@antify/ui-module 1.4.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 +2 -2
- package/dist/runtime/components/buttons/AntActionButton.vue +5 -0
- package/dist/runtime/components/buttons/AntButton.vue +126 -126
- package/dist/runtime/components/buttons/AntCreateButton.vue +1 -0
- package/dist/runtime/components/buttons/AntDeleteButton.vue +11 -1
- package/dist/runtime/components/buttons/AntDuplicateButton.vue +42 -0
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +6 -4
- package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +130 -130
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +4 -3
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +11 -3
- 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.mjs +4 -3
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +4 -3
- 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 +1 -1
- package/dist/runtime/components/crud/AntCrudDetailNav.vue +1 -1
- package/dist/runtime/components/crud/AntCrudTableFilter.vue +1 -1
- 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/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 +2 -2
- package/src/runtime/components/buttons/AntActionButton.vue +5 -0
- package/src/runtime/components/buttons/AntButton.vue +126 -126
- package/src/runtime/components/buttons/AntCreateButton.vue +1 -0
- package/src/runtime/components/buttons/AntDeleteButton.vue +11 -1
- package/src/runtime/components/buttons/AntDuplicateButton.vue +42 -0
- 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 +1 -1
- package/src/runtime/components/crud/AntCrudDetailNav.vue +1 -1
- package/src/runtime/components/crud/AntCrudTableFilter.vue +1 -1
- 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
|
@@ -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"
|
|
@@ -58,7 +58,7 @@ const icons = {
|
|
|
58
58
|
|
|
59
59
|
const inputClasses = computed(() => {
|
|
60
60
|
const variants: Record<InputColorType, string> = {
|
|
61
|
-
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 focus:ring-primary/25 bg-
|
|
61
|
+
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 focus:ring-primary/25 bg-white placeholder:text-neutral-500',
|
|
62
62
|
[InputColorType.danger]: 'outline-danger-500 focus:outline-danger-500 focus:ring-danger/25 bg-danger-100 placeholder:text-danger-700',
|
|
63
63
|
[InputColorType.info]: 'outline-info-500 focus:outline-info-500 focus:ring-info/25 bg-info-100 placeholder:text-info-700',
|
|
64
64
|
[InputColorType.success]: 'outline-success-500 focus:outline-success-500 focus:ring-success/25 bg-success-100 placeholder:text-success-700',
|
|
@@ -66,7 +66,7 @@ const inputClasses = computed(() => {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
return {
|
|
69
|
-
'transition-colors relative border-none outline w-full focus:z-10': true,
|
|
69
|
+
'transition-colors relative border-none outline w-full focus:z-10 text-black': true,
|
|
70
70
|
'outline-offset-[-1px] outline-1 focus:outline-offset-[-1px] focus:outline-1': true,
|
|
71
71
|
'disabled:opacity-50 disabled:cursor-not-allowed': props.disabled,
|
|
72
72
|
'text-right': props.type === BaseInputType.number,
|
|
@@ -90,21 +90,17 @@ const inputClasses = computed(() => {
|
|
|
90
90
|
});
|
|
91
91
|
const iconClasses = computed(() => ({
|
|
92
92
|
'transition-[height]': true,
|
|
93
|
-
'h-4': props.size === Size.sm,
|
|
94
|
-
'h-5': props.size === Size.md,
|
|
95
93
|
}));
|
|
96
|
-
const
|
|
94
|
+
const iconColorClass = computed(() => {
|
|
97
95
|
const variants: Record<InputColorType, string> = {
|
|
98
|
-
[InputColorType.base]: 'text-
|
|
96
|
+
[InputColorType.base]: 'text-for-white-bg-font',
|
|
99
97
|
[InputColorType.danger]: 'text-danger-500',
|
|
100
98
|
[InputColorType.info]: 'text-info-500',
|
|
101
99
|
[InputColorType.success]: 'text-success-500',
|
|
102
100
|
[InputColorType.warning]: 'text-warning-500',
|
|
103
101
|
};
|
|
104
102
|
|
|
105
|
-
return
|
|
106
|
-
[variants[_colorType.value]]: true,
|
|
107
|
-
};
|
|
103
|
+
return variants[_colorType.value];
|
|
108
104
|
});
|
|
109
105
|
const _wrapperClass = computed(() => classesToObjectSyntax(props.wrapperClass));
|
|
110
106
|
const icon = computed(() => icons[_colorType.value]);
|
|
@@ -156,57 +152,65 @@ function onBlur(e: FocusEvent) {
|
|
|
156
152
|
</script>
|
|
157
153
|
|
|
158
154
|
<template>
|
|
159
|
-
<div
|
|
155
|
+
<div
|
|
156
|
+
class="block relative w-full"
|
|
157
|
+
:class="{...{'-mr-px': grouped !== Grouped.none}, ..._wrapperClass}"
|
|
158
|
+
>
|
|
160
159
|
<div
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
v-if="iconLeft"
|
|
161
|
+
class="absolute h-full flex items-center justify-center z-20"
|
|
162
|
+
:class="{'w-7': size === Size.sm, 'w-10': size === Size.md}"
|
|
164
163
|
>
|
|
165
164
|
<AntIcon
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
:icon="iconLeft"
|
|
166
|
+
:size="size as unknown as IconSize"
|
|
167
|
+
color="text-for-white-bg-font"
|
|
169
168
|
/>
|
|
170
169
|
</div>
|
|
171
170
|
|
|
172
171
|
<input
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
172
|
+
v-model="_value"
|
|
173
|
+
:class="inputClasses"
|
|
174
|
+
:type="type"
|
|
175
|
+
:placeholder="placeholder"
|
|
176
|
+
:disabled="disabled || skeleton"
|
|
177
|
+
v-bind="$attrs"
|
|
178
|
+
@blur="onBlur"
|
|
180
179
|
>
|
|
181
180
|
|
|
182
181
|
<div
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
v-if="nullable && _value !== null && _value !== ''"
|
|
183
|
+
class="absolute flex w-fit right-0 top-0 h-full transition-all z-20"
|
|
184
|
+
:class="{'p-1.5': size === Size.sm, 'p-2.5': size === Size.md}"
|
|
186
185
|
>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
<AntIcon
|
|
187
|
+
:icon="faXmark"
|
|
188
|
+
:class="iconClasses"
|
|
189
|
+
class="cursor-pointer"
|
|
190
|
+
:color="iconColorClass"
|
|
191
|
+
:size="size as unknown as IconSize"
|
|
192
|
+
@click="() => _value = null"
|
|
193
193
|
/>
|
|
194
194
|
</div>
|
|
195
195
|
|
|
196
196
|
<div
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
v-else-if="showIcon && icon"
|
|
198
|
+
class="absolute flex w-fit right-0 top-0 h-full transition-all z-20"
|
|
199
|
+
:class="{'p-1.5': size === Size.sm, 'p-2.5': size === Size.md}"
|
|
200
200
|
>
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
<AntIcon
|
|
202
|
+
:icon="icon"
|
|
203
|
+
:color="iconColorClass"
|
|
204
|
+
:class="iconClasses"
|
|
205
|
+
:size="size as unknown as IconSize"
|
|
206
|
+
/>
|
|
203
207
|
</div>
|
|
204
208
|
|
|
205
209
|
<AntSkeleton
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
v-if="skeleton"
|
|
211
|
+
absolute
|
|
212
|
+
:grouped="grouped"
|
|
213
|
+
rounded
|
|
210
214
|
/>
|
|
211
215
|
</div>
|
|
212
216
|
</template>
|
|
@@ -56,7 +56,7 @@ const dropdownClasses = computed(() => {
|
|
|
56
56
|
});
|
|
57
57
|
const dropDownItemClasses = computed(() => {
|
|
58
58
|
const variants: Record<InputColorType, string> = {
|
|
59
|
-
[InputColorType.base]: 'bg-
|
|
59
|
+
[InputColorType.base]: 'bg-white text-for-white-bg-font',
|
|
60
60
|
[InputColorType.success]: 'bg-success-100 border-success-100-font',
|
|
61
61
|
[InputColorType.info]: 'bg-info-100 border-info-100-font',
|
|
62
62
|
[InputColorType.warning]: 'bg-warning-100 border-warning-100-font',
|
|
@@ -16,12 +16,12 @@ const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
|
|
|
16
16
|
<div class="flex gap-px bg-neutral-300 h-screen overflow-hidden">
|
|
17
17
|
<div class="flex flex-col gap-px bg-neutral-300 w-52 shrink-0">
|
|
18
18
|
<component
|
|
19
|
-
v-if="hasLogoImageSlot"
|
|
20
19
|
:is="logoRoute ? 'RouterLink' : 'div'"
|
|
20
|
+
v-if="hasLogoImageSlot"
|
|
21
21
|
:to="logoRoute"
|
|
22
|
-
class="bg-
|
|
22
|
+
class="bg-white min-h-[60px] flex justify-center items-center p-2.5"
|
|
23
23
|
>
|
|
24
|
-
<slot name="logo-image"/>
|
|
24
|
+
<slot name="logo-image" />
|
|
25
25
|
</component>
|
|
26
26
|
|
|
27
27
|
<AntNavbar
|
|
@@ -30,7 +30,7 @@ const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
|
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
<div class="flex-grow">
|
|
33
|
-
<slot/>
|
|
33
|
+
<slot />
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
</template>
|