@antify/ui-module 1.3.0 → 1.5.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/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/components/AntAccordionItem.vue +17 -14
- package/dist/runtime/components/AntDropdown.vue +6 -6
- package/dist/runtime/components/AntListGroupItem.vue +16 -10
- package/dist/runtime/components/AntModal.vue +10 -9
- package/dist/runtime/components/AntPopover.vue +10 -8
- package/dist/runtime/components/AntTooltip.vue +69 -63
- package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +5 -0
- package/dist/runtime/components/__stories/AntTooltip.stories.mjs +33 -11
- package/dist/runtime/components/buttons/AntActionButton.vue +40 -13
- package/dist/runtime/components/buttons/AntButton.vue +126 -126
- package/dist/runtime/components/buttons/AntCreateButton.vue +21 -8
- package/dist/runtime/components/buttons/AntDeleteButton.vue +30 -8
- package/dist/runtime/components/buttons/AntDuplicateButton.vue +42 -0
- package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
- package/dist/runtime/components/buttons/AntSaveButton.vue +20 -8
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +25 -1
- package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +130 -130
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +11 -1
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +2 -0
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +18 -1
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +11 -0
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +67 -0
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +11 -1
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +11 -1
- package/dist/runtime/components/crud/AntCrud.vue +13 -10
- package/dist/runtime/components/crud/AntCrudDetail.vue +1 -1
- package/dist/runtime/components/crud/AntCrudDetailActions.vue +10 -3
- package/dist/runtime/components/crud/AntCrudDetailNav.vue +21 -15
- package/dist/runtime/components/crud/AntCrudTableFilter.vue +36 -34
- package/dist/runtime/components/crud/AntCrudTableNav.vue +15 -4
- package/dist/runtime/components/dialogs/AntDialog.vue +7 -7
- package/dist/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +1 -2
- package/dist/runtime/components/form/AntSelect.vue +57 -53
- package/dist/runtime/components/form/AntSwitch.vue +13 -10
- package/dist/runtime/components/form/AntSwitcher.vue +4 -4
- package/dist/runtime/components/form/AntTextarea.vue +6 -3
- package/dist/runtime/components/form/Elements/AntBaseInput.vue +45 -41
- package/dist/runtime/components/form/Elements/AntDropDown.vue +1 -1
- package/dist/runtime/components/layouts/AntNavLeftLayout.vue +4 -4
- package/dist/runtime/components/table/AntTable.vue +95 -73
- package/dist/runtime/components/table/AntTableSortButton.vue +16 -4
- package/dist/runtime/components/tabs/AntTabItem.vue +7 -4
- package/dist/runtime/tailwind.config.mjs +1 -1
- package/dist/runtime/utils.d.ts +6 -0
- package/dist/runtime/utils.mjs +21 -0
- package/package.json +1 -1
- package/src/runtime/components/AntAccordionItem.vue +17 -14
- package/src/runtime/components/AntDropdown.vue +6 -6
- package/src/runtime/components/AntListGroupItem.vue +16 -10
- package/src/runtime/components/AntModal.vue +10 -9
- package/src/runtime/components/AntPopover.vue +10 -8
- package/src/runtime/components/AntTooltip.vue +69 -63
- package/src/runtime/components/buttons/AntActionButton.vue +40 -13
- package/src/runtime/components/buttons/AntButton.vue +126 -126
- package/src/runtime/components/buttons/AntCreateButton.vue +21 -8
- package/src/runtime/components/buttons/AntDeleteButton.vue +30 -8
- package/src/runtime/components/buttons/AntDuplicateButton.vue +42 -0
- package/src/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
- package/src/runtime/components/buttons/AntSaveButton.vue +20 -8
- package/src/runtime/components/crud/AntCrud.vue +13 -10
- package/src/runtime/components/crud/AntCrudDetail.vue +1 -1
- package/src/runtime/components/crud/AntCrudDetailActions.vue +10 -3
- package/src/runtime/components/crud/AntCrudDetailNav.vue +21 -15
- package/src/runtime/components/crud/AntCrudTableFilter.vue +36 -34
- package/src/runtime/components/crud/AntCrudTableNav.vue +15 -4
- package/src/runtime/components/dialogs/AntDialog.vue +7 -7
- package/src/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +1 -2
- package/src/runtime/components/form/AntSelect.vue +57 -53
- package/src/runtime/components/form/AntSwitch.vue +13 -10
- package/src/runtime/components/form/AntSwitcher.vue +4 -4
- package/src/runtime/components/form/AntTextarea.vue +6 -3
- package/src/runtime/components/form/Elements/AntBaseInput.vue +45 -41
- package/src/runtime/components/form/Elements/AntDropDown.vue +1 -1
- package/src/runtime/components/layouts/AntNavLeftLayout.vue +4 -4
- package/src/runtime/components/table/AntTable.vue +95 -73
- package/src/runtime/components/table/AntTableSortButton.vue +16 -4
- package/src/runtime/components/tabs/AntTabItem.vue +7 -4
|
@@ -5,40 +5,46 @@ import AntTabs from '../tabs/AntTabs.vue';
|
|
|
5
5
|
import AntDeleteButton from '../buttons/AntDeleteButton.vue';
|
|
6
6
|
import AntDeleteDialog from '../dialogs/AntDeleteDialog.vue';
|
|
7
7
|
import {ref} from 'vue';
|
|
8
|
+
import {Position} from '../../enums';
|
|
8
9
|
|
|
9
10
|
defineEmits(['delete']);
|
|
10
11
|
withDefaults(defineProps<{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
tabItems?: TabItem[]
|
|
13
|
+
deleteButtonDisabled?: boolean
|
|
14
|
+
getEntityName: () => string
|
|
15
|
+
canDelete?: boolean
|
|
14
16
|
}>(), {
|
|
15
|
-
|
|
17
|
+
deleteButtonDisabled: false,
|
|
18
|
+
canDelete: true
|
|
16
19
|
});
|
|
17
20
|
|
|
18
21
|
const dialogOpen = ref(false);
|
|
19
22
|
</script>
|
|
20
23
|
|
|
21
24
|
<template>
|
|
22
|
-
<div
|
|
25
|
+
<div
|
|
26
|
+
class="flex justify-between items-stretch gap-2.5 bg-white"
|
|
27
|
+
data-e2e="crud-detail-nav"
|
|
28
|
+
>
|
|
23
29
|
<slot name="tabs">
|
|
24
30
|
<AntTabs
|
|
25
|
-
:
|
|
31
|
+
:tab-items="tabItems"
|
|
26
32
|
/>
|
|
27
33
|
</slot>
|
|
28
34
|
|
|
29
35
|
<div class="flex gap-2.5 pr-2.5 py-2.5">
|
|
30
36
|
<slot name="buttons">
|
|
31
|
-
<slot name="before-delete-button"/>
|
|
37
|
+
<slot name="before-delete-button" />
|
|
32
38
|
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
<AntDeleteButton
|
|
40
|
+
:disabled="deleteButtonDisabled || !canDelete"
|
|
41
|
+
filled
|
|
42
|
+
:can-delete="canDelete"
|
|
43
|
+
:invalid-permission-tooltip-position="Position.left"
|
|
44
|
+
@click="() => dialogOpen = true"
|
|
45
|
+
/>
|
|
40
46
|
|
|
41
|
-
<slot name="after-delete-button"/>
|
|
47
|
+
<slot name="after-delete-button" />
|
|
42
48
|
</slot>
|
|
43
49
|
</div>
|
|
44
50
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
// TODO:: This component works only with vue-router. Make it work in storybook.
|
|
3
|
-
// TODO:: add skeleton
|
|
4
3
|
import AntSearch from '../form/AntSearch.vue';
|
|
5
4
|
import AntCreateButton from '../buttons/AntCreateButton.vue';
|
|
6
5
|
import AntDropdown from '../AntDropdown.vue';
|
|
7
|
-
import AntIcon from '../AntIcon.vue';
|
|
8
6
|
import {computed, ref, watch} from 'vue';
|
|
9
7
|
import AntButton from '../buttons/AntButton.vue';
|
|
10
8
|
import {faFilter, faMultiply} from '@fortawesome/free-solid-svg-icons';
|
|
@@ -12,17 +10,19 @@ import {ColorType, Grouped, Position} from '../../enums';
|
|
|
12
10
|
import {useRoute, useRouter} from 'vue-router';
|
|
13
11
|
|
|
14
12
|
const props = withDefaults(defineProps<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
fullWidth?: boolean,
|
|
14
|
+
showFilter?: boolean,
|
|
15
|
+
searchQuery?: string,
|
|
16
|
+
hasFilter?: boolean,
|
|
17
|
+
canCreate?: boolean,
|
|
18
|
+
skeleton?: boolean,
|
|
20
19
|
}>(), {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
fullWidth: true,
|
|
21
|
+
showFilter: true,
|
|
22
|
+
searchQuery: 'search',
|
|
23
|
+
hasFilter: false,
|
|
24
|
+
canCreate: true,
|
|
25
|
+
skeleton: false,
|
|
26
26
|
});
|
|
27
27
|
const emit = defineEmits(['search', 'create', 'removeFilter']);
|
|
28
28
|
const router = useRouter();
|
|
@@ -31,38 +31,38 @@ const route = useRoute();
|
|
|
31
31
|
const showDropdown = ref(false);
|
|
32
32
|
const _fullWidth = ref(props.fullWidth)
|
|
33
33
|
const search = computed({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
get: () => route.query[props.searchQuery] as string || '',
|
|
35
|
+
set: (value) => {
|
|
36
|
+
const query = {
|
|
37
|
+
...route.query,
|
|
38
|
+
[props.searchQuery]: value
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
if (!value) {
|
|
42
|
+
delete query[props.searchQuery];
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
(async () => {
|
|
46
|
+
await router.replace({
|
|
47
|
+
...route,
|
|
48
|
+
query
|
|
49
|
+
})
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
emit('search', value)
|
|
52
|
+
})()
|
|
53
|
+
}
|
|
54
54
|
})
|
|
55
55
|
|
|
56
56
|
watch(() => props.fullWidth, (val) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
_fullWidth.value = val
|
|
59
|
+
}, val ? 250 : 300)
|
|
60
60
|
})
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
63
|
<template>
|
|
64
64
|
<div
|
|
65
|
-
class="flex h-full items-center p-2.5 gap-2.5 bg-
|
|
65
|
+
class="flex h-full items-center p-2.5 gap-2.5 bg-white"
|
|
66
66
|
data-e2e="crud-table-filter"
|
|
67
67
|
>
|
|
68
68
|
<div
|
|
@@ -102,7 +102,7 @@ watch(() => props.fullWidth, (val) => {
|
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
104
|
<template #content>
|
|
105
|
-
<slot name="dropdownContent"/>
|
|
105
|
+
<slot name="dropdownContent" />
|
|
106
106
|
</template>
|
|
107
107
|
</AntDropdown>
|
|
108
108
|
</div>
|
|
@@ -112,6 +112,8 @@ watch(() => props.fullWidth, (val) => {
|
|
|
112
112
|
<AntCreateButton
|
|
113
113
|
filled
|
|
114
114
|
:skeleton="skeleton"
|
|
115
|
+
:can-create="canCreate"
|
|
116
|
+
:invalid-permission-tooltip-position="Position.left"
|
|
115
117
|
@click="() => emit('create')"
|
|
116
118
|
/>
|
|
117
119
|
</slot>
|
|
@@ -90,11 +90,15 @@ watch(() => props.fullWidth, (val) => {
|
|
|
90
90
|
>
|
|
91
91
|
<div
|
|
92
92
|
v-if="_fullWidth"
|
|
93
|
-
class="flex gap-2 items-center text-
|
|
93
|
+
class="flex gap-2 items-center text-for-white-bg-font text-sm"
|
|
94
94
|
data-e2e="items-per-page"
|
|
95
95
|
>
|
|
96
96
|
<span class="relative">
|
|
97
|
-
<AntSkeleton
|
|
97
|
+
<AntSkeleton
|
|
98
|
+
v-if="skeleton"
|
|
99
|
+
rounded
|
|
100
|
+
absolute
|
|
101
|
+
/>
|
|
98
102
|
Items per page
|
|
99
103
|
</span>
|
|
100
104
|
|
|
@@ -105,8 +109,15 @@ watch(() => props.fullWidth, (val) => {
|
|
|
105
109
|
:expanded="false"
|
|
106
110
|
/>
|
|
107
111
|
|
|
108
|
-
<div
|
|
109
|
-
|
|
112
|
+
<div
|
|
113
|
+
v-if="count !== null"
|
|
114
|
+
class="flex gap-1 relative"
|
|
115
|
+
>
|
|
116
|
+
<AntSkeleton
|
|
117
|
+
v-if="skeleton"
|
|
118
|
+
rounded
|
|
119
|
+
absolute
|
|
120
|
+
/>
|
|
110
121
|
|
|
111
122
|
<span class="font-medium">{{ fromItems }} - {{ itemsPerPage * page }}</span>
|
|
112
123
|
<span>of</span>
|
|
@@ -80,14 +80,14 @@ function confirmDialog() {
|
|
|
80
80
|
</script>
|
|
81
81
|
|
|
82
82
|
<template>
|
|
83
|
-
<
|
|
83
|
+
<Transition name="fade">
|
|
84
84
|
<div
|
|
85
85
|
v-if="openBackground"
|
|
86
86
|
class="absolute inset-0 flex items-center justify-center z-50 cursor-pointer overflow-hidden bg-black/50 backdrop-blur-sm"
|
|
87
87
|
data-e2e="dialog"
|
|
88
88
|
@click.self="closeDialog"
|
|
89
89
|
>
|
|
90
|
-
<
|
|
90
|
+
<Transition :name="'bounce'">
|
|
91
91
|
<div
|
|
92
92
|
v-if="openDialog"
|
|
93
93
|
class="flex flex-col gap-px bg-neutral-300 overflow-hidden cursor-auto w-96 border border-neutral-300 rounded-md shadow-md"
|
|
@@ -101,7 +101,7 @@ function confirmDialog() {
|
|
|
101
101
|
</slot>
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
|
-
<div class="bg-
|
|
104
|
+
<div class="bg-white p-2.5 grow flex items-center gap-2.5 text-sm">
|
|
105
105
|
<slot name="icon">
|
|
106
106
|
<AntIcon
|
|
107
107
|
v-if="icons[colorType]"
|
|
@@ -112,11 +112,11 @@ function confirmDialog() {
|
|
|
112
112
|
/>
|
|
113
113
|
</slot>
|
|
114
114
|
|
|
115
|
-
<slot/>
|
|
115
|
+
<slot />
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div
|
|
119
|
-
class="bg-neutral-100 p-2.5 gap-2.5 text-
|
|
119
|
+
class="bg-neutral-100 p-2.5 gap-2.5 text-for-white-bg-font flex w-full justify-end"
|
|
120
120
|
>
|
|
121
121
|
<slot name="footer">
|
|
122
122
|
<AntButton
|
|
@@ -137,9 +137,9 @@ function confirmDialog() {
|
|
|
137
137
|
</slot>
|
|
138
138
|
</div>
|
|
139
139
|
</div>
|
|
140
|
-
</
|
|
140
|
+
</Transition>
|
|
141
141
|
</div>
|
|
142
|
-
</
|
|
142
|
+
</Transition>
|
|
143
143
|
</template>
|
|
144
144
|
|
|
145
145
|
<style scoped>
|
|
@@ -113,7 +113,7 @@ onMounted(() => {
|
|
|
113
113
|
<AntIcon
|
|
114
114
|
v-if="_value"
|
|
115
115
|
:icon="faCheck"
|
|
116
|
-
class="absolute !text-
|
|
116
|
+
class="absolute !text-white pointer-events-none"
|
|
117
117
|
:size="size as unknown as IconSize"
|
|
118
118
|
/>
|
|
119
119
|
|
|
@@ -137,7 +137,6 @@ onMounted(() => {
|
|
|
137
137
|
</div>
|
|
138
138
|
</div>
|
|
139
139
|
</AntField>
|
|
140
|
-
|
|
141
140
|
</template>
|
|
142
141
|
|
|
143
142
|
<style scoped>
|
|
@@ -70,7 +70,7 @@ const _modelValue = computed({
|
|
|
70
70
|
const valueLabel = computed(() => props.options.find(option => option.value === _modelValue.value)?.label || null);
|
|
71
71
|
const inputClasses = computed(() => {
|
|
72
72
|
const variants: Record<InputColorType, string> = {
|
|
73
|
-
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 bg-
|
|
73
|
+
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 bg-white focus:ring-primary/25',
|
|
74
74
|
[InputColorType.success]: 'outline-success-500 focus:outline-success-500 bg-success-100 focus:ring-success/25',
|
|
75
75
|
[InputColorType.info]: 'outline-info-500 focus:outline-info-500 bg-info-100 focus:ring-info/25',
|
|
76
76
|
[InputColorType.warning]: 'outline-warning-500 focus:outline-warning-500 bg-warning-100 focus:ring-warning/25',
|
|
@@ -117,7 +117,7 @@ const placeholderClasses = computed(() => {
|
|
|
117
117
|
});
|
|
118
118
|
const inputValueClasses = computed(() => {
|
|
119
119
|
const variants: Record<InputColorType, string> = {
|
|
120
|
-
[InputColorType.base]: 'text-
|
|
120
|
+
[InputColorType.base]: 'text-for-white-bg-font',
|
|
121
121
|
[InputColorType.success]: 'text-success-100-font',
|
|
122
122
|
[InputColorType.info]: 'text-info-100-font',
|
|
123
123
|
[InputColorType.warning]: 'text-warning-100-font',
|
|
@@ -130,7 +130,7 @@ const inputValueClasses = computed(() => {
|
|
|
130
130
|
});
|
|
131
131
|
const arrowClasses = computed(() => {
|
|
132
132
|
const variants: Record<InputColorType, string> = {
|
|
133
|
-
[InputColorType.base]: 'text-
|
|
133
|
+
[InputColorType.base]: 'text-for-white-bg-font',
|
|
134
134
|
[InputColorType.success]: 'text-success-100-font',
|
|
135
135
|
[InputColorType.info]: 'text-info-100-font',
|
|
136
136
|
[InputColorType.warning]: 'text-warning-100-font',
|
|
@@ -196,103 +196,107 @@ function onClickRemoveButton() {
|
|
|
196
196
|
|
|
197
197
|
<template>
|
|
198
198
|
<AntField
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
199
|
+
:label="label"
|
|
200
|
+
:size="size"
|
|
201
|
+
:skeleton="skeleton"
|
|
202
|
+
:description="description"
|
|
203
|
+
:color-type="colorType"
|
|
204
|
+
:validator="validator"
|
|
205
|
+
:class="wrapperClass"
|
|
206
|
+
:show-message-on-error="showMessageOnError"
|
|
207
|
+
:expanded="expanded"
|
|
208
|
+
label-for="noop"
|
|
209
|
+
data-e2e="select"
|
|
210
|
+
@click-label="() => inputRef?.focus()"
|
|
211
211
|
>
|
|
212
212
|
<div
|
|
213
|
-
|
|
213
|
+
class="h-fit flex flex-row w-full"
|
|
214
214
|
>
|
|
215
215
|
<div
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
v-on-click-outside="onClickOutside"
|
|
217
|
+
class="relative w-full"
|
|
218
|
+
:class="{'cursor-pointer': !skeleton}"
|
|
219
219
|
>
|
|
220
220
|
<AntSkeleton
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
v-if="skeleton"
|
|
222
|
+
absolute
|
|
223
|
+
rounded
|
|
224
|
+
:grouped="skeletonGrouped"
|
|
225
225
|
/>
|
|
226
226
|
|
|
227
|
-
<input
|
|
227
|
+
<input
|
|
228
|
+
v-model="_modelValue"
|
|
229
|
+
type="hidden"
|
|
230
|
+
:name="name"
|
|
231
|
+
>
|
|
228
232
|
|
|
229
233
|
<!-- Input -->
|
|
230
234
|
<div
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
ref="inputRef"
|
|
236
|
+
:class="inputClasses"
|
|
237
|
+
:tabindex="disabled ? undefined : 0"
|
|
238
|
+
v-bind="$attrs"
|
|
239
|
+
@mousedown="onClickSelectInput"
|
|
240
|
+
@click="inputRef?.focus()"
|
|
237
241
|
>
|
|
238
242
|
<div
|
|
239
|
-
|
|
240
|
-
|
|
243
|
+
v-if="_modelValue === null && placeholder !== undefined"
|
|
244
|
+
:class="placeholderClasses"
|
|
241
245
|
>
|
|
242
246
|
{{ placeholder }}
|
|
243
247
|
</div>
|
|
244
248
|
|
|
245
249
|
<div
|
|
246
|
-
|
|
247
|
-
|
|
250
|
+
v-else-if="_modelValue === null && label !== undefined"
|
|
251
|
+
:class="placeholderClasses"
|
|
248
252
|
>
|
|
249
253
|
{{ label }}
|
|
250
254
|
</div>
|
|
251
255
|
|
|
252
256
|
<div
|
|
253
|
-
|
|
254
|
-
|
|
257
|
+
v-else
|
|
258
|
+
:class="inputValueClasses"
|
|
255
259
|
>
|
|
256
260
|
{{ valueLabel }}
|
|
257
261
|
</div>
|
|
258
262
|
|
|
259
263
|
<AntIcon
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
v-if="isOpen"
|
|
265
|
+
:icon="faChevronUp"
|
|
266
|
+
:size="size as unknown as IconSize"
|
|
267
|
+
:class="arrowClasses"
|
|
264
268
|
/>
|
|
265
269
|
|
|
266
270
|
<AntIcon
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
+
v-else
|
|
272
|
+
:icon="faChevronDown"
|
|
273
|
+
:size="size as unknown as IconSize"
|
|
274
|
+
:class="arrowClasses"
|
|
271
275
|
/>
|
|
272
276
|
</div>
|
|
273
277
|
|
|
274
278
|
<!-- Dropdown -->
|
|
275
279
|
<AntDropDown
|
|
280
|
+
ref="dropDownRef"
|
|
276
281
|
v-model="_modelValue"
|
|
277
282
|
v-model:open="isOpen"
|
|
278
|
-
ref="dropDownRef"
|
|
279
283
|
:options="options"
|
|
280
284
|
:input-ref="inputRef"
|
|
281
285
|
:size="size"
|
|
282
286
|
:color-type="_colorType"
|
|
283
|
-
@select-element="(e) => _modelValue = e"
|
|
284
287
|
close-on-enter
|
|
288
|
+
@select-element="(e) => _modelValue = e"
|
|
285
289
|
/>
|
|
286
290
|
</div>
|
|
287
291
|
|
|
288
292
|
<AntButton
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
v-if="nullable && _modelValue !== null"
|
|
294
|
+
:icon-left="faMultiply"
|
|
295
|
+
:color-type="_colorType as unknown as ColorType"
|
|
296
|
+
:grouped="[Grouped.left, Grouped.center].some(item => item === grouped) ? Grouped.center : Grouped.right"
|
|
297
|
+
:size="size"
|
|
298
|
+
:skeleton="skeleton"
|
|
299
|
+
@click="onClickRemoveButton"
|
|
296
300
|
/>
|
|
297
301
|
</div>
|
|
298
302
|
</AntField>
|
|
@@ -82,7 +82,7 @@ const ballClasses = computed(() => ({
|
|
|
82
82
|
|
|
83
83
|
const valueClasses = computed(() => {
|
|
84
84
|
const classes = {
|
|
85
|
-
'text-
|
|
85
|
+
'text-for-white-bg-font': true,
|
|
86
86
|
'text-sm': props.size === Size.sm,
|
|
87
87
|
'text-md': props.size === Size.md,
|
|
88
88
|
'opacity-50 cursor-not-allowed': props.disabled
|
|
@@ -115,17 +115,17 @@ function changeValue() {
|
|
|
115
115
|
:class="buttonClasses"
|
|
116
116
|
role="switch"
|
|
117
117
|
:aria-checked="_value"
|
|
118
|
-
@click="changeValue"
|
|
119
|
-
@blur="validator?.validate(_value)"
|
|
120
118
|
:disabled="disabled"
|
|
121
119
|
:tabindex="readonly ? -1 : 1"
|
|
120
|
+
@click="changeValue"
|
|
121
|
+
@blur="validator?.validate(_value)"
|
|
122
122
|
>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
<span
|
|
124
|
+
aria-hidden="true"
|
|
125
|
+
:class="ballClasses"
|
|
126
|
+
>
|
|
127
|
+
<slot name="icon"></slot>
|
|
128
|
+
</span>
|
|
129
129
|
</button>
|
|
130
130
|
|
|
131
131
|
<AntSkeleton
|
|
@@ -135,7 +135,10 @@ function changeValue() {
|
|
|
135
135
|
></AntSkeleton>
|
|
136
136
|
</div>
|
|
137
137
|
|
|
138
|
-
<div
|
|
138
|
+
<div
|
|
139
|
+
v-if="value"
|
|
140
|
+
class="relative"
|
|
141
|
+
>
|
|
139
142
|
<span :class="valueClasses">{{ value }}</span>
|
|
140
143
|
|
|
141
144
|
<AntSkeleton
|
|
@@ -79,7 +79,7 @@ const itemClasses = computed(() => {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
const colorVariant = {
|
|
82
|
-
[InputColorType.base]: 'border-neutral-300 bg-
|
|
82
|
+
[InputColorType.base]: 'border-neutral-300 bg-white text-for-white-bg-font',
|
|
83
83
|
[InputColorType.danger]: 'border-danger-500 bg-danger-100 text-danger-100-font',
|
|
84
84
|
[InputColorType.info]: 'border-info-500 bg-info-100 text-info-100-font',
|
|
85
85
|
[InputColorType.success]: 'border-success-500 bg-success-100 text-success-100-font',
|
|
@@ -126,7 +126,7 @@ function nextOption() {
|
|
|
126
126
|
:size="size"
|
|
127
127
|
:skeleton="skeleton"
|
|
128
128
|
:description="description"
|
|
129
|
-
:
|
|
129
|
+
:color-type="colorType"
|
|
130
130
|
:validator="validator"
|
|
131
131
|
label-for="noop"
|
|
132
132
|
>
|
|
@@ -140,12 +140,12 @@ function nextOption() {
|
|
|
140
140
|
:icon-left="faChevronLeft"
|
|
141
141
|
:grouped="Grouped.left"
|
|
142
142
|
no-focus
|
|
143
|
-
@click="prevOption"
|
|
144
143
|
:color-type="_colorType as unknown as ColorType"
|
|
145
144
|
:size="size"
|
|
146
145
|
:skeleton="skeleton"
|
|
147
146
|
:readonly="readonly"
|
|
148
147
|
:disabled="disabled"
|
|
148
|
+
@click="prevOption"
|
|
149
149
|
/>
|
|
150
150
|
|
|
151
151
|
<div class="grow relative">
|
|
@@ -168,12 +168,12 @@ function nextOption() {
|
|
|
168
168
|
:icon-left="faChevronRight"
|
|
169
169
|
:grouped="Grouped.right"
|
|
170
170
|
no-focus
|
|
171
|
-
@click="nextOption"
|
|
172
171
|
:color-type="_colorType as unknown as ColorType"
|
|
173
172
|
:size="size"
|
|
174
173
|
:skeleton="skeleton"
|
|
175
174
|
:readonly="readonly"
|
|
176
175
|
:disabled="disabled"
|
|
176
|
+
@click="nextOption"
|
|
177
177
|
/>
|
|
178
178
|
</div>
|
|
179
179
|
</AntField>
|
|
@@ -55,7 +55,7 @@ const icons = {
|
|
|
55
55
|
};
|
|
56
56
|
const inputClasses = computed(() => {
|
|
57
57
|
const variants: Record<InputColorType, string> = {
|
|
58
|
-
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 focus:ring-primary/25 bg-
|
|
58
|
+
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 focus:ring-primary/25 bg-white placeholder:text-neutral-500',
|
|
59
59
|
[InputColorType.danger]: 'outline-danger-500 focus:outline-danger-500 focus:ring-danger/25 bg-danger-100 placeholder:text-danger-700',
|
|
60
60
|
[InputColorType.info]: 'outline-info-500 focus:outline-info-500 focus:ring-info/25 bg-info-100 placeholder:text-info-700',
|
|
61
61
|
[InputColorType.success]: 'outline-success-500 focus:outline-success-500 focus:ring-success/25 bg-success-100 placeholder:text-success-700',
|
|
@@ -132,12 +132,15 @@ function onBlur(e: FocusEvent) {
|
|
|
132
132
|
:size="size"
|
|
133
133
|
:skeleton="skeleton"
|
|
134
134
|
:description="description"
|
|
135
|
-
:
|
|
135
|
+
:color-type="colorType"
|
|
136
136
|
:limiter-max-value="limiter && max !== undefined ? max : undefined"
|
|
137
137
|
:limiter-value="limiter ? _modelValue.length : undefined"
|
|
138
138
|
:errors="errors"
|
|
139
139
|
>
|
|
140
|
-
<div
|
|
140
|
+
<div
|
|
141
|
+
class="block relative w-full"
|
|
142
|
+
:class="{...{'-mr-px': grouped !== Grouped.none}, ..._wrapperClass}"
|
|
143
|
+
>
|
|
141
144
|
<textarea
|
|
142
145
|
v-model="_modelValue"
|
|
143
146
|
:class="inputClasses"
|