@antify/ui-module 1.4.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.
Files changed (88) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +2 -1
  3. package/dist/runtime/components/AntAccordionItem.vue +17 -14
  4. package/dist/runtime/components/AntDropdown.vue +6 -6
  5. package/dist/runtime/components/AntListGroupItem.vue +16 -10
  6. package/dist/runtime/components/AntModal.vue +10 -9
  7. package/dist/runtime/components/AntPopover.vue +10 -8
  8. package/dist/runtime/components/AntTooltip.vue +32 -20
  9. package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +1 -1
  10. package/dist/runtime/components/__stories/AntTooltip.stories.mjs +164 -12
  11. package/dist/runtime/components/buttons/AntActionButton.vue +40 -32
  12. package/dist/runtime/components/buttons/AntButton.vue +188 -168
  13. package/dist/runtime/components/buttons/AntCreateButton.vue +19 -6
  14. package/dist/runtime/components/buttons/AntDeleteButton.vue +21 -10
  15. package/dist/runtime/components/buttons/AntDuplicateButton.vue +54 -0
  16. package/dist/runtime/components/buttons/AntEditButton.vue +54 -0
  17. package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
  18. package/dist/runtime/components/buttons/AntSaveButton.vue +21 -10
  19. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +1 -1
  20. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +22 -19
  21. package/dist/runtime/components/buttons/__stories/AntButton.stories.d.ts +1 -0
  22. package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +166 -131
  23. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +1 -0
  24. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +16 -6
  25. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +1 -0
  26. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +16 -6
  27. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +12 -0
  28. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +76 -0
  29. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.d.ts +12 -0
  30. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.mjs +76 -0
  31. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +1 -0
  32. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +16 -6
  33. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +1 -0
  34. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +16 -6
  35. package/dist/runtime/components/crud/AntCrud.vue +13 -10
  36. package/dist/runtime/components/crud/AntCrudDetail.vue +1 -1
  37. package/dist/runtime/components/crud/AntCrudDetailActions.vue +1 -1
  38. package/dist/runtime/components/crud/AntCrudDetailNav.vue +1 -1
  39. package/dist/runtime/components/crud/AntCrudTableFilter.vue +1 -1
  40. package/dist/runtime/components/crud/AntCrudTableNav.vue +15 -4
  41. package/dist/runtime/components/dialogs/AntDialog.vue +7 -7
  42. package/dist/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +1 -2
  43. package/dist/runtime/components/form/AntFormGroup.vue +22 -7
  44. package/dist/runtime/components/form/AntSelect.vue +57 -53
  45. package/dist/runtime/components/form/AntSwitch.vue +13 -10
  46. package/dist/runtime/components/form/AntSwitcher.vue +4 -4
  47. package/dist/runtime/components/form/AntTextarea.vue +6 -3
  48. package/dist/runtime/components/form/Elements/AntBaseInput.vue +45 -41
  49. package/dist/runtime/components/form/Elements/AntDropDown.vue +1 -1
  50. package/dist/runtime/components/layouts/AntNavLeftLayout.vue +4 -4
  51. package/dist/runtime/components/table/AntTable.vue +95 -73
  52. package/dist/runtime/components/table/AntTableSortButton.vue +16 -4
  53. package/dist/runtime/components/tabs/AntTabItem.vue +7 -4
  54. package/dist/runtime/tailwind.config.mjs +1 -1
  55. package/package.json +11 -11
  56. package/src/runtime/components/AntAccordionItem.vue +17 -14
  57. package/src/runtime/components/AntDropdown.vue +6 -6
  58. package/src/runtime/components/AntListGroupItem.vue +16 -10
  59. package/src/runtime/components/AntModal.vue +10 -9
  60. package/src/runtime/components/AntPopover.vue +10 -8
  61. package/src/runtime/components/AntTooltip.vue +32 -20
  62. package/src/runtime/components/buttons/AntActionButton.vue +40 -32
  63. package/src/runtime/components/buttons/AntButton.vue +188 -168
  64. package/src/runtime/components/buttons/AntCreateButton.vue +19 -6
  65. package/src/runtime/components/buttons/AntDeleteButton.vue +21 -10
  66. package/src/runtime/components/buttons/AntDuplicateButton.vue +54 -0
  67. package/src/runtime/components/buttons/AntEditButton.vue +54 -0
  68. package/src/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
  69. package/src/runtime/components/buttons/AntSaveButton.vue +21 -10
  70. package/src/runtime/components/crud/AntCrud.vue +13 -10
  71. package/src/runtime/components/crud/AntCrudDetail.vue +1 -1
  72. package/src/runtime/components/crud/AntCrudDetailActions.vue +1 -1
  73. package/src/runtime/components/crud/AntCrudDetailNav.vue +1 -1
  74. package/src/runtime/components/crud/AntCrudTableFilter.vue +1 -1
  75. package/src/runtime/components/crud/AntCrudTableNav.vue +15 -4
  76. package/src/runtime/components/dialogs/AntDialog.vue +7 -7
  77. package/src/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +1 -2
  78. package/src/runtime/components/form/AntFormGroup.vue +22 -7
  79. package/src/runtime/components/form/AntSelect.vue +57 -53
  80. package/src/runtime/components/form/AntSwitch.vue +13 -10
  81. package/src/runtime/components/form/AntSwitcher.vue +4 -4
  82. package/src/runtime/components/form/AntTextarea.vue +6 -3
  83. package/src/runtime/components/form/Elements/AntBaseInput.vue +45 -41
  84. package/src/runtime/components/form/Elements/AntDropDown.vue +1 -1
  85. package/src/runtime/components/layouts/AntNavLeftLayout.vue +4 -4
  86. package/src/runtime/components/table/AntTable.vue +95 -73
  87. package/src/runtime/components/table/AntTableSortButton.vue +16 -4
  88. package/src/runtime/components/tabs/AntTabItem.vue +7 -4
