@roadtrip/components 3.17.0 → 3.18.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 (325) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/road-accordion.cjs.entry.js +1 -1
  3. package/dist/cjs/road-accordion.cjs.entry.js.map +1 -1
  4. package/dist/cjs/road-autocomplete.cjs.entry.js +1 -1
  5. package/dist/cjs/road-autocomplete.cjs.entry.js.map +1 -1
  6. package/dist/cjs/road-badge_14.cjs.entry.js +40 -8
  7. package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
  8. package/dist/cjs/road-banner.cjs.entry.js +1 -1
  9. package/dist/cjs/road-banner.cjs.entry.js.map +1 -1
  10. package/dist/cjs/road-button-floating.cjs.entry.js +1 -1
  11. package/dist/cjs/road-button-floating.cjs.entry.js.map +1 -1
  12. package/dist/cjs/road-card.cjs.entry.js +1 -1
  13. package/dist/cjs/road-card.cjs.entry.js.map +1 -1
  14. package/dist/cjs/road-carousel.cjs.entry.js +30 -118
  15. package/dist/cjs/road-carousel.cjs.entry.js.map +1 -1
  16. package/dist/cjs/road-chip.cjs.entry.js +2 -2
  17. package/dist/cjs/road-chip.cjs.entry.js.map +1 -1
  18. package/dist/cjs/road-collapse.cjs.entry.js +1 -1
  19. package/dist/cjs/road-collapse.cjs.entry.js.map +1 -1
  20. package/dist/cjs/road-dialog.cjs.entry.js +2 -2
  21. package/dist/cjs/road-dialog.cjs.entry.js.map +1 -1
  22. package/dist/cjs/road-dropdown.cjs.entry.js +4 -4
  23. package/dist/cjs/road-dropdown.cjs.entry.js.map +1 -1
  24. package/dist/cjs/road-global-navigation.cjs.entry.js +1 -1
  25. package/dist/cjs/road-global-navigation.cjs.entry.js.map +1 -1
  26. package/dist/cjs/road-illustration.cjs.entry.js +1 -1
  27. package/dist/cjs/road-illustration.cjs.entry.js.map +1 -1
  28. package/dist/cjs/road-modal.cjs.entry.js +1 -1
  29. package/dist/cjs/road-modal.cjs.entry.js.map +1 -1
  30. package/dist/cjs/road-navbar-item.cjs.entry.js +1 -1
  31. package/dist/cjs/road-navbar-item.cjs.entry.js.map +1 -1
  32. package/dist/cjs/road-navbar.cjs.entry.js +1 -1
  33. package/dist/cjs/road-navbar.cjs.entry.js.map +1 -1
  34. package/dist/cjs/road-phone-number-input.cjs.entry.js +41 -5
  35. package/dist/cjs/road-phone-number-input.cjs.entry.js.map +1 -1
  36. package/dist/cjs/road-plate-number.cjs.entry.js +2 -2
  37. package/dist/cjs/road-plate-number.cjs.entry.js.map +1 -1
  38. package/dist/cjs/road-profil-dropdown.cjs.entry.js +10 -1
  39. package/dist/cjs/road-profil-dropdown.cjs.entry.js.map +1 -1
  40. package/dist/cjs/road-progress-indicator-vertical.cjs.entry.js +2 -2
  41. package/dist/cjs/road-progress-indicator-vertical.cjs.entry.js.map +1 -1
  42. package/dist/cjs/road-progress-tracker.cjs.entry.js +2 -2
  43. package/dist/cjs/road-progress-tracker.cjs.entry.js.map +1 -1
  44. package/dist/cjs/road-progress.cjs.entry.js +1 -1
  45. package/dist/cjs/road-progress.cjs.entry.js.map +1 -1
  46. package/dist/cjs/road-range.cjs.entry.js +26 -2
  47. package/dist/cjs/road-range.cjs.entry.js.map +1 -1
  48. package/dist/cjs/road-segmented-button.cjs.entry.js +1 -1
  49. package/dist/cjs/road-segmented-button.cjs.entry.js.map +1 -1
  50. package/dist/cjs/road-select-filter.cjs.entry.js +34 -4
  51. package/dist/cjs/road-select-filter.cjs.entry.js.map +1 -1
  52. package/dist/cjs/road-select.cjs.entry.js +1 -1
  53. package/dist/cjs/road-select.cjs.entry.js.map +1 -1
  54. package/dist/cjs/road-textarea.cjs.entry.js +1 -1
  55. package/dist/cjs/road-textarea.cjs.entry.js.map +1 -1
  56. package/dist/cjs/road-tooltip.cjs.entry.js +1 -1
  57. package/dist/cjs/road-tooltip.cjs.entry.js.map +1 -1
  58. package/dist/cjs/roadtrip.cjs.js +1 -1
  59. package/dist/collection/components/accordion/accordion.css +4 -0
  60. package/dist/collection/components/accordion/accordion.stories.js +1 -1
  61. package/dist/collection/components/alert/alert.stories.js +1 -1
  62. package/dist/collection/components/autocomplete/autocomplete.js +1 -1
  63. package/dist/collection/components/autocomplete/autocomplete.js.map +1 -1
  64. package/dist/collection/components/autocomplete/autocomplete.stories.js +2 -2
  65. package/dist/collection/components/avatar/avatar.stories.js +1 -1
  66. package/dist/collection/components/badge/badge.stories.js +2 -2
  67. package/dist/collection/components/banner/banner.js +1 -1
  68. package/dist/collection/components/banner/banner.js.map +1 -1
  69. package/dist/collection/components/button/button.stories.js +6 -6
  70. package/dist/collection/components/button-floating/button-floating.css +0 -4
  71. package/dist/collection/components/button-floating/button-floating.stories.js +2 -2
  72. package/dist/collection/components/card/card.css +4 -0
  73. package/dist/collection/components/card/card.stories.js +4 -4
  74. package/dist/collection/components/carousel/carousel.css +4 -1
  75. package/dist/collection/components/carousel/carousel.js +93 -250
  76. package/dist/collection/components/carousel/carousel.js.map +1 -1
  77. package/dist/collection/components/chip/chip.css +2 -2
  78. package/dist/collection/components/chip/chip.js +1 -1
  79. package/dist/collection/components/chip/chip.js.map +1 -1
  80. package/dist/collection/components/chip/chip.stories.js +26 -1
  81. package/dist/collection/components/collapse/collapse.css +4 -0
  82. package/dist/collection/components/collapse/collapse.stories.js +8 -8
  83. package/dist/collection/components/counter/counter.css +5 -0
  84. package/dist/collection/components/counter/counter.js +19 -1
  85. package/dist/collection/components/counter/counter.js.map +1 -1
  86. package/dist/collection/components/dialog/dialog.js +2 -2
  87. package/dist/collection/components/dialog/dialog.js.map +1 -1
  88. package/dist/collection/components/drawer/drawer.js +1 -1
  89. package/dist/collection/components/drawer/drawer.js.map +1 -1
  90. package/dist/collection/components/drawer/drawer.stories.js +2 -2
  91. package/dist/collection/components/dropdown/dropdown.css +9 -4
  92. package/dist/collection/components/dropdown/dropdown.js +3 -3
  93. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  94. package/dist/collection/components/dropdown/dropdown.stories.js +4 -4
  95. package/dist/collection/components/global-navigation/global-navigation.js +1 -1
  96. package/dist/collection/components/global-navigation/global-navigation.js.map +1 -1
  97. package/dist/collection/components/global-navigation/global-navigation.stories.js +39 -39
  98. package/dist/collection/components/icon/icon.stories.js +44 -43
  99. package/dist/collection/components/illustration/illustration.js +1 -1
  100. package/dist/collection/components/illustration/illustration.js.map +1 -1
  101. package/dist/collection/components/input/input.css +8 -2
  102. package/dist/collection/components/input/input.js +16 -2
  103. package/dist/collection/components/input/input.js.map +1 -1
  104. package/dist/collection/components/input-group/input-group.js +1 -1
  105. package/dist/collection/components/input-group/input-group.js.map +1 -1
  106. package/dist/collection/components/input-group/input-group.stories.js +4 -4
  107. package/dist/collection/components/item/item.stories.js +9 -9
  108. package/dist/collection/components/list/list.stories.js +8 -8
  109. package/dist/collection/components/modal/modal.js +1 -1
  110. package/dist/collection/components/modal/modal.js.map +1 -1
  111. package/dist/collection/components/navbar/navbar.js +1 -1
  112. package/dist/collection/components/navbar/navbar.js.map +1 -1
  113. package/dist/collection/components/navbar/navbar.stories.js +84 -63
  114. package/dist/collection/components/navbar-item/navbar-item.js +1 -1
  115. package/dist/collection/components/navbar-item/navbar-item.js.map +1 -1
  116. package/dist/collection/components/patterns/link.stories.js +2 -2
  117. package/dist/collection/components/phone-number-input/phone-number-input.css +0 -1
  118. package/dist/collection/components/phone-number-input/phone-number-input.js +40 -4
  119. package/dist/collection/components/phone-number-input/phone-number-input.js.map +1 -1
  120. package/dist/collection/components/plate-number/plate-number.css +1 -1
  121. package/dist/collection/components/plate-number/plate-number.js +1 -1
  122. package/dist/collection/components/plate-number/plate-number.js.map +1 -1
  123. package/dist/collection/components/profil-dropdown/profil-dropdown.css +8 -0
  124. package/dist/collection/components/profil-dropdown/profil-dropdown.js +18 -0
  125. package/dist/collection/components/profil-dropdown/profil-dropdown.js.map +1 -1
  126. package/dist/collection/components/profil-dropdown/profil-dropdown.stories.js +4 -4
  127. package/dist/collection/components/progress/progress.js +1 -1
  128. package/dist/collection/components/progress/progress.js.map +1 -1
  129. package/dist/collection/components/progress-indicator-vertical/progress-indicator-vertical.css +5 -0
  130. package/dist/collection/components/progress-indicator-vertical/progress-indicator-vertical.js +1 -1
  131. package/dist/collection/components/progress-indicator-vertical/progress-indicator-vertical.js.map +1 -1
  132. package/dist/collection/components/progress-indicator-vertical/progress-indicator-vertical.stories.js +20 -20
  133. package/dist/collection/components/progress-tracker/progress-tracker.css +4 -0
  134. package/dist/collection/components/progress-tracker/progress-tracker.js +1 -1
  135. package/dist/collection/components/progress-tracker/progress-tracker.js.map +1 -1
  136. package/dist/collection/components/range/range.css +17 -2
  137. package/dist/collection/components/range/range.js +41 -2
  138. package/dist/collection/components/range/range.js.map +1 -1
  139. package/dist/collection/components/segmented-button/segmented-button.js +1 -1
  140. package/dist/collection/components/segmented-button/segmented-button.js.map +1 -1
  141. package/dist/collection/components/select/select.css +1 -1
  142. package/dist/collection/components/select-filter/select-filter.css +5 -0
  143. package/dist/collection/components/select-filter/select-filter.js +43 -9
  144. package/dist/collection/components/select-filter/select-filter.js.map +1 -1
  145. package/dist/collection/components/select-filter/select-filter.stories.js +8 -8
  146. package/dist/collection/components/tabs/tabs.stories.js +5 -5
  147. package/dist/collection/components/textarea/textarea.css +2 -2
  148. package/dist/collection/components/toolbar/toolbar.css +0 -2
  149. package/dist/collection/components/toolbar/toolbar.stories.js +8 -8
  150. package/dist/collection/components/tooltip/tooltip.js +1 -1
  151. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  152. package/dist/collection/components/tooltip/tooltip.stories.js +3 -3
  153. package/dist/esm/{index-891decf5.js → index-7a0158a4.js} +2 -2
  154. package/dist/esm/{index-891decf5.js.map → index-7a0158a4.js.map} +1 -1
  155. package/dist/esm/loader.js +1 -1
  156. package/dist/esm/road-accordion.entry.js +2 -2
  157. package/dist/esm/road-accordion.entry.js.map +1 -1
  158. package/dist/esm/road-autocomplete.entry.js +1 -1
  159. package/dist/esm/road-autocomplete.entry.js.map +1 -1
  160. package/dist/esm/road-badge_14.entry.js +41 -9
  161. package/dist/esm/road-badge_14.entry.js.map +1 -1
  162. package/dist/esm/road-banner.entry.js +2 -2
  163. package/dist/esm/road-banner.entry.js.map +1 -1
  164. package/dist/esm/road-button-floating.entry.js +1 -1
  165. package/dist/esm/road-button-floating.entry.js.map +1 -1
  166. package/dist/esm/road-card.entry.js +1 -1
  167. package/dist/esm/road-card.entry.js.map +1 -1
  168. package/dist/esm/road-carousel.entry.js +31 -119
  169. package/dist/esm/road-carousel.entry.js.map +1 -1
  170. package/dist/esm/road-checkbox.entry.js +1 -1
  171. package/dist/esm/road-chip.entry.js +3 -3
  172. package/dist/esm/road-chip.entry.js.map +1 -1
  173. package/dist/esm/road-collapse.entry.js +1 -1
  174. package/dist/esm/road-collapse.entry.js.map +1 -1
  175. package/dist/esm/road-dialog.entry.js +3 -3
  176. package/dist/esm/road-dialog.entry.js.map +1 -1
  177. package/dist/esm/road-dropdown.entry.js +4 -4
  178. package/dist/esm/road-dropdown.entry.js.map +1 -1
  179. package/dist/esm/road-global-navigation.entry.js +1 -1
  180. package/dist/esm/road-global-navigation.entry.js.map +1 -1
  181. package/dist/esm/road-illustration.entry.js +1 -1
  182. package/dist/esm/road-illustration.entry.js.map +1 -1
  183. package/dist/esm/road-modal.entry.js +2 -2
  184. package/dist/esm/road-modal.entry.js.map +1 -1
  185. package/dist/esm/road-navbar-item.entry.js +1 -1
  186. package/dist/esm/road-navbar-item.entry.js.map +1 -1
  187. package/dist/esm/road-navbar.entry.js +1 -1
  188. package/dist/esm/road-navbar.entry.js.map +1 -1
  189. package/dist/esm/road-phone-number-input.entry.js +41 -5
  190. package/dist/esm/road-phone-number-input.entry.js.map +1 -1
  191. package/dist/esm/road-plate-number.entry.js +3 -3
  192. package/dist/esm/road-plate-number.entry.js.map +1 -1
  193. package/dist/esm/road-profil-dropdown.entry.js +11 -2
  194. package/dist/esm/road-profil-dropdown.entry.js.map +1 -1
  195. package/dist/esm/road-progress-indicator-vertical.entry.js +2 -2
  196. package/dist/esm/road-progress-indicator-vertical.entry.js.map +1 -1
  197. package/dist/esm/road-progress-tracker.entry.js +2 -2
  198. package/dist/esm/road-progress-tracker.entry.js.map +1 -1
  199. package/dist/esm/road-progress.entry.js +1 -1
  200. package/dist/esm/road-progress.entry.js.map +1 -1
  201. package/dist/esm/road-range.entry.js +28 -4
  202. package/dist/esm/road-range.entry.js.map +1 -1
  203. package/dist/esm/road-rating.entry.js +1 -1
  204. package/dist/esm/road-segmented-button.entry.js +1 -1
  205. package/dist/esm/road-segmented-button.entry.js.map +1 -1
  206. package/dist/esm/road-select-filter.entry.js +34 -4
  207. package/dist/esm/road-select-filter.entry.js.map +1 -1
  208. package/dist/esm/road-select.entry.js +1 -1
  209. package/dist/esm/road-select.entry.js.map +1 -1
  210. package/dist/esm/road-textarea.entry.js +1 -1
  211. package/dist/esm/road-textarea.entry.js.map +1 -1
  212. package/dist/esm/road-toast.entry.js +1 -1
  213. package/dist/esm/road-tooltip.entry.js +1 -1
  214. package/dist/esm/road-tooltip.entry.js.map +1 -1
  215. package/dist/esm/roadtrip.js +1 -1
  216. package/dist/html.html-data.json +3 -3
  217. package/dist/roadtrip/p-054acf61.entry.js +2 -0
  218. package/dist/roadtrip/p-054acf61.entry.js.map +1 -0
  219. package/dist/roadtrip/{p-ea28a425.entry.js → p-08b0be1b.entry.js} +2 -2
  220. package/dist/roadtrip/p-08b0be1b.entry.js.map +1 -0
  221. package/dist/roadtrip/{p-1a761fc0.entry.js → p-0fd454dc.entry.js} +2 -2
  222. package/dist/roadtrip/p-0fd454dc.entry.js.map +1 -0
  223. package/dist/roadtrip/{p-60e25858.entry.js → p-14ecc91e.entry.js} +2 -2
  224. package/dist/roadtrip/{p-60e25858.entry.js.map → p-14ecc91e.entry.js.map} +1 -1
  225. package/dist/roadtrip/{p-82919e58.entry.js → p-16c934bc.entry.js} +2 -2
  226. package/dist/roadtrip/p-17ae87b0.entry.js +2 -0
  227. package/dist/roadtrip/p-17ae87b0.entry.js.map +1 -0
  228. package/dist/roadtrip/{p-6e3e0b40.entry.js → p-18967429.entry.js} +2 -2
  229. package/dist/roadtrip/{p-6e3e0b40.entry.js.map → p-18967429.entry.js.map} +1 -1
  230. package/dist/roadtrip/p-27d2770a.entry.js +2 -0
  231. package/dist/roadtrip/p-27d2770a.entry.js.map +1 -0
  232. package/dist/roadtrip/{p-4f47f4f7.entry.js → p-31cf9b61.entry.js} +2 -2
  233. package/dist/roadtrip/p-31cf9b61.entry.js.map +1 -0
  234. package/dist/roadtrip/{p-dcb280e3.entry.js → p-3bce3bdc.entry.js} +2 -2
  235. package/dist/roadtrip/p-3bce3bdc.entry.js.map +1 -0
  236. package/dist/roadtrip/p-4a2f2612.entry.js +2 -0
  237. package/dist/roadtrip/p-4a2f2612.entry.js.map +1 -0
  238. package/dist/roadtrip/p-5203acea.entry.js +2 -0
  239. package/dist/roadtrip/p-5203acea.entry.js.map +1 -0
  240. package/dist/roadtrip/{p-a73ef7de.entry.js → p-61d87e64.entry.js} +2 -2
  241. package/dist/roadtrip/{p-a73ef7de.entry.js.map → p-61d87e64.entry.js.map} +1 -1
  242. package/dist/roadtrip/p-6ad5091d.entry.js +2 -0
  243. package/dist/roadtrip/p-6ad5091d.entry.js.map +1 -0
  244. package/dist/roadtrip/{p-2c132382.entry.js → p-72b3b34a.entry.js} +2 -2
  245. package/dist/roadtrip/p-72b3b34a.entry.js.map +1 -0
  246. package/dist/roadtrip/p-7a14e5b7.entry.js +2 -0
  247. package/dist/roadtrip/p-7a14e5b7.entry.js.map +1 -0
  248. package/dist/roadtrip/{p-c3c92152.entry.js → p-7f1d9286.entry.js} +2 -2
  249. package/dist/roadtrip/p-7f1d9286.entry.js.map +1 -0
  250. package/dist/roadtrip/p-9a929988.entry.js +2 -0
  251. package/dist/roadtrip/p-9a929988.entry.js.map +1 -0
  252. package/dist/roadtrip/{p-336aa5f6.entry.js → p-9ff79904.entry.js} +2 -2
  253. package/dist/roadtrip/{p-336aa5f6.entry.js.map → p-9ff79904.entry.js.map} +1 -1
  254. package/dist/roadtrip/p-a5eee655.entry.js +2 -0
  255. package/dist/roadtrip/{p-40daa53b.entry.js.map → p-a5eee655.entry.js.map} +1 -1
  256. package/dist/roadtrip/{p-73fe2357.js → p-ac7a8bca.js} +2 -2
  257. package/dist/roadtrip/{p-6177bb46.entry.js → p-b510e552.entry.js} +2 -2
  258. package/dist/roadtrip/{p-6177bb46.entry.js.map → p-b510e552.entry.js.map} +1 -1
  259. package/dist/roadtrip/{p-46cccafc.entry.js → p-c096723c.entry.js} +2 -2
  260. package/dist/roadtrip/{p-46cccafc.entry.js.map → p-c096723c.entry.js.map} +1 -1
  261. package/dist/roadtrip/p-c7866ae4.entry.js +2 -0
  262. package/dist/roadtrip/p-c7866ae4.entry.js.map +1 -0
  263. package/dist/roadtrip/p-cdefa79c.entry.js +2 -0
  264. package/dist/roadtrip/p-cdefa79c.entry.js.map +1 -0
  265. package/dist/roadtrip/{p-cbc00bfb.entry.js → p-cfc0a3a7.entry.js} +2 -2
  266. package/dist/roadtrip/p-dcbaee2f.entry.js +2 -0
  267. package/dist/roadtrip/p-dcbaee2f.entry.js.map +1 -0
  268. package/dist/roadtrip/{p-7048f786.entry.js → p-dcbb0d20.entry.js} +2 -2
  269. package/dist/roadtrip/p-dcbb0d20.entry.js.map +1 -0
  270. package/dist/roadtrip/{p-414a2791.entry.js → p-e8c9c816.entry.js} +2 -2
  271. package/dist/roadtrip/{p-f5cce766.entry.js → p-ebd19369.entry.js} +2 -2
  272. package/dist/roadtrip/{p-f5cce766.entry.js.map → p-ebd19369.entry.js.map} +1 -1
  273. package/dist/roadtrip/p-f7b4f1fa.entry.js +2 -0
  274. package/dist/roadtrip/p-f7b4f1fa.entry.js.map +1 -0
  275. package/dist/roadtrip/p-f90af0e1.entry.js +2 -0
  276. package/dist/roadtrip/p-f90af0e1.entry.js.map +1 -0
  277. package/dist/roadtrip/roadtrip.esm.js +1 -1
  278. package/dist/roadtrip/roadtrip.esm.js.map +1 -1
  279. package/dist/types/components/carousel/carousel.d.ts +1 -131
  280. package/dist/types/components/counter/counter.d.ts +1 -0
  281. package/dist/types/components/phone-number-input/phone-number-input.d.ts +1 -0
  282. package/dist/types/components/profil-dropdown/profil-dropdown.d.ts +2 -0
  283. package/dist/types/components/range/range.d.ts +3 -0
  284. package/dist/types/components/select-filter/select-filter.d.ts +16 -4
  285. package/dist/types/components.d.ts +4 -128
  286. package/hydrate/index.js +216 -175
  287. package/package.json +1 -1
  288. package/dist/roadtrip/p-1a761fc0.entry.js.map +0 -1
  289. package/dist/roadtrip/p-2b5974fc.entry.js +0 -2
  290. package/dist/roadtrip/p-2b5974fc.entry.js.map +0 -1
  291. package/dist/roadtrip/p-2c132382.entry.js.map +0 -1
  292. package/dist/roadtrip/p-2c8a6854.entry.js +0 -2
  293. package/dist/roadtrip/p-2c8a6854.entry.js.map +0 -1
  294. package/dist/roadtrip/p-2e25c08d.entry.js +0 -2
  295. package/dist/roadtrip/p-2e25c08d.entry.js.map +0 -1
  296. package/dist/roadtrip/p-33002e9d.entry.js +0 -2
  297. package/dist/roadtrip/p-33002e9d.entry.js.map +0 -1
  298. package/dist/roadtrip/p-372fcb4d.entry.js +0 -2
  299. package/dist/roadtrip/p-372fcb4d.entry.js.map +0 -1
  300. package/dist/roadtrip/p-40daa53b.entry.js +0 -2
  301. package/dist/roadtrip/p-4f47f4f7.entry.js.map +0 -1
  302. package/dist/roadtrip/p-5053b01a.entry.js +0 -2
  303. package/dist/roadtrip/p-5053b01a.entry.js.map +0 -1
  304. package/dist/roadtrip/p-7048f786.entry.js.map +0 -1
  305. package/dist/roadtrip/p-9bef58e1.entry.js +0 -2
  306. package/dist/roadtrip/p-9bef58e1.entry.js.map +0 -1
  307. package/dist/roadtrip/p-a44a569a.entry.js +0 -2
  308. package/dist/roadtrip/p-a44a569a.entry.js.map +0 -1
  309. package/dist/roadtrip/p-acbc0a14.entry.js +0 -2
  310. package/dist/roadtrip/p-acbc0a14.entry.js.map +0 -1
  311. package/dist/roadtrip/p-b2e7bfcb.entry.js +0 -2
  312. package/dist/roadtrip/p-b2e7bfcb.entry.js.map +0 -1
  313. package/dist/roadtrip/p-c3c92152.entry.js.map +0 -1
  314. package/dist/roadtrip/p-dcb280e3.entry.js.map +0 -1
  315. package/dist/roadtrip/p-e2149bdf.entry.js +0 -2
  316. package/dist/roadtrip/p-e2149bdf.entry.js.map +0 -1
  317. package/dist/roadtrip/p-ea28a425.entry.js.map +0 -1
  318. package/dist/roadtrip/p-ee7aaee5.entry.js +0 -2
  319. package/dist/roadtrip/p-ee7aaee5.entry.js.map +0 -1
  320. package/dist/roadtrip/p-faba450c.entry.js +0 -2
  321. package/dist/roadtrip/p-faba450c.entry.js.map +0 -1
  322. /package/dist/roadtrip/{p-82919e58.entry.js.map → p-16c934bc.entry.js.map} +0 -0
  323. /package/dist/roadtrip/{p-73fe2357.js.map → p-ac7a8bca.js.map} +0 -0
  324. /package/dist/roadtrip/{p-cbc00bfb.entry.js.map → p-cfc0a3a7.entry.js.map} +0 -0
  325. /package/dist/roadtrip/{p-414a2791.entry.js.map → p-e8c9c816.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/components/carousel/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,MAAM,EAAE,EAAgB,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAC,MAAM,QAAQ,CAAA;AAE7F,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,MAAM,aAAa,GAAG,CAAC,EAAe,EAAE,EAAE;EACxC,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CACrF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from '@stencil/core';\nimport { navigationChevron } from '../../../icons';\nimport Swiper, {SwiperOptions, Autoplay, Pagination, Scrollbar, Keyboard, Zoom} from \"swiper\"\n\nSwiper.use([Pagination, Scrollbar, Autoplay, Keyboard, Zoom]);\n\n/**\n * @slot - content of the carousel, it should be road-carousel-item elements.\n */\n\n@Component({\n tag: 'road-carousel',\n styleUrl: 'carousel.css',\n shadow: true,\n})\nexport class Carousel {\n private paginationEl?: HTMLElement;\n private swiperReady = false;\n private mutationO?: MutationObserver;\n private readySwiper!: (swiper: Swiper) => void;\n private swiper: Promise<Swiper> = new Promise(resolve => {\n this.readySwiper = resolve;\n });\n private syncSwiper?: Swiper;\n private didInit = false;\n\n @Element() el!: HTMLRoadCarouselElement;\n\n /**\n * Options to pass to the swiper instance.\n * See http://idangero.us/swiper/api/ for valid options\n */\n @Prop() options: any = {}; // SwiperOptions; // TODO\n\n @Watch('options')\n async optionsChanged() {\n if (this.swiperReady) {\n const swiper = await this.getSwiper();\n Object.assign(swiper.params, this.options);\n await this.update();\n }\n }\n\n /**\n * If `true`, show the pagination.\n */\n @Prop() pager = true;\n\n /**\n * If `true`, show arrows.\n */\n @Prop() arrows = false;\n\n /**\n * Emitted after Swiper initialization\n */\n @Event() roadslidesdidload!: EventEmitter<void>;\n\n /**\n * Emitted when the user taps/clicks on the slide's container.\n */\n @Event() roadslidetap!: EventEmitter<void>;\n\n /**\n * Emitted when the user double taps on the slide's container.\n */\n @Event() roadslidedoubletap!: EventEmitter<void>;\n\n /**\n * Emitted before the active slide has changed.\n */\n @Event() roadslidewillchange!: EventEmitter<void>;\n\n /**\n * Emitted after the active slide has changed.\n */\n @Event() roadslidedidchange!: EventEmitter<void>;\n\n /**\n * Emitted when the next slide has started.\n */\n @Event() roadslidenextstart!: EventEmitter<void>;\n\n /**\n * Emitted when the previous slide has started.\n */\n @Event() roadslideprevstart!: EventEmitter<void>;\n\n /**\n * Emitted when the next slide has ended.\n */\n @Event() roadslidenextend!: EventEmitter<void>;\n\n /**\n * Emitted when the previous slide has ended.\n */\n @Event() roadslideprevend!: EventEmitter<void>;\n\n /**\n * Emitted when the slide transition has started.\n */\n @Event() roadslidetransitionstart!: EventEmitter<void>;\n\n /**\n * Emitted when the slide transition has ended.\n */\n @Event() roadslidetransitionend!: EventEmitter<void>;\n\n /**\n * Emitted when the slider is actively being moved.\n */\n @Event() roadslidedrag!: EventEmitter<void>;\n\n /**\n * Emitted when the slider is at its initial position.\n */\n @Event() roadslidereachstart!: EventEmitter<void>;\n\n /**\n * Emitted when the slider is at the last slide.\n */\n @Event() roadslidereachend!: EventEmitter<void>;\n\n /**\n * Emitted when the user first touches the slider.\n */\n @Event() roadslidetouchstart!: EventEmitter<void>;\n\n /**\n * Emitted when the user releases the touch.\n */\n @Event() roadslidetouchend!: EventEmitter<void>;\n\n connectedCallback() {\n // tslint:disable-next-line: strict-type-predicates\n if (typeof MutationObserver !== 'undefined') {\n const mut = this.mutationO = new MutationObserver(() => {\n if (this.swiperReady) {\n this.update();\n }\n });\n mut.observe(this.el, {\n childList: true,\n subtree: true,\n });\n }\n }\n\n componentDidLoad(){\n if (!this.didInit) {\n this.didInit = true;\n this.initSwiper();\n }\n }\n\n disconnectedCallback() {\n if (this.mutationO) {\n this.mutationO.disconnect();\n this.mutationO = undefined;\n }\n\n /**\n * We need to synchronously destroy\n * swiper otherwise it is possible\n * that it will be left in a\n * destroyed state if connectedCallback\n * is called multiple times\n */\n const swiper = this.syncSwiper;\n if (swiper !== undefined) {\n swiper.destroy(true, true);\n this.swiper = new Promise(resolve => {\n this.readySwiper = resolve;\n });\n this.swiperReady = false;\n this.syncSwiper = undefined;\n }\n\n this.didInit = false;\n }\n\n /**\n * Update the underlying slider implementation. Call this if you've added or removed\n * child slides.\n */\n @Method()\n async update() {\n const [swiper] = await Promise.all([\n this.getSwiper(),\n waitForSlides(this.el)\n ]);\n swiper.update();\n }\n\n /**\n * Force swiper to update its height (when autoHeight is enabled) for the duration\n * equal to 'speed' parameter.\n *\n * @param speed The transition duration (in ms).\n */\n @Method()\n async updateAutoHeight(speed?: number) {\n const swiper = await this.getSwiper();\n swiper.updateAutoHeight(speed);\n }\n\n /**\n * Transition to the specified slide.\n *\n * @param index The index of the slide to transition to.\n * @param speed The transition duration (in ms).\n * @param runCallbacks If true, the transition will produce [Transition/SlideChange][Start/End] transition events.\n */\n @Method()\n async slideTo(index: number, speed?: number, runCallbacks?: boolean) {\n const swiper = await this.getSwiper();\n swiper.slideTo(index, speed, runCallbacks);\n }\n\n /**\n * Transition to the next slide.\n *\n * @param speed The transition duration (in ms).\n * @param runCallbacks If true, the transition will produce [Transition/SlideChange][Start/End] transition events.\n */\n @Method()\n async slideNext(speed?: number, runCallbacks?: boolean) {\n const swiper = await this.getSwiper();\n swiper.slideNext(speed!, runCallbacks!);\n }\n\n /**\n * Transition to the previous slide.\n *\n * @param speed The transition duration (in ms).\n * @param runCallbacks If true, the transition will produce the [Transition/SlideChange][Start/End] transition events.\n */\n @Method()\n async slidePrev(speed?: number, runCallbacks?: boolean) {\n const swiper = await this.getSwiper();\n swiper.slidePrev(speed, runCallbacks);\n }\n\n /**\n * Get the index of the active slide.\n */\n @Method()\n async getActiveIndex(): Promise<number> {\n const swiper = await this.getSwiper();\n return swiper.activeIndex;\n }\n\n /**\n * Get the index of the previous slide.\n */\n @Method()\n async getPreviousIndex(): Promise<number> {\n const swiper = await this.getSwiper();\n return swiper.previousIndex;\n }\n\n /**\n * Get the total number of slides.\n */\n @Method()\n async length(): Promise<number> {\n const swiper = await this.getSwiper();\n return swiper.slides.length;\n }\n\n /**\n * Get whether or not the current slide is the last slide.\n */\n @Method()\n async isEnd(): Promise<boolean> {\n const swiper = await this.getSwiper();\n return swiper.isEnd;\n }\n\n /**\n * Get whether or not the current slide is the first slide.\n */\n @Method()\n async isBeginning(): Promise<boolean> {\n const swiper = await this.getSwiper();\n return swiper.isBeginning;\n }\n\n /**\n * Start auto play.\n */\n @Method()\n async startAutoplay() {\n const swiper = await this.getSwiper();\n if (swiper.autoplay) {\n swiper.autoplay.start();\n }\n }\n\n /**\n * Stop auto play.\n */\n @Method()\n async stopAutoplay() {\n const swiper = await this.getSwiper();\n if (swiper.autoplay) {\n swiper.autoplay.stop();\n }\n }\n\n /**\n * Lock or unlock the ability to slide to the next slide.\n *\n * @param lock If `true`, disable swiping to the next slide.\n */\n @Method()\n async lockSwipeToNext(lock: boolean) {\n const swiper = await this.getSwiper();\n swiper.allowSlideNext = !lock;\n }\n\n /**\n * Lock or unlock the ability to slide to the previous slide.\n *\n * @param lock If `true`, disable swiping to the previous slide.\n */\n @Method()\n async lockSwipeToPrev(lock: boolean) {\n const swiper = await this.getSwiper();\n swiper.allowSlidePrev = !lock;\n }\n\n /**\n * Lock or unlock the ability to slide to the next or previous slide.\n *\n * @param lock If `true`, disable swiping to the next and previous slide.\n */\n @Method()\n async lockSwipes(lock: boolean) {\n const swiper = await this.getSwiper();\n swiper.allowSlideNext = !lock;\n swiper.allowSlidePrev = !lock;\n swiper.allowTouchMove = !lock;\n }\n\n /**\n * Get the Swiper instance.\n * Use this to access the full Swiper API.\n * See https://idangero.us/swiper/api/ for all API options.\n */\n @Method()\n async getSwiper(): Promise<any> {\n return this.swiper;\n }\n\n private async initSwiper() {\n const finalOptions = this.normalizeOptions();\n\n // init swiper core\n await waitForSlides(this.el);\n // @ts-ignore\n const swiper = new Swiper(this.el, finalOptions);\n this.swiperReady = true;\n this.syncSwiper = swiper;\n this.readySwiper(swiper);\n }\n\n private normalizeOptions(): SwiperOptions {\n // Base options, can be changed\n // TODO Add interface SwiperOptions\n const swiperOptions: SwiperOptions = {\n effect: undefined,\n direction: 'horizontal',\n initialSlide: 0,\n loop: false,\n parallax: false,\n slidesPerView: 1,\n spaceBetween: 0,\n speed: 300,\n grid: {\n rows: 1,\n fill: 'column',\n },\n slidesPerGroup: 1,\n centeredSlides: false,\n slidesOffsetBefore: 0,\n slidesOffsetAfter: 0,\n touchEventsTarget: 'container',\n autoplay: false,\n freeMode: {\n enabled: false,\n momentum: true,\n momentumRatio: 1,\n momentumBounce: true,\n momentumBounceRatio: 1,\n momentumVelocityRatio: 1,\n sticky: false,\n minimumVelocity: 0.02,\n },\n autoHeight: false,\n setWrapperSize: false,\n zoom: {\n maxRatio: 3,\n minRatio: 1,\n toggle: false,\n },\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n touchStartPreventDefault: false,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n threshold: 0,\n touchMoveStopPropagation: true,\n touchReleaseOnEdges: false,\n resistance: true,\n resistanceRatio: 0.85,\n watchSlidesProgress: false,\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n loopAdditionalSlides: 0,\n noSwiping: true,\n runCallbacksOnInit: true,\n coverflowEffect: {\n rotate: 50,\n stretch: 0,\n depth: 100,\n modifier: 1,\n slideShadows: true,\n },\n flipEffect: {\n slideShadows: true,\n limitRotation: true,\n },\n cubeEffect: {\n slideShadows: true,\n shadow: true,\n shadowOffset: 20,\n shadowScale: 0.94,\n },\n fadeEffect: {\n crossFade: false,\n },\n a11y: {\n prevSlideMessage: 'Previous slide',\n nextSlideMessage: 'Next slide',\n firstSlideMessage: 'This is the first slide',\n lastSlideMessage: 'This is the last slide',\n },\n };\n\n if (this.pager) {\n swiperOptions.pagination = {\n el: this.paginationEl!,\n type: 'bullets',\n clickable: true,\n hideOnClick: false,\n };\n }\n\n // Keep the event options separate, we dont want users\n // overwriting these\n const eventOptions: SwiperOptions = {\n on: {\n init: () => {\n setTimeout(() => {\n this.roadslidesdidload.emit();\n }, 20);\n },\n // @ts-ignore\n slideChangeTransitionStart: this.roadslidewillchange.emit,\n // @ts-ignore\n slideChangeTransitionEnd: this.roadslidedidchange.emit,\n // @ts-ignore\n slideNextTransitionStart: this.roadslidenextstart.emit,\n // @ts-ignore\n slidePrevTransitionStart: this.roadslideprevstart.emit,\n // @ts-ignore\n slideNextTransitionEnd: this.roadslidenextend.emit,\n // @ts-ignore\n slidePrevTransitionEnd: this.roadslideprevend.emit,\n // @ts-ignore\n transitionStart: this.roadslidetransitionstart.emit,\n // @ts-ignore\n transitionEnd: this.roadslidetransitionend.emit,\n // @ts-ignore\n sliderMove: this.roadslidedrag.emit,\n // @ts-ignore\n reachBeginning: this.roadslidereachstart.emit,\n // @ts-ignore\n reachEnd: this.roadslidereachend.emit,\n // @ts-ignore\n touchStart: this.roadslidetouchstart.emit,\n // @ts-ignore\n touchEnd: this.roadslidetouchend.emit,\n // @ts-ignore\n tap: this.roadslidetap.emit,\n // @ts-ignore\n doubleTap: this.roadslidedoubletap.emit,\n },\n };\n\n const customEvents = (!!this.options && !!this.options.on) ? this.options.on : {};\n\n // merge \"on\" event listeners, while giving our event listeners priority\n const mergedEventOptions = { on: { ...customEvents, ...eventOptions.on } };\n\n // Merge the base, user options, and events together then pas to swiper\n return { ...swiperOptions, ...this.options, ...mergedEventOptions };\n }\n\n render() {\n return (\n <Host class=\"swiper-container\">\n <div class=\"swiper-wrapper\">\n <slot/>\n </div>\n {this.pager && <div class=\"swiper-pagination\" ref={el => this.paginationEl = el}></div>}\n {this.arrows && (\n <div class=\"swiper-button-prev\" onClick={() => this.el.slidePrev()}>\n <road-icon icon={navigationChevron} rotate=\"180\"></road-icon>\n </div>\n )}\n {this.arrows && (\n <div class=\"swiper-button-next\" onClick={() => this.el.slideNext()}>\n <road-icon icon={navigationChevron}></road-icon>\n </div>\n )}\n </Host>\n );\n }\n}\n\nconst waitForSlides = (el: HTMLElement) => {\n return Promise.all(\n Array.from(el.querySelectorAll('road-carousel-item')).map(s => s.componentOnReady())\n );\n};\n"]}
