@antify/ui-module 1.5.0 → 1.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/module.json +1 -1
- package/dist/runtime/components/AntTooltip.vue +30 -18
- 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/form/AntFormGroup.vue +22 -7
- package/package.json +11 -11
- 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/form/AntFormGroup.vue +22 -7
|
@@ -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 = {
|
|
@@ -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>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antify/ui-module",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"@faker-js/faker": "^8.3.1",
|
|
44
44
|
"@nuxt/eslint-config": "latest",
|
|
45
45
|
"@nuxt/module-builder": "latest",
|
|
46
|
-
"@storybook/addon-docs": "^8.0.0
|
|
47
|
-
"@storybook/addon-essentials": "^8.0.0
|
|
48
|
-
"@storybook/addon-interactions": "^8.0.0
|
|
49
|
-
"@storybook/addon-links": "^8.0.0
|
|
50
|
-
"@storybook/addon-mdx-gfm": "^8.0.0
|
|
51
|
-
"@storybook/blocks": "^8.0.0
|
|
52
|
-
"@storybook/test": "^8.0.0
|
|
53
|
-
"@storybook/vue3": "^8.0.0
|
|
54
|
-
"@storybook/vue3-vite": "^8.0.0
|
|
46
|
+
"@storybook/addon-docs": "^8.0.0",
|
|
47
|
+
"@storybook/addon-essentials": "^8.0.0",
|
|
48
|
+
"@storybook/addon-interactions": "^8.0.0",
|
|
49
|
+
"@storybook/addon-links": "^8.0.0",
|
|
50
|
+
"@storybook/addon-mdx-gfm": "^8.0.0",
|
|
51
|
+
"@storybook/blocks": "^8.0.0",
|
|
52
|
+
"@storybook/test": "^8.0.0",
|
|
53
|
+
"@storybook/vue3": "^8.0.0",
|
|
54
|
+
"@storybook/vue3-vite": "^8.0.0",
|
|
55
55
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
56
56
|
"autoprefixer": "^10.4.16",
|
|
57
57
|
"chromatic": "^11.0.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"nuxt": "^3.9.3",
|
|
61
61
|
"ofetch": "^1.3.3",
|
|
62
62
|
"standard-version": "latest",
|
|
63
|
-
"storybook": "^8.0.0
|
|
63
|
+
"storybook": "^8.0.0",
|
|
64
64
|
"typescript": "^5.3.3",
|
|
65
65
|
"unbuild": "^2.0.0",
|
|
66
66
|
"vite": "^5.1.4",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted, ref} from 'vue';
|
|
2
|
+
import {computed, onMounted, ref, getCurrentInstance} from 'vue';
|
|
3
3
|
import {handleEnumValidation} from '../handler';
|
|
4
4
|
import {InputColorType, Position} from '../enums';
|
|
5
5
|
import {classesToObjectSyntax} from '../utils';
|
|
@@ -10,11 +10,13 @@ const props = withDefaults(defineProps<{
|
|
|
10
10
|
tooltipClasses?: string | Record<string, boolean>
|
|
11
11
|
colorType?: InputColorType
|
|
12
12
|
expanded?: boolean
|
|
13
|
+
delay?: number
|
|
13
14
|
}>(), {
|
|
14
15
|
position: Position.left,
|
|
15
16
|
tooltipClasses: '',
|
|
16
17
|
colorType: InputColorType.base,
|
|
17
|
-
expanded: false
|
|
18
|
+
expanded: false,
|
|
19
|
+
delay: 800
|
|
18
20
|
});
|
|
19
21
|
const visible = ref(false);
|
|
20
22
|
const _tooltipClasses = computed(() => ({
|
|
@@ -73,43 +75,53 @@ const arrowSvgPathClasses = computed(() => {
|
|
|
73
75
|
|
|
74
76
|
return {[variants[props.colorType]]: true};
|
|
75
77
|
});
|
|
78
|
+
const timeout = ref<number | undefined>();
|
|
79
|
+
const clickLock = ref(false);
|
|
80
|
+
const uuid = ref(getCurrentInstance()?.uid)
|
|
76
81
|
|
|
77
82
|
onMounted(() => {
|
|
78
83
|
handleEnumValidation(props.position, Position, 'Position')
|
|
79
84
|
handleEnumValidation(props.colorType, InputColorType, 'colorType')
|
|
80
85
|
});
|
|
81
86
|
|
|
82
|
-
/**
|
|
83
|
-
* To prevent a fliggering ux, add a delay on hover and leaving the hover target,
|
|
84
|
-
* before showing the tooltip content.
|
|
85
|
-
*/
|
|
86
|
-
const delayVisible = ref(visible.value);
|
|
87
|
-
|
|
88
87
|
function onMouseOver() {
|
|
89
|
-
|
|
88
|
+
if (visible.value || clickLock.value) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
90
91
|
|
|
91
|
-
setTimeout(() =>
|
|
92
|
-
if (delayVisible.value) {
|
|
93
|
-
visible.value = true
|
|
94
|
-
}
|
|
95
|
-
}, 300)
|
|
92
|
+
timeout.value = setTimeout(() => visible.value = true, props.delay) as unknown as number
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
function onMouseLeave() {
|
|
99
|
-
|
|
96
|
+
clearTimeout(timeout.value)
|
|
97
|
+
|
|
100
98
|
visible.value = false
|
|
99
|
+
clickLock.value = false
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function onClick() {
|
|
103
|
+
clearTimeout(timeout.value)
|
|
104
|
+
|
|
105
|
+
visible.value = false
|
|
106
|
+
clickLock.value = true
|
|
101
107
|
}
|
|
102
108
|
</script>
|
|
103
109
|
|
|
104
110
|
<template>
|
|
105
111
|
<div
|
|
112
|
+
:key="uuid"
|
|
106
113
|
class="relative justify-center items-center"
|
|
107
114
|
:class="{'flex w-full': props.expanded, 'inline-flex': !props.expanded}"
|
|
108
115
|
data-e2e="tooltip"
|
|
109
|
-
@mouseover="onMouseOver"
|
|
110
|
-
@mouseleave="onMouseLeave"
|
|
116
|
+
@mouseover="() => onMouseOver()"
|
|
117
|
+
@mouseleave="() => onMouseLeave()"
|
|
111
118
|
>
|
|
112
|
-
<
|
|
119
|
+
<div
|
|
120
|
+
class="w-full"
|
|
121
|
+
@click="() => onClick()"
|
|
122
|
+
>
|
|
123
|
+
<slot />
|
|
124
|
+
</div>
|
|
113
125
|
|
|
114
126
|
<div
|
|
115
127
|
v-if="visible && hasSlotContent($slots.content)"
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
* This button is used for everything what is the primary
|
|
4
4
|
* action like save, confirm, create, etc.
|
|
5
5
|
*/
|
|
6
|
-
import {Grouped} from '../../enums
|
|
7
|
-
import {Size} from '../../enums/Size.enum';
|
|
8
|
-
import {ColorType, InputColorType} from '../../enums/ColorType.enum';
|
|
9
|
-
import {Position} from '../../enums/Position.enum';
|
|
6
|
+
import {Position, ColorType, InputColorType, Size, Grouped} from '../../enums';
|
|
10
7
|
import AntButton from './AntButton.vue';
|
|
11
|
-
import AntTooltip from '../AntTooltip.vue';
|
|
12
8
|
import type {IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
9
|
+
import {computed, useSlots} from 'vue';
|
|
10
|
+
import {hasSlotContent} from '../../utils';
|
|
13
11
|
|
|
14
12
|
defineEmits(['click', 'blur']);
|
|
15
|
-
withDefaults(
|
|
13
|
+
const props = withDefaults(
|
|
16
14
|
defineProps<{
|
|
17
15
|
iconLeft?: IconDefinition;
|
|
18
16
|
iconRight?: IconDefinition;
|
|
@@ -24,45 +22,50 @@ withDefaults(
|
|
|
24
22
|
expanded?: boolean;
|
|
25
23
|
filled?: boolean;
|
|
26
24
|
hasPermission?: boolean;
|
|
27
|
-
|
|
25
|
+
tooltipPosition?: Position;
|
|
26
|
+
tooltipColorType?: InputColorType;
|
|
27
|
+
tooltipDelay?: number;
|
|
28
28
|
}>(), {
|
|
29
29
|
colorType: ColorType.primary,
|
|
30
30
|
hasPermission: true,
|
|
31
31
|
filled: true
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
|
+
const slots = useSlots();
|
|
35
|
+
const hasTooltip = computed(() => !props.skeleton && !props.disabled && props.hasPermission && hasSlotContent(slots['tooltipContent']));
|
|
36
|
+
const hasPermissionTooltip = computed(() => !props.skeleton && !props.disabled && !props.hasPermission && hasSlotContent(slots['invalidPermissionTooltipContent']));
|
|
34
37
|
</script>
|
|
35
38
|
|
|
36
39
|
<template>
|
|
37
|
-
<
|
|
40
|
+
<AntButton
|
|
41
|
+
:icon-left="iconLeft"
|
|
42
|
+
:icon-right="iconRight"
|
|
43
|
+
:size="size"
|
|
44
|
+
:disabled="disabled || !hasPermission"
|
|
45
|
+
:grouped="grouped"
|
|
46
|
+
:skeleton="skeleton"
|
|
38
47
|
:expanded="expanded"
|
|
39
|
-
:
|
|
40
|
-
:
|
|
48
|
+
:color-type="colorType"
|
|
49
|
+
:filled="filled"
|
|
50
|
+
:tooltip-position="tooltipPosition"
|
|
51
|
+
:tooltip-color-type="hasPermissionTooltip ? InputColorType.info : tooltipColorType"
|
|
52
|
+
:tooltip-delay="hasPermissionTooltip ? 300 : tooltipDelay"
|
|
53
|
+
data-e2e="action-button"
|
|
54
|
+
@click="$emit('click')"
|
|
55
|
+
@blur="$emit('blur')"
|
|
41
56
|
>
|
|
42
|
-
<slot
|
|
43
|
-
<AntButton
|
|
44
|
-
:icon-left="iconLeft"
|
|
45
|
-
:icon-right="iconRight"
|
|
46
|
-
:size="size"
|
|
47
|
-
:disabled="disabled || !hasPermission"
|
|
48
|
-
:grouped="grouped"
|
|
49
|
-
:skeleton="skeleton"
|
|
50
|
-
:expanded="expanded"
|
|
51
|
-
:color-type="colorType"
|
|
52
|
-
:filled="filled"
|
|
53
|
-
data-e2e="action-button"
|
|
54
|
-
@click="$emit('click')"
|
|
55
|
-
@blur="$emit('blur')"
|
|
56
|
-
>
|
|
57
|
-
<slot />
|
|
58
|
-
</AntButton>
|
|
59
|
-
</slot>
|
|
57
|
+
<slot />
|
|
60
58
|
|
|
61
|
-
<template
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
<template #tooltip-content>
|
|
60
|
+
<slot
|
|
61
|
+
v-if="hasTooltip"
|
|
62
|
+
name="tooltipContent"
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<slot
|
|
66
|
+
v-if="hasPermissionTooltip"
|
|
67
|
+
name="invalidPermissionTooltipContent"
|
|
68
|
+
/>
|
|
66
69
|
</template>
|
|
67
|
-
</
|
|
70
|
+
</AntButton>
|
|
68
71
|
</template>
|
|
@@ -7,9 +7,10 @@ import AntSpinner from '../AntSpinner.vue';
|
|
|
7
7
|
import {Grouped} from '../../enums/Grouped.enum';
|
|
8
8
|
import {Size} from '../../enums/Size.enum';
|
|
9
9
|
import {handleEnumValidation} from '../../handler';
|
|
10
|
-
import {ColorType} from '../../enums';
|
|
10
|
+
import {ColorType, InputColorType, Position} from '../../enums';
|
|
11
11
|
import {ButtonType} from './__types';
|
|
12
12
|
import AntIcon from '../AntIcon.vue';
|
|
13
|
+
import AntTooltip from '../AntTooltip.vue';
|
|
13
14
|
import {IconSize} from '../__types/AntIcon.types';
|
|
14
15
|
|
|
15
16
|
defineEmits(['click', 'blur']);
|
|
@@ -30,6 +31,9 @@ const props = withDefaults(defineProps<{
|
|
|
30
31
|
submit?: boolean;
|
|
31
32
|
outlined?: boolean;
|
|
32
33
|
noFocus?: boolean;
|
|
34
|
+
tooltipPosition?: Position;
|
|
35
|
+
tooltipColorType?: InputColorType;
|
|
36
|
+
tooltipDelay?: number;
|
|
33
37
|
}>(), {
|
|
34
38
|
colorType: ColorType.base,
|
|
35
39
|
disabled: false,
|
|
@@ -43,6 +47,9 @@ const props = withDefaults(defineProps<{
|
|
|
43
47
|
submit: false,
|
|
44
48
|
outlined: true,
|
|
45
49
|
noFocus: false,
|
|
50
|
+
tooltipPosition: Position.bottom,
|
|
51
|
+
tooltipColorType: InputColorType.base,
|
|
52
|
+
tooltipDelay: 800
|
|
46
53
|
});
|
|
47
54
|
|
|
48
55
|
const hasAction = computed(() => (props.skeleton || props.readonly || props.disabled))
|
|
@@ -178,50 +185,63 @@ onMounted(() => {
|
|
|
178
185
|
absolute
|
|
179
186
|
/>
|
|
180
187
|
|
|
181
|
-
<
|
|
182
|
-
:
|
|
183
|
-
:
|
|
184
|
-
:type="
|
|
185
|
-
:
|
|
186
|
-
:disabled="disabled || undefined"
|
|
187
|
-
:tabindex="noFocus || hasAction ? '-1' : '0'"
|
|
188
|
-
@click="() => !props.readonly ? $emit('click') : null"
|
|
189
|
-
@blur="() => !props.readonly ? $emit('blur') : null"
|
|
188
|
+
<AntTooltip
|
|
189
|
+
:expanded="expanded"
|
|
190
|
+
:position="tooltipPosition"
|
|
191
|
+
:color-type="tooltipColorType"
|
|
192
|
+
:delay="tooltipDelay"
|
|
190
193
|
>
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
<template #default>
|
|
195
|
+
<component
|
|
196
|
+
:is="is"
|
|
197
|
+
:class="classes"
|
|
198
|
+
:type="type"
|
|
199
|
+
:to="to"
|
|
200
|
+
:disabled="disabled || undefined"
|
|
201
|
+
:tabindex="noFocus || hasAction ? '-1' : '0'"
|
|
202
|
+
@click="() => !props.readonly ? $emit('click') : null"
|
|
203
|
+
@blur="() => !props.readonly ? $emit('blur') : null"
|
|
204
|
+
>
|
|
205
|
+
<AntSpinner
|
|
206
|
+
v-if="spinner"
|
|
207
|
+
:size="size"
|
|
208
|
+
:color-type="colorType"
|
|
209
|
+
:inverted="!filled"
|
|
210
|
+
/>
|
|
197
211
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
<slot
|
|
213
|
+
v-if="!spinner"
|
|
214
|
+
name="icon-left"
|
|
215
|
+
>
|
|
216
|
+
<AntIcon
|
|
217
|
+
v-if="iconLeft"
|
|
218
|
+
:icon="iconLeft"
|
|
219
|
+
:size="size as unknown as IconSize"
|
|
220
|
+
:color="iconColor"
|
|
221
|
+
/>
|
|
222
|
+
</slot>
|
|
209
223
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
224
|
+
<slot
|
|
225
|
+
v-if="!spinner"
|
|
226
|
+
/>
|
|
213
227
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
228
|
+
<slot
|
|
229
|
+
v-if="!spinner"
|
|
230
|
+
name="icon-right"
|
|
231
|
+
>
|
|
232
|
+
<AntIcon
|
|
233
|
+
v-if="iconRight"
|
|
234
|
+
:icon="iconRight"
|
|
235
|
+
:size="size as unknown as IconSize"
|
|
236
|
+
:color="iconColor"
|
|
237
|
+
/>
|
|
238
|
+
</slot>
|
|
239
|
+
</component>
|
|
240
|
+
</template>
|
|
241
|
+
|
|
242
|
+
<template #content>
|
|
243
|
+
<slot name="tooltip-content" />
|
|
244
|
+
</template>
|
|
245
|
+
</AntTooltip>
|
|
226
246
|
</div>
|
|
227
247
|
</template>
|
|
@@ -1,19 +1,20 @@
|
|
|
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 {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
|
canCreate?: boolean;
|
|
15
|
-
|
|
15
|
+
tooltipPosition?: Position;
|
|
16
16
|
}>(), {
|
|
17
|
+
iconVariant: false,
|
|
17
18
|
canCreate: true
|
|
18
19
|
});
|
|
19
20
|
</script>
|
|
@@ -21,22 +22,33 @@ withDefaults(defineProps<{
|
|
|
21
22
|
<template>
|
|
22
23
|
<AntActionButton
|
|
23
24
|
:filled="false"
|
|
25
|
+
:color-type="ColorType.primary"
|
|
24
26
|
:size="size"
|
|
25
27
|
:disabled="disabled"
|
|
28
|
+
:icon-left="iconVariant ? faPlus : undefined"
|
|
26
29
|
:grouped="grouped"
|
|
27
30
|
:skeleton="skeleton"
|
|
28
31
|
:expanded="expanded"
|
|
29
32
|
:has-permission="canCreate"
|
|
30
|
-
:
|
|
33
|
+
:tooltip-position="tooltipPosition"
|
|
31
34
|
data-e2e="create-button"
|
|
32
35
|
@click="$emit('click')"
|
|
33
36
|
@blur="$emit('blur')"
|
|
34
37
|
>
|
|
35
|
-
<template
|
|
38
|
+
<template
|
|
39
|
+
v-if="!iconVariant"
|
|
40
|
+
#default
|
|
41
|
+
>
|
|
42
|
+
Create
|
|
43
|
+
</template>
|
|
36
44
|
|
|
37
45
|
<template #invalidPermissionTooltipContent>
|
|
38
46
|
You have no permission to create new entries.<br>
|
|
39
47
|
Please contact your administrator.
|
|
40
48
|
</template>
|
|
49
|
+
|
|
50
|
+
<template #tooltipContent>
|
|
51
|
+
Create new entry
|
|
52
|
+
</template>
|
|
41
53
|
</AntActionButton>
|
|
42
54
|
</template>
|
|
@@ -1,9 +1,6 @@
|
|
|
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';
|
|
7
4
|
import {faTrash} from '@fortawesome/free-solid-svg-icons';
|
|
8
5
|
|
|
9
6
|
defineEmits(['click', 'blur']);
|
|
@@ -15,25 +12,25 @@ withDefaults(defineProps<{
|
|
|
15
12
|
skeleton?: boolean;
|
|
16
13
|
expanded?: boolean;
|
|
17
14
|
canDelete?: boolean;
|
|
18
|
-
|
|
15
|
+
tooltipPosition?: Position;
|
|
19
16
|
}>(), {
|
|
20
17
|
iconVariant: false,
|
|
21
18
|
canDelete: true
|
|
22
|
-
})
|
|
19
|
+
});
|
|
23
20
|
</script>
|
|
24
21
|
|
|
25
22
|
<template>
|
|
26
23
|
<AntActionButton
|
|
27
|
-
:icon-left="iconVariant ? faTrash : undefined"
|
|
28
24
|
:filled="false"
|
|
25
|
+
:color-type="ColorType.danger"
|
|
29
26
|
:size="size"
|
|
30
27
|
:disabled="disabled"
|
|
28
|
+
:icon-left="iconVariant ? faTrash : undefined"
|
|
31
29
|
:grouped="grouped"
|
|
32
30
|
:skeleton="skeleton"
|
|
33
31
|
:expanded="expanded"
|
|
34
|
-
:color-type="ColorType.danger"
|
|
35
32
|
:has-permission="canDelete"
|
|
36
|
-
:
|
|
33
|
+
:tooltip-position="tooltipPosition"
|
|
37
34
|
data-e2e="delete-button"
|
|
38
35
|
@click="$emit('click')"
|
|
39
36
|
@blur="$emit('blur')"
|
|
@@ -46,8 +43,12 @@ withDefaults(defineProps<{
|
|
|
46
43
|
</template>
|
|
47
44
|
|
|
48
45
|
<template #invalidPermissionTooltipContent>
|
|
49
|
-
You have no permission to delete
|
|
46
|
+
You have no permission to delete entries.<br>
|
|
50
47
|
Please contact your administrator.
|
|
51
48
|
</template>
|
|
49
|
+
|
|
50
|
+
<template #tooltipContent>
|
|
51
|
+
Delete entry
|
|
52
|
+
</template>
|
|
52
53
|
</AntActionButton>
|
|
53
54
|
</template>
|
|
@@ -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>
|