@dv.net/ui-kit 7.2.16 → 7.2.17
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementBlock as s, openBlock as
|
|
1
|
+
import { createElementBlock as s, openBlock as l, createElementVNode as n, defineComponent as j, mergeModels as S, useModel as F, ref as b, computed as N, onMounted as A, createCommentVNode as y, createBlock as c, normalizeClass as z, renderSlot as q, Fragment as d, createVNode as m, createTextVNode as B, toDisplayString as g, capitalize as G, unref as r, withCtx as C, renderList as k, nextTick as J } from "vue";
|
|
2
2
|
import { _ as U } from "./UiFlagIcon.vue_vue_type_script_setup_true_lang-BEuyocgZ.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { _ as w } from "./UiLanguageButton.vue_vue_type_script_setup_true_lang-DiW2yYu5.js";
|
|
@@ -40,7 +40,7 @@ const X = {
|
|
|
40
40
|
viewBox: "0 0 20 20"
|
|
41
41
|
};
|
|
42
42
|
function Y(v, f) {
|
|
43
|
-
return
|
|
43
|
+
return l(), s("svg", X, [...f[0] || (f[0] = [
|
|
44
44
|
n("path", {
|
|
45
45
|
stroke: "#717173",
|
|
46
46
|
"stroke-linecap": "round",
|
|
@@ -75,86 +75,88 @@ const E = { render: Y }, Z = { class: "ui-languages" }, x = ["disabled"], ee = {
|
|
|
75
75
|
}),
|
|
76
76
|
emits: /* @__PURE__ */ S(["change"], ["update:modelValue", "update:is-show"]),
|
|
77
77
|
setup(v, { emit: f }) {
|
|
78
|
-
const I = f,
|
|
78
|
+
const I = f, $ = v, t = F(v, "modelValue"), u = F(v, "is-show"), { isMobile: R } = Q(), i = b(""), V = b(), H = b([]), h = N(() => [
|
|
79
79
|
{ id: 2, name: "English", isoCode: "en", nativeName: "English" },
|
|
80
|
-
|
|
80
|
+
...H.value,
|
|
81
81
|
t.value
|
|
82
|
-
].filter((e,
|
|
82
|
+
].filter((e, o, a) => o === a.findIndex((T) => T.isoCode === e.isoCode))), M = N(() => $.locales.toSorted((e, o) => e.name.localeCompare(o.name))), p = N(() => i.value ? M.value.filter(
|
|
83
83
|
(e) => e.name.toLocaleLowerCase().includes(i.value.toLocaleLowerCase()) || e.nativeName?.toLocaleLowerCase().includes(i.value.toLocaleLowerCase())
|
|
84
84
|
) : M.value);
|
|
85
85
|
function _(e) {
|
|
86
|
-
t.value = e,
|
|
86
|
+
t.value = e, u.value = !1, i.value = "", I("change", e);
|
|
87
87
|
}
|
|
88
88
|
function P() {
|
|
89
|
-
|
|
89
|
+
u.value = !0, J(() => {
|
|
90
90
|
V.value?.focus();
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
return A(() => {
|
|
94
|
-
const e = navigator.languages.slice(0, 2).map((
|
|
95
|
-
|
|
96
|
-
}), (e,
|
|
97
|
-
e.isHidden ? y("", !0) : (
|
|
94
|
+
const e = navigator.languages.slice(0, 2).map((o) => o.split("-")[0]);
|
|
95
|
+
H.value = $.locales.filter(({ isoCode: o }) => e.includes(o));
|
|
96
|
+
}), (e, o) => (l(), s("div", Z, [
|
|
97
|
+
e.isHidden ? y("", !0) : (l(), s("button", {
|
|
98
98
|
key: 0,
|
|
99
99
|
disabled: e.disabled,
|
|
100
100
|
class: z([{ "for-header": e.forHeader }, "ui-languages--trigger"]),
|
|
101
101
|
onClick: P
|
|
102
102
|
}, [
|
|
103
103
|
q(e.$slots, "trigger", { locale: t.value }, () => [
|
|
104
|
-
e.forHeader ? (
|
|
105
|
-
|
|
104
|
+
e.forHeader ? (l(), s(d, { key: 0 }, [
|
|
105
|
+
m(U, {
|
|
106
106
|
isoCode: t.value?.isoCode ?? "",
|
|
107
107
|
"is-small": ""
|
|
108
108
|
}, null, 8, ["isoCode"]),
|
|
109
109
|
B(" " + g(G(t.value?.isoCode ?? "")), 1)
|
|
110
|
-
], 64)) : (
|
|
111
|
-
|
|
110
|
+
], 64)) : (l(), s(d, { key: 1 }, [
|
|
111
|
+
m(U, {
|
|
112
112
|
isoCode: t.value?.isoCode ?? ""
|
|
113
113
|
}, null, 8, ["isoCode"]),
|
|
114
114
|
B(" " + g(t.value?.name) + " ", 1),
|
|
115
|
-
t.value?.nativeName ? (
|
|
115
|
+
t.value?.nativeName ? (l(), s(d, { key: 0 }, [
|
|
116
116
|
B("(" + g(t.value?.nativeName) + ")", 1)
|
|
117
117
|
], 64)) : y("", !0)
|
|
118
118
|
], 64))
|
|
119
119
|
])
|
|
120
120
|
], 10, x)),
|
|
121
|
-
r(R) ? (
|
|
121
|
+
r(R) ? (l(), c(r(O), {
|
|
122
122
|
key: 2,
|
|
123
123
|
class: "ui-languages--drawer",
|
|
124
124
|
direction: "btt",
|
|
125
|
-
modelValue:
|
|
126
|
-
"onUpdate:modelValue":
|
|
125
|
+
modelValue: u.value,
|
|
126
|
+
"onUpdate:modelValue": o[5] || (o[5] = (a) => u.value = a)
|
|
127
127
|
}, {
|
|
128
128
|
default: C(() => [
|
|
129
129
|
n("div", te, [
|
|
130
130
|
n("div", re, [
|
|
131
131
|
n("p", null, g(r(L).uiLanguages.translations.changeLanguage), 1),
|
|
132
|
-
|
|
132
|
+
m(r(K), {
|
|
133
|
+
style: { cursor: "pointer" },
|
|
133
134
|
name: "close",
|
|
134
135
|
type: "400",
|
|
135
|
-
size: "lg"
|
|
136
|
+
size: "lg",
|
|
137
|
+
onClick: o[3] || (o[3] = (a) => u.value = !1)
|
|
136
138
|
})
|
|
137
139
|
]),
|
|
138
140
|
n("div", ie, [
|
|
139
|
-
|
|
141
|
+
m(r(D), {
|
|
140
142
|
ref_key: "inputRef",
|
|
141
143
|
ref: V,
|
|
142
144
|
autofocus: "",
|
|
143
145
|
size: "sm",
|
|
144
146
|
modelValue: i.value,
|
|
145
|
-
"onUpdate:modelValue":
|
|
147
|
+
"onUpdate:modelValue": o[4] || (o[4] = (a) => i.value = a),
|
|
146
148
|
clearable: "",
|
|
147
149
|
placeholder: r(L).uiLanguages.translations.searchInputPlaceholder
|
|
148
150
|
}, {
|
|
149
151
|
prepend: C(() => [
|
|
150
|
-
|
|
152
|
+
m(r(E))
|
|
151
153
|
]),
|
|
152
154
|
_: 1
|
|
153
155
|
}, 8, ["modelValue", "placeholder"])
|
|
154
156
|
]),
|
|
155
157
|
n("div", ne, [
|
|
156
|
-
h.value?.length &&
|
|
157
|
-
(
|
|
158
|
+
h.value?.length && p.value.length >= e.minNumbersLocalesDisplayFavorites ? (l(), s("div", ue, [
|
|
159
|
+
(l(!0), s(d, null, k(h.value, (a) => (l(), c(w, {
|
|
158
160
|
key: a.id,
|
|
159
161
|
locale: a,
|
|
160
162
|
onChange: _,
|
|
@@ -162,7 +164,7 @@ const E = { render: Y }, Z = { class: "ui-languages" }, x = ["disabled"], ee = {
|
|
|
162
164
|
"for-header": e.forHeader
|
|
163
165
|
}, null, 8, ["locale", "selected", "for-header"]))), 128))
|
|
164
166
|
])) : y("", !0),
|
|
165
|
-
(
|
|
167
|
+
(l(!0), s(d, null, k(p.value, (a) => (l(), c(w, {
|
|
166
168
|
key: a.id,
|
|
167
169
|
locale: a,
|
|
168
170
|
onChange: _,
|
|
@@ -173,37 +175,37 @@ const E = { render: Y }, Z = { class: "ui-languages" }, x = ["disabled"], ee = {
|
|
|
173
175
|
])
|
|
174
176
|
]),
|
|
175
177
|
_: 1
|
|
176
|
-
}, 8, ["modelValue"])) : (
|
|
178
|
+
}, 8, ["modelValue"])) : (l(), c(r(W), {
|
|
177
179
|
key: 1,
|
|
178
|
-
onClose:
|
|
179
|
-
modelValue:
|
|
180
|
-
"onUpdate:modelValue":
|
|
180
|
+
onClose: o[1] || (o[1] = (a) => i.value = ""),
|
|
181
|
+
modelValue: u.value,
|
|
182
|
+
"onUpdate:modelValue": o[2] || (o[2] = (a) => u.value = a),
|
|
181
183
|
isShowBtnClose: !1,
|
|
182
184
|
popperClass: "transparent-bg"
|
|
183
185
|
}, {
|
|
184
186
|
default: C(() => [
|
|
185
187
|
n("div", ee, [
|
|
186
188
|
n("div", ae, [
|
|
187
|
-
|
|
189
|
+
m(r(D), {
|
|
188
190
|
ref_key: "inputRef",
|
|
189
191
|
ref: V,
|
|
190
192
|
autofocus: "",
|
|
191
193
|
size: "sm",
|
|
192
194
|
modelValue: i.value,
|
|
193
|
-
"onUpdate:modelValue":
|
|
195
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => i.value = a),
|
|
194
196
|
placeholder: r(L).uiLanguages.translations.searchInputPlaceholder
|
|
195
197
|
}, {
|
|
196
198
|
prepend: C(() => [
|
|
197
|
-
|
|
199
|
+
m(r(E))
|
|
198
200
|
]),
|
|
199
201
|
_: 1
|
|
200
202
|
}, 8, ["modelValue", "placeholder"])
|
|
201
203
|
]),
|
|
202
204
|
n("div", {
|
|
203
|
-
class: z(["ui-languages--modal__items", { "is-empty": !
|
|
205
|
+
class: z(["ui-languages--modal__items", { "is-empty": !p.value.length }])
|
|
204
206
|
}, [
|
|
205
|
-
h.value?.length &&
|
|
206
|
-
(
|
|
207
|
+
h.value?.length && p.value.length >= e.minNumbersLocalesDisplayFavorites ? (l(), s("div", oe, [
|
|
208
|
+
(l(!0), s(d, null, k(h.value, (a) => (l(), c(w, {
|
|
207
209
|
key: a.id,
|
|
208
210
|
locale: a,
|
|
209
211
|
onChange: _,
|
|
@@ -211,15 +213,15 @@ const E = { render: Y }, Z = { class: "ui-languages" }, x = ["disabled"], ee = {
|
|
|
211
213
|
"for-header": e.forHeader
|
|
212
214
|
}, null, 8, ["locale", "selected", "for-header"]))), 128))
|
|
213
215
|
])) : y("", !0),
|
|
214
|
-
|
|
215
|
-
(
|
|
216
|
+
p.value.length ? (l(), s("div", le, [
|
|
217
|
+
(l(!0), s(d, null, k(p.value, (a) => (l(), c(w, {
|
|
216
218
|
key: a.id,
|
|
217
219
|
locale: a,
|
|
218
220
|
onChange: _,
|
|
219
221
|
selected: t.value,
|
|
220
222
|
"for-header": e.forHeader
|
|
221
223
|
}, null, 8, ["locale", "selected", "for-header"]))), 128))
|
|
222
|
-
])) : (
|
|
224
|
+
])) : (l(), s("div", se, g(r(L).uiLanguages.translations.modalSearchNotFound), 1))
|
|
223
225
|
], 2)
|
|
224
226
|
])
|
|
225
227
|
]),
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { _ as ro } from "./chunks/UiIcon.vue_vue_type_script_setup_true_lang-CP1
|
|
|
27
27
|
/* empty css */
|
|
28
28
|
import { _ as ao } from "./chunks/UiIconButton.vue_vue_type_script_setup_true_lang-yQR_GeIn.js";
|
|
29
29
|
import { _ as io } from "./chunks/UiInput.vue_vue_type_script_setup_true_lang-DHWi8SLq.js";
|
|
30
|
-
import { _ as mo } from "./chunks/UiLanguages.vue_vue_type_script_setup_true_lang-
|
|
30
|
+
import { _ as mo } from "./chunks/UiLanguages.vue_vue_type_script_setup_true_lang-DU6Q9NU9.js";
|
|
31
31
|
import { _ as so } from "./chunks/UiLayout.vue_vue_type_script_setup_true_lang-CELUDfDH.js";
|
|
32
32
|
/* empty css */
|
|
33
33
|
import { default as Uo } from "./components/UiLayoutAuth/UiLayoutAuth.js";
|