wcs-core 2.5.3 → 2.8.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 (295) hide show
  1. package/CHANGELOG.md +104 -5
  2. package/README.md +17 -1
  3. package/dist/cjs/component-fc28ed16.js +1074 -0
  4. package/dist/cjs/helpers-6abce594.js +86 -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/popper-5777994b.js +1732 -0
  9. package/dist/cjs/select-arrow-76ccf86d.js +36 -0
  10. package/dist/cjs/wcs-action-bar.cjs.entry.js +24 -0
  11. package/dist/cjs/wcs-app.cjs.entry.js +2 -2
  12. package/dist/cjs/wcs-badge.cjs.entry.js +27 -0
  13. package/dist/cjs/wcs-button.cjs.entry.js +86 -0
  14. package/dist/cjs/wcs-card-body.cjs.entry.js +19 -0
  15. package/dist/cjs/wcs-card.cjs.entry.js +20 -0
  16. package/dist/cjs/wcs-checkbox.cjs.entry.js +47 -0
  17. package/dist/cjs/wcs-com-nav-category.cjs.entry.js +63 -0
  18. package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +69 -0
  19. package/dist/cjs/wcs-com-nav.cjs.entry.js +19 -0
  20. package/dist/cjs/wcs-divider.cjs.entry.js +19 -0
  21. package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
  22. package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
  23. package/dist/cjs/wcs-dropdown-item.cjs.entry.js +23 -0
  24. package/dist/cjs/wcs-dropdown.cjs.entry.js +90 -0
  25. package/dist/cjs/wcs-editable-field.cjs.entry.js +225 -0
  26. package/dist/cjs/wcs-error_2.cjs.entry.js +137 -0
  27. package/dist/cjs/wcs-field-content.cjs.entry.js +16 -0
  28. package/dist/cjs/wcs-field-label.cjs.entry.js +16 -0
  29. package/dist/cjs/wcs-field.cjs.entry.js +19 -0
  30. package/dist/cjs/wcs-footer.cjs.entry.js +19 -0
  31. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +58 -0
  32. package/dist/cjs/wcs-galactic.cjs.entry.js +41 -0
  33. package/dist/cjs/wcs-grid-column.cjs.entry.js +77 -0
  34. package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +16 -0
  35. package/dist/cjs/wcs-grid-pagination.cjs.entry.js +4 -4
  36. package/dist/cjs/wcs-grid.cjs.entry.js +332 -0
  37. package/dist/cjs/wcs-header.cjs.entry.js +25 -0
  38. package/dist/cjs/wcs-hint.cjs.entry.js +20 -0
  39. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +114 -0
  40. package/dist/cjs/wcs-icon.cjs.entry.js +2 -2
  41. package/dist/cjs/wcs-input.cjs.entry.js +228 -0
  42. package/dist/cjs/wcs-label.cjs.entry.js +20 -0
  43. package/dist/cjs/wcs-list-item-properties.cjs.entry.js +19 -0
  44. package/dist/cjs/wcs-list-item-property.cjs.entry.js +19 -0
  45. package/dist/cjs/wcs-list-item.cjs.entry.js +23 -0
  46. package/dist/cjs/wcs-mat-icon.cjs.entry.js +73 -0
  47. package/dist/cjs/wcs-modal.cjs.entry.js +45 -0
  48. package/dist/cjs/wcs-nav-item.cjs.entry.js +23 -0
  49. package/dist/cjs/wcs-nav.cjs.entry.js +19 -0
  50. package/dist/cjs/wcs-progress-bar.cjs.entry.js +47 -0
  51. package/dist/cjs/wcs-progress-radial.cjs.entry.js +30 -0
  52. package/dist/cjs/wcs-radio-group.cjs.entry.js +65 -0
  53. package/dist/cjs/wcs-radio.cjs.entry.js +49 -0
  54. package/dist/cjs/wcs-select_2.cjs.entry.js +4916 -0
  55. package/dist/cjs/wcs-spinner.cjs.entry.js +21 -0
  56. package/dist/cjs/wcs-switch.cjs.entry.js +42 -0
  57. package/dist/cjs/wcs-tab.cjs.entry.js +20 -0
  58. package/dist/cjs/wcs-tabs.cjs.entry.js +159 -0
  59. package/dist/cjs/wcs-textarea.cjs.entry.js +224 -0
  60. package/dist/cjs/wcs-tooltip.cjs.entry.js +1635 -0
  61. package/dist/cjs/wcs.cjs.js +3 -3
  62. package/dist/collection/collection-manifest.json +5 -2
  63. package/dist/collection/components/badge/badge-interface.js +1 -0
  64. package/dist/collection/components/badge/badge.js +14 -4
  65. package/dist/collection/components/button/button.css +79 -75
  66. package/dist/collection/components/button/button.js +23 -11
  67. package/dist/collection/components/card/card-interface.js +1 -0
  68. package/dist/collection/components/card/card.js +7 -2
  69. package/dist/collection/components/checkbox/checkbox.css +18 -7
  70. package/dist/collection/components/checkbox/checkbox.js +24 -2
  71. package/dist/collection/components/com-nav/com-nav.css +1 -2
  72. package/dist/collection/components/com-nav-category/com-nav-category.css +5 -6
  73. package/dist/collection/components/com-nav-category/com-nav-category.js +31 -1
  74. package/dist/collection/components/com-nav-submenu/com-nav-submenu.css +1 -2
  75. package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +21 -1
  76. package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
  77. package/dist/collection/components/dropdown/dropdown.css +46 -38
  78. package/dist/collection/components/dropdown/dropdown.js +90 -29
  79. package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
  80. package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
  81. package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
  82. package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
  83. package/dist/collection/components/editable-field/editable-field.js +7 -2
  84. package/dist/collection/components/footer/footer.css +1 -1
  85. package/dist/collection/components/form-field/form-field.css +1 -2
  86. package/dist/collection/components/form-field/form-field.js +0 -17
  87. package/dist/collection/components/grid/grid.js +75 -13
  88. package/dist/collection/components/grid-column/grid-column.css +5 -0
  89. package/dist/collection/components/grid-column/grid-column.js +69 -3
  90. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +45 -0
  91. package/dist/collection/components/grid-pagination/grid-pagination.js +4 -4
  92. package/dist/collection/components/header/header.css +1 -1
  93. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +7 -2
  94. package/dist/collection/components/input/input.css +48 -0
  95. package/dist/collection/components/input/input.js +40 -4
  96. package/dist/collection/components/mat-icon/mat-icon.css +1 -1
  97. package/dist/collection/components/mat-icon/mat-icon.js +7 -2
  98. package/dist/collection/components/modal/modal.css +8 -5
  99. package/dist/collection/components/modal/modal.js +5 -5
  100. package/dist/collection/components/nav-item/nav-item.js +1 -1
  101. package/dist/collection/components/progress-bar/progress-bar.js +4 -4
  102. package/dist/collection/components/radio/radio.component.js +9 -4
  103. package/dist/collection/components/radio/radio.css +43 -18
  104. package/dist/collection/components/radio-group/radio-group.css +4 -0
  105. package/dist/collection/components/radio-group/radio-group.js +10 -5
  106. package/dist/collection/components/select/select.css +81 -77
  107. package/dist/collection/components/select/select.js +2 -2
  108. package/dist/collection/components/select-option/select-option.css +79 -75
  109. package/dist/collection/components/select-option/select-option.js +6 -7
  110. package/dist/collection/components/spinner/spinner-interface.js +1 -0
  111. package/dist/collection/components/spinner/spinner.js +8 -3
  112. package/dist/collection/components/switch/switch.css +53 -16
  113. package/dist/collection/components/switch/switch.js +55 -6
  114. package/dist/collection/components/tab/tab.js +5 -5
  115. package/dist/collection/components/tabs/tabs.js +2 -2
  116. package/dist/collection/components/textarea/textarea.css +4 -0
  117. package/dist/collection/components/textarea/textarea.js +2 -2
  118. package/dist/collection/components/tooltip/tooltip.css +3 -0
  119. package/dist/collection/components/tooltip/tooltip.js +310 -92
  120. package/dist/collection/utils/helpers.js +4 -0
  121. package/dist/esm/component-6b4d470f.js +1072 -0
  122. package/dist/esm/helpers-e2993152.js +77 -0
  123. package/dist/esm/{index-c619b1fa.js → index-b982604a.js} +165 -88
  124. package/dist/esm/loader.js +3 -3
  125. package/dist/{cjs/wcs-action-bar_47.cjs.entry.js → esm/lodash-d6d9d079.js} +12610 -22791
  126. package/dist/esm/popper-5f42e560.js +1729 -0
  127. package/dist/esm/select-arrow-73ac4016.js +34 -0
  128. package/dist/esm/wcs-action-bar.entry.js +20 -0
  129. package/dist/esm/wcs-app.entry.js +2 -2
  130. package/dist/esm/wcs-badge.entry.js +23 -0
  131. package/dist/esm/wcs-button.entry.js +82 -0
  132. package/dist/esm/wcs-card-body.entry.js +15 -0
  133. package/dist/esm/wcs-card.entry.js +16 -0
  134. package/dist/esm/wcs-checkbox.entry.js +43 -0
  135. package/dist/esm/wcs-com-nav-category.entry.js +59 -0
  136. package/dist/esm/wcs-com-nav-submenu.entry.js +65 -0
  137. package/dist/esm/wcs-com-nav.entry.js +15 -0
  138. package/dist/esm/wcs-divider.entry.js +15 -0
  139. package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
  140. package/dist/esm/wcs-dropdown-header.entry.js +15 -0
  141. package/dist/esm/wcs-dropdown-item.entry.js +19 -0
  142. package/dist/esm/wcs-dropdown.entry.js +86 -0
  143. package/dist/esm/wcs-editable-field.entry.js +221 -0
  144. package/dist/esm/wcs-error_2.entry.js +132 -0
  145. package/dist/esm/wcs-field-content.entry.js +12 -0
  146. package/dist/esm/wcs-field-label.entry.js +12 -0
  147. package/dist/esm/wcs-field.entry.js +15 -0
  148. package/dist/esm/wcs-footer.entry.js +15 -0
  149. package/dist/esm/wcs-galactic-menu.entry.js +54 -0
  150. package/dist/esm/wcs-galactic.entry.js +37 -0
  151. package/dist/esm/wcs-grid-column.entry.js +73 -0
  152. package/dist/esm/wcs-grid-custom-cell.entry.js +12 -0
  153. package/dist/esm/wcs-grid-pagination.entry.js +4 -4
  154. package/dist/esm/wcs-grid.entry.js +328 -0
  155. package/dist/esm/wcs-header.entry.js +21 -0
  156. package/dist/esm/wcs-hint.entry.js +16 -0
  157. package/dist/esm/wcs-horizontal-stepper.entry.js +110 -0
  158. package/dist/esm/wcs-icon.entry.js +2 -2
  159. package/dist/esm/wcs-input.entry.js +224 -0
  160. package/dist/esm/wcs-label.entry.js +16 -0
  161. package/dist/esm/wcs-list-item-properties.entry.js +15 -0
  162. package/dist/esm/wcs-list-item-property.entry.js +15 -0
  163. package/dist/esm/wcs-list-item.entry.js +19 -0
  164. package/dist/esm/wcs-mat-icon.entry.js +69 -0
  165. package/dist/esm/wcs-modal.entry.js +41 -0
  166. package/dist/esm/wcs-nav-item.entry.js +19 -0
  167. package/dist/esm/wcs-nav.entry.js +15 -0
  168. package/dist/esm/wcs-progress-bar.entry.js +43 -0
  169. package/dist/esm/wcs-progress-radial.entry.js +26 -0
  170. package/dist/esm/wcs-radio-group.entry.js +61 -0
  171. package/dist/esm/wcs-radio.entry.js +45 -0
  172. package/dist/esm/wcs-select_2.entry.js +4911 -0
  173. package/dist/esm/wcs-spinner.entry.js +17 -0
  174. package/dist/esm/wcs-switch.entry.js +38 -0
  175. package/dist/esm/wcs-tab.entry.js +16 -0
  176. package/dist/esm/wcs-tabs.entry.js +155 -0
  177. package/dist/esm/wcs-textarea.entry.js +220 -0
  178. package/dist/esm/wcs-tooltip.entry.js +1631 -0
  179. package/dist/esm/wcs.js +3 -3
  180. package/dist/types/components/badge/badge-interface.d.ts +2 -0
  181. package/dist/types/components/badge/badge.d.ts +3 -2
  182. package/dist/types/components/button/button.d.ts +7 -3
  183. package/dist/types/components/card/card-interface.d.ts +1 -0
  184. package/dist/types/components/card/card.d.ts +2 -1
  185. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  186. package/dist/types/components/com-nav-category/com-nav-category.d.ts +7 -0
  187. package/dist/types/components/com-nav-submenu/com-nav-submenu.d.ts +7 -0
  188. package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
  189. package/dist/types/components/dropdown/dropdown.d.ts +13 -16
  190. package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
  191. package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
  192. package/dist/types/components/editable-field/editable-field-interface.d.ts +1 -0
  193. package/dist/types/components/editable-field/editable-field.d.ts +2 -2
  194. package/dist/types/components/form-field/form-field.d.ts +0 -4
  195. package/dist/types/components/grid/grid.d.ts +18 -0
  196. package/dist/types/components/grid-column/grid-column.d.ts +5 -0
  197. package/dist/types/components/grid-custom-cell/grid-custom-cell.d.ts +12 -0
  198. package/dist/types/components/horizontal-stepper/horizontal-stepper-interface.d.ts +1 -0
  199. package/dist/types/components/horizontal-stepper/horizontal-stepper.d.ts +2 -2
  200. package/dist/types/components/input/input.d.ts +8 -0
  201. package/dist/types/components/mat-icon/mat-icon-interface.d.ts +1 -0
  202. package/dist/types/components/mat-icon/mat-icon.d.ts +2 -2
  203. package/dist/types/components/modal/modal.d.ts +1 -1
  204. package/dist/types/components/radio/radio.component.d.ts +2 -1
  205. package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
  206. package/dist/types/components/radio-group/radio-group.d.ts +2 -2
  207. package/dist/types/components/select-option/select-option.d.ts +2 -0
  208. package/dist/types/components/spinner/spinner-interface.d.ts +1 -0
  209. package/dist/types/components/spinner/spinner.d.ts +2 -1
  210. package/dist/types/components/switch/switch-interface.d.ts +1 -0
  211. package/dist/types/components/switch/switch.d.ts +10 -2
  212. package/dist/types/components/tooltip/tooltip.d.ts +70 -6
  213. package/dist/types/components.d.ts +244 -41
  214. package/dist/types/interfaces.d.ts +21 -0
  215. package/dist/types/stencil-public-runtime.d.ts +183 -182
  216. package/dist/types/utils/helpers.d.ts +1 -0
  217. package/dist/wcs/p-03b2e238.entry.js +1 -0
  218. package/dist/wcs/p-08a7e84d.entry.js +1 -0
  219. package/dist/wcs/p-0a103e06.entry.js +1 -0
  220. package/dist/wcs/p-16dfbae8.js +127 -0
  221. package/dist/wcs/p-1dce7e63.entry.js +1 -0
  222. package/dist/wcs/p-1e16709a.entry.js +1 -0
  223. package/dist/wcs/p-1f5aed36.entry.js +1 -0
  224. package/dist/wcs/p-214236db.entry.js +1 -0
  225. package/dist/wcs/p-22813c8e.entry.js +1 -0
  226. package/dist/wcs/p-26b5c0a3.entry.js +1 -0
  227. package/dist/wcs/p-2e6265dc.entry.js +1 -0
  228. package/dist/wcs/p-384068f7.entry.js +1 -0
  229. package/dist/wcs/p-41037455.entry.js +1 -0
  230. package/dist/wcs/p-474d6601.entry.js +1 -0
  231. package/dist/wcs/p-4e9e226d.entry.js +1 -0
  232. package/dist/wcs/p-55fdc284.entry.js +1 -0
  233. package/dist/wcs/p-57247184.entry.js +1 -0
  234. package/dist/wcs/p-5b35b232.entry.js +1 -0
  235. package/dist/wcs/p-600a9cc0.entry.js +1 -0
  236. package/dist/wcs/p-60b51967.entry.js +1 -0
  237. package/dist/wcs/p-65c5ccc5.entry.js +1 -0
  238. package/dist/wcs/p-688fea65.entry.js +1 -0
  239. package/dist/wcs/p-6b8d2bc7.entry.js +1 -0
  240. package/dist/wcs/p-716d5921.entry.js +1 -0
  241. package/dist/wcs/p-7206e492.entry.js +1 -0
  242. package/dist/wcs/p-7219c04b.js +1 -0
  243. package/dist/wcs/p-8137f075.entry.js +1 -0
  244. package/dist/wcs/p-8864a491.entry.js +1 -0
  245. package/dist/wcs/p-8c8740e3.entry.js +1 -0
  246. package/dist/wcs/p-91a2de07.entry.js +1 -0
  247. package/dist/wcs/p-94a31f64.entry.js +1 -0
  248. package/dist/wcs/p-979dfd78.entry.js +1 -0
  249. package/dist/wcs/p-9ba52bc4.entry.js +1 -0
  250. package/dist/wcs/p-a1ee1551.entry.js +1 -0
  251. package/dist/wcs/p-a92d369e.entry.js +1 -0
  252. package/dist/wcs/p-a978c1e3.entry.js +1 -0
  253. package/dist/wcs/p-adef7aaf.js +1 -0
  254. package/dist/wcs/p-b5ffbea8.entry.js +1 -0
  255. package/dist/wcs/p-b7184d59.entry.js +1 -0
  256. package/dist/wcs/p-bbf1ef42.entry.js +1 -0
  257. package/dist/wcs/p-c7d6d3e1.entry.js +15 -0
  258. package/dist/wcs/p-cf4d7a83.js +1 -0
  259. package/dist/wcs/p-d3c9a644.js +1 -0
  260. package/dist/wcs/p-db68379f.entry.js +1 -0
  261. package/dist/wcs/p-dbbc3f58.entry.js +1 -0
  262. package/dist/wcs/p-dc817204.entry.js +1 -0
  263. package/dist/wcs/p-e0163de8.entry.js +1 -0
  264. package/dist/wcs/p-e4236d32.entry.js +1 -0
  265. package/dist/wcs/p-e43358e4.entry.js +1 -0
  266. package/dist/wcs/p-e9ce507c.entry.js +1 -0
  267. package/dist/wcs/p-ecbe5165.entry.js +6 -0
  268. package/dist/wcs/p-f46e6c3c.js +1 -0
  269. package/dist/wcs/p-f9944bde.entry.js +1 -0
  270. package/dist/wcs/p-fa173947.entry.js +1 -0
  271. package/dist/wcs/p-fb1577b5.entry.js +1 -0
  272. package/dist/wcs/p-febe9ccc.entry.js +1 -0
  273. package/dist/wcs/p-ff6d0dfd.entry.js +1 -0
  274. package/dist/wcs/wcs.css +1 -1
  275. package/dist/wcs/wcs.esm.js +1 -1
  276. package/loader/index.d.ts +0 -1
  277. package/package.json +25 -22
  278. package/dist/types/interface.d.ts +0 -3
  279. package/dist/wcs/p-16dca526.entry.js +0 -1
  280. package/dist/wcs/p-4f228fcb.entry.js +0 -134
  281. package/dist/wcs/p-66520e5a.entry.js +0 -1
  282. package/dist/wcs/p-d31287c6.entry.js +0 -1
  283. package/dist/wcs/p-f73f235b.js +0 -1
  284. package/schematics/.gitignore +0 -18
  285. package/schematics/.npmignore +0 -4
  286. package/schematics/collection.json +0 -9
  287. package/schematics/src/ng-add/files/fonts/avenir-black.woff +0 -0
  288. package/schematics/src/ng-add/files/fonts/avenir-book.woff +0 -0
  289. package/schematics/src/ng-add/files/fonts/avenir-lighter.woff +0 -0
  290. package/schematics/src/ng-add/files/fonts/avenir-medium.woff +0 -0
  291. package/schematics/src/ng-add/files/sncf-logo.png +0 -0
  292. package/schematics/src/ng-add/index.d.ts +0 -3
  293. package/schematics/src/ng-add/index.js +0 -119
  294. package/schematics/src/ng-add/index.js.map +0 -1
  295. package/schematics/src/ng-add/schema.json +0 -5
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  :host {
3
2
  display: block;
4
3
  }
