@vc-shell/framework 1.1.5 → 1.1.6

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 (227) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/core/plugins/modularity/loader.ts +31 -0
  3. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  4. package/dist/shared/components/common/popup/vc-popup-error.vue.d.ts +2 -2
  5. package/dist/shared/components/common/popup/vc-popup-error.vue.d.ts.map +1 -1
  6. package/dist/shared/components/common/popup/vc-popup-info.vue.d.ts +2 -2
  7. package/dist/shared/components/common/popup/vc-popup-info.vue.d.ts.map +1 -1
  8. package/dist/shared/components/common/popup/vc-popup-warning.vue.d.ts +2 -2
  9. package/dist/shared/components/common/popup/vc-popup-warning.vue.d.ts.map +1 -1
  10. package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts +3 -3
  11. package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts.map +1 -1
  12. package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +4 -4
  13. package/dist/shared/components/notifications/components/notification-container/index.d.ts +6 -6
  14. package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
  15. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +2 -2
  16. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
  17. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -2
  18. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts +1 -1
  19. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
  20. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts +1 -1
  21. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts +2 -2
  24. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
  25. package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +2 -2
  26. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +1 -1
  27. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  28. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +1 -1
  29. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  30. package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts +2 -2
  31. package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts.map +1 -1
  32. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +1 -1
  33. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
  34. package/dist/ui/components/atoms/vc-tooltip/vc-tooltip.vue.d.ts +2 -2
  35. package/dist/ui/components/atoms/vc-tooltip/vc-tooltip.vue.d.ts.map +1 -1
  36. package/dist/ui/components/molecules/vc-checkbox/vc-checkbox.vue.d.ts +3 -3
  37. package/dist/ui/components/molecules/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
  38. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +2 -2
  39. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +3 -3
  40. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
  41. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +4 -4
  42. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
  43. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +6 -34
  44. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  45. package/dist/ui/components/molecules/vc-input-dropdown/index.d.ts +4 -0
  46. package/dist/ui/components/molecules/vc-input-dropdown/index.d.ts.map +1 -0
  47. package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts +171 -0
  48. package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts.map +1 -0
  49. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +2 -2
  50. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
  51. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts +1 -1
  52. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  53. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +2 -2
  54. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
  55. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +3 -3
  56. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  57. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts +1 -1
  58. package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
  59. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue.d.ts +2 -2
  60. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue.d.ts.map +1 -1
  61. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts +5 -5
  62. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
  63. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +3 -3
  64. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  65. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +1 -1
  66. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
  67. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +1 -1
  68. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  69. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts +1 -1
  70. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +1 -1
  71. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
  72. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts +1 -1
  73. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts.map +1 -1
  74. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +5 -5
  75. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  76. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
  77. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts +1 -1
  78. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
  79. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +3 -3
  80. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  81. package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts +1 -1
  82. package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts.map +1 -1
  83. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +4 -4
  84. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  85. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts +1 -1
  86. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
  87. package/package.json +4 -4
  88. package/shared/components/common/popup/vc-popup-error.vue +3 -3
  89. package/shared/components/common/popup/vc-popup-info.vue +3 -3
  90. package/shared/components/common/popup/vc-popup-warning.vue +3 -3
  91. package/shared/components/dashboard-widget-card/dashboard-widget-card.vue +4 -4
  92. package/ui/components/atoms/vc-badge/vc-badge.vue +2 -2
  93. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +1 -1
  94. package/ui/components/atoms/vc-label/vc-label.vue +3 -3
  95. package/ui/components/atoms/vc-tooltip/vc-tooltip.vue +3 -3
  96. package/ui/components/molecules/vc-checkbox/vc-checkbox.vue +4 -4
  97. package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +2 -2
  98. package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +1 -1
  99. package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +36 -115
  100. package/ui/components/molecules/vc-input-dropdown/index.ts +4 -0
  101. package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.stories.ts +763 -0
  102. package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue +268 -0
  103. package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +2 -2
  104. package/ui/components/molecules/vc-rating/vc-rating.vue +2 -2
  105. package/ui/components/molecules/vc-textarea/vc-textarea.vue +2 -2
  106. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue +3 -3
  107. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +6 -6
  108. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +4 -4
  109. package/ui/components/organisms/vc-app/vc-app.vue +2 -3
  110. package/ui/components/organisms/vc-blade/vc-blade.vue +5 -5
  111. package/ui/components/organisms/vc-login-form/vc-login-form.vue +2 -2
  112. package/ui/components/organisms/vc-popup/vc-popup.vue +4 -4
  113. package/dist/apl-B2DGVGxc.js +0 -76
  114. package/dist/asciiarmor-2LVJmxlE.js +0 -34
  115. package/dist/asn1-jKiBa2Ya.js +0 -95
  116. package/dist/asterisk-DS281yxp.js +0 -271
  117. package/dist/brainfuck-C_p9pTT8.js +0 -34
  118. package/dist/clike-BUuHEmgZ.js +0 -620
  119. package/dist/clojure-CCKyeQKf.js +0 -800
  120. package/dist/cmake-CuaCgAKt.js +0 -28
  121. package/dist/cobol-BlTKFDRj.js +0 -72
  122. package/dist/coffeescript-BVCvwO8I.js +0 -179
  123. package/dist/commonlisp-D_kxz07b.js +0 -75
  124. package/dist/crystal-D309uH6_.js +0 -217
  125. package/dist/css-bIlmDBTK.js +0 -1560
  126. package/dist/cypher-BMq4Fwjl.js +0 -68
  127. package/dist/d-BZcgY6La.js +0 -127
  128. package/dist/diff-Cg9d_RX2.js +0 -18
  129. package/dist/dockerfile-DIy8NleC.js +0 -194
  130. package/dist/dtd-CtLokQ-U.js +0 -84
  131. package/dist/dylan-QYeExnWK.js +0 -234
  132. package/dist/ebnf-DUPDuY4r.js +0 -78
  133. package/dist/ecl-CiXN-g_D.js +0 -121
  134. package/dist/eiffel-yQhjl4T1.js +0 -110
  135. package/dist/elm-CNT9vbN0.js +0 -108
  136. package/dist/erlang-CFOYdy9e.js +0 -487
  137. package/dist/factor-DDOC7X6P.js +0 -65
  138. package/dist/fcl-CPC2WYrI.js +0 -103
  139. package/dist/forth-BmxRyE9S.js +0 -60
  140. package/dist/fortran-9bvPyrOW.js +0 -442
  141. package/dist/framework.js +0 -288
  142. package/dist/gas-BdfkXJT_.js +0 -183
  143. package/dist/gherkin-CJuwpceU.js +0 -34
  144. package/dist/groovy-DZeT_VM-.js +0 -146
  145. package/dist/haskell-Bvt3Qq1t.js +0 -375
  146. package/dist/haxe-70NVW1pR.js +0 -359
  147. package/dist/http-D9LttvKF.js +0 -44
  148. package/dist/idl-B6TRFYjl.js +0 -947
  149. package/dist/index-BBHl6nap.js +0 -308
  150. package/dist/index-BG6N4UCY.js +0 -299
  151. package/dist/index-Bv5as3SI.js +0 -71
  152. package/dist/index-C4VyqVxv.js +0 -249
  153. package/dist/index-CKLiFGZ-.js +0 -98
  154. package/dist/index-CTmAMa_1.js +0 -265
  155. package/dist/index-CtGZgIiV.js +0 -75
  156. package/dist/index-D13Jcezf.js +0 -288
  157. package/dist/index-DbpKygJh.js +0 -611
  158. package/dist/index-DgCtSr4P.js +0 -58
  159. package/dist/index-Dh1XjfgY.js +0 -134
  160. package/dist/index-DpDbQQg6.js +0 -341
  161. package/dist/index-DwuQbDJG.js +0 -156
  162. package/dist/index-Fhuqbkq2.js +0 -93
  163. package/dist/index-JTAZpxKF.js +0 -137
  164. package/dist/index-MKD2CP5c.js +0 -147000
  165. package/dist/index-Q3k1PYzc.js +0 -538
  166. package/dist/index.css +0 -9
  167. package/dist/javascript-WMWNx-Vj.js +0 -690
  168. package/dist/jinja2-DnB6dQmV.js +0 -154
  169. package/dist/julia-DpvXAuO6.js +0 -241
  170. package/dist/livescript-CanGTf8u.js +0 -272
  171. package/dist/lua-XplVlWi_.js +0 -217
  172. package/dist/mathematica-jaRHnSxC.js +0 -35
  173. package/dist/mbox-BctzC1hL.js +0 -76
  174. package/dist/mirc-CFBPAOaF.js +0 -72
  175. package/dist/mllike-BSnXJBGA.js +0 -272
  176. package/dist/modelica-vUgVs--1.js +0 -93
  177. package/dist/mscgen-Cpl0NYLN.js +0 -104
  178. package/dist/mumps-CQoS1kWX.js +0 -25
  179. package/dist/nginx-zDPm3Z74.js +0 -89
  180. package/dist/nsis-fePjrhq7.js +0 -62
  181. package/dist/ntriples-CsNjv2QF.js +0 -79
  182. package/dist/octave-C8PmmSRH.js +0 -143
  183. package/dist/oz-Ce8aN8oE.js +0 -151
  184. package/dist/pascal-De0D6mP7.js +0 -77
  185. package/dist/perl-B4bSCe1C.js +0 -915
  186. package/dist/pig-D24Z8EXi.js +0 -54
  187. package/dist/powershell-DkYVfTzP.js +0 -249
  188. package/dist/properties-Dn9wna3M.js +0 -26
  189. package/dist/protobuf-BPIjwpzm.js +0 -49
  190. package/dist/pug-BqUR2bBq.js +0 -248
  191. package/dist/puppet-nyd4dhjf.js +0 -45
  192. package/dist/python-B5QdSKoL.js +0 -313
  193. package/dist/q-DXjKs-tC.js +0 -83
  194. package/dist/r-LKEuhEGI.js +0 -104
  195. package/dist/rpm-IznJm2Xc.js +0 -57
  196. package/dist/ruby-CcYfvIk6.js +0 -228
  197. package/dist/sas-7E8yHoCW.js +0 -105
  198. package/dist/scheme-DjibxsNh.js +0 -124
  199. package/dist/shell-C0C2sNA_.js +0 -182
  200. package/dist/sieve-Bwz7vjP5.js +0 -72
  201. package/dist/simple-mode-B0dvCdAA.js +0 -89
  202. package/dist/smalltalk-Bhddl2pB.js +0 -48
  203. package/dist/solr-BNlsLglM.js +0 -41
  204. package/dist/sparql-FarWu_Gb.js +0 -197
  205. package/dist/spreadsheet-C-cy4P5N.js +0 -49
  206. package/dist/sql-mMre1Bo3.js +0 -282
  207. package/dist/stex-92raWT1r.js +0 -129
  208. package/dist/stylus-CAdqWld3.js +0 -250
  209. package/dist/swift-DSxqR9R6.js +0 -230
  210. package/dist/tcl-xfoLljhY.js +0 -81
  211. package/dist/textile-D1AWE-pc.js +0 -295
  212. package/dist/tiddlywiki-5wqsXtSk.js +0 -155
  213. package/dist/tiki-__Kn3CeS.js +0 -181
  214. package/dist/toml-BHiuTcfn.js +0 -49
  215. package/dist/troff-D2UO-fKf.js +0 -35
  216. package/dist/ttcn-Bsa4sfRm.js +0 -123
  217. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
  218. package/dist/turtle-xwJUxoPV.js +0 -80
  219. package/dist/vb-c2kQGd6-.js +0 -74
  220. package/dist/vbscript-Dz1TtKsy.js +0 -324
  221. package/dist/velocity-DJd0pTTC.js +0 -96
  222. package/dist/verilog-C4VGD9n1.js +0 -263
  223. package/dist/vhdl-T9HkrbI2.js +0 -106
  224. package/dist/webidl-CjfDENEo.js +0 -155
  225. package/dist/xquery-BUQdORAS.js +0 -422
  226. package/dist/yacas-C0absKBh.js +0 -73
  227. package/dist/z80-C8rPtw-0.js +0 -61
