wcs-core 7.0.0 → 7.1.0

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 (442) hide show
  1. package/design-tokens/dist/sncf-holding-root-scoped.css +589 -0
  2. package/design-tokens/dist/sncf-holding.css +13 -0
  3. package/design-tokens/dist/sncf-holding.json +54 -0
  4. package/design-tokens/dist/sncf-reseau-root-scoped.css +652 -0
  5. package/design-tokens/dist/sncf-reseau.css +10 -0
  6. package/design-tokens/dist/sncf-reseau.json +54 -0
  7. package/design-tokens/dist/sncf-voyageurs-root-scoped.css +550 -0
  8. package/design-tokens/dist/sncf-voyageurs.css +13 -0
  9. package/design-tokens/dist/sncf-voyageurs.json +54 -0
  10. package/dist/cjs/{com-nav-utils-9f6c99b8.js → com-nav-utils-ff4f0bef.js} +2 -2
  11. package/dist/cjs/{com-nav-utils-9f6c99b8.js.map → com-nav-utils-ff4f0bef.js.map} +1 -1
  12. package/dist/cjs/control-component-interface-d9b68f28.js +43 -0
  13. package/dist/cjs/control-component-interface-d9b68f28.js.map +1 -0
  14. package/dist/cjs/{grid-pagination-2c752b22.js → grid-pagination-e4f29c78.js} +3 -3
  15. package/dist/cjs/{grid-pagination-2c752b22.js.map → grid-pagination-e4f29c78.js.map} +1 -1
  16. package/dist/cjs/{helpers-871f5a3d.js → helpers-2f1a8ddc.js} +44 -1
  17. package/dist/cjs/helpers-2f1a8ddc.js.map +1 -0
  18. package/dist/cjs/{keyboard-event-d2c81ce0.js → keyboard-event-40ecdc27.js} +2 -2
  19. package/dist/cjs/{keyboard-event-d2c81ce0.js.map → keyboard-event-40ecdc27.js.map} +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/cjs/wcs-accordion-panel.cjs.entry.js +1 -1
  22. package/dist/cjs/wcs-action-bar.cjs.entry.js +1 -1
  23. package/dist/cjs/wcs-action-bar.cjs.entry.js.map +1 -1
  24. package/dist/cjs/wcs-badge.cjs.entry.js +1 -1
  25. package/dist/cjs/wcs-badge.cjs.entry.js.map +1 -1
  26. package/dist/cjs/wcs-breadcrumb.cjs.entry.js +1 -1
  27. package/dist/cjs/wcs-button_2.cjs.entry.js +3 -3
  28. package/dist/cjs/wcs-button_2.cjs.entry.js.map +1 -1
  29. package/dist/cjs/wcs-checkbox.cjs.entry.js +6 -2
  30. package/dist/cjs/wcs-checkbox.cjs.entry.js.map +1 -1
  31. package/dist/cjs/wcs-com-nav-category.cjs.entry.js +2 -2
  32. package/dist/cjs/wcs-com-nav-item.cjs.entry.js +1 -1
  33. package/dist/cjs/wcs-com-nav-item.cjs.entry.js.map +1 -1
  34. package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +2 -2
  35. package/dist/cjs/wcs-com-nav.cjs.entry.js +2 -2
  36. package/dist/cjs/wcs-counter.cjs.entry.js +13 -5
  37. package/dist/cjs/wcs-counter.cjs.entry.js.map +1 -1
  38. package/dist/cjs/wcs-dropdown-item.cjs.entry.js +1 -1
  39. package/dist/cjs/wcs-dropdown.cjs.entry.js +3 -3
  40. package/dist/cjs/wcs-dropdown.cjs.entry.js.map +1 -1
  41. package/dist/cjs/wcs-editable-field.cjs.entry.js +81 -55
  42. package/dist/cjs/wcs-editable-field.cjs.entry.js.map +1 -1
  43. package/dist/cjs/wcs-error_3.cjs.entry.js +209 -0
  44. package/dist/cjs/wcs-error_3.cjs.entry.js.map +1 -0
  45. package/dist/cjs/wcs-field-content.cjs.entry.js +1 -1
  46. package/dist/cjs/wcs-field-label.cjs.entry.js +1 -1
  47. package/dist/cjs/wcs-field.cjs.entry.js +1 -1
  48. package/dist/cjs/wcs-footer.cjs.entry.js +1 -1
  49. package/dist/cjs/wcs-footer.cjs.entry.js.map +1 -1
  50. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +4 -4
  51. package/dist/cjs/wcs-galactic-menu.cjs.entry.js.map +1 -1
  52. package/dist/cjs/wcs-galactic.cjs.entry.js +1 -1
  53. package/dist/cjs/wcs-grid-column.cjs.entry.js +2 -2
  54. package/dist/cjs/wcs-grid-column.cjs.entry.js.map +1 -1
  55. package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +1 -1
  56. package/dist/cjs/wcs-grid-pagination.cjs.entry.js +2 -2
  57. package/dist/cjs/wcs-grid.cjs.entry.js +6 -6
  58. package/dist/cjs/wcs-header.cjs.entry.js +2 -2
  59. package/dist/cjs/wcs-hint.cjs.entry.js +1 -1
  60. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +1 -1
  61. package/dist/cjs/wcs-icon.cjs.entry.js +2 -2
  62. package/dist/cjs/wcs-input.cjs.entry.js +5 -3
  63. package/dist/cjs/wcs-input.cjs.entry.js.map +1 -1
  64. package/dist/cjs/wcs-list-item-properties.cjs.entry.js +1 -1
  65. package/dist/cjs/wcs-list-item-property.cjs.entry.js +1 -1
  66. package/dist/cjs/wcs-list-item.cjs.entry.js +1 -1
  67. package/dist/cjs/wcs-list-item.cjs.entry.js.map +1 -1
  68. package/dist/cjs/wcs-mat-icon.cjs.entry.js +2 -2
  69. package/dist/cjs/wcs-modal.cjs.entry.js +17 -3
  70. package/dist/cjs/wcs-modal.cjs.entry.js.map +1 -1
  71. package/dist/cjs/wcs-native-select.cjs.entry.js +1 -1
  72. package/dist/cjs/wcs-nav-item.cjs.entry.js +3 -3
  73. package/dist/cjs/wcs-nav-item.cjs.entry.js.map +1 -1
  74. package/dist/cjs/wcs-nav.cjs.entry.js +2 -2
  75. package/dist/cjs/wcs-progress-bar.cjs.entry.js +3 -3
  76. package/dist/cjs/wcs-progress-radial.cjs.entry.js +3 -3
  77. package/dist/cjs/wcs-radio-group.cjs.entry.js +5 -2
  78. package/dist/cjs/wcs-radio-group.cjs.entry.js.map +1 -1
  79. package/dist/cjs/wcs-radio.cjs.entry.js +2 -2
  80. package/dist/cjs/wcs-radio.cjs.entry.js.map +1 -1
  81. package/dist/cjs/wcs-select_2.cjs.entry.js +8 -7
  82. package/dist/cjs/wcs-select_2.cjs.entry.js.map +1 -1
  83. package/dist/cjs/wcs-skeleton-circle.cjs.entry.js +1 -1
  84. package/dist/cjs/wcs-skeleton-rectangle.cjs.entry.js +1 -1
  85. package/dist/cjs/wcs-skeleton-text.cjs.entry.js +1 -1
  86. package/dist/cjs/wcs-switch.cjs.entry.js +6 -2
  87. package/dist/cjs/wcs-switch.cjs.entry.js.map +1 -1
  88. package/dist/cjs/wcs-tab.cjs.entry.js +1 -1
  89. package/dist/cjs/wcs-tabs.cjs.entry.js +2 -2
  90. package/dist/cjs/wcs-tabs.cjs.entry.js.map +1 -1
  91. package/dist/cjs/wcs-textarea.cjs.entry.js +2 -2
  92. package/dist/cjs/wcs-textarea.cjs.entry.js.map +1 -1
  93. package/dist/cjs/wcs-tooltip.cjs.entry.js +8 -4
  94. package/dist/cjs/wcs-tooltip.cjs.entry.js.map +1 -1
  95. package/dist/cjs/wcs.cjs.js +1 -1
  96. package/dist/collection/components/action-bar/action-bar.js +2 -2
  97. package/dist/collection/components/action-bar/action-bar.js.map +1 -1
  98. package/dist/collection/components/badge/badge.css +1 -0
  99. package/dist/collection/components/button/button.js +2 -2
  100. package/dist/collection/components/button/button.js.map +1 -1
  101. package/dist/collection/components/checkbox/checkbox.js +22 -1
  102. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  103. package/dist/collection/components/com-nav-item/com-nav-item.css +2 -1
  104. package/dist/collection/components/counter/counter.css +3 -0
  105. package/dist/collection/components/counter/counter.js +13 -5
  106. package/dist/collection/components/counter/counter.js.map +1 -1
  107. package/dist/collection/components/dropdown/dropdown.js +2 -2
  108. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  109. package/dist/collection/components/editable-field/editable-field.css +31 -10
  110. package/dist/collection/components/editable-field/editable-field.e2e.js +176 -0
  111. package/dist/collection/components/editable-field/editable-field.e2e.js.map +1 -0
  112. package/dist/collection/components/editable-field/editable-field.js +83 -57
  113. package/dist/collection/components/editable-field/editable-field.js.map +1 -1
  114. package/dist/collection/components/error/error.js +1 -1
  115. package/dist/collection/components/field/field.js +1 -1
  116. package/dist/collection/components/field-content/field-content.js +1 -1
  117. package/dist/collection/components/field-label/field-label.js +1 -1
  118. package/dist/collection/components/footer/footer.js +1 -1
  119. package/dist/collection/components/footer/footer.js.map +1 -1
  120. package/dist/collection/components/form-field/form-field.css +39 -12
  121. package/dist/collection/components/form-field/form-field.e2e.js +122 -0
  122. package/dist/collection/components/form-field/form-field.e2e.js.map +1 -0
  123. package/dist/collection/components/form-field/form-field.js +29 -12
  124. package/dist/collection/components/form-field/form-field.js.map +1 -1
  125. package/dist/collection/components/galactic/galactic.js +1 -1
  126. package/dist/collection/components/galactic-menu/galactic-menu.css +1 -0
  127. package/dist/collection/components/galactic-menu/galactic-menu.js +2 -2
  128. package/dist/collection/components/grid/grid.js +3 -3
  129. package/dist/collection/components/grid-column/grid-column.js +2 -2
  130. package/dist/collection/components/grid-column/grid-column.js.map +1 -1
  131. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +1 -1
  132. package/dist/collection/components/grid-pagination/grid-pagination.js +1 -1
  133. package/dist/collection/components/header/header.js +1 -1
  134. package/dist/collection/components/hint/hint.js +1 -1
  135. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +1 -1
  136. package/dist/collection/components/icon/icon.js +1 -1
  137. package/dist/collection/components/input/input.css +10 -1
  138. package/dist/collection/components/input/input.js +42 -3
  139. package/dist/collection/components/input/input.js.map +1 -1
  140. package/dist/collection/components/label/label.js +1 -1
  141. package/dist/collection/components/list-item/list-item.js +7 -2
  142. package/dist/collection/components/list-item/list-item.js.map +1 -1
  143. package/dist/collection/components/list-item-properties/list-item-properties.js +1 -1
  144. package/dist/collection/components/list-item-property/list-item-property.js +1 -1
  145. package/dist/collection/components/mat-icon/mat-icon.js +1 -1
  146. package/dist/collection/components/modal/modal.js +58 -2
  147. package/dist/collection/components/modal/modal.js.map +1 -1
  148. package/dist/collection/components/native-select/native-select.js +1 -1
  149. package/dist/collection/components/nav/nav.js +1 -1
  150. package/dist/collection/components/nav-item/nav-item.css +24 -6
  151. package/dist/collection/components/nav-item/nav-item.js +1 -1
  152. package/dist/collection/components/progress-bar/progress-bar.js +2 -2
  153. package/dist/collection/components/progress-radial/progress-radial.js +2 -2
  154. package/dist/collection/components/radio/radio.js +2 -2
  155. package/dist/collection/components/radio/radio.js.map +1 -1
  156. package/dist/collection/components/radio-group/radio-group.js +39 -2
  157. package/dist/collection/components/radio-group/radio-group.js.map +1 -1
  158. package/dist/collection/components/select/select.js +22 -3
  159. package/dist/collection/components/select/select.js.map +1 -1
  160. package/dist/collection/components/select-option/select-option.js +2 -2
  161. package/dist/collection/components/skeleton-circle/skeleton-circle.js +1 -1
  162. package/dist/collection/components/skeleton-rectangle/skeleton-rectangle.js +1 -1
  163. package/dist/collection/components/skeleton-text/skeleton-text.js +1 -1
  164. package/dist/collection/components/spinner/spinner.js +1 -1
  165. package/dist/collection/components/switch/switch.js +23 -2
  166. package/dist/collection/components/switch/switch.js.map +1 -1
  167. package/dist/collection/components/tab/tab.js +1 -1
  168. package/dist/collection/components/tabs/tabs.js +2 -2
  169. package/dist/collection/components/tabs/tabs.js.map +1 -1
  170. package/dist/collection/components/textarea/textarea.js +3 -3
  171. package/dist/collection/components/textarea/textarea.js.map +1 -1
  172. package/dist/collection/components/tooltip/tooltip.js +10 -8
  173. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  174. package/dist/collection/utils/control-component-interface.js +37 -0
  175. package/dist/collection/utils/control-component-interface.js.map +1 -0
  176. package/dist/collection/utils/helpers.js +40 -0
  177. package/dist/collection/utils/helpers.js.map +1 -1
  178. package/dist/esm/{com-nav-utils-1366c701.js → com-nav-utils-ee7bf77c.js} +2 -2
  179. package/dist/esm/{com-nav-utils-1366c701.js.map → com-nav-utils-ee7bf77c.js.map} +1 -1
  180. package/dist/esm/control-component-interface-9f09e520.js +40 -0
  181. package/dist/esm/control-component-interface-9f09e520.js.map +1 -0
  182. package/dist/esm/{grid-pagination-421689be.js → grid-pagination-976a86e9.js} +3 -3
  183. package/dist/esm/{grid-pagination-421689be.js.map → grid-pagination-976a86e9.js.map} +1 -1
  184. package/dist/esm/{helpers-f137ec8d.js → helpers-ece6a2d3.js} +42 -2
  185. package/dist/esm/helpers-ece6a2d3.js.map +1 -0
  186. package/dist/esm/{keyboard-event-bdea408a.js → keyboard-event-26b65ae5.js} +2 -2
  187. package/dist/esm/{keyboard-event-bdea408a.js.map → keyboard-event-26b65ae5.js.map} +1 -1
  188. package/dist/esm/loader.js +1 -1
  189. package/dist/esm/wcs-accordion-panel.entry.js +1 -1
  190. package/dist/esm/wcs-action-bar.entry.js +1 -1
  191. package/dist/esm/wcs-action-bar.entry.js.map +1 -1
  192. package/dist/esm/wcs-badge.entry.js +1 -1
  193. package/dist/esm/wcs-badge.entry.js.map +1 -1
  194. package/dist/esm/wcs-breadcrumb.entry.js +1 -1
  195. package/dist/esm/wcs-button_2.entry.js +3 -3
  196. package/dist/esm/wcs-button_2.entry.js.map +1 -1
  197. package/dist/esm/wcs-checkbox.entry.js +6 -2
  198. package/dist/esm/wcs-checkbox.entry.js.map +1 -1
  199. package/dist/esm/wcs-com-nav-category.entry.js +2 -2
  200. package/dist/esm/wcs-com-nav-item.entry.js +1 -1
  201. package/dist/esm/wcs-com-nav-item.entry.js.map +1 -1
  202. package/dist/esm/wcs-com-nav-submenu.entry.js +2 -2
  203. package/dist/esm/wcs-com-nav.entry.js +2 -2
  204. package/dist/esm/wcs-counter.entry.js +13 -5
  205. package/dist/esm/wcs-counter.entry.js.map +1 -1
  206. package/dist/esm/wcs-dropdown-item.entry.js +1 -1
  207. package/dist/esm/wcs-dropdown.entry.js +3 -3
  208. package/dist/esm/wcs-dropdown.entry.js.map +1 -1
  209. package/dist/esm/wcs-editable-field.entry.js +81 -55
  210. package/dist/esm/wcs-editable-field.entry.js.map +1 -1
  211. package/dist/esm/wcs-error_3.entry.js +203 -0
  212. package/dist/esm/wcs-error_3.entry.js.map +1 -0
  213. package/dist/esm/wcs-field-content.entry.js +1 -1
  214. package/dist/esm/wcs-field-label.entry.js +1 -1
  215. package/dist/esm/wcs-field.entry.js +1 -1
  216. package/dist/esm/wcs-footer.entry.js +1 -1
  217. package/dist/esm/wcs-footer.entry.js.map +1 -1
  218. package/dist/esm/wcs-galactic-menu.entry.js +4 -4
  219. package/dist/esm/wcs-galactic-menu.entry.js.map +1 -1
  220. package/dist/esm/wcs-galactic.entry.js +1 -1
  221. package/dist/esm/wcs-grid-column.entry.js +2 -2
  222. package/dist/esm/wcs-grid-column.entry.js.map +1 -1
  223. package/dist/esm/wcs-grid-custom-cell.entry.js +1 -1
  224. package/dist/esm/wcs-grid-pagination.entry.js +2 -2
  225. package/dist/esm/wcs-grid.entry.js +6 -6
  226. package/dist/esm/wcs-header.entry.js +2 -2
  227. package/dist/esm/wcs-hint.entry.js +1 -1
  228. package/dist/esm/wcs-horizontal-stepper.entry.js +1 -1
  229. package/dist/esm/wcs-icon.entry.js +2 -2
  230. package/dist/esm/wcs-input.entry.js +5 -3
  231. package/dist/esm/wcs-input.entry.js.map +1 -1
  232. package/dist/esm/wcs-list-item-properties.entry.js +1 -1
  233. package/dist/esm/wcs-list-item-property.entry.js +1 -1
  234. package/dist/esm/wcs-list-item.entry.js +1 -1
  235. package/dist/esm/wcs-list-item.entry.js.map +1 -1
  236. package/dist/esm/wcs-mat-icon.entry.js +2 -2
  237. package/dist/esm/wcs-modal.entry.js +17 -3
  238. package/dist/esm/wcs-modal.entry.js.map +1 -1
  239. package/dist/esm/wcs-native-select.entry.js +1 -1
  240. package/dist/esm/wcs-nav-item.entry.js +3 -3
  241. package/dist/esm/wcs-nav-item.entry.js.map +1 -1
  242. package/dist/esm/wcs-nav.entry.js +2 -2
  243. package/dist/esm/wcs-progress-bar.entry.js +3 -3
  244. package/dist/esm/wcs-progress-radial.entry.js +3 -3
  245. package/dist/esm/wcs-radio-group.entry.js +5 -2
  246. package/dist/esm/wcs-radio-group.entry.js.map +1 -1
  247. package/dist/esm/wcs-radio.entry.js +2 -2
  248. package/dist/esm/wcs-radio.entry.js.map +1 -1
  249. package/dist/esm/wcs-select_2.entry.js +8 -7
  250. package/dist/esm/wcs-select_2.entry.js.map +1 -1
  251. package/dist/esm/wcs-skeleton-circle.entry.js +1 -1
  252. package/dist/esm/wcs-skeleton-rectangle.entry.js +1 -1
  253. package/dist/esm/wcs-skeleton-text.entry.js +1 -1
  254. package/dist/esm/wcs-switch.entry.js +6 -2
  255. package/dist/esm/wcs-switch.entry.js.map +1 -1
  256. package/dist/esm/wcs-tab.entry.js +1 -1
  257. package/dist/esm/wcs-tabs.entry.js +2 -2
  258. package/dist/esm/wcs-tabs.entry.js.map +1 -1
  259. package/dist/esm/wcs-textarea.entry.js +2 -2
  260. package/dist/esm/wcs-textarea.entry.js.map +1 -1
  261. package/dist/esm/wcs-tooltip.entry.js +8 -4
  262. package/dist/esm/wcs-tooltip.entry.js.map +1 -1
  263. package/dist/esm/wcs.js +1 -1
  264. package/dist/types/components/checkbox/checkbox.d.ts +3 -1
  265. package/dist/types/components/counter/counter.d.ts +6 -0
  266. package/dist/types/components/editable-field/editable-field.d.ts +23 -9
  267. package/dist/types/components/input/input.d.ts +3 -0
  268. package/dist/types/components/list-item/list-item.d.ts +5 -0
  269. package/dist/types/components/modal/modal.d.ts +23 -0
  270. package/dist/types/components/radio-group/radio-group.d.ts +3 -1
  271. package/dist/types/components/select/select.d.ts +4 -0
  272. package/dist/types/components/switch/switch.d.ts +3 -1
  273. package/dist/types/components/tooltip/tooltip.d.ts +3 -5
  274. package/dist/types/components.d.ts +87 -16
  275. package/dist/types/utils/control-component-interface.d.ts +22 -0
  276. package/dist/types/utils/helpers.d.ts +21 -0
  277. package/dist/wcs/p-0017d766.js +2 -0
  278. package/dist/wcs/{p-45a6934d.entry.js → p-0ffdfc10.entry.js} +2 -2
  279. package/dist/wcs/{p-9f23c49e.entry.js → p-13090618.entry.js} +2 -2
  280. package/dist/wcs/{p-8f0e093f.entry.js → p-13e50077.entry.js} +2 -2
  281. package/dist/wcs/p-1438530e.entry.js +2 -0
  282. package/dist/wcs/p-1438530e.entry.js.map +1 -0
  283. package/dist/wcs/{p-2305f257.entry.js → p-16dd21cf.entry.js} +2 -2
  284. package/dist/wcs/{p-85a5bbb7.entry.js → p-206c01d5.entry.js} +2 -2
  285. package/dist/wcs/{p-85a5bbb7.entry.js.map → p-206c01d5.entry.js.map} +1 -1
  286. package/dist/wcs/{p-09d0a296.entry.js → p-21b964cd.entry.js} +3 -3
  287. package/dist/wcs/p-21b964cd.entry.js.map +1 -0
  288. package/dist/wcs/p-21d2f06f.entry.js +2 -0
  289. package/dist/wcs/p-21d2f06f.entry.js.map +1 -0
  290. package/dist/wcs/{p-2add4d4d.entry.js → p-258855a1.entry.js} +2 -2
  291. package/dist/wcs/{p-2c9e20c1.entry.js → p-294732f7.entry.js} +2 -2
  292. package/dist/wcs/{p-15ff9f93.entry.js → p-29f5b974.entry.js} +2 -2
  293. package/dist/wcs/{p-1ab0d13b.entry.js → p-2adf00be.entry.js} +2 -2
  294. package/dist/wcs/p-2adf00be.entry.js.map +1 -0
  295. package/dist/wcs/p-37800935.entry.js +2 -0
  296. package/dist/wcs/{p-76f07dbd.entry.js → p-388e6d75.entry.js} +2 -2
  297. package/dist/wcs/{p-8bd1b9ce.entry.js → p-43d70995.entry.js} +2 -2
  298. package/dist/wcs/{p-9553d60e.entry.js → p-4661290b.entry.js} +2 -2
  299. package/dist/wcs/{p-9553d60e.entry.js.map → p-4661290b.entry.js.map} +1 -1
  300. package/dist/wcs/{p-d2a4f609.entry.js → p-4dc52a25.entry.js} +2 -2
  301. package/dist/wcs/{p-25b96cde.entry.js → p-50523b53.entry.js} +2 -2
  302. package/dist/wcs/p-50523b53.entry.js.map +1 -0
  303. package/dist/wcs/p-52d77e1f.js +2 -0
  304. package/dist/wcs/p-52d77e1f.js.map +1 -0
  305. package/dist/wcs/p-5974be61.entry.js +2 -0
  306. package/dist/wcs/p-5974be61.entry.js.map +1 -0
  307. package/dist/wcs/{p-0fa370d7.entry.js → p-5bf73e05.entry.js} +3 -3
  308. package/dist/wcs/{p-0fa370d7.entry.js.map → p-5bf73e05.entry.js.map} +1 -1
  309. package/dist/wcs/{p-e19308cf.entry.js → p-5d5f50ed.entry.js} +2 -2
  310. package/dist/wcs/{p-94ff8939.entry.js → p-5de993d7.entry.js} +2 -2
  311. package/dist/wcs/p-5de993d7.entry.js.map +1 -0
  312. package/dist/wcs/{p-a788b5bd.entry.js → p-619e1110.entry.js} +2 -2
  313. package/dist/wcs/{p-9e03b379.entry.js → p-694724a2.entry.js} +2 -2
  314. package/dist/wcs/{p-f8d2be83.entry.js → p-6b06d2e7.entry.js} +2 -2
  315. package/dist/wcs/p-6f5d570a.entry.js +2 -0
  316. package/dist/wcs/p-6f5d570a.entry.js.map +1 -0
  317. package/dist/wcs/p-71db0ed5.entry.js +2 -0
  318. package/dist/wcs/{p-209145de.entry.js → p-76c92e22.entry.js} +2 -2
  319. package/dist/wcs/{p-f06aa79d.entry.js → p-796e690d.entry.js} +2 -2
  320. package/dist/wcs/{p-f06aa79d.entry.js.map → p-796e690d.entry.js.map} +1 -1
  321. package/dist/wcs/{p-97cbbcfc.entry.js → p-7d665a7e.entry.js} +2 -2
  322. package/dist/wcs/p-89b8c724.js +2 -0
  323. package/dist/wcs/{p-412b0021.js → p-8fcceaf1.js} +2 -2
  324. package/dist/wcs/p-9243a323.entry.js +2 -0
  325. package/dist/wcs/p-9243a323.entry.js.map +1 -0
  326. package/dist/wcs/p-94aa269f.entry.js +2 -0
  327. package/dist/wcs/p-94aa269f.entry.js.map +1 -0
  328. package/dist/wcs/{p-87b69cac.entry.js → p-9554196c.entry.js} +2 -2
  329. package/dist/wcs/{p-80a23f9c.entry.js → p-96bff8fe.entry.js} +2 -2
  330. package/dist/wcs/{p-80a23f9c.entry.js.map → p-96bff8fe.entry.js.map} +1 -1
  331. package/dist/wcs/{p-fa507e06.entry.js → p-9ad23e83.entry.js} +2 -2
  332. package/dist/wcs/{p-5ea2aba5.entry.js → p-9c012aae.entry.js} +2 -2
  333. package/dist/wcs/p-9dc3f9a5.entry.js +2 -0
  334. package/dist/wcs/p-9dc3f9a5.entry.js.map +1 -0
  335. package/dist/wcs/p-9eb66fa9.entry.js +2 -0
  336. package/dist/wcs/p-a7468a3a.js +2 -0
  337. package/dist/wcs/p-a7468a3a.js.map +1 -0
  338. package/dist/wcs/{p-4982f96c.entry.js → p-a7891233.entry.js} +2 -2
  339. package/dist/wcs/p-b2080509.entry.js +2 -0
  340. package/dist/wcs/{p-806315e6.entry.js.map → p-b2080509.entry.js.map} +1 -1
  341. package/dist/wcs/p-b96f4921.entry.js +2 -0
  342. package/dist/wcs/p-b96f4921.entry.js.map +1 -0
  343. package/dist/wcs/{p-276b8125.entry.js → p-c2d35aa6.entry.js} +3 -3
  344. package/dist/wcs/{p-276b8125.entry.js.map → p-c2d35aa6.entry.js.map} +1 -1
  345. package/dist/wcs/p-c752b85a.entry.js +2 -0
  346. package/dist/wcs/{p-b0f8190f.entry.js → p-d895ffb4.entry.js} +2 -2
  347. package/dist/wcs/{p-1e5aa960.entry.js → p-d9525519.entry.js} +2 -2
  348. package/dist/wcs/p-d9525519.entry.js.map +1 -0
  349. package/dist/wcs/{p-db81b74f.entry.js → p-da4636fa.entry.js} +2 -2
  350. package/dist/wcs/p-da4636fa.entry.js.map +1 -0
  351. package/dist/wcs/p-dd60a6db.entry.js +2 -0
  352. package/dist/wcs/p-dd60a6db.entry.js.map +1 -0
  353. package/dist/wcs/p-dddcd685.entry.js +2 -0
  354. package/dist/wcs/p-dddcd685.entry.js.map +1 -0
  355. package/dist/wcs/p-e36b2ad1.entry.js +2 -0
  356. package/dist/wcs/p-f87636f6.entry.js +2 -0
  357. package/dist/wcs/p-f87636f6.entry.js.map +1 -0
  358. package/dist/wcs/p-fc115de4.entry.js +2 -0
  359. package/dist/wcs/wcs.esm.js +1 -1
  360. package/dist/wcs/wcs.esm.js.map +1 -1
  361. package/package.json +1 -1
  362. package/dist/cjs/helpers-871f5a3d.js.map +0 -1
  363. package/dist/cjs/wcs-error_2.cjs.entry.js +0 -168
  364. package/dist/cjs/wcs-error_2.cjs.entry.js.map +0 -1
  365. package/dist/cjs/wcs-label.cjs.entry.js +0 -33
  366. package/dist/cjs/wcs-label.cjs.entry.js.map +0 -1
  367. package/dist/esm/helpers-f137ec8d.js.map +0 -1
  368. package/dist/esm/wcs-error_2.entry.js +0 -163
  369. package/dist/esm/wcs-error_2.entry.js.map +0 -1
  370. package/dist/esm/wcs-label.entry.js +0 -29
  371. package/dist/esm/wcs-label.entry.js.map +0 -1
  372. package/dist/wcs/p-08e86d69.entry.js +0 -2
  373. package/dist/wcs/p-08e86d69.entry.js.map +0 -1
  374. package/dist/wcs/p-09d0a296.entry.js.map +0 -1
  375. package/dist/wcs/p-0fdaec9e.entry.js +0 -2
  376. package/dist/wcs/p-0fdaec9e.entry.js.map +0 -1
  377. package/dist/wcs/p-19c77b5c.entry.js +0 -2
  378. package/dist/wcs/p-1ab0d13b.entry.js.map +0 -1
  379. package/dist/wcs/p-1e5aa960.entry.js.map +0 -1
  380. package/dist/wcs/p-25b96cde.entry.js.map +0 -1
  381. package/dist/wcs/p-400a71d7.entry.js +0 -2
  382. package/dist/wcs/p-4ca7c59f.entry.js +0 -2
  383. package/dist/wcs/p-4ca7c59f.entry.js.map +0 -1
  384. package/dist/wcs/p-4d6d1d14.js +0 -2
  385. package/dist/wcs/p-52cd0abb.entry.js +0 -2
  386. package/dist/wcs/p-52cd0abb.entry.js.map +0 -1
  387. package/dist/wcs/p-5f517eb5.entry.js +0 -2
  388. package/dist/wcs/p-806315e6.entry.js +0 -2
  389. package/dist/wcs/p-8780a429.entry.js +0 -2
  390. package/dist/wcs/p-8780a429.entry.js.map +0 -1
  391. package/dist/wcs/p-94ff8939.entry.js.map +0 -1
  392. package/dist/wcs/p-985c4cf2.entry.js +0 -2
  393. package/dist/wcs/p-985c4cf2.entry.js.map +0 -1
  394. package/dist/wcs/p-a3aece7a.js +0 -2
  395. package/dist/wcs/p-a3aece7a.js.map +0 -1
  396. package/dist/wcs/p-a66a4289.entry.js +0 -2
  397. package/dist/wcs/p-bf31245c.entry.js +0 -2
  398. package/dist/wcs/p-bf31245c.entry.js.map +0 -1
  399. package/dist/wcs/p-cd592a00.entry.js +0 -2
  400. package/dist/wcs/p-cd592a00.entry.js.map +0 -1
  401. package/dist/wcs/p-d42831b2.entry.js +0 -2
  402. package/dist/wcs/p-d42831b2.entry.js.map +0 -1
  403. package/dist/wcs/p-d7acbf01.js +0 -2
  404. package/dist/wcs/p-db81b74f.entry.js.map +0 -1
  405. package/dist/wcs/p-dbbf0980.entry.js +0 -2
  406. package/dist/wcs/p-dbbf0980.entry.js.map +0 -1
  407. package/dist/wcs/p-e64d7437.entry.js +0 -2
  408. package/dist/wcs/p-e86575d3.entry.js +0 -2
  409. package/dist/wcs/p-e86575d3.entry.js.map +0 -1
  410. package/dist/wcs/p-f264d46f.entry.js +0 -2
  411. package/dist/wcs/p-fd9e731d.entry.js +0 -2
  412. package/dist/wcs/p-fd9e731d.entry.js.map +0 -1
  413. /package/dist/wcs/{p-d7acbf01.js.map → p-0017d766.js.map} +0 -0
  414. /package/dist/wcs/{p-45a6934d.entry.js.map → p-0ffdfc10.entry.js.map} +0 -0
  415. /package/dist/wcs/{p-9f23c49e.entry.js.map → p-13090618.entry.js.map} +0 -0
  416. /package/dist/wcs/{p-8f0e093f.entry.js.map → p-13e50077.entry.js.map} +0 -0
  417. /package/dist/wcs/{p-2305f257.entry.js.map → p-16dd21cf.entry.js.map} +0 -0
  418. /package/dist/wcs/{p-2add4d4d.entry.js.map → p-258855a1.entry.js.map} +0 -0
  419. /package/dist/wcs/{p-2c9e20c1.entry.js.map → p-294732f7.entry.js.map} +0 -0
  420. /package/dist/wcs/{p-15ff9f93.entry.js.map → p-29f5b974.entry.js.map} +0 -0
  421. /package/dist/wcs/{p-e64d7437.entry.js.map → p-37800935.entry.js.map} +0 -0
  422. /package/dist/wcs/{p-76f07dbd.entry.js.map → p-388e6d75.entry.js.map} +0 -0
  423. /package/dist/wcs/{p-8bd1b9ce.entry.js.map → p-43d70995.entry.js.map} +0 -0
  424. /package/dist/wcs/{p-d2a4f609.entry.js.map → p-4dc52a25.entry.js.map} +0 -0
  425. /package/dist/wcs/{p-e19308cf.entry.js.map → p-5d5f50ed.entry.js.map} +0 -0
  426. /package/dist/wcs/{p-a788b5bd.entry.js.map → p-619e1110.entry.js.map} +0 -0
  427. /package/dist/wcs/{p-9e03b379.entry.js.map → p-694724a2.entry.js.map} +0 -0
  428. /package/dist/wcs/{p-f8d2be83.entry.js.map → p-6b06d2e7.entry.js.map} +0 -0
  429. /package/dist/wcs/{p-5f517eb5.entry.js.map → p-71db0ed5.entry.js.map} +0 -0
  430. /package/dist/wcs/{p-209145de.entry.js.map → p-76c92e22.entry.js.map} +0 -0
  431. /package/dist/wcs/{p-97cbbcfc.entry.js.map → p-7d665a7e.entry.js.map} +0 -0
  432. /package/dist/wcs/{p-4d6d1d14.js.map → p-89b8c724.js.map} +0 -0
  433. /package/dist/wcs/{p-412b0021.js.map → p-8fcceaf1.js.map} +0 -0
  434. /package/dist/wcs/{p-87b69cac.entry.js.map → p-9554196c.entry.js.map} +0 -0
  435. /package/dist/wcs/{p-fa507e06.entry.js.map → p-9ad23e83.entry.js.map} +0 -0
  436. /package/dist/wcs/{p-5ea2aba5.entry.js.map → p-9c012aae.entry.js.map} +0 -0
  437. /package/dist/wcs/{p-19c77b5c.entry.js.map → p-9eb66fa9.entry.js.map} +0 -0
  438. /package/dist/wcs/{p-4982f96c.entry.js.map → p-a7891233.entry.js.map} +0 -0
  439. /package/dist/wcs/{p-400a71d7.entry.js.map → p-c752b85a.entry.js.map} +0 -0
  440. /package/dist/wcs/{p-b0f8190f.entry.js.map → p-d895ffb4.entry.js.map} +0 -0
  441. /package/dist/wcs/{p-f264d46f.entry.js.map → p-e36b2ad1.entry.js.map} +0 -0
  442. /package/dist/wcs/{p-a66a4289.entry.js.map → p-fc115de4.entry.js.map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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,MAAM,GAAG,CAAC,CAAC","sourcesContent":["import {\n Component,\n Prop,\n Element,\n State,\n ComponentInterface,\n Event,\n EventEmitter,\n Watch,\n h,\n Host,\n Listen, Method\n} from '@stencil/core';\n\nimport { WcsTabsAlignment, WcsTabChangeEvent } from './tabs-interface';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\nimport { inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from \"../../utils/helpers\";\n\nconst TABS_INHERITED_ATTRS = [];\n\n/**\n * Tabs component to switch between tab content. Use in conjunction with `wcs-tab`.\n * \n * @cssprop --wcs-tabs-indicator-height - Height of the tabs indicator \n * @cssprop --wcs-tabs-indicator-background-color - Background color of the tabs indicator\n * @cssprop --wcs-tabs-indicator-border-radius - Border radius of the tabs indicator\n * @cssprop --wcs-tabs-color-default - Text color of the tabs\n * @cssprop --wcs-tabs-color-hover - Text color of the tabs when hovered\n * @cssprop --wcs-tabs-color-press - Text color of the tabs when pressed\n * @cssprop --wcs-tabs-color-focus - Text color of the tabs when focused\n * @cssprop --wcs-tabs-color-selected - Text color of the tabs when selected\n * @cssprop --wcs-tabs-background-color-focus - Background color of the tabs when focused\n * @cssprop --wcs-tabs-background-color-hover - Background color of the tabs when hovered\n * @cssprop --wcs-tabs-background-color-press - Background color of the tabs when pressed\n * @cssprop --wcs-tabs-border-radius - Border radius of the tabs\n * @cssprop --wcs-tabs-border-color-focus - Outline color on a focused tab\n * @cssprop --wcs-tabs-font-weight-default - Font weight of the tabs\n * @cssprop --wcs-tabs-font-weight-selected - Font weight of the tabs when selected\n * @cssprop --wcs-tabs-padding-top - Padding top of the tabs\n * @cssprop --wcs-tabs-padding-right - Padding right of the tabs\n * @cssprop --wcs-tabs-padding-bottom - Padding bottom of the tabs\n * @cssprop --wcs-tabs-padding-left - Padding left of the tabs\n * @cssprop --wcs-tabs-headers-border-bottom - Border bottom (gutter) below the tabs\n * @cssprop --wcs-tabs-transition-duration - Transition duration of the tabs\n */\n@Component({\n tag: 'wcs-tabs',\n styleUrl: 'tabs.scss',\n shadow: true,\n})\nexport class Tabs implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLWcsTabsElement;\n private nativeTablist!: HTMLElement;\n private inheritedAttributes: { [k: string]: any } = {};\n \n /**\n * Tab headers alignment.\n */\n @Prop({reflect: true}) align: WcsTabsAlignment = 'start';\n\n /**\n * Current selected tab index.\n * Starts at 0.\n */\n @Prop() selectedIndex: number = 0;\n\n @Prop() selectedKey: any;\n\n /**\n * Whether to skip rendering the tabpanel with the content of the selected tab. Use this prop if you plan to\n * separately render the tab content.\n */\n @Prop() headersOnly: boolean = false;\n /** Determines if tabs header should have a border at the bottom */\n @Prop() gutter: boolean;\n\n /**\n * Description is used to provide aria-label for the tabs container which has `role=\"tablist\"`.\n */\n @Prop() description: string;\n\n /**\n *\n * Emitted when the selected tab change.\n */\n @Event() tabChange!: EventEmitter<WcsTabChangeEvent>;\n\n @State() private headers: string[] = [];\n\n @State() private currentActiveTabIndex = 0;\n\n private tabsId: number = tabsId++;\n\n @Watch('selectedIndex')\n selectedIndexChanged(newValue: number) {\n this.currentActiveTabIndex = newValue;\n }\n\n @Watch('selectedKey')\n selectedTabkeyChanged(newValue: any) {\n this.updateCurrentActiveIndexByTabKey(newValue);\n }\n\n private emitActiveTabChange() {\n this.tabChange.emit({\n tabName: this.headers[this.currentActiveTabIndex],\n tabIndex: this.currentActiveTabIndex,\n selectedKey: this.tabs[this.currentActiveTabIndex].itemKey\n });\n }\n\n private updateCurrentActiveIndexByTabKey(newValue: any) {\n for (let i = 0; i < this.tabs.length; i++) {\n const tab = this.tabs[i];\n if (tab.itemKey === newValue) {\n this.currentActiveTabIndex = i;\n }\n }\n }\n\n @Listen('tabLoaded')\n onTabLoaded() {\n this.refreshHeaders();\n }\n\n componentDidLoad() {\n this.putTabsInCorrectDivIfTheyAreNot();\n this.refreshHeaders();\n if (this.selectedIndex) {\n this.currentActiveTabIndex = this.selectedIndex;\n }\n if (this.selectedKey) {\n this.updateCurrentActiveIndexByTabKey(this.selectedKey);\n }\n }\n\n // XXX: Firefox < 63\n private putTabsInCorrectDivIfTheyAreNot() {\n const tabDiv = this.el.shadowRoot.querySelector('.wcs-tabs');\n if (tabDiv.querySelector('slot') === null) {\n Array.from(this.el.querySelectorAll('wcs-tab'))\n .filter(node => node.parentNode !== tabDiv)\n .forEach(tab => {\n if (tab.parentElement.isEqualNode(this.el)) {\n this.el.removeChild(tab);\n tabDiv.appendChild(tab);\n }\n });\n }\n }\n\n handleKeyDown(ev: KeyboardEvent, tabIndex: number) {\n const target = ev.target as HTMLDivElement;\n switch (ev.key) {\n case ' ':\n case 'Enter': {\n this.currentActiveTabIndex = tabIndex;\n this.emitActiveTabChange();\n ev.preventDefault();\n break;\n }\n case 'ArrowLeft': {\n if (target.previousElementSibling?.classList.contains('wcs-tab-header')) {\n (target.previousElementSibling as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n case 'ArrowRight': {\n if (target.nextElementSibling?.classList.contains('wcs-tab-header')) {\n (target.nextElementSibling as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n case 'Home': {\n const firstTab = this.el.shadowRoot.querySelector('.wcs-tab-header:first-child');\n if (firstTab) {\n (firstTab as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n case 'End': {\n const lastTab = this.el.shadowRoot.querySelector('.wcs-tab-header:last-child');\n if (lastTab) {\n (lastTab as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n }\n }\n\n private refreshHeaders() {\n this.headers = [];\n this.tabs\n .forEach(x => {\n this.headers.push(x.getAttribute('header'));\n });\n }\n\n private get tabs() {\n const tabsEl = this.el.shadowRoot.querySelector('.wcs-tabs');\n // FIXME: problem with this selector being too greedy in ff < 63\n const tabs = this.el.shadowRoot.querySelectorAll('.wcs-tabs > wcs-tab');\n\n return tabs.length !== 0\n ? tabs\n : tabsEl?.querySelector('slot')\n ? tabsEl?.querySelector('slot')?.assignedElements() as unknown as NodeListOf<HTMLWcsTabElement>\n : [];\n }\n\n private selectTabAndEmitChangeEvent(index: number) {\n this.currentActiveTabIndex = index;\n this.emitActiveTabChange()\n }\n\n componentWillUpdate() {\n if (!this.headersOnly) {\n this.updateTabVisibility();\n } else {\n this.hideAllTabsContent();\n }\n }\n\n componentWillLoad(): Promise<void> | void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, TABS_INHERITED_ATTRS),\n };\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeTablist, attr, value);\n }\n\n private updateTabVisibility() {\n this.tabs.forEach((el: HTMLWcsTabElement, idx: number) => {\n if (idx !== this.currentActiveTabIndex) {\n el.hidden = true;\n } else {\n el.hidden = false;\n }\n });\n }\n\n private hideAllTabsContent() {\n this.tabs.forEach((el: HTMLWcsTabElement) => el.hidden = true);\n }\n\n render() {\n return (\n <Host>\n <div class=\"wcs-tabs-headers\"\n role=\"tablist\"\n ref={(el) => (this.nativeTablist = el)}\n aria-label={this.description}\n {...this.inheritedAttributes}>\n {this.headers.map((header, idx) =>\n <div class={'wcs-tab-header ' + (this.currentActiveTabIndex === idx ? 'active' : '')}\n onClick={() => this.selectTabAndEmitChangeEvent(idx)}\n onKeyDown={evt => this.handleKeyDown(evt, idx)}\n tabIndex={this.currentActiveTabIndex === idx ? 0 : -1}\n role=\"tab\"\n id={`tabs-id-${this.tabsId}-tab-id-${idx}`}\n // aria-controls refers to ID of the tab panel related to the header\n aria-controls={`tabs-id-${this.tabsId}-tab-panel-${idx}`}\n aria-label={header}\n aria-selected={this.currentActiveTabIndex === idx ? 'true' : 'false'}\n >\n <span>{header}</span>\n </div>\n )}\n </div>\n <div class=\"wcs-tabs\">\n <slot onSlotchange={() => this.onTabsSlotChange()} name=\"wcs-tab\"/>\n </div>\n </Host>\n );\n }\n\n /**\n * Observe when a new tab panel is added to the slot to let's handle accessibility properties for tabs panel:\n * - id: to let header tab refers it proper panel\n * - aria-label: take the same name as it's referenced header name\n * \n * @private\n */\n private onTabsSlotChange() {\n let tabId = 0;\n this.tabs.forEach(tab => {\n tab.setAttribute(\"aria-label\", this.headers.at(tabId));\n // set an ID to set aria-controls on header tab \n // (https://www.w3.org/WAI/ARIA/apg/patterns/tabs/examples/tabs-automatic/#:~:text=Refers%20to%20the%20element)\n tab.setAttribute(\"id\", `tabs-id-${this.tabsId}-tab-panel-${tabId}`);\n tabId++;\n });\n }\n}\n\nlet tabsId = 0;\n"]}
