zartui 3.0.7 → 3.0.8
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/es/calendar/Calendar.d.ts +23 -33
- package/es/calendar/Calendar.mjs +124 -31
- package/es/calendar/CalendarDay.mjs +1 -1
- package/es/calendar/CalendarHeader.d.ts +15 -1
- package/es/calendar/CalendarHeader.mjs +106 -4
- package/es/calendar/CalendarMonth.d.ts +23 -24
- package/es/calendar/CalendarMonth.mjs +49 -8
- package/es/calendar/index.css +1 -1
- package/es/calendar/index.d.ts +15 -22
- package/es/calendar/types.d.ts +3 -1
- package/es/calendar/utils.d.ts +4 -1
- package/es/calendar/utils.mjs +23 -3
- package/es/cascader/Cascader.mjs +1 -1
- package/es/dialog/Dialog.d.ts +4 -0
- package/es/dialog/Dialog.mjs +24 -9
- package/es/dialog/index.css +1 -1
- package/es/dialog/index.d.ts +3 -0
- package/es/dialog/types.d.ts +1 -0
- package/es/field/Field.d.ts +3 -0
- package/es/field/Field.mjs +2 -1
- package/es/field/index.d.ts +2 -0
- package/es/icon/config.mjs +2 -1
- package/es/icon/index.css +1 -1
- package/es/overlay/index.d.ts +1 -1
- package/es/popover/Popover.mjs +14 -6
- package/es/swipe-cell/index.d.ts +1 -1
- package/es/table/Table.d.ts +8 -3
- package/es/table/Table.mjs +122 -31
- package/es/table/index.css +1 -1
- package/es/table/index.d.ts +4 -2
- package/es/table/style/index.mjs +2 -0
- package/es/table/types.d.ts +5 -0
- package/es/table/types.mjs +8 -0
- package/es/tag/Tag.d.ts +3 -0
- package/es/tag/Tag.mjs +24 -16
- package/es/tag/index.css +1 -1
- package/es/tag/index.d.ts +2 -0
- package/es/tag/style/index.mjs +1 -0
- package/es/uploader/UploaderPreviewItem.d.ts +1 -1
- package/lib/calendar/Calendar.d.ts +23 -33
- package/lib/calendar/Calendar.js +123 -30
- package/lib/calendar/CalendarDay.js +1 -1
- package/lib/calendar/CalendarHeader.d.ts +15 -1
- package/lib/calendar/CalendarHeader.js +106 -4
- package/lib/calendar/CalendarMonth.d.ts +23 -24
- package/lib/calendar/CalendarMonth.js +48 -7
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.d.ts +15 -22
- package/lib/calendar/types.d.ts +3 -1
- package/lib/calendar/utils.d.ts +4 -1
- package/lib/calendar/utils.js +23 -3
- package/lib/cascader/Cascader.js +1 -1
- package/lib/dialog/Dialog.d.ts +4 -0
- package/lib/dialog/Dialog.js +24 -9
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.d.ts +3 -0
- package/lib/dialog/types.d.ts +1 -0
- package/lib/field/Field.d.ts +3 -0
- package/lib/field/Field.js +2 -1
- package/lib/field/index.d.ts +2 -0
- package/lib/icon/config.js +2 -1
- package/lib/icon/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/overlay/index.d.ts +1 -1
- package/lib/popover/Popover.js +14 -6
- package/lib/swipe-cell/index.d.ts +1 -1
- package/lib/table/Table.d.ts +8 -3
- package/lib/table/Table.js +122 -31
- package/lib/table/index.css +1 -1
- package/lib/table/index.d.ts +4 -2
- package/lib/table/style/index.js +2 -0
- package/lib/table/types.d.ts +5 -0
- package/lib/table/types.js +27 -0
- package/lib/tag/Tag.d.ts +3 -0
- package/lib/tag/Tag.js +34 -16
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.d.ts +2 -0
- package/lib/tag/style/index.js +1 -0
- package/lib/uploader/UploaderPreviewItem.d.ts +1 -1
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +487 -109
- package/lib/zartui.es.js +487 -109
- package/lib/zartui.js +487 -109
- package/lib/zartui.min.js +1 -1
- package/package.json +7 -7
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
2
|
import { PopupPosition } from '../popup';
|
|
3
|
-
import type { CalendarType, CalendarDayItem } from './types';
|
|
3
|
+
import type { CalendarType, CalendarDayItem, CalendarShowType } from './types';
|
|
4
4
|
export declare const calendarProps: {
|
|
5
5
|
show: BooleanConstructor;
|
|
6
|
+
showType: {
|
|
7
|
+
type: PropType<CalendarShowType>;
|
|
8
|
+
default: CalendarShowType;
|
|
9
|
+
};
|
|
6
10
|
type: {
|
|
7
11
|
type: PropType<CalendarType>;
|
|
8
12
|
default: CalendarType;
|
|
@@ -74,25 +78,22 @@ export declare const calendarProps: {
|
|
|
74
78
|
type: BooleanConstructor;
|
|
75
79
|
default: true;
|
|
76
80
|
};
|
|
77
|
-
minDate:
|
|
78
|
-
|
|
79
|
-
validator: (val: unknown) => val is Date;
|
|
80
|
-
default: () => Date;
|
|
81
|
-
};
|
|
82
|
-
maxDate: {
|
|
83
|
-
type: DateConstructor;
|
|
84
|
-
validator: (val: unknown) => val is Date;
|
|
85
|
-
default: () => Date;
|
|
86
|
-
};
|
|
81
|
+
minDate: DateConstructor;
|
|
82
|
+
maxDate: DateConstructor;
|
|
87
83
|
firstDayOfWeek: {
|
|
88
84
|
type: (NumberConstructor | StringConstructor)[];
|
|
89
85
|
default: number;
|
|
90
86
|
validator: (val: number) => boolean;
|
|
91
87
|
};
|
|
88
|
+
disabledDate: PropType<(date: Date) => boolean>;
|
|
92
89
|
};
|
|
93
90
|
export declare type CalendarProps = ExtractPropTypes<typeof calendarProps>;
|
|
94
91
|
declare const _default: import("vue").DefineComponent<{
|
|
95
92
|
show: BooleanConstructor;
|
|
93
|
+
showType: {
|
|
94
|
+
type: PropType<CalendarShowType>;
|
|
95
|
+
default: CalendarShowType;
|
|
96
|
+
};
|
|
96
97
|
type: {
|
|
97
98
|
type: PropType<CalendarType>;
|
|
98
99
|
default: CalendarType;
|
|
@@ -164,23 +165,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
164
165
|
type: BooleanConstructor;
|
|
165
166
|
default: true;
|
|
166
167
|
};
|
|
167
|
-
minDate:
|
|
168
|
-
|
|
169
|
-
validator: (val: unknown) => val is Date;
|
|
170
|
-
default: () => Date;
|
|
171
|
-
};
|
|
172
|
-
maxDate: {
|
|
173
|
-
type: DateConstructor;
|
|
174
|
-
validator: (val: unknown) => val is Date;
|
|
175
|
-
default: () => Date;
|
|
176
|
-
};
|
|
168
|
+
minDate: DateConstructor;
|
|
169
|
+
maxDate: DateConstructor;
|
|
177
170
|
firstDayOfWeek: {
|
|
178
171
|
type: (NumberConstructor | StringConstructor)[];
|
|
179
172
|
default: number;
|
|
180
173
|
validator: (val: number) => boolean;
|
|
181
174
|
};
|
|
175
|
+
disabledDate: PropType<(date: Date) => boolean>;
|
|
182
176
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show" | "cancel" | "clickSubtitle" | "confirm" | "unselect" | "monthShow" | "overRange")[], "select" | "update:show" | "cancel" | "clickSubtitle" | "confirm" | "unselect" | "monthShow" | "overRange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
183
177
|
show: BooleanConstructor;
|
|
178
|
+
showType: {
|
|
179
|
+
type: PropType<CalendarShowType>;
|
|
180
|
+
default: CalendarShowType;
|
|
181
|
+
};
|
|
184
182
|
type: {
|
|
185
183
|
type: PropType<CalendarType>;
|
|
186
184
|
default: CalendarType;
|
|
@@ -252,21 +250,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
252
250
|
type: BooleanConstructor;
|
|
253
251
|
default: true;
|
|
254
252
|
};
|
|
255
|
-
minDate:
|
|
256
|
-
|
|
257
|
-
validator: (val: unknown) => val is Date;
|
|
258
|
-
default: () => Date;
|
|
259
|
-
};
|
|
260
|
-
maxDate: {
|
|
261
|
-
type: DateConstructor;
|
|
262
|
-
validator: (val: unknown) => val is Date;
|
|
263
|
-
default: () => Date;
|
|
264
|
-
};
|
|
253
|
+
minDate: DateConstructor;
|
|
254
|
+
maxDate: DateConstructor;
|
|
265
255
|
firstDayOfWeek: {
|
|
266
256
|
type: (NumberConstructor | StringConstructor)[];
|
|
267
257
|
default: number;
|
|
268
258
|
validator: (val: number) => boolean;
|
|
269
259
|
};
|
|
260
|
+
disabledDate: PropType<(date: Date) => boolean>;
|
|
270
261
|
}>> & {
|
|
271
262
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
272
263
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
@@ -288,6 +279,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
288
279
|
safeAreaInsetTop: boolean;
|
|
289
280
|
safeAreaInsetBottom: boolean;
|
|
290
281
|
popup: boolean;
|
|
282
|
+
showType: CalendarShowType;
|
|
291
283
|
maxRange: string | number;
|
|
292
284
|
showMark: boolean;
|
|
293
285
|
showTitle: boolean;
|
|
@@ -295,8 +287,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
295
287
|
allowSameDay: boolean;
|
|
296
288
|
showSubtitle: boolean;
|
|
297
289
|
showRangePrompt: boolean;
|
|
298
|
-
minDate: Date;
|
|
299
|
-
maxDate: Date;
|
|
300
290
|
firstDayOfWeek: string | number;
|
|
301
291
|
}>;
|
|
302
292
|
export default _default;
|
package/lib/calendar/Calendar.js
CHANGED
|
@@ -45,6 +45,7 @@ var import_CalendarMonth = __toESM(require("./CalendarMonth"));
|
|
|
45
45
|
var import_CalendarHeader = __toESM(require("./CalendarHeader"));
|
|
46
46
|
const calendarProps = {
|
|
47
47
|
show: Boolean,
|
|
48
|
+
showType: (0, import_utils.makeStringProp)("inline"),
|
|
48
49
|
type: (0, import_utils.makeStringProp)("single"),
|
|
49
50
|
title: String,
|
|
50
51
|
color: String,
|
|
@@ -71,24 +72,14 @@ const calendarProps = {
|
|
|
71
72
|
closeOnClickOverlay: import_utils.truthProp,
|
|
72
73
|
safeAreaInsetTop: Boolean,
|
|
73
74
|
safeAreaInsetBottom: import_utils.truthProp,
|
|
74
|
-
minDate:
|
|
75
|
-
|
|
76
|
-
validator: import_utils.isDate,
|
|
77
|
-
default: import_utils2.getToday
|
|
78
|
-
},
|
|
79
|
-
maxDate: {
|
|
80
|
-
type: Date,
|
|
81
|
-
validator: import_utils.isDate,
|
|
82
|
-
default: () => {
|
|
83
|
-
const now = (0, import_utils2.getToday)();
|
|
84
|
-
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
|
85
|
-
}
|
|
86
|
-
},
|
|
75
|
+
minDate: Date,
|
|
76
|
+
maxDate: Date,
|
|
87
77
|
firstDayOfWeek: {
|
|
88
78
|
type: import_utils.numericProp,
|
|
89
|
-
default:
|
|
79
|
+
default: 1,
|
|
90
80
|
validator: (val) => val >= 0 && val <= 6
|
|
91
|
-
}
|
|
81
|
+
},
|
|
82
|
+
disabledDate: Function
|
|
92
83
|
};
|
|
93
84
|
var stdin_default = (0, import_vue2.defineComponent)({
|
|
94
85
|
name: import_utils2.name,
|
|
@@ -98,11 +89,19 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
98
89
|
emit,
|
|
99
90
|
slots
|
|
100
91
|
}) {
|
|
101
|
-
const
|
|
102
|
-
|
|
92
|
+
const lastMinDate = (0, import_vue2.computed)(() => {
|
|
93
|
+
const now = new Date();
|
|
94
|
+
return props.showType !== "inline" && !props.minDate ? new Date(now.getFullYear(), now.getMonth() - 3, now.getDate()) : props.minDate;
|
|
95
|
+
});
|
|
96
|
+
const lastMaxDate = (0, import_vue2.computed)(() => {
|
|
97
|
+
const now = new Date();
|
|
98
|
+
return props.showType !== "inline" && !props.maxDate ? new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()) : props.maxDate;
|
|
99
|
+
});
|
|
100
|
+
const limitDateRange = (date, minDate = lastMinDate.value, maxDate = lastMaxDate.value) => {
|
|
101
|
+
if (minDate && (0, import_utils2.compareDay)(date, minDate) === -1) {
|
|
103
102
|
return minDate;
|
|
104
103
|
}
|
|
105
|
-
if ((0, import_utils2.compareDay)(date, maxDate) === 1) {
|
|
104
|
+
if (maxDate && (0, import_utils2.compareDay)(date, maxDate) === 1) {
|
|
106
105
|
return maxDate;
|
|
107
106
|
}
|
|
108
107
|
return date;
|
|
@@ -110,10 +109,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
110
109
|
const getInitialDate = (defaultDate = props.defaultDate) => {
|
|
111
110
|
const {
|
|
112
111
|
type,
|
|
113
|
-
minDate,
|
|
114
|
-
maxDate,
|
|
115
112
|
allowSameDay
|
|
116
113
|
} = props;
|
|
114
|
+
const minDate = lastMinDate.value;
|
|
115
|
+
const maxDate = lastMaxDate.value;
|
|
117
116
|
if (defaultDate === null) {
|
|
118
117
|
return defaultDate;
|
|
119
118
|
}
|
|
@@ -122,8 +121,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
122
121
|
if (!Array.isArray(defaultDate)) {
|
|
123
122
|
defaultDate = [];
|
|
124
123
|
}
|
|
125
|
-
const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : (0, import_utils2.getPrevDay)(maxDate));
|
|
126
|
-
const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : (0, import_utils2.getNextDay)(minDate));
|
|
124
|
+
const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : maxDate && (0, import_utils2.getPrevDay)(maxDate));
|
|
125
|
+
const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : minDate && (0, import_utils2.getNextDay)(minDate));
|
|
127
126
|
return [start, end];
|
|
128
127
|
}
|
|
129
128
|
if (type === "multiple") {
|
|
@@ -137,20 +136,40 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
137
136
|
}
|
|
138
137
|
return limitDateRange(defaultDate);
|
|
139
138
|
};
|
|
139
|
+
const getInitialTitleDate = (defaultDate = props.defaultDate) => {
|
|
140
|
+
const initTitleDate = getInitialDate(defaultDate);
|
|
141
|
+
const now = (0, import_utils2.getToday)();
|
|
142
|
+
if (Array.isArray(initTitleDate)) {
|
|
143
|
+
return initTitleDate[0] || now;
|
|
144
|
+
} else {
|
|
145
|
+
return initTitleDate || now;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
140
148
|
let bodyHeight;
|
|
141
149
|
const bodyRef = (0, import_vue2.ref)();
|
|
142
150
|
const subtitle = (0, import_vue2.ref)("");
|
|
143
151
|
const currentDate = (0, import_vue2.ref)(getInitialDate());
|
|
152
|
+
const titleDate = (0, import_vue2.ref)(getInitialTitleDate());
|
|
144
153
|
const [monthRefs, setMonthRefs] = (0, import_use_refs.useRefs)();
|
|
145
154
|
const dayOffset = (0, import_vue2.computed)(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
|
|
146
155
|
const months = (0, import_vue2.computed)(() => {
|
|
156
|
+
var _a;
|
|
147
157
|
const months2 = [];
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
158
|
+
if (props.showType !== "inline" && lastMinDate.value && lastMaxDate.value) {
|
|
159
|
+
const cursor = new Date(lastMinDate.value);
|
|
160
|
+
cursor.setDate(1);
|
|
161
|
+
do {
|
|
162
|
+
months2.push(new Date(cursor));
|
|
163
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
|
164
|
+
} while ((0, import_utils2.compareMonth)(cursor, lastMaxDate.value) !== 1);
|
|
165
|
+
} else if (props.showType === "inline") {
|
|
166
|
+
const temp = (_a = titleDate.value) != null ? _a : (0, import_utils2.cloneDates)(titleDate.value);
|
|
167
|
+
if (!Array.isArray(temp)) {
|
|
168
|
+
months2.push((0, import_utils2.getFirstDate)(temp));
|
|
169
|
+
} else {
|
|
170
|
+
months2.push((0, import_utils2.getFirstDate)(temp[0]));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
154
173
|
return months2;
|
|
155
174
|
});
|
|
156
175
|
const buttonDisabled = (0, import_vue2.computed)(() => {
|
|
@@ -201,6 +220,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
201
220
|
});
|
|
202
221
|
if (currentMonth) {
|
|
203
222
|
subtitle.value = currentMonth.getTitle();
|
|
223
|
+
titleDate.value = currentMonth.getDate();
|
|
204
224
|
}
|
|
205
225
|
};
|
|
206
226
|
const scrollToDate = (targetDate) => {
|
|
@@ -241,6 +261,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
241
261
|
};
|
|
242
262
|
const reset = (date = getInitialDate()) => {
|
|
243
263
|
currentDate.value = date;
|
|
264
|
+
titleDate.value = getInitialTitleDate(date);
|
|
244
265
|
scrollToCurrentDate();
|
|
245
266
|
};
|
|
246
267
|
const checkRange = (date) => {
|
|
@@ -302,6 +323,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
302
323
|
const {
|
|
303
324
|
type
|
|
304
325
|
} = props;
|
|
326
|
+
if (item.type === "preview") {
|
|
327
|
+
titleDate.value = date;
|
|
328
|
+
}
|
|
305
329
|
if (type === "range") {
|
|
306
330
|
if (!currentDate.value) {
|
|
307
331
|
select([date]);
|
|
@@ -349,6 +373,64 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
349
373
|
select(date, true);
|
|
350
374
|
}
|
|
351
375
|
};
|
|
376
|
+
const yearPreEnable = (0, import_vue2.computed)(() => {
|
|
377
|
+
if (!lastMinDate.value) {
|
|
378
|
+
return true;
|
|
379
|
+
}
|
|
380
|
+
return titleDate.value.getFullYear() > lastMinDate.value.getFullYear();
|
|
381
|
+
});
|
|
382
|
+
const monthPreEnable = (0, import_vue2.computed)(() => {
|
|
383
|
+
if (!lastMinDate.value) {
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
const targetDate = titleDate.value;
|
|
387
|
+
const targetYearMonth = (0, import_utils2.getFirstDate)(targetDate);
|
|
388
|
+
const minDateYearMonth = (0, import_utils2.getFirstDate)(lastMinDate.value);
|
|
389
|
+
return (0, import_utils2.compareDay)(targetYearMonth, minDateYearMonth) === 1;
|
|
390
|
+
});
|
|
391
|
+
const yearNextEnable = (0, import_vue2.computed)(() => {
|
|
392
|
+
if (!lastMaxDate.value) {
|
|
393
|
+
return true;
|
|
394
|
+
}
|
|
395
|
+
return titleDate.value.getFullYear() < lastMaxDate.value.getFullYear();
|
|
396
|
+
});
|
|
397
|
+
const monthNextEnable = (0, import_vue2.computed)(() => {
|
|
398
|
+
if (!lastMaxDate.value) {
|
|
399
|
+
return true;
|
|
400
|
+
}
|
|
401
|
+
const targetDate = titleDate.value;
|
|
402
|
+
const targetYearMonth = (0, import_utils2.getFirstDate)(targetDate);
|
|
403
|
+
const maxDateYearMonth = (0, import_utils2.getFirstDate)(lastMaxDate.value);
|
|
404
|
+
return (0, import_utils2.compareDay)(maxDateYearMonth, targetYearMonth) === 1;
|
|
405
|
+
});
|
|
406
|
+
const onClickTitleIcon = (isPreFlag, isMonth, isYear) => {
|
|
407
|
+
const curTitleDate = titleDate.value;
|
|
408
|
+
if (curTitleDate) {
|
|
409
|
+
let targetDate = isPreFlag ? (0, import_utils2.getPrevDate)(curTitleDate, isMonth, isYear) : (0, import_utils2.getNextDate)(curTitleDate, isMonth, isYear);
|
|
410
|
+
if (!(0, import_utils.isDate)(targetDate)) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
let hasCompared = false;
|
|
414
|
+
const compareDate = isPreFlag ? lastMinDate.value : lastMaxDate.value;
|
|
415
|
+
const compareValue = isPreFlag ? 1 : -1;
|
|
416
|
+
if (compareDate && (0, import_utils2.compareDay)(compareDate, targetDate) === compareValue && (0, import_utils2.compareMonth)(compareDate, targetDate) === 0) {
|
|
417
|
+
targetDate = compareDate;
|
|
418
|
+
hasCompared = true;
|
|
419
|
+
}
|
|
420
|
+
if (hasCompared || !compareDate || compareDate && (0, import_utils2.compareDay)(compareDate, targetDate) !== compareValue) {
|
|
421
|
+
scrollToDate(targetDate);
|
|
422
|
+
titleDate.value = targetDate;
|
|
423
|
+
}
|
|
424
|
+
} else {
|
|
425
|
+
(0, import_use.raf)(onScroll);
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
const onClickPreIcon = (isMonth, isYear) => {
|
|
429
|
+
onClickTitleIcon(true, isMonth, isYear);
|
|
430
|
+
};
|
|
431
|
+
const onClickNextIcon = (isMonth, isYear) => {
|
|
432
|
+
onClickTitleIcon(false, isMonth, isYear);
|
|
433
|
+
};
|
|
352
434
|
const updateShow = (value) => emit("update:show", value);
|
|
353
435
|
const renderMonth = (date, index) => {
|
|
354
436
|
const showMonthTitle = index !== 0 || !props.showSubtitle;
|
|
@@ -358,7 +440,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
358
440
|
"currentDate": currentDate.value,
|
|
359
441
|
"showMonthTitle": showMonthTitle,
|
|
360
442
|
"firstDayOfWeek": dayOffset.value
|
|
361
|
-
}, (0, import_utils.pick)(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
|
443
|
+
}, (0, import_utils.pick)(props, ["showType", "type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay", "disabledDate"]), {
|
|
362
444
|
"onClick": onClickDay
|
|
363
445
|
}), (0, import_utils.pick)(slots, ["top-info", "bottom-info"]));
|
|
364
446
|
};
|
|
@@ -408,7 +490,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
408
490
|
"showTitle": props.showTitle,
|
|
409
491
|
"showSubtitle": props.showSubtitle,
|
|
410
492
|
"firstDayOfWeek": dayOffset.value,
|
|
411
|
-
"onClickSubtitle": (event) => emit("clickSubtitle", event)
|
|
493
|
+
"onClickSubtitle": (event) => emit("clickSubtitle", event),
|
|
494
|
+
"onClickPreIcon": onClickPreIcon,
|
|
495
|
+
"onClickNextIcon": onClickNextIcon,
|
|
496
|
+
"yearPreEnable": yearPreEnable.value,
|
|
497
|
+
"monthPreEnable": monthPreEnable.value,
|
|
498
|
+
"yearNextEnable": yearNextEnable.value,
|
|
499
|
+
"monthNextEnable": monthNextEnable.value
|
|
412
500
|
}, (0, import_utils.pick)(slots, ["title", "subtitle"])), (0, import_vue.createVNode)("div", {
|
|
413
501
|
"ref": bodyRef,
|
|
414
502
|
"class": (0, import_utils2.bem)("body"),
|
|
@@ -420,6 +508,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
420
508
|
currentDate.value = value;
|
|
421
509
|
scrollToCurrentDate();
|
|
422
510
|
});
|
|
511
|
+
(0, import_vue2.watch)(titleDate, (newValue) => {
|
|
512
|
+
if (props.showType === "inline" && newValue) {
|
|
513
|
+
subtitle.value = (0, import_utils2.formatMonthTitle)(newValue);
|
|
514
|
+
}
|
|
515
|
+
});
|
|
423
516
|
(0, import_use_expose.useExpose)({
|
|
424
517
|
reset,
|
|
425
518
|
scrollToDate,
|
|
@@ -7,7 +7,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
type: NumberConstructor;
|
|
8
8
|
default: number;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
yearPreEnable: BooleanConstructor;
|
|
11
|
+
monthPreEnable: BooleanConstructor;
|
|
12
|
+
yearNextEnable: BooleanConstructor;
|
|
13
|
+
monthNextEnable: BooleanConstructor;
|
|
14
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickSubtitle" | "clickPreIcon" | "clickNextIcon")[], "clickSubtitle" | "clickPreIcon" | "clickNextIcon", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
15
|
title: StringConstructor;
|
|
12
16
|
subtitle: StringConstructor;
|
|
13
17
|
showTitle: BooleanConstructor;
|
|
@@ -16,11 +20,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
20
|
type: NumberConstructor;
|
|
17
21
|
default: number;
|
|
18
22
|
};
|
|
23
|
+
yearPreEnable: BooleanConstructor;
|
|
24
|
+
monthPreEnable: BooleanConstructor;
|
|
25
|
+
yearNextEnable: BooleanConstructor;
|
|
26
|
+
monthNextEnable: BooleanConstructor;
|
|
19
27
|
}>> & {
|
|
20
28
|
onClickSubtitle?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
onClickPreIcon?: ((...args: any[]) => any) | undefined;
|
|
30
|
+
onClickNextIcon?: ((...args: any[]) => any) | undefined;
|
|
21
31
|
}, {
|
|
22
32
|
showTitle: boolean;
|
|
23
33
|
showSubtitle: boolean;
|
|
24
34
|
firstDayOfWeek: number;
|
|
35
|
+
yearPreEnable: boolean;
|
|
36
|
+
monthPreEnable: boolean;
|
|
37
|
+
yearNextEnable: boolean;
|
|
38
|
+
monthNextEnable: boolean;
|
|
25
39
|
}>;
|
|
26
40
|
export default _default;
|
|
@@ -32,9 +32,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
32
32
|
subtitle: String,
|
|
33
33
|
showTitle: Boolean,
|
|
34
34
|
showSubtitle: Boolean,
|
|
35
|
-
firstDayOfWeek: (0, import_utils.makeNumberProp)(1)
|
|
35
|
+
firstDayOfWeek: (0, import_utils.makeNumberProp)(1),
|
|
36
|
+
yearPreEnable: Boolean,
|
|
37
|
+
monthPreEnable: Boolean,
|
|
38
|
+
yearNextEnable: Boolean,
|
|
39
|
+
monthNextEnable: Boolean
|
|
36
40
|
},
|
|
37
|
-
emits: ["clickSubtitle"],
|
|
41
|
+
emits: ["clickSubtitle", "clickPreIcon", "clickNextIcon"],
|
|
38
42
|
setup(props, {
|
|
39
43
|
slots,
|
|
40
44
|
emit
|
|
@@ -49,13 +53,111 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
55
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
|
56
|
+
const onClickPreIcon = (isMonth, isYear) => () => {
|
|
57
|
+
if (isMonth && !props.monthPreEnable || isYear && !props.yearPreEnable) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
emit("clickPreIcon", isMonth, isYear);
|
|
61
|
+
};
|
|
62
|
+
const onClickNextIcon = (isMonth, isYear) => () => {
|
|
63
|
+
if (isMonth && !props.monthNextEnable || isYear && !props.yearNextEnable) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
emit("clickNextIcon", isMonth, isYear);
|
|
67
|
+
};
|
|
68
|
+
const fastForwardImg = () => (0, import_vue.createVNode)("svg", {
|
|
69
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
70
|
+
"width": "16px",
|
|
71
|
+
"height": "16px",
|
|
72
|
+
"viewBox": "0 0 16 16",
|
|
73
|
+
"version": "1.1"
|
|
74
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
75
|
+
"stroke": "none",
|
|
76
|
+
"stroke-width": "1",
|
|
77
|
+
"fill": "none",
|
|
78
|
+
"fill-rule": "evenodd"
|
|
79
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
80
|
+
"transform": "translate(-32.000000, -320.000000)",
|
|
81
|
+
"fill": "#0091FA",
|
|
82
|
+
"fill-rule": "nonzero"
|
|
83
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
84
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
85
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
86
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
87
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
88
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
89
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
90
|
+
"transform": "translate(8.000000, 10.000000) scale(-1, 1) translate(-8.000000, -10.000000) translate(0.000000, 2.000000)"
|
|
91
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
92
|
+
"transform": "translate(0.500000, 2.000000)"
|
|
93
|
+
}, [(0, import_vue.createVNode)("path", {
|
|
94
|
+
"d": "M6.79659726,4.25543258 L3.35183004,7.88886609 C3.14952477,8.10225141 2.77635057,8.13960837 2.51832213,7.9723052 C2.48075622,7.94794782 2.4468797,7.91993249 2.41742642,7.88886609 L-1.02734079,4.25543258 C-1.22964607,4.04204726 -1.18447352,3.73343826 -0.926445085,3.56613509 C-0.821927664,3.49836699 -0.69295109,3.46153846 -0.560138985,3.46153846 L6.32939545,3.46153846 C6.65727667,3.46153846 6.92307692,3.68135095 6.92307692,3.95250339 C6.92307692,4.06233684 6.87854337,4.16899837 6.79659726,4.25543258 Z",
|
|
95
|
+
"opacity": "0.3",
|
|
96
|
+
"transform": "translate(2.884615, 5.769231) rotate(-90.000000) translate(-2.884615, -5.769231) "
|
|
97
|
+
}, null), (0, import_vue.createVNode)("path", {
|
|
98
|
+
"d": "M12.5116225,3.49853348 L7.59052644,8.94868375 C7.3015189,9.26876173 6.7684129,9.32479717 6.39980085,9.07384242 C6.34613526,9.03730635 6.29774023,8.99528335 6.25566412,8.94868375 L1.3345681,3.49853348 C1.04556056,3.1784555 1.11009277,2.715542 1.47870482,2.46458724 C1.62801542,2.3629351 1.81226767,2.30769231 2.00199925,2.30769231 L11.8441913,2.30769231 C12.3125931,2.30769231 12.6923077,2.63741103 12.6923077,3.0441397 C12.6923077,3.20888987 12.6286883,3.36888217 12.5116225,3.49853348 Z",
|
|
99
|
+
"opacity": "0.8",
|
|
100
|
+
"transform": "translate(6.923077, 5.769231) rotate(-90.000000) translate(-6.923077, -5.769231) "
|
|
101
|
+
}, null), (0, import_vue.createVNode)("path", {
|
|
102
|
+
"d": "M17.1270071,3.49853348 L12.2059111,8.94868375 C11.9169035,9.26876173 11.3837975,9.32479717 11.0151855,9.07384242 C10.9615199,9.03730635 10.9131248,8.99528335 10.8710487,8.94868375 L5.94995271,3.49853348 C5.66094518,3.1784555 5.72547739,2.715542 6.09408944,2.46458724 C6.24340004,2.3629351 6.42765229,2.30769231 6.61738387,2.30769231 L16.4595759,2.30769231 C16.9279777,2.30769231 17.3076923,2.63741103 17.3076923,3.0441397 C17.3076923,3.20888987 17.2440729,3.36888217 17.1270071,3.49853348 Z",
|
|
103
|
+
"opacity": "0.8",
|
|
104
|
+
"transform": "translate(11.538462, 5.769231) rotate(-90.000000) translate(-11.538462, -5.769231) "
|
|
105
|
+
}, null)])])])])])])])]);
|
|
106
|
+
const slowForward = () => (0, import_vue.createVNode)("svg", {
|
|
107
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
108
|
+
"width": "16px",
|
|
109
|
+
"height": "16px",
|
|
110
|
+
"viewBox": "0 0 16 16",
|
|
111
|
+
"version": "1.1"
|
|
112
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
113
|
+
"stroke": "none",
|
|
114
|
+
"stroke-width": "1",
|
|
115
|
+
"fill": "none",
|
|
116
|
+
"fill-rule": "evenodd"
|
|
117
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
118
|
+
"transform": "translate(-80.000000, -320.000000)",
|
|
119
|
+
"fill": "#0091FA",
|
|
120
|
+
"fill-rule": "nonzero"
|
|
121
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
122
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
123
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
124
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
125
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
126
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
127
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
128
|
+
"transform": "translate(56.000000, 10.000000) scale(-1, 1) translate(-56.000000, -10.000000) translate(48.000000, 2.000000)"
|
|
129
|
+
}, [(0, import_vue.createVNode)("g", {
|
|
130
|
+
"transform": "translate(3.000000, 2.000000)"
|
|
131
|
+
}, [(0, import_vue.createVNode)("path", {
|
|
132
|
+
"d": "M7.06846115,4.42564988 L3.48590324,8.20442073 C3.27550576,8.42634147 2.88740459,8.46519271 2.61905502,8.29119741 C2.57998647,8.26586573 2.54475489,8.23672979 2.51412348,8.20442073 L-1.06843443,4.42564988 C-1.27883191,4.20372915 -1.23185246,3.88277579 -0.963502888,3.70878049 C-0.854804771,3.63830167 -0.720669133,3.6 -0.582544544,3.6 L6.58257127,3.6 C6.92356774,3.6 7.2,3.82860498 7.2,4.11060352 C7.2,4.22483031 7.1536851,4.3357583 7.06846115,4.42564988 Z",
|
|
133
|
+
"opacity": "0.3",
|
|
134
|
+
"transform": "translate(3.000000, 6.000000) rotate(-90.000000) translate(-3.000000, -6.000000) "
|
|
135
|
+
}, null), (0, import_vue.createVNode)("path", {
|
|
136
|
+
"d": "M13.0120874,3.63847482 L7.89414749,9.3066311 C7.59357966,9.6395122 7.03914942,9.69778906 6.65579288,9.43679611 C6.59998067,9.3987986 6.54964984,9.35509469 6.50589069,9.3066311 L1.38795082,3.63847482 C1.08738299,3.30559372 1.15449649,2.82416368 1.53785302,2.56317073 C1.69313604,2.4574525 1.88475838,2.4 2.08207922,2.4 L12.317959,2.4 C12.8050968,2.4 13.2,2.74290748 13.2,3.16590528 C13.2,3.33724547 13.1338359,3.50363746 13.0120874,3.63847482 Z",
|
|
137
|
+
"opacity": "0.8",
|
|
138
|
+
"transform": "translate(7.200000, 6.000000) rotate(-90.000000) translate(-7.200000, -6.000000) "
|
|
139
|
+
}, null)])])])])])])])]);
|
|
52
140
|
const renderSubtitle = () => {
|
|
53
141
|
if (props.showSubtitle) {
|
|
54
142
|
const title = slots.subtitle ? slots.subtitle() : props.subtitle;
|
|
55
143
|
return (0, import_vue.createVNode)("div", {
|
|
56
|
-
"class": (0, import_utils2.bem)("header-subtitle")
|
|
144
|
+
"class": (0, import_utils2.bem)("header-subtitle")
|
|
145
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
146
|
+
"class": (0, import_utils2.bem)("header-subtitle", ["opt", props.yearPreEnable ? "enable" : "unenable"]),
|
|
147
|
+
"onClick": onClickPreIcon(false, true)
|
|
148
|
+
}, [fastForwardImg()]), (0, import_vue.createVNode)("div", {
|
|
149
|
+
"class": (0, import_utils2.bem)("header-subtitle", ["opt", props.monthPreEnable ? "enable" : "unenable"]),
|
|
150
|
+
"onClick": onClickPreIcon(true, false)
|
|
151
|
+
}, [slowForward()]), (0, import_vue.createVNode)("label", {
|
|
152
|
+
"class": (0, import_utils2.bem)("header-subtitle-text"),
|
|
57
153
|
"onClick": onClickSubtitle
|
|
58
|
-
}, [title])
|
|
154
|
+
}, [title]), (0, import_vue.createVNode)("div", {
|
|
155
|
+
"class": (0, import_utils2.bem)("header-subtitle", ["opt", "right", [props.monthNextEnable ? "enable" : "unenable"]]),
|
|
156
|
+
"onClick": onClickNextIcon(true, false)
|
|
157
|
+
}, [slowForward()]), (0, import_vue.createVNode)("div", {
|
|
158
|
+
"class": (0, import_utils2.bem)("header-subtitle", ["opt", "right", [props.yearNextEnable ? "enable" : "unenable"]]),
|
|
159
|
+
"onClick": onClickNextIcon(false, true)
|
|
160
|
+
}, [fastForwardImg()])]);
|
|
59
161
|
}
|
|
60
162
|
};
|
|
61
163
|
const renderWeekDays = () => {
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
2
|
import type { CalendarType, CalendarDayItem } from './types';
|
|
3
|
+
import { CalendarShowType } from './types';
|
|
3
4
|
declare const calendarMonthProps: {
|
|
4
5
|
date: {
|
|
5
6
|
type: DateConstructor;
|
|
6
7
|
required: true;
|
|
7
8
|
};
|
|
9
|
+
showType: {
|
|
10
|
+
type: PropType<CalendarShowType>;
|
|
11
|
+
default: CalendarShowType;
|
|
12
|
+
};
|
|
8
13
|
type: PropType<CalendarType>;
|
|
9
14
|
color: StringConstructor;
|
|
10
|
-
minDate:
|
|
11
|
-
|
|
12
|
-
required: true;
|
|
13
|
-
};
|
|
14
|
-
maxDate: {
|
|
15
|
-
type: DateConstructor;
|
|
16
|
-
required: true;
|
|
17
|
-
};
|
|
15
|
+
minDate: DateConstructor;
|
|
16
|
+
maxDate: DateConstructor;
|
|
18
17
|
showMark: BooleanConstructor;
|
|
19
18
|
rowHeight: (NumberConstructor | StringConstructor)[];
|
|
20
19
|
formatter: PropType<(item: CalendarDayItem) => CalendarDayItem>;
|
|
@@ -24,6 +23,7 @@ declare const calendarMonthProps: {
|
|
|
24
23
|
showSubtitle: BooleanConstructor;
|
|
25
24
|
showMonthTitle: BooleanConstructor;
|
|
26
25
|
firstDayOfWeek: NumberConstructor;
|
|
26
|
+
disabledDate: PropType<(date: Date) => boolean>;
|
|
27
27
|
};
|
|
28
28
|
export declare type CalendarMonthProps = ExtractPropTypes<typeof calendarMonthProps>;
|
|
29
29
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -31,16 +31,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
31
|
type: DateConstructor;
|
|
32
32
|
required: true;
|
|
33
33
|
};
|
|
34
|
+
showType: {
|
|
35
|
+
type: PropType<CalendarShowType>;
|
|
36
|
+
default: CalendarShowType;
|
|
37
|
+
};
|
|
34
38
|
type: PropType<CalendarType>;
|
|
35
39
|
color: StringConstructor;
|
|
36
|
-
minDate:
|
|
37
|
-
|
|
38
|
-
required: true;
|
|
39
|
-
};
|
|
40
|
-
maxDate: {
|
|
41
|
-
type: DateConstructor;
|
|
42
|
-
required: true;
|
|
43
|
-
};
|
|
40
|
+
minDate: DateConstructor;
|
|
41
|
+
maxDate: DateConstructor;
|
|
44
42
|
showMark: BooleanConstructor;
|
|
45
43
|
rowHeight: (NumberConstructor | StringConstructor)[];
|
|
46
44
|
formatter: PropType<(item: CalendarDayItem) => CalendarDayItem>;
|
|
@@ -50,21 +48,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
48
|
showSubtitle: BooleanConstructor;
|
|
51
49
|
showMonthTitle: BooleanConstructor;
|
|
52
50
|
firstDayOfWeek: NumberConstructor;
|
|
51
|
+
disabledDate: PropType<(date: Date) => boolean>;
|
|
53
52
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
54
53
|
date: {
|
|
55
54
|
type: DateConstructor;
|
|
56
55
|
required: true;
|
|
57
56
|
};
|
|
57
|
+
showType: {
|
|
58
|
+
type: PropType<CalendarShowType>;
|
|
59
|
+
default: CalendarShowType;
|
|
60
|
+
};
|
|
58
61
|
type: PropType<CalendarType>;
|
|
59
62
|
color: StringConstructor;
|
|
60
|
-
minDate:
|
|
61
|
-
|
|
62
|
-
required: true;
|
|
63
|
-
};
|
|
64
|
-
maxDate: {
|
|
65
|
-
type: DateConstructor;
|
|
66
|
-
required: true;
|
|
67
|
-
};
|
|
63
|
+
minDate: DateConstructor;
|
|
64
|
+
maxDate: DateConstructor;
|
|
68
65
|
showMark: BooleanConstructor;
|
|
69
66
|
rowHeight: (NumberConstructor | StringConstructor)[];
|
|
70
67
|
formatter: PropType<(item: CalendarDayItem) => CalendarDayItem>;
|
|
@@ -74,10 +71,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
74
71
|
showSubtitle: BooleanConstructor;
|
|
75
72
|
showMonthTitle: BooleanConstructor;
|
|
76
73
|
firstDayOfWeek: NumberConstructor;
|
|
74
|
+
disabledDate: PropType<(date: Date) => boolean>;
|
|
77
75
|
}>> & {
|
|
78
76
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
79
77
|
}, {
|
|
80
78
|
lazyRender: boolean;
|
|
79
|
+
showType: CalendarShowType;
|
|
81
80
|
showMark: boolean;
|
|
82
81
|
allowSameDay: boolean;
|
|
83
82
|
showSubtitle: boolean;
|