@topvisor/ui 1.3.1-dev.2 → 1.3.1-utils.1
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/{core-ZuvfeeJ3.es.js → core-Cmk3j1ll.es.js} +4 -4
- package/.chunks/{core-ZuvfeeJ3.es.js.map → core-Cmk3j1ll.es.js.map} +1 -1
- package/.chunks/{core-DkD6AE7J.amd.js → core-DWQI6OYD.amd.js} +2 -2
- package/.chunks/{core-DkD6AE7J.amd.js.map → core-DWQI6OYD.amd.js.map} +1 -1
- package/.chunks/{datepicker-DeYFg9AM.amd.js → datepicker-BgLipRW7.amd.js} +2 -2
- package/.chunks/{datepicker-DeYFg9AM.amd.js.map → datepicker-BgLipRW7.amd.js.map} +1 -1
- package/.chunks/{datepicker-CxWa68gc.es.js → datepicker-Dfl91fRZ.es.js} +2 -2
- package/.chunks/{datepicker-CxWa68gc.es.js.map → datepicker-Dfl91fRZ.es.js.map} +1 -1
- package/.chunks/{dialog_selectorRegions-vQD6LBdY.amd.js → dialog_selectorRegions-JEsqs4cv.amd.js} +2 -2
- package/.chunks/{dialog_selectorRegions-vQD6LBdY.amd.js.map → dialog_selectorRegions-JEsqs4cv.amd.js.map} +1 -1
- package/.chunks/{dialog_selectorRegions-D1ord0Ik.es.js → dialog_selectorRegions-eFMZwckA.es.js} +4 -4
- package/.chunks/{dialog_selectorRegions-D1ord0Ik.es.js.map → dialog_selectorRegions-eFMZwckA.es.js.map} +1 -1
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-BMDSZwZJ.es.js → dialogs.vue_vue_type_script_setup_true_lang-CuRb6ess.es.js} +15 -13
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CuRb6ess.es.js.map +1 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DJoFuqCw.amd.js +2 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DJoFuqCw.amd.js.map +1 -0
- package/.chunks/{forms-CRHjU2Mj.es.js → forms-BWoAyEVH.es.js} +5 -5
- package/.chunks/{forms-CRHjU2Mj.es.js.map → forms-BWoAyEVH.es.js.map} +1 -1
- package/.chunks/{forms-D4uFd45i.amd.js → forms-BfDSGwrU.amd.js} +3 -3
- package/.chunks/{forms-D4uFd45i.amd.js.map → forms-BfDSGwrU.amd.js.map} +1 -1
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-DFWY29DS.es.js → listItem.vue_vue_type_script_setup_true_lang-Dljef_xa.es.js} +2 -2
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-DFWY29DS.es.js.map → listItem.vue_vue_type_script_setup_true_lang-Dljef_xa.es.js.map} +1 -1
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-B2Q4gqK6.amd.js → listItem.vue_vue_type_script_setup_true_lang-R7J0Cawj.amd.js} +2 -2
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-B2Q4gqK6.amd.js.map → listItem.vue_vue_type_script_setup_true_lang-R7J0Cawj.amd.js.map} +1 -1
- package/.chunks/{menu.vue_vue_type_style_index_0_lang-Bm9sY3Ux.es.js → menu.vue_vue_type_style_index_0_lang-HDPVVgzy.es.js} +2 -2
- package/.chunks/{menu.vue_vue_type_style_index_0_lang-Bm9sY3Ux.es.js.map → menu.vue_vue_type_style_index_0_lang-HDPVVgzy.es.js.map} +1 -1
- package/.chunks/{menu.vue_vue_type_style_index_0_lang-bMtkdrEt.amd.js → menu.vue_vue_type_style_index_0_lang-JZ-QwyLO.amd.js} +2 -2
- package/.chunks/{menu.vue_vue_type_style_index_0_lang-bMtkdrEt.amd.js.map → menu.vue_vue_type_style_index_0_lang-JZ-QwyLO.amd.js.map} +1 -1
- package/.chunks/notice-DAcU_6aT.amd.js +4 -0
- package/.chunks/notice-DAcU_6aT.amd.js.map +1 -0
- package/.chunks/notice-DYd206Yd.es.js +192 -0
- package/.chunks/notice-DYd206Yd.es.js.map +1 -0
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-o3lCjjxW.es.js → page.vue_vue_type_script_setup_true_lang-CFR_XnIk.es.js} +4 -4
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-o3lCjjxW.es.js.map → page.vue_vue_type_script_setup_true_lang-CFR_XnIk.es.js.map} +1 -1
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-DzuM-_u7.amd.js → page.vue_vue_type_script_setup_true_lang-Cy3k9hJN.amd.js} +2 -2
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-DzuM-_u7.amd.js.map → page.vue_vue_type_script_setup_true_lang-Cy3k9hJN.amd.js.map} +1 -1
- package/.chunks/{popup-Dr3j_FOV.es.js → popup-1pqtx_O5.es.js} +2 -2
- package/.chunks/{popup-Dr3j_FOV.es.js.map → popup-1pqtx_O5.es.js.map} +1 -1
- package/.chunks/{popup-C05LLKni.amd.js → popup-JuvnpqC-.amd.js} +2 -2
- package/.chunks/{popup-C05LLKni.amd.js.map → popup-JuvnpqC-.amd.js.map} +1 -1
- package/.chunks/{utils-BgEQlXpF.amd.js → utils-7_bMpPkj.amd.js} +2 -2
- package/.chunks/{utils-BgEQlXpF.amd.js.map → utils-7_bMpPkj.amd.js.map} +1 -1
- package/.chunks/{utils-Bsv1-1_h.es.js → utils-CdePhhIZ.es.js} +2 -2
- package/.chunks/{utils-Bsv1-1_h.es.js.map → utils-CdePhhIZ.es.js.map} +1 -1
- package/.chunks/{utils-sKjgHYod.es.js → utils-DOkSnf59.es.js} +24 -22
- package/.chunks/utils-DOkSnf59.es.js.map +1 -0
- package/.chunks/utils-_O-2Zobt.amd.js +2 -0
- package/.chunks/utils-_O-2Zobt.amd.js.map +1 -0
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-5LVABONB.es.js → widgetInput.vue_vue_type_script_setup_true_lang-Cr_jgOW4.es.js} +2 -2
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-5LVABONB.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-Cr_jgOW4.es.js.map} +1 -1
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-B7zzY9Mx.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-DVHWVUQM.amd.js} +2 -2
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-B7zzY9Mx.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-DVHWVUQM.amd.js.map} +1 -1
- package/charts/charts.amd.js +1 -1
- package/charts/charts.js +1 -1
- package/core/app.amd.js +1 -1
- package/core/app.js +5 -5
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.js +2 -2
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.js +4 -4
- package/layout/layout.amd.js +1 -1
- package/layout/layout.js +1 -1
- package/package.json +1 -1
- package/popup/popup.amd.js +1 -1
- package/popup/popup.js +4 -4
- package/popup/worker.amd.js +1 -1
- package/popup/worker.js +2 -2
- package/project/project.amd.js +1 -1
- package/project/project.js +5 -5
- package/src/components/core/notice/item/types.d.ts +6 -0
- package/src/components/core/notice/utils.d.ts +1 -0
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.js +2 -2
- package/utils/check.amd.js +1 -1
- package/utils/check.amd.js.map +1 -1
- package/utils/check.js +5 -5
- package/utils/check.js.map +1 -1
- package/utils/clipboard.amd.js +3 -3
- package/utils/clipboard.amd.js.map +1 -1
- package/utils/clipboard.js +7 -9
- package/utils/clipboard.js.map +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.js +1 -1
- package/utils/lodash.amd.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/price.amd.js +1 -1
- package/utils/price.js +1 -1
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.js +3 -3
- package/utils/string.amd.js +1 -1
- package/utils/string.js +1 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-BMDSZwZJ.es.js.map +0 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DDR6uqak.amd.js +0 -2
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DDR6uqak.amd.js.map +0 -1
- package/.chunks/notice-7-xEtFXT.amd.js +0 -4
- package/.chunks/notice-7-xEtFXT.amd.js.map +0 -1
- package/.chunks/notice-pFWJHCd7.es.js +0 -180
- package/.chunks/notice-pFWJHCd7.es.js.map +0 -1
- package/.chunks/utils-DQvj_C9w.amd.js +0 -2
- package/.chunks/utils-DQvj_C9w.amd.js.map +0 -1
- package/.chunks/utils-sKjgHYod.es.js.map +0 -1
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { Core as N } from "../core/app.js";
|
|
2
|
-
import { reactive as z, defineComponent as b, ref as C, computed as S, resolveComponent as D, withDirectives as E, createElementBlock as u, openBlock as i, normalizeClass as j, createElementVNode as v, createCommentVNode as _, Fragment as B, renderList as w, createBlock as M, mergeProps as O, Teleport as V, unref as A, normalizeStyle as F } from "vue";
|
|
3
|
-
import { C as T } from "./forms-CRHjU2Mj.es.js";
|
|
4
|
-
import { genIntHash as J, nl2br as U } from "../utils/string.js";
|
|
5
|
-
const x = ["../assets/notice.css"].map((e) => import.meta.resolve(e));
|
|
6
|
-
N.insertCSSLinkToPage(x, !0);
|
|
7
|
-
const y = 300, d = z(/* @__PURE__ */ new Map()), W = (e, l, t) => "top-notice_" + J(e + l + JSON.stringify(t)), ie = (e, l = "info", t) => {
|
|
8
|
-
let r = "";
|
|
9
|
-
e = String(e);
|
|
10
|
-
const f = W(e, l, t);
|
|
11
|
-
if (t != null && t.title)
|
|
12
|
-
r = t.title;
|
|
13
|
-
else {
|
|
14
|
-
const c = e.split(`
|
|
15
|
-
`);
|
|
16
|
-
c.length && (r = String(c.shift()), e = c.join(`
|
|
17
|
-
`));
|
|
18
|
-
}
|
|
19
|
-
const o = d.get(f);
|
|
20
|
-
if (o) {
|
|
21
|
-
q(o);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const a = {
|
|
25
|
-
id: f,
|
|
26
|
-
title: r,
|
|
27
|
-
text: e,
|
|
28
|
-
style: l,
|
|
29
|
-
buttonsProps: t == null ? void 0 : t.buttonsProps,
|
|
30
|
-
metaText: t == null ? void 0 : t.metaText,
|
|
31
|
-
isSafeHTML: t == null ? void 0 : t.isSafeHTML,
|
|
32
|
-
selectToClose: t == null ? void 0 : t.selectToClose,
|
|
33
|
-
onClose: t == null ? void 0 : t.onClose
|
|
34
|
-
};
|
|
35
|
-
if (d.set(a.id, a), d.size > 5) {
|
|
36
|
-
const [c, m] = [...d].at(0) || [];
|
|
37
|
-
m && H(m);
|
|
38
|
-
}
|
|
39
|
-
T.state.isMobile && $("input").one("click", () => H(a));
|
|
40
|
-
}, q = (e) => {
|
|
41
|
-
e.hightlight = !0, setTimeout(() => e.hightlight = !1, y);
|
|
42
|
-
}, H = (e) => {
|
|
43
|
-
e.forceClosed = !0, setTimeout(() => {
|
|
44
|
-
var l;
|
|
45
|
-
(l = e.onClose) == null || l.call(e), d.delete(e.id);
|
|
46
|
-
}, y);
|
|
47
|
-
}, k = (e) => {
|
|
48
|
-
const l = "hacking was detected";
|
|
49
|
-
return e = e.replace(/<script/g, l), e = e.replace(/<img/g, l), e = e.replace(/<iframe/g, l), e = e.replace(/javascript:/g, l), e = e.replace(/<[^>]+ (@|on)\w+=[^>]+>?/g, l), e;
|
|
50
|
-
}, G = { class: "top-notice_itemTextWrapper" }, K = ["innerHTML"], Q = ["innerHTML"], R = {
|
|
51
|
-
key: 0,
|
|
52
|
-
class: "top-notice_itemButtons"
|
|
53
|
-
}, X = ["innerHTML"], Y = ["title"], Z = /* @__PURE__ */ b({
|
|
54
|
-
__name: "item",
|
|
55
|
-
props: {
|
|
56
|
-
id: {},
|
|
57
|
-
title: {},
|
|
58
|
-
text: {},
|
|
59
|
-
style: {},
|
|
60
|
-
metaText: {},
|
|
61
|
-
buttonsProps: {},
|
|
62
|
-
isSafeHTML: { type: Boolean },
|
|
63
|
-
hightlight: { type: Boolean },
|
|
64
|
-
selectToClose: { type: Boolean, default: !0 },
|
|
65
|
-
forceClosed: { type: Boolean }
|
|
66
|
-
},
|
|
67
|
-
emits: ["close"],
|
|
68
|
-
setup(e, { emit: l }) {
|
|
69
|
-
const t = e, r = l, f = C(!1);
|
|
70
|
-
setTimeout(() => f.value = !0, 10);
|
|
71
|
-
const o = C(!1), a = C("right"), c = S(() => {
|
|
72
|
-
let s = t.title.replace(/ {2}/g, " ");
|
|
73
|
-
return t.isSafeHTML || (s = k(s)), s;
|
|
74
|
-
}), m = S(() => {
|
|
75
|
-
let s = U(t.text);
|
|
76
|
-
return s = s.replace(/ {2}/g, " "), t.isSafeHTML || (s = k(s)), s;
|
|
77
|
-
}), h = (s) => {
|
|
78
|
-
o.value = !0, s && (a.value = s), setTimeout(() => r("close"), y);
|
|
79
|
-
}, P = (s) => {
|
|
80
|
-
if (!t.selectToClose) return;
|
|
81
|
-
const { tagName: n } = s.target;
|
|
82
|
-
n === "A" && h(), n === "BUTTON" && h();
|
|
83
|
-
}, I = {
|
|
84
|
-
mounted: (s) => {
|
|
85
|
-
if (!T.state.isMobile || !T.$ || !T.$.ui.draggable) return;
|
|
86
|
-
let n = "right";
|
|
87
|
-
T.$(s).draggable({
|
|
88
|
-
revert: !1,
|
|
89
|
-
axis: "x",
|
|
90
|
-
drag: (p, g) => {
|
|
91
|
-
n = g.position.left > 0 ? "right" : "left";
|
|
92
|
-
},
|
|
93
|
-
stop: (p, g) => {
|
|
94
|
-
h(n);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
return (s, n) => {
|
|
100
|
-
var p;
|
|
101
|
-
const L = D("TopButton");
|
|
102
|
-
return E((i(), u("div", {
|
|
103
|
-
class: j(["top-notice_item", {
|
|
104
|
-
["top-notice_item-" + s.style]: !0,
|
|
105
|
-
"top-notice_item-hightlight": s.hightlight,
|
|
106
|
-
"top-notice_item-showed": f.value,
|
|
107
|
-
"top-notice_item-closed": o.value || s.forceClosed,
|
|
108
|
-
["top-notice_item-closed_" + a.value]: o.value
|
|
109
|
-
}]),
|
|
110
|
-
onClick: P
|
|
111
|
-
}, [
|
|
112
|
-
v("div", G, [
|
|
113
|
-
c.value ? (i(), u("div", {
|
|
114
|
-
key: 0,
|
|
115
|
-
class: "top-notice_itemTitle",
|
|
116
|
-
innerHTML: c.value
|
|
117
|
-
}, null, 8, K)) : _("", !0),
|
|
118
|
-
m.value ? (i(), u("div", {
|
|
119
|
-
key: 1,
|
|
120
|
-
class: "top-notice_itemText",
|
|
121
|
-
innerHTML: m.value
|
|
122
|
-
}, null, 8, Q)) : _("", !0)
|
|
123
|
-
]),
|
|
124
|
-
(p = s.buttonsProps) != null && p.length ? (i(), u("div", R, [
|
|
125
|
-
(i(!0), u(B, null, w(s.buttonsProps, (g) => (i(), M(L, O({
|
|
126
|
-
class: "top-notice_itemButton",
|
|
127
|
-
size: "s"
|
|
128
|
-
}, { ref_for: !0 }, g, {
|
|
129
|
-
title: g.title,
|
|
130
|
-
innerHTML: g.default,
|
|
131
|
-
onClick: n[0] || (n[0] = (te) => h())
|
|
132
|
-
}), null, 16, ["title", "innerHTML"]))), 256))
|
|
133
|
-
])) : _("", !0),
|
|
134
|
-
s.metaText ? (i(), u("div", {
|
|
135
|
-
key: 1,
|
|
136
|
-
class: "top-notice_itemMetaText",
|
|
137
|
-
innerHTML: s.metaText
|
|
138
|
-
}, null, 8, X)) : _("", !0),
|
|
139
|
-
v("div", {
|
|
140
|
-
class: "top-notice_itemClose",
|
|
141
|
-
"data-top-icon": "",
|
|
142
|
-
title: s.$i18n.Common.Close,
|
|
143
|
-
onClick: n[1] || (n[1] = () => h())
|
|
144
|
-
}, null, 8, Y)
|
|
145
|
-
], 2)), [
|
|
146
|
-
[I]
|
|
147
|
-
]);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}), ee = { class: "top-notice" }, re = /* @__PURE__ */ b({
|
|
151
|
-
__name: "notice",
|
|
152
|
-
setup(e) {
|
|
153
|
-
const l = (t) => {
|
|
154
|
-
var r;
|
|
155
|
-
(r = t.onClose) == null || r.call(t), d.delete(t.id);
|
|
156
|
-
};
|
|
157
|
-
return (t, r) => (i(), M(V, { to: "body" }, [
|
|
158
|
-
v("div", ee, [
|
|
159
|
-
(i(!0), u(B, null, w(A(d), ([f, o]) => (i(), M(Z, {
|
|
160
|
-
key: o.id,
|
|
161
|
-
id: o.id,
|
|
162
|
-
title: o.title,
|
|
163
|
-
text: o.text,
|
|
164
|
-
style: F(o.style),
|
|
165
|
-
buttonsProps: o.buttonsProps,
|
|
166
|
-
metaText: o.metaText,
|
|
167
|
-
isSafeHTML: o.isSafeHTML,
|
|
168
|
-
forceClosed: o.forceClosed,
|
|
169
|
-
hightlight: o.hightlight,
|
|
170
|
-
onClose: (a) => l(o)
|
|
171
|
-
}, null, 8, ["id", "title", "text", "style", "buttonsProps", "metaText", "isSafeHTML", "forceClosed", "hightlight", "onClose"]))), 128))
|
|
172
|
-
])
|
|
173
|
-
]));
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
export {
|
|
177
|
-
re as default,
|
|
178
|
-
ie as show
|
|
179
|
-
};
|
|
180
|
-
//# sourceMappingURL=notice-pFWJHCd7.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notice-pFWJHCd7.es.js","sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue"],"sourcesContent":["import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/g, textNoSafety);\n\ttext = text.replace(/<img/g, textNoSafety);\n\ttext = text.replace(/<iframe/g, textNoSafety);\n\ttext = text.replace(/javascript:/g, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/g, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tlet axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"],"names":["transitionDuration","itemById","reactive","genItemId","text","style","options","genIntHash","show","title","id","chunks","itemExists","hightlight","item","_firstId","firstItem","close","Core","_a","prepareText","textNoSafety","props","__props","emit","__emit","showed","ref","closed","closedDirection","computed","res","nl2br","direction","onClick","e","tagName","vSwipe","el","_e","ui","_ui","normalizeClass","_ctx","forceClosed","openBlock","createElementBlock","_hoisted_2","createCommentVNode","_hoisted_3","Fragment","renderList","buttonProps","createBlock","_component_TopButton","mergeProps","_cache","$event","metaText","_hoisted_6","onCloseItem","createElementVNode","_hoisted_1","unref","_index","normalizeStyle"],"mappings":";;;;;;AAKO,MAAAA,IAAA,KAIAC,IAAAC,EAAA,oBAAA,IAAA,CAAA,GAEPC,IAAA,CAAAC,GAAAC,GAAAC,MACC,gBAAAC,EAAAH,IAAAC,IAAA,KAAA,UAAAC,CAAA,CAAA,GAmBME,KAAA,CAAAJ,GAAAC,IAAA,QAAAC,MAAA;AACN,MAAAG,IAAA;AAEA,EAAAL,IAAA,OAAAA,CAAA;AAEA,QAAAM,IAAAP,EAAAC,GAAAC,GAAAC,CAAA;AAEA,MAAAA,KAAA,QAAAA,EAAA;AACC,IAAAG,IAAAH,EAAA;AAAA,OAAgB;AAEhB,UAAAK,IAAAP,EAAA,MAAA;AAAA,CAAA;AAEA,IAAAO,EAAA,WACCF,IAAA,OAAAE,EAAA,MAAA,CAAA,GACAP,IAAAO,EAAA,KAAA;AAAA,CAAA;AAAA,EACD;AAGD,QAAAC,IAAAX,EAAA,IAAAS,CAAA;AACA,MAAAE,GAAA;AACC,IAAAC,EAAAD,CAAA;AAEA;AAAA,EAAA;AAGD,QAAAE,IAAA;AAAA,IAAmB,IAAAJ;AA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,CAAA9C,MAAA;;AACC,OAAAK,IAAAL,EAAA,YAAA,QAAAK,EAAA,KAAAL,IAEAb,EAAA,OAAAa,EAAA,EAAA;AAAA,IAAuB;;MAKJ+C,EAAA,OAAAC,IAAA;AAAA,SAgBZjB,EAAA,EAAA,GAAAC,EAAAI,GAAA,MAAAC,EAAAY,EAAA9D,CAAA,GAAA,CAAA,CAAA+D,GAAAlD,CAAA;UADH,KAAAA,EAAA;AAAA,UAXU,IAAAA,EAAA;AAAA,UACD,OAAAA,EAAA;AAAA,UACG,MAAAA,EAAA;AAAA,UACD,OAAAmD,EAAAnD,EAAA,KAAA;AAAA,UACM,cAAAA,EAAA;AAAA,UACE,UAAAA,EAAA;AAAA,UACJ,YAAAA,EAAA;AAAA,UACE,aAAAA,EAAA;AAAA,UACC,YAAAA,EAAA;AAAA,UACD,SAAA,CAAA2C,MAAAG,EAAA9C,CAAA;AAAA,QACM,GAAA,MAAA,GAAA,CAAA,MAAA,SAAA,QAAA,SAAA,gBAAA,YAAA,cAAA,eAAA,cAAA,SAAA,CAAA;;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
define(["require","exports","vue","./forms-D4uFd45i.amd","../popup/worker.amd","../utils/system.amd","../utils/route.amd","../utils/scroll.amd","./dialogs.vue_vue_type_script_setup_true_lang-DDR6uqak.amd","../utils/dom.amd"],(function(ee,P,b,u,I,L,q,O,c,l){"use strict";if(typeof b>"u")var b=window.Vue;$;let E=!1;const H=()=>{E||(E=!0,document.addEventListener("keydown",e=>{if(e.key!=="Escape"||!e.target)return;const t=e.target;if(!t.closest(".ui-dialog")||t.contentEditable==="true"||t.contentEditable==="plaintext-only"||l.querySelectorVisible(document.documentElement,".top-popup-wrapper")||t.classList.contains("autocomplete")||l.querySelectorVisible(document.documentElement,".fancybox-container"))return;const i=l.querySelectorAllArray(document,".ui-dialog-content").filter(o=>l.isVisible(o));$(i[i.length-1]).dialog("close")}),document.addEventListener("click",e=>{const t=e.target.closest('[data-action="top-dialog-close"]');if(!t)return;e.preventDefault();const i=t.closest(".ui-dialog-content");if(!i)return;const o=t.dataset.toView;if(o=="toPrevPage()"){v.toPrevPage(i);return}if(o){const r=o.split("-"),n=r.shift(),s=r.join("-");if(!n)return;const p=v.getElDialogById(n);if(!p)return;const f=l.querySelectorAllArray(p,`[data-view-page="${s}"]`);if(!f)return;if(!l.isVisible(f[0])){const k=c.TopDialogWorker.genViewPageHash(o,"prev");q.historySetState(!1,k);return}}$(i).dialog("close")}),document.addEventListener("submit",e=>{const t=e.target;(t.matches(".modal-body > form")||t.matches(".modal-layer-body > form"))&&e.preventDefault()}),document.addEventListener("keypress",e=>{const t=e.target;if(!(!t.closest(".ui-dialog .modal-body")||!(t.matches("input:not(.searcher), textarea:not(.searcher), select:not(.searcher), button:not(.searcher)")||t.hasAttribute("contenteditable")))&&e.key==="Enter"){if(t.classList.contains("autocomplete")){e.preventDefault();return}if(t.tagName==="TEXTAREA"){if(!e.ctrlKey&&!e.metaKey)return;const a=t.closest("form");if(a){const r=l.querySelectorAllArray(a,'button[type="submit"]').concat(l.querySelectorAllArray(a,'input[type="submit"]')).find(n=>l.isVisible(n));r==null||r.click()}}}}),document.addEventListener("click",function(e){if(!e.target.classList.contains("ui-widget-overlay"))return;let i,o=0;if(l.querySelectorAllArray(document,".ui-dialog").filter(r=>l.isVisible(r)).forEach(r=>{const n=Number(window.getComputedStyle(r).zIndex);n<o||(i=r,o=n)}),i){const r=i.querySelector(".ui-dialog-content");$(r).dialog("close")}}),window.addEventListener("resize",v.recalcPositions),v.recalcPositions())},F=':root{--dialog-border-color: var(--color-line-1);--dialog-loading-duration: 10s;--top-dialog-footer-height: var(--top-forms-base-height_s)}html.with_dialog{overflow:hidden!important}a[data-to-view]{cursor:pointer}.ui-widget-overlay{background:#040404;opacity:.5;filter:Alpha(Opacity=50)}.ui-dialog{border-radius:8px;border:none;padding:0}.ui-dialog.ui-widget{border:none}.ui-dialog-titlebar{display:none}.ui-dialog .ui-dialog-content{padding:0;overflow:visible}.ui-dialog .project_name{word-break:break-all}.ui-dialog-content{--dialog-header-height: 50px;--dialog-layer-pageSelector: 0px}.ui-dialog-content-withPageSelector{--dialog-layer-pageSelector: 42px}.modal-header,.modal-body,.modal-footer{font-size:14px;position:relative}.modal-body{padding:var(--padding-default)}.modal-body:has(>.topTable:first-child){padding-top:calc(var(--padding-default) / 4)}.modal-header{border-bottom:1px solid var(--dialog-border-color);height:var(--dialog-header-height);padding:0 var(--padding-default);display:flex;justify-content:space-between;align-items:center;gap:var(--top-padding-2)}.modal-header>*{padding:10px 0;font-size:16px}.modal-header>.top-title{margin:0;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1;order:50;display:flex;align-items:center}.modal-header>.top-title>div[class*=icon]{display:none}.modal-header>div:not(.top-title){order:60}.modal-header>div.close{--top-icon-color: var(--color-text-2);cursor:pointer;background:var(--color-layout-front-1);font-size:16px;order:100;animation-name:none!important}.modal-header>div.close:hover{--top-icon-color: var(--color-text-1)}.modal-header .links_icons{position:absolute;right:50px}.modal-header .links_icons [class*=icon-]{width:auto;height:auto;padding:0 5px;color:#d6dee0}.modal-header .links_icons [class*=icon-].active{color:var(--color-bg-warning-1)}.modal-layer-pageSelector{padding:0 10px!important}.modal-body{max-height:calc(var(--100vh) - var(--dialog-header-height) - 1px - var(--dialog-layer-pageSelector) - var(--top-dialog-footer-height) - 1px);overflow-y:auto;overflow-x:hidden;box-sizing:border-box;flex-grow:1}.modal-body hr{margin:16px -15px}.modal-body h4{padding:0;margin:0 0 10px;line-height:normal}.modal-body .inner{padding:var(--padding-default);margin:0 calc(0px - var(--padding-default));position:relative}.modal-body .inner .bt{border-top:1px dashed var(--color-layout-front-primary-3);position:absolute;top:0;right:0;left:0}.modal-body .inner .bb{border-bottom:1px dashed var(--color-layout-front-primary-3);position:absolute;right:0;bottom:0;left:0}.modal-body .inner.color-1{background:var(--color-layout-front-primary-3);color:var(--color-text-1)}.modal-body .inner strong{color:var(--color-text-1)}.modal-body .comment{line-height:18px}.modal-footer{min-height:var(--top-dialog-footer-height);padding:var(--top-gap-2);display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;gap:var(--top-gap-2)}.modal-footer .modal-footer-btn-left{margin-right:auto}.modal-footer>.btn.full_width,.modal-footer>.top-button.full_width{flex-grow:1;align-self:flex-end}.modal-footer-fullWith{flex-wrap:wrap}.modal-footer-fullWith>*{flex-grow:1}.modal-footer-fullWith>.top-info{flex-grow:5}.modal-footer-fullWith>*:empty{flex-grow:0}.ui-dialog-content>.modal-layer>[data-view-page]>input[type=submit]{position:absolute;visibility:hidden}.help_popup .modal-header{display:none}.help_popup .modal-header a{top:2px;z-index:10}.help_popup .modal-header .top-title{display:none}.modal-layer{overflow:hidden}.modal-layer a[data-top-icon]:empty{color:var(--color-text-4);text-decoration:none}.modal-layer>[data-view-page]>div>div.buttons{display:flex;white-space:nowrap;gap:var(--top-padding-1)}.modal-layer>[data-view-page]>div>div.buttons:empty{display:none}.modal-layer>[data-view-page]>div>div.buttons>div,.modal-layer>[data-view-page]>div>div.buttons>a{cursor:pointer;width:auto;height:auto;min-width:auto;min-height:auto;padding:10px 9px;color:var(--color-text-4)}.modal-layer>[data-view-page]>div>div.buttons>div:hover{color:var(--color-text-2)}.modal-layer>[data-view-page]>div>div.buttons>div.hidden{display:none!important}.ui-dialog-content[data-view-page-active]{display:flex!important;flex-direction:column;justify-items:stretch}.ui-dialog-content>.modal-layer{display:flex!important;align-items:stretch;position:relative}.ui-dialog-content.i-change-page>.modal-layer{overflow:hidden}.ui-dialog-content>.modal-layer>[data-view-page]{width:100%;position:relative;display:none;flex-direction:column;justify-content:space-between;animation:.3s cubic-bezier(.4,0,.2,1) forwards}.ui-dialog-content>.modal-layer>[data-view-page].active{display:flex}.ui-dialog-content>.modal-layer>[data-view-page].reverse{animation-direction:reverse}.ui-dialog-content>.modal-layer>[data-view-page].center-to-left,.ui-dialog-content>.modal-layer>[data-view-page].right-to-center{display:flex;position:absolute;inset:0}.ui-dialog-content>.modal-layer>[data-view-page].center-to-left>div,.ui-dialog-content>.modal-layer>[data-view-page].right-to-center>div{overflow:hidden}.ui-dialog-content>.modal-layer-header{border-bottom:1px solid var(--dialog-border-color);min-height:var(--dialog-header-height)}.ui-dialog-content>.modal-layer-header>[data-view-page]>.modal-header{border:none;background:none}.ui-dialog-content>.modal-layer-header>[data-view-page]>.modal-header>*{animation:.3s cubic-bezier(.4,0,.2,1) forwards}.ui-dialog-content>.modal-layer-header>[data-view-page].reverse>.modal-header>*{animation-direction:reverse}.ui-dialog-content>.modal-layer-header>[data-view-page].center-to-left>.modal-header>.top-title{animation-name:dialog-center-to-left-header-title}.ui-dialog-content>.modal-layer-header>[data-view-page].right-to-center>.modal-header>.top-title{animation-name:dialog-right-to-center-header-title}.ui-dialog-content>.modal-layer-header>[data-view-page].center-to-left>.modal-header>[class*=widget-]{animation-name:dialog-center-to-left-header-title}.ui-dialog-content>.modal-layer-header>[data-view-page].right-to-center>.modal-header>[class*=widget-]{animation-name:dialog-right-to-center-header-title}.ui-dialog-content>.modal-layer-header>[data-view-page].center-to-left>.modal-header>div{animation-name:dialog-center-to-left-header-icons}.ui-dialog-content>.modal-layer-header>[data-view-page].right-to-center>.modal-header>div{animation-name:dialog-right-to-center-header-icons}.ui-dialog-content>.modal-layer-body{border-radius:0 0 8px 8px;max-height:calc(var(--100vh) - var(--dialog-header-height) - var(--dialog-layer-pageSelector) - var(--toolbar-height));flex-grow:2}.ui-dialog-content.i-change-page>.modal-layer-body>[data-view-page]{background:var(--color-layout-front-1)}.ui-dialog-content>.modal-layer-body>[data-view-page].center-to-left{animation-name:dialog-center-to-left}.ui-dialog-content>.modal-layer-body>[data-view-page].right-to-center{animation-name:dialog-right-to-center}.ui-dialog-content .modal-footer .second_level{box-sizing:border-box;background:var(--color-layout-front-1);width:100%;min-height:25px;display:flex;align-items:center;justify-content:center}.ui-dialog-content .modal-footer .second_level input{border-radius:8px;width:100%;height:var(--top-forms-base-height);padding:var(--top-padding-1) var(--top-padding-3);box-sizing:border-box}.ui-dialog-content>.modal-layer-body>[data-view-page].i-load-data{pointer-events:none}.ui-dialog-content>.modal-layer-body>[data-view-page].i-load-data:before{content:" ";background:#378dc6;width:0;height:4px;position:absolute;top:0;left:0;z-index:100;animation:top-loadbar var(--dialog-loading-duration) forwards}.ui-dialog-content.modal-expanded{width:100vw!important;height:calc(var(--100vh) + 10px)!important}.modal-header>[data-widget]{padding:0 8px;position:absolute;inset:0;opacity:0;overflow:hidden;align-items:center;visibility:hidden;transition:opacity .3s;z-index:1}.modal-header>[data-widget=search] div.cancel{opacity:0;transform:translate(100%);transition:transform,opacity;transition-duration:.3s}[data-view-page].i-show-search .modal-header>:not([data-widget=search]){visibility:hidden}[data-view-page].i-show-search [data-widget=search]{visibility:visible;opacity:1}[data-view-page].i-show-search [data-widget=search] .cancel{transform:translate(0);opacity:1}[data-view-page]>.modal-header>*{transition:opacity .3s}[data-view-page].i-show-search>.modal-header>div.buttons{opacity:0}.modal-layer .top-popup-wrapper{height:100%!important}@keyframes dialog-center-to-left-header-title{0%{transform:translate(0);opacity:1}75%{opacity:0}to{transform:translate(-30%);opacity:0}}@keyframes dialog-right-to-center-header-title{0%{transform:translate(100%);opacity:0}25%{opacity:0}to{transform:translate(0);opacity:1}}@keyframes dialog-center-to-left-header-icons{0%{transform:translate(0);opacity:1}35%{transform:translate(-20%);opacity:0}to{transform:translate(-20%);opacity:0}}@keyframes dialog-right-to-center-header-icons{0%{transform:translate(20%);opacity:0}65%{transform:translate(20%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes dialog-center-to-left{0%{transform:translate(0);filter:brightness(1)}to{transform:translate(-30%);filter:brightness(.9)}}@keyframes dialog-right-to-center{0%{transform:translate(100%);box-shadow:#0000001a 0 0 10px}to{transform:translate(0);box-shadow:#0003 0 0 10px}}@media only screen and (max-width: 1480px){.win_side_panel_opener{display:none}}@media only screen and (min-width: 1480px){.ui-dialog-content.with_side_panel{box-shadow:#0003 0 0 6px}.ui-dialog-content.with_side_panel .modal-layer-body{background:var(--color-layout-front-1)}[data-widget=side_panel]{--side_panel_width: calc((100vw - 900px)/2 - 28px) ;box-sizing:border-box;background:var(--color-layout-front-1);max-width:var(--side_panel_width);padding:18px;position:absolute;top:calc(var(--dialog-header-height) + 1px + var(--dialog-layer-pageSelector));bottom:calc(var(--top-dialog-footer-height) + 1px);z-index:-1;display:block;transition:.2s}.win_side_panel_left{border-radius:8px 0 0 8px;right:100%}.win_side_panel_right{border-radius:0 8px 8px 0;left:100%}.win_side_panel_closed.win_side_panel_left{right:calc(100% - var(--side_panel_width))}.win_side_panel_closed.win_side_panel_right{left:calc(100% - var(--side_panel_width))}[data-widget=side_panel] .template{display:block}[data-widget=side_panel] .template>.header,[data-widget=side_panel] .template>.footer{display:flex}.win_side_panel_opener{cursor:pointer;background:var(--color-cyan);color:#fff;padding:4px;position:absolute;top:20px}.win_side_panel_closed .win_side_panel_opener:not(:hover){opacity:.3}.win_side_panel_left .win_side_panel_opener{border-radius:4px 0 0 4px;right:100%}.win_side_panel_right .win_side_panel_opener{border-radius:0 6px 6px 0;left:100%}}@media only screen and (max-height: 900px){html.with_dialog{background:#f1f1f1;overflow:hidden}.ui-dialog.me-tightly{border-radius:0;height:auto!important;position:fixed;top:0!important;bottom:0!important}.ui-dialog.me-tightly .ui-dialog-content{min-height:100%!important}.ui-dialog.me-tightly>div>.modal-body{position:absolute;top:var(--dialog-header-height);right:0;left:0;bottom:var(--dialog-header-height)}.ui-dialog.me-tightly>div>.modal-body:last-child{bottom:0}.ui-dialog.me-tightly>div>.modal-footer{position:absolute;right:0;bottom:0;left:0}.ui-dialog.me-tightly .modal-layer-body{border-radius:0;min-height:0!important}.ui-dialog.me-tightly .modal-layer-body .modal-footer{min-height:unset}}',U='html.with_dialog body{height:var(--100vh);overflow:hidden}.ui-widget-overlay{height:calc(100% - var(--toolbar-height))}.ui-dialog{border-radius:0;width:auto!important;height:auto!important;position:fixed;inset:0!important}.ui-dialog-content{width:100%!important;height:100%!important;min-width:0!important;max-width:100%!important}.modal-header>.top-title{text-align:center;font-size:14px}.modal-header>div.close{font-size:14px;order:1}.modal-header>div.close:before{content:""}.modal-body:last-child{bottom:0}.modal-footer{bottom:0}.modal-footer .second_level{padding:10px 8px}.modal-layer-body{min-height:0!important}.ui-dialog-content>.modal-layer-body{border-radius:0}.modal-body,.modal-footer{padding-right:12px;padding-left:12px}.modal-footer .btn:last-child{margin-right:12px}.modal-body .inner{padding:12px;margin:0 -12px;position:relative}',K=".modal-menu-opener{order:1!important}.modal-menu-opener:before{--top-icon-size: 20px;--top-icon-color: #FFF;--top-icon-width: var(--top-icon-size);border-radius:50%;background:var(--color-bg-primary-1);padding:3px;transition:transform .1s}.modal-menu-opener:hover:before{background:var(--color-bg-primary-2)}.modal-menu-opener.top-active:before{background:var(--color-bg-primary-2);transform:scale(.8)}.modal-layer .top-popup-wrapper{background:transparent;width:auto!important;padding:0!important;margin:0!important;top:0!important;right:0!important;left:0!important;transition:background .3s}.modal-layer .top-popup-wrapper>.top-popup[class],.modal-layer .top-popup-wrapper.with_notch>.top-popup[class]{border-radius:8px;border:none;margin:12px!important;max-width:100%;max-height:calc(100% - 24px);inset:0 0 auto!important;overflow:auto;display:flex;flex-direction:column;opacity:1;transform:translateY(calc(-100% - 24px));transition:transform .3s}.modal-layer .top-popup>.top-popup_header{background:var(--color-theme-50)}.modal-layer .top-theme-lite .top-popup>.top-popup_header .select{border:none}.modal-layer .top-theme-lite .top-popup>.top-popup_header .select .text{color:#fff}.modal-layer .top-theme-lite .top-popup>.top-popup_header .select .arrow{background:none}.modal-layer .top-popup-wrapper-shown:not(.top-popup-wrapper-closed){background:#34495e40}@media only screen and (min-width: 1480px){.ui-dialog-content.with_side_panel{box-shadow:#0003 0 0 6px}.ui-dialog-content.with_side_panel .modal-layer-body{background:var(--color-layout-front-1)}[data-widget=side_panel]{--side_panel_width: calc((100vw - 900px)/2 - 28px) ;box-sizing:border-box;background:var(--color-layout-front-1);max-width:var(--side_panel_width);padding:18px;display:block;position:absolute;top:51px;bottom:51px;z-index:-1;transition:.2s}.win_side_panel_left{border-radius:8px 0 0 8px;right:100%}.win_side_panel_right{border-radius:0 8px 8px 0;left:100%}.win_side_panel_closed.win_side_panel_left{right:calc(100% - var(--side_panel_width))}.win_side_panel_closed.win_side_panel_right{left:calc(100% - var(--side_panel_width))}[data-widget=side_panel] .template{display:block}[data-widget=side_panel] .template>.header,[data-widget=side_panel] .template>.footer{display:flex}.win_side_panel_opener{cursor:pointer;background:var(--color-cyan);color:#fff;padding:4px;position:absolute;top:20px}.win_side_panel_closed .win_side_panel_opener:not(:hover){opacity:.3}.win_side_panel_left .win_side_panel_opener{border-radius:4px 0 0 4px;right:100%}.win_side_panel_right .win_side_panel_opener{border-radius:0 6px 6px 0;left:100%}}",R="html{--top-dialog-width: auto;--top-dialog-height: auto}.top-dialog{max-width:100vw}.top-dialog .modal-layer-body{height:var(--top-dialog-height)}",J=".top-dialog{width:var(--top-dialog-width)!important}";u.Core.insertStyleToPage(F),u.Core.insertStyleToPage(U,"m"),u.Core.insertStyleToPage(K,"pc"),u.Core.insertStyleToPage(R),u.Core.insertStyleToPage(J,"pc");let V,_=!1;const m=e=>!!e&&typeof e=="object"&&"jquery"in e,Z=()=>{$.extend($.ui.dialog.prototype.options,{focus:e=>{var t;e.target.focus(),(t=$("[autofocus]",e.target)[0])==null||t.focus()},create:e=>G(e.target),open:e=>X(e.target),close:e=>Y(e.target),modal:!0,resizable:!1,closeOnEscape:!1,width:"auto",minHeight:0}),$.ui.dialog.prototype._focusTabbable=$.noop,$.ui.dialog.prototype._moveToTopOriginal=$.ui.dialog.prototype._moveToTop,$.ui.dialog.prototype._moveToTop=function(){this._moveToTopOriginal();const e=$(this.element);e.trigger("dialogsMoveToTop",[e])},H(),_=!0},W=e=>{var i,o;const t={};return((i=e.dataset)==null?void 0:i.modal)==="false"&&(t.modal=!1),(o=e.dataset)!=null&&o.position&&(t.position=JSON.parse(e.dataset.position)),t},y=e=>document.getElementById(e),x=async(e,t,i)=>{if(!e.startsWith("dialog_"))return;const o=c.getDialogWorker(e);if(o&&(o.isOpened.value=!0,t!==void 0&&(o.pageActive.value=t),i!==void 0&&(o.pageActiveNext.value=i),await b.nextTick(),i)){const a=y(e);if(!a)return;a.querySelectorAll(`[data-view-page="${i}"]`).length||await L.waitWhile(()=>!a.querySelectorAll(`[data-view-page="${i}"]`).length)}},G=e=>{var i,o;const t=e.querySelector(".modal-body");t&&(O.connectScrollShadow(t),(o=(i=c.TopDialogWorker.state).decoratorOnCreate)==null||o.call(i,e),Q(e))},Q=e=>{$(e).on("aftershow.top-menu-popup","[data-top-popup]",(t,i)=>{var r;const o=i[0],a=c.TopDialogWorker.getPairPage(o);(r=a==null?void 0:a[1])==null||r.prepend(o)})},X=async e=>{var n;const t=e.dataset.viewPageActive,i=window.innerWidth;u.Core.state.documentClassModificators.set("top-dialog","with_dialog");const a=window.innerWidth-i;document.documentElement.scrollHeight>window.innerHeight&&(document.querySelector("html").style.marginRight=a+"px"),z();const r=c.getDialogWorker(e.getAttribute("id"));(n=r==null?void 0:r.emit)==null||n.call(r,"open",t)},Y=async e=>{var r;const t=e.getAttribute("id"),i=e.dataset.viewPageActive;if(i){const n={vpn:c.TopDialogWorker.state.viewPageN,["view-"+t]:null};n["view-"+t]=null,(c.TopDialogWorker.state.viewPageN===0||c.TopDialogWorker.state.viewPageN===1)&&(n.vpn=null),q.setHashs(n,!1)}l.querySelectorAllArray(document,".ui-widget-overlay").filter(n=>l.isVisible(n)).length||(u.Core.state.documentClassModificators.delete("top-dialog"),document.querySelector("html").style.marginRight=""),$(e).trigger("viewAfterClose",[$(e)]);const a=c.getDialogWorker(t);a&&(a.isOpened.value=!1,(r=a.emit)==null||r.call(a,"close",i),a.onCloseOnce&&(a.onCloseOnce(a.props,i),a.onCloseOnce=void 0)),window.dispatchEvent(new Event("resize"))},z=()=>{l.querySelectorAllArray(document,".ui-dialog").filter(t=>l.isVisible(t)&&t.querySelector(":scope > .ui-dialog-content")).map(t=>t.querySelector(":scope > .ui-dialog-content")).forEach(t=>{if(!t.querySelector(".modal-body"))return;const o=t.closest(".ui-dialog"),a=W(t);a.position??={of:window},$(t).dialog("option",a),o.classList.remove("me-tightly"),(o.clientHeight??0)>window.innerHeight&&o.classList.add("me-tightly")})},N=async(e,t)=>{const o=/(\w+)[=-]([\w-]+)(?::([\w.:-]+))?/g.exec(e);if(o){const a=o[1],r=o[2],n=o[3];let s=[];n&&(s=n.split(":")),await C(a,r,s,t)}},C=async(e,t,i,o,a)=>{_||await new Promise((s,p)=>{const f=setInterval(()=>{_&&(clearInterval(f),s())},10)}),await b.nextTick();let r;if(typeof e=="object"?(m(e)&&(e=e==null?void 0:e[0]),r=e):r=y(e),!r&&typeof e=="string"&&c.TopDialogWorker.state.load&&(await c.TopDialogWorker.state.load(e),r=y(e),!r))throw new Error("Dialog no exists: "+e);if(!r)return;await A(r,t,i,o);const n=$(r);if(r!=null&&r.classList.contains("ui-dialog-content"))n.dialog("open");else{const s=W(r);n.dialog(s)}a&&a(n)},A=async(e,t,i,o)=>{var f,k;m(e)&&(e=e==null?void 0:e[0]),t===void 0&&(t=e.dataset.viewPageActive),t!==e.dataset.viewPageActive&&B(e)&&await L.sleep(100),i===void 0&&(i=[]),await x(e.getAttribute("id"),void 0,t);const a=l.querySelectorAllArray(e,".modal-layer"),r=a.reduce((d,h)=>{const g=h.querySelector(":scope > .active");return g&&d.push(g),d},[]),n=a.reduce((d,h)=>{const g=h.querySelector(`:scope > [data-view-page="${t}"]`);return g&&d.push(g),d},[]),s=i.join(":");if(o===void 0&&(o="next",(((f=n[0])==null?void 0:f.dataset.order)??0)<(((k=r[0])==null?void 0:k.dataset.order)??0)&&(o="prev")),!n.length)return;if(e.dataset.viewPageActive=t,n[0].classList.contains("active")){n[0].dataset.viewPageArgs!==s&&n.forEach(d=>{d.dataset.viewPageArgs=s}),j(e,n,t,i),T(e,n,t,i);return}n.forEach(d=>{d.dataset.viewPageArgs=s}),r.forEach(d=>{d.querySelector(".top-popup-wrapper")&&I.TopPopupWorker.close(d.querySelector(".top-popup-wrapper"))});const p=n[0].closest(".ui-dialog");switch(p&&!l.isVisible(p)&&(o="none"),r.length||(o="none"),l.isVisible(n[0])&&(o="none"),o){case"prev":{n.forEach(d=>{var g,w;const h=(g=d.parentNode)==null?void 0:g.querySelector(":scope > .active");h&&((w=d.parentNode)==null||w.insertBefore(d,h))}),r.forEach(d=>{d.classList.add("right-to-center","reverse")}),n.forEach(d=>{d.classList.add("center-to-left","reverse")});break}case"next":{n.forEach(d=>{var g,w;const h=(g=d.parentNode)==null?void 0:g.querySelector(":scope > .active");h&&((w=d.parentNode)==null||w.insertBefore(d,h.nextSibling))}),r.forEach(d=>{d==null||d.classList.add("center-to-left")}),n.forEach(d=>{d.classList.add("right-to-center")});break}}if(e.setAttribute("view-page-active",t),r.forEach(d=>{d.classList.remove("active")}),n.forEach(d=>{d.classList.add("active")}),j(e,n,t,i),o){e.classList.add("i-change-page");const d=Number(window.getComputedStyle(n[0]).animationDuration.replace("s",""))*1e3;V=setTimeout(function(){x(e.getAttribute("id"),t,""),B(e),T(e,n,t,i)},d)}else await x(e.getAttribute("id"),t,""),T(e,n,t,i)},D=e=>{var r;const a=(r=l.querySelectorAllArray(e,".modal-layer").reduce((n,s)=>{const p=s.querySelector(":scope > .active");return p&&n.push(p),n},[]).reduce((n,s)=>{let p=s.previousElementSibling;for(;p&&!p.hasAttribute("[data-view-page]");)p=p.previousElementSibling;return p&&n.push(p),n},[])[0])==null?void 0:r.dataset.viewPage;a?A(e,a,void 0,"prev"):$(e).dialog("close")},S=new Set,j=(e,t,i,o)=>{const a=e.getAttribute("id")+t[0].dataset.viewPage+i+o.join();S.has(a)||(S.add(a),setTimeout(function(){S.delete(a),$(e).trigger("viewBeforeOpen",[$(e),$(t),i,o])}))},T=(e,t,i,o)=>{setTimeout(function(){$(e).trigger("viewAfterOpen",[$(e),$(t),i,o])})},M=e=>(m(e)&&(e=e==null?void 0:e[0]),e.classList.contains("i-change-page")),B=e=>{if(!M(e))return!1;clearTimeout(V);const t=l.querySelectorAllArray(e,".modal-layer"),i=e.dataset.viewPageActive;return e.classList.remove("i-change-page"),t.forEach(o=>{o.querySelectorAll(":scope > [data-view-page]").forEach(a=>{a.classList.remove("center-to-left","right-to-center","reverse","active")})}),t.forEach(o=>{var a;(a=o.querySelector(`:scope > [data-view-page="${i}"]`))==null||a.classList.add("active")}),!0},v={getElDialogById:y,updatePageVue:x,recalcPositions:z,toViewDirty:N,toView:C,toViewPage:A,toPrevPage:D,setLoading:(e,t,i)=>{m(e)&&(e=e.toArray());const o=e.reduce((a,r)=>(r.hasAttribute("[data-view-page]")&&l.isVisible(r)&&a.push(r),a),[]);t?(i!==void 0&&o.forEach(a=>{a.style.setProperty("--dialog-loading-duration",i+"s")}),o.forEach(a=>{a.classList.add("i-load-data")})):(o.forEach(a=>{a.classList.remove("i-load-data")}),o.forEach(a=>{a.style.setProperty("--dialog-loading-duration","10s")}))},isLoading:e=>(m(e)&&(e=e==null?void 0:e[0]),e.classList.contains("i-load-data")),inAnimation:M,close:function(e){const t=y(e);if(!t)return;const i=$(t);i.dialog("instance")&&i.dialog("close")}};Z(),P.TopDialogUtils=v,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
-
//# sourceMappingURL=utils-DQvj_C9w.amd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils-DQvj_C9w.amd.js","sources":["../../src/components/dialog/lib/utils.globalEvents.ts","../../src/components/dialog/lib/utils.ts"],"sourcesContent":["import { TopDialogUtils } from './utils';\nimport { TopDialogWorker } from './worker';\nimport { isVisible, querySelectorAllArray, querySelectorVisible } from '@/core/utils/dom';\nimport { historySetState } from '@/core/utils/route';\nimport type { ElTopDialog, ElTopDialogWrapper } from '@/components/dialog/lib/types';\n\nlet inited = false;\n\n/**\n * Инициализация глобальных событий для диалоговых окон\n *\n * Производится один раз при подключении диалогового окна\n *\n * События не размонтируются\n */\nexport const initDialogGlobalEvents = () => {\n\tif (inited) return;\n\tinited = true;\n\n\t/**\n\t * Закрытие диалога по Esc\n\t */\n\tdocument.addEventListener('keydown', (e) => {\n\t\tif (e.key !== 'Escape') return;\n\t\tif (!e.target) return;\n\n\t\tconst el = e.target as HTMLElement;\n\n\t\t// событие произошло вне диалогового окна\n\t\tif (!el.closest('.ui-dialog')) return;\n\n\t\tif (el.contentEditable === 'true' || el.contentEditable === 'plaintext-only') return;\n\n\t\t// не закрывать окно при открытом TopPopup\n\t\tif (querySelectorVisible(document.documentElement, '.top-popup-wrapper')) return;\n\n\t\t// не закрывать окно при работе с jquery autocomplete\n\t\tif (el.classList.contains('autocomplete')) return;\n\n\t\t// не закрывать окно при открытом fancybox\n\t\tif (querySelectorVisible(document.documentElement, '.fancybox-container')) return;\n\n\t\tconst elDialogs = querySelectorAllArray<ElTopDialog>(document, '.ui-dialog-content').filter((elDialog) => {\n\t\t\treturn isVisible(elDialog);\n\t\t});\n\n\t\t$(elDialogs[elDialogs.length - 1]).dialog('close');\n\t});\n\n\t/**\n\t * Закрытие диалога по кнопке закрыть\n\t */\n\tdocument.addEventListener('click', (e) => {\n\t\t// // навигация без истории\n\t\t// var $dialog = $(this).closest('.ui-dialog-content');\n\t\t// var viewName = $dialog.attr('id');\n\t\t// var pageName = getHash('view-' + viewName);\n\t\t// if (!pageName) {\n\t\t// \ttoPrevPage($dialog);\n\t\t//\n\t\t// \treturn;\n\t\t// }\n\t\t//\n\t\t// // навигация по истории\n\t\t// if (Core.state.isMobile && history.length > 1 && $(this).closest('.modal-layer').length) {\n\t\t// \tvar href = location.href;\n\t\t//\n\t\t// \thistory.go(-1);\n\t\t//\n\t\t// \tsetTimeout(() => {\n\t\t// \t\t// это первая страница в истории вкладки браузера\n\t\t// \t\tif (href === location.href) $(e.target).closest('.ui-dialog-content').dialog('close');\n\t\t// \t});\n\t\t// } else {\n\t\t// \t$(this).closest('.ui-dialog-content').dialog('close');\n\t\t// }\n\n\t\tconst el = (e.target as HTMLElement).closest('[data-action=\"top-dialog-close\"]') as HTMLElement | null;\n\t\tif (!el) return;\n\n\t\te.preventDefault();\n\n\t\tconst elDialog = el.closest<ElTopDialog>('.ui-dialog-content');\n\t\tif (!elDialog) return;\n\n\t\t// если к кнопке привязана ссылка, диалоговое окно не нужно закрывать\n\t\tconst toView = el.dataset.toView;\n\n\t\tif (toView == 'toPrevPage()') {\n\t\t\tTopDialogUtils.toPrevPage(elDialog);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (toView) {\n\t\t\tconst viewNameAndPageLink = toView.split('-');\n\t\t\tconst viewName = viewNameAndPageLink.shift();\n\t\t\tconst pageLink = viewNameAndPageLink.join('-');\n\n\t\t\tif (!viewName) return;\n\n\t\t\tconst elDialog = TopDialogUtils.getElDialogById(viewName);\n\t\t\tif (!elDialog) return;\n\n\t\t\tconst elToPages = querySelectorAllArray(elDialog, `[data-view-page=\"${pageLink}\"]`);\n\t\t\tif (!elToPages) return;\n\n\t\t\tif (!isVisible(elToPages[0])) {\n\t\t\t\tconst hash = TopDialogWorker.genViewPageHash(toView, 'prev');\n\n\t\t\t\t// // не убирает кнопку \"Вперед\" в браузере\n\t\t\t\t// history.replaceState(null, '', hash);\n\t\t\t\t// toViewDirty(toView, 'prev');\n\n\t\t\t\t// // добавляет текущую страницу в историю браузера\n\t\t\t\thistorySetState(false, hash);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst $dialog = $(elDialog);\n\n\t\t$dialog.dialog('close');\n\t});\n\n\t/**\n\t * Все submit должны обрабатываться через js\n\t */\n\tdocument.addEventListener('submit', (e) => {\n\t\tconst elForm = e.target as HTMLElement;\n\n\t\tif (elForm.matches('.modal-body > form') || elForm.matches('.modal-layer-body > form')) {\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\n\t/**\n\t * Выполнение действия по нажатию Enter\n\t *\n\t * @todo Убрать `.searcher`\n\t */\n\tdocument.addEventListener('keypress', (e) => {\n\t\tconst eventTarget = e.target as HTMLElement;\n\n\t\tconst elModalBody = eventTarget.closest('.ui-dialog .modal-body');\n\t\tif (!elModalBody) return;\n\n\t\tconst isInput =\n\t\t\teventTarget.matches('input:not(.searcher), textarea:not(.searcher), select:not(.searcher), button:not(.searcher)')\n\t\t\t|| eventTarget.hasAttribute('contenteditable');\n\t\tif (!isInput) return;\n\n\t\t// if (e.keyCode !== 10 && e.key !== 'ENTER') return;\n\t\tif (e.key !== 'Enter') return;\n\n\t\t// не выполнять submit действий при работе с jquery autocomplete\n\t\tif (eventTarget.classList.contains('autocomplete')) {\n\t\t\te.preventDefault();\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (eventTarget.tagName === 'TEXTAREA') {\n\t\t\tif (!e.ctrlKey && !e.metaKey) return;\n\n\t\t\tconst elForm = eventTarget.closest('form');\n\n\t\t\tif (elForm) {\n\t\t\t\t// Find visible submit buttons\n\t\t\t\tconst elSubmitButton = querySelectorAllArray(elForm, 'button[type=\"submit\"]')\n\t\t\t\t\t.concat(querySelectorAllArray(elForm, 'input[type=\"submit\"]'))\n\t\t\t\t\t.find((elSubmitButton) => {\n\t\t\t\t\t\treturn isVisible(elSubmitButton);\n\t\t\t\t\t});\n\n\t\t\t\telSubmitButton?.click();\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * Закрытие диалога по клику вне окна\n\t */\n\tdocument.addEventListener('click', function (event) {\n\t\tconst eventTarget = event.target as HTMLElement;\n\n\t\tif (!eventTarget.classList.contains('ui-widget-overlay')) return;\n\n\t\tlet elDialogWrapperWithTopZIndex: ElTopDialogWrapper | undefined;\n\t\tlet topZIndex = 0;\n\n\t\tconst elDialogWrapperVisibles = querySelectorAllArray<ElTopDialogWrapper>(document, '.ui-dialog').filter((elDialogWrapper) => {\n\t\t\treturn isVisible(elDialogWrapper);\n\t\t});\n\n\t\telDialogWrapperVisibles.forEach((elDialogWrapper) => {\n\t\t\tconst zIndex = Number(window.getComputedStyle(elDialogWrapper).zIndex);\n\t\t\tif (zIndex < topZIndex) return;\n\n\t\t\telDialogWrapperWithTopZIndex = elDialogWrapper;\n\t\t\ttopZIndex = zIndex;\n\t\t});\n\n\t\tif (elDialogWrapperWithTopZIndex) {\n\t\t\tconst elDialog = elDialogWrapperWithTopZIndex.querySelector('.ui-dialog-content');\n\n\t\t\t$(elDialog).dialog('close');\n\t\t}\n\t});\n\n\twindow.addEventListener('resize', TopDialogUtils.recalcPositions);\n\tTopDialogUtils.recalcPositions();\n};\n","import 'jquery';\nimport { nextTick } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { TopPopupWorker } from '@/components/popup/worker';\nimport { sleep, waitWhile } from '@/core/utils/system';\nimport { setHashs } from '@/core/utils/route';\nimport { connectScrollShadow } from '@/core/utils/scroll';\n\nimport type { ElTopDialog, ElTopDialogBody, ElTopDialogModalLayer, ElTopDialogPage, ElTopDialogWrapper, MoveDirection } from './types';\nimport { TopDialogWorker } from './worker';\nimport { initDialogGlobalEvents } from './utils.globalEvents';\nimport { getDialogWorker } from '../dialog/dialogs/dialogs.vue';\n\nimport css from '../dialog/style/dialog.css?inline';\nimport cssM from '../dialog/style/dialog.m.css?inline';\nimport cssPC from '../dialog/style/dialog.pc.css?inline';\nimport cssModern from '../dialog/style/modern/dialog.css?inline';\nimport cssModernPC from '../dialog/style/modern/dialog.pc.css?inline';\nimport { isVisible, querySelectorAllArray } from '@/core/utils/dom';\n\nCore.insertStyleToPage(css);\nCore.insertStyleToPage(cssM, 'm');\nCore.insertStyleToPage(cssPC, 'pc');\nCore.insertStyleToPage(cssModern);\nCore.insertStyleToPage(cssModernPC, 'pc');\n\nlet timerClearAnimation: NodeJS.Timeout;\nlet isInited = false;\n\n/**\n * Является ли элемент JQuery<HTMLElement>\n */\nconst isElJQuery = (el: JQuery<HTMLElement> | HTMLElement | HTMLElement[]) => {\n\treturn !!el && typeof el === 'object' && 'jquery' in el;\n};\n\nconst init = () => {\n\t$.extend($.ui.dialog.prototype.options, {\n\t\tfocus: (e: any) => {\n\t\t\te.target.focus();\n\n\t\t\t$('[autofocus]', e.target)[0]?.focus();\n\n\t\t\t// setTimeout(function () {\n\t\t\t// \tif ($('[autofocus]', e.target).length) return;\n\t\t\t// \t$('.modal-footer button:first, .modal-body :input:first', e.target).eq(0).focus();\n\t\t\t//\n\t\t\t// \t// fix пропадающего autocomplete при нажатии на scroll в autocomplete\n\t\t\t// \t$(e.target).add($(e.target).closest('.ui-dialog')).removeAttr('tabindex');\n\t\t\t// });\n\t\t},\n\t\tcreate: (e: any) => onCreate(e.target),\n\t\topen: (e: any) => onOpen(e.target),\n\t\tclose: (e: any) => onClose(e.target),\n\t\tmodal: true,\n\t\tresizable: false,\n\t\tcloseOnEscape: false,\n\t\twidth: 'auto',\n\t\tminHeight: 0,\n\t});\n\n\t$.ui.dialog.prototype._focusTabbable = $.noop;\n\n\t$.ui.dialog.prototype._moveToTopOriginal = $.ui.dialog.prototype._moveToTop;\n\t$.ui.dialog.prototype._moveToTop = function () {\n\t\tthis._moveToTopOriginal();\n\n\t\tconst $dialog = $(this.element);\n\t\t$dialog.trigger('dialogsMoveToTop', [$dialog]);\n\t};\n\n\tinitDialogGlobalEvents();\n\n\tisInited = true;\n};\n\n/**\n * Получить настройки диалогового окна из Vue компонента\n */\nconst genVueOptions = (elDialog: ElTopDialog) => {\n\tconst options: {\n\t\tmodal?: boolean,\n\t\tposition?: any,\n\t} = {};\n\n\tif (elDialog.dataset?.modal === 'false') options.modal = false;\n\tif (elDialog.dataset?.position) options.position = JSON.parse(elDialog.dataset.position);\n\n\treturn options;\n};\n\nconst getElDialogById = (id: string) => {\n\treturn <ElTopDialog | null>document.getElementById(id);\n};\n\n/**\n * Сменить состояние диалогового окна Vue\n */\nconst updatePageVue = async (dialogId: string, pageName?: string, pageNameNext?: string) => {\n\tif (!dialogId.startsWith('dialog_')) return;\n\n\tconst dialog = getDialogWorker(dialogId);\n\tif (!dialog) return;\n\n\tdialog.isOpened.value = true;\n\tif (pageName !== undefined) dialog.pageActive.value = pageName;\n\tif (pageNameNext !== undefined) dialog.pageActiveNext.value = pageNameNext;\n\n\tawait nextTick();\n\n\tif (pageNameNext) {\n\t\tconst elDialog = getElDialogById(dialogId);\n\t\tif (!elDialog) return;\n\n\t\tconst elNextpages = elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`);\n\n\t\tif (!elNextpages.length) {\n\t\t\tawait waitWhile(() => !elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`).length);\n\t\t}\n\t}\n};\n\n/**\n * Callback for jQuery dialog onCreate\n */\nconst onCreate = (elDialog: ElTopDialog) => {\n\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\tif (!elDialogBody) return;\n\n\tconnectScrollShadow(elDialogBody);\n\n\tTopDialogWorker.state.decoratorOnCreate?.(elDialog);\n\n\tinitPopup(elDialog);\n};\n\n/**\n * Инициирование событий TopPopup в диалоговом окне\n */\nconst initPopup = (elDialog: HTMLElement) => {\n\t$(elDialog).on('aftershow.top-menu-popup', '[data-top-popup]', (_e, $popup) => {\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPopup = $popup[0];\n\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPageContents = TopDialogWorker.getPairPage(elPopup);\n\t\telPageContents?.[1]?.prepend(elPopup);\n\t});\n};\n\n/**\n * Callback for jQuery dialog onOpen\n */\nconst onOpen = async (elDialog: ElTopDialog) => {\n\tconst pageName = elDialog.dataset.viewPageActive;\n\n\tconst w1 = window.innerWidth;\n\n\tCore.state.documentClassModificators.set('top-dialog', 'with_dialog');\n\n\tconst w2 = window.innerWidth;\n\n\tconst scrollBarWidth = w2 - w1;\n\tif (document.documentElement.scrollHeight > window.innerHeight) document.querySelector('html')!.style.marginRight = scrollBarWidth + 'px';\n\n\trecalcPositions();\n\n\tconst dialog = getDialogWorker(elDialog.getAttribute('id')!);\n\tdialog?.emit?.('open', pageName);\n};\n\n/**\n * Callback for jQuery dialog onClose\n */\nconst onClose = async (elDialog: ElTopDialog) => {\n\tconst viewName = elDialog.getAttribute('id');\n\tconst pageName = elDialog.dataset.viewPageActive;\n\n\tif (pageName) {\n\t\tconst hashData = {\n\t\t\tvpn: TopDialogWorker.state.viewPageN as number | null,\n\t\t\t['view-' + viewName]: null,\n\t\t};\n\t\thashData['view-' + viewName] = null;\n\n\t\tif (TopDialogWorker.state.viewPageN === 0 || TopDialogWorker.state.viewPageN === 1) {\n\t\t\thashData.vpn = null;\n\t\t}\n\n\t\tsetHashs(hashData, false);\n\t}\n\n\tconst elUiWidgetOverlayVisibles = querySelectorAllArray(document, '.ui-widget-overlay').filter((el) => {\n\t\treturn isVisible(el);\n\t});\n\n\tif (!elUiWidgetOverlayVisibles.length) {\n\t\tCore.state.documentClassModificators.delete('top-dialog');\n\n\t\tdocument.querySelector('html')!.style.marginRight = '';\n\t}\n\n\t$(elDialog).trigger('viewAfterClose', [$(elDialog)]);\n\n\tconst dialog = getDialogWorker(viewName);\n\n\tif (dialog) {\n\t\tdialog.isOpened.value = false;\n\t\tdialog.emit?.('close', pageName);\n\n\t\tif (dialog.onCloseOnce) {\n\t\t\tdialog.onCloseOnce(dialog.props, pageName);\n\t\t\tdialog.onCloseOnce = undefined;\n\t\t}\n\t}\n\n\t// после закрытия диалога может потребоваться пересчет позиций элементов\n\twindow.dispatchEvent(new Event('resize'));\n};\n\n/**\n * Пересчитать положения и размеры открытых диалоговых окон\n */\nconst recalcPositions = () => {\n\tconst elDialogVisibilityes = querySelectorAllArray(document, '.ui-dialog').filter((el) => {\n\t\treturn isVisible(el) && el.querySelector<ElTopDialog>(':scope > .ui-dialog-content');\n\t}).map((el) => {\n\t\treturn el.querySelector<ElTopDialog>(':scope > .ui-dialog-content')!;\n\t});\n\n\telDialogVisibilityes.forEach((elDialog) => {\n\t\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\t\tif (!elDialogBody) return;\n\n\t\tconst elDialogWrapper = elDialog.closest('.ui-dialog');\n\n\t\tconst options = genVueOptions(elDialog);\n\n\t\toptions.position ??= { of: window };\n\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('option', options);\n\n\t\telDialogWrapper.classList.remove('me-tightly');\n\t\tif ((elDialogWrapper.clientHeight ?? 0) > window.innerHeight) elDialogWrapper.classList.add('me-tightly');\n\t});\n};\n\n/**\n * Переход к view page по неразобранной ссылке в формате: {viewName}-{pageName}[:args]\n */\nconst toViewDirty = async (toViewPageName: string, moveDirection?: MoveDirection) => {\n\tconst regexp = /(\\w+)[=-]([\\w-]+)(?::([\\w.:-]+))?/g;\n\tconst toViewParts = regexp.exec(toViewPageName);\n\tif (toViewParts) {\n\t\tconst viewName = toViewParts[1];\n\t\tconst pageName = toViewParts[2];\n\t\tconst argsString = toViewParts[3];\n\n\t\tlet args: string[] = [];\n\t\tif (argsString) args = argsString.split(':');\n\n\t\tawait toView(viewName, pageName, args, moveDirection);\n\t}\n};\n\n/**\n * Открыть диалоговое окно, возможно указать нужную страницу\n * @param viewNameOrElDialog - id страницы окна или элемент окна\n * @param pageName - имя страницы\n * @param args - аргументы, набор проивзольных параметров, которые могут обрабатываться каждым окном по своему\n * @param moveDirection\n * @param callback - функция, которая будет запущена после октытия страницы\n */\nconst toView = async (\n\tviewNameOrElDialog: ElTopDialog | JQuery<ElTopDialog> | string,\n\tpageName?: string,\n\targs?: string[],\n\tmoveDirection?: MoveDirection,\n\tcallback?: Function,\n) => {\n\tif (!isInited) {\n\t\tawait new Promise<void>((resolve, _reject) => {\n\t\t\tconst timer = setInterval(() => {\n\t\t\t\tif (!isInited) return;\n\n\t\t\t\tclearInterval(timer);\n\n\t\t\t\tresolve();\n\t\t\t}, 10);\n\t\t});\n\t}\n\n\tawait nextTick();\n\n\tlet elDialog: ElTopDialog | null;\n\tif (typeof (viewNameOrElDialog) === 'object') {\n\t\tif (isElJQuery(viewNameOrElDialog)) viewNameOrElDialog = viewNameOrElDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\t\telDialog = viewNameOrElDialog;\n\t} else {\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t}\n\n\t// Диалоговое окно еще не загружено\n\tif (!elDialog && typeof viewNameOrElDialog === 'string' && TopDialogWorker.state.load) {\n\t\tawait TopDialogWorker.state.load(viewNameOrElDialog);\n\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t\tif (!elDialog) {\n\t\t\tthrow new Error('Dialog no exists: ' + viewNameOrElDialog);\n\t\t}\n\t}\n\n\tif (!elDialog) return;\n\n\tawait toViewPage(elDialog, pageName, args, moveDirection);\n\n\tconst $dialog = $(elDialog);\n\n\tif (elDialog?.classList.contains('ui-dialog-content')) {\n\t\t// var zIndexMax = 0;\n\t\t// $.map($('.ui-dialog'), function (el) {\n\t\t// \tvar zIndex = $(el).css('z-index') * 1;\n\t\t// \tif (zIndex > zIndexMax) zIndexMax = zIndex;\n\t\t// });\n\t\t//\n\t\t// if ($dialog.is(':hidden')) $dialog.dialog('open');\n\t\t//\n\t\t// var $dialogWrapper = $dialog.parent();\n\t\t// var $dialogOverlay = $dialogWrapper.next();\n\t\t//\n\t\t// if ($dialogWrapper.css('z-index') * 1 < zIndexMax) {\n\t\t// \t$dialogWrapper.css('z-index', zIndexMax + 2);\n\t\t// \t$dialogOverlay.css('z-index', zIndexMax + 1);\n\t\t// }\n\n\t\t$dialog.dialog('open');\n\t} else {\n\t\tconst options = genVueOptions(elDialog);\n\n\t\t$dialog.dialog(options);\n\t}\n\n\tif (callback) callback($dialog);\n};\n\nconst toViewPage = async (elDialog: ElTopDialog | JQuery<ElTopDialog>, pageName?: string, args?: string[], moveDirection?: MoveDirection) => {\n\t// todo: убрать после переписки jquery на сайте\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0];\n\n\tif (pageName === undefined) pageName = elDialog.dataset.viewPageActive;\n\n\tif (pageName !== elDialog.dataset.viewPageActive) {\n\t\tconst stopped = stopAnimations(elDialog);\n\t\tif (stopped) await sleep(100);\n\t}\n\n\tif (args === undefined) args = [];\n\n\tawait updatePageVue(elDialog.getAttribute('id') as string, undefined, pageName);\n\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elNextPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elNextPage = elModalLayer.querySelector<ElTopDialogPage>(`:scope > [data-view-page=\"${pageName}\"]`);\n\t\tif (elNextPage) {\n\t\t\tacc.push(elNextPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst argsString = args.join(':');\n\n\tif (moveDirection === undefined) {\n\t\tmoveDirection = 'next';\n\t\tif ((elNextPages[0]?.dataset.order ?? 0) < (elCurrentPages[0]?.dataset.order ?? 0)) moveDirection = 'prev';\n\t}\n\n\tif (!elNextPages.length) return;\n\n\telDialog.dataset.viewPageActive = pageName;\n\n\t// запрашиваемая страница уже открыта\n\tif (elNextPages[0].classList.contains('active')) {\n\t\tif (elNextPages[0].dataset.viewPageArgs !== argsString) {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.dataset.viewPageArgs = argsString;\n\t\t\t});\n\n\t\t\t// dialogs.beforeOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t\t// dialogs.afterOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t}\n\n\t\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\t\treturn;\n\t}\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.dataset.viewPageArgs = argsString;\n\t});\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\tif (elCurrentPage.querySelector('.top-popup-wrapper')) {\n\t\t\tTopPopupWorker.close(elCurrentPage.querySelector('.top-popup-wrapper')!);\n\t\t}\n\t});\n\n\tconst elDialogWrapper = elNextPages[0].closest<ElTopDialogWrapper>('.ui-dialog');\n\n\tif (elDialogWrapper && !isVisible(elDialogWrapper)) moveDirection = 'none';\n\tif (!elCurrentPages.length) moveDirection = 'none';\n\tif (isVisible(elNextPages[0])) moveDirection = 'none';\n\n\tswitch (moveDirection) {\n\t\tcase 'prev': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage.classList.add('right-to-center', 'reverse');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('center-to-left', 'reverse');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t\tcase 'next': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive.nextSibling);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage?.classList.add('center-to-left');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('right-to-center');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\telDialog.setAttribute('view-page-active', pageName);\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\telCurrentPage.classList.remove('active');\n\t});\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.classList.add('active');\n\t});\n\n\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\tif (moveDirection) {\n\t\telDialog.classList.add('i-change-page');\n\n\t\tconst delay = Number(window.getComputedStyle(elNextPages[0]).animationDuration.replace('s', '')) * 1000;\n\n\t\ttimerClearAnimation = setTimeout(function () {\n\t\t\tupdatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\t\tstopAnimations(elDialog);\n\t\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\t}, delay);\n\t} else {\n\t\tawait updatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t}\n};\n\n/**\n * К предыдущему представлению\n */\nconst toPrevPage = (elDialog: ElTopDialog) => {\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elPrevPages = elCurrentPages.reduce<ElTopDialogPage[]>((acc, elCurrentPage) => {\n\t\tlet elPrevPage = elCurrentPage.previousElementSibling as ElTopDialogPage | null;\n\t\twhile (elPrevPage && !elPrevPage.hasAttribute('[data-view-page]')) {\n\t\t\telPrevPage = elPrevPage.previousElementSibling as ElTopDialogPage | null;\n\t\t}\n\n\t\tif (elPrevPage) acc.push(elPrevPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tconst prevPageName = (elPrevPages[0])?.dataset.viewPage;\n\n\tif (prevPageName) {\n\t\tvoid toViewPage(elDialog, prevPageName, undefined, 'prev');\n\t} else {\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('close');\n\t}\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst beforeOpenViewPageTimers = new Set();\nconst beforeOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\t// группировка цепочки событий\n\t// запрос на открытие страницы может выполняться несколько раз, чаще такое может быть при открытии, загрузке и переходе сразу к нужной странице\n\tconst eventKey = elDialog.getAttribute('id') + elPages[0].dataset.viewPage + pageName + args.join();\n\n\tif (beforeOpenViewPageTimers.has(eventKey)) return;\n\tbeforeOpenViewPageTimers.add(eventKey);\n\n\tsetTimeout(function () {\n\t\tbeforeOpenViewPageTimers.delete(eventKey);\n\n\t\t$(elDialog).trigger('viewBeforeOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst afterOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\tsetTimeout(function () {\n\t\t$(elDialog).trigger('viewAfterOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Получить состояние: Диалоговое окно находится в состоянии смены страницы\n */\nconst inAnimation = (elDialog: ElTopDialog | JQuery<ElTopDialog>) => {\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elDialog.classList.contains('i-change-page');\n};\n\n/**\n * Остановить анимацию смены страницы\n *\n * @returns Вернет true, если анимация производилась и была остановлена\n */\nconst stopAnimations = (elDialog: ElTopDialog) => {\n\tif (!inAnimation(elDialog)) return false;\n\n\tclearTimeout(timerClearAnimation);\n\n\tconst elModalLayers = querySelectorAllArray(elDialog, '.modal-layer');\n\n\tconst pageName = elDialog.dataset.viewPageActive;\n\telDialog.classList.remove('i-change-page');\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelectorAll(':scope > [data-view-page]').forEach((el) => {\n\t\t\tel.classList.remove('center-to-left', 'right-to-center', 'reverse', 'active');\n\t\t});\n\t});\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelector(`:scope > [data-view-page=\"${pageName}\"]`)?.classList.add('active');\n\t});\n\n\treturn true;\n};\n\n/**\n * Закрыть диалоговое окно\n */\nconst close = function (dialogId: string) {\n\tconst elDialog = getElDialogById(dialogId);\n\tif (!elDialog) return;\n\n\tconst $dialog = $(elDialog);\n\n\tif (!$dialog.dialog('instance')) return;\n\n\t$dialog.dialog('close');\n};\n\n/**\n * Управление props.isLoading\n */\nconst setLoading = (elPages: ElTopDialogPage[] | JQuery<ElTopDialogPage>, isLoading: boolean, duration?: number) => {\n\tif (isElJQuery(elPages)) elPages = elPages.toArray(); // todo: убрать после переписки jquery на сайте\n\n\tconst elPagesVisibleds = elPages.reduce<ElTopDialogPage[]>((acc, elPage) => {\n\t\tif (elPage.hasAttribute('[data-view-page]') && isVisible(elPage)) acc.push(elPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tif (isLoading) {\n\t\tif (duration !== undefined) {\n\t\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', duration + 's');\n\t\t\t});\n\t\t}\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.add('i-load-data');\n\t\t});\n\t} else {\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.remove('i-load-data');\n\t\t});\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', '10s');\n\t\t});\n\t}\n};\n\nconst isLoading = (elPage: ElTopDialogPage | JQuery<ElTopDialogPage>) => {\n\tif (isElJQuery(elPage)) elPage = elPage?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elPage.classList.contains('i-load-data');\n};\n\nexport const TopDialogUtils = {\n\tgetElDialogById,\n\tupdatePageVue,\n\trecalcPositions,\n\ttoViewDirty,\n\ttoView,\n\ttoViewPage,\n\ttoPrevPage,\n\tsetLoading,\n\tisLoading,\n\tinAnimation,\n\tclose,\n};\n\ninit();\n"],"names":["el","elDialogs","utils_dom","elDialog","toView","TopDialogUtils","viewName","viewNameAndPageLink","elToPages","elDialog2","pageLink","utils_route","hash","elForm","eventTarget","elSubmitButton2","event","elDialogWrapperWithTopZIndex","elDialogWrapper","zIndex","topZIndex","Core","timerClearAnimation","isElJQuery","_a","initDialogGlobalEvents","genVueOptions","options","getElDialogById","id","dialog","dialogs_vue_vue_type_script_setup_true_lang","dialogId","pageNameNext","utils_system","onCreate","_b","initPopup","_e","$popup","elPopup","onOpen","pageName","w1","scrollBarWidth","recalcPositions","onClose","hashData","toViewDirty","toViewPageName","moveDirection","toViewParts","argsString","viewNameOrElDialog","args","callback","timer","resolve","$dialog","stopAnimations","updatePageVue","acc","elCurrentPage","elNextPage","elModalLayer","elNextPages","elCurrentPages","elActive","toPrevPage","elPrevPage","beforeOpenViewPageTimers","eventKey","inAnimation","elModalLayers","toViewPage","elPage","duration","elPagesVisibleds","elPagesVisibled","init"],"mappings":"wXAwBE,GADA,EAAA,MAAA,UACA,CAAA,EAAA,OAAA,OAEA,MAAAA,EAAA,EAAA,oCAKAA,EAAA,kBAAA,QAAAA,EAAA,kBAAA,6MAWA,MAAAC,EAAAC,EAAA,sBAAA,SAAA,oBAAA,EAAA,OAAAC,GACCD,EAAA,UAAAC,CAAA,CAAyB,EAG1B,EAAAF,EAAAA,EAAA,OAAA,CAAA,CAAA,EAAA,OAAA,OAAA,CAAiD,CAAA,0LAwCjD,MAAAG,EAAAJ,EAAA,QAAA,OAEA,GAAAI,GAAA,eAAA,CACCC,EAAA,WAAAF,CAAA,oCAOAG,EAAAC,EAAA,MAAA,uEAQA,MAAAC,EAAAN,EAAA,sBAAAO,EAAA,oBAAAC,CAAA,IAAA,0FAWCC,EAAA,gBAAA,GAAAC,CAAA,UAMF,EAAAT,CAAA,EAEA,OAAA,OAAA,CAAsB,CAAA,yCAOtB,MAAAU,EAAA,EAAA,QAEAA,EAAA,QAAA,oBAAA,GAAAA,EAAA,QAAA,0BAAA,sBAEA,CAAA,2CASA,MAAAC,EAAA,EAAA,oDAKAA,EAAA,QAAA,6FAAA,GAAAA,EAA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AMCA,EAAA,IAAAC,CAAA,IACAD,EAAA,IAAAC,CAAA,wBAGCD,EAAA,OAAAC,CAAA,gDAE+E,CAAA,qFASD,CAAA,GAOhFC,EAAArE,yEAWAwD,EAAAxD,GAAA,qFAOCuC,EAAAvC,EAAA,QAAA,eACA,OAAAA,EAAA,UAAA,OAAA,eAAA,EAEAsE,EAAA,QAAAT,GAAA,6DAEEhE,EAAA,UAAA,OAAA,iBAAA,kBAAA,UAAA,QAAA,CAA4E,CAAA,CAC5E,CAAA,EAGFyE,EAAA,QAAAT,GAAA,QACCxC,EAAAwC,EAAA,cAAA,6BAAAtB,CAAA,IAAA,IAAA,MAAAlB,EAAA,UAAA,IAAA,SAA6F,CAAA,EAG9F,IAwDMnB,EAAA,CAAuB,gBAAAuB,EAC7B,cAAAgC,EACA,gBAAAf,EACA,YAAAG,EACA,OAAA5C,EACA,WAAAsE,EACA,WAAAN,EACA,oEAvCCO,EAAA,aAAA,kBAAA,GAAAzE,EAAA,UAAAyE,CAAA,GAAAd,EAAA,KAAAc,CAAA,EAEAd,UAIAe,IAAA,QACCC,EAAA,QAAAC,GAAA,uDAC8E,CAAA,EAI/ED,EAAA,QAAAC,GAAA,CACCA,EAAA,UAAA,IAAA,aAAA,CAA2C,CAAA,IAG5CD,EAAA,QAAAC,GAAA,CACCA,EAAA,UAAA,OAAA,aAAA,CAA8C,CAAA,EAG/CD,EAAA,QAAAC,GAAA,uDACqE,CAAA,IAmBtE,UAdDH,uEAeC,YAAAH,QA3DD,SAAAxC,EAAA,CACC,MAAA7B,EAAAyB,EAAAI,CAAA,eAGA,MAAA0B,EAAA,EAAAvD,CAAA,wBAIAuD,EAAA,OAAA,OAAA,EAsDD,EAEAqB,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils-sKjgHYod.es.js","sources":["../../src/storybook/jquery.ts","../../src/components/dialog/lib/utils.globalEvents.ts","../../src/components/dialog/lib/utils.ts"],"sourcesContent":["/**\n * см. /.storybook/preview-head.html\n */\nexport default $;\n","import { TopDialogUtils } from './utils';\nimport { TopDialogWorker } from './worker';\nimport { isVisible, querySelectorAllArray, querySelectorVisible } from '@/core/utils/dom';\nimport { historySetState } from '@/core/utils/route';\nimport type { ElTopDialog, ElTopDialogWrapper } from '@/components/dialog/lib/types';\n\nlet inited = false;\n\n/**\n * Инициализация глобальных событий для диалоговых окон\n *\n * Производится один раз при подключении диалогового окна\n *\n * События не размонтируются\n */\nexport const initDialogGlobalEvents = () => {\n\tif (inited) return;\n\tinited = true;\n\n\t/**\n\t * Закрытие диалога по Esc\n\t */\n\tdocument.addEventListener('keydown', (e) => {\n\t\tif (e.key !== 'Escape') return;\n\t\tif (!e.target) return;\n\n\t\tconst el = e.target as HTMLElement;\n\n\t\t// событие произошло вне диалогового окна\n\t\tif (!el.closest('.ui-dialog')) return;\n\n\t\tif (el.contentEditable === 'true' || el.contentEditable === 'plaintext-only') return;\n\n\t\t// не закрывать окно при открытом TopPopup\n\t\tif (querySelectorVisible(document.documentElement, '.top-popup-wrapper')) return;\n\n\t\t// не закрывать окно при работе с jquery autocomplete\n\t\tif (el.classList.contains('autocomplete')) return;\n\n\t\t// не закрывать окно при открытом fancybox\n\t\tif (querySelectorVisible(document.documentElement, '.fancybox-container')) return;\n\n\t\tconst elDialogs = querySelectorAllArray<ElTopDialog>(document, '.ui-dialog-content').filter((elDialog) => {\n\t\t\treturn isVisible(elDialog);\n\t\t});\n\n\t\t$(elDialogs[elDialogs.length - 1]).dialog('close');\n\t});\n\n\t/**\n\t * Закрытие диалога по кнопке закрыть\n\t */\n\tdocument.addEventListener('click', (e) => {\n\t\t// // навигация без истории\n\t\t// var $dialog = $(this).closest('.ui-dialog-content');\n\t\t// var viewName = $dialog.attr('id');\n\t\t// var pageName = getHash('view-' + viewName);\n\t\t// if (!pageName) {\n\t\t// \ttoPrevPage($dialog);\n\t\t//\n\t\t// \treturn;\n\t\t// }\n\t\t//\n\t\t// // навигация по истории\n\t\t// if (Core.state.isMobile && history.length > 1 && $(this).closest('.modal-layer').length) {\n\t\t// \tvar href = location.href;\n\t\t//\n\t\t// \thistory.go(-1);\n\t\t//\n\t\t// \tsetTimeout(() => {\n\t\t// \t\t// это первая страница в истории вкладки браузера\n\t\t// \t\tif (href === location.href) $(e.target).closest('.ui-dialog-content').dialog('close');\n\t\t// \t});\n\t\t// } else {\n\t\t// \t$(this).closest('.ui-dialog-content').dialog('close');\n\t\t// }\n\n\t\tconst el = (e.target as HTMLElement).closest('[data-action=\"top-dialog-close\"]') as HTMLElement | null;\n\t\tif (!el) return;\n\n\t\te.preventDefault();\n\n\t\tconst elDialog = el.closest<ElTopDialog>('.ui-dialog-content');\n\t\tif (!elDialog) return;\n\n\t\t// если к кнопке привязана ссылка, диалоговое окно не нужно закрывать\n\t\tconst toView = el.dataset.toView;\n\n\t\tif (toView == 'toPrevPage()') {\n\t\t\tTopDialogUtils.toPrevPage(elDialog);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (toView) {\n\t\t\tconst viewNameAndPageLink = toView.split('-');\n\t\t\tconst viewName = viewNameAndPageLink.shift();\n\t\t\tconst pageLink = viewNameAndPageLink.join('-');\n\n\t\t\tif (!viewName) return;\n\n\t\t\tconst elDialog = TopDialogUtils.getElDialogById(viewName);\n\t\t\tif (!elDialog) return;\n\n\t\t\tconst elToPages = querySelectorAllArray(elDialog, `[data-view-page=\"${pageLink}\"]`);\n\t\t\tif (!elToPages) return;\n\n\t\t\tif (!isVisible(elToPages[0])) {\n\t\t\t\tconst hash = TopDialogWorker.genViewPageHash(toView, 'prev');\n\n\t\t\t\t// // не убирает кнопку \"Вперед\" в браузере\n\t\t\t\t// history.replaceState(null, '', hash);\n\t\t\t\t// toViewDirty(toView, 'prev');\n\n\t\t\t\t// // добавляет текущую страницу в историю браузера\n\t\t\t\thistorySetState(false, hash);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst $dialog = $(elDialog);\n\n\t\t$dialog.dialog('close');\n\t});\n\n\t/**\n\t * Все submit должны обрабатываться через js\n\t */\n\tdocument.addEventListener('submit', (e) => {\n\t\tconst elForm = e.target as HTMLElement;\n\n\t\tif (elForm.matches('.modal-body > form') || elForm.matches('.modal-layer-body > form')) {\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\n\t/**\n\t * Выполнение действия по нажатию Enter\n\t *\n\t * @todo Убрать `.searcher`\n\t */\n\tdocument.addEventListener('keypress', (e) => {\n\t\tconst eventTarget = e.target as HTMLElement;\n\n\t\tconst elModalBody = eventTarget.closest('.ui-dialog .modal-body');\n\t\tif (!elModalBody) return;\n\n\t\tconst isInput =\n\t\t\teventTarget.matches('input:not(.searcher), textarea:not(.searcher), select:not(.searcher), button:not(.searcher)')\n\t\t\t|| eventTarget.hasAttribute('contenteditable');\n\t\tif (!isInput) return;\n\n\t\t// if (e.keyCode !== 10 && e.key !== 'ENTER') return;\n\t\tif (e.key !== 'Enter') return;\n\n\t\t// не выполнять submit действий при работе с jquery autocomplete\n\t\tif (eventTarget.classList.contains('autocomplete')) {\n\t\t\te.preventDefault();\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (eventTarget.tagName === 'TEXTAREA') {\n\t\t\tif (!e.ctrlKey && !e.metaKey) return;\n\n\t\t\tconst elForm = eventTarget.closest('form');\n\n\t\t\tif (elForm) {\n\t\t\t\t// Find visible submit buttons\n\t\t\t\tconst elSubmitButton = querySelectorAllArray(elForm, 'button[type=\"submit\"]')\n\t\t\t\t\t.concat(querySelectorAllArray(elForm, 'input[type=\"submit\"]'))\n\t\t\t\t\t.find((elSubmitButton) => {\n\t\t\t\t\t\treturn isVisible(elSubmitButton);\n\t\t\t\t\t});\n\n\t\t\t\telSubmitButton?.click();\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * Закрытие диалога по клику вне окна\n\t */\n\tdocument.addEventListener('click', function (event) {\n\t\tconst eventTarget = event.target as HTMLElement;\n\n\t\tif (!eventTarget.classList.contains('ui-widget-overlay')) return;\n\n\t\tlet elDialogWrapperWithTopZIndex: ElTopDialogWrapper | undefined;\n\t\tlet topZIndex = 0;\n\n\t\tconst elDialogWrapperVisibles = querySelectorAllArray<ElTopDialogWrapper>(document, '.ui-dialog').filter((elDialogWrapper) => {\n\t\t\treturn isVisible(elDialogWrapper);\n\t\t});\n\n\t\telDialogWrapperVisibles.forEach((elDialogWrapper) => {\n\t\t\tconst zIndex = Number(window.getComputedStyle(elDialogWrapper).zIndex);\n\t\t\tif (zIndex < topZIndex) return;\n\n\t\t\telDialogWrapperWithTopZIndex = elDialogWrapper;\n\t\t\ttopZIndex = zIndex;\n\t\t});\n\n\t\tif (elDialogWrapperWithTopZIndex) {\n\t\t\tconst elDialog = elDialogWrapperWithTopZIndex.querySelector('.ui-dialog-content');\n\n\t\t\t$(elDialog).dialog('close');\n\t\t}\n\t});\n\n\twindow.addEventListener('resize', TopDialogUtils.recalcPositions);\n\tTopDialogUtils.recalcPositions();\n};\n","import 'jquery';\nimport { nextTick } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { TopPopupWorker } from '@/components/popup/worker';\nimport { sleep, waitWhile } from '@/core/utils/system';\nimport { setHashs } from '@/core/utils/route';\nimport { connectScrollShadow } from '@/core/utils/scroll';\n\nimport type { ElTopDialog, ElTopDialogBody, ElTopDialogModalLayer, ElTopDialogPage, ElTopDialogWrapper, MoveDirection } from './types';\nimport { TopDialogWorker } from './worker';\nimport { initDialogGlobalEvents } from './utils.globalEvents';\nimport { getDialogWorker } from '../dialog/dialogs/dialogs.vue';\n\nimport css from '../dialog/style/dialog.css?inline';\nimport cssM from '../dialog/style/dialog.m.css?inline';\nimport cssPC from '../dialog/style/dialog.pc.css?inline';\nimport cssModern from '../dialog/style/modern/dialog.css?inline';\nimport cssModernPC from '../dialog/style/modern/dialog.pc.css?inline';\nimport { isVisible, querySelectorAllArray } from '@/core/utils/dom';\n\nCore.insertStyleToPage(css);\nCore.insertStyleToPage(cssM, 'm');\nCore.insertStyleToPage(cssPC, 'pc');\nCore.insertStyleToPage(cssModern);\nCore.insertStyleToPage(cssModernPC, 'pc');\n\nlet timerClearAnimation: NodeJS.Timeout;\nlet isInited = false;\n\n/**\n * Является ли элемент JQuery<HTMLElement>\n */\nconst isElJQuery = (el: JQuery<HTMLElement> | HTMLElement | HTMLElement[]) => {\n\treturn !!el && typeof el === 'object' && 'jquery' in el;\n};\n\nconst init = () => {\n\t$.extend($.ui.dialog.prototype.options, {\n\t\tfocus: (e: any) => {\n\t\t\te.target.focus();\n\n\t\t\t$('[autofocus]', e.target)[0]?.focus();\n\n\t\t\t// setTimeout(function () {\n\t\t\t// \tif ($('[autofocus]', e.target).length) return;\n\t\t\t// \t$('.modal-footer button:first, .modal-body :input:first', e.target).eq(0).focus();\n\t\t\t//\n\t\t\t// \t// fix пропадающего autocomplete при нажатии на scroll в autocomplete\n\t\t\t// \t$(e.target).add($(e.target).closest('.ui-dialog')).removeAttr('tabindex');\n\t\t\t// });\n\t\t},\n\t\tcreate: (e: any) => onCreate(e.target),\n\t\topen: (e: any) => onOpen(e.target),\n\t\tclose: (e: any) => onClose(e.target),\n\t\tmodal: true,\n\t\tresizable: false,\n\t\tcloseOnEscape: false,\n\t\twidth: 'auto',\n\t\tminHeight: 0,\n\t});\n\n\t$.ui.dialog.prototype._focusTabbable = $.noop;\n\n\t$.ui.dialog.prototype._moveToTopOriginal = $.ui.dialog.prototype._moveToTop;\n\t$.ui.dialog.prototype._moveToTop = function () {\n\t\tthis._moveToTopOriginal();\n\n\t\tconst $dialog = $(this.element);\n\t\t$dialog.trigger('dialogsMoveToTop', [$dialog]);\n\t};\n\n\tinitDialogGlobalEvents();\n\n\tisInited = true;\n};\n\n/**\n * Получить настройки диалогового окна из Vue компонента\n */\nconst genVueOptions = (elDialog: ElTopDialog) => {\n\tconst options: {\n\t\tmodal?: boolean,\n\t\tposition?: any,\n\t} = {};\n\n\tif (elDialog.dataset?.modal === 'false') options.modal = false;\n\tif (elDialog.dataset?.position) options.position = JSON.parse(elDialog.dataset.position);\n\n\treturn options;\n};\n\nconst getElDialogById = (id: string) => {\n\treturn <ElTopDialog | null>document.getElementById(id);\n};\n\n/**\n * Сменить состояние диалогового окна Vue\n */\nconst updatePageVue = async (dialogId: string, pageName?: string, pageNameNext?: string) => {\n\tif (!dialogId.startsWith('dialog_')) return;\n\n\tconst dialog = getDialogWorker(dialogId);\n\tif (!dialog) return;\n\n\tdialog.isOpened.value = true;\n\tif (pageName !== undefined) dialog.pageActive.value = pageName;\n\tif (pageNameNext !== undefined) dialog.pageActiveNext.value = pageNameNext;\n\n\tawait nextTick();\n\n\tif (pageNameNext) {\n\t\tconst elDialog = getElDialogById(dialogId);\n\t\tif (!elDialog) return;\n\n\t\tconst elNextpages = elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`);\n\n\t\tif (!elNextpages.length) {\n\t\t\tawait waitWhile(() => !elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`).length);\n\t\t}\n\t}\n};\n\n/**\n * Callback for jQuery dialog onCreate\n */\nconst onCreate = (elDialog: ElTopDialog) => {\n\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\tif (!elDialogBody) return;\n\n\tconnectScrollShadow(elDialogBody);\n\n\tTopDialogWorker.state.decoratorOnCreate?.(elDialog);\n\n\tinitPopup(elDialog);\n};\n\n/**\n * Инициирование событий TopPopup в диалоговом окне\n */\nconst initPopup = (elDialog: HTMLElement) => {\n\t$(elDialog).on('aftershow.top-menu-popup', '[data-top-popup]', (_e, $popup) => {\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPopup = $popup[0];\n\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPageContents = TopDialogWorker.getPairPage(elPopup);\n\t\telPageContents?.[1]?.prepend(elPopup);\n\t});\n};\n\n/**\n * Callback for jQuery dialog onOpen\n */\nconst onOpen = async (elDialog: ElTopDialog) => {\n\tconst pageName = elDialog.dataset.viewPageActive;\n\n\tconst w1 = window.innerWidth;\n\n\tCore.state.documentClassModificators.set('top-dialog', 'with_dialog');\n\n\tconst w2 = window.innerWidth;\n\n\tconst scrollBarWidth = w2 - w1;\n\tif (document.documentElement.scrollHeight > window.innerHeight) document.querySelector('html')!.style.marginRight = scrollBarWidth + 'px';\n\n\trecalcPositions();\n\n\tconst dialog = getDialogWorker(elDialog.getAttribute('id')!);\n\tdialog?.emit?.('open', pageName);\n};\n\n/**\n * Callback for jQuery dialog onClose\n */\nconst onClose = async (elDialog: ElTopDialog) => {\n\tconst viewName = elDialog.getAttribute('id');\n\tconst pageName = elDialog.dataset.viewPageActive;\n\n\tif (pageName) {\n\t\tconst hashData = {\n\t\t\tvpn: TopDialogWorker.state.viewPageN as number | null,\n\t\t\t['view-' + viewName]: null,\n\t\t};\n\t\thashData['view-' + viewName] = null;\n\n\t\tif (TopDialogWorker.state.viewPageN === 0 || TopDialogWorker.state.viewPageN === 1) {\n\t\t\thashData.vpn = null;\n\t\t}\n\n\t\tsetHashs(hashData, false);\n\t}\n\n\tconst elUiWidgetOverlayVisibles = querySelectorAllArray(document, '.ui-widget-overlay').filter((el) => {\n\t\treturn isVisible(el);\n\t});\n\n\tif (!elUiWidgetOverlayVisibles.length) {\n\t\tCore.state.documentClassModificators.delete('top-dialog');\n\n\t\tdocument.querySelector('html')!.style.marginRight = '';\n\t}\n\n\t$(elDialog).trigger('viewAfterClose', [$(elDialog)]);\n\n\tconst dialog = getDialogWorker(viewName);\n\n\tif (dialog) {\n\t\tdialog.isOpened.value = false;\n\t\tdialog.emit?.('close', pageName);\n\n\t\tif (dialog.onCloseOnce) {\n\t\t\tdialog.onCloseOnce(dialog.props, pageName);\n\t\t\tdialog.onCloseOnce = undefined;\n\t\t}\n\t}\n\n\t// после закрытия диалога может потребоваться пересчет позиций элементов\n\twindow.dispatchEvent(new Event('resize'));\n};\n\n/**\n * Пересчитать положения и размеры открытых диалоговых окон\n */\nconst recalcPositions = () => {\n\tconst elDialogVisibilityes = querySelectorAllArray(document, '.ui-dialog').filter((el) => {\n\t\treturn isVisible(el) && el.querySelector<ElTopDialog>(':scope > .ui-dialog-content');\n\t}).map((el) => {\n\t\treturn el.querySelector<ElTopDialog>(':scope > .ui-dialog-content')!;\n\t});\n\n\telDialogVisibilityes.forEach((elDialog) => {\n\t\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\t\tif (!elDialogBody) return;\n\n\t\tconst elDialogWrapper = elDialog.closest('.ui-dialog');\n\n\t\tconst options = genVueOptions(elDialog);\n\n\t\toptions.position ??= { of: window };\n\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('option', options);\n\n\t\telDialogWrapper.classList.remove('me-tightly');\n\t\tif ((elDialogWrapper.clientHeight ?? 0) > window.innerHeight) elDialogWrapper.classList.add('me-tightly');\n\t});\n};\n\n/**\n * Переход к view page по неразобранной ссылке в формате: {viewName}-{pageName}[:args]\n */\nconst toViewDirty = async (toViewPageName: string, moveDirection?: MoveDirection) => {\n\tconst regexp = /(\\w+)[=-]([\\w-]+)(?::([\\w.:-]+))?/g;\n\tconst toViewParts = regexp.exec(toViewPageName);\n\tif (toViewParts) {\n\t\tconst viewName = toViewParts[1];\n\t\tconst pageName = toViewParts[2];\n\t\tconst argsString = toViewParts[3];\n\n\t\tlet args: string[] = [];\n\t\tif (argsString) args = argsString.split(':');\n\n\t\tawait toView(viewName, pageName, args, moveDirection);\n\t}\n};\n\n/**\n * Открыть диалоговое окно, возможно указать нужную страницу\n * @param viewNameOrElDialog - id страницы окна или элемент окна\n * @param pageName - имя страницы\n * @param args - аргументы, набор проивзольных параметров, которые могут обрабатываться каждым окном по своему\n * @param moveDirection\n * @param callback - функция, которая будет запущена после октытия страницы\n */\nconst toView = async (\n\tviewNameOrElDialog: ElTopDialog | JQuery<ElTopDialog> | string,\n\tpageName?: string,\n\targs?: string[],\n\tmoveDirection?: MoveDirection,\n\tcallback?: Function,\n) => {\n\tif (!isInited) {\n\t\tawait new Promise<void>((resolve, _reject) => {\n\t\t\tconst timer = setInterval(() => {\n\t\t\t\tif (!isInited) return;\n\n\t\t\t\tclearInterval(timer);\n\n\t\t\t\tresolve();\n\t\t\t}, 10);\n\t\t});\n\t}\n\n\tawait nextTick();\n\n\tlet elDialog: ElTopDialog | null;\n\tif (typeof (viewNameOrElDialog) === 'object') {\n\t\tif (isElJQuery(viewNameOrElDialog)) viewNameOrElDialog = viewNameOrElDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\t\telDialog = viewNameOrElDialog;\n\t} else {\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t}\n\n\t// Диалоговое окно еще не загружено\n\tif (!elDialog && typeof viewNameOrElDialog === 'string' && TopDialogWorker.state.load) {\n\t\tawait TopDialogWorker.state.load(viewNameOrElDialog);\n\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t\tif (!elDialog) {\n\t\t\tthrow new Error('Dialog no exists: ' + viewNameOrElDialog);\n\t\t}\n\t}\n\n\tif (!elDialog) return;\n\n\tawait toViewPage(elDialog, pageName, args, moveDirection);\n\n\tconst $dialog = $(elDialog);\n\n\tif (elDialog?.classList.contains('ui-dialog-content')) {\n\t\t// var zIndexMax = 0;\n\t\t// $.map($('.ui-dialog'), function (el) {\n\t\t// \tvar zIndex = $(el).css('z-index') * 1;\n\t\t// \tif (zIndex > zIndexMax) zIndexMax = zIndex;\n\t\t// });\n\t\t//\n\t\t// if ($dialog.is(':hidden')) $dialog.dialog('open');\n\t\t//\n\t\t// var $dialogWrapper = $dialog.parent();\n\t\t// var $dialogOverlay = $dialogWrapper.next();\n\t\t//\n\t\t// if ($dialogWrapper.css('z-index') * 1 < zIndexMax) {\n\t\t// \t$dialogWrapper.css('z-index', zIndexMax + 2);\n\t\t// \t$dialogOverlay.css('z-index', zIndexMax + 1);\n\t\t// }\n\n\t\t$dialog.dialog('open');\n\t} else {\n\t\tconst options = genVueOptions(elDialog);\n\n\t\t$dialog.dialog(options);\n\t}\n\n\tif (callback) callback($dialog);\n};\n\nconst toViewPage = async (elDialog: ElTopDialog | JQuery<ElTopDialog>, pageName?: string, args?: string[], moveDirection?: MoveDirection) => {\n\t// todo: убрать после переписки jquery на сайте\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0];\n\n\tif (pageName === undefined) pageName = elDialog.dataset.viewPageActive;\n\n\tif (pageName !== elDialog.dataset.viewPageActive) {\n\t\tconst stopped = stopAnimations(elDialog);\n\t\tif (stopped) await sleep(100);\n\t}\n\n\tif (args === undefined) args = [];\n\n\tawait updatePageVue(elDialog.getAttribute('id') as string, undefined, pageName);\n\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elNextPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elNextPage = elModalLayer.querySelector<ElTopDialogPage>(`:scope > [data-view-page=\"${pageName}\"]`);\n\t\tif (elNextPage) {\n\t\t\tacc.push(elNextPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst argsString = args.join(':');\n\n\tif (moveDirection === undefined) {\n\t\tmoveDirection = 'next';\n\t\tif ((elNextPages[0]?.dataset.order ?? 0) < (elCurrentPages[0]?.dataset.order ?? 0)) moveDirection = 'prev';\n\t}\n\n\tif (!elNextPages.length) return;\n\n\telDialog.dataset.viewPageActive = pageName;\n\n\t// запрашиваемая страница уже открыта\n\tif (elNextPages[0].classList.contains('active')) {\n\t\tif (elNextPages[0].dataset.viewPageArgs !== argsString) {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.dataset.viewPageArgs = argsString;\n\t\t\t});\n\n\t\t\t// dialogs.beforeOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t\t// dialogs.afterOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t}\n\n\t\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\t\treturn;\n\t}\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.dataset.viewPageArgs = argsString;\n\t});\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\tif (elCurrentPage.querySelector('.top-popup-wrapper')) {\n\t\t\tTopPopupWorker.close(elCurrentPage.querySelector('.top-popup-wrapper')!);\n\t\t}\n\t});\n\n\tconst elDialogWrapper = elNextPages[0].closest<ElTopDialogWrapper>('.ui-dialog');\n\n\tif (elDialogWrapper && !isVisible(elDialogWrapper)) moveDirection = 'none';\n\tif (!elCurrentPages.length) moveDirection = 'none';\n\tif (isVisible(elNextPages[0])) moveDirection = 'none';\n\n\tswitch (moveDirection) {\n\t\tcase 'prev': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage.classList.add('right-to-center', 'reverse');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('center-to-left', 'reverse');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t\tcase 'next': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive.nextSibling);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage?.classList.add('center-to-left');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('right-to-center');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\telDialog.setAttribute('view-page-active', pageName);\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\telCurrentPage.classList.remove('active');\n\t});\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.classList.add('active');\n\t});\n\n\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\tif (moveDirection) {\n\t\telDialog.classList.add('i-change-page');\n\n\t\tconst delay = Number(window.getComputedStyle(elNextPages[0]).animationDuration.replace('s', '')) * 1000;\n\n\t\ttimerClearAnimation = setTimeout(function () {\n\t\t\tupdatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\t\tstopAnimations(elDialog);\n\t\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\t}, delay);\n\t} else {\n\t\tawait updatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t}\n};\n\n/**\n * К предыдущему представлению\n */\nconst toPrevPage = (elDialog: ElTopDialog) => {\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elPrevPages = elCurrentPages.reduce<ElTopDialogPage[]>((acc, elCurrentPage) => {\n\t\tlet elPrevPage = elCurrentPage.previousElementSibling as ElTopDialogPage | null;\n\t\twhile (elPrevPage && !elPrevPage.hasAttribute('[data-view-page]')) {\n\t\t\telPrevPage = elPrevPage.previousElementSibling as ElTopDialogPage | null;\n\t\t}\n\n\t\tif (elPrevPage) acc.push(elPrevPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tconst prevPageName = (elPrevPages[0])?.dataset.viewPage;\n\n\tif (prevPageName) {\n\t\tvoid toViewPage(elDialog, prevPageName, undefined, 'prev');\n\t} else {\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('close');\n\t}\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst beforeOpenViewPageTimers = new Set();\nconst beforeOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\t// группировка цепочки событий\n\t// запрос на открытие страницы может выполняться несколько раз, чаще такое может быть при открытии, загрузке и переходе сразу к нужной странице\n\tconst eventKey = elDialog.getAttribute('id') + elPages[0].dataset.viewPage + pageName + args.join();\n\n\tif (beforeOpenViewPageTimers.has(eventKey)) return;\n\tbeforeOpenViewPageTimers.add(eventKey);\n\n\tsetTimeout(function () {\n\t\tbeforeOpenViewPageTimers.delete(eventKey);\n\n\t\t$(elDialog).trigger('viewBeforeOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst afterOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\tsetTimeout(function () {\n\t\t$(elDialog).trigger('viewAfterOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Получить состояние: Диалоговое окно находится в состоянии смены страницы\n */\nconst inAnimation = (elDialog: ElTopDialog | JQuery<ElTopDialog>) => {\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elDialog.classList.contains('i-change-page');\n};\n\n/**\n * Остановить анимацию смены страницы\n *\n * @returns Вернет true, если анимация производилась и была остановлена\n */\nconst stopAnimations = (elDialog: ElTopDialog) => {\n\tif (!inAnimation(elDialog)) return false;\n\n\tclearTimeout(timerClearAnimation);\n\n\tconst elModalLayers = querySelectorAllArray(elDialog, '.modal-layer');\n\n\tconst pageName = elDialog.dataset.viewPageActive;\n\telDialog.classList.remove('i-change-page');\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelectorAll(':scope > [data-view-page]').forEach((el) => {\n\t\t\tel.classList.remove('center-to-left', 'right-to-center', 'reverse', 'active');\n\t\t});\n\t});\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelector(`:scope > [data-view-page=\"${pageName}\"]`)?.classList.add('active');\n\t});\n\n\treturn true;\n};\n\n/**\n * Закрыть диалоговое окно\n */\nconst close = function (dialogId: string) {\n\tconst elDialog = getElDialogById(dialogId);\n\tif (!elDialog) return;\n\n\tconst $dialog = $(elDialog);\n\n\tif (!$dialog.dialog('instance')) return;\n\n\t$dialog.dialog('close');\n};\n\n/**\n * Управление props.isLoading\n */\nconst setLoading = (elPages: ElTopDialogPage[] | JQuery<ElTopDialogPage>, isLoading: boolean, duration?: number) => {\n\tif (isElJQuery(elPages)) elPages = elPages.toArray(); // todo: убрать после переписки jquery на сайте\n\n\tconst elPagesVisibleds = elPages.reduce<ElTopDialogPage[]>((acc, elPage) => {\n\t\tif (elPage.hasAttribute('[data-view-page]') && isVisible(elPage)) acc.push(elPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tif (isLoading) {\n\t\tif (duration !== undefined) {\n\t\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', duration + 's');\n\t\t\t});\n\t\t}\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.add('i-load-data');\n\t\t});\n\t} else {\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.remove('i-load-data');\n\t\t});\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', '10s');\n\t\t});\n\t}\n};\n\nconst isLoading = (elPage: ElTopDialogPage | JQuery<ElTopDialogPage>) => {\n\tif (isElJQuery(elPage)) elPage = elPage?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elPage.classList.contains('i-load-data');\n};\n\nexport const TopDialogUtils = {\n\tgetElDialogById,\n\tupdatePageVue,\n\trecalcPositions,\n\ttoViewDirty,\n\ttoView,\n\ttoViewPage,\n\ttoPrevPage,\n\tsetLoading,\n\tisLoading,\n\tinAnimation,\n\tclose,\n};\n\ninit();\n"],"names":["inited","initDialogGlobalEvents","el","querySelectorVisible","elDialogs","querySelectorAllArray","elDialog","isVisible","toView","TopDialogUtils","viewNameAndPageLink","viewName","pageLink","elToPages","hash","TopDialogWorker","historySetState","elForm","eventTarget","elSubmitButton","event","elDialogWrapperWithTopZIndex","topZIndex","elDialogWrapper","zIndex","Core","css","cssM","cssPC","cssModern","cssModernPC","timerClearAnimation","isInited","isElJQuery","init","_a","onCreate","onOpen","onClose","$dialog","genVueOptions","options","_b","getElDialogById","id","updatePageVue","dialogId","pageName","pageNameNext","dialog","getDialogWorker","nextTick","waitWhile","elDialogBody","connectScrollShadow","initPopup","_e","$popup","elPopup","elPageContents","w1","scrollBarWidth","recalcPositions","hashData","setHashs","toViewDirty","toViewPageName","moveDirection","toViewParts","argsString","args","viewNameOrElDialog","callback","resolve","_reject","timer","toViewPage","stopAnimations","sleep","elModalLayers","elCurrentPages","acc","elModalLayer","elCurrentPage","elNextPages","elNextPage","beforeOpenViewPage","afterOpenViewPage","TopPopupWorker","elActive","delay","toPrevPage","prevPageName","elPrevPage","beforeOpenViewPageTimers","elPages","eventKey","inAnimation","close","setLoading","isLoading","duration","elPagesVisibleds","elPage","elPagesVisibled"],"mappings":";;;;;;;;AAGe;ACGf,IAAIA,IAAS;AASN,MAAMC,IAAyB,MAAM;AAC3C,EAAID,MACJA,IAAS,IAKT,SAAS,iBAAiB,WAAW,CAAC,MAAM;AAE3C,QADI,EAAE,QAAQ,YACV,CAAC,EAAE,OAAQ;AAEf,UAAME,IAAK,EAAE;AAcb,QAXI,CAACA,EAAG,QAAQ,YAAY,KAExBA,EAAG,oBAAoB,UAAUA,EAAG,oBAAoB,oBAGx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