@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
|
@@ -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>
|
|
@@ -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>
|