sprintify-ui 0.4.10 → 0.5.2

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 (106) hide show
  1. package/dist/sprintify-ui.es.js +11724 -11622
  2. package/dist/types/src/components/BaseActionItem.vue.d.ts +10 -18
  3. package/dist/types/src/components/BaseActionItemButton.vue.d.ts +4 -4
  4. package/dist/types/src/components/BaseAddressForm.vue.d.ts +15 -13
  5. package/dist/types/src/components/BaseAutocomplete.vue.d.ts +13 -5
  6. package/dist/types/src/components/BaseAutocompleteDrawer.vue.d.ts +5 -2
  7. package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +10 -4
  8. package/dist/types/src/components/BaseBelongsTo.vue.d.ts +6 -4
  9. package/dist/types/src/components/BaseBelongsToFetch.vue.d.ts +6 -4
  10. package/dist/types/src/components/BaseButtonGroup.vue.d.ts +5 -3
  11. package/dist/types/src/components/BaseCalendar.vue.d.ts +12 -1
  12. package/dist/types/src/components/BaseClickOutside.vue.d.ts +3 -1
  13. package/dist/types/src/components/BaseColor.vue.d.ts +5 -3
  14. package/dist/types/src/components/BaseDataIterator.vue.d.ts +15 -5
  15. package/dist/types/src/components/BaseDataIteratorSectionColumns.vue.d.ts +31 -11
  16. package/dist/types/src/components/BaseDataTable.vue.d.ts +14 -8
  17. package/dist/types/src/components/BaseDataTableRowAction.vue.d.ts +1 -1
  18. package/dist/types/src/components/BaseDatePicker.vue.d.ts +23 -21
  19. package/dist/types/src/components/BaseDateSelect.vue.d.ts +4 -2
  20. package/dist/types/src/components/BaseDialog.vue.d.ts +4 -1
  21. package/dist/types/src/components/BaseDraggable.vue.d.ts +3 -1
  22. package/dist/types/src/components/BaseDropdown.vue.d.ts +4 -1
  23. package/dist/types/src/components/BaseDropdownAutocomplete.vue.d.ts +7 -4
  24. package/dist/types/src/components/BaseField.vue.d.ts +19 -1
  25. package/dist/types/src/components/BaseFieldI18n.vue.d.ts +4 -2
  26. package/dist/types/src/components/BaseFilePicker.vue.d.ts +3 -1
  27. package/dist/types/src/components/BaseFilePickerCrop.vue.d.ts +3 -1
  28. package/dist/types/src/components/BaseFileUploader.vue.d.ts +25 -20
  29. package/dist/types/src/components/BaseForm.vue.d.ts +4 -1
  30. package/dist/types/src/components/BaseGantt.vue.d.ts +4 -1
  31. package/dist/types/src/components/BaseHasMany.vue.d.ts +5 -3
  32. package/dist/types/src/components/BaseHeader.vue.d.ts +3 -2
  33. package/dist/types/src/components/BaseIconPicker.vue.d.ts +3 -1
  34. package/dist/types/src/components/BaseInput.vue.d.ts +9 -5
  35. package/dist/types/src/components/BaseInputPercent.vue.d.ts +8 -4
  36. package/dist/types/src/components/BaseLayoutNotificationDropdown.vue.d.ts +4 -1
  37. package/dist/types/src/components/BaseLayoutNotificationItem.vue.d.ts +3 -1
  38. package/dist/types/src/components/BaseLayoutSidebarConfigurable.vue.d.ts +9 -5
  39. package/dist/types/src/components/BaseLayoutStacked.vue.d.ts +20 -11
  40. package/dist/types/src/components/BaseLayoutStackedConfigurable.vue.d.ts +13 -9
  41. package/dist/types/src/components/BaseMediaGallery.vue.d.ts +5 -2
  42. package/dist/types/src/components/BaseMediaGalleryItem.vue.d.ts +4 -2
  43. package/dist/types/src/components/BaseMediaItem.vue.d.ts +3 -1
  44. package/dist/types/src/components/BaseMediaLibrary.vue.d.ts +11 -5
  45. package/dist/types/src/components/BaseMediaList.vue.d.ts +5 -2
  46. package/dist/types/src/components/BaseMediaListItem.vue.d.ts +5 -2
  47. package/dist/types/src/components/BaseMediaPictures.vue.d.ts +5 -2
  48. package/dist/types/src/components/BaseMediaPicturesItem.vue.d.ts +4 -2
  49. package/dist/types/src/components/BaseMediaPreview.vue.d.ts +3 -1
  50. package/dist/types/src/components/BaseMenu.vue.d.ts +6 -6
  51. package/dist/types/src/components/BaseMenuItem.vue.d.ts +2 -2
  52. package/dist/types/src/components/BaseModalCenter.vue.d.ts +3 -1
  53. package/dist/types/src/components/BaseModalSide.vue.d.ts +3 -1
  54. package/dist/types/src/components/BaseNavbar.vue.d.ts +32 -1
  55. package/dist/types/src/components/BaseNavbarItem.vue.d.ts +4 -2
  56. package/dist/types/src/components/BaseNavbarItemContent.vue.d.ts +2 -2
  57. package/dist/types/src/components/BaseNavbarSideItem.vue.d.ts +4 -11
  58. package/dist/types/src/components/BaseNavbarSideItemContent.vue.d.ts +2 -2
  59. package/dist/types/src/components/BasePagination.vue.d.ts +3 -1
  60. package/dist/types/src/components/BasePassword.vue.d.ts +6 -4
  61. package/dist/types/src/components/BaseProgressCircle.vue.d.ts +1 -1
  62. package/dist/types/src/components/BaseRadioGroup.vue.d.ts +5 -3
  63. package/dist/types/src/components/BaseRichText.vue.d.ts +6 -4
  64. package/dist/types/src/components/BaseSelect.vue.d.ts +6 -4
  65. package/dist/types/src/components/BaseShortcut.vue.d.ts +2 -2
  66. package/dist/types/src/components/BaseStatistic.vue.d.ts +1 -1
  67. package/dist/types/src/components/BaseStepper.vue.d.ts +3 -1
  68. package/dist/types/src/components/BaseStepperItem.vue.d.ts +3 -1
  69. package/dist/types/src/components/BaseSwitch.vue.d.ts +5 -3
  70. package/dist/types/src/components/BaseSystemAlert.vue.d.ts +4 -2
  71. package/dist/types/src/components/BaseTable.vue.d.ts +11 -2
  72. package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +11 -5
  73. package/dist/types/src/components/BaseTagAutocompleteFetch.vue.d.ts +7 -2
  74. package/dist/types/src/components/BaseTextarea.vue.d.ts +6 -4
  75. package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +8 -3
  76. package/dist/types/src/components/BaseUniqueCode.vue.d.ts +3 -1
  77. package/dist/types/src/types/ActionItem.d.ts +14 -0
  78. package/dist/types/src/types/index.d.ts +0 -26
  79. package/package.json +1 -1
  80. package/src/components/BaseActionItem.vue +25 -14
  81. package/src/components/BaseActionItemButton.vue +14 -16
  82. package/src/components/BaseDataIterator.stories.js +1 -1
  83. package/src/components/BaseDataIterator.vue +2 -2
  84. package/src/components/BaseDataTable.stories.js +1 -1
  85. package/src/components/BaseDataTable.vue +4 -4
  86. package/src/components/BaseField.vue +17 -0
  87. package/src/components/BaseHeader.vue +3 -2
  88. package/src/components/BaseInputLabel.vue +5 -5
  89. package/src/components/BaseLayoutSidebarConfigurable.stories.js +25 -5
  90. package/src/components/BaseLayoutSidebarConfigurable.vue +23 -27
  91. package/src/components/BaseLayoutStacked.vue +27 -11
  92. package/src/components/BaseLayoutStackedConfigurable.stories.js +6 -2
  93. package/src/components/BaseLayoutStackedConfigurable.vue +11 -10
  94. package/src/components/BaseMenu.vue +3 -3
  95. package/src/components/BaseNavbar.stories.js +8 -7
  96. package/src/components/BaseNavbar.vue +58 -12
  97. package/src/components/BaseNavbarItem.vue +2 -5
  98. package/src/components/BaseNavbarSideItem.vue +22 -17
  99. package/src/components/BaseRadioGroup.stories.js +0 -1
  100. package/src/components/BaseRadioGroup.vue +0 -1
  101. package/src/components/BaseShortcut.vue +5 -3
  102. package/src/components/BaseSideNavigation.stories.js +1 -1
  103. package/src/components/BaseTabs.stories.js +1 -1
  104. package/src/stories/List.stories.js +1 -1
  105. package/src/types/ActionItem.ts +15 -0
  106. package/src/types/index.ts +0 -29
