@topvisor/ui 0.0.17 → 0.0.33
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-48f2fa8d.es.js +275 -0
- package/.chunks/datepicker-48f2fa8d.es.js.map +1 -0
- package/.chunks/datepicker-f94ba423.amd.js +234 -0
- package/.chunks/datepicker-f94ba423.amd.js.map +1 -0
- package/.chunks/forms-6c397f5a.es.js +935 -0
- package/.chunks/forms-6c397f5a.es.js.map +1 -0
- package/.chunks/forms-cab135c7.amd.js +3 -0
- package/.chunks/forms-cab135c7.amd.js.map +1 -0
- package/.chunks/popup-04c385e0.es.js +701 -0
- package/.chunks/popup-04c385e0.es.js.map +1 -0
- package/.chunks/popup-33f53a1c.amd.js +342 -0
- package/.chunks/popup-33f53a1c.amd.js.map +1 -0
- package/README.md +62 -62
- package/common/common.amd.js +1 -21
- package/common/common.amd.js.map +1 -1
- package/common/common.js +1 -20
- package/common/common.js.map +1 -1
- package/core/core.amd.js +1 -4
- package/core/core.amd.js.map +1 -1
- package/core/core.js +2 -3
- package/core/core.js.map +1 -1
- package/core.css +1 -648
- package/dark.css +1 -136
- package/forms/forms.amd.js +1 -12
- package/forms/forms.amd.js.map +1 -1
- package/forms/forms.js +11 -9
- package/forms/helpers.amd.js +1 -5
- package/forms/helpers.amd.js.map +1 -1
- package/forms/helpers.js +6 -3
- package/forms/helpers.js.map +1 -1
- package/forms.css +1 -505
- package/formsExt/formsExt.amd.js +3 -0
- package/formsExt/formsExt.amd.js.map +1 -0
- package/formsExt/formsExt.js +152 -0
- package/formsExt/formsExt.js.map +1 -0
- package/formsExt.css +1 -0
- package/icomoon/demo-files/demo.css +161 -161
- package/icomoon/demo-files/demo.js +30 -30
- package/icomoon/demo.html +2945 -2945
- package/icomoon/fonts/Topvisor-2.svg +232 -232
- package/icomoon/style.css +647 -647
- package/light.css +1 -136
- package/package.json +19 -19
- package/popup/popup.amd.js +2 -197
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +104 -158
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -233
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +60 -143
- package/popup/worker.js.map +1 -1
- package/popup.css +1 -19
- package/tabs/tabs.amd.js +2 -122
- package/tabs/tabs.amd.js.map +1 -1
- package/tabs/tabs.js +63 -86
- package/tabs/tabs.js.map +1 -1
- package/tabs.css +1 -60
- package/utils/date.amd.js +2 -0
- package/utils/date.amd.js.map +1 -0
- package/utils/date.js +6 -0
- package/utils/date.js.map +1 -0
- package/utils/device.amd.js +1 -41
- package/utils/device.amd.js.map +1 -1
- package/utils/device.js +3 -38
- package/utils/device.js.map +1 -1
- package/utils/dom.amd.js +1 -94
- package/utils/dom.amd.js.map +1 -1
- package/utils/dom.js +47 -77
- package/utils/dom.js.map +1 -1
- package/.chunks/core-0b2c7817.es.js +0 -152
- package/.chunks/core-0b2c7817.es.js.map +0 -1
- package/.chunks/core-51f7b679.amd.js +0 -151
- package/.chunks/core-51f7b679.amd.js.map +0 -1
- package/.chunks/forms-245e3bc0.es.js +0 -565
- package/.chunks/forms-245e3bc0.es.js.map +0 -1
- package/.chunks/forms-f7b7b259.amd.js +0 -568
- package/.chunks/forms-f7b7b259.amd.js.map +0 -1
- package/.chunks/popup-8f650530.amd.js +0 -728
- package/.chunks/popup-8f650530.amd.js.map +0 -1
- package/.chunks/popup-d240ed19.es.js +0 -731
- package/.chunks/popup-d240ed19.es.js.map +0 -1
- package/editArea/editArea.amd.js +0 -126
- package/editArea/editArea.amd.js.map +0 -1
- package/editArea/editArea.js +0 -123
- package/editArea/editArea.js.map +0 -1
- package/editArea.css +0 -61
package/popup/popup.js
CHANGED
|
@@ -1,198 +1,144 @@
|
|
|
1
|
-
import { defineComponent, onUpdated, openBlock, createElementBlock, Fragment, createElementVNode, renderSlot, ref, toRef
|
|
2
|
-
import
|
|
3
|
-
import "../.chunks/
|
|
4
|
-
import "../utils/device.js";
|
|
1
|
+
import { defineComponent as m, onUpdated as h, openBlock as n, createElementBlock as u, Fragment as B, createElementVNode as v, renderSlot as r, ref as k, toRef as $, onUnmounted as P, createBlock as y, unref as C, withCtx as _, createCommentVNode as l, Teleport as H, normalizeClass as g, resolveDynamicComponent as I, mergeProps as T } from "vue";
|
|
2
|
+
import f from "./worker.js";
|
|
3
|
+
import "../.chunks/forms-6c397f5a.es.js";
|
|
5
4
|
import "../utils/dom.js";
|
|
6
|
-
|
|
7
|
-
POS2["over"] = "0";
|
|
8
|
-
POS2["top"] = "1";
|
|
9
|
-
POS2["right"] = "2";
|
|
10
|
-
POS2["bottom"] = "3";
|
|
11
|
-
POS2["left"] = "4";
|
|
12
|
-
return POS2;
|
|
13
|
-
})(POS || {});
|
|
14
|
-
var POS_BY = /* @__PURE__ */ ((POS_BY2) => {
|
|
15
|
-
POS_BY2["fixed"] = "fixed";
|
|
16
|
-
POS_BY2["left"] = "left";
|
|
17
|
-
POS_BY2["right"] = "right";
|
|
18
|
-
return POS_BY2;
|
|
19
|
-
})(POS_BY || {});
|
|
20
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
5
|
+
const V = /* @__PURE__ */ m({
|
|
21
6
|
__name: "opener",
|
|
22
7
|
props: {
|
|
23
8
|
id: {},
|
|
24
|
-
pos: { default:
|
|
25
|
-
notch: { type: Boolean, default:
|
|
9
|
+
pos: { default: "3" },
|
|
10
|
+
notch: { type: Boolean, default: !0 },
|
|
26
11
|
openByHover: { type: Boolean },
|
|
27
|
-
posBy: { default:
|
|
12
|
+
posBy: { default: "fixed" }
|
|
28
13
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function render(el) {
|
|
14
|
+
setup(d) {
|
|
15
|
+
const o = d, t = o.id || Math.random() + "";
|
|
16
|
+
let s;
|
|
17
|
+
function a(p) {
|
|
34
18
|
setTimeout(() => {
|
|
35
|
-
|
|
36
|
-
if (elOpener) {
|
|
37
|
-
renderOpener(elOpener);
|
|
38
|
-
}
|
|
19
|
+
s = p.nextElementSibling, s && c(s);
|
|
39
20
|
});
|
|
40
21
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
renderOpener(elOpener);
|
|
44
|
-
}
|
|
22
|
+
h(() => {
|
|
23
|
+
s && c(s);
|
|
45
24
|
});
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
elOpener2.dataset.topPopupId = id;
|
|
49
|
-
elOpener2.dataset.topPopupP = props.pos;
|
|
50
|
-
elOpener2.dataset.topPopupPosBy = props.posBy;
|
|
51
|
-
elOpener2.dataset.topPopupNotch = props.notch ? "true" : "";
|
|
52
|
-
elOpener2.dataset.topPopupOpenByHover = props.openByHover ? "true" : "";
|
|
25
|
+
function c(p) {
|
|
26
|
+
p.dataset.topPopup = "vue-" + t, p.dataset.topPopupId = t, p.dataset.topPopupP = o.pos, p.dataset.topPopupPosBy = o.posBy, p.dataset.topPopupNotch = o.notch ? "true" : "", p.dataset.topPopupOpenByHover = o.openByHover ? "true" : "";
|
|
53
27
|
}
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
], 64);
|
|
59
|
-
};
|
|
28
|
+
return (p, i) => (n(), u(B, null, [
|
|
29
|
+
v("template", { ref: a }),
|
|
30
|
+
r(p.$slots, "default")
|
|
31
|
+
], 64));
|
|
60
32
|
}
|
|
61
33
|
});
|
|
62
|
-
const
|
|
63
|
-
const _hoisted_1 = {
|
|
34
|
+
const E = {
|
|
64
35
|
key: 0,
|
|
65
36
|
class: "top-popup_header"
|
|
66
|
-
}
|
|
67
|
-
const _hoisted_2 = {
|
|
37
|
+
}, L = {
|
|
68
38
|
key: 1,
|
|
69
39
|
class: "top-popup_content"
|
|
70
|
-
}
|
|
71
|
-
const _hoisted_3 = {
|
|
40
|
+
}, N = {
|
|
72
41
|
key: 2,
|
|
73
42
|
class: "top-popup_content"
|
|
74
|
-
}
|
|
75
|
-
const _hoisted_4 = {
|
|
43
|
+
}, R = {
|
|
76
44
|
key: 3,
|
|
77
45
|
class: "top-popup_footer"
|
|
78
|
-
}
|
|
79
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
46
|
+
}, w = /* @__PURE__ */ m({
|
|
80
47
|
__name: "popup",
|
|
81
48
|
props: {
|
|
82
49
|
id: { default: "" },
|
|
83
50
|
class: {},
|
|
84
|
-
pos: { default:
|
|
85
|
-
notch: { type: Boolean, default:
|
|
51
|
+
pos: { default: "3" },
|
|
52
|
+
notch: { type: Boolean, default: !0 },
|
|
86
53
|
openByHover: { type: Boolean },
|
|
87
|
-
posBy: { default:
|
|
54
|
+
posBy: { default: "fixed" }
|
|
88
55
|
},
|
|
89
56
|
emits: ["open", "close"],
|
|
90
|
-
setup(
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
};
|
|
101
|
-
const onClose = (popup) => {
|
|
102
|
-
elPopupRef.value = null;
|
|
103
|
-
vueConnector.opened = false;
|
|
104
|
-
vueConnector.popup = null;
|
|
105
|
-
emit("close");
|
|
106
|
-
};
|
|
107
|
-
const vueConnector = {
|
|
108
|
-
onOpen,
|
|
109
|
-
onClose,
|
|
110
|
-
classRef: toRef(props, "class"),
|
|
111
|
-
opened: false,
|
|
57
|
+
setup(d, { emit: o }) {
|
|
58
|
+
const t = d, s = t.id || Math.random() + "", a = k(null), i = {
|
|
59
|
+
onOpen: async (e) => {
|
|
60
|
+
e.elPopupInner.innerText = "", a.value = e.elPopupInner, i.opened = !0, i.popup = e, o("open");
|
|
61
|
+
},
|
|
62
|
+
onClose: (e) => {
|
|
63
|
+
a.value = null, i.opened = !1, i.popup = null, o("close");
|
|
64
|
+
},
|
|
65
|
+
classRef: $(t, "class"),
|
|
66
|
+
opened: !1,
|
|
112
67
|
popup: null
|
|
113
68
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
])) : createCommentVNode("", true)
|
|
149
|
-
], 8, ["to"])) : createCommentVNode("", true)
|
|
150
|
-
], 64);
|
|
151
|
-
};
|
|
69
|
+
return f.regVueComponent(s, i), P(() => {
|
|
70
|
+
f.unregVueComponent(s);
|
|
71
|
+
}), (e, D) => (n(), u(B, null, [
|
|
72
|
+
e.$slots.opener ? (n(), y(V, {
|
|
73
|
+
key: 0,
|
|
74
|
+
id: C(s),
|
|
75
|
+
pos: e.pos,
|
|
76
|
+
posBy: e.posBy,
|
|
77
|
+
notch: e.notch,
|
|
78
|
+
openByHover: e.openByHover
|
|
79
|
+
}, {
|
|
80
|
+
default: _(() => [
|
|
81
|
+
r(e.$slots, "opener")
|
|
82
|
+
]),
|
|
83
|
+
_: 3
|
|
84
|
+
}, 8, ["id", "pos", "posBy", "notch", "openByHover"])) : l("", !0),
|
|
85
|
+
a.value ? (n(), y(H, {
|
|
86
|
+
key: 1,
|
|
87
|
+
to: a.value
|
|
88
|
+
}, [
|
|
89
|
+
e.$slots.header ? (n(), u("div", E, [
|
|
90
|
+
r(e.$slots, "header")
|
|
91
|
+
])) : l("", !0),
|
|
92
|
+
e.$slots.content ? (n(), u("div", L, [
|
|
93
|
+
r(e.$slots, "content")
|
|
94
|
+
])) : l("", !0),
|
|
95
|
+
e.$slots.contentList ? (n(), u("ul", N, [
|
|
96
|
+
r(e.$slots, "contentList")
|
|
97
|
+
])) : l("", !0),
|
|
98
|
+
e.$slots.footer ? (n(), u("div", R, [
|
|
99
|
+
r(e.$slots, "footer")
|
|
100
|
+
])) : l("", !0)
|
|
101
|
+
], 8, ["to"])) : l("", !0)
|
|
102
|
+
], 64));
|
|
152
103
|
}
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
...{
|
|
156
|
-
inheritAttrs: false
|
|
157
|
-
},
|
|
104
|
+
}), z = /* @__PURE__ */ m({
|
|
105
|
+
inheritAttrs: !1,
|
|
158
106
|
__name: "listItem",
|
|
159
107
|
props: {
|
|
160
108
|
type: { default: "simple" },
|
|
161
|
-
closeByClick: { type: Boolean, default:
|
|
109
|
+
closeByClick: { type: Boolean, default: !0 }
|
|
162
110
|
},
|
|
163
|
-
setup(
|
|
164
|
-
const
|
|
165
|
-
return (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
default
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
], 2);
|
|
190
|
-
};
|
|
111
|
+
setup(d) {
|
|
112
|
+
const o = d;
|
|
113
|
+
return (t, s) => (n(), u("li", {
|
|
114
|
+
class: g({
|
|
115
|
+
"top-popup_listDelimiter": t.type === "delimiter",
|
|
116
|
+
"top-popup_listTitle": t.type === "title"
|
|
117
|
+
})
|
|
118
|
+
}, [
|
|
119
|
+
o.type === "simple" || o.type === "link" ? (n(), y(I(o.type === "link" ? "a" : "i"), T({
|
|
120
|
+
key: 0,
|
|
121
|
+
class: {
|
|
122
|
+
"top-popup_item": !0,
|
|
123
|
+
"top-popup_item-a": o.type === "simple",
|
|
124
|
+
// имитация оформления ссылки
|
|
125
|
+
a: !0,
|
|
126
|
+
// deprecated
|
|
127
|
+
"top-popup-noCloser": !t.closeByClick
|
|
128
|
+
}
|
|
129
|
+
}, t.$attrs), {
|
|
130
|
+
default: _(() => [
|
|
131
|
+
r(t.$slots, "default")
|
|
132
|
+
]),
|
|
133
|
+
_: 3
|
|
134
|
+
}, 16, ["class"])) : l("", !0),
|
|
135
|
+
o.type === "title" || o.type === "control" ? r(t.$slots, "default", { key: 1 }) : l("", !0)
|
|
136
|
+
], 2));
|
|
191
137
|
}
|
|
192
138
|
});
|
|
193
139
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
140
|
+
w as Popup,
|
|
141
|
+
z as PopupListItem,
|
|
142
|
+
V as PopupOpener
|
|
197
143
|
};
|
|
198
144
|
//# sourceMappingURL=popup.js.map
|
package/popup/popup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup.js","sources":["../../src/components/popup/popup/
|
|
1
|
+
{"version":3,"file":"popup.js","sources":["../../src/components/popup/popup/opener.vue","../../src/components/popup/popup/popup.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { onUpdated, ref } from 'vue';\r\nimport type { OpenerProps } from './popup';\r\n\r\nconst props = withDefaults(defineProps<OpenerProps>(), {\r\n\tpos: '3',\r\n\tnotch: true,\r\n\tposBy: 'fixed',\r\n});\r\n\r\nconst id = props.id || Math.random() + '';\r\n\r\nlet elOpener: Element;\r\n\r\n/**\r\n * Необычная функция для проброски props внтурь элемента слота\r\n *\r\n * @param el - вспомогательрный элемент для доступа к элементам слота\r\n */\r\nfunction render (el: any) {\r\n\tsetTimeout(() => {\r\n\t\telOpener = el.nextElementSibling;\r\n\r\n\t\tif (elOpener) {\r\n\t\t\trenderOpener(elOpener);\r\n\t\t}\r\n\t});\r\n}\r\n\r\nonUpdated(() => {\r\n\tif (elOpener) {\r\n\t\trenderOpener(elOpener);\r\n\t}\r\n});\r\n\r\nfunction renderOpener (elOpener: any) {\r\n\telOpener.dataset.topPopup = 'vue-' + id;\r\n\telOpener.dataset.topPopupId = id;\r\n\telOpener.dataset.topPopupP = props.pos;\r\n\telOpener.dataset.topPopupPosBy = props.posBy;\r\n\telOpener.dataset.topPopupNotch = props.notch ? 'true' : '';\r\n\telOpener.dataset.topPopupOpenByHover = props.openByHover ? 'true' : '';\r\n}\r\n</script>\r\n\r\n<template>\r\n\t<template :ref=\"render\"></template>\r\n\r\n\t<!-- @slot элемент для открытия Popup -->\r\n\t<slot></slot>\r\n</template>\r\n\r\n<style>\r\nh3[data-top-popup],\r\ndiv[data-top-popup],\r\ni[data-top-popup]:not(.btn):not(.g_btn),\r\nb[data-top-popup]:not(.btn):not(.g_btn) {\r\n\tcursor: pointer;\r\n\tuser-select: none;\r\n\tfont-style: normal;\r\n\ttext-decoration: none;\r\n\tdisplay: inline-flex;\r\n\talign-items: center;\r\n}\r\n\r\n[data-top-popup][data-top-popup-disabled] {\r\n\tpointer-events: none;\r\n\tcursor: auto !important;\r\n}\r\n\r\ni[contenteditable] {\r\n\tcursor: text !important;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { ref, toRef, onUnmounted } from 'vue';\r\nimport type { Props, Emits } from './popup';\r\nimport Opener from './opener.vue';\r\nimport Worker from '@/components/popup/lib/worker';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tid: '',\r\n\tpos: '3',\r\n\tnotch: true,\r\n\tposBy: 'fixed',\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst id = props.id || Math.random() + '';\r\nconst elPopupRef = ref(null);\r\n\r\n// см. lib/popup\r\nconst onOpen = async (popup: any) => {\r\n\tpopup.elPopupInner.innerText = '';\r\n\r\n\telPopupRef.value = popup.elPopupInner;\r\n\r\n\tvueConnector.opened = true;\r\n\tvueConnector.popup = popup;\r\n\r\n\temit('open');\r\n};\r\n\r\n// см. lib/popup\r\nconst onClose = (popup: any) => {\r\n\telPopupRef.value = null;\r\n\r\n\tvueConnector.opened = false;\r\n\tvueConnector.popup = null;\r\n\r\n\temit('close');\r\n};\r\n\r\nconst vueConnector = {\r\n\tonOpen,\r\n\tonClose,\r\n\tclassRef: toRef(props, 'class'),\r\n\topened: false,\r\n\tpopup: null,\r\n};\r\n\r\nWorker.regVueComponent(id, vueConnector);\r\n\r\nonUnmounted(() => {\r\n\tWorker.unregVueComponent(id);\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<Opener\r\n\t\tv-if=\"$slots.opener\"\r\n\t\t:id=\"id\"\r\n\t\t:pos=\"pos\"\r\n\t\t:posBy=\"posBy\"\r\n\t\t:notch=\"notch\"\r\n\t\t:openByHover=\"openByHover\"\r\n\t>\r\n\t\t<!-- @slot элемент для открытия Popup -->\r\n\t\t<slot name=\"opener\"></slot>\r\n\t</Opener>\r\n\r\n\t<!-- Это шаблон для компонента Popup, сам Popup генерируется в js и может находиться где угодно -->\r\n\t<!-- elPopupRef будет установлен только после открытия и будет сброшен сразу после закрытия Popup -->\r\n\t<teleport\r\n\t\tv-if=\"elPopupRef\"\r\n\t\t:to=\"elPopupRef\"\r\n\t>\r\n\t\t<div v-if=\"$slots.header\" class=\"top-popup_header\">\r\n\t\t\t<!-- @slot Шапка -->\r\n\t\t\t<slot name=\"header\"></slot>\r\n\t\t</div>\r\n\r\n\t\t<div v-if=\"$slots.content\" class=\"top-popup_content\">\r\n\t\t\t<!-- @slot Контент в свободной форме -->\r\n\t\t\t<slot name=\"content\"></slot>\r\n\t\t</div>\r\n\r\n\t\t<ul v-if=\"$slots.contentList\" class=\"top-popup_content\">\r\n\t\t\t<!-- @slot Контент в виде списка, для вставки элементов списка испоьзуйте компонент popup/listItem -->\r\n\t\t\t<slot name=\"contentList\"></slot>\r\n\t\t</ul>\r\n\r\n\t\t<div v-if=\"$slots.footer\" class=\"top-popup_footer\">\r\n\t\t\t<!-- @slot Футер -->\r\n\t\t\t<slot name=\"footer\"></slot>\r\n\t\t</div>\r\n\t</teleport>\r\n</template>"],"names":["id","props","elOpener","render","el","renderOpener","onUpdated","elPopupRef","ref","vueConnector","popup","emit","toRef","Worker","onUnmounted"],"mappings":";;;;;;;;;;;;;;iBAUMA,IAAKC,EAAM,MAAM,KAAK,OAAW,IAAA;AAEnC,QAAAC;AAOJ,aAASC,EAAQC,GAAS;AACzB,iBAAW,MAAM;AAChB,QAAAF,IAAWE,EAAG,oBAEVF,KACHG,EAAaH,CAAQ;AAAA,MACtB,CACA;AAAA,IACF;AAEA,IAAAI,EAAU,MAAM;AACf,MAAIJ,KACHG,EAAaH,CAAQ;AAAA,IACtB,CACA;AAED,aAASG,EAAcH,GAAe;AACrCA,MAAAA,EAAS,QAAQ,WAAW,SAASF,GACrCE,EAAS,QAAQ,aAAaF,GAC9BE,EAAS,QAAQ,YAAYD,EAAM,KACnCC,EAAS,QAAQ,gBAAgBD,EAAM,OACvCC,EAAS,QAAQ,gBAAgBD,EAAM,QAAQ,SAAS,IACxDC,EAAS,QAAQ,sBAAsBD,EAAM,cAAc,SAAS;AAAA,IACrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC3BMD,IAAKC,EAAM,MAAM,KAAK,OAAW,IAAA,IACjCM,IAAaC,EAAI,IAAI,GAwBrBC,IAAe;AAAA,MACpB,QAtBc,OAAOC,MAAe;AACpC,QAAAA,EAAM,aAAa,YAAY,IAE/BH,EAAW,QAAQG,EAAM,cAEzBD,EAAa,SAAS,IACtBA,EAAa,QAAQC,GAErBC,EAAK,MAAM;AAAA,MAAA;AAAA,MAeX,SAXe,CAACD,MAAe;AAC/B,QAAAH,EAAW,QAAQ,MAEnBE,EAAa,SAAS,IACtBA,EAAa,QAAQ,MAErBE,EAAK,OAAO;AAAA,MAAA;AAAA,MAMZ,UAAUC,EAAMX,GAAO,OAAO;AAAA,MAC9B,QAAQ;AAAA,MACR,OAAO;AAAA,IAAA;AAGD,WAAAY,EAAA,gBAAgBb,GAAIS,CAAY,GAEvCK,EAAY,MAAM;AACjB,MAAAD,EAAO,kBAAkBb,CAAE;AAAA,IAAA,CAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/popup/worker.amd.js
CHANGED
|
@@ -1,234 +1,2 @@
|
|
|
1
|
-
define(["require",
|
|
2
|
-
"use strict"; if(typeof vue === "undefined") var vue = window.Vue;
|
|
3
|
-
class WorkerEvents {
|
|
4
|
-
static init() {
|
|
5
|
-
document.addEventListener("mouseover", (e) => {
|
|
6
|
-
var _a;
|
|
7
|
-
if (!((_a = e.target.dataset) == null ? void 0 : _a.topPopupOpenByHover)) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
e.target.click();
|
|
11
|
-
});
|
|
12
|
-
document.addEventListener("scroll", () => {
|
|
13
|
-
if (core_core.Core.isMobile) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
Worker$1.getAll().forEach((elPopup) => Worker$1.close(elPopup));
|
|
17
|
-
});
|
|
18
|
-
core_core.Events.addOnReize((e) => {
|
|
19
|
-
if (core_core.Core.state.isMobile && e.topEvent.widthDiff) {
|
|
20
|
-
Worker$1.getAll().forEach((elPopup) => Worker$1.close(elPopup));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
document.addEventListener("click", this.onclick);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Глобальный обработчик кликов
|
|
27
|
-
* обрабатывает клики на открытие Popup
|
|
28
|
-
* @param {Event} e
|
|
29
|
-
*/
|
|
30
|
-
static async onclick(e) {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
let elOpener2;
|
|
33
|
-
switch (true) {
|
|
34
|
-
case !!((_a = e.target.dataset) == null ? void 0 : _a.topPopup):
|
|
35
|
-
elOpener2 = e.target;
|
|
36
|
-
break;
|
|
37
|
-
case !!((_b = e.target.parentElement) == null ? void 0 : _b.dataset.topPopup):
|
|
38
|
-
elOpener2 = e.target.parentElement;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
if (!elOpener2) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (elOpener2.dataset.topPopupDisabled) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (elOpener2.dataset.topPopupOpened) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
await Worker$1.openByOpener(elOpener2);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
let decoratorBeforeOpen;
|
|
55
|
-
let decoratorAfterOpen;
|
|
56
|
-
let decoratorIsIgnoreOuterClick;
|
|
57
|
-
let i18n = {
|
|
58
|
-
Close: "Close"
|
|
59
|
-
};
|
|
60
|
-
class Worker {
|
|
61
|
-
// глобальное выключение закрытия меню, используется при различных оверлеях
|
|
62
|
-
static noClose = false;
|
|
63
|
-
static vueConnectors = /* @__PURE__ */ new Map();
|
|
64
|
-
/**
|
|
65
|
-
* Вызывается при инициализаци приложения
|
|
66
|
-
* устанавливает глобальные статические декортаоры для компонента Popup
|
|
67
|
-
* @param {{
|
|
68
|
-
* decoratorBeforeOpen: (object) => void
|
|
69
|
-
* decoratorAfterOpen: (object) => void,
|
|
70
|
-
* decoratorIsIgnoreOuterClick: (e) => void,
|
|
71
|
-
* i18n: {Close: string}
|
|
72
|
-
* }} options
|
|
73
|
-
*/
|
|
74
|
-
static onInitApp(options2) {
|
|
75
|
-
decoratorBeforeOpen = options2 == null ? void 0 : options2.decoratorBeforeOpen;
|
|
76
|
-
decoratorAfterOpen = options2 == null ? void 0 : options2.decoratorAfterOpen;
|
|
77
|
-
decoratorIsIgnoreOuterClick = options2 == null ? void 0 : options2.decoratorIsIgnoreOuterClick;
|
|
78
|
-
i18n = options2 == null ? void 0 : options2.i18n;
|
|
79
|
-
}
|
|
80
|
-
// вернуть объект компонента popup, привязанный к элементу
|
|
81
|
-
static getPopup(elPopup) {
|
|
82
|
-
return utils_dom.storage(elPopup, "Popup");
|
|
83
|
-
}
|
|
84
|
-
static getAll() {
|
|
85
|
-
return utils_dom.querySelectorAllArray(document, ".top-popup-wrapper");
|
|
86
|
-
}
|
|
87
|
-
static getAllVisible() {
|
|
88
|
-
return utils_dom.querySelectorAllVisible(document, ".top-popup-wrapper");
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Открть Popup от указанного elOpener
|
|
92
|
-
* @param {Element} elOpener - элемент, который должен вызвать открытие Popup
|
|
93
|
-
*/
|
|
94
|
-
static async openByOpener(elOpener2) {
|
|
95
|
-
const options2 = {};
|
|
96
|
-
options2.popup = elOpener2.dataset.topPopup;
|
|
97
|
-
if (elOpener2.dataset.topPopupP) {
|
|
98
|
-
options2.p = parseInt(elOpener2.dataset.topPopupP);
|
|
99
|
-
}
|
|
100
|
-
if (elOpener2.dataset.topPopupNotch) {
|
|
101
|
-
options2.notch = elOpener2.dataset.topPopupNotch;
|
|
102
|
-
}
|
|
103
|
-
if (elOpener2.dataset.topPopupClass) {
|
|
104
|
-
options2.class = elOpener2.dataset.topPopupClass;
|
|
105
|
-
}
|
|
106
|
-
if (elOpener2.dataset.topPopupPosBy) {
|
|
107
|
-
options2.posBy = elOpener2.dataset.topPopupPosBy;
|
|
108
|
-
}
|
|
109
|
-
if (elOpener2.dataset.topPopupFront) {
|
|
110
|
-
options2.frontSelector = elOpener2.dataset.topPopupFront;
|
|
111
|
-
}
|
|
112
|
-
if (elOpener2.dataset.topPopupInvertX) {
|
|
113
|
-
options2.invertX = elOpener2.dataset.topPopupInvertX;
|
|
114
|
-
}
|
|
115
|
-
if (elOpener2.dataset.topPopupOpenByHover) {
|
|
116
|
-
options2.openByHover = elOpener2.dataset.topPopupOpenByHover;
|
|
117
|
-
}
|
|
118
|
-
if (elOpener2.dataset.topPopupUseOriginal) {
|
|
119
|
-
options2.useOriginal = elOpener2.dataset.topPopupUseOriginal;
|
|
120
|
-
}
|
|
121
|
-
return await Worker.open(elOpener2, options2);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Создать и открыть Popup
|
|
125
|
-
* @param {Element} elOpener - элемент, вызвавший открытие Popup
|
|
126
|
-
* @param {object} options - опции Popup
|
|
127
|
-
*/
|
|
128
|
-
static async open(elOpener, options) {
|
|
129
|
-
elOpener.dataset.topPopupOpened = "opened";
|
|
130
|
-
const { default: Popup } = await new Promise((resolve, reject) => require(["../.chunks/popup-8f650530.amd"], resolve, reject));
|
|
131
|
-
if (typeof jQuery === "function") {
|
|
132
|
-
const $elOpener = jQuery(elOpener);
|
|
133
|
-
if ($elOpener.data("aftershow")) {
|
|
134
|
-
let afterShow = $elOpener.data("aftershow");
|
|
135
|
-
if (typeof afterShow == "string") {
|
|
136
|
-
afterShow = eval(afterShow.replace(/\W/g, ""));
|
|
137
|
-
}
|
|
138
|
-
$elOpener.one("aftershow.top-menu-popup", afterShow);
|
|
139
|
-
}
|
|
140
|
-
if ($elOpener.data("afterclose")) {
|
|
141
|
-
let afterclose = $elOpener.data("afterclose");
|
|
142
|
-
if (typeof afterclose == "string") {
|
|
143
|
-
afterclose = eval(afterclose.replace(/\W/g, ""));
|
|
144
|
-
}
|
|
145
|
-
$elOpener.one("afterclose.top-menu-popup", afterclose);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
options.isFullScreen = core_core.Core.state.isMobile;
|
|
149
|
-
options.i18n = i18n;
|
|
150
|
-
return await new Popup(elOpener, options);
|
|
151
|
-
}
|
|
152
|
-
static close(elPopup) {
|
|
153
|
-
const popup = Worker.getPopup(elPopup);
|
|
154
|
-
if (popup) {
|
|
155
|
-
popup.close();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
static recalcPosition(elPopup) {
|
|
159
|
-
const popup = Worker.getPopup(elPopup);
|
|
160
|
-
if (popup) {
|
|
161
|
-
popup.recalcPosition();
|
|
162
|
-
HelperCommon.genHasScroll($(popup.elPopupBody));
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
// скролл к активному элементу списка
|
|
166
|
-
static scrollToActive(elPopup) {
|
|
167
|
-
const elItemActive = utils_dom.querySelectorVisible(elPopup, "ul.top-popup_content > li > .top-active");
|
|
168
|
-
if (!elItemActive) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
const elUl = elPopup.querySelector("ul.top-popup_content");
|
|
172
|
-
const elsLi = utils_dom.querySelectorAllVisible(elPopup, "ul.top-popup_content > li");
|
|
173
|
-
elPopup.classList.add("top-popup-wrapper-no_animate");
|
|
174
|
-
setTimeout(() => elPopup.classList.remove("top-popup-wrapper-no_animate"), 100);
|
|
175
|
-
let top = 100;
|
|
176
|
-
for (const elLi of elsLi) {
|
|
177
|
-
if (elLi.querySelector(":scope > .top-active")) {
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
top += elLi.offsetHeight;
|
|
181
|
-
}
|
|
182
|
-
const heightWrapper = elUl.offsetHeight;
|
|
183
|
-
if (top > heightWrapper) {
|
|
184
|
-
elUl.scrollTop = top - heightWrapper;
|
|
185
|
-
} else {
|
|
186
|
-
elUl.scrollTop = 0;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
static decoratorBeforeOpen(popup) {
|
|
190
|
-
if (decoratorBeforeOpen) {
|
|
191
|
-
decoratorBeforeOpen(popup);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
static decoratorAfterOpen(popup) {
|
|
195
|
-
if (decoratorAfterOpen) {
|
|
196
|
-
decoratorAfterOpen(popup);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Определитель того, что клик вне Popup нужно игнорировать
|
|
201
|
-
* @returns {boolean} - игнорировать клик, то есть не закрывать Popup
|
|
202
|
-
*/
|
|
203
|
-
static decoratorIsIgnoreOuterClick(e) {
|
|
204
|
-
if (decoratorIsIgnoreOuterClick) {
|
|
205
|
-
return decoratorIsIgnoreOuterClick(e);
|
|
206
|
-
}
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Зарегистрировать Vue компонент
|
|
211
|
-
*
|
|
212
|
-
* Каждый экземляр Popup регистрируется в словаре vueConnectors для последующего доступа из js
|
|
213
|
-
* @param {string} id
|
|
214
|
-
* @param {any} vueConnector
|
|
215
|
-
*/
|
|
216
|
-
static regVueComponent(id, vueConnector) {
|
|
217
|
-
if (Worker.vueConnectors.get(id)) {
|
|
218
|
-
throw "Vue component Popup use duplicated id: " + id;
|
|
219
|
-
}
|
|
220
|
-
Worker.vueConnectors.set(id, vueConnector);
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Снять с регистрации Vue компонент
|
|
224
|
-
* @param {string} id
|
|
225
|
-
*/
|
|
226
|
-
static unregVueComponent(id) {
|
|
227
|
-
Worker.vueConnectors.delete(id);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
WorkerEvents.init(Worker, core_core.Core);
|
|
231
|
-
const Worker$1 = Worker;
|
|
232
|
-
return Worker$1;
|
|
233
|
-
});
|
|
1
|
+
define(["require","../.chunks/forms-cab135c7.amd","../utils/dom.amd","vue"],function(require,forms,utils_dom,vue){"use strict"; if(typeof vue === "undefined") var vue = window.Vue;class WorkerEvents{static init(){document.addEventListener("mouseover",t=>{var o;(o=t.target.dataset)!=null&&o.topPopupOpenByHover&&t.target.click()}),document.addEventListener("scroll",()=>{forms.Core.isMobile||Worker$1.getAll().forEach(t=>Worker$1.close(t))}),forms.Events.addOnReize(t=>{forms.Core.state.isMobile&&t.topEvent.widthDiff&&Worker$1.getAll().forEach(o=>Worker$1.close(o))}),document.addEventListener("click",this.onclick)}static async onclick(t){var a,r;let o;switch(!0){case!!((a=t.target.dataset)!=null&&a.topPopup):o=t.target;break;case!!((r=t.target.parentElement)!=null&&r.dataset.topPopup):o=t.target.parentElement;break}o&&(o.dataset.topPopupDisabled||o.dataset.topPopupOpened||(t.preventDefault(),await Worker$1.openByOpener(o)))}}let decoratorBeforeOpen,decoratorAfterOpen,decoratorIsIgnoreOuterClick,i18n={Close:"Close"};class Worker{static noClose=!1;static vueConnectors=new Map;static onInitApp(e){decoratorBeforeOpen=e==null?void 0:e.decoratorBeforeOpen,decoratorAfterOpen=e==null?void 0:e.decoratorAfterOpen,decoratorIsIgnoreOuterClick=e==null?void 0:e.decoratorIsIgnoreOuterClick,i18n=e==null?void 0:e.i18n}static getPopup(e){return utils_dom.storage(e,"Popup")}static getAll(){return utils_dom.querySelectorAllArray(document,".top-popup-wrapper")}static getAllVisible(){return utils_dom.querySelectorAllVisible(document,".top-popup-wrapper")}static async openByOpener(e){const t={};return t.popup=e.dataset.topPopup,e.dataset.topPopupP&&(t.p=parseInt(e.dataset.topPopupP)),e.dataset.topPopupNotch&&(t.notch=e.dataset.topPopupNotch),e.dataset.topPopupClass&&(t.class=e.dataset.topPopupClass),e.dataset.topPopupPosBy&&(t.posBy=e.dataset.topPopupPosBy),e.dataset.topPopupFront&&(t.frontSelector=e.dataset.topPopupFront),e.dataset.topPopupInvertX&&(t.invertX=e.dataset.topPopupInvertX),e.dataset.topPopupOpenByHover&&(t.openByHover=e.dataset.topPopupOpenByHover),e.dataset.topPopupUseOriginal&&(t.useOriginal=e.dataset.topPopupUseOriginal),await Worker.open(e,t)}static async open(elOpener,options){elOpener.dataset.topPopupOpened="opened";const{default:Popup}=await new Promise((e,t)=>require(["../.chunks/popup-33f53a1c.amd"],e,t));if(typeof jQuery=="function"){const $elOpener=jQuery(elOpener);if($elOpener.data("aftershow")){let afterShow=$elOpener.data("aftershow");typeof afterShow=="string"&&(afterShow=eval(afterShow.replace(/\W/g,""))),$elOpener.one("aftershow.top-menu-popup",afterShow)}if($elOpener.data("afterclose")){let afterclose=$elOpener.data("afterclose");typeof afterclose=="string"&&(afterclose=eval(afterclose.replace(/\W/g,""))),$elOpener.one("afterclose.top-menu-popup",afterclose)}}return options.isFullScreen=forms.Core.state.isMobile,options.i18n=i18n,await new Popup(elOpener,options)}static close(e){const t=Worker.getPopup(e);t&&t.close()}static recalcPosition(e){const t=Worker.getPopup(e);t&&(t.recalcPosition(),HelperCommon.genHasScroll($(t.elPopupBody)))}static scrollToActive(e){if(!utils_dom.querySelectorVisible(e,"ul.top-popup_content > li > .top-active"))return;const o=e.querySelector("ul.top-popup_content"),a=utils_dom.querySelectorAllVisible(e,"ul.top-popup_content > li");e.classList.add("top-popup-wrapper-no_animate"),setTimeout(()=>e.classList.remove("top-popup-wrapper-no_animate"),100);let r=100;for(const s of a){if(s.querySelector(":scope > .top-active"))break;r+=s.offsetHeight}const p=o.offsetHeight;r>p?o.scrollTop=r-p:o.scrollTop=0}static decoratorBeforeOpen(e){decoratorBeforeOpen&&decoratorBeforeOpen(e)}static decoratorAfterOpen(e){decoratorAfterOpen&&decoratorAfterOpen(e)}static decoratorIsIgnoreOuterClick(e){return decoratorIsIgnoreOuterClick?decoratorIsIgnoreOuterClick(e):!1}static regVueComponent(e,t){if(Worker.vueConnectors.get(e))throw"Vue component Popup use duplicated id: "+e;Worker.vueConnectors.set(e,t)}static unregVueComponent(e){Worker.vueConnectors.delete(e)}}WorkerEvents.init(Worker,forms.Core);const Worker$1=Worker;return Worker$1});
|
|
234
2
|
//# sourceMappingURL=worker.amd.js.map
|