@sdata/web-vue 3.12.0 → 3.14.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/dist/sd.css +288 -126
- package/dist/sd.min.css +43 -1
- package/es/_components/input-label/input-label.d.ts +2 -0
- package/es/_components/input-label/input-label.js +4 -2
- package/es/_components/input-label/style/index.css +2 -2
- package/es/_components/picker/input-range.vue.d.ts +6 -7
- package/es/_components/picker/input-range.vue_vue_type_script_setup_true_lang.js +63 -46
- package/es/_components/picker/input.vue.d.ts +5 -6
- package/es/_components/picker/input.vue_vue_type_script_setup_true_lang.js +52 -35
- package/es/_components/picker/style/index.scss +8 -2
- package/es/_components/resize-observer.js +1 -1
- package/es/_components/resize-trigger.vue_vue_type_script_setup_true_lang.js +9 -2
- package/es/_components/select-view/select-view.d.ts +2 -0
- package/es/_components/select-view/select-view.js +5 -1
- package/es/_components/select-view/style/index.css +5 -5
- package/es/_hooks/use-focus-trap.d.ts +10 -0
- package/es/_hooks/use-focus-trap.js +115 -0
- package/es/_hooks/use-readonly-tip.d.ts +11 -0
- package/es/_hooks/use-readonly-tip.js +66 -0
- package/es/_utils/dom.js +1 -10
- package/es/_utils/keyboard.d.ts +4 -0
- package/es/_utils/keyboard.js +21 -2
- package/es/alert/alert.vue.d.ts +2 -2
- package/es/alert/alert.vue_vue_type_script_setup_true_lang.js +12 -3
- package/es/alert/index.d.ts +5 -5
- package/es/alert/style/index.css +1 -1
- package/es/alert/style/index.scss +1 -1
- package/es/anchor/anchor-link.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +2 -0
- package/es/anchor/style/index.css +1 -1
- package/es/anchor/style/index.scss +3 -1
- package/es/auto-complete/auto-complete.d.ts +9 -0
- package/es/auto-complete/auto-complete.js +19 -1
- package/es/auto-complete/index.d.ts +15 -0
- package/es/avatar/avatar.vue_vue_type_script_setup_true_lang.js +8 -2
- package/es/avatar/style/index.css +2 -2
- package/es/avatar/style/index.scss +2 -2
- package/es/back-top/back-top.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/back-top/style/index.css +1 -1
- package/es/back-top/style/index.scss +2 -1
- package/es/badge/badge.js +4 -1
- package/es/badge/style/index.css +3 -3
- package/es/badge/style/index.scss +3 -3
- package/es/breadcrumb/breadcrumb.js +1 -0
- package/es/button/button.vue.d.ts +16 -7
- package/es/button/button.vue_vue_type_script_setup_true_lang.js +62 -31
- package/es/button/index.d.ts +11 -0
- package/es/button/interface.d.ts +2 -0
- package/es/button/style/index.css +15 -6
- package/es/button/style/index.scss +25 -7
- package/es/calendar/style/event.scss +2 -2
- package/es/calendar/style/index.css +2 -2
- package/es/card/card.d.ts +312 -0
- package/es/card/card.js +39 -7
- package/es/card/index.d.ts +616 -0
- package/es/card/style/index.css +26 -3
- package/es/card/style/index.scss +34 -3
- package/es/carousel/carousel-arrow.vue.d.ts +4 -4
- package/es/carousel/carousel-arrow.vue_vue_type_script_setup_true_lang.js +20 -4
- package/es/carousel/carousel-indicator.vue_vue_type_script_setup_true_lang.js +23 -4
- package/es/carousel/carousel-item.vue_vue_type_script_setup_true_lang.js +8 -1
- package/es/carousel/carousel.js +18 -1
- package/es/carousel/style/index.css +1 -1
- package/es/carousel/style/index.scss +1 -1
- package/es/cascader/cascader.vue.d.ts +9 -8
- package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +158 -128
- package/es/cascader/style/index.css +2 -2
- package/es/cascader/style/index.scss +3 -1
- package/es/cascader/types.d.ts +1 -0
- package/es/checkbox/checkbox-group.js +4 -1
- package/es/checkbox/checkbox.d.ts +9 -0
- package/es/checkbox/checkbox.js +14 -0
- package/es/checkbox/index.d.ts +15 -0
- package/es/checkbox/style/index.css +1 -1
- package/es/checkbox/style/index.scss +1 -1
- package/es/collapse/collapse-item.js +21 -3
- package/es/collapse/context.d.ts +1 -1
- package/es/color-picker/color-picker.d.ts +9 -0
- package/es/color-picker/color-picker.js +39 -11
- package/es/color-picker/index.d.ts +15 -0
- package/es/config-provider/context.d.ts +9 -9
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +11 -3
- package/es/date-picker/index.d.ts +3 -6
- package/es/date-picker/panels/body.vue_vue_type_script_setup_true_lang.js +14 -1
- package/es/date-picker/picker.vue.d.ts +2 -3
- package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +6 -5
- package/es/date-picker/range-picker.vue.d.ts +2 -3
- package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +4 -4
- package/es/date-picker/style/index.css +5 -5
- package/es/date-picker/style/index.scss +4 -3
- package/es/drawer/drawer.vue.d.ts +1 -1
- package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +30 -9
- package/es/drawer/index.d.ts +3 -3
- package/es/dropdown/dropdown-option.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/dropdown/dropdown-panel.vue.d.ts +9 -0
- package/es/dropdown/dropdown-panel.vue_vue_type_script_setup_true_lang.js +75 -2
- package/es/dropdown/dropdown-submenu.vue_vue_type_script_setup_true_lang.js +5 -2
- package/es/dropdown/dropdown.vue_vue_type_script_setup_true_lang.js +4 -2
- package/es/dropdown/style/index.css +1 -1
- package/es/dropdown/style/index.scss +3 -1
- package/es/empty/empty.js +1 -1
- package/es/file-previewer/file-previewer.vue.d.ts +1 -1
- package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +7 -3
- package/es/file-previewer/index.d.ts +3 -3
- package/es/form/context.d.ts +1 -0
- package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +6 -2
- package/es/form/style/index.css +2 -2
- package/es/form/style/index.scss +2 -2
- package/es/image/image.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/preview-action.d.ts +7 -127
- package/es/image/preview.vue.d.ts +1 -1
- package/es/image/preview.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/index.css +288 -126
- package/es/index.js +3 -3
- package/es/input/index.d.ts +6 -6
- package/es/input/input.d.ts +3 -3
- package/es/input/input.js +34 -8
- package/es/input/style/index.css +2 -2
- package/es/input/style/input.scss +4 -4
- package/es/input-number/index.d.ts +9 -9
- package/es/input-number/input-number.d.ts +5 -5
- package/es/input-number/input-number.js +13 -9
- package/es/input-number/style/index.css +3 -3
- package/es/input-number/style/index.scss +5 -1
- package/es/input-tag/index.d.ts +9 -6
- package/es/input-tag/input-tag.d.ts +5 -3
- package/es/input-tag/input-tag.js +49 -36
- package/es/input-tag/style/index.css +8 -8
- package/es/input-tag/style/index.scss +11 -5
- package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +31 -6
- package/es/layout/style/index.css +2 -2
- package/es/layout/style/index.scss +4 -2
- package/es/link/style/index.css +1 -1
- package/es/link/style/index.scss +3 -1
- package/es/locale/interface.d.ts +1 -0
- package/es/locale/lang/en-us.js +1 -0
- package/es/locale/lang/zh-cn.js +1 -0
- package/es/locale/lang/zh-tw.js +1 -0
- package/es/mention/index.d.ts +15 -0
- package/es/mention/mention.d.ts +9 -0
- package/es/mention/mention.js +20 -1
- package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +30 -4
- package/es/menu/item.js +14 -1
- package/es/menu/style/index.css +6 -6
- package/es/menu/style/index.scss +5 -3
- package/es/message/style/index.css +3 -3
- package/es/message/style/index.scss +5 -3
- package/es/modal/index.d.ts +3 -3
- package/es/modal/modal.vue.d.ts +1 -1
- package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +30 -15
- package/es/modal/style/index.css +2 -2
- package/es/modal/style/index.scss +3 -2
- package/es/notification/style/index.css +3 -3
- package/es/notification/style/index.scss +11 -3
- package/es/page-header/page-header.vue.d.ts +6 -6
- package/es/page-header/page-header.vue_vue_type_script_setup_true_lang.js +12 -1
- package/es/pagination/page-item-ellipsis.vue_vue_type_script_setup_true_lang.js +12 -2
- package/es/pagination/page-item-step.vue.d.ts +2 -2
- package/es/pagination/page-item-step.vue_vue_type_script_setup_true_lang.js +19 -2
- package/es/pagination/page-item.vue.d.ts +2 -2
- package/es/pagination/page-item.vue_vue_type_script_setup_true_lang.js +21 -3
- package/es/pagination/pagination.js +6 -2
- package/es/pagination/style/index.css +6 -1
- package/es/pagination/style/index.scss +9 -3
- package/es/popconfirm/popconfirm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/es/popover/popover.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/progress/style/index.css +2 -2
- package/es/progress/style/index.scss +5 -3
- package/es/qr-code/qr-code-status.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +11 -6
- package/es/radio/context.d.ts +1 -0
- package/es/radio/radio-group.js +6 -2
- package/es/radio/radio.js +1 -0
- package/es/radio/style/index.css +2 -2
- package/es/radio/style/index.scss +4 -2
- package/es/rate/index.d.ts +6 -6
- package/es/rate/rate.d.ts +3 -3
- package/es/rate/rate.js +42 -8
- 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 +30 -1
- package/es/result/result.vue_vue_type_script_setup_true_lang.js +7 -4
- package/es/scrollbar/style/index.css +57 -15
- package/es/scrollbar/style/index.scss +63 -15
- package/es/sd-vue.js +3 -3
- package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/select/index.d.ts +139 -0
- package/es/select/select-dropdown.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/select/select.d.ts +71 -0
- package/es/select/select.js +45 -6
- package/es/select/style/index.css +1 -1
- package/es/select/style/index.scss +3 -1
- package/es/selectable-card/style/index.css +2 -2
- package/es/selectable-card/style/index.scss +5 -5
- package/es/skeleton/skeleton.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/slider/slider-button.vue.d.ts +2 -0
- package/es/slider/slider-button.vue_vue_type_script_setup_true_lang.js +7 -2
- package/es/slider/slider.vue_vue_type_script_setup_true_lang.js +23 -2
- package/es/slider/style/index.css +1 -1
- package/es/slider/style/index.scss +3 -1
- package/es/spin/spin.js +7 -2
- package/es/spin/style/index.css +1 -1
- package/es/spin/style/index.scss +1 -1
- package/es/split/split.vue.d.ts +4 -4
- package/es/split/split.vue_vue_type_script_setup_true_lang.js +27 -3
- package/es/steps/context.d.ts +1 -0
- package/es/steps/step.vue_vue_type_script_setup_true_lang.js +15 -2
- package/es/steps/steps.vue_vue_type_script_setup_true_lang.js +6 -1
- package/es/steps/style/index.css +1 -1
- package/es/steps/style/index.scss +1 -1
- package/es/style/animation/index.scss +1 -0
- package/es/style/animation/reduced-motion.scss +22 -0
- package/es/style/animation/zoom.scss +7 -6
- package/es/style/icon.scss +9 -1
- package/es/style/normalize.scss +68 -0
- package/es/switch/style/index.css +1 -1
- package/es/switch/style/index.scss +4 -1
- package/es/switch/switch.vue_vue_type_script_setup_true_lang.js +6 -1
- package/es/table/style/index.css +8 -8
- package/es/table/style/index.scss +11 -8
- package/es/table/table-operation-td.d.ts +15 -0
- package/es/table/table-tbody.js +4 -1
- package/es/table/table-td.js +2 -1
- package/es/table/table-th.js +6 -4
- package/es/table/table-thead.js +4 -1
- package/es/table/table-tr.js +4 -1
- package/es/table/table.js +6 -2
- package/es/tabs/context.d.ts +3 -0
- package/es/tabs/index.d.ts +32 -0
- package/es/tabs/style/index.css +34 -5
- package/es/tabs/style/index.scss +45 -7
- package/es/tabs/tab-pane.vue.d.ts +4 -2
- package/es/tabs/tab-pane.vue_vue_type_script_setup_true_lang.js +39 -4
- package/es/tabs/tabs-nav.js +34 -1
- package/es/tabs/tabs-tab.vue_vue_type_script_setup_true_lang.js +27 -4
- package/es/tabs/tabs.d.ts +19 -0
- package/es/tabs/tabs.js +25 -2
- package/es/tag/index.d.ts +5 -5
- package/es/tag/style/index.css +1 -1
- package/es/tag/style/index.scss +3 -1
- package/es/tag/tag.vue.d.ts +2 -2
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +19 -2
- package/es/textarea/index.d.ts +15 -0
- package/es/textarea/style/index.css +2 -2
- package/es/textarea/textarea.vue.d.ts +11 -2
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +84 -47
- package/es/time-picker/index.d.ts +3 -6
- package/es/time-picker/panel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/time-picker/time-column.vue_vue_type_script_setup_true_lang.js +11 -3
- package/es/time-picker/time-picker.vue.d.ts +2 -3
- package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +12 -6
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/tooltip/index.d.ts +8 -127
- package/es/tooltip/interface.d.ts +17 -0
- package/es/tooltip/tooltip.vue.d.ts +5 -88
- package/es/tooltip/tooltip.vue_vue_type_script_setup_true_lang.js +9 -69
- package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/transfer/style/index.css +1 -1
- package/es/transfer/style/index.scss +1 -1
- package/es/transfer/transfer-list-item.js +16 -2
- package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +27 -7
- package/es/tree/context.d.ts +2 -0
- package/es/tree/style/index.css +1 -1
- package/es/tree/style/index.scss +1 -1
- package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +82 -3
- package/es/tree-select/tree-select.vue.d.ts +16 -10
- package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +165 -133
- package/es/trigger/index.d.ts +45 -0
- package/es/trigger/trigger.d.ts +27 -0
- package/es/trigger/trigger.js +47 -5
- package/es/typography/base.js +1 -1
- package/es/typography/edit-content.vue_vue_type_script_setup_true_lang.js +11 -8
- package/es/typography/operations.vue_vue_type_script_setup_true_lang.js +38 -6
- package/es/typography/style/index.css +2 -2
- package/es/typography/style/index.scss +2 -2
- package/es/upload/style/index.css +9 -9
- package/es/upload/style/index.scss +15 -9
- package/es/upload/upload-button.js +1 -1
- package/es/upload/upload-list-item.js +18 -5
- package/es/upload/upload-picture-item.js +25 -3
- package/es/verification-code/index.d.ts +15 -6
- package/es/verification-code/verification-code.d.ts +9 -3
- package/es/verification-code/verification-code.js +10 -2
- package/json/vetur-attributes.json +63 -7
- package/json/vetur-tags.json +23 -7
- package/json/web-types.json +131 -10
- package/package.json +1 -1
- package/es/style/base.scss +0 -18
package/es/tabs/index.d.ts
CHANGED
|
@@ -71,6 +71,14 @@ declare const Tabs: {
|
|
|
71
71
|
type: import("vue").PropType<import("./interface").ScrollPosition>;
|
|
72
72
|
default: string;
|
|
73
73
|
};
|
|
74
|
+
fullHeight: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
scrollbar: {
|
|
79
|
+
type: import("vue").PropType<boolean | import("../index.ts").ScrollbarProps>;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
74
82
|
}>> & Readonly<{
|
|
75
83
|
onDelete?: ((_key: string | number, _ev: Event) => any) | undefined;
|
|
76
84
|
onAdd?: ((_ev: Event) => any) | undefined;
|
|
@@ -88,9 +96,11 @@ declare const Tabs: {
|
|
|
88
96
|
trigger: import("./interface").TabTriggerEvent;
|
|
89
97
|
position: import("./interface").TabsPosition;
|
|
90
98
|
direction: "horizontal" | "vertical";
|
|
99
|
+
scrollbar: boolean | import("../index.ts").ScrollbarProps;
|
|
91
100
|
activeKey: string | number;
|
|
92
101
|
animation: boolean;
|
|
93
102
|
justify: boolean;
|
|
103
|
+
fullHeight: boolean;
|
|
94
104
|
destroyOnHide: boolean;
|
|
95
105
|
defaultActiveKey: string | number;
|
|
96
106
|
editable: boolean;
|
|
@@ -175,6 +185,14 @@ declare const Tabs: {
|
|
|
175
185
|
type: import("vue").PropType<import("./interface").ScrollPosition>;
|
|
176
186
|
default: string;
|
|
177
187
|
};
|
|
188
|
+
fullHeight: {
|
|
189
|
+
type: BooleanConstructor;
|
|
190
|
+
default: boolean;
|
|
191
|
+
};
|
|
192
|
+
scrollbar: {
|
|
193
|
+
type: import("vue").PropType<boolean | import("../index.ts").ScrollbarProps>;
|
|
194
|
+
default: boolean;
|
|
195
|
+
};
|
|
178
196
|
}>> & Readonly<{
|
|
179
197
|
onDelete?: ((_key: string | number, _ev: Event) => any) | undefined;
|
|
180
198
|
onAdd?: ((_ev: Event) => any) | undefined;
|
|
@@ -186,9 +204,11 @@ declare const Tabs: {
|
|
|
186
204
|
trigger: import("./interface").TabTriggerEvent;
|
|
187
205
|
position: import("./interface").TabsPosition;
|
|
188
206
|
direction: "horizontal" | "vertical";
|
|
207
|
+
scrollbar: boolean | import("../index.ts").ScrollbarProps;
|
|
189
208
|
activeKey: string | number;
|
|
190
209
|
animation: boolean;
|
|
191
210
|
justify: boolean;
|
|
211
|
+
fullHeight: boolean;
|
|
192
212
|
destroyOnHide: boolean;
|
|
193
213
|
defaultActiveKey: string | number;
|
|
194
214
|
editable: boolean;
|
|
@@ -270,6 +290,14 @@ declare const Tabs: {
|
|
|
270
290
|
type: import("vue").PropType<import("./interface").ScrollPosition>;
|
|
271
291
|
default: string;
|
|
272
292
|
};
|
|
293
|
+
fullHeight: {
|
|
294
|
+
type: BooleanConstructor;
|
|
295
|
+
default: boolean;
|
|
296
|
+
};
|
|
297
|
+
scrollbar: {
|
|
298
|
+
type: import("vue").PropType<boolean | import("../index.ts").ScrollbarProps>;
|
|
299
|
+
default: boolean;
|
|
300
|
+
};
|
|
273
301
|
}>> & Readonly<{
|
|
274
302
|
onDelete?: ((_key: string | number, _ev: Event) => any) | undefined;
|
|
275
303
|
onAdd?: ((_ev: Event) => any) | undefined;
|
|
@@ -287,9 +315,11 @@ declare const Tabs: {
|
|
|
287
315
|
trigger: import("./interface").TabTriggerEvent;
|
|
288
316
|
position: import("./interface").TabsPosition;
|
|
289
317
|
direction: "horizontal" | "vertical";
|
|
318
|
+
scrollbar: boolean | import("../index.ts").ScrollbarProps;
|
|
290
319
|
activeKey: string | number;
|
|
291
320
|
animation: boolean;
|
|
292
321
|
justify: boolean;
|
|
322
|
+
fullHeight: boolean;
|
|
293
323
|
destroyOnHide: boolean;
|
|
294
324
|
defaultActiveKey: string | number;
|
|
295
325
|
editable: boolean;
|
|
@@ -369,6 +399,8 @@ declare const Tabs: {
|
|
|
369
399
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
370
400
|
$slots: {
|
|
371
401
|
default?: (props: {}) => any;
|
|
402
|
+
} & {
|
|
403
|
+
default?: (props: {}) => any;
|
|
372
404
|
};
|
|
373
405
|
});
|
|
374
406
|
install: (app: App, options?: SDOptions) => void;
|
package/es/tabs/style/index.css
CHANGED
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
line-height: 1.5715;
|
|
114
114
|
outline: none;
|
|
115
115
|
cursor: pointer;
|
|
116
|
-
transition: color 0.2s cubic-bezier(0, 0, 1, 1);
|
|
116
|
+
transition: color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
117
117
|
}
|
|
118
118
|
.sd-tabs-tab-title {
|
|
119
119
|
display: inline-block;
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
background-color: transparent;
|
|
170
170
|
border-radius: var(--sd-border-radius-small);
|
|
171
171
|
opacity: 1;
|
|
172
|
-
transition: background-color 0.2s cubic-bezier(0, 0, 1, 1), opacity 0.2s cubic-bezier(0, 0, 1, 1);
|
|
172
|
+
transition: background-color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1), opacity 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
173
173
|
content: "";
|
|
174
174
|
}
|
|
175
175
|
.sd-tabs-nav-type-line .sd-tabs-tab:hover .sd-tabs-tab-title::before {
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
padding: 4px 16px;
|
|
196
196
|
font-size: 14px;
|
|
197
197
|
border: 1px solid var(--sd-color-neutral-3);
|
|
198
|
-
transition: padding 0.2s cubic-bezier(0, 0, 1, 1), color 0.2s cubic-bezier(0, 0, 1, 1);
|
|
198
|
+
transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 1), color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
199
199
|
}
|
|
200
200
|
.sd-tabs-nav-type-card .sd-tabs-tab-closable, .sd-tabs-nav-type-card-gutter .sd-tabs-tab-closable {
|
|
201
201
|
padding-right: 12px;
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
height: 14px;
|
|
371
371
|
background-color: var(--sd-color-fill-3);
|
|
372
372
|
transform: translateY(-50%);
|
|
373
|
-
transition:
|
|
373
|
+
transition: opacity 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
374
374
|
content: "";
|
|
375
375
|
}
|
|
376
376
|
|
|
@@ -407,7 +407,7 @@
|
|
|
407
407
|
border-top: none;
|
|
408
408
|
}
|
|
409
409
|
.sd-tabs-content-animation {
|
|
410
|
-
transition:
|
|
410
|
+
transition: margin 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
411
411
|
}
|
|
412
412
|
.sd-tabs-horizontal.sd-tabs-justify {
|
|
413
413
|
display: flex;
|
|
@@ -420,6 +420,35 @@
|
|
|
420
420
|
height: 100%;
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
+
.sd-tabs-horizontal.sd-tabs-full-height {
|
|
424
|
+
display: flex;
|
|
425
|
+
flex-direction: column;
|
|
426
|
+
height: 100%;
|
|
427
|
+
}
|
|
428
|
+
.sd-tabs-horizontal.sd-tabs-full-height > .sd-tabs-nav {
|
|
429
|
+
flex-shrink: 0;
|
|
430
|
+
}
|
|
431
|
+
.sd-tabs-horizontal.sd-tabs-full-height .sd-tabs-content {
|
|
432
|
+
flex: 1;
|
|
433
|
+
min-height: 0;
|
|
434
|
+
}
|
|
435
|
+
.sd-tabs-horizontal.sd-tabs-full-height .sd-tabs-content-list {
|
|
436
|
+
height: 100%;
|
|
437
|
+
}
|
|
438
|
+
.sd-tabs-horizontal.sd-tabs-full-height .sd-tabs-content-item-active {
|
|
439
|
+
height: 100%;
|
|
440
|
+
}
|
|
441
|
+
.sd-tabs-horizontal.sd-tabs-full-height .sd-tabs-pane {
|
|
442
|
+
height: 100%;
|
|
443
|
+
overflow: auto;
|
|
444
|
+
}
|
|
445
|
+
.sd-tabs-horizontal.sd-tabs-full-height .sd-tabs-pane-scroll {
|
|
446
|
+
overflow: hidden;
|
|
447
|
+
}
|
|
448
|
+
.sd-tabs-horizontal.sd-tabs-full-height .sd-tabs-pane-scrollbar {
|
|
449
|
+
height: 100%;
|
|
450
|
+
}
|
|
451
|
+
|
|
423
452
|
.sd-tabs-nav-size-mini.sd-tabs-nav-type-line .sd-tabs-nav-extra {
|
|
424
453
|
font-size: 12px;
|
|
425
454
|
line-height: 32px;
|
package/es/tabs/style/index.scss
CHANGED
|
@@ -181,7 +181,7 @@ $tabs-prefix-cls: string.unquote('#{theme.$prefix}-tabs');
|
|
|
181
181
|
line-height: 1.5715;
|
|
182
182
|
outline: none;
|
|
183
183
|
cursor: pointer;
|
|
184
|
-
transition: color theme.$transition-duration-2 theme.$transition-timing-function-
|
|
184
|
+
transition: color theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
185
185
|
|
|
186
186
|
&-title {
|
|
187
187
|
display: inline-block;
|
|
@@ -261,8 +261,8 @@ $tabs-prefix-cls: string.unquote('#{theme.$prefix}-tabs');
|
|
|
261
261
|
border-radius: $tabs-line-border-radius;
|
|
262
262
|
opacity: 1;
|
|
263
263
|
transition:
|
|
264
|
-
background-color theme.$transition-duration-2 theme.$transition-timing-function-
|
|
265
|
-
opacity theme.$transition-duration-2 theme.$transition-timing-function-
|
|
264
|
+
background-color theme.$transition-duration-2 theme.$transition-timing-function-standard,
|
|
265
|
+
opacity theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
266
266
|
content: '';
|
|
267
267
|
}
|
|
268
268
|
}
|
|
@@ -318,8 +318,8 @@ $tabs-prefix-cls: string.unquote('#{theme.$prefix}-tabs');
|
|
|
318
318
|
font-size: $tabs-size-default-font-size_card;
|
|
319
319
|
border: $tabs-card-border-width solid $tabs-card-color-title-border;
|
|
320
320
|
transition:
|
|
321
|
-
padding theme.$transition-duration-2 theme.$transition-timing-function-
|
|
322
|
-
color theme.$transition-duration-2 theme.$transition-timing-function-
|
|
321
|
+
padding theme.$transition-duration-2 theme.$transition-timing-function-standard,
|
|
322
|
+
color theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
323
323
|
|
|
324
324
|
&-closable {
|
|
325
325
|
padding-right: $tabs-card-padding-title-right_editable;
|
|
@@ -574,7 +574,7 @@ $tabs-prefix-cls: string.unquote('#{theme.$prefix}-tabs');
|
|
|
574
574
|
height: $tabs-capsule-size-separator-height;
|
|
575
575
|
background-color: $tabs-capsule-color-separator-bg;
|
|
576
576
|
transform: translateY(-50%);
|
|
577
|
-
transition:
|
|
577
|
+
transition: opacity theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
578
578
|
content: '';
|
|
579
579
|
}
|
|
580
580
|
}
|
|
@@ -627,7 +627,7 @@ $tabs-prefix-cls: string.unquote('#{theme.$prefix}-tabs');
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
&-content-animation {
|
|
630
|
-
transition:
|
|
630
|
+
transition: margin theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
631
631
|
}
|
|
632
632
|
|
|
633
633
|
&-horizontal#{&}-justify {
|
|
@@ -643,6 +643,44 @@ $tabs-prefix-cls: string.unquote('#{theme.$prefix}-tabs');
|
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
+
// full-height:撑满父容器高度(仅水平方向),内容区域自动滚动
|
|
647
|
+
.#{$tabs-prefix-cls}-horizontal.#{$tabs-prefix-cls}-full-height {
|
|
648
|
+
display: flex;
|
|
649
|
+
flex-direction: column;
|
|
650
|
+
height: 100%;
|
|
651
|
+
|
|
652
|
+
> .#{$tabs-prefix-cls}-nav {
|
|
653
|
+
flex-shrink: 0;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.#{$tabs-prefix-cls}-content {
|
|
657
|
+
flex: 1;
|
|
658
|
+
min-height: 0;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.#{$tabs-prefix-cls}-content-list {
|
|
662
|
+
height: 100%;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
.#{$tabs-prefix-cls}-content-item-active {
|
|
666
|
+
height: 100%;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.#{$tabs-prefix-cls}-pane {
|
|
670
|
+
height: 100%;
|
|
671
|
+
overflow: auto;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// scrollbar !== false:使用 Scrollbar 组件,pane 不再原生滚动
|
|
675
|
+
.#{$tabs-prefix-cls}-pane-scroll {
|
|
676
|
+
overflow: hidden;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.#{$tabs-prefix-cls}-pane-scrollbar {
|
|
680
|
+
height: 100%;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
646
684
|
@mixin for($data, $i: 1) {
|
|
647
685
|
@if ($i <= list.length($data)) {
|
|
648
686
|
$size: list.nth($data, $i);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_7: {}, __VLS_9: {};
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
|
-
default?: (props: typeof
|
|
3
|
+
default?: (props: typeof __VLS_7) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: typeof __VLS_9) => any;
|
|
4
6
|
};
|
|
5
7
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
8
|
title: StringConstructor;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
+
import Scrollbar from "../scrollbar/index.js";
|
|
3
4
|
import { tabsInjectionKey } from "./context.js";
|
|
4
|
-
import { computed, createCommentVNode, createElementBlock, defineComponent, getCurrentInstance, inject, normalizeClass, onBeforeUnmount, onUpdated, openBlock, reactive, ref, renderSlot, toRefs, unref, useSlots, watch } from "vue";
|
|
5
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, getCurrentInstance, inject, mergeProps, normalizeClass, onBeforeUnmount, onUpdated, openBlock, reactive, ref, renderSlot, toRefs, unref, useSlots, watch, withCtx } from "vue";
|
|
5
6
|
//#region components/tabs/tab-pane.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var _hoisted_1 = [
|
|
8
|
+
"id",
|
|
9
|
+
"aria-labelledby",
|
|
10
|
+
"aria-hidden",
|
|
11
|
+
"tabindex",
|
|
12
|
+
"inert"
|
|
13
|
+
];
|
|
6
14
|
var tab_pane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "TabPane" }), {}, {
|
|
7
15
|
__name: "tab-pane",
|
|
8
16
|
props: {
|
|
@@ -52,7 +60,22 @@ var tab_pane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
52
60
|
const itemRef = ref();
|
|
53
61
|
const key = computed(() => instance === null || instance === void 0 ? void 0 : instance.vnode.key);
|
|
54
62
|
const active = computed(() => key.value === tabsCtx.activeKey);
|
|
63
|
+
const tabsId = computed(() => {
|
|
64
|
+
var _tabsCtx$tabsId;
|
|
65
|
+
return (_tabsCtx$tabsId = tabsCtx.tabsId) !== null && _tabsCtx$tabsId !== void 0 ? _tabsCtx$tabsId : "";
|
|
66
|
+
});
|
|
67
|
+
const panelId = computed(() => `${tabsId.value}-${key.value}-panel`);
|
|
68
|
+
const tabLabelledBy = computed(() => `${tabsId.value}-${key.value}-tab`);
|
|
55
69
|
const mounted = ref(tabsCtx.lazyLoad ? active.value : true);
|
|
70
|
+
const paneScrollbarProps = computed(() => {
|
|
71
|
+
const { scrollbar } = tabsCtx;
|
|
72
|
+
return scrollbar === false || scrollbar === void 0 ? {} : scrollbar;
|
|
73
|
+
});
|
|
74
|
+
const hasPaneScrollbar = computed(() => {
|
|
75
|
+
const { scrollbar } = tabsCtx;
|
|
76
|
+
return scrollbar !== false && scrollbar !== void 0;
|
|
77
|
+
});
|
|
78
|
+
const paneCls = computed(() => [`${prefixCls}-pane`, { [`${prefixCls}-pane-scroll`]: hasPaneScrollbar.value }]);
|
|
56
79
|
const data = reactive({
|
|
57
80
|
key,
|
|
58
81
|
title,
|
|
@@ -82,11 +105,23 @@ var tab_pane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
82
105
|
return openBlock(), createElementBlock("div", {
|
|
83
106
|
ref_key: "itemRef",
|
|
84
107
|
ref: itemRef,
|
|
85
|
-
class: normalizeClass([`${unref(prefixCls)}-content-item`, { [`${unref(prefixCls)}-content-item-active`]: active.value }])
|
|
108
|
+
class: normalizeClass([`${unref(prefixCls)}-content-item`, { [`${unref(prefixCls)}-content-item-active`]: active.value }]),
|
|
109
|
+
role: "tabpanel",
|
|
110
|
+
id: panelId.value,
|
|
111
|
+
"aria-labelledby": tabLabelledBy.value,
|
|
112
|
+
"aria-hidden": active.value ? void 0 : "true",
|
|
113
|
+
tabindex: active.value ? 0 : void 0,
|
|
114
|
+
inert: active.value ? void 0 : true
|
|
86
115
|
}, [mounted.value ? (openBlock(), createElementBlock("div", {
|
|
87
116
|
key: 0,
|
|
88
|
-
class: normalizeClass(
|
|
89
|
-
}, [
|
|
117
|
+
class: normalizeClass(paneCls.value)
|
|
118
|
+
}, [hasPaneScrollbar.value ? (openBlock(), createBlock(unref(Scrollbar), mergeProps({
|
|
119
|
+
key: 0,
|
|
120
|
+
"outer-class": `${unref(prefixCls)}-pane-scrollbar`
|
|
121
|
+
}, paneScrollbarProps.value), {
|
|
122
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
123
|
+
_: 3
|
|
124
|
+
}, 16, ["outer-class"])) : renderSlot(_ctx.$slots, "default", { key: 1 })], 2)) : createCommentVNode("", true)], 10, _hoisted_1);
|
|
90
125
|
};
|
|
91
126
|
}
|
|
92
127
|
}));
|
package/es/tabs/tabs-nav.js
CHANGED
|
@@ -4,6 +4,7 @@ import { isNumber, isUndefined } from "../_utils/is.js";
|
|
|
4
4
|
import resize_observer_default from "../_components/resize-observer.js";
|
|
5
5
|
import { off, on } from "../_utils/dom.js";
|
|
6
6
|
import icon_hover_default from "../_components/icon-hover.js";
|
|
7
|
+
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
7
8
|
import IconPlus from "../icon/icon-plus/index.js";
|
|
8
9
|
import tabs_button_default from "./tabs-button.js";
|
|
9
10
|
import tabs_nav_ink_default from "./tabs-nav-ink.js";
|
|
@@ -171,6 +172,35 @@ var tabs_nav_default = /* @__PURE__ */ defineComponent({
|
|
|
171
172
|
const scrollDirection = type === "previous" !== isRtlHorizontal.value ? -1 : 1;
|
|
172
173
|
setOffset(offset.value + scrollDirection * wrapperLength.value);
|
|
173
174
|
};
|
|
175
|
+
const focusAndActivate = (key, ev) => {
|
|
176
|
+
const el = tabsRef.value[key];
|
|
177
|
+
if (el instanceof HTMLElement) el.focus();
|
|
178
|
+
emit("click", key, ev);
|
|
179
|
+
};
|
|
180
|
+
const handleListKeydown = (ev) => {
|
|
181
|
+
const enabled = props.tabs.filter((t) => !t.disabled);
|
|
182
|
+
if (enabled.length === 0) return;
|
|
183
|
+
const len = enabled.length;
|
|
184
|
+
const currentIdx = Math.max(0, enabled.findIndex((t) => t.key === activeKey.value));
|
|
185
|
+
let nextIdx = currentIdx;
|
|
186
|
+
const key = ev.key;
|
|
187
|
+
if (direction.value === "vertical") if (key === KEYBOARD_KEY.ARROW_DOWN) nextIdx = currentIdx + 1;
|
|
188
|
+
else if (key === KEYBOARD_KEY.ARROW_UP) nextIdx = currentIdx - 1;
|
|
189
|
+
else if (key === KEYBOARD_KEY.HOME) nextIdx = 0;
|
|
190
|
+
else if (key === KEYBOARD_KEY.END) nextIdx = len - 1;
|
|
191
|
+
else return;
|
|
192
|
+
else {
|
|
193
|
+
const rtl = isRtlHorizontal.value;
|
|
194
|
+
if (key === KEYBOARD_KEY.ARROW_RIGHT) nextIdx = rtl ? currentIdx - 1 : currentIdx + 1;
|
|
195
|
+
else if (key === KEYBOARD_KEY.ARROW_LEFT) nextIdx = rtl ? currentIdx + 1 : currentIdx - 1;
|
|
196
|
+
else if (key === KEYBOARD_KEY.HOME) nextIdx = 0;
|
|
197
|
+
else if (key === KEYBOARD_KEY.END) nextIdx = len - 1;
|
|
198
|
+
else return;
|
|
199
|
+
}
|
|
200
|
+
ev.preventDefault();
|
|
201
|
+
nextIdx = (nextIdx % len + len) % len;
|
|
202
|
+
focusAndActivate(enabled[nextIdx].key, ev);
|
|
203
|
+
};
|
|
174
204
|
const handleResize = () => {
|
|
175
205
|
getSize();
|
|
176
206
|
if (inkRef.value) inkRef.value.$forceUpdate();
|
|
@@ -229,7 +259,10 @@ var tabs_nav_default = /* @__PURE__ */ defineComponent({
|
|
|
229
259
|
}, [createVNode(resize_observer_default, { "onResize": handleResize }, { default: () => [createVNode("div", {
|
|
230
260
|
"ref": listRef,
|
|
231
261
|
"class": listCls.value,
|
|
232
|
-
"style": listStyle.value
|
|
262
|
+
"style": listStyle.value,
|
|
263
|
+
"role": "tablist",
|
|
264
|
+
"aria-orientation": direction.value === "vertical" ? "vertical" : "horizontal",
|
|
265
|
+
"onKeydown": handleListKeydown
|
|
233
266
|
}, [props.tabs.map((tab) => createVNode(tabs_tab_default, {
|
|
234
267
|
"key": tab.key,
|
|
235
268
|
"ref": (component) => {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import icon_hover_default from "../_components/icon-hover.js";
|
|
4
|
+
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
4
5
|
import IconClose from "../icon/icon-close/index.js";
|
|
5
6
|
import { tabsInjectionKey } from "./context.js";
|
|
6
7
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, mergeProps, normalizeClass, openBlock, renderSlot, unref, withCtx, withModifiers } from "vue";
|
|
7
8
|
//#region components/tabs/tabs-tab.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var _hoisted_1 = [
|
|
10
|
+
"id",
|
|
11
|
+
"tabindex",
|
|
12
|
+
"aria-selected",
|
|
13
|
+
"aria-disabled",
|
|
14
|
+
"aria-controls"
|
|
15
|
+
];
|
|
8
16
|
var tabs_tab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "TabsTab" }), {}, {
|
|
9
17
|
__name: "tabs-tab",
|
|
10
18
|
props: {
|
|
@@ -21,11 +29,21 @@ var tabs_tab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
21
29
|
const emit = __emit;
|
|
22
30
|
const prefixCls = getPrefixCls("tabs-tab");
|
|
23
31
|
const tabsCtx = inject(tabsInjectionKey, {});
|
|
32
|
+
const tabsId = computed(() => {
|
|
33
|
+
var _tabsCtx$tabsId;
|
|
34
|
+
return (_tabsCtx$tabsId = tabsCtx.tabsId) !== null && _tabsCtx$tabsId !== void 0 ? _tabsCtx$tabsId : "";
|
|
35
|
+
});
|
|
36
|
+
const tabId = computed(() => `${tabsId.value}-${props.tab.key}-tab`);
|
|
37
|
+
const panelId = computed(() => `${tabsId.value}-${props.tab.key}-panel`);
|
|
24
38
|
const handleClick = (e) => {
|
|
25
39
|
if (!props.tab.disabled) emit("click", props.tab.key, e);
|
|
26
40
|
};
|
|
27
41
|
const onKeyDown = (ev) => {
|
|
28
|
-
if (ev.key ===
|
|
42
|
+
if (ev.key === KEYBOARD_KEY.ENTER) handleClick(ev);
|
|
43
|
+
else if (ev.key === KEYBOARD_KEY.SPACE) {
|
|
44
|
+
ev.preventDefault();
|
|
45
|
+
handleClick(ev);
|
|
46
|
+
}
|
|
29
47
|
};
|
|
30
48
|
const eventHandlers = computed(() => {
|
|
31
49
|
return Object.assign(tabsCtx.trigger === "click" ? { onClick: handleClick } : { onMouseover: handleClick }, { onKeydown: onKeyDown });
|
|
@@ -40,8 +58,13 @@ var tabs_tab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
40
58
|
}]);
|
|
41
59
|
return (_ctx, _cache) => {
|
|
42
60
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
43
|
-
|
|
44
|
-
class: cls.value
|
|
61
|
+
id: tabId.value,
|
|
62
|
+
class: cls.value,
|
|
63
|
+
role: "tab",
|
|
64
|
+
tabindex: __props.active && !__props.tab.disabled ? 0 : -1,
|
|
65
|
+
"aria-selected": __props.active,
|
|
66
|
+
"aria-disabled": __props.tab.disabled || void 0,
|
|
67
|
+
"aria-controls": panelId.value
|
|
45
68
|
}, eventHandlers.value), [createElementVNode("span", { class: normalizeClass(`${unref(prefixCls)}-title`) }, [renderSlot(_ctx.$slots, "default")], 2), __props.editable && __props.tab.closable ? (openBlock(), createBlock(icon_hover_default, {
|
|
46
69
|
key: 0,
|
|
47
70
|
class: normalizeClass(`${unref(prefixCls)}-close-btn`),
|
|
@@ -49,7 +72,7 @@ var tabs_tab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
49
72
|
}, {
|
|
50
73
|
default: withCtx(() => [createVNode(unref(IconClose))]),
|
|
51
74
|
_: 1
|
|
52
|
-
}, 8, ["class"])) : createCommentVNode("", true)], 16);
|
|
75
|
+
}, 8, ["class"])) : createCommentVNode("", true)], 16, _hoisted_1);
|
|
53
76
|
};
|
|
54
77
|
}
|
|
55
78
|
}));
|
package/es/tabs/tabs.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { Direction, Size } from '../_utils/constant';
|
|
3
|
+
import type { ScrollbarProps } from '../scrollbar';
|
|
3
4
|
import type { TabsPosition, TabsType, TabTriggerEvent, ScrollPosition } from './interface';
|
|
4
5
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
6
|
activeKey: {
|
|
@@ -69,6 +70,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
69
70
|
type: PropType<ScrollPosition>;
|
|
70
71
|
default: string;
|
|
71
72
|
};
|
|
73
|
+
fullHeight: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
77
|
+
scrollbar: {
|
|
78
|
+
type: PropType<boolean | ScrollbarProps>;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
72
81
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
82
|
'update:activeKey': (_key: string | number) => true;
|
|
74
83
|
change: (_key: string | number) => true;
|
|
@@ -143,6 +152,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
143
152
|
type: PropType<ScrollPosition>;
|
|
144
153
|
default: string;
|
|
145
154
|
};
|
|
155
|
+
fullHeight: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
default: boolean;
|
|
158
|
+
};
|
|
159
|
+
scrollbar: {
|
|
160
|
+
type: PropType<boolean | ScrollbarProps>;
|
|
161
|
+
default: boolean;
|
|
162
|
+
};
|
|
146
163
|
}>> & Readonly<{
|
|
147
164
|
onDelete?: ((_key: string | number, _ev: Event) => any) | undefined;
|
|
148
165
|
onAdd?: ((_ev: Event) => any) | undefined;
|
|
@@ -154,9 +171,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
154
171
|
trigger: TabTriggerEvent;
|
|
155
172
|
position: TabsPosition;
|
|
156
173
|
direction: "horizontal" | "vertical";
|
|
174
|
+
scrollbar: boolean | ScrollbarProps;
|
|
157
175
|
activeKey: string | number;
|
|
158
176
|
animation: boolean;
|
|
159
177
|
justify: boolean;
|
|
178
|
+
fullHeight: boolean;
|
|
160
179
|
destroyOnHide: boolean;
|
|
161
180
|
defaultActiveKey: string | number;
|
|
162
181
|
editable: boolean;
|
package/es/tabs/tabs.js
CHANGED
|
@@ -2,10 +2,11 @@ import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import { isUndefined } from "../_utils/is.js";
|
|
4
4
|
import { useSize } from "../_hooks/use-size.js";
|
|
5
|
+
import { useScrollbar } from "../_hooks/use-scrollbar.js";
|
|
5
6
|
import { useChildrenComponents } from "../_hooks/use-children-components.js";
|
|
6
7
|
import { tabsInjectionKey } from "./context.js";
|
|
7
8
|
import tabs_nav_default from "./tabs-nav.js";
|
|
8
|
-
import { computed, createVNode, defineComponent, inject, nextTick, provide, reactive, ref, toRefs } from "vue";
|
|
9
|
+
import { computed, createVNode, defineComponent, getCurrentInstance, inject, nextTick, provide, reactive, ref, toRef, toRefs } from "vue";
|
|
9
10
|
//#region components/tabs/tabs.tsx
|
|
10
11
|
var tabs_default = /* @__PURE__ */ defineComponent({
|
|
11
12
|
name: "Tabs",
|
|
@@ -154,6 +155,23 @@ var tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
154
155
|
scrollPosition: {
|
|
155
156
|
type: [String, Number],
|
|
156
157
|
default: "auto"
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* @zh 是否高度撑满父容器(仅在水平方向生效,内容区域自动滚动)
|
|
161
|
+
* @en Whether to fill the height of the parent container (only effective in horizontal direction, the content area scrolls automatically)
|
|
162
|
+
*/
|
|
163
|
+
fullHeight: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
default: false
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* @zh 内容区域是否使用 Scrollbar 组件滚动,可传入对象自定义滚动条配置。为 false 时使用原生 overflow 滚动。仅 `full-height` 为 true 时生效
|
|
169
|
+
* @en Whether the content area uses the Scrollbar component for scrolling, an object can be passed to customize the scrollbar. When false, native overflow scrolling is used. Only effective when `full-height` is true
|
|
170
|
+
* @defaultValue true
|
|
171
|
+
*/
|
|
172
|
+
scrollbar: {
|
|
173
|
+
type: [Boolean, Object],
|
|
174
|
+
default: true
|
|
157
175
|
}
|
|
158
176
|
},
|
|
159
177
|
emits: {
|
|
@@ -190,6 +208,7 @@ var tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
190
208
|
setup(props, { emit, slots }) {
|
|
191
209
|
const { size, lazyLoad, destroyOnHide, trigger } = toRefs(props);
|
|
192
210
|
const prefixCls = getPrefixCls("tabs");
|
|
211
|
+
const tabsId = `${prefixCls}-${getCurrentInstance().uid}`;
|
|
193
212
|
const { mergedSize } = useSize(size);
|
|
194
213
|
const mergedPosition = computed(() => props.direction === "vertical" ? "left" : props.position);
|
|
195
214
|
const mergedDirection = computed(() => ["left", "right"].includes(mergedPosition.value) ? "vertical" : "horizontal");
|
|
@@ -222,13 +241,16 @@ var tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
222
241
|
if (index === -1) return 0;
|
|
223
242
|
return index;
|
|
224
243
|
});
|
|
244
|
+
const { scrollbarProps } = useScrollbar(toRef(props, "scrollbar"));
|
|
225
245
|
provide(tabsInjectionKey, reactive({
|
|
226
246
|
lazyLoad,
|
|
227
247
|
destroyOnHide,
|
|
228
248
|
activeKey: computedActiveKey,
|
|
229
249
|
addItem,
|
|
230
250
|
removeItem,
|
|
231
|
-
trigger
|
|
251
|
+
trigger,
|
|
252
|
+
scrollbar: computed(() => props.fullHeight && props.scrollbar !== false ? scrollbarProps.value : false),
|
|
253
|
+
tabsId
|
|
232
254
|
}));
|
|
233
255
|
const handleChange = (key) => {
|
|
234
256
|
if (key !== computedActiveKey.value) {
|
|
@@ -270,6 +292,7 @@ var tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
270
292
|
`${prefixCls}-size-${mergedSize.value}`,
|
|
271
293
|
{
|
|
272
294
|
[`${prefixCls}-justify`]: props.justify,
|
|
295
|
+
[`${prefixCls}-full-height`]: props.fullHeight,
|
|
273
296
|
[`${prefixCls}-rtl`]: rtl.value
|
|
274
297
|
}
|
|
275
298
|
]);
|
package/es/tag/index.d.ts
CHANGED
|
@@ -74,12 +74,12 @@ declare const Tag: {
|
|
|
74
74
|
default: undefined;
|
|
75
75
|
};
|
|
76
76
|
}>> & Readonly<{
|
|
77
|
-
onClose?: ((_ev:
|
|
77
|
+
onClose?: ((_ev: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
78
78
|
"onUpdate:visible"?: ((_visible: boolean) => any) | undefined;
|
|
79
79
|
"onUpdate:checked"?: ((_checked: boolean) => any) | undefined;
|
|
80
80
|
onCheck?: ((_checked: boolean, _ev: MouseEvent) => any) | undefined;
|
|
81
81
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
82
|
-
close: (_ev:
|
|
82
|
+
close: (_ev: KeyboardEvent | MouseEvent) => any;
|
|
83
83
|
"update:visible": (_visible: boolean) => any;
|
|
84
84
|
"update:checked": (_checked: boolean) => any;
|
|
85
85
|
check: (_checked: boolean, _ev: MouseEvent) => any;
|
|
@@ -179,7 +179,7 @@ declare const Tag: {
|
|
|
179
179
|
default: undefined;
|
|
180
180
|
};
|
|
181
181
|
}>> & Readonly<{
|
|
182
|
-
onClose?: ((_ev:
|
|
182
|
+
onClose?: ((_ev: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
183
183
|
"onUpdate:visible"?: ((_visible: boolean) => any) | undefined;
|
|
184
184
|
"onUpdate:checked"?: ((_checked: boolean) => any) | undefined;
|
|
185
185
|
onCheck?: ((_checked: boolean, _ev: MouseEvent) => any) | undefined;
|
|
@@ -276,12 +276,12 @@ declare const Tag: {
|
|
|
276
276
|
default: undefined;
|
|
277
277
|
};
|
|
278
278
|
}>> & Readonly<{
|
|
279
|
-
onClose?: ((_ev:
|
|
279
|
+
onClose?: ((_ev: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
280
280
|
"onUpdate:visible"?: ((_visible: boolean) => any) | undefined;
|
|
281
281
|
"onUpdate:checked"?: ((_checked: boolean) => any) | undefined;
|
|
282
282
|
onCheck?: ((_checked: boolean, _ev: MouseEvent) => any) | undefined;
|
|
283
283
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
284
|
-
close: (_ev:
|
|
284
|
+
close: (_ev: KeyboardEvent | MouseEvent) => any;
|
|
285
285
|
"update:visible": (_visible: boolean) => any;
|
|
286
286
|
"update:checked": (_checked: boolean) => any;
|
|
287
287
|
check: (_checked: boolean, _ev: MouseEvent) => any;
|
package/es/tag/style/index.css
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
.sd-tag-checkable {
|
|
41
41
|
cursor: pointer;
|
|
42
|
-
transition:
|
|
42
|
+
transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), border-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
43
43
|
}
|
|
44
44
|
.sd-tag-checkable:hover {
|
|
45
45
|
background-color: var(--sd-color-fill-2);
|
package/es/tag/style/index.scss
CHANGED
|
@@ -68,7 +68,9 @@ $colors:
|
|
|
68
68
|
|
|
69
69
|
&-checkable {
|
|
70
70
|
cursor: pointer;
|
|
71
|
-
transition:
|
|
71
|
+
transition:
|
|
72
|
+
background-color theme.$transition-duration-1 theme.$transition-timing-function-standard,
|
|
73
|
+
border-color theme.$transition-duration-1 theme.$transition-timing-function-standard;
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
&-checkable:hover {
|
package/es/tag/tag.vue.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
84
84
|
default: undefined;
|
|
85
85
|
};
|
|
86
86
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
87
|
-
close: (_ev:
|
|
87
|
+
close: (_ev: KeyboardEvent | MouseEvent) => any;
|
|
88
88
|
"update:visible": (_visible: boolean) => any;
|
|
89
89
|
"update:checked": (_checked: boolean) => any;
|
|
90
90
|
check: (_checked: boolean, _ev: MouseEvent) => any;
|
|
@@ -160,7 +160,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
160
160
|
default: undefined;
|
|
161
161
|
};
|
|
162
162
|
}>> & Readonly<{
|
|
163
|
-
onClose?: ((_ev:
|
|
163
|
+
onClose?: ((_ev: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
164
164
|
"onUpdate:visible"?: ((_visible: boolean) => any) | undefined;
|
|
165
165
|
"onUpdate:checked"?: ((_checked: boolean) => any) | undefined;
|
|
166
166
|
onCheck?: ((_checked: boolean, _ev: MouseEvent) => any) | undefined;
|