1
+ {"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/components/carousel/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,MAAM,EAAE,EAAiB,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE/F,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AAO9D,MAAM,OAAO,QAAQ;;IAEX,gBAAW,GAAG,KAAK,CAAC;IAGpB,WAAM,GAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;MACtD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEK,YAAO,GAAG,KAAK,CAAC;mBAID,EAAE;iBAWT,IAAI;kBACH,KAAK;;EATtB,KAAK,CAAC,cAAc;IAClB,IAAI,IAAI,CAAC,WAAW,EAAE;MACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;MACtC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAA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;AAED,MAAM,aAAa,GAAG,CAAC,EAAe,EAAE,EAAE;EACxC,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CACrF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from '@stencil/core';\nimport { navigationChevron } from '../../../icons';\nimport Swiper, { SwiperOptions, Autoplay, Pagination, Scrollbar, Keyboard, Zoom } from \"swiper\"\n\nSwiper.use([Pagination, Scrollbar, Autoplay, Keyboard, Zoom]);\n\n@Component({\n tag: 'road-carousel',\n styleUrl: 'carousel.css',\n shadow: true,\n})\nexport class Carousel {\n private paginationEl?: HTMLElement;\n private swiperReady = false;\n private mutationO?: MutationObserver;\n private readySwiper!: (swiper: Swiper) => void;\n private swiper: Promise<Swiper> = new Promise(resolve => {\n this.readySwiper = resolve;\n });\n private syncSwiper?: Swiper;\n private didInit = false;\n\n @Element() el!: HTMLRoadCarouselElement;\n\n @Prop() options: any = {};\n\n @Watch('options')\n async optionsChanged() {\n if (this.swiperReady) {\n const swiper = await this.getSwiper();\n Object.assign(swiper.params, this.options);\n await this.update();\n }\n }\n\n @Prop() pager = true;\n @Prop() arrows = false;\n\n @Event() roadslidesdidload!: EventEmitter<void>;\n @Event() roadslidetap!: EventEmitter<void>;\n @Event() roadslidedoubletap!: EventEmitter<void>;\n @Event() roadslidewillchange!: EventEmitter<void>;\n @Event() roadslidedidchange!: EventEmitter<void>;\n @Event() roadslidenextstart!: EventEmitter<void>;\n @Event() roadslideprevstart!: EventEmitter<void>;\n @Event() roadslidenextend!: EventEmitter<void>;\n @Event() roadslideprevend!: EventEmitter<void>;\n @Event() roadslidetransitionstart!: EventEmitter<void>;\n @Event() roadslidetransitionend!: EventEmitter<void>;\n @Event() roadslidedrag!: EventEmitter<void>;\n @Event() roadslidereachstart!: EventEmitter<void>;\n @Event() roadslidereachend!: EventEmitter<void>;\n @Event() roadslidetouchstart!: EventEmitter<void>;\n @Event() roadslidetouchend!: EventEmitter<void>;\n\n connectedCallback() {\n if (typeof MutationObserver !== 'undefined') {\n const mut = this.mutationO = new MutationObserver(() => {\n if (this.swiperReady) {\n this.update();\n }\n });\n mut.observe(this.el, {\n childList: true,\n subtree: true,\n });\n }\n }\n\n componentDidLoad() {\n if (!this.didInit) {\n this.didInit = true;\n this.initSwiper();\n }\n this.setupKeyboardNavigation();\n }\n\n disconnectedCallback() {\n if (this.mutationO) {\n this.mutationO.disconnect();\n this.mutationO = undefined;\n }\n\n const swiper = this.syncSwiper;\n if (swiper !== undefined) {\n swiper.destroy(true, true);\n this.swiper = new Promise(resolve => {\n this.readySwiper = resolve;\n });\n this.swiperReady = false;\n this.syncSwiper = undefined;\n }\n\n this.didInit = false;\n }\n\n @Method()\n async update() {\n const [swiper] = await Promise.all([\n this.getSwiper(),\n waitForSlides(this.el)\n ]);\n swiper.update();\n }\n\n @Method()\n async updateAutoHeight(speed?: number) {\n const swiper = await this.getSwiper();\n swiper.updateAutoHeight(speed);\n }\n\n @Method()\n async slideTo(index: number, speed?: number, runCallbacks?: boolean) {\n const swiper = await this.getSwiper();\n swiper.slideTo(index, speed, runCallbacks);\n }\n\n @Method()\n async slideNext(speed?: number, runCallbacks?: boolean) {\n const swiper = await this.getSwiper();\n swiper.slideNext(speed!, runCallbacks!);\n }\n\n @Method()\n async slidePrev(speed?: number, runCallbacks?: boolean) {\n const swiper = await this.getSwiper();\n swiper.slidePrev(speed, runCallbacks);\n }\n\n @Method()\n async getActiveIndex(): Promise<number> {\n const swiper = await this.getSwiper();\n return swiper.activeIndex;\n }\n\n @Method()\n async getPreviousIndex(): Promise<number> {\n const swiper = await this.getSwiper();\n return swiper.previousIndex;\n }\n\n @Method()\n async length(): Promise<number> {\n const swiper = await this.getSwiper();\n return swiper.slides.length;\n }\n\n @Method()\n async isEnd(): Promise<boolean> {\n const swiper = await this.getSwiper();\n return swiper.isEnd;\n }\n\n @Method()\n async isBeginning(): Promise<boolean> {\n const swiper = await this.getSwiper();\n return swiper.isBeginning;\n }\n\n @Method()\n async startAutoplay() {\n const swiper = await this.getSwiper();\n if (swiper.autoplay) {\n swiper.autoplay.start();\n }\n }\n\n @Method()\n async stopAutoplay() {\n const swiper = await this.getSwiper();\n if (swiper.autoplay) {\n swiper.autoplay.stop();\n }\n }\n\n @Method()\n async lockSwipeToNext(lock: boolean) {\n const swiper = await this.getSwiper();\n swiper.allowSlideNext = !lock;\n }\n\n @Method()\n async lockSwipeToPrev(lock: boolean) {\n const swiper = await this.getSwiper();\n swiper.allowSlidePrev = !lock;\n }\n\n @Method()\n async lockSwipes(lock: boolean) {\n const swiper = await this.getSwiper();\n swiper.allowSlideNext = !lock;\n swiper.allowSlidePrev = !lock;\n swiper.allowTouchMove = !lock;\n }\n\n @Method()\n async getSwiper(): Promise<any> {\n return this.swiper;\n }\n\n private async initSwiper() {\n const finalOptions = this.normalizeOptions();\n\n await waitForSlides(this.el);\n const swiper = new Swiper(this.el, finalOptions);\n this.swiperReady = true;\n this.syncSwiper = swiper;\n this.readySwiper(swiper);\n }\n\n private normalizeOptions(): SwiperOptions {\n const swiperOptions: SwiperOptions = {\n effect: undefined,\n direction: 'horizontal',\n initialSlide: 0,\n loop: false,\n parallax: false,\n slidesPerView: 1,\n spaceBetween: 0,\n speed: 300,\n grid: {\n rows: 1,\n fill: 'column',\n },\n slidesPerGroup: 1,\n centeredSlides: false,\n slidesOffsetBefore: 0,\n slidesOffsetAfter: 0,\n touchEventsTarget: 'container',\n autoplay: false,\n freeMode: {\n enabled: false,\n momentum: true,\n momentumRatio: 1,\n momentumBounce: true,\n momentumBounceRatio: 1,\n momentumVelocityRatio: 1,\n sticky: false,\n minimumVelocity: 0.02,\n },\n autoHeight: false,\n setWrapperSize: false,\n zoom: {\n maxRatio: 3,\n minRatio: 1,\n toggle: false,\n },\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n touchStartPreventDefault: false,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n threshold: 0,\n touchMoveStopPropagation: true,\n touchReleaseOnEdges: false,\n resistance: true,\n resistanceRatio: 0.85,\n watchSlidesProgress: false,\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n loopAdditionalSlides: 0,\n noSwiping: true,\n runCallbacksOnInit: true,\n coverflowEffect: {\n rotate: 50,\n stretch: 0,\n depth: 100,\n modifier: 1,\n slideShadows: true,\n },\n flipEffect: {\n slideShadows: true,\n limitRotation: true,\n },\n cubeEffect: {\n slideShadows: true,\n shadow: true,\n shadowOffset: 20,\n shadowScale: 0.94,\n },\n fadeEffect: {\n crossFade: false,\n },\n a11y: {\n prevSlideMessage: 'Previous slide',\n nextSlideMessage: 'Next slide',\n firstSlideMessage: 'This is the first slide',\n lastSlideMessage: 'This is the last slide',\n },\n };\n\n if (this.pager) {\n swiperOptions.pagination = {\n el: this.paginationEl!,\n type: 'bullets',\n clickable: true,\n hideOnClick: false,\n };\n }\n\n const eventOptions: SwiperOptions = {\n on: {\n init: () => {\n setTimeout(() => {\n this.roadslidesdidload.emit();\n }, 20);\n },\n slideChangeTransitionStart: () => this.roadslidewillchange.emit(),\n slideChangeTransitionEnd: () => this.roadslidedidchange.emit(),\n slideNextTransitionStart: () => this.roadslidenextstart.emit(),\n slidePrevTransitionStart: () => this.roadslideprevstart.emit(),\n slideNextTransitionEnd: () => this.roadslidenextend.emit(),\n slidePrevTransitionEnd: () => this.roadslideprevend.emit(),\n transitionStart: () => this.roadslidetransitionstart.emit(),\n transitionEnd: () => this.roadslidetransitionend.emit(),\n sliderMove: () => this.roadslidedrag.emit(),\n reachBeginning: () => this.roadslidereachstart.emit(),\n reachEnd: () => this.roadslidereachend.emit(),\n touchStart: () => this.roadslidetouchstart.emit(),\n touchEnd: () => this.roadslidetouchend.emit(),\n tap: () => this.roadslidetap.emit(),\n doubleTap: () => this.roadslidedoubletap.emit(),\n },\n };\n\n const customEvents = (!!this.options && !!this.options.on) ? this.options.on : {};\n const mergedEventOptions = { on: { ...customEvents, ...eventOptions.on } };\n\n return { ...swiperOptions, ...this.options, ...mergedEventOptions };\n }\n\n private setupKeyboardNavigation() {\n this.el.addEventListener('keydown', (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowLeft':\n this.slidePrev();\n break;\n case 'ArrowRight':\n this.slideNext();\n break;\n }\n });\n }\n\n render() {\n return (\n <Host class=\"swiper-container\" tabindex=\"0\">\n <div class=\"swiper-wrapper\">\n <slot />\n </div>\n {this.pager && <div class=\"swiper-pagination\" ref={el => this.paginationEl = el}></div>}\n {this.arrows && (\n <div role=\"button\" class=\"swiper-button-prev\" tabindex=\"0\" aria-label=\"Previous slide\" onClick={() => this.slidePrev()}>\n <road-icon icon={navigationChevron} rotate=\"180\"></road-icon>\n </div>\n )}\n {this.arrows && (\n <div role=\"button\" class=\"swiper-button-next\" tabindex=\"0\" aria-label=\"Next slide\" onClick={() => this.slideNext()}>\n <road-icon icon={navigationChevron}></road-icon>\n </div>\n )}\n </Host>\n );\n }\n}\n\nconst waitForSlides = (el: HTMLElement) => {\n return Promise.all(\n Array.from(el.querySelectorAll('road-carousel-item')).map(s => s.componentOnReady())\n );\n};\n"]}
@@ -100,7 +100,7 @@
100
100
  }
