wcs-core 7.0.0 → 7.2.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 (664) hide show
  1. package/README.md +1 -11
  2. package/design-tokens/dist/sncf-groupe-root-scoped.css +590 -0
  3. package/design-tokens/dist/sncf-groupe.css +590 -0
  4. package/design-tokens/dist/sncf-groupe.json +10693 -0
  5. package/design-tokens/dist/sncf-holding-root-scoped.css +590 -0
  6. package/design-tokens/dist/sncf-holding.css +437 -423
  7. package/design-tokens/dist/sncf-holding.json +80 -3
  8. package/design-tokens/dist/sncf-reseau-root-scoped.css +652 -0
  9. package/design-tokens/dist/sncf-reseau.css +473 -463
  10. package/design-tokens/dist/sncf-reseau.json +54 -0
  11. package/design-tokens/dist/sncf-voyageurs-root-scoped.css +550 -0
  12. package/design-tokens/dist/sncf-voyageurs.css +394 -381
  13. package/design-tokens/dist/sncf-voyageurs.json +54 -0
  14. package/dist/cjs/{com-nav-utils-9f6c99b8.js → com-nav-utils-ff4f0bef.js} +2 -2
  15. package/dist/cjs/{com-nav-utils-9f6c99b8.js.map → com-nav-utils-ff4f0bef.js.map} +1 -1
  16. package/dist/cjs/control-component-interface-d9b68f28.js +43 -0
  17. package/dist/cjs/control-component-interface-d9b68f28.js.map +1 -0
  18. package/dist/cjs/{grid-pagination-2c752b22.js → grid-pagination-4505d7b6.js} +26 -6
  19. package/dist/cjs/grid-pagination-4505d7b6.js.map +1 -0
  20. package/dist/cjs/{helpers-871f5a3d.js → helpers-2f1a8ddc.js} +44 -1
  21. package/dist/cjs/helpers-2f1a8ddc.js.map +1 -0
  22. package/dist/cjs/{keyboard-event-d2c81ce0.js → keyboard-event-40ecdc27.js} +2 -2
  23. package/dist/cjs/{keyboard-event-d2c81ce0.js.map → keyboard-event-40ecdc27.js.map} +1 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/wcs-accordion-panel.cjs.entry.js +2 -2
  26. package/dist/cjs/wcs-accordion-panel.cjs.entry.js.map +1 -1
  27. package/dist/cjs/wcs-action-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/wcs-action-bar.cjs.entry.js.map +1 -1
  29. package/dist/cjs/wcs-alert-drawer.cjs.entry.js +99 -0
  30. package/dist/cjs/wcs-alert-drawer.cjs.entry.js.map +1 -0
  31. package/dist/cjs/wcs-alert.cjs.entry.js +121 -0
  32. package/dist/cjs/wcs-alert.cjs.entry.js.map +1 -0
  33. package/dist/cjs/wcs-app.cjs.entry.js +3 -3
  34. package/dist/cjs/wcs-badge.cjs.entry.js +2 -2
  35. package/dist/cjs/wcs-badge.cjs.entry.js.map +1 -1
  36. package/dist/cjs/wcs-breadcrumb-item.cjs.entry.js +1 -1
  37. package/dist/cjs/wcs-breadcrumb-item.cjs.entry.js.map +1 -1
  38. package/dist/cjs/wcs-breadcrumb.cjs.entry.js +2 -2
  39. package/dist/cjs/wcs-button_2.cjs.entry.js +4 -9
  40. package/dist/cjs/wcs-button_2.cjs.entry.js.map +1 -1
  41. package/dist/cjs/wcs-card-body.cjs.entry.js +9 -2
  42. package/dist/cjs/wcs-card-body.cjs.entry.js.map +1 -1
  43. package/dist/cjs/wcs-card-content.cjs.entry.js +22 -0
  44. package/dist/cjs/wcs-card-content.cjs.entry.js.map +1 -0
  45. package/dist/cjs/wcs-card-footer.cjs.entry.js +22 -0
  46. package/dist/cjs/wcs-card-footer.cjs.entry.js.map +1 -0
  47. package/dist/cjs/wcs-card-header.cjs.entry.js +22 -0
  48. package/dist/cjs/wcs-card-header.cjs.entry.js.map +1 -0
  49. package/dist/cjs/wcs-card-media.cjs.entry.js +29 -0
  50. package/dist/cjs/wcs-card-media.cjs.entry.js.map +1 -0
  51. package/dist/cjs/wcs-card.cjs.entry.js +30 -2
  52. package/dist/cjs/wcs-card.cjs.entry.js.map +1 -1
  53. package/dist/cjs/wcs-checkbox.cjs.entry.js +6 -2
  54. package/dist/cjs/wcs-checkbox.cjs.entry.js.map +1 -1
  55. package/dist/cjs/wcs-com-nav-category.cjs.entry.js +4 -4
  56. package/dist/cjs/wcs-com-nav-item.cjs.entry.js +2 -2
  57. package/dist/cjs/wcs-com-nav-item.cjs.entry.js.map +1 -1
  58. package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +4 -4
  59. package/dist/cjs/wcs-com-nav.cjs.entry.js +4 -4
  60. package/dist/cjs/wcs-counter.cjs.entry.js +13 -15
  61. package/dist/cjs/wcs-counter.cjs.entry.js.map +1 -1
  62. package/dist/cjs/wcs-divider.cjs.entry.js +1 -1
  63. package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +1 -1
  64. package/dist/cjs/wcs-dropdown-header.cjs.entry.js +1 -1
  65. package/dist/cjs/wcs-dropdown-item.cjs.entry.js +2 -2
  66. package/dist/cjs/wcs-dropdown.cjs.entry.js +3 -8
  67. package/dist/cjs/wcs-dropdown.cjs.entry.js.map +1 -1
  68. package/dist/cjs/wcs-editable-field.cjs.entry.js +81 -55
  69. package/dist/cjs/wcs-editable-field.cjs.entry.js.map +1 -1
  70. package/dist/cjs/wcs-error_3.cjs.entry.js +209 -0
  71. package/dist/cjs/wcs-error_3.cjs.entry.js.map +1 -0
  72. package/dist/cjs/wcs-field-content.cjs.entry.js +1 -1
  73. package/dist/cjs/wcs-field-label.cjs.entry.js +1 -1
  74. package/dist/cjs/wcs-field.cjs.entry.js +1 -1
  75. package/dist/cjs/wcs-footer.cjs.entry.js +1 -1
  76. package/dist/cjs/wcs-footer.cjs.entry.js.map +1 -1
  77. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +4 -4
  78. package/dist/cjs/wcs-galactic-menu.cjs.entry.js.map +1 -1
  79. package/dist/cjs/wcs-galactic.cjs.entry.js +1 -1
  80. package/dist/cjs/wcs-grid-column.cjs.entry.js +2 -2
  81. package/dist/cjs/wcs-grid-column.cjs.entry.js.map +1 -1
  82. package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +1 -1
  83. package/dist/cjs/wcs-grid-pagination.cjs.entry.js +2 -2
  84. package/dist/cjs/wcs-grid.cjs.entry.js +14 -6
  85. package/dist/cjs/wcs-grid.cjs.entry.js.map +1 -1
  86. package/dist/cjs/wcs-header.cjs.entry.js +3 -3
  87. package/dist/cjs/wcs-header.cjs.entry.js.map +1 -1
  88. package/dist/cjs/wcs-hint.cjs.entry.js +1 -1
  89. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +1 -1
  90. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js.map +1 -1
  91. package/dist/cjs/wcs-icon.cjs.entry.js +2 -2
  92. package/dist/cjs/wcs-input.cjs.entry.js +5 -13
  93. package/dist/cjs/wcs-input.cjs.entry.js.map +1 -1
  94. package/dist/cjs/wcs-list-item-properties.cjs.entry.js +1 -1
  95. package/dist/cjs/wcs-list-item-property.cjs.entry.js +1 -1
  96. package/dist/cjs/wcs-list-item.cjs.entry.js +1 -1
  97. package/dist/cjs/wcs-list-item.cjs.entry.js.map +1 -1
  98. package/dist/cjs/wcs-mat-icon.cjs.entry.js +2 -2
  99. package/dist/cjs/wcs-mat-icon.cjs.entry.js.map +1 -1
  100. package/dist/cjs/wcs-modal.cjs.entry.js +18 -4
  101. package/dist/cjs/wcs-modal.cjs.entry.js.map +1 -1
  102. package/dist/cjs/wcs-native-select.cjs.entry.js +2 -2
  103. package/dist/cjs/wcs-native-select.cjs.entry.js.map +1 -1
  104. package/dist/cjs/wcs-nav-item.cjs.entry.js +3 -3
  105. package/dist/cjs/wcs-nav-item.cjs.entry.js.map +1 -1
  106. package/dist/cjs/wcs-nav.cjs.entry.js +3 -3
  107. package/dist/cjs/wcs-nav.cjs.entry.js.map +1 -1
  108. package/dist/cjs/wcs-progress-bar.cjs.entry.js +4 -4
  109. package/dist/cjs/wcs-progress-bar.cjs.entry.js.map +1 -1
  110. package/dist/cjs/wcs-progress-radial.cjs.entry.js +3 -3
  111. package/dist/cjs/wcs-progress-radial.cjs.entry.js.map +1 -1
  112. package/dist/cjs/wcs-radio-group.cjs.entry.js +5 -2
  113. package/dist/cjs/wcs-radio-group.cjs.entry.js.map +1 -1
  114. package/dist/cjs/wcs-radio.cjs.entry.js +2 -2
  115. package/dist/cjs/wcs-radio.cjs.entry.js.map +1 -1
  116. package/dist/cjs/wcs-select_2.cjs.entry.js +21 -13
  117. package/dist/cjs/wcs-select_2.cjs.entry.js.map +1 -1
  118. package/dist/cjs/wcs-skeleton-circle.cjs.entry.js +1 -1
  119. package/dist/cjs/wcs-skeleton-rectangle.cjs.entry.js +1 -1
  120. package/dist/cjs/wcs-skeleton-text.cjs.entry.js +1 -1
  121. package/dist/cjs/wcs-switch.cjs.entry.js +6 -2
  122. package/dist/cjs/wcs-switch.cjs.entry.js.map +1 -1
  123. package/dist/cjs/wcs-tab.cjs.entry.js +1 -1
  124. package/dist/cjs/wcs-tabs.cjs.entry.js +150 -7
  125. package/dist/cjs/wcs-tabs.cjs.entry.js.map +1 -1
  126. package/dist/cjs/wcs-textarea.cjs.entry.js +2 -2
  127. package/dist/cjs/wcs-textarea.cjs.entry.js.map +1 -1
  128. package/dist/cjs/wcs-tooltip.cjs.entry.js +8 -4
  129. package/dist/cjs/wcs-tooltip.cjs.entry.js.map +1 -1
  130. package/dist/cjs/wcs.cjs.js +1 -1
  131. package/dist/collection/collection-manifest.json +6 -0
  132. package/dist/collection/components/accordion-panel/accordion-panel.js +1 -1
  133. package/dist/collection/components/accordion-panel/accordion-panel.js.map +1 -1
  134. package/dist/collection/components/action-bar/action-bar.js +2 -2
  135. package/dist/collection/components/action-bar/action-bar.js.map +1 -1
  136. package/dist/collection/components/alert/alert-interface.js +2 -0
  137. package/dist/collection/components/alert/alert-interface.js.map +1 -0
  138. package/dist/collection/components/alert/alert.css +115 -0
  139. package/dist/collection/components/alert/alert.e2e.js +142 -0
  140. package/dist/collection/components/alert/alert.e2e.js.map +1 -0
  141. package/dist/collection/components/alert/alert.js +257 -0
  142. package/dist/collection/components/alert/alert.js.map +1 -0
  143. package/dist/collection/components/alert-drawer/alert-drawer-interface.js +2 -0
  144. package/dist/collection/components/alert-drawer/alert-drawer-interface.js.map +1 -0
  145. package/dist/collection/components/alert-drawer/alert-drawer.css +103 -0
  146. package/dist/collection/components/alert-drawer/alert-drawer.e2e.js +111 -0
  147. package/dist/collection/components/alert-drawer/alert-drawer.e2e.js.map +1 -0
  148. package/dist/collection/components/alert-drawer/alert-drawer.js +237 -0
  149. package/dist/collection/components/alert-drawer/alert-drawer.js.map +1 -0
  150. package/dist/collection/components/app/app.js +3 -3
  151. package/dist/collection/components/badge/badge.css +5 -1
  152. package/dist/collection/components/badge/badge.js +1 -1
  153. package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
  154. package/dist/collection/components/breadcrumb-item/breadcrumb-item.js +1 -1
  155. package/dist/collection/components/breadcrumb-item/breadcrumb-item.js.map +1 -1
  156. package/dist/collection/components/button/button-interface.js +1 -5
  157. package/dist/collection/components/button/button-interface.js.map +1 -1
  158. package/dist/collection/components/button/button.css +2 -2
  159. package/dist/collection/components/button/button.js +2 -7
  160. package/dist/collection/components/button/button.js.map +1 -1
  161. package/dist/collection/components/card/card-interface.js.map +1 -1
  162. package/dist/collection/components/card/card.css +10 -0
  163. package/dist/collection/components/card/card.js +62 -1
  164. package/dist/collection/components/card/card.js.map +1 -1
  165. package/dist/collection/components/card-body/card-body.css +12 -1
  166. package/dist/collection/components/card-body/card-body.js +52 -2
  167. package/dist/collection/components/card-body/card-body.js.map +1 -1
  168. package/dist/collection/components/card-content/card-content.css +12 -0
  169. package/dist/collection/components/card-content/card-content.js +30 -0
  170. package/dist/collection/components/card-content/card-content.js.map +1 -0
  171. package/dist/collection/components/card-footer/card-footer.css +7 -0
  172. package/dist/collection/components/card-footer/card-footer.js +25 -0
  173. package/dist/collection/components/card-footer/card-footer.js.map +1 -0
  174. package/dist/collection/components/card-header/card-header.css +28 -0
  175. package/dist/collection/components/card-header/card-header.js +32 -0
  176. package/dist/collection/components/card-header/card-header.js.map +1 -0
  177. package/dist/collection/components/card-media/card-media.css +21 -0
  178. package/dist/collection/components/card-media/card-media.js +77 -0
  179. package/dist/collection/components/card-media/card-media.js.map +1 -0
  180. package/dist/collection/components/checkbox/checkbox.js +22 -1
  181. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  182. package/dist/collection/components/com-nav/com-nav.js +2 -2
  183. package/dist/collection/components/com-nav-category/com-nav-category.js +2 -2
  184. package/dist/collection/components/com-nav-item/com-nav-item.css +2 -1
  185. package/dist/collection/components/com-nav-item/com-nav-item.js +1 -1
  186. package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +2 -2
  187. package/dist/collection/components/counter/counter-interface.js +1 -5
  188. package/dist/collection/components/counter/counter-interface.js.map +1 -1
  189. package/dist/collection/components/counter/counter.css +7 -1
  190. package/dist/collection/components/counter/counter.js +13 -10
  191. package/dist/collection/components/counter/counter.js.map +1 -1
  192. package/dist/collection/components/divider/divider.js +1 -1
  193. package/dist/collection/components/dropdown/dropdown.js +3 -8
  194. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  195. package/dist/collection/components/dropdown-divider/dropdown-divider.js +1 -1
  196. package/dist/collection/components/dropdown-header/dropdown-header.js +1 -1
  197. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  198. package/dist/collection/components/editable-field/editable-field.css +34 -10
  199. package/dist/collection/components/editable-field/editable-field.e2e.js +176 -0
  200. package/dist/collection/components/editable-field/editable-field.e2e.js.map +1 -0
  201. package/dist/collection/components/editable-field/editable-field.js +83 -57
  202. package/dist/collection/components/editable-field/editable-field.js.map +1 -1
  203. package/dist/collection/components/error/error.js +1 -1
  204. package/dist/collection/components/error/error.js.map +1 -1
  205. package/dist/collection/components/field/field.js +1 -1
  206. package/dist/collection/components/field-content/field-content.js +1 -1
  207. package/dist/collection/components/field-label/field-label.js +1 -1
  208. package/dist/collection/components/footer/footer.js +1 -1
  209. package/dist/collection/components/footer/footer.js.map +1 -1
  210. package/dist/collection/components/form-field/form-field.css +39 -12
  211. package/dist/collection/components/form-field/form-field.e2e.js +122 -0
  212. package/dist/collection/components/form-field/form-field.e2e.js.map +1 -0
  213. package/dist/collection/components/form-field/form-field.js +29 -12
  214. package/dist/collection/components/form-field/form-field.js.map +1 -1
  215. package/dist/collection/components/galactic/galactic.js +1 -1
  216. package/dist/collection/components/galactic-menu/galactic-menu.css +1 -0
  217. package/dist/collection/components/galactic-menu/galactic-menu.js +2 -2
  218. package/dist/collection/components/grid/grid.js +30 -5
  219. package/dist/collection/components/grid/grid.js.map +1 -1
  220. package/dist/collection/components/grid-column/grid-column.js +4 -4
  221. package/dist/collection/components/grid-column/grid-column.js.map +1 -1
  222. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +1 -1
  223. package/dist/collection/components/grid-pagination/grid-pagination-arrow.js +2 -2
  224. package/dist/collection/components/grid-pagination/grid-pagination-arrow.js.map +1 -1
  225. package/dist/collection/components/grid-pagination/grid-pagination.js +22 -2
  226. package/dist/collection/components/grid-pagination/grid-pagination.js.map +1 -1
  227. package/dist/collection/components/header/header.css +9 -1
  228. package/dist/collection/components/header/header.js +2 -1
  229. package/dist/collection/components/header/header.js.map +1 -1
  230. package/dist/collection/components/hint/hint.js +1 -1
  231. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +2 -2
  232. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js.map +1 -1
  233. package/dist/collection/components/icon/icon.js +1 -1
  234. package/dist/collection/components/input/input-interface.js +1 -5
  235. package/dist/collection/components/input/input-interface.js.map +1 -1
  236. package/dist/collection/components/input/input.css +14 -1
  237. package/dist/collection/components/input/input.js +44 -10
  238. package/dist/collection/components/input/input.js.map +1 -1
  239. package/dist/collection/components/label/label.js +1 -1
  240. package/dist/collection/components/label/label.js.map +1 -1
  241. package/dist/collection/components/list-item/list-item.js +7 -2
  242. package/dist/collection/components/list-item/list-item.js.map +1 -1
  243. package/dist/collection/components/list-item-properties/list-item-properties.js +1 -1
  244. package/dist/collection/components/list-item-property/list-item-property.js +1 -1
  245. package/dist/collection/components/mat-icon/mat-icon.js +2 -2
  246. package/dist/collection/components/mat-icon/mat-icon.js.map +1 -1
  247. package/dist/collection/components/modal/modal-interface.js.map +1 -1
  248. package/dist/collection/components/modal/modal.css +1 -0
  249. package/dist/collection/components/modal/modal.js +58 -2
  250. package/dist/collection/components/modal/modal.js.map +1 -1
  251. package/dist/collection/components/native-select/native-select.css +2 -2
  252. package/dist/collection/components/native-select/native-select.js +2 -2
  253. package/dist/collection/components/native-select/native-select.js.map +1 -1
  254. package/dist/collection/components/nav/nav.css +2 -0
  255. package/dist/collection/components/nav/nav.js +1 -1
  256. package/dist/collection/components/nav-item/nav-item.css +24 -6
  257. package/dist/collection/components/nav-item/nav-item.js +1 -1
  258. package/dist/collection/components/progress-bar/progress-bar.css +2 -2
  259. package/dist/collection/components/progress-bar/progress-bar.js +3 -3
  260. package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
  261. package/dist/collection/components/progress-radial/progress-radial.js +3 -3
  262. package/dist/collection/components/progress-radial/progress-radial.js.map +1 -1
  263. package/dist/collection/components/radio/radio.js +2 -2
  264. package/dist/collection/components/radio/radio.js.map +1 -1
  265. package/dist/collection/components/radio-group/radio-group.js +39 -2
  266. package/dist/collection/components/radio-group/radio-group.js.map +1 -1
  267. package/dist/collection/components/select/select.css +1 -1
  268. package/dist/collection/components/select/select.js +35 -9
  269. package/dist/collection/components/select/select.js.map +1 -1
  270. package/dist/collection/components/select-option/select-option.js +2 -2
  271. package/dist/collection/components/select-option/select-option.js.map +1 -1
  272. package/dist/collection/components/skeleton-circle/skeleton-circle.js +1 -1
  273. package/dist/collection/components/skeleton-rectangle/skeleton-rectangle.js +1 -1
  274. package/dist/collection/components/skeleton-text/skeleton-text.js +1 -1
  275. package/dist/collection/components/spinner/spinner.js +1 -1
  276. package/dist/collection/components/switch/switch.js +23 -2
  277. package/dist/collection/components/switch/switch.js.map +1 -1
  278. package/dist/collection/components/tab/tab.js +1 -1
  279. package/dist/collection/components/tabs/tabs.css +104 -1
  280. package/dist/collection/components/tabs/tabs.js +181 -6
  281. package/dist/collection/components/tabs/tabs.js.map +1 -1
  282. package/dist/collection/components/textarea/textarea.js +5 -5
  283. package/dist/collection/components/textarea/textarea.js.map +1 -1
  284. package/dist/collection/components/tooltip/tooltip.js +11 -9
  285. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  286. package/dist/collection/utils/control-component-interface.js +37 -0
  287. package/dist/collection/utils/control-component-interface.js.map +1 -0
  288. package/dist/collection/utils/helpers.js +40 -0
  289. package/dist/collection/utils/helpers.js.map +1 -1
  290. package/dist/esm/{com-nav-utils-1366c701.js → com-nav-utils-ee7bf77c.js} +2 -2
  291. package/dist/esm/{com-nav-utils-1366c701.js.map → com-nav-utils-ee7bf77c.js.map} +1 -1
  292. package/dist/esm/control-component-interface-9f09e520.js +40 -0
  293. package/dist/esm/control-component-interface-9f09e520.js.map +1 -0
  294. package/dist/esm/{grid-pagination-421689be.js → grid-pagination-731726a6.js} +26 -6
  295. package/dist/esm/grid-pagination-731726a6.js.map +1 -0
  296. package/dist/esm/{helpers-f137ec8d.js → helpers-ece6a2d3.js} +42 -2
  297. package/dist/esm/helpers-ece6a2d3.js.map +1 -0
  298. package/dist/esm/{keyboard-event-bdea408a.js → keyboard-event-26b65ae5.js} +2 -2
  299. package/dist/esm/{keyboard-event-bdea408a.js.map → keyboard-event-26b65ae5.js.map} +1 -1
  300. package/dist/esm/loader.js +1 -1
  301. package/dist/esm/wcs-accordion-panel.entry.js +2 -2
  302. package/dist/esm/wcs-accordion-panel.entry.js.map +1 -1
  303. package/dist/esm/wcs-action-bar.entry.js +1 -1
  304. package/dist/esm/wcs-action-bar.entry.js.map +1 -1
  305. package/dist/esm/wcs-alert-drawer.entry.js +95 -0
  306. package/dist/esm/wcs-alert-drawer.entry.js.map +1 -0
  307. package/dist/esm/wcs-alert.entry.js +117 -0
  308. package/dist/esm/wcs-alert.entry.js.map +1 -0
  309. package/dist/esm/wcs-app.entry.js +3 -3
  310. package/dist/esm/wcs-badge.entry.js +2 -2
  311. package/dist/esm/wcs-badge.entry.js.map +1 -1
  312. package/dist/esm/wcs-breadcrumb-item.entry.js +1 -1
  313. package/dist/esm/wcs-breadcrumb-item.entry.js.map +1 -1
  314. package/dist/esm/wcs-breadcrumb.entry.js +2 -2
  315. package/dist/esm/wcs-button_2.entry.js +4 -9
  316. package/dist/esm/wcs-button_2.entry.js.map +1 -1
  317. package/dist/esm/wcs-card-body.entry.js +10 -3
  318. package/dist/esm/wcs-card-body.entry.js.map +1 -1
  319. package/dist/esm/wcs-card-content.entry.js +18 -0
  320. package/dist/esm/wcs-card-content.entry.js.map +1 -0
  321. package/dist/esm/wcs-card-footer.entry.js +18 -0
  322. package/dist/esm/wcs-card-footer.entry.js.map +1 -0
  323. package/dist/esm/wcs-card-header.entry.js +18 -0
  324. package/dist/esm/wcs-card-header.entry.js.map +1 -0
  325. package/dist/esm/wcs-card-media.entry.js +25 -0
  326. package/dist/esm/wcs-card-media.entry.js.map +1 -0
  327. package/dist/esm/wcs-card.entry.js +31 -3
  328. package/dist/esm/wcs-card.entry.js.map +1 -1
  329. package/dist/esm/wcs-checkbox.entry.js +6 -2
  330. package/dist/esm/wcs-checkbox.entry.js.map +1 -1
  331. package/dist/esm/wcs-com-nav-category.entry.js +4 -4
  332. package/dist/esm/wcs-com-nav-item.entry.js +2 -2
  333. package/dist/esm/wcs-com-nav-item.entry.js.map +1 -1
  334. package/dist/esm/wcs-com-nav-submenu.entry.js +4 -4
  335. package/dist/esm/wcs-com-nav.entry.js +4 -4
  336. package/dist/esm/wcs-counter.entry.js +13 -15
  337. package/dist/esm/wcs-counter.entry.js.map +1 -1
  338. package/dist/esm/wcs-divider.entry.js +1 -1
  339. package/dist/esm/wcs-dropdown-divider.entry.js +1 -1
  340. package/dist/esm/wcs-dropdown-header.entry.js +1 -1
  341. package/dist/esm/wcs-dropdown-item.entry.js +2 -2
  342. package/dist/esm/wcs-dropdown.entry.js +3 -8
  343. package/dist/esm/wcs-dropdown.entry.js.map +1 -1
  344. package/dist/esm/wcs-editable-field.entry.js +81 -55
  345. package/dist/esm/wcs-editable-field.entry.js.map +1 -1
  346. package/dist/esm/wcs-error_3.entry.js +203 -0
  347. package/dist/esm/wcs-error_3.entry.js.map +1 -0
  348. package/dist/esm/wcs-field-content.entry.js +1 -1
  349. package/dist/esm/wcs-field-label.entry.js +1 -1
  350. package/dist/esm/wcs-field.entry.js +1 -1
  351. package/dist/esm/wcs-footer.entry.js +1 -1
  352. package/dist/esm/wcs-footer.entry.js.map +1 -1
  353. package/dist/esm/wcs-galactic-menu.entry.js +4 -4
  354. package/dist/esm/wcs-galactic-menu.entry.js.map +1 -1
  355. package/dist/esm/wcs-galactic.entry.js +1 -1
  356. package/dist/esm/wcs-grid-column.entry.js +2 -2
  357. package/dist/esm/wcs-grid-column.entry.js.map +1 -1
  358. package/dist/esm/wcs-grid-custom-cell.entry.js +1 -1
  359. package/dist/esm/wcs-grid-pagination.entry.js +2 -2
  360. package/dist/esm/wcs-grid.entry.js +14 -6
  361. package/dist/esm/wcs-grid.entry.js.map +1 -1
  362. package/dist/esm/wcs-header.entry.js +3 -3
  363. package/dist/esm/wcs-header.entry.js.map +1 -1
  364. package/dist/esm/wcs-hint.entry.js +1 -1
  365. package/dist/esm/wcs-horizontal-stepper.entry.js +1 -1
  366. package/dist/esm/wcs-horizontal-stepper.entry.js.map +1 -1
  367. package/dist/esm/wcs-icon.entry.js +2 -2
  368. package/dist/esm/wcs-input.entry.js +5 -13
  369. package/dist/esm/wcs-input.entry.js.map +1 -1
  370. package/dist/esm/wcs-list-item-properties.entry.js +1 -1
  371. package/dist/esm/wcs-list-item-property.entry.js +1 -1
  372. package/dist/esm/wcs-list-item.entry.js +1 -1
  373. package/dist/esm/wcs-list-item.entry.js.map +1 -1
  374. package/dist/esm/wcs-mat-icon.entry.js +2 -2
  375. package/dist/esm/wcs-mat-icon.entry.js.map +1 -1
  376. package/dist/esm/wcs-modal.entry.js +18 -4
  377. package/dist/esm/wcs-modal.entry.js.map +1 -1
  378. package/dist/esm/wcs-native-select.entry.js +2 -2
  379. package/dist/esm/wcs-native-select.entry.js.map +1 -1
  380. package/dist/esm/wcs-nav-item.entry.js +3 -3
  381. package/dist/esm/wcs-nav-item.entry.js.map +1 -1
  382. package/dist/esm/wcs-nav.entry.js +3 -3
  383. package/dist/esm/wcs-nav.entry.js.map +1 -1
  384. package/dist/esm/wcs-progress-bar.entry.js +4 -4
  385. package/dist/esm/wcs-progress-bar.entry.js.map +1 -1
  386. package/dist/esm/wcs-progress-radial.entry.js +3 -3
  387. package/dist/esm/wcs-progress-radial.entry.js.map +1 -1
  388. package/dist/esm/wcs-radio-group.entry.js +5 -2
  389. package/dist/esm/wcs-radio-group.entry.js.map +1 -1
  390. package/dist/esm/wcs-radio.entry.js +2 -2
  391. package/dist/esm/wcs-radio.entry.js.map +1 -1
  392. package/dist/esm/wcs-select_2.entry.js +21 -13
  393. package/dist/esm/wcs-select_2.entry.js.map +1 -1
  394. package/dist/esm/wcs-skeleton-circle.entry.js +1 -1
  395. package/dist/esm/wcs-skeleton-rectangle.entry.js +1 -1
  396. package/dist/esm/wcs-skeleton-text.entry.js +1 -1
  397. package/dist/esm/wcs-switch.entry.js +6 -2
  398. package/dist/esm/wcs-switch.entry.js.map +1 -1
  399. package/dist/esm/wcs-tab.entry.js +1 -1
  400. package/dist/esm/wcs-tabs.entry.js +150 -7
  401. package/dist/esm/wcs-tabs.entry.js.map +1 -1
  402. package/dist/esm/wcs-textarea.entry.js +2 -2
  403. package/dist/esm/wcs-textarea.entry.js.map +1 -1
  404. package/dist/esm/wcs-tooltip.entry.js +8 -4
  405. package/dist/esm/wcs-tooltip.entry.js.map +1 -1
  406. package/dist/esm/wcs.js +1 -1
  407. package/dist/types/components/alert/alert-interface.d.ts +11 -0
  408. package/dist/types/components/alert/alert.d.ts +79 -0
  409. package/dist/types/components/alert-drawer/alert-drawer-interface.d.ts +1 -0
  410. package/dist/types/components/alert-drawer/alert-drawer.d.ts +83 -0
  411. package/dist/types/components/button/button-interface.d.ts +1 -3
  412. package/dist/types/components/card/card-interface.d.ts +1 -0
  413. package/dist/types/components/card/card.d.ts +18 -1
  414. package/dist/types/components/card-body/card-body.d.ts +9 -0
  415. package/dist/types/components/card-content/card-content.d.ts +14 -0
  416. package/dist/types/components/card-footer/card-footer.d.ts +9 -0
  417. package/dist/types/components/card-header/card-header.d.ts +16 -0
  418. package/dist/types/components/card-media/card-media.d.ts +20 -0
  419. package/dist/types/components/checkbox/checkbox.d.ts +3 -1
  420. package/dist/types/components/counter/counter-interface.d.ts +1 -3
  421. package/dist/types/components/counter/counter.d.ts +6 -0
  422. package/dist/types/components/editable-field/editable-field.d.ts +23 -9
  423. package/dist/types/components/grid/grid.d.ts +4 -0
  424. package/dist/types/components/grid-pagination/grid-pagination.d.ts +6 -1
  425. package/dist/types/components/header/header.d.ts +1 -0
  426. package/dist/types/components/input/input-interface.d.ts +1 -3
  427. package/dist/types/components/input/input.d.ts +3 -0
  428. package/dist/types/components/list-item/list-item.d.ts +5 -0
  429. package/dist/types/components/mat-icon/mat-icon.d.ts +1 -1
  430. package/dist/types/components/modal/modal-interface.d.ts +2 -1
  431. package/dist/types/components/modal/modal.d.ts +23 -0
  432. package/dist/types/components/radio-group/radio-group.d.ts +3 -1
  433. package/dist/types/components/select/select.d.ts +11 -1
  434. package/dist/types/components/switch/switch.d.ts +3 -1
  435. package/dist/types/components/tabs/tabs.d.ts +55 -0
  436. package/dist/types/components/tooltip/tooltip.d.ts +3 -5
  437. package/dist/types/components.d.ts +658 -22
  438. package/dist/types/utils/control-component-interface.d.ts +22 -0
  439. package/dist/types/utils/helpers.d.ts +21 -0
  440. package/dist/wcs/p-0017d766.js +2 -0
  441. package/dist/wcs/{p-5ea2aba5.entry.js → p-0424e545.entry.js} +2 -2
  442. package/dist/wcs/{p-25b96cde.entry.js → p-0758d22e.entry.js} +2 -2
  443. package/dist/wcs/p-0758d22e.entry.js.map +1 -0
  444. package/dist/wcs/p-0b8157e7.entry.js +2 -0
  445. package/dist/wcs/p-0dd07842.entry.js +2 -0
  446. package/dist/wcs/p-0dd07842.entry.js.map +1 -0
  447. package/dist/wcs/{p-87b69cac.entry.js → p-1244daa0.entry.js} +2 -2
  448. package/dist/wcs/{p-80a23f9c.entry.js → p-18fa39f4.entry.js} +2 -2
  449. package/dist/wcs/{p-80a23f9c.entry.js.map → p-18fa39f4.entry.js.map} +1 -1
  450. package/dist/wcs/p-1ba616c2.entry.js +2 -0
  451. package/dist/wcs/p-1ba616c2.entry.js.map +1 -0
  452. package/dist/wcs/p-1e7ea63c.entry.js +2 -0
  453. package/dist/wcs/p-1e7ea63c.entry.js.map +1 -0
  454. package/dist/wcs/p-1f593d06.entry.js +2 -0
  455. package/dist/wcs/p-1f593d06.entry.js.map +1 -0
  456. package/dist/wcs/{p-d2a4f609.entry.js → p-1fbe0328.entry.js} +2 -2
  457. package/dist/wcs/p-1fbe0328.entry.js.map +1 -0
  458. package/dist/wcs/{p-276b8125.entry.js → p-204f2722.entry.js} +9 -9
  459. package/dist/wcs/p-204f2722.entry.js.map +1 -0
  460. package/dist/wcs/p-27b438c0.entry.js +2 -0
  461. package/dist/wcs/{p-45a6934d.entry.js → p-352e1f99.entry.js} +2 -2
  462. package/dist/wcs/{p-3cfa1c4b.entry.js → p-367946fe.entry.js} +2 -2
  463. package/dist/wcs/p-3823f54e.entry.js +2 -0
  464. package/dist/wcs/{p-4982f96c.entry.js → p-3a18535f.entry.js} +2 -2
  465. package/dist/wcs/p-41b946b2.entry.js +2 -0
  466. package/dist/wcs/p-41b946b2.entry.js.map +1 -0
  467. package/dist/wcs/{p-9553d60e.entry.js → p-496115a5.entry.js} +2 -2
  468. package/dist/wcs/{p-9553d60e.entry.js.map → p-496115a5.entry.js.map} +1 -1
  469. package/dist/wcs/p-4fb2d985.entry.js +2 -0
  470. package/dist/wcs/p-4fb2d985.entry.js.map +1 -0
  471. package/dist/wcs/{p-b0f8190f.entry.js → p-5202b323.entry.js} +2 -2
  472. package/dist/wcs/p-52d77e1f.js +2 -0
  473. package/dist/wcs/p-52d77e1f.js.map +1 -0
  474. package/dist/wcs/{p-ca8f3677.entry.js → p-53a395a9.entry.js} +2 -2
  475. package/dist/wcs/{p-ca8f3677.entry.js.map → p-53a395a9.entry.js.map} +1 -1
  476. package/dist/wcs/p-5607246c.entry.js +2 -0
  477. package/dist/wcs/p-5607246c.entry.js.map +1 -0
  478. package/dist/wcs/p-580b3142.entry.js +2 -0
  479. package/dist/wcs/{p-806315e6.entry.js.map → p-580b3142.entry.js.map} +1 -1
  480. package/dist/wcs/p-5da0534f.entry.js +2 -0
  481. package/dist/wcs/p-5da0534f.entry.js.map +1 -0
  482. package/dist/wcs/p-5e8fff73.entry.js +2 -0
  483. package/dist/wcs/p-5e8fff73.entry.js.map +1 -0
  484. package/dist/wcs/p-622f7403.entry.js +2 -0
  485. package/dist/wcs/p-622f7403.entry.js.map +1 -0
  486. package/dist/wcs/p-637ec45a.entry.js +2 -0
  487. package/dist/wcs/p-637ec45a.entry.js.map +1 -0
  488. package/dist/wcs/p-6aededc6.entry.js +2 -0
  489. package/dist/wcs/p-6aededc6.entry.js.map +1 -0
  490. package/dist/wcs/p-6c6079ee.entry.js +2 -0
  491. package/dist/wcs/{p-209145de.entry.js.map → p-6c6079ee.entry.js.map} +1 -1
  492. package/dist/wcs/{p-e5c057c4.entry.js → p-781a956e.entry.js} +2 -2
  493. package/dist/wcs/p-7de847e0.entry.js +2 -0
  494. package/dist/wcs/p-8152d360.entry.js +2 -0
  495. package/dist/wcs/p-8152d360.entry.js.map +1 -0
  496. package/dist/wcs/{p-2c9e20c1.entry.js → p-850fa9c9.entry.js} +2 -2
  497. package/dist/wcs/{p-f06aa79d.entry.js → p-86ec9ead.entry.js} +2 -2
  498. package/dist/wcs/{p-f06aa79d.entry.js.map → p-86ec9ead.entry.js.map} +1 -1
  499. package/dist/wcs/p-89b8c724.js +2 -0
  500. package/dist/wcs/p-8c2605fd.entry.js +2 -0
  501. package/dist/wcs/p-8c2605fd.entry.js.map +1 -0
  502. package/dist/wcs/{p-2305f257.entry.js → p-8e9bd0f1.entry.js} +2 -2
  503. package/dist/wcs/p-98a8b806.entry.js +2 -0
  504. package/dist/wcs/p-98a8b806.entry.js.map +1 -0
  505. package/dist/wcs/p-9c73744c.entry.js +2 -0
  506. package/dist/wcs/p-9c73744c.entry.js.map +1 -0
  507. package/dist/wcs/p-9fd3366c.entry.js +2 -0
  508. package/dist/wcs/p-9fd3366c.entry.js.map +1 -0
  509. package/dist/wcs/p-a0f6ef30.entry.js +2 -0
  510. package/dist/wcs/p-a0f6ef30.entry.js.map +1 -0
  511. package/dist/wcs/p-a7468a3a.js +2 -0
  512. package/dist/wcs/p-a7468a3a.js.map +1 -0
  513. package/dist/wcs/{p-0fa370d7.entry.js → p-a94e685c.entry.js} +3 -3
  514. package/dist/wcs/{p-0fa370d7.entry.js.map → p-a94e685c.entry.js.map} +1 -1
  515. package/dist/wcs/{p-97cbbcfc.entry.js → p-a956dc84.entry.js} +2 -2
  516. package/dist/wcs/p-a956dc84.entry.js.map +1 -0
  517. package/dist/wcs/{p-e19308cf.entry.js → p-aadf37e7.entry.js} +2 -2
  518. package/dist/wcs/{p-f8d2be83.entry.js → p-ad286030.entry.js} +2 -2
  519. package/dist/wcs/p-ad5192cd.entry.js +2 -0
  520. package/dist/wcs/p-b0a6eec6.entry.js +2 -0
  521. package/dist/wcs/p-b0a6eec6.entry.js.map +1 -0
  522. package/dist/wcs/{p-fa507e06.entry.js → p-b28b2fba.entry.js} +2 -2
  523. package/dist/wcs/p-b28b2fba.entry.js.map +1 -0
  524. package/dist/wcs/{p-15ff9f93.entry.js → p-bc009574.entry.js} +2 -2
  525. package/dist/wcs/{p-15ff9f93.entry.js.map → p-bc009574.entry.js.map} +1 -1
  526. package/dist/wcs/p-c211a5d1.entry.js +2 -0
  527. package/dist/wcs/{p-85a5bbb7.entry.js → p-c261eaf9.entry.js} +2 -2
  528. package/dist/wcs/p-c261eaf9.entry.js.map +1 -0
  529. package/dist/wcs/p-c5bad0b8.js +2 -0
  530. package/dist/wcs/p-c5bad0b8.js.map +1 -0
  531. package/dist/wcs/p-c7812760.entry.js +2 -0
  532. package/dist/wcs/{p-9e03b379.entry.js → p-c84ae00d.entry.js} +2 -2
  533. package/dist/wcs/p-cad10435.entry.js +2 -0
  534. package/dist/wcs/{p-8f0e093f.entry.js.map → p-cad10435.entry.js.map} +1 -1
  535. package/dist/wcs/p-cbbca016.entry.js +2 -0
  536. package/dist/wcs/p-cbbca016.entry.js.map +1 -0
  537. package/dist/wcs/{p-a788b5bd.entry.js → p-cbda74f6.entry.js} +2 -2
  538. package/dist/wcs/{p-09d0a296.entry.js → p-d27d4a53.entry.js} +3 -3
  539. package/dist/wcs/p-d27d4a53.entry.js.map +1 -0
  540. package/dist/wcs/p-dfb52a1c.entry.js +2 -0
  541. package/dist/wcs/p-dfb52a1c.entry.js.map +1 -0
  542. package/dist/wcs/p-dff8641e.entry.js +2 -0
  543. package/dist/wcs/p-dff8641e.entry.js.map +1 -0
  544. package/dist/wcs/p-e26c19e5.entry.js +2 -0
  545. package/dist/wcs/{p-1e5aa960.entry.js → p-e56b9ce2.entry.js} +2 -2
  546. package/dist/wcs/p-e56b9ce2.entry.js.map +1 -0
  547. package/dist/wcs/p-ec383729.entry.js +2 -0
  548. package/dist/wcs/p-ec383729.entry.js.map +1 -0
  549. package/dist/wcs/p-f929b66f.entry.js +2 -0
  550. package/dist/wcs/p-f929b66f.entry.js.map +1 -0
  551. package/dist/wcs/{p-db81b74f.entry.js → p-fd187bce.entry.js} +2 -2
  552. package/dist/wcs/p-fd187bce.entry.js.map +1 -0
  553. package/dist/wcs/p-fdeae83e.entry.js +2 -0
  554. package/dist/wcs/p-fdeae83e.entry.js.map +1 -0
  555. package/dist/wcs/wcs.esm.js +1 -1
  556. package/dist/wcs/wcs.esm.js.map +1 -1
  557. package/package.json +5 -2
  558. package/dist/cjs/button-interface-629f3563.js +0 -12
  559. package/dist/cjs/button-interface-629f3563.js.map +0 -1
  560. package/dist/cjs/grid-pagination-2c752b22.js.map +0 -1
  561. package/dist/cjs/helpers-871f5a3d.js.map +0 -1
  562. package/dist/cjs/wcs-error_2.cjs.entry.js +0 -168
  563. package/dist/cjs/wcs-error_2.cjs.entry.js.map +0 -1
  564. package/dist/cjs/wcs-label.cjs.entry.js +0 -33
  565. package/dist/cjs/wcs-label.cjs.entry.js.map +0 -1
  566. package/dist/esm/button-interface-dc5ddd51.js +0 -9
  567. package/dist/esm/button-interface-dc5ddd51.js.map +0 -1
  568. package/dist/esm/grid-pagination-421689be.js.map +0 -1
  569. package/dist/esm/helpers-f137ec8d.js.map +0 -1
  570. package/dist/esm/wcs-error_2.entry.js +0 -163
  571. package/dist/esm/wcs-error_2.entry.js.map +0 -1
  572. package/dist/esm/wcs-label.entry.js +0 -29
  573. package/dist/esm/wcs-label.entry.js.map +0 -1
  574. package/dist/wcs/p-08e86d69.entry.js +0 -2
  575. package/dist/wcs/p-08e86d69.entry.js.map +0 -1
  576. package/dist/wcs/p-09d0a296.entry.js.map +0 -1
  577. package/dist/wcs/p-0fdaec9e.entry.js +0 -2
  578. package/dist/wcs/p-0fdaec9e.entry.js.map +0 -1
  579. package/dist/wcs/p-19c77b5c.entry.js +0 -2
  580. package/dist/wcs/p-1ab0d13b.entry.js +0 -2
  581. package/dist/wcs/p-1ab0d13b.entry.js.map +0 -1
  582. package/dist/wcs/p-1e5aa960.entry.js.map +0 -1
  583. package/dist/wcs/p-209145de.entry.js +0 -2
  584. package/dist/wcs/p-25b96cde.entry.js.map +0 -1
  585. package/dist/wcs/p-276b8125.entry.js.map +0 -1
  586. package/dist/wcs/p-2add4d4d.entry.js +0 -2
  587. package/dist/wcs/p-2add4d4d.entry.js.map +0 -1
  588. package/dist/wcs/p-400a71d7.entry.js +0 -2
  589. package/dist/wcs/p-412b0021.js +0 -2
  590. package/dist/wcs/p-412b0021.js.map +0 -1
  591. package/dist/wcs/p-4ca7c59f.entry.js +0 -2
  592. package/dist/wcs/p-4ca7c59f.entry.js.map +0 -1
  593. package/dist/wcs/p-4d6d1d14.js +0 -2
  594. package/dist/wcs/p-52cd0abb.entry.js +0 -2
  595. package/dist/wcs/p-52cd0abb.entry.js.map +0 -1
  596. package/dist/wcs/p-550012c2.entry.js +0 -2
  597. package/dist/wcs/p-5f517eb5.entry.js +0 -2
  598. package/dist/wcs/p-76f07dbd.entry.js +0 -2
  599. package/dist/wcs/p-76f07dbd.entry.js.map +0 -1
  600. package/dist/wcs/p-806315e6.entry.js +0 -2
  601. package/dist/wcs/p-85a5bbb7.entry.js.map +0 -1
  602. package/dist/wcs/p-8780a429.entry.js +0 -2
  603. package/dist/wcs/p-8780a429.entry.js.map +0 -1
  604. package/dist/wcs/p-8bd1b9ce.entry.js +0 -2
  605. package/dist/wcs/p-8bd1b9ce.entry.js.map +0 -1
  606. package/dist/wcs/p-8f0e093f.entry.js +0 -2
  607. package/dist/wcs/p-94ff8939.entry.js +0 -2
  608. package/dist/wcs/p-94ff8939.entry.js.map +0 -1
  609. package/dist/wcs/p-96195d9a.entry.js +0 -2
  610. package/dist/wcs/p-96195d9a.entry.js.map +0 -1
  611. package/dist/wcs/p-97cbbcfc.entry.js.map +0 -1
  612. package/dist/wcs/p-985c4cf2.entry.js +0 -2
  613. package/dist/wcs/p-985c4cf2.entry.js.map +0 -1
  614. package/dist/wcs/p-9f23c49e.entry.js +0 -2
  615. package/dist/wcs/p-9f23c49e.entry.js.map +0 -1
  616. package/dist/wcs/p-a3aece7a.js +0 -2
  617. package/dist/wcs/p-a3aece7a.js.map +0 -1
  618. package/dist/wcs/p-a66a4289.entry.js +0 -2
  619. package/dist/wcs/p-ab49926d.entry.js +0 -2
  620. package/dist/wcs/p-ab49926d.entry.js.map +0 -1
  621. package/dist/wcs/p-bf31245c.entry.js +0 -2
  622. package/dist/wcs/p-bf31245c.entry.js.map +0 -1
  623. package/dist/wcs/p-c6a28b79.js +0 -2
  624. package/dist/wcs/p-c6a28b79.js.map +0 -1
  625. package/dist/wcs/p-cd592a00.entry.js +0 -2
  626. package/dist/wcs/p-cd592a00.entry.js.map +0 -1
  627. package/dist/wcs/p-d2a4f609.entry.js.map +0 -1
  628. package/dist/wcs/p-d42831b2.entry.js +0 -2
  629. package/dist/wcs/p-d42831b2.entry.js.map +0 -1
  630. package/dist/wcs/p-d443d419.entry.js +0 -2
  631. package/dist/wcs/p-d7acbf01.js +0 -2
  632. package/dist/wcs/p-db81b74f.entry.js.map +0 -1
  633. package/dist/wcs/p-dbbf0980.entry.js +0 -2
  634. package/dist/wcs/p-dbbf0980.entry.js.map +0 -1
  635. package/dist/wcs/p-e64d7437.entry.js +0 -2
  636. package/dist/wcs/p-e86575d3.entry.js +0 -2
  637. package/dist/wcs/p-e86575d3.entry.js.map +0 -1
  638. package/dist/wcs/p-f264d46f.entry.js +0 -2
  639. package/dist/wcs/p-fa507e06.entry.js.map +0 -1
  640. package/dist/wcs/p-fd9e731d.entry.js +0 -2
  641. package/dist/wcs/p-fd9e731d.entry.js.map +0 -1
  642. /package/dist/wcs/{p-d7acbf01.js.map → p-0017d766.js.map} +0 -0
  643. /package/dist/wcs/{p-5ea2aba5.entry.js.map → p-0424e545.entry.js.map} +0 -0
  644. /package/dist/wcs/{p-f264d46f.entry.js.map → p-0b8157e7.entry.js.map} +0 -0
  645. /package/dist/wcs/{p-87b69cac.entry.js.map → p-1244daa0.entry.js.map} +0 -0
  646. /package/dist/wcs/{p-e64d7437.entry.js.map → p-27b438c0.entry.js.map} +0 -0
  647. /package/dist/wcs/{p-45a6934d.entry.js.map → p-352e1f99.entry.js.map} +0 -0
  648. /package/dist/wcs/{p-3cfa1c4b.entry.js.map → p-367946fe.entry.js.map} +0 -0
  649. /package/dist/wcs/{p-400a71d7.entry.js.map → p-3823f54e.entry.js.map} +0 -0
  650. /package/dist/wcs/{p-4982f96c.entry.js.map → p-3a18535f.entry.js.map} +0 -0
  651. /package/dist/wcs/{p-b0f8190f.entry.js.map → p-5202b323.entry.js.map} +0 -0
  652. /package/dist/wcs/{p-e5c057c4.entry.js.map → p-781a956e.entry.js.map} +0 -0
  653. /package/dist/wcs/{p-550012c2.entry.js.map → p-7de847e0.entry.js.map} +0 -0
  654. /package/dist/wcs/{p-2c9e20c1.entry.js.map → p-850fa9c9.entry.js.map} +0 -0
  655. /package/dist/wcs/{p-4d6d1d14.js.map → p-89b8c724.js.map} +0 -0
  656. /package/dist/wcs/{p-2305f257.entry.js.map → p-8e9bd0f1.entry.js.map} +0 -0
  657. /package/dist/wcs/{p-e19308cf.entry.js.map → p-aadf37e7.entry.js.map} +0 -0
  658. /package/dist/wcs/{p-f8d2be83.entry.js.map → p-ad286030.entry.js.map} +0 -0
  659. /package/dist/wcs/{p-a66a4289.entry.js.map → p-ad5192cd.entry.js.map} +0 -0
  660. /package/dist/wcs/{p-19c77b5c.entry.js.map → p-c211a5d1.entry.js.map} +0 -0
  661. /package/dist/wcs/{p-d443d419.entry.js.map → p-c7812760.entry.js.map} +0 -0
  662. /package/dist/wcs/{p-9e03b379.entry.js.map → p-c84ae00d.entry.js.map} +0 -0
  663. /package/dist/wcs/{p-a788b5bd.entry.js.map → p-cbda74f6.entry.js.map} +0 -0
  664. /package/dist/wcs/{p-5f517eb5.entry.js.map → p-e26c19e5.entry.js.map} +0 -0
