@vc-shell/framework 1.0.188 → 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.
Files changed (147) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/core/plugins/moment/humanize.ts +6 -7
  3. package/dist/core/plugins/moment/humanize.d.ts.map +1 -1
  4. package/dist/framework.js +5719 -5699
  5. package/dist/index.css +1 -1
  6. package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
  7. package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
  8. package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
  9. package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +4 -1
  10. package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
  11. package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
  12. package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
  13. package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -1
  14. package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
  15. package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
  16. package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
  17. package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts +417 -0
  18. package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts.map +1 -0
  19. package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts +357 -0
  20. package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts.map +1 -0
  21. package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts +398 -0
  22. package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts.map +1 -0
  23. package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts +392 -0
  24. package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts.map +1 -0
  25. package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts +398 -0
  26. package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts.map +1 -0
  27. package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts +372 -0
  28. package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts.map +1 -0
  29. package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts +391 -0
  30. package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts.map +1 -0
  31. package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts +372 -0
  32. package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts.map +1 -0
  33. package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts +439 -0
  34. package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts.map +1 -0
  35. package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts +448 -0
  36. package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts.map +1 -0
  37. package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts +459 -0
  38. package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts.map +1 -0
  39. package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts +359 -0
  40. package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts.map +1 -0
  41. package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts +507 -0
  42. package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts.map +1 -0
  43. package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts +392 -0
  44. package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts.map +1 -0
  45. package/dist/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.d.ts +14 -0
  46. package/dist/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.d.ts.map +1 -0
  47. package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts +395 -0
  48. package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts.map +1 -0
  49. package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts +322 -0
  50. package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts.map +1 -0
  51. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +113 -0
  52. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +1 -0
  53. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +3 -0
  54. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +1 -0
  55. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +235 -0
  56. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +1 -0
  57. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +4 -0
  58. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +1 -0
  59. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +3 -0
  60. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +1 -0
  61. package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
  62. package/dist/shared/modules/dynamic/helpers/getters.d.ts.map +1 -1
  63. package/dist/shared/modules/dynamic/types/index.d.ts +73 -38
  64. package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
  65. package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
  66. package/dist/tsconfig.tsbuildinfo +1 -1
  67. package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
  68. package/dist/ui/components/atoms/vc-switch/index.d.ts +1 -39
  69. package/dist/ui/components/atoms/vc-switch/index.d.ts.map +1 -1
  70. package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts +30 -11
  71. package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts.map +1 -1
  72. package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts +22 -3
  73. package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts.map +1 -1
  74. package/dist/ui/components/atoms/vc-video/index.d.ts +1 -35
  75. package/dist/ui/components/atoms/vc-video/index.d.ts.map +1 -1
  76. package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts +5 -27
  77. package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts.map +1 -1
  78. package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts +3 -18
  79. package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts.map +1 -1
  80. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  81. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  82. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts +252 -42
  83. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts.map +1 -1
  84. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +36 -6
  85. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
  86. package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts +96 -32
  87. package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts.map +1 -1
  88. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +3 -3
  89. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  90. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
  91. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  92. package/package.json +4 -4
  93. package/shared/modules/dynamic/components/fields/Button.ts +5 -2
  94. package/shared/modules/dynamic/components/fields/Card.ts +4 -4
  95. package/shared/modules/dynamic/components/fields/ContentField.ts +1 -0
  96. package/shared/modules/dynamic/components/fields/DynamicProperty.ts +5 -6
  97. package/shared/modules/dynamic/components/fields/EditorField.ts +4 -3
  98. package/shared/modules/dynamic/components/fields/Fieldset.ts +1 -1
  99. package/shared/modules/dynamic/components/fields/GalleryField.ts +6 -3
  100. package/shared/modules/dynamic/components/fields/ImageField.ts +0 -1
  101. package/shared/modules/dynamic/components/fields/InputCurrency.ts +1 -1
  102. package/shared/modules/dynamic/components/fields/MultivalueField.ts +3 -2
  103. package/shared/modules/dynamic/components/fields/SelectField.ts +1 -0
  104. package/shared/modules/dynamic/components/fields/StatusField.ts +20 -10
  105. package/shared/modules/dynamic/components/fields/VideoField.ts +0 -1
  106. package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +247 -0
  107. package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +167 -0
  108. package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +186 -0
  109. package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +246 -0
  110. package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +185 -0
  111. package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +409 -0
  112. package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +239 -0
  113. package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +186 -0
  114. package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +267 -0
  115. package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +286 -0
  116. package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +347 -0
  117. package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +131 -0
  118. package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +653 -0
  119. package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +202 -0
  120. package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +178 -0
  121. package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +191 -0
  122. package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +92 -0
  123. package/shared/modules/dynamic/components/fields/storybook/common/args.ts +130 -0
  124. package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +8 -0
  125. package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +54 -0
  126. package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +16 -0
  127. package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +41 -0
  128. package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +1 -0
  129. package/shared/modules/dynamic/helpers/getters.ts +3 -0
  130. package/shared/modules/dynamic/helpers/nodeBuilder.ts +1 -1
  131. package/shared/modules/dynamic/helpers/setters.ts +1 -1
  132. package/shared/modules/dynamic/types/index.ts +78 -40
  133. package/shared/modules/dynamic/types/models.ts +8 -7
  134. package/ui/components/atoms/vc-card/vc-card.vue +12 -2
  135. package/ui/components/atoms/vc-switch/index.ts +1 -3
  136. package/ui/components/atoms/vc-switch/vc-switch.vue +10 -3
  137. package/ui/components/atoms/vc-video/index.ts +1 -3
  138. package/ui/components/atoms/vc-video/vc-video.stories.ts +1 -15
  139. package/ui/components/atoms/vc-video/vc-video.vue +4 -37
  140. package/ui/components/molecules/vc-editor/vc-editor.vue +28 -9
  141. package/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue +2 -2
  142. package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +8 -0
  143. package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +21 -9
  144. package/ui/components/molecules/vc-select/vc-select.stories.ts +74 -3
  145. package/ui/components/molecules/vc-select/vc-select.vue +35 -38
  146. package/ui/components/molecules/vc-textarea/vc-textarea.vue +1 -9
  147. package/ui/components/organisms/vc-table/vc-table.vue +1 -0
