wcs-core 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/component-fc28ed16.js +1074 -0
  4. package/dist/cjs/helpers-d9aaa8c4.js +81 -0
  5. package/dist/cjs/{index-e05c3e1f.js → index-3cb9d725.js} +165 -87
  6. package/dist/cjs/loader.cjs.js +3 -3
  7. package/dist/{esm/wcs-action-bar_47.entry.js → cjs/lodash-776d6f03.js} +12499 -22628
  8. package/dist/cjs/select-arrow-76ccf86d.js +36 -0
  9. package/dist/cjs/wcs-action-bar.cjs.entry.js +24 -0
  10. package/dist/cjs/wcs-app.cjs.entry.js +2 -2
  11. package/dist/cjs/wcs-badge.cjs.entry.js +27 -0
  12. package/dist/cjs/wcs-button.cjs.entry.js +86 -0
  13. package/dist/cjs/wcs-card-body.cjs.entry.js +19 -0
  14. package/dist/cjs/wcs-card.cjs.entry.js +20 -0
  15. package/dist/cjs/wcs-checkbox.cjs.entry.js +43 -0
  16. package/dist/cjs/wcs-com-nav-category.cjs.entry.js +63 -0
  17. package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +69 -0
  18. package/dist/cjs/wcs-com-nav.cjs.entry.js +19 -0
  19. package/dist/cjs/wcs-divider.cjs.entry.js +19 -0
  20. package/dist/cjs/wcs-dropdown-item.cjs.entry.js +23 -0
  21. package/dist/cjs/wcs-dropdown.cjs.entry.js +57 -0
  22. package/dist/cjs/wcs-editable-field.cjs.entry.js +225 -0
  23. package/dist/cjs/wcs-error_2.cjs.entry.js +137 -0
  24. package/dist/cjs/wcs-field-content.cjs.entry.js +16 -0
  25. package/dist/cjs/wcs-field-label.cjs.entry.js +16 -0
  26. package/dist/cjs/wcs-field.cjs.entry.js +19 -0
  27. package/dist/cjs/wcs-footer.cjs.entry.js +19 -0
  28. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +1785 -0
  29. package/dist/cjs/wcs-galactic.cjs.entry.js +41 -0
  30. package/dist/cjs/wcs-grid-column.cjs.entry.js +73 -0
  31. package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +16 -0
  32. package/dist/cjs/wcs-grid-pagination.cjs.entry.js +4 -4
  33. package/dist/cjs/wcs-grid.cjs.entry.js +309 -0
  34. package/dist/cjs/wcs-header.cjs.entry.js +25 -0
  35. package/dist/cjs/wcs-hint.cjs.entry.js +20 -0
  36. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +114 -0
  37. package/dist/cjs/wcs-icon.cjs.entry.js +2 -2
  38. package/dist/cjs/wcs-input.cjs.entry.js +228 -0
  39. package/dist/cjs/wcs-label.cjs.entry.js +20 -0
  40. package/dist/cjs/wcs-list-item-properties.cjs.entry.js +19 -0
  41. package/dist/cjs/wcs-list-item-property.cjs.entry.js +19 -0
  42. package/dist/cjs/wcs-list-item.cjs.entry.js +23 -0
  43. package/dist/cjs/wcs-mat-icon.cjs.entry.js +73 -0
  44. package/dist/cjs/wcs-modal.cjs.entry.js +45 -0
  45. package/dist/cjs/wcs-nav-item.cjs.entry.js +23 -0
  46. package/dist/cjs/wcs-nav.cjs.entry.js +19 -0
  47. package/dist/cjs/wcs-progress-bar.cjs.entry.js +47 -0
  48. package/dist/cjs/wcs-progress-radial.cjs.entry.js +30 -0
  49. package/dist/cjs/wcs-radio-group.cjs.entry.js +65 -0
  50. package/dist/cjs/wcs-radio.cjs.entry.js +49 -0
  51. package/dist/cjs/wcs-select_2.cjs.entry.js +4916 -0
  52. package/dist/cjs/wcs-spinner.cjs.entry.js +21 -0
  53. package/dist/cjs/wcs-switch.cjs.entry.js +34 -0
  54. package/dist/cjs/wcs-tab.cjs.entry.js +20 -0
  55. package/dist/cjs/wcs-tabs.cjs.entry.js +159 -0
  56. package/dist/cjs/wcs-textarea.cjs.entry.js +224 -0
  57. package/dist/cjs/wcs-tooltip.cjs.entry.js +129 -0
  58. package/dist/cjs/wcs.cjs.js +3 -3
  59. package/dist/collection/collection-manifest.json +3 -2
  60. package/dist/collection/components/button/button.css +79 -75
  61. package/dist/collection/components/button/button.js +23 -11
  62. package/dist/collection/components/com-nav/com-nav.css +1 -2
  63. package/dist/collection/components/com-nav-category/com-nav-category.css +5 -6
  64. package/dist/collection/components/com-nav-category/com-nav-category.js +31 -1
  65. package/dist/collection/components/com-nav-submenu/com-nav-submenu.css +1 -2
  66. package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +21 -1
  67. package/dist/collection/components/footer/footer.css +1 -1
  68. package/dist/collection/components/grid/grid.js +47 -8
  69. package/dist/collection/components/grid-column/grid-column.css +5 -0
  70. package/dist/collection/components/grid-column/grid-column.js +62 -2
  71. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +45 -0
  72. package/dist/collection/components/grid-pagination/grid-pagination.js +4 -4
  73. package/dist/collection/components/header/header.css +1 -1
  74. package/dist/collection/components/input/input.js +2 -2
  75. package/dist/collection/components/select/select.css +81 -77
  76. package/dist/collection/components/select/select.js +2 -2
  77. package/dist/collection/components/select-option/select-option.css +79 -75
  78. package/dist/collection/components/select-option/select-option.js +6 -7
  79. package/dist/collection/components/tab/tab.js +4 -4
  80. package/dist/collection/components/tabs/tabs.js +1 -1
  81. package/dist/collection/components/textarea/textarea.js +2 -2
  82. package/dist/collection/components/tooltip/tooltip.js +2 -2
  83. package/dist/esm/component-6b4d470f.js +1072 -0
  84. package/dist/esm/helpers-50436c51.js +73 -0
  85. package/dist/esm/{index-c619b1fa.js → index-b982604a.js} +165 -88
  86. package/dist/esm/loader.js +3 -3
  87. package/dist/{cjs/wcs-action-bar_47.cjs.entry.js → esm/lodash-d6d9d079.js} +12610 -22791
  88. package/dist/esm/select-arrow-73ac4016.js +34 -0
  89. package/dist/esm/wcs-action-bar.entry.js +20 -0
  90. package/dist/esm/wcs-app.entry.js +2 -2
  91. package/dist/esm/wcs-badge.entry.js +23 -0
  92. package/dist/esm/wcs-button.entry.js +82 -0
  93. package/dist/esm/wcs-card-body.entry.js +15 -0
  94. package/dist/esm/wcs-card.entry.js +16 -0
  95. package/dist/esm/wcs-checkbox.entry.js +39 -0
  96. package/dist/esm/wcs-com-nav-category.entry.js +59 -0
  97. package/dist/esm/wcs-com-nav-submenu.entry.js +65 -0
  98. package/dist/esm/wcs-com-nav.entry.js +15 -0
  99. package/dist/esm/wcs-divider.entry.js +15 -0
  100. package/dist/esm/wcs-dropdown-item.entry.js +19 -0
  101. package/dist/esm/wcs-dropdown.entry.js +53 -0
  102. package/dist/esm/wcs-editable-field.entry.js +221 -0
  103. package/dist/esm/wcs-error_2.entry.js +132 -0
  104. package/dist/esm/wcs-field-content.entry.js +12 -0
  105. package/dist/esm/wcs-field-label.entry.js +12 -0
  106. package/dist/esm/wcs-field.entry.js +15 -0
  107. package/dist/esm/wcs-footer.entry.js +15 -0
  108. package/dist/esm/wcs-galactic-menu.entry.js +1781 -0
  109. package/dist/esm/wcs-galactic.entry.js +37 -0
  110. package/dist/esm/wcs-grid-column.entry.js +69 -0
  111. package/dist/esm/wcs-grid-custom-cell.entry.js +12 -0
  112. package/dist/esm/wcs-grid-pagination.entry.js +4 -4
  113. package/dist/esm/wcs-grid.entry.js +305 -0
  114. package/dist/esm/wcs-header.entry.js +21 -0
  115. package/dist/esm/wcs-hint.entry.js +16 -0
  116. package/dist/esm/wcs-horizontal-stepper.entry.js +110 -0
  117. package/dist/esm/wcs-icon.entry.js +2 -2
  118. package/dist/esm/wcs-input.entry.js +224 -0
  119. package/dist/esm/wcs-label.entry.js +16 -0
  120. package/dist/esm/wcs-list-item-properties.entry.js +15 -0
  121. package/dist/esm/wcs-list-item-property.entry.js +15 -0
  122. package/dist/esm/wcs-list-item.entry.js +19 -0
  123. package/dist/esm/wcs-mat-icon.entry.js +69 -0
  124. package/dist/esm/wcs-modal.entry.js +41 -0
  125. package/dist/esm/wcs-nav-item.entry.js +19 -0
  126. package/dist/esm/wcs-nav.entry.js +15 -0
  127. package/dist/esm/wcs-progress-bar.entry.js +43 -0
  128. package/dist/esm/wcs-progress-radial.entry.js +26 -0
  129. package/dist/esm/wcs-radio-group.entry.js +61 -0
  130. package/dist/esm/wcs-radio.entry.js +45 -0
  131. package/dist/esm/wcs-select_2.entry.js +4911 -0
  132. package/dist/esm/wcs-spinner.entry.js +17 -0
  133. package/dist/esm/wcs-switch.entry.js +30 -0
  134. package/dist/esm/wcs-tab.entry.js +16 -0
  135. package/dist/esm/wcs-tabs.entry.js +155 -0
  136. package/dist/esm/wcs-textarea.entry.js +220 -0
  137. package/dist/esm/wcs-tooltip.entry.js +125 -0
  138. package/dist/esm/wcs.js +3 -3
  139. package/dist/types/components/button/button.d.ts +7 -3
  140. package/dist/types/components/com-nav-category/com-nav-category.d.ts +7 -0
  141. package/dist/types/components/com-nav-submenu/com-nav-submenu.d.ts +7 -0
  142. package/dist/types/components/grid/grid.d.ts +7 -0
  143. package/dist/types/components/grid-column/grid-column.d.ts +4 -0
  144. package/dist/types/components/grid-custom-cell/grid-custom-cell.d.ts +12 -0
  145. package/dist/types/components/select-option/select-option.d.ts +2 -0
  146. package/dist/types/components.d.ts +43 -0
  147. package/dist/types/stencil-public-runtime.d.ts +183 -182
  148. package/dist/wcs/p-03b2e238.entry.js +1 -0
  149. package/dist/wcs/p-0fbe574e.entry.js +1 -0
  150. package/dist/wcs/p-15008e35.entry.js +1 -0
  151. package/dist/wcs/p-16dfbae8.js +127 -0
  152. package/dist/wcs/p-17c6db7f.entry.js +1 -0
  153. package/dist/wcs/p-1dce7e63.entry.js +1 -0
  154. package/dist/wcs/p-1f5aed36.entry.js +1 -0
  155. package/dist/wcs/p-214236db.entry.js +1 -0
  156. package/dist/wcs/p-26b5c0a3.entry.js +1 -0
  157. package/dist/wcs/p-2e6265dc.entry.js +1 -0
  158. package/dist/wcs/p-356a8e3b.entry.js +1 -0
  159. package/dist/wcs/p-3d10b02a.entry.js +15 -0
  160. package/dist/wcs/p-4338f140.entry.js +1 -0
  161. package/dist/wcs/p-474d6601.entry.js +1 -0
  162. package/dist/wcs/p-55fdc284.entry.js +1 -0
  163. package/dist/wcs/p-5b35b232.entry.js +1 -0
  164. package/dist/wcs/p-600a9cc0.entry.js +1 -0
  165. package/dist/wcs/p-60b51967.entry.js +1 -0
  166. package/dist/wcs/p-62f7ab6d.entry.js +1 -0
  167. package/dist/wcs/p-64523291.entry.js +1 -0
  168. package/dist/wcs/p-65c5ccc5.entry.js +1 -0
  169. package/dist/wcs/p-688fea65.entry.js +1 -0
  170. package/dist/wcs/p-716d5921.entry.js +1 -0
  171. package/dist/wcs/p-7219c04b.js +1 -0
  172. package/dist/wcs/p-8137f075.entry.js +1 -0
  173. package/dist/wcs/p-83f1ad32.js +1 -0
  174. package/dist/wcs/p-8864a491.entry.js +1 -0
  175. package/dist/wcs/p-8f0f9868.entry.js +1 -0
  176. package/dist/wcs/p-91a2de07.entry.js +1 -0
  177. package/dist/wcs/p-94a31f64.entry.js +1 -0
  178. package/dist/wcs/p-979dfd78.entry.js +1 -0
  179. package/dist/wcs/p-9ba52bc4.entry.js +1 -0
  180. package/dist/wcs/p-a1ee1551.entry.js +1 -0
  181. package/dist/wcs/p-a5a1b27c.entry.js +1 -0
  182. package/dist/wcs/p-adef7aaf.js +1 -0
  183. package/dist/wcs/p-af1a5e52.entry.js +1 -0
  184. package/dist/wcs/p-b7184d59.entry.js +1 -0
  185. package/dist/wcs/p-bef44630.entry.js +1 -0
  186. package/dist/wcs/p-d59b4495.entry.js +1 -0
  187. package/dist/wcs/p-db68379f.entry.js +1 -0
  188. package/dist/wcs/p-dbbc3f58.entry.js +1 -0
  189. package/dist/wcs/p-dc817204.entry.js +1 -0
  190. package/dist/wcs/p-dd300dea.entry.js +1 -0
  191. package/dist/wcs/p-e0163de8.entry.js +1 -0
  192. package/dist/wcs/p-e4236d32.entry.js +1 -0
  193. package/dist/wcs/p-e43358e4.entry.js +1 -0
  194. package/dist/wcs/p-e486647c.entry.js +1 -0
  195. package/dist/wcs/p-e9ce507c.entry.js +1 -0
  196. package/dist/wcs/p-ed6e8541.entry.js +1 -0
  197. package/dist/wcs/p-f46e6c3c.js +1 -0
  198. package/dist/wcs/p-f9944bde.entry.js +1 -0
  199. package/dist/wcs/p-fa173947.entry.js +1 -0
  200. package/dist/wcs/p-fb1577b5.entry.js +1 -0
  201. package/dist/wcs/p-febe9ccc.entry.js +1 -0
  202. package/dist/wcs/wcs.esm.js +1 -1
  203. package/loader/index.d.ts +0 -1
  204. package/package.json +22 -20
  205. package/dist/wcs/p-16dca526.entry.js +0 -1
  206. package/dist/wcs/p-4f228fcb.entry.js +0 -134
  207. package/dist/wcs/p-66520e5a.entry.js +0 -1
  208. package/dist/wcs/p-d31287c6.entry.js +0 -1
  209. package/dist/wcs/p-f73f235b.js +0 -1
  210. package/schematics/.gitignore +0 -18
  211. package/schematics/.npmignore +0 -4
  212. package/schematics/collection.json +0 -9
  213. package/schematics/src/ng-add/files/fonts/avenir-black.woff +0 -0
  214. package/schematics/src/ng-add/files/fonts/avenir-book.woff +0 -0
  215. package/schematics/src/ng-add/files/fonts/avenir-lighter.woff +0 -0
  216. package/schematics/src/ng-add/files/fonts/avenir-medium.woff +0 -0
  217. package/schematics/src/ng-add/files/sncf-logo.png +0 -0
  218. package/schematics/src/ng-add/index.d.ts +0 -3
  219. package/schematics/src/ng-add/index.js +0 -119
  220. package/schematics/src/ng-add/index.js.map +0 -1
  221. package/schematics/src/ng-add/schema.json +0 -5
