@topvisor/ui 0.9.21 → 0.9.23
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-B28_yC8V.es.js +277 -0
- package/.chunks/datepicker-B28_yC8V.es.js.map +1 -0
- package/.chunks/datepicker-CDoo2d0x.amd.js +234 -0
- package/.chunks/datepicker-CDoo2d0x.amd.js.map +1 -0
- package/.chunks/forms-DNRGCC9P.amd.js +3 -0
- package/.chunks/forms-DNRGCC9P.amd.js.map +1 -0
- package/.chunks/{forms-gb7uf2K8.es.js → forms-U97cW1zp.es.js} +39 -39
- package/.chunks/forms-U97cW1zp.es.js.map +1 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-2TAzIZZA.amd.js → listItem.vue_vue_type_script_setup_true_lang-C67aHWhi.amd.js} +2 -2
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C67aHWhi.amd.js.map +1 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-Caw4oFU-.es.js → listItem.vue_vue_type_script_setup_true_lang-C_o5sC8m.es.js} +2 -2
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C_o5sC8m.es.js.map +1 -0
- package/.chunks/{popup-B-BAfp1v.es.js → popup-C1hmF9NI.es.js} +432 -442
- package/.chunks/popup-C1hmF9NI.es.js.map +1 -0
- package/.chunks/popup-Cg-GRa9u.amd.js +386 -0
- package/.chunks/popup-Cg-GRa9u.amd.js.map +1 -0
- package/.chunks/store-Bl79G7T_.amd.js.map +1 -1
- package/.chunks/store-PoMCiuBr.es.js.map +1 -1
- package/.chunks/{widgetInput-BxO9y9L7.amd.js → widgetInput-DgylW6NK.amd.js} +2 -2
- package/.chunks/widgetInput-DgylW6NK.amd.js.map +1 -0
- package/.chunks/{widgetInput-DPOH_qya.es.js → widgetInput-DmpYL1aA.es.js} +2 -2
- package/.chunks/widgetInput-DmpYL1aA.es.js.map +1 -0
- package/README.md +86 -86
- package/assets/dark.css +1 -1
- package/assets/forms.css +1 -1
- package/assets/light.css +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 +1 -1
- package/forms/helpers.amd.js.map +1 -1
- package/forms/helpers.js.map +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +4 -4
- package/formsExt/formsExt.js.map +1 -1
- package/icomoon/Read Me.txt +7 -7
- package/icomoon/demo-files/demo.css +161 -161
- package/icomoon/demo-files/demo.js +30 -30
- package/icomoon/demo.html +3225 -3211
- package/icomoon/fonts/Topvisor-2.svg +252 -251
- package/icomoon/fonts/Topvisor-2.ttf +0 -0
- package/icomoon/fonts/Topvisor-2.woff +0 -0
- package/icomoon/selection.json +1 -1
- package/icomoon/style.css +707 -704
- package/package.json +20 -20
- package/popup/popup.amd.js +1 -1
- package/popup/popup.js +2 -2
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +2 -2
- package/popup/worker.js.map +1 -1
- package/require/css.amd.js +11 -11
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.js +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +19 -18
- package/tabsView/tabsView.js.map +1 -1
- package/utils/css.amd.js.map +1 -1
- package/utils/css.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 +1 -1
- package/utils/dom.amd.js.map +1 -1
- package/utils/dom.js.map +1 -1
- package/utils/keyboard.amd.js.map +1 -1
- package/utils/keyboard.js.map +1 -1
- package/utils/route.amd.js.map +1 -1
- package/utils/route.js.map +1 -1
- package/utils/scroll.amd.js +1 -1
- package/utils/scroll.amd.js.map +1 -1
- package/utils/scroll.js +5 -5
- package/utils/scroll.js.map +1 -1
- package/utils/system.amd.js.map +1 -1
- package/utils/system.js.map +1 -1
- package/utils/window.amd.js +1 -1
- package/utils/window.js +1 -1
- package/.chunks/datepicker-B9eprAyk.amd.js +0 -234
- package/.chunks/datepicker-B9eprAyk.amd.js.map +0 -1
- package/.chunks/datepicker-C86O1mQq.es.js +0 -277
- package/.chunks/datepicker-C86O1mQq.es.js.map +0 -1
- package/.chunks/forms-DkNAMd-D.amd.js +0 -3
- package/.chunks/forms-DkNAMd-D.amd.js.map +0 -1
- package/.chunks/forms-gb7uf2K8.es.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-2TAzIZZA.amd.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-Caw4oFU-.es.js.map +0 -1
- package/.chunks/popup-B-BAfp1v.es.js.map +0 -1
- package/.chunks/popup-CV5MPPEu.amd.js +0 -396
- package/.chunks/popup-CV5MPPEu.amd.js.map +0 -1
- package/.chunks/widgetInput-BxO9y9L7.amd.js.map +0 -1
- package/.chunks/widgetInput-DPOH_qya.es.js.map +0 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { watch as k, toRef as g } from "vue";
|
|
2
|
+
import { C as a, d as m } from "./forms-U97cW1zp.es.js";
|
|
3
|
+
const h = `/* ui-datepicker */
|
|
4
|
+
.ui-datepicker {
|
|
5
|
+
--datepicker-day-color: #FFF;
|
|
6
|
+
--datepicker-day-color-hover: var(--color-blue-150);
|
|
7
|
+
--datepicker-selected-color: var(--color-blue-500);
|
|
8
|
+
--datepicker-selected-color-hover: var(--color-blue-550);
|
|
9
|
+
--datepicker-range-color: var(--color-blue-100);
|
|
10
|
+
--datepicker-range-color-hover: var(--color-blue-150);
|
|
11
|
+
|
|
12
|
+
user-select: none;
|
|
13
|
+
width: auto;
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ui-datepicker:before,
|
|
18
|
+
.ui-datepicker:after {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* на странице */
|
|
23
|
+
.ui-datepicker-inline {
|
|
24
|
+
display: inline-block !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* в popup */
|
|
28
|
+
.ui-datepicker:not(.ui-datepicker-inline) {
|
|
29
|
+
border-radius: 8px;
|
|
30
|
+
background: var(--content-background-color);
|
|
31
|
+
box-shadow: var(--top-shadow);
|
|
32
|
+
z-index: 10000000 !important;
|
|
33
|
+
padding: 8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ui-datepicker a {
|
|
37
|
+
text-decoration: none !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ui-datepicker option {
|
|
41
|
+
color: var(--color-text);
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ui-datepicker-header {
|
|
46
|
+
padding: 0 !important;
|
|
47
|
+
margin: 0 0 18px 0;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ui-datepicker-header > * {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ui-datepicker-title {
|
|
59
|
+
width: 100% !important;
|
|
60
|
+
height: 24px;
|
|
61
|
+
margin: 0 !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ui-datepicker-month,
|
|
65
|
+
.ui-datepicker-year {
|
|
66
|
+
outline: none !important;
|
|
67
|
+
width: auto !important;
|
|
68
|
+
border: none;
|
|
69
|
+
padding: 0;
|
|
70
|
+
margin: 0 6px !important;
|
|
71
|
+
text-align: center;
|
|
72
|
+
font-size: 16px !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ui-datepicker-month {
|
|
76
|
+
color: var(--color-text);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ui-datepicker-year {
|
|
80
|
+
color: var(--color-gray-300);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* select.ui-datepicker-month,
|
|
84
|
+
select.ui-datepicker-year{ cursor: pointer; color: var(--color-blue-500); }*/
|
|
85
|
+
select.ui-datepicker-month,
|
|
86
|
+
select.ui-datepicker-year {
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ui-datepicker-prev,
|
|
91
|
+
.ui-datepicker-next {
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
width: 24px !important;
|
|
94
|
+
height: 24px !important;
|
|
95
|
+
font-size: 24px;
|
|
96
|
+
font-family: 'Topvisor-2';
|
|
97
|
+
position: static !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ui-datepicker-prev:before {
|
|
101
|
+
content: '';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ui-datepicker-next {
|
|
105
|
+
order: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ui-datepicker-next:before {
|
|
109
|
+
content: '';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ui-datepicker-prev > *,
|
|
113
|
+
.ui-datepicker-next > * {
|
|
114
|
+
display: none !important;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ui-datepicker thead th {
|
|
118
|
+
width: auto !important;
|
|
119
|
+
padding: 0 !important;
|
|
120
|
+
color: #B3BEBF;
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
font-weight: 400 !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ui-datepicker table {
|
|
126
|
+
margin: 0 !important;
|
|
127
|
+
font-size: 14px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.ui-datepicker td {
|
|
131
|
+
background: none;
|
|
132
|
+
padding: 0 !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ui-datepicker td span,
|
|
136
|
+
.ui-datepicker td a {
|
|
137
|
+
border-radius: 8px;
|
|
138
|
+
border: none;
|
|
139
|
+
min-width: 32px;
|
|
140
|
+
height: 32px;
|
|
141
|
+
padding: 0;
|
|
142
|
+
margin: 1px;
|
|
143
|
+
color: var(--color-text) !important;
|
|
144
|
+
line-height: 32px;
|
|
145
|
+
text-align: center;
|
|
146
|
+
position: relative;
|
|
147
|
+
display: block;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* обычные даты */
|
|
151
|
+
.ui-datepicker td a {
|
|
152
|
+
background: var(--datepicker-day-color);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ui-datepicker td a:hover {
|
|
156
|
+
background: var(--datepicker-day-color-hover);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* текущий день */
|
|
160
|
+
td.ui-datepicker-today span,
|
|
161
|
+
td.ui-datepicker-today a {
|
|
162
|
+
background: none;
|
|
163
|
+
position: relative;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* выбранные даты */
|
|
167
|
+
.ui-datepicker td.selected a {
|
|
168
|
+
background: var(--datepicker-range-color);
|
|
169
|
+
padding-right: 0;
|
|
170
|
+
padding-left: 1px;
|
|
171
|
+
margin-right: 1px;
|
|
172
|
+
margin-left: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ui-datepicker td.selected a:hover {
|
|
176
|
+
background: var(--datepicker-range-color-hover);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.ui-datepicker td.selected:not(.selected-start):not(:first-child):not(.first-of-month) a {
|
|
180
|
+
border-top-left-radius: 0;
|
|
181
|
+
border-bottom-left-radius: 0;
|
|
182
|
+
padding-left: 1px;
|
|
183
|
+
margin-left: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ui-datepicker td.selected:not(.selected-end):not(:last-child):not(.last-of-month) a {
|
|
187
|
+
border-top-right-radius: 0;
|
|
188
|
+
border-bottom-right-radius: 0;
|
|
189
|
+
padding-right: 1px;
|
|
190
|
+
margin-right: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ui-datepicker td.selected-start a,
|
|
194
|
+
.ui-datepicker td.selected-end a,
|
|
195
|
+
.ui-datepicker td.ui-datepicker-current-day a {
|
|
196
|
+
background: var(--datepicker-selected-color);
|
|
197
|
+
color: #FFF !important;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ui-datepicker td.selected-start a:hover,
|
|
201
|
+
.ui-datepicker td.selected-end a:hover,
|
|
202
|
+
.ui-datepicker td.ui-datepicker-current-day a:hover {
|
|
203
|
+
background: var(--datepicker-selected-color-hover);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.ui-datepicker-day-marks {
|
|
207
|
+
line-height: normal;
|
|
208
|
+
position: absolute;
|
|
209
|
+
right: 0;
|
|
210
|
+
bottom: 3px;
|
|
211
|
+
left: 0;
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ui-datepicker-day-marks > i {
|
|
218
|
+
border-radius: 50%;
|
|
219
|
+
border: 1px solid #FFF;
|
|
220
|
+
width: 4px;
|
|
221
|
+
height: 4px;
|
|
222
|
+
margin: 0 2px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.ui-datepicker-day-marks-exists {
|
|
226
|
+
background: var(--color-blue-500);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.ui-datepicker-day-marks-update {
|
|
230
|
+
background: var(--color-red-500);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.ui-datepicker-row-break {
|
|
234
|
+
display: none;
|
|
235
|
+
}`;
|
|
236
|
+
a.appendStyle(h);
|
|
237
|
+
const b = (e) => {
|
|
238
|
+
var t, n;
|
|
239
|
+
if (!((n = (t = a.$) == null ? void 0 : t.ui) != null && n.datepicker)) {
|
|
240
|
+
console.info("Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker");
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
return a.$.datepicker.setDefaults({
|
|
244
|
+
dateFormat: a.state.dateFormat.toLowerCase().replace("m", "mm").replace("y", "yy").replace("d", "dd")
|
|
245
|
+
}), a.$(e);
|
|
246
|
+
};
|
|
247
|
+
function v(e, t) {
|
|
248
|
+
var n;
|
|
249
|
+
return (n = b(e)) == null ? void 0 : n.datepicker(t);
|
|
250
|
+
}
|
|
251
|
+
let d, l, p, u;
|
|
252
|
+
k(g(a.state.dateFormat), () => {
|
|
253
|
+
var e;
|
|
254
|
+
d = m("2000-01-01"), l = ((e = d.match(/\D/)) == null ? void 0 : e[0]) ?? "-", p = d.replace(/\D+/g, "").length, u = [];
|
|
255
|
+
for (let t = 0; t < d.length; t++)
|
|
256
|
+
d[t] === l && u.push(t);
|
|
257
|
+
}, { immediate: !0 });
|
|
258
|
+
function y(e) {
|
|
259
|
+
let t = e.target.selectionEnd, n = e.target.value, r = n.substring(0, t).replace(/\D+/g, ""), i = n.substring(t).replace(/\D+/g, ""), c = r.length + i.length - p;
|
|
260
|
+
if (c > 0) {
|
|
261
|
+
r = r.substring(0, p);
|
|
262
|
+
const o = p - r.length;
|
|
263
|
+
i = i.substring(i.length - o);
|
|
264
|
+
} else
|
|
265
|
+
c < 0 && (e.inputType === "deleteContentForward" ? r += "0".repeat(-c) : i = "0".repeat(-c) + i);
|
|
266
|
+
t = r.length, n = r + i;
|
|
267
|
+
for (let o = 0; o < u.length; o++) {
|
|
268
|
+
const s = u[o];
|
|
269
|
+
n = n.substring(0, s) + l + n.substring(s), t >= s && t++;
|
|
270
|
+
}
|
|
271
|
+
e.inputType === "deleteContentBackward" && n[t - 1] === l && t--, n !== e.target.value && (e.target.value = n, e.target.selectionStart = t, e.target.selectionEnd = t);
|
|
272
|
+
}
|
|
273
|
+
export {
|
|
274
|
+
v as connectDatepicker,
|
|
275
|
+
y as oninput
|
|
276
|
+
};
|
|
277
|
+
//# sourceMappingURL=datepicker-B28_yC8V.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datepicker-B28_yC8V.es.js","sources":["../../src/components/forms/inputDate/datepicker.css?raw","../../src/components/forms/inputDate/datepicker.ts"],"sourcesContent":["export default \"/* ui-datepicker */\\n.ui-datepicker {\\n\\t--datepicker-day-color: #FFF;\\n\\t--datepicker-day-color-hover: var(--color-blue-150);\\n\\t--datepicker-selected-color: var(--color-blue-500);\\n\\t--datepicker-selected-color-hover: var(--color-blue-550);\\n\\t--datepicker-range-color: var(--color-blue-100);\\n\\t--datepicker-range-color-hover: var(--color-blue-150);\\n\\n\\tuser-select: none;\\n\\twidth: auto;\\n\\tpadding: 0;\\n}\\n\\n.ui-datepicker:before,\\n.ui-datepicker:after {\\n\\tdisplay: none;\\n}\\n\\n/* на странице */\\n.ui-datepicker-inline {\\n\\tdisplay: inline-block !important;\\n}\\n\\n/* в popup */\\n.ui-datepicker:not(.ui-datepicker-inline) {\\n\\tborder-radius: 8px;\\n\\tbackground: var(--content-background-color);\\n\\tbox-shadow: var(--top-shadow);\\n\\tz-index: 10000000 !important;\\n\\tpadding: 8px;\\n}\\n\\n.ui-datepicker a {\\n\\ttext-decoration: none !important;\\n}\\n\\n.ui-datepicker option {\\n\\tcolor: var(--color-text);\\n\\tfont-size: 14px;\\n}\\n\\n.ui-datepicker-header {\\n\\tpadding: 0 !important;\\n\\tmargin: 0 0 18px 0;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n}\\n\\n.ui-datepicker-header > * {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n}\\n\\n.ui-datepicker-title {\\n\\twidth: 100% !important;\\n\\theight: 24px;\\n\\tmargin: 0 !important;\\n}\\n\\n.ui-datepicker-month,\\n.ui-datepicker-year {\\n\\toutline: none !important;\\n\\twidth: auto !important;\\n\\tborder: none;\\n\\tpadding: 0;\\n\\tmargin: 0 6px !important;\\n\\ttext-align: center;\\n\\tfont-size: 16px !important;\\n}\\n\\n.ui-datepicker-month {\\n\\tcolor: var(--color-text);\\n}\\n\\n.ui-datepicker-year {\\n\\tcolor: var(--color-gray-300);\\n}\\n\\n/*\\tselect.ui-datepicker-month,\\nselect.ui-datepicker-year{ cursor: pointer; color: var(--color-blue-500); }*/\\nselect.ui-datepicker-month,\\nselect.ui-datepicker-year {\\n\\tcursor: pointer;\\n}\\n\\n.ui-datepicker-prev,\\n.ui-datepicker-next {\\n\\tcursor: pointer;\\n\\twidth: 24px !important;\\n\\theight: 24px !important;\\n\\tfont-size: 24px;\\n\\tfont-family: 'Topvisor-2';\\n\\tposition: static !important;\\n}\\n\\n.ui-datepicker-prev:before {\\n\\tcontent: '';\\n}\\n\\n.ui-datepicker-next {\\n\\torder: 1;\\n}\\n\\n.ui-datepicker-next:before {\\n\\tcontent: '';\\n}\\n\\n.ui-datepicker-prev > *,\\n.ui-datepicker-next > * {\\n\\tdisplay: none !important;\\n}\\n\\n.ui-datepicker thead th {\\n\\twidth: auto !important;\\n\\tpadding: 0 !important;\\n\\tcolor: #B3BEBF;\\n\\tfont-size: 14px;\\n\\tfont-weight: 400 !important;\\n}\\n\\n.ui-datepicker table {\\n\\tmargin: 0 !important;\\n\\tfont-size: 14px;\\n}\\n\\n.ui-datepicker td {\\n\\tbackground: none;\\n\\tpadding: 0 !important;\\n}\\n\\n.ui-datepicker td span,\\n.ui-datepicker td a {\\n\\tborder-radius: 8px;\\n\\tborder: none;\\n\\tmin-width: 32px;\\n\\theight: 32px;\\n\\tpadding: 0;\\n\\tmargin: 1px;\\n\\tcolor: var(--color-text) !important;\\n\\tline-height: 32px;\\n\\ttext-align: center;\\n\\tposition: relative;\\n\\tdisplay: block;\\n}\\n\\n/* обычные даты */\\n.ui-datepicker td a {\\n\\tbackground: var(--datepicker-day-color);\\n}\\n\\n.ui-datepicker td a:hover {\\n\\tbackground: var(--datepicker-day-color-hover);\\n}\\n\\n/* текущий день */\\ntd.ui-datepicker-today span,\\ntd.ui-datepicker-today a {\\n\\tbackground: none;\\n\\tposition: relative;\\n}\\n\\n/* выбранные даты */\\n.ui-datepicker td.selected a {\\n\\tbackground: var(--datepicker-range-color);\\n\\tpadding-right: 0;\\n\\tpadding-left: 1px;\\n\\tmargin-right: 1px;\\n\\tmargin-left: 0;\\n}\\n\\n.ui-datepicker td.selected a:hover {\\n\\tbackground: var(--datepicker-range-color-hover);\\n}\\n\\n.ui-datepicker td.selected:not(.selected-start):not(:first-child):not(.first-of-month) a {\\n\\tborder-top-left-radius: 0;\\n\\tborder-bottom-left-radius: 0;\\n\\tpadding-left: 1px;\\n\\tmargin-left: 0;\\n}\\n\\n.ui-datepicker td.selected:not(.selected-end):not(:last-child):not(.last-of-month) a {\\n\\tborder-top-right-radius: 0;\\n\\tborder-bottom-right-radius: 0;\\n\\tpadding-right: 1px;\\n\\tmargin-right: 0;\\n}\\n\\n.ui-datepicker td.selected-start a,\\n.ui-datepicker td.selected-end a,\\n.ui-datepicker td.ui-datepicker-current-day a {\\n\\tbackground: var(--datepicker-selected-color);\\n\\tcolor: #FFF !important;\\n}\\n\\n.ui-datepicker td.selected-start a:hover,\\n.ui-datepicker td.selected-end a:hover,\\n.ui-datepicker td.ui-datepicker-current-day a:hover {\\n\\tbackground: var(--datepicker-selected-color-hover);\\n}\\n\\n.ui-datepicker-day-marks {\\n\\tline-height: normal;\\n\\tposition: absolute;\\n\\tright: 0;\\n\\tbottom: 3px;\\n\\tleft: 0;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n}\\n\\n.ui-datepicker-day-marks > i {\\n\\tborder-radius: 50%;\\n\\tborder: 1px solid #FFF;\\n\\twidth: 4px;\\n\\theight: 4px;\\n\\tmargin: 0 2px;\\n}\\n\\n.ui-datepicker-day-marks-exists {\\n\\tbackground: var(--color-blue-500);\\n}\\n\\n.ui-datepicker-day-marks-update {\\n\\tbackground: var(--color-red-500);\\n}\\n\\n.ui-datepicker-row-break {\\n\\tdisplay: none;\\n}\"","import { toRef, watch } from 'vue';\nimport Core from '@/core/core/core';\nimport { dateFormat } from '@/core/utils/date';\n\nimport css from '@/components/forms/inputDate/datepicker.css?raw';\n\nCore.appendStyle(css);\n\nconst $ = (el: HTMLInputElement) => {\n\tif (!Core.$?.ui?.datepicker) {\n\t\tconsole.info('Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker');\n\n\t\treturn;\n\t}\n\n\tCore.$.datepicker.setDefaults({\n\t\tdateFormat: Core.state.dateFormat.toLowerCase().replace('m', 'mm').replace('y', 'yy').replace('d', 'dd')\n\t});\n\n\treturn Core.$(el);\n};\n\nexport function connectDatepicker(el: HTMLInputElement, options: any) {\n\treturn $(el)?.datepicker(options);\n}\n\nlet dateFormatted;\nlet delimiter: string;\nlet dateNumbersCount: number;\nlet delimitersIndexes: number[];\n\nwatch(toRef(Core.state.dateFormat), () => {\n\t// генерация отформатированной даты, извлечение из нее разделителей и их индексов\n\tdateFormatted = dateFormat('2000-01-01');\n\tdelimiter = dateFormatted.match(/\\D/)?.[0] ?? '-';\n\tdateNumbersCount = dateFormatted.replace(/\\D+/g, '').length;\n\tdelimitersIndexes = [];\n\n\tfor (let i = 0; i < dateFormatted.length; i++) {\n\t\tif (dateFormatted[i] === delimiter) {\n\t\t\tdelimitersIndexes.push(i);\n\t\t}\n\t}\n}, { immediate: true });\n\n/**\n * Автоформат при вводе в поле с датой\n */\nexport function oninput(e: any) {\n\tlet selectionPos = e.target.selectionEnd;\n\tlet value = e.target.value;\n\n\t// разбить занчение на две половины - до и после каретки\n\t// удалить все символы, кроме цифр\n\tlet valueChunkLeft = value.substring(0, selectionPos).replace(/\\D+/g, '');\n\tlet valueChunkRight = value.substring(selectionPos).replace(/\\D+/g, '');\n\n\tlet extraNumbersCount = valueChunkLeft.length + valueChunkRight.length - dateNumbersCount;\n\tif (extraNumbersCount > 0) {\n\t\t// // количество цифр больше требуемого - удалить лишние\n\t\tvalueChunkLeft = valueChunkLeft.substring(0, dateNumbersCount);\n\n\t\tconst valueChunkRightMaxLength = dateNumbersCount - valueChunkLeft.length;\n\t\tvalueChunkRight = valueChunkRight.substring(valueChunkRight.length - valueChunkRightMaxLength);\n\t} else if (extraNumbersCount < 0) {\n\t\t// количество цифр меньше требуемого - добавить 0\n\t\tif (e.inputType === 'deleteContentForward') {\n\t\t\t// нажатие на delete - добавить к левой части для правильного позиционирования каретки\n\t\t\tvalueChunkLeft += '0'.repeat(-extraNumbersCount);\n\t\t} else {\n\t\t\tvalueChunkRight = '0'.repeat(-extraNumbersCount) + valueChunkRight;\n\t\t}\n\t}\n\n\tselectionPos = valueChunkLeft.length;\n\tvalue = valueChunkLeft + valueChunkRight;\n\n\t// вставить разделители\n\tfor (let i = 0; i < delimitersIndexes.length; i++) {\n\t\tconst delimiterIndex = delimitersIndexes[i];\n\n\t\tvalue = value.substring(0, delimiterIndex) + delimiter + value.substring(delimiterIndex);\n\n\t\t// сдвинуть каретку, если разделитель вставлен левее ее\n\t\tif (selectionPos >= delimiterIndex) {\n\t\t\tselectionPos++;\n\t\t}\n\t}\n\n\t// нажатие на backspace - если слева символ разделителя, перенести каретку за него\n\tif (e.inputType === 'deleteContentBackward' && value[selectionPos - 1] === delimiter) {\n\t\tselectionPos--;\n\t}\n\n\t// если значение изменилось - вставить его и переместить каретку\n\tif (value !== e.target.value) {\n\t\te.target.value = value;\n\t\te.target.selectionStart = selectionPos;\n\t\te.target.selectionEnd = selectionPos;\n\t}\n}"],"names":["css","Core","$","el","_b","_a","connectDatepicker","options","dateFormatted","delimiter","dateNumbersCount","delimitersIndexes","watch","toRef","dateFormat","i","oninput","selectionPos","value","valueChunkLeft","valueChunkRight","extraNumbersCount","valueChunkRightMaxLength","delimiterIndex"],"mappings":";;AAAA,MAAeA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACMfC,EAAK,YAAYD,CAAG;AAEpB,MAAME,IAAI,CAACC,MAAyB;;AACnC,MAAI,GAACC,KAAAC,IAAAJ,EAAK,MAAL,gBAAAI,EAAQ,OAAR,QAAAD,EAAY,aAAY;AAC5B,YAAQ,KAAK,0EAA0E;AAEvF;AAAA,EACD;AAEK,SAAAH,EAAA,EAAE,WAAW,YAAY;AAAA,IAC7B,YAAYA,EAAK,MAAM,WAAW,YAAA,EAAc,QAAQ,KAAK,IAAI,EAAE,QAAQ,KAAK,IAAI,EAAE,QAAQ,KAAK,IAAI;AAAA,EAAA,CACvG,GAEMA,EAAK,EAAEE,CAAE;AACjB;AAEgB,SAAAG,EAAkBH,GAAsBI,GAAc;;AACrE,UAAOF,IAAAH,EAAEC,CAAE,MAAJ,gBAAAE,EAAO,WAAWE;AAC1B;AAEA,IAAIC,GACAC,GACAC,GACAC;AAEJC,EAAMC,EAAMZ,EAAK,MAAM,UAAU,GAAG,MAAM;;AAEzC,EAAAO,IAAgBM,EAAW,YAAY,GACvCL,MAAYJ,IAAAG,EAAc,MAAM,IAAI,MAAxB,gBAAAH,EAA4B,OAAM,KAC9CK,IAAmBF,EAAc,QAAQ,QAAQ,EAAE,EAAE,QACrDG,IAAoB,CAAA;AAEpB,WAASI,IAAI,GAAGA,IAAIP,EAAc,QAAQO;AACrC,IAAAP,EAAcO,CAAC,MAAMN,KACxBE,EAAkB,KAAKI,CAAC;AAG3B,GAAG,EAAE,WAAW,GAAA,CAAM;AAKf,SAASC,EAAQ,GAAQ;AAC3B,MAAAC,IAAe,EAAE,OAAO,cACxBC,IAAQ,EAAE,OAAO,OAIjBC,IAAiBD,EAAM,UAAU,GAAGD,CAAY,EAAE,QAAQ,QAAQ,EAAE,GACpEG,IAAkBF,EAAM,UAAUD,CAAY,EAAE,QAAQ,QAAQ,EAAE,GAElEI,IAAoBF,EAAe,SAASC,EAAgB,SAASV;AACzE,MAAIW,IAAoB,GAAG;AAET,IAAAF,IAAAA,EAAe,UAAU,GAAGT,CAAgB;AAEvD,UAAAY,IAA2BZ,IAAmBS,EAAe;AACnE,IAAAC,IAAkBA,EAAgB,UAAUA,EAAgB,SAASE,CAAwB;AAAA,EAAA;AAC9F,IAAWD,IAAoB,MAE1B,EAAE,cAAc,yBAEDF,KAAA,IAAI,OAAO,CAACE,CAAiB,IAE/CD,IAAkB,IAAI,OAAO,CAACC,CAAiB,IAAID;AAIrD,EAAAH,IAAeE,EAAe,QAC9BD,IAAQC,IAAiBC;AAGzB,WAASL,IAAI,GAAGA,IAAIJ,EAAkB,QAAQI,KAAK;AAC5C,UAAAQ,IAAiBZ,EAAkBI,CAAC;AAElC,IAAAG,IAAAA,EAAM,UAAU,GAAGK,CAAc,IAAId,IAAYS,EAAM,UAAUK,CAAc,GAGnFN,KAAgBM,KACnBN;AAAA,EAEF;AAGA,EAAI,EAAE,cAAc,2BAA2BC,EAAMD,IAAe,CAAC,MAAMR,KAC1EQ,KAIGC,MAAU,EAAE,OAAO,UACtB,EAAE,OAAO,QAAQA,GACjB,EAAE,OAAO,iBAAiBD,GAC1B,EAAE,OAAO,eAAeA;AAE1B;"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
define(["require","exports","vue","./forms-DNRGCC9P.amd"],function(v,k,c,r){"use strict";if(typeof c>"u")var c=window.Vue;r.Core.appendStyle(`/* ui-datepicker */
|
|
2
|
+
.ui-datepicker {
|
|
3
|
+
--datepicker-day-color: #FFF;
|
|
4
|
+
--datepicker-day-color-hover: var(--color-blue-150);
|
|
5
|
+
--datepicker-selected-color: var(--color-blue-500);
|
|
6
|
+
--datepicker-selected-color-hover: var(--color-blue-550);
|
|
7
|
+
--datepicker-range-color: var(--color-blue-100);
|
|
8
|
+
--datepicker-range-color-hover: var(--color-blue-150);
|
|
9
|
+
|
|
10
|
+
user-select: none;
|
|
11
|
+
width: auto;
|
|
12
|
+
padding: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ui-datepicker:before,
|
|
16
|
+
.ui-datepicker:after {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* на странице */
|
|
21
|
+
.ui-datepicker-inline {
|
|
22
|
+
display: inline-block !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* в popup */
|
|
26
|
+
.ui-datepicker:not(.ui-datepicker-inline) {
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
background: var(--content-background-color);
|
|
29
|
+
box-shadow: var(--top-shadow);
|
|
30
|
+
z-index: 10000000 !important;
|
|
31
|
+
padding: 8px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ui-datepicker a {
|
|
35
|
+
text-decoration: none !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ui-datepicker option {
|
|
39
|
+
color: var(--color-text);
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ui-datepicker-header {
|
|
44
|
+
padding: 0 !important;
|
|
45
|
+
margin: 0 0 18px 0;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ui-datepicker-header > * {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ui-datepicker-title {
|
|
57
|
+
width: 100% !important;
|
|
58
|
+
height: 24px;
|
|
59
|
+
margin: 0 !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ui-datepicker-month,
|
|
63
|
+
.ui-datepicker-year {
|
|
64
|
+
outline: none !important;
|
|
65
|
+
width: auto !important;
|
|
66
|
+
border: none;
|
|
67
|
+
padding: 0;
|
|
68
|
+
margin: 0 6px !important;
|
|
69
|
+
text-align: center;
|
|
70
|
+
font-size: 16px !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ui-datepicker-month {
|
|
74
|
+
color: var(--color-text);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ui-datepicker-year {
|
|
78
|
+
color: var(--color-gray-300);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* select.ui-datepicker-month,
|
|
82
|
+
select.ui-datepicker-year{ cursor: pointer; color: var(--color-blue-500); }*/
|
|
83
|
+
select.ui-datepicker-month,
|
|
84
|
+
select.ui-datepicker-year {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ui-datepicker-prev,
|
|
89
|
+
.ui-datepicker-next {
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
width: 24px !important;
|
|
92
|
+
height: 24px !important;
|
|
93
|
+
font-size: 24px;
|
|
94
|
+
font-family: 'Topvisor-2';
|
|
95
|
+
position: static !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ui-datepicker-prev:before {
|
|
99
|
+
content: '';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ui-datepicker-next {
|
|
103
|
+
order: 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ui-datepicker-next:before {
|
|
107
|
+
content: '';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ui-datepicker-prev > *,
|
|
111
|
+
.ui-datepicker-next > * {
|
|
112
|
+
display: none !important;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ui-datepicker thead th {
|
|
116
|
+
width: auto !important;
|
|
117
|
+
padding: 0 !important;
|
|
118
|
+
color: #B3BEBF;
|
|
119
|
+
font-size: 14px;
|
|
120
|
+
font-weight: 400 !important;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ui-datepicker table {
|
|
124
|
+
margin: 0 !important;
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ui-datepicker td {
|
|
129
|
+
background: none;
|
|
130
|
+
padding: 0 !important;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.ui-datepicker td span,
|
|
134
|
+
.ui-datepicker td a {
|
|
135
|
+
border-radius: 8px;
|
|
136
|
+
border: none;
|
|
137
|
+
min-width: 32px;
|
|
138
|
+
height: 32px;
|
|
139
|
+
padding: 0;
|
|
140
|
+
margin: 1px;
|
|
141
|
+
color: var(--color-text) !important;
|
|
142
|
+
line-height: 32px;
|
|
143
|
+
text-align: center;
|
|
144
|
+
position: relative;
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* обычные даты */
|
|
149
|
+
.ui-datepicker td a {
|
|
150
|
+
background: var(--datepicker-day-color);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ui-datepicker td a:hover {
|
|
154
|
+
background: var(--datepicker-day-color-hover);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* текущий день */
|
|
158
|
+
td.ui-datepicker-today span,
|
|
159
|
+
td.ui-datepicker-today a {
|
|
160
|
+
background: none;
|
|
161
|
+
position: relative;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* выбранные даты */
|
|
165
|
+
.ui-datepicker td.selected a {
|
|
166
|
+
background: var(--datepicker-range-color);
|
|
167
|
+
padding-right: 0;
|
|
168
|
+
padding-left: 1px;
|
|
169
|
+
margin-right: 1px;
|
|
170
|
+
margin-left: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ui-datepicker td.selected a:hover {
|
|
174
|
+
background: var(--datepicker-range-color-hover);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.ui-datepicker td.selected:not(.selected-start):not(:first-child):not(.first-of-month) a {
|
|
178
|
+
border-top-left-radius: 0;
|
|
179
|
+
border-bottom-left-radius: 0;
|
|
180
|
+
padding-left: 1px;
|
|
181
|
+
margin-left: 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.ui-datepicker td.selected:not(.selected-end):not(:last-child):not(.last-of-month) a {
|
|
185
|
+
border-top-right-radius: 0;
|
|
186
|
+
border-bottom-right-radius: 0;
|
|
187
|
+
padding-right: 1px;
|
|
188
|
+
margin-right: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.ui-datepicker td.selected-start a,
|
|
192
|
+
.ui-datepicker td.selected-end a,
|
|
193
|
+
.ui-datepicker td.ui-datepicker-current-day a {
|
|
194
|
+
background: var(--datepicker-selected-color);
|
|
195
|
+
color: #FFF !important;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.ui-datepicker td.selected-start a:hover,
|
|
199
|
+
.ui-datepicker td.selected-end a:hover,
|
|
200
|
+
.ui-datepicker td.ui-datepicker-current-day a:hover {
|
|
201
|
+
background: var(--datepicker-selected-color-hover);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ui-datepicker-day-marks {
|
|
205
|
+
line-height: normal;
|
|
206
|
+
position: absolute;
|
|
207
|
+
right: 0;
|
|
208
|
+
bottom: 3px;
|
|
209
|
+
left: 0;
|
|
210
|
+
display: flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
justify-content: center;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.ui-datepicker-day-marks > i {
|
|
216
|
+
border-radius: 50%;
|
|
217
|
+
border: 1px solid #FFF;
|
|
218
|
+
width: 4px;
|
|
219
|
+
height: 4px;
|
|
220
|
+
margin: 0 2px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.ui-datepicker-day-marks-exists {
|
|
224
|
+
background: var(--color-blue-500);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.ui-datepicker-day-marks-update {
|
|
228
|
+
background: var(--color-red-500);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.ui-datepicker-row-break {
|
|
232
|
+
display: none;
|
|
233
|
+
}`);const h=e=>{var t,n;if(!((n=(t=r.Core.$)==null?void 0:t.ui)!=null&&n.datepicker)){console.info("Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker");return}return r.Core.$.datepicker.setDefaults({dateFormat:r.Core.state.dateFormat.toLowerCase().replace("m","mm").replace("y","yy").replace("d","dd")}),r.Core.$(e)};function m(e,t){var n;return(n=h(e))==null?void 0:n.datepicker(t)}let o,p,l,u;c.watch(c.toRef(r.Core.state.dateFormat),()=>{var e;o=r.dateFormat("2000-01-01"),p=((e=o.match(/\D/))==null?void 0:e[0])??"-",l=o.replace(/\D+/g,"").length,u=[];for(let t=0;t<o.length;t++)o[t]===p&&u.push(t)},{immediate:!0});function b(e){let t=e.target.selectionEnd,n=e.target.value,i=n.substring(0,t).replace(/\D+/g,""),a=n.substring(t).replace(/\D+/g,""),s=i.length+a.length-l;if(s>0){i=i.substring(0,l);const d=l-i.length;a=a.substring(a.length-d)}else s<0&&(e.inputType==="deleteContentForward"?i+="0".repeat(-s):a="0".repeat(-s)+a);t=i.length,n=i+a;for(let d=0;d<u.length;d++){const g=u[d];n=n.substring(0,g)+p+n.substring(g),t>=g&&t++}e.inputType==="deleteContentBackward"&&n[t-1]===p&&t--,n!==e.target.value&&(e.target.value=n,e.target.selectionStart=t,e.target.selectionEnd=t)}k.connectDatepicker=m,k.oninput=b,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
|
234
|
+
//# sourceMappingURL=datepicker-CDoo2d0x.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datepicker-CDoo2d0x.amd.js","sources":["../../src/components/forms/inputDate/datepicker.ts","../../src/components/forms/inputDate/datepicker.css?raw"],"sourcesContent":["import { toRef, watch } from 'vue';\nimport Core from '@/core/core/core';\nimport { dateFormat } from '@/core/utils/date';\n\nimport css from '@/components/forms/inputDate/datepicker.css?raw';\n\nCore.appendStyle(css);\n\nconst $ = (el: HTMLInputElement) => {\n\tif (!Core.$?.ui?.datepicker) {\n\t\tconsole.info('Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker');\n\n\t\treturn;\n\t}\n\n\tCore.$.datepicker.setDefaults({\n\t\tdateFormat: Core.state.dateFormat.toLowerCase().replace('m', 'mm').replace('y', 'yy').replace('d', 'dd')\n\t});\n\n\treturn Core.$(el);\n};\n\nexport function connectDatepicker(el: HTMLInputElement, options: any) {\n\treturn $(el)?.datepicker(options);\n}\n\nlet dateFormatted;\nlet delimiter: string;\nlet dateNumbersCount: number;\nlet delimitersIndexes: number[];\n\nwatch(toRef(Core.state.dateFormat), () => {\n\t// генерация отформатированной даты, извлечение из нее разделителей и их индексов\n\tdateFormatted = dateFormat('2000-01-01');\n\tdelimiter = dateFormatted.match(/\\D/)?.[0] ?? '-';\n\tdateNumbersCount = dateFormatted.replace(/\\D+/g, '').length;\n\tdelimitersIndexes = [];\n\n\tfor (let i = 0; i < dateFormatted.length; i++) {\n\t\tif (dateFormatted[i] === delimiter) {\n\t\t\tdelimitersIndexes.push(i);\n\t\t}\n\t}\n}, { immediate: true });\n\n/**\n * Автоформат при вводе в поле с датой\n */\nexport function oninput(e: any) {\n\tlet selectionPos = e.target.selectionEnd;\n\tlet value = e.target.value;\n\n\t// разбить занчение на две половины - до и после каретки\n\t// удалить все символы, кроме цифр\n\tlet valueChunkLeft = value.substring(0, selectionPos).replace(/\\D+/g, '');\n\tlet valueChunkRight = value.substring(selectionPos).replace(/\\D+/g, '');\n\n\tlet extraNumbersCount = valueChunkLeft.length + valueChunkRight.length - dateNumbersCount;\n\tif (extraNumbersCount > 0) {\n\t\t// // количество цифр больше требуемого - удалить лишние\n\t\tvalueChunkLeft = valueChunkLeft.substring(0, dateNumbersCount);\n\n\t\tconst valueChunkRightMaxLength = dateNumbersCount - valueChunkLeft.length;\n\t\tvalueChunkRight = valueChunkRight.substring(valueChunkRight.length - valueChunkRightMaxLength);\n\t} else if (extraNumbersCount < 0) {\n\t\t// количество цифр меньше требуемого - добавить 0\n\t\tif (e.inputType === 'deleteContentForward') {\n\t\t\t// нажатие на delete - добавить к левой части для правильного позиционирования каретки\n\t\t\tvalueChunkLeft += '0'.repeat(-extraNumbersCount);\n\t\t} else {\n\t\t\tvalueChunkRight = '0'.repeat(-extraNumbersCount) + valueChunkRight;\n\t\t}\n\t}\n\n\tselectionPos = valueChunkLeft.length;\n\tvalue = valueChunkLeft + valueChunkRight;\n\n\t// вставить разделители\n\tfor (let i = 0; i < delimitersIndexes.length; i++) {\n\t\tconst delimiterIndex = delimitersIndexes[i];\n\n\t\tvalue = value.substring(0, delimiterIndex) + delimiter + value.substring(delimiterIndex);\n\n\t\t// сдвинуть каретку, если разделитель вставлен левее ее\n\t\tif (selectionPos >= delimiterIndex) {\n\t\t\tselectionPos++;\n\t\t}\n\t}\n\n\t// нажатие на backspace - если слева символ разделителя, перенести каретку за него\n\tif (e.inputType === 'deleteContentBackward' && value[selectionPos - 1] === delimiter) {\n\t\tselectionPos--;\n\t}\n\n\t// если значение изменилось - вставить его и переместить каретку\n\tif (value !== e.target.value) {\n\t\te.target.value = value;\n\t\te.target.selectionStart = selectionPos;\n\t\te.target.selectionEnd = selectionPos;\n\t}\n}","export default \"/* ui-datepicker */\\n.ui-datepicker {\\n\\t--datepicker-day-color: #FFF;\\n\\t--datepicker-day-color-hover: var(--color-blue-150);\\n\\t--datepicker-selected-color: var(--color-blue-500);\\n\\t--datepicker-selected-color-hover: var(--color-blue-550);\\n\\t--datepicker-range-color: var(--color-blue-100);\\n\\t--datepicker-range-color-hover: var(--color-blue-150);\\n\\n\\tuser-select: none;\\n\\twidth: auto;\\n\\tpadding: 0;\\n}\\n\\n.ui-datepicker:before,\\n.ui-datepicker:after {\\n\\tdisplay: none;\\n}\\n\\n/* на странице */\\n.ui-datepicker-inline {\\n\\tdisplay: inline-block !important;\\n}\\n\\n/* в popup */\\n.ui-datepicker:not(.ui-datepicker-inline) {\\n\\tborder-radius: 8px;\\n\\tbackground: var(--content-background-color);\\n\\tbox-shadow: var(--top-shadow);\\n\\tz-index: 10000000 !important;\\n\\tpadding: 8px;\\n}\\n\\n.ui-datepicker a {\\n\\ttext-decoration: none !important;\\n}\\n\\n.ui-datepicker option {\\n\\tcolor: var(--color-text);\\n\\tfont-size: 14px;\\n}\\n\\n.ui-datepicker-header {\\n\\tpadding: 0 !important;\\n\\tmargin: 0 0 18px 0;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n}\\n\\n.ui-datepicker-header > * {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n}\\n\\n.ui-datepicker-title {\\n\\twidth: 100% !important;\\n\\theight: 24px;\\n\\tmargin: 0 !important;\\n}\\n\\n.ui-datepicker-month,\\n.ui-datepicker-year {\\n\\toutline: none !important;\\n\\twidth: auto !important;\\n\\tborder: none;\\n\\tpadding: 0;\\n\\tmargin: 0 6px !important;\\n\\ttext-align: center;\\n\\tfont-size: 16px !important;\\n}\\n\\n.ui-datepicker-month {\\n\\tcolor: var(--color-text);\\n}\\n\\n.ui-datepicker-year {\\n\\tcolor: var(--color-gray-300);\\n}\\n\\n/*\\tselect.ui-datepicker-month,\\nselect.ui-datepicker-year{ cursor: pointer; color: var(--color-blue-500); }*/\\nselect.ui-datepicker-month,\\nselect.ui-datepicker-year {\\n\\tcursor: pointer;\\n}\\n\\n.ui-datepicker-prev,\\n.ui-datepicker-next {\\n\\tcursor: pointer;\\n\\twidth: 24px !important;\\n\\theight: 24px !important;\\n\\tfont-size: 24px;\\n\\tfont-family: 'Topvisor-2';\\n\\tposition: static !important;\\n}\\n\\n.ui-datepicker-prev:before {\\n\\tcontent: '';\\n}\\n\\n.ui-datepicker-next {\\n\\torder: 1;\\n}\\n\\n.ui-datepicker-next:before {\\n\\tcontent: '';\\n}\\n\\n.ui-datepicker-prev > *,\\n.ui-datepicker-next > * {\\n\\tdisplay: none !important;\\n}\\n\\n.ui-datepicker thead th {\\n\\twidth: auto !important;\\n\\tpadding: 0 !important;\\n\\tcolor: #B3BEBF;\\n\\tfont-size: 14px;\\n\\tfont-weight: 400 !important;\\n}\\n\\n.ui-datepicker table {\\n\\tmargin: 0 !important;\\n\\tfont-size: 14px;\\n}\\n\\n.ui-datepicker td {\\n\\tbackground: none;\\n\\tpadding: 0 !important;\\n}\\n\\n.ui-datepicker td span,\\n.ui-datepicker td a {\\n\\tborder-radius: 8px;\\n\\tborder: none;\\n\\tmin-width: 32px;\\n\\theight: 32px;\\n\\tpadding: 0;\\n\\tmargin: 1px;\\n\\tcolor: var(--color-text) !important;\\n\\tline-height: 32px;\\n\\ttext-align: center;\\n\\tposition: relative;\\n\\tdisplay: block;\\n}\\n\\n/* обычные даты */\\n.ui-datepicker td a {\\n\\tbackground: var(--datepicker-day-color);\\n}\\n\\n.ui-datepicker td a:hover {\\n\\tbackground: var(--datepicker-day-color-hover);\\n}\\n\\n/* текущий день */\\ntd.ui-datepicker-today span,\\ntd.ui-datepicker-today a {\\n\\tbackground: none;\\n\\tposition: relative;\\n}\\n\\n/* выбранные даты */\\n.ui-datepicker td.selected a {\\n\\tbackground: var(--datepicker-range-color);\\n\\tpadding-right: 0;\\n\\tpadding-left: 1px;\\n\\tmargin-right: 1px;\\n\\tmargin-left: 0;\\n}\\n\\n.ui-datepicker td.selected a:hover {\\n\\tbackground: var(--datepicker-range-color-hover);\\n}\\n\\n.ui-datepicker td.selected:not(.selected-start):not(:first-child):not(.first-of-month) a {\\n\\tborder-top-left-radius: 0;\\n\\tborder-bottom-left-radius: 0;\\n\\tpadding-left: 1px;\\n\\tmargin-left: 0;\\n}\\n\\n.ui-datepicker td.selected:not(.selected-end):not(:last-child):not(.last-of-month) a {\\n\\tborder-top-right-radius: 0;\\n\\tborder-bottom-right-radius: 0;\\n\\tpadding-right: 1px;\\n\\tmargin-right: 0;\\n}\\n\\n.ui-datepicker td.selected-start a,\\n.ui-datepicker td.selected-end a,\\n.ui-datepicker td.ui-datepicker-current-day a {\\n\\tbackground: var(--datepicker-selected-color);\\n\\tcolor: #FFF !important;\\n}\\n\\n.ui-datepicker td.selected-start a:hover,\\n.ui-datepicker td.selected-end a:hover,\\n.ui-datepicker td.ui-datepicker-current-day a:hover {\\n\\tbackground: var(--datepicker-selected-color-hover);\\n}\\n\\n.ui-datepicker-day-marks {\\n\\tline-height: normal;\\n\\tposition: absolute;\\n\\tright: 0;\\n\\tbottom: 3px;\\n\\tleft: 0;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n}\\n\\n.ui-datepicker-day-marks > i {\\n\\tborder-radius: 50%;\\n\\tborder: 1px solid #FFF;\\n\\twidth: 4px;\\n\\theight: 4px;\\n\\tmargin: 0 2px;\\n}\\n\\n.ui-datepicker-day-marks-exists {\\n\\tbackground: var(--color-blue-500);\\n}\\n\\n.ui-datepicker-day-marks-update {\\n\\tbackground: var(--color-red-500);\\n}\\n\\n.ui-datepicker-row-break {\\n\\tdisplay: none;\\n}\""],"names":["Core","$","el","forms","connectDatepicker","options","dateFormatted","delimiter","dateNumbersCount","delimitersIndexes","watch","_a","i","valueChunkLeft","value","selectionPos","valueChunkRight","extraNumbersCount","valueChunkRightMaxLength","delimiterIndex"],"mappings":"0HAMAA,EAAAA,KAAAA,YCNA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EDMAA,EAEA,MAAAC,EAAAC,GAAA,uEAEE,QAAA,KAAA,0EAAA,EAEA,OAGD,OAAAC,EAAA,KAAA,EAAA,WAAA,YAAA,CAA8B,WAAAA,EAAA,KAAA,MAAA,WAAA,YAAA,EAAA,QAAA,IAAA,IAAA,EAAA,QAAA,IAAA,IAAA,EAAA,QAAA,IAAA,IAAA,CAC0E,CAAA,EAGxGA,EAAA,KAAA,EAAAD,CAAA,CACD,EAEgB,SAAAE,EAAAF,EAAAG,EAAA,mDAIhB,IAAAC,EACAC,EACAC,EACAC,EAEAC,EAAAA,MAAAA,EAAAA,MAAAA,EAAAA,KAAAA,MAAAA,UAAAA,EAAAA,IAAAA,OAECJ,EAAAH,EAAA,WAAA,YAAA,EACAI,IAAAI,EAAAL,EAAA,MAAA,IAAA,IAAA,YAAAK,EAAA,KAAA,IACAH,EAAAF,EAAA,QAAA,OAAA,EAAA,EAAA,YAGA,QAAAM,EAAA,EAAAA,EAAAN,EAAA,OAAAM,IACCN,EAAAM,CAAA,IAAAL,GACCE,EAAA,KAAAG,CAAA,CAGH,EAAA,CAAA,UAAA,EAAA,CAAA,6DAWCC,EAAAC,EAAA,UAAA,EAAAC,CAAA,EAAA,QAAA,OAAA,EAAA,EACAC,EAAAF,EAAA,UAAAC,CAAA,EAAA,QAAA,OAAA,EAAA,EAEAE,EAAAJ,EAAA,OAAAG,EAAA,OAAAR,EACA,GAAAS,EAAA,EAAA,uCAKCD,EAAAA,EAAA,UAAAA,EAAA,OAAAE,CAAA,CAA6F,MAAAD,EAAA,IAG7F,EAAA,YAAA,6DAQDF,EAAAF,EAAA,OACAC,EAAAD,EAAAG,EAGA,QAAAJ,EAAA,EAAAA,EAAAH,EAAA,OAAAG,IAAA,CACC,MAAAO,EAAAV,EAAAG,CAAA,EAEAE,EAAAA,EAAA,UAAA,EAAAK,CAAA,EAAAZ,EAAAO,EAAA,UAAAK,CAAA,EAGAJ,GAAAI,OAMD,EAAA,YAAA,yBAAAL,EAAAC,EAAA,CAAA,IAAAR,4BAMC,EAAA,OAAA,MAAAO,EACA,EAAA,OAAA,eAAAC,EACA,EAAA,OAAA,aAAAA,EAEF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
define(["require","exports","vue","../require/css.amd!../assets/forms.css"],function(O,u,e){"use strict";var A,W;if(typeof e>"u")var e=window.Vue;function S(){return"devicePixelRatio"in window&&window.devicePixelRatio>1}function E(){return!!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|IEMobile|Opera Mini/i)}function C(){return navigator.userAgent.indexOf("Topvisor_App")!=-1}function z(){return navigator.userAgent.indexOf("Mac OS X")!==-1}function H(){const n=/Chrome|Android/.test(navigator.userAgent);let o=/Safari/.test(navigator.userAgent);return n&&o&&(o=!1),o}function I(){return z()?"⌘":"Ctrl"}class U{}const Y=100;let L;const w=new Map,g={width:window.innerWidth,height:window.innerHeight};function j(n){w.set(n,n)}function q(n){w.delete(n)}function K(n){clearTimeout(L),L=setTimeout(function(){n.topEvent={widthDiff:g.width-window.innerWidth,hightDiff:g.height-window.innerHeight},g.width=window.innerWidth,g.height=window.innerHeight,w.forEach(o=>o(n))},Y)}window.addEventListener("resize",K);const D={addOnReize:j,removeOnResize:q},G={widthForMobile:900,dateFormat:"Y-m-d",gmt:(A=new Date().toString().match(/GMT(\S+)/))==null?void 0:A[1]},Q={isMobile:!1,isMobileUA:!1,isRetina:!1,isApp:!1,isLandscape:!0,isPortrait:!1,size:0,dateFormat:"Y-m-d",gmt:(W=new Date().toString().match(/GMT(\S+)/))==null?void 0:W[1]},_=n=>{var o,a;if(!((a=(o=p.$)==null?void 0:o.ui)!=null&&a.tooltip)){console.info("Для работы v-top-tooltip требуется глобальная загрузка jQuery UI Tooltip");return}return p.$(n)},N=(n,o)=>{var s;const a=n.value??{};return a.content??=(s=o.props)==null?void 0:s.title,a.content=String(a.content).replace(/\r\n|\r|\n/g,"<br>"),a.position??={my:"bottom-18px",at:"top center"},a},X={mounted(n,o,a){var s;(s=_(n))==null||s.tooltip(N(o,a))},updated(n,o,a,s){var c;const i=N(o,a),t=(c=_(n))==null?void 0:c.tooltip("instance");t&&(t.options={...t.options,...i})},unmounted(n,o,a){var s;(s=_(n))==null||s.tooltip("destroy")}},B=typeof window>"u"?{}:window;class p{static L=e.reactive({Not_date:"Not date"});static page=B.page??{};static Page=U;static options=G;static state=e.reactive({...Q});static matchMediaIsMobile;static $=B.$;static appendStyle(o,a=""){let s="all";a==="m"&&(s="(max-width: "+this.options.widthForMobile+"px)"),a==="pc"&&(s="(min-width: "+this.options.widthForMobile+"px)");const i=document.createElement("style");i.innerHTML=o,i.media=s,document.head.append(i)}static install(o,a){p.defineOptions(a),o.provide("top-core",p),this.installDirectives(o)}static installDirectives(o){o.directive("top-tooltip",X)}static defineOptions(o){o!=null&&o.widthForMobile&&(this.options.widthForMobile=o.widthForMobile),o!=null&&o.dateFormat&&(this.options.dateFormat=o.dateFormat),o!=null&&o.gmt&&(this.options.gmt=o.gmt),p.setState()}static setState(){p.matchMediaIsMobile=window.matchMedia(`(max-width: ${p.options.widthForMobile}px)`),p.state.isMobileUA=E(),p.state.isRetina=S(),p.state.isApp=C(),p.state.dateFormat=this.options.dateFormat,p.state.gmt=this.options.gmt,p.setStateByWindowSize(),D.addOnReize(p.onResize),p.onResize(),p.saveToCookie()}static onResize(){p.setStateByWindowSize(),document.documentElement.style.setProperty("--100vh",window.innerHeight+"px")}static setStateByWindowSize(){var o;p.state.isMobile=!!((o=p.matchMediaIsMobile)!=null&&o.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()}static saveToCookie(){const o=[1,window.innerWidth,window.innerHeight,window.devicePixelRatio,Number(p.state.isMobile),Number(p.state.isRetina)];document.cookie="device="+o.join(",")+"; path=/;"}}function J(n){return n.indexOf("T")===-1&&(n.length==10&&(n+=" 00:00:00"),n=n.replace(" ","T")+p.state.gmt),new Date(n)}function T(n=void 0,o=!0,a=0){let s;n!=null?s=new Date(n):s=new Date;const i=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),c=s.getDate().toString().padStart(2,"0"),r=s.getHours().toString().padStart(2,"0"),b=s.getMinutes().toString().padStart(2,"0"),d=s.getSeconds().toString().padStart(2,"0");return s=i+"-"+t+"-"+c,a&&(s+=" "),a>=1&&(s+=r),a>=2&&(s+=":"+b),a>=3&&(s+=":"+d),o&&(s=y(s,a)),s}function y(n,o=2,a=p.L.Not_date){if((!n||n.substring(0,10)==="0000-00-00")&&a&&a!=="0000-00-00")return a;const s=p.state.dateFormat.toLowerCase();let i=n.substring(0,10);i.length===7&&(i+="-01"),i+=" 00:00",i=i.replace(/-/g,"/");const t=new Date(i);if(isNaN(Number(t)))return a;let c=s.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"));if(n.length>10)switch(o){case 1:c+=" "+n.substring(11,13);break;case 2:c+=" "+n.substring(11,16);break;case 3:c+=" "+n.substring(11,19);break}return c}function M(n,o=p.L.Not_date){if(!n)return o;if(n.match(/\d\d\d\d-\d\d-\d\d/))return n;const a=p.state.dateFormat.toLowerCase(),s=n.split(/\W/),i=a.split(/\W/);let t="",c="",r="";i.forEach((d,l)=>{switch(d){case"d":t=s[l];break;case"m":c=s[l];break;case"y":r=s[l];break}});let b=r+"-"+c+"-"+t;return b.match(/\d\d\d\d-\d\d-\d\d/)||(console.info("Неверный формат даты, будет возращена текущая дата, "+b),b=T(new Date().getTime(),!1).substring(0,10)),b}const Z={class:"top-avatar"},x=["src","title"],ee=["title"],te=e.defineComponent({__name:"avatar",props:{size:{default:64},image:{},nickname:{},isOnline:{type:Boolean},lastActiveTime:{}},setup(n){e.useCssVars(i=>({"566609b7":i.size+"px"}));const o=n,a={user:{Online:"Онлайн",LastSeen:"Заходил(а)"}},s=e.computed(()=>{if(o.isOnline)return a.user.Online;if(o.lastActiveTime)return a.user.LastSeen+": "+y(o.lastActiveTime,2)});return(i,t)=>(e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("img",{class:"top-avatar_image",src:i.image,title:o.nickname+(s.value?`
|
|
2
|
+
${s.value}`:""),alt:""},null,8,x),i.isOnline?(e.openBlock(),e.createElementBlock("div",{key:0,class:"top-avatar_status",title:s.value},null,8,ee)):e.createCommentVNode("",!0)]))}}),oe={"top-avatar":"top-avatar","top-avatar_image":"top-avatar_image","top-avatar_status":"top-avatar_status"},h=(n,o)=>{const a=n.__vccOpts||n;for(const[s,i]of o)a[s]=i;return a},ae=h(te,[["__cssModules",{$style:oe}]]),ne={key:0,class:"top-ellipsis"},se=h(e.defineComponent({__name:"button",props:{color:{default:"blue"},styling:{default:""},size:{default:"s"},name:{},title:{},icon:{},icon2:{},href:{},disabled:{type:Boolean},isSubmit:{type:Boolean},isActive:{type:Boolean},isProgress:{type:Boolean}},setup(n){const o=n,a=e.computed(()=>o.href?"a":"button"),s=e.computed(()=>o.isSubmit?"submit":void 0);return(i,t)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value),{class:e.normalizeClass({"top-active":i.isActive,"top-disabled":i.disabled,"top-forms-focusable":!i.disabled,"top-button":!0,"top-button-progress":i.isProgress,[`top-size_${i.size}`]:!!i.size,[`top-color_${i.color}`]:!0,[`top-style_${i.styling}`]:!!i.styling,"top-button-withoutText":!i.$slots.default}),name:i.name,title:i.title,href:i.href,type:s.value,"data-top-icon":i.icon||void 0,"data-top-icon2":i.icon2||void 0,disabled:i.disabled||void 0,inProgress:i.isProgress},{default:e.withCtx(()=>[i.$slots.default?(e.openBlock(),e.createElementBlock("span",ne,[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.icon?"":"Button"),1)])])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"html")]),_:3},8,["class","name","title","href","type","data-top-icon","data-top-icon2","disabled","inProgress"]))}}),[["__cssModules",{$style:{"top-button":"top-button","top-active":"top-active","top-button-progress":"top-button-progress",progress:"_progress_1hqxk_1","top-button-withoutText":"top-button-withoutText","top-color_blue":"top-color_blue","top-color_green":"top-color_green","top-color_orange":"top-color_orange","top-color_red":"top-color_red","top-color_pink":"top-color_pink","top-color_theme":"top-color_theme","top-style_outline":"top-style_outline","top-style_soft":"top-style_soft","top-style_transparent":"top-style_transparent","top-size_l":"top-size_l","top-size_xl":"top-size_xl"}}]]),ie={class:"top-forms-optionLabel"},k=h(e.defineComponent({__name:"controlLabel",props:{description:{},disabled:{type:Boolean}},setup(n){return(o,a)=>(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("div",{class:e.normalizeClass({"top-forms-optionLabel_title":!0,"top-forms-optionLabel_title-disabled":o.disabled})},[e.renderSlot(o.$slots,"default")],2),o.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["top-forms-optionLabel_description",{"top-forms-optionLabel_description-disabled":o.disabled}])},e.toDisplayString(o.description),3)):e.createCommentVNode("",!0)]))}}),[["__cssModules",{$style:{"top-forms-optionLabel":"top-forms-optionLabel","top-forms-optionLabel_title":"top-forms-optionLabel_title","top-forms-optionLabel_title-disabled":"top-forms-optionLabel_title-disabled","top-forms-optionLabel_description":"top-forms-optionLabel_description","top-forms-optionLabel_description-disabled":"top-forms-optionLabel_description-disabled"}}]]),le=["name","value","indeterminate","disabled"],re=h(e.defineComponent({__name:"checkbox",props:e.mergeModels({modelValue:{type:[Boolean,Array,Set]},name:{},value:{},description:{},disabled:{type:Boolean},indeterminate:{type:Boolean},isError:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const o=e.useModel(n,"modelValue");return(a,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-forms-optionWrapper":!0,"top-checkbox":!0,["top-checkbox_"+a.name]:!!a.name,"top-disabled":a.disabled,"top-error":a.isError&&!a.disabled})},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:e.normalizeClass({"top-forms-focusable":!a.disabled,"top-forms-option":!0,"top-checkbox_input":!0,"top-error":a.isError&&!a.disabled}),name:a.name,"onUpdate:modelValue":s[0]||(s[0]=i=>o.value=i),value:a.value,indeterminate:a.indeterminate,disabled:a.disabled},null,10,le),[[e.vModelCheckbox,o.value]]),a.$slots.default?(e.openBlock(),e.createBlock(k,{key:0,description:a.description,disabled:a.disabled},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["description","disabled"])):e.createCommentVNode("",!0)],2))}}),[["__cssModules",{$style:{"top-checkbox":"top-checkbox","top-checkbox_input":"top-checkbox_input","top-error":"top-error"}}]]),de=["title"],F=h(e.defineComponent({__name:"hint",props:{hint:{}},setup(n){return(o,a)=>(e.openBlock(),e.createElementBlock("span",{class:"top-hint","data-top-icon":"",title:o.hint},null,8,de))}}),[["__cssModules",{$style:{"top-hint":"top-hint"}}]]),pe=["data-top-icon","data-top-icon2"],ce=["name","title","placeholder","disabled","readonly"],ue={key:2,class:"top-formsCaption"},V=h(e.defineComponent({inheritAttrs:!1,__name:"input",props:{modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},modificator:{},size:{default:"s"},isError:{type:Boolean},isLoading:{type:Boolean},icon:{},icon2:{},addCleaner:{type:Boolean},title:{},captionType:{default:""}},emits:["update:modelValue"],setup(n,{emit:o}){const a=n,s=o,i=e.computed({get(){return a.modelValue},set(r){s("update:modelValue",r)}}),t=e.computed(()=>a.addCleaner&&!a.title||a.captionType!==""?"":a.title),c=r=>{a.modelValue&&r.stopPropagation(),s("update:modelValue","")};return(r,b)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-input":!0,["top-size_"+r.size]:!0,"top-disabled":r.disabled,["top-input-"+r.modificator]:!!r.modificator,"top-input-withCleaner":r.addCleaner&&i.value&&i.value!=="0000-00-00","top-formsCaptionWrapper":r.captionType!=="","top-formsCaptionWrapper-always":r.captionType==="top"}),"data-top-icon":r.icon,"data-top-icon2":r.icon2},[r.isLoading?(e.openBlock(),e.createBlock(e.unref(P),{key:0})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({type:"text",class:{"top-input_input":!0,["top-input_input-"+r.modificator]:!!r.modificator,"top-forms-focusable":!r.disabled,"top-error":r.isError},autocomplete:"off_always",name:r.name,"onUpdate:modelValue":b[0]||(b[0]=d=>i.value=d),title:r.title,placeholder:t.value,disabled:r.disabled,readonly:r.readonly,onKeydown:b[1]||(b[1]=e.withKeys(d=>(r.addCleaner||!!r.$slots.btn)&&c(d),["esc"]))},r.$attrs),null,16,ce),[[e.vModelText,i.value]]),r.addCleaner&&i.value&&i.value!=="0000-00-00"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"top-input_cleaner","data-top-icon":"",onClick:e.withModifiers(c,["prevent"])})):e.createCommentVNode("",!0),r.captionType!==""?(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default")],10,pe))}}),[["__cssModules",{$style:{"top-input":"top-input","top-input_input":"top-input_input","top-input-withCleaner":"top-input-withCleaner","top-input_cleaner":"top-input_cleaner","top-loadbar":"top-loadbar"}}]]),me=["modelValue"],fe=!!document.documentElement.ontouchstart&&!!document.createElement("input").showPicker;let R=n=>{};const be=h(e.defineComponent({__name:"inputDate",props:{modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},modificator:{},size:{},isError:{type:Boolean},isLoading:{type:Boolean},icon:{},icon2:{default:""},addCleaner:{type:Boolean},title:{},captionType:{}},emits:["update:modelValue"],setup(n,{emit:o}){const a=n,s=o;e.onUnmounted(()=>{t&&t.datepicker("destroy")});const i=e.ref();let t;const c=e.computed({get(){return y(a.modelValue,2,"0000-00-00")},set(l){l=M(l,"0000-00-00"),s("update:modelValue",l)}});let r=l=>{R(l)},b=l=>{const m=M(l.target.value),f=y(m);if(!f||f===p.L.Not_date||l.target.value!==f){l.target.value=c.value;return}c.value=l.target.value};async function d(l){const m=await new Promise((f,v)=>O(["./datepicker-CDoo2d0x.amd"],f,v));R=m.oninput,t=m.connectDatepicker(l.target,{onSelect:()=>b(l)}),t&&t.datepicker("show")}return(l,m)=>e.unref(fe)?(e.openBlock(),e.createBlock(e.unref(V),e.mergeProps({key:0},l.$props,{modelValue:c.value,readonly:"",onClick:m[1]||(m[1]=f=>i.value.showPicker())}),{default:e.withCtx(()=>[e.createElementVNode("input",{ref_key:"el",ref:i,type:"date",class:"top-input_input-date",modelValue:l.modelValue,onChange:m[0]||(m[0]=f=>c.value=f.target.value),tabindex:"-1"},null,40,me)]),_:1},16,["modelValue"])):(e.openBlock(),e.createBlock(e.unref(V),e.mergeProps({key:1},l.$props,{modelValue:c.value,"onUpdate:modelValue":m[2]||(m[2]=f=>f===""?c.value="":""),onInput:e.unref(r),onFocusOnce:d,onChange:e.unref(b),modificator:"datepicker"}),null,16,["modelValue","onInput","onChange"]))}}),[["__cssModules",{$style:{"top-input-datepicker":"top-input-datepicker","top-input_input-date":"top-input_input-date"}}]]),he={class:"top-inputRange"},ve=e.createElementVNode("span",{class:"top-inputRange_dash"}," — ",-1),ye=h(e.defineComponent({__name:"inputRange",setup(n){return(o,a)=>(e.openBlock(),e.createElementBlock("div",he,[e.renderSlot(o.$slots,"from"),ve,e.renderSlot(o.$slots,"to")]))}}),[["__cssModules",{$style:{"top-inputRange":"top-inputRange","top-inputRange_dash":"top-inputRange_dash","top-input":"top-input"}}]]),ge=["name","value","disabled"],ke=h(e.defineComponent({__name:"radio",props:{modelValue:{},value:{},name:{},description:{},disabled:{type:Boolean},isError:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:o}){const a=n,s=o,i=e.computed({get(){return a.modelValue},set(t){s("update:modelValue",t)}});return(t,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-forms-optionWrapper":!0,"top-radio":!0,["top-radio_"+t.name]:t.name!=="","top-disabled":t.disabled,"top-error":t.isError&&!t.disabled})},[e.withDirectives(e.createElementVNode("input",{type:"radio",class:e.normalizeClass({"top-forms-focusable":!t.disabled,"top-forms-option":!0,"top-radio_input":!0,"top-error":t.isError&&!t.disabled}),"onUpdate:modelValue":c[0]||(c[0]=r=>i.value=r),name:t.name,value:t.value,disabled:t.disabled},null,10,ge),[[e.vModelRadio,i.value]]),t.$slots.default?(e.openBlock(),e.createBlock(k,{key:0,description:t.description,disabled:t.disabled},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["description","disabled"])):e.createCommentVNode("",!0)],2))}}),[["__cssModules",{$style:{"top-radio":"top-radio","top-radio_input":"top-radio_input","top-error":"top-error"}}]]),$e=["name","value","disabled"],we=h(e.defineComponent({__name:"switcher",props:{modelValue:{type:[Boolean,Array,Set]},name:{},value:{},description:{},disabled:{type:Boolean},isError:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:o}){const a=n,s=o,i=e.computed({get(){return a.modelValue},set(t){s("update:modelValue",t)}});return(t,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-forms-optionWrapper":!0,"top-checkboxSwitcher":!0,"top-disabled":t.disabled,"top-error":t.isError&&!t.disabled})},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:e.normalizeClass({"top-forms-focusable":!t.disabled,"top-forms-option":!0,"top-checkboxSwitcher_input":!0,"top-error":t.isError&&!t.disabled}),"onUpdate:modelValue":c[0]||(c[0]=r=>i.value=r),name:t.name,value:t.value,disabled:t.disabled},null,10,$e),[[e.vModelCheckbox,i.value]]),t.$slots.default?(e.openBlock(),e.createBlock(k,{key:0,description:t.description,disabled:t.disabled},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["description","disabled"])):e.createCommentVNode("",!0)],2))}}),[["__cssModules",{$style:{"top-checkboxSwitcher":"top-checkboxSwitcher","top-checkboxSwitcher_input":"top-checkboxSwitcher_input","top-error":"top-error"}}]]),_e=["name","placeholder","disabled","readonly","rows"],Be={key:0,class:"top-textarea_pseudoContent"},Me=h(e.defineComponent({inheritAttrs:!1,__name:"textarea",props:{modelValue:{},name:{},placeholder:{},rows:{default:5},minHeight:{default:120},expandable:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},isError:{type:Boolean},hint:{}},emits:["update:modelValue"],setup(n,{emit:o}){e.useCssVars(t=>({c35baa86:t.minHeight+"px"}));const a=n,s=o,i=e.computed({get(){return a.modelValue},set(t){s("update:modelValue",t)}});return(t,c)=>{const r=e.resolveDirective("top-tooltip");return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-textarea":!0,["top-textarea-"+t.name]:t.name,"top-disabled":t.disabled})},[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({type:"text",class:{"top-forms-focusable":!t.disabled,"top-textarea_textarea":!0,"top-textarea_textarea-expandable":t.expandable,"top-error":t.isError},autocomplete:"off_always",name:t.name,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,rows:t.expandable?void 0:t.rows},t.$attrs,{"onUpdate:modelValue":c[0]||(c[0]=b=>i.value=b)}),null,16,_e),[[e.vModelText,i.value]]),t.expandable?(e.openBlock(),e.createElementBlock("div",Be,e.toDisplayString(i.value+" "),1)):e.createCommentVNode("",!0),t.hint?e.withDirectives((e.openBlock(),e.createBlock(F,{key:1,class:"top-textarea_hint",hint:t.hint},null,8,["hint"])),[[r]]):e.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{"top-textarea":"top-textarea","top-textarea_textarea":"top-textarea_textarea","top-textarea_textarea-expandable":"top-textarea_textarea-expandable","top-textarea_pseudoContent":"top-textarea_pseudoContent","top-textarea_hint":"top-textarea_hint"}}]]),Ve=["data-value","data-top-icon","data-top-icon2"],Se=["name","disabled"],Ee=["label","disabled"],Ce=["value","selected","disabled"],ze=["value","selected","disabled"],Le={key:1,class:"top-formsCaption"},De=h(e.defineComponent({__name:"select",props:e.mergeModels({modelValue:{},options:{},name:{},disabled:{type:Boolean},icon:{},size:{default:"s"},addChanger:{type:Boolean},title:{},isError:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(n,{emit:o}){const a=n,s=e.useModel(n,"modelValue"),i=e.computed(()=>{const d=new Map;return a.options.forEach((l,m)=>{if(typeof l=="string"&&(l=c(m,l)),l.children){const f=new Map;l.children.forEach((v,$)=>{typeof v=="string"&&(v=c($,v)),f.set(v.value,v)}),l={...l},l.children=f,d.set(l.value,l)}else d.set(l.value,l)}),d}),t=e.computed(()=>{const d=new Map;return i.value.forEach(l=>{if(!l.disabled){if(l.children){l.children.forEach(m=>{m.disabled||d.set(m.value,m)});return}d.set(l.value,l)}}),d}),c=(d,l)=>({value:d,title:l});e.watch([()=>a.modelValue,t],()=>{(s.value===null||s.value===void 0)&&t.value.size&&(console.warn("Пожалуйста, не передавайте в компонент Select значения null и undefined"),s.value=t.value.keys().next().value)},{immediate:!0});const r=e.computed(()=>{var d;return(d=t.value.get(s.value))==null?void 0:d.icon}),b=()=>{const d=[...t.value.keys()],m=(d.indexOf(s.value)+1)%d.length;s.value=d[m]};return(d,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-select":!0,["top-select-"+d.name]:d.name,["top-size_"+d.size]:!0,"top-formsCaptionWrapper":!!d.title,"top-select-error":d.isError,"top-disabled":d.disabled}),"data-value":s.value,"data-top-icon":d.icon,"data-top-icon2":r.value},[e.withDirectives(e.createElementVNode("select",{class:e.normalizeClass({"top-forms-focusable":!d.disabled,"top-select_select":!0,"top-select_arrow":!0,"top-error":d.isError}),name:d.name,disabled:d.disabled,"onUpdate:modelValue":l[0]||(l[0]=m=>s.value=m)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,([m,f])=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f.children?(e.openBlock(),e.createElementBlock("optgroup",{key:"group_"+m,label:f.title,disabled:f.disabled},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.children,([v,$])=>(e.openBlock(),e.createElementBlock("option",{key:v,value:v,selected:v===s.value,disabled:$.disabled},e.toDisplayString($.title),9,Ce))),128))],8,Ee)):(e.openBlock(),e.createElementBlock("option",{key:m??void 0,value:m,selected:m===s.value,disabled:f.disabled},e.toDisplayString(f.title),9,ze))],64))),256))],10,Se),[[e.vModelSelect,s.value]]),d.addChanger&&t.value.size&&!d.disabled?(e.openBlock(),e.createElementBlock("span",{key:0,class:"top-changer",onClick:b})):e.createCommentVNode("",!0),d.title?(e.openBlock(),e.createElementBlock("span",Le,e.toDisplayString(d.title),1)):e.createCommentVNode("",!0)],10,Ve))}}),[["__cssModules",{$style:{"top-select":"top-select","top-select-error":"top-select-error","top-select_select":"top-select_select","top-changer":"top-changer"}}]]),Ne={"top-loadbar":"top-loadbar"},Te={},Fe={class:"top-loadbar"};function Re(n,o){return e.openBlock(),e.createElementBlock("div",Fe)}const P=h(Te,[["render",Re],["__cssModules",{$style:Ne}]]);u.Button=se,u.ControlLabel=k,u.Core=p,u.Events=D,u.Hint=F,u.Input=V,u.Loadbar=P,u.Textarea=Me,u._export_sfc=h,u._window=B,u.avatar=ae,u.checkbox=re,u.dateFormat=y,u.dateUnformat=M,u.genDate=T,u.getCommandKeyLabel=I,u.inputDate=be,u.inputRange=ye,u.isApp=C,u.isMacOS=z,u.isMobile=E,u.isRetina=S,u.isSafari=H,u.radio=ke,u.select=De,u.stringToDate=J,u.switcher=we});
|
|
3
|
+
//# sourceMappingURL=forms-DNRGCC9P.amd.js.map
|