@vc-shell/framework 1.0.188 → 1.0.190

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 (181) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/core/plugins/moment/humanize.ts +6 -7
  3. package/core/types/index.ts +12 -1
  4. package/dist/core/plugins/moment/humanize.d.ts.map +1 -1
  5. package/dist/core/types/index.d.ts +1 -1
  6. package/dist/core/types/index.d.ts.map +1 -1
  7. package/dist/framework.js +30782 -20187
  8. package/dist/index.css +1 -1
  9. package/dist/shared/components/error-interceptor/interceptor.d.ts.map +1 -1
  10. package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
  11. package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
  12. package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
  13. package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +4 -1
  14. package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
  15. package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
  16. package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
  17. package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -1
  18. package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -1
  19. package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
  20. package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
  21. package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts.map +1 -1
  22. package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
  23. package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts +417 -0
  24. package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts.map +1 -0
  25. package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts +357 -0
  26. package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts.map +1 -0
  27. package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts +398 -0
  28. package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts.map +1 -0
  29. package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts +392 -0
  30. package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts.map +1 -0
  31. package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts +407 -0
  32. package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts.map +1 -0
  33. package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts +372 -0
  34. package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts.map +1 -0
  35. package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts +391 -0
  36. package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts.map +1 -0
  37. package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts +372 -0
  38. package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts.map +1 -0
  39. package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts +439 -0
  40. package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts.map +1 -0
  41. package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts +460 -0
  42. package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts.map +1 -0
  43. package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts +459 -0
  44. package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts.map +1 -0
  45. package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts +359 -0
  46. package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts.map +1 -0
  47. package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts +507 -0
  48. package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts.map +1 -0
  49. package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts +392 -0
  50. package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts.map +1 -0
  51. package/dist/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.d.ts +14 -0
  52. package/dist/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.d.ts.map +1 -0
  53. package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts +407 -0
  54. package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts.map +1 -0
  55. package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts +322 -0
  56. package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts.map +1 -0
  57. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +113 -0
  58. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +1 -0
  59. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +3 -0
  60. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +1 -0
  61. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +235 -0
  62. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +1 -0
  63. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +4 -0
  64. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +1 -0
  65. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +3 -0
  66. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +1 -0
  67. package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
  68. package/dist/shared/modules/dynamic/factories/types/index.d.ts +1 -0
  69. package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
  70. package/dist/shared/modules/dynamic/helpers/getters.d.ts.map +1 -1
  71. package/dist/shared/modules/dynamic/types/index.d.ts +88 -38
  72. package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
  73. package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
  74. package/dist/tsconfig.tsbuildinfo +1 -1
  75. package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +16 -16
  76. package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
  77. package/dist/ui/components/atoms/vc-switch/index.d.ts +1 -39
  78. package/dist/ui/components/atoms/vc-switch/index.d.ts.map +1 -1
  79. package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts +30 -11
  80. package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts.map +1 -1
  81. package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts +22 -3
  82. package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts.map +1 -1
  83. package/dist/ui/components/atoms/vc-video/index.d.ts +1 -35
  84. package/dist/ui/components/atoms/vc-video/index.d.ts.map +1 -1
  85. package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts +5 -27
  86. package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts.map +1 -1
  87. package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts +3 -18
  88. package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts.map +1 -1
  89. package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts +16 -4
  90. package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts.map +1 -1
  91. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +2 -1
  92. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  93. package/dist/ui/components/molecules/vc-input/vc-input.stories.d.ts +30 -16
  94. package/dist/ui/components/molecules/vc-input/vc-input.stories.d.ts.map +1 -1
  95. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts +12 -12
  96. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  97. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts +252 -42
  98. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts.map +1 -1
  99. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +36 -6
  100. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
  101. package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts +96 -32
  102. package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts.map +1 -1
  103. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +3 -3
  104. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  105. package/dist/ui/components/molecules/vc-textarea/vc-textarea.stories.d.ts +63 -63
  106. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts +6 -6
  107. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
  108. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts +1 -0
  109. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
  110. package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts.map +1 -1
  111. package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts +8 -2
  112. package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts.map +1 -1
  113. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +3 -1
  114. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  115. package/package.json +8 -4
  116. package/shared/components/error-interceptor/interceptor.ts +1 -1
  117. package/shared/modules/dynamic/components/fields/Button.ts +5 -2
  118. package/shared/modules/dynamic/components/fields/Card.ts +4 -4
  119. package/shared/modules/dynamic/components/fields/ContentField.ts +1 -0
  120. package/shared/modules/dynamic/components/fields/DynamicProperty.ts +5 -6
  121. package/shared/modules/dynamic/components/fields/EditorField.ts +5 -3
  122. package/shared/modules/dynamic/components/fields/Fieldset.ts +1 -1
  123. package/shared/modules/dynamic/components/fields/GalleryField.ts +6 -3
  124. package/shared/modules/dynamic/components/fields/ImageField.ts +0 -1
  125. package/shared/modules/dynamic/components/fields/InputCurrency.ts +1 -1
  126. package/shared/modules/dynamic/components/fields/InputField.ts +1 -0
  127. package/shared/modules/dynamic/components/fields/MultivalueField.ts +3 -2
  128. package/shared/modules/dynamic/components/fields/SelectField.ts +1 -0
  129. package/shared/modules/dynamic/components/fields/StatusField.ts +20 -10
  130. package/shared/modules/dynamic/components/fields/TextareaField.ts +1 -0
  131. package/shared/modules/dynamic/components/fields/VideoField.ts +0 -1
  132. package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +247 -0
  133. package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +166 -0
  134. package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +185 -0
  135. package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +245 -0
  136. package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +192 -0
  137. package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +409 -0
  138. package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +239 -0
  139. package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +186 -0
  140. package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +267 -0
  141. package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +298 -0
  142. package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +347 -0
  143. package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +131 -0
  144. package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +653 -0
  145. package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +202 -0
  146. package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +178 -0
  147. package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +203 -0
  148. package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +92 -0
  149. package/shared/modules/dynamic/components/fields/storybook/common/args.ts +130 -0
  150. package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +8 -0
  151. package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +54 -0
  152. package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +16 -0
  153. package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +41 -0
  154. package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +1 -0
  155. package/shared/modules/dynamic/factories/types/index.ts +2 -0
  156. package/shared/modules/dynamic/helpers/getters.ts +3 -0
  157. package/shared/modules/dynamic/helpers/nodeBuilder.ts +1 -1
  158. package/shared/modules/dynamic/helpers/setters.ts +1 -1
  159. package/shared/modules/dynamic/types/index.ts +93 -40
  160. package/shared/modules/dynamic/types/models.ts +8 -7
  161. package/shared/pages/LoginPage/components/login/Login.vue +1 -1
  162. package/ui/components/atoms/vc-card/vc-card.vue +12 -2
  163. package/ui/components/atoms/vc-switch/index.ts +1 -3
  164. package/ui/components/atoms/vc-switch/vc-switch.vue +10 -3
  165. package/ui/components/atoms/vc-video/index.ts +1 -3
  166. package/ui/components/atoms/vc-video/vc-video.stories.ts +1 -15
  167. package/ui/components/atoms/vc-video/vc-video.vue +4 -37
  168. package/ui/components/molecules/vc-editor/vc-editor.vue +47 -33
  169. package/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue +2 -2
  170. package/ui/components/molecules/vc-input/vc-input.stories.ts +14 -0
  171. package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +8 -0
  172. package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +21 -9
  173. package/ui/components/molecules/vc-select/vc-select.stories.ts +74 -3
  174. package/ui/components/molecules/vc-select/vc-select.vue +35 -38
  175. package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +1 -1
  176. package/ui/components/molecules/vc-textarea/vc-textarea.vue +5 -15
  177. package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +1 -1
  178. package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +140 -108
  179. package/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue +20 -6
  180. package/ui/components/organisms/vc-table/vc-table.stories.ts +6 -2
  181. package/ui/components/organisms/vc-table/vc-table.vue +176 -124
