@cscfi/csc-ui 1.0.15 → 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 (342) 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 +7 -7
  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-card/c-card.css +2 -1
  74. package/dist/collection/components/c-dropdown/c-dropdown-options-item.js +3 -0
  75. package/dist/collection/components/c-dropdown/c-dropdown-options-item.js.map +1 -0
  76. package/dist/collection/components/c-dropdown/c-dropdown.css +42 -9
  77. package/dist/collection/components/c-dropdown/c-dropdown.js +293 -507
  78. package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
  79. package/dist/collection/components/c-icon/c-icon.css +13 -3
  80. package/dist/collection/components/c-icon/c-icon.js +3 -3
  81. package/dist/collection/components/c-icon/c-icon.js.map +1 -1
  82. package/dist/collection/components/c-icon-button/c-icon-button.css +5 -7
  83. package/dist/collection/components/c-input/c-input.css +13 -6
  84. package/dist/collection/components/c-input/c-input.js +59 -4
  85. package/dist/collection/components/c-input/c-input.js.map +1 -1
  86. package/dist/collection/components/c-login-card/c-login-card.css +3 -0
  87. package/dist/collection/components/c-modal/c-modal.css +3 -1
  88. package/dist/collection/components/c-modal/c-modal.js +23 -1
  89. package/dist/collection/components/c-modal/c-modal.js.map +1 -1
  90. package/dist/collection/components/c-otp-input/c-otp-input.js +1 -1
  91. package/dist/collection/components/c-otp-input/c-otp-input.js.map +1 -1
  92. package/dist/collection/components/c-select/c-select.css +0 -3
  93. package/dist/collection/components/c-select/c-select.js +326 -394
  94. package/dist/collection/components/c-select/c-select.js.map +1 -1
  95. package/dist/collection/types/index.js.map +1 -1
  96. package/dist/components/c-autocomplete.js +235 -215
  97. package/dist/components/c-autocomplete.js.map +1 -1
  98. package/dist/components/c-card.js +2 -2
  99. package/dist/components/c-card.js.map +1 -1
  100. package/dist/components/c-data-table.js +1 -1
  101. package/dist/components/c-dropdown2.js +191 -388
  102. package/dist/components/c-dropdown2.js.map +1 -1
  103. package/dist/components/c-icon-button2.js +1 -1
  104. package/dist/components/c-icon-button2.js.map +1 -1
  105. package/dist/components/c-icon2.js +4 -4
  106. package/dist/components/c-icon2.js.map +1 -1
  107. package/dist/components/c-input2.js +20 -5
  108. package/dist/components/c-input2.js.map +1 -1
  109. package/dist/components/c-login-card.js +1 -1
  110. package/dist/components/c-login-card.js.map +1 -1
  111. package/dist/components/c-modal.js +7 -2
  112. package/dist/components/c-modal.js.map +1 -1
  113. package/dist/components/c-navigation-button.js +1 -1
  114. package/dist/components/c-otp-input.js +1 -1
  115. package/dist/components/c-otp-input.js.map +1 -1
  116. package/dist/components/c-pagination2.js +1 -1
  117. package/dist/components/c-select.js +243 -270
  118. package/dist/components/c-select.js.map +1 -1
  119. package/dist/components/c-side-navigation.js +1 -1
  120. package/dist/components/c-swiper.js +1 -1
  121. package/dist/components/c-tabs.js +1 -1
  122. package/dist/components/c-tag.js +1 -1
  123. package/dist/components/c-toast2.js +1 -1
  124. package/dist/components/index2.js.map +1 -1
  125. package/dist/components/mdi.js +1 -1
  126. package/dist/csc-ui/csc-ui.esm.js +1 -1
  127. package/dist/csc-ui/csc-ui.esm.js.map +1 -1
  128. package/dist/csc-ui/{p-02b57cbd.entry.js → p-019c6898.entry.js} +2 -2
  129. package/dist/csc-ui/{p-2c9aabef.entry.js → p-0666f12d.entry.js} +2 -2
  130. package/dist/csc-ui/{p-738a7d1d.entry.js → p-075a7c96.entry.js} +2 -2
  131. package/dist/csc-ui/{p-e0c3d13b.entry.js → p-0db503fb.entry.js} +2 -2
  132. package/dist/csc-ui/{p-a369bf94.entry.js → p-16098e94.entry.js} +2 -2
  133. package/dist/csc-ui/{p-4c23471f.entry.js → p-1a1e8b4b.entry.js} +2 -2
  134. package/dist/csc-ui/p-1bb973d5.entry.js +2 -0
  135. package/dist/csc-ui/p-1bb973d5.entry.js.map +1 -0
  136. package/dist/csc-ui/{p-bf307cb4.entry.js → p-2a622e79.entry.js} +2 -2
  137. package/dist/csc-ui/{p-cd047753.entry.js → p-2b5cd791.entry.js} +2 -2
  138. package/dist/csc-ui/p-30108adb.entry.js +2 -0
  139. package/dist/csc-ui/{p-b65fb982.entry.js.map → p-30108adb.entry.js.map} +1 -1
  140. package/dist/csc-ui/{p-37c19431.entry.js → p-45641e3d.entry.js} +2 -2
  141. package/dist/csc-ui/{p-8b7e9097.entry.js → p-47ca0a95.entry.js} +2 -2
  142. package/dist/csc-ui/p-494a4f19.entry.js +2 -0
  143. package/dist/csc-ui/{p-93280350.entry.js → p-4cf4ffff.entry.js} +2 -2
  144. package/dist/csc-ui/{p-dd6d422d.entry.js → p-4e1d8f5d.entry.js} +2 -2
  145. package/dist/csc-ui/{p-b09ba433.entry.js → p-4f9c92e4.entry.js} +2 -2
  146. package/dist/csc-ui/{p-dffa1f9f.js → p-5461ca29.js} +2 -2
  147. package/dist/csc-ui/p-55cbda54.entry.js +2 -0
  148. package/dist/csc-ui/{p-14ed80ac.entry.js.map → p-55cbda54.entry.js.map} +1 -1
  149. package/dist/csc-ui/p-565ec8e4.js +3 -0
  150. package/dist/csc-ui/p-565ec8e4.js.map +1 -0
  151. package/dist/csc-ui/{p-9f2311a7.entry.js → p-5d21c4c7.entry.js} +2 -2
  152. package/dist/csc-ui/{p-732bc932.entry.js → p-75798257.entry.js} +2 -2
  153. package/dist/csc-ui/{p-0bf28786.entry.js → p-7af82ab9.entry.js} +2 -2
  154. package/dist/csc-ui/{p-ef6162d9.entry.js → p-7ea05669.entry.js} +2 -2
  155. package/dist/csc-ui/{p-ef6162d9.entry.js.map → p-7ea05669.entry.js.map} +1 -1
  156. package/dist/csc-ui/{p-79308b3f.entry.js → p-82a711fb.entry.js} +2 -2
  157. package/dist/csc-ui/{p-c5deb643.entry.js → p-862486aa.entry.js} +2 -2
  158. package/dist/csc-ui/{p-6a1e5ae3.entry.js → p-873aa915.entry.js} +2 -2
  159. package/dist/csc-ui/p-88c60ba3.entry.js +2 -0
  160. package/dist/csc-ui/p-88c60ba3.entry.js.map +1 -0
  161. package/dist/csc-ui/{p-26021965.entry.js → p-8d34efbc.entry.js} +2 -2
  162. package/dist/csc-ui/{p-210da773.entry.js → p-8d5fe14f.entry.js} +2 -2
  163. package/dist/csc-ui/{p-f0329312.entry.js → p-958cf6ed.entry.js} +2 -2
  164. package/dist/csc-ui/{p-eb35a668.entry.js → p-98faa11d.entry.js} +2 -2
  165. package/dist/csc-ui/{p-05bb5c30.entry.js → p-a9ed6afb.entry.js} +2 -2
  166. package/dist/csc-ui/{p-d60032ce.entry.js → p-aa930d89.entry.js} +2 -2
  167. package/dist/csc-ui/{p-6ec9109d.entry.js → p-afd4cc03.entry.js} +2 -2
  168. package/dist/csc-ui/{p-a8073d7e.entry.js → p-baea3193.entry.js} +2 -2
  169. package/dist/csc-ui/{p-cea20d08.entry.js → p-bbe8423c.entry.js} +2 -2
  170. package/dist/csc-ui/{p-28282ef5.entry.js → p-bddd9153.entry.js} +2 -2
  171. package/dist/csc-ui/{p-f4a9cb4d.entry.js → p-bf01d3ef.entry.js} +2 -2
  172. package/dist/csc-ui/{p-0f76461d.entry.js → p-c291cbe2.entry.js} +2 -2
  173. package/dist/csc-ui/{p-f4d93d05.entry.js → p-caa58a64.entry.js} +2 -2
  174. package/dist/csc-ui/{p-a8da163c.entry.js → p-cc31d9b2.entry.js} +2 -2
  175. package/dist/csc-ui/p-d1089126.entry.js +2 -0
  176. package/dist/csc-ui/p-d1089126.entry.js.map +1 -0
  177. package/dist/csc-ui/{p-6f86810a.entry.js → p-d26167bc.entry.js} +2 -2
  178. package/dist/csc-ui/p-d2fc8cb4.entry.js +2 -0
  179. package/dist/csc-ui/p-d2fc8cb4.entry.js.map +1 -0
  180. package/dist/csc-ui/{p-c48a6e1d.entry.js → p-d76079eb.entry.js} +2 -2
  181. package/dist/csc-ui/{p-889d3d6d.entry.js → p-d7ca1f65.entry.js} +2 -2
  182. package/dist/csc-ui/{p-192145f2.entry.js → p-d8899493.entry.js} +2 -2
  183. package/dist/csc-ui/p-da6a2275.entry.js +2 -0
  184. package/dist/csc-ui/p-dda56b09.entry.js +2 -0
  185. package/dist/csc-ui/p-dda56b09.entry.js.map +1 -0
  186. package/dist/csc-ui/{p-cfc34289.entry.js → p-e3bd1f42.entry.js} +2 -2
  187. package/dist/csc-ui/{p-58aed6cc.entry.js → p-e6fb98a7.entry.js} +2 -2
  188. package/dist/csc-ui/{p-e970fa68.entry.js → p-e8bd7a76.entry.js} +2 -2
  189. package/dist/csc-ui/{p-55ca2b16.entry.js → p-ea99cd0e.entry.js} +2 -2
  190. package/dist/csc-ui/{p-32298609.entry.js → p-ec167606.entry.js} +2 -2
  191. package/dist/csc-ui/p-fafac729.js.map +1 -1
  192. package/dist/csc-ui/{p-dea9da0e.entry.js → p-fb098c2b.entry.js} +2 -2
  193. package/dist/csc-ui/p-fde2bd49.entry.js +2 -0
  194. package/dist/csc-ui/p-fde2bd49.entry.js.map +1 -0
  195. package/dist/csc-ui/{p-843b5cdb.entry.js → p-ff51bae3.entry.js} +2 -2
  196. package/dist/esm/c-accordion-item.entry.js +2 -2
  197. package/dist/esm/c-accordion.entry.js +1 -1
  198. package/dist/esm/c-alert.entry.js +2 -2
  199. package/dist/esm/c-autocomplete.entry.js +187 -191
  200. package/dist/esm/c-autocomplete.entry.js.map +1 -1
  201. package/dist/esm/c-badge_12.entry.js +8 -8
  202. package/dist/esm/c-badge_12.entry.js.map +1 -1
  203. package/dist/esm/c-card-actions.entry.js +1 -1
  204. package/dist/esm/c-card-content.entry.js +1 -1
  205. package/dist/esm/c-card-title.entry.js +1 -1
  206. package/dist/esm/c-checkbox_2.entry.js +2 -2
  207. package/dist/esm/c-data-table.entry.js +2 -2
  208. package/dist/esm/c-dropdown_2.entry.js +197 -378
  209. package/dist/esm/c-dropdown_2.entry.js.map +1 -1
  210. package/dist/esm/c-link.entry.js +1 -1
  211. package/dist/esm/c-list-item-title.entry.js +1 -1
  212. package/dist/esm/c-list-item.entry.js +1 -1
  213. package/dist/esm/c-list.entry.js +1 -1
  214. package/dist/esm/c-loader.entry.js +1 -1
  215. package/dist/esm/c-login-button.entry.js +1 -1
  216. package/dist/esm/c-login-buttons.entry.js +1 -1
  217. package/dist/esm/c-login-card-actions.entry.js +1 -1
  218. package/dist/esm/c-login-card-content.entry.js +1 -1
  219. package/dist/esm/c-login-card-title.entry.js +1 -1
  220. package/dist/esm/c-login-card.entry.js +2 -2
  221. package/dist/esm/c-login-card.entry.js.map +1 -1
  222. package/dist/esm/c-menu_2.entry.js +2 -2
  223. package/dist/esm/c-message.entry.js +2 -2
  224. package/dist/esm/c-modal.entry.js +7 -3
  225. package/dist/esm/c-modal.entry.js.map +1 -1
  226. package/dist/esm/c-navigation-button.entry.js +2 -2
  227. package/dist/esm/c-option-value.entry.js +1 -1
  228. package/dist/esm/c-option.entry.js +1 -1
  229. package/dist/esm/c-otp-input.entry.js +2 -2
  230. package/dist/esm/c-otp-input.entry.js.map +1 -1
  231. package/dist/esm/c-page.entry.js +1 -1
  232. package/dist/esm/c-progress-bar.entry.js +1 -1
  233. package/dist/esm/c-radio-group.entry.js +2 -2
  234. package/dist/esm/c-radio.entry.js +1 -1
  235. package/dist/esm/c-select.entry.js +196 -247
  236. package/dist/esm/c-select.entry.js.map +1 -1
  237. package/dist/esm/c-side-navigation-item.entry.js +2 -2
  238. package/dist/esm/c-side-navigation-title.entry.js +1 -1
  239. package/dist/esm/c-side-navigation.entry.js +2 -2
  240. package/dist/esm/c-status.entry.js +1 -1
  241. package/dist/esm/c-step.entry.js +1 -1
  242. package/dist/esm/c-steps.entry.js +1 -1
  243. package/dist/esm/c-sub-navigation-item.entry.js +1 -1
  244. package/dist/esm/c-swiper-tab.entry.js +1 -1
  245. package/dist/esm/c-swiper.entry.js +2 -2
  246. package/dist/esm/c-switch.entry.js +1 -1
  247. package/dist/esm/c-tab-buttons.entry.js +1 -1
  248. package/dist/esm/c-tab-item.entry.js +1 -1
  249. package/dist/esm/c-tab-items.entry.js +1 -1
  250. package/dist/esm/c-tab.entry.js +1 -1
  251. package/dist/esm/c-table.entry.js +1 -1
  252. package/dist/esm/c-tabs.entry.js +2 -2
  253. package/dist/esm/c-tag.entry.js +2 -2
  254. package/dist/esm/c-tags.entry.js +1 -1
  255. package/dist/esm/c-text-field.entry.js +2 -2
  256. package/dist/esm/c-toast.entry.js +2 -2
  257. package/dist/esm/c-toasts.entry.js +1 -1
  258. package/dist/esm/csc-ui.js +4 -4
  259. package/dist/esm/csc-ui.js.map +1 -1
  260. package/dist/esm/{index-cdf029b7.js → index-47956d53.js} +128 -58
  261. package/dist/esm/index-47956d53.js.map +1 -0
  262. package/dist/esm/index-dfaed2a4.js.map +1 -1
  263. package/dist/esm/loader.js +3 -3
  264. package/dist/esm/{mdi-a4a63b40.js → mdi-e92c0e44.js} +2 -2
  265. package/dist/esm/{mdi-a4a63b40.js.map → mdi-e92c0e44.js.map} +1 -1
  266. package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +41 -45
  267. package/dist/types/components/c-dropdown/c-dropdown-options-item.d.ts +3 -0
  268. package/dist/types/components/c-dropdown/c-dropdown.d.ts +35 -49
  269. package/dist/types/components/c-input/c-input.d.ts +2 -0
  270. package/dist/types/components/c-modal/c-modal.d.ts +1 -0
  271. package/dist/types/components/c-select/c-select.d.ts +39 -48
  272. package/dist/types/components.d.ts +118 -125
  273. package/dist/types/types/index.d.ts +1 -1
  274. package/package.json +2 -2
  275. package/vscode-data.json +37 -33
  276. package/dist/cjs/index-3cad12b5.js.map +0 -1
  277. package/dist/csc-ui/p-01ed27ec.entry.js +0 -2
  278. package/dist/csc-ui/p-01ed27ec.entry.js.map +0 -1
  279. package/dist/csc-ui/p-14ed80ac.entry.js +0 -2
  280. package/dist/csc-ui/p-1faee730.entry.js +0 -2
  281. package/dist/csc-ui/p-1faee730.entry.js.map +0 -1
  282. package/dist/csc-ui/p-2ff8e8e2.entry.js +0 -2
  283. package/dist/csc-ui/p-2ff8e8e2.entry.js.map +0 -1
  284. package/dist/csc-ui/p-50db6941.entry.js +0 -2
  285. package/dist/csc-ui/p-50db6941.entry.js.map +0 -1
  286. package/dist/csc-ui/p-7575c2c3.entry.js +0 -2
  287. package/dist/csc-ui/p-7575c2c3.entry.js.map +0 -1
  288. package/dist/csc-ui/p-9d54e9a4.js +0 -3
  289. package/dist/csc-ui/p-9d54e9a4.js.map +0 -1
  290. package/dist/csc-ui/p-b65fb982.entry.js +0 -2
  291. package/dist/csc-ui/p-c343dd6e.entry.js +0 -2
  292. package/dist/csc-ui/p-c7a07889.entry.js +0 -2
  293. package/dist/csc-ui/p-ff51acad.entry.js +0 -2
  294. package/dist/csc-ui/p-ff51acad.entry.js.map +0 -1
  295. package/dist/esm/index-cdf029b7.js.map +0 -1
  296. /package/dist/csc-ui/{p-02b57cbd.entry.js.map → p-019c6898.entry.js.map} +0 -0
  297. /package/dist/csc-ui/{p-2c9aabef.entry.js.map → p-0666f12d.entry.js.map} +0 -0
  298. /package/dist/csc-ui/{p-738a7d1d.entry.js.map → p-075a7c96.entry.js.map} +0 -0
  299. /package/dist/csc-ui/{p-e0c3d13b.entry.js.map → p-0db503fb.entry.js.map} +0 -0
  300. /package/dist/csc-ui/{p-a369bf94.entry.js.map → p-16098e94.entry.js.map} +0 -0
  301. /package/dist/csc-ui/{p-4c23471f.entry.js.map → p-1a1e8b4b.entry.js.map} +0 -0
  302. /package/dist/csc-ui/{p-bf307cb4.entry.js.map → p-2a622e79.entry.js.map} +0 -0
  303. /package/dist/csc-ui/{p-cd047753.entry.js.map → p-2b5cd791.entry.js.map} +0 -0
  304. /package/dist/csc-ui/{p-37c19431.entry.js.map → p-45641e3d.entry.js.map} +0 -0
  305. /package/dist/csc-ui/{p-8b7e9097.entry.js.map → p-47ca0a95.entry.js.map} +0 -0
  306. /package/dist/csc-ui/{p-c7a07889.entry.js.map → p-494a4f19.entry.js.map} +0 -0
  307. /package/dist/csc-ui/{p-93280350.entry.js.map → p-4cf4ffff.entry.js.map} +0 -0
  308. /package/dist/csc-ui/{p-dd6d422d.entry.js.map → p-4e1d8f5d.entry.js.map} +0 -0
  309. /package/dist/csc-ui/{p-b09ba433.entry.js.map → p-4f9c92e4.entry.js.map} +0 -0
  310. /package/dist/csc-ui/{p-dffa1f9f.js.map → p-5461ca29.js.map} +0 -0
  311. /package/dist/csc-ui/{p-9f2311a7.entry.js.map → p-5d21c4c7.entry.js.map} +0 -0
  312. /package/dist/csc-ui/{p-732bc932.entry.js.map → p-75798257.entry.js.map} +0 -0
  313. /package/dist/csc-ui/{p-0bf28786.entry.js.map → p-7af82ab9.entry.js.map} +0 -0
  314. /package/dist/csc-ui/{p-79308b3f.entry.js.map → p-82a711fb.entry.js.map} +0 -0
  315. /package/dist/csc-ui/{p-c5deb643.entry.js.map → p-862486aa.entry.js.map} +0 -0
  316. /package/dist/csc-ui/{p-6a1e5ae3.entry.js.map → p-873aa915.entry.js.map} +0 -0
  317. /package/dist/csc-ui/{p-26021965.entry.js.map → p-8d34efbc.entry.js.map} +0 -0
  318. /package/dist/csc-ui/{p-210da773.entry.js.map → p-8d5fe14f.entry.js.map} +0 -0
  319. /package/dist/csc-ui/{p-f0329312.entry.js.map → p-958cf6ed.entry.js.map} +0 -0
  320. /package/dist/csc-ui/{p-eb35a668.entry.js.map → p-98faa11d.entry.js.map} +0 -0
  321. /package/dist/csc-ui/{p-05bb5c30.entry.js.map → p-a9ed6afb.entry.js.map} +0 -0
  322. /package/dist/csc-ui/{p-d60032ce.entry.js.map → p-aa930d89.entry.js.map} +0 -0
  323. /package/dist/csc-ui/{p-6ec9109d.entry.js.map → p-afd4cc03.entry.js.map} +0 -0
  324. /package/dist/csc-ui/{p-a8073d7e.entry.js.map → p-baea3193.entry.js.map} +0 -0
  325. /package/dist/csc-ui/{p-cea20d08.entry.js.map → p-bbe8423c.entry.js.map} +0 -0
  326. /package/dist/csc-ui/{p-28282ef5.entry.js.map → p-bddd9153.entry.js.map} +0 -0
  327. /package/dist/csc-ui/{p-f4a9cb4d.entry.js.map → p-bf01d3ef.entry.js.map} +0 -0
  328. /package/dist/csc-ui/{p-0f76461d.entry.js.map → p-c291cbe2.entry.js.map} +0 -0
  329. /package/dist/csc-ui/{p-f4d93d05.entry.js.map → p-caa58a64.entry.js.map} +0 -0
  330. /package/dist/csc-ui/{p-a8da163c.entry.js.map → p-cc31d9b2.entry.js.map} +0 -0
  331. /package/dist/csc-ui/{p-6f86810a.entry.js.map → p-d26167bc.entry.js.map} +0 -0
  332. /package/dist/csc-ui/{p-c48a6e1d.entry.js.map → p-d76079eb.entry.js.map} +0 -0
  333. /package/dist/csc-ui/{p-889d3d6d.entry.js.map → p-d7ca1f65.entry.js.map} +0 -0
  334. /package/dist/csc-ui/{p-192145f2.entry.js.map → p-d8899493.entry.js.map} +0 -0
  335. /package/dist/csc-ui/{p-c343dd6e.entry.js.map → p-da6a2275.entry.js.map} +0 -0
  336. /package/dist/csc-ui/{p-cfc34289.entry.js.map → p-e3bd1f42.entry.js.map} +0 -0
  337. /package/dist/csc-ui/{p-58aed6cc.entry.js.map → p-e6fb98a7.entry.js.map} +0 -0
  338. /package/dist/csc-ui/{p-e970fa68.entry.js.map → p-e8bd7a76.entry.js.map} +0 -0
  339. /package/dist/csc-ui/{p-55ca2b16.entry.js.map → p-ea99cd0e.entry.js.map} +0 -0
  340. /package/dist/csc-ui/{p-32298609.entry.js.map → p-ec167606.entry.js.map} +0 -0
  341. /package/dist/csc-ui/{p-dea9da0e.entry.js.map → p-fb098c2b.entry.js.map} +0 -0
  342. /package/dist/csc-ui/{p-843b5cdb.entry.js.map → p-ff51bae3.entry.js.map} +0 -0
