@soroka282/migrant.ui-kit 0.0.80 → 0.0.82

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.
@@ -0,0 +1,56 @@
1
+ import { defineComponent as g, ref as I, computed as d, createElementBlock as c, openBlock as r, createElementVNode as o, createVNode as S, Fragment as k, renderList as V, toDisplayString as _ } from "vue";
2
+ import { u as w, U as E, f as B, _ as F } from "./index-CluS2ONS.js";
3
+ const U = { class: "country-list" }, b = { class: "country-list__search" }, x = ["onClick"], A = ["innerHTML"], H = { class: "country-list__name" }, M = { class: "country-list__code" }, N = /* @__PURE__ */ g({
4
+ __name: "CountryList",
5
+ props: {
6
+ countries: {},
7
+ locale: { default: "en" },
8
+ selectedColor: { default: "#666EE4" },
9
+ placeholderSearchInput: { default: "" }
10
+ },
11
+ emits: ["select", "close"],
12
+ setup(p, { emit: m }) {
13
+ const a = m, l = p, [h] = w(), n = I(""), f = (e) => B[e] || "", i = (e) => e.name[l.locale] || e.name.en, C = d(() => {
14
+ if (!n.value) return l.countries;
15
+ const e = n.value.toLowerCase().replace("+", "");
16
+ return l.countries.filter((s) => {
17
+ const t = i(s).toLowerCase(), u = s.phoneCode.replace("+", ""), y = s.iso.toLowerCase();
18
+ return t.includes(e) || u.includes(e) || y.includes(e);
19
+ });
20
+ }), v = (e) => {
21
+ a("select", e), a("close");
22
+ }, L = d(() => l.selectedColor === "#3C6BFF" ? "WIR" : "SIR");
23
+ return (e, s) => (r(), c("div", U, [
24
+ o("div", b, [
25
+ S(E, {
26
+ modelValue: n.value,
27
+ "onUpdate:modelValue": s[0] || (s[0] = (t) => n.value = t),
28
+ placeholder: e.placeholderSearchInput,
29
+ "show-search-icon": "",
30
+ "color-scheme": L.value
31
+ }, null, 8, ["modelValue", "placeholder", "color-scheme"])
32
+ ]),
33
+ o("ul", {
34
+ ref_key: "list",
35
+ ref: h,
36
+ class: "country-list__options"
37
+ }, [
38
+ (r(!0), c(k, null, V(C.value, (t) => (r(), c("li", {
39
+ key: t.iso,
40
+ class: "country-list__item",
41
+ onClick: (u) => v(t)
42
+ }, [
43
+ o("span", {
44
+ class: "country-list__flag",
45
+ innerHTML: f(t.iso)
46
+ }, null, 8, A),
47
+ o("span", H, _(i(t)), 1),
48
+ o("span", M, _(t.phoneCode), 1)
49
+ ], 8, x))), 128))
50
+ ], 512)
51
+ ]));
52
+ }
53
+ }), q = /* @__PURE__ */ F(N, [["__scopeId", "data-v-b60d85ed"]]);
54
+ export {
55
+ q as default
56
+ };
@@ -1,12 +1,12 @@
1
- import { defineComponent as b, ref as p, computed as w, createElementBlock as s, openBlock as o, createCommentVNode as a, createElementVNode as d, createVNode as I, renderSlot as V, createBlock as B, resolveDynamicComponent as L, Fragment as g, renderList as _, normalizeStyle as m, normalizeClass as N, createTextVNode as F, toDisplayString as f } from "vue";
2
- import { u as T, U, _ as $ } from "./index-BHwxk8WR.js";
3
- const z = { class: "select-list" }, A = {
1
+ import { defineComponent as I, ref as p, computed as m, createElementBlock as s, openBlock as t, createCommentVNode as a, createElementVNode as d, createVNode as V, renderSlot as b, createBlock as L, resolveDynamicComponent as g, Fragment as _, renderList as N, normalizeStyle as f, normalizeClass as F, createTextVNode as T, toDisplayString as h } from "vue";
2
+ import { u as U, U as $, _ as z } from "./index-CluS2ONS.js";
3
+ const A = { class: "select-list" }, D = {
4
4
  key: 0,
5
5
  class: "search-wrapper"
6
- }, D = {
6
+ }, E = {
7
7
  key: 1,
8
8
  class: "infoblock-wrapper"
9
- }, E = ["onClick"], M = {
9
+ }, M = ["onClick"], R = {
10
10
  key: 0,
11
11
  class: "option-item-icon",
12
12
  width: "20",
@@ -14,10 +14,10 @@ const z = { class: "select-list" }, A = {
14
14
  viewBox: "0 0 24 24",
15
15
  fill: "none",
16
16
  xmlns: "http://www.w3.org/2000/svg"
17
- }, R = {
17
+ }, Z = {
18
18
  key: 2,
19
19
  class: "confirm-button-wrapper"
20
- }, Z = /* @__PURE__ */ b({
20
+ }, q = /* @__PURE__ */ I({
21
21
  __name: "List",
22
22
  props: {
23
23
  showSearchInput: { type: Boolean, default: !0 },
@@ -26,69 +26,69 @@ const z = { class: "select-list" }, A = {
26
26
  multiple: { type: Boolean, default: !1 },
27
27
  selectedValues: { default: () => [] },
28
28
  selectedColor: { default: "#7c3aed" },
29
- infoblockSlot: {},
29
+ infoBlockSlot: { default: void 0 },
30
30
  multipleButtonConfirmText: { default: "Подтвердить" }
31
31
  },
32
32
  emits: ["select", "close"],
33
- setup(C, { emit: h }) {
34
- const c = h, n = C, [v] = T(), u = p(""), r = p([...n.selectedValues]), k = w(() => {
33
+ setup(C, { emit: v }) {
34
+ const c = v, n = C, [k] = U(), u = p(""), r = p([...n.selectedValues]), y = m(() => {
35
35
  if (!u.value) return n.options;
36
36
  const e = u.value.toLowerCase();
37
37
  return n.options.filter((l) => l.label.toLowerCase().includes(e));
38
- }), i = (e) => r.value.some((l) => l.value === e.value), y = (e) => {
38
+ }), i = (e) => r.value.some((l) => l.value === e.value), S = (e) => {
39
39
  if (n.multiple) {
40
- const l = r.value.findIndex((t) => t.value === e.value);
40
+ const l = r.value.findIndex((o) => o.value === e.value);
41
41
  l === -1 ? r.value.push(e) : r.value.splice(l, 1);
42
42
  } else
43
43
  c("select", e), c("close");
44
- }, S = () => {
44
+ }, w = () => {
45
45
  c("select", [...r.value]), c("close");
46
- };
47
- return (e, l) => (o(), s("div", z, [
48
- e.showSearchInput ? (o(), s("div", A, [
49
- I(U, {
46
+ }, B = m(() => n.selectedColor === "#3C6BFF" ? "WIR" : "SIR");
47
+ return (e, l) => (t(), s("div", A, [
48
+ e.showSearchInput ? (t(), s("div", D, [
49
+ V($, {
50
50
  modelValue: u.value,
51
- "onUpdate:modelValue": l[0] || (l[0] = (t) => u.value = t),
51
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => u.value = o),
52
52
  placeholder: e.placeholderSearchInput,
53
- showSearchIcon: !0,
54
- "color-scheme": e.selectedColor === "#3C6BFF" ? "WIR" : "SIR"
53
+ "show-search-icon": "",
54
+ "color-scheme": B.value
55
55
  }, null, 8, ["modelValue", "placeholder", "color-scheme"])
56
56
  ])) : a("", !0),
57
- e.$slots.infoblock || e.infoblockSlot ? (o(), s("div", D, [
58
- V(e.$slots, "infoblock", {}, () => [
59
- e.infoblockSlot ? (o(), B(L(e.infoblockSlot), { key: 0 })) : a("", !0)
57
+ e.$slots.infoblock || e.infoBlockSlot ? (t(), s("div", E, [
58
+ b(e.$slots, "infoblock", {}, () => [
59
+ e.infoBlockSlot ? (t(), L(g(e.infoBlockSlot), { key: 0 })) : a("", !0)
60
60
  ], !0)
61
61
  ])) : a("", !0),
62
62
  d("ul", {
63
63
  ref_key: "list",
64
- ref: v,
64
+ ref: k,
65
65
  class: "options-list"
66
66
  }, [
67
- (o(!0), s(g, null, _(k.value, (t) => (o(), s("li", {
68
- key: t.value,
69
- class: N(["option-item", { "--selected": e.multiple && i(t) }]),
70
- style: m(e.multiple && i(t) ? { color: n.selectedColor } : {}),
71
- onClick: (q) => y(t)
67
+ (t(!0), s(_, null, N(y.value, (o) => (t(), s("li", {
68
+ key: o.value,
69
+ class: F(["option-item", { "--selected": e.multiple && i(o) }]),
70
+ style: f(e.multiple && i(o) ? { color: n.selectedColor } : {}),
71
+ onClick: (O) => S(o)
72
72
  }, [
73
- F(f(t.label) + " ", 1),
74
- e.multiple && i(t) ? (o(), s("svg", M, l[1] || (l[1] = [
73
+ T(h(o.label) + " ", 1),
74
+ e.multiple && i(o) ? (t(), s("svg", R, l[1] || (l[1] = [
75
75
  d("path", {
76
76
  d: "M10 20C4.47656 20 0 15.5234 0 10C0 4.47656 4.47656 0 10 0C15.5234 0 20 4.47656 20 10C20 15.5234 15.5234 20 10 20ZM14.6094 5.69141C14.1914 5.38672 13.6055 5.48047 13.3008 5.89844L8.63672 12.3125L6.60156 10.2773C6.23438 9.91016 5.64063 9.91016 5.27734 10.2773C4.91406 10.6445 4.91016 11.2383 5.27734 11.6016L8.08984 14.4141C8.28516 14.6094 8.55078 14.707 8.82422 14.6875C9.09766 14.668 9.34766 14.5273 9.50781 14.3047L14.8164 7C15.1211 6.58203 15.0273 5.99609 14.6094 5.69141Z",
77
77
  fill: "currentColor"
78
78
  }, null, -1)
79
79
  ]))) : a("", !0)
80
- ], 14, E))), 128))
80
+ ], 14, M))), 128))
81
81
  ], 512),
82
- e.multiple ? (o(), s("div", R, [
82
+ e.multiple ? (t(), s("div", Z, [
83
83
  d("button", {
84
84
  class: "confirm-button",
85
- style: m({ background: e.selectedColor }),
86
- onClick: S
87
- }, f(e.multipleButtonConfirmText), 5)
85
+ style: f({ background: e.selectedColor }),
86
+ onClick: w
87
+ }, h(e.multipleButtonConfirmText), 5)
88
88
  ])) : a("", !0)
89
89
  ]));
90
90
  }
91
- }), W = /* @__PURE__ */ $(Z, [["__scopeId", "data-v-9bbd18ce"]]);
91
+ }), j = /* @__PURE__ */ z(q, [["__scopeId", "data-v-e4c27405"]]);
92
92
  export {
93
- W as default
93
+ j as default
94
94
  };