@oliasoft-open-source/react-ui-library 10.0.0-beta-44 → 10.0.0-beta-46
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 +97 -79
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2655,7 +2655,7 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
2655
2655
|
let t = d(Nr);
|
|
2656
2656
|
return f(() => {
|
|
2657
2657
|
e.current = t ? {
|
|
2658
|
-
close: () => t.
|
|
2658
|
+
close: () => t.setOpen(!1),
|
|
2659
2659
|
open: () => {
|
|
2660
2660
|
t.isOpen || t.open(null, "input");
|
|
2661
2661
|
}
|
|
@@ -2798,87 +2798,94 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
2798
2798
|
searchText: r.toLowerCase()
|
|
2799
2799
|
};
|
|
2800
2800
|
}, Fc = (e) => Pr(e) ? [] : Array.isArray(e) ? e.map(String) : [String(e)], Ic = ({ 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 }) => {
|
|
2801
|
-
let f = !!t, p = cc(), m = v(null), h = v(!1),
|
|
2802
|
-
optionsCount:
|
|
2801
|
+
let f = !!t, p = cc(), m = v(null), h = v(!1), _ = v(null), [b, x] = y(!1), S = g(() => e.map((e, t) => Pc(e, t)), [e]), { searchValue: C, committedFilter: w, isFilterPending: T, onChangeSearch: E, resetSearchState: D } = Nc({
|
|
2802
|
+
optionsCount: S.length,
|
|
2803
2803
|
comboBoxStateRef: m
|
|
2804
|
-
}),
|
|
2804
|
+
}), O = u(() => {
|
|
2805
2805
|
if (l) {
|
|
2806
2806
|
var e;
|
|
2807
2807
|
(e = m.current) == null || e.close();
|
|
2808
2808
|
}
|
|
2809
|
-
}, [l]),
|
|
2810
|
-
|
|
2811
|
-
}, [
|
|
2812
|
-
|
|
2809
|
+
}, [l]), k = u((e) => {
|
|
2810
|
+
x(e), e || D();
|
|
2811
|
+
}, [D]), A = i === "auto" || s, j = g(() => A ? Tc(e, a, p, o == null ? "" : o) : 0, [
|
|
2812
|
+
A,
|
|
2813
2813
|
e,
|
|
2814
2814
|
a,
|
|
2815
2815
|
p,
|
|
2816
2816
|
o
|
|
2817
|
-
]),
|
|
2817
|
+
]), M = u(() => i ? i === "auto" ? j : i : "100%", [i, j]), N = u((e) => {
|
|
2818
2818
|
var t;
|
|
2819
|
-
let n =
|
|
2820
|
-
return s ? Math.max(
|
|
2819
|
+
let n = M(), r = (t = e == null ? void 0 : e.getBoundingClientRect().width) == null ? typeof n == "number" ? n : 0 : t;
|
|
2820
|
+
return s ? Math.max(j, r) : r;
|
|
2821
2821
|
}, [
|
|
2822
2822
|
s,
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
]),
|
|
2823
|
+
j,
|
|
2824
|
+
M
|
|
2825
|
+
]), P = g(() => {
|
|
2826
2826
|
let e = /* @__PURE__ */ new Map();
|
|
2827
|
-
for (let t of
|
|
2827
|
+
for (let t of S) e.set(t.id, t);
|
|
2828
2828
|
return e;
|
|
2829
|
-
}, [
|
|
2829
|
+
}, [S]), F = g(() => {
|
|
2830
2830
|
if (c) return (Array.isArray(r) ? r : []).filter((e) => e && !Pr(e.value)).map((e) => String(e.value));
|
|
2831
2831
|
let e = Array.isArray(r) ? r[0] : r;
|
|
2832
2832
|
return Pr(e == null ? void 0 : e.value) ? null : String(e.value);
|
|
2833
|
-
}, [c, r]),
|
|
2834
|
-
if (d &&
|
|
2835
|
-
let e = d ?
|
|
2833
|
+
}, [c, r]), I = g(() => c ? Array.isArray(F) ? F : [] : Pr(F) ? [] : [F], [F, c]), L = g(() => {
|
|
2834
|
+
if (d && T && !w.trim()) return I.length === 0 ? [] : S.filter((e) => I.includes(e.id));
|
|
2835
|
+
let e = d ? w.trim().toLowerCase() : "", t = e ? S.filter((t) => t.searchText.includes(e)) : S;
|
|
2836
2836
|
return f && e ? [...t, {
|
|
2837
2837
|
id: Oc,
|
|
2838
|
-
label: `Create "${
|
|
2839
|
-
value:
|
|
2838
|
+
label: `Create "${w}"`,
|
|
2839
|
+
value: w,
|
|
2840
2840
|
createAble: !0,
|
|
2841
|
-
textValue: `Create "${
|
|
2841
|
+
textValue: `Create "${w}"`
|
|
2842
2842
|
}] : t;
|
|
2843
2843
|
}, [
|
|
2844
|
-
|
|
2845
|
-
|
|
2844
|
+
S,
|
|
2845
|
+
w,
|
|
2846
2846
|
f,
|
|
2847
2847
|
d,
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
]),
|
|
2848
|
+
T,
|
|
2849
|
+
I
|
|
2850
|
+
]), R = g(() => {
|
|
2851
2851
|
if (c) {
|
|
2852
2852
|
let e = Array.isArray(r) ? r[0] : null;
|
|
2853
2853
|
return Pr(e == null ? void 0 : e.value) ? null : String(e.value);
|
|
2854
2854
|
}
|
|
2855
|
-
return
|
|
2855
|
+
return F;
|
|
2856
2856
|
}, [
|
|
2857
|
-
|
|
2857
|
+
F,
|
|
2858
2858
|
c,
|
|
2859
2859
|
r
|
|
2860
|
-
]),
|
|
2860
|
+
]), z = u((e) => {
|
|
2861
|
+
if (!c) {
|
|
2862
|
+
var t;
|
|
2863
|
+
(t = m.current) == null || t.close();
|
|
2864
|
+
}
|
|
2861
2865
|
n == null || n({ target: {} }, e);
|
|
2862
|
-
}, [n]),
|
|
2863
|
-
if (!(!t || !e)
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
+
}, [n, c]), B = u((e = C) => {
|
|
2867
|
+
if (!(!t || !e)) {
|
|
2868
|
+
if (h.current = !0, !c) {
|
|
2869
|
+
var n;
|
|
2870
|
+
(n = m.current) == null || n.close();
|
|
2871
|
+
}
|
|
2872
|
+
t(e), D();
|
|
2866
2873
|
}
|
|
2867
2874
|
}, [
|
|
2868
|
-
|
|
2875
|
+
C,
|
|
2869
2876
|
c,
|
|
2870
2877
|
t,
|
|
2871
|
-
|
|
2872
|
-
]),
|
|
2873
|
-
if (
|
|
2878
|
+
D
|
|
2879
|
+
]), ee = u((e) => {
|
|
2880
|
+
if (D(), c) {
|
|
2874
2881
|
let t = Fc(e);
|
|
2875
2882
|
if (t.includes("create")) {
|
|
2876
|
-
|
|
2883
|
+
B();
|
|
2877
2884
|
return;
|
|
2878
2885
|
}
|
|
2879
|
-
let n = Array.isArray(
|
|
2886
|
+
let n = Array.isArray(F) ? F : [];
|
|
2880
2887
|
if (t.length === n.length && t.every((e) => n.includes(e))) return;
|
|
2881
|
-
let r = t.map((e) =>
|
|
2888
|
+
let r = t.map((e) => P.get(e)).filter((e) => !Pr(e) && e.type !== Qa.HEADING).map((e) => ({
|
|
2882
2889
|
value: e.value,
|
|
2883
2890
|
label: e.label,
|
|
2884
2891
|
details: e.details,
|
|
@@ -2886,7 +2893,7 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
2886
2893
|
actions: e.actions,
|
|
2887
2894
|
testId: e.testId
|
|
2888
2895
|
}));
|
|
2889
|
-
|
|
2896
|
+
z(r);
|
|
2890
2897
|
return;
|
|
2891
2898
|
}
|
|
2892
2899
|
let t = Array.isArray(e) ? e[0] : e;
|
|
@@ -2895,51 +2902,61 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
2895
2902
|
h.current = !1;
|
|
2896
2903
|
return;
|
|
2897
2904
|
}
|
|
2898
|
-
if (!Pr(
|
|
2899
|
-
|
|
2905
|
+
if (!Pr(F)) return;
|
|
2906
|
+
z({ value: null });
|
|
2900
2907
|
return;
|
|
2901
2908
|
}
|
|
2902
2909
|
if (String(t) === "create") {
|
|
2903
|
-
|
|
2910
|
+
B();
|
|
2904
2911
|
return;
|
|
2905
2912
|
}
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2913
|
+
let n = P.get(String(t));
|
|
2914
|
+
if (!n || n.type === Qa.HEADING || n.disabled || n.createAble) return;
|
|
2915
|
+
let r = String(t);
|
|
2916
|
+
_.current !== r && (_.current = r, Promise.resolve().then(() => {
|
|
2917
|
+
_.current === r && (_.current = null);
|
|
2918
|
+
}), z({
|
|
2909
2919
|
value: n.value,
|
|
2910
2920
|
label: n.label,
|
|
2911
2921
|
details: n.details,
|
|
2912
2922
|
icon: n.icon,
|
|
2913
2923
|
actions: n.actions,
|
|
2914
2924
|
testId: n.testId
|
|
2915
|
-
});
|
|
2925
|
+
}));
|
|
2916
2926
|
}, [
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
R,
|
|
2927
|
+
D,
|
|
2928
|
+
F,
|
|
2920
2929
|
z,
|
|
2930
|
+
B,
|
|
2921
2931
|
c,
|
|
2922
|
-
|
|
2932
|
+
P
|
|
2923
2933
|
]);
|
|
2924
2934
|
return {
|
|
2925
|
-
getTriggerWidth:
|
|
2926
|
-
onChangeSearch:
|
|
2935
|
+
getTriggerWidth: M,
|
|
2936
|
+
onChangeSearch: E,
|
|
2927
2937
|
onClickClearAll: u(() => {
|
|
2928
|
-
|
|
2938
|
+
D(), z(c ? [] : { value: null });
|
|
2929
2939
|
}, [
|
|
2930
|
-
|
|
2931
|
-
|
|
2940
|
+
D,
|
|
2941
|
+
z,
|
|
2932
2942
|
c
|
|
2933
2943
|
]),
|
|
2934
|
-
closeLayer:
|
|
2935
|
-
handleChange:
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2944
|
+
closeLayer: O,
|
|
2945
|
+
handleChange: ee,
|
|
2946
|
+
handleSelectionChange: u((e) => {
|
|
2947
|
+
c || !Pr(e) && String(e) === String(F) && ee(e);
|
|
2948
|
+
}, [
|
|
2949
|
+
c,
|
|
2950
|
+
F,
|
|
2951
|
+
ee
|
|
2952
|
+
]),
|
|
2953
|
+
getLayerWidth: N,
|
|
2954
|
+
searchValue: C,
|
|
2955
|
+
isOpen: b,
|
|
2956
|
+
setIsOpen: k,
|
|
2957
|
+
visibleOptions: L,
|
|
2958
|
+
comboValue: F,
|
|
2959
|
+
selectedItemId: R,
|
|
2943
2960
|
comboBoxStateRef: m
|
|
2944
2961
|
};
|
|
2945
2962
|
}, Lc = ({ items: e, optionsCount: t, selectedItemId: n, width: r, small: i, isMulti: a = !1, closeLayer: o, testId: s }) => {
|
|
@@ -3153,7 +3170,7 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3153
3170
|
children: A
|
|
3154
3171
|
}) });
|
|
3155
3172
|
}, Wc = () => !0, Gc = (e) => {
|
|
3156
|
-
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,
|
|
3173
|
+
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, handleSelectionChange: ee, getLayerWidth: te, searchValue: ne, isOpen: V, setIsOpen: re, visibleOptions: ie, comboValue: ae, selectedItemId: oe, comboBoxStateRef: se } = Ic({
|
|
3157
3174
|
options: o,
|
|
3158
3175
|
onCreate: l,
|
|
3159
3176
|
onChange: c,
|
|
@@ -3167,27 +3184,28 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3167
3184
|
searchable: _
|
|
3168
3185
|
});
|
|
3169
3186
|
return h(() => {
|
|
3170
|
-
|
|
3171
|
-
}, [
|
|
3187
|
+
V && F(te(N.current));
|
|
3188
|
+
}, [te, V]), /* @__PURE__ */ w(Mr, {
|
|
3172
3189
|
"aria-label": u || "Select",
|
|
3173
3190
|
className: ac.select,
|
|
3174
3191
|
style: { width: I() },
|
|
3175
3192
|
isDisabled: M,
|
|
3176
3193
|
selectionMode: t ? "multiple" : "single",
|
|
3177
|
-
value:
|
|
3194
|
+
value: ae,
|
|
3178
3195
|
onChange: B,
|
|
3179
|
-
|
|
3196
|
+
onSelectionChange: ee,
|
|
3197
|
+
inputValue: ne,
|
|
3180
3198
|
onInputChange: _ ? L : void 0,
|
|
3181
|
-
items:
|
|
3199
|
+
items: ie,
|
|
3182
3200
|
defaultFilter: Wc,
|
|
3183
3201
|
allowsEmptyCollection: !0,
|
|
3184
3202
|
menuTrigger: "manual",
|
|
3185
|
-
onOpenChange:
|
|
3203
|
+
onOpenChange: re,
|
|
3186
3204
|
children: [
|
|
3187
|
-
/* @__PURE__ */ C(oc, { stateRef:
|
|
3205
|
+
/* @__PURE__ */ C(oc, { stateRef: se }),
|
|
3188
3206
|
/* @__PURE__ */ C(Uc, {
|
|
3189
3207
|
selectedOptions: s,
|
|
3190
|
-
searchValue:
|
|
3208
|
+
searchValue: ne,
|
|
3191
3209
|
searchable: _,
|
|
3192
3210
|
clearable: b,
|
|
3193
3211
|
error: r,
|
|
@@ -3198,7 +3216,7 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3198
3216
|
disabled: M,
|
|
3199
3217
|
onClickClear: R,
|
|
3200
3218
|
tabIndex: p,
|
|
3201
|
-
isOpen:
|
|
3219
|
+
isOpen: V,
|
|
3202
3220
|
triggerRef: N,
|
|
3203
3221
|
onFocus: m,
|
|
3204
3222
|
onBlur: g,
|
|
@@ -3215,9 +3233,9 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3215
3233
|
triggerRef: N,
|
|
3216
3234
|
offset: 0,
|
|
3217
3235
|
children: /* @__PURE__ */ C(Lc, {
|
|
3218
|
-
items:
|
|
3236
|
+
items: ie,
|
|
3219
3237
|
optionsCount: o.length,
|
|
3220
|
-
selectedItemId:
|
|
3238
|
+
selectedItemId: oe,
|
|
3221
3239
|
width: P,
|
|
3222
3240
|
small: f,
|
|
3223
3241
|
isMulti: t,
|
package/package.json
CHANGED