@@ -2,290 +2,218 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3cad12b5.js');
5
+ const index = require('./index-91ba22ab.js');
6
6
  const mdi = require('./mdi-16842afc.js');
7
7
 
8
- const cSelectCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-select-active-color:var(--c-select-active-color, var(--c-primary-600));--_c-select-inactive-color:var(--c-select-inactive-color, var(--c-tertiary-600));--_c-select-background-color:var(--c-select-background-color, var(--c-transparent));--_c-select-text-color:var(--c-select-text-color, var(--c-text-body));--_c-select-placeholder-color:var(--c-select-placeholder-color, var(--c-tertiary-500));--_c-select-option-background-color:var(--c-select-option-background-color, var(--c-white));--_c-select-option-background-color-hover:var(--c-select-option-background-color-hover, var(--c-primary-100));--_c-select-option-text-color:var(--c-select-option-text-color, var(--c-text-body));--_c-input-active-color:var(--_c-select-active-color);--_c-input-inactive-color:var(--_c-select-inactive-color);--_c-input-background-color:var(--_c-select-background-color);--_c-input-text-color:var(--_c-select-text-color);--_c-input-placeholder-color:var(--_c-select-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;height:22px;width:22px;min-width:22px;transform:rotate(0deg);transition:transform 0.3s ease-in-out}.c-input-menu__chevron--active{transform:rotate(180deg)}.c-input-menu__input{width:100%;display:flex;justify-items:stretch}.c-input-menu__selection{display:none;pointer-events:none}.c-input-menu__selection--show{align-items:center;display:flex;width:100%;color:var(--_c-select-active-color)}.c-input-menu__item-wrapper{position:absolute;width:100%;top:44px;z-index:10;margin-left:calc(var(--_c-input-label-position) * -1)}.c-input-menu__item-wrapper--shadow{top:47px}.c-input-menu__items{position:absolute;background-color:var(--_c-select-option-background-color);min-width:calc(100% + 24px);box-shadow:0 8px 16px 0 rgba(0, 0, 0, 0.2);z-index:10;user-select:none;border-radius:4px;margin:0 -12px;overflow-y:scroll;list-style:none;padding:0}.c-input-menu__items--hidden{display:none}.c-input-menu__items li{cursor:pointer;display:flex;min-height:48px;padding:0 12px;transition:background-color 0.3s;font-size:14px;align-items:center;justify-content:flex-start;color:var(--_c-select-option-text-color)}.c-input-menu__items li.disabled{background-color:var(--c-tertiary-100);filter:grayscale(1) opacity(0.6);cursor:default}.c-input-menu__items li.disabled:hover{background-color:var(--c-tertiary-100)}.c-input-menu__items li.dense{padding:10px 14px}.c-input-menu__items li:hover{background-color:var(--_c-select-option-background-color-hover)}.c-input-menu__items li[aria-selected=true]{background-color:var(--_c-select-option-background-color-hover);box-shadow:inset 0 0 0 1px var(--_c-select-active-color);border-radius:4px;backface-visibility:hidden;transform:translate3d(0, 0, 0)}.c-input-menu__items li.none{color:rgba(0, 0, 0, 0.5)}.c-input-menu__items--empty li{color:var(--c-text-system);cursor:default;gap:8px;pointer-events:none}.c-input-menu__items--empty li svg{fill:var(--c-warning-600);height:18px;width:18px}input{max-height:32px;padding:8px 0;background-color:transparent;border:none;color:var(--c-text-body);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%;pointer-events:none}input:focus,input:active{outline:none}input::-ms-reveal{display:none}svg{fill:currentColor;height:22px;width:22px}.c-input--disabled{color:var(--c-tertiary-400)}.c-input:focus-within{color:var(--c-primary-600)}.c-input--error{color:var(--c-error-600)}.c-input--error:focus-within{color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";
8
+ const cSelectCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-select-active-color:var(--c-select-active-color, var(--c-primary-600));--_c-select-inactive-color:var(--c-select-inactive-color, var(--c-tertiary-600));--_c-select-background-color:var(--c-select-background-color, var(--c-transparent));--_c-select-text-color:var(--c-select-text-color, var(--c-text-body));--_c-select-placeholder-color:var(--c-select-placeholder-color, var(--c-tertiary-500));--_c-select-option-background-color:var(--c-select-option-background-color, var(--c-white));--_c-select-option-background-color-hover:var(--c-select-option-background-color-hover, var(--c-primary-100));--_c-select-option-text-color:var(--c-select-option-text-color, var(--c-text-body));--_c-input-active-color:var(--_c-select-active-color);--_c-input-inactive-color:var(--_c-select-inactive-color);--_c-input-background-color:var(--_c-select-background-color);--_c-input-text-color:var(--_c-select-text-color);--_c-input-placeholder-color:var(--_c-select-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;transform:rotate(0deg);transition:transform 0.3s ease-in-out}.c-input-menu__chevron--active{transform:rotate(180deg)}.c-input-menu__input{width:100%;display:flex;justify-items:stretch}.c-input-menu__selection{display:none;pointer-events:none}.c-input-menu__selection--show{align-items:center;display:flex;width:100%;color:var(--_c-select-active-color)}.c-input-menu__item-wrapper{position:absolute;width:100%;top:44px;z-index:10;margin-left:calc(var(--_c-input-label-position) * -1)}.c-input-menu__item-wrapper--shadow{top:47px}.c-input-menu__items{position:absolute;background-color:var(--_c-select-option-background-color);min-width:calc(100% + 24px);box-shadow:0 8px 16px 0 rgba(0, 0, 0, 0.2);z-index:10;user-select:none;border-radius:4px;margin:0 -12px;overflow-y:scroll;list-style:none;padding:0}.c-input-menu__items--hidden{display:none}.c-input-menu__items li{cursor:pointer;display:flex;min-height:48px;padding:0 12px;transition:background-color 0.3s;font-size:14px;align-items:center;justify-content:flex-start;color:var(--_c-select-option-text-color)}.c-input-menu__items li.disabled{background-color:var(--c-tertiary-100);filter:grayscale(1) opacity(0.6);cursor:default}.c-input-menu__items li.disabled:hover{background-color:var(--c-tertiary-100)}.c-input-menu__items li.dense{padding:10px 14px}.c-input-menu__items li:hover{background-color:var(--_c-select-option-background-color-hover)}.c-input-menu__items li[aria-selected=true]{background-color:var(--_c-select-option-background-color-hover);box-shadow:inset 0 0 0 1px var(--_c-select-active-color);border-radius:4px;backface-visibility:hidden;transform:translate3d(0, 0, 0)}.c-input-menu__items li.none{color:rgba(0, 0, 0, 0.5)}.c-input-menu__items--empty li{color:var(--c-text-system);cursor:default;gap:8px;pointer-events:none}.c-input-menu__items--empty li svg{fill:var(--c-warning-600);height:18px;width:18px}input{max-height:32px;padding:8px 0;background-color:transparent;border:none;color:var(--c-text-body);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%;pointer-events:none}input:focus,input:active{outline:none}input::-ms-reveal{display:none}svg{fill:currentColor;height:22px;width:22px}.c-input--disabled{color:var(--c-tertiary-400)}.c-input:focus-within{color:var(--c-primary-600)}.c-input--error{color:var(--c-error-600)}.c-input--error:focus-within{color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";
9
9
 
10
10
  const CSelect = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
13
  this.changeValue = index.createEvent(this, "changeValue", 3);
14
- if (hostRef.$hostElement$["s-ei"]) {
15
- this.internals = hostRef.$hostElement$["s-ei"];
16
- }
17
- else {
18
- this.internals = hostRef.$hostElement$.attachInternals();
19
- hostRef.$hostElement$["s-ei"] = this.internals;
20
- }
21
- this._itemRefs = [];
22
- this._cOptionElements = {};
23
- this._outerWrapperClasses = ['outer-wrapper'];
24
- this._validationClasses = ['validation-message'];
14
+ this._preventDialogOpen = false;
25
15
  this._debounce = null;
26
- this._observer = new IntersectionObserver((entries, observer) => {
27
- entries.forEach((entry) => {
28
- if (!entry.isIntersecting) {
29
- entry.target.scrollIntoView({
30
- block: 'nearest',
31
- inline: 'nearest',
32
- });
33
- observer.unobserve(entry.target);
34
- }
35
- else {
36
- observer.unobserve(entry.target);
37
- }
38
- });
39
- }, { threshold: 1 });
40
16
  this._lastKeyPressTime = null;
41
17
  this._searchString = '';
42
- this._blurred = false;
43
- this._optionItems = [];
44
- this._handleSlotChange = () => {
45
- this._getOptionItems();
18
+ this._toggleDropdown = (event) => {
19
+ event.stopPropagation();
20
+ if (this.dropdownVisible) {
21
+ this._dropdownElement.close();
22
+ return;
23
+ }
24
+ this._dropdownElement.open();
46
25
  };
47
- this.autofocus = false;
48
- this.disabled = false;
49
- this.hideDetails = false;
50
- this.hint = '';
26
+ this._onButtonKeyDown = (src, event) => {
27
+ event.stopPropagation();
28
+ if (event.key !== 'Tab')
29
+ event.preventDefault();
30
+ if (['Enter', ' '].includes(event.key)) {
31
+ if (src === 'chevron') {
32
+ this._toggleDropdown(event);
33
+ return;
34
+ }
35
+ this._onReset(event);
36
+ this._preventDialogOpen = true;
37
+ requestAnimationFrame(() => {
38
+ this._inputElement.focus();
39
+ });
40
+ }
41
+ };
42
+ this._onSlotChange = () => {
43
+ this.optionElements = this.el.querySelectorAll('c-option');
44
+ if (this.optionElements.length && !this.optionElementsExist) {
45
+ this.optionElementsExist = true;
46
+ }
47
+ };
48
+ this._onReset = (event) => {
49
+ event.stopPropagation();
50
+ this.changeValue.emit(null);
51
+ this._selectionElement.classList.remove('c-input-menu__selection--show');
52
+ this._selectionElement.replaceChildren(null);
53
+ this._preventDialogOpen = true;
54
+ this._cInputElement.reset();
55
+ this._inputElement.focus();
56
+ this._dropdownElement.updateList();
57
+ };
58
+ this._onInputFocus = () => {
59
+ if (!this._preventDialogOpen) {
60
+ this._dropdownElement.open();
61
+ }
62
+ this._updateStatusText();
63
+ this._preventDialogOpen = false;
64
+ };
65
+ this.items = [];
66
+ this.value = null;
51
67
  this.hostId = undefined;
68
+ this.clearable = false;
69
+ this.disabled = false;
52
70
  this.label = undefined;
53
- this.shadow = false;
54
71
  this.name = undefined;
72
+ this.placeholder = '';
73
+ this.hideDetails = false;
74
+ this.hint = '';
75
+ this.loading = false;
55
76
  this.required = false;
56
- this.returnValue = undefined;
57
77
  this.valid = true;
58
78
  this.validate = false;
59
79
  this.validateOnBlur = false;
60
80
  this.validation = 'Required field';
81
+ this.shadow = false;
82
+ this.returnObject = false;
61
83
  this.itemsPerPage = 6;
62
- this.placeholder = '';
63
- this.value = null;
64
- this.items = [];
65
84
  this.optionAsSelection = undefined;
66
- this.menuVisible = false;
85
+ this.optionElements = undefined;
67
86
  this.currentIndex = null;
68
- this.activeListItemId = null;
87
+ this.dropdownVisible = false;
69
88
  this.statusText = '';
70
- this.hasOptionItems = false;
71
- this.previousValue = { value: '', name: '' };
89
+ this.optionElementsExist = false;
72
90
  }
73
- onValueChange() {
74
- var _a;
75
- if (!this.value)
76
- return;
77
- const realValue = !((_a = this.value) === null || _a === void 0 ? void 0 : _a.value)
78
- ? this._items.find((item) => item.value === this.value)
79
- : this.value;
80
- this._valueChangedHandler(realValue);
81
- }
82
- validateChange(newValue) {
83
- if (newValue) {
84
- this._runValidate();
85
- }
86
- }
87
- onCurrentIndexChange(index) {
88
- var _a, _b, _c;
89
- 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;
90
- this._scrollToElement();
91
- this._updateStatusText();
91
+ get _id() {
92
+ return this.hostId || `select_${CSelect._uniqueId}`;
92
93
  }
93
94
  get _items() {
94
- return this.hasOptionItems ? this._optionItems : this.items;
95
- }
96
- _setValue(item) {
97
- return this.returnValue
98
- ? item === null || item === void 0 ? void 0 : item.value
99
- : {
100
- name: item === null || item === void 0 ? void 0 : item.name,
101
- value: item === null || item === void 0 ? void 0 : item.value,
102
- };
95
+ return this.optionElementsExist ? this.optionElements : this.items;
103
96
  }
104
- _valueChangedHandler(item) {
105
- var _a;
106
- if (!item)
107
- return;
108
- if (this.hasOptionItems && this.optionAsSelection) {
109
- const selection = this._cOptionElements[item.value.toString()];
110
- if (!selection)
111
- return;
112
- const clone = selection.cloneNode(true);
113
- this._selectionElement.classList.add('c-input-menu__selection--show');
114
- this._selectionElement.replaceChildren(clone);
115
- }
116
- this.currentIndex = this._items.findIndex((element) => element.value === (item === null || item === void 0 ? void 0 : item.value));
117
- const value = this._setValue(item);
118
- if (this.previousValue && ((_a = this.previousValue) === null || _a === void 0 ? void 0 : _a.value) === (item === null || item === void 0 ? void 0 : item.value))
119
- return;
120
- this.previousValue = item;
121
- this.changeValue.emit(value);
122
- this.internals.setFormValue(item.value);
123
- }
124
- _getLabel() {
97
+ get _value() {
125
98
  var _a, _b, _c, _d;
126
99
  if (!this.value)
127
100
  return '';
128
- if (this.returnValue &&
129
- ['number', 'string', 'boolean'].includes(typeof this.value)) {
130
- 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;
101
+ if (!this.returnObject &&
102
+ !['number', 'string'].includes(typeof this.value)) {
103
+ console.warn(`[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`);
104
+ return '';
105
+ }
106
+ if (!this.returnObject &&
107
+ ['number', 'string'].includes(typeof this.value)) {
108
+ 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;
131
109
  }
132
110
  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;
133
111
  }
134
- _scrollToElement() {
135
- var _a;
136
- if (this._items.length > this.itemsPerPage) {
137
- 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;
138
- if (!!itemRef) {
139
- this._observer.observe(itemRef);
140
- }
141
- }
112
+ async reset() {
113
+ this.changeValue.emit(null);
114
+ this._dropdownElement.updateList();
142
115
  }
143
- handleKeyDown(ev) {
144
- if (this.disabled)
145
- return;
146
- const letterNumber = /^[0-9a-zA-Z]+$/;
147
- if (ev.key.match(letterNumber) && ev.key.length === 1) {
148
- if (Date.now() - this._lastKeyPressTime > 3000 ||
149
- this._searchString.length > 2) {
150
- this._searchString = ev.key;
116
+ handleKeyDown(event) {
117
+ const alphanumeric = /^[0-9a-zA-Z ]+$/;
118
+ if (event.key.match(alphanumeric) && event.key.length === 1) {
119
+ if (this.dropdownVisible)
120
+ return;
121
+ if (Date.now() - this._lastKeyPressTime > 3000) {
122
+ this._searchString = event.key;
151
123
  }
152
124
  else {
153
- this._searchString = `${this._searchString}${ev.key}`;
125
+ this._searchString += event.key;
154
126
  }
155
127
  this._lastKeyPressTime = Date.now();
156
- const selectedItem = this._items.find((i) => i.name.toLowerCase().startsWith(this._searchString));
157
- function isItem(element) {
158
- return element === selectedItem;
159
- }
160
- if (selectedItem) {
161
- if (this.menuVisible) {
162
- this.currentIndex = this._items.findIndex(isItem);
163
- this._scrollToElement();
164
- }
165
- else {
166
- this.value = selectedItem;
167
- }
128
+ const selectionIndex = Array.from(this._items).findIndex((i) => i.name.toLowerCase().startsWith(this._searchString));
129
+ this.currentIndex = selectionIndex >= 0 ? selectionIndex : null;
130
+ if (this.currentIndex !== null) {
131
+ this._dropdownElement.selectItem(this.currentIndex);
168
132
  }
133
+ return;
169
134
  }
170
- if (ev.key === 'Tab') {
135
+ if (event.key === 'Escape') {
136
+ this._preventDialogOpen = true;
171
137
  this._dropdownElement.close();
138
+ this._inputElement.focus();
139
+ return;
172
140
  }
173
- if (ev.key === 'ArrowDown') {
174
- ev.preventDefault();
175
- if (this._dropdownElement.isOpen)
141
+ if (event.key === 'Tab') {
142
+ this._dropdownElement.close();
143
+ return;
144
+ }
145
+ if (event.key === 'ArrowDown') {
146
+ event.preventDefault();
147
+ if (!this._items.length)
176
148
  return;
177
- this._showMenu();
149
+ if (!this.dropdownVisible || this.currentIndex === null) {
150
+ this.currentIndex = 0;
151
+ this._dropdownElement.open();
152
+ this._dropdownElement.focusItem(this.currentIndex);
153
+ return;
154
+ }
155
+ this.currentIndex = Math.min(this.currentIndex + 1, this._items.length - 1);
178
156
  this._dropdownElement.focusItem(this.currentIndex);
157
+ return;
179
158
  }
180
- if (ev.key === 'ArrowUp') {
181
- ev.preventDefault();
182
- if (this._dropdownElement.isOpen)
159
+ if (event.key === 'ArrowUp') {
160
+ event.preventDefault();
161
+ if (this.currentIndex === 0) {
162
+ this._dropdownElement.close();
163
+ this._inputElement.focus();
164
+ }
165
+ if (!this.dropdownVisible || this.currentIndex === null) {
166
+ this.currentIndex = this._items.length - 1;
167
+ this._dropdownElement.open();
168
+ this._dropdownElement.focusItem(this.currentIndex);
183
169
  return;
184
- this._showMenu();
170
+ }
171
+ this.currentIndex = Math.max(this.currentIndex - 1, 0);
185
172
  this._dropdownElement.focusItem(this.currentIndex);
186
173
  }
187
- if (ev.key === ' ') {
188
- ev.preventDefault();
189
- this._showMenu();
174
+ if (event.key === ' ') {
175
+ event.preventDefault();
190
176
  }
191
- }
192
- async onItemSelection(index) {
193
- this.currentIndex = index;
194
- this._selectItem();
195
- }
196
- async onHideMenu() {
197
- this.menuVisible = false;
198
- }
199
- componentWillLoad() {
200
- var _a, _b;
201
- CSelect._uniqueId += 1;
202
- this._id =
203
- (_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();
204
- this._inputId =
205
- 'input-' +
206
- (this.hostId || this.label || this.placeholder)
207
- .replace(/[^a-zA-Z0-9-_]/g, '')
208
- .toLowerCase();
209
- this._setInitialValue();
210
- }
211
- _setInitialValue() {
212
- if (!this.value)
213
- return;
214
- const value = this.returnValue
215
- ? this.value
216
- : this.value.value;
217
- this.internals.setFormValue(value);
218
- }
219
- componentDidLoad() {
220
- this._getOptionItems();
221
- if ((this.value || typeof this.value === 'boolean') &&
222
- !this.currentIndex &&
223
- this.currentIndex !== 0) {
224
- this.currentIndex = this._items.findIndex((item) => item.value === this.value);
177
+ if (event.key === 'Enter') {
178
+ event.preventDefault();
179
+ if (this.currentIndex === null)
180
+ return;
181
+ this._dropdownElement.selectItem(this.currentIndex);
182
+ }
183
+ if (event.key === 'Home' && this.dropdownVisible) {
184
+ this.currentIndex = 0;
185
+ }
186
+ if (event.key === 'End' && this.dropdownVisible) {
187
+ this.currentIndex = this._items.length - 1;
225
188
  }
226
189
  }
227
- disconnectedCallback() {
228
- this._observer.disconnect();
229
- }
230
- _selectItem() {
231
- const selectedItem = this._items[this.currentIndex];
232
- this.value = selectedItem;
233
- this._scrollToElement();
234
- }
235
- async setActiveDescendant(id) {
236
- this._inputElement.setAttribute('aria-activedescendant', id);
237
- }
238
- _showMenu() {
239
- if (this.disabled)
240
- return;
241
- this.menuVisible = true;
242
- this._dropdownElement.open();
243
- }
244
- _getOptionItems() {
245
- requestAnimationFrame(() => {
246
- this._cOptionElements = {};
247
- let selection = null;
248
- this._optionItems = (this.el ? Array.from(this.el.querySelectorAll('c-option')) : []).map((item, index) => {
249
- const cSelectItem = {
250
- value: item.value,
251
- name: item.name || item.innerText,
252
- disabled: !!item.disabled,
253
- };
254
- if (item.selected) {
255
- selection = cSelectItem;
256
- }
257
- item.slot = `option-${index}`;
258
- this._cOptionElements[item.value.toString()] = item;
259
- return cSelectItem;
190
+ onDropdownStateChange(event) {
191
+ const isOpen = event.detail;
192
+ this.dropdownVisible = isOpen;
193
+ if (!isOpen) {
194
+ requestAnimationFrame(() => {
195
+ this.currentIndex = null;
260
196
  });
261
- this.hasOptionItems = !!this._optionItems.length;
262
- if (selection) {
263
- this._valueChangedHandler(selection);
264
- }
265
- });
266
- }
267
- _runValidate() {
268
- if (this.required &&
269
- !this.value &&
270
- (this._blurred || !this.validateOnBlur)) {
271
- this._outerWrapperClasses.push('required');
272
- this._validationClasses.push('show');
273
- }
274
- else {
275
- this._outerWrapperClasses = this._outerWrapperClasses.filter((c) => c !== 'required');
276
- this._validationClasses = this._validationClasses.filter((c) => c !== 'show');
277
197
  }
278
198
  }
279
- _renderChevron() {
280
- const classes = {
281
- 'c-input-menu__chevron': true,
282
- 'c-input-menu__chevron--active': this.menuVisible,
283
- };
284
- return (index.h("svg", { class: classes, viewBox: "0 0 24 24" }, index.h("path", { d: mdi.mdiChevronDown })));
199
+ onSelectOption(event) {
200
+ this._dropdownElement.close();
201
+ const { name, value } = event.detail;
202
+ if (this.optionElementsExist && this.optionAsSelection) {
203
+ const selection = Array.from(this.optionElements).find((item) => item.value === value && item.name === name);
204
+ if (!selection)
205
+ return;
206
+ const clone = selection.cloneNode(true);
207
+ this._selectionElement.classList.add('c-input-menu__selection--show');
208
+ this._selectionElement.replaceChildren(clone);
209
+ }
210
+ this.changeValue.emit(this.returnObject ? event.detail : value);
211
+ this._preventDialogOpen = true;
212
+ this._inputElement.focus();
285
213
  }
286
- _renderInputElement() {
287
- var _a, _b;
288
- return (index.h("div", { class: "c-input-menu__input" }, index.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" }), index.h("div", { ref: (el) => (this._selectionElement = el), class: "c-input-menu__selection" })));
214
+ _updateInput() {
215
+ this._dropdownElement.open();
216
+ this._dropdownElement.updateList();
289
217
  }
290
218
  _updateStatusText() {
291
219
  if (this._debounce !== null) {
@@ -293,31 +221,52 @@ const CSelect = class {
293
221
  this._debounce = null;
294
222
  }
295
223
  this._debounce = window.setTimeout(() => {
296
- var _a;
297
- const selection = this.el.shadowRoot.querySelector('li[aria-selected="true"]');
224
+ this.statusText = '';
225
+ if (this.currentIndex === null) {
226
+ this.statusText = this._items.length
227
+ ? `${this._items.length} option${this._items.length !== 1 ? 's' : ''} available`
228
+ : 'No options available';
229
+ }
298
230
  const ending = !!this._items.length
299
- ? ', to navigate use up and down arrows'
231
+ ? ', navigate using the up and down arrows'
300
232
  : '';
301
- const isDisabled = !!((_a = selection === null || selection === void 0 ? void 0 : selection.classList) === null || _a === void 0 ? void 0 : _a.contains('disabled'));
302
- const beginning = isDisabled ? 'Disabled option - ' : '';
303
- const selectionText = !!selection
304
- ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`
305
- : null;
306
- this.statusText = `${selectionText || ending}`;
233
+ this._dropdownElement.setStatusText(this.statusText + ending);
307
234
  this._debounce = null;
308
235
  }, 1400);
309
236
  }
310
- render() {
237
+ componentWillLoad() {
238
+ CSelect._uniqueId += 1;
239
+ this._inputId =
240
+ 'input_' +
241
+ (this.hostId || this.label || this.placeholder).replace(/[^a-zA-Z0-9-_]/g, '');
242
+ }
243
+ _renderLoader() {
244
+ return index.h("c-spinner", { color: "var(--_c-autocomplete-active-color)", size: 20 });
245
+ }
246
+ _renderChevron() {
247
+ const classes = {
248
+ 'c-input-menu__chevron': true,
249
+ 'c-input-menu__chevron--active': this.dropdownVisible,
250
+ };
251
+ return (index.h("c-icon-button", { size: "x-small", class: classes, text: true, onClick: (event) => this._toggleDropdown(event), onKeyDown: (event) => this._onButtonKeyDown('chevron', event) }, index.h("c-icon", { path: mdi.mdiChevronDown, size: 24 })));
252
+ }
253
+ _renderInputElement() {
311
254
  var _a;
312
- return (index.h(index.Host, { title: (_a = this._getLabel()) !== null && _a !== void 0 ? _a : null }, index.h("div", { id: 'announce-' + this._id, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), index.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() }, index.h("slot", { name: "pre", slot: "pre" }), index.h("div", { class: "c-input__content" }, this._renderInputElement(), this._renderChevron(), index.h("slot", { onSlotchange: this._handleSlotChange })), index.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" }), index.h("slot", { name: "post", slot: "post" }))));
255
+ return (index.h("div", { class: "c-input-menu__input" }, index.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() }), index.h("div", { ref: (el) => (this._selectionElement = el), class: "c-input-menu__selection" })));
256
+ }
257
+ _renderReset() {
258
+ return (index.h("c-icon-button", { "aria-label": "", size: "x-small", text: true, onClick: (event) => this._onReset(event), onKeyDown: (event) => this._onButtonKeyDown('reset', event) }, index.h("c-icon", { path: mdi.mdiClose, size: 20 })));
259
+ }
260
+ render() {
261
+ const itemType = this.optionElementsExist ? 'option' : 'item';
262
+ return (index.h(index.Host, null, index.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" }, index.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() }, index.h("slot", { name: "pre", slot: "pre" }), index.h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading &&
263
+ this.value &&
264
+ this.clearable &&
265
+ this._renderReset(), !this.loading &&
266
+ (!this.value || !this.clearable) &&
267
+ this._renderChevron(), index.h("slot", { onSlotchange: () => this._onSlotChange() })), index.h("slot", { name: "post", slot: "post" })))));
313
268
  }
314
- static get formAssociated() { return true; }
315
269
  get el() { return index.getElement(this); }
316
- static get watchers() { return {
317
- "value": ["onValueChange"],
318
- "validate": ["validateChange"],
319
- "currentIndex": ["onCurrentIndexChange"]
320
- }; }
321
270
  };
322
271
  CSelect._uniqueId = 0;
323
272
  CSelect.style = cSelectCss;