1
+ {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EAEL,KAAK,EACL,CAAC,EACD,IAAI,EACJ,MAAM,EAAE,MAAM,EACjB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAErG,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAMH,MAAM,OAAO,IAAI;;QAGL,wBAAmB,GAAyB,EAAE,CAAC;QAsC/C,WAAM,GAAW,MAAM,EAAE,CAAC;qBAjCe,OAAO;6BAMxB,CAAC;;2BAQF,KAAK;;;uBAeC,EAAE;qCAEE,CAAC;;IAK1C,oBAAoB,CAAC,QAAgB;QACjC,IAAI,CAAC,qBAAqB,GAAG,QAAQ,CAAC;IAC1C,CAAC;IAGD,qBAAqB,CAAC,QAAa;QAC/B,IAAI,CAAC,gCAAgC,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAEO,mBAAmB;QACvB,IAAI,CAAC,SAAS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E;YACpB,GAAG,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YACvD,gDAAgD;YAChD,+GAA+G;YAC/G,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,WAAW,IAAI,CAAC,MAAM,cAAc,KAAK,EAAE,CAAC,CAAC;YACpE,KAAK,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,MAAM,GAAG,CAAC,CAAC","sourcesContent":["import {\n Component,\n Prop,\n Element,\n State,\n ComponentInterface,\n Event,\n EventEmitter,\n Watch,\n h,\n Host,\n Listen, Method\n} from '@stencil/core';\n\nimport { WcsTabsAlignment, WcsTabChangeEvent } from './tabs-interface';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\nimport { inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from \"../../utils/helpers\";\n\nconst TABS_INHERITED_ATTRS = [];\n\n/**\n * Tabs component to switch between tab content. Use in conjunction with `wcs-tab`.\n * \n * @cssprop --wcs-tabs-indicator-height - Height of the tabs indicator \n * @cssprop --wcs-tabs-indicator-background-color - Background color of the tabs indicator\n * @cssprop --wcs-tabs-indicator-border-radius - Border radius of the tabs indicator\n * @cssprop --wcs-tabs-color-default - Text color of the tabs\n * @cssprop --wcs-tabs-color-hover - Text color of the tabs when hovered\n * @cssprop --wcs-tabs-color-press - Text color of the tabs when pressed\n * @cssprop --wcs-tabs-color-focus - Text color of the tabs when focused\n * @cssprop --wcs-tabs-color-selected - Text color of the tabs when selected\n * @cssprop --wcs-tabs-background-color-focus - Background color of the tabs when focused\n * @cssprop --wcs-tabs-background-color-hover - Background color of the tabs when hovered\n * @cssprop --wcs-tabs-background-color-press - Background color of the tabs when pressed\n * @cssprop --wcs-tabs-border-radius - Border radius of the tabs\n * @cssprop --wcs-tabs-border-color-focus - Outline color on a focused tab\n * @cssprop --wcs-tabs-font-weight-default - Font weight of the tabs\n * @cssprop --wcs-tabs-font-weight-selected - Font weight of the tabs when selected\n * @cssprop --wcs-tabs-padding-top - Padding top of the tabs\n * @cssprop --wcs-tabs-padding-right - Padding right of the tabs\n * @cssprop --wcs-tabs-padding-bottom - Padding bottom of the tabs\n * @cssprop --wcs-tabs-padding-left - Padding left of the tabs\n * @cssprop --wcs-tabs-headers-border-bottom - Border bottom (gutter) below the tabs\n * @cssprop --wcs-tabs-transition-duration - Transition duration of the tabs\n */\n@Component({\n tag: 'wcs-tabs',\n styleUrl: 'tabs.scss',\n shadow: true,\n})\nexport class Tabs implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLWcsTabsElement;\n private nativeTablist!: HTMLElement;\n private inheritedAttributes: { [k: string]: any } = {};\n \n /**\n * Tab headers alignment.\n */\n @Prop({reflect: true}) align: WcsTabsAlignment = 'start';\n\n /**\n * Current selected tab index.\n * Starts at 0.\n */\n @Prop() selectedIndex: number = 0;\n\n @Prop() selectedKey: any;\n\n /**\n * Whether to skip rendering the tabpanel with the content of the selected tab. Use this prop if you plan to\n * separately render the tab content.\n */\n @Prop() headersOnly: boolean = false;\n /** Determines if tabs header should have a border at the bottom */\n @Prop({ reflect: true }) gutter: boolean;\n\n /**\n * Description is used to provide aria-label for the tabs container which has `role=\"tablist\"`.\n */\n @Prop() description: string;\n\n /**\n *\n * Emitted when the selected tab change.\n */\n @Event() tabChange!: EventEmitter<WcsTabChangeEvent>;\n\n @State() private headers: string[] = [];\n\n @State() private currentActiveTabIndex = 0;\n\n private tabsId: number = tabsId++;\n\n @Watch('selectedIndex')\n selectedIndexChanged(newValue: number) {\n this.currentActiveTabIndex = newValue;\n }\n\n @Watch('selectedKey')\n selectedTabkeyChanged(newValue: any) {\n this.updateCurrentActiveIndexByTabKey(newValue);\n }\n\n private emitActiveTabChange() {\n this.tabChange.emit({\n tabName: this.headers[this.currentActiveTabIndex],\n tabIndex: this.currentActiveTabIndex,\n selectedKey: this.tabs[this.currentActiveTabIndex].itemKey\n });\n }\n\n private updateCurrentActiveIndexByTabKey(newValue: any) {\n for (let i = 0; i < this.tabs.length; i++) {\n const tab = this.tabs[i];\n if (tab.itemKey === newValue) {\n this.currentActiveTabIndex = i;\n }\n }\n }\n\n @Listen('tabLoaded')\n onTabLoaded() {\n this.refreshHeaders();\n }\n\n componentDidLoad() {\n this.putTabsInCorrectDivIfTheyAreNot();\n this.refreshHeaders();\n if (this.selectedIndex) {\n this.currentActiveTabIndex = this.selectedIndex;\n }\n if (this.selectedKey) {\n this.updateCurrentActiveIndexByTabKey(this.selectedKey);\n }\n }\n\n // XXX: Firefox < 63\n private putTabsInCorrectDivIfTheyAreNot() {\n const tabDiv = this.el.shadowRoot.querySelector('.wcs-tabs');\n if (tabDiv.querySelector('slot') === null) {\n Array.from(this.el.querySelectorAll('wcs-tab'))\n .filter(node => node.parentNode !== tabDiv)\n .forEach(tab => {\n if (tab.parentElement.isEqualNode(this.el)) {\n this.el.removeChild(tab);\n tabDiv.appendChild(tab);\n }\n });\n }\n }\n\n handleKeyDown(ev: KeyboardEvent, tabIndex: number) {\n const target = ev.target as HTMLDivElement;\n switch (ev.key) {\n case ' ':\n case 'Enter': {\n this.currentActiveTabIndex = tabIndex;\n this.emitActiveTabChange();\n ev.preventDefault();\n break;\n }\n case 'ArrowLeft': {\n if (target.previousElementSibling?.classList.contains('wcs-tab-header')) {\n (target.previousElementSibling as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n case 'ArrowRight': {\n if (target.nextElementSibling?.classList.contains('wcs-tab-header')) {\n (target.nextElementSibling as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n case 'Home': {\n const firstTab = this.el.shadowRoot.querySelector('.wcs-tab-header:first-child');\n if (firstTab) {\n (firstTab as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n case 'End': {\n const lastTab = this.el.shadowRoot.querySelector('.wcs-tab-header:last-child');\n if (lastTab) {\n (lastTab as HTMLDivElement).focus();\n ev.preventDefault();\n }\n break;\n }\n }\n }\n\n private refreshHeaders() {\n this.headers = [];\n this.tabs\n .forEach(x => {\n this.headers.push(x.getAttribute('header'));\n });\n }\n\n private get tabs() {\n const tabsEl = this.el.shadowRoot.querySelector('.wcs-tabs');\n // FIXME: problem with this selector being too greedy in ff < 63\n const tabs = this.el.shadowRoot.querySelectorAll('.wcs-tabs > wcs-tab');\n\n return tabs.length !== 0\n ? tabs\n : tabsEl?.querySelector('slot')\n ? tabsEl?.querySelector('slot')?.assignedElements() as unknown as NodeListOf<HTMLWcsTabElement>\n : [];\n }\n\n private selectTabAndEmitChangeEvent(index: number) {\n this.currentActiveTabIndex = index;\n this.emitActiveTabChange()\n }\n\n componentWillUpdate() {\n if (!this.headersOnly) {\n this.updateTabVisibility();\n } else {\n this.hideAllTabsContent();\n }\n }\n\n componentWillLoad(): Promise<void> | void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, TABS_INHERITED_ATTRS),\n };\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeTablist, attr, value);\n }\n\n private updateTabVisibility() {\n this.tabs.forEach((el: HTMLWcsTabElement, idx: number) => {\n if (idx !== this.currentActiveTabIndex) {\n el.hidden = true;\n } else {\n el.hidden = false;\n }\n });\n }\n\n private hideAllTabsContent() {\n this.tabs.forEach((el: HTMLWcsTabElement) => el.hidden = true);\n }\n\n render() {\n return (\n <Host>\n <div class=\"wcs-tabs-headers\"\n role=\"tablist\"\n ref={(el) => (this.nativeTablist = el)}\n aria-label={this.description}\n {...this.inheritedAttributes}>\n {this.headers.map((header, idx) =>\n <div class={'wcs-tab-header ' + (this.currentActiveTabIndex === idx ? 'active' : '')}\n onClick={() => this.selectTabAndEmitChangeEvent(idx)}\n onKeyDown={evt => this.handleKeyDown(evt, idx)}\n tabIndex={this.currentActiveTabIndex === idx ? 0 : -1}\n role=\"tab\"\n id={`tabs-id-${this.tabsId}-tab-id-${idx}`}\n // aria-controls refers to ID of the tab panel related to the header\n aria-controls={`tabs-id-${this.tabsId}-tab-panel-${idx}`}\n aria-label={header}\n aria-selected={this.currentActiveTabIndex === idx ? 'true' : 'false'}\n >\n <span>{header}</span>\n </div>\n )}\n </div>\n <div class=\"wcs-tabs\">\n <slot onSlotchange={() => this.onTabsSlotChange()} name=\"wcs-tab\"/>\n </div>\n </Host>\n );\n }\n\n /**\n * Observe when a new tab panel is added to the slot to let's handle accessibility properties for tabs panel:\n * - id: to let header tab refers it proper panel\n * - aria-label: take the same name as it's referenced header name\n * \n * @private\n */\n private onTabsSlotChange() {\n let tabId = 0;\n this.tabs.forEach(tab => {\n tab.setAttribute(\"aria-label\", this.headers.at(tabId));\n // set an ID to set aria-controls on header tab \n // (https://www.w3.org/WAI/ARIA/apg/patterns/tabs/examples/tabs-automatic/#:~:text=Refers%20to%20the%20element)\n tab.setAttribute(\"id\", `tabs-id-${this.tabsId}-tab-panel-${tabId}`);\n tabId++;\n });\n }\n}\n\nlet tabsId = 0;\n"]}
@@ -170,7 +170,7 @@ export class Textarea {
170
170
  render() {
171
171
  const value = this.getValue();
172
172
  const style = Object.assign({}, (this.resize && { 'resize': this.resize }));
173
- return (h(Host, { key: '1d7fc40452ef3499c548ead8966d565f69464c7e', "aria-disabled": this.disabled ? 'true' : null }, this.icon ? (h("wcs-mat-icon", { icon: this.icon, size: "m" })) : null, h("textarea", Object.assign({ key: '5d1ee380bf9e0ddd60864210b337de4bb4ec1e80', class: "native-textarea", ref: el => this.nativeInput = el, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, style: style }, this.inheritedAttributes), value)));
173
+ return (h(Host, { key: 'd2f0cea260f9745f49f4aa259004b704af492c33', "aria-disabled": this.disabled ? 'true' : null }, this.icon ? (h("wcs-mat-icon", { icon: this.icon, size: "m" })) : null, h("textarea", Object.assign({ key: 'a5c87bbb2888132fd62f26df0f36e5d4e003ad84', class: "native-textarea", ref: el => this.nativeInput = el, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, style: style }, this.inheritedAttributes), value)));
174
174
  }
175
175
  static get is() { return "wcs-textarea"; }
176
176
  static get encapsulation() { return "shadow"; }
@@ -277,7 +277,7 @@ export class Textarea {
277
277
  "text": "If `true`, the user cannot interact with the textarea."
278
278
  },
279
279
  "attribute": "disabled",
280
- "reflect": false,
280
+ "reflect": true,
281
281
  "defaultValue": "false"
282
282
  },