101
101
 
102
102
  :host(.chip-secondary) {
103
- color: var(--road-surface-inverse);
103
+ color: var(--road-on-button-primary);
104
104
  background: var(--road-button-primary);
105
105
  border-color: transparent;
106
106
  }
@@ -133,7 +133,7 @@
133
133
  * Focus state
134
134
  */
135
135
 
136
- :host(.chip-outline:hover) {
136
+ :host(.chip-outline:focus-visible) {
137
137
  border-color: var(--road-outline-variant);
138
138
  }
139
139
 
@@ -13,7 +13,7 @@ export class Chip {
13
13
  }
14
14
  render() {
15
15
  const outlineClass = this.outline ? 'chip-outline' : '';
16
- return (h(Host, { class: `${outlineClass} chip-${this.color} chip-${this.size}` }, h("div", { class: "chip-description" }, h("slot", null)), this.hasCloseIcon && h("road-icon", { class: "chip-close", icon: navigationClose })));
16
+ return (h(Host, { class: `${outlineClass} chip-${this.color} chip-${this.size}`, tabindex: "0" }, h("div", { class: "chip-description" }, h("slot", null)), this.hasCloseIcon && h("road-icon", { class: "chip-close", icon: navigationClose })));
17
17
  }
18
18
  static get is() { return "road-chip"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../src/components/chip/chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,wBAAwB,CAAC;AAEhC;;GAEG;AAOH,MAAM,OAAO,IAAI;;iBAI2B,SAAS;mBAKxB,KAAK;gBAKJ,IAAI;wBAKA,KAAK;;EAErC,MAAM;IACJ,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAExD,OAAO,CACL,EAAC,IAAI,IACH,KAAK,EAAE,GAAG,YAAY,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,IAAI,EAAE;MAE7D,WAAK,KAAK,EAAC,kBAAkB;QAC3B,eAAO,CACH;MACL,IAAI,CAAC,YAAY,IAAI,iBAAW,KAAK,EAAC,YAAY,EAAC,IAAI,EAAE,eAAe,GAAc,CAClF,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { navigationClose } from '../../../icons';\nimport './../../utils/polyfill';\n\n/**\n * @slot - Content of the chip.\n */\n\n@Component({\n tag: 'road-chip',\n styleUrl: 'chip.css',\n shadow: true,\n})\nexport class Chip {\n /**\n * The color to use from your application's color palette.\n */\n @Prop() color?: 'default' | 'secondary' = 'default';\n\n /**\n * Display an outline style chip.\n */\n @Prop() outline: boolean = false;\n\n /**\n * The chip size.\n */\n @Prop() size: 'md' | 'lg' = 'md';\n\n /**\n * Display a close icon\n */\n @Prop() hasCloseIcon: boolean = false;\n\n render() {\n const outlineClass = this.outline ? 'chip-outline' : '';\n\n return (\n <Host\n class={`${outlineClass} chip-${this.color} chip-${this.size}`}\n >\n <div class=\"chip-description\">\n <slot/>\n </div>\n {this.hasCloseIcon && <road-icon class=\"chip-close\" icon={navigationClose}></road-icon>}\n </Host>\n );\n }\n}"]}
1
+ {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../src/components/chip/chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,wBAAwB,CAAC;AAEhC;;GAEG;AAOH,MAAM,OAAO,IAAI;;iBAI2B,SAAS;mBAKxB,KAAK;gBAKJ,IAAI;wBAKA,KAAK;;EAErC,MAAM;IACJ,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAExD,OAAO,CACL,EAAC,IAAI,IACH,KAAK,EAAE,GAAG,YAAY,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAC,GAAG;MAE3E,WAAK,KAAK,EAAC,kBAAkB;QAC3B,eAAO,CACH;MACL,IAAI,CAAC,YAAY,IAAI,iBAAW,KAAK,EAAC,YAAY,EAAC,IAAI,EAAE,eAAe,GAAc,CAClF,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { navigationClose } from '../../../icons';\nimport './../../utils/polyfill';\n\n/**\n * @slot - Content of the chip.\n */\n\n@Component({\n tag: 'road-chip',\n styleUrl: 'chip.css',\n shadow: true,\n})\nexport class Chip {\n /**\n * The color to use from your application's color palette.\n */\n @Prop() color?: 'default' | 'secondary' = 'default';\n\n /**\n * Display an outline style chip.\n */\n @Prop() outline: boolean = false;\n\n /**\n * The chip size.\n */\n @Prop() size: 'md' | 'lg' = 'md';\n\n /**\n * Display a close icon\n */\n @Prop() hasCloseIcon: boolean = false;\n\n render() {\n const outlineClass = this.outline ? 'chip-outline' : '';\n\n return (\n <Host\n class={`${outlineClass} chip-${this.color} chip-${this.size}`} tabindex=\"0\"\n >\n <div class=\"chip-description\">\n <slot/>\n </div>\n {this.hasCloseIcon && <road-icon class=\"chip-close\" icon={navigationClose}></road-icon>}\n </Host>\n );\n }\n}"]}
@@ -49,6 +49,31 @@ const Template = (args) => html`
49
49
  >
50
50
  ${unsafeHTML(args[' '])}
51
51
  </road-chip>
52
+ <road-chip
53
+ outline="${ifDefined(args.outline)}"
54
+ has-close-icon="${ifDefined(args['has-close-icon'])}"
55
+ size="${ifDefined(args.size)}"
56
+ color="${ifDefined(args.color)}"
57
+ >
58
+ ${unsafeHTML(args[' '])}
59
+ </road-chip>
60
+ <road-chip
61
+ outline="${ifDefined(args.outline)}"
62
+ has-close-icon="${ifDefined(args['has-close-icon'])}"
63
+ size="${ifDefined(args.size)}"
64
+ color="${ifDefined(args.color)}"
65
+ >
66
+ ${unsafeHTML(args[' '])}
67
+ </road-chip>
68
+ <road-chip
69
+ outline="${ifDefined(args.outline)}"
70
+ has-close-icon="${ifDefined(args['has-close-icon'])}"
71
+ size="${ifDefined(args.size)}"
72
+ color="${ifDefined(args.color)}"
73
+ >
74
+ ${unsafeHTML(args[' '])}
75
+ </road-chip>
76
+
52
77
  `;
53
78
 
54
79
  export const Playground = Template.bind({});
@@ -61,7 +86,7 @@ export const withIcon = Template.bind({});
61
86
  withIcon.args = {
62
87
  outline: true,
63
88
  'has-close-icon': true,
64
- ' ': `<road-icon name="weather-rain"></road-icon>
89
+ ' ': `<road-icon name="weather-rain" role="button"></road-icon>
65
90
  B`,
66
91
  };
67
92
 
@@ -56,6 +56,10 @@
56
56
  --font-size: var(--btn-font-size);
57
57
  }
58
58
 
59
+ .collapse-btn:focus {
60
+ outline: 1px solid var(--road-link-primary);
61
+ }
62
+
59
63
  .collapse-btn-centered {
60
64
  display: flex;
61
65
  justify-content: center;
@@ -112,25 +112,25 @@ VehicleTypes.args = {
112
112
  <road-row>
113
113
  <road-col class="col-6 col-md-4 col-lg-3">
114
114
  <road-card button value="car">
115
- <road-icon name="vehicle-car" size="3x"></road-icon>
115
+ <road-icon name="vehicle-car" size="3x" aria-hidden="true"></road-icon>
116
116
  <road-label>Car</road-label>
117
117
  </road-card>
118
118
  </road-col>
119
119
  <road-col class="col-6 col-md-4 col-lg-3">
120
120
  <road-card button value="4x4">
121
- <road-icon name="vehicle-suv" size="3x"></road-icon>
121
+ <road-icon name="vehicle-suv" size="3x" aria-hidden="true"></road-icon>
122
122
  <road-label>4x4</road-label>
123
123
  </road-card>
124
124
  </road-col>
125
125
  <road-col class="col-6 col-md-4 col-lg-3">
126
126
  <road-card button value="truck">
127
- <road-icon name="vehicle-pickup-van" size="3x"></road-icon>
127
+ <road-icon name="vehicle-pickup-van" size="3x" aria-hidden="true"></road-icon>
128
128
  <road-label>Truck</road-label>
129
129
  </road-card>
130
130
  </road-col>
131
131
  <road-col class="col-6 col-md-4 col-lg-3">
132
132
  <road-card button value="bike">
133
- <road-icon name="vehicle-moto" size="3x"></road-icon>
133
+ <road-icon name="vehicle-moto" size="3x" aria-hidden="true"></road-icon>
134
134
  <road-label>Bike</road-label>
135
135
  </road-card>
136
136
  </road-col>
@@ -140,25 +140,25 @@ VehicleTypes.args = {
140
140
  <road-row>
141
141
  <road-col class="col-6 col-md-4 col-lg-3">
142
142
  <road-card button value="scooter">
143
- <road-icon name="vehicle-scooter" size="3x"></road-icon>
143
+ <road-icon name="vehicle-scooter" size="3x" aria-hidden="true"></road-icon>
144
144
  <road-label>Scooter</road-label>
145
145
  </road-card>
146
146
  </road-col>
147
147
  <road-col class="col-6 col-md-4 col-lg-3">
148
148
  <road-card button value="competition">
149
- <road-icon name="vehicle-rally" size="3x"></road-icon>
149
+ <road-icon name="vehicle-rally" size="3x" aria-hidden="true"></road-icon>
150
150
  <road-label>Compétition</road-label>
151
151
  </road-card>
152
152
  </road-col>
153
153
  <road-col class="col-6 col-md-4 col-lg-3">
154
154
  <road-card button value="colletion">
155
- <road-icon name="vehicle-collector" size="3x"></road-icon>
155
+ <road-icon name="vehicle-collector" size="3x" aria-hidden="true"></road-icon>
156
156
  <road-label>Colletion</road-label>
157
157
  </road-card>
158
158
  </road-col>
159
159
  <road-col class="col-6 col-md-4 col-lg-3">
160
160
  <road-card button value="quad">
161
- <road-icon name="vehicle-quad" size="3x"></road-icon>
161
+ <road-icon name="vehicle-quad" size="3x" aria-hidden="true"></road-icon>
162
162
  <road-label>Quad</road-label>
163
163
  </road-card>
164
164
  </road-col>
@@ -26,6 +26,11 @@ road-input {
26
26
  --margin-bottom: 0;
27
27
  }
28
28
 
29
+ .test{
30
+ display: none;
31
+ }
32
+
33
+
29
34
  /* BUTTONS
30
35
  -------------------- */
31
36
 
@@ -92,9 +92,27 @@ export class Counter {
92
92
  componentWillLoad() {
93
93
  this.onValueChange(this.value);
94
94
  }
95
+ componentDidLoad() {
96
+ // Cacher le label pour accessibilité
97
+ const label = this.el.querySelector('.form-label');
98
+ const input = this.el.querySelector('.form-control.sc-road-input');
99
+ if (label) {
100
+ label.style.clip = 'rect(0 0 0 0)';
101
+ label.style.border = '0';
102
+ label.style.height = '1px';
103
+ label.style.left = '0';
104
+ label.style.margin = '-1px';
105
+ label.style.overflow = 'hidden';
106
+ label.style.padding = '0';
107
+ label.style.position = 'absolute';
108
+ label.style.top = '0';
109
+ label.style.width = '1px';
110
+ input.style.padding = '0 1rem 0';
111
+ }
112
+ }
95
113
  render() {
96
114
  const dataCi = this.isDustbinVisible ? "road-dustbin" : "";
97
- return (h("road-input-group", { class: this.size && `counter-${this.size}` }, h("road-button", { slot: "prepend", size: this.size, onClick: this.decrease, class: this.leftIconClasses, "data-cy": "road-decrease" }, h("road-icon", { name: this.isDustbinVisible ? "delete-forever" : "navigation-add-less", ref: (el) => this.iconCounterLess = el, size: this.size, "data-cy": dataCi })), h("road-input", { ref: (el) => this.inputElement = el, type: "number", min: this.min.toString(), max: (this.max && this.max.toString()), step: this.step, value: this.value, onRoadChange: this.onRoadChange, onKeyUp: this.checkValue, "data-cy": "road-input-counter", readonly: this.readonly }), h("road-button", { slot: "append", size: this.size, onClick: this.increase, class: this.rightIconClasses, "data-cy": "road-increase" }, h("road-icon", { name: "navigation-add-more", size: this.size }))));
115
+ return (h("road-input-group", { class: this.size && `counter-${this.size}` }, h("road-button", { slot: "prepend", size: this.size, onClick: this.decrease, class: this.leftIconClasses, "data-cy": "road-decrease" }, h("road-icon", { name: this.isDustbinVisible ? "delete-forever" : "navigation-add-less", ref: (el) => this.iconCounterLess = el, size: this.size, "data-cy": dataCi, role: "button" })), h("road-input", { ref: (el) => this.inputElement = el, type: "number", min: this.min.toString(), max: (this.max && this.max.toString()), step: this.step, value: this.value, onRoadChange: this.onRoadChange, onKeyUp: this.checkValue, "data-cy": "road-input-counter", readonly: this.readonly, label: "Quantit\u00E9" }), h("road-button", { slot: "append", size: this.size, onClick: this.increase, class: this.rightIconClasses, "data-cy": "road-increase" }, h("road-icon", { name: "navigation-add-more", size: this.size, role: "button" }))));
98
116
  }
99
117
  static get is() { return "road-counter"; }
100
118
  static get encapsulation() { return "scoped"; }
@@ -1 +1 @@
1
- {"version":3,"file":"counter.js","sourceRoot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AE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,KAAK,EAAE,IAAI,CAAC,gBAAgB,aACpB,eAAe;QAEvB,iBACE,IAAI,EAAC,qBAAqB,EAC1B,IAAI,EAAE,IAAI,CAAC,IAAI,GACf,CACU,CACG,CACpB,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,UAAU,GAAG,CAAC,CAAC","sourcesContent":["import { Component, h, Prop, Element, Event, EventEmitter, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'road-counter',\n styleUrl: 'counter.css',\n scoped: true,\n})\nexport class Counter {\n\n @Element() el!: HTMLRoadCounterElement;\n\n iconCounterLess!: HTMLRoadIconElement;\n\n inputElement!: HTMLRoadInputElement;\n\n @State() leftIconClasses: string = \"\";\n\n @State() rightIconClasses: string = \"\";\n\n @State() isDustbinVisible: boolean = false;\n\n /**\n * The id of counter\n */\n @Prop() inputId: string = `road-counter-${counterIds++}`;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min: number = 0;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: number;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The value of the counter.\n */\n @Prop() value: number = 1;\n\n /**\n * The size of the counter.\n */\n @Prop() size?: 'sm' | 'md' | 'lg' = \"lg\";\n\n /**\n * Set to `true` to add the dustbin icon if the value is equal to the min.\n */\n @Prop() dustbin: boolean = false;\n\n /**\n * Set to `true` to not modify the input field\n */\n @Prop() readonly: boolean = false;\n\n /**\n * Emitted when the plus button is clicked\n */\n @Event() roadIncrease!: EventEmitter<{\n value: number | undefined | null;\n }>;\n\n /**\n * Emitted when the minus button is clicked\n */\n @Event() roadDecrease!: EventEmitter<{\n value: number | undefined | null;\n }>;\n\n /**\n * Emitted when the minus button is clicked\n */\n @Event() roadChange!: EventEmitter<{\n value: number | undefined | null;\n }>;\n\n /**\n * Emitted when the dustbin is clicked\n */\n @Event() roadDustbinClick!: EventEmitter<void>;\n\n @Watch('value')\n private onValueChange(valueInput: number) {\n this.setIsDustbinVisible(valueInput);\n this.setIconsClasses(valueInput);\n }\n\n private setIconsClasses(valueInput?: number) {\n valueInput = valueInput ?? parseInt(this.inputElement.querySelector('input')!.value as string);\n\n this.leftIconClasses = valueInput <= this.min && !this.dustbin ? \"disabled\" : \"\";\n this.rightIconClasses = this.max && valueInput >= this.max ? \"disabled\" : \"\";\n }\n\n private setIsDustbinVisible = (valueInput: number) => {\n if (valueInput > this.min) {\n this.isDustbinVisible = false;\n } else if (this.dustbin) {\n this.isDustbinVisible = true;\n }\n else {\n this.isDustbinVisible = false;\n }\n }\n\n private increase = () => {\n (this.inputElement as unknown as HTMLInputElement).querySelector('input')!.stepUp();\n let valueInput = parseInt(this.inputElement.querySelector('input')!.value as string);\n if(!valueInput) {\n valueInput = this.min\n };\n this.onValueChange(valueInput);\n this.roadIncrease.emit({ value: valueInput });\n };\n\n private decrease = () => {\n if(this.isDustbinVisible){\n this.roadDustbinClick.emit();\n return;\n }\n\n (this.inputElement as unknown as HTMLInputElement).querySelector('input')!.stepDown();\n\n let valueInput = parseInt(this.inputElement.querySelector('input')!.value as string);\n if(!valueInput) {\n valueInput = this.min\n };\n this.onValueChange(valueInput);\n\n this.roadDecrease.emit({ value: valueInput });\n };\n\n private checkValue = (ev: Event) => {\n const input = ev.target as HTMLInputElement;\n const value = input.value && parseInt(input.value)\n\n if (value == null || value === \"\") return;\n\n if (value < this.min) {\n input.value = this.min.toString()\n }\n else if (this.max && value > this.max) {\n input.value = this.max.toString()\n }\n\n this.onValueChange(parseInt(input.value));\n }\n\n private onRoadChange = (ev: Event) => {\n ev.stopPropagation();\n const input = ev.target as HTMLInputElement;\n const value = input.value && parseInt(input.value)\n if (value !== null && value !== \"\") {\n if (value < this.min) {\n this.roadChange.emit({ value: this.min });\n }\n else if (this.max && value > this.max) {\n this.roadChange.emit({ value: this.max });\n }\n else {\n this.roadChange.emit({ value: parseInt(input.value) });\n }\n }\n else {\n this.roadChange.emit({ value: null });\n }\n };\n\n componentWillLoad() {\n this.onValueChange(this.value);\n }\n render() {\n\n const dataCi = this.isDustbinVisible ? \"road-dustbin\" : \"\";\n\n\n return (\n <road-input-group\n class={this.size && `counter-${this.size}`}\n >\n <road-button\n slot=\"prepend\"\n size={this.size}\n onClick={this.decrease}\n class={this.leftIconClasses}\n data-cy=\"road-decrease\"\n >\n <road-icon\n name={this.isDustbinVisible ? \"delete-forever\" : \"navigation-add-less\"}\n ref={(el) => this.iconCounterLess = el as HTMLRoadIconElement}\n size={this.size}\n data-cy={dataCi}\n />\n </road-button>\n <road-input\n ref={(el) => this.inputElement = el as HTMLRoadInputElement}\n type=\"number\"\n min={this.min.toString()}\n max={(this.max && this.max.toString()) as string}\n step={this.step}\n value={this.value}\n onRoadChange={this.onRoadChange}\n onKeyUp={this.checkValue}\n data-cy=\"road-input-counter\"\n readonly={this.readonly}\n />\n <road-button\n slot=\"append\"\n size={this.size}\n onClick={this.increase}\n class={this.rightIconClasses}\n data-cy=\"road-increase\"\n >\n <road-icon\n name=\"navigation-add-more\"\n size={this.size}\n />\n </road-button>\n </road-input-group>\n );\n }\n}\n\nlet counterIds = 0;\n"]}
1
+ {"version":3,"file":"counter.js","sourceRoot":"","sources":["../../../src/components/counter/counter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,UAAU,GAAG,CAAC,CAAC","sourcesContent":["import { Component, h, Prop, Element, Event, EventEmitter, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'road-counter',\n styleUrl: 'counter.css',\n scoped: true,\n})\nexport class Counter {\n\n @Element() el!: HTMLRoadCounterElement;\n\n iconCounterLess!: HTMLRoadIconElement;\n\n inputElement!: HTMLRoadInputElement;\n\n @State() leftIconClasses: string = \"\";\n\n @State() rightIconClasses: string = \"\";\n\n @State() isDustbinVisible: boolean = false;\n\n /**\n * The id of counter\n */\n @Prop() inputId: string = `road-counter-${counterIds++}`;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min: number = 0;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: number;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The value of the counter.\n */\n @Prop() value: number = 1;\n\n /**\n * The size of the counter.\n */\n @Prop() size?: 'sm' | 'md' | 'lg' = \"lg\";\n\n /**\n * Set to `true` to add the dustbin icon if the value is equal to the min.\n */\n @Prop() dustbin: boolean = false;\n\n /**\n * Set to `true` to not modify the input field\n */\n @Prop() readonly: boolean = false;\n\n /**\n * Emitted when the plus button is clicked\n */\n @Event() roadIncrease!: EventEmitter<{\n value: number | undefined | null;\n }>;\n\n /**\n * Emitted when the minus button is clicked\n */\n @Event() roadDecrease!: EventEmitter<{\n value: number | undefined | null;\n }>;\n\n /**\n * Emitted when the minus button is clicked\n */\n @Event() roadChange!: EventEmitter<{\n value: number | undefined | null;\n }>;\n\n /**\n * Emitted when the dustbin is clicked\n */\n @Event() roadDustbinClick!: EventEmitter<void>;\n\n @Watch('value')\n private onValueChange(valueInput: number) {\n this.setIsDustbinVisible(valueInput);\n this.setIconsClasses(valueInput);\n }\n\n private setIconsClasses(valueInput?: number) {\n valueInput = valueInput ?? parseInt(this.inputElement.querySelector('input')!.value as string);\n\n this.leftIconClasses = valueInput <= this.min && !this.dustbin ? \"disabled\" : \"\";\n this.rightIconClasses = this.max && valueInput >= this.max ? \"disabled\" : \"\";\n }\n\n private setIsDustbinVisible = (valueInput: number) => {\n if (valueInput > this.min) {\n this.isDustbinVisible = false;\n } else if (this.dustbin) {\n this.isDustbinVisible = true;\n }\n else {\n this.isDustbinVisible = false;\n }\n }\n\n private increase = () => {\n (this.inputElement as unknown as HTMLInputElement).querySelector('input')!.stepUp();\n let valueInput = parseInt(this.inputElement.querySelector('input')!.value as string);\n if(!valueInput) {\n valueInput = this.min\n };\n this.onValueChange(valueInput);\n this.roadIncrease.emit({ value: valueInput });\n };\n\n private decrease = () => {\n if(this.isDustbinVisible){\n this.roadDustbinClick.emit();\n return;\n }\n\n (this.inputElement as unknown as HTMLInputElement).querySelector('input')!.stepDown();\n\n let valueInput = parseInt(this.inputElement.querySelector('input')!.value as string);\n if(!valueInput) {\n valueInput = this.min\n };\n this.onValueChange(valueInput);\n\n this.roadDecrease.emit({ value: valueInput });\n };\n\n private checkValue = (ev: Event) => {\n const input = ev.target as HTMLInputElement;\n const value = input.value && parseInt(input.value)\n\n if (value == null || value === \"\") return;\n\n if (value < this.min) {\n input.value = this.min.toString()\n }\n else if (this.max && value > this.max) {\n input.value = this.max.toString()\n }\n\n this.onValueChange(parseInt(input.value));\n }\n\n private onRoadChange = (ev: Event) => {\n ev.stopPropagation();\n const input = ev.target as HTMLInputElement;\n const value = input.value && parseInt(input.value)\n if (value !== null && value !== \"\") {\n if (value < this.min) {\n this.roadChange.emit({ value: this.min });\n }\n else if (this.max && value > this.max) {\n this.roadChange.emit({ value: this.max });\n }\n else {\n this.roadChange.emit({ value: parseInt(input.value) });\n }\n }\n else {\n this.roadChange.emit({ value: null });\n }\n };\n\n componentWillLoad() {\n this.onValueChange(this.value);\n }\n\n componentDidLoad() {\n // Cacher le label pour accessibilité\n\n const label = this.el.querySelector('.form-label') as HTMLElement;\n const input = this.el.querySelector('.form-control.sc-road-input') as HTMLElement;\n if (label) {\n label.style.clip = 'rect(0 0 0 0)';\n label.style.border = '0';\n label.style.height = '1px';\n label.style.left = '0';\n label.style.margin = '-1px';\n label.style.overflow = 'hidden';\n label.style.padding = '0';\n label.style.position = 'absolute';\n label.style.top = '0';\n label.style.width = '1px';\n\n input.style.padding = '0 1rem 0';\n \n }\n }\n\n render() {\n\n const dataCi = this.isDustbinVisible ? \"road-dustbin\" : \"\";\n\n return (\n <road-input-group\n class={this.size && `counter-${this.size}`}\n >\n <road-button\n slot=\"prepend\"\n size={this.size}\n onClick={this.decrease}\n class={this.leftIconClasses}\n data-cy=\"road-decrease\"\n >\n <road-icon\n name={this.isDustbinVisible ? \"delete-forever\" : \"navigation-add-less\"}\n ref={(el) => this.iconCounterLess = el as HTMLRoadIconElement}\n size={this.size}\n data-cy={dataCi}\n role=\"button\"\n />\n </road-button>\n <road-input\n ref={(el) => this.inputElement = el as HTMLRoadInputElement}\n type=\"number\"\n min={this.min.toString()}\n max={(this.max && this.max.toString()) as string}\n step={this.step}\n value={this.value}\n onRoadChange={this.onRoadChange}\n onKeyUp={this.checkValue}\n data-cy=\"road-input-counter\"\n readonly={this.readonly}\n label=\"Quantité\"\n />\n <road-button\n slot=\"append\"\n size={this.size}\n onClick={this.increase}\n class={this.rightIconClasses}\n data-cy=\"road-increase\"\n >\n <road-icon\n name=\"navigation-add-more\"\n size={this.size}\n role=\"button\"\n />\n </road-button>\n </road-input-group>\n );\n }\n}\n\nlet counterIds = 0;\n"]}
@@ -79,11 +79,11 @@ export class Dialog {
79
79
  break;
80
80
  }
81
81
  }
82
- return (h(Host, { class: `dialog ${modalIsOpenClass} ${modalhasClose}`, role: "alertdialog", "aria-modal": "true", tabindex: "-1", "aria-labelledby": "dialogLabel", "aria-describedby": "dialogDesc" }, h("div", { class: "dialog-overlay", onClick: this.hasCloseIcon === true ? this.onClick : undefined, tabindex: "-1" }), h("div", { class: "dialog-modal", role: "document", tabindex: "0" }, h("div", { class: "dialog-content" }, h("header", { class: "dialog-header" }, this.hasCloseIcon
82
+ return (h(Host, { class: `dialog ${modalIsOpenClass} ${modalhasClose}`, role: "alertdialog", "aria-modal": "true", tabindex: "-1", "aria-label": "dialogLabel" }, h("div", { class: "dialog-overlay", onClick: this.hasCloseIcon === true ? this.onClick : undefined, tabindex: "-1" }), h("div", { class: "dialog-modal", role: "document", tabindex: "0" }, h("div", { class: "dialog-content" }, h("header", { class: "dialog-header" }, this.hasCloseIcon
83
83
  ? h("button", { type: "button", class: "dialog-close", onClick: this.onClick, "aria-label": "Close" }, h("road-icon", { icon: navigationClose, "aria-hidden": "true" }))
84
84
  : ''), h("div", { class: "dialog-body" }, this.color !== undefined
85
85
  ? h("road-icon", { class: "dialog-icon", part: "dialog-icon", color: this.color, icon: icon, "aria-hidden": "true" })
86
- : '', h("h2", { class: "dialog-title", id: "dialogLabel" }, this.label), h("p", { class: "dialog-description", id: "dialogDesc" }, this.description)), h("footer", { class: "dialog-footer" }, h("slot", null))))));
86
+ : '', h("h2", { class: "dialog-title" }, this.label), h("p", { class: "dialog-description", id: "dialogDesc" }, this.description)), h("footer", { class: "dialog-footer" }, h("slot", null))))));
87
87
  }
88
88
  static get is() { return "road-dialog"; }
89
89
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEjI;;;;GAIG;AAOH,MAAM,OAAO,MAAM;;IA6DjB;;OAEG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rB,IAAI,CAAC,KAAK,KAAK,SAAS;cACvB,CAAC,CAAC,iBAAW,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,aAAa,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,iBAAc,MAAM,GAAa;cAClH,CAAC,CAAC,EAAE;YACN,UAAI,KAAK,EAAC,cAAc,EAAC,EAAE,EAAC,aAAa,IAAE,IAAI,CAAC,KAAK,CAAM;YAC3D,SAAG,KAAK,EAAC,oBAAoB,EAAC,EAAE,EAAC,YAAY,IAAE,IAAI,CAAC,WAAW,CAAK,CAChE;UACN,cAAQ,KAAK,EAAC,eAAe;YAC3B,eAAO,CACA,CACL,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Listen, Method, Prop, h, Host } from '@stencil/core';\nimport { FeedbackColors } from '../../interface';\nimport { navigationClose, alertDangerOutline, alertInfoOutline, alertSuccessOutline, alertWarningOutline } from '../../../icons';\n\n/**\n * @slot - Content of the footer dialog if it's an action dialog add action buttons here.\n *\n * @part dialog-icon - main icon of the dialog\n */\n\n@Component({\n tag: 'road-dialog',\n styleUrl: 'dialog.css',\n shadow: true,\n})\nexport class Dialog {\n\n /**\n * Current reference of the dialog\n */\n @Element() el!: HTMLRoadDialogElement;\n\n /**\n * Set isOpen property to true to open the dialog\n */\n @Prop({ mutable: true }) isOpen: boolean = false;\n\n /**\n * Show / hide the close icon\n */\n @Prop() hasCloseIcon: boolean = true;\n\n /**\n * Set the color of information dialog. e.g. info, success, warning, danger\n */\n @Prop() color?: FeedbackColors;\n\n /**\n * override default icon\n */\n @Prop() icon?: string;\n\n /**\n * Text to the top\n */\n @Prop() label?: string;\n\n /**\n * Content description of the dialog\n */\n @Prop() description?: string;\n\n /**\n * Indicate when closing the dialog\n */\n @Event({ eventName: 'close' }) onClose!: EventEmitter<void>;\n\n /**\n * Open the dialog\n */\n @Method()\n async open() {\n this.isOpen = true;\n }\n\n /**\n * Close the dialog\n */\n @Method()\n async close() {\n this.isOpen = false;\n this.el.addEventListener('transitionend', () => {\n this.onClose.emit();\n }, { once: true});\n }\n\n /**\n * Close the dialog when clicking on the cross or layer\n */\n private onClick = (ev: UIEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.close();\n };\n\n /**\n * Close the dialog when press Escape key\n */\n @Listen('keyup', { target: 'document' })\n onEscape(event: KeyboardEvent) {\n if ((event.key === 'Escape' || event.key === \"Esc\") && this.isOpen && this.hasCloseIcon) {\n this.close();\n }\n }\n\n /**\n * Call close function when clicking an element with data-dismiss=\"modal\" attribute\n */\n componentDidLoad() {\n this.el.querySelectorAll('[data-dismiss=\"modal\"]').forEach(item => {\n item.addEventListener('click', () => this.close());\n });\n }\n\n render() {\n const modalIsOpenClass = this.isOpen ? 'dialog-open' : '';\n const modalhasClose = this.hasCloseIcon ? 'dialog-has-close' : '';\n\n let icon;\n\n if(this.icon) {\n icon = this.icon;\n } else {\n switch(this.color) {\n case 'info':\n icon = alertInfoOutline;\n break;\n case 'success':\n icon = alertSuccessOutline;\n break;\n case 'warning':\n icon = alertWarningOutline;\n break;\n case 'danger':\n icon = alertDangerOutline;\n break;\n default:\n icon = alertInfoOutline;\n break;\n }\n }\n\n return (\n <Host class={`dialog ${modalIsOpenClass} ${modalhasClose}`} role=\"alertdialog\" aria-modal=\"true\" tabindex=\"-1\" aria-labelledby=\"dialogLabel\" aria-describedby=\"dialogDesc\">\n <div class=\"dialog-overlay\" onClick={this.hasCloseIcon === true ? this.onClick : undefined} tabindex=\"-1\"></div>\n <div class=\"dialog-modal\" role=\"document\" tabindex=\"0\">\n <div class=\"dialog-content\">\n <header class=\"dialog-header\">\n {this.hasCloseIcon\n ? <button type=\"button\" class=\"dialog-close\" onClick={this.onClick} aria-label=\"Close\"><road-icon icon={navigationClose} aria-hidden=\"true\"></road-icon></button>\n : ''}\n </header>\n <div class=\"dialog-body\">\n {this.color !== undefined\n ? <road-icon class=\"dialog-icon\" part=\"dialog-icon\" color={this.color} icon={icon} aria-hidden=\"true\"></road-icon>\n : ''}\n <h2 class=\"dialog-title\" id=\"dialogLabel\">{this.label}</h2>\n <p class=\"dialog-description\" id=\"dialogDesc\">{this.description}</p>\n </div>\n <footer class=\"dialog-footer\">\n <slot/>\n </footer>\n </div>\n </div>\n </Host>\n );\n }\n}"]}
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEjI;;;;GAIG;AAOH,MAAM,OAAO,MAAM;;IA6DjB;;OAEG;IACK,YAAO,GAAG,CAAC,EAAW,EAAE,EAAE;MAChC,EAAE,CAAC,eAAe,EAAE,CAAC;MACrB,EAAE,CAAC,cAAc,EAAE,CAAC;MAEpB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC,CAAC;kBA3DyC,KAAK;wBAKhB,IAAI;;;;;;EA2BpC;;KAEG;EAEH,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;EACrB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,KAAK;IACT,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACpB,IAAI,CAAC,EAAE,CAAC,gBAAgB,CA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EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Listen, Method, Prop, h, Host } from '@stencil/core';\nimport { FeedbackColors } from '../../interface';\nimport { navigationClose, alertDangerOutline, alertInfoOutline, alertSuccessOutline, alertWarningOutline } from '../../../icons';\n\n/**\n * @slot - Content of the footer dialog if it's an action dialog add action buttons here.\n *\n * @part dialog-icon - main icon of the dialog\n */\n\n@Component({\n tag: 'road-dialog',\n styleUrl: 'dialog.css',\n shadow: true,\n})\nexport class Dialog {\n\n /**\n * Current reference of the dialog\n */\n @Element() el!: HTMLRoadDialogElement;\n\n /**\n * Set isOpen property to true to open the dialog\n */\n @Prop({ mutable: true }) isOpen: boolean = false;\n\n /**\n * Show / hide the close icon\n */\n @Prop() hasCloseIcon: boolean = true;\n\n /**\n * Set the color of information dialog. e.g. info, success, warning, danger\n */\n @Prop() color?: FeedbackColors;\n\n /**\n * override default icon\n */\n @Prop() icon?: string;\n\n /**\n * Text to the top\n */\n @Prop() label?: string;\n\n /**\n * Content description of the dialog\n */\n @Prop() description?: string;\n\n /**\n * Indicate when closing the dialog\n */\n @Event({ eventName: 'close' }) onClose!: EventEmitter<void>;\n\n /**\n * Open the dialog\n */\n @Method()\n async open() {\n this.isOpen = true;\n }\n\n /**\n * Close the dialog\n */\n @Method()\n async close() {\n this.isOpen = false;\n this.el.addEventListener('transitionend', () => {\n this.onClose.emit();\n }, { once: true});\n }\n\n /**\n * Close the dialog when clicking on the cross or layer\n */\n private onClick = (ev: UIEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.close();\n };\n\n /**\n * Close the dialog when press Escape key\n */\n @Listen('keyup', { target: 'document' })\n onEscape(event: KeyboardEvent) {\n if ((event.key === 'Escape' || event.key === \"Esc\") && this.isOpen && this.hasCloseIcon) {\n this.close();\n }\n }\n\n /**\n * Call close function when clicking an element with data-dismiss=\"modal\" attribute\n */\n componentDidLoad() {\n this.el.querySelectorAll('[data-dismiss=\"modal\"]').forEach(item => {\n item.addEventListener('click', () => this.close());\n });\n }\n\n render() {\n const modalIsOpenClass = this.isOpen ? 'dialog-open' : '';\n const modalhasClose = this.hasCloseIcon ? 'dialog-has-close' : '';\n\n let icon;\n\n if(this.icon) {\n icon = this.icon;\n } else {\n switch(this.color) {\n case 'info':\n icon = alertInfoOutline;\n break;\n case 'success':\n icon = alertSuccessOutline;\n break;\n case 'warning':\n icon = alertWarningOutline;\n break;\n case 'danger':\n icon = alertDangerOutline;\n break;\n default:\n icon = alertInfoOutline;\n break;\n }\n }\n\n return (\n <Host class={`dialog ${modalIsOpenClass} ${modalhasClose}`} role=\"alertdialog\" aria-modal=\"true\" tabindex=\"-1\" aria-label=\"dialogLabel\">\n <div class=\"dialog-overlay\" onClick={this.hasCloseIcon === true ? this.onClick : undefined} tabindex=\"-1\"></div>\n <div class=\"dialog-modal\" role=\"document\" tabindex=\"0\">\n <div class=\"dialog-content\">\n <header class=\"dialog-header\">\n {this.hasCloseIcon\n ? <button type=\"button\" class=\"dialog-close\" onClick={this.onClick} aria-label=\"Close\"><road-icon icon={navigationClose} aria-hidden=\"true\"></road-icon></button>\n : ''}\n </header>\n <div class=\"dialog-body\">\n {this.color !== undefined\n ? <road-icon class=\"dialog-icon\" part=\"dialog-icon\" color={this.color} icon={icon} aria-hidden=\"true\"></road-icon>\n : ''}\n <h2 class=\"dialog-title\">{this.label}</h2>\n <p class=\"dialog-description\" id=\"dialogDesc\">{this.description}</p>\n </div>\n <footer class=\"dialog-footer\">\n <slot/>\n </footer>\n </div>\n </div>\n </Host>\n );\n }\n}"]}
@@ -84,7 +84,7 @@ export class Drawer {
84
84
  const backIconElement = this.hasBackIcon ? h("button", { type: "button", class: "drawer-action", "aria-label": "Back", onClick: this.onClickBack }, h("road-icon", { icon: navigationChevron, rotate: "180" }), this.backText) : '';
85
85
  const closeIconElement = this.hasCloseIcon ? h("button", { type: "button", class: "drawer-close", onClick: this.onClick, "aria-label": "Close" }, h("road-icon", { icon: navigationClose, "aria-hidden": "true" })) : '';
86
86
  const drawerWidthValue = this.position === 'bottom' ? '100%' : this.drawerWidth + 'px';
87
- return (h(Host, { class: `${drawerIsOpenClass} drawer-${this.position}`, tabindex: "-1", role: "dialog" }, h("div", { class: "drawer-overlay", onClick: this.onClick, tabindex: "-1" }), h("div", { class: "drawer-dialog", style: { maxWidth: `${drawerWidthValue}` }, role: "document", tabindex: "0" }, h("div", { class: "drawer-content" }, h("header", { class: `drawer-header ${inverseHeaderClass} ${drawerDelimiterClass}` }, backIconElement, this.drawerTitle !== undefined ? h("h2", { class: "drawer-title" }, this.drawerTitle) : h("div", { class: "drawer-title" }, h("slot", { name: "title" })), closeIconElement), h("div", { class: "drawer-body" }, h("slot", null))))));
87
+ return (h(Host, { class: `${drawerIsOpenClass} drawer-${this.position}`, tabindex: "0", role: "dialog", "aria-label": "drawer" }, h("div", { class: "drawer-overlay", onClick: this.onClick, tabindex: "-1" }), h("div", { class: "drawer-dialog", style: { maxWidth: `${drawerWidthValue}` }, role: "document", tabindex: "0" }, h("div", { class: "drawer-content" }, h("header", { class: `drawer-header ${inverseHeaderClass} ${drawerDelimiterClass}` }, backIconElement, this.drawerTitle !== undefined ? h("h2", { class: "drawer-title" }, this.drawerTitle) : h("div", { class: "drawer-title" }, h("slot", { name: "title" })), closeIconElement), h("div", { class: "drawer-body" }, h("slot", null))))));
88
88
  }
89
89
  static get is() { return "road-drawer"; }
90
90
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../src/components/drawer/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Listen, Method, Prop, h, Host, Watch } from '@stencil/core';\nimport { navigationClose, navigationChevron } from '../../../icons';\n\n/**\n * @slot - Content of the drawer.\n * @slot title - replace the title with a custom title section when `'drawerTitle'` is not set\n *\n */\n\n@Component({\n tag: 'road-drawer',\n styleUrl: 'drawer.css',\n shadow: true,\n})\nexport class Drawer {\n\n /**\n * Current reference of the drawer\n */\n @Element() el!: HTMLRoadDrawerElement;\n\n /**\n * Set isOpen property to true to open the drawer\n */\n @Prop({ mutable: true }) isOpen: boolean = false;\n\n /**\n * position of the drawer. e.g. left, right, bottom\n */\n @Prop() position: string = 'left';\n\n /**\n * Width of the drawer\n */\n @Prop() drawerWidth: number = 480;\n\n /**\n * Inverse header colors\n */\n @Prop() hasInverseHeader: boolean = false;\n\n /**\n * Show / hide back icon\n */\n @Prop() hasBackIcon: boolean = false;\n\n /**\n * Show / hide back icon\n */\n @Prop() backText?: string;\n\n /**\n * Title of the drawer in the header bar\n */\n @Prop() drawerTitle?: string;\n\n /**\n * Show / hide close icon\n */\n @Prop() hasCloseIcon: boolean = true;\n\n /**\n * Indicate when opening the drawer\n */\n @Event({ eventName: 'open' }) onOpen!: EventEmitter<void>;\n\n /**\n * Indicate when closing the drawer\n */\n @Event({ eventName: 'close' }) onClose!: EventEmitter<void>;\n\n /**\n * Indicate when return to previous state of the drawer content\n */\n @Event({ eventName: 'back' }) onBack!: EventEmitter<void>;\n\n /**\n * Open the drawer\n */\n @Method()\n async open() {\n this.isOpen = true;\n }\n\n /**\n * Close the drawer\n */\n @Method()\n async close() {\n this.isOpen = false;\n }\n\n /**\n * Return to previous state of the drawer content\n */\n @Method()\n async back() {\n this.onBack.emit();\n }\n\n @Watch('isOpen')\n handleOpen(openValue: boolean) {\n if(openValue === true) {\n this.onOpen.emit();\n } else {\n this.el.addEventListener('transitionend', () => {\n this.onClose.emit();\n this.el.shadowRoot && ((this.el.shadowRoot.querySelector('.drawer-body') as HTMLElement).scrollTop = 0);\n }, { once: true});\n }\n }\n\n /**\n * Close the dialog when clicking on the cross or layer\n */\n private onClick = (ev: UIEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.close();\n };\n\n /**\n * Close the dialog when clicking on the cross or layer\n */\n private onClickBack = (event: MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n\n this.back();\n };\n\n /**\n * Close the dialog when press Escape key\n */\n @Listen('keyup', { target: 'document' })\n onEscape(event: KeyboardEvent) {\n if (event.key === 'Escape' || event.key === \"Esc\") {\n this.close();\n }\n }\n\n /**\n * Call close function when clicking an element with data-dismiss=\"modal\" attribute\n */\n componentDidLoad() {\n this.el.querySelectorAll('[data-dismiss=\"modal\"]').forEach(item => {\n item.addEventListener('click', () => this.close());\n });\n }\n\n render() {\n const drawerIsOpenClass = this.isOpen ? 'drawer-open' : '';\n const inverseHeaderClass = this.hasInverseHeader ? 'drawer-header-inverse' : '';\n const drawerDelimiterClass = this.drawerTitle !== undefined && !this.hasInverseHeader ? 'drawer-delimiter' : '';\n const backIconElement = this.hasBackIcon ? <button type=\"button\" class=\"drawer-action\" aria-label=\"Back\" onClick={this.onClickBack}><road-icon icon={navigationChevron} rotate=\"180\"></road-icon>{this.backText}</button> : '';\n const closeIconElement = this.hasCloseIcon ? <button type=\"button\" class=\"drawer-close\" onClick={this.onClick} aria-label=\"Close\"><road-icon icon={navigationClose} aria-hidden=\"true\"></road-icon></button> : '';\n const drawerWidthValue = this.position === 'bottom' ? '100%' : this.drawerWidth + 'px';\n\n return (\n <Host class={`${drawerIsOpenClass} drawer-${this.position}`} tabindex=\"-1\" role=\"dialog\">\n <div class=\"drawer-overlay\" onClick={this.onClick} tabindex=\"-1\"></div>\n <div class=\"drawer-dialog\" style={{ maxWidth: `${drawerWidthValue}` }} role=\"document\" tabindex=\"0\">\n <div class=\"drawer-content\">\n <header class={`drawer-header ${inverseHeaderClass} ${drawerDelimiterClass}`}>\n {backIconElement}\n {this.drawerTitle !== undefined ? <h2 class=\"drawer-title\">{this.drawerTitle}</h2> : <div class=\"drawer-title\"><slot name=\"title\" /></div>}\n {closeIconElement}\n </header>\n <div class=\"drawer-body\">\n <slot/>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../src/components/drawer/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEpE;;;;GAIG;AAOH,MAAM,OAAO,MAAM;;IAkGjB;;OAEG;IACK,YAAO,GAAG,CAAC,EAAW,EAAE,EAAE;MAChC,EAAE,CAAC,eAAe,EAAE,CAAC;MACrB,EAAE,CAAC,cAAc,EAAE,CAAC;MAEpB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC,CAAC;IAEF;;OAEG;IACK,gBAAW,GAAG,CAAC,KAAiB,EAAE,EAAE;MAC1C,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,KAAK,CAAC,cAAc,EAAE,CAAC;MAEvB,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC,CAAC;kBA1GyC,KAAK;oBAKrB,MAAM;uBAKH,GAAG;4BAKG,KAAK;uBAKV,KAAK;;;wBAeJ,IAAI;;EAiBpC;;KAEG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K,EAAC,eAAe,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,EAAE,EAAE,IAAI,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG;QACjG,WAAK,KAAK,EAAC,gBAAgB;UACzB,cAAQ,KAAK,EAAE,iBAAiB,kBAAkB,IAAI,oBAAoB,EAAE;YACzE,eAAe;YACf,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,UAAI,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,WAAW,CAAM,CAAC,CAAC,CAAC,WAAK,KAAK,EAAC,cAAc;cAAC,YAAM,IAAI,EAAC,OAAO,GAAG,CAAM;YACzI,gBAAgB,CACV;UACT,WAAK,KAAK,EAAC,aAAa;YACtB,eAAO,CACH,CACF,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Listen, Method, Prop, h, Host, Watch } from '@stencil/core';\nimport { navigationClose, navigationChevron } from '../../../icons';\n\n/**\n * @slot - Content of the drawer.\n * @slot title - replace the title with a custom title section when `'drawerTitle'` is not set\n *\n */\n\n@Component({\n tag: 'road-drawer',\n styleUrl: 'drawer.css',\n shadow: true,\n})\nexport class Drawer {\n\n /**\n * Current reference of the drawer\n */\n @Element() el!: HTMLRoadDrawerElement;\n\n /**\n * Set isOpen property to true to open the drawer\n */\n @Prop({ mutable: true }) isOpen: boolean = false;\n\n /**\n * position of the drawer. e.g. left, right, bottom\n */\n @Prop() position: string = 'left';\n\n /**\n * Width of the drawer\n */\n @Prop() drawerWidth: number = 480;\n\n /**\n * Inverse header colors\n */\n @Prop() hasInverseHeader: boolean = false;\n\n /**\n * Show / hide back icon\n */\n @Prop() hasBackIcon: boolean = false;\n\n /**\n * Show / hide back icon\n */\n @Prop() backText?: string;\n\n /**\n * Title of the drawer in the header bar\n */\n @Prop() drawerTitle?: string;\n\n /**\n * Show / hide close icon\n */\n @Prop() hasCloseIcon: boolean = true;\n\n /**\n * Indicate when opening the drawer\n */\n @Event({ eventName: 'open' }) onOpen!: EventEmitter<void>;\n\n /**\n * Indicate when closing the drawer\n */\n @Event({ eventName: 'close' }) onClose!: EventEmitter<void>;\n\n /**\n * Indicate when return to previous state of the drawer content\n */\n @Event({ eventName: 'back' }) onBack!: EventEmitter<void>;\n\n /**\n * Open the drawer\n */\n @Method()\n async open() {\n this.isOpen = true;\n }\n\n /**\n * Close the drawer\n */\n @Method()\n async close() {\n this.isOpen = false;\n }\n\n /**\n * Return to previous state of the drawer content\n */\n @Method()\n async back() {\n this.onBack.emit();\n }\n\n @Watch('isOpen')\n handleOpen(openValue: boolean) {\n if(openValue === true) {\n this.onOpen.emit();\n } else {\n this.el.addEventListener('transitionend', () => {\n this.onClose.emit();\n this.el.shadowRoot && ((this.el.shadowRoot.querySelector('.drawer-body') as HTMLElement).scrollTop = 0);\n }, { once: true});\n }\n }\n\n /**\n * Close the dialog when clicking on the cross or layer\n */\n private onClick = (ev: UIEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.close();\n };\n\n /**\n * Close the dialog when clicking on the cross or layer\n */\n private onClickBack = (event: MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n\n this.back();\n };\n\n /**\n * Close the dialog when press Escape key\n */\n @Listen('keyup', { target: 'document' })\n onEscape(event: KeyboardEvent) {\n if (event.key === 'Escape' || event.key === \"Esc\") {\n this.close();\n }\n }\n\n /**\n * Call close function when clicking an element with data-dismiss=\"modal\" attribute\n */\n componentDidLoad() {\n this.el.querySelectorAll('[data-dismiss=\"modal\"]').forEach(item => {\n item.addEventListener('click', () => this.close());\n });\n }\n\n render() {\n const drawerIsOpenClass = this.isOpen ? 'drawer-open' : '';\n const inverseHeaderClass = this.hasInverseHeader ? 'drawer-header-inverse' : '';\n const drawerDelimiterClass = this.drawerTitle !== undefined && !this.hasInverseHeader ? 'drawer-delimiter' : '';\n const backIconElement = this.hasBackIcon ? <button type=\"button\" class=\"drawer-action\" aria-label=\"Back\" onClick={this.onClickBack}><road-icon icon={navigationChevron} rotate=\"180\"></road-icon>{this.backText}</button> : '';\n const closeIconElement = this.hasCloseIcon ? <button type=\"button\" class=\"drawer-close\" onClick={this.onClick} aria-label=\"Close\"><road-icon icon={navigationClose} aria-hidden=\"true\"></road-icon></button> : '';\n const drawerWidthValue = this.position === 'bottom' ? '100%' : this.drawerWidth + 'px';\n\n return (\n <Host class={`${drawerIsOpenClass} drawer-${this.position}`} tabindex=\"0\" role=\"dialog\" aria-label=\"drawer\">\n <div class=\"drawer-overlay\" onClick={this.onClick} tabindex=\"-1\"></div>\n <div class=\"drawer-dialog\" style={{ maxWidth: `${drawerWidthValue}` }} role=\"document\" tabindex=\"0\">\n <div class=\"drawer-content\">\n <header class={`drawer-header ${inverseHeaderClass} ${drawerDelimiterClass}`}>\n {backIconElement}\n {this.drawerTitle !== undefined ? <h2 class=\"drawer-title\">{this.drawerTitle}</h2> : <div class=\"drawer-title\"><slot name=\"title\" /></div>}\n {closeIconElement}\n </header>\n <div class=\"drawer-body\">\n <slot/>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}"]}
@@ -194,9 +194,9 @@ customTitle.args = {
194
194
  position: 'right',
195
195
  'drawer-width': 480,
196
196
  title: `<div slot="title" class="d-flex align-items-center">
197
- <road-icon name="key" color="secondary" class="mr-16"></road-icon>
197
+ <road-icon name="key" color="secondary" class="mr-16" role="img"></road-icon>
198
198
  <road-text color="secondary">618</road-text>
199
- <road-icon name="multi-service-outline" color="secondary" class="ml-16"></road-icon>
199
+ <road-icon name="multi-service-outline" color="secondary" class="ml-16" role="img"></road-icon>
200
200
  </div>`,
201
201
  };
202
202
 
@@ -25,9 +25,18 @@
25
25
 
26
26
  .dropdown summary {
27
27
  display: block;
28
+ width: max-content;
29
+ background-color: var(--road-surface);
30
+ border-radius: 0.25rem;
28
31
  outline: none;
29
32
  }
30
33
 
34
+ .dropdown summary:focus,
35
+ .dropdown summary.focus-visible,
36
+ .dropdown summary:focus-within{
37
+ background: var(--road-surface-inverse);
38
+ }
39
+
31
40
  .dropdown summary::-webkit-details-marker { /* remove native arrow */
32
41
  display: none;
33
42
  }
@@ -48,10 +57,6 @@
48
57
  height: 2.5rem;
49
58
  }
50
59
 
51
- .dropdown-button:hover{
52
- background: var(--road-grey-200);
53
- }
54
-
55
60
  .position-right{
56
61
  display: flex;
57
62
  justify-content: flex-end;
@@ -19,12 +19,12 @@ export class Dropdown {
19
19
  this.isOpen = false;
20
20
  }
21
21
  render() {
22
- const isLightButtonDropDown = this.isLight ? 'dropdown-button' : 'dropdown-button bg-white';
23
- const isMediumButtonDropDown = this.isMedium ? 'dropdown-medium-button dropdown-button' : 'dropdown-button bg-white';
22
+ const isLightButtonDropDown = this.isLight ? 'dropdown-button' : 'dropdown-button';
23
+ const isMediumButtonDropDown = this.isMedium ? 'dropdown-medium-button dropdown-button' : 'dropdown-button';
24
24
  const positionClass = this.position ? `position-${this.position}` : '';
25
25
  const dropdownClass = this.position ? `dropdown-${this.position}` : '';
26
26
  const directionClass = this.direction ? `direction-${this.direction}` : '';
27
- return (h("details", { class: "dropdown", open: this.isOpen }, h("summary", { "aria-expanded": this.isOpen.toString(), tabindex: "0", role: "button", onClick: this.onClick }, h("div", { class: `d-flex ${positionClass}` }, h("div", { class: `${isLightButtonDropDown} ${isMediumButtonDropDown}` }, h("road-icon", { name: "navigation-more", class: "dropdown-button-icon" })))), h("div", { class: `dropdown-menu ${directionClass} ${dropdownClass}` }, h("slot", { name: "list" }))));
27
+ return (h("details", { class: "dropdown", open: this.isOpen }, h("summary", { "aria-expanded": this.isOpen.toString(), tabindex: "0", role: "button", onClick: this.onClick, "tab-index": "0" }, h("div", { class: `d-flex ${positionClass}` }, h("div", { class: `${isLightButtonDropDown} ${isMediumButtonDropDown}` }, h("road-icon", { name: "navigation-more", class: "dropdown-button-icon", "aria-hidden": "true" })))), h("div", { class: `dropdown-menu ${directionClass} ${dropdownClass}` }, h("slot", { name: "list" }))));
28
28
  }
29
29
  static get is() { return "road-dropdown"; }
30
30
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAOpE,MAAM,OAAO,QAAQ;;IAWX,YAAO,GAAG,GAAG,EAAE;MACrB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC,CAAC;kBARyC,KAAK;mBACrB,KAAK;oBACJ,KAAK;;qBAEuB,QAAQ;;EAOhE,mBAAmB,CAAC,EAAc;IAChC,sDAAsD;IACtD,IAAK,EAAE,CAAC,MAAsB,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC,EAAE,EAAE;MACnE,OAAO,CAAC,uDAAuD;KAChE;IACD,kDAAkD;IAClD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;EACtB,CAAC;EAED,MAAM;IACJ,MAAM,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,0BAA0B,CAAC;IAC5F,MAAM,sBAAsB,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,0BAA0B,CAAC;IACrH,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE3E,OAAO,CACL,eAAS,KAAK,EAAC,UAAU,EAAC,IAAI,EAAE,IAAI,CAAC,MAAM;MACzC,gCAAwB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAC,GAAG,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO;QAC9F,WAAK,KAAK,EAAE,UAAU,aAAa,EAAE;UACnC,WAAK,KAAK,EAAE,GAAG,qBAAqB,IAAI,sBAAsB,EAAE;YAC9D,iBAAW,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,sBAAsB,GAAa,CACvE,CACF,CACE;MACV,WAAK,KAAK,EAAE,iBAAiB,cAAc,IAAI,aAAa,EAAE;QAC5D,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACE,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Element, Prop, Listen } from '@stencil/core';\n\n@Component({\n tag: 'road-dropdown',\n styleUrl: 'dropdown.css',\n shadow: true,\n})\nexport class Dropdown {\n\n @Element() el!: HTMLRoadDropdownElement;\n\n\n @Prop({ mutable: true }) isOpen: boolean = false;\n @Prop() isLight: boolean = false;\n @Prop() isMedium: boolean = false;\n @Prop({ reflect: true }) position?: 'left' | 'right';\n @Prop({ reflect: true }) direction?: 'top' | 'bottom' = 'bottom';\n\n private onClick = () => {\n this.isOpen = !this.isOpen;\n };\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(ev: MouseEvent) {\n // Check if the clicked element is the dropdown button\n if ((ev.target as HTMLElement).closest('road-dropdown') === this.el) {\n return; // Do nothing if clicked element is the dropdown button\n }\n // Close dropdown if click is outside the dropdown\n this.isOpen = false;\n }\n\n render() {\n const isLightButtonDropDown = this.isLight ? 'dropdown-button' : 'dropdown-button bg-white';\n const isMediumButtonDropDown = this.isMedium ? 'dropdown-medium-button dropdown-button' : 'dropdown-button bg-white';\n const positionClass = this.position ? `position-${this.position}` : '';\n const dropdownClass = this.position ? `dropdown-${this.position}` : '';\n const directionClass = this.direction ? `direction-${this.direction}` : '';\n\n return (\n <details class=\"dropdown\" open={this.isOpen}>\n <summary aria-expanded={this.isOpen.toString()} tabindex=\"0\" role=\"button\" onClick={this.onClick}>\n <div class={`d-flex ${positionClass}`}>\n <div class={`${isLightButtonDropDown} ${isMediumButtonDropDown}`}>\n <road-icon name=\"navigation-more\" class=\"dropdown-button-icon\"></road-icon>\n </div>\n </div>\n </summary>\n <div class={`dropdown-menu ${directionClass} ${dropdownClass}`}>\n <slot name=\"list\" />\n </div>\n </details>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAOpE,MAAM,OAAO,QAAQ;;IAWX,YAAO,GAAG,GAAG,EAAE;MACrB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC,CAAC;kBARyC,KAAK;mBACrB,KAAK;oBACJ,KAAK;;qBAEuB,QAAQ;;EAOhE,mBAAmB,CAAC,EAAc;IAChC,s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AE,iBAAiB,cAAc,IAAI,aAAa,EAAE;QAC5D,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACE,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Element, Prop, Listen } from '@stencil/core';\n\n@Component({\n tag: 'road-dropdown',\n styleUrl: 'dropdown.css',\n shadow: true,\n})\nexport class Dropdown {\n\n @Element() el!: HTMLRoadDropdownElement;\n\n\n @Prop({ mutable: true }) isOpen: boolean = false;\n @Prop() isLight: boolean = false;\n @Prop() isMedium: boolean = false;\n @Prop({ reflect: true }) position?: 'left' | 'right';\n @Prop({ reflect: true }) direction?: 'top' | 'bottom' = 'bottom';\n\n private onClick = () => {\n this.isOpen = !this.isOpen;\n };\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(ev: MouseEvent) {\n // Check if the clicked element is the dropdown button\n if ((ev.target as HTMLElement).closest('road-dropdown') === this.el) {\n return; // Do nothing if clicked element is the dropdown button\n }\n // Close dropdown if click is outside the dropdown\n this.isOpen = false;\n }\n\n render() {\n const isLightButtonDropDown = this.isLight ? 'dropdown-button' : 'dropdown-button';\n const isMediumButtonDropDown = this.isMedium ? 'dropdown-medium-button dropdown-button' : 'dropdown-button';\n const positionClass = this.position ? `position-${this.position}` : '';\n const dropdownClass = this.position ? `dropdown-${this.position}` : '';\n const directionClass = this.direction ? `direction-${this.direction}` : '';\n\n return (\n <details class=\"dropdown\" open={this.isOpen}>\n <summary aria-expanded={this.isOpen.toString()} tabindex=\"0\" role=\"button\" onClick={this.onClick} tab-index=\"0\">\n <div class={`d-flex ${positionClass}`}>\n <div class={`${isLightButtonDropDown} ${isMediumButtonDropDown}`}>\n <road-icon name=\"navigation-more\" class=\"dropdown-button-icon\" aria-hidden=\"true\"></road-icon>\n </div>\n </div>\n </summary>\n <div class={`dropdown-menu ${directionClass} ${dropdownClass}`}>\n <slot name=\"list\" />\n </div>\n </details>\n );\n }\n}\n"]}