@topvisor/ui 0.0.37 → 0.0.38
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-778ddcc5.es.js +275 -0
- package/.chunks/datepicker-778ddcc5.es.js.map +1 -0
- package/.chunks/datepicker-80599025.amd.js +234 -0
- package/.chunks/datepicker-80599025.amd.js.map +1 -0
- package/.chunks/forms-58420e52.amd.js +3 -0
- package/.chunks/forms-58420e52.amd.js.map +1 -0
- package/.chunks/forms-779fee37.es.js +1107 -0
- package/.chunks/forms-779fee37.es.js.map +1 -0
- package/.chunks/{popup-b9517276.es.js → popup-672d6531.es.js} +420 -385
- package/.chunks/popup-672d6531.es.js.map +1 -0
- package/.chunks/popup-d53450b6.amd.js +377 -0
- package/.chunks/popup-d53450b6.amd.js.map +1 -0
- package/README.md +62 -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,275 @@
|
|
|
1
|
+
import { watch as g, toRef as m } from "vue";
|
|
2
|
+
import { C as k, U as h } from "./forms-779fee37.es.js";
|
|
3
|
+
const b = `/* 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
|
+
k.appendStyle(b);
|
|
237
|
+
const o = window, x = (e) => {
|
|
238
|
+
var t, n;
|
|
239
|
+
if (!((n = (t = o == null ? void 0 : o.jQuery) == null ? void 0 : t.ui) != null && n.datepicker)) {
|
|
240
|
+
console.info("Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker");
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
return o.jQuery.datepicker._defaults.dateFormat = k.state.dateFormat.toLowerCase().replace("m", "mm").replace("y", "yy").replace("d", "dd"), o.jQuery(e);
|
|
244
|
+
};
|
|
245
|
+
function y(e, t) {
|
|
246
|
+
var n;
|
|
247
|
+
return (n = x(e)) == null ? void 0 : n.datepicker(t);
|
|
248
|
+
}
|
|
249
|
+
let d, l, p, u;
|
|
250
|
+
g(m(k.state.dateFormat), () => {
|
|
251
|
+
var e;
|
|
252
|
+
d = h.dateFormat("2000-01-01"), l = ((e = d.match(/\D/)) == null ? void 0 : e[0]) ?? "-", p = d.replace(/\D+/g, "").length, u = [];
|
|
253
|
+
for (let t = 0; t < d.length; t++)
|
|
254
|
+
d[t] === l && u.push(t);
|
|
255
|
+
}, { immediate: !0 });
|
|
256
|
+
function F(e) {
|
|
257
|
+
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;
|
|
258
|
+
if (c > 0) {
|
|
259
|
+
r = r.substring(0, p);
|
|
260
|
+
const a = p - r.length;
|
|
261
|
+
i = i.substring(i.length - a);
|
|
262
|
+
} else
|
|
263
|
+
c < 0 && (e.inputType === "deleteContentForward" ? r += "0".repeat(-c) : i = "0".repeat(-c) + i);
|
|
264
|
+
t = r.length, n = r + i;
|
|
265
|
+
for (let a = 0; a < u.length; a++) {
|
|
266
|
+
const s = u[a];
|
|
267
|
+
n = n.substring(0, s) + l + n.substring(s), t >= s && t++;
|
|
268
|
+
}
|
|
269
|
+
e.inputType === "deleteContentBackward" && n[t - 1] === l && t--, n !== e.target.value && (e.target.value = n, e.target.selectionStart = t, e.target.selectionEnd = t);
|
|
270
|
+
}
|
|
271
|
+
export {
|
|
272
|
+
y as connectDatepicker,
|
|
273
|
+
F as oninput
|
|
274
|
+
};
|
|
275
|
+
//# sourceMappingURL=datepicker-778ddcc5.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datepicker-778ddcc5.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 UtilsDate from '@/core/utils/date';\n\nimport css from '@/components/forms/inputDate/datepicker.css?raw';\n\nCore.appendStyle(css);\n\nconst _window: any = window;\n\nconst $ = (el: HTMLInputElement) => {\n\tif (!_window?.jQuery?.ui?.datepicker) {\n\t\tconsole.info('Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker');\n\n\t\treturn;\n\t}\n\n\t_window.jQuery.datepicker._defaults.dateFormat = Core.state.dateFormat.toLowerCase().replace('m', 'mm').replace('y', 'yy').replace('d', 'dd');\n\n\treturn _window.jQuery(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 = UtilsDate.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","_window","$","el","_b","_a","connectDatepicker","options","dateFormatted","delimiter","dateNumbersCount","delimitersIndexes","watch","toRef","UtilsDate","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,IAAe,QAEfC,IAAI,CAACC,MAAyB;;AACnC,MAAI,GAACC,KAAAC,IAAAJ,KAAA,gBAAAA,EAAS,WAAT,gBAAAI,EAAiB,OAAjB,QAAAD,EAAqB,aAAY;AACrC,YAAQ,KAAK,0EAA0E;AAEvF;AAAA,EACD;AAEA,SAAAH,EAAQ,OAAO,WAAW,UAAU,aAAaD,EAAK,MAAM,WAAW,YAAY,EAAE,QAAQ,KAAK,IAAI,EAAE,QAAQ,KAAK,IAAI,EAAE,QAAQ,KAAK,IAAI,GAErIC,EAAQ,OAAOE,CAAE;AACzB;AAEgB,SAAAG,EAAkBH,GAAsBI,GAAc;;AACrE,UAAOF,IAAAH,EAAEC,CAAE,MAAJ,gBAAAE,EAAO,WAAWE;AAC1B;AAEA,IAAIC,GACAC,GACAC,GACAC;AAEJC,EAAMC,EAAMb,EAAK,MAAM,UAAU,GAAG,MAAM;;AAEzB,EAAAQ,IAAAM,EAAU,WAAW,YAAY,GACjDL,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-58420e52.amd"],function(x,g,p,c){"use strict";if(typeof p>"u")var p=window.Vue;const m=`/* 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
|
+
}`;c.Core.appendStyle(m);const a=window,b=e=>{var t,n;if(!((n=(t=a==null?void 0:a.jQuery)==null?void 0:t.ui)!=null&&n.datepicker)){console.info("Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker");return}return a.jQuery.datepicker._defaults.dateFormat=c.Core.state.dateFormat.toLowerCase().replace("m","mm").replace("y","yy").replace("d","dd"),a.jQuery(e)};function v(e,t){var n;return(n=b(e))==null?void 0:n.datepicker(t)}let o,l,u,s;p.watch(p.toRef(c.Core.state.dateFormat),()=>{var e;o=c.UtilsDate.dateFormat("2000-01-01"),l=((e=o.match(/\D/))==null?void 0:e[0])??"-",u=o.replace(/\D+/g,"").length,s=[];for(let t=0;t<o.length;t++)o[t]===l&&s.push(t)},{immediate:!0});function f(e){let t=e.target.selectionEnd,n=e.target.value,r=n.substring(0,t).replace(/\D+/g,""),i=n.substring(t).replace(/\D+/g,""),k=r.length+i.length-u;if(k>0){r=r.substring(0,u);const d=u-r.length;i=i.substring(i.length-d)}else k<0&&(e.inputType==="deleteContentForward"?r+="0".repeat(-k):i="0".repeat(-k)+i);t=r.length,n=r+i;for(let d=0;d<s.length;d++){const h=s[d];n=n.substring(0,h)+l+n.substring(h),t>=h&&t++}e.inputType==="deleteContentBackward"&&n[t-1]===l&&t--,n!==e.target.value&&(e.target.value=n,e.target.selectionStart=t,e.target.selectionEnd=t)}g.connectDatepicker=v,g.oninput=f,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
234
|
+
//# sourceMappingURL=datepicker-80599025.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datepicker-80599025.amd.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 UtilsDate from '@/core/utils/date';\n\nimport css from '@/components/forms/inputDate/datepicker.css?raw';\n\nCore.appendStyle(css);\n\nconst _window: any = window;\n\nconst $ = (el: HTMLInputElement) => {\n\tif (!_window?.jQuery?.ui?.datepicker) {\n\t\tconsole.info('Для работы datepicker требуется глобальная загрузка jQuery UI Datepicker');\n\n\t\treturn;\n\t}\n\n\t_window.jQuery.datepicker._defaults.dateFormat = Core.state.dateFormat.toLowerCase().replace('m', 'mm').replace('y', 'yy').replace('d', 'dd');\n\n\treturn _window.jQuery(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 = UtilsDate.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","_window","forms","connectDatepicker","options","dateFormatted","delimiter","dateNumbersCount","delimitersIndexes","watch","_a","i","valueChunkLeft","value","selectionPos","valueChunkRight","extraNumbersCount","valueChunkRightMaxLength","delimiterIndex"],"mappings":"0HAAA,MAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GCMAC,EAAAA,KAAAA,YAAAA,CAAAA,iBAIAC,EAAAC,GAAA,sFAEE,QAAA,KAAA,0EAAA,EAEA,OAGD,OAAAC,EAAA,OAAA,WAAA,UAAA,WAAAC,EAAA,KAAA,MAAA,WAAA,YAAA,EAAA,QAAA,IAAA,IAAA,EAAA,QAAA,IAAA,IAAA,EAAA,QAAA,IAAA,IAAA,EAEAD,EAAA,OAAAD,CAAA,CACD,EAEgB,SAAAG,EAAAH,EAAAI,EAAA,mDAIhB,IAAAC,EACAC,EACAC,EACAC,EAEAC,EAAAA,MAAAA,EAAAA,MAAAA,EAAAA,KAAAA,MAAAA,UAAAA,EAAAA,IAAAA,8CAGCH,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"],function(M,f,e){var A,P;"use strict";M(["../core/core.amd"],s=>{const t=["../assets/forms.css"].map(n=>M.toUrl(n));s.Page.addCss(t)});class g{static isRetina(){return"devicePixelRatio"in window&&window.devicePixelRatio>1}static isMobile(){return!!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|IEMobile|Opera Mini/i)}static isApp(){return navigator.userAgent.indexOf("Topvisor_App")!=-1}static isMacOS(){return navigator.userAgent.indexOf("Mac OS X")!==-1}static isSafari(){const t=/Chrome|Android/.test(navigator.userAgent);let n=/Safari/.test(navigator.userAgent);return t&&n&&(n=!1),n}static getCommandKeyLabel(){return this.isMacOS()?"⌘":"Ctrl"}}function W(s,t,...n){const i=document.createElement(s);for(const a in t)a.indexOf("on")===0?i[a]=t[a]:i.setAttribute(a,t[a]);return n.forEach(a=>{typeof a=="string"?i.insertAdjacentHTML("beforeend",a):i.append(a)}),i}function k(s){if(!s)return!1;const t=s.getBoundingClientRect();return!!(t.width||t.height)}function U(s){const t=s.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX}}function H(s,t){return window.getComputedStyle(s).getPropertyValue(t)}function I(s,t){const n=document.createElement(t);return s.after(n),n.append(s),n}function j(s,t){return w(s,t).find(k)||null}function Y(s,t){return w(s,t).findLast(k)||null}function q(s,t){return w(s,t).filter(k)}function w(s,t){return s?[...s.querySelectorAll(t)]:[]}function G(s,t="common",n=void 0){if(s)return s.topData||(s.topData={}),n&&(s.topData[t]=n),n===null&&delete s.topData[t],s.topData[t]}function K(s){s&&delete s.topData}const D={genEl:W,isVisible:k,offset:U,css:H,wrap:I,querySelectorVisible:j,querySelectorVisibleLast:Y,querySelectorAllVisible:q,querySelectorAllArray:w,storage:G,storageClear:K};class V{static addCss(t,n={}){const i=new Map;i.set("::",[]),t.forEach(a=>{let o=!1,d=!1;a.match(/\.m\./)&&(o=!0),a.match(/\.pc\./)&&(d=!0);const l=`${o}:${d}`;i.has(l)||i.set(`${o}:${d}`,[]),i.get(`${o}:${d}`).push(a)}),i.forEach((a,o)=>{if(!a.length)return;const[d,l]=o.split(":").map(p=>p==="true");let r="all";d&&(r="(max-width: 900px)"),l&&(r="(min-width: 900px)"),n.media=r,V._addCss(a,n)})}static _addCss(t,n){t.forEach(i=>{if(n.id??="topCSSLink-"+i.replace(/\W/g,"-"),window[n.id])return;n.rel="stylesheet",n.href=i;const a=D.genEl("link",n);document.head.append(a)})}}const Q=100;let L;const S=new Map,$={width:window.innerWidth,height:window.innerHeight};function X(s){S.set(s,s)}function J(s){S.delete(s)}function Z(s){clearTimeout(L),L=setTimeout(function(){s.topEvent={widthDiff:$.width-window.innerWidth,hightDiff:$.height-window.innerHeight},$.width=window.innerWidth,$.height=window.innerHeight,S.forEach(t=>t(s))},Q)}window.addEventListener("resize",Z);const F={addOnReize:X,removeOnResize:J},v={widthForMobile:900,dateFormat:"Y-m-d",gmt:(A=new Date().toString().match(/GMT(\S+)/))==null?void 0:A[1]},x={isMobile:!1,isMobileUA:!1,isRetina:!1,isApp:!1,isLandscape:!0,isPortrait:!1,size:0,dateFormat:"Y-m-d",gmt:(P=new Date().toString().match(/GMT(\S+)/))==null?void 0:P[1]},_=window,C=s=>{var t,n;if(!((n=(t=_==null?void 0:_.jQuery)==null?void 0:t.ui)!=null&&n.tooltip)){console.info("Для работы v-top-tooltip требуется глобальная загрузка jQuery UI Tooltip");return}return _.jQuery(s)},R=(s,t)=>{var i;const n=s.value??{};return n.content??=(i=t.props)==null?void 0:i.title,n.content=String(n.content).replace(/\r\n|\r|\n/g,"<br>"),n.position??={my:"bottom-18px",at:"top center"},n},ee={mounted(s,t,n){var i;(i=C(s))==null||i.tooltip(R(t,n))},updated(s,t,n,i){var d;const a=R(t,n),o=(d=C(s))==null?void 0:d.tooltip("instance");o&&(o.options={...o.options,...a})},unmounted(s,t,n){var i;(i=C(s))==null||i.tooltip("destroy")}},E=window;class c{static L=e.reactive({Not_date:"Not date"});static page=(E==null?void 0:E.page)||{};static Page=V;static options=v;static state=e.reactive({...x});static matchMediaIsMobile;static appendStyle(t,n=""){let i="all";n==="m"&&(i="(max-width: "+this.options.widthForMobile+"px)"),n==="pc"&&(i="(min-width: "+this.options.widthForMobile+"px)");const a=document.createElement("style");a.innerHTML=t,a.media=i,document.head.append(a)}static install(t,n){c.defineOptions(n),t.provide("top-core",c),this.installDirectives(t)}static installDirectives(t){t.directive("top-tooltip",ee)}static defineOptions(t){t!=null&&t.widthForMobile&&(this.options.widthForMobile=t.widthForMobile),t!=null&&t.dateFormat&&(this.options.dateFormat=t.dateFormat),t!=null&&t.gmt&&(this.options.gmt=t.gmt),c.setState()}static setState(){c.matchMediaIsMobile=window.matchMedia(`(max-width: ${c.options.widthForMobile}px)`),c.state.isMobileUA=g.isMobile(),c.state.isRetina=g.isRetina(),c.state.isApp=g.isApp(),c.state.dateFormat=this.options.dateFormat,c.state.gmt=this.options.gmt,c.setStateByWindowSize(),F.addOnReize(c.onResize),c.onResize(),c.saveToCookie()}static onResize(){c.setStateByWindowSize(),document.documentElement.style.setProperty("--100vh",window.innerHeight+"px")}static setStateByWindowSize(){var t;c.state.isMobile=!!((t=c.matchMediaIsMobile)!=null&&t.matches),c.state.isLandscape=window.innerWidth>window.innerHeight,c.state.isPortrait=!c.state.isLandscape,c.state.size=window.innerWidth>window.innerHeight?window.innerWidth:window.innerHeight,c.saveToCookie()}static saveToCookie(){const t=[1,window.innerWidth,window.innerHeight,window.devicePixelRatio,Number(c.state.isMobile),Number(c.state.isRetina)];document.cookie="device="+t.join(",")+"; path=/;"}}class h{static stringToDate(t){return t.indexOf("T")===-1&&(t.length==10&&(t+=" 00:00:00"),t=t.replace(" ","T")+c.state.gmt),new Date(t)}static ms2Date(t,n=!0){let i;t!=null?i=new Date(t):i=new Date;const a=i.getDate().toString().padStart(2,"0"),o=String(i.getMonth()+1).padStart(2,"0"),d=i.getFullYear(),l=i.getHours().toString().padStart(2,"0"),r=i.getMinutes().toString().padStart(2,"0"),p=i.getSeconds().toString().padStart(2,"0");return i=d+"-"+o+"-"+a+" "+l+":"+r+":"+p,n&&(i=this.dateFormat(i)),i}static dateFormat(t,n=2,i=c.L.Not_date){if((!t||t.substring(0,10)==="0000-00-00")&&i&&i!=="0000-00-00")return i;const a=c.state.dateFormat.toLowerCase();let o=t.substring(0,10);o.length===7&&(o+="-01"),o+=" 00:00",o=o.replace(/-/g,"/");const d=new Date(o);if(isNaN(Number(d)))return i;let l=a.replace("y",String(d.getFullYear()).padStart(2,"0")).replace("m",String(d.getMonth()+1).padStart(2,"0")).replace("d",String(d.getDate()).padStart(2,"0"));if(t.length>10)switch(n){case 1:l+=" "+t.substring(11,13);break;case 2:l+=" "+t.substring(11,16);break;case 3:l+=" "+t.substring(11,19);break}return l}static dateUnformat(t,n=c.L.Not_date){if(!t)return n;if(t.match(/\d\d\d\d-\d\d-\d\d/))return t;const i=c.state.dateFormat.toLowerCase(),a=t.split(/\W/),o=i.split(/\W/);let d="",l="",r="";o.forEach((u,m)=>{switch(u){case"d":d=a[m];break;case"m":l=a[m];break;case"y":r=a[m];break}});let p=r+"-"+l+"-"+d;return p.match(/\d\d\d\d-\d\d-\d\d/)||(console.info("Неверный формат даты, будет возращена текущая дата, "+p),p=this.ms2Date(new Date().getTime(),!1).substring(0,10)),p}}const te={class:"top-avatar"},oe=["src","title"],ae=["title"],ne=e.defineComponent({__name:"avatar",props:{size:{default:64},image:{},nickname:{},isOnline:{type:Boolean},lastActiveTime:{}},setup(s){e.useCssVars(a=>({"9f3c0670":a.size+"px"}));const t=s,n={user:{Online:"Онлайн",LastSeen:"Заходил(а)"}},i=e.computed(()=>{if(t.isOnline)return n.user.Online;if(t.lastActiveTime)return n.user.LastSeen+": "+h.dateFormat(t.lastActiveTime,2)});return(a,o)=>(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("img",{class:"top-avatar_image",src:a.image,title:t.nickname+(i.value?`
|
|
2
|
+
${i.value}`:""),alt:""},null,8,oe),a.isOnline?(e.openBlock(),e.createElementBlock("div",{key:0,class:"top-avatar_status",title:i.value},null,8,ae)):e.createCommentVNode("",!0)]))}}),se={"top-avatar":"top-avatar","top-avatar_image":"top-avatar_image","top-avatar_status":"top-avatar_status"},b=(s,t)=>{const n=s.__vccOpts||s;for(const[i,a]of t)n[i]=a;return n},ie=b(ne,[["__cssModules",{$style:se}]]),le=b(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(s){const t=s,n=e.computed(()=>t.href?"a":"button"),i=e.computed(()=>t.isSubmit?"submit":void 0);return(a,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{class:e.normalizeClass({"top-active":a.isActive,"top-disabled":a.disabled,"top-forms-focusable":!a.disabled,"top-button":!0,"top-button-progress":a.isProgress,[`top-size_${a.size}`]:!!a.size,[`top-color_${a.color}`]:!0,[`top-style_${a.styling}`]:!!a.styling}),name:a.name,title:a.title,href:a.href,type:i.value,"data-top-icon":a.icon||void 0,"data-top-icon2":a.icon2||void 0,disabled:a.disabled||void 0,inProgress:a.isProgress},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.icon?"":"Button"),1)])]),_: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-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"}}]]),re={class:"top-forms-optionLabel"},B=b(e.defineComponent({__name:"controlLabel",props:{description:{},disabled:{type:Boolean}},setup(s){return(t,n)=>(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",{class:e.normalizeClass({"top-forms-optionLabel_title":!0,"top-forms-optionLabel_title-disabled":t.disabled})},[e.renderSlot(t.$slots,"default")],2),t.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["top-forms-optionLabel_description",{"top-forms-optionLabel_description-disabled":t.disabled}])},e.toDisplayString(t.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"}}]]),de=["name","value","indeterminate","disabled"],pe=b(e.defineComponent({__name:"checkbox",props:{modelValue:{type:[Boolean,Array,Set]},name:{},value:{},description:{},disabled:{type:Boolean},indeterminate:{type:Boolean},isError:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:t}){const n=s,i=t,a=e.computed({get(){return n.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-forms-optionWrapper":!0,"top-checkbox":!0,["top-checkbox_"+o.name]:o.name!=="","top-disabled":o.disabled,"top-error":o.isError&&!o.disabled})},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:e.normalizeClass({"top-forms-focusable":!o.disabled,"top-forms-option":!0,"top-checkbox_input":!0,"top-error":o.isError&&!o.disabled}),name:o.name,"onUpdate:modelValue":d[0]||(d[0]=l=>a.value=l),value:o.value,indeterminate:o.indeterminate,disabled:o.disabled},null,10,de),[[e.vModelCheckbox,a.value]]),o.$slots.default?(e.openBlock(),e.createBlock(B,{key:0,description:o.description,disabled:o.disabled},{default:e.withCtx(()=>[e.renderSlot(o.$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"}}]]),ce=["title"],N=b(e.defineComponent({__name:"hint",props:{hint:{}},setup(s){return(t,n)=>(e.openBlock(),e.createElementBlock("span",{class:"top-hint","data-top-icon":"",title:t.hint},null,8,ce))}}),[["__cssModules",{$style:{"top-hint":"top-hint"}}]]),me=["data-top-icon","data-top-icon2"],ue=["name","title","placeholder","disabled","readonly"],fe=["onClick"],be={key:1,class:"top-formsCaption"},z=b(e.defineComponent({inheritAttrs:!1,__name:"input",props:{modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},title:{},captionType:{default:""},size:{default:"s"},icon:{},icon2:{},addCleaner:{type:Boolean},isError:{type:Boolean},modificator:{}},emits:["update:modelValue"],setup(s,{emit:t}){const n=s,i=t,a=e.computed({get(){return n.modelValue},set(l){i("update:modelValue",l)}}),o=e.computed(()=>n.addCleaner&&!n.title||n.captionType!==""?"":n.title),d=()=>{i("update:modelValue","")};return(l,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-input":!0,["top-size_"+l.size]:!0,"top-disabled":l.disabled,["top-input-"+l.modificator]:!!l.modificator,"top-input-withCleaner":l.addCleaner&&a.value&&a.value!=="0000-00-00","top-formsCaptionWrapper":l.captionType!=="","top-formsCaptionWrapper-always":l.captionType==="top"}),"data-top-icon":l.icon,"data-top-icon2":l.icon2},[e.withDirectives(e.createElementVNode("input",e.mergeProps({type:"text",class:{"top-input_input":!0,["top-input_input-"+l.modificator]:!!l.modificator,"top-forms-focusable":!l.disabled,"top-error":l.isError},autocomplete:"off_always",name:l.name,"onUpdate:modelValue":r[0]||(r[0]=p=>a.value=p),title:l.title,placeholder:o.value,disabled:l.disabled,readonly:l.readonly,onKeydown:r[1]||(r[1]=e.withKeys(e.withModifiers(()=>(l.addCleaner||!!l.$slots.btn)&&d(),["stop"]),["esc"]))},l.$attrs),null,16,ue),[[e.vModelText,a.value]]),l.addCleaner&&a.value&&a.value!=="0000-00-00"?(e.openBlock(),e.createElementBlock("span",{key:0,class:"top-input_cleaner","data-top-icon":"",onClick:e.withModifiers(d,["prevent"])},null,8,fe)):e.createCommentVNode("",!0),l.captionType!==""?(e.openBlock(),e.createElementBlock("span",be,e.toDisplayString(l.title),1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")],10,me))}}),[["__cssModules",{$style:{"top-input":"top-input","top-input_input":"top-input_input","top-input-withCleaner":"top-input-withCleaner","top-input_cleaner":"top-input_cleaner"}}]]),he=["modelValue"],ye=!!document.documentElement.ontouchstart&&!!document.createElement("input").showPicker;let T=s=>{};const ge=b(e.defineComponent({__name:"inputDate",props:{modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},title:{},captionType:{},size:{},icon:{},icon2:{default:""},addCleaner:{type:Boolean},isError:{type:Boolean},modificator:{}},emits:["update:modelValue"],setup(s,{emit:t}){const n=s,i=t,a=e.ref(),o=e.computed({get(){return h.dateFormat(n.modelValue,2,"0000-00-00")},set(p){p=h.dateUnformat(p,"0000-00-00"),i("update:modelValue",p)}});let d=p=>{T(p)},l=p=>{const u=h.dateUnformat(p.target.value),m=h.dateFormat(u);if(!m||m===c.L.Not_date||p.target.value!==m){p.target.value=o.value;return}o.value=p.target.value};async function r(p){const u=await new Promise((O,y)=>M(["./datepicker-80599025.amd"],O,y));T=u.oninput;const m=u.connectDatepicker(p.target,{onSelect:()=>l(p)});m&&(m.datepicker("show"),e.onUnmounted(()=>m.datepicker("destroy")))}return(p,u)=>e.unref(ye)?(e.openBlock(),e.createBlock(e.unref(z),e.mergeProps({key:0},p.$props,{modelValue:o.value,readonly:"",onClick:u[1]||(u[1]=m=>a.value.showPicker())}),{default:e.withCtx(()=>[e.createElementVNode("input",{ref_key:"el",ref:a,type:"date",class:"top-input_input-date",modelValue:p.modelValue,onChange:u[0]||(u[0]=m=>o.value=m.target.value),tabindex:"-1"},null,40,he)]),_:1},16,["modelValue"])):(e.openBlock(),e.createBlock(e.unref(z),e.mergeProps({key:1},p.$props,{modelValue:o.value,"onUpdate:modelValue":u[2]||(u[2]=m=>m===""?o.value="":""),onInput:e.unref(d),onFocusOnce:r,onChange:e.unref(l),modificator:"datepicker"}),null,16,["modelValue","onInput","onChange"]))}}),[["__cssModules",{$style:{"top-input-datepicker":"top-input-datepicker","top-input_input-date":"top-input_input-date"}}]]),ke={class:"top-inputRange"},we=e.createElementVNode("span",{class:"top-inputRange_dash"}," — ",-1),$e=b(e.defineComponent({__name:"inputRange",setup(s){return(t,n)=>(e.openBlock(),e.createElementBlock("div",ke,[e.renderSlot(t.$slots,"from"),we,e.renderSlot(t.$slots,"to")]))}}),[["__cssModules",{$style:{"top-inputRange":"top-inputRange","top-inputRange_dash":"top-inputRange_dash","top-input":"top-input"}}]]),_e=["name","value","disabled"],Be=b(e.defineComponent({__name:"radio",props:{modelValue:{},value:{},name:{},description:{},disabled:{type:Boolean},isError:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:t}){const n=s,i=t,a=e.computed({get(){return n.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-forms-optionWrapper":!0,"top-radio":!0,["top-radio_"+o.name]:o.name!=="","top-disabled":o.disabled,"top-error":o.isError&&!o.disabled})},[e.withDirectives(e.createElementVNode("input",{type:"radio",class:e.normalizeClass({"top-forms-focusable":!o.disabled,"top-forms-option":!0,"top-radio_input":!0,"top-error":o.isError&&!o.disabled}),"onUpdate:modelValue":d[0]||(d[0]=l=>a.value=l),name:o.name,value:o.value,disabled:o.disabled},null,10,_e),[[e.vModelRadio,a.value]]),o.$slots.default?(e.openBlock(),e.createBlock(B,{key:0,description:o.description,disabled:o.disabled},{default:e.withCtx(()=>[e.renderSlot(o.$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"}}]]),Me=["name","value","disabled"],Ve=b(e.defineComponent({__name:"switcher",props:{modelValue:{type:[Boolean,Array,Set]},name:{},value:{},description:{},disabled:{type:Boolean},isError:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:t}){const n=s,i=t,a=e.computed({get(){return n.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-forms-optionWrapper":!0,"top-checkboxSwitcher":!0,"top-disabled":o.disabled,"top-error":o.isError&&!o.disabled})},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:e.normalizeClass({"top-forms-focusable":!o.disabled,"top-forms-option":!0,"top-checkboxSwitcher_input":!0,"top-error":o.isError&&!o.disabled}),"onUpdate:modelValue":d[0]||(d[0]=l=>a.value=l),name:o.name,value:o.value,disabled:o.disabled},null,10,Me),[[e.vModelCheckbox,a.value]]),o.$slots.default?(e.openBlock(),e.createBlock(B,{key:0,description:o.description,disabled:o.disabled},{default:e.withCtx(()=>[e.renderSlot(o.$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"}}]]),Se=["name","placeholder","disabled","readonly","rows"],Ce={key:0,class:"top-textarea_pseudoContent"},Ee=b(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(s,{emit:t}){e.useCssVars(o=>({c35baa86:o.minHeight+"px"}));const n=s,i=t,a=e.computed({get(){return n.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>{const l=e.resolveDirective("top-tooltip");return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-textarea":!0,["top-textarea-"+o.name]:o.name,"top-disabled":o.disabled})},[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({type:"text",class:{"top-forms-focusable":!o.disabled,"top-textarea_textarea":!0,"top-textarea_textarea-expandable":o.expandable,"top-error":o.isError},autocomplete:"off_always",name:o.name,placeholder:o.placeholder,disabled:o.disabled,readonly:o.readonly,rows:o.expandable?void 0:o.rows},o.$attrs,{"onUpdate:modelValue":d[0]||(d[0]=r=>a.value=r)}),null,16,Se),[[e.vModelText,a.value]]),o.expandable?(e.openBlock(),e.createElementBlock("div",Ce,e.toDisplayString(a.value+" "),1)):e.createCommentVNode("",!0),o.hint?e.withDirectives((e.openBlock(),e.createBlock(N,{key:1,class:"top-textarea_hint",hint:o.hint},null,8,["hint"])),[[l]]):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"}}]]),ze=["data-value","data-top-icon","data-top-icon2"],De=["name","disabled"],Le=["label","disabled"],Fe=["value","selected","disabled"],Re=["value","selected","disabled"],Ne={key:1,class:"top-formsCaption"},Te=b(e.defineComponent({__name:"select",props:{modelValue:{},options:{},name:{},disabled:{type:Boolean},icon:{},size:{default:"s"},addChanger:{type:Boolean},title:{},isError:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:t}){const n=s,i=t,a=e.computed({get(){return n.modelValue},set(r){i("update:modelValue",r)}}),o=e.computed(()=>{var r;return(r=d.value.get(a.value))==null?void 0:r.icon}),d=e.computed(()=>{const r=new Map;return n.options.forEach(p=>{if(!p.disabled){if(p.children){p.children.forEach(u=>{u.disabled||r.set(u.value,u)});return}r.set(p.value,p)}}),r});e.watch([e.toRef(n.modelValue),d],()=>{(a.value===null||a.value===void 0)&&d.value.size&&(console.warn("Пожалуйста, не передавайте в компонент Select значения null и undefined"),a.value=d.value.keys().next().value)},{immediate:!0});const l=()=>{const r=[...d.value.keys()],u=(r.indexOf(a.value)+1)%r.length;a.value=r[u]};return(r,p)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"top-select":!0,["top-select-"+r.name]:r.name,["top-size_"+r.size]:!0,"top-formsCaptionWrapper":!!r.title,"top-select-error":r.isError,"top-disabled":r.disabled}),"data-value":a.value,"data-top-icon":r.icon,"data-top-icon2":o.value},[e.withDirectives(e.createElementVNode("select",{class:e.normalizeClass({"top-forms-focusable":!r.disabled,"top-select_select":!0,"top-select_arrow":!0,"top-error":r.isError}),name:r.name,disabled:r.disabled,"onUpdate:modelValue":p[0]||(p[0]=u=>a.value=u)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options.entries(),([u,m])=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m.children?(e.openBlock(),e.createElementBlock("optgroup",{key:"group_"+m.value,label:m.title,disabled:m.disabled},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.children.entries(),([O,y])=>(e.openBlock(),e.createElementBlock("option",{key:m.value,value:y.value,selected:y.value===a.value,disabled:y.disabled},e.toDisplayString(y.title),9,Fe))),128))],8,Le)):(e.openBlock(),e.createElementBlock("option",{key:m.value,value:m.value,selected:m.value===a.value,disabled:m.disabled},e.toDisplayString(m.title),9,Re))],64))),256))],10,De),[[e.vModelSelect,a.value]]),r.addChanger&&d.value.size&&!r.disabled?(e.openBlock(),e.createElementBlock("span",{key:0,class:"top-changer",onClick:l})):e.createCommentVNode("",!0),r.title?(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0)],10,ze))}}),[["__cssModules",{$style:{"top-select":"top-select","top-select-error":"top-select-error","top-select_select":"top-select_select","top-changer":"top-changer"}}]]);f.Button=le,f.ControlLabel=B,f.Core=c,f.DOM=D,f.Device=g,f.Events=F,f.Hint=N,f.Input=z,f.Textarea=Ee,f.UtilsDate=h,f._export_sfc=b,f.avatar=ie,f.checkbox=pe,f.inputDate=ge,f.inputRange=$e,f.radio=Be,f.select=Te,f.switcher=Ve});
|
|
3
|
+
//# sourceMappingURL=forms-58420e52.amd.js.map
|