@spw-ds/spw-stencil-library 1.2.4 → 1.2.5

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 (212) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/spw-button.spw-loading.entry.cjs.js.map +1 -1
  3. package/dist/cjs/spw-button_2.cjs.entry.js +1 -1
  4. package/dist/cjs/spw-button_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/spw-custom-select.cjs.entry.js +43 -7
  6. package/dist/cjs/spw-custom-select.cjs.entry.js.map +1 -1
  7. package/dist/cjs/spw-custom-select.entry.cjs.js.map +1 -1
  8. package/dist/cjs/spw-date-picker.cjs.entry.js +48 -28
  9. package/dist/cjs/spw-date-picker.cjs.entry.js.map +1 -1
  10. package/dist/cjs/spw-date-picker.entry.cjs.js.map +1 -1
  11. package/dist/cjs/spw-field-label.spw-group.spw-icon.spw-link.spw-separator.spw-theme-provider.entry.cjs.js.map +1 -1
  12. package/dist/cjs/spw-field-label_6.cjs.entry.js +1 -1
  13. package/dist/cjs/spw-field-label_6.cjs.entry.js.map +1 -1
  14. package/dist/cjs/spw-pagination.cjs.entry.js +26 -16
  15. package/dist/cjs/spw-pagination.cjs.entry.js.map +1 -1
  16. package/dist/cjs/spw-pagination.entry.cjs.js.map +1 -1
  17. package/dist/cjs/spw-search-field.cjs.entry.js +12 -2
  18. package/dist/cjs/spw-search-field.cjs.entry.js.map +1 -1
  19. package/dist/cjs/spw-search-field.entry.cjs.js.map +1 -1
  20. package/dist/cjs/spw-select.cjs.entry.js +3 -1
  21. package/dist/cjs/spw-select.cjs.entry.js.map +1 -1
  22. package/dist/cjs/spw-select.entry.cjs.js.map +1 -1
  23. package/dist/cjs/spw-stencil-library.cjs.js +1 -1
  24. package/dist/cjs/spw-table-cell.cjs.entry.js +23 -2
  25. package/dist/cjs/spw-table-cell.cjs.entry.js.map +1 -1
  26. package/dist/cjs/spw-table-cell.entry.cjs.js.map +1 -1
  27. package/dist/cjs/spw-table-footer.cjs.entry.js +1 -1
  28. package/dist/cjs/spw-table-footer.cjs.entry.js.map +1 -1
  29. package/dist/cjs/spw-table-footer.entry.cjs.js.map +1 -1
  30. package/dist/cjs/spw-table-header.cjs.entry.js +33 -3
  31. package/dist/cjs/spw-table-header.cjs.entry.js.map +1 -1
  32. package/dist/cjs/spw-table-header.entry.cjs.js.map +1 -1
  33. package/dist/cjs/spw-table-row.cjs.entry.js +34 -2
  34. package/dist/cjs/spw-table-row.cjs.entry.js.map +1 -1
  35. package/dist/cjs/spw-table-row.entry.cjs.js.map +1 -1
  36. package/dist/cjs/spw-table.cjs.entry.js +26 -3
  37. package/dist/cjs/spw-table.cjs.entry.js.map +1 -1
  38. package/dist/cjs/spw-table.entry.cjs.js.map +1 -1
  39. package/dist/cjs/utils-D_vNTY6w.js.map +1 -1
  40. package/dist/collection/components/spw-button/spw-button.css +1 -1
  41. package/dist/collection/components/spw-custom-select/spw-custom-select.css +1 -1
  42. package/dist/collection/components/spw-custom-select/spw-custom-select.js +42 -6
  43. package/dist/collection/components/spw-custom-select/spw-custom-select.js.map +1 -1
  44. package/dist/collection/components/spw-date-picker/spw-date-picker.js +48 -28
  45. package/dist/collection/components/spw-date-picker/spw-date-picker.js.map +1 -1
  46. package/dist/collection/components/spw-link/spw-link.css +1 -1
  47. package/dist/collection/components/spw-pagination/spw-pagination.css +1 -1
  48. package/dist/collection/components/spw-pagination/spw-pagination.js +54 -13
  49. package/dist/collection/components/spw-pagination/spw-pagination.js.map +1 -1
  50. package/dist/collection/components/spw-search-field/spw-search-field.js +50 -2
  51. package/dist/collection/components/spw-search-field/spw-search-field.js.map +1 -1
  52. package/dist/collection/components/spw-select/spw-select.js +3 -1
  53. package/dist/collection/components/spw-select/spw-select.js.map +1 -1
  54. package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.css +1 -1
  55. package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.js +82 -1
  56. package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.js.map +1 -1
  57. package/dist/collection/components/spw-table/spw-table-footer/spw-table-footer.css +1 -1
  58. package/dist/collection/components/spw-table/spw-table-header/spw-table-header.css +1 -1
  59. package/dist/collection/components/spw-table/spw-table-header/spw-table-header.js +92 -2
  60. package/dist/collection/components/spw-table/spw-table-header/spw-table-header.js.map +1 -1
  61. package/dist/collection/components/spw-table/spw-table-row/spw-table-row.css +1 -1
  62. package/dist/collection/components/spw-table/spw-table-row/spw-table-row.js +66 -1
  63. package/dist/collection/components/spw-table/spw-table-row/spw-table-row.js.map +1 -1
  64. package/dist/collection/components/spw-table/spw-table.js +27 -2
  65. package/dist/collection/components/spw-table/spw-table.js.map +1 -1
  66. package/dist/collection/stories/organisms/spw-footer/spw-footer.stories.js +1 -1
  67. package/dist/collection/stories/organisms/spw-footer/spw-footer.stories.js.map +1 -1
  68. package/dist/collection/utils/utils.js +47 -48
  69. package/dist/collection/utils/utils.js.map +1 -1
  70. package/dist/components/{p-du-Bai6S.js → p-B2toBmC2.js} +32 -21
  71. package/dist/components/p-B2toBmC2.js.map +1 -0
  72. package/dist/components/p-BBi01mKM.js.map +1 -1
  73. package/dist/components/{p-AjhBdYbk.js → p-DjyPtAVX.js} +3 -3
  74. package/dist/components/p-DjyPtAVX.js.map +1 -0
  75. package/dist/components/{p-CNNUoO2J.js → p-qROlK2WR.js} +3 -3
  76. package/dist/components/p-qROlK2WR.js.map +1 -0
  77. package/dist/components/spw-breadcrumb-item.js +1 -1
  78. package/dist/components/spw-button.js +1 -1
  79. package/dist/components/spw-cookies.js +1 -1
  80. package/dist/components/spw-custom-select.js +43 -7
  81. package/dist/components/spw-custom-select.js.map +1 -1
  82. package/dist/components/spw-date-picker.js +48 -28
  83. package/dist/components/spw-date-picker.js.map +1 -1
  84. package/dist/components/spw-file-upload.js +1 -1
  85. package/dist/components/spw-header-lang.js +1 -1
  86. package/dist/components/spw-header.js +1 -1
  87. package/dist/components/spw-iodda.js +1 -1
  88. package/dist/components/spw-link.js +1 -1
  89. package/dist/components/spw-message.js +1 -1
  90. package/dist/components/spw-pagination.js +1 -1
  91. package/dist/components/spw-search-field.js +15 -4
  92. package/dist/components/spw-search-field.js.map +1 -1
  93. package/dist/components/spw-select.js +3 -1
  94. package/dist/components/spw-select.js.map +1 -1
  95. package/dist/components/spw-table-cell.js +26 -2
  96. package/dist/components/spw-table-cell.js.map +1 -1
  97. package/dist/components/spw-table-footer.js +1 -1
  98. package/dist/components/spw-table-footer.js.map +1 -1
  99. package/dist/components/spw-table-header.js +37 -4
  100. package/dist/components/spw-table-header.js.map +1 -1
  101. package/dist/components/spw-table-row.js +39 -3
  102. package/dist/components/spw-table-row.js.map +1 -1
  103. package/dist/components/spw-table.js +28 -4
  104. package/dist/components/spw-table.js.map +1 -1
  105. package/dist/components_json.json +268 -12
  106. package/dist/components_vscode.json +3088 -0
  107. package/dist/esm/loader.js +1 -1
  108. package/dist/esm/spw-button.spw-loading.entry.js.map +1 -1
  109. package/dist/esm/spw-button_2.entry.js +1 -1
  110. package/dist/esm/spw-button_2.entry.js.map +1 -1
  111. package/dist/esm/spw-custom-select.entry.js +43 -7
  112. package/dist/esm/spw-custom-select.entry.js.map +1 -1
  113. package/dist/esm/spw-date-picker.entry.js +48 -28
  114. package/dist/esm/spw-date-picker.entry.js.map +1 -1
  115. package/dist/esm/spw-field-label.spw-group.spw-icon.spw-link.spw-separator.spw-theme-provider.entry.js.map +1 -1
  116. package/dist/esm/spw-field-label_6.entry.js +1 -1
  117. package/dist/esm/spw-field-label_6.entry.js.map +1 -1
  118. package/dist/esm/spw-pagination.entry.js +26 -16
  119. package/dist/esm/spw-pagination.entry.js.map +1 -1
  120. package/dist/esm/spw-search-field.entry.js +13 -3
  121. package/dist/esm/spw-search-field.entry.js.map +1 -1
  122. package/dist/esm/spw-select.entry.js +3 -1
  123. package/dist/esm/spw-select.entry.js.map +1 -1
  124. package/dist/esm/spw-stencil-library.js +1 -1
  125. package/dist/esm/spw-table-cell.entry.js +23 -2
  126. package/dist/esm/spw-table-cell.entry.js.map +1 -1
  127. package/dist/esm/spw-table-footer.entry.js +1 -1
  128. package/dist/esm/spw-table-footer.entry.js.map +1 -1
  129. package/dist/esm/spw-table-header.entry.js +33 -3
  130. package/dist/esm/spw-table-header.entry.js.map +1 -1
  131. package/dist/esm/spw-table-row.entry.js +35 -3
  132. package/dist/esm/spw-table-row.entry.js.map +1 -1
  133. package/dist/esm/spw-table.entry.js +26 -3
  134. package/dist/esm/spw-table.entry.js.map +1 -1
  135. package/dist/esm/utils-BBi01mKM.js.map +1 -1
  136. package/dist/spw-stencil-library/p-0f69442e.entry.js +2 -0
  137. package/dist/spw-stencil-library/p-0f69442e.entry.js.map +1 -0
  138. package/dist/spw-stencil-library/p-14722019.entry.js +2 -0
  139. package/dist/spw-stencil-library/p-14722019.entry.js.map +1 -0
  140. package/dist/spw-stencil-library/{p-b1de48f3.entry.js → p-152525de.entry.js} +2 -2
  141. package/dist/spw-stencil-library/p-152525de.entry.js.map +1 -0
  142. package/dist/spw-stencil-library/p-2ad00dfc.entry.js +2 -0
  143. package/dist/spw-stencil-library/p-2ad00dfc.entry.js.map +1 -0
  144. package/dist/spw-stencil-library/p-4a273848.entry.js +2 -0
  145. package/dist/spw-stencil-library/p-4a273848.entry.js.map +1 -0
  146. package/dist/spw-stencil-library/{p-31793077.entry.js → p-5632f307.entry.js} +2 -2
  147. package/dist/spw-stencil-library/p-5632f307.entry.js.map +1 -0
  148. package/dist/spw-stencil-library/p-5e43e2ed.entry.js +2 -0
  149. package/dist/spw-stencil-library/p-5e43e2ed.entry.js.map +1 -0
  150. package/dist/spw-stencil-library/p-92583499.entry.js +2 -0
  151. package/dist/spw-stencil-library/p-92583499.entry.js.map +1 -0
  152. package/dist/spw-stencil-library/p-9d760073.entry.js +2 -0
  153. package/dist/spw-stencil-library/p-9d760073.entry.js.map +1 -0
  154. package/dist/spw-stencil-library/p-9e8a779e.entry.js +2 -0
  155. package/dist/spw-stencil-library/p-9e8a779e.entry.js.map +1 -0
  156. package/dist/spw-stencil-library/p-BBi01mKM.js.map +1 -1
  157. package/dist/spw-stencil-library/p-c4e4cfd4.entry.js +2 -0
  158. package/dist/spw-stencil-library/p-c4e4cfd4.entry.js.map +1 -0
  159. package/dist/spw-stencil-library/{p-f7760a47.entry.js → p-fcc5884a.entry.js} +2 -2
  160. package/dist/spw-stencil-library/p-fcc5884a.entry.js.map +1 -0
  161. package/dist/spw-stencil-library/spw-button.spw-loading.entry.esm.js.map +1 -1
  162. package/dist/spw-stencil-library/spw-custom-select.entry.esm.js.map +1 -1
  163. package/dist/spw-stencil-library/spw-date-picker.entry.esm.js.map +1 -1
  164. package/dist/spw-stencil-library/spw-field-label.spw-group.spw-icon.spw-link.spw-separator.spw-theme-provider.entry.esm.js.map +1 -1
  165. package/dist/spw-stencil-library/spw-pagination.entry.esm.js.map +1 -1
  166. package/dist/spw-stencil-library/spw-search-field.entry.esm.js.map +1 -1
  167. package/dist/spw-stencil-library/spw-select.entry.esm.js.map +1 -1
  168. package/dist/spw-stencil-library/spw-stencil-library.esm.js +1 -1
  169. package/dist/spw-stencil-library/spw-table-cell.entry.esm.js.map +1 -1
  170. package/dist/spw-stencil-library/spw-table-footer.entry.esm.js.map +1 -1
  171. package/dist/spw-stencil-library/spw-table-header.entry.esm.js.map +1 -1
  172. package/dist/spw-stencil-library/spw-table-row.entry.esm.js.map +1 -1
  173. package/dist/spw-stencil-library/spw-table.entry.esm.js.map +1 -1
  174. package/dist/stats.json +611 -150
  175. package/dist/types/components/spw-custom-select/spw-custom-select.d.ts +3 -0
  176. package/dist/types/components/spw-date-picker/spw-date-picker.d.ts +1 -0
  177. package/dist/types/components/spw-pagination/spw-pagination.d.ts +4 -1
  178. package/dist/types/components/spw-search-field/spw-search-field.d.ts +5 -0
  179. package/dist/types/components/spw-select/spw-select.d.ts +1 -0
  180. package/dist/types/components/spw-table/spw-table-cell/spw-table-cell.d.ts +6 -0
  181. package/dist/types/components/spw-table/spw-table-header/spw-table-header.d.ts +6 -0
  182. package/dist/types/components/spw-table/spw-table-row/spw-table-row.d.ts +8 -0
  183. package/dist/types/components/spw-table/spw-table.d.ts +2 -0
  184. package/dist/types/components.d.ts +83 -0
  185. package/dist/types/utils/utils.d.ts +2 -1
  186. package/hydrate/index.js +265 -72
  187. package/hydrate/index.mjs +265 -72
  188. package/package.json +1 -1
  189. package/dist/components/p-AjhBdYbk.js.map +0 -1
  190. package/dist/components/p-CNNUoO2J.js.map +0 -1
  191. package/dist/components/p-du-Bai6S.js.map +0 -1
  192. package/dist/spw-stencil-library/p-22f972ca.entry.js +0 -2
  193. package/dist/spw-stencil-library/p-22f972ca.entry.js.map +0 -1
  194. package/dist/spw-stencil-library/p-2c28684f.entry.js +0 -2
  195. package/dist/spw-stencil-library/p-2c28684f.entry.js.map +0 -1
  196. package/dist/spw-stencil-library/p-31793077.entry.js.map +0 -1
  197. package/dist/spw-stencil-library/p-4c21a696.entry.js +0 -2
  198. package/dist/spw-stencil-library/p-4c21a696.entry.js.map +0 -1
  199. package/dist/spw-stencil-library/p-572188ac.entry.js +0 -2
  200. package/dist/spw-stencil-library/p-572188ac.entry.js.map +0 -1
  201. package/dist/spw-stencil-library/p-823b60ae.entry.js +0 -2
  202. package/dist/spw-stencil-library/p-823b60ae.entry.js.map +0 -1
  203. package/dist/spw-stencil-library/p-b1de48f3.entry.js.map +0 -1
  204. package/dist/spw-stencil-library/p-d115a739.entry.js +0 -2
  205. package/dist/spw-stencil-library/p-d115a739.entry.js.map +0 -1
  206. package/dist/spw-stencil-library/p-d2258e0a.entry.js +0 -2
  207. package/dist/spw-stencil-library/p-d2258e0a.entry.js.map +0 -1
  208. package/dist/spw-stencil-library/p-ecec4588.entry.js +0 -2
  209. package/dist/spw-stencil-library/p-ecec4588.entry.js.map +0 -1
  210. package/dist/spw-stencil-library/p-f5caed11.entry.js +0 -2
  211. package/dist/spw-stencil-library/p-f5caed11.entry.js.map +0 -1
  212. package/dist/spw-stencil-library/p-f7760a47.entry.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{r as e,c as t,h as s}from"./p-CvfVJV8a.js";const i="/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-custom-select{position:relative}.spw-custom-select__container{align-items:center;background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:4px;display:flex;height:40px;justify-content:space-between;line-height:40px;padding:0 12px;width:100%}.spw-custom-select__container:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-custom-select__container:focus-visible,.spw-custom-select__container:focus-within{box-shadow:0 0 0 6px #000;outline:3px solid #fff;outline-offset:0}.spw-custom-select--disabled .spw-custom-select__container{background:var(--spw-color-themes-grey-grey-100);border-color:var(--spw-color-themes-grey-grey-400);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-custom-select--disabled .spw-custom-select__container::-moz-placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container:focus,.spw-custom-select--disabled .spw-custom-select__container:focus-visible,.spw-custom-select--disabled .spw-custom-select__container:hover{outline:none}.spw-custom-select--is-error .spw-custom-select__container{border-color:var(--spw-colors-states-error-error-300)}.spw-custom-select--large .spw-custom-select__container{height:60px;line-height:60px;padding:0 24px}.spw-custom-select--is-opened .spw-custom-select__container{border-bottom-color:transparent;border-radius:4px 4px 0 0;height:auto;line-height:1;min-height:40px}.spw-custom-select__selected{flex:1;max-width:100%;padding-right:30px}.spw-custom-select__selected-item{align-items:center;background:var(--spw-color-themes-grey-grey-200);border:1px solid var(--spw-color-themes-grey-grey-900);border-radius:999px;color:var(--spw-color-themes-grey-grey-900);display:inline-flex;font-size:14px;gap:6px;height:24px;line-height:24px;margin:4px 6px 2px 0;padding:0 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.spw-custom-select__selected-items{text-wrap:nowrap;flex:1;overflow:hidden;text-overflow:ellipsis}.spw-custom-select--is-opened .spw-custom-select__selected-items{text-wrap:initial;overflow:visible;padding-bottom:4px;padding-top:3px;text-overflow:clip}.spw-custom-select__arrow{color:var(--spw-color-themes-grey-grey-600);font-size:16px;pointer-events:none;position:absolute;right:12px;top:10px}.spw-custom-select__wrapper{position:relative}.spw-custom-select--is-opened .spw-custom-select__search{left:0;margin-top:1px;position:absolute;top:0;width:100%;z-index:11}.spw-custom-select--has-value.spw-custom-select--is-opened .spw-custom-select__search{margin-top:-3px;top:auto;top:100%}.spw-custom-select__search-input{border:none;height:38px;line-height:40px;margin:0;padding:0;text-overflow:ellipsis;width:calc(100% - 30px)}.spw-custom-select__search-input:focus{outline:none}.spw-custom-select--is-opened .spw-custom-select__search-input{border-left:1px solid var(--spw-color-themes-grey-grey-800);padding:0 12px}.spw-custom-select--is-opened.spw-custom-select--has-value .spw-custom-select__search-input{border-right:1px solid var(--spw-color-themes-grey-grey-800);width:100%}.spw-custom-select__options{background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:0 0 4px 4px;max-height:200px;overflow-y:auto;position:absolute;width:100%;z-index:12}.spw-custom-select__options--down,.spw-custom-select__options--up{top:100%;transform:translateY(0)}.spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) .spw-custom-select__options{margin-top:35px}.spw-custom-select__no-results{color:var(--spw-color-themes-grey-grey-600);cursor:not-allowed;padding:12px}.spw-custom-select__option{border-bottom:1px solid var(--spw-color-themes-grey-grey-900);cursor:pointer;padding:12px}.spw-custom-select__option:hover{background-color:var(--spw-color-themes-grey-grey-200)}.spw-custom-select__option:last-child{border-bottom:none}.spw-custom-select__option--selected{font-weight:700}.spw-custom-select__option--disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.spw-custom-select__option--disabled:hover{background-color:transparent}.spw-custom-select__error{color:var(--spw-color-themes-grey-grey-600);display:block;font-size:12px;margin-top:8px}.spw-custom-select__option--focused{background-color:var(--spw-color-themes-grey-grey-300)}.-spw-tw-mt-1{margin-top:-.25rem}.spw-tw-mb-2{margin-bottom:.5rem}.spw-tw-mr-2{margin-right:.5rem}";const o=class{constructor(s){e(this,s);this.valueChanged=t(this,"valueChanged",7);if(s.$hostElement$["s-ei"]){this.internals=s.$hostElement$["s-ei"]}else{this.internals=s.$hostElement$.attachInternals();s.$hostElement$["s-ei"]=this.internals}this.isOpen=false;this.parsedOptions=[];this.focusedOptionIndex=null;this.searchText="";this.dropdownDirection="down";this.hasSelectedValue=false;this.value=[];this.label="";this.placeholder="Sélectionnez une option";this.required=false;this.size="medium";this.multiple=false;this.isSearch=false;this.error="";this.hint="";this.success="";this.warning="";this.showErrorIcon=true;this.showHintIcon=true;this.showSuccessIcon=true;this.showWarningIcon=true;this.handleOtherSelectOpened=e=>{if(e.detail.instance!==this.host&&this.isOpen){this.closeDropdown()}};this.handleClickOutside=e=>{var t,s;if(this.isOpen){const i=e.composedPath()[0];const o=this.host.contains(i);const r=(t=this.host.shadowRoot)===null||t===void 0?void 0:t.querySelector(".spw-custom-select__search-input");const n=r===null||r===void 0?void 0:r.contains(i);if(!o&&!n){if(this.multiple){const e=(s=this.host.shadowRoot)===null||s===void 0?void 0:s.querySelector(".spw-custom-select__options");if(e&&e.contains(i)){return}}this.closeDropdown()}}}}componentWillLoad(){if(this.multiple){if(typeof this.value==="string"){try{this.internalValue=JSON.parse(this.value)}catch(e){this.internalValue=[]}}else if(Array.isArray(this.value)){this.internalValue=this.value}else{this.internalValue=[]}}else{this.internalValue=this.value}if(this.items){this.parseOptions(this.items)}this.updateSelectedOption()}async resetSelect(){if(this.multiple){this.internalValue=[];this.value=[]}else{this.internalValue="";this.value=""}this.searchText="";this.focusedOptionIndex=null;this.internals.setFormValue(this.getFormValue());this.valueChanged.emit(this.internalValue);this.updateSelectedOption()}formResetCallback(){this.resetSelect()}componentDidLoad(){document.addEventListener("click",this.handleClickOutside);document.addEventListener("spw-custom-select-opened",this.handleOtherSelectOpened);this.internals.setFormValue(this.getFormValue())}disconnectedCallback(){document.removeEventListener("click",this.handleClickOutside);document.removeEventListener("spw-custom-select-opened",this.handleOtherSelectOpened)}parseOptions(e){try{if(Array.isArray(e)){this.parsedOptions=e.map((e=>({value:e.value,label:e.label,disabled:e.disabled||false})))}else if(typeof e==="string"){this.parsedOptions=JSON.parse(e).map((e=>({value:e.value,label:e.label,disabled:e.disabled||false})))}else{this.parsedOptions=[]}this.updateSelectedOption()}catch(e){this.parsedOptions=[]}}valueChangedHandler(e){if(this.multiple){this.internalValue=Array.isArray(e)?e:[e]}else{this.internalValue=e}this.updateSelectedOption();this.internals.setFormValue(this.getFormValue());this.valueChanged.emit(this.internalValue)}updateSelectedOption(){this.internals.setFormValue(this.getFormValue());if(!this.multiple&&this.internalValue!==undefined){this.focusedOptionIndex=this.parsedOptions.findIndex((e=>String(e.value)===String(this.internalValue)))}else if(this.multiple&&Array.isArray(this.internalValue)){this.internalValue=this.internalValue.filter((e=>this.parsedOptions.some((t=>String(t.value)===String(e))))).sort(((e,t)=>this.parsedOptions.findIndex((t=>String(t.value)===String(e)))-this.parsedOptions.findIndex((e=>String(e.value)===String(t)))))}}internalValueChanged(){this.hasSelectedValue=Array.isArray(this.internalValue)?this.internalValue.length>0:Boolean(this.internalValue)}getFormValue(){if(this.multiple){return Array.isArray(this.internalValue)&&this.internalValue.length>0?this.internalValue.map((e=>String(e))).join(","):null}return this.internalValue?String(this.internalValue):null}toggleDropdown(e){if(!this.disabled){if(e){const t=e.composedPath()[0];if(t.classList.contains("spw-custom-select__search-input")){return}e.stopPropagation()}this.determineDropdownDirection();const t=this.isOpen;this.isOpen=!this.isOpen;if(this.isOpen&&!t){this.notifyOtherSelects()}if(!this.isOpen){this.focusedOptionIndex=null}}}notifyOtherSelects(){const e=new CustomEvent("spw-custom-select-opened",{detail:{instance:this.host},bubbles:true,composed:true});document.dispatchEvent(e)}determineDropdownDirection(){const e=this.selectContainer.getBoundingClientRect();const t=window.innerHeight;if(e.bottom+200>t&&e.top>200){this.dropdownDirection="up"}else{this.dropdownDirection="down"}}openDropdownWithKeyboard(){this.determineDropdownDirection();this.isOpen=true;this.focusedOptionIndex=0;this.notifyOtherSelects()}closeDropdown(){this.isOpen=false;this.focusedOptionIndex=null;this.searchText=""}selectOption(e,t){if(t){t.stopPropagation()}const s=this.parsedOptions.find((t=>String(t.value)===String(e)));if(s===null||s===void 0?void 0:s.disabled){return}if(this.multiple){const t=this.internalValue.findIndex((t=>String(t)===String(e)));if(t>-1){this.internalValue=[...this.internalValue.slice(0,t),...this.internalValue.slice(t+1)]}else{this.internalValue=[...this.internalValue,e]}this.internalValue=this.internalValue.sort(((e,t)=>this.parsedOptions.findIndex((t=>String(t.value)===String(e)))-this.parsedOptions.findIndex((e=>String(e.value)===String(t)))))}else{this.internalValue=e;this.closeDropdown()}this.value=this.internalValue;this.internals.setFormValue(this.getFormValue());this.valueChanged.emit(this.internalValue);this.updateSelectedOption()}handleOptionKeyDown(e,t){if(e.key==="Enter"||e.key===" "){e.preventDefault();this.selectOption(t)}}handleKeyDown(e){var t,s;if(e.target.classList.contains("spw-custom-select__search-input")){return}switch(e.key){case" ":e.preventDefault();if(!this.isOpen){this.openDropdownWithKeyboard()}break;case"ArrowDown":e.preventDefault();if(this.isOpen){let e=this.focusedOptionIndex===null?0:(this.focusedOptionIndex+1)%this.parsedOptions.length;while(((t=this.parsedOptions[e])===null||t===void 0?void 0:t.disabled)&&e!==this.focusedOptionIndex){e=(e+1)%this.parsedOptions.length}this.focusedOptionIndex=e}else{this.openDropdownWithKeyboard()}break;case"ArrowUp":e.preventDefault();if(this.isOpen){let e=this.focusedOptionIndex===null?this.parsedOptions.length-1:(this.focusedOptionIndex-1+this.parsedOptions.length)%this.parsedOptions.length;while(((s=this.parsedOptions[e])===null||s===void 0?void 0:s.disabled)&&e!==this.focusedOptionIndex){e=(e-1+this.parsedOptions.length)%this.parsedOptions.length}this.focusedOptionIndex=e}break;case"Enter":e.preventDefault();if(this.isOpen&&this.focusedOptionIndex!==null){this.selectOption(this.parsedOptions[this.focusedOptionIndex].value)}break;case"Escape":if(this.isOpen){this.closeDropdown()}break}}renderErrorMessage(){if(this.error){return s("spw-field-message",{variant:"error",showIcon:this.showErrorIcon},this.error)}}renderHintMessage(){if(this.hint){return s("spw-field-message",{variant:"hint",showIcon:this.showHintIcon},this.hint)}}renderWarningMessage(){if(this.warning){return s("spw-field-message",{variant:"warning",showIcon:this.showWarningIcon},this.warning)}}renderSuccessMessage(){if(this.success){return s("spw-field-message",{variant:"success",showIcon:this.showSuccessIcon},this.success)}}get elementClass(){return{"spw-custom-select":true,[`spw-custom-select--${this.size}`]:true,"spw-custom-select--is-error":!!this.error,"spw-custom-select--disabled":this.disabled,"spw-custom-select--is-opened":this.isOpen,"spw-custom-select--has-value":this.hasSelectedValue,"spw-custom-select--no-value":!this.hasSelectedValue,"spw-custom-select--is-searchable":this.isSearch,"spw-custom-select--not-searchable":!this.isSearch}}normalizeString(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}getSelectedLabels(){if(this.multiple){return Array.isArray(this.internalValue)&&this.internalValue.length>0?this.internalValue.map((e=>{var t;return(t=this.parsedOptions.find((t=>String(t.value)===String(e))))===null||t===void 0?void 0:t.label})).filter(Boolean).join(", "):null}else{const e=this.parsedOptions.find((e=>String(e.value)===String(this.internalValue)));return e?e.label:null}}getFilteredOptions(){const e=this.normalizeString(this.searchText);return this.parsedOptions.filter((t=>this.normalizeString(t.label).includes(e)))}handleSearchInput(e){const t=e.target;this.searchText=t.value;this.focusedOptionIndex=0;if(!this.isOpen){this.isOpen=true;this.notifyOtherSelects()}}isSearchVisible(){if(!this.isSearch)return false;if(!this.hasSelectedValue&&!this.isOpen)return true;if(this.isSearch&&this.isOpen)return true;return this.isOpen}showPlaceholder(){if(this.isSearch)return false;if(this.hasSelectedValue)return false;return true}render(){const e=this.getFilteredOptions();const t=this.showPlaceholder();return s("div",{key:"a2e9fb9f19b299dfde36cc0562ee8d3e82441aae",class:this.elementClass,ref:e=>this.host=e},this.label&&s("spw-field-label",{key:"624c8188f2a36b66febcfd7c8a2d22e646490d56",label:this.label,name:this.name,required:this.required}),this.assistiveText&&s("spw-field-message",{key:"d1e74cf86c8b0de5a18a386ef384d747759b99cc",class:"spw-tw-mb-2 -spw-tw-mt-1",variant:"hint",showIcon:false},this.assistiveText),s("div",{key:"0f4ae9ca8c745da16f4a6a8af594e81e04889eb9",class:"spw-custom-select__wrapper"},s("div",{key:"ed257c48baa566f4480c161435ab2f1affd91ec0",class:"spw-custom-select__container",id:this.name,ref:e=>this.selectContainer=e,onClick:e=>this.toggleDropdown(e),onKeyDown:e=>this.handleKeyDown(e),tabindex:this.disabled?-1:0},s("div",{key:"5006bc09c045d469089dbeab1fb99fdaadf9ae4b",class:"spw-custom-select__selected"},this.isSearchVisible()&&s("div",{key:"5ea0a83210326adf2f22d700c0c6de204f8efc4a",class:"spw-custom-select__search"},s("input",{key:"c4a23018e53464b65323fae714fe669e6cf510cc",class:"spw-custom-select__search-input",placeholder:"Entrez votre recherche",onInput:e=>this.handleSearchInput(e),value:this.searchText})),t&&s("span",{key:"b35cea32fe067f85a90568a67f64e3723f15d2f9"},this.placeholder),this.multiple&&this.internalValue.length>0&&s("div",{key:"ad42651a8e606cc7abb424f167ec4a9b95562290",class:"spw-custom-select__selected-items"},this.internalValue.map((e=>{var t;return s("span",{class:"spw-custom-select__selected-item"},(t=this.parsedOptions.find((t=>String(t.value)===String(e))))===null||t===void 0?void 0:t.label,s("spw-icon",{icon:"fa-times",class:"spw-custom-select__deselect-icon",onClick:t=>this.selectOption(e,t)}))}))),!this.multiple&&s("span",{key:"6050f92aaa17ef4613559e315f8d1fc95db86638"},this.getSelectedLabels()))),s("div",{key:"b0031148a8d7da8d003f0935dfe6e319b8334d3f",class:"spw-custom-select__arrow"},s("spw-icon",{key:"d2b3141c4308fe565780794888b763d0bf6ad101",icon:this.isOpen?"fa-chevron-up":"fa-chevron-down"})),this.isOpen&&s("div",{key:"ea056a2ec8ef32dac0b12ab4f1b7e232dd3fc609",class:`spw-custom-select__options spw-custom-select__options--${this.dropdownDirection}`},!!e.length&&s("ul",{key:"fee67a6f3e5f5d4c5d07c9b960f8e07b44974b77"},e.map(((e,t)=>s("li",{class:{"spw-custom-select__option":true,"spw-custom-select__option--selected":this.multiple?this.internalValue.some((t=>String(t)===String(e.value))):e.value===this.internalValue,"spw-custom-select__option--focused":t===this.focusedOptionIndex,"spw-custom-select__option--disabled":e.disabled},onClick:()=>this.selectOption(e.value)},this.multiple&&s("spw-checkbox",{onKeyDown:t=>this.handleOptionKeyDown(t,e.value),class:"spw-tw-mr-2",checked:this.internalValue.some((t=>String(t)===String(e.value))),disabled:e.disabled}),e.label)))),!e.length&&s("p",{key:"31ea5a9e76b448f46bf2dc4009a64e575ad3ed85",class:"spw-custom-select__no-results"},"Pas de résultats pour cette recherche."))),this.renderErrorMessage(),this.renderHintMessage(),this.renderSuccessMessage(),this.renderWarningMessage())}static get formAssociated(){return true}static get watchers(){return{items:["parseOptions"],value:["valueChangedHandler"],internalValue:["internalValueChanged"]}}};o.style=i;export{o as spw_custom_select};
