@sdata/web-vue 2.2.1 → 2.6.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/sd.css +117 -191
- package/dist/sd.min.css +1 -1
- package/es/_components/picker/input-range.vue.d.ts +2 -2
- package/es/_components/transition/expand-transition.vue.d.ts +2 -2
- package/es/_hooks/use-responsive.d.ts +2 -2
- package/es/_hooks/use-theme-mode.d.ts +3 -0
- package/es/{calendar/hooks/use-calendar-theme.js → _hooks/use-theme-mode.js} +14 -10
- package/es/_utils/date.d.ts +10 -9
- package/es/_utils/date.js +23 -7
- package/es/_utils/responsive-observe.d.ts +5 -4
- package/es/_utils/responsive-observe.js +2 -1
- package/es/alert/index.d.ts +3 -3
- package/es/anchor/anchor.vue.d.ts +52 -2
- package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +75 -15
- package/es/anchor/index.d.ts +78 -3
- package/es/avatar/index.d.ts +20 -20
- package/es/border-beam/border-beam.js +5 -0
- package/es/border-beam/border-beam.vue.d.ts +52 -0
- package/es/border-beam/border-beam.vue_vue_type_script_setup_true_lang.js +623 -0
- package/es/border-beam/index.d.ts +106 -0
- package/es/border-beam/index.js +10 -0
- package/es/border-beam/pulseDriver.d.ts +2 -0
- package/es/border-beam/pulseDriver.js +74 -0
- package/es/border-beam/style/css.js +2 -0
- package/es/border-beam/style/index.css +21 -0
- package/es/border-beam/style/index.d.ts +2 -0
- package/es/border-beam/style/index.js +2 -0
- package/es/border-beam/style/index.scss +12 -0
- package/es/border-beam/style/token.scss +12 -0
- package/es/border-beam/styles.d.ts +42 -0
- package/es/border-beam/styles.js +3545 -0
- package/es/border-beam/types.d.ts +27 -0
- package/es/button/button.vue.d.ts +16 -3
- package/es/button/button.vue_vue_type_script_setup_true_lang.js +39 -9
- package/es/button/index.d.ts +43 -24
- package/es/button/interface.d.ts +1 -0
- package/es/calendar/components/cell.vue.d.ts +26 -26
- package/es/calendar/components/index.vue.d.ts +1 -1
- package/es/calendar/components/index.vue_vue_type_script_setup_true_lang.js +3 -2
- package/es/calendar/index.d.ts +5 -5
- package/es/carousel/index.d.ts +3 -3
- package/es/cascader/cascader.vue.d.ts +8 -8
- package/es/checkbox/checkbox.d.ts +3 -3
- package/es/collapse/collapse-item.d.ts +5 -5
- package/es/collapse/index.d.ts +3 -3
- package/es/components.d.ts +1 -0
- package/es/config-provider/config-provider.vue.d.ts +9 -0
- package/es/config-provider/config-provider.vue_vue_type_script_setup_true_lang.js +10 -1
- package/es/config-provider/context.d.ts +1 -0
- package/es/config-provider/index.d.ts +36 -21
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +1 -0
- package/es/date-picker/hooks/use-cell-class-name.d.ts +1 -0
- package/es/date-picker/hooks/use-cell-class-name.js +3 -2
- package/es/date-picker/hooks/use-header-value.d.ts +2 -0
- package/es/date-picker/hooks/use-header-value.js +23 -19
- package/es/date-picker/hooks/use-picker-state.d.ts +2 -0
- package/es/date-picker/hooks/use-picker-state.js +3 -3
- package/es/date-picker/hooks/use-range-header-value.d.ts +2 -0
- package/es/date-picker/hooks/use-range-header-value.js +5 -1
- package/es/date-picker/hooks/use-range-picker-state.d.ts +2 -0
- package/es/date-picker/hooks/use-range-picker-state.js +3 -3
- package/es/date-picker/hooks/use-value-format.d.ts +5 -3
- package/es/date-picker/hooks/use-value-format.js +10 -8
- package/es/date-picker/index.d.ts +1373 -12
- package/es/date-picker/interface.d.ts +7 -0
- package/es/date-picker/panels/body.vue.d.ts +24 -6
- package/es/date-picker/panels/body.vue_vue_type_script_setup_true_lang.js +13 -12
- package/es/date-picker/panels/date/index.vue.d.ts +26 -8
- package/es/date-picker/panels/date/index.vue_vue_type_script_setup_true_lang.js +18 -9
- package/es/date-picker/panels/header.vue_vue_type_script_setup_true_lang.js +13 -20
- package/es/date-picker/panels/month/index.vue.d.ts +13 -8
- package/es/date-picker/panels/month/index.vue_vue_type_script_setup_true_lang.js +6 -6
- package/es/date-picker/panels/quarter/index.vue.d.ts +13 -8
- package/es/date-picker/panels/quarter/index.vue_vue_type_script_setup_true_lang.js +6 -6
- package/es/date-picker/panels/shortcuts.vue_vue_type_script_setup_true_lang.js +2 -6
- package/es/date-picker/panels/week/index.vue.d.ts +13 -1
- package/es/date-picker/panels/week/index.vue_vue_type_script_setup_true_lang.js +5 -2
- package/es/date-picker/panels/year/index.vue.d.ts +13 -8
- package/es/date-picker/panels/year/index.vue_vue_type_script_setup_true_lang.js +25 -15
- package/es/date-picker/picker-panel.vue.d.ts +56 -14
- package/es/date-picker/picker-panel.vue_vue_type_script_setup_true_lang.js +36 -19
- package/es/date-picker/picker.vue.d.ts +951 -3
- package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +91 -29
- package/es/date-picker/range-picker-panel.vue.d.ts +77 -15
- package/es/date-picker/range-picker-panel.vue_vue_type_script_setup_true_lang.js +52 -28
- package/es/date-picker/range-picker.vue.d.ts +1348 -4
- package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +114 -34
- package/es/descriptions/index.d.ts +24 -24
- package/es/drawer/drawer.vue.d.ts +5 -5
- package/es/drawer/index.d.ts +15 -15
- package/es/dropdown/dropdown-button.vue.d.ts +4 -4
- package/es/dropdown/index.d.ts +15 -15
- package/es/ellipsis/ellipsis.vue.d.ts +7 -7
- package/es/ellipsis/performant-ellipsis.vue.d.ts +5 -5
- package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/form/index.d.ts +3 -3
- package/es/grid/grid-col.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/grid/grid.vue_vue_type_script_setup_true_lang.js +10 -10
- package/es/icon/icon-menu/icon-menu.js +5 -0
- package/es/icon/icon-menu/icon-menu.vue_vue_type_script_setup_true_lang.js +52 -0
- package/es/icon/icon-menu/index.js +9 -0
- package/es/image/preview-toolbar.vue.d.ts +2 -3
- package/es/image/preview-toolbar.vue_vue_type_script_setup_true_lang.js +2 -3
- package/es/image/preview.vue.d.ts +2 -2
- package/es/index.css +117 -191
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -2
- package/es/index.scss +1 -0
- package/es/input/index.d.ts +7 -7
- package/es/input/input-password.vue.d.ts +3 -3
- package/es/json-form/index.d.ts +9 -9
- package/es/json-form/json-form-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/json-form/json-form.vue.d.ts +3 -3
- package/es/layout/content.vue.d.ts +2 -2
- package/es/layout/content.vue_vue_type_script_setup_true_lang.js +8 -3
- package/es/layout/context.d.ts +12 -9
- package/es/layout/context.js +11 -3
- package/es/layout/footer.vue.d.ts +2 -2
- package/es/layout/footer.vue_vue_type_script_setup_true_lang.js +8 -3
- package/es/layout/header.vue.d.ts +3 -30
- package/es/layout/header.vue_vue_type_script_setup_true_lang.js +9 -339
- package/es/layout/hooks/use-has-sider.d.ts +2 -0
- package/es/layout/hooks/use-has-sider.js +38 -0
- package/es/layout/index.d.ts +91 -380
- package/es/layout/index.js +2 -2
- package/es/layout/interface.d.ts +12 -46
- package/es/layout/layout.vue.d.ts +4 -2
- package/es/layout/layout.vue_vue_type_script_setup_true_lang.js +38 -14
- package/es/layout/sider.vue.d.ts +47 -183
- package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +191 -370
- package/es/layout/style/index.css +112 -190
- package/es/layout/style/index.scss +127 -239
- package/es/layout/style/token.scss +46 -26
- package/es/link/index.d.ts +6 -6
- package/es/list/index.d.ts +18 -18
- package/es/locale/interface.d.ts +2 -0
- package/es/locale/lang/ar-eg.js +46 -0
- package/es/locale/lang/de-de.js +46 -0
- package/es/locale/lang/es-es.js +46 -0
- package/es/locale/lang/fr-fr.js +46 -0
- package/es/locale/lang/id-id.js +46 -0
- package/es/locale/lang/it-it.js +46 -0
- package/es/locale/lang/km-kh.js +46 -0
- package/es/locale/lang/ko-kr.js +46 -0
- package/es/locale/lang/ms-my.js +46 -0
- package/es/locale/lang/pt-pt.js +46 -0
- package/es/locale/lang/th-th.js +46 -0
- package/es/locale/lang/vi-vn.js +46 -0
- package/es/mention/mention.js +2 -0
- package/es/menu/base-menu.vue.d.ts +1 -1
- package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +14 -14
- package/es/menu/item.d.ts +1 -1
- package/es/menu/menu.d.ts +12 -12
- package/es/menu/menu.js +3 -3
- package/es/menu/sub-menu-pop.vue_vue_type_script_setup_true_lang.js +3 -4
- package/es/modal/index.d.ts +22 -20
- package/es/modal/index.js +47 -11
- package/es/modal/interface.d.ts +5 -0
- package/es/modal/modal.vue.d.ts +4 -4
- package/es/popconfirm/index.d.ts +12 -12
- package/es/popover/index.d.ts +12 -12
- package/es/progress/index.d.ts +6 -6
- package/es/qr-code/index.d.ts +3 -3
- package/es/radio/radio.d.ts +3 -3
- package/es/resize-box/resize-box.vue.d.ts +4 -4
- package/es/resize-box/resize-box.vue_vue_type_script_setup_true_lang.js +7 -7
- package/es/result/index.d.ts +3 -3
- package/es/scrollbar/style/index.css +1 -1
- package/es/scrollbar/style/index.scss +4 -1
- package/es/sd-vue.js +3 -1
- package/es/select/select.d.ts +17 -17
- package/es/slider/index.d.ts +3 -3
- package/es/split/split.vue.d.ts +4 -4
- package/es/split/split.vue_vue_type_script_setup_true_lang.js +6 -6
- package/es/steps/index.d.ts +6 -6
- package/es/tabs/index.d.ts +6 -6
- package/es/tag/index.d.ts +6 -6
- package/es/tag/tag.vue.d.ts +2 -2
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +4 -4
- package/es/theme-provider/index.d.ts +9 -9
- package/es/time-picker/index.d.ts +6 -6
- package/es/time-picker/time-picker.vue.d.ts +2 -2
- package/es/timeline/index.d.ts +3 -3
- package/es/timeline/timeline.d.ts +1 -1
- package/es/tooltip/index.d.ts +3 -3
- package/es/tour/index.d.ts +3 -3
- package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +6 -6
- package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +6 -21
- package/es/tree/expand-transition.vue.d.ts +2 -2
- package/es/tree/node-switcher.vue.d.ts +1 -12
- package/es/tree/node-switcher.vue_vue_type_script_lang.js +1 -5
- package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +23 -23
- package/es/tree-select/tree-select.vue.d.ts +9 -9
- package/es/trigger/trigger.js +2 -1
- package/es/verification-code/verification-code.js +17 -7
- package/json/vetur-attributes.json +76 -156
- package/json/vetur-tags.json +26 -44
- package/json/web-types.json +150 -304
- package/package.json +5 -5
- package/es/_components/render-function.d.ts +0 -14
- package/es/_components/render-function.js +0 -14
- package/es/calendar/hooks/use-calendar-theme.d.ts +0 -4
- package/es/layout/utils.d.ts +0 -1
- package/es/layout/utils.js +0 -11
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { CascaderModelValue, CascaderOption } from './interface';
|
|
2
2
|
import type { CascaderProps } from './types';
|
|
3
|
-
declare var
|
|
3
|
+
declare var __VLS_19: any, __VLS_22: {}, __VLS_25: {}, __VLS_28: {}, __VLS_31: {}, __VLS_41: {}, __VLS_50: {};
|
|
4
4
|
type __VLS_Slots = {} & {
|
|
5
|
-
label?: (props: typeof
|
|
5
|
+
label?: (props: typeof __VLS_19) => any;
|
|
6
6
|
} & {
|
|
7
|
-
prefix?: (props: typeof
|
|
7
|
+
prefix?: (props: typeof __VLS_22) => any;
|
|
8
8
|
} & {
|
|
9
|
-
'arrow-icon'?: (props: typeof
|
|
9
|
+
'arrow-icon'?: (props: typeof __VLS_25) => any;
|
|
10
10
|
} & {
|
|
11
|
-
'loading-icon'?: (props: typeof
|
|
11
|
+
'loading-icon'?: (props: typeof __VLS_28) => any;
|
|
12
12
|
} & {
|
|
13
|
-
'search-icon'?: (props: typeof
|
|
13
|
+
'search-icon'?: (props: typeof __VLS_31) => any;
|
|
14
14
|
} & {
|
|
15
|
-
empty?: (props: typeof
|
|
15
|
+
empty?: (props: typeof __VLS_41) => any;
|
|
16
16
|
} & {
|
|
17
|
-
empty?: (props: typeof
|
|
17
|
+
empty?: (props: typeof __VLS_50) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<CascaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
20
|
search: (value: string) => any;
|
|
@@ -67,7 +67,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
67
67
|
type: StringConstructor;
|
|
68
68
|
};
|
|
69
69
|
size: {
|
|
70
|
-
type: PropType<import("../index.
|
|
70
|
+
type: PropType<import("../index.ts").Size>;
|
|
71
71
|
default: string;
|
|
72
72
|
};
|
|
73
73
|
disabled: {
|
|
@@ -93,7 +93,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
93
93
|
type: StringConstructor;
|
|
94
94
|
};
|
|
95
95
|
size: {
|
|
96
|
-
type: PropType<import("../index.
|
|
96
|
+
type: PropType<import("../index.ts").Size>;
|
|
97
97
|
default: string;
|
|
98
98
|
};
|
|
99
99
|
disabled: {
|
|
@@ -114,7 +114,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
114
114
|
type: StringConstructor;
|
|
115
115
|
};
|
|
116
116
|
size: {
|
|
117
|
-
type: PropType<import("../index.
|
|
117
|
+
type: PropType<import("../index.ts").Size>;
|
|
118
118
|
default: string;
|
|
119
119
|
};
|
|
120
120
|
disabled: {
|
|
@@ -37,7 +37,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
37
37
|
type: StringConstructor;
|
|
38
38
|
};
|
|
39
39
|
size: {
|
|
40
|
-
type: import("vue").PropType<import("../index.
|
|
40
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
41
41
|
default: string;
|
|
42
42
|
};
|
|
43
43
|
disabled: {
|
|
@@ -63,7 +63,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
63
63
|
type: StringConstructor;
|
|
64
64
|
};
|
|
65
65
|
size: {
|
|
66
|
-
type: import("vue").PropType<import("../index.
|
|
66
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
67
67
|
default: string;
|
|
68
68
|
};
|
|
69
69
|
disabled: {
|
|
@@ -84,7 +84,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
84
84
|
type: StringConstructor;
|
|
85
85
|
};
|
|
86
86
|
size: {
|
|
87
|
-
type: import("vue").PropType<import("../index.
|
|
87
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
88
88
|
default: string;
|
|
89
89
|
};
|
|
90
90
|
disabled: {
|
|
@@ -126,7 +126,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
126
126
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
127
127
|
click: (_ev: MouseEvent) => any;
|
|
128
128
|
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
129
|
-
install: (app: import("vue").App, options?: import("../_utils/types.
|
|
129
|
+
install: (app: import("vue").App, options?: import("../_utils/types.ts").SDIconOptions) => void;
|
|
130
130
|
};
|
|
131
131
|
IconCaretLeft: {
|
|
132
132
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("../icon/icon-caret-left/icon-caret-left.vue").Props> & Readonly<{
|
|
@@ -151,7 +151,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
151
151
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
152
152
|
click: (_ev: MouseEvent) => any;
|
|
153
153
|
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
154
|
-
install: (app: import("vue").App, options?: import("../_utils/types.
|
|
154
|
+
install: (app: import("vue").App, options?: import("../_utils/types.ts").SDIconOptions) => void;
|
|
155
155
|
};
|
|
156
156
|
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
157
157
|
export default _default;
|
package/es/collapse/index.d.ts
CHANGED
|
@@ -184,7 +184,7 @@ declare const Collapse: {
|
|
|
184
184
|
type: StringConstructor;
|
|
185
185
|
};
|
|
186
186
|
size: {
|
|
187
|
-
type: import("vue").PropType<import("
|
|
187
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
188
188
|
default: string;
|
|
189
189
|
};
|
|
190
190
|
disabled: {
|
|
@@ -210,7 +210,7 @@ declare const Collapse: {
|
|
|
210
210
|
type: StringConstructor;
|
|
211
211
|
};
|
|
212
212
|
size: {
|
|
213
|
-
type: import("vue").PropType<import("
|
|
213
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
214
214
|
default: string;
|
|
215
215
|
};
|
|
216
216
|
disabled: {
|
|
@@ -231,7 +231,7 @@ declare const Collapse: {
|
|
|
231
231
|
type: StringConstructor;
|
|
232
232
|
};
|
|
233
233
|
size: {
|
|
234
|
-
type: import("vue").PropType<import("
|
|
234
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
235
235
|
default: string;
|
|
236
236
|
};
|
|
237
237
|
disabled: {
|
package/es/components.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare module 'vue' {
|
|
|
13
13
|
SdAvatar: SDVue['Avatar'];
|
|
14
14
|
SdAvatarGroup: SDVue['AvatarGroup'];
|
|
15
15
|
SdBackTop: SDVue['BackTop'];
|
|
16
|
+
SdBorderBeam: SDVue['BorderBeam'];
|
|
16
17
|
SdBadge: SDVue['Badge'];
|
|
17
18
|
SdBreadcrumb: SDVue['Breadcrumb'];
|
|
18
19
|
SdBreadcrumbItem: SDVue['BreadcrumbItem'];
|
|
@@ -23,6 +23,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
23
23
|
type: BooleanConstructor;
|
|
24
24
|
default: boolean;
|
|
25
25
|
};
|
|
26
|
+
autoInsertSpaceInButton: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
26
30
|
allowSearch: {
|
|
27
31
|
type: BooleanConstructor;
|
|
28
32
|
default: boolean;
|
|
@@ -83,6 +87,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
83
87
|
type: BooleanConstructor;
|
|
84
88
|
default: boolean;
|
|
85
89
|
};
|
|
90
|
+
autoInsertSpaceInButton: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: boolean;
|
|
93
|
+
};
|
|
86
94
|
allowSearch: {
|
|
87
95
|
type: BooleanConstructor;
|
|
88
96
|
default: boolean;
|
|
@@ -137,6 +145,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
137
145
|
allowSearch: boolean;
|
|
138
146
|
exchangeTime: boolean;
|
|
139
147
|
global: boolean;
|
|
148
|
+
autoInsertSpaceInButton: boolean;
|
|
140
149
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
141
150
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
142
151
|
declare const _default: typeof __VLS_export;
|
|
@@ -35,6 +35,14 @@ var config_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
35
35
|
default: false
|
|
36
36
|
},
|
|
37
37
|
/**
|
|
38
|
+
* @zh 当按钮中是两个汉字时,自动在两个汉字中添加一个空格。
|
|
39
|
+
* @en When there are two Chinese characters in the button, a space is automatically added between two Chinese characters.
|
|
40
|
+
*/
|
|
41
|
+
autoInsertSpaceInButton: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
38
46
|
* @zh 是否默认开启搜索
|
|
39
47
|
* @en Whether to enable search by default
|
|
40
48
|
*/
|
|
@@ -138,13 +146,14 @@ var config_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
138
146
|
* @version 2.28.0
|
|
139
147
|
*/
|
|
140
148
|
const slots = useSlots();
|
|
141
|
-
const { prefixCls, locale, size, allowClear, allowSearch, virtualListProps, updateAtScroll, scrollToClose, exchangeTime, rtl, datePicker, modal, drawer } = toRefs(props);
|
|
149
|
+
const { prefixCls, locale, size, allowClear, autoInsertSpaceInButton, allowSearch, virtualListProps, updateAtScroll, scrollToClose, exchangeTime, rtl, datePicker, modal, drawer } = toRefs(props);
|
|
142
150
|
const config = reactive({
|
|
143
151
|
slots,
|
|
144
152
|
prefixCls,
|
|
145
153
|
locale,
|
|
146
154
|
size,
|
|
147
155
|
allowClear,
|
|
156
|
+
autoInsertSpaceInButton,
|
|
148
157
|
allowSearch,
|
|
149
158
|
virtualListProps,
|
|
150
159
|
updateAtScroll,
|
|
@@ -8,21 +8,25 @@ declare const ConfigProvider: {
|
|
|
8
8
|
default: string;
|
|
9
9
|
};
|
|
10
10
|
locale: {
|
|
11
|
-
type: import("vue").PropType<import("../locale/interface").SDLang>;
|
|
11
|
+
type: import("vue").PropType<import("../locale/interface.ts").SDLang>;
|
|
12
12
|
};
|
|
13
13
|
size: {
|
|
14
|
-
type: import("vue").PropType<import("
|
|
14
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
15
15
|
};
|
|
16
16
|
allowClear: {
|
|
17
17
|
type: BooleanConstructor;
|
|
18
18
|
default: boolean;
|
|
19
19
|
};
|
|
20
|
+
autoInsertSpaceInButton: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
20
24
|
allowSearch: {
|
|
21
25
|
type: BooleanConstructor;
|
|
22
26
|
default: boolean;
|
|
23
27
|
};
|
|
24
28
|
virtualListProps: {
|
|
25
|
-
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps>;
|
|
29
|
+
type: import("vue").PropType<import("../_components/virtual-list/interface.ts").VirtualListProps>;
|
|
26
30
|
};
|
|
27
31
|
global: {
|
|
28
32
|
type: BooleanConstructor;
|
|
@@ -45,16 +49,16 @@ declare const ConfigProvider: {
|
|
|
45
49
|
default: boolean;
|
|
46
50
|
};
|
|
47
51
|
datePicker: {
|
|
48
|
-
type: import("vue").PropType<import("./context").ConfigProviderDatePicker>;
|
|
52
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderDatePicker>;
|
|
49
53
|
};
|
|
50
54
|
modal: {
|
|
51
|
-
type: import("vue").PropType<import("./context").ConfigProviderModal>;
|
|
55
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderModal>;
|
|
52
56
|
};
|
|
53
57
|
drawer: {
|
|
54
|
-
type: import("vue").PropType<import("./context").ConfigProviderDrawer>;
|
|
58
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderDrawer>;
|
|
55
59
|
};
|
|
56
60
|
jsonForm: {
|
|
57
|
-
type: import("vue").PropType<import("./context").JsonFormProviderConfig>;
|
|
61
|
+
type: import("vue").PropType<import("./context.ts").JsonFormProviderConfig>;
|
|
58
62
|
};
|
|
59
63
|
theme: {
|
|
60
64
|
type: import("vue").PropType<import("./theme").SDThemeConfig>;
|
|
@@ -71,6 +75,7 @@ declare const ConfigProvider: {
|
|
|
71
75
|
allowSearch: boolean;
|
|
72
76
|
exchangeTime: boolean;
|
|
73
77
|
global: boolean;
|
|
78
|
+
autoInsertSpaceInButton: boolean;
|
|
74
79
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
75
80
|
P: {};
|
|
76
81
|
B: {};
|
|
@@ -84,21 +89,25 @@ declare const ConfigProvider: {
|
|
|
84
89
|
default: string;
|
|
85
90
|
};
|
|
86
91
|
locale: {
|
|
87
|
-
type: import("vue").PropType<import("../locale/interface").SDLang>;
|
|
92
|
+
type: import("vue").PropType<import("../locale/interface.ts").SDLang>;
|
|
88
93
|
};
|
|
89
94
|
size: {
|
|
90
|
-
type: import("vue").PropType<import("
|
|
95
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
91
96
|
};
|
|
92
97
|
allowClear: {
|
|
93
98
|
type: BooleanConstructor;
|
|
94
99
|
default: boolean;
|
|
95
100
|
};
|
|
101
|
+
autoInsertSpaceInButton: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
96
105
|
allowSearch: {
|
|
97
106
|
type: BooleanConstructor;
|
|
98
107
|
default: boolean;
|
|
99
108
|
};
|
|
100
109
|
virtualListProps: {
|
|
101
|
-
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps>;
|
|
110
|
+
type: import("vue").PropType<import("../_components/virtual-list/interface.ts").VirtualListProps>;
|
|
102
111
|
};
|
|
103
112
|
global: {
|
|
104
113
|
type: BooleanConstructor;
|
|
@@ -121,16 +130,16 @@ declare const ConfigProvider: {
|
|
|
121
130
|
default: boolean;
|
|
122
131
|
};
|
|
123
132
|
datePicker: {
|
|
124
|
-
type: import("vue").PropType<import("./context").ConfigProviderDatePicker>;
|
|
133
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderDatePicker>;
|
|
125
134
|
};
|
|
126
135
|
modal: {
|
|
127
|
-
type: import("vue").PropType<import("./context").ConfigProviderModal>;
|
|
136
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderModal>;
|
|
128
137
|
};
|
|
129
138
|
drawer: {
|
|
130
|
-
type: import("vue").PropType<import("./context").ConfigProviderDrawer>;
|
|
139
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderDrawer>;
|
|
131
140
|
};
|
|
132
141
|
jsonForm: {
|
|
133
|
-
type: import("vue").PropType<import("./context").JsonFormProviderConfig>;
|
|
142
|
+
type: import("vue").PropType<import("./context.ts").JsonFormProviderConfig>;
|
|
134
143
|
};
|
|
135
144
|
theme: {
|
|
136
145
|
type: import("vue").PropType<import("./theme").SDThemeConfig>;
|
|
@@ -147,6 +156,7 @@ declare const ConfigProvider: {
|
|
|
147
156
|
allowSearch: boolean;
|
|
148
157
|
exchangeTime: boolean;
|
|
149
158
|
global: boolean;
|
|
159
|
+
autoInsertSpaceInButton: boolean;
|
|
150
160
|
}>;
|
|
151
161
|
__isFragment?: never;
|
|
152
162
|
__isTeleport?: never;
|
|
@@ -157,21 +167,25 @@ declare const ConfigProvider: {
|
|
|
157
167
|
default: string;
|
|
158
168
|
};
|
|
159
169
|
locale: {
|
|
160
|
-
type: import("vue").PropType<import("../locale/interface").SDLang>;
|
|
170
|
+
type: import("vue").PropType<import("../locale/interface.ts").SDLang>;
|
|
161
171
|
};
|
|
162
172
|
size: {
|
|
163
|
-
type: import("vue").PropType<import("
|
|
173
|
+
type: import("vue").PropType<import("../index.ts").Size>;
|
|
164
174
|
};
|
|
165
175
|
allowClear: {
|
|
166
176
|
type: BooleanConstructor;
|
|
167
177
|
default: boolean;
|
|
168
178
|
};
|
|
179
|
+
autoInsertSpaceInButton: {
|
|
180
|
+
type: BooleanConstructor;
|
|
181
|
+
default: boolean;
|
|
182
|
+
};
|
|
169
183
|
allowSearch: {
|
|
170
184
|
type: BooleanConstructor;
|
|
171
185
|
default: boolean;
|
|
172
186
|
};
|
|
173
187
|
virtualListProps: {
|
|
174
|
-
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps>;
|
|
188
|
+
type: import("vue").PropType<import("../_components/virtual-list/interface.ts").VirtualListProps>;
|
|
175
189
|
};
|
|
176
190
|
global: {
|
|
177
191
|
type: BooleanConstructor;
|
|
@@ -194,16 +208,16 @@ declare const ConfigProvider: {
|
|
|
194
208
|
default: boolean;
|
|
195
209
|
};
|
|
196
210
|
datePicker: {
|
|
197
|
-
type: import("vue").PropType<import("./context").ConfigProviderDatePicker>;
|
|
211
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderDatePicker>;
|
|
198
212
|
};
|
|
199
213
|
modal: {
|
|
200
|
-
type: import("vue").PropType<import("./context").ConfigProviderModal>;
|
|
214
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderModal>;
|
|
201
215
|
};
|
|
202
216
|
drawer: {
|
|
203
|
-
type: import("vue").PropType<import("./context").ConfigProviderDrawer>;
|
|
217
|
+
type: import("vue").PropType<import("./context.ts").ConfigProviderDrawer>;
|
|
204
218
|
};
|
|
205
219
|
jsonForm: {
|
|
206
|
-
type: import("vue").PropType<import("./context").JsonFormProviderConfig>;
|
|
220
|
+
type: import("vue").PropType<import("./context.ts").JsonFormProviderConfig>;
|
|
207
221
|
};
|
|
208
222
|
theme: {
|
|
209
223
|
type: import("vue").PropType<import("./theme").SDThemeConfig>;
|
|
@@ -220,6 +234,7 @@ declare const ConfigProvider: {
|
|
|
220
234
|
allowSearch: boolean;
|
|
221
235
|
exchangeTime: boolean;
|
|
222
236
|
global: boolean;
|
|
237
|
+
autoInsertSpaceInButton: boolean;
|
|
223
238
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
224
239
|
$slots: {
|
|
225
240
|
default?: (props: {}) => any;
|
|
@@ -6,6 +6,7 @@ interface CellClassNameProps {
|
|
|
6
6
|
rangeValues?: Array<Dayjs | undefined>;
|
|
7
7
|
isSameTime: IsSameTime;
|
|
8
8
|
mode?: Mode;
|
|
9
|
+
now?: Dayjs;
|
|
9
10
|
}
|
|
10
11
|
export default function useCellClassName(props: CellClassNameProps): {
|
|
11
12
|
getCellClassName: (cellData: Cell, disabled: boolean) => (string | {
|
|
@@ -17,8 +17,9 @@ function useCellClassName(props) {
|
|
|
17
17
|
const { value, isSameTime, mode, prefixCls } = props;
|
|
18
18
|
const isInView = !cellData.isPrev && !cellData.isNext;
|
|
19
19
|
const isSelected = value && isSameTime(cellData.value, value);
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const currentNow = props.now || getNow();
|
|
21
|
+
let isToday = isSameTime(cellData.value, currentNow);
|
|
22
|
+
if (mode === "week") isToday = currentNow.isSame(cellData.value, "date");
|
|
22
23
|
const isRangeStart = isInView && rangeStart.value && isSameTime(cellData.value, rangeStart.value);
|
|
23
24
|
const isRangeEnd = isInView && rangeEnd.value && isSameTime(cellData.value, rangeEnd.value);
|
|
24
25
|
const isInRange = isInView && rangeStart.value && rangeEnd.value && (isRangeStart || isRangeEnd || cellData.value.isBetween(rangeStart.value, rangeEnd.value, null, "[]"));
|
|
@@ -3,16 +3,17 @@ import usePanelSpan from "./use-panel-span.js";
|
|
|
3
3
|
import { computed, reactive, ref, toRefs, watch } from "vue";
|
|
4
4
|
//#region components/date-picker/hooks/use-header-value.ts
|
|
5
5
|
function useHeaderValue(props) {
|
|
6
|
-
const { mode, value, defaultValue, selectedValue, format, onChange } = toRefs(props);
|
|
6
|
+
const { mode, value, defaultValue, selectedValue, format, utcOffset, timezone, onChange } = toRefs(props);
|
|
7
7
|
const computedMode = computed(() => (mode === null || mode === void 0 ? void 0 : mode.value) || "date");
|
|
8
|
+
const MIN_YEAR = 0;
|
|
8
9
|
const { span, superSpan } = usePanelSpan(reactive({ mode: computedMode }));
|
|
9
10
|
const isSame = (current, target) => {
|
|
10
11
|
const unit = computedMode.value === "date" || computedMode.value === "week" ? "M" : "y";
|
|
11
12
|
return current.isSame(target, unit);
|
|
12
13
|
};
|
|
13
|
-
const computedValue = computed(() => getDayjsValue(value === null || value === void 0 ? void 0 : value.value, format.value));
|
|
14
|
-
const computedDefaultValue = computed(() => getDayjsValue(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value, format.value));
|
|
15
|
-
const localValue = ref(computedDefaultValue.value || getNow());
|
|
14
|
+
const computedValue = computed(() => getDayjsValue(value === null || value === void 0 ? void 0 : value.value, format.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value));
|
|
15
|
+
const computedDefaultValue = computed(() => getDayjsValue(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value, format.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value));
|
|
16
|
+
const localValue = ref(computedDefaultValue.value || getNow(utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value));
|
|
16
17
|
const headerValue = computed(() => computedValue.value || localValue.value);
|
|
17
18
|
const setLocalValue = (newVal) => {
|
|
18
19
|
if (!newVal) return;
|
|
@@ -31,7 +32,7 @@ function useHeaderValue(props) {
|
|
|
31
32
|
setHeaderValue(newVal);
|
|
32
33
|
});
|
|
33
34
|
function getDefaultLocalValue() {
|
|
34
|
-
return (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) || computedDefaultValue.value || getNow();
|
|
35
|
+
return (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) || computedDefaultValue.value || getNow(utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value);
|
|
35
36
|
}
|
|
36
37
|
function resetHeaderValue(emitChange = true) {
|
|
37
38
|
const defaultLocalValue = getDefaultLocalValue();
|
|
@@ -39,23 +40,26 @@ function useHeaderValue(props) {
|
|
|
39
40
|
else setLocalValue(defaultLocalValue);
|
|
40
41
|
}
|
|
41
42
|
const showSingleBtn = computed(() => span.value !== superSpan.value);
|
|
43
|
+
const canMovePrev = (months) => methods.subtract(headerValue.value, months, "M").year() >= MIN_YEAR;
|
|
42
44
|
return {
|
|
43
45
|
headerValue,
|
|
44
46
|
setHeaderValue,
|
|
45
|
-
headerOperations: computed(() =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
headerOperations: computed(() => {
|
|
48
|
+
return {
|
|
49
|
+
onSuperPrev: canMovePrev(superSpan.value) ? () => {
|
|
50
|
+
setHeaderValue(methods.subtract(headerValue.value, superSpan.value, "M"));
|
|
51
|
+
} : void 0,
|
|
52
|
+
onPrev: showSingleBtn.value && canMovePrev(span.value) ? () => {
|
|
53
|
+
setHeaderValue(methods.subtract(headerValue.value, span.value, "M"));
|
|
54
|
+
} : void 0,
|
|
55
|
+
onNext: showSingleBtn.value ? () => {
|
|
56
|
+
setHeaderValue(methods.add(headerValue.value, span.value, "M"));
|
|
57
|
+
} : void 0,
|
|
58
|
+
onSuperNext: () => {
|
|
59
|
+
setHeaderValue(methods.add(headerValue.value, superSpan.value, "M"));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
59
63
|
resetHeaderValue,
|
|
60
64
|
getDefaultLocalValue
|
|
61
65
|
};
|
|
@@ -4,6 +4,8 @@ interface PickerStateProps {
|
|
|
4
4
|
modelValue: CalendarValue | undefined;
|
|
5
5
|
defaultValue: CalendarValue | undefined;
|
|
6
6
|
format: string;
|
|
7
|
+
utcOffset?: number;
|
|
8
|
+
timezone?: string;
|
|
7
9
|
}
|
|
8
10
|
export default function usePickerState(props: PickerStateProps): {
|
|
9
11
|
value: import("vue").ComputedRef<Dayjs | undefined>;
|
|
@@ -4,12 +4,12 @@ import { getDayjsValue } from "../../_utils/date.js";
|
|
|
4
4
|
import { computed, toRefs, watch } from "vue";
|
|
5
5
|
//#region components/date-picker/hooks/use-picker-state.ts
|
|
6
6
|
function usePickerState(props) {
|
|
7
|
-
const { modelValue, defaultValue, format } = toRefs(props);
|
|
7
|
+
const { modelValue, defaultValue, format, utcOffset, timezone } = toRefs(props);
|
|
8
8
|
const computedModelValue = computed(() => {
|
|
9
|
-
return getDayjsValue(modelValue.value, format.value);
|
|
9
|
+
return getDayjsValue(modelValue.value, format.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value);
|
|
10
10
|
});
|
|
11
11
|
const computedDefaultValue = computed(() => {
|
|
12
|
-
return getDayjsValue(defaultValue.value, format.value);
|
|
12
|
+
return getDayjsValue(defaultValue.value, format.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value);
|
|
13
13
|
});
|
|
14
14
|
const [localValue, setLocalValue] = useState(!isUndefined(computedModelValue.value) ? computedModelValue.value : !isUndefined(computedDefaultValue.value) ? computedDefaultValue.value : void 0);
|
|
15
15
|
watch(computedModelValue, () => {
|
|
@@ -8,6 +8,8 @@ interface RangeHeaderValueProps {
|
|
|
8
8
|
defaultValue: CalendarValue[] | undefined;
|
|
9
9
|
selectedValue: (Dayjs | undefined)[];
|
|
10
10
|
format: string;
|
|
11
|
+
utcOffset?: number;
|
|
12
|
+
timezone?: string;
|
|
11
13
|
onChange?: (newVal: Dayjs[]) => void;
|
|
12
14
|
}
|
|
13
15
|
export default function useRangeHeaderValue(props: RangeHeaderValueProps): {
|
|
@@ -5,7 +5,7 @@ import useHeaderValue from "./use-header-value.js";
|
|
|
5
5
|
import { computed, nextTick, reactive, toRefs } from "vue";
|
|
6
6
|
//#region components/date-picker/hooks/use-range-header-value.ts
|
|
7
7
|
function useRangeHeaderValue(props) {
|
|
8
|
-
const { startHeaderMode, endHeaderMode, mode, value, defaultValue, selectedValue, format, onChange } = toRefs(props);
|
|
8
|
+
const { startHeaderMode, endHeaderMode, mode, value, defaultValue, selectedValue, format, utcOffset, timezone, onChange } = toRefs(props);
|
|
9
9
|
const isDateOrWeek = computed(() => ["date", "week"].includes(mode.value));
|
|
10
10
|
const unit = computed(() => isDateOrWeek.value ? "M" : "y");
|
|
11
11
|
const isSame = (current, target) => current.isSame(target, unit.value);
|
|
@@ -37,6 +37,8 @@ function useRangeHeaderValue(props) {
|
|
|
37
37
|
defaultValue: startDefaultValue,
|
|
38
38
|
selectedValue: void 0,
|
|
39
39
|
format,
|
|
40
|
+
utcOffset,
|
|
41
|
+
timezone,
|
|
40
42
|
onChange: (newVal) => {
|
|
41
43
|
emitChange([newVal, endHeaderValue.value]);
|
|
42
44
|
}
|
|
@@ -47,6 +49,8 @@ function useRangeHeaderValue(props) {
|
|
|
47
49
|
defaultValue: endDefaultValue,
|
|
48
50
|
selectedValue: void 0,
|
|
49
51
|
format,
|
|
52
|
+
utcOffset,
|
|
53
|
+
timezone,
|
|
50
54
|
onChange: (newVal) => {
|
|
51
55
|
emitChange([startHeaderValue.value, newVal]);
|
|
52
56
|
}
|
|
@@ -4,6 +4,8 @@ interface PickerStateProps {
|
|
|
4
4
|
modelValue: (CalendarValue | undefined)[] | undefined;
|
|
5
5
|
defaultValue: (CalendarValue | undefined)[] | undefined;
|
|
6
6
|
format: string;
|
|
7
|
+
utcOffset?: number;
|
|
8
|
+
timezone?: string;
|
|
7
9
|
}
|
|
8
10
|
export default function useRangePickerState(props: PickerStateProps): {
|
|
9
11
|
value: import("vue").ComputedRef<(Dayjs | undefined)[]>;
|
|
@@ -5,12 +5,12 @@ import { normalizeRangeValue } from "../utils/index.js";
|
|
|
5
5
|
import { computed, toRefs, watch } from "vue";
|
|
6
6
|
//#region components/date-picker/hooks/use-range-picker-state.ts
|
|
7
7
|
function useRangePickerState(props) {
|
|
8
|
-
const { modelValue, defaultValue, format } = toRefs(props);
|
|
8
|
+
const { modelValue, defaultValue, format, utcOffset, timezone } = toRefs(props);
|
|
9
9
|
const computedModelValue = computed(() => {
|
|
10
|
-
return getDayjsValue(normalizeRangeValue(modelValue.value), format.value);
|
|
10
|
+
return getDayjsValue(normalizeRangeValue(modelValue.value), format.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value);
|
|
11
11
|
});
|
|
12
12
|
const computedDefaultValue = computed(() => {
|
|
13
|
-
return getDayjsValue(normalizeRangeValue(defaultValue.value), format.value);
|
|
13
|
+
return getDayjsValue(normalizeRangeValue(defaultValue.value), format.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value);
|
|
14
14
|
});
|
|
15
15
|
const [localValue, setLocalValue] = useState(!isUndefined(computedModelValue.value) ? computedModelValue.value : !isUndefined(computedDefaultValue.value) ? computedDefaultValue.value : []);
|
|
16
16
|
watch(computedModelValue, () => {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
2
|
import { CalendarValue, ValueFormat } from '../interface';
|
|
3
|
-
export declare function getReturnValue(date: Dayjs, format: ValueFormat): string | number | Date;
|
|
3
|
+
export declare function getReturnValue(date: Dayjs, format: ValueFormat, utcOffset?: number, timezone?: string): string | number | Date;
|
|
4
4
|
export declare function useReturnValue(props: {
|
|
5
5
|
format: ValueFormat;
|
|
6
|
+
utcOffset?: number;
|
|
7
|
+
timezone?: string;
|
|
6
8
|
}): (date: Dayjs) => string | number | Date;
|
|
7
|
-
export declare function getReturnRangeValue(dates: Dayjs[], format: ValueFormat): CalendarValue[];
|
|
8
|
-
export declare function getReturnRangeValue(dates: (Dayjs | undefined)[], format: ValueFormat): (CalendarValue | undefined)[];
|
|
9
|
+
export declare function getReturnRangeValue(dates: Dayjs[], format: ValueFormat, utcOffset?: number, timezone?: string): CalendarValue[];
|
|
10
|
+
export declare function getReturnRangeValue(dates: (Dayjs | undefined)[], format: ValueFormat, utcOffset?: number, timezone?: string): (CalendarValue | undefined)[];
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { toLocal } from "../../_utils/date.js";
|
|
1
2
|
import { toRefs } from "vue";
|
|
2
3
|
//#region components/date-picker/hooks/use-value-format.ts
|
|
3
|
-
function getReturnValue(date, format) {
|
|
4
|
-
|
|
5
|
-
if (format === "
|
|
6
|
-
return
|
|
4
|
+
function getReturnValue(date, format, utcOffset, timezone) {
|
|
5
|
+
const localDate = toLocal(date, utcOffset, timezone);
|
|
6
|
+
if (format === "timestamp") return localDate.toDate().getTime();
|
|
7
|
+
if (format === "Date") return localDate.toDate();
|
|
8
|
+
return localDate.format(format);
|
|
7
9
|
}
|
|
8
10
|
function useReturnValue(props) {
|
|
9
|
-
const { format } = toRefs(props);
|
|
10
|
-
return (date) => getReturnValue(date, format.value);
|
|
11
|
+
const { format, utcOffset, timezone } = toRefs(props);
|
|
12
|
+
return (date) => getReturnValue(date, format.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value);
|
|
11
13
|
}
|
|
12
|
-
function getReturnRangeValue(dates, format) {
|
|
13
|
-
return dates.map((date) => date ? getReturnValue(date, format) : void 0);
|
|
14
|
+
function getReturnRangeValue(dates, format, utcOffset, timezone) {
|
|
15
|
+
return dates.map((date) => date ? getReturnValue(date, format, utcOffset, timezone) : void 0);
|
|
14
16
|
}
|
|
15
17
|
//#endregion
|
|
16
18
|
export { getReturnRangeValue, useReturnValue };
|