@@ -9,7 +8,7 @@
9
8
  font-family: icons;
10
9
  padding-left: var(--wcs-base-margin);
11
10
  font-size: 0.6rem;
12
- content: "";
11
+ content: "\f107";
13
12
  line-height: 1;
14
13
  box-sizing: border-box;
15
14
  }
@@ -21,7 +20,7 @@
21
20
  }
22
21
  :host .label-container[data-open]:after {
23
22
  position: absolute;
24
- left: calc(calc(calc(100% / 2) + calc(var(--wcs-com-content-max-width) / 8)) - calc(1.125rem / 2));
23
+ left: calc(50% + var(--wcs-com-content-max-width) / 8 - 0.5625rem);
25
24
  z-index: 2;
26
25
  display: block;
27
26
  width: 1.125rem;
@@ -32,14 +31,14 @@
32
31
  }
33
32
  :host .item-container[data-open] {
34
33
  position: absolute;
35
- left: calc(calc(100% / 2) + calc(var(--wcs-com-content-max-width) / 8));
34
+ left: calc(50% + var(--wcs-com-content-max-width) / 8);
36
35
  top: 0;
37
36
  right: 0;
38
37
  padding: 50px 0 50px 50px;
39
38
  background-blend-mode: multiply;
40
39
  background-color: rgba(0, 0, 0, 0.15);
41
40
  box-sizing: border-box;
42
- height: calc(100%);
41
+ height: 100%;
43
42
  display: flex;
44
43
  flex-direction: column;
45
44
  align-items: start;
@@ -51,7 +50,7 @@
51
50
  font-family: icons;
52
51
  padding-left: var(--wcs-base-margin);
53
52
  font-size: 0.6rem;
54
- content: "";
53
+ content: "\f107";
55
54
  line-height: 1;
56
55
  box-sizing: border-box;
57
56
  }