2
+ //# sourceMappingURL=p-14722019.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwCustomSelectCss","SpwCustomSelect","constructor","hostRef","this","isOpen","parsedOptions","focusedOptionIndex","searchText","dropdownDirection","hasSelectedValue","value","label","placeholder","required","size","multiple","isSearch","error","hint","success","warning","showErrorIcon","showHintIcon","showSuccessIcon","showWarningIcon","handleOtherSelectOpened","event","detail","instance","host","closeDropdown","handleClickOutside","target","composedPath","isInsideHost","contains","searchField","_a","shadowRoot","querySelector","isInsideSearchField","optionsContainer","_b","componentWillLoad","internalValue","JSON","parse","e","Array","isArray","items","parseOptions","updateSelectedOption","resetSelect","internals","setFormValue","getFormValue","valueChanged","emit","formResetCallback","componentDidLoad","document","addEventListener","disconnectedCallback","removeEventListener","newValue","map","option","disabled","valueChangedHandler","undefined","findIndex","String","filter","val","some","sort","a","b","internalValueChanged","length","Boolean","v","join","toggleDropdown","classList","stopPropagation","determineDropdownDirection","wasOpen","notifyOtherSelects","CustomEvent","bubbles","composed","dispatchEvent","rect","selectContainer","getBoundingClientRect","viewportHeight","window","innerHeight","bottom","top","openDropdownWithKeyboard","selectOption","optionValue","find","opt","index","slice","handleOptionKeyDown","key","preventDefault","handleKeyDown","nextIndex","prevIndex","renderErrorMessage","h","variant","showIcon","renderHintMessage","renderWarningMessage","renderSuccessMessage","elementClass","normalizeString","str","normalize","replace","toLowerCase","getSelectedLabels","selectedOption","getFilteredOptions","normalizedSearchText","includes","handleSearchInput","input","isSearchVisible","showPlaceholder","render","filteredOptions","class","ref","el","name","assistiveText","id","onClick","onKeyDown","tabindex","onInput","icon","checked"],"sources":["src/components/spw-custom-select/spw-custom-select.scss?tag=spw-custom-select&encapsulation=shadow","src/components/spw-custom-select/spw-custom-select.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.spw-custom-select {\n position: relative;\n &__container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 40px;\n padding: 0 12px;\n line-height: 40px;\n border-radius: 4px;\n border: 1px solid var(--spw-color-themes-grey-grey-800);\n background-color: #fff;\n &:hover {\n outline: 4px solid var(--spw-color-themes-grey-grey-300);\n }\n &:focus-within,\n &:focus-visible {\n outline: 3px solid white;\n outline-offset: 0;\n box-shadow: 0 0 0 6px black;\n }\n .spw-custom-select--disabled & {\n border-color: var(--spw-color-themes-grey-grey-400);\n background: var(--spw-color-themes-grey-grey-100);\n color: var(--spw-color-themes-grey-grey-500);\n cursor: not-allowed;\n &::placeholder {\n color: var(--spw-color-themes-grey-grey-500);\n }\n &:hover,\n &:focus,\n &:focus-visible {\n outline: none;\n }\n }\n .spw-custom-select--is-error & {\n border-color: var(--spw-colors-states-error-error-300);\n }\n .spw-custom-select--large & {\n height: 60px;\n padding: 0 24px;\n line-height: 60px;\n }\n .spw-custom-select--is-opened & {\n height: auto;\n line-height: 1;\n min-height: 40px;\n border-radius: 4px 4px 0 0;\n border-bottom-color: transparent;\n }\n }\n\n &__selected {\n flex: 1;\n padding-right: 30px;\n max-width: 100%;\n }\n\n &__selected-item {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n color: var(--spw-color-themes-grey-grey-900);\n border: 1px solid var(--spw-color-themes-grey-grey-900);\n background: var(--spw-color-themes-grey-grey-200);\n line-height: 24px;\n height: 24px;\n padding: 0 8px;\n margin: 4px 6px 2px 0;\n border-radius: 999px;\n font-size: 14px;\n user-select: none;\n }\n\n &__selected-items {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n .spw-custom-select--is-opened & {\n padding-top: 3px;\n padding-bottom: 4px;\n overflow: visible;\n text-overflow: initial;\n text-wrap: initial;\n }\n }\n\n &__arrow {\n position: absolute;\n right: 12px;\n top: 10px;\n font-size: 16px;\n color: var(--spw-color-themes-grey-grey-600);\n pointer-events: none;\n }\n\n &__wrapper {\n position: relative;\n }\n\n &__search {\n .spw-custom-select--is-opened & {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 11;\n width: 100%;\n margin-top: 1px;\n }\n .spw-custom-select--has-value.spw-custom-select--is-opened & {\n top: auto;\n top: 100%;\n margin-top: -3px;\n }\n &-input {\n padding: 0;\n height: 38px;\n line-height: 40px;\n border: none;\n margin: 0;\n width: calc(100% - 30px);\n text-overflow: ellipsis;\n &:focus {\n outline: none;\n }\n .spw-custom-select--is-opened & {\n border-left: 1px solid var(--spw-color-themes-grey-grey-800);\n padding: 0 12px;\n }\n .spw-custom-select--is-opened.spw-custom-select--has-value & {\n border-right: 1px solid var(--spw-color-themes-grey-grey-800);\n width: 100%;\n }\n }\n }\n\n &__options {\n position: absolute;\n width: 100%;\n background-color: #fff;\n border: 1px solid var(--spw-color-themes-grey-grey-800);\n border-radius: 0 0 4px 4px;\n max-height: 200px;\n overflow-y: auto;\n z-index: 12;\n\n &--down {\n top: 100%;\n transform: translateY(0);\n }\n\n &--up {\n top: 100%;\n transform: translateY(0);\n }\n\n .spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) & {\n margin-top: 35px;\n }\n }\n\n &__no-results {\n padding: 12px;\n cursor: not-allowed;\n color: var(--spw-color-themes-grey-grey-600);\n }\n\n &__option {\n border-bottom: 1px solid var(--spw-color-themes-grey-grey-900);\n padding: 12px;\n cursor: pointer;\n &:hover {\n background-color: var(--spw-color-themes-grey-grey-200);\n }\n &:last-child {\n border-bottom: none;\n }\n &--selected {\n font-weight: 700;\n }\n &--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n &:hover {\n background-color: transparent;\n }\n }\n }\n\n &__error {\n display: block;\n font-size: 12px;\n color: var(--spw-color-themes-grey-grey-600);\n margin-top: 8px;\n }\n}\n\n.spw-custom-select__option--focused {\n background-color: var(--spw-color-themes-grey-grey-300);\n}\n","import { AttachInternals, Component, Method, Prop, State, Event, EventEmitter, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'spw-custom-select',\n styleUrl: 'spw-custom-select.scss',\n formAssociated: true,\n shadow: true,\n})\nexport class SpwCustomSelect {\n private host: HTMLElement;\n private selectContainer: HTMLElement;\n\n /** Événement émis lorsque la valeur sélectionnée change */\n @Event() valueChanged: EventEmitter<(string | number)[] | string | number>;\n\n @State() internalValue: (string | number)[] | string | number;\n @State() isOpen: boolean = false;\n @State() parsedOptions: { value: string | number; label: string; disabled?: boolean }[] = [];\n @State() focusedOptionIndex: number | null = null;\n @State() searchText: string = '';\n @State() dropdownDirection: 'up' | 'down' = 'down';\n @State() hasSelectedValue: boolean = false;\n\n /** Valeur actuelle sélectionnée dans le composant, peut être une chaîne, un nombre ou un tableau */\n @Prop({ mutable: true, reflect: true }) value: (string | number)[] | string | number = [];\n /** Label associé au champ de sélection personnalisé */\n @Prop() label: string = '';\n /** Placeholder à afficher lorsque aucune option n'est sélectionnée */\n @Prop() placeholder: string = 'Sélectionnez une option';\n /** Indique si le champ est désactivé et donc non interactif */\n @Prop() disabled: boolean;\n /** Nom de l'élément dans les formulaires, utilisé pour associer la valeur */\n @Prop() name: string;\n /** Indique si la sélection est obligatoire dans le formulaire */\n @Prop() required: boolean = false;\n /** Chaîne JSON des options disponibles dans le select (valeur et label) */\n @Prop() items: string | any[];\n /** Taille du select, peut être \"large\" ou \"medium\" */\n @Prop() size: 'large' | 'medium' = 'medium';\n /** Permet la sélection multiple si vrai */\n @Prop() multiple: boolean = false;\n /** Active la fonction de recherche dans la liste des items */\n @Prop() isSearch: boolean = false;\n /** Texte d'assistance à afficher sous le champ */\n @Prop() assistiveText?: string;\n /** Message d'erreur à afficher sous le champ */\n @Prop() error?: string = '';\n /** Message d'indication (hint) à afficher sous le champ */\n @Prop() hint?: string = '';\n /** Message de succès à afficher sous le champ */\n @Prop() success?: string = '';\n /** Message de warning à afficher sous le champ */\n @Prop() warning?: string = '';\n /** Affiche une icône d'erreur si vrai */\n @Prop() showErrorIcon?: boolean = true;\n /** Affiche une icône d'indication si vrai */\n @Prop() showHintIcon?: boolean = true;\n /** Affiche une icône de succès si vrai */\n @Prop() showSuccessIcon?: boolean = true;\n /** Affiche une icône de warning si vrai */\n @Prop() showWarningIcon?: boolean = true;\n\n @AttachInternals() internals: ElementInternals;\n\n componentWillLoad() {\n if (this.multiple) {\n if (typeof this.value === 'string') {\n try {\n this.internalValue = JSON.parse(this.value);\n } catch (e) {\n this.internalValue = [];\n }\n } else if (Array.isArray(this.value)) {\n this.internalValue = this.value;\n } else {\n this.internalValue = [];\n }\n } else {\n this.internalValue = this.value as string | number;\n }\n\n if (this.items) {\n this.parseOptions(this.items);\n }\n this.updateSelectedOption();\n }\n\n @Method()\n async resetSelect() {\n if (this.multiple) {\n this.internalValue = [];\n this.value = [];\n } else {\n this.internalValue = '';\n this.value = '';\n }\n this.searchText = '';\n this.focusedOptionIndex = null;\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n this.updateSelectedOption();\n }\n\n formResetCallback() {\n this.resetSelect();\n }\n\n componentDidLoad() {\n document.addEventListener('click', this.handleClickOutside);\n document.addEventListener('spw-custom-select-opened', this.handleOtherSelectOpened);\n this.internals.setFormValue(this.getFormValue());\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside);\n document.removeEventListener('spw-custom-select-opened', this.handleOtherSelectOpened);\n }\n\n private handleOtherSelectOpened = (event: CustomEvent) => {\n if (event.detail.instance !== this.host && this.isOpen) {\n this.closeDropdown();\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.isOpen) {\n const target = event.composedPath()[0] as Node;\n const isInsideHost = this.host.contains(target);\n const searchField = this.host.shadowRoot?.querySelector('.spw-custom-select__search-input');\n\n const isInsideSearchField = searchField?.contains(target);\n\n if (!isInsideHost && !isInsideSearchField) {\n if (this.multiple) {\n const optionsContainer = this.host.shadowRoot?.querySelector('.spw-custom-select__options');\n if (optionsContainer && optionsContainer.contains(target)) {\n return;\n }\n }\n\n this.closeDropdown();\n }\n }\n };\n\n @Watch('items')\n parseOptions(newValue: string | any[]) {\n try {\n if (Array.isArray(newValue)) {\n this.parsedOptions = newValue.map(option => ({\n value: option.value,\n label: option.label,\n disabled: option.disabled || false,\n }));\n } else if (typeof newValue === 'string') {\n this.parsedOptions = JSON.parse(newValue).map(option => ({\n value: option.value,\n label: option.label,\n disabled: option.disabled || false,\n }));\n } else {\n this.parsedOptions = [];\n }\n this.updateSelectedOption();\n } catch (e) {\n this.parsedOptions = [];\n }\n }\n\n @Watch('value')\n valueChangedHandler(newValue: (string | number)[] | string | number) {\n if (this.multiple) {\n this.internalValue = Array.isArray(newValue) ? newValue : [newValue];\n } else {\n this.internalValue = newValue;\n }\n this.updateSelectedOption();\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n }\n\n private updateSelectedOption() {\n this.internals.setFormValue(this.getFormValue());\n\n if (!this.multiple && this.internalValue !== undefined) {\n this.focusedOptionIndex = this.parsedOptions.findIndex(option => String(option.value) === String(this.internalValue));\n } else if (this.multiple && Array.isArray(this.internalValue)) {\n this.internalValue = (this.internalValue as (string | number)[])\n .filter(val => this.parsedOptions.some(option => String(option.value) === String(val)))\n .sort((a, b) => this.parsedOptions.findIndex(option => String(option.value) === String(a)) - this.parsedOptions.findIndex(option => String(option.value) === String(b)));\n }\n }\n\n @Watch('internalValue')\n internalValueChanged() {\n this.hasSelectedValue = Array.isArray(this.internalValue) ? this.internalValue.length > 0 : Boolean(this.internalValue);\n }\n\n private getFormValue(): string | null {\n if (this.multiple) {\n return Array.isArray(this.internalValue) && this.internalValue.length > 0 ? this.internalValue.map(v => String(v)).join(',') : null;\n }\n return this.internalValue ? String(this.internalValue) : null;\n }\n\n private toggleDropdown(event?: MouseEvent) {\n if (!this.disabled) {\n if (event) {\n const target = event.composedPath()[0] as HTMLElement;\n\n if (target.classList.contains('spw-custom-select__search-input')) {\n return;\n }\n\n event.stopPropagation();\n }\n this.determineDropdownDirection();\n const wasOpen = this.isOpen;\n this.isOpen = !this.isOpen;\n\n if (this.isOpen && !wasOpen) {\n this.notifyOtherSelects();\n }\n\n if (!this.isOpen) {\n this.focusedOptionIndex = null;\n }\n }\n }\n\n private notifyOtherSelects() {\n const event = new CustomEvent('spw-custom-select-opened', {\n detail: { instance: this.host },\n bubbles: true,\n composed: true\n });\n document.dispatchEvent(event);\n }\n\n private determineDropdownDirection() {\n const rect = this.selectContainer.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n if (rect.bottom + 200 > viewportHeight && rect.top > 200) {\n this.dropdownDirection = 'up';\n } else {\n this.dropdownDirection = 'down';\n }\n }\n\n private openDropdownWithKeyboard() {\n this.determineDropdownDirection();\n this.isOpen = true;\n this.focusedOptionIndex = 0;\n this.notifyOtherSelects();\n }\n\n private closeDropdown() {\n this.isOpen = false;\n this.focusedOptionIndex = null;\n this.searchText = '';\n }\n\n private selectOption(optionValue: string | number, event?: MouseEvent) {\n if (event) {\n event.stopPropagation();\n }\n\n const option = this.parsedOptions.find(opt => String(opt.value) === String(optionValue));\n if (option?.disabled) {\n return;\n }\n\n if (this.multiple) {\n const index = (this.internalValue as (string | number)[]).findIndex(val => String(val) === String(optionValue));\n if (index > -1) {\n this.internalValue = [...(this.internalValue as (string | number)[]).slice(0, index), ...(this.internalValue as (string | number)[]).slice(index + 1)];\n } else {\n this.internalValue = [...(this.internalValue as (string | number)[]), optionValue];\n }\n this.internalValue = (this.internalValue as (string | number)[]).sort(\n (a, b) => this.parsedOptions.findIndex(option => String(option.value) === String(a)) - this.parsedOptions.findIndex(option => String(option.value) === String(b)),\n );\n } else {\n this.internalValue = optionValue;\n this.closeDropdown();\n }\n\n this.value = this.internalValue;\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n this.updateSelectedOption();\n }\n\n private handleOptionKeyDown(event: KeyboardEvent, optionValue: string | number) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.selectOption(optionValue);\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if ((event.target as HTMLElement).classList.contains('spw-custom-select__search-input')) {\n return;\n }\n switch (event.key) {\n case ' ':\n event.preventDefault();\n if (!this.isOpen) {\n this.openDropdownWithKeyboard();\n }\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (this.isOpen) {\n let nextIndex = this.focusedOptionIndex === null ? 0 : (this.focusedOptionIndex + 1) % this.parsedOptions.length;\n while (this.parsedOptions[nextIndex]?.disabled && nextIndex !== this.focusedOptionIndex) {\n nextIndex = (nextIndex + 1) % this.parsedOptions.length;\n }\n this.focusedOptionIndex = nextIndex;\n } else {\n this.openDropdownWithKeyboard();\n }\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.isOpen) {\n let prevIndex = this.focusedOptionIndex === null ? this.parsedOptions.length - 1 : (this.focusedOptionIndex - 1 + this.parsedOptions.length) % this.parsedOptions.length;\n while (this.parsedOptions[prevIndex]?.disabled && prevIndex !== this.focusedOptionIndex) {\n prevIndex = (prevIndex - 1 + this.parsedOptions.length) % this.parsedOptions.length;\n }\n this.focusedOptionIndex = prevIndex;\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (this.isOpen && this.focusedOptionIndex !== null) {\n this.selectOption(this.parsedOptions[this.focusedOptionIndex].value);\n }\n break;\n case 'Escape':\n if (this.isOpen) {\n this.closeDropdown();\n }\n break;\n }\n }\n\n private renderErrorMessage() {\n if (this.error) {\n return (\n <spw-field-message variant=\"error\" showIcon={this.showErrorIcon}>\n {this.error}\n </spw-field-message>\n );\n }\n }\n\n private renderHintMessage() {\n if (this.hint) {\n return (\n <spw-field-message variant=\"hint\" showIcon={this.showHintIcon}>\n {this.hint}\n </spw-field-message>\n );\n }\n }\n\n private renderWarningMessage() {\n if (this.warning) {\n return (\n <spw-field-message variant=\"warning\" showIcon={this.showWarningIcon}>\n {this.warning}\n </spw-field-message>\n );\n }\n }\n\n private renderSuccessMessage() {\n if (this.success) {\n return (\n <spw-field-message variant=\"success\" showIcon={this.showSuccessIcon}>\n {this.success}\n </spw-field-message>\n );\n }\n }\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-custom-select': true,\n [`spw-custom-select--${this.size}`]: true,\n 'spw-custom-select--is-error': !!this.error,\n 'spw-custom-select--disabled': this.disabled,\n 'spw-custom-select--is-opened': this.isOpen,\n 'spw-custom-select--has-value': this.hasSelectedValue,\n 'spw-custom-select--no-value': !this.hasSelectedValue,\n 'spw-custom-select--is-searchable': this.isSearch,\n 'spw-custom-select--not-searchable': !this.isSearch,\n };\n }\n\n private normalizeString(str: string): string {\n return str\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase();\n }\n\n private getSelectedLabels(): string {\n if (this.multiple) {\n return Array.isArray(this.internalValue) && this.internalValue.length > 0\n ? (this.internalValue as (string | number)[])\n .map(val => this.parsedOptions.find(option => String(option.value) === String(val))?.label)\n .filter(Boolean)\n .join(', ')\n : null;\n } else {\n const selectedOption = this.parsedOptions.find(option => String(option.value) === String(this.internalValue));\n return selectedOption ? selectedOption.label : null;\n }\n }\n\n private getFilteredOptions() {\n const normalizedSearchText = this.normalizeString(this.searchText);\n return this.parsedOptions.filter(option => this.normalizeString(option.label).includes(normalizedSearchText));\n }\n\n private handleSearchInput(event: Event) {\n const input = event.target as HTMLInputElement;\n this.searchText = input.value;\n this.focusedOptionIndex = 0;\n\n if (!this.isOpen) {\n this.isOpen = true;\n this.notifyOtherSelects();\n }\n }\n\n private isSearchVisible(): boolean {\n if (!this.isSearch) return false;\n if (!this.hasSelectedValue && !this.isOpen) return true;\n if (this.isSearch && this.isOpen) return true;\n return this.isOpen;\n }\n\n private showPlaceholder(): boolean {\n if (this.isSearch) return false;\n if (this.hasSelectedValue) return false;\n return true;\n }\n\n render() {\n const filteredOptions = this.getFilteredOptions();\n const showPlaceholder = this.showPlaceholder();\n\n return (\n <div class={this.elementClass} ref={el => (this.host = el as HTMLElement)}>\n {this.label && <spw-field-label label={this.label} name={this.name} required={this.required}></spw-field-label>}\n {this.assistiveText && (\n <spw-field-message class=\"spw-tw-mb-2 -spw-tw-mt-1\" variant=\"hint\" showIcon={false}>\n {this.assistiveText}\n </spw-field-message>\n )}\n <div class=\"spw-custom-select__wrapper\">\n <div\n class=\"spw-custom-select__container\"\n id={this.name}\n ref={el => (this.selectContainer = el as HTMLElement)}\n onClick={event => this.toggleDropdown(event)}\n onKeyDown={event => this.handleKeyDown(event)}\n tabindex={this.disabled ? -1 : 0}\n >\n <div class=\"spw-custom-select__selected\">\n {this.isSearchVisible() && (\n <div class=\"spw-custom-select__search\">\n <input class=\"spw-custom-select__search-input\" placeholder=\"Entrez votre recherche\" onInput={event => this.handleSearchInput(event)} value={this.searchText} />\n </div>\n )}\n {showPlaceholder && <span>{this.placeholder}</span>}\n {this.multiple && (this.internalValue as (string | number)[]).length > 0 && (\n <div class=\"spw-custom-select__selected-items\">\n {(this.internalValue as (string | number)[]).map(val => (\n <span class=\"spw-custom-select__selected-item\">\n {this.parsedOptions.find(option => String(option.value) === String(val))?.label}\n <spw-icon icon=\"fa-times\" class=\"spw-custom-select__deselect-icon\" onClick={event => this.selectOption(val, event)}></spw-icon>\n </span>\n ))}\n </div>\n )}\n {!this.multiple && <span>{this.getSelectedLabels()}</span>}\n </div>\n </div>\n <div class=\"spw-custom-select__arrow\">\n <spw-icon icon={this.isOpen ? 'fa-chevron-up' : 'fa-chevron-down'}></spw-icon>\n </div>\n {this.isOpen && (\n <div class={`spw-custom-select__options spw-custom-select__options--${this.dropdownDirection}`}>\n {!!filteredOptions.length && (\n <ul>\n {filteredOptions.map((option, index) => (\n <li\n class={{\n 'spw-custom-select__option': true,\n 'spw-custom-select__option--selected': this.multiple\n ? (this.internalValue as (string | number)[]).some(val => String(val) === String(option.value))\n : option.value === this.internalValue,\n 'spw-custom-select__option--focused': index === this.focusedOptionIndex,\n 'spw-custom-select__option--disabled': option.disabled,\n }}\n onClick={() => this.selectOption(option.value)}\n >\n {this.multiple && (\n <spw-checkbox\n onKeyDown={event => this.handleOptionKeyDown(event, option.value)}\n class=\"spw-tw-mr-2\"\n checked={(this.internalValue as (string | number)[]).some(val => String(val) === String(option.value))}\n disabled={option.disabled}\n ></spw-checkbox>\n )}\n {option.label}\n </li>\n ))}\n </ul>\n )}\n {!filteredOptions.length && <p class=\"spw-custom-select__no-results\">Pas de résultats pour cette recherche.</p>}\n </div>\n )}\n </div>\n {this.renderErrorMessage()}\n {this.renderHintMessage()}\n {this.renderSuccessMessage()}\n {this.renderWarningMessage()}\n </div>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAqB,6gO,MCQdC,EAAe,MAN5B,WAAAC,CAAAC,G,qNAcWC,KAAMC,OAAY,MAClBD,KAAaE,cAAoE,GACjFF,K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1B,MAC1EyG,EAAU,YAAAiC,KAAK,WAAWV,MAAM,mCAAmCM,QAASvH,GAASvB,KAAKoG,aAAa7B,EAAKhD,KACvG,MAIXvB,KAAKY,UAAYqG,EAAA,QAAAN,IAAA,4CAAO3G,KAAK6H,uBAGnCZ,EAAK,OAAAN,IAAA,2CAAA6B,MAAM,4BACTvB,EAAA,YAAAN,IAAA,2CAAUuC,KAAMlJ,KAAKC,OAAS,gBAAkB,qBAEjDD,KAAKC,QACJgH,EAAA,OAAAN,IAAA,2CAAK6B,MAAO,0DAA0DxI,KAAKK,uBACtEkI,EAAgB1D,QACjBoC,EAAA,MAAAN,IAAA,4CACG4B,EAAgBxE,KAAI,CAACC,EAAQwC,IAC5BS,EACE,MAAAuB,MAAO,CACL,4BAA6B,KAC7B,sCAAuCxI,KAAKY,SACvCZ,KAAKyC,cAAsC+B,MAAKD,GAAOF,OAAOE,KAASF,OAAOL,EAAOzD,SACtFyD,EAAOzD,QAAUP,KAAKyC,cAC1B,qCAAsC+D,IAAUxG,KAAKG,mBACrD,sCAAuC6D,EAAOC,UAEhD6E,QAAS,IAAM9I,KAAKoG,aAAapC,EAAOzD,QAEvCP,KAAKY,UACJqG,EAAA,gBACE8B,UAAWxH,GAASvB,KAAK0G,oBAAoBnF,EAAOyC,EAAOzD,OAC3DiI,MAAM,cACNW,QAAUnJ,KAAKyC,cAAsC+B,MAAKD,GAAOF,OAAOE,KAASF,OAAOL,EAAOzD,SAC/F0D,SAAUD,EAAOC,WAGpBD,EAAOxD,WAKd+H,EAAgB1D,QAAUoC,EAAA,KAAAN,IAAA,2CAAG6B,MAAM,iCAA+B,4CAIzExI,KAAKgH,qBACLhH,KAAKoH,oBACLpH,KAAKsH,uBACLtH,KAAKqH,uB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,h as s,H as i,g as o}from"./p-CvfVJV8a.js";const r='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-select,.spw-select__container{position:relative}.spw-select__arrow{color:var(--spw-color-themes-grey-grey-600);font-size:16px;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.spw-select__trigger{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:4px;color:var(--spw-color-themes-grey-grey-800);font-size:16px;height:40px;margin:0;padding:0 40px 0 12px;position:relative;width:100%}.spw-select__trigger:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-select__trigger:focus-visible{box-shadow:0 0 0 6px #000;outline:3px solid #fff;outline-offset:0}.spw-select__trigger:after{color:var(--spw-color-themes-grey-grey-800);content:"\\f078";font-family:var(--spw-ds-font-icons-solid);font-size:14px;font-weight:900;pointer-events:none;position:absolute;right:10px;top:50%;transform:translateY(-50%)}.spw-select--is-error .spw-select__trigger{border-color:var(--spw-colors-states-error-error-300)}.spw-select--large .spw-select__trigger{font-size:18px;height:60px;padding:0 24px}.spw-select--disabled .spw-select__trigger{background:var(--spw-color-themes-grey-grey-100);border-color:var(--spw-color-themes-grey-grey-400);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-select--disabled .spw-select__trigger::-moz-placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-select--disabled .spw-select__trigger::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-select--disabled .spw-select__trigger:focus,.spw-select--disabled .spw-select__trigger:focus-visible,.spw-select--disabled .spw-select__trigger:hover{outline:none}.-spw-tw-mt-1{margin-top:-.25rem}.spw-tw-mb-2{margin-bottom:.5rem}';const n=class{constructor(s){e(this,s);this.valueChanged=t(this,"valueChanged",7);if(s.$hostElement$["s-ei"]){this.internals=s.$hostElement$["s-ei"]}else{this.internals=s.$hostElement$.attachInternals();s.$hostElement$["s-ei"]=this.internals}this.label="";this.placeholder="Sélectionner une option";this.required=false;this.size="medium";this.error="";this.hint="";this.success="";this.warning="";this.showErrorIcon=true;this.showHintIcon=true;this.showSuccessIcon=true;this.showWarningIcon=true;this.defaultValue=null}handleItemsChange(){if(this.selectElement){this.syncDynamicOptions()}}async resetSelect(){this.internalValue="";this.value="";if(this.selectElement){this.selectElement.value=""}this.internals.setFormValue("");this.valueChanged.emit("")}componentWillLoad(){var e;this.defaultValue=(e=this.value)!==null&&e!==void 0?e:this.getInitialSelectedValue();this.internalValue=this.value||this.getInitialSelectedValue()}componentDidLoad(){this.internals.setFormValue(this.getFormValue());if(!this.items){this.moveOptionsToLightDom()}else{this.syncDynamicOptions()}}formResetCallback(){var e;this.setValue((e=this.defaultValue)!==null&&e!==void 0?e:"");this.resetSelect()}setValue(e){this.internalValue=e;this.value=e;if(this.selectElement){this.selectElement.value=String(e)}this.internals.setFormValue(this.getFormValue());this.valueChanged.emit(this.internalValue)}getFormValue(){return this.internalValue?String(this.internalValue):null}getInitialSelectedValue(){if(this.items&&this.items.length>0){return null}const e=Array.from(this.el.querySelectorAll("option"));for(const t of e){if(t.hasAttribute("selected")){return t.getAttribute("value")}}return null}handleSelectChange(e){const t=e.target;this.internalValue=t.value;this.value=this.internalValue;this.internals.setFormValue(this.getFormValue());this.valueChanged.emit(this.internalValue)}moveOptionsToLightDom(){const e=this.el.shadowRoot.querySelector("slot");if(e){const t=e.assignedNodes({flatten:true});t.forEach((e=>{if(e.nodeName==="OPTION"||e.nodeName==="OPTGROUP"){this.selectElement.appendChild(e)}}))}}syncDynamicOptions(){while(this.selectElement.options.length>1){this.selectElement.remove(1)}if(this.items&&this.items.length>0){this.items.forEach((e=>{const t=document.createElement("option");const s=this.itemValue?e[this.itemValue]:e;const i=this.itemLabel?e[this.itemLabel]:e;t.value=String(s);t.textContent=String(i);this.selectElement.appendChild(t)}))}if(this.selectElement.value!==String(this.internalValue||"")){this.selectElement.value=String(this.internalValue||"")}}renderErrorMessage(){if(this.error){return s("spw-field-message",{variant:"error",showIcon:this.showErrorIcon},this.error)}}renderHintMessage(){if(this.hint){return s("spw-field-message",{variant:"hint",showIcon:this.showHintIcon},this.hint)}}renderSuccessMessage(){if(this.success){return s("spw-field-message",{variant:"success",showIcon:this.showSuccessIcon},this.success)}}renderWarningMessage(){if(this.warning){return s("spw-field-message",{variant:"warning",showIcon:this.showWarningIcon},this.warning)}}get elementClass(){return{"spw-select":true,[`spw-select--${this.size}`]:true,"spw-select--disabled":this.disabled,"spw-select--is-error":!!this.error}}render(){return s(i,{key:"17dff311dbe9762fe0d38f1949f012767e9a2b51"},s("div",{key:"0fc7e6d39e182c1044bb5b3d117110d44316a958",class:this.elementClass},this.label&&s("spw-field-label",{key:"6a4eda2b4ff3caefb9b05b12b1581274f1be10a6",label:this.label,name:this.name,required:this.required}),this.assistiveText&&s("spw-field-message",{key:"f0b09de81771bc5008bb58c0b90ff15e5a4615b6",class:"spw-tw-mb-2 -spw-tw-mt-1",variant:"hint",showIcon:false},this.assistiveText),s("div",{key:"ac1906e5238eb49410d2a2f534b56b2f9853e7aa",class:"spw-select__container"},s("select",{key:"e1e817c838f15973a6ef86672e15eca40b740d33",id:this.name,class:"spw-select__trigger",onChange:e=>this.handleSelectChange(e),disabled:this.disabled,ref:e=>this.selectElement=e,tabindex:this.disabled?-1:0},s("option",{key:"a5e2727f8418964b03462f16b266d1cbb8cac425",value:"",disabled:true,selected:!this.internalValue},this.placeholder)),s("spw-icon",{key:"fe958cab33e002cab576bffd8f720feeeaf455d1",class:"spw-select__arrow",icon:"fa-chevron-down"})),!this.items&&s("slot",{key:"5e81d8b62ce0e59dd25204aa7a88ccdaf413722e"})),this.renderErrorMessage(),this.renderHintMessage(),this.renderSuccessMessage(),this.renderWarningMessage())}static get formAssociated(){return true}get el(){return o(this)}static get watchers(){return{items:["handleItemsChange"]}}};n.style=r;export{n as spw_select};
2
- //# sourceMappingURL=p-b1de48f3.entry.js.map
1
+ import{r as e,c as t,h as s,H as i,g as o}from"./p-CvfVJV8a.js";const r='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-select,.spw-select__container{position:relative}.spw-select__arrow{color:var(--spw-color-themes-grey-grey-600);font-size:16px;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.spw-select__trigger{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:4px;color:var(--spw-color-themes-grey-grey-800);font-size:16px;height:40px;margin:0;padding:0 40px 0 12px;position:relative;width:100%}.spw-select__trigger:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-select__trigger:focus-visible{box-shadow:0 0 0 6px #000;outline:3px solid #fff;outline-offset:0}.spw-select__trigger:after{color:var(--spw-color-themes-grey-grey-800);content:"\\f078";font-family:var(--spw-ds-font-icons-solid);font-size:14px;font-weight:900;pointer-events:none;position:absolute;right:10px;top:50%;transform:translateY(-50%)}.spw-select--is-error .spw-select__trigger{border-color:var(--spw-colors-states-error-error-300)}.spw-select--large .spw-select__trigger{font-size:18px;height:60px;padding:0 24px}.spw-select--disabled .spw-select__trigger{background:var(--spw-color-themes-grey-grey-100);border-color:var(--spw-color-themes-grey-grey-400);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-select--disabled .spw-select__trigger::-moz-placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-select--disabled .spw-select__trigger::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-select--disabled .spw-select__trigger:focus,.spw-select--disabled .spw-select__trigger:focus-visible,.spw-select--disabled .spw-select__trigger:hover{outline:none}.-spw-tw-mt-1{margin-top:-.25rem}.spw-tw-mb-2{margin-bottom:.5rem}';const n=class{constructor(s){e(this,s);this.valueChanged=t(this,"valueChanged",7);if(s.$hostElement$["s-ei"]){this.internals=s.$hostElement$["s-ei"]}else{this.internals=s.$hostElement$.attachInternals();s.$hostElement$["s-ei"]=this.internals}this.label="";this.placeholder="Sélectionner une option";this.required=false;this.size="medium";this.error="";this.hint="";this.success="";this.warning="";this.showErrorIcon=true;this.showHintIcon=true;this.showSuccessIcon=true;this.showWarningIcon=true;this.defaultValue=null}handleItemsChange(){if(this.selectElement){this.syncDynamicOptions()}}async resetSelect(){this.internalValue="";this.value="";if(this.selectElement){this.selectElement.value=""}this.internals.setFormValue("");this.valueChanged.emit("")}componentWillLoad(){var e;this.defaultValue=(e=this.value)!==null&&e!==void 0?e:this.getInitialSelectedValue();this.internalValue=this.value||this.getInitialSelectedValue()}componentDidLoad(){this.internals.setFormValue(this.getFormValue());if(!this.items){this.moveOptionsToLightDom()}else{this.syncDynamicOptions()}}formResetCallback(){var e;this.setValue((e=this.defaultValue)!==null&&e!==void 0?e:"");this.resetSelect()}setValue(e){this.internalValue=e;this.value=e;if(this.selectElement){this.selectElement.value=String(e)}this.internals.setFormValue(this.getFormValue());this.valueChanged.emit(this.internalValue)}getFormValue(){return this.internalValue?String(this.internalValue):null}getInitialSelectedValue(){if(this.items&&this.items.length>0){return null}const e=Array.from(this.el.querySelectorAll("option"));for(const t of e){if(t.hasAttribute("selected")){return t.getAttribute("value")}}return null}handleSelectChange(e){const t=e.target;this.internalValue=t.value;this.value=this.internalValue;this.internals.setFormValue(this.getFormValue());this.valueChanged.emit(this.internalValue)}moveOptionsToLightDom(){const e=this.el.shadowRoot.querySelector("slot");if(e){const t=e.assignedNodes({flatten:true});t.forEach((e=>{if(e.nodeName==="OPTION"||e.nodeName==="OPTGROUP"){this.selectElement.appendChild(e)}}))}}syncDynamicOptions(){while(this.selectElement.options.length>1){this.selectElement.remove(1)}if(this.items&&this.items.length>0){this.items.forEach((e=>{const t=document.createElement("option");const s=this.itemValue?e[this.itemValue]:e;const i=this.itemLabel?e[this.itemLabel]:e;const o=e.disabled||false;t.value=String(s);t.textContent=String(i);t.disabled=o;this.selectElement.appendChild(t)}))}if(this.selectElement.value!==String(this.internalValue||"")){this.selectElement.value=String(this.internalValue||"")}}renderErrorMessage(){if(this.error){return s("spw-field-message",{variant:"error",showIcon:this.showErrorIcon},this.error)}}renderHintMessage(){if(this.hint){return s("spw-field-message",{variant:"hint",showIcon:this.showHintIcon},this.hint)}}renderSuccessMessage(){if(this.success){return s("spw-field-message",{variant:"success",showIcon:this.showSuccessIcon},this.success)}}renderWarningMessage(){if(this.warning){return s("spw-field-message",{variant:"warning",showIcon:this.showWarningIcon},this.warning)}}get elementClass(){return{"spw-select":true,[`spw-select--${this.size}`]:true,"spw-select--disabled":this.disabled,"spw-select--is-error":!!this.error}}render(){return s(i,{key:"deb7266660e609a3e44623613a990bf8dcbe7343"},s("div",{key:"ff425d15ea0fd790039e72674d7657324b3c62cb",class:this.elementClass},this.label&&s("spw-field-label",{key:"71f35858b08561f526d52498aa04da0b7dd46c57",label:this.label,name:this.name,required:this.required}),this.assistiveText&&s("spw-field-message",{key:"1e0b80d55ae61be1d161fc4dcad2e5abb0d3b351",class:"spw-tw-mb-2 -spw-tw-mt-1",variant:"hint",showIcon:false},this.assistiveText),s("div",{key:"3af822dbdc83f589aad041fd6fd0cb7cd43be639",class:"spw-select__container"},s("select",{key:"727b2f5f46ac0610f91da0eeb13530ec99dc98a3",id:this.name,class:"spw-select__trigger",onChange:e=>this.handleSelectChange(e),disabled:this.disabled,ref:e=>this.selectElement=e,tabindex:this.disabled?-1:0},s("option",{key:"54fdb7a9268d4e796cc2cf6e70642719668ac3a7",value:"",disabled:true,selected:!this.internalValue},this.placeholder)),s("spw-icon",{key:"345e115df06ae4373a0d910947997d4f2f7cd2d4",class:"spw-select__arrow",icon:"fa-chevron-down"})),!this.items&&s("slot",{key:"ca10c23f8e7e9b7422d479b5b648f661c6d431a0"})),this.renderErrorMessage(),this.renderHintMessage(),this.renderSuccessMessage(),this.renderWarningMessage())}static get formAssociated(){return true}get el(){return o(this)}static get watchers(){return{items:["handleItemsChange"]}}};n.style=r;export{n as spw_select};
2
+ //# sourceMappingURL=p-152525de.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwSelectCss","SpwSelect","constructor","hostRef","this","label","placeholder","required","size","error","hint","success","warning","showErrorIcon","showHintIcon","showSuccessIcon","showWarningIcon","defaultValue","handleItemsChange","selectElement","syncDynamicOptions","resetSelect","internalValue","value","internals","setFormValue","valueChanged","emit","componentWillLoad","_a","getInitialSelectedValue","componentDidLoad","getFormValue","items","moveOptionsToLightDom","formResetCallback","setValue","val","String","length","assignedNodes","Array","from","el","querySelectorAll","option","hasAttribute","getAttribute","handleSelectChange","event","select","target","slot","shadowRoot","querySelector","flatten","forEach","node","nodeName","appendChild","options","remove","item","document","createElement","itemValue","itemLabel","disabled","textContent","renderErrorMessage","h","variant","showIcon","renderHintMessage","renderSuccessMessage","renderWarningMessage","elementClass","render","Host","key","class","name","assistiveText","id","onChange","ref","tabindex","selected","icon"],"sources":["src/components/spw-select/spw-select.scss?tag=spw-select&encapsulation=shadow","src/components/spw-select/spw-select.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.spw-select {\n position: relative;\n &__container {\n position: relative;\n }\n &__arrow {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 12px;\n pointer-events: none;\n color: var(--spw-color-themes-grey-grey-600);\n font-size: 16px;\n }\n &__trigger {\n width: 100%;\n height: 40px;\n border-radius: 4px;\n border: 1px solid var(--spw-color-themes-grey-grey-800);\n background-color: #fff;\n font-size: 16px;\n color: var(--spw-color-themes-grey-grey-800);\n position: relative;\n padding: 0;\n margin: 0;\n appearance: none;\n padding: 0 12px;\n padding-right: 40px;\n\n &:hover {\n outline: 4px solid var(--spw-color-themes-grey-grey-300);\n }\n\n &:focus-visible {\n outline: 3px solid white;\n outline-offset: 0;\n box-shadow: 0 0 0 6px black;\n }\n\n &::after {\n content: '\\f078';\n font-family: var(--spw-ds-font-icons-solid);\n font-weight: 900;\n font-size: 14px;\n color: var(--spw-color-themes-grey-grey-800);\n position: absolute;\n right: 10px;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n }\n\n .spw-select--is-error & {\n border-color: var(--spw-colors-states-error-error-300);\n }\n\n .spw-select--large & {\n height: 60px;\n padding: 0 24px;\n font-size: 18px;\n }\n\n .spw-select--disabled & {\n border-color: var(--spw-color-themes-grey-grey-400);\n background: var(--spw-color-themes-grey-grey-100);\n color: var(--spw-color-themes-grey-grey-500);\n cursor: not-allowed;\n &::placeholder {\n color: var(--spw-color-themes-grey-grey-500);\n }\n &:hover,\n &:focus,\n &:focus-visible {\n outline: none;\n }\n }\n }\n}\n","import { AttachInternals, Host, Component, Method, Prop, State, Event, EventEmitter, h, Element, Watch } from '@stencil/core';\n\nexport interface SelectItem {\n label: string;\n value: string | number;\n disabled?: boolean;\n}\n\n@Component({\n tag: 'spw-select',\n styleUrl: 'spw-select.scss',\n formAssociated: true,\n shadow: true,\n})\nexport class SpwSelect {\n @Element() el: HTMLSpwSelectElement;\n\n /** Emet un event si la valeur change */\n @Event() valueChanged: EventEmitter<string | number>;\n @State() internalValue: string | number;\n\n /** Valeur sélectionnée actuelle, mutable et reflétée dans le DOM */\n @Prop({ mutable: true, reflect: true }) value: string | number;\n /** Label associé au champ de sélection */\n @Prop() label: string = '';\n /** Texte du placeholder à afficher lorsque rien n'est sélectionné */\n @Prop() placeholder: string = 'Sélectionner une option';\n /** Indique si le champ de sélection est désactivé */\n @Prop() disabled: boolean;\n /** Nom de l'élément utilisé dans les formulaires pour associer la valeur sélectionnée */\n @Prop() name: string;\n /** Indique si la sélection est obligatoire dans le formulaire */\n @Prop() required: boolean = false;\n /** Taille du champ de sélection : 'large' ou 'medium' */\n @Prop() size: 'large' | 'medium' = 'medium';\n /** Texte d'assistance affiché sous le champ de sélection */\n @Prop() assistiveText?: string;\n /** Message d'erreur à afficher sous le champ de sélection */\n @Prop() error?: string = '';\n /** Message d'indication (hint) à afficher sous le champ de sélection */\n @Prop() hint?: string = '';\n /** Message de succès à afficher sous le champ de sélection */\n @Prop() success?: string = '';\n /** Message de warning à afficher sous le champ */\n @Prop() warning?: string = '';\n /** Affiche une icône d'erreur si vrai */\n @Prop() showErrorIcon?: boolean = true;\n /** Affiche une icône d'indication si vrai */\n @Prop() showHintIcon?: boolean = true;\n /** Affiche une icône de succès si vrai */\n @Prop() showSuccessIcon?: boolean = true;\n /** Affiche une icône de warning si vrai */\n @Prop() showWarningIcon?: boolean = true;\n /** Liste d'items dynamiques pour générer les options (array d'objects avec label + value) */\n @Prop() items?: SelectItem[];\n /** Propriété à utiliser comme label des options */\n @Prop() itemLabel?: string;\n /** Propriété à utiliser comme valeur des options */\n @Prop() itemValue?: string;\n\n private selectElement!: HTMLSelectElement;\n private defaultValue: string | number | null = null;\n\n @AttachInternals() internals: ElementInternals;\n\n @Watch('items')\n handleItemsChange() {\n if (this.selectElement) {\n this.syncDynamicOptions();\n }\n }\n\n @Method()\n async resetSelect() {\n this.internalValue = '';\n this.value = '';\n if (this.selectElement) {\n this.selectElement.value = '';\n }\n this.internals.setFormValue('');\n this.valueChanged.emit('');\n }\n\n componentWillLoad() {\n this.defaultValue = this.value ?? this.getInitialSelectedValue();\n this.internalValue = this.value || this.getInitialSelectedValue();\n }\n\n componentDidLoad() {\n this.internals.setFormValue(this.getFormValue());\n if (!this.items) {\n this.moveOptionsToLightDom();\n } else {\n this.syncDynamicOptions();\n }\n }\n\n formResetCallback() {\n this.setValue(this.defaultValue ?? '');\n this.resetSelect();\n }\n\n private setValue(val: string | number) {\n this.internalValue = val;\n this.value = val;\n\n if (this.selectElement) {\n this.selectElement.value = String(val);\n }\n\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n }\n\n private getFormValue(): string | null {\n return this.internalValue ? String(this.internalValue) : null;\n }\n\n private getInitialSelectedValue(): string | number | null {\n if (this.items && this.items.length > 0) {\n return null;\n }\n const assignedNodes = Array.from(this.el.querySelectorAll('option')) as HTMLOptionElement[];\n for (const option of assignedNodes) {\n if (option.hasAttribute('selected')) {\n return option.getAttribute('value');\n }\n }\n return null;\n }\n\n private handleSelectChange(event: Event) {\n const select = event.target as HTMLSelectElement;\n this.internalValue = select.value;\n this.value = this.internalValue;\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n }\n\n private moveOptionsToLightDom() {\n const slot = this.el.shadowRoot.querySelector('slot');\n if (slot) {\n const assignedNodes = slot.assignedNodes({ flatten: true }) as HTMLElement[];\n assignedNodes.forEach(node => {\n if (node.nodeName === 'OPTION' || node.nodeName === 'OPTGROUP') {\n this.selectElement.appendChild(node);\n }\n });\n }\n }\n\n private syncDynamicOptions() {\n while (this.selectElement.options.length > 1) {\n this.selectElement.remove(1);\n }\n\n if (this.items && this.items.length > 0) {\n this.items.forEach(item => {\n const option = document.createElement('option');\n const value = this.itemValue ? item[this.itemValue] : item;\n const label = this.itemLabel ? item[this.itemLabel] : item;\n const disabled = item.disabled || false;\n option.value = String(value);\n option.textContent = String(label);\n option.disabled = disabled;\n this.selectElement.appendChild(option);\n });\n }\n\n if (this.selectElement.value !== String(this.internalValue || '')) {\n this.selectElement.value = String(this.internalValue || '');\n }\n }\n\n private renderErrorMessage() {\n if (this.error) {\n return (\n <spw-field-message variant=\"error\" showIcon={this.showErrorIcon}>\n {this.error}\n </spw-field-message>\n );\n }\n }\n\n private renderHintMessage() {\n if (this.hint) {\n return (\n <spw-field-message variant=\"hint\" showIcon={this.showHintIcon}>\n {this.hint}\n </spw-field-message>\n );\n }\n }\n\n private renderSuccessMessage() {\n if (this.success) {\n return (\n <spw-field-message variant=\"success\" showIcon={this.showSuccessIcon}>\n {this.success}\n </spw-field-message>\n );\n }\n }\n\n private renderWarningMessage() {\n if (this.warning) {\n return (\n <spw-field-message variant=\"warning\" showIcon={this.showWarningIcon}>\n {this.warning}\n </spw-field-message>\n );\n }\n }\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-select': true,\n [`spw-select--${this.size}`]: true,\n 'spw-select--disabled': this.disabled,\n 'spw-select--is-error': !!this.error,\n };\n }\n\n render() {\n return (\n <Host>\n <div class={this.elementClass}>\n {this.label && <spw-field-label label={this.label} name={this.name} required={this.required}></spw-field-label>}\n {this.assistiveText && (\n <spw-field-message class=\"spw-tw-mb-2 -spw-tw-mt-1\" variant=\"hint\" showIcon={false}>\n {this.assistiveText}\n </spw-field-message>\n )}\n <div class=\"spw-select__container\">\n <select\n id={this.name}\n class=\"spw-select__trigger\"\n onChange={event => this.handleSelectChange(event)}\n disabled={this.disabled}\n ref={el => (this.selectElement = el as HTMLSelectElement)}\n tabindex={this.disabled ? -1 : 0}\n >\n <option value=\"\" disabled selected={!this.internalValue}>\n {this.placeholder}\n </option>\n </select>\n <spw-icon class=\"spw-select__arrow\" icon=\"fa-chevron-down\"></spw-icon>\n </div>\n {!this.items && <slot />}\n </div>\n {this.renderErrorMessage()}\n {this.renderHintMessage()}\n {this.renderSuccessMessage()}\n {this.renderWarningMessage()}\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAe,8zI,MCcRC,EAAS,MANtB,WAAAC,CAAAC,G,qNAgBUC,KAAKC,MAAW,GAEhBD,KAAWE,YAAW,0BAMtBF,KAAQG,SAAY,MAEpBH,KAAII,KAAuB,SAI3BJ,KAAKK,MAAY,GAEjBL,KAAIM,KAAY,GAEhBN,KAAOO,QAAY,GAEnBP,KAAOQ,QAAY,GAEnBR,KAAaS,cAAa,KAE1BT,KAAYU,aAAa,KAEzBV,KAAeW,gBAAa,KAE5BX,KAAeY,gBAAa,KAS5BZ,KAAYa,aAA2B,IAoMhD,CA/LC,iBAAAC,GACE,GAAId,KAAKe,cAAe,CACtBf,KAAKgB,oB,EAKT,iBAAMC,GACJj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as a}from"./p-CvfVJV8a.js";const s='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:contents;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host(.--is-sticky) .spw-table-header{position:sticky;top:0;z-index:50}.spw-table-header{background:var(--spw-color-themes-grey-grey-200);background-clip:padding-box;border:1px solid var(--spw-color-themes-grey-grey-300);border-bottom:none!important;border-top:none!important;box-shadow:inset 0 1px 0 var(--spw-color-themes-grey-grey-300),inset 0 -1px 0 var(--spw-color-themes-grey-grey-300);color:var(--spw-color-themes-grey-grey-800);font-size:14px;font-weight:700;text-align:left;transition:all .2s linear;white-space:nowrap}.spw-table-header--text-align-left{text-align:left}.spw-table-header--text-align-center{text-align:center}.spw-table-header--text-align-right{text-align:right}.spw-table-header--vertical-align-top{vertical-align:top}.spw-table-header--vertical-align-bottom{vertical-align:bottom}.spw-table-header--vertical-align-middle{vertical-align:middle}.spw-table-header--has-tooltip .spw-table-header__content{align-items:center;display:flex;gap:16px;justify-content:space-between}.spw-table-header--has-tooltip .spw-table-header__content spw-icon{color:var(--spw-color-themes-grey-grey-500)}.spw-table-header--has-tooltip .spw-table-header__content spw-icon:hover{color:var(--spw-color-themes-grey-grey-900)}.spw-table-header--sortable{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.spw-table-header--sortable:hover{background:var(--spw-color-themes-grey-grey-300)}.spw-table-header--sortable .spw-table-header__content{align-items:center;display:flex;gap:16px;justify-content:space-between}.spw-table-header--sortable .spw-table-header__content spw-icon{color:var(--spw-color-themes-grey-grey-500)}.spw-table-header--sortable .spw-table-header__content spw-icon:hover,.spw-table-header--sortable .spw-table-header__content--is-sorted .spw-table-header__sort-icon{color:var(--spw-color-themes-grey-grey-900)}.spw-table-header__sort-icons{display:flex;gap:0}.spw-table-header--padding-small{padding:8px}.spw-table-header--padding-medium{padding:16px}.spw-table-header__icons{align-items:center;color:var(--spw-color-themes-grey-grey-500);display:flex;gap:8px}.spw-table-header ::slotted(spw-checkbox){--spw-ds-checkbox-checked-color:#000}.spw-table-header--sticky{background-color:var(--spw-color-themes-grey-grey-200);position:sticky}.spw-table-header--sticky:after{bottom:-1px;content:"";pointer-events:none;position:absolute;top:0;transition:opacity .2s;width:8px}.spw-table-header--sticky-start:after{box-shadow:inset 8px 0 8px -8px rgba(0,0,0,.15);right:-8px}.spw-table-header--sticky-end:after{box-shadow:inset -8px 0 8px -8px rgba(0,0,0,.15);left:-8px}';const i=class{constructor(a){e(this,a);this.spwHeaderClick=t(this,"spwHeaderClick",7);this.isHighlighted=false;this.textAlign="left";this.verticalAlign="top";this.padding="medium";this.sortable=false;this.isSorted=false;this.sticky=false;this.stickyPosition="start";this.stickyOffset=0;this.handleClick=e=>{if(e.target.closest('[slot="filters"]')){e.stopPropagation();return}if(this.sortable){this.spwHeaderClick.emit(this.columnId)}}}get elementClass(){return{"spw-table-header":true,"spw-table-header--sortable":this.sortable,"spw-table-header--is-sorted":this.isSorted,"spw-table-header--has-tooltip":!!(this.tooltipTitle||this.tooltipText),[`spw-table-header--padding-${this.padding}`]:true,[`spw-table-header--text-align-${this.textAlign}`]:true,[`spw-table-header--vertical-align-${this.verticalAlign}`]:true,"spw-table-header--sticky":this.sticky,[`spw-table-header--sticky-${this.stickyPosition}`]:this.sticky}}render(){const e={"aria-sort":this.isSorted?this.sortDirection:"none",onClick:this.handleClick,class:this.elementClass,colSpan:this.colspan,headers:this.headers,part:"cell",rowSpan:this.rowspan};if(this.sticky){const t={position:"sticky",zIndex:"60"};if(this.stickyPosition==="start"){t.left=`${this.stickyOffset}px`}else{t.right=`${this.stickyOffset}px`}e.style=t}return a("th",Object.assign({key:"72a54f9eb43f87e80da3bfe45a6eb848cf11e09f"},e),a("div",{key:"06111c36e9fa869e263dfb1bc64fa023acf42538",class:{"spw-table-header__content":true,"spw-table-header__content--is-sorted":this.isSorted}},a("slot",{key:"16439694bfaf17d5f1371ffd817f16ba7bc4ecdc"}),a("div",{key:"4b8cf5f4de063c8aa9c2ea8b653d9a35b1ae64b0",class:"spw-table-header__icons"},a("slot",{key:"d9816f83f71672ebda6b27b705142666e376ec7a",name:"filters"}),(this.tooltipTitle||this.tooltipText)&&a("spw-tooltip",{key:"a8c4e3d4a555806faef984533696c393173b7ad7","tooltip-title":this.tooltipTitle,"tooltip-text":this.tooltipText},a("spw-icon",{key:"92a361a5400a2cb09c3ccf68a713897076e019b6",variant:"fa-regular",icon:"fa-circle-question"})),this.sortable&&a("spw-icon",{key:"db44bf3aa7be154edecf0281f3335edf0896eb01",class:"spw-table-header__sort-icon",icon:this.isSorted?this.sortDirection==="asc"?"fa-arrow-up-short-wide":"fa-arrow-down-wide-short":"fa-arrow-up-arrow-down"}))))}};i.style=s;export{i as spw_table_header};
2
+ //# sourceMappingURL=p-2ad00dfc.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwTableHeaderCss","SpwTableHeader","constructor","hostRef","this","isHighlighted","textAlign","verticalAlign","padding","sortable","isSorted","sticky","stickyPosition","stickyOffset","handleClick","event","target","closest","stopPropagation","spwHeaderClick","emit","columnId","elementClass","tooltipTitle","tooltipText","render","attrs","sortDirection","onClick","class","colSpan","colspan","headers","part","rowSpan","rowspan","stickyStyles","position","zIndex","left","right","style","h","Object","assign","key","name","variant","icon"],"sources":["src/components/spw-table/spw-table-header/spw-table-header.scss?tag=spw-table-header&encapsulation=shadow","src/components/spw-table/spw-table-header/spw-table-header.tsx"],"sourcesContent":[":host {\n display: contents;\n}\n\n:host(.--is-sticky) {\n .spw-table-header {\n position: sticky;\n top: 0;\n z-index: 50;\n }\n}\n\n.spw-table-header {\n border: 1px solid var(--spw-color-themes-grey-grey-300);\n color: var(--spw-color-themes-grey-grey-800);\n font-size: 14px;\n text-align: left;\n font-weight: 700;\n transition: all 0.2s linear;\n background: var(--spw-color-themes-grey-grey-200);\n white-space: nowrap;\n border-top: none !important;\n border-bottom: none !important;\n box-shadow:\n inset 0 1px 0 var(--spw-color-themes-grey-grey-300),\n inset 0 -1px 0 var(--spw-color-themes-grey-grey-300);\n\n background-clip: padding-box;\n\n &--text-align-left {\n text-align: left;\n }\n &--text-align-center {\n text-align: center;\n }\n &--text-align-right {\n text-align: right;\n }\n &--vertical-align-top {\n vertical-align: top;\n }\n &--vertical-align-bottom {\n vertical-align: bottom;\n }\n &--vertical-align-middle {\n vertical-align: middle;\n }\n\n &--has-tooltip {\n .spw-table-header__content {\n display: flex;\n gap: 16px;\n justify-content: space-between;\n align-items: center;\n spw-icon {\n color: var(--spw-color-themes-grey-grey-500);\n &:hover {\n color: var(--spw-color-themes-grey-grey-900);\n }\n }\n }\n }\n &--sortable {\n user-select: none;\n cursor: pointer;\n &:hover {\n background: var(--spw-color-themes-grey-grey-300);\n }\n .spw-table-header__content {\n display: flex;\n gap: 16px;\n justify-content: space-between;\n align-items: center;\n spw-icon {\n color: var(--spw-color-themes-grey-grey-500);\n &:hover {\n color: var(--spw-color-themes-grey-grey-900);\n }\n }\n &--is-sorted {\n .spw-table-header__sort-icon {\n color: var(--spw-color-themes-grey-grey-900);\n }\n }\n }\n }\n &__sort-icons {\n display: flex;\n gap: 0;\n }\n &--padding-small {\n padding: 8px;\n }\n &--padding-medium {\n padding: 16px;\n }\n &__icons {\n display: flex;\n gap: 8px;\n align-items: center;\n color: var(--spw-color-themes-grey-grey-500);\n }\n ::slotted(spw-checkbox) {\n --spw-ds-checkbox-checked-color: #000;\n }\n\n &--sticky {\n position: sticky;\n background-color: var(--spw-color-themes-grey-grey-200);\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: -1px;\n width: 8px;\n pointer-events: none;\n transition: opacity 0.2s;\n }\n\n &-start::after {\n right: -8px;\n box-shadow: inset 8px 0 8px -8px rgba(0, 0, 0, 0.15);\n }\n\n &-end::after {\n left: -8px;\n box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.15);\n }\n }\n}\n","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\n\n@Component({\n tag: 'spw-table-header',\n styleUrl: 'spw-table-header.scss',\n shadow: true,\n})\nexport class SpwTableHeader {\n /** Définit un colspan pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() colspan?: HTMLTableCellElement['colSpan'];\n /** Définit un header relationnel pour la cellule, à des fins d'accessibilité (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() headers?: HTMLTableCellElement['headers'];\n /** Définit un rowspan pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() rowspan?: HTMLTableCellElement['rowSpan'];\n /** Définit un style visuel qui met en avant la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() isHighlighted?: boolean = false;\n /** Définit un alignement de texte pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() textAlign?: 'center' | 'left' | 'right' = 'left';\n /** Définit un alignement vertical pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() verticalAlign?: 'top' | 'bottom' | 'middle' = 'top';\n /** Définit le padding pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() padding?: 'small' | 'medium' = 'medium';\n /** Définit id pour la colonne (en cas de tri) (à appliquer sur spw-table-header) */\n @Prop() columnId: string;\n /** Définit si la colonne est triable (à appliquer sur spw-table-header) */\n @Prop() sortable?: boolean = false;\n /** Définit la direction pour le tri sur la colonne (ascendant ou descendant) (à appliquer sur spw-table-header) */\n @Prop() sortDirection?: 'asc' | 'desc';\n /** Définit si la colonne est triée ou non (à appliquer sur spw-table-header) */\n @Prop() isSorted?: boolean = false;\n /** Définit un titre pour le tooltip (à appliquer sur spw-table-header) */\n @Prop() tooltipTitle?: string;\n /** Définit un contenu pour le tooltip (à appliquer sur spw-table-header) */\n @Prop() tooltipText?: string;\n /** Rend la cellule sticky lors du défilement horizontal (à appliquer sur spw-table-header ou spw-table-cell) */\n @Prop() sticky?: boolean = false;\n /** Position du sticky : 'start' (left: 0) ou 'end' (right: 0) (à appliquer sur spw-table-header ou spw-table-cell) */\n @Prop() stickyPosition?: 'start' | 'end' = 'start';\n /** Décalage en pixels pour le sticky (utile pour empiler plusieurs colonnes sticky) (à appliquer sur spw-table-header ou spw-table-cell) */\n @Prop() stickyOffset?: number = 0;\n\n @Event() spwHeaderClick: EventEmitter<string>;\n\n private handleClick = (event: MouseEvent) => {\n if ((event.target as HTMLElement).closest('[slot=\"filters\"]')) {\n event.stopPropagation();\n return;\n }\n if (this.sortable) {\n this.spwHeaderClick.emit(this.columnId);\n }\n };\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-table-header': true,\n 'spw-table-header--sortable': this.sortable,\n 'spw-table-header--is-sorted': this.isSorted,\n 'spw-table-header--has-tooltip': !!(this.tooltipTitle || this.tooltipText),\n [`spw-table-header--padding-${this.padding}`]: true,\n [`spw-table-header--text-align-${this.textAlign}`]: true,\n [`spw-table-header--vertical-align-${this.verticalAlign}`]: true,\n 'spw-table-header--sticky': this.sticky,\n [`spw-table-header--sticky-${this.stickyPosition}`]: this.sticky,\n };\n }\n\n render() {\n const attrs: { [key: string]: any } = {\n 'aria-sort': this.isSorted ? this.sortDirection : 'none',\n 'onClick': this.handleClick,\n 'class': this.elementClass,\n 'colSpan': this.colspan,\n 'headers': this.headers,\n 'part': 'cell',\n 'rowSpan': this.rowspan,\n };\n\n if (this.sticky) {\n const stickyStyles: { [key: string]: string } = {\n position: 'sticky',\n zIndex: '60',\n };\n\n if (this.stickyPosition === 'start') {\n stickyStyles.left = `${this.stickyOffset}px`;\n } else {\n stickyStyles.right = `${this.stickyOffset}px`;\n }\n\n attrs.style = stickyStyles;\n }\n\n return (\n <th {...attrs}>\n <div\n class={{\n 'spw-table-header__content': true,\n 'spw-table-header__content--is-sorted': this.isSorted,\n }}\n >\n <slot />\n <div class=\"spw-table-header__icons\">\n <slot name=\"filters\"></slot>\n {(this.tooltipTitle || this.tooltipText) && (\n <spw-tooltip tooltip-title={this.tooltipTitle} tooltip-text={this.tooltipText}>\n <spw-icon variant=\"fa-regular\" icon=\"fa-circle-question\"></spw-icon>\n </spw-tooltip>\n )}\n {this.sortable && (\n <spw-icon\n class=\"spw-table-header__sort-icon\"\n icon={this.isSorted ? (this.sortDirection === 'asc' ? 'fa-arrow-up-short-wide' : 'fa-arrow-down-wide-short') : 'fa-arrow-up-arrow-down'}\n ></spw-icon>\n )}\n </div>\n </div>\n </th>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAoB,koK,MCObC,EAAc,MAL3B,WAAAC,CAAAC,G,yDAaUC,KAAaC,cAAa,MAE1BD,KAASE,UAAiC,OAE1CF,KAAaG,cAAiC,MAE9CH,KAAOI,QAAwB,SAI/BJ,KAAQK,SAAa,MAIrBL,KAAQM,SAAa,MAMrBN,KAAMO,OAAa,MAEnBP,KAAcQ,eAAqB,QAEnCR,KAAYS,aAAY,EAIxBT,KAAAU,YAAeC,IACrB,GAAKA,EAAMC,OAAuBC,QAAQ,oBAAqB,CAC7DF,EAAMG,kBACN,M,CAEF,GAAId,KAAKK,SAAU,CACjBL,KAAKe,eAAeC,KAAKhB,KAAKiB,S,EAuEnC,CAnEC,gBAAYC,GACV,MAAO,CACL,mBAAoB,KACpB,6BAA8BlB,KAAKK,SACnC,8BAA+BL,KAAKM,SACpC,mCAAoCN,KAAKmB,cAAgBnB,KAAKoB,aAC9D,CAAC,6BAA6BpB,KAAKI,WAAY,KAC/C,CAAC,gCAAgCJ,KAAKE,aAAc,KACpD,CAAC,oCAAoCF,KAAKG,iBAAkB,KAC5D,2BAA4BH,KAAKO,OACjC,CAAC,4BAA4BP,KAAKQ,kBAAmBR,KAAKO,O,CAI9D,MAAAc,GACE,MAAMC,EAAgC,CACpC,YAAatB,KAAKM,SAAWN,KAAKuB,cAAgB,OAClDC,QAAWxB,KAAKU,YAChBe,MAASzB,KAAKkB,aACdQ,QAAW1B,KAAK2B,QAChBC,QAAW5B,KAAK4B,QAChBC,KAAQ,OACRC,QAAW9B,KAAK+B,SAGlB,GAAI/B,KAAKO,OAAQ,CACf,MAAMyB,EAA0C,CAC9CC,SAAU,SACVC,OAAQ,MAGV,GAAIlC,KAAKQ,iBAAmB,QAAS,CACnCwB,EAAaG,KAAO,GAAGnC,KAAKS,gB,KACvB,CACLuB,EAAaI,MAAQ,GAAGpC,KAAKS,gB,CAG/Ba,EAAMe,MAAQL,C,CAGhB,OACEM,EAAA,KAAAC,OAAAC,OAAA,CAAAC,IAAA,4CAAQnB,GACNgB,EAAA,OAAAG,IAAA,2CACEhB,MAAO,CACL,4BAA6B,KAC7B,uCAAwCzB,KAAKM,WAG/CgC,EAAQ,QAAAG,IAAA,6CACRH,EAAK,OAAAG,IAAA,2CAAAhB,MAAM,2BACTa,EAAM,QAAAG,IAAA,2CAAAC,KAAK,aACT1C,KAAKmB,cAAgBnB,KAAKoB,cAC1BkB,EAAA,eAAAG,IAAA,2DAA4BzC,KAAKmB,aAA4B,eAAAnB,KAAKoB,aAChEkB,EAAU,YAAAG,IAAA,2CAAAE,QAAQ,aAAaC,KAAK,wBAGvC5C,KAAKK,UACJiC,EACE,YAAAG,IAAA,2CAAAhB,MAAM,8BACNmB,KAAM5C,KAAKM,SAAYN,KAAKuB,gBAAkB,MAAQ,yBAA2B,2BAA8B,6B","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,h as t,H as o,g as n}from"./p-CvfVJV8a.js";const i="/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:contents;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host([data-row-style=odd]) .spw-table-row{background-color:var(--spw-color-themes-grey-grey-50)}.spw-table-row{position:relative}.spw-table-row--disabled{background:#fff}.spw-table-row--selected{background-color:var(--spw-color-themes-blue-blue-50);box-shadow:inset 3px 0 0 var(--spw-color-themes-blue-blue-500)}";const s=class{constructor(t){e(this,t);this.state="default"}componentDidLoad(){this.applyPropsToChildren()}slotChanged(){this.applyPropsToChildren()}onStateChange(){this.applyPropsToChildren()}onPaddingChange(){this.applyPropsToChildren()}applyPropsToChildren(){requestAnimationFrame((()=>{const e=this.el.querySelectorAll("spw-table-cell, spw-table-header");const t=`--${this.state}`;e.forEach((e=>{e.classList.remove("--default","--selected","--disabled");if(this.state!=="default"){e.classList.add(t)}if(this.padding&&!e.hasAttribute("padding")){e.padding=this.padding}}))}))}get elementClass(){return{"spw-table-row":true,[`spw-table-row--${this.state}`]:true}}render(){return t(o,{key:"a92e7619db6ca66332e5680add2f4f074ddb5db5",part:"row"},t("tr",{key:"198d8027ea3cd377444f476e0c77d35de50c22c2",class:this.elementClass,part:"row"},t("slot",{key:"667fb895983eff3077f36da1ac0d31756c8dd691"})))}get el(){return n(this)}static get watchers(){return{state:["onStateChange"],padding:["onPaddingChange"]}}};s.style=i;export{s as spw_table_row};
2
+ //# sourceMappingURL=p-4a273848.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwTableRowCss","SpwTableRow","constructor","hostRef","this","state","componentDidLoad","applyPropsToChildren","slotChanged","onStateChange","onPaddingChange","requestAnimationFrame","cells","el","querySelectorAll","stateClass","forEach","cell","classList","remove","add","padding","hasAttribute","elementClass","render","h","Host","key","part","class"],"sources":["src/components/spw-table/spw-table-row/spw-table-row.scss?tag=spw-table-row&encapsulation=shadow","src/components/spw-table/spw-table-row/spw-table-row.tsx"],"sourcesContent":[":host {\n display: contents;\n}\n\n:host([data-row-style='odd']) {\n .spw-table-row {\n background-color: var(--spw-color-themes-grey-grey-50);\n }\n}\n\n.spw-table-row {\n position: relative;\n\n &--disabled {\n background: white;\n }\n &--selected {\n background-color: var(--spw-color-themes-blue-blue-50);\n box-shadow: inset 3px 0 0 var(--spw-color-themes-blue-blue-500);\n }\n}\n","import { Component, Host, Prop, Element, Listen, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'spw-table-row',\n styleUrl: 'spw-table-row.scss',\n shadow: true,\n})\nexport class SpwTableRow {\n @Element() el: HTMLSpwTableRowElement;\n\n /** Permet de changer le state du spw-table-row */\n @Prop() state?: 'default' | 'selected' | 'disabled' = 'default';\n /** Définit le padding pour toutes les cellules de la row */\n @Prop() padding?: 'small' | 'medium';\n\n componentDidLoad() {\n this.applyPropsToChildren();\n }\n\n @Listen('slotchange')\n slotChanged() {\n this.applyPropsToChildren();\n }\n\n @Watch('state')\n onStateChange() {\n this.applyPropsToChildren();\n }\n\n @Watch('padding')\n onPaddingChange() {\n this.applyPropsToChildren();\n }\n\n private applyPropsToChildren() {\n requestAnimationFrame(() => {\n const cells = this.el.querySelectorAll('spw-table-cell, spw-table-header');\n const stateClass = `--${this.state}`;\n\n cells.forEach(cell => {\n cell.classList.remove('--default', '--selected', '--disabled');\n if (this.state !== 'default') {\n cell.classList.add(stateClass);\n }\n\n if (this.padding && !cell.hasAttribute('padding')) {\n (cell as any).padding = this.padding;\n }\n });\n });\n }\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-table-row': true,\n [`spw-table-row--${this.state}`]: true,\n };\n }\n\n render() {\n return (\n <Host part=\"row\">\n <tr class={this.elementClass} part=\"row\">\n <slot />\n </tr>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAiB,y4F,MCOVC,EAAW,MALxB,WAAAC,CAAAC,G,UASUC,KAAKC,MAAyC,SAyDvD,CArDC,gBAAAC,GACEF,KAAKG,sB,CAIP,WAAAC,GACEJ,KAAKG,sB,CAIP,aAAAE,GACEL,KAAKG,sB,CAIP,eAAAG,GACEN,KAAKG,sB,CAGC,oBAAAA,GACNI,uBAAsB,KACpB,MAAMC,EAAQR,KAAKS,GAAGC,iBAAiB,oCACvC,MAAMC,EAAa,KAAKX,KAAKC,QAE7BO,EAAMI,SAAQC,IACZA,EAAKC,UAAUC,OAAO,YAAa,aAAc,cACjD,GAAIf,KAAKC,QAAU,UAAW,CAC5BY,EAAKC,UAAUE,IAAIL,E,CAGrB,GAAIX,KAAKiB,UAAYJ,EAAKK,aAAa,WAAY,CAChDL,EAAaI,QAAUjB,KAAKiB,O,IAE/B,G,CAIN,gBAAYE,GACV,MAAO,CACL,gBAAiB,KACjB,CAAC,kBAAkBnB,KAAKC,SAAU,K,CAItC,MAAAmB,GACE,OACEC,EAACC,EAAK,CAAAC,IAAA,2CAAAC,KAAK,OACTH,EAAI,MAAAE,IAAA,2CAAAE,MAAOzB,KAAKmB,aAAcK,KAAK,OACjCH,EAAQ,QAAAE,IAAA,8C","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as e,h as t}from"./p-CvfVJV8a.js";const o="/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:contents;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host-context(.spw-table--is-sticky) caption{background:var(--spw-ds-white);border:1px solid var(--spw-color-themes-grey-grey-300);bottom:0;position:sticky;z-index:20}.spw-table-footer{align-items:center;caption-side:bottom;color:var(--spw-color-themes-grey-grey-900);display:flex;font-size:14px;gap:16px;justify-content:space-between;padding:16px 24px}.spw-table-footer ::slotted([slot=right]){align-items:center;display:inline-flex;gap:8px}";const i=class{constructor(t){e(this,t)}render(){return t("caption",{key:"b3a44bdef9702153da340157aa91c915a2a500c3",part:"tfoot",style:{captionSide:"bottom"}},t("div",{key:"a4243321891d910e9facca40ff68828a140af354",class:"spw-table-footer"},t("slot",{key:"1f5ff5b35f7032674c1e5b1486e4457415ea60b3",name:"left"}),t("slot",{key:"1299dec5aacd636c36325085a7753b87ef4f0a4b",name:"center"}),t("slot",{key:"edfe9a8832c3d869ab0c1ce6c3636069579a8487",name:"right"})))}};i.style=o;export{i as spw_table_footer};
2
- //# sourceMappingURL=p-31793077.entry.js.map
1
+ import{r as e,h as t}from"./p-CvfVJV8a.js";const o="/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:contents;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host(.--is-sticky) caption{bottom:0;position:sticky;z-index:20}caption{background:var(--spw-ds-white);border:1px solid var(--spw-color-themes-grey-grey-300)}.spw-table-footer{align-items:center;caption-side:bottom;color:var(--spw-color-themes-grey-grey-900);display:flex;font-size:14px;gap:16px;justify-content:space-between;padding:16px 24px}.spw-table-footer ::slotted([slot=right]){align-items:center;display:inline-flex;gap:8px}";const i=class{constructor(t){e(this,t)}render(){return t("caption",{key:"b3a44bdef9702153da340157aa91c915a2a500c3",part:"tfoot",style:{captionSide:"bottom"}},t("div",{key:"a4243321891d910e9facca40ff68828a140af354",class:"spw-table-footer"},t("slot",{key:"1f5ff5b35f7032674c1e5b1486e4457415ea60b3",name:"left"}),t("slot",{key:"1299dec5aacd636c36325085a7753b87ef4f0a4b",name:"center"}),t("slot",{key:"edfe9a8832c3d869ab0c1ce6c3636069579a8487",name:"right"})))}};i.style=o;export{i as spw_table_footer};
2
+ //# sourceMappingURL=p-5632f307.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwTableFooterCss","SpwTableFooter","render","h","key","part","style","captionSide","class","name"],"sources":["src/components/spw-table/spw-table-footer/spw-table-footer.scss?tag=spw-table-footer&encapsulation=shadow","src/components/spw-table/spw-table-footer/spw-table-footer.tsx"],"sourcesContent":[":host {\n display: contents;\n}\n\n:host(.--is-sticky) {\n caption {\n position: sticky;\n bottom: 0;\n z-index: 20;\n }\n}\n\ncaption {\n background: var(--spw-ds-white);\n border: 1px solid var(--spw-color-themes-grey-grey-300);\n}\n\n.spw-table-footer {\n padding: 16px 24px;\n caption-side: bottom;\n font-size: 14px;\n color: var(--spw-color-themes-grey-grey-900);\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 16px;\n ::slotted([slot='right']) {\n display: inline-flex;\n gap: 8px;\n align-items: center;\n }\n}\n","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'spw-table-footer',\n styleUrl: 'spw-table-footer.scss',\n shadow: true,\n})\nexport class SpwTableFooter {\n render() {\n return (\n <caption part=\"tfoot\" style={{ captionSide: 'bottom' }}>\n <div class=\"spw-table-footer\">\n <slot name=\"left\" />\n <slot name=\"center\" />\n <slot name=\"right\" />\n </div>\n </caption>\n );\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAoB,igG,MCObC,EAAc,M,yBACzB,MAAAC,GACE,OACEC,EAAA,WAAAC,IAAA,2CAASC,KAAK,QAAQC,MAAO,CAAEC,YAAa,WAC1CJ,EAAK,OAAAC,IAAA,2CAAAI,MAAM,oBACTL,EAAM,QAAAC,IAAA,2CAAAK,KAAK,SACXN,EAAM,QAAAC,IAAA,2CAAAK,KAAK,WACXN,EAAA,QAAAC,IAAA,2CAAMK,KAAK,W","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as e,F as a,H as s}from"./p-CvfVJV8a.js";const n="/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-pagination__item button,.spw-pagination__item--dots{border-radius:32px;font-size:14px;font-weight:700;height:32px;line-height:32px;min-width:32px;text-align:center}.spw-pagination__item button:focus-visible,.spw-pagination__item--dots:focus-visible{box-shadow:0 0 0 5px #000;outline:3px solid #fff;outline-offset:-1px}.spw-pagination{align-items:center;display:flex;flex-direction:column}@media (min-width:768px){.spw-pagination{align-items:flex-start}}.spw-pagination ul{align-items:center;display:flex;padding:0}.spw-pagination__item{margin-right:12px}.spw-pagination__item spw-icon{font-size:18px}.spw-pagination__item button{background:none;border:none;color:var(--spw-color-themes-grey-grey-900);cursor:pointer;margin:0;padding:0 6px}.spw-pagination__item:not(.spw-pagination__item--active,.spw-pagination__item--dots,.spw-pagination__item--disabled):hover button{background:var(--spw-color-themes-grey-grey-200)}.spw-pagination__item:not(.spw-pagination__item--active,.spw-pagination__item--dots,.spw-pagination__item--disabled):active button{background:var(--spw-color-themes-grey-grey-300)}.spw-pagination__item--arrow button{align-items:center;display:flex;gap:8px;padding:0 12px;text-decoration:underline}.spw-pagination__item--arrow button:hover{text-decoration:none}.spw-pagination__item--dots{align-items:center;background:none;color:var(--spw-color-themes-grey-grey-400);cursor:default;display:inline-flex;justify-content:center;position:relative;top:3px}.spw-pagination__item--dots spw-icon{font-size:16px}.spw-pagination__item--desktop{display:none}@media (min-width:768px){.spw-pagination__item--desktop{display:inline-block}}.spw-pagination__item--active button{background:var(--spw-ds-primary);color:#fff}.spw-pagination__input spw-text-field{--spw-input-height:32px;--spw-input-padding:0 4px;--spw-input-text-align:center;--spw-input-font-size:14px;width:36px}.spw-pagination__mobile-arrows{margin-top:12px}@media (min-width:768px){.spw-pagination__mobile-arrows{display:none!important}}.spw-pagination__total-pages{font-size:14px;margin:0 12px 0 6px}.spw-tw-mb-10{margin-bottom:2.5rem}.spw-tw-mb-6{margin-bottom:1.5rem}.spw-tw-ml-2{margin-left:.5rem}.spw-tw-mr-4{margin-right:1rem}.spw-tw-mt-12{margin-top:3rem}.-spw-tw-mt-1{margin-top:-.25rem}.spw-tw-mb-2{margin-bottom:.5rem}";const o=class{constructor(e){t(this,e);this.pageChanged=i(this,"pageChanged",7);this.isDisabled=false;this.variant="numbers";this.currentPage=1;this.inputPageValue="";this.isMobile=window.innerWidth<800;this.updateIsMobile=()=>{this.isMobile=window.innerWidth<800}}componentWillLoad(){this.calculateTotalPages();this.inputPageValue=this.currentPage.toString();window.addEventListener("resize",this.updateIsMobile)}disconnectedCallback(){window.removeEventListener("resize",this.updateIsMobile)}calculateTotalPages(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)}onItemsPerPageChange(){this.currentPage=1;this.inputPageValue="1";this.pageChanged.emit(this.currentPage)}onTotalItemsChange(){const t=Math.ceil(this.totalItems/this.itemsPerPage);if(this.currentPage>t||this.currentPage===0){this.currentPage=1;this.inputPageValue="1";this.pageChanged.emit(this.currentPage)}}async setPage(t){this.goToPage(t)}goToPage(t){if(t!==this.currentPage&&!this.isDisabled&&t>=1&&t<=this.totalPages){this.currentPage=t;this.inputPageValue=this.currentPage.toString();this.pageChanged.emit(this.currentPage)}}handleInputChange(t){const i=t.target.value;this.inputPageValue=i;const e=parseInt(i,10);if(!isNaN(e)&&e>=1&&e<=this.totalPages){clearTimeout(this.debounceTimer);this.debounceTimer=setTimeout((()=>{this.goToPage(e)}),500)}}getPaginationClass(){var t,i;const e=this.calculatePageRange();const a=e.filter((({page:t})=>t==="...")).length;const s=a>0&&((t=e[1])===null||t===void 0?void 0:t.page)==="...";const n=a>0&&((i=e[e.length-2])===null||i===void 0?void 0:i.page)==="...";let o=`spw-pagination spw-pagination--${this.currentPage} spw-pagination--total-${this.totalPages}`;if(a===2){o+=" spw-pagination--double-ellipsis"}else if(s){o+=" spw-pagination--ellipsis-start"}else if(n){o+=" spw-pagination--ellipsis-end"}return o}handleKeyDown(t){if(t.key==="Enter"){const t=parseInt(this.inputPageValue,10);if(!isNaN(t)){this.goToPage(t)}}}calculatePageRange(){const t=[];const{currentPage:i,totalPages:e,isMobile:a}=this;if(a){if(e<=5){for(let i=1;i<=e;i++){t.push({page:i,class:"spw-pagination__item--small-range"})}}else if(i<=3){for(let i=1;i<=3;i++){t.push({page:i,class:"spw-pagination__item--start-range"})}t.push({page:"...",class:"spw-pagination__item--ellipsis"});t.push({page:e,class:"spw-pagination__item--end"})}else if(i>=e-2){t.push({page:1,class:"spw-pagination__item--start"});t.push({page:"...",class:"spw-pagination__item--ellipsis"});for(let i=e-2;i<=e;i++){t.push({page:i,class:"spw-pagination__item--end-range"})}}else{t.push({page:1,class:"spw-pagination__item--start"});t.push({page:"...",class:"spw-pagination__item--ellipsis"});for(let e=i-1;e<=i+1;e++){t.push({page:e,class:"spw-pagination__item--middle-range"})}t.push({page:"...",class:"spw-pagination__item--ellipsis"});t.push({page:e,class:"spw-pagination__item--end"})}}else{if(e<=7){for(let i=1;i<=e;i++){t.push({page:i,class:"spw-pagination__item--small-range"})}}else if(i<=4){for(let i=1;i<=4;i++){t.push({page:i,class:"spw-pagination__item--start-range"})}t.push({page:"...",class:"spw-pagination__item--ellipsis"});t.push({page:e,class:"spw-pagination__item--end"})}else if(i>=e-3){t.push({page:1,class:"spw-pagination__item--start"});t.push({page:"...",class:"spw-pagination__item--ellipsis"});for(let i=e-3;i<=e;i++){t.push({page:i,class:"spw-pagination__item--end-range"})}}else{t.push({page:1,class:"spw-pagination__item--start"});t.push({page:"...",class:"spw-pagination__item--ellipsis"});for(let e=i-2;e<=i+2;e++){t.push({page:e,class:"spw-pagination__item--middle-range"})}t.push({page:"...",class:"spw-pagination__item--ellipsis"});t.push({page:e,class:"spw-pagination__item--end"})}}return t}render(){const t=this.calculatePageRange();const i=this.currentPage>1;const n=this.currentPage<this.totalPages;const o=i&&e("li",{key:"c96747975f1283f426b16fc5d6b9169641bf937a",class:"spw-pagination__item spw-pagination__item--desktop spw-pagination__item--arrow"},e("button",{key:"2cb14838bb36158b08708be2a6c851eab28d8a9e",onClick:()=>this.goToPage(this.currentPage-1)},e("spw-icon",{key:"4a97d865f50b82f807b699d2c9962cadb2fa3c49",icon:"fa-chevron-left"})," ",e("span",{key:"85d4eba965c575bf620ac2775fc8b8ab91582c53",class:"spw-pagination__item-arrow-text"},"Précédent")));const p=n&&e("li",{key:"db5e31a07af299158c0730b2c8ffdc647eb9c798",class:"spw-pagination__item spw-pagination__item--desktop spw-pagination__item--arrow"},e("button",{key:"a2c031078bce4993152b5441e149c00d4633cefe",onClick:()=>this.goToPage(this.currentPage+1)},e("span",{key:"28cdbfbcca8698294fae48d72a3d0a8932f0a94f",class:"spw-pagination__item-arrow-text"},"Suivant")," ",e("spw-icon",{key:"8af477a9a0eb495234278335eca66b7ca0b06fbe",icon:"fa-chevron-right"})));const c=this.currentPage>1&&e("li",{key:"7509af0d29a02f64d67717753d71f2aa05349177",class:"spw-pagination__item spw-pagination__item--arrow"},e("button",{key:"c3707cdd586dd519eaa00621eed632f73c5b00b6",onClick:()=>this.goToPage(this.currentPage-1)},e("spw-icon",{key:"f1fcf011715c381330865d20f1628ef24edb1778",icon:"fa-chevron-left"})," ",e("span",{key:"b9753065430534df7f5b499d97bf4bbad12c32d5"},"Précédent")));const r=this.currentPage<this.totalPages&&e("li",{key:"0c3fcbc4f482b151ef5355c2cd24378a7a2c7af3",class:"spw-pagination__item spw-pagination__item--arrow"},e("button",{key:"f363b0de0131d011336fccdbf17dc9bc2b5eca15",onClick:()=>this.goToPage(this.currentPage+1),disabled:this.currentPage>=this.totalPages},e("span",{key:"74df65c99c48fc1aec8084359866227ecdd26dbc"},"Suivant")," ",e("spw-icon",{key:"98e057e8cb6318ea06c2543fb4eae8500fcef87c",icon:"fa-chevron-right"})));const l=e("ul",{key:"a4bff20ae94b1b94d70a8781cf311997c54c87e7",class:"spw-pagination__mobile-arrows"},c,r);return e(s,{key:"fc202908905cb6da3eea73312068961b60cc776b"},e("div",{key:"351bc8518011e937ee51c4831ac13797be51a6cb",class:this.getPaginationClass()},this.variant==="input"&&e(a,{key:"684feca5a1724c030f21733850370eaf87153c13"},e("ul",{key:"14de6cc555d4cab07ef9cb8dbdc0d3e83a25f67b"},o,e("li",{key:"825297b0b82ef635497f3470ffcc5478646a558d",class:"spw-pagination__input"},e("spw-text-field",{key:"3010c66645025021ca8b678b1dedcc65810e3742",value:this.inputPageValue,type:"text",onInput:t=>this.handleInputChange(t),onKeyDown:t=>this.handleKeyDown(t),disabled:this.isDisabled})),e("li",{key:"4273e7a738ef59ff77229580d89effeaeda18091",class:"spw-pagination__total-pages"},"sur ",this.totalPages," pages"),p),l),this.variant==="numbers"&&e(a,{key:"159503f57df6936053bbffeb4ed28bd01dff38ff"},e("ul",{key:"87e707dd1060d3c3ccb6367f99e1c6cefabf99b8"},o,t.map((({page:t,class:i})=>{if(t==="..."){return e("li",{class:`spw-pagination__item spw-pagination__item--dots ${i}`},e("spw-icon",{icon:"fa-ellipsis"}))}return e("li",{class:{"spw-pagination__item":true,"spw-pagination__item--active":t===this.currentPage,[i]:true}},e("button",{onClick:()=>this.goToPage(t),disabled:t===this.currentPage},t))})),p),l)))}static get watchers(){return{totalItems:["calculateTotalPages","onTotalItemsChange"],itemsPerPage:["calculateTotalPages","onItemsPerPageChange"],currentPage:["calculateTotalPages"]}}};o.style=n;export{o as spw_pagination};
2
+ //# sourceMappingURL=p-5e43e2ed.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwPaginationCss","SpwPagination","constructor","hostRef","this","isDisabled","variant","currentPage","inputPageValue","isMobile","window","innerWidth","updateIsMobile","componentWillLoad","calculateTotalPages","toString","addEventListener","disconnectedCallback","removeEventListener","totalPages","Math","ceil","totalItems","itemsPerPage","onItemsPerPageChange","pageChanged","emit","onTotalItemsChange","newTotalPages","setPage","page","goToPage","handleInputChange","event","inputValue","target","value","parseInt","isNaN","clearTimeout","debounceTimer","setTimeout","getPaginationClass","pages","calculatePageRange","ellipsisCount","filter","length","hasEllipsisStart","_a","hasEllipsisEnd","_b","paginationClass","handleKeyDown","key","i","push","class","render","showPrevArrow","showNextArrow","prevArrow","h","onClick","icon","nextArrow","prevArrowMobile","nextArrowMobile","disabled","mobileArrows","Host","Fragment","type","onInput","onKeyDown","map","pageClass"],"sources":["src/components/spw-pagination/spw-pagination.scss?tag=spw-pagination&encapsulation=shadow","src/components/spw-pagination/spw-pagination.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n%button {\n text-align: center;\n line-height: 32px;\n font-weight: 700;\n border-radius: 32px;\n font-size: 14px;\n min-width: 32px;\n height: 32px;\n &:focus-visible {\n outline: 3px solid white;\n outline-offset: -1px;\n box-shadow: 0 0 0 5px black;\n }\n}\n\n.spw-pagination {\n display: flex;\n flex-direction: column;\n align-items: center;\n @include breakpoint(md) {\n align-items: flex-start;\n }\n\n ul {\n display: flex;\n align-items: center;\n padding: 0;\n }\n\n &__item {\n margin-right: 12px;\n spw-icon {\n font-size: 18px;\n }\n button {\n padding: 0 6px;\n margin: 0;\n border: none;\n cursor: pointer;\n color: var(--spw-color-themes-grey-grey-900);\n background: none;\n @extend %button;\n }\n\n &:not(.spw-pagination__item--active, .spw-pagination__item--dots, .spw-pagination__item--disabled):hover {\n button {\n background: var(--spw-color-themes-grey-grey-200);\n }\n }\n\n &:not(.spw-pagination__item--active, .spw-pagination__item--dots, .spw-pagination__item--disabled):active {\n button {\n background: var(--spw-color-themes-grey-grey-300);\n }\n }\n\n &--arrow {\n button {\n padding: 0 12px;\n display: flex;\n gap: 8px;\n align-items: center;\n text-decoration: underline;\n &:hover {\n text-decoration: none;\n }\n }\n }\n\n &--dots {\n position: relative;\n top: 3px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n background: none;\n color: var(--spw-color-themes-grey-grey-400);\n @extend %button;\n spw-icon {\n font-size: 16px;\n }\n }\n\n &--desktop {\n display: none;\n @include breakpoint(md) {\n display: inline-block;\n }\n }\n\n &--active {\n button {\n color: white;\n background: var(--spw-ds-primary);\n }\n }\n }\n\n &__input {\n spw-text-field {\n width: 36px;\n --spw-input-height: 32px;\n --spw-input-padding: 0 4px;\n --spw-input-text-align: center;\n --spw-input-font-size: 14px;\n }\n }\n\n &__mobile-arrows {\n margin-top: 12px;\n @include breakpoint(md) {\n display: none !important;\n }\n }\n\n &__total-pages {\n font-size: 14px;\n margin: 0 12px 0 6px;\n }\n}\n","import { Component, Fragment, Prop, Host, h, Event, EventEmitter, Watch, State, Method } from '@stencil/core';\n\n@Component({\n tag: 'spw-pagination',\n styleUrl: 'spw-pagination.scss',\n shadow: true,\n})\nexport class SpwPagination {\n /** Nombre total d'éléments à paginer */\n @Prop() totalItems: number;\n /** Nombre d'éléments à afficher par page */\n @Prop() itemsPerPage: number;\n /** Indique si la pagination est désactivée */\n @Prop() isDisabled: boolean = false;\n /** Type de variante de la pagination : 'numbers' ou 'input' */\n @Prop() variant: 'numbers' | 'input' = 'numbers';\n /** Page actuellement sélectionnée, mutable */\n @Prop({ mutable: true }) currentPage: number = 1;\n\n /** Événement émis lorsque la page est changée, renvoie le numéro de la nouvelle page */\n @Event() pageChanged: EventEmitter<number>;\n\n private totalPages: number;\n @State() inputPageValue: string = '';\n @State() isMobile: boolean = window.innerWidth < 800;\n private debounceTimer: any;\n\n componentWillLoad() {\n this.calculateTotalPages();\n this.inputPageValue = this.currentPage.toString();\n window.addEventListener('resize', this.updateIsMobile);\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.updateIsMobile);\n }\n\n private updateIsMobile = () => {\n this.isMobile = window.innerWidth < 800;\n };\n\n @Watch('totalItems')\n @Watch('itemsPerPage')\n @Watch('currentPage')\n calculateTotalPages() {\n this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);\n }\n\n @Watch('itemsPerPage')\n onItemsPerPageChange() {\n this.currentPage = 1;\n this.inputPageValue = '1';\n this.pageChanged.emit(this.currentPage);\n }\n\n @Watch('totalItems')\n onTotalItemsChange() {\n const newTotalPages = Math.ceil(this.totalItems / this.itemsPerPage);\n if (this.currentPage > newTotalPages || this.currentPage === 0) {\n this.currentPage = 1;\n this.inputPageValue = '1';\n this.pageChanged.emit(this.currentPage);\n }\n }\n\n /** Méthode publique pour définir la page courante */\n @Method()\n async setPage(page: number): Promise<void> {\n this.goToPage(page);\n }\n\n private goToPage(page: number) {\n if (page !== this.currentPage && !this.isDisabled && page >= 1 && page <= this.totalPages) {\n this.currentPage = page;\n this.inputPageValue = this.currentPage.toString();\n this.pageChanged.emit(this.currentPage);\n }\n }\n\n private handleInputChange(event: Event) {\n const inputValue = (event.target as HTMLInputElement).value;\n this.inputPageValue = inputValue;\n const page = parseInt(inputValue, 10);\n\n if (!isNaN(page) && page >= 1 && page <= this.totalPages) {\n clearTimeout(this.debounceTimer);\n this.debounceTimer = setTimeout(() => {\n this.goToPage(page);\n }, 500);\n }\n }\n\n private getPaginationClass() {\n const pages = this.calculatePageRange();\n const ellipsisCount = pages.filter(({ page }) => page === '...').length;\n const hasEllipsisStart = ellipsisCount > 0 && pages[1]?.page === '...';\n const hasEllipsisEnd = ellipsisCount > 0 && pages[pages.length - 2]?.page === '...';\n\n let paginationClass = `spw-pagination spw-pagination--${this.currentPage} spw-pagination--total-${this.totalPages}`;\n\n if (ellipsisCount === 2) {\n paginationClass += ' spw-pagination--double-ellipsis';\n } else if (hasEllipsisStart) {\n paginationClass += ' spw-pagination--ellipsis-start';\n } else if (hasEllipsisEnd) {\n paginationClass += ' spw-pagination--ellipsis-end';\n }\n\n return paginationClass;\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n const page = parseInt(this.inputPageValue, 10);\n if (!isNaN(page)) {\n this.goToPage(page);\n }\n }\n }\n\n private calculatePageRange() {\n const pages = [];\n const { currentPage, totalPages, isMobile } = this;\n\n if (isMobile) {\n // Mode mobile\n if (totalPages <= 5) {\n for (let i = 1; i <= totalPages; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--small-range' });\n }\n } else if (currentPage <= 3) {\n for (let i = 1; i <= 3; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--start-range' });\n }\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n pages.push({ page: totalPages, class: 'spw-pagination__item--end' });\n } else if (currentPage >= totalPages - 2) {\n pages.push({ page: 1, class: 'spw-pagination__item--start' });\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n for (let i = totalPages - 2; i <= totalPages; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--end-range' });\n }\n } else {\n pages.push({ page: 1, class: 'spw-pagination__item--start' });\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n for (let i = currentPage - 1; i <= currentPage + 1; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--middle-range' });\n }\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n pages.push({ page: totalPages, class: 'spw-pagination__item--end' });\n }\n } else {\n // Mode desktop\n if (totalPages <= 7) {\n for (let i = 1; i <= totalPages; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--small-range' });\n }\n } else if (currentPage <= 4) {\n for (let i = 1; i <= 4; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--start-range' });\n }\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n pages.push({ page: totalPages, class: 'spw-pagination__item--end' });\n } else if (currentPage >= totalPages - 3) {\n pages.push({ page: 1, class: 'spw-pagination__item--start' });\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n for (let i = totalPages - 3; i <= totalPages; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--end-range' });\n }\n } else {\n pages.push({ page: 1, class: 'spw-pagination__item--start' });\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n for (let i = currentPage - 2; i <= currentPage + 2; i++) {\n pages.push({ page: i, class: 'spw-pagination__item--middle-range' });\n }\n pages.push({ page: '...', class: 'spw-pagination__item--ellipsis' });\n pages.push({ page: totalPages, class: 'spw-pagination__item--end' });\n }\n }\n\n return pages;\n }\n\n render() {\n const pages = this.calculatePageRange();\n const showPrevArrow = this.currentPage > 1;\n const showNextArrow = this.currentPage < this.totalPages;\n\n const prevArrow = showPrevArrow && (\n <li class=\"spw-pagination__item spw-pagination__item--desktop spw-pagination__item--arrow\">\n <button onClick={() => this.goToPage(this.currentPage - 1)}>\n <spw-icon icon=\"fa-chevron-left\"></spw-icon> <span class=\"spw-pagination__item-arrow-text\">Précédent</span>\n </button>\n </li>\n );\n\n const nextArrow = showNextArrow && (\n <li class=\"spw-pagination__item spw-pagination__item--desktop spw-pagination__item--arrow\">\n <button onClick={() => this.goToPage(this.currentPage + 1)}>\n <span class=\"spw-pagination__item-arrow-text\">Suivant</span> <spw-icon icon=\"fa-chevron-right\"></spw-icon>\n </button>\n </li>\n );\n\n const prevArrowMobile = this.currentPage > 1 && (\n <li class=\"spw-pagination__item spw-pagination__item--arrow\">\n <button onClick={() => this.goToPage(this.currentPage - 1)}>\n <spw-icon icon=\"fa-chevron-left\"></spw-icon> <span>Précédent</span>\n </button>\n </li>\n );\n\n const nextArrowMobile = this.currentPage < this.totalPages && (\n <li class=\"spw-pagination__item spw-pagination__item--arrow\">\n <button onClick={() => this.goToPage(this.currentPage + 1)} disabled={this.currentPage >= this.totalPages}>\n <span>Suivant</span> <spw-icon icon=\"fa-chevron-right\"></spw-icon>\n </button>\n </li>\n );\n\n const mobileArrows = (\n <ul class=\"spw-pagination__mobile-arrows\">\n {prevArrowMobile}\n {nextArrowMobile}\n </ul>\n );\n\n return (\n <Host>\n <div class={this.getPaginationClass()}>\n {this.variant === 'input' && (\n <Fragment>\n <ul>\n {prevArrow}\n <li class=\"spw-pagination__input\">\n <spw-text-field\n value={this.inputPageValue}\n type=\"text\"\n onInput={event => this.handleInputChange(event)}\n onKeyDown={event => this.handleKeyDown(event)}\n disabled={this.isDisabled}\n ></spw-text-field>\n </li>\n <li class=\"spw-pagination__total-pages\">sur {this.totalPages} pages</li>\n {nextArrow}\n </ul>\n {mobileArrows}\n </Fragment>\n )}\n {this.variant === 'numbers' && (\n <Fragment>\n <ul>\n {prevArrow}\n\n {pages.map(({ page, class: pageClass }) => {\n if (page === '...') {\n return (\n <li class={`spw-pagination__item spw-pagination__item--dots ${pageClass}`}>\n <spw-icon icon=\"fa-ellipsis\"></spw-icon>\n </li>\n );\n }\n\n return (\n <li\n class={{\n 'spw-pagination__item': true,\n 'spw-pagination__item--active': page === this.currentPage,\n [pageClass]: true,\n }}\n >\n <button onClick={() => this.goToPage(page as number)} disabled={page === this.currentPage}>\n {page}\n </button>\n </li>\n );\n })}\n\n {nextArrow}\n </ul>\n {mobileArrows}\n </Fragment>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAmB,40J,MCOZC,EAAa,MAL1B,WAAAC,CAAAC,G,mDAWUC,KAAUC,WAAY,MAEtBD,KAAOE,QAAwB,UAEdF,KAAWG,YAAW,EAMtCH,KAAcI,eAAW,GACzBJ,KAAAK,SAAoBC,OAAOC,WAAa,IAazCP,KAAcQ,eAAG,KACvBR,KAAKK,SAAWC,OAAOC,WAAa,GAAG,CAyP1C,CApQC,iBAAAE,GACET,KAAKU,sBACLV,KAAKI,eAAiBJ,KAAKG,YAAYQ,WACvCL,OAAOM,iBAAiB,SAAUZ,KAAKQ,e,CAGzC,oBAAAK,GACEP,OAAOQ,oBAAoB,SAAUd,KAAKQ,e,CAU5C,mBAAAE,GACEV,KAAKe,WAAaC,KAAKC,KAAKjB,KAAKkB,WAAalB,KAAKmB,a,CAIrD,oBAAAC,GACEpB,KAAKG,YAAc,EACnBH,KAAKI,eAAiB,IACtBJ,KAAKqB,YAAYC,KAAKtB,KAAKG,Y,CAI7B,kBAAAoB,GACE,MAAMC,EAAgBR,KAAKC,KAAKjB,KAAKkB,WAAalB,KAAKmB,cACvD,GAAInB,KAAKG,YAAcqB,GAAiBxB,KAAKG,cAAgB,EAAG,CAC9DH,KAAKG,YAAc,EACnBH,KAAKI,eAAiB,IACtBJ,KAAKqB,YAAYC,KAAKtB,KAAKG,Y,EAM/B,aAAMsB,CAAQC,GACZ1B,KAAK2B,SAASD,E,CAGR,QAAAC,CAASD,GACf,GAAIA,IAAS1B,KAAKG,cAAgBH,KAAK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,EAAA,MAAAR,IAAA,4CACGO,EAEAlB,EAAMgC,KAAI,EAAG7C,OAAM2B,MAAOmB,MACzB,GAAI9C,IAAS,MAAO,CAClB,OACEgC,EAAI,MAAAL,MAAO,mDAAmDmB,KAC5Dd,EAAA,YAAUE,KAAK,gB,CAKrB,OACEF,EACE,MAAAL,MAAO,CACL,uBAAwB,KACxB,+BAAgC3B,IAAS1B,KAAKG,YAC9CqE,CAACA,GAAY,OAGfd,EAAQ,UAAAC,QAAS,IAAM3D,KAAK2B,SAASD,GAAiBsC,SAAUtC,IAAS1B,KAAKG,aAC3EuB,GAEA,IAIRmC,GAEFI,I","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,h as i,H as s,g as o}from"./p-CvfVJV8a.js";const n="/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3;position:relative}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-table-container{scrollbar-face-color:var(--spw-color-themes-grey-grey-400);scrollbar-track-color:var(--spw-ds-white);border-radius:4px;max-height:var(--spw-table-max-height);outline:1px solid var(--spw-color-themes-grey-grey-300);outline-offset:-1px;overflow-x:auto;overflow-y:auto;position:relative;width:100%}.spw-table-container::-webkit-scrollbar{height:14px;width:14px}.spw-table-container::-webkit-scrollbar-thumb{background:var(--spw-color-themes-grey-grey-400);border:4px solid var(--spw-ds-white);border-radius:20px}.spw-table-container::-webkit-scrollbar-track{background:var(--spw-ds-white)}.spw-table{border-collapse:collapse;border-radius:4px;min-width:var(--spw-table-min-width);position:relative;width:100%}.spw-table--layout-fixed{table-layout:fixed}.spw-table--layout-auto{table-layout:auto}";const r=class{constructor(i){t(this,i);this.spwSort=e(this,"spwSort",7);this.isSticky=false;this.minWidth="600";this.tableLayout="auto";this.isZebra=false;this.disableSort=false;this.checkboxChangeHandler=()=>this.updateMasterCheckboxState()}onCurrentSortChange(t){if(t){this.updateHeadersSortState(t)}}onIsStickyChange(){this.applyStickyToChildren()}componentDidLoad(){var t;this.updateZebra();this.applyStickyToChildren();const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("slot");if(e){e.addEventListener("slotchange",(()=>{this.setupHeaderCheckboxListener();this.updateMasterCheckboxState();this.applyStickyToChildren()}))}this.setupHeaderCheckboxListener();this.setupBodyCheckboxListener();this.setupTableBodyObserver();setTimeout((()=>{this.updateMasterCheckboxState()}),0)}disconnectedCallback(){if(this.mutationObserver){this.mutationObserver.disconnect()}}setupTableBodyObserver(){const t=Array.from(this.el.children).find((t=>t.tagName.toLowerCase()==="spw-table-body"));if(!t)return;this.mutationObserver=new MutationObserver((()=>{this.setupBodyCheckboxListener();setTimeout((()=>{this.updateMasterCheckboxState()}),0)}));this.mutationObserver.observe(t,{childList:true,subtree:true,attributes:true,attributeFilter:["checked","disabled"]})}getMasterCheckboxColumnIndex(){var t;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("slot");if(!e)return null;const i=e.assignedElements({flatten:true});const s=i.find((t=>t.tagName.toLowerCase()==="spw-table-head"));if(!s)return null;const o=s.querySelector("spw-table-row");if(!o)return null;const n=Array.from(o.querySelectorAll("spw-table-header"));for(let t=0;t<n.length;t++){if(n[t].querySelector("spw-checkbox")){return t}}return null}isCheckboxDisabled(t){return(t===null||t===void 0?void 0:t.disabled)===true||(t===null||t===void 0?void 0:t.getAttribute("disabled"))==="true"||(t===null||t===void 0?void 0:t.getAttribute("disabled"))===""}updateMasterCheckboxState(){var t;const e=this.getMasterCheckboxColumnIndex();if(e===null)return;const i=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("slot");const s=i===null||i===void 0?void 0:i.assignedElements({flatten:true});if(!s)return;const o=s.find((t=>t.tagName.toLowerCase()==="spw-table-head"));const n=s.find((t=>t.tagName.toLowerCase()==="spw-table-body"));if(!o||!n)return;const r=o.querySelector("spw-table-row");const a=r===null||r===void 0?void 0:r.querySelectorAll("spw-table-header")[e];const l=a===null||a===void 0?void 0:a.querySelector("spw-checkbox");const c=n.querySelectorAll("spw-table-row");const d=Array.from(c).map((t=>{const i=t.querySelectorAll("spw-table-cell")[e];const s=i===null||i===void 0?void 0:i.querySelector("spw-checkbox");return{checked:(s===null||s===void 0?void 0:s.checked)===true||(s===null||s===void 0?void 0:s.getAttribute("checked"))==="true",disabled:this.isCheckboxDisabled(s)}}));const h=d.filter((t=>!t.disabled));if(h.length===0)return;const u=h.every((t=>t.checked));const b=h.every((t=>!t.checked));if(!l)return;if(u){l.checked=true;l.setAttribute("checked","true");l.setAttribute("icon","fa-check")}else if(b){l.checked=false;l.setAttribute("checked","false");l.setAttribute("icon","fa-check")}else{l.checked=true;l.setAttribute("checked","true");l.setAttribute("icon","fa-minus")}}setupHeaderCheckboxListener(){var t,e;const i=(e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("slot"))===null||e===void 0?void 0:e.assignedElements({flatten:true});if(!i)return;const s=i.find((t=>t.tagName.toLowerCase()==="spw-table-head"));if(!s)return;const o=s.querySelectorAll("spw-table-row");o.forEach((t=>{const e=t.querySelectorAll("spw-checkbox");e.forEach((t=>{t.addEventListener("spwChange",(t=>{this.toggleAllRowCheckboxes(t.detail)}))}))}))}setupBodyCheckboxListener(){const t=Array.from(this.el.children).find((t=>t.tagName.toLowerCase()==="spw-table-body"));if(!t)return;const e=t.querySelectorAll("spw-table-row");e.forEach((t=>{const e=t.querySelectorAll("spw-checkbox");e.forEach((t=>{t.removeEventListener("spwChange",this.checkboxChangeHandler);t.addEventListener("spwChange",this.checkboxChangeHandler)}))}))}toggleAllRowCheckboxes(t){var e;const i=this.getMasterCheckboxColumnIndex();if(i===null)return;const s=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector("slot");const o=s===null||s===void 0?void 0:s.assignedElements({flatten:true});if(!o)return;const n=o.find((t=>t.tagName.toLowerCase()==="spw-table-body"));if(!n)return;const r=n.querySelectorAll("spw-table-row");r.forEach((e=>{const s=Array.from(e.querySelectorAll("spw-table-cell"));const o=s[i];const n=o===null||o===void 0?void 0:o.querySelector("spw-checkbox");if(n&&!this.isCheckboxDisabled(n)){n.checked=t;n.setAttribute("checked",t.toString())}}));setTimeout((()=>{this.updateMasterCheckboxState()}),0)}handleHeaderClick(t){const e=t.detail;const i=this.currentSort;const s={column:e,direction:(i===null||i===void 0?void 0:i.column)===e&&i.direction==="asc"?"desc":"asc"};this.currentSort=s;this.spwSort.emit(s);if(!this.disableSort){this.sortRows(s.column,s.direction)}this.updateHeadersSortState(s);this.updateZebra()}updateZebra(){const t=this.el.shadowRoot.querySelector("slot");if(!t)return;const e=t.assignedElements({flatten:true});const i=e.find((t=>t.tagName.toLowerCase()==="spw-table-body"));if(i){if(this.isZebra){i.setAttribute("is-zebra","true")}else{i.removeAttribute("is-zebra")}if(typeof i.updateZebraStyles==="function"){i.updateZebraStyles()}}}applyStickyToChildren(){requestAnimationFrame((()=>{const t="--is-sticky";const e=this.el.querySelectorAll("spw-table-header");const i=this.el.querySelectorAll("spw-table-cell");const s=this.el.querySelector("spw-table-footer");if(this.isSticky){e.forEach((e=>e.classList.add(t)));s===null||s===void 0?void 0:s.classList.add(t)}else{e.forEach((e=>e.classList.remove(t)));i.forEach((e=>e.classList.remove(t)));s===null||s===void 0?void 0:s.classList.remove(t)}}))}sortRows(t,e){var i;const s=(i=this.el.shadowRoot.querySelector("slot"))===null||i===void 0?void 0:i.assignedElements().find((t=>t.tagName.toLowerCase()==="spw-table-body"));if(!s)return;const o=Array.from(s.querySelectorAll("spw-table-row"));const n=Array.from(this.el.querySelectorAll("spw-table-header")).findIndex((e=>e.columnId===t));if(n===-1)return;o.sort(((t,i)=>{const s=t.querySelectorAll("spw-table-cell")[n];const o=i.querySelectorAll("spw-table-cell")[n];if(!s||!o)return 0;const r=s.textContent.trim();const a=o.textContent.trim();if(!isNaN(Number(r))&&!isNaN(Number(a))){return e==="asc"?+r-+a:+a-+r}return e==="asc"?r.localeCompare(a):a.localeCompare(r)}));o.forEach((t=>s.appendChild(t)));const r=s;if(r===null||r===void 0?void 0:r.updateZebraStyles){r.updateZebraStyles()}}updateHeadersSortState(t){const e=this.el.querySelectorAll("spw-table-header");e.forEach((e=>{const i=e.columnId===t.column;e.isSorted=i;e.sortDirection=i?t.direction:undefined}))}formatSize(t){if(t===undefined||t===null){return"auto"}return`${t}px`}get elementClass(){return{"spw-table":true,"spw-table--is-sticky":this.isSticky,[`spw-table--layout-${this.tableLayout}`]:true}}render(){return i(s,{key:"7cc259ed7e17128348ebd7a6757d48b2d0114e0a",style:{"--spw-table-max-height":this.formatSize(this.maxHeight),"--spw-table-min-width":this.formatSize(this.minWidth)}},i("div",{key:"b5dac474e57841c60312f92045859a1ff0d741c7",class:"spw-table-container"},i("table",{key:"67790f5adbd07b77c80be97b03406ca6d8296d13",part:"table",class:this.elementClass,role:"table","aria-label":this.accAriaLabel},i("slot",{key:"208be3ca21332261306114673e756ca47bc0582d"}))))}get el(){return o(this)}static get watchers(){return{currentSort:["onCurrentSortChange"],isSticky:["onIsStickyChange"]}}};r.style=n;export{r as spw_table};
2
+ //# sourceMappingURL=p-92583499.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwTableCss","SpwTable","constructor","hostRef","this","isSticky","minWidth","tableLayout","isZebra","disableSort","checkboxChangeHandler","updateMasterCheckboxState","onCurrentSortChange","newSort","updateHeadersSortState","onIsStickyChange","applyStickyToChildren","componentDidLoad","updateZebra","slot","_a","el","shadowRoot","querySelector","addEventListener","setupHeaderCheckboxListener","setupBodyCheckboxListener","setupTableBodyObserver","setTimeout","disconnectedCallback","mutationObserver","disconnect","body","Array","from","children","find","tagName","toLowerCase","MutationObserver","observe","childList","subtree","attributes","attributeFilter","getMasterCheckboxColumnIndex","assignedElements","flatten","head","headerRow","headerCells","querySelectorAll","i","length","isCheckboxDisabled","checkbox","disabled","getAttribute","columnIndex","headerCell","masterCheckbox","rows","checkboxData","map","row","cell","cb","checked","enabledCheckboxes","filter","item","allChecked","every","noneChecked","setAttribute","_b","headerRows","forEach","checkboxes","event","toggleAllRowCheckboxes","detail","removeEventListener","cells","targetCell","toString","handleHeaderClick","columnId","current","currentSort","column","direction","spwSort","emit","sortRows","removeAttribute","updateZebraStyles","requestAnimationFrame","stickyClass","headers","footer","header","classList","add","remove","findIndex","sort","a","b","aCell","bCell","aValue","textContent","trim","bValue","isNaN","Number","localeCompare","appendChild","bodyComponent","isCurrent","isSorted","sortDirection","undefined","formatSize","value","elementClass","render","h","Host","key","style","maxHeight","class","part","role","accAriaLabel"],"sources":["src/components/spw-table/spw-table.scss?tag=spw-table&encapsulation=shadow","src/components/spw-table/spw-table.tsx"],"sourcesContent":[":host {\n display: block;\n position: relative;\n}\n\n%highlight {\n font-weight: 700;\n background: var(--spw-color-themes-grey-grey-100);\n}\n\n.spw-table-container {\n width: 100%;\n overflow-x: auto;\n overflow-y: auto;\n max-height: var(--spw-table-max-height);\n border-radius: 4px;\n outline: 1px solid var(--spw-color-themes-grey-grey-300);\n outline-offset: -1px;\n position: relative;\n @include scrollbars(var(--spw-color-themes-grey-grey-400), var(--spw-ds-white));\n}\n\n.spw-table {\n width: 100%;\n border-collapse: collapse;\n min-width: var(--spw-table-min-width);\n border-radius: 4px;\n position: relative;\n &--layout-fixed {\n table-layout: fixed;\n }\n &--layout-auto {\n table-layout: auto;\n }\n}\n","import { Component, Element, Event, Listen, EventEmitter, Host, Prop, Watch, h } from '@stencil/core';\n\nexport interface SortEvent {\n column: string;\n direction: 'asc' | 'desc';\n}\n\n@Component({\n tag: 'spw-table',\n styleUrl: 'spw-table.scss',\n shadow: true,\n})\nexport class SpwTable {\n @Element() el: HTMLSpwTableElement;\n\n /** Propriété pour l'aria-label, à des fins d'accessibilité */\n @Prop() accAriaLabel?: string;\n /** Si le header du tableau doit être sticky ou non */\n @Prop() isSticky?: boolean = false;\n /** Si défini, apparition d'une scrollbar verticale et max-height */\n @Prop() maxHeight?: string;\n /** Si défini, apparition d'une scrollbar horizontale et max-width */\n @Prop() minWidth?: string = '600';\n /** Permet de définir le table-layout (auto ou fixed) */\n @Prop() tableLayout?: 'auto' | 'fixed' = 'auto';\n /** Définit un background de couleur différent une ligne sur 2 */\n @Prop() isZebra?: boolean = false;\n /** Désactive le tri natif pour permettre l'utilisation d'une fonction de tri personnalisée */\n @Prop() disableSort?: boolean = false;\n /** État du tri actuel (colonne et direction). Peut être défini de l'extérieur pour un tri personnalisé */\n @Prop({ mutable: true }) currentSort?: SortEvent;\n\n @Event() spwSort: EventEmitter<SortEvent>;\n\n private mutationObserver?: MutationObserver;\n\n @Watch('currentSort')\n onCurrentSortChange(newSort: SortEvent | undefined) {\n if (newSort) {\n this.updateHeadersSortState(newSort);\n }\n }\n\n @Watch('isSticky')\n onIsStickyChange() {\n this.applyStickyToChildren();\n }\n\n componentDidLoad() {\n this.updateZebra();\n this.applyStickyToChildren();\n const slot = this.el.shadowRoot?.querySelector('slot');\n if (slot) {\n slot.addEventListener('slotchange', () => {\n this.setupHeaderCheckboxListener();\n this.updateMasterCheckboxState();\n this.applyStickyToChildren();\n });\n }\n this.setupHeaderCheckboxListener();\n this.setupBodyCheckboxListener();\n this.setupTableBodyObserver();\n setTimeout(() => {\n this.updateMasterCheckboxState();\n }, 0);\n }\n\n disconnectedCallback() {\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n }\n }\n\n private setupTableBodyObserver() {\n const body = Array.from(this.el.children).find(el => el.tagName.toLowerCase() === 'spw-table-body');\n if (!body) return;\n\n this.mutationObserver = new MutationObserver(() => {\n this.setupBodyCheckboxListener();\n setTimeout(() => {\n this.updateMasterCheckboxState();\n }, 0);\n });\n\n this.mutationObserver.observe(body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['checked', 'disabled'],\n });\n }\n\n private getMasterCheckboxColumnIndex(): number | null {\n const slot = this.el.shadowRoot?.querySelector('slot');\n if (!slot) return null;\n\n const assignedElements = slot.assignedElements({ flatten: true }) as HTMLElement[];\n const head = assignedElements.find(el => el.tagName.toLowerCase() === 'spw-table-head');\n if (!head) return null;\n\n const headerRow = head.querySelector('spw-table-row');\n if (!headerRow) return null;\n\n const headerCells = Array.from(headerRow.querySelectorAll('spw-table-header'));\n\n for (let i = 0; i < headerCells.length; i++) {\n if (headerCells[i].querySelector('spw-checkbox')) {\n return i;\n }\n }\n\n return null;\n }\n\n private isCheckboxDisabled(checkbox: any): boolean {\n return checkbox?.disabled === true || checkbox?.getAttribute('disabled') === 'true' || checkbox?.getAttribute('disabled') === '';\n }\n\n private updateMasterCheckboxState() {\n const columnIndex = this.getMasterCheckboxColumnIndex();\n if (columnIndex === null) return;\n\n const slot = this.el.shadowRoot?.querySelector('slot');\n const assignedElements = slot?.assignedElements({ flatten: true }) as HTMLElement[] | undefined;\n if (!assignedElements) return;\n\n const head = assignedElements.find(el => el.tagName.toLowerCase() === 'spw-table-head');\n const body = assignedElements.find(el => el.tagName.toLowerCase() === 'spw-table-body');\n if (!head || !body) return;\n\n const headerRow = head.querySelector('spw-table-row');\n const headerCell = headerRow?.querySelectorAll('spw-table-header')[columnIndex];\n const masterCheckbox = headerCell?.querySelector('spw-checkbox') as any;\n\n const rows = body.querySelectorAll('spw-table-row');\n const checkboxData = Array.from(rows).map(row => {\n const cell = row.querySelectorAll('spw-table-cell')[columnIndex];\n const cb = cell?.querySelector('spw-checkbox') as any;\n return {\n checked: cb?.checked === true || cb?.getAttribute('checked') === 'true',\n disabled: this.isCheckboxDisabled(cb),\n };\n });\n\n const enabledCheckboxes = checkboxData.filter(item => !item.disabled);\n\n if (enabledCheckboxes.length === 0) return;\n\n const allChecked = enabledCheckboxes.every(item => item.checked);\n const noneChecked = enabledCheckboxes.every(item => !item.checked);\n\n if (!masterCheckbox) return;\n\n if (allChecked) {\n masterCheckbox.checked = true;\n masterCheckbox.setAttribute('checked', 'true');\n masterCheckbox.setAttribute('icon', 'fa-check');\n } else if (noneChecked) {\n masterCheckbox.checked = false;\n masterCheckbox.setAttribute('checked', 'false');\n masterCheckbox.setAttribute('icon', 'fa-check');\n } else {\n masterCheckbox.checked = true;\n masterCheckbox.setAttribute('checked', 'true');\n masterCheckbox.setAttribute('icon', 'fa-minus');\n }\n }\n\n private setupHeaderCheckboxListener() {\n const assignedElements = this.el.shadowRoot?.querySelector('slot')?.assignedElements({ flatten: true }) as HTMLElement[] | undefined;\n\n if (!assignedElements) return;\n\n const head = assignedElements.find(el => el.tagName.toLowerCase() === 'spw-table-head');\n if (!head) return;\n\n const headerRows = head.querySelectorAll('spw-table-row');\n\n headerRows.forEach(row => {\n const checkboxes = row.querySelectorAll('spw-checkbox');\n checkboxes.forEach(cb => {\n cb.addEventListener('spwChange', (event: CustomEvent<boolean>) => {\n this.toggleAllRowCheckboxes(event.detail);\n });\n });\n });\n }\n\n private checkboxChangeHandler = () => this.updateMasterCheckboxState();\n\n private setupBodyCheckboxListener() {\n const body = Array.from(this.el.children).find(el => el.tagName.toLowerCase() === 'spw-table-body');\n if (!body) return;\n\n const rows = body.querySelectorAll('spw-table-row');\n rows.forEach(row => {\n const checkboxes = row.querySelectorAll('spw-checkbox');\n checkboxes.forEach(cb => {\n cb.removeEventListener('spwChange', this.checkboxChangeHandler);\n cb.addEventListener('spwChange', this.checkboxChangeHandler);\n });\n });\n }\n\n private toggleAllRowCheckboxes(checked: boolean) {\n const columnIndex = this.getMasterCheckboxColumnIndex();\n if (columnIndex === null) return;\n\n const slot = this.el.shadowRoot?.querySelector('slot');\n const assignedElements = slot?.assignedElements({ flatten: true }) as HTMLElement[] | undefined;\n if (!assignedElements) return;\n\n const body = assignedElements.find(el => el.tagName.toLowerCase() === 'spw-table-body');\n if (!body) return;\n\n const rows = body.querySelectorAll('spw-table-row');\n\n rows.forEach(row => {\n const cells = Array.from(row.querySelectorAll('spw-table-cell'));\n const targetCell = cells[columnIndex];\n const checkbox = targetCell?.querySelector('spw-checkbox') as any;\n\n if (checkbox && !this.isCheckboxDisabled(checkbox)) {\n checkbox.checked = checked;\n checkbox.setAttribute('checked', checked.toString());\n }\n });\n\n setTimeout(() => {\n this.updateMasterCheckboxState();\n }, 0);\n }\n\n @Listen('spwHeaderClick')\n handleHeaderClick(event: CustomEvent<string>) {\n const columnId = event.detail;\n const current = this.currentSort;\n\n const newSort: SortEvent = {\n column: columnId,\n direction: current?.column === columnId && current.direction === 'asc' ? 'desc' : 'asc',\n };\n\n this.currentSort = newSort;\n this.spwSort.emit(newSort);\n\n if (!this.disableSort) {\n this.sortRows(newSort.column, newSort.direction);\n }\n\n this.updateHeadersSortState(newSort);\n this.updateZebra();\n }\n\n private updateZebra() {\n const slot = this.el.shadowRoot.querySelector('slot');\n if (!slot) return;\n\n const assignedElements = slot.assignedElements({ flatten: true });\n const body = assignedElements.find(el => el.tagName.toLowerCase() === 'spw-table-body') as any;\n\n if (body) {\n if (this.isZebra) {\n body.setAttribute('is-zebra', 'true');\n } else {\n body.removeAttribute('is-zebra');\n }\n\n if (typeof body.updateZebraStyles === 'function') {\n body.updateZebraStyles();\n }\n }\n }\n\n private applyStickyToChildren() {\n requestAnimationFrame(() => {\n const stickyClass = '--is-sticky';\n const headers = this.el.querySelectorAll('spw-table-header');\n const cells = this.el.querySelectorAll('spw-table-cell');\n const footer = this.el.querySelector('spw-table-footer');\n\n if (this.isSticky) {\n headers.forEach(header => header.classList.add(stickyClass));\n footer?.classList.add(stickyClass);\n } else {\n headers.forEach(header => header.classList.remove(stickyClass));\n cells.forEach(cell => cell.classList.remove(stickyClass));\n footer?.classList.remove(stickyClass);\n }\n });\n }\n\n private sortRows(columnId: string, direction: 'asc' | 'desc') {\n const body = this.el.shadowRoot\n .querySelector('slot')\n ?.assignedElements()\n .find(el => el.tagName.toLowerCase() === 'spw-table-body');\n if (!body) return;\n\n const rows = Array.from(body.querySelectorAll('spw-table-row'));\n\n const columnIndex = Array.from(this.el.querySelectorAll('spw-table-header')).findIndex((header: any) => header.columnId === columnId);\n if (columnIndex === -1) return;\n\n rows.sort((a: any, b: any) => {\n const aCell = a.querySelectorAll('spw-table-cell')[columnIndex];\n const bCell = b.querySelectorAll('spw-table-cell')[columnIndex];\n if (!aCell || !bCell) return 0;\n\n const aValue = aCell.textContent.trim();\n const bValue = bCell.textContent.trim();\n\n if (!isNaN(Number(aValue)) && !isNaN(Number(bValue))) {\n return direction === 'asc' ? +aValue - +bValue : +bValue - +aValue;\n }\n\n return direction === 'asc' ? aValue.localeCompare(bValue) : bValue.localeCompare(aValue);\n });\n\n rows.forEach(row => body.appendChild(row));\n\n const bodyComponent = body as HTMLSpwTableBodyElement;\n if (bodyComponent?.updateZebraStyles) {\n bodyComponent.updateZebraStyles();\n }\n }\n\n private updateHeadersSortState(sort: SortEvent) {\n const headers = this.el.querySelectorAll('spw-table-header');\n headers.forEach((header: any) => {\n const isCurrent = header.columnId === sort.column;\n header.isSorted = isCurrent;\n header.sortDirection = isCurrent ? sort.direction : undefined;\n });\n }\n\n private formatSize(value?: string): string {\n if (value === undefined || value === null) {\n return 'auto';\n }\n return `${value}px`;\n }\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-table': true,\n 'spw-table--is-sticky': this.isSticky,\n [`spw-table--layout-${this.tableLayout}`]: true,\n };\n }\n\n render() {\n return (\n <Host\n style={{\n '--spw-table-max-height': this.formatSize(this.maxHeight),\n '--spw-table-min-width': this.formatSize(this.minWidth),\n }}\n >\n <div class=\"spw-table-container\">\n <table part=\"table\" class={this.elementClass} role=\"table\" aria-label={this.accAriaLabel}>\n <slot />\n </table>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAc,44G,MCYPC,EAAQ,MALrB,WAAAC,CAAAC,G,2CAWUC,KAAQC,SAAa,MAIrBD,KAAQE,SAAY,MAEpBF,KAAWG,YAAsB,OAEjCH,KAAOI,QAAa,MAEpBJ,KAAWK,YAAa,MAgKxBL,KAAqBM,sBA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,EAAK,OAAAE,IAAA,2CAAAG,MAAM,uBACTL,EAAA,SAAAE,IAAA,2CAAOI,KAAK,QAAQD,MAAOjI,KAAK0H,aAAcS,KAAK,QAAoB,aAAAnI,KAAKoI,cAC1ER,EAAA,QAAAE,IAAA,+C","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,h as t,g as i}from"./p-CvfVJV8a.js";const s='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:contents;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host(.--selected) .spw-table-cell{background-color:var(--spw-color-themes-blue-blue-50)}:host(.--selected) .spw-table-cell.spw-table-cell--first-in-row{box-shadow:inset 3px 0 0 var(--spw-color-themes-blue-blue-500)}:host(.--disabled) .spw-table-cell,:host(.--disabled) .spw-table-cell--sticky{position:relative}:host(.--disabled) .spw-table-cell--sticky:before,:host(.--disabled) .spw-table-cell:before{background:var(--spw-ds-white);bottom:1px;content:"";cursor:not-allowed;left:0;opacity:.7;position:absolute;right:0;top:0;z-index:8}.spw-table-cell{border:1px solid var(--spw-color-themes-grey-grey-300);border-top:0;color:var(--spw-color-themes-grey-grey-800);font-size:14px;text-align:left}.spw-table-cell--is-highlighted{background:var(--spw-color-themes-grey-grey-100);font-weight:700}.spw-table-cell--text-align-left{text-align:left}.spw-table-cell--text-align-center{text-align:center}.spw-table-cell--text-align-right{text-align:right}.spw-table-cell--vertical-align-top{vertical-align:top}.spw-table-cell--vertical-align-bottom{vertical-align:bottom}.spw-table-cell--vertical-align-middle{vertical-align:middle}.spw-table-cell--padding-small{padding:8px}.spw-table-cell--padding-medium{padding:16px}.spw-table-cell--disabled{cursor:not-allowed;opacity:.3;pointer-events:none}.spw-table-cell--selected{background-color:var(--spw-color-themes-blue-blue-50)}.spw-table-cell--selected.spw-table-cell--first-in-row{box-shadow:inset 3px 0 0 var(--spw-color-themes-blue-blue-500)}.spw-table-cell ::slotted(spw-checkbox){--spw-ds-checkbox-checked-color:#000}.spw-table-cell--sticky{background-color:var(--spw-color-themes-grey-grey-50);position:sticky}.spw-table-cell--sticky:after{bottom:-1px;content:"";pointer-events:none;position:absolute;top:0;transition:opacity .2s;width:8px}.spw-table-cell--sticky-start:after{box-shadow:inset 8px 0 8px -8px rgba(0,0,0,.15);right:-8px}.spw-table-cell--sticky-end:after{box-shadow:inset -8px 0 8px -8px rgba(0,0,0,.15);left:-8px}.spw-table-cell--sticky.spw-table-cell--selected{background-color:var(--spw-color-themes-blue-blue-50)}.spw-table-cell--sticky.spw-table-cell--is-highlighted{background-color:var(--spw-color-themes-grey-grey-100)}:host(.--selected) .spw-table-cell--sticky{background-color:var(--spw-color-themes-blue-blue-50)}';const l=class{constructor(t){e(this,t);this.isHighlighted=false;this.textAlign="left";this.verticalAlign="middle";this.width="auto";this.padding="medium";this.state="default";this.sticky=false;this.stickyPosition="start";this.stickyOffset=0;this.isFirst=false}componentDidLoad(){this.checkIfFirst();this.observeRowSlot()}disconnectedCallback(){var e;(e=this.slotObserver)===null||e===void 0?void 0:e.disconnect()}checkIfFirst(){const e=this.el.closest("spw-table-row");if(!e){this.isFirst=false;return}const t=Array.from(e.children).filter((e=>e.tagName==="SPW-TABLE-CELL"||e.tagName==="SPW-TABLE-HEADER"||e.tagName==="TD"||e.tagName==="TH"));this.isFirst=t[0]===this.el}observeRowSlot(){const e=this.el.closest("spw-table-row");if(!e)return;this.slotObserver=new MutationObserver((()=>this.checkIfFirst()));this.slotObserver.observe(e,{childList:true,subtree:false})}get elementClass(){return{"spw-table-cell":true,"spw-table-cell--is-highlighted":this.isHighlighted,[`spw-table-cell--text-align-${this.textAlign}`]:true,[`spw-table-cell--padding-${this.padding}`]:true,[`spw-table-cell--vertical-align-${this.verticalAlign}`]:true,[`spw-table-cell--${this.state}`]:true,"spw-table-cell--first-in-row":this.isFirst,"spw-table-cell--sticky":this.sticky,[`spw-table-cell--sticky-${this.stickyPosition}`]:this.sticky}}render(){const e={width:this.width,class:this.elementClass,part:"cell"};if(this.colspan!==undefined)e.colSpan=this.colspan;if(this.rowspan!==undefined)e.rowSpan=this.rowspan;if(this.headers!==undefined)e.headers=this.headers;if(this.sticky){const t={position:"sticky",zIndex:"10"};if(this.stickyPosition==="start"){t.left=`${this.stickyOffset}px`}else{t.right=`${this.stickyOffset}px`}e.style=t}return t("td",Object.assign({key:"27bf04742118714d6b54e104929909a392d1995c"},e),t("slot",{key:"8c3ba8fd30c331af629cd030c93047f9931829e3"}))}get el(){return i(this)}};l.style=s;export{l as spw_table_cell};
2
+ //# sourceMappingURL=p-9d760073.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["spwTableCellCss","SpwTableCell","constructor","hostRef","this","isHighlighted","textAlign","verticalAlign","width","padding","state","sticky","stickyPosition","stickyOffset","isFirst","componentDidLoad","checkIfFirst","observeRowSlot","disconnectedCallback","_a","slotObserver","disconnect","parentRow","el","closest","cells","Array","from","children","filter","tagName","MutationObserver","observe","childList","subtree","elementClass","render","attrs","class","part","colspan","undefined","colSpan","rowspan","rowSpan","headers","stickyStyles","position","zIndex","left","right","style","h","Object","assign","key"],"sources":["src/components/spw-table/spw-table-cell/spw-table-cell.scss?tag=spw-table-cell&encapsulation=shadow","src/components/spw-table/spw-table-cell/spw-table-cell.tsx"],"sourcesContent":[":host {\n display: contents;\n}\n\n:host(.--selected) {\n .spw-table-cell {\n background-color: var(--spw-color-themes-blue-blue-50);\n &.spw-table-cell--first-in-row {\n box-shadow: inset 3px 0 0 var(--spw-color-themes-blue-blue-500);\n }\n }\n}\n\n%disabled {\n position: relative;\n &:before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 1px;\n left: 0;\n right: 0;\n background: var(--spw-ds-white);\n opacity: 0.7;\n cursor: not-allowed;\n z-index: 8;\n }\n}\n\n:host(.--disabled) {\n .spw-table-cell {\n @extend %disabled;\n }\n}\n\n.spw-table-cell {\n border: 1px solid var(--spw-color-themes-grey-grey-300);\n color: var(--spw-color-themes-grey-grey-800);\n font-size: 14px;\n text-align: left;\n border-top: 0;\n &--is-highlighted {\n font-weight: 700;\n background: var(--spw-color-themes-grey-grey-100);\n }\n &--text-align-left {\n text-align: left;\n }\n &--text-align-center {\n text-align: center;\n }\n &--text-align-right {\n text-align: right;\n }\n &--vertical-align-top {\n vertical-align: top;\n }\n &--vertical-align-bottom {\n vertical-align: bottom;\n }\n &--vertical-align-middle {\n vertical-align: middle;\n }\n &--padding-small {\n padding: 8px;\n }\n &--padding-medium {\n padding: 16px;\n }\n &--disabled {\n opacity: 0.3;\n pointer-events: none;\n cursor: not-allowed;\n }\n &--selected {\n background-color: var(--spw-color-themes-blue-blue-50);\n &.spw-table-cell--first-in-row {\n box-shadow: inset 3px 0 0 var(--spw-color-themes-blue-blue-500);\n }\n }\n ::slotted(spw-checkbox) {\n --spw-ds-checkbox-checked-color: #000;\n }\n\n &--sticky {\n position: sticky;\n background-color: var(--spw-color-themes-grey-grey-50);\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: -1px;\n width: 8px;\n pointer-events: none;\n transition: opacity 0.2s;\n }\n\n &-start::after {\n right: -8px;\n box-shadow: inset 8px 0 8px -8px rgba(0, 0, 0, 0.15);\n }\n\n &-end::after {\n left: -8px;\n box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.15);\n }\n\n &.spw-table-cell--selected {\n background-color: var(--spw-color-themes-blue-blue-50);\n }\n\n &.spw-table-cell--is-highlighted {\n background-color: var(--spw-color-themes-grey-grey-100);\n }\n\n :host(.--selected) & {\n background-color: var(--spw-color-themes-blue-blue-50);\n }\n\n :host(.--disabled) & {\n @extend %disabled;\n }\n }\n}\n","import { Component, Element, State, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'spw-table-cell',\n styleUrl: 'spw-table-cell.scss',\n shadow: true,\n})\nexport class SpwTableCell {\n @Element() el: HTMLElement;\n /** Définit un colspan pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() colspan?: HTMLTableCellElement['colSpan'];\n /** Définit un header relationnel pour la cellule, à des fins d'accessibilité (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() headers?: HTMLTableCellElement['headers'];\n /** Définit un rowspan pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() rowspan?: HTMLTableCellElement['rowSpan'];\n /** Définit un style visuel qui met en avant la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() isHighlighted?: boolean = false;\n /** Définit un alignement de texte pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() textAlign?: 'center' | 'left' | 'right' = 'left';\n /** Définit un alignement vertical pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() verticalAlign?: 'top' | 'bottom' | 'middle' = 'middle';\n /** Définit une largeur si nécessaire (à appliquer sur spw-table-cell) */\n @Prop() width?: string = 'auto';\n /** Définit le padding pour la cellule (à appliquer sur spw-table-cell ou spw-table-header) */\n @Prop() padding?: 'small' | 'medium' = 'medium';\n /** Permet de changer le state du spw-table-cell */\n @Prop() state?: 'default' | 'selected' | 'disabled' = 'default';\n /** Rend la cellule sticky lors du défilement (à appliquer sur spw-table-header ou spw-table-cell) */\n @Prop() sticky?: boolean = false;\n /** Position du sticky : 'start' (left: 0) ou 'end' (right: 0) (à appliquer sur spw-table-header ou spw-table-cell) */\n @Prop() stickyPosition?: 'start' | 'end' = 'start';\n /** Décalage en pixels pour le sticky (utile pour empiler plusieurs colonnes sticky) (à appliquer sur spw-table-header ou spw-table-cell) */\n @Prop() stickyOffset?: number = 0;\n\n @State() isFirst: boolean = false;\n\n private slotObserver?: MutationObserver;\n\n componentDidLoad() {\n this.checkIfFirst();\n this.observeRowSlot();\n }\n\n disconnectedCallback() {\n this.slotObserver?.disconnect();\n }\n\n private checkIfFirst() {\n const parentRow = this.el.closest('spw-table-row');\n if (!parentRow) {\n this.isFirst = false;\n return;\n }\n const cells = Array.from(parentRow.children).filter(\n (el: Element) => el.tagName === 'SPW-TABLE-CELL' || el.tagName === 'SPW-TABLE-HEADER' || el.tagName === 'TD' || el.tagName === 'TH',\n );\n this.isFirst = cells[0] === this.el;\n }\n\n private observeRowSlot() {\n const parentRow = this.el.closest('spw-table-row');\n if (!parentRow) return;\n this.slotObserver = new MutationObserver(() => this.checkIfFirst());\n this.slotObserver.observe(parentRow, { childList: true, subtree: false });\n }\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-table-cell': true,\n 'spw-table-cell--is-highlighted': this.isHighlighted,\n [`spw-table-cell--text-align-${this.textAlign}`]: true,\n [`spw-table-cell--padding-${this.padding}`]: true,\n [`spw-table-cell--vertical-align-${this.verticalAlign}`]: true,\n [`spw-table-cell--${this.state}`]: true,\n 'spw-table-cell--first-in-row': this.isFirst,\n 'spw-table-cell--sticky': this.sticky,\n [`spw-table-cell--sticky-${this.stickyPosition}`]: this.sticky,\n };\n }\n\n render() {\n const attrs: { [key: string]: any } = {\n width: this.width,\n class: this.elementClass,\n part: 'cell',\n };\n\n if (this.colspan !== undefined) attrs.colSpan = this.colspan;\n if (this.rowspan !== undefined) attrs.rowSpan = this.rowspan;\n if (this.headers !== undefined) attrs.headers = this.headers;\n\n if (this.sticky) {\n const stickyStyles: { [key: string]: string } = {\n position: 'sticky',\n zIndex: '10',\n };\n\n if (this.stickyPosition === 'start') {\n stickyStyles.left = `${this.stickyOffset}px`;\n } else {\n stickyStyles.right = `${this.stickyOffset}px`;\n }\n\n attrs.style = stickyStyles;\n }\n\n return (\n <td {...attrs}>\n <slot />\n </td>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAkB,2zJ,MCOXC,EAAY,MALzB,WAAAC,CAAAC,G,UAcUC,KAAaC,cAAa,MAE1BD,KAASE,UAAiC,OAE1CF,KAAaG,cAAiC,SAE9CH,KAAKI,MAAY,O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