@oliasoft-open-source/react-ui-library 10.0.0-beta-36 → 10.0.0-beta-38

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.
Files changed (2) hide show
  1. package/dist/index.js +117 -117
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2794,27 +2794,32 @@ var Lo = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ro =
2794
2794
  textValue: r,
2795
2795
  searchText: r.toLowerCase()
2796
2796
  };
2797
- }, Ic = (e) => Pr(e) ? [] : Array.isArray(e) ? e.map(String) : [String(e)], Lc = ({ options: e, selectedOptions: t, onChange: n, onCreate: r, isMulti: i, small: a, width: o = null, autoLayerWidth: s = !1, placeholder: c = "", closeOnOptionActionClick: l, searchable: d = !0 }) => {
2798
- let f = !!r, p = lc(), m = v(null), h = v(!1), [_, b] = y(!1), x = g(() => e.map((e, t) => Fc(e, t)), [e]), { searchValue: S, committedFilter: C, isFilterPending: w, onChangeSearch: T, resetSearchState: E } = Pc({
2797
+ }, Ic = (e) => Pr(e) ? [] : Array.isArray(e) ? e.map(String) : [String(e)], Lc = ({ options: e, onCreate: t, onChange: n, selectedOptions: r, width: i = null, small: a, placeholder: o = "", autoLayerWidth: s = !1, isMulti: c, closeOnOptionActionClick: l, searchable: d = !0 }) => {
2798
+ let f = !!t, p = lc(), m = v(null), h = v(!1), [_, b] = y(!1), x = g(() => e.map((e, t) => Fc(e, t)), [e]), { searchValue: S, committedFilter: C, isFilterPending: w, onChangeSearch: T, resetSearchState: E } = Pc({
2799
2799
  optionsCount: x.length,
2800
2800
  comboBoxStateRef: m
2801
- }), D = u((e) => {
2801
+ }), D = u(() => {
2802
+ if (l) {
2803
+ var e;
2804
+ (e = m.current) == null || e.close();
2805
+ }
2806
+ }, [l]), O = u((e) => {
2802
2807
  b(e), e || E();
2803
- }, [E]), O = o === "auto" || s, k = g(() => O ? Ec(e, a, p, c == null ? "" : c) : 0, [
2804
- O,
2808
+ }, [E]), k = i === "auto" || s, A = g(() => k ? Ec(e, a, p, o == null ? "" : o) : 0, [
2809
+ k,
2805
2810
  e,
2806
2811
  a,
2807
2812
  p,
2808
- c
2809
- ]), A = u(() => o ? o === "auto" ? k : o : "100%", [o, k]), j = u((e) => {
2813
+ o
2814
+ ]), j = u(() => i ? i === "auto" ? A : i : "100%", [i, A]), M = u((e) => {
2810
2815
  var t;
2811
- let n = A(), r = (t = e == null ? void 0 : e.getBoundingClientRect().width) == null ? typeof n == "number" ? n : 0 : t;
2812
- return s ? Math.max(k, r) : r;
2816
+ let n = j(), r = (t = e == null ? void 0 : e.getBoundingClientRect().width) == null ? typeof n == "number" ? n : 0 : t;
2817
+ return s ? Math.max(A, r) : r;
2813
2818
  }, [
2814
2819
  s,
2815
- k,
2816
- A
2817
- ]), M = g(() => {
2820
+ A,
2821
+ j
2822
+ ]), N = g(() => {
2818
2823
  if (d && w && !C.trim()) return [];
2819
2824
  let e = d ? C.trim().toLowerCase() : "", t = e ? x.filter((t) => t.searchText.includes(e)) : x;
2820
2825
  return f && e ? [...t, {
@@ -2830,111 +2835,106 @@ var Lo = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ro =
2830
2835
  f,
2831
2836
  d,
2832
2837
  w
2833
- ]), N = g(() => {
2838
+ ]), P = g(() => {
2834
2839
  let e = /* @__PURE__ */ new Map();
2835
2840
  for (let t of x) e.set(t.id, t);
2836
2841
  return e;
2837
- }, [x]), P = g(() => {
2838
- if (i) return (Array.isArray(t) ? t : []).filter((e) => e && !Pr(e.value)).map((e) => String(e.value));
2839
- let e = Array.isArray(t) ? t[0] : t;
2842
+ }, [x]), F = g(() => {
2843
+ if (c) return (Array.isArray(r) ? r : []).filter((e) => e && !Pr(e.value)).map((e) => String(e.value));
2844
+ let e = Array.isArray(r) ? r[0] : r;
2840
2845
  return Pr(e == null ? void 0 : e.value) ? null : String(e.value);
2841
- }, [i, t]), F = g(() => {
2842
- if (i) {
2843
- let e = Array.isArray(t) ? t[0] : null;
2846
+ }, [c, r]), I = g(() => {
2847
+ if (c) {
2848
+ let e = Array.isArray(r) ? r[0] : null;
2844
2849
  return Pr(e == null ? void 0 : e.value) ? null : String(e.value);
2845
2850
  }
2846
- return P;
2851
+ return F;
2847
2852
  }, [
2848
- P,
2849
- i,
2850
- t
2851
- ]), I = u((e) => {
2853
+ F,
2854
+ c,
2855
+ r
2856
+ ]), L = u((e) => {
2852
2857
  n == null || n({ target: {} }, e);
2853
- }, [n]), L = u((e = S) => {
2854
- if (!(!r || !e) && (h.current = !0, r(e), E(), !i)) {
2855
- var t;
2856
- (t = m.current) == null || t.close();
2858
+ }, [n]), R = u((e = S) => {
2859
+ if (!(!t || !e) && (h.current = !0, t(e), E(), !c)) {
2860
+ var n;
2861
+ (n = m.current) == null || n.close();
2857
2862
  }
2858
2863
  }, [
2859
2864
  S,
2860
- i,
2861
- r,
2865
+ c,
2866
+ t,
2862
2867
  E
2863
- ]);
2864
- return {
2865
- searchValue: S,
2866
- onChangeSearch: T,
2867
- isOpen: _,
2868
- setIsOpen: D,
2869
- visibleOptions: M,
2870
- comboValue: P,
2871
- selectedItemId: F,
2872
- getTriggerWidth: A,
2873
- getLayerWidth: j,
2874
- handleChange: u((e) => {
2875
- if (E(), i) {
2876
- let t = Ic(e);
2877
- if (t.includes("create")) {
2878
- L();
2879
- return;
2880
- }
2881
- let n = Array.isArray(P) ? P : [];
2882
- if (t.length === n.length && t.every((e) => n.includes(e))) return;
2883
- let r = t.map((e) => N.get(e)).filter((e) => !Pr(e) && e.type !== $a.HEADING).map((e) => ({
2884
- value: e.value,
2885
- label: e.label,
2886
- details: e.details,
2887
- icon: e.icon,
2888
- actions: e.actions,
2889
- testId: e.testId
2890
- }));
2891
- I(r);
2892
- return;
2893
- }
2894
- let t = Array.isArray(e) ? e[0] : e;
2895
- if (Pr(t)) {
2896
- if (h.current) {
2897
- h.current = !1;
2898
- return;
2899
- }
2900
- I({ value: null });
2868
+ ]), z = u((e) => {
2869
+ if (E(), c) {
2870
+ let t = Ic(e);
2871
+ if (t.includes("create")) {
2872
+ R();
2901
2873
  return;
2902
2874
  }
2903
- if (String(t) === "create") {
2904
- L();
2875
+ let n = Array.isArray(F) ? F : [];
2876
+ if (t.length === n.length && t.every((e) => n.includes(e))) return;
2877
+ let r = t.map((e) => P.get(e)).filter((e) => !Pr(e) && e.type !== $a.HEADING).map((e) => ({
2878
+ value: e.value,
2879
+ label: e.label,
2880
+ details: e.details,
2881
+ icon: e.icon,
2882
+ actions: e.actions,
2883
+ testId: e.testId
2884
+ }));
2885
+ L(r);
2886
+ return;
2887
+ }
2888
+ let t = Array.isArray(e) ? e[0] : e;
2889
+ if (Pr(t)) {
2890
+ if (h.current) {
2891
+ h.current = !1;
2905
2892
  return;
2906
2893
  }
2907
- if (String(t) === P) return;
2908
- let n = N.get(String(t));
2909
- !n || n.type === $a.HEADING || n.disabled || n.createAble || I({
2910
- value: n.value,
2911
- label: n.label,
2912
- details: n.details,
2913
- icon: n.icon,
2914
- actions: n.actions,
2915
- testId: n.testId
2916
- });
2917
- }, [
2918
- E,
2919
- P,
2920
- I,
2921
- L,
2922
- i,
2923
- N
2924
- ]),
2894
+ L({ value: null });
2895
+ return;
2896
+ }
2897
+ if (String(t) === "create") {
2898
+ R();
2899
+ return;
2900
+ }
2901
+ if (String(t) === F) return;
2902
+ let n = P.get(String(t));
2903
+ !n || n.type === $a.HEADING || n.disabled || n.createAble || L({
2904
+ value: n.value,
2905
+ label: n.label,
2906
+ details: n.details,
2907
+ icon: n.icon,
2908
+ actions: n.actions,
2909
+ testId: n.testId
2910
+ });
2911
+ }, [
2912
+ E,
2913
+ F,
2914
+ L,
2915
+ R,
2916
+ c,
2917
+ P
2918
+ ]);
2919
+ return {
2920
+ getTriggerWidth: j,
2921
+ onChangeSearch: T,
2925
2922
  onClickClearAll: u(() => {
2926
- E(), I(i ? [] : { value: null });
2923
+ E(), L(c ? [] : { value: null });
2927
2924
  }, [
2928
2925
  E,
2929
- I,
2930
- i
2926
+ L,
2927
+ c
2931
2928
  ]),
2932
- closeLayer: u(() => {
2933
- if (l) {
2934
- var e;
2935
- (e = m.current) == null || e.close();
2936
- }
2937
- }, [l]),
2929
+ closeLayer: D,
2930
+ handleChange: z,
2931
+ getLayerWidth: M,
2932
+ searchValue: S,
2933
+ isOpen: _,
2934
+ setIsOpen: O,
2935
+ visibleOptions: N,
2936
+ comboValue: F,
2937
+ selectedItemId: I,
2938
2938
  comboBoxStateRef: m
2939
2939
  };
2940
2940
  }, Rc = ({ items: e, optionsCount: t, selectedItemId: n, width: r, small: i, isMulti: a = !1, closeLayer: o, testId: s }) => {
@@ -3147,41 +3147,41 @@ var Lo = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ro =
3147
3147
  children: A
3148
3148
  }) });
3149
3149
  }, Wc = (e) => {
3150
- let { multi: t = !1, disabled: n = !1, error: r = null, warning: i = null, tooltip: a = null, options: o, selectedOptions: s, onChange: c, onCreate: l = null, placeholder: u = "", small: f = !1, tabIndex: p = 0, onFocus: m = Ir, onBlur: g = Ir, searchable: _ = !0, clearable: b = !1, maxTooltipWidth: x, closeOnOptionActionClick: S, isInTable: T = !1, groupOrder: E, right: D = !1, width: O = null, autoLayerWidth: k = !1, testId: A } = e, j = d(W), M = n || j, N = v(null), [P, F] = y(0), { searchValue: I, onChangeSearch: L, isOpen: R, setIsOpen: z, visibleOptions: B, comboValue: ee, selectedItemId: te, getTriggerWidth: ne, getLayerWidth: V, handleChange: re, onClickClearAll: ie, closeLayer: ae, comboBoxStateRef: oe } = Lc({
3150
+ let { multi: t = !1, disabled: n = !1, error: r = null, warning: i = null, tooltip: a = null, options: o, selectedOptions: s, onChange: c, onCreate: l = null, placeholder: u = "", small: f = !1, tabIndex: p = 0, onFocus: m = Ir, onBlur: g = Ir, searchable: _ = !0, clearable: b = !1, maxTooltipWidth: x, closeOnOptionActionClick: S, isInTable: T = !1, groupOrder: E, right: D = !1, width: O = null, autoLayerWidth: k = !1, testId: A } = e, j = d(W), M = n || j, N = v(null), [P, F] = y(0), { getTriggerWidth: I, onChangeSearch: L, onClickClearAll: R, closeLayer: z, handleChange: B, getLayerWidth: ee, searchValue: te, isOpen: ne, setIsOpen: V, visibleOptions: re, comboValue: ie, selectedItemId: ae, comboBoxStateRef: oe } = Lc({
3151
3151
  options: o,
3152
- selectedOptions: s,
3153
- onChange: c,
3154
3152
  onCreate: l,
3155
- isMulti: t,
3156
- small: f,
3153
+ onChange: c,
3154
+ selectedOptions: s,
3157
3155
  width: O,
3158
- autoLayerWidth: k,
3156
+ small: f,
3159
3157
  placeholder: u,
3158
+ autoLayerWidth: k,
3159
+ isMulti: t,
3160
3160
  closeOnOptionActionClick: S,
3161
3161
  searchable: _
3162
3162
  });
3163
3163
  return h(() => {
3164
- R && F(V(N.current));
3165
- }, [V, R]), /* @__PURE__ */ w(Mr, {
3164
+ ne && F(ee(N.current));
3165
+ }, [ee, ne]), /* @__PURE__ */ w(Mr, {
3166
3166
  "aria-label": u || "Select",
3167
3167
  className: oc.select,
3168
- style: { width: ne() },
3168
+ style: { width: I() },
3169
3169
  isDisabled: M,
3170
3170
  selectionMode: t ? "multiple" : "single",
3171
- value: ee,
3172
- onChange: re,
3173
- inputValue: I,
3171
+ value: ie,
3172
+ onChange: B,
3173
+ inputValue: te,
3174
3174
  onInputChange: L,
3175
- items: B,
3175
+ items: re,
3176
3176
  defaultFilter: () => !0,
3177
3177
  allowsEmptyCollection: !0,
3178
3178
  menuTrigger: "manual",
3179
- onOpenChange: z,
3179
+ onOpenChange: V,
3180
3180
  children: [
3181
3181
  /* @__PURE__ */ C(sc, { stateRef: oe }),
3182
3182
  /* @__PURE__ */ C(Uc, {
3183
3183
  selectedOptions: s,
3184
- searchValue: I,
3184
+ searchValue: te,
3185
3185
  searchable: _,
3186
3186
  clearable: b,
3187
3187
  error: r,
@@ -3190,9 +3190,9 @@ var Lo = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ro =
3190
3190
  small: f,
3191
3191
  isInTable: T,
3192
3192
  disabled: M,
3193
- onClickClear: ie,
3193
+ onClickClear: R,
3194
3194
  tabIndex: p,
3195
- isOpen: R,
3195
+ isOpen: ne,
3196
3196
  triggerRef: N,
3197
3197
  onFocus: m,
3198
3198
  onBlur: g,
@@ -3209,13 +3209,13 @@ var Lo = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ro =
3209
3209
  triggerRef: N,
3210
3210
  offset: 0,
3211
3211
  children: /* @__PURE__ */ C(Rc, {
3212
- items: B,
3212
+ items: re,
3213
3213
  optionsCount: o.length,
3214
- selectedItemId: te,
3214
+ selectedItemId: ae,
3215
3215
  width: P,
3216
3216
  small: f,
3217
3217
  isMulti: t,
3218
- closeLayer: ae,
3218
+ closeLayer: z,
3219
3219
  testId: A && `${A}-layer`
3220
3220
  })
3221
3221
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "10.0.0-beta-36",
3
+ "version": "10.0.0-beta-38",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {