@snmt-react-ui/country-select 1.1.12 → 1.1.13
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/country-select.js +20 -31
- package/package.json +2 -2
package/dist/country-select.js
CHANGED
@@ -242176,58 +242176,47 @@ fC.use(hbt).init({
|
|
242176
242176
|
});
|
242177
242177
|
const Rbt = i4(
|
242178
242178
|
({ width: r, selectedCity: l, setSelectedCity: i, onChange: c, value: d }, v) => {
|
242179
|
-
const [m, k] = _1([]), [S, x] = _1([]), { locale: E } = oc(T2e), { t:
|
242179
|
+
const [m, k] = _1([]), [S, x] = _1([]), { locale: E, axios: N } = oc(T2e), { t: _ } = bbt("common", { lng: E }), T = MA(async () => {
|
242180
242180
|
try {
|
242181
|
-
const
|
242182
|
-
|
242183
|
-
{
|
242184
|
-
method: "POST",
|
242185
|
-
headers: {
|
242186
|
-
"Content-Type": "application/json"
|
242187
|
-
}
|
242188
|
-
}
|
242189
|
-
);
|
242190
|
-
if (!D.ok)
|
242191
|
-
throw new Error("Something went wrong");
|
242192
|
-
const M = await D.json();
|
242193
|
-
x(M.data);
|
242181
|
+
const M = await (N == null ? void 0 : N.post("/countries/search"));
|
242182
|
+
x(M == null ? void 0 : M.data.data);
|
242194
242183
|
} catch {
|
242195
242184
|
k([]);
|
242196
242185
|
}
|
242197
|
-
}, []);
|
242186
|
+
}, [N]);
|
242198
242187
|
Zu(() => {
|
242199
|
-
|
242188
|
+
T();
|
242200
242189
|
}, []), Zu(() => {
|
242201
242190
|
if (l) {
|
242202
|
-
const
|
242203
|
-
(
|
242191
|
+
const M = l.split("-")[1], L = S.filter(
|
242192
|
+
(W) => W.name.includes(M)
|
242204
242193
|
);
|
242205
|
-
if (
|
242206
|
-
const
|
242207
|
-
label:
|
242208
|
-
value:
|
242194
|
+
if (L.length) {
|
242195
|
+
const W = L.map((q) => ({
|
242196
|
+
label: q.name,
|
242197
|
+
value: q.name
|
242209
242198
|
}));
|
242210
|
-
c(
|
242199
|
+
c(W[0].value);
|
242211
242200
|
}
|
242212
242201
|
}
|
242213
242202
|
}, [l, S, c]), Zu(() => {
|
242214
|
-
const
|
242215
|
-
label:
|
242216
|
-
value:
|
242203
|
+
const M = S.map((L) => ({
|
242204
|
+
label: L.name,
|
242205
|
+
value: L.name
|
242217
242206
|
}));
|
242218
|
-
k(
|
242207
|
+
k(M);
|
242219
242208
|
}, [S]);
|
242220
|
-
const
|
242221
|
-
|
242209
|
+
const D = (M) => {
|
242210
|
+
M === "None" ? (c(""), i && i("")) : (c(M), i && i(""));
|
242222
242211
|
};
|
242223
242212
|
return /* @__PURE__ */ Xe("div", { className: "snmt-country-select", children: /* @__PURE__ */ Xe(
|
242224
242213
|
M0t,
|
242225
242214
|
{
|
242226
242215
|
width: r,
|
242227
|
-
placeholder:
|
242216
|
+
placeholder: _("placeholder"),
|
242228
242217
|
value: d,
|
242229
242218
|
ref: v,
|
242230
|
-
onChange:
|
242219
|
+
onChange: D,
|
242231
242220
|
options: [{ label: "None", value: "None" }, ...m]
|
242232
242221
|
}
|
242233
242222
|
) });
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@snmt-react-ui/country-select",
|
3
3
|
"private": false,
|
4
|
-
"version": "1.1.
|
4
|
+
"version": "1.1.13",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/country-select.js",
|
7
7
|
"types": "dist/index.d.ts",
|
@@ -24,5 +24,5 @@
|
|
24
24
|
"i18next": "^23.11.5",
|
25
25
|
"react-i18next": "^14.1.1"
|
26
26
|
},
|
27
|
-
"gitHead": "
|
27
|
+
"gitHead": "3a057df3dd5329fe9688f86802578ffd268cd0bc"
|
28
28
|
}
|