@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.
Files changed (68) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/AntAlert.vue +14 -5
  3. package/dist/runtime/components/AntContent.vue +16 -0
  4. package/dist/runtime/components/AntPagination.vue +8 -3
  5. package/dist/runtime/components/AntTooltip.vue +30 -18
  6. package/dist/runtime/components/__stories/AntAlert.stories.d.ts +1 -0
  7. package/dist/runtime/components/__stories/AntAlert.stories.mjs +15 -9
  8. package/dist/runtime/components/__stories/AntContent.stories.d.ts +6 -0
  9. package/dist/runtime/components/__stories/AntContent.stories.mjs +26 -0
  10. package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +1 -1
  11. package/dist/runtime/components/__stories/AntTooltip.stories.mjs +164 -12
  12. package/dist/runtime/components/buttons/AntActionButton.vue +37 -34
  13. package/dist/runtime/components/buttons/AntButton.vue +62 -42
  14. package/dist/runtime/components/buttons/AntCreateButton.vue +18 -6
  15. package/dist/runtime/components/buttons/AntDeleteButton.vue +11 -10
  16. package/dist/runtime/components/buttons/AntDuplicateButton.vue +19 -7
  17. package/dist/runtime/components/buttons/AntEditButton.vue +54 -0
  18. package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
  19. package/dist/runtime/components/buttons/AntSaveButton.vue +21 -10
  20. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +1 -1
  21. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +18 -17
  22. package/dist/runtime/components/buttons/__stories/AntButton.stories.d.ts +1 -0
  23. package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +38 -3
  24. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +1 -0
  25. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +13 -4
  26. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +1 -1
  27. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +13 -11
  28. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +1 -0
  29. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +13 -4
  30. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.d.ts +12 -0
  31. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.mjs +76 -0
  32. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +1 -0
  33. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +13 -4
  34. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +1 -0
  35. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +13 -4
  36. package/dist/runtime/components/crud/AntCrudTableNav.vue +11 -2
  37. package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.mjs +1 -1
  38. package/dist/runtime/components/form/AntFormGroup.vue +22 -7
  39. package/dist/runtime/components/form/AntNumberInput.vue +6 -2
  40. package/dist/runtime/components/form/AntSelect.vue +3 -3
  41. package/dist/runtime/components/form/AntTagInput.vue +7 -7
  42. package/dist/runtime/components/form/Elements/AntField.vue +24 -21
  43. package/dist/runtime/components/form/Elements/AntInputDescription.vue +5 -5
  44. package/dist/runtime/components/form/__stories/AntNumberInput.stories.d.ts +1 -0
  45. package/dist/runtime/components/form/__stories/AntNumberInput.stories.mjs +7 -0
  46. package/dist/runtime/components/layouts/AntNavLeftLayout.vue +2 -2
  47. package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.mjs +1 -1
  48. package/package.json +11 -11
  49. package/src/runtime/components/AntAlert.vue +14 -5
  50. package/src/runtime/components/AntContent.vue +16 -0
  51. package/src/runtime/components/AntPagination.vue +8 -3
  52. package/src/runtime/components/AntTooltip.vue +30 -18
  53. package/src/runtime/components/buttons/AntActionButton.vue +37 -34
  54. package/src/runtime/components/buttons/AntButton.vue +62 -42
  55. package/src/runtime/components/buttons/AntCreateButton.vue +18 -6
  56. package/src/runtime/components/buttons/AntDeleteButton.vue +11 -10
  57. package/src/runtime/components/buttons/AntDuplicateButton.vue +19 -7
  58. package/src/runtime/components/buttons/AntEditButton.vue +54 -0
  59. package/src/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
  60. package/src/runtime/components/buttons/AntSaveButton.vue +21 -10
  61. package/src/runtime/components/crud/AntCrudTableNav.vue +11 -2
  62. package/src/runtime/components/form/AntFormGroup.vue +22 -7
  63. package/src/runtime/components/form/AntNumberInput.vue +6 -2
  64. package/src/runtime/components/form/AntSelect.vue +3 -3
  65. package/src/runtime/components/form/AntTagInput.vue +7 -7
  66. package/src/runtime/components/form/Elements/AntField.vue +24 -21
  67. package/src/runtime/components/form/Elements/AntInputDescription.vue +5 -5
  68. package/src/runtime/components/layouts/AntNavLeftLayout.vue +2 -2
