@topvisor/ui 1.0.26-0 → 1.0.26-10
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/.chunks/dialog_selectorRegions-DZR64Wm8.es.js +181 -0
- package/.chunks/dialog_selectorRegions-DZR64Wm8.es.js.map +1 -0
- package/.chunks/dialog_selectorRegions-D_HXNjOX.amd.js +2 -0
- package/.chunks/dialog_selectorRegions-D_HXNjOX.amd.js.map +1 -0
- package/assets/extra.css +1 -0
- package/components/extra/extra.d.ts +3 -0
- package/components/extra/rive/rive.vue.d.ts +11 -0
- package/components/extra/rive/types.d.ts +7 -0
- package/components/formsExt/selector2/selector2.d.ts +4 -0
- package/components/formsExt/selector2/selector2.vue.d.ts +1 -0
- package/components/project/selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts +3 -1
- package/components/project/selectorRegion/utils/utils.d.ts +3 -1
- package/core/app.amd.js +1 -1
- package/core/app.amd.js.map +1 -1
- package/core/app.js +24 -24
- package/core/app.js.map +1 -1
- package/core/utils/searchers.d.ts +1 -1
- package/extra/extra.amd.js +2 -0
- package/extra/extra.amd.js.map +1 -0
- package/extra/extra.d.ts +2 -0
- package/extra/extra.js +72 -0
- package/extra/extra.js.map +1 -0
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +129 -123
- package/formsExt/formsExt.js.map +1 -1
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +199 -196
- package/project/project.js.map +1 -1
- package/utils/searchers.amd.js.map +1 -1
- package/utils/searchers.js.map +1 -1
- package/.chunks/dialog_selectorRegions-BOPta9cH.amd.js +0 -2
- package/.chunks/dialog_selectorRegions-BOPta9cH.amd.js.map +0 -1
- package/.chunks/dialog_selectorRegions-Dy0AlECS.es.js +0 -140
- package/.chunks/dialog_selectorRegions-Dy0AlECS.es.js.map +0 -1
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { Core as N } from "../core/app.js";
|
|
2
|
-
import { defineComponent as $, ref as x, reactive as A, watch as R, resolveComponent as I, createBlock as L, openBlock as c, unref as f, withCtx as i, createVNode as r, createTextVNode as V, toDisplayString as m, createElementBlock as p, Fragment as w, renderList as D, createElementVNode as k, createCommentVNode as h } from "vue";
|
|
3
|
-
import { _ as E, a as U } from "./page.vue_vue_type_script_setup_true_lang-CCE8pKg7.es.js";
|
|
4
|
-
import { b as G } from "./utils-DIly8mml.es.js";
|
|
5
|
-
import { genFlagLinkByCountryCode as O } from "../utils/string.js";
|
|
6
|
-
import { getSearcherGIcon as P, getLangLabel as j, getDeviceGIcon as q } from "../utils/searchers.js";
|
|
7
|
-
const T = ["../assets/dialog_selectorRegions.css"].map((_) => import.meta.resolve(_));
|
|
8
|
-
N.insertCSSLinkToPage(T, !0);
|
|
9
|
-
const z = { class: "dialog_selectorRegions_header" }, H = ["data-top-icon"], J = ["src", "alt"], K = { class: "dialog_selectorRegions_regionAreaName top-ellipsis" }, M = { key: 1 }, Q = ["data-top-icon"], oe = /* @__PURE__ */ $({
|
|
10
|
-
id: "selectorRegions",
|
|
11
|
-
__name: "dialog_selectorRegions",
|
|
12
|
-
props: {
|
|
13
|
-
regions: {},
|
|
14
|
-
regionsIndexes: {},
|
|
15
|
-
"@update:regionsIndexes": { type: Function }
|
|
16
|
-
},
|
|
17
|
-
setup(_) {
|
|
18
|
-
const l = _, y = G(), d = x(!1), a = x([]), u = A({
|
|
19
|
-
searcher_key: -1,
|
|
20
|
-
key: -1,
|
|
21
|
-
name: -1
|
|
22
|
-
}), v = (t) => {
|
|
23
|
-
u[t] = -u[t], a.value.sort((e, s) => !e[t] || !s[t] ? -1 : e[t] >= s[t] ? u[t] : -u[t]);
|
|
24
|
-
}, S = () => {
|
|
25
|
-
var e;
|
|
26
|
-
if (!a.value.some((s) => s.selected)) return;
|
|
27
|
-
const t = a.value.filter((s) => s.selected).map((s) => s.index);
|
|
28
|
-
(e = l["@update:regionsIndexes"]) == null || e.call(l, t), y.close();
|
|
29
|
-
};
|
|
30
|
-
return R(d, () => {
|
|
31
|
-
a.value = a.value.map((t) => ({ ...t, selected: d.value }));
|
|
32
|
-
}), R([
|
|
33
|
-
() => l.regions,
|
|
34
|
-
() => l.regionsIndexes
|
|
35
|
-
], () => {
|
|
36
|
-
a.value = [];
|
|
37
|
-
let t = !0;
|
|
38
|
-
l.regions.forEach((e) => {
|
|
39
|
-
let s = e.name;
|
|
40
|
-
e.areaName && (s += ` (${e.areaName})`);
|
|
41
|
-
const n = l.regionsIndexes.indexOf(+e.index) !== -1, o = P(e.searcher_key), g = e.lang !== void 0 ? j(e.searcher_key, e.lang) : void 0, b = e.device !== void 0 ? q(e.device) : void 0, B = e.countryCode !== void 0 ? O(e.countryCode) : void 0, C = {
|
|
42
|
-
...e,
|
|
43
|
-
selected: n,
|
|
44
|
-
title: s,
|
|
45
|
-
searcherIcon: o,
|
|
46
|
-
langLabel: g,
|
|
47
|
-
deviceIcon: b,
|
|
48
|
-
flagLink: B
|
|
49
|
-
};
|
|
50
|
-
a.value.push(C), C.selected || (t = !1);
|
|
51
|
-
}), d.value = t;
|
|
52
|
-
}), (t, e) => {
|
|
53
|
-
const s = I("TopCheckbox"), n = I("TopButton");
|
|
54
|
-
return c(), L(f(E), {
|
|
55
|
-
id: f(y).id,
|
|
56
|
-
pageActive: "selectorRegions",
|
|
57
|
-
class: "dialog_selectorRegions",
|
|
58
|
-
height: "600px",
|
|
59
|
-
width: "600px"
|
|
60
|
-
}, {
|
|
61
|
-
default: i(() => [
|
|
62
|
-
r(f(U), {
|
|
63
|
-
name: "selectorRegions",
|
|
64
|
-
order: 0
|
|
65
|
-
}, {
|
|
66
|
-
header: i(() => [
|
|
67
|
-
k("div", z, [
|
|
68
|
-
r(s, {
|
|
69
|
-
modelValue: d.value,
|
|
70
|
-
"onUpdate:modelValue": e[0] || (e[0] = (o) => d.value = o)
|
|
71
|
-
}, null, 8, ["modelValue"]),
|
|
72
|
-
r(n, {
|
|
73
|
-
class: "dialog_selectorRegions_sortButton",
|
|
74
|
-
color: "theme",
|
|
75
|
-
"data-top-icon": "",
|
|
76
|
-
onClick: e[1] || (e[1] = (o) => v("searcher_key"))
|
|
77
|
-
}),
|
|
78
|
-
r(n, {
|
|
79
|
-
class: "dialog_selectorRegions_sortButton",
|
|
80
|
-
color: "theme",
|
|
81
|
-
"data-top-icon": "",
|
|
82
|
-
onClick: e[2] || (e[2] = (o) => v("key"))
|
|
83
|
-
}),
|
|
84
|
-
r(n, {
|
|
85
|
-
class: "dialog_selectorRegions_sortButton",
|
|
86
|
-
color: "theme",
|
|
87
|
-
"data-top-icon": "",
|
|
88
|
-
onClick: e[3] || (e[3] = (o) => v("name"))
|
|
89
|
-
})
|
|
90
|
-
])
|
|
91
|
-
]),
|
|
92
|
-
body: i(() => [
|
|
93
|
-
(c(!0), p(w, null, D(a.value, (o) => (c(), L(s, {
|
|
94
|
-
key: o.index,
|
|
95
|
-
modelValue: o.selected,
|
|
96
|
-
"onUpdate:modelValue": (g) => o.selected = g,
|
|
97
|
-
class: "dialog_selectorRegions_region"
|
|
98
|
-
}, {
|
|
99
|
-
default: i(() => [
|
|
100
|
-
k("div", {
|
|
101
|
-
class: "dialog_selectorRegions_regionSearcherIcon",
|
|
102
|
-
"data-top-icon": o.searcherIcon
|
|
103
|
-
}, null, 8, H),
|
|
104
|
-
o.flagLink ? (c(), p("img", {
|
|
105
|
-
key: 0,
|
|
106
|
-
class: "top-flag",
|
|
107
|
-
src: "//topvisor.dev" + o.flagLink,
|
|
108
|
-
alt: o.countryCode
|
|
109
|
-
}, null, 8, J)) : h("", !0),
|
|
110
|
-
V(" " + m(o.name) + " ", 1),
|
|
111
|
-
k("div", K, m(o.areaName), 1),
|
|
112
|
-
o.langLabel ? (c(), p("div", M, " [" + m(o.langLabel) + "] ", 1)) : h("", !0),
|
|
113
|
-
o.deviceIcon ? (c(), p("div", {
|
|
114
|
-
key: 2,
|
|
115
|
-
"data-top-icon": o.deviceIcon
|
|
116
|
-
}, null, 8, Q)) : h("", !0)
|
|
117
|
-
]),
|
|
118
|
-
_: 2
|
|
119
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
120
|
-
]),
|
|
121
|
-
footer: i(() => [
|
|
122
|
-
r(n, { onClick: S }, {
|
|
123
|
-
default: i(() => [
|
|
124
|
-
V(m(t.$i18n.Common.Apply), 1)
|
|
125
|
-
]),
|
|
126
|
-
_: 1
|
|
127
|
-
})
|
|
128
|
-
]),
|
|
129
|
-
_: 1
|
|
130
|
-
})
|
|
131
|
-
]),
|
|
132
|
-
_: 1
|
|
133
|
-
}, 8, ["id"]);
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
export {
|
|
138
|
-
oe as default
|
|
139
|
-
};
|
|
140
|
-
//# sourceMappingURL=dialog_selectorRegions-Dy0AlECS.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog_selectorRegions-Dy0AlECS.es.js","sources":["../../src/components/project/selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { reactive, ref, watch } from 'vue';\nimport { TopDialog, TopDialogPage, useTopDialogSelf } from '@/components/dialog/dialog';\nimport { genFlagLinkByCountryCode } from '@/core/utils/string';\nimport type { Props, RegionRich } from './types';\nimport { getDeviceGIcon, getLangLabel, getSearcherGIcon } from '@/core/utils/searchers';\n\ndefineOptions({ id: 'selectorRegions' });\n\nconst props = defineProps<Partial<Props>>();\n\nconst dialog = useTopDialogSelf();\n\n/**\n * Выбраны все регионы\n */\nconst isAllSelected = ref(false);\n\n/**\n * Список расширенных регионов для использования в компоненте\n */\nconst regionsRich = ref<RegionRich[]>([]);\n\n/**\n * Направление сортировки по полю\n */\nconst sortedVectorByField = reactive({\n\tsearcher_key: -1,\n\tkey: -1,\n\tname: -1,\n});\n\n/**\n * Сортировать регионы по выбранному полю\n * @param sortedField - Поле для сортировки\n */\nconst sort = (sortedField: keyof typeof sortedVectorByField) => {\n\tsortedVectorByField[sortedField] = -sortedVectorByField[sortedField];\n\n\tregionsRich.value.sort((regionA, regionB) => {\n\t\tif (!regionA[sortedField] || !regionB[sortedField]) return -1;\n\n\t\treturn regionA[sortedField] >= regionB[sortedField] ? sortedVectorByField[sortedField] : -sortedVectorByField[sortedField];\n\t});\n};\n\n/**\n * Применить изменения\n *\n * Вызывает callback `props['@update:regionsIndexes']`\n */\nconst onSubmit = () => {\n\tif (!regionsRich.value.some((region) => region.selected)) return;\n\n\tconst regionsIndexes = regionsRich.value.filter((region) => region.selected).map((region) => region.index);\n\n\tprops['@update:regionsIndexes']?.(regionsIndexes);\n\n\tdialog.close();\n};\n\n// Выбрать / отменить все регионы\nwatch(isAllSelected, () => {\n\tregionsRich.value = regionsRich.value.map((region) => ({ ...region, selected: isAllSelected.value }));\n});\n\n// генерация регионов\nwatch([\n\t() => props.regions,\n\t() => props.regionsIndexes,\n], () => {\n\tregionsRich.value = [];\n\n\tlet isAllSelectedLocal = true;\n\n\tprops.regions.forEach((region) => {\n\t\tlet title = region.name;\n\t\tif (region.areaName) title += ` (${region.areaName})`;\n\n\t\tconst selected = (props.regionsIndexes.indexOf(+region.index) !== -1);\n\t\tconst searcherIcon = getSearcherGIcon(region.searcher_key);\n\t\tconst langLabel = region.lang !== undefined ? getLangLabel(region.searcher_key, region.lang) : undefined;\n\t\tconst deviceIcon = region.device !== undefined ? getDeviceGIcon(region.device) : undefined;\n\t\tconst flagLink = region.countryCode !== undefined ? genFlagLinkByCountryCode(region.countryCode) : undefined;\n\n\t\tconst regionRich = {\n\t\t\t...region,\n\t\t\tselected,\n\t\t\ttitle,\n\t\t\tsearcherIcon,\n\t\t\tlangLabel,\n\t\t\tdeviceIcon,\n\t\t\tflagLink,\n\t\t};\n\n\t\tregionsRich.value.push(regionRich);\n\n\t\tif (!regionRich.selected) {\n\t\t\tisAllSelectedLocal = false;\n\t\t}\n\t});\n\n\tisAllSelected.value = isAllSelectedLocal;\n});\n</script>\n\n<template>\n\t<TopDialog\n\t\t:id=\"dialog.id\"\n\t\tpageActive=\"selectorRegions\"\n\t\tclass=\"dialog_selectorRegions\"\n\t\theight=\"600px\"\n\t\twidth=\"600px\"\n\t>\n\t\t<TopDialogPage name=\"selectorRegions\" :order=\"0\">\n\t\t\t<template #header>\n\t\t\t\t<div class=\"dialog_selectorRegions_header\">\n\t\t\t\t\t<TopCheckbox v-model=\"isAllSelected\"></TopCheckbox>\n\n\t\t\t\t\t<TopButton\n\t\t\t\t\t\tclass=\"dialog_selectorRegions_sortButton\"\n\t\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t\tdata-top-icon=\"\"\n\t\t\t\t\t\t@click=\"sort('searcher_key')\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<TopButton\n\t\t\t\t\t\tclass=\"dialog_selectorRegions_sortButton\"\n\t\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t\tdata-top-icon=\"\"\n\t\t\t\t\t\t@click=\"sort('key')\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<TopButton\n\t\t\t\t\t\tclass=\"dialog_selectorRegions_sortButton\"\n\t\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t\tdata-top-icon=\"\"\n\t\t\t\t\t\t@click=\"sort('name')\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</template>\n\n\t\t\t<template #body>\n\t\t\t\t<TopCheckbox\n\t\t\t\t\tv-for=\"region of regionsRich\"\n\t\t\t\t\t:key=\"region.index\"\n\t\t\t\t\tv-model=\"region.selected\"\n\t\t\t\t\tclass=\"dialog_selectorRegions_region\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"dialog_selectorRegions_regionSearcherIcon\"\n\t\t\t\t\t\t:data-top-icon=\"region.searcherIcon\"\n\t\t\t\t\t></div>\n\n\t\t\t\t\t<img\n\t\t\t\t\t\tv-if=\"region.flagLink\"\n\t\t\t\t\t\tclass=\"top-flag\"\n\t\t\t\t\t\t:src=\"'//topvisor.dev' + region.flagLink\"\n\t\t\t\t\t\t:alt=\"region.countryCode\"\n\t\t\t\t\t>\n\n\t\t\t\t\t{{ region.name }}\n\n\t\t\t\t\t<div class=\"dialog_selectorRegions_regionAreaName top-ellipsis\">\n\t\t\t\t\t\t{{ region.areaName }}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"region.langLabel\">\n\t\t\t\t\t\t[{{ region.langLabel }}]\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"region.deviceIcon\"\n\t\t\t\t\t\t:data-top-icon=\"region.deviceIcon\"\n\t\t\t\t\t></div>\n\t\t\t\t</TopCheckbox>\n\t\t\t</template>\n\n\t\t\t<template #footer>\n\t\t\t\t<TopButton @click=\"onSubmit\">\n\t\t\t\t\t{{ $i18n.Common.Apply }}\n\t\t\t\t</TopButton>\n\t\t\t</template>\n\t\t</TopDialogPage>\n\t</TopDialog>\n</template>\n\n<style>\n@import \"./style.css\";\n</style>\n"],"names":["props","__props","dialog","useTopDialogSelf","isAllSelected","ref","regionsRich","sortedVectorByField","reactive","sort","sortedField","regionA","regionB","onSubmit","region","regionsIndexes","_a","watch","isAllSelectedLocal","title","selected","searcherIcon","getSearcherGIcon","langLabel","getLangLabel","deviceIcon","getDeviceGIcon","flagLink","genFlagLinkByCountryCode","regionRich"],"mappings":";;;;;;;;;;;;;;;;;AASA,UAAAA,IAAAC,GAEAC,IAAAC,EAAA,GAKAC,IAAAC,EAAA,EAAA,GAKAC,IAAAD,EAAA,CAAA,CAAA,GAKAE,IAAAC,EAAA;AAAA,MAAqC,cAAA;AAAA,MACtB,KAAA;AAAA,MACT,MAAA;AAAA,IACC,CAAA,GAOPC,IAAA,CAAAC,MAAA;AACC,MAAAH,EAAAG,CAAA,IAAA,CAAAH,EAAAG,CAAA,GAEAJ,EAAA,MAAA,KAAA,CA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