@topvisor/ui 1.3.5-5.0 → 1.4.0-TopGroupSelector.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/.chunks/core-BL-38XF7.es.js +196 -0
  2. package/.chunks/core-BL-38XF7.es.js.map +1 -0
  3. package/.chunks/core-BsPx05H9.amd.js +2 -0
  4. package/.chunks/core-BsPx05H9.amd.js.map +1 -0
  5. package/.chunks/{datepicker-CPrHVH4x.amd.js → datepicker-3coUsFW2.amd.js} +2 -2
  6. package/.chunks/{datepicker-CPrHVH4x.amd.js.map → datepicker-3coUsFW2.amd.js.map} +1 -1
  7. package/.chunks/{datepicker-J8Zg9mKt.es.js → datepicker-D1Hw3a3o.es.js} +14 -17
  8. package/.chunks/{datepicker-J8Zg9mKt.es.js.map → datepicker-D1Hw3a3o.es.js.map} +1 -1
  9. package/.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js +180 -0
  10. package/.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js.map +1 -0
  11. package/.chunks/dialog_regionSelectorRegions-CZ8IX7la.amd.js +2 -0
  12. package/.chunks/dialog_regionSelectorRegions-CZ8IX7la.amd.js.map +1 -0
  13. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js} +111 -112
  14. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js.map} +1 -1
  15. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js +2 -0
  16. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js.map} +1 -1
  17. package/.chunks/forms-BseC3Ftz.es.js +2035 -0
  18. package/.chunks/{forms-COXAfg9G.es.js.map → forms-BseC3Ftz.es.js.map} +1 -1
  19. package/.chunks/forms-CUSCBQu3.amd.js +3 -0
  20. package/.chunks/{forms-DXX5M4DO.amd.js.map → forms-CUSCBQu3.amd.js.map} +1 -1
  21. package/.chunks/index-DLUtoTUg.amd.js +2 -0
  22. package/.chunks/index-DLUtoTUg.amd.js.map +1 -0
  23. package/.chunks/index-DkQWJkMc.es.js +54 -0
  24. package/.chunks/index-DkQWJkMc.es.js.map +1 -0
  25. package/.chunks/notice-Cl3ZgiHm.es.js +191 -0
  26. package/.chunks/{notice-P7CXfEuX.es.js.map → notice-Cl3ZgiHm.es.js.map} +1 -1
  27. package/.chunks/notice-DwjipV21.amd.js +4 -0
  28. package/.chunks/{notice-CSGn_jTM.amd.js.map → notice-DwjipV21.amd.js.map} +1 -1
  29. package/.chunks/page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js +2 -0
  30. package/.chunks/{page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js.map → page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js.map} +1 -1
  31. package/.chunks/page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js +139 -0
  32. package/.chunks/{page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js.map → page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js.map} +1 -1
  33. package/.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js +496 -0
  34. package/.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js.map +1 -0
  35. package/.chunks/policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js +2 -0
  36. package/.chunks/policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js.map +1 -0
  37. package/.chunks/popup-DRuyYFGB.amd.js +2 -0
  38. package/.chunks/popup-DRuyYFGB.amd.js.map +1 -0
  39. package/.chunks/popup-Jw_Yyg3U.es.js +470 -0
  40. package/.chunks/popup-Jw_Yyg3U.es.js.map +1 -0
  41. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js +209 -0
  42. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js.map +1 -0
  43. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js +2 -0
  44. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js.map +1 -0
  45. package/.chunks/utils-CzHUG_xz.amd.js +2 -0
  46. package/.chunks/{utils-D505nRsu.amd.js.map → utils-CzHUG_xz.amd.js.map} +1 -1
  47. package/.chunks/utils-D9nYQabE.amd.js +2 -0
  48. package/.chunks/{utils-DmxcQpWA.amd.js.map → utils-D9nYQabE.amd.js.map} +1 -1
  49. package/.chunks/{utils-CWm0zAtM.es.js → utils-Q69SXlnV.es.js} +192 -208
  50. package/.chunks/{utils-CWm0zAtM.es.js.map → utils-Q69SXlnV.es.js.map} +1 -1
  51. package/.chunks/{utils-Rbz9mxy6.es.js → utils-YrUExsH7.es.js} +23 -24
  52. package/.chunks/{utils-Rbz9mxy6.es.js.map → utils-YrUExsH7.es.js.map} +1 -1
  53. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js} +2 -2
  54. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js.map} +1 -1
  55. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js} +2 -2
  56. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js.map} +1 -1
  57. package/api/index.amd.js +1 -1
  58. package/api/index.amd.js.map +1 -1
  59. package/api/index.js +138 -133
  60. package/api/index.js.map +1 -1
  61. package/assets/dialog_regionSelectorRegions.css +1 -0
  62. package/assets/forms.css +1 -1
  63. package/assets/policy.css +1 -0
  64. package/assets/popupHint.css +1 -1
  65. package/assets/project.css +1 -1
  66. package/charts/charts.amd.js +1 -1
  67. package/charts/charts.amd.js.map +1 -1
  68. package/charts/charts.js +80 -80
  69. package/charts/charts.js.map +1 -1
  70. package/core/app.amd.js +1 -1
  71. package/core/app.amd.js.map +1 -1
  72. package/core/app.js +93 -96
  73. package/core/app.js.map +1 -1
  74. package/dialog/dialog.amd.js +1 -1
  75. package/dialog/dialog.amd.js.map +1 -1
  76. package/dialog/dialog.js +13 -13
  77. package/dialog/dialog.js.map +1 -1
  78. package/extra/extra.amd.js +1 -1
  79. package/extra/extra.amd.js.map +1 -1
  80. package/extra/extra.js +20 -23
  81. package/extra/extra.js.map +1 -1
  82. package/forms/forms.amd.js +1 -1
  83. package/forms/forms.js +5 -5
  84. package/formsExt/formsExt.amd.js +1 -1
  85. package/formsExt/formsExt.amd.js.map +1 -1
  86. package/formsExt/formsExt.js +180 -541
  87. package/formsExt/formsExt.js.map +1 -1
  88. package/layout/layout.amd.js +1 -1
  89. package/layout/layout.js +6 -6
  90. package/package.json +1 -1
  91. package/popup/popup.amd.js +1 -1
  92. package/popup/popup.amd.js.map +1 -1
  93. package/popup/popup.js +43 -46
  94. package/popup/popup.js.map +1 -1
  95. package/popup/worker.amd.js +1 -1
  96. package/popup/worker.amd.js.map +1 -1
  97. package/popup/worker.js +11 -9
  98. package/popup/worker.js.map +1 -1
  99. package/project/project.amd.js +1 -1
  100. package/project/project.amd.js.map +1 -1
  101. package/project/project.js +847 -579
  102. package/project/project.js.map +1 -1
  103. package/src/api/api/client/client.d.ts +5 -0
  104. package/src/api/api/mocker/index.d.ts +3 -3
  105. package/src/api/api/types/client/request.d.ts +6 -0
  106. package/src/api/api/types/mocker.d.ts +2 -2
  107. package/src/components/formsExt/formsExt.d.ts +1 -0
  108. package/src/components/formsExt/selector2/cache.d.ts +12 -0
  109. package/src/components/formsExt/selector2/composables/useAPI.d.ts +2033 -0
  110. package/src/components/formsExt/selector2/composables/useMenu.d.ts +2045 -5
  111. package/src/components/formsExt/selector2/itemMulti.vue.d.ts +3 -3
  112. package/src/components/formsExt/selector2/selector2.vue.d.ts +9 -3
  113. package/src/components/formsExt/selector2/types.d.ts +25 -8
  114. package/src/components/formsExt/selector2/utils.d.ts +16 -0
  115. package/src/components/popup/lib/popup.d.ts +1 -2
  116. package/src/components/popup/popup/opener/types.d.ts +6 -2
  117. package/src/components/popup/popup/types.d.ts +3 -2
  118. package/src/components/popup/popup.d.ts +1 -1
  119. package/src/components/project/groupSelector/folders/folders.vue.d.ts +18 -0
  120. package/src/components/project/groupSelector/folders/types.d.ts +63 -0
  121. package/src/components/project/groupSelector/folders/utils.d.ts +63 -0
  122. package/src/components/project/groupSelector/groupSelector.vue.d.ts +33 -0
  123. package/src/components/project/groupSelector/groups/groups.vue.d.ts +126 -0
  124. package/src/components/project/groupSelector/groups/types.d.ts +58 -0
  125. package/src/components/project/groupSelector/groups/utils.d.ts +92 -0
  126. package/src/components/project/groupSelector/stories/mocks/folders.d.ts +4 -0
  127. package/src/components/project/groupSelector/stories/mocks/groups.d.ts +2 -0
  128. package/src/components/project/groupSelector/stories/mocks/index.d.ts +7 -0
  129. package/src/components/project/groupSelector/types.d.ts +133 -0
  130. package/src/components/project/project.d.ts +5 -4
  131. package/src/components/project/{selectorRegion → regionSelector}/utils/utils.d.ts +3 -3
  132. package/src/core/utils/composables/useWatch.d.ts +32 -0
  133. package/tabs/tabs.amd.js +1 -1
  134. package/tabs/tabs.amd.js.map +1 -1
  135. package/tabs/tabs.js +24 -24
  136. package/tabs/tabs.js.map +1 -1
  137. package/tabsView/tabsView.amd.js +1 -1
  138. package/tabsView/tabsView.amd.js.map +1 -1
  139. package/tabsView/tabsView.js +131 -133
  140. package/tabsView/tabsView.js.map +1 -1
  141. package/utils/clipboard.amd.js +1 -1
  142. package/utils/clipboard.js +1 -1
  143. package/utils/date.amd.js +1 -1
  144. package/utils/date.js +1 -1
  145. package/utils/device.amd.js +1 -1
  146. package/utils/device.js +1 -1
  147. package/utils/lodash.amd.js +1 -1
  148. package/utils/lodash.js +1 -1
  149. package/utils/price.amd.js +1 -1
  150. package/utils/price.js +1 -1
  151. package/utils/scroll.amd.js +1 -1
  152. package/utils/scroll.amd.js.map +1 -1
  153. package/utils/scroll.js +14 -14
  154. package/utils/scroll.js.map +1 -1
  155. package/utils/searchers.amd.js +1 -1
  156. package/utils/searchers.js +3 -3
  157. package/utils/string.amd.js +1 -1
  158. package/utils/string.amd.js.map +1 -1
  159. package/utils/string.js +3 -7
  160. package/utils/string.js.map +1 -1
  161. package/.chunks/core-CaWxDXrZ.es.js +0 -197
  162. package/.chunks/core-CaWxDXrZ.es.js.map +0 -1
  163. package/.chunks/core-DmO1i1Ua.amd.js +0 -2
  164. package/.chunks/core-DmO1i1Ua.amd.js.map +0 -1
  165. package/.chunks/dialog_selectorRegions-DoEjgXtb.es.js +0 -190
  166. package/.chunks/dialog_selectorRegions-DoEjgXtb.es.js.map +0 -1
  167. package/.chunks/dialog_selectorRegions-DzufTzj9.amd.js +0 -2
  168. package/.chunks/dialog_selectorRegions-DzufTzj9.amd.js.map +0 -1
  169. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js +0 -2
  170. package/.chunks/forms-COXAfg9G.es.js +0 -2047
  171. package/.chunks/forms-DXX5M4DO.amd.js +0 -3
  172. package/.chunks/index-BEI7XZmU.amd.js +0 -2
  173. package/.chunks/index-BEI7XZmU.amd.js.map +0 -1
  174. package/.chunks/index-igPkes8X.es.js +0 -48
  175. package/.chunks/index-igPkes8X.es.js.map +0 -1
  176. package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js +0 -199
  177. package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js.map +0 -1
  178. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js +0 -2
  179. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js.map +0 -1
  180. package/.chunks/menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js +0 -112
  181. package/.chunks/menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js.map +0 -1
  182. package/.chunks/menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js +0 -2
  183. package/.chunks/menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js.map +0 -1
  184. package/.chunks/notice-CSGn_jTM.amd.js +0 -4
  185. package/.chunks/notice-P7CXfEuX.es.js +0 -194
  186. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js +0 -36
  187. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js.map +0 -1
  188. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js +0 -2
  189. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js.map +0 -1
  190. package/.chunks/page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js +0 -143
  191. package/.chunks/page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js +0 -2
  192. package/.chunks/popup-CF4k7j3U.amd.js +0 -2
  193. package/.chunks/popup-CF4k7j3U.amd.js.map +0 -1
  194. package/.chunks/popup-G7FYKscC.es.js +0 -485
  195. package/.chunks/popup-G7FYKscC.es.js.map +0 -1
  196. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js +0 -2
  197. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js.map +0 -1
  198. package/.chunks/utils-D505nRsu.amd.js +0 -2
  199. package/.chunks/utils-DmxcQpWA.amd.js +0 -2
  200. package/assets/dialog_selectorRegions.css +0 -1
  201. package/assets/formsExt.css +0 -1
  202. package/assets/listItem.css +0 -1
  203. package/assets/menu.css +0 -1
  204. package/src/components/popup/popup/opener.vue.d.ts +0 -17
  205. /package/src/components/project/{selectorCompetitors/selectorCompetitors.vue.d.ts → competitorSelector/competitorSelector.vue.d.ts} +0 -0
  206. /package/src/components/project/{selectorCompetitors → competitorSelector}/composables.d.ts +0 -0
  207. /package/src/components/project/{selectorCompetitors → competitorSelector}/types.d.ts +0 -0
  208. /package/src/components/project/{selectorRegion → regionSelector}/composables/compare.d.ts +0 -0
  209. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectRegion.d.ts +0 -0
  210. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectSearcher.d.ts +0 -0
  211. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectorRegion.d.ts +0 -0
  212. /package/src/components/project/{selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts → regionSelector/dialog_regionSelectorRegions/dialog_regionSelectorRegions.vue.d.ts} +0 -0
  213. /package/src/components/project/{selectorRegion/dialog_selectorRegions → regionSelector/dialog_regionSelectorRegions}/types.d.ts +0 -0
  214. /package/src/components/project/{selectorRegion/selectorRegion.vue.d.ts → regionSelector/regionSelector.vue.d.ts} +0 -0
  215. /package/src/components/project/{selectorRegion → regionSelector}/types.d.ts +0 -0
  216. /package/src/components/project/{selectorRegion → regionSelector}/utils/consts.d.ts +0 -0