@@ -1,168 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-6f0140d8.js');
6
- const mutableAriaAttribute = require('./mutable-aria-attribute-342a2304.js');
7
-
8
- const errorCss = ":host{--wcs-error-color:var(--wcs-semantic-color-text-critical);--wcs-error-font-size:var(--wcs-semantic-font-size-caption-2);--wcs-error-font-weight:var(--wcs-semantic-font-weight-book);color:var(--wcs-error-color);font-size:var(--wcs-error-font-size);font-weight:var(--wcs-error-font-weight)}";
9
- const WcsErrorStyle0 = errorCss;
10
-
11
- const Label = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- }
15
- render() {
16
- return (index.h(index.Host, { key: '2257210c2e97d6c4dc04a87fa05121e203b79619', "aria-live": "polite", "aria-atomic": "true", slot: "error" }, index.h("slot", { key: 'fc76b174cb85991bb4cd899b72605b171f8165e6' })));
17
- }
18
- };
19
- Label.style = WcsErrorStyle0;
20
-
21
- const formFieldCss = ":host{--wcs-form-field-gap:var(--wcs-semantic-spacing-small);--wcs-form-field-prefix-suffix-border-radius:var(--wcs-semantic-border-radius-base);--wcs-form-field-prefix-icon-color:var(--wcs-semantic-color-foreground-primary);--wcs-form-field-prefix-value-color:var(--wcs-semantic-color-text-inverse);--wcs-form-field-prefix-placeholder-color:var(--wcs-semantic-color-text-inverse);display:flex;flex-direction:column;gap:var(--wcs-form-field-gap)}:host ::slotted([slot=prefix]){--wcs-select-value-color:var(--wcs-semantic-color-text-inverse);--wcs-select-placeholder-color:var(--wcs-semantic-color-text-inverse);--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-default);--wcs-select-control-arrow-color:var(--wcs-form-field-prefix-icon-color);--wcs-select-control-border-radius:var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);--wcs-select-control-border-width-default:0;--wcs-select-control-border-style-focus:dashed;--wcs-select-control-border-color-focus:var(--wcs-semantic-color-border-focus-base);--wcs-native-select-value-color:var(--wcs-semantic-color-text-inverse);--wcs-native-select-placeholder-color:var(--wcs-semantic-color-text-inverse);--wcs-native-select-arrow-color:var(--wcs-form-field-prefix-icon-color);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-default);--wcs-native-select-border-width:0;--wcs-native-select-border-color-focus:var(--wcs-semantic-color-border-focus-base);--wcs-native-select-border-style-focus:dashed;--wcs-native-select-border-radius:var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);--wcs-native-select-option-color:var(--wcs-semantic-color-text-inverse)}:host ::slotted([slot=prefix][disabled]),:host ::slotted([slot=prefix]:disabled),:host ::slotted([slot=prefix][aria-disabled=true]),:host ::slotted([slot=prefix][data-disabled]){--wcs-semantic-color-background-control-disabled:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-semantic-color-text-disabled:var(--wcs-semantic-color-foreground-disabled);--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-select-value-color:var(--wcs-semantic-color-text-disabled);--wcs-select-placeholder-color:var(--wcs-semantic-color-text-disabled);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-native-select-placeholder-color:var(--wcs-semantic-color-text-disabled);--wcs-native-select-value-color:var(--wcs-semantic-color-text-disabled)}:host ::slotted([slot=prefix]:hover:not([disabled]):not([data-disabled])){--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-hover);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-hover)}:host ::slotted([slot=prefix]:active:not([disabled]):not([data-disabled])){--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-press);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-press)}.input-container{display:flex}::slotted(wcs-select:not([slot=prefix])){width:100%}::slotted(wcs-native-select:not([slot=prefix])){width:100%}:host(.has-prefix) ::slotted(wcs-input){--wcs-input-border-radius-left:0}:host(.has-suffix) ::slotted(wcs-input){--wcs-input-border-radius-right:0}::slotted([slot=suffix]){--wcs-button-border-radius:0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;--wcs-select-control-border-radius:0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;--wcs-native-select-border-radius:0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0}";
22
- const WcsFormFieldStyle0 = formFieldCss;
23
-
24
- const FormField = class {
25
- constructor(hostRef) {
26
- index.registerInstance(this, hostRef);
27
- this.isError = false;
28
- this.hasPrefix = false;
29
- this.hasSuffix = false;
30
- this.spiedElement = undefined;
31
- }
32
- componentWillLoad() {
33
- this.hasSuffix = this.el.querySelector('wcs-button') !== null;
34
- this.hasPrefix = this.el.querySelector('wcs-select') !== null;
35
- }
36
- componentDidLoad() {
37
- this.initSpiedElement();
38
- this.addRequiredMarkerToLabel();
39
- this.updateErrorStateOnInput(this.isError);
40
- }
41
- isErrorChange(newValue) {
42
- this.updateErrorStateOnInput(newValue);
43
- this.updateAriaAttributes();
44
- }
45
- updateErrorStateOnInput(newValue) {
46
- if (this.spiedElementIsOfType('wcs-input', 'wcs-textarea')) {
47
- if (newValue) {
48
- this.spiedElement.setAttribute('state', 'error');
49
- }
50
- else {
51
- this.spiedElement.setAttribute('state', 'initial');
52
- }
53
- }
54
- }
55
- /**
56
- * This function return true if the form field contains an element with tagName matches a value of the types param
57
- * @param types
58
- * @private
59
- */
60
- spiedElementIsOfType(...types) {
61
- var _a;
62
- for (const type of types) {
63
- if (((_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.tagName) === type.toUpperCase())
64
- return true;
65
- }
66
- return false;
67
- }
68
- addRequiredMarkerToLabel() {
69
- var _a;
70
- // TODO: deprecate this in favor of the 'required' component attribute
71
- const label = this.el.querySelector('wcs-label');
72
- this.observer = new MutationObserver(mutations => {
73
- var _a;
74
- const requiredAttMutation = mutations.filter(m => m.attributeName === 'required')[0];
75
- if (requiredAttMutation) {
76
- this.updateLabelRequiredFlag((_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.hasAttribute('required'), label);
77
- }
78
- });
79
- if (this.spiedElement) {
80
- this.observer.observe(this.spiedElement, { attributes: true });
81
- }
82
- const isRequired = (_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.hasAttribute('required');
83
- this.updateLabelRequiredFlag(isRequired, label);
84
- }
85
- initSpiedElement() {
86
- var _a, _b;
87
- const SUPPORTED_COMPONENTS = ['wcs-input', 'wcs-select', 'wcs-native-select', 'wcs-textarea', 'wcs-radio-group', 'wcs-switch', 'wcs-checkbox', 'wcs-native-select', 'wcs-counter'];
88
- this.spiedElement = (_a = this.el.shadowRoot.querySelector('slot:not([name])')) === null || _a === void 0 ? void 0 : _a.assignedElements().filter(n => [...SUPPORTED_COMPONENTS, 'SLOT'].map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0];
89
- // If the component is used in another web component
90
- if (((_b = this.spiedElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'SLOT') {
91
- this.spiedElement = (this.spiedElement
92
- .assignedElements()
93
- .filter(n => SUPPORTED_COMPONENTS.map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0]);
94
- }
95
- if (!this.spiedElement) {
96
- // tslint:disable-next-line:no-console
97
- console.warn('Form-field component support only ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component.');
98
- return;
99
- }
100
- }
101
- updateAriaAttributes() {
102
- if (mutableAriaAttribute.isMutableAriaAttribute(this.spiedElement)) {
103
- this.spiedElement.setAriaAttribute('aria-label', this.label);
104
- // Sur les autres DS, généralement seul l'erreur est affichée et pas avec la description
105
- if (this.isError) {
106
- if (this.error)
107
- this.spiedElement.setAriaAttribute('aria-description', this.error);
108
- this.spiedElement.setAriaAttribute('aria-invalid', 'true');
109
- }
110
- else {
111
- if (this.description)
112
- this.spiedElement.setAriaAttribute('aria-description', this.description);
113
- this.spiedElement.setAriaAttribute('aria-invalid', 'false');
114
- }
115
- }
116
- }
117
- get label() {
118
- var _a;
119
- return (_a = this.el.querySelector('wcs-label')) === null || _a === void 0 ? void 0 : _a.textContent;
120
- }
121
- get description() {
122
- var _a;
123
- return (_a = this.el.querySelector('wcs-hint')) === null || _a === void 0 ? void 0 : _a.textContent;
124
- }
125
- get error() {
126
- var _a;
127
- return (_a = this.el.querySelector('wcs-error')) === null || _a === void 0 ? void 0 : _a.textContent;
128
- }
129
- updateLabelRequiredFlag(isRequired, label) {
130
- if (isRequired && label) {
131
- label.setAttribute('required', 'true');
132
- }
133
- else if (!isRequired && label) {
134
- label.removeAttribute('required');
135
- }
136
- }
137
- disconnectedCallback() {
138
- var _a;
139
- (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
140
- }
141
- render() {
142
- let classes = '';
143
- const isError = this.isError;
144
- if (this.hasSuffix) {
145
- classes += ' has-suffix';
146
- }
147
- if (this.hasPrefix) {
148
- classes += ' has-prefix';
149
- }
150
- return (index.h(index.Host, { key: 'c9f7040c27e964d32f5d39befad34fd2500ad89b', class: classes }, index.h("slot", { key: '580960c53f66356e3e8a67436603f3d5d0828409', name: "label" }), index.h("div", { key: '9f942bf24140c7c3718d4e56b5c356e4471c246b', class: "input-container" }, index.h("slot", { key: '03ac6862d220be32e3c62d6fa6b49d745f77f1f8', name: "prefix" }), index.h("slot", { key: '476c0419a0269dde5d3b89b025f475c54fa7a1f4', onSlotchange: () => this.onFormInputSlotChange() }), index.h("slot", { key: '63e76f50c004442ad27dbdf87c59fdb574a24352', name: "suffix" })), isError ? (index.h("slot", { name: "error" })) : '', index.h("slot", { key: 'd6dd0c622edbaf25c38844f62e46efefb462d616', name: "messages" })));
151
- }
152
- onFormInputSlotChange() {
153
- this.initSpiedElement();
154
- this.updateAriaAttributes();
155
- this.addRequiredMarkerToLabel();
156
- this.updateErrorStateOnInput(this.isError);
157
- }
158
- get el() { return index.getElement(this); }
159
- static get watchers() { return {
160
- "isError": ["isErrorChange"]
161
- }; }
162
- };
163
- FormField.style = WcsFormFieldStyle0;
164
-
165
- exports.wcs_error = Label;
166
- exports.wcs_form_field = FormField;
167
-
168
- //# sourceMappingURL=wcs-error_2.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"wcs-error.wcs-form-field.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,QAAQ,GAAG,wSAAwS,CAAC;AAC1T,uBAAe,QAAQ;;MCoBV,KAAK;;;;IACd,MAAM;QACF,QACIA,QAACC,UAAI,kEAAW,QAAQ,iBAAa,MAAM,EAAC,IAAI,EAAC,OAAO,IACpDD,oEAAQ,CACL,EACT;KACL;;;;AC5BL,MAAM,YAAY,GAAG,qzHAA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AI,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC9C;;;;;;;;;;;","names":["h","Host","isMutableAriaAttribute"],"sources":["src/components/error/error.scss?tag=wcs-error&encapsulation=shadow","src/components/error/error.tsx","src/components/form-field/form-field.scss?tag=wcs-form-field&encapsulation=shadow","src/components/form-field/form-field.tsx"],"sourcesContent":[":host {\n --wcs-error-color: var(--wcs-semantic-color-text-critical);\n --wcs-error-font-size: var(--wcs-semantic-font-size-caption-2);\n --wcs-error-font-weight: var(--wcs-semantic-font-weight-book);\n\n color: var(--wcs-error-color);\n font-size: var(--wcs-error-font-size);\n font-weight: var(--wcs-error-font-weight);\n}\n","import { Component, ComponentInterface, h, Host } from '@stencil/core';\n\n/**\n * The `wcs-error` should always be wrapped in a `wcs-form-field`.\n * It is used to display a red message under the field indicating an incorrect user input.\n * \n * ## Accessibility guidelines 💡\n * - Provide a relevant error message to inform the users what they should change to make the field valid\n * - Always add the error icon, to ensure the visual indication of the error state other than the color\n * - `aria-description` will be automatically added to the field for screen readers\n * - `aria-invalid=\"true\"` will be automatically added to the field for screen readers\n * \n * @cssprop --wcs-error-color - Color of the text\n * @cssprop --wcs-error-font-size - Font size\n * @cssprop --wcs-error-font-weight - Font weight\n */\n@Component({\n tag: 'wcs-error',\n styleUrl: 'error.scss',\n shadow: true,\n})\nexport class Label implements ComponentInterface {\n render() {\n return (\n <Host aria-live=\"polite\" aria-atomic=\"true\" slot=\"error\">\n <slot />\n </Host>\n );\n }\n}\n",":host {\n --wcs-form-field-gap: var(--wcs-semantic-spacing-small);\n\n --wcs-form-field-prefix-suffix-border-radius: var(--wcs-semantic-border-radius-base);\n\n --wcs-form-field-prefix-icon-color: var(--wcs-semantic-color-foreground-primary);\n --wcs-form-field-prefix-value-color: var(--wcs-semantic-color-text-inverse);\n --wcs-form-field-prefix-placeholder-color: var(--wcs-semantic-color-text-inverse);\n\n // Prefixed select\n ::slotted([slot=prefix]) {\n --wcs-select-value-color: var(--wcs-semantic-color-text-inverse);\n --wcs-select-placeholder-color: var(--wcs-semantic-color-text-inverse);\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-default);\n --wcs-select-control-arrow-color: var(--wcs-form-field-prefix-icon-color);\n --wcs-select-control-border-radius: var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);\n --wcs-select-control-border-width-default: 0;\n --wcs-select-control-border-style-focus: dashed;\n --wcs-select-control-border-color-focus: var(--wcs-semantic-color-border-focus-base);\n\n --wcs-native-select-value-color: var(--wcs-semantic-color-text-inverse);\n --wcs-native-select-placeholder-color: var(--wcs-semantic-color-text-inverse);\n --wcs-native-select-arrow-color: var(--wcs-form-field-prefix-icon-color);\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-default);\n --wcs-native-select-border-width: 0;\n --wcs-native-select-border-color-focus: var(--wcs-semantic-color-border-focus-base);\n --wcs-native-select-border-style-focus: dashed;\n --wcs-native-select-border-radius: var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);\n --wcs-native-select-option-color: var(--wcs-semantic-color-text-inverse);\n }\n\n ::slotted([slot=prefix][disabled]),\n ::slotted([slot=prefix]:disabled),\n ::slotted([slot=prefix][aria-disabled=true]),\n ::slotted([slot=prefix][data-disabled]) {\n --wcs-semantic-color-background-control-disabled: var(--wcs-semantic-color-background-action-primary-disabled);\n --wcs-semantic-color-text-disabled: var(--wcs-semantic-color-foreground-disabled);\n\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-disabled);\n --wcs-select-value-color: var(--wcs-semantic-color-text-disabled);\n --wcs-select-placeholder-color: var(--wcs-semantic-color-text-disabled);\n\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-disabled);\n --wcs-native-select-placeholder-color: var(--wcs-semantic-color-text-disabled);\n --wcs-native-select-value-color: var(--wcs-semantic-color-text-disabled);\n }\n\n ::slotted([slot=prefix]:hover:not([disabled]):not([data-disabled])) {\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-hover);\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-hover);\n }\n\n ::slotted([slot=prefix]:active:not([disabled]):not([data-disabled])) {\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-press);\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-press);\n }\n // endregion\n\n display: flex;\n flex-direction: column;\n gap: var(--wcs-form-field-gap);\n}\n\n.input-container {\n display: flex;\n}\n\n::slotted(wcs-select:not([slot=prefix])) {\n width: 100%;\n}\n\n::slotted(wcs-native-select:not([slot=prefix])) {\n width: 100%;\n}\n\n// Make input square on left side if there is a prefix\n:host(.has-prefix) {\n ::slotted(wcs-input) {\n --wcs-input-border-radius-left: 0;\n }\n}\n\n// Make input square on right side if there is a suffix\n:host(.has-suffix) {\n ::slotted(wcs-input) {\n --wcs-input-border-radius-right: 0;\n }\n}\n\n::slotted([slot=suffix]) {\n // Make button square on left side\n --wcs-button-border-radius: 0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;\n\n // Make select square on left side\n --wcs-select-control-border-radius: 0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0 ;\n\n // Make native select square on left side\n --wcs-native-select-border-radius: 0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;\n}\n","import { Component, ComponentInterface, Element, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { isMutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\n/**\n * Form field component wraps the native input element and add some more functionality on top of it.\n *\n * You can use the `wcs-form-field` to wrap any of these components :\n * - `wcs-input`\n * - `wcs-textarea`\n * - `wcs-radio-group`\n * - `wcs-switch`\n * - `wcs-checkbox`\n * - `wcs-native-select`\n * - `wcs-select`\n * - `wcs-counter`\n *\n * For non-supported slotted component, you can use the `required` attribute on the wrapped component to tell the\n * form-field that it is required. It will add a red star after the label of the form field.\n * \n * ## Accessibility guidelines 💡\n * - Each form control should be identified with a unique `wcs-label`\n * - Don't forget to add form validation to make sure the data is correctly formatted\n * - If the `wcs-label` is required, the form control must have the `required` HTML attribute and vice-versa (this is normally automatically set)\n * - The form should not be submittable if at least one required form control is not filled\n * - Hints are optional and should only be used to add extra information\n * - Additional aria attributes put on `<wcs-form-field>` won't inherit onto the native component : you must use the `setAriaAttribute` method.\n * \n * @slot label - Automatically filled when a `wcs-label` is provided\n * @slot <no-name> - The main slot containing the wrapped component\n * @slot prefix - (Optional) Display a component as prefix. See \"Prefix Suffix Group\" story for more info.\n * @slot suffix - (Optional) Display a component as suffix. See \"Prefix Suffix Group\" story for more info.\n * @slot error - Automatically filled when a `wcs-error` is provided\n * @slot messages - Automatically filled when a `wcs-hint` is provided\n *\n * @cssprop --wcs-form-field-gap - Defines the spacing between the label, input control, and hint messages.\n * @cssprop --wcs-form-field-prefix-suffix-border-radius - Sets the border radius for both prefix and suffix elements.\n * \n * @cssprop --wcs-form-field-prefix-background-color-default - Background color default for prefix elements\n * @cssprop --wcs-form-field-prefix-background-color-disabled - Background color for prefix elements when disabled\n * @cssprop --wcs-form-field-prefix-background-color-hover - Background color for prefix elements when hovered\n * @cssprop --wcs-form-field-prefix-border-color-default - Defines the default border color for prefix\n * @cssprop --wcs-form-field-prefix-border-color-focus - Sets the border color for prefix elements when focused.\n * @cssprop --wcs-form-field-prefix-border-color-disabled - Determines the border color for prefix elements when disabled.\n * \n * @cssprop --wcs-form-field-prefix-icon-color - Specifies the color of icons within prefix elements.\n * @cssprop --wcs-form-field-prefix-value-color - Sets the color of values within prefix elements.\n * @cssprop --wcs-form-field-prefix-placeholder-color - Defines the placeholder text color within prefix elements.\n * @cssprop --wcs-form-field-prefix-color-disabled - Determines the text color for prefix elements when disabled.\n */\n@Component({\n tag: 'wcs-form-field',\n styleUrl: 'form-field.scss',\n shadow: true,\n})\nexport class FormField implements ComponentInterface {\n @Element() private el!: HTMLWcsFormFieldElement;\n\n /**\n * Specifies whether the form field is in an error state. Displays the field border in red and the message contained in the wcs-error component\n */\n @Prop({mutable: true, reflect: true}) isError = false;\n\n @State() private hasPrefix = false;\n @State() private hasSuffix = false;\n @State() private spiedElement: Element;\n\n private observer: MutationObserver;\n\n componentWillLoad() {\n this.hasSuffix = this.el.querySelector('wcs-button') !== null;\n this.hasPrefix = this.el.querySelector('wcs-select') !== null;\n }\n\n componentDidLoad() {\n this.initSpiedElement();\n this.addRequiredMarkerToLabel();\n this.updateErrorStateOnInput(this.isError);\n }\n\n @Watch('isError')\n // @ts-ignore\n private isErrorChange(newValue: boolean) {\n this.updateErrorStateOnInput(newValue);\n this.updateAriaAttributes();\n }\n\n private updateErrorStateOnInput(newValue: boolean) {\n if (this.spiedElementIsOfType('wcs-input', 'wcs-textarea')) {\n if (newValue) {\n this.spiedElement.setAttribute('state', 'error');\n } else {\n this.spiedElement.setAttribute('state', 'initial');\n }\n }\n }\n\n /**\n * This function return true if the form field contains an element with tagName matches a value of the types param\n * @param types\n * @private\n */\n private spiedElementIsOfType(...types: string[]): boolean {\n for (const type of types) {\n if (this.spiedElement?.tagName === type.toUpperCase()) return true;\n }\n return false\n }\n\n\n private addRequiredMarkerToLabel() {\n // TODO: deprecate this in favor of the 'required' component attribute\n const label = this.el.querySelector('wcs-label');\n this.observer = new MutationObserver(mutations => {\n const requiredAttMutation = mutations.filter(m => m.attributeName === 'required')[0];\n if (requiredAttMutation) {\n this.updateLabelRequiredFlag(this.spiedElement?.hasAttribute('required'), label);\n }\n });\n if (this.spiedElement) {\n this.observer.observe(this.spiedElement, {attributes: true});\n }\n\n const isRequired = this.spiedElement?.hasAttribute('required');\n this.updateLabelRequiredFlag(isRequired, label);\n }\n\n\n private initSpiedElement() {\n const SUPPORTED_COMPONENTS = ['wcs-input', 'wcs-select', 'wcs-native-select', 'wcs-textarea', 'wcs-radio-group', 'wcs-switch', 'wcs-checkbox', 'wcs-native-select', 'wcs-counter'];\n\n this.spiedElement = (this.el.shadowRoot.querySelector('slot:not([name])') as HTMLSlotElement)\n ?.assignedElements()\n .filter(n => [...SUPPORTED_COMPONENTS, 'SLOT'].map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0];\n\n // If the component is used in another web component\n if (this.spiedElement?.tagName === 'SLOT') {\n this.spiedElement = ((this.spiedElement as HTMLSlotElement)\n .assignedElements()\n .filter(n => SUPPORTED_COMPONENTS.map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0]) as HTMLElement;\n }\n\n if (!this.spiedElement) {\n // tslint:disable-next-line:no-console\n console.warn('Form-field component support only ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component.');\n return;\n }\n }\n \n private updateAriaAttributes(): void {\n if(isMutableAriaAttribute(this.spiedElement)) {\n this.spiedElement.setAriaAttribute('aria-label', this.label);\n\n // Sur les autres DS, généralement seul l'erreur est affichée et pas avec la description\n if(this.isError) {\n if(this.error) this.spiedElement.setAriaAttribute('aria-description', this.error);\n this.spiedElement.setAriaAttribute('aria-invalid', 'true');\n } else {\n if(this.description) this.spiedElement.setAriaAttribute('aria-description', this.description);\n this.spiedElement.setAriaAttribute('aria-invalid', 'false');\n }\n }\n }\n \n private get label() {\n return this.el.querySelector('wcs-label')?.textContent;\n }\n \n private get description() {\n return this.el.querySelector('wcs-hint')?.textContent;\n }\n \n private get error() {\n return this.el.querySelector('wcs-error')?.textContent;\n }\n\n private updateLabelRequiredFlag(isRequired: boolean, label: Element) {\n if (isRequired && label) {\n label.setAttribute('required', 'true');\n } else if (!isRequired && label) {\n label.removeAttribute('required');\n }\n }\n\n disconnectedCallback() {\n this.observer?.disconnect();\n }\n\n render() {\n let classes = '';\n const isError = this.isError;\n\n if (this.hasSuffix) {\n classes += ' has-suffix';\n }\n if (this.hasPrefix) {\n classes += ' has-prefix';\n }\n return (\n <Host class={classes}>\n <slot name=\"label\"/>\n <div class=\"input-container\">\n <slot name=\"prefix\"/>\n <slot onSlotchange={() => this.onFormInputSlotChange()}/>\n <slot name=\"suffix\"/>\n </div>\n {\n isError ? (<slot name=\"error\"/>) : ''\n }\n <slot name=\"messages\"/>\n </Host>\n );\n }\n\n private onFormInputSlotChange() {\n this.initSpiedElement();\n this.updateAriaAttributes()\n this.addRequiredMarkerToLabel();\n this.updateErrorStateOnInput(this.isError);\n }\n}\n"],"version":3}
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-6f0140d8.js');
6
- const helpers = require('./helpers-871f5a3d.js');
7
-
8
- const labelCss = ":host{--wcs-label-font-weight:var(--wcs-semantic-font-weight-book);--wcs-label-color:var(--wcs-semantic-color-text-primary);--wcs-label-required-marker-color:var(--wcs-semantic-color-text-critical);--wcs-label-gap:var(--wcs-semantic-spacing-small);font-weight:var(--wcs-label-font-weight)}:host([required])>label::after{font-weight:var(--wcs-label-font-weight);color:var(--wcs-label-required-marker-color);content:\" *\"}label{display:inline-block;color:var(--wcs-label-color);font-weight:var(--wcs-label-font-weight)}label ::slotted(wcs-mat-icon){display:inline;vertical-align:middle;margin-left:var(--wcs-label-gap)}";
9
- const WcsLabelStyle0 = labelCss;
10
-
11
- const LABEL_INHERITED_ATTRS = ['title'];
12
- const Label = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.inheritedAttributes = {};
16
- this.required = false;
17
- }
18
- componentWillLoad() {
19
- this.inheritedAttributes = Object.assign(Object.assign({}, helpers.inheritAriaAttributes(this.el)), helpers.inheritAttributes(this.el, LABEL_INHERITED_ATTRS));
20
- }
21
- async setAriaAttribute(attr, value) {
22
- helpers.setOrRemoveAttribute(this.nativeLabel, attr, value);
23
- }
24
- render() {
25
- return (index.h(index.Host, { key: '112bfe1eddc6da7b457bf183c83a07a60de0ca00', slot: "label" }, index.h("label", Object.assign({ key: '0d32dfcc8b4f024f986d7770a52402ae024c8862', ref: (el) => this.nativeLabel = el }, this.inheritedAttributes), index.h("slot", { key: '74c93cbd04d6744c2427f4810d510f05faa2bbfc' }))));
26
- }
27
- get el() { return index.getElement(this); }
28
- };
29
- Label.style = WcsLabelStyle0;
30
-
31
- exports.wcs_label = Label;
32
-
33
- //# sourceMappingURL=wcs-label.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"wcs-label.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,QAAQ,GAAG,4mBAA4mB,CAAC;AAC9nB,uBAAe,QAAQ;;ACGvB,MAAM,qBAAqB,GAAG,CAAC,OAAO,CAAC,CAAC;MAsB3B,KAAK;;;QAGN,wBAAmB,GAAyB,EAAE,CAAC;wBAMnB,KAAK;;IAEzC,iBAAiB;QACb,IAAI,CAAC,mBAAmB,mCACjBA,6BAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,GAC9BC,yBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,CAAC,CACvD,CAAC;KACL;IAGD,MAAM,gBAAgB,CAAC,IAAuB,EAAE,KAAgC;QAC5EC,4BAAoB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;KACvD;IAED,MAAM;QACF,QACIC,QAACC,UAAI,qDAAC,IAAI,EAAC,OAAO,IACdD,kFAAO,GAAG,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,EAAE,IAAM,IAAI,CAAC,mBAAmB,GACnEA,oEAAQ,CACJ,CACL,EACT;KACL;;;;;;;","names":["inheritAriaAttributes","inheritAttributes","setOrRemoveAttribute","h","Host"],"sources":["src/components/label/label.scss?tag=wcs-label&encapsulation=shadow","src/components/label/label.tsx"],"sourcesContent":[":host {\n --wcs-label-font-weight: var(--wcs-semantic-font-weight-book);\n --wcs-label-color: var(--wcs-semantic-color-text-primary);\n --wcs-label-required-marker-color: var(--wcs-semantic-color-text-critical);\n\n --wcs-label-gap: var(--wcs-semantic-spacing-small);\n\n font-weight: var(--wcs-label-font-weight);\n}\n\n:host([required]) > label::after {\n font-weight: var(--wcs-label-font-weight);\n color: var(--wcs-label-required-marker-color);\n content: ' *';\n}\n\nlabel {\n display: inline-block;\n color: var(--wcs-label-color);\n font-weight: var(--wcs-label-font-weight);\n\n // Add margin before tooltip icon\n ::slotted(wcs-mat-icon) {\n display: inline;\n vertical-align: middle;\n margin-left: var(--wcs-label-gap);\n }\n}\n","import { Component, ComponentInterface, h, Host, Method, Prop, Element } from '@stencil/core';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\nimport { inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from \"../../utils/helpers\";\n\nconst LABEL_INHERITED_ATTRS = ['title'];\n\n/**\n * The `wcs-label` should always be wrapped in a `wcs-form-field`.\n * It is used to caption a form control component.\n *\n * ## Accessibility guidelines 💡\n * - Use concise name for the label. If you want to describe more your form control, add a `wcs-hint`\n * - Use the required flag only as an indication to inform users that the form control is required\n * \n * @cssprop --wcs-label-color - Color of the text\n * @cssprop --wcs-label-font-weight - Font weight of the text\n * \n * @cssprop --wcs-label-required-marker-color - Color of the required marker\n * \n * @cssprop --wcs-label-gap - Gap between text and required marker\n */\n@Component({\n tag: 'wcs-label',\n styleUrl: 'label.scss',\n shadow: true,\n})\nexport class Label implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeLabel?: HTMLLabelElement;\n private inheritedAttributes: { [k: string]: any } = {};\n \n /**\n * If `true`, marks the label with a red star.\n * Automatically added if the wrapped component inside the `wcs-form-field` already has the `required` attribute. \n */\n @Prop({ reflect: true }) required = false;\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, LABEL_INHERITED_ATTRS),\n };\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeLabel, attr, value);\n }\n\n render() {\n return (\n <Host slot=\"label\">\n <label ref={(el) => this.nativeLabel = el} {...this.inheritedAttributes}>\n <slot />\n </label>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,9 +0,0 @@
1
- const WcsButtonSizeValues = ['s', 'm', 'l']; // as const keyword is used to infer and preserve the exact literal values of an array or object.
2
- function isWcsButtonSize(size) {
3
- // @ts-ignore : ignore size type, as it is checked with WcsButtonSizeValues
4
- return WcsButtonSizeValues.includes(size);
5
- }
6
-
7
- export { WcsButtonSizeValues as W, isWcsButtonSize as i };
8
-
9
- //# sourceMappingURL=button-interface-dc5ddd51.js.map
@@ -1 +0,0 @@
1
- {"file":"button-interface-dc5ddd51.js","mappings":"MAQa,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAW;SAI5C,eAAe,CAAC,IAAY;;IAExC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9C;;;;","names":[],"sources":["src/components/button/button-interface.ts"],"sourcesContent":["import { WcsSize } from '../../shared-types';\n\nexport type WcsButtonType = 'button' | 'submit';\n\nexport type WcsButtonShape = 'normal' | 'round' | 'square';\n\nexport type WcsButtonMode = 'plain' | 'stroked' | 'clear';\n\nexport const WcsButtonSizeValues = ['s', 'm', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object.\n\nexport type WcsButtonSize = Extract<WcsSize, typeof WcsButtonSizeValues[number]>;\n\nexport function isWcsButtonSize(size: string): size is WcsButtonSize {\n // @ts-ignore : ignore size type, as it is checked with WcsButtonSizeValues\n return WcsButtonSizeValues.includes(size);\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"grid-pagination-421689be.js","mappings":";;;AAQA,MAAM,iBAAiB,GAAG,CAAC,KAAwC,EAAE,MAA0C;IAC7G,QAAQ,KAAK;QACX,KAAK,MAAM;YACT,OAAO,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC;QAC5C,KAAK,UAAU,CAAC;QAChB;YACE,OAAO,MAAM,GAAG,YAAY,GAAG,eAAe,CAAC;KAClD;AAC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I,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAC3D,EAAC,mBAAmB,qDAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,EAAE,KAAK,EAAC,UAAU,EAAC,MAAM,SAAuB,CACtG,EACL,2DAAI,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAC9D,EAAC,mBAAmB,qDAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,EAAE,KAAK,EAAC,UAAU,GAAuB,CAC/F,EAEL,2DAAI,KAAK,EAAC,oBAAoB,IAC1B,2EAAkB,QAAQ,IAAI,CAAC,WAAW,GAAG,CAAC,QAAQ,IAAI,CAAC,SAAS,EAAE,kBAAe,MAAM,IACtF,IAAI,CAAC,WAAW,GAAG,CAAC,SAAK,IAAI,CAAC,SAAS,CACrC,CACN,EAEL,2DAAI,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAC1D,EAAC,mBAAmB,qDAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAC,MAAM,GAAuB,CACvF,EACL,2DAAI,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAC1D,EAAC,mBAAmB,qDAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,SAAuB,CAC9F,CACJ,CACH,CACJ,CACH,EAAC;KACX;;;AA9Ie,+BAAgB,GAAW,CAAX,CAAa;;;;;","names":[],"sources":["src/components/grid-pagination/grid-pagination-arrow.tsx","src/components/grid-pagination/grid-pagination.scss?tag=wcs-grid-pagination&encapsulation=shadow","src/components/grid-pagination/grid-pagination.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\n\ninterface GridPaginationArrowProps {\n active: boolean;\n order: 'next' | 'previous';\n double?: boolean;\n}\n\nconst getAccessibleName = (order: GridPaginationArrowProps['order'], double: GridPaginationArrowProps['double']): string => {\n switch (order) {\n case 'next':\n return double ? 'Last page' : 'Next page';\n case 'previous':\n default:\n return double ? 'First page' : 'Previous page';\n }\n}\n\nexport const GridPaginationArrow: FunctionalComponent<GridPaginationArrowProps> = ({active, order, double = false}) => (\n <wcs-button mode=\"clear\"\n shape=\"square\"\n size=\"s\"\n disabled={!active}\n title={getAccessibleName(order, double)}>\n <svg style={{cursor: 'pointer'}}\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"20\" viewBox=\"0 0 24 20\">\n <style type=\"text/css\">{`\n .arrow-group {\n transform-origin: 50% 51%;\n transition: transform 175ms ease-in-out;\n }\n .arrow {\n transition: fill 175ms ease-in-out;\n fill: var(--wcs-grid-pagination-arrow-color-inactive, var(--wcs-button-color));\n }\n .second-arrow {\n transform: translateY(-8px);\n }\n .next {\n transform: rotate(90deg);\n }\n .previous {\n transform: rotate(-90deg);\n }\n .active {\n fill: var(--wcs-grid-pagination-arrow-color-active, var(--wcs-button-color));\n }\n `}</style>\n <g fill=\"none\" class={order + ' arrow-group'}>\n <path class={(active ? 'active' : '') + ' arrow'} d=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z\"/>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n </g>\n {\n double ?\n <g fill=\"none\" class={order + ' arrow-group'}>\n <path class={(active ? 'active' : '') + ' arrow second-arrow'}\n d=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z\"/>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n </g>\n : ''\n }\n </svg>\n </wcs-button>\n);\n","@import '../../style/focus-outline.scss';\n\n:host {\n display: block;\n margin-top: var(--wcs-grid-pagination-margin-top);\n\n --wcs-grid-pagination-color: var(--wcs-semantic-color-text-primary);\n --wcs-grid-pagination-font-size: var(--wcs-semantic-font-size-label-2);\n --wcs-grid-pagination-font-weight: var(--wcs-semantic-font-weight-medium);\n\n --wcs-grid-pagination-gap: var(--wcs-semantic-spacing-base);\n --wcs-grid-pagination-page-size-gap: var(--wcs-semantic-spacing-base);\n --wcs-grid-pagination-counter-gap: var(--wcs-semantic-spacing-small);\n --wcs-grid-pagination-margin-top: var(--wcs-semantic-spacing-large);\n\n --wcs-grid-pagination-arrow-color-inactive: unset; /* Optional : Overrides the fill property of the grid-pagination-arrow */\n --wcs-grid-pagination-arrow-color-active: unset; /* Optional : Overrides the fill property of the grid-pagination-arrow */\n}\n\n.container {\n display: grid;\n gap: var(--wcs-grid-pagination-gap);\n grid-template-columns: auto auto auto;\n justify-content: space-between;\n align-items: center;\n color: var(--wcs-grid-pagination-color);\n font-size: var(--wcs-grid-pagination-font-size);\n font-weight: var(--wcs-grid-pagination-font-weight);\n}\n\n.available-page-sizes {\n width: auto;\n}\n\n.page-management, .page-size, .items-count {\n display: flex;\n align-items: center;\n}\n\n.page-size {\n gap: var(--wcs-grid-pagination-page-size-gap);\n}\n\n.page-management {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n\n.pagination-arrow {\n display: flex;\n}\n\n.pagination-counter {\n padding: 0 var(--wcs-grid-pagination-counter-gap);\n\n span {\n white-space: nowrap;\n }\n}\n\n/* TODO : Remove this when the select component will be able to handle the size S */\nwcs-select.available-page-sizes {\n --wcs-select-control-height: var(--wcs-semantic-size-s);\n}\n","import {\n Component,\n ComponentInterface, Element,\n Event, EventEmitter,\n h,\n Host, Method,\n Prop\n} from '@stencil/core';\nimport {\n WcsGridPaginationChangeEventDetails\n} from '../grid/grid-interface';\nimport { SelectChangeEventDetail } from '../select/select-interface';\nimport { GridPaginationArrow } from './grid-pagination-arrow';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\nimport { inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from \"../../utils/helpers\";\n\nconst GRID_PAGINATION_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.\n * \n * @cssprop --wcs-grid-pagination-color - Text color of the grid pagination\n * @cssprop --wcs-grid-pagination-font-size - Font-size of the grid pagination\n * @cssprop --wcs-grid-pagination-font-weight - Font-weight of the grid pagination\n * @cssprop --wcs-grid-pagination-gap - Gap between the page size, number of elements and page management\n * @cssprop --wcs-grid-pagination-page-size-gap - Gap between the select and the text within the page size container\n * @cssprop --wcs-grid-pagination-counter-gap - Gap within the page management counter\n * @cssprop --wcs-grid-pagination-margin-top - Margin between the grid and the pagination\n * @cssprop --wcs-grid-pagination-arrow-color-inactive - Color of the inactive arrow\n * @cssprop --wcs-grid-pagination-arrow-color-active - Color of the active arrow\n */\n@Component({\n tag: 'wcs-grid-pagination',\n styleUrl: 'grid-pagination.scss',\n shadow: true\n})\nexport class GridPagination implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeNav!: HTMLElement;\n private inheritedAttributes: { [k: string]: any } = {};\n \n static readonly INDEX_FIRST_PAGE: number = 0;\n /**\n * Set the available page sizes in the pagination dropdown on the left.\n */\n @Prop() availablePageSizes: number[] = [10, 20, 50];\n /**\n * The current page of the pagination. First page starts at index 0.\n */\n @Prop({mutable: true}) currentPage: number = GridPagination.INDEX_FIRST_PAGE;\n /**\n * Maximum number of elements shown per page. \n * Default is the first value of `availablePageSizes`.\n */\n @Prop() pageSize: number = this.availablePageSizes[0];\n /**\n * Total elements in the grid. \n * - **Grid in `Server mode`** : You have to set `itemsCount` = your total data length. \n * - **Grid not in Server mode** : Do not set it manually : itemsCount is set and updated every pagination refresh.\n */\n @Prop() itemsCount: number = 0;\n /**\n * Max number of pages. \n * - **Grid in `Server mode`** : You have to set `pageCount` = `itemsCount` divided by `pageSize`. \n * - **Grid not in Server mode** : Do not set it manually : pageCount is set and updated every pagination refresh.\n */\n @Prop() pageCount: number = 1;\n /**\n * Event emitted when the pagination changes.\n */\n @Event() wcsGridPaginationChange!: EventEmitter<WcsGridPaginationChangeEventDetails>;\n\n componentWillLoad(): Promise<void> | void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, GRID_PAGINATION_INHERITED_ATTRS),\n };\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeNav, attr, value);\n }\n\n private lastPage(): void {\n this.currentPage = this.pageCount - 1;\n this.emitPaginationChange();\n }\n\n private nextPage(): void {\n if (this.canGoToNextPage()) {\n this.currentPage++;\n this.emitPaginationChange();\n }\n }\n\n private canGoToNextPage(): boolean {\n return this.currentPage + 1 < this.pageCount;\n }\n\n private previousPage(): void {\n if (this.canGoToPreviousPage()) {\n this.currentPage--;\n this.emitPaginationChange();\n }\n }\n\n private canGoToPreviousPage(): boolean {\n return this.currentPage > 0;\n }\n\n private firstPage(): void {\n this.currentPage = 0;\n this.emitPaginationChange();\n }\n\n private onChangePagesize(event: CustomEvent<SelectChangeEventDetail>): void {\n this.pageSize = event.detail.value;\n if (this.currentPage + 1 > this.pageSize) {\n this.currentPage = 0;\n }\n this.emitPaginationChange();\n }\n\n private emitPaginationChange(): void {\n this.wcsGridPaginationChange.emit({\n pagination: {\n currentPage: this.currentPage,\n pageSize: this.pageSize,\n itemsCount: this.itemsCount,\n pageCount: this.pageCount\n }\n });\n }\n\n render(): any {\n return (<Host slot=\"grid-pagination\">\n <div class=\"container\">\n <div class=\"page-size\">\n <wcs-select placeholder=\"Eléments par page\"\n class=\"available-page-sizes\"\n aria-labelledby=\"elements-per-page-number elements-per-page-text\"\n value={this.pageSize}\n onWcsChange={this.onChangePagesize.bind(this)}>\n {\n this.availablePageSizes.map((pageSize) =>\n <wcs-select-option value={pageSize}>{pageSize}</wcs-select-option>\n )\n }\n </wcs-select>\n <span id=\"elements-per-page-number\" hidden>{this.pageSize}</span>\n <span id=\"elements-per-page-text\">éléments par page</span>\n </div>\n\n <div class=\"items-count\">\n <span>{this.itemsCount} éléments</span>\n </div>\n\n <nav aria-label=\"pagination\" ref={(el) => (this.nativeNav = el)} {...this.inheritedAttributes}>\n <ul class=\"page-management\">\n <li class=\"pagination-arrow\" onClick={this.firstPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToPreviousPage()} order=\"previous\" double></GridPaginationArrow>\n </li>\n <li class=\"pagination-arrow\" onClick={this.previousPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToPreviousPage()} order=\"previous\"></GridPaginationArrow>\n </li>\n \n <li class=\"pagination-counter\">\n <span aria-label={`Page ${this.currentPage + 1} sur ${this.pageCount}`} aria-current=\"page\">\n {this.currentPage + 1} / {this.pageCount}\n </span>\n </li>\n \n <li class=\"pagination-arrow\" onClick={this.nextPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToNextPage()} order=\"next\"></GridPaginationArrow>\n </li>\n <li class=\"pagination-arrow\" onClick={this.lastPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToNextPage()} order=\"next\" double></GridPaginationArrow>\n </li>\n </ul>\n </nav>\n </div>\n </Host>)\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"helpers-f137ec8d.js","mappings":"SAEgB,SAAS,CAAC,OAAY;IAClC,OAAO,aAAa,IAAI,OAAO;WACxB,cAAc,IAAI,OAAO,CAAC;AACrC,CAAC;SAEe,YAAY,CAAC,EAAe;IACxC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,IAAI,CAAC,CAAE,EAAU,CAAC,YAAY,CAAC;AACzD,CAAC;MAEY,aAAa,GAAG,CAAC,KAAmB,EAAE,IAAY;IAC3D,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,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,GAAkB;IAC5C,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU,CAAC;AAClC,CAAC;SAEe,WAAW,CAAC,GAAkB;IAC1C,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC;AAChC,CAAC;SAEe,QAAQ,CAAC,GAAkB;IACvC,OAAO,GAAG,CAAC,GAAG,KAAK,KAAK,CAAC;AAC7B,CAAC;SAMe,uBAAuB,CAAC,IAAY;IAChD,OAAO,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACjF;;;;","names":[],"sources":["src/utils/helpers.ts"],"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"],"version":3}
@@ -1,163 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-d9de61ce.js';
2
- import { i as isMutableAriaAttribute } from './mutable-aria-attribute-e225edc1.js';
3
-
4
- const errorCss = ":host{--wcs-error-color:var(--wcs-semantic-color-text-critical);--wcs-error-font-size:var(--wcs-semantic-font-size-caption-2);--wcs-error-font-weight:var(--wcs-semantic-font-weight-book);color:var(--wcs-error-color);font-size:var(--wcs-error-font-size);font-weight:var(--wcs-error-font-weight)}";
5
- const WcsErrorStyle0 = errorCss;
6
-
7
- const Label = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- }
11
- render() {
12
- return (h(Host, { key: '2257210c2e97d6c4dc04a87fa05121e203b79619', "aria-live": "polite", "aria-atomic": "true", slot: "error" }, h("slot", { key: 'fc76b174cb85991bb4cd899b72605b171f8165e6' })));
13
- }
14
- };
15
- Label.style = WcsErrorStyle0;
16
-
17
- const formFieldCss = ":host{--wcs-form-field-gap:var(--wcs-semantic-spacing-small);--wcs-form-field-prefix-suffix-border-radius:var(--wcs-semantic-border-radius-base);--wcs-form-field-prefix-icon-color:var(--wcs-semantic-color-foreground-primary);--wcs-form-field-prefix-value-color:var(--wcs-semantic-color-text-inverse);--wcs-form-field-prefix-placeholder-color:var(--wcs-semantic-color-text-inverse);display:flex;flex-direction:column;gap:var(--wcs-form-field-gap)}:host ::slotted([slot=prefix]){--wcs-select-value-color:var(--wcs-semantic-color-text-inverse);--wcs-select-placeholder-color:var(--wcs-semantic-color-text-inverse);--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-default);--wcs-select-control-arrow-color:var(--wcs-form-field-prefix-icon-color);--wcs-select-control-border-radius:var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);--wcs-select-control-border-width-default:0;--wcs-select-control-border-style-focus:dashed;--wcs-select-control-border-color-focus:var(--wcs-semantic-color-border-focus-base);--wcs-native-select-value-color:var(--wcs-semantic-color-text-inverse);--wcs-native-select-placeholder-color:var(--wcs-semantic-color-text-inverse);--wcs-native-select-arrow-color:var(--wcs-form-field-prefix-icon-color);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-default);--wcs-native-select-border-width:0;--wcs-native-select-border-color-focus:var(--wcs-semantic-color-border-focus-base);--wcs-native-select-border-style-focus:dashed;--wcs-native-select-border-radius:var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);--wcs-native-select-option-color:var(--wcs-semantic-color-text-inverse)}:host ::slotted([slot=prefix][disabled]),:host ::slotted([slot=prefix]:disabled),:host ::slotted([slot=prefix][aria-disabled=true]),:host ::slotted([slot=prefix][data-disabled]){--wcs-semantic-color-background-control-disabled:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-semantic-color-text-disabled:var(--wcs-semantic-color-foreground-disabled);--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-select-value-color:var(--wcs-semantic-color-text-disabled);--wcs-select-placeholder-color:var(--wcs-semantic-color-text-disabled);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-native-select-placeholder-color:var(--wcs-semantic-color-text-disabled);--wcs-native-select-value-color:var(--wcs-semantic-color-text-disabled)}:host ::slotted([slot=prefix]:hover:not([disabled]):not([data-disabled])){--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-hover);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-hover)}:host ::slotted([slot=prefix]:active:not([disabled]):not([data-disabled])){--wcs-select-control-background-color:var(--wcs-semantic-color-background-action-primary-press);--wcs-native-select-background-color:var(--wcs-semantic-color-background-action-primary-press)}.input-container{display:flex}::slotted(wcs-select:not([slot=prefix])){width:100%}::slotted(wcs-native-select:not([slot=prefix])){width:100%}:host(.has-prefix) ::slotted(wcs-input){--wcs-input-border-radius-left:0}:host(.has-suffix) ::slotted(wcs-input){--wcs-input-border-radius-right:0}::slotted([slot=suffix]){--wcs-button-border-radius:0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;--wcs-select-control-border-radius:0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;--wcs-native-select-border-radius:0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0}";
18
- const WcsFormFieldStyle0 = formFieldCss;
19
-
20
- const FormField = class {
21
- constructor(hostRef) {
22
- registerInstance(this, hostRef);
23
- this.isError = false;
24
- this.hasPrefix = false;
25
- this.hasSuffix = false;
26
- this.spiedElement = undefined;
27
- }
28
- componentWillLoad() {
29
- this.hasSuffix = this.el.querySelector('wcs-button') !== null;
30
- this.hasPrefix = this.el.querySelector('wcs-select') !== null;
31
- }
32
- componentDidLoad() {
33
- this.initSpiedElement();
34
- this.addRequiredMarkerToLabel();
35
- this.updateErrorStateOnInput(this.isError);
36
- }
37
- isErrorChange(newValue) {
38
- this.updateErrorStateOnInput(newValue);
39
- this.updateAriaAttributes();
40
- }
41
- updateErrorStateOnInput(newValue) {
42
- if (this.spiedElementIsOfType('wcs-input', 'wcs-textarea')) {
43
- if (newValue) {
44
- this.spiedElement.setAttribute('state', 'error');
45
- }
46
- else {
47
- this.spiedElement.setAttribute('state', 'initial');
48
- }
49
- }
50
- }
51
- /**
52
- * This function return true if the form field contains an element with tagName matches a value of the types param
53
- * @param types
54
- * @private
55
- */
56
- spiedElementIsOfType(...types) {
57
- var _a;
58
- for (const type of types) {
59
- if (((_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.tagName) === type.toUpperCase())
60
- return true;
61
- }
62
- return false;
63
- }
64
- addRequiredMarkerToLabel() {
65
- var _a;
66
- // TODO: deprecate this in favor of the 'required' component attribute
67
- const label = this.el.querySelector('wcs-label');
68
- this.observer = new MutationObserver(mutations => {
69
- var _a;
70
- const requiredAttMutation = mutations.filter(m => m.attributeName === 'required')[0];
71
- if (requiredAttMutation) {
72
- this.updateLabelRequiredFlag((_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.hasAttribute('required'), label);
73
- }
74
- });
75
- if (this.spiedElement) {
76
- this.observer.observe(this.spiedElement, { attributes: true });
77
- }
78
- const isRequired = (_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.hasAttribute('required');
79
- this.updateLabelRequiredFlag(isRequired, label);
80
- }
81
- initSpiedElement() {
82
- var _a, _b;
83
- const SUPPORTED_COMPONENTS = ['wcs-input', 'wcs-select', 'wcs-native-select', 'wcs-textarea', 'wcs-radio-group', 'wcs-switch', 'wcs-checkbox', 'wcs-native-select', 'wcs-counter'];
84
- this.spiedElement = (_a = this.el.shadowRoot.querySelector('slot:not([name])')) === null || _a === void 0 ? void 0 : _a.assignedElements().filter(n => [...SUPPORTED_COMPONENTS, 'SLOT'].map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0];
85
- // If the component is used in another web component
86
- if (((_b = this.spiedElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'SLOT') {
87
- this.spiedElement = (this.spiedElement
88
- .assignedElements()
89
- .filter(n => SUPPORTED_COMPONENTS.map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0]);
90
- }
91
- if (!this.spiedElement) {
92
- // tslint:disable-next-line:no-console
93
- console.warn('Form-field component support only ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component.');
94
- return;
95
- }
96
- }
97
- updateAriaAttributes() {
98
- if (isMutableAriaAttribute(this.spiedElement)) {
99
- this.spiedElement.setAriaAttribute('aria-label', this.label);
100
- // Sur les autres DS, généralement seul l'erreur est affichée et pas avec la description
101
- if (this.isError) {
102
- if (this.error)
103
- this.spiedElement.setAriaAttribute('aria-description', this.error);
104
- this.spiedElement.setAriaAttribute('aria-invalid', 'true');
105
- }
106
- else {
107
- if (this.description)
108
- this.spiedElement.setAriaAttribute('aria-description', this.description);
109
- this.spiedElement.setAriaAttribute('aria-invalid', 'false');
110
- }
111
- }
112
- }
113
- get label() {
114
- var _a;
115
- return (_a = this.el.querySelector('wcs-label')) === null || _a === void 0 ? void 0 : _a.textContent;
116
- }
117
- get description() {
118
- var _a;
119
- return (_a = this.el.querySelector('wcs-hint')) === null || _a === void 0 ? void 0 : _a.textContent;
120
- }
121
- get error() {
122
- var _a;
123
- return (_a = this.el.querySelector('wcs-error')) === null || _a === void 0 ? void 0 : _a.textContent;
124
- }
125
- updateLabelRequiredFlag(isRequired, label) {
126
- if (isRequired && label) {
127
- label.setAttribute('required', 'true');
128
- }
129
- else if (!isRequired && label) {
130
- label.removeAttribute('required');
131
- }
132
- }
133
- disconnectedCallback() {
134
- var _a;
135
- (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
136
- }
137
- render() {
138
- let classes = '';
139
- const isError = this.isError;
140
- if (this.hasSuffix) {
141
- classes += ' has-suffix';
142
- }
143
- if (this.hasPrefix) {
144
- classes += ' has-prefix';
145
- }
146
- return (h(Host, { key: 'c9f7040c27e964d32f5d39befad34fd2500ad89b', class: classes }, h("slot", { key: '580960c53f66356e3e8a67436603f3d5d0828409', name: "label" }), h("div", { key: '9f942bf24140c7c3718d4e56b5c356e4471c246b', class: "input-container" }, h("slot", { key: '03ac6862d220be32e3c62d6fa6b49d745f77f1f8', name: "prefix" }), h("slot", { key: '476c0419a0269dde5d3b89b025f475c54fa7a1f4', onSlotchange: () => this.onFormInputSlotChange() }), h("slot", { key: '63e76f50c004442ad27dbdf87c59fdb574a24352', name: "suffix" })), isError ? (h("slot", { name: "error" })) : '', h("slot", { key: 'd6dd0c622edbaf25c38844f62e46efefb462d616', name: "messages" })));
147
- }
148
- onFormInputSlotChange() {
149
- this.initSpiedElement();
150
- this.updateAriaAttributes();
151
- this.addRequiredMarkerToLabel();
152
- this.updateErrorStateOnInput(this.isError);
153
- }
154
- get el() { return getElement(this); }
155
- static get watchers() { return {
156
- "isError": ["isErrorChange"]
157
- }; }
158
- };
159
- FormField.style = WcsFormFieldStyle0;
160
-
161
- export { Label as wcs_error, FormField as wcs_form_field };
162
-
163
- //# sourceMappingURL=wcs-error_2.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"wcs-error.wcs-form-field.entry.js","mappings":";;;AAAA,MAAM,QAAQ,GAAG,wSAAwS,CAAC;AAC1T,uBAAe,QAAQ;;MCoBV,KAAK;;;;IACd,MAAM;QACF,QACI,EAAC,IAAI,kEAAW,QAAQ,iB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QACxB,IAAI,CAAC,oBAAoB,EAAE,CAAA;QAC3B,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAChC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC9C;;;;;;;;;;","names":[],"sources":["src/components/error/error.scss?tag=wcs-error&encapsulation=shadow","src/components/error/error.tsx","src/components/form-field/form-field.scss?tag=wcs-form-field&encapsulation=shadow","src/components/form-field/form-field.tsx"],"sourcesContent":[":host {\n --wcs-error-color: var(--wcs-semantic-color-text-critical);\n --wcs-error-font-size: var(--wcs-semantic-font-size-caption-2);\n --wcs-error-font-weight: var(--wcs-semantic-font-weight-book);\n\n color: var(--wcs-error-color);\n font-size: var(--wcs-error-font-size);\n font-weight: var(--wcs-error-font-weight);\n}\n","import { Component, ComponentInterface, h, Host } from '@stencil/core';\n\n/**\n * The `wcs-error` should always be wrapped in a `wcs-form-field`.\n * It is used to display a red message under the field indicating an incorrect user input.\n * \n * ## Accessibility guidelines 💡\n * - Provide a relevant error message to inform the users what they should change to make the field valid\n * - Always add the error icon, to ensure the visual indication of the error state other than the color\n * - `aria-description` will be automatically added to the field for screen readers\n * - `aria-invalid=\"true\"` will be automatically added to the field for screen readers\n * \n * @cssprop --wcs-error-color - Color of the text\n * @cssprop --wcs-error-font-size - Font size\n * @cssprop --wcs-error-font-weight - Font weight\n */\n@Component({\n tag: 'wcs-error',\n styleUrl: 'error.scss',\n shadow: true,\n})\nexport class Label implements ComponentInterface {\n render() {\n return (\n <Host aria-live=\"polite\" aria-atomic=\"true\" slot=\"error\">\n <slot />\n </Host>\n );\n }\n}\n",":host {\n --wcs-form-field-gap: var(--wcs-semantic-spacing-small);\n\n --wcs-form-field-prefix-suffix-border-radius: var(--wcs-semantic-border-radius-base);\n\n --wcs-form-field-prefix-icon-color: var(--wcs-semantic-color-foreground-primary);\n --wcs-form-field-prefix-value-color: var(--wcs-semantic-color-text-inverse);\n --wcs-form-field-prefix-placeholder-color: var(--wcs-semantic-color-text-inverse);\n\n // Prefixed select\n ::slotted([slot=prefix]) {\n --wcs-select-value-color: var(--wcs-semantic-color-text-inverse);\n --wcs-select-placeholder-color: var(--wcs-semantic-color-text-inverse);\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-default);\n --wcs-select-control-arrow-color: var(--wcs-form-field-prefix-icon-color);\n --wcs-select-control-border-radius: var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);\n --wcs-select-control-border-width-default: 0;\n --wcs-select-control-border-style-focus: dashed;\n --wcs-select-control-border-color-focus: var(--wcs-semantic-color-border-focus-base);\n\n --wcs-native-select-value-color: var(--wcs-semantic-color-text-inverse);\n --wcs-native-select-placeholder-color: var(--wcs-semantic-color-text-inverse);\n --wcs-native-select-arrow-color: var(--wcs-form-field-prefix-icon-color);\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-default);\n --wcs-native-select-border-width: 0;\n --wcs-native-select-border-color-focus: var(--wcs-semantic-color-border-focus-base);\n --wcs-native-select-border-style-focus: dashed;\n --wcs-native-select-border-radius: var(--wcs-form-field-prefix-suffix-border-radius) 0 0 var(--wcs-form-field-prefix-suffix-border-radius);\n --wcs-native-select-option-color: var(--wcs-semantic-color-text-inverse);\n }\n\n ::slotted([slot=prefix][disabled]),\n ::slotted([slot=prefix]:disabled),\n ::slotted([slot=prefix][aria-disabled=true]),\n ::slotted([slot=prefix][data-disabled]) {\n --wcs-semantic-color-background-control-disabled: var(--wcs-semantic-color-background-action-primary-disabled);\n --wcs-semantic-color-text-disabled: var(--wcs-semantic-color-foreground-disabled);\n\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-disabled);\n --wcs-select-value-color: var(--wcs-semantic-color-text-disabled);\n --wcs-select-placeholder-color: var(--wcs-semantic-color-text-disabled);\n\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-disabled);\n --wcs-native-select-placeholder-color: var(--wcs-semantic-color-text-disabled);\n --wcs-native-select-value-color: var(--wcs-semantic-color-text-disabled);\n }\n\n ::slotted([slot=prefix]:hover:not([disabled]):not([data-disabled])) {\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-hover);\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-hover);\n }\n\n ::slotted([slot=prefix]:active:not([disabled]):not([data-disabled])) {\n --wcs-select-control-background-color: var(--wcs-semantic-color-background-action-primary-press);\n --wcs-native-select-background-color: var(--wcs-semantic-color-background-action-primary-press);\n }\n // endregion\n\n display: flex;\n flex-direction: column;\n gap: var(--wcs-form-field-gap);\n}\n\n.input-container {\n display: flex;\n}\n\n::slotted(wcs-select:not([slot=prefix])) {\n width: 100%;\n}\n\n::slotted(wcs-native-select:not([slot=prefix])) {\n width: 100%;\n}\n\n// Make input square on left side if there is a prefix\n:host(.has-prefix) {\n ::slotted(wcs-input) {\n --wcs-input-border-radius-left: 0;\n }\n}\n\n// Make input square on right side if there is a suffix\n:host(.has-suffix) {\n ::slotted(wcs-input) {\n --wcs-input-border-radius-right: 0;\n }\n}\n\n::slotted([slot=suffix]) {\n // Make button square on left side\n --wcs-button-border-radius: 0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;\n\n // Make select square on left side\n --wcs-select-control-border-radius: 0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0 ;\n\n // Make native select square on left side\n --wcs-native-select-border-radius: 0 var(--wcs-form-field-prefix-suffix-border-radius) var(--wcs-form-field-prefix-suffix-border-radius) 0;\n}\n","import { Component, ComponentInterface, Element, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { isMutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\n/**\n * Form field component wraps the native input element and add some more functionality on top of it.\n *\n * You can use the `wcs-form-field` to wrap any of these components :\n * - `wcs-input`\n * - `wcs-textarea`\n * - `wcs-radio-group`\n * - `wcs-switch`\n * - `wcs-checkbox`\n * - `wcs-native-select`\n * - `wcs-select`\n * - `wcs-counter`\n *\n * For non-supported slotted component, you can use the `required` attribute on the wrapped component to tell the\n * form-field that it is required. It will add a red star after the label of the form field.\n * \n * ## Accessibility guidelines 💡\n * - Each form control should be identified with a unique `wcs-label`\n * - Don't forget to add form validation to make sure the data is correctly formatted\n * - If the `wcs-label` is required, the form control must have the `required` HTML attribute and vice-versa (this is normally automatically set)\n * - The form should not be submittable if at least one required form control is not filled\n * - Hints are optional and should only be used to add extra information\n * - Additional aria attributes put on `<wcs-form-field>` won't inherit onto the native component : you must use the `setAriaAttribute` method.\n * \n * @slot label - Automatically filled when a `wcs-label` is provided\n * @slot <no-name> - The main slot containing the wrapped component\n * @slot prefix - (Optional) Display a component as prefix. See \"Prefix Suffix Group\" story for more info.\n * @slot suffix - (Optional) Display a component as suffix. See \"Prefix Suffix Group\" story for more info.\n * @slot error - Automatically filled when a `wcs-error` is provided\n * @slot messages - Automatically filled when a `wcs-hint` is provided\n *\n * @cssprop --wcs-form-field-gap - Defines the spacing between the label, input control, and hint messages.\n * @cssprop --wcs-form-field-prefix-suffix-border-radius - Sets the border radius for both prefix and suffix elements.\n * \n * @cssprop --wcs-form-field-prefix-background-color-default - Background color default for prefix elements\n * @cssprop --wcs-form-field-prefix-background-color-disabled - Background color for prefix elements when disabled\n * @cssprop --wcs-form-field-prefix-background-color-hover - Background color for prefix elements when hovered\n * @cssprop --wcs-form-field-prefix-border-color-default - Defines the default border color for prefix\n * @cssprop --wcs-form-field-prefix-border-color-focus - Sets the border color for prefix elements when focused.\n * @cssprop --wcs-form-field-prefix-border-color-disabled - Determines the border color for prefix elements when disabled.\n * \n * @cssprop --wcs-form-field-prefix-icon-color - Specifies the color of icons within prefix elements.\n * @cssprop --wcs-form-field-prefix-value-color - Sets the color of values within prefix elements.\n * @cssprop --wcs-form-field-prefix-placeholder-color - Defines the placeholder text color within prefix elements.\n * @cssprop --wcs-form-field-prefix-color-disabled - Determines the text color for prefix elements when disabled.\n */\n@Component({\n tag: 'wcs-form-field',\n styleUrl: 'form-field.scss',\n shadow: true,\n})\nexport class FormField implements ComponentInterface {\n @Element() private el!: HTMLWcsFormFieldElement;\n\n /**\n * Specifies whether the form field is in an error state. Displays the field border in red and the message contained in the wcs-error component\n */\n @Prop({mutable: true, reflect: true}) isError = false;\n\n @State() private hasPrefix = false;\n @State() private hasSuffix = false;\n @State() private spiedElement: Element;\n\n private observer: MutationObserver;\n\n componentWillLoad() {\n this.hasSuffix = this.el.querySelector('wcs-button') !== null;\n this.hasPrefix = this.el.querySelector('wcs-select') !== null;\n }\n\n componentDidLoad() {\n this.initSpiedElement();\n this.addRequiredMarkerToLabel();\n this.updateErrorStateOnInput(this.isError);\n }\n\n @Watch('isError')\n // @ts-ignore\n private isErrorChange(newValue: boolean) {\n this.updateErrorStateOnInput(newValue);\n this.updateAriaAttributes();\n }\n\n private updateErrorStateOnInput(newValue: boolean) {\n if (this.spiedElementIsOfType('wcs-input', 'wcs-textarea')) {\n if (newValue) {\n this.spiedElement.setAttribute('state', 'error');\n } else {\n this.spiedElement.setAttribute('state', 'initial');\n }\n }\n }\n\n /**\n * This function return true if the form field contains an element with tagName matches a value of the types param\n * @param types\n * @private\n */\n private spiedElementIsOfType(...types: string[]): boolean {\n for (const type of types) {\n if (this.spiedElement?.tagName === type.toUpperCase()) return true;\n }\n return false\n }\n\n\n private addRequiredMarkerToLabel() {\n // TODO: deprecate this in favor of the 'required' component attribute\n const label = this.el.querySelector('wcs-label');\n this.observer = new MutationObserver(mutations => {\n const requiredAttMutation = mutations.filter(m => m.attributeName === 'required')[0];\n if (requiredAttMutation) {\n this.updateLabelRequiredFlag(this.spiedElement?.hasAttribute('required'), label);\n }\n });\n if (this.spiedElement) {\n this.observer.observe(this.spiedElement, {attributes: true});\n }\n\n const isRequired = this.spiedElement?.hasAttribute('required');\n this.updateLabelRequiredFlag(isRequired, label);\n }\n\n\n private initSpiedElement() {\n const SUPPORTED_COMPONENTS = ['wcs-input', 'wcs-select', 'wcs-native-select', 'wcs-textarea', 'wcs-radio-group', 'wcs-switch', 'wcs-checkbox', 'wcs-native-select', 'wcs-counter'];\n\n this.spiedElement = (this.el.shadowRoot.querySelector('slot:not([name])') as HTMLSlotElement)\n ?.assignedElements()\n .filter(n => [...SUPPORTED_COMPONENTS, 'SLOT'].map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0];\n\n // If the component is used in another web component\n if (this.spiedElement?.tagName === 'SLOT') {\n this.spiedElement = ((this.spiedElement as HTMLSlotElement)\n .assignedElements()\n .filter(n => SUPPORTED_COMPONENTS.map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0]) as HTMLElement;\n }\n\n if (!this.spiedElement) {\n // tslint:disable-next-line:no-console\n console.warn('Form-field component support only ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component.');\n return;\n }\n }\n \n private updateAriaAttributes(): void {\n if(isMutableAriaAttribute(this.spiedElement)) {\n this.spiedElement.setAriaAttribute('aria-label', this.label);\n\n // Sur les autres DS, généralement seul l'erreur est affichée et pas avec la description\n if(this.isError) {\n if(this.error) this.spiedElement.setAriaAttribute('aria-description', this.error);\n this.spiedElement.setAriaAttribute('aria-invalid', 'true');\n } else {\n if(this.description) this.spiedElement.setAriaAttribute('aria-description', this.description);\n this.spiedElement.setAriaAttribute('aria-invalid', 'false');\n }\n }\n }\n \n private get label() {\n return this.el.querySelector('wcs-label')?.textContent;\n }\n \n private get description() {\n return this.el.querySelector('wcs-hint')?.textContent;\n }\n \n private get error() {\n return this.el.querySelector('wcs-error')?.textContent;\n }\n\n private updateLabelRequiredFlag(isRequired: boolean, label: Element) {\n if (isRequired && label) {\n label.setAttribute('required', 'true');\n } else if (!isRequired && label) {\n label.removeAttribute('required');\n }\n }\n\n disconnectedCallback() {\n this.observer?.disconnect();\n }\n\n render() {\n let classes = '';\n const isError = this.isError;\n\n if (this.hasSuffix) {\n classes += ' has-suffix';\n }\n if (this.hasPrefix) {\n classes += ' has-prefix';\n }\n return (\n <Host class={classes}>\n <slot name=\"label\"/>\n <div class=\"input-container\">\n <slot name=\"prefix\"/>\n <slot onSlotchange={() => this.onFormInputSlotChange()}/>\n <slot name=\"suffix\"/>\n </div>\n {\n isError ? (<slot name=\"error\"/>) : ''\n }\n <slot name=\"messages\"/>\n </Host>\n );\n }\n\n private onFormInputSlotChange() {\n this.initSpiedElement();\n this.updateAriaAttributes()\n this.addRequiredMarkerToLabel();\n this.updateErrorStateOnInput(this.isError);\n }\n}\n"],"version":3}
@@ -1,29 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-d9de61ce.js';
2
- import { i as inheritAriaAttributes, a as inheritAttributes, s as setOrRemoveAttribute } from './helpers-f137ec8d.js';
3
-
4
- const labelCss = ":host{--wcs-label-font-weight:var(--wcs-semantic-font-weight-book);--wcs-label-color:var(--wcs-semantic-color-text-primary);--wcs-label-required-marker-color:var(--wcs-semantic-color-text-critical);--wcs-label-gap:var(--wcs-semantic-spacing-small);font-weight:var(--wcs-label-font-weight)}:host([required])>label::after{font-weight:var(--wcs-label-font-weight);color:var(--wcs-label-required-marker-color);content:\" *\"}label{display:inline-block;color:var(--wcs-label-color);font-weight:var(--wcs-label-font-weight)}label ::slotted(wcs-mat-icon){display:inline;vertical-align:middle;margin-left:var(--wcs-label-gap)}";
5
- const WcsLabelStyle0 = labelCss;
6
-
7
- const LABEL_INHERITED_ATTRS = ['title'];
8
- const Label = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.inheritedAttributes = {};
12
- this.required = false;
13
- }
14
- componentWillLoad() {
15
- this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes(this.el, LABEL_INHERITED_ATTRS));
16
- }
17
- async setAriaAttribute(attr, value) {
18
- setOrRemoveAttribute(this.nativeLabel, attr, value);
19
- }
20
- render() {
21
- return (h(Host, { key: '112bfe1eddc6da7b457bf183c83a07a60de0ca00', slot: "label" }, h("label", Object.assign({ key: '0d32dfcc8b4f024f986d7770a52402ae024c8862', ref: (el) => this.nativeLabel = el }, this.inheritedAttributes), h("slot", { key: '74c93cbd04d6744c2427f4810d510f05faa2bbfc' }))));
22
- }
23
- get el() { return getElement(this); }
24
- };
25
- Label.style = WcsLabelStyle0;
26
-
27
- export { Label as wcs_label };
28
-
29
- //# sourceMappingURL=wcs-label.entry.js.map