@vc-shell/framework 1.1.0-alpha.3 → 1.1.0-alpha.4

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 (156) hide show
  1. package/core/composables/index.ts +18 -17
  2. package/core/composables/useDashboard/index.ts +19 -0
  3. package/core/composables/{useGlobalSearch.ts → useGlobalSearch/index.ts} +3 -5
  4. package/core/composables/useWidgets/index.ts +19 -18
  5. package/core/plugins/modularity/loader.ts +2 -1
  6. package/core/services/dashboard-service.ts +121 -0
  7. package/core/services/widget-service.ts +1 -4
  8. package/dist/core/composables/index.d.ts +1 -0
  9. package/dist/core/composables/index.d.ts.map +1 -1
  10. package/dist/core/composables/useDashboard/index.d.ts +5 -0
  11. package/dist/core/composables/useDashboard/index.d.ts.map +1 -0
  12. package/dist/core/composables/{useGlobalSearch.d.ts → useGlobalSearch/index.d.ts} +1 -1
  13. package/dist/core/composables/useGlobalSearch/index.d.ts.map +1 -0
  14. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  15. package/dist/core/services/dashboard-service.d.ts +33 -0
  16. package/dist/core/services/dashboard-service.d.ts.map +1 -0
  17. package/dist/core/services/widget-service.d.ts.map +1 -1
  18. package/dist/framework.js +235 -225
  19. package/dist/{index-Bu12RZTu.js → index-8LELHzw9.js} +1 -1
  20. package/dist/{index-Bwl2ND2Q.js → index-9lJxZE5w.js} +1 -1
  21. package/dist/{index-CJi-BbTb.js → index-B1YR_MYV.js} +1 -1
  22. package/dist/{index-BhdwVgUw.js → index-BA98L1jI.js} +1 -1
  23. package/dist/{index-NdrUF1u3.js → index-BAeTsi-X.js} +1 -1
  24. package/dist/{index-CbRqPQTw.js → index-BBYyHeYA.js} +1 -1
  25. package/dist/{index-CsaYfhir.js → index-BrUitdDo.js} +1 -1
  26. package/dist/{index-CZ_pj3nW.js → index-BuO5ByG9.js} +1 -1
  27. package/dist/{index-DFPb-jDP.js → index-CJ5I7vTn.js} +1 -1
  28. package/dist/{index-BdoAu2fz.js → index-CWKrD2Cd.js} +1 -1
  29. package/dist/{index-DVaMW7gL.js → index-Cf9Tz1ql.js} +1 -1
  30. package/dist/{index-B89uIUkS.js → index-CrxFDC2b.js} +1 -1
  31. package/dist/{index-BcQiBkO6.js → index-D1JchciU.js} +1 -1
  32. package/dist/{index-CEvuTGIu.js → index-DLtsQ_PJ.js} +31254 -31134
  33. package/dist/{index-COjjAS6v.js → index-DVljTjbf.js} +1 -1
  34. package/dist/{index-DjQ6Ffv8.js → index-RwX3kiZh.js} +28 -28
  35. package/dist/{index-S9Ht7s3i.js → index-xLYzNPa7.js} +1 -1
  36. package/dist/index.css +1 -1
  37. package/dist/injection-keys.d.ts +28 -0
  38. package/dist/injection-keys.d.ts.map +1 -1
  39. package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts +25 -0
  40. package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts.map +1 -0
  41. package/dist/shared/components/dashboard-widget-card/index.d.ts +2 -0
  42. package/dist/shared/components/dashboard-widget-card/index.d.ts.map +1 -0
  43. package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts +6 -0
  44. package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -0
  45. package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts +20 -0
  46. package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts.map +1 -0
  47. package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +354 -0
  48. package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts.map +1 -0
  49. package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts +12 -0
  50. package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts.map +1 -0
  51. package/dist/shared/components/draggable-dashboard/index.d.ts +2 -0
  52. package/dist/shared/components/draggable-dashboard/index.d.ts.map +1 -0
  53. package/dist/shared/components/draggable-dashboard/types.d.ts +80 -0
  54. package/dist/shared/components/draggable-dashboard/types.d.ts.map +1 -0
  55. package/dist/shared/components/index.d.ts +2 -0
  56. package/dist/shared/components/index.d.ts.map +1 -1
  57. package/dist/shared/components/user-dropdown-button/_internal/user-info.vue.d.ts.map +1 -1
  58. package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
  59. package/dist/shared/composables/useMenuExpanded.d.ts +2 -0
  60. package/dist/shared/composables/useMenuExpanded.d.ts.map +1 -1
  61. package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts +0 -41
  62. package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts.map +1 -1
  63. package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts.map +1 -1
  64. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +1 -1
  65. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +1 -1
  66. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -25
  67. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  68. package/dist/tailwind.config.d.ts +1 -81
  69. package/dist/tailwind.config.d.ts.map +1 -1
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts +169 -734
  72. package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts.map +1 -1
  73. package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +18 -2
  74. package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
  75. package/dist/ui/components/atoms/vc-card/index.d.ts +2 -0
  76. package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -1
  77. package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +12 -0
  78. package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts.map +1 -1
  79. package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts +2 -0
  80. package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
  81. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +18 -0
  82. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +1 -0
  83. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +18 -0
  84. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +1 -0
  85. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +2 -0
  86. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
  87. package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts +2 -0
  88. package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts.map +1 -1
  89. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +0 -1
  90. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  91. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts +2 -1
  92. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
  93. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +1 -1
  94. package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts +13 -67
  95. package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts.map +1 -1
  96. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +5 -65
  97. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  98. package/dist/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue.d.ts.map +1 -1
  99. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/{vc-table-header/vc-table-header.vue.d.ts → vc-table-columns-header/vc-table-columns-header.vue.d.ts} +1 -1
  100. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts.map +1 -0
  101. package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
  102. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts +33 -3
  103. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts.map +1 -1
  104. package/dist/ui/components/organisms/vc-table/composables/useTableRowReorder.d.ts.map +1 -1
  105. package/package.json +10 -5
  106. package/shared/components/dashboard-widget-card/dashboard-widget-card.vue +67 -0
  107. package/shared/components/dashboard-widget-card/index.ts +1 -0
  108. package/shared/components/draggable-dashboard/DraggableDashboard.vue +369 -0
  109. package/shared/components/draggable-dashboard/_internal/DashboardWidget.vue +133 -0
  110. package/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts +547 -0
  111. package/shared/components/draggable-dashboard/composables/useDashboardGrid.ts +250 -0
  112. package/shared/components/draggable-dashboard/index.ts +1 -0
  113. package/shared/components/draggable-dashboard/types.ts +91 -0
  114. package/shared/components/index.ts +2 -0
  115. package/shared/components/user-dropdown-button/_internal/user-info.vue +25 -12
  116. package/shared/components/user-dropdown-button/user-dropdown-button.vue +3 -3
  117. package/shared/composables/useMenuExpanded.ts +24 -0
  118. package/shared/modules/assets/components/assets-details/assets-details.vue +1 -1
  119. package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +186 -247
  120. package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +175 -176
  121. package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +8 -8
  122. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +153 -187
  123. package/tailwind.config.ts +127 -126
  124. package/ui/components/atoms/vc-button/vc-button.stories.ts +1 -16
  125. package/ui/components/atoms/vc-button/vc-button.vue +74 -63
  126. package/ui/components/atoms/vc-card/vc-card.stories.ts +102 -102
  127. package/ui/components/atoms/vc-card/vc-card.vue +164 -159
  128. package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +22 -0
  129. package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +16 -0
  130. package/ui/components/atoms/vc-icon/icons/index.ts +2 -0
  131. package/ui/components/molecules/vc-field/vc-field.vue +1 -1
  132. package/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.ts +12 -1
  133. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarContent.vue +1 -2
  134. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue +1 -1
  135. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue +0 -1
  136. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +274 -112
  137. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +81 -37
  138. package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +7 -5
  139. package/ui/components/organisms/vc-app/vc-app.vue +26 -15
  140. package/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue +5 -7
  141. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/{vc-table-header/vc-table-header.vue → vc-table-columns-header/vc-table-columns-header.vue} +23 -21
  142. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue +1 -0
  143. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue +1 -1
  144. package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +12 -1
  145. package/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue +45 -2
  146. package/ui/components/organisms/vc-table/composables/useTableColumnReorder.ts +5 -5
  147. package/ui/components/organisms/vc-table/composables/useTableColumnResize.ts +1 -1
  148. package/ui/components/organisms/vc-table/composables/useTableRowReorder.ts +1 -0
  149. package/core/services/toolbarbus-service.ts +0 -34
  150. package/dist/core/composables/useGlobalSearch.d.ts.map +0 -1
  151. package/dist/core/services/toolbarbus-service.d.ts +0 -10
  152. package/dist/core/services/toolbarbus-service.d.ts.map +0 -1
  153. package/dist/ui/components/organisms/vc-app/composables/useToolbarSlots.d.ts +0 -5
  154. package/dist/ui/components/organisms/vc-app/composables/useToolbarSlots.d.ts.map +0 -1
  155. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-header/vc-table-header.vue.d.ts.map +0 -1
  156. package/ui/components/organisms/vc-app/composables/useToolbarSlots.ts +0 -37
@@ -1,247 +1,186 @@
1
- import { template, templateWithVisibilityToggle } from "./common/templates";
2
- import { Meta, StoryFn } from "@storybook/vue3";
3
- import { computed, reactive, ref } from "vue";
4
- import page from "./pages/DynamicRender";
5
- import * as _ from "lodash-es";
6
- import { SchemaBaseArgTypes } from "./common/args";
7
- import { ButtonSchema } from "../../..";
8
-
9
- export default {
10
- title: "DynamicViews/atoms/VcButton",
11
- component: page,
12
- args: {
13
- id: "buttonId",
14
- component: "vc-button",
15
- content: "I am a button",
16
- method: "runFn",
17
- },
18
- argTypes: {
19
- ..._.pick(SchemaBaseArgTypes, ["id", "disabled", "visibility"]),
20
- variant: {
21
- description: "Button variant.",
22
- control: "radio",
23
- options: ["primary", "warning", "danger"],
24
- table: {
25
- type: {
26
- summary: "primary | warning | danger",
27
- },
28
- defaultValue: {
29
- summary: "primary",
30
- },
31
- },
32
- },
33
- content: {
34
- description: `Button inner text.
35
- Supports i18n keys.`,
36
- type: {
37
- required: true,
38
- name: "string",
39
- },
40
- table: {
41
- type: {
42
- summary: "string",
43
- },
44
- },
45
- },
46
- component: {
47
- description: `Component type.`,
48
- control: "text",
49
- type: {
50
- required: true,
51
- name: "string",
52
- },
53
- table: {
54
- type: {
55
- summary: "vc-button",
56
- },
57
- defaultValue: {
58
- summary: "vc-button",
59
- },
60
- },
61
- },
62
- small: {
63
- description: "Small sized button.",
64
- control: "boolean",
65
- table: {
66
- type: {
67
- summary: "boolean",
68
- },
69
- defaultValue: {
70
- summary: "false",
71
- },
72
- },
73
- },
74
- raised: {
75
- description: "Raised button.",
76
- control: "boolean",
77
- table: {
78
- type: {
79
- summary: "boolean",
80
- },
81
- defaultValue: {
82
- summary: "false",
83
- },
84
- },
85
- },
86
- text: {
87
- description: "Button as text without overlay.",
88
- control: "boolean",
89
- table: {
90
- type: {
91
- summary: "boolean",
92
- },
93
- defaultValue: {
94
- summary: "false",
95
- },
96
- },
97
- },
98
- outline: {
99
- description: "Outlined button.",
100
- control: "boolean",
101
- table: {
102
- type: {
103
- summary: "boolean",
104
- },
105
- defaultValue: {
106
- summary: "false",
107
- },
108
- },
109
- },
110
- icon: {
111
- description: "Button icon.",
112
- control: "text",
113
- table: {
114
- type: {
115
- summary: "string",
116
- },
117
- },
118
- },
119
- iconSize: {
120
- description: "Size of the button icon.",
121
- control: "radio",
122
- options: ["s", "m", "xs", "l", "xl", "xxl", "xxxl"],
123
- table: {
124
- type: {
125
- summary: "s | m | xs | l | xl | xxl | xxxl",
126
- },
127
- defaultValue: {
128
- summary: "s",
129
- },
130
- },
131
- },
132
- method: {
133
- description: `Method to be called when the button is clicked.
134
- Method should be defined in the blade \`scope\``,
135
- type: {
136
- required: true,
137
- name: "string",
138
- },
139
- control: "text",
140
- table: {
141
- type: {
142
- summary: "string",
143
- },
144
- },
145
- },
146
- },
147
- parameters: {
148
- docs: {
149
- canvas: {
150
- sourceState: "none",
151
- },
152
- },
153
- },
154
- } satisfies Meta<ButtonSchema>;
155
-
156
- export const Template: StoryFn<ButtonSchema> = (args) => ({
157
- components: { page },
158
- setup: () => {
159
- const context = reactive({
160
- scope: {
161
- runFn: () => alert("Button click"),
162
- },
163
- });
164
- return { args, context };
165
- },
166
- template,
167
- });
168
-
169
- export const Disabled: StoryFn<ButtonSchema> = (args) => ({
170
- components: { page },
171
- setup: () => {
172
- const context = reactive({
173
- scope: {
174
- runFn: () => alert("Button click"),
175
- disabledFn: computed(() => true),
176
- },
177
- });
178
- return { args, context };
179
- },
180
- template,
181
- });
182
- Disabled.args = {
183
- disabled: { method: "disabledFn" },
184
- };
185
-
186
- export const WithVisibilityMethod: StoryFn<ButtonSchema> = (args) => ({
187
- components: { page },
188
- setup: () => {
189
- const isVisible = ref(false);
190
- const toggle = () => {
191
- isVisible.value = !isVisible.value;
192
- };
193
-
194
- const context = reactive({
195
- scope: {
196
- runFn: () => alert("Button click"),
197
- visibilityFn: isVisible,
198
- },
199
- });
200
- return { args, context, toggle };
201
- },
202
- template: templateWithVisibilityToggle,
203
- });
204
- WithVisibilityMethod.args = {
205
- visibility: { method: "visibilityFn" },
206
- };
207
-
208
- export const Small = Template.bind({});
209
- Small.args = {
210
- small: true,
211
- };
212
-
213
- export const Text = Template.bind({});
214
- Text.args = {
215
- text: true,
216
- };
217
-
218
- export const Icon = Template.bind({});
219
- Icon.args = {
220
- icon: "fas fa-truck-moving",
221
- };
222
-
223
- export const IconSize = Template.bind({});
224
- IconSize.args = {
225
- icon: "fas fa-truck-moving",
226
- iconSize: "xxl",
227
- };
228
-
229
- export const Raised = Template.bind({});
230
- Raised.args = {
231
- raised: true,
232
- };
233
-
234
- export const Warning = Template.bind({});
235
- Warning.args = {
236
- variant: "warning",
237
- };
238
-
239
- export const Danger = Template.bind({});
240
- Danger.args = {
241
- variant: "danger",
242
- };
243
-
244
- export const Outline = Template.bind({});
245
- Outline.args = {
246
- outline: true,
247
- };
1
+ import { template, templateWithVisibilityToggle } from "./common/templates";
2
+ import { Meta, StoryFn } from "@storybook/vue3";
3
+ import { computed, reactive, ref } from "vue";
4
+ import page from "./pages/DynamicRender";
5
+ import * as _ from "lodash-es";
6
+ import { SchemaBaseArgTypes } from "./common/args";
7
+ import { ButtonSchema } from "../../..";
8
+
9
+ export default {
10
+ title: "DynamicViews/atoms/VcButton",
11
+ component: page,
12
+ args: {
13
+ id: "buttonId",
14
+ component: "vc-button",
15
+ content: "I am a button",
16
+ method: "runFn",
17
+ },
18
+ argTypes: {
19
+ ..._.pick(SchemaBaseArgTypes, ["id", "disabled", "visibility"]),
20
+ variant: {
21
+ description: "Button variant.",
22
+ control: "radio",
23
+ options: ["primary", "secondary"],
24
+ table: {
25
+ type: {
26
+ summary: "primary | secondary",
27
+ },
28
+ defaultValue: {
29
+ summary: "primary",
30
+ },
31
+ },
32
+ },
33
+ content: {
34
+ description: `Button inner text.
35
+ Supports i18n keys.`,
36
+ type: {
37
+ required: true,
38
+ name: "string",
39
+ },
40
+ table: {
41
+ type: {
42
+ summary: "string",
43
+ },
44
+ },
45
+ },
46
+ component: {
47
+ description: `Component type.`,
48
+ control: "text",
49
+ type: {
50
+ required: true,
51
+ name: "string",
52
+ },
53
+ table: {
54
+ type: {
55
+ summary: "vc-button",
56
+ },
57
+ defaultValue: {
58
+ summary: "vc-button",
59
+ },
60
+ },
61
+ },
62
+ text: {
63
+ description: "Button as text without overlay.",
64
+ control: "boolean",
65
+ table: {
66
+ type: {
67
+ summary: "boolean",
68
+ },
69
+ defaultValue: {
70
+ summary: "false",
71
+ },
72
+ },
73
+ },
74
+ icon: {
75
+ description: "Button icon.",
76
+ control: "text",
77
+ table: {
78
+ type: {
79
+ summary: "string",
80
+ },
81
+ },
82
+ },
83
+ iconSize: {
84
+ description: "Size of the button icon.",
85
+ control: "radio",
86
+ options: ["s", "m", "xs", "l", "xl", "xxl", "xxxl"],
87
+ table: {
88
+ type: {
89
+ summary: "s | m | xs | l | xl | xxl | xxxl",
90
+ },
91
+ defaultValue: {
92
+ summary: "s",
93
+ },
94
+ },
95
+ },
96
+ method: {
97
+ description: `Method to be called when the button is clicked.
98
+ Method should be defined in the blade \`scope\``,
99
+ type: {
100
+ required: true,
101
+ name: "string",
102
+ },
103
+ control: "text",
104
+ table: {
105
+ type: {
106
+ summary: "string",
107
+ },
108
+ },
109
+ },
110
+ },
111
+ parameters: {
112
+ docs: {
113
+ canvas: {
114
+ sourceState: "none",
115
+ },
116
+ },
117
+ },
118
+ } satisfies Meta<ButtonSchema>;
119
+
120
+ export const Template: StoryFn<ButtonSchema> = (args) => ({
121
+ components: { page },
122
+ setup: () => {
123
+ const context = reactive({
124
+ scope: {
125
+ runFn: () => alert("Button click"),
126
+ },
127
+ });
128
+ return { args, context };
129
+ },
130
+ template,
131
+ });
132
+
133
+ export const Disabled: StoryFn<ButtonSchema> = (args) => ({
134
+ components: { page },
135
+ setup: () => {
136
+ const context = reactive({
137
+ scope: {
138
+ runFn: () => alert("Button click"),
139
+ disabledFn: computed(() => true),
140
+ },
141
+ });
142
+ return { args, context };
143
+ },
144
+ template,
145
+ });
146
+ Disabled.args = {
147
+ disabled: { method: "disabledFn" },
148
+ };
149
+
150
+ export const WithVisibilityMethod: StoryFn<ButtonSchema> = (args) => ({
151
+ components: { page },
152
+ setup: () => {
153
+ const isVisible = ref(false);
154
+ const toggle = () => {
155
+ isVisible.value = !isVisible.value;
156
+ };
157
+
158
+ const context = reactive({
159
+ scope: {
160
+ runFn: () => alert("Button click"),
161
+ visibilityFn: isVisible,
162
+ },
163
+ });
164
+ return { args, context, toggle };
165
+ },
166
+ template: templateWithVisibilityToggle,
167
+ });
168
+ WithVisibilityMethod.args = {
169
+ visibility: { method: "visibilityFn" },
170
+ };
171
+
172
+ export const Text = Template.bind({});
173
+ Text.args = {
174
+ text: true,
175
+ };
176
+
177
+ export const Icon = Template.bind({});
178
+ Icon.args = {
179
+ icon: "fas fa-truck-moving",
180
+ };
181
+
182
+ export const IconSize = Template.bind({});
183
+ IconSize.args = {
184
+ icon: "fas fa-truck-moving",
185
+ iconSize: "xxl",
186
+ };