@antify/ui 1.3.0 → 2.1.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/AntAccordion.vue +1 -1
- package/dist/components/AntAlert.vue +2 -2
- package/dist/components/AntCard.vue +1 -1
- package/dist/components/AntDropdown.vue +1 -1
- package/dist/components/AntKeycap.vue +1 -1
- package/dist/components/AntListGroup.vue +1 -1
- package/dist/components/AntListGroupItem.vue +1 -1
- package/dist/components/AntModal.vue +2 -2
- package/dist/components/AntPopover.vue +6 -6
- package/dist/components/AntSpinner.vue +4 -4
- package/dist/components/AntTag.vue +2 -2
- package/dist/components/AntToast.vue +2 -2
- package/dist/components/AntTooltip.vue +5 -3
- package/dist/components/__stories/AntContent.stories.js +1 -1
- package/dist/components/__stories/AntContent.stories.mjs +1 -1
- package/dist/components/__stories/AntListGroup.stories.js +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +1 -1
- package/dist/components/__stories/AntListGroupItem.stories.js +1 -1
- package/dist/components/__stories/AntListGroupItem.stories.mjs +1 -1
- package/dist/components/__stories/AntTooltip.stories.d.ts +1 -0
- package/dist/components/__stories/AntTooltip.stories.js +8 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +7 -0
- package/dist/components/buttons/AntButton.vue +4 -4
- package/dist/components/crud/AntCrud.vue +2 -2
- package/dist/components/crud/AntCrudDetail.vue +1 -1
- package/dist/components/crud/AntCrudTableFilter.vue +18 -20
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.js +1 -1
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +1 -1
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.js +1 -1
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +1 -1
- package/dist/components/dialogs/AntDialog.vue +4 -4
- package/dist/components/dialogs/__stories/AntDialog.stories.js +1 -1
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +1 -1
- package/dist/components/inputs/AntCheckbox.vue +2 -2
- package/dist/components/inputs/AntPasswordInput.vue +1 -1
- package/dist/components/inputs/AntRadio.vue +1 -1
- package/dist/components/inputs/AntRangeSlider.vue +2 -2
- package/dist/components/inputs/AntSelect.vue +2 -2
- package/dist/components/inputs/AntSwitch.vue +2 -2
- package/dist/components/inputs/AntSwitcher.vue +1 -1
- package/dist/components/inputs/AntTagInput.vue +2 -2
- package/dist/components/inputs/AntTextarea.vue +1 -1
- package/dist/components/inputs/Elements/AntBaseInput.vue +1 -1
- package/dist/components/inputs/Elements/AntSelectMenu.vue +27 -28
- package/dist/components/inputs/__stories/AntSelect.stories.d.ts +1 -0
- package/dist/components/inputs/__stories/AntSelect.stories.js +14 -2
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +12 -1
- package/dist/components/layouts/AntNavLeftLayout.vue +2 -2
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.js +1 -1
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +1 -1
- package/dist/components/navbar/AntNavbarItem.vue +1 -1
- package/dist/components/table/AntTable.vue +8 -6
- package/dist/components/table/AntTh.vue +1 -1
- package/dist/components/table/__stories/AntTable.stories.js +38 -2
- package/dist/components/table/__stories/AntTable.stories.mjs +32 -2
- package/dist/components/tabs/AntTabItem.vue +3 -3
- package/dist/components/tabs/AntTabs.vue +1 -1
- package/dist/tailwind.config.js +92 -92
- package/dist/tailwind.config.mjs +92 -92
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ const buttonClasses = computed(() => {
|
|
|
38
38
|
'focus-within:ring-2': !hasInputState.value && (props.size === Size.sm || props.size === Size.xs || props.size === Size.xs2),
|
|
39
39
|
'h-5 w-9': props.size === Size.lg || props.size === Size.md || props.size === Size.sm,
|
|
40
40
|
'h-4 w-[30px]': props.size === Size.xs || props.size === Size.xs2,
|
|
41
|
-
'bg-
|
|
41
|
+
'bg-base-300': !_value.value,
|
|
42
42
|
'invisible': props.skeleton,
|
|
43
43
|
// Disabled
|
|
44
44
|
'opacity-50 cursor-not-allowed': props.disabled,
|
|
@@ -65,7 +65,7 @@ const buttonClasses = computed(() => {
|
|
|
65
65
|
return classes;
|
|
66
66
|
});
|
|
67
67
|
const ballClasses = computed(() => ({
|
|
68
|
-
'pointer-events-none inline-block rounded-full bg-
|
|
68
|
+
'pointer-events-none inline-block rounded-full bg-base-100 shadow transform ring-0 transition ease-in-out duration-200': true,
|
|
69
69
|
'h-4 w-4 translate-y-0.5': props.size === Size.lg || props.size === Size.md || props.size === Size.sm,
|
|
70
70
|
'translate-x-[1.125rem]': _value.value && (props.size === Size.lg || props.size === Size.md || props.size === Size.sm),
|
|
71
71
|
'translate-x-0.5': !_value.value && (props.size === Size.lg || props.size === Size.md || props.size === Size.sm),
|
|
@@ -72,7 +72,7 @@ const itemClasses = computed(() => {
|
|
|
72
72
|
|
|
73
73
|
const colorVariant = {
|
|
74
74
|
[InputState.danger]: 'outline-danger-500 bg-danger-100',
|
|
75
|
-
[InputState.base]: 'outline-
|
|
75
|
+
[InputState.base]: 'outline-base-300 bg-white',
|
|
76
76
|
[InputState.info]: 'outline-info-500 bg-info-100',
|
|
77
77
|
[InputState.success]: 'outline-success-500 bg-success-100',
|
|
78
78
|
[InputState.warning]: 'outline-warning-500 bg-warning-100',
|
|
@@ -64,7 +64,7 @@ const tagInput = ref('');
|
|
|
64
64
|
const inputRef: Ref<HTMLElement | null> = ref(null);
|
|
65
65
|
const inputContainerClasses = computed(() => {
|
|
66
66
|
const variants: Record<InputState, string> = {
|
|
67
|
-
[InputState.base]: 'outline-
|
|
67
|
+
[InputState.base]: 'outline-base-300 focus-within:outline-base-300 focus-within:ring-primary-200 bg-white',
|
|
68
68
|
[InputState.danger]: 'outline-danger-500 focus-within:outline-danger-500 focus-within:ring-danger-200 bg-danger-100',
|
|
69
69
|
[InputState.info]: 'outline-info-500 focus-within:outline-info-500 focus-within:ring-info-200 bg-info-100',
|
|
70
70
|
[InputState.success]: 'outline-success-500 focus-within:outline-success-500 focus-within:ring-success-200 bg-success-100',
|
|
@@ -93,7 +93,7 @@ const inputContainerClasses = computed(() => {
|
|
|
93
93
|
});
|
|
94
94
|
const inputClasses = computed(() => {
|
|
95
95
|
const variants: Record<InputState, string> = {
|
|
96
|
-
[InputState.base]: 'placeholder:text-
|
|
96
|
+
[InputState.base]: 'placeholder:text-base-500',
|
|
97
97
|
[InputState.danger]: 'placeholder:text-danger-700',
|
|
98
98
|
[InputState.info]: 'placeholder:text-info-700',
|
|
99
99
|
[InputState.success]: 'placeholder:text-success-700',
|
|
@@ -62,7 +62,7 @@ const icons = {
|
|
|
62
62
|
/*TODO #59:: If the scrollbar is showing than the pr is moving and the gap between icon and text is bigger and the icon is stuck in the scrollbar*/
|
|
63
63
|
const inputClasses = computed(() => {
|
|
64
64
|
const variants: Record<InputState, string> = {
|
|
65
|
-
[InputState.base]: 'outline-
|
|
65
|
+
[InputState.base]: 'outline-base-300 focus:ring-primary-200 bg-white placeholder:text-base-500',
|
|
66
66
|
[InputState.danger]: 'outline-danger-500 focus:ring-danger-200 bg-danger-100 placeholder:text-danger-700',
|
|
67
67
|
[InputState.info]: 'outline-info-500 focus:ring-info-200 bg-info-100 placeholder:text-info-700',
|
|
68
68
|
[InputState.success]: 'outline-success-500 focus:ring-success-200 bg-success-100 placeholder:text-success-700',
|
|
@@ -60,7 +60,7 @@ const icons = {
|
|
|
60
60
|
};
|
|
61
61
|
const inputClasses = computed(() => {
|
|
62
62
|
const variants: Record<InputState, string> = {
|
|
63
|
-
[InputState.base]: 'outline-
|
|
63
|
+
[InputState.base]: 'outline-base-300 focus:ring-primary-200 bg-white placeholder:text-base-500',
|
|
64
64
|
[InputState.danger]: 'outline-danger-500 focus:ring-danger-200 bg-danger-100 placeholder:text-danger-700',
|
|
65
65
|
[InputState.info]: 'outline-info-500 focus:ring-info-200 bg-info-100 placeholder:text-info-700',
|
|
66
66
|
[InputState.success]: 'outline-success-500 focus:ring-success-200 bg-success-100 placeholder:text-success-700',
|
|
@@ -12,7 +12,6 @@ import type {SelectOption} from '../__types';
|
|
|
12
12
|
import {useElementSize, useVModel, onClickOutside} from '@vueuse/core';
|
|
13
13
|
import type {Validator} from '@antify/validate';
|
|
14
14
|
import {autoUpdate, flip, offset, useFloating} from "@floating-ui/vue";
|
|
15
|
-
import {vOnClickOutside} from '@vueuse/components';
|
|
16
15
|
|
|
17
16
|
const emit = defineEmits(['update:open', 'update:modelValue', 'update:focused', 'selectElement']);
|
|
18
17
|
const props = withDefaults(defineProps<{
|
|
@@ -35,7 +34,7 @@ const props = withDefaults(defineProps<{
|
|
|
35
34
|
closeOnSelectItem: true,
|
|
36
35
|
});
|
|
37
36
|
const reference = ref<HTMLElement | null | undefined>(props.inputRef)
|
|
38
|
-
const
|
|
37
|
+
const elementSize = useElementSize(reference);
|
|
39
38
|
const floating = ref<HTMLElement | null>(null)
|
|
40
39
|
const {floatingStyles, middlewareData, placement} = useFloating(reference, floating, {
|
|
41
40
|
placement: 'bottom',
|
|
@@ -61,7 +60,7 @@ const isOpen = useVModel(props, 'open', emit);
|
|
|
61
60
|
const focusedDropDownItem = useVModel(props, 'focused', emit);
|
|
62
61
|
const dropdownClasses = computed(() => {
|
|
63
62
|
const variants: Record<InputState, string> = {
|
|
64
|
-
[InputState.base]: 'bg-
|
|
63
|
+
[InputState.base]: 'bg-base-300 border-base-300',
|
|
65
64
|
[InputState.success]: 'bg-success-500 border-success-500',
|
|
66
65
|
[InputState.info]: 'bg-info-500 border-info-500',
|
|
67
66
|
[InputState.warning]: 'bg-warning-500 border-warning-500',
|
|
@@ -69,7 +68,7 @@ const dropdownClasses = computed(() => {
|
|
|
69
68
|
};
|
|
70
69
|
|
|
71
70
|
return {
|
|
72
|
-
'w-full border flex flex-col gap-px outline-none -mt-px overflow-
|
|
71
|
+
'w-full border flex flex-col gap-px outline-none -mt-px overflow-y-auto shadow-md z-[90] max-h-[250px]': true,
|
|
73
72
|
'rounded-md': true,
|
|
74
73
|
[variants[props.state]]: true,
|
|
75
74
|
};
|
|
@@ -84,7 +83,7 @@ const dropDownItemClasses = computed(() => {
|
|
|
84
83
|
};
|
|
85
84
|
|
|
86
85
|
return {
|
|
87
|
-
'select-none text-ellipsis overflow-hidden whitespace-nowrap': true,
|
|
86
|
+
'select-none text-ellipsis overflow-hidden whitespace-nowrap min-h-fit': true,
|
|
88
87
|
[variants[props.state]]: true,
|
|
89
88
|
// Size
|
|
90
89
|
'p-1 text-xs': props.size === Size.xs2,
|
|
@@ -168,7 +167,7 @@ function onKeyDownDropDown(e: KeyboardEvent) {
|
|
|
168
167
|
|
|
169
168
|
function getActiveDropDownItemClasses(option: SelectOption) {
|
|
170
169
|
const variants: Record<InputState, string> = {
|
|
171
|
-
[InputState.base]: '!bg-
|
|
170
|
+
[InputState.base]: '!bg-base-100',
|
|
172
171
|
[InputState.success]: 'bg-success-200',
|
|
173
172
|
[InputState.info]: 'bg-info-200',
|
|
174
173
|
[InputState.warning]: 'bg-warning-200',
|
|
@@ -203,31 +202,31 @@ watch(_modelValue, (val) => {
|
|
|
203
202
|
<slot/>
|
|
204
203
|
|
|
205
204
|
<teleport to="body">
|
|
206
|
-
<div
|
|
207
|
-
v-if="isOpen"
|
|
208
|
-
:class="dropdownClasses"
|
|
209
|
-
ref="floating"
|
|
210
|
-
:style="{width: `${width.width.value}px!important`, ...floatingStyles}"
|
|
211
|
-
>
|
|
212
205
|
<div
|
|
213
|
-
v-
|
|
214
|
-
:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
@mouseover="() => focusedDropDownItem = option.value"
|
|
206
|
+
v-if="isOpen"
|
|
207
|
+
:class="dropdownClasses"
|
|
208
|
+
ref="floating"
|
|
209
|
+
:style="{width: `${elementSize.width.value}px!important`, ...floatingStyles}"
|
|
218
210
|
>
|
|
219
|
-
|
|
211
|
+
<div
|
|
212
|
+
v-for="(option, index) in options"
|
|
213
|
+
:key="`option-${index}`"
|
|
214
|
+
:class="{...dropDownItemClasses, ...getActiveDropDownItemClasses(option)}"
|
|
215
|
+
@mousedown="(e) => onClickDropDownItem(e, option.value)"
|
|
216
|
+
@mouseover="() => focusedDropDownItem = option.value"
|
|
217
|
+
>
|
|
218
|
+
{{ option.label }}
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div
|
|
222
|
+
v-if="options.length === 0"
|
|
223
|
+
:class="{...dropDownItemClasses}"
|
|
224
|
+
>
|
|
225
|
+
<slot name="empty">
|
|
226
|
+
No options available
|
|
227
|
+
</slot>
|
|
228
|
+
</div>
|
|
220
229
|
</div>
|
|
221
|
-
|
|
222
|
-
<div
|
|
223
|
-
v-if="options.length === 0"
|
|
224
|
-
:class="{...dropDownItemClasses}"
|
|
225
|
-
>
|
|
226
|
-
<slot name="empty">
|
|
227
|
-
No options available
|
|
228
|
-
</slot>
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
230
|
</teleport>
|
|
232
231
|
</div>
|
|
233
232
|
</template>
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntSelect>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntSelect>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
+
export declare const manyOptions: Story;
|
|
7
8
|
export declare const nullable: Story;
|
|
8
9
|
export declare const skeleton: Story;
|
|
9
10
|
export declare const disabled: Story;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.withPlaceholder = exports.summary = exports.skeleton = exports.nullable = exports.ellipsisText = exports.disabled = exports.default = exports.Docs = void 0;
|
|
6
|
+
exports.withPlaceholder = exports.summary = exports.skeleton = exports.nullable = exports.manyOptions = exports.ellipsisText = exports.disabled = exports.default = exports.Docs = void 0;
|
|
7
7
|
var _Size = require("../../../enums/Size.enum");
|
|
8
8
|
var _AntSelect = _interopRequireDefault(require("../AntSelect.vue"));
|
|
9
9
|
var _AntSelectMenu = _interopRequireDefault(require("../Elements/AntSelectMenu.vue"));
|
|
@@ -75,6 +75,10 @@ const options = [{
|
|
|
75
75
|
label: "Option 4",
|
|
76
76
|
value: "4"
|
|
77
77
|
}];
|
|
78
|
+
const manySelectOptions = [...Array(24).keys()].map(key => ({
|
|
79
|
+
label: `Option ${Number(key) + 1}`,
|
|
80
|
+
value: Number(key) + 1
|
|
81
|
+
}));
|
|
78
82
|
const Docs = exports.Docs = {
|
|
79
83
|
render: args => ({
|
|
80
84
|
components: {
|
|
@@ -115,6 +119,13 @@ const Docs = exports.Docs = {
|
|
|
115
119
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
116
120
|
}
|
|
117
121
|
};
|
|
122
|
+
const manyOptions = exports.manyOptions = {
|
|
123
|
+
render: Docs.render,
|
|
124
|
+
args: {
|
|
125
|
+
...Docs.args,
|
|
126
|
+
options: manySelectOptions
|
|
127
|
+
}
|
|
128
|
+
};
|
|
118
129
|
const nullable = exports.nullable = {
|
|
119
130
|
render: Docs.render,
|
|
120
131
|
args: {
|
|
@@ -185,7 +196,8 @@ const summary = exports.summary = {
|
|
|
185
196
|
},
|
|
186
197
|
setup() {
|
|
187
198
|
return {
|
|
188
|
-
args
|
|
199
|
+
args,
|
|
200
|
+
manySelectOptions
|
|
189
201
|
};
|
|
190
202
|
},
|
|
191
203
|
template: `
|
|
@@ -53,6 +53,10 @@ const options = [
|
|
|
53
53
|
value: "4"
|
|
54
54
|
}
|
|
55
55
|
];
|
|
56
|
+
const manySelectOptions = [...Array(24).keys()].map((key) => ({
|
|
57
|
+
label: `Option ${Number(key) + 1}`,
|
|
58
|
+
value: Number(key) + 1
|
|
59
|
+
}));
|
|
56
60
|
export const Docs = {
|
|
57
61
|
render: (args) => ({
|
|
58
62
|
components: { AntSelect, AntDropdown },
|
|
@@ -86,6 +90,13 @@ export const Docs = {
|
|
|
86
90
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
87
91
|
}
|
|
88
92
|
};
|
|
93
|
+
export const manyOptions = {
|
|
94
|
+
render: Docs.render,
|
|
95
|
+
args: {
|
|
96
|
+
...Docs.args,
|
|
97
|
+
options: manySelectOptions
|
|
98
|
+
}
|
|
99
|
+
};
|
|
89
100
|
export const nullable = {
|
|
90
101
|
render: Docs.render,
|
|
91
102
|
args: {
|
|
@@ -151,7 +162,7 @@ export const summary = {
|
|
|
151
162
|
render: (args) => ({
|
|
152
163
|
components: { AntSelect },
|
|
153
164
|
setup() {
|
|
154
|
-
return { args };
|
|
165
|
+
return { args, manySelectOptions };
|
|
155
166
|
},
|
|
156
167
|
template: `
|
|
157
168
|
<div class="p-4 flex flex-col gap-2.5">
|
|
@@ -13,8 +13,8 @@ const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
|
-
<div class="flex gap-px bg-
|
|
17
|
-
<div class="flex flex-col gap-px bg-
|
|
16
|
+
<div class="flex gap-px bg-base-300 h-screen min-w-full overflow-y-hidden">
|
|
17
|
+
<div class="flex flex-col gap-px bg-base-300 w-52 shrink-0">
|
|
18
18
|
<component
|
|
19
19
|
:is="logoRoute ? 'RouterLink' : 'div'"
|
|
20
20
|
v-if="hasLogoImageSlot"
|
|
@@ -4,7 +4,7 @@ const meta = {
|
|
|
4
4
|
title: "Layouts/NavLeftLayout",
|
|
5
5
|
component: AntNavLeftLayout,
|
|
6
6
|
parameters: { controls: { sort: "requiredFirst" } },
|
|
7
|
-
decorators: [() => ({ template: '<div class="border border-dashed border-
|
|
7
|
+
decorators: [() => ({ template: '<div class="border border-dashed border-base-300"><story/></div>' })],
|
|
8
8
|
argTypes: {}
|
|
9
9
|
};
|
|
10
10
|
export default meta;
|
|
@@ -11,7 +11,7 @@ const props = defineProps<{
|
|
|
11
11
|
|
|
12
12
|
const itemClasses = computed(() => ({
|
|
13
13
|
'w-full text-sm p-1.5 rounded-md cursor-pointer flex items-center flex-nowrap gap-1': true,
|
|
14
|
-
'transition-colors hover:bg-
|
|
14
|
+
'transition-colors hover:bg-base-100': true,
|
|
15
15
|
'text-primary-500': props.navbarItem.active
|
|
16
16
|
}));
|
|
17
17
|
|
|
@@ -29,13 +29,15 @@ const props = withDefaults(
|
|
|
29
29
|
showLightVersion?: boolean;
|
|
30
30
|
size?: AntTableSize;
|
|
31
31
|
headerColor?: string;
|
|
32
|
+
emptyStateText?: string;
|
|
32
33
|
}>(), {
|
|
33
34
|
rowKey: 'id',
|
|
34
35
|
loading: false,
|
|
35
36
|
selectableRows: false,
|
|
36
37
|
showLightVersion: false,
|
|
37
38
|
size: AntTableSize.md,
|
|
38
|
-
headerColor: 'bg-
|
|
39
|
+
headerColor: 'bg-base-200',
|
|
40
|
+
emptyStateText: 'We couldn\'t find any entry',
|
|
39
41
|
});
|
|
40
42
|
|
|
41
43
|
const selected: Ref<Record<string, unknown> | undefined> = useVModel(props, 'selectedRow', emits);
|
|
@@ -132,9 +134,9 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
132
134
|
:class="{
|
|
133
135
|
'bg-primary-200 text-primary-200-font transition-colors': elem === selected,
|
|
134
136
|
'bg-white text-for-white-bg-font': elem !== selected && rowIndex % 2 === 0,
|
|
135
|
-
'bg-
|
|
137
|
+
'bg-base-100 text-base-100-font': elem !== selected && rowIndex % 2 !== 0,
|
|
136
138
|
'cursor-pointer': selectableRows,
|
|
137
|
-
'hover:bg-
|
|
139
|
+
'hover:bg-base-200': selectableRows && elem !== selected,
|
|
138
140
|
}"
|
|
139
141
|
>
|
|
140
142
|
<slot
|
|
@@ -188,7 +190,7 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
188
190
|
>
|
|
189
191
|
<slot name="emptyState">
|
|
190
192
|
<div class="flex items-center flex-col">
|
|
191
|
-
<span class="font-semibold">
|
|
193
|
+
<span class="font-semibold">{{ emptyStateText }}</span>
|
|
192
194
|
</div>
|
|
193
195
|
</slot>
|
|
194
196
|
</td>
|
|
@@ -199,7 +201,7 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
199
201
|
|
|
200
202
|
<div
|
|
201
203
|
v-if="data.length > 0 && _loading"
|
|
202
|
-
class="absolute bg-opacity-50 w-full top-0 bottom-0 bg-
|
|
204
|
+
class="absolute bg-opacity-50 w-full top-0 bottom-0 bg-base-300 flex items-center justify-center"
|
|
203
205
|
>
|
|
204
206
|
<AntSpinner
|
|
205
207
|
class="!w-24 !h-24"
|
|
@@ -209,7 +211,7 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
209
211
|
|
|
210
212
|
<div
|
|
211
213
|
v-if="!data || data.length <= 0 && _loading"
|
|
212
|
-
class="absolute bg-opacity-50 w-full top-[40px] bottom-0 bg-
|
|
214
|
+
class="absolute bg-opacity-50 w-full top-[40px] bottom-0 bg-base-300 flex items-center justify-center"
|
|
213
215
|
>
|
|
214
216
|
<AntSkeleton
|
|
215
217
|
v-model="_loading"
|
|
@@ -16,7 +16,7 @@ const props = withDefaults(
|
|
|
16
16
|
|
|
17
17
|
const headerClasses = computed(() => ({
|
|
18
18
|
[props.header.headerClassList || '']: true,
|
|
19
|
-
'text-sm text-
|
|
19
|
+
'text-sm text-base-200-font uppercase font-semi-bold': true,
|
|
20
20
|
'text-left': !props.header.align || props.header.align === AntTableAlign.left,
|
|
21
21
|
'text-center': props.header.align === AntTableAlign.center,
|
|
22
22
|
'text-right': props.header.align === AntTableAlign.right,
|
|
@@ -166,7 +166,7 @@ const Docs = exports.Docs = {
|
|
|
166
166
|
};
|
|
167
167
|
},
|
|
168
168
|
template: `
|
|
169
|
-
<div class="h-96 border border-dashed border-
|
|
169
|
+
<div class="h-96 border border-dashed border-base-300">
|
|
170
170
|
<AntTable v-bind="args" v-model="selected" :selected-row="selected" @row-click="(val) => selected = val">
|
|
171
171
|
<template #cellContent="{element: entry, header}">
|
|
172
172
|
<div v-if="header.identifier === 'employeed'">
|
|
@@ -205,7 +205,43 @@ const Docs = exports.Docs = {
|
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
207
|
const Empty = exports.Empty = {
|
|
208
|
-
render:
|
|
208
|
+
render: args => ({
|
|
209
|
+
components: {
|
|
210
|
+
AntTable: _AntTable.default,
|
|
211
|
+
AntSwitch: _AntSwitch.default
|
|
212
|
+
},
|
|
213
|
+
setup() {
|
|
214
|
+
const selected = (0, _vue.ref)();
|
|
215
|
+
return {
|
|
216
|
+
args,
|
|
217
|
+
selected
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
template: `
|
|
221
|
+
<div class="flex flex-col gap-2">
|
|
222
|
+
<div class="h-96 border border-dashed border-base-300">
|
|
223
|
+
<AntTable v-bind="args" v-model="selected" :selected-row="selected" @row-click="(val) => selected = val">
|
|
224
|
+
<template #cellContent="{element: entry, header}">
|
|
225
|
+
<div v-if="header.identifier === 'employeed'">
|
|
226
|
+
<AntSwitch v-model="entry.employeed"/>
|
|
227
|
+
</div>
|
|
228
|
+
</template>
|
|
229
|
+
</AntTable>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<div class="h-96 border border-dashed border-base-300">
|
|
233
|
+
<AntTable v-bind="args" v-model="selected" :selected-row="selected" @row-click="(val) => selected = val" empty-state-text="Custom Empty State Text">
|
|
234
|
+
<template #cellContent="{element: entry, header}">
|
|
235
|
+
<div v-if="header.identifier === 'employeed'">
|
|
236
|
+
<AntSwitch v-model="entry.employeed"/>
|
|
237
|
+
</div>
|
|
238
|
+
</template>
|
|
239
|
+
</AntTable>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
`
|
|
244
|
+
}),
|
|
209
245
|
args: {
|
|
210
246
|
headers: [{
|
|
211
247
|
title: "Name",
|
|
@@ -110,7 +110,7 @@ export const Docs = {
|
|
|
110
110
|
return { args, selected };
|
|
111
111
|
},
|
|
112
112
|
template: `
|
|
113
|
-
<div class="h-96 border border-dashed border-
|
|
113
|
+
<div class="h-96 border border-dashed border-base-300">
|
|
114
114
|
<AntTable v-bind="args" v-model="selected" :selected-row="selected" @row-click="(val) => selected = val">
|
|
115
115
|
<template #cellContent="{element: entry, header}">
|
|
116
116
|
<div v-if="header.identifier === 'employeed'">
|
|
@@ -154,7 +154,37 @@ export const Docs = {
|
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
export const Empty = {
|
|
157
|
-
render:
|
|
157
|
+
render: (args) => ({
|
|
158
|
+
components: { AntTable, AntSwitch },
|
|
159
|
+
setup() {
|
|
160
|
+
const selected = ref();
|
|
161
|
+
return { args, selected };
|
|
162
|
+
},
|
|
163
|
+
template: `
|
|
164
|
+
<div class="flex flex-col gap-2">
|
|
165
|
+
<div class="h-96 border border-dashed border-base-300">
|
|
166
|
+
<AntTable v-bind="args" v-model="selected" :selected-row="selected" @row-click="(val) => selected = val">
|
|
167
|
+
<template #cellContent="{element: entry, header}">
|
|
168
|
+
<div v-if="header.identifier === 'employeed'">
|
|
169
|
+
<AntSwitch v-model="entry.employeed"/>
|
|
170
|
+
</div>
|
|
171
|
+
</template>
|
|
172
|
+
</AntTable>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div class="h-96 border border-dashed border-base-300">
|
|
176
|
+
<AntTable v-bind="args" v-model="selected" :selected-row="selected" @row-click="(val) => selected = val" empty-state-text="Custom Empty State Text">
|
|
177
|
+
<template #cellContent="{element: entry, header}">
|
|
178
|
+
<div v-if="header.identifier === 'employeed'">
|
|
179
|
+
<AntSwitch v-model="entry.employeed"/>
|
|
180
|
+
</div>
|
|
181
|
+
</template>
|
|
182
|
+
</AntTable>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
`
|
|
187
|
+
}),
|
|
158
188
|
args: {
|
|
159
189
|
headers: [
|
|
160
190
|
{
|
|
@@ -49,8 +49,8 @@ const _active = computed<boolean>(() => {
|
|
|
49
49
|
});
|
|
50
50
|
const containerClasses = computed(() => {
|
|
51
51
|
const variants: Record<TabItemState, string> = {
|
|
52
|
-
[TabItemState.base]: 'hover:bg-
|
|
53
|
-
[TabItemState.info]: 'hover:bg-
|
|
52
|
+
[TabItemState.base]: 'hover:bg-base-100',
|
|
53
|
+
[TabItemState.info]: 'hover:bg-base-100',
|
|
54
54
|
[TabItemState.warning]: 'hover:bg-warning-100',
|
|
55
55
|
[TabItemState.danger]: 'hover:bg-danger-100',
|
|
56
56
|
};
|
|
@@ -92,7 +92,7 @@ const borderBoxClasses = computed(() => {
|
|
|
92
92
|
});
|
|
93
93
|
const iconColor = computed(() => {
|
|
94
94
|
const variants = {
|
|
95
|
-
[TabItemState.base]: 'text-
|
|
95
|
+
[TabItemState.base]: 'text-base-100-font',
|
|
96
96
|
[TabItemState.info]: 'text-info-500',
|
|
97
97
|
[TabItemState.warning]: 'text-warning-500',
|
|
98
98
|
[TabItemState.danger]: 'text-danger-500',
|
|
@@ -39,7 +39,7 @@ function clickTab(tabItem: TabItem) {
|
|
|
39
39
|
|
|
40
40
|
<template>
|
|
41
41
|
<div :class="containerClasses">
|
|
42
|
-
<div class="flex gap-px bg-
|
|
42
|
+
<div class="flex gap-px bg-base-300 border-l border-r border-base-300 overflow-x-auto" :class="scrollContainerClasses">
|
|
43
43
|
<slot>
|
|
44
44
|
<AntTabItem
|
|
45
45
|
v-for="(tabItem, index) in tabItems"
|