@@ -1,485 +0,0 @@
1
- import { u as E, C as f } from "./forms-COXAfg9G.es.js";
2
- import i from "../utils/dom.js";
3
- import { TopPopupWorker as l } from "../popup/worker.js";
4
- class w {
5
- static componentName = "Top";
6
- componentName;
7
- // имя класса компонента
8
- className;
9
- // имя css класса компонента
10
- uid;
11
- // уникальный id компонента
12
- el;
13
- // элемент, связанный с компонентом
14
- options = {};
15
- // параметры компонента
16
- unmountEls = [];
17
- unmountEvents = [];
18
- // переопредлять нельзя
19
- // если компонент инициирован, необходимо сразу его вернуть и выполнить reInit() вместо mount()
20
- // используется init вместо constructor, так как super constructor выполняется до Object.defineProperty() параметров класса
21
- init(t, p, e) {
22
- if (!p)
23
- throw t + ": el is undefined";
24
- const o = w.getComponent(p, t);
25
- if (o)
26
- return o.reInit(e), o;
27
- this.componentName = t, this.className = "top" + t[0].toUpperCase() + t.substring(1), this.uid = this.componentName + (Math.random() + "").replace(".", ""), this._setComponent(p), this.el = p, this.el.classList.add(this.className), this.options = Object.assign(this.options, e), this.mount();
28
- }
29
- // получить инициированный компонент
30
- static getComponent(t, p) {
31
- return i.storage(t, "#" + p);
32
- }
33
- // устанвоить компонент
34
- _setComponent(t) {
35
- i.storage(t, "#" + this.componentName, this);
36
- }
37
- // функция подключения компонента
38
- mount() {
39
- throw "Please, add method mount() to component: " + this.componentName;
40
- }
41
- // функция отключения компонента
42
- unmount() {
43
- i.storage(this.el, "#" + this.componentName, null), this.unmountEls.forEach((t) => {
44
- t.remove();
45
- }), this.unmountEls = [], this.unmountEvents.forEach((t) => {
46
- t.el.removeEventListener(t.type, t.listener, t.options);
47
- }), this.unmountEvents = [];
48
- }
49
- // указание новые элементы, которые должны будут удалиться после unmount
50
- registerElForUnmount(t) {
51
- this.unmountEls.push(t);
52
- }
53
- // указание новые события, которые должны будут удалиться после unmount
54
- addEventListenerWithUnmount(t, p, e, o) {
55
- t.addEventListener(p, e, o), this.registerEventForUnmount(t, p, e, o);
56
- }
57
- // указание новые события, которые должны будут удалиться после unmount
58
- registerEventForUnmount(t, p, e, o) {
59
- const r = {
60
- el: t,
61
- type: p,
62
- listener: e,
63
- options: o
64
- };
65
- this.unmountEvents.push(r);
66
- }
67
- // функция перенастройки уже подключенного компонента
68
- reInit(t) {
69
- throw "Please, add method reInit() to component: " + this.componentName;
70
- }
71
- // удалить элементы из DOM, но не из памяти
72
- static detach(t) {
73
- var p;
74
- if (t instanceof NodeList)
75
- t.forEach((e) => {
76
- var o;
77
- return (o = e.parentElement) == null ? void 0 : o.removeChild(e);
78
- });
79
- else {
80
- const e = t;
81
- (p = e.parentElement) == null || p.removeChild(e);
82
- }
83
- }
84
- }
85
- class k {
86
- static isInited = !1;
87
- /**
88
- * Добавить глобальные обработчики
89
- *
90
- * Добавляются на страницу один раз и навсегда
91
- */
92
- static init() {
93
- this.isInited || (this.isInited = !0, document.addEventListener("click", this.onclickCapture, { capture: !0 }), document.addEventListener("click", this.onclick), document.addEventListener("keydown", this.onkeydown));
94
- }
95
- /**
96
- * Глобальный обработчик захватов кликов
97
- *
98
- * Обрабатывает захватов клики внутри Popup
99
- */
100
- static onclickCapture(t) {
101
- var e;
102
- if (!(!(t.target instanceof HTMLElement) || !t.target.closest(".top-popup-wrapper"))) {
103
- if (t.target.matches("[data-top-popup]")) {
104
- const o = t.target.closest("ul"), r = t.target.closest("a, .a");
105
- o && ((e = o.querySelector("a.top-active, .a.top-active")) == null || e.classList.remove("top-active")), r && r.classList.add("top-active"), t.stopPropagation();
106
- return;
107
- }
108
- if (t.target.matches(".top-popup-wrapper")) {
109
- const o = t.target;
110
- l.close(o, !0), t.stopPropagation();
111
- return;
112
- }
113
- }
114
- }
115
- /**
116
- * Глобальный обработчик кликов
117
- *
118
- * Обрабатывает клики внутри Popup
119
- */
120
- static onclick(t) {
121
- if (!(t.target instanceof HTMLElement)) return;
122
- const p = t.target.closest(".closer, a, .a, .top-button");
123
- if (p) {
124
- const e = t.target.closest(".top-popup-wrapper");
125
- if (!e || p.matches(".top-popup-noCloser"))
126
- return;
127
- p.getAttribute("href") === "." && t.preventDefault(), l.close(e, !0);
128
- }
129
- }
130
- /**
131
- * Глобальный обработчик нажатия кнопки на клавиатуре
132
- */
133
- static onkeydown(t) {
134
- var o, r, s;
135
- if (!(t.target instanceof HTMLElement)) return;
136
- let p = t.target.closest(".top-popup-wrapper");
137
- if (p || (p = ((o = l.getPopupFromOpener(t.target)) == null ? void 0 : o.elPopup) ?? null), !p)
138
- return;
139
- const e = p.querySelector("ul.top-popup_content");
140
- switch (t.key) {
141
- case "Escape":
142
- l.close(p, !0);
143
- break;
144
- case "Enter":
145
- if (!e) {
146
- if (i.querySelectorVisible(p, ".preloader"))
147
- break;
148
- const d = i.querySelectorVisible(p, ".top-popup_footer .go, .top-popup_footer [data-action]");
149
- if (d instanceof HTMLElement) {
150
- d.click();
151
- break;
152
- }
153
- let v = i.querySelectorVisibleLast(p, ".top-popup_footer .top-button:focus");
154
- v || (v = i.querySelectorVisibleLast(p, ".top-popup_footer .top-button")), v instanceof HTMLElement && v.click();
155
- break;
156
- }
157
- const n = i.querySelectorVisible(p, "li > a.top-active");
158
- n && n.getAttribute("href") && (t.preventDefault(), location.href = n.getAttribute("href"));
159
- const h = p.querySelector("li > .top-active");
160
- h instanceof HTMLElement && h.click();
161
- break;
162
- // управление стрелками
163
- case "ArrowUp":
164
- case "ArrowRight":
165
- case "ArrowDown":
166
- case "ArrowLeft":
167
- if (!e)
168
- break;
169
- if (t.key === "ArrowRight" || t.key === "ArrowLeft") {
170
- if (i.querySelectorVisible(
171
- p,
172
- "ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active > .top-popup_listMore"
173
- ))
174
- t.preventDefault();
175
- else if (t.target.tagName === "INPUT")
176
- break;
177
- } else
178
- t.preventDefault();
179
- const c = (r = p.querySelector("ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active")) == null ? void 0 : r.parentElement;
180
- if (t.key === "ArrowRight" && c) {
181
- const d = c.querySelector(".top-active > .top-popup_listMore");
182
- if (d instanceof HTMLElement)
183
- return d.click();
184
- }
185
- const g = i.querySelectorAllVisible(p, "ul.top-popup_content > li:not(.top-popup_liNoSelectable)"), m = g.length;
186
- if (!m)
187
- return;
188
- let a = -1;
189
- if (c && (a = g.indexOf(c)), t.key === "ArrowUp" || t.key === "ArrowLeft" ? a-- : a++, t.key === "ArrowLeft" && a === -1)
190
- return t.target.matches("input") ? void 0 : l.close(p, !0);
191
- if (t.key === "ArrowRight" && a === m)
192
- return;
193
- a < 0 && (a = m - 1), a > m - 1 && (a = 0), p.querySelectorAll("ul.top-popup_content > li > .top-active").forEach((d) => d.classList.remove("top-active")), (s = g[a].querySelector(":scope > a, :scope > .a")) == null || s.classList.add("top-active"), l.scrollToActive(p);
194
- break;
195
- }
196
- }
197
- }
198
- const S = ":root{--top-popup-z-index: 200000;--top-popup-transition-delay: .1s;--top-popup-offset: var(--top-padding-2);--top-popup-background-color: var(--color-layout-front-1);--top-popup-background-color-hover: var(--color-layout-front-3);--top-popup-background-color-active: var(--color-layout-front-4);--top-popup-border-color: var(--color-line-2-opacity);--top-popup-title-background-color: var(--color-layer-1);--top-popup-content-padding: calc(var(--top-popup-list-padding) + var(--top-popup-listItem-padding));--top-popup-list-padding: var(--top-padding-2);--top-popup-listItem-radius: var(--top-radius-2);--top-popup-listItem-padding: var(--top-padding-2)}.top-popup-front{position:relative}.top-popup-wrapper{--top-popup-height: 0px;--top-popup-right-bounding: 0px;--top-popup-bottom-bounding: 0px;--top-popup-top: 0px;--top-popup-right: calc(100vw - var(--top-popup-right-bounding));--top-popup-bottom: calc(var(--100vh) - var(--top-popup-bottom-bounding));--top-popup-left: 0px;--top-popup-margin: -10px;pointer-events:none;text-align:initial;white-space:normal;word-break:normal;position:absolute;z-index:200000;outline:none}.top-popup-wrapper:not(.top-popup-wrapper-shown){overflow:hidden}.top-popupPanel{cursor:default;box-shadow:var(--top-shadow-b);border-radius:14px;background:var(--top-popup-background-color);position:absolute;overflow:hidden;display:flex;flex-direction:column}.top-popup-wrapper>*{opacity:0;transition:opacity var(--top-popup-transition-delay) linear,transform var(--top-popup-transition-delay) linear;pointer-events:auto}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed)>*{opacity:1;transform:translate(0)!important}.top-popup_header,.top-popup_content,.top-popup_footer{font-size:14px}.top-popup_header,.top-popup_footer{display:flex;align-items:center;justify-content:space-between}.top-popup_header{color:var(--color-text-1);border-bottom:1px solid var(--top-popup-border-color);padding:var(--top-padding-3);font-weight:600}.top-popup_header>*{font-weight:400}.top-popup_header>.a{cursor:pointer}.top-popup_header>.a:hover{color:var(--color-text-primary)}.top-popup_headerButton{width:60px}.top-popup_widget{padding:var(--top-padding-2)}.top-popup_content{margin:0;flex-grow:1;overflow-y:auto;display:flex;flex-direction:column;gap:var(--top-gap-4);-webkit-overflow-scrolling:touch}div.top-popup_content{color:var(--color-text-1);padding:var(--top-popup-content-padding)}div.top-popup_content>*{flex-shrink:0}div.top-popup_content>.top-button{margin:0}div.top-popup_content .top-unwrap{--top-unwrap-x: var(--top-popup-content-padding)}ul.top-popup_content{color:var(--color-text-1);padding:var(--top-popup-list-padding);gap:2px}ul.top-popup_content .top-unwrap{--top-unwrap-x: var(--top-popup-list-padding)}.top-popup_listItem{border-radius:var(--top-popup-listItem-radius);padding:var(--top-popup-listItem-padding);line-height:1!important}ul.top-popup_content li{margin:0;list-style:none;display:flex;align-items:center;position:relative}ul.top-popup_content li>*{flex-grow:1}ul.top-popup_content li>a:not(.top-button),ul.top-popup_content li>.a{cursor:pointer;box-sizing:border-box;border-radius:var(--top-popup-listItem-radius);background:var(--top-popup-background-color);padding:var(--top-popup-listItem-padding);color:var(--color-text-1)!important;font-size:14px;font-weight:400!important;text-decoration:none!important;font-style:normal;line-height:1!important;display:flex;flex:1 1 100%;align-items:center;transition:background-color .1s ease-in-out}.top-popup-wrapper-no_animate ul.top-popup_content li>a:not(.top-button),.top-popup-wrapper-no_animate ul.top-popup_content li>.a{transition:none}ul.top-popup_content li>a:not(.top-button):hover,ul.top-popup_content li>.a:hover{background:var(--top-popup-background-color-hover)}ul.top-popup_content li>a:not(.top-button).top-active,ul.top-popup_content li>.a.top-active{--top-icon-color: var(--color-text-primary) !important;background:var(--top-popup-background-color-active)}.top-popup_liastItem-withActions{width:240px;max-width:100%}.top-popup_listItemActionsLabel{flex-grow:1}.top-popup_listItemActions{margin-left:auto;flex-grow:0;display:flex}.top-popup_listItemActions>[data-top-icon]{--top-icon-size: 20px;--top-icon-color: var(--color-text-4)}.top-popup_listItemActions>[data-top-icon]:before{line-height:0}.top-popup_listItemActions>[data-top-icon]:hover,.top-popup_listItemActions>[data-top-icon].top-active{--top-icon-color: var(--color-text-3)}.top-popup_content+.top-popup_content{padding-top:0}.top-popup_listItem-title{background:var(--color-layer-1);color:var(--color-text-1);font-size:12px}.top-popup_listItem-formControls{padding-top:0;padding-bottom:0;display:flex;flex-direction:column}.top-popup_listItem-delimiter{border-radius:3px;background:var(--top-popup-border-color);height:1px;padding:0;margin:4px}.top-popup_listMore{font-size:20px;margin:calc(0px - var(--top-popup-listItem-padding)) calc(0px - var(--top-popup-listItem-padding) / 2) calc(0px - var(--top-popup-listItem-padding)) 0}.top-popup_listMore.top-button{margin:0}ul.top-popup_content li>.a.top-popup_listMore{text-align:center;flex-basis:10px}ul.top-popup_content li>.a.top-popup_listMore:before{color:var(--color-text-2)}ul.top-popup_content li>*>.top-popup_listMore{margin-left:auto;color:var(--color-layer-4);font-size:14px}ul.top-popup_content li>*>i.top-popup_listMore:hover,ul.top-popup_content li>*>i.top-popup_listMore.top-active{color:var(--color-text-primary)}ul.top-popup_content li>*>i.top-popup_listMore:before{transform:rotate(90deg);display:block}ul.top-popup_content li a.close{background:none!important}.top-popup_content>[data-top-icon]:before{--top-icon-size: 20px}ul.top-popup_content li>[data-top-icon]{--top-icon-color: var(--color-text-2);--top-icon-size: 20px;--top-icon-width: 20px}ul.top-popup_content li>[data-top-icon]:not(.top-button):before{height:1rem;margin-right:8px;transition:color .1s}ul.top-popup_content li:hover>[data-top-icon]:not(.top-button){--top-icon-color: var(--color-text-2)}.top-popup_footer{padding:var(--top-padding-3);border-top:1px solid var(--top-popup-border-color);display:flex;gap:var(--top-gap-2);justify-content:flex-end}.top-popup_footerSupportLink{margin-right:auto}.top-popup>[data-widget]{padding:0 var(--top-popup-list-padding)}.top-popup>[data-widget]+hr{margin:0 var(--top-popup-list-padding)}.top-popup .placeholder{border:1px solid #E0D9D9!important;border-right:none!important;border-left:none!important;background:#f9f9f9!important;margin:-1px 0;z-index:1;position:relative}.top-popup-wrapper.simple_list>.top-popup{min-width:0;white-space:nowrap}.top-popup_content .top-column{display:flex;flex-direction:column;gap:4px}.top-popup li .check_all,.top-popup li .clear_all{cursor:pointer;color:var(--color-text-primary);padding:8px;display:inline-block}.top-popup li .check_all:hover,.top-popup li .clear_all:hover{text-decoration:underline}.top-popup li .clear_all{display:none}.top-popup_content table{margin:-9px 0}.top-popup_content table td,.top-popup_content table th{padding:9px var(--top-popup-listItem-padding) 9px 0;vertical-align:top}.top-popup_content table th{width:40%;font-weight:600;white-space:nowrap}ul.top-popup_content .a>[type=checkbox],ul.top-popup_content .a>[type=radio]{margin:-8px 0 -8px auto}ul.top-popup_content a>[class*=icon],ul.top-popup_content i.a>[class*=icon]{transition:.1s}.top-popup .buttons{border-radius:0 0 4px 4px;border-top:1px solid #BDC3C7;background:#ecf0f1;padding:10px 15px;margin:10px -15px -10px;white-space:nowrap}.top-popup_footer [class*=btn]:not(.btn-transparent){min-width:100px;padding:5px 14px;margin-left:10px}.top-popup_footer [class*=btn]:first-child{margin-left:0}.top-popup_footer .btn.full_width{margin:0;flex-grow:1}", M = ":root{--top-popup-list-padding: 0px;--top-popup-listItem-radius: 0px;--top-popup-listItem-padding: var(--top-padding-4)}.top-popup-wrapper{--top-popup-footer-offset: 25px;width:auto!important;height:auto!important;position:fixed;top:0!important;right:0!important;left:0!important;overflow:hidden;transition:background .3s}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed){background:#00000080;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed)>.top-popup{opacity:1!important}.top-popup{border-radius:8px 8px 0 0;width:auto!important;max-height:calc(100% - var(--header-height, 0px) - var(--toolbar-height, 0px) - 12px);margin:0!important;top:auto!important;right:0!important;bottom:var(--toolbar-height, 0px)!important;left:0!important;display:flex;flex-direction:column;transform:translateY(80%);transition:opacity .3s,transform .3s}.top-popup-wrapper.p-from-top{--top-popup-footer-offset: 0px;top:var(--header-height, 0px)!important}.with_dialog .top-popup-wrapper.p-from-top{top:50px!important}.top-popup-wrapper.p-from-top>.top-popup{border-radius:0 0 8px 8px;max-height:calc(100% - 24px);top:0!important;bottom:auto!important;transform:translateY(calc(-100% - 24px))}.top-popup_widget:not(.p-from-top){order:10}ul.top-popup_content{gap:0}ul.top-popup_content li:not(:last-child){border-bottom:1px solid var(--top-popup-border-color)}.top-popup-wrapper.top-style_alt>.top-popup>ul>li{border-bottom:none}.top-popup_footer{flex-direction:column-reverse}.top-popup_footer>.top-button{--top-forms-base-height: var(--top-forms-base-height_l);width:100%}ul.top-popup_content .top-popup_listItem-title{--top-popup-padding-v: 12px}ul.top-popup_content .top-popup_listItem-delimiter{background:var(--color-line-1-opacity);height:4px;margin:0}ul.top-popup_content li:first-child>.top-popup_listItem-delimiter{border-top:1px solid var(--top-popup-border-color)}", T = ".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))}.top-popup-wrapper.p0>*{transform:translateY(-8px)}.top-popup-wrapper.p1>*{transform:translateY(8px)}.top-popup-wrapper.p2>*{transform:translate(8px)}.top-popup-wrapper.p3>*{transform:translateY(8px)}.top-popup-wrapper.p4>*{transform:translate(-8px)}.top-popup-wrapper.p0>.top-popup{top:-16px;left:-8px}.top-popup-wrapper.p1>.top-popup{bottom:calc(100% + 8px)}.top-popup-wrapper.p2>.top-popup{left:calc(100% + 8px)}.top-popup-wrapper.p3>.top-popup{top:calc(100% + 8px)}.top-popup-wrapper.p4>.top-popup{right:calc(100% + 8px)}.top-popup-wrapper.p2>.top-popup,.top-popup-wrapper.p4>.top-popup{margin-top:var(--top-popup-margin)}.top-popup-wrapper.p2.invert-y>.top-popup,.top-popup-wrapper.p4.invert-y>.top-popup{margin-bottom:var(--top-popup-margin)}.top-popup-wrapper.p1.with_notch>.top-popup{margin-bottom:5px}.top-popup-wrapper.p2.with_notch>.top-popup{margin-left:5px}.top-popup-wrapper.p3.with_notch>.top-popup{margin-top:5px}.top-popup-wrapper.p4.with_notch>.top-popup{margin-right:5px}.top-popup-wrapper.invert-x>.top-popup{right:0}.top-popup-wrapper.invert-y>.top-popup{bottom:0}.top-popup-wrapper.p1>.top-popup{max-height:calc(var(--top-popup-top) - var(--header-height, 0px) - 16px)}.top-popup-wrapper.p3>.top-popup{max-height:calc(var(--top-popup-bottom) - 16px)}.top-popup-wrapper.p2>.top-popup{max-width:calc(var(--top-popup-right) - 16px)}.top-popup-wrapper.p4>.top-popup{max-width:calc(var(--top-popup-left) - 16px)}.top-popup-wrapper.invert-x>.top-popup{max-width:calc(100vw - var(--top-popup-right) - 16px)}.top-popup-wrapper.invert-y>.top-popup{max-height:calc(100vh - var(--top-popup-bottom) - 16px)}.top-popup-wrapper>.notch{border:7.4px solid transparent;position:absolute;display:block}.top-popup-wrapper.p1>.notch{border-bottom:0;border-top:7.4px solid var(--color-layout-front-1);margin:0 0 7.4px -7.4px;bottom:100%;left:50%}.top-popup-wrapper.p2>.notch{border-left:0;border-right:7.4px solid var(--color-layout-front-1);margin:0 0 -7.4px 7.4px;bottom:50%;left:100%}.top-popup-wrapper.p3>.notch{border-top:0;border-bottom:7.4px solid var(--color-layout-front-1);margin:7.4px 0 0 -7.4px;top:100%;left:50%}.top-popup-wrapper.p4>.notch{border-right:0;border-left:7.4px solid var(--color-layout-front-1);margin:0 7.4px -7.4px 0;bottom:50%;right:100%}.top-popup-wrapper.p1>.notch-border{border-top-color:#0000000d;margin-bottom:6px}.top-popup-wrapper.p2>.notch-border{border-right-color:#0000000d;margin-left:6px}.top-popup-wrapper.p3>.notch-border{border-bottom-color:#0000000d;margin-top:6px}.top-popup-wrapper.p4>.notch-border{border-left-color:#0000000d;margin-right:6px}.top-popup-wrapper.p1.with_notch>.top-popup,.top-popup-wrapper.p3.with_notch>.top-popup{margin-left:-16px!important}.top-popup-wrapper.p1.with_notch>.notch,.top-popup-wrapper.p3.with_notch>.notch{margin-left:-8px!important}.top-popup-wrapper.p1.with_notch.invert-x,.top-popup-wrapper.p3.with_notch.invert-x{margin-left:3px!important}.top-popup-wrapper.p1.with_notch.invert-x>.notch,.top-popup-wrapper.p3.with_notch.invert-x>.notch{margin-left:-9px!important}ul.top-popup_content li>*>i.top-popup_listMore{visibility:hidden;transition:none}ul.top-popup_content li:hover>*>i.top-popup_listMore,ul.top-popup_content li>*.top-active>i.top-popup_listMore,ul.top-popup_content li>*>i.top-popup_listMore.top-active{visibility:visible}.top-popup_listItemActions{display:none}.top-popup_listItem.top-active>.top-popup_listItemActions,.top-popup_listItem:hover>.top-popup_listItemActions{display:flex}";
199
- f.insertStyleToPage(S);
200
- f.insertStyleToPage(M, "m");
201
- f.insertStyleToPage(T, "pc");
202
- class P extends w {
203
- static componentName = "TopPopup";
204
- // элемент, вызвавший открытие Popup
205
- elActiveByDefault;
206
- // элемент уже имеет класс top-active перед открытием окна
207
- elPopup;
208
- // Popup .top-popup-wrapper
209
- elPopupInner;
210
- // контентная часть Popup .top-popup
211
- elPopupHeader;
212
- elPopupWidget;
213
- elPopupBody;
214
- elPopupFooter;
215
- elFront;
216
- /**
217
- * Для openerIsInput фокусировка срабатывает при входе в поле ввода
218
- *
219
- * Фкусировка на сам Popup не производится
220
- *
221
- * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/combobox_role
222
- */
223
- openerIsInput = !1;
224
- popupParent;
225
- $;
226
- // только если есть jQuery
227
- elStartPosition;
228
- // используется для useOriginal
229
- shift = {
230
- top: 0,
231
- left: 0
232
- };
233
- isClosed = !1;
234
- // флаг того, что меню закрыто
235
- isFirstClick = !0;
236
- type;
237
- // selector или html
238
- options = {
239
- popup: "",
240
- // selector, text
241
- p: 0,
242
- // положение меню (0 - над элементом, 1 - сверху, 2 - справа, 3 - снизу, 4 слева)
243
- notch: !1,
244
- // отображать ли клювик
245
- class: "",
246
- // класс, добавляемый меню
247
- posBy: "left",
248
- // способ привязки позиционирования меню (left/right - левый/правый край родителя, fixed - по документу)
249
- frontSelector: "",
250
- invertX: !1,
251
- // базовая ордината - правая граница элемента, а не левая
252
- openByHover: !1,
253
- // открывать при наведении
254
- useOriginal: !1,
255
- // использовать оригинальный шаблон, без клонирвоания (для сохранения состояния меню)
256
- transitionDuration: 100,
257
- // значение прописано в css
258
- isFullScreen: !1
259
- };
260
- events = {};
261
- /**
262
- * Создать Popup
263
- * @param el - элемент, открывающий меню
264
- * @param options
265
- */
266
- constructor(t, p) {
267
- super(), this.init(P.componentName, t, p);
268
- }
269
- async mount() {
270
- var r, s;
271
- if (!(this.el instanceof HTMLElement)) return;
272
- const t = this.vueGetComponent();
273
- this.el.closest(".top-popup-wrapper") && (this.popupParent = l.getPopup(this.el.closest(".top-popup-wrapper"))), await this.mountJQuery(), i.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"), this.openerIsInput = this.el.classList.contains("top-input");
274
- const p = this.el.querySelector("input");
275
- if (p && !p.__popupOnBlur && (p.__popupOnBlur = !0, p.addEventListener("blur", (n) => {
276
- this.close();
277
- })), t)
278
- this.type = "vue", this.options.popup = "", this.elPopup = i.genEl("div", {}, this.options.popup);
279
- else if ((r = this.options.popup) != null && r.match(/^[#.]/))
280
- this.type = "selector", this.elPopup = document.querySelector(`${this.options.popup}.template`) || void 0;
281
- else {
282
- if (this.type = "html", this.options.useOriginal)
283
- throw "Option useOriginal not allowed for text templates";
284
- this.elPopup = i.genEl("div", {}, this.options.popup ?? "");
285
- }
286
- if (!this.elPopup || t != null && t.opened) {
287
- if (this.options.useOriginal || t != null && t.opened) {
288
- if (t != null && t.opened ? this.elPopup = t.popup.elPopup : this.elPopup = document.querySelector(`${this.options.popup}.top-popup-wrapper-shown`) || void 0, this.elPopup) {
289
- this.el.dataset.topPopupOpened = "", this.elActiveByDefault || this.el.classList.remove("top-active"), l.close(this.elPopup), setTimeout(() => this.mount(), this.options.transitionDuration);
290
- return;
291
- }
292
- throw "Option useOriginal state allowed only elements .template";
293
- }
294
- this.elPopup = document.querySelector(`${this.options.popup}:not(.top-popup-wrapper)`) || void 0;
295
- }
296
- if (!this.elPopup)
297
- return;
298
- for (this.options.useOriginal ? (this.elStartPosition = this.elPopup.closest(".top-popup-el-start-position"), this.elStartPosition || (this.elStartPosition = i.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 = i.wrap(this.elPopup, "div")), this.type === "html" && (this.elPopup.querySelector(":scope > .top-popup_content") || (this.elPopup.classList.add("top-popup_content"), this.elPopup = i.wrap(this.elPopup, "div"))), (this.type === "selector" && !this.elPopup.matches(".template") || this.type === "html" || this.type === "vue") && (i.querySelectorAllArray(this.elPopup, "[data-top-popup]").forEach((n) => {
299
- n instanceof HTMLElement && (n.dataset.topPopupPosBy = "fixed");
300
- }), i.querySelectorAllArray(this.elPopup, ".top-popup-wrapper").forEach((n) => n.remove()))), l.decoratorBeforeOpen(this), t && (this.options.class = t.classRef.value, t.transitionDurationRef.value !== void 0 && (this.options.transitionDuration = t.transitionDurationRef.value, this.elPopup instanceof HTMLElement && this.elPopup.style.setProperty(
301
- "--top-popup-transition-delay",
302
- this.options.transitionDuration + "ms"
303
- ))), this.elPopupInner = document.createElement("div"), this.elPopupInner.classList.add("top-popupPanel", "top-popup"); this.elPopup.firstChild; )
304
- this.elPopupInner.appendChild(this.elPopup.firstChild);
305
- if (this.elPopup.append(this.elPopupInner), this.elPopup.classList.add("top-popup-wrapper"), this.options.class) {
306
- const n = this.options.class.split(" ");
307
- this.elPopup.classList.add(...n);
308
- }
309
- this.options.notch && (this.elPopup.classList.add("with_notch"), this.elPopup.insertAdjacentHTML("beforeend", '<i class="notch notch-border"></i><i class="notch"></i>')), await this.vueOpen(), this.elPopupHeader = this.elPopupInner.querySelector(".top-popup_header"), this.elPopupWidget = this.elPopupInner.querySelector(".top-popup_widget"), this.elPopupBody = this.elPopupInner.querySelector(".top-popup_content"), this.elPopupFooter = this.elPopupInner.querySelector(".top-popup_footer");
310
- const e = !!this.elPopup.querySelector('[data-widget="search"]');
311
- if (this.options.isFullScreen && !e) {
312
- const n = E();
313
- !this.elPopupHeader && n.Common.Close && (this.elPopupHeader = i.genEl("i", { class: "top-popup_header" }), this.elPopupInner.prepend(this.elPopupHeader), this.elPopupHeader.prepend(i.genEl("i", { class: "a closer" }, n.Common.Close)), this.elPopupHeader.append(i.genEl("i", { class: "top-popup_headerButton" })));
314
- }
315
- i.storage(this.elPopup, P.componentName, this), this.options.frontSelector && (this.elFront = document.querySelector(this.options.frontSelector)), this.elFront || (this.elFront = this.el.closest(".top-popup-front")), this.elFront || (this.elFront = document.body), this.elPopup instanceof HTMLElement && (this.elPopup.style.width = this.el.offsetWidth + "px", this.elPopup.style.height = this.el.offsetHeight + "px", this.elPopup.style.top = this.el.offsetTop + "px", this.elPopup.style.right = parseInt(this.el.style.right || "0") + "px", this.elPopup.style.bottom = parseInt(this.el.style.bottom || "0") + "px"), (s = this.el.parentElement) == null || s.insertBefore(this.elPopup, this.el), this.elPopup.classList.remove("template"), this.options.invertX && this.elPopup.classList.add("invert-x");
316
- let o = !!this.el.closest(".modal-header");
317
- o || (o = !!this.el.closest("#top_panel")), o || (o = !!this.el.closest("#secondmenu")), o && this.elPopup.classList.add("p-from-top"), setTimeout(() => {
318
- var n;
319
- return (n = this.elPopup) == null ? void 0 : n.classList.add("top-popup-wrapper-shown");
320
- }), this.elFront && !this.elFront.matches("body") && (this.elFront.append(this.elPopup), this.shift.top = i.offset(this.el).top - this.el.offsetTop - i.offset(this.elFront).top, this.shift.left = i.offset(this.el).left - this.el.offsetLeft - i.offset(this.elFront).left, this.shift.top -= parseInt(this.el.style["margin-top"] || 0), this.shift.left -= parseInt(this.el.style["margin-left"] || 0), this.elPopup instanceof HTMLElement && (this.elPopup.style.top = parseInt(this.elPopup.style.top || "0") + this.shift.top + "px", this.elPopup.style.left = parseInt(this.elPopup.style.left || "0") + this.shift.left + "px")), this.$ && f.$ && this.$.trigger("aftershow.top-menu-popup", [f.$(this.elPopup)]), this.recalcPosition(), this.elPopup.setAttribute("tabindex", "0"), this.focus(), l.decoratorAfterOpen(this), this.mountEvents();
321
- }
322
- async mountJQuery() {
323
- f.$ && (this.$ = f.$(this.el));
324
- }
325
- /**
326
- * Выполнить фокусировку на нужный элемент после открытия окна
327
- */
328
- focus() {
329
- let t;
330
- this.elPopup && (t = i.querySelectorVisible(this.elPopup, ".top-popup-autofocus"), t || (t = i.querySelectorVisible(this.elPopup, ":read-write, select:not(:disabled)")), t || (t = i.querySelectorVisible(this.elPopup, ".top-popup_footer .top-button")), t || (t = this.elPopup), this.openerIsInput || (t instanceof HTMLElement && t.focus(), setTimeout(() => {
331
- t instanceof HTMLElement && t.focus();
332
- }, this.options.transitionDuration)));
333
- }
334
- mountEvents() {
335
- this.addEventListenerWithUnmount(document, "mousedown", (t) => this.onMousedown(t)), this.openerIsInput ? this.onFocusCloseOthers() : this.elPopup && this.elPopupInner && (this.addEventListenerWithUnmount(this.elPopup, "focus", (t) => this.onFocus(t)), this.options.openByHover && (this.addEventListenerWithUnmount(this.elPopup, "mouseleave", (t) => this.onMouseleave(t)), this.addEventListenerWithUnmount(this.elPopupInner, "mouseleave", (t) => this.onMouseleave(t)))), this.options.isFullScreen && this.elPopupBody && this.addEventListenerWithUnmount(this.elPopupBody, "touchmove", (t) => this.onTouchmove(t));
336
- }
337
- /**
338
- * Обработка клика вне окна
339
- */
340
- onMousedown(t) {
341
- if (!this.elPopup || !(t.target instanceof Element) || !this.isFirstClick || (this.isFirstClick = !1, setTimeout(() => this.isFirstClick = !0), t instanceof MouseEvent && t.button !== 0))
342
- return;
343
- let p = i.querySelectorVisibleLast(document.body, ":scope > .top-popup-wrapper");
344
- if (p && p !== this.elPopup || t.target.closest(".top-popup-front") && (p = i.querySelectorVisibleLast(t.target.closest(".top-popup-front"), ":scope > .top-popup-wrapper"), p && p !== this.elPopup))
345
- return;
346
- if (t.target.closest(`[data-top-popup-id="${this.options.id}"]`)) {
347
- t.preventDefault();
348
- return;
349
- }
350
- let e = t.target.closest("input, select, textarea, button, [tabindex]");
351
- e === this.elPopup && (e = null);
352
- const o = !e;
353
- o && this.openerIsInput && t.preventDefault(), !this.elPopup.contains(t.target) && (this.elPopup.closest(".ui-dialog") && !t.target.closest(".ui-dialog") || l.decoratorIsIgnoreOuterClick(t) || l.close(this.elPopup, o));
354
- }
355
- /**
356
- * Произошла фокусировка на этот popup
357
- */
358
- onFocus(t) {
359
- t.target instanceof Element && t.target.matches("input") || this.onFocusCloseOthers();
360
- }
361
- /**
362
- * Закрыть другие Popup при фокусе на элемент формы в текущем
363
- */
364
- onFocusCloseOthers() {
365
- if (this.isClosed)
366
- return;
367
- l.getAllVisible().forEach((p) => {
368
- var e, o, r, s;
369
- (e = this.elPopup) != null && e.contains(p) || ((o = this.popupParent) == null ? void 0 : o.elPopup) === p || ((s = (r = this.popupParent) == null ? void 0 : r.popupParent) == null ? void 0 : s.elPopup) === p || l.close(p);
370
- });
371
- }
372
- /**
373
- * Закрыть Popup при отведении мыши
374
- */
375
- onMouseleave(t) {
376
- setTimeout(() => {
377
- this.elPopupInner && this.elPopupInner.matches(":hover") || !this.elPopup || l.close(this.elPopup);
378
- }, 100);
379
- }
380
- /**
381
- * Контроль положения Popup при fixed позиционировании
382
- */
383
- onResize() {
384
- this.elPopup && this.elPopup.parentElement !== document.body && document.body.append(this.elPopup), this.elPopup instanceof HTMLElement && (this.elPopup.style.top = i.offset(this.el).top + "px", this.elPopup.style.left = i.offset(this.el).left + "px");
385
- }
386
- unmount() {
387
- super.unmount(), this.el instanceof HTMLElement && (this.el.dataset.topPopupOpened = ""), this.elActiveByDefault || this.el.classList.remove("top-active");
388
- let t = this.el.getAttribute("style");
389
- t && (t = t.replace(/position:[^;]*;?/g, ""), this.el.setAttribute("style", t));
390
- }
391
- // контроль за положением Popup, чтобы оно не вылезало за пределы документа
392
- recalcPosition(t) {
393
- var _, I;
394
- if (!(this.elPopup instanceof HTMLElement)) return;
395
- let p = t ?? this.options.p, e;
396
- if (this.el instanceof HTMLElement)
397
- switch (this.elPopup.style.height = this.el.offsetHeight + "px", this.elPopup.classList.remove("p0", "p1", "p2", "p3", "p4"), this.elPopup.classList.add("p" + p), this.options.posBy) {
398
- case "left":
399
- e = this.el.offsetLeft + parseInt(this.el.style["margin-left"] || "0"), e += this.shift.left, this.elPopup.style.left = e + "px";
400
- break;
401
- case "right":
402
- if (!(this.el.offsetParent instanceof HTMLElement)) break;
403
- e = this.el.offsetLeft + parseInt(this.el.style["margin-left"] || "0"), this.elPopup.style.right = this.el.offsetParent.offsetWidth - this.el.offsetWidth - e + "px";
404
- break;
405
- case "fixed":
406
- this.addEventListenerWithUnmount(window, "resize", () => this.onResize()), this.onResize();
407
- break;
408
- default:
409
- (_ = this.options.posBy) == null || _.append(this.elPopup);
410
- }
411
- const o = this.elPopup.getBoundingClientRect();
412
- this.elPopup.style.setProperty("--top-popup-height", this.elPopup.offsetHeight + "px"), this.elPopup.style.setProperty("--top-popup-right-bounding", o.right + "px"), this.elPopup.style.setProperty("--top-popup-bottom-bounding", o.bottom + "px"), this.elPopup.style.setProperty("--top-popup-top", o.top + "px"), this.elPopup.style.setProperty("--top-popup-left", o.left + "px"), this.elPopupInner instanceof HTMLElement && (this.elPopupInner.style.maxWidth = "unset", this.elPopupInner.style.maxHeight = "unset");
413
- const r = {
414
- top: !1,
415
- right: !1,
416
- bottom: !1,
417
- left: !1
418
- }, s = {
419
- top: !1,
420
- right: !1,
421
- bottom: !1,
422
- left: !1
423
- };
424
- let n = o.left > window.innerWidth / 2, h = o.top > window.innerHeight / 2;
425
- p === 4 && (n = !n), p === 1 && (h = !h);
426
- const c = (I = this.elPopupInner) == null ? void 0 : I.getBoundingClientRect();
427
- let g, m;
428
- const a = i.cssNumber(this.elPopup, "--top-popup-offset"), d = this.el.offsetHeight, v = this.el.offsetWidth;
429
- c && (g = window.innerWidth - c.right, m = window.innerHeight - c.bottom, c.top < a && (r.top = !0, c.top < a * 2 - c.height + d && (s.top = !0)), g < a && (r.right = !0, g < a * 2 - c.width + v && (s.right = !0)), m < a && (r.bottom = !0, m < a * 2 - c.height + d && (s.bottom = !0)), c.left < a && (r.left = !0, c.left < a * 2 - c.width + d && (s.left = !0)));
430
- const L = (x, u) => {
431
- if (x === "x") {
432
- if (!r.right && !r.left || (u === 1 || u === 3) && !s.right && !s.left && n)
433
- return u;
434
- r.right && (u === 0 || u === 2) && n && (u = 4), r.left && (u === 0 || u === 4) && n && (u = 2);
435
- }
436
- if (x === "y") {
437
- if (!r.top && !r.bottom || (u === 2 || u === 4) && !s.top && !s.bottom && h)
438
- return u;
439
- r.top && (u === 0 || u === 1) && h && (u = 3), r.bottom && h && (u = 1);
440
- }
441
- return u;
442
- };
443
- let y = ["x", "y"];
444
- (p === 0 || p === 1 || p === 3) && (y = ["y", "x"]);
445
- let b = p ?? 0;
446
- y.forEach((x) => {
447
- b = L(x, b);
448
- }), p = b, r.bottom && (p === 2 || p === 4) && h && this.elPopup.classList.add("invert-y"), r.right && (p === 0 || p === 1 || p === 3) && this.elPopup.classList.add("invert-x"), this.elPopup.classList.remove("p0", "p1", "p2", "p3", "p4"), this.elPopup.classList.add("p" + p), this.elPopupInner instanceof HTMLElement && (this.elPopupInner.style.maxWidth = "", this.elPopupInner.style.maxHeight = ""), l.scrollToActive(this.elPopup);
449
- }
450
- onTouchmove(t) {
451
- var p, e, o;
452
- if (t.currentTarget instanceof HTMLElement && t.target instanceof HTMLElement) {
453
- if (t.currentTarget.scrollWidth > t.currentTarget.offsetWidth || (p = t.target.parentElement) != null && p.scrollWidth && ((e = t.target.parentElement) != null && e.offsetWidth) && t.target.parentElement.scrollWidth > ((o = t.target.parentElement) == null ? void 0 : o.offsetWidth))
454
- return;
455
- t.currentTarget.matches(".has_scroll") || t.preventDefault();
456
- }
457
- }
458
- close() {
459
- var t;
460
- this.isClosed || (this.isClosed = !0, this.$ && f.$ && this.elPopup && this.$.trigger("afterclose.top-menu-popup", [f.$(this.elPopup)]), !l.noClose && (this.unmount(), (t = this.elPopup) == null || t.classList.add("top-popup-wrapper-closed"), setTimeout(() => {
461
- var o, r, s, n, h;
462
- if (this.vueClose(), !this.elPopup) return;
463
- this.options.useOriginal ? (this.elPopup.removeAttribute("style"), this.elPopup.classList.remove("top-popup-wrapper-shown", "top-popup-wrapper-closed"), this.elPopup.classList.add("template"), (o = this.elStartPosition) == null || o.append(this.elPopup), (r = this.elPopup.querySelector("div.top-popup_content.top-column")) == null || r.classList.remove("top-column"), (s = this.elPopup.querySelector(".notch-border")) == null || s.remove(), (n = this.elPopup.querySelector(".notch")) == null || n.remove(), (h = this.elPopupInner) == null || h.replaceWith(...this.elPopupInner.childNodes), i.storageClear(this.elPopup)) : (i.storageClear(this.elPopup), this.elPopup.remove(), delete this.elPopup);
464
- const p = l.getAllVisible(), e = p.length && p[p.length - 1];
465
- e ? l.getPopup(e).focus() : document.documentElement.classList.remove("with_popup");
466
- }, this.options.transitionDuration)));
467
- }
468
- async vueOpen() {
469
- var t;
470
- await ((t = this.vueGetComponent()) == null ? void 0 : t.onOpen(this));
471
- }
472
- vueClose() {
473
- var t;
474
- (t = this.vueGetComponent()) == null || t.onClose(this);
475
- }
476
- // получить vueConnectors компонента Popup
477
- vueGetComponent() {
478
- if (this.el instanceof HTMLElement && this.options.id) return l.vueConnectors.get(this.options.id);
479
- }
480
- }
481
- k.init();
482
- export {
483
- P as TopLibPopup
484
- };
485
- //# sourceMappingURL=popup-G7FYKscC.es.js.map