@antify/ui 1.2.0 → 1.3.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/components/AntTooltip.vue +27 -6
- package/dist/components/__stories/AntTooltip.stories.js +3 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +1 -1
- package/dist/components/buttons/AntButton.vue +2 -2
- package/dist/components/crud/AntCrudDetailNav.vue +1 -0
- package/dist/components/inputs/AntDateInput.vue +1 -1
- package/dist/components/inputs/AntTextarea.vue +9 -1
- package/dist/components/inputs/Elements/AntSelectMenu.vue +0 -1
- package/dist/components/inputs/__stories/AntTextInput.stories.js +1 -0
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +1 -0
- package/dist/components/tabs/AntTabItem.vue +9 -2
- package/dist/components/tabs/AntTabs.vue +6 -2
- package/dist/components/tabs/__stories/AntTabs.stories.d.ts +1 -0
- package/dist/components/tabs/__stories/AntTabs.stories.js +112 -6
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +120 -5
- package/dist/components/tabs/__types/AntTabItem.types.d.ts +1 -0
- package/dist/components/tabs/__types/AntTabItem.types.js +1 -0
- package/dist/components/tabs/__types/AntTabItem.types.mjs +1 -0
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ const props = withDefaults(defineProps<{
|
|
|
18
18
|
const floatOpen = ref<boolean>(false)
|
|
19
19
|
const clickLock = ref(false);
|
|
20
20
|
const timeout = ref<number | undefined>();
|
|
21
|
+
const hoverFloat = ref<boolean>(false)
|
|
22
|
+
const hoverReference = ref<boolean>(false)
|
|
21
23
|
|
|
22
24
|
const reference = ref<HTMLElement | null>(null)
|
|
23
25
|
const floating = ref<HTMLElement | null>(null)
|
|
@@ -94,10 +96,6 @@ const _tooltipClasses = computed(() => ({
|
|
|
94
96
|
}));
|
|
95
97
|
|
|
96
98
|
function onMouseOver() {
|
|
97
|
-
if (floatOpen.value || clickLock.value) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
99
|
/**
|
|
102
100
|
* To prevent buggy behavior when hovering over multiple tooltips in quick succession,
|
|
103
101
|
* we clear the timeout before setting a new one.
|
|
@@ -110,8 +108,29 @@ function onMouseOver() {
|
|
|
110
108
|
function onMouseLeave() {
|
|
111
109
|
clearTimeout(timeout.value);
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
timeout.value = setTimeout(() => {
|
|
112
|
+
if (!hoverFloat.value) {
|
|
113
|
+
floatOpen.value = false
|
|
114
|
+
clickLock.value = false;
|
|
115
|
+
}
|
|
116
|
+
}, props.delay) as unknown as number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function onMouseEnterTooltip() {
|
|
120
|
+
clearTimeout(timeout.value);
|
|
121
|
+
|
|
122
|
+
floatOpen.value = true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function onMouseLeaveTooltip() {
|
|
126
|
+
clearTimeout(timeout.value);
|
|
127
|
+
|
|
128
|
+
timeout.value = setTimeout(() => {
|
|
129
|
+
if (!hoverReference.value) {
|
|
130
|
+
floatOpen.value = false
|
|
131
|
+
clickLock.value = false;
|
|
132
|
+
}
|
|
133
|
+
}, props.delay) as unknown as number;
|
|
115
134
|
}
|
|
116
135
|
|
|
117
136
|
function onClick() {
|
|
@@ -147,6 +166,8 @@ function onClick() {
|
|
|
147
166
|
? 'block'
|
|
148
167
|
: 'none',
|
|
149
168
|
}"
|
|
169
|
+
@mouseenter="() => onMouseEnterTooltip()"
|
|
170
|
+
@mouseleave="() => onMouseLeaveTooltip()"
|
|
150
171
|
data-e2e="tooltip-content"
|
|
151
172
|
>
|
|
152
173
|
<div
|
|
@@ -80,7 +80,9 @@ const Docs = exports.Docs = {
|
|
|
80
80
|
});
|
|
81
81
|
await step("Leave hover state and expect not showing the tooltip anymore", async () => {
|
|
82
82
|
await _test.userEvent.unhover(target);
|
|
83
|
-
await (0, _test.expect)(queryTooltip()).not.toBeInTheDocument()
|
|
83
|
+
await (0, _test.waitFor)(() => (0, _test.expect)(queryTooltip()).not.toBeInTheDocument(), {
|
|
84
|
+
timeout: 600
|
|
85
|
+
});
|
|
84
86
|
});
|
|
85
87
|
await step("Hover over the target, wait until the tooltip is visible, click the target and expect not showing the tooltip", async () => {
|
|
86
88
|
await _test.userEvent.hover(target);
|
|
@@ -58,7 +58,7 @@ export const Docs = {
|
|
|
58
58
|
});
|
|
59
59
|
await step("Leave hover state and expect not showing the tooltip anymore", async () => {
|
|
60
60
|
await userEvent.unhover(target);
|
|
61
|
-
await expect(queryTooltip()).not.toBeInTheDocument();
|
|
61
|
+
await waitFor(() => expect(queryTooltip()).not.toBeInTheDocument(), { timeout: 600 });
|
|
62
62
|
});
|
|
63
63
|
await step("Hover over the target, wait until the tooltip is visible, click the target and expect not showing the tooltip", async () => {
|
|
64
64
|
await userEvent.hover(target);
|
|
@@ -207,8 +207,8 @@ onMounted(() => {
|
|
|
207
207
|
:to="to"
|
|
208
208
|
:disabled="disabled || undefined"
|
|
209
209
|
:tabindex="noFocus || hasInputState ? '-1' : '0'"
|
|
210
|
-
@click="() => !props.readonly ? $emit('click') : null"
|
|
211
|
-
@blur="() => !props.readonly ? $emit('blur') : null"
|
|
210
|
+
@click="(e: MouseEvent) => !props.readonly ? $emit('click', e) : null"
|
|
211
|
+
@blur="(e: FocusEvent) => !props.readonly ? $emit('blur', e) : null"
|
|
212
212
|
>
|
|
213
213
|
<AntSpinner
|
|
214
214
|
v-if="spinner"
|
|
@@ -95,7 +95,7 @@ function onClickCalendar() {
|
|
|
95
95
|
:icon="_icon"
|
|
96
96
|
:color="iconColor"
|
|
97
97
|
:size="iconSize"
|
|
98
|
-
:class="{'cursor-pointer': !disabled, 'opacity-50': disabled}"
|
|
98
|
+
:class="{'cursor-pointer': !disabled && !readonly, 'opacity-50': disabled}"
|
|
99
99
|
@click="onClickCalendar"
|
|
100
100
|
/>
|
|
101
101
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted, watch} from 'vue';
|
|
2
|
+
import {computed, onMounted, ref, watch} from 'vue';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
4
|
import AntSkeleton from '../AntSkeleton.vue';
|
|
5
5
|
import AntIcon from '../AntIcon.vue';
|
|
@@ -49,6 +49,7 @@ const props = withDefaults(defineProps<{
|
|
|
49
49
|
resize: true,
|
|
50
50
|
messages: () => []
|
|
51
51
|
});
|
|
52
|
+
|
|
52
53
|
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
53
54
|
const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
|
|
54
55
|
const icons = {
|
|
@@ -111,6 +112,7 @@ const iconColor = computed(() => {
|
|
|
111
112
|
});
|
|
112
113
|
const _wrapperClass = computed(() => classesToObjectSyntax(props.wrapperClass));
|
|
113
114
|
const icon = computed(() => icons[props.state]);
|
|
115
|
+
const textAreaRef = ref();
|
|
114
116
|
const getIconSize = computed(() => {
|
|
115
117
|
if (props.size === Size.xs || props.size === Size.xs2) {
|
|
116
118
|
return IconSize.xs;
|
|
@@ -144,6 +146,11 @@ function onBlur(e: FocusEvent) {
|
|
|
144
146
|
emit('validate', props.modelValue);
|
|
145
147
|
emit('blur', e);
|
|
146
148
|
}
|
|
149
|
+
|
|
150
|
+
defineExpose({
|
|
151
|
+
getTextAreaRef: () => textAreaRef.value
|
|
152
|
+
});
|
|
153
|
+
|
|
147
154
|
</script>
|
|
148
155
|
|
|
149
156
|
<template>
|
|
@@ -168,6 +175,7 @@ function onBlur(e: FocusEvent) {
|
|
|
168
175
|
:placeholder="placeholder !== undefined ? placeholder : label"
|
|
169
176
|
:disabled="disabled || skeleton"
|
|
170
177
|
:readonly="readonly"
|
|
178
|
+
ref="textAreaRef"
|
|
171
179
|
v-bind="$attrs"
|
|
172
180
|
@blur="onBlur"
|
|
173
181
|
/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import AntIcon from '../AntIcon.vue';
|
|
3
3
|
import {
|
|
4
|
+
faCircleInfo,
|
|
4
5
|
faExclamationCircle,
|
|
5
6
|
faExclamationTriangle,
|
|
6
7
|
type IconDefinition
|
|
@@ -30,6 +31,7 @@ const route = useRoute();
|
|
|
30
31
|
|
|
31
32
|
const icons = {
|
|
32
33
|
[TabItemState.base]: null,
|
|
34
|
+
[TabItemState.info]: faCircleInfo,
|
|
33
35
|
[TabItemState.danger]: faExclamationCircle,
|
|
34
36
|
[TabItemState.warning]: faExclamationTriangle,
|
|
35
37
|
};
|
|
@@ -48,22 +50,25 @@ const _active = computed<boolean>(() => {
|
|
|
48
50
|
const containerClasses = computed(() => {
|
|
49
51
|
const variants: Record<TabItemState, string> = {
|
|
50
52
|
[TabItemState.base]: 'hover:bg-neutral-100',
|
|
53
|
+
[TabItemState.info]: 'hover:bg-neutral-100',
|
|
51
54
|
[TabItemState.warning]: 'hover:bg-warning-100',
|
|
52
55
|
[TabItemState.danger]: 'hover:bg-danger-100',
|
|
53
56
|
};
|
|
54
57
|
const activeVariants: Record<TabItemState, string> = {
|
|
55
58
|
[TabItemState.base]: 'text-primary-500 border-primary-500',
|
|
59
|
+
[TabItemState.info]: 'text-info-500 border-info-500',
|
|
56
60
|
[TabItemState.warning]: 'text-warning-500 border-warning-500',
|
|
57
61
|
[TabItemState.danger]: 'text-danger-500 border-danger-500',
|
|
58
62
|
};
|
|
59
63
|
const notActiveVariants: Record<TabItemState, string> = {
|
|
60
|
-
[TabItemState.base]: 'text-for-white-bg-font
|
|
64
|
+
[TabItemState.base]: 'text-for-white-bg-font',
|
|
65
|
+
[TabItemState.info]: 'text-info-500',
|
|
61
66
|
[TabItemState.warning]: 'text-warning-500',
|
|
62
67
|
[TabItemState.danger]: 'text-danger-500',
|
|
63
68
|
};
|
|
64
69
|
|
|
65
70
|
return {
|
|
66
|
-
'p-2 text-center flex items-center justify-center gap-2 bg-white transition-[background-color] relative text-sm': true,
|
|
71
|
+
'p-2 text-center flex items-center justify-center gap-2 bg-white transition-[background-color] relative text-sm text-nowrap': true,
|
|
67
72
|
'grow': props.expanded,
|
|
68
73
|
[variants[props.state]]: !props.disabled,
|
|
69
74
|
[activeVariants[props.state]]: _active.value,
|
|
@@ -75,6 +80,7 @@ const containerClasses = computed(() => {
|
|
|
75
80
|
const borderBoxClasses = computed(() => {
|
|
76
81
|
const variants: Record<TabItemState, string> = {
|
|
77
82
|
[TabItemState.base]: 'bg-primary-500',
|
|
83
|
+
[TabItemState.info]: 'bg-info-500',
|
|
78
84
|
[TabItemState.warning]: 'bg-warning-500',
|
|
79
85
|
[TabItemState.danger]: 'bg-danger-500',
|
|
80
86
|
};
|
|
@@ -87,6 +93,7 @@ const borderBoxClasses = computed(() => {
|
|
|
87
93
|
const iconColor = computed(() => {
|
|
88
94
|
const variants = {
|
|
89
95
|
[TabItemState.base]: 'text-neutral-100-font',
|
|
96
|
+
[TabItemState.info]: 'text-info-500',
|
|
90
97
|
[TabItemState.warning]: 'text-warning-500',
|
|
91
98
|
[TabItemState.danger]: 'text-danger-500',
|
|
92
99
|
};
|
|
@@ -17,8 +17,10 @@ const props = withDefaults(defineProps<{
|
|
|
17
17
|
|
|
18
18
|
const currentActive = useVModel(props, 'modelValue', emits);
|
|
19
19
|
const containerClasses = computed(() => ({
|
|
20
|
-
'flex
|
|
21
|
-
|
|
20
|
+
'flex transition-all h-full': true,
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
const scrollContainerClasses = computed(() => ({
|
|
22
24
|
'w-full': props.expanded,
|
|
23
25
|
}));
|
|
24
26
|
|
|
@@ -37,6 +39,7 @@ function clickTab(tabItem: TabItem) {
|
|
|
37
39
|
|
|
38
40
|
<template>
|
|
39
41
|
<div :class="containerClasses">
|
|
42
|
+
<div class="flex gap-px bg-neutral-300 border-l border-r border-neutral-300 overflow-x-auto" :class="scrollContainerClasses">
|
|
40
43
|
<slot>
|
|
41
44
|
<AntTabItem
|
|
42
45
|
v-for="(tabItem, index) in tabItems"
|
|
@@ -51,5 +54,6 @@ function clickTab(tabItem: TabItem) {
|
|
|
51
54
|
<slot name="content" v-bind="{item: tabItem, isActive: currentActive === tabItem.id}"></slot>
|
|
52
55
|
</AntTabItem>
|
|
53
56
|
</slot>
|
|
57
|
+
</div>
|
|
54
58
|
</div>
|
|
55
59
|
</template>
|
|
@@ -5,5 +5,6 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof AntTabs>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
7
|
export declare const FixedHeight: Story;
|
|
8
|
+
export declare const HorizontalScrolling: Story;
|
|
8
9
|
export declare const DifferentStates: Story;
|
|
9
10
|
export declare const Summary: Story;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
module.exports = exports.Summary = exports.FixedHeight = exports.Docs = exports.DifferentStates = void 0;
|
|
6
|
+
module.exports = exports.Summary = exports.HorizontalScrolling = exports.FixedHeight = exports.Docs = exports.DifferentStates = void 0;
|
|
7
7
|
var _AntTabs = _interopRequireDefault(require("../AntTabs.vue"));
|
|
8
8
|
var _AntFormGroupLabel = _interopRequireDefault(require("../../forms/AntFormGroupLabel.vue"));
|
|
9
9
|
var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
|
|
@@ -83,6 +83,68 @@ const FixedHeight = exports.FixedHeight = {
|
|
|
83
83
|
}),
|
|
84
84
|
args: Docs.args
|
|
85
85
|
};
|
|
86
|
+
const HorizontalScrolling = exports.HorizontalScrolling = {
|
|
87
|
+
render: args => ({
|
|
88
|
+
components: {
|
|
89
|
+
AntTabs: _AntTabs.default,
|
|
90
|
+
AntFormGroupLabel: _AntFormGroupLabel.default,
|
|
91
|
+
AntFormGroup: _AntFormGroup.default
|
|
92
|
+
},
|
|
93
|
+
setup() {
|
|
94
|
+
return {
|
|
95
|
+
args
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
template: `
|
|
99
|
+
<AntFormGroup>
|
|
100
|
+
|
|
101
|
+
<AntFormGroupLabel>Default Small</AntFormGroupLabel>
|
|
102
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
103
|
+
<AntTabs v-bind="args" v-model="args.modelValue" />
|
|
104
|
+
</AntFormGroup>
|
|
105
|
+
|
|
106
|
+
<AntFormGroupLabel>Expanded Small</AntFormGroupLabel>
|
|
107
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
108
|
+
<AntTabs v-bind="args" v-model="args.modelValue" expanded />
|
|
109
|
+
</AntFormGroup>
|
|
110
|
+
|
|
111
|
+
<AntFormGroupLabel>Default Large</AntFormGroupLabel>
|
|
112
|
+
<AntFormGroup class="dashed">
|
|
113
|
+
<AntTabs v-bind="args" v-model="args.modelValue" />
|
|
114
|
+
</AntFormGroup>
|
|
115
|
+
|
|
116
|
+
<AntFormGroupLabel>Expanded Large</AntFormGroupLabel>
|
|
117
|
+
<AntFormGroup class="dashed">
|
|
118
|
+
<AntTabs v-bind="args" v-model="args.modelValue" expanded />
|
|
119
|
+
</AntFormGroup>
|
|
120
|
+
|
|
121
|
+
</AntFormGroup>
|
|
122
|
+
`
|
|
123
|
+
}),
|
|
124
|
+
args: {
|
|
125
|
+
tabItems: [{
|
|
126
|
+
id: "1",
|
|
127
|
+
label: "First tab"
|
|
128
|
+
}, {
|
|
129
|
+
id: "2",
|
|
130
|
+
label: "Second tab"
|
|
131
|
+
}, {
|
|
132
|
+
id: "3",
|
|
133
|
+
label: "Third tab",
|
|
134
|
+
state: _AntTabItem.TabItemState.warning
|
|
135
|
+
}, {
|
|
136
|
+
id: "4",
|
|
137
|
+
label: "Fourth tab",
|
|
138
|
+
state: _AntTabItem.TabItemState.danger
|
|
139
|
+
}, {
|
|
140
|
+
id: "5",
|
|
141
|
+
label: "Fifth tab"
|
|
142
|
+
}, {
|
|
143
|
+
id: "6",
|
|
144
|
+
label: "Sixth tab"
|
|
145
|
+
}]
|
|
146
|
+
}
|
|
147
|
+
};
|
|
86
148
|
const DifferentStates = exports.DifferentStates = {
|
|
87
149
|
render: Docs.render,
|
|
88
150
|
args: {
|
|
@@ -100,6 +162,10 @@ const DifferentStates = exports.DifferentStates = {
|
|
|
100
162
|
id: "4",
|
|
101
163
|
label: "Fourth tab",
|
|
102
164
|
state: _AntTabItem.TabItemState.danger
|
|
165
|
+
}, {
|
|
166
|
+
id: "5",
|
|
167
|
+
label: "Fifth tab",
|
|
168
|
+
state: _AntTabItem.TabItemState.info
|
|
103
169
|
}]
|
|
104
170
|
}
|
|
105
171
|
};
|
|
@@ -114,6 +180,7 @@ const Summary = exports.Summary = {
|
|
|
114
180
|
const value_1 = (0, _vue.ref)();
|
|
115
181
|
const value_2 = (0, _vue.ref)();
|
|
116
182
|
const value_3 = (0, _vue.ref)("2");
|
|
183
|
+
const value_4 = (0, _vue.ref)();
|
|
117
184
|
const tabItems_1 = [{
|
|
118
185
|
id: "1",
|
|
119
186
|
label: "My account"
|
|
@@ -146,14 +213,38 @@ const Summary = exports.Summary = {
|
|
|
146
213
|
label: "Messages",
|
|
147
214
|
to: "/#"
|
|
148
215
|
}];
|
|
216
|
+
const tabItems_4 = [{
|
|
217
|
+
id: "1",
|
|
218
|
+
label: "First tab"
|
|
219
|
+
}, {
|
|
220
|
+
id: "2",
|
|
221
|
+
label: "Second tab"
|
|
222
|
+
}, {
|
|
223
|
+
id: "3",
|
|
224
|
+
label: "Third tab",
|
|
225
|
+
state: _AntTabItem.TabItemState.warning
|
|
226
|
+
}, {
|
|
227
|
+
id: "4",
|
|
228
|
+
label: "Fourth tab",
|
|
229
|
+
state: _AntTabItem.TabItemState.danger
|
|
230
|
+
}, {
|
|
231
|
+
id: "5",
|
|
232
|
+
label: "Fifth tab",
|
|
233
|
+
state: _AntTabItem.TabItemState.info
|
|
234
|
+
}, {
|
|
235
|
+
id: "6",
|
|
236
|
+
label: "Sixth tab"
|
|
237
|
+
}];
|
|
149
238
|
return {
|
|
150
239
|
args,
|
|
151
240
|
value_1,
|
|
152
241
|
value_2,
|
|
153
242
|
value_3,
|
|
243
|
+
value_4,
|
|
154
244
|
tabItems_1,
|
|
155
245
|
tabItems_2,
|
|
156
|
-
tabItems_3
|
|
246
|
+
tabItems_3,
|
|
247
|
+
tabItems_4
|
|
157
248
|
};
|
|
158
249
|
},
|
|
159
250
|
template: `
|
|
@@ -167,15 +258,30 @@ const Summary = exports.Summary = {
|
|
|
167
258
|
|
|
168
259
|
<AntFormGroupLabel>Expanded</AntFormGroupLabel>
|
|
169
260
|
<AntFormGroup>
|
|
170
|
-
<div class="dashed"><AntTabs v-model="value_1" :tab-items="tabItems_1" expanded
|
|
171
|
-
<div class="dashed"><AntTabs v-model="value_2" :tab-items="tabItems_2" expanded
|
|
172
|
-
<div class="dashed"><AntTabs v-model="value_3" :tab-items="tabItems_3" expanded
|
|
261
|
+
<div class="dashed"><AntTabs v-model="value_1" :tab-items="tabItems_1" expanded/></div>
|
|
262
|
+
<div class="dashed"><AntTabs v-model="value_2" :tab-items="tabItems_2" expanded/></div>
|
|
263
|
+
<div class="dashed"><AntTabs v-model="value_3" :tab-items="tabItems_3" expanded/></div>
|
|
173
264
|
</AntFormGroup>
|
|
174
265
|
|
|
175
266
|
<AntFormGroupLabel>Larger container</AntFormGroupLabel>
|
|
176
267
|
<div class="h-16 dashed">
|
|
177
|
-
<AntTabs v-model="value_3" :tab-items="tabItems_3" expanded
|
|
268
|
+
<AntTabs v-model="value_3" :tab-items="tabItems_3" expanded/>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<AntFormGroupLabel>Different States</AntFormGroupLabel>
|
|
272
|
+
<div class="dashed">
|
|
273
|
+
<AntTabs v-model="value_4" :tab-items="tabItems_4" />
|
|
178
274
|
</div>
|
|
275
|
+
|
|
276
|
+
<AntFormGroupLabel>Default Small Parent Container</AntFormGroupLabel>
|
|
277
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
278
|
+
<AntTabs v-model="value_4" :tab-items="tabItems_4" />
|
|
279
|
+
</AntFormGroup>
|
|
280
|
+
|
|
281
|
+
<AntFormGroupLabel>Expanded Small Parent Container</AntFormGroupLabel>
|
|
282
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
283
|
+
<AntTabs v-model="value_4" :tab-items="tabItems_4" expanded />
|
|
284
|
+
</AntFormGroup>
|
|
179
285
|
</AntFormGroup>
|
|
180
286
|
`
|
|
181
287
|
}),
|
|
@@ -69,6 +69,69 @@ export const FixedHeight = {
|
|
|
69
69
|
}),
|
|
70
70
|
args: Docs.args
|
|
71
71
|
};
|
|
72
|
+
export const HorizontalScrolling = {
|
|
73
|
+
render: (args) => ({
|
|
74
|
+
components: { AntTabs, AntFormGroupLabel, AntFormGroup },
|
|
75
|
+
setup() {
|
|
76
|
+
return { args };
|
|
77
|
+
},
|
|
78
|
+
template: `
|
|
79
|
+
<AntFormGroup>
|
|
80
|
+
|
|
81
|
+
<AntFormGroupLabel>Default Small</AntFormGroupLabel>
|
|
82
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
83
|
+
<AntTabs v-bind="args" v-model="args.modelValue" />
|
|
84
|
+
</AntFormGroup>
|
|
85
|
+
|
|
86
|
+
<AntFormGroupLabel>Expanded Small</AntFormGroupLabel>
|
|
87
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
88
|
+
<AntTabs v-bind="args" v-model="args.modelValue" expanded />
|
|
89
|
+
</AntFormGroup>
|
|
90
|
+
|
|
91
|
+
<AntFormGroupLabel>Default Large</AntFormGroupLabel>
|
|
92
|
+
<AntFormGroup class="dashed">
|
|
93
|
+
<AntTabs v-bind="args" v-model="args.modelValue" />
|
|
94
|
+
</AntFormGroup>
|
|
95
|
+
|
|
96
|
+
<AntFormGroupLabel>Expanded Large</AntFormGroupLabel>
|
|
97
|
+
<AntFormGroup class="dashed">
|
|
98
|
+
<AntTabs v-bind="args" v-model="args.modelValue" expanded />
|
|
99
|
+
</AntFormGroup>
|
|
100
|
+
|
|
101
|
+
</AntFormGroup>
|
|
102
|
+
`
|
|
103
|
+
}),
|
|
104
|
+
args: {
|
|
105
|
+
tabItems: [
|
|
106
|
+
{
|
|
107
|
+
id: "1",
|
|
108
|
+
label: "First tab"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "2",
|
|
112
|
+
label: "Second tab"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "3",
|
|
116
|
+
label: "Third tab",
|
|
117
|
+
state: TabItemState.warning
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "4",
|
|
121
|
+
label: "Fourth tab",
|
|
122
|
+
state: TabItemState.danger
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "5",
|
|
126
|
+
label: "Fifth tab"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "6",
|
|
130
|
+
label: "Sixth tab"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
};
|
|
72
135
|
export const DifferentStates = {
|
|
73
136
|
render: Docs.render,
|
|
74
137
|
args: {
|
|
@@ -90,6 +153,11 @@ export const DifferentStates = {
|
|
|
90
153
|
id: "4",
|
|
91
154
|
label: "Fourth tab",
|
|
92
155
|
state: TabItemState.danger
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: "5",
|
|
159
|
+
label: "Fifth tab",
|
|
160
|
+
state: TabItemState.info
|
|
93
161
|
}
|
|
94
162
|
]
|
|
95
163
|
}
|
|
@@ -101,6 +169,7 @@ export const Summary = {
|
|
|
101
169
|
const value_1 = ref();
|
|
102
170
|
const value_2 = ref();
|
|
103
171
|
const value_3 = ref("2");
|
|
172
|
+
const value_4 = ref();
|
|
104
173
|
const tabItems_1 = [
|
|
105
174
|
{
|
|
106
175
|
id: "1",
|
|
@@ -142,14 +211,45 @@ export const Summary = {
|
|
|
142
211
|
to: "/#"
|
|
143
212
|
}
|
|
144
213
|
];
|
|
214
|
+
const tabItems_4 = [
|
|
215
|
+
{
|
|
216
|
+
id: "1",
|
|
217
|
+
label: "First tab"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "2",
|
|
221
|
+
label: "Second tab"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: "3",
|
|
225
|
+
label: "Third tab",
|
|
226
|
+
state: TabItemState.warning
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "4",
|
|
230
|
+
label: "Fourth tab",
|
|
231
|
+
state: TabItemState.danger
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: "5",
|
|
235
|
+
label: "Fifth tab",
|
|
236
|
+
state: TabItemState.info
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: "6",
|
|
240
|
+
label: "Sixth tab"
|
|
241
|
+
}
|
|
242
|
+
];
|
|
145
243
|
return {
|
|
146
244
|
args,
|
|
147
245
|
value_1,
|
|
148
246
|
value_2,
|
|
149
247
|
value_3,
|
|
248
|
+
value_4,
|
|
150
249
|
tabItems_1,
|
|
151
250
|
tabItems_2,
|
|
152
|
-
tabItems_3
|
|
251
|
+
tabItems_3,
|
|
252
|
+
tabItems_4
|
|
153
253
|
};
|
|
154
254
|
},
|
|
155
255
|
template: `
|
|
@@ -163,15 +263,30 @@ export const Summary = {
|
|
|
163
263
|
|
|
164
264
|
<AntFormGroupLabel>Expanded</AntFormGroupLabel>
|
|
165
265
|
<AntFormGroup>
|
|
166
|
-
<div class="dashed"><AntTabs v-model="value_1" :tab-items="tabItems_1" expanded
|
|
167
|
-
<div class="dashed"><AntTabs v-model="value_2" :tab-items="tabItems_2" expanded
|
|
168
|
-
<div class="dashed"><AntTabs v-model="value_3" :tab-items="tabItems_3" expanded
|
|
266
|
+
<div class="dashed"><AntTabs v-model="value_1" :tab-items="tabItems_1" expanded/></div>
|
|
267
|
+
<div class="dashed"><AntTabs v-model="value_2" :tab-items="tabItems_2" expanded/></div>
|
|
268
|
+
<div class="dashed"><AntTabs v-model="value_3" :tab-items="tabItems_3" expanded/></div>
|
|
169
269
|
</AntFormGroup>
|
|
170
270
|
|
|
171
271
|
<AntFormGroupLabel>Larger container</AntFormGroupLabel>
|
|
172
272
|
<div class="h-16 dashed">
|
|
173
|
-
<AntTabs v-model="value_3" :tab-items="tabItems_3" expanded
|
|
273
|
+
<AntTabs v-model="value_3" :tab-items="tabItems_3" expanded/>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<AntFormGroupLabel>Different States</AntFormGroupLabel>
|
|
277
|
+
<div class="dashed">
|
|
278
|
+
<AntTabs v-model="value_4" :tab-items="tabItems_4" />
|
|
174
279
|
</div>
|
|
280
|
+
|
|
281
|
+
<AntFormGroupLabel>Default Small Parent Container</AntFormGroupLabel>
|
|
282
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
283
|
+
<AntTabs v-model="value_4" :tab-items="tabItems_4" />
|
|
284
|
+
</AntFormGroup>
|
|
285
|
+
|
|
286
|
+
<AntFormGroupLabel>Expanded Small Parent Container</AntFormGroupLabel>
|
|
287
|
+
<AntFormGroup class="dashed max-w-[320px] overflow-hidden">
|
|
288
|
+
<AntTabs v-model="value_4" :tab-items="tabItems_4" expanded />
|
|
289
|
+
</AntFormGroup>
|
|
175
290
|
</AntFormGroup>
|
|
176
291
|
`
|
|
177
292
|
}),
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TabItemState = void 0;
|
|
7
7
|
var TabItemState = exports.TabItemState = /* @__PURE__ */(TabItemState2 => {
|
|
8
8
|
TabItemState2["base"] = "base";
|
|
9
|
+
TabItemState2["info"] = "info";
|
|
9
10
|
TabItemState2["warning"] = "warning";
|
|
10
11
|
TabItemState2["danger"] = "danger";
|
|
11
12
|
return TabItemState2;
|