@topvisor/ui 0.9.2 → 0.9.3

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