@topvisor/ui 0.9.31-3 → 0.9.33-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/.chunks/{datepicker-CCrqadMd.amd.js → datepicker-B2sjxM3R.amd.js} +29 -16
  2. package/.chunks/datepicker-B2sjxM3R.amd.js.map +1 -0
  3. package/.chunks/{datepicker-vwT52g9l.es.js → datepicker-V4rjmE4P.es.js} +44 -31
  4. package/.chunks/datepicker-V4rjmE4P.es.js.map +1 -0
  5. package/.chunks/forms-Dixfp052.amd.js +4 -0
  6. package/.chunks/forms-Dixfp052.amd.js.map +1 -0
  7. package/.chunks/forms-o7UeMJFf.es.js +1507 -0
  8. package/.chunks/forms-o7UeMJFf.es.js.map +1 -0
  9. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-Fl7AM9wy.es.js → listItem.vue_vue_type_script_setup_true_lang-BliXIrA8.es.js} +2 -2
  10. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-Fl7AM9wy.es.js.map → listItem.vue_vue_type_script_setup_true_lang-BliXIrA8.es.js.map} +1 -1
  11. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-Cr9e1nzK.amd.js → listItem.vue_vue_type_script_setup_true_lang-C0tRJmSC.amd.js} +2 -2
  12. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-Cr9e1nzK.amd.js.map → listItem.vue_vue_type_script_setup_true_lang-C0tRJmSC.amd.js.map} +1 -1
  13. package/.chunks/{menu-CYVPcwEJ.es.js → menu-CHczkYl6.es.js} +2 -2
  14. package/.chunks/{menu-CYVPcwEJ.es.js.map → menu-CHczkYl6.es.js.map} +1 -1
  15. package/.chunks/{menu-BGUYnOx6.amd.js → menu-buQxcAhv.amd.js} +2 -2
  16. package/.chunks/{menu-BGUYnOx6.amd.js.map → menu-buQxcAhv.amd.js.map} +1 -1
  17. package/.chunks/{popup-CcxDRowY.amd.js → popup-BMNS1F2G.amd.js} +76 -22
  18. package/.chunks/popup-BMNS1F2G.amd.js.map +1 -0
  19. package/.chunks/{popup-kXOd0_xN.es.js → popup-CJLGyBwQ.es.js} +76 -22
  20. package/.chunks/popup-CJLGyBwQ.es.js.map +1 -0
  21. package/.chunks/{widgetInput-DfOBj0qz.amd.js → widgetInput-ASxjfQpi.amd.js} +2 -2
  22. package/.chunks/widgetInput-ASxjfQpi.amd.js.map +1 -0
  23. package/.chunks/{widgetInput-Dp8KRAPK.es.js → widgetInput-p8fSQGk9.es.js} +2 -2
  24. package/.chunks/widgetInput-p8fSQGk9.es.js.map +1 -0
  25. package/assets/core.css +1 -1
  26. package/assets/dark.css +1 -1
  27. package/assets/forms.css +1 -1
  28. package/assets/formsExt.css +1 -1
  29. package/assets/light.css +1 -1
  30. package/assets/menu.css +1 -1
  31. package/assets/tabs.css +1 -1
  32. package/assets/tabsView.css +1 -1
  33. package/assets/widgetInput.css +1 -1
  34. package/core/core.amd.js +1 -1
  35. package/core/core.js +1 -1
  36. package/forms/forms.amd.js +1 -1
  37. package/forms/forms.js +15 -14
  38. package/forms/forms.js.map +1 -1
  39. package/formsExt/formsExt.amd.js +1 -1
  40. package/formsExt/formsExt.amd.js.map +1 -1
  41. package/formsExt/formsExt.js +83 -82
  42. package/formsExt/formsExt.js.map +1 -1
  43. package/icomoon/demo.html +142 -2
  44. package/icomoon/fonts/Topvisor-2.svg +10 -0
  45. package/icomoon/fonts/Topvisor-2.ttf +0 -0
  46. package/icomoon/fonts/Topvisor-2.woff +0 -0
  47. package/icomoon/selection.json +1 -1
  48. package/icomoon/style.css +33 -3
  49. package/package.json +22 -22
  50. package/popup/popup.amd.js +1 -1
  51. package/popup/popup.js +2 -2
  52. package/popup/worker.amd.js +1 -1
  53. package/popup/worker.js +2 -2
  54. package/project/project.amd.js +1 -1
  55. package/project/project.amd.js.map +1 -1
  56. package/project/project.js +33 -35
  57. package/project/project.js.map +1 -1
  58. package/src/components/forms/avatar/avatar.stories.d.ts +15 -14
  59. package/src/components/forms/avatar/avatar.vue.d.ts +7 -6
  60. package/src/components/forms/button/button.stories.d.ts +59 -57
  61. package/src/components/forms/button/button.vue.d.ts +10 -8
  62. package/src/components/forms/checkbox/checkbox.stories.d.ts +34 -33
  63. package/src/components/forms/checkbox/checkbox.vue.d.ts +17 -16
  64. package/src/components/forms/controlLabel/controlLabel.stories.d.ts +14 -13
  65. package/src/components/forms/controlLabel/controlLabel.vue.d.ts +4 -3
  66. package/src/components/forms/forms.d.ts +8 -0
  67. package/src/components/forms/hint/hint.stories.d.ts +43 -42
  68. package/src/components/forms/hint/hint.vue.d.ts +4 -3
  69. package/src/components/forms/input/input.stories.d.ts +64 -62
  70. package/src/components/forms/input/input.vue.d.ts +10 -8
  71. package/src/components/forms/inputDate/inputDate.stories.d.ts +31 -29
  72. package/src/components/forms/inputDate/inputDate.vue.d.ts +6 -5
  73. package/src/components/forms/inputRange/inputRange.stories.d.ts +93 -90
  74. package/src/components/forms/inputRange/inputRange.vue.d.ts +2 -1
  75. package/src/components/forms/loadbar/loadbar.stories.d.ts +2 -1
  76. package/src/components/forms/loadbar/loadbar.vue.d.ts +2 -1
  77. package/src/components/forms/radio/radio.stories.d.ts +32 -31
  78. package/src/components/forms/radio/radio.vue.d.ts +5 -4
  79. package/src/components/forms/select/select.stories.d.ts +24 -22
  80. package/src/components/forms/select/select.vue.d.ts +25 -22
  81. package/src/components/forms/switcher/switcher.stories.d.ts +32 -31
  82. package/src/components/forms/switcher/switcher.vue.d.ts +5 -4
  83. package/src/components/forms/textarea/textarea.stories.d.ts +24 -23
  84. package/src/components/forms/textarea/textarea.vue.d.ts +6 -5
  85. package/src/components/formsExt/editArea/editArea.stories.d.ts +40 -39
  86. package/src/components/formsExt/editArea/editArea.vue.d.ts +6 -5
  87. package/src/components/formsExt/editInput/editInput.stories.d.ts +22 -19
  88. package/src/components/formsExt/editInput/editInput.vue.d.ts +5 -4
  89. package/src/components/formsExt/menu/menu.stories.d.ts +15 -14
  90. package/src/components/formsExt/menu/menu.vue.d.ts +15 -14
  91. package/src/components/formsExt/radioGroup/radioGroup.stories.d.ts +16 -14
  92. package/src/components/formsExt/radioGroup/radioGroup.vue.d.ts +17 -14
  93. package/src/components/formsExt/selector2/itemMulti.vue.d.ts +5 -4
  94. package/src/components/formsExt/selector2/selector2.stories.d.ts +67 -65
  95. package/src/components/formsExt/selector2/selector2.vue.d.ts +33 -31
  96. package/src/components/popup/popup/listItem.vue.d.ts +5 -4
  97. package/src/components/popup/popup/opener.vue.d.ts +8 -7
  98. package/src/components/popup/popup/popup.stories.d.ts +218 -213
  99. package/src/components/popup/popup/popup.vue.d.ts +9 -8
  100. package/src/components/popup/popup/widgetInput.vue.d.ts +31 -28
  101. package/src/components/project/selectorCompetitors/composables.d.ts +5 -0
  102. package/src/components/project/selectorCompetitors/selectorCompetitors.d.ts +4 -2
  103. package/src/components/project/selectorCompetitors/selectorCompetitors.stories.d.ts +9 -8
  104. package/src/components/project/selectorCompetitors/selectorCompetitors.vue.d.ts +10 -8
  105. package/src/components/project/selectorCompetitors/stories/items.d.ts +2 -3
  106. package/src/components/project/selectorCompetitors/types/competitor.d.ts +7 -0
  107. package/src/components/tabs/tabs/content.vue.d.ts +4 -3
  108. package/src/components/tabs/tabs/tab.vue.d.ts +4 -3
  109. package/src/components/tabs/tabs/tabs.stories.d.ts +185 -182
  110. package/src/components/tabs/tabs/tabs.vue.d.ts +4 -3
  111. package/src/components/tabsView/tabsView/menu.vue.d.ts +7 -6
  112. package/src/components/tabsView/tabsView/menuDelimeter.vue.d.ts +2 -1
  113. package/src/components/tabsView/tabsView/menuItem.vue.d.ts +6 -5
  114. package/src/components/tabsView/tabsView/menuTitle.vue.d.ts +4 -3
  115. package/src/components/tabsView/tabsView/store.d.ts +124 -67
  116. package/src/components/tabsView/tabsView/tabsView.d.ts +1 -1
  117. package/src/components/tabsView/tabsView/tabsView.stories.d.ts +95 -94
  118. package/src/components/tabsView/tabsView/tabsView.vue.d.ts +13 -12
  119. package/src/components/tabsView/tabsView//320/255/320/273/320/265/320/274/320/265/320/275/321/202/321/213/MenuItem.stories.d.ts +93 -92
  120. package/src/components/tabsView/tabsView//320/255/320/273/320/265/320/274/320/265/320/275/321/202/321/213/MenuTitle.stories.d.ts +45 -44
  121. package/src/core/core/core.d.ts +1 -0
  122. package/src/core/core/page.d.ts +4 -0
  123. package/src/core/core/plugin.d.ts +38 -0
  124. package/src/core/core/state.d.ts +4 -0
  125. package/src/core/utils/device.d.ts +6 -0
  126. package/src/core/utils/image.d.ts +12 -0
  127. package/src/core/utils/number.d.ts +7 -0
  128. package/src/core/utils/store/plugin.d.ts +2 -1
  129. package/src/core/utils/string.d.ts +4 -0
  130. package/tabs/tabs.amd.js +1 -1
  131. package/tabs/tabs.js +1 -1
  132. package/tabsView/tabsView.amd.js +1 -1
  133. package/tabsView/tabsView.amd.js.map +1 -1
  134. package/tabsView/tabsView.js +2 -2
  135. package/tabsView/tabsView.js.map +1 -1
  136. package/utils/check.amd.js +1 -1
  137. package/utils/check.amd.js.map +1 -1
  138. package/utils/check.js +5 -22
  139. package/utils/check.js.map +1 -1
  140. package/utils/date.amd.js +1 -1
  141. package/utils/date.js +4 -4
  142. package/utils/device.amd.js +1 -1
  143. package/utils/device.js +7 -6
  144. package/utils/image.amd.js +2 -0
  145. package/utils/image.amd.js.map +1 -0
  146. package/utils/image.d.ts +1 -0
  147. package/utils/image.js +13 -0
  148. package/utils/image.js.map +1 -0
  149. package/utils/number.amd.js +2 -0
  150. package/utils/number.amd.js.map +1 -0
  151. package/utils/number.d.ts +1 -0
  152. package/utils/number.js +9 -0
  153. package/utils/number.js.map +1 -0
  154. package/utils/scroll.amd.js +1 -1
  155. package/utils/scroll.js +1 -1
  156. package/utils/string.amd.js +1 -1
  157. package/utils/string.amd.js.map +1 -1
  158. package/utils/string.js +17 -128
  159. package/utils/string.js.map +1 -1
  160. package/utils/system.amd.js +1 -1
  161. package/utils/system.amd.js.map +1 -1
  162. package/utils/system.js +8 -8
  163. package/utils/system.js.map +1 -1
  164. package/utils/url.amd.js +1 -2
  165. package/utils/url.amd.js.map +1 -1
  166. package/utils/url.js +8 -173
  167. package/utils/url.js.map +1 -1
  168. package/utils/window.amd.js +1 -1
  169. package/utils/window.js +1 -1
  170. package/.chunks/datepicker-CCrqadMd.amd.js.map +0 -1
  171. package/.chunks/datepicker-vwT52g9l.es.js.map +0 -1
  172. package/.chunks/forms-0MQ_zU80.amd.js +0 -3
  173. package/.chunks/forms-0MQ_zU80.amd.js.map +0 -1
  174. package/.chunks/forms-DKvPSbG6.es.js +0 -1171
  175. package/.chunks/forms-DKvPSbG6.es.js.map +0 -1
  176. package/.chunks/popup-CcxDRowY.amd.js.map +0 -1
  177. package/.chunks/popup-kXOd0_xN.es.js.map +0 -1
  178. package/.chunks/widgetInput-DfOBj0qz.amd.js.map +0 -1
  179. package/.chunks/widgetInput-Dp8KRAPK.es.js.map +0 -1
  180. package/src/core/utils/common.d.ts +0 -21
  181. package/utils/common.amd.js +0 -2
  182. package/utils/common.amd.js.map +0 -1
  183. package/utils/common.d.ts +0 -1
  184. package/utils/common.js +0 -21
  185. package/utils/common.js.map +0 -1
