@topvisor/ui 0.0.14 → 0.0.16

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.
Files changed (67) hide show
  1. package/.chunks/core-97b070be.amd.js +2 -0
  2. package/.chunks/core-97b070be.amd.js.map +1 -0
  3. package/.chunks/core-c3afa109.es.js +121 -0
  4. package/.chunks/core-c3afa109.es.js.map +1 -0
  5. package/.chunks/forms-6a6b0b80.es.js +436 -0
  6. package/.chunks/forms-6a6b0b80.es.js.map +1 -0
  7. package/.chunks/forms-7119886a.amd.js +3 -0
  8. package/.chunks/forms-7119886a.amd.js.map +1 -0
  9. package/.chunks/popup-6d1d8097.amd.js +342 -0
  10. package/.chunks/popup-6d1d8097.amd.js.map +1 -0
  11. package/.chunks/popup-95d27020.es.js +720 -0
  12. package/.chunks/popup-95d27020.es.js.map +1 -0
  13. package/README.md +62 -62
  14. package/common/common.amd.js +1 -21
  15. package/common/common.amd.js.map +1 -1
  16. package/common/common.js +8 -11
  17. package/common/common.js.map +1 -1
  18. package/core/core.amd.js +2 -0
  19. package/core/core.amd.js.map +1 -0
  20. package/core/core.js +7 -0
  21. package/core/core.js.map +1 -0
  22. package/core.css +1 -645
  23. package/dark.css +1 -128
  24. package/editArea/editArea.amd.js +3 -0
  25. package/editArea/editArea.amd.js.map +1 -0
  26. package/editArea/editArea.js +111 -0
  27. package/editArea/editArea.js.map +1 -0
  28. package/editArea.css +1 -0
  29. package/forms/forms.amd.js +1 -10
  30. package/forms/forms.amd.js.map +1 -1
  31. package/forms/forms.js +9 -7
  32. package/forms/helpers.amd.js +2 -0
  33. package/{helpers → forms}/helpers.amd.js.map +1 -1
  34. package/forms/helpers.js +6 -0
  35. package/forms.css +1 -408
  36. package/icomoon/demo-files/Read Me.txt +7 -7
  37. package/icomoon/demo-files/demo.css +161 -161
  38. package/icomoon/demo-files/demo.js +30 -30
  39. package/icomoon/demo.html +2931 -2931
  40. package/icomoon/fonts/Topvisor-2.svg +231 -231
  41. package/icomoon/style.css +644 -644
  42. package/light.css +1 -128
  43. package/package.json +19 -19
  44. package/popup/popup.amd.js +3 -0
  45. package/popup/popup.amd.js.map +1 -0
  46. package/popup/popup.js +146 -0
  47. package/popup/popup.js.map +1 -0
  48. package/popup/worker.amd.js +2 -0
  49. package/popup/worker.amd.js.map +1 -0
  50. package/popup/worker.js +158 -0
  51. package/popup/worker.js.map +1 -0
  52. package/popup.css +1 -0
  53. package/utils/device.amd.js +2 -0
  54. package/utils/device.amd.js.map +1 -0
  55. package/utils/device.js +34 -0
  56. package/utils/device.js.map +1 -0
  57. package/utils/dom.amd.js +2 -0
  58. package/utils/dom.amd.js.map +1 -0
  59. package/utils/dom.js +64 -0
  60. package/utils/dom.js.map +1 -0
  61. package/.chunks/forms-1b3f76e9.es.js +0 -410
  62. package/.chunks/forms-1b3f76e9.es.js.map +0 -1
  63. package/.chunks/forms-512abfa7.amd.js +0 -413
  64. package/.chunks/forms-512abfa7.amd.js.map +0 -1
  65. package/helpers/helpers.amd.js +0 -6
  66. package/helpers/helpers.js +0 -6
  67. /package/{helpers → forms}/helpers.js.map +0 -0