@@ -0,0 +1,202 @@
1
+ import { Meta, StoryFn } from "@storybook/vue3";
2
+ import { SchemaBaseArgTypes } from "./common/args";
3
+ import * as _ from "lodash-es";
4
+ import page from "./pages/DynamicRender";
5
+ import { template, templateWithVisibilityToggle } from "./common/templates";
6
+ import { computed, reactive, ref } from "vue";
7
+ import { StatusSchema } from "../../..";
8
+
9
+ export default {
10
+ title: "DynamicViews/molecules/VcStatus",
11
+ component: page,
12
+ args: {
13
+ id: "statusFieldId",
14
+ component: "vc-status",
15
+ content: "Success status",
16
+ variant: "success",
17
+ },
18
+ argTypes: {
19
+ ..._.pick(SchemaBaseArgTypes, ["id", "visibility", "horizontalSeparator"]),
20
+ component: {
21
+ description: "Component type for status.",
22
+ type: {
23
+ required: true,
24
+ name: "string",
25
+ },
26
+ table: {
27
+ type: {
28
+ summary: "vc-status",
29
+ },
30
+ defaultValue: {
31
+ summary: "vc-status",
32
+ },
33
+ },
34
+ },
35
+ outline: {
36
+ description: "Whether the status is outlined or not.",
37
+ table: {
38
+ type: {
39
+ summary: "boolean",
40
+ },
41
+ defaultValue: {
42
+ summary: "true",
43
+ },
44
+ },
45
+ },
46
+ extend: {
47
+ description: `Whether the status is extendable or not.`,
48
+ table: {
49
+ type: {
50
+ summary: "boolean",
51
+ },
52
+ defaultValue: {
53
+ summary: "false",
54
+ },
55
+ },
56
+ },
57
+ variant: {
58
+ description: "Status variant.",
59
+ table: {
60
+ type: {
61
+ summary: "info | warning | danger | success | light-danger",
62
+ },
63
+ defaultValue: {
64
+ summary: "info",
65
+ },
66
+ },
67
+ },
68
+ icon: {
69
+ description: "Status icon.",
70
+ control: "text",
71
+ table: {
72
+ type: {
73
+ summary: "string",
74
+ },
75
+ },
76
+ },
77
+ iconSize: {
78
+ description: "Status icon size.",
79
+ control: "radio",
80
+ options: ["xs", "s", "m", "l", "xl", "xxl", "xxxl"],
81
+ table: {
82
+ type: {
83
+ summary: `xs | s | m | l | xl | xxl | xxxl`,
84
+ },
85
+ defaultValue: {
86
+ summary: "m",
87
+ },
88
+ },
89
+ },
90
+ iconVariant: {
91
+ description: "Status icon variant.",
92
+ control: "radio",
93
+ options: ["warning", "danger", "success"],
94
+ table: {
95
+ type: {
96
+ summary: "warning | danger | success",
97
+ },
98
+ },
99
+ },
100
+ title: {
101
+ description: `Status title.
102
+ Supports i18n keys.`,
103
+ table: {
104
+ type: {
105
+ summary: "string",
106
+ },
107
+ },
108
+ },
109
+ content: {
110
+ description: `Used to display the content of the status. It can be a \`string\` or an \`object with a method property\`.
111
+ Method property could be a function or \`computed property\` or \`ref\`, returning a \`string\` value.
112
+ Method should be defined in the blade \`scope\`.
113
+ `,
114
+ type: {
115
+ required: true,
116
+ name: "string",
117
+ },
118
+ table: {
119
+ type: {
120
+ summary: "{ method: string } | string",
121
+ },
122
+ },
123
+ },
124
+ },
125
+ parameters: {
126
+ docs: {
127
+ canvas: {
128
+ sourceState: "none",
129
+ },
130
+ },
131
+ },
132
+ } satisfies Meta<StatusSchema>;
133
+
134
+ export const Template: StoryFn<StatusSchema> = (args) => ({
135
+ components: { page },
136
+ setup() {
137
+ return { args };
138
+ },
139
+ template,
140
+ });
141
+
142
+ export const ContentAsMethod: StoryFn<StatusSchema> = (args) => ({
143
+ components: { page },
144
+ setup() {
145
+ const context = reactive({
146
+ scope: {
147
+ mockedMethod: () => "I am status content",
148
+ },
149
+ });
150
+ return { args, context };
151
+ },
152
+ template,
153
+ });
154
+ ContentAsMethod.args = {
155
+ content: { method: "mockedMethod" },
156
+ };
157
+
158
+ export const ContentAsComputed: StoryFn<StatusSchema> = (args) => ({
159
+ components: { page },
160
+ setup() {
161
+ const context = reactive({
162
+ scope: {
163
+ mockedComputed: computed(() => "I am status content"),
164
+ },
165
+ });
166
+ return { args, context };
167
+ },
168
+ template,
169
+ });
170
+ ContentAsComputed.args = {
171
+ content: { method: "mockedComputed" },
172
+ };
173
+
174
+ export const WithIcon = Template.bind({});
175
+ WithIcon.args = {
176
+ icon: "fas fa-check",
177
+ };
178
+
179
+ export const ExtendedWithTitle = Template.bind({});
180
+ ExtendedWithTitle.args = {
181
+ extend: true,
182
+ title: "Extended status",
183
+ icon: "fas fa-check",
184
+ };
185
+
186
+ export const WithVisibilityMethod: StoryFn<StatusSchema> = (args) => ({
187
+ components: { page },
188
+ setup() {
189
+ const isVisible = ref(false);
190
+ const toggle = () => {
191
+ isVisible.value = !isVisible.value;
192
+ };
193
+
194
+ const context = reactive({
195
+ scope: {
196
+ visibilityFn: isVisible,
197
+ },
198
+ });
199
+ return { args, context, toggle };
200
+ },
201
+ template: templateWithVisibilityToggle,
202
+ });
@@ -0,0 +1,178 @@
1
+ import { SwitchSchema } from "../../..";
2
+ import { Meta, StoryFn } from "@storybook/vue3";
3
+ import { SchemaBaseArgTypes } from "./common/args";
4
+ import * as _ from "lodash-es";
5
+ import page from "./pages/DynamicRender";
6
+ import { template, templateWithVisibilityToggle } from "./common/templates";
7
+ import { reactive, ref } from "vue";
8
+
9
+ export default {
10
+ title: "DynamicViews/molecules/VcSwitch",
11
+ component: page,
12
+ args: {
13
+ id: "switchFieldId",
14
+ component: "vc-switch",
15
+ property: "mockedProperty",
16
+ },
17
+ argTypes: {
18
+ ..._.omit(SchemaBaseArgTypes, ["placeholder", "multilanguage"]),
19
+ component: {
20
+ description: "Component type.",
21
+ type: {
22
+ required: true,
23
+ name: "string",
24
+ },
25
+ table: {
26
+ type: {
27
+ summary: "vc-switch",
28
+ },
29
+ defaultValue: {
30
+ summary: "vc-switch",
31
+ },
32
+ },
33
+ },
34
+ trueValue: {
35
+ description: "Value when switch is on.",
36
+ table: {
37
+ type: {
38
+ summary: "any",
39
+ },
40
+ defaultValue: {
41
+ summary: "true",
42
+ },
43
+ },
44
+ },
45
+ falseValue: {
46
+ description: "Value when switch is off.",
47
+ table: {
48
+ type: {
49
+ summary: "any",
50
+ },
51
+ defaultValue: {
52
+ summary: "false",
53
+ },
54
+ },
55
+ },
56
+ },
57
+ parameters: {
58
+ docs: {
59
+ canvas: {
60
+ sourceState: "none",
61
+ },
62
+ },
63
+ },
64
+ } as Meta<SwitchSchema>;
65
+
66
+ export const Template: StoryFn<SwitchSchema> = (args) => ({
67
+ components: { page },
68
+ setup() {
69
+ const context = reactive({
70
+ item: {
71
+ mockedProperty: true,
72
+ },
73
+ });
74
+ return { args, context };
75
+ },
76
+ template,
77
+ });
78
+
79
+ export const InvertedValues = Template.bind({});
80
+ InvertedValues.args = {
81
+ trueValue: false,
82
+ falseValue: true,
83
+ };
84
+
85
+ export const WithLabel = Template.bind({});
86
+ WithLabel.args = {
87
+ label: "Switch label",
88
+ };
89
+
90
+ export const WithTooltip = WithLabel.bind({});
91
+ WithTooltip.args = {
92
+ tooltip: "Switch tooltip",
93
+ };
94
+
95
+ export const WithValidation = Template.bind({});
96
+ WithValidation.args = {
97
+ label: "Switch label",
98
+ rules: {
99
+ required: true,
100
+ },
101
+ };
102
+
103
+ export const WithDisabled: StoryFn<SwitchSchema> = (args) => ({
104
+ components: { page },
105
+ setup() {
106
+ const context = reactive({
107
+ item: {
108
+ mockedProperty: true,
109
+ },
110
+ scope: {
111
+ disabledFn: true,
112
+ },
113
+ });
114
+ return { args, context };
115
+ },
116
+ template,
117
+ });
118
+ WithDisabled.args = {
119
+ label: "Switch label",
120
+ disabled: {
121
+ method: "disabledFn",
122
+ },
123
+ };
124
+
125
+ export const WithVisibilityMethod: StoryFn<SwitchSchema> = (args) => ({
126
+ components: { page },
127
+ setup() {
128
+ const isVisible = ref(false);
129
+ const toggle = () => {
130
+ isVisible.value = !isVisible.value;
131
+ };
132
+
133
+ const context = reactive({
134
+ item: {
135
+ mockedProperty: true,
136
+ },
137
+ scope: {
138
+ visibilityFn: isVisible,
139
+ },
140
+ });
141
+ return { args, context, toggle };
142
+ },
143
+ template: templateWithVisibilityToggle,
144
+ });
145
+ WithVisibilityMethod.args = {
146
+ label: "Switch label",
147
+ visibility: {
148
+ method: "visibilityFn",
149
+ },
150
+ };
151
+
152
+ export const WithUpdateMethod: StoryFn<SwitchSchema> = (args) => ({
153
+ components: { page },
154
+ setup() {
155
+ const context = reactive({
156
+ item: {
157
+ mockedProperty: true,
158
+ },
159
+ scope: {
160
+ updateFn: (value: string) => alert(`Value updated to: ${value}`),
161
+ },
162
+ });
163
+ return { args, context };
164
+ },
165
+ template,
166
+ });
167
+ WithUpdateMethod.args = {
168
+ label: "Switch label",
169
+ update: {
170
+ method: "updateFn",
171
+ },
172
+ };
173
+
174
+ export const WithHorizontalSeparator = Template.bind({});
175
+ WithHorizontalSeparator.args = {
176
+ label: "Switch label",
177
+ horizontalSeparator: true,
178
+ };
@@ -0,0 +1,191 @@
1
+ import { Meta, StoryFn } from "@storybook/vue3";
2
+ import { TextareaSchema } from "../../..";
3
+ import { SchemaBaseArgTypes } from "./common/args";
4
+ import page from "./pages/DynamicRender";
5
+ import { template, templateWithVisibilityToggle } from "./common/templates";
6
+ import { reactive, ref } from "vue";
7
+
8
+ export default {
9
+ title: "DynamicViews/molecules/VcTextarea",
10
+ component: page,
11
+ args: {
12
+ id: "textareaId",
13
+ component: "vc-textarea",
14
+ property: "mockedProperty",
15
+ },
16
+ argTypes: {
17
+ ...SchemaBaseArgTypes,
18
+ component: {
19
+ description: "Component type.",
20
+ type: {
21
+ required: true,
22
+ name: "string",
23
+ },
24
+ table: {
25
+ type: {
26
+ summary: "vc-textarea",
27
+ },
28
+ defaultValue: {
29
+ summary: "vc-textarea",
30
+ },
31
+ },
32
+ },
33
+ clearable: {
34
+ description: "Whether the textarea is clearable or not.",
35
+ table: {
36
+ type: {
37
+ summary: "boolean",
38
+ },
39
+ },
40
+ },
41
+ },
42
+ parameters: {
43
+ docs: {
44
+ canvas: {
45
+ sourceState: "none",
46
+ },
47
+ },
48
+ },
49
+ } satisfies Meta<TextareaSchema>;
50
+
51
+ export const Template: StoryFn<TextareaSchema> = (args) => ({
52
+ components: { page },
53
+ setup() {
54
+ const context = reactive({
55
+ item: {
56
+ mockedProperty: "I am input field",
57
+ },
58
+ });
59
+ return { args, context };
60
+ },
61
+ template,
62
+ });
63
+
64
+ export const WithPlaceholder: StoryFn<TextareaSchema> = (args) => ({
65
+ components: { page },
66
+ setup() {
67
+ const context = reactive({
68
+ item: {
69
+ mockedProperty: "",
70
+ },
71
+ });
72
+ return { args, context };
73
+ },
74
+ template,
75
+ });
76
+ WithPlaceholder.args = {
77
+ placeholder: "Textarea placeholder",
78
+ };
79
+
80
+ export const WithLabel = Template.bind({});
81
+ WithLabel.args = {
82
+ label: "Textarea label",
83
+ };
84
+
85
+ export const WithTooltip = Template.bind({});
86
+ WithTooltip.args = {
87
+ label: "Textarea label",
88
+ tooltip: "Textarea tooltip",
89
+ };
90
+
91
+ export const WithValidation: StoryFn<TextareaSchema> = (args) => ({
92
+ components: { page },
93
+ setup() {
94
+ const context = reactive({
95
+ item: {
96
+ mockedProperty: null,
97
+ },
98
+ });
99
+ return { args, context };
100
+ },
101
+ template,
102
+ });
103
+ WithValidation.args = {
104
+ label: "Textarea label",
105
+ placeholder: "Enter text here",
106
+ rules: {
107
+ required: true,
108
+ },
109
+ };
110
+
111
+ export const WithDisabled: StoryFn<TextareaSchema> = (args) => ({
112
+ components: { page },
113
+ setup() {
114
+ const context = reactive({
115
+ item: {
116
+ mockedProperty: "I am input field",
117
+ },
118
+ scope: {
119
+ disabledFn: true,
120
+ },
121
+ });
122
+ return { args, context };
123
+ },
124
+ template,
125
+ });
126
+ WithDisabled.args = {
127
+ label: "Textarea label",
128
+ disabled: {
129
+ method: "disabledFn",
130
+ },
131
+ };
132
+
133
+ export const WithClearable = Template.bind({});
134
+ WithClearable.args = {
135
+ label: "Textarea label",
136
+ clearable: true,
137
+ };
138
+
139
+ export const WithVisibilityMethod: StoryFn<TextareaSchema> = (args) => ({
140
+ components: { page },
141
+ setup() {
142
+ const isVisible = ref(false);
143
+ const toggle = () => {
144
+ isVisible.value = !isVisible.value;
145
+ };
146
+
147
+ const context = reactive({
148
+ item: {
149
+ mockedProperty: "I am input field",
150
+ },
151
+ scope: {
152
+ visibilityFn: isVisible,
153
+ },
154
+ });
155
+
156
+ return { args, context, toggle };
157
+ },
158
+ template: templateWithVisibilityToggle,
159
+ });
160
+ WithVisibilityMethod.args = {
161
+ label: "Textarea label",
162
+ visibility: { method: "visibilityFn" },
163
+ };
164
+
165
+ export const WithUpdateMethod: StoryFn<TextareaSchema> = (args) => ({
166
+ components: { page },
167
+ setup() {
168
+ const context = reactive({
169
+ item: {
170
+ mockedProperty: "I am input field",
171
+ },
172
+ scope: {
173
+ updateFn: (value: string) => alert(`Value updated to: ${value}`),
174
+ },
175
+ });
176
+ return { args, context };
177
+ },
178
+ template,
179
+ });
180
+ WithUpdateMethod.args = {
181
+ label: "Textarea label",
182
+ update: {
183
+ method: "updateFn",
184
+ },
185
+ };
186
+
187
+ export const WithHorizontalSeparator = Template.bind({});
188
+ WithHorizontalSeparator.args = {
189
+ label: "Textarea label",
190
+ horizontalSeparator: true,
191
+ };
@@ -0,0 +1,92 @@
1
+ import { Meta, StoryFn } from "@storybook/vue3";
2
+ import { VideoSchema } from "../../..";
3
+ import { template, templateWithVisibilityToggle } from "./common/templates";
4
+ import page from "./pages/DynamicRender";
5
+ import * as _ from "lodash-es";
6
+ import { SchemaBaseArgTypes } from "./common/args";
7
+ import { reactive, ref } from "vue";
8
+
9
+ export default {
10
+ title: "DynamicViews/atoms/VcVideo",
11
+ component: page,
12
+ args: {
13
+ id: "videoFieldId",
14
+ component: "vc-video",
15
+ property: "mockedProperty",
16
+ },
17
+ argTypes: {
18
+ ..._.pick(SchemaBaseArgTypes, ["id", "property", "label", "visibility", "tooltip"]),
19
+ component: {
20
+ description: "Component type.",
21
+ type: {
22
+ required: true,
23
+ name: "string",
24
+ },
25
+ table: {
26
+ type: {
27
+ summary: "vc-video",
28
+ },
29
+ defaultValue: {
30
+ summary: "vc-video",
31
+ },
32
+ },
33
+ },
34
+ },
35
+ parameters: {
36
+ docs: {
37
+ canvas: {
38
+ sourceState: "none",
39
+ },
40
+ },
41
+ },
42
+ } satisfies Meta<VideoSchema>;
43
+
44
+ export const Template: StoryFn<VideoSchema> = (args) => ({
45
+ components: { page },
46
+ setup() {
47
+ const context = reactive({
48
+ item: {
49
+ mockedProperty: "https://www.youtube.com/embed/PeXX-V-dwpA",
50
+ },
51
+ });
52
+ return { args, context };
53
+ },
54
+ template,
55
+ });
56
+
57
+ export const WithLabel = Template.bind({});
58
+ WithLabel.args = {
59
+ label: "Video label",
60
+ };
61
+
62
+ export const WithTooltip = Template.bind({});
63
+ WithTooltip.args = {
64
+ label: "Video label",
65
+ tooltip: "Video tooltip",
66
+ };
67
+
68
+ export const WithVisibility: StoryFn<VideoSchema> = (args) => ({
69
+ components: { page },
70
+ setup() {
71
+ const isVisible = ref(false);
72
+ const toggle = () => {
73
+ isVisible.value = !isVisible.value;
74
+ };
75
+
76
+ const context = reactive({
77
+ item: {
78
+ mockedProperty: "https://www.youtube.com/embed/PeXX-V-dwpA",
79
+ },
80
+ scope: {
81
+ visibilityFn: isVisible,
82
+ },
83
+ });
84
+ return { args, context, toggle };
85
+ },
86
+ template: templateWithVisibilityToggle,
87
+ });
88
+ WithVisibility.args = {
89
+ visibility: {
90
+ method: "visibilityFn",
91
+ },
92
+ };