@uzum-tech/ui 1.1.5 → 1.2.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/README.md +1 -1
- package/dist/index.js +266 -340
- package/dist/index.prod.js +2 -2
- package/es/_utils/uzum/warn.js +3 -3
- package/es/alert/src/Alert.js +1 -1
- package/es/alert/src/styles/index.cssr.js +1 -1
- package/es/date-picker/src/DatePicker.d.ts +1 -0
- package/es/date-picker/src/DatePicker.js +10 -8
- package/es/date-picker/src/config.d.ts +1 -1
- package/es/date-picker/src/config.js +1 -1
- package/es/date-picker/src/interface.d.ts +7 -5
- package/es/date-picker/src/panel/date.d.ts +10 -7
- package/es/date-picker/src/panel/date.js +38 -18
- package/es/date-picker/src/panel/daterange.d.ts +18 -7
- package/es/date-picker/src/panel/daterange.js +94 -43
- package/es/date-picker/src/panel/datetime.d.ts +3 -1
- package/es/date-picker/src/panel/datetimerange.d.ts +2 -0
- package/es/date-picker/src/panel/panelHeader.d.ts +28 -7
- package/es/date-picker/src/panel/panelHeader.js +37 -13
- package/es/date-picker/src/panel/panelMonth.d.ts +16 -8
- package/es/date-picker/src/panel/panelMonth.js +8 -4
- package/es/date-picker/src/panel/panelMonthContent.d.ts +3 -1
- package/es/date-picker/src/panel/panelMonthContent.js +2 -5
- package/es/date-picker/src/panel/panelYear.d.ts +16 -8
- package/es/date-picker/src/panel/panelYear.js +8 -4
- package/es/date-picker/src/panel/panelYearContent.d.ts +3 -1
- package/es/date-picker/src/panel/panelYearContent.js +2 -1
- package/es/date-picker/src/panel/use-calendar.d.ts +4 -3
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +2 -0
- package/es/date-picker/src/panel/use-panel-common.js +1 -0
- package/es/date-picker/src/styles/index.cssr.js +12 -10
- package/es/date-picker/src/utils.d.ts +1 -0
- package/es/grid/src/Grid.js +1 -1
- package/es/preset.d.ts +2 -2
- package/es/preset.js +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_utils/uzum/warn.js +3 -3
- package/lib/alert/src/Alert.js +1 -1
- package/lib/alert/src/styles/index.cssr.js +1 -1
- package/lib/date-picker/src/DatePicker.d.ts +1 -0
- package/lib/date-picker/src/DatePicker.js +9 -7
- package/lib/date-picker/src/config.d.ts +1 -1
- package/lib/date-picker/src/config.js +1 -1
- package/lib/date-picker/src/interface.d.ts +7 -5
- package/lib/date-picker/src/panel/date.d.ts +10 -7
- package/lib/date-picker/src/panel/date.js +37 -17
- package/lib/date-picker/src/panel/daterange.d.ts +18 -7
- package/lib/date-picker/src/panel/daterange.js +93 -42
- package/lib/date-picker/src/panel/datetime.d.ts +3 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +2 -0
- package/lib/date-picker/src/panel/panelHeader.d.ts +28 -7
- package/lib/date-picker/src/panel/panelHeader.js +37 -13
- package/lib/date-picker/src/panel/panelMonth.d.ts +16 -8
- package/lib/date-picker/src/panel/panelMonth.js +8 -4
- package/lib/date-picker/src/panel/panelMonthContent.d.ts +3 -1
- package/lib/date-picker/src/panel/panelMonthContent.js +2 -5
- package/lib/date-picker/src/panel/panelYear.d.ts +16 -8
- package/lib/date-picker/src/panel/panelYear.js +8 -4
- package/lib/date-picker/src/panel/panelYearContent.d.ts +3 -1
- package/lib/date-picker/src/panel/panelYearContent.js +2 -1
- package/lib/date-picker/src/panel/use-calendar.d.ts +4 -3
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +2 -0
- package/lib/date-picker/src/panel/use-panel-common.js +1 -0
- package/lib/date-picker/src/styles/index.cssr.js +12 -10
- package/lib/date-picker/src/utils.d.ts +1 -0
- package/lib/grid/src/Grid.js +1 -1
- package/lib/preset.d.ts +2 -2
- package/lib/preset.js +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -6
- package/web-types.json +9 -9
- package/es/date-picker/src/panel/monthrange.d.ts +0 -1303
- package/es/date-picker/src/panel/monthrange.js +0 -117
- package/lib/date-picker/src/panel/monthrange.d.ts +0 -1303
- package/lib/date-picker/src/panel/monthrange.js +0 -119
package/lib/alert/src/Alert.js
CHANGED
|
@@ -134,7 +134,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
134
134
|
this.actionsHorizontal &&
|
|
135
135
|
`${mergedClsPrefix}-alert--horizontal`,
|
|
136
136
|
this.showIcon && `${mergedClsPrefix}-alert--show-icon`,
|
|
137
|
-
// fix: https://github.com/tusen-ai/
|
|
137
|
+
// fix: https://github.com/tusen-ai/uzum-ui/issues/4588
|
|
138
138
|
!this.title &&
|
|
139
139
|
this.closable &&
|
|
140
140
|
`${mergedClsPrefix}-alert--right-adjust`,
|
|
@@ -65,7 +65,7 @@ exports.default = (0, cssr_1.cB)('alert', `
|
|
|
65
65
|
width: var(--u-close-icon-size);
|
|
66
66
|
height: var(--u-close-icon-size);
|
|
67
67
|
`),
|
|
68
|
-
// fix: https://github.com/tusen-ai/
|
|
68
|
+
// fix: https://github.com/tusen-ai/uzum-ui/issues/4588
|
|
69
69
|
(0, cssr_1.cM)('right-adjust', [(0, cssr_1.cB)('alert-body', `
|
|
70
70
|
padding-right: calc(var(--u-close-size) + var(--u-padding) + 2px);
|
|
71
71
|
`)]), (0, cssr_1.cM)('show-icon', [(0, cssr_1.cB)('alert-body', [(0, cssr_1.cE)('content, title', `
|
|
@@ -4206,6 +4206,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4206
4206
|
}, any>;
|
|
4207
4207
|
}>>>;
|
|
4208
4208
|
}, {
|
|
4209
|
+
rangeTypes: DatePickerType[];
|
|
4209
4210
|
mergedStatus: import("vue").ComputedRef<FormValidationStatus | undefined>;
|
|
4210
4211
|
mergedClsPrefix: Ref<string>;
|
|
4211
4212
|
mergedBordered: import("vue").ComputedRef<boolean>;
|
|
@@ -23,7 +23,6 @@ const datetime_1 = __importDefault(require("./panel/datetime"));
|
|
|
23
23
|
const datetimerange_1 = __importDefault(require("./panel/datetimerange"));
|
|
24
24
|
const date_1 = __importDefault(require("./panel/date"));
|
|
25
25
|
const daterange_1 = __importDefault(require("./panel/daterange"));
|
|
26
|
-
const monthrange_1 = __importDefault(require("./panel/monthrange"));
|
|
27
26
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
28
27
|
exports.datePickerProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { to: _utils_1.useAdjustedTo.propTo, bordered: {
|
|
29
28
|
type: Boolean,
|
|
@@ -55,6 +54,12 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
55
54
|
}
|
|
56
55
|
});
|
|
57
56
|
}
|
|
57
|
+
const rangeTypes = [
|
|
58
|
+
'daterange',
|
|
59
|
+
'monthrange',
|
|
60
|
+
'yearrange',
|
|
61
|
+
'quarterrange'
|
|
62
|
+
];
|
|
58
63
|
const { localeRef, dateLocaleRef } = (0, _mixins_1.useLocale)('DatePicker');
|
|
59
64
|
const formItem = (0, _mixins_1.useFormItem)(props);
|
|
60
65
|
const { mergedSizeRef, mergedDisabledRef, mergedStatusRef } = formItem;
|
|
@@ -689,7 +694,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
689
694
|
return props.type;
|
|
690
695
|
}), cssVarsRef, props)
|
|
691
696
|
: undefined;
|
|
692
|
-
return Object.assign(Object.assign({}, exposedMethods), { mergedStatus: mergedStatusRef, mergedClsPrefix: mergedClsPrefixRef, mergedBordered: mergedBorderedRef, namespace: namespaceRef, uncontrolledValue: uncontrolledValueRef, pendingValue: pendingValueRef, panelInstRef,
|
|
697
|
+
return Object.assign(Object.assign({}, exposedMethods), { rangeTypes, mergedStatus: mergedStatusRef, mergedClsPrefix: mergedClsPrefixRef, mergedBordered: mergedBorderedRef, namespace: namespaceRef, uncontrolledValue: uncontrolledValueRef, pendingValue: pendingValueRef, panelInstRef,
|
|
693
698
|
triggerElRef,
|
|
694
699
|
inputInstRef, isMounted: (0, vooks_1.useIsMounted)(), displayTime: singleInputValueRef, displayStartTime: rangeStartInputValueRef, displayEndTime: rangeEndInputValueRef, mergedShow: mergedShowRef, adjustedTo: (0, _utils_1.useAdjustedTo)(props), isRange: isRangeRef, localizedStartPlaceholder: localizedStartPlaceholderRef, localizedEndPlaceholder: localizedEndPlaceholderRef, mergedSize: mergedSizeRef, mergedDisabled: mergedDisabledRef, localizedPlacehoder: localizedPlacehoderRef, isValueInvalid: uniVaidation.isValueInvalidRef, isStartValueInvalid: dualValidation.isStartValueInvalidRef, isEndValueInvalid: dualValidation.isEndValueInvalidRef, handleInputKeydown,
|
|
695
700
|
handleClickOutside,
|
|
@@ -732,11 +737,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
732
737
|
onRender: this.onRender
|
|
733
738
|
};
|
|
734
739
|
const renderPanel = () => {
|
|
735
|
-
const { type } = this;
|
|
736
|
-
return type === 'datetime' ? ((0, vue_1.h)(datetime_1.default, Object.assign({}, commonPanelProps), $slots)) : type
|
|
737
|
-
: type === 'monthrange' ||
|
|
738
|
-
type === 'yearrange' ||
|
|
739
|
-
type === 'quarterrange' ? ((0, vue_1.h)(monthrange_1.default, Object.assign({}, commonPanelProps, { type: type }))) : ((0, vue_1.h)(date_1.default, Object.assign({}, commonPanelProps), $slots));
|
|
740
|
+
const { type, rangeTypes } = this;
|
|
741
|
+
return type === 'datetime' ? ((0, vue_1.h)(datetime_1.default, Object.assign({}, commonPanelProps), $slots)) : rangeTypes.includes(type) ? ((0, vue_1.h)(daterange_1.default, Object.assign({}, commonPanelProps, { type: type, defaultCalendarStartTime: this.defaultCalendarStartTime, defaultCalendarEndTime: this.defaultCalendarEndTime, bindCalendarMonths: this.bindCalendarMonths }), $slots)) : type === 'datetimerange' ? ((0, vue_1.h)(datetimerange_1.default, Object.assign({}, commonPanelProps, { defaultCalendarStartTime: this.defaultCalendarStartTime, defaultCalendarEndTime: this.defaultCalendarEndTime, bindCalendarMonths: this.bindCalendarMonths }), $slots)) : ((0, vue_1.h)(date_1.default, Object.assign({}, commonPanelProps, { type: type }), $slots));
|
|
740
742
|
};
|
|
741
743
|
if (this.panel) {
|
|
742
744
|
return renderPanel();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MONTH_ITEM_GAP = exports.MONTH_ITEM_HEIGHT = exports.END_YEAR = exports.START_YEAR = void 0;
|
|
4
|
-
exports.START_YEAR =
|
|
4
|
+
exports.START_YEAR = 1924;
|
|
5
5
|
exports.END_YEAR = new Date().getFullYear();
|
|
6
6
|
exports.MONTH_ITEM_HEIGHT = 50;
|
|
7
7
|
exports.MONTH_ITEM_GAP = 8;
|
|
@@ -7,7 +7,12 @@ import type { TimePickerProps } from '../../time-picker/src/TimePicker';
|
|
|
7
7
|
import type { MergedTheme } from '../../_mixins';
|
|
8
8
|
import type { DatePickerTheme } from '../styles/light';
|
|
9
9
|
import type { uniCalendarValidation, dualCalendarValidation } from './validation-utils';
|
|
10
|
+
import { DateCommonItem } from './utils';
|
|
10
11
|
export type Value = number | [number, number];
|
|
12
|
+
export type PanelValue = number & (number | null) & [
|
|
13
|
+
number,
|
|
14
|
+
number
|
|
15
|
+
] & ([number, number] | null);
|
|
11
16
|
export type DefaultTime = string | [string | undefined, string | undefined];
|
|
12
17
|
export type FormattedValue = string | [string, string];
|
|
13
18
|
export type Shortcuts = Record<string, number | (() => number)> | Record<string, [number, number] | readonly [number, number] | (() => [number, number] | readonly [number, number])>;
|
|
@@ -29,11 +34,8 @@ export type OnUpdateFormattedValue = (value: string & (string | null) & [
|
|
|
29
34
|
] & ([number, number] | null)) => void;
|
|
30
35
|
export type OnUpdateFormattedValueImpl = (value: string | [string, string] | null, timestampValue: number | [number, number] | null) => void;
|
|
31
36
|
export type OnUpdateValueImpl = (value: Value | null, formattedValue: string | [string, string] | null) => void;
|
|
32
|
-
export type OnPanelUpdateValue = (value:
|
|
33
|
-
|
|
34
|
-
number
|
|
35
|
-
] & ([number, number] | null), doUpdate: boolean) => void;
|
|
36
|
-
export type OnPanelUpdateValueImpl = (value: Value | null, doUpdate: boolean) => void;
|
|
37
|
+
export type OnPanelUpdateValue = (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
|
|
38
|
+
export type OnPanelUpdateValueImpl = (value: Value | null, doUpdate: boolean, item?: DateCommonItem) => void;
|
|
37
39
|
export type OnClose = (disableUpdateOnClose: boolean) => void;
|
|
38
40
|
export interface RangePanelChildComponentRefs {
|
|
39
41
|
startYearScrollbarRef: Ref<ScrollbarInst | null>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DatePickerType } from '../config';
|
|
2
|
+
import { DateCommonItem } from '../utils';
|
|
1
3
|
/**
|
|
2
4
|
* Date Panel
|
|
3
5
|
* Update picker value on:
|
|
@@ -11,6 +13,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
13
|
};
|
|
12
14
|
readonly active: BooleanConstructor;
|
|
13
15
|
readonly dateFormat: StringConstructor;
|
|
16
|
+
readonly type: import("vue").PropType<DatePickerType>;
|
|
14
17
|
readonly timeFormat: {
|
|
15
18
|
readonly type: StringConstructor;
|
|
16
19
|
readonly value: "HH:mm:ss";
|
|
@@ -33,7 +36,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
36
|
readonly onRender: import("vue").PropType<(() => void) | undefined>;
|
|
34
37
|
readonly panel: BooleanConstructor;
|
|
35
38
|
}, {
|
|
36
|
-
|
|
39
|
+
isWithoutDay: import("vue").ComputedRef<boolean>;
|
|
40
|
+
isMonth: import("vue").ComputedRef<boolean>;
|
|
41
|
+
isYear: import("vue").ComputedRef<boolean>;
|
|
42
|
+
handleMonthClick: (value: number, _doUpdate: boolean, item?: DateCommonItem) => void;
|
|
43
|
+
handleYearClick: (value: number, _doUpdate: boolean, item?: DateCommonItem) => void;
|
|
44
|
+
handleDateClick: (dateItem: DateCommonItem) => void;
|
|
37
45
|
handleDateInputBlur: () => void;
|
|
38
46
|
handleDateInput: (value: string) => void;
|
|
39
47
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -114,12 +122,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
122
|
fontFamily: string;
|
|
115
123
|
fontFamilyMono: string;
|
|
116
124
|
cubicBezierEaseInOut: string;
|
|
117
|
-
/**
|
|
118
|
-
* Date Panel
|
|
119
|
-
* Update picker value on:
|
|
120
|
-
* 1. item click
|
|
121
|
-
* 2. clear click
|
|
122
|
-
*/
|
|
123
125
|
cubicBezierEaseOut: string;
|
|
124
126
|
cubicBezierEaseIn: string;
|
|
125
127
|
borderRadiusLarge: string;
|
|
@@ -1230,6 +1232,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1230
1232
|
};
|
|
1231
1233
|
readonly active: BooleanConstructor;
|
|
1232
1234
|
readonly dateFormat: StringConstructor;
|
|
1235
|
+
readonly type: import("vue").PropType<DatePickerType>;
|
|
1233
1236
|
readonly timeFormat: {
|
|
1234
1237
|
readonly type: StringConstructor;
|
|
1235
1238
|
readonly value: "HH:mm:ss";
|
|
@@ -27,11 +27,30 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
const calendar = (0, use_calendar_1.useCalendar)(props, 'date');
|
|
31
|
+
const type = props.type;
|
|
32
|
+
const monthTypes = ['month', 'quarter'];
|
|
33
|
+
const withoutDayTypes = [...monthTypes, 'year'];
|
|
34
|
+
const isWithoutDay = (0, vue_1.computed)(() => withoutDayTypes.includes(type));
|
|
35
|
+
const isMonth = (0, vue_1.computed)(() => monthTypes.includes(type));
|
|
36
|
+
const isYear = (0, vue_1.computed)(() => type === 'year');
|
|
37
|
+
const handleMonthClick = (value, _doUpdate, item) => {
|
|
38
|
+
calendar.onUpdateCalendarValue(value);
|
|
39
|
+
isMonth.value && calendar.handleDateClick(item);
|
|
40
|
+
};
|
|
41
|
+
const handleYearClick = (value, _doUpdate, item) => {
|
|
42
|
+
calendar.onUpdateCalendarValue(value);
|
|
43
|
+
isYear.value && calendar.handleDateClick(item);
|
|
44
|
+
};
|
|
45
|
+
return Object.assign(Object.assign({}, calendar), { isWithoutDay,
|
|
46
|
+
isMonth,
|
|
47
|
+
isYear,
|
|
48
|
+
handleMonthClick,
|
|
49
|
+
handleYearClick });
|
|
31
50
|
},
|
|
32
51
|
render() {
|
|
33
52
|
var _a, _b, _c;
|
|
34
|
-
const { mergedClsPrefix, shortcuts, onRender } = this;
|
|
53
|
+
const { mergedClsPrefix, shortcuts, onRender, isWithoutDay, isYear, isMonth, handleMonthClick, handleYearClick } = this;
|
|
35
54
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
36
55
|
return ((0, vue_1.h)("div", { ref: "selfRef", tabindex: 0, class: [
|
|
37
56
|
`${mergedClsPrefix}-date-panel`,
|
|
@@ -40,21 +59,22 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
40
59
|
this.themeClass
|
|
41
60
|
], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
|
|
42
61
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-calendar` },
|
|
43
|
-
(0, vue_1.h)(panelHeader_1.default, { value: this.calendarValue, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear,
|
|
44
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
(0, vue_1.h)(panelHeader_1.default, { value: this.calendarValue, isMonth: isMonth, isYear: isYear, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear, onUpdateMonth: handleMonthClick, onUpdateYear: handleYearClick }),
|
|
63
|
+
isWithoutDay ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-placeholder` })) : ((0, vue_1.h)(vue_1.Fragment, null,
|
|
64
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-weekdays` }, this.weekdays.map((weekday) => ((0, vue_1.h)("div", { key: weekday, class: `${mergedClsPrefix}-date-panel-weekdays__day` }, weekday)))),
|
|
65
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-dates` }, this.dateArray.map((dateItem, i) => ((0, vue_1.h)("div", { "data-u-date": true, key: i, class: [
|
|
66
|
+
`${mergedClsPrefix}-date-panel-date`,
|
|
67
|
+
{
|
|
68
|
+
[`${mergedClsPrefix}-date-panel-date--current`]: dateItem.isCurrentDate,
|
|
69
|
+
[`${mergedClsPrefix}-date-panel-date--selected`]: dateItem.selected,
|
|
70
|
+
[`${mergedClsPrefix}-date-panel-date--excluded`]: !dateItem.inCurrentMonth,
|
|
71
|
+
[`${mergedClsPrefix}-date-panel-date--disabled`]: this.mergedIsDateDisabled(dateItem.ts)
|
|
72
|
+
}
|
|
73
|
+
], onClick: () => {
|
|
74
|
+
this.handleDateClick(dateItem);
|
|
75
|
+
} },
|
|
76
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-date__trigger` }),
|
|
77
|
+
dateItem.dateObject.date))))))),
|
|
58
78
|
this.datePickerSlots.footer ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-footer` }, this.datePickerSlots.footer())) : null,
|
|
59
79
|
((_a = this.actions) === null || _a === void 0 ? void 0 : _a.length) || shortcuts ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-actions` },
|
|
60
80
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-actions__prefix` }, shortcuts &&
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DatePickerType } from '../config';
|
|
2
|
+
import { DateCommonItem, DateItem, MonthItem } from '../utils';
|
|
1
3
|
declare const _default: import("vue").DefineComponent<{
|
|
2
4
|
readonly defaultCalendarStartTime: NumberConstructor;
|
|
3
5
|
readonly defaultCalendarEndTime: NumberConstructor;
|
|
@@ -8,6 +10,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
10
|
};
|
|
9
11
|
readonly active: BooleanConstructor;
|
|
10
12
|
readonly dateFormat: StringConstructor;
|
|
13
|
+
readonly type: import("vue").PropType<DatePickerType>;
|
|
11
14
|
readonly timeFormat: {
|
|
12
15
|
readonly type: StringConstructor;
|
|
13
16
|
readonly value: "HH:mm:ss";
|
|
@@ -30,6 +33,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
33
|
readonly onRender: import("vue").PropType<(() => void) | undefined>;
|
|
31
34
|
readonly panel: BooleanConstructor;
|
|
32
35
|
}, {
|
|
36
|
+
isMonthRange: import("vue").ComputedRef<boolean>;
|
|
37
|
+
isYearRange: import("vue").ComputedRef<boolean>;
|
|
38
|
+
isWithoutDay: import("vue").ComputedRef<boolean>;
|
|
39
|
+
handleMonthStartClick: (value: number, _doUpdate: boolean, item?: DateCommonItem) => void;
|
|
40
|
+
handleMonthEndClick: (value: number, _doUpdate: boolean, item?: DateCommonItem) => void;
|
|
41
|
+
handleYearStartClick: (value: number, _doUpdate: boolean, item?: DateCommonItem) => void;
|
|
42
|
+
handleYearEndClick: (value: number, _doUpdate: boolean, item?: DateCommonItem) => void;
|
|
33
43
|
startDateDisplayString: import("vue").Ref<string>;
|
|
34
44
|
endDateInput: import("vue").Ref<string>;
|
|
35
45
|
timePickerSize: import("vue").Ref<import("../../..").InputSize>;
|
|
@@ -1220,9 +1230,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1220
1230
|
handleOpenQuickSelectMonthPanel: () => void;
|
|
1221
1231
|
startDatesElRef: import("vue").Ref<HTMLElement | null>;
|
|
1222
1232
|
endDatesElRef: import("vue").Ref<HTMLElement | null>;
|
|
1223
|
-
handleDateClick: (dateItem:
|
|
1224
|
-
handleColItemClick: (dateItem:
|
|
1225
|
-
handleDateMouseEnter: (dateItem:
|
|
1233
|
+
handleDateClick: (dateItem: DateItem) => void;
|
|
1234
|
+
handleColItemClick: (dateItem: MonthItem | import("../utils").YearItem | import("../utils").QuarterItem, clickType: "start" | "end") => void;
|
|
1235
|
+
handleDateMouseEnter: (dateItem: DateItem) => void;
|
|
1226
1236
|
handleConfirmClick: () => void;
|
|
1227
1237
|
startCalendarPrevYear: () => void;
|
|
1228
1238
|
startCalendarPrevMonth: () => void;
|
|
@@ -1240,13 +1250,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1240
1250
|
endCalendarMonth: import("vue").ComputedRef<string>;
|
|
1241
1251
|
endCalendarYear: import("vue").ComputedRef<string>;
|
|
1242
1252
|
weekdays: import("vue").ComputedRef<string[]>;
|
|
1243
|
-
startDateArray: import("vue").ComputedRef<
|
|
1244
|
-
endDateArray: import("vue").ComputedRef<
|
|
1253
|
+
startDateArray: import("vue").ComputedRef<DateItem[]>;
|
|
1254
|
+
endDateArray: import("vue").ComputedRef<DateItem[]>;
|
|
1245
1255
|
startYearArray: import("vue").ComputedRef<import("../utils").YearItem[]>;
|
|
1246
|
-
startMonthArray: import("vue").ComputedRef<
|
|
1256
|
+
startMonthArray: import("vue").ComputedRef<MonthItem[]>;
|
|
1247
1257
|
startQuarterArray: import("vue").ComputedRef<import("../utils").QuarterItem[]>;
|
|
1248
1258
|
endYearArray: import("vue").ComputedRef<import("../utils").YearItem[]>;
|
|
1249
|
-
endMonthArray: import("vue").ComputedRef<
|
|
1259
|
+
endMonthArray: import("vue").ComputedRef<MonthItem[]>;
|
|
1250
1260
|
endQuarterArray: import("vue").ComputedRef<import("../utils").QuarterItem[]>;
|
|
1251
1261
|
isSelecting: import("vue").Ref<boolean>;
|
|
1252
1262
|
handleRangeShortcutMouseenter: (shortcut: number | [number, number] | (() => number) | readonly [number, number] | (() => [number, number] | readonly [number, number])) => void;
|
|
@@ -1261,6 +1271,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1261
1271
|
};
|
|
1262
1272
|
readonly active: BooleanConstructor;
|
|
1263
1273
|
readonly dateFormat: StringConstructor;
|
|
1274
|
+
readonly type: import("vue").PropType<DatePickerType>;
|
|
1264
1275
|
readonly timeFormat: {
|
|
1265
1276
|
readonly type: StringConstructor;
|
|
1266
1277
|
readonly value: "HH:mm:ss";
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -21,11 +32,49 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
21
32
|
}
|
|
22
33
|
});
|
|
23
34
|
}
|
|
24
|
-
|
|
35
|
+
const calendar = (0, use_dual_calendar_1.useDualCalendar)(props, 'daterange');
|
|
36
|
+
const type = props.type;
|
|
37
|
+
const monthRanges = ['monthrange', 'quarterrange'];
|
|
38
|
+
const withoutDayTypes = [...monthRanges, 'yearrange'];
|
|
39
|
+
const isWithoutDay = (0, vue_1.computed)(() => withoutDayTypes.includes(type));
|
|
40
|
+
const isMonthRange = (0, vue_1.computed)(() => monthRanges.includes(type));
|
|
41
|
+
const isYearRange = (0, vue_1.computed)(() => type === 'yearrange');
|
|
42
|
+
const monthToDateItem = (value, item, isEnd = false) => {
|
|
43
|
+
const _a = item, { dateObject } = _a, monthItem = __rest(_a, ["dateObject"]);
|
|
44
|
+
return Object.assign(Object.assign({}, monthItem), { dateObject: Object.assign(Object.assign({}, dateObject), { date: 1 }), inCurrentMonth: false, isCurrentDate: false, inSpan: false, startOfSpan: false, endOfSpan: isEnd, selected: isEnd, ts: value, type: 'date' });
|
|
45
|
+
};
|
|
46
|
+
const setMonthRange = (value, item, isEnd = false) => {
|
|
47
|
+
const monthItem = monthToDateItem(value, item, isEnd);
|
|
48
|
+
calendar.handleDateMouseEnter(monthItem);
|
|
49
|
+
calendar.handleDateClick(monthItem);
|
|
50
|
+
};
|
|
51
|
+
const handleMonthStartClick = (value, _doUpdate, item) => {
|
|
52
|
+
calendar.onUpdateStartCalendarValue(value);
|
|
53
|
+
isMonthRange.value && setMonthRange(value, item);
|
|
54
|
+
};
|
|
55
|
+
const handleMonthEndClick = (value, _doUpdate, item) => {
|
|
56
|
+
calendar.onUpdateEndCalendarValue(value);
|
|
57
|
+
isMonthRange.value && setMonthRange(value, item, true);
|
|
58
|
+
};
|
|
59
|
+
const handleYearStartClick = (value, _doUpdate, item) => {
|
|
60
|
+
calendar.onUpdateStartCalendarValue(value);
|
|
61
|
+
isYearRange.value && setMonthRange(value, item);
|
|
62
|
+
};
|
|
63
|
+
const handleYearEndClick = (value, _doUpdate, item) => {
|
|
64
|
+
calendar.onUpdateEndCalendarValue(value);
|
|
65
|
+
isYearRange.value && setMonthRange(value, item, true);
|
|
66
|
+
};
|
|
67
|
+
return Object.assign(Object.assign({}, calendar), { isMonthRange,
|
|
68
|
+
isYearRange,
|
|
69
|
+
isWithoutDay,
|
|
70
|
+
handleMonthStartClick,
|
|
71
|
+
handleMonthEndClick,
|
|
72
|
+
handleYearStartClick,
|
|
73
|
+
handleYearEndClick });
|
|
25
74
|
},
|
|
26
75
|
render() {
|
|
27
76
|
var _a, _b, _c;
|
|
28
|
-
const { mergedClsPrefix, shortcuts, onRender } = this;
|
|
77
|
+
const { mergedClsPrefix, shortcuts, onRender, isMonthRange, isYearRange, isWithoutDay, handleMonthStartClick, handleMonthEndClick, handleYearStartClick, handleYearEndClick } = this;
|
|
29
78
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
30
79
|
return ((0, vue_1.h)("div", { ref: "selfRef", tabindex: 0, class: [
|
|
31
80
|
`${mergedClsPrefix}-date-panel`,
|
|
@@ -34,47 +83,49 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
34
83
|
this.themeClass
|
|
35
84
|
], onKeydown: this.handlePanelKeyDown, onFocus: this.handlePanelFocus },
|
|
36
85
|
(0, vue_1.h)("div", { ref: "startDatesElRef", class: `${mergedClsPrefix}-date-panel-calendar ${mergedClsPrefix}-date-panel-calendar--start` },
|
|
37
|
-
(0, vue_1.h)(panelHeader_1.default, { value: this.startCalendarDateTime, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.startCalendarMonth, calendarYear: this.startCalendarYear,
|
|
38
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
86
|
+
(0, vue_1.h)(panelHeader_1.default, { value: this.startCalendarDateTime, mergedClsPrefix: mergedClsPrefix, isMonth: isMonthRange, isYear: isYearRange, calendarMonth: this.startCalendarMonth, calendarYear: this.startCalendarYear, onUpdateMonth: handleMonthStartClick, onUpdateYear: handleYearStartClick }),
|
|
87
|
+
isWithoutDay ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-placeholder` })) : ((0, vue_1.h)(vue_1.Fragment, null,
|
|
88
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-weekdays` }, this.weekdays.map((weekday) => ((0, vue_1.h)("div", { key: weekday, class: `${mergedClsPrefix}-date-panel-weekdays__day` }, weekday)))),
|
|
89
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-dates` }, this.startDateArray.map((dateItem, i) => ((0, vue_1.h)("div", { "data-u-date": true, key: i, class: [
|
|
90
|
+
`${mergedClsPrefix}-date-panel-date`,
|
|
91
|
+
{
|
|
92
|
+
[`${mergedClsPrefix}-date-panel-date--excluded`]: !dateItem.inCurrentMonth,
|
|
93
|
+
[`${mergedClsPrefix}-date-panel-date--current`]: dateItem.isCurrentDate,
|
|
94
|
+
[`${mergedClsPrefix}-date-panel-date--selected`]: dateItem.selected,
|
|
95
|
+
[`${mergedClsPrefix}-date-panel-date--covered`]: dateItem.inSpan,
|
|
96
|
+
[`${mergedClsPrefix}-date-panel-date--start`]: dateItem.startOfSpan,
|
|
97
|
+
[`${mergedClsPrefix}-date-panel-date--end`]: dateItem.endOfSpan,
|
|
98
|
+
[`${mergedClsPrefix}-date-panel-date--disabled`]: this.mergedIsDateDisabled(dateItem.ts)
|
|
99
|
+
}
|
|
100
|
+
], onClick: () => {
|
|
101
|
+
this.handleDateClick(dateItem);
|
|
102
|
+
}, onMouseenter: () => {
|
|
103
|
+
this.handleDateMouseEnter(dateItem);
|
|
104
|
+
} },
|
|
105
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-date__trigger` }),
|
|
106
|
+
dateItem.dateObject.date))))))),
|
|
57
107
|
(0, vue_1.h)("div", { ref: "endDatesElRef", class: `${mergedClsPrefix}-date-panel-calendar ${mergedClsPrefix}-date-panel-calendar--end` },
|
|
58
|
-
(0, vue_1.h)(panelHeader_1.default, { value: this.endCalendarDateTime, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.endCalendarMonth, calendarYear: this.endCalendarYear,
|
|
59
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
108
|
+
(0, vue_1.h)(panelHeader_1.default, { value: this.endCalendarDateTime, mergedClsPrefix: mergedClsPrefix, isMonth: isMonthRange, isYear: isYearRange, calendarMonth: this.endCalendarMonth, calendarYear: this.endCalendarYear, onUpdateMonth: handleMonthEndClick, onUpdateYear: handleYearEndClick }),
|
|
109
|
+
isWithoutDay ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-placeholder` })) : ((0, vue_1.h)(vue_1.Fragment, null,
|
|
110
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-weekdays` }, this.weekdays.map((weekday) => ((0, vue_1.h)("div", { key: weekday, class: `${mergedClsPrefix}-date-panel-weekdays__day` }, weekday)))),
|
|
111
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-dates` }, this.endDateArray.map((dateItem, i) => ((0, vue_1.h)("div", { "data-u-date": true, key: i, class: [
|
|
112
|
+
`${mergedClsPrefix}-date-panel-date`,
|
|
113
|
+
{
|
|
114
|
+
[`${mergedClsPrefix}-date-panel-date--excluded`]: !dateItem.inCurrentMonth,
|
|
115
|
+
[`${mergedClsPrefix}-date-panel-date--current`]: dateItem.isCurrentDate,
|
|
116
|
+
[`${mergedClsPrefix}-date-panel-date--selected`]: dateItem.selected,
|
|
117
|
+
[`${mergedClsPrefix}-date-panel-date--covered`]: dateItem.inSpan,
|
|
118
|
+
[`${mergedClsPrefix}-date-panel-date--start`]: dateItem.startOfSpan,
|
|
119
|
+
[`${mergedClsPrefix}-date-panel-date--end`]: dateItem.endOfSpan,
|
|
120
|
+
[`${mergedClsPrefix}-date-panel-date--disabled`]: this.mergedIsDateDisabled(dateItem.ts)
|
|
121
|
+
}
|
|
122
|
+
], onClick: () => {
|
|
123
|
+
this.handleDateClick(dateItem);
|
|
124
|
+
}, onMouseenter: () => {
|
|
125
|
+
this.handleDateMouseEnter(dateItem);
|
|
126
|
+
} },
|
|
127
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-date__trigger` }),
|
|
128
|
+
dateItem.dateObject.date))))))),
|
|
78
129
|
this.datePickerSlots.footer ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-footer` }, this.datePickerSlots.footer())) : null,
|
|
79
130
|
((_a = this.actions) === null || _a === void 0 ? void 0 : _a.length) || shortcuts ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-actions` },
|
|
80
131
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-actions__prefix` }, shortcuts &&
|
|
@@ -11,6 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
};
|
|
12
12
|
readonly active: BooleanConstructor;
|
|
13
13
|
readonly dateFormat: StringConstructor;
|
|
14
|
+
readonly type: import("vue").PropType<import("../config").DatePickerType>;
|
|
14
15
|
readonly timeFormat: {
|
|
15
16
|
readonly type: StringConstructor;
|
|
16
17
|
readonly value: "HH:mm:ss";
|
|
@@ -33,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
34
|
readonly onRender: import("vue").PropType<(() => void) | undefined>;
|
|
34
35
|
readonly panel: BooleanConstructor;
|
|
35
36
|
}, {
|
|
36
|
-
handleDateClick: (dateItem: import("../utils").
|
|
37
|
+
handleDateClick: (dateItem: import("../utils").DateCommonItem) => void;
|
|
37
38
|
handleDateInputBlur: () => void;
|
|
38
39
|
handleDateInput: (value: string) => void;
|
|
39
40
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -1224,6 +1225,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1224
1225
|
};
|
|
1225
1226
|
readonly active: BooleanConstructor;
|
|
1226
1227
|
readonly dateFormat: StringConstructor;
|
|
1228
|
+
readonly type: import("vue").PropType<import("../config").DatePickerType>;
|
|
1227
1229
|
readonly timeFormat: {
|
|
1228
1230
|
readonly type: StringConstructor;
|
|
1229
1231
|
readonly value: "HH:mm:ss";
|
|
@@ -8,6 +8,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
};
|
|
9
9
|
readonly active: BooleanConstructor;
|
|
10
10
|
readonly dateFormat: StringConstructor;
|
|
11
|
+
readonly type: import("vue").PropType<import("../config").DatePickerType>;
|
|
11
12
|
readonly timeFormat: {
|
|
12
13
|
readonly type: StringConstructor;
|
|
13
14
|
readonly value: "HH:mm:ss";
|
|
@@ -1261,6 +1262,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1261
1262
|
};
|
|
1262
1263
|
readonly active: BooleanConstructor;
|
|
1263
1264
|
readonly dateFormat: StringConstructor;
|
|
1265
|
+
readonly type: import("vue").PropType<import("../config").DatePickerType>;
|
|
1264
1266
|
readonly timeFormat: {
|
|
1265
1267
|
readonly type: StringConstructor;
|
|
1266
1268
|
readonly value: "HH:mm:ss";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
+
import { OnPanelUpdateValue, PanelValue } from '../interface';
|
|
3
|
+
import { DateCommonItem } from '../utils';
|
|
2
4
|
declare const _default: import("vue").DefineComponent<{
|
|
3
5
|
mergedClsPrefix: {
|
|
4
6
|
type: StringConstructor;
|
|
@@ -13,15 +15,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
15
|
type: StringConstructor;
|
|
14
16
|
required: true;
|
|
15
17
|
};
|
|
16
|
-
|
|
17
|
-
type:
|
|
18
|
-
|
|
18
|
+
isMonth: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
value: boolean;
|
|
21
|
+
};
|
|
22
|
+
isYear: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
value: boolean;
|
|
19
25
|
};
|
|
26
|
+
onUpdateValue: PropType<OnPanelUpdateValue>;
|
|
27
|
+
onUpdateMonth: PropType<OnPanelUpdateValue>;
|
|
28
|
+
onUpdateYear: PropType<OnPanelUpdateValue>;
|
|
20
29
|
}, {
|
|
21
30
|
monthPanelIsActive: import("vue").Ref<boolean>;
|
|
22
31
|
yearPanelIsActive: import("vue").Ref<boolean>;
|
|
23
32
|
onUpdateMonthPanelIsActive: (value: boolean) => void;
|
|
24
33
|
onUpdateYearPanelIsActive: (value: boolean) => void;
|
|
34
|
+
handleUpdateMonth: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
|
|
35
|
+
handleUpdateYear: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
|
|
25
36
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
37
|
mergedClsPrefix: {
|
|
27
38
|
type: StringConstructor;
|
|
@@ -36,9 +47,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
47
|
type: StringConstructor;
|
|
37
48
|
required: true;
|
|
38
49
|
};
|
|
39
|
-
|
|
40
|
-
type:
|
|
41
|
-
|
|
50
|
+
isMonth: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
value: boolean;
|
|
53
|
+
};
|
|
54
|
+
isYear: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
value: boolean;
|
|
42
57
|
};
|
|
43
|
-
|
|
58
|
+
onUpdateValue: PropType<OnPanelUpdateValue>;
|
|
59
|
+
onUpdateMonth: PropType<OnPanelUpdateValue>;
|
|
60
|
+
onUpdateYear: PropType<OnPanelUpdateValue>;
|
|
61
|
+
}>>, {
|
|
62
|
+
isMonth: boolean;
|
|
63
|
+
isYear: boolean;
|
|
64
|
+
}, {}>;
|
|
44
65
|
export default _default;
|