@antify/ui 2.4.12 → 2.5.1
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/AntSkeleton.vue +41 -3
- package/dist/components/__stories/AntSkeleton.stories.d.ts +1 -0
- package/dist/components/__stories/AntSkeleton.stories.js +20 -1
- package/dist/components/__stories/AntSkeleton.stories.mjs +19 -0
- package/dist/components/crud/AntCrudTableFilter.vue +11 -6
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.js +1 -1
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +1 -1
- package/dist/components/forms/AntFormGroupLabel.vue +16 -1
- package/dist/components/inputs/AntCheckbox.vue +3 -1
- package/dist/components/inputs/Elements/AntInputDescription.vue +5 -8
- package/dist/components/inputs/Elements/AntInputLabel.vue +11 -11
- package/dist/components/inputs/Elements/AntInputLimiter.vue +4 -7
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.d.ts +1 -1
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.js +3 -1
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +5 -1
- package/package.json +1 -1
|
@@ -3,21 +3,27 @@ import {
|
|
|
3
3
|
Grouped,
|
|
4
4
|
} from '../enums/Grouped.enum';
|
|
5
5
|
import {
|
|
6
|
-
computed,
|
|
6
|
+
computed, ref, watch,
|
|
7
7
|
} from 'vue';
|
|
8
8
|
|
|
9
|
+
defineOptions({
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
});
|
|
12
|
+
|
|
9
13
|
const props = withDefaults(defineProps<{
|
|
14
|
+
visible?: boolean;
|
|
10
15
|
grouped?: Grouped;
|
|
11
16
|
rounded?: boolean;
|
|
12
17
|
roundedFull?: boolean;
|
|
13
18
|
absolute?: boolean;
|
|
14
19
|
minShowTime?: number;
|
|
15
20
|
}>(), {
|
|
21
|
+
visible: true,
|
|
16
22
|
grouped: Grouped.none,
|
|
17
23
|
rounded: false,
|
|
18
24
|
roundedFull: false,
|
|
19
25
|
absolute: false,
|
|
20
|
-
minShowTime:
|
|
26
|
+
minShowTime: 300,
|
|
21
27
|
});
|
|
22
28
|
|
|
23
29
|
const groupedClassList = computed(() => ({
|
|
@@ -32,11 +38,43 @@ const classList = computed(() => ({
|
|
|
32
38
|
'rounded-full': props.roundedFull && props.grouped === Grouped.none,
|
|
33
39
|
...groupedClassList.value,
|
|
34
40
|
}));
|
|
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
|
+
);
|
|
35
65
|
</script>
|
|
36
66
|
|
|
37
67
|
<template>
|
|
38
68
|
<div
|
|
69
|
+
v-if="_visible"
|
|
39
70
|
:class="classList"
|
|
71
|
+
v-bind="$attrs"
|
|
40
72
|
data-e2e="skeleton"
|
|
41
|
-
|
|
73
|
+
>
|
|
74
|
+
<div class="invisible">
|
|
75
|
+
<slot />
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<slot v-else />
|
|
42
80
|
</template>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
module.exports = exports.Rounded = exports.Grouped = exports.Docs = void 0;
|
|
6
|
+
module.exports = exports.Slot = exports.Rounded = exports.Grouped = exports.Docs = void 0;
|
|
7
7
|
var _AntSkeleton = _interopRequireDefault(require("../AntSkeleton.vue"));
|
|
8
8
|
var _Grouped2 = require("../../enums/Grouped.enum");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -57,4 +57,23 @@ const Grouped = exports.Grouped = {
|
|
|
57
57
|
...Docs.args,
|
|
58
58
|
grouped: _Grouped2.Grouped.left
|
|
59
59
|
}
|
|
60
|
+
};
|
|
61
|
+
const Slot = exports.Slot = {
|
|
62
|
+
render: args => ({
|
|
63
|
+
components: {
|
|
64
|
+
AntSkeleton: _AntSkeleton.default
|
|
65
|
+
},
|
|
66
|
+
setup() {
|
|
67
|
+
return {
|
|
68
|
+
args
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
template: `
|
|
72
|
+
<AntSkeleton
|
|
73
|
+
v-bind="args"
|
|
74
|
+
>
|
|
75
|
+
Test here
|
|
76
|
+
</AntSkeleton>`
|
|
77
|
+
}),
|
|
78
|
+
args: {}
|
|
60
79
|
};
|
|
@@ -53,3 +53,22 @@ export const Grouped = {
|
|
|
53
53
|
grouped: _Grouped.left
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
+
export const Slot = {
|
|
57
|
+
render: (args) => ({
|
|
58
|
+
components: {
|
|
59
|
+
AntSkeleton
|
|
60
|
+
},
|
|
61
|
+
setup() {
|
|
62
|
+
return {
|
|
63
|
+
args
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
template: `
|
|
67
|
+
<AntSkeleton
|
|
68
|
+
v-bind="args"
|
|
69
|
+
>
|
|
70
|
+
Test here
|
|
71
|
+
</AntSkeleton>`
|
|
72
|
+
}),
|
|
73
|
+
args: {}
|
|
74
|
+
};
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
const props = withDefaults(defineProps<{
|
|
21
21
|
fullWidth?: boolean;
|
|
22
22
|
showFilter?: boolean;
|
|
23
|
+
showSearch?: boolean;
|
|
23
24
|
searchQuery?: string;
|
|
24
25
|
hasFilter?: boolean;
|
|
25
26
|
canCreate?: boolean;
|
|
@@ -28,6 +29,7 @@ const props = withDefaults(defineProps<{
|
|
|
28
29
|
}>(), {
|
|
29
30
|
fullWidth: true,
|
|
30
31
|
showFilter: true,
|
|
32
|
+
showSearch: true,
|
|
31
33
|
searchQuery: 'search',
|
|
32
34
|
hasFilter: false,
|
|
33
35
|
canCreate: true,
|
|
@@ -84,11 +86,14 @@ watch(() => props.fullWidth, (val) => {
|
|
|
84
86
|
:class="{'grow': !_fullWidth}"
|
|
85
87
|
>
|
|
86
88
|
<div :class="{'w-80': _fullWidth, 'w-full': !_fullWidth}">
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
<slot name="filter">
|
|
90
|
+
<AntSearch
|
|
91
|
+
v-if="showSearch"
|
|
92
|
+
v-model="search"
|
|
93
|
+
:skeleton="skeleton"
|
|
94
|
+
:placeholder="searchPlaceholderText"
|
|
95
|
+
/>
|
|
96
|
+
</slot>
|
|
92
97
|
</div>
|
|
93
98
|
|
|
94
99
|
<AntDropdown
|
|
@@ -122,7 +127,7 @@ watch(() => props.fullWidth, (val) => {
|
|
|
122
127
|
</AntDropdown>
|
|
123
128
|
</div>
|
|
124
129
|
|
|
125
|
-
<div
|
|
130
|
+
<div>
|
|
126
131
|
<slot name="buttons">
|
|
127
132
|
<AntCreateButton
|
|
128
133
|
:skeleton="skeleton"
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import AntSkeleton from '../AntSkeleton.vue';
|
|
3
|
+
|
|
4
|
+
withDefaults(defineProps<{
|
|
5
|
+
skeleton?: boolean;
|
|
6
|
+
}>(), {
|
|
7
|
+
skeleton: false,
|
|
8
|
+
});
|
|
9
|
+
</script>
|
|
10
|
+
|
|
1
11
|
<template>
|
|
2
12
|
<div class="text-primary-500 text-xl font-medium">
|
|
3
|
-
<
|
|
13
|
+
<AntSkeleton
|
|
14
|
+
:visible="skeleton"
|
|
15
|
+
rounded
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</AntSkeleton>
|
|
4
19
|
</div>
|
|
5
20
|
</template>
|
|
@@ -234,12 +234,14 @@ input[type="checkbox"]::before {
|
|
|
234
234
|
width: 100%;
|
|
235
235
|
height: 100%;
|
|
236
236
|
transform: scale(0);
|
|
237
|
-
transition: 120ms
|
|
237
|
+
transition: 120ms all;
|
|
238
238
|
background: currentColor;
|
|
239
239
|
border-radius: inherit;
|
|
240
|
+
opacity: 0;
|
|
240
241
|
}
|
|
241
242
|
|
|
242
243
|
input[type="checkbox"]:checked::before {
|
|
243
244
|
transform: scale(1);
|
|
245
|
+
opacity: 1;
|
|
244
246
|
}
|
|
245
247
|
</style>
|
|
@@ -33,7 +33,7 @@ const classes = computed(() => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
return {
|
|
36
|
-
'
|
|
36
|
+
'font-regular inline-block transition-color': true,
|
|
37
37
|
'text-2xs': props.size === Size.xs2,
|
|
38
38
|
'text-xs': props.size === Size.xs,
|
|
39
39
|
'text-sm': props.size === Size.sm,
|
|
@@ -53,14 +53,11 @@ onMounted(() => {
|
|
|
53
53
|
<div
|
|
54
54
|
:class="classes"
|
|
55
55
|
>
|
|
56
|
-
<span :class="{'invisible': skeleton}">
|
|
57
|
-
<slot />
|
|
58
|
-
</span>
|
|
59
|
-
|
|
60
56
|
<AntSkeleton
|
|
61
|
-
|
|
62
|
-
absolute
|
|
57
|
+
:visible="skeleton"
|
|
63
58
|
rounded
|
|
64
|
-
|
|
59
|
+
>
|
|
60
|
+
<slot />
|
|
61
|
+
</AntSkeleton>
|
|
65
62
|
</div>
|
|
66
63
|
</template>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {
|
|
3
|
-
computed,
|
|
3
|
+
computed,
|
|
4
|
+
onMounted,
|
|
4
5
|
} from 'vue';
|
|
5
6
|
import {
|
|
6
7
|
Size,
|
|
@@ -48,21 +49,20 @@ onMounted(() => {
|
|
|
48
49
|
<span
|
|
49
50
|
v-if="label"
|
|
50
51
|
:class="fontClasses"
|
|
52
|
+
@click="() => {
|
|
53
|
+
if(!skeleton) {
|
|
54
|
+
$emit('clickContent')
|
|
55
|
+
}
|
|
56
|
+
}"
|
|
51
57
|
>
|
|
52
|
-
<
|
|
53
|
-
:
|
|
54
|
-
|
|
58
|
+
<AntSkeleton
|
|
59
|
+
:visible="skeleton"
|
|
60
|
+
rounded
|
|
55
61
|
>
|
|
56
62
|
<slot name="label">
|
|
57
63
|
{{ label }}
|
|
58
64
|
</slot>
|
|
59
|
-
</
|
|
60
|
-
|
|
61
|
-
<AntSkeleton
|
|
62
|
-
v-if="skeleton"
|
|
63
|
-
absolute
|
|
64
|
-
rounded
|
|
65
|
-
/>
|
|
65
|
+
</AntSkeleton>
|
|
66
66
|
</span>
|
|
67
67
|
|
|
68
68
|
<slot />
|
|
@@ -53,14 +53,11 @@ onMounted(() => {
|
|
|
53
53
|
|
|
54
54
|
<template>
|
|
55
55
|
<div :class="classes">
|
|
56
|
-
<span :class="{'invisible': skeleton}">
|
|
57
|
-
{{ value }}/{{ maxValue }}
|
|
58
|
-
</span>
|
|
59
|
-
|
|
60
56
|
<AntSkeleton
|
|
61
|
-
|
|
62
|
-
absolute
|
|
57
|
+
:visible="skeleton"
|
|
63
58
|
rounded
|
|
64
|
-
|
|
59
|
+
>
|
|
60
|
+
{{ value }}/{{ maxValue }}
|
|
61
|
+
</AntSkeleton>
|
|
65
62
|
</div>
|
|
66
63
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AntInputLabel from '../AntInputLabel.vue';
|
|
2
|
-
import {
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
3
3
|
declare const meta: Meta<typeof AntInputLabel>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntInputLabel>;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
module.exports = exports.WithContent = exports.Docs = void 0;
|
|
7
7
|
var _AntInputLabel = _interopRequireDefault(require("../AntInputLabel.vue"));
|
|
8
|
+
var _test = require("@storybook/test");
|
|
8
9
|
var _Size = require("../../../../enums/Size.enum");
|
|
9
10
|
var _AntBaseInput = _interopRequireDefault(require("../AntBaseInput.vue"));
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -53,7 +54,8 @@ const Docs = exports.Docs = {
|
|
|
53
54
|
template: '<div class="p-4"><AntInputLabel v-bind="args"></AntInputLabel></div>'
|
|
54
55
|
}),
|
|
55
56
|
args: {
|
|
56
|
-
label: "Label"
|
|
57
|
+
label: "Label",
|
|
58
|
+
onClickContent: (0, _test.fn)()
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
const WithContent = exports.WithContent = {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import AntInputLabel from "../AntInputLabel.vue";
|
|
2
|
+
import {
|
|
3
|
+
fn
|
|
4
|
+
} from "@storybook/test";
|
|
2
5
|
import {
|
|
3
6
|
Size
|
|
4
7
|
} from "../../../../enums/Size.enum.mjs";
|
|
@@ -48,7 +51,8 @@ export const Docs = {
|
|
|
48
51
|
template: '<div class="p-4"><AntInputLabel v-bind="args"></AntInputLabel></div>'
|
|
49
52
|
}),
|
|
50
53
|
args: {
|
|
51
|
-
label: "Label"
|
|
54
|
+
label: "Label",
|
|
55
|
+
onClickContent: fn()
|
|
52
56
|
}
|
|
53
57
|
};
|
|
54
58
|
export const WithContent = {
|