hys-ui 0.7.0 → 0.8.0
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/CHANGELOG.md +6 -0
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +102 -48
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +874 -532
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +209 -168
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +102 -48
- package/dist/composables/datePicker.js +153 -94
- package/dist/composables/datePickerModel.js +156 -0
- package/dist/composables/datePickerPanels.js +78 -0
- package/dist/composables/datePickerRules.js +166 -0
- package/dist/composables/floatingPosition.js +32 -13
- package/dist/composables/useDatePicker.js +274 -381
- package/dist/composables/useFloating.js +21 -20
- package/dist/style.css +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +6 -9
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +12 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +6 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +6 -9
- package/dist/types/components/HysIcon/HysIcon.vue.d.ts +1 -1
- package/dist/types/composables/datePicker.d.ts +14 -214
- package/dist/types/composables/datePickerModel.d.ts +63 -0
- package/dist/types/composables/datePickerPanels.d.ts +23 -0
- package/dist/types/composables/datePickerRules.d.ts +31 -0
- package/dist/types/composables/datePickerTypes.d.ts +277 -0
- package/dist/types/composables/floatingPosition.d.ts +1 -1
- package/dist/types/composables/useColorPicker.d.ts +1 -3
- package/dist/types/composables/useContextMenu.d.ts +1 -3
- package/dist/types/composables/useDatePicker.d.ts +20 -11
- package/dist/types/composables/useFloating.d.ts +2 -3
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { defineComponent as v, useSlots as
|
|
2
|
-
import
|
|
3
|
-
import { datePickerDefaults as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as v, useSlots as c, ref as h, computed as p, openBlock as k, createBlock as $, mergeProps as B, toHandlers as g, unref as b, createSlots as w, withCtx as l, renderSlot as n, normalizeProps as s, guardReactiveProps as r, mergeDefaults as C } from "vue";
|
|
2
|
+
import P from "../HysDatePicker/HysDatePickerControl.vue.js";
|
|
3
|
+
import { datePickerDefaults as F } from "../../composables/datePicker.js";
|
|
4
|
+
const O = /* @__PURE__ */ v({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "HysDateRangePicker",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ C({
|
|
8
8
|
popupTransition: {},
|
|
9
9
|
popupTransitionDuration: {},
|
|
10
10
|
modelValue: {},
|
|
11
|
+
value: {},
|
|
11
12
|
defaultValue: {},
|
|
12
13
|
clearValue: {},
|
|
14
|
+
emptyValues: {},
|
|
15
|
+
valueOnClear: { type: Function },
|
|
13
16
|
type: {},
|
|
17
|
+
picker: {},
|
|
14
18
|
valueType: {},
|
|
15
19
|
valueFormat: {},
|
|
16
|
-
format: {},
|
|
20
|
+
format: { type: [String, Function, Array] },
|
|
17
21
|
inputFormats: {},
|
|
18
22
|
disabled: { type: [Boolean, Array] },
|
|
19
23
|
readonly: { type: Boolean },
|
|
@@ -21,6 +25,7 @@ const T = /* @__PURE__ */ v({
|
|
|
21
25
|
status: {},
|
|
22
26
|
bordered: { type: Boolean },
|
|
23
27
|
placeholder: {},
|
|
28
|
+
id: {},
|
|
24
29
|
label: {},
|
|
25
30
|
ariaLabel: {},
|
|
26
31
|
name: {},
|
|
@@ -30,6 +35,9 @@ const T = /* @__PURE__ */ v({
|
|
|
30
35
|
max: {},
|
|
31
36
|
disabledDate: { type: Function },
|
|
32
37
|
disabledTime: { type: Function },
|
|
38
|
+
disabledHours: { type: Function },
|
|
39
|
+
disabledMinutes: { type: Function },
|
|
40
|
+
disabledSeconds: { type: Function },
|
|
33
41
|
firstDayOfWeek: {},
|
|
34
42
|
firstWeekContainsDate: {},
|
|
35
43
|
weekNumberFormatter: { type: Function },
|
|
@@ -38,27 +46,40 @@ const T = /* @__PURE__ */ v({
|
|
|
38
46
|
locale: {},
|
|
39
47
|
messages: {},
|
|
40
48
|
showWeekNumbers: { type: Boolean },
|
|
49
|
+
showWeekNumber: { type: Boolean },
|
|
41
50
|
showAdjacentDays: { type: Boolean },
|
|
42
51
|
defaultPickerValue: {},
|
|
43
52
|
panelValue: {},
|
|
53
|
+
panelValues: {},
|
|
44
54
|
mode: {},
|
|
45
55
|
defaultMode: {},
|
|
46
56
|
shortcuts: {},
|
|
57
|
+
presets: {},
|
|
58
|
+
ranges: {},
|
|
59
|
+
shortcutPlacement: {},
|
|
47
60
|
clearable: { type: Boolean },
|
|
61
|
+
allowClear: { type: Boolean },
|
|
48
62
|
editable: { type: Boolean },
|
|
49
63
|
inputReadonly: { type: Boolean },
|
|
50
64
|
showOnFocus: { type: Boolean },
|
|
65
|
+
automaticDropdown: { type: Boolean },
|
|
51
66
|
showToday: { type: Boolean },
|
|
52
67
|
showNow: { type: Boolean },
|
|
53
68
|
showFooter: { type: Boolean },
|
|
54
69
|
showConfirm: { type: Boolean },
|
|
55
|
-
showTime: { type: Boolean },
|
|
70
|
+
showTime: { type: [Boolean, Object] },
|
|
56
71
|
defaultTime: {},
|
|
72
|
+
dateFormat: {},
|
|
73
|
+
timeFormat: {},
|
|
74
|
+
use12Hours: { type: Boolean },
|
|
75
|
+
hideDisabledOptions: { type: Boolean },
|
|
76
|
+
arrowControl: { type: Boolean },
|
|
57
77
|
hourStep: {},
|
|
58
78
|
minuteStep: {},
|
|
59
79
|
secondStep: {},
|
|
60
80
|
showSeconds: { type: Boolean },
|
|
61
81
|
rangeSeparator: {},
|
|
82
|
+
separator: {},
|
|
62
83
|
startPlaceholder: {},
|
|
63
84
|
endPlaceholder: {},
|
|
64
85
|
allowEmpty: {},
|
|
@@ -73,23 +94,35 @@ const T = /* @__PURE__ */ v({
|
|
|
73
94
|
inline: { type: Boolean },
|
|
74
95
|
placement: {},
|
|
75
96
|
appendTo: { type: [String, Boolean] },
|
|
97
|
+
teleported: { type: Boolean },
|
|
98
|
+
getPopupContainer: { type: Function },
|
|
99
|
+
fallbackPlacements: {},
|
|
100
|
+
popperOptions: {},
|
|
76
101
|
popupWidth: {},
|
|
77
102
|
popupClass: {},
|
|
103
|
+
popupClassName: {},
|
|
104
|
+
popperClass: {},
|
|
78
105
|
popupStyle: {},
|
|
106
|
+
popperStyle: {},
|
|
107
|
+
prefixIcon: {},
|
|
108
|
+
clearIcon: {},
|
|
79
109
|
validateEvent: { type: Boolean },
|
|
80
110
|
cellClassName: { type: Function }
|
|
81
|
-
},
|
|
82
|
-
emits: ["update:modelValue", "change", "value-change", "update:open", "visible-change", "update:panelValue", "update:mode", "panelChange", "calendarChange", "clear", "ok", "invalid", "focus", "blur"],
|
|
83
|
-
setup(
|
|
84
|
-
const m =
|
|
85
|
-
|
|
86
|
-
const o =
|
|
111
|
+
}, F),
|
|
112
|
+
emits: ["update:modelValue", "update:value", "change", "value-change", "update:open", "visible-change", "openChange", "update:panelValues", "update:panelValue", "update:mode", "panelChange", "calendarChange", "clear", "ok", "invalid", "focus", "blur"],
|
|
113
|
+
setup(u, { expose: i, emit: d }) {
|
|
114
|
+
const m = u, y = d;
|
|
115
|
+
c();
|
|
116
|
+
const o = h(), f = Object.fromEntries(
|
|
87
117
|
[
|
|
88
118
|
"update:modelValue",
|
|
119
|
+
"update:value",
|
|
89
120
|
"change",
|
|
90
121
|
"value-change",
|
|
91
122
|
"update:open",
|
|
92
123
|
"visible-change",
|
|
124
|
+
"openChange",
|
|
125
|
+
"update:panelValues",
|
|
93
126
|
"update:panelValue",
|
|
94
127
|
"update:mode",
|
|
95
128
|
"panelChange",
|
|
@@ -101,10 +134,10 @@ const T = /* @__PURE__ */ v({
|
|
|
101
134
|
"blur"
|
|
102
135
|
].map((e) => [
|
|
103
136
|
e,
|
|
104
|
-
(...
|
|
137
|
+
(...t) => y(e, ...t)
|
|
105
138
|
])
|
|
106
139
|
);
|
|
107
|
-
return
|
|
140
|
+
return i({
|
|
108
141
|
element: p(() => {
|
|
109
142
|
var e;
|
|
110
143
|
return (e = o.value) == null ? void 0 : e.element;
|
|
@@ -134,8 +167,8 @@ const T = /* @__PURE__ */ v({
|
|
|
134
167
|
return ((e = o.value) == null ? void 0 : e.show()) ?? Promise.resolve(!1);
|
|
135
168
|
},
|
|
136
169
|
hide: (e = !1) => {
|
|
137
|
-
var
|
|
138
|
-
return (
|
|
170
|
+
var t;
|
|
171
|
+
return (t = o.value) == null ? void 0 : t.hide(e);
|
|
139
172
|
},
|
|
140
173
|
handleOpen: () => {
|
|
141
174
|
var e;
|
|
@@ -150,8 +183,8 @@ const T = /* @__PURE__ */ v({
|
|
|
150
183
|
return ((e = o.value) == null ? void 0 : e.clear()) ?? Promise.resolve(!1);
|
|
151
184
|
},
|
|
152
185
|
setValue: (e) => {
|
|
153
|
-
var
|
|
154
|
-
return ((
|
|
186
|
+
var t;
|
|
187
|
+
return ((t = o.value) == null ? void 0 : t.setValue(e)) ?? Promise.resolve(!1);
|
|
155
188
|
},
|
|
156
189
|
confirm: () => {
|
|
157
190
|
var e;
|
|
@@ -162,119 +195,140 @@ const T = /* @__PURE__ */ v({
|
|
|
162
195
|
return (e = o.value) == null ? void 0 : e.cancel();
|
|
163
196
|
},
|
|
164
197
|
showMonth: (e) => {
|
|
165
|
-
var
|
|
166
|
-
return ((
|
|
198
|
+
var t;
|
|
199
|
+
return ((t = o.value) == null ? void 0 : t.showMonth(e)) ?? Promise.resolve(!1);
|
|
167
200
|
},
|
|
168
201
|
setMode: (e) => {
|
|
169
|
-
var
|
|
170
|
-
return ((
|
|
202
|
+
var t;
|
|
203
|
+
return ((t = o.value) == null ? void 0 : t.setMode(e)) ?? !1;
|
|
171
204
|
}
|
|
172
|
-
}), (e,
|
|
205
|
+
}), (e, t) => (k(), $(P, B({ ...m, ...e.$attrs }, {
|
|
173
206
|
range: !0,
|
|
174
207
|
ref_key: "control",
|
|
175
208
|
ref: o
|
|
176
|
-
},
|
|
209
|
+
}, g(b(f))), w({ _: 2 }, [
|
|
177
210
|
e.$slots.default ? {
|
|
178
211
|
name: "default",
|
|
179
|
-
fn: l((
|
|
180
|
-
n(e.$slots, "default",
|
|
212
|
+
fn: l((a) => [
|
|
213
|
+
n(e.$slots, "default", s(r(a)))
|
|
181
214
|
]),
|
|
182
215
|
key: "0"
|
|
183
216
|
} : void 0,
|
|
184
217
|
e.$slots["week-number"] ? {
|
|
185
218
|
name: "week-number",
|
|
186
|
-
fn: l((
|
|
187
|
-
n(e.$slots, "week-number",
|
|
219
|
+
fn: l((a) => [
|
|
220
|
+
n(e.$slots, "week-number", s(r(a)))
|
|
188
221
|
]),
|
|
189
222
|
key: "1"
|
|
190
223
|
} : void 0,
|
|
191
224
|
e.$slots.cell ? {
|
|
192
225
|
name: "cell",
|
|
193
|
-
fn: l((
|
|
194
|
-
n(e.$slots, "cell",
|
|
226
|
+
fn: l((a) => [
|
|
227
|
+
n(e.$slots, "cell", s(r(a)))
|
|
195
228
|
]),
|
|
196
229
|
key: "2"
|
|
197
230
|
} : void 0,
|
|
198
231
|
e.$slots.header ? {
|
|
199
232
|
name: "header",
|
|
200
|
-
fn: l((
|
|
201
|
-
n(e.$slots, "header",
|
|
233
|
+
fn: l((a) => [
|
|
234
|
+
n(e.$slots, "header", s(r(a)))
|
|
202
235
|
]),
|
|
203
236
|
key: "3"
|
|
204
237
|
} : void 0,
|
|
238
|
+
e.$slots["extra-footer"] ? {
|
|
239
|
+
name: "extra-footer",
|
|
240
|
+
fn: l((a) => [
|
|
241
|
+
n(e.$slots, "extra-footer", s(r(a)))
|
|
242
|
+
]),
|
|
243
|
+
key: "4"
|
|
244
|
+
} : void 0,
|
|
245
|
+
e.$slots["date-render"] ? {
|
|
246
|
+
name: "date-render",
|
|
247
|
+
fn: l((a) => [
|
|
248
|
+
n(e.$slots, "date-render", s(r(a)))
|
|
249
|
+
]),
|
|
250
|
+
key: "5"
|
|
251
|
+
} : void 0,
|
|
252
|
+
e.$slots["month-cell-render"] ? {
|
|
253
|
+
name: "month-cell-render",
|
|
254
|
+
fn: l((a) => [
|
|
255
|
+
n(e.$slots, "month-cell-render", s(r(a)))
|
|
256
|
+
]),
|
|
257
|
+
key: "6"
|
|
258
|
+
} : void 0,
|
|
205
259
|
e.$slots.footer ? {
|
|
206
260
|
name: "footer",
|
|
207
|
-
fn: l((
|
|
208
|
-
n(e.$slots, "footer",
|
|
261
|
+
fn: l((a) => [
|
|
262
|
+
n(e.$slots, "footer", s(r(a)))
|
|
209
263
|
]),
|
|
210
|
-
key: "
|
|
264
|
+
key: "7"
|
|
211
265
|
} : void 0,
|
|
212
266
|
e.$slots.shortcut ? {
|
|
213
267
|
name: "shortcut",
|
|
214
|
-
fn: l((
|
|
215
|
-
n(e.$slots, "shortcut",
|
|
268
|
+
fn: l((a) => [
|
|
269
|
+
n(e.$slots, "shortcut", s(r(a)))
|
|
216
270
|
]),
|
|
217
|
-
key: "
|
|
271
|
+
key: "8"
|
|
218
272
|
} : void 0,
|
|
219
273
|
e.$slots.prefix ? {
|
|
220
274
|
name: "prefix",
|
|
221
275
|
fn: l(() => [
|
|
222
276
|
n(e.$slots, "prefix")
|
|
223
277
|
]),
|
|
224
|
-
key: "
|
|
278
|
+
key: "9"
|
|
225
279
|
} : void 0,
|
|
226
280
|
e.$slots.suffix ? {
|
|
227
281
|
name: "suffix",
|
|
228
282
|
fn: l(() => [
|
|
229
283
|
n(e.$slots, "suffix")
|
|
230
284
|
]),
|
|
231
|
-
key: "
|
|
285
|
+
key: "10"
|
|
232
286
|
} : void 0,
|
|
233
287
|
e.$slots["clear-icon"] ? {
|
|
234
288
|
name: "clear-icon",
|
|
235
289
|
fn: l(() => [
|
|
236
290
|
n(e.$slots, "clear-icon")
|
|
237
291
|
]),
|
|
238
|
-
key: "
|
|
292
|
+
key: "11"
|
|
239
293
|
} : void 0,
|
|
240
294
|
e.$slots["prev-month"] ? {
|
|
241
295
|
name: "prev-month",
|
|
242
296
|
fn: l(() => [
|
|
243
297
|
n(e.$slots, "prev-month")
|
|
244
298
|
]),
|
|
245
|
-
key: "
|
|
299
|
+
key: "12"
|
|
246
300
|
} : void 0,
|
|
247
301
|
e.$slots["next-month"] ? {
|
|
248
302
|
name: "next-month",
|
|
249
303
|
fn: l(() => [
|
|
250
304
|
n(e.$slots, "next-month")
|
|
251
305
|
]),
|
|
252
|
-
key: "
|
|
306
|
+
key: "13"
|
|
253
307
|
} : void 0,
|
|
254
308
|
e.$slots["prev-year"] ? {
|
|
255
309
|
name: "prev-year",
|
|
256
310
|
fn: l(() => [
|
|
257
311
|
n(e.$slots, "prev-year")
|
|
258
312
|
]),
|
|
259
|
-
key: "
|
|
313
|
+
key: "14"
|
|
260
314
|
} : void 0,
|
|
261
315
|
e.$slots["next-year"] ? {
|
|
262
316
|
name: "next-year",
|
|
263
317
|
fn: l(() => [
|
|
264
318
|
n(e.$slots, "next-year")
|
|
265
319
|
]),
|
|
266
|
-
key: "
|
|
320
|
+
key: "15"
|
|
267
321
|
} : void 0,
|
|
268
322
|
e.$slots["range-separator"] ? {
|
|
269
323
|
name: "range-separator",
|
|
270
324
|
fn: l(() => [
|
|
271
325
|
n(e.$slots, "range-separator")
|
|
272
326
|
]),
|
|
273
|
-
key: "
|
|
327
|
+
key: "16"
|
|
274
328
|
} : void 0
|
|
275
329
|
]), 1040));
|
|
276
330
|
}
|
|
277
331
|
});
|
|
278
332
|
export {
|
|
279
|
-
|
|
333
|
+
O as default
|
|
280
334
|
};
|