@@ -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
- <component
182
- :is="is"
183
- :class="classes"
184
- :type="type"
185
- :to="to"
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
- <AntSpinner
192
- v-if="spinner"
193
- :size="size"
194
- :color-type="colorType"
195
- :inverted="!filled"
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
- <slot
199
- v-if="!spinner"
200
- name="icon-left"
201
- >
202
- <AntIcon
203
- v-if="iconLeft"
204
- :icon="iconLeft"
205
- :size="size as unknown as IconSize"
206
- :color="iconColor"
207
- />
208
- </slot>
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
- <slot
211
- v-if="!spinner"
212
- />
224
+ <slot
225
+ v-if="!spinner"
226
+ />
213
227
 
214
- <slot
215
- v-if="!spinner"
216
- name="icon-right"
217
- >
218
- <AntIcon
219
- v-if="iconRight"
220
- :icon="iconRight"
221
- :size="size as unknown as IconSize"
222
- :color="iconColor"
223
- />
224
- </slot>
225
- </component>
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
- invalidPermissionTooltipPosition?: Position;
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
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
33
+ :tooltip-position="tooltipPosition"
31
34
  data-e2e="create-button"
32
35
  @click="$emit('click')"
33
36
  @blur="$emit('blur')"
34
37
  >
35
- <template #default>Create</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
- invalidPermissionTooltipPosition?: Position;
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
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
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 this entry.<br>
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 {ColorType, Position} from '../../enums';
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
- invalidPermissionTooltipPosition?: Position;
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
- :icon-left="faCopy"
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
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
33
- data-e2e="create-button"
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
- invalidPermissionTooltipPosition?: Position;
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
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
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 #default>Save and new</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 this entry.<br>
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
- invalidPermissionTooltipPosition?: Position;
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
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
33
+ :tooltip-position="tooltipPosition"
34
+ data-e2e="save-button"
33
35
  @click="$emit('click')"
34
36
  @blur="$emit('blur')"
35
37
  >
36
- <template #default>Save</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 this entry.<br>
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>
@@ -8,4 +8,4 @@ export declare const Disabled: Story;
8
8
  export declare const Grouped: Story;
9
9
  export declare const Skeleton: Story;
10
10
  export declare const Expanded: Story;
11
- export declare const WithPermissionTooltip: Story;
11
+ export declare const WithoutPermission: Story;
@@ -1,12 +1,15 @@
1
1
  import AntActionButton from "../AntActionButton.vue";
2
- import { Size } from "../../../enums/Size.enum.mjs";
3
2
  import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
4
- import { Position } from "../../../enums/Position.enum.mjs";
3
+ import { ColorType, InputColorType, Position, Size } from "../../../enums/index.mjs";
5
4
  const meta = {
6
5
  title: "Components/Buttons/Action Button",
7
6
  component: AntActionButton,
8
7
  parameters: { controls: { sort: "requiredFirst" } },
9
8
  argTypes: {
9
+ colorType: {
10
+ control: { type: "select" },
11
+ options: Object.values(ColorType)
12
+ },
10
13
  size: {
11
14
  control: { type: "radio" },
12
15
  options: Object.values(Size)
@@ -15,9 +18,13 @@ const meta = {
15
18
  control: { type: "select" },
16
19
  options: Object.values(_Grouped)
17
20
  },
18
- invalidPermissionTooltipPosition: {
21
+ tooltipPosition: {
19
22
  control: { type: "select" },
20
23
  options: Object.values(Position)
24
+ },
25
+ tooltipColorType: {
26
+ control: { type: "select" },
27
+ options: Object.values(InputColorType)
21
28
  }
22
29
  }
23
30
  };
@@ -28,10 +35,14 @@ export const Docs = {
28
35
  setup() {
29
36
  return { args };
30
37
  },
31
- template: '<AntActionButton v-bind="args">Action Button</AntActionButton>'
38
+ template: `<AntActionButton v-bind="args">
39
+ <template #default>Action Button</template>
40
+ <template #tooltipContent>This is an action button</template>
41
+ <template #invalidPermissionTooltipContent>You have no permission <br>to click this button</template>
42
+ </AntActionButton>`
32
43
  }),
33
44
  args: {
34
- invalidPermissionTooltipPosition: Position.right
45
+ tooltipPosition: Position.right
35
46
  }
36
47
  };