@@ -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 {faCopy} 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
+ canDuplicate?: boolean;
15
+ tooltipPosition?: Position;
16
+ }>(), {
17
+ iconVariant: false,
18
+ canDuplicate: 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 ? faCopy : undefined"
29
+ :grouped="grouped"
30
+ :skeleton="skeleton"
31
+ :expanded="expanded"
32
+ :has-permission="canDuplicate"
33
+ :tooltip-position="tooltipPosition"
34
+ data-e2e="duplicate-button"
35
+ @click="$emit('click')"
36
+ @blur="$emit('blur')"
37
+ >
38
+ <template
39
+ v-if="!iconVariant"
40
+ #default
41
+ >
42
+ Duplicate
43
+ </template>
44
+
45
+ <template #invalidPermissionTooltipContent>
46
+ You have no permission to duplicate entries.<br>
47
+ Please contact your administrator.
48
+ </template>
49
+
50
+ <template #tooltipContent>
51
+ Duplicate entry
52
+ </template>
53
+ </AntActionButton>
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/index.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,9 +35,15 @@ 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
- args: {}
44
+ args: {
45
+ tooltipPosition: Position.right
46
+ }
34
47
  };
35
48
  export const Disabled = {
36
49
  render: Docs.render,
@@ -60,20 +73,10 @@ export const Expanded = {
60
73
  expanded: true
61
74
  }
62
75
  };
63
- export const WithPermissionTooltip = {
64
- render: (args) => ({
65
- components: { AntActionButton },
66
- setup() {
67
- return { args };
68
- },
69
- template: `<AntActionButton v-bind="args">
70
- Action Button
71
-
72
- <template #invalidPermissionTooltipContent>You have no permission to do this</template>
73
- </AntActionButton>`
74
- }),
76
+ export const WithoutPermission = {
77
+ render: Docs.render,
75
78
  args: {
76
- hasPermission: false,
77
- invalidPermissionTooltipPosition: Position.right
79
+ ...Docs.args,
80
+ hasPermission: false
78
81
  }
79
82
  };
@@ -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;