@@ -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,203 @@
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
+ maxlength: {
42
+ description: "Maximum number of characters that can be entered.",
43
+ control: "number",
44
+ table: {
45
+ type: {
46
+ summary: "number",
47
+ },
48
+ defaultValue: {
49
+ summary: "1024",
50
+ },
51
+ },
52
+ },
53
+ },
54
+ parameters: {
55
+ docs: {
56
+ canvas: {
57
+ sourceState: "none",
58
+ },
59
+ },
60
+ },
61
+ } satisfies Meta<TextareaSchema>;
62
+
63
+ export const Template: StoryFn<TextareaSchema> = (args) => ({
64
+ components: { page },
65
+ setup() {
66
+ const context = reactive({
67
+ item: {
68
+ mockedProperty: "I am input field",
69
+ },
70
+ });
71
+ return { args, context };
72
+ },
73
+ template,
74
+ });
75
+
76
+ export const WithPlaceholder: StoryFn<TextareaSchema> = (args) => ({
77
+ components: { page },
78
+ setup() {
79
+ const context = reactive({
80
+ item: {
81
+ mockedProperty: "",
82
+ },
83
+ });
84
+ return { args, context };
85
+ },
86
+ template,
87
+ });
88
+ WithPlaceholder.args = {
89
+ placeholder: "Textarea placeholder",
90
+ };
91
+
92
+ export const WithLabel = Template.bind({});
93
+ WithLabel.args = {
94
+ label: "Textarea label",
95
+ };
96
+
97
+ export const WithTooltip = Template.bind({});
98
+ WithTooltip.args = {
99
+ label: "Textarea label",
100
+ tooltip: "Textarea tooltip",
101
+ };
102
+
103
+ export const WithValidation: StoryFn<TextareaSchema> = (args) => ({
104
+ components: { page },
105
+ setup() {
106
+ const context = reactive({
107
+ item: {
108
+ mockedProperty: null,
109
+ },
110
+ });
111
+ return { args, context };
112
+ },
113
+ template,
114
+ });
115
+ WithValidation.args = {
116
+ label: "Textarea label",
117
+ placeholder: "Enter text here",
118
+ rules: {
119
+ required: true,
120
+ },
121
+ };
122
+
123
+ export const WithDisabled: StoryFn<TextareaSchema> = (args) => ({
124
+ components: { page },
125
+ setup() {
126
+ const context = reactive({
127
+ item: {
128
+ mockedProperty: "I am input field",
129
+ },
130
+ scope: {
131
+ disabledFn: true,
132
+ },
133
+ });
134
+ return { args, context };
135
+ },
136
+ template,
137
+ });
138
+ WithDisabled.args = {
139
+ label: "Textarea label",
140
+ disabled: {
141
+ method: "disabledFn",
142
+ },
143
+ };
144
+
145
+ export const WithClearable = Template.bind({});
146
+ WithClearable.args = {
147
+ label: "Textarea label",
148
+ clearable: true,
149
+ };
150
+
151
+ export const WithVisibilityMethod: StoryFn<TextareaSchema> = (args) => ({
152
+ components: { page },
153
+ setup() {
154
+ const isVisible = ref(false);
155
+ const toggle = () => {
156
+ isVisible.value = !isVisible.value;
157
+ };
158
+
159
+ const context = reactive({
160
+ item: {
161
+ mockedProperty: "I am input field",
162
+ },
163
+ scope: {
164
+ visibilityFn: isVisible,
165
+ },
166
+ });
167
+
168
+ return { args, context, toggle };
169
+ },
170
+ template: templateWithVisibilityToggle,
171
+ });
172
+ WithVisibilityMethod.args = {
173
+ label: "Textarea label",
174
+ visibility: { method: "visibilityFn" },
175
+ };
176
+
177
+ export const WithUpdateMethod: StoryFn<TextareaSchema> = (args) => ({
178
+ components: { page },
179
+ setup() {
180
+ const context = reactive({
181
+ item: {
182
+ mockedProperty: "I am input field",
183
+ },
184
+ scope: {
185
+ updateFn: (value: string) => alert(`Value updated to: ${value}`),
186
+ },
187
+ });
188
+ return { args, context };
189
+ },
190
+ template,
191
+ });
192
+ WithUpdateMethod.args = {
193
+ label: "Textarea label",
194
+ update: {
195
+ method: "updateFn",
196
+ },
197
+ };
198
+
199
+ export const WithHorizontalSeparator = Template.bind({});
200
+ WithHorizontalSeparator.args = {
201
+ label: "Textarea label",
202
+ horizontalSeparator: true,
203
+ };
@@ -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
+ };