37
48
  export const Disabled = {
@@ -62,18 +73,8 @@ export const Expanded = {
62
73
  expanded: true
63
74
  }
64
75
  };
65
- export const WithPermissionTooltip = {
66
- render: (args) => ({
67
- components: { AntActionButton },
68
- setup() {
69
- return { args };
70
- },
71
- template: `<AntActionButton v-bind="args">
72
- Action Button
73
-
74
- <template #invalidPermissionTooltipContent>You have no permission to do this</template>
75
- </AntActionButton>`
76
- }),
76
+ export const WithoutPermission = {
77
+ render: Docs.render,
77
78
  args: {
78
79
  ...Docs.args,
79
80
  hasPermission: false
@@ -12,4 +12,5 @@ export declare const Skeleton: Story;
12
12
  export declare const ReadOnly: Story;
13
13
  export declare const Expanded: Story;
14
14
  export declare const WithoutBorder: Story;
15
+ export declare const WithTooltip: Story;
15
16
  export declare const Summary: Story;
@@ -4,7 +4,8 @@ import AntFormGroup from "../../form/AntFormGroup.vue";
4
4
  import { faCaretRight, faCaretLeft } from "@fortawesome/free-solid-svg-icons";
5
5
  import { Size } from "../../../enums/Size.enum.mjs";
6
6
  import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
7
- import { ColorType } from "../../../enums/index.mjs";
7
+ import { ColorType, InputColorType, Position } from "../../../enums/index.mjs";
8
+ import { within } from "@storybook/test";
8
9
  const meta = {
9
10
  component: AntButton,
10
11
  title: "Components/Buttons/Button",
@@ -39,6 +40,16 @@ const meta = {
39
40
  },
40
41
  submit: {
41
42
  description: 'Change the button type to type="submit"'
43
+ },
44
+ tooltipPosition: {
45
+ control: { type: "select" },
46
+ options: Object.values(Position),
47
+ description: "The tooltips position. Tooltip is only shown if a tooltip-content slot is provided."
48
+ },
49
+ tooltipColorType: {
50
+ control: { type: "select" },
51
+ options: Object.values(InputColorType),
52
+ description: "The tooltips color type. Tooltip is only shown if a tooltip-content slot is provided."
42
53
  }
43
54
  }
44
55
  };
@@ -138,6 +149,29 @@ export const WithoutBorder = {
138
149
  outlined: false
139
150
  }
140
151
  };
152
+ export const WithTooltip = {
153
+ render: (args) => ({
154
+ components: { AntButton },
155
+ setup() {
156
+ return { args };
157
+ },
158
+ template: `
159
+ <AntButton v-bind="args">
160
+ <template #default>Button</template>
161
+
162
+ <template #tooltip-content>This is a button</template>
163
+ </AntButton>`
164
+ }),
165
+ play: async ({ canvasElement, step }) => {
166
+ const canvas = within(canvasElement);
167
+ },
168
+ args: {
169
+ tooltipDelay: 800
170
+ },
171
+ parameters: {
172
+ chromatic: { disableSnapshot: false }
173
+ }
174
+ };
141
175
  export const Summary = {
142
176
  parameters: {
143
177
  chromatic: { disableSnapshot: false }
@@ -154,7 +188,7 @@ export const Summary = {
154
188
  template: `
155
189
  <div class="flex flex-col gap-2.5">
156
190
  <AntFormGroup>
157
- <AntFormGroupLabel class="text-xl">
191
+ <AntFormGroupLabel>
158
192
  Grouped | Filled | Outlined combinations
159
193
  </AntFormGroupLabel>
160
194
  <div class="flex">
@@ -256,8 +290,9 @@ export const Summary = {
256
290
  </AntButton>
257
291
  </div>
258
292
  </AntFormGroup>
293
+
259
294
  <AntFormGroup>
260
- <AntFormGroupLabel class="text-xl">
295
+ <AntFormGroupLabel>
261
296
  Size
262
297
  </AntFormGroupLabel>
263
298
  <AntFormGroup direction="row">
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntCreateButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AntCreateButton>;
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;