283
283
  "icon": {
@@ -427,7 +427,7 @@ export class Textarea {
427
427
  "text": "If `true`, the user cannot modify the value."
428
428
  },
429
429
  "attribute": "readonly",
430
- "reflect": false,
430
+ "reflect": true,
431
431
  "defaultValue": "false"
432
432
  },
433
433
  "required": {
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAET,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,WAAW,GAAG,CAAC,CAAC","sourcesContent":["import {\n Component,\n ComponentInterface,\n Method,\n Prop,\n Watch,\n h,\n Host,\n EventEmitter,\n Element,\n Event,\n Build,\n readTask\n} from '@stencil/core';\nimport {\n debounceEvent,\n inheritAriaAttributes,\n inheritAttributes,\n raf,\n setOrRemoveAttribute\n} from '../../utils/helpers';\nimport { \n TextareaChangeEventDetail,\n WcsTextareaInputMode, \n WcsTextareaEnterKeyHint, \n WcsTextareaResize, \n WcsTextareaInputState,\n WcsTextareaWrap\n} from './textarea-interface';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\nconst TEXTAREA_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * Mainly inspired from Ionic Textarea Component.\n * \n * ## Accessibility guidelines 💡\n * > - If you use wcs-textarea outside a wcs-form-field, you have to manage the label and the error message yourself.\n * > You can use the `aria-label` attribute to provide a label for screen readers but adds no visual label.\n *\n * @cssprop --wcs-textarea-icon-color-default - Default icon color whe the textarea is not focused\n * @cssprop --wcs-textarea-icon-color-focus - Icon color when the textarea is focused \n * @cssprop --wcs-textarea-icon-color-disabled - Icon color when the textarea is disabled\n * \n * @cssprop --wcs-textarea-background-color - Background color of the textarea\n *\n * @cssprop --wcs-textarea-border-radius-left - Border radius of the left side of the textarea\n * @cssprop --wcs-textarea-border-radius-right - Border radius of the right side of the textarea\n * \n * @cssprop --wcs-textarea-border-width - Border width of the textarea when not focused\n * @cssprop --wcs-textarea-border-width-focus - Border width of the textarea when focused\n * \n * @cssprop --wcs-textarea-border-color-default - Default border color of the textarea when not focused\n * @cssprop --wcs-textarea-border-color-disabled - Border color of the textarea when disabled\n * @cssprop --wcs-textarea-border-color-error - Border color of the textarea when in error state\n * @cssprop --wcs-textarea-border-color-focus - Border color of the textarea when focused\n * \n * @cssprop --wcs-textarea-value-color - Color of the value when the textarea is not focused\n * @cssprop --wcs-textarea-value-font-weight - Font weight of the textarea value\n * \n * @cssprop --wcs-textarea-placeholder-color - Color of the textarea placeholder\n * @cssprop --wcs-textarea-placeholder-font-weight - Font weight of the textarea placeholder\n * @cssprop --wcs-textarea-placeholder-font-style - Font style of the textarea placeholder\n * \n * @cssprop --wcs-textarea-text-color-disabled - Color of the value when the textarea is disabled\n * \n * @cssprop --wcs-textarea-border-style-default - Border style default of the textarea when not focused\n * @cssprop --wcs-textarea-border-style-error - Border style default of the textarea in error state\n * @cssprop --wcs-textarea-border-style-focus - Border style default of the textarea when focused\n * \n * @cssprop --wcs-textarea-min-height - Min height of the textarea component\n * @cssprop --wcs-textarea-max-height - Max height of the textarea component\n * \n * @cssprop --wcs-textarea-padding-top - Padding top of the textarea\n * @cssprop --wcs-textarea-padding-bottom - Padding bottom of the textarea\n * @cssprop --wcs-textarea-padding-left - Padding left of the textarea\n * @cssprop --wcs-textarea-padding-right - Padding right of the textarea\n * \n * @cssprop --wcs-textarea-gap - Gap between textarea and icon (prefix/suffix)\n */\n@Component({\n tag: 'wcs-textarea',\n styleUrl: 'textarea.scss',\n shadow: {\n delegatesFocus: true\n },\n})\nexport class Textarea implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeInput?: HTMLTextAreaElement;\n private inputId = `wcs-textarea-${textareaIds++}`;\n private inheritedAttributes: { [k: string]: any } = {};\n\n /**\n * This is required for a WebKit bug which requires us to\n * blur and focus an input to properly focus the input in\n * an item with delegatesFocus. It will no longer be needed\n * with iOS 14.\n *\n * @internal\n */\n @Prop() fireFocusEvents = true;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalize = 'none';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `wcsInput` event after each keystroke.\n * This also impacts form bindings such as `ngModel` or `v-model`.\n */\n @Prop() debounce = 0;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.wcsInput = debounceEvent(this.wcsInput, this.debounce);\n }\n\n /**\n * If `true`, the user cannot interact with the textarea.\n */\n @Prop() disabled = false;\n\n /**\n * Name of the material icon to add to the input\n */\n @Prop() icon: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n */\n @Prop() inputmode?: WcsTextareaInputMode;\n\n /**\n * A hint to the browser for which enter key to display.\n */\n @Prop() enterkeyhint?: WcsTextareaEnterKeyHint;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Specifies the state of the input. By default the input is in an initial state but you can set it to 'error' state if the data given by the user is not valid.\n */\n @Prop({reflect: true}) state: WcsTextareaInputState = 'initial';\n\n /**\n * The visible width of the text control, in average character widths. If it is specified, it must be a positive integer. \n * Note : at the moment, modifying the width is only possible if you add some custom CSS to the component,\n * for example by overriding the `width` CSS property. See the Resize section for an example on how to do it.\n */\n @Prop() cols?: number;\n\n /**\n * The number of visible text lines for the control.\n */\n @Prop() rows?: number;\n\n /**\n * Indicates how the control wraps text.\n */\n @Prop() wrap?: WcsTextareaWrap;\n\n /**\n * If `true`, the element height will increase based on the value.\n */\n @Prop() autoGrow = false;\n\n /**\n * The value of the textarea.\n */\n @Prop({mutable: true}) value?: string | null = '';\n\n /**\n * Indicates how the textarea should be resizable. \n * Note : at the moment horizontal resizing is only possible if you add custom CSS to the component,\n * see the Resize section for an example.\n */\n @Prop({reflect: true}) resize?: WcsTextareaResize;\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.runAutoGrow();\n }\n\n /**\n * Emitted when the input value has changed.- See https://developer.mozilla.org/en-US/docs/Web/Events/change\n */\n @Event() wcsChange!: EventEmitter<TextareaChangeEventDetail>;\n\n /**\n * Emitted when a keyboard input occurred. See https://developer.mozilla.org/en-US/docs/Web/Events/input\n */\n @Event() wcsInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() wcsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() wcsFocus!: EventEmitter<FocusEvent>;\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidLoad', {\n detail: this.el\n }));\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidUnload', {\n detail: this.el\n }));\n }\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, TEXTAREA_INHERITED_ATTRS)\n };\n }\n\n componentDidLoad() {\n raf(() => this.runAutoGrow());\n }\n\n private runAutoGrow() {\n const nativeInput = this.nativeInput;\n if (nativeInput && this.autoGrow) {\n readTask(() => {\n nativeInput.style.height = 'auto';\n nativeInput.style.height = nativeInput.scrollHeight + 'px';\n });\n }\n }\n \n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeInput, attr, value);\n }\n\n /**\n * This method make the textarea automatically adopt the size of the content without a scroll bar\n */\n @Method()\n async fitContent() {\n raf(() => this.runAutoGrow());\n }\n\n /**\n * Sets blur on the native `textarea` in `wcs-textarea`. Use this method instead of the global\n * `textarea.blur()`.\n * @internal\n */\n @Method()\n async setBlur() {\n if (this.nativeInput) {\n this.nativeInput.blur();\n }\n }\n\n /**\n * Returns the native `<textarea>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLTextAreaElement> {\n // tslint:disable-next-line:no-non-null-assertion\n return Promise.resolve(this.nativeInput!);\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private onInput = (ev: Event) => {\n if (this.nativeInput) {\n this.value = this.nativeInput.value;\n }\n this.wcsInput.emit(ev as KeyboardEvent);\n }\n \n private onChange = (_: Event) => {\n this.wcsChange.emit({value: this.nativeInput.value});\n }\n\n private onFocus = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsFocus.emit(ev);\n }\n }\n\n private onBlur = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsBlur.emit(ev);\n }\n }\n\n render() {\n const value = this.getValue();\n const style = {\n ...(this.resize && {'resize': this.resize})\n }\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n >\n {this.icon ? (<wcs-mat-icon icon={this.icon} size=\"m\"></wcs-mat-icon>) : null}\n <textarea\n class=\"native-textarea\"\n ref={el => this.nativeInput = el}\n autoCapitalize={this.autocapitalize}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n disabled={this.disabled}\n maxLength={this.maxlength}\n minLength={this.minlength}\n name={this.name}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n cols={this.cols}\n rows={this.rows}\n wrap={this.wrap}\n onInput={this.onInput}\n onChange={this.onChange}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n style={style}\n {...this.inheritedAttributes}\n >\n {value}\n </textarea>\n </Host>\n );\n }\n}\n\nlet textareaIds = 0;\n"]}
1
+ {"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAET,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,EACD,IAAI,EAEJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,GAAG,EACH,oBAAoB,EACvB,MAAM,qBAAqB,CAAC;AAW7B,MAAM,wBAAwB,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAQH,MAAM,OAAO,QAAQ;;QAGT,YAAO,GAAG,gBAAgB,WAAW,EAAE,EAAE,CAAC;QAC1C,wBAAmB,GAAyB,EAAE,CAAC;QA4O/C,YAAO,GAAG,CAAC,EAAS,EAAE,EAAE;YAC5B,IAAI,IAAI,CAAC,WAAW,EAAE,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,WAAW,GAAG,CAAC,CAAC","sourcesContent":["import {\n Component,\n ComponentInterface,\n Method,\n Prop,\n Watch,\n h,\n Host,\n EventEmitter,\n Element,\n Event,\n Build,\n readTask\n} from '@stencil/core';\nimport {\n debounceEvent,\n inheritAriaAttributes,\n inheritAttributes,\n raf,\n setOrRemoveAttribute\n} from '../../utils/helpers';\nimport { \n TextareaChangeEventDetail,\n WcsTextareaInputMode, \n WcsTextareaEnterKeyHint, \n WcsTextareaResize, \n WcsTextareaInputState,\n WcsTextareaWrap\n} from './textarea-interface';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\nconst TEXTAREA_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * Mainly inspired from Ionic Textarea Component.\n * \n * ## Accessibility guidelines 💡\n * > - If you use wcs-textarea outside a wcs-form-field, you have to manage the label and the error message yourself.\n * > You can use the `aria-label` attribute to provide a label for screen readers but adds no visual label.\n *\n * @cssprop --wcs-textarea-icon-color-default - Default icon color whe the textarea is not focused\n * @cssprop --wcs-textarea-icon-color-focus - Icon color when the textarea is focused \n * @cssprop --wcs-textarea-icon-color-disabled - Icon color when the textarea is disabled\n * \n * @cssprop --wcs-textarea-background-color - Background color of the textarea\n *\n * @cssprop --wcs-textarea-border-radius-left - Border radius of the left side of the textarea\n * @cssprop --wcs-textarea-border-radius-right - Border radius of the right side of the textarea\n * \n * @cssprop --wcs-textarea-border-width - Border width of the textarea when not focused\n * @cssprop --wcs-textarea-border-width-focus - Border width of the textarea when focused\n * \n * @cssprop --wcs-textarea-border-color-default - Default border color of the textarea when not focused\n * @cssprop --wcs-textarea-border-color-disabled - Border color of the textarea when disabled\n * @cssprop --wcs-textarea-border-color-error - Border color of the textarea when in error state\n * @cssprop --wcs-textarea-border-color-focus - Border color of the textarea when focused\n * \n * @cssprop --wcs-textarea-value-color - Color of the value when the textarea is not focused\n * @cssprop --wcs-textarea-value-font-weight - Font weight of the textarea value\n * \n * @cssprop --wcs-textarea-placeholder-color - Color of the textarea placeholder\n * @cssprop --wcs-textarea-placeholder-font-weight - Font weight of the textarea placeholder\n * @cssprop --wcs-textarea-placeholder-font-style - Font style of the textarea placeholder\n * \n * @cssprop --wcs-textarea-text-color-disabled - Color of the value when the textarea is disabled\n * \n * @cssprop --wcs-textarea-border-style-default - Border style default of the textarea when not focused\n * @cssprop --wcs-textarea-border-style-error - Border style default of the textarea in error state\n * @cssprop --wcs-textarea-border-style-focus - Border style default of the textarea when focused\n * \n * @cssprop --wcs-textarea-min-height - Min height of the textarea component\n * @cssprop --wcs-textarea-max-height - Max height of the textarea component\n * \n * @cssprop --wcs-textarea-padding-top - Padding top of the textarea\n * @cssprop --wcs-textarea-padding-bottom - Padding bottom of the textarea\n * @cssprop --wcs-textarea-padding-left - Padding left of the textarea\n * @cssprop --wcs-textarea-padding-right - Padding right of the textarea\n * \n * @cssprop --wcs-textarea-gap - Gap between textarea and icon (prefix/suffix)\n */\n@Component({\n tag: 'wcs-textarea',\n styleUrl: 'textarea.scss',\n shadow: {\n delegatesFocus: true\n },\n})\nexport class Textarea implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeInput?: HTMLTextAreaElement;\n private inputId = `wcs-textarea-${textareaIds++}`;\n private inheritedAttributes: { [k: string]: any } = {};\n\n /**\n * This is required for a WebKit bug which requires us to\n * blur and focus an input to properly focus the input in\n * an item with delegatesFocus. It will no longer be needed\n * with iOS 14.\n *\n * @internal\n */\n @Prop() fireFocusEvents = true;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalize = 'none';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `wcsInput` event after each keystroke.\n * This also impacts form bindings such as `ngModel` or `v-model`.\n */\n @Prop() debounce = 0;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.wcsInput = debounceEvent(this.wcsInput, this.debounce);\n }\n\n /**\n * If `true`, the user cannot interact with the textarea.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Name of the material icon to add to the input\n */\n @Prop() icon: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n */\n @Prop() inputmode?: WcsTextareaInputMode;\n\n /**\n * A hint to the browser for which enter key to display.\n */\n @Prop() enterkeyhint?: WcsTextareaEnterKeyHint;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Specifies the state of the input. By default the input is in an initial state but you can set it to 'error' state if the data given by the user is not valid.\n */\n @Prop({reflect: true}) state: WcsTextareaInputState = 'initial';\n\n /**\n * The visible width of the text control, in average character widths. If it is specified, it must be a positive integer. \n * Note : at the moment, modifying the width is only possible if you add some custom CSS to the component,\n * for example by overriding the `width` CSS property. See the Resize section for an example on how to do it.\n */\n @Prop() cols?: number;\n\n /**\n * The number of visible text lines for the control.\n */\n @Prop() rows?: number;\n\n /**\n * Indicates how the control wraps text.\n */\n @Prop() wrap?: WcsTextareaWrap;\n\n /**\n * If `true`, the element height will increase based on the value.\n */\n @Prop() autoGrow = false;\n\n /**\n * The value of the textarea.\n */\n @Prop({mutable: true}) value?: string | null = '';\n\n /**\n * Indicates how the textarea should be resizable. \n * Note : at the moment horizontal resizing is only possible if you add custom CSS to the component,\n * see the Resize section for an example.\n */\n @Prop({reflect: true}) resize?: WcsTextareaResize;\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.runAutoGrow();\n }\n\n /**\n * Emitted when the input value has changed.- See https://developer.mozilla.org/en-US/docs/Web/Events/change\n */\n @Event() wcsChange!: EventEmitter<TextareaChangeEventDetail>;\n\n /**\n * Emitted when a keyboard input occurred. See https://developer.mozilla.org/en-US/docs/Web/Events/input\n */\n @Event() wcsInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() wcsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() wcsFocus!: EventEmitter<FocusEvent>;\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidLoad', {\n detail: this.el\n }));\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidUnload', {\n detail: this.el\n }));\n }\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, TEXTAREA_INHERITED_ATTRS)\n };\n }\n\n componentDidLoad() {\n raf(() => this.runAutoGrow());\n }\n\n private runAutoGrow() {\n const nativeInput = this.nativeInput;\n if (nativeInput && this.autoGrow) {\n readTask(() => {\n nativeInput.style.height = 'auto';\n nativeInput.style.height = nativeInput.scrollHeight + 'px';\n });\n }\n }\n \n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeInput, attr, value);\n }\n\n /**\n * This method make the textarea automatically adopt the size of the content without a scroll bar\n */\n @Method()\n async fitContent() {\n raf(() => this.runAutoGrow());\n }\n\n /**\n * Sets blur on the native `textarea` in `wcs-textarea`. Use this method instead of the global\n * `textarea.blur()`.\n * @internal\n */\n @Method()\n async setBlur() {\n if (this.nativeInput) {\n this.nativeInput.blur();\n }\n }\n\n /**\n * Returns the native `<textarea>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLTextAreaElement> {\n // tslint:disable-next-line:no-non-null-assertion\n return Promise.resolve(this.nativeInput!);\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private onInput = (ev: Event) => {\n if (this.nativeInput) {\n this.value = this.nativeInput.value;\n }\n this.wcsInput.emit(ev as KeyboardEvent);\n }\n \n private onChange = (_: Event) => {\n this.wcsChange.emit({value: this.nativeInput.value});\n }\n\n private onFocus = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsFocus.emit(ev);\n }\n }\n\n private onBlur = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsBlur.emit(ev);\n }\n }\n\n render() {\n const value = this.getValue();\n const style = {\n ...(this.resize && {'resize': this.resize})\n }\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n >\n {this.icon ? (<wcs-mat-icon icon={this.icon} size=\"m\"></wcs-mat-icon>) : null}\n <textarea\n class=\"native-textarea\"\n ref={el => this.nativeInput = el}\n autoCapitalize={this.autocapitalize}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n disabled={this.disabled}\n maxLength={this.maxlength}\n minLength={this.minlength}\n name={this.name}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n cols={this.cols}\n rows={this.rows}\n wrap={this.wrap}\n onInput={this.onInput}\n onChange={this.onChange}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n style={style}\n {...this.inheritedAttributes}\n >\n {value}\n </textarea>\n </Host>\n );\n }\n}\n\nlet textareaIds = 0;\n"]}
@@ -26,16 +26,14 @@ const DELEGATED_ARIA_COMPONENTS = ['WCS-BUTTON'];
26
26
  *
27
27
  * ## Accessibility guidelines 💡
28
28
  *
29
- * The component places necessary aria attribute on your target element (like the `wcs-button`) :
30
- * - `aria-expanded`: set to true when popover is open, false when it is closed
31
- *
32
29
  * The problem is that impaired users may not be able to see what is the information provided by the tooltip. To solve
33
30
  * this problem, the tooltip should be served with some aria attributes to make it accessible.
34
31
  *
35
32
  * Aria-features `wcs-tooltip` respect:
36
33
  * - dismiss when the user presses the `Escape` key
37
34
  * - has a `role=tooltip`
38
- * - `aria-expanded` on the targeted element: set to true when popover is open, false when it is closed
35
+ * - when set to `interactive` mode
36
+ * - `aria-expanded` on the targeted element: set to true when popover is open, false when it is closed
39
37
  *
40
38
  * Aria-features `wcs-tooltip` **does not respect with `wcs-button`**:
41
39
  * - aria-controls => we cannot do it yet, we need to wait for Cross root ARIA - export ID (https://github.com/WICG/aom/blob/gh-pages/exportid-explainer.md)
@@ -103,7 +101,9 @@ export class Tooltip {
103
101
  }
104
102
  if (this.forElement.tagName && DELEGATED_ARIA_COMPONENTS.indexOf(this.forElement.tagName) !== -1) {
105
103
  if (isMutableAriaAttribute(this.forElement)) {
106
- this.forElement.setAriaAttribute('aria-expanded', 'true');
104
+ if (this.interactive) {
105
+ this.forElement.setAriaAttribute('aria-expanded', 'true');
106
+ }
107
107
  }
108
108
  }
109
109
  }
@@ -113,7 +113,9 @@ export class Tooltip {
113
113
  }
114
114
  if (this.forElement.tagName && DELEGATED_ARIA_COMPONENTS.indexOf(this.forElement.tagName) !== -1) {
115
115
  if (isMutableAriaAttribute(this.forElement)) {
116
- this.forElement.setAriaAttribute('aria-expanded', 'false');
116
+ if (this.interactive) {
117
+ this.forElement.setAriaAttribute('aria-expanded', 'false');
118
+ }
117
119
  }
118
120
  }
119
121
  }
