@antify/ui-module 1.2.1 → 1.3.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/buttons/AntActionButton.vue +41 -0
- package/dist/runtime/components/buttons/AntCreateButton.vue +3 -6
- package/dist/runtime/components/buttons/AntDeleteButton.vue +3 -4
- package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +3 -6
- package/dist/runtime/components/buttons/AntSaveButton.vue +3 -3
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +10 -0
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +57 -0
- package/package.json +1 -1
- package/src/runtime/components/buttons/AntActionButton.vue +41 -0
- package/src/runtime/components/buttons/AntCreateButton.vue +3 -6
- package/src/runtime/components/buttons/AntDeleteButton.vue +3 -4
- package/src/runtime/components/buttons/AntSaveAndNewButton.vue +3 -6
- package/src/runtime/components/buttons/AntSaveButton.vue +3 -3
package/dist/module.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
/**
|
|
3
|
+
* This button is used for everything what is the primary
|
|
4
|
+
* action like save, confirm, create, etc.
|
|
5
|
+
*/
|
|
6
|
+
import {Grouped} from '../../enums/Grouped.enum';
|
|
7
|
+
import {Size} from '../../enums/Size.enum';
|
|
8
|
+
import {ColorType} from '../../enums/ColorType.enum';
|
|
9
|
+
import AntButton from './AntButton.vue';
|
|
10
|
+
|
|
11
|
+
defineEmits(['click', 'blur']);
|
|
12
|
+
withDefaults(
|
|
13
|
+
defineProps<{
|
|
14
|
+
size?: Size;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
grouped?: Grouped;
|
|
17
|
+
colorType?: ColorType;
|
|
18
|
+
skeleton?: boolean;
|
|
19
|
+
expanded?: boolean;
|
|
20
|
+
}>(), {
|
|
21
|
+
colorType: ColorType.primary,
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<AntButton
|
|
28
|
+
:size="size"
|
|
29
|
+
:disabled="disabled"
|
|
30
|
+
:grouped="grouped"
|
|
31
|
+
:skeleton="skeleton"
|
|
32
|
+
:expanded="expanded"
|
|
33
|
+
:color-type="colorType"
|
|
34
|
+
filled
|
|
35
|
+
data-e2e="action-button"
|
|
36
|
+
@click="$emit('click')"
|
|
37
|
+
@blur="$emit('blur')"
|
|
38
|
+
>
|
|
39
|
+
<slot />
|
|
40
|
+
</AntButton>
|
|
41
|
+
</template>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
|
-
import
|
|
5
|
-
import AntButton from './AntButton.vue';
|
|
4
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
5
|
|
|
7
6
|
defineEmits(['click', 'blur']);
|
|
8
7
|
defineProps<{
|
|
@@ -15,18 +14,16 @@ defineProps<{
|
|
|
15
14
|
</script>
|
|
16
15
|
|
|
17
16
|
<template>
|
|
18
|
-
<
|
|
17
|
+
<AntActionButton
|
|
19
18
|
:size="size"
|
|
20
19
|
:disabled="disabled"
|
|
21
20
|
:grouped="grouped"
|
|
22
21
|
:skeleton="skeleton"
|
|
23
22
|
:expanded="expanded"
|
|
24
|
-
:color-type="ColorType.primary"
|
|
25
|
-
filled
|
|
26
23
|
data-e2e="create-button"
|
|
27
24
|
@click="$emit('click')"
|
|
28
25
|
@blur="$emit('blur')"
|
|
29
26
|
>
|
|
30
27
|
Create
|
|
31
|
-
</
|
|
28
|
+
</AntActionButton>
|
|
32
29
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
4
|
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
|
-
import
|
|
5
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
6
|
|
|
7
7
|
defineEmits(['click', 'blur']);
|
|
8
8
|
defineProps<{
|
|
@@ -15,18 +15,17 @@ defineProps<{
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
|
-
<
|
|
18
|
+
<AntActionButton
|
|
19
19
|
:size="size"
|
|
20
20
|
:disabled="disabled"
|
|
21
21
|
:grouped="grouped"
|
|
22
22
|
:skeleton="skeleton"
|
|
23
23
|
:expanded="expanded"
|
|
24
24
|
:color-type="ColorType.danger"
|
|
25
|
-
filled
|
|
26
25
|
data-e2e="delete-button"
|
|
27
26
|
@click="$emit('click')"
|
|
28
27
|
@blur="$emit('blur')"
|
|
29
28
|
>
|
|
30
29
|
Delete
|
|
31
|
-
</
|
|
30
|
+
</AntActionButton>
|
|
32
31
|
</template>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
|
-
import
|
|
5
|
-
import AntButton from './AntButton.vue';
|
|
4
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
5
|
|
|
7
6
|
defineEmits(['click', 'blur']);
|
|
8
7
|
defineProps<{
|
|
@@ -15,18 +14,16 @@ defineProps<{
|
|
|
15
14
|
</script>
|
|
16
15
|
|
|
17
16
|
<template>
|
|
18
|
-
<
|
|
17
|
+
<AntActionButton
|
|
19
18
|
:size="size"
|
|
20
19
|
:disabled="disabled"
|
|
21
20
|
:grouped="grouped"
|
|
22
21
|
:skeleton="skeleton"
|
|
23
22
|
:expanded="expanded"
|
|
24
|
-
:color-type="ColorType.primary"
|
|
25
|
-
filled
|
|
26
23
|
data-e2e="save-and-new-button"
|
|
27
24
|
@click="$emit('click')"
|
|
28
25
|
@blur="$emit('blur')"
|
|
29
26
|
>
|
|
30
27
|
Save and new
|
|
31
|
-
</
|
|
28
|
+
</AntActionButton>
|
|
32
29
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
4
|
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
|
-
import
|
|
5
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
6
|
|
|
7
7
|
defineEmits(['click', 'blur']);
|
|
8
8
|
defineProps<{
|
|
@@ -15,7 +15,7 @@ defineProps<{
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
|
-
<
|
|
18
|
+
<AntActionButton
|
|
19
19
|
:size="size"
|
|
20
20
|
:disabled="disabled"
|
|
21
21
|
:grouped="grouped"
|
|
@@ -27,5 +27,5 @@ defineProps<{
|
|
|
27
27
|
@blur="$emit('blur')"
|
|
28
28
|
>
|
|
29
29
|
Save
|
|
30
|
-
</
|
|
30
|
+
</AntActionButton>
|
|
31
31
|
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import AntActionButton from '../AntActionButton.vue';
|
|
2
|
+
import { type Meta, type StoryObj } from '@storybook/vue3';
|
|
3
|
+
declare const meta: Meta<typeof AntActionButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AntActionButton>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const Disabled: Story;
|
|
8
|
+
export declare const Grouped: Story;
|
|
9
|
+
export declare const Skeleton: Story;
|
|
10
|
+
export declare const Expanded: Story;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import AntActionButton from "../AntActionButton.vue";
|
|
2
|
+
import { Size } from "../../../enums/Size.enum.mjs";
|
|
3
|
+
import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/Buttons/Action Button",
|
|
6
|
+
component: AntActionButton,
|
|
7
|
+
parameters: { controls: { sort: "requiredFirst" } },
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: {
|
|
10
|
+
control: { type: "radio" },
|
|
11
|
+
options: Object.values(Size)
|
|
12
|
+
},
|
|
13
|
+
grouped: {
|
|
14
|
+
control: { type: "select" },
|
|
15
|
+
options: Object.values(_Grouped)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
export const Docs = {
|
|
21
|
+
render: (args) => ({
|
|
22
|
+
components: { AntActionButton },
|
|
23
|
+
setup() {
|
|
24
|
+
return { args };
|
|
25
|
+
},
|
|
26
|
+
template: '<AntActionButton v-bind="args">Action Button</AntActionButton>'
|
|
27
|
+
}),
|
|
28
|
+
args: {}
|
|
29
|
+
};
|
|
30
|
+
export const Disabled = {
|
|
31
|
+
render: Docs.render,
|
|
32
|
+
args: {
|
|
33
|
+
...Docs.args,
|
|
34
|
+
disabled: true
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export const Grouped = {
|
|
38
|
+
render: Docs.render,
|
|
39
|
+
args: {
|
|
40
|
+
...Docs.args,
|
|
41
|
+
grouped: _Grouped.left
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
export const Skeleton = {
|
|
45
|
+
render: Docs.render,
|
|
46
|
+
args: {
|
|
47
|
+
...Docs.args,
|
|
48
|
+
skeleton: true
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export const Expanded = {
|
|
52
|
+
render: Docs.render,
|
|
53
|
+
args: {
|
|
54
|
+
...Docs.args,
|
|
55
|
+
expanded: true
|
|
56
|
+
}
|
|
57
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
/**
|
|
3
|
+
* This button is used for everything what is the primary
|
|
4
|
+
* action like save, confirm, create, etc.
|
|
5
|
+
*/
|
|
6
|
+
import {Grouped} from '../../enums/Grouped.enum';
|
|
7
|
+
import {Size} from '../../enums/Size.enum';
|
|
8
|
+
import {ColorType} from '../../enums/ColorType.enum';
|
|
9
|
+
import AntButton from './AntButton.vue';
|
|
10
|
+
|
|
11
|
+
defineEmits(['click', 'blur']);
|
|
12
|
+
withDefaults(
|
|
13
|
+
defineProps<{
|
|
14
|
+
size?: Size;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
grouped?: Grouped;
|
|
17
|
+
colorType?: ColorType;
|
|
18
|
+
skeleton?: boolean;
|
|
19
|
+
expanded?: boolean;
|
|
20
|
+
}>(), {
|
|
21
|
+
colorType: ColorType.primary,
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<AntButton
|
|
28
|
+
:size="size"
|
|
29
|
+
:disabled="disabled"
|
|
30
|
+
:grouped="grouped"
|
|
31
|
+
:skeleton="skeleton"
|
|
32
|
+
:expanded="expanded"
|
|
33
|
+
:color-type="colorType"
|
|
34
|
+
filled
|
|
35
|
+
data-e2e="action-button"
|
|
36
|
+
@click="$emit('click')"
|
|
37
|
+
@blur="$emit('blur')"
|
|
38
|
+
>
|
|
39
|
+
<slot />
|
|
40
|
+
</AntButton>
|
|
41
|
+
</template>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
|
-
import
|
|
5
|
-
import AntButton from './AntButton.vue';
|
|
4
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
5
|
|
|
7
6
|
defineEmits(['click', 'blur']);
|
|
8
7
|
defineProps<{
|
|
@@ -15,18 +14,16 @@ defineProps<{
|
|
|
15
14
|
</script>
|
|
16
15
|
|
|
17
16
|
<template>
|
|
18
|
-
<
|
|
17
|
+
<AntActionButton
|
|
19
18
|
:size="size"
|
|
20
19
|
:disabled="disabled"
|
|
21
20
|
:grouped="grouped"
|
|
22
21
|
:skeleton="skeleton"
|
|
23
22
|
:expanded="expanded"
|
|
24
|
-
:color-type="ColorType.primary"
|
|
25
|
-
filled
|
|
26
23
|
data-e2e="create-button"
|
|
27
24
|
@click="$emit('click')"
|
|
28
25
|
@blur="$emit('blur')"
|
|
29
26
|
>
|
|
30
27
|
Create
|
|
31
|
-
</
|
|
28
|
+
</AntActionButton>
|
|
32
29
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
4
|
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
|
-
import
|
|
5
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
6
|
|
|
7
7
|
defineEmits(['click', 'blur']);
|
|
8
8
|
defineProps<{
|
|
@@ -15,18 +15,17 @@ defineProps<{
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
|
-
<
|
|
18
|
+
<AntActionButton
|
|
19
19
|
:size="size"
|
|
20
20
|
:disabled="disabled"
|
|
21
21
|
:grouped="grouped"
|
|
22
22
|
:skeleton="skeleton"
|
|
23
23
|
:expanded="expanded"
|
|
24
24
|
:color-type="ColorType.danger"
|
|
25
|
-
filled
|
|
26
25
|
data-e2e="delete-button"
|
|
27
26
|
@click="$emit('click')"
|
|
28
27
|
@blur="$emit('blur')"
|
|
29
28
|
>
|
|
30
29
|
Delete
|
|
31
|
-
</
|
|
30
|
+
</AntActionButton>
|
|
32
31
|
</template>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
|
-
import
|
|
5
|
-
import AntButton from './AntButton.vue';
|
|
4
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
5
|
|
|
7
6
|
defineEmits(['click', 'blur']);
|
|
8
7
|
defineProps<{
|
|
@@ -15,18 +14,16 @@ defineProps<{
|
|
|
15
14
|
</script>
|
|
16
15
|
|
|
17
16
|
<template>
|
|
18
|
-
<
|
|
17
|
+
<AntActionButton
|
|
19
18
|
:size="size"
|
|
20
19
|
:disabled="disabled"
|
|
21
20
|
:grouped="grouped"
|
|
22
21
|
:skeleton="skeleton"
|
|
23
22
|
:expanded="expanded"
|
|
24
|
-
:color-type="ColorType.primary"
|
|
25
|
-
filled
|
|
26
23
|
data-e2e="save-and-new-button"
|
|
27
24
|
@click="$emit('click')"
|
|
28
25
|
@blur="$emit('blur')"
|
|
29
26
|
>
|
|
30
27
|
Save and new
|
|
31
|
-
</
|
|
28
|
+
</AntActionButton>
|
|
32
29
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
3
|
import {Size} from '../../enums/Size.enum';
|
|
4
4
|
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
|
-
import
|
|
5
|
+
import AntActionButton from './AntActionButton.vue';
|
|
6
6
|
|
|
7
7
|
defineEmits(['click', 'blur']);
|
|
8
8
|
defineProps<{
|
|
@@ -15,7 +15,7 @@ defineProps<{
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
|
-
<
|
|
18
|
+
<AntActionButton
|
|
19
19
|
:size="size"
|
|
20
20
|
:disabled="disabled"
|
|
21
21
|
:grouped="grouped"
|
|
@@ -27,5 +27,5 @@ defineProps<{
|
|
|
27
27
|
@blur="$emit('blur')"
|
|
28
28
|
>
|
|
29
29
|
Save
|
|
30
|
-
</
|
|
30
|
+
</AntActionButton>
|
|
31
31
|
</template>
|