@@ -32,11 +32,22 @@ export class ComNavCategory {
32
32
  evt.stopPropagation();
33
33
  this.wcsCategoryOpened.emit({ categoryElement: this.el });
34
34
  }
35
+ /**
36
+ * Close the category and fire item click if we detect a mouse click on a slotted `a` element.
37
+ * @param evt
38
+ * @private
39
+ */
40
+ handleItemClick(evt) {
41
+ if (evt.target.tagName === 'A') {
42
+ this.close();
43
+ this.wcsCategoryItemClicked.emit(evt);
44
+ }
45
+ }
35
46
  render() {
36
47
  return (h(Host, { onClick: evt => this.onClick(evt) },
37
48
  h("div", { class: "label-container", "data-open": this.categoryOpen, onClick: _ => this.categoryOpen = !this.categoryOpen },
38
49
  h("span", { class: "label" }, this.label)),
39
- h("div", { class: "item-container", "data-open": this.categoryOpen },
50
+ h("div", { class: "item-container", "data-open": this.categoryOpen, onClick: (evt) => this.handleItemClick(evt) },
40
51
  h("slot", null))));
41
52
  }
42
53
  static get is() { return "wcs-com-nav-category"; }
@@ -89,6 +100,25 @@ export class ComNavCategory {
89
100
  }
90
101
  }
