@topvisor/ui 0.0.18 → 0.0.33

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