x-next 0.0.0-alpha.50 → 0.0.0-alpha.51
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 +21 -16
- package/dist/_hooks/use-children-components.d.ts +5 -0
- package/dist/_hooks/use-size.d.ts +7 -0
- package/dist/_utils/vue-eco.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/input/Input.d.ts +5 -5
- package/dist/components/input/index.d.ts +15 -15
- package/dist/components/tabs/TabPane.vue.d.ts +78 -0
- package/dist/components/tabs/Tabs.d.ts +349 -0
- package/dist/components/tabs/context.d.ts +11 -0
- package/dist/components/tabs/index.d.ts +400 -0
- package/dist/components/tabs/interface.d.ts +12 -0
- package/dist/components/tabs/tabs-button.d.ts +43 -0
- package/dist/components/tabs/tabs-nav-ink.vue.d.ts +36 -0
- package/dist/components/tabs/tabs-nav.d.ts +110 -0
- package/dist/components/tabs/tabs-tab.vue.d.ts +129 -0
- package/dist/components/tabs/utils.d.ts +13 -0
- package/dist/icons/_self/down.d.ts +50 -0
- package/dist/icons/_self/left.d.ts +50 -0
- package/dist/icons/_self/plus.d.ts +50 -0
- package/dist/icons/_self/right.d.ts +50 -0
- package/dist/icons/_self/up.d.ts +50 -0
- package/dist/index.es.js +2708 -1934
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/volar.d.ts +2 -0
package/README.md
CHANGED
@@ -27,20 +27,25 @@ app.mount('#app')
|
|
27
27
|
### 目前已完成的组件
|
28
28
|
|
29
29
|
```
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
30
|
+
XButton: (typeof import('x-next'))['XButton'];
|
31
|
+
XDialog: (typeof import('x-next'))['XDialog'];
|
32
|
+
XMessage: (typeof import('x-next'))['XMessage'];
|
33
|
+
XMessageBox: (typeof import('x-next'))['XMessageBox'];
|
34
|
+
XNotification: (typeof import('x-next'))['XNotification'];
|
35
|
+
XSpace: (typeof import('x-next'))['XSpace'];
|
36
|
+
XPopconfirm: (typeof import('x-next'))['XPopconfirm'];
|
37
|
+
XTrendChart: (typeof import('x-next'))['XTrendChart'];
|
38
|
+
XTimeline: (typeof import('x-next'))['XTimeline'];
|
39
|
+
XTimelineItem: (typeof import('x-next'))['XTimelineItem'];
|
40
|
+
XPopup: (typeof import('x-next'))['XPopup'];
|
41
|
+
XScrollbar: (typeof import('x-next'))['XScrollbar'];
|
42
|
+
XDrawer: (typeof import('x-next'))['XDrawer'];
|
43
|
+
XTag: (typeof import('x-next'))['XTag'];
|
44
|
+
XTooltip: (typeof import('x-next'))['XTooltip'];
|
45
|
+
XImage: (typeof import('x-next'))['XImage'];
|
46
|
+
XImagePreview: (typeof import('x-next'))['XImagePreview'];
|
47
|
+
XImagePreviewGroup: (typeof import('x-next'))['XImagePreviewGroup'];
|
48
|
+
XImagePreviewAction: (typeof import('x-next'))['XImagePreviewAction'];
|
49
|
+
XTabPane: (typeof import('x-next'))['XTabPane'];
|
50
|
+
XTabs: (typeof import('x-next'))['XTabs'];
|
46
51
|
```
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { Size } from '../_utils/constant';
|
3
|
+
export declare const useSize: (size?: Ref<Size | undefined>, { defaultValue }?: {
|
4
|
+
defaultValue?: Size;
|
5
|
+
}) => {
|
6
|
+
mergedSize: import('vue').ComputedRef<"mini" | "small" | "medium" | "large">;
|
7
|
+
};
|
package/dist/_utils/vue-eco.d.ts
CHANGED
@@ -31,6 +31,8 @@ export declare const getFirstElement: (vn: VNode | VNode[]) => HTMLElement | nul
|
|
31
31
|
export declare const getFirstElementFromVNode: (vn: VNode) => HTMLElement | undefined;
|
32
32
|
export declare const getFirstElementFromChildren: (children: VNode[] | undefined) => HTMLElement | undefined;
|
33
33
|
export declare const getChildrenArray: (vn: VNode) => VNode[] | undefined;
|
34
|
+
export declare const getComponentsFromVNode: (vn: VNode, name: string) => number[];
|
35
|
+
export declare const getComponentsFromChildren: (children: VNode[] | undefined, name: string) => number[];
|
34
36
|
export declare const mergeFirstChild: (children: VNode[] | undefined, extraProps: ObjectData | ((vn: VNode) => ObjectData)) => boolean;
|
35
37
|
export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
|
36
38
|
export declare const generateComponent: <T extends Component | DefineComponent>(name: string, component: T) => T & {
|
@@ -198,22 +198,22 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
198
198
|
disabled: boolean;
|
199
199
|
resize: boolean;
|
200
200
|
modelValue: string | number;
|
201
|
+
autocomplete: "on" | "off";
|
202
|
+
autofocus: boolean;
|
203
|
+
maxlength: string | number;
|
204
|
+
readonly: boolean;
|
205
|
+
card: boolean;
|
201
206
|
prefixIcon: string;
|
202
207
|
suffixIcon: string;
|
203
208
|
placeholder: string;
|
204
|
-
readonly: boolean;
|
205
|
-
maxlength: string | number;
|
206
209
|
clearable: boolean;
|
207
|
-
autofocus: boolean;
|
208
210
|
showPassword: boolean;
|
209
|
-
autocomplete: "on" | "off";
|
210
211
|
autosize: boolean | {
|
211
212
|
minRows: number;
|
212
213
|
maxRows: number;
|
213
214
|
};
|
214
215
|
formatter: Function;
|
215
216
|
validateEvent: boolean;
|
216
|
-
card: boolean;
|
217
217
|
showWordLimit: boolean;
|
218
218
|
valueType: "string" | "number";
|
219
219
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
@@ -107,22 +107,22 @@ export declare const XInput: {
|
|
107
107
|
disabled: boolean;
|
108
108
|
resize: boolean;
|
109
109
|
modelValue: string | number;
|
110
|
+
autocomplete: "on" | "off";
|
111
|
+
autofocus: boolean;
|
112
|
+
maxlength: string | number;
|
113
|
+
readonly: boolean;
|
114
|
+
card: boolean;
|
110
115
|
prefixIcon: string;
|
111
116
|
suffixIcon: string;
|
112
117
|
placeholder: string;
|
113
|
-
readonly: boolean;
|
114
|
-
maxlength: string | number;
|
115
118
|
clearable: boolean;
|
116
|
-
autofocus: boolean;
|
117
119
|
showPassword: boolean;
|
118
|
-
autocomplete: "on" | "off";
|
119
120
|
autosize: boolean | {
|
120
121
|
minRows: number;
|
121
122
|
maxRows: number;
|
122
123
|
};
|
123
124
|
formatter: Function;
|
124
125
|
validateEvent: boolean;
|
125
|
-
card: boolean;
|
126
126
|
showWordLimit: boolean;
|
127
127
|
valueType: "string" | "number";
|
128
128
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
@@ -240,22 +240,22 @@ export declare const XInput: {
|
|
240
240
|
disabled: boolean;
|
241
241
|
resize: boolean;
|
242
242
|
modelValue: string | number;
|
243
|
+
autocomplete: "on" | "off";
|
244
|
+
autofocus: boolean;
|
245
|
+
maxlength: string | number;
|
246
|
+
readonly: boolean;
|
247
|
+
card: boolean;
|
243
248
|
prefixIcon: string;
|
244
249
|
suffixIcon: string;
|
245
250
|
placeholder: string;
|
246
|
-
readonly: boolean;
|
247
|
-
maxlength: string | number;
|
248
251
|
clearable: boolean;
|
249
|
-
autofocus: boolean;
|
250
252
|
showPassword: boolean;
|
251
|
-
autocomplete: "on" | "off";
|
252
253
|
autosize: boolean | {
|
253
254
|
minRows: number;
|
254
255
|
maxRows: number;
|
255
256
|
};
|
256
257
|
formatter: Function;
|
257
258
|
validateEvent: boolean;
|
258
|
-
card: boolean;
|
259
259
|
showWordLimit: boolean;
|
260
260
|
valueType: "string" | "number";
|
261
261
|
}>;
|
@@ -370,22 +370,22 @@ export declare const XInput: {
|
|
370
370
|
disabled: boolean;
|
371
371
|
resize: boolean;
|
372
372
|
modelValue: string | number;
|
373
|
+
autocomplete: "on" | "off";
|
374
|
+
autofocus: boolean;
|
375
|
+
maxlength: string | number;
|
376
|
+
readonly: boolean;
|
377
|
+
card: boolean;
|
373
378
|
prefixIcon: string;
|
374
379
|
suffixIcon: string;
|
375
380
|
placeholder: string;
|
376
|
-
readonly: boolean;
|
377
|
-
maxlength: string | number;
|
378
381
|
clearable: boolean;
|
379
|
-
autofocus: boolean;
|
380
382
|
showPassword: boolean;
|
381
|
-
autocomplete: "on" | "off";
|
382
383
|
autosize: boolean | {
|
383
384
|
minRows: number;
|
384
385
|
maxRows: number;
|
385
386
|
};
|
386
387
|
formatter: Function;
|
387
388
|
validateEvent: boolean;
|
388
|
-
card: boolean;
|
389
389
|
showWordLimit: boolean;
|
390
390
|
valueType: "string" | "number";
|
391
391
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
@@ -0,0 +1,78 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
2
|
+
/**
|
3
|
+
* @zh 选项卡的标题
|
4
|
+
* @en Title of the tab
|
5
|
+
*/
|
6
|
+
title: StringConstructor;
|
7
|
+
/**
|
8
|
+
* @zh 是否禁用
|
9
|
+
* @en Whether to disable
|
10
|
+
*/
|
11
|
+
disabled: {
|
12
|
+
type: BooleanConstructor;
|
13
|
+
default: boolean;
|
14
|
+
};
|
15
|
+
/**
|
16
|
+
* @zh 是否允许关闭此选项卡(仅在可编辑模式生效)
|
17
|
+
* @en Whether to allow this tab to be closed (only effective in editable mode)
|
18
|
+
*/
|
19
|
+
closable: {
|
20
|
+
type: BooleanConstructor;
|
21
|
+
default: boolean;
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* @zh 是否在不显示标签时销毁内容
|
25
|
+
* @en Whether to destroy the content when the label is not displayed
|
26
|
+
* @version 2.27.0
|
27
|
+
*/
|
28
|
+
destroyOnHide: {
|
29
|
+
type: BooleanConstructor;
|
30
|
+
default: boolean;
|
31
|
+
};
|
32
|
+
}>, {
|
33
|
+
className: {
|
34
|
+
block: string;
|
35
|
+
element: (className: string) => string;
|
36
|
+
modifier: (className: string) => string;
|
37
|
+
is: (className: string) => string;
|
38
|
+
};
|
39
|
+
active: import('vue').ComputedRef<boolean>;
|
40
|
+
itemRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
41
|
+
mounted: import('vue').Ref<boolean, boolean>;
|
42
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
43
|
+
/**
|
44
|
+
* @zh 选项卡的标题
|
45
|
+
* @en Title of the tab
|
46
|
+
*/
|
47
|
+
title: StringConstructor;
|
48
|
+
/**
|
49
|
+
* @zh 是否禁用
|
50
|
+
* @en Whether to disable
|
51
|
+
*/
|
52
|
+
disabled: {
|
53
|
+
type: BooleanConstructor;
|
54
|
+
default: boolean;
|
55
|
+
};
|
56
|
+
/**
|
57
|
+
* @zh 是否允许关闭此选项卡(仅在可编辑模式生效)
|
58
|
+
* @en Whether to allow this tab to be closed (only effective in editable mode)
|
59
|
+
*/
|
60
|
+
closable: {
|
61
|
+
type: BooleanConstructor;
|
62
|
+
default: boolean;
|
63
|
+
};
|
64
|
+
/**
|
65
|
+
* @zh 是否在不显示标签时销毁内容
|
66
|
+
* @en Whether to destroy the content when the label is not displayed
|
67
|
+
* @version 2.27.0
|
68
|
+
*/
|
69
|
+
destroyOnHide: {
|
70
|
+
type: BooleanConstructor;
|
71
|
+
default: boolean;
|
72
|
+
};
|
73
|
+
}>> & Readonly<{}>, {
|
74
|
+
disabled: boolean;
|
75
|
+
closable: boolean;
|
76
|
+
destroyOnHide: boolean;
|
77
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
78
|
+
export default _default;
|
@@ -0,0 +1,349 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { Direction, Size } from '../../_utils/constant';
|
3
|
+
import { TabsPosition, TabsType, TabTriggerEvent, ScrollPosition } from './interface';
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
5
|
+
/**
|
6
|
+
* @zh 当前选中的标签的 `key`
|
7
|
+
* @en The `key` of the currently selected label
|
8
|
+
* @vModel
|
9
|
+
*/
|
10
|
+
activeKey: {
|
11
|
+
type: (NumberConstructor | StringConstructor)[];
|
12
|
+
default: undefined;
|
13
|
+
};
|
14
|
+
/**
|
15
|
+
* @zh 默认选中的标签的`key`(非受控状态,为空时选中第一个标签页)
|
16
|
+
* @en The `key` of the tab selected by default (uncontrolled state, select the first tab page when it is empty)
|
17
|
+
*/
|
18
|
+
defaultActiveKey: {
|
19
|
+
type: (NumberConstructor | StringConstructor)[];
|
20
|
+
default: undefined;
|
21
|
+
};
|
22
|
+
/**
|
23
|
+
* @zh 选项卡的位置
|
24
|
+
* @en Position of the tab
|
25
|
+
* @values 'left', 'right', 'top', 'bottom'
|
26
|
+
*/
|
27
|
+
position: {
|
28
|
+
type: PropType<TabsPosition>;
|
29
|
+
default: string;
|
30
|
+
};
|
31
|
+
/**
|
32
|
+
* @zh 选项卡的大小
|
33
|
+
* @en The size of the tab
|
34
|
+
* @values 'mini', 'small', 'medium', 'large'
|
35
|
+
*/
|
36
|
+
size: {
|
37
|
+
type: PropType<Size>;
|
38
|
+
};
|
39
|
+
/**
|
40
|
+
* @zh 选项卡的类型
|
41
|
+
* @en The type of tab
|
42
|
+
* @values 'line', 'card', 'card-gutter', 'text', 'rounded', 'capsule'
|
43
|
+
*/
|
44
|
+
type: {
|
45
|
+
type: PropType<TabsType>;
|
46
|
+
default: string;
|
47
|
+
};
|
48
|
+
/**
|
49
|
+
* @zh 选项卡的方向
|
50
|
+
* @en The direction of tab
|
51
|
+
* @values 'horizontal', 'vertical'
|
52
|
+
*/
|
53
|
+
direction: {
|
54
|
+
type: PropType<Direction>;
|
55
|
+
default: string;
|
56
|
+
};
|
57
|
+
/**
|
58
|
+
* @zh 是否开启可编辑模式
|
59
|
+
* @en Whether to enable editable mode
|
60
|
+
*/
|
61
|
+
editable: {
|
62
|
+
type: BooleanConstructor;
|
63
|
+
default: boolean;
|
64
|
+
};
|
65
|
+
/**
|
66
|
+
* @zh 是否显示增加按钮(仅在可编辑模式可用)
|
67
|
+
* @en Whether to display the add button (only available in editable mode)
|
68
|
+
*/
|
69
|
+
showAddButton: {
|
70
|
+
type: BooleanConstructor;
|
71
|
+
default: boolean;
|
72
|
+
};
|
73
|
+
/**
|
74
|
+
* @zh 是否在不显示标签时销毁内容
|
75
|
+
* @en Whether to destroy the content when the label is not displayed
|
76
|
+
* @version 2.27.0
|
77
|
+
*/
|
78
|
+
destroyOnHide: {
|
79
|
+
type: BooleanConstructor;
|
80
|
+
default: boolean;
|
81
|
+
};
|
82
|
+
/**
|
83
|
+
* @zh 是否在首次展示标签时挂载内容
|
84
|
+
* @en Whether to mount the content when the label is first displayed
|
85
|
+
*/
|
86
|
+
lazyLoad: {
|
87
|
+
type: BooleanConstructor;
|
88
|
+
default: boolean;
|
89
|
+
};
|
90
|
+
/**
|
91
|
+
* @zh 高度撑满容器,只在水平模式下生效。
|
92
|
+
* @en The height of the container is fully supported, and it only takes effect in horizontal mode.
|
93
|
+
*/
|
94
|
+
justify: {
|
95
|
+
type: BooleanConstructor;
|
96
|
+
default: boolean;
|
97
|
+
};
|
98
|
+
/**
|
99
|
+
* @zh 是否开启选项内容过渡动画
|
100
|
+
* @en Whether to enable option content transition animation
|
101
|
+
*/
|
102
|
+
animation: {
|
103
|
+
type: BooleanConstructor;
|
104
|
+
default: boolean;
|
105
|
+
};
|
106
|
+
/**
|
107
|
+
* @zh 选项卡头部是否存在水平边距。仅对 `type` 等于 `line`、`text` 类型的选项卡生效
|
108
|
+
* @en Whether there is a horizontal margin on the header of the tab. Only valid for tabs with `type` equal to `line` and `text` type
|
109
|
+
* @version 2.10.0
|
110
|
+
*/
|
111
|
+
headerPadding: {
|
112
|
+
type: BooleanConstructor;
|
113
|
+
default: boolean;
|
114
|
+
};
|
115
|
+
/**
|
116
|
+
* @zh 创建标签后是否切换到新标签(最后一个)
|
117
|
+
* @en Whether to switch to a new tab after creating a tab (the last one)
|
118
|
+
* @version 2.18.0
|
119
|
+
*/
|
120
|
+
autoSwitch: {
|
121
|
+
type: BooleanConstructor;
|
122
|
+
default: boolean;
|
123
|
+
};
|
124
|
+
/**
|
125
|
+
* @zh 是否隐藏内容
|
126
|
+
* @en Whether to hide content
|
127
|
+
* @version 2.25.0
|
128
|
+
*/
|
129
|
+
hideContent: {
|
130
|
+
type: BooleanConstructor;
|
131
|
+
default: boolean;
|
132
|
+
};
|
133
|
+
/**
|
134
|
+
* @zh 触发方式
|
135
|
+
* @en Trigger method
|
136
|
+
* @values 'hover','click'
|
137
|
+
* @version 2.34.0
|
138
|
+
*/
|
139
|
+
trigger: {
|
140
|
+
type: PropType<TabTriggerEvent>;
|
141
|
+
default: string;
|
142
|
+
};
|
143
|
+
/**
|
144
|
+
* @zh 被选中 tab 的滚动位置,默认 auto 即会将 activeTab 滚动到可见区域,但不会特意做位置调整
|
145
|
+
* @en The scroll position of the selected tab, the default auto will scroll the activeTab to the visible area, but will not adjust the position intentionally
|
146
|
+
* @values 'start', 'end', 'center', 'auto', number
|
147
|
+
*/
|
148
|
+
scrollPosition: {
|
149
|
+
type: PropType<ScrollPosition>;
|
150
|
+
default: string;
|
151
|
+
};
|
152
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
153
|
+
'update:activeKey': (key: string | number) => true;
|
154
|
+
/**
|
155
|
+
* @zh 当前标签值改变时触发
|
156
|
+
* @en Triggered when the current tag value changes
|
157
|
+
* @property { string | number } key
|
158
|
+
*/
|
159
|
+
change: (key: string | number) => true;
|
160
|
+
/**
|
161
|
+
* @zh 用户点击标签时触发
|
162
|
+
* @en Triggered when the user clicks on the tab
|
163
|
+
* @property { string | number } key
|
164
|
+
*/
|
165
|
+
tabClick: (key: string | number, ev: Event) => true;
|
166
|
+
/**
|
167
|
+
* @zh 用户点击增加按钮时触发
|
168
|
+
* @en Triggered when the user clicks the add button
|
169
|
+
*/
|
170
|
+
add: (ev: Event) => true;
|
171
|
+
/**
|
172
|
+
* @zh 用户点击删除按钮时触发
|
173
|
+
* @en Triggered when the user clicks the delete button
|
174
|
+
* @property { string | number } key
|
175
|
+
*/
|
176
|
+
delete: (key: string | number, ev: Event) => true;
|
177
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
178
|
+
/**
|
179
|
+
* @zh 当前选中的标签的 `key`
|
180
|
+
* @en The `key` of the currently selected label
|
181
|
+
* @vModel
|
182
|
+
*/
|
183
|
+
activeKey: {
|
184
|
+
type: (NumberConstructor | StringConstructor)[];
|
185
|
+
default: undefined;
|
186
|
+
};
|
187
|
+
/**
|
188
|
+
* @zh 默认选中的标签的`key`(非受控状态,为空时选中第一个标签页)
|
189
|
+
* @en The `key` of the tab selected by default (uncontrolled state, select the first tab page when it is empty)
|
190
|
+
*/
|
191
|
+
defaultActiveKey: {
|
192
|
+
type: (NumberConstructor | StringConstructor)[];
|
193
|
+
default: undefined;
|
194
|
+
};
|
195
|
+
/**
|
196
|
+
* @zh 选项卡的位置
|
197
|
+
* @en Position of the tab
|
198
|
+
* @values 'left', 'right', 'top', 'bottom'
|
199
|
+
*/
|
200
|
+
position: {
|
201
|
+
type: PropType<TabsPosition>;
|
202
|
+
default: string;
|
203
|
+
};
|
204
|
+
/**
|
205
|
+
* @zh 选项卡的大小
|
206
|
+
* @en The size of the tab
|
207
|
+
* @values 'mini', 'small', 'medium', 'large'
|
208
|
+
*/
|
209
|
+
size: {
|
210
|
+
type: PropType<Size>;
|
211
|
+
};
|
212
|
+
/**
|
213
|
+
* @zh 选项卡的类型
|
214
|
+
* @en The type of tab
|
215
|
+
* @values 'line', 'card', 'card-gutter', 'text', 'rounded', 'capsule'
|
216
|
+
*/
|
217
|
+
type: {
|
218
|
+
type: PropType<TabsType>;
|
219
|
+
default: string;
|
220
|
+
};
|
221
|
+
/**
|
222
|
+
* @zh 选项卡的方向
|
223
|
+
* @en The direction of tab
|
224
|
+
* @values 'horizontal', 'vertical'
|
225
|
+
*/
|
226
|
+
direction: {
|
227
|
+
type: PropType<Direction>;
|
228
|
+
default: string;
|
229
|
+
};
|
230
|
+
/**
|
231
|
+
* @zh 是否开启可编辑模式
|
232
|
+
* @en Whether to enable editable mode
|
233
|
+
*/
|
234
|
+
editable: {
|
235
|
+
type: BooleanConstructor;
|
236
|
+
default: boolean;
|
237
|
+
};
|
238
|
+
/**
|
239
|
+
* @zh 是否显示增加按钮(仅在可编辑模式可用)
|
240
|
+
* @en Whether to display the add button (only available in editable mode)
|
241
|
+
*/
|
242
|
+
showAddButton: {
|
243
|
+
type: BooleanConstructor;
|
244
|
+
default: boolean;
|
245
|
+
};
|
246
|
+
/**
|
247
|
+
* @zh 是否在不显示标签时销毁内容
|
248
|
+
* @en Whether to destroy the content when the label is not displayed
|
249
|
+
* @version 2.27.0
|
250
|
+
*/
|
251
|
+
destroyOnHide: {
|
252
|
+
type: BooleanConstructor;
|
253
|
+
default: boolean;
|
254
|
+
};
|
255
|
+
/**
|
256
|
+
* @zh 是否在首次展示标签时挂载内容
|
257
|
+
* @en Whether to mount the content when the label is first displayed
|
258
|
+
*/
|
259
|
+
lazyLoad: {
|
260
|
+
type: BooleanConstructor;
|
261
|
+
default: boolean;
|
262
|
+
};
|
263
|
+
/**
|
264
|
+
* @zh 高度撑满容器,只在水平模式下生效。
|
265
|
+
* @en The height of the container is fully supported, and it only takes effect in horizontal mode.
|
266
|
+
*/
|
267
|
+
justify: {
|
268
|
+
type: BooleanConstructor;
|
269
|
+
default: boolean;
|
270
|
+
};
|
271
|
+
/**
|
272
|
+
* @zh 是否开启选项内容过渡动画
|
273
|
+
* @en Whether to enable option content transition animation
|
274
|
+
*/
|
275
|
+
animation: {
|
276
|
+
type: BooleanConstructor;
|
277
|
+
default: boolean;
|
278
|
+
};
|
279
|
+
/**
|
280
|
+
* @zh 选项卡头部是否存在水平边距。仅对 `type` 等于 `line`、`text` 类型的选项卡生效
|
281
|
+
* @en Whether there is a horizontal margin on the header of the tab. Only valid for tabs with `type` equal to `line` and `text` type
|
282
|
+
* @version 2.10.0
|
283
|
+
*/
|
284
|
+
headerPadding: {
|
285
|
+
type: BooleanConstructor;
|
286
|
+
default: boolean;
|
287
|
+
};
|
288
|
+
/**
|
289
|
+
* @zh 创建标签后是否切换到新标签(最后一个)
|
290
|
+
* @en Whether to switch to a new tab after creating a tab (the last one)
|
291
|
+
* @version 2.18.0
|
292
|
+
*/
|
293
|
+
autoSwitch: {
|
294
|
+
type: BooleanConstructor;
|
295
|
+
default: boolean;
|
296
|
+
};
|
297
|
+
/**
|
298
|
+
* @zh 是否隐藏内容
|
299
|
+
* @en Whether to hide content
|
300
|
+
* @version 2.25.0
|
301
|
+
*/
|
302
|
+
hideContent: {
|
303
|
+
type: BooleanConstructor;
|
304
|
+
default: boolean;
|
305
|
+
};
|
306
|
+
/**
|
307
|
+
* @zh 触发方式
|
308
|
+
* @en Trigger method
|
309
|
+
* @values 'hover','click'
|
310
|
+
* @version 2.34.0
|
311
|
+
*/
|
312
|
+
trigger: {
|
313
|
+
type: PropType<TabTriggerEvent>;
|
314
|
+
default: string;
|
315
|
+
};
|
316
|
+
/**
|
317
|
+
* @zh 被选中 tab 的滚动位置,默认 auto 即会将 activeTab 滚动到可见区域,但不会特意做位置调整
|
318
|
+
* @en The scroll position of the selected tab, the default auto will scroll the activeTab to the visible area, but will not adjust the position intentionally
|
319
|
+
* @values 'start', 'end', 'center', 'auto', number
|
320
|
+
*/
|
321
|
+
scrollPosition: {
|
322
|
+
type: PropType<ScrollPosition>;
|
323
|
+
default: string;
|
324
|
+
};
|
325
|
+
}>> & Readonly<{
|
326
|
+
onDelete?: ((key: string | number, ev: Event) => any) | undefined;
|
327
|
+
onAdd?: ((ev: Event) => any) | undefined;
|
328
|
+
onChange?: ((key: string | number) => any) | undefined;
|
329
|
+
"onUpdate:activeKey"?: ((key: string | number) => any) | undefined;
|
330
|
+
onTabClick?: ((key: string | number, ev: Event) => any) | undefined;
|
331
|
+
}>, {
|
332
|
+
type: TabsType;
|
333
|
+
direction: "horizontal" | "vertical";
|
334
|
+
position: TabsPosition;
|
335
|
+
animation: boolean;
|
336
|
+
justify: boolean;
|
337
|
+
trigger: TabTriggerEvent;
|
338
|
+
editable: boolean;
|
339
|
+
lazyLoad: boolean;
|
340
|
+
destroyOnHide: boolean;
|
341
|
+
activeKey: string | number;
|
342
|
+
showAddButton: boolean;
|
343
|
+
headerPadding: boolean;
|
344
|
+
scrollPosition: ScrollPosition;
|
345
|
+
defaultActiveKey: string | number;
|
346
|
+
autoSwitch: boolean;
|
347
|
+
hideContent: boolean;
|
348
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
349
|
+
export default _default;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { InjectionKey } from 'vue';
|
2
|
+
import { TabData, TabTriggerEvent } from './interface';
|
3
|
+
export interface TabsContext {
|
4
|
+
lazyLoad: boolean;
|
5
|
+
destroyOnHide: boolean;
|
6
|
+
activeKey: string | number;
|
7
|
+
addItem: (id: number, data: TabData) => void;
|
8
|
+
removeItem: (id: number) => void;
|
9
|
+
trigger: TabTriggerEvent;
|
10
|
+
}
|
11
|
+
export declare const tabsInjectionKey: InjectionKey<TabsContext>;
|