91
102
  }
103
+ }, {
104
+ "method": "wcsCategoryItemClicked",
105
+ "name": "wcsCategoryItemClicked",
106
+ "bubbles": true,
107
+ "cancelable": true,
108
+ "composed": true,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": ""
112
+ },
113
+ "complexType": {
114
+ "original": "MouseEvent",
115
+ "resolved": "MouseEvent",
116
+ "references": {
117
+ "MouseEvent": {
118
+ "location": "global"
119
+ }
120
+ }
121
+ }
92
122
  }]; }
93
123
  static get methods() { return {
94
124
  "close": {
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  :host {
3
2
  display: block;
4
3
  height: 100%;
@@ -70,7 +69,7 @@
70
69
  font-family: icons;
71
70
  padding-left: var(--wcs-base-margin);
72
71
  font-size: 0.6rem;
73
- content: "";
72
+ content: "\f107";
74
73
  line-height: 1;
75
74
  box-sizing: border-box;
76
75
  }
@@ -36,6 +36,20 @@ export class ComNavSubmenu {
36
36
  evt.stopPropagation();
37
37
  this.wcsSubmenuOpened.emit({ menuElement: this.el });
38
38
  }
39
+ handleMenuItemsClick(evt) {
40
+ if (evt.target.tagName === 'A') {
41
+ this.close();
42
+ }
43
+ }
44
+ /**
45
+ * handle category item click to close the submenu
46
+ * @param _
47
+ * @private
48
+ */
49
+ wcsCategoryItemClickedHandler(_) {
50
+ // If a category item is clicked, we close the submenu drawer;
51
+ this.close();
52
+ }
39
53
  render() {
40
54
  return (h(Host, { onClick: evt => this.onClick(evt) },
41
55
  h("div", { onClick: _ => this.menuOpen = !this.menuOpen, class: "menu-button" },
@@ -48,7 +62,7 @@ export class ComNavSubmenu {
48
62
  h("div", null,
49
63
  h("h3", null, this.panelTitle),
50
64
  h("p", null, this.panelDescription)),
51
- h("div", { class: "menu-items" },
65
+ h("div", { class: "menu-items", onClick: (evt) => this.handleMenuItemsClick(evt) },
52
66
  h("slot", null)))))));
53
67
  }
54
68
  static get is() { return "wcs-com-nav-submenu"; }
@@ -183,5 +197,11 @@ export class ComNavSubmenu {
183
197
  "target": "window",
184
198
  "capture": false,
185
199
  "passive": false
200
+ }, {
201
+ "name": "wcsCategoryItemClicked",
202
+ "method": "wcsCategoryItemClickedHandler",
203
+ "target": undefined,
204
+ "capture": false,
205
+ "passive": false
186
206
  }]; }
187
207
  }
