@mozaic-ds/web-components 0.12.0 → 0.14.0-beta.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 (501) hide show
  1. package/README.md +2 -1
  2. package/package.json +3 -3
  3. package/public/{adeo/EventForward-8492ff62.js → EventForward-422700d7.js} +2 -2
  4. package/public/{EventForward-8492ff62.js.map → EventForward-422700d7.js.map} +1 -1
  5. package/public/{EventHandler-02058705.js → EventHandler-f4efd23c.js} +2 -2
  6. package/public/{EventHandler-02058705.js.map → EventHandler-f4efd23c.js.map} +1 -1
  7. package/public/{bricoman/EventForward-8492ff62.js → adeo/EventForward-422700d7.js} +2 -2
  8. package/public/adeo/{EventForward-8492ff62.js.map → EventForward-422700d7.js.map} +1 -1
  9. package/public/adeo/{EventHandler-02058705.js → EventHandler-f4efd23c.js} +2 -2
  10. package/public/adeo/{EventHandler-02058705.js.map → EventHandler-f4efd23c.js.map} +1 -1
  11. package/public/adeo/bundle.js +20 -0
  12. package/public/adeo/components/accordion/Accordion.js +1 -1
  13. package/public/adeo/components/actionbar/ActionBar.js +2 -0
  14. package/public/adeo/components/actionbar/ActionBar.js.map +1 -0
  15. package/public/adeo/components/actionbar/ActionBar.svelte +97 -0
  16. package/public/adeo/components/autocomplete/Autocomplete.js +1 -1
  17. package/public/adeo/components/autocomplete/Autocomplete.js.map +1 -1
  18. package/public/adeo/components/badge/Badge.js +1 -1
  19. package/public/adeo/components/badge/Badge.nested.js +1 -1
  20. package/public/adeo/components/bottombar/BottomBar.js +2 -0
  21. package/public/adeo/components/bottombar/BottomBar.js.map +1 -0
  22. package/public/adeo/components/bottombar/BottomBar.svelte +18 -0
  23. package/public/adeo/components/breadcrumb/Breadcrumb.js +1 -1
  24. package/public/adeo/components/breadcrumb/Breadcrumb.nested.js +1 -1
  25. package/public/adeo/components/button/Button.js +1 -1
  26. package/public/adeo/components/button/Button.nested.js +2 -0
  27. package/public/adeo/components/button/Button.nested.js.map +1 -0
  28. package/public/adeo/components/button/Button.nested.svelte +173 -0
  29. package/public/adeo/components/card/Card.js +1 -1
  30. package/public/adeo/components/carousel/Carousel.js +2 -0
  31. package/public/adeo/components/carousel/Carousel.js.map +1 -0
  32. package/public/adeo/components/carousel/Carousel.svelte +414 -0
  33. package/public/adeo/components/carousel/CarouselCard.nested.js +2 -0
  34. package/public/adeo/components/carousel/CarouselCard.nested.js.map +1 -0
  35. package/public/adeo/components/carousel/carousel.types.d.ts +19 -0
  36. package/public/adeo/components/carousel/carousel.types.d.ts.map +1 -0
  37. package/public/adeo/components/carouselcard/CarouselCard.nested.svelte +37 -0
  38. package/public/adeo/components/chart/BarChart.js +1 -1
  39. package/public/adeo/components/chart/Donut.js +1 -1
  40. package/public/adeo/components/chart/GroupedBarChart.js +1 -1
  41. package/public/adeo/components/chart/LineChart.js +1 -1
  42. package/public/adeo/components/chart/Radar.js +1 -1
  43. package/public/adeo/components/chart/StackedBarChart.js +1 -1
  44. package/public/adeo/components/checkbox/Checkbox.js +1 -1
  45. package/public/adeo/components/checkboxgroup/checkboxGroup.js +1 -1
  46. package/public/adeo/components/checkboxgroup/checkboxgroup.types.d.ts.map +1 -1
  47. package/public/adeo/components/datatable/DataTable.js +1 -1
  48. package/public/adeo/components/datatable/DataTable.js.map +1 -1
  49. package/public/adeo/components/datatable/DataTable.svelte +9 -4
  50. package/public/adeo/components/datatable/DataTableDefaultAction.nested.js +1 -1
  51. package/public/adeo/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
  52. package/public/adeo/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
  53. package/public/adeo/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
  54. package/public/adeo/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
  55. package/public/adeo/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
  56. package/public/adeo/components/datatable/DataTableDefaultSelection.nested.js +1 -1
  57. package/public/adeo/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
  58. package/public/adeo/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -1
  59. package/public/adeo/components/datatable/DataTableFooter.nested.js +1 -1
  60. package/public/adeo/components/datatable/datatable.types.d.ts +3 -0
  61. package/public/adeo/components/datatable/datatable.types.d.ts.map +1 -1
  62. package/public/adeo/components/datatabledefaultaction/DataTableDefaultAction.nested.svelte +6 -1
  63. package/public/adeo/components/datatabledefaultedtion/DataTableDefaultEdtion.nested.svelte +15 -10
  64. package/public/adeo/components/datatabledefaultselection/DataTableDefaultSelection.nested.svelte +0 -15
  65. package/public/adeo/components/dropdown/Dropdown.js +1 -1
  66. package/public/adeo/components/dropdown/Dropdown.js.map +1 -1
  67. package/public/adeo/components/field/Field.js +1 -1
  68. package/public/adeo/components/fileuploader/FileUploader.js +1 -1
  69. package/public/adeo/components/fileuploader/ResultFile.nested.js +1 -1
  70. package/public/adeo/components/flag/Flag.js +1 -1
  71. package/public/adeo/components/header/Header.js +1 -1
  72. package/public/adeo/components/header/Header.js.map +1 -1
  73. package/public/adeo/components/header/Header.svelte +1 -1
  74. package/public/adeo/components/header/Header.types.d.ts.map +1 -1
  75. package/public/adeo/components/header/_c.header.scss +310 -0
  76. package/public/adeo/components/header/_s.header.scss +28 -0
  77. package/public/adeo/components/hero/Hero.js +1 -1
  78. package/public/adeo/components/kpi/Kpi.js +1 -1
  79. package/public/adeo/components/layer/Layer.js +1 -1
  80. package/public/adeo/components/layer/Layer.js.map +1 -1
  81. package/public/adeo/components/layer/Layer.svelte +6 -3
  82. package/public/adeo/components/layer/layer.types.d.ts +2 -0
  83. package/public/adeo/components/layer/layer.types.d.ts.map +1 -0
  84. package/public/adeo/components/link/Link.js +1 -1
  85. package/public/adeo/components/link/Link.nested.js +2 -0
  86. package/public/adeo/components/link/Link.nested.js.map +1 -0
  87. package/public/adeo/components/link/Link.nested.svelte +78 -0
  88. package/public/adeo/components/listbox/Listbox.js +1 -1
  89. package/public/adeo/components/listbox/Listbox.nested.js +1 -1
  90. package/public/adeo/components/loader/Loader.js +1 -1
  91. package/public/adeo/components/loader/Loader.nested.js +1 -1
  92. package/public/adeo/components/loader/Loader.nested.js.map +1 -1
  93. package/public/adeo/components/menu/Menu.js +1 -1
  94. package/public/adeo/components/modal/Modal.js +1 -1
  95. package/public/adeo/components/notification/Notification.js +1 -1
  96. package/public/adeo/components/optionbutton/OptionButton.js +1 -1
  97. package/public/adeo/components/overlay/Overlay.js +1 -1
  98. package/public/adeo/components/overlay/OverlayLoader.js +1 -1
  99. package/public/adeo/components/pagination/Pagination.js +1 -1
  100. package/public/adeo/components/pagination/Pagination.js.map +1 -1
  101. package/public/adeo/components/passwordinput/PasswordInput.js +1 -1
  102. package/public/adeo/components/phonenumber/PhoneNumber.js +1 -1
  103. package/public/adeo/components/phonenumber/PhoneNumber.js.map +1 -1
  104. package/public/adeo/components/phonenumber/PhoneNumber.svelte +1 -1
  105. package/public/adeo/components/price/Price.js +1 -1
  106. package/public/adeo/components/progressbar/ProgressBar.js +1 -1
  107. package/public/adeo/components/progressbar/ProgressBar.js.map +1 -1
  108. package/public/adeo/components/progressbar/ProgressBar.svelte +5 -5
  109. package/public/adeo/components/quantityselector/QuantitySelector.js +1 -1
  110. package/public/adeo/components/quantityselector/QuantitySelector.js.map +1 -1
  111. package/public/adeo/components/quantityselector/QuantitySelector.svelte +1 -1
  112. package/public/adeo/components/radio/Radio.js +1 -1
  113. package/public/adeo/components/radiogroup/RadioGroup.js +1 -1
  114. package/public/adeo/components/radiogroup/radioGroup.types.d.ts.map +1 -1
  115. package/public/adeo/components/ratings/StarsInput.js +1 -1
  116. package/public/adeo/components/ratings/StarsResult.js +1 -1
  117. package/public/adeo/components/segmentedcontrol/SegmentedControl.js +1 -1
  118. package/public/adeo/components/select/Select.js +1 -1
  119. package/public/adeo/components/sidebar/Sidebar.js +1 -1
  120. package/public/adeo/components/sidebar/sidebar-feature-group.nested.js +1 -1
  121. package/public/adeo/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
  122. package/public/adeo/components/sidebar/sidebar-feature.nested.js +1 -1
  123. package/public/adeo/components/sidebar/sidebar-section.nested.js +1 -1
  124. package/public/adeo/components/sidebar/sidebar-segment.nested.js +1 -1
  125. package/public/adeo/components/sidebar/sidebar-segment.nested.js.map +1 -1
  126. package/public/adeo/components/sidebar/sidebar-separator.nested.js +1 -1
  127. package/public/adeo/components/sidebar/sidebar-service.d.ts.map +1 -1
  128. package/public/adeo/components/sidebar/sidebar-sub-features.nested.js +1 -1
  129. package/public/adeo/components/sidebar/sidebar-user.nested.js +1 -1
  130. package/public/adeo/components/sidebar/sidebar.types.d.ts.map +1 -1
  131. package/public/adeo/components/sidebar-feature-group/sidebar-feature-group.nested.svelte +6 -4
  132. package/public/adeo/components/sidebar-segment/sidebar-segment.nested.svelte +9 -8
  133. package/public/adeo/components/stepper/Stepper.js +1 -1
  134. package/public/adeo/components/stepperbar/StepperBar.js +2 -0
  135. package/public/adeo/components/stepperbar/StepperBar.js.map +1 -0
  136. package/public/adeo/components/stepperbar/StepperBar.svelte +86 -0
  137. package/public/adeo/components/tabs/Tabs.js +1 -1
  138. package/public/adeo/components/tabs/Tabs.js.map +1 -1
  139. package/public/adeo/components/tabs/Tabs.nested.js +1 -1
  140. package/public/adeo/components/tag/Tag.js +1 -1
  141. package/public/adeo/components/tag/Tag.nested.js +1 -1
  142. package/public/adeo/components/taglist/TagList.js +1 -1
  143. package/public/adeo/components/textarea/Textarea.js +1 -1
  144. package/public/adeo/components/textinput/Textinput.js +1 -1
  145. package/public/adeo/components/textinput/Textinput.js.map +1 -1
  146. package/public/adeo/components/textinput/Textinput.nested.js +1 -1
  147. package/public/adeo/components/textinput/Textinput.nested.js.map +1 -1
  148. package/public/adeo/components/textinput/Textinput.svelte +8 -0
  149. package/public/adeo/components/toggle/Toggle.js +1 -1
  150. package/public/adeo/components/tooltip/Tooltip.js +1 -1
  151. package/public/adeo/components/undefined/sidebar-variables.scss +9 -0
  152. package/public/adeo/{index-c33b3772.js → index-52f16292.js} +2 -2
  153. package/public/adeo/{index-c33b3772.js.map → index-52f16292.js.map} +1 -1
  154. package/public/adeo/index-64cccc06-4c960e34.js +2 -0
  155. package/public/adeo/index-64cccc06-4c960e34.js.map +1 -0
  156. package/public/adeo/main.d.ts +4 -0
  157. package/public/adeo/main.d.ts.map +1 -1
  158. package/public/adeo/{sidebar-service-275bf9ef.js → sidebar-service-293d79ef.js} +2 -2
  159. package/public/adeo/{sidebar-service-275bf9ef.js.map → sidebar-service-293d79ef.js.map} +1 -1
  160. package/public/adeo/stories/carousel/items.d.ts +3 -0
  161. package/public/adeo/stories/carousel/items.d.ts.map +1 -0
  162. package/public/{EventForward-8492ff62.js → bricoman/EventForward-422700d7.js} +2 -2
  163. package/public/bricoman/{EventForward-8492ff62.js.map → EventForward-422700d7.js.map} +1 -1
  164. package/public/bricoman/{EventHandler-02058705.js → EventHandler-f4efd23c.js} +2 -2
  165. package/public/bricoman/{EventHandler-02058705.js.map → EventHandler-f4efd23c.js.map} +1 -1
  166. package/public/bricoman/bundle.js +20 -0
  167. package/public/bricoman/components/accordion/Accordion.js +1 -1
  168. package/public/bricoman/components/actionbar/ActionBar.js +2 -0
  169. package/public/bricoman/components/actionbar/ActionBar.js.map +1 -0
  170. package/public/bricoman/components/actionbar/ActionBar.svelte +97 -0
  171. package/public/bricoman/components/autocomplete/Autocomplete.js +1 -1
  172. package/public/bricoman/components/autocomplete/Autocomplete.js.map +1 -1
  173. package/public/bricoman/components/badge/Badge.js +1 -1
  174. package/public/bricoman/components/badge/Badge.nested.js +1 -1
  175. package/public/bricoman/components/bottombar/BottomBar.js +2 -0
  176. package/public/bricoman/components/bottombar/BottomBar.js.map +1 -0
  177. package/public/bricoman/components/bottombar/BottomBar.svelte +18 -0
  178. package/public/bricoman/components/breadcrumb/Breadcrumb.js +1 -1
  179. package/public/bricoman/components/breadcrumb/Breadcrumb.nested.js +1 -1
  180. package/public/bricoman/components/button/Button.js +1 -1
  181. package/public/bricoman/components/button/Button.nested.js +2 -0
  182. package/public/bricoman/components/button/Button.nested.js.map +1 -0
  183. package/public/bricoman/components/button/Button.nested.svelte +173 -0
  184. package/public/bricoman/components/card/Card.js +1 -1
  185. package/public/bricoman/components/carousel/Carousel.js +2 -0
  186. package/public/bricoman/components/carousel/Carousel.js.map +1 -0
  187. package/public/bricoman/components/carousel/Carousel.svelte +414 -0
  188. package/public/bricoman/components/carousel/CarouselCard.nested.js +2 -0
  189. package/public/bricoman/components/carousel/CarouselCard.nested.js.map +1 -0
  190. package/public/bricoman/components/carousel/carousel.types.d.ts +19 -0
  191. package/public/bricoman/components/carousel/carousel.types.d.ts.map +1 -0
  192. package/public/bricoman/components/carouselcard/CarouselCard.nested.svelte +37 -0
  193. package/public/bricoman/components/chart/BarChart.js +1 -1
  194. package/public/bricoman/components/chart/Donut.js +1 -1
  195. package/public/bricoman/components/chart/GroupedBarChart.js +1 -1
  196. package/public/bricoman/components/chart/LineChart.js +1 -1
  197. package/public/bricoman/components/chart/Radar.js +1 -1
  198. package/public/bricoman/components/chart/StackedBarChart.js +1 -1
  199. package/public/bricoman/components/checkbox/Checkbox.js +1 -1
  200. package/public/bricoman/components/checkboxgroup/checkboxGroup.js +1 -1
  201. package/public/bricoman/components/checkboxgroup/checkboxgroup.types.d.ts.map +1 -1
  202. package/public/bricoman/components/datatable/DataTable.js +1 -1
  203. package/public/bricoman/components/datatable/DataTable.js.map +1 -1
  204. package/public/bricoman/components/datatable/DataTable.svelte +9 -4
  205. package/public/bricoman/components/datatable/DataTableDefaultAction.nested.js +1 -1
  206. package/public/bricoman/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
  207. package/public/bricoman/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
  208. package/public/bricoman/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
  209. package/public/bricoman/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
  210. package/public/bricoman/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
  211. package/public/bricoman/components/datatable/DataTableDefaultSelection.nested.js +1 -1
  212. package/public/bricoman/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
  213. package/public/bricoman/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -1
  214. package/public/bricoman/components/datatable/DataTableFooter.nested.js +1 -1
  215. package/public/bricoman/components/datatable/datatable.types.d.ts +3 -0
  216. package/public/bricoman/components/datatable/datatable.types.d.ts.map +1 -1
  217. package/public/bricoman/components/datatabledefaultaction/DataTableDefaultAction.nested.svelte +6 -1
  218. package/public/bricoman/components/datatabledefaultedtion/DataTableDefaultEdtion.nested.svelte +15 -10
  219. package/public/bricoman/components/datatabledefaultselection/DataTableDefaultSelection.nested.svelte +0 -15
  220. package/public/bricoman/components/dropdown/Dropdown.js +1 -1
  221. package/public/bricoman/components/dropdown/Dropdown.js.map +1 -1
  222. package/public/bricoman/components/field/Field.js +1 -1
  223. package/public/bricoman/components/fileuploader/FileUploader.js +1 -1
  224. package/public/bricoman/components/fileuploader/ResultFile.nested.js +1 -1
  225. package/public/bricoman/components/flag/Flag.js +1 -1
  226. package/public/bricoman/components/flag/Flag.js.map +1 -1
  227. package/public/bricoman/components/header/Header.js +1 -1
  228. package/public/bricoman/components/header/Header.js.map +1 -1
  229. package/public/bricoman/components/header/Header.svelte +1 -1
  230. package/public/bricoman/components/header/Header.types.d.ts.map +1 -1
  231. package/public/bricoman/components/header/_c.header.scss +310 -0
  232. package/public/bricoman/components/header/_s.header.scss +28 -0
  233. package/public/bricoman/components/hero/Hero.js +1 -1
  234. package/public/bricoman/components/kpi/Kpi.js +1 -1
  235. package/public/bricoman/components/layer/Layer.js +1 -1
  236. package/public/bricoman/components/layer/Layer.js.map +1 -1
  237. package/public/bricoman/components/layer/Layer.svelte +6 -3
  238. package/public/bricoman/components/layer/layer.types.d.ts +2 -0
  239. package/public/bricoman/components/layer/layer.types.d.ts.map +1 -0
  240. package/public/bricoman/components/link/Link.js +1 -1
  241. package/public/bricoman/components/link/Link.nested.js +2 -0
  242. package/public/bricoman/components/link/Link.nested.js.map +1 -0
  243. package/public/bricoman/components/link/Link.nested.svelte +78 -0
  244. package/public/bricoman/components/listbox/Listbox.js +1 -1
  245. package/public/bricoman/components/listbox/Listbox.nested.js +1 -1
  246. package/public/bricoman/components/loader/Loader.js +1 -1
  247. package/public/bricoman/components/loader/Loader.nested.js +1 -1
  248. package/public/bricoman/components/menu/Menu.js +1 -1
  249. package/public/bricoman/components/modal/Modal.js +1 -1
  250. package/public/bricoman/components/notification/Notification.js +1 -1
  251. package/public/bricoman/components/optionbutton/OptionButton.js +1 -1
  252. package/public/bricoman/components/overlay/Overlay.js +1 -1
  253. package/public/bricoman/components/overlay/OverlayLoader.js +1 -1
  254. package/public/bricoman/components/pagination/Pagination.js +1 -1
  255. package/public/bricoman/components/pagination/Pagination.js.map +1 -1
  256. package/public/bricoman/components/passwordinput/PasswordInput.js +1 -1
  257. package/public/bricoman/components/phonenumber/PhoneNumber.js +1 -1
  258. package/public/bricoman/components/phonenumber/PhoneNumber.js.map +1 -1
  259. package/public/bricoman/components/phonenumber/PhoneNumber.svelte +1 -1
  260. package/public/bricoman/components/price/Price.js +1 -1
  261. package/public/bricoman/components/progressbar/ProgressBar.js +1 -1
  262. package/public/bricoman/components/progressbar/ProgressBar.js.map +1 -1
  263. package/public/bricoman/components/progressbar/ProgressBar.svelte +5 -5
  264. package/public/bricoman/components/quantityselector/QuantitySelector.js +1 -1
  265. package/public/bricoman/components/quantityselector/QuantitySelector.js.map +1 -1
  266. package/public/bricoman/components/quantityselector/QuantitySelector.svelte +1 -1
  267. package/public/bricoman/components/radio/Radio.js +1 -1
  268. package/public/bricoman/components/radiogroup/RadioGroup.js +1 -1
  269. package/public/bricoman/components/radiogroup/radioGroup.types.d.ts.map +1 -1
  270. package/public/bricoman/components/ratings/StarsInput.js +1 -1
  271. package/public/bricoman/components/ratings/StarsResult.js +1 -1
  272. package/public/bricoman/components/segmentedcontrol/SegmentedControl.js +1 -1
  273. package/public/bricoman/components/select/Select.js +1 -1
  274. package/public/bricoman/components/sidebar/Sidebar.js +1 -1
  275. package/public/bricoman/components/sidebar/sidebar-feature-group.nested.js +1 -1
  276. package/public/bricoman/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
  277. package/public/bricoman/components/sidebar/sidebar-feature.nested.js +1 -1
  278. package/public/bricoman/components/sidebar/sidebar-section.nested.js +1 -1
  279. package/public/bricoman/components/sidebar/sidebar-segment.nested.js +1 -1
  280. package/public/bricoman/components/sidebar/sidebar-segment.nested.js.map +1 -1
  281. package/public/bricoman/components/sidebar/sidebar-separator.nested.js +1 -1
  282. package/public/bricoman/components/sidebar/sidebar-service.d.ts.map +1 -1
  283. package/public/bricoman/components/sidebar/sidebar-sub-features.nested.js +1 -1
  284. package/public/bricoman/components/sidebar/sidebar-user.nested.js +1 -1
  285. package/public/bricoman/components/sidebar/sidebar-user.nested.js.map +1 -1
  286. package/public/bricoman/components/sidebar/sidebar.types.d.ts.map +1 -1
  287. package/public/bricoman/components/sidebar-feature-group/sidebar-feature-group.nested.svelte +6 -4
  288. package/public/bricoman/components/sidebar-segment/sidebar-segment.nested.svelte +9 -8
  289. package/public/bricoman/components/stepper/Stepper.js +1 -1
  290. package/public/bricoman/components/stepperbar/StepperBar.js +2 -0
  291. package/public/bricoman/components/stepperbar/StepperBar.js.map +1 -0
  292. package/public/bricoman/components/stepperbar/StepperBar.svelte +86 -0
  293. package/public/bricoman/components/tabs/Tabs.js +1 -1
  294. package/public/bricoman/components/tabs/Tabs.js.map +1 -1
  295. package/public/bricoman/components/tabs/Tabs.nested.js +1 -1
  296. package/public/bricoman/components/tag/Tag.js +1 -1
  297. package/public/bricoman/components/tag/Tag.nested.js +1 -1
  298. package/public/bricoman/components/taglist/TagList.js +1 -1
  299. package/public/bricoman/components/textarea/Textarea.js +1 -1
  300. package/public/bricoman/components/textinput/Textinput.js +1 -1
  301. package/public/bricoman/components/textinput/Textinput.js.map +1 -1
  302. package/public/bricoman/components/textinput/Textinput.nested.js +1 -1
  303. package/public/bricoman/components/textinput/Textinput.nested.js.map +1 -1
  304. package/public/bricoman/components/textinput/Textinput.svelte +8 -0
  305. package/public/bricoman/components/toggle/Toggle.js +1 -1
  306. package/public/bricoman/components/tooltip/Tooltip.js +1 -1
  307. package/public/bricoman/components/undefined/sidebar-variables.scss +9 -0
  308. package/public/bricoman/{index-c33b3772.js → index-52f16292.js} +2 -2
  309. package/public/bricoman/{index-c33b3772.js.map → index-52f16292.js.map} +1 -1
  310. package/public/bricoman/index-64cccc06-4c960e34.js +2 -0
  311. package/public/bricoman/index-64cccc06-4c960e34.js.map +1 -0
  312. package/public/bricoman/main.d.ts +4 -0
  313. package/public/bricoman/main.d.ts.map +1 -1
  314. package/public/bricoman/{sidebar-service-275bf9ef.js → sidebar-service-293d79ef.js} +2 -2
  315. package/public/bricoman/{sidebar-service-275bf9ef.js.map → sidebar-service-293d79ef.js.map} +1 -1
  316. package/public/bricoman/stories/carousel/items.d.ts +3 -0
  317. package/public/bricoman/stories/carousel/items.d.ts.map +1 -0
  318. package/public/bundle.js +20 -0
  319. package/public/components/accordion/Accordion.js +1 -1
  320. package/public/components/actionbar/ActionBar.js +2 -0
  321. package/public/components/actionbar/ActionBar.js.map +1 -0
  322. package/public/components/actionbar/ActionBar.svelte +97 -0
  323. package/public/components/autocomplete/Autocomplete.js +1 -1
  324. package/public/components/autocomplete/Autocomplete.js.map +1 -1
  325. package/public/components/badge/Badge.js +1 -1
  326. package/public/components/badge/Badge.nested.js +1 -1
  327. package/public/components/bottombar/BottomBar.js +2 -0
  328. package/public/components/bottombar/BottomBar.js.map +1 -0
  329. package/public/components/bottombar/BottomBar.svelte +18 -0
  330. package/public/components/breadcrumb/Breadcrumb.js +1 -1
  331. package/public/components/breadcrumb/Breadcrumb.nested.js +1 -1
  332. package/public/components/button/Button.js +1 -1
  333. package/public/components/button/Button.nested.js +2 -0
  334. package/public/components/button/Button.nested.js.map +1 -0
  335. package/public/components/button/Button.nested.svelte +173 -0
  336. package/public/components/card/Card.js +1 -1
  337. package/public/components/carousel/Carousel.js +2 -0
  338. package/public/components/carousel/Carousel.js.map +1 -0
  339. package/public/components/carousel/Carousel.svelte +414 -0
  340. package/public/components/carousel/CarouselCard.nested.js +2 -0
  341. package/public/components/carousel/CarouselCard.nested.js.map +1 -0
  342. package/public/components/carousel/carousel.types.d.ts +19 -0
  343. package/public/components/carousel/carousel.types.d.ts.map +1 -0
  344. package/public/components/carouselcard/CarouselCard.nested.svelte +37 -0
  345. package/public/components/chart/BarChart.js +1 -1
  346. package/public/components/chart/Donut.js +1 -1
  347. package/public/components/chart/GroupedBarChart.js +1 -1
  348. package/public/components/chart/LineChart.js +1 -1
  349. package/public/components/chart/Radar.js +1 -1
  350. package/public/components/chart/StackedBarChart.js +1 -1
  351. package/public/components/checkbox/Checkbox.js +1 -1
  352. package/public/components/checkboxgroup/checkboxGroup.js +1 -1
  353. package/public/components/checkboxgroup/checkboxgroup.types.d.ts.map +1 -1
  354. package/public/components/datatable/DataTable.js +1 -1
  355. package/public/components/datatable/DataTable.js.map +1 -1
  356. package/public/components/datatable/DataTable.svelte +9 -4
  357. package/public/components/datatable/DataTableDefaultAction.nested.js +1 -1
  358. package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
  359. package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
  360. package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
  361. package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
  362. package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
  363. package/public/components/datatable/DataTableDefaultSelection.nested.js +1 -1
  364. package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
  365. package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -1
  366. package/public/components/datatable/DataTableFooter.nested.js +1 -1
  367. package/public/components/datatable/datatable.types.d.ts +3 -0
  368. package/public/components/datatable/datatable.types.d.ts.map +1 -1
  369. package/public/components/datatabledefaultaction/DataTableDefaultAction.nested.svelte +6 -1
  370. package/public/components/datatabledefaultedtion/DataTableDefaultEdtion.nested.svelte +15 -10
  371. package/public/components/datatabledefaultselection/DataTableDefaultSelection.nested.svelte +0 -15
  372. package/public/components/dropdown/Dropdown.js +1 -1
  373. package/public/components/dropdown/Dropdown.js.map +1 -1
  374. package/public/components/field/Field.js +1 -1
  375. package/public/components/fileuploader/FileUploader.js +1 -1
  376. package/public/components/fileuploader/ResultFile.nested.js +1 -1
  377. package/public/components/flag/Flag.js +1 -1
  378. package/public/components/flag/Flag.js.map +1 -1
  379. package/public/components/header/Header.js +1 -1
  380. package/public/components/header/Header.js.map +1 -1
  381. package/public/components/header/Header.svelte +1 -1
  382. package/public/components/header/Header.types.d.ts.map +1 -1
  383. package/public/components/header/_c.header.scss +310 -0
  384. package/public/components/header/_s.header.scss +28 -0
  385. package/public/components/hero/Hero.js +1 -1
  386. package/public/components/kpi/Kpi.js +1 -1
  387. package/public/components/layer/Layer.js +1 -1
  388. package/public/components/layer/Layer.js.map +1 -1
  389. package/public/components/layer/Layer.svelte +6 -3
  390. package/public/components/layer/layer.types.d.ts +2 -0
  391. package/public/components/layer/layer.types.d.ts.map +1 -0
  392. package/public/components/link/Link.js +1 -1
  393. package/public/components/link/Link.nested.js +2 -0
  394. package/public/components/link/Link.nested.js.map +1 -0
  395. package/public/components/link/Link.nested.svelte +78 -0
  396. package/public/components/listbox/Listbox.js +1 -1
  397. package/public/components/listbox/Listbox.nested.js +1 -1
  398. package/public/components/loader/Loader.js +1 -1
  399. package/public/components/loader/Loader.js.map +1 -1
  400. package/public/components/loader/Loader.nested.js +1 -1
  401. package/public/components/menu/Menu.js +1 -1
  402. package/public/components/modal/Modal.js +1 -1
  403. package/public/components/notification/Notification.js +1 -1
  404. package/public/components/optionbutton/OptionButton.js +1 -1
  405. package/public/components/overlay/Overlay.js +1 -1
  406. package/public/components/overlay/OverlayLoader.js +1 -1
  407. package/public/components/pagination/Pagination.js +1 -1
  408. package/public/components/pagination/Pagination.js.map +1 -1
  409. package/public/components/passwordinput/PasswordInput.js +1 -1
  410. package/public/components/phonenumber/PhoneNumber.js +1 -1
  411. package/public/components/phonenumber/PhoneNumber.js.map +1 -1
  412. package/public/components/phonenumber/PhoneNumber.svelte +1 -1
  413. package/public/components/price/Price.js +1 -1
  414. package/public/components/progressbar/ProgressBar.js +1 -1
  415. package/public/components/progressbar/ProgressBar.js.map +1 -1
  416. package/public/components/progressbar/ProgressBar.svelte +5 -5
  417. package/public/components/quantityselector/QuantitySelector.js +1 -1
  418. package/public/components/quantityselector/QuantitySelector.js.map +1 -1
  419. package/public/components/quantityselector/QuantitySelector.svelte +1 -1
  420. package/public/components/radio/Radio.js +1 -1
  421. package/public/components/radiogroup/RadioGroup.js +1 -1
  422. package/public/components/radiogroup/radioGroup.types.d.ts.map +1 -1
  423. package/public/components/ratings/StarsInput.js +1 -1
  424. package/public/components/ratings/StarsResult.js +1 -1
  425. package/public/components/segmentedcontrol/SegmentedControl.js +1 -1
  426. package/public/components/select/Select.js +1 -1
  427. package/public/components/sidebar/Sidebar.js +1 -1
  428. package/public/components/sidebar/sidebar-feature-group.nested.js +1 -1
  429. package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
  430. package/public/components/sidebar/sidebar-feature.nested.js +1 -1
  431. package/public/components/sidebar/sidebar-section.nested.js +1 -1
  432. package/public/components/sidebar/sidebar-segment.nested.js +1 -1
  433. package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
  434. package/public/components/sidebar/sidebar-separator.nested.js +1 -1
  435. package/public/components/sidebar/sidebar-service.d.ts.map +1 -1
  436. package/public/components/sidebar/sidebar-sub-features.nested.js +1 -1
  437. package/public/components/sidebar/sidebar-user.nested.js +1 -1
  438. package/public/components/sidebar/sidebar.types.d.ts.map +1 -1
  439. package/public/components/sidebar-feature-group/sidebar-feature-group.nested.svelte +6 -4
  440. package/public/components/sidebar-segment/sidebar-segment.nested.svelte +9 -8
  441. package/public/components/stepper/Stepper.js +1 -1
  442. package/public/components/stepperbar/StepperBar.js +2 -0
  443. package/public/components/stepperbar/StepperBar.js.map +1 -0
  444. package/public/components/stepperbar/StepperBar.svelte +86 -0
  445. package/public/components/tabs/Tabs.js +1 -1
  446. package/public/components/tabs/Tabs.js.map +1 -1
  447. package/public/components/tabs/Tabs.nested.js +1 -1
  448. package/public/components/tag/Tag.js +1 -1
  449. package/public/components/tag/Tag.nested.js +1 -1
  450. package/public/components/taglist/TagList.js +1 -1
  451. package/public/components/textarea/Textarea.js +1 -1
  452. package/public/components/textinput/Textinput.js +1 -1
  453. package/public/components/textinput/Textinput.js.map +1 -1
  454. package/public/components/textinput/Textinput.nested.js +1 -1
  455. package/public/components/textinput/Textinput.nested.js.map +1 -1
  456. package/public/components/textinput/Textinput.svelte +8 -0
  457. package/public/components/toggle/Toggle.js +1 -1
  458. package/public/components/tooltip/Tooltip.js +1 -1
  459. package/public/components/undefined/sidebar-variables.scss +9 -0
  460. package/public/{index-c33b3772.js → index-52f16292.js} +2 -2
  461. package/public/{index-c33b3772.js.map → index-52f16292.js.map} +1 -1
  462. package/public/index-64cccc06-4c960e34.js +2 -0
  463. package/public/index-64cccc06-4c960e34.js.map +1 -0
  464. package/public/main.d.ts +4 -0
  465. package/public/main.d.ts.map +1 -1
  466. package/public/{sidebar-service-275bf9ef.js → sidebar-service-293d79ef.js} +2 -2
  467. package/public/{sidebar-service-275bf9ef.js.map → sidebar-service-293d79ef.js.map} +1 -1
  468. package/public/stories/carousel/items.d.ts +3 -0
  469. package/public/stories/carousel/items.d.ts.map +1 -0
  470. package/public/utilities/components/carousel/carousel.types.d.ts +19 -0
  471. package/public/utilities/components/carousel/carousel.types.d.ts.map +1 -0
  472. package/public/utilities/components/checkboxgroup/checkboxgroup.types.d.ts.map +1 -1
  473. package/public/utilities/components/datatable/datatable.types.d.ts +3 -0
  474. package/public/utilities/components/datatable/datatable.types.d.ts.map +1 -1
  475. package/public/utilities/components/header/Header.types.d.ts.map +1 -1
  476. package/public/utilities/components/layer/layer.types.d.ts +2 -0
  477. package/public/utilities/components/layer/layer.types.d.ts.map +1 -0
  478. package/public/utilities/components/radiogroup/radioGroup.types.d.ts.map +1 -1
  479. package/public/utilities/components/sidebar/sidebar-service.d.ts.map +1 -1
  480. package/public/utilities/components/sidebar/sidebar.types.d.ts.map +1 -1
  481. package/public/utilities/main.d.ts +4 -0
  482. package/public/utilities/main.d.ts.map +1 -1
  483. package/public/utilities/stories/actionbar/ActionBar.stories.d.ts +7 -0
  484. package/public/utilities/stories/actionbar/ActionBar.stories.d.ts.map +1 -0
  485. package/public/utilities/stories/bottombar/BottomBar.stories.d.ts +6 -0
  486. package/public/utilities/stories/bottombar/BottomBar.stories.d.ts.map +1 -0
  487. package/public/utilities/stories/carousel/Carousel.stories.d.ts +8 -0
  488. package/public/utilities/stories/carousel/Carousel.stories.d.ts.map +1 -0
  489. package/public/utilities/stories/carousel/items.d.ts +3 -0
  490. package/public/utilities/stories/carousel/items.d.ts.map +1 -0
  491. package/public/utilities/stories/datatable/DataTable.stories.d.ts.map +1 -1
  492. package/public/utilities/stories/layer/Layer.stories.d.ts +1 -0
  493. package/public/utilities/stories/layer/Layer.stories.d.ts.map +1 -1
  494. package/public/utilities/stories/stepperbar/StepperBar.stories.d.ts +6 -0
  495. package/public/utilities/stories/stepperbar/StepperBar.stories.d.ts.map +1 -0
  496. package/public/DataTableDefaultAction.nested-e758217a.js +0 -2
  497. package/public/DataTableDefaultAction.nested-e758217a.js.map +0 -1
  498. package/public/adeo/DataTableDefaultAction.nested-be8d4e7b.js +0 -2
  499. package/public/adeo/DataTableDefaultAction.nested-be8d4e7b.js.map +0 -1
  500. package/public/bricoman/DataTableDefaultAction.nested-41f58b1f.js +0 -2
  501. package/public/bricoman/DataTableDefaultAction.nested-41f58b1f.js.map +0 -1