@@ -178,7 +180,7 @@ export class Tooltip {
178
180
  (_a = this.tippyInstance) === null || _a === void 0 ? void 0 : _a.destroy();
179
181
  }
180
182
  render() {
181
- return (h(Host, { key: '06de58e5ee996c471588dd36a2556f9c13b9aaa3', role: "tooltip" }, h("slot", { key: 'f1b6df619dbf24fc37216252a92e39b54f5874cb', onSlotchange: _ => this.updateTippyContent() })));
183
+ return (h(Host, { key: 'c64153818029a55af719bc87fa5ce413d310e8b7', role: "tooltip" }, h("slot", { key: '2f24f867892089d93b41783977b470ab908063cd', onSlotchange: _ => this.updateTippyContent() })));
182
184
  }
183
185
  static get is() { return "wcs-tooltip"; }
184
186
  static get encapsulation() { return "shadow"; }
@@ -340,7 +342,7 @@ export class Tooltip {
340
342
  "optional": false,
341
343
  "docs": {
342
344
  "tags": [],
343
- "text": "Allows you to change the theme used by tippy.\n\nThe WCS theme is used by default and uses the WCS CSS variables.\n\nYou can create a theme by following this documentation and choosing a custom name :\nhttps://atomiks.github.io/tippyjs/v6/themes/"
345
+ "text": "Allows you to change the theme used by tippy.\n\nThe WCS theme 'dark' is used by default and uses the WCS CSS variables.\n\nYou can create a theme by following this documentation and choosing a custom name :\nhttps://atomiks.github.io/tippyjs/v6/themes/"
344
346
  },
345
347
  "attribute": "theme",
346
348
  "reflect": false,
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG7G,sGAAsG;AACtG,gEAAgE;AAChE,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,kFAAkF;AAClF,OAAO,KAA0B,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E;;;;;;;GAOG;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, ComponentInterface, h, Host, Prop, Element, Watch, Method, Listen } from '@stencil/core';\nimport { WcsTooltipAppendTo, WcsTooltipPosition } from './tooltip-interface';\n\n// We use the Tippy.js library for the tooltip. At first by using directly the styles of tippy because\n// the design system does not specify any spec for the tooltips.\n//\n// In a second time, if a need of customization is felt, it will be possible to use the lib in a\n// \"Headless\" mode where the rendering of the tooltip will be entirely in our charge, without\n// modifications in the API : https://atomiks.github.io/tippyjs/v6/headless-tippy/\nimport tippy, { Instance, Props } from 'tippy.js';\nimport { isEscapeKey } from \"../../utils/helpers\";\nimport { isMutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\n/**\n * List of components that require special ARIA attribute delegation handling.\n * These components have their own internal elements (like native button inside wcs-button)\n * that need to receive ARIA attributes for proper accessibility.\n * \n * Another solution we take into account is to @Watch the ARIA attributes on the component and set them on the internal element.\n * But this solution was not centralized and can be forgotten.\n */\nconst DELEGATED_ARIA_COMPONENTS = ['WCS-BUTTON'];\n\n/**\n * Tooltips are used to provide additional information for features available on the website. These can improve the user\n * experience or simply show additional information. Tooltips appear when the user rolls over or clicks on them\n * (for longer content).\n *\n * Note that this component is based on the Tippy.js library : https://atomiks.github.io/tippyjs/\n * \n * ## Accessibility guidelines 💡\n * \n * The component places necessary aria attribute on your target element (like the `wcs-button`) :\n * - `aria-expanded`: set to true when popover is open, false when it is closed\n * \n * The problem is that impaired users may not be able to see what is the information provided by the tooltip. To solve\n * this problem, the tooltip should be served with some aria attributes to make it accessible.\n *\n * Aria-features `wcs-tooltip` respect:\n * - dismiss when the user presses the `Escape` key\n * - has a `role=tooltip`\n * - `aria-expanded` on the targeted element: set to true when popover is open, false when it is closed\n *\n * Aria-features `wcs-tooltip` **does not respect with `wcs-button`**:\n * - aria-controls => we cannot do it yet, we need to wait for Cross root ARIA - export ID (https://github.com/WICG/aom/blob/gh-pages/exportid-explainer.md)\n * \n * But you have to provide the \"link\" between the element you want to describe and the tooltip. To do this, you have to\n * provide the \"visual description\" you add on the `wcs-tooltip` to the `aria-label` attribute or the `aria-description` as soon as the attribute will be available \n * of the element you want to describe .\n * \n * Example:\n * \n * ```html\n * <wcs-tooltip for=\"my-button\">Trashed items</wcs-tooltip>\n * <wcs-button id=\"my-button\" aria-label=\"Trashed items\">Trash</wcs-button>\n * ```\n * \n * @cssprop --wcs-tooltip-background-color - Background color of the tooltip\n * @cssprop --wcs-tooltip-text-color - Text color of the tooltip\n * @cssprop --wcs-tooltip-padding - Padding of the tooltip\n */\n@Component({\n tag: 'wcs-tooltip',\n shadow: true,\n // Tippy stylesheet and specific styles are imported in the global tooltip.scss file\n styleUrl: 'tooltip.scss'\n})\nexport class Tooltip implements ComponentInterface {\n /**\n * The **id** of the element the tooltip's going to describe.\n *\n * This property cannot be modified after initialization.\n *\n * @example\n * ```html\n * <span id=\"tooltiped\">Some content</span>\n * <wcs-tooltip for=\"tooltiped\">A tooltip!</wcs-tooltip>\n * ```\n */\n @Prop({mutable: false})\n for: string;\n\n /**\n * Where the tooltip is going to show relative to the element it's describing.\n */\n @Prop({reflect: true})\n position: WcsTooltipPosition = 'bottom';\n\n /**\n * Determines if the tooltip has interactive content inside of it, so that it can be hovered over and clicked inside\n * without hiding.\n */\n @Prop()\n interactive: boolean = false;\n\n /**\n * Specifies the maximum width of the tooltip. Useful to prevent it from being too horizontally wide to read.\n *\n * If the viewport's width is smaller than maxWidth, core CSS ensures the tippy remains smaller than the screen.\n * \n * To test it on WCS documentation page, add 'px' to the control value (string type in this case).\n */\n @Prop()\n maxWidth: string | number = 350;\n\n /**\n * Delay in ms once a trigger event is fired before the tooltip shows or hides.\n *\n * You can provide an array with two values to define a different duration for show and hide.\n *\n * `[showDelay, hideDelay]`\n *\n * Use null to use default value.\n */\n @Prop()\n delay: number | [number, number] = 0;\n\n /**\n * Duration in ms of the transition animation.\n */\n @Prop()\n duration: number | [number, number] = [300, 250];\n\n /**\n * Determines the events that cause the tooltip to show. Multiple event names are separated by spaces.\n *\n * See: https://atomiks.github.io/tippyjs/v6/all-props/#trigger\n */\n @Prop()\n trigger: string = 'mouseenter focus';\n\n /**\n * Allows you to change the theme used by tippy.\n *\n * The WCS theme is used by default and uses the WCS CSS variables.\n *\n * You can create a theme by following this documentation and choosing a custom name :\n * https://atomiks.github.io/tippyjs/v6/themes/\n */\n @Prop()\n theme: 'dark' | 'light' = 'dark';\n\n /**\n * You can use this property instead of the slot API to affect content in the tooltip.\n *\n * This makes it easier to manage the update if the tooltip contains elements that are not mutated when their\n * content changes. Indeed, if the slot is used, the tooltip is updated only if the structure of the slotted DOM\n * changes (the DOM must be mutated).\n *\n * The two APIs are not mutually exclusive, if both are filled in (the prop + the slot) the rendering will first\n * display the content of this property and then the slotted elements.\n */\n @Prop()\n content: string;\n\n /**\n * The element to append the tooltip to. Default behaviour is `() => document.body`. If interactive: true,\n * the default behavior is appendTo: \"parent\"\n *\n * See: https://atomiks.github.io/tippyjs/v6/all-props/#appendto\n */\n @Prop()\n appendTo: WcsTooltipAppendTo;\n\n @Element()\n private el: HTMLWcsTooltipElement;\n\n private tippyInstance: Instance<Props>;\n private forElement?: HTMLElement;\n\n componentWillLoad(): Promise<void> | void {\n this.forElement = document.getElementById(this.for);\n \n if(!this.forElement) {\n console.error('[wcs-tooltip]: The element with the id provided in the \"for\" property does not exist');\n return\n }\n \n this.tippyInstance = tippy(this.forElement, {\n appendTo: this.appendTo || (() => document.body),\n theme: this.theme,\n allowHTML: true,\n content: this.getTooltipContentFromPropAndSlot(),\n maxWidth: this.maxWidth,\n placement: this.position,\n delay: this.delay,\n duration: this.duration,\n interactive: this.interactive,\n trigger: this.trigger,\n onShow: () => this.onShow(),\n onHide: () => this.onHide()\n });\n }\n\n // region Tippy.js events\n \n // ARIA attributes management 🔍\n //\n // While tippy.js automatically handles aria-expanded on the target element, we manage it ourselves for two main reasons:\n // 1. Some of our components (like wcs-button) have an internal structure where the accessible/focusable element\n // is not the root element. We need to ensure the aria-expanded is set on the correct internal element.\n // 2. We want to maintain consistent control over our ARIA attributes across all components and ensure\n // they work with our custom MutableAriaAttribute interface.\n \n private onShow() {\n if (!this.forElement) {\n return;\n }\n\n if (this.forElement.tagName && DELEGATED_ARIA_COMPONENTS.indexOf(this.forElement.tagName) !== -1) {\n if(isMutableAriaAttribute(this.forElement)) {\n this.forElement.setAriaAttribute('aria-expanded', 'true');\n }\n }\n }\n \n private onHide() {\n if (!this.forElement) {\n return;\n }\n \n if (this.forElement.tagName && DELEGATED_ARIA_COMPONENTS.indexOf(this.forElement.tagName) !== -1) {\n if(isMutableAriaAttribute(this.forElement)) {\n this.forElement.setAriaAttribute('aria-expanded', 'false');\n }\n }\n }\n \n // endregion\n \n @Listen('keydown', { target: 'window' })\n async handleKeyDown(ev: KeyboardEvent) {\n if (isEscapeKey(ev)) {\n if(this.tippyInstance.state.isShown) {\n await this.hide();\n }\n }\n }\n\n private getTooltipContentFromPropAndSlot() {\n if (this.content) {\n return this.content + this.el.innerHTML;\n }\n return this.el.innerHTML;\n }\n\n @Watch('interactive')\n @Watch('position')\n @Watch('maxWidth')\n @Watch('theme')\n @Watch('delay')\n @Watch('duration')\n @Watch('trigger')\n // @ts-ignore\n private updateProps() {\n this.tippyInstance?.setProps({\n interactive: this.interactive,\n placement: this.position,\n maxWidth: this.maxWidth,\n theme: this.theme,\n delay: this.delay,\n duration: this.duration,\n trigger: this.trigger\n })\n }\n\n @Watch('content')\n private updateTippyContent() {\n this.tippyInstance?.setProps({\n content: this.getTooltipContentFromPropAndSlot()\n })\n }\n\n /**\n * Programmatically hide the tooltip\n */\n @Method()\n async hide() {\n this.tippyInstance.hide();\n }\n\n /**\n * Programmatically show the tooltip\n */\n @Method()\n async show() {\n this.tippyInstance.show();\n }\n\n /**\n * Temporarily prevent the tooltip from showing or hiding\n */\n @Method()\n async disable() {\n this.tippyInstance.disable();\n }\n\n /**\n * Re-enable a disabled tooltip\n */\n @Method()\n async enable() {\n this.tippyInstance.enable();\n }\n\n disconnectedCallback() {\n this.tippyInstance?.destroy();\n }\n\n render() {\n return (\n <Host role=\"tooltip\">\n <slot onSlotchange={_ => this.updateTippyContent()}/>\n </Host>\n );\n }\n\n\n}\n"]}
1
+ {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG7G,sGAAsG;AACtG,gEAAgE;AAChE,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,kFAAkF;AAClF,OAAO,KAA0B,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,yBAAyB,GAAI,CAAC,YAAY,CAAC,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAOH,MAAM,OAAO,OAAO;;;wBAmBe,QAAQ;2BAOhB,KAAK;wBAUA,GAAG;qBAYI,CAAC;wBAME,CAAC,GAAG,EAAE,GAAG,CAAC;uBAQ9B,kBAAkB;qBAWV,MAAM;;;;IA8BhC,iBAAiB;QACb,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEpD,IAAG,CAAC,IAAI,CAAC,UAAU,EAA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ComponentInterface, h, Host, Prop, Element, Watch, Method, Listen } from '@stencil/core';\nimport { WcsTooltipAppendTo, WcsTooltipPosition } from './tooltip-interface';\n\n// We use the Tippy.js library for the tooltip. At first by using directly the styles of tippy because\n// the design system does not specify any spec for the tooltips.\n//\n// In a second time, if a need of customization is felt, it will be possible to use the lib in a\n// \"Headless\" mode where the rendering of the tooltip will be entirely in our charge, without\n// modifications in the API : https://atomiks.github.io/tippyjs/v6/headless-tippy/\nimport tippy, { Instance, Props } from 'tippy.js';\nimport { isEscapeKey } from \"../../utils/helpers\";\nimport { isMutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\n/**\n * List of components that require special ARIA attribute delegation handling.\n * These components have their own internal elements (like native button inside wcs-button)\n * that need to receive ARIA attributes for proper accessibility.\n * \n * Another solution we take into account is to @Watch the ARIA attributes on the component and set them on the internal element.\n * But this solution was not centralized and can be forgotten.\n */\nconst DELEGATED_ARIA_COMPONENTS = ['WCS-BUTTON'];\n\n/**\n * Tooltips are used to provide additional information for features available on the website. These can improve the user\n * experience or simply show additional information. Tooltips appear when the user rolls over or clicks on them\n * (for longer content).\n *\n * Note that this component is based on the Tippy.js library : https://atomiks.github.io/tippyjs/\n * \n * ## Accessibility guidelines 💡\n * \n * The problem is that impaired users may not be able to see what is the information provided by the tooltip. To solve\n * this problem, the tooltip should be served with some aria attributes to make it accessible.\n *\n * Aria-features `wcs-tooltip` respect:\n * - dismiss when the user presses the `Escape` key\n * - has a `role=tooltip`\n * - when set to `interactive` mode\n * - `aria-expanded` on the targeted element: set to true when popover is open, false when it is closed\n *\n * Aria-features `wcs-tooltip` **does not respect with `wcs-button`**:\n * - aria-controls => we cannot do it yet, we need to wait for Cross root ARIA - export ID (https://github.com/WICG/aom/blob/gh-pages/exportid-explainer.md)\n * \n * But you have to provide the \"link\" between the element you want to describe and the tooltip. To do this, you have to\n * provide the \"visual description\" you add on the `wcs-tooltip` to the `aria-label` attribute or the `aria-description` as soon as the attribute will be available \n * of the element you want to describe .\n * \n * Example:\n * \n * ```html\n * <wcs-tooltip for=\"my-button\">Trashed items</wcs-tooltip>\n * <wcs-button id=\"my-button\" aria-label=\"Trashed items\">Trash</wcs-button>\n * ```\n * \n * @cssprop --wcs-tooltip-background-color - Background color of the tooltip\n * @cssprop --wcs-tooltip-text-color - Text color of the tooltip\n * @cssprop --wcs-tooltip-padding - Padding of the tooltip\n */\n@Component({\n tag: 'wcs-tooltip',\n shadow: true,\n // Tippy stylesheet and specific styles are imported in the global tooltip.scss file\n styleUrl: 'tooltip.scss'\n})\nexport class Tooltip implements ComponentInterface {\n /**\n * The **id** of the element the tooltip's going to describe.\n *\n * This property cannot be modified after initialization.\n *\n * @example\n * ```html\n * <span id=\"tooltiped\">Some content</span>\n * <wcs-tooltip for=\"tooltiped\">A tooltip!</wcs-tooltip>\n * ```\n */\n @Prop({mutable: false})\n for: string;\n\n /**\n * Where the tooltip is going to show relative to the element it's describing.\n */\n @Prop({reflect: true})\n position: WcsTooltipPosition = 'bottom';\n\n /**\n * Determines if the tooltip has interactive content inside of it, so that it can be hovered over and clicked inside\n * without hiding.\n */\n @Prop()\n interactive: boolean = false;\n\n /**\n * Specifies the maximum width of the tooltip. Useful to prevent it from being too horizontally wide to read.\n *\n * If the viewport's width is smaller than maxWidth, core CSS ensures the tippy remains smaller than the screen.\n * \n * To test it on WCS documentation page, add 'px' to the control value (string type in this case).\n */\n @Prop()\n maxWidth: string | number = 350;\n\n /**\n * Delay in ms once a trigger event is fired before the tooltip shows or hides.\n *\n * You can provide an array with two values to define a different duration for show and hide.\n *\n * `[showDelay, hideDelay]`\n *\n * Use null to use default value.\n */\n @Prop()\n delay: number | [number, number] = 0;\n\n /**\n * Duration in ms of the transition animation.\n */\n @Prop()\n duration: number | [number, number] = [300, 250];\n\n /**\n * Determines the events that cause the tooltip to show. Multiple event names are separated by spaces.\n *\n * See: https://atomiks.github.io/tippyjs/v6/all-props/#trigger\n */\n @Prop()\n trigger: string = 'mouseenter focus';\n\n /**\n * Allows you to change the theme used by tippy.\n *\n * The WCS theme 'dark' is used by default and uses the WCS CSS variables.\n *\n * You can create a theme by following this documentation and choosing a custom name :\n * https://atomiks.github.io/tippyjs/v6/themes/\n */\n @Prop()\n theme: 'dark' | 'light' = 'dark';\n\n /**\n * You can use this property instead of the slot API to affect content in the tooltip.\n *\n * This makes it easier to manage the update if the tooltip contains elements that are not mutated when their\n * content changes. Indeed, if the slot is used, the tooltip is updated only if the structure of the slotted DOM\n * changes (the DOM must be mutated).\n *\n * The two APIs are not mutually exclusive, if both are filled in (the prop + the slot) the rendering will first\n * display the content of this property and then the slotted elements.\n */\n @Prop()\n content: string;\n\n /**\n * The element to append the tooltip to. Default behaviour is `() => document.body`. If interactive: true,\n * the default behavior is appendTo: \"parent\"\n *\n * See: https://atomiks.github.io/tippyjs/v6/all-props/#appendto\n */\n @Prop()\n appendTo: WcsTooltipAppendTo;\n\n @Element()\n private el: HTMLWcsTooltipElement;\n\n private tippyInstance: Instance<Props>;\n private forElement?: HTMLElement;\n\n componentWillLoad(): Promise<void> | void {\n this.forElement = document.getElementById(this.for);\n \n if(!this.forElement) {\n console.error('[wcs-tooltip]: The element with the id provided in the \"for\" property does not exist');\n return\n }\n \n this.tippyInstance = tippy(this.forElement, {\n appendTo: this.appendTo || (() => document.body),\n theme: this.theme,\n allowHTML: true,\n content: this.getTooltipContentFromPropAndSlot(),\n maxWidth: this.maxWidth,\n placement: this.position,\n delay: this.delay,\n duration: this.duration,\n interactive: this.interactive,\n trigger: this.trigger,\n onShow: () => this.onShow(),\n onHide: () => this.onHide()\n });\n }\n\n // region Tippy.js events\n \n // ARIA attributes management 🔍\n //\n // While tippy.js automatically handles aria-expanded on the target element, we manage it ourselves for two main reasons:\n // 1. Some of our components (like wcs-button) have an internal structure where the accessible/focusable element\n // is not the root element. We need to ensure the aria-expanded is set on the correct internal element.\n // 2. We want to maintain consistent control over our ARIA attributes across all components and ensure\n // they work with our custom MutableAriaAttribute interface.\n \n private onShow() {\n if (!this.forElement) {\n return;\n }\n\n if (this.forElement.tagName && DELEGATED_ARIA_COMPONENTS.indexOf(this.forElement.tagName) !== -1) {\n if(isMutableAriaAttribute(this.forElement)) {\n if(this.interactive) {\n this.forElement.setAriaAttribute('aria-expanded', 'true');\n }\n }\n }\n }\n \n private onHide() {\n if (!this.forElement) {\n return;\n }\n\n if (this.forElement.tagName && DELEGATED_ARIA_COMPONENTS.indexOf(this.forElement.tagName) !== -1) {\n if(isMutableAriaAttribute(this.forElement)) {\n if(this.interactive) {\n this.forElement.setAriaAttribute('aria-expanded', 'false');\n }\n }\n }\n }\n \n // endregion\n \n @Listen('keydown', { target: 'window' })\n async handleKeyDown(ev: KeyboardEvent) {\n if (isEscapeKey(ev)) {\n if(this.tippyInstance.state.isShown) {\n await this.hide();\n }\n }\n }\n\n private getTooltipContentFromPropAndSlot() {\n if (this.content) {\n return this.content + this.el.innerHTML;\n }\n return this.el.innerHTML;\n }\n\n @Watch('interactive')\n @Watch('position')\n @Watch('maxWidth')\n @Watch('theme')\n @Watch('delay')\n @Watch('duration')\n @Watch('trigger')\n // @ts-ignore\n private updateProps() {\n this.tippyInstance?.setProps({\n interactive: this.interactive,\n placement: this.position,\n maxWidth: this.maxWidth,\n theme: this.theme,\n delay: this.delay,\n duration: this.duration,\n trigger: this.trigger\n })\n }\n\n @Watch('content')\n private updateTippyContent() {\n this.tippyInstance?.setProps({\n content: this.getTooltipContentFromPropAndSlot()\n })\n }\n\n /**\n * Programmatically hide the tooltip\n */\n @Method()\n async hide() {\n this.tippyInstance.hide();\n }\n\n /**\n * Programmatically show the tooltip\n */\n @Method()\n async show() {\n this.tippyInstance.show();\n }\n\n /**\n * Temporarily prevent the tooltip from showing or hiding\n */\n @Method()\n async disable() {\n this.tippyInstance.disable();\n }\n\n /**\n * Re-enable a disabled tooltip\n */\n @Method()\n async enable() {\n this.tippyInstance.enable();\n }\n\n disconnectedCallback() {\n this.tippyInstance?.destroy();\n }\n\n render() {\n return (\n <Host role=\"tooltip\">\n <slot onSlotchange={_ => this.updateTippyContent()}/>\n </Host>\n );\n }\n\n\n}\n"]}
@@ -0,0 +1,37 @@
1
+ export function isControlComponentWithLabel(el) {
2
+ if (typeof el !== 'object' || el === null || el === undefined)
3
+ return false;
4
+ return 'getLabel' in el;
5
+ }
6
+ /**
7
+
8
+ * Extracts the text content from nodes assigned to a slot in a Web Component's Shadow DOM.
9
+ *
10
+ * @param element - The Web Component HTMLElement containing a Shadow DOM with slots
11
+ * @param slotName - Optional name of the slot to target (if not provided, targets the default slot)
12
+ * @returns The combined text content of all nodes assigned to the specified slot, with normalized whitespace
13
+ *
14
+ * @throws Will not throw errors, but returns empty string if the element has no Shadow DOM,
15
+ * no matching slot, or no assigned nodes
16
+ */
17
+ export function getSlottedContentText(element, slotName) {
18
+ if (!element.shadowRoot) {
19
+ return '';
20
+ }
21
+ const slotSelector = typeof slotName === 'string' ? `slot[name="${slotName}"]` : 'slot:not([name])';
22
+ const slotElement = element.shadowRoot.querySelector(slotSelector);
23
+ if (!slotElement) {
24
+ return '';
25
+ }
26
+ const assignedNodes = slotElement.assignedNodes({ flatten: true });
27
+ if (!assignedNodes.length) {
28
+ return '';
29
+ }
30
+ return assignedNodes
31
+ .map(node => node.textContent || '')
32
+ .filter(text => text.trim() !== '') // we skip empty text nodes
33
+ .join(' ')
34
+ .replace(/\s+/g, ' ')
35
+ .trim();
36
+ }
37
+ //# sourceMappingURL=control-component-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-component-interface.js","sourceRoot":"","sources":["../../src/utils/control-component-interface.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,2BAA2B,CAAC,EAAO;IAC/C,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC5E,OAAO,UAAU,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAoB,EAAE,QAAiB;IACzE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,QAAQ,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAEpG,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IACnE,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAI,WAA+B,CAAC,aAAa,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IACtF,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,aAAa;SACf,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;SACnC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,2BAA2B;SAC9D,IAAI,CAAC,GAAG,CAAC;SACT,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AAChB,CAAC","sourcesContent":["/**\n * For form controls components which have a label within like a wcs-switch or wcs-checkbox\n */\nexport interface ControlComponentWithLabel {\n /**\n * Get the label text\n */\n getLabel(): Promise<string>;\n}\n\nexport function isControlComponentWithLabel(el: any): el is ControlComponentWithLabel {\n if (typeof el !== 'object' || el === null || el === undefined) return false;\n return 'getLabel' in el;\n}\n\n/**\n\n * Extracts the text content from nodes assigned to a slot in a Web Component's Shadow DOM.\n *\n * @param element - The Web Component HTMLElement containing a Shadow DOM with slots\n * @param slotName - Optional name of the slot to target (if not provided, targets the default slot)\n * @returns The combined text content of all nodes assigned to the specified slot, with normalized whitespace\n *\n * @throws Will not throw errors, but returns empty string if the element has no Shadow DOM,\n * no matching slot, or no assigned nodes\n */\nexport function getSlottedContentText(element: HTMLElement, slotName?: string): string {\n if (!element.shadowRoot) {\n return '';\n }\n\n const slotSelector = typeof slotName === 'string' ? `slot[name=\"${slotName}\"]` : 'slot:not([name])';\n\n const slotElement = element.shadowRoot.querySelector(slotSelector);\n if (!slotElement) {\n return '';\n }\n\n const assignedNodes = (slotElement as HTMLSlotElement).assignedNodes({flatten: true});\n if (!assignedNodes.length) {\n return '';\n }\n\n return assignedNodes\n .map(node => node.textContent || '')\n .filter(text => text.trim() !== '') // we skip empty text nodes\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n"]}
@@ -151,6 +151,20 @@ export const compareLists = (sourceList, newList, compareFn) => {
151
151
  const added = newList.filter(val => !sourceList.some(sourceVal => compareFn(val, sourceVal)));
152
152
  return { removed, kept, added };
153
153
  };
154
+ /**
155
+ * Normalizes whitespace by replacing multiple consecutive whitespace characters
156
+ * with a single space and removes leading and trailing whitespace.
157
+ *
158
+ * @param content - String potentially containing multiple whitespace characters to normalize, if the content is null or undefined, it will return an empty string.
159
+ * @returns Normalized string where sequences of whitespace are replaced by a single space.
160
+ *
161
+ * @example
162
+ * normalizeWhitespace(" Text with spaces ") // Returns "Text with spaces"
163
+ */
164
+ export function normalizeWhitespace(content) {
165
+ var _a, _b;
166
+ return (_b = (_a = content === null || content === void 0 ? void 0 : content.replace(/\s+/g, ' ')) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
167
+ }
154
168
  /**
155
169
  * Patched version of requestAnimationFrame that avoids ngzone
156
170
  * Use only when you know ngzone should not run
@@ -178,6 +192,12 @@ export const clickTargetIsElementOrChildren = (mouseEvent, element) => {
178
192
  export function generateUniqueId(componentName) {
179
193
  return componentName + "-" + Math.random().toString(36);
180
194
  }
195
+ /**
196
+ * `clientX` property doesn't exist on KeyboardEvent, we therefore deduce it's a MouseEvent.
197
+ */
198
+ export function isMouseEvent(event) {
199
+ return 'clientX' in event;
200
+ }
181
201
  export function isKeyup(evt) {
182
202
  return evt.code === 'ArrowUp';
183
203
  }
@@ -226,4 +246,24 @@ export function isCtrlA(evt) {
226
246
  export function getCssRootPropertyValue(name) {
227
247
  return window.getComputedStyle(document.body).getPropertyValue(name) || null;
228
248
  }
249
+ /**
250
+ * Converts a CSS time value string (e.g., '150ms', '1.5s') into milliseconds
251
+ * @param {string} timeValue - The CSS time value string
252
+ * @returns {number} Time in milliseconds
253
+ */
254
+ export function parseCssTimeValueToMilliseconds(timeValue) {
255
+ if (!timeValue)
256
+ return 0;
257
+ const TIME_REGEX = /^([\d.]+)(?:(ms|s))?$/;
258
+ const trimmedValue = timeValue.trim();
259
+ if (!/^\d/.test(trimmedValue))
260
+ return 0;
261
+ const match = TIME_REGEX.exec(trimmedValue);
262
+ if (!match)
263
+ return 0;
264
+ const value = Number(match[1]);
265
+ if (!Number.isFinite(value))
266
+ return 0;
267
+ return match[2] === 's' ? value * 1000 : value;
268
+ }
229
269
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,OAAY;IAClC,OAAO,aAAa,IAAI,OAAO;WACxB,cAAc,IAAI,OAAO,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAe;IACxC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,IAAI,CAAC,CAAE,EAAU,CAAC,YAAY,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAE,IAAY,EAAgB,EAAE;IAC7E,MAAM,QAAQ,GAAI,KAAa,CAAC,SAAS,IAAI,KAAK,CAAC;IACnD,OAAO;QACH,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IA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AI,CAAC,IAAI,IAAI,CAAC;AACjF,CAAC","sourcesContent":["import { EventEmitter } from '@stencil/core';\n\nexport function isElement(element: any): element is Element {\n return 'clientWidth' in element\n && 'clientHeight' in element;\n}\n\nexport function hasShadowDom(el: HTMLElement) {\n return !!el.shadowRoot && !!(el as any).attachShadow;\n}\n\nexport const debounceEvent = (event: EventEmitter, wait: number): EventEmitter => {\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait)\n } as EventEmitter;\n};\n\nexport const debounce = (func: (...args: any[]) => void, wait = 0) => {\n let timer: any;\n return (...args: any[]): any => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `wcs-input` should inherit\n * the `title` attribute that developers set directly on `wcs-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {\n const attributeObject: { [k: string]: any } = {};\n\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n}\n\n/**\n * List of available ARIA attributes + `role`.\n * Removed deprecated attributes.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes\n */\nconst ariaAttributes = [\n 'role',\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-braillelabel',\n 'aria-brailleroledescription',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colindextext',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-description',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowindextext',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n];\n\n/**\n * Returns an array of aria attributes that should be copied from\n * the shadow host element to a target within the light DOM.\n * @param el The element that the attributes should be copied from.\n * @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host.\n * Use this in instances where we manually specify aria attributes on the `<Host>` element.\n */\nexport const inheritAriaAttributes = (el: HTMLElement, ignoreList?: string[]) => {\n let attributesToInherit = ariaAttributes;\n if (ignoreList && ignoreList.length > 0) {\n attributesToInherit = attributesToInherit.filter((attr) => !ignoreList.includes(attr));\n }\n return inheritAttributes(el, attributesToInherit);\n};\n\n/**\n * Dynamically add or remove an attribute on the element.\n * If the value of the attribute is null or undefined, the attribute is removed.\n *\n * @param el - The HTMLElement\n * @param attr - The attribute to be added or removed\n * @param value - The value of the attribute\n */\nexport function setOrRemoveAttribute(el: HTMLElement, attr: string, value: string | null | undefined) {\n if (el) {\n if (value === undefined || value === null) {\n el.removeAttribute(attr);\n } else {\n el.setAttribute(attr, value);\n }\n }\n}\n\nexport const findItemLabel = (componentEl: HTMLElement): HTMLWcsLabelElement | null => {\n const itemEl = componentEl.closest('wcs-form-field');\n if (itemEl) {\n return itemEl.querySelector('wcs-label');\n }\n return null;\n};\n\n/**\n * Given two lists of items, this function will return the items that were removed, kept, and added compared to the source list.\n * @param sourceList - The source list of items\n * @param newList - The target list of items\n * @param compareFn - The function to compare the items\n */\nexport const compareLists: <T>(sourceList: T[], newList: T[], compareFn: (v1: T, v2: T) => boolean) => {\n removed: T[];\n kept: T[];\n added: T[]\n} = <T>(sourceList: T[], newList: T[], compareFn: (v1: T, v2: T) => boolean) => {\n const removed = sourceList.filter(val => !newList.some(newVal => compareFn(val, newVal)));\n const kept = sourceList.filter(val => newList.some(newVal => compareFn(val, newVal)));\n const added = newList.filter(val => !sourceList.some(sourceVal => compareFn(val, sourceVal)));\n\n return { removed, kept, added };\n};\n\n\ndeclare const __zone_symbol__requestAnimationFrame: any;\n\n/**\n * Patched version of requestAnimationFrame that avoids ngzone\n * Use only when you know ngzone should not run\n */\nexport const raf = (h: any) => {\n if (typeof __zone_symbol__requestAnimationFrame === 'function') {\n return __zone_symbol__requestAnimationFrame(h);\n }\n if (typeof requestAnimationFrame === 'function') {\n return requestAnimationFrame(h);\n }\n return setTimeout(h);\n};\n\n/**\n * Return true if the mouseEvent click is inside the given HTML element\n */\nexport const clickInsideElement = (event: MouseEvent, element: HTMLElement): boolean => {\n return event.x >= element.getBoundingClientRect().x && event.x <= element.getBoundingClientRect().x + element.getBoundingClientRect().width\n && event.y >= element.getBoundingClientRect().y && event.y <= element.getBoundingClientRect().y + element.getBoundingClientRect().height;\n}\n\n\nexport const clickTargetIsElementOrChildren = (mouseEvent: MouseEvent, element: HTMLElement) => {\n return mouseEvent.target instanceof Node\n && element.contains(mouseEvent.target);\n}\n\nexport function generateUniqueId(componentName: string): string {\n return componentName + \"-\" + Math.random().toString(36);\n}\n\nexport function isKeyup(evt: KeyboardEvent) {\n return evt.code === 'ArrowUp';\n}\n\nexport function isKeydown(evt: KeyboardEvent) {\n return evt.code === 'ArrowDown';\n}\n\nexport function isEscapeKey(evt: KeyboardEvent) {\n return evt.code === 'Escape';\n}\n\nexport function isSpaceKey(evt: KeyboardEvent) {\n return evt.code === 'Space';\n}\n\nexport function isEnterKey(evt: KeyboardEvent) {\n return evt.key === 'Enter';\n}\n\nexport function isHomeKey(evt: KeyboardEvent) {\n return evt.code === 'Home';\n}\n\nexport function isEndKey(evt: KeyboardEvent) {\n return evt.code === 'End';\n}\n\nexport function isUpArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowUp';\n}\n\nexport function isDownArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowDown';\n}\n\nexport function isLeftArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowLeft';\n}\n\nexport function isRightArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowRight';\n}\n\nexport function isPageDownKey(evt: KeyboardEvent) {\n return evt.key === 'PageDown';\n}\n\nexport function isPageUpKey(evt: KeyboardEvent) {\n return evt.key === 'PageUp';\n}\n\nexport function isTabKey(evt: KeyboardEvent) {\n return evt.key === 'Tab';\n}\n\nexport function isCtrlA(evt: KeyboardEvent) {\n return evt.key === 'a' && evt.ctrlKey;\n}\n\nexport function getCssRootPropertyValue(name: string): string | null {\n return window.getComputedStyle(document.body).getPropertyValue(name) || null;\n}\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,OAAY;IAClC,OAAO,aAAa,IAAI,OAAO;WACxB,cAAc,IAAI,OAAO,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAe;IACxC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,IAAI,CAAC,CAAE,EAAU,CAAC,YAAY,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAE,IAAY,EAAgB,EAAE;IAC7E,MAAM,QAAQ,GAAI,KAAa,CAAC,SAAS,IAAI,KAAK,CAAC;IACnD,OAAO;QACH,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;KACrC,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CA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C,GAAkB;IACtC,OAAO,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAChD,OAAO,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACjF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,SAAiB;IAC7D,IAAI,CAAC,SAAS;QAAE,OAAO,CAAC,CAAC;IAEzB,MAAM,UAAU,GAAG,uBAAuB,CAAC;IAE3C,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,CAAC,CAAC;IAExC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC;IAErB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAEtC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC","sourcesContent":["import { EventEmitter } from '@stencil/core';\n\nexport function isElement(element: any): element is Element {\n return 'clientWidth' in element\n && 'clientHeight' in element;\n}\n\nexport function hasShadowDom(el: HTMLElement) {\n return !!el.shadowRoot && !!(el as any).attachShadow;\n}\n\nexport const debounceEvent = (event: EventEmitter, wait: number): EventEmitter => {\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait)\n } as EventEmitter;\n};\n\nexport const debounce = (func: (...args: any[]) => void, wait = 0) => {\n let timer: any;\n return (...args: any[]): any => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `wcs-input` should inherit\n * the `title` attribute that developers set directly on `wcs-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {\n const attributeObject: { [k: string]: any } = {};\n\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n}\n\n/**\n * List of available ARIA attributes + `role`.\n * Removed deprecated attributes.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes\n */\nconst ariaAttributes = [\n 'role',\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-braillelabel',\n 'aria-brailleroledescription',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colindextext',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-description',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowindextext',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n];\n\n/**\n * Returns an array of aria attributes that should be copied from\n * the shadow host element to a target within the light DOM.\n * @param el The element that the attributes should be copied from.\n * @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host.\n * Use this in instances where we manually specify aria attributes on the `<Host>` element.\n */\nexport const inheritAriaAttributes = (el: HTMLElement, ignoreList?: string[]) => {\n let attributesToInherit = ariaAttributes;\n if (ignoreList && ignoreList.length > 0) {\n attributesToInherit = attributesToInherit.filter((attr) => !ignoreList.includes(attr));\n }\n return inheritAttributes(el, attributesToInherit);\n};\n\n/**\n * Dynamically add or remove an attribute on the element.\n * If the value of the attribute is null or undefined, the attribute is removed.\n *\n * @param el - The HTMLElement\n * @param attr - The attribute to be added or removed\n * @param value - The value of the attribute\n */\nexport function setOrRemoveAttribute(el: HTMLElement, attr: string, value: string | null | undefined) {\n if (el) {\n if (value === undefined || value === null) {\n el.removeAttribute(attr);\n } else {\n el.setAttribute(attr, value);\n }\n }\n}\n\nexport const findItemLabel = (componentEl: HTMLElement): HTMLWcsLabelElement | null => {\n const itemEl = componentEl.closest('wcs-form-field');\n if (itemEl) {\n return itemEl.querySelector('wcs-label');\n }\n return null;\n};\n\n/**\n * Given two lists of items, this function will return the items that were removed, kept, and added compared to the source list.\n * @param sourceList - The source list of items\n * @param newList - The target list of items\n * @param compareFn - The function to compare the items\n */\nexport const compareLists: <T>(sourceList: T[], newList: T[], compareFn: (v1: T, v2: T) => boolean) => {\n removed: T[];\n kept: T[];\n added: T[]\n} = <T>(sourceList: T[], newList: T[], compareFn: (v1: T, v2: T) => boolean) => {\n const removed = sourceList.filter(val => !newList.some(newVal => compareFn(val, newVal)));\n const kept = sourceList.filter(val => newList.some(newVal => compareFn(val, newVal)));\n const added = newList.filter(val => !sourceList.some(sourceVal => compareFn(val, sourceVal)));\n\n return { removed, kept, added };\n};\n\n/**\n * Normalizes whitespace by replacing multiple consecutive whitespace characters \n * with a single space and removes leading and trailing whitespace.\n * \n * @param content - String potentially containing multiple whitespace characters to normalize, if the content is null or undefined, it will return an empty string.\n * @returns Normalized string where sequences of whitespace are replaced by a single space.\n * \n * @example\n * normalizeWhitespace(\" Text with spaces \") // Returns \"Text with spaces\"\n */\nexport function normalizeWhitespace(content: string): string {\n return content?.replace(/\\s+/g, ' ')?.trim() ?? '';\n}\n\ndeclare const __zone_symbol__requestAnimationFrame: any;\n\n/**\n * Patched version of requestAnimationFrame that avoids ngzone\n * Use only when you know ngzone should not run\n */\nexport const raf = (h: any) => {\n if (typeof __zone_symbol__requestAnimationFrame === 'function') {\n return __zone_symbol__requestAnimationFrame(h);\n }\n if (typeof requestAnimationFrame === 'function') {\n return requestAnimationFrame(h);\n }\n return setTimeout(h);\n};\n\n/**\n * Return true if the mouseEvent click is inside the given HTML element\n */\nexport const clickInsideElement = (event: MouseEvent, element: HTMLElement): boolean => {\n return event.x >= element.getBoundingClientRect().x && event.x <= element.getBoundingClientRect().x + element.getBoundingClientRect().width\n && event.y >= element.getBoundingClientRect().y && event.y <= element.getBoundingClientRect().y + element.getBoundingClientRect().height;\n}\n\nexport const clickTargetIsElementOrChildren = (mouseEvent: MouseEvent, element: HTMLElement) => {\n return mouseEvent.target instanceof Node\n && element.contains(mouseEvent.target);\n}\n\nexport function generateUniqueId(componentName: string): string {\n return componentName + \"-\" + Math.random().toString(36);\n}\n\n/**\n * `clientX` property doesn't exist on KeyboardEvent, we therefore deduce it's a MouseEvent.\n */\nexport function isMouseEvent(event: MouseEvent | KeyboardEvent): event is MouseEvent {\n return 'clientX' in event;\n}\n\nexport function isKeyup(evt: KeyboardEvent) {\n return evt.code === 'ArrowUp';\n}\n\nexport function isKeydown(evt: KeyboardEvent) {\n return evt.code === 'ArrowDown';\n}\n\nexport function isEscapeKey(evt: KeyboardEvent) {\n return evt.code === 'Escape';\n}\n\nexport function isSpaceKey(evt: KeyboardEvent) {\n return evt.code === 'Space';\n}\n\nexport function isEnterKey(evt: KeyboardEvent) {\n return evt.key === 'Enter';\n}\n\nexport function isHomeKey(evt: KeyboardEvent) {\n return evt.code === 'Home';\n}\n\nexport function isEndKey(evt: KeyboardEvent) {\n return evt.code === 'End';\n}\n\nexport function isUpArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowUp';\n}\n\nexport function isDownArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowDown';\n}\n\nexport function isLeftArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowLeft';\n}\n\nexport function isRightArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowRight';\n}\n\nexport function isPageDownKey(evt: KeyboardEvent) {\n return evt.key === 'PageDown';\n}\n\nexport function isPageUpKey(evt: KeyboardEvent) {\n return evt.key === 'PageUp';\n}\n\nexport function isTabKey(evt: KeyboardEvent) {\n return evt.key === 'Tab';\n}\n\nexport function isCtrlA(evt: KeyboardEvent) {\n return evt.key === 'a' && evt.ctrlKey;\n}\n\nexport function getCssRootPropertyValue(name: string): string | null {\n return window.getComputedStyle(document.body).getPropertyValue(name) || null;\n}\n\n/**\n * Converts a CSS time value string (e.g., '150ms', '1.5s') into milliseconds\n * @param {string} timeValue - The CSS time value string\n * @returns {number} Time in milliseconds\n */\nexport function parseCssTimeValueToMilliseconds(timeValue: string): number {\n if (!timeValue) return 0;\n\n const TIME_REGEX = /^([\\d.]+)(?:(ms|s))?$/;\n\n const trimmedValue = timeValue.trim();\n if (!/^\\d/.test(trimmedValue)) return 0;\n\n const match = TIME_REGEX.exec(trimmedValue);\n if (!match) return 0;\n\n const value = Number(match[1]);\n if (!Number.isFinite(value)) return 0;\n\n return match[2] === 's' ? value * 1000 : value;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { g as getCssRootPropertyValue } from './helpers-f137ec8d.js';
1
+ import { g as getCssRootPropertyValue } from './helpers-ece6a2d3.js';
2
2
 
3
3
  /**
4
4
  * This function add event handlers on the navigableItems list. The handlers call the function close() on the nodeName.
@@ -48,4 +48,4 @@ function comNavDidLoadWithResizeObserver(comNavElement) {
48
48
 
49
49
  export { comNavDidLoadWithResizeObserver as c, registerCloseHandlerForFocusOutEventOn as r };
50
50
 
51
- //# sourceMappingURL=com-nav-utils-1366c701.js.map
51
+ //# sourceMappingURL=com-nav-utils-ee7bf77c.js.map
@@ -1 +1 @@
1
- {"file":"com-nav-utils-1366c701.js","mappings":";;AAKA;;;;;;;;SAQgB,sCAAsC,CAA+B,cAAmC,EAAE,eAAuB;IAC7I,cAAc,CAAC,OAAO,CAAC,aAAa;QAChC,aAAa,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,GAAe;YACvD,MAAM,oBAAoB,GAAG,GAAG,CAAC,aAA4B,CAAC;YAC9D,IAAI,CAAC,6BAA6B,CAAC,aAAa,EAAE,oBAAoB,CAAC,EAAE;gBACrE,MAAM,iBAAiB,GAAI,GAAa,CAAC,YAAY,EAAE,CAAC;gBACxD,IAAI,uCAAuC,CAAC,iBAAiB,EAAE,eAAe,CAAC,EAAE;oBAC5E,iBAAiB,CAAC,MAAM,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAkB,CAAC,KAAK,EAAE,CAAC;iBACrG;aACJ;SACJ,CAAC,CAAA;KACL,CAAC,CAAC;AACP,CAAC;AAED,SAAS,6BAA6B,CAAC,aAAsB,EAAE,OAAgB;IAC3E,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,yBAAyB,CAAC,QAAgB;IAC/C,OAAO,CAAC,IAAK,CAAiB,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACzD,CAAC;AAED,SAAS,uCAAuC,CAAC,iBAAgC,EAAE,QAAgB;IAC/F,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAK,CAAiB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC;SAEe,+BAA+B,CAAC,aAAsD;IAClG,MAAM,eAAe,GAAG,uBAAuB,CAAC,kCAAkC,CAAC,IAAI,OAAO,CAAC;IAC/F,MAAM,oBAAoB,GAAG,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAE3D,OAAO,IAAI,cAAc,CAAC,KAAK;QAC3B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAChC,MAAM,YAAY,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;QACzC,MAAM,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC;QAC5B,IAAI,EAAE,CAAC,KAAK,IAAI,oBAAoB,IAAI,WAAW,GAAG,YAAY,CAAC,EAAE;YACjE,aAAa,CAAC,mBAAmB,GAAG,QAAQ,CAAC;SAChD;aAAM;YACH,aAAa,CAAC,mBAAmB,GAAG,SAAS,CAAC;SACjD;KACJ,CAAC,CAAC;AACP;;;;","names":[],"sources":["src/components/com-nav/com-nav-utils.ts"],"sourcesContent":["import { getCssRootPropertyValue } from \"../../utils/helpers\";\nimport { ComNav } from \"./com-nav\";\nimport { ComNavSubmenu } from \"../com-nav-submenu/com-nav-submenu\";\nimport { ComNavCategory } from \"../com-nav-category/com-nav-category\";\n\n/**\n * This function add event handlers on the navigableItems list. The handlers call the function close() on the nodeName.\n *\n * T: type class of the nodeNameToClose param (must have a close function)\n *\n * @param navigableItems items on which focusout event listeners must be added\n * @param nodeNameToClose nodeName of the element we want to close in the event path\n */\nexport function registerCloseHandlerForFocusOutEventOn<T extends {close: () => any}>(navigableItems: NodeListOf<Element>, nodeNameToClose: string): void {\n navigableItems.forEach(navigableItem => {\n navigableItem.addEventListener(\"focusout\", (evt: FocusEvent) => {\n const relatedTargetElement = evt.relatedTarget as HTMLElement;\n if (!isElementChildOfNavigableItem(navigableItem, relatedTargetElement)) {\n const eventComposedPath = (evt as Event).composedPath();\n if (isEventThrownFromChildOfNodeNameToClose(eventComposedPath, nodeNameToClose)) {\n (eventComposedPath.filter(eventTargetNodeNameEquals(nodeNameToClose))[0] as unknown as T).close();\n }\n }\n })\n });\n}\n\nfunction isElementChildOfNavigableItem(navigableItem: Element, element: Element) {\n return navigableItem.contains(element);\n}\n\nfunction eventTargetNodeNameEquals(nodeName: string) {\n return x => (x as HTMLElement).nodeName === nodeName;\n}\n\nfunction isEventThrownFromChildOfNodeNameToClose(eventComposedPath: EventTarget[], nodeName: string) {\n return eventComposedPath.map(x => (x as HTMLElement).nodeName).indexOf(nodeName) !== -1;\n}\n\nexport function comNavDidLoadWithResizeObserver(comNavElement: ComNav | ComNavSubmenu | ComNavCategory): ResizeObserver {\n const smallBreakpoint = getCssRootPropertyValue('--wcs-phone-breakpoint-max-width') || '575px';\n const smallBreakpointValue = parseInt(smallBreakpoint, 10);\n\n return new ResizeObserver(entry => {\n const cr = entry[0].contentRect;\n const paddingRight = cr.right - cr.width;\n const paddingLeft = cr.left;\n if (cr.width <= smallBreakpointValue - (paddingLeft + paddingRight)) {\n comNavElement.currentActiveSizing = 'mobile';\n } else {\n comNavElement.currentActiveSizing = 'desktop';\n }\n });\n}\n"],"version":3}
1
+ {"file":"com-nav-utils-ee7bf77c.js","mappings":";;AAKA;;;;;;;;SAQgB,sCAAsC,CAA+B,cAAmC,EAAE,eAAuB;IAC7I,cAAc,CAAC,OAAO,CAAC,aAAa;QAChC,aAAa,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,GAAe;YACvD,MAAM,oBAAoB,GAAG,GAAG,CAAC,aAA4B,CAAC;YAC9D,IAAI,CAAC,6BAA6B,CAAC,aAAa,EAAE,oBAAoB,CAAC,EAAE;gBACrE,MAAM,iBAAiB,GAAI,GAAa,CAAC,YAAY,EAAE,CAAC;gBACxD,IAAI,uCAAuC,CAAC,iBAAiB,EAAE,eAAe,CAAC,EAAE;oBAC5E,iBAAiB,CAAC,MAAM,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAkB,CAAC,KAAK,EAAE,CAAC;iBACrG;aACJ;SACJ,CAAC,CAAA;KACL,CAAC,CAAC;AACP,CAAC;AAED,SAAS,6BAA6B,CAAC,aAAsB,EAAE,OAAgB;IAC3E,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,yBAAyB,CAAC,QAAgB;IAC/C,OAAO,CAAC,IAAK,CAAiB,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACzD,CAAC;AAED,SAAS,uCAAuC,CAAC,iBAAgC,EAAE,QAAgB;IAC/F,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAK,CAAiB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC;SAEe,+BAA+B,CAAC,aAAsD;IAClG,MAAM,eAAe,GAAG,uBAAuB,CAAC,kCAAkC,CAAC,IAAI,OAAO,CAAC;IAC/F,MAAM,oBAAoB,GAAG,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAE3D,OAAO,IAAI,cAAc,CAAC,KAAK;QAC3B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAChC,MAAM,YAAY,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;QACzC,MAAM,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC;QAC5B,IAAI,EAAE,CAAC,KAAK,IAAI,oBAAoB,IAAI,WAAW,GAAG,YAAY,CAAC,EAAE;YACjE,aAAa,CAAC,mBAAmB,GAAG,QAAQ,CAAC;SAChD;aAAM;YACH,aAAa,CAAC,mBAAmB,GAAG,SAAS,CAAC;SACjD;KACJ,CAAC,CAAC;AACP;;;;","names":[],"sources":["src/components/com-nav/com-nav-utils.ts"],"sourcesContent":["import { getCssRootPropertyValue } from \"../../utils/helpers\";\nimport { ComNav } from \"./com-nav\";\nimport { ComNavSubmenu } from \"../com-nav-submenu/com-nav-submenu\";\nimport { ComNavCategory } from \"../com-nav-category/com-nav-category\";\n\n/**\n * This function add event handlers on the navigableItems list. The handlers call the function close() on the nodeName.\n *\n * T: type class of the nodeNameToClose param (must have a close function)\n *\n * @param navigableItems items on which focusout event listeners must be added\n * @param nodeNameToClose nodeName of the element we want to close in the event path\n */\nexport function registerCloseHandlerForFocusOutEventOn<T extends {close: () => any}>(navigableItems: NodeListOf<Element>, nodeNameToClose: string): void {\n navigableItems.forEach(navigableItem => {\n navigableItem.addEventListener(\"focusout\", (evt: FocusEvent) => {\n const relatedTargetElement = evt.relatedTarget as HTMLElement;\n if (!isElementChildOfNavigableItem(navigableItem, relatedTargetElement)) {\n const eventComposedPath = (evt as Event).composedPath();\n if (isEventThrownFromChildOfNodeNameToClose(eventComposedPath, nodeNameToClose)) {\n (eventComposedPath.filter(eventTargetNodeNameEquals(nodeNameToClose))[0] as unknown as T).close();\n }\n }\n })\n });\n}\n\nfunction isElementChildOfNavigableItem(navigableItem: Element, element: Element) {\n return navigableItem.contains(element);\n}\n\nfunction eventTargetNodeNameEquals(nodeName: string) {\n return x => (x as HTMLElement).nodeName === nodeName;\n}\n\nfunction isEventThrownFromChildOfNodeNameToClose(eventComposedPath: EventTarget[], nodeName: string) {\n return eventComposedPath.map(x => (x as HTMLElement).nodeName).indexOf(nodeName) !== -1;\n}\n\nexport function comNavDidLoadWithResizeObserver(comNavElement: ComNav | ComNavSubmenu | ComNavCategory): ResizeObserver {\n const smallBreakpoint = getCssRootPropertyValue('--wcs-phone-breakpoint-max-width') || '575px';\n const smallBreakpointValue = parseInt(smallBreakpoint, 10);\n\n return new ResizeObserver(entry => {\n const cr = entry[0].contentRect;\n const paddingRight = cr.right - cr.width;\n const paddingLeft = cr.left;\n if (cr.width <= smallBreakpointValue - (paddingLeft + paddingRight)) {\n comNavElement.currentActiveSizing = 'mobile';\n } else {\n comNavElement.currentActiveSizing = 'desktop';\n }\n });\n}\n"],"version":3}
@@ -0,0 +1,40 @@
1
+ function isControlComponentWithLabel(el) {
2
+ if (typeof el !== 'object' || el === null || el === undefined)
3
+ return false;
4
+ return 'getLabel' in el;
5
+ }
6
+ /**
7
+
8
+ * Extracts the text content from nodes assigned to a slot in a Web Component's Shadow DOM.
9
+ *
10
+ * @param element - The Web Component HTMLElement containing a Shadow DOM with slots
11
+ * @param slotName - Optional name of the slot to target (if not provided, targets the default slot)
12
+ * @returns The combined text content of all nodes assigned to the specified slot, with normalized whitespace
13
+ *
14
+ * @throws Will not throw errors, but returns empty string if the element has no Shadow DOM,
15
+ * no matching slot, or no assigned nodes
16
+ */
17
+ function getSlottedContentText(element, slotName) {
18
+ if (!element.shadowRoot) {
19
+ return '';
20
+ }
21
+ const slotSelector = typeof slotName === 'string' ? `slot[name="${slotName}"]` : 'slot:not([name])';
22
+ const slotElement = element.shadowRoot.querySelector(slotSelector);
23
+ if (!slotElement) {
24
+ return '';
25
+ }
26
+ const assignedNodes = slotElement.assignedNodes({ flatten: true });
27
+ if (!assignedNodes.length) {
28
+ return '';
29
+ }
30
+ return assignedNodes
31
+ .map(node => node.textContent || '')
32
+ .filter(text => text.trim() !== '') // we skip empty text nodes
33
+ .join(' ')
34
+ .replace(/\s+/g, ' ')
35
+ .trim();
36
+ }
37
+
38
+ export { getSlottedContentText as g, isControlComponentWithLabel as i };
39
+
40
+ //# sourceMappingURL=control-component-interface-9f09e520.js.map