@@ -1,21 +1,23 @@
1
1
  :host {
2
- display: inline-flex;
3
- flex-direction: row;
4
- position: relative;
5
- flex-flow: row-reverse;
2
+ display: flex;
6
3
  }
7
4
 
8
5
  wcs-button {
9
6
  --wcs-button-padding: 8px 10px 8px 16px !important;
10
7
  }
11
8
 
12
- :host([shape=small]) .show {
13
- top: 48px !important;
9
+ :host([no-arrow]) wcs-button {
10
+ --wcs-button-padding: 8px 16px 8px 16px !important;
14
11
  }
12
+
15
13
  :host([shape=small]) wcs-button {
16
14
  --wcs-button-padding: 2px 10px 2px 16px !important;
17
15
  }
18
16
 
17
+ :host([shape=small][no-arrow]) wcs-button {
18
+ --wcs-button-padding: 2px 16px 2px 16px !important;
19
+ }
20
+
19
21
  .wcs-button-content-wrapper {
20
22
  display: flex;
21
23
  }
@@ -24,47 +26,53 @@ wcs-button {
24
26
  display: none;
25
27
  border: 1px solid #d7d7d7;
26
28
  border-radius: var(--wcs-border-radius);
27
- white-space: nowrap;
29
+ background-color: var(--wcs-white);
30
+ z-index: 9999;
31
+ }
32
+
33
+ .show {
34
+ display: block;
35
+ }
36
+
37
+ .container {
38
+ border-radius: inherit;
39
+ overflow: hidden;
40
+ padding: calc(var(--wcs-padding) / 2) 0;
41
+ background-color: var(--wcs-white);
28
42
  }
29
43
 
30
- .popover::before, .popover::after {
44
+ #arrow,
45
+ #arrow::before {
31
46
  position: absolute;
32
- width: 0;
33
- height: 0;
34
- pointer-events: none;
35
- content: " ";
36
- border: solid transparent;
37
- z-index: 1000;
47
+ width: 8px;
48
+ height: 8px;
49
+ background: inherit;
50
+ border: solid 1px #d7d7d7;
38
51
  }
39
52
 
40
- .popover::before {
41
- border-color: rgba(216, 216, 216, 0);
42
- border-width: 0.625rem;
43
- right: 1.0625rem;
44
- margin-left: -0.625rem;
45
- bottom: 100%;
46
- border-bottom-color: #d7d7d7;
53
+ #arrow {
54
+ visibility: hidden;
55
+ z-index: -1;
47
56
  }
48
57
 
49
- .popover::after {
50
- border-color: rgba(255, 255, 255, 0);
51
- border-width: 9px;
52
- right: 1.125rem;
53
- margin-left: -0.5625rem;
54
- bottom: 100%;
55
- border-bottom-color: #fff;
58
+ #arrow::before {
59
+ visibility: visible;
60
+ content: "";
61
+ transform: rotate(45deg);
56
62
  }
57
63
 
58
- .show {
59
- z-index: 1000;
60
- display: block;
61
- flex-direction: column;
62
- position: absolute;
63
- background-color: var(--wcs-white);
64
- top: 58px;
64
+ .popover[data-popper-placement^=top] > #arrow {
65
+ bottom: -5px;
65
66
  }
66
67
 
67
- .container {
68
- border-radius: inherit;
69
- overflow: hidden;
68
+ .popover[data-popper-placement^=bottom] > #arrow {
69
+ top: -6px;
70
+ }
71
+
72
+ .popover[data-popper-placement^=left] > #arrow {
73
+ right: -4px;
74
+ }
75
+
76
+ .popover[data-popper-placement^=right] > #arrow {
77
+ left: -6px;
70
78
  }
