@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,176 +1,175 @@
|
|
|
1
|
-
import { template, templateWithVisibilityToggle } from "./common/templates";
|
|
2
|
-
import { Meta, StoryFn } from "@storybook/vue3";
|
|
3
|
-
import { reactive, ref } from "vue";
|
|
4
|
-
import page from "./pages/DynamicRender";
|
|
5
|
-
import * as _ from "lodash-es";
|
|
6
|
-
import { SchemaBaseArgTypes } from "./common/args";
|
|
7
|
-
import { CardSchema } from "../../..";
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: "DynamicViews/atoms/VcCard",
|
|
11
|
-
component: page,
|
|
12
|
-
args: {
|
|
13
|
-
id: "cardId",
|
|
14
|
-
component: "vc-card",
|
|
15
|
-
label: "Card Title",
|
|
16
|
-
fields: [
|
|
17
|
-
{
|
|
18
|
-
id: "fieldId",
|
|
19
|
-
component: "vc-input",
|
|
20
|
-
label: "Input field",
|
|
21
|
-
placeholder: "Enter text here",
|
|
22
|
-
property: "mockedProperty",
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
argTypes: {
|
|
27
|
-
..._.pick(SchemaBaseArgTypes, ["id", "disabled", "visibility"]),
|
|
28
|
-
component: {
|
|
29
|
-
description: "Component type.",
|
|
30
|
-
type: {
|
|
31
|
-
required: true,
|
|
32
|
-
name: "string",
|
|
33
|
-
},
|
|
34
|
-
table: {
|
|
35
|
-
type: {
|
|
36
|
-
summary: "vc-card",
|
|
37
|
-
},
|
|
38
|
-
defaultValue: {
|
|
39
|
-
summary: "vc-card",
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
fields: {
|
|
44
|
-
description: "Array of control schemas for the fields in the card.",
|
|
45
|
-
type: {
|
|
46
|
-
required: true,
|
|
47
|
-
name: "string",
|
|
48
|
-
},
|
|
49
|
-
table: {
|
|
50
|
-
type: {
|
|
51
|
-
summary: "ControlSchema[]",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
collapsible: {
|
|
56
|
-
description: "Whether the card is collapsible or not.",
|
|
57
|
-
control: "boolean",
|
|
58
|
-
table: {
|
|
59
|
-
type: {
|
|
60
|
-
summary: "boolean",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
collapsed: {
|
|
65
|
-
description: "Whether the card is collapsed or not.",
|
|
66
|
-
control: "boolean",
|
|
67
|
-
table: {
|
|
68
|
-
type: {
|
|
69
|
-
summary: "boolean",
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
removePadding: {
|
|
74
|
-
description: "Remove padding from card.",
|
|
75
|
-
control: "boolean",
|
|
76
|
-
table: {
|
|
77
|
-
type: {
|
|
78
|
-
summary: "boolean",
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
action: {
|
|
83
|
-
description: "Action button to be displayed in card.",
|
|
84
|
-
table: {
|
|
85
|
-
type: {
|
|
86
|
-
summary: "ButtonSchema",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
variant: {
|
|
91
|
-
description: "Card variant.",
|
|
92
|
-
control: "radio",
|
|
93
|
-
options: ["default", "success", "danger"],
|
|
94
|
-
table: {
|
|
95
|
-
type: {
|
|
96
|
-
summary: "default | success | danger",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
parameters: {
|
|
102
|
-
docs: {
|
|
103
|
-
canvas: {
|
|
104
|
-
sourceState: "none",
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
} satisfies Meta<CardSchema>;
|
|
109
|
-
|
|
110
|
-
export const Template: StoryFn<CardSchema> = (args) => ({
|
|
111
|
-
components: { page },
|
|
112
|
-
setup: () => {
|
|
113
|
-
const context = reactive({
|
|
114
|
-
scope: {
|
|
115
|
-
runFn: () => alert("Button click"),
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
return { args, context };
|
|
119
|
-
},
|
|
120
|
-
template,
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
export const EmptyCard = Template.bind({});
|
|
124
|
-
EmptyCard.args = {
|
|
125
|
-
fields: [],
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const Collapsible = Template.bind({});
|
|
129
|
-
Collapsible.args = {
|
|
130
|
-
collapsible: true,
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const Collapsed = Template.bind({});
|
|
134
|
-
Collapsed.args = {
|
|
135
|
-
collapsed: true,
|
|
136
|
-
collapsible: true,
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export const WithoutPadding = Template.bind({});
|
|
140
|
-
WithoutPadding.args = {
|
|
141
|
-
removePadding: true,
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export const WithAction = Template.bind({});
|
|
145
|
-
WithAction.args = {
|
|
146
|
-
action: {
|
|
147
|
-
id: "actionId",
|
|
148
|
-
component: "vc-button",
|
|
149
|
-
content: "Action",
|
|
150
|
-
method: "runFn",
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
1
|
+
import { template, templateWithVisibilityToggle } from "./common/templates";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/vue3";
|
|
3
|
+
import { reactive, ref } from "vue";
|
|
4
|
+
import page from "./pages/DynamicRender";
|
|
5
|
+
import * as _ from "lodash-es";
|
|
6
|
+
import { SchemaBaseArgTypes } from "./common/args";
|
|
7
|
+
import { CardSchema } from "../../..";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "DynamicViews/atoms/VcCard",
|
|
11
|
+
component: page,
|
|
12
|
+
args: {
|
|
13
|
+
id: "cardId",
|
|
14
|
+
component: "vc-card",
|
|
15
|
+
label: "Card Title",
|
|
16
|
+
fields: [
|
|
17
|
+
{
|
|
18
|
+
id: "fieldId",
|
|
19
|
+
component: "vc-input",
|
|
20
|
+
label: "Input field",
|
|
21
|
+
placeholder: "Enter text here",
|
|
22
|
+
property: "mockedProperty",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
..._.pick(SchemaBaseArgTypes, ["id", "disabled", "visibility"]),
|
|
28
|
+
component: {
|
|
29
|
+
description: "Component type.",
|
|
30
|
+
type: {
|
|
31
|
+
required: true,
|
|
32
|
+
name: "string",
|
|
33
|
+
},
|
|
34
|
+
table: {
|
|
35
|
+
type: {
|
|
36
|
+
summary: "vc-card",
|
|
37
|
+
},
|
|
38
|
+
defaultValue: {
|
|
39
|
+
summary: "vc-card",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
fields: {
|
|
44
|
+
description: "Array of control schemas for the fields in the card.",
|
|
45
|
+
type: {
|
|
46
|
+
required: true,
|
|
47
|
+
name: "string",
|
|
48
|
+
},
|
|
49
|
+
table: {
|
|
50
|
+
type: {
|
|
51
|
+
summary: "ControlSchema[]",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
collapsible: {
|
|
56
|
+
description: "Whether the card is collapsible or not.",
|
|
57
|
+
control: "boolean",
|
|
58
|
+
table: {
|
|
59
|
+
type: {
|
|
60
|
+
summary: "boolean",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
collapsed: {
|
|
65
|
+
description: "Whether the card is collapsed or not.",
|
|
66
|
+
control: "boolean",
|
|
67
|
+
table: {
|
|
68
|
+
type: {
|
|
69
|
+
summary: "boolean",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
removePadding: {
|
|
74
|
+
description: "Remove padding from card.",
|
|
75
|
+
control: "boolean",
|
|
76
|
+
table: {
|
|
77
|
+
type: {
|
|
78
|
+
summary: "boolean",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
action: {
|
|
83
|
+
description: "Action button to be displayed in card.",
|
|
84
|
+
table: {
|
|
85
|
+
type: {
|
|
86
|
+
summary: "ButtonSchema",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
variant: {
|
|
91
|
+
description: "Card variant.",
|
|
92
|
+
control: "radio",
|
|
93
|
+
options: ["default", "success", "danger"],
|
|
94
|
+
table: {
|
|
95
|
+
type: {
|
|
96
|
+
summary: "default | success | danger",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
parameters: {
|
|
102
|
+
docs: {
|
|
103
|
+
canvas: {
|
|
104
|
+
sourceState: "none",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
} satisfies Meta<CardSchema>;
|
|
109
|
+
|
|
110
|
+
export const Template: StoryFn<CardSchema> = (args) => ({
|
|
111
|
+
components: { page },
|
|
112
|
+
setup: () => {
|
|
113
|
+
const context = reactive({
|
|
114
|
+
scope: {
|
|
115
|
+
runFn: () => alert("Button click"),
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
return { args, context };
|
|
119
|
+
},
|
|
120
|
+
template,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export const EmptyCard = Template.bind({});
|
|
124
|
+
EmptyCard.args = {
|
|
125
|
+
fields: [],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const Collapsible = Template.bind({});
|
|
129
|
+
Collapsible.args = {
|
|
130
|
+
collapsible: true,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const Collapsed = Template.bind({});
|
|
134
|
+
Collapsed.args = {
|
|
135
|
+
collapsed: true,
|
|
136
|
+
collapsible: true,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const WithoutPadding = Template.bind({});
|
|
140
|
+
WithoutPadding.args = {
|
|
141
|
+
removePadding: true,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const WithAction = Template.bind({});
|
|
145
|
+
WithAction.args = {
|
|
146
|
+
action: {
|
|
147
|
+
id: "actionId",
|
|
148
|
+
component: "vc-button",
|
|
149
|
+
content: "Action",
|
|
150
|
+
method: "runFn",
|
|
151
|
+
variant: "secondary",
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const WithVisibilityMethod: StoryFn<CardSchema> = (args) => ({
|
|
156
|
+
components: { page },
|
|
157
|
+
setup: () => {
|
|
158
|
+
const isVisible = ref(false);
|
|
159
|
+
const toggle = () => {
|
|
160
|
+
isVisible.value = !isVisible.value;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const context = reactive({
|
|
164
|
+
scope: {
|
|
165
|
+
runFn: () => alert("Button click"),
|
|
166
|
+
visibilityFn: isVisible,
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
return { args, context, toggle };
|
|
170
|
+
},
|
|
171
|
+
template: templateWithVisibilityToggle,
|
|
172
|
+
});
|
|
173
|
+
WithVisibilityMethod.args = {
|
|
174
|
+
visibility: { method: "visibilityFn" },
|
|
175
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export const template = `
|
|
2
|
-
<page :args="args" :context="context" :additionalSource="additionalSource" @update:modelValue="(val) => Object.assign(context.item, val)" />
|
|
3
|
-
`;
|
|
4
|
-
|
|
5
|
-
export const templateWithVisibilityToggle = `
|
|
6
|
-
<VcButton @click="toggle" class="tw-mb-4"
|
|
7
|
-
${template}
|
|
8
|
-
`;
|
|
1
|
+
export const template = `
|
|
2
|
+
<page :args="args" :context="context" :additionalSource="additionalSource" @update:modelValue="(val) => Object.assign(context.item, val)" />
|
|
3
|
+
`;
|
|
4
|
+
|
|
5
|
+
export const templateWithVisibilityToggle = `
|
|
6
|
+
<VcButton @click="toggle" class="tw-mb-4" small variant="secondary">Toggle visibility</VcButton>
|
|
7
|
+
${template}
|
|
8
|
+
`;
|