@ws-ui/ui-components 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10515,7 +10515,7 @@ const Q2 = /* @__PURE__ */ _o(function(t) {
10515
10515
  scrollAdjustedTranslate: null
10516
10516
  }), ne = j.getNodeFor((r = F.current.over) == null ? void 0 : r.id), P = L2({
10517
10517
  measure: D.dragOverlay.measure
10518
- }), ue = (n = P.nodeRef.current) != null ? n : O, we = R ? (i = P.rect) != null ? i : _ : null, Ee = !!(P.nodeRef.current && P.rect), xe = V2(Ee ? null : _), Ne = Pi(ue ? tt(ue) : null), Ie = O2(R ? ne ?? O : null), De = F2(Ie), rt = ji(g, {
10518
+ }), ue = (n = P.nodeRef.current) != null ? n : O, we = R ? (i = P.rect) != null ? i : _ : null, Se = !!(P.nodeRef.current && P.rect), xe = V2(Se ? null : _), Ne = Pi(ue ? tt(ue) : null), Ie = O2(R ? ne ?? O : null), De = F2(Ie), rt = ji(g, {
10519
10519
  transform: {
10520
10520
  x: T.x - xe.x,
10521
10521
  y: T.y - xe.y,
@@ -10532,13 +10532,13 @@ const Q2 = /* @__PURE__ */ _o(function(t) {
10532
10532
  scrollableAncestors: Ie,
10533
10533
  scrollableAncestorRects: De,
10534
10534
  windowRect: Ne
10535
- }), Be = z ? Gt(z, T) : null, Re = k2(Ie), xt = q0(Re), Ct = q0(Re, [_]), Me = Gt(rt, xt), Pe = we ? i2(we, rt) : null, Ke = V && Pe ? h({
10535
+ }), Ee = z ? Gt(z, T) : null, Re = k2(Ie), xt = q0(Re), Ct = q0(Re, [_]), Me = Gt(rt, xt), Pe = we ? i2(we, rt) : null, Ke = V && Pe ? h({
10536
10536
  active: V,
10537
10537
  collisionRect: Pe,
10538
10538
  droppableRects: W,
10539
10539
  droppableContainers: Z,
10540
- pointerCoordinates: Be
10541
- }) : null, je = $s(Ke, "id"), [ot, kr] = le(null), Nr = Ee ? rt : Gt(rt, Ct), Tr = n2(Nr, (o = ot == null ? void 0 : ot.rect) != null ? o : null, _), Ft = re(null), ar = J(
10540
+ pointerCoordinates: Ee
10541
+ }) : null, je = $s(Ke, "id"), [ot, kr] = le(null), Nr = Se ? rt : Gt(rt, Ct), Tr = n2(Nr, (o = ot == null ? void 0 : ot.rect) != null ? o : null, _), Ft = re(null), ar = J(
10542
10542
  (ze, Ye) => {
10543
10543
  let {
10544
10544
  sensor: Ge,
@@ -10595,7 +10595,7 @@ const Q2 = /* @__PURE__ */ _o(function(t) {
10595
10595
  return;
10596
10596
  const {
10597
10597
  onDragStart: ye
10598
- } = q.current, Ze = {
10598
+ } = q.current, Be = {
10599
10599
  activatorEvent: qe,
10600
10600
  active: {
10601
10601
  id: mt,
@@ -10604,13 +10604,13 @@ const Q2 = /* @__PURE__ */ _o(function(t) {
10604
10604
  }
10605
10605
  };
10606
10606
  Pr(() => {
10607
- ye == null || ye(Ze), x(Bt.Initializing), A({
10607
+ ye == null || ye(Be), x(Bt.Initializing), A({
10608
10608
  type: Le.DragStart,
10609
10609
  initialCoordinates: Ve,
10610
10610
  active: mt
10611
10611
  }), b({
10612
10612
  type: "onDragStart",
10613
- event: Ze
10613
+ event: Be
10614
10614
  }), U(Ft.current), k(qe);
10615
10615
  });
10616
10616
  },
@@ -10629,7 +10629,7 @@ const Q2 = /* @__PURE__ */ _o(function(t) {
10629
10629
  const {
10630
10630
  active: ce,
10631
10631
  collisions: ye,
10632
- over: Ze,
10632
+ over: Be,
10633
10633
  scrollAdjustedTranslate: He
10634
10634
  } = F.current;
10635
10635
  let Oe = null;
@@ -10642,7 +10642,7 @@ const Q2 = /* @__PURE__ */ _o(function(t) {
10642
10642
  active: ce,
10643
10643
  collisions: ye,
10644
10644
  delta: He,
10645
- over: Ze
10645
+ over: Be
10646
10646
  }, Ve === Le.DragEnd && typeof Je == "function" && await Promise.resolve(Je(Oe)) && (Ve = Le.DragCancel);
10647
10647
  }
10648
10648
  H.current = null, Pr(() => {
@@ -10772,7 +10772,7 @@ const Q2 = /* @__PURE__ */ _o(function(t) {
10772
10772
  ...B,
10773
10773
  delta: T,
10774
10774
  draggingRect: Pe,
10775
- pointerCoordinates: Be,
10775
+ pointerCoordinates: Ee,
10776
10776
  scrollableAncestors: Ie,
10777
10777
  scrollableAncestorRects: De
10778
10778
  });
@@ -14257,7 +14257,7 @@ const ha = dt(null), We = () => {
14257
14257
  message: "text-s p-2.5",
14258
14258
  icon: "text-lg"
14259
14259
  }
14260
- }, Se = {
14260
+ }, Ze = {
14261
14261
  primary: {
14262
14262
  // Control
14263
14263
  control: "cursor-pointer bg-input-bg text-select-text",
@@ -14455,9 +14455,9 @@ const ha = dt(null), We = () => {
14455
14455
  isFocused: o,
14456
14456
  menuPlacement: l
14457
14457
  }) => {
14458
- const c = Se[i ? "negative" : t];
14458
+ const c = Ze[i ? "negative" : t];
14459
14459
  return S(
14460
- "bg-input-bg flex relative transition-all duration-200 ease-in-out items-center px-0.5",
14460
+ "bg-input-bg flex relative transition-all duration-200 ease-in-out items-center",
14461
14461
  o && l ? l === "top" ? "rounded-b" : "rounded-t" : "only:rounded first:rounded-t last:rounded-b",
14462
14462
  c.control,
14463
14463
  n ? ["ring-1", c.messageBorder] : [
@@ -14476,7 +14476,7 @@ const ha = dt(null), We = () => {
14476
14476
  isDisabled: r,
14477
14477
  isAction: n
14478
14478
  }) => {
14479
- const i = Se[t];
14479
+ const i = Ze[t];
14480
14480
  return S(
14481
14481
  "transition-colors duration-200 rounded max-h-full h-fit px-0.5",
14482
14482
  ke[e].icon,
@@ -14498,7 +14498,7 @@ const ha = dt(null), We = () => {
14498
14498
  hasGroup: l,
14499
14499
  menuPlacement: s
14500
14500
  }) => {
14501
- const d = Se[i ? "negative" : t], h = n && s ? s === "top" ? "rounded-b" : "rounded-t" : "rounded";
14501
+ const d = Ze[i ? "negative" : t], h = n && s ? s === "top" ? "rounded-b" : "rounded-t" : "rounded";
14502
14502
  return l ? S(
14503
14503
  "flex items-center justify-between flex-1 min-w-0",
14504
14504
  ke[e].control,
@@ -14531,14 +14531,14 @@ const ha = dt(null), We = () => {
14531
14531
  }) => S(
14532
14532
  "bg-transparent border-0 outline-hidden flex-1 min-w-7.5 text-input-text",
14533
14533
  ke[e].input,
14534
- Se[t].placeholder
14534
+ Ze[t].placeholder
14535
14535
  ), Nd = ({
14536
14536
  size: e,
14537
14537
  color: t
14538
14538
  }) => S(
14539
14539
  "select-none truncate",
14540
14540
  ke[e].placeholder,
14541
- Se[t].placeholder
14541
+ Ze[t].placeholder
14542
14542
  ), Td = ({
14543
14543
  size: e,
14544
14544
  color: t,
@@ -14546,7 +14546,7 @@ const ha = dt(null), We = () => {
14546
14546
  }) => S(
14547
14547
  "truncate",
14548
14548
  ke[e].singleValue,
14549
- r ? Se[t].singleValueDisabled : Se[t].singleValue
14549
+ r ? Ze[t].singleValueDisabled : Ze[t].singleValue
14550
14550
  ), Fd = ({
14551
14551
  size: e,
14552
14552
  color: t,
@@ -14555,7 +14555,7 @@ const ha = dt(null), We = () => {
14555
14555
  }) => S(
14556
14556
  "inline-flex items-center rounded-xs",
14557
14557
  ke[e].multiValue,
14558
- r ? Se[t].multiValueDisabled : Se[t].multiValue,
14558
+ r ? Ze[t].multiValueDisabled : Ze[t].multiValue,
14559
14559
  {
14560
14560
  "border border-white": n && !r
14561
14561
  }
@@ -14568,7 +14568,7 @@ const ha = dt(null), We = () => {
14568
14568
  }) => S(
14569
14569
  "flex items-center justify-center cursor-pointer transition-colors",
14570
14570
  ke[e].multiValueRemove,
14571
- Se[t].multiValueRemove
14571
+ Ze[t].multiValueRemove
14572
14572
  ), va = ({
14573
14573
  size: e,
14574
14574
  color: t,
@@ -14577,8 +14577,8 @@ const ha = dt(null), We = () => {
14577
14577
  "flex items-center justify-center transition-colors rounded",
14578
14578
  ke[e].clearIndicator,
14579
14579
  r ? "hidden" : [
14580
- Se[t].clearIndicator,
14581
- Se[t].clearIndicatorHover
14580
+ Ze[t].clearIndicator,
14581
+ Ze[t].clearIndicatorHover
14582
14582
  ]
14583
14583
  ), zd = ({
14584
14584
  size: e,
@@ -14588,8 +14588,8 @@ const ha = dt(null), We = () => {
14588
14588
  "flex items-center justify-center transition-colors rounded",
14589
14589
  ke[e].dropdownIndicator,
14590
14590
  r ? "text-grey-200" : [
14591
- Se[t].dropdownIndicator,
14592
- Se[t].dropdownIndicatorHover
14591
+ Ze[t].dropdownIndicator,
14592
+ Ze[t].dropdownIndicatorHover
14593
14593
  ]
14594
14594
  ), _d = ({
14595
14595
  size: e,
@@ -14605,9 +14605,9 @@ const ha = dt(null), We = () => {
14605
14605
  // w-full would only cover the content-box (W-2px). Using -left-px/-right-px
14606
14606
  // stretches the menu to cover SelectGroup's full border-box instead.
14607
14607
  i ? "-left-px -right-px" : "w-full",
14608
- Se[n].menu,
14608
+ Ze[n].menu,
14609
14609
  {
14610
- [Se[n].messageBorder]: r
14610
+ [Ze[n].messageBorder]: r
14611
14611
  },
14612
14612
  o ? "bottom-full rounded-t rounded-b-none border-b-0" : "top-full rounded-b border-t-0",
14613
14613
  ke[e].menu
@@ -14615,7 +14615,7 @@ const ha = dt(null), We = () => {
14615
14615
  }, Wd = ({ size: e }) => S(
14616
14616
  "overflow-y-auto",
14617
14617
  ke[e].menuList,
14618
- Se.primary.menuList
14618
+ Ze.primary.menuList
14619
14619
  ), jd = ({
14620
14620
  size: e,
14621
14621
  color: t,
@@ -14626,28 +14626,28 @@ const ha = dt(null), We = () => {
14626
14626
  "transition-colors duration-150 cursor-pointer mx-1 rounded flex items-center gap-2",
14627
14627
  ke[e].option,
14628
14628
  {
14629
- [Se[t].optionDisabled]: r,
14630
- [Se[t].optionSelected]: i && !r,
14631
- [Se[t].optionFocused]: n && !i && !r,
14632
- [Se[t].option]: !i && !n && !r
14629
+ [Ze[t].optionDisabled]: r,
14630
+ [Ze[t].optionSelected]: i && !r,
14631
+ [Ze[t].optionFocused]: n && !i && !r,
14632
+ [Ze[t].option]: !i && !n && !r
14633
14633
  }
14634
14634
  ), Kd = ({ size: e }) => S(ke[e].group), Yd = ({
14635
14635
  size: e,
14636
14636
  color: t
14637
- }) => S(ke[e].groupHeading, Se[t].groupHeading), Xd = ({
14637
+ }) => S(ke[e].groupHeading, Ze[t].groupHeading), Xd = ({
14638
14638
  size: e
14639
14639
  }) => S("text-grey-100", ke[e].loadingMessage), Qd = ({
14640
14640
  size: e
14641
14641
  }) => S(
14642
14642
  ke[e].noOptionsMessage,
14643
- Se.primary.noOptionsMessage
14643
+ Ze.primary.noOptionsMessage
14644
14644
  ), Gd = ({
14645
14645
  size: e,
14646
14646
  color: t,
14647
14647
  isInvalid: r,
14648
14648
  isDisabled: n
14649
14649
  }) => {
14650
- const o = Se[r ? "negative" : t];
14650
+ const o = Ze[r ? "negative" : t];
14651
14651
  return S(
14652
14652
  "absolute left-0 right-0 z-10",
14653
14653
  "flex items-start gap-x-2 ring-1",
@@ -15469,15 +15469,15 @@ function s4() {
15469
15469
  case u:
15470
15470
  return we;
15471
15471
  default:
15472
- var Ee = we && we.$$typeof;
15473
- switch (Ee) {
15472
+ var Se = we && we.$$typeof;
15473
+ switch (Se) {
15474
15474
  case s:
15475
15475
  case l:
15476
15476
  case c:
15477
15477
  case v:
15478
15478
  case h:
15479
15479
  case o:
15480
- return Ee;
15480
+ return Se;
15481
15481
  default:
15482
15482
  return ue;
15483
15483
  }
@@ -16993,7 +16993,7 @@ function Qt(e) {
16993
16993
  P.isOpen && !R.isMouseDown && s({
16994
16994
  type: Sn
16995
16995
  });
16996
- }, Ee = function(Ie) {
16996
+ }, Se = function(Ie) {
16997
16997
  var De = Jt(Ie);
16998
16998
  De && I[De] ? I[De](Ie) : H4(De) && s({
16999
16999
  type: Zn,
@@ -17002,13 +17002,13 @@ function Qt(e) {
17002
17002
  }, xe = ae((D = {}, D[B] = ht(X, function(Ne) {
17003
17003
  v.current = Ne;
17004
17004
  }), D["aria-activedescendant"] = P.isOpen && P.highlightedIndex > -1 ? f.getItemId(P.highlightedIndex) : "", D["aria-controls"] = f.menuId, D["aria-expanded"] = A.current.state.isOpen, D["aria-haspopup"] = "listbox", D["aria-labelledby"] = _ && _["aria-label"] ? void 0 : "" + f.labelId, D.id = f.toggleButtonId, D.role = "combobox", D.tabIndex = 0, D.onBlur = fe(N, we), D), _);
17005
- return _.disabled || (xe.onClick = fe(K, ue), xe.onKeyDown = fe(O, Ee)), E("getToggleButtonProps", ne, B, v), xe;
17005
+ return _.disabled || (xe.onClick = fe(K, ue), xe.onKeyDown = fe(O, Se)), E("getToggleButtonProps", ne, B, v), xe;
17006
17006
  }, [s, f, A, R, E, I]), q = J(function(C) {
17007
17007
  var Z, D = C === void 0 ? {} : C, W = D.item, N = D.index, K = D.onMouseMove, O = D.onClick, z = D.onMouseDown;
17008
17008
  D.onPress;
17009
17009
  var B = D.refKey, X = B === void 0 ? "ref" : B, _ = D.disabled, $ = D.ref, F = et(D, P4);
17010
17010
  _ !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');
17011
- var ne = A.current, P = ne.state, ue = ne.props, we = k1(W, N, ue.items, "Pass either item or index to getItemProps!"), Ee = we[0], xe = we[1], Ne = ue.isItemDisabled(Ee, xe), Ie = function() {
17011
+ var ne = A.current, P = ne.state, ue = ne.props, we = k1(W, N, ue.items, "Pass either item or index to getItemProps!"), Se = we[0], xe = we[1], Ne = ue.isItemDisabled(Se, xe), Ie = function() {
17012
17012
  R.isTouchEnd || xe === P.highlightedIndex || (m.current = !1, s({
17013
17013
  type: Qa,
17014
17014
  index: xe,
@@ -17021,10 +17021,10 @@ function Qt(e) {
17021
17021
  });
17022
17022
  }, rt = function(xt) {
17023
17023
  return xt.preventDefault();
17024
- }, Be = ae((Z = {}, Z[X] = ht($, function(Re) {
17024
+ }, Ee = ae((Z = {}, Z[X] = ht($, function(Re) {
17025
17025
  Re && (y.current[f.getItemId(xe)] = Re);
17026
- }), Z["aria-disabled"] = Ne, Z["aria-selected"] = Ee === P.selectedItem, Z.id = f.getItemId(xe), Z.role = "option", Z), F);
17027
- return Ne || (Be.onClick = fe(O, De)), Be.onMouseMove = fe(K, Ie), Be.onMouseDown = fe(z, rt), Be;
17026
+ }), Z["aria-disabled"] = Ne, Z["aria-selected"] = Se === P.selectedItem, Z.id = f.getItemId(xe), Z.role = "option", Z), F);
17027
+ return Ne || (Ee.onClick = fe(O, De)), Ee.onMouseMove = fe(K, Ie), Ee.onMouseDown = fe(z, rt), Ee;
17028
17028
  }, [A, f, R, m, s]);
17029
17029
  return {
17030
17030
  // prop getters.
@@ -17314,28 +17314,28 @@ function At(e) {
17314
17314
  }, [c, j, b]), H = J(function(N) {
17315
17315
  var K, O, z = N === void 0 ? {} : N, B = z.item, X = z.index, _ = z.refKey, $ = _ === void 0 ? "ref" : _, F = z.ref, ne = z.onMouseMove, P = z.onMouseDown, ue = z.onClick;
17316
17316
  z.onPress;
17317
- var we = z.disabled, Ee = et(z, X4);
17317
+ var we = z.disabled, Se = et(z, X4);
17318
17318
  we !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');
17319
- var xe = w.current, Ne = xe.props, Ie = xe.state, De = k1(B, X, Ne.items, "Pass either item or index to getItemProps!"), rt = De[0], Be = De[1], Re = Ne.isItemDisabled(rt, Be), xt = "onClick", Ct = ue, Me = function() {
17320
- T.isTouchEnd || Be === Ie.highlightedIndex || (R.current = !1, c({
17319
+ var xe = w.current, Ne = xe.props, Ie = xe.state, De = k1(B, X, Ne.items, "Pass either item or index to getItemProps!"), rt = De[0], Ee = De[1], Re = Ne.isItemDisabled(rt, Ee), xt = "onClick", Ct = ue, Me = function() {
17320
+ T.isTouchEnd || Ee === Ie.highlightedIndex || (R.current = !1, c({
17321
17321
  type: r5,
17322
- index: Be,
17322
+ index: Ee,
17323
17323
  disabled: Re
17324
17324
  }));
17325
17325
  }, Pe = function() {
17326
17326
  c({
17327
17327
  type: i0,
17328
- index: Be
17328
+ index: Ee
17329
17329
  });
17330
17330
  }, Ke = function(ot) {
17331
17331
  return ot.preventDefault();
17332
17332
  };
17333
17333
  return ae((K = {}, K[$] = ht(F, function(je) {
17334
- je && (y.current[b.getItemId(Be)] = je);
17335
- }), K["aria-disabled"] = Re, K["aria-selected"] = Be === Ie.highlightedIndex, K.id = b.getItemId(Be), K.role = "option", K), !Re && (O = {}, O[xt] = fe(Ct, Pe), O), {
17334
+ je && (y.current[b.getItemId(Ee)] = je);
17335
+ }), K["aria-disabled"] = Re, K["aria-selected"] = Ee === Ie.highlightedIndex, K.id = b.getItemId(Ee), K.role = "option", K), !Re && (O = {}, O[xt] = fe(Ct, Pe), O), {
17336
17336
  onMouseMove: fe(ne, Me),
17337
17337
  onMouseDown: fe(P, Ke)
17338
- }, Ee);
17338
+ }, Se);
17339
17339
  }, [c, b, w, T, R]), G = J(function(N) {
17340
17340
  var K, O = N === void 0 ? {} : N, z = O.onClick;
17341
17341
  O.onPress;
@@ -17352,7 +17352,7 @@ function At(e) {
17352
17352
  }, [c, w, b]), U = J(function(N, K) {
17353
17353
  var O, z = N === void 0 ? {} : N, B = z.onKeyDown, X = z.onChange, _ = z.onInput, $ = z.onBlur;
17354
17354
  z.onChangeText;
17355
- var F = z.onClick, ne = z.refKey, P = ne === void 0 ? "ref" : ne, ue = z.ref, we = et(z, G4), Ee = K === void 0 ? {} : K, xe = Ee.suppressRefError, Ne = xe === void 0 ? !1 : xe;
17355
+ var F = z.onClick, ne = z.refKey, P = ne === void 0 ? "ref" : ne, ue = z.ref, we = et(z, G4), Se = K === void 0 ? {} : K, xe = Se.suppressRefError, Ne = xe === void 0 ? !1 : xe;
17356
17356
  j("getInputProps", Ne, P, p);
17357
17357
  var Ie = w.current.state, De = function(Ke) {
17358
17358
  var je = Jt(Ke);
@@ -17362,7 +17362,7 @@ function At(e) {
17362
17362
  type: n0,
17363
17363
  inputValue: Ke.target.value
17364
17364
  });
17365
- }, Be = function(Ke) {
17365
+ }, Ee = function(Ke) {
17366
17366
  if (i != null && i.document && Ie.isOpen && !T.isMouseDown) {
17367
17367
  var je = Ke.relatedTarget === null && i.document.activeElement !== i.document.body;
17368
17368
  c({
@@ -17377,7 +17377,7 @@ function At(e) {
17377
17377
  }, xt = "onChange", Ct = {};
17378
17378
  if (!we.disabled) {
17379
17379
  var Me;
17380
- Ct = (Me = {}, Me[xt] = fe(X, _, rt), Me.onKeyDown = fe(B, De), Me.onBlur = fe($, Be), Me.onClick = fe(F, Re), Me);
17380
+ Ct = (Me = {}, Me[xt] = fe(X, _, rt), Me.onKeyDown = fe(B, De), Me.onBlur = fe($, Ee), Me.onClick = fe(F, Re), Me);
17381
17381
  }
17382
17382
  return ae((O = {}, O[P] = ht(ue, function(Pe) {
17383
17383
  p.current = Pe;
@@ -18485,26 +18485,25 @@ const ou = (e) => {
18485
18485
  isOpen: P,
18486
18486
  openMenu: ue,
18487
18487
  selectedItem: we,
18488
- inputValue: Ee,
18488
+ inputValue: Se,
18489
18489
  highlightedIndex: xe,
18490
18490
  getToggleButtonProps: Ne,
18491
18491
  getMenuProps: Ie,
18492
18492
  getInputProps: De,
18493
18493
  getItemProps: rt,
18494
- isMulti: Be,
18494
+ isMulti: Ee,
18495
18495
  isSearchable: Re,
18496
18496
  multipleSelection: xt
18497
18497
  } = C, { getDropdownProps: Ct } = xt;
18498
18498
  Ut(() => {
18499
- if (P && $.current && F.current) {
18500
- const ce = $.current.getBoundingClientRect(), ye = F.current.getBoundingClientRect().height, Ze = window.innerHeight - ce.bottom;
18501
- O(Ze < ye ? "top" : "bottom");
18502
- }
18499
+ if (!P || !$.current) return;
18500
+ const ce = $.current.getBoundingClientRect(), ye = window.innerHeight - ce.bottom;
18501
+ O(ye < 300 ? "top" : "bottom");
18503
18502
  }, [P, O]), Ut(() => {
18504
18503
  const ce = P && !(r && C.filteredItems.length === 0);
18505
18504
  return B(ce), () => B(!1);
18506
18505
  }, [P, r, C.filteredItems.length, B]);
18507
- const Me = Be ? C.selectedItems ?? [] : we ? [we] : [], Pe = Me.length > 0, Ke = o && !k && !c, je = i && Pe && !k && !c, ot = !d && !c, kr = !Pe && (!Re || !Ee) || !w, Nr = {}, Tr = {};
18506
+ const Me = Ee ? C.selectedItems ?? [] : we ? [we] : [], Pe = Me.length > 0, Ke = o && !k && !c, je = i && Pe && !k && !c, ot = !d && !c, kr = !Pe && (!Re || !Se) || !w, Nr = {}, Tr = {};
18508
18507
  Object.entries(H).forEach(([ce, ye]) => {
18509
18508
  ce.startsWith("data-") || ce.startsWith("aria-") || ce === "role" ? Nr[ce] = ye : Tr[ce] = ye;
18510
18509
  });
@@ -18560,8 +18559,8 @@ const ou = (e) => {
18560
18559
  ce.stopPropagation(), Re ? ue() : Re || C.toggleMenu();
18561
18560
  },
18562
18561
  children: [
18563
- L || /* @__PURE__ */ M(au, { isMulti: Be, children: [
18564
- Be && w && Me.map((ce, ye) => /* @__PURE__ */ a(
18562
+ L || /* @__PURE__ */ M(au, { isMulti: Ee, children: [
18563
+ Ee && w && Me.map((ce, ye) => /* @__PURE__ */ a(
18565
18564
  A0,
18566
18565
  {
18567
18566
  data: ce,
@@ -18571,7 +18570,7 @@ const ou = (e) => {
18571
18570
  },
18572
18571
  W(ce)
18573
18572
  )),
18574
- !Be && Pe && w && !Re && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a(
18573
+ !Ee && Pe && w && !Re && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a(
18575
18574
  su,
18576
18575
  {
18577
18576
  data: Me[0],
@@ -18662,7 +18661,7 @@ const ou = (e) => {
18662
18661
  ...lr,
18663
18662
  autoFocus: !0,
18664
18663
  placeholder: e,
18665
- onClick: (Ze) => Ze.stopPropagation()
18664
+ onClick: (Be) => Be.stopPropagation()
18666
18665
  }
18667
18666
  ) }),
18668
18667
  /* @__PURE__ */ a(
@@ -18670,11 +18669,11 @@ const ou = (e) => {
18670
18669
  {
18671
18670
  ref: ne,
18672
18671
  totalHeight: Xe ? ut.getTotalSize() : void 0,
18673
- children: l ? /* @__PURE__ */ a("div", { className: Xd({ size: U }), children: n }) : C.filteredItems.length === 0 ? /* @__PURE__ */ a(o1, { inputValue: Ee, children: typeof t == "function" ? t(Ee) : t }) : d1(Z) ? (() => {
18674
- const Ze = Ge(
18672
+ children: l ? /* @__PURE__ */ a("div", { className: Xd({ size: U }), children: n }) : C.filteredItems.length === 0 ? /* @__PURE__ */ a(o1, { inputValue: Se, children: typeof t == "function" ? t(Se) : t }) : d1(Z) ? (() => {
18673
+ const Be = Ge(
18675
18674
  Z
18676
18675
  );
18677
- return Ze.length === 0 ? /* @__PURE__ */ a(o1, { inputValue: Ee, children: typeof t == "function" ? t(Ee) : t }) : Ze.map((He) => /* @__PURE__ */ a(
18676
+ return Be.length === 0 ? /* @__PURE__ */ a(o1, { inputValue: Se, children: typeof t == "function" ? t(Se) : t }) : Be.map((He) => /* @__PURE__ */ a(
18678
18677
  I0,
18679
18678
  {
18680
18679
  data: He,
@@ -18708,8 +18707,8 @@ const ou = (e) => {
18708
18707
  },
18709
18708
  He.label
18710
18709
  ));
18711
- })() : Ue.length === 0 ? /* @__PURE__ */ a(o1, { inputValue: Ee, children: typeof t == "function" ? t(Ee) : t }) : Xe ? ut.getVirtualItems().map((Ze) => {
18712
- const He = Ue[Ze.index], Oe = W(He), Je = Me.some(
18710
+ })() : Ue.length === 0 ? /* @__PURE__ */ a(o1, { inputValue: Se, children: typeof t == "function" ? t(Se) : t }) : Xe ? ut.getVirtualItems().map((Be) => {
18711
+ const He = Ue[Be.index], Oe = W(He), Je = Me.some(
18713
18712
  (It) => W(It) === Oe
18714
18713
  ), lt = C.filteredItems.findIndex(
18715
18714
  (It) => W(It) === Oe
@@ -18721,14 +18720,14 @@ const ou = (e) => {
18721
18720
  return /* @__PURE__ */ a(
18722
18721
  "div",
18723
18722
  {
18724
- "data-index": Ze.index,
18723
+ "data-index": Be.index,
18725
18724
  ref: ut.measureElement,
18726
18725
  style: {
18727
18726
  position: "absolute",
18728
18727
  top: 0,
18729
18728
  left: 0,
18730
18729
  width: "100%",
18731
- transform: `translateY(${Ze.start}px)`
18730
+ transform: `translateY(${Be.start}px)`
18732
18731
  },
18733
18732
  children: /* @__PURE__ */ a(
18734
18733
  hn,
@@ -18743,28 +18742,28 @@ const ou = (e) => {
18743
18742
  }
18744
18743
  )
18745
18744
  },
18746
- Ze.key
18745
+ Be.key
18747
18746
  );
18748
- }) : Ue.map((Ze) => {
18749
- const He = W(Ze), Oe = Me.some(
18747
+ }) : Ue.map((Be) => {
18748
+ const He = W(Be), Oe = Me.some(
18750
18749
  (It) => W(It) === He
18751
18750
  ), Je = C.filteredItems.findIndex(
18752
18751
  (It) => W(It) === He
18753
- ), lt = xe === Je, Mt = N(Ze), Pt = rt({
18754
- item: Ze,
18752
+ ), lt = xe === Je, Mt = N(Be), Pt = rt({
18753
+ item: Be,
18755
18754
  index: Je,
18756
- onClick: () => Ve(Ze)
18755
+ onClick: () => Ve(Be)
18757
18756
  });
18758
18757
  return /* @__PURE__ */ a(
18759
18758
  hn,
18760
18759
  {
18761
18760
  ...Pt,
18762
- data: Ze,
18761
+ data: Be,
18763
18762
  isDisabled: Mt,
18764
18763
  isFocused: lt,
18765
18764
  isSelected: Oe,
18766
18765
  optionClassName: f,
18767
- children: p ? p({ data: Ze, isFocused: lt, isSelected: Oe, isDisabled: Mt }) : void 0
18766
+ children: p ? p({ data: Be, isFocused: lt, isSelected: Oe, isDisabled: Mt }) : void 0
18768
18767
  },
18769
18768
  He
18770
18769
  );
package/dist/qodly.svg CHANGED
@@ -1,14 +1,14 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
3
- <path fill="url(#a)" d="M.377 5.77A5.394 5.394 0 0 1 5.77.377h13.213a5.394 5.394 0 0 1 5.394 5.393v13.213a5.394 5.394 0 0 1-5.394 5.394H5.77a5.394 5.394 0 0 1-5.393-5.394V5.77Z" />
4
- <path fill="#fff" d="m14.45 15.919 1.602 2.913h2.819l-1.47-2.535c1.253-1.425 1.442-3.13 1.442-3.13h-2.351s-.342 1.749-2.042 2.752Z" />
5
- <path fill="#fff" d="M18.843 12.322h-2.229c.04-1.872-.893-3.068-1.676-3.684-1.162-.948-2.564-.962-2.564-.962-1.726-.034-2.762.739-3.35 1.318a4.43 4.43 0 0 0-1.285 3.323c.062 1.977 1.51 3.656 3.39 4.111.464.111.712.11.866.126.93.016 1.214.018 1.845.018l1.247 2.262h-2.809c-4.192-.053-6.117-3.118-6.593-4.995-.443-1.595-.06-3.131-.06-3.131.711-3.119 3.492-5.334 6.807-5.237.372.047 2.448.013 4.457 1.922.995.994 1.985 2.569 1.954 4.93Z" />
6
- <defs>
7
- <linearGradient id="a" x1="29.54" x2="15.21" y1="28.58" y2="-1.402" gradientUnits="userSpaceOnUse">
8
- <stop stop-color="#2743A6" />
9
- <stop offset=".46" stop-color="#8F1AEB" />
10
- <stop offset=".734" stop-color="#C860D5" />
11
- <stop offset="1" stop-color="#FFA4C0" />
12
- </linearGradient>
13
- </defs>
14
- </svg>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
3
+ <path fill="url(#a)" d="M.377 5.77A5.394 5.394 0 0 1 5.77.377h13.213a5.394 5.394 0 0 1 5.394 5.393v13.213a5.394 5.394 0 0 1-5.394 5.394H5.77a5.394 5.394 0 0 1-5.393-5.394V5.77Z" />
4
+ <path fill="#fff" d="m14.45 15.919 1.602 2.913h2.819l-1.47-2.535c1.253-1.425 1.442-3.13 1.442-3.13h-2.351s-.342 1.749-2.042 2.752Z" />
5
+ <path fill="#fff" d="M18.843 12.322h-2.229c.04-1.872-.893-3.068-1.676-3.684-1.162-.948-2.564-.962-2.564-.962-1.726-.034-2.762.739-3.35 1.318a4.43 4.43 0 0 0-1.285 3.323c.062 1.977 1.51 3.656 3.39 4.111.464.111.712.11.866.126.93.016 1.214.018 1.845.018l1.247 2.262h-2.809c-4.192-.053-6.117-3.118-6.593-4.995-.443-1.595-.06-3.131-.06-3.131.711-3.119 3.492-5.334 6.807-5.237.372.047 2.448.013 4.457 1.922.995.994 1.985 2.569 1.954 4.93Z" />
6
+ <defs>
7
+ <linearGradient id="a" x1="29.54" x2="15.21" y1="28.58" y2="-1.402" gradientUnits="userSpaceOnUse">
8
+ <stop stop-color="#2743A6" />
9
+ <stop offset=".46" stop-color="#8F1AEB" />
10
+ <stop offset=".734" stop-color="#C860D5" />
11
+ <stop offset="1" stop-color="#FFA4C0" />
12
+ </linearGradient>
13
+ </defs>
14
+ </svg>