@oliasoft-open-source/react-ui-library 10.0.0-beta-21 → 10.0.0-beta-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.
Files changed (2) hide show
  1. package/dist/index.js +48 -61
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2798,24 +2798,21 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
2798
2798
  var t;
2799
2799
  (t = p.current) == null || t.open();
2800
2800
  }
2801
- }, []), w = l(() => o ? o === "auto" ? Dc(e, a, f, c == null ? "" : c) : o : "100%", [
2802
- o,
2801
+ }, []), w = o === "auto" || s, T = h(() => w ? Dc(e, a, f, c == null ? "" : c) : 0, [
2802
+ w,
2803
2803
  e,
2804
2804
  a,
2805
2805
  f,
2806
2806
  c
2807
- ]), T = l((t) => {
2808
- var n;
2809
- let r = (n = t == null ? void 0 : t.getBoundingClientRect().width) == null ? typeof w() == "number" ? w() : 0 : n;
2810
- return s ? Math.max(Dc(e, a, f, c == null ? "" : c), r) : r;
2807
+ ]), E = l(() => o ? o === "auto" ? T : o : "100%", [o, T]), D = l((e) => {
2808
+ var t;
2809
+ let n = E(), r = (t = e == null ? void 0 : e.getBoundingClientRect().width) == null ? typeof n == "number" ? n : 0 : t;
2810
+ return s ? Math.max(T, r) : r;
2811
2811
  }, [
2812
2812
  s,
2813
- e,
2814
- a,
2815
- f,
2816
- c,
2817
- w
2818
- ]), E = h(() => {
2813
+ T,
2814
+ E
2815
+ ]), O = h(() => {
2819
2816
  let t = e.filter((e) => Nc(e, g)).map((e, t) => Pc(e, t));
2820
2817
  return d && g && t.push(Pc({
2821
2818
  label: `Create "${g}"`,
@@ -2826,36 +2823,28 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
2826
2823
  e,
2827
2824
  g,
2828
2825
  d
2829
- ]), D = h(() => {
2826
+ ]), k = h(() => {
2830
2827
  let t = /* @__PURE__ */ new Map();
2831
2828
  return e.forEach((e, n) => {
2832
2829
  t.set(jc(e, n), e);
2833
- }), d && g && t.set(Ac, {
2834
- label: `Create "${g}"`,
2835
- value: g,
2836
- createAble: !0
2837
2830
  }), t;
2838
- }, [
2839
- e,
2840
- d,
2841
- g
2842
- ]), O = h(() => {
2831
+ }, [e]), A = h(() => {
2843
2832
  if (i) return (Array.isArray(t) ? t : []).filter((e) => e && !Mr(e.value)).map((e) => String(e.value));
2844
2833
  let e = Array.isArray(t) ? t[0] : t;
2845
2834
  return Mr(e == null ? void 0 : e.value) ? null : String(e.value);
2846
- }, [i, t]), k = h(() => {
2835
+ }, [i, t]), j = h(() => {
2847
2836
  if (i) {
2848
2837
  let e = Array.isArray(t) ? t[0] : null;
2849
2838
  return Mr(e == null ? void 0 : e.value) ? null : String(e.value);
2850
2839
  }
2851
- return O;
2840
+ return A;
2852
2841
  }, [
2853
- O,
2842
+ A,
2854
2843
  i,
2855
2844
  t
2856
- ]), A = l((e) => {
2845
+ ]), M = l((e) => {
2857
2846
  n == null || n({ target: {} }, e);
2858
- }, [n]), j = l((e = g) => {
2847
+ }, [n]), N = l((e = g) => {
2859
2848
  if (!(!r || !e) && (m.current = !0, r(e), y(""), !i)) {
2860
2849
  var t;
2861
2850
  (t = p.current) == null || t.close();
@@ -2866,24 +2855,23 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
2866
2855
  r
2867
2856
  ]);
2868
2857
  return {
2869
- inputValue: g,
2870
- handleInputChange: C,
2858
+ searchValue: g,
2859
+ onChangeSearch: C,
2871
2860
  isOpen: b,
2872
2861
  setIsOpen: S,
2873
- collectionItems: E,
2874
- comboValue: O,
2875
- selectedItemId: k,
2876
- getTriggerWidth: w,
2877
- getLayerWidth: T,
2862
+ visibleOptions: O,
2863
+ comboValue: A,
2864
+ selectedItemId: j,
2865
+ getTriggerWidth: E,
2866
+ getLayerWidth: D,
2878
2867
  handleChange: l((e) => {
2879
2868
  if (y(""), i) {
2880
- let r = Fc(e);
2881
- if (r.includes("create")) {
2882
- var t, n;
2883
- j(String((t = (n = D.get("create")) == null ? void 0 : n.value) == null ? "" : t));
2869
+ let t = Fc(e);
2870
+ if (t.includes("create")) {
2871
+ N();
2884
2872
  return;
2885
2873
  }
2886
- let i = r.map((e) => D.get(e)).filter((e) => !Mr(e) && e.type !== eo.HEADING).map((e) => ({
2874
+ let n = t.map((e) => k.get(e)).filter((e) => !Mr(e) && e.type !== eo.HEADING).map((e) => ({
2887
2875
  value: e.value,
2888
2876
  label: e.label,
2889
2877
  details: e.details,
@@ -2891,41 +2879,40 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
2891
2879
  actions: e.actions,
2892
2880
  testId: e.testId
2893
2881
  }));
2894
- A(i);
2882
+ M(n);
2895
2883
  return;
2896
2884
  }
2897
- let r = Array.isArray(e) ? e[0] : e;
2898
- if (Mr(r)) {
2885
+ let t = Array.isArray(e) ? e[0] : e;
2886
+ if (Mr(t)) {
2899
2887
  if (m.current) {
2900
2888
  m.current = !1;
2901
2889
  return;
2902
2890
  }
2903
- A({ value: null });
2891
+ M({ value: null });
2904
2892
  return;
2905
2893
  }
2906
- if (String(r) === "create") {
2907
- var a, o;
2908
- j(String((a = (o = D.get("create")) == null ? void 0 : o.value) == null ? "" : a));
2894
+ if (String(t) === "create") {
2895
+ N();
2909
2896
  return;
2910
2897
  }
2911
- let s = D.get(String(r));
2912
- !s || s.type === eo.HEADING || s.disabled || s.createAble || A({
2913
- value: s.value,
2914
- label: s.label,
2915
- details: s.details,
2916
- icon: s.icon,
2917
- actions: s.actions,
2918
- testId: s.testId
2898
+ let n = k.get(String(t));
2899
+ !n || n.type === eo.HEADING || n.disabled || n.createAble || M({
2900
+ value: n.value,
2901
+ label: n.label,
2902
+ details: n.details,
2903
+ icon: n.icon,
2904
+ actions: n.actions,
2905
+ testId: n.testId
2919
2906
  });
2920
2907
  }, [
2921
- A,
2922
- j,
2908
+ M,
2909
+ N,
2923
2910
  i,
2924
- D
2911
+ k
2925
2912
  ]),
2926
- handleClear: l(() => {
2927
- y(""), A(i ? [] : { value: null });
2928
- }, [A, i]),
2913
+ onClickClearAll: l(() => {
2914
+ y(""), M(i ? [] : { value: null });
2915
+ }, [M, i]),
2929
2916
  closeLayer: l(() => {
2930
2917
  if (u) {
2931
2918
  var e;
@@ -3152,7 +3139,7 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
3152
3139
  children: A
3153
3140
  }) });
3154
3141
  }, Hc = (e) => {
3155
- 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: d = "", small: f = !1, tabIndex: p = 0, onFocus: h = Pr, onBlur: g = Pr, searchable: y = !0, clearable: b = !1, maxTooltipWidth: x, closeOnOptionActionClick: w, isInTable: T = !1, groupOrder: E, right: D = !1, width: O = null, autoLayerWidth: k = !1, testId: A } = e, j = u(W), M = n || j, N = _(null), [P, F] = v(0), { inputValue: I, handleInputChange: L, isOpen: R, setIsOpen: z, collectionItems: B, comboValue: ee, selectedItemId: te, getTriggerWidth: ne, getLayerWidth: V, handleChange: re, handleClear: ie, closeLayer: ae, comboBoxStateRef: oe } = Ic({
3142
+ 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: d = "", small: f = !1, tabIndex: p = 0, onFocus: h = Pr, onBlur: g = Pr, searchable: y = !0, clearable: b = !1, maxTooltipWidth: x, closeOnOptionActionClick: w, isInTable: T = !1, groupOrder: E, right: D = !1, width: O = null, autoLayerWidth: k = !1, testId: A } = e, j = u(W), M = n || j, N = _(null), [P, F] = v(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 } = Ic({
3156
3143
  options: o,
3157
3144
  selectedOptions: s,
3158
3145
  onChange: c,
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-21",
3
+ "version": "10.0.0-beta-22",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {