@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.
- package/core/composables/index.ts +18 -17
- package/core/composables/useDashboard/index.ts +19 -0
- package/core/composables/{useGlobalSearch.ts → useGlobalSearch/index.ts} +3 -5
- package/core/composables/useWidgets/index.ts +19 -18
- package/core/plugins/modularity/loader.ts +2 -1
- package/core/services/dashboard-service.ts +121 -0
- package/core/services/widget-service.ts +1 -4
- package/dist/core/composables/index.d.ts +1 -0
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useDashboard/index.d.ts +5 -0
- package/dist/core/composables/useDashboard/index.d.ts.map +1 -0
- package/dist/core/composables/{useGlobalSearch.d.ts → useGlobalSearch/index.d.ts} +1 -1
- package/dist/core/composables/useGlobalSearch/index.d.ts.map +1 -0
- package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
- package/dist/core/services/dashboard-service.d.ts +33 -0
- package/dist/core/services/dashboard-service.d.ts.map +1 -0
- package/dist/core/services/widget-service.d.ts.map +1 -1
- package/dist/framework.js +235 -225
- package/dist/{index-Bu12RZTu.js → index-8LELHzw9.js} +1 -1
- package/dist/{index-Bwl2ND2Q.js → index-9lJxZE5w.js} +1 -1
- package/dist/{index-CJi-BbTb.js → index-B1YR_MYV.js} +1 -1
- package/dist/{index-BhdwVgUw.js → index-BA98L1jI.js} +1 -1
- package/dist/{index-NdrUF1u3.js → index-BAeTsi-X.js} +1 -1
- package/dist/{index-CbRqPQTw.js → index-BBYyHeYA.js} +1 -1
- package/dist/{index-CsaYfhir.js → index-BrUitdDo.js} +1 -1
- package/dist/{index-CZ_pj3nW.js → index-BuO5ByG9.js} +1 -1
- package/dist/{index-DFPb-jDP.js → index-CJ5I7vTn.js} +1 -1
- package/dist/{index-BdoAu2fz.js → index-CWKrD2Cd.js} +1 -1
- package/dist/{index-DVaMW7gL.js → index-Cf9Tz1ql.js} +1 -1
- package/dist/{index-B89uIUkS.js → index-CrxFDC2b.js} +1 -1
- package/dist/{index-BcQiBkO6.js → index-D1JchciU.js} +1 -1
- package/dist/{index-CEvuTGIu.js → index-DLtsQ_PJ.js} +31254 -31134
- package/dist/{index-COjjAS6v.js → index-DVljTjbf.js} +1 -1
- package/dist/{index-DjQ6Ffv8.js → index-RwX3kiZh.js} +28 -28
- package/dist/{index-S9Ht7s3i.js → index-xLYzNPa7.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/injection-keys.d.ts +28 -0
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts +25 -0
- package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts.map +1 -0
- package/dist/shared/components/dashboard-widget-card/index.d.ts +2 -0
- package/dist/shared/components/dashboard-widget-card/index.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts +6 -0
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts +20 -0
- package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +354 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts +12 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/index.d.ts +2 -0
- package/dist/shared/components/draggable-dashboard/index.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/types.d.ts +80 -0
- package/dist/shared/components/draggable-dashboard/types.d.ts.map +1 -0
- package/dist/shared/components/index.d.ts +2 -0
- package/dist/shared/components/index.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/_internal/user-info.vue.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
- package/dist/shared/composables/useMenuExpanded.d.ts +2 -0
- package/dist/shared/composables/useMenuExpanded.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts +0 -41
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -25
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/tailwind.config.d.ts +1 -81
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts +169 -734
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +18 -2
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/index.d.ts +2 -0
- package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +12 -0
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts +2 -0
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +2 -0
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts +2 -0
- package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- 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
- 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
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts +13 -67
- package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +5 -65
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue.d.ts.map +1 -1
- 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
- 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
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts +33 -3
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableRowReorder.d.ts.map +1 -1
- package/package.json +10 -5
- package/shared/components/dashboard-widget-card/dashboard-widget-card.vue +67 -0
- package/shared/components/dashboard-widget-card/index.ts +1 -0
- package/shared/components/draggable-dashboard/DraggableDashboard.vue +369 -0
- package/shared/components/draggable-dashboard/_internal/DashboardWidget.vue +133 -0
- package/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts +547 -0
- package/shared/components/draggable-dashboard/composables/useDashboardGrid.ts +250 -0
- package/shared/components/draggable-dashboard/index.ts +1 -0
- package/shared/components/draggable-dashboard/types.ts +91 -0
- package/shared/components/index.ts +2 -0
- package/shared/components/user-dropdown-button/_internal/user-info.vue +25 -12
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +3 -3
- package/shared/composables/useMenuExpanded.ts +24 -0
- package/shared/modules/assets/components/assets-details/assets-details.vue +1 -1
- package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +186 -247
- package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +175 -176
- package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +8 -8
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +153 -187
- package/tailwind.config.ts +127 -126
- package/ui/components/atoms/vc-button/vc-button.stories.ts +1 -16
- package/ui/components/atoms/vc-button/vc-button.vue +74 -63
- package/ui/components/atoms/vc-card/vc-card.stories.ts +102 -102
- package/ui/components/atoms/vc-card/vc-card.vue +164 -159
- package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +22 -0
- package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +16 -0
- package/ui/components/atoms/vc-icon/icons/index.ts +2 -0
- package/ui/components/molecules/vc-field/vc-field.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.ts +12 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarContent.vue +1 -2
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue +0 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +274 -112
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +81 -37
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +7 -5
- package/ui/components/organisms/vc-app/vc-app.vue +26 -15
- package/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue +5 -7
- 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
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue +1 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue +1 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +12 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue +45 -2
- package/ui/components/organisms/vc-table/composables/useTableColumnReorder.ts +5 -5
- package/ui/components/organisms/vc-table/composables/useTableColumnResize.ts +1 -1
- package/ui/components/organisms/vc-table/composables/useTableRowReorder.ts +1 -0
- package/core/services/toolbarbus-service.ts +0 -34
- package/dist/core/composables/useGlobalSearch.d.ts.map +0 -1
- package/dist/core/services/toolbarbus-service.d.ts +0 -10
- package/dist/core/services/toolbarbus-service.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/composables/useToolbarSlots.d.ts +0 -5
- package/dist/ui/components/organisms/vc-app/composables/useToolbarSlots.d.ts.map +0 -1
- 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
- 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", "
|
|
24
|
-
table: {
|
|
25
|
-
type: {
|
|
26
|
-
summary: "primary |
|
|
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
|
-
|
|
63
|
-
description: "
|
|
64
|
-
control: "boolean",
|
|
65
|
-
table: {
|
|
66
|
-
type: {
|
|
67
|
-
summary: "boolean",
|
|
68
|
-
},
|
|
69
|
-
defaultValue: {
|
|
70
|
-
summary: "false",
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
description: "
|
|
76
|
-
control: "
|
|
77
|
-
table: {
|
|
78
|
-
type: {
|
|
79
|
-
summary: "
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
summary: "
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
return { args, context };
|
|
165
|
-
},
|
|
166
|
-
template,
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
+
};
|