@@ -0,0 +1,414 @@
1
+ <svelte:options tag={null} />
2
+
3
+ <script lang="ts">
4
+ import type {
5
+ CarouselDevice,
6
+ CarouselItem,
7
+ CarouselOptions,
8
+ CarouselTitleTag,
9
+ } from './carousel.types';
10
+ import Link from '../link/Link.nested.svelte';
11
+ import CarouselCard from './CarouselCard.nested.svelte';
12
+ import Button from '../button/Button.nested.svelte';
13
+ import { EventHandler } from '../../utilities/EventHandler';
14
+ import { onMount } from 'svelte';
15
+
16
+ export let title: string;
17
+ export let titletag: CarouselTitleTag = 'h1';
18
+ export let subtitlelink: string;
19
+ export let mobile = false;
20
+ export let options: string;
21
+ export let items: string;
22
+
23
+ const mediaQueryS: MediaQueryList = window.matchMedia('(max-width: 679px)');
24
+ const mediaQueryM: MediaQueryList = window.matchMedia(
25
+ '(min-width: 680px) and (max-width: 1279px)',
26
+ );
27
+ const mediaQueryXL: MediaQueryList = window.matchMedia('(min-width: 1280px)');
28
+
29
+ // default options for all 3 screen sizes (s = <m ; m = >=m to <xl ; xl = >=xl)
30
+ const defaultCarouselOptions: CarouselOptions = {
31
+ s: {
32
+ itemsVisible: 1,
33
+ hasHalfItemVisible: true,
34
+ },
35
+ m: {
36
+ itemsVisible: 3,
37
+ hasHalfItemVisible: false,
38
+ },
39
+ xl: {
40
+ itemsVisible: 5,
41
+ hasHalfItemVisible: false,
42
+ },
43
+ };
44
+
45
+ // size using to separate item. Useful for gap in css and for move the scroll.
46
+ let betweenItemsPixelSize = 16;
47
+
48
+ // needed padding to display the outlined focus border on carousel items
49
+ let accessibilityFocusPadding = 4;
50
+
51
+ let eventHandler = new EventHandler();
52
+
53
+ let currentDevice: CarouselDevice = initCurrentDevice(
54
+ mediaQueryM,
55
+ mediaQueryXL,
56
+ );
57
+
58
+ let carouselContainer: HTMLDivElement;
59
+ let carouselScrollbarLeft = 0;
60
+
61
+ let isScrollBeginning = true;
62
+ let isScrollEnd = false;
63
+
64
+ $: carouselItems = items ? (JSON.parse(items) as CarouselItem[]) : [];
65
+ $: carouselOptions = options
66
+ ? Object.assign(
67
+ {},
68
+ defaultCarouselOptions,
69
+ JSON.parse(options) as CarouselOptions,
70
+ )
71
+ : defaultCarouselOptions;
72
+ $: carouselItemsSize = carouselItems?.length;
73
+
74
+ $: carouselCurrentItemsVisible = carouselOptions[currentDevice].itemsVisible;
75
+ $: carouselCurrentHasHalfItemVisible =
76
+ carouselOptions[currentDevice].hasHalfItemVisible || false;
77
+ $: carouselCurrentItemsSize =
78
+ carouselItemsSize < carouselCurrentItemsVisible
79
+ ? carouselCurrentItemsVisible
80
+ : carouselItemsSize;
81
+
82
+ $: carouselCurrentItemsVisibleAndHalf = carouselCurrentHasHalfItemVisible
83
+ ? carouselCurrentItemsVisible + 0.5
84
+ : carouselCurrentItemsVisible;
85
+
86
+ $: carouselItemWidthSpace = getCarouselItemsWidthSpace(
87
+ carouselCurrentItemsVisible,
88
+ carouselCurrentHasHalfItemVisible,
89
+ );
90
+ $: carouselContainerWidthSpace = getCarouselContainerWidthSpace(
91
+ carouselCurrentItemsSize,
92
+ );
93
+
94
+ /* returns the total size of the spacing between items for the big container */
95
+ function getCarouselContainerWidthSpace(totalItems: number) {
96
+ return (totalItems - 1) * betweenItemsPixelSize;
97
+ }
98
+
99
+ /* returns the total size of the spacing between items for the screen size */
100
+ function getCarouselItemsWidthSpace(
101
+ itemsVisible: number,
102
+ itemsAndHalfVisible: boolean,
103
+ ) {
104
+ if (itemsAndHalfVisible) {
105
+ return itemsVisible * betweenItemsPixelSize;
106
+ }
107
+ return (itemsVisible - 1) * betweenItemsPixelSize;
108
+ }
109
+
110
+ /* move the scroll to change the displaying items.
111
+ 1 to move right, -1 to move left
112
+ */
113
+ function moveScroll(signe: 1 | -1) {
114
+ /* returns the size in pixel of an item according to screen size and the number of items visible. */
115
+ function getCarouselItemWidth() {
116
+ const carouselItemsWidthSpace = getCarouselItemsWidthSpace(
117
+ carouselCurrentItemsVisible,
118
+ carouselCurrentHasHalfItemVisible,
119
+ );
120
+ if (carouselCurrentHasHalfItemVisible) {
121
+ return (
122
+ (carouselContainer.clientWidth - carouselItemsWidthSpace) /
123
+ carouselCurrentItemsVisibleAndHalf
124
+ );
125
+ } else {
126
+ return (
127
+ (carouselContainer.clientWidth - carouselItemsWidthSpace) /
128
+ carouselCurrentItemsVisible
129
+ );
130
+ }
131
+ }
132
+
133
+ /* returns the new left position of the scrollbar
134
+ * in the case of visible half items, the calculation depends if the carousel is at the beginnind, at the end or in the middle.
135
+ *
136
+ */
137
+ function getLeft() {
138
+ if (!carouselCurrentHasHalfItemVisible) {
139
+ return (
140
+ carouselContainer.scrollLeft +
141
+ signe *
142
+ (carouselContainer.clientWidth +
143
+ betweenItemsPixelSize -
144
+ accessibilityFocusPadding * 2)
145
+ );
146
+ }
147
+ const itemWidth = getCarouselItemWidth();
148
+ if (isScrollBeginning) {
149
+ return (
150
+ carouselContainer.scrollLeft +
151
+ (signe *
152
+ (carouselContainer.clientWidth -
153
+ (3 / 4) * itemWidth -
154
+ betweenItemsPixelSize) +
155
+ accessibilityFocusPadding)
156
+ );
157
+ }
158
+ if (isScrollEnd) {
159
+ return (
160
+ carouselContainer.scrollLeft +
161
+ signe *
162
+ (carouselContainer.clientWidth -
163
+ (3 / 4) * itemWidth -
164
+ betweenItemsPixelSize)
165
+ );
166
+ }
167
+ return (
168
+ carouselContainer.scrollLeft +
169
+ signe *
170
+ (carouselContainer.clientWidth -
171
+ itemWidth / 2 -
172
+ betweenItemsPixelSize +
173
+ accessibilityFocusPadding * 2)
174
+ );
175
+ }
176
+
177
+ carouselContainer.scrollTo({ behavior: 'smooth', left: getLeft() });
178
+ }
179
+
180
+ function nextCards() {
181
+ moveScroll(1);
182
+ }
183
+
184
+ function previousCards() {
185
+ moveScroll(-1);
186
+ }
187
+
188
+ function handleScrollCarousel() {
189
+ isScrollBeginning = carouselContainer?.scrollLeft <= 0;
190
+ isScrollEnd =
191
+ carouselContainer?.scrollWidth - carouselContainer?.scrollLeft <=
192
+ carouselContainer.offsetWidth;
193
+ }
194
+
195
+ function handleClickCard(item: CarouselItem, event: MouseEvent): MouseEvent {
196
+ eventHandler.dispatch('carousel-item-clicked', item);
197
+ return event;
198
+ }
199
+ function handleClickLink(event: MouseEvent): MouseEvent {
200
+ eventHandler.dispatch('carousel-link-clicked', {});
201
+ return event;
202
+ }
203
+
204
+ // returns device according to screen size
205
+ function initCurrentDevice(
206
+ mediaQueryM: MediaQueryList,
207
+ mediaQueryXL: MediaQueryList,
208
+ ) {
209
+ if (mediaQueryXL.matches) {
210
+ return 'xl';
211
+ }
212
+ if (mediaQueryM.matches) {
213
+ return 'm';
214
+ }
215
+ return 's';
216
+ }
217
+
218
+ function handleMediaQueryChange(
219
+ event: MediaQueryListEvent,
220
+ matchingDevice: CarouselDevice,
221
+ ): MediaQueryListEvent {
222
+ if (event.matches) {
223
+ currentDevice = matchingDevice;
224
+ }
225
+ return event;
226
+ }
227
+
228
+ onMount(() => {
229
+ mediaQueryS.onchange = (e) => {
230
+ handleMediaQueryChange(e, 's');
231
+ };
232
+ mediaQueryM.onchange = (e) => {
233
+ handleMediaQueryChange(e, 'm');
234
+ };
235
+ mediaQueryXL.onchange = (e) => {
236
+ handleMediaQueryChange(e, 'xl');
237
+ };
238
+ });
239
+ </script>
240
+
241
+ <div class="mc-carousel">
242
+ <div class="mc-carousel__header">
243
+ <div class="mc-carousel__titles">
244
+ {@html `<${titletag} style="margin:0">${title}</${titletag}>`}
245
+ <div class="mc-carousel__subtitle">
246
+ <Link
247
+ href="#layer"
248
+ iconname="navigation-arrow-arrow--right-24px"
249
+ iconposition="right"
250
+ label={subtitlelink}
251
+ on:click={handleClickLink}
252
+ size="s"
253
+ target="_self"
254
+ />
255
+ </div>
256
+ </div>
257
+ <nav
258
+ aria-label="pagination"
259
+ class="mc-carousel__nav {mobile
260
+ ? 'mc-carousel__nav--mobile'
261
+ : 'mc-carousel__nav--desktop'}"
262
+ >
263
+ <Button
264
+ theme="neutral"
265
+ size="s"
266
+ bordered={true}
267
+ iconmode="only"
268
+ iconname="navigation-arrow-arrow--left-32px"
269
+ aria-label="Previous page"
270
+ disabled={isScrollBeginning}
271
+ on:click={previousCards}
272
+ label="Previous"
273
+ loader=""
274
+ />
275
+ <Button
276
+ theme="neutral"
277
+ size="s"
278
+ type="button"
279
+ bordered={true}
280
+ disabled={isScrollEnd}
281
+ iconmode="only"
282
+ iconname="navigation-arrow-arrow--right-32px"
283
+ aria-label="Next Page"
284
+ on:click={nextCards}
285
+ label="Next"
286
+ loader=""
287
+ />
288
+ </nav>
289
+ </div>
290
+ <div
291
+ class="mc-carousel__body"
292
+ bind:this={carouselContainer}
293
+ on:scroll={handleScrollCarousel}
294
+ style="--carousel__accessibility-focus-padding: {accessibilityFocusPadding}px;"
295
+ >
296
+ <div
297
+ class="mc-carousel__content"
298
+ style="
299
+ --carousel__container-width-space: {carouselContainerWidthSpace}px;
300
+ --carousel__items-count: {carouselCurrentItemsSize};
301
+ --carousel__item-width-space: {carouselItemWidthSpace}px;
302
+ --carousel__items-visible: {carouselCurrentItemsVisibleAndHalf};
303
+ --carousel__scrollbar-left: {carouselScrollbarLeft};
304
+ --carousel__container-separate-item-size: {betweenItemsPixelSize}px;"
305
+ >
306
+ {#each carouselItems as item}
307
+ <button
308
+ class="mc-carousel__item"
309
+ on:click={(event) => handleClickCard(item, event)}
310
+ >
311
+ <CarouselCard
312
+ title={item.title}
313
+ imgSrc={item.imgSrc}
314
+ imgAlt={item.imgAlt}
315
+ />
316
+ </button>
317
+ {/each}
318
+ </div>
319
+ </div>
320
+ </div>
321
+
322
+ <style lang="scss">
323
+ @import '@mozaic-ds/styles/settings-tools/_all-settings';
324
+ @import '@mozaic-ds/styles/components/c.button';
325
+ @import '@mozaic-ds/styles/components/c.links';
326
+ @import '@mozaic-ds/styles/components/c.pagination';
327
+
328
+ .mc-carousel {
329
+ display: flex;
330
+ flex-direction: column;
331
+ gap: $mu100;
332
+
333
+ &__header {
334
+ /* Auto layout */
335
+
336
+ display: flex;
337
+ align-items: flex-end;
338
+ justify-content: space-between;
339
+ }
340
+ &__titles {
341
+ display: flex;
342
+ flex-direction: column;
343
+ gap: $mu025;
344
+ }
345
+ &__nav {
346
+ gap: $mu050;
347
+ &--mobile {
348
+ display: none;
349
+ }
350
+ &--desktop {
351
+ display: flex;
352
+ }
353
+ }
354
+
355
+ &__body {
356
+ position: relative;
357
+ overflow-x: auto;
358
+ overflow-y: hidden;
359
+ padding: var(--carousel__accessibility-focus-padding);
360
+ }
361
+
362
+ &__content {
363
+ display: flex;
364
+ flex-wrap: nowrap;
365
+ column-gap: var(--carousel__container-separate-item-size);
366
+ // the total size of the big container for all items: taille d'un item * le nbre d'items + espace entre chaque item
367
+ width: calc(
368
+ (
369
+ (100% - var(--carousel__item-width-space)) /
370
+ var(--carousel__items-visible)
371
+ ) * var(--carousel__items-count) +
372
+ var(--carousel__container-width-space)
373
+ );
374
+ margin-bottom: $mu125;
375
+ }
376
+
377
+ &__item {
378
+ display: flex;
379
+ background: none;
380
+ border: none;
381
+ margin: 0;
382
+ padding: 0;
383
+ cursor: pointer;
384
+ // taille d'un item: (100% - les espaces entre chaque item isible) / le nombre d'items visible
385
+ width: calc(
386
+ (100% - var(--carousel__item-width-space)) /
387
+ var(--carousel__items-visible)
388
+ );
389
+ @include set-focus-floating-base();
390
+
391
+ &:focus {
392
+ @include set-focus-floating();
393
+ }
394
+ }
395
+
396
+ &-footer {
397
+ display: flex;
398
+ flex-direction: column;
399
+ }
400
+ }
401
+
402
+ ::-webkit-scrollbar {
403
+ border-radius: $mu025;
404
+ height: 6px;
405
+ background: $color-grey-100;
406
+ border-top: 1px solid white;
407
+ border-bottom: 1px solid white;
408
+ }
409
+
410
+ ::-webkit-scrollbar-thumb {
411
+ background: $color-grey-800;
412
+ border-radius: 6px;
413
+ }
414
+ </style>
@@ -0,0 +1,2 @@
1
+ import{E as e,i as t,s,F as l,c as a,e as i,d as r,t as c,g as o,$ as d,h as m,v as g,b as n,j as v,k as y,m as j,n as q,o as f,p as b,q as x}from"../../index-52f16292.js";function p(e){l(e,"svelte-1yq09gj",'.mc-card.svelte-1yq09gj.svelte-1yq09gj{font-family:"Roboto", sans-serif;max-width:17.75rem}.mc-card.svelte-1yq09gj.svelte-1yq09gj,.mc-card.svelte-1yq09gj .svelte-1yq09gj{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (min-width: 680px){.mc-card.svelte-1yq09gj.svelte-1yq09gj{max-width:18.25rem}}@media screen and (min-width: 1024px){.mc-card.svelte-1yq09gj.svelte-1yq09gj{max-width:18rem}}@media screen and (min-width: 1280px){.mc-card.svelte-1yq09gj.svelte-1yq09gj{max-width:17.5rem}}@media screen and (min-width: 1920px){.mc-card.svelte-1yq09gj.svelte-1yq09gj{max-width:27.25rem}}.mc-card__visual.svelte-1yq09gj.svelte-1yq09gj{margin:0;overflow:hidden;position:relative}.mc-card__visual.svelte-1yq09gj.svelte-1yq09gj::before{content:"";display:block;width:100%;padding-top:75%}.mc-card__visual--1x1.svelte-1yq09gj.svelte-1yq09gj::before{padding-top:100%}.mc-card__visual--16x9.svelte-1yq09gj.svelte-1yq09gj::before{padding-top:56.25%}.mc-card__img.svelte-1yq09gj.svelte-1yq09gj{height:auto;left:0;position:absolute;top:50%;width:100%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.mc-card__content.svelte-1yq09gj.svelte-1yq09gj{padding-top:1rem}.mc-card__title.svelte-1yq09gj.svelte-1yq09gj,.mc-card__subtitle.svelte-1yq09gj.svelte-1yq09gj{margin-top:0;margin-bottom:0.5rem}.mc-card__title.svelte-1yq09gj.svelte-1yq09gj{font-size:1.125rem;line-height:1.3333333333;font-weight:700;color:#000000}.mc-card__subtitle.svelte-1yq09gj.svelte-1yq09gj{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#333333}.mc-card__body.svelte-1yq09gj.svelte-1yq09gj{font-size:1rem;line-height:1.375;color:#191919}.mc-card__body.svelte-1yq09gj.svelte-1yq09gj:not(:last-child){margin-bottom:1rem}.mc-card--bordered.svelte-1yq09gj.svelte-1yq09gj{background:#ffffff;border:2px solid #808080;border-radius:0.25rem;overflow:hidden}.mc-card--fluid.svelte-1yq09gj.svelte-1yq09gj{max-width:none}.mc-carousel-card.svelte-1yq09gj.svelte-1yq09gj{font-family:"Roboto", sans-serif;font-weight:400;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;padding:0.5rem;gap:0.25rem;border:1px solid #666666;border-radius:0.25rem}.mc-carousel-card.svelte-1yq09gj .mc-carousel-card__image.svelte-1yq09gj{width:100%}')}function u(e){let t,s,l,b,x,p,u,h=[e[3],{class:"mc-carousel-card"}],_={};for(let e=0;e<h.length;e+=1)_=a(_,h[e]);return{c(){t=i("div"),s=i("picture"),l=i("img"),x=r(),p=i("div"),u=c(e[0]),o(l,"class","mc-carousel-card__image svelte-1yq09gj"),d(l.src,b=e[1])||o(l,"src",b),o(l,"alt",e[2]),o(s,"class","svelte-1yq09gj"),o(p,"class","mc-carousel-card__title svelte-1yq09gj"),m(t,_),g(t,"svelte-1yq09gj",!0)},m(e,a){n(e,t,a),v(t,s),v(s,l),v(t,x),v(t,p),v(p,u)},p(e,[s]){2&s&&!d(l.src,b=e[1])&&o(l,"src",b),4&s&&o(l,"alt",e[2]),1&s&&y(u,e[0]),m(t,_=j(h,[8&s&&e[3],{class:"mc-carousel-card"}])),g(t,"svelte-1yq09gj",!0)},i:q,o:q,d(e){e&&f(t)}}}function h(e,t,s){let l;const i=["title","imgSrc","imgAlt"];let r=b(t,i),{title:c}=t,{imgSrc:o}=t,{imgAlt:d}=t;return e.$$set=e=>{t=a(a({},t),x(e)),s(4,r=b(t,i)),"title"in e&&s(0,c=e.title),"imgSrc"in e&&s(1,o=e.imgSrc),"imgAlt"in e&&s(2,d=e.imgAlt)},e.$$.update=()=>{s(3,l=Object.assign({},r))},[c,o,d,l]}class _ extends e{constructor(e){super(),t(this,e,h,u,s,{title:0,imgSrc:1,imgAlt:2},p)}}export{_ as default};
2
+ //# sourceMappingURL=CarouselCard.nested.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CarouselCard.nested.js","sources":["../../../../src/components/carousel/CarouselCard.nested.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n export let title: string;\n export let imgSrc: string;\n export let imgAlt: string;\n $: attributes = { ...$$restProps };\n</script>\n\n<div {...attributes} class=\"mc-carousel-card\">\n <picture>\n <img class=\"mc-carousel-card__image\" src={imgSrc} alt={imgAlt} />\n </picture>\n <div class=\"mc-carousel-card__title\">{title}</div>\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.card';\n\n .mc-carousel-card {\n $parent: get-parent-selector(&);\n @include set-font-face();\n\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding: $mu050;\n gap: $mu025;\n border: 1px solid $color-grey-600;\n border-radius: $mu025;\n\n #{$parent}__image {\n width: 100%;\n }\n }\n</style>\n"],"names":["ctx","class","attr","img","img_src_value","insert","target","div1","anchor","append","picture","div0","title","$$props","imgSrc","imgAlt","attributes","Object","assign","$$restProps"],"mappings":"ynFASSA,EAAU,GAAA,CAAAC,MAAA,uIAIqBD,EAAK,oEAFCA,EAAM,KAAAE,EAAAC,EAAA,MAAAC,aAAOJ,EAAM,gIAFjEK,EAKKC,EAAAC,EAAAC,GAJHC,EAESF,EAAAG,GADPD,EAAgEC,EAAAP,UAElEM,EAAiDF,EAAAI,oCAFLX,EAAM,iCAAOA,EAAM,aAEzBA,EAAK,oBAJpCA,EAAU,kKANNY,GAAaC,UACbC,GAAcD,UACdE,GAAcF,mKACtBG,EAALC,OAAAC,UAAuBC,GAAW"}
@@ -0,0 +1,19 @@
1
+ export type CarouselTitleTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
2
+ export type CarouselDevice = 's' | 'm' | 'xl';
3
+ export type CarouselOptions = {
4
+ s: ItemOptions;
5
+ m: ItemOptions;
6
+ xl: ItemOptions;
7
+ };
8
+ type ItemOptions = {
9
+ itemsVisible: number;
10
+ hasHalfItemVisible?: boolean;
11
+ };
12
+ export type CarouselItem = {
13
+ id?: string;
14
+ title: string;
15
+ imgSrc: string;
16
+ imgAlt: string;
17
+ };
18
+ export {};
19
+ //# sourceMappingURL=carousel.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.types.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/carousel.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACvE,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC1B,CAAC,EAAE,WAAW,CAAC;IACf,CAAC,EAAE,WAAW,CAAC;IACf,EAAE,EAAE,WAAW,CAAC;CACnB,CAAA;AAED,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB,CAAA"}
@@ -0,0 +1,37 @@
1
+ <svelte:options tag={null} />
2
+
3
+ <script lang="ts">
4
+ export let title: string;
5
+ export let imgSrc: string;
6
+ export let imgAlt: string;
7
+ $: attributes = { ...$$restProps };
8
+ </script>
9
+
10
+ <div {...attributes} class="mc-carousel-card">
11
+ <picture>
12
+ <img class="mc-carousel-card__image" src={imgSrc} alt={imgAlt} />
13
+ </picture>
14
+ <div class="mc-carousel-card__title">{title}</div>
15
+ </div>
16
+
17
+ <style lang="scss">
18
+ @import '@mozaic-ds/styles/settings-tools/_all-settings';
19
+ @import '@mozaic-ds/styles/components/c.card';
20
+
21
+ .mc-carousel-card {
22
+ $parent: get-parent-selector(&);
23
+ @include set-font-face();
24
+
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: flex-start;
28
+ padding: $mu050;
29
+ gap: $mu025;
30
+ border: 1px solid $color-grey-600;
31
+ border-radius: $mu025;
32
+
33
+ #{$parent}__image {
34
+ width: 100%;
35
+ }
36
+ }
37
+ </style>
@@ -1,2 +1,2 @@
1
- import{S as t,i as e,a as r,b as s,f as a,s as o,e as i,d as n,T as c,n as l,y as u,g as m,o as d,J as h,a1 as g,t as f,j as p,k as $,K as b,v as x,Z as k}from"../../index-c33b3772.js";import{s as y}from"../../transform-15d69d5d.js";import{E as v}from"../../EventHandler-02058705.js";import{a as w,b as A}from"../../axis-fbc0f7b5.js";import{b as N}from"../../band-d7a07d2c.js";import{l as S}from"../../linear-f46d7e9e.js";function j(t,e,r){const s=t.slice();return s[4]=e[r],s}function E(t){let e,r,a,o=t[2].text+"";return{c(){e=i("div"),r=f(o),m(e,"class","tooltip"),m(e,"style",a=`top: ${t[2].top}px; left: ${t[2].left}px;`)},m(t,a){s(t,e,a),p(e,r)},p(t,s){4&s[0]&&o!==(o=t[2].text+"")&&$(r,o),4&s[0]&&a!==(a=`top: ${t[2].top}px; left: ${t[2].left}px;`)&&m(e,"style",a)},d(t){t&&d(e)}}}function C(t){let e,r,a=t[4]+"";return{c(){e=new k(!1),r=b(),e.a=r},m(t,o){e.m(a,t,o),s(t,r,o)},p(t,r){8&r[0]&&a!==(a=t[4]+"")&&e.p(a)},d(t){t&&d(r),t&&e.d()}}}function O(t){let e,r,a,o,g,f,p=t[2].show&&E(t),$=t[3],b=[];for(let e=0;e<$.length;e+=1)b[e]=C(j(t,$,e));return{c(){e=i("div"),r=n(),p&&p.c(),a=n(),o=i("div");for(let t=0;t<b.length;t+=1)b[t].c();g=n(),f=c("text"),this.c=l,u(e,"background-color",t[0]),u(o,"height","0"),u(o,"width","0"),m(o,"class","pattern")},m(i,n){s(i,e,n),t[18](e),s(i,r,n),p&&p.m(i,n),s(i,a,n),s(i,o,n);for(let t=0;t<b.length;t+=1)b[t]&&b[t].m(o,null);s(i,g,n),s(i,f,n)},p(t,r){if(1&r[0]&&u(e,"background-color",t[0]),t[2].show?p?p.p(t,r):(p=E(t),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null),8&r[0]){let e;for($=t[3],e=0;e<$.length;e+=1){const s=j(t,$,e);b[e]?b[e].p(s,r):(b[e]=C(s),b[e].c(),b[e].m(o,null))}for(;e<b.length;e+=1)b[e].d(1);b.length=$.length}},i:l,o:l,d(s){s&&d(e),t[18](null),s&&d(r),p&&p.d(s),s&&d(a),s&&d(o),h(b,s),s&&d(g),s&&d(f)}}}function J(t){return t?JSON.parse(t):{top:10,right:40,bottom:20,left:60,xAxis:20}}function R(t,e,r){let s,a,o,i,n,{data:c=""}=e,{chartheight:l="300"}=e,{backgroundcolor:u="#fff"}=e,{scalemax:m=50}=e,{scalemin:d=0}=e,{color:h="#0B96CC"}=e,{ticknumbers:f=4}=e,{tickleftformat:p}=e;p=t=>`${t}`;let $,b,k,{tickbottomformat:j=(t=>`${t}`)}=e,{svgs:E}=e,{margins:C}=e,O=!1,R={show:!1,text:"",top:0,left:0,width:0},z=new v;function F(){let t=y(b).style("width");return""!==t&&t||(t=""+window.innerWidth/2),parseInt(t)}function q(t){return n.map((e=>({key:e,value:t[e].value,customtooltip:t[e].customtooltip})))}function B(t){const e=N().domain(s).range([0,t-(J(C).left/2+J(C).right/2)]).padding(.2),r=S().domain([d,m]).range([a,0]),o=N().domain(n).range([0,e.bandwidth()]).padding(.05);return{x:e,y:r,xSubgroup:o}}function I(t,e,s){k.append("g").selectAll("g").data(i).join("g").attr("transform",(e=>`translate(${String(t(e.group))}, 0)`)).attr("class","bar").selectAll("rect").data((t=>q(t))).join("rect").attr("x",(t=>e(t.key))).attr("y",(()=>s(0))).attr("width",e.bandwidth()).attr("height",(()=>a-s(0))).style("fill",(()=>h)).style("cursor","pointer").on("mouseout",((t,e)=>{k.selectAll("rect").filter((function(t){return t!=e})).style("opacity",1),r(2,R.show=!1,R)})).on("mouseover",((t,s)=>{k.selectAll("rect").filter((function(t){return t!=s})).style("opacity",.7);const{left:a,top:o,width:i}=t.target.getBoundingClientRect();console.log(e.bandwidth()),r(2,R={show:!0,text:s.customtooltip?`${s.customtooltip}`:`${s.key} - ${s.value}`,left:a,top:o-50,width:i})})).on("click",((t,e)=>{z.dispatch("bar-clicked",e)})),k.selectAll("rect").transition().duration(800).attr("y",(t=>+t.value<0?s(0):s(+t.value))).attr("height",(t=>+t.value<0?s(+t.value)-s(0):a-s(+t.value+Number(d)))).delay(((t,e)=>100*e))}function D(t,e){k.select(".x-axis").call(w(t).tickFormat(j)),k.select(".y-axis").call(A(e).ticks(f).tickFormat(p));const r=F();k.selectAll(".y-axis .tick line").attr("stroke","#EEEDEA").attr("stroke-width","1px").attr("x2",r)}function H(){var t;if($){const e=F();null===(t=b.querySelector("#svg-chart"))||void 0===t||t.setAttribute("width",`${e}px`);const{x:r,y:s,xSubgroup:a}=B(e);D(r,s),k.selectAll(".bar").data(i).attr("transform",(t=>`translate(${Number(r(t.group))}, 0)`)).selectAll("rect").data((t=>q(t))).attr("x",(t=>a(t.key))).attr("width",a.bandwidth())}}return g((()=>{new ResizeObserver(H).observe(b),r(17,O=!0)})),t.$$set=t=>{"data"in t&&r(6,c=t.data),"chartheight"in t&&r(7,l=t.chartheight),"backgroundcolor"in t&&r(0,u=t.backgroundcolor),"scalemax"in t&&r(8,m=t.scalemax),"scalemin"in t&&r(9,d=t.scalemin),"color"in t&&r(10,h=t.color),"ticknumbers"in t&&r(11,f=t.ticknumbers),"tickleftformat"in t&&r(5,p=t.tickleftformat),"tickbottomformat"in t&&r(12,j=t.tickbottomformat),"svgs"in t&&r(13,E=t.svgs),"margins"in t&&r(14,C=t.margins)},t.$$.update=()=>{64&t.$$.dirty[0]&&r(15,i=c?JSON.parse(c):[]),32768&t.$$.dirty[0]&&(s=i.map((t=>t.group))),32768&t.$$.dirty[0]&&(n=i[0]?Object.keys(i[0]).filter((t=>"group"!==t)):[]),128&t.$$.dirty[0]&&(a=parseInt(l,10)),8192&t.$$.dirty[0]&&r(3,o=E?JSON.parse(E):[]),196672&t.$$.dirty[0]&&c.length>0&&O&&($?c!==$&&(!function(){var t;const e=F();null===(t=b.querySelector("#svg-chart"))||void 0===t||t.setAttribute("width",`${e}px`);const{x:r,y:s,xSubgroup:a}=B(e);D(r,s),k.selectAll(".bar").remove(),I(r,a,s)}(),r(16,$=c)):(!function(){const t=F(),{x:e,y:s,xSubgroup:o}=B(t);r(4,k=y(b).append("svg").attr("width",t).attr("height",Number(a)+Number(J(C).top)+Number(J(C).bottom)+Number(J(C).xAxis)).attr("id","svg-chart").append("g").attr("transform",`translate(${J(C).left/2+J(C).right/2},${J(C).top})`)),k.append("g").attr("transform",`translate(0, ${Number(a)+Number(J(C).xAxis)})`).call(w(e)).attr("class","x-axis").attr("stroke-width","0"),k.append("g").call(A(s).ticks(f).tickFormat(p)).attr("class","y-axis").attr("stroke-width","0"),I(e,o,s)}(),r(16,$=c)))},[u,b,R,o,k,p,c,l,m,d,h,f,j,E,C,i,$,O,function(t){x[t?"unshift":"push"]((()=>{b=t,r(1,b)}))}]}class z extends t{constructor(t){super();const i=document.createElement("style");i.textContent='.tooltip{height:auto;background-color:#4d4d4d;border-radius:4px;color:#ffffff;text-align:center;padding:0.5rem 1rem;position:absolute}.pattern{z-index:-1;position:relative}text{font-family:"LeroyMerlin", sans-serif;font-size:0.875rem;color:#4d4d4d}',this.shadowRoot.appendChild(i),e(this,{target:this.shadowRoot,props:r(this.attributes),customElement:!0},R,O,o,{data:6,chartheight:7,backgroundcolor:0,scalemax:8,scalemin:9,color:10,ticknumbers:11,tickleftformat:5,tickbottomformat:12,svgs:13,margins:14},null,[-1,-1]),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),a()))}static get observedAttributes(){return["data","chartheight","backgroundcolor","scalemax","scalemin","color","ticknumbers","tickleftformat","tickbottomformat","svgs","margins"]}get data(){return this.$$.ctx[6]}set data(t){this.$$set({data:t}),a()}get chartheight(){return this.$$.ctx[7]}set chartheight(t){this.$$set({chartheight:t}),a()}get backgroundcolor(){return this.$$.ctx[0]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),a()}get scalemax(){return this.$$.ctx[8]}set scalemax(t){this.$$set({scalemax:t}),a()}get scalemin(){return this.$$.ctx[9]}set scalemin(t){this.$$set({scalemin:t}),a()}get color(){return this.$$.ctx[10]}set color(t){this.$$set({color:t}),a()}get ticknumbers(){return this.$$.ctx[11]}set ticknumbers(t){this.$$set({ticknumbers:t}),a()}get tickleftformat(){return this.$$.ctx[5]}set tickleftformat(t){this.$$set({tickleftformat:t}),a()}get tickbottomformat(){return this.$$.ctx[12]}set tickbottomformat(t){this.$$set({tickbottomformat:t}),a()}get svgs(){return this.$$.ctx[13]}set svgs(t){this.$$set({svgs:t}),a()}get margins(){return this.$$.ctx[14]}set margins(t){this.$$set({margins:t}),a()}}export{z as default};
1
+ import{S as t,i as e,a as r,b as s,f as a,s as o,e as i,d as n,G as c,n as l,J as u,g as d,o as m,O as h,a1 as g,t as f,j as p,k as $,P as b,H as x,Z as k}from"../../index-52f16292.js";import{s as y}from"../../transform-15d69d5d.js";import{E as v}from"../../EventHandler-f4efd23c.js";import{a as w,b as A}from"../../axis-fbc0f7b5.js";import{b as N}from"../../band-d7a07d2c.js";import{l as S}from"../../linear-f46d7e9e.js";function j(t,e,r){const s=t.slice();return s[4]=e[r],s}function E(t){let e,r,a,o=t[2].text+"";return{c(){e=i("div"),r=f(o),d(e,"class","tooltip"),d(e,"style",a=`top: ${t[2].top}px; left: ${t[2].left}px;`)},m(t,a){s(t,e,a),p(e,r)},p(t,s){4&s[0]&&o!==(o=t[2].text+"")&&$(r,o),4&s[0]&&a!==(a=`top: ${t[2].top}px; left: ${t[2].left}px;`)&&d(e,"style",a)},d(t){t&&m(e)}}}function O(t){let e,r,a=t[4]+"";return{c(){e=new k(!1),r=b(),e.a=r},m(t,o){e.m(a,t,o),s(t,r,o)},p(t,r){8&r[0]&&a!==(a=t[4]+"")&&e.p(a)},d(t){t&&m(r),t&&e.d()}}}function C(t){let e,r,a,o,g,f,p=t[2].show&&E(t),$=t[3],b=[];for(let e=0;e<$.length;e+=1)b[e]=O(j(t,$,e));return{c(){e=i("div"),r=n(),p&&p.c(),a=n(),o=i("div");for(let t=0;t<b.length;t+=1)b[t].c();g=n(),f=c("text"),this.c=l,u(e,"background-color",t[0]),u(o,"height","0"),u(o,"width","0"),d(o,"class","pattern")},m(i,n){s(i,e,n),t[18](e),s(i,r,n),p&&p.m(i,n),s(i,a,n),s(i,o,n);for(let t=0;t<b.length;t+=1)b[t]&&b[t].m(o,null);s(i,g,n),s(i,f,n)},p(t,r){if(1&r[0]&&u(e,"background-color",t[0]),t[2].show?p?p.p(t,r):(p=E(t),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null),8&r[0]){let e;for($=t[3],e=0;e<$.length;e+=1){const s=j(t,$,e);b[e]?b[e].p(s,r):(b[e]=O(s),b[e].c(),b[e].m(o,null))}for(;e<b.length;e+=1)b[e].d(1);b.length=$.length}},i:l,o:l,d(s){s&&m(e),t[18](null),s&&m(r),p&&p.d(s),s&&m(a),s&&m(o),h(b,s),s&&m(g),s&&m(f)}}}function J(t){return t?JSON.parse(t):{top:10,right:40,bottom:20,left:60,xAxis:20}}function R(t,e,r){let s,a,o,i,n,{data:c=""}=e,{chartheight:l="300"}=e,{backgroundcolor:u="#fff"}=e,{scalemax:d=50}=e,{scalemin:m=0}=e,{color:h="#0B96CC"}=e,{ticknumbers:f=4}=e,{tickleftformat:p}=e;p=t=>`${t}`;let $,b,k,{tickbottomformat:j=(t=>`${t}`)}=e,{svgs:E}=e,{margins:O}=e,C=!1,R={show:!1,text:"",top:0,left:0,width:0},z=new v;function F(){let t=y(b).style("width");return""!==t&&t||(t=""+window.innerWidth/2),parseInt(t)}function q(t){return n.map((e=>({key:e,value:t[e].value,customtooltip:t[e].customtooltip})))}function B(t){const e=N().domain(s).range([0,t-(J(O).left/2+J(O).right/2)]).padding(.2),r=S().domain([m,d]).range([a,0]),o=N().domain(n).range([0,e.bandwidth()]).padding(.05);return{x:e,y:r,xSubgroup:o}}function H(t,e,s){k.append("g").selectAll("g").data(i).join("g").attr("transform",(e=>`translate(${String(t(e.group))}, 0)`)).attr("class","bar").selectAll("rect").data((t=>q(t))).join("rect").attr("x",(t=>e(t.key))).attr("y",(()=>s(0))).attr("width",e.bandwidth()).attr("height",(()=>a-s(0))).style("fill",(()=>h)).style("cursor","pointer").on("mouseout",((t,e)=>{k.selectAll("rect").filter((function(t){return t!=e})).style("opacity",1),r(2,R.show=!1,R)})).on("mouseover",((t,s)=>{k.selectAll("rect").filter((function(t){return t!=s})).style("opacity",.7);const{left:a,top:o,width:i}=t.target.getBoundingClientRect();console.log(e.bandwidth()),r(2,R={show:!0,text:s.customtooltip?`${s.customtooltip}`:`${s.key} - ${s.value}`,left:a,top:o-50,width:i})})).on("click",((t,e)=>{z.dispatch("bar-clicked",e)})),k.selectAll("rect").transition().duration(800).attr("y",(t=>+t.value<0?s(0):s(+t.value))).attr("height",(t=>+t.value<0?s(+t.value)-s(0):a-s(+t.value+Number(m)))).delay(((t,e)=>100*e))}function I(t,e){k.select(".x-axis").call(w(t).tickFormat(j)),k.select(".y-axis").call(A(e).ticks(f).tickFormat(p));const r=F();k.selectAll(".y-axis .tick line").attr("stroke","#EEEDEA").attr("stroke-width","1px").attr("x2",r)}function D(){var t;if($){const e=F();null===(t=b.querySelector("#svg-chart"))||void 0===t||t.setAttribute("width",`${e}px`);const{x:r,y:s,xSubgroup:a}=B(e);I(r,s),k.selectAll(".bar").data(i).attr("transform",(t=>`translate(${Number(r(t.group))}, 0)`)).selectAll("rect").data((t=>q(t))).attr("x",(t=>a(t.key))).attr("width",a.bandwidth())}}return g((()=>{new ResizeObserver(D).observe(b),r(17,C=!0)})),t.$$set=t=>{"data"in t&&r(6,c=t.data),"chartheight"in t&&r(7,l=t.chartheight),"backgroundcolor"in t&&r(0,u=t.backgroundcolor),"scalemax"in t&&r(8,d=t.scalemax),"scalemin"in t&&r(9,m=t.scalemin),"color"in t&&r(10,h=t.color),"ticknumbers"in t&&r(11,f=t.ticknumbers),"tickleftformat"in t&&r(5,p=t.tickleftformat),"tickbottomformat"in t&&r(12,j=t.tickbottomformat),"svgs"in t&&r(13,E=t.svgs),"margins"in t&&r(14,O=t.margins)},t.$$.update=()=>{64&t.$$.dirty[0]&&r(15,i=c?JSON.parse(c):[]),32768&t.$$.dirty[0]&&(s=i.map((t=>t.group))),32768&t.$$.dirty[0]&&(n=i[0]?Object.keys(i[0]).filter((t=>"group"!==t)):[]),128&t.$$.dirty[0]&&(a=parseInt(l,10)),8192&t.$$.dirty[0]&&r(3,o=E?JSON.parse(E):[]),196672&t.$$.dirty[0]&&c.length>0&&C&&($?c!==$&&(!function(){var t;const e=F();null===(t=b.querySelector("#svg-chart"))||void 0===t||t.setAttribute("width",`${e}px`);const{x:r,y:s,xSubgroup:a}=B(e);I(r,s),k.selectAll(".bar").remove(),H(r,a,s)}(),r(16,$=c)):(!function(){const t=F(),{x:e,y:s,xSubgroup:o}=B(t);r(4,k=y(b).append("svg").attr("width",t).attr("height",Number(a)+Number(J(O).top)+Number(J(O).bottom)+Number(J(O).xAxis)).attr("id","svg-chart").append("g").attr("transform",`translate(${J(O).left/2+J(O).right/2},${J(O).top})`)),k.append("g").attr("transform",`translate(0, ${Number(a)+Number(J(O).xAxis)})`).call(w(e)).attr("class","x-axis").attr("stroke-width","0"),k.append("g").call(A(s).ticks(f).tickFormat(p)).attr("class","y-axis").attr("stroke-width","0"),H(e,o,s)}(),r(16,$=c)))},[u,b,R,o,k,p,c,l,d,m,h,f,j,E,O,i,$,C,function(t){x[t?"unshift":"push"]((()=>{b=t,r(1,b)}))}]}class z extends t{constructor(t){super();const i=document.createElement("style");i.textContent='.tooltip{height:auto;background-color:#4d4d4d;border-radius:4px;color:#ffffff;text-align:center;padding:0.5rem 1rem;position:absolute}.pattern{z-index:-1;position:relative}text{font-family:"LeroyMerlin", sans-serif;font-size:0.875rem;color:#4d4d4d}',this.shadowRoot.appendChild(i),e(this,{target:this.shadowRoot,props:r(this.attributes),customElement:!0},R,C,o,{data:6,chartheight:7,backgroundcolor:0,scalemax:8,scalemin:9,color:10,ticknumbers:11,tickleftformat:5,tickbottomformat:12,svgs:13,margins:14},null,[-1,-1]),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),a()))}static get observedAttributes(){return["data","chartheight","backgroundcolor","scalemax","scalemin","color","ticknumbers","tickleftformat","tickbottomformat","svgs","margins"]}get data(){return this.$$.ctx[6]}set data(t){this.$$set({data:t}),a()}get chartheight(){return this.$$.ctx[7]}set chartheight(t){this.$$set({chartheight:t}),a()}get backgroundcolor(){return this.$$.ctx[0]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),a()}get scalemax(){return this.$$.ctx[8]}set scalemax(t){this.$$set({scalemax:t}),a()}get scalemin(){return this.$$.ctx[9]}set scalemin(t){this.$$set({scalemin:t}),a()}get color(){return this.$$.ctx[10]}set color(t){this.$$set({color:t}),a()}get ticknumbers(){return this.$$.ctx[11]}set ticknumbers(t){this.$$set({ticknumbers:t}),a()}get tickleftformat(){return this.$$.ctx[5]}set tickleftformat(t){this.$$set({tickleftformat:t}),a()}get tickbottomformat(){return this.$$.ctx[12]}set tickbottomformat(t){this.$$set({tickbottomformat:t}),a()}get svgs(){return this.$$.ctx[13]}set svgs(t){this.$$set({svgs:t}),a()}get margins(){return this.$$.ctx[14]}set margins(t){this.$$set({margins:t}),a()}}export{z as default};
2
2
  //# sourceMappingURL=BarChart.js.map
