@uzum-tech/ui 1.1.5 → 1.2.1
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 +310 -353
- 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 +23 -8
- package/es/date-picker/src/panel/date.js +43 -18
- package/es/date-picker/src/panel/daterange.d.ts +18 -7
- package/es/date-picker/src/panel/daterange.js +95 -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 +3 -1
- package/es/date-picker/src/utils.js +13 -1
- 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 +23 -8
- package/lib/date-picker/src/panel/date.js +42 -17
- package/lib/date-picker/src/panel/daterange.d.ts +18 -7
- package/lib/date-picker/src/panel/daterange.js +94 -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 +3 -1
- package/lib/date-picker/src/utils.js +14 -1
- 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
|
@@ -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;
|
|
@@ -16,14 +16,21 @@ export default defineComponent({
|
|
|
16
16
|
type: String,
|
|
17
17
|
required: true
|
|
18
18
|
},
|
|
19
|
-
|
|
20
|
-
type:
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
isMonth: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
value: false
|
|
22
|
+
},
|
|
23
|
+
isYear: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
value: false
|
|
26
|
+
},
|
|
27
|
+
onUpdateValue: Function,
|
|
28
|
+
onUpdateMonth: Function,
|
|
29
|
+
onUpdateYear: Function
|
|
23
30
|
},
|
|
24
|
-
setup() {
|
|
25
|
-
const monthPanelIsActive = ref(
|
|
26
|
-
const yearPanelIsActive = ref(
|
|
31
|
+
setup(props) {
|
|
32
|
+
const monthPanelIsActive = ref(props.isMonth);
|
|
33
|
+
const yearPanelIsActive = ref(props.isYear);
|
|
27
34
|
function onUpdateMonthPanelIsActive(value) {
|
|
28
35
|
monthPanelIsActive.value = value;
|
|
29
36
|
if (value)
|
|
@@ -31,20 +38,37 @@ export default defineComponent({
|
|
|
31
38
|
}
|
|
32
39
|
function onUpdateYearPanelIsActive(value) {
|
|
33
40
|
yearPanelIsActive.value = value;
|
|
34
|
-
if (value)
|
|
41
|
+
if (value && !props.isMonth)
|
|
35
42
|
monthPanelIsActive.value = false;
|
|
36
43
|
}
|
|
44
|
+
function handleUpdateMonth(value, doUpdate, item) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
(_a = props.onUpdateMonth) === null || _a === void 0 ? void 0 : _a.call(props, value, doUpdate, item);
|
|
47
|
+
(_b = props.onUpdateValue) === null || _b === void 0 ? void 0 : _b.call(props, value, doUpdate, item);
|
|
48
|
+
}
|
|
49
|
+
function handleUpdateYear(value, doUpdate, item) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
(_a = props.onUpdateYear) === null || _a === void 0 ? void 0 : _a.call(props, value, doUpdate, item);
|
|
52
|
+
(_b = props.onUpdateValue) === null || _b === void 0 ? void 0 : _b.call(props, value, doUpdate, item);
|
|
53
|
+
}
|
|
37
54
|
return {
|
|
38
55
|
monthPanelIsActive,
|
|
39
56
|
yearPanelIsActive,
|
|
40
57
|
onUpdateMonthPanelIsActive,
|
|
41
|
-
onUpdateYearPanelIsActive
|
|
58
|
+
onUpdateYearPanelIsActive,
|
|
59
|
+
handleUpdateMonth,
|
|
60
|
+
handleUpdateYear
|
|
42
61
|
};
|
|
43
62
|
},
|
|
44
63
|
render() {
|
|
45
|
-
const { mergedClsPrefix } = this;
|
|
46
|
-
return (h("div", { class:
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
const { mergedClsPrefix, isYear } = this;
|
|
65
|
+
return (h("div", { class: [
|
|
66
|
+
`${mergedClsPrefix}-date-panel-month`,
|
|
67
|
+
{
|
|
68
|
+
[`${mergedClsPrefix}-date-panel-month--justify-end`]: isYear
|
|
69
|
+
}
|
|
70
|
+
] },
|
|
71
|
+
isYear ? null : (h(PanelMonth, { panelActive: this.monthPanelIsActive, value: this.value, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear, disabled: this.isMonth, onUpdatePanelActive: this.onUpdateMonthPanelIsActive, onUpdateValue: this.handleUpdateMonth })),
|
|
72
|
+
h(PanelYear, { panelActive: this.yearPanelIsActive, value: this.value, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear, disabled: this.isYear, onUpdatePanelActive: this.onUpdateYearPanelIsActive, onUpdateValue: this.handleUpdateYear })));
|
|
49
73
|
}
|
|
50
74
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
|
+
import { OnPanelUpdateValue, PanelValue } from '../interface';
|
|
3
|
+
import { DateCommonItem } from '../utils';
|
|
2
4
|
declare const _default: import("vue").DefineComponent<{
|
|
3
5
|
panelActive: BooleanConstructor;
|
|
4
6
|
mergedClsPrefix: {
|
|
@@ -14,8 +16,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
16
|
type: StringConstructor;
|
|
15
17
|
required: true;
|
|
16
18
|
};
|
|
19
|
+
disabled: BooleanConstructor;
|
|
17
20
|
onUpdateValue: {
|
|
18
|
-
type: PropType<
|
|
21
|
+
type: PropType<OnPanelUpdateValue>;
|
|
19
22
|
required: true;
|
|
20
23
|
};
|
|
21
24
|
onUpdatePanelActive: PropType<(value: boolean) => void>;
|
|
@@ -30,6 +33,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
33
|
actions?: string[] | undefined;
|
|
31
34
|
panel?: boolean | undefined;
|
|
32
35
|
useAsQuickJump?: boolean | undefined;
|
|
36
|
+
readonly type?: import("../config").DatePickerType | undefined;
|
|
33
37
|
key?: string | number | symbol | undefined;
|
|
34
38
|
style?: unknown;
|
|
35
39
|
class?: unknown;
|
|
@@ -80,7 +84,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
80
84
|
readonly onTabOut?: Function | undefined;
|
|
81
85
|
readonly onClose?: import("../interface").OnClose | undefined;
|
|
82
86
|
readonly onClear?: Function | undefined;
|
|
83
|
-
readonly onUpdateValue:
|
|
87
|
+
readonly onUpdateValue: OnPanelUpdateValue;
|
|
84
88
|
readonly onConfirm?: ((value: import("../interface").Value | null) => void) | undefined;
|
|
85
89
|
readonly timeFormat?: string | undefined;
|
|
86
90
|
readonly shortcuts?: import("../interface").Shortcuts | undefined;
|
|
@@ -107,6 +111,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
107
111
|
};
|
|
108
112
|
active: BooleanConstructor;
|
|
109
113
|
dateFormat: StringConstructor;
|
|
114
|
+
type: PropType<import("../config").DatePickerType>;
|
|
110
115
|
timeFormat: {
|
|
111
116
|
readonly type: StringConstructor;
|
|
112
117
|
readonly value: "HH:mm:ss";
|
|
@@ -122,7 +127,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
122
127
|
onClose: PropType<import("../interface").OnClose>;
|
|
123
128
|
onTabOut: FunctionConstructor;
|
|
124
129
|
onUpdateValue: {
|
|
125
|
-
readonly type: PropType<
|
|
130
|
+
readonly type: PropType<OnPanelUpdateValue>;
|
|
126
131
|
readonly required: true;
|
|
127
132
|
};
|
|
128
133
|
themeClass: StringConstructor;
|
|
@@ -132,7 +137,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
132
137
|
renderItem: (item: import("../utils").MonthItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
133
138
|
[key: string]: any;
|
|
134
139
|
}>;
|
|
135
|
-
handleDateClick: (dateItem:
|
|
140
|
+
handleDateClick: (dateItem: DateCommonItem) => void;
|
|
136
141
|
handleDateInputBlur: () => void;
|
|
137
142
|
handleDateInput: (value: string) => void;
|
|
138
143
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -1350,6 +1355,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1350
1355
|
};
|
|
1351
1356
|
active: BooleanConstructor;
|
|
1352
1357
|
dateFormat: StringConstructor;
|
|
1358
|
+
type: PropType<import("../config").DatePickerType>;
|
|
1353
1359
|
timeFormat: {
|
|
1354
1360
|
readonly type: StringConstructor;
|
|
1355
1361
|
readonly value: "HH:mm:ss";
|
|
@@ -1365,7 +1371,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1365
1371
|
onClose: PropType<import("../interface").OnClose>;
|
|
1366
1372
|
onTabOut: FunctionConstructor;
|
|
1367
1373
|
onUpdateValue: {
|
|
1368
|
-
readonly type: PropType<
|
|
1374
|
+
readonly type: PropType<OnPanelUpdateValue>;
|
|
1369
1375
|
readonly required: true;
|
|
1370
1376
|
};
|
|
1371
1377
|
themeClass: StringConstructor;
|
|
@@ -1375,7 +1381,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1375
1381
|
renderItem: (item: import("../utils").MonthItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1376
1382
|
[key: string]: any;
|
|
1377
1383
|
}>;
|
|
1378
|
-
handleDateClick: (dateItem:
|
|
1384
|
+
handleDateClick: (dateItem: DateCommonItem) => void;
|
|
1379
1385
|
handleDateInputBlur: () => void;
|
|
1380
1386
|
handleDateInput: (value: string) => void;
|
|
1381
1387
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -2561,7 +2567,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2561
2567
|
handleSingleShortcutClick: (shortcut: number | [number, number] | (() => number) | readonly [number, number] | (() => [number, number] | readonly [number, number])) => void;
|
|
2562
2568
|
}> & {} & import("vue").ComponentCustomProperties & {}) | null>;
|
|
2563
2569
|
handleHeaderClick: () => void;
|
|
2564
|
-
handleUpdateValue: (value:
|
|
2570
|
+
handleUpdateValue: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
|
|
2565
2571
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2566
2572
|
panelActive: BooleanConstructor;
|
|
2567
2573
|
mergedClsPrefix: {
|
|
@@ -2577,12 +2583,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2577
2583
|
type: StringConstructor;
|
|
2578
2584
|
required: true;
|
|
2579
2585
|
};
|
|
2586
|
+
disabled: BooleanConstructor;
|
|
2580
2587
|
onUpdateValue: {
|
|
2581
|
-
type: PropType<
|
|
2588
|
+
type: PropType<OnPanelUpdateValue>;
|
|
2582
2589
|
required: true;
|
|
2583
2590
|
};
|
|
2584
2591
|
onUpdatePanelActive: PropType<(value: boolean) => void>;
|
|
2585
2592
|
}>>, {
|
|
2593
|
+
disabled: boolean;
|
|
2586
2594
|
panelActive: boolean;
|
|
2587
2595
|
}, {}>;
|
|
2588
2596
|
export default _default;
|
|
@@ -18,6 +18,7 @@ export default defineComponent({
|
|
|
18
18
|
type: String,
|
|
19
19
|
required: true
|
|
20
20
|
},
|
|
21
|
+
disabled: Boolean,
|
|
21
22
|
onUpdateValue: {
|
|
22
23
|
type: Function,
|
|
23
24
|
required: true
|
|
@@ -34,10 +35,12 @@ export default defineComponent({
|
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
function handleHeaderClick() {
|
|
38
|
+
if (props.disabled)
|
|
39
|
+
return;
|
|
37
40
|
showRef.value = !showRef.value;
|
|
38
41
|
}
|
|
39
|
-
function handleUpdateValue(value) {
|
|
40
|
-
props.onUpdateValue(value);
|
|
42
|
+
function handleUpdateValue(value, doUpdate, item) {
|
|
43
|
+
props.onUpdateValue(value, doUpdate, item);
|
|
41
44
|
handleHeaderClick();
|
|
42
45
|
}
|
|
43
46
|
return {
|
|
@@ -48,11 +51,12 @@ export default defineComponent({
|
|
|
48
51
|
};
|
|
49
52
|
},
|
|
50
53
|
render() {
|
|
51
|
-
const { mergedClsPrefix } = this;
|
|
54
|
+
const { mergedClsPrefix, disabled } = this;
|
|
52
55
|
return (h("div", { class: `${mergedClsPrefix}-date-panel-month__month-year` },
|
|
53
56
|
h("div", { class: [
|
|
54
57
|
`${mergedClsPrefix}-date-panel-month__text`,
|
|
55
|
-
this.show && `${mergedClsPrefix}-date-panel-month__text--active
|
|
58
|
+
this.show && `${mergedClsPrefix}-date-panel-month__text--active`,
|
|
59
|
+
disabled && `${mergedClsPrefix}-date-panel-month__text--disabled`
|
|
56
60
|
], onClick: this.handleHeaderClick },
|
|
57
61
|
this.calendarMonth,
|
|
58
62
|
h(UBaseIcon, { class: `${mergedClsPrefix}-date-panel-month__icon`, clsPrefix: mergedClsPrefix }, {
|
|
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
14
|
};
|
|
15
15
|
active: BooleanConstructor;
|
|
16
16
|
dateFormat: StringConstructor;
|
|
17
|
+
type: import("vue").PropType<import("../config").DatePickerType>;
|
|
17
18
|
timeFormat: {
|
|
18
19
|
readonly type: StringConstructor;
|
|
19
20
|
readonly value: "HH:mm:ss";
|
|
@@ -37,7 +38,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
38
|
panel: BooleanConstructor;
|
|
38
39
|
}, {
|
|
39
40
|
renderItem: (item: MonthItem, i: number, mergedClsPrefix: string) => VNode;
|
|
40
|
-
handleDateClick: (dateItem: import("../utils").
|
|
41
|
+
handleDateClick: (dateItem: import("../utils").DateCommonItem) => void;
|
|
41
42
|
handleDateInputBlur: () => void;
|
|
42
43
|
handleDateInput: (value: string) => void;
|
|
43
44
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -1235,6 +1236,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1235
1236
|
};
|
|
1236
1237
|
active: BooleanConstructor;
|
|
1237
1238
|
dateFormat: StringConstructor;
|
|
1239
|
+
type: import("vue").PropType<import("../config").DatePickerType>;
|
|
1238
1240
|
timeFormat: {
|
|
1239
1241
|
readonly type: StringConstructor;
|
|
1240
1242
|
readonly value: "HH:mm:ss";
|
|
@@ -30,7 +30,7 @@ export default defineComponent({
|
|
|
30
30
|
useAsQuickJump
|
|
31
31
|
? handleQuickMonthClick(item, (value) => {
|
|
32
32
|
;
|
|
33
|
-
props.onUpdateValue(value, false);
|
|
33
|
+
props.onUpdateValue(value, false, item);
|
|
34
34
|
})
|
|
35
35
|
: handleDateClick(item);
|
|
36
36
|
} }, getRenderContent(item)));
|
|
@@ -49,10 +49,7 @@ export default defineComponent({
|
|
|
49
49
|
this.themeClass
|
|
50
50
|
], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
|
|
51
51
|
h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar` }, {
|
|
52
|
-
default: () =>
|
|
53
|
-
this.monthArray.map((item, i) => renderItem(item, i, mergedClsPrefix)),
|
|
54
|
-
h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__padding` })
|
|
55
|
-
]
|
|
52
|
+
default: () => this.monthArray.map((item, i) => renderItem(item, i, mergedClsPrefix))
|
|
56
53
|
}),
|
|
57
54
|
h(UBaseFocusDetector, { onFocus: this.handleFocusDetectorFocus })));
|
|
58
55
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
|
+
import { OnPanelUpdateValue, PanelValue } from '../interface';
|
|
3
|
+
import { DateCommonItem } from '../utils';
|
|
2
4
|
declare const _default: import("vue").DefineComponent<{
|
|
3
5
|
panelActive: BooleanConstructor;
|
|
4
6
|
mergedClsPrefix: {
|
|
@@ -14,8 +16,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
16
|
type: StringConstructor;
|
|
15
17
|
required: true;
|
|
16
18
|
};
|
|
19
|
+
disabled: BooleanConstructor;
|
|
17
20
|
onUpdateValue: {
|
|
18
|
-
type: PropType<
|
|
21
|
+
type: PropType<OnPanelUpdateValue>;
|
|
19
22
|
required: true;
|
|
20
23
|
};
|
|
21
24
|
onUpdatePanelActive: PropType<(value: boolean) => void>;
|
|
@@ -30,6 +33,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
33
|
actions?: string[] | undefined;
|
|
31
34
|
panel?: boolean | undefined;
|
|
32
35
|
useAsQuickJump?: boolean | undefined;
|
|
36
|
+
readonly type?: import("../config").DatePickerType | undefined;
|
|
33
37
|
key?: string | number | symbol | undefined;
|
|
34
38
|
style?: unknown;
|
|
35
39
|
class?: unknown;
|
|
@@ -80,7 +84,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
80
84
|
readonly onTabOut?: Function | undefined;
|
|
81
85
|
readonly onClose?: import("../interface").OnClose | undefined;
|
|
82
86
|
readonly onClear?: Function | undefined;
|
|
83
|
-
readonly onUpdateValue:
|
|
87
|
+
readonly onUpdateValue: OnPanelUpdateValue;
|
|
84
88
|
readonly onConfirm?: ((value: import("../interface").Value | null) => void) | undefined;
|
|
85
89
|
readonly timeFormat?: string | undefined;
|
|
86
90
|
readonly shortcuts?: import("../interface").Shortcuts | undefined;
|
|
@@ -107,6 +111,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
107
111
|
};
|
|
108
112
|
active: BooleanConstructor;
|
|
109
113
|
dateFormat: StringConstructor;
|
|
114
|
+
type: PropType<import("../config").DatePickerType>;
|
|
110
115
|
timeFormat: {
|
|
111
116
|
readonly type: StringConstructor;
|
|
112
117
|
readonly value: "HH:mm:ss";
|
|
@@ -122,7 +127,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
122
127
|
onClose: PropType<import("../interface").OnClose>;
|
|
123
128
|
onTabOut: FunctionConstructor;
|
|
124
129
|
onUpdateValue: {
|
|
125
|
-
readonly type: PropType<
|
|
130
|
+
readonly type: PropType<OnPanelUpdateValue>;
|
|
126
131
|
readonly required: true;
|
|
127
132
|
};
|
|
128
133
|
themeClass: StringConstructor;
|
|
@@ -132,7 +137,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
132
137
|
renderItem: (item: import("../utils").YearItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
133
138
|
[key: string]: any;
|
|
134
139
|
}>;
|
|
135
|
-
handleDateClick: (dateItem:
|
|
140
|
+
handleDateClick: (dateItem: DateCommonItem) => void;
|
|
136
141
|
handleDateInputBlur: () => void;
|
|
137
142
|
handleDateInput: (value: string) => void;
|
|
138
143
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -1350,6 +1355,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1350
1355
|
};
|
|
1351
1356
|
active: BooleanConstructor;
|
|
1352
1357
|
dateFormat: StringConstructor;
|
|
1358
|
+
type: PropType<import("../config").DatePickerType>;
|
|
1353
1359
|
timeFormat: {
|
|
1354
1360
|
readonly type: StringConstructor;
|
|
1355
1361
|
readonly value: "HH:mm:ss";
|
|
@@ -1365,7 +1371,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1365
1371
|
onClose: PropType<import("../interface").OnClose>;
|
|
1366
1372
|
onTabOut: FunctionConstructor;
|
|
1367
1373
|
onUpdateValue: {
|
|
1368
|
-
readonly type: PropType<
|
|
1374
|
+
readonly type: PropType<OnPanelUpdateValue>;
|
|
1369
1375
|
readonly required: true;
|
|
1370
1376
|
};
|
|
1371
1377
|
themeClass: StringConstructor;
|
|
@@ -1375,7 +1381,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1375
1381
|
renderItem: (item: import("../utils").YearItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1376
1382
|
[key: string]: any;
|
|
1377
1383
|
}>;
|
|
1378
|
-
handleDateClick: (dateItem:
|
|
1384
|
+
handleDateClick: (dateItem: DateCommonItem) => void;
|
|
1379
1385
|
handleDateInputBlur: () => void;
|
|
1380
1386
|
handleDateInput: (value: string) => void;
|
|
1381
1387
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -2561,7 +2567,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2561
2567
|
handleSingleShortcutClick: (shortcut: number | [number, number] | (() => number) | readonly [number, number] | (() => [number, number] | readonly [number, number])) => void;
|
|
2562
2568
|
}> & {} & import("vue").ComponentCustomProperties & {}) | null>;
|
|
2563
2569
|
handleHeaderClick: () => void;
|
|
2564
|
-
handleUpdateValue: (value:
|
|
2570
|
+
handleUpdateValue: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
|
|
2565
2571
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2566
2572
|
panelActive: BooleanConstructor;
|
|
2567
2573
|
mergedClsPrefix: {
|
|
@@ -2577,12 +2583,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2577
2583
|
type: StringConstructor;
|
|
2578
2584
|
required: true;
|
|
2579
2585
|
};
|
|
2586
|
+
disabled: BooleanConstructor;
|
|
2580
2587
|
onUpdateValue: {
|
|
2581
|
-
type: PropType<
|
|
2588
|
+
type: PropType<OnPanelUpdateValue>;
|
|
2582
2589
|
required: true;
|
|
2583
2590
|
};
|
|
2584
2591
|
onUpdatePanelActive: PropType<(value: boolean) => void>;
|
|
2585
2592
|
}>>, {
|
|
2593
|
+
disabled: boolean;
|
|
2586
2594
|
panelActive: boolean;
|
|
2587
2595
|
}, {}>;
|
|
2588
2596
|
export default _default;
|
|
@@ -18,6 +18,7 @@ export default defineComponent({
|
|
|
18
18
|
type: String,
|
|
19
19
|
required: true
|
|
20
20
|
},
|
|
21
|
+
disabled: Boolean,
|
|
21
22
|
onUpdateValue: {
|
|
22
23
|
type: Function,
|
|
23
24
|
required: true
|
|
@@ -34,10 +35,12 @@ export default defineComponent({
|
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
function handleHeaderClick() {
|
|
38
|
+
if (props.disabled)
|
|
39
|
+
return;
|
|
37
40
|
showRef.value = !showRef.value;
|
|
38
41
|
}
|
|
39
|
-
function handleUpdateValue(value) {
|
|
40
|
-
props.onUpdateValue(value);
|
|
42
|
+
function handleUpdateValue(value, doUpdate, item) {
|
|
43
|
+
props.onUpdateValue(value, doUpdate, item);
|
|
41
44
|
handleHeaderClick();
|
|
42
45
|
}
|
|
43
46
|
return {
|
|
@@ -48,11 +51,12 @@ export default defineComponent({
|
|
|
48
51
|
};
|
|
49
52
|
},
|
|
50
53
|
render() {
|
|
51
|
-
const { mergedClsPrefix } = this;
|
|
54
|
+
const { mergedClsPrefix, disabled } = this;
|
|
52
55
|
return (h("div", { class: `${mergedClsPrefix}-date-panel-month__month-year`, ref: "triggerRef" },
|
|
53
56
|
h("div", { class: [
|
|
54
57
|
`${mergedClsPrefix}-date-panel-month__text`,
|
|
55
|
-
this.show && `${mergedClsPrefix}-date-panel-month__text--active
|
|
58
|
+
this.show && `${mergedClsPrefix}-date-panel-month__text--active`,
|
|
59
|
+
disabled && `${mergedClsPrefix}-date-panel-month__text--disabled`
|
|
56
60
|
], onClick: this.handleHeaderClick },
|
|
57
61
|
this.calendarYear,
|
|
58
62
|
h(UBaseIcon, { class: `${mergedClsPrefix}-date-panel-month__icon`, clsPrefix: mergedClsPrefix }, {
|
|
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
14
|
};
|
|
15
15
|
active: BooleanConstructor;
|
|
16
16
|
dateFormat: StringConstructor;
|
|
17
|
+
type: import("vue").PropType<import("../config").DatePickerType>;
|
|
17
18
|
timeFormat: {
|
|
18
19
|
readonly type: StringConstructor;
|
|
19
20
|
readonly value: "HH:mm:ss";
|
|
@@ -37,7 +38,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
38
|
panel: BooleanConstructor;
|
|
38
39
|
}, {
|
|
39
40
|
renderItem: (item: YearItem, i: number, mergedClsPrefix: string) => VNode;
|
|
40
|
-
handleDateClick: (dateItem: import("../utils").
|
|
41
|
+
handleDateClick: (dateItem: import("../utils").DateCommonItem) => void;
|
|
41
42
|
handleDateInputBlur: () => void;
|
|
42
43
|
handleDateInput: (value: string) => void;
|
|
43
44
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -1247,6 +1248,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1247
1248
|
};
|
|
1248
1249
|
active: BooleanConstructor;
|
|
1249
1250
|
dateFormat: StringConstructor;
|
|
1251
|
+
type: import("vue").PropType<import("../config").DatePickerType>;
|
|
1250
1252
|
timeFormat: {
|
|
1251
1253
|
readonly type: StringConstructor;
|
|
1252
1254
|
readonly value: "HH:mm:ss";
|
|
@@ -27,7 +27,7 @@ export default defineComponent({
|
|
|
27
27
|
useAsQuickJump
|
|
28
28
|
? handleQuickMonthClick(item, (value) => {
|
|
29
29
|
;
|
|
30
|
-
props.onUpdateValue(value, false);
|
|
30
|
+
props.onUpdateValue(value, false, item);
|
|
31
31
|
})
|
|
32
32
|
: handleDateClick(item);
|
|
33
33
|
} }, getRenderContent(item)));
|
|
@@ -43,6 +43,7 @@ export default defineComponent({
|
|
|
43
43
|
return (h("div", { ref: "selfRef", tabindex: 0, class: [
|
|
44
44
|
`${mergedClsPrefix}-date-panel`,
|
|
45
45
|
`${mergedClsPrefix}-date-panel--month`,
|
|
46
|
+
`${mergedClsPrefix}-date-panel--year`,
|
|
46
47
|
this.themeClass
|
|
47
48
|
], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
|
|
48
49
|
h(UScrollbar, { ref: "yearScrollbarRef", theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar, horizontalRailStyle: { zIndex: 1 }, verticalRailStyle: { zIndex: 1 } }, {
|
|
@@ -2,7 +2,7 @@ import { type ExtractPropTypes, type PropType } from 'vue';
|
|
|
2
2
|
import type { VirtualListInst } from 'vueuc';
|
|
3
3
|
import type { ScrollbarInst } from '../../../_internal';
|
|
4
4
|
import type { Shortcuts } from '../interface';
|
|
5
|
-
import type {
|
|
5
|
+
import type { MonthItem, YearItem, QuarterItem, DateCommonItem } from '../utils';
|
|
6
6
|
declare const useCalendarProps: {
|
|
7
7
|
readonly actions: {
|
|
8
8
|
readonly type: PropType<string[]>;
|
|
@@ -10,6 +10,7 @@ declare const useCalendarProps: {
|
|
|
10
10
|
};
|
|
11
11
|
readonly active: BooleanConstructor;
|
|
12
12
|
readonly dateFormat: StringConstructor;
|
|
13
|
+
readonly type: PropType<import("../config").DatePickerType>;
|
|
13
14
|
readonly timeFormat: {
|
|
14
15
|
readonly type: StringConstructor;
|
|
15
16
|
readonly value: "HH:mm:ss";
|
|
@@ -33,7 +34,7 @@ declare const useCalendarProps: {
|
|
|
33
34
|
readonly panel: BooleanConstructor;
|
|
34
35
|
};
|
|
35
36
|
declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year' | 'quarter'): {
|
|
36
|
-
handleDateClick: (dateItem:
|
|
37
|
+
handleDateClick: (dateItem: DateCommonItem) => void;
|
|
37
38
|
handleDateInputBlur: () => void;
|
|
38
39
|
handleDateInput: (value: string) => void;
|
|
39
40
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -1201,7 +1202,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1201
1202
|
isHourDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsHourDisabled | undefined>;
|
|
1202
1203
|
isMinuteDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsMinuteDisabled | undefined>;
|
|
1203
1204
|
isSecondDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsSecondDisabled | undefined>;
|
|
1204
|
-
dateArray: import("vue").ComputedRef<DateItem[]>;
|
|
1205
|
+
dateArray: import("vue").ComputedRef<import("../utils").DateItem[]>;
|
|
1205
1206
|
monthArray: import("vue").ComputedRef<MonthItem[]>;
|
|
1206
1207
|
yearArray: import("vue").ComputedRef<YearItem[]>;
|
|
1207
1208
|
quarterArray: import("vue").ComputedRef<QuarterItem[]>;
|
|
@@ -13,6 +13,7 @@ declare const useDualCalendarProps: {
|
|
|
13
13
|
};
|
|
14
14
|
readonly active: BooleanConstructor;
|
|
15
15
|
readonly dateFormat: StringConstructor;
|
|
16
|
+
readonly type: import("vue").PropType<import("../config").DatePickerType>;
|
|
16
17
|
readonly timeFormat: {
|
|
17
18
|
readonly type: StringConstructor;
|
|
18
19
|
readonly value: "HH:mm:ss";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type PropType, type ExtractPropTypes } from 'vue';
|
|
2
2
|
import { type Value, type OnPanelUpdateValue, type OnClose, type Shortcuts, type DefaultTime } from '../interface';
|
|
3
|
+
import { DatePickerType } from '../config';
|
|
3
4
|
declare const usePanelCommonProps: {
|
|
4
5
|
readonly active: BooleanConstructor;
|
|
5
6
|
readonly dateFormat: StringConstructor;
|
|
7
|
+
readonly type: PropType<DatePickerType>;
|
|
6
8
|
readonly timeFormat: {
|
|
7
9
|
readonly type: StringConstructor;
|
|
8
10
|
readonly value: "HH:mm:ss";
|
|
@@ -168,6 +168,8 @@ export default c([cB('date-picker', `
|
|
|
168
168
|
margin: 0,
|
|
169
169
|
padding: '15px 16px',
|
|
170
170
|
boxSizing: 'border-box'
|
|
171
|
+
}), cM('year', {
|
|
172
|
+
zIndex: '2'
|
|
171
173
|
}), cB('date-panel-footer', {
|
|
172
174
|
gridArea: 'footer'
|
|
173
175
|
}), cB('date-panel-actions', {
|
|
@@ -190,21 +192,20 @@ export default c([cB('date-picker', `
|
|
|
190
192
|
zIndex: 1
|
|
191
193
|
})]), c('~ .u-date-panel-calendar', {
|
|
192
194
|
paddingTop: '16px'
|
|
193
|
-
})]), cB('date-panel-
|
|
195
|
+
})]), cB('date-panel-placeholder', {
|
|
196
|
+
width: '266px',
|
|
197
|
+
height: '250px'
|
|
198
|
+
}), cB('date-panel-month', {
|
|
194
199
|
boxSizing: 'border-box',
|
|
195
200
|
display: 'flex',
|
|
196
201
|
alignItems: 'center',
|
|
197
202
|
justifyContent: 'space-between',
|
|
198
203
|
padding: 'var(--u-calendar-title-padding)',
|
|
199
204
|
height: 'var(--u-calendar-title-height)'
|
|
200
|
-
}, [
|
|
205
|
+
}, [cM('justify-end', {
|
|
206
|
+
justifyContent: 'end'
|
|
207
|
+
}), cE('icon', `
|
|
201
208
|
font-size: var(--u-arrow-size);
|
|
202
|
-
`), cE('prev, next, fast-prev, fast-next', `
|
|
203
|
-
line-height: 0;
|
|
204
|
-
cursor: pointer;
|
|
205
|
-
width: var(--u-arrow-size);
|
|
206
|
-
height: var(--u-arrow-size);
|
|
207
|
-
color: var(--u-arrow-color);
|
|
208
209
|
`), cE('month-year', {
|
|
209
210
|
userSelect: 'none',
|
|
210
211
|
'-webkit-user-select': 'none'
|
|
@@ -217,10 +218,11 @@ export default c([cB('date-picker', `
|
|
|
217
218
|
padding: 6px 8px;
|
|
218
219
|
text-align: center;
|
|
219
220
|
color: var(--u-calendar-title-text-color);
|
|
220
|
-
cursor: pointer;
|
|
221
221
|
transition: .3s var(--u-bezier);
|
|
222
222
|
border-radius: var(--u-panel-border-radius);
|
|
223
|
-
`, [
|
|
223
|
+
`, [cNotM('disabled', {
|
|
224
|
+
cursor: 'pointer'
|
|
225
|
+
}), c('.u-icon', {
|
|
224
226
|
width: '24px',
|
|
225
227
|
transition: 'transform .3s var(--u-bezier)'
|
|
226
228
|
}), cM('active', `
|
|
@@ -45,6 +45,7 @@ export interface QuarterItem {
|
|
|
45
45
|
selected: boolean;
|
|
46
46
|
ts: number;
|
|
47
47
|
}
|
|
48
|
+
export type DateCommonItem = DateItem | MonthItem | YearItem | QuarterItem;
|
|
48
49
|
/**
|
|
49
50
|
* Given time to display calendar, given the selected time, given current time,
|
|
50
51
|
* return the date array of display time's month.
|
|
@@ -62,4 +63,5 @@ declare function getDefaultTime(timeValue: string | undefined): {
|
|
|
62
63
|
seconds: number;
|
|
63
64
|
} | undefined;
|
|
64
65
|
declare function pluckValueFromRange(value: Value | null, type: 'start' | 'end'): number | null;
|
|
65
|
-
|
|
66
|
+
declare function getMsByDateCommonItem(item?: DateCommonItem): number;
|
|
67
|
+
export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime, getMsByDateCommonItem, pluckValueFromRange };
|