@@ -1,31 +1,41 @@
1
- import { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';
1
+ import { Component, Element, h, Host, Listen, Prop, State, Watch } from '@stencil/core';
2
2
  import { SelectArrow } from '../select/select-arrow';
3
- /**
4
- * Dropdown component.
5
- *
6
- * @example ```hmtl
7
- * <wcs-dropdown>
8
- * <div slot="placeholder"></div>
9
- * <div slot="items">
10
- * <wcs-dropdown-header></wcs-dropdown-header>
11
- * <wcs-divider></wcs-divider>
12
- * <wcs-dropdown-item></wcs-dropdown-item>
13
- * </div>
14
- * </wcs-dropdown>
15
- * ```
16
- * @todo Complete keyboard navigation.
17
- */
3
+ import { createPopper } from '@popperjs/core';
4
+ import { clickTargetIsElementOrChildren } from '../../utils/helpers';
18
5
  export class Dropdown {
19
6
  constructor() {
7
+ /** Hides the arrow in the button */
8
+ this.noArrow = false;
9
+ /** Dropdown's button mode */
20
10
  this.mode = 'stroked';
11
+ /** Dropdown's button shape */
21
12
  this.shape = 'normal';
13
+ /** Specifies whether the dropdown button is clickable or not */
22
14
  this.disabled = false;
15
+ /** placement of the dropdown's popover */
16
+ this.placement = 'bottom-end';
23
17
  this.expanded = false;
24
18
  }
19
+ placementChange() {
20
+ this.popper.setOptions(Object.assign(Object.assign({}, this.popper.state.options), { placement: this.placement })).then(_ => this.popper.update());
21
+ }
25
22
  componentDidLoad() {
26
- const buttonWrapper = this.el.shadowRoot.querySelector('wcs-button').shadowRoot.querySelector('button');
27
- const buttonTextColor = window.getComputedStyle(buttonWrapper).color;
28
- this.el.shadowRoot.querySelector('.arrow').style.fill = buttonTextColor;
23
+ const wcsButtonElement = this.el.shadowRoot.querySelector('wcs-button');
24
+ const buttonWrapper = wcsButtonElement.shadowRoot.querySelector('button');
25
+ this.buttonTextColor = window.getComputedStyle(buttonWrapper).color;
26
+ const popoverDiv = this.el.shadowRoot.querySelector('.popover');
27
+ this.popper = createPopper(wcsButtonElement, popoverDiv, {
28
+ placement: this.placement,
29
+ modifiers: [
30
+ {
31
+ name: 'offset',
32
+ options: {
33
+ offset: [0, 8]
34
+ }
35
+ }
36
+ ]
37
+ });
38
+ this.el.shadowRoot.querySelector('.arrow').style.fill = this.buttonTextColor;
29
39
  this.fixForFirefoxBelow63();
30
40
  }
31
41
  fixForFirefoxBelow63() {
@@ -39,14 +49,11 @@ export class Dropdown {
39
49
  });
40
50
  }
41
51
  }
