@antify/ui 2.5.7 → 3.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 +5 -6
- package/dist/components/AntAccordionItem.vue +5 -7
- package/dist/components/AntAlert.vue +53 -54
- package/dist/components/AntButton.vue +60 -62
- package/dist/components/AntCard.vue +10 -11
- package/dist/components/AntIcon.vue +8 -8
- package/dist/components/AntKeycap.vue +15 -15
- package/dist/components/AntListGroup.vue +10 -10
- package/dist/components/AntModal.vue +5 -5
- package/dist/components/AntPagination.vue +38 -40
- package/dist/components/AntSkeleton.vue +5 -25
- package/dist/components/AntToast.vue +6 -6
- package/dist/components/AntToaster.vue +42 -15
- package/dist/components/__stories/AntListGroup.stories.js +6 -9
- package/dist/components/__stories/AntListGroup.stories.mjs +6 -9
- package/dist/components/__stories/AntListGroupItem.stories.js +1 -1
- package/dist/components/__stories/AntListGroupItem.stories.mjs +1 -1
- package/dist/components/__stories/AntToaster.stories.js +2 -2
- package/dist/components/__stories/AntToaster.stories.mjs +2 -2
- package/dist/components/inputs/AntCheckbox.vue +8 -9
- package/dist/components/inputs/AntColorInput/AntColorInput.vue +5 -10
- package/dist/components/inputs/AntImageInput.vue +34 -36
- package/dist/components/inputs/AntRadio.vue +8 -9
- package/dist/components/inputs/AntSelect.vue +64 -63
- package/dist/components/inputs/AntSwitch.vue +26 -27
- package/dist/components/inputs/AntSwitcher.vue +12 -11
- package/dist/components/inputs/AntTagInput.vue +6 -10
- package/dist/components/inputs/AntTextarea.vue +5 -9
- package/dist/components/inputs/Elements/AntBaseInput.vue +60 -60
- package/dist/components/inputs/__stories/AntCheckbox.stories.js +41 -14
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +41 -14
- package/dist/components/table/AntTable.vue +11 -7
- package/dist/components/table/AntTableSkeleton.vue +5 -1
- package/dist/components/tabs/AntTabItem.vue +5 -7
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +11 -0
- package/dist/composables/index.mjs +1 -0
- package/dist/composables/useFlickerProtection.d.ts +22 -0
- package/dist/composables/useFlickerProtection.js +48 -0
- package/dist/composables/useFlickerProtection.mjs +48 -0
- package/dist/composables/useToaster.d.ts +1 -0
- package/dist/composables/useToaster.js +7 -4
- package/dist/composables/useToaster.mjs +7 -4
- package/package.json +1 -1
|
@@ -82,18 +82,17 @@ function onClose(index: number) {
|
|
|
82
82
|
/>
|
|
83
83
|
</template>
|
|
84
84
|
|
|
85
|
-
<div
|
|
85
|
+
<div>
|
|
86
86
|
<slot
|
|
87
87
|
name="item-content"
|
|
88
88
|
v-bind="{item, index}"
|
|
89
89
|
>
|
|
90
|
-
<div v-html="item.content" />
|
|
91
|
-
|
|
92
90
|
<AntSkeleton
|
|
93
|
-
|
|
94
|
-
absolute
|
|
91
|
+
:visible="skeleton"
|
|
95
92
|
rounded
|
|
96
|
-
|
|
93
|
+
>
|
|
94
|
+
<div v-html="item.content" />
|
|
95
|
+
</AntSkeleton>
|
|
97
96
|
</slot>
|
|
98
97
|
</div>
|
|
99
98
|
</AntAccordionItem>
|
|
@@ -85,16 +85,14 @@ const labelClasses = computed(() => ({
|
|
|
85
85
|
/>
|
|
86
86
|
</slot>
|
|
87
87
|
|
|
88
|
-
<
|
|
88
|
+
<AntSkeleton
|
|
89
|
+
:visible="skeleton"
|
|
90
|
+
rounded
|
|
91
|
+
>
|
|
89
92
|
<div class="text-sm font-semibold">
|
|
90
93
|
{{ label }}
|
|
91
94
|
</div>
|
|
92
|
-
|
|
93
|
-
v-if="skeleton"
|
|
94
|
-
absolute
|
|
95
|
-
rounded
|
|
96
|
-
/>
|
|
97
|
-
</div>
|
|
95
|
+
</AntSkeleton>
|
|
98
96
|
</div>
|
|
99
97
|
|
|
100
98
|
<AntIcon
|
|
@@ -64,7 +64,7 @@ const classes = computed(() => {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
return {
|
|
67
|
-
'inline-flex flex-col gap-2 rounded-md p-2 transition-colors text-sm
|
|
67
|
+
'inline-flex flex-col gap-2 rounded-md p-2 transition-colors text-sm': true,
|
|
68
68
|
'w-full': props.expanded,
|
|
69
69
|
[variants[props.state]]: true,
|
|
70
70
|
};
|
|
@@ -89,68 +89,67 @@ onMounted(() => {
|
|
|
89
89
|
</script>
|
|
90
90
|
|
|
91
91
|
<template>
|
|
92
|
-
<
|
|
93
|
-
:
|
|
94
|
-
|
|
92
|
+
<AntSkeleton
|
|
93
|
+
:visible="skeleton"
|
|
94
|
+
rounded
|
|
95
95
|
>
|
|
96
|
-
<AntSkeleton
|
|
97
|
-
v-if="skeleton"
|
|
98
|
-
absolute
|
|
99
|
-
rounded
|
|
100
|
-
/>
|
|
101
|
-
|
|
102
96
|
<div
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
:class="{'invisible': skeleton}"
|
|
97
|
+
:class="classes"
|
|
98
|
+
data-e2e="alert"
|
|
106
99
|
>
|
|
107
|
-
<div
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
<div
|
|
101
|
+
v-if="icon || hasQuestionMark || dismissBtn || title"
|
|
102
|
+
class="inline-flex items-center justify-between w-content gap-2"
|
|
103
|
+
:class="{'invisible': skeleton}"
|
|
104
|
+
>
|
|
105
|
+
<div class="inline-flex items-center gap-2">
|
|
106
|
+
<AntIcon
|
|
107
|
+
v-if="icon"
|
|
108
|
+
:icon="_icon"
|
|
109
|
+
:color="iconColor"
|
|
110
|
+
:size="IconSize.sm"
|
|
111
|
+
/>
|
|
114
112
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
113
|
+
<div
|
|
114
|
+
:class="{'font-semibold': hasDefaultSlot}"
|
|
115
|
+
>
|
|
116
|
+
<slot name="title">
|
|
117
|
+
{{ title }}
|
|
118
|
+
</slot>
|
|
119
|
+
</div>
|
|
121
120
|
</div>
|
|
122
|
-
</div>
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
<div class="flex gap-2">
|
|
123
|
+
<div v-if="hasQuestionMark">
|
|
124
|
+
<slot name="questionMarkText">
|
|
125
|
+
<AntTooltip>
|
|
126
|
+
<AntIcon
|
|
127
|
+
:icon="faCircleQuestion"
|
|
128
|
+
:color="iconColor"
|
|
129
|
+
:size="IconSize.sm"
|
|
130
|
+
/>
|
|
133
131
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
<template #content>
|
|
133
|
+
{{ questionMarkText }}
|
|
134
|
+
</template>
|
|
135
|
+
</AntTooltip>
|
|
136
|
+
</slot>
|
|
137
|
+
</div>
|
|
140
138
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
139
|
+
<AntIcon
|
|
140
|
+
v-if="dismissBtn"
|
|
141
|
+
:icon="faXmark"
|
|
142
|
+
class="cursor-pointer"
|
|
143
|
+
:color="iconColor"
|
|
144
|
+
:size="IconSize.sm"
|
|
145
|
+
@click="() => $emit('close')"
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
149
148
|
</div>
|
|
150
|
-
</div>
|
|
151
149
|
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
<div v-if="hasDefaultSlot">
|
|
151
|
+
<slot />
|
|
152
|
+
</div>
|
|
154
153
|
</div>
|
|
155
|
-
</
|
|
154
|
+
</AntSkeleton>
|
|
156
155
|
</template>
|
|
@@ -128,7 +128,7 @@ const classes = computed(() => {
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
return {
|
|
131
|
-
'transition-all inline-flex items-center justify-center
|
|
131
|
+
'transition-all inline-flex items-center justify-center font-medium cursor-pointer select-none': true,
|
|
132
132
|
'active:shadow-[inset_0_4px_4px_rgba(0,0,0,0.25)]': !hasInputState.value,
|
|
133
133
|
'p-1 text-xs gap-1': props.size === Size.xs2,
|
|
134
134
|
'p-1.5 text-xs gap-1.5': props.size === Size.xs,
|
|
@@ -140,7 +140,6 @@ const classes = computed(() => {
|
|
|
140
140
|
'focus:ring-2': !props.readonly && props.size === Size.sm || props.size === Size.xs || props.size === Size.xs2,
|
|
141
141
|
'focus:ring-4': !props.readonly && props.size === Size.md || props.size === Size.lg,
|
|
142
142
|
'w-full': props.expanded,
|
|
143
|
-
invisible: props.skeleton,
|
|
144
143
|
'outline outline-1 outline-offset-[-1px]': props.outlined,
|
|
145
144
|
...groupedClassList.value,
|
|
146
145
|
[variants[props.state]]: true,
|
|
@@ -202,73 +201,72 @@ onMounted(() => {
|
|
|
202
201
|
</script>
|
|
203
202
|
|
|
204
203
|
<template>
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
:
|
|
208
|
-
|
|
209
|
-
:data-e2e-state="props.state"
|
|
204
|
+
<AntSkeleton
|
|
205
|
+
:visible="skeleton"
|
|
206
|
+
:grouped="grouped"
|
|
207
|
+
rounded
|
|
210
208
|
>
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
/>
|
|
217
|
-
|
|
218
|
-
<AntTooltip
|
|
219
|
-
class="w-full"
|
|
220
|
-
:state="tooltipState"
|
|
221
|
-
:delay="tooltipDelay"
|
|
209
|
+
<div
|
|
210
|
+
class="inline-flex h-fit"
|
|
211
|
+
:class="{'w-full': props.expanded}"
|
|
212
|
+
data-e2e="button"
|
|
213
|
+
:data-e2e-state="props.state"
|
|
222
214
|
>
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
:
|
|
226
|
-
:
|
|
227
|
-
:to="to"
|
|
228
|
-
:disabled="disabled || undefined"
|
|
229
|
-
:tabindex="noFocus || hasInputState ? '-1' : '0'"
|
|
230
|
-
@click="(e: MouseEvent) => !props.readonly ? $emit('click', e) : null"
|
|
231
|
-
@blur="(e: FocusEvent) => !props.readonly ? $emit('blur', e) : null"
|
|
215
|
+
<AntTooltip
|
|
216
|
+
class="w-full"
|
|
217
|
+
:state="tooltipState"
|
|
218
|
+
:delay="tooltipDelay"
|
|
232
219
|
>
|
|
233
|
-
<
|
|
234
|
-
|
|
235
|
-
:
|
|
236
|
-
:
|
|
237
|
-
:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
name="icon-left"
|
|
220
|
+
<component
|
|
221
|
+
:is="is"
|
|
222
|
+
:class="classes"
|
|
223
|
+
:type="type"
|
|
224
|
+
:to="to"
|
|
225
|
+
:disabled="disabled || undefined"
|
|
226
|
+
:tabindex="noFocus || hasInputState ? '-1' : '0'"
|
|
227
|
+
@click="(e: MouseEvent) => !props.readonly ? $emit('click', e) : null"
|
|
228
|
+
@blur="(e: FocusEvent) => !props.readonly ? $emit('blur', e) : null"
|
|
243
229
|
>
|
|
244
|
-
<
|
|
245
|
-
v-if="
|
|
246
|
-
:
|
|
247
|
-
:
|
|
248
|
-
:
|
|
230
|
+
<AntSpinner
|
|
231
|
+
v-if="spinner"
|
|
232
|
+
:size="size"
|
|
233
|
+
:state="state"
|
|
234
|
+
:inverted="!filled"
|
|
249
235
|
/>
|
|
250
|
-
</slot>
|
|
251
236
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
237
|
+
<slot
|
|
238
|
+
v-if="!spinner"
|
|
239
|
+
name="icon-left"
|
|
240
|
+
>
|
|
241
|
+
<AntIcon
|
|
242
|
+
v-if="iconLeft"
|
|
243
|
+
:icon="iconLeft"
|
|
244
|
+
:size="getIconSize"
|
|
245
|
+
:color="iconColor"
|
|
246
|
+
/>
|
|
247
|
+
</slot>
|
|
255
248
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
name="icon-right"
|
|
259
|
-
>
|
|
260
|
-
<AntIcon
|
|
261
|
-
v-if="iconRight"
|
|
262
|
-
:icon="iconRight"
|
|
263
|
-
:size="getIconSize"
|
|
264
|
-
:color="iconColor"
|
|
249
|
+
<slot
|
|
250
|
+
v-if="!spinner"
|
|
265
251
|
/>
|
|
266
|
-
</slot>
|
|
267
|
-
</component>
|
|
268
252
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
253
|
+
<slot
|
|
254
|
+
v-if="!spinner"
|
|
255
|
+
name="icon-right"
|
|
256
|
+
>
|
|
257
|
+
<AntIcon
|
|
258
|
+
v-if="iconRight"
|
|
259
|
+
:icon="iconRight"
|
|
260
|
+
:size="getIconSize"
|
|
261
|
+
:color="iconColor"
|
|
262
|
+
/>
|
|
263
|
+
</slot>
|
|
264
|
+
</component>
|
|
265
|
+
|
|
266
|
+
<template #content>
|
|
267
|
+
<slot name="tooltip-content" />
|
|
268
|
+
</template>
|
|
269
|
+
</AntTooltip>
|
|
270
|
+
</div>
|
|
271
|
+
</AntSkeleton>
|
|
274
272
|
</template>
|
|
@@ -31,16 +31,15 @@ const cardClass = computed(() => ({
|
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<template>
|
|
34
|
-
<
|
|
35
|
-
:
|
|
36
|
-
|
|
34
|
+
<AntSkeleton
|
|
35
|
+
:visible="skeleton"
|
|
36
|
+
rounded
|
|
37
37
|
>
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</div>
|
|
38
|
+
<div
|
|
39
|
+
:class="cardClass"
|
|
40
|
+
class="bg-white outline outline-offset-[-1px] outline-base-300 rounded-md"
|
|
41
|
+
>
|
|
42
|
+
<slot />
|
|
43
|
+
</div>
|
|
44
|
+
</AntSkeleton>
|
|
46
45
|
</template>
|
|
@@ -56,15 +56,15 @@ onMounted(() => {
|
|
|
56
56
|
|
|
57
57
|
<template>
|
|
58
58
|
<span :class="containerClasses">
|
|
59
|
-
<FaIcon
|
|
60
|
-
v-if="icon"
|
|
61
|
-
:icon="icon"
|
|
62
|
-
:class="iconClasses"
|
|
63
|
-
/>
|
|
64
59
|
<AntSkeleton
|
|
65
|
-
|
|
66
|
-
absolute
|
|
60
|
+
:visible="skeleton"
|
|
67
61
|
rounded
|
|
68
|
-
|
|
62
|
+
>
|
|
63
|
+
<FaIcon
|
|
64
|
+
v-if="icon"
|
|
65
|
+
:icon="icon"
|
|
66
|
+
:class="iconClasses"
|
|
67
|
+
/>
|
|
68
|
+
</AntSkeleton>
|
|
69
69
|
</span>
|
|
70
70
|
</template>
|
|
@@ -45,21 +45,21 @@ const iconClasses = computed(() => {
|
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
47
|
<template>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
<AntSkeleton
|
|
49
|
+
:visible="skeleton"
|
|
50
|
+
rounded
|
|
51
51
|
>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
<div
|
|
53
|
+
class="inline-flex justify-center items-center bg-base-300 rounded-md text-center text-base-300-font font-medium"
|
|
54
|
+
:class="classes"
|
|
55
|
+
>
|
|
56
|
+
<AntIcon
|
|
57
|
+
v-if="icon"
|
|
58
|
+
:icon="icon"
|
|
59
|
+
:size="iconClasses"
|
|
60
|
+
/>
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
absolute
|
|
62
|
-
rounded
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
62
|
+
<slot v-else />
|
|
63
|
+
</div>
|
|
64
|
+
</AntSkeleton>
|
|
65
65
|
</template>
|
|
@@ -11,18 +11,18 @@ withDefaults(defineProps<{
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<template>
|
|
14
|
-
<div
|
|
14
|
+
<div>
|
|
15
15
|
<AntSkeleton
|
|
16
|
-
|
|
17
|
-
absolute
|
|
16
|
+
:visible="skeleton"
|
|
18
17
|
rounded
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<div
|
|
22
|
-
class="flex flex-col rounded-md bg-base-300 gap-px relative border border-base-300 overflow-hidden"
|
|
23
|
-
:class="{'invisible': skeleton, 'shadow-md': shadow}"
|
|
18
|
+
class="w-full"
|
|
24
19
|
>
|
|
25
|
-
<
|
|
26
|
-
|
|
20
|
+
<div
|
|
21
|
+
class="flex flex-col rounded-md bg-base-300 gap-px relative border border-base-300 overflow-hidden"
|
|
22
|
+
:class="{'invisible': skeleton, 'shadow-md': shadow}"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</AntSkeleton>
|
|
27
27
|
</div>
|
|
28
28
|
</template>
|
|
@@ -68,13 +68,13 @@ function closeModal() {
|
|
|
68
68
|
class="bg-white p-2 flex items-center justify-between gap-2"
|
|
69
69
|
>
|
|
70
70
|
<slot name="title">
|
|
71
|
-
<div class="
|
|
72
|
-
{{ title }}
|
|
71
|
+
<div class="text-for-white-bg-font text-lg font-medium">
|
|
73
72
|
<AntSkeleton
|
|
74
|
-
|
|
75
|
-
absolute
|
|
73
|
+
:visible="skeleton"
|
|
76
74
|
rounded
|
|
77
|
-
|
|
75
|
+
>
|
|
76
|
+
{{ title }}
|
|
77
|
+
</AntSkeleton>
|
|
78
78
|
</div>
|
|
79
79
|
</slot>
|
|
80
80
|
|
|
@@ -170,49 +170,47 @@ const pagination = computed(() => {
|
|
|
170
170
|
</script>
|
|
171
171
|
|
|
172
172
|
<template>
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
<AntSkeleton
|
|
174
|
+
:visible="skeleton"
|
|
175
|
+
rounded
|
|
176
176
|
>
|
|
177
|
-
<AntSkeleton
|
|
178
|
-
v-if="skeleton"
|
|
179
|
-
rounded
|
|
180
|
-
absolute
|
|
181
|
-
/>
|
|
182
|
-
|
|
183
177
|
<div
|
|
184
|
-
class="inline-flex
|
|
185
|
-
|
|
178
|
+
class="inline-flex"
|
|
179
|
+
data-e2e="pagination"
|
|
186
180
|
>
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
:icon-left="faChevronLeft"
|
|
190
|
-
:grouped="Grouped.left"
|
|
191
|
-
:filled="false"
|
|
192
|
-
@click="() => page = page - 1"
|
|
193
|
-
/>
|
|
194
|
-
|
|
195
|
-
<AntButton
|
|
196
|
-
v-for="(pageObj) in pagination"
|
|
197
|
-
:key="`pagination-button-${pageObj}`"
|
|
198
|
-
:state="pageObj === page ? State.primary : State.base"
|
|
199
|
-
:class="{'text-primary-500 z-10': pageObj === page}"
|
|
200
|
-
:disabled="pageObj === '...'"
|
|
201
|
-
:grouped="Grouped.center"
|
|
202
|
-
:filled="false"
|
|
203
|
-
:readonly="pageObj === page"
|
|
204
|
-
@click="() => page = pageObj"
|
|
181
|
+
<div
|
|
182
|
+
class="inline-flex gap-px"
|
|
205
183
|
>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
184
|
+
<AntButton
|
|
185
|
+
:disabled="page === 1"
|
|
186
|
+
:icon-left="faChevronLeft"
|
|
187
|
+
:grouped="Grouped.left"
|
|
188
|
+
:filled="false"
|
|
189
|
+
@click="() => page = page - 1"
|
|
190
|
+
/>
|
|
191
|
+
|
|
192
|
+
<AntButton
|
|
193
|
+
v-for="(pageObj) in pagination"
|
|
194
|
+
:key="`pagination-button-${pageObj}`"
|
|
195
|
+
:state="pageObj === page ? State.primary : State.base"
|
|
196
|
+
:class="{'text-primary-500 z-10': pageObj === page}"
|
|
197
|
+
:disabled="pageObj === '...'"
|
|
198
|
+
:grouped="Grouped.center"
|
|
199
|
+
:filled="false"
|
|
200
|
+
:readonly="pageObj === page"
|
|
201
|
+
@click="() => page = pageObj"
|
|
202
|
+
>
|
|
203
|
+
{{ pageObj }}
|
|
204
|
+
</AntButton>
|
|
205
|
+
|
|
206
|
+
<AntButton
|
|
207
|
+
:icon-left="faChevronRight"
|
|
208
|
+
:grouped="Grouped.right"
|
|
209
|
+
:disabled="page === pages"
|
|
210
|
+
:filled="false"
|
|
211
|
+
@click="() => page = page + 1"
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
216
214
|
</div>
|
|
217
|
-
</
|
|
215
|
+
</AntSkeleton>
|
|
218
216
|
</template>
|
|
@@ -3,8 +3,11 @@ import {
|
|
|
3
3
|
Grouped,
|
|
4
4
|
} from '../enums/Grouped.enum';
|
|
5
5
|
import {
|
|
6
|
-
computed,
|
|
6
|
+
computed,
|
|
7
7
|
} from 'vue';
|
|
8
|
+
import {
|
|
9
|
+
useFlickerProtection,
|
|
10
|
+
} from '../composables/useFlickerProtection';
|
|
8
11
|
|
|
9
12
|
defineOptions({
|
|
10
13
|
inheritAttrs: false,
|
|
@@ -38,30 +41,7 @@ const classList = computed(() => ({
|
|
|
38
41
|
'rounded-full': props.roundedFull && props.grouped === Grouped.none,
|
|
39
42
|
...groupedClassList.value,
|
|
40
43
|
}));
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* To prevent flickering, make sure the skeleton is a minimum time visible
|
|
44
|
-
* before hide it.
|
|
45
|
-
*/
|
|
46
|
-
const _visible = ref(props.visible);
|
|
47
|
-
|
|
48
|
-
watch(
|
|
49
|
-
() => props.visible,
|
|
50
|
-
(newValue) => {
|
|
51
|
-
if (newValue) {
|
|
52
|
-
_visible.value = true;
|
|
53
|
-
} else if (props.minShowTime && props.minShowTime > 0) {
|
|
54
|
-
setTimeout(() => {
|
|
55
|
-
_visible.value = false;
|
|
56
|
-
}, props.minShowTime);
|
|
57
|
-
} else {
|
|
58
|
-
_visible.value = false;
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
immediate: true,
|
|
63
|
-
},
|
|
64
|
-
);
|
|
44
|
+
const _visible = useFlickerProtection(computed(() => props.visible));
|
|
65
45
|
</script>
|
|
66
46
|
|
|
67
47
|
<template>
|
|
@@ -43,15 +43,15 @@ const icons = {
|
|
|
43
43
|
const _icon = computed(() => icons[props.state]);
|
|
44
44
|
const classes = computed(() => {
|
|
45
45
|
const variants: Record<InputState, string> = {
|
|
46
|
-
[InputState.base]: '
|
|
47
|
-
[InputState.danger]: '
|
|
48
|
-
[InputState.info]: '
|
|
49
|
-
[InputState.success]: '
|
|
50
|
-
[InputState.warning]: '
|
|
46
|
+
[InputState.base]: 'border-base-500 text-base-500',
|
|
47
|
+
[InputState.danger]: 'border-danger-500 text-danger-500',
|
|
48
|
+
[InputState.info]: 'border-info-500 text-info-500',
|
|
49
|
+
[InputState.success]: 'border-success-500 text-success-500',
|
|
50
|
+
[InputState.warning]: 'border-warning-500 text-warning-500',
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
return {
|
|
54
|
-
'inline-flex flex-col gap-2 rounded-md p-2 border transition-colors shadow-md': true,
|
|
54
|
+
'bg-white inline-flex flex-col gap-2 rounded-md p-2 border transition-colors shadow-md': true,
|
|
55
55
|
[variants[props.state]]: true,
|
|
56
56
|
};
|
|
57
57
|
});
|