@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,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
+ };