@topvisor/ui 0.9.24 → 0.9.26-dev
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/{datepicker-B28_yC8V.es.js → datepicker-BMrdz1zd.es.js} +2 -2
- package/.chunks/{datepicker-B28_yC8V.es.js.map → datepicker-BMrdz1zd.es.js.map} +1 -1
- package/.chunks/{datepicker-CDoo2d0x.amd.js → datepicker-C0rB8tdN.amd.js} +2 -2
- package/.chunks/{datepicker-CDoo2d0x.amd.js.map → datepicker-C0rB8tdN.amd.js.map} +1 -1
- package/.chunks/{forms-U97cW1zp.es.js → forms-C4UtO06K.es.js} +224 -224
- package/.chunks/forms-C4UtO06K.es.js.map +1 -0
- package/.chunks/forms-DujTMzoW.amd.js +3 -0
- package/.chunks/forms-DujTMzoW.amd.js.map +1 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C_o5sC8m.es.js → listItem.vue_vue_type_script_setup_true_lang-CHYNz0kA.es.js} +2 -2
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C_o5sC8m.es.js.map → listItem.vue_vue_type_script_setup_true_lang-CHYNz0kA.es.js.map} +1 -1
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C67aHWhi.amd.js → listItem.vue_vue_type_script_setup_true_lang-Ob3185Bq.amd.js} +2 -2
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C67aHWhi.amd.js.map → listItem.vue_vue_type_script_setup_true_lang-Ob3185Bq.amd.js.map} +1 -1
- package/.chunks/{popup-C1hmF9NI.es.js → popup-B2BoAirk.es.js} +127 -99
- package/.chunks/popup-B2BoAirk.es.js.map +1 -0
- package/.chunks/popup-CyJ0WBUB.amd.js +386 -0
- package/.chunks/popup-CyJ0WBUB.amd.js.map +1 -0
- package/.chunks/{widgetInput-DgylW6NK.amd.js → widgetInput-Ce8a61St.amd.js} +2 -2
- package/.chunks/widgetInput-Ce8a61St.amd.js.map +1 -0
- package/.chunks/{widgetInput-DmpYL1aA.es.js → widgetInput-pNYn7i5g.es.js} +2 -2
- package/.chunks/{widgetInput-DmpYL1aA.es.js.map → widgetInput-pNYn7i5g.es.js.map} +1 -1
- package/assets/forms.css +1 -1
- package/assets/formsExt.css +1 -1
- package/core/core.amd.js +1 -1
- package/core/core.js +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +317 -301
- package/formsExt/formsExt.js.map +1 -1
- package/package.json +1 -1
- package/popup/popup.amd.js +1 -1
- package/popup/popup.js +2 -2
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +60 -64
- package/popup/worker.js.map +1 -1
- package/src/components/forms/avatar/avatar.d.ts +9 -0
- package/src/components/forms/avatar/avatar.stories.d.ts +24 -0
- package/src/components/forms/avatar/avatar.vue.d.ts +12 -0
- package/src/components/formsExt/editArea/editArea.d.ts +16 -3
- package/src/components/formsExt/editArea/editArea.stories.d.ts +36 -20
- package/src/components/formsExt/editArea/editArea.vue.d.ts +12 -4
- package/src/components/formsExt/selector2/selector2.stories.d.ts +16 -16
- package/src/components/formsExt/selector2/selector2.vue.d.ts +8 -8
- package/src/components/popup/lib/popup.d.ts +40 -46
- package/src/components/popup/lib/popup.globalEvents.d.ts +2 -4
- package/src/components/popup/lib/worker.d.ts +24 -33
- package/src/components/popup/lib/worker.globalEvents.d.ts +1 -2
- package/src/components/popup/popup/popup.stories.d.ts +8 -8
- package/src/components/popup/worker.d.ts +2 -2
- package/src/core/utils/dom.d.ts +3 -3
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.js +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.js +2 -2
- 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/dom.amd.js.map +1 -1
- package/utils/dom.js.map +1 -1
- package/utils/scroll.amd.js +1 -1
- package/utils/scroll.js +1 -1
- package/utils/window.amd.js +1 -1
- package/utils/window.js +1 -1
- package/.chunks/forms-DNRGCC9P.amd.js +0 -3
- package/.chunks/forms-DNRGCC9P.amd.js.map +0 -1
- package/.chunks/forms-U97cW1zp.es.js.map +0 -1
- package/.chunks/popup-C1hmF9NI.es.js.map +0 -1
- package/.chunks/popup-Cg-GRa9u.amd.js +0 -386
- package/.chunks/popup-Cg-GRa9u.amd.js.map +0 -1
- package/.chunks/widgetInput-DgylW6NK.amd.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as f } from "./forms-C4UtO06K.es.js";
|
|
2
2
|
import n from "../utils/dom.js";
|
|
3
|
-
import { PopupWorker as
|
|
4
|
-
class
|
|
3
|
+
import { PopupWorker as l } from "../popup/worker.js";
|
|
4
|
+
class v {
|
|
5
5
|
static componentName = "Top";
|
|
6
6
|
componentName;
|
|
7
7
|
// имя класса компонента
|
|
@@ -21,7 +21,7 @@ class g {
|
|
|
21
21
|
init(t, p, o) {
|
|
22
22
|
if (!p)
|
|
23
23
|
throw t + ": el is undefined";
|
|
24
|
-
const e =
|
|
24
|
+
const e = v.getComponent(p, t);
|
|
25
25
|
if (e)
|
|
26
26
|
return e.reInit(o), e;
|
|
27
27
|
this.componentName = t, this.className = "top" + t[0].toUpperCase() + t.substring(1), this.uid = this.componentName + (Math.random() + "").replace(".", ""), this._setComponent(p), this.el = p, this.el.classList.add(this.className), this.options = Object.assign(this.options, o), this.mount();
|
|
@@ -82,65 +82,67 @@ class g {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
class
|
|
85
|
+
class P {
|
|
86
86
|
static init() {
|
|
87
87
|
document.addEventListener("click", this.onclick), document.addEventListener("keydown", this.onkeydown);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Глобальный обработчик кликов
|
|
91
91
|
* обрабатывает клики внутри Popup
|
|
92
|
-
* @param {Event} e
|
|
93
92
|
*/
|
|
94
93
|
static onclick(t) {
|
|
95
94
|
var o;
|
|
95
|
+
if (!(t.target instanceof Element))
|
|
96
|
+
return;
|
|
96
97
|
const p = t.target.closest(".closer, a, .a, .top-button");
|
|
97
98
|
if (p) {
|
|
98
99
|
const e = t.target.closest(".top-popup-wrapper");
|
|
99
100
|
if (!e || p.matches(".top-popup-noCloser"))
|
|
100
101
|
return;
|
|
101
102
|
if (p.getAttribute("href") === "." && t.preventDefault(), t.target.matches("[data-top-popup]")) {
|
|
102
|
-
const r = t.target.closest("ul"),
|
|
103
|
-
r && ((o = r.querySelector("a.top-active, .a.top-active")) == null || o.classList.remove("top-active")),
|
|
103
|
+
const r = t.target.closest("ul"), s = t.target.closest("a, .a");
|
|
104
|
+
r && ((o = r.querySelector("a.top-active, .a.top-active")) == null || o.classList.remove("top-active")), s && s.classList.add("top-active");
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
l.close(e);
|
|
107
108
|
}
|
|
108
109
|
if (t.target.matches(".top-popup-wrapper")) {
|
|
109
110
|
const e = t.target;
|
|
110
|
-
|
|
111
|
+
l.close(e);
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
114
115
|
* Глобальный обработчик нажатия кнопки на клавиатуре
|
|
115
|
-
* @param {Event} e
|
|
116
116
|
*/
|
|
117
117
|
static onkeydown(t) {
|
|
118
|
-
var e;
|
|
118
|
+
var e, r;
|
|
119
|
+
if (!(t.target instanceof Element))
|
|
120
|
+
return;
|
|
119
121
|
const p = t.target.closest(".top-popup-wrapper");
|
|
120
122
|
if (!p)
|
|
121
123
|
return;
|
|
122
124
|
const o = p.querySelector("ul.top-popup_content");
|
|
123
125
|
switch (t.key) {
|
|
124
126
|
case "Escape":
|
|
125
|
-
|
|
127
|
+
l.close(p);
|
|
126
128
|
break;
|
|
127
129
|
case "Enter":
|
|
128
130
|
if (!o) {
|
|
129
131
|
if (n.querySelectorVisible(p, ".preloader"))
|
|
130
132
|
break;
|
|
131
133
|
const c = n.querySelectorVisible(p, ".top-popup_footer .go, .top-popup_footer [data-action]");
|
|
132
|
-
if (c) {
|
|
134
|
+
if (c instanceof HTMLElement) {
|
|
133
135
|
c.click();
|
|
134
136
|
break;
|
|
135
137
|
}
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
+
const m = n.querySelectorVisibleLast(p, ".top-popup_footer .top-button");
|
|
139
|
+
m instanceof HTMLElement && m.click();
|
|
138
140
|
break;
|
|
139
141
|
}
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const s = n.querySelectorVisible(p, "li > a.top-active");
|
|
143
|
+
s && s.getAttribute("href") && (t.preventDefault(), location.href = s.getAttribute("href"));
|
|
144
|
+
const a = p.querySelector("li > .top-active");
|
|
145
|
+
a instanceof HTMLElement && a.click();
|
|
144
146
|
break;
|
|
145
147
|
case "ArrowUp":
|
|
146
148
|
case "ArrowRight":
|
|
@@ -152,26 +154,26 @@ class b {
|
|
|
152
154
|
p,
|
|
153
155
|
"ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active > .top-popup_listMore"
|
|
154
156
|
) && t.preventDefault() : t.preventDefault();
|
|
155
|
-
const
|
|
156
|
-
if (t.key === "ArrowRight" &&
|
|
157
|
-
const c =
|
|
158
|
-
if (c)
|
|
157
|
+
const i = (e = p.querySelector("ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active")) == null ? void 0 : e.parentElement;
|
|
158
|
+
if (t.key === "ArrowRight" && i) {
|
|
159
|
+
const c = i.querySelector(".top-active > .top-popup_listMore");
|
|
160
|
+
if (c instanceof HTMLElement)
|
|
159
161
|
return c.click();
|
|
160
162
|
}
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
163
|
+
const d = n.querySelectorAllVisible(p, "ul.top-popup_content > li:not(.top-popup_liNoSelectable)"), h = d.length;
|
|
164
|
+
if (!h)
|
|
163
165
|
return;
|
|
164
|
-
let
|
|
165
|
-
if (t.key === "ArrowUp" || t.key === "ArrowLeft" ?
|
|
166
|
-
return t.target.matches("input") ? void 0 :
|
|
167
|
-
if (t.key === "ArrowRight" &&
|
|
166
|
+
let u = -1;
|
|
167
|
+
if (i && (u = d.indexOf(i)), t.key === "ArrowUp" || t.key === "ArrowLeft" ? u-- : u++, t.key === "ArrowLeft" && u === -1)
|
|
168
|
+
return t.target.matches("input") ? void 0 : l.close(p);
|
|
169
|
+
if (t.key === "ArrowRight" && u === h)
|
|
168
170
|
return;
|
|
169
|
-
|
|
171
|
+
u < 0 && (u = h - 1), u > h - 1 && (u = 0), p.querySelectorAll("ul.top-popup_content > li > .top-active").forEach((c) => c.classList.remove("top-active")), (r = d[u].querySelector(":scope > a, :scope > .a")) == null || r.classList.add("top-active"), l.scrollToActive(p);
|
|
170
172
|
break;
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
|
-
const
|
|
176
|
+
const w = `:root {
|
|
175
177
|
--top-popup-z-index: 200000;
|
|
176
178
|
--top-popup-transition-delay: 100ms;
|
|
177
179
|
|
|
@@ -455,7 +457,7 @@ ul.top-popup_content i.a > [class*=icon] {
|
|
|
455
457
|
.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; }
|
|
456
458
|
.top-popup_footer [class*=btn]:not(.btn-transparent) { min-width: 100px; padding: 5px 14px; margin-left: 10px; }
|
|
457
459
|
.top-popup_footer [class*=btn]:first-child { margin-left: 0; }
|
|
458
|
-
.top-popup_footer .btn.full_width { margin: 0; flex-grow: 1; }`,
|
|
460
|
+
.top-popup_footer .btn.full_width { margin: 0; flex-grow: 1; }`, y = `:root{
|
|
459
461
|
--top-popup-list-padding: 0px;
|
|
460
462
|
|
|
461
463
|
--top-popup-listItem-radius: 0px;
|
|
@@ -528,7 +530,7 @@ ul.top-popup_content .top-popup_listItem-title{
|
|
|
528
530
|
|
|
529
531
|
/* listDelimiter */
|
|
530
532
|
ul.top-popup_content .top-popup_listItem-delimiter{ background: var(--color-line-1-opacity); height: 4px; margin: 0; }
|
|
531
|
-
ul.top-popup_content li:first-child > .top-popup_listItem-delimiter{ border-top: 1px solid var(--top-popup-border-color); }`,
|
|
533
|
+
ul.top-popup_content li:first-child > .top-popup_listItem-delimiter{ border-top: 1px solid var(--top-popup-border-color); }`, _ = `html:not(.with_dialog){ margin-right: 0 !important; }
|
|
532
534
|
|
|
533
535
|
.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)); }
|
|
534
536
|
.top-popup-wrapper.invert-x > .top-popup{ max-width: calc(100vw - var(--top-popup-right) - 16px); }
|
|
@@ -556,17 +558,18 @@ ul.top-popup_content li > * > i.top-popup_listMore{ visibility: hidden; transiti
|
|
|
556
558
|
ul.top-popup_content li:hover > * > i.top-popup_listMore,
|
|
557
559
|
ul.top-popup_content li > *.top-active > i.top-popup_listMore,
|
|
558
560
|
ul.top-popup_content li > * > i.top-popup_listMore.top-active{ visibility: visible; }`;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
class
|
|
561
|
+
f.appendStyle(w);
|
|
562
|
+
f.appendStyle(y, "m");
|
|
563
|
+
f.appendStyle(_, "pc");
|
|
564
|
+
class x extends v {
|
|
563
565
|
static componentName = "Popup";
|
|
564
|
-
el;
|
|
565
566
|
// элемент, вызвавший открытие Popup
|
|
566
567
|
elActiveByDefault;
|
|
567
568
|
// элемент уже имеет класс top-active перед открытием окна
|
|
568
569
|
elPopup;
|
|
570
|
+
// Popup .top-popup-wrapper
|
|
569
571
|
elPopupInner;
|
|
572
|
+
// контентная часть Popup .top-popup
|
|
570
573
|
elPopupHeader;
|
|
571
574
|
elPopupWidget;
|
|
572
575
|
elPopupBody;
|
|
@@ -607,31 +610,31 @@ class v extends g {
|
|
|
607
610
|
transitionDuration: 100,
|
|
608
611
|
// значение прописано в css
|
|
609
612
|
isFullScreen: !1,
|
|
610
|
-
/**
|
|
611
|
-
* @type {}
|
|
612
|
-
*/
|
|
613
613
|
i18n: {}
|
|
614
614
|
};
|
|
615
615
|
events = {};
|
|
616
616
|
// el - элемент, открывающий меню
|
|
617
617
|
constructor(t, p) {
|
|
618
|
-
return super(), this.init(
|
|
618
|
+
return super(), this.init(x.componentName, t, p);
|
|
619
619
|
}
|
|
620
620
|
async mount() {
|
|
621
|
+
var e, r, s, a;
|
|
622
|
+
if (!(this.el instanceof HTMLElement))
|
|
623
|
+
return;
|
|
621
624
|
const t = this.vueGetComponent();
|
|
622
|
-
if (this.popupParent =
|
|
625
|
+
if (this.el.closest(".top-popup-wrapper") && (this.popupParent = l.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)
|
|
623
626
|
this.type = "vue", this.options.popup = "", this.elPopup = n.genEl("div", {}, this.options.popup);
|
|
624
|
-
else if (this.options.popup.match(/^[#.]/))
|
|
627
|
+
else if ((e = this.options.popup) != null && e.match(/^[#.]/))
|
|
625
628
|
this.type = "selector", this.elPopup = document.querySelector(`${this.options.popup}.template`);
|
|
626
629
|
else {
|
|
627
630
|
if (this.type = "html", this.options.useOriginal)
|
|
628
631
|
throw "Option useOriginal not allowed for text templates";
|
|
629
|
-
this.elPopup = n.genEl("div", {}, this.options.popup);
|
|
632
|
+
this.elPopup = n.genEl("div", {}, this.options.popup ?? "");
|
|
630
633
|
}
|
|
631
634
|
if (!this.elPopup || t != null && t.opened) {
|
|
632
635
|
if (this.options.useOriginal || t != null && t.opened) {
|
|
633
636
|
if (t != null && t.opened ? this.elPopup = t.popup.elPopup : this.elPopup = document.querySelector(`${this.options.popup}.top-popup-wrapper-shown`), this.elPopup) {
|
|
634
|
-
this.el.dataset.topPopupOpened = "", this.elActiveByDefault || this.el.classList.remove("top-active"),
|
|
637
|
+
this.el.dataset.topPopupOpened = "", this.elActiveByDefault || this.el.classList.remove("top-active"), l.close(this.elPopup), setTimeout(() => this.mount(), this.options.transitionDuration);
|
|
635
638
|
return;
|
|
636
639
|
}
|
|
637
640
|
throw "Option useOriginal state allowed only elements .template";
|
|
@@ -640,109 +643,132 @@ class v extends g {
|
|
|
640
643
|
}
|
|
641
644
|
if (!this.elPopup)
|
|
642
645
|
return;
|
|
643
|
-
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((
|
|
646
|
+
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((i) => {
|
|
647
|
+
i instanceof HTMLElement && (i.dataset.topPopupPosBy = "fixed");
|
|
648
|
+
}), n.querySelectorAllArray(this.elPopup, ".top-popup-wrapper").forEach((i) => i.remove()))), l.decoratorBeforeOpen(this), t && (this.options.class = t.classRef.value, t.transitionDurationRef.value !== void 0 && (this.options.transitionDuration = t.transitionDurationRef.value, this.elPopup instanceof HTMLElement && this.elPopup.style.setProperty(
|
|
649
|
+
"--top-popup-transition-delay",
|
|
650
|
+
this.options.transitionDuration + "ms"
|
|
651
|
+
))), this.elPopupInner = document.createElement("div"), this.elPopupInner.classList.add("top-popupPanel", "top-popup"); this.elPopup.firstChild; )
|
|
644
652
|
this.elPopupInner.appendChild(this.elPopup.firstChild);
|
|
645
653
|
if (this.elPopup.append(this.elPopupInner), this.elPopup.classList.add("top-popup-wrapper"), this.options.class) {
|
|
646
|
-
const
|
|
647
|
-
this.elPopup.classList.add(...
|
|
654
|
+
const i = this.options.class.split(" ");
|
|
655
|
+
this.elPopup.classList.add(...i);
|
|
648
656
|
}
|
|
649
657
|
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.elPopupWidget = this.elPopupInner.querySelector(".top-popup_widget"), this.elPopupBody = this.elPopupInner.querySelector(".top-popup_content"), this.elPopupFooter = this.elPopupInner.querySelector(".top-popup_footer");
|
|
650
658
|
const p = !!this.elPopup.querySelector('[data-widget="search"]');
|
|
651
|
-
this.options.isFullScreen && !p &&
|
|
659
|
+
this.options.isFullScreen && !p && !this.elPopupHeader && (r = this.options.i18n) != null && r.Close && (this.elPopupHeader = n.genEl("i", { class: "top-popup_header" }), this.elPopupInner.prepend(this.elPopupHeader), this.elPopupHeader.prepend(n.genEl("i", { class: "a closer" }, (s = this.options.i18n) == null ? void 0 : s.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 instanceof HTMLElement && (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"), (a = this.el.parentElement) == null || a.insertBefore(this.elPopup, this.el), this.elPopup.classList.remove("template"), this.options.invertX && this.elPopup.classList.add("invert-x");
|
|
652
660
|
let o = !!this.el.closest(".modal-header");
|
|
653
|
-
o || (o = !!this.el.closest("#top_panel")), o || (o = !!this.el.closest("#secondmenu")), o && this.elPopup.classList.add("p-from-top"), setTimeout(() =>
|
|
661
|
+
o || (o = !!this.el.closest("#top_panel")), o || (o = !!this.el.closest("#secondmenu")), o && this.elPopup.classList.add("p-from-top"), setTimeout(() => {
|
|
662
|
+
var i;
|
|
663
|
+
return (i = this.elPopup) == null ? void 0 : i.classList.add("top-popup-wrapper-shown");
|
|
664
|
+
}), 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 instanceof HTMLElement && (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.$ && f.$ && this.$.trigger("aftershow.top-menu-popup", [f.$(this.elPopup)]), this.recalcPosition(), this.elPopup.setAttribute("tabindex", "0"), this.focus(), l.decoratorAfterOpen(this), this.mountEvents();
|
|
654
665
|
}
|
|
655
666
|
async mountJQuery() {
|
|
656
|
-
|
|
667
|
+
f.$ && (this.$ = f.$(this.el));
|
|
657
668
|
}
|
|
658
669
|
/**
|
|
659
670
|
* Выполнить фокусировку на нужный элемент после открытия окна
|
|
660
671
|
*/
|
|
661
672
|
focus() {
|
|
662
|
-
let t
|
|
663
|
-
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(), setTimeout(() => {
|
|
664
|
-
t.focus();
|
|
665
|
-
}, this.options.transitionDuration);
|
|
673
|
+
let t;
|
|
674
|
+
this.elPopup && (t = n.querySelectorVisible(this.elPopup, ".top-popup-autofocus"), 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 instanceof HTMLElement && t.focus(), setTimeout(() => {
|
|
675
|
+
t instanceof HTMLElement && t.focus();
|
|
676
|
+
}, this.options.transitionDuration));
|
|
666
677
|
}
|
|
667
678
|
mountEvents() {
|
|
668
|
-
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.elPopupBody && this.addEventListenerWithUnmount(this.elPopupBody, "touchmove", (t) => this.onTouchmove(t));
|
|
679
|
+
this.addEventListenerWithUnmount(document, "mousedown", (t) => this.onMousedown(t)), this.elPopup && this.elPopupInner && (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.elPopupBody && this.addEventListenerWithUnmount(this.elPopupBody, "touchmove", (t) => this.onTouchmove(t));
|
|
669
680
|
}
|
|
670
681
|
/**
|
|
671
682
|
* Обработка клика вне окна
|
|
672
|
-
* @param {Event} e
|
|
673
683
|
*/
|
|
674
684
|
onMousedown(t) {
|
|
675
|
-
if (!this.elPopup || !this.isFirstClick || (this.isFirstClick = !1, setTimeout(() => this.isFirstClick = !0), t.button !== 0))
|
|
685
|
+
if (!this.elPopup || !(t.target instanceof Element) || !this.isFirstClick || (this.isFirstClick = !1, setTimeout(() => this.isFirstClick = !0), t instanceof MouseEvent && t.button !== 0))
|
|
676
686
|
return;
|
|
677
687
|
let p = n.querySelectorVisibleLast(document.body, ":scope > .top-popup-wrapper");
|
|
678
|
-
p && p !== this.elPopup || (p = n.querySelectorVisibleLast(t.target.closest(".top-popup-front"), ":scope > .top-popup-wrapper"),
|
|
688
|
+
p && p !== this.elPopup || t.target.closest(".top-popup-front") && (p = n.querySelectorVisibleLast(t.target.closest(".top-popup-front"), ":scope > .top-popup-wrapper"), p && p !== this.elPopup) || this.elPopup.contains(t.target) || this.elPopup.closest(".ui-dialog") && !t.target.closest(".ui-dialog") || l.decoratorIsIgnoreOuterClick(t) || l.close(this.elPopup);
|
|
679
689
|
}
|
|
680
690
|
/**
|
|
681
691
|
* Закрыть другие Popup при фокусе на элемент формы в текущем
|
|
682
|
-
* @param {Event} e
|
|
683
692
|
*/
|
|
684
693
|
onFocus(t) {
|
|
685
|
-
if (t.target.matches("input") || this.isClosed)
|
|
694
|
+
if (t.target instanceof Element && t.target.matches("input") || this.isClosed)
|
|
686
695
|
return;
|
|
687
|
-
|
|
688
|
-
var e, r,
|
|
689
|
-
this.elPopup.contains(o) || ((
|
|
696
|
+
l.getAllVisible().forEach((o) => {
|
|
697
|
+
var e, r, s, a;
|
|
698
|
+
(e = this.elPopup) != null && e.contains(o) || ((r = this.popupParent) == null ? void 0 : r.elPopup) === o || ((a = (s = this.popupParent) == null ? void 0 : s.popupParent) == null ? void 0 : a.elPopup) === o || l.close(o);
|
|
690
699
|
});
|
|
691
700
|
}
|
|
692
701
|
/**
|
|
693
702
|
* Закрыть Popup при отведении мыши
|
|
694
|
-
* @param {Event} _e
|
|
695
703
|
*/
|
|
696
704
|
onMouseleave(t) {
|
|
697
705
|
setTimeout(() => {
|
|
698
|
-
this.elPopupInner.matches(":hover") ||
|
|
706
|
+
this.elPopupInner && this.elPopupInner.matches(":hover") || !this.elPopup || l.close(this.elPopup);
|
|
699
707
|
}, 100);
|
|
700
708
|
}
|
|
701
709
|
/**
|
|
702
710
|
* Контроль положения Popup при fixed позиционировании
|
|
703
711
|
*/
|
|
704
712
|
onResize() {
|
|
705
|
-
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";
|
|
713
|
+
this.elPopup && this.elPopup.parentElement !== document.body && document.body.append(this.elPopup), this.elPopup instanceof HTMLElement && (this.elPopup.style.top = n.offset(this.el).top + "px", this.elPopup.style.left = n.offset(this.el).left + "px");
|
|
706
714
|
}
|
|
707
715
|
unmount() {
|
|
708
|
-
super.unmount(), this.el.dataset.topPopupOpened = "", this.elActiveByDefault || this.el.classList.remove("top-active");
|
|
716
|
+
super.unmount(), this.el instanceof HTMLElement && (this.el.dataset.topPopupOpened = ""), this.elActiveByDefault || this.el.classList.remove("top-active");
|
|
709
717
|
let t = this.el.getAttribute("style");
|
|
710
718
|
t && (t = t.replace(/position:[^;]*;?/g, ""), this.el.setAttribute("style", t));
|
|
711
719
|
}
|
|
712
720
|
// контроль за положением Popup, чтобы оно не вылезало за пределы документа
|
|
713
721
|
recalcPosition() {
|
|
714
|
-
|
|
722
|
+
var m, b;
|
|
723
|
+
if (!(this.elPopup instanceof HTMLElement))
|
|
715
724
|
return;
|
|
716
725
|
let t = this.options.p, p;
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
726
|
+
if (this.el instanceof HTMLElement)
|
|
727
|
+
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) {
|
|
728
|
+
case "left":
|
|
729
|
+
p = this.el.offsetLeft + parseInt(this.el.style["margin-left"] || "0"), p += this.shift.left, this.elPopup.style.left = p + "px";
|
|
730
|
+
break;
|
|
731
|
+
case "right":
|
|
732
|
+
if (!(this.el.offsetParent instanceof HTMLElement))
|
|
733
|
+
break;
|
|
734
|
+
p = this.el.offsetLeft + parseInt(this.el.style["margin-left"] || "0"), this.elPopup.style.right = this.el.offsetParent.offsetWidth - this.el.offsetWidth - p + "px";
|
|
735
|
+
break;
|
|
736
|
+
case "fixed":
|
|
737
|
+
this.addEventListenerWithUnmount(window, "resize", () => this.onResize()), this.onResize();
|
|
738
|
+
break;
|
|
739
|
+
default:
|
|
740
|
+
(m = this.options.posBy) == null || m.append(this.elPopup);
|
|
741
|
+
}
|
|
730
742
|
const o = this.elPopup.getBoundingClientRect();
|
|
731
|
-
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";
|
|
732
|
-
let e = !1, r = !1,
|
|
733
|
-
t === 4 && (
|
|
734
|
-
const
|
|
735
|
-
|
|
743
|
+
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 instanceof HTMLElement && (this.elPopupInner.style.maxWidth = "unset", this.elPopupInner.style.maxHeight = "unset");
|
|
744
|
+
let e = !1, r = !1, s = !1, a = !1, i = o.left > window.innerWidth / 2, d = o.top > window.innerHeight / 2;
|
|
745
|
+
t === 4 && (i = !i), t === 1 && (d = !d);
|
|
746
|
+
const h = (b = this.elPopupInner) == null ? void 0 : b.getBoundingClientRect();
|
|
747
|
+
let u, c;
|
|
748
|
+
if (h) {
|
|
749
|
+
u = window.innerWidth - h.right, c = window.innerHeight - h.bottom;
|
|
750
|
+
const g = 8;
|
|
751
|
+
h.top < g && (e = !0), u < g && (r = !0), c < g && (s = !0), h.left < g && (a = !0);
|
|
752
|
+
}
|
|
753
|
+
e && (t === 0 || t === 1) && d && (t = 3), s && t === 3 && d && (t = 1), r && t === 2 && i && (t = 4), a && t === 4 && i && (t = 2), r && (t === 0 || t === 1 || t === 3) && this.elPopup.classList.add("invert-x"), s && (t === 2 || t === 4) && d && (t === 2 && !i && this.elPopup.classList.add("invert-y"), t === 4 && !i && 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 instanceof HTMLElement && (this.elPopupInner.style.maxWidth = "", this.elPopupInner.style.maxHeight = ""), l.scrollToActive(this.elPopup);
|
|
736
754
|
}
|
|
737
755
|
onTouchmove(t) {
|
|
738
|
-
|
|
756
|
+
var p, o, e;
|
|
757
|
+
if (t.currentTarget instanceof HTMLElement && t.target instanceof HTMLElement) {
|
|
758
|
+
if (t.currentTarget.scrollWidth > t.currentTarget.offsetWidth || (p = t.target.parentElement) != null && p.scrollWidth && ((o = t.target.parentElement) != null && o.offsetWidth) && t.target.parentElement.scrollWidth > ((e = t.target.parentElement) == null ? void 0 : e.offsetWidth))
|
|
759
|
+
return;
|
|
760
|
+
t.currentTarget.matches(".has_scroll") || t.preventDefault();
|
|
761
|
+
}
|
|
739
762
|
}
|
|
740
763
|
close() {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
764
|
+
var t;
|
|
765
|
+
this.isClosed || (this.isClosed = !0, this.$ && f.$ && this.elPopup && this.$.trigger("afterclose.top-menu-popup", [f.$(this.elPopup)]), !l.noClose && (this.unmount(), (t = this.elPopup) == null || t.classList.add("top-popup-wrapper-closed"), setTimeout(() => {
|
|
766
|
+
var e, r, s, a, i;
|
|
767
|
+
if (this.vueClose(), !this.elPopup)
|
|
768
|
+
return;
|
|
769
|
+
this.options.useOriginal ? (this.elPopup.removeAttribute("style"), this.elPopup.classList.remove("top-popup-wrapper-shown", "top-popup-wrapper-closed"), this.elPopup.classList.add("template"), (e = this.elStartPosition) == null || e.append(this.elPopup), (r = this.elPopup.querySelector("div.top-popup_content.top-column")) == null || r.classList.remove("top-column"), (s = this.elPopup.querySelector(".notch-border")) == null || s.remove(), (a = this.elPopup.querySelector(".notch")) == null || a.remove(), (i = this.elPopupInner) == null || i.replaceWith(...this.elPopupInner.childNodes), n.storageClear(this.elPopup)) : (n.storageClear(this.elPopup), this.elPopup.remove(), delete this.elPopup);
|
|
770
|
+
const p = l.getAllVisible(), o = p.length && p[p.length - 1];
|
|
771
|
+
o ? l.getPopup(o).focus() : document.documentElement.classList.remove("with_popup");
|
|
746
772
|
}, this.options.transitionDuration)));
|
|
747
773
|
}
|
|
748
774
|
async vueOpen() {
|
|
@@ -755,11 +781,13 @@ class v extends g {
|
|
|
755
781
|
}
|
|
756
782
|
// получить vueConnectors компонента Popup
|
|
757
783
|
vueGetComponent() {
|
|
758
|
-
|
|
784
|
+
if (this.el instanceof HTMLElement)
|
|
785
|
+
return l.vueConnectors.get(this.el.dataset.topPopupId);
|
|
759
786
|
}
|
|
760
787
|
}
|
|
761
|
-
|
|
788
|
+
P.init();
|
|
762
789
|
export {
|
|
763
|
-
|
|
790
|
+
x as Popup,
|
|
791
|
+
x as default
|
|
764
792
|
};
|
|
765
|
-
//# sourceMappingURL=popup-
|
|
793
|
+
//# sourceMappingURL=popup-B2BoAirk.es.js.map
|