@snmt-react-ui/country-select 2.3.18 → 2.5.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/CountrySelect.d.ts +6 -0
- package/dist/country-select.js +253 -239
- package/package.json +3 -3
package/dist/CountrySelect.d.ts
CHANGED
@@ -12,6 +12,12 @@ export interface CountrySelectProps {
|
|
12
12
|
/** ID of the element */
|
13
13
|
id?: string;
|
14
14
|
disabled?: boolean;
|
15
|
+
/** Make the selection mandatory */
|
16
|
+
required?: boolean;
|
17
|
+
/** Show the clear button */
|
18
|
+
clearable?: boolean;
|
19
|
+
/** Error for displaying */
|
20
|
+
error?: string | React.ReactNode;
|
15
21
|
}
|
16
22
|
export type Country = {
|
17
23
|
id: string;
|
package/dist/country-select.js
CHANGED
@@ -2,23 +2,23 @@ var de = Object.defineProperty;
|
|
2
2
|
var ge = (i, e, t) => e in i ? de(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
3
3
|
var H1 = (i, e, t) => ge(i, typeof e != "symbol" ? e + "" : e, t);
|
4
4
|
import "./index.css";
|
5
|
-
import { jsx as n, Fragment as
|
5
|
+
import { jsx as n, Fragment as $, jsxs as C } from "react/jsx-runtime";
|
6
6
|
import { SNMTUiContext as Ce } from "@snmt-react-ui/core";
|
7
7
|
import { Select as ue, Flex as pe, Avatar as we, Checkbox as fe, Typography as J1, Tag as me, Popover as ke } from "antd";
|
8
|
-
import { createContext as e1, forwardRef as m1, useState as S, useRef as a1, useEffect as A, useCallback as
|
8
|
+
import { createContext as e1, forwardRef as m1, useState as S, useRef as a1, useEffect as A, useCallback as j, useContext as J } from "react";
|
9
9
|
var Le = Object.defineProperty, ve = (i, e, t) => e in i ? Le(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Ne = (i, e, t) => ve(i, e + "", t), xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
10
10
|
function Me() {
|
11
11
|
if (console && console.warn) {
|
12
12
|
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
|
13
13
|
e[t] = arguments[t];
|
14
|
-
|
14
|
+
U(e[0]) && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
|
15
15
|
}
|
16
16
|
}
|
17
17
|
const I1 = {};
|
18
18
|
function M1() {
|
19
19
|
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
|
20
20
|
e[t] = arguments[t];
|
21
|
-
|
21
|
+
U(e[0]) && I1[e[0]] || (U(e[0]) && (I1[e[0]] = /* @__PURE__ */ new Date()), Me(...e));
|
22
22
|
}
|
23
23
|
const q1 = (i, e) => () => {
|
24
24
|
if (i.isInitialized)
|
@@ -34,7 +34,7 @@ const q1 = (i, e) => () => {
|
|
34
34
|
}, O1 = (i, e, t) => {
|
35
35
|
i.loadNamespaces(e, q1(i, t));
|
36
36
|
}, S1 = (i, e, t, s) => {
|
37
|
-
|
37
|
+
U(t) && (t = [t]), t.forEach((o) => {
|
38
38
|
i.options.ns.indexOf(o) < 0 && i.options.ns.push(o);
|
39
39
|
}), i.loadLanguages(e, q1(i, s));
|
40
40
|
}, Re = function(i, e) {
|
@@ -54,7 +54,7 @@ const q1 = (i, e) => () => {
|
|
54
54
|
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && s.services.backendConnector.backend && s.isLanguageChangingTo && !o(s.isLanguageChangingTo, i)) return !1;
|
55
55
|
}
|
56
56
|
}) : Re(i, e, t);
|
57
|
-
},
|
57
|
+
}, U = (i) => typeof i == "string", be = (i) => typeof i == "object" && i !== null, _e = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Ee = {
|
58
58
|
"&": "&",
|
59
59
|
"&": "&",
|
60
60
|
"<": "<",
|
@@ -104,18 +104,18 @@ const We = (i, e) => {
|
|
104
104
|
return A(() => {
|
105
105
|
t.current = i;
|
106
106
|
}, [i, e]), t.current;
|
107
|
-
}, Q1 = (i, e, t, s) => i.getFixedT(e, t, s), je = (i, e, t, s) =>
|
107
|
+
}, Q1 = (i, e, t, s) => i.getFixedT(e, t, s), je = (i, e, t, s) => j(Q1(i, e, t, s), [i, e, t, s]), De = function(i) {
|
108
108
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
109
109
|
const {
|
110
110
|
i18n: t
|
111
111
|
} = e, {
|
112
112
|
i18n: s,
|
113
113
|
defaultNS: o
|
114
|
-
} =
|
114
|
+
} = J(Be) || {}, l = t || s || Ae();
|
115
115
|
if (l && !l.reportNamespaces && (l.reportNamespaces = new Ze()), !l) {
|
116
116
|
M1("You will need to pass in an i18next instance by using initReactI18next");
|
117
|
-
const w = (
|
118
|
-
return
|
117
|
+
const w = (N, x) => U(x) ? x : be(x) && U(x.defaultValue) ? x.defaultValue : Array.isArray(N) ? N[N.length - 1] : N, R = [w, {}, !1];
|
118
|
+
return R.t = w, R.i18n = {}, R.ready = !1, R;
|
119
119
|
}
|
120
120
|
l.options.react && l.options.react.wait !== void 0 && M1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
121
121
|
const c = {
|
@@ -127,32 +127,32 @@ const We = (i, e) => {
|
|
127
127
|
keyPrefix: d
|
128
128
|
} = c;
|
129
129
|
let g = i;
|
130
|
-
g =
|
131
|
-
const a = (l.isInitialized || l.initializedStoreOnce) && g.every((w) => ye(w, l, c)), h = je(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), u = () => h, p = () => Q1(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [L,
|
130
|
+
g = U(g) ? [g] : g || ["translation"], l.reportNamespaces.addUsedNamespaces && l.reportNamespaces.addUsedNamespaces(g);
|
131
|
+
const a = (l.isInitialized || l.initializedStoreOnce) && g.every((w) => ye(w, l, c)), h = je(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), u = () => h, p = () => Q1(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [L, y] = S(u);
|
132
132
|
let f = g.join();
|
133
133
|
e.lng && (f = `${e.lng}${f}`);
|
134
|
-
const
|
134
|
+
const _ = We(f), b = a1(!0);
|
135
135
|
A(() => {
|
136
136
|
const {
|
137
137
|
bindI18n: w,
|
138
|
-
bindI18nStore:
|
138
|
+
bindI18nStore: R
|
139
139
|
} = c;
|
140
|
-
|
141
|
-
|
140
|
+
b.current = !0, !a && !r && (e.lng ? S1(l, e.lng, g, () => {
|
141
|
+
b.current && y(p);
|
142
142
|
}) : O1(l, g, () => {
|
143
|
-
|
144
|
-
})), a &&
|
145
|
-
const
|
146
|
-
|
143
|
+
b.current && y(p);
|
144
|
+
})), a && _ && _ !== f && b.current && y(p);
|
145
|
+
const N = () => {
|
146
|
+
b.current && y(p);
|
147
147
|
};
|
148
|
-
return w && l && l.on(w,
|
149
|
-
|
148
|
+
return w && l && l.on(w, N), R && l && l.store.on(R, N), () => {
|
149
|
+
b.current = !1, w && l && w.split(" ").forEach((x) => l.off(x, N)), R && l && R.split(" ").forEach((x) => l.store.off(x, N));
|
150
150
|
};
|
151
151
|
}, [l, f]), A(() => {
|
152
|
-
|
152
|
+
b.current && a && y(u);
|
153
153
|
}, [l, d, a]);
|
154
|
-
const
|
155
|
-
if (
|
154
|
+
const E = [L, l, a];
|
155
|
+
if (E.t = L, E.i18n = l, E.ready = a, a || !a && !r) return E;
|
156
156
|
throw new Promise((w) => {
|
157
157
|
e.lng ? S1(l, e.lng, g, () => w()) : O1(l, g, () => w());
|
158
158
|
});
|
@@ -192,7 +192,7 @@ const We = (i, e) => {
|
|
192
192
|
}
|
193
193
|
);
|
194
194
|
};
|
195
|
-
var
|
195
|
+
var P = /* @__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))(P || {});
|
196
196
|
const _1 = e1({
|
197
197
|
locale: "en",
|
198
198
|
theme: "light"
|
@@ -210,7 +210,7 @@ const Ge = ({
|
|
210
210
|
A(() => {
|
211
211
|
r(i), g(e);
|
212
212
|
}, [i, e]);
|
213
|
-
const { theme: a } =
|
213
|
+
const { theme: a } = J(_1);
|
214
214
|
return /* @__PURE__ */ n(
|
215
215
|
fe,
|
216
216
|
{
|
@@ -3476,14 +3476,14 @@ const Ke = ({
|
|
3476
3476
|
disabled: l = !1,
|
3477
3477
|
onClick: c
|
3478
3478
|
}) => {
|
3479
|
-
const [r, d] = S(o), { theme: g } =
|
3479
|
+
const [r, d] = S(o), { theme: g } = J(X1), a = l ? g && g === "dark" ? m.GREY_LIGHT_4 : m.GREY_DARK_1 : s, h = l ? void 0 : c;
|
3480
3480
|
return A(() => {
|
3481
3481
|
if (o) {
|
3482
3482
|
h && !l && d(`${o} clickable`);
|
3483
3483
|
return;
|
3484
3484
|
}
|
3485
3485
|
h && !l && d("clickable");
|
3486
|
-
}, [h, o, l]), /* @__PURE__ */ n(
|
3486
|
+
}, [h, o, l]), /* @__PURE__ */ n($, { children: (() => {
|
3487
3487
|
switch (i) {
|
3488
3488
|
case "nextIcon":
|
3489
3489
|
return A2({ width: e, height: t, color: a, className: r, onClick: h });
|
@@ -3738,7 +3738,7 @@ const Ke = ({
|
|
3738
3738
|
case "docs":
|
3739
3739
|
return Mt({ width: e, height: t, color: a, className: r, onClick: h });
|
3740
3740
|
default:
|
3741
|
-
return /* @__PURE__ */ n(
|
3741
|
+
return /* @__PURE__ */ n($, { children: "No Icon provided" });
|
3742
3742
|
}
|
3743
3743
|
})() });
|
3744
3744
|
}, { Title: Rt, Text: yt } = J1, bt = {
|
@@ -7031,14 +7031,14 @@ const Et = ({
|
|
7031
7031
|
disabled: l = !1,
|
7032
7032
|
onClick: c
|
7033
7033
|
}) => {
|
7034
|
-
const [r, d] = S(o), { theme: g } =
|
7034
|
+
const [r, d] = S(o), { theme: g } = J(ee), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : s, h = l ? void 0 : c;
|
7035
7035
|
return A(() => {
|
7036
7036
|
if (o) {
|
7037
7037
|
h && !l && d(`${o} clickable`);
|
7038
7038
|
return;
|
7039
7039
|
}
|
7040
7040
|
h && !l && d("clickable");
|
7041
|
-
}, [h, o, l]), /* @__PURE__ */ n(
|
7041
|
+
}, [h, o, l]), /* @__PURE__ */ n($, { children: (() => {
|
7042
7042
|
switch (i) {
|
7043
7043
|
case "nextIcon":
|
7044
7044
|
return v5({ width: e, height: t, color: a, className: r, onClick: h });
|
@@ -7293,7 +7293,7 @@ const Et = ({
|
|
7293
7293
|
case "docs":
|
7294
7294
|
return c3({ width: e, height: t, color: a, className: r, onClick: h });
|
7295
7295
|
default:
|
7296
|
-
return /* @__PURE__ */ n(
|
7296
|
+
return /* @__PURE__ */ n($, { children: "No Icon provided" });
|
7297
7297
|
}
|
7298
7298
|
})() });
|
7299
7299
|
};
|
@@ -7424,7 +7424,7 @@ const k3 = ({
|
|
7424
7424
|
options: l,
|
7425
7425
|
extraOptions: c
|
7426
7426
|
}) => {
|
7427
|
-
const { locale: r } =
|
7427
|
+
const { locale: r } = J(_1), { t: d } = De("common", { lng: r }), [g, a] = S(!1);
|
7428
7428
|
if (A(() => {
|
7429
7429
|
i.length || a(!1);
|
7430
7430
|
}, [i]), !i.length)
|
@@ -7484,39 +7484,39 @@ const k3 = ({
|
|
7484
7484
|
onDropdownVisibleChange: u,
|
7485
7485
|
onScrollToEnd: p,
|
7486
7486
|
onPopupScroll: L,
|
7487
|
-
id:
|
7487
|
+
id: y,
|
7488
7488
|
extraOptions: f,
|
7489
|
-
dropdownRender:
|
7490
|
-
optionRender:
|
7491
|
-
isLoading:
|
7489
|
+
dropdownRender: _,
|
7490
|
+
optionRender: b,
|
7491
|
+
isLoading: E,
|
7492
7492
|
readOnly: w,
|
7493
|
-
error:
|
7494
|
-
},
|
7495
|
-
const [
|
7493
|
+
error: R
|
7494
|
+
}, N) => {
|
7495
|
+
const [x, Z] = S(!1), [T, t1] = S(!1), [F, h1] = S(!0), [H, G] = S(i), Y = a1(null);
|
7496
7496
|
A(() => {
|
7497
|
-
|
7497
|
+
G(i);
|
7498
7498
|
}, [i]);
|
7499
|
-
const q = (
|
7500
|
-
|
7501
|
-
}, c1 = (
|
7502
|
-
var
|
7503
|
-
return !!((
|
7499
|
+
const q = (M) => {
|
7500
|
+
Z(M), u && u(M);
|
7501
|
+
}, c1 = (M, V) => {
|
7502
|
+
var W;
|
7503
|
+
return !!((W = V == null ? void 0 : V.label) != null && W.toString().toLowerCase().includes(M.toLowerCase()));
|
7504
7504
|
}, O = () => {
|
7505
7505
|
t1(!0);
|
7506
|
-
},
|
7506
|
+
}, K = () => {
|
7507
7507
|
t1(!1);
|
7508
|
-
}, B =
|
7509
|
-
(
|
7510
|
-
if (
|
7511
|
-
const
|
7512
|
-
e == null || e(
|
7508
|
+
}, B = j(
|
7509
|
+
(M) => {
|
7510
|
+
if (G(M), s) {
|
7511
|
+
const W = M;
|
7512
|
+
e == null || e(W);
|
7513
7513
|
return;
|
7514
7514
|
}
|
7515
|
-
const V =
|
7515
|
+
const V = M;
|
7516
7516
|
e == null || e(V);
|
7517
7517
|
},
|
7518
7518
|
[s, e]
|
7519
|
-
), d1 =
|
7519
|
+
), d1 = j(() => {
|
7520
7520
|
if (!w) {
|
7521
7521
|
if (s) {
|
7522
7522
|
B([]);
|
@@ -7524,41 +7524,41 @@ const k3 = ({
|
|
7524
7524
|
}
|
7525
7525
|
B("");
|
7526
7526
|
}
|
7527
|
-
}, [B, s, w]), g1 =
|
7528
|
-
(
|
7529
|
-
const V = H.filter((
|
7530
|
-
B(V),
|
7527
|
+
}, [B, s, w]), g1 = j(
|
7528
|
+
(M) => {
|
7529
|
+
const V = H.filter((W) => W !== M);
|
7530
|
+
B(V), G(V);
|
7531
7531
|
},
|
7532
7532
|
[B, H]
|
7533
|
-
), E1 =
|
7534
|
-
(
|
7533
|
+
), E1 = j(
|
7534
|
+
(M) => (H == null ? void 0 : H.indexOf(M)) === 0 ? (
|
7535
7535
|
// if the search input is empty
|
7536
7536
|
// then display the placeholder, else do not display it
|
7537
|
-
/* @__PURE__ */ n("span", { className: "custom-placeholder", children:
|
7538
|
-
) : /* @__PURE__ */ n(
|
7539
|
-
[
|
7540
|
-
), le = (
|
7541
|
-
|
7542
|
-
}, ae = async (
|
7543
|
-
const { target: V } =
|
7544
|
-
V.scrollTop + V.offsetHeight >= V.scrollHeight - a && (p == null || p(!0)), L && await L(
|
7545
|
-
}, L1 =
|
7546
|
-
(
|
7547
|
-
var V,
|
7548
|
-
return ((V = l.find((v1) => v1.value ===
|
7549
|
-
(v1) => v1.value ===
|
7550
|
-
)) == null ? void 0 :
|
7537
|
+
/* @__PURE__ */ n("span", { className: "custom-placeholder", children: F ? t : "" })
|
7538
|
+
) : /* @__PURE__ */ n($, {}),
|
7539
|
+
[F, H, t]
|
7540
|
+
), le = (M) => {
|
7541
|
+
M.preventDefault(), M.stopPropagation();
|
7542
|
+
}, ae = async (M) => {
|
7543
|
+
const { target: V } = M;
|
7544
|
+
V.scrollTop + V.offsetHeight >= V.scrollHeight - a && (p == null || p(!0)), L && await L(M);
|
7545
|
+
}, L1 = j(
|
7546
|
+
(M) => {
|
7547
|
+
var V, W;
|
7548
|
+
return ((V = l.find((v1) => v1.value === M)) == null ? void 0 : V.label) || ((W = f == null ? void 0 : f.find(
|
7549
|
+
(v1) => v1.value === M
|
7550
|
+
)) == null ? void 0 : W.label) || M;
|
7551
7551
|
},
|
7552
7552
|
[f, l]
|
7553
|
-
), he =
|
7554
|
-
(
|
7553
|
+
), he = j(
|
7554
|
+
(M) => {
|
7555
7555
|
var V;
|
7556
7556
|
return /* @__PURE__ */ n(
|
7557
7557
|
k3,
|
7558
7558
|
{
|
7559
|
-
values:
|
7559
|
+
values: M,
|
7560
7560
|
onTagClose: g1,
|
7561
|
-
maxWidth: ((V =
|
7561
|
+
maxWidth: ((V = Y.current) == null ? void 0 : V.clientWidth) || 0,
|
7562
7562
|
disabled: r,
|
7563
7563
|
closable: !w,
|
7564
7564
|
options: l,
|
@@ -7567,16 +7567,16 @@ const k3 = ({
|
|
7567
7567
|
);
|
7568
7568
|
},
|
7569
7569
|
[r, f, g1, l, w]
|
7570
|
-
), ce =
|
7571
|
-
({ label:
|
7570
|
+
), ce = j(
|
7571
|
+
({ label: M, value: V, mode: W }) => W === "filter" ? E1(V) : /* @__PURE__ */ n("div", { onMouseDown: le, className: "tag-wrapper", children: /* @__PURE__ */ n(te, { onClose: () => g1(V), disabled: r, children: typeof M == "object" ? M : L1(V) }) }),
|
7572
7572
|
[r, L1, g1, E1]
|
7573
7573
|
), V1 = Array.isArray(H) && H.length > 0 || !!H && typeof H == "string" && H.trim() !== "";
|
7574
7574
|
return /* @__PURE__ */ C(
|
7575
7575
|
"div",
|
7576
7576
|
{
|
7577
|
-
className: `snmt-select-1-15-6 ${
|
7577
|
+
className: `snmt-select-1-15-6 ${T ? "snmt-select-focused" : ""}
|
7578
7578
|
${s ? "" : "snmt-select-single"} ${w ? "snmt-select-read-only" : ""}`,
|
7579
|
-
ref:
|
7579
|
+
ref: Y,
|
7580
7580
|
style: { width: c },
|
7581
7581
|
children: [
|
7582
7582
|
/* @__PURE__ */ n(
|
@@ -7584,96 +7584,96 @@ const k3 = ({
|
|
7584
7584
|
{
|
7585
7585
|
className: "snmt-select-blank",
|
7586
7586
|
popupClassName: w ? "dropdown-read-only" : "",
|
7587
|
-
id:
|
7588
|
-
ref:
|
7587
|
+
id: y,
|
7588
|
+
ref: N,
|
7589
7589
|
showSearch: !!o,
|
7590
7590
|
filterOption: o && c1,
|
7591
7591
|
onDropdownVisibleChange: q,
|
7592
7592
|
disabled: r,
|
7593
7593
|
value: H || void 0,
|
7594
|
-
labelRender: (
|
7594
|
+
labelRender: (M) => L1(M.value),
|
7595
7595
|
mode: s === "filter" ? "multiple" : s,
|
7596
7596
|
onChange: B,
|
7597
7597
|
onFocus: O,
|
7598
|
-
onBlur:
|
7599
|
-
onSearch: (
|
7600
|
-
h1(!
|
7598
|
+
onBlur: K,
|
7599
|
+
onSearch: (M) => {
|
7600
|
+
h1(!M), h && h(M);
|
7601
7601
|
},
|
7602
7602
|
onSelect: () => h1(!0),
|
7603
7603
|
onDeselect: () => h1(!0),
|
7604
|
-
tagRender: (
|
7604
|
+
tagRender: (M) => ce({ ...M, mode: s }),
|
7605
7605
|
maxTagCount: "responsive",
|
7606
7606
|
maxTagPlaceholder: he,
|
7607
7607
|
onPopupScroll: ae,
|
7608
|
-
prefix:
|
7609
|
-
suffixIcon: /* @__PURE__ */ n("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ C(
|
7608
|
+
prefix: E && /* @__PURE__ */ n(A1, { size: 15 }),
|
7609
|
+
suffixIcon: /* @__PURE__ */ n("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ C($, { children: [
|
7610
7610
|
H && !!H.length && (s || g) && /* @__PURE__ */ n("div", { onClick: d1, children: /* @__PURE__ */ n(
|
7611
7611
|
i1,
|
7612
7612
|
{
|
7613
7613
|
name: "cancel",
|
7614
|
-
color: r ?
|
7614
|
+
color: r ? P.GREY_DARK_1 : P.GREY_DARK_5
|
7615
7615
|
}
|
7616
7616
|
) }),
|
7617
7617
|
/* @__PURE__ */ n(
|
7618
7618
|
i1,
|
7619
7619
|
{
|
7620
7620
|
name: "selectArrowIcon",
|
7621
|
-
color: r ?
|
7622
|
-
className:
|
7623
|
-
onClick: () =>
|
7621
|
+
color: r ? P.GREY_DARK_1 : P.GREY_DARK_5,
|
7622
|
+
className: x ? "select-arrow-rotated" : "select-arrow",
|
7623
|
+
onClick: () => Z(!x)
|
7624
7624
|
}
|
7625
7625
|
)
|
7626
7626
|
] }) }),
|
7627
|
-
removeIcon: /* @__PURE__ */ n(i1, { name: "errorSmall", color:
|
7627
|
+
removeIcon: /* @__PURE__ */ n(i1, { name: "errorSmall", color: P.GREY_DARK_2 }),
|
7628
7628
|
options: l,
|
7629
|
-
optionRender: (
|
7629
|
+
optionRender: (M) => b ? b(M.data) : /* @__PURE__ */ C(o1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
7630
7630
|
/* @__PURE__ */ C(o1, { alignItems: "center", gap: 12, children: [
|
7631
7631
|
s && /* @__PURE__ */ n(
|
7632
7632
|
Ge,
|
7633
7633
|
{
|
7634
|
-
checked: !!(H != null && H.includes(
|
7634
|
+
checked: !!(H != null && H.includes(M.value))
|
7635
7635
|
}
|
7636
7636
|
),
|
7637
7637
|
/* @__PURE__ */ C(o1, { alignItems: "center", gap: 8, children: [
|
7638
|
-
|
7639
|
-
/* @__PURE__ */ n("span", { children:
|
7638
|
+
M.data.image && /* @__PURE__ */ n(Te, { src: M.data.image, size: 20 }),
|
7639
|
+
/* @__PURE__ */ n("span", { children: M.label })
|
7640
7640
|
] })
|
7641
7641
|
] }),
|
7642
|
-
!s && H ===
|
7642
|
+
!s && H === M.value && /* @__PURE__ */ n(
|
7643
7643
|
i1,
|
7644
7644
|
{
|
7645
7645
|
name: "ok",
|
7646
|
-
color:
|
7646
|
+
color: P.BLUE_PRIMARY,
|
7647
7647
|
width: 16,
|
7648
7648
|
height: 16
|
7649
7649
|
}
|
7650
7650
|
)
|
7651
7651
|
] }),
|
7652
|
-
dropdownRender: (
|
7653
|
-
/* @__PURE__ */ n("div", { className: "dropdown-menu", children:
|
7654
|
-
|
7652
|
+
dropdownRender: (M) => /* @__PURE__ */ C("div", { className: "dropdown-container", children: [
|
7653
|
+
/* @__PURE__ */ n("div", { className: "dropdown-menu", children: _ ? _(M) : M }),
|
7654
|
+
E && /* @__PURE__ */ n("div", { className: "loading-overlay", children: /* @__PURE__ */ n(A1, { size: 28 }) })
|
7655
7655
|
] })
|
7656
7656
|
}
|
7657
7657
|
),
|
7658
|
-
t && /* @__PURE__ */ C(
|
7658
|
+
t && /* @__PURE__ */ C($, { children: [
|
7659
7659
|
/* @__PURE__ */ n(
|
7660
7660
|
"label",
|
7661
7661
|
{
|
7662
|
-
className: `${
|
7662
|
+
className: `${T || V1 ? "label-floating" : ""} ${r ? "label-disabled" : ""} ${T ? "label-focused" : ""} ${E ? "label-loading" : ""} ${R ? "label-error" : ""}`,
|
7663
7663
|
children: d ? `${t}*` : t
|
7664
7664
|
}
|
7665
7665
|
),
|
7666
7666
|
/* @__PURE__ */ n(
|
7667
7667
|
"fieldset",
|
7668
7668
|
{
|
7669
|
-
className: `${
|
7669
|
+
className: `${T ? "fieldset-focused" : ""} ${r ? "fieldset-disabled" : ""} ${V1 ? "fieldset-filled" : ""} ${R ? "fieldset-error" : ""}`,
|
7670
7670
|
children: /* @__PURE__ */ n("legend", { children: /* @__PURE__ */ n("span", { children: d ? `${t}*` : t }) })
|
7671
7671
|
}
|
7672
7672
|
)
|
7673
7673
|
] }),
|
7674
|
-
|
7675
|
-
/* @__PURE__ */ n(i1, { name: "attention", color:
|
7676
|
-
typeof
|
7674
|
+
R && /* @__PURE__ */ C(o1, { justifyContent: "flex-start", gap: 6, children: [
|
7675
|
+
/* @__PURE__ */ n(i1, { name: "attention", color: P.NOTIFICATION_ERROR_DARK }),
|
7676
|
+
typeof R == "string" ? /* @__PURE__ */ n(w3, { color: P.NOTIFICATION_ERROR_DARK, variant: "body4", children: R }) : R
|
7677
7677
|
] })
|
7678
7678
|
]
|
7679
7679
|
}
|
@@ -7844,7 +7844,7 @@ class w1 {
|
|
7844
7844
|
return e = e || this.options, e.prefix = e.prefix || this.prefix, new w1(this.logger, e);
|
7845
7845
|
}
|
7846
7846
|
}
|
7847
|
-
var
|
7847
|
+
var D = new w1();
|
7848
7848
|
class k1 {
|
7849
7849
|
constructor() {
|
7850
7850
|
this.observers = {};
|
@@ -7969,7 +7969,7 @@ const T1 = {};
|
|
7969
7969
|
class f1 extends k1 {
|
7970
7970
|
constructor(e) {
|
7971
7971
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
7972
|
-
super(), v3(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger =
|
7972
|
+
super(), v3(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = D.create("translator");
|
7973
7973
|
}
|
7974
7974
|
changeLanguage(e) {
|
7975
7975
|
e && (this.language = e);
|
@@ -8036,8 +8036,8 @@ class f1 extends k1 {
|
|
8036
8036
|
}
|
8037
8037
|
const h = this.resolve(e, t);
|
8038
8038
|
let u = h && h.res;
|
8039
|
-
const p = h && h.usedKey || c, L = h && h.exactUsedKey || c,
|
8040
|
-
if (
|
8039
|
+
const p = h && h.usedKey || c, L = h && h.exactUsedKey || c, y = Object.prototype.toString.apply(u), f = ["[object Number]", "[object Function]", "[object RegExp]"], _ = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, E = !v(u) && typeof u != "boolean" && typeof u != "number";
|
8040
|
+
if (b && u && E && f.indexOf(y) < 0 && !(v(_) && Array.isArray(u))) {
|
8041
8041
|
if (!t.returnObjects && !this.options.returnObjects) {
|
8042
8042
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
8043
8043
|
const w = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, u, {
|
@@ -8047,53 +8047,53 @@ class f1 extends k1 {
|
|
8047
8047
|
return o ? (h.res = w, h.usedParams = this.getUsedParamsDetails(t), h) : w;
|
8048
8048
|
}
|
8049
8049
|
if (l) {
|
8050
|
-
const w = Array.isArray(u),
|
8051
|
-
for (const
|
8052
|
-
if (Object.prototype.hasOwnProperty.call(u,
|
8053
|
-
const
|
8054
|
-
|
8050
|
+
const w = Array.isArray(u), R = w ? [] : {}, N = w ? L : p;
|
8051
|
+
for (const x in u)
|
8052
|
+
if (Object.prototype.hasOwnProperty.call(u, x)) {
|
8053
|
+
const Z = `${N}${l}${x}`;
|
8054
|
+
R[x] = this.translate(Z, {
|
8055
8055
|
...t,
|
8056
8056
|
joinArrays: !1,
|
8057
8057
|
ns: r
|
8058
|
-
}),
|
8058
|
+
}), R[x] === Z && (R[x] = u[x]);
|
8059
8059
|
}
|
8060
|
-
u =
|
8060
|
+
u = R;
|
8061
8061
|
}
|
8062
|
-
} else if (
|
8063
|
-
u = u.join(
|
8062
|
+
} else if (b && v(_) && Array.isArray(u))
|
8063
|
+
u = u.join(_), u && (u = this.extendTranslation(u, e, t, s));
|
8064
8064
|
else {
|
8065
|
-
let w = !1,
|
8066
|
-
const
|
8065
|
+
let w = !1, R = !1;
|
8066
|
+
const N = t.count !== void 0 && !v(t.count), x = f1.hasDefaultValue(t), Z = N ? this.pluralResolver.getSuffix(g, t.count, t) : "", T = t.ordinal && N ? this.pluralResolver.getSuffix(g, t.count, {
|
8067
8067
|
ordinal: !1
|
8068
|
-
}) : "", t1 =
|
8069
|
-
!this.isValidLookup(u) &&
|
8070
|
-
const H = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) &&
|
8071
|
-
if (
|
8072
|
-
if (this.logger.log(
|
8068
|
+
}) : "", t1 = N && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), F = t1 && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${Z}`] || t[`defaultValue${T}`] || t.defaultValue;
|
8069
|
+
!this.isValidLookup(u) && x && (w = !0, u = F), this.isValidLookup(u) || (R = !0, u = c);
|
8070
|
+
const H = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && R ? void 0 : u, G = x && F !== u && this.options.updateMissing;
|
8071
|
+
if (R || w || G) {
|
8072
|
+
if (this.logger.log(G ? "updateKey" : "missingKey", g, d, c, G ? F : u), l) {
|
8073
8073
|
const O = this.resolve(c, {
|
8074
8074
|
...t,
|
8075
8075
|
keySeparator: !1
|
8076
8076
|
});
|
8077
8077
|
O && O.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.");
|
8078
8078
|
}
|
8079
|
-
let
|
8079
|
+
let Y = [];
|
8080
8080
|
const q = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
8081
8081
|
if (this.options.saveMissingTo === "fallback" && q && q[0])
|
8082
8082
|
for (let O = 0; O < q.length; O++)
|
8083
|
-
|
8084
|
-
else this.options.saveMissingTo === "all" ?
|
8085
|
-
const c1 = (O,
|
8086
|
-
const d1 =
|
8087
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(O, d,
|
8083
|
+
Y.push(q[O]);
|
8084
|
+
else this.options.saveMissingTo === "all" ? Y = this.languageUtils.toResolveHierarchy(t.lng || this.language) : Y.push(t.lng || this.language);
|
8085
|
+
const c1 = (O, K, B) => {
|
8086
|
+
const d1 = x && B !== u ? B : H;
|
8087
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(O, d, K, d1, G, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(O, d, K, d1, G, t), this.emit("missingKey", O, d, K, u);
|
8088
8088
|
};
|
8089
|
-
this.options.saveMissing && (this.options.saveMissingPlurals &&
|
8090
|
-
const
|
8091
|
-
t1 && t[`defaultValue${this.options.pluralSeparator}zero`] &&
|
8092
|
-
c1([O], c + B, t[`defaultValue${B}`] ||
|
8089
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && N ? Y.forEach((O) => {
|
8090
|
+
const K = this.pluralResolver.getSuffixes(O, t);
|
8091
|
+
t1 && t[`defaultValue${this.options.pluralSeparator}zero`] && K.indexOf(`${this.options.pluralSeparator}zero`) < 0 && K.push(`${this.options.pluralSeparator}zero`), K.forEach((B) => {
|
8092
|
+
c1([O], c + B, t[`defaultValue${B}`] || F);
|
8093
8093
|
});
|
8094
|
-
}) : c1(
|
8094
|
+
}) : c1(Y, c, F));
|
8095
8095
|
}
|
8096
|
-
u = this.extendTranslation(u, e, t, h, s),
|
8096
|
+
u = this.extendTranslation(u, e, t, h, s), R && u === c && this.options.appendNamespaceToMissingKey && (u = `${d}:${c}`), (R || w) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}:${c}` : c, w ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
|
8097
8097
|
}
|
8098
8098
|
return o ? (h.res = u, h.usedParams = this.getUsedParamsDetails(t), h) : u;
|
8099
8099
|
}
|
@@ -8151,26 +8151,26 @@ class f1 extends k1 {
|
|
8151
8151
|
o = a;
|
8152
8152
|
let h = g.namespaces;
|
8153
8153
|
this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
|
8154
|
-
const u = t.count !== void 0 && !v(t.count), p = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), L = t.context !== void 0 && (v(t.context) || typeof t.context == "number") && t.context !== "",
|
8154
|
+
const u = t.count !== void 0 && !v(t.count), p = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), L = t.context !== void 0 && (v(t.context) || typeof t.context == "number") && t.context !== "", y = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
8155
8155
|
h.forEach((f) => {
|
8156
|
-
this.isValidLookup(s) || (r = f, !T1[`${
|
8156
|
+
this.isValidLookup(s) || (r = f, !T1[`${y[0]}-${f}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(r) && (T1[`${y[0]}-${f}`] = !0, this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${r}" 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!!!")), y.forEach((_) => {
|
8157
8157
|
if (this.isValidLookup(s)) return;
|
8158
|
-
c =
|
8159
|
-
const
|
8158
|
+
c = _;
|
8159
|
+
const b = [a];
|
8160
8160
|
if (this.i18nFormat && this.i18nFormat.addLookupKeys)
|
8161
|
-
this.i18nFormat.addLookupKeys(
|
8161
|
+
this.i18nFormat.addLookupKeys(b, a, _, f, t);
|
8162
8162
|
else {
|
8163
8163
|
let w;
|
8164
|
-
u && (w = this.pluralResolver.getSuffix(
|
8165
|
-
const
|
8166
|
-
if (u && (
|
8167
|
-
const
|
8168
|
-
|
8164
|
+
u && (w = this.pluralResolver.getSuffix(_, t.count, t));
|
8165
|
+
const R = `${this.options.pluralSeparator}zero`, N = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
8166
|
+
if (u && (b.push(a + w), t.ordinal && w.indexOf(N) === 0 && b.push(a + w.replace(N, this.options.pluralSeparator)), p && b.push(a + R)), L) {
|
8167
|
+
const x = `${a}${this.options.contextSeparator}${t.context}`;
|
8168
|
+
b.push(x), u && (b.push(x + w), t.ordinal && w.indexOf(N) === 0 && b.push(x + w.replace(N, this.options.pluralSeparator)), p && b.push(x + R));
|
8169
8169
|
}
|
8170
8170
|
}
|
8171
|
-
let
|
8172
|
-
for (;
|
8173
|
-
this.isValidLookup(s) || (l =
|
8171
|
+
let E;
|
8172
|
+
for (; E = b.pop(); )
|
8173
|
+
this.isValidLookup(s) || (l = E, s = this.getResource(_, f, E, t));
|
8174
8174
|
}));
|
8175
8175
|
});
|
8176
8176
|
}), {
|
@@ -8215,7 +8215,7 @@ class f1 extends k1 {
|
|
8215
8215
|
const N1 = (i) => i.charAt(0).toUpperCase() + i.slice(1);
|
8216
8216
|
class G1 {
|
8217
8217
|
constructor(e) {
|
8218
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
8218
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = D.create("languageUtils");
|
8219
8219
|
}
|
8220
8220
|
getScriptPartFromCode(e) {
|
8221
8221
|
if (e = p1(e), !e || e.indexOf("-") < 0) return null;
|
@@ -8415,7 +8415,7 @@ const S3 = ["v1", "v2", "v3"], A3 = ["v4"], K1 = {
|
|
8415
8415
|
class Z3 {
|
8416
8416
|
constructor(e) {
|
8417
8417
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
8418
|
-
this.languageUtils = e, this.options = t, this.logger =
|
8418
|
+
this.languageUtils = e, this.options = t, this.logger = D.create("pluralResolver"), (!this.options.compatibilityJSON || A3.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = B3(), this.pluralRulesCache = {};
|
8419
8419
|
}
|
8420
8420
|
addRule(e, t) {
|
8421
8421
|
this.rules[e] = t;
|
@@ -8483,7 +8483,7 @@ const P1 = function(i, e, t) {
|
|
8483
8483
|
class W3 {
|
8484
8484
|
constructor() {
|
8485
8485
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
8486
|
-
this.logger =
|
8486
|
+
this.logger = D.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
8487
8487
|
}
|
8488
8488
|
init() {
|
8489
8489
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
@@ -8504,12 +8504,12 @@ class W3 {
|
|
8504
8504
|
nestingPrefix: u,
|
8505
8505
|
nestingPrefixEscaped: p,
|
8506
8506
|
nestingSuffix: L,
|
8507
|
-
nestingSuffixEscaped:
|
8507
|
+
nestingSuffixEscaped: y,
|
8508
8508
|
nestingOptionsSeparator: f,
|
8509
|
-
maxReplaces:
|
8510
|
-
alwaysFormat:
|
8509
|
+
maxReplaces: _,
|
8510
|
+
alwaysFormat: b
|
8511
8511
|
} = e.interpolation;
|
8512
|
-
this.escape = t !== void 0 ? t : y3, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = o !== void 0 ? o : !1, this.prefix = l ? Q(l) : c || "{{", this.suffix = r ? Q(r) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = u ? Q(u) : p || Q("$t("), this.nestingSuffix = L ? Q(L) :
|
8512
|
+
this.escape = t !== void 0 ? t : y3, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = o !== void 0 ? o : !1, this.prefix = l ? Q(l) : c || "{{", this.suffix = r ? Q(r) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = u ? Q(u) : p || Q("$t("), this.nestingSuffix = L ? Q(L) : y || Q(")"), this.nestingOptionsSeparator = f || ",", this.maxReplaces = _ || 1e3, this.alwaysFormat = b !== void 0 ? b : !1, this.resetRegExp();
|
8513
8513
|
}
|
8514
8514
|
reset() {
|
8515
8515
|
this.options && this.init(this.options);
|
@@ -8522,18 +8522,18 @@ class W3 {
|
|
8522
8522
|
let l, c, r;
|
8523
8523
|
const d = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, g = (p) => {
|
8524
8524
|
if (p.indexOf(this.formatSeparator) < 0) {
|
8525
|
-
const
|
8526
|
-
return this.alwaysFormat ? this.format(
|
8525
|
+
const _ = P1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
8526
|
+
return this.alwaysFormat ? this.format(_, void 0, s, {
|
8527
8527
|
...o,
|
8528
8528
|
...t,
|
8529
8529
|
interpolationkey: p
|
8530
|
-
}) :
|
8530
|
+
}) : _;
|
8531
8531
|
}
|
8532
|
-
const L = p.split(this.formatSeparator),
|
8533
|
-
return this.format(P1(t, d,
|
8532
|
+
const L = p.split(this.formatSeparator), y = L.shift().trim(), f = L.join(this.formatSeparator).trim();
|
8533
|
+
return this.format(P1(t, d, y, this.options.keySeparator, this.options.ignoreJSONStructure), f, s, {
|
8534
8534
|
...o,
|
8535
8535
|
...t,
|
8536
|
-
interpolationkey:
|
8536
|
+
interpolationkey: y
|
8537
8537
|
});
|
8538
8538
|
};
|
8539
8539
|
this.resetRegExp();
|
@@ -8559,8 +8559,8 @@ class W3 {
|
|
8559
8559
|
} else
|
8560
8560
|
this.logger.warn(`missed to pass in variable ${L} for interpolating ${e}`), c = "";
|
8561
8561
|
else !v(c) && !this.useRawValueToEscape && (c = B1(c));
|
8562
|
-
const
|
8563
|
-
if (e = e.replace(l[0],
|
8562
|
+
const y = p.safeValue(c);
|
8563
|
+
if (e = e.replace(l[0], y), h ? (p.regex.lastIndex += c.length, p.regex.lastIndex -= l[0].length) : p.regex.lastIndex = 0, r++, r >= this.maxReplaces)
|
8564
8564
|
break;
|
8565
8565
|
}
|
8566
8566
|
}), e;
|
@@ -8580,8 +8580,8 @@ class W3 {
|
|
8580
8580
|
...g,
|
8581
8581
|
...c
|
8582
8582
|
});
|
8583
|
-
} catch (
|
8584
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${d}`,
|
8583
|
+
} catch (y) {
|
8584
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${d}`, y), `${d}${a}${u}`;
|
8585
8585
|
}
|
8586
8586
|
return c.defaultValue && c.defaultValue.indexOf(this.prefix) > -1 && delete c.defaultValue, d;
|
8587
8587
|
};
|
@@ -8638,7 +8638,7 @@ const j3 = (i) => {
|
|
8638
8638
|
class D3 {
|
8639
8639
|
constructor() {
|
8640
8640
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
8641
|
-
this.logger =
|
8641
|
+
this.logger = D.create("formatter"), this.options = e, this.formats = {
|
8642
8642
|
number: X((t, s) => {
|
8643
8643
|
const o = new Intl.NumberFormat(t, {
|
8644
8644
|
...s
|
@@ -8721,7 +8721,7 @@ const T3 = (i, e) => {
|
|
8721
8721
|
class G3 extends k1 {
|
8722
8722
|
constructor(e, t, s) {
|
8723
8723
|
let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
8724
|
-
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = o, this.logger =
|
8724
|
+
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = o, this.logger = D.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = o.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = o.maxRetries >= 0 ? o.maxRetries : 5, this.retryTimeout = o.retryTimeout >= 1 ? o.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, o.backend, o);
|
8725
8725
|
}
|
8726
8726
|
queueLoad(e, t, s, o) {
|
8727
8727
|
const l = {}, c = {}, r = {}, d = {};
|
@@ -8918,7 +8918,7 @@ const F1 = () => ({
|
|
8918
8918
|
class l1 extends k1 {
|
8919
8919
|
constructor() {
|
8920
8920
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
8921
|
-
if (super(), this.options = Y1(e), this.services = {}, this.logger =
|
8921
|
+
if (super(), this.options = Y1(e), this.services = {}, this.logger = D, this.modules = {
|
8922
8922
|
external: []
|
8923
8923
|
}, K3(this), t && !this.isInitialized && !e.isClone) {
|
8924
8924
|
if (!this.options.initImmediate)
|
@@ -8943,26 +8943,26 @@ class l1 extends k1 {
|
|
8943
8943
|
}), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
8944
8944
|
const l = (a) => a ? typeof a == "function" ? new a() : a : null;
|
8945
8945
|
if (!this.options.isClone) {
|
8946
|
-
this.modules.logger ?
|
8946
|
+
this.modules.logger ? D.init(l(this.modules.logger), this.options) : D.init(null, this.options);
|
8947
8947
|
let a;
|
8948
8948
|
this.modules.formatter ? a = this.modules.formatter : typeof Intl < "u" && (a = D3);
|
8949
8949
|
const h = new G1(this.options);
|
8950
8950
|
this.store = new D1(this.options.resources, this.options);
|
8951
8951
|
const u = this.services;
|
8952
|
-
u.logger =
|
8952
|
+
u.logger = D, u.resourceStore = this.store, u.languageUtils = h, u.pluralResolver = new Z3(h, {
|
8953
8953
|
prepend: this.options.pluralSeparator,
|
8954
8954
|
compatibilityJSON: this.options.compatibilityJSON,
|
8955
8955
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
8956
8956
|
}), a && (!this.options.interpolation.format || this.options.interpolation.format === o.interpolation.format) && (u.formatter = l(a), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new W3(this.options), u.utils = {
|
8957
8957
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
8958
8958
|
}, u.backendConnector = new G3(l(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(p) {
|
8959
|
-
for (var L = arguments.length,
|
8960
|
-
|
8961
|
-
e.emit(p, ...
|
8959
|
+
for (var L = arguments.length, y = new Array(L > 1 ? L - 1 : 0), f = 1; f < L; f++)
|
8960
|
+
y[f - 1] = arguments[f];
|
8961
|
+
e.emit(p, ...y);
|
8962
8962
|
}), this.modules.languageDetector && (u.languageDetector = l(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = l(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new f1(this.services, this.options), this.translator.on("*", function(p) {
|
8963
|
-
for (var L = arguments.length,
|
8964
|
-
|
8965
|
-
e.emit(p, ...
|
8963
|
+
for (var L = arguments.length, y = new Array(L > 1 ? L - 1 : 0), f = 1; f < L; f++)
|
8964
|
+
y[f - 1] = arguments[f];
|
8965
|
+
e.emit(p, ...y);
|
8966
8966
|
}), this.modules.external.forEach((p) => {
|
8967
8967
|
p.init && p.init(this);
|
8968
8968
|
});
|
@@ -9173,14 +9173,14 @@ function P3() {
|
|
9173
9173
|
if (console && console.warn) {
|
9174
9174
|
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
|
9175
9175
|
e[t] = arguments[t];
|
9176
|
-
|
9176
|
+
z(e[0]) && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
|
9177
9177
|
}
|
9178
9178
|
}
|
9179
9179
|
const $1 = {};
|
9180
9180
|
function y1() {
|
9181
9181
|
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
|
9182
9182
|
e[t] = arguments[t];
|
9183
|
-
|
9183
|
+
z(e[0]) && $1[e[0]] || (z(e[0]) && ($1[e[0]] = /* @__PURE__ */ new Date()), P3(...e));
|
9184
9184
|
}
|
9185
9185
|
const oe = (i, e) => () => {
|
9186
9186
|
if (i.isInitialized)
|
@@ -9196,7 +9196,7 @@ const oe = (i, e) => () => {
|
|
9196
9196
|
}, U1 = (i, e, t) => {
|
9197
9197
|
i.loadNamespaces(e, oe(i, t));
|
9198
9198
|
}, z1 = (i, e, t, s) => {
|
9199
|
-
|
9199
|
+
z(t) && (t = [t]), t.forEach((o) => {
|
9200
9200
|
i.options.ns.indexOf(o) < 0 && i.options.ns.push(o);
|
9201
9201
|
}), i.loadLanguages(e, oe(i, s));
|
9202
9202
|
}, F3 = function(i, e) {
|
@@ -9216,7 +9216,7 @@ const oe = (i, e) => () => {
|
|
9216
9216
|
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && o.services.backendConnector.backend && o.isLanguageChangingTo && !l(o.isLanguageChangingTo, i)) return !1;
|
9217
9217
|
}
|
9218
9218
|
}) : F3(i, e, t);
|
9219
|
-
},
|
9219
|
+
}, z = (i) => typeof i == "string", $3 = (i) => typeof i == "object" && i !== null, U3 = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, z3 = {
|
9220
9220
|
"&": "&",
|
9221
9221
|
"&": "&",
|
9222
9222
|
"<": "<",
|
@@ -9280,18 +9280,18 @@ const n0 = (i, e) => {
|
|
9280
9280
|
return A(() => {
|
9281
9281
|
t.current = i;
|
9282
9282
|
}, [i, e]), t.current;
|
9283
|
-
}, re = (i, e, t, s) => i.getFixedT(e, t, s), r0 = (i, e, t, s) =>
|
9283
|
+
}, re = (i, e, t, s) => i.getFixedT(e, t, s), r0 = (i, e, t, s) => j(re(i, e, t, s), [i, e, t, s]), l0 = function(i) {
|
9284
9284
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
9285
9285
|
const {
|
9286
9286
|
i18n: t
|
9287
9287
|
} = e, {
|
9288
9288
|
i18n: s,
|
9289
9289
|
defaultNS: o
|
9290
|
-
} =
|
9290
|
+
} = J(s0) || {}, l = t || s || t0();
|
9291
9291
|
if (l && !l.reportNamespaces && (l.reportNamespaces = new o0()), !l) {
|
9292
9292
|
y1("You will need to pass in an i18next instance by using initReactI18next");
|
9293
|
-
const w = (
|
9294
|
-
return
|
9293
|
+
const w = (N, x) => z(x) ? x : $3(x) && z(x.defaultValue) ? x.defaultValue : Array.isArray(N) ? N[N.length - 1] : N, R = [w, {}, !1];
|
9294
|
+
return R.t = w, R.i18n = {}, R.ready = !1, R;
|
9295
9295
|
}
|
9296
9296
|
l.options.react && l.options.react.wait !== void 0 && y1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
9297
9297
|
const c = {
|
@@ -9303,32 +9303,32 @@ const n0 = (i, e) => {
|
|
9303
9303
|
keyPrefix: d
|
9304
9304
|
} = c;
|
9305
9305
|
let g = i;
|
9306
|
-
g =
|
9307
|
-
const a = (l.isInitialized || l.initializedStoreOnce) && g.every((w) => Y3(w, l, c)), h = r0(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), u = () => h, p = () => re(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [L,
|
9306
|
+
g = z(g) ? [g] : g || ["translation"], l.reportNamespaces.addUsedNamespaces && l.reportNamespaces.addUsedNamespaces(g);
|
9307
|
+
const a = (l.isInitialized || l.initializedStoreOnce) && g.every((w) => Y3(w, l, c)), h = r0(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), u = () => h, p = () => re(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [L, y] = S(u);
|
9308
9308
|
let f = g.join();
|
9309
9309
|
e.lng && (f = `${e.lng}${f}`);
|
9310
|
-
const
|
9310
|
+
const _ = n0(f), b = a1(!0);
|
9311
9311
|
A(() => {
|
9312
9312
|
const {
|
9313
9313
|
bindI18n: w,
|
9314
|
-
bindI18nStore:
|
9314
|
+
bindI18nStore: R
|
9315
9315
|
} = c;
|
9316
|
-
|
9317
|
-
|
9316
|
+
b.current = !0, !a && !r && (e.lng ? z1(l, e.lng, g, () => {
|
9317
|
+
b.current && y(p);
|
9318
9318
|
}) : U1(l, g, () => {
|
9319
|
-
|
9320
|
-
})), a &&
|
9321
|
-
const
|
9322
|
-
|
9319
|
+
b.current && y(p);
|
9320
|
+
})), a && _ && _ !== f && b.current && y(p);
|
9321
|
+
const N = () => {
|
9322
|
+
b.current && y(p);
|
9323
9323
|
};
|
9324
|
-
return w && l && l.on(w,
|
9325
|
-
|
9324
|
+
return w && l && l.on(w, N), R && l && l.store.on(R, N), () => {
|
9325
|
+
b.current = !1, w && l && w.split(" ").forEach((x) => l.off(x, N)), R && l && R.split(" ").forEach((x) => l.store.off(x, N));
|
9326
9326
|
};
|
9327
9327
|
}, [l, f]), A(() => {
|
9328
|
-
|
9328
|
+
b.current && a && y(u);
|
9329
9329
|
}, [l, d, a]);
|
9330
|
-
const
|
9331
|
-
if (
|
9330
|
+
const E = [L, l, a];
|
9331
|
+
if (E.t = L, E.i18n = l, E.ready = a, a || !a && !r) return E;
|
9332
9332
|
throw new Promise((w) => {
|
9333
9333
|
e.lng ? z1(l, e.lng, g, () => w()) : U1(l, g, () => w());
|
9334
9334
|
});
|
@@ -9350,61 +9350,75 @@ I.use(i0).init({
|
|
9350
9350
|
}
|
9351
9351
|
});
|
9352
9352
|
const k0 = m1(
|
9353
|
-
({
|
9354
|
-
|
9355
|
-
|
9353
|
+
({
|
9354
|
+
width: i,
|
9355
|
+
selectedCity: e,
|
9356
|
+
setSelectedCity: t,
|
9357
|
+
onChange: s,
|
9358
|
+
value: o,
|
9359
|
+
id: l,
|
9360
|
+
disabled: c,
|
9361
|
+
required: r,
|
9362
|
+
clearable: d,
|
9363
|
+
error: g
|
9364
|
+
}, a) => {
|
9365
|
+
const [h, u] = S([]), [p, L] = S([]), [y, f] = S(!1), { locale: _, axiosPeople: b } = J(Ce);
|
9366
|
+
if (!b)
|
9356
9367
|
throw new Error(
|
9357
9368
|
`CountrySelect requires "axiosPeople" to fetch counties.
|
9358
9369
|
Please provide it via SNMTUiContext.`
|
9359
9370
|
);
|
9360
|
-
const { t:
|
9361
|
-
|
9371
|
+
const { t: E } = l0("common", { lng: _ }), w = j(async () => {
|
9372
|
+
f(!0);
|
9362
9373
|
try {
|
9363
|
-
const
|
9364
|
-
|
9374
|
+
const N = await b.post("v1/countries/search");
|
9375
|
+
L(N == null ? void 0 : N.data.data);
|
9365
9376
|
} catch {
|
9366
|
-
|
9377
|
+
u([]);
|
9367
9378
|
} finally {
|
9368
|
-
|
9379
|
+
f(!1);
|
9369
9380
|
}
|
9370
|
-
}, [
|
9381
|
+
}, [b]);
|
9371
9382
|
A(() => {
|
9372
|
-
|
9383
|
+
w();
|
9373
9384
|
}, []), A(() => {
|
9374
9385
|
if (e) {
|
9375
|
-
const
|
9376
|
-
(
|
9386
|
+
const N = e.split("-")[1], x = p.filter(
|
9387
|
+
(Z) => Z.name.includes(N)
|
9377
9388
|
);
|
9378
|
-
if (
|
9379
|
-
const
|
9380
|
-
label:
|
9381
|
-
value:
|
9389
|
+
if (x.length) {
|
9390
|
+
const Z = x.map((T) => ({
|
9391
|
+
label: T.name,
|
9392
|
+
value: T.name
|
9382
9393
|
}));
|
9383
|
-
s(
|
9394
|
+
s(Z[0].value);
|
9384
9395
|
}
|
9385
9396
|
}
|
9386
|
-
}, [e,
|
9387
|
-
const
|
9388
|
-
label:
|
9389
|
-
value:
|
9397
|
+
}, [e, p, s]), A(() => {
|
9398
|
+
const N = p.map((x) => ({
|
9399
|
+
label: x.name,
|
9400
|
+
value: x.name
|
9390
9401
|
}));
|
9391
|
-
|
9392
|
-
}, [
|
9393
|
-
const
|
9394
|
-
|
9402
|
+
u(N);
|
9403
|
+
}, [p]);
|
9404
|
+
const R = (N) => {
|
9405
|
+
N === null ? (s(""), t && t("")) : (s(N), t && t(""));
|
9395
9406
|
};
|
9396
9407
|
return /* @__PURE__ */ n("div", { className: "snmt-country-select", children: /* @__PURE__ */ n(
|
9397
9408
|
L3,
|
9398
9409
|
{
|
9399
9410
|
id: l,
|
9400
9411
|
width: i,
|
9401
|
-
placeholder:
|
9412
|
+
placeholder: E("placeholder"),
|
9402
9413
|
value: o,
|
9403
|
-
ref:
|
9404
|
-
onChange:
|
9405
|
-
options:
|
9414
|
+
ref: a,
|
9415
|
+
onChange: R,
|
9416
|
+
options: h,
|
9406
9417
|
disabled: c,
|
9407
|
-
isLoading:
|
9418
|
+
isLoading: y,
|
9419
|
+
required: r,
|
9420
|
+
clearable: d,
|
9421
|
+
error: g
|
9408
9422
|
}
|
9409
9423
|
) });
|
9410
9424
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@snmt-react-ui/country-select",
|
3
3
|
"private": false,
|
4
|
-
"version": "2.
|
4
|
+
"version": "2.5.0",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/country-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/city-select": "^2.5.
|
21
|
+
"@snmt-react-ui/city-select": "^2.5.9",
|
22
22
|
"@snmt-react-ui/core": "^2.2.0",
|
23
23
|
"@snmt-react-ui/flex": "^1.5.1",
|
24
24
|
"i18next": "^23.11.5",
|
@@ -27,5 +27,5 @@
|
|
27
27
|
"peerDependencies": {
|
28
28
|
"antd": "^5.18.3"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "8d61a4db9fb68d6fa82a8a9bad7d8f1663688f0a"
|
31
31
|
}
|