@vc-shell/framework 1.0.187 → 1.0.189
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 +18 -0
- package/core/plugins/moment/humanize.ts +6 -7
- package/dist/core/plugins/moment/humanize.d.ts.map +1 -1
- package/dist/framework.js +5907 -5885
- package/dist/index.css +1 -1
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +4 -1
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts +417 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts +357 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts +398 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts +392 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts +398 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts +372 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts +391 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts +372 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts +439 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts +448 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts +459 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts +359 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts +507 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts +392 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.d.ts +14 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts +395 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts +322 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +113 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +3 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +235 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +4 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +3 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/getters.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts +73 -38
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-switch/index.d.ts +1 -39
- package/dist/ui/components/atoms/vc-switch/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts +30 -11
- package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts +22 -3
- package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-video/index.d.ts +1 -35
- package/dist/ui/components/atoms/vc-video/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts +5 -27
- package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts +3 -18
- package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts +252 -42
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +36 -6
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts +96 -32
- 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 +3 -3
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/modules/dynamic/components/fields/Button.ts +5 -2
- package/shared/modules/dynamic/components/fields/Card.ts +4 -4
- package/shared/modules/dynamic/components/fields/ContentField.ts +1 -0
- package/shared/modules/dynamic/components/fields/DynamicProperty.ts +5 -6
- package/shared/modules/dynamic/components/fields/EditorField.ts +4 -3
- package/shared/modules/dynamic/components/fields/Fieldset.ts +1 -1
- package/shared/modules/dynamic/components/fields/GalleryField.ts +6 -3
- package/shared/modules/dynamic/components/fields/ImageField.ts +0 -1
- package/shared/modules/dynamic/components/fields/InputCurrency.ts +1 -1
- package/shared/modules/dynamic/components/fields/MultivalueField.ts +3 -2
- package/shared/modules/dynamic/components/fields/SelectField.ts +1 -0
- package/shared/modules/dynamic/components/fields/StatusField.ts +20 -10
- package/shared/modules/dynamic/components/fields/VideoField.ts +0 -1
- package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +247 -0
- package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +167 -0
- package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +186 -0
- package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +246 -0
- package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +185 -0
- package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +409 -0
- package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +239 -0
- package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +186 -0
- package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +267 -0
- package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +286 -0
- package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +347 -0
- package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +131 -0
- package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +653 -0
- package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +202 -0
- package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +178 -0
- package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +191 -0
- package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +92 -0
- package/shared/modules/dynamic/components/fields/storybook/common/args.ts +130 -0
- package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +8 -0
- package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +54 -0
- package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +16 -0
- package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +41 -0
- package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +4 -2
- package/shared/modules/dynamic/helpers/getters.ts +3 -0
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +1 -1
- package/shared/modules/dynamic/helpers/setters.ts +1 -1
- package/shared/modules/dynamic/types/index.ts +78 -40
- package/shared/modules/dynamic/types/models.ts +8 -7
- package/ui/components/atoms/vc-card/vc-card.vue +12 -2
- package/ui/components/atoms/vc-switch/index.ts +1 -3
- package/ui/components/atoms/vc-switch/vc-switch.vue +10 -3
- package/ui/components/atoms/vc-video/index.ts +1 -3
- package/ui/components/atoms/vc-video/vc-video.stories.ts +1 -15
- package/ui/components/atoms/vc-video/vc-video.vue +4 -37
- package/ui/components/molecules/vc-editor/vc-editor.vue +28 -9
- package/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue +2 -2
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +8 -0
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +21 -9
- package/ui/components/molecules/vc-select/vc-select.stories.ts +74 -3
- package/ui/components/molecules/vc-select/vc-select.vue +35 -38
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +1 -9
- package/ui/components/organisms/vc-table/vc-table.vue +1 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Meta, StoryFn } from "@storybook/vue3";
|
|
2
|
+
import { ImageSchema } from "../../..";
|
|
3
|
+
import { template, templateWithVisibilityToggle } from "./common/templates";
|
|
4
|
+
import page from "./pages/DynamicRender";
|
|
5
|
+
import { ref, reactive } from "vue";
|
|
6
|
+
import * as _ from "lodash-es";
|
|
7
|
+
import { SchemaBaseArgTypes } from "./common/args";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "DynamicViews/atoms/VcImage",
|
|
11
|
+
component: page,
|
|
12
|
+
args: {
|
|
13
|
+
id: "imageId",
|
|
14
|
+
component: "vc-image",
|
|
15
|
+
property: "mockedProperty",
|
|
16
|
+
size: "xxl",
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
..._.pick(SchemaBaseArgTypes, ["id", "property", "visibility"]),
|
|
20
|
+
component: {
|
|
21
|
+
description: "Component type.",
|
|
22
|
+
type: {
|
|
23
|
+
required: true,
|
|
24
|
+
name: "string",
|
|
25
|
+
},
|
|
26
|
+
table: {
|
|
27
|
+
type: {
|
|
28
|
+
summary: "vc-image",
|
|
29
|
+
},
|
|
30
|
+
defaultValue: {
|
|
31
|
+
summary: "vc-image",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
aspect: {
|
|
36
|
+
description: "Aspect ratio of the image.",
|
|
37
|
+
control: "radio",
|
|
38
|
+
options: ["1x1", "16x9", "4x3", "3x2"],
|
|
39
|
+
table: {
|
|
40
|
+
type: {
|
|
41
|
+
summary: "1x1 | 16x9 | 4x3 | 3x2",
|
|
42
|
+
},
|
|
43
|
+
defaultValue: {
|
|
44
|
+
summary: "1x1",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
description: "Size of the image.",
|
|
50
|
+
control: "radio",
|
|
51
|
+
options: ["auto", "xs", "s", "m", "l", "xl", "xxl"],
|
|
52
|
+
table: {
|
|
53
|
+
type: {
|
|
54
|
+
summary: "auto | xs | s | m | l | xl | xxl",
|
|
55
|
+
},
|
|
56
|
+
defaultValue: {
|
|
57
|
+
summary: "auto",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
background: {
|
|
62
|
+
description: "Size of the element's background image. Accepts auto, cover, contain CSS background-size value.",
|
|
63
|
+
control: "radio",
|
|
64
|
+
options: ["auto", "contain", "cover"],
|
|
65
|
+
table: {
|
|
66
|
+
type: {
|
|
67
|
+
summary: "auto | contain | cover",
|
|
68
|
+
},
|
|
69
|
+
defaultValue: {
|
|
70
|
+
summary: "cover",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
rounded: {
|
|
75
|
+
description: "Rounded image.",
|
|
76
|
+
control: "boolean",
|
|
77
|
+
table: {
|
|
78
|
+
type: {
|
|
79
|
+
summary: "boolean",
|
|
80
|
+
},
|
|
81
|
+
defaultValue: {
|
|
82
|
+
summary: "false",
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
bordered: {
|
|
87
|
+
description: "Bordered image.",
|
|
88
|
+
control: "boolean",
|
|
89
|
+
table: {
|
|
90
|
+
type: {
|
|
91
|
+
summary: "boolean",
|
|
92
|
+
},
|
|
93
|
+
defaultValue: {
|
|
94
|
+
summary: "false",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
parameters: {
|
|
100
|
+
docs: {
|
|
101
|
+
canvas: {
|
|
102
|
+
sourceState: "none",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
} satisfies Meta<ImageSchema>;
|
|
107
|
+
|
|
108
|
+
export const Template: StoryFn<ImageSchema> = (args) => ({
|
|
109
|
+
props: args,
|
|
110
|
+
components: { page },
|
|
111
|
+
setup() {
|
|
112
|
+
const context = {
|
|
113
|
+
item: {
|
|
114
|
+
mockedProperty: "https://picsum.photos/200",
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
args,
|
|
120
|
+
context,
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
template,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export const Rounded = Template.bind({});
|
|
127
|
+
Rounded.args = {
|
|
128
|
+
rounded: true,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const Bordered = Template.bind({});
|
|
132
|
+
Bordered.args = {
|
|
133
|
+
bordered: true,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const Aspect16x9 = Template.bind({});
|
|
137
|
+
Aspect16x9.args = {
|
|
138
|
+
aspect: "16x9",
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Aspect4x3 = Template.bind({});
|
|
142
|
+
Aspect4x3.args = {
|
|
143
|
+
aspect: "4x3",
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const Aspect3x2 = Template.bind({});
|
|
147
|
+
Aspect3x2.args = {
|
|
148
|
+
aspect: "3x2",
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const ExtraSmall = Template.bind({});
|
|
152
|
+
ExtraSmall.args = {
|
|
153
|
+
size: "xs",
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const WithVisibilityMethod: StoryFn<ImageSchema> = (args) => ({
|
|
157
|
+
props: args,
|
|
158
|
+
components: { page },
|
|
159
|
+
setup() {
|
|
160
|
+
const isVisible = ref(false);
|
|
161
|
+
const toggle = () => {
|
|
162
|
+
isVisible.value = !isVisible.value;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const context = reactive({
|
|
166
|
+
item: {
|
|
167
|
+
mockedProperty: "https://picsum.photos/200",
|
|
168
|
+
},
|
|
169
|
+
scope: {
|
|
170
|
+
visibilityMethod: isVisible,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
args,
|
|
176
|
+
context,
|
|
177
|
+
toggle,
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
template: templateWithVisibilityToggle,
|
|
181
|
+
});
|
|
182
|
+
WithVisibilityMethod.args = {
|
|
183
|
+
visibility: {
|
|
184
|
+
method: "visibilityMethod",
|
|
185
|
+
},
|
|
186
|
+
};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { reactive, ref } from "vue";
|
|
2
|
+
import { template, templateWithVisibilityToggle } from "./common/templates";
|
|
3
|
+
import page from "./pages/DynamicRender";
|
|
4
|
+
import { Meta, StoryFn } from "@storybook/vue3";
|
|
5
|
+
import { InputCurrencySchema } from "../../..";
|
|
6
|
+
import * as _ from "lodash-es";
|
|
7
|
+
import { SchemaBaseArgTypes } from "./common/args";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "DynamicViews/molecules/VcInputCurrency",
|
|
11
|
+
component: page,
|
|
12
|
+
args: {
|
|
13
|
+
id: "inputCurrencyId",
|
|
14
|
+
component: "vc-input-currency",
|
|
15
|
+
property: "mockedProperty",
|
|
16
|
+
optionProperty: "currency",
|
|
17
|
+
options: "currencies",
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
..._.omit(SchemaBaseArgTypes, ["multilanguage"]),
|
|
21
|
+
component: {
|
|
22
|
+
description: "Component type.",
|
|
23
|
+
type: {
|
|
24
|
+
required: true,
|
|
25
|
+
name: "string",
|
|
26
|
+
},
|
|
27
|
+
table: {
|
|
28
|
+
type: {
|
|
29
|
+
summary: "vc-input-currency",
|
|
30
|
+
},
|
|
31
|
+
defaultValue: {
|
|
32
|
+
summary: "vc-input-currency",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
options: {
|
|
37
|
+
description: `List of currency options to be displayed in the dropdown.
|
|
38
|
+
Array should be defined in the blade \`scope\``,
|
|
39
|
+
type: {
|
|
40
|
+
required: true,
|
|
41
|
+
name: "string",
|
|
42
|
+
},
|
|
43
|
+
table: {
|
|
44
|
+
type: {
|
|
45
|
+
summary: "array",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
optionProperty: {
|
|
50
|
+
description: "Name of property that holds currency value.",
|
|
51
|
+
type: {
|
|
52
|
+
required: true,
|
|
53
|
+
name: "string",
|
|
54
|
+
},
|
|
55
|
+
table: {
|
|
56
|
+
type: {
|
|
57
|
+
summary: "string",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
optionValue: {
|
|
62
|
+
description: "Property of optionProperty which holds the `value`",
|
|
63
|
+
type: {
|
|
64
|
+
required: true,
|
|
65
|
+
name: "string",
|
|
66
|
+
},
|
|
67
|
+
table: {
|
|
68
|
+
type: {
|
|
69
|
+
summary: "string",
|
|
70
|
+
},
|
|
71
|
+
defaultValue: {
|
|
72
|
+
summary: "id",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
optionLabel: {
|
|
77
|
+
description: "Property of optionProperty which holds the `label`",
|
|
78
|
+
type: {
|
|
79
|
+
required: true,
|
|
80
|
+
name: "string",
|
|
81
|
+
},
|
|
82
|
+
table: {
|
|
83
|
+
type: {
|
|
84
|
+
summary: "string",
|
|
85
|
+
},
|
|
86
|
+
defaultValue: {
|
|
87
|
+
summary: "title",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
clearable: {
|
|
92
|
+
description: "Whether the input-currency is clearable or not.",
|
|
93
|
+
table: {
|
|
94
|
+
type: {
|
|
95
|
+
summary: "boolean",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
parameters: {
|
|
101
|
+
docs: {
|
|
102
|
+
canvas: {
|
|
103
|
+
sourceState: "none",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
} satisfies Meta<InputCurrencySchema>;
|
|
108
|
+
|
|
109
|
+
export const Template: StoryFn<InputCurrencySchema> = (args) => ({
|
|
110
|
+
components: { page },
|
|
111
|
+
setup() {
|
|
112
|
+
const context = reactive({
|
|
113
|
+
item: {
|
|
114
|
+
mockedProperty: 1234,
|
|
115
|
+
currency: "USD",
|
|
116
|
+
},
|
|
117
|
+
scope: {
|
|
118
|
+
currencies: [
|
|
119
|
+
{ id: "USD", title: "USD" },
|
|
120
|
+
{ id: "EUR", title: "EUR" },
|
|
121
|
+
{ id: "GBP", title: "GBP" },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return { args, context };
|
|
127
|
+
},
|
|
128
|
+
template,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const WithLabel = Template.bind({});
|
|
132
|
+
WithLabel.args = {
|
|
133
|
+
label: "Input Currency Label",
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const WithTooltip = WithLabel.bind({});
|
|
137
|
+
WithTooltip.args = {
|
|
138
|
+
label: "Input Currency Label",
|
|
139
|
+
tooltip: "Input Currency Tooltip",
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const WithPlaceholder: StoryFn<InputCurrencySchema> = (args) => ({
|
|
143
|
+
components: { page },
|
|
144
|
+
setup() {
|
|
145
|
+
const context = reactive({
|
|
146
|
+
item: {
|
|
147
|
+
mockedProperty: null,
|
|
148
|
+
currency: "USD",
|
|
149
|
+
},
|
|
150
|
+
scope: {
|
|
151
|
+
currencies: [
|
|
152
|
+
{ id: "USD", title: "USD" },
|
|
153
|
+
{ id: "EUR", title: "EUR" },
|
|
154
|
+
{ id: "GBP", title: "GBP" },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
return { args, context };
|
|
159
|
+
},
|
|
160
|
+
template,
|
|
161
|
+
});
|
|
162
|
+
WithPlaceholder.args = {
|
|
163
|
+
label: "Input Currency Label",
|
|
164
|
+
placeholder: "Input Currency Placeholder",
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const WithValidation = WithPlaceholder.bind({});
|
|
168
|
+
WithValidation.args = {
|
|
169
|
+
label: "Input Currency Label",
|
|
170
|
+
placeholder: "Input Currency Placeholder",
|
|
171
|
+
rules: { required: true },
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export const WithDisabled: StoryFn<InputCurrencySchema> = (args) => ({
|
|
175
|
+
components: { page },
|
|
176
|
+
setup() {
|
|
177
|
+
const context = reactive({
|
|
178
|
+
item: {
|
|
179
|
+
mockedProperty: 1234,
|
|
180
|
+
currency: "USD",
|
|
181
|
+
},
|
|
182
|
+
scope: {
|
|
183
|
+
currencies: [
|
|
184
|
+
{ id: "USD", title: "USD" },
|
|
185
|
+
{ id: "EUR", title: "EUR" },
|
|
186
|
+
{ id: "GBP", title: "GBP" },
|
|
187
|
+
],
|
|
188
|
+
disabledFn: true,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
return { args, context };
|
|
192
|
+
},
|
|
193
|
+
template,
|
|
194
|
+
});
|
|
195
|
+
WithDisabled.args = {
|
|
196
|
+
label: "Input Currency Label",
|
|
197
|
+
disabled: { method: "disabledFn" },
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export const WithVisibilityMethod: StoryFn<InputCurrencySchema> = (args) => ({
|
|
201
|
+
components: { page },
|
|
202
|
+
setup() {
|
|
203
|
+
const isVisible = ref(false);
|
|
204
|
+
const toggle = () => {
|
|
205
|
+
isVisible.value = !isVisible.value;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const context = reactive({
|
|
209
|
+
item: {
|
|
210
|
+
mockedProperty: 1234,
|
|
211
|
+
currency: "USD",
|
|
212
|
+
},
|
|
213
|
+
scope: {
|
|
214
|
+
currencies: [
|
|
215
|
+
{ id: "USD", title: "USD" },
|
|
216
|
+
{ id: "EUR", title: "EUR" },
|
|
217
|
+
{ id: "GBP", title: "GBP" },
|
|
218
|
+
],
|
|
219
|
+
visibilityFn: isVisible,
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
return { args, context, toggle };
|
|
223
|
+
},
|
|
224
|
+
template: templateWithVisibilityToggle,
|
|
225
|
+
});
|
|
226
|
+
WithVisibilityMethod.args = {
|
|
227
|
+
label: "Input Currency Label",
|
|
228
|
+
visibility: { method: "visibilityFn" },
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const WithUpdateMethod: StoryFn<InputCurrencySchema> = (args) => ({
|
|
232
|
+
components: { page },
|
|
233
|
+
setup() {
|
|
234
|
+
const context = reactive({
|
|
235
|
+
item: {
|
|
236
|
+
mockedProperty: null,
|
|
237
|
+
currency: "USD",
|
|
238
|
+
},
|
|
239
|
+
scope: {
|
|
240
|
+
currencies: [
|
|
241
|
+
{ id: "USD", title: "USD" },
|
|
242
|
+
{ id: "EUR", title: "EUR" },
|
|
243
|
+
{ id: "GBP", title: "GBP" },
|
|
244
|
+
],
|
|
245
|
+
updateFn: (value: string) => alert(`Value updated to: ${value}`),
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
return { args, context };
|
|
249
|
+
},
|
|
250
|
+
template,
|
|
251
|
+
});
|
|
252
|
+
WithUpdateMethod.args = {
|
|
253
|
+
label: "Input Currency Label",
|
|
254
|
+
update: { method: "updateFn" },
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const WithClearable = Template.bind({});
|
|
258
|
+
WithClearable.args = {
|
|
259
|
+
label: "Input Currency Label",
|
|
260
|
+
clearable: true,
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const WithHorizontalSeparator = Template.bind({});
|
|
264
|
+
WithHorizontalSeparator.args = {
|
|
265
|
+
label: "Input Currency Label",
|
|
266
|
+
horizontalSeparator: true,
|
|
267
|
+
};
|