naive-ui 2.21.5 → 2.22.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/es/_internal/close/src/styles/index.cssr.js +6 -5
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/es/_internal/selection/src/Selection.js +11 -9
- package/es/_internal/selection/src/styles/index.cssr.js +6 -2
- package/es/alert/src/Alert.d.ts +20 -20
- package/es/alert/src/Alert.js +22 -22
- package/es/alert/src/styles/index.cssr.js +45 -45
- package/es/anchor/src/AnchorAdapter.js +12 -12
- package/es/anchor/src/styles/index.cssr.js +41 -41
- package/es/avatar/src/Avatar.d.ts +5 -3
- package/es/avatar/src/Avatar.js +7 -5
- package/es/avatar/src/styles/index.cssr.js +3 -5
- package/es/button/src/Button.d.ts +33 -33
- package/es/button/src/Button.js +103 -102
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +2 -0
- package/es/cascader/src/Cascader.d.ts +135 -0
- package/es/cascader/src/Cascader.js +2 -4
- package/es/cascader/src/CascaderMenu.d.ts +345 -0
- package/es/cascader/src/CascaderMenu.js +6 -5
- package/es/cascader/src/CascaderOption.d.ts +18 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/es/cascader/styles/dark.js +3 -1
- package/es/cascader/styles/light.d.ts +13 -0
- package/es/cascader/styles/light.js +3 -1
- package/es/config-provider/src/ConfigProvider.d.ts +6 -0
- package/es/data-table/src/DataTable.js +7 -13
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +15 -4
- package/es/data-table/src/TableParts/Body.js +80 -28
- package/es/data-table/src/TableParts/Header.js +1 -1
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +4 -3
- package/es/data-table/src/use-check.js +6 -2
- package/es/data-table/src/use-scroll.d.ts +2 -0
- package/es/data-table/src/use-scroll.js +34 -4
- package/es/data-table/src/use-table-data.js +3 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/date-picker/src/DatePicker.d.ts +25 -1
- package/es/date-picker/src/DatePicker.js +16 -7
- package/es/date-picker/src/config.d.ts +1 -1
- package/es/date-picker/src/interface.d.ts +2 -1
- package/es/date-picker/src/panel/date.d.ts +9 -1
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +7 -0
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +9 -7
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +7 -0
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +13 -11
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +11 -34
- package/es/date-picker/src/panel/use-calendar.js +35 -18
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +7 -31
- package/es/date-picker/src/panel/use-dual-calendar.js +23 -8
- package/es/date-picker/src/panel/use-panel-common.d.ts +7 -27
- package/es/date-picker/src/panel/use-panel-common.js +2 -2
- package/es/date-picker/src/utils.d.ts +19 -3
- package/es/date-picker/src/utils.js +40 -5
- package/es/date-picker/styles/_common.d.ts +2 -0
- package/es/date-picker/styles/_common.js +3 -1
- package/es/date-picker/styles/light.d.ts +4 -0
- package/es/image/src/Image.js +8 -12
- package/es/locales/common/deDE.js +2 -0
- package/es/locales/common/enUS.d.ts +2 -0
- package/es/locales/common/enUS.js +2 -0
- package/es/locales/common/frFR.js +3 -0
- package/es/locales/common/idID.js +2 -0
- package/es/locales/common/jaJP.js +2 -0
- package/es/locales/common/nbNO.js +2 -0
- package/es/locales/common/ruRU.js +2 -0
- package/es/locales/common/ukUA.js +2 -0
- package/es/locales/common/zhCN.js +2 -0
- package/es/locales/common/zhTW.d.ts +3 -0
- package/es/locales/common/zhTW.js +100 -0
- package/es/locales/date/zhTW.d.ts +3 -0
- package/es/locales/date/zhTW.js +6 -0
- package/es/locales/index.d.ts +2 -0
- package/es/locales/index.js +2 -0
- package/es/page-header/src/PageHeader.js +3 -3
- package/es/page-header/src/styles/index.cssr.js +2 -4
- package/es/popover/src/Popover.js +4 -1
- package/es/popover/src/PopoverBody.js +3 -3
- package/es/popselect/src/Popselect.d.ts +2 -11
- package/es/popselect/src/Popselect.js +2 -2
- package/es/popselect/src/PopselectPanel.d.ts +3 -11
- package/es/popselect/src/PopselectPanel.js +17 -11
- package/es/radio/src/Radio.js +3 -3
- package/es/radio/src/RadioButton.js +4 -5
- package/es/radio/src/styles/radio-group.cssr.js +8 -4
- package/es/radio/src/styles/radio.cssr.js +8 -4
- package/es/radio/src/use-radio.d.ts +0 -3
- package/es/radio/src/use-radio.js +1 -26
- package/es/tabs/src/styles/index.cssr.js +1 -0
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +38 -1
- package/es/tree-select/src/TreeSelect.js +25 -10
- package/es/tree-select/src/styles/index.cssr.js +11 -2
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/close/src/styles/index.cssr.js +6 -5
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/lib/_internal/selection/src/Selection.js +11 -9
- package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
- package/lib/alert/src/Alert.d.ts +20 -20
- package/lib/alert/src/Alert.js +22 -22
- package/lib/alert/src/styles/index.cssr.js +45 -45
- package/lib/anchor/src/AnchorAdapter.js +12 -12
- package/lib/anchor/src/styles/index.cssr.js +41 -41
- package/lib/avatar/src/Avatar.d.ts +5 -3
- package/lib/avatar/src/Avatar.js +7 -5
- package/lib/avatar/src/styles/index.cssr.js +3 -5
- package/lib/button/src/Button.d.ts +33 -33
- package/lib/button/src/Button.js +103 -102
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +2 -0
- package/lib/cascader/src/Cascader.d.ts +135 -0
- package/lib/cascader/src/Cascader.js +2 -4
- package/lib/cascader/src/CascaderMenu.d.ts +345 -0
- package/lib/cascader/src/CascaderMenu.js +6 -5
- package/lib/cascader/src/CascaderOption.d.ts +18 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/lib/cascader/styles/dark.js +3 -1
- package/lib/cascader/styles/light.d.ts +13 -0
- package/lib/cascader/styles/light.js +3 -1
- package/lib/config-provider/src/ConfigProvider.d.ts +6 -0
- package/lib/data-table/src/DataTable.js +6 -12
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +15 -4
- package/lib/data-table/src/TableParts/Body.js +78 -26
- package/lib/data-table/src/TableParts/Header.js +1 -1
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +4 -3
- package/lib/data-table/src/use-check.js +6 -2
- package/lib/data-table/src/use-scroll.d.ts +2 -0
- package/lib/data-table/src/use-scroll.js +34 -4
- package/lib/data-table/src/use-table-data.js +3 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/date-picker/src/DatePicker.d.ts +25 -1
- package/lib/date-picker/src/DatePicker.js +16 -7
- package/lib/date-picker/src/config.d.ts +1 -1
- package/lib/date-picker/src/interface.d.ts +2 -1
- package/lib/date-picker/src/panel/date.d.ts +9 -1
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +7 -0
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +9 -7
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +7 -0
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +13 -11
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +11 -34
- package/lib/date-picker/src/panel/use-calendar.js +34 -16
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +7 -31
- package/lib/date-picker/src/panel/use-dual-calendar.js +22 -6
- package/lib/date-picker/src/panel/use-panel-common.d.ts +7 -27
- package/lib/date-picker/src/panel/use-panel-common.js +3 -2
- package/lib/date-picker/src/utils.d.ts +19 -3
- package/lib/date-picker/src/utils.js +41 -4
- package/lib/date-picker/styles/_common.d.ts +2 -0
- package/lib/date-picker/styles/_common.js +3 -1
- package/lib/date-picker/styles/light.d.ts +4 -0
- package/lib/image/src/Image.js +7 -11
- package/lib/locales/common/deDE.js +2 -0
- package/lib/locales/common/enUS.d.ts +2 -0
- package/lib/locales/common/enUS.js +2 -0
- package/lib/locales/common/frFR.js +3 -0
- package/lib/locales/common/idID.js +2 -0
- package/lib/locales/common/jaJP.js +2 -0
- package/lib/locales/common/nbNO.js +2 -0
- package/lib/locales/common/ruRU.js +2 -0
- package/lib/locales/common/ukUA.js +2 -0
- package/lib/locales/common/zhCN.js +2 -0
- package/lib/locales/common/zhTW.d.ts +3 -0
- package/lib/locales/common/zhTW.js +102 -0
- package/lib/locales/date/zhTW.d.ts +3 -0
- package/lib/locales/date/zhTW.js +11 -0
- package/lib/locales/index.d.ts +2 -0
- package/lib/locales/index.js +5 -1
- package/lib/page-header/src/PageHeader.js +3 -3
- package/lib/page-header/src/styles/index.cssr.js +2 -4
- package/lib/popover/src/Popover.js +4 -1
- package/lib/popover/src/PopoverBody.js +3 -3
- package/lib/popselect/src/Popselect.d.ts +2 -11
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/popselect/src/PopselectPanel.d.ts +3 -11
- package/lib/popselect/src/PopselectPanel.js +16 -10
- package/lib/radio/src/Radio.js +3 -3
- package/lib/radio/src/RadioButton.js +4 -5
- package/lib/radio/src/styles/radio-group.cssr.js +8 -4
- package/lib/radio/src/styles/radio.cssr.js +8 -4
- package/lib/radio/src/use-radio.d.ts +0 -3
- package/lib/radio/src/use-radio.js +1 -26
- package/lib/tabs/src/styles/index.cssr.js +1 -0
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +38 -1
- package/lib/tree-select/src/TreeSelect.js +24 -9
- package/lib/tree-select/src/styles/index.cssr.js +11 -2
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -3
- package/web-types.json +25 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VNode, PropType } from 'vue';
|
|
2
|
-
import type { MonthItem, YearItem } from '../utils';
|
|
2
|
+
import type { MonthItem, YearItem, QuarterItem } from '../utils';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
type: {
|
|
5
|
-
type: PropType<"month" | "year">;
|
|
5
|
+
type: PropType<"month" | "year" | "quarter">;
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
actions: {
|
|
@@ -23,6 +23,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
23
|
readonly default: null;
|
|
24
24
|
};
|
|
25
25
|
shortcuts: PropType<import("../interface").Shortcuts>;
|
|
26
|
+
defaultTime: PropType<import("../interface").DefaultTime>;
|
|
26
27
|
onConfirm: FunctionConstructor;
|
|
27
28
|
onClose: PropType<import("../interface").OnClose>;
|
|
28
29
|
onTabOut: FunctionConstructor;
|
|
@@ -31,8 +32,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
32
|
readonly required: true;
|
|
32
33
|
};
|
|
33
34
|
}, {
|
|
34
|
-
renderItem: (item: YearItem | MonthItem, i: number, mergedClsPrefix: string) => VNode;
|
|
35
|
-
handleDateClick: (dateItem: import("../utils").DateItem | MonthItem | YearItem) => void;
|
|
35
|
+
renderItem: (item: YearItem | MonthItem | QuarterItem, i: number, mergedClsPrefix: string) => VNode;
|
|
36
|
+
handleDateClick: (dateItem: import("../utils").DateItem | MonthItem | YearItem | QuarterItem) => void;
|
|
36
37
|
handleDateInputBlur: () => void;
|
|
37
38
|
handleDateInput: (value: string) => void;
|
|
38
39
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -149,12 +150,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
149
150
|
fontWeight: string;
|
|
150
151
|
fontWeightStrong: string;
|
|
151
152
|
cubicBezierEaseInOut: string;
|
|
152
|
-
/**
|
|
153
|
-
* Month Panel
|
|
154
|
-
* Update picker value on:
|
|
155
|
-
* 1. item click
|
|
156
|
-
* 2. clear click
|
|
157
|
-
*/
|
|
158
153
|
cubicBezierEaseOut: string;
|
|
159
154
|
cubicBezierEaseIn: string;
|
|
160
155
|
borderRadius: string;
|
|
@@ -221,12 +216,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
221
216
|
calendarLeftPaddingDatetimerange: string;
|
|
222
217
|
calendarLeftPaddingMonth: string;
|
|
223
218
|
calendarLeftPaddingYear: string;
|
|
219
|
+
calendarLeftPaddingQuarter: string;
|
|
224
220
|
calendarRightPaddingDate: string;
|
|
225
221
|
calendarRightPaddingDatetime: string;
|
|
226
222
|
calendarRightPaddingDaterange: string;
|
|
227
223
|
calendarRightPaddingDatetimerange: string;
|
|
228
224
|
calendarRightPaddingMonth: string;
|
|
229
225
|
calendarRightPaddingYear: string;
|
|
226
|
+
calendarRightPaddingQuarter: string;
|
|
230
227
|
};
|
|
231
228
|
peers: {
|
|
232
229
|
Input: import("../../../_mixins").Theme<"Input", {
|
|
@@ -1087,6 +1084,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1087
1084
|
monthTypeFormat: string;
|
|
1088
1085
|
dateFormat: string;
|
|
1089
1086
|
dateTimeFormat: string;
|
|
1087
|
+
quarterFormat: string;
|
|
1090
1088
|
clear: string;
|
|
1091
1089
|
now: string;
|
|
1092
1090
|
confirm: string;
|
|
@@ -1096,6 +1094,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1096
1094
|
datetimePlaceholder: string;
|
|
1097
1095
|
monthPlaceholder: string;
|
|
1098
1096
|
yearPlaceholder: string;
|
|
1097
|
+
quarterPlaceholder: string;
|
|
1099
1098
|
startDatePlaceholder: string;
|
|
1100
1099
|
endDatePlaceholder: string;
|
|
1101
1100
|
startDatetimePlaceholder: string;
|
|
@@ -1129,6 +1128,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1129
1128
|
dateArray: import("vue").ComputedRef<import("../utils").DateItem[]>;
|
|
1130
1129
|
monthArray: import("vue").ComputedRef<MonthItem[]>;
|
|
1131
1130
|
yearArray: import("vue").ComputedRef<YearItem[]>;
|
|
1131
|
+
quarterArray: import("vue").ComputedRef<QuarterItem[]>;
|
|
1132
1132
|
calendarYear: import("vue").ComputedRef<string>;
|
|
1133
1133
|
calendarMonth: import("vue").ComputedRef<string>;
|
|
1134
1134
|
weekdays: import("vue").ComputedRef<string[]>;
|
|
@@ -1149,12 +1149,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1149
1149
|
timeFormat?: unknown;
|
|
1150
1150
|
value?: unknown;
|
|
1151
1151
|
shortcuts?: unknown;
|
|
1152
|
+
defaultTime?: unknown;
|
|
1152
1153
|
onConfirm?: unknown;
|
|
1153
1154
|
onClose?: unknown;
|
|
1154
1155
|
onTabOut?: unknown;
|
|
1155
1156
|
onUpdateValue?: unknown;
|
|
1156
1157
|
} & {
|
|
1157
|
-
type: "month" | "year";
|
|
1158
|
+
type: "month" | "year" | "quarter";
|
|
1158
1159
|
value: import("../interface").Value | null;
|
|
1159
1160
|
active: boolean;
|
|
1160
1161
|
dateFormat: string;
|
|
@@ -1165,6 +1166,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1165
1166
|
onTabOut?: Function | undefined;
|
|
1166
1167
|
onClose?: import("../interface").OnClose | undefined;
|
|
1167
1168
|
onConfirm?: Function | undefined;
|
|
1169
|
+
defaultTime?: import("../interface").DefaultTime | undefined;
|
|
1168
1170
|
shortcuts?: import("../interface").Shortcuts | undefined;
|
|
1169
1171
|
}>, {
|
|
1170
1172
|
value: import("../interface").Value | null;
|
|
@@ -4,8 +4,8 @@ const vue_1 = require("vue");
|
|
|
4
4
|
const vueuc_1 = require("vueuc");
|
|
5
5
|
const button_1 = require("../../../button");
|
|
6
6
|
const _internal_1 = require("../../../_internal");
|
|
7
|
-
const use_calendar_1 = require("./use-calendar");
|
|
8
7
|
const config_1 = require("../config");
|
|
8
|
+
const use_calendar_1 = require("./use-calendar");
|
|
9
9
|
/**
|
|
10
10
|
* Month Panel
|
|
11
11
|
* Update picker value on:
|
|
@@ -14,32 +14,41 @@ const config_1 = require("../config");
|
|
|
14
14
|
*/
|
|
15
15
|
exports.default = (0, vue_1.defineComponent)({
|
|
16
16
|
name: 'MonthPanel',
|
|
17
|
-
props: Object.assign(Object.assign({}, use_calendar_1.
|
|
17
|
+
props: Object.assign(Object.assign({}, use_calendar_1.useCalendarProps), { type: {
|
|
18
18
|
type: String,
|
|
19
19
|
required: true
|
|
20
20
|
} }),
|
|
21
21
|
setup(props) {
|
|
22
22
|
const useCalendarRef = (0, use_calendar_1.useCalendar)(props, props.type);
|
|
23
|
+
const getRenderContent = (item) => {
|
|
24
|
+
switch (item.type) {
|
|
25
|
+
case 'year':
|
|
26
|
+
return item.dateObject.year;
|
|
27
|
+
case 'month':
|
|
28
|
+
return item.dateObject.month + 1;
|
|
29
|
+
case 'quarter':
|
|
30
|
+
return `Q ${item.dateObject.quarter}`;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
23
33
|
const renderItem = (item, i, mergedClsPrefix) => {
|
|
24
34
|
const { mergedIsDateDisabled, handleDateClick } = useCalendarRef;
|
|
25
35
|
return ((0, vue_1.h)("div", { "data-n-date": true, key: i, class: [
|
|
26
36
|
`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item`,
|
|
27
37
|
{
|
|
28
|
-
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--current`]: item.
|
|
29
|
-
? item.isCurrentMonth
|
|
30
|
-
: item.isCurrentYear,
|
|
38
|
+
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--current`]: item.isCurrent,
|
|
31
39
|
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--selected`]: item.selected,
|
|
32
40
|
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--disabled`]: mergedIsDateDisabled(item.ts)
|
|
33
41
|
}
|
|
34
|
-
], onClick: () => handleDateClick(item) }, item
|
|
35
|
-
? item.dateObject.month + 1
|
|
36
|
-
: item.dateObject.year));
|
|
42
|
+
], onClick: () => handleDateClick(item) }, getRenderContent(item)));
|
|
37
43
|
};
|
|
38
44
|
return Object.assign(Object.assign({}, useCalendarRef), { renderItem });
|
|
39
45
|
},
|
|
40
46
|
render() {
|
|
41
47
|
const { mergedClsPrefix, mergedTheme, shortcuts, actions, renderItem, type } = this;
|
|
42
|
-
return ((0, vue_1.h)("div", { ref: "selfRef", tabindex: 0, class:
|
|
48
|
+
return ((0, vue_1.h)("div", { ref: "selfRef", tabindex: 0, class: [
|
|
49
|
+
`${mergedClsPrefix}-date-panel`,
|
|
50
|
+
`${mergedClsPrefix}-date-panel--month`
|
|
51
|
+
], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
|
|
43
52
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-month-calendar` },
|
|
44
53
|
(0, vue_1.h)(_internal_1.NScrollbar, { ref: "scrollbarInstRef", class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col`, theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar, container: this.virtualListContainer, content: this.virtualListContent, horizontalRailStyle: { zIndex: 1 }, verticalRailStyle: { zIndex: 1 } }, {
|
|
45
54
|
default: () => ((0, vue_1.h)(vueuc_1.VirtualList, { ref: "yearScrollRef", items: this.yearArray, itemSize: config_1.MONTH_ITEM_HEIGHT, showScrollbar: false, keyField: "ts", onScroll: this.handleVirtualListScroll, paddingBottom: 4 }, {
|
|
@@ -48,11 +57,13 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
48
57
|
}
|
|
49
58
|
}))
|
|
50
59
|
}),
|
|
51
|
-
type === 'month' ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col` },
|
|
60
|
+
type === 'month' || type === 'quarter' ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col` },
|
|
52
61
|
(0, vue_1.h)(_internal_1.NScrollbar, { ref: "monthScrollRef", theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar }, {
|
|
53
62
|
default: () => [
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
(type === 'month'
|
|
64
|
+
? this.monthArray
|
|
65
|
+
: this.quarterArray).map((item, i) => renderItem(item, i, mergedClsPrefix)),
|
|
66
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-${type}-calendar__padding` })
|
|
56
67
|
]
|
|
57
68
|
}))) : null),
|
|
58
69
|
this.datePickerSlots.footer ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-footer` }, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { Shortcuts } from '../interface';
|
|
3
|
-
import type { DateItem, MonthItem, YearItem } from '../utils';
|
|
2
|
+
import type { Shortcuts } from '../interface';
|
|
3
|
+
import type { DateItem, MonthItem, YearItem, QuarterItem } from '../utils';
|
|
4
4
|
declare const useCalendarProps: {
|
|
5
5
|
readonly actions: {
|
|
6
6
|
readonly type: PropType<string[]>;
|
|
@@ -20,6 +20,7 @@ declare const useCalendarProps: {
|
|
|
20
20
|
readonly default: null;
|
|
21
21
|
};
|
|
22
22
|
readonly shortcuts: PropType<Shortcuts>;
|
|
23
|
+
readonly defaultTime: PropType<import("../interface").DefaultTime>;
|
|
23
24
|
readonly onConfirm: FunctionConstructor;
|
|
24
25
|
readonly onClose: PropType<import("../interface").OnClose>;
|
|
25
26
|
readonly onTabOut: FunctionConstructor;
|
|
@@ -28,8 +29,8 @@ declare const useCalendarProps: {
|
|
|
28
29
|
readonly required: true;
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
|
-
declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year'): {
|
|
32
|
-
handleDateClick: (dateItem: DateItem | MonthItem | YearItem) => void;
|
|
32
|
+
declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year' | 'quarter'): {
|
|
33
|
+
handleDateClick: (dateItem: DateItem | MonthItem | YearItem | QuarterItem) => void;
|
|
33
34
|
handleDateInputBlur: () => void;
|
|
34
35
|
handleDateInput: (value: string) => void;
|
|
35
36
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -212,12 +213,14 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
212
213
|
calendarLeftPaddingDatetimerange: string;
|
|
213
214
|
calendarLeftPaddingMonth: string;
|
|
214
215
|
calendarLeftPaddingYear: string;
|
|
216
|
+
calendarLeftPaddingQuarter: string;
|
|
215
217
|
calendarRightPaddingDate: string;
|
|
216
218
|
calendarRightPaddingDatetime: string;
|
|
217
219
|
calendarRightPaddingDaterange: string;
|
|
218
220
|
calendarRightPaddingDatetimerange: string;
|
|
219
221
|
calendarRightPaddingMonth: string;
|
|
220
222
|
calendarRightPaddingYear: string;
|
|
223
|
+
calendarRightPaddingQuarter: string;
|
|
221
224
|
};
|
|
222
225
|
peers: {
|
|
223
226
|
Input: import("../../../_mixins").Theme<"Input", {
|
|
@@ -1078,6 +1081,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1078
1081
|
monthTypeFormat: string;
|
|
1079
1082
|
dateFormat: string;
|
|
1080
1083
|
dateTimeFormat: string;
|
|
1084
|
+
quarterFormat: string;
|
|
1081
1085
|
clear: string;
|
|
1082
1086
|
now: string;
|
|
1083
1087
|
confirm: string;
|
|
@@ -1087,6 +1091,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1087
1091
|
datetimePlaceholder: string;
|
|
1088
1092
|
monthPlaceholder: string;
|
|
1089
1093
|
yearPlaceholder: string;
|
|
1094
|
+
quarterPlaceholder: string;
|
|
1090
1095
|
startDatePlaceholder: string;
|
|
1091
1096
|
endDatePlaceholder: string;
|
|
1092
1097
|
startDatetimePlaceholder: string;
|
|
@@ -1120,6 +1125,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1120
1125
|
dateArray: import("vue").ComputedRef<DateItem[]>;
|
|
1121
1126
|
monthArray: import("vue").ComputedRef<MonthItem[]>;
|
|
1122
1127
|
yearArray: import("vue").ComputedRef<YearItem[]>;
|
|
1128
|
+
quarterArray: import("vue").ComputedRef<QuarterItem[]>;
|
|
1123
1129
|
calendarYear: import("vue").ComputedRef<string>;
|
|
1124
1130
|
calendarMonth: import("vue").ComputedRef<string>;
|
|
1125
1131
|
weekdays: import("vue").ComputedRef<string[]>;
|
|
@@ -1133,33 +1139,4 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1133
1139
|
handleSingleShortcutMouseenter: (shortcut: Shortcuts[string]) => void;
|
|
1134
1140
|
handleSingleShortcutClick: (shortcut: Shortcuts[string]) => void;
|
|
1135
1141
|
};
|
|
1136
|
-
|
|
1137
|
-
var props: {
|
|
1138
|
-
readonly actions: {
|
|
1139
|
-
readonly type: PropType<string[]>;
|
|
1140
|
-
readonly default: () => string[];
|
|
1141
|
-
};
|
|
1142
|
-
readonly active: BooleanConstructor;
|
|
1143
|
-
readonly dateFormat: {
|
|
1144
|
-
readonly type: StringConstructor;
|
|
1145
|
-
readonly default: "yyyy-MM-dd";
|
|
1146
|
-
};
|
|
1147
|
-
readonly timeFormat: {
|
|
1148
|
-
readonly type: StringConstructor;
|
|
1149
|
-
readonly default: "HH:mm:ss";
|
|
1150
|
-
};
|
|
1151
|
-
readonly value: {
|
|
1152
|
-
readonly type: PropType<import("../interface").Value | null>;
|
|
1153
|
-
readonly default: null;
|
|
1154
|
-
};
|
|
1155
|
-
readonly shortcuts: PropType<Shortcuts>;
|
|
1156
|
-
readonly onConfirm: FunctionConstructor;
|
|
1157
|
-
readonly onClose: PropType<import("../interface").OnClose>;
|
|
1158
|
-
readonly onTabOut: FunctionConstructor;
|
|
1159
|
-
readonly onUpdateValue: {
|
|
1160
|
-
readonly type: PropType<import("../interface").OnPanelUpdateValue>;
|
|
1161
|
-
readonly required: true;
|
|
1162
|
-
};
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
|
-
export { useCalendar };
|
|
1142
|
+
export { useCalendar, useCalendarProps };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCalendar = void 0;
|
|
3
|
+
exports.useCalendarProps = exports.useCalendar = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const date_fns_1 = require("date-fns");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
-
const use_panel_common_1 = require("./use-panel-common");
|
|
8
7
|
const interface_1 = require("../interface");
|
|
9
|
-
const
|
|
8
|
+
const use_panel_common_1 = require("./use-panel-common");
|
|
9
|
+
const useCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommonProps), { actions: {
|
|
10
10
|
type: Array,
|
|
11
11
|
default: () => ['now', 'clear', 'confirm']
|
|
12
12
|
} });
|
|
13
|
+
exports.useCalendarProps = useCalendarProps;
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
14
15
|
function useCalendar(props, type) {
|
|
15
16
|
const panelCommon = (0, use_panel_common_1.usePanelCommon)(props);
|
|
16
|
-
const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots,
|
|
17
|
+
const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots, scrollPickerColumns
|
|
17
18
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18
19
|
} = (0, vue_1.inject)(interface_1.datePickerInjectionKey);
|
|
19
20
|
const validation = {
|
|
@@ -46,6 +47,9 @@ function useCalendar(props, type) {
|
|
|
46
47
|
const yearArrayRef = (0, vue_1.computed)(() => {
|
|
47
48
|
return (0, utils_1.yearArray)(calendarValueRef.value, props.value, nowRef.value);
|
|
48
49
|
});
|
|
50
|
+
const querterArrayRef = (0, vue_1.computed)(() => {
|
|
51
|
+
return (0, utils_1.quarterArray)(calendarValueRef.value, props.value, nowRef.value);
|
|
52
|
+
});
|
|
49
53
|
const weekdaysRef = (0, vue_1.computed)(() => {
|
|
50
54
|
return dateArrayRef.value.slice(0, 7).map((dateItem) => {
|
|
51
55
|
const { ts } = dateItem;
|
|
@@ -79,6 +83,8 @@ function useCalendar(props, type) {
|
|
|
79
83
|
return (0, date_fns_1.getTime)((0, date_fns_1.startOfMonth)(value));
|
|
80
84
|
if (type === 'year')
|
|
81
85
|
return (0, date_fns_1.getTime)((0, date_fns_1.startOfYear)(value));
|
|
86
|
+
if (type === 'quarter')
|
|
87
|
+
return (0, date_fns_1.getTime)((0, date_fns_1.startOfQuarter)(value));
|
|
82
88
|
return (0, date_fns_1.getTime)((0, date_fns_1.startOfDay)(value));
|
|
83
89
|
}
|
|
84
90
|
function mergedIsDateDisabled(ts) {
|
|
@@ -146,17 +152,30 @@ function useCalendar(props, type) {
|
|
|
146
152
|
else {
|
|
147
153
|
newValue = Date.now();
|
|
148
154
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
scrollYearMonth(newValue);
|
|
155
|
+
if (type === 'datetime' &&
|
|
156
|
+
props.defaultTime !== null &&
|
|
157
|
+
!Array.isArray(props.defaultTime)) {
|
|
158
|
+
const time = (0, utils_1.getDefaultTime)(props.defaultTime);
|
|
159
|
+
if (time) {
|
|
160
|
+
newValue = (0, date_fns_1.getTime)((0, date_fns_1.set)(newValue, time)); // setDate getTime(addMilliseconds(startOfDay(newValue), time))
|
|
161
|
+
}
|
|
157
162
|
}
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
newValue = (0, date_fns_1.getTime)(dateItem.type === 'quarter' && dateItem.dateObject.quarter
|
|
164
|
+
? (0, date_fns_1.setQuarter)((0, date_fns_1.setYear)(newValue, dateItem.dateObject.year), dateItem.dateObject.quarter)
|
|
165
|
+
: (0, date_fns_1.set)(newValue, dateItem.dateObject));
|
|
166
|
+
panelCommon.doUpdateValue(sanitizeValue(newValue), type === 'date' || type === 'year');
|
|
167
|
+
switch (type) {
|
|
168
|
+
case 'date':
|
|
169
|
+
case 'year':
|
|
170
|
+
panelCommon.doClose();
|
|
171
|
+
break;
|
|
172
|
+
case 'month':
|
|
173
|
+
panelCommon.disableTransitionOneTick();
|
|
174
|
+
scrollPickerColumns(newValue);
|
|
175
|
+
break;
|
|
176
|
+
case 'quarter':
|
|
177
|
+
scrollPickerColumns(newValue);
|
|
178
|
+
break;
|
|
160
179
|
}
|
|
161
180
|
}
|
|
162
181
|
function deriveDateInputValue(time) {
|
|
@@ -230,7 +249,7 @@ function useCalendar(props, type) {
|
|
|
230
249
|
panelCommon.clearPendingValue();
|
|
231
250
|
handleConfirmClick();
|
|
232
251
|
}
|
|
233
|
-
return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
|
|
252
|
+
return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, quarterArray: querterArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
|
|
234
253
|
nextYear,
|
|
235
254
|
prevYear,
|
|
236
255
|
nextMonth,
|
|
@@ -253,4 +272,3 @@ function useCalendar(props, type) {
|
|
|
253
272
|
scrollbarInstRef });
|
|
254
273
|
}
|
|
255
274
|
exports.useCalendar = useCalendar;
|
|
256
|
-
useCalendar.props = useCalendarProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { DateItem } from '../utils';
|
|
3
|
-
import { Shortcuts } from '../interface';
|
|
3
|
+
import type { Shortcuts } from '../interface';
|
|
4
4
|
declare const useDualCalendarProps: {
|
|
5
5
|
readonly actions: {
|
|
6
6
|
readonly type: ArrayConstructor;
|
|
@@ -20,6 +20,7 @@ declare const useDualCalendarProps: {
|
|
|
20
20
|
readonly default: null;
|
|
21
21
|
};
|
|
22
22
|
readonly shortcuts: import("vue").PropType<Shortcuts>;
|
|
23
|
+
readonly defaultTime: import("vue").PropType<import("../interface").DefaultTime>;
|
|
23
24
|
readonly onConfirm: FunctionConstructor;
|
|
24
25
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
25
26
|
readonly onTabOut: FunctionConstructor;
|
|
@@ -210,12 +211,14 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
210
211
|
calendarLeftPaddingDatetimerange: string;
|
|
211
212
|
calendarLeftPaddingMonth: string;
|
|
212
213
|
calendarLeftPaddingYear: string;
|
|
214
|
+
calendarLeftPaddingQuarter: string;
|
|
213
215
|
calendarRightPaddingDate: string;
|
|
214
216
|
calendarRightPaddingDatetime: string;
|
|
215
217
|
calendarRightPaddingDaterange: string;
|
|
216
218
|
calendarRightPaddingDatetimerange: string;
|
|
217
219
|
calendarRightPaddingMonth: string;
|
|
218
220
|
calendarRightPaddingYear: string;
|
|
221
|
+
calendarRightPaddingQuarter: string;
|
|
219
222
|
};
|
|
220
223
|
peers: {
|
|
221
224
|
Input: import("../../../_mixins").Theme<"Input", {
|
|
@@ -1076,6 +1079,7 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
1076
1079
|
monthTypeFormat: string;
|
|
1077
1080
|
dateFormat: string;
|
|
1078
1081
|
dateTimeFormat: string;
|
|
1082
|
+
quarterFormat: string;
|
|
1079
1083
|
clear: string;
|
|
1080
1084
|
now: string;
|
|
1081
1085
|
confirm: string;
|
|
@@ -1085,6 +1089,7 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
1085
1089
|
datetimePlaceholder: string;
|
|
1086
1090
|
monthPlaceholder: string;
|
|
1087
1091
|
yearPlaceholder: string;
|
|
1092
|
+
quarterPlaceholder: string;
|
|
1088
1093
|
startDatePlaceholder: string;
|
|
1089
1094
|
endDatePlaceholder: string;
|
|
1090
1095
|
startDatetimePlaceholder: string;
|
|
@@ -1133,33 +1138,4 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
1133
1138
|
handleRangeShortcutMouseenter: (shortcut: Shortcuts[string]) => void;
|
|
1134
1139
|
handleRangeShortcutClick: (shortcut: Shortcuts[string]) => void;
|
|
1135
1140
|
};
|
|
1136
|
-
|
|
1137
|
-
var props: {
|
|
1138
|
-
readonly actions: {
|
|
1139
|
-
readonly type: ArrayConstructor;
|
|
1140
|
-
readonly default: () => string[];
|
|
1141
|
-
};
|
|
1142
|
-
readonly active: BooleanConstructor;
|
|
1143
|
-
readonly dateFormat: {
|
|
1144
|
-
readonly type: StringConstructor;
|
|
1145
|
-
readonly default: "yyyy-MM-dd";
|
|
1146
|
-
};
|
|
1147
|
-
readonly timeFormat: {
|
|
1148
|
-
readonly type: StringConstructor;
|
|
1149
|
-
readonly default: "HH:mm:ss";
|
|
1150
|
-
};
|
|
1151
|
-
readonly value: {
|
|
1152
|
-
readonly type: import("vue").PropType<import("../interface").Value | null>;
|
|
1153
|
-
readonly default: null;
|
|
1154
|
-
};
|
|
1155
|
-
readonly shortcuts: import("vue").PropType<Shortcuts>;
|
|
1156
|
-
readonly onConfirm: FunctionConstructor;
|
|
1157
|
-
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
1158
|
-
readonly onTabOut: FunctionConstructor;
|
|
1159
|
-
readonly onUpdateValue: {
|
|
1160
|
-
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
1161
|
-
readonly required: true;
|
|
1162
|
-
};
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
|
-
export { useDualCalendar };
|
|
1141
|
+
export { useDualCalendar, useDualCalendarProps };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useDualCalendar = void 0;
|
|
3
|
+
exports.useDualCalendarProps = exports.useDualCalendar = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const date_fns_1 = require("date-fns");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
-
const use_panel_common_1 = require("./use-panel-common");
|
|
8
7
|
const interface_1 = require("../interface");
|
|
9
|
-
const
|
|
8
|
+
const use_panel_common_1 = require("./use-panel-common");
|
|
9
|
+
const useDualCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommonProps), { actions: {
|
|
10
10
|
type: Array,
|
|
11
11
|
default: () => ['clear', 'confirm']
|
|
12
12
|
} });
|
|
13
|
+
exports.useDualCalendarProps = useDualCalendarProps;
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
14
15
|
function useDualCalendar(props, type = 'datetime') {
|
|
15
16
|
const { isDateDisabledRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots
|
|
@@ -290,8 +291,24 @@ function useDualCalendar(props, type = 'datetime') {
|
|
|
290
291
|
if (typeof startTime !== 'number') {
|
|
291
292
|
startTime = (0, date_fns_1.getTime)(startTime);
|
|
292
293
|
}
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
let startDefaultTime;
|
|
295
|
+
let endDefaultTime;
|
|
296
|
+
if (type === 'datetimerange') {
|
|
297
|
+
const { defaultTime } = props;
|
|
298
|
+
if (Array.isArray(defaultTime)) {
|
|
299
|
+
startDefaultTime = (0, utils_1.getDefaultTime)(defaultTime[0]);
|
|
300
|
+
endDefaultTime = (0, utils_1.getDefaultTime)(defaultTime[1]);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
startDefaultTime = (0, utils_1.getDefaultTime)(defaultTime);
|
|
304
|
+
endDefaultTime = startDefaultTime;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (startDefaultTime) {
|
|
308
|
+
startTime = (0, date_fns_1.getTime)((0, date_fns_1.set)(startTime, startDefaultTime));
|
|
309
|
+
}
|
|
310
|
+
if (endDefaultTime) {
|
|
311
|
+
endTime = (0, date_fns_1.getTime)((0, date_fns_1.set)(endTime, endDefaultTime));
|
|
295
312
|
}
|
|
296
313
|
panelCommon.doUpdateValue([startTime, endTime], false);
|
|
297
314
|
}
|
|
@@ -471,4 +488,3 @@ function useDualCalendar(props, type = 'datetime') {
|
|
|
471
488
|
datePickerSlots, shortcuts: shortcutsRef });
|
|
472
489
|
}
|
|
473
490
|
exports.useDualCalendar = useDualCalendar;
|
|
474
|
-
useDualCalendar.props = useDualCalendarProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import { Value, OnPanelUpdateValue, OnClose, Shortcuts } from '../interface';
|
|
2
|
+
import { Value, OnPanelUpdateValue, OnClose, Shortcuts, DefaultTime } from '../interface';
|
|
3
3
|
declare const usePanelCommonProps: {
|
|
4
4
|
readonly active: BooleanConstructor;
|
|
5
5
|
readonly dateFormat: {
|
|
@@ -15,6 +15,7 @@ declare const usePanelCommonProps: {
|
|
|
15
15
|
readonly default: null;
|
|
16
16
|
};
|
|
17
17
|
readonly shortcuts: PropType<Shortcuts>;
|
|
18
|
+
readonly defaultTime: PropType<DefaultTime>;
|
|
18
19
|
readonly onConfirm: FunctionConstructor;
|
|
19
20
|
readonly onClose: PropType<OnClose>;
|
|
20
21
|
readonly onTabOut: FunctionConstructor;
|
|
@@ -176,12 +177,14 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
176
177
|
calendarLeftPaddingDatetimerange: string;
|
|
177
178
|
calendarLeftPaddingMonth: string;
|
|
178
179
|
calendarLeftPaddingYear: string;
|
|
180
|
+
calendarLeftPaddingQuarter: string;
|
|
179
181
|
calendarRightPaddingDate: string;
|
|
180
182
|
calendarRightPaddingDatetime: string;
|
|
181
183
|
calendarRightPaddingDaterange: string;
|
|
182
184
|
calendarRightPaddingDatetimerange: string;
|
|
183
185
|
calendarRightPaddingMonth: string;
|
|
184
186
|
calendarRightPaddingYear: string;
|
|
187
|
+
calendarRightPaddingQuarter: string;
|
|
185
188
|
};
|
|
186
189
|
peers: {
|
|
187
190
|
Input: import("../../../_mixins").Theme<"Input", {
|
|
@@ -1043,6 +1046,7 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
1043
1046
|
monthTypeFormat: string;
|
|
1044
1047
|
dateFormat: string;
|
|
1045
1048
|
dateTimeFormat: string;
|
|
1049
|
+
quarterFormat: string;
|
|
1046
1050
|
clear: string;
|
|
1047
1051
|
now: string;
|
|
1048
1052
|
confirm: string;
|
|
@@ -1052,6 +1056,7 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
1052
1056
|
datetimePlaceholder: string;
|
|
1053
1057
|
monthPlaceholder: string;
|
|
1054
1058
|
yearPlaceholder: string;
|
|
1059
|
+
quarterPlaceholder: string;
|
|
1055
1060
|
startDatePlaceholder: string;
|
|
1056
1061
|
endDatePlaceholder: string;
|
|
1057
1062
|
startDatetimePlaceholder: string;
|
|
@@ -1075,29 +1080,4 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
1075
1080
|
getShortcutValue: (shortcut: Shortcuts[string]) => number | [number, number];
|
|
1076
1081
|
handleShortcutMouseleave: () => void;
|
|
1077
1082
|
};
|
|
1078
|
-
|
|
1079
|
-
var props: {
|
|
1080
|
-
readonly active: BooleanConstructor;
|
|
1081
|
-
readonly dateFormat: {
|
|
1082
|
-
readonly type: StringConstructor;
|
|
1083
|
-
readonly default: "yyyy-MM-dd";
|
|
1084
|
-
};
|
|
1085
|
-
readonly timeFormat: {
|
|
1086
|
-
readonly type: StringConstructor;
|
|
1087
|
-
readonly default: "HH:mm:ss";
|
|
1088
|
-
};
|
|
1089
|
-
readonly value: {
|
|
1090
|
-
readonly type: PropType<Value | null>;
|
|
1091
|
-
readonly default: null;
|
|
1092
|
-
};
|
|
1093
|
-
readonly shortcuts: PropType<Shortcuts>;
|
|
1094
|
-
readonly onConfirm: FunctionConstructor;
|
|
1095
|
-
readonly onClose: PropType<OnClose>;
|
|
1096
|
-
readonly onTabOut: FunctionConstructor;
|
|
1097
|
-
readonly onUpdateValue: {
|
|
1098
|
-
readonly type: PropType<OnPanelUpdateValue>;
|
|
1099
|
-
readonly required: true;
|
|
1100
|
-
};
|
|
1101
|
-
};
|
|
1102
|
-
}
|
|
1103
|
-
export { usePanelCommon };
|
|
1083
|
+
export { usePanelCommon, usePanelCommonProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePanelCommon = void 0;
|
|
3
|
+
exports.usePanelCommonProps = exports.usePanelCommon = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const vooks_1 = require("vooks");
|
|
6
6
|
const interface_1 = require("../interface");
|
|
@@ -21,6 +21,7 @@ const usePanelCommonProps = {
|
|
|
21
21
|
default: null
|
|
22
22
|
},
|
|
23
23
|
shortcuts: Object,
|
|
24
|
+
defaultTime: [Number, String, Array],
|
|
24
25
|
onConfirm: Function,
|
|
25
26
|
onClose: Function,
|
|
26
27
|
onTabOut: Function,
|
|
@@ -29,6 +30,7 @@ const usePanelCommonProps = {
|
|
|
29
30
|
required: true
|
|
30
31
|
}
|
|
31
32
|
};
|
|
33
|
+
exports.usePanelCommonProps = usePanelCommonProps;
|
|
32
34
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
33
35
|
function usePanelCommon(props) {
|
|
34
36
|
const { dateLocaleRef, timePickerSizeRef, localeRef, mergedClsPrefixRef, mergedThemeRef
|
|
@@ -143,4 +145,3 @@ function usePanelCommon(props) {
|
|
|
143
145
|
};
|
|
144
146
|
}
|
|
145
147
|
exports.usePanelCommon = usePanelCommon;
|
|
146
|
-
usePanelCommon.props = usePanelCommonProps;
|
|
@@ -21,7 +21,7 @@ export interface MonthItem {
|
|
|
21
21
|
month: number;
|
|
22
22
|
year: number;
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
isCurrent: boolean;
|
|
25
25
|
selected: boolean;
|
|
26
26
|
ts: number;
|
|
27
27
|
}
|
|
@@ -30,7 +30,17 @@ export interface YearItem {
|
|
|
30
30
|
dateObject: {
|
|
31
31
|
year: number;
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
isCurrent: boolean;
|
|
34
|
+
selected: boolean;
|
|
35
|
+
ts: number;
|
|
36
|
+
}
|
|
37
|
+
export interface QuarterItem {
|
|
38
|
+
type: 'quarter';
|
|
39
|
+
dateObject: {
|
|
40
|
+
quarter: number;
|
|
41
|
+
year: number;
|
|
42
|
+
};
|
|
43
|
+
isCurrent: boolean;
|
|
34
44
|
selected: boolean;
|
|
35
45
|
ts: number;
|
|
36
46
|
}
|
|
@@ -40,8 +50,14 @@ export interface YearItem {
|
|
|
40
50
|
*/
|
|
41
51
|
declare function dateArray(monthTs: number, valueTs: number | [number, number] | null, currentTs: number, startDay: 0 | 1 | 2 | 3 | 4 | 5 | 6, strip?: boolean): DateItem[];
|
|
42
52
|
declare function monthArray(monthTs: number, valueTs: number | [number, number] | null, currentTs: number): MonthItem[];
|
|
53
|
+
declare function quarterArray(quarterTs: number, valueTs: number | [number, number] | null, currentTs: number): QuarterItem[];
|
|
43
54
|
declare function yearArray(yearTs: number, valueTs: number | [number, number] | null, currentTs: number): YearItem[];
|
|
44
55
|
declare function strictParse(string: string, pattern: string, backup: Date, option: {
|
|
45
56
|
locale: Locale;
|
|
46
57
|
}): Date;
|
|
47
|
-
|
|
58
|
+
declare function getDefaultTime(timeValue: string | undefined): {
|
|
59
|
+
hours: number;
|
|
60
|
+
minutes: number;
|
|
61
|
+
seconds: number;
|
|
62
|
+
} | undefined;
|
|
63
|
+
export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime };
|