@@ -0,0 +1,720 @@
1
+ var E = Object.defineProperty;
2
+ var I = (u, p, t) => p in u ? E(u, p, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[p] = t;
3
+ var i = (u, p, t) => (I(u, typeof p != "symbol" ? p + "" : p, t), t), C = (u, p, t) => {
4
+ if (!p.has(u))
5
+ throw TypeError("Cannot " + t);
6
+ };
7
+ var P = (u, p, t) => {
8
+ if (p.has(u))
9
+ throw TypeError("Cannot add the same private member more than once");
10
+ p instanceof WeakSet ? p.add(u) : p.set(u, t);
11
+ };
12
+ var y = (u, p, t) => (C(u, p, "access private method"), t);
13
+ import { C as w } from "./core-c3afa109.es.js";
14
+ import n from "../utils/dom.js";
15
+ import s from "../popup/worker.js";
16
+ import "vue";
17
+ import "../utils/device.js";
18
+ var g, k;
19
+ const v = class v {
20
+ constructor() {
21
+ // устанвоить компонент
22
+ P(this, g);
23
+ i(this, "componentName");
24
+ // имя класса компонента
25
+ i(this, "className");
26
+ // имя css класса компонента
27
+ i(this, "uid");
28
+ // уникальный id компонента
29
+ i(this, "el");
30
+ // элемент, связанный с компонентом
31
+ i(this, "options", {});
32
+ // параметры компонента
33
+ i(this, "unmountEls", []);
34
+ i(this, "unmountEvents", []);
35
+ }
36
+ // переопредлять нельзя
37
+ // если компонент инициирован, необходимо сразу его вернуть и выполнить reInit() вместо mount()
38
+ // используется init вместо constructor, так как super constructor выполняется до Object.defineProperty() параметров класса
39
+ init(p, t, e) {
40
+ if (!t)
41
+ throw p + ": el is undefined";
42
+ const o = v.getComponent(t, p);
43
+ if (o)
44
+ return o.reInit(e), o;
45
+ this.componentName = p, this.className = "top" + p[0].toUpperCase() + p.substring(1), this.uid = this.componentName + (Math.random() + "").replace(".", ""), y(this, g, k).call(this, t), this.el = t, this.el.classList.add(this.className), this.options = Object.assign(this.options, e), this.mount();
46
+ }
47
+ // получить инициированный компонент
48
+ static getComponent(p, t) {
49
+ return n.storage(p, "#" + t);
50
+ }
51
+ // функция подключения компонента
52
+ mount() {
53
+ throw "Please, add method mount() to component: " + this.componentName;
54
+ }
55
+ // функция отключения компонента
56
+ unmount() {
57
+ n.storage(this.el, "#" + this.componentName, null), this.unmountEls.forEach((p) => {
58
+ p.remove();
59
+ }), this.unmountEls = [], this.unmountEvents.forEach((p) => {
60
+ p.el.removeEventListener(p.type, p.listener, p.options);
61
+ }), this.unmountEvents = [];
62
+ }
63
+ // указание новые элементы, которые должны будут удалиться после unmount
64
+ registerElForUnmount(p) {
65
+ this.unmountEls.push(p);
66
+ }
67
+ // указание новые события, которые должны будут удалиться после unmount
68
+ addEventListenerWithUnmount(p, t, e, o) {
69
+ p.addEventListener(t, e, o), this.registerEventForUnmount(p, t, e, o);
70
+ }
71
+ // указание новые события, которые должны будут удалиться после unmount
72
+ registerEventForUnmount(p, t, e, o) {
73
+ const r = {
74
+ el: p,
75
+ type: t,
76
+ listener: e,
77
+ options: o
78
+ };
79
+ this.unmountEvents.push(r);
80
+ }
81
+ // функция перенастройки уже подключенного компонента
82
+ reInit(p) {
83
+ throw "Please, add method reInit() to component: " + this.componentName;
84
+ }
85
+ // удалить элементы из DOM, но не из памяти
86
+ static detach(p) {
87
+ var t;
88
+ if (p.forEach)
89
+ p.forEach((e) => {
90
+ var o;
91
+ return (o = e.parentElement) == null ? void 0 : o.removeChild(e);
92
+ });
93
+ else {
94
+ const e = p;
95
+ (t = e.parentElement) == null || t.removeChild(e);
96
+ }
97
+ }
98
+ };
99
+ g = new WeakSet(), k = function(p) {
100
+ n.storage(p, "#" + this.componentName, this);
101
+ }, i(v, "componentName", "Top");
102
+ let x = v;
103
+ class A {
104
+ static init() {
105
+ document.addEventListener("click", this.onclick), document.addEventListener("keydown", this.onkeydown);
106
+ }
107
+ /**
108
+ * Глобальный обработчик кликов
109
+ * обрабатывает клики внутри Popup
110
+ * @param {Event} e
111
+ */
112
+ static onclick(p) {
113
+ var e;
114
+ const t = p.target.closest(".closer, a, .a, .top-button");
115
+ if (t) {
116
+ const o = p.target.closest(".top-popup-wrapper");
117
+ if (!o || t.matches(".top-popup-noCloser"))
118
+ return;
119
+ if (t.getAttribute("href") === "." && p.preventDefault(), p.target.matches("[data-top-popup]")) {
120
+ const r = p.target.closest("ul"), l = p.target.closest("a, .a");
121
+ r && ((e = r.querySelector("a.top-active, .a.top-active")) == null || e.classList.remove("top-active")), l && l.classList.add("top-active");
122
+ return;
123
+ }
124
+ s.close(o);
125
+ }
126
+ if (p.target.matches(".top-popup-wrapper")) {
127
+ const o = p.target;
128
+ s.close(o);
129
+ }
130
+ }
131
+ /**
132
+ * Глобальный обработчик нажатия кнопки на клавиатуре
133
+ * @param {Event} e
134
+ */
135
+ static onkeydown(p) {
136
+ var o;
137
+ const t = p.target.closest(".top-popup-wrapper");
138
+ if (!t)
139
+ return;
140
+ const e = t.querySelector("ul.top-popup_content");
141
+ switch (p.key) {
142
+ case "Escape":
143
+ break;
144
+ case "Enter":
145
+ if (!e) {
146
+ if (n.querySelectorVisible(t, ".preloader"))
147
+ break;
148
+ const c = t.querySelector(".top-popup_footer .go, .top-popup_footer [data-action]");
149
+ c && c.click();
150
+ break;
151
+ }
152
+ const r = n.querySelectorVisible(t, "li > a.top-active");
153
+ r && (p.preventDefault(), location.href = r.getAttribute("href"));
154
+ const l = t.querySelector("li > .top-active");
155
+ l && l.click();
156
+ break;
157
+ case "ArrowUp":
158
+ case "ArrowRight":
159
+ case "ArrowDown":
160
+ case "ArrowLeft":
161
+ if (!e)
162
+ break;
163
+ p.key === "ArrowRight" || p.key === "ArrowLeft" ? n.querySelectorVisible(t, "ul.top-popup_content > li:not(.top-popup_listTitle):not(.top-popup_listDelimiter) > .top-active > .top-popup_listMore") && p.preventDefault() : p.preventDefault();
164
+ const h = (o = t.querySelector("ul.top-popup_content > li:not(.top-popup_listTitle):not(.top-popup_listDelimiter) > .top-active")) == null ? void 0 : o.parentElement;
165
+ if (p.key === "ArrowRight" && h) {
166
+ const c = h.querySelector(".top-active > .top-popup_listMore");
167
+ if (c)
168
+ return c.click();
169
+ }
170
+ const f = n.querySelectorAllVisible(t, "ul.top-popup_content > li:not(.top-popup_listTitle):not(.top-popup_listDelimiter)"), d = f.length;
171
+ let a = f.indexOf(h);
172
+ if (p.key === "ArrowUp" || p.key === "ArrowLeft" ? a-- : a++, p.key === "ArrowLeft" && a === -1)
173
+ return p.target.matches("input") ? void 0 : s.close(t);
174
+ if (p.key === "ArrowRight" && a === d)
175
+ return;
176
+ a < 0 && (a = d - 1), a > d - 1 && (a = 0), t.querySelectorAll("ul.top-popup_content > li > .top-active").forEach((c) => c.classList.remove("top-active")), f[a].querySelector(":scope > a, :scope > .a").classList.add("top-active"), s.scrollToActive(t);
177
+ break;
178
+ }
179
+ }
180
+ }
181
+ const q = `:root{
182
+ --top-popup-background-color-hover: var(--color-steel-150);
183
+ --top-popup-background-color-active: var(--color-steel-200);
184
+ --top-popup-border-color: var(--color-theme-100);
185
+ --top-popup-title-background-color: var(--color-steel-100);
186
+ }
187
+
188
+ .top-theme-dark{
189
+ --top-popup-background-color-hover: var(--color-gray-800);
190
+ --top-popup-background-color-active: var(--color-gray-750);
191
+ --top-popup-title-background-color: var(--color-gray-900);
192
+ }
193
+
194
+ .top-popup-front{ position: relative; }
195
+
196
+ .top-popup-wrapper{
197
+ --top-popup-background-color: var(--color-bg-3);
198
+
199
+ --top-popup-padding-h: 8px;
200
+ --top-popup-padding-v: 8px;
201
+
202
+ /* см. recalcPosition() */
203
+ --top-popup-height: 0px;
204
+ --top-popup-right-bounding: 0px;
205
+ --top-popup-bottom-bounding: 0px;
206
+ --top-popup-top: 0px;
207
+ --top-popup-right: calc(100vw - var(--top-popup-right-bounding));
208
+ --top-popup-bottom: calc(var(--100vh) - var(--top-popup-bottom-bounding));
209
+ --top-popup-left: 0px;
210
+
211
+ text-align: initial; white-space: normal; word-break: normal;
212
+ position: absolute; z-index: 200000;
213
+ }
214
+ .top-popup-wrapper:not(.top-popup-wrapper-shown){ overflow: hidden; }
215
+
216
+ /* top-popupPanel */
217
+ .top-popupPanel {
218
+ cursor: default;
219
+ box-shadow: var(--top-shadow-b);
220
+ border-radius: 8px;
221
+ background: var(--top-popup-background-color);
222
+ position: absolute; overflow: hidden;
223
+ display: flex; flex-direction: column;
224
+ }
225
+
226
+ /* position */
227
+ .top-popup-wrapper > *{ opacity: 0; transition: opacity 100ms linear, transform 100ms linear; }
228
+ .top-popup-wrapper.p0 > *{ transform: translateY(-8px); }
229
+ .top-popup-wrapper.p1 > *{ transform: translateY(8px); }
230
+ .top-popup-wrapper.p2 > *{ transform: translateX(8px); }
231
+ .top-popup-wrapper.p3 > *{ transform: translateY(8px); }
232
+ .top-popup-wrapper.p4 > *{ transform: translateX(-8px); }
233
+ .top-popup-wrapper-shown:not(.top-popup-wrapper-closed) > *{opacity: 1;transform: translate(0, 0) !important;}
234
+
235
+ .top-popup-wrapper.p0 > .top-popup{ top: calc(-16px); left: calc(0px - var(--top-popup-padding-h)); }
236
+ .top-popup-wrapper.p1 > .top-popup{ bottom: calc(100% + 8px); }
237
+ .top-popup-wrapper.p2 > .top-popup{ left: calc(100% + 8px); }
238
+ .top-popup-wrapper.p3 > .top-popup{ top: calc(100% + 8px); }
239
+ .top-popup-wrapper.p4 > .top-popup{ right: calc(100% + 8px); }
240
+ .top-popup-wrapper.p2 > .top-popup,
241
+ .top-popup-wrapper.p4 > .top-popup{ margin-top: -10px; }
242
+
243
+ .top-popup-wrapper.p1.with_notch > .top-popup{ margin-bottom: 5px; }
244
+ .top-popup-wrapper.p2.with_notch > .top-popup{ margin-left: 5px; }
245
+ .top-popup-wrapper.p3.with_notch > .top-popup{ margin-top: 5px; }
246
+ .top-popup-wrapper.p4.with_notch > .top-popup{ margin-right: 5px; }
247
+
248
+ .top-popup-wrapper.invert-x > .top-popup{ right: 0; }
249
+ .top-popup-wrapper.invert-y > .top-popup{ bottom: 0; }
250
+
251
+ /* notch */
252
+ .top-popup-wrapper > .notch{ border: 7.4px solid transparent; position: absolute; display: block; }
253
+
254
+ .top-popup-wrapper.p1 > .notch{ border-bottom: 0; border-top: 7.4px solid var(--content-background-color); margin: 0 0 7.4px -7.4px; bottom: 100%; left: 50% }
255
+ .top-popup-wrapper.p2 > .notch{ border-left: 0; border-right: 7.4px solid var(--content-background-color); margin: 0 0 -7.4px 7.4px; bottom: 50%; left: 100%; }
256
+ .top-popup-wrapper.p3 > .notch{ border-top: 0; border-bottom: 7.4px solid var(--content-background-color); margin: 7.4px 0 0 -7.4px; top: 100%; left: 50%; }
257
+ .top-popup-wrapper.p4 > .notch{ border-right: 0; border-left: 7.4px solid var(--content-background-color); margin: 0 7.4px -7.4px 0; bottom: 50%; right: 100%; }
258
+
259
+ .top-popup-wrapper.p1 > .notch-border{ border-top-color: rgba(0,0,0,0.05); margin-bottom: 6px; }
260
+ .top-popup-wrapper.p2 > .notch-border{ border-right-color: rgba(0,0,0,0.05); margin-left: 6px; }
261
+ .top-popup-wrapper.p3 > .notch-border{ border-bottom-color: rgba(0,0,0,0.05); margin-top: 6px; }
262
+ .top-popup-wrapper.p4 > .notch-border{ border-left-color: rgba(0,0,0,0.05); margin-right: 6px; }
263
+
264
+ /* common */
265
+ .top-popup_header,
266
+ .top-popup_content,
267
+ .top-popup_footer{ padding: var(--top-popup-padding-h) var(--top-popup-padding-h); font-size: 14px; }
268
+ .top-popup_header,
269
+ .top-popup_footer{ display: flex; align-items: center; justify-content: space-between; }
270
+
271
+ /* header */
272
+ .top-popup_header{ border-bottom: 1px solid var(--top-popup-border-color); font-weight: 600; }
273
+ .top-popup_header > *{ font-weight: 400; }
274
+ .top-popup_header > .a{ cursor: pointer; color: var(--color-blue-450); }
275
+ .top-popup_header > .a:hover{ color: var(--color-blue-350); }
276
+
277
+ .top-popup-headerButton{ width: 60px; }
278
+
279
+ /* content */
280
+ .top-popup .top-popup_content{
281
+ /* has_scroll */
282
+ --scroll-padding-top: var(--top-popup-padding-v);
283
+ --scroll-padding-bottom: var(--top-popup-padding-v);
284
+
285
+ padding-top: var(--top-popup-padding-v); padding-bottom: var(--top-popup-padding-v); margin: 0; line-height:1.3 !important;
286
+ flex-grow: 1; overflow-y: auto;
287
+ -webkit-overflow-scrolling: touch;
288
+ }
289
+
290
+ .top-popup .top-popup_content .top-unwrap{
291
+ --top-unwrap-x: var(--top-popup-padding-h);
292
+ }
293
+
294
+ .top-popup div.top-popup_content{ display: flex; flex-direction: column; gap: 4px; }
295
+ .top-popup div.top-popup_content > *{ flex-shrink: 0; }
296
+ .top-popup div.top-popup_content > .top-button{ margin: 0; }
297
+
298
+ .top-popup ul.top-popup_content{
299
+ --scroll-padding-top: 4px;
300
+ --scroll-padding-bottom: var(--scroll-padding-top);
301
+
302
+ padding: var(--scroll-padding-top) 0;
303
+ }
304
+
305
+ ul.top-popup_content li{ margin: 0; list-style:none; display: flex; position: relative }
306
+ ul.top-popup_content li > *{ flex-grow: 1; }
307
+ ul.top-popup_content li > a:not(.top-button),
308
+ ul.top-popup_content li > i.a{
309
+ cursor: pointer;
310
+ box-sizing: border-box;
311
+ background: var(--top-popup-background-color); padding:var(--top-popup-padding-v) var(--top-popup-padding-h);
312
+ color:var(--color-text) !important; font-size: 14px; font-weight: normal !important; text-decoration:none !important; font-style: normal;
313
+ display:flex; flex: 1 1 100%; align-items: center;
314
+ transition: background-color 0.1s ease-in-out;
315
+ }
316
+ .top-popup-wrapper-no_animate ul.top-popup_content li > a:not(.top-button),
317
+ .top-popup-wrapper-no_animate ul.top-popup_content li > i.a{ transition: none; }
318
+
319
+ ul.top-popup_content li > a:not(.top-button):hover,
320
+ ul.top-popup_content li > i.a:hover{ background: var(--top-popup-background-color-hover); }
321
+ ul.top-popup_content li > a:not(.top-button).top-active,
322
+ ul.top-popup_content li > i.a.top-active{ background: var(--top-popup-background-color-active); }
323
+
324
+ /* listTitle */
325
+ li.top-popup_listTitle{
326
+ background: var(--top-popup-title-background-color); padding: var(--top-popup-padding-v) var(--top-popup-padding-h);
327
+ color: var(--color-text-3); font-size: 12px; font-weight: 400;
328
+ }
329
+ li.top-popup_listTitle:first-child{
330
+ padding-top: calc(var(--top-popup-padding-v) + var(--scroll-padding-top));
331
+ margin-top: calc(0px - var(--scroll-padding-top));
332
+ }
333
+
334
+ /* listDelimiter */
335
+ ul.top-popup_content li.top-popup_listDelimiter{
336
+ border-radius: 3px;
337
+ background: var(--top-popup-border-color);
338
+ height: 2px;
339
+ margin: calc(var(--top-popup-padding-h) / 2) var(--top-popup-padding-h);
340
+ }
341
+
342
+ /* listMore */
343
+ ul.top-popup_content li > i.a.top-popup_listMore{
344
+ height: auto; padding-right: 4px; padding-left: 4px;
345
+ font-size: 24px; line-height: 17px; text-align: center;
346
+ flex-basis: 10px;
347
+ }
348
+ ul.top-popup_content li > i.a.top-popup_listMore:before{ color: var(--color-gray-500); }
349
+ ul.top-popup_content li > * > i.top-popup_listMore{
350
+ padding: 0 var(--top-popup-padding-h); margin: 0 0 0 auto;
351
+ color: var(--color-gray-500);
352
+ font-size: 14px;
353
+ }
354
+ ul.top-popup_content li > * > i.top-popup_listMore:hover,
355
+ ul.top-popup_content li > * > i.top-popup_listMore.top-active{ color: var(--color-blue-500); }
356
+ ul.top-popup_content li > * > i.top-popup_listMore:before{ transform: rotate(90deg); }
357
+
358
+ ul.top-popup_content li a.close{ background: none !important; }
359
+
360
+ /* data-top-icon */
361
+ .top-popup_content > [data-top-icon]:before{ --top-icon-size: 20px; }
362
+
363
+ ul.top-popup_content li > [data-top-icon]:not(.top-button):before{
364
+ --top-icon-color: var(--color-text-3);
365
+ --top-icon-size: 20px;
366
+ --top-icon-width: 20px;
367
+
368
+ height: 1rem; margin-right: 8px; transition: color 0.1s;
369
+ }
370
+ ul.top-popup_content li:hover > [data-top-icon]:not(.top-button):before,
371
+ ul.top-popup_content li > [data-top-icon]:not(.top-button).top-active:before{
372
+ --top-icon-color: #378DC6;
373
+ }
374
+
375
+ /* footer */
376
+ .top-popup_footer{
377
+ padding: var(--top-popup-padding-h) var(--top-popup-padding-h); display: flex; gap:8px; justify-content: flex-end;
378
+ }
379
+ .top-popup_footer > .top-button{ margin: 0; }
380
+
381
+ /* Виджеты */
382
+ .top-popup > [data-widget]{ padding: 0 var(--top-popup-padding-h); }
383
+ .top-popup > [data-widget] + hr{ margin: 0 var(--top-popup-padding-h); }
384
+
385
+ .top-popup .placeholder{
386
+ border:1px solid #E0D9D9 !important; border-right: none !important; border-left: none !important; background:#F9F9F9 !important; margin: -1px 0; z-index: 1;
387
+ position: relative;
388
+ }
389
+
390
+ /* компоненты */
391
+ .top-popup-wrapper.simple_list > .top-popup{ min-width: 0; white-space: nowrap; }
392
+
393
+ .top-popup_content .top-column{ display: flex; flex-direction: column; gap: 4px; }
394
+ .top-popup_content li > :not(a):not(.a){ margin:0 var(--top-popup-padding-h); }
395
+ html .top-popup .top-popup_content li > .top-button{ margin:calc(var(--top-popup-padding-v) / 2) var(--top-popup-padding-h); }
396
+
397
+ .top-popup li .check_all,
398
+ .top-popup li .clear_all{ cursor: pointer; color: var(--color-cyan); padding: 8px; display: inline-block; }
399
+ .top-popup li .check_all:hover,
400
+ .top-popup li .clear_all:hover{ text-decoration: underline; }
401
+ .top-popup li .clear_all{ display: none; }
402
+
403
+ /* table */
404
+ .top-popup_content table{ margin: -9px 0; }
405
+ .top-popup_content table td,
406
+ .top-popup_content table th{ padding: 9px var(--top-popup-padding-h) 9px 0; vertical-align: top; }
407
+ .top-popup_content table th{ width: 40%; font-weight: 600; white-space: nowrap; }
408
+
409
+ /* формы */
410
+ ul.top-popup_content .a > [type="checkbox"],
411
+ ul.top-popup_content .a > [type="radio"]{ margin: -8px 0 -8px auto; }
412
+
413
+ /* deprecated */
414
+ ul.top-popup_content a > [class*=icon],
415
+ ul.top-popup_content i.a > [class*=icon]{
416
+ margin-right: 14px; text-align: center;
417
+ width: auto; height: 16px; font-size: 16px; vertical-align: top;
418
+ transition: 0.1s;
419
+ }
420
+
421
+ .top-popup .buttons{ border-radius:0 0 4px 4px; border-top:1px solid #BDC3C7; background:#ECF0F1; padding:10px 15px; margin:10px -15px -10px -15px; white-space: nowrap; }
422
+ .top-popup_footer [class*=btn]:not(.btn-transparent){ min-width: 100px; padding: 5px 14px; margin-left: 10px; }
423
+ .top-popup_footer [class*=btn]:first-child{ margin-left: 0; }
424
+ .top-popup_footer .btn.full_width{ margin: 0; flex-grow: 1; }`, F = `html.with_popup{ background: #808080; }
425
+
426
+ .top-popup-wrapper{
427
+ --top-popup-padding-h: 19px;
428
+ --top-popup-padding-v: 16px;
429
+ --top-popup-footer-offset: 25px;
430
+
431
+ width: auto !important; height: auto !important;
432
+ position: fixed; top: 0 !important; right: 0 !important; left: 0 !important; overflow: hidden;
433
+ transition: background 0.3s;
434
+ }
435
+
436
+ .top-popup-wrapper-shown:not(.top-popup-wrapper-closed){ background: rgba(0,0,0,0.5); backdrop-filter: blur(1px); }
437
+ .top-popup-wrapper-shown:not(.top-popup-wrapper-closed) > .top-popup{ opacity: 1 !important; }
438
+
439
+ .top-popup{
440
+ border-radius: 8px 8px 0 0; width: auto !important; max-height: calc(100% - var(--header-height) - 12px);
441
+ top: auto !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
442
+ display: flex; flex-direction: column;
443
+
444
+ /* невозможно опустить элемент вниз за экран на 100%, fix: opacity и translateY(80%) */
445
+ transform: translateY(80%);
446
+
447
+ transition: opacity 0.3s, transform 0.3s;
448
+ }
449
+
450
+ /* from top */
451
+ .top-popup-wrapper.p-from-top{
452
+ --top-popup-footer-offset: 0px;
453
+
454
+ top: var(--header-height) !important;
455
+ }
456
+ .with_dialog .top-popup-wrapper.p-from-top{ top: 50px !important; }
457
+ .top-popup-wrapper.p-from-top > .top-popup{
458
+ border-radius: 0 0 8px 8px; max-height: calc(100% - 24px); top: 0 !important; bottom: auto !important;
459
+ transform: translateY(calc(-100% - 24px));
460
+ }
461
+
462
+ .top-popup_content:last-child,
463
+ .top-popup_footer{
464
+ --scroll-padding-bottom: calc(var(--top-popup-padding-v) + var(--top-popup-footer-offset));
465
+
466
+ padding-bottom: var(--scroll-padding-bottom);
467
+ }
468
+
469
+ /* content */
470
+ ul.top-popup_content{
471
+ --scroll-padding-top: 0px;
472
+ --scroll-padding-bottom: var(--scroll-padding-top);
473
+
474
+ display: flex; flex-direction: column;
475
+ }
476
+ ul.top-popup_content li:not(:last-child){ border-bottom: 1px solid var(--top-popup-border-color); }
477
+
478
+ .top-popup-wrapper.top-style_alt > .top-popup > ul > li{ border-bottom: none; }
479
+
480
+ /* footer */
481
+ .top-popup_footer{ flex-wrap: wrap; }
482
+ .top-popup_footer > .top-button{
483
+ --top-forms-base-height: var(--top-forms-base-height_xl);
484
+
485
+ flex-grow: 1;
486
+ }
487
+
488
+ /* listTitle */
489
+ ul.top-popup_content li.top-popup_listTitle{
490
+ --top-popup-padding-v: 12px;
491
+ }
492
+
493
+ /* listDelimiter */
494
+ ul.top-popup_content li.top-popup_listDelimiter{ border-radius: 0; border-bottom: none; height: 2px; margin: 0; }`, M = `html:not(.with_dialog){ margin-right: 0 !important; }
495
+
496
+ .top-popup{ min-width: 250px; max-width: calc(100vw - var(--top-popup-left) - 16px); max-height: calc(var(--top-popup-bottom) + var(--top-popup-height)); }
497
+ .top-popup-wrapper.invert-x > .top-popup{ max-width: calc(100vw - var(--top-popup-right) - 16px); }
498
+ .top-popup-wrapper.invert-y > .top-popup{ max-height: calc(100vh - var(--top-popup-bottom) - 16px); }
499
+
500
+ /* position */
501
+ .top-popup-wrapper.p1 > .top-popup{ max-height: calc(var(--top-popup-top) - var(--header-height) - 16px); }
502
+ .top-popup-wrapper.p3 > .top-popup{ max-height: calc(var(--top-popup-bottom) - 16px); }
503
+ .top-popup-wrapper.p2 > .top-popup{ max-width: calc(var(--top-popup-right) - 16px); }
504
+ .top-popup-wrapper.p4 > .top-popup{ max-width: calc(var(--top-popup-left) - 16px); }
505
+
506
+ /* notch */
507
+ .top-popup-wrapper.p1.with_notch > .top-popup,
508
+ .top-popup-wrapper.p3.with_notch > .top-popup{ margin-left: -16px !important; }
509
+ .top-popup-wrapper.p1.with_notch > .notch,
510
+ .top-popup-wrapper.p3.with_notch > .notch{ margin-left: -8px !important; }
511
+
512
+ .top-popup-wrapper.p1.with_notch.invert-x,
513
+ .top-popup-wrapper.p3.with_notch.invert-x{ margin-left: 3px !important; }
514
+ .top-popup-wrapper.p1.with_notch.invert-x > .notch,
515
+ .top-popup-wrapper.p3.with_notch.invert-x > .notch{ margin-left: -9px !important; }
516
+
517
+ /* listMore */
518
+ ul.top-popup_content li > * > i.top-popup_listMore{ visibility: hidden; transition: none; }
519
+ ul.top-popup_content li:hover > * > i.top-popup_listMore,
520
+ ul.top-popup_content li > *.top-active > i.top-popup_listMore,
521
+ ul.top-popup_content li > * > i.top-popup_listMore.top-active{ visibility: visible; }`;
522
+ w.appendStyle(q);
523
+ w.appendStyle(F, "m");
524
+ w.appendStyle(M, "pc");
525
+ const b = class b extends x {
526
+ // el - элемент, открывающий меню
527
+ constructor(t, e) {
528
+ super();
529
+ i(this, "el");
530
+ // элемент, вызвавший открытие Popup
531
+ i(this, "elActiveByDefault");
532
+ // элемент уже имеет класс top-active перед открытием окна
533
+ i(this, "elPopup");
534
+ i(this, "elPopupInner");
535
+ i(this, "elPopupHeader");
536
+ i(this, "elPopupBody");
537
+ i(this, "elPopupFooter");
538
+ i(this, "elFront");
539
+ i(this, "popupParent");
540
+ i(this, "$");
541
+ // только, если есть jQuery
542
+ i(this, "elStartPosition");
543
+ // используется для useOriginal
544
+ i(this, "shift", {
545
+ top: 0,
546
+ left: 0
547
+ });
548
+ i(this, "isClosed", !1);
549
+ // флаг того, что меню закрыто
550
+ i(this, "isFirstClick", !0);
551
+ i(this, "type");
552
+ // selector или html
553
+ i(this, "options", {
554
+ popup: "",
555
+ // selector, text
556
+ p: 0,
557
+ // положение меню (0 - над элементом, 1 - сверху, 2 - справа, 3 - снизу, 4 слева)
558
+ notch: !1,
559
+ // отображать ли клювик
560
+ class: "",
561
+ // класс, добавляемый меню
562
+ posBy: "left",
563
+ // способ привязки позиционирования меню (left/right - левый/правый край родителя, fixed - по окну)
564
+ frontSelector: "",
565
+ invertX: !1,
566
+ // базовая ордината - правая граница элемента, а не левая
567
+ openByHover: !1,
568
+ // открывать при наведении
569
+ useOriginal: !1,
570
+ // использовать оригинальный шаблон, без клонирвоания (для сохранения состояния меню)
571
+ isFullScreen: !1,
572
+ i18n: {}
573
+ });
574
+ i(this, "events", {});
575
+ return this.init(b.componentName, t, e);
576
+ }
577
+ async mount() {
578
+ const t = this.vueGetComponent();
579
+ if (this.popupParent = s.getPopup(this.el.closest(".top-popup-wrapper")), await this.mountJQuery(), n.css(this.el, "position") !== "absolute" && (this.el.style.position = "relative"), this.el.dataset.topPopupOpened = "opened", this.elActiveByDefault = this.el.classList.contains("top-active"), this.el.classList.add("top-active"), t)
580
+ this.type = "vue", this.options.popup = "", this.elPopup = n.genEl("div", {}, this.options.popup);
581
+ else if (this.options.popup.match(/^[#.]/))
582
+ this.type = "selector", this.elPopup = document.querySelector(`${this.options.popup}.template`);
583
+ else {
584
+ if (this.type = "html", this.options.useOriginal)
585
+ throw "Option useOriginal not allowed for text templates";
586
+ this.elPopup = n.genEl("div", {}, this.options.popup);
587
+ }
588
+ if (!this.elPopup || t != null && t.opened) {
589
+ if (this.options.useOriginal || t != null && t.opened) {
590
+ if (t != null && t.opened ? this.elPopup = t.popup.elPopup : this.elPopup = document.querySelector(`${this.options.popup}.top-popup-wrapper-shown`), this.elPopup) {
591
+ this.el.dataset.topPopupOpened = "", this.elActiveByDefault || this.el.classList.remove("top-active"), s.close(this.elPopup), setTimeout(() => this.mount(), 300);
592
+ return;
593
+ }
594
+ throw "Option useOriginal state allowed only elements .template";
595
+ }
596
+ this.elPopup = document.querySelector(`${this.options.popup}:not(.top-popup-wrapper)`);
597
+ }
598
+ if (!this.elPopup)
599
+ return;
600
+ for (this.options.useOriginal ? (this.elStartPosition = this.elPopup.closest(".top-popup-el-start-position"), this.elStartPosition || (this.elStartPosition = n.wrap(this.elPopup, "i"), this.elStartPosition.classList.add("top-popup-el-start-position", "hidden"))) : (this.elPopup = this.elPopup.cloneNode(!0), this.type === "selector" && !this.elPopup.matches(".template") && (this.elPopup.classList.remove("hidden"), this.elPopup.querySelector(":scope > .top-popup_content") || this.elPopup.classList.add("top-popup_content"), this.elPopup = n.wrap(this.elPopup, "div")), this.type === "html" && (this.elPopup.querySelector(":scope > .top-popup_content") || (this.elPopup.classList.add("top-popup_content"), this.elPopup = n.wrap(this.elPopup, "div"))), (this.type === "selector" && !this.elPopup.matches(".template") || this.type === "html" || this.type === "vue") && (n.querySelectorAllArray(this.elPopup, "[data-top-popup]").forEach((r) => r.dataset.topPopupPosBy = "fixed"), n.querySelectorAllArray(this.elPopup, ".top-popup-wrapper").forEach((r) => r.remove()))), s.decoratorBeforeOpen(this), t && (this.options.class = t.classRef.value), this.elPopupInner = document.createElement("div"), this.elPopupInner.classList.add("top-popupPanel", "top-popup"); this.elPopup.firstChild; )
601
+ this.elPopupInner.appendChild(this.elPopup.firstChild);
602
+ if (this.elPopup.append(this.elPopupInner), this.elPopup.classList.add("top-popup-wrapper"), this.options.class) {
603
+ const r = this.options.class.split(" ");
604
+ this.elPopup.classList.add(...r);
605
+ }
606
+ this.options.notch && (this.elPopup.classList.add("with_notch"), this.elPopup.insertAdjacentHTML("beforeend", '<i class="notch notch-border"></i><i class="notch"></i>')), await this.vueOpen(), this.elPopupHeader = this.elPopupInner.querySelector(".top-popup_header"), this.elPopupBody = this.elPopupInner.querySelector(".top-popup_content"), this.elPopupFooter = this.elPopupInner.querySelector(".top-popup_footer");
607
+ const e = !!this.elPopup.querySelector('[data-widget="search"]');
608
+ this.options.isFullScreen && !e && (this.elPopupHeader || (this.elPopupHeader = n.genEl("i", { class: "header" }), this.elPopupInner.prepend(this.elPopupHeader), this.elPopupHeader.prepend(n.genEl("i", { class: "a closer" }, this.options.i18n.Close)), this.elPopupHeader.append(n.genEl("i", { class: "top-popup-headerButton" })))), n.storage(this.elPopup, "Popup", this), this.options.frontSelector && (this.elFront = document.querySelector(this.options.frontSelector)), this.elFront || (this.elFront = this.el.closest(".top-popup-front")), this.elFront || (this.elFront = document.body), this.elPopup.style.width = this.el.offsetWidth + "px", this.elPopup.style.height = this.el.offsetHeight + "px", this.elPopup.style.top = this.el.offsetTop + "px", this.elPopup.style.right = parseInt(this.el.style.right || 0) + "px", this.elPopup.style.bottom = parseInt(this.el.style.bottom || 0) + "px", this.el.parentElement.insertBefore(this.elPopup, this.el), this.elPopup.classList.remove("template"), this.options.invertX && this.elPopup.classList.add("invert-x");
609
+ let o = !!this.el.closest(".modal-header");
610
+ o || (o = !!this.el.closest("#top_panel")), o || (o = !!this.el.closest("#secondmenu")), o && this.elPopup.classList.add("p-from-top"), setTimeout(() => this.elPopup.classList.add("top-popup-wrapper-shown")), this.elFront && !this.elFront.matches("body") && (this.elFront.append(this.elPopup), this.shift.top = n.offset(this.el).top - this.el.offsetTop - n.offset(this.elFront).top, this.shift.left = n.offset(this.el).left - this.el.offsetLeft - n.offset(this.elFront).left, this.shift.top -= parseInt(this.el.style["margin-top"] || 0), this.shift.left -= parseInt(this.el.style["margin-left"] || 0), this.elPopup.style.top = parseInt(this.elPopup.style.top || "0") + this.shift.top + "px", this.elPopup.style.left = parseInt(this.elPopup.style.left || "0") + this.shift.left + "px"), this.$ && this.$.trigger("aftershow.top-menu-popup", [jQuery(this.elPopup)]), this.recalcPosition(), this.elPopup.setAttribute("tabindex", 0), this.focus(), s.decoratorAfterOpen(this), this.mountEvents();
611
+ }
612
+ async mountJQuery() {
613
+ typeof jQuery == "function" && (this.$ = jQuery(this.el));
614
+ }
615
+ /**
616
+ * Выполнить фокусировку на нужный элемент после открытия окна
617
+ */
618
+ focus() {
619
+ let t = n.querySelectorVisible(this.elPopup, ".top-popup-autofocus");
620
+ t || (t = n.querySelectorVisible(this.elPopup, ":read-write, select:not(:disabled)")), t || (t = n.querySelectorVisible(this.elPopup, ".top-popup_footer .top-button")), t || (t = this.elPopup), t.focus();
621
+ }
622
+ mountEvents() {
623
+ this.addEventListenerWithUnmount(document, "mousedown", (t) => this.onMousedown(t)), this.addEventListenerWithUnmount(this.elPopup, "focus", (t) => this.onFocus(t)), this.options.openByHover && (this.addEventListenerWithUnmount(this.elPopup, "mouseleave", (t) => this.onMouseleave(t)), this.addEventListenerWithUnmount(this.elPopupInner, "mouseleave", (t) => this.onMouseleave(t))), this.options.isFullScreen && this.addEventListenerWithUnmount(this.elPopupBody, "touchmove", (t) => this.onTouchmove(t));
624
+ }
625
+ /**
626
+ * Обработка клика вне окна
627
+ * @param {Event} e
628
+ */
629
+ onMousedown(t) {
630
+ if (!this.elPopup || !this.isFirstClick || (this.isFirstClick = !1, setTimeout(() => this.isFirstClick = !0), t.button !== 0))
631
+ return;
632
+ let e = n.querySelectorVisibleLast(document.body, ":scope > .top-popup-wrapper");
633
+ e && e !== this.elPopup || (e = n.querySelectorVisibleLast(t.target.closest(".top-popup-front"), ":scope > .top-popup-wrapper"), !(e && e !== this.elPopup) && (this.elPopup.contains(t.target) || this.elPopup.closest(".ui-dialog") && !t.target.closest(".ui-dialog") || s.decoratorIsIgnoreOuterClick(t) || s.close(this.elPopup)));
634
+ }
635
+ /**
636
+ * Закрыть другие Popup при фокусе на элемент формы в текущем
637
+ * @param {Event} e
638
+ */
639
+ onFocus(t) {
640
+ if (t.target.matches("input") || this.isClosed)
641
+ return;
642
+ s.getAllVisible().forEach((o) => {
643
+ var r, l, h;
644
+ this.elPopup.contains(o) || ((r = this.popupParent) == null ? void 0 : r.elPopup) === o || ((h = (l = this.popupParent) == null ? void 0 : l.popupParent) == null ? void 0 : h.elPopup) === o || s.close(o);
645
+ });
646
+ }
647
+ /**
648
+ * Закрыть Popup при отведении мыши
649
+ * @param {Event} _e
650
+ */
651
+ onMouseleave(t) {
652
+ setTimeout(() => {
653
+ this.elPopupInner.matches(":hover") || s.close(this.elPopup);
654
+ }, 100);
655
+ }
656
+ /**
657
+ * Контроль положения Popup при fixed позиционировании
658
+ */
659
+ onResize() {
660
+ this.elPopup.parentElement !== document.body && document.body.append(this.elPopup), this.elPopup.style.top = n.offset(this.el).top + "px", this.elPopup.style.left = n.offset(this.el).left + "px";
661
+ }
662
+ unmount() {
663
+ super.unmount(), this.el.dataset.topPopupOpened = "", this.elActiveByDefault || this.el.classList.remove("top-active");
664
+ let t = this.el.getAttribute("style");
665
+ t && (t = t.replace(/position:[^;]*;?/g, ""), this.el.setAttribute("style", t));
666
+ }
667
+ // контроль за положением Popup, чтобы оно не вылезало за пределы документа
668
+ recalcPosition() {
669
+ let t = this.options.p, e;
670
+ switch (this.elPopup.style.height = this.el.offsetHeight + "px", this.elPopup.classList.remove("p0", "p1", "p2", "p3", "p4"), this.elPopup.classList.add("p" + t), this.options.posBy) {
671
+ case "left":
672
+ e = this.el.offsetLeft + parseInt(this.el.style["margin-left"] || 0), e += this.shift.left, this.elPopup.style.left = e + "px";
673
+ break;
674
+ case "right":
675
+ e = this.el.offsetLeft + parseInt(this.el.style["margin-left"] || 0), this.elPopup.style.right = this.el.offsetParent.offsetWidth - this.el.offsetWidth - e + "px";
676
+ break;
677
+ case "fixed":
678
+ this.addEventListenerWithUnmount(window, "resize", () => this.onResize()), this.onResize();
679
+ break;
680
+ default:
681
+ this.options.posBy.append(this.elPopup);
682
+ }
683
+ const o = this.elPopup.getBoundingClientRect();
684
+ this.elPopup.style.setProperty("--top-popup-height", this.elPopup.offsetHeight + "px"), this.elPopup.style.setProperty("--top-popup-right-bounding", o.right + "px"), this.elPopup.style.setProperty("--top-popup-bottom-bounding", o.bottom + "px"), this.elPopup.style.setProperty("--top-popup-top", o.top + "px"), this.elPopup.style.setProperty("--top-popup-left", o.left + "px"), this.elPopupInner.style.maxWidth = "unset", this.elPopupInner.style.maxHeight = "unset";
685
+ let r = !1, l = !1, h = !1, f = !1, d = o.left > window.innerWidth / 2, a = o.top > window.innerHeight / 2;
686
+ t === 4 && (d = !d), t === 1 && (a = !a);
687
+ const c = this.elPopupInner.getBoundingClientRect(), L = window.innerWidth - c.right, S = window.innerHeight - c.bottom, m = 8;
688
+ c.top < m && (r = !0), L < m && (l = !0), S < m && (h = !0), c.left < m && (f = !0), r && (t === 0 || t === 1) && a && (t = 3), h && t === 3 && a && (t = 1), l && t === 2 && d && (t = 4), f && t === 4 && d && (t = 2), l && (t === 0 || t === 1 || t === 3) && this.elPopup.classList.add("invert-x"), h && (t === 2 || t === 4) && a && (t === 2 && !d && this.elPopup.classList.add("invert-y"), t === 4 && !d && this.elPopup.classList.add("invert-x"), this.elPopup.matches(".invert-y") || (t = 1)), this.elPopup.classList.remove("p0", "p1", "p2", "p3", "p4"), this.elPopup.classList.add("p" + t), this.elPopupInner.style.maxWidth = "", this.elPopupInner.style.maxHeight = "", s.scrollToActive(this.elPopup);
689
+ }
690
+ onTouchmove(t) {
691
+ t.currentTarget.scrollWidth > t.currentTarget.offsetWidth || t.target.parentElement.scrollWidth > t.target.parentElement.offsetWidth || t.currentTarget.matches(".has_scroll") || t.preventDefault();
692
+ }
693
+ close() {
694
+ this.isClosed || (this.isClosed = !0, this.$ && this.$.trigger("afterclose.top-menu-popup", [jQuery(this.elPopup)]), !s.noClose && (this.unmount(), this.elPopup.classList.add("top-popup-wrapper-closed"), setTimeout(() => {
695
+ var o, r, l;
696
+ this.vueClose(), this.options.useOriginal ? (this.elPopup.removeAttribute("style"), this.elPopup.classList.remove("top-popup-wrapper-shown", "top-popup-wrapper-closed"), this.elPopup.classList.add("template"), this.elStartPosition.append(this.elPopup), (o = this.elPopup.querySelector("div.top-popup_content.top-column")) == null || o.classList.remove("top-column"), (r = this.elPopup.querySelector(".notch-border")) == null || r.remove(), (l = this.elPopup.querySelector(".notch")) == null || l.remove(), this.elPopupInner.replaceWith(...this.elPopupInner.childNodes), n.storageClear(this.elPopup)) : (n.storageClear(this.elPopup), this.elPopup.remove(), delete this.elPopup);
697
+ const t = s.getAllVisible(), e = t.length && t[t.length - 1];
698
+ e ? s.getPopup(e).focus() : document.documentElement.classList.remove("with_popup");
699
+ }, 300)));
700
+ }
701
+ async vueOpen() {
702
+ var t;
703
+ await ((t = this.vueGetComponent()) == null ? void 0 : t.onOpen(this));
704
+ }
705
+ vueClose() {
706
+ var t;
707
+ (t = this.vueGetComponent()) == null || t.onClose(this);
708
+ }
709
+ // получить vueConnectors компонента Popup
710
+ vueGetComponent() {
711
+ return s.vueConnectors.get(this.el.dataset.topPopupId);
712
+ }
713
+ };
714
+ i(b, "componentName", "Popup");
715
+ let _ = b;
716
+ A.init();
717
+ export {
718
+ _ as default
719
+ };
720
+ //# sourceMappingURL=popup-95d27020.es.js.map