@@ -1,1171 +0,0 @@
1
- import { insertToPage as ae } from "../utils/css.js";
2
- import { reactive as Y, defineComponent as y, useCssVars as te, computed as b, openBlock as u, createElementBlock as m, createElementVNode as _, createCommentVNode as g, createBlock as M, resolveDynamicComponent as re, normalizeClass as w, withCtx as D, renderSlot as k, createTextVNode as le, toDisplayString as W, mergeModels as H, useModel as oe, withDirectives as T, vModelCheckbox as se, onUnmounted as de, ref as pe, unref as B, mergeProps as A, vModelRadio as ue, resolveDirective as ce, vModelText as ne, watch as me, Fragment as O, renderList as X, vModelSelect as fe, withKeys as he, withModifiers as be } from "vue";
3
- const ie = ["../assets/forms.css"].map((t) => import.meta.resolve(t));
4
- ae(ie, !0);
5
- function ge() {
6
- return "devicePixelRatio" in window && window.devicePixelRatio > 1;
7
- }
8
- function we() {
9
- return !!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|IEMobile|Opera Mini/i);
10
- }
11
- function ve() {
12
- return navigator.userAgent.indexOf("Topvisor_App") != -1;
13
- }
14
- function ye() {
15
- return navigator.userAgent.indexOf("Mac OS X") !== -1;
16
- }
17
- function eo() {
18
- const t = /Chrome|Android/.test(navigator.userAgent);
19
- let e = /Safari/.test(navigator.userAgent);
20
- return t && e && (e = !1), e;
21
- }
22
- function to() {
23
- return ye() ? "⌘" : "Ctrl";
24
- }
25
- const oo = () => $(document).scrollTop(), so = () => $(document), no = () => [document], _e = () => {
26
- const t = [
27
- ["iOS", /(iPhone|iPad)/i],
28
- ["Android", /(Android)/i],
29
- ["Windows Phone", /(IEMobile)/i],
30
- ["Windows 3.11", /Win16/i],
31
- ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/i],
32
- ["Windows 98", /(Windows 98)|(Win98)/i],
33
- ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/i],
34
- ["Windows XP", /(Windows NT 5.1)|(Windows XP)/i],
35
- ["Windows Server 2003", /(Windows NT 5.2)/i],
36
- ["Windows Vista", /(Windows NT 6.0)/i],
37
- ["Windows 7", /(Windows NT 6.1)/i],
38
- ["Windows 8", /(Windows NT 6.[23])|(Windows 8)/i],
39
- ["Windows 10", /(Windows NT 10)/i],
40
- ["Windows NT 4.0", /(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)/i],
41
- ["Windows ME", /Windows ME/i],
42
- ["Windows", /Windows/i],
43
- ["Open BSD", /OpenBSD/i],
44
- ["Sun OS", /SunOS/i],
45
- ["Linux", /(Linux)|(X11)/i],
46
- ["Macintosh", /(Mac_PowerPC)|(Macintosh)|(Mac OS X 10.4)|(Mac OS X 10.5)|(Mac OS X 10.6)/i],
47
- ["QNX", /QNX/i],
48
- ["BeOS", /BeOS/i],
49
- ["OS/2", /OS\/2/i]
50
- ];
51
- let e = "";
52
- for (let s = 0; s < t.length; s++)
53
- if (t[s][1].test(navigator.userAgent)) {
54
- e = t[s][0];
55
- break;
56
- }
57
- return e;
58
- }, ao = async () => {
59
- var e;
60
- let t = _e();
61
- if (t === "Windows 10") {
62
- const s = await ((e = navigator == null ? void 0 : navigator.userAgentData) == null ? void 0 : e.getHighEntropyValues(["platformVersion"]));
63
- s && s.platformVersion >= "13" && (t = "Windows 11");
64
- }
65
- return t;
66
- };
67
- class $e {
68
- }
69
- const Se = 100;
70
- let q;
71
- const I = /* @__PURE__ */ new Map(), R = {
72
- width: window.innerWidth,
73
- height: window.innerHeight
74
- };
75
- function ke(t) {
76
- I.set(t, t);
77
- }
78
- function Me(t) {
79
- I.delete(t);
80
- }
81
- function Ve(t) {
82
- clearTimeout(q), q = setTimeout(function() {
83
- t.topEvent = {
84
- widthDiff: R.width - window.innerWidth,
85
- hightDiff: R.height - window.innerHeight
86
- }, R.width = window.innerWidth, R.height = window.innerHeight, I.forEach((e) => e(t));
87
- }, Se);
88
- }
89
- window.addEventListener("resize", Ve);
90
- const We = {
91
- addOnReize: ke,
92
- removeOnResize: Me
93
- };
94
- var x;
95
- const Te = {
96
- widthForMobile: 900,
97
- dateFormat: "Y-m-d",
98
- /**
99
- * Для Москвы: +0300
100
- */
101
- gmt: (x = (/* @__PURE__ */ new Date()).toString().match(/GMT(\S+)/)) == null ? void 0 : x[1]
102
- };
103
- var ee;
104
- const Be = {
105
- /**
106
- * Device by size
107
- * @see widthForMobile
108
- */
109
- isMobile: !1,
110
- /**
111
- * Device by user agent
112
- */
113
- isMobileUA: !1,
114
- /**
115
- * true, если плотность пикселей экрана больше 1
116
- */
117
- isRetina: !1,
118
- /**
119
- * true, елси это приложение
120
- */
121
- isApp: !1,
122
- /**
123
- * true при горизонтальном расположении устройства
124
- */
125
- isLandscape: !0,
126
- /**
127
- * true при вертикальном расположении устройства
128
- */
129
- isPortrait: !1,
130
- size: 0,
131
- // См. core.options
132
- dateFormat: "Y-m-d",
133
- // См. core.options
134
- gmt: (ee = (/* @__PURE__ */ new Date()).toString().match(/GMT(\S+)/)) == null ? void 0 : ee[1]
135
- }, C = (t) => {
136
- var e, s;
137
- if (!((s = (e = p.$) == null ? void 0 : e.ui) != null && s.tooltip)) {
138
- console.info("Для работы v-top-tooltip требуется глобальная загрузка jQuery UI Tooltip");
139
- return;
140
- }
141
- return p.$(t);
142
- }, G = (t, e) => {
143
- var n;
144
- const s = t.value ?? {};
145
- return s.content ??= (n = e.props) == null ? void 0 : n.title, s.content = String(s.content).replace(/\r\n|\r|\n/g, "<br>"), s.position ??= {
146
- my: "bottom-18px",
147
- at: "top center"
148
- }, s;
149
- }, Le = {
150
- mounted(t, e, s) {
151
- var n;
152
- (n = C(t)) == null || n.tooltip(G(e, s));
153
- },
154
- updated(t, e, s, n) {
155
- var i;
156
- const a = G(e, s), o = (i = C(t)) == null ? void 0 : i.tooltip("instance");
157
- o && (o.options = {
158
- ...o.options,
159
- ...a
160
- });
161
- },
162
- unmounted(t, e, s) {
163
- var n;
164
- (n = C(t)) == null || n.tooltip("destroy");
165
- }
166
- }, Ee = {
167
- mounted: function(t, e) {
168
- (e.value || e.value === void 0) && t.focus();
169
- }
170
- };
171
- let E;
172
- const ze = {
173
- mounted(t, e, s) {
174
- const n = e.value || "top-sticky";
175
- E = new IntersectionObserver((a) => {
176
- let o = a[0].intersectionRatio < 1;
177
- o && e.arg === "bottom" && a[0].intersectionRect.y === 0 && (o = !1), t.classList.toggle(n, o);
178
- }, {
179
- threshold: [1]
180
- }), E.observe(t);
181
- },
182
- unmounted(t, e, s) {
183
- E == null || E.disconnect();
184
- }
185
- };
186
- let K = !1, z, F;
187
- const P = /* @__PURE__ */ new Map(), De = (t, e) => {
188
- const { distance: s, percent: n } = F, a = t.getBoundingClientRect().top, o = e * n / 100 / s, i = (e - a) / o;
189
- i <= s ? t.style.transform = `translateY(${s - i}px)` : t.style.transform = "translateY(0px)";
190
- }, Ne = (t) => {
191
- let e = window.innerHeight;
192
- window.addEventListener("scroll", () => {
193
- P.forEach((s) => De(s, e));
194
- }, { passive: !0 }), z = new IntersectionObserver((s) => {
195
- e = window.innerHeight, s.forEach((n) => {
196
- const a = n.target;
197
- if (n.intersectionRatio < 0.1 ? P.delete(a) : P.set(a, a), n.intersectionRatio === 0) {
198
- const { distance: o, percent: i } = F;
199
- a.style.transform = `translateY(${o}px)`;
200
- }
201
- });
202
- }, {
203
- threshold: 0.1
204
- });
205
- }, Re = {
206
- mounted(t, e, s) {
207
- var i;
208
- if (p.state.isMobileUA) return;
209
- const n = (i = e.arg) == null ? void 0 : i.split(":");
210
- let a = Number((n == null ? void 0 : n[0]) ?? 100), o = Number((n == null ? void 0 : n[1]) ?? 30);
211
- F = {
212
- distance: a,
213
- percent: o
214
- }, K || (Ne(), K = !0), z.observe(t);
215
- },
216
- unmounted(t, e, s) {
217
- P.delete(t), z == null || z.unobserve(t);
218
- }
219
- }, Pe = () => typeof window > "u" ? {} : window, Q = Pe();
220
- class p {
221
- /**
222
- * Настройки словаря
223
- */
224
- static L = Y({
225
- Not_date: "Not date"
226
- });
227
- static page = Q.page ?? {};
228
- static Page = $e;
229
- static options = Te;
230
- static state = Y({ ...Be });
231
- static matchMediaIsMobile;
232
- static $ = Q.$;
233
- /**
234
- * Добавить на страницу стили, используется для загрузки стилей из js
235
- *
236
- * Условная загрузка стилей m и pc отключена в пользу производительсности, стили грузятся всегда, но применяются по условию
237
- * @param style - css стили в строке
238
- * @param type - если указать 'm' или 'pc', то стили будут применяться по условию в зависимости от настройки this.options.widthForMobile
239
- */
240
- static appendStyle(e, s = "") {
241
- let n = "all";
242
- s === "m" && (n = "(max-width: " + this.options.widthForMobile + "px)"), s === "pc" && (n = "(min-width: " + this.options.widthForMobile + "px)");
243
- const a = document.createElement("style");
244
- a.innerHTML = e, a.media = n, document.head.append(a);
245
- }
246
- /**
247
- * Установить как плагин в прилоежнии Vue
248
- * Core.state является общим для всех приложений Vue на странице
249
- * Core.options является общим для всех приложений Vue на странице
250
- * @param app - Vue App
251
- * @param {typeof options} options - параметры UI
252
- */
253
- static install(e, s) {
254
- p.defineOptions(s), e.provide("top-core", p), this.installDirectives(e);
255
- }
256
- static installDirectives(e) {
257
- e.directive("top-tooltip", Le), e.directive("top-focus", Ee), e.directive("top-sticky", ze), e.directive("top-swim-up", Re);
258
- }
259
- /**
260
- * Установить конфигурацию UI
261
- * @param {typeof options} options
262
- */
263
- static defineOptions(e) {
264
- e != null && e.widthForMobile && (this.options.widthForMobile = e.widthForMobile), e != null && e.dateFormat && (this.options.dateFormat = e.dateFormat), e != null && e.gmt && (this.options.gmt = e.gmt), p.setState();
265
- }
266
- static setState() {
267
- p.matchMediaIsMobile = window.matchMedia(`(max-width: ${p.options.widthForMobile}px)`), p.state.isMobileUA = we(), p.state.isRetina = ge(), p.state.isApp = ve(), p.state.dateFormat = this.options.dateFormat, p.state.gmt = this.options.gmt, p.setStateByWindowSize(), We.addOnReize(p.onResize), p.onResize(), p.saveToCookie();
268
- }
269
- static onResize() {
270
- p.setStateByWindowSize(), document.documentElement.style.setProperty("--100vh", window.innerHeight + "px");
271
- }
272
- static setStateByWindowSize() {
273
- var e;
274
- p.state.isMobile = !!((e = p.matchMediaIsMobile) != null && e.matches), p.state.isLandscape = window.innerWidth > window.innerHeight, p.state.isPortrait = !p.state.isLandscape, p.state.size = window.innerWidth > window.innerHeight ? window.innerWidth : window.innerHeight, p.saveToCookie();
275
- }
276
- /**
277
- * Сохранить информацию об устройстве в cookie
278
- */
279
- static saveToCookie() {
280
- const e = [
281
- 1,
282
- window.innerWidth,
283
- window.innerHeight,
284
- window.devicePixelRatio,
285
- Number(p.state.isMobile),
286
- Number(p.state.isRetina)
287
- ];
288
- document.cookie = "device=" + e.join(",") + "; path=/;";
289
- }
290
- }
291
- const V = window.L ?? {}, io = (t, e, s) => {
292
- switch (new Date(t, e, s).getDay()) {
293
- case 0:
294
- return V.Vs + ".";
295
- case 1:
296
- return V.Pn + ".";
297
- case 2:
298
- return V.Vt + ".";
299
- case 3:
300
- return V.Sr + ".";
301
- case 4:
302
- return V.Ct + ".";
303
- case 5:
304
- return V.Pt + ".";
305
- case 6:
306
- return V.Sb + ".";
307
- default:
308
- return "";
309
- }
310
- }, ro = (t, e = !0, s = 2) => {
311
- let n = String(t.getFullYear()), a = String(t.getDate()).padStart(2, "0"), o = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getHours()).padStart(2, "0"), l = String(t.getMinutes()).padStart(2, "0"), f = String(t.getSeconds()).padStart(2, "0"), r = n + "-" + o + "-" + a;
312
- return s >= 1 && (r += " " + i), s >= 2 && (r += ":" + l), s === 3 && (r += ":" + f), e && (r = L(r, s)), r;
313
- };
314
- function lo(t) {
315
- return t.indexOf("T") === -1 && (t.length == 10 && (t += " 00:00:00"), t = t.replace(" ", "T") + p.state.gmt), new Date(t);
316
- }
317
- function Ae(t, e = !0, s = 0) {
318
- let n;
319
- t != null ? n = new Date(t) : n = /* @__PURE__ */ new Date();
320
- const a = n.getFullYear(), o = String(n.getMonth() + 1).padStart(2, "0"), i = n.getDate().toString().padStart(2, "0"), l = n.getHours().toString().padStart(2, "0"), f = n.getMinutes().toString().padStart(2, "0"), r = n.getSeconds().toString().padStart(2, "0");
321
- return n = a + "-" + o + "-" + i, s && (n += " "), s >= 1 && (n += l), s >= 2 && (n += ":" + f), s >= 3 && (n += ":" + r), e && (n = L(n, s)), n;
322
- }
323
- function po(t, e = !0) {
324
- const n = (/* @__PURE__ */ new Date()).getTimezoneOffset() / 60 * -1 * 60 * 60 * 1e3, a = 3 * 60 * 60 * 1e3;
325
- let o;
326
- t !== void 0 ? o = new Date(t) : o = /* @__PURE__ */ new Date(), o.setTime(o.getTime() - n + a);
327
- let i = String(o.getFullYear()), l = String(o.getDate()).padStart(2, "0"), f = String(o.getMonth() + 1).padStart(2, "0"), r = String(o.getHours()).padStart(2, "0"), d = String(o.getMinutes()).padStart(2, "0"), c = String(o.getSeconds()).padStart(2, "0"), h = i + "-" + f + "-" + l + " " + r + ":" + d + ":" + c;
328
- return e && (h = L(h)), h;
329
- }
330
- function L(t, e = 2, s, n = p.L.Not_date) {
331
- if (typeof t == "string" && (!t || t.substring(0, 10) === "0000-00-00") && n && n !== "0000-00-00")
332
- return n;
333
- s || (s = p.state.dateFormat.toLowerCase().toLowerCase().replace("m", "mm").replace("y", "yy").replace("d", "dd"));
334
- let a;
335
- if (t instanceof Date)
336
- a = t;
337
- else {
338
- let i = t.substring(0, 10);
339
- if (i.length === 7 && (i += "-01"), i += " 00:00", i = i.replace(/-/g, "/"), a = new Date(i), isNaN(Number(a))) return n;
340
- }
341
- let o = "";
342
- if (s && window.$ && (o = $.datepicker.formatDate(s, a)), e && typeof t == "string" && t.length > 10 || e && t instanceof Date) {
343
- let i = "";
344
- if (t instanceof Date)
345
- i = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
346
- hour12: !1,
347
- hour: "numeric",
348
- minute: e >= 2 ? "numeric" : void 0,
349
- second: e >= 3 ? "numeric" : void 0
350
- });
351
- else
352
- switch (e) {
353
- case 1:
354
- i = t.substring(11, 13);
355
- break;
356
- case 2:
357
- i = t.substring(11, 16);
358
- break;
359
- case 3:
360
- i = t.substring(11, 19);
361
- break;
362
- }
363
- o += " " + i;
364
- }
365
- return o = o.trim(), o;
366
- }
367
- function J(t, e = p.L.Not_date) {
368
- if (!t)
369
- return e;
370
- if (t.match(/\d\d\d\d-\d\d-\d\d/))
371
- return t;
372
- const s = p.state.dateFormat.toLowerCase(), n = t.split(/\W/), a = s.split(/\W/);
373
- let o = "", i = "", l = "";
374
- a.forEach((r, d) => {
375
- switch (r) {
376
- case "d":
377
- o = n[d];
378
- break;
379
- case "m":
380
- i = n[d];
381
- break;
382
- case "y":
383
- l = n[d];
384
- break;
385
- }
386
- });
387
- let f = l + "-" + i + "-" + o;
388
- return f.match(/\d\d\d\d-\d\d-\d\d/) || (console.info("Неверный формат даты, будет возращена текущая дата, " + f), f = Ae((/* @__PURE__ */ new Date()).getTime(), !1).substring(0, 10)), f;
389
- }
390
- const Oe = { class: "top-avatar" }, Ce = ["src", "title"], He = ["title"], Ie = /* @__PURE__ */ y({
391
- __name: "avatar",
392
- props: {
393
- size: { default: 64 },
394
- image: {},
395
- nickname: {},
396
- isOnline: { type: Boolean },
397
- lastActiveTime: {},
398
- i18n: { default: () => ({
399
- Online: "Online",
400
- LastSeen: "Last seen"
401
- }) }
402
- },
403
- setup(t) {
404
- te((a) => ({
405
- "5365dc30": a.size + "px"
406
- }));
407
- const e = t, s = b(() => {
408
- var a, o;
409
- if (e.isOnline)
410
- return (a = e.i18n) == null ? void 0 : a.Online;
411
- if (e.lastActiveTime)
412
- return ((o = e.i18n) == null ? void 0 : o.LastSeen) + ": " + L(e.lastActiveTime, 2);
413
- }), n = b(() => e.nickname ? e.nickname + (s.value ? `
414
- ${s.value}` : "") : s.value);
415
- return (a, o) => (u(), m("div", Oe, [
416
- _("img", {
417
- class: "top-avatar_image",
418
- src: a.image,
419
- title: n.value,
420
- alt: ""
421
- }, null, 8, Ce),
422
- a.isOnline ? (u(), m("div", {
423
- key: 0,
424
- class: "top-avatar_status",
425
- title: s.value
426
- }, null, 8, He)) : g("", !0)
427
- ]));
428
- }
429
- }), Fe = {
430
- "top-avatar": "top-avatar",
431
- "top-avatar_image": "top-avatar_image",
432
- "top-avatar_status": "top-avatar_status"
433
- }, v = (t, e) => {
434
- const s = t.__vccOpts || t;
435
- for (const [n, a] of e)
436
- s[n] = a;
437
- return s;
438
- }, Ue = {
439
- $style: Fe
440
- }, uo = /* @__PURE__ */ v(Ie, [["__cssModules", Ue]]), Ye = {
441
- key: 0,
442
- class: "top-ellipsis"
443
- }, Xe = /* @__PURE__ */ y({
444
- __name: "button",
445
- props: {
446
- color: { default: "blue" },
447
- styling: { default: "" },
448
- size: { default: "s" },
449
- name: {},
450
- title: {},
451
- icon: {},
452
- icon2: {},
453
- href: {},
454
- disabled: { type: Boolean },
455
- isSubmit: { type: Boolean },
456
- isActive: { type: Boolean },
457
- isProgress: { type: Boolean }
458
- },
459
- setup(t) {
460
- const e = t, s = b(() => e.href ? "a" : "button"), n = b(() => e.isSubmit ? "submit" : void 0);
461
- return (a, o) => (u(), M(re(s.value), {
462
- class: w({
463
- "top-active": a.isActive,
464
- "top-disabled": a.disabled,
465
- "top-forms-focusable": !a.disabled,
466
- "top-button": !0,
467
- "top-button-progress": a.isProgress,
468
- [`top-size_${a.size}`]: !!a.size,
469
- [`top-color_${a.color}`]: !0,
470
- [`top-style_${a.styling}`]: !!a.styling,
471
- "top-button-withoutText": !a.$slots.default
472
- }),
473
- name: a.name,
474
- title: a.title,
475
- href: a.href,
476
- type: n.value,
477
- "data-top-icon": a.icon || void 0,
478
- "data-top-icon2": a.icon2 || void 0,
479
- disabled: a.disabled || void 0,
480
- inProgress: a.isProgress
481
- }, {
482
- default: D(() => [
483
- a.$slots.default ? (u(), m("span", Ye, [
484
- k(a.$slots, "default", {}, () => [
485
- le(W(a.icon ? "" : "Button"), 1)
486
- ])
487
- ])) : g("", !0),
488
- k(a.$slots, "html")
489
- ]),
490
- _: 3
491
- }, 8, ["class", "name", "title", "href", "type", "data-top-icon", "data-top-icon2", "disabled", "inProgress"]));
492
- }
493
- }), qe = "_progress_1hqxk_1", Ge = {
494
- "top-button": "top-button",
495
- "top-active": "top-active",
496
- "top-button-progress": "top-button-progress",
497
- progress: qe,
498
- "top-button-withoutText": "top-button-withoutText",
499
- "top-color_blue": "top-color_blue",
500
- "top-color_green": "top-color_green",
501
- "top-color_orange": "top-color_orange",
502
- "top-color_red": "top-color_red",
503
- "top-color_pink": "top-color_pink",
504
- "top-color_theme": "top-color_theme",
505
- "top-style_outline": "top-style_outline",
506
- "top-style_soft": "top-style_soft",
507
- "top-style_transparent": "top-style_transparent",
508
- "top-size_l": "top-size_l",
509
- "top-size_xl": "top-size_xl"
510
- }, Ke = {
511
- $style: Ge
512
- }, co = /* @__PURE__ */ v(Xe, [["__cssModules", Ke]]), Qe = { class: "top-forms-optionLabel" }, Je = /* @__PURE__ */ y({
513
- __name: "controlLabel",
514
- props: {
515
- description: {},
516
- disabled: { type: Boolean }
517
- },
518
- setup(t) {
519
- return (e, s) => (u(), m("div", Qe, [
520
- _("div", {
521
- class: w({
522
- "top-forms-optionLabel_title": !0,
523
- "top-forms-optionLabel_title-disabled": e.disabled
524
- })
525
- }, [
526
- k(e.$slots, "default")
527
- ], 2),
528
- e.description ? (u(), m("div", {
529
- key: 0,
530
- class: w(["top-forms-optionLabel_description", { "top-forms-optionLabel_description-disabled": e.disabled }])
531
- }, W(e.description), 3)) : g("", !0)
532
- ]));
533
- }
534
- }), Ze = {
535
- "top-forms-optionLabel": "top-forms-optionLabel",
536
- "top-forms-optionLabel_title": "top-forms-optionLabel_title",
537
- "top-forms-optionLabel_title-disabled": "top-forms-optionLabel_title-disabled",
538
- "top-forms-optionLabel_description": "top-forms-optionLabel_description",
539
- "top-forms-optionLabel_description-disabled": "top-forms-optionLabel_description-disabled"
540
- }, je = {
541
- $style: Ze
542
- }, U = /* @__PURE__ */ v(Je, [["__cssModules", je]]), xe = ["name", "value", "indeterminate", "disabled"], et = /* @__PURE__ */ y({
543
- __name: "checkbox",
544
- props: /* @__PURE__ */ H({
545
- modelValue: { type: [Boolean, Array, Set] },
546
- name: {},
547
- value: {},
548
- description: {},
549
- disabled: { type: Boolean },
550
- indeterminate: { type: Boolean },
551
- isError: { type: Boolean }
552
- }, {
553
- modelValue: { type: [Boolean, Array, Set] },
554
- modelModifiers: {}
555
- }),
556
- emits: ["update:modelValue"],
557
- setup(t) {
558
- const e = oe(t, "modelValue");
559
- return (s, n) => (u(), m("label", {
560
- class: w({
561
- "top-forms-optionWrapper": !0,
562
- "top-checkbox": !0,
563
- ["top-checkbox_" + s.name]: !!s.name,
564
- "top-disabled": s.disabled,
565
- "top-error": s.isError && !s.disabled
566
- })
567
- }, [
568
- T(_("input", {
569
- type: "checkbox",
570
- class: w({
571
- "top-forms-focusable": !s.disabled,
572
- "top-forms-option": !0,
573
- "top-checkbox_input": !0,
574
- "top-error": s.isError && !s.disabled
575
- }),
576
- name: s.name,
577
- "onUpdate:modelValue": n[0] || (n[0] = (a) => e.value = a),
578
- value: s.value,
579
- indeterminate: s.indeterminate,
580
- disabled: s.disabled
581
- }, null, 10, xe), [
582
- [se, e.value]
583
- ]),
584
- s.$slots.default ? (u(), M(U, {
585
- key: 0,
586
- description: s.description,
587
- disabled: s.disabled
588
- }, {
589
- default: D(() => [
590
- k(s.$slots, "default")
591
- ]),
592
- _: 3
593
- }, 8, ["description", "disabled"])) : g("", !0)
594
- ], 2));
595
- }
596
- }), tt = {
597
- "top-checkbox": "top-checkbox",
598
- "top-checkbox_input": "top-checkbox_input",
599
- "top-error": "top-error"
600
- }, ot = {
601
- $style: tt
602
- }, mo = /* @__PURE__ */ v(et, [["__cssModules", ot]]), st = ["title"], nt = /* @__PURE__ */ y({
603
- __name: "hint",
604
- props: {
605
- hint: {}
606
- },
607
- setup(t) {
608
- return (e, s) => (u(), m("span", {
609
- class: "top-hint",
610
- "data-top-icon": "",
611
- title: e.hint
612
- }, null, 8, st));
613
- }
614
- }), at = {
615
- "top-hint": "top-hint"
616
- }, it = {
617
- $style: at
618
- }, rt = /* @__PURE__ */ v(nt, [["__cssModules", it]]), lt = ["modelValue"], dt = !!document.documentElement.ontouchstart && !!document.createElement("input").showPicker;
619
- let Z = (t) => {
620
- };
621
- const pt = /* @__PURE__ */ y({
622
- __name: "inputDate",
623
- props: {
624
- modelValue: {},
625
- name: {},
626
- disabled: { type: Boolean },
627
- readonly: { type: Boolean },
628
- modificator: {},
629
- size: {},
630
- isError: { type: Boolean },
631
- isLoading: { type: Boolean },
632
- icon: {},
633
- icon2: { default: "" },
634
- addCleaner: { type: Boolean },
635
- title: {},
636
- captionType: {}
637
- },
638
- emits: ["update:modelValue"],
639
- setup(t, { emit: e }) {
640
- const s = t, n = e;
641
- de(() => {
642
- o && o.datepicker("destroy");
643
- });
644
- const a = pe();
645
- let o;
646
- const i = b({
647
- get() {
648
- return L(s.modelValue, 2, void 0, "0000-00-00");
649
- },
650
- set(d) {
651
- d = J(d, "0000-00-00"), n("update:modelValue", d);
652
- }
653
- });
654
- let l = (d) => {
655
- Z(d);
656
- }, f = (d) => {
657
- const c = J(d.target.value), h = L(c);
658
- if (!h || h === p.L.Not_date || d.target.value !== h) {
659
- d.target.value = i.value;
660
- return;
661
- }
662
- i.value = d.target.value;
663
- };
664
- async function r(d) {
665
- const c = await import("./datepicker-vwT52g9l.es.js");
666
- Z = c.oninput, o = c.connectDatepicker(d.target, {
667
- onSelect: () => f(d)
668
- }), o && o.datepicker("show");
669
- }
670
- return (d, c) => B(dt) ? (u(), M(B(j), A({ key: 0 }, d.$props, {
671
- modelValue: i.value,
672
- readonly: "",
673
- onClick: c[1] || (c[1] = (h) => a.value.showPicker())
674
- }), {
675
- default: D(() => [
676
- _("input", {
677
- ref_key: "el",
678
- ref: a,
679
- type: "date",
680
- class: "top-input_input-date",
681
- modelValue: d.modelValue,
682
- onChange: c[0] || (c[0] = (h) => i.value = h.target.value),
683
- tabindex: "-1"
684
- }, null, 40, lt)
685
- ]),
686
- _: 1
687
- }, 16, ["modelValue"])) : (u(), M(B(j), A({ key: 1 }, d.$props, {
688
- modelValue: i.value,
689
- "onUpdate:modelValue": c[2] || (c[2] = (h) => h === "" ? i.value = "" : ""),
690
- onInput: B(l),
691
- onFocusOnce: r,
692
- onChange: B(f),
693
- modificator: "datepicker"
694
- }), null, 16, ["modelValue", "onInput", "onChange"]));
695
- }
696
- }), ut = {
697
- "top-input-datepicker": "top-input-datepicker",
698
- "top-input_input-date": "top-input_input-date"
699
- }, ct = {
700
- $style: ut
701
- }, fo = /* @__PURE__ */ v(pt, [["__cssModules", ct]]), mt = { class: "top-inputRange" }, ft = /* @__PURE__ */ _("span", { class: "top-inputRange_dash" }, " — ", -1), ht = /* @__PURE__ */ y({
702
- __name: "inputRange",
703
- setup(t) {
704
- return (e, s) => (u(), m("div", mt, [
705
- k(e.$slots, "from"),
706
- ft,
707
- k(e.$slots, "to")
708
- ]));
709
- }
710
- }), bt = {
711
- "top-inputRange": "top-inputRange",
712
- "top-inputRange_dash": "top-inputRange_dash",
713
- "top-input": "top-input"
714
- }, gt = {
715
- $style: bt
716
- }, ho = /* @__PURE__ */ v(ht, [["__cssModules", gt]]), wt = ["name", "value", "disabled"], vt = /* @__PURE__ */ y({
717
- __name: "radio",
718
- props: {
719
- modelValue: {},
720
- value: {},
721
- name: {},
722
- description: {},
723
- disabled: { type: Boolean },
724
- isError: { type: Boolean }
725
- },
726
- emits: ["update:modelValue"],
727
- setup(t, { emit: e }) {
728
- const s = t, n = e, a = b({
729
- get() {
730
- return s.modelValue;
731
- },
732
- set(o) {
733
- n("update:modelValue", o);
734
- }
735
- });
736
- return (o, i) => (u(), m("label", {
737
- class: w({
738
- "top-forms-optionWrapper": !0,
739
- "top-radio": !0,
740
- ["top-radio_" + o.name]: o.name !== "",
741
- "top-disabled": o.disabled,
742
- "top-error": o.isError && !o.disabled
743
- })
744
- }, [
745
- T(_("input", {
746
- type: "radio",
747
- class: w({
748
- "top-forms-focusable": !o.disabled,
749
- "top-forms-option": !0,
750
- "top-radio_input": !0,
751
- "top-error": o.isError && !o.disabled
752
- }),
753
- "onUpdate:modelValue": i[0] || (i[0] = (l) => a.value = l),
754
- name: o.name,
755
- value: o.value,
756
- disabled: o.disabled
757
- }, null, 10, wt), [
758
- [ue, a.value]
759
- ]),
760
- o.$slots.default ? (u(), M(U, {
761
- key: 0,
762
- description: o.description,
763
- disabled: o.disabled
764
- }, {
765
- default: D(() => [
766
- k(o.$slots, "default")
767
- ]),
768
- _: 3
769
- }, 8, ["description", "disabled"])) : g("", !0)
770
- ], 2));
771
- }
772
- }), yt = {
773
- "top-radio": "top-radio",
774
- "top-radio_input": "top-radio_input",
775
- "top-error": "top-error"
776
- }, _t = {
777
- $style: yt
778
- }, bo = /* @__PURE__ */ v(vt, [["__cssModules", _t]]), $t = ["name", "value", "disabled"], St = /* @__PURE__ */ y({
779
- __name: "switcher",
780
- props: {
781
- modelValue: { type: [Boolean, Array, Set] },
782
- name: {},
783
- value: {},
784
- description: {},
785
- disabled: { type: Boolean },
786
- isError: { type: Boolean }
787
- },
788
- emits: ["update:modelValue"],
789
- setup(t, { emit: e }) {
790
- const s = t, n = e, a = b({
791
- get() {
792
- return s.modelValue;
793
- },
794
- set(o) {
795
- n("update:modelValue", o);
796
- }
797
- });
798
- return (o, i) => (u(), m("label", {
799
- class: w({
800
- "top-forms-optionWrapper": !0,
801
- "top-checkboxSwitcher": !0,
802
- "top-disabled": o.disabled,
803
- "top-error": o.isError && !o.disabled
804
- })
805
- }, [
806
- T(_("input", {
807
- type: "checkbox",
808
- class: w({
809
- "top-forms-focusable": !o.disabled,
810
- "top-forms-option": !0,
811
- "top-checkboxSwitcher_input": !0,
812
- "top-error": o.isError && !o.disabled
813
- }),
814
- "onUpdate:modelValue": i[0] || (i[0] = (l) => a.value = l),
815
- name: o.name,
816
- value: o.value,
817
- disabled: o.disabled
818
- }, null, 10, $t), [
819
- [se, a.value]
820
- ]),
821
- o.$slots.default ? (u(), M(U, {
822
- key: 0,
823
- description: o.description,
824
- disabled: o.disabled
825
- }, {
826
- default: D(() => [
827
- k(o.$slots, "default")
828
- ]),
829
- _: 3
830
- }, 8, ["description", "disabled"])) : g("", !0)
831
- ], 2));
832
- }
833
- }), kt = {
834
- "top-checkboxSwitcher": "top-checkboxSwitcher",
835
- "top-checkboxSwitcher_input": "top-checkboxSwitcher_input",
836
- "top-error": "top-error"
837
- }, Mt = {
838
- $style: kt
839
- }, go = /* @__PURE__ */ v(St, [["__cssModules", Mt]]), Vt = ["name", "placeholder", "disabled", "readonly", "rows"], Wt = {
840
- key: 0,
841
- class: "top-textarea_pseudoContent"
842
- }, Tt = /* @__PURE__ */ y({
843
- inheritAttrs: !1,
844
- __name: "textarea",
845
- props: {
846
- modelValue: {},
847
- name: {},
848
- placeholder: {},
849
- rows: { default: 5 },
850
- minHeight: { default: 120 },
851
- expandable: { type: Boolean },
852
- disabled: { type: Boolean },
853
- readonly: { type: Boolean },
854
- isError: { type: Boolean },
855
- hint: {}
856
- },
857
- emits: ["update:modelValue"],
858
- setup(t, { emit: e }) {
859
- te((o) => ({
860
- c35baa86: o.minHeight + "px"
861
- }));
862
- const s = t, n = e, a = b({
863
- get() {
864
- return s.modelValue;
865
- },
866
- set(o) {
867
- n("update:modelValue", o);
868
- }
869
- });
870
- return (o, i) => {
871
- const l = ce("top-tooltip");
872
- return u(), m("label", {
873
- class: w({
874
- "top-textarea": !0,
875
- ["top-textarea-" + o.name]: o.name,
876
- "top-disabled": o.disabled
877
- })
878
- }, [
879
- T(_("textarea", A({
880
- type: "text",
881
- class: {
882
- "top-forms-focusable": !o.disabled,
883
- "top-textarea_textarea": !0,
884
- "top-textarea_textarea-expandable": o.expandable,
885
- "top-error": o.isError
886
- },
887
- autocomplete: "off_always",
888
- name: o.name,
889
- placeholder: o.placeholder,
890
- disabled: o.disabled,
891
- readonly: o.readonly,
892
- rows: o.expandable ? void 0 : o.rows
893
- }, o.$attrs, {
894
- "onUpdate:modelValue": i[0] || (i[0] = (f) => a.value = f)
895
- }), null, 16, Vt), [
896
- [ne, a.value]
897
- ]),
898
- o.expandable ? (u(), m("div", Wt, W(a.value + " "), 1)) : g("", !0),
899
- o.hint ? T((u(), M(rt, {
900
- key: 1,
901
- class: "top-textarea_hint",
902
- hint: o.hint
903
- }, null, 8, ["hint"])), [
904
- [l]
905
- ]) : g("", !0)
906
- ], 2);
907
- };
908
- }
909
- }), Bt = {
910
- "top-textarea": "top-textarea",
911
- "top-textarea_textarea": "top-textarea_textarea",
912
- "top-textarea_textarea-expandable": "top-textarea_textarea-expandable",
913
- "top-textarea_pseudoContent": "top-textarea_pseudoContent",
914
- "top-textarea_hint": "top-textarea_hint"
915
- }, Lt = {
916
- $style: Bt
917
- }, wo = /* @__PURE__ */ v(Tt, [["__cssModules", Lt]]), Et = ["data-value", "data-top-icon", "data-top-icon2"], zt = ["name", "disabled"], Dt = ["label", "disabled"], Nt = ["value", "selected", "disabled"], Rt = ["value", "selected", "disabled"], Pt = {
918
- key: 1,
919
- class: "top-formsCaption"
920
- }, At = /* @__PURE__ */ y({
921
- __name: "select",
922
- props: /* @__PURE__ */ H({
923
- modelValue: {},
924
- options: {},
925
- name: {},
926
- disabled: { type: Boolean },
927
- icon: {},
928
- size: { default: "s" },
929
- addChanger: { type: Boolean },
930
- title: {},
931
- isError: { type: Boolean }
932
- }, {
933
- modelValue: {
934
- required: !0
935
- },
936
- modelModifiers: {}
937
- }),
938
- emits: /* @__PURE__ */ H(["update:modelValue"], ["update:modelValue"]),
939
- setup(t, { emit: e }) {
940
- const s = t, n = oe(t, "modelValue"), a = b(() => {
941
- const r = /* @__PURE__ */ new Map();
942
- return s.options.forEach((d, c) => {
943
- if (typeof d == "string" && (d = i(c, d)), d.children) {
944
- const h = /* @__PURE__ */ new Map();
945
- d.children.forEach((S, N) => {
946
- typeof S == "string" && (S = i(N, S)), h.set(S.value, S);
947
- }), d = { ...d }, d.children = h, r.set(d.value, d);
948
- } else
949
- r.set(d.value, d);
950
- }), r;
951
- }), o = b(() => {
952
- const r = /* @__PURE__ */ new Map();
953
- return a.value.forEach((d) => {
954
- if (!d.disabled) {
955
- if (d.children) {
956
- d.children.forEach((c) => {
957
- c.disabled || r.set(c.value, c);
958
- });
959
- return;
960
- }
961
- r.set(d.value, d);
962
- }
963
- }), r;
964
- }), i = (r, d) => ({
965
- value: r,
966
- title: d
967
- });
968
- me([
969
- () => s.modelValue,
970
- o
971
- ], () => {
972
- (n.value === null || n.value === void 0) && o.value.size && (console.warn("Пожалуйста, не передавайте в компонент Select значения null и undefined"), n.value = o.value.keys().next().value);
973
- }, { immediate: !0 });
974
- const l = b(() => {
975
- var r;
976
- return (r = o.value.get(n.value)) == null ? void 0 : r.icon;
977
- }), f = () => {
978
- const r = [...o.value.keys()], c = (r.indexOf(n.value) + 1) % r.length;
979
- n.value = r[c];
980
- };
981
- return (r, d) => (u(), m("label", {
982
- class: w({
983
- "top-select": !0,
984
- ["top-select-" + r.name]: r.name,
985
- ["top-size_" + r.size]: !0,
986
- "top-formsCaptionWrapper": !!r.title,
987
- "top-select-error": r.isError,
988
- "top-disabled": r.disabled
989
- }),
990
- "data-value": n.value,
991
- "data-top-icon": r.icon,
992
- "data-top-icon2": l.value
993
- }, [
994
- T(_("select", {
995
- class: w({
996
- "top-forms-focusable": !r.disabled,
997
- "top-select_select": !0,
998
- "top-select_arrow": !0,
999
- "top-error": r.isError
1000
- }),
1001
- name: r.name,
1002
- disabled: r.disabled,
1003
- "onUpdate:modelValue": d[0] || (d[0] = (c) => n.value = c)
1004
- }, [
1005
- (u(!0), m(O, null, X(a.value, ([c, h]) => (u(), m(O, null, [
1006
- h.children ? (u(), m("optgroup", {
1007
- key: "group_" + c,
1008
- label: h.title,
1009
- disabled: h.disabled
1010
- }, [
1011
- (u(!0), m(O, null, X(h.children, ([S, N]) => (u(), m("option", {
1012
- key: S,
1013
- value: S,
1014
- selected: S === n.value,
1015
- disabled: N.disabled
1016
- }, W(N.title), 9, Nt))), 128))
1017
- ], 8, Dt)) : (u(), m("option", {
1018
- key: c ?? void 0,
1019
- value: c,
1020
- selected: c === n.value,
1021
- disabled: h.disabled
1022
- }, W(h.title), 9, Rt))
1023
- ], 64))), 256))
1024
- ], 10, zt), [
1025
- [fe, n.value]
1026
- ]),
1027
- r.addChanger && o.value.size && !r.disabled ? (u(), m("span", {
1028
- key: 0,
1029
- class: "top-changer",
1030
- onClick: f
1031
- })) : g("", !0),
1032
- r.title ? (u(), m("span", Pt, W(r.title), 1)) : g("", !0)
1033
- ], 10, Et));
1034
- }
1035
- }), Ot = {
1036
- "top-select": "top-select",
1037
- "top-select-error": "top-select-error",
1038
- "top-select_select": "top-select_select",
1039
- "top-changer": "top-changer"
1040
- }, Ct = {
1041
- $style: Ot
1042
- }, vo = /* @__PURE__ */ v(At, [["__cssModules", Ct]]), Ht = {
1043
- "top-loadbar": "top-loadbar"
1044
- }, It = {}, Ft = { class: "top-loadbar" };
1045
- function Ut(t, e) {
1046
- return u(), m("div", Ft);
1047
- }
1048
- const Yt = {
1049
- $style: Ht
1050
- }, Xt = /* @__PURE__ */ v(It, [["render", Ut], ["__cssModules", Yt]]), qt = ["data-top-icon", "data-top-icon2"], Gt = ["name", "title", "placeholder", "disabled", "readonly"], Kt = {
1051
- key: 2,
1052
- class: "top-formsCaption"
1053
- }, Qt = /* @__PURE__ */ y({
1054
- inheritAttrs: !1,
1055
- __name: "input",
1056
- props: {
1057
- modelValue: {},
1058
- name: {},
1059
- disabled: { type: Boolean },
1060
- readonly: { type: Boolean },
1061
- modificator: {},
1062
- size: { default: "s" },
1063
- isError: { type: Boolean },
1064
- isLoading: { type: Boolean },
1065
- icon: {},
1066
- icon2: {},
1067
- addCleaner: { type: Boolean },
1068
- title: {},
1069
- captionType: { default: "" }
1070
- },
1071
- emits: ["update:modelValue"],
1072
- setup(t, { emit: e }) {
1073
- const s = t, n = e, a = b({
1074
- get() {
1075
- return s.modelValue;
1076
- },
1077
- set(l) {
1078
- n("update:modelValue", l);
1079
- }
1080
- }), o = b(() => s.addCleaner && !s.title || s.captionType !== "" ? "" : s.title), i = (l) => {
1081
- s.modelValue && l.stopPropagation(), n("update:modelValue", "");
1082
- };
1083
- return (l, f) => (u(), m("label", {
1084
- class: w({
1085
- "top-input": !0,
1086
- ["top-size_" + l.size]: !0,
1087
- "top-disabled": l.disabled,
1088
- ["top-input-" + l.modificator]: !!l.modificator,
1089
- "top-input-withCleaner": l.addCleaner && a.value && a.value !== "0000-00-00",
1090
- "top-formsCaptionWrapper": l.captionType !== "",
1091
- "top-formsCaptionWrapper-always": l.captionType === "top"
1092
- }),
1093
- "data-top-icon": l.icon,
1094
- "data-top-icon2": l.icon2
1095
- }, [
1096
- l.isLoading ? (u(), M(B(Xt), { key: 0 })) : g("", !0),
1097
- T(_("input", A({
1098
- type: "text",
1099
- class: {
1100
- "top-input_input": !0,
1101
- ["top-input_input-" + l.modificator]: !!l.modificator,
1102
- "top-forms-focusable": !l.disabled,
1103
- "top-error": l.isError
1104
- },
1105
- autocomplete: "off_always",
1106
- name: l.name,
1107
- "onUpdate:modelValue": f[0] || (f[0] = (r) => a.value = r),
1108
- title: l.title,
1109
- placeholder: o.value,
1110
- disabled: l.disabled,
1111
- readonly: l.readonly,
1112
- onKeydown: f[1] || (f[1] = he((r) => (l.addCleaner || !!l.$slots.btn) && i(r), ["esc"]))
1113
- }, l.$attrs), null, 16, Gt), [
1114
- [ne, a.value]
1115
- ]),
1116
- l.addCleaner && a.value && a.value !== "0000-00-00" ? (u(), m("span", {
1117
- key: 1,
1118
- class: "top-input_cleaner",
1119
- "data-top-icon": "",
1120
- onClick: be(i, ["prevent"])
1121
- })) : g("", !0),
1122
- l.captionType !== "" ? (u(), m("span", Kt, W(l.title), 1)) : g("", !0),
1123
- k(l.$slots, "default")
1124
- ], 10, qt));
1125
- }
1126
- }), Jt = {
1127
- "top-input": "top-input",
1128
- "top-input_input": "top-input_input",
1129
- "top-input-withCleaner": "top-input-withCleaner",
1130
- "top-input_cleaner": "top-input_cleaner",
1131
- "top-loadbar": "top-loadbar"
1132
- }, Zt = {
1133
- $style: Jt
1134
- }, j = /* @__PURE__ */ v(Qt, [["__cssModules", Zt]]);
1135
- export {
1136
- co as B,
1137
- p as C,
1138
- We as E,
1139
- rt as H,
1140
- j as I,
1141
- Xt as L,
1142
- wo as T,
1143
- Q as _,
1144
- v as a,
1145
- ge as b,
1146
- we as c,
1147
- L as d,
1148
- ve as e,
1149
- ye as f,
1150
- to as g,
1151
- oo as h,
1152
- eo as i,
1153
- so as j,
1154
- no as k,
1155
- ao as l,
1156
- io as m,
1157
- ro as n,
1158
- Ae as o,
1159
- po as p,
1160
- J as q,
1161
- uo as r,
1162
- lo as s,
1163
- mo as t,
1164
- U as u,
1165
- fo as v,
1166
- ho as w,
1167
- bo as x,
1168
- go as y,
1169
- vo as z
1170
- };
1171
- //# sourceMappingURL=forms-DKvPSbG6.es.js.map