@snmt-react-ui/async-select 1.7.7 → 1.8.0
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 +278 -275
- package/package.json +2 -2
package/dist/async-select.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { jsx as t, Fragment as
|
|
3
|
-
import { createContext as r1, forwardRef as
|
|
2
|
+
import { jsx as t, Fragment as F, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as r1, forwardRef as k1, useState as H, useRef as q, useEffect as I, useCallback as W, useContext as n1, useMemo as Z1, useImperativeHandle as W1 } from "react";
|
|
4
4
|
import { Select as I1, Flex as A1, Avatar as B1, Checkbox as G1, Typography as x1, Tag as y1, Popover as D1 } from "antd";
|
|
5
5
|
var j1 = Object.defineProperty, T1 = (i, o, e) => o in i ? j1(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e, Y1 = (i, o, e) => T1(i, o + "", e), K1 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6
6
|
function b1() {
|
|
7
7
|
if (console && console.warn) {
|
|
8
8
|
for (var i = arguments.length, o = new Array(i), e = 0; e < i; e++)
|
|
9
9
|
o[e] = arguments[e];
|
|
10
|
-
|
|
10
|
+
U(o[0]) && (o[0] = `react-i18next:: ${o[0]}`), console.warn(...o);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
const m1 = {};
|
|
14
|
-
function
|
|
14
|
+
function p1() {
|
|
15
15
|
for (var i = arguments.length, o = new Array(i), e = 0; e < i; e++)
|
|
16
16
|
o[e] = arguments[e];
|
|
17
|
-
|
|
17
|
+
U(o[0]) && m1[o[0]] || (U(o[0]) && (m1[o[0]] = /* @__PURE__ */ new Date()), b1(...o));
|
|
18
18
|
}
|
|
19
19
|
const _1 = (i, o) => () => {
|
|
20
20
|
if (i.isInitialized)
|
|
@@ -30,27 +30,27 @@ const _1 = (i, o) => () => {
|
|
|
30
30
|
}, u1 = (i, o, e) => {
|
|
31
31
|
i.loadNamespaces(o, _1(i, e));
|
|
32
32
|
}, v1 = (i, o, e, l) => {
|
|
33
|
-
|
|
33
|
+
U(e) && (e = [e]), e.forEach((r) => {
|
|
34
34
|
i.options.ns.indexOf(r) < 0 && i.options.ns.push(r);
|
|
35
35
|
}), i.loadLanguages(o, _1(i, l));
|
|
36
36
|
}, O1 = function(i, o) {
|
|
37
37
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
38
38
|
const l = o.languages[0], r = o.options ? o.options.fallbackLng : !1, a = o.languages[o.languages.length - 1];
|
|
39
39
|
if (l.toLowerCase() === "cimode") return !0;
|
|
40
|
-
const g = (n,
|
|
41
|
-
const k = o.services.backendConnector.state[`${n}|${
|
|
40
|
+
const g = (n, m) => {
|
|
41
|
+
const k = o.services.backendConnector.state[`${n}|${m}`];
|
|
42
42
|
return k === -1 || k === 2;
|
|
43
43
|
};
|
|
44
44
|
return e.bindI18n && e.bindI18n.indexOf("languageChanging") > -1 && o.services.backendConnector.backend && o.isLanguageChangingTo && !g(o.isLanguageChangingTo, i) ? !1 : !!(o.hasResourceBundle(l, i) || !o.services.backendConnector.backend || o.options.resources && !o.options.partialBundledLanguages || g(l, i) && (!r || g(a, i)));
|
|
45
45
|
}, S1 = function(i, o) {
|
|
46
46
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
47
|
-
return !o.languages || !o.languages.length ? (
|
|
47
|
+
return !o.languages || !o.languages.length ? (p1("i18n.languages were undefined or empty", o.languages), !0) : o.options.ignoreJSONStructure !== void 0 ? o.hasLoadedNamespace(i, {
|
|
48
48
|
lng: e.lng,
|
|
49
49
|
precheck: (l, r) => {
|
|
50
50
|
if (e.bindI18n && e.bindI18n.indexOf("languageChanging") > -1 && l.services.backendConnector.backend && l.isLanguageChangingTo && !r(l.isLanguageChangingTo, i)) return !1;
|
|
51
51
|
}
|
|
52
52
|
}) : O1(i, o, e);
|
|
53
|
-
},
|
|
53
|
+
}, U = (i) => typeof i == "string", F1 = (i) => typeof i == "object" && i !== null, U1 = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, P1 = {
|
|
54
54
|
"&": "&",
|
|
55
55
|
"&": "&",
|
|
56
56
|
"<": "<",
|
|
@@ -96,11 +96,11 @@ class o2 {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
const i2 = (i, o) => {
|
|
99
|
-
const e =
|
|
100
|
-
return
|
|
99
|
+
const e = q();
|
|
100
|
+
return I(() => {
|
|
101
101
|
e.current = i;
|
|
102
102
|
}, [i, o]), e.current;
|
|
103
|
-
}, R1 = (i, o, e, l) => i.getFixedT(o, e, l), t2 = (i, o, e, l) =>
|
|
103
|
+
}, R1 = (i, o, e, l) => i.getFixedT(o, e, l), t2 = (i, o, e, l) => W(R1(i, o, e, l), [i, o, e, l]), l2 = function(i) {
|
|
104
104
|
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
105
105
|
const {
|
|
106
106
|
i18n: e
|
|
@@ -109,48 +109,48 @@ const i2 = (i, o) => {
|
|
|
109
109
|
defaultNS: r
|
|
110
110
|
} = n1(e2) || {}, a = e || l || X1();
|
|
111
111
|
if (a && !a.reportNamespaces && (a.reportNamespaces = new o2()), !a) {
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
return
|
|
112
|
+
p1("You will need to pass in an i18next instance by using initReactI18next");
|
|
113
|
+
const p = (N, f) => U(f) ? f : F1(f) && U(f.defaultValue) ? f.defaultValue : Array.isArray(N) ? N[N.length - 1] : N, _ = [p, {}, !1];
|
|
114
|
+
return _.t = p, _.i18n = {}, _.ready = !1, _;
|
|
115
115
|
}
|
|
116
|
-
a.options.react && a.options.react.wait !== void 0 &&
|
|
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 g = {
|
|
118
118
|
...q1(),
|
|
119
119
|
...a.options.react,
|
|
120
120
|
...o
|
|
121
121
|
}, {
|
|
122
122
|
useSuspense: n,
|
|
123
|
-
keyPrefix:
|
|
123
|
+
keyPrefix: m
|
|
124
124
|
} = g;
|
|
125
125
|
let k = i;
|
|
126
|
-
k =
|
|
127
|
-
const h = (a.isInitialized || a.initializedStoreOnce) && k.every((
|
|
128
|
-
let
|
|
129
|
-
o.lng && (
|
|
130
|
-
const
|
|
131
|
-
|
|
126
|
+
k = U(k) ? [k] : k || ["translation"], a.reportNamespaces.addUsedNamespaces && a.reportNamespaces.addUsedNamespaces(k);
|
|
127
|
+
const h = (a.isInitialized || a.initializedStoreOnce) && k.every((p) => S1(p, a, g)), s = t2(a, o.lng || null, g.nsMode === "fallback" ? k : k[0], m), M = () => s, E = () => R1(a, o.lng || null, g.nsMode === "fallback" ? k : k[0], m), [B, G] = H(M);
|
|
128
|
+
let x = k.join();
|
|
129
|
+
o.lng && (x = `${o.lng}${x}`);
|
|
130
|
+
const K = i2(x), Z = q(!0);
|
|
131
|
+
I(() => {
|
|
132
132
|
const {
|
|
133
|
-
bindI18n:
|
|
134
|
-
bindI18nStore:
|
|
133
|
+
bindI18n: p,
|
|
134
|
+
bindI18nStore: _
|
|
135
135
|
} = g;
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
Z.current = !0, !h && !n && (o.lng ? v1(a, o.lng, k, () => {
|
|
137
|
+
Z.current && G(E);
|
|
138
138
|
}) : u1(a, k, () => {
|
|
139
|
-
|
|
140
|
-
})), h &&
|
|
141
|
-
const
|
|
142
|
-
|
|
139
|
+
Z.current && G(E);
|
|
140
|
+
})), h && K && K !== x && Z.current && G(E);
|
|
141
|
+
const N = () => {
|
|
142
|
+
Z.current && G(E);
|
|
143
143
|
};
|
|
144
|
-
return
|
|
145
|
-
|
|
144
|
+
return p && a && a.on(p, N), _ && a && a.store.on(_, N), () => {
|
|
145
|
+
Z.current = !1, p && a && p.split(" ").forEach((f) => a.off(f, N)), _ && a && _.split(" ").forEach((f) => a.store.off(f, N));
|
|
146
146
|
};
|
|
147
|
-
}, [a,
|
|
148
|
-
|
|
149
|
-
}, [a,
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
152
|
-
throw new Promise((
|
|
153
|
-
o.lng ? v1(a, o.lng, k, () =>
|
|
147
|
+
}, [a, x]), I(() => {
|
|
148
|
+
Z.current && h && G(M);
|
|
149
|
+
}, [a, m, h]);
|
|
150
|
+
const A = [B, a, h];
|
|
151
|
+
if (A.t = B, A.i18n = a, A.ready = h, h || !h && !n) return A;
|
|
152
|
+
throw new Promise((p) => {
|
|
153
|
+
o.lng ? v1(a, o.lng, k, () => p()) : u1(a, k, () => p());
|
|
154
154
|
});
|
|
155
155
|
}, t1 = ({
|
|
156
156
|
children: i,
|
|
@@ -188,12 +188,12 @@ const i2 = (i, o) => {
|
|
|
188
188
|
}
|
|
189
189
|
);
|
|
190
190
|
};
|
|
191
|
-
var
|
|
192
|
-
const
|
|
191
|
+
var Y = /* @__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.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))(Y || {});
|
|
192
|
+
const L1 = r1({
|
|
193
193
|
locale: "en",
|
|
194
194
|
theme: "light"
|
|
195
195
|
});
|
|
196
|
-
|
|
196
|
+
L1.Provider;
|
|
197
197
|
const n2 = ({
|
|
198
198
|
checked: i = !0,
|
|
199
199
|
indeterminate: o = !1,
|
|
@@ -202,17 +202,17 @@ const n2 = ({
|
|
|
202
202
|
disabled: r = !1,
|
|
203
203
|
disableUncheck: a = !1
|
|
204
204
|
}) => {
|
|
205
|
-
const [g, n] = H(i), [
|
|
206
|
-
|
|
205
|
+
const [g, n] = H(i), [m, k] = H(o);
|
|
206
|
+
I(() => {
|
|
207
207
|
n(i), k(o);
|
|
208
208
|
}, [i, o]);
|
|
209
|
-
const { theme: h } = n1(
|
|
209
|
+
const { theme: h } = n1(L1);
|
|
210
210
|
return /* @__PURE__ */ t(
|
|
211
211
|
G1,
|
|
212
212
|
{
|
|
213
213
|
className: `snmt-checkbox snmt-checkbox-${h}`,
|
|
214
214
|
checked: g,
|
|
215
|
-
indeterminate:
|
|
215
|
+
indeterminate: m,
|
|
216
216
|
onChange: (s) => {
|
|
217
217
|
a && g || (k(!1), n(s.target.checked), l && l(s));
|
|
218
218
|
},
|
|
@@ -3472,14 +3472,14 @@ const s2 = ({
|
|
|
3472
3472
|
disabled: a = !1,
|
|
3473
3473
|
onClick: g
|
|
3474
3474
|
}) => {
|
|
3475
|
-
const [n,
|
|
3476
|
-
return
|
|
3475
|
+
const [n, m] = H(r), { theme: k } = n1(H1), h = a ? k && k === "dark" ? d.GREY_LIGHT_4 : d.GREY_DARK_1 : l, s = a ? void 0 : g;
|
|
3476
|
+
return I(() => {
|
|
3477
3477
|
if (r) {
|
|
3478
|
-
s && !a &&
|
|
3478
|
+
s && !a && m(`${r} clickable`);
|
|
3479
3479
|
return;
|
|
3480
3480
|
}
|
|
3481
|
-
s && !a &&
|
|
3482
|
-
}, [s, r, a]), /* @__PURE__ */ t(
|
|
3481
|
+
s && !a && m("clickable");
|
|
3482
|
+
}, [s, r, a]), /* @__PURE__ */ t(F, { children: (() => {
|
|
3483
3483
|
switch (i) {
|
|
3484
3484
|
case "nextIcon":
|
|
3485
3485
|
return X2({ width: o, height: e, color: h, className: n, onClick: s });
|
|
@@ -3734,7 +3734,7 @@ const s2 = ({
|
|
|
3734
3734
|
case "docs":
|
|
3735
3735
|
return b5({ width: o, height: e, color: h, className: n, onClick: s });
|
|
3736
3736
|
default:
|
|
3737
|
-
return /* @__PURE__ */ t(
|
|
3737
|
+
return /* @__PURE__ */ t(F, { children: "No Icon provided" });
|
|
3738
3738
|
}
|
|
3739
3739
|
})() });
|
|
3740
3740
|
}, { Title: O5, Text: S5 } = x1, F5 = {
|
|
@@ -3742,7 +3742,7 @@ const s2 = ({
|
|
|
3742
3742
|
h2: 2,
|
|
3743
3743
|
h3: 3,
|
|
3744
3744
|
h4: 4
|
|
3745
|
-
}, U5 =
|
|
3745
|
+
}, U5 = k1(
|
|
3746
3746
|
({
|
|
3747
3747
|
align: i = "inherit",
|
|
3748
3748
|
variant: o = "body1",
|
|
@@ -3752,9 +3752,9 @@ const s2 = ({
|
|
|
3752
3752
|
collapsed: a,
|
|
3753
3753
|
whiteSpace: g = "normal"
|
|
3754
3754
|
}, n) => {
|
|
3755
|
-
const
|
|
3755
|
+
const m = o === "h1" || o === "h2" || o === "h3" || o === "h4";
|
|
3756
3756
|
let k = `snmt-typography snmt-typography-${o}`;
|
|
3757
|
-
return i && i !== "inherit" && (k += ` snmt-typography-align-${i}`), a && (k += " collapsed"),
|
|
3757
|
+
return i && i !== "inherit" && (k += ` snmt-typography-align-${i}`), a && (k += " collapsed"), m ? /* @__PURE__ */ t(
|
|
3758
3758
|
O5,
|
|
3759
3759
|
{
|
|
3760
3760
|
className: k,
|
|
@@ -7027,14 +7027,14 @@ const P5 = ({
|
|
|
7027
7027
|
disabled: a = !1,
|
|
7028
7028
|
onClick: g
|
|
7029
7029
|
}) => {
|
|
7030
|
-
const [n,
|
|
7031
|
-
return
|
|
7030
|
+
const [n, m] = H(r), { theme: k } = n1(V1), h = a ? k && k === "dark" ? w.GREY_LIGHT_4 : w.GREY_DARK_1 : l, s = a ? void 0 : g;
|
|
7031
|
+
return I(() => {
|
|
7032
7032
|
if (r) {
|
|
7033
|
-
s && !a &&
|
|
7033
|
+
s && !a && m(`${r} clickable`);
|
|
7034
7034
|
return;
|
|
7035
7035
|
}
|
|
7036
|
-
s && !a &&
|
|
7037
|
-
}, [s, r, a]), /* @__PURE__ */ t(
|
|
7036
|
+
s && !a && m("clickable");
|
|
7037
|
+
}, [s, r, a]), /* @__PURE__ */ t(F, { children: (() => {
|
|
7038
7038
|
switch (i) {
|
|
7039
7039
|
case "nextIcon":
|
|
7040
7040
|
return T3({ width: o, height: e, color: h, className: n, onClick: s });
|
|
@@ -7289,7 +7289,7 @@ const P5 = ({
|
|
|
7289
7289
|
case "docs":
|
|
7290
7290
|
return V0({ width: o, height: e, color: h, className: n, onClick: s });
|
|
7291
7291
|
default:
|
|
7292
|
-
return /* @__PURE__ */ t(
|
|
7292
|
+
return /* @__PURE__ */ t(F, { children: "No Icon provided" });
|
|
7293
7293
|
}
|
|
7294
7294
|
})() });
|
|
7295
7295
|
};
|
|
@@ -7342,7 +7342,7 @@ const E1 = ({
|
|
|
7342
7342
|
h2: 2,
|
|
7343
7343
|
h3: 3,
|
|
7344
7344
|
h4: 4
|
|
7345
|
-
}, B0 =
|
|
7345
|
+
}, B0 = k1(
|
|
7346
7346
|
({
|
|
7347
7347
|
align: i = "inherit",
|
|
7348
7348
|
variant: o = "body1",
|
|
@@ -7352,9 +7352,9 @@ const E1 = ({
|
|
|
7352
7352
|
collapsed: a,
|
|
7353
7353
|
whiteSpace: g = "normal"
|
|
7354
7354
|
}, n) => {
|
|
7355
|
-
const
|
|
7355
|
+
const m = o === "h1" || o === "h2" || o === "h3" || o === "h4";
|
|
7356
7356
|
let k = `snmt-typography snmt-typography-${o}`;
|
|
7357
|
-
return i && i !== "inherit" && (k += ` snmt-typography-align-${i}`), a && (k += " collapsed"),
|
|
7357
|
+
return i && i !== "inherit" && (k += ` snmt-typography-align-${i}`), a && (k += " collapsed"), m ? /* @__PURE__ */ t(
|
|
7358
7358
|
W0,
|
|
7359
7359
|
{
|
|
7360
7360
|
className: k,
|
|
@@ -7393,8 +7393,8 @@ const E1 = ({
|
|
|
7393
7393
|
trigger: "click",
|
|
7394
7394
|
overlayClassName: `snmt-popover ${a ? "" : "padding"}`,
|
|
7395
7395
|
open: e ?? g,
|
|
7396
|
-
onOpenChange: (
|
|
7397
|
-
n(
|
|
7396
|
+
onOpenChange: (m) => {
|
|
7397
|
+
n(m), l == null || l(m);
|
|
7398
7398
|
},
|
|
7399
7399
|
children: /* @__PURE__ */ t("div", { className: "wrapper", children: i })
|
|
7400
7400
|
}
|
|
@@ -7420,29 +7420,29 @@ const D0 = ({
|
|
|
7420
7420
|
options: a,
|
|
7421
7421
|
extraOptions: g
|
|
7422
7422
|
}) => {
|
|
7423
|
-
const { locale: n } = n1(
|
|
7424
|
-
if (
|
|
7423
|
+
const { locale: n } = n1(L1), { t: m } = l2("common", { lng: n }), [k, h] = H(!1);
|
|
7424
|
+
if (I(() => {
|
|
7425
7425
|
i.length || h(!1);
|
|
7426
7426
|
}, [i]), !i.length)
|
|
7427
7427
|
return null;
|
|
7428
|
-
const s = (
|
|
7429
|
-
var
|
|
7430
|
-
return ((
|
|
7428
|
+
const s = (M) => {
|
|
7429
|
+
var E, B;
|
|
7430
|
+
return ((E = a == null ? void 0 : a.find((x) => x.value === M)) == null ? void 0 : E.label) || ((B = g == null ? void 0 : g.find((x) => x.value === M)) == null ? void 0 : B.label) || M;
|
|
7431
7431
|
};
|
|
7432
7432
|
return /* @__PURE__ */ c(
|
|
7433
7433
|
G0,
|
|
7434
7434
|
{
|
|
7435
7435
|
content: (
|
|
7436
7436
|
// 90: paddings + margins + gaps and so on
|
|
7437
|
-
/* @__PURE__ */ t("div", { style: { maxWidth: e - 90 }, className: "snmt-popover-from-select", children: /* @__PURE__ */ t(t1, { gap: 6, flexWrap: "wrap", children: i.map(({ value:
|
|
7437
|
+
/* @__PURE__ */ t("div", { style: { maxWidth: e - 90 }, className: "snmt-popover-from-select", children: /* @__PURE__ */ t(t1, { gap: 6, flexWrap: "wrap", children: i.map(({ value: M }) => /* @__PURE__ */ t(
|
|
7438
7438
|
E1,
|
|
7439
7439
|
{
|
|
7440
|
-
onClose: () => o(
|
|
7440
|
+
onClose: () => o(M),
|
|
7441
7441
|
closable: l,
|
|
7442
7442
|
disabled: r,
|
|
7443
|
-
children: s(
|
|
7443
|
+
children: s(M)
|
|
7444
7444
|
},
|
|
7445
|
-
|
|
7445
|
+
M
|
|
7446
7446
|
)) }) })
|
|
7447
7447
|
),
|
|
7448
7448
|
placement: "bottomRight",
|
|
@@ -7451,7 +7451,7 @@ const D0 = ({
|
|
|
7451
7451
|
children: [
|
|
7452
7452
|
i.length,
|
|
7453
7453
|
" ",
|
|
7454
|
-
|
|
7454
|
+
m("more")
|
|
7455
7455
|
]
|
|
7456
7456
|
}
|
|
7457
7457
|
);
|
|
@@ -7463,7 +7463,7 @@ const D0 = ({
|
|
|
7463
7463
|
backgroundSize: "20% calc(200% + 20px)"
|
|
7464
7464
|
};
|
|
7465
7465
|
return /* @__PURE__ */ t("span", { className: "snmt-loader", style: l });
|
|
7466
|
-
}, f1 =
|
|
7466
|
+
}, f1 = k1(
|
|
7467
7467
|
({
|
|
7468
7468
|
value: i,
|
|
7469
7469
|
onChange: o,
|
|
@@ -7473,161 +7473,161 @@ const D0 = ({
|
|
|
7473
7473
|
options: a,
|
|
7474
7474
|
width: g,
|
|
7475
7475
|
disabled: n = !1,
|
|
7476
|
-
required:
|
|
7476
|
+
required: m = !1,
|
|
7477
7477
|
clearable: k = !1,
|
|
7478
7478
|
scrollThresholdValue: h = 50,
|
|
7479
7479
|
onSearchChange: s,
|
|
7480
|
-
onDropdownVisibleChange:
|
|
7481
|
-
onScrollToEnd:
|
|
7482
|
-
onPopupScroll:
|
|
7483
|
-
id:
|
|
7484
|
-
extraOptions:
|
|
7485
|
-
dropdownRender:
|
|
7486
|
-
optionRender:
|
|
7487
|
-
isLoading:
|
|
7488
|
-
readOnly:
|
|
7489
|
-
error:
|
|
7490
|
-
},
|
|
7491
|
-
const [
|
|
7492
|
-
|
|
7493
|
-
|
|
7480
|
+
onDropdownVisibleChange: M,
|
|
7481
|
+
onScrollToEnd: E,
|
|
7482
|
+
onPopupScroll: B,
|
|
7483
|
+
id: G,
|
|
7484
|
+
extraOptions: x,
|
|
7485
|
+
dropdownRender: K,
|
|
7486
|
+
optionRender: Z,
|
|
7487
|
+
isLoading: A,
|
|
7488
|
+
readOnly: p,
|
|
7489
|
+
error: _
|
|
7490
|
+
}, N) => {
|
|
7491
|
+
const [f, j] = H(!1), [b, y] = H(!1), [O, P] = H(!0), [R, D] = H(i), Q = q(null);
|
|
7492
|
+
I(() => {
|
|
7493
|
+
D(i);
|
|
7494
7494
|
}, [i]);
|
|
7495
7495
|
const s1 = (C) => {
|
|
7496
|
-
|
|
7497
|
-
},
|
|
7498
|
-
var
|
|
7499
|
-
return !!((
|
|
7500
|
-
},
|
|
7501
|
-
|
|
7502
|
-
},
|
|
7503
|
-
|
|
7504
|
-
},
|
|
7496
|
+
j(C), M && M(C);
|
|
7497
|
+
}, h1 = (C, L) => {
|
|
7498
|
+
var v;
|
|
7499
|
+
return !!((v = L == null ? void 0 : L.label) != null && v.toString().toLowerCase().includes(C.toLowerCase()));
|
|
7500
|
+
}, X = () => {
|
|
7501
|
+
y(!0);
|
|
7502
|
+
}, $ = () => {
|
|
7503
|
+
y(!1);
|
|
7504
|
+
}, T = W(
|
|
7505
7505
|
(C) => {
|
|
7506
|
-
if (
|
|
7507
|
-
const
|
|
7508
|
-
o == null || o(
|
|
7506
|
+
if (D(C), l) {
|
|
7507
|
+
const v = C;
|
|
7508
|
+
o == null || o(v);
|
|
7509
7509
|
return;
|
|
7510
7510
|
}
|
|
7511
|
-
const
|
|
7512
|
-
o == null || o(
|
|
7511
|
+
const L = C;
|
|
7512
|
+
o == null || o(L);
|
|
7513
7513
|
},
|
|
7514
7514
|
[l, o]
|
|
7515
|
-
), c1 =
|
|
7516
|
-
if (!
|
|
7515
|
+
), c1 = W(() => {
|
|
7516
|
+
if (!p) {
|
|
7517
7517
|
if (l) {
|
|
7518
|
-
|
|
7518
|
+
T([]);
|
|
7519
7519
|
return;
|
|
7520
7520
|
}
|
|
7521
|
-
|
|
7521
|
+
T("");
|
|
7522
7522
|
}
|
|
7523
|
-
}, [
|
|
7523
|
+
}, [T, l, p]), S = W(
|
|
7524
7524
|
(C) => {
|
|
7525
|
-
const
|
|
7526
|
-
|
|
7525
|
+
const L = R.filter((v) => v !== C);
|
|
7526
|
+
T(L), D(L);
|
|
7527
7527
|
},
|
|
7528
|
-
[
|
|
7529
|
-
),
|
|
7530
|
-
(C) => (
|
|
7528
|
+
[T, R]
|
|
7529
|
+
), e1 = W(
|
|
7530
|
+
(C) => (R == null ? void 0 : R.indexOf(C)) === 0 ? (
|
|
7531
7531
|
// if the search input is empty
|
|
7532
7532
|
// then display the placeholder, else do not display it
|
|
7533
|
-
/* @__PURE__ */ t("span", { className: "custom-placeholder", children:
|
|
7534
|
-
) : /* @__PURE__ */ t(
|
|
7535
|
-
[
|
|
7533
|
+
/* @__PURE__ */ t("span", { className: "custom-placeholder", children: O ? e : "" })
|
|
7534
|
+
) : /* @__PURE__ */ t(F, {}),
|
|
7535
|
+
[O, R, e]
|
|
7536
7536
|
), a1 = (C) => {
|
|
7537
7537
|
C.preventDefault(), C.stopPropagation();
|
|
7538
7538
|
}, C1 = async (C) => {
|
|
7539
|
-
const { target:
|
|
7540
|
-
|
|
7541
|
-
},
|
|
7539
|
+
const { target: L } = C;
|
|
7540
|
+
L.scrollTop + L.offsetHeight >= L.scrollHeight - h && (E == null || E(!0)), B && await B(C);
|
|
7541
|
+
}, z = W(
|
|
7542
7542
|
(C) => {
|
|
7543
|
-
var
|
|
7544
|
-
return ((
|
|
7545
|
-
(
|
|
7546
|
-
)) == null ? void 0 :
|
|
7543
|
+
var L, v;
|
|
7544
|
+
return ((L = a.find((o1) => o1.value === C)) == null ? void 0 : L.label) || ((v = x == null ? void 0 : x.find(
|
|
7545
|
+
(o1) => o1.value === C
|
|
7546
|
+
)) == null ? void 0 : v.label) || C;
|
|
7547
7547
|
},
|
|
7548
|
-
[
|
|
7549
|
-
),
|
|
7548
|
+
[x, a]
|
|
7549
|
+
), d1 = W(
|
|
7550
7550
|
(C) => {
|
|
7551
|
-
var
|
|
7551
|
+
var L;
|
|
7552
7552
|
return /* @__PURE__ */ t(
|
|
7553
7553
|
D0,
|
|
7554
7554
|
{
|
|
7555
7555
|
values: C,
|
|
7556
|
-
onTagClose:
|
|
7557
|
-
maxWidth: ((
|
|
7556
|
+
onTagClose: S,
|
|
7557
|
+
maxWidth: ((L = Q.current) == null ? void 0 : L.clientWidth) || 0,
|
|
7558
7558
|
disabled: n,
|
|
7559
|
-
closable: !
|
|
7559
|
+
closable: !p,
|
|
7560
7560
|
options: a,
|
|
7561
|
-
extraOptions:
|
|
7561
|
+
extraOptions: x
|
|
7562
7562
|
}
|
|
7563
7563
|
);
|
|
7564
7564
|
},
|
|
7565
|
-
[n,
|
|
7566
|
-
),
|
|
7567
|
-
({ label: C, value:
|
|
7568
|
-
[n,
|
|
7569
|
-
),
|
|
7565
|
+
[n, x, S, a, p]
|
|
7566
|
+
), u = W(
|
|
7567
|
+
({ label: C, value: L, mode: v }) => v === "filter" ? e1(L) : /* @__PURE__ */ t("div", { onMouseDown: a1, className: "tag-wrapper", children: /* @__PURE__ */ t(E1, { onClose: () => S(L), disabled: n, children: typeof C == "object" ? C : z(L) }) }),
|
|
7568
|
+
[n, z, S, e1]
|
|
7569
|
+
), V = Array.isArray(R) && R.length > 0 || !!R && typeof R == "string" && R.trim() !== "";
|
|
7570
7570
|
return /* @__PURE__ */ c(
|
|
7571
7571
|
"div",
|
|
7572
7572
|
{
|
|
7573
|
-
className: `snmt-select-1-15-6 ${
|
|
7574
|
-
${l ? "" : "snmt-select-single"} ${
|
|
7575
|
-
ref:
|
|
7573
|
+
className: `snmt-select-1-15-6 ${b ? "snmt-select-focused" : ""}
|
|
7574
|
+
${l ? "" : "snmt-select-single"} ${p ? "snmt-select-read-only" : ""}`,
|
|
7575
|
+
ref: Q,
|
|
7576
7576
|
style: { width: g },
|
|
7577
7577
|
children: [
|
|
7578
7578
|
/* @__PURE__ */ t(
|
|
7579
7579
|
I1,
|
|
7580
7580
|
{
|
|
7581
7581
|
className: "snmt-select-blank",
|
|
7582
|
-
popupClassName:
|
|
7583
|
-
id:
|
|
7584
|
-
ref:
|
|
7582
|
+
popupClassName: p ? "dropdown-read-only" : "",
|
|
7583
|
+
id: G,
|
|
7584
|
+
ref: N,
|
|
7585
7585
|
showSearch: !!r,
|
|
7586
|
-
filterOption: r &&
|
|
7586
|
+
filterOption: r && h1,
|
|
7587
7587
|
onDropdownVisibleChange: s1,
|
|
7588
7588
|
disabled: n,
|
|
7589
|
-
value:
|
|
7590
|
-
labelRender: (C) =>
|
|
7589
|
+
value: R || void 0,
|
|
7590
|
+
labelRender: (C) => z(C.value),
|
|
7591
7591
|
mode: l === "filter" ? "multiple" : l,
|
|
7592
|
-
onChange:
|
|
7593
|
-
onFocus:
|
|
7594
|
-
onBlur:
|
|
7592
|
+
onChange: T,
|
|
7593
|
+
onFocus: X,
|
|
7594
|
+
onBlur: $,
|
|
7595
7595
|
onSearch: (C) => {
|
|
7596
|
-
|
|
7596
|
+
P(!C), s && s(C);
|
|
7597
7597
|
},
|
|
7598
|
-
onSelect: () =>
|
|
7599
|
-
onDeselect: () =>
|
|
7600
|
-
tagRender: (C) =>
|
|
7598
|
+
onSelect: () => P(!0),
|
|
7599
|
+
onDeselect: () => P(!0),
|
|
7600
|
+
tagRender: (C) => u({ ...C, mode: l }),
|
|
7601
7601
|
maxTagCount: "responsive",
|
|
7602
|
-
maxTagPlaceholder:
|
|
7602
|
+
maxTagPlaceholder: d1,
|
|
7603
7603
|
onPopupScroll: C1,
|
|
7604
|
-
prefix:
|
|
7605
|
-
suffixIcon: /* @__PURE__ */ t("div", { className: "wrapper-suffix-icon", children: l !== "filter" && /* @__PURE__ */ c(
|
|
7606
|
-
|
|
7604
|
+
prefix: A && /* @__PURE__ */ t(N1, { size: 15 }),
|
|
7605
|
+
suffixIcon: /* @__PURE__ */ t("div", { className: "wrapper-suffix-icon", children: l !== "filter" && /* @__PURE__ */ c(F, { children: [
|
|
7606
|
+
R && !!R.length && (l || k) && /* @__PURE__ */ t("div", { onClick: c1, children: /* @__PURE__ */ t(
|
|
7607
7607
|
i1,
|
|
7608
7608
|
{
|
|
7609
7609
|
name: "cancel",
|
|
7610
|
-
color: n ?
|
|
7610
|
+
color: n ? Y.GREY_DARK_1 : Y.GREY_DARK_5
|
|
7611
7611
|
}
|
|
7612
7612
|
) }),
|
|
7613
7613
|
/* @__PURE__ */ t(
|
|
7614
7614
|
i1,
|
|
7615
7615
|
{
|
|
7616
7616
|
name: "selectArrowIcon",
|
|
7617
|
-
color: n ?
|
|
7618
|
-
className:
|
|
7619
|
-
onClick: () =>
|
|
7617
|
+
color: n ? Y.GREY_DARK_1 : Y.GREY_DARK_5,
|
|
7618
|
+
className: f ? "select-arrow-rotated" : "select-arrow",
|
|
7619
|
+
onClick: () => j(!f)
|
|
7620
7620
|
}
|
|
7621
7621
|
)
|
|
7622
7622
|
] }) }),
|
|
7623
|
-
removeIcon: /* @__PURE__ */ t(i1, { name: "errorSmall", color:
|
|
7623
|
+
removeIcon: /* @__PURE__ */ t(i1, { name: "errorSmall", color: Y.GREY_DARK_2 }),
|
|
7624
7624
|
options: a,
|
|
7625
|
-
optionRender: (C) =>
|
|
7625
|
+
optionRender: (C) => Z ? Z(C.data) : /* @__PURE__ */ c(t1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
|
7626
7626
|
/* @__PURE__ */ c(t1, { alignItems: "center", gap: 12, children: [
|
|
7627
7627
|
l && /* @__PURE__ */ t(
|
|
7628
7628
|
n2,
|
|
7629
7629
|
{
|
|
7630
|
-
checked: !!(
|
|
7630
|
+
checked: !!(R != null && R.includes(C.value))
|
|
7631
7631
|
}
|
|
7632
7632
|
),
|
|
7633
7633
|
/* @__PURE__ */ c(t1, { alignItems: "center", gap: 8, children: [
|
|
@@ -7635,41 +7635,41 @@ const D0 = ({
|
|
|
7635
7635
|
/* @__PURE__ */ t("span", { children: C.label })
|
|
7636
7636
|
] })
|
|
7637
7637
|
] }),
|
|
7638
|
-
!l &&
|
|
7638
|
+
!l && R === C.value && /* @__PURE__ */ t(
|
|
7639
7639
|
i1,
|
|
7640
7640
|
{
|
|
7641
7641
|
name: "ok",
|
|
7642
|
-
color:
|
|
7642
|
+
color: Y.BLUE_PRIMARY,
|
|
7643
7643
|
width: 16,
|
|
7644
7644
|
height: 16
|
|
7645
7645
|
}
|
|
7646
7646
|
)
|
|
7647
7647
|
] }),
|
|
7648
7648
|
dropdownRender: (C) => /* @__PURE__ */ c("div", { className: "dropdown-container", children: [
|
|
7649
|
-
/* @__PURE__ */ t("div", { className: "dropdown-menu", children:
|
|
7650
|
-
|
|
7649
|
+
/* @__PURE__ */ t("div", { className: "dropdown-menu", children: K ? K(C) : C }),
|
|
7650
|
+
A && /* @__PURE__ */ t("div", { className: "loading-overlay", children: /* @__PURE__ */ t(N1, { size: 28 }) })
|
|
7651
7651
|
] })
|
|
7652
7652
|
}
|
|
7653
7653
|
),
|
|
7654
|
-
e && /* @__PURE__ */ c(
|
|
7654
|
+
e && /* @__PURE__ */ c(F, { children: [
|
|
7655
7655
|
/* @__PURE__ */ t(
|
|
7656
7656
|
"label",
|
|
7657
7657
|
{
|
|
7658
|
-
className: `${
|
|
7659
|
-
children:
|
|
7658
|
+
className: `${b || V ? "label-floating" : ""} ${n ? "label-disabled" : ""} ${b ? "label-focused" : ""} ${A ? "label-loading" : ""} ${_ ? "label-error" : ""}`,
|
|
7659
|
+
children: m ? `${e}*` : e
|
|
7660
7660
|
}
|
|
7661
7661
|
),
|
|
7662
7662
|
/* @__PURE__ */ t(
|
|
7663
7663
|
"fieldset",
|
|
7664
7664
|
{
|
|
7665
|
-
className: `${
|
|
7666
|
-
children: /* @__PURE__ */ t("legend", { children: /* @__PURE__ */ t("span", { children:
|
|
7665
|
+
className: `${b ? "fieldset-focused" : ""} ${n ? "fieldset-disabled" : ""} ${V ? "fieldset-filled" : ""} ${_ ? "fieldset-error" : ""}`,
|
|
7666
|
+
children: /* @__PURE__ */ t("legend", { children: /* @__PURE__ */ t("span", { children: m ? `${e}*` : e }) })
|
|
7667
7667
|
}
|
|
7668
7668
|
)
|
|
7669
7669
|
] }),
|
|
7670
|
-
|
|
7671
|
-
/* @__PURE__ */ t(i1, { name: "attention", color:
|
|
7672
|
-
typeof
|
|
7670
|
+
_ && /* @__PURE__ */ c(t1, { justifyContent: "flex-start", gap: 6, children: [
|
|
7671
|
+
/* @__PURE__ */ t(i1, { name: "attention", color: Y.NOTIFICATION_ERROR_DARK }),
|
|
7672
|
+
typeof _ == "string" ? /* @__PURE__ */ t(B0, { color: Y.NOTIFICATION_ERROR_DARK, variant: "body4", children: _ }) : _
|
|
7673
7673
|
] })
|
|
7674
7674
|
]
|
|
7675
7675
|
}
|
|
@@ -7677,8 +7677,8 @@ const D0 = ({
|
|
|
7677
7677
|
}
|
|
7678
7678
|
);
|
|
7679
7679
|
function j0(i, o = 500) {
|
|
7680
|
-
const e =
|
|
7681
|
-
return
|
|
7680
|
+
const e = q();
|
|
7681
|
+
return I(() => () => {
|
|
7682
7682
|
e.current && clearTimeout(e.current);
|
|
7683
7683
|
}, []), (...r) => {
|
|
7684
7684
|
const a = setTimeout(() => {
|
|
@@ -7688,14 +7688,14 @@ function j0(i, o = 500) {
|
|
|
7688
7688
|
};
|
|
7689
7689
|
}
|
|
7690
7690
|
function M1(i) {
|
|
7691
|
-
const o =
|
|
7692
|
-
return
|
|
7691
|
+
const o = q(i);
|
|
7692
|
+
return I(() => {
|
|
7693
7693
|
o.current = i;
|
|
7694
7694
|
}, [i]), o.current;
|
|
7695
7695
|
}
|
|
7696
|
-
const
|
|
7696
|
+
const g1 = 100, J = {
|
|
7697
7697
|
offset: 0
|
|
7698
|
-
}, O0 =
|
|
7698
|
+
}, O0 = k1(
|
|
7699
7699
|
({
|
|
7700
7700
|
loadOptions: i,
|
|
7701
7701
|
width: o,
|
|
@@ -7705,148 +7705,151 @@ const k1 = 100, $ = {
|
|
|
7705
7705
|
disabled: a,
|
|
7706
7706
|
scrollThresholdValue: g,
|
|
7707
7707
|
placeholder: n,
|
|
7708
|
-
mode:
|
|
7708
|
+
mode: m,
|
|
7709
7709
|
loadOnClosedState: k,
|
|
7710
7710
|
preloadOptions: h,
|
|
7711
7711
|
extraOptions: s,
|
|
7712
|
-
onDropdownVisibleChange:
|
|
7713
|
-
optionRender:
|
|
7714
|
-
dropdownRender:
|
|
7715
|
-
readOnly:
|
|
7716
|
-
clearable:
|
|
7717
|
-
required:
|
|
7718
|
-
|
|
7719
|
-
|
|
7712
|
+
onDropdownVisibleChange: M,
|
|
7713
|
+
optionRender: E,
|
|
7714
|
+
dropdownRender: B,
|
|
7715
|
+
readOnly: G,
|
|
7716
|
+
clearable: x = !1,
|
|
7717
|
+
required: K = !1,
|
|
7718
|
+
error: Z
|
|
7719
|
+
}, A) => {
|
|
7720
|
+
const [p, _] = H(), [N, f] = H(J), [j, b] = H(!1), [y, O] = H(), [P, R] = H(!1), [D, Q] = H(
|
|
7720
7721
|
s ?? []
|
|
7721
|
-
),
|
|
7722
|
+
), s1 = M1(N.offset), h1 = M1(y), [X, $] = H(!1), T = q(!1), c1 = W(
|
|
7722
7723
|
async ({
|
|
7723
|
-
limit: u =
|
|
7724
|
-
offset:
|
|
7725
|
-
search:
|
|
7724
|
+
limit: u = g1,
|
|
7725
|
+
offset: V,
|
|
7726
|
+
search: C
|
|
7726
7727
|
}) => {
|
|
7727
|
-
|
|
7728
|
+
b(!0);
|
|
7728
7729
|
try {
|
|
7729
|
-
const
|
|
7730
|
+
const L = await i({
|
|
7730
7731
|
limit: u,
|
|
7731
|
-
offset:
|
|
7732
|
-
search:
|
|
7732
|
+
offset: V,
|
|
7733
|
+
search: C
|
|
7733
7734
|
});
|
|
7734
|
-
|
|
7735
|
-
(
|
|
7736
|
-
),
|
|
7737
|
-
...
|
|
7738
|
-
count:
|
|
7735
|
+
_(
|
|
7736
|
+
(v) => V === 0 ? L.options : [...v ?? [], ...L.options]
|
|
7737
|
+
), f((v) => ({
|
|
7738
|
+
...v,
|
|
7739
|
+
count: L.count
|
|
7739
7740
|
}));
|
|
7740
|
-
} catch (
|
|
7741
|
-
return console.error("AsyncSelect. fetchOptions error",
|
|
7741
|
+
} catch (L) {
|
|
7742
|
+
return console.error("AsyncSelect. fetchOptions error", L), [];
|
|
7742
7743
|
} finally {
|
|
7743
|
-
|
|
7744
|
+
b(!1);
|
|
7744
7745
|
}
|
|
7745
7746
|
},
|
|
7746
7747
|
[i]
|
|
7747
|
-
),
|
|
7748
|
-
|
|
7749
|
-
}),
|
|
7750
|
-
(u) =>
|
|
7751
|
-
[
|
|
7752
|
-
),
|
|
7748
|
+
), S = j0((u) => {
|
|
7749
|
+
O(u), u || f(J);
|
|
7750
|
+
}), e1 = W(
|
|
7751
|
+
(u) => S(u),
|
|
7752
|
+
[S]
|
|
7753
|
+
), a1 = W(
|
|
7753
7754
|
async (u) => {
|
|
7754
|
-
|
|
7755
|
-
...
|
|
7756
|
-
offset:
|
|
7755
|
+
j || u && N.count && N.count > ((p == null ? void 0 : p.length) ?? 0) && f((V) => ({
|
|
7756
|
+
...V,
|
|
7757
|
+
offset: V.offset + g1
|
|
7757
7758
|
}));
|
|
7758
7759
|
},
|
|
7759
|
-
[
|
|
7760
|
-
),
|
|
7760
|
+
[j, p == null ? void 0 : p.length, N.count]
|
|
7761
|
+
), C1 = W(
|
|
7761
7762
|
(u) => {
|
|
7762
|
-
|
|
7763
|
+
R(u), !u && y && (O(void 0), f(J), $(!0)), M == null || M(u);
|
|
7763
7764
|
},
|
|
7764
|
-
[
|
|
7765
|
+
[M, y]
|
|
7765
7766
|
);
|
|
7766
|
-
|
|
7767
|
-
if (!
|
|
7768
|
-
(
|
|
7769
|
-
}, [
|
|
7770
|
-
(k || h) &&
|
|
7771
|
-
}, []),
|
|
7772
|
-
s &&
|
|
7773
|
-
const
|
|
7774
|
-
(
|
|
7767
|
+
I(() => {
|
|
7768
|
+
if (!T.current || j) return;
|
|
7769
|
+
(X || P && (s1 !== N.offset || h1 !== y || !p)) && (c1({ offset: N.offset, limit: g1, search: y }), X && $(!1));
|
|
7770
|
+
}, [X, P, N.offset, y, s1, h1, p, j]), I(() => {
|
|
7771
|
+
(k || h) && c1(J), T.current = !0;
|
|
7772
|
+
}, []), I(() => {
|
|
7773
|
+
s && Q((u) => {
|
|
7774
|
+
const V = s.filter(
|
|
7775
|
+
(C) => !u.some((L) => L.value === C.value)
|
|
7775
7776
|
);
|
|
7776
|
-
return [...u, ...
|
|
7777
|
+
return [...u, ...V];
|
|
7777
7778
|
});
|
|
7778
7779
|
}, [s]);
|
|
7779
|
-
const
|
|
7780
|
+
const z = W(
|
|
7780
7781
|
(u) => {
|
|
7781
7782
|
e && e(u);
|
|
7782
|
-
let
|
|
7783
|
-
if (
|
|
7784
|
-
const
|
|
7785
|
-
(
|
|
7783
|
+
let V = [];
|
|
7784
|
+
if (m ? V = Array.isArray(u) ? u : [] : V = u ? [u] : [], y) {
|
|
7785
|
+
const C = V.filter(
|
|
7786
|
+
(L) => !(D != null && D.some((v) => v.value === L))
|
|
7786
7787
|
);
|
|
7787
|
-
|
|
7788
|
-
...
|
|
7789
|
-
...
|
|
7790
|
-
const
|
|
7788
|
+
C.length > 0 && Q((L = []) => [
|
|
7789
|
+
...L,
|
|
7790
|
+
...C.map((v) => {
|
|
7791
|
+
const w1 = p == null ? void 0 : p.find((o1) => o1.value === v);
|
|
7791
7792
|
return {
|
|
7792
|
-
value:
|
|
7793
|
-
label: (
|
|
7793
|
+
value: v,
|
|
7794
|
+
label: (w1 == null ? void 0 : w1.label) ?? v
|
|
7794
7795
|
};
|
|
7795
7796
|
})
|
|
7796
|
-
]),
|
|
7797
|
+
]), O(void 0), f(J), $(!0);
|
|
7797
7798
|
}
|
|
7798
7799
|
},
|
|
7799
|
-
[e,
|
|
7800
|
-
),
|
|
7800
|
+
[e, y, m, p, D]
|
|
7801
|
+
), d1 = Z1(
|
|
7801
7802
|
() => ({
|
|
7802
7803
|
id: r,
|
|
7803
7804
|
width: o,
|
|
7804
|
-
options:
|
|
7805
|
-
onChange:
|
|
7806
|
-
ref:
|
|
7805
|
+
options: p || [],
|
|
7806
|
+
onChange: z,
|
|
7807
|
+
ref: A,
|
|
7807
7808
|
placeholder: n,
|
|
7808
7809
|
search: !0,
|
|
7809
7810
|
value: l,
|
|
7810
|
-
onSearchChange:
|
|
7811
|
-
onDropdownVisibleChange:
|
|
7811
|
+
onSearchChange: e1,
|
|
7812
|
+
onDropdownVisibleChange: C1,
|
|
7812
7813
|
scrollThresholdValue: g,
|
|
7813
|
-
onScrollToEnd:
|
|
7814
|
+
onScrollToEnd: a1,
|
|
7814
7815
|
disabled: a,
|
|
7815
|
-
extraOptions:
|
|
7816
|
-
isLoading:
|
|
7817
|
-
optionRender:
|
|
7818
|
-
dropdownRender:
|
|
7819
|
-
readOnly:
|
|
7820
|
-
clearable:
|
|
7821
|
-
required:
|
|
7816
|
+
extraOptions: D,
|
|
7817
|
+
isLoading: j,
|
|
7818
|
+
optionRender: E,
|
|
7819
|
+
dropdownRender: B,
|
|
7820
|
+
readOnly: G,
|
|
7821
|
+
clearable: x,
|
|
7822
|
+
required: K,
|
|
7823
|
+
error: Z
|
|
7822
7824
|
}),
|
|
7823
7825
|
[
|
|
7824
7826
|
r,
|
|
7825
7827
|
o,
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7828
|
+
p,
|
|
7829
|
+
z,
|
|
7830
|
+
A,
|
|
7829
7831
|
n,
|
|
7830
7832
|
l,
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
+
e1,
|
|
7834
|
+
C1,
|
|
7833
7835
|
g,
|
|
7834
|
-
|
|
7836
|
+
a1,
|
|
7835
7837
|
a,
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7838
|
+
D,
|
|
7839
|
+
j,
|
|
7840
|
+
E,
|
|
7841
|
+
B,
|
|
7839
7842
|
G,
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
+
x,
|
|
7844
|
+
K,
|
|
7845
|
+
Z
|
|
7843
7846
|
]
|
|
7844
7847
|
);
|
|
7845
|
-
return W1(
|
|
7848
|
+
return W1(A, () => ({
|
|
7846
7849
|
refetchOptions: async () => {
|
|
7847
|
-
|
|
7850
|
+
f(J), O(void 0), $(!0);
|
|
7848
7851
|
}
|
|
7849
|
-
})),
|
|
7852
|
+
})), m ? /* @__PURE__ */ t(f1, { ...d1, value: l, mode: m }) : /* @__PURE__ */ t("div", { className: "snmt-async-select", children: /* @__PURE__ */ t(f1, { ...d1, value: l }) });
|
|
7850
7853
|
}
|
|
7851
7854
|
);
|
|
7852
7855
|
export {
|
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.
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/async-select.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"antd": "^5.18.3"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "8d61a4db9fb68d6fa82a8a9bad7d8f1663688f0a"
|
|
27
27
|
}
|