@cscfi/csc-ui 1.0.16 → 1.0.17

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 (340) hide show
  1. package/dist/cjs/c-accordion-item.cjs.entry.js +1 -1
  2. package/dist/cjs/c-accordion.cjs.entry.js +1 -1
  3. package/dist/cjs/c-alert.cjs.entry.js +1 -1
  4. package/dist/cjs/c-autocomplete.cjs.entry.js +186 -190
  5. package/dist/cjs/c-autocomplete.cjs.entry.js.map +1 -1
  6. package/dist/cjs/c-badge_12.cjs.entry.js +6 -6
  7. package/dist/cjs/c-badge_12.cjs.entry.js.map +1 -1
  8. package/dist/cjs/c-card-actions.cjs.entry.js +1 -1
  9. package/dist/cjs/c-card-content.cjs.entry.js +1 -1
  10. package/dist/cjs/c-card-title.cjs.entry.js +1 -1
  11. package/dist/cjs/c-checkbox_2.cjs.entry.js +1 -1
  12. package/dist/cjs/c-data-table.cjs.entry.js +1 -1
  13. package/dist/cjs/c-dropdown_2.cjs.entry.js +196 -377
  14. package/dist/cjs/c-dropdown_2.cjs.entry.js.map +1 -1
  15. package/dist/cjs/c-link.cjs.entry.js +1 -1
  16. package/dist/cjs/c-list-item-title.cjs.entry.js +1 -1
  17. package/dist/cjs/c-list-item.cjs.entry.js +1 -1
  18. package/dist/cjs/c-list.cjs.entry.js +1 -1
  19. package/dist/cjs/c-loader.cjs.entry.js +1 -1
  20. package/dist/cjs/c-login-button.cjs.entry.js +1 -1
  21. package/dist/cjs/c-login-buttons.cjs.entry.js +1 -1
  22. package/dist/cjs/c-login-card-actions.cjs.entry.js +1 -1
  23. package/dist/cjs/c-login-card-content.cjs.entry.js +1 -1
  24. package/dist/cjs/c-login-card-title.cjs.entry.js +1 -1
  25. package/dist/cjs/c-login-card.cjs.entry.js +2 -2
  26. package/dist/cjs/c-login-card.cjs.entry.js.map +1 -1
  27. package/dist/cjs/c-menu_2.cjs.entry.js +1 -1
  28. package/dist/cjs/c-message.cjs.entry.js +1 -1
  29. package/dist/cjs/c-modal.cjs.entry.js +7 -3
  30. package/dist/cjs/c-modal.cjs.entry.js.map +1 -1
  31. package/dist/cjs/c-navigation-button.cjs.entry.js +1 -1
  32. package/dist/cjs/c-option-value.cjs.entry.js +1 -1
  33. package/dist/cjs/c-option.cjs.entry.js +1 -1
  34. package/dist/cjs/c-otp-input.cjs.entry.js +2 -2
  35. package/dist/cjs/c-otp-input.cjs.entry.js.map +1 -1
  36. package/dist/cjs/c-page.cjs.entry.js +1 -1
  37. package/dist/cjs/c-progress-bar.cjs.entry.js +1 -1
  38. package/dist/cjs/c-radio-group.cjs.entry.js +1 -1
  39. package/dist/cjs/c-radio.cjs.entry.js +1 -1
  40. package/dist/cjs/c-select.cjs.entry.js +195 -246
  41. package/dist/cjs/c-select.cjs.entry.js.map +1 -1
  42. package/dist/cjs/c-side-navigation-item.cjs.entry.js +1 -1
  43. package/dist/cjs/c-side-navigation-title.cjs.entry.js +1 -1
  44. package/dist/cjs/c-side-navigation.cjs.entry.js +1 -1
  45. package/dist/cjs/c-status.cjs.entry.js +1 -1
  46. package/dist/cjs/c-step.cjs.entry.js +1 -1
  47. package/dist/cjs/c-steps.cjs.entry.js +1 -1
  48. package/dist/cjs/c-sub-navigation-item.cjs.entry.js +1 -1
  49. package/dist/cjs/c-swiper-tab.cjs.entry.js +1 -1
  50. package/dist/cjs/c-swiper.cjs.entry.js +1 -1
  51. package/dist/cjs/c-switch.cjs.entry.js +1 -1
  52. package/dist/cjs/c-tab-buttons.cjs.entry.js +1 -1
  53. package/dist/cjs/c-tab-item.cjs.entry.js +1 -1
  54. package/dist/cjs/c-tab-items.cjs.entry.js +1 -1
  55. package/dist/cjs/c-tab.cjs.entry.js +1 -1
  56. package/dist/cjs/c-table.cjs.entry.js +1 -1
  57. package/dist/cjs/c-tabs.cjs.entry.js +1 -1
  58. package/dist/cjs/c-tag.cjs.entry.js +1 -1
  59. package/dist/cjs/c-tags.cjs.entry.js +1 -1
  60. package/dist/cjs/c-text-field.cjs.entry.js +1 -1
  61. package/dist/cjs/c-toast.cjs.entry.js +1 -1
  62. package/dist/cjs/c-toasts.cjs.entry.js +1 -1
  63. package/dist/cjs/csc-ui.cjs.js +3 -3
  64. package/dist/cjs/csc-ui.cjs.js.map +1 -1
  65. package/dist/cjs/index-72dca436.js.map +1 -1
  66. package/dist/cjs/{index-3cad12b5.js → index-91ba22ab.js} +128 -58
  67. package/dist/cjs/index-91ba22ab.js.map +1 -0
  68. package/dist/cjs/loader.cjs.js +2 -2
  69. package/dist/collection/collection-manifest.json +2 -2
  70. package/dist/collection/components/c-autocomplete/c-autocomplete.css +33 -12
  71. package/dist/collection/components/c-autocomplete/c-autocomplete.js +297 -408
  72. package/dist/collection/components/c-autocomplete/c-autocomplete.js.map +1 -1
  73. package/dist/collection/components/c-dropdown/c-dropdown-options-item.js +3 -0
  74. package/dist/collection/components/c-dropdown/c-dropdown-options-item.js.map +1 -0
  75. package/dist/collection/components/c-dropdown/c-dropdown.css +42 -9
  76. package/dist/collection/components/c-dropdown/c-dropdown.js +293 -507
  77. package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
  78. package/dist/collection/components/c-icon/c-icon.css +13 -3
  79. package/dist/collection/components/c-icon/c-icon.js +3 -3
  80. package/dist/collection/components/c-icon/c-icon.js.map +1 -1
  81. package/dist/collection/components/c-icon-button/c-icon-button.css +5 -7
  82. package/dist/collection/components/c-input/c-input.css +13 -6
  83. package/dist/collection/components/c-input/c-input.js +59 -4
  84. package/dist/collection/components/c-input/c-input.js.map +1 -1
  85. package/dist/collection/components/c-login-card/c-login-card.css +3 -0
  86. package/dist/collection/components/c-modal/c-modal.css +3 -1
  87. package/dist/collection/components/c-modal/c-modal.js +23 -1
  88. package/dist/collection/components/c-modal/c-modal.js.map +1 -1
  89. package/dist/collection/components/c-otp-input/c-otp-input.js +1 -1
  90. package/dist/collection/components/c-otp-input/c-otp-input.js.map +1 -1
  91. package/dist/collection/components/c-select/c-select.css +0 -3
  92. package/dist/collection/components/c-select/c-select.js +326 -394
  93. package/dist/collection/components/c-select/c-select.js.map +1 -1
  94. package/dist/collection/types/index.js.map +1 -1
  95. package/dist/components/c-autocomplete.js +235 -215
  96. package/dist/components/c-autocomplete.js.map +1 -1
  97. package/dist/components/c-card.js +1 -1
  98. package/dist/components/c-data-table.js +1 -1
  99. package/dist/components/c-dropdown2.js +191 -388
  100. package/dist/components/c-dropdown2.js.map +1 -1
  101. package/dist/components/c-icon-button2.js +1 -1
  102. package/dist/components/c-icon-button2.js.map +1 -1
  103. package/dist/components/c-icon2.js +4 -4
  104. package/dist/components/c-icon2.js.map +1 -1
  105. package/dist/components/c-input2.js +20 -5
  106. package/dist/components/c-input2.js.map +1 -1
  107. package/dist/components/c-login-card.js +1 -1
  108. package/dist/components/c-login-card.js.map +1 -1
  109. package/dist/components/c-modal.js +7 -2
  110. package/dist/components/c-modal.js.map +1 -1
  111. package/dist/components/c-navigation-button.js +1 -1
  112. package/dist/components/c-otp-input.js +1 -1
  113. package/dist/components/c-otp-input.js.map +1 -1
  114. package/dist/components/c-pagination2.js +1 -1
  115. package/dist/components/c-select.js +243 -270
  116. package/dist/components/c-select.js.map +1 -1
  117. package/dist/components/c-side-navigation.js +1 -1
  118. package/dist/components/c-swiper.js +1 -1
  119. package/dist/components/c-tabs.js +1 -1
  120. package/dist/components/c-tag.js +1 -1
  121. package/dist/components/c-toast2.js +1 -1
  122. package/dist/components/index2.js.map +1 -1
  123. package/dist/components/mdi.js +1 -1
  124. package/dist/csc-ui/csc-ui.esm.js +1 -1
  125. package/dist/csc-ui/csc-ui.esm.js.map +1 -1
  126. package/dist/csc-ui/{p-02b57cbd.entry.js → p-019c6898.entry.js} +2 -2
  127. package/dist/csc-ui/{p-2c9aabef.entry.js → p-0666f12d.entry.js} +2 -2
  128. package/dist/csc-ui/{p-738a7d1d.entry.js → p-075a7c96.entry.js} +2 -2
  129. package/dist/csc-ui/{p-e0c3d13b.entry.js → p-0db503fb.entry.js} +2 -2
  130. package/dist/csc-ui/{p-a369bf94.entry.js → p-16098e94.entry.js} +2 -2
  131. package/dist/csc-ui/{p-4c23471f.entry.js → p-1a1e8b4b.entry.js} +2 -2
  132. package/dist/csc-ui/p-1bb973d5.entry.js +2 -0
  133. package/dist/csc-ui/p-1bb973d5.entry.js.map +1 -0
  134. package/dist/csc-ui/{p-bf307cb4.entry.js → p-2a622e79.entry.js} +2 -2
  135. package/dist/csc-ui/{p-cd047753.entry.js → p-2b5cd791.entry.js} +2 -2
  136. package/dist/csc-ui/p-30108adb.entry.js +2 -0
  137. package/dist/csc-ui/{p-b65fb982.entry.js.map → p-30108adb.entry.js.map} +1 -1
  138. package/dist/csc-ui/{p-37c19431.entry.js → p-45641e3d.entry.js} +2 -2
  139. package/dist/csc-ui/{p-8b7e9097.entry.js → p-47ca0a95.entry.js} +2 -2
  140. package/dist/csc-ui/p-494a4f19.entry.js +2 -0
  141. package/dist/csc-ui/{p-93280350.entry.js → p-4cf4ffff.entry.js} +2 -2
  142. package/dist/csc-ui/{p-dd6d422d.entry.js → p-4e1d8f5d.entry.js} +2 -2
  143. package/dist/csc-ui/{p-b09ba433.entry.js → p-4f9c92e4.entry.js} +2 -2
  144. package/dist/csc-ui/{p-dffa1f9f.js → p-5461ca29.js} +2 -2
  145. package/dist/csc-ui/p-55cbda54.entry.js +2 -0
  146. package/dist/csc-ui/{p-14ed80ac.entry.js.map → p-55cbda54.entry.js.map} +1 -1
  147. package/dist/csc-ui/p-565ec8e4.js +3 -0
  148. package/dist/csc-ui/p-565ec8e4.js.map +1 -0
  149. package/dist/csc-ui/{p-9f2311a7.entry.js → p-5d21c4c7.entry.js} +2 -2
  150. package/dist/csc-ui/{p-732bc932.entry.js → p-75798257.entry.js} +2 -2
  151. package/dist/csc-ui/{p-0bf28786.entry.js → p-7af82ab9.entry.js} +2 -2
  152. package/dist/csc-ui/{p-ef6162d9.entry.js → p-7ea05669.entry.js} +2 -2
  153. package/dist/csc-ui/{p-ef6162d9.entry.js.map → p-7ea05669.entry.js.map} +1 -1
  154. package/dist/csc-ui/{p-79308b3f.entry.js → p-82a711fb.entry.js} +2 -2
  155. package/dist/csc-ui/{p-c5deb643.entry.js → p-862486aa.entry.js} +2 -2
  156. package/dist/csc-ui/{p-6a1e5ae3.entry.js → p-873aa915.entry.js} +2 -2
  157. package/dist/csc-ui/p-88c60ba3.entry.js +2 -0
  158. package/dist/csc-ui/p-88c60ba3.entry.js.map +1 -0
  159. package/dist/csc-ui/{p-26021965.entry.js → p-8d34efbc.entry.js} +2 -2
  160. package/dist/csc-ui/{p-210da773.entry.js → p-8d5fe14f.entry.js} +2 -2
  161. package/dist/csc-ui/{p-f0329312.entry.js → p-958cf6ed.entry.js} +2 -2
  162. package/dist/csc-ui/{p-eb35a668.entry.js → p-98faa11d.entry.js} +2 -2
  163. package/dist/csc-ui/{p-05bb5c30.entry.js → p-a9ed6afb.entry.js} +2 -2
  164. package/dist/csc-ui/{p-d60032ce.entry.js → p-aa930d89.entry.js} +2 -2
  165. package/dist/csc-ui/{p-6ec9109d.entry.js → p-afd4cc03.entry.js} +2 -2
  166. package/dist/csc-ui/{p-a8073d7e.entry.js → p-baea3193.entry.js} +2 -2
  167. package/dist/csc-ui/{p-cea20d08.entry.js → p-bbe8423c.entry.js} +2 -2
  168. package/dist/csc-ui/{p-28282ef5.entry.js → p-bddd9153.entry.js} +2 -2
  169. package/dist/csc-ui/{p-f4a9cb4d.entry.js → p-bf01d3ef.entry.js} +2 -2
  170. package/dist/csc-ui/{p-0f76461d.entry.js → p-c291cbe2.entry.js} +2 -2
  171. package/dist/csc-ui/{p-f4d93d05.entry.js → p-caa58a64.entry.js} +2 -2
  172. package/dist/csc-ui/{p-a8da163c.entry.js → p-cc31d9b2.entry.js} +2 -2
  173. package/dist/csc-ui/p-d1089126.entry.js +2 -0
  174. package/dist/csc-ui/p-d1089126.entry.js.map +1 -0
  175. package/dist/csc-ui/{p-6f86810a.entry.js → p-d26167bc.entry.js} +2 -2
  176. package/dist/csc-ui/p-d2fc8cb4.entry.js +2 -0
  177. package/dist/csc-ui/p-d2fc8cb4.entry.js.map +1 -0
  178. package/dist/csc-ui/{p-c48a6e1d.entry.js → p-d76079eb.entry.js} +2 -2
  179. package/dist/csc-ui/{p-889d3d6d.entry.js → p-d7ca1f65.entry.js} +2 -2
  180. package/dist/csc-ui/{p-192145f2.entry.js → p-d8899493.entry.js} +2 -2
  181. package/dist/csc-ui/p-da6a2275.entry.js +2 -0
  182. package/dist/csc-ui/p-dda56b09.entry.js +2 -0
  183. package/dist/csc-ui/p-dda56b09.entry.js.map +1 -0
  184. package/dist/csc-ui/{p-cfc34289.entry.js → p-e3bd1f42.entry.js} +2 -2
  185. package/dist/csc-ui/{p-58aed6cc.entry.js → p-e6fb98a7.entry.js} +2 -2
  186. package/dist/csc-ui/{p-e970fa68.entry.js → p-e8bd7a76.entry.js} +2 -2
  187. package/dist/csc-ui/{p-55ca2b16.entry.js → p-ea99cd0e.entry.js} +2 -2
  188. package/dist/csc-ui/{p-32298609.entry.js → p-ec167606.entry.js} +2 -2
  189. package/dist/csc-ui/p-fafac729.js.map +1 -1
  190. package/dist/csc-ui/{p-dea9da0e.entry.js → p-fb098c2b.entry.js} +2 -2
  191. package/dist/csc-ui/p-fde2bd49.entry.js +2 -0
  192. package/dist/csc-ui/p-fde2bd49.entry.js.map +1 -0
  193. package/dist/csc-ui/{p-843b5cdb.entry.js → p-ff51bae3.entry.js} +2 -2
  194. package/dist/esm/c-accordion-item.entry.js +2 -2
  195. package/dist/esm/c-accordion.entry.js +1 -1
  196. package/dist/esm/c-alert.entry.js +2 -2
  197. package/dist/esm/c-autocomplete.entry.js +187 -191
  198. package/dist/esm/c-autocomplete.entry.js.map +1 -1
  199. package/dist/esm/c-badge_12.entry.js +7 -7
  200. package/dist/esm/c-badge_12.entry.js.map +1 -1
  201. package/dist/esm/c-card-actions.entry.js +1 -1
  202. package/dist/esm/c-card-content.entry.js +1 -1
  203. package/dist/esm/c-card-title.entry.js +1 -1
  204. package/dist/esm/c-checkbox_2.entry.js +2 -2
  205. package/dist/esm/c-data-table.entry.js +2 -2
  206. package/dist/esm/c-dropdown_2.entry.js +197 -378
  207. package/dist/esm/c-dropdown_2.entry.js.map +1 -1
  208. package/dist/esm/c-link.entry.js +1 -1
  209. package/dist/esm/c-list-item-title.entry.js +1 -1
  210. package/dist/esm/c-list-item.entry.js +1 -1
  211. package/dist/esm/c-list.entry.js +1 -1
  212. package/dist/esm/c-loader.entry.js +1 -1
  213. package/dist/esm/c-login-button.entry.js +1 -1
  214. package/dist/esm/c-login-buttons.entry.js +1 -1
  215. package/dist/esm/c-login-card-actions.entry.js +1 -1
  216. package/dist/esm/c-login-card-content.entry.js +1 -1
  217. package/dist/esm/c-login-card-title.entry.js +1 -1
  218. package/dist/esm/c-login-card.entry.js +2 -2
  219. package/dist/esm/c-login-card.entry.js.map +1 -1
  220. package/dist/esm/c-menu_2.entry.js +2 -2
  221. package/dist/esm/c-message.entry.js +2 -2
  222. package/dist/esm/c-modal.entry.js +7 -3
  223. package/dist/esm/c-modal.entry.js.map +1 -1
  224. package/dist/esm/c-navigation-button.entry.js +2 -2
  225. package/dist/esm/c-option-value.entry.js +1 -1
  226. package/dist/esm/c-option.entry.js +1 -1
  227. package/dist/esm/c-otp-input.entry.js +2 -2
  228. package/dist/esm/c-otp-input.entry.js.map +1 -1
  229. package/dist/esm/c-page.entry.js +1 -1
  230. package/dist/esm/c-progress-bar.entry.js +1 -1
  231. package/dist/esm/c-radio-group.entry.js +2 -2
  232. package/dist/esm/c-radio.entry.js +1 -1
  233. package/dist/esm/c-select.entry.js +196 -247
  234. package/dist/esm/c-select.entry.js.map +1 -1
  235. package/dist/esm/c-side-navigation-item.entry.js +2 -2
  236. package/dist/esm/c-side-navigation-title.entry.js +1 -1
  237. package/dist/esm/c-side-navigation.entry.js +2 -2
  238. package/dist/esm/c-status.entry.js +1 -1
  239. package/dist/esm/c-step.entry.js +1 -1
  240. package/dist/esm/c-steps.entry.js +1 -1
  241. package/dist/esm/c-sub-navigation-item.entry.js +1 -1
  242. package/dist/esm/c-swiper-tab.entry.js +1 -1
  243. package/dist/esm/c-swiper.entry.js +2 -2
  244. package/dist/esm/c-switch.entry.js +1 -1
  245. package/dist/esm/c-tab-buttons.entry.js +1 -1
  246. package/dist/esm/c-tab-item.entry.js +1 -1
  247. package/dist/esm/c-tab-items.entry.js +1 -1
  248. package/dist/esm/c-tab.entry.js +1 -1
  249. package/dist/esm/c-table.entry.js +1 -1
  250. package/dist/esm/c-tabs.entry.js +2 -2
  251. package/dist/esm/c-tag.entry.js +2 -2
  252. package/dist/esm/c-tags.entry.js +1 -1
  253. package/dist/esm/c-text-field.entry.js +2 -2
  254. package/dist/esm/c-toast.entry.js +2 -2
  255. package/dist/esm/c-toasts.entry.js +1 -1
  256. package/dist/esm/csc-ui.js +4 -4
  257. package/dist/esm/csc-ui.js.map +1 -1
  258. package/dist/esm/{index-cdf029b7.js → index-47956d53.js} +128 -58
  259. package/dist/esm/index-47956d53.js.map +1 -0
  260. package/dist/esm/index-dfaed2a4.js.map +1 -1
  261. package/dist/esm/loader.js +3 -3
  262. package/dist/esm/{mdi-a4a63b40.js → mdi-e92c0e44.js} +2 -2
  263. package/dist/esm/{mdi-a4a63b40.js.map → mdi-e92c0e44.js.map} +1 -1
  264. package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +41 -45
  265. package/dist/types/components/c-dropdown/c-dropdown-options-item.d.ts +3 -0
  266. package/dist/types/components/c-dropdown/c-dropdown.d.ts +35 -49
  267. package/dist/types/components/c-input/c-input.d.ts +2 -0
  268. package/dist/types/components/c-modal/c-modal.d.ts +1 -0
  269. package/dist/types/components/c-select/c-select.d.ts +39 -48
  270. package/dist/types/components.d.ts +118 -125
  271. package/dist/types/types/index.d.ts +1 -1
  272. package/package.json +2 -2
  273. package/vscode-data.json +37 -33
  274. package/dist/cjs/index-3cad12b5.js.map +0 -1
  275. package/dist/csc-ui/p-01ed27ec.entry.js +0 -2
  276. package/dist/csc-ui/p-01ed27ec.entry.js.map +0 -1
  277. package/dist/csc-ui/p-14ed80ac.entry.js +0 -2
  278. package/dist/csc-ui/p-2ff8e8e2.entry.js +0 -2
  279. package/dist/csc-ui/p-2ff8e8e2.entry.js.map +0 -1
  280. package/dist/csc-ui/p-50db6941.entry.js +0 -2
  281. package/dist/csc-ui/p-50db6941.entry.js.map +0 -1
  282. package/dist/csc-ui/p-7575c2c3.entry.js +0 -2
  283. package/dist/csc-ui/p-7575c2c3.entry.js.map +0 -1
  284. package/dist/csc-ui/p-9d54e9a4.js +0 -3
  285. package/dist/csc-ui/p-9d54e9a4.js.map +0 -1
  286. package/dist/csc-ui/p-b65fb982.entry.js +0 -2
  287. package/dist/csc-ui/p-c343dd6e.entry.js +0 -2
  288. package/dist/csc-ui/p-c79e12d7.entry.js +0 -2
  289. package/dist/csc-ui/p-c79e12d7.entry.js.map +0 -1
  290. package/dist/csc-ui/p-c7a07889.entry.js +0 -2
  291. package/dist/csc-ui/p-ff51acad.entry.js +0 -2
  292. package/dist/csc-ui/p-ff51acad.entry.js.map +0 -1
  293. package/dist/esm/index-cdf029b7.js.map +0 -1
  294. /package/dist/csc-ui/{p-02b57cbd.entry.js.map → p-019c6898.entry.js.map} +0 -0
  295. /package/dist/csc-ui/{p-2c9aabef.entry.js.map → p-0666f12d.entry.js.map} +0 -0
  296. /package/dist/csc-ui/{p-738a7d1d.entry.js.map → p-075a7c96.entry.js.map} +0 -0
  297. /package/dist/csc-ui/{p-e0c3d13b.entry.js.map → p-0db503fb.entry.js.map} +0 -0
  298. /package/dist/csc-ui/{p-a369bf94.entry.js.map → p-16098e94.entry.js.map} +0 -0
  299. /package/dist/csc-ui/{p-4c23471f.entry.js.map → p-1a1e8b4b.entry.js.map} +0 -0
  300. /package/dist/csc-ui/{p-bf307cb4.entry.js.map → p-2a622e79.entry.js.map} +0 -0
  301. /package/dist/csc-ui/{p-cd047753.entry.js.map → p-2b5cd791.entry.js.map} +0 -0
  302. /package/dist/csc-ui/{p-37c19431.entry.js.map → p-45641e3d.entry.js.map} +0 -0
  303. /package/dist/csc-ui/{p-8b7e9097.entry.js.map → p-47ca0a95.entry.js.map} +0 -0
  304. /package/dist/csc-ui/{p-c7a07889.entry.js.map → p-494a4f19.entry.js.map} +0 -0
  305. /package/dist/csc-ui/{p-93280350.entry.js.map → p-4cf4ffff.entry.js.map} +0 -0
  306. /package/dist/csc-ui/{p-dd6d422d.entry.js.map → p-4e1d8f5d.entry.js.map} +0 -0
  307. /package/dist/csc-ui/{p-b09ba433.entry.js.map → p-4f9c92e4.entry.js.map} +0 -0
  308. /package/dist/csc-ui/{p-dffa1f9f.js.map → p-5461ca29.js.map} +0 -0
  309. /package/dist/csc-ui/{p-9f2311a7.entry.js.map → p-5d21c4c7.entry.js.map} +0 -0
  310. /package/dist/csc-ui/{p-732bc932.entry.js.map → p-75798257.entry.js.map} +0 -0
  311. /package/dist/csc-ui/{p-0bf28786.entry.js.map → p-7af82ab9.entry.js.map} +0 -0
  312. /package/dist/csc-ui/{p-79308b3f.entry.js.map → p-82a711fb.entry.js.map} +0 -0
  313. /package/dist/csc-ui/{p-c5deb643.entry.js.map → p-862486aa.entry.js.map} +0 -0
  314. /package/dist/csc-ui/{p-6a1e5ae3.entry.js.map → p-873aa915.entry.js.map} +0 -0
  315. /package/dist/csc-ui/{p-26021965.entry.js.map → p-8d34efbc.entry.js.map} +0 -0
  316. /package/dist/csc-ui/{p-210da773.entry.js.map → p-8d5fe14f.entry.js.map} +0 -0
  317. /package/dist/csc-ui/{p-f0329312.entry.js.map → p-958cf6ed.entry.js.map} +0 -0
  318. /package/dist/csc-ui/{p-eb35a668.entry.js.map → p-98faa11d.entry.js.map} +0 -0
  319. /package/dist/csc-ui/{p-05bb5c30.entry.js.map → p-a9ed6afb.entry.js.map} +0 -0
  320. /package/dist/csc-ui/{p-d60032ce.entry.js.map → p-aa930d89.entry.js.map} +0 -0
  321. /package/dist/csc-ui/{p-6ec9109d.entry.js.map → p-afd4cc03.entry.js.map} +0 -0
  322. /package/dist/csc-ui/{p-a8073d7e.entry.js.map → p-baea3193.entry.js.map} +0 -0
  323. /package/dist/csc-ui/{p-cea20d08.entry.js.map → p-bbe8423c.entry.js.map} +0 -0
  324. /package/dist/csc-ui/{p-28282ef5.entry.js.map → p-bddd9153.entry.js.map} +0 -0
  325. /package/dist/csc-ui/{p-f4a9cb4d.entry.js.map → p-bf01d3ef.entry.js.map} +0 -0
  326. /package/dist/csc-ui/{p-0f76461d.entry.js.map → p-c291cbe2.entry.js.map} +0 -0
  327. /package/dist/csc-ui/{p-f4d93d05.entry.js.map → p-caa58a64.entry.js.map} +0 -0
  328. /package/dist/csc-ui/{p-a8da163c.entry.js.map → p-cc31d9b2.entry.js.map} +0 -0
  329. /package/dist/csc-ui/{p-6f86810a.entry.js.map → p-d26167bc.entry.js.map} +0 -0
  330. /package/dist/csc-ui/{p-c48a6e1d.entry.js.map → p-d76079eb.entry.js.map} +0 -0
  331. /package/dist/csc-ui/{p-889d3d6d.entry.js.map → p-d7ca1f65.entry.js.map} +0 -0
  332. /package/dist/csc-ui/{p-192145f2.entry.js.map → p-d8899493.entry.js.map} +0 -0
  333. /package/dist/csc-ui/{p-c343dd6e.entry.js.map → p-da6a2275.entry.js.map} +0 -0
  334. /package/dist/csc-ui/{p-cfc34289.entry.js.map → p-e3bd1f42.entry.js.map} +0 -0
  335. /package/dist/csc-ui/{p-58aed6cc.entry.js.map → p-e6fb98a7.entry.js.map} +0 -0
  336. /package/dist/csc-ui/{p-e970fa68.entry.js.map → p-e8bd7a76.entry.js.map} +0 -0
  337. /package/dist/csc-ui/{p-55ca2b16.entry.js.map → p-ea99cd0e.entry.js.map} +0 -0
  338. /package/dist/csc-ui/{p-32298609.entry.js.map → p-ec167606.entry.js.map} +0 -0
  339. /package/dist/csc-ui/{p-dea9da0e.entry.js.map → p-fb098c2b.entry.js.map} +0 -0
  340. /package/dist/csc-ui/{p-843b5cdb.entry.js.map → p-ff51bae3.entry.js.map} +0 -0
