@oliasoft-open-source/react-ui-library 10.0.0-beta-43 → 10.0.0-beta-45
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 +88 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -904,7 +904,7 @@ var Ma = {
|
|
|
904
904
|
}
|
|
905
905
|
r == null || r(e);
|
|
906
906
|
},
|
|
907
|
-
|
|
907
|
+
onClickCapture: (e) => {
|
|
908
908
|
l && (e.preventDefault(), e.stopPropagation());
|
|
909
909
|
},
|
|
910
910
|
"data-testid": h,
|
|
@@ -2798,87 +2798,87 @@ 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
2861
|
n == null || n({ target: {} }, e);
|
|
2862
|
-
}, [n]),
|
|
2863
|
-
if (!(!t || !e) && (h.current = !0, t(e),
|
|
2862
|
+
}, [n]), B = u((e = C) => {
|
|
2863
|
+
if (!(!t || !e) && (h.current = !0, t(e), D(), !c)) {
|
|
2864
2864
|
var n;
|
|
2865
2865
|
(n = m.current) == null || n.close();
|
|
2866
2866
|
}
|
|
2867
2867
|
}, [
|
|
2868
|
-
|
|
2868
|
+
C,
|
|
2869
2869
|
c,
|
|
2870
2870
|
t,
|
|
2871
|
-
|
|
2872
|
-
]),
|
|
2873
|
-
if (
|
|
2871
|
+
D
|
|
2872
|
+
]), ee = u((e) => {
|
|
2873
|
+
if (D(), c) {
|
|
2874
2874
|
let t = Fc(e);
|
|
2875
2875
|
if (t.includes("create")) {
|
|
2876
|
-
|
|
2876
|
+
B();
|
|
2877
2877
|
return;
|
|
2878
2878
|
}
|
|
2879
|
-
let n = Array.isArray(
|
|
2879
|
+
let n = Array.isArray(F) ? F : [];
|
|
2880
2880
|
if (t.length === n.length && t.every((e) => n.includes(e))) return;
|
|
2881
|
-
let r = t.map((e) =>
|
|
2881
|
+
let r = t.map((e) => P.get(e)).filter((e) => !Pr(e) && e.type !== Qa.HEADING).map((e) => ({
|
|
2882
2882
|
value: e.value,
|
|
2883
2883
|
label: e.label,
|
|
2884
2884
|
details: e.details,
|
|
@@ -2886,7 +2886,7 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
2886
2886
|
actions: e.actions,
|
|
2887
2887
|
testId: e.testId
|
|
2888
2888
|
}));
|
|
2889
|
-
|
|
2889
|
+
z(r);
|
|
2890
2890
|
return;
|
|
2891
2891
|
}
|
|
2892
2892
|
let t = Array.isArray(e) ? e[0] : e;
|
|
@@ -2895,51 +2895,61 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
2895
2895
|
h.current = !1;
|
|
2896
2896
|
return;
|
|
2897
2897
|
}
|
|
2898
|
-
if (!Pr(
|
|
2899
|
-
|
|
2898
|
+
if (!Pr(F)) return;
|
|
2899
|
+
z({ value: null });
|
|
2900
2900
|
return;
|
|
2901
2901
|
}
|
|
2902
2902
|
if (String(t) === "create") {
|
|
2903
|
-
|
|
2903
|
+
B();
|
|
2904
2904
|
return;
|
|
2905
2905
|
}
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2906
|
+
let n = P.get(String(t));
|
|
2907
|
+
if (!n || n.type === Qa.HEADING || n.disabled || n.createAble) return;
|
|
2908
|
+
let r = String(t);
|
|
2909
|
+
_.current !== r && (_.current = r, Promise.resolve().then(() => {
|
|
2910
|
+
_.current === r && (_.current = null);
|
|
2911
|
+
}), z({
|
|
2909
2912
|
value: n.value,
|
|
2910
2913
|
label: n.label,
|
|
2911
2914
|
details: n.details,
|
|
2912
2915
|
icon: n.icon,
|
|
2913
2916
|
actions: n.actions,
|
|
2914
2917
|
testId: n.testId
|
|
2915
|
-
});
|
|
2918
|
+
}));
|
|
2916
2919
|
}, [
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
R,
|
|
2920
|
+
D,
|
|
2921
|
+
F,
|
|
2920
2922
|
z,
|
|
2923
|
+
B,
|
|
2921
2924
|
c,
|
|
2922
|
-
|
|
2925
|
+
P
|
|
2923
2926
|
]);
|
|
2924
2927
|
return {
|
|
2925
|
-
getTriggerWidth:
|
|
2926
|
-
onChangeSearch:
|
|
2928
|
+
getTriggerWidth: M,
|
|
2929
|
+
onChangeSearch: E,
|
|
2927
2930
|
onClickClearAll: u(() => {
|
|
2928
|
-
|
|
2931
|
+
D(), z(c ? [] : { value: null });
|
|
2929
2932
|
}, [
|
|
2930
|
-
|
|
2931
|
-
|
|
2933
|
+
D,
|
|
2934
|
+
z,
|
|
2932
2935
|
c
|
|
2933
2936
|
]),
|
|
2934
|
-
closeLayer:
|
|
2935
|
-
handleChange:
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2937
|
+
closeLayer: O,
|
|
2938
|
+
handleChange: ee,
|
|
2939
|
+
handleSelectionChange: u((e) => {
|
|
2940
|
+
c || !Pr(e) && String(e) === String(F) && ee(e);
|
|
2941
|
+
}, [
|
|
2942
|
+
c,
|
|
2943
|
+
F,
|
|
2944
|
+
ee
|
|
2945
|
+
]),
|
|
2946
|
+
getLayerWidth: N,
|
|
2947
|
+
searchValue: C,
|
|
2948
|
+
isOpen: b,
|
|
2949
|
+
setIsOpen: k,
|
|
2950
|
+
visibleOptions: L,
|
|
2951
|
+
comboValue: F,
|
|
2952
|
+
selectedItemId: R,
|
|
2943
2953
|
comboBoxStateRef: m
|
|
2944
2954
|
};
|
|
2945
2955
|
}, Lc = ({ items: e, optionsCount: t, selectedItemId: n, width: r, small: i, isMulti: a = !1, closeLayer: o, testId: s }) => {
|
|
@@ -3153,7 +3163,7 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3153
3163
|
children: A
|
|
3154
3164
|
}) });
|
|
3155
3165
|
}, 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,
|
|
3166
|
+
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
3167
|
options: o,
|
|
3158
3168
|
onCreate: l,
|
|
3159
3169
|
onChange: c,
|
|
@@ -3167,27 +3177,28 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3167
3177
|
searchable: _
|
|
3168
3178
|
});
|
|
3169
3179
|
return h(() => {
|
|
3170
|
-
|
|
3171
|
-
}, [
|
|
3180
|
+
V && F(te(N.current));
|
|
3181
|
+
}, [te, V]), /* @__PURE__ */ w(Mr, {
|
|
3172
3182
|
"aria-label": u || "Select",
|
|
3173
3183
|
className: ac.select,
|
|
3174
3184
|
style: { width: I() },
|
|
3175
3185
|
isDisabled: M,
|
|
3176
3186
|
selectionMode: t ? "multiple" : "single",
|
|
3177
|
-
value:
|
|
3187
|
+
value: ae,
|
|
3178
3188
|
onChange: B,
|
|
3179
|
-
|
|
3189
|
+
onSelectionChange: ee,
|
|
3190
|
+
inputValue: ne,
|
|
3180
3191
|
onInputChange: _ ? L : void 0,
|
|
3181
|
-
items:
|
|
3192
|
+
items: ie,
|
|
3182
3193
|
defaultFilter: Wc,
|
|
3183
3194
|
allowsEmptyCollection: !0,
|
|
3184
3195
|
menuTrigger: "manual",
|
|
3185
|
-
onOpenChange:
|
|
3196
|
+
onOpenChange: re,
|
|
3186
3197
|
children: [
|
|
3187
|
-
/* @__PURE__ */ C(oc, { stateRef:
|
|
3198
|
+
/* @__PURE__ */ C(oc, { stateRef: se }),
|
|
3188
3199
|
/* @__PURE__ */ C(Uc, {
|
|
3189
3200
|
selectedOptions: s,
|
|
3190
|
-
searchValue:
|
|
3201
|
+
searchValue: ne,
|
|
3191
3202
|
searchable: _,
|
|
3192
3203
|
clearable: b,
|
|
3193
3204
|
error: r,
|
|
@@ -3198,7 +3209,7 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3198
3209
|
disabled: M,
|
|
3199
3210
|
onClickClear: R,
|
|
3200
3211
|
tabIndex: p,
|
|
3201
|
-
isOpen:
|
|
3212
|
+
isOpen: V,
|
|
3202
3213
|
triggerRef: N,
|
|
3203
3214
|
onFocus: m,
|
|
3204
3215
|
onBlur: g,
|
|
@@ -3215,9 +3226,9 @@ var Io = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Lo =
|
|
|
3215
3226
|
triggerRef: N,
|
|
3216
3227
|
offset: 0,
|
|
3217
3228
|
children: /* @__PURE__ */ C(Lc, {
|
|
3218
|
-
items:
|
|
3229
|
+
items: ie,
|
|
3219
3230
|
optionsCount: o.length,
|
|
3220
|
-
selectedItemId:
|
|
3231
|
+
selectedItemId: oe,
|
|
3221
3232
|
width: P,
|
|
3222
3233
|
small: f,
|
|
3223
3234
|
isMulti: t,
|
package/package.json
CHANGED