@snmt-react-ui/async-select 1.8.22 → 1.8.23
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/async-select.js +258 -252
- package/package.json +3 -3
package/dist/async-select.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
import { jsx as t, Fragment as U, jsxs as c } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as n1, forwardRef as g1, useRef as Y, useImperativeHandle as u1, useState as _, useEffect as
|
|
4
|
-
import { Select as G1, Flex as B1, Avatar as W1, Checkbox as y1, Tooltip as
|
|
5
|
-
var
|
|
3
|
+
import { createContext as n1, forwardRef as g1, useRef as Y, useImperativeHandle as u1, useState as _, useEffect as A, useCallback as W, useContext as r1, useMemo as A1 } from "react";
|
|
4
|
+
import { Select as G1, Flex as B1, Avatar as W1, Checkbox as y1, Tooltip as _1, Typography as x1, Tag as T1, Popover as b1 } from "antd";
|
|
5
|
+
var D1 = Object.defineProperty, K1 = (i, o, e) => o in i ? D1(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e, j1 = (i, o, e) => K1(i, o + "", e), Y1 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6
6
|
function O1() {
|
|
7
7
|
if (console && console.warn) {
|
|
8
8
|
for (var i = arguments.length, o = new Array(i), e = 0; e < i; e++)
|
|
@@ -38,8 +38,8 @@ const H1 = (i, o) => () => {
|
|
|
38
38
|
const l = o.languages[0], n = o.options ? o.options.fallbackLng : !1, a = o.languages[o.languages.length - 1];
|
|
39
39
|
if (l.toLowerCase() === "cimode") return !0;
|
|
40
40
|
const p = (r, m) => {
|
|
41
|
-
const
|
|
42
|
-
return
|
|
41
|
+
const C = o.services.backendConnector.state[`${r}|${m}`];
|
|
42
|
+
return C === -1 || C === 2;
|
|
43
43
|
};
|
|
44
44
|
return e.bindI18n && e.bindI18n.indexOf("languageChanging") > -1 && o.services.backendConnector.backend && o.isLanguageChangingTo && !p(o.isLanguageChangingTo, i) ? !1 : !!(o.hasResourceBundle(l, i) || !o.services.backendConnector.backend || o.options.resources && !o.options.partialBundledLanguages || p(l, i) && (!n || p(a, i)));
|
|
45
45
|
}, S1 = function(i, o) {
|
|
@@ -97,7 +97,7 @@ class i2 {
|
|
|
97
97
|
}
|
|
98
98
|
const t2 = (i, o) => {
|
|
99
99
|
const e = Y();
|
|
100
|
-
return
|
|
100
|
+
return A(() => {
|
|
101
101
|
e.current = i;
|
|
102
102
|
}, [i, o]), e.current;
|
|
103
103
|
}, E1 = (i, o, e, l) => i.getFixedT(o, e, l), l2 = (i, o, e, l) => W(E1(i, o, e, l), [i, o, e, l]), n2 = function(i) {
|
|
@@ -110,8 +110,8 @@ const t2 = (i, o) => {
|
|
|
110
110
|
} = r1(o2) || {}, a = e || l || e2();
|
|
111
111
|
if (a && !a.reportNamespaces && (a.reportNamespaces = new i2()), !a) {
|
|
112
112
|
p1("You will need to pass in an i18next instance by using initReactI18next");
|
|
113
|
-
const u = (
|
|
114
|
-
return
|
|
113
|
+
const u = (x, H) => P(H) ? H : U1(H) && P(H.defaultValue) ? H.defaultValue : Array.isArray(x) ? x[x.length - 1] : x, E = [u, {}, !1];
|
|
114
|
+
return E.t = u, E.i18n = {}, E.ready = !1, E;
|
|
115
115
|
}
|
|
116
116
|
a.options.react && a.options.react.wait !== void 0 && p1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
117
117
|
const p = {
|
|
@@ -122,35 +122,35 @@ const t2 = (i, o) => {
|
|
|
122
122
|
useSuspense: r,
|
|
123
123
|
keyPrefix: m
|
|
124
124
|
} = p;
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
const h = (a.isInitialized || a.initializedStoreOnce) &&
|
|
128
|
-
let
|
|
129
|
-
o.lng && (
|
|
130
|
-
const
|
|
131
|
-
|
|
125
|
+
let C = i;
|
|
126
|
+
C = P(C) ? [C] : C || ["translation"], a.reportNamespaces.addUsedNamespaces && a.reportNamespaces.addUsedNamespaces(C);
|
|
127
|
+
const h = (a.isInitialized || a.initializedStoreOnce) && C.every((u) => S1(u, a, p)), s = l2(a, o.lng || null, p.nsMode === "fallback" ? C : C[0], m), f = () => s, N = () => E1(a, o.lng || null, p.nsMode === "fallback" ? C : C[0], m), [V, Z] = _(f);
|
|
128
|
+
let L = C.join();
|
|
129
|
+
o.lng && (L = `${o.lng}${L}`);
|
|
130
|
+
const G = t2(L), M = Y(!0);
|
|
131
|
+
A(() => {
|
|
132
132
|
const {
|
|
133
133
|
bindI18n: u,
|
|
134
|
-
bindI18nStore:
|
|
134
|
+
bindI18nStore: E
|
|
135
135
|
} = p;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}) : v1(a,
|
|
139
|
-
|
|
140
|
-
})), h &&
|
|
141
|
-
const
|
|
142
|
-
|
|
136
|
+
M.current = !0, !h && !r && (o.lng ? N1(a, o.lng, C, () => {
|
|
137
|
+
M.current && Z(N);
|
|
138
|
+
}) : v1(a, C, () => {
|
|
139
|
+
M.current && Z(N);
|
|
140
|
+
})), h && G && G !== L && M.current && Z(N);
|
|
141
|
+
const x = () => {
|
|
142
|
+
M.current && Z(N);
|
|
143
143
|
};
|
|
144
|
-
return u && a && a.on(u,
|
|
145
|
-
|
|
144
|
+
return u && a && a.on(u, x), E && a && a.store.on(E, x), () => {
|
|
145
|
+
M.current = !1, u && a && u.split(" ").forEach((H) => a.off(H, x)), E && a && E.split(" ").forEach((H) => a.store.off(H, x));
|
|
146
146
|
};
|
|
147
|
-
}, [a,
|
|
148
|
-
|
|
147
|
+
}, [a, L]), A(() => {
|
|
148
|
+
M.current && h && Z(f);
|
|
149
149
|
}, [a, m, h]);
|
|
150
|
-
const y = [
|
|
151
|
-
if (y.t =
|
|
150
|
+
const y = [V, a, h];
|
|
151
|
+
if (y.t = V, y.i18n = a, y.ready = h, h || !h && !r) return y;
|
|
152
152
|
throw new Promise((u) => {
|
|
153
|
-
o.lng ? N1(a, o.lng,
|
|
153
|
+
o.lng ? N1(a, o.lng, C, () => u()) : v1(a, C, () => u());
|
|
154
154
|
});
|
|
155
155
|
}, t1 = ({
|
|
156
156
|
children: i,
|
|
@@ -188,7 +188,7 @@ const t2 = (i, o) => {
|
|
|
188
188
|
}
|
|
189
189
|
);
|
|
190
190
|
};
|
|
191
|
-
var
|
|
191
|
+
var D = /* @__PURE__ */ ((i) => (i.GREY_LIGHT_0 = "var(--grey-light-0)", i.GREY_LIGHT_1 = "var(--grey-light-1)", i.GREY_LIGHT_2 = "var(--grey-light-2)", i.GREY_LIGHT_3 = "var(--grey-light-3)", i.GREY_LIGHT_4 = "var(--grey-light-4)", i.GREY_DARK_1 = "var(--grey-dark-1)", i.GREY_DARK_2 = "var(--grey-dark-2)", i.GREY_DARK_3 = "var(--grey-dark-3)", i.GREY_DARK_4 = "var(--grey-dark-4)", i.GREY_DARK_5 = "var(--grey-dark-5)", i.BLUE_PRIMARY = "var(--blue-primary)", i.BLUE_HOVER = "var(--blue-hover)", i.BLUE_LIGHT_1 = "var(--blue-light-1)", i.BLUE_LIGHT_2 = "var(--blue-light-2)", i.BLUE_LIGHT_3 = "var(--blue-light-3)", i.BLUE_LIGHT_4 = "var(--blue-light-4)", i.BLUE_DARK_1 = "var(--blue-dark-1)", i.BLUE_DARK_3 = "var(--blue-dark-3)", i.PURPLE_LIGHT = "var(--purple-light)", i.PURPLE_DARK = "var(--purple-dark)", i.NOTIFICATION_WARNING_LIGHT = "var(--notification-warning-light)", i.NOTIFICATION_WARNING_DARK = "var(--notification-warning-dark)", i.NOTIFICATION_SUCCESS_LIGHT = "var(--notification-success-light)", i.NOTIFICATION_SUCCESS_DARK = "var(--notification-success-dark)", i.NOTIFICATION_ERROR_LIGHT = "var(--notification-error-light)", i.NOTIFICATION_ERROR_DARK = "var(--notification-error-dark)", i.NOTIFICATION_ERROR_DARK_MODE = "var(--notification-error-dark-mode)", i))(D || {});
|
|
192
192
|
const m1 = n1({
|
|
193
193
|
locale: "en",
|
|
194
194
|
theme: "light"
|
|
@@ -202,9 +202,9 @@ const s2 = ({
|
|
|
202
202
|
disabled: n = !1,
|
|
203
203
|
disableUncheck: a = !1
|
|
204
204
|
}) => {
|
|
205
|
-
const [p, r] = _(i), [m,
|
|
206
|
-
|
|
207
|
-
r(i),
|
|
205
|
+
const [p, r] = _(i), [m, C] = _(o);
|
|
206
|
+
A(() => {
|
|
207
|
+
r(i), C(o);
|
|
208
208
|
}, [i, o]);
|
|
209
209
|
const { theme: h } = r1(m1);
|
|
210
210
|
return /* @__PURE__ */ t(
|
|
@@ -214,7 +214,7 @@ const s2 = ({
|
|
|
214
214
|
checked: p,
|
|
215
215
|
indeterminate: m,
|
|
216
216
|
onChange: (s) => {
|
|
217
|
-
a && p || (
|
|
217
|
+
a && p || (C(!1), r(s.target.checked), l && l(s));
|
|
218
218
|
},
|
|
219
219
|
disabled: n,
|
|
220
220
|
children: e
|
|
@@ -828,7 +828,7 @@ const h2 = ({
|
|
|
828
828
|
)
|
|
829
829
|
]
|
|
830
830
|
}
|
|
831
|
-
),
|
|
831
|
+
), R2 = ({
|
|
832
832
|
width: i = 20,
|
|
833
833
|
height: o = 20,
|
|
834
834
|
color: e = "#001E52",
|
|
@@ -861,7 +861,7 @@ const h2 = ({
|
|
|
861
861
|
)
|
|
862
862
|
]
|
|
863
863
|
}
|
|
864
|
-
),
|
|
864
|
+
), _2 = ({
|
|
865
865
|
width: i = 20,
|
|
866
866
|
height: o = 20,
|
|
867
867
|
color: e = "#001E52",
|
|
@@ -1322,7 +1322,7 @@ const h2 = ({
|
|
|
1322
1322
|
)
|
|
1323
1323
|
]
|
|
1324
1324
|
}
|
|
1325
|
-
),
|
|
1325
|
+
), b2 = ({
|
|
1326
1326
|
width: i = 20,
|
|
1327
1327
|
height: o = 20,
|
|
1328
1328
|
color: e = "#004ED7",
|
|
@@ -1351,7 +1351,7 @@ const h2 = ({
|
|
|
1351
1351
|
)
|
|
1352
1352
|
]
|
|
1353
1353
|
}
|
|
1354
|
-
),
|
|
1354
|
+
), D2 = ({
|
|
1355
1355
|
width: i = 10,
|
|
1356
1356
|
height: o = 10,
|
|
1357
1357
|
color: e = "#001E52",
|
|
@@ -2702,8 +2702,8 @@ const h2 = ({
|
|
|
2702
2702
|
disabled: a = !1,
|
|
2703
2703
|
onClick: p
|
|
2704
2704
|
}) => {
|
|
2705
|
-
const [r, m] = _(n), { theme:
|
|
2706
|
-
return
|
|
2705
|
+
const [r, m] = _(n), { theme: C } = r1(I1), h = a ? C && C === "dark" ? g.GREY_LIGHT_4 : g.GREY_DARK_1 : l, s = a ? void 0 : p;
|
|
2706
|
+
return A(() => {
|
|
2707
2707
|
if (n) {
|
|
2708
2708
|
s && !a && m(`${n} clickable`);
|
|
2709
2709
|
return;
|
|
@@ -2760,9 +2760,9 @@ const h2 = ({
|
|
|
2760
2760
|
case "history":
|
|
2761
2761
|
return M2({ width: o, height: e, color: h, className: r, onClick: s });
|
|
2762
2762
|
case "logOut":
|
|
2763
|
-
return _2({ width: o, height: e, color: h, className: r, onClick: s });
|
|
2764
|
-
case "settings":
|
|
2765
2763
|
return R2({ width: o, height: e, color: h, className: r, onClick: s });
|
|
2764
|
+
case "settings":
|
|
2765
|
+
return _2({ width: o, height: e, color: h, className: r, onClick: s });
|
|
2766
2766
|
case "trash":
|
|
2767
2767
|
return x2({ width: o, height: e, color: h, className: r, onClick: s });
|
|
2768
2768
|
case "settings4":
|
|
@@ -2818,7 +2818,7 @@ const h2 = ({
|
|
|
2818
2818
|
onClick: s
|
|
2819
2819
|
});
|
|
2820
2820
|
case "expandActiveArrowIcon":
|
|
2821
|
-
return
|
|
2821
|
+
return b2({
|
|
2822
2822
|
width: o,
|
|
2823
2823
|
height: e,
|
|
2824
2824
|
color: h,
|
|
@@ -2826,7 +2826,7 @@ const h2 = ({
|
|
|
2826
2826
|
onClick: s
|
|
2827
2827
|
});
|
|
2828
2828
|
case "sortUp":
|
|
2829
|
-
return
|
|
2829
|
+
return D2({ width: o, height: e, color: h, className: r, onClick: s });
|
|
2830
2830
|
case "sortDown":
|
|
2831
2831
|
return K2({ width: o, height: e, color: h, className: r, onClick: s });
|
|
2832
2832
|
case "search":
|
|
@@ -2900,7 +2900,7 @@ const h2 = ({
|
|
|
2900
2900
|
}
|
|
2901
2901
|
})() });
|
|
2902
2902
|
}, f5 = ({ children: i, title: o, arrow: e = !0, open: l, placement: n = "top" }) => /* @__PURE__ */ t(
|
|
2903
|
-
|
|
2903
|
+
_1,
|
|
2904
2904
|
{
|
|
2905
2905
|
overlayClassName: "snmt-tooltip",
|
|
2906
2906
|
title: o,
|
|
@@ -2909,7 +2909,7 @@ const h2 = ({
|
|
|
2909
2909
|
placement: n,
|
|
2910
2910
|
children: i
|
|
2911
2911
|
}
|
|
2912
|
-
), { Title: M5, Text:
|
|
2912
|
+
), { Title: M5, Text: R5 } = x1, _5 = {
|
|
2913
2913
|
h1: 1,
|
|
2914
2914
|
h2: 2,
|
|
2915
2915
|
h3: 3,
|
|
@@ -2926,28 +2926,31 @@ const h2 = ({
|
|
|
2926
2926
|
/** This prop allows you to enable tooltip if text size is too big */
|
|
2927
2927
|
trim: r = !1
|
|
2928
2928
|
}, m) => {
|
|
2929
|
-
const
|
|
2930
|
-
u1(m, () =>
|
|
2929
|
+
const C = Y(null);
|
|
2930
|
+
u1(m, () => C.current);
|
|
2931
2931
|
const [h, s] = _(!1);
|
|
2932
|
-
|
|
2932
|
+
A(() => {
|
|
2933
|
+
var L;
|
|
2933
2934
|
if (!r) return;
|
|
2934
|
-
const
|
|
2935
|
-
|
|
2936
|
-
}
|
|
2937
|
-
|
|
2938
|
-
|
|
2935
|
+
const G = () => {
|
|
2936
|
+
C.current && s(C.current.scrollWidth > C.current.clientWidth);
|
|
2937
|
+
};
|
|
2938
|
+
G();
|
|
2939
|
+
const M = new ResizeObserver(G);
|
|
2940
|
+
return C.current && M.observe(C.current), (L = C.current) != null && L.parentElement && M.observe(C.current.parentElement), () => {
|
|
2941
|
+
M.disconnect();
|
|
2939
2942
|
};
|
|
2940
|
-
}, [r
|
|
2941
|
-
const
|
|
2942
|
-
let
|
|
2943
|
-
i && i !== "inherit" && (
|
|
2944
|
-
const
|
|
2945
|
-
className:
|
|
2943
|
+
}, [r]);
|
|
2944
|
+
const f = o === "h1" || o === "h2" || o === "h3" || o === "h4";
|
|
2945
|
+
let N = `snmt-typography snmt-typography-${o}`;
|
|
2946
|
+
i && i !== "inherit" && (N += ` snmt-typography-align-${i}`), a && (N += " collapsed"), r && (N += " collapsed");
|
|
2947
|
+
const V = {
|
|
2948
|
+
className: N,
|
|
2946
2949
|
style: { color: e, whiteSpace: r ? "nowrap" : p, display: r ? "block" : "" },
|
|
2947
2950
|
onClick: n,
|
|
2948
|
-
ref:
|
|
2949
|
-
},
|
|
2950
|
-
return r && h ? /* @__PURE__ */ t(f5, { placement: "top", title: l, children:
|
|
2951
|
+
ref: C
|
|
2952
|
+
}, Z = f ? /* @__PURE__ */ t(M5, { level: _5[o], ...V, children: l }) : /* @__PURE__ */ t(R5, { ...V, children: l });
|
|
2953
|
+
return r && h ? /* @__PURE__ */ t(f5, { placement: "top", title: l, children: Z }) : Z;
|
|
2951
2954
|
}
|
|
2952
2955
|
);
|
|
2953
2956
|
var k = /* @__PURE__ */ ((i) => (i.GREY_LIGHT_0 = "var(--grey-light-0)", i.GREY_LIGHT_1 = "var(--grey-light-1)", i.GREY_LIGHT_2 = "var(--grey-light-2)", i.GREY_LIGHT_3 = "var(--grey-light-3)", i.GREY_LIGHT_4 = "var(--grey-light-4)", i.GREY_DARK_1 = "var(--grey-dark-1)", i.GREY_DARK_2 = "var(--grey-dark-2)", i.GREY_DARK_3 = "var(--grey-dark-3)", i.GREY_DARK_4 = "var(--grey-dark-4)", i.GREY_DARK_5 = "var(--grey-dark-5)", i.BLUE_PRIMARY = "var(--blue-primary)", i.BLUE_HOVER = "var(--blue-hover)", i.BLUE_LIGHT_1 = "var(--blue-light-1)", i.BLUE_LIGHT_2 = "var(--blue-light-2)", i.BLUE_LIGHT_3 = "var(--blue-light-3)", i.BLUE_LIGHT_4 = "var(--blue-light-4)", i.BLUE_DARK_1 = "var(--blue-dark-1)", i.BLUE_DARK_3 = "var(--blue-dark-3)", i.PURPLE_LIGHT = "var(--purple-light)", i.PURPLE_DARK = "var(--purple-dark)", i.NOTIFICATION_WARNING_LIGHT = "var(--notification-warning-light)", i.NOTIFICATION_WARNING_DARK = "var(--notification-warning-dark)", i.NOTIFICATION_SUCCESS_LIGHT = "var(--notification-success-light)", i.NOTIFICATION_SUCCESS_DARK = "var(--notification-success-dark)", i.NOTIFICATION_ERROR_LIGHT = "var(--notification-error-light)", i.NOTIFICATION_ERROR_DARK = "var(--notification-error-dark)", i.NOTIFICATION_ERROR_DARK_MODE = "var(--notification-error-dark-mode)", i))(k || {});
|
|
@@ -3358,7 +3361,7 @@ const H5 = ({
|
|
|
3358
3361
|
)
|
|
3359
3362
|
]
|
|
3360
3363
|
}
|
|
3361
|
-
),
|
|
3364
|
+
), b5 = ({
|
|
3362
3365
|
width: i = 20,
|
|
3363
3366
|
height: o = 20,
|
|
3364
3367
|
color: e = "#001E52",
|
|
@@ -3405,7 +3408,7 @@ const H5 = ({
|
|
|
3405
3408
|
)
|
|
3406
3409
|
]
|
|
3407
3410
|
}
|
|
3408
|
-
),
|
|
3411
|
+
), D5 = ({
|
|
3409
3412
|
width: i = 20,
|
|
3410
3413
|
height: o = 20,
|
|
3411
3414
|
color: e = "#001E52",
|
|
@@ -4785,7 +4788,7 @@ const H5 = ({
|
|
|
4785
4788
|
)
|
|
4786
4789
|
]
|
|
4787
4790
|
}
|
|
4788
|
-
),
|
|
4791
|
+
), R3 = ({
|
|
4789
4792
|
className: i,
|
|
4790
4793
|
color: o = k.GREY_DARK_5,
|
|
4791
4794
|
height: e = 24,
|
|
@@ -4854,7 +4857,7 @@ const H5 = ({
|
|
|
4854
4857
|
)
|
|
4855
4858
|
]
|
|
4856
4859
|
}
|
|
4857
|
-
),
|
|
4860
|
+
), _3 = ({
|
|
4858
4861
|
className: i,
|
|
4859
4862
|
color: o = k.GREY_DARK_5,
|
|
4860
4863
|
height: e = 24,
|
|
@@ -5342,7 +5345,7 @@ const H5 = ({
|
|
|
5342
5345
|
)
|
|
5343
5346
|
]
|
|
5344
5347
|
}
|
|
5345
|
-
),
|
|
5348
|
+
), b3 = ({
|
|
5346
5349
|
width: i = 24,
|
|
5347
5350
|
height: o = 24,
|
|
5348
5351
|
color: e = k.GREY_DARK_2,
|
|
@@ -5369,7 +5372,7 @@ const H5 = ({
|
|
|
5369
5372
|
}
|
|
5370
5373
|
)
|
|
5371
5374
|
}
|
|
5372
|
-
),
|
|
5375
|
+
), D3 = ({
|
|
5373
5376
|
width: i = 24,
|
|
5374
5377
|
height: o = 24,
|
|
5375
5378
|
color: e = k.GREY_DARK_2,
|
|
@@ -5431,8 +5434,8 @@ const H5 = ({
|
|
|
5431
5434
|
disabled: a = !1,
|
|
5432
5435
|
onClick: p
|
|
5433
5436
|
}) => {
|
|
5434
|
-
const [r, m] = _(n), { theme:
|
|
5435
|
-
return
|
|
5437
|
+
const [r, m] = _(n), { theme: C } = r1(V1), h = a ? C && C === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : l, s = a ? void 0 : p;
|
|
5438
|
+
return A(() => {
|
|
5436
5439
|
if (n) {
|
|
5437
5440
|
s && !a && m(`${n} clickable`);
|
|
5438
5441
|
return;
|
|
@@ -5467,9 +5470,9 @@ const H5 = ({
|
|
|
5467
5470
|
case "attention":
|
|
5468
5471
|
return T5({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5469
5472
|
case "users":
|
|
5470
|
-
return
|
|
5473
|
+
return b5({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5471
5474
|
case "mySkillsMatrix":
|
|
5472
|
-
return
|
|
5475
|
+
return D5({
|
|
5473
5476
|
width: o,
|
|
5474
5477
|
height: e,
|
|
5475
5478
|
color: h,
|
|
@@ -5589,11 +5592,11 @@ const H5 = ({
|
|
|
5589
5592
|
case "bell":
|
|
5590
5593
|
return f3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5591
5594
|
case "contract":
|
|
5592
|
-
return
|
|
5595
|
+
return R3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5593
5596
|
case "trash2":
|
|
5594
5597
|
return M3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5595
5598
|
case "resourceManager":
|
|
5596
|
-
return
|
|
5599
|
+
return _3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5597
5600
|
case "settings2":
|
|
5598
5601
|
return x3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5599
5602
|
case "image":
|
|
@@ -5621,9 +5624,9 @@ const H5 = ({
|
|
|
5621
5624
|
case "openPointCircle":
|
|
5622
5625
|
return T3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5623
5626
|
case "community":
|
|
5624
|
-
return D3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5625
|
-
case "docs":
|
|
5626
5627
|
return b3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5628
|
+
case "docs":
|
|
5629
|
+
return D3({ width: o, height: e, color: h, className: r, onClick: s });
|
|
5627
5630
|
default:
|
|
5628
5631
|
return /* @__PURE__ */ t(U, { children: "No Icon provided" });
|
|
5629
5632
|
}
|
|
@@ -5674,7 +5677,7 @@ const Z1 = ({
|
|
|
5674
5677
|
}
|
|
5675
5678
|
);
|
|
5676
5679
|
}, O3 = ({ children: i, title: o, arrow: e = !0, open: l, placement: n = "top" }) => /* @__PURE__ */ t(
|
|
5677
|
-
|
|
5680
|
+
_1,
|
|
5678
5681
|
{
|
|
5679
5682
|
overlayClassName: "snmt-tooltip",
|
|
5680
5683
|
title: o,
|
|
@@ -5700,28 +5703,31 @@ const Z1 = ({
|
|
|
5700
5703
|
/** This prop allows you to enable tooltip if text size is too big */
|
|
5701
5704
|
trim: r = !1
|
|
5702
5705
|
}, m) => {
|
|
5703
|
-
const
|
|
5704
|
-
u1(m, () =>
|
|
5706
|
+
const C = Y(null);
|
|
5707
|
+
u1(m, () => C.current);
|
|
5705
5708
|
const [h, s] = _(!1);
|
|
5706
|
-
|
|
5709
|
+
A(() => {
|
|
5710
|
+
var L;
|
|
5707
5711
|
if (!r) return;
|
|
5708
|
-
const
|
|
5709
|
-
|
|
5710
|
-
}
|
|
5711
|
-
|
|
5712
|
-
|
|
5712
|
+
const G = () => {
|
|
5713
|
+
C.current && s(C.current.scrollWidth > C.current.clientWidth);
|
|
5714
|
+
};
|
|
5715
|
+
G();
|
|
5716
|
+
const M = new ResizeObserver(G);
|
|
5717
|
+
return C.current && M.observe(C.current), (L = C.current) != null && L.parentElement && M.observe(C.current.parentElement), () => {
|
|
5718
|
+
M.disconnect();
|
|
5713
5719
|
};
|
|
5714
|
-
}, [r
|
|
5715
|
-
const
|
|
5716
|
-
let
|
|
5717
|
-
i && i !== "inherit" && (
|
|
5718
|
-
const
|
|
5719
|
-
className:
|
|
5720
|
+
}, [r]);
|
|
5721
|
+
const f = o === "h1" || o === "h2" || o === "h3" || o === "h4";
|
|
5722
|
+
let N = `snmt-typography snmt-typography-${o}`;
|
|
5723
|
+
i && i !== "inherit" && (N += ` snmt-typography-align-${i}`), a && (N += " collapsed"), r && (N += " collapsed");
|
|
5724
|
+
const V = {
|
|
5725
|
+
className: N,
|
|
5720
5726
|
style: { color: e, whiteSpace: r ? "nowrap" : p, display: r ? "block" : "" },
|
|
5721
5727
|
onClick: n,
|
|
5722
|
-
ref:
|
|
5723
|
-
},
|
|
5724
|
-
return r && h ? /* @__PURE__ */ t(O3, { placement: "top", title: l, children:
|
|
5728
|
+
ref: C
|
|
5729
|
+
}, Z = f ? /* @__PURE__ */ t(F3, { level: U3[o], ...V, children: l }) : /* @__PURE__ */ t(S3, { ...V, children: l });
|
|
5730
|
+
return r && h ? /* @__PURE__ */ t(O3, { placement: "top", title: l, children: Z }) : Z;
|
|
5725
5731
|
}
|
|
5726
5732
|
), $3 = ({
|
|
5727
5733
|
children: i,
|
|
@@ -5733,7 +5739,7 @@ const Z1 = ({
|
|
|
5733
5739
|
}) => {
|
|
5734
5740
|
const [p, r] = _(!1);
|
|
5735
5741
|
return /* @__PURE__ */ t(
|
|
5736
|
-
|
|
5742
|
+
b1,
|
|
5737
5743
|
{
|
|
5738
5744
|
content: o,
|
|
5739
5745
|
arrow: !1,
|
|
@@ -5768,33 +5774,33 @@ const J3 = ({
|
|
|
5768
5774
|
options: a,
|
|
5769
5775
|
extraOptions: p
|
|
5770
5776
|
}) => {
|
|
5771
|
-
const { locale: r } = r1(m1), { t: m } = n2("common", { lng: r }), [
|
|
5772
|
-
if (
|
|
5777
|
+
const { locale: r } = r1(m1), { t: m } = n2("common", { lng: r }), [C, h] = _(!1);
|
|
5778
|
+
if (A(() => {
|
|
5773
5779
|
i.length || h(!1);
|
|
5774
5780
|
}, [i]), !i.length)
|
|
5775
5781
|
return null;
|
|
5776
|
-
const s = (
|
|
5777
|
-
var
|
|
5778
|
-
return ((
|
|
5782
|
+
const s = (f) => {
|
|
5783
|
+
var N, V;
|
|
5784
|
+
return ((N = a == null ? void 0 : a.find((L) => L.value === f)) == null ? void 0 : N.label) || ((V = p == null ? void 0 : p.find((L) => L.value === f)) == null ? void 0 : V.label) || f;
|
|
5779
5785
|
};
|
|
5780
5786
|
return /* @__PURE__ */ c(
|
|
5781
5787
|
$3,
|
|
5782
5788
|
{
|
|
5783
5789
|
content: (
|
|
5784
5790
|
// 90: paddings + margins + gaps and so on
|
|
5785
|
-
/* @__PURE__ */ t("div", { style: { maxWidth: e - 90 }, className: "snmt-popover-from-select", children: /* @__PURE__ */ t(t1, { gap: 6, flexWrap: "wrap", children: i.map(({ value:
|
|
5791
|
+
/* @__PURE__ */ t("div", { style: { maxWidth: e - 90 }, className: "snmt-popover-from-select", children: /* @__PURE__ */ t(t1, { gap: 6, flexWrap: "wrap", children: i.map(({ value: f }) => /* @__PURE__ */ t(
|
|
5786
5792
|
Z1,
|
|
5787
5793
|
{
|
|
5788
|
-
onClose: () => o(
|
|
5794
|
+
onClose: () => o(f),
|
|
5789
5795
|
closable: l,
|
|
5790
5796
|
disabled: n,
|
|
5791
|
-
children: s(
|
|
5797
|
+
children: s(f)
|
|
5792
5798
|
},
|
|
5793
|
-
|
|
5799
|
+
f
|
|
5794
5800
|
)) }) })
|
|
5795
5801
|
),
|
|
5796
5802
|
placement: "bottomRight",
|
|
5797
|
-
isOpen:
|
|
5803
|
+
isOpen: C,
|
|
5798
5804
|
setIsOpen: h,
|
|
5799
5805
|
children: [
|
|
5800
5806
|
i.length,
|
|
@@ -5822,41 +5828,41 @@ const J3 = ({
|
|
|
5822
5828
|
width: p,
|
|
5823
5829
|
disabled: r = !1,
|
|
5824
5830
|
required: m = !1,
|
|
5825
|
-
clearable:
|
|
5831
|
+
clearable: C = !1,
|
|
5826
5832
|
scrollThresholdValue: h = 50,
|
|
5827
5833
|
onSearchChange: s,
|
|
5828
|
-
onDropdownVisibleChange:
|
|
5829
|
-
onScrollToEnd:
|
|
5830
|
-
onPopupScroll:
|
|
5831
|
-
id:
|
|
5832
|
-
extraOptions:
|
|
5833
|
-
dropdownRender:
|
|
5834
|
-
optionRender:
|
|
5834
|
+
onDropdownVisibleChange: f,
|
|
5835
|
+
onScrollToEnd: N,
|
|
5836
|
+
onPopupScroll: V,
|
|
5837
|
+
id: Z,
|
|
5838
|
+
extraOptions: L,
|
|
5839
|
+
dropdownRender: G,
|
|
5840
|
+
optionRender: M,
|
|
5835
5841
|
isLoading: y,
|
|
5836
5842
|
readOnly: u,
|
|
5837
|
-
error:
|
|
5838
|
-
},
|
|
5839
|
-
const [
|
|
5840
|
-
|
|
5841
|
-
|
|
5843
|
+
error: E
|
|
5844
|
+
}, x) => {
|
|
5845
|
+
const [H, K] = _(!1), [O, T] = _(!1), [F, $] = _(!0), [I, b] = _(i), Q = Y(null);
|
|
5846
|
+
A(() => {
|
|
5847
|
+
b(i);
|
|
5842
5848
|
}, [i]);
|
|
5843
|
-
const s1 = (
|
|
5844
|
-
K(
|
|
5845
|
-
}, h1 = (
|
|
5846
|
-
var
|
|
5847
|
-
return !!((
|
|
5849
|
+
const s1 = (d) => {
|
|
5850
|
+
K(d), f && f(d);
|
|
5851
|
+
}, h1 = (d, w) => {
|
|
5852
|
+
var R;
|
|
5853
|
+
return !!((R = w == null ? void 0 : w.label) != null && R.toString().toLowerCase().includes(d.toLowerCase()));
|
|
5848
5854
|
}, X = () => {
|
|
5849
5855
|
T(!0);
|
|
5850
5856
|
}, z = () => {
|
|
5851
5857
|
T(!1);
|
|
5852
5858
|
}, j = W(
|
|
5853
|
-
(
|
|
5854
|
-
if (
|
|
5855
|
-
const
|
|
5856
|
-
o == null || o(
|
|
5859
|
+
(d) => {
|
|
5860
|
+
if (b(d), l) {
|
|
5861
|
+
const R = d;
|
|
5862
|
+
o == null || o(R);
|
|
5857
5863
|
return;
|
|
5858
5864
|
}
|
|
5859
|
-
const w =
|
|
5865
|
+
const w = d;
|
|
5860
5866
|
o == null || o(w);
|
|
5861
5867
|
},
|
|
5862
5868
|
[l, o]
|
|
@@ -5869,52 +5875,52 @@ const J3 = ({
|
|
|
5869
5875
|
j("");
|
|
5870
5876
|
}
|
|
5871
5877
|
}, [r, j, l, u]), S = W(
|
|
5872
|
-
(
|
|
5873
|
-
const w =
|
|
5874
|
-
j(w),
|
|
5878
|
+
(d) => {
|
|
5879
|
+
const w = I.filter((R) => R !== d);
|
|
5880
|
+
j(w), b(w);
|
|
5875
5881
|
},
|
|
5876
|
-
[j,
|
|
5882
|
+
[j, I]
|
|
5877
5883
|
), e1 = W(
|
|
5878
|
-
(
|
|
5884
|
+
(d) => (I == null ? void 0 : I.indexOf(d)) === 0 ? (
|
|
5879
5885
|
// if the search input is empty
|
|
5880
5886
|
// then display the placeholder, else do not display it
|
|
5881
5887
|
/* @__PURE__ */ t("span", { className: "custom-placeholder", children: F ? e : "" })
|
|
5882
5888
|
) : /* @__PURE__ */ t(U, {}),
|
|
5883
|
-
[F,
|
|
5884
|
-
), a1 = (
|
|
5885
|
-
|
|
5886
|
-
}, C1 = async (
|
|
5887
|
-
const { target: w } =
|
|
5888
|
-
w.scrollTop + w.offsetHeight >= w.scrollHeight - h && (
|
|
5889
|
+
[F, I, e]
|
|
5890
|
+
), a1 = (d) => {
|
|
5891
|
+
d.preventDefault(), d.stopPropagation();
|
|
5892
|
+
}, C1 = async (d) => {
|
|
5893
|
+
const { target: w } = d;
|
|
5894
|
+
w.scrollTop + w.offsetHeight >= w.scrollHeight - h && (N == null || N(!0)), V && await V(d);
|
|
5889
5895
|
}, J = W(
|
|
5890
|
-
(
|
|
5891
|
-
var w,
|
|
5892
|
-
return ((w = a.find((o1) => o1.value ===
|
|
5893
|
-
(o1) => o1.value ===
|
|
5894
|
-
)) == null ? void 0 :
|
|
5896
|
+
(d) => {
|
|
5897
|
+
var w, R;
|
|
5898
|
+
return ((w = a.find((o1) => o1.value === d)) == null ? void 0 : w.label) || ((R = L == null ? void 0 : L.find(
|
|
5899
|
+
(o1) => o1.value === d
|
|
5900
|
+
)) == null ? void 0 : R.label) || d;
|
|
5895
5901
|
},
|
|
5896
|
-
[
|
|
5902
|
+
[L, a]
|
|
5897
5903
|
), d1 = W(
|
|
5898
|
-
(
|
|
5904
|
+
(d) => {
|
|
5899
5905
|
var w;
|
|
5900
5906
|
return /* @__PURE__ */ t(
|
|
5901
5907
|
J3,
|
|
5902
5908
|
{
|
|
5903
|
-
values:
|
|
5909
|
+
values: d,
|
|
5904
5910
|
onTagClose: S,
|
|
5905
5911
|
maxWidth: ((w = Q.current) == null ? void 0 : w.clientWidth) || 0,
|
|
5906
5912
|
disabled: r,
|
|
5907
5913
|
closable: !u,
|
|
5908
5914
|
options: a,
|
|
5909
|
-
extraOptions:
|
|
5915
|
+
extraOptions: L
|
|
5910
5916
|
}
|
|
5911
5917
|
);
|
|
5912
5918
|
},
|
|
5913
|
-
[r,
|
|
5914
|
-
),
|
|
5915
|
-
({ label:
|
|
5919
|
+
[r, L, S, a, u]
|
|
5920
|
+
), v = W(
|
|
5921
|
+
({ label: d, value: w, mode: R }) => R === "filter" ? e1(w) : /* @__PURE__ */ t("div", { onMouseDown: a1, className: "tag-wrapper", children: /* @__PURE__ */ t(Z1, { onClose: () => S(w), disabled: r, children: typeof d == "object" ? d : J(w) }) }),
|
|
5916
5922
|
[r, J, S, e1]
|
|
5917
|
-
),
|
|
5923
|
+
), B = Array.isArray(I) && I.length > 0 || !!I && typeof I == "string" && I.trim() !== "";
|
|
5918
5924
|
return /* @__PURE__ */ c("div", { className: "snmt-select-container", children: [
|
|
5919
5925
|
/* @__PURE__ */ c(
|
|
5920
5926
|
"div",
|
|
@@ -5929,33 +5935,33 @@ const J3 = ({
|
|
|
5929
5935
|
{
|
|
5930
5936
|
className: "snmt-select-blank",
|
|
5931
5937
|
popupClassName: u ? "dropdown-read-only" : "",
|
|
5932
|
-
id:
|
|
5933
|
-
ref:
|
|
5938
|
+
id: Z,
|
|
5939
|
+
ref: x,
|
|
5934
5940
|
showSearch: !!n,
|
|
5935
5941
|
filterOption: n && h1,
|
|
5936
5942
|
onDropdownVisibleChange: s1,
|
|
5937
5943
|
disabled: r,
|
|
5938
|
-
value:
|
|
5939
|
-
labelRender: (
|
|
5940
|
-
const w = J(
|
|
5941
|
-
return r ? /* @__PURE__ */ t("span", { style: { color:
|
|
5944
|
+
value: I || void 0,
|
|
5945
|
+
labelRender: (d) => {
|
|
5946
|
+
const w = J(d.value);
|
|
5947
|
+
return r ? /* @__PURE__ */ t("span", { style: { color: D.GREY_DARK_1 }, children: w }) : w;
|
|
5942
5948
|
},
|
|
5943
5949
|
mode: l === "filter" ? "multiple" : l,
|
|
5944
5950
|
onChange: j,
|
|
5945
5951
|
onFocus: X,
|
|
5946
5952
|
onBlur: z,
|
|
5947
|
-
onSearch: (
|
|
5948
|
-
$(!
|
|
5953
|
+
onSearch: (d) => {
|
|
5954
|
+
$(!d), s && s(d);
|
|
5949
5955
|
},
|
|
5950
5956
|
onSelect: () => $(!0),
|
|
5951
5957
|
onDeselect: () => $(!0),
|
|
5952
|
-
tagRender: (
|
|
5958
|
+
tagRender: (d) => v({ ...d, mode: l }),
|
|
5953
5959
|
maxTagCount: "responsive",
|
|
5954
5960
|
maxTagPlaceholder: d1,
|
|
5955
5961
|
onPopupScroll: C1,
|
|
5956
5962
|
prefix: y && /* @__PURE__ */ t(f1, { size: 15 }),
|
|
5957
5963
|
suffixIcon: /* @__PURE__ */ t("div", { className: "wrapper-suffix-icon", children: l !== "filter" && /* @__PURE__ */ c(U, { children: [
|
|
5958
|
-
|
|
5964
|
+
I && !!I.length && (l || C) && /* @__PURE__ */ t(
|
|
5959
5965
|
"div",
|
|
5960
5966
|
{
|
|
5961
5967
|
onClick: c1,
|
|
@@ -5966,7 +5972,7 @@ const J3 = ({
|
|
|
5966
5972
|
i1,
|
|
5967
5973
|
{
|
|
5968
5974
|
name: "cancel",
|
|
5969
|
-
color: r ?
|
|
5975
|
+
color: r ? D.GREY_DARK_1 : D.GREY_DARK_5
|
|
5970
5976
|
}
|
|
5971
5977
|
)
|
|
5972
5978
|
}
|
|
@@ -5975,39 +5981,39 @@ const J3 = ({
|
|
|
5975
5981
|
i1,
|
|
5976
5982
|
{
|
|
5977
5983
|
name: "selectArrowIcon",
|
|
5978
|
-
color: r ?
|
|
5979
|
-
className:
|
|
5980
|
-
onClick: () => K(!
|
|
5984
|
+
color: r ? D.GREY_DARK_1 : D.GREY_DARK_5,
|
|
5985
|
+
className: H ? "select-arrow-rotated" : "select-arrow",
|
|
5986
|
+
onClick: () => K(!H)
|
|
5981
5987
|
}
|
|
5982
5988
|
)
|
|
5983
5989
|
] }) }),
|
|
5984
|
-
removeIcon: /* @__PURE__ */ t(i1, { name: "errorSmall", color:
|
|
5990
|
+
removeIcon: /* @__PURE__ */ t(i1, { name: "errorSmall", color: D.GREY_DARK_1 }),
|
|
5985
5991
|
options: a,
|
|
5986
|
-
optionRender: (
|
|
5992
|
+
optionRender: (d) => M ? M(d.data) : /* @__PURE__ */ c(t1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
|
5987
5993
|
/* @__PURE__ */ c(t1, { alignItems: "center", gap: 12, children: [
|
|
5988
5994
|
l && /* @__PURE__ */ t(
|
|
5989
5995
|
s2,
|
|
5990
5996
|
{
|
|
5991
|
-
checked: !!(
|
|
5997
|
+
checked: !!(I != null && I.includes(d.value))
|
|
5992
5998
|
}
|
|
5993
5999
|
),
|
|
5994
6000
|
/* @__PURE__ */ c(t1, { alignItems: "center", gap: 8, children: [
|
|
5995
|
-
|
|
5996
|
-
/* @__PURE__ */ t("span", { children:
|
|
6001
|
+
d.data.image && /* @__PURE__ */ t(r2, { src: d.data.image, size: 20 }),
|
|
6002
|
+
/* @__PURE__ */ t("span", { children: d.label })
|
|
5997
6003
|
] })
|
|
5998
6004
|
] }),
|
|
5999
|
-
!l &&
|
|
6005
|
+
!l && I === d.value && /* @__PURE__ */ t(
|
|
6000
6006
|
i1,
|
|
6001
6007
|
{
|
|
6002
6008
|
name: "ok",
|
|
6003
|
-
color:
|
|
6009
|
+
color: D.BLUE_PRIMARY,
|
|
6004
6010
|
width: 16,
|
|
6005
6011
|
height: 16
|
|
6006
6012
|
}
|
|
6007
6013
|
)
|
|
6008
6014
|
] }),
|
|
6009
|
-
dropdownRender: (
|
|
6010
|
-
/* @__PURE__ */ t("div", { className: "dropdown-menu", children:
|
|
6015
|
+
dropdownRender: (d) => /* @__PURE__ */ c("div", { className: "dropdown-container", children: [
|
|
6016
|
+
/* @__PURE__ */ t("div", { className: "dropdown-menu", children: G ? G(d) : d }),
|
|
6011
6017
|
y && /* @__PURE__ */ t("div", { className: "loading-overlay", children: /* @__PURE__ */ t(f1, { size: 28 }) })
|
|
6012
6018
|
] })
|
|
6013
6019
|
}
|
|
@@ -6016,14 +6022,14 @@ const J3 = ({
|
|
|
6016
6022
|
/* @__PURE__ */ t(
|
|
6017
6023
|
"label",
|
|
6018
6024
|
{
|
|
6019
|
-
className: `${O ||
|
|
6025
|
+
className: `${O || B ? "label-floating" : ""} ${r ? "label-disabled" : ""} ${O ? "label-focused" : ""} ${y ? "label-loading" : ""} ${E ? "label-error" : ""}`,
|
|
6020
6026
|
children: m ? `${e}*` : e
|
|
6021
6027
|
}
|
|
6022
6028
|
),
|
|
6023
6029
|
/* @__PURE__ */ t(
|
|
6024
6030
|
"fieldset",
|
|
6025
6031
|
{
|
|
6026
|
-
className: `${O ? "fieldset-focused" : ""} ${r ? "fieldset-disabled" : ""} ${
|
|
6032
|
+
className: `${O ? "fieldset-focused" : ""} ${r ? "fieldset-disabled" : ""} ${B ? "fieldset-filled" : ""} ${E ? "fieldset-error" : ""}`,
|
|
6027
6033
|
children: /* @__PURE__ */ t("legend", { children: /* @__PURE__ */ t("span", { children: m ? `${e}*` : e }) })
|
|
6028
6034
|
}
|
|
6029
6035
|
)
|
|
@@ -6031,24 +6037,24 @@ const J3 = ({
|
|
|
6031
6037
|
]
|
|
6032
6038
|
}
|
|
6033
6039
|
),
|
|
6034
|
-
|
|
6040
|
+
E && /* @__PURE__ */ c(t1, { justifyContent: "flex-start", gap: 6, children: [
|
|
6035
6041
|
/* @__PURE__ */ t(
|
|
6036
6042
|
i1,
|
|
6037
6043
|
{
|
|
6038
6044
|
name: "attention",
|
|
6039
|
-
color:
|
|
6045
|
+
color: D.NOTIFICATION_ERROR_DARK,
|
|
6040
6046
|
height: 16,
|
|
6041
6047
|
width: 16
|
|
6042
6048
|
}
|
|
6043
6049
|
),
|
|
6044
|
-
typeof
|
|
6050
|
+
typeof E == "string" ? /* @__PURE__ */ t(P3, { color: D.NOTIFICATION_ERROR_DARK, variant: "body4", children: E }) : E
|
|
6045
6051
|
] })
|
|
6046
6052
|
] });
|
|
6047
6053
|
}
|
|
6048
6054
|
);
|
|
6049
6055
|
function q3(i, o = 500) {
|
|
6050
6056
|
const e = Y();
|
|
6051
|
-
return
|
|
6057
|
+
return A(() => () => {
|
|
6052
6058
|
e.current && clearTimeout(e.current);
|
|
6053
6059
|
}, []), (...n) => {
|
|
6054
6060
|
const a = setTimeout(() => {
|
|
@@ -6057,9 +6063,9 @@ function q3(i, o = 500) {
|
|
|
6057
6063
|
clearTimeout(e.current), e.current = a;
|
|
6058
6064
|
};
|
|
6059
6065
|
}
|
|
6060
|
-
function
|
|
6066
|
+
function R1(i) {
|
|
6061
6067
|
const o = Y(i);
|
|
6062
|
-
return
|
|
6068
|
+
return A(() => {
|
|
6063
6069
|
o.current = i;
|
|
6064
6070
|
}, [i]), o.current;
|
|
6065
6071
|
}
|
|
@@ -6076,36 +6082,36 @@ const k1 = 100, q = {
|
|
|
6076
6082
|
scrollThresholdValue: p,
|
|
6077
6083
|
placeholder: r,
|
|
6078
6084
|
mode: m,
|
|
6079
|
-
loadOnClosedState:
|
|
6085
|
+
loadOnClosedState: C,
|
|
6080
6086
|
preloadOptions: h,
|
|
6081
6087
|
extraOptions: s,
|
|
6082
|
-
onDropdownVisibleChange:
|
|
6083
|
-
optionRender:
|
|
6084
|
-
dropdownRender:
|
|
6085
|
-
readOnly:
|
|
6086
|
-
clearable:
|
|
6087
|
-
required:
|
|
6088
|
-
error:
|
|
6088
|
+
onDropdownVisibleChange: f,
|
|
6089
|
+
optionRender: N,
|
|
6090
|
+
dropdownRender: V,
|
|
6091
|
+
readOnly: Z,
|
|
6092
|
+
clearable: L = !1,
|
|
6093
|
+
required: G = !1,
|
|
6094
|
+
error: M
|
|
6089
6095
|
}, y) => {
|
|
6090
|
-
const [u,
|
|
6096
|
+
const [u, E] = _(), [x, H] = _(q), [K, O] = _(!1), [T, F] = _(), [$, I] = _(!1), [b, Q] = _(
|
|
6091
6097
|
s ?? []
|
|
6092
|
-
), s1 =
|
|
6098
|
+
), s1 = R1(x.offset), h1 = R1(T), [X, z] = _(!1), j = Y(!1), c1 = W(
|
|
6093
6099
|
async ({
|
|
6094
|
-
limit:
|
|
6095
|
-
offset:
|
|
6096
|
-
search:
|
|
6100
|
+
limit: v = k1,
|
|
6101
|
+
offset: B,
|
|
6102
|
+
search: d
|
|
6097
6103
|
}) => {
|
|
6098
6104
|
O(!0);
|
|
6099
6105
|
try {
|
|
6100
6106
|
const w = await i({
|
|
6101
|
-
limit:
|
|
6102
|
-
offset:
|
|
6103
|
-
search:
|
|
6107
|
+
limit: v,
|
|
6108
|
+
offset: B,
|
|
6109
|
+
search: d
|
|
6104
6110
|
});
|
|
6105
|
-
|
|
6106
|
-
(
|
|
6107
|
-
),
|
|
6108
|
-
...
|
|
6111
|
+
E(
|
|
6112
|
+
(R) => B === 0 ? w.options : [...R ?? [], ...w.options]
|
|
6113
|
+
), H((R) => ({
|
|
6114
|
+
...R,
|
|
6109
6115
|
count: w.count
|
|
6110
6116
|
}));
|
|
6111
6117
|
} catch (w) {
|
|
@@ -6115,59 +6121,59 @@ const k1 = 100, q = {
|
|
|
6115
6121
|
}
|
|
6116
6122
|
},
|
|
6117
6123
|
[i]
|
|
6118
|
-
), S = q3((
|
|
6119
|
-
F(
|
|
6124
|
+
), S = q3((v) => {
|
|
6125
|
+
F(v), v || H(q);
|
|
6120
6126
|
}), e1 = W(
|
|
6121
|
-
(
|
|
6127
|
+
(v) => S(v),
|
|
6122
6128
|
[S]
|
|
6123
6129
|
), a1 = W(
|
|
6124
|
-
async (
|
|
6125
|
-
K ||
|
|
6126
|
-
...
|
|
6127
|
-
offset:
|
|
6130
|
+
async (v) => {
|
|
6131
|
+
K || v && x.count && x.count > ((u == null ? void 0 : u.length) ?? 0) && H((B) => ({
|
|
6132
|
+
...B,
|
|
6133
|
+
offset: B.offset + k1
|
|
6128
6134
|
}));
|
|
6129
6135
|
},
|
|
6130
|
-
[K, u == null ? void 0 : u.length,
|
|
6136
|
+
[K, u == null ? void 0 : u.length, x.count]
|
|
6131
6137
|
), C1 = W(
|
|
6132
|
-
(
|
|
6133
|
-
|
|
6138
|
+
(v) => {
|
|
6139
|
+
I(v), !v && T && (F(void 0), H(q), z(!0)), f == null || f(v);
|
|
6134
6140
|
},
|
|
6135
|
-
[
|
|
6141
|
+
[f, T]
|
|
6136
6142
|
);
|
|
6137
|
-
|
|
6143
|
+
A(() => {
|
|
6138
6144
|
if (!j.current || K) return;
|
|
6139
|
-
(X || $ && (s1 !==
|
|
6140
|
-
}, [X, $,
|
|
6141
|
-
(
|
|
6142
|
-
}, []),
|
|
6143
|
-
s && Q((
|
|
6144
|
-
const
|
|
6145
|
-
(
|
|
6145
|
+
(X || $ && (s1 !== x.offset || h1 !== T || !u)) && (c1({ offset: x.offset, limit: k1, search: T }), X && z(!1));
|
|
6146
|
+
}, [X, $, x.offset, T, s1, h1, u, K]), A(() => {
|
|
6147
|
+
(C || h) && c1(q), j.current = !0;
|
|
6148
|
+
}, []), A(() => {
|
|
6149
|
+
s && Q((v) => {
|
|
6150
|
+
const B = s.filter(
|
|
6151
|
+
(d) => !v.some((w) => w.value === d.value)
|
|
6146
6152
|
);
|
|
6147
|
-
return [...
|
|
6153
|
+
return [...v, ...B];
|
|
6148
6154
|
});
|
|
6149
6155
|
}, [s]);
|
|
6150
6156
|
const J = W(
|
|
6151
|
-
(
|
|
6152
|
-
e && e(
|
|
6153
|
-
let
|
|
6154
|
-
if (m ?
|
|
6155
|
-
const
|
|
6156
|
-
(w) => !(
|
|
6157
|
+
(v) => {
|
|
6158
|
+
e && e(v);
|
|
6159
|
+
let B = [];
|
|
6160
|
+
if (m ? B = Array.isArray(v) ? v : [] : B = v ? [v] : [], T) {
|
|
6161
|
+
const d = B.filter(
|
|
6162
|
+
(w) => !(b != null && b.some((R) => R.value === w))
|
|
6157
6163
|
);
|
|
6158
|
-
|
|
6164
|
+
d.length > 0 && Q((w = []) => [
|
|
6159
6165
|
...w,
|
|
6160
|
-
...
|
|
6161
|
-
const w1 = u == null ? void 0 : u.find((o1) => o1.value ===
|
|
6166
|
+
...d.map((R) => {
|
|
6167
|
+
const w1 = u == null ? void 0 : u.find((o1) => o1.value === R);
|
|
6162
6168
|
return {
|
|
6163
|
-
value:
|
|
6164
|
-
label: (w1 == null ? void 0 : w1.label) ??
|
|
6169
|
+
value: R,
|
|
6170
|
+
label: (w1 == null ? void 0 : w1.label) ?? R
|
|
6165
6171
|
};
|
|
6166
6172
|
})
|
|
6167
|
-
]), F(void 0),
|
|
6173
|
+
]), F(void 0), H(q), z(!0);
|
|
6168
6174
|
}
|
|
6169
6175
|
},
|
|
6170
|
-
[e, T, m, u,
|
|
6176
|
+
[e, T, m, u, b]
|
|
6171
6177
|
), d1 = A1(
|
|
6172
6178
|
() => ({
|
|
6173
6179
|
id: n,
|
|
@@ -6183,14 +6189,14 @@ const k1 = 100, q = {
|
|
|
6183
6189
|
scrollThresholdValue: p,
|
|
6184
6190
|
onScrollToEnd: a1,
|
|
6185
6191
|
disabled: a,
|
|
6186
|
-
extraOptions:
|
|
6192
|
+
extraOptions: b,
|
|
6187
6193
|
isLoading: K,
|
|
6188
|
-
optionRender:
|
|
6189
|
-
dropdownRender:
|
|
6190
|
-
readOnly:
|
|
6191
|
-
clearable:
|
|
6192
|
-
required:
|
|
6193
|
-
error:
|
|
6194
|
+
optionRender: N,
|
|
6195
|
+
dropdownRender: V,
|
|
6196
|
+
readOnly: Z,
|
|
6197
|
+
clearable: L,
|
|
6198
|
+
required: G,
|
|
6199
|
+
error: M
|
|
6194
6200
|
}),
|
|
6195
6201
|
[
|
|
6196
6202
|
n,
|
|
@@ -6205,19 +6211,19 @@ const k1 = 100, q = {
|
|
|
6205
6211
|
p,
|
|
6206
6212
|
a1,
|
|
6207
6213
|
a,
|
|
6208
|
-
|
|
6214
|
+
b,
|
|
6209
6215
|
K,
|
|
6210
|
-
|
|
6211
|
-
I,
|
|
6216
|
+
N,
|
|
6212
6217
|
V,
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6218
|
+
Z,
|
|
6219
|
+
L,
|
|
6220
|
+
G,
|
|
6221
|
+
M
|
|
6216
6222
|
]
|
|
6217
6223
|
);
|
|
6218
6224
|
return u1(y, () => ({
|
|
6219
6225
|
refetchOptions: async () => {
|
|
6220
|
-
|
|
6226
|
+
H(q), F(void 0), z(!0);
|
|
6221
6227
|
}
|
|
6222
6228
|
})), m ? /* @__PURE__ */ t(M1, { ...d1, value: l, mode: m }) : /* @__PURE__ */ t("div", { className: "snmt-async-select", children: /* @__PURE__ */ t(M1, { ...d1, value: l }) });
|
|
6223
6229
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snmt-react-ui/async-select",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.23",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/async-select.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"build": "tsc && vite build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@snmt-react-ui/select": "^1.18.
|
|
21
|
+
"@snmt-react-ui/select": "^1.18.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"antd": "^5.18.3"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "17d865b0e12710b8f2abbe30a08abfa5f245144d"
|
|
27
27
|
}
|