@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,7 +1,5 @@
|
|
|
1
1
|
import AntCreateButton from "../AntCreateButton.vue";
|
|
2
|
-
import { Size } from "../../../enums/
|
|
3
|
-
import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
|
|
4
|
-
import { Position } from "../../../enums/index.mjs";
|
|
2
|
+
import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
|
|
5
3
|
const meta = {
|
|
6
4
|
title: "Components/Buttons/Create Button",
|
|
7
5
|
component: AntCreateButton,
|
|
@@ -14,6 +12,10 @@ const meta = {
|
|
|
14
12
|
grouped: {
|
|
15
13
|
control: { type: "select" },
|
|
16
14
|
options: Object.values(_Grouped)
|
|
15
|
+
},
|
|
16
|
+
tooltipPosition: {
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
options: Object.values(Position)
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
};
|
|
@@ -27,7 +29,14 @@ export const Docs = {
|
|
|
27
29
|
template: '<AntCreateButton v-bind="args"/>'
|
|
28
30
|
}),
|
|
29
31
|
args: {
|
|
30
|
-
|
|
32
|
+
tooltipPosition: Position.right
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const IconVariant = {
|
|
36
|
+
render: Docs.render,
|
|
37
|
+
args: {
|
|
38
|
+
...Docs.args,
|
|
39
|
+
iconVariant: true
|
|
31
40
|
}
|
|
32
41
|
};
|
|
33
42
|
export const Disabled = {
|
|
@@ -4,9 +4,9 @@ declare const meta: Meta<typeof AntDeleteButton>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntDeleteButton>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
+
export declare const IconVariant: Story;
|
|
7
8
|
export declare const Disabled: Story;
|
|
8
9
|
export declare const Grouped: Story;
|
|
9
10
|
export declare const Skeleton: Story;
|
|
10
11
|
export declare const Expanded: Story;
|
|
11
|
-
export declare const IconVariant: Story;
|
|
12
12
|
export declare const InvalidPermission: Story;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import AntDeleteButton from "../AntDeleteButton.vue";
|
|
2
|
-
import { Size } from "../../../enums/
|
|
3
|
-
import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
|
|
4
|
-
import { Position } from "../../../enums/index.mjs";
|
|
2
|
+
import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
|
|
5
3
|
const meta = {
|
|
6
4
|
title: "Components/Buttons/Delete Button",
|
|
7
5
|
component: AntDeleteButton,
|
|
@@ -14,6 +12,10 @@ const meta = {
|
|
|
14
12
|
grouped: {
|
|
15
13
|
control: { type: "select" },
|
|
16
14
|
options: Object.values(_Grouped)
|
|
15
|
+
},
|
|
16
|
+
tooltipPosition: {
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
options: Object.values(Position)
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
};
|
|
@@ -27,7 +29,14 @@ export const Docs = {
|
|
|
27
29
|
template: '<AntDeleteButton v-bind="args"/>'
|
|
28
30
|
}),
|
|
29
31
|
args: {
|
|
30
|
-
|
|
32
|
+
tooltipPosition: Position.right
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const IconVariant = {
|
|
36
|
+
render: Docs.render,
|
|
37
|
+
args: {
|
|
38
|
+
...Docs.args,
|
|
39
|
+
iconVariant: true
|
|
31
40
|
}
|
|
32
41
|
};
|
|
33
42
|
export const Disabled = {
|
|
@@ -58,13 +67,6 @@ export const Expanded = {
|
|
|
58
67
|
expanded: true
|
|
59
68
|
}
|
|
60
69
|
};
|
|
61
|
-
export const IconVariant = {
|
|
62
|
-
render: Docs.render,
|
|
63
|
-
args: {
|
|
64
|
-
...Docs.args,
|
|
65
|
-
iconVariant: true
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
70
|
export const InvalidPermission = {
|
|
69
71
|
render: Docs.render,
|
|
70
72
|
args: {
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntDuplicateButton>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntDuplicateButton>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
+
export declare const IconVariant: Story;
|
|
7
8
|
export declare const Disabled: Story;
|
|
8
9
|
export declare const Grouped: Story;
|
|
9
10
|
export declare const Skeleton: Story;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import AntDuplicateButton from "../AntDuplicateButton.vue";
|
|
2
|
-
import { Size } from "../../../enums/
|
|
3
|
-
import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
|
|
4
|
-
import { Position } from "../../../enums/index.mjs";
|
|
2
|
+
import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
|
|
5
3
|
const meta = {
|
|
6
4
|
title: "Components/Buttons/Duplicate Button",
|
|
7
5
|
component: AntDuplicateButton,
|
|
@@ -14,6 +12,10 @@ const meta = {
|
|
|
14
12
|
grouped: {
|
|
15
13
|
control: { type: "select" },
|
|
16
14
|
options: Object.values(_Grouped)
|
|
15
|
+
},
|
|
16
|
+
tooltipPosition: {
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
options: Object.values(Position)
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
};
|
|
@@ -27,7 +29,14 @@ export const Docs = {
|
|
|
27
29
|
template: '<AntDuplicateButton v-bind="args"/>'
|
|
28
30
|
}),
|
|
29
31
|
args: {
|
|
30
|
-
|
|
32
|
+
tooltipPosition: Position.right
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const IconVariant = {
|
|
36
|
+
render: Docs.render,
|
|
37
|
+
args: {
|
|
38
|
+
...Docs.args,
|
|
39
|
+
iconVariant: true
|
|
31
40
|
}
|
|
32
41
|
};
|
|
33
42
|
export const Disabled = {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import AntEditButton from '../AntEditButton.vue';
|
|
2
|
+
import { type Meta, type StoryObj } from '@storybook/vue3';
|
|
3
|
+
declare const meta: Meta<typeof AntEditButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AntEditButton>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const IconVariant: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const Grouped: Story;
|
|
10
|
+
export declare const Skeleton: Story;
|
|
11
|
+
export declare const Expanded: Story;
|
|
12
|
+
export declare const InvalidPermission: Story;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import AntEditButton from "../AntEditButton.vue";
|
|
2
|
+
import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/Buttons/Edit Button",
|
|
5
|
+
component: AntEditButton,
|
|
6
|
+
parameters: { controls: { sort: "requiredFirst" } },
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: { type: "radio" },
|
|
10
|
+
options: Object.values(Size)
|
|
11
|
+
},
|
|
12
|
+
grouped: {
|
|
13
|
+
control: { type: "select" },
|
|
14
|
+
options: Object.values(_Grouped)
|
|
15
|
+
},
|
|
16
|
+
tooltipPosition: {
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
options: Object.values(Position)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
export const Docs = {
|
|
24
|
+
render: (args) => ({
|
|
25
|
+
components: { AntEditButton },
|
|
26
|
+
setup() {
|
|
27
|
+
return { args };
|
|
28
|
+
},
|
|
29
|
+
template: '<AntEditButton v-bind="args"/>'
|
|
30
|
+
}),
|
|
31
|
+
args: {
|
|
32
|
+
tooltipPosition: Position.right
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const IconVariant = {
|
|
36
|
+
render: Docs.render,
|
|
37
|
+
args: {
|
|
38
|
+
...Docs.args,
|
|
39
|
+
iconVariant: true
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export const Disabled = {
|
|
43
|
+
render: Docs.render,
|
|
44
|
+
args: {
|
|
45
|
+
...Docs.args,
|
|
46
|
+
disabled: true
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export const Grouped = {
|
|
50
|
+
render: Docs.render,
|
|
51
|
+
args: {
|
|
52
|
+
...Docs.args,
|
|
53
|
+
grouped: _Grouped.left
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export const Skeleton = {
|
|
57
|
+
render: Docs.render,
|
|
58
|
+
args: {
|
|
59
|
+
...Docs.args,
|
|
60
|
+
skeleton: true
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export const Expanded = {
|
|
64
|
+
render: Docs.render,
|
|
65
|
+
args: {
|
|
66
|
+
...Docs.args,
|
|
67
|
+
expanded: true
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export const InvalidPermission = {
|
|
71
|
+
render: Docs.render,
|
|
72
|
+
args: {
|
|
73
|
+
...Docs.args,
|
|
74
|
+
canEdit: false
|
|
75
|
+
}
|
|
76
|
+
};
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntSaveAndNewButton>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntSaveAndNewButton>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
+
export declare const IconVariant: Story;
|
|
7
8
|
export declare const Disabled: Story;
|
|
8
9
|
export declare const Grouped: Story;
|
|
9
10
|
export declare const Skeleton: Story;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import AntSaveAndNewButton from "../AntSaveAndNewButton.vue";
|
|
2
|
-
import { Size } from "../../../enums/
|
|
3
|
-
import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
|
|
4
|
-
import { Position } from "../../../enums/index.mjs";
|
|
2
|
+
import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
|
|
5
3
|
const meta = {
|
|
6
4
|
title: "Components/Buttons/Save And New Button",
|
|
7
5
|
component: AntSaveAndNewButton,
|
|
@@ -14,6 +12,10 @@ const meta = {
|
|
|
14
12
|
grouped: {
|
|
15
13
|
control: { type: "select" },
|
|
16
14
|
options: Object.values(_Grouped)
|
|
15
|
+
},
|
|
16
|
+
tooltipPosition: {
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
options: Object.values(Position)
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
};
|
|
@@ -27,7 +29,14 @@ export const Docs = {
|
|
|
27
29
|
template: '<AntSaveAndNewButton v-bind="args"/>'
|
|
28
30
|
}),
|
|
29
31
|
args: {
|
|
30
|
-
|
|
32
|
+
tooltipPosition: Position.right
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const IconVariant = {
|
|
36
|
+
render: Docs.render,
|
|
37
|
+
args: {
|
|
38
|
+
...Docs.args,
|
|
39
|
+
iconVariant: true
|
|
31
40
|
}
|
|
32
41
|
};
|
|
33
42
|
export const Disabled = {
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntSaveButton>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntSaveButton>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
+
export declare const IconVariant: Story;
|
|
7
8
|
export declare const Disabled: Story;
|
|
8
9
|
export declare const Grouped: Story;
|
|
9
10
|
export declare const Skeleton: Story;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import AntSaveButton from "../AntSaveButton.vue";
|
|
2
|
-
import { Size } from "../../../enums/
|
|
3
|
-
import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
|
|
4
|
-
import { Position } from "../../../enums/index.mjs";
|
|
2
|
+
import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
|
|
5
3
|
const meta = {
|
|
6
4
|
title: "Components/Buttons/Save Button",
|
|
7
5
|
component: AntSaveButton,
|
|
@@ -14,6 +12,10 @@ const meta = {
|
|
|
14
12
|
grouped: {
|
|
15
13
|
control: { type: "select" },
|
|
16
14
|
options: Object.values(_Grouped)
|
|
15
|
+
},
|
|
16
|
+
tooltipPosition: {
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
options: Object.values(Position)
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
};
|
|
@@ -27,7 +29,14 @@ export const Docs = {
|
|
|
27
29
|
template: '<AntSaveButton v-bind="args"/>'
|
|
28
30
|
}),
|
|
29
31
|
args: {
|
|
30
|
-
|
|
32
|
+
tooltipPosition: Position.right
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const IconVariant = {
|
|
36
|
+
render: Docs.render,
|
|
37
|
+
args: {
|
|
38
|
+
...Docs.args,
|
|
39
|
+
iconVariant: true
|
|
31
40
|
}
|
|
32
41
|
};
|
|
33
42
|
export const Disabled = {
|
|
@@ -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>
|