@uzum-tech/ui 2.0.0-beta.1 → 2.0.0-beta.3
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/dist/index.js +136 -75
- package/dist/index.mjs +137 -76
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/calendar/src/Calendar.d.ts +3 -0
- package/es/calendar/src/Calendar.mjs +4 -3
- package/es/checkbox/src/Checkbox.mjs +4 -4
- package/es/collapse/src/CollapseItem.mjs +5 -5
- package/es/config-provider/src/ConfigProvider.d.ts +3 -0
- package/es/config-provider/src/ConfigProvider.mjs +26 -12
- package/es/config-provider/src/internal-interface.d.ts +1 -0
- package/es/data-table/src/DataTable.mjs +3 -3
- package/es/date-picker/src/DatePicker.d.ts +3 -0
- package/es/date-picker/src/DatePicker.mjs +2 -0
- package/es/date-picker/src/panel/date.d.ts +2 -0
- package/es/date-picker/src/panel/daterange.d.ts +2 -0
- package/es/date-picker/src/panel/datetime.d.ts +2 -0
- package/es/date-picker/src/panel/datetimerange.d.ts +2 -0
- package/es/date-picker/src/panel/panelMonth.d.ts +4 -0
- package/es/date-picker/src/panel/panelMonthContent.d.ts +2 -0
- package/es/date-picker/src/panel/panelYear.d.ts +4 -0
- package/es/date-picker/src/panel/panelYearContent.d.ts +2 -0
- package/es/date-picker/src/panel/use-calendar.d.ts +1 -0
- package/es/date-picker/src/panel/use-calendar.mjs +10 -5
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
- package/es/date-picker/src/panel/use-dual-calendar.mjs +17 -13
- package/es/date-picker/src/panel/use-panel-common.d.ts +1 -0
- package/es/date-picker/src/panel/use-panel-common.mjs +1 -0
- package/es/date-picker/src/utils.d.ts +4 -4
- package/es/date-picker/src/utils.mjs +4 -4
- package/es/date-picker-v2/src/panel/CalendarPanel.d.ts +0 -1
- package/es/date-picker-v2/src/panel/CalendarPanel.mjs +7 -5
- package/es/date-picker-v2/src/panel/CalendarRangePanel.d.ts +0 -1
- package/es/date-picker-v2/src/panel/CalendarRangePanel.mjs +7 -5
- package/es/date-picker-v2/src/utils.d.ts +1 -1
- package/es/date-picker-v2/src/utils.mjs +1 -1
- package/es/dialog/src/DialogProvider.mjs +4 -3
- package/es/dynamic-input/src/DynamicInput.mjs +9 -7
- package/es/form/src/FormItem.mjs +6 -4
- package/es/grid/src/Grid.mjs +7 -1
- package/es/header/src/HeaderNavigation.d.ts +3 -3292
- package/es/header/src/HeaderNavigation.mjs +3 -2
- package/es/heatmap/src/Heatmap.mjs +4 -3
- package/es/image/src/Image.mjs +3 -4
- package/es/image/src/ImageGroup.d.ts +1 -1
- package/es/image/src/ImageGroup.mjs +5 -6
- package/es/menu/src/Menu.mjs +2 -3
- package/es/message/src/MessageProvider.mjs +4 -3
- package/es/modal/src/ModalProvider.mjs +4 -3
- package/es/notification/src/NotificationProvider.mjs +4 -3
- package/es/time/src/Time.d.ts +3 -0
- package/es/time/src/Time.mjs +3 -1
- package/es/time-picker/src/Panel.mjs +9 -2
- package/es/upload/src/Upload.mjs +10 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/calendar/src/Calendar.d.ts +3 -0
- package/lib/calendar/src/Calendar.js +4 -4
- package/lib/checkbox/src/Checkbox.js +3 -3
- package/lib/collapse/src/CollapseItem.js +3 -3
- package/lib/config-provider/src/ConfigProvider.d.ts +3 -0
- package/lib/config-provider/src/ConfigProvider.js +33 -18
- package/lib/config-provider/src/internal-interface.d.ts +1 -0
- package/lib/data-table/src/DataTable.js +2 -2
- package/lib/date-picker/src/DatePicker.d.ts +3 -0
- package/lib/date-picker/src/DatePicker.js +2 -1
- package/lib/date-picker/src/panel/date.d.ts +2 -0
- package/lib/date-picker/src/panel/daterange.d.ts +2 -0
- package/lib/date-picker/src/panel/datetime.d.ts +2 -0
- package/lib/date-picker/src/panel/datetimerange.d.ts +2 -0
- package/lib/date-picker/src/panel/panelMonth.d.ts +4 -0
- package/lib/date-picker/src/panel/panelMonthContent.d.ts +2 -0
- package/lib/date-picker/src/panel/panelYear.d.ts +4 -0
- package/lib/date-picker/src/panel/panelYearContent.d.ts +2 -0
- package/lib/date-picker/src/panel/use-calendar.d.ts +1 -0
- package/lib/date-picker/src/panel/use-calendar.js +9 -4
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
- package/lib/date-picker/src/panel/use-dual-calendar.js +17 -13
- package/lib/date-picker/src/panel/use-panel-common.d.ts +1 -0
- package/lib/date-picker/src/panel/use-panel-common.js +1 -0
- package/lib/date-picker/src/utils.d.ts +4 -4
- package/lib/date-picker/src/utils.js +4 -4
- package/lib/date-picker-v2/src/panel/CalendarPanel.d.ts +0 -1
- package/lib/date-picker-v2/src/panel/CalendarPanel.js +6 -4
- package/lib/date-picker-v2/src/panel/CalendarRangePanel.d.ts +0 -1
- package/lib/date-picker-v2/src/panel/CalendarRangePanel.js +6 -4
- package/lib/date-picker-v2/src/utils.d.ts +1 -1
- package/lib/date-picker-v2/src/utils.js +1 -1
- package/lib/dialog/src/DialogProvider.js +3 -2
- package/lib/dynamic-input/src/DynamicInput.js +8 -6
- package/lib/form/src/FormItem.js +5 -3
- package/lib/grid/src/Grid.js +8 -1
- package/lib/header/src/HeaderNavigation.d.ts +3 -3292
- package/lib/header/src/HeaderNavigation.js +2 -1
- package/lib/heatmap/src/Heatmap.js +4 -3
- package/lib/image/src/Image.js +2 -3
- package/lib/image/src/ImageGroup.d.ts +1 -1
- package/lib/image/src/ImageGroup.js +4 -5
- package/lib/menu/src/Menu.js +1 -2
- package/lib/message/src/MessageProvider.js +3 -2
- package/lib/modal/src/ModalProvider.js +3 -2
- package/lib/notification/src/NotificationProvider.js +3 -2
- package/lib/time/src/Time.d.ts +3 -0
- package/lib/time/src/Time.js +3 -1
- package/lib/time-picker/src/Panel.js +8 -1
- package/lib/upload/src/Upload.js +9 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +30 -30
- package/web-types.json +32 -4
|
@@ -27,6 +27,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
27
27
|
readonly onClear: FunctionConstructor;
|
|
28
28
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
29
29
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
30
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
30
31
|
readonly onTabOut: FunctionConstructor;
|
|
31
32
|
readonly onUpdateValue: {
|
|
32
33
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -2527,6 +2528,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2527
2528
|
readonly onClear: FunctionConstructor;
|
|
2528
2529
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
2529
2530
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
2531
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
2530
2532
|
readonly onTabOut: FunctionConstructor;
|
|
2531
2533
|
readonly onUpdateValue: {
|
|
2532
2534
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -24,6 +24,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
24
24
|
readonly onClear: FunctionConstructor;
|
|
25
25
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
26
26
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
27
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
27
28
|
readonly onTabOut: FunctionConstructor;
|
|
28
29
|
readonly onUpdateValue: {
|
|
29
30
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -2566,6 +2567,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2566
2567
|
readonly onClear: FunctionConstructor;
|
|
2567
2568
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
2568
2569
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
2570
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
2569
2571
|
readonly onTabOut: FunctionConstructor;
|
|
2570
2572
|
readonly onUpdateValue: {
|
|
2571
2573
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -25,6 +25,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
25
25
|
readonly onClear: FunctionConstructor;
|
|
26
26
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
27
27
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
28
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
28
29
|
readonly onTabOut: FunctionConstructor;
|
|
29
30
|
readonly onUpdateValue: {
|
|
30
31
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -2520,6 +2521,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2520
2521
|
readonly onClear: FunctionConstructor;
|
|
2521
2522
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
2522
2523
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
2524
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
2523
2525
|
readonly onTabOut: FunctionConstructor;
|
|
2524
2526
|
readonly onUpdateValue: {
|
|
2525
2527
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -22,6 +22,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
22
22
|
readonly onClear: FunctionConstructor;
|
|
23
23
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
24
24
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
25
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
25
26
|
readonly onTabOut: FunctionConstructor;
|
|
26
27
|
readonly onUpdateValue: {
|
|
27
28
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -2557,6 +2558,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2557
2558
|
readonly onClear: FunctionConstructor;
|
|
2558
2559
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
2559
2560
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
2561
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
2560
2562
|
readonly onTabOut: FunctionConstructor;
|
|
2561
2563
|
readonly onUpdateValue: {
|
|
2562
2564
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -46,6 +46,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
46
46
|
onClear: FunctionConstructor;
|
|
47
47
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
48
48
|
onClose: PropType<import("../interface").OnClose>;
|
|
49
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
49
50
|
onTabOut: FunctionConstructor;
|
|
50
51
|
onUpdateValue: {
|
|
51
52
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -2556,6 +2557,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2556
2557
|
onClear: FunctionConstructor;
|
|
2557
2558
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
2558
2559
|
onClose: PropType<import("../interface").OnClose>;
|
|
2560
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
2559
2561
|
onTabOut: FunctionConstructor;
|
|
2560
2562
|
onUpdateValue: {
|
|
2561
2563
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -5059,6 +5061,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
5059
5061
|
onClear: FunctionConstructor;
|
|
5060
5062
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
5061
5063
|
onClose: PropType<import("../interface").OnClose>;
|
|
5064
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
5062
5065
|
onTabOut: FunctionConstructor;
|
|
5063
5066
|
onUpdateValue: {
|
|
5064
5067
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -7569,6 +7572,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7569
7572
|
onClear: FunctionConstructor;
|
|
7570
7573
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
7571
7574
|
onClose: PropType<import("../interface").OnClose>;
|
|
7575
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
7572
7576
|
onTabOut: FunctionConstructor;
|
|
7573
7577
|
onUpdateValue: {
|
|
7574
7578
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -28,6 +28,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
28
28
|
onClear: FunctionConstructor;
|
|
29
29
|
onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
30
30
|
onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
31
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
31
32
|
onTabOut: FunctionConstructor;
|
|
32
33
|
onUpdateValue: {
|
|
33
34
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -2525,6 +2526,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2525
2526
|
onClear: FunctionConstructor;
|
|
2526
2527
|
onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
2527
2528
|
onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
2529
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
2528
2530
|
onTabOut: FunctionConstructor;
|
|
2529
2531
|
onUpdateValue: {
|
|
2530
2532
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -46,6 +46,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
46
46
|
onClear: FunctionConstructor;
|
|
47
47
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
48
48
|
onClose: PropType<import("../interface").OnClose>;
|
|
49
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
49
50
|
onTabOut: FunctionConstructor;
|
|
50
51
|
onUpdateValue: {
|
|
51
52
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -2556,6 +2557,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2556
2557
|
onClear: FunctionConstructor;
|
|
2557
2558
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
2558
2559
|
onClose: PropType<import("../interface").OnClose>;
|
|
2560
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
2559
2561
|
onTabOut: FunctionConstructor;
|
|
2560
2562
|
onUpdateValue: {
|
|
2561
2563
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -5059,6 +5061,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
5059
5061
|
onClear: FunctionConstructor;
|
|
5060
5062
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
5061
5063
|
onClose: PropType<import("../interface").OnClose>;
|
|
5064
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
5062
5065
|
onTabOut: FunctionConstructor;
|
|
5063
5066
|
onUpdateValue: {
|
|
5064
5067
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -7569,6 +7572,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7569
7572
|
onClear: FunctionConstructor;
|
|
7570
7573
|
onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
7571
7574
|
onClose: PropType<import("../interface").OnClose>;
|
|
7575
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
7572
7576
|
onTabOut: FunctionConstructor;
|
|
7573
7577
|
onUpdateValue: {
|
|
7574
7578
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -28,6 +28,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
28
28
|
onClear: FunctionConstructor;
|
|
29
29
|
onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
30
30
|
onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
31
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
31
32
|
onTabOut: FunctionConstructor;
|
|
32
33
|
onUpdateValue: {
|
|
33
34
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -2525,6 +2526,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2525
2526
|
onClear: FunctionConstructor;
|
|
2526
2527
|
onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
2527
2528
|
onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
2529
|
+
ssrCurrentTimestamp: NumberConstructor;
|
|
2528
2530
|
onTabOut: FunctionConstructor;
|
|
2529
2531
|
onUpdateValue: {
|
|
2530
2532
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -24,6 +24,7 @@ declare const useCalendarProps: {
|
|
|
24
24
|
readonly onClear: FunctionConstructor;
|
|
25
25
|
readonly onConfirm: PropType<(value: import("../interface").Value | null) => void>;
|
|
26
26
|
readonly onClose: PropType<import("../interface").OnClose>;
|
|
27
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
27
28
|
readonly onTabOut: FunctionConstructor;
|
|
28
29
|
readonly onUpdateValue: {
|
|
29
30
|
readonly type: PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -14,6 +14,7 @@ const useCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.useP
|
|
|
14
14
|
} });
|
|
15
15
|
exports.useCalendarProps = useCalendarProps;
|
|
16
16
|
function useCalendar(props, type) {
|
|
17
|
+
var _a, _b;
|
|
17
18
|
const panelCommon = (0, use_panel_common_1.usePanelCommon)(props);
|
|
18
19
|
const { isValueInvalidRef, isDateDisabledRef, maxDateRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots } = (0, vue_1.inject)(interface_1.datePickerInjectionKey);
|
|
19
20
|
const validation = {
|
|
@@ -27,15 +28,19 @@ function useCalendar(props, type) {
|
|
|
27
28
|
isSecondDisabled: isSecondDisabledRef
|
|
28
29
|
};
|
|
29
30
|
const mergedDateFormatRef = (0, vue_1.computed)(() => props.dateFormat || localeRef.value.dateFormat);
|
|
31
|
+
const initialCurrentTimestamp = (_a = props.ssrCurrentTimestamp) !== null && _a !== void 0 ? _a : Date.now();
|
|
30
32
|
const dateInputValueRef = (0, vue_1.ref)(props.value === null || Array.isArray(props.value)
|
|
31
33
|
? ''
|
|
32
34
|
: (0, date_fns_1.format)(props.value, mergedDateFormatRef.value));
|
|
33
35
|
const calendarValueRef = (0, vue_1.ref)(props.value === null || Array.isArray(props.value)
|
|
34
|
-
?
|
|
36
|
+
? initialCurrentTimestamp
|
|
35
37
|
: props.value);
|
|
36
38
|
const yearVlRef = (0, vue_1.ref)(null);
|
|
37
39
|
const yearScrollbarRef = (0, vue_1.ref)(null);
|
|
38
|
-
const nowRef = (0, vue_1.ref)(
|
|
40
|
+
const nowRef = (0, vue_1.ref)((_b = props.ssrCurrentTimestamp) !== null && _b !== void 0 ? _b : null);
|
|
41
|
+
(0, vue_1.onMounted)(() => {
|
|
42
|
+
nowRef.value = Date.now();
|
|
43
|
+
});
|
|
39
44
|
const dateArrayRef = (0, vue_1.computed)(() => {
|
|
40
45
|
var _a;
|
|
41
46
|
return (0, utils_1.dateArray)(calendarValueRef.value, props.value, nowRef.value, (_a = firstDayOfWeekRef.value) !== null && _a !== void 0 ? _a : localeRef.value.firstDayOfWeek);
|
|
@@ -164,7 +169,7 @@ function useCalendar(props, type) {
|
|
|
164
169
|
newValue = props.value;
|
|
165
170
|
}
|
|
166
171
|
else {
|
|
167
|
-
newValue =
|
|
172
|
+
newValue = calendarValueRef.value;
|
|
168
173
|
}
|
|
169
174
|
if (type === 'datetime'
|
|
170
175
|
&& props.defaultTime !== null
|
|
@@ -210,7 +215,7 @@ function useCalendar(props, type) {
|
|
|
210
215
|
newValue = props.value;
|
|
211
216
|
}
|
|
212
217
|
else {
|
|
213
|
-
newValue =
|
|
218
|
+
newValue = calendarValueRef.value;
|
|
214
219
|
}
|
|
215
220
|
newValue = (0, date_fns_1.getTime)(dateItem.type === 'month'
|
|
216
221
|
? (0, date_fns_1.setMonth)(newValue, dateItem.dateObject.month)
|
|
@@ -27,6 +27,7 @@ declare const useDualCalendarProps: {
|
|
|
27
27
|
readonly onClear: FunctionConstructor;
|
|
28
28
|
readonly onConfirm: import("vue").PropType<(value: import("../interface").Value | null) => void>;
|
|
29
29
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
30
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
30
31
|
readonly onTabOut: FunctionConstructor;
|
|
31
32
|
readonly onUpdateValue: {
|
|
32
33
|
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
@@ -14,7 +14,7 @@ const useDualCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.
|
|
|
14
14
|
} });
|
|
15
15
|
exports.useDualCalendarProps = useDualCalendarProps;
|
|
16
16
|
function useDualCalendar(props, type) {
|
|
17
|
-
var _a, _b;
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
18
|
const { isDateDisabledRef, maxDateRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots } = (0, vue_1.inject)(interface_1.datePickerInjectionKey);
|
|
19
19
|
const validation = {
|
|
20
20
|
isDateDisabled: isDateDisabledRef,
|
|
@@ -42,15 +42,19 @@ function useDualCalendar(props, type) {
|
|
|
42
42
|
const startMonthScrollbarRef = (0, vue_1.ref)(null);
|
|
43
43
|
const endMonthScrollbarRef = (0, vue_1.ref)(null);
|
|
44
44
|
const { value } = props;
|
|
45
|
-
const
|
|
45
|
+
const initialCurrentTimestamp = (_a = props.ssrCurrentTimestamp) !== null && _a !== void 0 ? _a : Date.now();
|
|
46
|
+
const defaultCalendarStartTime = (_b = props.defaultCalendarStartTime) !== null && _b !== void 0 ? _b : (Array.isArray(value) && typeof value[0] === 'number'
|
|
46
47
|
? value[0]
|
|
47
|
-
:
|
|
48
|
+
: initialCurrentTimestamp);
|
|
48
49
|
const startCalendarDateTimeRef = (0, vue_1.ref)(defaultCalendarStartTime);
|
|
49
|
-
const endCalendarDateTimeRef = (0, vue_1.ref)((
|
|
50
|
+
const endCalendarDateTimeRef = (0, vue_1.ref)((_c = props.defaultCalendarEndTime) !== null && _c !== void 0 ? _c : (Array.isArray(value) && typeof value[1] === 'number'
|
|
50
51
|
? value[1]
|
|
51
52
|
: (0, date_fns_1.getTime)((0, date_fns_1.addMonths)(defaultCalendarStartTime, 1))));
|
|
52
53
|
adjustCalendarTimes(true);
|
|
53
|
-
const nowRef = (0, vue_1.ref)(
|
|
54
|
+
const nowRef = (0, vue_1.ref)((_d = props.ssrCurrentTimestamp) !== null && _d !== void 0 ? _d : null);
|
|
55
|
+
(0, vue_1.onMounted)(() => {
|
|
56
|
+
nowRef.value = Date.now();
|
|
57
|
+
});
|
|
54
58
|
const isSelectingRef = (0, vue_1.ref)(false);
|
|
55
59
|
const memorizedStartDateTimeRef = (0, vue_1.ref)(0);
|
|
56
60
|
const mergedDateFormatRef = (0, vue_1.computed)(() => props.dateFormat || localeRef.value.dateFormat);
|
|
@@ -117,19 +121,19 @@ function useDualCalendar(props, type) {
|
|
|
117
121
|
});
|
|
118
122
|
const startQuarterArrayRef = (0, vue_1.computed)(() => {
|
|
119
123
|
const startValue = (0, utils_1.pluckValueFromRange)(props.value, 'start');
|
|
120
|
-
return (0, utils_1.quarterArray)(startValue !== null && startValue !== void 0 ? startValue :
|
|
124
|
+
return (0, utils_1.quarterArray)(startValue !== null && startValue !== void 0 ? startValue : startCalendarDateTimeRef.value, startValue, nowRef.value);
|
|
121
125
|
});
|
|
122
126
|
const endQuarterArrayRef = (0, vue_1.computed)(() => {
|
|
123
127
|
const endValue = (0, utils_1.pluckValueFromRange)(props.value, 'end');
|
|
124
|
-
return (0, utils_1.quarterArray)(endValue !== null && endValue !== void 0 ? endValue :
|
|
128
|
+
return (0, utils_1.quarterArray)(endValue !== null && endValue !== void 0 ? endValue : endCalendarDateTimeRef.value, endValue, nowRef.value);
|
|
125
129
|
});
|
|
126
130
|
const startMonthArrayRef = (0, vue_1.computed)(() => {
|
|
127
131
|
const startValue = (0, utils_1.pluckValueFromRange)(props.value, 'start');
|
|
128
|
-
return (0, utils_1.monthArray)(startValue !== null && startValue !== void 0 ? startValue :
|
|
132
|
+
return (0, utils_1.monthArray)(startValue !== null && startValue !== void 0 ? startValue : startCalendarDateTimeRef.value, startValue, nowRef.value);
|
|
129
133
|
});
|
|
130
134
|
const endMonthArrayRef = (0, vue_1.computed)(() => {
|
|
131
135
|
const endValue = (0, utils_1.pluckValueFromRange)(props.value, 'end');
|
|
132
|
-
return (0, utils_1.monthArray)(endValue !== null && endValue !== void 0 ? endValue :
|
|
136
|
+
return (0, utils_1.monthArray)(endValue !== null && endValue !== void 0 ? endValue : endCalendarDateTimeRef.value, endValue, nowRef.value);
|
|
133
137
|
});
|
|
134
138
|
(0, vue_1.watch)((0, vue_1.computed)(() => props.value), (value) => {
|
|
135
139
|
if (value !== null && Array.isArray(value)) {
|
|
@@ -510,7 +514,7 @@ function useDualCalendar(props, type) {
|
|
|
510
514
|
if (value === undefined || type === 'start') {
|
|
511
515
|
if (startMonthScrollbarRef.value) {
|
|
512
516
|
const monthIndex = !Array.isArray(mergedValue)
|
|
513
|
-
? (0, date_fns_1.getMonth)(
|
|
517
|
+
? (0, date_fns_1.getMonth)(startCalendarDateTimeRef.value)
|
|
514
518
|
: (0, date_fns_1.getMonth)(mergedValue[0]);
|
|
515
519
|
startMonthScrollbarRef.value.scrollTo({
|
|
516
520
|
debounce: false,
|
|
@@ -520,7 +524,7 @@ function useDualCalendar(props, type) {
|
|
|
520
524
|
}
|
|
521
525
|
if (startYearVlRef.value) {
|
|
522
526
|
const yearIndex = (!Array.isArray(mergedValue)
|
|
523
|
-
? (0, date_fns_1.getYear)(
|
|
527
|
+
? (0, date_fns_1.getYear)(startCalendarDateTimeRef.value)
|
|
524
528
|
: (0, date_fns_1.getYear)(mergedValue[0])) - config_1.START_YEAR;
|
|
525
529
|
startYearVlRef.value.scrollTo({ index: yearIndex, debounce: false });
|
|
526
530
|
}
|
|
@@ -528,7 +532,7 @@ function useDualCalendar(props, type) {
|
|
|
528
532
|
if (value === undefined || type === 'end') {
|
|
529
533
|
if (endMonthScrollbarRef.value) {
|
|
530
534
|
const monthIndex = !Array.isArray(mergedValue)
|
|
531
|
-
? (0, date_fns_1.getMonth)(
|
|
535
|
+
? (0, date_fns_1.getMonth)(endCalendarDateTimeRef.value)
|
|
532
536
|
: (0, date_fns_1.getMonth)(mergedValue[1]);
|
|
533
537
|
endMonthScrollbarRef.value.scrollTo({
|
|
534
538
|
debounce: false,
|
|
@@ -538,7 +542,7 @@ function useDualCalendar(props, type) {
|
|
|
538
542
|
}
|
|
539
543
|
if (endYearVlRef.value) {
|
|
540
544
|
const yearIndex = (!Array.isArray(mergedValue)
|
|
541
|
-
? (0, date_fns_1.getYear)(
|
|
545
|
+
? (0, date_fns_1.getYear)(endCalendarDateTimeRef.value)
|
|
542
546
|
: (0, date_fns_1.getYear)(mergedValue[1])) - config_1.START_YEAR;
|
|
543
547
|
endYearVlRef.value.scrollTo({ index: yearIndex, debounce: false });
|
|
544
548
|
}
|
|
@@ -18,6 +18,7 @@ declare const usePanelCommonProps: {
|
|
|
18
18
|
readonly onClear: FunctionConstructor;
|
|
19
19
|
readonly onConfirm: PropType<(value: Value | null) => void>;
|
|
20
20
|
readonly onClose: PropType<OnClose>;
|
|
21
|
+
readonly ssrCurrentTimestamp: NumberConstructor;
|
|
21
22
|
readonly onTabOut: FunctionConstructor;
|
|
22
23
|
readonly onUpdateValue: {
|
|
23
24
|
readonly type: PropType<OnPanelUpdateValue>;
|
|
@@ -50,10 +50,10 @@ export type DateCommonItem = DateItem | MonthItem | YearItem | QuarterItem;
|
|
|
50
50
|
* Given time to display calendar, given the selected time, given current time,
|
|
51
51
|
* return the date array of display time's month.
|
|
52
52
|
*/
|
|
53
|
-
declare function dateArray(monthTs: number, valueTs: number | [number, number] | null, currentTs: number, startDay: 0 | 1 | 2 | 3 | 4 | 5 | 6, strip?: boolean): DateItem[];
|
|
54
|
-
declare function monthArray(yearAnchorTs: number, valueTs: number | null, currentTs: number): MonthItem[];
|
|
55
|
-
declare function quarterArray(yearAnchorTs: number, valueTs: number | null, currentTs: number): QuarterItem[];
|
|
56
|
-
declare function yearArray(valueTs: number | null, currentTs: number, maxDate?: number): YearItem[];
|
|
53
|
+
declare function dateArray(monthTs: number, valueTs: number | [number, number] | null, currentTs: number | null, startDay: 0 | 1 | 2 | 3 | 4 | 5 | 6, strip?: boolean): DateItem[];
|
|
54
|
+
declare function monthArray(yearAnchorTs: number, valueTs: number | null, currentTs: number | null): MonthItem[];
|
|
55
|
+
declare function quarterArray(yearAnchorTs: number, valueTs: number | null, currentTs: number | null): QuarterItem[];
|
|
56
|
+
declare function yearArray(valueTs: number | null, currentTs: number | null, maxDate?: number): YearItem[];
|
|
57
57
|
declare function strictParse(string: string, pattern: string, backup: Date, option: {
|
|
58
58
|
locale: UDateLocale['locale'];
|
|
59
59
|
}): Date;
|
|
@@ -72,7 +72,7 @@ function dateItem(time, monthTs, valueTs, currentTs) {
|
|
|
72
72
|
year: (0, date_fns_1.getYear)(time)
|
|
73
73
|
},
|
|
74
74
|
inCurrentMonth: (0, date_fns_1.isSameMonth)(time, monthTs),
|
|
75
|
-
isCurrentDate: matchDate(currentTs, time, 'date'),
|
|
75
|
+
isCurrentDate: currentTs !== null && matchDate(currentTs, time, 'date'),
|
|
76
76
|
inSpan,
|
|
77
77
|
startOfSpan,
|
|
78
78
|
endOfSpan,
|
|
@@ -87,7 +87,7 @@ function monthItem(monthTs, valueTs, currentTs) {
|
|
|
87
87
|
month: (0, date_fns_1.getMonth)(monthTs),
|
|
88
88
|
year: (0, date_fns_1.getYear)(monthTs)
|
|
89
89
|
},
|
|
90
|
-
isCurrent: (0, date_fns_1.isSameMonth)(currentTs, monthTs),
|
|
90
|
+
isCurrent: currentTs !== null && (0, date_fns_1.isSameMonth)(currentTs, monthTs),
|
|
91
91
|
selected: valueTs !== null && matchDate(valueTs, monthTs, 'month'),
|
|
92
92
|
ts: (0, date_fns_1.getTime)(monthTs)
|
|
93
93
|
};
|
|
@@ -98,7 +98,7 @@ function yearItem(yearTs, valueTs, currentTs) {
|
|
|
98
98
|
dateObject: {
|
|
99
99
|
year: (0, date_fns_1.getYear)(yearTs)
|
|
100
100
|
},
|
|
101
|
-
isCurrent: (0, date_fns_1.isSameYear)(currentTs, yearTs),
|
|
101
|
+
isCurrent: currentTs !== null && (0, date_fns_1.isSameYear)(currentTs, yearTs),
|
|
102
102
|
selected: valueTs !== null && matchDate(valueTs, yearTs, 'year'),
|
|
103
103
|
ts: (0, date_fns_1.getTime)(yearTs)
|
|
104
104
|
};
|
|
@@ -110,7 +110,7 @@ function quarterItem(quarterTs, valueTs, currentTs) {
|
|
|
110
110
|
quarter: (0, date_fns_1.getQuarter)(quarterTs),
|
|
111
111
|
year: (0, date_fns_1.getYear)(quarterTs)
|
|
112
112
|
},
|
|
113
|
-
isCurrent: (0, date_fns_1.isSameQuarter)(currentTs, quarterTs),
|
|
113
|
+
isCurrent: currentTs !== null && (0, date_fns_1.isSameQuarter)(currentTs, quarterTs),
|
|
114
114
|
selected: valueTs !== null && matchDate(valueTs, quarterTs, 'quarter'),
|
|
115
115
|
ts: (0, date_fns_1.getTime)(quarterTs)
|
|
116
116
|
};
|
|
@@ -1765,7 +1765,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1765
1765
|
readonly yPlacement: "left" | "right";
|
|
1766
1766
|
readonly xPlacement: "top" | "bottom";
|
|
1767
1767
|
}> | null>;
|
|
1768
|
-
now: number;
|
|
1769
1768
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1770
1769
|
value: PropType<Value>;
|
|
1771
1770
|
displayYear: {
|
|
@@ -57,7 +57,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
57
57
|
const loc = (_a = dateLocaleRef === null || dateLocaleRef === void 0 ? void 0 : dateLocaleRef.value) === null || _a === void 0 ? void 0 : _a.locale;
|
|
58
58
|
return loc ? { locale: loc } : undefined;
|
|
59
59
|
});
|
|
60
|
-
const
|
|
60
|
+
const nowRef = (0, vue_1.ref)(null);
|
|
61
|
+
(0, vue_1.onMounted)(() => {
|
|
62
|
+
nowRef.value = Date.now();
|
|
63
|
+
});
|
|
61
64
|
// Используем composable для скролла
|
|
62
65
|
const { monthScrollbarRef, yearScrollbarRef, calendarScrollbarRef, scrollToMonthInMonthList, scrollToYear, scrollToMonthInCalendar: scrollToMonthInCalendarRaw } = (0, useCalendarScroll_1.useCalendarScroll)();
|
|
63
66
|
// Все месяцы для навигации (с локализацией)
|
|
@@ -99,7 +102,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
99
102
|
year,
|
|
100
103
|
month,
|
|
101
104
|
label: (0, utils_1.getMonthLabel)(month, dateFnsOptions.value),
|
|
102
|
-
dates: (0, utils_1.generateDatesForMonth)(year, month, (_a = props.value) !== null && _a !== void 0 ? _a : null, null,
|
|
105
|
+
dates: (0, utils_1.generateDatesForMonth)(year, month, (_a = props.value) !== null && _a !== void 0 ? _a : null, null, nowRef.value, props.isDateDisabled)
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
return months;
|
|
@@ -123,8 +126,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
123
126
|
weekdayNamesRef,
|
|
124
127
|
monthScrollbarRef,
|
|
125
128
|
yearScrollbarRef,
|
|
126
|
-
calendarScrollbarRef
|
|
127
|
-
now
|
|
129
|
+
calendarScrollbarRef
|
|
128
130
|
};
|
|
129
131
|
},
|
|
130
132
|
render() {
|
|
@@ -1776,7 +1776,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1776
1776
|
readonly yPlacement: "left" | "right";
|
|
1777
1777
|
readonly xPlacement: "top" | "bottom";
|
|
1778
1778
|
}> | null>;
|
|
1779
|
-
now: number;
|
|
1780
1779
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1781
1780
|
value: {
|
|
1782
1781
|
type: PropType<RangeValue>;
|
|
@@ -68,7 +68,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
68
68
|
const loc = (_a = dateLocaleRef === null || dateLocaleRef === void 0 ? void 0 : dateLocaleRef.value) === null || _a === void 0 ? void 0 : _a.locale;
|
|
69
69
|
return loc ? { locale: loc } : undefined;
|
|
70
70
|
});
|
|
71
|
-
const
|
|
71
|
+
const nowRef = (0, vue_1.ref)(null);
|
|
72
|
+
(0, vue_1.onMounted)(() => {
|
|
73
|
+
nowRef.value = Date.now();
|
|
74
|
+
});
|
|
72
75
|
// Используем composable для скролла
|
|
73
76
|
const { monthScrollbarRef, yearScrollbarRef, calendarScrollbarRef, scrollToMonthInMonthList, scrollToYear, scrollToMonthInCalendar: scrollToMonthInCalendarRaw } = (0, useCalendarScroll_1.useCalendarScroll)();
|
|
74
77
|
// Все месяцы для навигации (с локализацией)
|
|
@@ -110,7 +113,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
110
113
|
month,
|
|
111
114
|
label: (0, utils_1.getMonthLabel)(month, dateFnsOptions.value),
|
|
112
115
|
dates: (0, utils_1.generateDatesForMonth)(year, month, null, // single value не используется для range
|
|
113
|
-
props.value,
|
|
116
|
+
props.value, nowRef.value, props.isDateDisabled)
|
|
114
117
|
});
|
|
115
118
|
}
|
|
116
119
|
return months;
|
|
@@ -134,8 +137,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
134
137
|
weekdayNamesRef,
|
|
135
138
|
monthScrollbarRef,
|
|
136
139
|
yearScrollbarRef,
|
|
137
|
-
calendarScrollbarRef
|
|
138
|
-
now
|
|
140
|
+
calendarScrollbarRef
|
|
139
141
|
};
|
|
140
142
|
},
|
|
141
143
|
render() {
|
|
@@ -3,7 +3,7 @@ import type { DateItem, MonthItem, YearItem } from './interface';
|
|
|
3
3
|
export interface DateFnsOptions {
|
|
4
4
|
locale: Locale;
|
|
5
5
|
}
|
|
6
|
-
export declare function generateDatesForMonth(year: number, month: number, value: number | null, rangeValue: [number, number] | null, now: number, isDateDisabled?: (ts: number) => boolean): DateItem[];
|
|
6
|
+
export declare function generateDatesForMonth(year: number, month: number, value: number | null, rangeValue: [number, number] | null, now: number | null, isDateDisabled?: (ts: number) => boolean): DateItem[];
|
|
7
7
|
export declare function getMonthLabel(month: number, options?: DateFnsOptions): string;
|
|
8
8
|
export declare function getWeekdayNames(options?: DateFnsOptions, dayFormat?: string): string[];
|
|
9
9
|
export declare function generateMonthsForYear(year: number, options?: DateFnsOptions, monthFormat?: string): MonthItem[];
|
|
@@ -45,7 +45,7 @@ function generateDatesForMonth(year, month, value, rangeValue, now, isDateDisabl
|
|
|
45
45
|
month: dayMonth,
|
|
46
46
|
date: dayDate,
|
|
47
47
|
ts,
|
|
48
|
-
isCurrentDate: (0, date_fns_1.isSameDay)(day, now),
|
|
48
|
+
isCurrentDate: now !== null && (0, date_fns_1.isSameDay)(day, now),
|
|
49
49
|
isCurrentMonth: (0, date_fns_1.isSameMonth)(day, date),
|
|
50
50
|
selected,
|
|
51
51
|
inRange,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UDialogProvider = exports.dialogProviderProps = void 0;
|
|
4
|
-
const seemly_1 = require("seemly");
|
|
5
4
|
const vooks_1 = require("vooks");
|
|
6
5
|
const vue_1 = require("vue");
|
|
7
6
|
const _utils_1 = require("../../_utils");
|
|
@@ -17,8 +16,10 @@ exports.UDialogProvider = (0, vue_1.defineComponent)({
|
|
|
17
16
|
setup() {
|
|
18
17
|
const dialogListRef = (0, vue_1.ref)([]);
|
|
19
18
|
const dialogInstRefs = {};
|
|
19
|
+
const providerId = (0, vue_1.useId)();
|
|
20
|
+
let dialogKeyIndex = 0;
|
|
20
21
|
function create(options = {}) {
|
|
21
|
-
const key =
|
|
22
|
+
const key = `${providerId}-${dialogKeyIndex++}`;
|
|
22
23
|
const dialogReactive = (0, vue_1.reactive)(Object.assign(Object.assign({}, options), { key, destroy: () => {
|
|
23
24
|
dialogInstRefs[`u-dialog-${key}`].hide();
|
|
24
25
|
} }));
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.dynamicInputProps = void 0;
|
|
7
|
-
const seemly_1 = require("seemly");
|
|
8
7
|
const vooks_1 = require("vooks");
|
|
9
8
|
const vue_1 = require("vue");
|
|
10
9
|
const _internal_1 = require("../../_internal");
|
|
@@ -20,7 +19,6 @@ const InputPreset_1 = __importDefault(require("./InputPreset"));
|
|
|
20
19
|
const interface_1 = require("./interface");
|
|
21
20
|
const PairPreset_1 = __importDefault(require("./PairPreset"));
|
|
22
21
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
23
|
-
const globalDataKeyMap = new WeakMap();
|
|
24
22
|
exports.dynamicInputProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { max: Number, min: {
|
|
25
23
|
type: Number,
|
|
26
24
|
default: 0
|
|
@@ -67,6 +65,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
67
65
|
const uncontrolledValueRef = (0, vue_1.ref)(props.defaultValue);
|
|
68
66
|
const controlledValueRef = (0, vue_1.toRef)(props, 'value');
|
|
69
67
|
const mergedValueRef = (0, vooks_1.useMergedState)(controlledValueRef, uncontrolledValueRef);
|
|
68
|
+
const componentId = (0, vue_1.useId)();
|
|
69
|
+
const localDataKeyMap = new WeakMap();
|
|
70
|
+
let localDataKeyIndex = 0;
|
|
70
71
|
const themeRef = (0, _mixins_1.useTheme)('DynamicInput', '-dynamic-input', index_cssr_1.default, styles_1.dynamicInputLight, props, mergedClsPrefixRef);
|
|
71
72
|
const insertionDisabledRef = (0, vue_1.computed)(() => {
|
|
72
73
|
const { value: mergedValue } = mergedValueRef;
|
|
@@ -102,9 +103,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
102
103
|
if (typeof value !== 'object')
|
|
103
104
|
return index;
|
|
104
105
|
const rawValue = (0, vue_1.isProxy)(value) ? (0, vue_1.toRaw)(value) : value;
|
|
105
|
-
let key =
|
|
106
|
+
let key = localDataKeyMap.get(rawValue);
|
|
106
107
|
if (key === undefined) {
|
|
107
|
-
|
|
108
|
+
key = `${componentId}-${localDataKeyIndex++}`;
|
|
109
|
+
localDataKeyMap.set(rawValue, key);
|
|
108
110
|
}
|
|
109
111
|
return key;
|
|
110
112
|
}
|
|
@@ -123,9 +125,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
123
125
|
: originalItem;
|
|
124
126
|
const rawNew = (0, vue_1.isProxy)(value) ? (0, vue_1.toRaw)(value) : value;
|
|
125
127
|
// inherit key is value position is not change
|
|
126
|
-
const originalKey =
|
|
128
|
+
const originalKey = localDataKeyMap.get(rawOriginal);
|
|
127
129
|
if (originalKey !== undefined) {
|
|
128
|
-
|
|
130
|
+
localDataKeyMap.set(rawNew, originalKey);
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
doUpdateValue(newValue);
|
package/lib/form/src/FormItem.js
CHANGED
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.formItemPropKeys = exports.formItemProps = void 0;
|
|
16
16
|
const async_validator_1 = __importDefault(require("async-validator"));
|
|
17
17
|
const lodash_es_1 = require("lodash-es");
|
|
18
|
-
const seemly_1 = require("seemly");
|
|
19
18
|
const vue_1 = require("vue");
|
|
20
19
|
const _mixins_1 = require("../../_mixins");
|
|
21
20
|
const use_form_item_1 = require("../../_mixins/use-form-item");
|
|
@@ -84,7 +83,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
84
83
|
const { mergedSize: mergedSizeRef } = formItemSizeRefs;
|
|
85
84
|
const { mergedLabelPlacement: labelPlacementRef, mergedLabelAlign: labelTextAlignRef, mergedRequireMarkPlacement: mergedRequireMarkPlacementRef } = formItemMiscRefs;
|
|
86
85
|
const renderExplainsRef = (0, vue_1.ref)([]);
|
|
87
|
-
const
|
|
86
|
+
const feedbackBaseId = (0, vue_1.useId)();
|
|
87
|
+
const feedbackIdIndexRef = (0, vue_1.ref)(0);
|
|
88
|
+
const feedbackIdRef = (0, vue_1.ref)(`${feedbackBaseId}-${feedbackIdIndexRef.value}`);
|
|
88
89
|
const labelElementRef = (0, vue_1.ref)(null);
|
|
89
90
|
const mergedDisabledRef = UForm
|
|
90
91
|
? (0, vue_1.toRef)(UForm.props, 'disabled')
|
|
@@ -112,7 +113,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
112
113
|
validationErroredRef.value = false;
|
|
113
114
|
validationWarnedRef.value = false;
|
|
114
115
|
if (props.feedback) {
|
|
115
|
-
|
|
116
|
+
feedbackIdIndexRef.value += 1;
|
|
117
|
+
feedbackIdRef.value = `${feedbackBaseId}-${feedbackIdIndexRef.value}`;
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
function handleContentBlur() {
|
package/lib/grid/src/Grid.js
CHANGED
|
@@ -46,6 +46,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
46
46
|
const { mergedClsPrefixRef, mergedBreakpointsRef } = (0, _mixins_1.useConfig)(props);
|
|
47
47
|
const numRegex = /^\d+$/;
|
|
48
48
|
const widthRef = (0, vue_1.ref)(undefined);
|
|
49
|
+
const mountedRef = (0, vue_1.ref)(false);
|
|
49
50
|
const breakpointsRef = (0, vooks_1.useBreakpoints)((mergedBreakpointsRef === null || mergedBreakpointsRef === void 0 ? void 0 : mergedBreakpointsRef.value) || config_1.defaultBreakpoints);
|
|
50
51
|
const isResponsiveRef = (0, vooks_1.useMemo)(() => {
|
|
51
52
|
if (props.itemResponsive)
|
|
@@ -61,7 +62,12 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
61
62
|
const responsiveQueryRef = (0, vue_1.computed)(() => {
|
|
62
63
|
if (!isResponsiveRef.value)
|
|
63
64
|
return undefined;
|
|
64
|
-
|
|
65
|
+
if (props.responsive === 'self')
|
|
66
|
+
return widthRef.value;
|
|
67
|
+
// `screen` responsiveness depends on client-only media queries. Keep the
|
|
68
|
+
// first SSR and hydration render deterministic, then resolve breakpoints
|
|
69
|
+
// after mount.
|
|
70
|
+
return mountedRef.value ? breakpointsRef.value : undefined;
|
|
65
71
|
});
|
|
66
72
|
const responsiveColsRef = (0, vooks_1.useMemo)(() => {
|
|
67
73
|
var _a;
|
|
@@ -86,6 +92,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
86
92
|
const isSsrRef = (0, vue_1.ref)(false);
|
|
87
93
|
const contentElRef = (0, vue_1.ref)();
|
|
88
94
|
(0, vue_1.onMounted)(() => {
|
|
95
|
+
mountedRef.value = true;
|
|
89
96
|
const { value: contentEl } = contentElRef;
|
|
90
97
|
if (contentEl) {
|
|
91
98
|
if (contentEl.hasAttribute(SSR_ATTR_NAME)) {
|