@snmt-react-ui/user-select 2.5.0 → 2.5.1
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/user-select.js +114 -114
- package/package.json +3 -3
package/dist/user-select.js
CHANGED
|
@@ -3,7 +3,7 @@ var le = (i, e, t) => e in i ? oe(i, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var M1 = (i, e, t) => le(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { jsx as r, Fragment as X, jsxs as u } from "react/jsx-runtime";
|
|
6
|
-
import { createContext as
|
|
6
|
+
import { createContext as r1, forwardRef as o1, useState as B, useRef as f1, useEffect as T, useCallback as j, useImperativeHandle as ae, useContext as l1 } from "react";
|
|
7
7
|
import { Select as he, Flex as ce, Avatar as de, Checkbox as ge, Typography as K1, Tag as P1, Popover as ue } from "antd";
|
|
8
8
|
import { SNMTUiContext as Ce } from "@snmt-react-ui/core";
|
|
9
9
|
const c1 = ({
|
|
@@ -43,7 +43,7 @@ const c1 = ({
|
|
|
43
43
|
);
|
|
44
44
|
};
|
|
45
45
|
var q = /* @__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))(q || {});
|
|
46
|
-
const $1 =
|
|
46
|
+
const $1 = r1({
|
|
47
47
|
locale: "en",
|
|
48
48
|
theme: "light"
|
|
49
49
|
});
|
|
@@ -60,7 +60,7 @@ const fe = ({
|
|
|
60
60
|
T(() => {
|
|
61
61
|
o(i), g(e);
|
|
62
62
|
}, [i, e]);
|
|
63
|
-
const { theme: a } =
|
|
63
|
+
const { theme: a } = l1($1);
|
|
64
64
|
return /* @__PURE__ */ r(
|
|
65
65
|
ge,
|
|
66
66
|
{
|
|
@@ -76,7 +76,7 @@ const fe = ({
|
|
|
76
76
|
);
|
|
77
77
|
};
|
|
78
78
|
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.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 || {});
|
|
79
|
-
const F1 =
|
|
79
|
+
const F1 = r1({
|
|
80
80
|
locale: "en",
|
|
81
81
|
theme: "light"
|
|
82
82
|
});
|
|
@@ -3068,7 +3068,7 @@ const we = ({
|
|
|
3068
3068
|
)
|
|
3069
3069
|
] }) })
|
|
3070
3070
|
}
|
|
3071
|
-
),
|
|
3071
|
+
), a1 = ({
|
|
3072
3072
|
name: i,
|
|
3073
3073
|
width: e,
|
|
3074
3074
|
height: t,
|
|
@@ -3077,7 +3077,7 @@ const we = ({
|
|
|
3077
3077
|
disabled: l = !1,
|
|
3078
3078
|
onClick: c
|
|
3079
3079
|
}) => {
|
|
3080
|
-
const [o, d] = B(n), { theme: g } =
|
|
3080
|
+
const [o, d] = B(n), { theme: g } = l1(F1), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : s, h = l ? void 0 : c;
|
|
3081
3081
|
return T(() => {
|
|
3082
3082
|
if (n) {
|
|
3083
3083
|
h && !l && d(`${n} clickable`);
|
|
@@ -3333,7 +3333,7 @@ const we = ({
|
|
|
3333
3333
|
h2: 2,
|
|
3334
3334
|
h3: 3,
|
|
3335
3335
|
h4: 4
|
|
3336
|
-
}, zt =
|
|
3336
|
+
}, zt = o1(
|
|
3337
3337
|
({
|
|
3338
3338
|
align: i = "inherit",
|
|
3339
3339
|
variant: e = "body1",
|
|
@@ -3368,7 +3368,7 @@ const we = ({
|
|
|
3368
3368
|
}
|
|
3369
3369
|
);
|
|
3370
3370
|
var L = /* @__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))(L || {});
|
|
3371
|
-
const Y1 =
|
|
3371
|
+
const Y1 = r1({
|
|
3372
3372
|
locale: "en",
|
|
3373
3373
|
theme: "light"
|
|
3374
3374
|
});
|
|
@@ -6369,7 +6369,7 @@ const Jt = ({
|
|
|
6369
6369
|
disabled: l = !1,
|
|
6370
6370
|
onClick: c
|
|
6371
6371
|
}) => {
|
|
6372
|
-
const [o, d] = B(n), { theme: g } =
|
|
6372
|
+
const [o, d] = B(n), { theme: g } = l1(Y1), a = l ? g && g === "dark" ? L.GREY_LIGHT_4 : L.GREY_DARK_1 : s, h = l ? void 0 : c;
|
|
6373
6373
|
return T(() => {
|
|
6374
6374
|
if (n) {
|
|
6375
6375
|
h && !l && d(`${n} clickable`);
|
|
@@ -6622,7 +6622,7 @@ const Jt = ({
|
|
|
6622
6622
|
})() });
|
|
6623
6623
|
};
|
|
6624
6624
|
var U1 = /* @__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))(U1 || {});
|
|
6625
|
-
const yi =
|
|
6625
|
+
const yi = r1({
|
|
6626
6626
|
locale: "en",
|
|
6627
6627
|
theme: "light"
|
|
6628
6628
|
});
|
|
@@ -6654,7 +6654,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6654
6654
|
h2: 2,
|
|
6655
6655
|
h3: 3,
|
|
6656
6656
|
h4: 4
|
|
6657
|
-
}, J1 =
|
|
6657
|
+
}, J1 = o1(
|
|
6658
6658
|
({
|
|
6659
6659
|
align: i = "inherit",
|
|
6660
6660
|
variant: e = "body1",
|
|
@@ -6764,7 +6764,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6764
6764
|
backgroundSize: "20% calc(200% + 20px)"
|
|
6765
6765
|
};
|
|
6766
6766
|
return /* @__PURE__ */ r("span", { className: "snmt-loader", style: s });
|
|
6767
|
-
}, b1 =
|
|
6767
|
+
}, b1 = o1(
|
|
6768
6768
|
({
|
|
6769
6769
|
value: i,
|
|
6770
6770
|
onChange: e,
|
|
@@ -6783,15 +6783,15 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6783
6783
|
id: x,
|
|
6784
6784
|
extraOptions: R,
|
|
6785
6785
|
dropdownRender: v,
|
|
6786
|
-
optionRender:
|
|
6786
|
+
optionRender: H,
|
|
6787
6787
|
isLoading: y,
|
|
6788
|
-
readOnly:
|
|
6788
|
+
readOnly: E
|
|
6789
6789
|
}, w) => {
|
|
6790
6790
|
const [m, N] = B(!1), [M, I] = B(!1), [A, S] = B(!0), [b, P] = B(i), Z = f1(null);
|
|
6791
6791
|
T(() => {
|
|
6792
6792
|
P(i);
|
|
6793
6793
|
}, [i]);
|
|
6794
|
-
const
|
|
6794
|
+
const _ = (f) => {
|
|
6795
6795
|
N(f), h && h(f);
|
|
6796
6796
|
}, $ = (f, O) => {
|
|
6797
6797
|
var D;
|
|
@@ -6800,7 +6800,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6800
6800
|
I(!0);
|
|
6801
6801
|
}, U = () => {
|
|
6802
6802
|
I(!1);
|
|
6803
|
-
},
|
|
6803
|
+
}, V = j(
|
|
6804
6804
|
(f) => {
|
|
6805
6805
|
if (P(f), s) {
|
|
6806
6806
|
const D = f;
|
|
@@ -6812,19 +6812,19 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6812
6812
|
},
|
|
6813
6813
|
[s, e]
|
|
6814
6814
|
), F = j(() => {
|
|
6815
|
-
if (!
|
|
6815
|
+
if (!E) {
|
|
6816
6816
|
if (s) {
|
|
6817
|
-
|
|
6817
|
+
V([]);
|
|
6818
6818
|
return;
|
|
6819
6819
|
}
|
|
6820
|
-
|
|
6820
|
+
V("");
|
|
6821
6821
|
}
|
|
6822
|
-
}, [
|
|
6822
|
+
}, [V, s, E]), G = j(
|
|
6823
6823
|
(f) => {
|
|
6824
6824
|
const O = b.filter((D) => D !== f);
|
|
6825
|
-
|
|
6825
|
+
V(O), P(O);
|
|
6826
6826
|
},
|
|
6827
|
-
[
|
|
6827
|
+
[V, b]
|
|
6828
6828
|
), e1 = j(
|
|
6829
6829
|
(f) => (b == null ? void 0 : b.indexOf(f)) === 0 ? (
|
|
6830
6830
|
// if the search input is empty
|
|
@@ -6854,13 +6854,13 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6854
6854
|
values: f,
|
|
6855
6855
|
onTagClose: G,
|
|
6856
6856
|
maxWidth: ((O = Z.current) == null ? void 0 : O.clientWidth) || 0,
|
|
6857
|
-
disabled: o ||
|
|
6857
|
+
disabled: o || E,
|
|
6858
6858
|
options: l,
|
|
6859
6859
|
extraOptions: R
|
|
6860
6860
|
}
|
|
6861
6861
|
);
|
|
6862
6862
|
},
|
|
6863
|
-
[o, R, G, l,
|
|
6863
|
+
[o, R, G, l, E]
|
|
6864
6864
|
), re = j(
|
|
6865
6865
|
({ label: f, value: O, mode: D }) => D === "filter" ? e1(O) : /* @__PURE__ */ r("div", { onMouseDown: ie, className: "tag-wrapper", children: /* @__PURE__ */ r(z1, { onClose: () => G(O), closable: !o, children: /* @__PURE__ */ r(J1, { variant: "body4", children: typeof f == "object" ? f : m1(O) }) }) }),
|
|
6866
6866
|
[o, m1, G, e1]
|
|
@@ -6869,7 +6869,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6869
6869
|
"div",
|
|
6870
6870
|
{
|
|
6871
6871
|
className: `snmt-select ${M ? "snmt-select-focused" : ""}
|
|
6872
|
-
${s ? "" : "snmt-select-single"} ${
|
|
6872
|
+
${s ? "" : "snmt-select-single"} ${E ? "snmt-select-read-only" : ""}`,
|
|
6873
6873
|
ref: Z,
|
|
6874
6874
|
style: { width: c },
|
|
6875
6875
|
children: [
|
|
@@ -6877,18 +6877,18 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6877
6877
|
he,
|
|
6878
6878
|
{
|
|
6879
6879
|
className: "snmt-select-blank",
|
|
6880
|
-
popupClassName:
|
|
6880
|
+
popupClassName: E ? "dropdown-read-only" : "",
|
|
6881
6881
|
id: x,
|
|
6882
6882
|
ref: w,
|
|
6883
6883
|
showSearch: !!n,
|
|
6884
6884
|
filterOption: n && $,
|
|
6885
|
-
onDropdownVisibleChange:
|
|
6885
|
+
onDropdownVisibleChange: _,
|
|
6886
6886
|
placeholder: t ? d ? `${t}*` : t : void 0,
|
|
6887
6887
|
disabled: o,
|
|
6888
6888
|
value: b || void 0,
|
|
6889
6889
|
labelRender: (f) => m1(f.value),
|
|
6890
6890
|
mode: s === "filter" ? "multiple" : s,
|
|
6891
|
-
onChange:
|
|
6891
|
+
onChange: V,
|
|
6892
6892
|
onFocus: Y,
|
|
6893
6893
|
onBlur: U,
|
|
6894
6894
|
onSearch: (f) => {
|
|
@@ -6900,11 +6900,11 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6900
6900
|
maxTagCount: "responsive",
|
|
6901
6901
|
maxTagPlaceholder: ne,
|
|
6902
6902
|
onPopupScroll: se,
|
|
6903
|
-
prefix:
|
|
6903
|
+
prefix: E && !i && /* @__PURE__ */ r(y1, { size: 15 }),
|
|
6904
6904
|
suffixIcon: /* @__PURE__ */ r("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ u(X, { children: [
|
|
6905
|
-
s && b && !!b.length && /* @__PURE__ */ r("div", { onClick: F, children: /* @__PURE__ */ r(
|
|
6905
|
+
s && b && !!b.length && /* @__PURE__ */ r("div", { onClick: F, children: /* @__PURE__ */ r(a1, { name: "cancel" }) }),
|
|
6906
6906
|
/* @__PURE__ */ r(
|
|
6907
|
-
|
|
6907
|
+
a1,
|
|
6908
6908
|
{
|
|
6909
6909
|
name: "selectArrowIcon",
|
|
6910
6910
|
color: o ? q.GREY_DARK_1 : q.GREY_DARK_5,
|
|
@@ -6913,9 +6913,9 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6913
6913
|
}
|
|
6914
6914
|
)
|
|
6915
6915
|
] }) }),
|
|
6916
|
-
removeIcon: /* @__PURE__ */ r(
|
|
6916
|
+
removeIcon: /* @__PURE__ */ r(a1, { name: "errorSmall", color: q.GREY_DARK_2 }),
|
|
6917
6917
|
options: l,
|
|
6918
|
-
optionRender: (f) =>
|
|
6918
|
+
optionRender: (f) => H ? H(f.data) : /* @__PURE__ */ u(c1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
|
6919
6919
|
/* @__PURE__ */ u(c1, { alignItems: "center", gap: 12, children: [
|
|
6920
6920
|
s && /* @__PURE__ */ r(
|
|
6921
6921
|
fe,
|
|
@@ -6929,7 +6929,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
|
|
|
6929
6929
|
] })
|
|
6930
6930
|
] }),
|
|
6931
6931
|
!s && b === f.value && /* @__PURE__ */ r(
|
|
6932
|
-
|
|
6932
|
+
a1,
|
|
6933
6933
|
{
|
|
6934
6934
|
name: "ok",
|
|
6935
6935
|
color: q.BLUE_PRIMARY,
|
|
@@ -6977,10 +6977,10 @@ function Ii(i, e = 500) {
|
|
|
6977
6977
|
clearTimeout(t.current), t.current = n;
|
|
6978
6978
|
};
|
|
6979
6979
|
}
|
|
6980
|
-
const
|
|
6980
|
+
const t1 = {
|
|
6981
6981
|
limit: 100,
|
|
6982
6982
|
offset: 0
|
|
6983
|
-
}, E1 =
|
|
6983
|
+
}, E1 = o1(
|
|
6984
6984
|
({
|
|
6985
6985
|
loadOptions: i,
|
|
6986
6986
|
width: e,
|
|
@@ -6998,17 +6998,17 @@ const a1 = {
|
|
|
6998
6998
|
dropdownRender: p,
|
|
6999
6999
|
readOnly: x
|
|
7000
7000
|
}, R) => {
|
|
7001
|
-
const [v,
|
|
7002
|
-
async (
|
|
7001
|
+
const [v, H] = B([]), [y, E] = B(t1), [w, m] = B(!1), [N, M] = B(null), I = j(
|
|
7002
|
+
async (_ = !1, $) => {
|
|
7003
7003
|
if (!w) {
|
|
7004
7004
|
m(!0);
|
|
7005
7005
|
try {
|
|
7006
|
-
const Y =
|
|
7007
|
-
|
|
7008
|
-
(
|
|
7009
|
-
), M(U.count),
|
|
7010
|
-
...
|
|
7011
|
-
offset:
|
|
7006
|
+
const Y = _ ? { ...t1, search: $ } : y, U = await i(Y);
|
|
7007
|
+
H(
|
|
7008
|
+
(V) => _ ? U.options : [...V, ...U.options]
|
|
7009
|
+
), M(U.count), E((V) => ({
|
|
7010
|
+
...V,
|
|
7011
|
+
offset: V.offset + V.limit
|
|
7012
7012
|
}));
|
|
7013
7013
|
} finally {
|
|
7014
7014
|
m(!1);
|
|
@@ -7017,15 +7017,15 @@ const a1 = {
|
|
|
7017
7017
|
},
|
|
7018
7018
|
[y, i, w]
|
|
7019
7019
|
), A = Ii(I), S = j(
|
|
7020
|
-
(
|
|
7021
|
-
|
|
7020
|
+
(_) => {
|
|
7021
|
+
_ === "" || _ === void 0 || _ === null ? (E(t1), A(!0)) : A(!0, _);
|
|
7022
7022
|
},
|
|
7023
7023
|
[A]
|
|
7024
|
-
), b = async (
|
|
7025
|
-
|
|
7024
|
+
), b = async (_) => {
|
|
7025
|
+
_ && N !== null && N > v.length && await I(!1);
|
|
7026
7026
|
}, P = j(
|
|
7027
|
-
(
|
|
7028
|
-
|
|
7027
|
+
(_) => {
|
|
7028
|
+
_ && !g && (H([]), E(t1), I(!0)), h == null || h(_);
|
|
7029
7029
|
},
|
|
7030
7030
|
// eslint-disable-next-line
|
|
7031
7031
|
[g]
|
|
@@ -7056,7 +7056,7 @@ const a1 = {
|
|
|
7056
7056
|
};
|
|
7057
7057
|
return ae(R, () => ({
|
|
7058
7058
|
refetchOptions: async () => {
|
|
7059
|
-
|
|
7059
|
+
E(t1), await I(!0);
|
|
7060
7060
|
}
|
|
7061
7061
|
})), d ? /* @__PURE__ */ r(b1, { ...Z, onChange: t, value: s, mode: d }) : /* @__PURE__ */ r("div", { className: "snmt-async-select", children: /* @__PURE__ */ r(b1, { ...Z, onChange: t, value: s }) });
|
|
7062
7062
|
}
|
|
@@ -7165,7 +7165,7 @@ const Pi = (i) => {
|
|
|
7165
7165
|
init(i) {
|
|
7166
7166
|
Gi(i.options.react), Pi(i);
|
|
7167
7167
|
}
|
|
7168
|
-
}, Yi =
|
|
7168
|
+
}, Yi = r1();
|
|
7169
7169
|
class Ui {
|
|
7170
7170
|
constructor() {
|
|
7171
7171
|
M1(this, "getUsedNamespaces", () => Object.keys(this.usedNamespaces));
|
|
@@ -7189,7 +7189,7 @@ const zi = (i, e) => {
|
|
|
7189
7189
|
} = e, {
|
|
7190
7190
|
i18n: s,
|
|
7191
7191
|
defaultNS: n
|
|
7192
|
-
} =
|
|
7192
|
+
} = l1(Yi) || {}, l = t || s || $i();
|
|
7193
7193
|
if (l && !l.reportNamespaces && (l.reportNamespaces = new Ui()), !l) {
|
|
7194
7194
|
N1("You will need to pass in an i18next instance by using initReactI18next");
|
|
7195
7195
|
const w = (N, M) => z(M) ? M : Wi(M) && z(M.defaultValue) ? M.defaultValue : Array.isArray(N) ? N[N.length - 1] : N, m = [w, {}, !1];
|
|
@@ -7209,7 +7209,7 @@ const zi = (i, e) => {
|
|
|
7209
7209
|
const a = (l.isInitialized || l.initializedStoreOnce) && g.every((w) => Bi(w, l, c)), h = Ji(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), C = () => h, p = () => X1(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [x, R] = B(C);
|
|
7210
7210
|
let v = g.join();
|
|
7211
7211
|
e.lng && (v = `${e.lng}${v}`);
|
|
7212
|
-
const
|
|
7212
|
+
const H = zi(v), y = f1(!0);
|
|
7213
7213
|
T(() => {
|
|
7214
7214
|
const {
|
|
7215
7215
|
bindI18n: w,
|
|
@@ -7219,7 +7219,7 @@ const zi = (i, e) => {
|
|
|
7219
7219
|
y.current && R(p);
|
|
7220
7220
|
}) : H1(l, g, () => {
|
|
7221
7221
|
y.current && R(p);
|
|
7222
|
-
})), a &&
|
|
7222
|
+
})), a && H && H !== v && y.current && R(p);
|
|
7223
7223
|
const N = () => {
|
|
7224
7224
|
y.current && R(p);
|
|
7225
7225
|
};
|
|
@@ -7229,8 +7229,8 @@ const zi = (i, e) => {
|
|
|
7229
7229
|
}, [l, v]), T(() => {
|
|
7230
7230
|
y.current && a && R(C);
|
|
7231
7231
|
}, [l, d, a]);
|
|
7232
|
-
const
|
|
7233
|
-
if (
|
|
7232
|
+
const E = [x, l, a];
|
|
7233
|
+
if (E.t = x, E.i18n = l, E.ready = a, a || !a && !o) return E;
|
|
7234
7234
|
throw new Promise((w) => {
|
|
7235
7235
|
e.lng ? _1(l, e.lng, g, () => w()) : H1(l, g, () => w());
|
|
7236
7236
|
});
|
|
@@ -7326,7 +7326,7 @@ class w1 {
|
|
|
7326
7326
|
});
|
|
7327
7327
|
}
|
|
7328
7328
|
}
|
|
7329
|
-
const
|
|
7329
|
+
const i1 = () => {
|
|
7330
7330
|
let i, e;
|
|
7331
7331
|
const t = new Promise((s, n) => {
|
|
7332
7332
|
i = s, e = n;
|
|
@@ -7336,7 +7336,7 @@ const t1 = () => {
|
|
|
7336
7336
|
i.forEach((s) => {
|
|
7337
7337
|
e[s] && (t[s] = e[s]);
|
|
7338
7338
|
});
|
|
7339
|
-
}, e5 = /###/g, O1 = (i) => i && i.indexOf("###") > -1 ? i.replace(e5, ".") : i, S1 = (i) => !i || typeof i == "string",
|
|
7339
|
+
}, e5 = /###/g, O1 = (i) => i && i.indexOf("###") > -1 ? i.replace(e5, ".") : i, S1 = (i) => !i || typeof i == "string", s1 = (i, e, t) => {
|
|
7340
7340
|
const s = typeof e != "string" ? e : e.split(".");
|
|
7341
7341
|
let n = 0;
|
|
7342
7342
|
for (; n < s.length - 1; ) {
|
|
@@ -7352,26 +7352,26 @@ const t1 = () => {
|
|
|
7352
7352
|
const {
|
|
7353
7353
|
obj: s,
|
|
7354
7354
|
k: n
|
|
7355
|
-
} =
|
|
7355
|
+
} = s1(i, e, Object);
|
|
7356
7356
|
if (s !== void 0 || e.length === 1) {
|
|
7357
7357
|
s[n] = t;
|
|
7358
7358
|
return;
|
|
7359
7359
|
}
|
|
7360
|
-
let l = e[e.length - 1], c = e.slice(0, e.length - 1), o =
|
|
7360
|
+
let l = e[e.length - 1], c = e.slice(0, e.length - 1), o = s1(i, c, Object);
|
|
7361
7361
|
for (; o.obj === void 0 && c.length; )
|
|
7362
|
-
l = `${c[c.length - 1]}.${l}`, c = c.slice(0, c.length - 1), o =
|
|
7362
|
+
l = `${c[c.length - 1]}.${l}`, c = c.slice(0, c.length - 1), o = s1(i, c, Object), o && o.obj && typeof o.obj[`${o.k}.${l}`] < "u" && (o.obj = void 0);
|
|
7363
7363
|
o.obj[`${o.k}.${l}`] = t;
|
|
7364
7364
|
}, t5 = (i, e, t, s) => {
|
|
7365
7365
|
const {
|
|
7366
7366
|
obj: n,
|
|
7367
7367
|
k: l
|
|
7368
|
-
} =
|
|
7368
|
+
} = s1(i, e, Object);
|
|
7369
7369
|
n[l] = n[l] || [], n[l].push(t);
|
|
7370
7370
|
}, u1 = (i, e) => {
|
|
7371
7371
|
const {
|
|
7372
7372
|
obj: t,
|
|
7373
7373
|
k: s
|
|
7374
|
-
} =
|
|
7374
|
+
} = s1(i, e);
|
|
7375
7375
|
if (t)
|
|
7376
7376
|
return t[s];
|
|
7377
7377
|
}, i5 = (i, e, t) => {
|
|
@@ -7592,8 +7592,8 @@ class p1 extends w1 {
|
|
|
7592
7592
|
}
|
|
7593
7593
|
const h = this.resolve(e, t);
|
|
7594
7594
|
let C = h && h.res;
|
|
7595
|
-
const p = h && h.usedKey || c, x = h && h.exactUsedKey || c, R = Object.prototype.toString.apply(C), v = ["[object Number]", "[object Function]", "[object RegExp]"],
|
|
7596
|
-
if (y && C && (typeof C != "string" && typeof C != "boolean" && typeof C != "number") && v.indexOf(R) < 0 && !(typeof
|
|
7595
|
+
const p = h && h.usedKey || c, x = h && h.exactUsedKey || c, R = Object.prototype.toString.apply(C), v = ["[object Number]", "[object Function]", "[object RegExp]"], H = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
7596
|
+
if (y && C && (typeof C != "string" && typeof C != "boolean" && typeof C != "number") && v.indexOf(R) < 0 && !(typeof H == "string" && Array.isArray(C))) {
|
|
7597
7597
|
if (!t.returnObjects && !this.options.returnObjects) {
|
|
7598
7598
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
7599
7599
|
const w = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, C, {
|
|
@@ -7615,37 +7615,37 @@ class p1 extends w1 {
|
|
|
7615
7615
|
}
|
|
7616
7616
|
C = m;
|
|
7617
7617
|
}
|
|
7618
|
-
} else if (y && typeof
|
|
7619
|
-
C = C.join(
|
|
7618
|
+
} else if (y && typeof H == "string" && Array.isArray(C))
|
|
7619
|
+
C = C.join(H), C && (C = this.extendTranslation(C, e, t, s));
|
|
7620
7620
|
else {
|
|
7621
7621
|
let w = !1, m = !1;
|
|
7622
7622
|
const N = t.count !== void 0 && typeof t.count != "string", M = p1.hasDefaultValue(t), I = N ? this.pluralResolver.getSuffix(g, t.count, t) : "", A = t.ordinal && N ? this.pluralResolver.getSuffix(g, t.count, {
|
|
7623
7623
|
ordinal: !1
|
|
7624
7624
|
}) : "", S = N && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), b = S && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${I}`] || t[`defaultValue${A}`] || t.defaultValue;
|
|
7625
7625
|
!this.isValidLookup(C) && M && (w = !0, C = b), this.isValidLookup(C) || (m = !0, C = c);
|
|
7626
|
-
const Z = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && m ? void 0 : C,
|
|
7627
|
-
if (m || w ||
|
|
7628
|
-
if (this.logger.log(
|
|
7629
|
-
const
|
|
7626
|
+
const Z = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && m ? void 0 : C, _ = M && b !== C && this.options.updateMissing;
|
|
7627
|
+
if (m || w || _) {
|
|
7628
|
+
if (this.logger.log(_ ? "updateKey" : "missingKey", g, d, c, _ ? b : C), l) {
|
|
7629
|
+
const V = this.resolve(c, {
|
|
7630
7630
|
...t,
|
|
7631
7631
|
keySeparator: !1
|
|
7632
7632
|
});
|
|
7633
|
-
|
|
7633
|
+
V && V.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
7634
7634
|
}
|
|
7635
7635
|
let $ = [];
|
|
7636
7636
|
const Y = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
7637
7637
|
if (this.options.saveMissingTo === "fallback" && Y && Y[0])
|
|
7638
|
-
for (let
|
|
7639
|
-
$.push(Y[
|
|
7638
|
+
for (let V = 0; V < Y.length; V++)
|
|
7639
|
+
$.push(Y[V]);
|
|
7640
7640
|
else this.options.saveMissingTo === "all" ? $ = this.languageUtils.toResolveHierarchy(t.lng || this.language) : $.push(t.lng || this.language);
|
|
7641
|
-
const U = (
|
|
7641
|
+
const U = (V, F, G) => {
|
|
7642
7642
|
const e1 = M && G !== C ? G : Z;
|
|
7643
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
7643
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(V, d, F, e1, _, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(V, d, F, e1, _, t), this.emit("missingKey", V, d, F, C);
|
|
7644
7644
|
};
|
|
7645
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && N ? $.forEach((
|
|
7646
|
-
const F = this.pluralResolver.getSuffixes(
|
|
7645
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && N ? $.forEach((V) => {
|
|
7646
|
+
const F = this.pluralResolver.getSuffixes(V, t);
|
|
7647
7647
|
S && t[`defaultValue${this.options.pluralSeparator}zero`] && F.indexOf(`${this.options.pluralSeparator}zero`) < 0 && F.push(`${this.options.pluralSeparator}zero`), F.forEach((G) => {
|
|
7648
|
-
U([
|
|
7648
|
+
U([V], c + G, t[`defaultValue${G}`] || b);
|
|
7649
7649
|
});
|
|
7650
7650
|
}) : U($, c, b));
|
|
7651
7651
|
}
|
|
@@ -7709,24 +7709,24 @@ class p1 extends w1 {
|
|
|
7709
7709
|
this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
|
|
7710
7710
|
const C = t.count !== void 0 && typeof t.count != "string", p = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), x = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", R = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
7711
7711
|
h.forEach((v) => {
|
|
7712
|
-
this.isValidLookup(s) || (o = v, !W1[`${R[0]}-${v}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (W1[`${R[0]}-${v}`] = !0, this.logger.warn(`key "${n}" for languages "${R.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), R.forEach((
|
|
7712
|
+
this.isValidLookup(s) || (o = v, !W1[`${R[0]}-${v}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (W1[`${R[0]}-${v}`] = !0, this.logger.warn(`key "${n}" for languages "${R.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), R.forEach((H) => {
|
|
7713
7713
|
if (this.isValidLookup(s)) return;
|
|
7714
|
-
c =
|
|
7714
|
+
c = H;
|
|
7715
7715
|
const y = [a];
|
|
7716
7716
|
if (this.i18nFormat && this.i18nFormat.addLookupKeys)
|
|
7717
|
-
this.i18nFormat.addLookupKeys(y, a,
|
|
7717
|
+
this.i18nFormat.addLookupKeys(y, a, H, v, t);
|
|
7718
7718
|
else {
|
|
7719
7719
|
let w;
|
|
7720
|
-
C && (w = this.pluralResolver.getSuffix(
|
|
7720
|
+
C && (w = this.pluralResolver.getSuffix(H, t.count, t));
|
|
7721
7721
|
const m = `${this.options.pluralSeparator}zero`, N = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
7722
7722
|
if (C && (y.push(a + w), t.ordinal && w.indexOf(N) === 0 && y.push(a + w.replace(N, this.options.pluralSeparator)), p && y.push(a + m)), x) {
|
|
7723
7723
|
const M = `${a}${this.options.contextSeparator}${t.context}`;
|
|
7724
7724
|
y.push(M), C && (y.push(M + w), t.ordinal && w.indexOf(N) === 0 && y.push(M + w.replace(N, this.options.pluralSeparator)), p && y.push(M + m));
|
|
7725
7725
|
}
|
|
7726
7726
|
}
|
|
7727
|
-
let
|
|
7728
|
-
for (;
|
|
7729
|
-
this.isValidLookup(s) || (l =
|
|
7727
|
+
let E;
|
|
7728
|
+
for (; E = y.pop(); )
|
|
7729
|
+
this.isValidLookup(s) || (l = E, s = this.getResource(H, v, E, t));
|
|
7730
7730
|
}));
|
|
7731
7731
|
});
|
|
7732
7732
|
}), {
|
|
@@ -8052,10 +8052,10 @@ class p5 {
|
|
|
8052
8052
|
nestingSuffix: x,
|
|
8053
8053
|
nestingSuffixEscaped: R,
|
|
8054
8054
|
nestingOptionsSeparator: v,
|
|
8055
|
-
maxReplaces:
|
|
8055
|
+
maxReplaces: H,
|
|
8056
8056
|
alwaysFormat: y
|
|
8057
8057
|
} = e.interpolation;
|
|
8058
|
-
this.escape = t !== void 0 ? t : n5, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = l ? J(l) : c || "{{", this.suffix = o ? J(o) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = C ? J(C) : p || J("$t("), this.nestingSuffix = x ? J(x) : R || J(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces =
|
|
8058
|
+
this.escape = t !== void 0 ? t : n5, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = l ? J(l) : c || "{{", this.suffix = o ? J(o) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = C ? J(C) : p || J("$t("), this.nestingSuffix = x ? J(x) : R || J(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = H || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
|
|
8059
8059
|
}
|
|
8060
8060
|
reset() {
|
|
8061
8061
|
this.options && this.init(this.options);
|
|
@@ -8068,12 +8068,12 @@ class p5 {
|
|
|
8068
8068
|
let l, c, o;
|
|
8069
8069
|
const d = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, g = (p) => {
|
|
8070
8070
|
if (p.indexOf(this.formatSeparator) < 0) {
|
|
8071
|
-
const
|
|
8072
|
-
return this.alwaysFormat ? this.format(
|
|
8071
|
+
const H = D1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
8072
|
+
return this.alwaysFormat ? this.format(H, void 0, s, {
|
|
8073
8073
|
...n,
|
|
8074
8074
|
...t,
|
|
8075
8075
|
interpolationkey: p
|
|
8076
|
-
}) :
|
|
8076
|
+
}) : H;
|
|
8077
8077
|
}
|
|
8078
8078
|
const x = p.split(this.formatSeparator), R = x.shift().trim(), v = x.join(this.formatSeparator).trim();
|
|
8079
8079
|
return this.format(D1(t, d, R, this.options.keySeparator, this.options.ignoreJSONStructure), v, s, {
|
|
@@ -8461,7 +8461,7 @@ const T1 = () => ({
|
|
|
8461
8461
|
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
8462
8462
|
});
|
|
8463
8463
|
};
|
|
8464
|
-
class
|
|
8464
|
+
class n1 extends w1 {
|
|
8465
8465
|
constructor() {
|
|
8466
8466
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
8467
8467
|
if (super(), this.options = G1(e), this.services = {}, this.logger = K, this.modules = {
|
|
@@ -8526,7 +8526,7 @@ class s1 extends w1 {
|
|
|
8526
8526
|
return e.store[a](...arguments), e;
|
|
8527
8527
|
};
|
|
8528
8528
|
});
|
|
8529
|
-
const d =
|
|
8529
|
+
const d = i1(), g = () => {
|
|
8530
8530
|
const a = (h, C) => {
|
|
8531
8531
|
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), d.resolve(C), s(h, C);
|
|
8532
8532
|
};
|
|
@@ -8553,7 +8553,7 @@ class s1 extends w1 {
|
|
|
8553
8553
|
s(null);
|
|
8554
8554
|
}
|
|
8555
8555
|
reloadResources(e, t, s) {
|
|
8556
|
-
const n =
|
|
8556
|
+
const n = i1();
|
|
8557
8557
|
return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = h1), this.services.backendConnector.reload(e, t, (l) => {
|
|
8558
8558
|
n.resolve(), s(l);
|
|
8559
8559
|
}), n;
|
|
@@ -8576,7 +8576,7 @@ class s1 extends w1 {
|
|
|
8576
8576
|
changeLanguage(e, t) {
|
|
8577
8577
|
var s = this;
|
|
8578
8578
|
this.isLanguageChangingTo = e;
|
|
8579
|
-
const n =
|
|
8579
|
+
const n = i1();
|
|
8580
8580
|
this.emit("languageChanging", e);
|
|
8581
8581
|
const l = (d) => {
|
|
8582
8582
|
this.language = d, this.languages = this.services.languageUtils.toResolveHierarchy(d), this.resolvedLanguage = void 0, this.setResolvedLanguage(d);
|
|
@@ -8642,7 +8642,7 @@ class s1 extends w1 {
|
|
|
8642
8642
|
return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || c(s, e) && (!n || c(l, e)));
|
|
8643
8643
|
}
|
|
8644
8644
|
loadNamespaces(e, t) {
|
|
8645
|
-
const s =
|
|
8645
|
+
const s = i1();
|
|
8646
8646
|
return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((n) => {
|
|
8647
8647
|
this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
|
|
8648
8648
|
}), this.loadResources((n) => {
|
|
@@ -8650,7 +8650,7 @@ class s1 extends w1 {
|
|
|
8650
8650
|
}), s) : (t && t(), Promise.resolve());
|
|
8651
8651
|
}
|
|
8652
8652
|
loadLanguages(e, t) {
|
|
8653
|
-
const s =
|
|
8653
|
+
const s = i1();
|
|
8654
8654
|
typeof e == "string" && (e = [e]);
|
|
8655
8655
|
const n = this.options.preload || [], l = e.filter((c) => n.indexOf(c) < 0 && this.services.languageUtils.isSupportedCode(c));
|
|
8656
8656
|
return l.length ? (this.options.preload = n.concat(l), this.loadResources((c) => {
|
|
@@ -8664,7 +8664,7 @@ class s1 extends w1 {
|
|
|
8664
8664
|
}
|
|
8665
8665
|
static createInstance() {
|
|
8666
8666
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
8667
|
-
return new
|
|
8667
|
+
return new n1(e, t);
|
|
8668
8668
|
}
|
|
8669
8669
|
cloneInstance() {
|
|
8670
8670
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : h1;
|
|
@@ -8674,7 +8674,7 @@ class s1 extends w1 {
|
|
|
8674
8674
|
...this.options,
|
|
8675
8675
|
...e,
|
|
8676
8676
|
isClone: !0
|
|
8677
|
-
}, l = new
|
|
8677
|
+
}, l = new n1(n);
|
|
8678
8678
|
return (e.debug !== void 0 || e.prefix !== void 0) && (l.logger = l.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
|
|
8679
8679
|
l[o] = this[o];
|
|
8680
8680
|
}), l.services = {
|
|
@@ -8699,8 +8699,8 @@ class s1 extends w1 {
|
|
|
8699
8699
|
};
|
|
8700
8700
|
}
|
|
8701
8701
|
}
|
|
8702
|
-
const W =
|
|
8703
|
-
W.createInstance =
|
|
8702
|
+
const W = n1.createInstance();
|
|
8703
|
+
W.createInstance = n1.createInstance;
|
|
8704
8704
|
W.createInstance;
|
|
8705
8705
|
W.dir;
|
|
8706
8706
|
W.init;
|
|
@@ -8734,7 +8734,7 @@ W.use(Fi).init({
|
|
|
8734
8734
|
}
|
|
8735
8735
|
}
|
|
8736
8736
|
});
|
|
8737
|
-
const O5 =
|
|
8737
|
+
const O5 = o1(
|
|
8738
8738
|
({
|
|
8739
8739
|
fetchParams: i,
|
|
8740
8740
|
mode: e = void 0,
|
|
@@ -8745,7 +8745,7 @@ const O5 = r1(
|
|
|
8745
8745
|
onError: c,
|
|
8746
8746
|
allowEmpty: o = !1
|
|
8747
8747
|
}, d) => {
|
|
8748
|
-
const { axiosPeople: g, locale: a } =
|
|
8748
|
+
const { axiosPeople: g, locale: a } = l1(Ce), { t: h } = Qi("common", { lng: a }), [C, p] = B([]), [x, R] = B(!0);
|
|
8749
8749
|
if (!g)
|
|
8750
8750
|
throw new Error(
|
|
8751
8751
|
`UserSelect requires "axiosPeople" to fetch users.
|
|
@@ -8757,7 +8757,7 @@ const O5 = r1(
|
|
|
8757
8757
|
return m.deletedAt && (N += `[${h("deleted")}] `), m.status === d1.ARCHIVED && (N += `[${h("archived")}] `), `${N}${m.firstName} ${m.lastName}`;
|
|
8758
8758
|
},
|
|
8759
8759
|
[h]
|
|
8760
|
-
),
|
|
8760
|
+
), H = j(
|
|
8761
8761
|
async ({
|
|
8762
8762
|
offset: m,
|
|
8763
8763
|
limit: N,
|
|
@@ -8773,9 +8773,9 @@ const O5 = r1(
|
|
|
8773
8773
|
includeCount: !0
|
|
8774
8774
|
}), { data: P, metadata: Z } = b.data;
|
|
8775
8775
|
return {
|
|
8776
|
-
options: P.map((
|
|
8777
|
-
value:
|
|
8778
|
-
label: v(
|
|
8776
|
+
options: P.map((_) => ({
|
|
8777
|
+
value: _.id,
|
|
8778
|
+
label: v(_)
|
|
8779
8779
|
})),
|
|
8780
8780
|
count: Z.count
|
|
8781
8781
|
};
|
|
@@ -8796,7 +8796,7 @@ const O5 = r1(
|
|
|
8796
8796
|
try {
|
|
8797
8797
|
return await Promise.all(
|
|
8798
8798
|
m.map(async (S) => {
|
|
8799
|
-
const b = C.find((
|
|
8799
|
+
const b = C.find((_) => _.value === S);
|
|
8800
8800
|
if (b)
|
|
8801
8801
|
return b;
|
|
8802
8802
|
const Z = (await g.post("v1/users/search", {
|
|
@@ -8832,13 +8832,13 @@ const O5 = r1(
|
|
|
8832
8832
|
p(M), R(!1);
|
|
8833
8833
|
})();
|
|
8834
8834
|
}, [y, n]);
|
|
8835
|
-
const
|
|
8835
|
+
const E = j(
|
|
8836
8836
|
async ({
|
|
8837
8837
|
limit: m,
|
|
8838
8838
|
offset: N,
|
|
8839
8839
|
search: M
|
|
8840
8840
|
}) => {
|
|
8841
|
-
const { count: I, ...A } = await
|
|
8841
|
+
const { count: I, ...A } = await H({
|
|
8842
8842
|
offset: N,
|
|
8843
8843
|
limit: m,
|
|
8844
8844
|
search: M
|
|
@@ -8850,7 +8850,7 @@ const O5 = r1(
|
|
|
8850
8850
|
limit: m
|
|
8851
8851
|
};
|
|
8852
8852
|
},
|
|
8853
|
-
[o,
|
|
8853
|
+
[o, H]
|
|
8854
8854
|
);
|
|
8855
8855
|
if (x)
|
|
8856
8856
|
return /* @__PURE__ */ r(Oi, {});
|
|
@@ -8866,7 +8866,7 @@ const O5 = r1(
|
|
|
8866
8866
|
mode: e,
|
|
8867
8867
|
value: n,
|
|
8868
8868
|
onChange: l,
|
|
8869
|
-
loadOptions:
|
|
8869
|
+
loadOptions: E,
|
|
8870
8870
|
loadOnClosedState: !0,
|
|
8871
8871
|
extraOptions: C
|
|
8872
8872
|
}
|
|
@@ -8877,7 +8877,7 @@ const O5 = r1(
|
|
|
8877
8877
|
value: n,
|
|
8878
8878
|
mode: void 0,
|
|
8879
8879
|
onChange: l,
|
|
8880
|
-
loadOptions:
|
|
8880
|
+
loadOptions: E,
|
|
8881
8881
|
loadOnClosedState: !0,
|
|
8882
8882
|
extraOptions: C
|
|
8883
8883
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snmt-react-ui/user-select",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/user-select.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"build": "tsc && vite build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@snmt-react-ui/async-select": "^1.5.
|
|
21
|
+
"@snmt-react-ui/async-select": "^1.5.2",
|
|
22
22
|
"@snmt-react-ui/core": "^2.1.0",
|
|
23
23
|
"@snmt-react-ui/loader": "^1.4.0",
|
|
24
24
|
"@snmt-react-ui/select": "^1.13.0"
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"i18next": "^23.11.1",
|
|
29
29
|
"react-i18next": "^14.1.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "3110b4a7202e4a6ded1eea349bee8b81d67cfc02"
|
|
32
32
|
}
|