@@ -5,7 +5,9 @@ declare const _default: import("vue").DefineComponent<{
5
5
  required: true;
6
6
  type: PropType<StepperItem[]>;
7
7
  };
8
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ click: (...args: any[]) => void;
10
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
11
  items: {
10
12
  required: true;
11
13
  type: PropType<StepperItem[]>;
@@ -21,7 +21,9 @@ declare const _default: import("vue").DefineComponent<{
21
21
  required: true;
22
22
  type: NumberConstructor;
23
23
  };
24
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ click: (...args: any[]) => void;
26
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
25
27
  stepNumber: {
26
28
  required: true;
27
29
  type: NumberConstructor;
@@ -32,7 +32,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
32
32
  default: string;
33
33
  type: StringConstructor;
34
34
  };
35
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
35
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
36
+ "update:modelValue": (...args: any[]) => void;
37
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
38
  modelValue: {
37
39
  default: boolean;
38
40
  type: PropType<string | number | boolean | null | undefined>;
@@ -68,9 +70,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
68
70
  }>> & {
69
71
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
70
72
  }, {
71
- color: "dark" | "light" | "danger" | "success" | "warning" | "primary" | "info";
72
- name: string;
73
73
  required: boolean;
74
+ name: string;
75
+ color: "dark" | "light" | "danger" | "success" | "warning" | "primary" | "info";
74
76
  modelValue: string | number | boolean | null | undefined;
75
77
  hasError: boolean;
76
78
  size: "base" | "xs" | "sm" | "lg" | "xl";
@@ -17,7 +17,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
17
17
  default: boolean;
18
18
  type: BooleanConstructor;
19
19
  };
20
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
20
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ close: (...args: any[]) => void;
22
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
21
23
  to: {
22
24
  default: undefined;
23
25
  type: PropType<RouteLocationRaw | undefined>;
@@ -38,8 +40,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
38
40
  onClose?: ((...args: any[]) => any) | undefined;
39
41
  }, {
40
42
  to: RouteLocationRaw | undefined;
41
- action: () => void | Promise<void>;
42
43
  color: "danger" | "success" | "warning" | "info";
44
+ action: () => void | Promise<void>;
43
45
  closable: boolean;
44
46
  }, {}>, {
45
47
  default?(_: {}): any;
@@ -101,7 +101,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
101
101
  }[]>;
102
102
  uncheckAll: () => void;
103
103
  scrollTop: () => void;
104
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("sort" | "check" | "check-all" | "update:checkedRows" | "details-open" | "details-close" | "update:openedDetailed" | "cell-click")[], "sort" | "check" | "check-all" | "update:checkedRows" | "details-open" | "details-close" | "update:openedDetailed" | "cell-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
104
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
105
+ sort: (...args: any[]) => void;
106
+ check: (...args: any[]) => void;
107
+ "check-all": (...args: any[]) => void;
108
+ "update:checkedRows": (...args: any[]) => void;
109
+ "details-open": (...args: any[]) => void;
110
+ "details-close": (...args: any[]) => void;
111
+ "update:openedDetailed": (...args: any[]) => void;
112
+ "cell-click": (...args: any[]) => void;
113
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
105
114
  /** Table data */
106
115
  data: {
107
116
  type: PropType<Row[]>;
@@ -190,8 +199,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
190
199
  "onCell-click"?: ((...args: any[]) => any) | undefined;
191
200
  }, {
192
201
  data: Row[];
193
- size: "sm" | "md";
194
202
  loading: boolean;
203
+ size: "sm" | "md";
195
204
  sortField: string;
196
205
  sortDirection: string;
197
206
  visibleColumns: number[];
@@ -80,7 +80,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
80
80
  close: typeof close;
81
81
  open: typeof open;
82
82
  setKeywords: typeof setKeywords;
83
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "close" | "scrollBottom" | "typing" | "open")[], "update:modelValue" | "close" | "scrollBottom" | "typing" | "open", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
83
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
84
+ "update:modelValue": (...args: any[]) => void;
85
+ close: (...args: any[]) => void;
86
+ scrollBottom: (...args: any[]) => void;
87
+ typing: (...args: any[]) => void;
88
+ open: (...args: any[]) => void;
89
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
84
90
  modelValue: {
85
91
  required: true;
86
92
  type: PropType<Option[] | null>;
@@ -157,16 +163,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
157
163
  onOpen?: ((...args: any[]) => any) | undefined;
158
164
  }, {
159
165
  filter: (option: NormalizedOption) => boolean;
160
- placeholder: string;
161
- name: string;
162
- disabled: boolean;
163
166
  required: boolean;
167
+ name: string;
164
168
  inline: boolean;
169
+ placeholder: string;
170
+ disabled: boolean;
165
171
  hasError: boolean;
166
172
  max: number;
167
- size: "base" | "xs" | "sm";
168
173
  loading: boolean;
169
174
  loadingBottom: boolean;
175
+ size: "base" | "xs" | "sm";
170
176
  dropdownShow: "focus" | "always";
171
177
  twContainer: string | string[];
172
178
  }, {}>, {
@@ -47,7 +47,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
47
47
  open: () => void | undefined;
48
48
  close: () => void | undefined;
49
49
  setKeywords: (input: string) => void | undefined;
50
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "focus" | "scrollBottom" | "typing")[], "update:modelValue" | "focus" | "scrollBottom" | "typing", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
50
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
51
+ "update:modelValue": (...args: any[]) => void;
52
+ focus: (...args: any[]) => void;
53
+ scrollBottom: (...args: any[]) => void;
54
+ typing: (...args: any[]) => void;
55
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
51
56
  modelValue: {
52
57
  required: true;
53
58
  type: PropType<Option[]>;
@@ -94,9 +99,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
94
99
  onScrollBottom?: ((...args: any[]) => any) | undefined;
95
100
  onTyping?: ((...args: any[]) => any) | undefined;
96
101
  }, {
102
+ required: boolean;
97
103
  placeholder: string;
98
104
  disabled: boolean;
99
- required: boolean;
100
105
  hasError: boolean;
101
106
  max: number;
102
107
  queryKey: string;
@@ -45,7 +45,9 @@ declare const _default: import("vue").DefineComponent<{
45
45
  }, {
46
46
  focus: typeof focus;
47
47
  blur: typeof blur;
48
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
48
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
49
+ "update:modelValue": (...args: any[]) => void;
50
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
49
51
  modelValue: {
50
52
  default: undefined;
51
53
  type: PropType<string | null | undefined>;
@@ -90,13 +92,13 @@ declare const _default: import("vue").DefineComponent<{
90
92
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
91
93
  }, {
92
94
  type: string;
93
- placeholder: string;
94
- name: string;
95
- disabled: boolean;
96
95
  required: boolean;
96
+ name: string;
97
97
  modelValue: string | null | undefined;
98
98
  autocomplete: boolean;
99
99
  preventSubmit: boolean;
100
+ placeholder: string;
101
+ disabled: boolean;
100
102
  hasError: boolean;
101
103
  rows: number;
102
104
  }, {}>;
@@ -49,7 +49,12 @@ declare const _default: import("vue").DefineComponent<{
49
49
  }, {
50
50
  focus: typeof focus;
51
51
  blur: typeof blur;
52
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "submit" | "update:modelValue" | "focus")[], "input" | "submit" | "update:modelValue" | "focus", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
52
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
+ input: (...args: any[]) => void;
54
+ submit: (...args: any[]) => void;
55
+ "update:modelValue": (...args: any[]) => void;
56
+ focus: (...args: any[]) => void;
57
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
53
58
  modelValue: {
54
59
  default: string;
55
60
  type: PropType<string | null>;
@@ -100,10 +105,10 @@ declare const _default: import("vue").DefineComponent<{
100
105
  onSubmit?: ((...args: any[]) => any) | undefined;
101
106
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
102
107
  }, {
103
- placeholder: string;
104
- disabled: boolean;
105
108
  required: boolean;
106
109
  modelValue: string | null;
110
+ placeholder: string;
111
+ disabled: boolean;
107
112
  hasError: boolean;
108
113
  maxHeight: number;
109
114
  rows: number;
@@ -12,7 +12,9 @@ declare const _default: import("vue").DefineComponent<{
12
12
  default: string;
13
13
  type: PropType<"numeric" | "alphanumeric">;
14
14
  };
15
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ "update:modelValue": (...args: any[]) => void;
17
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
18
  modelValue: {
17
19
  required: true;
18
20
  type: PropType<string | number | null>;
@@ -0,0 +1,14 @@
1
+ import { RouteLocationRaw } from "vue-router";
2
+ import { ActionColors } from ".";
3
+ export interface ActionItem {
4
+ label?: string;
5
+ href?: string;
6
+ to?: RouteLocationRaw;
7
+ action?: () => Promise<void> | void;
8
+ icon?: string;
9
+ count?: number;
10
+ color?: ActionColors;
11
+ disabled?: boolean;
12
+ meta?: Record<string, any>;
13
+ actions?: ActionItem[];
14
+ }
@@ -52,32 +52,6 @@ export interface PaginatedCollection extends PaginationMetadata {
52
52
  data: Collection;
53
53
  }
54
54
  export type ActionColors = 'dark' | 'light' | 'danger' | 'success' | 'warning' | 'primary' | 'secondary';
55
- export interface MenuItemInterface {
56
- label?: string;
57
- href?: string;
58
- to?: RouteLocationRaw;
59
- action?: () => Promise<void> | void;
60
- icon?: string;
61
- count?: number;
62
- color?: ActionColors;
63
- line?: boolean;
64
- }
65
- export interface ActionItem {
66
- label: string;
67
- href?: string;
68
- to?: RouteLocationRaw;
69
- action?: () => Promise<void> | void;
70
- icon?: string;
71
- count?: number;
72
- color?: ActionColors;
73
- disabled?: boolean;
74
- meta?: Record<string, any>;
75
- actions?: ActionItem[];
76
- }
77
- export interface ActionSection {
78
- title: string;
79
- actions: ActionItem[];
80
- }
81
55
  export type Row = Record<string, any>;
82
56
  export interface BaseTableColumn {
83
57
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.4.10",
3
+ "version": "0.5.2",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <RouterLink
3
- v-if="to"
3
+ v-if="item.to"
4
4
  v-slot="{ isActive, href: slotHref, navigate }"
5
5
  custom
6
- :to="to"
6
+ :to="item.to"
7
7
  >
8
8
  <a
9
9
  :active="isActive"
10
10
  :href="slotHref"
11
- :class="props.class"
11
+ :class="classInternal"
12
12
  :aria-current="isActive ? 'page' : undefined"
13
13
  @click.prevent="onClick(navigate)"
14
14
  >
@@ -16,22 +16,27 @@
16
16
  </a>
17
17
  </RouterLink>
18
18
  <button
19
- v-else-if="action"
19
+ v-else-if="item.action"
20
20
  type="button"
21
- class="text-left"
22
- :class="props.class"
23
- @click="onClick(action)"
21
+ :class="classInternal"
22
+ @click="onClick(item.action)"
24
23
  >
25
24
  <slot :active="false" />
26
25
  </button>
27
26
  <a
28
- v-else-if="href"
29
- :href="href"
30
- :class="props.class"
27
+ v-else-if="item.href"
28
+ :href="item.href"
29
+ :class="classInternal"
31
30
  @click="onClick()"
32
31
  >
33
32
  <slot :active="false" />
34
33
  </a>
34
+ <div
35
+ v-else
36
+ :class="classInternal"
37
+ >
38
+ <slot :active="false" />
39
+ </div>
35
40
  </template>
36
41
 
37
42
  <script lang="ts">
@@ -41,15 +46,21 @@ export default {
41
46
  </script>
42
47
 
43
48
  <script setup lang="ts">
44
- import { RouteLocationRaw } from 'vue-router';
49
+ import { ActionItem } from '@/types/ActionItem';
50
+ import { twMerge } from 'tailwind-merge';
45
51
 
46
52
  const props = defineProps<{
47
- to?: RouteLocationRaw;
48
- href?: string;
49
- action?: (() => Promise<void>) | (() => void);
53
+ item: ActionItem,
50
54
  class?: string | string[] | null;
51
55
  }>();
52
56
 
57
+ const classInternal = computed(() => {
58
+ return twMerge(
59
+ 'block text-left',
60
+ props.class,
61
+ );
62
+ });
63
+
53
64
  const closeMenu = inject('closeMenu', () => {
54
65
  return;
55
66
  }) as () => void;
@@ -1,31 +1,29 @@
1
1
  <template>
2
2
  <BaseActionItem
3
- :to="action.to"
4
- :href="action.href"
5
- :action="action.action"
3
+ :item="item"
6
4
  :class="classes"
7
5
  class="flex items-center justify-center"
8
6
  >
9
7
  <BaseIcon
10
- v-if="action.icon"
11
- :icon="action.icon"
8
+ v-if="item.icon"
9
+ :icon="item.icon"
12
10
  :class="iconClasses"
13
11
  class="mr-2"
14
12
  />
15
13
  <span
16
- :class="[action.icon ? 'pr-1' : '']"
17
- >{{ action.label }}</span>
14
+ :class="[item.icon ? 'pr-1' : '']"
15
+ >{{ item.label }}</span>
18
16
  </BaseActionItem>
19
17
  </template>
20
18
 
21
19
  <script lang="ts" setup>
22
- import { ActionItem } from '@/types';
23
20
  import { BaseIcon } from '..';
21
+ import { ActionItem } from '@/types/ActionItem';
24
22
  import BaseActionItem from './BaseActionItem.vue';
25
23
 
26
24
  const props = withDefaults(
27
25
  defineProps<{
28
- action: ActionItem;
26
+ item: ActionItem;
29
27
  size: 'sm' | 'md' | 'lg';
30
28
  }>(),
31
29
  {
@@ -36,19 +34,19 @@ const props = withDefaults(
36
34
  const classes = computed(() => {
37
35
  const classList = ['btn'];
38
36
 
39
- if (props.action.color == 'primary') {
37
+ if (props.item.color == 'primary') {
40
38
  classList.push('btn-primary');
41
- } else if (props.action.color == 'secondary') {
39
+ } else if (props.item.color == 'secondary') {
42
40
  classList.push('btn-secondary-outline');
43
- } else if (props.action.color == 'danger') {
41
+ } else if (props.item.color == 'danger') {
44
42
  classList.push('btn-danger');
45
- } else if (props.action.color == 'warning') {
43
+ } else if (props.item.color == 'warning') {
46
44
  classList.push('btn-warning');
47
- } else if (props.action.color == 'success') {
45
+ } else if (props.item.color == 'success') {
48
46
  classList.push('btn-success');
49
- } else if (props.action.color == 'light') {
47
+ } else if (props.item.color == 'light') {
50
48
  classList.push('');
51
- } else if (props.action.color == 'dark') {
49
+ } else if (props.item.color == 'dark') {
52
50
  classList.push('btn-black');
53
51
  }
54
52
 
@@ -133,7 +133,7 @@ Demo.args = {
133
133
  icon: 'heroicons:table-cells',
134
134
  action: () => alert('export!'),
135
135
  },
136
- { line: true },
136
+ { meta: { line: true } },
137
137
  {
138
138
  label: 'Delete all',
139
139
  icon: 'heroicons:trash',
@@ -228,10 +228,10 @@ import {
228
228
  Collection,
229
229
  DataIteratorSection,
230
230
  DataTableQuery,
231
- MenuItemInterface,
232
231
  PaginatedCollection,
233
232
  ResourceCollection,
234
233
  } from '@/types';
234
+ import { ActionItem } from '@/types/ActionItem';
235
235
 
236
236
  import BaseMenu from './BaseMenu.vue';
237
237
  import BasePagination from './BasePagination.vue';
@@ -285,7 +285,7 @@ const props = defineProps({
285
285
  */
286
286
  actions: {
287
287
  default: undefined,
288
- type: Array as PropType<MenuItemInterface[]>,
288
+ type: Array as PropType<ActionItem[]>,
289
289
  },
290
290
 
291
291
  /**
@@ -98,7 +98,7 @@ Demo.args = {
98
98
  icon: 'heroicons:arrow-down-tray',
99
99
  action: () => alert('export!'),
100
100
  },
101
- { line: true },
101
+ { meta: { line: true } },
102
102
  {
103
103
  label: 'Delete all',
104
104
  icon: 'heroicons:trash',
@@ -242,7 +242,6 @@ import {
242
242
  CollectionItem,
243
243
  DataIteratorSection,
244
244
  DataTableQuery,
245
- MenuItemInterface,
246
245
  PaginatedCollection,
247
246
  ResourceCollection,
248
247
  RowAction,
@@ -261,6 +260,7 @@ import BaseEmptyState from '../svg/BaseEmptyState.vue';
261
260
  import { RouteLocationRaw } from 'vue-router';
262
261
  import BaseMenu from './BaseMenu.vue';
263
262
  import BaseDataTableRowAction from './BaseDataTableRowAction.vue';
263
+ import { ActionItem } from '@/types/ActionItem';
264
264
 
265
265
  const router = useRouter();
266
266
 
@@ -372,7 +372,7 @@ const props = defineProps({
372
372
  */
373
373
  checkableActions: {
374
374
  default: undefined,
375
- type: Array as PropType<MenuItemInterface[]>,
375
+ type: Array as PropType<ActionItem[]>,
376
376
  },
377
377
 
378
378
  /**
@@ -416,7 +416,7 @@ const props = defineProps({
416
416
  */
417
417
  actions: {
418
418
  default: undefined,
419
- type: Array as PropType<MenuItemInterface[]>,
419
+ type: Array as PropType<ActionItem[]>,
420
420
  },
421
421
 
422
422
  /**
@@ -654,7 +654,7 @@ const showRowActionMenu = computed<boolean>(() => {
654
654
  return rowActionsInternal.value.length > props.numberOfVisibleRowActions;
655
655
  });
656
656
 
657
- function rowActionMenuItems(row: CollectionItem): MenuItemInterface[] {
657
+ function rowActionMenuItems(row: CollectionItem): ActionItem[] {
658
658
  return rowActionsInternal.value.map((action) => {
659
659
  return {
660
660
  label: action.label,
@@ -5,7 +5,16 @@
5
5
  :label="labelNormalized"
6
6
  :required="required"
7
7
  :class="labelClassInternal"
8
+ :help="help"
8
9
  />
10
+
11
+ <small
12
+ v-if="labelNormalized && description"
13
+ class="mb-3 -mt-1 block text-xs text-slate-500"
14
+ >
15
+ {{ description }}
16
+ </small>
17
+
9
18
  <slot />
10
19
  <template v-if="errorMessage">
11
20
  <BaseInputError
@@ -45,6 +54,14 @@ const props = defineProps({
45
54
  type: Boolean,
46
55
  default: false,
47
56
  },
57
+ help: {
58
+ type: String,
59
+ default: null,
60
+ },
61
+ description: {
62
+ type: String,
63
+ default: null,
64
+ },
48
65
  errorType: {
49
66
  type: String as PropType<'default' | 'alert'>,
50
67
  default: 'default',
@@ -71,7 +71,7 @@
71
71
  <BaseActionItemButton
72
72
  v-for="(primaryAction, i) in primaryActions"
73
73
  :key="i"
74
- :action="primaryAction"
74
+ :item="primaryAction"
75
75
  size="sm"
76
76
  />
77
77
  <BaseMenu
@@ -99,7 +99,8 @@
99
99
  </template>
100
100
 
101
101
  <script setup lang="ts">
102
- import { ActionItem, Breadcrumb } from '@/types';
102
+ import { Breadcrumb } from '@/types';
103
+ import { ActionItem } from '@/types/ActionItem';
103
104
  import { useResizeObserver } from '@vueuse/core';
104
105
  import { BaseBreadcrumbs, BaseIcon } from '..';
105
106
  import BaseActionItemButton from './BaseActionItemButton.vue';
@@ -2,21 +2,21 @@
2
2
  <label :class="classes">
3
3
  <div
4
4
  :ref="help ? 'info' : ''"
5
- class="relative inline-flex items-center"
5
+ class="relative inline-flex"
6
6
  :class="[help ? 'cursor-help' : 'cursor-default']"
7
7
  >
8
- <span> {{ label }}</span>
8
+ <div> {{ label }}</div>
9
9
 
10
10
  <BaseIcon
11
11
  v-if="help"
12
- class="relative bottom-px ml-1 inline h-4 w-4"
12
+ class="block relative text-slate-900 -bottom-[3px] ml-1 mr-1 h-[13px] w-[13px]"
13
13
  icon="mdi:information-outline"
14
14
  />
15
15
 
16
- <span
16
+ <div
17
17
  v-if="required"
18
18
  class="ml-0.5 text-red-600"
19
- > *</span>
19
+ > *</div>
20
20
  </div>
21
21
  </label>
22
22
  </template>
@@ -19,13 +19,32 @@ export default {
19
19
  },
20
20
  menu: [
21
21
  {
22
- title: 'General',
22
+ label: 'Dashboard',
23
+ to: '/dashboard',
24
+ icon: 'heroicons:home-20-solid',
25
+ count: 1,
26
+ meta: {
27
+ showSubItems: 'always',
28
+ },
23
29
  actions: [
24
30
  {
25
- label: 'Dashboard',
26
- to: '/',
27
- icon: 'heroicons:home-20-solid',
31
+ label: 'Sales',
32
+ to: '/dashboard/1',
33
+ count: 10,
34
+ },
35
+ {
36
+ label: 'Performance',
37
+ to: '/dashboard/2',
28
38
  },
39
+ {
40
+ label: 'Workload',
41
+ to: '/dashboard/3',
42
+ },
43
+ ],
44
+ },
45
+ {
46
+ label: 'General',
47
+ actions: [
29
48
  {
30
49
  label: 'Articles',
31
50
  to: '/articles',
@@ -35,6 +54,7 @@ export default {
35
54
  {
36
55
  label: 'Articles',
37
56
  to: '/articles/1',
57
+ count: 10,
38
58
  },
39
59
  {
40
60
  label: 'Videos',
@@ -59,7 +79,7 @@ export default {
59
79
  ],
60
80
  },
61
81
  {
62
- title: 'Settings',
82
+ label: 'Settings',
63
83
  actions: [
64
84
  {
65
85
  label: 'Account',