@web-utils/form-ui 1.0.0-beta4 → 1.0.0-beta40
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/api/index.d.ts +60 -0
- package/api/index.mjs +42 -0
- package/awesome-button/index.d.ts +60 -0
- package/awesome-button/index.mjs +49 -0
- package/base.css +1 -0
- package/chunks/B1MSrc6f.mjs +8 -0
- package/chunks/B3ajWLh3.mjs +198 -0
- package/chunks/BH_JJ8Xh.mjs +106 -0
- package/chunks/BWBHzD5N.mjs +89 -0
- package/chunks/Bd1UFJic.mjs +660 -0
- package/chunks/Bm5eiSmT.mjs +79 -0
- package/chunks/BsCS7SB5.mjs +141 -0
- package/chunks/BufIRDd0.mjs +185 -0
- package/chunks/C1AgOUe_.mjs +172 -0
- package/chunks/C3Uo82-I.mjs +35 -0
- package/chunks/C9dGL28n.mjs +56 -0
- package/chunks/CFOGMFgo.mjs +150 -0
- package/chunks/CLPSCSsy.mjs +603 -0
- package/chunks/CSyJ-vEx.mjs +17 -0
- package/chunks/CTKmEf2M.mjs +93 -0
- package/chunks/CWfUPCtS.mjs +1360 -0
- package/chunks/CXvGoZKJ.mjs +198 -0
- package/chunks/Cab-ZjRx.mjs +164 -0
- package/chunks/ChmDDqoZ2.mjs +478 -0
- package/chunks/Cj59E77g.mjs +230 -0
- package/chunks/CqTcEefA.mjs +93 -0
- package/chunks/Ct5bDJ50.mjs +38 -0
- package/chunks/CuG2Q-PM.mjs +100 -0
- package/chunks/D8UVq1t1.mjs +176 -0
- package/chunks/DDmQcNm6.mjs +93 -0
- package/chunks/DF9fJMQS.mjs +105 -0
- package/chunks/DJe97Fgi.mjs +107 -0
- package/chunks/DXYgAmil.mjs +317 -0
- package/chunks/DhtHh0jk.mjs +87 -0
- package/chunks/DiJyms_r.mjs +100 -0
- package/chunks/Ds_Tpa_M.mjs +83 -0
- package/chunks/TvNHGVAP.mjs +25 -0
- package/chunks/XCGWTz41.mjs +25 -0
- package/chunks/XqRTtFfp.mjs +166 -0
- package/chunks/cmuHpsX6.mjs +109 -0
- package/chunks/o6VhYAN52.mjs +207 -0
- package/chunks/pdwFQpA8.mjs +57 -0
- package/chunks/taicx2sd.mjs +25 -0
- package/confirm-button/index.d.ts +113 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +84 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +53 -0
- package/constants/index.mjs +4 -0
- package/editable-tree/index.d.ts +254 -0
- package/editable-tree/index.mjs +2 -0
- package/editable-tree/style.css +1 -0
- package/element-dialog/index.d.ts +337 -16
- package/element-dialog/index.mjs +2 -91
- package/empty-view/index.d.ts +2 -2
- package/empty-view/index.mjs +1 -1
- package/flex-scroll-area/index.d.ts +1 -1
- package/flex-scroll-area/index.mjs +1 -1
- package/form-advice/index.mjs +13 -12
- package/form-button/index.d.ts +114 -0
- package/form-button/index.mjs +36 -0
- package/form-card/index.d.ts +14 -0
- package/form-card/index.mjs +18 -0
- package/form-cascader/index.d.ts +472 -0
- package/form-cascader/index.mjs +2 -0
- package/form-check-box-group/index.d.ts +289 -18
- package/form-check-box-group/index.mjs +1 -1
- package/form-check-box-group/style.css +1 -0
- package/form-checkbox/index.d.ts +236 -16
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.d.ts +390 -19
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +87 -20
- package/form-holder/index.mjs +1 -1
- package/form-holder/style.css +1 -1
- package/form-image/index.d.ts +145 -13
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +301 -20
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-cron-expression/index.d.ts +217 -0
- package/form-input-cron-expression/index.mjs +2 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.d.ts +307 -16
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +307 -16
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +246 -18
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +307 -16
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +263 -1
- package/form-input-tag/index.mjs +1 -3
- package/form-input-time/index.d.ts +434 -1
- package/form-input-time/index.mjs +1 -3
- package/form-item-config-provider/index.d.ts +22 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-group/index.d.ts +91 -17
- package/form-item-group/index.mjs +2 -78
- package/form-item-group/style.css +1 -1
- package/form-item-x/index.d.ts +141 -11
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -0
- package/form-radio-group/index.d.ts +303 -16
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +254 -14
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.mjs +27 -26
- package/form-row/index.d.ts +2 -2
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +537 -18
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +283 -16
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +272 -14
- package/form-switch/index.mjs +1 -1
- package/form-text/index.d.ts +165 -13
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +351 -0
- package/form-textarea/index.mjs +2 -0
- package/form-time-select/index.d.ts +319 -0
- package/form-time-select/index.mjs +2 -0
- package/form-view/index.mjs +1 -1
- package/helper/dictionary.d.ts +15 -0
- package/helper/dictionary.mjs +97 -0
- package/hook/useDictionary.d.ts +60 -0
- package/hook/useDictionary.mjs +15 -0
- package/hook/useVisibilityChange.d.ts +4 -0
- package/hook/useVisibilityChange.mjs +14 -0
- package/iframe-window/index.d.ts +9 -0
- package/iframe-window/index.mjs +37 -0
- package/iframe-window/style.css +1 -0
- package/index.d.ts +52 -36
- package/index.mjs +54 -61
- package/package.json +10 -5
- package/pageable-table/index.d.ts +398 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/resize-observer/index.d.ts +8 -0
- package/resize-observer/index.mjs +40 -0
- package/resize-observer/style.css +1 -0
- package/resolver/index.mjs +29 -0
- package/table-column/index.d.ts +160 -0
- package/table-column/index.mjs +2 -0
- package/table-column/style.css +1 -0
- package/table-column-def/index.d.ts +85 -0
- package/table-column-def/index.mjs +11 -0
- package/table-view/index.d.ts +340 -1
- package/table-view/index.mjs +453 -6
- package/table-view/style.css +1 -0
- package/toolbar/index.d.ts +128 -1
- package/toolbar/index.mjs +1 -8
- package/toolbar/style.css +1 -0
- package/toolbar-button/index.d.ts +188 -1
- package/toolbar-button/index.mjs +1 -8
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +2 -0
- package/vue-cron/style.css +1 -0
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/x-input-tag/index.mjs +227 -0
- package/x-input-tag/style.css +1 -0
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +2 -0
- package/year-calendar/style.css +1 -0
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/B5BIQCcK.mjs +0 -149
- package/chunks/BHNKrW1j.mjs +0 -61
- package/chunks/BO9jWhBl.mjs +0 -46
- package/chunks/BZ8aOa78.mjs +0 -35
- package/chunks/Bsz7y4Xp.mjs +0 -73
- package/chunks/Bxj372sF.mjs +0 -53
- package/chunks/C33EmJN8.mjs +0 -32
- package/chunks/C6Li3-l7.mjs +0 -28
- package/chunks/CBcdalMX.mjs +0 -35
- package/chunks/CdRsyF0n.mjs +0 -43
- package/chunks/ClNahmiU.mjs +0 -23
- package/chunks/CstztYMu.mjs +0 -28
- package/chunks/DC9b53M6.mjs +0 -32
- package/chunks/DDVAgRED.mjs +0 -36
- package/chunks/DpJQABVD.mjs +0 -91
- package/chunks/ZsLNWI9x.mjs +0 -46
- package/chunks/jn_iQrVZ.mjs +0 -28
- package/constants.d.ts +0 -1
- package/constants.mjs +0 -4
- package/input/style.css +0 -1
- package/resolver.mjs +0 -79
- package/utils/style.css +0 -1
- /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { t as e } from "./B1MSrc6f.mjs";
|
|
2
|
+
import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, createVNode as o, normalizeClass as s, normalizeStyle as c, openBlock as l, renderList as u, toDisplayString as d, withModifiers as f } from "vue";
|
|
3
|
+
import p from "dayjs";
|
|
4
|
+
//#region src/components/material-year-calendar/MonthCalendar.vue
|
|
5
|
+
var m = {
|
|
6
|
+
name: "MonthCalendar",
|
|
7
|
+
props: {
|
|
8
|
+
activeDates: {
|
|
9
|
+
type: Array,
|
|
10
|
+
default: () => []
|
|
11
|
+
},
|
|
12
|
+
month: {
|
|
13
|
+
type: [String, Number],
|
|
14
|
+
default: () => p().month() + 1
|
|
15
|
+
},
|
|
16
|
+
year: {
|
|
17
|
+
type: [String, Number],
|
|
18
|
+
default: () => p().year()
|
|
19
|
+
},
|
|
20
|
+
lang: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "en"
|
|
23
|
+
},
|
|
24
|
+
activeClass: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: () => ""
|
|
27
|
+
},
|
|
28
|
+
prefixClass: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: () => "calendar--active"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emits: ["toggleDate", "monthClickEvent"],
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
showDays: [],
|
|
37
|
+
isMouseDown: !1
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
weekTitleFontSizeAdjustLang() {
|
|
42
|
+
return {
|
|
43
|
+
tw: "16px",
|
|
44
|
+
en: "14px",
|
|
45
|
+
pt: "14px",
|
|
46
|
+
de: "14px",
|
|
47
|
+
es: "14px",
|
|
48
|
+
pl: "12px",
|
|
49
|
+
ru: "14px"
|
|
50
|
+
}[this.lang];
|
|
51
|
+
},
|
|
52
|
+
monthTitle() {
|
|
53
|
+
return {
|
|
54
|
+
tw: [
|
|
55
|
+
"一月",
|
|
56
|
+
"二月",
|
|
57
|
+
"三月",
|
|
58
|
+
"四月",
|
|
59
|
+
"五月",
|
|
60
|
+
"六月",
|
|
61
|
+
"七月",
|
|
62
|
+
"八月",
|
|
63
|
+
"九月",
|
|
64
|
+
"十月",
|
|
65
|
+
"十一月",
|
|
66
|
+
"十二月"
|
|
67
|
+
],
|
|
68
|
+
en: [
|
|
69
|
+
"January",
|
|
70
|
+
"February",
|
|
71
|
+
"March",
|
|
72
|
+
"April",
|
|
73
|
+
"May",
|
|
74
|
+
"June",
|
|
75
|
+
"July",
|
|
76
|
+
"August",
|
|
77
|
+
"September",
|
|
78
|
+
"October",
|
|
79
|
+
"November",
|
|
80
|
+
"December"
|
|
81
|
+
],
|
|
82
|
+
pt: [
|
|
83
|
+
"Janeiro",
|
|
84
|
+
"Fevereiro",
|
|
85
|
+
"Março",
|
|
86
|
+
"Abril",
|
|
87
|
+
"Maio",
|
|
88
|
+
"Junho",
|
|
89
|
+
"Julho",
|
|
90
|
+
"Agosto",
|
|
91
|
+
"Setembro",
|
|
92
|
+
"Outubro",
|
|
93
|
+
"Novembro",
|
|
94
|
+
"Dezembro"
|
|
95
|
+
],
|
|
96
|
+
de: [
|
|
97
|
+
"Januar",
|
|
98
|
+
"Februar",
|
|
99
|
+
"März",
|
|
100
|
+
"April",
|
|
101
|
+
"Mai",
|
|
102
|
+
"Juni",
|
|
103
|
+
"Juli",
|
|
104
|
+
"August",
|
|
105
|
+
"September",
|
|
106
|
+
"Oktober",
|
|
107
|
+
"November",
|
|
108
|
+
"Dezember"
|
|
109
|
+
],
|
|
110
|
+
es: [
|
|
111
|
+
"Enero",
|
|
112
|
+
"Febrero",
|
|
113
|
+
"Marzo",
|
|
114
|
+
"Abril",
|
|
115
|
+
"Mayo",
|
|
116
|
+
"Junio",
|
|
117
|
+
"Julio",
|
|
118
|
+
"Agosto",
|
|
119
|
+
"Septiembre",
|
|
120
|
+
"Octubre",
|
|
121
|
+
"Noviembre",
|
|
122
|
+
"Diciembre"
|
|
123
|
+
],
|
|
124
|
+
pl: [
|
|
125
|
+
"Styczeń",
|
|
126
|
+
"Luty",
|
|
127
|
+
"Marzec",
|
|
128
|
+
"Kwiecień",
|
|
129
|
+
"Maj",
|
|
130
|
+
"Czerwiec",
|
|
131
|
+
"Lipiec",
|
|
132
|
+
"Sierpień",
|
|
133
|
+
"Wrzesień",
|
|
134
|
+
"Październik",
|
|
135
|
+
"Listopad",
|
|
136
|
+
"Grudzień"
|
|
137
|
+
],
|
|
138
|
+
ru: [
|
|
139
|
+
"Январь",
|
|
140
|
+
"Февраль",
|
|
141
|
+
"Март",
|
|
142
|
+
"Апрель",
|
|
143
|
+
"Май",
|
|
144
|
+
"Июнь",
|
|
145
|
+
"Июль",
|
|
146
|
+
"Август",
|
|
147
|
+
"Сентябрь",
|
|
148
|
+
"Октябрь",
|
|
149
|
+
"Ноябрь",
|
|
150
|
+
"Декабрь"
|
|
151
|
+
]
|
|
152
|
+
}[this.lang][this.month - 1];
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
watch: {
|
|
156
|
+
year(e) {
|
|
157
|
+
this.initCalendar();
|
|
158
|
+
},
|
|
159
|
+
activeDates(e, t) {
|
|
160
|
+
this.initCalendar();
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
created() {
|
|
164
|
+
this.initCalendar();
|
|
165
|
+
},
|
|
166
|
+
methods: {
|
|
167
|
+
initCalendar() {
|
|
168
|
+
if (!this.year || !this.month) return [];
|
|
169
|
+
let e = p().set("date", 1).set("year", this.year).set("month", this.month - 1), t = e.startOf("month").day() - 1;
|
|
170
|
+
t < 0 && (t += 7);
|
|
171
|
+
let n = e.endOf("month").date(), r = t >= 5 ? 6 : 5, i = 0;
|
|
172
|
+
this.showDays = Array.from(Array(r * 7).keys()).map((e) => ({
|
|
173
|
+
value: t <= e ? i++ % n + 1 : "",
|
|
174
|
+
active: !1,
|
|
175
|
+
isOtherMonth: t > e || i > n
|
|
176
|
+
})), this.activeDates.forEach((e) => {
|
|
177
|
+
let n;
|
|
178
|
+
typeof e == "string" ? n = {
|
|
179
|
+
date: e,
|
|
180
|
+
className: this.activeClass
|
|
181
|
+
} : typeof e == "object" && (n = e);
|
|
182
|
+
let r = p(n.date);
|
|
183
|
+
if (r.year() !== this.year) return;
|
|
184
|
+
let i = r.date(), a = Math.floor(i / 7), o = i % 7 - 1 + t + 7 * a;
|
|
185
|
+
this.showDays[o].active = !0, this.showDays[o].className = n.className;
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
showDayTitle(e) {
|
|
189
|
+
return {
|
|
190
|
+
tw: [
|
|
191
|
+
"一",
|
|
192
|
+
"二",
|
|
193
|
+
"三",
|
|
194
|
+
"四",
|
|
195
|
+
"五",
|
|
196
|
+
"六",
|
|
197
|
+
"日"
|
|
198
|
+
],
|
|
199
|
+
en: [
|
|
200
|
+
"Mo",
|
|
201
|
+
"Tu",
|
|
202
|
+
"We",
|
|
203
|
+
"Th",
|
|
204
|
+
"Fr",
|
|
205
|
+
"Sa",
|
|
206
|
+
"Su"
|
|
207
|
+
],
|
|
208
|
+
pt: [
|
|
209
|
+
"2ª",
|
|
210
|
+
"3ª",
|
|
211
|
+
"4ª",
|
|
212
|
+
"5ª",
|
|
213
|
+
"6ª",
|
|
214
|
+
"Sa",
|
|
215
|
+
"Do"
|
|
216
|
+
],
|
|
217
|
+
de: [
|
|
218
|
+
"Mo",
|
|
219
|
+
"Di",
|
|
220
|
+
"Mi",
|
|
221
|
+
"Do",
|
|
222
|
+
"Fr",
|
|
223
|
+
"Sa",
|
|
224
|
+
"So"
|
|
225
|
+
],
|
|
226
|
+
es: [
|
|
227
|
+
"Lu",
|
|
228
|
+
"Ma",
|
|
229
|
+
"Mi",
|
|
230
|
+
"Ju",
|
|
231
|
+
"Vi",
|
|
232
|
+
"Sá",
|
|
233
|
+
"Do"
|
|
234
|
+
],
|
|
235
|
+
pl: [
|
|
236
|
+
"Pon",
|
|
237
|
+
"Wt",
|
|
238
|
+
"Śr",
|
|
239
|
+
"Czw",
|
|
240
|
+
"Pt",
|
|
241
|
+
"Sob",
|
|
242
|
+
"Nie"
|
|
243
|
+
],
|
|
244
|
+
ru: [
|
|
245
|
+
"Пн",
|
|
246
|
+
"Вт",
|
|
247
|
+
"Ср",
|
|
248
|
+
"Чт",
|
|
249
|
+
"Пт",
|
|
250
|
+
"Сб",
|
|
251
|
+
"Вс"
|
|
252
|
+
]
|
|
253
|
+
}[this.lang][e];
|
|
254
|
+
},
|
|
255
|
+
toggleDay(e) {
|
|
256
|
+
e.isOtherMonth || this.$emit("toggleDate", {
|
|
257
|
+
month: this.month,
|
|
258
|
+
date: e.value,
|
|
259
|
+
selected: !e.active,
|
|
260
|
+
className: this.activeClass
|
|
261
|
+
});
|
|
262
|
+
},
|
|
263
|
+
dragDay(e) {
|
|
264
|
+
this.isMouseDown && this.toggleDay(e);
|
|
265
|
+
},
|
|
266
|
+
mouseDown(e) {
|
|
267
|
+
this.toggleDay(e), this.isMouseDown = !0;
|
|
268
|
+
},
|
|
269
|
+
mouseUp() {
|
|
270
|
+
this.isMouseDown = !1;
|
|
271
|
+
},
|
|
272
|
+
classList(e) {
|
|
273
|
+
let t = {
|
|
274
|
+
"calendar__day--otherMonth": e.isOtherMonth,
|
|
275
|
+
[this.prefixClass]: e.active
|
|
276
|
+
};
|
|
277
|
+
return e.active && (t[e.className] = !0), t;
|
|
278
|
+
},
|
|
279
|
+
monthClickEvent(e) {
|
|
280
|
+
let t = {
|
|
281
|
+
monthTitle: this.monthTitle,
|
|
282
|
+
month: this.month,
|
|
283
|
+
year: e
|
|
284
|
+
};
|
|
285
|
+
this.$emit("monthClickEvent", t);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}, h = { class: "c-wrapper" }, g = { class: "calendar__body" }, _ = ["onMouseover", "onMousedown"];
|
|
289
|
+
function v(e, n, a, o, p, m) {
|
|
290
|
+
return l(), r("div", h, [i("div", {
|
|
291
|
+
class: "calendar",
|
|
292
|
+
onMouseup: n[1] || (n[1] = (...e) => m.mouseUp && m.mouseUp(...e)),
|
|
293
|
+
onMouseleave: n[2] || (n[2] = f((...e) => m.mouseUp && m.mouseUp(...e), ["stop"]))
|
|
294
|
+
}, [i("div", {
|
|
295
|
+
class: "calendar__title",
|
|
296
|
+
onClick: n[0] || (n[0] = (e) => m.monthClickEvent(a.year))
|
|
297
|
+
}, d(m.monthTitle), 1), i("div", g, [(l(), r(t, null, u(7, (e, t) => i("div", {
|
|
298
|
+
key: `title${e}`,
|
|
299
|
+
class: "calendar__day day__weektitle",
|
|
300
|
+
style: c({ fontSize: m.weekTitleFontSizeAdjustLang })
|
|
301
|
+
}, d(m.showDayTitle(t)), 5)), 64)), (l(!0), r(t, null, u(p.showDays, (e, t) => (l(), r("div", {
|
|
302
|
+
key: `day${t}`,
|
|
303
|
+
class: "calendar__day"
|
|
304
|
+
}, [i("div", {
|
|
305
|
+
class: s(["day", m.classList(e)]),
|
|
306
|
+
onMouseover: (t) => m.dragDay(e),
|
|
307
|
+
onMousedown: (t) => m.mouseDown(e)
|
|
308
|
+
}, d(e.value), 43, _)]))), 128))])], 32)]);
|
|
309
|
+
}
|
|
310
|
+
var y = /* @__PURE__ */ e(m, [["render", v], ["__scopeId", "data-v-2a7f150d"]]), b = {
|
|
311
|
+
name: "YearCalendar",
|
|
312
|
+
components: { MonthCalendar: y },
|
|
313
|
+
props: {
|
|
314
|
+
showYearSelector: {
|
|
315
|
+
type: Boolean,
|
|
316
|
+
default: () => !0
|
|
317
|
+
},
|
|
318
|
+
activeDates: {
|
|
319
|
+
type: Array,
|
|
320
|
+
default: () => [],
|
|
321
|
+
validator: (e) => {
|
|
322
|
+
let t = !0, n = null;
|
|
323
|
+
return e.forEach((e) => {
|
|
324
|
+
typeof e == "string" ? n = e : typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "date") && (n = e.date), /^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n) || (t = !1);
|
|
325
|
+
let r = n.split("-"), i = parseInt(r[2], 10), a = parseInt(r[1], 10), o = parseInt(r[0], 10);
|
|
326
|
+
(o < 1e3 || o > 3e3 || a === 0 || a > 12) && (t = !1);
|
|
327
|
+
let s = [
|
|
328
|
+
31,
|
|
329
|
+
28,
|
|
330
|
+
31,
|
|
331
|
+
30,
|
|
332
|
+
31,
|
|
333
|
+
30,
|
|
334
|
+
31,
|
|
335
|
+
31,
|
|
336
|
+
30,
|
|
337
|
+
31,
|
|
338
|
+
30,
|
|
339
|
+
31
|
|
340
|
+
];
|
|
341
|
+
(o % 400 == 0 || o % 100 != 0 && o % 4 == 0) && (s[1] = 29), i > 0 && i <= s[a - 1] || (t = !1);
|
|
342
|
+
}), t;
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
modelValue: {
|
|
346
|
+
type: [String, Number],
|
|
347
|
+
default: p().year()
|
|
348
|
+
},
|
|
349
|
+
lang: {
|
|
350
|
+
type: String,
|
|
351
|
+
default: "en"
|
|
352
|
+
},
|
|
353
|
+
activeClass: {
|
|
354
|
+
type: String,
|
|
355
|
+
default: () => ""
|
|
356
|
+
},
|
|
357
|
+
prefixClass: {
|
|
358
|
+
type: String,
|
|
359
|
+
default: () => "calendar--active"
|
|
360
|
+
},
|
|
361
|
+
hideWeekend: {
|
|
362
|
+
type: Boolean,
|
|
363
|
+
default: !1
|
|
364
|
+
},
|
|
365
|
+
hideSunday: {
|
|
366
|
+
type: Boolean,
|
|
367
|
+
default: !1
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
emits: [
|
|
371
|
+
"toggleDate",
|
|
372
|
+
"monthClick",
|
|
373
|
+
"update:activeDates",
|
|
374
|
+
"update:modelValue"
|
|
375
|
+
],
|
|
376
|
+
data() {
|
|
377
|
+
return { isUsingString: !0 };
|
|
378
|
+
},
|
|
379
|
+
computed: {
|
|
380
|
+
month() {
|
|
381
|
+
let e = {};
|
|
382
|
+
return this.activeDates.forEach((t) => {
|
|
383
|
+
let n;
|
|
384
|
+
if (n = typeof t == "string" ? {
|
|
385
|
+
date: t,
|
|
386
|
+
className: this.activeClass
|
|
387
|
+
} : {
|
|
388
|
+
date: t.date,
|
|
389
|
+
className: t.className || ""
|
|
390
|
+
}, p(n.date).year() !== parseInt(this.modelValue)) return;
|
|
391
|
+
let r = (p(n.date).month() + 1).toString();
|
|
392
|
+
e[r] || (e[r] = []), e[r].push(n);
|
|
393
|
+
}), e;
|
|
394
|
+
},
|
|
395
|
+
activeYear: {
|
|
396
|
+
get() {
|
|
397
|
+
return parseInt(this.modelValue);
|
|
398
|
+
},
|
|
399
|
+
set(e) {
|
|
400
|
+
this.$emit("update:modelValue", e);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
created() {
|
|
405
|
+
this.isUsingString = this.activeDates.length && typeof this.activeDates[0] == "string";
|
|
406
|
+
},
|
|
407
|
+
methods: {
|
|
408
|
+
changeYear(e) {
|
|
409
|
+
this.activeYear = e + this.activeYear - 3;
|
|
410
|
+
},
|
|
411
|
+
toggleDate(e) {
|
|
412
|
+
let t = p().set("year", this.modelValue).set("month", e.month - 1).set("date", e.date).format("YYYY-MM-DD");
|
|
413
|
+
this.$emit("toggleDate", {
|
|
414
|
+
date: t,
|
|
415
|
+
selected: e.selected,
|
|
416
|
+
className: e.className
|
|
417
|
+
});
|
|
418
|
+
let n, r;
|
|
419
|
+
if (this.isUsingString) n = this.activeDates.indexOf(t), r = this.modifiedActiveDates(n, t);
|
|
420
|
+
else {
|
|
421
|
+
let i = {
|
|
422
|
+
date: t,
|
|
423
|
+
className: e.className
|
|
424
|
+
};
|
|
425
|
+
n = this.activeDates.indexOf(this.activeDates.find((e) => e.date === t)), r = this.modifiedActiveDates(n, i);
|
|
426
|
+
}
|
|
427
|
+
this.$emit("update:activeDates", r);
|
|
428
|
+
},
|
|
429
|
+
modifiedActiveDates(e, t) {
|
|
430
|
+
let n = [...this.activeDates];
|
|
431
|
+
return e === -1 ? n.push(t) : n.splice(e, 1), n;
|
|
432
|
+
},
|
|
433
|
+
monthClick(e) {
|
|
434
|
+
this.$emit("monthClick", e);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}, x = { class: "vue-calendar__container" }, S = {
|
|
438
|
+
key: 0,
|
|
439
|
+
class: "container__year"
|
|
440
|
+
}, C = ["onClick"];
|
|
441
|
+
function w(e, c, f, p, m, h) {
|
|
442
|
+
let g = y;
|
|
443
|
+
return l(), r("div", x, [f.showYearSelector ? (l(), r("div", S, [
|
|
444
|
+
n(" <span><button @click=\"addYear(-1)\">back</button></span> "),
|
|
445
|
+
(l(), r(t, null, u(5, (e) => i("span", {
|
|
446
|
+
key: e,
|
|
447
|
+
class: "year__chooser",
|
|
448
|
+
onClick: (t) => h.changeYear(e)
|
|
449
|
+
}, d(e + h.activeYear - 3), 9, C)), 64)),
|
|
450
|
+
n(" <span><button @click=\"addYear(1)\">next</button></span> ")
|
|
451
|
+
])) : n("v-if", !0), i("div", { class: s(["container__months", {
|
|
452
|
+
"hide-weekend": f.hideWeekend,
|
|
453
|
+
"hide-sunday": f.hideSunday
|
|
454
|
+
}]) }, [(l(), r(t, null, u(12, (e) => o(g, {
|
|
455
|
+
key: `month-${e}`,
|
|
456
|
+
class: "container__month",
|
|
457
|
+
year: h.activeYear,
|
|
458
|
+
month: e,
|
|
459
|
+
"active-dates": h.month[e],
|
|
460
|
+
"active-class": f.activeClass,
|
|
461
|
+
lang: f.lang,
|
|
462
|
+
"prefix-class": f.prefixClass,
|
|
463
|
+
onToggleDate: h.toggleDate,
|
|
464
|
+
onMonthClickEvent: h.monthClick
|
|
465
|
+
}, null, 8, [
|
|
466
|
+
"year",
|
|
467
|
+
"month",
|
|
468
|
+
"active-dates",
|
|
469
|
+
"active-class",
|
|
470
|
+
"lang",
|
|
471
|
+
"prefix-class",
|
|
472
|
+
"onToggleDate",
|
|
473
|
+
"onMonthClickEvent"
|
|
474
|
+
])), 64)), c[0] || (c[0] = a("<div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div>", 5))], 2)]);
|
|
475
|
+
}
|
|
476
|
+
var T = /* @__PURE__ */ e(b, [["render", w], ["__scopeId", "data-v-5cc87b9a"]]);
|
|
477
|
+
//#endregion
|
|
478
|
+
export { T as t };
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { a as e, d as t, f as n } from "./cmuHpsX6.mjs";
|
|
2
|
+
import { formHolderContextKey as r, formItemConfigProviderContextKey as i, formItemGroupContextKey as a } from "../constants/index.mjs";
|
|
3
|
+
import { isArray as o, isPlainObject as s, isString as c } from "@web-utils/core";
|
|
4
|
+
import { computed as l, createVNode as u, h as d, inject as f, mergeProps as p, nextTick as m, unref as h, useTemplateRef as g } from "vue";
|
|
5
|
+
import { ElCol as _, rowContextKey as v } from "element-plus";
|
|
6
|
+
import { ElCol as y, ElFormItem as b, ElTooltip as x } from "element-plus/es";
|
|
7
|
+
//#region src/components/form/props/form-item.ts
|
|
8
|
+
var S = {
|
|
9
|
+
prop: [String, Array],
|
|
10
|
+
label: String,
|
|
11
|
+
labelPosition: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
labelWidth: [String, Number],
|
|
16
|
+
required: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !1
|
|
19
|
+
},
|
|
20
|
+
rules: Object,
|
|
21
|
+
error: String,
|
|
22
|
+
showMessage: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
inlineMessage: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
size: String,
|
|
31
|
+
for: String,
|
|
32
|
+
validateStatus: String,
|
|
33
|
+
messagePrefix: String,
|
|
34
|
+
message: String,
|
|
35
|
+
wrapCol: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !0
|
|
38
|
+
},
|
|
39
|
+
fixedSpan: Number,
|
|
40
|
+
block: Boolean,
|
|
41
|
+
unwrap: Boolean,
|
|
42
|
+
half: Boolean,
|
|
43
|
+
formItemClass: String,
|
|
44
|
+
hideLabel: Boolean,
|
|
45
|
+
tips: { type: String },
|
|
46
|
+
tipsAfterLabel: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
labelColspan: [Number, String],
|
|
51
|
+
inputColspan: [Number, String],
|
|
52
|
+
labelRowspan: [Number, String],
|
|
53
|
+
inputRowspan: [Number, String]
|
|
54
|
+
}, C = {
|
|
55
|
+
required: !0,
|
|
56
|
+
rules: !0,
|
|
57
|
+
messagePrefix: !0,
|
|
58
|
+
message: !0,
|
|
59
|
+
wrapCol: !0,
|
|
60
|
+
fixedSpan: !0,
|
|
61
|
+
block: !0,
|
|
62
|
+
unwrap: !0,
|
|
63
|
+
half: !0,
|
|
64
|
+
formItemClass: !0,
|
|
65
|
+
hideLabel: !0,
|
|
66
|
+
tips: !0,
|
|
67
|
+
tipsAfterLabel: !0,
|
|
68
|
+
labelColspan: !0,
|
|
69
|
+
inputColspan: !0,
|
|
70
|
+
labelRowspan: !0,
|
|
71
|
+
inputRowspan: !0
|
|
72
|
+
}, w = (e) => S[e] !== void 0 && C[e] !== !0, T = (t, { emit: n, events: r, predicate: i }) => l(() => e(t, i, r, n)), E = {
|
|
73
|
+
span: {
|
|
74
|
+
type: Number,
|
|
75
|
+
default: 12
|
|
76
|
+
},
|
|
77
|
+
offset: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 0
|
|
80
|
+
},
|
|
81
|
+
push: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 0
|
|
84
|
+
},
|
|
85
|
+
pull: {
|
|
86
|
+
type: Number,
|
|
87
|
+
default: 0
|
|
88
|
+
},
|
|
89
|
+
xs: { type: [Number, Object] },
|
|
90
|
+
sm: { type: [Number, Object] },
|
|
91
|
+
md: { type: [Number, Object] },
|
|
92
|
+
lg: { type: [Number, Object] },
|
|
93
|
+
xl: { type: [Number, Object] },
|
|
94
|
+
tag: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "div"
|
|
97
|
+
}
|
|
98
|
+
}, D = { span: !0 }, O = (e) => E[e] !== void 0 && D[e] !== !0, k = (t, { emit: n, events: r, predicate: i }) => l(() => e(t, i, r, n)), A = (e) => {
|
|
99
|
+
let t = f(r, null);
|
|
100
|
+
return l(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
|
|
101
|
+
}, j = (e, t) => {
|
|
102
|
+
c(t) ? e.push(t) : o(t) ? e.push(...t) : s(t) && e.push(t);
|
|
103
|
+
}, M = (e, { rules: t, attrs: n, messagePrefix: r, message: i, ...a } = {}) => {
|
|
104
|
+
let o = A(e);
|
|
105
|
+
return l(() => {
|
|
106
|
+
let s = { message: i }, c = h(t);
|
|
107
|
+
Object.keys({
|
|
108
|
+
...S,
|
|
109
|
+
...E
|
|
110
|
+
}).forEach((t) => {
|
|
111
|
+
t === "rules" ? e[t] && c ? s[t] = [...e[t], ...c] : e[t] ? s[t] = e[t] : c && (s[t] = c) : t === "messagePrefix" ? s[t] = e.messagePrefix || r : s[t] = e[t];
|
|
112
|
+
});
|
|
113
|
+
let l = [];
|
|
114
|
+
return j(l, h(n == null ? void 0 : n.class)), j(l, h(a == null ? void 0 : a.class)), s.required = o.value, s.class = l, s.style = n == null ? void 0 : n.style, s;
|
|
115
|
+
});
|
|
116
|
+
}, N = {
|
|
117
|
+
name: "FormItemX",
|
|
118
|
+
inheritAttrs: !1,
|
|
119
|
+
props: {
|
|
120
|
+
...S,
|
|
121
|
+
...E
|
|
122
|
+
},
|
|
123
|
+
setup(e, { attrs: t, slots: n, expose: a }) {
|
|
124
|
+
let o = f(v, null), s = f(i, null), c = f(r, null), d = t.embed ? l(() => t.disabled) : F(e), h = T(e, { predicate: w }), _ = k(e, { predicate: O }), S = l(() => (s == null ? void 0 : s.reactive) === !0 && s.block === !1 && e.fixedSpan === void 0 && !e.half), C = A(e), E = g("formItem"), D = l(() => (s == null ? void 0 : s.wrapCol) === !1 ? !1 : !!o && e.wrapCol), j = l(() => c != null && c.tableForm ? "" : s != null && s.block ? "100%" : e.half && D.value ? `calc(50% - ${o.gutter.value / 2}px)` : ""), M = l(() => (s == null ? void 0 : s.block) === !0 || e.block || e.half ? 24 : e.span), N = l(() => {
|
|
125
|
+
if (d.value) return [];
|
|
126
|
+
if (C.value) {
|
|
127
|
+
let t = {
|
|
128
|
+
required: !0,
|
|
129
|
+
message: e.message || `${e.messagePrefix || "请输入"}${e.label}`
|
|
130
|
+
};
|
|
131
|
+
return e.rules ? [...e.rules, t] : [t];
|
|
132
|
+
}
|
|
133
|
+
return e.rules;
|
|
134
|
+
});
|
|
135
|
+
return a({
|
|
136
|
+
clearValidate: async () => {
|
|
137
|
+
var e;
|
|
138
|
+
await m(), (e = E.value) == null || e.clearValidate();
|
|
139
|
+
},
|
|
140
|
+
validate: async () => {
|
|
141
|
+
var e;
|
|
142
|
+
await m(), (e = E.value) == null || e.validate();
|
|
143
|
+
}
|
|
144
|
+
}), () => {
|
|
145
|
+
var r;
|
|
146
|
+
let i = n.tips || e.tips, a = i ? u(x, {
|
|
147
|
+
effect: "light",
|
|
148
|
+
content: e.tips,
|
|
149
|
+
offset: 4
|
|
150
|
+
}, {
|
|
151
|
+
default: () => u("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
152
|
+
content: n.tips ? n.tips : null
|
|
153
|
+
}) : null, o = u(b, p(h.value, t, {
|
|
154
|
+
ref: "formItem",
|
|
155
|
+
style: { width: j.value },
|
|
156
|
+
class: [
|
|
157
|
+
"form-item",
|
|
158
|
+
e.formItemClass,
|
|
159
|
+
{
|
|
160
|
+
"form-item-hide-label": e.hideLabel,
|
|
161
|
+
"with-tips": !e.tipsAfterLabel && i,
|
|
162
|
+
required: d.value === !1 && C.value
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
rules: N.value
|
|
166
|
+
}), {
|
|
167
|
+
...n,
|
|
168
|
+
default: () => {
|
|
169
|
+
var t;
|
|
170
|
+
return [(t = n.default) == null ? void 0 : t.call(n, {
|
|
171
|
+
disabled: d.value,
|
|
172
|
+
required: C.value
|
|
173
|
+
}), i && !e.tipsAfterLabel ? a : null];
|
|
174
|
+
},
|
|
175
|
+
label: () => [n.label ? n.label() : e.label, e.tipsAfterLabel ? a : null]
|
|
176
|
+
}), s = [o, (r = n.below) == null ? void 0 : r.call(n)];
|
|
177
|
+
return e.unwrap ? s : D.value ? u(y, p(_.value, S.value ? {
|
|
178
|
+
xs: 24,
|
|
179
|
+
sm: 12,
|
|
180
|
+
md: 12,
|
|
181
|
+
lg: 8,
|
|
182
|
+
xl: 6
|
|
183
|
+
} : {}, { span: M.value }), { default: () => s }) : o;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}, P = "update:modelValue", F = (e) => {
|
|
187
|
+
let t = f(r, null), n = f(a, null);
|
|
188
|
+
return l(() => {
|
|
189
|
+
if (e.disabled !== void 0) return e.disabled;
|
|
190
|
+
if (t) {
|
|
191
|
+
if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
|
|
192
|
+
if (t.disabledFieldsMap[e.prop] === !0) return !0;
|
|
193
|
+
}
|
|
194
|
+
return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
|
|
195
|
+
});
|
|
196
|
+
}, I = { [P]: null }, L = (e, t) => e(P, t), R = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? d(N, {
|
|
197
|
+
...n.value,
|
|
198
|
+
embed: !0,
|
|
199
|
+
disabled: i == null ? void 0 : i.value
|
|
200
|
+
}, {
|
|
201
|
+
default: () => t,
|
|
202
|
+
label: r.label,
|
|
203
|
+
error: r.error,
|
|
204
|
+
tips: r.tips,
|
|
205
|
+
below: r.below
|
|
206
|
+
}) : t, z = (r, { emit: i, slots: a, attrs: o, rules: s, events: c, predicate: u, messagePrefix: f = "请输入", removeOn: p = !1, ...m }) => {
|
|
207
|
+
let h = F(r), g = l(() => h.value ? "" : `${f}${r.label}`), v = M(r, {
|
|
208
|
+
rules: s,
|
|
209
|
+
attrs: o,
|
|
210
|
+
message: g.value,
|
|
211
|
+
...m
|
|
212
|
+
}), y = (e) => L(i, e), b = (e) => r.col ? d(_, { span: r.block ? 24 : r.span }, { default: () => e }) : e, x = ({ vNodes: e }) => R(r, {
|
|
213
|
+
vNodes: b(e),
|
|
214
|
+
formItemProps: v,
|
|
215
|
+
slots: a,
|
|
216
|
+
disabled: h
|
|
217
|
+
}), S = l(() => e(r, u, c, i)), C = n({ removeOn: p });
|
|
218
|
+
return {
|
|
219
|
+
emitInput: y,
|
|
220
|
+
render: x,
|
|
221
|
+
placeholder: g,
|
|
222
|
+
disabled: h,
|
|
223
|
+
formItemProps: v,
|
|
224
|
+
autoBind: S,
|
|
225
|
+
inputProps: t(r, u),
|
|
226
|
+
listeners: C
|
|
227
|
+
};
|
|
228
|
+
}, B = (e) => e.icon ? d("i", { class: e.icon }) : null;
|
|
229
|
+
//#endregion
|
|
230
|
+
export { N as a, S as c, z as i, I as n, M as o, R as r, E as s, B as t };
|