@topvisor/ui 1.1.0-addNativeDialog.13 → 1.1.0-addNativeDialog.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.chunks/{core-uFZ53eDz.amd.js → core-Bg7lKh4e.amd.js} +2 -2
- package/.chunks/{core-uFZ53eDz.amd.js.map → core-Bg7lKh4e.amd.js.map} +1 -1
- package/.chunks/{core-DwmZJeKo.es.js → core-CPZQHtCX.es.js} +2 -2
- package/.chunks/{core-DwmZJeKo.es.js.map → core-CPZQHtCX.es.js.map} +1 -1
- package/.chunks/{dialog_selectorRegions-DKdrXyjJ.es.js → dialog_selectorRegions-CiOb1xAG.es.js} +3 -3
- package/.chunks/{dialog_selectorRegions-DKdrXyjJ.es.js.map → dialog_selectorRegions-CiOb1xAG.es.js.map} +1 -1
- package/.chunks/{dialog_selectorRegions--uU_HPMU.amd.js → dialog_selectorRegions-DuaLJE6o.amd.js} +2 -2
- package/.chunks/{dialog_selectorRegions--uU_HPMU.amd.js.map → dialog_selectorRegions-DuaLJE6o.amd.js.map} +1 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DzO4WR8t.es.js +622 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DzO4WR8t.es.js.map +1 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-R1tL-n2T.amd.js +2 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-R1tL-n2T.amd.js.map +1 -0
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-jdOhWtvA.amd.js → page.vue_vue_type_script_setup_true_lang-BhK7qQ70.amd.js} +2 -2
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-jdOhWtvA.amd.js.map → page.vue_vue_type_script_setup_true_lang-BhK7qQ70.amd.js.map} +1 -1
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-DRvRAOmG.es.js → page.vue_vue_type_script_setup_true_lang-BuzMReWp.es.js} +3 -3
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-DRvRAOmG.es.js.map → page.vue_vue_type_script_setup_true_lang-BuzMReWp.es.js.map} +1 -1
- package/.chunks/{utils-BmI_WbPx.amd.js → utils-Br0ZfM-6.amd.js} +2 -2
- package/.chunks/{utils-BmI_WbPx.amd.js.map → utils-Br0ZfM-6.amd.js.map} +1 -1
- package/.chunks/{utils-CjdLXxom.es.js → utils-CSr6gGno.es.js} +2 -2
- package/.chunks/{utils-CjdLXxom.es.js.map → utils-CSr6gGno.es.js.map} +1 -1
- package/core/app.amd.js +1 -1
- package/core/app.js +3 -3
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.js +2 -2
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.js +2 -2
- package/src/components/dialog/lib/types.d.ts +4 -36
- package/src/components/dialog/lib/utils.d.ts +7 -8
- package/src/components/dialog/lib/worker.d.ts +4 -8
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.js +2 -2
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-C7vi1i47.amd.js +0 -2
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-C7vi1i47.amd.js.map +0 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-xvod3Gmp.es.js +0 -626
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-xvod3Gmp.es.js.map +0 -1
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
import { nextTick as ae, ref as x, markRaw as oe, shallowReactive as ie, defineComponent as re, onUnmounted as ne, createElementBlock as F, openBlock as z, Fragment as de, renderList as le, unref as se, createBlock as ce, resolveDynamicComponent as pe } from "vue";
|
|
2
|
+
import { sleep as ge, waitWhile as J } from "../utils/system.js";
|
|
3
|
+
import { C as b } from "./forms-DarRVke_.es.js";
|
|
4
|
+
import { TopPopupWorker as he } from "../popup/worker.js";
|
|
5
|
+
import { historySetState as L, genHash as R, getHash as K, setHashs as ue } from "../utils/route.js";
|
|
6
|
+
import { connectScrollShadow as me } from "../utils/scroll.js";
|
|
7
|
+
import { querySelectorAllArray as h, isVisible as f } from "../utils/dom.js";
|
|
8
|
+
$;
|
|
9
|
+
class c {
|
|
10
|
+
static state = {
|
|
11
|
+
load: void 0,
|
|
12
|
+
decoratorOnCreate: void 0,
|
|
13
|
+
/**
|
|
14
|
+
* Порядковый номер перехода в диалоговых окнах
|
|
15
|
+
*
|
|
16
|
+
* Для расчета анимации Вперед / Назад
|
|
17
|
+
*/
|
|
18
|
+
viewPageN: 0
|
|
19
|
+
};
|
|
20
|
+
static inited = !1;
|
|
21
|
+
/**
|
|
22
|
+
* Инициировать события слежения за парамтерами url
|
|
23
|
+
*
|
|
24
|
+
* Если в параметрах есть запрос на открытие диалогового окна, TopDialog будет автоматически подключен на страницу
|
|
25
|
+
*/
|
|
26
|
+
static init(t) {
|
|
27
|
+
if (this.inited) return;
|
|
28
|
+
this.inited = !0, this.state.load = t == null ? void 0 : t.load, this.state.decoratorOnCreate = t == null ? void 0 : t.decoratorOnCreate;
|
|
29
|
+
const a = (t == null ? void 0 : t.autoInitDelay) ?? 5e3;
|
|
30
|
+
window.addEventListener("hashchange", (o) => {
|
|
31
|
+
this.opendDialogsFromChangeUrl(o.oldURL, o.newURL);
|
|
32
|
+
}), this.opendDialogsFromChangeUrl("", location.href), document.addEventListener("mousedown", async (o) => {
|
|
33
|
+
const i = o.target.closest("a[data-to-view]");
|
|
34
|
+
if (!i) return;
|
|
35
|
+
let r = "next";
|
|
36
|
+
i.dataset.action === "top-dialog-close" && (r = "prev"), i.href = c.genViewPageHash(i.dataset.toView, r);
|
|
37
|
+
}), document.addEventListener("click", async (o) => {
|
|
38
|
+
var g, w;
|
|
39
|
+
const i = o.target.closest("[data-to-view]");
|
|
40
|
+
if (!i) return;
|
|
41
|
+
if (i instanceof HTMLAnchorElement && i.href === ".") {
|
|
42
|
+
o.preventDefault();
|
|
43
|
+
const k = new MouseEvent("mousedown", {
|
|
44
|
+
bubbles: !0,
|
|
45
|
+
cancelable: !0,
|
|
46
|
+
view: window
|
|
47
|
+
});
|
|
48
|
+
i.dispatchEvent(k), setTimeout(() => i.click());
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const r = await this.getDialogsUtils(), d = i.dataset.toView, s = d.split("-")[0], p = r.getElDialogById(s);
|
|
52
|
+
let m = "next";
|
|
53
|
+
if (p) {
|
|
54
|
+
const k = h(p, ".modal-layer"), B = k.reduce((E, j) => {
|
|
55
|
+
const A = j.querySelector(":scope > .active");
|
|
56
|
+
return A && E.push(A), E;
|
|
57
|
+
}, []);
|
|
58
|
+
if (B.length) {
|
|
59
|
+
const E = d.split("-")[1].split(":")[0];
|
|
60
|
+
(((g = k.reduce((A, V) => {
|
|
61
|
+
const O = V == null ? void 0 : V.querySelector(`:scope > [data-view-page="${E}"]`);
|
|
62
|
+
return O && A.push(O), A;
|
|
63
|
+
}, [])[0]) == null ? void 0 : g.dataset.order) ?? 0) < (((w = B[0]) == null ? void 0 : w.dataset.order) ?? 0) && (m = "prev");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
i.dataset.action === "top-dialog-close" && (m = "prev");
|
|
67
|
+
const l = c.genViewPageHash(d, m);
|
|
68
|
+
if (i instanceof HTMLAnchorElement) {
|
|
69
|
+
if (!p || !f(p)) return;
|
|
70
|
+
if (location.hash.indexOf(d.replace("-", "=")) !== -1) {
|
|
71
|
+
await r.toViewDirty(d);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
!!(p != null && p.dataset.toViewReplace) ? (o.preventDefault(), L(!0, l), await r.toViewDirty(d), m == "next" ? c.state.viewPageN++ : c.state.viewPageN--) : i.tagName !== "A" && (this.compareStates(l, location.hash) ? L(!1, l) : await r.toViewDirty(d));
|
|
76
|
+
}), setTimeout(() => this.getDialogsUtils(), a);
|
|
77
|
+
}
|
|
78
|
+
static opendDialogsFromChangeUrl(t, a) {
|
|
79
|
+
const o = t.replace(/.*?#/, "#"), n = a.replace(/.*?#/, "#");
|
|
80
|
+
this.compareStates(o, n) && this.opendDialogsFromUrl();
|
|
81
|
+
}
|
|
82
|
+
static async getDialogsUtils() {
|
|
83
|
+
const { TopDialogUtils: t } = await Promise.resolve().then(() => qe);
|
|
84
|
+
return t;
|
|
85
|
+
}
|
|
86
|
+
static getDialog(t) {
|
|
87
|
+
return t.closest(".ui-dialog-content");
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* todo: Переписать на сайте на this.getDialog()
|
|
91
|
+
*
|
|
92
|
+
* @deprecated Для обратной совместимости
|
|
93
|
+
*/
|
|
94
|
+
static get$dialog(t) {
|
|
95
|
+
return t.closest(".ui-dialog-content");
|
|
96
|
+
}
|
|
97
|
+
static getPage(t) {
|
|
98
|
+
return t.closest("[data-view-page]");
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* todo: Переписать на сайте на this.getPage()
|
|
102
|
+
*
|
|
103
|
+
* @deprecated Для обратной совместимости
|
|
104
|
+
*/
|
|
105
|
+
static get$page(t) {
|
|
106
|
+
return t.closest("[data-view-page]");
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* todo: Переписать на сайте на this.getPairPage()
|
|
110
|
+
*
|
|
111
|
+
* @deprecated Для обратной совместимости
|
|
112
|
+
*/
|
|
113
|
+
static get$pairPage(t) {
|
|
114
|
+
const a = c.get$dialog(t), n = c.get$page(t).data("view-page");
|
|
115
|
+
return $('[data-view-page="' + n + '"]', a);
|
|
116
|
+
}
|
|
117
|
+
static getPairPage(t) {
|
|
118
|
+
const a = c.getDialog(t);
|
|
119
|
+
if (!a) return;
|
|
120
|
+
const o = c.getPage(t), n = o == null ? void 0 : o.dataset.viewPage;
|
|
121
|
+
return h(a, `[data-view-page="${n}"]`);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Закрыть диалоговое окно по его id
|
|
125
|
+
*/
|
|
126
|
+
static close(t) {
|
|
127
|
+
u(t).close();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Размонтировать диалоговое окно по его id
|
|
131
|
+
*/
|
|
132
|
+
static destroy(t) {
|
|
133
|
+
const a = u(t);
|
|
134
|
+
a.close(), a.remove();
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Сгенерировать ссылку на страницу в диалоговом окне
|
|
138
|
+
* @param toView - указатель в формате: dialog_{{ dialogId }}={{ pageName }}:{{ args }}
|
|
139
|
+
* @param moveDirection
|
|
140
|
+
*/
|
|
141
|
+
static genViewPageHash(t, a = "next") {
|
|
142
|
+
let o = this.state.viewPageN;
|
|
143
|
+
a == "prev" ? o-- : o++;
|
|
144
|
+
const n = t.split("-"), i = n.shift(), r = n.join("-");
|
|
145
|
+
let d = R("vpn", o);
|
|
146
|
+
return d = R("view-" + i, r, d), d;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Сравнить версию открытых диалоговых окон
|
|
150
|
+
* @returns вернет true, если состояния открытых окон изменилось
|
|
151
|
+
*/
|
|
152
|
+
static compareStates(t, a) {
|
|
153
|
+
const o = t.match(/[#&]view-[^&]+/g) || [], n = a.match(/[#&]view-[^&]+/g) || [];
|
|
154
|
+
return !!(o.length !== n.length || o.filter((r, d) => {
|
|
155
|
+
const s = n[d] || "";
|
|
156
|
+
return r !== s;
|
|
157
|
+
}).length);
|
|
158
|
+
}
|
|
159
|
+
static opendDialogsFromUrl = async () => {
|
|
160
|
+
const t = Number(K("vpn")) || 0;
|
|
161
|
+
let a;
|
|
162
|
+
const o = new RegExp("view-((\\w+)=([\\w-]+)(?::([\\w.:-]+))?)", "g");
|
|
163
|
+
for (; a = o.exec(location.hash); ) {
|
|
164
|
+
let i = "next";
|
|
165
|
+
return t < this.state.viewPageN && (i = "prev"), (await this.getDialogsUtils()).toViewDirty(a[1], i);
|
|
166
|
+
}
|
|
167
|
+
return h(document, ".ui-dialog-content[data-view-page-active]").filter((i) => f(i)).forEach((i) => {
|
|
168
|
+
const r = i.getAttribute("id");
|
|
169
|
+
if (!r) throw "Диалоговое окно не содержит id";
|
|
170
|
+
K("view-" + r) || u(i.getAttribute("id")).close();
|
|
171
|
+
}), this.state.viewPageN = t, !0;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
let Y = !1;
|
|
175
|
+
const fe = () => {
|
|
176
|
+
Y || (Y = !0, document.addEventListener("click", (e) => {
|
|
177
|
+
const t = e.target.closest('[data-action="top-dialog-close"]');
|
|
178
|
+
if (!t) return;
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
const a = t.closest(".ui-dialog-content");
|
|
181
|
+
if (!a) return;
|
|
182
|
+
const o = t.dataset.toView;
|
|
183
|
+
if (o == "toPrevPage()") {
|
|
184
|
+
P.toPrevPage(a);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (o) {
|
|
188
|
+
const i = o.split("-"), r = i.shift(), d = i.join("-");
|
|
189
|
+
if (!r) return;
|
|
190
|
+
const s = P.getElDialogById(r);
|
|
191
|
+
if (!s) return;
|
|
192
|
+
const p = h(s, `[data-view-page="${d}"]`);
|
|
193
|
+
if (!p) return;
|
|
194
|
+
if (!f(p[0])) {
|
|
195
|
+
const m = c.genViewPageHash(o, "prev");
|
|
196
|
+
L(!1, m);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
u(a.getAttribute("id")).close();
|
|
201
|
+
}), document.addEventListener("submit", (e) => {
|
|
202
|
+
const t = e.target;
|
|
203
|
+
(t.matches(".modal-body > form") || t.matches(".modal-layer-body > form")) && e.preventDefault();
|
|
204
|
+
}), document.addEventListener("keypress", (e) => {
|
|
205
|
+
const t = e.target;
|
|
206
|
+
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") {
|
|
207
|
+
if (t.classList.contains("autocomplete")) {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (t.tagName === "TEXTAREA") {
|
|
212
|
+
if (!e.ctrlKey && !e.metaKey) return;
|
|
213
|
+
const n = t.closest("form");
|
|
214
|
+
if (n) {
|
|
215
|
+
const i = h(n, 'button[type="submit"]').concat(h(n, 'input[type="submit"]')).find((r) => f(r));
|
|
216
|
+
i == null || i.click();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}), document.addEventListener("click", (e) => {
|
|
221
|
+
if (!e.target.classList.contains("ui-dialog-overlay")) return;
|
|
222
|
+
let a, o = 0;
|
|
223
|
+
h(document, ".ui-dialog").filter((i) => f(i) && i.getAttribute("aria-modal") === "false").forEach((i) => {
|
|
224
|
+
const r = Number(window.getComputedStyle(i).zIndex);
|
|
225
|
+
r < o || (a = i, o = r);
|
|
226
|
+
}), a && a.close();
|
|
227
|
+
}), window.addEventListener("resize", P.recalcPositions), P.recalcPositions());
|
|
228
|
+
}, ve = ':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-dialog{overflow:visible;background:var(--color-layout-front-1);max-height:none;max-width:none;border-radius:8px;border:none;padding:0;color:var(--color-text-1)}.ui-dialog[aria-modal=false]{top:50%;transform:translateY(-50%);z-index:100001}.ui-dialog-overlay,.ui-dialog::backdrop{background:#040404;opacity:.5;filter:Alpha(Opacity=50)}.ui-dialog-overlay{position:fixed;inset:0;z-index:100000;display:none}.ui-dialog[aria-modal=false][open]~.ui-dialog-overlay{display:block}.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>button.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>button.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, 0px));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}}', we = "html.with_dialog body{height:var(--100vh);overflow:hidden}.ui-dialog{border-radius:0}.ui-dialog,.ui-dialog::backdrop{height:calc(100% - var(--toolbar-height, 0px));width:auto;margin-top:0}.ui-dialog[aria-modal=false]{top:0;transform:none}.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>button.close{font-size:14px;order:1}.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}", ye = ".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%}}", be = "html{--top-dialog-width: auto;--top-dialog-height: auto}.top-dialog{max-width:100vw}.top-dialog .modal-layer-body{height:var(--top-dialog-height)}", xe = ".top-dialog{width:var(--top-dialog-width)!important}";
|
|
229
|
+
b.insertStyleToPage(ve);
|
|
230
|
+
b.insertStyleToPage(we, "m");
|
|
231
|
+
b.insertStyleToPage(ye, "pc");
|
|
232
|
+
b.insertStyleToPage(be);
|
|
233
|
+
b.insertStyleToPage(xe, "pc");
|
|
234
|
+
let N;
|
|
235
|
+
const _ = (e) => !!e && typeof e == "object" && "jquery" in e, _e = () => {
|
|
236
|
+
fe();
|
|
237
|
+
}, q = (e) => {
|
|
238
|
+
const t = D(e.getAttribute("id")), a = Ae(t);
|
|
239
|
+
e.setAttribute("closedby", a.closedby), e.setAttribute("aria-modal", "false"), e.show();
|
|
240
|
+
}, Ae = (e) => {
|
|
241
|
+
const t = {
|
|
242
|
+
modal: !1,
|
|
243
|
+
closedby: "closerequest"
|
|
244
|
+
}, a = e.dataset.closedby;
|
|
245
|
+
return (a === "closerequest" || a === "none") && (t.closedby = a), t;
|
|
246
|
+
}, M = (e) => document.getElementById(e), S = async (e, t, a) => {
|
|
247
|
+
if (!e.startsWith("dialog_")) return;
|
|
248
|
+
const o = I(e);
|
|
249
|
+
if (o && (o.isOpened.value = !0, t !== void 0 && (o.pageActive.value = t), a !== void 0 && (o.pageActiveNext.value = a), await ae(), a)) {
|
|
250
|
+
const n = M(e);
|
|
251
|
+
if (!n) return;
|
|
252
|
+
n.querySelectorAll(`[data-view-page="${a}"]`).length || await J(() => !n.querySelectorAll(`[data-view-page="${a}"]`).length);
|
|
253
|
+
}
|
|
254
|
+
}, Pe = (e) => {
|
|
255
|
+
var a, o;
|
|
256
|
+
const t = e.querySelector(".modal-body");
|
|
257
|
+
t && (me(t), (o = (a = c.state).decoratorOnCreate) == null || o.call(a, e), ke(e));
|
|
258
|
+
}, ke = (e) => {
|
|
259
|
+
$(e).on("aftershow.top-menu-popup", "[data-top-popup]", (t, a) => {
|
|
260
|
+
var i;
|
|
261
|
+
const o = a[0], n = c.getPairPage(o);
|
|
262
|
+
(i = n == null ? void 0 : n[1]) == null || i.prepend(o);
|
|
263
|
+
});
|
|
264
|
+
}, Ee = async (e) => {
|
|
265
|
+
var r;
|
|
266
|
+
const t = e.dataset.viewPageActive, a = window.innerWidth;
|
|
267
|
+
b.state.documentClassModificators.set("top-dialog", "with_dialog");
|
|
268
|
+
const n = window.innerWidth - a;
|
|
269
|
+
document.documentElement.scrollHeight > window.innerHeight && (document.querySelector("html").style.marginRight = n + "px"), Q();
|
|
270
|
+
const i = I(e.getAttribute("id"));
|
|
271
|
+
(r = i == null ? void 0 : i.emit) == null || r.call(i, "open", t);
|
|
272
|
+
}, Se = async (e) => {
|
|
273
|
+
var i;
|
|
274
|
+
const t = e.getAttribute("id"), a = e.dataset.viewPageActive;
|
|
275
|
+
if (a) {
|
|
276
|
+
const r = {
|
|
277
|
+
vpn: c.state.viewPageN,
|
|
278
|
+
["view-" + t]: null
|
|
279
|
+
};
|
|
280
|
+
r["view-" + t] = null, (c.state.viewPageN === 0 || c.state.viewPageN === 1) && (r.vpn = null), ue(r, !1);
|
|
281
|
+
}
|
|
282
|
+
h(document, ".ui-dialog[open]").find((r) => f(r)) || (b.state.documentClassModificators.delete("top-dialog"), document.querySelector("html").style.marginRight = ""), $(e).trigger("viewAfterClose", [$(e)]);
|
|
283
|
+
const n = I(t);
|
|
284
|
+
n && (n.isOpened.value = !1, (i = n.emit) == null || i.call(n, "close", a), n.onCloseOnce && (n.onCloseOnce(n.props, a), n.onCloseOnce = void 0)), window.dispatchEvent(new Event("resize"));
|
|
285
|
+
}, Q = () => {
|
|
286
|
+
h(document, ".ui-dialog").filter((t) => f(t)).forEach((t) => {
|
|
287
|
+
const a = t.querySelector(".modal-body");
|
|
288
|
+
!a || f(a) || (q(t), t.classList.remove("me-tightly"), (t.clientHeight ?? 0) > window.innerHeight && t.classList.add("me-tightly"));
|
|
289
|
+
});
|
|
290
|
+
}, T = (e) => `${e}Wrapper`, X = (e) => e.replace(/Wrapper$/, ""), u = (e) => {
|
|
291
|
+
const t = T(e);
|
|
292
|
+
return document.getElementById(t);
|
|
293
|
+
}, D = (e) => {
|
|
294
|
+
const t = X(e);
|
|
295
|
+
return document.getElementById(t);
|
|
296
|
+
}, Le = () => {
|
|
297
|
+
let e = document.body.querySelector(".ui-dialog-overlay");
|
|
298
|
+
return e || (e = document.createElement("div"), e.classList.add("ui-dialog-overlay"), document.body.appendChild(e)), e;
|
|
299
|
+
}, ee = (e, t) => {
|
|
300
|
+
const a = Le(), o = document.createElement("dialog");
|
|
301
|
+
return o.setAttribute("id", T(e)), o.setAttribute("page-active", t), o.setAttribute("class", "dialog ui-dialog"), a.insertAdjacentElement("beforebegin", o), o;
|
|
302
|
+
}, Ve = async (e, t) => {
|
|
303
|
+
const o = /(\w+)[=-]([\w-]+)(?::([\w.:-]+))?/g.exec(e);
|
|
304
|
+
if (o) {
|
|
305
|
+
const n = o[1], i = o[2], r = o[3];
|
|
306
|
+
let d = [];
|
|
307
|
+
r && (d = r.split(":")), await U(n, i, d, t);
|
|
308
|
+
}
|
|
309
|
+
}, U = async (e, t, a, o, n) => {
|
|
310
|
+
let i = null, r = null;
|
|
311
|
+
if (typeof e == "object" ? (_(e) && (e = e == null ? void 0 : e[0]), i = e, r = u(i.getAttribute("id"))) : (i = document.getElementById(e), r = u(e)), !i && typeof e == "string" && c.state.load) {
|
|
312
|
+
await c.state.load(e), await U(e, t, a, o, n);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
i && (!r && i.dataset.vueDiaolg !== "true" && (i.classList.add("top-dialog", "ui-dialog-content"), r = ee(i.getAttribute("id"), i.dataset.viewPageActive), r.append(i)), r && (await H(i, t, a, o), r.__isInit || (r.__isInit = !0, Pe(i), r.dialog = (d) => {
|
|
316
|
+
switch (d) {
|
|
317
|
+
case "open": {
|
|
318
|
+
q(r);
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
case "close": {
|
|
322
|
+
r.close();
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
case void 0: {
|
|
326
|
+
console.warn("Вызвана бесполезная инициализация у нативного диалога");
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
default:
|
|
330
|
+
throw new Error(`Передан неизвестный аргумент: "${d}"`);
|
|
331
|
+
}
|
|
332
|
+
return r;
|
|
333
|
+
}, r.toggleClass = (d, s) => {
|
|
334
|
+
const p = r.querySelector(".ui-dialog-content");
|
|
335
|
+
if (typeof d == "string" && (d = d.split(" ")), Array.isArray(d))
|
|
336
|
+
d.forEach((m) => {
|
|
337
|
+
p.classList.toggle(m, s);
|
|
338
|
+
});
|
|
339
|
+
else
|
|
340
|
+
throw new Error(`Передан необработанный тип аргумента: ${typeof d}`);
|
|
341
|
+
return r;
|
|
342
|
+
}, r.data = (...d) => {
|
|
343
|
+
const s = r.querySelector(".ui-dialog-content");
|
|
344
|
+
return $(s).data(d), r;
|
|
345
|
+
}, r.onclose = () => Se(i)), q(r), await Ee(i), n && n(r)));
|
|
346
|
+
}, H = async (e, t, a, o) => {
|
|
347
|
+
var p, m;
|
|
348
|
+
_(e) && (e = e == null ? void 0 : e[0]), t === void 0 && (t = e.dataset.viewPageActive), t !== e.dataset.viewPageActive && G(e) && await ge(100), a === void 0 && (a = []), await S(e.getAttribute("id"), void 0, t);
|
|
349
|
+
const n = h(e, ".modal-layer"), i = n.reduce((l, v) => {
|
|
350
|
+
const g = v.querySelector(":scope > .active");
|
|
351
|
+
return g && l.push(g), l;
|
|
352
|
+
}, []), r = n.reduce((l, v) => {
|
|
353
|
+
const g = v.querySelector(`:scope > [data-view-page="${t}"]`);
|
|
354
|
+
return g && l.push(g), l;
|
|
355
|
+
}, []), d = a.join(":");
|
|
356
|
+
if (o === void 0 && (o = "next", (((p = r[0]) == null ? void 0 : p.dataset.order) ?? 0) < (((m = i[0]) == null ? void 0 : m.dataset.order) ?? 0) && (o = "prev")), !r.length) return;
|
|
357
|
+
const s = u(e.getAttribute("id"));
|
|
358
|
+
if (e.dataset.viewPageActive = t, s.setAttribute("page-active", t), r[0].classList.contains("active")) {
|
|
359
|
+
r[0].dataset.viewPageArgs !== d && r.forEach((l) => {
|
|
360
|
+
l.dataset.viewPageArgs = d;
|
|
361
|
+
}), Z(e, r, t, a), W(e, r, t, a);
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
switch (r.forEach((l) => {
|
|
365
|
+
l.dataset.viewPageArgs = d;
|
|
366
|
+
}), i.forEach((l) => {
|
|
367
|
+
l.querySelector(".top-popup-wrapper") && he.close(l.querySelector(".top-popup-wrapper"));
|
|
368
|
+
}), s && !f(s) && (o = "none"), i.length || (o = "none"), f(r[0]) && (o = "none"), o) {
|
|
369
|
+
case "prev": {
|
|
370
|
+
r.forEach((l) => {
|
|
371
|
+
var g, w;
|
|
372
|
+
const v = (g = l.parentNode) == null ? void 0 : g.querySelector(":scope > .active");
|
|
373
|
+
v && ((w = l.parentNode) == null || w.insertBefore(l, v));
|
|
374
|
+
}), i.forEach((l) => {
|
|
375
|
+
l.classList.add("right-to-center", "reverse");
|
|
376
|
+
}), r.forEach((l) => {
|
|
377
|
+
l.classList.add("center-to-left", "reverse");
|
|
378
|
+
});
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
case "next": {
|
|
382
|
+
r.forEach((l) => {
|
|
383
|
+
var g, w;
|
|
384
|
+
const v = (g = l.parentNode) == null ? void 0 : g.querySelector(":scope > .active");
|
|
385
|
+
v && ((w = l.parentNode) == null || w.insertBefore(l, v.nextSibling));
|
|
386
|
+
}), i.forEach((l) => {
|
|
387
|
+
l == null || l.classList.add("center-to-left");
|
|
388
|
+
}), r.forEach((l) => {
|
|
389
|
+
l.classList.add("right-to-center");
|
|
390
|
+
});
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (e.setAttribute("view-page-active", t), i.forEach((l) => {
|
|
395
|
+
l.classList.remove("active");
|
|
396
|
+
}), r.forEach((l) => {
|
|
397
|
+
l.classList.add("active");
|
|
398
|
+
}), Z(e, r, t, a), o) {
|
|
399
|
+
e.classList.add("i-change-page");
|
|
400
|
+
const l = Number(window.getComputedStyle(r[0]).animationDuration.replace("s", "")) * 1e3;
|
|
401
|
+
N = setTimeout(function() {
|
|
402
|
+
_(e) && (e = e == null ? void 0 : e[0]), S(e.getAttribute("id"), t, ""), G(e), W(e, r, t, a);
|
|
403
|
+
}, l);
|
|
404
|
+
} else
|
|
405
|
+
await S(e.getAttribute("id"), t, ""), W(e, r, t, a);
|
|
406
|
+
}, $e = (e) => {
|
|
407
|
+
var i;
|
|
408
|
+
const n = (i = h(e, ".modal-layer").reduce((r, d) => {
|
|
409
|
+
const s = d.querySelector(":scope > .active");
|
|
410
|
+
return s && r.push(s), r;
|
|
411
|
+
}, []).reduce((r, d) => {
|
|
412
|
+
let s = d.previousElementSibling;
|
|
413
|
+
for (; s && !s.hasAttribute("[data-view-page]"); )
|
|
414
|
+
s = s.previousElementSibling;
|
|
415
|
+
return s && r.push(s), r;
|
|
416
|
+
}, [])[0]) == null ? void 0 : i.dataset.viewPage;
|
|
417
|
+
n ? H(e, n, void 0, "prev") : u(e.getAttribute("id")).close();
|
|
418
|
+
}, C = /* @__PURE__ */ new Set(), Z = (e, t, a, o) => {
|
|
419
|
+
const n = e.getAttribute("id") + t[0].dataset.viewPage + a + o.join();
|
|
420
|
+
C.has(n) || (C.add(n), setTimeout(function() {
|
|
421
|
+
C.delete(n);
|
|
422
|
+
const i = u(e.getAttribute("id"));
|
|
423
|
+
$(e).trigger("viewBeforeOpen", [i, $(t), a, o]);
|
|
424
|
+
}));
|
|
425
|
+
}, W = (e, t, a, o) => {
|
|
426
|
+
const n = u(e.getAttribute("id"));
|
|
427
|
+
setTimeout(function() {
|
|
428
|
+
$(e).trigger("viewAfterOpen", [n, $(t), a, o]);
|
|
429
|
+
});
|
|
430
|
+
}, te = (e) => (_(e) && (e = e == null ? void 0 : e[0]), e.classList.contains("i-change-page")), G = (e) => {
|
|
431
|
+
if (!te(e)) return !1;
|
|
432
|
+
clearTimeout(N);
|
|
433
|
+
const t = h(e, ".modal-layer"), a = e.dataset.viewPageActive;
|
|
434
|
+
return e.classList.remove("i-change-page"), t.forEach((o) => {
|
|
435
|
+
o.querySelectorAll(":scope > [data-view-page]").forEach((n) => {
|
|
436
|
+
n.classList.remove("center-to-left", "right-to-center", "reverse", "active");
|
|
437
|
+
});
|
|
438
|
+
}), t.forEach((o) => {
|
|
439
|
+
var n;
|
|
440
|
+
(n = o.querySelector(`:scope > [data-view-page="${a}"]`)) == null || n.classList.add("active");
|
|
441
|
+
}), !0;
|
|
442
|
+
}, ze = function(e) {
|
|
443
|
+
if (!M(e)) return;
|
|
444
|
+
u(e).close();
|
|
445
|
+
}, Ce = (e, t, a) => {
|
|
446
|
+
_(e) && (e = e.toArray());
|
|
447
|
+
const o = e.reduce((n, i) => (i.hasAttribute("[data-view-page]") && f(i) && n.push(i), n), []);
|
|
448
|
+
t ? (a !== void 0 && o.forEach((n) => {
|
|
449
|
+
n.style.setProperty("--dialog-loading-duration", a + "s");
|
|
450
|
+
}), o.forEach((n) => {
|
|
451
|
+
n.classList.add("i-load-data");
|
|
452
|
+
})) : (o.forEach((n) => {
|
|
453
|
+
n.classList.remove("i-load-data");
|
|
454
|
+
}), o.forEach((n) => {
|
|
455
|
+
n.style.setProperty("--dialog-loading-duration", "10s");
|
|
456
|
+
}));
|
|
457
|
+
}, We = (e) => (_(e) && (e = e == null ? void 0 : e[0]), e.classList.contains("i-load-data")), P = {
|
|
458
|
+
getElDialogById: M,
|
|
459
|
+
updatePageVue: S,
|
|
460
|
+
recalcPositions: Q,
|
|
461
|
+
toViewDirty: Ve,
|
|
462
|
+
toView: U,
|
|
463
|
+
toViewPage: H,
|
|
464
|
+
toPrevPage: $e,
|
|
465
|
+
setLoading: Ce,
|
|
466
|
+
isLoading: We,
|
|
467
|
+
inAnimation: te,
|
|
468
|
+
close: ze
|
|
469
|
+
};
|
|
470
|
+
_e();
|
|
471
|
+
const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
472
|
+
__proto__: null,
|
|
473
|
+
TopDialogUtils: P,
|
|
474
|
+
createAndMountElDialogWrapper: ee,
|
|
475
|
+
getDialogId: X,
|
|
476
|
+
getDialogWrapperId: T,
|
|
477
|
+
getElDialog: D,
|
|
478
|
+
getElDialogWrapper: u
|
|
479
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
480
|
+
class Me {
|
|
481
|
+
/**
|
|
482
|
+
* Индентификатор, определяется на уровне компонента TopDialogComponent
|
|
483
|
+
*
|
|
484
|
+
* Может использоваться в навигации для открытия нужных окон с нужными настройками
|
|
485
|
+
*/
|
|
486
|
+
id;
|
|
487
|
+
/**
|
|
488
|
+
* ID, используемый в верстке диалогового окна
|
|
489
|
+
*/
|
|
490
|
+
idAttr;
|
|
491
|
+
/**
|
|
492
|
+
* Пользовательский компонент диалогового окна
|
|
493
|
+
*/
|
|
494
|
+
Component;
|
|
495
|
+
/**
|
|
496
|
+
* Компонент инициирован
|
|
497
|
+
*
|
|
498
|
+
* Устанавливается после первого вызова useTopDialog()
|
|
499
|
+
*/
|
|
500
|
+
isMounted = x(!1);
|
|
501
|
+
/**
|
|
502
|
+
* Компонент готов к использованию
|
|
503
|
+
*
|
|
504
|
+
* Используется для внутренних преобразований после отрисовки
|
|
505
|
+
*/
|
|
506
|
+
isReady = x(!1);
|
|
507
|
+
/**
|
|
508
|
+
* Диалоговое окно открыто
|
|
509
|
+
*/
|
|
510
|
+
isOpened = x(!1);
|
|
511
|
+
/**
|
|
512
|
+
* Имя активной страницы дилогового окна
|
|
513
|
+
*/
|
|
514
|
+
pageActive = x("");
|
|
515
|
+
/**
|
|
516
|
+
* Диалоговое окно находится в состоянии загрузки своей страницы
|
|
517
|
+
*/
|
|
518
|
+
isLoadingPage = x(!1);
|
|
519
|
+
/**
|
|
520
|
+
* Следующая активная страница
|
|
521
|
+
*
|
|
522
|
+
* В один момент времени может потребоваться отобразить две страницы, чтобы воспроизвести анимацию
|
|
523
|
+
*/
|
|
524
|
+
pageActiveNext = x("");
|
|
525
|
+
/**
|
|
526
|
+
* props компонента, доступны после инициализации
|
|
527
|
+
*/
|
|
528
|
+
props;
|
|
529
|
+
/**
|
|
530
|
+
* emit базового компонента `TopDialog`
|
|
531
|
+
*/
|
|
532
|
+
emit;
|
|
533
|
+
/**
|
|
534
|
+
* Одноразовое событие на закрытие диалогового окна
|
|
535
|
+
*
|
|
536
|
+
* Используется для привязки окна к сценариям использования
|
|
537
|
+
*/
|
|
538
|
+
onCloseOnce;
|
|
539
|
+
constructor(t) {
|
|
540
|
+
this.id = t.id, this.idAttr = "dialog_" + t.id, this.Component = oe(t);
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Событие - компонент инициирован
|
|
544
|
+
*/
|
|
545
|
+
onMounted(t, a) {
|
|
546
|
+
this.isMounted.value = !0, this.props = t.props, this.emit = a.emit;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Открыть диалоговое окно
|
|
550
|
+
*
|
|
551
|
+
* Учтите, что props в диалоговом окне будут доступны не сразу, а только после инициализации vue компонента
|
|
552
|
+
*/
|
|
553
|
+
async open(t = "main", a, o = [], n, i) {
|
|
554
|
+
a && await this.setProps(a), n && (this.onCloseOnce = n), await (await c.getDialogsUtils()).toView(this.idAttr, t, o, i);
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Открыть диалоговое окно как ссылку, для хеш-навигации
|
|
558
|
+
*
|
|
559
|
+
* Диалоговые окна загружаются по имени, см. настройку плагина Core topDialogLoader
|
|
560
|
+
*/
|
|
561
|
+
async openAsLink(t = "main", a, o = [], n, i) {
|
|
562
|
+
a && await this.setProps(a), n && (this.onCloseOnce = n);
|
|
563
|
+
const r = this.idAttr + "-" + t, d = c.genViewPageHash(r, i);
|
|
564
|
+
L(!1, d);
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Закрыть диалоговое окно
|
|
568
|
+
*
|
|
569
|
+
* Не меняет состояние компонента диалогового окна
|
|
570
|
+
*/
|
|
571
|
+
async close() {
|
|
572
|
+
c.close(this.idAttr);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Размонтировать $.dialog
|
|
576
|
+
*/
|
|
577
|
+
async destroy() {
|
|
578
|
+
c.destroy(this.idAttr);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Устанвоить props
|
|
582
|
+
*
|
|
583
|
+
* Полностью сбрасывается состояние props
|
|
584
|
+
*/
|
|
585
|
+
async setProps(t = {}) {
|
|
586
|
+
this.isMounted || await J(() => !this.props);
|
|
587
|
+
for (const a in this.props)
|
|
588
|
+
this.props[a] = t[a];
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Проверить, есть ли необходимость отрисовки страницы диалогового окна
|
|
592
|
+
*/
|
|
593
|
+
needShowPage(t) {
|
|
594
|
+
return this.isOpened.value ? this.pageActive.value === t || this.pageActiveNext.value === t : !1;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
const Te = {
|
|
598
|
+
class: "top-dialogs",
|
|
599
|
+
style: { display: "none" }
|
|
600
|
+
}, y = ie(/* @__PURE__ */ new Map()), I = (e) => (e = e.replace(/^dialog_/, ""), y.get(e)), Re = (e) => {
|
|
601
|
+
if (!(e != null && e.id))
|
|
602
|
+
throw console.log({ TopDialogComponent: e }), new Error("Expected TopDialogComponent");
|
|
603
|
+
return y.has(e.id) || y.set(e.id, new Me(e)), y.get(e.id);
|
|
604
|
+
}, Ke = /* @__PURE__ */ re({
|
|
605
|
+
name: "DialogWrapper",
|
|
606
|
+
__name: "dialogs",
|
|
607
|
+
setup(e) {
|
|
608
|
+
return ne(() => {
|
|
609
|
+
y.forEach((t) => t.destroy()), y.clear();
|
|
610
|
+
}), (t, a) => (z(), F("div", Te, [
|
|
611
|
+
(z(!0), F(de, null, le(se(y), ([o, n]) => (z(), ce(pe(n.Component), { key: o }))), 128))
|
|
612
|
+
]));
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
export {
|
|
616
|
+
c as T,
|
|
617
|
+
Ke as _,
|
|
618
|
+
Re as a,
|
|
619
|
+
ee as c,
|
|
620
|
+
I as g
|
|
621
|
+
};
|
|
622
|
+
//# sourceMappingURL=dialogs.vue_vue_type_script_setup_true_lang-DzO4WR8t.es.js.map
|