@topvisor/ui 0.0.34 → 0.0.35
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/.storybook/TopTheme.js +82 -0
- package/.storybook/TopThemeManager.js +44 -0
- package/.storybook/main.ts +43 -0
- package/.storybook/manager.ts +28 -0
- package/.storybook/preview-head.html +16 -0
- package/.storybook/preview.ts +48 -0
- package/.storybook/vue/coreDecorator.ts +19 -0
- package/.storybook/vue/vModelDecorator.ts +27 -0
- package/.vscode/extensions.json +11 -0
- package/.vscode/keybindings.example.json +121 -0
- package/.vscode/settings.json +46 -0
- package/Dockerfile +3 -0
- package/NPM.md +25 -0
- package/PUBLISH.md +18 -0
- package/README.md +19 -52
- package/STORYBOOK.md +27 -0
- package/USE_IN_PROJECT.md +29 -0
- package/build/afterBuild.sh +12 -0
- package/build/cssModules.ts +39 -0
- package/build/plugin/amdFix.ts +46 -0
- package/build/rollup.config.ts +18 -0
- package/nbproject/project.properties +11 -0
- package/nbproject/project.xml +9 -0
- package/package.json +68 -19
- package/public/README.md +63 -0
- package/src/components/common/common.ts +1 -0
- package/src/components/common/icon/icon.ts +4 -0
- package/src/components/common/icon/icon.vue +15 -0
- package/src/components/component.ts +133 -0
- package/src/components/forms/button/button.stories.ts +112 -0
- package/src/components/forms/button/button.ts +51 -0
- package/src/components/forms/button/button.vue +75 -0
- package/src/components/forms/button/stories/README.md +35 -0
- package/src/components/forms/button/stories/overview.vue +33 -0
- package/src/components/forms/button/style/button.css +124 -0
- package/src/components/forms/button/style/style-outline.css +42 -0
- package/src/components/forms/button/style/style-soft.css +31 -0
- package/src/components/forms/button/style/style-transparent.css +35 -0
- package/src/components/forms/checkbox/checkbox.stories.ts +33 -0
- package/src/components/forms/checkbox/checkbox.ts +23 -0
- package/src/components/forms/checkbox/checkbox.vue +135 -0
- package/src/components/forms/checkbox/stories/overview.vue +171 -0
- package/src/components/forms/controlLabel/controlLabel.stories.ts +38 -0
- package/src/components/forms/controlLabel/controlLabel.ts +4 -0
- package/src/components/forms/controlLabel/controlLabel.vue +48 -0
- package/src/components/forms/forms.ts +10 -0
- package/src/components/forms/helpers.ts +10 -0
- package/src/components/forms/hint/hint.stories.ts +46 -0
- package/src/components/forms/hint/hint.ts +8 -0
- package/src/components/forms/hint/hint.vue +32 -0
- package/src/components/forms/input/input.stories.ts +31 -0
- package/src/components/forms/input/input.ts +34 -0
- package/src/components/forms/input/input.vue +170 -0
- package/src/components/forms/input/stories/overview.vue +61 -0
- package/src/components/forms/inputDate/datepicker.css +233 -0
- package/src/components/forms/inputDate/datepicker.ts +101 -0
- package/src/components/forms/inputDate/inputDate.stories.ts +41 -0
- package/src/components/forms/inputDate/inputDate.ts +4 -0
- package/src/components/forms/inputDate/inputDate.vue +127 -0
- package/src/components/forms/inputDate/stories/overview.vue +35 -0
- package/src/components/forms/radio/radio.stories.ts +34 -0
- package/src/components/forms/radio/radio.ts +15 -0
- package/src/components/forms/radio/radio.vue +107 -0
- package/src/components/forms/radio/stories/overview.vue +79 -0
- package/src/components/forms/select/select.stories.ts +34 -0
- package/src/components/forms/select/select.ts +36 -0
- package/src/components/forms/select/select.vue +253 -0
- package/src/components/forms/select/stories/exampleOptions.ts +71 -0
- package/src/components/forms/select/stories/overview.vue +60 -0
- package/src/components/forms/switcher/stories/overview.vue +139 -0
- package/src/components/forms/switcher/switcher.stories.ts +33 -0
- package/src/components/forms/switcher/switcher.ts +22 -0
- package/src/components/forms/switcher/switcher.vue +113 -0
- package/src/components/forms/textarea/stories/overview.vue +62 -0
- package/src/components/forms/textarea/textarea.stories.ts +33 -0
- package/src/components/forms/textarea/textarea.ts +38 -0
- package/src/components/forms/textarea/textarea.vue +119 -0
- package/src/components/formsExt/editArea/editArea.stories.ts +72 -0
- package/src/components/formsExt/editArea/editArea.ts +25 -0
- package/src/components/formsExt/editArea/editArea.vue +172 -0
- package/src/components/formsExt/editArea/stories/README.md +17 -0
- package/src/components/formsExt/editArea/stories/overview.vue +66 -0
- package/src/components/formsExt/editInput/editInput.stories.ts +36 -0
- package/src/components/formsExt/editInput/editInput.ts +20 -0
- package/src/components/formsExt/editInput/editInput.vue +57 -0
- package/src/components/formsExt/editInput/stories/overview.vue +54 -0
- package/src/components/formsExt/formsExt.ts +3 -0
- package/src/components/formsExt/radioGroup/radioGroup.stories.ts +51 -0
- package/src/components/formsExt/radioGroup/radioGroup.ts +28 -0
- package/src/components/formsExt/radioGroup/radioGroup.vue +143 -0
- package/src/components/formsExt/radioGroup/stories/overview.vue +78 -0
- package/src/components/formsExt/radioGroup/styles/top-scrollBar.css +52 -0
- package/src/components/helper.js +10 -0
- package/src/components/helpersStories.ts +151 -0
- package/src/components/popup/lib/popup.globalEvents.js +205 -0
- package/src/components/popup/lib/popup.js +702 -0
- package/src/components/popup/lib/worker.globalEvents.js +78 -0
- package/src/components/popup/lib/worker.js +232 -0
- package/src/components/popup/popup/listItem.vue +42 -0
- package/src/components/popup/popup/opener.vue +74 -0
- package/src/components/popup/popup/popup.stories.ts +68 -0
- package/src/components/popup/popup/popup.ts +93 -0
- package/src/components/popup/popup/popup.vue +95 -0
- package/src/components/popup/popup/stories/README.md +34 -0
- package/src/components/popup/popup/stories/listItems.vue +44 -0
- package/src/components/popup/popup/stories/listSubItems.vue +52 -0
- package/src/components/popup/popup/stories/overview.vue +208 -0
- package/src/components/popup/popup/style/popup.css +243 -0
- package/src/components/popup/popup/style/popup.m.css +71 -0
- package/src/components/popup/popup/style/popup.pc.css +28 -0
- package/src/components/popup/popup.ts +3 -0
- package/src/components/popup/worker.ts +1 -0
- package/src/components/tabs/tabs/content.vue +24 -0
- package/src/components/tabs/tabs/stories/README.md +10 -0
- package/src/components/tabs/tabs/tab.vue +52 -0
- package/src/components/tabs/tabs/tabs.stories.ts +171 -0
- package/src/components/tabs/tabs/tabs.ts +22 -0
- package/src/components/tabs/tabs/tabs.vue +64 -0
- package/src/components/tabs/tabs.ts +3 -0
- package/src/core/base/Colors.stories.ts +15 -0
- package/src/core/base/Layout.stories.ts +15 -0
- package/src/core/base/Properties.stories.ts +15 -0
- package/src/core/base/base.mdx +21 -0
- package/src/core/core/core.ts +144 -0
- package/src/core/core/events.ts +54 -0
- package/src/core/core/options.ts +15 -0
- package/src/core/core/state.ts +44 -0
- package/src/core/directives/tooltip.ts +55 -0
- package/src/core/theme/Colors.stories.ts +15 -0
- package/src/core/theme/Properties.stories.ts +15 -0
- package/src/core/theme/theme.mdx +15 -0
- package/src/core/utils/date.ts +164 -0
- package/src/core/utils/device.ts +48 -0
- package/src/core/utils/dom.ts +185 -0
- 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" +72 -0
- 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" +31 -0
- 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" +14 -0
- package/src/docs/CSS/FAQ.mdx +43 -0
- 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" +156 -0
- 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 +47 -0
- 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 +15 -0
- 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" +49 -0
- package/src/docs/CSS//320/241/321/202/320/270/320/273/320/270.md +53 -0
- package/src/docs/CSS//320/241/321/202/320/270/320/273/320/270.mdx +4 -0
- 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" +53 -0
- package/src/docs/ROADMAP.md +17 -0
- package/src/docs/Roadmap.mdx +4 -0
- package/src/docs//320/222/320/262/320/265/320/264/320/265/320/275/320/270/320/265 /320/262 Storybook.mdx" +323 -0
- package/src/docs//320/232/320/276/320/274/320/277/320/276/320/275/320/265/320/275/321/202/321/213.mdx +20 -0
- 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" +8 -0
- 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" +42 -0
- 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" +72 -0
- 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" +29 -0
- package/src/globals.d.ts +1 -0
- package/{icomoon → src/resources/icomoon}/demo-files/demo.css +161 -161
- package/{icomoon → src/resources/icomoon}/demo-files/demo.js +30 -30
- package/{icomoon → src/resources/icomoon}/demo.html +2945 -2945
- package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.svg +232 -232
- package/{icomoon → src/resources/icomoon}/style.css +647 -647
- package/src/resources/styles/core/colors.css +204 -0
- package/src/resources/styles/core/components.css +70 -0
- package/src/resources/styles/core/core.ts +10 -0
- package/src/resources/styles/core/forms/clear.css +19 -0
- package/src/resources/styles/core/forms/controls.css +20 -0
- package/src/resources/styles/core/forms/focusable.css +26 -0
- package/src/resources/styles/core/forms/forms.css +100 -0
- package/src/resources/styles/core/icon.css +58 -0
- package/src/resources/styles/core/layout.css +40 -0
- package/src/resources/styles/core/modifiers/as.css +9 -0
- package/src/resources/styles/core/modifiers/ellipsis.css +18 -0
- package/src/resources/styles/core/modifiers/modifiers.css +81 -0
- package/src/resources/styles/core/modifiers/only.css +19 -0
- package/src/resources/styles/core/select.css +16 -0
- package/src/resources/styles/jquery-ui.min.css +6 -0
- package/src/resources/styles/storybook.css +11 -0
- package/src/resources/styles/themes/dark/theme.css +139 -0
- package/src/resources/styles/themes/dark.ts +1 -0
- package/src/resources/styles/themes/light/theme.css +139 -0
- package/src/resources/styles/themes/light.ts +1 -0
- package/src/storybook/components/color.vue +45 -0
- package/src/storybook/components/colors.vue +34 -0
- package/src/storybook/components/icomoon.ts +38 -0
- package/src/storybook/components/properties.vue +82 -0
- package/src/storybook/resources/accessibility.png +0 -0
- package/src/storybook/resources/accessibility.svg +5 -0
- 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 +15 -0
- package/src/storybook/resources/docs.png +0 -0
- package/src/storybook/resources/figma-plugin.png +0 -0
- package/src/storybook/resources/github.svg +3 -0
- 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 +12 -0
- package/src/storybook/resources/youtube.svg +4 -0
- 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" +3 -0
- package/tsconfig.json +62 -0
- package/vite.config.ts +91 -0
- package/.chunks/datepicker-0b648b9f.es.js +0 -275
- package/.chunks/datepicker-0b648b9f.es.js.map +0 -1
- package/.chunks/datepicker-0e9a0541.amd.js +0 -234
- package/.chunks/datepicker-0e9a0541.amd.js.map +0 -1
- package/.chunks/forms-02202302.amd.js +0 -3
- package/.chunks/forms-02202302.amd.js.map +0 -1
- package/.chunks/forms-eb00d0c1.es.js +0 -946
- package/.chunks/forms-eb00d0c1.es.js.map +0 -1
- package/.chunks/popup-6f73b4b2.es.js +0 -700
- package/.chunks/popup-6f73b4b2.es.js.map +0 -1
- package/.chunks/popup-e1f34511.amd.js +0 -341
- package/.chunks/popup-e1f34511.amd.js.map +0 -1
- package/common/common.amd.js +0 -2
- package/common/common.amd.js.map +0 -1
- package/common/common.js +0 -2
- package/common/common.js.map +0 -1
- package/core/core.amd.js +0 -2
- package/core/core.amd.js.map +0 -1
- package/core/core.js +0 -6
- package/core/core.js.map +0 -1
- package/core.css +0 -1
- package/dark.css +0 -1
- package/forms/forms.amd.js +0 -2
- package/forms/forms.amd.js.map +0 -1
- package/forms/forms.js +0 -15
- package/forms/forms.js.map +0 -1
- package/forms/helpers.amd.js +0 -2
- package/forms/helpers.amd.js.map +0 -1
- package/forms/helpers.js +0 -9
- package/forms/helpers.js.map +0 -1
- package/forms.css +0 -1
- package/formsExt/formsExt.amd.js +0 -3
- package/formsExt/formsExt.amd.js.map +0 -1
- package/formsExt/formsExt.js +0 -152
- package/formsExt/formsExt.js.map +0 -1
- package/formsExt.css +0 -1
- package/light.css +0 -1
- package/popup/popup.amd.js +0 -3
- package/popup/popup.amd.js.map +0 -1
- package/popup/popup.js +0 -144
- package/popup/popup.js.map +0 -1
- package/popup/worker.amd.js +0 -2
- package/popup/worker.amd.js.map +0 -1
- package/popup/worker.js +0 -154
- package/popup/worker.js.map +0 -1
- package/popup.css +0 -1
- package/tabs/tabs.amd.js +0 -3
- package/tabs/tabs.amd.js.map +0 -1
- package/tabs/tabs.js +0 -97
- package/tabs/tabs.js.map +0 -1
- package/tabs.css +0 -1
- package/utils/date.amd.js +0 -2
- package/utils/date.amd.js.map +0 -1
- package/utils/date.js +0 -6
- package/utils/date.js.map +0 -1
- package/utils/device.amd.js +0 -2
- package/utils/device.amd.js.map +0 -1
- package/utils/device.js +0 -6
- package/utils/device.js.map +0 -1
- package/utils/dom.amd.js +0 -2
- package/utils/dom.amd.js.map +0 -1
- package/utils/dom.js +0 -64
- package/utils/dom.js.map +0 -1
- /package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.ttf +0 -0
- /package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.woff +0 -0
- /package/{icomoon → src/resources/icomoon}/selection.json +0 -0
|
@@ -1,700 +0,0 @@
|
|
|
1
|
-
import { C as f } from "./forms-eb00d0c1.es.js";
|
|
2
|
-
import r from "../utils/dom.js";
|
|
3
|
-
import n 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 r.storage(t, "#" + p);
|
|
33
|
-
}
|
|
34
|
-
// устанвоить компонент
|
|
35
|
-
_setComponent(t) {
|
|
36
|
-
r.storage(t, "#" + this.componentName, this);
|
|
37
|
-
}
|
|
38
|
-
// функция подключения компонента
|
|
39
|
-
mount() {
|
|
40
|
-
throw "Please, add method mount() to component: " + this.componentName;
|
|
41
|
-
}
|
|
42
|
-
// функция отключения компонента
|
|
43
|
-
unmount() {
|
|
44
|
-
r.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 i = {
|
|
61
|
-
el: t,
|
|
62
|
-
type: p,
|
|
63
|
-
listener: o,
|
|
64
|
-
options: e
|
|
65
|
-
};
|
|
66
|
-
this.unmountEvents.push(i);
|
|
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 i = t.target.closest("ul"), l = t.target.closest("a, .a");
|
|
104
|
-
i && ((o = i.querySelector("a.top-active, .a.top-active")) == null || o.classList.remove("top-active")), l && l.classList.add("top-active");
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
n.close(e);
|
|
108
|
-
}
|
|
109
|
-
if (t.target.matches(".top-popup-wrapper")) {
|
|
110
|
-
const e = t.target;
|
|
111
|
-
n.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 (r.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 i = r.querySelectorVisible(p, "li > a.top-active");
|
|
136
|
-
i && (t.preventDefault(), location.href = i.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" ? r.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 = r.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 : n.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"), n.scrollToActive(p);
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const x = `:root{\r
|
|
165
|
-
--top-popup-background-color: var(--color-bg-3);\r
|
|
166
|
-
--top-popup-background-color-hover: var(--color-steel-150);\r
|
|
167
|
-
--top-popup-background-color-active: var(--color-steel-200);\r
|
|
168
|
-
--top-popup-border-color: var(--color-theme-100);\r
|
|
169
|
-
--top-popup-title-background-color: var(--color-steel-100);\r
|
|
170
|
-
}\r
|
|
171
|
-
\r
|
|
172
|
-
.top-theme-dark{\r
|
|
173
|
-
--top-popup-background-color-hover: var(--color-gray-800);\r
|
|
174
|
-
--top-popup-background-color-active: var(--color-gray-750);\r
|
|
175
|
-
--top-popup-title-background-color: var(--color-gray-900);\r
|
|
176
|
-
}\r
|
|
177
|
-
\r
|
|
178
|
-
.top-popup-front{ position: relative; }\r
|
|
179
|
-
\r
|
|
180
|
-
.top-popup-wrapper{\r
|
|
181
|
-
--top-popup-padding-h: 8px;\r
|
|
182
|
-
--top-popup-padding-v: 8px;\r
|
|
183
|
-
\r
|
|
184
|
-
/* см. recalcPosition() */\r
|
|
185
|
-
--top-popup-height: 0px;\r
|
|
186
|
-
--top-popup-right-bounding: 0px;\r
|
|
187
|
-
--top-popup-bottom-bounding: 0px;\r
|
|
188
|
-
--top-popup-top: 0px;\r
|
|
189
|
-
--top-popup-right: calc(100vw - var(--top-popup-right-bounding));\r
|
|
190
|
-
--top-popup-bottom: calc(var(--100vh) - var(--top-popup-bottom-bounding));\r
|
|
191
|
-
--top-popup-left: 0px;\r
|
|
192
|
-
\r
|
|
193
|
-
text-align: initial; white-space: normal; word-break: normal;\r
|
|
194
|
-
position: absolute; z-index: 200000;\r
|
|
195
|
-
}\r
|
|
196
|
-
.top-popup-wrapper:not(.top-popup-wrapper-shown){ overflow: hidden; }\r
|
|
197
|
-
\r
|
|
198
|
-
/* top-popupPanel */\r
|
|
199
|
-
.top-popupPanel {\r
|
|
200
|
-
cursor: default;\r
|
|
201
|
-
box-shadow: var(--top-shadow-b);\r
|
|
202
|
-
border-radius: 8px;\r
|
|
203
|
-
background: var(--top-popup-background-color);\r
|
|
204
|
-
position: absolute; overflow: hidden;\r
|
|
205
|
-
display: flex; flex-direction: column;\r
|
|
206
|
-
}\r
|
|
207
|
-
\r
|
|
208
|
-
/* position */\r
|
|
209
|
-
.top-popup-wrapper > *{ opacity: 0; transition: opacity 100ms linear, transform 100ms linear; }\r
|
|
210
|
-
.top-popup-wrapper.p0 > *{ transform: translateY(-8px); }\r
|
|
211
|
-
.top-popup-wrapper.p1 > *{ transform: translateY(8px); }\r
|
|
212
|
-
.top-popup-wrapper.p2 > *{ transform: translateX(8px); }\r
|
|
213
|
-
.top-popup-wrapper.p3 > *{ transform: translateY(8px); }\r
|
|
214
|
-
.top-popup-wrapper.p4 > *{ transform: translateX(-8px); }\r
|
|
215
|
-
.top-popup-wrapper-shown:not(.top-popup-wrapper-closed) > *{opacity: 1;transform: translate(0, 0) !important;}\r
|
|
216
|
-
\r
|
|
217
|
-
.top-popup-wrapper.p0 > .top-popup{ top: calc(-16px); left: calc(0px - var(--top-popup-padding-h)); }\r
|
|
218
|
-
.top-popup-wrapper.p1 > .top-popup{ bottom: calc(100% + 8px); }\r
|
|
219
|
-
.top-popup-wrapper.p2 > .top-popup{ left: calc(100% + 8px); }\r
|
|
220
|
-
.top-popup-wrapper.p3 > .top-popup{ top: calc(100% + 8px); }\r
|
|
221
|
-
.top-popup-wrapper.p4 > .top-popup{ right: calc(100% + 8px); }\r
|
|
222
|
-
.top-popup-wrapper.p2 > .top-popup,\r
|
|
223
|
-
.top-popup-wrapper.p4 > .top-popup{ margin-top: -10px; }\r
|
|
224
|
-
\r
|
|
225
|
-
.top-popup-wrapper.p1.with_notch > .top-popup{ margin-bottom: 5px; }\r
|
|
226
|
-
.top-popup-wrapper.p2.with_notch > .top-popup{ margin-left: 5px; }\r
|
|
227
|
-
.top-popup-wrapper.p3.with_notch > .top-popup{ margin-top: 5px; }\r
|
|
228
|
-
.top-popup-wrapper.p4.with_notch > .top-popup{ margin-right: 5px; }\r
|
|
229
|
-
\r
|
|
230
|
-
.top-popup-wrapper.invert-x > .top-popup{ right: 0; }\r
|
|
231
|
-
.top-popup-wrapper.invert-y > .top-popup{ bottom: 0; }\r
|
|
232
|
-
\r
|
|
233
|
-
/* notch */\r
|
|
234
|
-
.top-popup-wrapper > .notch{ border: 7.4px solid transparent; position: absolute; display: block; }\r
|
|
235
|
-
\r
|
|
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% }\r
|
|
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%; }\r
|
|
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%; }\r
|
|
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%; }\r
|
|
240
|
-
\r
|
|
241
|
-
.top-popup-wrapper.p1 > .notch-border{ border-top-color: rgba(0,0,0,0.05); margin-bottom: 6px; }\r
|
|
242
|
-
.top-popup-wrapper.p2 > .notch-border{ border-right-color: rgba(0,0,0,0.05); margin-left: 6px; }\r
|
|
243
|
-
.top-popup-wrapper.p3 > .notch-border{ border-bottom-color: rgba(0,0,0,0.05); margin-top: 6px; }\r
|
|
244
|
-
.top-popup-wrapper.p4 > .notch-border{ border-left-color: rgba(0,0,0,0.05); margin-right: 6px; }\r
|
|
245
|
-
\r
|
|
246
|
-
/* common */\r
|
|
247
|
-
.top-popup_header,\r
|
|
248
|
-
.top-popup_content,\r
|
|
249
|
-
.top-popup_footer{ padding: var(--top-popup-padding-h) var(--top-popup-padding-h); font-size: 14px; }\r
|
|
250
|
-
.top-popup_header,\r
|
|
251
|
-
.top-popup_footer{ display: flex; align-items: center; justify-content: space-between; }\r
|
|
252
|
-
\r
|
|
253
|
-
/* header */\r
|
|
254
|
-
.top-popup_header{ border-bottom: 1px solid var(--top-popup-border-color); font-weight: 600; }\r
|
|
255
|
-
.top-popup_header > *{ font-weight: 400; }\r
|
|
256
|
-
.top-popup_header > .a{ cursor: pointer; color: var(--color-blue-450); }\r
|
|
257
|
-
.top-popup_header > .a:hover{ color: var(--color-blue-350); }\r
|
|
258
|
-
\r
|
|
259
|
-
.top-popup-headerButton{ width: 60px; }\r
|
|
260
|
-
\r
|
|
261
|
-
/* content */\r
|
|
262
|
-
.top-popup .top-popup_content{\r
|
|
263
|
-
/* has_scroll */\r
|
|
264
|
-
--scroll-padding-top: var(--top-popup-padding-v);\r
|
|
265
|
-
--scroll-padding-bottom: var(--top-popup-padding-v);\r
|
|
266
|
-
\r
|
|
267
|
-
padding-top: var(--top-popup-padding-v); padding-bottom: var(--top-popup-padding-v); margin: 0; line-height:1.3 !important;\r
|
|
268
|
-
flex-grow: 1; overflow-y: auto;\r
|
|
269
|
-
-webkit-overflow-scrolling: touch;\r
|
|
270
|
-
}\r
|
|
271
|
-
\r
|
|
272
|
-
.top-popup .top-popup_content .top-unwrap{\r
|
|
273
|
-
--top-unwrap-x: var(--top-popup-padding-h);\r
|
|
274
|
-
}\r
|
|
275
|
-
\r
|
|
276
|
-
.top-popup div.top-popup_content{ display: flex; flex-direction: column; gap: 4px; }\r
|
|
277
|
-
.top-popup div.top-popup_content > *{ flex-shrink: 0; }\r
|
|
278
|
-
.top-popup div.top-popup_content > .top-button{ margin: 0; }\r
|
|
279
|
-
\r
|
|
280
|
-
.top-popup ul.top-popup_content{\r
|
|
281
|
-
--scroll-padding-top: 4px;\r
|
|
282
|
-
--scroll-padding-bottom: var(--scroll-padding-top);\r
|
|
283
|
-
\r
|
|
284
|
-
padding: var(--scroll-padding-top) 0;\r
|
|
285
|
-
}\r
|
|
286
|
-
\r
|
|
287
|
-
ul.top-popup_content li{ margin: 0; list-style:none; display: flex; position: relative }\r
|
|
288
|
-
ul.top-popup_content li > *{ flex-grow: 1; }\r
|
|
289
|
-
ul.top-popup_content li > a:not(.top-button),\r
|
|
290
|
-
ul.top-popup_content li > i.a{\r
|
|
291
|
-
cursor: pointer;\r
|
|
292
|
-
box-sizing: border-box;\r
|
|
293
|
-
background: var(--top-popup-background-color); padding:var(--top-popup-padding-v) var(--top-popup-padding-h);\r
|
|
294
|
-
color:var(--color-text) !important; font-size: 14px; font-weight: normal !important; text-decoration:none !important; font-style: normal;\r
|
|
295
|
-
display:flex; flex: 1 1 100%; align-items: center;\r
|
|
296
|
-
transition: background-color 0.1s ease-in-out;\r
|
|
297
|
-
}\r
|
|
298
|
-
.top-popup-wrapper-no_animate ul.top-popup_content li > a:not(.top-button),\r
|
|
299
|
-
.top-popup-wrapper-no_animate ul.top-popup_content li > i.a{ transition: none; }\r
|
|
300
|
-
\r
|
|
301
|
-
ul.top-popup_content li > a:not(.top-button):hover,\r
|
|
302
|
-
ul.top-popup_content li > i.a:hover{ background: var(--top-popup-background-color-hover); }\r
|
|
303
|
-
ul.top-popup_content li > a:not(.top-button).top-active,\r
|
|
304
|
-
ul.top-popup_content li > i.a.top-active{ background: var(--top-popup-background-color-active); }\r
|
|
305
|
-
\r
|
|
306
|
-
/* listTitle */\r
|
|
307
|
-
li.top-popup_listTitle{\r
|
|
308
|
-
background: var(--top-popup-title-background-color); padding: var(--top-popup-padding-v) var(--top-popup-padding-h);\r
|
|
309
|
-
color: var(--color-text-3); font-size: 12px; font-weight: 400;\r
|
|
310
|
-
}\r
|
|
311
|
-
li.top-popup_listTitle:first-child{\r
|
|
312
|
-
padding-top: calc(var(--top-popup-padding-v) + var(--scroll-padding-top));\r
|
|
313
|
-
margin-top: calc(0px - var(--scroll-padding-top));\r
|
|
314
|
-
}\r
|
|
315
|
-
\r
|
|
316
|
-
/* listDelimiter */\r
|
|
317
|
-
ul.top-popup_content li.top-popup_listDelimiter{\r
|
|
318
|
-
border-radius: 3px;\r
|
|
319
|
-
background: var(--top-popup-border-color);\r
|
|
320
|
-
height: 2px;\r
|
|
321
|
-
margin: calc(var(--top-popup-padding-h) / 2) var(--top-popup-padding-h);\r
|
|
322
|
-
}\r
|
|
323
|
-
\r
|
|
324
|
-
/* listMore */\r
|
|
325
|
-
ul.top-popup_content li > i.a.top-popup_listMore{\r
|
|
326
|
-
height: auto; padding-right: 4px; padding-left: 4px;\r
|
|
327
|
-
font-size: 24px; line-height: 17px; text-align: center;\r
|
|
328
|
-
flex-basis: 10px;\r
|
|
329
|
-
}\r
|
|
330
|
-
ul.top-popup_content li > i.a.top-popup_listMore:before{ color: var(--color-gray-500); }\r
|
|
331
|
-
ul.top-popup_content li > * > i.top-popup_listMore{\r
|
|
332
|
-
padding: 0 var(--top-popup-padding-h); margin: 0 0 0 auto;\r
|
|
333
|
-
color: var(--color-gray-500);\r
|
|
334
|
-
font-size: 14px;\r
|
|
335
|
-
}\r
|
|
336
|
-
ul.top-popup_content li > * > i.top-popup_listMore:hover,\r
|
|
337
|
-
ul.top-popup_content li > * > i.top-popup_listMore.top-active{ color: var(--color-blue-500); }\r
|
|
338
|
-
ul.top-popup_content li > * > i.top-popup_listMore:before{ transform: rotate(90deg); }\r
|
|
339
|
-
\r
|
|
340
|
-
ul.top-popup_content li a.close{ background: none !important; }\r
|
|
341
|
-
\r
|
|
342
|
-
/* data-top-icon */\r
|
|
343
|
-
.top-popup_content > [data-top-icon]:before{ --top-icon-size: 20px; }\r
|
|
344
|
-
\r
|
|
345
|
-
ul.top-popup_content li > [data-top-icon]:not(.top-button):before{\r
|
|
346
|
-
--top-icon-color: var(--color-text-3);\r
|
|
347
|
-
--top-icon-size: 20px;\r
|
|
348
|
-
--top-icon-width: 20px;\r
|
|
349
|
-
\r
|
|
350
|
-
height: 1rem; margin-right: 8px; transition: color 0.1s;\r
|
|
351
|
-
}\r
|
|
352
|
-
ul.top-popup_content li:hover > [data-top-icon]:not(.top-button):before,\r
|
|
353
|
-
ul.top-popup_content li > [data-top-icon]:not(.top-button).top-active:before{\r
|
|
354
|
-
--top-icon-color: #378DC6;\r
|
|
355
|
-
}\r
|
|
356
|
-
\r
|
|
357
|
-
/* footer */\r
|
|
358
|
-
.top-popup_footer{\r
|
|
359
|
-
padding: var(--top-popup-padding-h) var(--top-popup-padding-h); display: flex; gap:8px; justify-content: flex-end;\r
|
|
360
|
-
}\r
|
|
361
|
-
.top-popup_footer > .top-button{ margin: 0; }\r
|
|
362
|
-
\r
|
|
363
|
-
/* Виджеты */\r
|
|
364
|
-
.top-popup > [data-widget]{ padding: 0 var(--top-popup-padding-h); }\r
|
|
365
|
-
.top-popup > [data-widget] + hr{ margin: 0 var(--top-popup-padding-h); }\r
|
|
366
|
-
\r
|
|
367
|
-
.top-popup .placeholder{\r
|
|
368
|
-
border:1px solid #E0D9D9 !important; border-right: none !important; border-left: none !important; background:#F9F9F9 !important; margin: -1px 0; z-index: 1;\r
|
|
369
|
-
position: relative;\r
|
|
370
|
-
}\r
|
|
371
|
-
\r
|
|
372
|
-
/* компоненты */\r
|
|
373
|
-
.top-popup-wrapper.simple_list > .top-popup{ min-width: 0; white-space: nowrap; }\r
|
|
374
|
-
\r
|
|
375
|
-
.top-popup_content .top-column{ display: flex; flex-direction: column; gap: 4px; }\r
|
|
376
|
-
.top-popup_content li > :not(a):not(.a){ margin:0 var(--top-popup-padding-h); }\r
|
|
377
|
-
html .top-popup .top-popup_content li > .top-button{ margin:calc(var(--top-popup-padding-v) / 2) var(--top-popup-padding-h); }\r
|
|
378
|
-
\r
|
|
379
|
-
.top-popup li .check_all,\r
|
|
380
|
-
.top-popup li .clear_all{ cursor: pointer; color: var(--color-cyan); padding: 8px; display: inline-block; }\r
|
|
381
|
-
.top-popup li .check_all:hover,\r
|
|
382
|
-
.top-popup li .clear_all:hover{ text-decoration: underline; }\r
|
|
383
|
-
.top-popup li .clear_all{ display: none; }\r
|
|
384
|
-
\r
|
|
385
|
-
/* table */\r
|
|
386
|
-
.top-popup_content table{ margin: -9px 0; }\r
|
|
387
|
-
.top-popup_content table td,\r
|
|
388
|
-
.top-popup_content table th{ padding: 9px var(--top-popup-padding-h) 9px 0; vertical-align: top; }\r
|
|
389
|
-
.top-popup_content table th{ width: 40%; font-weight: 600; white-space: nowrap; }\r
|
|
390
|
-
\r
|
|
391
|
-
/* формы */\r
|
|
392
|
-
ul.top-popup_content .a > [type="checkbox"],\r
|
|
393
|
-
ul.top-popup_content .a > [type="radio"]{ margin: -8px 0 -8px auto; }\r
|
|
394
|
-
\r
|
|
395
|
-
/* deprecated */\r
|
|
396
|
-
ul.top-popup_content a > [class*=icon],\r
|
|
397
|
-
ul.top-popup_content i.a > [class*=icon]{\r
|
|
398
|
-
margin-right: 14px; text-align: center;\r
|
|
399
|
-
width: auto; height: 16px; font-size: 16px; vertical-align: top;\r
|
|
400
|
-
transition: 0.1s;\r
|
|
401
|
-
}\r
|
|
402
|
-
\r
|
|
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; }\r
|
|
404
|
-
.top-popup_footer [class*=btn]:not(.btn-transparent){ min-width: 100px; padding: 5px 14px; margin-left: 10px; }\r
|
|
405
|
-
.top-popup_footer [class*=btn]:first-child{ margin-left: 0; }\r
|
|
406
|
-
.top-popup_footer .btn.full_width{ margin: 0; flex-grow: 1; }`, w = `html.with_popup{ background: #808080; }\r
|
|
407
|
-
\r
|
|
408
|
-
.top-popup-wrapper{\r
|
|
409
|
-
--top-popup-padding-h: 19px;\r
|
|
410
|
-
--top-popup-padding-v: 16px;\r
|
|
411
|
-
--top-popup-footer-offset: 25px;\r
|
|
412
|
-
\r
|
|
413
|
-
width: auto !important; height: auto !important;\r
|
|
414
|
-
position: fixed; top: 0 !important; right: 0 !important; left: 0 !important; overflow: hidden;\r
|
|
415
|
-
transition: background 0.3s;\r
|
|
416
|
-
}\r
|
|
417
|
-
\r
|
|
418
|
-
.top-popup-wrapper-shown:not(.top-popup-wrapper-closed){ background: rgba(0,0,0,0.5); backdrop-filter: blur(1px); }\r
|
|
419
|
-
.top-popup-wrapper-shown:not(.top-popup-wrapper-closed) > .top-popup{ opacity: 1 !important; }\r
|
|
420
|
-
\r
|
|
421
|
-
.top-popup{\r
|
|
422
|
-
border-radius: 8px 8px 0 0; width: auto !important; max-height: calc(100% - var(--header-height) - 12px);\r
|
|
423
|
-
top: auto !important; right: 0 !important; bottom: 0 !important; left: 0 !important;\r
|
|
424
|
-
display: flex; flex-direction: column;\r
|
|
425
|
-
\r
|
|
426
|
-
/* невозможно опустить элемент вниз за экран на 100%, fix: opacity и translateY(80%) */\r
|
|
427
|
-
transform: translateY(80%);\r
|
|
428
|
-
\r
|
|
429
|
-
transition: opacity 0.3s, transform 0.3s;\r
|
|
430
|
-
}\r
|
|
431
|
-
\r
|
|
432
|
-
/* from top */\r
|
|
433
|
-
.top-popup-wrapper.p-from-top{\r
|
|
434
|
-
--top-popup-footer-offset: 0px;\r
|
|
435
|
-
\r
|
|
436
|
-
top: var(--header-height) !important;\r
|
|
437
|
-
}\r
|
|
438
|
-
.with_dialog .top-popup-wrapper.p-from-top{ top: 50px !important; }\r
|
|
439
|
-
.top-popup-wrapper.p-from-top > .top-popup{\r
|
|
440
|
-
border-radius: 0 0 8px 8px; max-height: calc(100% - 24px); top: 0 !important; bottom: auto !important;\r
|
|
441
|
-
transform: translateY(calc(-100% - 24px));\r
|
|
442
|
-
}\r
|
|
443
|
-
\r
|
|
444
|
-
.top-popup_content:last-child,\r
|
|
445
|
-
.top-popup_footer{\r
|
|
446
|
-
--scroll-padding-bottom: calc(var(--top-popup-padding-v) + var(--top-popup-footer-offset));\r
|
|
447
|
-
\r
|
|
448
|
-
padding-bottom: var(--scroll-padding-bottom);\r
|
|
449
|
-
}\r
|
|
450
|
-
\r
|
|
451
|
-
/* content */\r
|
|
452
|
-
ul.top-popup_content{\r
|
|
453
|
-
--scroll-padding-top: 0px;\r
|
|
454
|
-
--scroll-padding-bottom: var(--scroll-padding-top);\r
|
|
455
|
-
\r
|
|
456
|
-
display: flex; flex-direction: column;\r
|
|
457
|
-
}\r
|
|
458
|
-
ul.top-popup_content li:not(:last-child){ border-bottom: 1px solid var(--top-popup-border-color); }\r
|
|
459
|
-
\r
|
|
460
|
-
.top-popup-wrapper.top-style_alt > .top-popup > ul > li{ border-bottom: none; }\r
|
|
461
|
-
\r
|
|
462
|
-
/* footer */\r
|
|
463
|
-
.top-popup_footer{ flex-wrap: wrap; }\r
|
|
464
|
-
.top-popup_footer > .top-button{\r
|
|
465
|
-
--top-forms-base-height: var(--top-forms-base-height_xl);\r
|
|
466
|
-
\r
|
|
467
|
-
flex-grow: 1;\r
|
|
468
|
-
}\r
|
|
469
|
-
\r
|
|
470
|
-
/* listTitle */\r
|
|
471
|
-
ul.top-popup_content li.top-popup_listTitle{\r
|
|
472
|
-
--top-popup-padding-v: 12px;\r
|
|
473
|
-
}\r
|
|
474
|
-
\r
|
|
475
|
-
/* listDelimiter */\r
|
|
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; }\r
|
|
477
|
-
\r
|
|
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)); }\r
|
|
479
|
-
.top-popup-wrapper.invert-x > .top-popup{ max-width: calc(100vw - var(--top-popup-right) - 16px); }\r
|
|
480
|
-
.top-popup-wrapper.invert-y > .top-popup{ max-height: calc(100vh - var(--top-popup-bottom) - 16px); }\r
|
|
481
|
-
\r
|
|
482
|
-
/* position */\r
|
|
483
|
-
.top-popup-wrapper.p1 > .top-popup{ max-height: calc(var(--top-popup-top) - var(--header-height) - 16px); }\r
|
|
484
|
-
.top-popup-wrapper.p3 > .top-popup{ max-height: calc(var(--top-popup-bottom) - 16px); }\r
|
|
485
|
-
.top-popup-wrapper.p2 > .top-popup{ max-width: calc(var(--top-popup-right) - 16px); }\r
|
|
486
|
-
.top-popup-wrapper.p4 > .top-popup{ max-width: calc(var(--top-popup-left) - 16px); }\r
|
|
487
|
-
\r
|
|
488
|
-
/* notch */\r
|
|
489
|
-
.top-popup-wrapper.p1.with_notch > .top-popup,\r
|
|
490
|
-
.top-popup-wrapper.p3.with_notch > .top-popup{ margin-left: -16px !important; }\r
|
|
491
|
-
.top-popup-wrapper.p1.with_notch > .notch,\r
|
|
492
|
-
.top-popup-wrapper.p3.with_notch > .notch{ margin-left: -8px !important; }\r
|
|
493
|
-
\r
|
|
494
|
-
.top-popup-wrapper.p1.with_notch.invert-x,\r
|
|
495
|
-
.top-popup-wrapper.p3.with_notch.invert-x{ margin-left: 3px !important; }\r
|
|
496
|
-
.top-popup-wrapper.p1.with_notch.invert-x > .notch,\r
|
|
497
|
-
.top-popup-wrapper.p3.with_notch.invert-x > .notch{ margin-left: -9px !important; }\r
|
|
498
|
-
\r
|
|
499
|
-
/* listMore */\r
|
|
500
|
-
ul.top-popup_content li > * > i.top-popup_listMore{ visibility: hidden; transition: none; }\r
|
|
501
|
-
ul.top-popup_content li:hover > * > i.top-popup_listMore,\r
|
|
502
|
-
ul.top-popup_content li > *.top-active > i.top-popup_listMore,\r
|
|
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 = n.getPopup(this.el.closest(".top-popup-wrapper")), await this.mountJQuery(), r.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 = r.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 = r.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"), n.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 = r.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 = r.wrap(this.elPopup, "div")), this.type === "html" && (this.elPopup.querySelector(":scope > .top-popup_content") || (this.elPopup.classList.add("top-popup_content"), this.elPopup = r.wrap(this.elPopup, "div"))), (this.type === "selector" && !this.elPopup.matches(".template") || this.type === "html" || this.type === "vue") && (r.querySelectorAllArray(this.elPopup, "[data-top-popup]").forEach((e) => e.dataset.topPopupPosBy = "fixed"), r.querySelectorAllArray(this.elPopup, ".top-popup-wrapper").forEach((e) => e.remove()))), n.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 = r.genEl("i", { class: "header" }), this.elPopupInner.prepend(this.elPopupHeader), this.elPopupHeader.prepend(r.genEl("i", { class: "a closer" }, this.options.i18n.Close)), this.elPopupHeader.append(r.genEl("i", { class: "top-popup-headerButton" })))), r.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 = r.offset(this.el).top - this.el.offsetTop - r.offset(this.elFront).top, this.shift.left = r.offset(this.el).left - this.el.offsetLeft - r.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(), n.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 = r.querySelectorVisible(this.elPopup, ".top-popup-autofocus");
|
|
602
|
-
t || (t = r.querySelectorVisible(this.elPopup, ":read-write, select:not(:disabled)")), t || (t = r.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 = r.querySelectorVisibleLast(document.body, ":scope > .top-popup-wrapper");
|
|
615
|
-
p && p !== this.elPopup || (p = r.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") || n.decoratorIsIgnoreOuterClick(t) || n.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
|
-
n.getAllVisible().forEach((o) => {
|
|
625
|
-
var e, i, l;
|
|
626
|
-
this.elPopup.contains(o) || ((e = this.popupParent) == null ? void 0 : e.elPopup) === o || ((l = (i = this.popupParent) == null ? void 0 : i.popupParent) == null ? void 0 : l.elPopup) === o || n.close(o);
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Закрыть Popup при отведении мыши
|
|
631
|
-
* @param {Event} _e
|
|
632
|
-
*/
|
|
633
|
-
onMouseleave(t) {
|
|
634
|
-
setTimeout(() => {
|
|
635
|
-
this.elPopupInner.matches(":hover") || n.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 = r.offset(this.el).top + "px", this.elPopup.style.left = r.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, i = !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 && (i = !0), v < d && (l = !0), s.left < d && (h = !0), e && (t === 0 || t === 1) && c && (t = 3), l && t === 3 && c && (t = 1), i && t === 2 && a && (t = 4), h && t === 4 && a && (t = 2), i && (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 = "", n.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)]), !n.noClose && (this.unmount(), this.elPopup.classList.add("top-popup-wrapper-closed"), setTimeout(() => {
|
|
677
|
-
var o, e, i;
|
|
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(), (i = this.elPopup.querySelector(".notch")) == null || i.remove(), this.elPopupInner.replaceWith(...this.elPopupInner.childNodes), r.storageClear(this.elPopup)) : (r.storageClear(this.elPopup), this.elPopup.remove(), delete this.elPopup);
|
|
679
|
-
const t = n.getAllVisible(), p = t.length && t[t.length - 1];
|
|
680
|
-
p ? n.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 n.vueConnectors.get(this.el.dataset.topPopupId);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
b.init();
|
|
697
|
-
export {
|
|
698
|
-
g as default
|
|
699
|
-
};
|
|
700
|
-
//# sourceMappingURL=popup-6f73b4b2.es.js.map
|