@vc-shell/framework 1.0.181 → 1.0.183
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/CHANGELOG.md +13 -0
- package/dist/framework.js +5196 -5182
- package/dist/index.css +1 -1
- package/dist/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
- package/dist/shared/components/popup-handler/composables/usePopup/index.d.ts.map +1 -1
- package/dist/tailwind.config.d.ts +1 -2
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/index.d.ts +1 -79
- package/dist/ui/components/atoms/vc-badge/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.stories.d.ts +389 -6
- package/dist/ui/components/atoms/vc-badge/vc-badge.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts +2295 -5
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +1119 -5
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts +1778 -5
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-col/vc-col.stories.d.ts +51 -5
- package/dist/ui/components/atoms/vc-col/vc-col.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-hint/vc-hint.stories.d.ts +37 -5
- package/dist/ui/components/atoms/vc-hint/vc-hint.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.stories.d.ts +62 -5
- package/dist/ui/components/atoms/vc-icon/vc-icon.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts +103 -5
- package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-label/vc-label.stories.d.ts +101 -5
- package/dist/ui/components/atoms/vc-label/vc-label.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts +103 -5
- package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-loading/vc-loading.stories.d.ts +18 -5
- package/dist/ui/components/atoms/vc-loading/vc-loading.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.stories.d.ts +85 -5
- package/dist/ui/components/atoms/vc-progress/vc-progress.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-row/vc-row.stories.d.ts +25 -5
- package/dist/ui/components/atoms/vc-row/vc-row.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/vc-status.stories.d.ts +116 -5
- package/dist/ui/components/atoms/vc-status/vc-status.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts +53 -5
- package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts +59 -0
- package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-widget/vc-widget.stories.d.ts +42 -5
- package/dist/ui/components/atoms/vc-widget/vc-widget.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts +40 -5
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts +179 -5
- package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-field/vc-field.stories.d.ts +12 -0
- package/dist/ui/components/molecules/vc-field/vc-field.stories.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts +19 -0
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.stories.d.ts +182 -5
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +4 -0
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-form/vc-form.stories.d.ts +29 -5
- package/dist/ui/components/molecules/vc-form/vc-form.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/vc-input.stories.d.ts +347 -5
- package/dist/ui/components/molecules/vc-input/vc-input.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts +354 -5
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts +889 -0
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.stories.d.ts +74 -5
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.stories.d.ts +498 -5
- package/dist/ui/components/molecules/vc-rating/vc-rating.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts +2567 -5
- package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-slider/vc-slider.stories.d.ts +156 -5
- package/dist/ui/components/molecules/vc-slider/vc-slider.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.stories.d.ts +1297 -5
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts +276 -5
- 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 +82 -3
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/index.d.ts +1 -179
- package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.stories.d.ts +209 -5
- package/dist/ui/components/organisms/vc-blade/vc-blade.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +6 -3
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.stories.d.ts +155 -6
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +0 -4
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +13 -8
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts +1272 -5
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +6 -5
- package/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue +1 -0
- package/shared/components/popup-handler/composables/usePopup/index.ts +8 -7
- package/tailwind.config.ts +2 -46
- package/ui/components/atoms/vc-badge/index.ts +1 -13
- package/ui/components/atoms/vc-badge/vc-badge.stories.ts +48 -20
- package/ui/components/atoms/vc-button/vc-button.stories.ts +111 -19
- package/ui/components/atoms/vc-card/vc-card.stories.ts +96 -18
- package/ui/components/atoms/vc-checkbox/vc-checkbox.stories.ts +75 -16
- package/ui/components/atoms/vc-col/vc-col.stories.ts +16 -17
- package/ui/components/atoms/vc-hint/vc-hint.stories.ts +18 -16
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +57 -16
- package/ui/components/atoms/vc-image/vc-image.stories.ts +72 -24
- package/ui/components/atoms/vc-label/vc-label.stories.ts +26 -16
- package/ui/components/atoms/vc-link/vc-link.stories.ts +29 -16
- package/ui/components/atoms/vc-loading/vc-loading.stories.ts +11 -16
- package/ui/components/atoms/vc-progress/vc-progress.stories.ts +22 -16
- package/ui/components/atoms/vc-row/vc-row.stories.ts +14 -17
- package/ui/components/atoms/vc-status/vc-status.stories.ts +78 -16
- package/ui/components/atoms/vc-switch/vc-switch.stories.ts +18 -16
- package/ui/components/atoms/vc-video/vc-video.stories.ts +33 -0
- package/ui/components/atoms/vc-widget/vc-widget.stories.ts +13 -17
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +22 -19
- package/ui/components/molecules/vc-editor/vc-editor.stories.ts +24 -16
- package/ui/components/molecules/vc-field/vc-field.stories.ts +114 -0
- package/ui/components/molecules/vc-file-upload/vc-file-upload.stories.ts +34 -16
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +3 -1
- package/ui/components/molecules/vc-form/vc-form.stories.ts +20 -16
- package/ui/components/molecules/vc-input/vc-input.stories.ts +144 -14
- package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +61 -18
- package/ui/components/molecules/vc-multivalue/vc-multivalue.stories.ts +120 -0
- package/ui/components/molecules/vc-pagination/vc-pagination.stories.ts +17 -14
- package/ui/components/molecules/vc-rating/vc-rating.stories.ts +51 -15
- package/ui/components/molecules/vc-select/vc-select.stories.ts +605 -29
- package/ui/components/molecules/vc-select/vc-select.vue +0 -4
- package/ui/components/molecules/vc-slider/vc-slider.stories.ts +34 -21
- package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +46 -14
- package/ui/components/organisms/vc-app/vc-app.stories.ts +204 -51
- package/ui/components/organisms/vc-app/vc-app.vue +31 -24
- package/ui/components/organisms/vc-blade/index.ts +1 -11
- package/ui/components/organisms/vc-blade/vc-blade.stories.ts +60 -16
- package/ui/components/organisms/vc-blade/vc-blade.vue +7 -2
- package/ui/components/organisms/vc-gallery/vc-gallery.stories.ts +68 -24
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +7 -6
- package/ui/components/organisms/vc-popup/vc-popup.vue +7 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +1 -0
- package/ui/components/organisms/vc-table/vc-table.stories.ts +144 -30
- package/ui/components/organisms/vc-table/vc-table.vue +13 -7
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.stories.d.ts +0 -7
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.stories.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.stories.d.ts +0 -7
- package/dist/ui/components/organisms/vc-popup/vc-popup.stories.d.ts.map +0 -1
- package/ui/components/organisms/vc-login-form/vc-login-form.stories.ts +0 -52
- package/ui/components/organisms/vc-popup/vc-popup.stories.ts +0 -21
|
@@ -1,48 +1,61 @@
|
|
|
1
|
-
import type { Meta,
|
|
1
|
+
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
2
2
|
import { VcSlider } from ".";
|
|
3
3
|
import { VcImage, VcIcon } from "../..";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
export default {
|
|
6
6
|
title: "molecules/VcSlider",
|
|
7
7
|
component: VcSlider,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof VcSlider>;
|
|
12
|
-
|
|
13
|
-
export const Primary: Story = {
|
|
14
|
-
render: (args) => ({
|
|
15
|
-
components: { VcSlider, VcImage, VcIcon },
|
|
16
|
-
setup() {
|
|
17
|
-
return { args };
|
|
18
|
-
},
|
|
19
|
-
template:
|
|
20
|
-
'<div class="tw-flex tw-h-[400px] tw-w-full"><vc-slider v-bind="args" class="tw-w-full"><template v-slot:default="{slide}"><div class="tw-w-10"><vc-image :src="slide.url" size="xl"></vc-image></div></template></vc-slider></div>',
|
|
21
|
-
}),
|
|
22
8
|
args: {
|
|
23
9
|
navigation: true,
|
|
24
10
|
slidesPerView: "2",
|
|
11
|
+
overflow: false,
|
|
25
12
|
slides: [
|
|
26
13
|
{
|
|
27
14
|
title: "Title1",
|
|
28
15
|
name: "Name1",
|
|
29
|
-
url: "https://
|
|
16
|
+
url: "https://picsum.photos/400",
|
|
30
17
|
},
|
|
31
18
|
{
|
|
32
19
|
title: "Title2",
|
|
33
20
|
name: "Name2",
|
|
34
|
-
url: "https://
|
|
21
|
+
url: "https://picsum.photos/400",
|
|
35
22
|
},
|
|
36
23
|
{
|
|
37
24
|
title: "Title3",
|
|
38
25
|
name: "Name3",
|
|
39
|
-
url: "https://
|
|
26
|
+
url: "https://picsum.photos/400",
|
|
40
27
|
},
|
|
41
28
|
{
|
|
42
29
|
title: "Title4",
|
|
43
30
|
name: "Name4",
|
|
44
|
-
url: "https://
|
|
31
|
+
url: "https://picsum.photos/400",
|
|
45
32
|
},
|
|
46
33
|
],
|
|
47
34
|
},
|
|
48
|
-
|
|
35
|
+
argTypes: {
|
|
36
|
+
navigation: {
|
|
37
|
+
control: {
|
|
38
|
+
type: "boolean",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
slidesPerView: {
|
|
42
|
+
control: {
|
|
43
|
+
type: "text",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
slides: {
|
|
47
|
+
control: {
|
|
48
|
+
type: "object",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
} satisfies Meta<typeof VcSlider>;
|
|
53
|
+
|
|
54
|
+
export const Primary: StoryFn<typeof VcSlider> = (args) => ({
|
|
55
|
+
components: { VcSlider, VcImage, VcIcon },
|
|
56
|
+
setup() {
|
|
57
|
+
return { args };
|
|
58
|
+
},
|
|
59
|
+
template:
|
|
60
|
+
'<vc-slider v-bind="args" class="tw-w-full"><template v-slot:default="{slide}"><vc-image :src="slide.url"></vc-image></template></vc-slider>',
|
|
61
|
+
});
|
|
@@ -1,21 +1,53 @@
|
|
|
1
|
-
import type { Meta,
|
|
1
|
+
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
2
2
|
import { VcTextarea } from "./";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default {
|
|
5
5
|
title: "molecules/VcTextarea",
|
|
6
6
|
component: VcTextarea,
|
|
7
|
+
args: {
|
|
8
|
+
placeholder: "Placeholder",
|
|
9
|
+
},
|
|
10
|
+
} satisfies Meta<typeof VcTextarea>;
|
|
11
|
+
|
|
12
|
+
export const Primary: StoryFn<typeof VcTextarea> = (args) => ({
|
|
13
|
+
components: { VcTextarea },
|
|
14
|
+
setup() {
|
|
15
|
+
return { args };
|
|
16
|
+
},
|
|
17
|
+
template: '<vc-textarea v-bind="args"></vc-textarea>',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const Label = Primary.bind({});
|
|
21
|
+
Label.args = {
|
|
22
|
+
label: "Textarea Label",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Disabled = Primary.bind({});
|
|
26
|
+
Disabled.args = {
|
|
27
|
+
disabled: true,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Error = Primary.bind({});
|
|
31
|
+
Error.args = {
|
|
32
|
+
errorMessage: "This is an error",
|
|
33
|
+
error: true,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Required = Primary.bind({});
|
|
37
|
+
Required.args = {
|
|
38
|
+
label: "Textarea Label",
|
|
39
|
+
required: true,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Tooltip = Primary.bind({});
|
|
43
|
+
Tooltip.args = {
|
|
44
|
+
tooltip: "This is a tooltip",
|
|
45
|
+
label: "Textarea Label",
|
|
7
46
|
};
|
|
8
47
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
components: { VcTextarea },
|
|
15
|
-
setup() {
|
|
16
|
-
return { args };
|
|
17
|
-
},
|
|
18
|
-
template: '<vc-textarea v-bind="args"></vc-textarea>',
|
|
19
|
-
}),
|
|
20
|
-
args: {},
|
|
48
|
+
export const MaximumCharacters = Primary.bind({});
|
|
49
|
+
MaximumCharacters.args = {
|
|
50
|
+
label: "Textarea Label",
|
|
51
|
+
maxchars: "10",
|
|
52
|
+
modelValue: "1234567890",
|
|
21
53
|
};
|
|
@@ -1,61 +1,214 @@
|
|
|
1
|
-
import type { Meta,
|
|
1
|
+
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
2
2
|
import { VcApp } from "./";
|
|
3
|
+
import { usePopup } from "../../../..";
|
|
4
|
+
import { VcPopup } from "..";
|
|
5
|
+
import { useMenuService } from "../../../../core/composables/useMenuService";
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
export default {
|
|
5
8
|
title: "organisms/VcApp",
|
|
6
9
|
component: VcApp,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj<typeof VcApp>;
|
|
11
|
-
|
|
12
|
-
export const Primary: Story = {
|
|
13
|
-
render: (args) => ({
|
|
14
|
-
components: { VcApp },
|
|
15
|
-
setup() {
|
|
16
|
-
return { args };
|
|
17
|
-
},
|
|
18
|
-
template: '<vc-app v-bind="args"></vc-app>',
|
|
19
|
-
}),
|
|
20
10
|
args: {
|
|
21
|
-
// menuItems: [
|
|
22
|
-
// {
|
|
23
|
-
// title: "Dashboard",
|
|
24
|
-
// icon: "fas fa-home",
|
|
25
|
-
// isVisible: true,
|
|
26
|
-
// },
|
|
27
|
-
// {
|
|
28
|
-
// title: "Orders",
|
|
29
|
-
// icon: "fas fa-file-alt",
|
|
30
|
-
// isVisible: true,
|
|
31
|
-
// },
|
|
32
|
-
// {
|
|
33
|
-
// title: "Products",
|
|
34
|
-
// icon: "fas fa-box-open",
|
|
35
|
-
// isVisible: true,
|
|
36
|
-
// },
|
|
37
|
-
// {
|
|
38
|
-
// title: "Offers",
|
|
39
|
-
// icon: "fas fa-file-invoice",
|
|
40
|
-
// isVisible: true,
|
|
41
|
-
// },
|
|
42
|
-
// {
|
|
43
|
-
// title: "Import",
|
|
44
|
-
// icon: "fas fa-file-import",
|
|
45
|
-
// isVisible: true,
|
|
46
|
-
// },
|
|
47
|
-
// {
|
|
48
|
-
// title: "Logout",
|
|
49
|
-
// icon: "fas fa-sign-out-alt",
|
|
50
|
-
// },
|
|
51
|
-
// ],
|
|
52
|
-
// toolbarItems: [
|
|
53
|
-
// { id: "1", icon: "fas fa-globe", title: "Language selector" },
|
|
54
|
-
// { id: "2", icon: "fas fa-bell", title: "Notifications", isAccent: true },
|
|
55
|
-
// ],
|
|
56
11
|
isReady: true,
|
|
57
|
-
// isAuthorized: true,
|
|
58
12
|
version: "0.0.100",
|
|
13
|
+
title: "VC-Shell Application",
|
|
59
14
|
logo: "images/main-logo.svg",
|
|
60
15
|
},
|
|
16
|
+
decorators: [
|
|
17
|
+
() => ({
|
|
18
|
+
template: `
|
|
19
|
+
<div
|
|
20
|
+
class="tw-h-[600px]"
|
|
21
|
+
style="--app-bar-divider-color: #ffffff;">
|
|
22
|
+
<story/>
|
|
23
|
+
</div>`,
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
} satisfies Meta<typeof VcApp>;
|
|
27
|
+
|
|
28
|
+
export const Primary: StoryFn<typeof VcApp> = (args) => ({
|
|
29
|
+
components: { VcApp },
|
|
30
|
+
setup() {
|
|
31
|
+
const { addMenuItem } = useMenuService();
|
|
32
|
+
|
|
33
|
+
addMenuItem({
|
|
34
|
+
title: "SHELL.MENU.DASHBOARD",
|
|
35
|
+
icon: "fas fa-home",
|
|
36
|
+
priority: 0,
|
|
37
|
+
url: "/",
|
|
38
|
+
});
|
|
39
|
+
return { args };
|
|
40
|
+
},
|
|
41
|
+
template: `
|
|
42
|
+
<vc-app v-bind="args"></vc-app>
|
|
43
|
+
`,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const CustomAppSwitcherSlot: StoryFn<typeof VcApp> = (args) => ({
|
|
47
|
+
components: { VcApp },
|
|
48
|
+
setup() {
|
|
49
|
+
return { args };
|
|
50
|
+
},
|
|
51
|
+
template: `
|
|
52
|
+
<vc-app v-bind="args">
|
|
53
|
+
<template #app-switcher>
|
|
54
|
+
<VcButton>Custom App Switcher</VcButton>
|
|
55
|
+
</template>
|
|
56
|
+
</vc-app>
|
|
57
|
+
`,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
CustomAppSwitcherSlot.parameters = {
|
|
61
|
+
docs: {
|
|
62
|
+
description: {
|
|
63
|
+
story: "You could use the `app-switcher` slot to customize the app switcher or to remove it.",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const CustomToolbarSlot: StoryFn<typeof VcApp> = (args) => ({
|
|
69
|
+
components: { VcApp },
|
|
70
|
+
setup() {
|
|
71
|
+
return { args };
|
|
72
|
+
},
|
|
73
|
+
template: `
|
|
74
|
+
<vc-app v-bind="args">
|
|
75
|
+
<template #toolbar="{
|
|
76
|
+
LanguageSelector,
|
|
77
|
+
UserDropdownButton,
|
|
78
|
+
NotificationDropdown
|
|
79
|
+
}">
|
|
80
|
+
<div class="tw-flex tw-items-center tw-space-x-4">
|
|
81
|
+
<component :is="LanguageSelector" />
|
|
82
|
+
<component :is="UserDropdownButton" />
|
|
83
|
+
<component :is="NotificationDropdown" />
|
|
84
|
+
|
|
85
|
+
<VcButton>Custom Toolbar</VcButton>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
</vc-app>
|
|
89
|
+
`,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
CustomToolbarSlot.parameters = {
|
|
93
|
+
docs: {
|
|
94
|
+
description: {
|
|
95
|
+
story: "You could use the `toolbar` slot to customize the toolbar or to remove it.",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const CustomToolbarPrependSlot: StoryFn<typeof VcApp> = (args) => ({
|
|
101
|
+
components: { VcApp },
|
|
102
|
+
setup() {
|
|
103
|
+
return { args };
|
|
104
|
+
},
|
|
105
|
+
template: `
|
|
106
|
+
<vc-app v-bind="args">
|
|
107
|
+
<template #toolbar:prepend>
|
|
108
|
+
<VcButton>Custom Toolbar Prepend</VcButton>
|
|
109
|
+
</template>
|
|
110
|
+
</vc-app>
|
|
111
|
+
`,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
CustomToolbarPrependSlot.parameters = {
|
|
115
|
+
docs: {
|
|
116
|
+
description: {
|
|
117
|
+
story: "You could use the `toolbar:prepend` slot to prepend content to the toolbar.",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const CustomToolbarLanguageSelectorSlot: StoryFn<typeof VcApp> = (args) => ({
|
|
123
|
+
components: { VcApp },
|
|
124
|
+
setup() {
|
|
125
|
+
const { open } = usePopup({
|
|
126
|
+
component: VcPopup,
|
|
127
|
+
props: {
|
|
128
|
+
title: "Select a language",
|
|
129
|
+
},
|
|
130
|
+
slots: {
|
|
131
|
+
content: "Lorem ipsum dolor",
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
return { args, open };
|
|
135
|
+
},
|
|
136
|
+
template: `
|
|
137
|
+
<vc-app v-bind="args">
|
|
138
|
+
<template #toolbar:language-selector>
|
|
139
|
+
<VcButton @click="open">Click me!</VcButton>
|
|
140
|
+
</template>
|
|
141
|
+
</vc-app>
|
|
142
|
+
`,
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
CustomToolbarLanguageSelectorSlot.parameters = {
|
|
146
|
+
docs: {
|
|
147
|
+
description: {
|
|
148
|
+
story: "You could use the `toolbar:language-selector` slot to customize the language selector or to remove it.",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const CustomNotificationsDropdownSlot: StoryFn<typeof VcApp> = (args) => ({
|
|
154
|
+
components: { VcApp },
|
|
155
|
+
setup() {
|
|
156
|
+
const { open } = usePopup({
|
|
157
|
+
component: VcPopup,
|
|
158
|
+
props: {
|
|
159
|
+
title: "Notifications",
|
|
160
|
+
},
|
|
161
|
+
slots: {
|
|
162
|
+
content: "Lorem ipsum dolor",
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
return { args, open };
|
|
166
|
+
},
|
|
167
|
+
template: `
|
|
168
|
+
<vc-app v-bind="args">
|
|
169
|
+
<template #toolbar:notifications-dropdown>
|
|
170
|
+
<VcButton @click="open">Click me!</VcButton>
|
|
171
|
+
</template>
|
|
172
|
+
</vc-app>
|
|
173
|
+
`,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
CustomNotificationsDropdownSlot.parameters = {
|
|
177
|
+
docs: {
|
|
178
|
+
description: {
|
|
179
|
+
story:
|
|
180
|
+
"You could use the `toolbar:notifications-dropdown` slot to customize the notifications dropdown or to remove it.",
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export const CustomUserDropdownButtonSlot: StoryFn<typeof VcApp> = (args) => ({
|
|
186
|
+
components: { VcApp },
|
|
187
|
+
setup() {
|
|
188
|
+
const { open } = usePopup({
|
|
189
|
+
component: VcPopup,
|
|
190
|
+
props: {
|
|
191
|
+
title: "User",
|
|
192
|
+
},
|
|
193
|
+
slots: {
|
|
194
|
+
content: "Lorem ipsum dolor",
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
return { args, open };
|
|
198
|
+
},
|
|
199
|
+
template: `
|
|
200
|
+
<vc-app v-bind="args">
|
|
201
|
+
<template #toolbar:user-dropdown>
|
|
202
|
+
<VcButton @click="open">Click me!</VcButton>
|
|
203
|
+
</template>
|
|
204
|
+
</vc-app>
|
|
205
|
+
`,
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
CustomUserDropdownButtonSlot.parameters = {
|
|
209
|
+
docs: {
|
|
210
|
+
description: {
|
|
211
|
+
story: "You could use the `toolbar:user-dropdown` slot to customize the user dropdown button or to remove it.",
|
|
212
|
+
},
|
|
213
|
+
},
|
|
61
214
|
};
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
v-else
|
|
9
9
|
class="vc-app tw-flex tw-flex-col tw-w-full tw-h-full tw-box-border tw-m-0 tw-overflow-hidden tw-text-base"
|
|
10
10
|
:class="[
|
|
11
|
-
`vc-theme_${theme}`,
|
|
12
11
|
{
|
|
13
12
|
'vc-app_touch': $isTouch,
|
|
14
13
|
'vc-app_phone': $isPhone.value,
|
|
@@ -27,10 +26,7 @@
|
|
|
27
26
|
@logo:click="openRoot"
|
|
28
27
|
>
|
|
29
28
|
<template #app-switcher>
|
|
30
|
-
<slot
|
|
31
|
-
v-if="!$slots['app-switcher']"
|
|
32
|
-
name="app-switcher"
|
|
33
|
-
>
|
|
29
|
+
<slot name="app-switcher">
|
|
34
30
|
<VcAppSwitcher
|
|
35
31
|
:apps-list="appsList"
|
|
36
32
|
@on-click="switchApp($event)"
|
|
@@ -41,26 +37,34 @@
|
|
|
41
37
|
<!-- Toolbar slot -->
|
|
42
38
|
<template #toolbar>
|
|
43
39
|
<slot
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
name="toolbar"
|
|
41
|
+
v-bind="{
|
|
42
|
+
LanguageSelector,
|
|
43
|
+
UserDropdownButton,
|
|
44
|
+
NotificationDropdown,
|
|
45
|
+
}"
|
|
50
46
|
>
|
|
51
|
-
<LanguageSelector v-if="$isDesktop.value ? $isDesktop.value : $isMobile.value ? route.path === '/' : false" />
|
|
52
|
-
</slot>
|
|
53
|
-
<slot name="toolbar:notifications-dropdown">
|
|
54
|
-
<NotificationDropdown />
|
|
55
|
-
</slot>
|
|
56
|
-
<template v-if="$isDesktop.value">
|
|
57
47
|
<slot
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
>
|
|
61
|
-
|
|
48
|
+
v-if="$slots['toolbar:prepend']"
|
|
49
|
+
name="toolbar:prepend"
|
|
50
|
+
></slot>
|
|
51
|
+
<slot name="toolbar:language-selector">
|
|
52
|
+
<LanguageSelector
|
|
53
|
+
v-if="$isDesktop.value ? $isDesktop.value : $isMobile.value ? route.path === '/' : false"
|
|
54
|
+
/>
|
|
62
55
|
</slot>
|
|
63
|
-
|
|
56
|
+
<slot name="toolbar:notifications-dropdown">
|
|
57
|
+
<NotificationDropdown />
|
|
58
|
+
</slot>
|
|
59
|
+
<template v-if="$isDesktop.value">
|
|
60
|
+
<slot
|
|
61
|
+
name="toolbar:user-dropdown"
|
|
62
|
+
:user-dropdown="UserDropdownButton"
|
|
63
|
+
>
|
|
64
|
+
<UserDropdownButton />
|
|
65
|
+
</slot>
|
|
66
|
+
</template>
|
|
67
|
+
</slot>
|
|
64
68
|
</template>
|
|
65
69
|
</VcAppBar>
|
|
66
70
|
|
|
@@ -116,7 +120,6 @@ export interface Props {
|
|
|
116
120
|
isReady: boolean;
|
|
117
121
|
logo?: string;
|
|
118
122
|
version?: string;
|
|
119
|
-
theme?: "light" | "dark";
|
|
120
123
|
title?: string;
|
|
121
124
|
disableMenu?: boolean;
|
|
122
125
|
}
|
|
@@ -127,7 +130,11 @@ defineOptions({
|
|
|
127
130
|
|
|
128
131
|
defineSlots<{
|
|
129
132
|
"app-switcher": void;
|
|
130
|
-
toolbar:
|
|
133
|
+
toolbar: (props: {
|
|
134
|
+
UserDropdownButton: typeof UserDropdownButton;
|
|
135
|
+
LanguageSelector: typeof LanguageSelector;
|
|
136
|
+
NotificationDropdown: typeof NotificationDropdown;
|
|
137
|
+
}) => void;
|
|
131
138
|
"toolbar:prepend": void;
|
|
132
139
|
"toolbar:language-selector": void;
|
|
133
140
|
"toolbar:notifications-dropdown": void;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import _Blade from "./vc-blade.vue";
|
|
3
|
-
|
|
4
|
-
export const VcBlade = _Blade as typeof _Blade & {
|
|
5
|
-
new (): {
|
|
6
|
-
$slots: {
|
|
7
|
-
actions: () => VNode[];
|
|
8
|
-
default: () => VNode[];
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
};
|
|
1
|
+
export { default as VcBlade } from "./vc-blade.vue";
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import type { Meta,
|
|
1
|
+
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
2
2
|
import { VcBlade } from "./";
|
|
3
|
+
import { onMounted, ref } from "vue";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
export default {
|
|
5
6
|
title: "organisms/VcBlade",
|
|
6
7
|
component: VcBlade,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj<typeof VcBlade>;
|
|
11
|
-
|
|
12
|
-
export const Primary: Story = {
|
|
13
|
-
render: (args) => ({
|
|
14
|
-
components: { VcBlade },
|
|
15
|
-
setup() {
|
|
16
|
-
return { args };
|
|
17
|
-
},
|
|
18
|
-
template: '<vc-blade v-bind="args"><div class="p-4">Blade Contents</div></vc-blade>',
|
|
19
|
-
}),
|
|
20
8
|
args: {
|
|
21
9
|
icon: "fas fa-star",
|
|
22
10
|
title: "My Awesome Blade",
|
|
@@ -36,4 +24,60 @@ export const Primary: Story = {
|
|
|
36
24
|
{ id: "8", icon: "fas fa-cubes", title: "Bulk export", disabled: true },
|
|
37
25
|
],
|
|
38
26
|
},
|
|
39
|
-
}
|
|
27
|
+
decorators: [() => ({ template: "<div><VcPopupContainer/><story/></div>" })],
|
|
28
|
+
} satisfies Meta<typeof VcBlade>;
|
|
29
|
+
|
|
30
|
+
export const Primary: StoryFn<typeof VcBlade> = (args) => ({
|
|
31
|
+
components: { VcBlade },
|
|
32
|
+
setup() {
|
|
33
|
+
return { args };
|
|
34
|
+
},
|
|
35
|
+
template: '<vc-blade v-bind="args"><div class="p-4">Blade Contents</div></vc-blade>',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const BladeWithError: StoryFn<typeof VcBlade> = (args) => ({
|
|
39
|
+
components: { VcBlade },
|
|
40
|
+
setup() {
|
|
41
|
+
const error = ref("This is an error message");
|
|
42
|
+
return { args, error };
|
|
43
|
+
},
|
|
44
|
+
template: '<vc-blade v-bind="args" :error="error"><div class="p-4">Blade Contents</div></vc-blade>',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const BladeWithLoading: StoryFn<typeof VcBlade> = (args) => ({
|
|
48
|
+
components: { VcBlade },
|
|
49
|
+
setup() {
|
|
50
|
+
return { args };
|
|
51
|
+
},
|
|
52
|
+
template: '<vc-blade v-bind="args" v-loading="true"><div class="p-4">Blade Contents</div></vc-blade>',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const ClosableBlade: StoryFn<typeof VcBlade> = (args) => ({
|
|
56
|
+
components: { VcBlade },
|
|
57
|
+
setup() {
|
|
58
|
+
const closeBlade = () => {
|
|
59
|
+
alert("Blade Closed");
|
|
60
|
+
};
|
|
61
|
+
return { args, closeBlade };
|
|
62
|
+
},
|
|
63
|
+
template: '<vc-blade v-bind="args" closable @close="closeBlade"><div class="p-4">Blade Contents</div></vc-blade>',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const ExpandableBlade: StoryFn<typeof VcBlade> = (args) => ({
|
|
67
|
+
components: { VcBlade },
|
|
68
|
+
setup() {
|
|
69
|
+
const expandBlade = () => {
|
|
70
|
+
alert("Blade Expanded");
|
|
71
|
+
};
|
|
72
|
+
return { args, expandBlade };
|
|
73
|
+
},
|
|
74
|
+
template: '<vc-blade v-bind="args" expandable @expand="expandBlade"><div class="p-4">Blade Contents</div></vc-blade>',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const bladeWithoutToolbar: StoryFn<typeof VcBlade> = (args) => ({
|
|
78
|
+
components: { VcBlade },
|
|
79
|
+
setup() {
|
|
80
|
+
return { args };
|
|
81
|
+
},
|
|
82
|
+
template: '<vc-blade v-bind="args" :toolbarItems="[]"><div class="p-4">Blade Contents</div></vc-blade>',
|
|
83
|
+
});
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<script lang="ts" setup>
|
|
63
|
-
import { computed, Ref, reactive, useAttrs, toRefs } from "vue";
|
|
63
|
+
import { computed, Ref, reactive, useAttrs, toRefs, toValue } from "vue";
|
|
64
64
|
import { IBladeToolbar } from "../../../../core/types";
|
|
65
65
|
import { usePopup } from "./../../../../shared";
|
|
66
66
|
import { useI18n } from "vue-i18n";
|
|
@@ -97,6 +97,11 @@ withDefaults(defineProps<Props>(), {
|
|
|
97
97
|
toolbarItems: () => [],
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
+
defineSlots<{
|
|
101
|
+
actions: void;
|
|
102
|
+
default: void;
|
|
103
|
+
}>();
|
|
104
|
+
|
|
100
105
|
defineEmits<Emits>();
|
|
101
106
|
const attrs = useAttrs();
|
|
102
107
|
const { maximized, error }: { maximized?: Ref<boolean>; error?: Ref<string> } = toRefs(reactive(attrs));
|
|
@@ -108,7 +113,7 @@ const { open } = usePopup({
|
|
|
108
113
|
title: t("COMPONENTS.ORGANISMS.VC_BLADE.ERROR_POPUP.TITLE"),
|
|
109
114
|
},
|
|
110
115
|
slots: {
|
|
111
|
-
|
|
116
|
+
default: computed(() => toValue(error)),
|
|
112
117
|
},
|
|
113
118
|
});
|
|
114
119
|
</script>
|