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