@oliasoft-open-source/react-ui-library 10.0.0-beta-17 → 10.0.0-beta-18
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 +53 -57
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2794,17 +2794,15 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
2794
2794
|
}), Lc = (e) => Mr(e) ? [] : Array.isArray(e) ? e.map(String) : [String(e)], Rc = ({ options: e, selectedOptions: t, onChange: n, onCreate: r, isMulti: i, small: a, width: o = null, autoLayerWidth: s = !1, placeholder: c = "", closeOnOptionActionClick: u }) => {
|
|
2795
2795
|
let d = !!r, f = dc(), p = _(null), m = _(!1), [g, y] = v(""), [b, x] = v(!1), S = l((e) => {
|
|
2796
2796
|
x(e), e || y("");
|
|
2797
|
-
}, []), C = l((
|
|
2798
|
-
b && y(e);
|
|
2799
|
-
}, [b]), w = l(() => o ? o === "auto" ? Oc(e, a, f, c == null ? "" : c) : o : "100%", [
|
|
2797
|
+
}, []), C = l(() => o ? o === "auto" ? Oc(e, a, f, c == null ? "" : c) : o : "100%", [
|
|
2800
2798
|
o,
|
|
2801
2799
|
e,
|
|
2802
2800
|
a,
|
|
2803
2801
|
f,
|
|
2804
2802
|
c
|
|
2805
|
-
]),
|
|
2803
|
+
]), w = l((t) => {
|
|
2806
2804
|
var n;
|
|
2807
|
-
let r = (n = t == null ? void 0 : t.getBoundingClientRect().width) == null ? typeof
|
|
2805
|
+
let r = (n = t == null ? void 0 : t.getBoundingClientRect().width) == null ? typeof C() == "number" ? C() : 0 : n;
|
|
2808
2806
|
return s ? Math.max(Oc(e, a, f, c == null ? "" : c), r) : r;
|
|
2809
2807
|
}, [
|
|
2810
2808
|
s,
|
|
@@ -2812,8 +2810,8 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
2812
2810
|
a,
|
|
2813
2811
|
f,
|
|
2814
2812
|
c,
|
|
2815
|
-
|
|
2816
|
-
]),
|
|
2813
|
+
C
|
|
2814
|
+
]), T = h(() => {
|
|
2817
2815
|
let t = e.filter((e) => Fc(e, g)).map((e, t) => Ic(e, t));
|
|
2818
2816
|
return d && g && t.push(Ic({
|
|
2819
2817
|
label: `Create "${g}"`,
|
|
@@ -2824,31 +2822,31 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
2824
2822
|
e,
|
|
2825
2823
|
g,
|
|
2826
2824
|
d
|
|
2827
|
-
]),
|
|
2825
|
+
]), E = h(() => {
|
|
2828
2826
|
let t = /* @__PURE__ */ new Map();
|
|
2829
|
-
return
|
|
2827
|
+
return T.forEach((e) => {
|
|
2830
2828
|
t.set(e.id, e.section);
|
|
2831
2829
|
}), e.forEach((e, n) => {
|
|
2832
2830
|
let r = Nc(e, n);
|
|
2833
2831
|
t.has(r) || t.set(r, e);
|
|
2834
2832
|
}), t;
|
|
2835
|
-
}, [
|
|
2833
|
+
}, [T, e]), D = h(() => {
|
|
2836
2834
|
if (i) return (Array.isArray(t) ? t : []).filter((e) => e && !Mr(e.value)).map((e) => String(e.value));
|
|
2837
2835
|
let e = Array.isArray(t) ? t[0] : t;
|
|
2838
2836
|
return Mr(e == null ? void 0 : e.value) ? null : String(e.value);
|
|
2839
|
-
}, [i, t]),
|
|
2837
|
+
}, [i, t]), O = h(() => {
|
|
2840
2838
|
if (i) {
|
|
2841
2839
|
let e = Array.isArray(t) ? t[0] : null;
|
|
2842
2840
|
return Mr(e == null ? void 0 : e.value) ? null : String(e.value);
|
|
2843
2841
|
}
|
|
2844
|
-
return
|
|
2842
|
+
return D;
|
|
2845
2843
|
}, [
|
|
2846
|
-
|
|
2844
|
+
D,
|
|
2847
2845
|
i,
|
|
2848
2846
|
t
|
|
2849
|
-
]),
|
|
2847
|
+
]), k = l((e) => {
|
|
2850
2848
|
n == null || n({ target: {} }, e);
|
|
2851
|
-
}, [n]),
|
|
2849
|
+
}, [n]), A = l((e = g) => {
|
|
2852
2850
|
if (!(!r || !e) && (m.current = !0, r(e), y(""), !i)) {
|
|
2853
2851
|
var t;
|
|
2854
2852
|
(t = p.current) == null || t.close();
|
|
@@ -2863,21 +2861,20 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
2863
2861
|
setInputValue: y,
|
|
2864
2862
|
isOpen: b,
|
|
2865
2863
|
setIsOpen: S,
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
getLayerWidth: T,
|
|
2864
|
+
collectionItems: T,
|
|
2865
|
+
comboValue: D,
|
|
2866
|
+
selectedItemId: O,
|
|
2867
|
+
getTriggerWidth: C,
|
|
2868
|
+
getLayerWidth: w,
|
|
2872
2869
|
handleChange: l((e) => {
|
|
2873
2870
|
if (y(""), i) {
|
|
2874
2871
|
let r = Lc(e);
|
|
2875
2872
|
if (r.includes("create")) {
|
|
2876
2873
|
var t, n;
|
|
2877
|
-
|
|
2874
|
+
A(String((t = (n = E.get("create")) == null ? void 0 : n.value) == null ? "" : t));
|
|
2878
2875
|
return;
|
|
2879
2876
|
}
|
|
2880
|
-
let i = r.map((e) =>
|
|
2877
|
+
let i = r.map((e) => E.get(e)).filter((e) => !Mr(e) && e.type !== eo.HEADING).map((e) => ({
|
|
2881
2878
|
value: e.value,
|
|
2882
2879
|
label: e.label,
|
|
2883
2880
|
details: e.details,
|
|
@@ -2885,7 +2882,7 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
2885
2882
|
actions: e.actions,
|
|
2886
2883
|
testId: e.testId
|
|
2887
2884
|
}));
|
|
2888
|
-
|
|
2885
|
+
k(i);
|
|
2889
2886
|
return;
|
|
2890
2887
|
}
|
|
2891
2888
|
let r = Array.isArray(e) ? e[0] : e;
|
|
@@ -2894,16 +2891,16 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
2894
2891
|
m.current = !1;
|
|
2895
2892
|
return;
|
|
2896
2893
|
}
|
|
2897
|
-
|
|
2894
|
+
k({ value: null });
|
|
2898
2895
|
return;
|
|
2899
2896
|
}
|
|
2900
2897
|
if (String(r) === "create") {
|
|
2901
2898
|
var a, o;
|
|
2902
|
-
|
|
2899
|
+
A(String((a = (o = E.get("create")) == null ? void 0 : o.value) == null ? "" : a));
|
|
2903
2900
|
return;
|
|
2904
2901
|
}
|
|
2905
|
-
let s =
|
|
2906
|
-
!s || s.type === eo.HEADING || s.disabled || s.createAble ||
|
|
2902
|
+
let s = E.get(String(r));
|
|
2903
|
+
!s || s.type === eo.HEADING || s.disabled || s.createAble || k({
|
|
2907
2904
|
value: s.value,
|
|
2908
2905
|
label: s.label,
|
|
2909
2906
|
details: s.details,
|
|
@@ -2912,14 +2909,14 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
2912
2909
|
testId: s.testId
|
|
2913
2910
|
});
|
|
2914
2911
|
}, [
|
|
2912
|
+
k,
|
|
2915
2913
|
A,
|
|
2916
|
-
j,
|
|
2917
2914
|
i,
|
|
2918
|
-
|
|
2915
|
+
E
|
|
2919
2916
|
]),
|
|
2920
2917
|
handleClear: l(() => {
|
|
2921
|
-
y(""),
|
|
2922
|
-
}, [
|
|
2918
|
+
y(""), k(i ? [] : { value: null });
|
|
2919
|
+
}, [k, i]),
|
|
2923
2920
|
closeLayer: l(() => {
|
|
2924
2921
|
if (u) {
|
|
2925
2922
|
var e;
|
|
@@ -3028,30 +3025,30 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3028
3025
|
})
|
|
3029
3026
|
})]
|
|
3030
3027
|
});
|
|
3031
|
-
}, Uc = ({ selectedOptions: e, searchable: t = !1, searchValue: n, error: r, placeholder: i = "Select...", small: a,
|
|
3032
|
-
let
|
|
3028
|
+
}, Uc = ({ selectedOptions: e, searchable: t = !1, searchValue: n, error: r, placeholder: i = "Select...", small: a, testId: o, tabIndex: s }) => {
|
|
3029
|
+
let c = _(null), l = _(null), [u, d] = v(0), f = Array.isArray(e), p = f ? e.length > 0 : !!e, h = n ? n.length + 1 : 1;
|
|
3033
3030
|
return m(() => {
|
|
3034
3031
|
var e, t;
|
|
3035
|
-
if (!
|
|
3036
|
-
let n = ((e =
|
|
3037
|
-
|
|
3032
|
+
if (!f || !p) return;
|
|
3033
|
+
let n = ((e = c.current) == null ? void 0 : e.offsetWidth) || 0, r = ((t = l.current) == null ? void 0 : t.offsetWidth) || 0;
|
|
3034
|
+
d(n - r);
|
|
3038
3035
|
}, [
|
|
3039
3036
|
n,
|
|
3037
|
+
f,
|
|
3040
3038
|
p,
|
|
3041
|
-
h,
|
|
3042
3039
|
e
|
|
3043
3040
|
]), /* @__PURE__ */ C("div", {
|
|
3044
3041
|
className: Y.triggerInputContainer,
|
|
3045
|
-
ref:
|
|
3042
|
+
ref: c,
|
|
3046
3043
|
children: [
|
|
3047
|
-
|
|
3044
|
+
p ? f ? /* @__PURE__ */ S(Hc, {
|
|
3048
3045
|
selectedOptions: e,
|
|
3049
3046
|
small: a,
|
|
3050
|
-
width:
|
|
3051
|
-
testId:
|
|
3047
|
+
width: u,
|
|
3048
|
+
testId: o
|
|
3052
3049
|
}) : /* @__PURE__ */ S("span", {
|
|
3053
3050
|
className: Y.selectedSingleValue,
|
|
3054
|
-
"data-testid":
|
|
3051
|
+
"data-testid": o && `${o}-value`,
|
|
3055
3052
|
children: n != null && n.length ? "" : e == null ? void 0 : e.label
|
|
3056
3053
|
}) : /* @__PURE__ */ S("span", {
|
|
3057
3054
|
className: Y.placeHolder,
|
|
@@ -3059,14 +3056,14 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3059
3056
|
}),
|
|
3060
3057
|
/* @__PURE__ */ S(Hr, {
|
|
3061
3058
|
className: Y.input,
|
|
3062
|
-
size:
|
|
3063
|
-
readOnly: !t
|
|
3064
|
-
tabIndex:
|
|
3059
|
+
size: h,
|
|
3060
|
+
readOnly: !t,
|
|
3061
|
+
tabIndex: s,
|
|
3065
3062
|
"data-error": r || null,
|
|
3066
|
-
"data-testid":
|
|
3063
|
+
"data-testid": o && `${o}-input`
|
|
3067
3064
|
}),
|
|
3068
|
-
|
|
3069
|
-
ref:
|
|
3065
|
+
f ? /* @__PURE__ */ S("span", {
|
|
3066
|
+
ref: l,
|
|
3070
3067
|
className: Y.input,
|
|
3071
3068
|
style: {
|
|
3072
3069
|
position: "absolute",
|
|
@@ -3111,7 +3108,6 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3111
3108
|
searchValue: t,
|
|
3112
3109
|
error: i,
|
|
3113
3110
|
small: s,
|
|
3114
|
-
isOpen: f,
|
|
3115
3111
|
testId: w,
|
|
3116
3112
|
tabIndex: d
|
|
3117
3113
|
}),
|
|
@@ -3147,7 +3143,7 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3147
3143
|
children: A
|
|
3148
3144
|
}) });
|
|
3149
3145
|
}, Gc = (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: 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,
|
|
3146
|
+
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, setInputValue: L, isOpen: R, setIsOpen: z, collectionItems: B, comboValue: ee, selectedItemId: te, getTriggerWidth: ne, getLayerWidth: V, handleChange: re, handleClear: ie, closeLayer: ae, comboBoxStateRef: oe } = Rc({
|
|
3151
3147
|
options: o,
|
|
3152
3148
|
selectedOptions: s,
|
|
3153
3149
|
onChange: c,
|
|
@@ -3160,8 +3156,8 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3160
3156
|
closeOnOptionActionClick: w
|
|
3161
3157
|
});
|
|
3162
3158
|
return m(() => {
|
|
3163
|
-
|
|
3164
|
-
}, [V,
|
|
3159
|
+
R && F(V(N.current));
|
|
3160
|
+
}, [V, R]), /* @__PURE__ */ C(Ar, {
|
|
3165
3161
|
"aria-label": d || "Select",
|
|
3166
3162
|
className: sc.select,
|
|
3167
3163
|
style: { width: ne() },
|
|
@@ -3170,12 +3166,12 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3170
3166
|
value: ee,
|
|
3171
3167
|
onChange: re,
|
|
3172
3168
|
inputValue: I,
|
|
3173
|
-
onInputChange:
|
|
3169
|
+
onInputChange: L,
|
|
3174
3170
|
items: B,
|
|
3175
3171
|
defaultFilter: () => !0,
|
|
3176
3172
|
allowsEmptyCollection: !0,
|
|
3177
|
-
menuTrigger: "manual",
|
|
3178
|
-
onOpenChange:
|
|
3173
|
+
menuTrigger: y ? "input" : "manual",
|
|
3174
|
+
onOpenChange: z,
|
|
3179
3175
|
children: [
|
|
3180
3176
|
/* @__PURE__ */ S(cc, { triggerRef: N }),
|
|
3181
3177
|
/* @__PURE__ */ S(lc, { stateRef: oe }),
|
|
@@ -3192,7 +3188,7 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3192
3188
|
disabled: M,
|
|
3193
3189
|
onClickClear: ie,
|
|
3194
3190
|
tabIndex: p,
|
|
3195
|
-
isOpen:
|
|
3191
|
+
isOpen: R,
|
|
3196
3192
|
triggerRef: N,
|
|
3197
3193
|
onFocus: h,
|
|
3198
3194
|
onBlur: g,
|
package/package.json
CHANGED