42
- onButtonClick(e) {
43
- e.stopPropagation();
52
+ onButtonClick(_) {
44
53
  this.expanded = !this.expanded;
45
54
  }
46
55
  onWindowClickEvent(event) {
47
- // TODO: Extract to utils
48
- const clickedOnDropdownOrChildren = event.target instanceof Node
49
- && this.el.contains(event.target);
56
+ const clickedOnDropdownOrChildren = clickTargetIsElementOrChildren(event, this.el);
50
57
  if (this.expanded && !clickedOnDropdownOrChildren) {
51
58
  this.expanded = false;
52
59
  }
@@ -54,13 +61,22 @@ export class Dropdown {
54
61
  dropdownItemClick(_) {
55
62
  this.expanded = false;
56
63
  }
64
+ componentDidRender() {
65
+ if (this.popper) {
66
+ this.popper.update();
67
+ }
68
+ if (!this.noArrow) {
69
+ this.el.shadowRoot.querySelector('.arrow').style.fill = this.buttonTextColor;
70
+ }
71
+ }
57
72
  render() {
58
73
  return (h(Host, null,
59
- h("wcs-button", { mode: this.mode, shape: this.shape, onClick: ($event) => this.onButtonClick($event) },
74
+ h("wcs-button", { mode: this.mode, shape: this.shape, disabled: this.disabled, onClick: ($event) => this.onButtonClick($event) },
60
75
  h("div", { class: "wcs-button-content-wrapper" },
61
76
  h("slot", { name: "placeholder" }),
62
- h(SelectArrow, { up: this.expanded }))),
77
+ this.noArrow ? null : (h(SelectArrow, { up: this.expanded })))),
63
78
  h("div", { class: (this.expanded ? 'show ' : '') + 'popover' },
79
+ h("div", { id: "arrow", "data-popper-arrow": true }),
64
80
  h("div", { class: "container" },
65
81
  h("slot", { name: "item" })))));
66
82
  }
@@ -73,6 +89,24 @@ export class Dropdown {
73
89
  "$": ["dropdown.css"]
74
90
  }; }
75
91
  static get properties() { return {
92
+ "noArrow": {
93
+ "type": "boolean",
94
+ "mutable": false,
95
+ "complexType": {
96
+ "original": "boolean",
97
+ "resolved": "boolean",
98
+ "references": {}
99
+ },
100
+ "required": false,
101
+ "optional": false,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": "Hides the arrow in the button"
105
+ },
106
+ "attribute": "no-arrow",
107
+ "reflect": false,
108
+ "defaultValue": "false"
109
+ },
76
110
  "mode": {
77
111
  "type": "string",
78
112
  "mutable": false,
@@ -90,7 +124,7 @@ export class Dropdown {
90
124
  "optional": false,
91
125
  "docs": {
92
126
  "tags": [],
93
- "text": ""
127
+ "text": "Dropdown's button mode"
94
128
  },
95
129
  "attribute": "mode",
96
130
  "reflect": false,
@@ -113,7 +147,7 @@ export class Dropdown {
113
147
  "optional": false,
114
148
  "docs": {
115
149
  "tags": [],
116
- "text": ""
150
+ "text": "Dropdown's button shape"
117
151
  },
118
152
  "attribute": "shape",
119
153
  "reflect": false,
@@ -131,17 +165,44 @@ export class Dropdown {
131
165
  "optional": false,
132
166
  "docs": {
133
167
  "tags": [],
134
- "text": ""
168
+ "text": "Specifies whether the dropdown button is clickable or not"
135
169
  },
136
170
  "attribute": "disabled",
137
171
  "reflect": false,
138
172
  "defaultValue": "false"
173
+ },
174
+ "placement": {
175
+ "type": "string",
176
+ "mutable": false,
177
+ "complexType": {
178
+ "original": "WcsDropdownPlacement",
179
+ "resolved": "\"auto\" | \"auto-end\" | \"auto-start\" | \"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
180
+ "references": {
181
+ "WcsDropdownPlacement": {
182
+ "location": "import",
183
+ "path": "./dropdown-interface"
184
+ }
185
+ }
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": "placement of the dropdown's popover"
192
+ },
193
+ "attribute": "placement",
194
+ "reflect": false,
195
+ "defaultValue": "'bottom-end'"
139
196
  }
140
197
  }; }
141
198
  static get states() { return {
142
199
  "expanded": {}
143
200
  }; }
144
201
  static get elementRef() { return "el"; }
202
+ static get watchers() { return [{
203
+ "propName": "placement",
204
+ "methodName": "placementChange"
205
+ }]; }
145
206
  static get listeners() { return [{
146
207
  "name": "click",
147
208
  "method": "onWindowClickEvent",
@@ -0,0 +1,7 @@
1
+ :host {
2
+ display: block;
3
+ margin: var(--wcs-base-margin) calc(var(--wcs-base-margin) * 2);
4
+ overflow: hidden;
5
+ border-top: 1px solid var(--wcs-text-light);
6
+ width: calc(100% - var(--wcs-base-margin) * 4);
7
+ }
@@ -0,0 +1,14 @@
1
+ import { Component, h, Host } from '@stencil/core';
2
+ export class DropdownDivider {
3
+ render() {
4
+ return (h(Host, { slot: "item" }));
5
+ }
6
+ static get is() { return "wcs-dropdown-divider"; }
7
+ static get encapsulation() { return "shadow"; }
8
+ static get originalStyleUrls() { return {
9
+ "$": ["dropdown-divider.scss"]
10
+ }; }
11
+ static get styleUrls() { return {
12
+ "$": ["dropdown-divider.css"]
13
+ }; }
14
+ }
@@ -0,0 +1,8 @@
1
+ :host {
2
+ display: block;
3
+ padding: calc(var(--wcs-padding) / 2) var(--wcs-padding);
4
+ font-size: 0.75rem;
5
+ text-transform: uppercase;
6
+ color: var(--wcs-text-medium);
7
+ white-space: nowrap;
8
+ }
@@ -0,0 +1,15 @@
1
+ import { Component, h, Host } from '@stencil/core';
2
+ export class DropdownHeader {
3
+ render() {
4
+ return (h(Host, { slot: "item" },
5
+ h("slot", null)));
6
+ }
7
+ static get is() { return "wcs-dropdown-header"; }
8
+ static get encapsulation() { return "shadow"; }
9
+ static get originalStyleUrls() { return {
10
+ "$": ["dropdown-header.scss"]
11
+ }; }
12
+ static get styleUrls() { return {
13
+ "$": ["dropdown-header.css"]
14
+ }; }
15
+ }
@@ -233,9 +233,14 @@ export class EditableField {
233
233
  "type": "string",
234
234
  "mutable": false,
235
235
  "complexType": {
236
- "original": "'input' | 'textarea' | 'select'",
236
+ "original": "EditableFieldType",
237
237
  "resolved": "\"input\" | \"select\" | \"textarea\"",
238
- "references": {}
238
+ "references": {
239
+ "EditableFieldType": {
240
+ "location": "import",
241
+ "path": "./editable-field-interface"
242
+ }
243
+ }
239
244
  },
240
245
  "required": false,
241
246
  "optional": false,
@@ -5,7 +5,7 @@
5
5
  color: white;
6
6
  }
7
7
  :host .end {
8
- margin-top: calc(2*var(--wcs-base-margin));
8
+ margin-top: calc(2 * var(--wcs-base-margin));
9
9
  width: 100%;
10
10
  display: flex;
11
11
  justify-content: space-between;
@@ -1,8 +1,7 @@
1
1
  :host {
2
- --wcs-form-field-icon-color: var(--wcs-text-medium);
3
2
  --wcs-form-field-border-radius-left: var(--wcs-border-radius);
4
3
  --wcs-form-field-border-radius-right: var(--wcs-border-radius);
5
- display: inline-flex;
4
+ display: flex;
6
5
  flex-direction: column;
7
6
  }
8
7
 
@@ -143,23 +143,6 @@ export class FormField {
143
143
  "attribute": "is-error",
144
144
  "reflect": true,
145
145
  "defaultValue": "false"
146
- },
147
- "icon": {
148
- "type": "any",
149
- "mutable": false,
150
- "complexType": {
151
- "original": "any",
152
- "resolved": "any",
153
- "references": {}
154
- },
155
- "required": false,
156
- "optional": false,
157
- "docs": {
158
- "tags": [],
159
- "text": "Name of the material icon to add to the field"
160
- },
161
- "attribute": "icon",
162
- "reflect": false
163
146
  }
164
147
  }; }
165
148
  static get states() { return {