@@ -0,0 +1,763 @@
1
+ import type { Meta, StoryObj } from "@storybook/vue3";
2
+ import { VcInputDropdown } from "./";
3
+ import { VcIcon } from "../../atoms/vc-icon";
4
+ import { VcButton } from "../../atoms/vc-button";
5
+ import { ref, computed, watch } from "vue";
6
+
7
+ /**
8
+ * `VcInputDropdown` is a versatile component that combines an input field with a dropdown selection.
9
+ * It allows users to enter a value while also selecting an option from a predefined list,
10
+ * making it perfect for units of measurement, date formats, currencies, and other similar use cases.
11
+ */
12
+ const meta = {
13
+ title: "Molecules/VcInputDropdown",
14
+ component: VcInputDropdown,
15
+ tags: ["autodocs"],
16
+ args: {
17
+ modelValue: "100",
18
+ label: "Input with Dropdown",
19
+ placeholder: "Enter value",
20
+ options: ["Option 1", "Option 2", "Option 3", "Option 4", "Option 5"],
21
+ option: "Option 1",
22
+ },
23
+ argTypes: {
24
+ modelValue: {
25
+ description: "Value of the input field (v-model)",
26
+ control: "text",
27
+ table: {
28
+ category: "Model",
29
+ type: { summary: "unknown" },
30
+ },
31
+ },
32
+ option: {
33
+ description: "Selected option from dropdown (v-model:option)",
34
+ control: "text",
35
+ table: {
36
+ category: "Model",
37
+ type: { summary: "unknown" },
38
+ },
39
+ },
40
+ options: {
41
+ description: "Options for the dropdown selection",
42
+ control: "object",
43
+ table: {
44
+ category: "Data",
45
+ type: { summary: "unknown[]" },
46
+ },
47
+ },
48
+ optionValue: {
49
+ description: "Property name or function to get the value from option objects",
50
+ control: "text",
51
+ table: {
52
+ category: "Data",
53
+ type: {
54
+ summary: "string | Function",
55
+ detail: "Property name to use as value or function that returns value from option object",
56
+ },
57
+ defaultValue: { summary: "id" },
58
+ },
59
+ },
60
+ optionLabel: {
61
+ description: "Property name or function to get the display label from option objects",
62
+ control: "text",
63
+ table: {
64
+ category: "Data",
65
+ type: {
66
+ summary: "string | Function",
67
+ detail: "Property name to use as label or function that returns label from option object",
68
+ },
69
+ defaultValue: { summary: "title" },
70
+ },
71
+ },
72
+ inputType: {
73
+ description: "Type of the input field",
74
+ control: "select",
75
+ options: ["text", "number", "email", "password", "tel", "url", "search"],
76
+ table: {
77
+ category: "Behavior",
78
+ type: { summary: "string" },
79
+ defaultValue: { summary: "text" },
80
+ },
81
+ },
82
+ label: {
83
+ description: "Label text displayed above the component",
84
+ control: "text",
85
+ table: {
86
+ category: "Appearance",
87
+ type: { summary: "string" },
88
+ },
89
+ },
90
+ placeholder: {
91
+ description: "Placeholder text for the input field",
92
+ control: "text",
93
+ table: {
94
+ category: "Appearance",
95
+ type: { summary: "string" },
96
+ },
97
+ },
98
+ hint: {
99
+ description: "Hint text displayed below the component",
100
+ control: "text",
101
+ table: {
102
+ category: "Appearance",
103
+ type: { summary: "string" },
104
+ },
105
+ },
106
+ clearable: {
107
+ description: "Whether the input allows clearing the entered value",
108
+ control: "boolean",
109
+ table: {
110
+ category: "Behavior",
111
+ type: { summary: "boolean" },
112
+ defaultValue: { summary: "false" },
113
+ },
114
+ },
115
+ prefix: {
116
+ description: "Prefix text to display inside the input field",
117
+ control: "text",
118
+ table: {
119
+ category: "Appearance",
120
+ type: { summary: "string" },
121
+ },
122
+ },
123
+ suffix: {
124
+ description: "Suffix text to display inside the input field",
125
+ control: "text",
126
+ table: {
127
+ category: "Appearance",
128
+ type: { summary: "string" },
129
+ },
130
+ },
131
+ name: {
132
+ description: "HTML name attribute for the input field",
133
+ control: "text",
134
+ table: {
135
+ category: "Behavior",
136
+ type: { summary: "string" },
137
+ defaultValue: { summary: "Field" },
138
+ },
139
+ },
140
+ loading: {
141
+ description: "Shows a loading spinner in the component",
142
+ control: "boolean",
143
+ table: {
144
+ category: "State",
145
+ type: { summary: "boolean" },
146
+ defaultValue: { summary: "false" },
147
+ },
148
+ },
149
+ debounce: {
150
+ description: "Debounce time in milliseconds for search input",
151
+ control: "number",
152
+ table: {
153
+ category: "Behavior",
154
+ type: { summary: "number | string" },
155
+ defaultValue: { summary: "0" },
156
+ },
157
+ },
158
+ disabled: {
159
+ description: "Disables the entire component",
160
+ control: "boolean",
161
+ table: {
162
+ category: "State",
163
+ type: { summary: "boolean" },
164
+ defaultValue: { summary: "false" },
165
+ },
166
+ },
167
+ autofocus: {
168
+ description: "Automatically focuses the input field when component mounts",
169
+ control: "boolean",
170
+ table: {
171
+ category: "Behavior",
172
+ type: { summary: "boolean" },
173
+ defaultValue: { summary: "false" },
174
+ },
175
+ },
176
+ error: {
177
+ description: "Shows the component in error state",
178
+ control: "boolean",
179
+ table: {
180
+ category: "State",
181
+ type: { summary: "boolean" },
182
+ defaultValue: { summary: "false" },
183
+ },
184
+ },
185
+ errorMessage: {
186
+ description: "Error message text displayed when in error state",
187
+ control: "text",
188
+ table: {
189
+ category: "Validation",
190
+ type: { summary: "string" },
191
+ },
192
+ },
193
+ maxlength: {
194
+ description: "Maximum character length for the input field",
195
+ control: "number",
196
+ table: {
197
+ category: "Validation",
198
+ type: { summary: "number | string" },
199
+ defaultValue: { summary: "1024" },
200
+ },
201
+ },
202
+ tooltip: {
203
+ description: "Tooltip text displayed on hover",
204
+ control: "text",
205
+ table: {
206
+ category: "Appearance",
207
+ type: { summary: "string" },
208
+ },
209
+ },
210
+ required: {
211
+ description: "Marks the component as required (shows asterisk)",
212
+ control: "boolean",
213
+ table: {
214
+ category: "Validation",
215
+ type: { summary: "boolean" },
216
+ defaultValue: { summary: "false" },
217
+ },
218
+ },
219
+ searchable: {
220
+ description: "Enables search functionality in the dropdown",
221
+ control: "boolean",
222
+ table: {
223
+ category: "Behavior",
224
+ type: { summary: "boolean" },
225
+ defaultValue: { summary: "false" },
226
+ },
227
+ },
228
+ // Slots
229
+ control: {
230
+ description: "Slot for custom input control",
231
+ table: {
232
+ category: "Slots",
233
+ type: { summary: "(scope: { placeholder, focused, modelValue, emitValue }) => VNode" },
234
+ },
235
+ },
236
+ button: {
237
+ description: "Slot for custom dropdown button",
238
+ table: {
239
+ category: "Slots",
240
+ type: { summary: "(scope: { toggleHandler }) => VNode" },
241
+ },
242
+ },
243
+ "append-inner": {
244
+ description: "Slot for custom append-inner content",
245
+ table: {
246
+ category: "Slots",
247
+ type: { summary: "VNode" },
248
+ },
249
+ },
250
+ "prepend-inner": {
251
+ description: "Slot for custom prepend-inner content",
252
+ table: {
253
+ category: "Slots",
254
+ type: { summary: "VNode" },
255
+ },
256
+ },
257
+ append: {
258
+ description: "Slot for custom append content",
259
+ table: {
260
+ category: "Slots",
261
+ type: { summary: "VNode" },
262
+ },
263
+ },
264
+ prepend: {
265
+ description: "Slot for custom prepend content",
266
+ table: {
267
+ category: "Slots",
268
+ type: { summary: "VNode" },
269
+ },
270
+ },
271
+ },
272
+ parameters: {
273
+ docs: {
274
+ description: {
275
+ component: `
276
+ ### VcInputDropdown Component
277
+
278
+ The VcInputDropdown component combines an input field with a dropdown selection in a unified interface.
279
+ This creates a powerful and flexible control ideal for scenarios where users need to both input a value
280
+ and select a category, unit, or format for that value.
281
+
282
+ ## Key Features
283
+
284
+ - **Value + Selection**: Combines input field with dropdown selection
285
+ - **Flexible Data Types**: Works with both primitive and object data
286
+ - **Customizable Input Types**: Supports text, number, email, etc.
287
+ - **Searchable Dropdown**: Optional search functionality for options
288
+ - **Extensive Slot System**: Multiple slots for customization
289
+ - **State Management**: Supports loading, error, disabled states
290
+ - **Consistent UX**: Follows the design system patterns
291
+
292
+ ## Common Use Cases
293
+
294
+ - **Unit Selection**: Input numeric values with units (e.g., measurements)
295
+ - **Currency Inputs**: Amount with currency selection
296
+ - **Date Formats**: Date inputs with format selection
297
+ - **Custom Formatting**: Any input that requires format choice
298
+
299
+ ## Usage Example
300
+
301
+ \`\`\`vue
302
+ <template>
303
+ <VcInputDropdown
304
+ v-model="measurement"
305
+ v-model:option="unit"
306
+ :options="unitOptions"
307
+ label="Measurement"
308
+ placeholder="Enter value"
309
+ input-type="number"
310
+ required
311
+ />
312
+ </template>
313
+
314
+ <script setup>
315
+ import { ref } from 'vue';
316
+ import { VcInputDropdown } from '@vc-shell/framework';
317
+
318
+ const measurement = ref(100);
319
+ const unit = ref('cm');
320
+ const unitOptions = ['mm', 'cm', 'm', 'km'];
321
+ </script>
322
+ \`\`\`
323
+ `,
324
+ },
325
+ },
326
+ },
327
+ } satisfies Meta<typeof VcInputDropdown>;
328
+
329
+ export default meta;
330
+ type Story = StoryObj<typeof meta>;
331
+
332
+ /**
333
+ * Basic usage of the component with simple string options. This demonstrates
334
+ * the default behavior with a text input and dropdown selection.
335
+ */
336
+ export const Default: Story = {
337
+ args: {
338
+ modelValue: "100",
339
+ label: "Input with Dropdown",
340
+ placeholder: "Enter value",
341
+ options: ["Option 1", "Option 2", "Option 3", "Option 4", "Option 5"],
342
+ option: "Option 1",
343
+ hint: "Basic example with string options",
344
+ },
345
+ render: (args) => ({
346
+ components: { VcInputDropdown },
347
+ setup() {
348
+ const inputValue = ref(args.modelValue);
349
+ const selectedOption = ref(args.option);
350
+
351
+ const handleInputChange = (value: unknown) => {
352
+ inputValue.value = value as string;
353
+ console.log("Input changed:", value);
354
+ };
355
+
356
+ const handleOptionChange = (value: unknown) => {
357
+ selectedOption.value = value as string;
358
+ console.log("Option changed:", value);
359
+ };
360
+
361
+ return {
362
+ args,
363
+ inputValue,
364
+ selectedOption,
365
+ handleInputChange,
366
+ handleOptionChange,
367
+ };
368
+ },
369
+ template: `
370
+ <div class="tw-space-y-6 tw-max-w-md">
371
+ <VcInputDropdown
372
+ v-model="inputValue"
373
+ v-model:option="selectedOption"
374
+ :label="args.label"
375
+ :placeholder="args.placeholder"
376
+ :options="args.options"
377
+ :hint="args.hint"
378
+ @update:model-value="handleInputChange"
379
+ @update:option="handleOptionChange"
380
+ />
381
+
382
+ <div class="tw-p-3 tw-bg-gray-100 tw-rounded tw-text-sm">
383
+ <div class="tw-mb-2 tw-font-medium">Component State:</div>
384
+ <div><strong>Input Value:</strong> <code>{{ inputValue }}</code></div>
385
+ <div><strong>Selected Option:</strong> <code>{{ selectedOption }}</code></div>
386
+ </div>
387
+ </div>
388
+ `,
389
+ }),
390
+ };
391
+
392
+ /**
393
+ * Example showing VcInputDropdown with object options and customized appearance.
394
+ * This demonstrates how to work with complex data structures.
395
+ */
396
+ export const WithObjectOptions: Story = {
397
+ args: {
398
+ modelValue: "42",
399
+ label: "Dimensions",
400
+ placeholder: "Enter value",
401
+ hint: "Enter a dimension with unit",
402
+ inputType: "number",
403
+ searchable: true,
404
+ required: true,
405
+ },
406
+ render: (args) => ({
407
+ components: { VcInputDropdown, VcIcon },
408
+ setup() {
409
+ const inputValue = ref(args.modelValue);
410
+ const selectedOption = ref({ id: "px", label: "Pixels" });
411
+
412
+ const options = [
413
+ { id: "px", label: "Pixels", description: "Screen pixels (relative units)" },
414
+ { id: "em", label: "Em units", description: "Relative to font size" },
415
+ { id: "rem", label: "Root Em units", description: "Relative to root font size" },
416
+ { id: "%", label: "Percentage", description: "Percentage of parent element" },
417
+ { id: "vw", label: "Viewport Width", description: "1% of viewport width" },
418
+ { id: "vh", label: "Viewport Height", description: "1% of viewport height" },
419
+ ];
420
+
421
+ // Format the displayed value with the unit
422
+ const formattedValue = computed(() => {
423
+ if (!inputValue.value) return "";
424
+ return `${inputValue.value}${selectedOption.value.id}`;
425
+ });
426
+
427
+ return {
428
+ args,
429
+ inputValue,
430
+ selectedOption,
431
+ options,
432
+ optionValue: "id",
433
+ optionLabel: "label",
434
+ formattedValue,
435
+ };
436
+ },
437
+ template: `
438
+ <div class="tw-space-y-6 tw-max-w-md">
439
+ <VcInputDropdown
440
+ v-model="inputValue"
441
+ v-model:option="selectedOption"
442
+ :label="args.label"
443
+ :placeholder="args.placeholder"
444
+ :hint="args.hint"
445
+ :options="options"
446
+ :option-value="optionValue"
447
+ :option-label="optionLabel"
448
+ :input-type="args.inputType"
449
+ :searchable="args.searchable"
450
+ :required="args.required"
451
+ >
452
+ <template #button="{ toggleHandler }">
453
+ <button
454
+ class="tw-flex tw-items-center tw-px-2 tw-text-primary-500 tw-font-medium"
455
+ @click.stop.prevent="toggleHandler"
456
+ >
457
+ <span>{{ selectedOption.label }}</span>
458
+ <VcIcon icon="material-keyboard_arrow_down" size="s" class="tw-ml-1" />
459
+ </button>
460
+ </template>
461
+ </VcInputDropdown>
462
+
463
+ <div class="tw-p-4 tw-bg-gray-100 tw-rounded tw-text-sm">
464
+ <div class="tw-mb-2 tw-font-medium">Component State:</div>
465
+ <div><strong>Input Value:</strong> <code>{{ inputValue }}</code></div>
466
+ <div><strong>Selected Option:</strong> <code>{{ JSON.stringify(selectedOption) }}</code></div>
467
+ <div class="tw-mt-2 tw-pt-2 tw-border-t tw-border-gray-200">
468
+ <strong>Formatted Output:</strong> <span class="tw-text-base tw-font-medium">{{ formattedValue }}</span>
469
+ </div>
470
+ </div>
471
+ </div>
472
+ `,
473
+ }),
474
+ };
475
+
476
+ /**
477
+ * Example of VcInputDropdown as a currency input field with formatting.
478
+ * This demonstrates a practical use case for financial applications.
479
+ */
480
+ export const CurrencyInput: Story = {
481
+ args: {
482
+ modelValue: 1250.99,
483
+ label: "Price",
484
+ placeholder: "Enter price",
485
+ hint: "Enter price with currency",
486
+ inputType: "number",
487
+ required: true,
488
+ clearable: true,
489
+ },
490
+ render: (args) => ({
491
+ components: { VcInputDropdown, VcIcon },
492
+ setup() {
493
+ const price = ref(args.modelValue);
494
+ const currency = ref("USD");
495
+
496
+ const currencyOptions = [
497
+ { code: "USD", symbol: "$", name: "US Dollar" },
498
+ { code: "EUR", symbol: "€", name: "Euro" },
499
+ { code: "GBP", symbol: "£", name: "British Pound" },
500
+ { code: "JPY", symbol: "¥", name: "Japanese Yen" },
501
+ ];
502
+
503
+ // Find the current currency object
504
+ const currentCurrency = computed(() => {
505
+ return currencyOptions.find((c) => c.code === currency.value) || currencyOptions[0];
506
+ });
507
+
508
+ // Format price with currency
509
+ const formattedPrice = computed(() => {
510
+ if (price.value === null || price.value === undefined) return "";
511
+
512
+ return new Intl.NumberFormat("en-US", {
513
+ style: "currency",
514
+ currency: currency.value,
515
+ currencyDisplay: "symbol",
516
+ }).format(price.value);
517
+ });
518
+
519
+ return {
520
+ args,
521
+ price,
522
+ currency,
523
+ currencyOptions,
524
+ formattedPrice,
525
+ currentCurrency,
526
+ };
527
+ },
528
+ template: `
529
+ <div class="tw-space-y-6 tw-max-w-md">
530
+ <VcInputDropdown
531
+ v-model="price"
532
+ v-model:option="currency"
533
+ :label="args.label"
534
+ :placeholder="args.placeholder"
535
+ :hint="args.hint"
536
+ :options="currencyOptions.map(c => c.code)"
537
+ :input-type="args.inputType"
538
+ :required="args.required"
539
+ :clearable="args.clearable"
540
+ >
541
+ <template #button="{ toggleHandler }">
542
+ <button
543
+ class="tw-flex tw-items-center tw-px-2 tw-text-primary-500 tw-font-medium"
544
+ @click.stop.prevent="toggleHandler"
545
+ >
546
+ <span>{{ currentCurrency.symbol }} {{ currency }}</span>
547
+ <VcIcon icon="material-keyboard_arrow_down" size="s" class="tw-ml-1" />
548
+ </button>
549
+ </template>
550
+ </VcInputDropdown>
551
+
552
+ <div class="tw-p-4 tw-bg-gray-100 tw-rounded">
553
+ <div><strong>Formatted Output:</strong> {{ formattedPrice }}</div>
554
+ </div>
555
+ </div>
556
+ `,
557
+ }),
558
+ };
559
+
560
+ /**
561
+ * Example demonstrating custom input with date formatting based on selected format.
562
+ * This shows how to use the control slot for advanced customization.
563
+ */
564
+ export const WithCustomInput: Story = {
565
+ args: {
566
+ modelValue: "",
567
+ label: "Date with Format",
568
+ placeholder: "Enter date",
569
+ hint: "Enter date with specific format",
570
+ tooltip: "Choose a date format and enter a date value",
571
+ },
572
+ render: (args) => ({
573
+ components: { VcInputDropdown, VcIcon, VcButton },
574
+ setup() {
575
+ const date = ref(args.modelValue || "");
576
+ const format = ref("DD/MM/YYYY");
577
+
578
+ const formatOptions = [
579
+ { id: "DD/MM/YYYY", label: "Day/Month/Year", example: "31/12/2023" },
580
+ { id: "MM/DD/YYYY", label: "Month/Day/Year", example: "12/31/2023" },
581
+ { id: "YYYY-MM-DD", label: "ISO Format", example: "2023-12-31" },
582
+ { id: "MMM DD, YYYY", label: "Text Format", example: "Dec 31, 2023" },
583
+ ];
584
+
585
+ const formatDate = () => {
586
+ if (!date.value) return;
587
+
588
+ const today = new Date();
589
+ const day = String(today.getDate()).padStart(2, "0");
590
+ const month = String(today.getMonth() + 1).padStart(2, "0");
591
+ const monthName = today.toLocaleString("default", { month: "short" });
592
+ const year = today.getFullYear();
593
+
594
+ switch (format.value) {
595
+ case "DD/MM/YYYY":
596
+ date.value = `${day}/${month}/${year}`;
597
+ break;
598
+ case "MM/DD/YYYY":
599
+ date.value = `${month}/${day}/${year}`;
600
+ break;
601
+ case "YYYY-MM-DD":
602
+ date.value = `${year}-${month}-${day}`;
603
+ break;
604
+ case "MMM DD, YYYY":
605
+ date.value = `${monthName} ${day}, ${year}`;
606
+ break;
607
+ }
608
+ };
609
+
610
+ // Format date on component mount and when format changes
611
+ watch(format, formatDate);
612
+
613
+ const setToday = () => {
614
+ formatDate();
615
+ };
616
+
617
+ return {
618
+ args,
619
+ date,
620
+ format,
621
+ formatOptions,
622
+ formatDate,
623
+ setToday,
624
+ };
625
+ },
626
+ template: `
627
+ <div class="tw-space-y-6 tw-max-w-md">
628
+ <VcInputDropdown
629
+ v-model="date"
630
+ v-model:option="format"
631
+ :label="args.label"
632
+ :placeholder="args.placeholder"
633
+ :hint="args.hint"
634
+ :tooltip="args.tooltip"
635
+ :options="formatOptions"
636
+ :option-value="opt => opt.id"
637
+ :option-label="opt => opt.label"
638
+ >
639
+ <template #control="{ placeholder }">
640
+ <div class="tw-flex tw-items-center tw-relative tw-w-full">
641
+ <VcButton size="xs" variety="secondary" @click="setToday">Today</VcButton>
642
+
643
+ <VcIcon
644
+ icon="material-calendar_today"
645
+ class="tw-text-gray-500"
646
+ size="s"
647
+ />
648
+ <input
649
+ v-model="date"
650
+ :placeholder="placeholder"
651
+ class="tw-w-full tw-p-2 tw-pl-8 tw-border tw-border-solid tw-border-gray-300 tw-rounded tw-text-sm tw-outline-none"
652
+ @blur="formatDate"
653
+ />
654
+
655
+
656
+ </div>
657
+ </template>
658
+ </VcInputDropdown>
659
+
660
+ <div class="tw-p-4 tw-bg-gray-100 tw-rounded tw-text-sm">
661
+ <div><strong>Date Value:</strong> {{ date || 'empty' }}</div>
662
+ <div><strong>Format:</strong> {{ format }}</div>
663
+ </div>
664
+ </div>
665
+ `,
666
+ }),
667
+ };
668
+
669
+ /**
670
+ * Demonstrates various component states: default, disabled, error, and loading.
671
+ * This provides a comprehensive view of how the component looks in different states.
672
+ */
673
+ export const States: Story = {
674
+ args: {
675
+ modelValue: "Sample value",
676
+ },
677
+ render: (args) => ({
678
+ components: { VcInputDropdown },
679
+ setup() {
680
+ const defaultValue = ref("Sample value");
681
+ const defaultOption = ref("Default");
682
+ const disabledValue = ref("Disabled input");
683
+ const disabledOption = ref("Disabled");
684
+ const errorValue = ref("Error value");
685
+ const errorOption = ref("Error");
686
+ const loadingValue = ref("Loading...");
687
+ const loadingOption = ref("Loading");
688
+ const requiredValue = ref("");
689
+ const requiredOption = ref("Required");
690
+
691
+ const stateOptions = ["Default", "Disabled", "Error", "Loading", "Required"];
692
+
693
+ return {
694
+ args,
695
+ defaultValue,
696
+ defaultOption,
697
+ disabledValue,
698
+ disabledOption,
699
+ errorValue,
700
+ errorOption,
701
+ loadingValue,
702
+ loadingOption,
703
+ requiredValue,
704
+ requiredOption,
705
+ stateOptions,
706
+ };
707
+ },
708
+ template: `
709
+ <div class="tw-space-y-6 tw-max-w-md">
710
+ <h3 class="tw-text-lg tw-font-medium">Component States</h3>
711
+
712
+ <VcInputDropdown
713
+ v-model="defaultValue"
714
+ v-model:option="defaultOption"
715
+ :options="stateOptions"
716
+ label="Default State"
717
+ placeholder="Enter value"
718
+ hint="This is a component in its default state"
719
+ />
720
+
721
+ <VcInputDropdown
722
+ v-model="disabledValue"
723
+ v-model:option="disabledOption"
724
+ :options="stateOptions"
725
+ label="Disabled State"
726
+ placeholder="Enter value"
727
+ hint="This component is disabled"
728
+ disabled
729
+ />
730
+
731
+ <VcInputDropdown
732
+ v-model="errorValue"
733
+ v-model:option="errorOption"
734
+ :options="stateOptions"
735
+ label="Error State"
736
+ placeholder="Enter value"
737
+ error
738
+ error-message="This field has an error that needs to be fixed"
739
+ />
740
+
741
+ <VcInputDropdown
742
+ v-model="loadingValue"
743
+ v-model:option="loadingOption"
744
+ :options="stateOptions"
745
+ label="Loading State"
746
+ placeholder="Enter value"
747
+ hint="This component is in loading state"
748
+ loading
749
+ />
750
+
751
+ <VcInputDropdown
752
+ v-model="requiredValue"
753
+ v-model:option="requiredOption"
754
+ :options="stateOptions"
755
+ label="Required Field"
756
+ placeholder="This field is required"
757
+ hint="This field must have a value"
758
+ required
759
+ />
760
+ </div>
761
+ `,
762
+ }),
763
+ };