@antify/ui-module 1.5.0 → 1.6.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/runtime/components/AntAlert.vue +14 -5
- package/dist/runtime/components/AntContent.vue +16 -0
- package/dist/runtime/components/AntPagination.vue +8 -3
- package/dist/runtime/components/AntTooltip.vue +30 -18
- package/dist/runtime/components/__stories/AntAlert.stories.d.ts +1 -0
- package/dist/runtime/components/__stories/AntAlert.stories.mjs +15 -9
- package/dist/runtime/components/__stories/AntContent.stories.d.ts +6 -0
- package/dist/runtime/components/__stories/AntContent.stories.mjs +26 -0
- package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +1 -1
- package/dist/runtime/components/__stories/AntTooltip.stories.mjs +164 -12
- package/dist/runtime/components/buttons/AntActionButton.vue +37 -34
- package/dist/runtime/components/buttons/AntButton.vue +62 -42
- package/dist/runtime/components/buttons/AntCreateButton.vue +18 -6
- package/dist/runtime/components/buttons/AntDeleteButton.vue +11 -10
- package/dist/runtime/components/buttons/AntDuplicateButton.vue +19 -7
- package/dist/runtime/components/buttons/AntEditButton.vue +54 -0
- package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
- package/dist/runtime/components/buttons/AntSaveButton.vue +21 -10
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +1 -1
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +18 -17
- package/dist/runtime/components/buttons/__stories/AntButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +38 -3
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +13 -4
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +1 -1
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +13 -11
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +13 -4
- package/dist/runtime/components/buttons/__stories/AntEditButton.stories.d.ts +12 -0
- package/dist/runtime/components/buttons/__stories/AntEditButton.stories.mjs +76 -0
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +13 -4
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +13 -4
- package/dist/runtime/components/crud/AntCrudTableNav.vue +11 -2
- package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.mjs +1 -1
- package/dist/runtime/components/form/AntFormGroup.vue +22 -7
- package/dist/runtime/components/form/AntNumberInput.vue +6 -2
- package/dist/runtime/components/form/AntSelect.vue +3 -3
- package/dist/runtime/components/form/AntTagInput.vue +7 -7
- package/dist/runtime/components/form/Elements/AntField.vue +24 -21
- package/dist/runtime/components/form/Elements/AntInputDescription.vue +5 -5
- package/dist/runtime/components/form/__stories/AntNumberInput.stories.d.ts +1 -0
- package/dist/runtime/components/form/__stories/AntNumberInput.stories.mjs +7 -0
- package/dist/runtime/components/layouts/AntNavLeftLayout.vue +2 -2
- package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.mjs +1 -1
- package/package.json +11 -11
- package/src/runtime/components/AntAlert.vue +14 -5
- package/src/runtime/components/AntContent.vue +16 -0
- package/src/runtime/components/AntPagination.vue +8 -3
- package/src/runtime/components/AntTooltip.vue +30 -18
- package/src/runtime/components/buttons/AntActionButton.vue +37 -34
- package/src/runtime/components/buttons/AntButton.vue +62 -42
- package/src/runtime/components/buttons/AntCreateButton.vue +18 -6
- package/src/runtime/components/buttons/AntDeleteButton.vue +11 -10
- package/src/runtime/components/buttons/AntDuplicateButton.vue +19 -7
- package/src/runtime/components/buttons/AntEditButton.vue +54 -0
- package/src/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
- package/src/runtime/components/buttons/AntSaveButton.vue +21 -10
- package/src/runtime/components/crud/AntCrudTableNav.vue +11 -2
- package/src/runtime/components/form/AntFormGroup.vue +22 -7
- package/src/runtime/components/form/AntNumberInput.vue +6 -2
- package/src/runtime/components/form/AntSelect.vue +3 -3
- package/src/runtime/components/form/AntTagInput.vue +7 -7
- package/src/runtime/components/form/Elements/AntField.vue +24 -21
- package/src/runtime/components/form/Elements/AntInputDescription.vue +5 -5
- package/src/runtime/components/layouts/AntNavLeftLayout.vue +2 -2
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
|
-
import {Size} from '../../enums/Size.enum';
|
|
4
2
|
import AntActionButton from './AntActionButton.vue';
|
|
5
|
-
import {
|
|
3
|
+
import {Position, Size, Grouped, ColorType} from '../../enums';
|
|
6
4
|
import {faCopy} from '@fortawesome/free-solid-svg-icons';
|
|
7
5
|
|
|
8
6
|
defineEmits(['click', 'blur']);
|
|
9
7
|
withDefaults(defineProps<{
|
|
8
|
+
iconVariant?: boolean;
|
|
10
9
|
size?: Size;
|
|
11
10
|
disabled?: boolean;
|
|
12
11
|
grouped?: Grouped;
|
|
13
12
|
skeleton?: boolean;
|
|
14
13
|
expanded?: boolean;
|
|
15
14
|
canDuplicate?: boolean;
|
|
16
|
-
|
|
15
|
+
tooltipPosition?: Position;
|
|
17
16
|
}>(), {
|
|
17
|
+
iconVariant: false,
|
|
18
18
|
canDuplicate: true
|
|
19
19
|
});
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
23
|
<AntActionButton
|
|
24
|
-
:
|
|
24
|
+
:filled="false"
|
|
25
25
|
:color-type="ColorType.base"
|
|
26
26
|
:size="size"
|
|
27
27
|
:disabled="disabled"
|
|
28
|
+
:icon-left="iconVariant ? faCopy : undefined"
|
|
28
29
|
:grouped="grouped"
|
|
29
30
|
:skeleton="skeleton"
|
|
30
31
|
:expanded="expanded"
|
|
31
32
|
:has-permission="canDuplicate"
|
|
32
|
-
:
|
|
33
|
-
data-e2e="
|
|
33
|
+
:tooltip-position="tooltipPosition"
|
|
34
|
+
data-e2e="duplicate-button"
|
|
34
35
|
@click="$emit('click')"
|
|
35
36
|
@blur="$emit('blur')"
|
|
36
37
|
>
|
|
38
|
+
<template
|
|
39
|
+
v-if="!iconVariant"
|
|
40
|
+
#default
|
|
41
|
+
>
|
|
42
|
+
Duplicate
|
|
43
|
+
</template>
|
|
44
|
+
|
|
37
45
|
<template #invalidPermissionTooltipContent>
|
|
38
46
|
You have no permission to duplicate entries.<br>
|
|
39
47
|
Please contact your administrator.
|
|
40
48
|
</template>
|
|
49
|
+
|
|
50
|
+
<template #tooltipContent>
|
|
51
|
+
Duplicate entry
|
|
52
|
+
</template>
|
|
41
53
|
</AntActionButton>
|
|
42
54
|
</template>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import AntActionButton from './AntActionButton.vue';
|
|
3
|
+
import {Position, Size, Grouped, ColorType} from '../../enums';
|
|
4
|
+
import {faPencil} from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
|
|
6
|
+
defineEmits(['click', 'blur']);
|
|
7
|
+
withDefaults(defineProps<{
|
|
8
|
+
iconVariant?: boolean;
|
|
9
|
+
size?: Size;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
grouped?: Grouped;
|
|
12
|
+
skeleton?: boolean;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
canEdit?: boolean;
|
|
15
|
+
tooltipPosition?: Position;
|
|
16
|
+
}>(), {
|
|
17
|
+
iconVariant: false,
|
|
18
|
+
canEdit: true
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<AntActionButton
|
|
24
|
+
:filled="false"
|
|
25
|
+
:color-type="ColorType.base"
|
|
26
|
+
:size="size"
|
|
27
|
+
:disabled="disabled"
|
|
28
|
+
:icon-left="iconVariant ? faPencil : undefined"
|
|
29
|
+
:grouped="grouped"
|
|
30
|
+
:skeleton="skeleton"
|
|
31
|
+
:expanded="expanded"
|
|
32
|
+
:has-permission="canEdit"
|
|
33
|
+
:tooltip-position="tooltipPosition"
|
|
34
|
+
data-e2e="edit-button"
|
|
35
|
+
@click="$emit('click')"
|
|
36
|
+
@blur="$emit('blur')"
|
|
37
|
+
>
|
|
38
|
+
<template
|
|
39
|
+
v-if="!iconVariant"
|
|
40
|
+
#default
|
|
41
|
+
>
|
|
42
|
+
Edit
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<template #invalidPermissionTooltipContent>
|
|
46
|
+
You have no permission to edit entries.<br>
|
|
47
|
+
Please contact your administrator.
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<template #tooltipContent>
|
|
51
|
+
Edit entry
|
|
52
|
+
</template>
|
|
53
|
+
</AntActionButton>
|
|
54
|
+
</template>
|
|
@@ -1,42 +1,55 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
|
-
import {Size} from '../../enums/Size.enum';
|
|
4
2
|
import AntActionButton from './AntActionButton.vue';
|
|
5
|
-
import {Position} from '../../enums';
|
|
3
|
+
import {Position, Size, Grouped, ColorType} from '../../enums';
|
|
4
|
+
import {faFloppyDisk, faPlus} from '@fortawesome/free-solid-svg-icons';
|
|
6
5
|
|
|
7
6
|
defineEmits(['click', 'blur']);
|
|
8
7
|
withDefaults(defineProps<{
|
|
8
|
+
iconVariant?: boolean;
|
|
9
9
|
size?: Size;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
grouped?: Grouped;
|
|
12
12
|
skeleton?: boolean;
|
|
13
13
|
expanded?: boolean;
|
|
14
14
|
canSave?: boolean;
|
|
15
|
-
|
|
15
|
+
tooltipPosition?: Position;
|
|
16
16
|
}>(), {
|
|
17
|
+
iconVariant: false,
|
|
17
18
|
canSave: true
|
|
18
19
|
});
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
22
|
<template>
|
|
22
23
|
<AntActionButton
|
|
24
|
+
:filled="false"
|
|
25
|
+
:color-type="ColorType.primary"
|
|
23
26
|
:size="size"
|
|
24
27
|
:disabled="disabled"
|
|
28
|
+
:icon-left="iconVariant ? faFloppyDisk : undefined"
|
|
29
|
+
:icon-right="iconVariant ? faPlus : undefined"
|
|
25
30
|
:grouped="grouped"
|
|
26
31
|
:skeleton="skeleton"
|
|
27
32
|
:expanded="expanded"
|
|
28
|
-
:filled="false"
|
|
29
33
|
:has-permission="canSave"
|
|
30
|
-
:
|
|
34
|
+
:tooltip-position="tooltipPosition"
|
|
31
35
|
data-e2e="save-and-new-button"
|
|
32
36
|
@click="$emit('click')"
|
|
33
37
|
@blur="$emit('blur')"
|
|
34
38
|
>
|
|
35
|
-
<template
|
|
39
|
+
<template
|
|
40
|
+
v-if="!iconVariant"
|
|
41
|
+
#default
|
|
42
|
+
>
|
|
43
|
+
Save and new
|
|
44
|
+
</template>
|
|
36
45
|
|
|
37
46
|
<template #invalidPermissionTooltipContent>
|
|
38
|
-
You have no permission to save
|
|
47
|
+
You have no permission to save entries.<br>
|
|
39
48
|
Please contact your administrator.
|
|
40
49
|
</template>
|
|
50
|
+
|
|
51
|
+
<template #tooltipContent>
|
|
52
|
+
Save entry
|
|
53
|
+
</template>
|
|
41
54
|
</AntActionButton>
|
|
42
55
|
</template>
|
|
@@ -1,43 +1,54 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
|
-
import {Size} from '../../enums/Size.enum';
|
|
4
|
-
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
2
|
import AntActionButton from './AntActionButton.vue';
|
|
6
|
-
import {Position} from '../../enums';
|
|
3
|
+
import {Position, Size, Grouped, ColorType} from '../../enums';
|
|
4
|
+
import {faFloppyDisk} from '@fortawesome/free-solid-svg-icons';
|
|
7
5
|
|
|
8
6
|
defineEmits(['click', 'blur']);
|
|
9
7
|
withDefaults(defineProps<{
|
|
8
|
+
iconVariant?: boolean;
|
|
10
9
|
size?: Size;
|
|
11
10
|
disabled?: boolean;
|
|
12
11
|
grouped?: Grouped;
|
|
13
12
|
skeleton?: boolean;
|
|
14
13
|
expanded?: boolean;
|
|
15
14
|
canSave?: boolean;
|
|
16
|
-
|
|
15
|
+
tooltipPosition?: Position;
|
|
17
16
|
}>(), {
|
|
17
|
+
iconVariant: false,
|
|
18
18
|
canSave: true
|
|
19
19
|
});
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
23
|
<AntActionButton
|
|
24
|
+
:filled="true"
|
|
25
|
+
:color-type="ColorType.primary"
|
|
24
26
|
:size="size"
|
|
25
27
|
:disabled="disabled"
|
|
28
|
+
:icon-left="iconVariant ? faFloppyDisk : undefined"
|
|
26
29
|
:grouped="grouped"
|
|
27
30
|
:skeleton="skeleton"
|
|
28
31
|
:expanded="expanded"
|
|
29
|
-
:color-type="ColorType.primary"
|
|
30
|
-
data-e2e="save-button"
|
|
31
32
|
:has-permission="canSave"
|
|
32
|
-
:
|
|
33
|
+
:tooltip-position="tooltipPosition"
|
|
34
|
+
data-e2e="save-button"
|
|
33
35
|
@click="$emit('click')"
|
|
34
36
|
@blur="$emit('blur')"
|
|
35
37
|
>
|
|
36
|
-
<template
|
|
38
|
+
<template
|
|
39
|
+
v-if="!iconVariant"
|
|
40
|
+
#default
|
|
41
|
+
>
|
|
42
|
+
Save
|
|
43
|
+
</template>
|
|
37
44
|
|
|
38
45
|
<template #invalidPermissionTooltipContent>
|
|
39
|
-
You have no permission to save
|
|
46
|
+
You have no permission to save entries.<br>
|
|
40
47
|
Please contact your administrator.
|
|
41
48
|
</template>
|
|
49
|
+
|
|
50
|
+
<template #tooltipContent>
|
|
51
|
+
Save entry
|
|
52
|
+
</template>
|
|
42
53
|
</AntActionButton>
|
|
43
54
|
</template>
|
|
@@ -68,7 +68,16 @@ const itemsPerPage = computed({
|
|
|
68
68
|
})()
|
|
69
69
|
}
|
|
70
70
|
})
|
|
71
|
-
const fromItems = computed(() => (itemsPerPage.value * (page.value - 1)))
|
|
71
|
+
const fromItems = computed(() => (itemsPerPage.value * (page.value - 1)) + 1)
|
|
72
|
+
const toItems = computed(() => {
|
|
73
|
+
const items = itemsPerPage.value * page.value;
|
|
74
|
+
|
|
75
|
+
if (page.value === pages.value && items > props.count) {
|
|
76
|
+
return props.count;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return itemsPerPage.value * page.value;
|
|
80
|
+
})
|
|
72
81
|
const pages = computed(() => Math.ceil(props.count / itemsPerPage.value))
|
|
73
82
|
const _fullWidth = ref(props.fullWidth)
|
|
74
83
|
|
|
@@ -119,7 +128,7 @@ watch(() => props.fullWidth, (val) => {
|
|
|
119
128
|
absolute
|
|
120
129
|
/>
|
|
121
130
|
|
|
122
|
-
<span class="font-medium">{{ fromItems }} - {{
|
|
131
|
+
<span class="font-medium">{{ fromItems }} - {{ toItems }}</span>
|
|
123
132
|
<span>of</span>
|
|
124
133
|
<span
|
|
125
134
|
class="font-medium"
|
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {Direction} from '../../enums/Direction.enum';
|
|
3
|
-
import {computed} from 'vue';
|
|
3
|
+
import {computed, useAttrs} from 'vue';
|
|
4
4
|
|
|
5
|
+
const attrs = useAttrs();
|
|
5
6
|
const props = withDefaults(defineProps<{
|
|
6
7
|
direction?: Direction;
|
|
7
8
|
}>(), {
|
|
8
9
|
direction: Direction.column,
|
|
9
10
|
});
|
|
10
11
|
|
|
11
|
-
const classes = computed(() =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const classes = computed(() => {
|
|
13
|
+
// Let override gap-x-* and gap-y-* classes from outside
|
|
14
|
+
const attrClasses = typeof attrs.class === 'string' ? attrs.class : ''
|
|
15
|
+
const hasGapX = /gap-x-\d/.test(attrClasses);
|
|
16
|
+
const hasGapY = /gap-y-\d/.test(attrClasses);
|
|
17
|
+
|
|
18
|
+
const classes: Record<string, boolean> = {
|
|
19
|
+
'flex-col': props.direction === Direction.column,
|
|
20
|
+
'gap-y-2.5': !hasGapY && props.direction === Direction.column,
|
|
21
|
+
'flex-row': props.direction === Direction.row,
|
|
22
|
+
'gap-x-2.5': !hasGapX && props.direction === Direction.row,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return classes;
|
|
26
|
+
});
|
|
15
27
|
</script>
|
|
16
28
|
|
|
17
29
|
<template>
|
|
18
|
-
<section
|
|
19
|
-
|
|
30
|
+
<section
|
|
31
|
+
class="flex"
|
|
32
|
+
:class="classes"
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
20
35
|
</section>
|
|
21
36
|
</template>
|
|
@@ -27,6 +27,7 @@ const props = withDefaults(defineProps<{
|
|
|
27
27
|
max?: number;
|
|
28
28
|
limiter?: boolean;
|
|
29
29
|
errors?: string[];
|
|
30
|
+
indicators?: boolean;
|
|
30
31
|
}>(), {
|
|
31
32
|
colorType: InputColorType.base,
|
|
32
33
|
disabled: false,
|
|
@@ -34,7 +35,8 @@ const props = withDefaults(defineProps<{
|
|
|
34
35
|
size: Size.md,
|
|
35
36
|
steps: 1,
|
|
36
37
|
limiter: false,
|
|
37
|
-
errors: []
|
|
38
|
+
errors: [],
|
|
39
|
+
indicators: false
|
|
38
40
|
});
|
|
39
41
|
const emit = defineEmits(['update:modelValue', 'validate']);
|
|
40
42
|
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
@@ -127,6 +129,7 @@ function onButtonBlur() {
|
|
|
127
129
|
class="flex relative"
|
|
128
130
|
>
|
|
129
131
|
<AntButton
|
|
132
|
+
v-if="indicators"
|
|
130
133
|
:icon-left="faMinus"
|
|
131
134
|
:grouped="Grouped.left"
|
|
132
135
|
:color-type="buttonColorType"
|
|
@@ -140,7 +143,7 @@ function onButtonBlur() {
|
|
|
140
143
|
<AntBaseInput
|
|
141
144
|
v-model:value.number="_modelValue"
|
|
142
145
|
:type="BaseInputType.number"
|
|
143
|
-
:grouped="Grouped.center"
|
|
146
|
+
:grouped="indicators ? Grouped.center : Grouped.none"
|
|
144
147
|
wrapper-class="flex-grow"
|
|
145
148
|
:color-type="colorType"
|
|
146
149
|
:size="size"
|
|
@@ -156,6 +159,7 @@ function onButtonBlur() {
|
|
|
156
159
|
/>
|
|
157
160
|
|
|
158
161
|
<AntButton
|
|
162
|
+
v-if="indicators"
|
|
159
163
|
:icon-left="faPlus"
|
|
160
164
|
:grouped="Grouped.right"
|
|
161
165
|
:color-type="buttonColorType"
|
|
@@ -45,7 +45,6 @@ const props = withDefaults(
|
|
|
45
45
|
grouped?: Grouped;
|
|
46
46
|
name?: string;
|
|
47
47
|
wrapperClass?: string | Record<string, boolean>;
|
|
48
|
-
showMessageOnError?: boolean;
|
|
49
48
|
expanded?: boolean;
|
|
50
49
|
}>(), {
|
|
51
50
|
colorType: InputColorType.base,
|
|
@@ -54,7 +53,6 @@ const props = withDefaults(
|
|
|
54
53
|
disabled: false,
|
|
55
54
|
skeleton: false,
|
|
56
55
|
nullable: false,
|
|
57
|
-
showMessageOnError: true,
|
|
58
56
|
expanded: true
|
|
59
57
|
}
|
|
60
58
|
);
|
|
@@ -154,6 +152,8 @@ const skeletonGrouped = computed(() => {
|
|
|
154
152
|
const inputRef = ref<HTMLElement | null>(null);
|
|
155
153
|
const dropDownRef = ref<HTMLElement | null>(null);
|
|
156
154
|
const focusedDropDownItem = ref<string | number | null>(null);
|
|
155
|
+
// TODO:: Hotfix to prevent missing required prop warning. Fix it with https://github.com/antify/ui-module/issues/52
|
|
156
|
+
const dropDownFocused = ref(null);
|
|
157
157
|
|
|
158
158
|
onMounted(() => {
|
|
159
159
|
handleEnumValidation(props.size, Size, 'size');
|
|
@@ -203,7 +203,6 @@ function onClickRemoveButton() {
|
|
|
203
203
|
:color-type="colorType"
|
|
204
204
|
:validator="validator"
|
|
205
205
|
:class="wrapperClass"
|
|
206
|
-
:show-message-on-error="showMessageOnError"
|
|
207
206
|
:expanded="expanded"
|
|
208
207
|
label-for="noop"
|
|
209
208
|
data-e2e="select"
|
|
@@ -280,6 +279,7 @@ function onClickRemoveButton() {
|
|
|
280
279
|
ref="dropDownRef"
|
|
281
280
|
v-model="_modelValue"
|
|
282
281
|
v-model:open="isOpen"
|
|
282
|
+
v-model:focused="dropDownFocused"
|
|
283
283
|
:options="options"
|
|
284
284
|
:input-ref="inputRef"
|
|
285
285
|
:size="size"
|
|
@@ -31,7 +31,6 @@ const props = withDefaults(
|
|
|
31
31
|
skeleton?: boolean;
|
|
32
32
|
validator?: FieldValidator;
|
|
33
33
|
name?: string;
|
|
34
|
-
showMessageOnError?: boolean;
|
|
35
34
|
expanded?: boolean;
|
|
36
35
|
icon?: IconDefinition;
|
|
37
36
|
grouped?: Grouped;
|
|
@@ -53,7 +52,6 @@ const props = withDefaults(
|
|
|
53
52
|
allowDuplicates: false,
|
|
54
53
|
openOnFocus: true,
|
|
55
54
|
autoCloseAfterSelection: false,
|
|
56
|
-
showMessageOnError: true,
|
|
57
55
|
|
|
58
56
|
placeholder: 'Add new tag'
|
|
59
57
|
}
|
|
@@ -233,12 +231,11 @@ function filterDropDown() {
|
|
|
233
231
|
:description="description"
|
|
234
232
|
:color-type="colorType"
|
|
235
233
|
:validator="validator"
|
|
236
|
-
:show-message-on-error="showMessageOnError"
|
|
237
234
|
:expanded="expanded"
|
|
238
235
|
>
|
|
239
236
|
<div
|
|
240
|
-
class="relative w-full"
|
|
241
237
|
v-on-click-outside="onClickOutside"
|
|
238
|
+
class="relative w-full"
|
|
242
239
|
>
|
|
243
240
|
<AntSkeleton
|
|
244
241
|
v-if="skeleton"
|
|
@@ -264,12 +261,15 @@ function filterDropDown() {
|
|
|
264
261
|
|
|
265
262
|
<!-- Input -->
|
|
266
263
|
<div class="flex items-center gap-1 w-32 shrink grow">
|
|
267
|
-
<AntIcon
|
|
264
|
+
<AntIcon
|
|
265
|
+
:icon="icon"
|
|
266
|
+
:size="size === Size.sm ? IconSize.xs : IconSize.sm"
|
|
267
|
+
/>
|
|
268
268
|
|
|
269
269
|
<input
|
|
270
|
+
ref="inputRef"
|
|
270
271
|
v-model="tagInput"
|
|
271
272
|
type="text"
|
|
272
|
-
ref="inputRef"
|
|
273
273
|
:placeholder="placeholder"
|
|
274
274
|
:class="inputClasses"
|
|
275
275
|
:disabled="disabled"
|
|
@@ -283,9 +283,9 @@ function filterDropDown() {
|
|
|
283
283
|
|
|
284
284
|
<AntDropDown
|
|
285
285
|
v-if="filteredOptions && !disabled"
|
|
286
|
+
ref="dropDownRef"
|
|
286
287
|
v-model:focused="focusedDropDownItem"
|
|
287
288
|
v-model:open="dropDownOpen"
|
|
288
|
-
ref="dropDownRef"
|
|
289
289
|
:model-value="null"
|
|
290
290
|
:auto-select-first-on-open="!allowCreate"
|
|
291
291
|
:options="filteredOptions"
|
|
@@ -17,14 +17,12 @@ const props = withDefaults(defineProps<{
|
|
|
17
17
|
limiterValue?: number;
|
|
18
18
|
limiterMaxValue?: number;
|
|
19
19
|
labelFor?: string;
|
|
20
|
-
showMessageOnError?: boolean;
|
|
21
20
|
errors?: string[];
|
|
22
21
|
expanded?: boolean;
|
|
23
22
|
}>(), {
|
|
24
23
|
colorType: InputColorType.base,
|
|
25
24
|
skeleton: false,
|
|
26
25
|
size: Size.md,
|
|
27
|
-
showMessageOnError: true,
|
|
28
26
|
errors: () => [],
|
|
29
27
|
expanded: true
|
|
30
28
|
});
|
|
@@ -35,34 +33,35 @@ onMounted(() => {
|
|
|
35
33
|
});
|
|
36
34
|
|
|
37
35
|
const _errors = computed(() => props.skeleton ? [] : props.errors);
|
|
38
|
-
const _colorType = computed(() => _errors.value.length > 0 ? InputColorType.danger : props.colorType)
|
|
36
|
+
const _colorType = computed(() => _errors.value.length > 0 ? InputColorType.danger : props.colorType);
|
|
39
37
|
</script>
|
|
40
38
|
|
|
41
39
|
<template>
|
|
42
40
|
<div
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
class="flex flex-col items-start gap-1.5"
|
|
42
|
+
:class="{'w-full': expanded}"
|
|
45
43
|
>
|
|
46
44
|
<AntInputLabel
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
:label="label"
|
|
46
|
+
:size="size"
|
|
47
|
+
:skeleton="skeleton"
|
|
48
|
+
:for="labelFor"
|
|
49
|
+
@click-content="$emit('clickLabel')"
|
|
52
50
|
>
|
|
53
51
|
<div class="w-full">
|
|
54
|
-
<slot/>
|
|
52
|
+
<slot />
|
|
55
53
|
</div>
|
|
56
54
|
</AntInputLabel>
|
|
57
55
|
|
|
58
56
|
<div
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
v-if="description || _errors.length > 0 || (limiterMaxValue !== undefined && limiterValue !== undefined)"
|
|
58
|
+
class="flex justify-between w-full"
|
|
61
59
|
>
|
|
62
60
|
<AntInputDescription
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
v-if="description || _errors.length > 0"
|
|
62
|
+
:size="size"
|
|
63
|
+
:skeleton="skeleton"
|
|
64
|
+
:color-type="_colorType"
|
|
66
65
|
>
|
|
67
66
|
<slot name="description">
|
|
68
67
|
<template v-if="_errors.length === 1">
|
|
@@ -87,16 +86,20 @@ const _colorType = computed(() => _errors.value.length > 0 ? InputColorType.dang
|
|
|
87
86
|
</slot>
|
|
88
87
|
</AntInputDescription>
|
|
89
88
|
|
|
90
|
-
<
|
|
91
|
-
|
|
89
|
+
<div
|
|
90
|
+
v-if="limiterMaxValue !== undefined && limiterValue !== undefined"
|
|
91
|
+
class="flex flex-grow justify-end"
|
|
92
|
+
>
|
|
93
|
+
<AntInputLimiter
|
|
92
94
|
:value="limiterValue"
|
|
93
95
|
:max-value="limiterMaxValue"
|
|
94
96
|
:color-type="_colorType"
|
|
95
97
|
:size="size"
|
|
96
98
|
:skeleton="skeleton"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
>
|
|
100
|
+
{{ limiterValue }}/{{ limiterMaxValue }}
|
|
101
|
+
</AntInputLimiter>
|
|
102
|
+
</div>
|
|
100
103
|
</div>
|
|
101
104
|
</div>
|
|
102
105
|
</template>
|
|
@@ -40,16 +40,16 @@ onMounted(() => {
|
|
|
40
40
|
|
|
41
41
|
<template>
|
|
42
42
|
<div
|
|
43
|
-
|
|
43
|
+
:class="classes"
|
|
44
44
|
>
|
|
45
45
|
<span :class="{'invisible': skeleton}">
|
|
46
|
-
<slot/>
|
|
46
|
+
<slot />
|
|
47
47
|
</span>
|
|
48
48
|
|
|
49
49
|
<AntSkeleton
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
v-if="skeleton"
|
|
51
|
+
absolute
|
|
52
|
+
rounded
|
|
53
53
|
/>
|
|
54
54
|
</div>
|
|
55
55
|
</template>
|
|
@@ -13,7 +13,7 @@ const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
|
-
<div class="flex gap-px bg-neutral-300 h-screen overflow-hidden">
|
|
16
|
+
<div class="flex gap-px bg-neutral-300 h-screen min-w-full overflow-y-hidden">
|
|
17
17
|
<div class="flex flex-col gap-px bg-neutral-300 w-52 shrink-0">
|
|
18
18
|
<component
|
|
19
19
|
:is="logoRoute ? 'RouterLink' : 'div'"
|
|
@@ -29,7 +29,7 @@ const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
|
|
|
29
29
|
/>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
|
-
<div class="flex-grow">
|
|
32
|
+
<div class="w-px flex-grow">
|
|
33
33
|
<slot />
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|