@@ -1,275 +1,210 @@
1
1
  import { Host, h, } from "@stencil/core";
2
- import { mdiChevronDown } from "@mdi/js";
2
+ import { mdiChevronDown, mdiClose } from "@mdi/js";
3
3
  export class CSelect {
4
4
  constructor() {
5
- this._itemRefs = [];
6
- this._cOptionElements = {};
7
- this._outerWrapperClasses = ['outer-wrapper'];
8
- this._validationClasses = ['validation-message'];
5
+ this._preventDialogOpen = false;
9
6
  this._debounce = null;
10
- this._observer = new IntersectionObserver((entries, observer) => {
11
- entries.forEach((entry) => {
12
- if (!entry.isIntersecting) {
13
- entry.target.scrollIntoView({
14
- block: 'nearest',
15
- inline: 'nearest',
16
- });
17
- observer.unobserve(entry.target);
18
- }
19
- else {
20
- observer.unobserve(entry.target);
21
- }
22
- });
23
- }, { threshold: 1 });
24
7
  this._lastKeyPressTime = null;
25
8
  this._searchString = '';
26
- this._blurred = false;
27
- this._optionItems = [];
28
- this._handleSlotChange = () => {
29
- this._getOptionItems();
9
+ this._toggleDropdown = (event) => {
10
+ event.stopPropagation();
11
+ if (this.dropdownVisible) {
12
+ this._dropdownElement.close();
13
+ return;
14
+ }
15
+ this._dropdownElement.open();
30
16
  };
31
- this.autofocus = false;
32
- this.disabled = false;
33
- this.hideDetails = false;
34
- this.hint = '';
17
+ this._onButtonKeyDown = (src, event) => {
18
+ event.stopPropagation();
19
+ if (event.key !== 'Tab')
20
+ event.preventDefault();
21
+ if (['Enter', ' '].includes(event.key)) {
22
+ if (src === 'chevron') {
23
+ this._toggleDropdown(event);
24
+ return;
25
+ }
26
+ this._onReset(event);
27
+ this._preventDialogOpen = true;
28
+ requestAnimationFrame(() => {
29
+ this._inputElement.focus();
30
+ });
31
+ }
32
+ };
33
+ this._onSlotChange = () => {
34
+ this.optionElements = this.el.querySelectorAll('c-option');
35
+ if (this.optionElements.length && !this.optionElementsExist) {
36
+ this.optionElementsExist = true;
37
+ }
38
+ };
39
+ this._onReset = (event) => {
40
+ event.stopPropagation();
41
+ this.changeValue.emit(null);
42
+ this._selectionElement.classList.remove('c-input-menu__selection--show');
43
+ this._selectionElement.replaceChildren(null);
44
+ this._preventDialogOpen = true;
45
+ this._cInputElement.reset();
46
+ this._inputElement.focus();
47
+ this._dropdownElement.updateList();
48
+ };
49
+ this._onInputFocus = () => {
50
+ if (!this._preventDialogOpen) {
51
+ this._dropdownElement.open();
52
+ }
53
+ this._updateStatusText();
54
+ this._preventDialogOpen = false;
55
+ };
56
+ this.items = [];
57
+ this.value = null;
35
58
  this.hostId = undefined;
59
+ this.clearable = false;
60
+ this.disabled = false;
36
61
  this.label = undefined;
37
- this.shadow = false;
38
62
  this.name = undefined;
63
+ this.placeholder = '';
64
+ this.hideDetails = false;
65
+ this.hint = '';
66
+ this.loading = false;
39
67
  this.required = false;
40
- this.returnValue = undefined;
41
68
  this.valid = true;
42
69
  this.validate = false;
43
70
  this.validateOnBlur = false;
44
71
  this.validation = 'Required field';
72
+ this.shadow = false;
73
+ this.returnObject = false;
45
74
  this.itemsPerPage = 6;
46
- this.placeholder = '';
47
- this.value = null;
48
- this.items = [];
49
75
  this.optionAsSelection = undefined;
50
- this.menuVisible = false;
76
+ this.optionElements = undefined;
51
77
  this.currentIndex = null;
52
- this.activeListItemId = null;
78
+ this.dropdownVisible = false;
53
79
  this.statusText = '';
54
- this.hasOptionItems = false;
55
- this.previousValue = { value: '', name: '' };
80
+ this.optionElementsExist = false;
56
81
  }
57
- onValueChange() {
58
- var _a;
59
- if (!this.value)
60
- return;
61
- const realValue = !((_a = this.value) === null || _a === void 0 ? void 0 : _a.value)
62
- ? this._items.find((item) => item.value === this.value)
63
- : this.value;
64
- this._valueChangedHandler(realValue);
65
- }
66
- validateChange(newValue) {
67
- if (newValue) {
68
- this._runValidate();
69
- }
70
- }
71
- onCurrentIndexChange(index) {
72
- var _a, _b, _c;
73
- this.activeListItemId = (_c = (_b = (_a = this._itemRefs[index]) === null || _a === void 0 ? void 0 : _a.ref) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : null;
74
- this._scrollToElement();
75
- this._updateStatusText();
82
+ get _id() {
83
+ return this.hostId || `select_${CSelect._uniqueId}`;
76
84
  }
77
85
  get _items() {
78
- return this.hasOptionItems ? this._optionItems : this.items;
79
- }
80
- _setValue(item) {
81
- return this.returnValue
82
- ? item === null || item === void 0 ? void 0 : item.value
83
- : {
84
- name: item === null || item === void 0 ? void 0 : item.name,
85
- value: item === null || item === void 0 ? void 0 : item.value,
86
- };
86
+ return this.optionElementsExist ? this.optionElements : this.items;
87
87
  }
88
- _valueChangedHandler(item) {
89
- var _a;
90
- if (!item)
91
- return;
92
- if (this.hasOptionItems && this.optionAsSelection) {
93
- const selection = this._cOptionElements[item.value.toString()];
94
- if (!selection)
95
- return;
96
- const clone = selection.cloneNode(true);
97
- this._selectionElement.classList.add('c-input-menu__selection--show');
98
- this._selectionElement.replaceChildren(clone);
99
- }
100
- this.currentIndex = this._items.findIndex((element) => element.value === (item === null || item === void 0 ? void 0 : item.value));
101
- const value = this._setValue(item);
102
- if (this.previousValue && ((_a = this.previousValue) === null || _a === void 0 ? void 0 : _a.value) === (item === null || item === void 0 ? void 0 : item.value))
103
- return;
104
- this.previousValue = item;
105
- this.changeValue.emit(value);
106
- this.internals.setFormValue(item.value);
107
- }
108
- _getLabel() {
88
+ get _value() {
109
89
  var _a, _b, _c, _d;
110
90
  if (!this.value)
111
91
  return '';
112
- if (this.returnValue &&
113
- ['number', 'string', 'boolean'].includes(typeof this.value)) {
114
- return (_b = (_a = this._items) === null || _a === void 0 ? void 0 : _a.find((item) => item.value === this.value)) === null || _b === void 0 ? void 0 : _b.name;
92
+ if (!this.returnObject &&
93
+ !['number', 'string'].includes(typeof this.value)) {
94
+ console.warn(`[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`);
95
+ return '';
96
+ }
97
+ if (!this.returnObject &&
98
+ ['number', 'string'].includes(typeof this.value)) {
99
+ return (_b = (_a = Array.from(this._items)) === null || _a === void 0 ? void 0 : _a.find((item) => item.value === this.value)) === null || _b === void 0 ? void 0 : _b.name;
115
100
  }
116
101
  return (_d = (_c = this._items) === null || _c === void 0 ? void 0 : _c.find((item) => item.value === this.value.value)) === null || _d === void 0 ? void 0 : _d.name;
117
102
  }
118
- _scrollToElement() {
119
- var _a;
120
- if (this._items.length > this.itemsPerPage) {
121
- const itemRef = (_a = this._itemRefs.find((item) => { var _a; return item.value === ((_a = this._items[this.currentIndex]) === null || _a === void 0 ? void 0 : _a.value); })) === null || _a === void 0 ? void 0 : _a.ref;
122
- if (!!itemRef) {
123
- this._observer.observe(itemRef);
124
- }
125
- }
103
+ async reset() {
104
+ this.changeValue.emit(null);
105
+ this._dropdownElement.updateList();
126
106
  }
127
- handleKeyDown(ev) {
128
- if (this.disabled)
129
- return;
130
- const letterNumber = /^[0-9a-zA-Z]+$/;
131
- if (ev.key.match(letterNumber) && ev.key.length === 1) {
132
- if (Date.now() - this._lastKeyPressTime > 3000 ||
133
- this._searchString.length > 2) {
134
- this._searchString = ev.key;
107
+ handleKeyDown(event) {
108
+ const alphanumeric = /^[0-9a-zA-Z ]+$/;
109
+ if (event.key.match(alphanumeric) && event.key.length === 1) {
110
+ if (this.dropdownVisible)
111
+ return;
112
+ if (Date.now() - this._lastKeyPressTime > 3000) {
113
+ this._searchString = event.key;
135
114
  }
136
115
  else {
137
- this._searchString = `${this._searchString}${ev.key}`;
116
+ this._searchString += event.key;
138
117
  }
139
118
  this._lastKeyPressTime = Date.now();
140
- const selectedItem = this._items.find((i) => i.name.toLowerCase().startsWith(this._searchString));
141
- function isItem(element) {
142
- return element === selectedItem;
143
- }
144
- if (selectedItem) {
145
- if (this.menuVisible) {
146
- this.currentIndex = this._items.findIndex(isItem);
147
- this._scrollToElement();
148
- }
149
- else {
150
- this.value = selectedItem;
151
- }
119
+ const selectionIndex = Array.from(this._items).findIndex((i) => i.name.toLowerCase().startsWith(this._searchString));
120
+ this.currentIndex = selectionIndex >= 0 ? selectionIndex : null;
121
+ if (this.currentIndex !== null) {
122
+ this._dropdownElement.selectItem(this.currentIndex);
152
123
  }
124
+ return;
125
+ }
126
+ if (event.key === 'Escape') {
127
+ this._preventDialogOpen = true;
128
+ this._dropdownElement.close();
129
+ this._inputElement.focus();
130
+ return;
153
131
  }
154
- if (ev.key === 'Tab') {
132
+ if (event.key === 'Tab') {
155
133
  this._dropdownElement.close();
134
+ return;
156
135
  }
157
- if (ev.key === 'ArrowDown') {
158
- ev.preventDefault();
159
- if (this._dropdownElement.isOpen)
136
+ if (event.key === 'ArrowDown') {
137
+ event.preventDefault();
138
+ if (!this._items.length)
139
+ return;
140
+ if (!this.dropdownVisible || this.currentIndex === null) {
141
+ this.currentIndex = 0;
142
+ this._dropdownElement.open();
143
+ this._dropdownElement.focusItem(this.currentIndex);
160
144
  return;
161
- this._showMenu();
145
+ }
146
+ this.currentIndex = Math.min(this.currentIndex + 1, this._items.length - 1);
162
147
  this._dropdownElement.focusItem(this.currentIndex);
148
+ return;
163
149
  }
164
- if (ev.key === 'ArrowUp') {
165
- ev.preventDefault();
166
- if (this._dropdownElement.isOpen)
150
+ if (event.key === 'ArrowUp') {
151
+ event.preventDefault();
152
+ if (this.currentIndex === 0) {
153
+ this._dropdownElement.close();
154
+ this._inputElement.focus();
155
+ }
156
+ if (!this.dropdownVisible || this.currentIndex === null) {
157
+ this.currentIndex = this._items.length - 1;
158
+ this._dropdownElement.open();
159
+ this._dropdownElement.focusItem(this.currentIndex);
167
160
  return;
168
- this._showMenu();
161
+ }
162
+ this.currentIndex = Math.max(this.currentIndex - 1, 0);
169
163
  this._dropdownElement.focusItem(this.currentIndex);
170
164
  }
171
- if (ev.key === ' ') {
172
- ev.preventDefault();
173
- this._showMenu();
165
+ if (event.key === ' ') {
166
+ event.preventDefault();
174
167
  }
175
- }
176
- async onItemSelection(index) {
177
- this.currentIndex = index;
178
- this._selectItem();
179
- }
180
- async onHideMenu() {
181
- this.menuVisible = false;
182
- }
183
- componentWillLoad() {
184
- var _a, _b;
185
- CSelect._uniqueId += 1;
186
- this._id =
187
- (_b = (_a = this.hostId) === null || _a === void 0 ? void 0 : _a.replace(/[^a-zA-Z0-9-_]/g, '')) !== null && _b !== void 0 ? _b : CSelect._uniqueId.toString();
188
- this._inputId =
189
- 'input-' +
190
- (this.hostId || this.label || this.placeholder)
191
- .replace(/[^a-zA-Z0-9-_]/g, '')
192
- .toLowerCase();
193
- this._setInitialValue();
194
- }
195
- _setInitialValue() {
196
- if (!this.value)
197
- return;
198
- const value = this.returnValue
199
- ? this.value
200
- : this.value.value;
201
- this.internals.setFormValue(value);
202
- }
203
- componentDidLoad() {
204
- this._getOptionItems();
205
- if ((this.value || typeof this.value === 'boolean') &&
206
- !this.currentIndex &&
207
- this.currentIndex !== 0) {
208
- this.currentIndex = this._items.findIndex((item) => item.value === this.value);
168
+ if (event.key === 'Enter') {
169
+ event.preventDefault();
170
+ if (this.currentIndex === null)
171
+ return;
172
+ this._dropdownElement.selectItem(this.currentIndex);
173
+ }
174
+ if (event.key === 'Home' && this.dropdownVisible) {
175
+ this.currentIndex = 0;
176
+ }
177
+ if (event.key === 'End' && this.dropdownVisible) {
178
+ this.currentIndex = this._items.length - 1;
209
179
  }
210
180
  }
211
- disconnectedCallback() {
212
- this._observer.disconnect();
213
- }
214
- _selectItem() {
215
- const selectedItem = this._items[this.currentIndex];
216
- this.value = selectedItem;
217
- this._scrollToElement();
218
- }
219
- async setActiveDescendant(id) {
220
- this._inputElement.setAttribute('aria-activedescendant', id);
221
- }
222
- _showMenu() {
223
- if (this.disabled)
224
- return;
225
- this.menuVisible = true;
226
- this._dropdownElement.open();
227
- }
228
- _getOptionItems() {
229
- requestAnimationFrame(() => {
230
- this._cOptionElements = {};
231
- let selection = null;
232
- this._optionItems = (this.el ? Array.from(this.el.querySelectorAll('c-option')) : []).map((item, index) => {
233
- const cSelectItem = {
234
- value: item.value,
235
- name: item.name || item.innerText,
236
- disabled: !!item.disabled,
237
- };
238
- if (item.selected) {
239
- selection = cSelectItem;
240
- }
241
- item.slot = `option-${index}`;
242
- this._cOptionElements[item.value.toString()] = item;
243
- return cSelectItem;
181
+ onDropdownStateChange(event) {
182
+ const isOpen = event.detail;
183
+ this.dropdownVisible = isOpen;
184
+ if (!isOpen) {
185
+ requestAnimationFrame(() => {
186
+ this.currentIndex = null;
244
187
  });
245
- this.hasOptionItems = !!this._optionItems.length;
246
- if (selection) {
247
- this._valueChangedHandler(selection);
248
- }
249
- });
250
- }
251
- _runValidate() {
252
- if (this.required &&
253
- !this.value &&
254
- (this._blurred || !this.validateOnBlur)) {
255
- this._outerWrapperClasses.push('required');
256
- this._validationClasses.push('show');
257
- }
258
- else {
259
- this._outerWrapperClasses = this._outerWrapperClasses.filter((c) => c !== 'required');
260
- this._validationClasses = this._validationClasses.filter((c) => c !== 'show');
261
188
  }
262
189
  }
263
- _renderChevron() {
264
- const classes = {
265
- 'c-input-menu__chevron': true,
266
- 'c-input-menu__chevron--active': this.menuVisible,
267
- };
268
- return (h("svg", { class: classes, viewBox: "0 0 24 24" }, h("path", { d: mdiChevronDown })));
190
+ onSelectOption(event) {
191
+ this._dropdownElement.close();
192
+ const { name, value } = event.detail;
193
+ if (this.optionElementsExist && this.optionAsSelection) {
194
+ const selection = Array.from(this.optionElements).find((item) => item.value === value && item.name === name);
195
+ if (!selection)
196
+ return;
197
+ const clone = selection.cloneNode(true);
198
+ this._selectionElement.classList.add('c-input-menu__selection--show');
199
+ this._selectionElement.replaceChildren(clone);
200
+ }
201
+ this.changeValue.emit(this.returnObject ? event.detail : value);
202
+ this._preventDialogOpen = true;
203
+ this._inputElement.focus();
269
204
  }
270
- _renderInputElement() {
271
- var _a, _b;
272
- return (h("div", { class: "c-input-menu__input" }, h("input", { "aria-controls": this._inputId + '-items', "aria-expanded": this.menuVisible.toString(), "aria-readonly": "true", "aria-haspopup": "listbox", ref: (el) => (this._inputElement = el), id: this._inputId, autocomplete: "off", class: "c-input__input", type: "text", value: (_a = this._getLabel()) !== null && _a !== void 0 ? _a : null, name: (_b = this.name) !== null && _b !== void 0 ? _b : null, readonly: "true" }), h("div", { ref: (el) => (this._selectionElement = el), class: "c-input-menu__selection" })));
205
+ _updateInput() {
206
+ this._dropdownElement.open();
207
+ this._dropdownElement.updateList();
273
208
  }
274
209
  _updateStatusText() {
275
210
  if (this._debounce !== null) {
@@ -277,27 +212,53 @@ export class CSelect {
277
212
  this._debounce = null;
278
213
  }
279
214
  this._debounce = window.setTimeout(() => {
280
- var _a;
281
- const selection = this.el.shadowRoot.querySelector('li[aria-selected="true"]');
215
+ this.statusText = '';
216
+ if (this.currentIndex === null) {
217
+ this.statusText = this._items.length
218
+ ? `${this._items.length} option${this._items.length !== 1 ? 's' : ''} available`
219
+ : 'No options available';
220
+ }
282
221
  const ending = !!this._items.length
283
- ? ', to navigate use up and down arrows'
222
+ ? ', navigate using the up and down arrows'
284
223
  : '';
285
- const isDisabled = !!((_a = selection === null || selection === void 0 ? void 0 : selection.classList) === null || _a === void 0 ? void 0 : _a.contains('disabled'));
286
- const beginning = isDisabled ? 'Disabled option - ' : '';
287
- const selectionText = !!selection
288
- ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`
289
- : null;
290
- this.statusText = `${selectionText || ending}`;
224
+ this._dropdownElement.setStatusText(this.statusText + ending);
291
225
  this._debounce = null;
292
226
  }, 1400);
293
227
  }
294
- render() {
228
+ componentWillLoad() {
229
+ CSelect._uniqueId += 1;
230
+ this._inputId =
231
+ 'input_' +
232
+ (this.hostId || this.label || this.placeholder).replace(/[^a-zA-Z0-9-_]/g, '');
233
+ }
234
+ _renderLoader() {
235
+ return h("c-spinner", { color: "var(--_c-autocomplete-active-color)", size: 20 });
236
+ }
237
+ _renderChevron() {
238
+ const classes = {
239
+ 'c-input-menu__chevron': true,
240
+ 'c-input-menu__chevron--active': this.dropdownVisible,
241
+ };
242
+ return (h("c-icon-button", { size: "x-small", class: classes, text: true, onClick: (event) => this._toggleDropdown(event), onKeyDown: (event) => this._onButtonKeyDown('chevron', event) }, h("c-icon", { path: mdiChevronDown, size: 24 })));
243
+ }
244
+ _renderInputElement() {
295
245
  var _a;
296
- return (h(Host, { title: (_a = this._getLabel()) !== null && _a !== void 0 ? _a : null }, h("div", { id: 'announce-' + this._id, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), h("c-input", { autofocus: this.autofocus, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, items: this._items, "items-per-page": this.itemsPerPage, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.value, variant: "select", onItemClick: () => this._showMenu() }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this._renderChevron(), h("slot", { onSlotchange: this._handleSlotChange })), h("c-dropdown", { ref: (el) => (this._dropdownElement = el), slot: "dropdown", items: this._items, options: this._cOptionElements, "items-per-page": this.itemsPerPage, parent: this.el, index: this.currentIndex, "input-id": this._inputId, type: "select" }), h("slot", { name: "post", slot: "post" }))));
246
+ return (h("div", { class: "c-input-menu__input" }, h("input", { type: "text", readonly: true, ref: (el) => (this._inputElement = el), "aria-expanded": this.dropdownVisible.toString(), "aria-owns": this._inputId + '-items', "aria-autocomplete": "list", autocomplete: "off", class: "c-input__input", role: "combobox", value: this._value, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: () => this._updateInput(), onFocus: () => this._onInputFocus() }), h("div", { ref: (el) => (this._selectionElement = el), class: "c-input-menu__selection" })));
247
+ }
248
+ _renderReset() {
249
+ return (h("c-icon-button", { "aria-label": "", size: "x-small", text: true, onClick: (event) => this._onReset(event), onKeyDown: (event) => this._onButtonKeyDown('reset', event) }, h("c-icon", { path: mdiClose, size: 20 })));
250
+ }
251
+ render() {
252
+ const itemType = this.optionElementsExist ? 'option' : 'item';
253
+ return (h(Host, null, h("c-dropdown", { ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "item-type": itemType, items: this._items, parent: this.el, type: "select" }, h("c-input", { slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.value, variant: "select", onClick: () => this._dropdownElement.open() }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading &&
254
+ this.value &&
255
+ this.clearable &&
256
+ this._renderReset(), !this.loading &&
257
+ (!this.value || !this.clearable) &&
258
+ this._renderChevron(), h("slot", { onSlotchange: () => this._onSlotChange() })), h("slot", { name: "post", slot: "post" })))));
297
259
  }
298
260
  static get is() { return "c-select"; }
299
261
  static get encapsulation() { return "shadow"; }
300
- static get formAssociated() { return true; }
301
262
  static get originalStyleUrls() {
302
263
  return {
303
264
  "$": ["c-select.scss"]
@@ -310,25 +271,70 @@ export class CSelect {
310
271
  }
311
272
  static get properties() {
312
273
  return {
313
- "autofocus": {
314
- "type": "boolean",
274
+ "items": {
275
+ "type": "unknown",
315
276
  "mutable": false,
316
277
  "complexType": {
317
- "original": "boolean",
318
- "resolved": "boolean",
319
- "references": {}
278
+ "original": "CSelectItem[]",
279
+ "resolved": "CSelectItem[]",
280
+ "references": {
281
+ "CSelectItem": {
282
+ "location": "import",
283
+ "path": "../../types",
284
+ "id": "src/types/index.ts::CSelectItem"
285
+ }
286
+ }
320
287
  },
321
288
  "required": false,
322
289
  "optional": false,
323
290
  "docs": {
324
291
  "tags": [],
325
- "text": "Auto focus the input"
292
+ "text": "Dropdown items"
326
293
  },
327
- "attribute": "autofocus",
294
+ "defaultValue": "[]"
295
+ },
296
+ "value": {
297
+ "type": "any",
298
+ "mutable": false,
299
+ "complexType": {
300
+ "original": "string | number | CSelectItem",
301
+ "resolved": "number | string | { name: string; value: string | number; disabled?: boolean; }",
302
+ "references": {
303
+ "CSelectItem": {
304
+ "location": "import",
305
+ "path": "../../types",
306
+ "id": "src/types/index.ts::CSelectItem"
307
+ }
308
+ }
309
+ },
310
+ "required": false,
311
+ "optional": false,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": "Selected item"
315
+ },
316
+ "attribute": "value",
328
317
  "reflect": false,
329
- "defaultValue": "false"
318
+ "defaultValue": "null"
330
319
  },
331
- "disabled": {
320
+ "hostId": {
321
+ "type": "string",
322
+ "mutable": false,
323
+ "complexType": {
324
+ "original": "string",
325
+ "resolved": "string",
326
+ "references": {}
327
+ },
328
+ "required": false,
329
+ "optional": false,
330
+ "docs": {
331
+ "tags": [],
332
+ "text": "Id of the element"
333
+ },
334
+ "attribute": "id",
335
+ "reflect": false
336
+ },
337
+ "clearable": {
332
338
  "type": "boolean",
333
339
  "mutable": false,
334
340
  "complexType": {
@@ -340,13 +346,13 @@ export class CSelect {
340
346
  "optional": false,
341
347
  "docs": {
342
348
  "tags": [],
343
- "text": "Disable the input"
349
+ "text": "Make the selected value clearable"
344
350
  },
345
- "attribute": "disabled",
351
+ "attribute": "clearable",
346
352
  "reflect": false,
347
353
  "defaultValue": "false"
348
354
  },
349
- "hideDetails": {
355
+ "disabled": {
350
356
  "type": "boolean",
351
357
  "mutable": false,
352
358
  "complexType": {
@@ -358,13 +364,13 @@ export class CSelect {
358
364
  "optional": false,
359
365
  "docs": {
360
366
  "tags": [],
361
- "text": "Hide the hint and error messages"
367
+ "text": "Disable the input"
362
368
  },
363
- "attribute": "hide-details",
369
+ "attribute": "disabled",
364
370
  "reflect": false,
365
371
  "defaultValue": "false"
366
372
  },
367
- "hint": {
373
+ "label": {
368
374
  "type": "string",
369
375
  "mutable": false,
370
376
  "complexType": {
@@ -376,13 +382,12 @@ export class CSelect {
376
382
  "optional": false,
377
383
  "docs": {
378
384
  "tags": [],
379
- "text": "Hint text for the input"
385
+ "text": "Element label"
380
386
  },
381
- "attribute": "hint",
382
- "reflect": false,
383
- "defaultValue": "''"
387
+ "attribute": "label",
388
+ "reflect": false
384
389
  },
385
- "hostId": {
390
+ "name": {
386
391
  "type": "string",
387
392
  "mutable": false,
388
393
  "complexType": {
@@ -394,12 +399,12 @@ export class CSelect {
394
399
  "optional": false,
395
400
  "docs": {
396
401
  "tags": [],
397
- "text": "Id of the element"
402
+ "text": "Input field name"
398
403
  },
399
- "attribute": "id",
404
+ "attribute": "name",
400
405
  "reflect": false
401
406
  },
402
- "label": {
407
+ "placeholder": {
403
408
  "type": "string",
404
409
  "mutable": false,
405
410
  "complexType": {
@@ -411,12 +416,13 @@ export class CSelect {
411
416
  "optional": false,
412
417
  "docs": {
413
418
  "tags": [],
414
- "text": "Element label"
419
+ "text": "Placeholder text"
415
420
  },
416
- "attribute": "label",
417
- "reflect": false
421
+ "attribute": "placeholder",
422
+ "reflect": false,
423
+ "defaultValue": "''"
418
424
  },
419
- "shadow": {
425
+ "hideDetails": {
420
426
  "type": "boolean",
421
427
  "mutable": false,
422
428
  "complexType": {
@@ -428,13 +434,13 @@ export class CSelect {
428
434
  "optional": false,
429
435
  "docs": {
430
436
  "tags": [],
431
- "text": "Shadow variant"
437
+ "text": "Hide the hint and error messages"
432
438
  },
433
- "attribute": "shadow",
439
+ "attribute": "hide-details",
434
440
  "reflect": false,
435
441
  "defaultValue": "false"
436
442
  },
437
- "name": {
443
+ "hint": {
438
444
  "type": "string",
439
445
  "mutable": false,
440
446
  "complexType": {
@@ -446,12 +452,13 @@ export class CSelect {
446
452
  "optional": false,
447
453
  "docs": {
448
454
  "tags": [],
449
- "text": "Input field name"
455
+ "text": "Hint text for the input"
450
456
  },
451
- "attribute": "name",
452
- "reflect": false
457
+ "attribute": "hint",
458
+ "reflect": false,
459
+ "defaultValue": "''"
453
460
  },
454
- "required": {
461
+ "loading": {
455
462
  "type": "boolean",
456
463
  "mutable": false,
457
464
  "complexType": {
@@ -463,17 +470,17 @@ export class CSelect {
463
470
  "optional": false,
464
471
  "docs": {
465
472
  "tags": [],
466
- "text": "Set as required"
473
+ "text": "Show loading state"
467
474
  },
468
- "attribute": "required",
475
+ "attribute": "loading",
469
476
  "reflect": false,
470
477
  "defaultValue": "false"
471
478
  },
472
- "returnValue": {
479
+ "required": {
473
480
  "type": "boolean",
474
481
  "mutable": false,
475
482
  "complexType": {
476
- "original": "false",
483
+ "original": "boolean",
477
484
  "resolved": "boolean",
478
485
  "references": {}
479
486
  },
@@ -481,10 +488,11 @@ export class CSelect {
481
488
  "optional": false,
482
489
  "docs": {
483
490
  "tags": [],
484
- "text": "Return only the item value rather than the whole item object"
491
+ "text": "Show required validation"
485
492
  },
486
- "attribute": "return-value",
487
- "reflect": false
493
+ "attribute": "required",
494
+ "reflect": false,
495
+ "defaultValue": "false"
488
496
  },
489
497
  "valid": {
490
498
  "type": "boolean",
@@ -498,7 +506,7 @@ export class CSelect {
498
506
  "optional": false,
499
507
  "docs": {
500
508
  "tags": [],
501
- "text": "Set the validity of the input"
509
+ "text": "Set the valid\u00EDty of the input"
502
510
  },
503
511
  "attribute": "valid",
504
512
  "reflect": false,
@@ -558,87 +566,59 @@ export class CSelect {
558
566
  "reflect": false,
559
567
  "defaultValue": "'Required field'"
560
568
  },
561
- "itemsPerPage": {
562
- "type": "number",
569
+ "shadow": {
570
+ "type": "boolean",
563
571
  "mutable": false,
564
572
  "complexType": {
565
- "original": "number",
566
- "resolved": "number",
573
+ "original": "boolean",
574
+ "resolved": "boolean",
567
575
  "references": {}
568
576
  },
569
577
  "required": false,
570
578
  "optional": false,
571
579
  "docs": {
572
580
  "tags": [],
573
- "text": "Items per page before adding scroll"
581
+ "text": "Shadow variant"
574
582
  },
575
- "attribute": "items-per-page",
583
+ "attribute": "shadow",
576
584
  "reflect": false,
577
- "defaultValue": "6"
585
+ "defaultValue": "false"
578
586
  },
579
- "placeholder": {
580
- "type": "string",
587
+ "returnObject": {
588
+ "type": "boolean",
581
589
  "mutable": false,
582
590
  "complexType": {
583
- "original": "string",
584
- "resolved": "string",
591
+ "original": "boolean",
592
+ "resolved": "boolean",
585
593
  "references": {}
586
594
  },
587
595
  "required": false,
588
596
  "optional": false,
589
597
  "docs": {
590
598
  "tags": [],
591
- "text": "Placeholder text"
599
+ "text": "Return object instead of value"
592
600
  },
593
- "attribute": "placeholder",
601
+ "attribute": "return-object",
594
602
  "reflect": false,
595
- "defaultValue": "''"
596
- },
597
- "value": {
598
- "type": "any",
599
- "mutable": true,
600
- "complexType": {
601
- "original": "string | number | boolean | CSelectItem",
602
- "resolved": "boolean | number | string | { name: string; value: string | number | boolean; disabled?: boolean; }",
603
- "references": {
604
- "CSelectItem": {
605
- "location": "import",
606
- "path": "../../types",
607
- "id": "src/types/index.ts::CSelectItem"
608
- }
609
- }
610
- },
611
- "required": false,
612
- "optional": false,
613
- "docs": {
614
- "tags": [],
615
- "text": "Selected item"
616
- },
617
- "attribute": "value",
618
- "reflect": false,
619
- "defaultValue": "null"
603
+ "defaultValue": "false"
620
604
  },
621
- "items": {
622
- "type": "unknown",
605
+ "itemsPerPage": {
606
+ "type": "number",
623
607
  "mutable": false,
624
608
  "complexType": {
625
- "original": "CSelectItem[]",
626
- "resolved": "CSelectItem[]",
627
- "references": {
628
- "CSelectItem": {
629
- "location": "import",
630
- "path": "../../types",
631
- "id": "src/types/index.ts::CSelectItem"
632
- }
633
- }
609
+ "original": "number",
610
+ "resolved": "number",
611
+ "references": {}
634
612
  },
635
613
  "required": false,
636
614
  "optional": false,
637
615
  "docs": {
638
616
  "tags": [],
639
- "text": "selectable items"
617
+ "text": "Items per page before adding scroll"
640
618
  },
641
- "defaultValue": "[]"
619
+ "attribute": "items-per-page",
620
+ "reflect": false,
621
+ "defaultValue": "6"
642
622
  },
643
623
  "optionAsSelection": {
644
624
  "type": "boolean",
@@ -661,12 +641,11 @@ export class CSelect {
661
641
  }
662
642
  static get states() {
663
643
  return {
664
- "menuVisible": {},
644
+ "optionElements": {},
665
645
  "currentIndex": {},
666
- "activeListItemId": {},
646
+ "dropdownVisible": {},
667
647
  "statusText": {},
668
- "hasOptionItems": {},
669
- "previousValue": {}
648
+ "optionElementsExist": {}
670
649
  };
671
650
  }
672
651
  static get events() {
@@ -678,7 +657,7 @@ export class CSelect {
678
657
  "composed": true,
679
658
  "docs": {
680
659
  "tags": [],
681
- "text": "Triggered when an item is selected"
660
+ "text": "Triggered when option is selected"
682
661
  },
683
662
  "complexType": {
684
663
  "original": "any",
@@ -689,27 +668,7 @@ export class CSelect {
689
668
  }
690
669
  static get methods() {
691
670
  return {
692
- "onItemSelection": {
693
- "complexType": {
694
- "signature": "(index: number) => Promise<void>",
695
- "parameters": [{
696
- "tags": [],
697
- "text": ""
698
- }],
699
- "references": {
700
- "Promise": {
701
- "location": "global",
702
- "id": "global::Promise"
703
- }
704
- },
705
- "return": "Promise<void>"
706
- },
707
- "docs": {
708
- "text": "Select item by index",
709
- "tags": []
710
- }
711
- },
712
- "onHideMenu": {
671
+ "reset": {
713
672
  "complexType": {
714
673
  "signature": "() => Promise<void>",
715
674
  "parameters": [],
@@ -722,61 +681,34 @@ export class CSelect {
722
681
  "return": "Promise<void>"
723
682
  },
724
683
  "docs": {
725
- "text": "Hide menu",
726
- "tags": [{
727
- "name": "private",
728
- "text": undefined
729
- }]
730
- }
731
- },
732
- "setActiveDescendant": {
733
- "complexType": {
734
- "signature": "(id: string) => Promise<void>",
735
- "parameters": [{
736
- "tags": [],
737
- "text": ""
738
- }],
739
- "references": {
740
- "Promise": {
741
- "location": "global",
742
- "id": "global::Promise"
743
- }
744
- },
745
- "return": "Promise<void>"
746
- },
747
- "docs": {
748
- "text": "",
749
- "tags": [{
750
- "name": "private",
751
- "text": undefined
752
- }]
684
+ "text": "Reset select state",
685
+ "tags": []
753
686
  }
754
687
  }
755
688
  };
756
689
  }
757
690
  static get elementRef() { return "el"; }
758
- static get watchers() {
759
- return [{
760
- "propName": "value",
761
- "methodName": "onValueChange"
762
- }, {
763
- "propName": "validate",
764
- "methodName": "validateChange"
765
- }, {
766
- "propName": "currentIndex",
767
- "methodName": "onCurrentIndexChange"
768
- }];
769
- }
770
691
  static get listeners() {
771
692
  return [{
772
693
  "name": "keydown",
773
694
  "method": "handleKeyDown",
774
695
  "target": undefined,
775
- "capture": true,
696
+ "capture": false,
697
+ "passive": true
698
+ }, {
699
+ "name": "dropdownStateChange",
700
+ "method": "onDropdownStateChange",
701
+ "target": undefined,
702
+ "capture": false,
703
+ "passive": false
704
+ }, {
705
+ "name": "selectOption",
706
+ "method": "onSelectOption",
707
+ "target": undefined,
708
+ "capture": false,
776
709
  "passive": false
777
710
  }];
778
711
  }
779
- static get attachInternalsMemberName() { return "internals"; }
780
712
  }
781
713
  CSelect._uniqueId = 0;
782
714
  //# sourceMappingURL=c-select.js.map