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