cosey 0.7.16 → 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/components/components.d.ts +3 -1
- package/components/components.js +1 -0
- package/components/field/components/date/date.d.ts +1 -0
- package/components/field/components/week/week.vue.js +1 -1
- package/components/field/components/week-range/week-range.d.ts +5 -0
- package/components/field/components/week-range/week-range.js +1 -0
- package/components/field/components/week-range/week-range.vue.d.ts +4 -0
- package/components/field/components/week-range/week-range.vue.js +34 -0
- package/components/field/field.api.d.ts +3 -0
- package/components/field/field.api.js +72 -70
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/table/table-query/table-query.js +2 -1
- package/components/week-range-picker/index.d.ts +865 -0
- package/components/week-range-picker/index.js +7 -0
- package/components/week-range-picker/panel-week-range.api.d.ts +32 -0
- package/components/week-range-picker/panel-week-range.api.js +15 -0
- package/components/week-range-picker/panel-week-range.d.ts +25 -0
- package/components/week-range-picker/panel-week-range.js +207 -0
- package/components/week-range-picker/panel-week-range.style.d.ts +4 -0
- package/components/week-range-picker/panel-week-range.style.js +94 -0
- package/components/week-range-picker/week-range-picker.api.d.ts +269 -0
- package/components/week-range-picker/week-range-picker.api.js +16 -0
- package/components/week-range-picker/week-range-picker.d.ts +540 -0
- package/components/week-range-picker/week-range-picker.js +44 -0
- package/components/week-range-picker/week-range-picker.style.d.ts +4 -0
- package/components/week-range-picker/week-range-picker.style.js +12 -0
- package/locale/lang/ar.d.ts +1 -0
- package/locale/lang/ar.js +1 -0
- package/locale/lang/en.d.ts +1 -0
- package/locale/lang/en.js +2 -1
- package/locale/lang/zh-cn.d.ts +1 -0
- package/locale/lang/zh-cn.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { withInstall } from '../utils.js';
|
|
2
|
+
import stdin_default$1 from './week-range-picker.js';
|
|
3
|
+
|
|
4
|
+
const _WeekRangePicker = withInstall(stdin_default$1);
|
|
5
|
+
var stdin_default = _WeekRangePicker;
|
|
6
|
+
|
|
7
|
+
export { _WeekRangePicker as WeekRangePicker, stdin_default as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType, SlotsType } from 'vue';
|
|
2
|
+
import { type Dayjs } from 'dayjs';
|
|
3
|
+
export declare const panelWeekRangeProps: {
|
|
4
|
+
visible: {
|
|
5
|
+
type: BooleanConstructor;
|
|
6
|
+
};
|
|
7
|
+
parsedValue: {
|
|
8
|
+
type: PropType<Date[]>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type WeekRangePickerProps = ExtractPropTypes<typeof panelWeekRangeProps>;
|
|
12
|
+
export interface WeekRangePickerSlots {
|
|
13
|
+
'range-separator': {};
|
|
14
|
+
default: {};
|
|
15
|
+
}
|
|
16
|
+
export declare const panelWeekRangeSlots: SlotsType<WeekRangePickerSlots>;
|
|
17
|
+
export declare const panelWeekRangeEmits: {
|
|
18
|
+
pick: (value: Dayjs[] | null) => value is Dayjs[];
|
|
19
|
+
'set-picker-option': (value: any[]) => boolean;
|
|
20
|
+
};
|
|
21
|
+
export type WeekRangePickerEmits = typeof panelWeekRangeEmits;
|
|
22
|
+
export interface WeekRangePickerExpose {
|
|
23
|
+
}
|
|
24
|
+
export interface WeekInfo {
|
|
25
|
+
id: number;
|
|
26
|
+
week: number;
|
|
27
|
+
weekStr: string;
|
|
28
|
+
startDate: Dayjs;
|
|
29
|
+
endDate: Dayjs;
|
|
30
|
+
startStr: string;
|
|
31
|
+
endStr: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const panelWeekRangeProps = {
|
|
2
|
+
visible: {
|
|
3
|
+
type: Boolean
|
|
4
|
+
},
|
|
5
|
+
parsedValue: {
|
|
6
|
+
type: Array
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const panelWeekRangeSlots = {};
|
|
10
|
+
const panelWeekRangeEmits = {
|
|
11
|
+
pick: (value) => Array.isArray(value),
|
|
12
|
+
"set-picker-option": (value) => Array.isArray(value)
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { panelWeekRangeEmits, panelWeekRangeProps, panelWeekRangeSlots };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
visible: {
|
|
4
|
+
type: BooleanConstructor;
|
|
5
|
+
};
|
|
6
|
+
parsedValue: {
|
|
7
|
+
type: import("vue").PropType<Date[]>;
|
|
8
|
+
};
|
|
9
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
pick: (value: Dayjs[] | null) => value is dayjs.Dayjs[];
|
|
11
|
+
'set-picker-option': (value: any[]) => boolean;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
visible: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
};
|
|
16
|
+
parsedValue: {
|
|
17
|
+
type: import("vue").PropType<Date[]>;
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{
|
|
20
|
+
onPick?: ((value: dayjs.Dayjs[] | null) => any) | undefined;
|
|
21
|
+
"onSet-picker-option"?: ((value: any[]) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
visible: boolean;
|
|
24
|
+
}, import("vue").SlotsType<import("./panel-week-range.api").WeekRangePickerSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { defineComponent, shallowRef, computed, ref, watch, createVNode } from 'vue';
|
|
2
|
+
import stdin_default$1 from './panel-week-range.style.js';
|
|
3
|
+
import { ElIcon } from 'element-plus';
|
|
4
|
+
import { DArrowLeft, DArrowRight } from '@element-plus/icons-vue';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import weekYear from 'dayjs/plugin/weekYear.js';
|
|
7
|
+
import weekOfYear from 'dayjs/plugin/weekOfYear.js';
|
|
8
|
+
import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear.js';
|
|
9
|
+
import isLeapYear from 'dayjs/plugin/isLeapYear.js';
|
|
10
|
+
import { panelWeekRangeEmits, panelWeekRangeSlots, panelWeekRangeProps } from './panel-week-range.api.js';
|
|
11
|
+
import { isValidRange } from 'element-plus/es/components/date-picker-panel/src/utils.mjs';
|
|
12
|
+
import { useLocale } from '../../hooks/useLocale.js';
|
|
13
|
+
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
14
|
+
|
|
15
|
+
dayjs.extend(weekYear);
|
|
16
|
+
dayjs.extend(weekOfYear);
|
|
17
|
+
dayjs.extend(isoWeeksInYear);
|
|
18
|
+
dayjs.extend(isLeapYear);
|
|
19
|
+
function parseDates(dates) {
|
|
20
|
+
if (!dates || dates.length < 2) return [];
|
|
21
|
+
const d = dates.map(dayjs).sort((a, b) => a.isBefore(b) ? -1 : 1);
|
|
22
|
+
return [d[0].startOf("date"), d[1].endOf("week")];
|
|
23
|
+
}
|
|
24
|
+
function isSame(d1, d2) {
|
|
25
|
+
return d1.every((d, i) => d.isSame(d2[i]));
|
|
26
|
+
}
|
|
27
|
+
var stdin_default = defineComponent({
|
|
28
|
+
name: "CoPanelWeekRange",
|
|
29
|
+
props: panelWeekRangeProps,
|
|
30
|
+
slots: panelWeekRangeSlots,
|
|
31
|
+
emits: panelWeekRangeEmits,
|
|
32
|
+
setup(props, {
|
|
33
|
+
emit
|
|
34
|
+
}) {
|
|
35
|
+
const {
|
|
36
|
+
t
|
|
37
|
+
} = useLocale();
|
|
38
|
+
const {
|
|
39
|
+
prefixCls
|
|
40
|
+
} = useComponentConfig("panel-week-range", props);
|
|
41
|
+
const {
|
|
42
|
+
hashId
|
|
43
|
+
} = stdin_default$1(prefixCls);
|
|
44
|
+
const currentYearDate = shallowRef(dayjs());
|
|
45
|
+
const yearLabel = computed(() => currentYearDate.value.year());
|
|
46
|
+
const weeks = computed(() => {
|
|
47
|
+
const currentD = currentYearDate.value;
|
|
48
|
+
const weeks2 = currentD.isoWeeksInYear();
|
|
49
|
+
const result = [];
|
|
50
|
+
for (let i = 0; i < weeks2; i++) {
|
|
51
|
+
const rowIndex = Math.floor(i / 8);
|
|
52
|
+
const row = result[rowIndex] ??= [];
|
|
53
|
+
const week = i + 1;
|
|
54
|
+
const d = currentD.week(week);
|
|
55
|
+
const startDate = d.startOf("date");
|
|
56
|
+
const endDate = d.endOf("week");
|
|
57
|
+
const startStr = startDate.format("MM-DD");
|
|
58
|
+
const endStr = endDate.format("MM-DD");
|
|
59
|
+
const weekStr = t("co.form.week", {
|
|
60
|
+
w: week
|
|
61
|
+
});
|
|
62
|
+
row.push({
|
|
63
|
+
id: currentD.year() * 100 + week,
|
|
64
|
+
week,
|
|
65
|
+
weekStr,
|
|
66
|
+
startDate,
|
|
67
|
+
endDate,
|
|
68
|
+
startStr,
|
|
69
|
+
endStr
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
});
|
|
74
|
+
const pickedDates = ref([]);
|
|
75
|
+
const innerValue = ref(parseDates(props.parsedValue));
|
|
76
|
+
watch(() => props.parsedValue, () => {
|
|
77
|
+
const dates = parseDates(props.parsedValue);
|
|
78
|
+
if (dates.length !== innerValue.value.length || dates.length > 0 && !isSame(dates, innerValue.value)) {
|
|
79
|
+
innerValue.value = dates;
|
|
80
|
+
selectedDates.value = innerValue.value.map(item => item.year() * 100 + item.week()).sort();
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
immediate: true
|
|
84
|
+
});
|
|
85
|
+
const isSelecting = computed(() => pickedDates.value.length === 1);
|
|
86
|
+
const selectedDates = ref([]);
|
|
87
|
+
const onPrevYear = () => {
|
|
88
|
+
currentYearDate.value = dayjs(currentYearDate.value).subtract(1, "year");
|
|
89
|
+
};
|
|
90
|
+
const onNextYear = () => {
|
|
91
|
+
currentYearDate.value = dayjs(currentYearDate.value).add(1, "year");
|
|
92
|
+
};
|
|
93
|
+
const getWeekInfo = event => {
|
|
94
|
+
const target = event.target.closest("td");
|
|
95
|
+
if (!target) return;
|
|
96
|
+
const rowIndex = target.parentNode.rowIndex;
|
|
97
|
+
const cellIndex = target.cellIndex;
|
|
98
|
+
const weekInfo = weeks.value[rowIndex][cellIndex];
|
|
99
|
+
return weekInfo;
|
|
100
|
+
};
|
|
101
|
+
const onPickWeek = event => {
|
|
102
|
+
const weekInfo = getWeekInfo(event);
|
|
103
|
+
if (!weekInfo) return;
|
|
104
|
+
if (pickedDates.value.length === 2) {
|
|
105
|
+
pickedDates.value = [];
|
|
106
|
+
}
|
|
107
|
+
pickedDates.value.push(weekInfo);
|
|
108
|
+
selectedDates.value = pickedDates.value.map(item => item.id).sort();
|
|
109
|
+
if (selectedDates.value.length === 1) {
|
|
110
|
+
const d = selectedDates.value[0];
|
|
111
|
+
selectedDates.value = [d, d];
|
|
112
|
+
}
|
|
113
|
+
if (pickedDates.value.length === 2) {
|
|
114
|
+
const [start, end] = pickedDates.value;
|
|
115
|
+
emit("pick", [start.startDate, end.endDate]);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const onMouseMove = event => {
|
|
119
|
+
if (!isSelecting.value) return;
|
|
120
|
+
const weekInfo = getWeekInfo(event);
|
|
121
|
+
if (!weekInfo) return;
|
|
122
|
+
selectedDates.value = [pickedDates.value[0].id, weekInfo.id].sort();
|
|
123
|
+
};
|
|
124
|
+
const onMouseDown = () => {};
|
|
125
|
+
const onMouseUp = () => {};
|
|
126
|
+
const resetCurrentYear = year => {
|
|
127
|
+
const currentYear = currentYearDate.value.year();
|
|
128
|
+
if (year !== currentYear) {
|
|
129
|
+
currentYearDate.value = dayjs(innerValue.value[0]);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
watch(() => props.visible, () => {
|
|
133
|
+
if (props.visible) {
|
|
134
|
+
if (isSelecting.value) {
|
|
135
|
+
selectedDates.value = innerValue.value.length ? innerValue.value.map(item => item.year() * 100 + item.week()).sort() : [];
|
|
136
|
+
pickedDates.value = [];
|
|
137
|
+
}
|
|
138
|
+
resetCurrentYear(innerValue.value.length ? innerValue.value[0].year() : dayjs().year());
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
const isValidValue = date => {
|
|
142
|
+
return isValidRange(date);
|
|
143
|
+
};
|
|
144
|
+
const formatToString = value => {
|
|
145
|
+
return Array.isArray(value) ? value.map(d => d.format("gggg[w]ww")) : value.format("gggg[w]ww");
|
|
146
|
+
};
|
|
147
|
+
const handleClear = () => {
|
|
148
|
+
innerValue.value = [];
|
|
149
|
+
selectedDates.value = [];
|
|
150
|
+
emit("pick", null);
|
|
151
|
+
};
|
|
152
|
+
emit("set-picker-option", ["isValidValue", isValidValue]);
|
|
153
|
+
emit("set-picker-option", ["formatToString", formatToString]);
|
|
154
|
+
emit("set-picker-option", ["handleClear", handleClear]);
|
|
155
|
+
return () => {
|
|
156
|
+
return createVNode("div", {
|
|
157
|
+
"class": [hashId.value, prefixCls.value]
|
|
158
|
+
}, [createVNode("div", {
|
|
159
|
+
"class": `${prefixCls.value}-header`
|
|
160
|
+
}, [createVNode("div", {
|
|
161
|
+
"class": `${prefixCls.value}-prev-btn`
|
|
162
|
+
}, [createVNode("button", {
|
|
163
|
+
"class": `${prefixCls.value}-icon-btn`,
|
|
164
|
+
"onClick": onPrevYear
|
|
165
|
+
}, [createVNode(ElIcon, null, {
|
|
166
|
+
default: () => [createVNode(DArrowLeft, null, null)]
|
|
167
|
+
})])]), createVNode("span", {
|
|
168
|
+
"role": "button",
|
|
169
|
+
"class": `${prefixCls.value}-header-label`
|
|
170
|
+
}, [yearLabel.value]), createVNode("div", {
|
|
171
|
+
"class": `${prefixCls.value}-next-btn`
|
|
172
|
+
}, [createVNode("button", {
|
|
173
|
+
"class": `${prefixCls.value}-icon-btn`,
|
|
174
|
+
"onClick": onNextYear
|
|
175
|
+
}, [createVNode(ElIcon, null, {
|
|
176
|
+
default: () => [createVNode(DArrowRight, null, null)]
|
|
177
|
+
})])])]), createVNode("div", {
|
|
178
|
+
"class": `${prefixCls.value}-content`
|
|
179
|
+
}, [createVNode("table", {
|
|
180
|
+
"onClick": onPickWeek,
|
|
181
|
+
"onMousemove": onMouseMove,
|
|
182
|
+
"onMousedown": onMouseDown,
|
|
183
|
+
"onMouseup": onMouseUp
|
|
184
|
+
}, [createVNode("tbody", null, [weeks.value.map((row, i) => {
|
|
185
|
+
return createVNode("tr", {
|
|
186
|
+
"key": i
|
|
187
|
+
}, [row.map((weekInfo, j) => {
|
|
188
|
+
const [start, end] = selectedDates.value;
|
|
189
|
+
return createVNode("td", {
|
|
190
|
+
"key": j,
|
|
191
|
+
"class": {
|
|
192
|
+
"is-start": start === weekInfo.id,
|
|
193
|
+
"is-end": end === weekInfo.id,
|
|
194
|
+
"in-range": start <= weekInfo.id && weekInfo.id <= end
|
|
195
|
+
}
|
|
196
|
+
}, [createVNode("div", {
|
|
197
|
+
"class": `${prefixCls.value}-cell`
|
|
198
|
+
}, [createVNode("div", {
|
|
199
|
+
"class": `${prefixCls.value}-cell-text`
|
|
200
|
+
}, [createVNode("div", null, [weekInfo.weekStr]), createVNode("div", null, [`${weekInfo.startStr}~${weekInfo.endStr}`])])])]);
|
|
201
|
+
})]);
|
|
202
|
+
})])])])]);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { getSimpleStyleHook } from '../theme/getSimpleStyleHook.js';
|
|
2
|
+
|
|
3
|
+
var stdin_default = getSimpleStyleHook("CoPanelWeekRange", (token) => {
|
|
4
|
+
const { componentCls } = token;
|
|
5
|
+
return {
|
|
6
|
+
[`${componentCls}`]: {
|
|
7
|
+
width: 860,
|
|
8
|
+
[`${componentCls}-header`]: {
|
|
9
|
+
display: "flex",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "space-between",
|
|
12
|
+
padding: 12,
|
|
13
|
+
borderBottom: `1px solid ${token.colorBorderSecondary}`
|
|
14
|
+
},
|
|
15
|
+
[`${componentCls}-header-label`]: {
|
|
16
|
+
fontSize: token.fontSizeLG,
|
|
17
|
+
fontWeight: 500,
|
|
18
|
+
paddingInline: 5,
|
|
19
|
+
color: token.colorText
|
|
20
|
+
},
|
|
21
|
+
[`${componentCls}-icon-btn`]: {
|
|
22
|
+
paddingBlock: 1,
|
|
23
|
+
paddingInline: 6,
|
|
24
|
+
border: 0,
|
|
25
|
+
fontSize: token.fontSizeSM,
|
|
26
|
+
lineHeight: 1,
|
|
27
|
+
color: token.colorText,
|
|
28
|
+
background: "transparent",
|
|
29
|
+
cursor: "pointer",
|
|
30
|
+
outline: "none",
|
|
31
|
+
"&:hover": {
|
|
32
|
+
color: token.colorPrimary
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
[`${componentCls}-content`]: {
|
|
36
|
+
marginInline: 15,
|
|
37
|
+
marginBlockEnd: 15
|
|
38
|
+
},
|
|
39
|
+
table: {
|
|
40
|
+
tableLayout: "fixed",
|
|
41
|
+
width: "100%",
|
|
42
|
+
fontSize: token.fontSizeSM,
|
|
43
|
+
borderCollapse: "collapse"
|
|
44
|
+
},
|
|
45
|
+
td: {
|
|
46
|
+
paddingBlock: 3,
|
|
47
|
+
textAlign: "center",
|
|
48
|
+
cursor: "pointer",
|
|
49
|
+
"&.is-start": {
|
|
50
|
+
[`${componentCls}-cell`]: {
|
|
51
|
+
borderStartStartRadius: 9999,
|
|
52
|
+
borderEndStartRadius: 9999
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"&.is-end": {
|
|
56
|
+
[`${componentCls}-cell`]: {
|
|
57
|
+
borderStartEndRadius: 9999,
|
|
58
|
+
borderEndEndRadius: 9999
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"&.is-start, &.is-end": {
|
|
62
|
+
[`${componentCls}-cell-text`]: {
|
|
63
|
+
color: token.colorWhite,
|
|
64
|
+
background: token.colorPrimary
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"&.in-range": {
|
|
68
|
+
[`${componentCls}-cell`]: {
|
|
69
|
+
background: token.colorBorderSecondary
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
[`${componentCls}-cell`]: {
|
|
74
|
+
paddingBlock: 6
|
|
75
|
+
},
|
|
76
|
+
[`${componentCls}-cell-text`]: {
|
|
77
|
+
display: "flex",
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
justifyContent: "center",
|
|
81
|
+
height: 36,
|
|
82
|
+
marginInline: 6,
|
|
83
|
+
borderRadius: 9999,
|
|
84
|
+
lineHeight: 1.15,
|
|
85
|
+
color: token.colorText,
|
|
86
|
+
"&:hover": {
|
|
87
|
+
color: token.colorPrimary
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType, SlotsType } from 'vue';
|
|
2
|
+
export declare const weekRangePickerProps: {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: PropType<Date[]>;
|
|
5
|
+
};
|
|
6
|
+
showNow: {
|
|
7
|
+
readonly type: PropType<boolean>;
|
|
8
|
+
readonly required: false;
|
|
9
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
10
|
+
__epPropKey: true;
|
|
11
|
+
} & {
|
|
12
|
+
readonly default: true;
|
|
13
|
+
};
|
|
14
|
+
showConfirm: {
|
|
15
|
+
readonly type: PropType<boolean>;
|
|
16
|
+
readonly required: false;
|
|
17
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
18
|
+
__epPropKey: true;
|
|
19
|
+
} & {
|
|
20
|
+
readonly default: true;
|
|
21
|
+
};
|
|
22
|
+
showFooter: {
|
|
23
|
+
readonly type: PropType<boolean>;
|
|
24
|
+
readonly required: false;
|
|
25
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
26
|
+
__epPropKey: true;
|
|
27
|
+
} & {
|
|
28
|
+
readonly default: true;
|
|
29
|
+
};
|
|
30
|
+
showWeekNumber: BooleanConstructor;
|
|
31
|
+
ariaLabel: StringConstructor;
|
|
32
|
+
emptyValues: ArrayConstructor;
|
|
33
|
+
valueOnClear: {
|
|
34
|
+
readonly type: PropType<string | number | boolean | Function | null>;
|
|
35
|
+
readonly required: false;
|
|
36
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
37
|
+
__epPropKey: true;
|
|
38
|
+
} & {
|
|
39
|
+
readonly default: undefined;
|
|
40
|
+
};
|
|
41
|
+
disabledDate: {
|
|
42
|
+
readonly type: PropType<Function>;
|
|
43
|
+
readonly required: false;
|
|
44
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
45
|
+
__epPropKey: true;
|
|
46
|
+
};
|
|
47
|
+
cellClassName: {
|
|
48
|
+
readonly type: PropType<Function>;
|
|
49
|
+
readonly required: false;
|
|
50
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
51
|
+
__epPropKey: true;
|
|
52
|
+
};
|
|
53
|
+
shortcuts: {
|
|
54
|
+
readonly type: PropType<unknown[]>;
|
|
55
|
+
readonly required: false;
|
|
56
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
57
|
+
__epPropKey: true;
|
|
58
|
+
} & {
|
|
59
|
+
readonly default: () => never[];
|
|
60
|
+
};
|
|
61
|
+
arrowControl: BooleanConstructor;
|
|
62
|
+
tabindex: {
|
|
63
|
+
readonly type: PropType<string | number>;
|
|
64
|
+
readonly required: false;
|
|
65
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
66
|
+
__epPropKey: true;
|
|
67
|
+
} & {
|
|
68
|
+
readonly default: 0;
|
|
69
|
+
};
|
|
70
|
+
validateEvent: {
|
|
71
|
+
readonly type: PropType<boolean>;
|
|
72
|
+
readonly required: false;
|
|
73
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
74
|
+
__epPropKey: true;
|
|
75
|
+
} & {
|
|
76
|
+
readonly default: true;
|
|
77
|
+
};
|
|
78
|
+
unlinkPanels: BooleanConstructor;
|
|
79
|
+
placement: {
|
|
80
|
+
readonly type: PropType<any>;
|
|
81
|
+
readonly required: false;
|
|
82
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
83
|
+
__epPropKey: true;
|
|
84
|
+
} & {
|
|
85
|
+
readonly default: "bottom";
|
|
86
|
+
};
|
|
87
|
+
fallbackPlacements: {
|
|
88
|
+
readonly type: PropType<Placement[]>;
|
|
89
|
+
readonly required: false;
|
|
90
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
91
|
+
__epPropKey: true;
|
|
92
|
+
} & {
|
|
93
|
+
readonly default: readonly ["bottom", "top", "right", "left"];
|
|
94
|
+
};
|
|
95
|
+
disabledHours: {
|
|
96
|
+
readonly type: PropType<import("element-plus").GetDisabledHours>;
|
|
97
|
+
readonly required: false;
|
|
98
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
99
|
+
__epPropKey: true;
|
|
100
|
+
};
|
|
101
|
+
disabledMinutes: {
|
|
102
|
+
readonly type: PropType<import("element-plus").GetDisabledMinutes>;
|
|
103
|
+
readonly required: false;
|
|
104
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
105
|
+
__epPropKey: true;
|
|
106
|
+
};
|
|
107
|
+
disabledSeconds: {
|
|
108
|
+
readonly type: PropType<import("element-plus").GetDisabledSeconds>;
|
|
109
|
+
readonly required: false;
|
|
110
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
111
|
+
__epPropKey: true;
|
|
112
|
+
};
|
|
113
|
+
automaticDropdown: {
|
|
114
|
+
readonly type: PropType<boolean>;
|
|
115
|
+
readonly required: false;
|
|
116
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
117
|
+
__epPropKey: true;
|
|
118
|
+
} & {
|
|
119
|
+
readonly default: true;
|
|
120
|
+
};
|
|
121
|
+
id: {
|
|
122
|
+
readonly type: PropType<import("element-plus").SingleOrRange<string>>;
|
|
123
|
+
readonly required: false;
|
|
124
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
125
|
+
__epPropKey: true;
|
|
126
|
+
};
|
|
127
|
+
name: {
|
|
128
|
+
readonly type: PropType<import("element-plus").SingleOrRange<string>>;
|
|
129
|
+
readonly required: false;
|
|
130
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
131
|
+
__epPropKey: true;
|
|
132
|
+
};
|
|
133
|
+
popperClass: {
|
|
134
|
+
readonly type: PropType<string | {
|
|
135
|
+
[x: string]: boolean;
|
|
136
|
+
} | (string | {
|
|
137
|
+
[x: string]: boolean;
|
|
138
|
+
} | (string | {
|
|
139
|
+
[x: string]: boolean;
|
|
140
|
+
} | (string | {
|
|
141
|
+
[x: string]: boolean;
|
|
142
|
+
} | (string | {
|
|
143
|
+
[x: string]: boolean;
|
|
144
|
+
} | (string | {
|
|
145
|
+
[x: string]: boolean;
|
|
146
|
+
} | (string | {
|
|
147
|
+
[x: string]: boolean;
|
|
148
|
+
} | (string | {
|
|
149
|
+
[x: string]: boolean;
|
|
150
|
+
} | (string | {
|
|
151
|
+
[x: string]: boolean;
|
|
152
|
+
} | (string | {
|
|
153
|
+
[x: string]: boolean;
|
|
154
|
+
} | (string | any[] | {
|
|
155
|
+
[x: string]: boolean;
|
|
156
|
+
})[])[])[])[])[])[])[])[])[])[]>;
|
|
157
|
+
readonly required: false;
|
|
158
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
159
|
+
__epPropKey: true;
|
|
160
|
+
};
|
|
161
|
+
popperStyle: {
|
|
162
|
+
readonly type: PropType<import("vue").StyleValue>;
|
|
163
|
+
readonly required: false;
|
|
164
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
165
|
+
__epPropKey: true;
|
|
166
|
+
};
|
|
167
|
+
format: StringConstructor;
|
|
168
|
+
valueFormat: StringConstructor;
|
|
169
|
+
dateFormat: StringConstructor;
|
|
170
|
+
timeFormat: StringConstructor;
|
|
171
|
+
type: {
|
|
172
|
+
readonly type: PropType<string>;
|
|
173
|
+
readonly required: false;
|
|
174
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
175
|
+
__epPropKey: true;
|
|
176
|
+
} & {
|
|
177
|
+
readonly default: "";
|
|
178
|
+
};
|
|
179
|
+
clearable: {
|
|
180
|
+
readonly type: PropType<boolean>;
|
|
181
|
+
readonly required: false;
|
|
182
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
183
|
+
__epPropKey: true;
|
|
184
|
+
} & {
|
|
185
|
+
readonly default: true;
|
|
186
|
+
};
|
|
187
|
+
clearIcon: {
|
|
188
|
+
readonly type: PropType<string | import("vue").Component>;
|
|
189
|
+
readonly required: false;
|
|
190
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
191
|
+
__epPropKey: true;
|
|
192
|
+
};
|
|
193
|
+
editable: {
|
|
194
|
+
readonly type: PropType<boolean>;
|
|
195
|
+
readonly required: false;
|
|
196
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
197
|
+
__epPropKey: true;
|
|
198
|
+
} & {
|
|
199
|
+
readonly default: true;
|
|
200
|
+
};
|
|
201
|
+
prefixIcon: {
|
|
202
|
+
readonly type: PropType<string | import("vue").Component>;
|
|
203
|
+
readonly required: false;
|
|
204
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
205
|
+
__epPropKey: true;
|
|
206
|
+
} & {
|
|
207
|
+
readonly default: "";
|
|
208
|
+
};
|
|
209
|
+
size: {
|
|
210
|
+
readonly type: PropType<"" | "default" | "large" | "small">;
|
|
211
|
+
readonly required: false;
|
|
212
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
213
|
+
__epPropKey: true;
|
|
214
|
+
};
|
|
215
|
+
readonly: BooleanConstructor;
|
|
216
|
+
disabled: BooleanConstructor;
|
|
217
|
+
placeholder: {
|
|
218
|
+
readonly type: PropType<string>;
|
|
219
|
+
readonly required: false;
|
|
220
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
221
|
+
__epPropKey: true;
|
|
222
|
+
} & {
|
|
223
|
+
readonly default: "";
|
|
224
|
+
};
|
|
225
|
+
popperOptions: {
|
|
226
|
+
readonly type: PropType<any>;
|
|
227
|
+
readonly required: false;
|
|
228
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
229
|
+
__epPropKey: true;
|
|
230
|
+
} & {
|
|
231
|
+
readonly default: () => {};
|
|
232
|
+
};
|
|
233
|
+
rangeSeparator: {
|
|
234
|
+
readonly type: PropType<string>;
|
|
235
|
+
readonly required: false;
|
|
236
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
237
|
+
__epPropKey: true;
|
|
238
|
+
} & {
|
|
239
|
+
readonly default: "-";
|
|
240
|
+
};
|
|
241
|
+
startPlaceholder: StringConstructor;
|
|
242
|
+
endPlaceholder: StringConstructor;
|
|
243
|
+
defaultValue: {
|
|
244
|
+
readonly type: PropType<import("element-plus").SingleOrRange<Date>>;
|
|
245
|
+
readonly required: false;
|
|
246
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
247
|
+
__epPropKey: true;
|
|
248
|
+
};
|
|
249
|
+
defaultTime: {
|
|
250
|
+
readonly type: PropType<import("element-plus").SingleOrRange<Date>>;
|
|
251
|
+
readonly required: false;
|
|
252
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
253
|
+
__epPropKey: true;
|
|
254
|
+
};
|
|
255
|
+
isRange: BooleanConstructor;
|
|
256
|
+
};
|
|
257
|
+
export type WeekRangePickerProps = ExtractPropTypes<typeof weekRangePickerProps>;
|
|
258
|
+
export interface WeekRangePickerSlots {
|
|
259
|
+
'range-separator': {};
|
|
260
|
+
default: {};
|
|
261
|
+
}
|
|
262
|
+
export declare const weekRangePickerSlots: SlotsType<WeekRangePickerSlots>;
|
|
263
|
+
export declare const weekRangePickerEmits: {
|
|
264
|
+
'update:modelValue': (value: Date[] | undefined | null) => boolean;
|
|
265
|
+
change: (value: Date[] | undefined | null) => boolean;
|
|
266
|
+
};
|
|
267
|
+
export type WeekRangePickerEmits = typeof weekRangePickerEmits;
|
|
268
|
+
export interface WeekRangePickerExpose {
|
|
269
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { timePickerDefaultProps } from 'element-plus';
|
|
2
|
+
import { isNullish } from '../../utils/is.js';
|
|
3
|
+
|
|
4
|
+
const weekRangePickerProps = {
|
|
5
|
+
...timePickerDefaultProps,
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Array
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const weekRangePickerSlots = {};
|
|
11
|
+
const weekRangePickerEmits = {
|
|
12
|
+
"update:modelValue": (value) => Array.isArray(value) || isNullish(value),
|
|
13
|
+
change: (value) => Array.isArray(value) || isNullish(value)
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { weekRangePickerEmits, weekRangePickerProps, weekRangePickerSlots };
|