@@ -0,0 +1,37 @@
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-b982604a.js';
2
+
3
+ const galacticCss = ":host{display:block;background-color:var(--wcs-gray)}.container{height:32px;align-items:center;justify-content:space-between;color:var(--wcs-white);font-size:14px;display:flex;max-width:var(--wcs-com-content-max-width);margin:0 auto}.container #sncf-logo{height:32px;margin-right:20px}.container .container-left{display:flex;align-items:center}";
4
+
5
+ let Galactic = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.show = false;
9
+ }
10
+ render() {
11
+ return (h(Host, null, h("div", { class: "container" }, h("div", { class: "container-left" }, h("img", { src: SNCF_BASE64_SVG_LOGO, id: "sncf-logo", alt: "Logo SNCF" }), h("span", null, this.text)), h("div", { class: "menu" }, h("slot", null)))));
12
+ }
13
+ get el() { return getElement(this); }
14
+ };
15
+ const SNCF_BASE64_SVG_LOGO = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVy' +
16
+ 'c2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5' +
17
+ 'rIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KCTxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHX0dSQURJRU5UIiBncmFkaW' +
18
+ 'VudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAiIHkxPSIxNiIgeDI9IjMxLjk1OTMiIHkyPSIxNiI+DQoJCTxzdG9wICBvZmZzZXQ9IjAiIHN0e' +
19
+ 'WxlPSJzdG9wLWNvbG9yOiM4MzJGNzAiLz4NCgkJPHN0b3AgIG9mZnNldD0iMC4yNDcyIiBzdHlsZT0ic3RvcC1jb2xvcjojQUMyODdDIi8+DQoJCTxz' +
20
+ 'dG9wICBvZmZzZXQ9IjAuODE0NiIgc3R5bGU9InN0b3AtY29sb3I6I0RGMjUzMCIvPg0KCQk8c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2x' +
21
+ 'vcjojREYyNTMwIi8+DQoJPC9saW5lYXJHcmFkaWVudD4NCgk8cGF0aCBmaWxsPSJ1cmwoI1NWR19HUkFESUVOVCkiIGQ9Ik0wLjYsNy43QzAuMiw3Lj' +
22
+ 'csMCw3LjgsMCw4LjJ2MTUuN2MwLDAuMywwLjIsMC41LDAuNSwwLjVoMjhjMC4zLDAsMC41LDAsMC42LTAuNGMwLDAsMi44LTguOSwyLjktOSBjMC4xL' +
23
+ 'TAuMywwLTAuNS0wLjMtMC43QzIyLjYsOC41LDguOSw3LjYsMi44LDcuNkMxLjksNy42LDEuMSw3LjYsMC42LDcuN3oiLz4NCgk8cGF0aCBmaWxsPSIj' +
24
+ 'RkZGRkZGIiBkPSJNNi40LDE3LjdjLTEtMC41LTEuNy0wLjgtMS42LTEuM0M1LDE1LjgsNi4xLDE1LjYsNywxNS42YzAuNSwwLDAuOCwwLjEsMS4yLDA' +
25
+ 'uMmwwLjMtMS4xIGMtMC41LTAuMS0wLjgtMC4xLTEuNC0wLjFjLTEuOSwwLTMuNiwwLjUtNCwxLjZjLTAuNSwxLjMsMC45LDIsMi4yLDIuNmMxLDAuNS' +
26
+ 'wxLjgsMC45LDEuNSwxLjVjLTAuMiwwLjUtMC45LDAuNy0yLDAuNyBjLTAuOSwwLTItMC4zLTIuOS0wLjdsLTAuNSwxLjFjMC42LDAuMywyLDAuNywzL' +
27
+ 'jEsMC43YzIuMSwwLDMuNS0wLjUsNC4xLTEuN0M5LjMsMTkuMSw3LjcsMTguMyw2LjQsMTcuN3oiLz4NCgk8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJN' +
28
+ 'OS4zLDE5LjZDOS4zLDE5LjcsOS4zLDE5LjcsOS4zLDE5LjZjMC4xLDAsMC4xLDAsMC4xLDBjMCwwLDEtMy4yLDEtMy4yYzEuMSwxLjUsMi4xLDMuNSw' +
29
+ 'yLjcsNS42aDEuNyBsMC45LTIuN2MwLDAsMCwwLDAuMSwwYzAsMCwwLDAsMC4xLDBjMC4zLDEuNywxLjksMi44LDQuMywyLjhjMS41LDAsMi45LTAuNC' +
30
+ 'wzLjItMC42bDAuOS0yLjhoMy40bDAuMy0xLjFoLTMuNGwwLjYtMS44aDQuMSBsMC40LTEuMWgtNS43bC0xLjksNi4xYy0wLjQsMC4xLTAuOSwwLjItM' +
31
+ 'S41LDAuMmMtMS4xLDAtMi4xLTAuMy0yLjYtMC45Yy0wLjQtMC41LTAuNS0xLTAuNC0xLjdjMC4yLTEuNiwxLjgtMi42LDMuOC0yLjYgYzAuNCwwLDAu' +
32
+ 'OSwwLDEuMywwLjFsMC40LTEuMmMtMC41LTAuMS0xLjEtMC4xLTEuNy0wLjFjLTEuOCwwLTMuNCwwLjYtNC40LDEuN2MwLDAtMC4xLDAtMC4xLDBjMCw' +
33
+ 'wLTAuMSwwLDAsMGwwLjUtMS42aC0xLjUgTDE0LDE5LjhjLTAuNS0xLjUtMS42LTMuNS0yLjktNS4xSDkuNWwtMS4yLDMuN0M4LjksMTguOCw5LjEsMT' +
34
+ 'kuMiw5LjMsMTkuNnoiLz4NCjwvc3ZnPg0K';
35
+ Galactic.style = galacticCss;
36
+
37
+ export { Galactic as wcs_galactic };
@@ -0,0 +1,69 @@
1
+ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-b982604a.js';
2
+
3
+ const GridSortArrow = ({ state }) => (h("svg", { style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "20", viewBox: "0 0 24 20" },
4
+ h("style", { type: "text/css" }, `
5
+ .arrow-group {
6
+ transform-origin: 50% 51%;
7
+ transition: transform 175ms ease-in-out;
8
+ }
9
+ .arrow{
10
+ transition: fill 175ms ease-in-out;
11
+ fill: var(--wcs-text-light);
12
+ }
13
+ .asc {
14
+ transform: scaleY(1) translateY(-6px);
15
+ }
16
+ .desc {
17
+ transform: scaleY(-1) translateY(-6px);
18
+ }
19
+ .active {
20
+ fill: var(--wcs-primary);
21
+ }
22
+
23
+ `),
24
+ h("g", { fill: "none", class: 'asc arrow-group' },
25
+ h("path", { class: (state === 'asc' ? 'active' : '') + ' arrow', d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" }),
26
+ h("path", { d: "M0 0h24v24H0z", fill: "none" })),
27
+ h("g", { fill: "none", class: 'desc arrow-group' },
28
+ h("path", { class: (state === 'desc' ? 'active' : '') + ' arrow', d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" }),
29
+ h("path", { d: "M0 0h24v24H0z", fill: "none" }))));
30
+
31
+ const gridColumnCss = ":host{--wcs-grid-column-border-left:solid 1px var(--wcs-text-light);display:contents}:host th{color:var(--wcs-gray-dark);background-color:var(--wcs-light);border-left:var(--wcs-grid-column-border-left);padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);text-align:left}:host th .grid-column-th-content{display:inline-flex;flex-direction:row}:host th .grid-column-th-content span{user-select:none}:host .pointer{cursor:pointer}:host([sort-order=asc]) img{transform:scaleY(1)}:host([sort-order=desc]) img{transform:scaleY(-1)}:host([sort-order=none]) img{display:none}:host([sort-order=none]) th:hover img{display:inline-block}:host([hidden]){display:none !important}";
32
+
33
+ let GridColumn = class {
34
+ constructor(hostRef) {
35
+ registerInstance(this, hostRef);
36
+ this.wcsSortChange = createEvent(this, "wcsSortChange", 7);
37
+ this.wcsHiddenChange = createEvent(this, "wcsHiddenChange", 7);
38
+ this.sort = false;
39
+ this.sortOrder = 'none';
40
+ this.customCells = false;
41
+ this.hidden = false;
42
+ }
43
+ parseMyObjectProp(newValue) {
44
+ this.wcsHiddenChange.emit(newValue);
45
+ }
46
+ emitSortConfig() {
47
+ if (!this.sort)
48
+ return;
49
+ this.wcsSortChange.emit({
50
+ column: this.el,
51
+ order: this.sortOrder,
52
+ sortFn: this.sortFn
53
+ });
54
+ }
55
+ render() {
56
+ return (h(Host, { onClick: this.onSortClick.bind(this), slot: "grid-column" }, h("th", { style: { width: this.width }, class: this.sort ? 'pointer' : '' }, h("div", { class: "grid-column-th-content" }, h("span", null, this.name), this.sort ? h(GridSortArrow, { state: this.sortOrder }) : ''))));
57
+ }
58
+ onSortClick() {
59
+ this.sortOrder = this.sortOrder === 'none' || this.sortOrder === 'desc' ? 'asc' : 'desc';
60
+ this.emitSortConfig();
61
+ }
62
+ get el() { return getElement(this); }
63
+ static get watchers() { return {
64
+ "hidden": ["parseMyObjectProp"]
65
+ }; }
66
+ };
67
+ GridColumn.style = gridColumnCss;
68
+
69
+ export { GridColumn as wcs_grid_column };
@@ -0,0 +1,12 @@
1
+ import { r as registerInstance, h, H as Host } from './index-b982604a.js';
2
+
3
+ let GridCustomCell = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ }
7
+ render() {
8
+ return (h(Host, { slot: this.columnId + '-' + this.rowId }, h("slot", null)));
9
+ }
10
+ };
11
+
12
+ export { GridCustomCell as wcs_grid_custom_cell };
@@ -1,4 +1,4 @@
1
- import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-c619b1fa.js';
1
+ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-b982604a.js';
2
2
 
3
3
  const GridPaginationArrow = ({ active, order, double = false }) => (h("svg", { style: { marginLeft: 'auto', cursor: 'pointer' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "20", viewBox: "0 0 24 20" },
4
4
  h("style", { type: "text/css" }, `
@@ -34,15 +34,15 @@ const GridPaginationArrow = ({ active, order, double = false }) => (h("svg", { s
34
34
 
35
35
  const gridPaginationCss = ":host{display:block;border-style:solid none none;border-width:1px;border-color:var(--wcs-text-light)}.container{display:grid;grid-template-columns:auto auto auto;justify-content:space-between;color:var(--wcs-text-medium)}.available-page-sizes{width:auto}.page-management,.page-size,.items-count{display:flex;align-items:center}.pagination-arrow{display:flex}";
36
36
 
37
- const GridPagination = class {
37
+ let GridPagination = class {
38
38
  constructor(hostRef) {
39
39
  registerInstance(this, hostRef);
40
40
  this.wcsGridPaginationChange = createEvent(this, "wcsGridPaginationChange", 7);
41
41
  this.availablePageSizes = [10, 20, 50];
42
- this.currentPage = 1;
42
+ this.currentPage = 0;
43
43
  this.pageSize = this.availablePageSizes[0];
44
44
  this.itemsCount = 0;
45
- this.pageCount = 0;
45
+ this.pageCount = 1;
46
46
  }
47
47
  lastPage() {
48
48
  this.currentPage = this.pageCount - 1;
@@ -0,0 +1,305 @@
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-b982604a.js';
2
+ import { l as lodash } from './lodash-d6d9d079.js';
3
+
4
+ function getSortOrderInteger(sortOrder) {
5
+ switch (sortOrder) {
6
+ case 'asc':
7
+ return 1;
8
+ case 'desc':
9
+ return -1;
10
+ }
11
+ }
12
+
13
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
14
+ // require the crypto API and do not support built-in fallback to lower quality random number
15
+ // generators (like Math.random()).
16
+ var getRandomValues;
17
+ var rnds8 = new Uint8Array(16);
18
+ function rng() {
19
+ // lazy load so that environments that need to polyfill have a chance to do so
20
+ if (!getRandomValues) {
21
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
22
+ // find the complete implementation of crypto (msCrypto) on IE11.
23
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
24
+
25
+ if (!getRandomValues) {
26
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
27
+ }
28
+ }
29
+
30
+ return getRandomValues(rnds8);
31
+ }
32
+
33
+ const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
34
+
35
+ function validate(uuid) {
36
+ return typeof uuid === 'string' && REGEX.test(uuid);
37
+ }
38
+
39
+ /**
40
+ * Convert array of 16 byte values to UUID string format of the form:
41
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
42
+ */
43
+
44
+ var byteToHex = [];
45
+
46
+ for (var i = 0; i < 256; ++i) {
47
+ byteToHex.push((i + 0x100).toString(16).substr(1));
48
+ }
49
+
50
+ function stringify(arr) {
51
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
52
+ // Note: Be careful editing this code! It's been tuned for performance
53
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
54
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
55
+ // of the following:
56
+ // - One or more input array values don't map to a hex octet (leading to
57
+ // "undefined" in the uuid)
58
+ // - Invalid input values for the RFC `version` or `variant` fields
59
+
60
+ if (!validate(uuid)) {
61
+ throw TypeError('Stringified UUID is invalid');
62
+ }
63
+
64
+ return uuid;
65
+ }
66
+
67
+ function v4(options, buf, offset) {
68
+ options = options || {};
69
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
70
+
71
+ rnds[6] = rnds[6] & 0x0f | 0x40;
72
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
73
+
74
+ if (buf) {
75
+ offset = offset || 0;
76
+
77
+ for (var i = 0; i < 16; ++i) {
78
+ buf[offset + i] = rnds[i];
79
+ }
80
+
81
+ return buf;
82
+ }
83
+
84
+ return stringify(rnds);
85
+ }
86
+
87
+ const gridCss = ":host{display:block;--wcs-grid-highlight-color:var(--wcs-light)}:host th{background-color:var(--wcs-light)}:host th:not(:first-child){border-left:solid 1px var(--wcs-text-light)}:host ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:none}:host table{width:100%;border-spacing:0}:host td{color:var(--wcs-gray-light);margin:0;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding)}:host tr:not(:last-child) td{border-bottom:solid 1px var(--wcs-text-light)}:host .wcs-grid-selection-column{padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);width:40px}:host tr.selected{background-color:var(--wcs-grid-highlight-color)}:host .loading{text-align:center}:host([selection]) ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:solid 1px var(--wcs-text-light) !important}";
88
+
89
+ let Grid = class {
90
+ constructor(hostRef) {
91
+ registerInstance(this, hostRef);
92
+ this.wcsGridSelectionChange = createEvent(this, "wcsGridSelectionChange", 7);
93
+ this.wcsGridAllSelectionChange = createEvent(this, "wcsGridAllSelectionChange", 7);
94
+ /**
95
+ * Used to manage grid's row selection
96
+ */
97
+ this.selectionConfig = 'none';
98
+ /**
99
+ * Set the selected items
100
+ */
101
+ this.selectedItems = [];
102
+ /**
103
+ * Rows to display, contains user data and meta data
104
+ */
105
+ this.rows = [];
106
+ }
107
+ onDataChange(newValue) {
108
+ this.updateGridRows(newValue);
109
+ }
110
+ onSelectedItemsPropertyChange(newValue) {
111
+ this.updateSelectionWithValues(newValue);
112
+ }
113
+ onHiddenColumnChange() {
114
+ // We use forceUpdate because the fact of hiding a column or not does not modify the internal structure of the grid (WcsGridRow).
115
+ // Hide a column only impacts the way it is rendered but the grid-column remains in the dom and in our internal model.
116
+ forceUpdate(this);
117
+ }
118
+ updateSelectionWithValues(values) {
119
+ if (this.selectionConfig === 'single') {
120
+ this.rows.map(r => r.selected = false);
121
+ for (const row of this.rows) {
122
+ if (lodash.isEqual(row.data, values)) {
123
+ row.selected = true;
124
+ break; // only one line can be selected
125
+ }
126
+ }
127
+ }
128
+ else if (this.selectionConfig === 'multiple') {
129
+ this.rows.map(r => r.selected = false);
130
+ for (const row of this.rows) {
131
+ if (values.find(x => lodash.isEqual(x, row.data))) {
132
+ row.selected = true;
133
+ }
134
+ }
135
+ }
136
+ this.rows = lodash.cloneDeep(this.rows);
137
+ }
138
+ wcsGridRowToWcsGridRowData(row) {
139
+ return { selected: row.selected, page: row.page, data: row.data };
140
+ }
141
+ updateGridRows(data) {
142
+ const rows = [];
143
+ if (data && this.columns) {
144
+ for (let i = 0; i < data.length; i++) {
145
+ const row = {
146
+ uuid: v4(),
147
+ data: data[i],
148
+ selected: false,
149
+ cells: []
150
+ };
151
+ for (const column of this.columns) {
152
+ row.cells.push({
153
+ content: lodash.get(data[i], column.path),
154
+ column,
155
+ formatter: column.formatter
156
+ });
157
+ }
158
+ rows.push(row);
159
+ }
160
+ this.rows = rows;
161
+ this.updatePageIndex();
162
+ }
163
+ }
164
+ componentDidLoad() {
165
+ this.columns = this.getGridColumnsFromTemplate();
166
+ this.paginationEl = this.wcsGridPaginationId
167
+ ? document.getElementById(this.wcsGridPaginationId)
168
+ : this.getGridPaginationsFromTemplate()[0];
169
+ this.updateGridRows(this.data);
170
+ if (this.selectedItems) {
171
+ this.updateSelectionWithValues(this.selectedItems);
172
+ }
173
+ }
174
+ getGridColumnsFromTemplate() {
175
+ const slotted = this.el.shadowRoot.querySelector('slot[name="grid-column"]');
176
+ return slotted.assignedElements();
177
+ }
178
+ getGridPaginationsFromTemplate() {
179
+ const slotted = this.el.shadowRoot.querySelector('slot[name="grid-pagination"]');
180
+ return slotted.assignedElements();
181
+ }
182
+ sortChangeEventHandler(event) {
183
+ // We keep only one active sort column
184
+ this.columns.filter(c => c !== event.detail.column).forEach(c => c.sortOrder = 'none');
185
+ if (this.serverMode)
186
+ return;
187
+ if (event.detail.sortFn) {
188
+ this.rows = lodash.cloneDeep(this.rows)
189
+ .sort((a, b) => event.detail.sortFn(a.data, b.data, event.detail.column) * getSortOrderInteger(event.detail.order));
190
+ }
191
+ else {
192
+ this.rows = lodash.cloneDeep(this.rows)
193
+ .sort((a, b) => {
194
+ const path = event.detail.column.path;
195
+ return ((lodash.get(a.data, path) < lodash.get(b.data, path)) ? -1 : (lodash.get(a.data, path) > lodash.get(b.data, path)) ? 1 : 0) * getSortOrderInteger(event.detail.order);
196
+ });
197
+ }
198
+ this.updatePageIndex();
199
+ }
200
+ /**
201
+ * Update the page's number of all rows
202
+ */
203
+ updatePageIndex() {
204
+ if (!this.serverMode && this.paginationEl) {
205
+ if (this.paginationEl.currentPage + 1 > this.paginationEl.pageCount) {
206
+ this.paginationEl.currentPage = this.paginationEl.pageCount - 1;
207
+ }
208
+ this.paginationEl.itemsCount = this.data.length;
209
+ this.paginationEl.pageCount = Math.ceil(this.data.length / this.paginationEl.pageSize);
210
+ const rows = lodash.cloneDeep(this.rows);
211
+ rows.forEach((row, index) => row.page = Math.floor(index / this.paginationEl.pageSize));
212
+ this.rows = [...rows];
213
+ }
214
+ }
215
+ paginationChangeEventHandler() {
216
+ this.onPaginationChange();
217
+ }
218
+ paginationChangeEventHandlerOutside(event) {
219
+ if (this.wcsGridPaginationId && this.wcsGridPaginationId === event.target.id) {
220
+ this.onPaginationChange();
221
+ }
222
+ }
223
+ onPaginationChange() {
224
+ if (this.serverMode)
225
+ return;
226
+ this.updatePageIndex();
227
+ }
228
+ onRowSelection(row) {
229
+ if (this.selectionConfig === 'single') {
230
+ this.rows.filter(r => r.uuid !== row.uuid).map(r => r.selected = false);
231
+ }
232
+ row.selected = !row.selected;
233
+ if (this.selectionConfig !== 'single' || row.selected) {
234
+ this.wcsGridSelectionChange.emit({ row: this.wcsGridRowToWcsGridRowData(row) });
235
+ }
236
+ this.rows = lodash.cloneDeep(this.rows);
237
+ }
238
+ selectAllRows() {
239
+ const rows = this.getRowsForCurrentPage();
240
+ const selected = !this.allRowsAreSelected();
241
+ rows.map(r => r.selected = selected);
242
+ this.wcsGridAllSelectionChange.emit({ rows: selected ? rows.map(row => this.wcsGridRowToWcsGridRowData(row)) : [] });
243
+ this.rows = lodash.cloneDeep(this.rows);
244
+ }
245
+ allRowsAreSelected() {
246
+ const rows = this.getRowsForCurrentPage();
247
+ return rows.length > 0 && rows.filter(row => row.selected).length === rows.length;
248
+ }
249
+ getRowsForCurrentPage() {
250
+ if (this.paginationEl) {
251
+ return this.rows.filter(row => row.page === this.paginationEl.currentPage);
252
+ }
253
+ return this.rows;
254
+ }
255
+ renderSelectionColumn(row) {
256
+ switch (this.selectionConfig) {
257
+ case 'none':
258
+ return;
259
+ case 'single':
260
+ return h("td", null, h("wcs-radio", { checked: row.selected, onClick: this.onRowSelection.bind(this, row) }));
261
+ case 'multiple':
262
+ return h("td", null, h("wcs-checkbox", { checked: row.selected, onWcsChange: this.onRowSelection.bind(this, row) }));
263
+ }
264
+ }
265
+ getCellContent(row, cell) {
266
+ if (cell.formatter) {
267
+ return cell.formatter(h, cell.column, this.wcsGridRowToWcsGridRowData(row));
268
+ }
269
+ return cell.content;
270
+ }
271
+ totalColumnCount() {
272
+ if (!this.columns) {
273
+ return 0;
274
+ }
275
+ return this.columns.length + (this.selectionConfig === 'none' ? 0 : 1);
276
+ }
277
+ render() {
278
+ var _a;
279
+ return (h(Host, null, h("table", null, h("thead", null, this.selectionConfig === 'none' ? ''
280
+ : h("th", { class: "wcs-grid-selection-column" }, this.selectionConfig === 'single' ? '' :
281
+ h("wcs-checkbox", { checked: this.allRowsAreSelected(), onWcsChange: this.selectAllRows.bind(this) })), h("slot", { name: "grid-column" })), h("tbody", null, this.loading
282
+ ? h("tr", null, h("td", { colSpan: this.totalColumnCount(), class: "loading" }, h("wcs-spinner", null)))
283
+ : (_a = this.rows) === null || _a === void 0 ? void 0 : _a.filter(row => this.serverMode || !this.paginationEl || row.page === this.paginationEl.currentPage).map(row => this.renderRow(row)))), h("slot", { name: "grid-pagination" })));
284
+ }
285
+ renderRow(row) {
286
+ var _a;
287
+ return h("tr", { class: row.selected ? 'selected' : '' }, this.renderSelectionColumn(row), (_a = row.cells) === null || _a === void 0 ? void 0 :
288
+ _a.map(cell => {
289
+ if (cell.column.hidden) {
290
+ return;
291
+ }
292
+ return cell.column.customCells
293
+ ? (h("td", null, h("slot", { name: cell.column.id + '-' + row.data[this.rowIdPath] })))
294
+ : (h("td", { part: cell.column.path + '-column' }, this.getCellContent(row, cell)));
295
+ }));
296
+ }
297
+ get el() { return getElement(this); }
298
+ static get watchers() { return {
299
+ "data": ["onDataChange"],
300
+ "selectedItems": ["onSelectedItemsPropertyChange"]
301
+ }; }
302
+ };
303
+ Grid.style = gridCss;
304
+
305
+ export { Grid as wcs_grid };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h, H as Host } from './index-b982604a.js';
2
+
3
+ const headerCss = "header{box-shadow:0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2);display:flex;align-items:center;background:var(--wcs-gray);padding:8px 8px 8px 16px;height:48px;z-index:1}::slotted(img){width:70px;height:36.8px;margin-right:16px}::slotted(h1){color:var(--wcs-white);margin:0;font-weight:500;font-size:1.5rem}::slotted([slot=actions]){margin-left:auto}";
4
+
5
+ let Header = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ }
9
+ hostData() {
10
+ return {
11
+ 'slot': 'header'
12
+ };
13
+ }
14
+ __stencil_render() {
15
+ return (h("header", null, h("slot", { name: "logo" }), h("slot", { name: "title" }), h("slot", { name: "actions" })));
16
+ }
17
+ render() { return h(Host, this.hostData(), this.__stencil_render()); }
18
+ };
19
+ Header.style = headerCss;
20
+
21
+ export { Header as wcs_header };
@@ -0,0 +1,16 @@
1
+ import { r as registerInstance, h, H as Host } from './index-b982604a.js';
2
+
3
+ const hintCss = ":host{margin-top:0.25rem}:host([small]){font-size:0.75rem;font-weight:400;color:var(--wcs-text-medium)}";
4
+
5
+ let Label = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.small = false;
9
+ }
10
+ render() {
11
+ return (h(Host, { slot: "messages" }, h("slot", null)));
12
+ }
13
+ };
14
+ Label.style = hintCss;
15
+
16
+ export { Label as wcs_hint };
@@ -0,0 +1,110 @@
1
+ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-b982604a.js';
2
+
3
+ const HorizontalStep = ({ step, checkOnComplete, complete, passed, active, first, disable, onClick }) => {
4
+ return (h("div", { class: "graphic-step", "data-first": first },
5
+ first ? null : (h("wcs-progress-bar", { value: passed ? 100 : 0 })),
6
+ h("wcs-button", { style: { 'backgroundColor': 'white' }, shape: "round", onClick: _ => onClick(step), mode: (active || complete) && !step.disable ? 'plain' : 'stroked', disabled: disable }, getButtonContent(step.button, checkOnComplete, complete, active))));
7
+ };
8
+ const getButtonContent = (stepButton, checkOnComplete, complete, active) => {
9
+ if (checkOnComplete && complete && !active) {
10
+ return (h("wcs-mat-icon", { size: "m", icon: "done", family: "outlined" }));
11
+ }
12
+ switch (stepButton.kind) {
13
+ case 'Icon':
14
+ return (h("wcs-mat-icon", { size: "m", icon: stepButton.iconName, family: stepButton.family ? stepButton.family : 'outlined' }));
15
+ case 'Text':
16
+ return (stepButton.text);
17
+ }
18
+ };
19
+
20
+ const horizontalStepperCss = ":host{display:block}:host .steps{display:flex;flex-direction:row;flex:1}:host .graphic-step{display:flex;flex-direction:row;flex:1;align-items:center}:host .graphic-step[data-first]{flex:0}:host wcs-progress-bar{--wcs-internal-progress-bar-border-radius:0;flex:1;margin:0 -1px}:host .label-container{justify-content:space-between;display:flex;flex-direction:row;margin-top:var(--wcs-base-margin)}:host .label-container>*{width:100%;text-align:center;flex:1;color:var(--wcs-text-medium);font-weight:500}:host .label-container>*[data-disable]{color:var(--wcs-text-light)}:host .label-container>*[data-current]{color:var(--wcs-primary)}:host .label-container>div[data-first]{margin-left:20px;text-align:left;flex:0.5}:host .label-container>div[data-first]>span{margin-left:-20px}:host .label-container>div[data-last]{margin-right:20px;text-align:right;flex:0.5}:host .label-container>div[data-last]>span{margin-right:-20px}";
21
+
22
+ let HorizontalStepper = class {
23
+ constructor(hostRef) {
24
+ registerInstance(this, hostRef);
25
+ this.wcsHorizontalStepClick = createEvent(this, "wcsHorizontalStepClick", 7);
26
+ /**
27
+ * index of the active step. The index corresponds to the index of the step in the 'steps' list
28
+ */
29
+ this.currentStep = 0;
30
+ /**
31
+ * Specifies if the stepper is in linear mode (the user can only click on the next step)
32
+ * or non-linear (the user can click on any step)
33
+ */
34
+ this.mode = 'nonLinear';
35
+ this.buttonMode = 'stroked';
36
+ }
37
+ componentWillLoad() {
38
+ this.internalCurrentStep = this.currentStep;
39
+ if (this.steps.length < 1) {
40
+ throw new Error('You must add at least one step');
41
+ }
42
+ }
43
+ onCurrentStepChange(newValue, oldValue) {
44
+ const stepInterval = Math.abs(oldValue - newValue);
45
+ this.el.style.setProperty('--wcs-progress-bar-animation-duration', 375 / stepInterval + 'ms');
46
+ if (newValue !== oldValue) {
47
+ for (let i = 0; i < stepInterval; i++) {
48
+ setTimeout(() => {
49
+ this.internalCurrentStep -= (oldValue - newValue) > 0 ? 1 : -1;
50
+ if (i === stepInterval - 1) {
51
+ this.el.style.removeProperty('--wcs-progress-bar-animation-duration');
52
+ }
53
+ }, (i * (375 / stepInterval)));
54
+ }
55
+ }
56
+ }
57
+ async previous() {
58
+ this.navigateToIndex(this.internalCurrentStep - 1, 'backward');
59
+ }
60
+ async next() {
61
+ this.navigateToIndex(this.internalCurrentStep + 1, 'forward');
62
+ }
63
+ navigateToIndex(index, direction) {
64
+ var _a, _b;
65
+ if (index >= 0 && index <= this.steps.length - 1) {
66
+ if (((_a = this.steps[index]) === null || _a === void 0 ? void 0 : _a.complete) || ((_b = this.steps[index]) === null || _b === void 0 ? void 0 : _b.disable)) {
67
+ this.navigateToIndex(index + (direction === 'forward' ? 1 : -1), direction);
68
+ }
69
+ else {
70
+ this.currentStep = index;
71
+ }
72
+ }
73
+ }
74
+ render() {
75
+ return (h(Host, null, h("div", { class: "steps" }, this.steps.map((step, index) => (h(HorizontalStep, { step: step, passed: index <= this.internalCurrentStep, checkOnComplete: this.checkOnComplete, complete: this.isComplete(step, index), active: index === this.internalCurrentStep, first: index === 0, disable: this.isDisable(step, index), onClick: step => this.wcsHorizontalStepClick.emit({ step, index }) })))), this.renderLabels()));
76
+ }
77
+ isComplete(step, index) {
78
+ return index <= this.internalCurrentStep || step.complete;
79
+ }
80
+ renderLabels() {
81
+ if (this.steps.map(s => s.text).every(s => !s)) {
82
+ return null;
83
+ }
84
+ else {
85
+ return h("div", { class: "label-container" }, this.steps.map((step, index) => (h("div", { "data-first": index === 0, "data-current": index === this.internalCurrentStep && !step.disable, "data-disable": this.isDisable(step, index), "data-last": index === this.steps.length - 1 }, h("span", null, step.text)))));
86
+ }
87
+ }
88
+ isDisable(step, index) {
89
+ return step.disable || (this.mode === 'linear' && (!this.isNextPossibleStep(index) && this.internalCurrentStep < index));
90
+ }
91
+ isNextPossibleStep(index) {
92
+ var _a;
93
+ if (index === 0)
94
+ return true;
95
+ if (((_a = this.steps[index - 1]) === null || _a === void 0 ? void 0 : _a.disable) || this.previousStepIsCompleteAndNotActive(index))
96
+ return this.isNextPossibleStep(index - 1);
97
+ return this.internalCurrentStep === index - 1;
98
+ }
99
+ previousStepIsCompleteAndNotActive(index) {
100
+ var _a;
101
+ return ((_a = this.steps[index - 1]) === null || _a === void 0 ? void 0 : _a.complete) && index - 1 !== this.internalCurrentStep;
102
+ }
103
+ get el() { return getElement(this); }
104
+ static get watchers() { return {
105
+ "currentStep": ["onCurrentStepChange"]
106
+ }; }
107
+ };
108
+ HorizontalStepper.style = horizontalStepperCss;
109
+
110
+ export { HorizontalStepper as wcs_horizontal_stepper };
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, h } from './index-c619b1fa.js';
1
+ import { r as registerInstance, h } from './index-b982604a.js';
2
2
 
3
- const Icon = class {
3
+ let Icon = class {
4
4
  constructor(hostRef) {
5
5
  registerInstance(this, hostRef);
6
6
  }