@snmt-react-ui/city-select 2.6.6 → 2.6.8
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/city-select.js +149 -137
- package/package.json +3 -3
package/dist/city-select.js
CHANGED
@@ -4,7 +4,7 @@ var B1 = (i, e, t) => me(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import "./index.css";
|
5
5
|
import { jsx as r, Fragment as i1, jsxs as C } from "react/jsx-runtime";
|
6
6
|
import { SNMTUiContext as ke } from "@snmt-react-ui/core";
|
7
|
-
import { createContext as d1, forwardRef as k1, useState as A, useRef as Y, useEffect as
|
7
|
+
import { createContext as d1, forwardRef as k1, useState as A, useRef as Y, useEffect as j, useCallback as D, useMemo as Le, useImperativeHandle as ne, useContext as r1 } from "react";
|
8
8
|
import { Select as ve, Flex as Ne, Avatar as xe, Checkbox as Re, Typography as re, Tag as Me, Popover as ye } from "antd";
|
9
9
|
var be = Object.defineProperty, Ee = (i, e, t) => e in i ? be(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, He = (i, e, t) => Ee(i, e + "", t), _e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
10
10
|
function Ie() {
|
@@ -14,11 +14,11 @@ function Ie() {
|
|
14
14
|
s1(e[0]) && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
|
15
15
|
}
|
16
16
|
}
|
17
|
-
const
|
18
|
-
function
|
17
|
+
const j1 = {};
|
18
|
+
function O1() {
|
19
19
|
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
|
20
20
|
e[t] = arguments[t];
|
21
|
-
s1(e[0]) &&
|
21
|
+
s1(e[0]) && j1[e[0]] || (s1(e[0]) && (j1[e[0]] = /* @__PURE__ */ new Date()), Ie(...e));
|
22
22
|
}
|
23
23
|
const oe = (i, e) => () => {
|
24
24
|
if (i.isInitialized)
|
@@ -31,13 +31,13 @@ const oe = (i, e) => () => {
|
|
31
31
|
};
|
32
32
|
i.on("initialized", t);
|
33
33
|
}
|
34
|
-
},
|
34
|
+
}, Z1 = (i, e, t) => {
|
35
35
|
i.loadNamespaces(e, oe(i, t));
|
36
36
|
}, D1 = (i, e, t, s) => {
|
37
37
|
s1(t) && (t = [t]), t.forEach((n) => {
|
38
38
|
i.options.ns.indexOf(n) < 0 && i.options.ns.push(n);
|
39
39
|
}), i.loadLanguages(e, oe(i, s));
|
40
|
-
},
|
40
|
+
}, Oe = function(i, e) {
|
41
41
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
42
42
|
const s = e.languages[0], n = e.options ? e.options.fallbackLng : !1, o = e.languages[e.languages.length - 1];
|
43
43
|
if (s.toLowerCase() === "cimode") return !0;
|
@@ -46,14 +46,14 @@ const oe = (i, e) => () => {
|
|
46
46
|
return g === -1 || g === 2;
|
47
47
|
};
|
48
48
|
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !c(e.isLanguageChangingTo, i) ? !1 : !!(e.hasResourceBundle(s, i) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || c(s, i) && (!n || c(o, i)));
|
49
|
-
},
|
49
|
+
}, Se = function(i, e) {
|
50
50
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
51
|
-
return !e.languages || !e.languages.length ? (
|
51
|
+
return !e.languages || !e.languages.length ? (O1("i18n.languages were undefined or empty", e.languages), !0) : e.options.ignoreJSONStructure !== void 0 ? e.hasLoadedNamespace(i, {
|
52
52
|
lng: t.lng,
|
53
53
|
precheck: (s, n) => {
|
54
54
|
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && s.services.backendConnector.backend && s.isLanguageChangingTo && !n(s.isLanguageChangingTo, i)) return !1;
|
55
55
|
}
|
56
|
-
}) :
|
56
|
+
}) : Oe(i, e, t);
|
57
57
|
}, s1 = (i) => typeof i == "string", Ve = (i) => typeof i == "object" && i !== null, Ae = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Te = {
|
58
58
|
"&": "&",
|
59
59
|
"&": "&",
|
@@ -75,8 +75,8 @@ const oe = (i, e) => () => {
|
|
75
75
|
"…": "…",
|
76
76
|
"/": "/",
|
77
77
|
"/": "/"
|
78
|
-
}, Be = (i) => Te[i],
|
79
|
-
let
|
78
|
+
}, Be = (i) => Te[i], je = (i) => i.replace(Ae, Be);
|
79
|
+
let Ze = {
|
80
80
|
bindI18n: "languageChanged",
|
81
81
|
bindI18nStore: "",
|
82
82
|
transEmptyNodeValue: "",
|
@@ -84,9 +84,9 @@ let je = {
|
|
84
84
|
transWrapTextNodes: "",
|
85
85
|
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
86
86
|
useSuspense: !0,
|
87
|
-
unescape:
|
87
|
+
unescape: je
|
88
88
|
};
|
89
|
-
const De = () =>
|
89
|
+
const De = () => Ze;
|
90
90
|
let We;
|
91
91
|
const Ge = () => We, Ke = d1();
|
92
92
|
class Pe {
|
@@ -101,7 +101,7 @@ class Pe {
|
|
101
101
|
}
|
102
102
|
const $e = (i, e) => {
|
103
103
|
const t = Y();
|
104
|
-
return
|
104
|
+
return j(() => {
|
105
105
|
t.current = i;
|
106
106
|
}, [i, e]), t.current;
|
107
107
|
}, ae = (i, e, t, s) => i.getFixedT(e, t, s), Fe = (i, e, t, s) => D(ae(i, e, t, s), [i, e, t, s]), Ye = function(i) {
|
@@ -113,11 +113,11 @@ const $e = (i, e) => {
|
|
113
113
|
defaultNS: n
|
114
114
|
} = r1(Ke) || {}, o = t || s || Ge();
|
115
115
|
if (o && !o.reportNamespaces && (o.reportNamespaces = new Pe()), !o) {
|
116
|
-
|
116
|
+
O1("You will need to pass in an i18next instance by using initReactI18next");
|
117
117
|
const f = (N, m) => s1(m) ? m : Ve(m) && s1(m.defaultValue) ? m.defaultValue : Array.isArray(N) ? N[N.length - 1] : N, w = [f, {}, !1];
|
118
118
|
return w.t = f, w.i18n = {}, w.ready = !1, w;
|
119
119
|
}
|
120
|
-
o.options.react && o.options.react.wait !== void 0 &&
|
120
|
+
o.options.react && o.options.react.wait !== void 0 && O1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
121
121
|
const c = {
|
122
122
|
...De(),
|
123
123
|
...o.options.react,
|
@@ -128,18 +128,18 @@ const $e = (i, e) => {
|
|
128
128
|
} = c;
|
129
129
|
let g = i;
|
130
130
|
g = s1(g) ? [g] : g || ["translation"], o.reportNamespaces.addUsedNamespaces && o.reportNamespaces.addUsedNamespaces(g);
|
131
|
-
const l = (o.isInitialized || o.initializedStoreOnce) && g.every((f) =>
|
131
|
+
const l = (o.isInitialized || o.initializedStoreOnce) && g.every((f) => Se(f, o, c)), h = Fe(o, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), u = () => h, p = () => ae(o, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [v, x] = A(u);
|
132
132
|
let L = g.join();
|
133
133
|
e.lng && (L = `${e.lng}${L}`);
|
134
134
|
const H = $e(L), M = Y(!0);
|
135
|
-
|
135
|
+
j(() => {
|
136
136
|
const {
|
137
137
|
bindI18n: f,
|
138
138
|
bindI18nStore: w
|
139
139
|
} = c;
|
140
140
|
M.current = !0, !l && !a && (e.lng ? D1(o, e.lng, g, () => {
|
141
141
|
M.current && x(p);
|
142
|
-
}) :
|
142
|
+
}) : Z1(o, g, () => {
|
143
143
|
M.current && x(p);
|
144
144
|
})), l && H && H !== L && M.current && x(p);
|
145
145
|
const N = () => {
|
@@ -148,13 +148,13 @@ const $e = (i, e) => {
|
|
148
148
|
return f && o && o.on(f, N), w && o && o.store.on(w, N), () => {
|
149
149
|
M.current = !1, f && o && f.split(" ").forEach((m) => o.off(m, N)), w && o && w.split(" ").forEach((m) => o.store.off(m, N));
|
150
150
|
};
|
151
|
-
}, [o, L]),
|
151
|
+
}, [o, L]), j(() => {
|
152
152
|
M.current && l && x(u);
|
153
153
|
}, [o, d, l]);
|
154
154
|
const _ = [v, o, l];
|
155
155
|
if (_.t = v, _.i18n = o, _.ready = l, l || !l && !a) return _;
|
156
156
|
throw new Promise((f) => {
|
157
|
-
e.lng ? D1(o, e.lng, g, () => f()) :
|
157
|
+
e.lng ? D1(o, e.lng, g, () => f()) : Z1(o, g, () => f());
|
158
158
|
});
|
159
159
|
}, p1 = ({
|
160
160
|
children: i,
|
@@ -192,7 +192,7 @@ const $e = (i, e) => {
|
|
192
192
|
}
|
193
193
|
);
|
194
194
|
};
|
195
|
-
var
|
195
|
+
var z = /* @__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))(z || {});
|
196
196
|
const T1 = d1({
|
197
197
|
locale: "en",
|
198
198
|
theme: "light"
|
@@ -207,7 +207,7 @@ const ze = ({
|
|
207
207
|
disableUncheck: o = !1
|
208
208
|
}) => {
|
209
209
|
const [c, a] = A(i), [d, g] = A(e);
|
210
|
-
|
210
|
+
j(() => {
|
211
211
|
a(i), g(e);
|
212
212
|
}, [i, e]);
|
213
213
|
const { theme: l } = r1(T1);
|
@@ -1508,7 +1508,7 @@ const Je = ({
|
|
1508
1508
|
}
|
1509
1509
|
)
|
1510
1510
|
}
|
1511
|
-
),
|
1511
|
+
), Ot = ({
|
1512
1512
|
className: i,
|
1513
1513
|
color: e = b.GREY_DARK_5,
|
1514
1514
|
height: t = 20,
|
@@ -1535,7 +1535,7 @@ const Je = ({
|
|
1535
1535
|
}
|
1536
1536
|
)
|
1537
1537
|
}
|
1538
|
-
),
|
1538
|
+
), St = ({
|
1539
1539
|
className: i,
|
1540
1540
|
color: e = b.GREY_DARK_5,
|
1541
1541
|
height: t = 5,
|
@@ -1689,7 +1689,7 @@ const Je = ({
|
|
1689
1689
|
}
|
1690
1690
|
)
|
1691
1691
|
}
|
1692
|
-
),
|
1692
|
+
), jt = ({
|
1693
1693
|
className: i,
|
1694
1694
|
color: e = b.GREY_DARK_5,
|
1695
1695
|
height: t = 24,
|
@@ -1748,7 +1748,7 @@ const Je = ({
|
|
1748
1748
|
)
|
1749
1749
|
]
|
1750
1750
|
}
|
1751
|
-
),
|
1751
|
+
), Zt = ({
|
1752
1752
|
className: i,
|
1753
1753
|
color: e = b.GREY_DARK_5,
|
1754
1754
|
height: t = 24,
|
@@ -2728,7 +2728,7 @@ const Je = ({
|
|
2728
2728
|
onClick: c
|
2729
2729
|
}) => {
|
2730
2730
|
const [a, d] = A(n), { theme: g } = r1(le), l = o ? g && g === "dark" ? b.GREY_LIGHT_4 : b.GREY_DARK_1 : s, h = o ? void 0 : c;
|
2731
|
-
return
|
2731
|
+
return j(() => {
|
2732
2732
|
if (n) {
|
2733
2733
|
h && !o && d(`${n} clickable`);
|
2734
2734
|
return;
|
@@ -2739,7 +2739,7 @@ const Je = ({
|
|
2739
2739
|
case "nextIcon":
|
2740
2740
|
return It({ width: e, height: t, color: l, className: a, onClick: h });
|
2741
2741
|
case "prevIcon":
|
2742
|
-
return
|
2742
|
+
return Ot({ width: e, height: t, color: l, className: a, onClick: h });
|
2743
2743
|
case "arrowDown":
|
2744
2744
|
return Je({ width: e, height: t, color: l, className: a, onClick: h });
|
2745
2745
|
case "info":
|
@@ -2867,17 +2867,17 @@ const Je = ({
|
|
2867
2867
|
case "arrowUpFilled":
|
2868
2868
|
return Vt({ width: e, height: t, color: l, className: a, onClick: h });
|
2869
2869
|
case "arrowDownFilled":
|
2870
|
-
return
|
2870
|
+
return St({ width: e, height: t, color: l, className: a, onClick: h });
|
2871
2871
|
case "link":
|
2872
2872
|
return At({ width: e, height: t, color: l, className: a, onClick: h });
|
2873
2873
|
case "telegram":
|
2874
2874
|
return Bt({ width: e, height: t, color: l, className: a, onClick: h });
|
2875
2875
|
case "mail":
|
2876
|
-
return
|
2876
|
+
return Zt({ width: e, height: t, color: l, className: a, onClick: h });
|
2877
2877
|
case "github":
|
2878
2878
|
return Tt({ width: e, height: t, color: l, className: a, onClick: h });
|
2879
2879
|
case "linkedIn":
|
2880
|
-
return
|
2880
|
+
return jt({ width: e, height: t, color: l, className: a, onClick: h });
|
2881
2881
|
case "emptyStateIcon":
|
2882
2882
|
return Dt({ width: e, height: t, color: l, className: a, onClick: h });
|
2883
2883
|
case "filtersIcon":
|
@@ -3593,7 +3593,7 @@ const p2 = ({
|
|
3593
3593
|
)
|
3594
3594
|
]
|
3595
3595
|
}
|
3596
|
-
),
|
3596
|
+
), O2 = ({
|
3597
3597
|
width: i = 18,
|
3598
3598
|
height: e = 16,
|
3599
3599
|
color: t = "#001E52",
|
@@ -3632,7 +3632,7 @@ const p2 = ({
|
|
3632
3632
|
)
|
3633
3633
|
]
|
3634
3634
|
}
|
3635
|
-
),
|
3635
|
+
), S2 = ({
|
3636
3636
|
width: i = 20,
|
3637
3637
|
height: e = 20,
|
3638
3638
|
color: t = "#001E52",
|
@@ -3812,7 +3812,7 @@ const p2 = ({
|
|
3812
3812
|
)
|
3813
3813
|
]
|
3814
3814
|
}
|
3815
|
-
),
|
3815
|
+
), j2 = ({
|
3816
3816
|
width: i = 10,
|
3817
3817
|
height: e = 10,
|
3818
3818
|
color: t = "#88A4FF",
|
@@ -3860,7 +3860,7 @@ const p2 = ({
|
|
3860
3860
|
)
|
3861
3861
|
]
|
3862
3862
|
}
|
3863
|
-
),
|
3863
|
+
), Z2 = ({
|
3864
3864
|
width: i = 14,
|
3865
3865
|
height: e = 14,
|
3866
3866
|
color: t = "#8E8E93",
|
@@ -5474,7 +5474,7 @@ const p2 = ({
|
|
5474
5474
|
onClick: c
|
5475
5475
|
}) => {
|
5476
5476
|
const [a, d] = A(n), { theme: g } = r1(he), l = o ? g && g === "dark" ? E.GREY_LIGHT_4 : E.GREY_DARK_1 : s, h = o ? void 0 : c;
|
5477
|
-
return
|
5477
|
+
return j(() => {
|
5478
5478
|
if (n) {
|
5479
5479
|
h && !o && d(`${n} clickable`);
|
5480
5480
|
return;
|
@@ -5539,9 +5539,9 @@ const p2 = ({
|
|
5539
5539
|
onClick: h
|
5540
5540
|
});
|
5541
5541
|
case "history":
|
5542
|
-
return S2({ width: e, height: t, color: l, className: a, onClick: h });
|
5543
|
-
case "logOut":
|
5544
5542
|
return O2({ width: e, height: t, color: l, className: a, onClick: h });
|
5543
|
+
case "logOut":
|
5544
|
+
return S2({ width: e, height: t, color: l, className: a, onClick: h });
|
5545
5545
|
case "settings":
|
5546
5546
|
return V2({ width: e, height: t, color: l, className: a, onClick: h });
|
5547
5547
|
case "trash":
|
@@ -5551,9 +5551,9 @@ const p2 = ({
|
|
5551
5551
|
case "success":
|
5552
5552
|
return B2({ width: e, height: t, color: l, className: a, onClick: h });
|
5553
5553
|
case "errorSmall":
|
5554
|
-
return Z2({ width: e, height: t, color: l, className: a, onClick: h });
|
5555
|
-
case "infoMedium":
|
5556
5554
|
return j2({ width: e, height: t, color: l, className: a, onClick: h });
|
5555
|
+
case "infoMedium":
|
5556
|
+
return Z2({ width: e, height: t, color: l, className: a, onClick: h });
|
5557
5557
|
case "attentionMedium":
|
5558
5558
|
return D2({
|
5559
5559
|
width: e,
|
@@ -5723,7 +5723,7 @@ const ce = ({
|
|
5723
5723
|
) : i
|
5724
5724
|
}
|
5725
5725
|
);
|
5726
|
-
}, { Title:
|
5726
|
+
}, { Title: Oi, Text: Si } = re, Vi = {
|
5727
5727
|
h1: 1,
|
5728
5728
|
h2: 2,
|
5729
5729
|
h3: 3,
|
@@ -5741,7 +5741,7 @@ const ce = ({
|
|
5741
5741
|
const d = e === "h1" || e === "h2" || e === "h3" || e === "h4";
|
5742
5742
|
let g = `snmt-typography snmt-typography-${e}`;
|
5743
5743
|
return i && i !== "inherit" && (g += ` snmt-typography-align-${i}`), o && (g += " collapsed"), d ? /* @__PURE__ */ r(
|
5744
|
-
|
5744
|
+
Oi,
|
5745
5745
|
{
|
5746
5746
|
className: g,
|
5747
5747
|
style: { color: t, whiteSpace: c },
|
@@ -5751,7 +5751,7 @@ const ce = ({
|
|
5751
5751
|
children: s
|
5752
5752
|
}
|
5753
5753
|
) : /* @__PURE__ */ r(
|
5754
|
-
|
5754
|
+
Si,
|
5755
5755
|
{
|
5756
5756
|
className: g,
|
5757
5757
|
style: { color: t, whiteSpace: c },
|
@@ -5797,7 +5797,7 @@ var Bi = { exports: {} };
|
|
5797
5797
|
} };
|
5798
5798
|
});
|
5799
5799
|
})(Bi);
|
5800
|
-
const
|
5800
|
+
const ji = ({
|
5801
5801
|
values: i,
|
5802
5802
|
onTagClose: e,
|
5803
5803
|
maxWidth: t,
|
@@ -5807,7 +5807,7 @@ const Zi = ({
|
|
5807
5807
|
extraOptions: c
|
5808
5808
|
}) => {
|
5809
5809
|
const { locale: a } = r1(T1), { t: d } = Ye("common", { lng: a }), [g, l] = A(!1);
|
5810
|
-
if (
|
5810
|
+
if (j(() => {
|
5811
5811
|
i.length || l(!1);
|
5812
5812
|
}, [i]), !i.length)
|
5813
5813
|
return null;
|
@@ -5874,19 +5874,19 @@ const Zi = ({
|
|
5874
5874
|
readOnly: f,
|
5875
5875
|
error: w
|
5876
5876
|
}, N) => {
|
5877
|
-
const [m, I] = A(!1), [T,
|
5878
|
-
|
5877
|
+
const [m, I] = A(!1), [T, Z] = A(!1), [G, Q] = A(!0), [O, K] = A(i), U = Y(null);
|
5878
|
+
j(() => {
|
5879
5879
|
K(i);
|
5880
5880
|
}, [i]);
|
5881
|
-
const
|
5881
|
+
const q = (k) => {
|
5882
5882
|
I(k), u && u(k);
|
5883
5883
|
}, X = (k, y) => {
|
5884
5884
|
var V;
|
5885
5885
|
return !!((V = y == null ? void 0 : y.label) != null && V.toString().toLowerCase().includes(k.toLowerCase()));
|
5886
5886
|
}, B = () => {
|
5887
|
-
|
5887
|
+
Z(!0);
|
5888
5888
|
}, $ = () => {
|
5889
|
-
|
5889
|
+
Z(!1);
|
5890
5890
|
}, P = D(
|
5891
5891
|
(k) => {
|
5892
5892
|
if (K(k), s) {
|
@@ -5899,26 +5899,26 @@ const Zi = ({
|
|
5899
5899
|
},
|
5900
5900
|
[s, e]
|
5901
5901
|
), e1 = D(() => {
|
5902
|
-
if (!f) {
|
5902
|
+
if (!(f || a)) {
|
5903
5903
|
if (s) {
|
5904
5904
|
P([]);
|
5905
5905
|
return;
|
5906
5906
|
}
|
5907
5907
|
P("");
|
5908
5908
|
}
|
5909
|
-
}, [P, s, f]), t1 = D(
|
5909
|
+
}, [a, P, s, f]), t1 = D(
|
5910
5910
|
(k) => {
|
5911
|
-
const y =
|
5911
|
+
const y = O.filter((V) => V !== k);
|
5912
5912
|
P(y), K(y);
|
5913
5913
|
},
|
5914
|
-
[P,
|
5914
|
+
[P, O]
|
5915
5915
|
), g1 = D(
|
5916
|
-
(k) => (
|
5916
|
+
(k) => (O == null ? void 0 : O.indexOf(k)) === 0 ? (
|
5917
5917
|
// if the search input is empty
|
5918
5918
|
// then display the placeholder, else do not display it
|
5919
5919
|
/* @__PURE__ */ r("span", { className: "custom-placeholder", children: G ? t : "" })
|
5920
5920
|
) : /* @__PURE__ */ r(i1, {}),
|
5921
|
-
[G,
|
5921
|
+
[G, O, t]
|
5922
5922
|
), L1 = (k) => {
|
5923
5923
|
k.preventDefault(), k.stopPropagation();
|
5924
5924
|
}, v1 = async (k) => {
|
@@ -5936,7 +5936,7 @@ const Zi = ({
|
|
5936
5936
|
(k) => {
|
5937
5937
|
var y;
|
5938
5938
|
return /* @__PURE__ */ r(
|
5939
|
-
|
5939
|
+
ji,
|
5940
5940
|
{
|
5941
5941
|
values: k,
|
5942
5942
|
onTagClose: t1,
|
@@ -5949,10 +5949,10 @@ const Zi = ({
|
|
5949
5949
|
);
|
5950
5950
|
},
|
5951
5951
|
[a, L, t1, o, f]
|
5952
|
-
),
|
5952
|
+
), S = D(
|
5953
5953
|
({ label: k, value: y, mode: V }) => V === "filter" ? g1(y) : /* @__PURE__ */ r("div", { onMouseDown: L1, className: "tag-wrapper", children: /* @__PURE__ */ r(ce, { onClose: () => t1(y), disabled: a, children: typeof k == "object" ? k : o1(y) }) }),
|
5954
5954
|
[a, o1, t1, g1]
|
5955
|
-
), F = Array.isArray(
|
5955
|
+
), F = Array.isArray(O) && O.length > 0 || !!O && typeof O == "string" && O.trim() !== "";
|
5956
5956
|
return /* @__PURE__ */ C("div", { className: "snmt-select-container", children: [
|
5957
5957
|
/* @__PURE__ */ C(
|
5958
5958
|
"div",
|
@@ -5971,10 +5971,13 @@ const Zi = ({
|
|
5971
5971
|
ref: N,
|
5972
5972
|
showSearch: !!n,
|
5973
5973
|
filterOption: n && X,
|
5974
|
-
onDropdownVisibleChange:
|
5974
|
+
onDropdownVisibleChange: q,
|
5975
5975
|
disabled: a,
|
5976
|
-
value:
|
5977
|
-
labelRender: (k) =>
|
5976
|
+
value: O || void 0,
|
5977
|
+
labelRender: (k) => {
|
5978
|
+
const y = o1(k.value);
|
5979
|
+
return a ? /* @__PURE__ */ r("span", { style: { color: z.GREY_DARK_2 }, children: y }) : y;
|
5980
|
+
},
|
5978
5981
|
mode: s === "filter" ? "multiple" : s,
|
5979
5982
|
onChange: P,
|
5980
5983
|
onFocus: B,
|
@@ -5984,37 +5987,46 @@ const Zi = ({
|
|
5984
5987
|
},
|
5985
5988
|
onSelect: () => Q(!0),
|
5986
5989
|
onDeselect: () => Q(!0),
|
5987
|
-
tagRender: (k) =>
|
5990
|
+
tagRender: (k) => S({ ...k, mode: s }),
|
5988
5991
|
maxTagCount: "responsive",
|
5989
5992
|
maxTagPlaceholder: N1,
|
5990
5993
|
onPopupScroll: v1,
|
5991
5994
|
prefix: _ && /* @__PURE__ */ r(W1, { size: 15 }),
|
5992
5995
|
suffixIcon: /* @__PURE__ */ r("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ C(i1, { children: [
|
5993
|
-
|
5994
|
-
|
5996
|
+
O && !!O.length && (s || g) && /* @__PURE__ */ r(
|
5997
|
+
"div",
|
5995
5998
|
{
|
5996
|
-
|
5997
|
-
|
5999
|
+
onClick: e1,
|
6000
|
+
style: {
|
6001
|
+
cursor: a ? "not-allowed" : "pointer"
|
6002
|
+
},
|
6003
|
+
children: /* @__PURE__ */ r(
|
6004
|
+
u1,
|
6005
|
+
{
|
6006
|
+
name: "cancel",
|
6007
|
+
color: a ? z.GREY_DARK_1 : z.GREY_DARK_5
|
6008
|
+
}
|
6009
|
+
)
|
5998
6010
|
}
|
5999
|
-
)
|
6011
|
+
),
|
6000
6012
|
/* @__PURE__ */ r(
|
6001
6013
|
u1,
|
6002
6014
|
{
|
6003
6015
|
name: "selectArrowIcon",
|
6004
|
-
color: a ?
|
6016
|
+
color: a ? z.GREY_DARK_1 : z.GREY_DARK_5,
|
6005
6017
|
className: m ? "select-arrow-rotated" : "select-arrow",
|
6006
6018
|
onClick: () => I(!m)
|
6007
6019
|
}
|
6008
6020
|
)
|
6009
6021
|
] }) }),
|
6010
|
-
removeIcon: /* @__PURE__ */ r(u1, { name: "errorSmall", color:
|
6022
|
+
removeIcon: /* @__PURE__ */ r(u1, { name: "errorSmall", color: z.GREY_DARK_2 }),
|
6011
6023
|
options: o,
|
6012
6024
|
optionRender: (k) => M ? M(k.data) : /* @__PURE__ */ C(p1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
6013
6025
|
/* @__PURE__ */ C(p1, { alignItems: "center", gap: 12, children: [
|
6014
6026
|
s && /* @__PURE__ */ r(
|
6015
6027
|
ze,
|
6016
6028
|
{
|
6017
|
-
checked: !!(
|
6029
|
+
checked: !!(O != null && O.includes(k.value))
|
6018
6030
|
}
|
6019
6031
|
),
|
6020
6032
|
/* @__PURE__ */ C(p1, { alignItems: "center", gap: 8, children: [
|
@@ -6022,11 +6034,11 @@ const Zi = ({
|
|
6022
6034
|
/* @__PURE__ */ r("span", { children: k.label })
|
6023
6035
|
] })
|
6024
6036
|
] }),
|
6025
|
-
!s &&
|
6037
|
+
!s && O === k.value && /* @__PURE__ */ r(
|
6026
6038
|
u1,
|
6027
6039
|
{
|
6028
6040
|
name: "ok",
|
6029
|
-
color:
|
6041
|
+
color: z.BLUE_PRIMARY,
|
6030
6042
|
width: 16,
|
6031
6043
|
height: 16
|
6032
6044
|
}
|
@@ -6058,15 +6070,15 @@ const Zi = ({
|
|
6058
6070
|
}
|
6059
6071
|
),
|
6060
6072
|
w && /* @__PURE__ */ C(p1, { justifyContent: "flex-start", gap: 6, children: [
|
6061
|
-
/* @__PURE__ */ r(u1, { name: "attention", color:
|
6062
|
-
typeof w == "string" ? /* @__PURE__ */ r(Ai, { color:
|
6073
|
+
/* @__PURE__ */ r(u1, { name: "attention", color: z.NOTIFICATION_ERROR_DARK }),
|
6074
|
+
typeof w == "string" ? /* @__PURE__ */ r(Ai, { color: z.NOTIFICATION_ERROR_DARK, variant: "body4", children: w }) : w
|
6063
6075
|
] })
|
6064
6076
|
] });
|
6065
6077
|
}
|
6066
6078
|
);
|
6067
|
-
function
|
6079
|
+
function Zi(i, e = 500) {
|
6068
6080
|
const t = Y();
|
6069
|
-
return
|
6081
|
+
return j(() => () => {
|
6070
6082
|
t.current && clearTimeout(t.current);
|
6071
6083
|
}, []), (...s) => {
|
6072
6084
|
const n = setTimeout(() => {
|
@@ -6077,7 +6089,7 @@ function ji(i, e = 500) {
|
|
6077
6089
|
}
|
6078
6090
|
function K1(i) {
|
6079
6091
|
const e = Y(i);
|
6080
|
-
return
|
6092
|
+
return j(() => {
|
6081
6093
|
e.current = i;
|
6082
6094
|
}, [i]), e.current;
|
6083
6095
|
}
|
@@ -6105,18 +6117,18 @@ const H1 = 100, l1 = {
|
|
6105
6117
|
required: H = !1,
|
6106
6118
|
error: M
|
6107
6119
|
}, _) => {
|
6108
|
-
const [f, w] = A(), [N, m] = A(l1), [I, T] = A(!1), [
|
6120
|
+
const [f, w] = A(), [N, m] = A(l1), [I, T] = A(!1), [Z, G] = A(), [Q, O] = A(!1), [K, U] = A(
|
6109
6121
|
h ?? []
|
6110
|
-
),
|
6122
|
+
), q = K1(N.offset), X = K1(Z), [B, $] = A(!1), P = Y(!1), e1 = D(
|
6111
6123
|
async ({
|
6112
|
-
limit:
|
6124
|
+
limit: S = H1,
|
6113
6125
|
offset: F,
|
6114
6126
|
search: k
|
6115
6127
|
}) => {
|
6116
6128
|
T(!0);
|
6117
6129
|
try {
|
6118
6130
|
const y = await i({
|
6119
|
-
limit:
|
6131
|
+
limit: S,
|
6120
6132
|
offset: F,
|
6121
6133
|
search: k
|
6122
6134
|
});
|
@@ -6133,42 +6145,42 @@ const H1 = 100, l1 = {
|
|
6133
6145
|
}
|
6134
6146
|
},
|
6135
6147
|
[i]
|
6136
|
-
), t1 =
|
6137
|
-
G(
|
6148
|
+
), t1 = Zi((S) => {
|
6149
|
+
G(S), S || m(l1);
|
6138
6150
|
}), g1 = D(
|
6139
|
-
(
|
6151
|
+
(S) => t1(S),
|
6140
6152
|
[t1]
|
6141
6153
|
), L1 = D(
|
6142
|
-
async (
|
6143
|
-
I ||
|
6154
|
+
async (S) => {
|
6155
|
+
I || S && N.count && N.count > ((f == null ? void 0 : f.length) ?? 0) && m((F) => ({
|
6144
6156
|
...F,
|
6145
6157
|
offset: F.offset + H1
|
6146
6158
|
}));
|
6147
6159
|
},
|
6148
6160
|
[I, f == null ? void 0 : f.length, N.count]
|
6149
6161
|
), v1 = D(
|
6150
|
-
(
|
6151
|
-
S
|
6162
|
+
(S) => {
|
6163
|
+
O(S), !S && Z && (G(void 0), m(l1), $(!0)), u == null || u(S);
|
6152
6164
|
},
|
6153
|
-
[u,
|
6165
|
+
[u, Z]
|
6154
6166
|
);
|
6155
|
-
|
6156
|
-
!P.current || I || (B || Q && (
|
6157
|
-
}, [B, Q, N.offset,
|
6167
|
+
j(() => {
|
6168
|
+
!P.current || I || (B || Q && (q !== N.offset || X !== Z || !f)) && (e1({ offset: N.offset, limit: H1, search: Z }), B && $(!1));
|
6169
|
+
}, [B, Q, N.offset, Z, q, X, f, I]), j(() => {
|
6158
6170
|
(g || l) && e1(l1), P.current = !0;
|
6159
|
-
}, []),
|
6160
|
-
h && U((
|
6171
|
+
}, []), j(() => {
|
6172
|
+
h && U((S) => {
|
6161
6173
|
const F = h.filter(
|
6162
|
-
(k) => !
|
6174
|
+
(k) => !S.some((y) => y.value === k.value)
|
6163
6175
|
);
|
6164
|
-
return [...
|
6176
|
+
return [...S, ...F];
|
6165
6177
|
});
|
6166
6178
|
}, [h]);
|
6167
6179
|
const o1 = D(
|
6168
|
-
(
|
6169
|
-
t && t(
|
6180
|
+
(S) => {
|
6181
|
+
t && t(S);
|
6170
6182
|
let F = [];
|
6171
|
-
if (d ? F = Array.isArray(
|
6183
|
+
if (d ? F = Array.isArray(S) ? S : [] : F = S ? [S] : [], Z) {
|
6172
6184
|
const k = F.filter(
|
6173
6185
|
(y) => !(K != null && K.some((V) => V.value === y))
|
6174
6186
|
);
|
@@ -6184,7 +6196,7 @@ const H1 = 100, l1 = {
|
|
6184
6196
|
]), G(void 0), m(l1), $(!0);
|
6185
6197
|
}
|
6186
6198
|
},
|
6187
|
-
[t,
|
6199
|
+
[t, Z, d, f, K]
|
6188
6200
|
), N1 = Le(
|
6189
6201
|
() => ({
|
6190
6202
|
id: n,
|
@@ -6326,7 +6338,7 @@ const Ui = [" ", ",", "?", "!", ";"], zi = new Yi(20), Ji = (i, e, t) => {
|
|
6326
6338
|
c > 0 && !n.test(i.substring(0, c)) && (o = !0);
|
6327
6339
|
}
|
6328
6340
|
return o;
|
6329
|
-
},
|
6341
|
+
}, S1 = function(i, e) {
|
6330
6342
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
6331
6343
|
if (!i) return;
|
6332
6344
|
if (i[e]) return i[e];
|
@@ -6403,7 +6415,7 @@ class y1 {
|
|
6403
6415
|
return e = e || this.options, e.prefix = e.prefix || this.prefix, new y1(this.logger, e);
|
6404
6416
|
}
|
6405
6417
|
}
|
6406
|
-
var
|
6418
|
+
var J = new y1();
|
6407
6419
|
class E1 {
|
6408
6420
|
constructor() {
|
6409
6421
|
this.observers = {};
|
@@ -6459,7 +6471,7 @@ class U1 extends E1 {
|
|
6459
6471
|
let a;
|
6460
6472
|
e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], s && (Array.isArray(s) ? a.push(...s) : R(s) && o ? a.push(...s.split(o)) : a.push(s)));
|
6461
6473
|
const d = R1(this.data, a);
|
6462
|
-
return !d && !t && !s && e.indexOf(".") > -1 && (e = a[0], t = a[1], s = a.slice(2).join(".")), d || !c || !R(s) ? d :
|
6474
|
+
return !d && !t && !s && e.indexOf(".") > -1 && (e = a[0], t = a[1], s = a.slice(2).join(".")), d || !c || !R(s) ? d : S1(this.data && this.data[e] && this.data[e][t], s, o);
|
6463
6475
|
}
|
6464
6476
|
addResource(e, t, s, n) {
|
6465
6477
|
let o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
@@ -6528,7 +6540,7 @@ const z1 = {};
|
|
6528
6540
|
class b1 extends E1 {
|
6529
6541
|
constructor(e) {
|
6530
6542
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
6531
|
-
super(), Wi(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger =
|
6543
|
+
super(), Wi(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = J.create("translator");
|
6532
6544
|
}
|
6533
6545
|
changeLanguage(e) {
|
6534
6546
|
e && (this.language = e);
|
@@ -6624,9 +6636,9 @@ class b1 extends E1 {
|
|
6624
6636
|
let f = !1, w = !1;
|
6625
6637
|
const N = t.count !== void 0 && !R(t.count), m = b1.hasDefaultValue(t), I = N ? this.pluralResolver.getSuffix(g, t.count, t) : "", T = t.ordinal && N ? this.pluralResolver.getSuffix(g, t.count, {
|
6626
6638
|
ordinal: !1
|
6627
|
-
}) : "",
|
6639
|
+
}) : "", Z = N && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), G = Z && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${I}`] || t[`defaultValue${T}`] || t.defaultValue;
|
6628
6640
|
!this.isValidLookup(u) && m && (f = !0, u = G), this.isValidLookup(u) || (w = !0, u = c);
|
6629
|
-
const
|
6641
|
+
const O = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && w ? void 0 : u, K = m && G !== u && this.options.updateMissing;
|
6630
6642
|
if (w || f || K) {
|
6631
6643
|
if (this.logger.log(K ? "updateKey" : "missingKey", g, d, c, K ? G : u), o) {
|
6632
6644
|
const B = this.resolve(c, {
|
@@ -6636,18 +6648,18 @@ class b1 extends E1 {
|
|
6636
6648
|
B && B.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.");
|
6637
6649
|
}
|
6638
6650
|
let U = [];
|
6639
|
-
const
|
6640
|
-
if (this.options.saveMissingTo === "fallback" &&
|
6641
|
-
for (let B = 0; B <
|
6642
|
-
U.push(
|
6651
|
+
const q = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
6652
|
+
if (this.options.saveMissingTo === "fallback" && q && q[0])
|
6653
|
+
for (let B = 0; B < q.length; B++)
|
6654
|
+
U.push(q[B]);
|
6643
6655
|
else this.options.saveMissingTo === "all" ? U = this.languageUtils.toResolveHierarchy(t.lng || this.language) : U.push(t.lng || this.language);
|
6644
6656
|
const X = (B, $, P) => {
|
6645
|
-
const e1 = m && P !== u ? P :
|
6657
|
+
const e1 = m && P !== u ? P : O;
|
6646
6658
|
this.options.missingKeyHandler ? this.options.missingKeyHandler(B, d, $, e1, K, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(B, d, $, e1, K, t), this.emit("missingKey", B, d, $, u);
|
6647
6659
|
};
|
6648
6660
|
this.options.saveMissing && (this.options.saveMissingPlurals && N ? U.forEach((B) => {
|
6649
6661
|
const $ = this.pluralResolver.getSuffixes(B, t);
|
6650
|
-
|
6662
|
+
Z && t[`defaultValue${this.options.pluralSeparator}zero`] && $.indexOf(`${this.options.pluralSeparator}zero`) < 0 && $.push(`${this.options.pluralSeparator}zero`), $.forEach((P) => {
|
6651
6663
|
X([B], c + P, t[`defaultValue${P}`] || G);
|
6652
6664
|
});
|
6653
6665
|
}) : X(U, c, G));
|
@@ -6774,7 +6786,7 @@ class b1 extends E1 {
|
|
6774
6786
|
const _1 = (i) => i.charAt(0).toUpperCase() + i.slice(1);
|
6775
6787
|
class J1 {
|
6776
6788
|
constructor(e) {
|
6777
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
6789
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = J.create("languageUtils");
|
6778
6790
|
}
|
6779
6791
|
getScriptPartFromCode(e) {
|
6780
6792
|
if (e = M1(e), !e || e.indexOf("-") < 0) return null;
|
@@ -6974,7 +6986,7 @@ const e0 = ["v1", "v2", "v3"], t0 = ["v4"], q1 = {
|
|
6974
6986
|
class s0 {
|
6975
6987
|
constructor(e) {
|
6976
6988
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
6977
|
-
this.languageUtils = e, this.options = t, this.logger =
|
6989
|
+
this.languageUtils = e, this.options = t, this.logger = J.create("pluralResolver"), (!this.options.compatibilityJSON || t0.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 = i0(), this.pluralRulesCache = {};
|
6978
6990
|
}
|
6979
6991
|
addRule(e, t) {
|
6980
6992
|
this.rules[e] = t;
|
@@ -7037,12 +7049,12 @@ class s0 {
|
|
7037
7049
|
}
|
7038
7050
|
const Q1 = function(i, e, t) {
|
7039
7051
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, o = Pi(i, e, t);
|
7040
|
-
return !o && n && R(t) && (o =
|
7052
|
+
return !o && n && R(t) && (o = S1(i, t, s), o === void 0 && (o = S1(e, t, s))), o;
|
7041
7053
|
}, I1 = (i) => i.replace(/\$/g, "$$$$");
|
7042
7054
|
class n0 {
|
7043
7055
|
constructor() {
|
7044
7056
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
7045
|
-
this.logger =
|
7057
|
+
this.logger = J.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
7046
7058
|
}
|
7047
7059
|
init() {
|
7048
7060
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
@@ -7197,7 +7209,7 @@ const r0 = (i) => {
|
|
7197
7209
|
class o0 {
|
7198
7210
|
constructor() {
|
7199
7211
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
7200
|
-
this.logger =
|
7212
|
+
this.logger = J.create("formatter"), this.options = e, this.formats = {
|
7201
7213
|
number: c1((t, s) => {
|
7202
7214
|
const n = new Intl.NumberFormat(t, {
|
7203
7215
|
...s
|
@@ -7280,7 +7292,7 @@ const a0 = (i, e) => {
|
|
7280
7292
|
class l0 extends E1 {
|
7281
7293
|
constructor(e, t, s) {
|
7282
7294
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
7283
|
-
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger =
|
7295
|
+
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = J.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, n.backend, n);
|
7284
7296
|
}
|
7285
7297
|
queueLoad(e, t, s, n) {
|
7286
7298
|
const o = {}, c = {}, a = {}, d = {};
|
@@ -7477,7 +7489,7 @@ const X1 = () => ({
|
|
7477
7489
|
class m1 extends E1 {
|
7478
7490
|
constructor() {
|
7479
7491
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
7480
|
-
if (super(), this.options = ee(e), this.services = {}, this.logger =
|
7492
|
+
if (super(), this.options = ee(e), this.services = {}, this.logger = J, this.modules = {
|
7481
7493
|
external: []
|
7482
7494
|
}, h0(this), t && !this.isInitialized && !e.isClone) {
|
7483
7495
|
if (!this.options.initImmediate)
|
@@ -7502,13 +7514,13 @@ class m1 extends E1 {
|
|
7502
7514
|
}), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
7503
7515
|
const o = (l) => l ? typeof l == "function" ? new l() : l : null;
|
7504
7516
|
if (!this.options.isClone) {
|
7505
|
-
this.modules.logger ?
|
7517
|
+
this.modules.logger ? J.init(o(this.modules.logger), this.options) : J.init(null, this.options);
|
7506
7518
|
let l;
|
7507
7519
|
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l = o0);
|
7508
7520
|
const h = new J1(this.options);
|
7509
7521
|
this.store = new U1(this.options.resources, this.options);
|
7510
7522
|
const u = this.services;
|
7511
|
-
u.logger =
|
7523
|
+
u.logger = J, u.resourceStore = this.store, u.languageUtils = h, u.pluralResolver = new s0(h, {
|
7512
7524
|
prepend: this.options.pluralSeparator,
|
7513
7525
|
compatibilityJSON: this.options.compatibilityJSON,
|
7514
7526
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
@@ -7836,7 +7848,7 @@ class R0 {
|
|
7836
7848
|
}
|
7837
7849
|
const M0 = (i, e) => {
|
7838
7850
|
const t = Y();
|
7839
|
-
return
|
7851
|
+
return j(() => {
|
7840
7852
|
t.current = i;
|
7841
7853
|
}, [i, e]), t.current;
|
7842
7854
|
}, pe = (i, e, t, s) => i.getFixedT(e, t, s), y0 = (i, e, t, s) => D(pe(i, e, t, s), [i, e, t, s]), b0 = function(i) {
|
@@ -7867,7 +7879,7 @@ const M0 = (i, e) => {
|
|
7867
7879
|
let L = g.join();
|
7868
7880
|
e.lng && (L = `${e.lng}${L}`);
|
7869
7881
|
const H = M0(L), M = Y(!0);
|
7870
|
-
|
7882
|
+
j(() => {
|
7871
7883
|
const {
|
7872
7884
|
bindI18n: f,
|
7873
7885
|
bindI18nStore: w
|
@@ -7883,7 +7895,7 @@ const M0 = (i, e) => {
|
|
7883
7895
|
return f && o && o.on(f, N), w && o && o.store.on(w, N), () => {
|
7884
7896
|
M.current = !1, f && o && f.split(" ").forEach((m) => o.off(m, N)), w && o && w.split(" ").forEach((m) => o.store.off(m, N));
|
7885
7897
|
};
|
7886
|
-
}, [o, L]),
|
7898
|
+
}, [o, L]), j(() => {
|
7887
7899
|
M.current && l && x(u);
|
7888
7900
|
}, [o, d, l]);
|
7889
7901
|
const _ = [v, o, l];
|
@@ -7896,9 +7908,9 @@ const M0 = (i, e) => {
|
|
7896
7908
|
}, _0 = "Город", I0 = {
|
7897
7909
|
placeholder: _0
|
7898
7910
|
};
|
7899
|
-
function
|
7911
|
+
function O0(i) {
|
7900
7912
|
const e = Y(i);
|
7901
|
-
return
|
7913
|
+
return j(() => {
|
7902
7914
|
e.current = i;
|
7903
7915
|
}, [i]), e.current;
|
7904
7916
|
}
|
@@ -7914,11 +7926,11 @@ W.use(N0).init({
|
|
7914
7926
|
}
|
7915
7927
|
}
|
7916
7928
|
});
|
7917
|
-
const
|
7929
|
+
const Z0 = k1(
|
7918
7930
|
({ width: i, selectedCountry: e, onChange: t, value: s, id: n, disabled: o, clearable: c }, a) => {
|
7919
7931
|
const [d, g] = A(
|
7920
7932
|
[]
|
7921
|
-
), [l, h] = A(!1), { locale: u, axiosPeople: p } = r1(ke), v = Y(!1), x = Y(null), L = Y(d), H =
|
7933
|
+
), [l, h] = A(!1), { locale: u, axiosPeople: p } = r1(ke), v = Y(!1), x = Y(null), L = Y(d), H = O0(e);
|
7922
7934
|
if (!p)
|
7923
7935
|
throw new Error(
|
7924
7936
|
`CitySelect requires "axiosPeople" to fetch cities.
|
@@ -7949,13 +7961,13 @@ const j0 = k1(
|
|
7949
7961
|
},
|
7950
7962
|
[p, e, t]
|
7951
7963
|
);
|
7952
|
-
|
7964
|
+
j(() => {
|
7953
7965
|
(async () => {
|
7954
7966
|
if (!s) return;
|
7955
7967
|
const N = await _(s);
|
7956
7968
|
g(N);
|
7957
7969
|
})();
|
7958
|
-
}, []),
|
7970
|
+
}, []), j(() => {
|
7959
7971
|
var w;
|
7960
7972
|
H !== e ? v.current && (t(null), g([]), L.current = [], (w = x.current) == null || w.refetchOptions()) : v.current = !0;
|
7961
7973
|
}, [e, t, H]);
|
@@ -7973,11 +7985,11 @@ const j0 = k1(
|
|
7973
7985
|
includeCount: !0
|
7974
7986
|
};
|
7975
7987
|
I.filters = {}, e && e.length > 0 && (I.filters.countryId = [e]), m && (I.search = m);
|
7976
|
-
const T = await p.post("v1/cities/search", I),
|
7988
|
+
const T = await p.post("v1/cities/search", I), Z = (T == null ? void 0 : T.data.data) || [], G = T == null ? void 0 : T.data.metadata.count;
|
7977
7989
|
return {
|
7978
|
-
options:
|
7979
|
-
value:
|
7980
|
-
label:
|
7990
|
+
options: Z.map((O) => ({
|
7991
|
+
value: O.geoNameId,
|
7992
|
+
label: O.name
|
7981
7993
|
})),
|
7982
7994
|
count: G,
|
7983
7995
|
limit: w
|
@@ -8015,5 +8027,5 @@ const j0 = k1(
|
|
8015
8027
|
}
|
8016
8028
|
);
|
8017
8029
|
export {
|
8018
|
-
|
8030
|
+
Z0 as CitySelect
|
8019
8031
|
};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@snmt-react-ui/city-select",
|
3
3
|
"private": false,
|
4
|
-
"version": "2.6.
|
4
|
+
"version": "2.6.8",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/city-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.8.
|
21
|
+
"@snmt-react-ui/async-select": "^1.8.9",
|
22
22
|
"@snmt-react-ui/core": "^2.2.0",
|
23
23
|
"i18next": "^23.11.5",
|
24
24
|
"react-i18next": "^14.1.1",
|
@@ -27,5 +27,5 @@
|
|
27
27
|
"peerDependencies": {
|
28
28
|
"antd": "^5.22.0"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "80d3cbe0d67b94370191b14fa1618cdf126ece68"
|
31
31
|
}
|