@snmt-react-ui/country-select 1.1.12 → 1.1.14

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.
@@ -240362,7 +240362,7 @@ const T0t = ({
240362
240362
  ] }) }),
240363
240363
  removeIcon: /* @__PURE__ */ Xe(wI, { name: "errorSmall", color: wT.GREY_DARK_2 }),
240364
240364
  options: v,
240365
- optionRender: (me) => /* @__PURE__ */ Kr(PD, { justifyContent: "space-between", alignItems: "center", children: [
240365
+ optionRender: (me) => /* @__PURE__ */ Kr(PD, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
240366
240366
  /* @__PURE__ */ Kr(PD, { alignItems: "center", gap: 12, children: [
240367
240367
  c && /* @__PURE__ */ Xe(
240368
240368
  Tje,
@@ -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: N } = bbt("common", { lng: E }), _ = MA(async () => {
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 D = await fetch(
242182
- "https://api.people.dev.sunmait.com/api/v1/countries/search",
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 D = l.split("-")[1], M = S.filter(
242203
- (L) => L.name.includes(D)
242191
+ const M = l.split("-")[1], L = S.filter(
242192
+ (W) => W.name.includes(M)
242204
242193
  );
242205
- if (M.length) {
242206
- const L = M.map((W) => ({
242207
- label: W.name,
242208
- value: W.name
242194
+ if (L.length) {
242195
+ const W = L.map((q) => ({
242196
+ label: q.name,
242197
+ value: q.name
242209
242198
  }));
242210
- c(L[0].value);
242199
+ c(W[0].value);
242211
242200
  }
242212
242201
  }
242213
242202
  }, [l, S, c]), Zu(() => {
242214
- const D = S.map((M) => ({
242215
- label: M.name,
242216
- value: M.name
242203
+ const M = S.map((L) => ({
242204
+ label: L.name,
242205
+ value: L.name
242217
242206
  }));
242218
- k(D);
242207
+ k(M);
242219
242208
  }, [S]);
242220
- const T = (D) => {
242221
- D === "None" ? (c(""), i && i("")) : (c(D), i && i(""));
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: N("placeholder"),
242216
+ placeholder: _("placeholder"),
242228
242217
  value: d,
242229
242218
  ref: v,
242230
- onChange: T,
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.12",
4
+ "version": "1.1.14",
5
5
  "type": "module",
6
6
  "main": "dist/country-select.js",
7
7
  "types": "dist/index.d.ts",
@@ -18,11 +18,11 @@
18
18
  "build": "tsc && vite build"
19
19
  },
20
20
  "dependencies": {
21
- "@snmt-react-ui/city-select": "^1.2.0",
21
+ "@snmt-react-ui/city-select": "^1.2.1",
22
22
  "@snmt-react-ui/core": "^1.5.0",
23
23
  "@snmt-react-ui/flex": "^1.3.5",
24
24
  "i18next": "^23.11.5",
25
25
  "react-i18next": "^14.1.1"
26
26
  },
27
- "gitHead": "c564f90b1cc6e98de1a2a59051f814e621acb140"
27
+ "gitHead": "656ea480b930b8181a023e26a23bacb7953f5911"
28
28
  }