@antify/ui 2.2.1 → 2.2.4
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 +25 -12
- package/dist/components/AntAccordionItem.vue +28 -13
- package/dist/components/AntAlert.vue +25 -15
- package/dist/components/AntCard.vue +26 -14
- package/dist/components/AntContent.vue +4 -4
- package/dist/components/AntDropdown.vue +41 -23
- package/dist/components/AntIcon.vue +18 -6
- package/dist/components/AntKeycap.vue +31 -16
- package/dist/components/AntListGroup.vue +13 -11
- package/dist/components/AntListGroupItem.vue +19 -9
- package/dist/components/AntModal.vue +26 -15
- package/dist/components/AntPagination.vue +28 -15
- package/dist/components/AntPopover.vue +74 -51
- package/dist/components/AntSkeleton.vue +8 -4
- package/dist/components/AntSpinner.vue +14 -6
- package/dist/components/AntTag.vue +25 -13
- package/dist/components/AntToast.vue +19 -11
- package/dist/components/AntToaster.vue +13 -5
- package/dist/components/AntTooltip.vue +78 -54
- package/dist/components/__stories/AntAccordion.stories.js +4 -4
- package/dist/components/__stories/AntAccordion.stories.mjs +50 -17
- package/dist/components/__stories/AntAlert.stories.mjs +18 -5
- package/dist/components/__stories/AntCard.stories.mjs +36 -10
- package/dist/components/__stories/AntContent.stories.mjs +14 -4
- package/dist/components/__stories/AntDropdown.stories.mjs +20 -4
- package/dist/components/__stories/AntIcon.stories.mjs +38 -12
- package/dist/components/__stories/AntKeycap.stories.mjs +35 -10
- package/dist/components/__stories/AntListGroup.stories.d.ts +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +22 -4
- package/dist/components/__stories/AntListGroupItem.stories.mjs +27 -8
- package/dist/components/__stories/AntModal.stories.mjs +17 -4
- package/dist/components/__stories/AntPagination.stories.mjs +21 -6
- package/dist/components/__stories/AntPopover.stories.mjs +20 -4
- package/dist/components/__stories/AntSkeleton.stories.mjs +17 -5
- package/dist/components/__stories/AntSpinner.stories.mjs +33 -9
- package/dist/components/__stories/AntTag.stories.mjs +28 -8
- package/dist/components/__stories/AntToast.stories.mjs +19 -5
- package/dist/components/__stories/AntToaster.stories.d.ts +1 -1
- package/dist/components/__stories/AntToaster.stories.mjs +35 -9
- package/dist/components/__stories/AntTooltip.stories.js +1 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +44 -13
- package/dist/components/buttons/AntActionButton.vue +38 -29
- package/dist/components/buttons/AntButton.vue +34 -13
- package/dist/components/buttons/AntCreateButton.vue +11 -4
- package/dist/components/buttons/AntDeleteButton.vue +11 -4
- package/dist/components/buttons/AntDuplicateButton.vue +11 -4
- package/dist/components/buttons/AntEditButton.vue +11 -4
- package/dist/components/buttons/AntSaveAndNewButton.vue +11 -4
- package/dist/components/buttons/AntSaveButton.vue +11 -4
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +35 -10
- package/dist/components/buttons/__stories/AntButton.stories.mjs +77 -23
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +25 -7
- package/dist/components/crud/AntCrud.vue +6 -6
- package/dist/components/crud/AntCrudDetail.vue +8 -5
- package/dist/components/crud/AntCrudDetailActions.vue +14 -8
- package/dist/components/crud/AntCrudDetailNav.vue +21 -13
- package/dist/components/crud/AntCrudTableFilter.vue +29 -17
- package/dist/components/crud/AntCrudTableNav.vue +36 -22
- package/dist/components/crud/__stories/AntCrud.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +10 -2
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +23 -7
- package/dist/components/dialogs/AntDeleteDialog.vue +13 -5
- package/dist/components/dialogs/AntDialog.vue +23 -13
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +12 -3
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +28 -7
- package/dist/components/forms/AntField.vue +18 -7
- package/dist/components/forms/AntFormGroup.vue +9 -5
- package/dist/components/forms/AntFormGroupLabel.vue +1 -1
- package/dist/components/forms/__stories/AntField.stories.mjs +37 -9
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +20 -5
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +11 -3
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inputs/AntCheckbox.vue +60 -36
- package/dist/components/inputs/AntCheckboxGroup.vue +39 -15
- package/dist/components/inputs/AntDateInput.vue +35 -12
- package/dist/components/inputs/AntNumberInput.vue +33 -12
- package/dist/components/inputs/AntPasswordInput.vue +32 -11
- package/dist/components/inputs/AntRadio.vue +57 -34
- package/dist/components/inputs/AntRadioGroup.vue +60 -35
- package/dist/components/inputs/AntRangeSlider.vue +31 -12
- package/dist/components/inputs/AntSearch.vue +19 -7
- package/dist/components/inputs/AntSelect.vue +107 -83
- package/dist/components/inputs/AntSwitch.vue +35 -18
- package/dist/components/inputs/AntSwitcher.vue +30 -15
- package/dist/components/inputs/AntTagInput.vue +91 -61
- package/dist/components/inputs/AntTextInput.vue +31 -11
- package/dist/components/inputs/AntTextarea.vue +53 -25
- package/dist/components/inputs/AntUnitInput.vue +33 -12
- package/dist/components/inputs/Elements/AntBaseInput.vue +47 -18
- package/dist/components/inputs/Elements/AntInputDescription.vue +16 -8
- package/dist/components/inputs/Elements/AntInputLabel.vue +13 -5
- package/dist/components/inputs/Elements/AntInputLimiter.vue +13 -5
- package/dist/components/inputs/Elements/AntSelectMenu.vue +65 -41
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +104 -27
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +33 -9
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +34 -9
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +33 -9
- package/dist/components/inputs/Elements/index.d.ts +1 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +34 -9
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +45 -21
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +52 -14
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +66 -17
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +51 -13
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +45 -12
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +16 -5
- package/dist/components/inputs/__stories/AntSearch.stories.mjs +41 -10
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +59 -15
- package/dist/components/inputs/__stories/AntSwitch.stories.js +126 -102
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +162 -112
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +38 -10
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +46 -12
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +59 -16
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +47 -13
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +46 -12
- package/dist/components/layouts/AntNavLeftLayout.vue +12 -6
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +10 -2
- package/dist/components/navbar/AntNavbar.vue +7 -3
- package/dist/components/navbar/AntNavbarItem.vue +12 -6
- package/dist/components/navbar/__stories/AntNavbar.stories.mjs +59 -37
- package/dist/components/table/AntCollapsibleTableRowContent.vue +7 -5
- package/dist/components/table/AntTable.vue +210 -165
- package/dist/components/table/AntTableSkeleton.vue +126 -0
- package/dist/components/table/AntTableSortButton.vue +22 -13
- package/dist/components/table/AntTd.vue +21 -17
- package/dist/components/table/AntTh.vue +19 -12
- package/dist/components/table/__stories/AntTable.stories.js +1 -1
- package/dist/components/table/__stories/AntTable.stories.mjs +190 -62
- package/dist/components/tabs/AntTabItem.vue +20 -8
- package/dist/components/tabs/AntTabs.vue +35 -21
- package/dist/components/tabs/__stories/AntTabItem.stories.mjs +23 -7
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +45 -13
- package/dist/components/transitions/AntTransitionCollapseHeight.vue +1 -1
- package/dist/composables/useToaster.mjs +25 -7
- package/dist/index.css +1 -0
- package/dist/utils.mjs +3 -1
- package/package.json +23 -16
- package/dist/tailwind.config.d.ts +0 -3
- package/dist/tailwind.config.js +0 -198
- package/dist/tailwind.config.mjs +0 -189
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import AntAccordionItem from './AntAccordionItem.vue';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
onMounted, ref,
|
|
5
|
+
} from 'vue';
|
|
6
|
+
import {
|
|
7
|
+
CollapseStrategy,
|
|
8
|
+
} from './__types/AntAccordion.types';
|
|
9
|
+
import AntSkeleton from './AntSkeleton.vue';
|
|
6
10
|
|
|
7
11
|
const props = withDefaults(defineProps<{
|
|
8
12
|
items: {
|
|
@@ -20,7 +24,7 @@ const props = withDefaults(defineProps<{
|
|
|
20
24
|
skeleton?: boolean;
|
|
21
25
|
}>(), {
|
|
22
26
|
collapseStrategy: CollapseStrategy.single,
|
|
23
|
-
skeleton: false
|
|
27
|
+
skeleton: false,
|
|
24
28
|
});
|
|
25
29
|
|
|
26
30
|
const openItems = ref<number[]>([]);
|
|
@@ -33,9 +37,14 @@ onMounted(() => {
|
|
|
33
37
|
|
|
34
38
|
function onOpen(index: number) {
|
|
35
39
|
if (props.collapseStrategy === CollapseStrategy.single) {
|
|
36
|
-
openItems.value = [
|
|
40
|
+
openItems.value = [
|
|
41
|
+
index,
|
|
42
|
+
];
|
|
37
43
|
} else {
|
|
38
|
-
openItems.value = [
|
|
44
|
+
openItems.value = [
|
|
45
|
+
...openItems.value,
|
|
46
|
+
index,
|
|
47
|
+
];
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
|
|
@@ -58,10 +67,10 @@ function onClose(index: number) {
|
|
|
58
67
|
:is-open="openItems.includes(index)"
|
|
59
68
|
:icon-left="item.iconLeft"
|
|
60
69
|
:content-padding="item.contentPadding"
|
|
61
|
-
:
|
|
62
|
-
:
|
|
63
|
-
:
|
|
64
|
-
:
|
|
70
|
+
:active-label-classes="item.activeLabelClasses"
|
|
71
|
+
:active-icon-classes="item.activeIconClasses"
|
|
72
|
+
:inactive-label-classes="item.inactiveLabelClasses"
|
|
73
|
+
:inactive-icon-classes="item.inactiveIconClasses"
|
|
65
74
|
:skeleton="skeleton"
|
|
66
75
|
@open="() => onOpen(index)"
|
|
67
76
|
@close="() => onClose(index)"
|
|
@@ -78,9 +87,13 @@ function onClose(index: number) {
|
|
|
78
87
|
name="item-content"
|
|
79
88
|
v-bind="{item, index}"
|
|
80
89
|
>
|
|
81
|
-
<div v-html="item.content"/>
|
|
90
|
+
<div v-html="item.content" />
|
|
82
91
|
|
|
83
|
-
<AntSkeleton
|
|
92
|
+
<AntSkeleton
|
|
93
|
+
v-if="skeleton"
|
|
94
|
+
absolute
|
|
95
|
+
rounded
|
|
96
|
+
/>
|
|
84
97
|
</slot>
|
|
85
98
|
</div>
|
|
86
99
|
</AntAccordionItem>
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
faAngleDown, faAngleUp, faQuestionCircle,
|
|
4
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
3
5
|
import AntIcon from './AntIcon.vue';
|
|
4
6
|
import AntTransitionCollapseHeight from './transitions/AntTransitionCollapseHeight.vue';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
import {
|
|
8
|
+
IconSize,
|
|
9
|
+
} from './__types/AntIcon.types';
|
|
10
|
+
import {
|
|
11
|
+
computed,
|
|
12
|
+
} from 'vue';
|
|
13
|
+
import AntSkeleton from '../components/AntSkeleton.vue';
|
|
8
14
|
|
|
9
15
|
const props = withDefaults(defineProps<{
|
|
10
16
|
isOpen: boolean;
|
|
@@ -25,14 +31,17 @@ const props = withDefaults(defineProps<{
|
|
|
25
31
|
activeLabelClasses: 'bg-primary-500 text-primary-500-font',
|
|
26
32
|
activeIconClasses: 'text-primary-500-font',
|
|
27
33
|
inactiveLabelClasses: 'bg-white text-for-white-bg-font',
|
|
28
|
-
inactiveIconClasses: 'text-for-white-bg-font'
|
|
34
|
+
inactiveIconClasses: 'text-for-white-bg-font',
|
|
29
35
|
});
|
|
30
|
-
const emit = defineEmits([
|
|
36
|
+
const emit = defineEmits([
|
|
37
|
+
'close',
|
|
38
|
+
'open',
|
|
39
|
+
]);
|
|
31
40
|
|
|
32
41
|
// TODO:: Stehengeblieben: delays machen
|
|
33
42
|
function onClick() {
|
|
34
43
|
if (props.skeleton) {
|
|
35
|
-
return
|
|
44
|
+
return;
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
if (props.isOpen) {
|
|
@@ -45,8 +54,8 @@ function onClick() {
|
|
|
45
54
|
const labelClasses = computed(() => ({
|
|
46
55
|
[props.activeLabelClasses]: props.isOpen,
|
|
47
56
|
[props.inactiveLabelClasses]: !props.isOpen,
|
|
48
|
-
'cursor-pointer': !props.skeleton
|
|
49
|
-
}))
|
|
57
|
+
'cursor-pointer': !props.skeleton,
|
|
58
|
+
}));
|
|
50
59
|
</script>
|
|
51
60
|
|
|
52
61
|
<template>
|
|
@@ -63,7 +72,10 @@ const labelClasses = computed(() => ({
|
|
|
63
72
|
class="flex justify-between items-center"
|
|
64
73
|
>
|
|
65
74
|
<div class="flex items-center gap-2">
|
|
66
|
-
<slot
|
|
75
|
+
<slot
|
|
76
|
+
name="icon-left"
|
|
77
|
+
v-bind="{isOpen}"
|
|
78
|
+
>
|
|
67
79
|
<AntIcon
|
|
68
80
|
v-if="iconLeft"
|
|
69
81
|
:size="IconSize.sm"
|
|
@@ -73,12 +85,15 @@ const labelClasses = computed(() => ({
|
|
|
73
85
|
/>
|
|
74
86
|
</slot>
|
|
75
87
|
|
|
76
|
-
|
|
77
88
|
<div class="relative">
|
|
78
89
|
<div class="text-sm font-semibold">
|
|
79
90
|
{{ label }}
|
|
80
91
|
</div>
|
|
81
|
-
<AntSkeleton
|
|
92
|
+
<AntSkeleton
|
|
93
|
+
v-if="skeleton"
|
|
94
|
+
absolute
|
|
95
|
+
rounded
|
|
96
|
+
/>
|
|
82
97
|
</div>
|
|
83
98
|
</div>
|
|
84
99
|
|
|
@@ -102,7 +117,7 @@ const labelClasses = computed(() => ({
|
|
|
102
117
|
class="text-sm bg-white text-for-white-bg-font"
|
|
103
118
|
:class="{'p-2': contentPadding}"
|
|
104
119
|
>
|
|
105
|
-
<slot/>
|
|
120
|
+
<slot />
|
|
106
121
|
</div>
|
|
107
122
|
</Transition>
|
|
108
123
|
</div>
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
computed, onMounted, useSlots,
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import {
|
|
6
|
+
handleEnumValidation,
|
|
7
|
+
} from '../handler';
|
|
4
8
|
import {
|
|
5
9
|
faCheckCircle,
|
|
6
10
|
faCircleQuestion,
|
|
7
11
|
faExclamationCircle,
|
|
8
12
|
faExclamationTriangle,
|
|
9
13
|
faInfoCircle,
|
|
10
|
-
faXmark
|
|
14
|
+
faXmark,
|
|
11
15
|
} from '@fortawesome/free-solid-svg-icons';
|
|
12
16
|
import AntIcon from './AntIcon.vue';
|
|
13
17
|
import AntTooltip from './AntTooltip.vue';
|
|
14
18
|
import AntSkeleton from './AntSkeleton.vue';
|
|
15
|
-
import {
|
|
16
|
-
|
|
19
|
+
import {
|
|
20
|
+
InputState, Position,
|
|
21
|
+
} from '../enums';
|
|
22
|
+
import {
|
|
23
|
+
IconSize,
|
|
24
|
+
} from './__types';
|
|
17
25
|
|
|
18
|
-
defineEmits([
|
|
26
|
+
defineEmits([
|
|
27
|
+
'close',
|
|
28
|
+
]);
|
|
19
29
|
|
|
20
30
|
const props = withDefaults(defineProps<{
|
|
21
|
-
title?: string | null
|
|
22
|
-
state?: InputState
|
|
23
|
-
icon?: boolean
|
|
24
|
-
expanded?: boolean
|
|
25
|
-
questionMarkText?: string | null
|
|
26
|
-
skeleton?: boolean
|
|
27
|
-
dismissBtn?: boolean
|
|
31
|
+
title?: string | null;
|
|
32
|
+
state?: InputState;
|
|
33
|
+
icon?: boolean;
|
|
34
|
+
expanded?: boolean;
|
|
35
|
+
questionMarkText?: string | null;
|
|
36
|
+
skeleton?: boolean;
|
|
37
|
+
dismissBtn?: boolean;
|
|
28
38
|
}>(), {
|
|
29
39
|
title: null,
|
|
30
40
|
state: InputState.base,
|
|
@@ -114,7 +124,7 @@ onMounted(() => {
|
|
|
114
124
|
<div class="flex gap-2">
|
|
115
125
|
<div v-if="hasQuestionMark">
|
|
116
126
|
<slot name="questionMarkText">
|
|
117
|
-
<AntTooltip
|
|
127
|
+
<AntTooltip>
|
|
118
128
|
<template #reference>
|
|
119
129
|
<AntIcon
|
|
120
130
|
:icon="faCircleQuestion"
|
|
@@ -142,7 +152,7 @@ onMounted(() => {
|
|
|
142
152
|
</div>
|
|
143
153
|
|
|
144
154
|
<div v-if="hasDefaultSlot">
|
|
145
|
-
<slot/>
|
|
155
|
+
<slot />
|
|
146
156
|
</div>
|
|
147
157
|
</div>
|
|
148
158
|
</template>
|
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import {
|
|
6
|
+
Size,
|
|
7
|
+
} from '../enums/Size.enum';
|
|
8
|
+
import AntSkeleton from './AntSkeleton.vue';
|
|
4
9
|
|
|
5
10
|
const props = withDefaults(defineProps<{
|
|
6
11
|
size?: Size;
|
|
7
12
|
padding?: boolean;
|
|
8
13
|
expanded?: boolean;
|
|
14
|
+
skeleton?: boolean;
|
|
9
15
|
}>(), {
|
|
10
16
|
size: Size.md,
|
|
11
17
|
padding: true,
|
|
12
|
-
expanded: false
|
|
18
|
+
expanded: false,
|
|
19
|
+
skeleton: false,
|
|
13
20
|
});
|
|
14
21
|
|
|
15
22
|
const cardClass = computed(() => ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
23
|
+
'inline-block': true,
|
|
24
|
+
'w-full': props.expanded,
|
|
25
|
+
'p-0': !props.padding,
|
|
26
|
+
'p-2.5': props.size === Size.lg && props.padding,
|
|
27
|
+
'p-2': props.size === Size.md && props.padding,
|
|
28
|
+
'p-1.5': props.size === Size.sm || props.size === Size.xs && props.padding,
|
|
29
|
+
'p-1': props.size === Size.xs2 && props.padding,
|
|
30
|
+
}));
|
|
25
31
|
</script>
|
|
26
32
|
|
|
27
33
|
<template>
|
|
28
34
|
<div
|
|
29
35
|
:class="cardClass"
|
|
30
|
-
class="bg-white
|
|
36
|
+
class="bg-white outline outline-offset-[-1px] outline-base-300 rounded-md relative"
|
|
31
37
|
>
|
|
32
|
-
<slot/>
|
|
38
|
+
<slot />
|
|
39
|
+
|
|
40
|
+
<AntSkeleton
|
|
41
|
+
v-if="skeleton"
|
|
42
|
+
absolute
|
|
43
|
+
rounded
|
|
44
|
+
/>
|
|
33
45
|
</div>
|
|
34
46
|
</template>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
withDefaults(defineProps<{
|
|
3
|
-
padding?: boolean
|
|
3
|
+
padding?: boolean;
|
|
4
4
|
}>(), {
|
|
5
|
-
padding: true
|
|
6
|
-
})
|
|
5
|
+
padding: true,
|
|
6
|
+
});
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<template>
|
|
@@ -11,6 +11,6 @@ withDefaults(defineProps<{
|
|
|
11
11
|
:class="{ 'p-2.5': padding }"
|
|
12
12
|
class="bg-white overflow-auto"
|
|
13
13
|
>
|
|
14
|
-
<slot/>
|
|
14
|
+
<slot />
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import {
|
|
3
|
+
computed, ref,
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import {
|
|
6
|
+
classesToObjectSyntax,
|
|
7
|
+
} from '../utils';
|
|
8
|
+
import {
|
|
9
|
+
vOnClickOutside,
|
|
10
|
+
} from '@vueuse/components';
|
|
11
|
+
import {
|
|
12
|
+
onKeyStroke,
|
|
13
|
+
} from '@vueuse/core';
|
|
14
|
+
import {
|
|
15
|
+
autoUpdate, flip, offset, useFloating, shift,
|
|
16
|
+
} from '@floating-ui/vue';
|
|
7
17
|
|
|
8
18
|
const props = withDefaults(defineProps<{
|
|
9
|
-
showDropdown: boolean
|
|
10
|
-
dropdownClasses?: string | Record<string, boolean
|
|
11
|
-
contentPadding?: boolean
|
|
12
|
-
isClickable?: boolean
|
|
19
|
+
showDropdown: boolean;
|
|
20
|
+
dropdownClasses?: string | Record<string, boolean>;
|
|
21
|
+
contentPadding?: boolean;
|
|
22
|
+
isClickable?: boolean;
|
|
13
23
|
}>(), {
|
|
14
24
|
contentPadding: true,
|
|
15
25
|
dropdownClasses: '',
|
|
16
26
|
isClickable: true,
|
|
17
27
|
});
|
|
18
|
-
const emit = defineEmits([
|
|
28
|
+
const emit = defineEmits([
|
|
29
|
+
'update:showDropdown',
|
|
30
|
+
]);
|
|
19
31
|
|
|
20
|
-
const reference = ref<HTMLElement | null>(null)
|
|
21
|
-
const floating = ref<HTMLElement | null>(null)
|
|
32
|
+
const reference = ref<HTMLElement | null>(null);
|
|
33
|
+
const floating = ref<HTMLElement | null>(null);
|
|
22
34
|
|
|
23
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
floatingStyles,
|
|
37
|
+
} = useFloating(reference, floating, {
|
|
24
38
|
transform: false,
|
|
25
39
|
placement: 'bottom-start',
|
|
26
40
|
whileElementsMounted: autoUpdate,
|
|
@@ -28,14 +42,16 @@ const {floatingStyles} = useFloating(reference, floating, {
|
|
|
28
42
|
offset(8),
|
|
29
43
|
shift(),
|
|
30
44
|
flip({
|
|
31
|
-
fallbackPlacements: [
|
|
45
|
+
fallbackPlacements: [
|
|
46
|
+
'top-start',
|
|
47
|
+
],
|
|
32
48
|
}),
|
|
33
|
-
]
|
|
49
|
+
],
|
|
34
50
|
});
|
|
35
51
|
|
|
36
52
|
const _dropdownClasses = computed(() => ({
|
|
37
53
|
'min-w-[10rem] z-[50]': true,
|
|
38
|
-
...classesToObjectSyntax(props.dropdownClasses)
|
|
54
|
+
...classesToObjectSyntax(props.dropdownClasses),
|
|
39
55
|
}));
|
|
40
56
|
|
|
41
57
|
onKeyStroke('Escape', (e: KeyboardEvent) => {
|
|
@@ -50,9 +66,11 @@ const onClickOutside = [
|
|
|
50
66
|
emit('update:showDropdown', false);
|
|
51
67
|
},
|
|
52
68
|
{
|
|
53
|
-
ignore: [
|
|
54
|
-
|
|
55
|
-
]
|
|
69
|
+
ignore: [
|
|
70
|
+
floating,
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
];
|
|
56
74
|
</script>
|
|
57
75
|
|
|
58
76
|
<template>
|
|
@@ -62,25 +80,25 @@ const onClickOutside = [
|
|
|
62
80
|
>
|
|
63
81
|
<div
|
|
64
82
|
ref="reference"
|
|
65
|
-
class="h-full w-full"
|
|
66
83
|
v-on-click-outside="onClickOutside"
|
|
84
|
+
class="h-full w-full"
|
|
67
85
|
>
|
|
68
|
-
<slot/>
|
|
86
|
+
<slot />
|
|
69
87
|
</div>
|
|
70
88
|
|
|
71
89
|
<Transition name="bounce">
|
|
72
90
|
<teleport to="body">
|
|
73
91
|
<div
|
|
74
92
|
v-if="showDropdown"
|
|
75
|
-
:class="_dropdownClasses"
|
|
76
93
|
ref="floating"
|
|
94
|
+
:class="_dropdownClasses"
|
|
77
95
|
:style="floatingStyles"
|
|
78
96
|
>
|
|
79
97
|
<div
|
|
80
98
|
class="shadow-lg border border-base-300 rounded-md text-sm relative inline-flex flex-col bg-white text-for-white-bg-font w-full overflow-hidden"
|
|
81
99
|
:class="{'p-2': contentPadding}"
|
|
82
100
|
>
|
|
83
|
-
<slot name="content"/>
|
|
101
|
+
<slot name="content" />
|
|
84
102
|
</div>
|
|
85
103
|
</div>
|
|
86
104
|
</teleport>
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import {
|
|
3
|
+
computed, onMounted,
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import {
|
|
6
|
+
handleEnumValidation,
|
|
7
|
+
} from '../handler';
|
|
8
|
+
import {
|
|
9
|
+
type IconDefinition,
|
|
10
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
11
|
+
import {
|
|
12
|
+
IconSize,
|
|
13
|
+
} from './__types/AntIcon.types';
|
|
14
|
+
import AntSkeleton from './AntSkeleton.vue';
|
|
7
15
|
|
|
8
16
|
const props = withDefaults(defineProps<{
|
|
9
17
|
icon: IconDefinition;
|
|
@@ -53,6 +61,10 @@ onMounted(() => {
|
|
|
53
61
|
:icon="icon"
|
|
54
62
|
:class="iconClasses"
|
|
55
63
|
/>
|
|
56
|
-
<AntSkeleton
|
|
64
|
+
<AntSkeleton
|
|
65
|
+
v-if="skeleton"
|
|
66
|
+
absolute
|
|
67
|
+
rounded
|
|
68
|
+
/>
|
|
57
69
|
</span>
|
|
58
70
|
</template>
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
// TODO:: Fix typo KeyCap with upperchar C
|
|
3
3
|
import AntIcon from './AntIcon.vue';
|
|
4
|
-
import AntSkeleton from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
4
|
+
import AntSkeleton from './AntSkeleton.vue';
|
|
5
|
+
import {
|
|
6
|
+
type IconDefinition,
|
|
7
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import {
|
|
9
|
+
IconSize,
|
|
10
|
+
} from './__types';
|
|
11
|
+
import {
|
|
12
|
+
AntKeycapSize,
|
|
13
|
+
} from './__types/AntKeycap.types';
|
|
14
|
+
import {
|
|
15
|
+
computed,
|
|
16
|
+
} from 'vue';
|
|
9
17
|
|
|
10
18
|
const props = withDefaults(defineProps<{
|
|
11
|
-
icon?: IconDefinition
|
|
12
|
-
size?: AntKeycapSize
|
|
13
|
-
skeleton?: boolean
|
|
19
|
+
icon?: IconDefinition;
|
|
20
|
+
size?: AntKeycapSize;
|
|
21
|
+
skeleton?: boolean;
|
|
14
22
|
}>(), {
|
|
15
23
|
size: AntKeycapSize.sm,
|
|
16
|
-
skeleton: false
|
|
24
|
+
skeleton: false,
|
|
17
25
|
});
|
|
18
26
|
|
|
19
27
|
const classes = computed(() => {
|
|
@@ -27,9 +35,9 @@ const classes = computed(() => {
|
|
|
27
35
|
const iconClasses = computed(() => {
|
|
28
36
|
switch (props.size) {
|
|
29
37
|
case AntKeycapSize.md:
|
|
30
|
-
return IconSize.md
|
|
38
|
+
return IconSize.md;
|
|
31
39
|
case AntKeycapSize.sm:
|
|
32
|
-
return IconSize.sm
|
|
40
|
+
return IconSize.sm;
|
|
33
41
|
default:
|
|
34
42
|
return IconSize.xs;
|
|
35
43
|
}
|
|
@@ -37,14 +45,21 @@ const iconClasses = computed(() => {
|
|
|
37
45
|
</script>
|
|
38
46
|
|
|
39
47
|
<template>
|
|
40
|
-
<div
|
|
41
|
-
|
|
48
|
+
<div
|
|
49
|
+
class="inline-flex relative justify-center items-center bg-base-300 rounded-md text-center text-base-300-font font-medium"
|
|
50
|
+
:class="classes"
|
|
51
|
+
>
|
|
52
|
+
<AntIcon
|
|
42
53
|
v-if="icon"
|
|
43
54
|
:icon="icon"
|
|
44
55
|
:size="iconClasses"
|
|
45
|
-
|
|
56
|
+
/>
|
|
46
57
|
|
|
47
|
-
|
|
48
|
-
<AntSkeleton
|
|
58
|
+
<slot v-else />
|
|
59
|
+
<AntSkeleton
|
|
60
|
+
v-if="skeleton"
|
|
61
|
+
absolute
|
|
62
|
+
rounded
|
|
63
|
+
/>
|
|
49
64
|
</div>
|
|
50
65
|
</template>
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import AntSkeleton from './AntSkeleton.vue';
|
|
3
3
|
|
|
4
|
-
withDefaults(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
)
|
|
4
|
+
withDefaults(defineProps<{
|
|
5
|
+
skeleton?: boolean;
|
|
6
|
+
shadow?: boolean;
|
|
7
|
+
}>(), {
|
|
8
|
+
skeleton: false,
|
|
9
|
+
shadow: false,
|
|
10
|
+
});
|
|
13
11
|
</script>
|
|
14
12
|
|
|
15
13
|
<template>
|
|
16
14
|
<div class="relative">
|
|
17
|
-
<AntSkeleton
|
|
15
|
+
<AntSkeleton
|
|
16
|
+
v-if="skeleton"
|
|
17
|
+
absolute
|
|
18
|
+
rounded
|
|
19
|
+
/>
|
|
18
20
|
|
|
19
21
|
<div
|
|
20
22
|
class="flex flex-col rounded-md bg-base-300 gap-px relative border border-base-300 overflow-hidden"
|
|
21
23
|
:class="{'invisible': skeleton, 'shadow-md': shadow}"
|
|
22
24
|
>
|
|
23
|
-
<slot/>
|
|
25
|
+
<slot />
|
|
24
26
|
</div>
|
|
25
27
|
</div>
|
|
26
28
|
</template>
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import {
|
|
3
|
+
computed, onMounted,
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import {
|
|
6
|
+
type IconDefinition,
|
|
7
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import {
|
|
9
|
+
ListGroupItemState,
|
|
10
|
+
} from './__types/AntListGroupItem.types';
|
|
11
|
+
import {
|
|
12
|
+
handleEnumValidation,
|
|
13
|
+
} from '../handler';
|
|
14
|
+
import {
|
|
15
|
+
type RouteLocationRaw,
|
|
16
|
+
} from 'vue-router';
|
|
7
17
|
import AntIcon from './AntIcon.vue';
|
|
8
18
|
|
|
9
19
|
const props = withDefaults(defineProps<{
|
|
@@ -45,7 +55,7 @@ const contentWrapperClasses = computed(() => {
|
|
|
45
55
|
return {
|
|
46
56
|
'w-full p-2 flex gap-2 items-center justify-between': true,
|
|
47
57
|
'cursor-pointer transition-colors': props.to !== undefined,
|
|
48
|
-
[variants[props.state]]: props.to !== undefined
|
|
58
|
+
[variants[props.state]]: props.to !== undefined,
|
|
49
59
|
};
|
|
50
60
|
});
|
|
51
61
|
|
|
@@ -66,17 +76,17 @@ onMounted(() => {
|
|
|
66
76
|
v-if="iconLeft"
|
|
67
77
|
name="icon-left"
|
|
68
78
|
>
|
|
69
|
-
<AntIcon :icon="iconLeft"/>
|
|
79
|
+
<AntIcon :icon="iconLeft" />
|
|
70
80
|
</slot>
|
|
71
81
|
|
|
72
|
-
<slot/>
|
|
82
|
+
<slot />
|
|
73
83
|
</div>
|
|
74
84
|
|
|
75
85
|
<slot
|
|
76
86
|
v-if="iconRight"
|
|
77
87
|
name="icon-right"
|
|
78
88
|
>
|
|
79
|
-
<AntIcon :icon="iconRight"/>
|
|
89
|
+
<AntIcon :icon="iconRight" />
|
|
80
90
|
</slot>
|
|
81
91
|
</div>
|
|
82
92
|
</component>
|