@@ -1,2 +1,2 @@
1
- import{S as t,i as e,a as n,b as i,f as r,s as a,e as l,d as o,n as s,g,y as d,j as c,o as h,J as m,a1 as f,T as u,l as p,t as x,k as y,K as b,v as w,Z as k}from"../../index-c33b3772.js";import{s as $,a as v}from"../../transform-15d69d5d.js";import{E as _}from"../../EventHandler-02058705.js";import{c as A,a as z}from"../../array-5b770a93.js";import{w as T,p as j,c as R,s as E,h as M,e as O,t as S,a as N,m as C,b as D,d as F,f as I,g as J,i as P}from"../../path-1b5da959.js";function q(t){return t.innerRadius}function B(t){return t.outerRadius}function H(t){return t.startAngle}function K(t){return t.endAngle}function V(t){return t&&t.padAngle}function X(t,e,n,i,r,a,l){var o=t-n,s=e-i,g=(l?a:-a)/N(o*o+s*s),d=g*s,c=-g*o,h=t+d,m=e+c,f=n+d,u=i+c,p=(h+f)/2,x=(m+u)/2,y=f-h,b=u-m,w=y*y+b*b,k=r-a,$=h*u-f*m,v=(b<0?-1:1)*N(P(0,k*k*w-$*$)),_=($*b-y*v)/w,A=(-$*y-b*v)/w,z=($*b+y*v)/w,T=(-$*y+b*v)/w,j=_-p,R=A-x,E=z-p,M=T-x;return j*j+R*R>E*E+M*M&&(_=z,A=T),{cx:_,cy:A,x01:-d,y01:-c,x11:_*(r/k-1),y11:A*(r/k-1)}}function Y(){var t=q,e=B,n=A(0),i=null,r=H,a=K,l=V,o=null,s=T(g);function g(){var g,d,c=+t.apply(this,arguments),h=+e.apply(this,arguments),m=r.apply(this,arguments)-M,f=a.apply(this,arguments)-M,u=D(f-m),p=f>m;if(o||(o=g=s()),h<c&&(d=h,h=c,c=d),h>O)if(u>S-O)o.moveTo(h*R(m),h*E(m)),o.arc(0,0,h,m,f,!p),c>O&&(o.moveTo(c*R(f),c*E(f)),o.arc(0,0,c,f,m,p));else{var x,y,b=m,w=f,k=m,$=f,v=u,_=u,A=l.apply(this,arguments)/2,z=A>O&&(i?+i.apply(this,arguments):N(c*c+h*h)),T=C(D(h-c)/2,+n.apply(this,arguments)),P=T,q=T;if(z>O){var B=I(z/c*E(A)),H=I(z/h*E(A));(v-=2*B)>O?(k+=B*=p?1:-1,$-=B):(v=0,k=$=(m+f)/2),(_-=2*H)>O?(b+=H*=p?1:-1,w-=H):(_=0,b=w=(m+f)/2)}var K=h*R(b),V=h*E(b),Y=c*R($),Z=c*E($);if(T>O){var G,L=h*R(w),Q=h*E(w),U=c*R(k),W=c*E(k);if(u<j)if(G=function(t,e,n,i,r,a,l,o){var s=n-t,g=i-e,d=l-r,c=o-a,h=c*s-d*g;if(!(h*h<O))return[t+(h=(d*(e-a)-c*(t-r))/h)*s,e+h*g]}(K,V,U,W,L,Q,Y,Z)){var tt=K-G[0],et=V-G[1],nt=L-G[0],it=Q-G[1],rt=1/E(J((tt*nt+et*it)/(N(tt*tt+et*et)*N(nt*nt+it*it)))/2),at=N(G[0]*G[0]+G[1]*G[1]);P=C(T,(c-at)/(rt-1)),q=C(T,(h-at)/(rt+1))}else P=q=0}_>O?q>O?(x=X(U,W,K,V,h,q,p),y=X(L,Q,Y,Z,h,q,p),o.moveTo(x.cx+x.x01,x.cy+x.y01),q<T?o.arc(x.cx,x.cy,q,F(x.y01,x.x01),F(y.y01,y.x01),!p):(o.arc(x.cx,x.cy,q,F(x.y01,x.x01),F(x.y11,x.x11),!p),o.arc(0,0,h,F(x.cy+x.y11,x.cx+x.x11),F(y.cy+y.y11,y.cx+y.x11),!p),o.arc(y.cx,y.cy,q,F(y.y11,y.x11),F(y.y01,y.x01),!p))):(o.moveTo(K,V),o.arc(0,0,h,b,w,!p)):o.moveTo(K,V),c>O&&v>O?P>O?(x=X(Y,Z,L,Q,c,-P,p),y=X(K,V,U,W,c,-P,p),o.lineTo(x.cx+x.x01,x.cy+x.y01),P<T?o.arc(x.cx,x.cy,P,F(x.y01,x.x01),F(y.y01,y.x01),!p):(o.arc(x.cx,x.cy,P,F(x.y01,x.x01),F(x.y11,x.x11),!p),o.arc(0,0,c,F(x.cy+x.y11,x.cx+x.x11),F(y.cy+y.y11,y.cx+y.x11),p),o.arc(y.cx,y.cy,P,F(y.y11,y.x11),F(y.y01,y.x01),!p))):o.arc(0,0,c,$,k,p):o.lineTo(Y,Z)}else o.moveTo(0,0);if(o.closePath(),g)return o=null,g+""||null}return g.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-j/2;return[R(i)*n,E(i)*n]},g.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:A(+e),g):t},g.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:A(+t),g):e},g.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:A(+t),g):n},g.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:A(+t),g):i},g.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:A(+t),g):r},g.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:A(+t),g):a},g.padAngle=function(t){return arguments.length?(l="function"==typeof t?t:A(+t),g):l},g.context=function(t){return arguments.length?(o=null==t?null:t,g):o},g}function Z(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function G(t){return t}function L(t,e,n){const i=t.slice();return i[7]=e[n],i}function Q(t,e,n){const i=t.slice();return i[4]=e[n],i[33]=n,i}function U(t,e,n){const i=t.slice();return i[34]=e[n],i}function W(t){let e,n,r,a=t[34].split(t[1])[1]+"";return{c(){e=l("span"),n=x("("),r=x(a),g(e,"class","legend__text--light")},m(t,a){i(t,e,a),c(e,n),c(e,r)},p(t,e){67&e[0]&&a!==(a=t[34].split(t[1])[1]+"")&&y(r,a)},d(t){t&&h(e)}}}function tt(t){let e,n,r,a,s,d=t[34].split(t[1])[0]+"",m=t[34].split(t[1])[1],f=m&&W(t);return{c(){e=l("p"),n=x(d),r=o(),f&&f.c(),a=o(),g(e,"class",s=at(t[4].checked))},m(t,l){i(t,e,l),c(e,n),c(e,r),f&&f.m(e,null),c(e,a)},p(t,i){67&i[0]&&d!==(d=t[34].split(t[1])[0]+"")&&y(n,d),67&i[0]&&(m=t[34].split(t[1])[1]),m?f?f.p(t,i):(f=W(t),f.c(),f.m(e,a)):f&&(f.d(1),f=null),64&i[0]&&s!==(s=at(t[4].checked))&&g(e,"class",s)},d(t){t&&h(e),f&&f.d()}}}function et(t){let e,n,r,a,s,d,f,x,y,b=t[4].name.split(t[0]),w=[];for(let e=0;e<b.length;e+=1)w[e]=tt(U(t,b,e));function k(){return t[20](t[4])}return{c(){e=l("button"),n=u("svg"),r=u("rect"),s=o(),d=l("div");for(let t=0;t<w.length;t+=1)w[t].c();f=o(),g(r,"x","0"),g(r,"y","0"),g(r,"width","24"),g(r,"height","16"),g(r,"fill",a=t[12](t[4],t[33],t[10],t[9])),g(n,"class","legend__box"),g(e,"class","legend__item")},m(t,a){i(t,e,a),c(e,n),c(n,r),c(e,s),c(e,d);for(let t=0;t<w.length;t+=1)w[t]&&w[t].m(d,null);c(e,f),x||(y=p(e,"click",k),x=!0)},p(e,n){if(t=e,1600&n[0]&&a!==(a=t[12](t[4],t[33],t[10],t[9]))&&g(r,"fill",a),67&n[0]){let e;for(b=t[4].name.split(t[0]),e=0;e<b.length;e+=1){const i=U(t,b,e);w[e]?w[e].p(i,n):(w[e]=tt(i),w[e].c(),w[e].m(d,null))}for(;e<w.length;e+=1)w[e].d(1);w.length=b.length}},d(t){t&&h(e),m(w,t),x=!1,y()}}}function nt(t){let e,n,r=t[8].text+"";return{c(){e=l("div"),n=x(r),g(e,"class","chart__tooltip"),d(e,"left",t[8].left),d(e,"top",t[8].top)},m(t,r){i(t,e,r),c(e,n)},p(t,i){256&i[0]&&r!==(r=t[8].text+"")&&y(n,r),256&i[0]&&d(e,"left",t[8].left),256&i[0]&&d(e,"top",t[8].top)},d(t){t&&h(e)}}}function it(t){let e,n,r=t[7]+"";return{c(){e=new k(!1),n=b(),e.a=n},m(t,a){e.m(r,t,a),i(t,n,a)},p(t,n){1024&n[0]&&r!==(r=t[7]+"")&&e.p(r)},d(t){t&&h(n),t&&e.d()}}}function rt(t){let e,n,r,a,f,u,p=t[6],x=[];for(let e=0;e<p.length;e+=1)x[e]=et(Q(t,p,e));let y=t[8].show&&nt(t),b=t[10],w=[];for(let e=0;e<b.length;e+=1)w[e]=it(L(t,b,e));return{c(){e=l("div"),n=l("div");for(let t=0;t<x.length;t+=1)x[t].c();r=o(),y&&y.c(),f=o(),u=l("div");for(let t=0;t<w.length;t+=1)w[t].c();this.c=s,g(n,"class","legend"),g(e,"class",a="chart "+lt(t[3])),d(e,"background-color",t[2]),d(u,"height","0"),d(u,"width","0"),g(u,"class","pattern")},m(a,l){i(a,e,l),c(e,n);for(let t=0;t<x.length;t+=1)x[t]&&x[t].m(n,null);c(e,r),y&&y.m(e,null),t[21](e),i(a,f,l),i(a,u,l);for(let t=0;t<w.length;t+=1)w[t]&&w[t].m(u,null)},p(t,i){if(7747&i[0]){let e;for(p=t[6],e=0;e<p.length;e+=1){const r=Q(t,p,e);x[e]?x[e].p(r,i):(x[e]=et(r),x[e].c(),x[e].m(n,null))}for(;e<x.length;e+=1)x[e].d(1);x.length=p.length}if(t[8].show?y?y.p(t,i):(y=nt(t),y.c(),y.m(e,null)):y&&(y.d(1),y=null),8&i[0]&&a!==(a="chart "+lt(t[3]))&&g(e,"class",a),4&i[0]&&d(e,"background-color",t[2]),1024&i[0]){let e;for(b=t[10],e=0;e<b.length;e+=1){const n=L(t,b,e);w[e]?w[e].p(n,i):(w[e]=it(n),w[e].c(),w[e].m(u,null))}for(;e<w.length;e+=1)w[e].d(1);w.length=b.length}},i:s,o:s,d(n){n&&h(e),m(x,n),y&&y.d(),t[21](null),n&&h(f),n&&h(u),m(w,n)}}}function at(t){return"legend__text"+(t?" legend__text--not-selected":"")}function lt(t){switch(t){case"top":return"chart--top";case"right":default:return"chart--right";case"bottom":return"chart--bottom";case"left":return"chart--left"}}function ot(t,e,n){let i,r,a,l,o,s,{data:g=""}=e,{svgs:d}=e,{colors:c}=e,{title:h}=e,{legendseparator:m=","}=e,{legendseparatorcount:u="("}=e,{dimension:p=250}=e,{padangle:x=.05}=e,{backgroundcolor:y="#fff"}=e,{delay:b=500}=e,{legendposition:k="right"}=e,T=!1,j=new _,R={left:"0px",top:"0px",text:"",show:!1};const E=p/2,M=Y().outerRadius(E-5).innerRadius(E-60).padAngle(x),O=function(){var t=G,e=Z,n=null,i=A(0),r=A(S),a=A(0);function l(l){var o,s,g,d,c,h=(l=z(l)).length,m=0,f=new Array(h),u=new Array(h),p=+i.apply(this,arguments),x=Math.min(S,Math.max(-S,r.apply(this,arguments)-p)),y=Math.min(Math.abs(x)/h,a.apply(this,arguments)),b=y*(x<0?-1:1);for(o=0;o<h;++o)(c=u[f[o]=o]=+t(l[o],o,l))>0&&(m+=c);for(null!=e?f.sort((function(t,n){return e(u[t],u[n])})):null!=n&&f.sort((function(t,e){return n(l[t],l[e])})),o=0,g=m?(x-h*b)/m:0;o<h;++o,p=d)s=f[o],d=p+((c=u[s])>0?c*g:0)+b,u[s]={data:l[s],index:o,value:c,startAngle:p,endAngle:d,padAngle:y};return u}return l.value=function(e){return arguments.length?(t="function"==typeof e?e:A(+e),l):t},l.sortValues=function(t){return arguments.length?(e=t,n=null,l):e},l.sort=function(t){return arguments.length?(n=t,e=null,l):n},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:A(+t),l):i},l.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:A(+t),l):r},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:A(+t),l):a},l}().sort(null).startAngle(1.1*Math.PI).endAngle(3.1*Math.PI).value((t=>t.total)),N=()=>i?i.filter((t=>!t.checked)).reduce(((t,e)=>t+e.total),0):[];function C(t){s.selectAll("path").data(O(t)).transition().duration(b).attr("stroke-width",((t,e)=>i[e].checked?"0px":"4px")).attrTween("d",(function(t){const e=v(this._current,t);return this._current=e(0),t=>M(e(t))||""})),s.selectAll("svg text").filter((function(){return/^[0-9]/.test($(this).text())})).text(String(N()))}function D(t){const e=s.selectAll("path").data().map(((e,r)=>{const a=e.data;if(a.name===t){n(6,i[r].checked=!i[r].checked,i);const t=0===a.total?i[r].total:0;return Object.assign(Object.assign({},a),{total:t})}return Object.assign({},a)}));C(e)}f((()=>n(19,T=!0)));return t.$$set=t=>{"data"in t&&n(4,g=t.data),"svgs"in t&&n(13,d=t.svgs),"colors"in t&&n(14,c=t.colors),"title"in t&&n(15,h=t.title),"legendseparator"in t&&n(0,m=t.legendseparator),"legendseparatorcount"in t&&n(1,u=t.legendseparatorcount),"dimension"in t&&n(16,p=t.dimension),"padangle"in t&&n(17,x=t.padangle),"backgroundcolor"in t&&n(2,y=t.backgroundcolor),"delay"in t&&n(18,b=t.delay),"legendposition"in t&&n(3,k=t.legendposition)},t.$$.update=()=>{16&t.$$.dirty[0]&&n(6,i=g?JSON.parse(g):[]),8192&t.$$.dirty[0]&&n(10,r=d?JSON.parse(d):[]),16384&t.$$.dirty[0]&&n(9,a=c?JSON.parse(c):["#605F9D","#D9F0F3","#EAEDEF","#0B96CC","#EA7315","#EA302D"]),64&t.$$.dirty[0]&&(l=i?i.filter((t=>!t.checked)).reduce(((t,e)=>t+e.total),0):[]),59e4&t.$$.dirty[0]&&g.length>0&&T&&(s?s.selectAll("path").remove():n(7,s=$(o).append("svg").attr("width",p).attr("height",p).append("g").attr("transform","translate("+p/2+","+p/2+")")),(()=>{const t=s.selectAll("path").data(O(i)).enter().append("path").attr("class","chart__arc").attr("title",(t=>t.data.name)).attr("stroke",(t=>`${a[t.index]}`)).attr("stroke-width","4px").style("fill",(t=>r.length>0?`url(#${t.data.patternId})`:(a.length,`${a[t.index]}`)));s.append("svg:text").attr("text-anchor","middle").attr("font-size","28").attr("fill","#333").text(String(l)),s.append("svg:text").attr("text-anchor","middle").attr("font-size","22").attr("fill","#333").attr("dy","1.5rem").text(h),t.transition().delay(((t,e)=>e*b)).duration(b).attrTween("d",(t=>{if(0===t.data.total)return()=>"";const e=v(t.startAngle+.1,t.endAngle);return n=>(t.endAngle=e(n),M(t)||"")})),t.on("mousemove",((t,e)=>{n(8,R={left:t.pageX+10+"px",top:t.pageY-25+"px",text:e.data.customTooltip?e.data.customTooltip:e.data.name,show:!0})})).on("mouseover",((t,e)=>{var n=s.selectAll(".chart__arc").filter((function(t){return t===e})),i=s.selectAll(".chart__arc").filter((function(t){return t!=e}));i.style("opacity",.7),n.style("transform","scale(1.02)")})).on("mouseout",((t,e)=>{var i=s.selectAll(".chart__arc").filter((function(t){return t===e})),r=s.selectAll(".chart__arc").filter((function(t){return t!=e}));r.style("opacity",1),i.style("transform","scale(1)"),n(8,R.show=!1,R)})).on("click",((t,e)=>{j.dispatch("donut-clicked",e)})),setTimeout((()=>{C(i)}),b*i.length)})())},[m,u,y,k,g,o,i,s,R,a,r,D,function(t,e,n,i){return n.length>0?`url(#${t.patternId})`:i.length>0?a[e]:void 0},d,c,h,p,x,b,T,t=>D(t.name),function(t){w[t?"unshift":"push"]((()=>{o=t,n(5,o)}))}]}class st extends t{constructor(t){super();const l=document.createElement("style");l.textContent='.mt-heading{font-family:"Roboto", sans-serif;font-weight:400;color:#000000;display:block;margin-bottom:2rem}.mt-heading--underline::after{content:"";display:block;height:0.25rem;background-color:#00919f}.mt-heading--line-primary-01-200::after,.mt-heading--line-lightest::after{background-color:#91d5db}.mt-heading--line-primary-02-200::after{background-color:#cfd2d8}.mt-heading--line-primary-02-600::after{background-color:#494f60}.mt-heading--center{text-align:center}.mt-heading--center.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right{text-align:right}.mt-heading--right.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left{text-align:left}.mt-heading--left.mt-heading--underline::after{margin-left:0;margin-right:auto}.mt-heading--s{font-size:1.4375rem;line-height:1.3913043478}.mt-heading--s.mt-heading--underline::after{width:4rem;margin-top:1rem}.mt-heading--s.mt-heading--line-height-xs{line-height:1.0434782609}.mt-heading--m{font-size:1.75rem;line-height:1.2857142857}.mt-heading--m.mt-heading--underline::after{width:4.5rem;margin-top:1rem}.mt-heading--m.mt-heading--line-height-xs{line-height:1}.mt-heading--l{font-size:2.125rem;line-height:1.2941176471}.mt-heading--l.mt-heading--underline::after{width:5rem;margin-top:1.25rem}.mt-heading--l.mt-heading--line-height-xs{line-height:1.0588235294}.mt-heading--lightest{color:#ffffff}.mt-heading--light{font-weight:300}.mt-heading--semi-bold,.mt-heading--underline{font-weight:700}@media screen and (min-width: 680px){.mt-heading--center\\@from-m{text-align:center}.mt-heading--center\\@from-m.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-m{text-align:right}.mt-heading--right\\@from-m.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-m{text-align:left}.mt-heading--left\\@from-m.mt-heading--underline::after{margin-left:0;margin-right:auto}.mt-heading--s{font-size:1.75rem;line-height:1.2857142857}.mt-heading--s.mt-heading--underline::after{width:4.5rem;margin-top:1rem}.mt-heading--s.mt-heading--line-height-xs{line-height:1}.mt-heading--m{font-size:2.125rem;line-height:1.2941176471}.mt-heading--m.mt-heading--underline::after{width:5rem;margin-top:1.25rem}.mt-heading--m.mt-heading--line-height-xs{line-height:1.0588235294}.mt-heading--l{font-size:2.5625rem;line-height:1.3658536585}.mt-heading--l.mt-heading--underline::after{width:5.5rem;margin-top:1.5rem}.mt-heading--l.mt-heading--line-height-xs{line-height:0.9756097561}}@media screen and (min-width: 1024px){.mt-heading--center\\@from-l{text-align:center}.mt-heading--center\\@from-l.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-l{text-align:right}.mt-heading--right\\@from-l.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-l{text-align:left}.mt-heading--left\\@from-l.mt-heading--underline::after{margin-left:0;margin-right:auto}.mt-heading--s{font-size:2.125rem;line-height:1.2941176471}.mt-heading--s.mt-heading--underline::after{width:5rem;margin-top:1.25rem}.mt-heading--s.mt-heading--line-height-xs{line-height:1.0588235294}.mt-heading--m{font-size:2.5625rem;line-height:1.3658536585}.mt-heading--m.mt-heading--underline::after{width:5.5rem;margin-top:1.5rem}.mt-heading--m.mt-heading--line-height-xs{line-height:0.9756097561}.mt-heading--l{font-size:3.0625rem;line-height:1.387755102;margin-bottom:3.5rem}.mt-heading--l.mt-heading--underline::after{width:6rem;margin-top:2rem}.mt-heading--l.mt-heading--line-height-xs{line-height:0.9795918367}}@media screen and (min-width: 1280px){.mt-heading--center\\@from-xl{text-align:center}.mt-heading--center\\@from-xl.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-xl{text-align:right}.mt-heading--right\\@from-xl.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-xl{text-align:left}.mt-heading--left\\@from-xl.mt-heading--underline::after{margin-left:0;margin-right:auto}}@media screen and (min-width: 1920px){.mt-heading--center\\@from-xxl{text-align:center}.mt-heading--center\\@from-xxl.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-xxl{text-align:right}.mt-heading--right\\@from-xxl.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-xxl{text-align:left}.mt-heading--left\\@from-xxl.mt-heading--underline::after{margin-left:0;margin-right:auto}}.opaque{opacity:0.7}.chart{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;background-color:#ffffff;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.chart--top{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.chart--right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.chart--bottom{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.chart--left{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.chart__tooltip{position:absolute;width:auto;height:auto;background-color:#4d4d4d;border-radius:4px;color:#ffffff;padding:0.5rem 1rem;text-align:center}.chart__arc{cursor:pointer;-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;-o-transition:transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.legend{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;padding:0 1.5rem;height:100%;margin:0;color:#000000}.legend__title{padding:0.75rem;white-space:nowrap;margin:0}.legend__title--light{color:#808080}.legend__item{cursor:pointer;background:none;border:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;margin-left:0.75rem;margin-bottom:0.25rem;font-size:0.875rem}.legend__item:focus,.legend__item:hover{outline:0;text-decoration:underline}.legend__box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:0.75rem;height:16px;width:24px}.legend__text{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;white-space:nowrap;margin:0 0 0.25rem 0;padding:0}.legend__text--light{color:#808080}.legend__text--not-selected{text-decoration:line-through}.pattern{z-index:-1;position:absolute}',this.shadowRoot.appendChild(l),e(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},ot,rt,a,{data:4,svgs:13,colors:14,title:15,legendseparator:0,legendseparatorcount:1,dimension:16,padangle:17,backgroundcolor:2,delay:18,legendposition:3},null,[-1,-1]),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),r()))}static get observedAttributes(){return["data","svgs","colors","title","legendseparator","legendseparatorcount","dimension","padangle","backgroundcolor","delay","legendposition"]}get data(){return this.$$.ctx[4]}set data(t){this.$$set({data:t}),r()}get svgs(){return this.$$.ctx[13]}set svgs(t){this.$$set({svgs:t}),r()}get colors(){return this.$$.ctx[14]}set colors(t){this.$$set({colors:t}),r()}get title(){return this.$$.ctx[15]}set title(t){this.$$set({title:t}),r()}get legendseparator(){return this.$$.ctx[0]}set legendseparator(t){this.$$set({legendseparator:t}),r()}get legendseparatorcount(){return this.$$.ctx[1]}set legendseparatorcount(t){this.$$set({legendseparatorcount:t}),r()}get dimension(){return this.$$.ctx[16]}set dimension(t){this.$$set({dimension:t}),r()}get padangle(){return this.$$.ctx[17]}set padangle(t){this.$$set({padangle:t}),r()}get backgroundcolor(){return this.$$.ctx[2]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),r()}get delay(){return this.$$.ctx[18]}set delay(t){this.$$set({delay:t}),r()}get legendposition(){return this.$$.ctx[3]}set legendposition(t){this.$$set({legendposition:t}),r()}}customElements.define("m-donut",st);export{st as default};
1
+ import{S as t,i as e,a as n,b as i,f as r,s as a,e as l,d as o,n as s,g,J as d,j as c,o as h,O as m,a1 as f,G as u,l as p,t as x,k as y,P as b,H as w,Z as k}from"../../index-52f16292.js";import{s as $,a as v}from"../../transform-15d69d5d.js";import{E as _}from"../../EventHandler-f4efd23c.js";import{c as A,a as z}from"../../array-5b770a93.js";import{w as T,p as j,c as R,s as E,h as O,e as M,t as S,a as N,m as C,b as D,d as F,f as I,g as J,i as P}from"../../path-1b5da959.js";function H(t){return t.innerRadius}function q(t){return t.outerRadius}function B(t){return t.startAngle}function G(t){return t.endAngle}function V(t){return t&&t.padAngle}function X(t,e,n,i,r,a,l){var o=t-n,s=e-i,g=(l?a:-a)/N(o*o+s*s),d=g*s,c=-g*o,h=t+d,m=e+c,f=n+d,u=i+c,p=(h+f)/2,x=(m+u)/2,y=f-h,b=u-m,w=y*y+b*b,k=r-a,$=h*u-f*m,v=(b<0?-1:1)*N(P(0,k*k*w-$*$)),_=($*b-y*v)/w,A=(-$*y-b*v)/w,z=($*b+y*v)/w,T=(-$*y+b*v)/w,j=_-p,R=A-x,E=z-p,O=T-x;return j*j+R*R>E*E+O*O&&(_=z,A=T),{cx:_,cy:A,x01:-d,y01:-c,x11:_*(r/k-1),y11:A*(r/k-1)}}function Y(){var t=H,e=q,n=A(0),i=null,r=B,a=G,l=V,o=null,s=T(g);function g(){var g,d,c=+t.apply(this,arguments),h=+e.apply(this,arguments),m=r.apply(this,arguments)-O,f=a.apply(this,arguments)-O,u=D(f-m),p=f>m;if(o||(o=g=s()),h<c&&(d=h,h=c,c=d),h>M)if(u>S-M)o.moveTo(h*R(m),h*E(m)),o.arc(0,0,h,m,f,!p),c>M&&(o.moveTo(c*R(f),c*E(f)),o.arc(0,0,c,f,m,p));else{var x,y,b=m,w=f,k=m,$=f,v=u,_=u,A=l.apply(this,arguments)/2,z=A>M&&(i?+i.apply(this,arguments):N(c*c+h*h)),T=C(D(h-c)/2,+n.apply(this,arguments)),P=T,H=T;if(z>M){var q=I(z/c*E(A)),B=I(z/h*E(A));(v-=2*q)>M?(k+=q*=p?1:-1,$-=q):(v=0,k=$=(m+f)/2),(_-=2*B)>M?(b+=B*=p?1:-1,w-=B):(_=0,b=w=(m+f)/2)}var G=h*R(b),V=h*E(b),Y=c*R($),Z=c*E($);if(T>M){var K,L=h*R(w),Q=h*E(w),U=c*R(k),W=c*E(k);if(u<j)if(K=function(t,e,n,i,r,a,l,o){var s=n-t,g=i-e,d=l-r,c=o-a,h=c*s-d*g;if(!(h*h<M))return[t+(h=(d*(e-a)-c*(t-r))/h)*s,e+h*g]}(G,V,U,W,L,Q,Y,Z)){var tt=G-K[0],et=V-K[1],nt=L-K[0],it=Q-K[1],rt=1/E(J((tt*nt+et*it)/(N(tt*tt+et*et)*N(nt*nt+it*it)))/2),at=N(K[0]*K[0]+K[1]*K[1]);P=C(T,(c-at)/(rt-1)),H=C(T,(h-at)/(rt+1))}else P=H=0}_>M?H>M?(x=X(U,W,G,V,h,H,p),y=X(L,Q,Y,Z,h,H,p),o.moveTo(x.cx+x.x01,x.cy+x.y01),H<T?o.arc(x.cx,x.cy,H,F(x.y01,x.x01),F(y.y01,y.x01),!p):(o.arc(x.cx,x.cy,H,F(x.y01,x.x01),F(x.y11,x.x11),!p),o.arc(0,0,h,F(x.cy+x.y11,x.cx+x.x11),F(y.cy+y.y11,y.cx+y.x11),!p),o.arc(y.cx,y.cy,H,F(y.y11,y.x11),F(y.y01,y.x01),!p))):(o.moveTo(G,V),o.arc(0,0,h,b,w,!p)):o.moveTo(G,V),c>M&&v>M?P>M?(x=X(Y,Z,L,Q,c,-P,p),y=X(G,V,U,W,c,-P,p),o.lineTo(x.cx+x.x01,x.cy+x.y01),P<T?o.arc(x.cx,x.cy,P,F(x.y01,x.x01),F(y.y01,y.x01),!p):(o.arc(x.cx,x.cy,P,F(x.y01,x.x01),F(x.y11,x.x11),!p),o.arc(0,0,c,F(x.cy+x.y11,x.cx+x.x11),F(y.cy+y.y11,y.cx+y.x11),p),o.arc(y.cx,y.cy,P,F(y.y11,y.x11),F(y.y01,y.x01),!p))):o.arc(0,0,c,$,k,p):o.lineTo(Y,Z)}else o.moveTo(0,0);if(o.closePath(),g)return o=null,g+""||null}return g.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-j/2;return[R(i)*n,E(i)*n]},g.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:A(+e),g):t},g.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:A(+t),g):e},g.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:A(+t),g):n},g.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:A(+t),g):i},g.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:A(+t),g):r},g.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:A(+t),g):a},g.padAngle=function(t){return arguments.length?(l="function"==typeof t?t:A(+t),g):l},g.context=function(t){return arguments.length?(o=null==t?null:t,g):o},g}function Z(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function K(t){return t}function L(t,e,n){const i=t.slice();return i[7]=e[n],i}function Q(t,e,n){const i=t.slice();return i[4]=e[n],i[33]=n,i}function U(t,e,n){const i=t.slice();return i[34]=e[n],i}function W(t){let e,n,r,a=t[34].split(t[1])[1]+"";return{c(){e=l("span"),n=x("("),r=x(a),g(e,"class","legend__text--light")},m(t,a){i(t,e,a),c(e,n),c(e,r)},p(t,e){67&e[0]&&a!==(a=t[34].split(t[1])[1]+"")&&y(r,a)},d(t){t&&h(e)}}}function tt(t){let e,n,r,a,s,d=t[34].split(t[1])[0]+"",m=t[34].split(t[1])[1],f=m&&W(t);return{c(){e=l("p"),n=x(d),r=o(),f&&f.c(),a=o(),g(e,"class",s=at(t[4].checked))},m(t,l){i(t,e,l),c(e,n),c(e,r),f&&f.m(e,null),c(e,a)},p(t,i){67&i[0]&&d!==(d=t[34].split(t[1])[0]+"")&&y(n,d),67&i[0]&&(m=t[34].split(t[1])[1]),m?f?f.p(t,i):(f=W(t),f.c(),f.m(e,a)):f&&(f.d(1),f=null),64&i[0]&&s!==(s=at(t[4].checked))&&g(e,"class",s)},d(t){t&&h(e),f&&f.d()}}}function et(t){let e,n,r,a,s,d,f,x,y,b=t[4].name.split(t[0]),w=[];for(let e=0;e<b.length;e+=1)w[e]=tt(U(t,b,e));function k(){return t[20](t[4])}return{c(){e=l("button"),n=u("svg"),r=u("rect"),s=o(),d=l("div");for(let t=0;t<w.length;t+=1)w[t].c();f=o(),g(r,"x","0"),g(r,"y","0"),g(r,"width","24"),g(r,"height","16"),g(r,"fill",a=t[12](t[4],t[33],t[10],t[9])),g(n,"class","legend__box"),g(e,"class","legend__item")},m(t,a){i(t,e,a),c(e,n),c(n,r),c(e,s),c(e,d);for(let t=0;t<w.length;t+=1)w[t]&&w[t].m(d,null);c(e,f),x||(y=p(e,"click",k),x=!0)},p(e,n){if(t=e,1600&n[0]&&a!==(a=t[12](t[4],t[33],t[10],t[9]))&&g(r,"fill",a),67&n[0]){let e;for(b=t[4].name.split(t[0]),e=0;e<b.length;e+=1){const i=U(t,b,e);w[e]?w[e].p(i,n):(w[e]=tt(i),w[e].c(),w[e].m(d,null))}for(;e<w.length;e+=1)w[e].d(1);w.length=b.length}},d(t){t&&h(e),m(w,t),x=!1,y()}}}function nt(t){let e,n,r=t[8].text+"";return{c(){e=l("div"),n=x(r),g(e,"class","chart__tooltip"),d(e,"left",t[8].left),d(e,"top",t[8].top)},m(t,r){i(t,e,r),c(e,n)},p(t,i){256&i[0]&&r!==(r=t[8].text+"")&&y(n,r),256&i[0]&&d(e,"left",t[8].left),256&i[0]&&d(e,"top",t[8].top)},d(t){t&&h(e)}}}function it(t){let e,n,r=t[7]+"";return{c(){e=new k(!1),n=b(),e.a=n},m(t,a){e.m(r,t,a),i(t,n,a)},p(t,n){1024&n[0]&&r!==(r=t[7]+"")&&e.p(r)},d(t){t&&h(n),t&&e.d()}}}function rt(t){let e,n,r,a,f,u,p=t[6],x=[];for(let e=0;e<p.length;e+=1)x[e]=et(Q(t,p,e));let y=t[8].show&&nt(t),b=t[10],w=[];for(let e=0;e<b.length;e+=1)w[e]=it(L(t,b,e));return{c(){e=l("div"),n=l("div");for(let t=0;t<x.length;t+=1)x[t].c();r=o(),y&&y.c(),f=o(),u=l("div");for(let t=0;t<w.length;t+=1)w[t].c();this.c=s,g(n,"class","legend"),g(e,"class",a="chart "+lt(t[3])),d(e,"background-color",t[2]),d(u,"height","0"),d(u,"width","0"),g(u,"class","pattern")},m(a,l){i(a,e,l),c(e,n);for(let t=0;t<x.length;t+=1)x[t]&&x[t].m(n,null);c(e,r),y&&y.m(e,null),t[21](e),i(a,f,l),i(a,u,l);for(let t=0;t<w.length;t+=1)w[t]&&w[t].m(u,null)},p(t,i){if(7747&i[0]){let e;for(p=t[6],e=0;e<p.length;e+=1){const r=Q(t,p,e);x[e]?x[e].p(r,i):(x[e]=et(r),x[e].c(),x[e].m(n,null))}for(;e<x.length;e+=1)x[e].d(1);x.length=p.length}if(t[8].show?y?y.p(t,i):(y=nt(t),y.c(),y.m(e,null)):y&&(y.d(1),y=null),8&i[0]&&a!==(a="chart "+lt(t[3]))&&g(e,"class",a),4&i[0]&&d(e,"background-color",t[2]),1024&i[0]){let e;for(b=t[10],e=0;e<b.length;e+=1){const n=L(t,b,e);w[e]?w[e].p(n,i):(w[e]=it(n),w[e].c(),w[e].m(u,null))}for(;e<w.length;e+=1)w[e].d(1);w.length=b.length}},i:s,o:s,d(n){n&&h(e),m(x,n),y&&y.d(),t[21](null),n&&h(f),n&&h(u),m(w,n)}}}function at(t){return"legend__text"+(t?" legend__text--not-selected":"")}function lt(t){switch(t){case"top":return"chart--top";case"right":default:return"chart--right";case"bottom":return"chart--bottom";case"left":return"chart--left"}}function ot(t,e,n){let i,r,a,l,o,s,{data:g=""}=e,{svgs:d}=e,{colors:c}=e,{title:h}=e,{legendseparator:m=","}=e,{legendseparatorcount:u="("}=e,{dimension:p=250}=e,{padangle:x=.05}=e,{backgroundcolor:y="#fff"}=e,{delay:b=500}=e,{legendposition:k="right"}=e,T=!1,j=new _,R={left:"0px",top:"0px",text:"",show:!1};const E=p/2,O=Y().outerRadius(E-5).innerRadius(E-60).padAngle(x),M=function(){var t=K,e=Z,n=null,i=A(0),r=A(S),a=A(0);function l(l){var o,s,g,d,c,h=(l=z(l)).length,m=0,f=new Array(h),u=new Array(h),p=+i.apply(this,arguments),x=Math.min(S,Math.max(-S,r.apply(this,arguments)-p)),y=Math.min(Math.abs(x)/h,a.apply(this,arguments)),b=y*(x<0?-1:1);for(o=0;o<h;++o)(c=u[f[o]=o]=+t(l[o],o,l))>0&&(m+=c);for(null!=e?f.sort((function(t,n){return e(u[t],u[n])})):null!=n&&f.sort((function(t,e){return n(l[t],l[e])})),o=0,g=m?(x-h*b)/m:0;o<h;++o,p=d)s=f[o],d=p+((c=u[s])>0?c*g:0)+b,u[s]={data:l[s],index:o,value:c,startAngle:p,endAngle:d,padAngle:y};return u}return l.value=function(e){return arguments.length?(t="function"==typeof e?e:A(+e),l):t},l.sortValues=function(t){return arguments.length?(e=t,n=null,l):e},l.sort=function(t){return arguments.length?(n=t,e=null,l):n},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:A(+t),l):i},l.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:A(+t),l):r},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:A(+t),l):a},l}().sort(null).startAngle(1.1*Math.PI).endAngle(3.1*Math.PI).value((t=>t.total)),N=()=>i?i.filter((t=>!t.checked)).reduce(((t,e)=>t+e.total),0):[];function C(t){s.selectAll("path").data(M(t)).transition().duration(b).attr("stroke-width",((t,e)=>i[e].checked?"0px":"4px")).attrTween("d",(function(t){const e=v(this._current,t);return this._current=e(0),t=>O(e(t))||""})),s.selectAll("svg text").filter((function(){return/^[0-9]/.test($(this).text())})).text(String(N()))}function D(t){const e=s.selectAll("path").data().map(((e,r)=>{const a=e.data;if(a.name===t){n(6,i[r].checked=!i[r].checked,i);const t=0===a.total?i[r].total:0;return Object.assign(Object.assign({},a),{total:t})}return Object.assign({},a)}));C(e)}f((()=>n(19,T=!0)));return t.$$set=t=>{"data"in t&&n(4,g=t.data),"svgs"in t&&n(13,d=t.svgs),"colors"in t&&n(14,c=t.colors),"title"in t&&n(15,h=t.title),"legendseparator"in t&&n(0,m=t.legendseparator),"legendseparatorcount"in t&&n(1,u=t.legendseparatorcount),"dimension"in t&&n(16,p=t.dimension),"padangle"in t&&n(17,x=t.padangle),"backgroundcolor"in t&&n(2,y=t.backgroundcolor),"delay"in t&&n(18,b=t.delay),"legendposition"in t&&n(3,k=t.legendposition)},t.$$.update=()=>{16&t.$$.dirty[0]&&n(6,i=g?JSON.parse(g):[]),8192&t.$$.dirty[0]&&n(10,r=d?JSON.parse(d):[]),16384&t.$$.dirty[0]&&n(9,a=c?JSON.parse(c):["#605F9D","#D9F0F3","#EAEDEF","#0B96CC","#EA7315","#EA302D"]),64&t.$$.dirty[0]&&(l=i?i.filter((t=>!t.checked)).reduce(((t,e)=>t+e.total),0):[]),59e4&t.$$.dirty[0]&&g.length>0&&T&&(s?s.selectAll("path").remove():n(7,s=$(o).append("svg").attr("width",p).attr("height",p).append("g").attr("transform","translate("+p/2+","+p/2+")")),(()=>{const t=s.selectAll("path").data(M(i)).enter().append("path").attr("class","chart__arc").attr("title",(t=>t.data.name)).attr("stroke",(t=>`${a[t.index]}`)).attr("stroke-width","4px").style("fill",(t=>r.length>0?`url(#${t.data.patternId})`:(a.length,`${a[t.index]}`)));s.append("svg:text").attr("text-anchor","middle").attr("font-size","28").attr("fill","#333").text(String(l)),s.append("svg:text").attr("text-anchor","middle").attr("font-size","22").attr("fill","#333").attr("dy","1.5rem").text(h),t.transition().delay(((t,e)=>e*b)).duration(b).attrTween("d",(t=>{if(0===t.data.total)return()=>"";const e=v(t.startAngle+.1,t.endAngle);return n=>(t.endAngle=e(n),O(t)||"")})),t.on("mousemove",((t,e)=>{n(8,R={left:t.pageX+10+"px",top:t.pageY-25+"px",text:e.data.customTooltip?e.data.customTooltip:e.data.name,show:!0})})).on("mouseover",((t,e)=>{var n=s.selectAll(".chart__arc").filter((function(t){return t===e})),i=s.selectAll(".chart__arc").filter((function(t){return t!=e}));i.style("opacity",.7),n.style("transform","scale(1.02)")})).on("mouseout",((t,e)=>{var i=s.selectAll(".chart__arc").filter((function(t){return t===e})),r=s.selectAll(".chart__arc").filter((function(t){return t!=e}));r.style("opacity",1),i.style("transform","scale(1)"),n(8,R.show=!1,R)})).on("click",((t,e)=>{j.dispatch("donut-clicked",e)})),setTimeout((()=>{C(i)}),b*i.length)})())},[m,u,y,k,g,o,i,s,R,a,r,D,function(t,e,n,i){return n.length>0?`url(#${t.patternId})`:i.length>0?a[e]:void 0},d,c,h,p,x,b,T,t=>D(t.name),function(t){w[t?"unshift":"push"]((()=>{o=t,n(5,o)}))}]}class st extends t{constructor(t){super();const l=document.createElement("style");l.textContent='.mt-heading{font-family:"Roboto", sans-serif;font-weight:400;color:#000000;display:block;margin-bottom:2rem}.mt-heading--underline::after{content:"";display:block;height:0.25rem;background-color:#00919f}.mt-heading--line-primary-01-200::after,.mt-heading--line-lightest::after{background-color:#91d5db}.mt-heading--line-primary-02-200::after{background-color:#cfd2d8}.mt-heading--line-primary-02-600::after{background-color:#494f60}.mt-heading--center{text-align:center}.mt-heading--center.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right{text-align:right}.mt-heading--right.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left{text-align:left}.mt-heading--left.mt-heading--underline::after{margin-left:0;margin-right:auto}.mt-heading--s{font-size:1.4375rem;line-height:1.3913043478}.mt-heading--s.mt-heading--underline::after{width:4rem;margin-top:1rem}.mt-heading--s.mt-heading--line-height-xs{line-height:1.0434782609}.mt-heading--m{font-size:1.75rem;line-height:1.2857142857}.mt-heading--m.mt-heading--underline::after{width:4.5rem;margin-top:1rem}.mt-heading--m.mt-heading--line-height-xs{line-height:1}.mt-heading--l{font-size:2.125rem;line-height:1.2941176471}.mt-heading--l.mt-heading--underline::after{width:5rem;margin-top:1.25rem}.mt-heading--l.mt-heading--line-height-xs{line-height:1.0588235294}.mt-heading--lightest{color:#ffffff}.mt-heading--light{font-weight:300}.mt-heading--semi-bold,.mt-heading--underline{font-weight:700}@media screen and (min-width: 680px){.mt-heading--center\\@from-m{text-align:center}.mt-heading--center\\@from-m.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-m{text-align:right}.mt-heading--right\\@from-m.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-m{text-align:left}.mt-heading--left\\@from-m.mt-heading--underline::after{margin-left:0;margin-right:auto}.mt-heading--s{font-size:1.75rem;line-height:1.2857142857}.mt-heading--s.mt-heading--underline::after{width:4.5rem;margin-top:1rem}.mt-heading--s.mt-heading--line-height-xs{line-height:1}.mt-heading--m{font-size:2.125rem;line-height:1.2941176471}.mt-heading--m.mt-heading--underline::after{width:5rem;margin-top:1.25rem}.mt-heading--m.mt-heading--line-height-xs{line-height:1.0588235294}.mt-heading--l{font-size:2.5625rem;line-height:1.3658536585}.mt-heading--l.mt-heading--underline::after{width:5.5rem;margin-top:1.5rem}.mt-heading--l.mt-heading--line-height-xs{line-height:0.9756097561}}@media screen and (min-width: 1024px){.mt-heading--center\\@from-l{text-align:center}.mt-heading--center\\@from-l.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-l{text-align:right}.mt-heading--right\\@from-l.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-l{text-align:left}.mt-heading--left\\@from-l.mt-heading--underline::after{margin-left:0;margin-right:auto}.mt-heading--s{font-size:2.125rem;line-height:1.2941176471}.mt-heading--s.mt-heading--underline::after{width:5rem;margin-top:1.25rem}.mt-heading--s.mt-heading--line-height-xs{line-height:1.0588235294}.mt-heading--m{font-size:2.5625rem;line-height:1.3658536585}.mt-heading--m.mt-heading--underline::after{width:5.5rem;margin-top:1.5rem}.mt-heading--m.mt-heading--line-height-xs{line-height:0.9756097561}.mt-heading--l{font-size:3.0625rem;line-height:1.387755102;margin-bottom:3.5rem}.mt-heading--l.mt-heading--underline::after{width:6rem;margin-top:2rem}.mt-heading--l.mt-heading--line-height-xs{line-height:0.9795918367}}@media screen and (min-width: 1280px){.mt-heading--center\\@from-xl{text-align:center}.mt-heading--center\\@from-xl.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-xl{text-align:right}.mt-heading--right\\@from-xl.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-xl{text-align:left}.mt-heading--left\\@from-xl.mt-heading--underline::after{margin-left:0;margin-right:auto}}@media screen and (min-width: 1920px){.mt-heading--center\\@from-xxl{text-align:center}.mt-heading--center\\@from-xxl.mt-heading--underline::after{margin-left:auto;margin-right:auto}.mt-heading--right\\@from-xxl{text-align:right}.mt-heading--right\\@from-xxl.mt-heading--underline::after{margin-left:auto;margin-right:0}.mt-heading--left\\@from-xxl{text-align:left}.mt-heading--left\\@from-xxl.mt-heading--underline::after{margin-left:0;margin-right:auto}}.opaque{opacity:0.7}.chart{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;background-color:#ffffff;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.chart--top{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.chart--right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.chart--bottom{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.chart--left{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.chart__tooltip{position:absolute;width:auto;height:auto;background-color:#4d4d4d;border-radius:4px;color:#ffffff;padding:0.5rem 1rem;text-align:center}.chart__arc{cursor:pointer;-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;-o-transition:transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.legend{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;padding:0 1.5rem;height:100%;margin:0;color:#000000}.legend__title{padding:0.75rem;white-space:nowrap;margin:0}.legend__title--light{color:#808080}.legend__item{cursor:pointer;background:none;border:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;margin-left:0.75rem;margin-bottom:0.25rem;font-size:0.875rem}.legend__item:focus,.legend__item:hover{outline:0;text-decoration:underline}.legend__box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:0.75rem;height:16px;width:24px}.legend__text{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;white-space:nowrap;margin:0 0 0.25rem 0;padding:0}.legend__text--light{color:#808080}.legend__text--not-selected{text-decoration:line-through}.pattern{z-index:-1;position:absolute}',this.shadowRoot.appendChild(l),e(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},ot,rt,a,{data:4,svgs:13,colors:14,title:15,legendseparator:0,legendseparatorcount:1,dimension:16,padangle:17,backgroundcolor:2,delay:18,legendposition:3},null,[-1,-1]),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),r()))}static get observedAttributes(){return["data","svgs","colors","title","legendseparator","legendseparatorcount","dimension","padangle","backgroundcolor","delay","legendposition"]}get data(){return this.$$.ctx[4]}set data(t){this.$$set({data:t}),r()}get svgs(){return this.$$.ctx[13]}set svgs(t){this.$$set({svgs:t}),r()}get colors(){return this.$$.ctx[14]}set colors(t){this.$$set({colors:t}),r()}get title(){return this.$$.ctx[15]}set title(t){this.$$set({title:t}),r()}get legendseparator(){return this.$$.ctx[0]}set legendseparator(t){this.$$set({legendseparator:t}),r()}get legendseparatorcount(){return this.$$.ctx[1]}set legendseparatorcount(t){this.$$set({legendseparatorcount:t}),r()}get dimension(){return this.$$.ctx[16]}set dimension(t){this.$$set({dimension:t}),r()}get padangle(){return this.$$.ctx[17]}set padangle(t){this.$$set({padangle:t}),r()}get backgroundcolor(){return this.$$.ctx[2]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),r()}get delay(){return this.$$.ctx[18]}set delay(t){this.$$set({delay:t}),r()}get legendposition(){return this.$$.ctx[3]}set legendposition(t){this.$$set({legendposition:t}),r()}}customElements.define("m-donut",st);export{st as default};
2
2
  //# sourceMappingURL=Donut.js.map