@zanichelli/albe-web-components 20.0.2 → 21.0.0-RC2

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 (406) hide show
  1. package/dist/cjs/dialog-polyfill.esm-D8Polhcd.js +863 -0
  2. package/dist/cjs/dialog-polyfill.esm-D8Polhcd.js.map +1 -0
  3. package/dist/cjs/hammer-CJF2Ixtg.js +2665 -0
  4. package/dist/cjs/hammer-CJF2Ixtg.js.map +1 -0
  5. package/dist/cjs/index-CZz7uP-M.js +6 -6
  6. package/dist/cjs/z-app-header_12.cjs.entry.js +7 -1
  7. package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
  8. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +8 -862
  9. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -1
  10. package/dist/cjs/z-toast-notification.cjs.entry.js +7 -2657
  11. package/dist/cjs/z-toast-notification.cjs.entry.js.map +1 -1
  12. package/dist/collection/components/z-input/index.js +7 -1
  13. package/dist/collection/components/z-input/index.js.map +1 -1
  14. package/dist/collection/components/z-modal/index.js +8 -6
  15. package/dist/collection/components/z-modal/index.js.map +1 -1
  16. package/dist/collection/components/z-toast-notification/index.js +7 -5
  17. package/dist/collection/components/z-toast-notification/index.js.map +1 -1
  18. package/dist/components/index.js +1 -1
  19. package/dist/components/index.js.map +1 -1
  20. package/dist/components/{utils.js → p-8C_CrFxp.js} +3 -3
  21. package/dist/components/p-B3VFztJH.js +6 -0
  22. package/dist/components/p-B5U9pSXR.js +2 -0
  23. package/dist/components/{index14.js.map → p-B5U9pSXR.js.map} +1 -1
  24. package/dist/components/p-B6jtvVtV.js +2 -0
  25. package/dist/components/{utils2.js.map → p-B6jtvVtV.js.map} +1 -1
  26. package/dist/components/{_commonjsHelpers.js → p-B85MJLTf.js} +1 -1
  27. package/dist/components/p-BAguKZnb.js +2 -0
  28. package/dist/components/{index4.js.map → p-BAguKZnb.js.map} +1 -1
  29. package/dist/components/p-BRkq64wS.js +2 -0
  30. package/dist/components/p-BRkq64wS.js.map +1 -0
  31. package/dist/components/p-BeSVHdId.js +2 -0
  32. package/dist/components/{index9.js.map → p-BeSVHdId.js.map} +1 -1
  33. package/dist/components/p-Bj8MyegH.js +2 -0
  34. package/dist/components/{index18.js.map → p-Bj8MyegH.js.map} +1 -1
  35. package/dist/components/p-BoiZb7m1.js +2 -0
  36. package/dist/components/{index13.js.map → p-BoiZb7m1.js.map} +1 -1
  37. package/dist/components/p-BolVsvfr.js +2 -0
  38. package/dist/components/{index5.js.map → p-BolVsvfr.js.map} +1 -1
  39. package/dist/components/p-Bt1M0wUw.js +7 -0
  40. package/dist/components/p-Bt1M0wUw.js.map +1 -0
  41. package/dist/components/p-BvCsF6Eq.js +2 -0
  42. package/dist/components/p-BvCsF6Eq.js.map +1 -0
  43. package/dist/components/p-CGSP8diU.js +2 -0
  44. package/dist/components/{index15.js.map → p-CGSP8diU.js.map} +1 -1
  45. package/dist/components/p-CJjo0ntH.js +2 -0
  46. package/dist/components/{index12.js.map → p-CJjo0ntH.js.map} +1 -1
  47. package/dist/components/p-CaSvyuw6.js +2 -0
  48. package/dist/components/{index17.js.map → p-CaSvyuw6.js.map} +1 -1
  49. package/dist/components/p-CbXEdwLi.js +2 -0
  50. package/dist/components/{index3.js.map → p-CbXEdwLi.js.map} +1 -1
  51. package/dist/components/p-CdBqnUF6.js +2 -0
  52. package/dist/components/{index7.js.map → p-CdBqnUF6.js.map} +1 -1
  53. package/dist/components/p-Ch6o4_VN.js +2 -0
  54. package/dist/components/{index21.js.map → p-Ch6o4_VN.js.map} +1 -1
  55. package/dist/components/{iconset.js → p-D1c5gR45.js} +1 -1
  56. package/dist/components/p-D8wde41u.js +2 -0
  57. package/dist/components/{index16.js.map → p-D8wde41u.js.map} +1 -1
  58. package/dist/components/p-DL2QAfIP.js +2 -0
  59. package/dist/components/{index11.js.map → p-DL2QAfIP.js.map} +1 -1
  60. package/dist/components/{index2.js → p-DdetsoIY.js} +1 -1
  61. package/dist/components/p-LXvmZzZa.js +2 -0
  62. package/dist/components/p-LXvmZzZa.js.map +1 -0
  63. package/dist/components/{breakpoints.js → p-Q-tWjk7P.js} +1 -1
  64. package/dist/components/p-RmbDDbWd.js +2 -0
  65. package/dist/components/p-RmbDDbWd.js.map +1 -0
  66. package/dist/components/p-VP75-vje.js +2 -0
  67. package/dist/components/{index19.js.map → p-VP75-vje.js.map} +1 -1
  68. package/dist/components/p-cpTAMdcF.js +2 -0
  69. package/dist/components/{index8.js.map → p-cpTAMdcF.js.map} +1 -1
  70. package/dist/components/p-mphirYN3.js +2 -0
  71. package/dist/components/{index10.js.map → p-mphirYN3.js.map} +1 -1
  72. package/dist/components/z-accordion.js +1 -1
  73. package/dist/components/z-accordion.js.map +1 -1
  74. package/dist/components/z-anchor-navigation.js +1 -1
  75. package/dist/components/z-anchor-navigation.js.map +1 -1
  76. package/dist/components/z-app-header.js +1 -1
  77. package/dist/components/z-app-header.js.map +1 -1
  78. package/dist/components/z-aria-alert.js +1 -1
  79. package/dist/components/z-aria-alert.js.map +1 -1
  80. package/dist/components/z-avatar.js +1 -1
  81. package/dist/components/z-avatar.js.map +1 -1
  82. package/dist/components/z-book-card-app.js +1 -1
  83. package/dist/components/z-book-card-app.js.map +1 -1
  84. package/dist/components/z-book-card.js +1 -1
  85. package/dist/components/z-book-card.js.map +1 -1
  86. package/dist/components/z-book-cover.js +1 -1
  87. package/dist/components/z-breadcrumb.js +1 -1
  88. package/dist/components/z-breadcrumb.js.map +1 -1
  89. package/dist/components/z-button-sort.js +1 -1
  90. package/dist/components/z-button-sort.js.map +1 -1
  91. package/dist/components/z-button.js +1 -1
  92. package/dist/components/z-card.js +1 -1
  93. package/dist/components/z-card.js.map +1 -1
  94. package/dist/components/z-carousel.js +1 -1
  95. package/dist/components/z-carousel.js.map +1 -1
  96. package/dist/components/z-chip.js +1 -1
  97. package/dist/components/z-color-picker.js +1 -1
  98. package/dist/components/z-color-picker.js.map +1 -1
  99. package/dist/components/z-combobox.js +1 -1
  100. package/dist/components/z-combobox.js.map +1 -1
  101. package/dist/components/z-cover-hero.js +1 -1
  102. package/dist/components/z-cover-hero.js.map +1 -1
  103. package/dist/components/z-date-picker.js +2 -2
  104. package/dist/components/z-date-picker.js.map +1 -1
  105. package/dist/components/z-divider.js +1 -1
  106. package/dist/components/z-dragdrop-area.js +1 -1
  107. package/dist/components/z-file-upload.js +1 -1
  108. package/dist/components/z-file-upload.js.map +1 -1
  109. package/dist/components/z-file.js +1 -1
  110. package/dist/components/z-file.js.map +1 -1
  111. package/dist/components/z-ghost-loading.js +1 -1
  112. package/dist/components/z-icon.js +1 -1
  113. package/dist/components/z-info-box.js +1 -1
  114. package/dist/components/z-info-box.js.map +1 -1
  115. package/dist/components/z-info-reveal.js +1 -1
  116. package/dist/components/z-input-message.js +1 -1
  117. package/dist/components/z-input-range.js +1 -1
  118. package/dist/components/z-input-range.js.map +1 -1
  119. package/dist/components/z-input.js +1 -1
  120. package/dist/components/z-list-element.js +1 -1
  121. package/dist/components/z-list-group.js +1 -1
  122. package/dist/components/z-list.js +1 -1
  123. package/dist/components/z-logo.js +1 -1
  124. package/dist/components/z-logo.js.map +1 -1
  125. package/dist/components/z-menu-section.js +1 -1
  126. package/dist/components/z-menu-section.js.map +1 -1
  127. package/dist/components/z-menu.js +1 -1
  128. package/dist/components/z-menu.js.map +1 -1
  129. package/dist/components/z-modal.js +1 -1
  130. package/dist/components/z-navigation-tabs.js +1 -1
  131. package/dist/components/z-navigation-tabs.js.map +1 -1
  132. package/dist/components/z-notification.js +1 -1
  133. package/dist/components/z-notification.js.map +1 -1
  134. package/dist/components/z-offcanvas.js +1 -1
  135. package/dist/components/z-pagination.js +1 -1
  136. package/dist/components/z-pagination.js.map +1 -1
  137. package/dist/components/z-popover.js +1 -1
  138. package/dist/components/z-range-picker.js +1 -1
  139. package/dist/components/z-range-picker.js.map +1 -1
  140. package/dist/components/z-result-card.js +1 -1
  141. package/dist/components/z-result-card.js.map +1 -1
  142. package/dist/components/z-searchbar.js +1 -1
  143. package/dist/components/z-select.js +1 -1
  144. package/dist/components/z-select.js.map +1 -1
  145. package/dist/components/z-skip-to-content.js +1 -1
  146. package/dist/components/z-skip-to-content.js.map +1 -1
  147. package/dist/components/z-stepper-item.js +1 -1
  148. package/dist/components/z-stepper-item.js.map +1 -1
  149. package/dist/components/z-stepper.js +1 -1
  150. package/dist/components/z-stepper.js.map +1 -1
  151. package/dist/components/z-table.js +1 -1
  152. package/dist/components/z-table.js.map +1 -1
  153. package/dist/components/z-tag.js +1 -1
  154. package/dist/components/z-tbody.js +1 -1
  155. package/dist/components/z-tbody.js.map +1 -1
  156. package/dist/components/z-td.js +1 -1
  157. package/dist/components/z-td.js.map +1 -1
  158. package/dist/components/z-tfoot.js +1 -1
  159. package/dist/components/z-tfoot.js.map +1 -1
  160. package/dist/components/z-th.js +1 -1
  161. package/dist/components/z-th.js.map +1 -1
  162. package/dist/components/z-thead.js +1 -1
  163. package/dist/components/z-thead.js.map +1 -1
  164. package/dist/components/z-toast-notification-list.js +1 -1
  165. package/dist/components/z-toast-notification-list.js.map +1 -1
  166. package/dist/components/z-toast-notification.js +2 -7
  167. package/dist/components/z-toast-notification.js.map +1 -1
  168. package/dist/components/z-toggle-switch.js +1 -1
  169. package/dist/components/z-toggle-switch.js.map +1 -1
  170. package/dist/components/z-tool.js +1 -1
  171. package/dist/components/z-tool.js.map +1 -1
  172. package/dist/components/z-toolbar.js +1 -1
  173. package/dist/components/z-toolbar.js.map +1 -1
  174. package/dist/components/z-tooltip.js +1 -1
  175. package/dist/components/z-tr.js +1 -1
  176. package/dist/components/z-tr.js.map +1 -1
  177. package/dist/components/z-tree-list.js +1 -1
  178. package/dist/components/z-tree-list.js.map +1 -1
  179. package/dist/components/z-visually-hidden.js +1 -1
  180. package/dist/components/z-visually-hidden.js.map +1 -1
  181. package/dist/esm/dialog-polyfill.esm-BRkq64wS.js +861 -0
  182. package/dist/esm/dialog-polyfill.esm-BRkq64wS.js.map +1 -0
  183. package/dist/esm/hammer-C3JqVNyx.js +2663 -0
  184. package/dist/esm/hammer-C3JqVNyx.js.map +1 -0
  185. package/dist/esm/index-BcDWN4F1.js +6 -6
  186. package/dist/esm/z-app-header_12.entry.js +7 -1
  187. package/dist/esm/z-app-header_12.entry.js.map +1 -1
  188. package/dist/esm/z-dragdrop-area_2.entry.js +8 -862
  189. package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -1
  190. package/dist/esm/z-toast-notification.entry.js +7 -2657
  191. package/dist/esm/z-toast-notification.entry.js.map +1 -1
  192. package/dist/types/components/z-input/index.d.ts +1 -0
  193. package/dist/types/components/z-modal/index.d.ts +1 -1
  194. package/dist/web-components-library/p-67051e01.entry.js +3 -0
  195. package/dist/web-components-library/p-67051e01.entry.js.map +1 -0
  196. package/dist/web-components-library/p-BRkq64wS.js +2 -0
  197. package/dist/web-components-library/p-BRkq64wS.js.map +1 -0
  198. package/dist/web-components-library/p-Bt1M0wUw.js +7 -0
  199. package/dist/web-components-library/p-Bt1M0wUw.js.map +1 -0
  200. package/dist/web-components-library/p-c3f69ac9.entry.js +2 -0
  201. package/dist/web-components-library/p-c3f69ac9.entry.js.map +1 -0
  202. package/dist/web-components-library/p-e2eea612.entry.js +2 -0
  203. package/dist/web-components-library/p-e2eea612.entry.js.map +1 -0
  204. package/dist/web-components-library/web-components-library.esm.js +1 -1
  205. package/package.json +9 -4
  206. package/react/components.d.ts +68 -66
  207. package/react/components.js +134 -69
  208. package/react/z-accordion.d.ts +12 -0
  209. package/react/z-accordion.js +18 -0
  210. package/react/z-anchor-navigation.d.ts +9 -0
  211. package/react/z-anchor-navigation.js +18 -0
  212. package/react/z-app-header.d.ts +12 -0
  213. package/react/z-app-header.js +18 -0
  214. package/react/z-aria-alert.d.ts +9 -0
  215. package/react/z-aria-alert.js +18 -0
  216. package/react/z-avatar.d.ts +9 -0
  217. package/react/z-avatar.js +18 -0
  218. package/react/z-book-card-app.d.ts +12 -0
  219. package/react/z-book-card-app.js +18 -0
  220. package/react/z-book-card.d.ts +14 -0
  221. package/react/z-book-card.js +22 -0
  222. package/react/z-book-cover.d.ts +9 -0
  223. package/react/z-book-cover.js +18 -0
  224. package/react/z-breadcrumb.d.ts +12 -0
  225. package/react/z-breadcrumb.js +18 -0
  226. package/react/z-button-sort.d.ts +12 -0
  227. package/react/z-button-sort.js +18 -0
  228. package/react/z-button.d.ts +9 -0
  229. package/react/z-button.js +18 -0
  230. package/react/z-card.d.ts +9 -0
  231. package/react/z-card.js +18 -0
  232. package/react/z-carousel.d.ts +14 -0
  233. package/react/z-carousel.js +18 -0
  234. package/react/z-chip.d.ts +12 -0
  235. package/react/z-chip.js +18 -0
  236. package/react/z-color-picker.d.ts +12 -0
  237. package/react/z-color-picker.js +18 -0
  238. package/react/z-combobox.d.ts +12 -0
  239. package/react/z-combobox.js +18 -0
  240. package/react/z-cover-hero.d.ts +9 -0
  241. package/react/z-cover-hero.js +18 -0
  242. package/react/z-date-picker.d.ts +12 -0
  243. package/react/z-date-picker.js +18 -0
  244. package/react/z-divider.d.ts +9 -0
  245. package/react/z-divider.js +18 -0
  246. package/react/z-dragdrop-area.d.ts +12 -0
  247. package/react/z-dragdrop-area.js +18 -0
  248. package/react/z-file-upload.d.ts +16 -0
  249. package/react/z-file-upload.js +21 -0
  250. package/react/z-file.d.ts +12 -0
  251. package/react/z-file.js +18 -0
  252. package/react/z-ghost-loading.d.ts +9 -0
  253. package/react/z-ghost-loading.js +18 -0
  254. package/react/z-icon.d.ts +9 -0
  255. package/react/z-icon.js +18 -0
  256. package/react/z-info-box.d.ts +14 -0
  257. package/react/z-info-box.js +18 -0
  258. package/react/z-info-reveal.d.ts +9 -0
  259. package/react/z-info-reveal.js +18 -0
  260. package/react/z-input-message.d.ts +9 -0
  261. package/react/z-input-message.js +18 -0
  262. package/react/z-input-range.d.ts +13 -0
  263. package/react/z-input-range.js +21 -0
  264. package/react/z-input.d.ts +17 -0
  265. package/react/z-input.js +25 -0
  266. package/react/z-list-element.d.ts +14 -0
  267. package/react/z-list-element.js +22 -0
  268. package/react/z-list-group.d.ts +9 -0
  269. package/react/z-list-group.js +18 -0
  270. package/react/z-list.d.ts +9 -0
  271. package/react/z-list.js +18 -0
  272. package/react/z-logo.d.ts +9 -0
  273. package/react/z-logo.js +18 -0
  274. package/react/z-menu-section.d.ts +13 -0
  275. package/react/z-menu-section.js +21 -0
  276. package/react/z-menu.d.ts +13 -0
  277. package/react/z-menu.js +21 -0
  278. package/react/z-modal.d.ts +14 -0
  279. package/react/z-modal.js +22 -0
  280. package/react/z-navigation-tabs.d.ts +12 -0
  281. package/react/z-navigation-tabs.js +18 -0
  282. package/react/z-notification.d.ts +13 -0
  283. package/react/z-notification.js +21 -0
  284. package/react/z-offcanvas.d.ts +12 -0
  285. package/react/z-offcanvas.js +18 -0
  286. package/react/z-pagination.d.ts +12 -0
  287. package/react/z-pagination.js +18 -0
  288. package/react/z-popover.d.ts +17 -0
  289. package/react/z-popover.js +21 -0
  290. package/react/z-range-picker.d.ts +12 -0
  291. package/react/z-range-picker.js +18 -0
  292. package/react/z-result-card.d.ts +9 -0
  293. package/react/z-result-card.js +18 -0
  294. package/react/z-searchbar.d.ts +14 -0
  295. package/react/z-searchbar.js +22 -0
  296. package/react/z-select.d.ts +13 -0
  297. package/react/z-select.js +21 -0
  298. package/react/z-skip-to-content.d.ts +9 -0
  299. package/react/z-skip-to-content.js +18 -0
  300. package/react/z-stepper-item.d.ts +9 -0
  301. package/react/z-stepper-item.js +18 -0
  302. package/react/z-stepper.d.ts +9 -0
  303. package/react/z-stepper.js +18 -0
  304. package/react/z-table.d.ts +9 -0
  305. package/react/z-table.js +18 -0
  306. package/react/z-tag.d.ts +9 -0
  307. package/react/z-tag.js +18 -0
  308. package/react/z-tbody.d.ts +9 -0
  309. package/react/z-tbody.js +18 -0
  310. package/react/z-td.d.ts +12 -0
  311. package/react/z-td.js +18 -0
  312. package/react/z-tfoot.d.ts +9 -0
  313. package/react/z-tfoot.js +18 -0
  314. package/react/z-th.d.ts +12 -0
  315. package/react/z-th.js +18 -0
  316. package/react/z-thead.d.ts +9 -0
  317. package/react/z-thead.js +18 -0
  318. package/react/z-toast-notification-list.d.ts +9 -0
  319. package/react/z-toast-notification-list.js +18 -0
  320. package/react/z-toast-notification.d.ts +12 -0
  321. package/react/z-toast-notification.js +18 -0
  322. package/react/z-toggle-switch.d.ts +12 -0
  323. package/react/z-toggle-switch.js +18 -0
  324. package/react/z-tool.d.ts +13 -0
  325. package/react/z-tool.js +21 -0
  326. package/react/z-toolbar.d.ts +9 -0
  327. package/react/z-toolbar.js +18 -0
  328. package/react/z-tooltip.d.ts +14 -0
  329. package/react/z-tooltip.js +18 -0
  330. package/react/z-tr.d.ts +12 -0
  331. package/react/z-tr.js +18 -0
  332. package/react/z-tree-list.d.ts +16 -0
  333. package/react/z-tree-list.js +18 -0
  334. package/react/z-visually-hidden.d.ts +9 -0
  335. package/react/z-visually-hidden.js +18 -0
  336. package/readme.md +7 -4
  337. package/www/build/{p-9a93e186.js → p-3ddbf8a7.js} +1 -1
  338. package/www/build/p-67051e01.entry.js +3 -0
  339. package/www/build/p-67051e01.entry.js.map +1 -0
  340. package/www/build/p-BRkq64wS.js +2 -0
  341. package/www/build/p-BRkq64wS.js.map +1 -0
  342. package/www/build/p-Bt1M0wUw.js +7 -0
  343. package/www/build/p-Bt1M0wUw.js.map +1 -0
  344. package/www/build/p-c3f69ac9.entry.js +2 -0
  345. package/www/build/p-c3f69ac9.entry.js.map +1 -0
  346. package/www/build/p-e2eea612.entry.js +2 -0
  347. package/www/build/p-e2eea612.entry.js.map +1 -0
  348. package/www/build/web-components-library.esm.js +1 -1
  349. package/www/index.html +1 -1
  350. package/dist/components/index10.js +0 -2
  351. package/dist/components/index11.js +0 -2
  352. package/dist/components/index12.js +0 -2
  353. package/dist/components/index13.js +0 -2
  354. package/dist/components/index14.js +0 -2
  355. package/dist/components/index15.js +0 -2
  356. package/dist/components/index16.js +0 -2
  357. package/dist/components/index17.js +0 -2
  358. package/dist/components/index18.js +0 -2
  359. package/dist/components/index19.js +0 -2
  360. package/dist/components/index20.js +0 -2
  361. package/dist/components/index20.js.map +0 -1
  362. package/dist/components/index21.js +0 -2
  363. package/dist/components/index3.js +0 -2
  364. package/dist/components/index4.js +0 -2
  365. package/dist/components/index5.js +0 -2
  366. package/dist/components/index6.js +0 -2
  367. package/dist/components/index6.js.map +0 -1
  368. package/dist/components/index7.js +0 -2
  369. package/dist/components/index8.js +0 -2
  370. package/dist/components/index9.js +0 -2
  371. package/dist/components/reactive-controller.js +0 -6
  372. package/dist/components/utils2.js +0 -2
  373. package/dist/web-components-library/p-1fad41b2.entry.js +0 -2
  374. package/dist/web-components-library/p-1fad41b2.entry.js.map +0 -1
  375. package/dist/web-components-library/p-baa35a6e.entry.js +0 -2
  376. package/dist/web-components-library/p-baa35a6e.entry.js.map +0 -1
  377. package/dist/web-components-library/p-ea96790b.entry.js +0 -8
  378. package/dist/web-components-library/p-ea96790b.entry.js.map +0 -1
  379. package/react/react-component-lib/createComponent.d.ts +0 -10
  380. package/react/react-component-lib/createComponent.js +0 -101
  381. package/react/react-component-lib/createOverlayComponent.d.ts +0 -21
  382. package/react/react-component-lib/createOverlayComponent.js +0 -115
  383. package/react/react-component-lib/index.d.ts +0 -2
  384. package/react/react-component-lib/index.js +0 -7
  385. package/react/react-component-lib/interfaces.d.ts +0 -29
  386. package/react/react-component-lib/interfaces.js +0 -2
  387. package/react/react-component-lib/utils/attachProps.d.ts +0 -16
  388. package/react/react-component-lib/utils/attachProps.js +0 -115
  389. package/react/react-component-lib/utils/case.d.ts +0 -2
  390. package/react/react-component-lib/utils/case.js +0 -11
  391. package/react/react-component-lib/utils/dev.d.ts +0 -2
  392. package/react/react-component-lib/utils/dev.js +0 -17
  393. package/react/react-component-lib/utils/index.d.ts +0 -10
  394. package/react/react-component-lib/utils/index.js +0 -55
  395. package/www/build/p-1fad41b2.entry.js +0 -2
  396. package/www/build/p-1fad41b2.entry.js.map +0 -1
  397. package/www/build/p-baa35a6e.entry.js +0 -2
  398. package/www/build/p-baa35a6e.entry.js.map +0 -1
  399. package/www/build/p-ea96790b.entry.js +0 -8
  400. package/www/build/p-ea96790b.entry.js.map +0 -1
  401. /package/dist/components/{utils.js.map → p-8C_CrFxp.js.map} +0 -0
  402. /package/dist/components/{reactive-controller.js.map → p-B3VFztJH.js.map} +0 -0
  403. /package/dist/components/{_commonjsHelpers.js.map → p-B85MJLTf.js.map} +0 -0
  404. /package/dist/components/{iconset.js.map → p-D1c5gR45.js.map} +0 -0
  405. /package/dist/components/{index2.js.map → p-DdetsoIY.js.map} +0 -0
  406. /package/dist/components/{breakpoints.js.map → p-Q-tWjk7P.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as c,Host as i,transformTag as l}from"@stencil/core/internal/client";import{k as a}from"./index2.js";import{r as o}from"./utils.js";import{d as r}from"./index3.js";const n=()=>`.sc-z-toggle-switch-h{position:relative;display:inline-flex;font-family:var(--font-family-sans);font-weight:var(--font-rg)}label.sc-z-toggle-switch{display:flex;flex-direction:row;align-items:center;cursor:pointer}label.disabled.sc-z-toggle-switch{cursor:default}label.right.sc-z-toggle-switch{flex-direction:row-reverse}label.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{color:var(--color-default-text);letter-spacing:0}label.left.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-right:var(--space-unit)}label.right.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-left:var(--space-unit)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch{position:relative;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 4);height:18px;align-items:center;background-color:var(--gray500);border-radius:var(--space-unit);color:var(--gray500);cursor:pointer}label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch,label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch{background-color:var(--color-disabled01);cursor:default}label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch>span.circle.sc-z-toggle-switch>z-icon.sc-z-toggle-switch{fill:var(--color-disabled01)}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch{background-color:var(--color-primary01);fill:var(--color-primary01)}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled){box-shadow:var(--shadow-focus-primary);outline:none}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch{outline:none}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled):hover{background-color:var(--color-hover-primary);fill:var(--color-hover-primary)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{position:absolute;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);align-items:center;justify-content:center;margin:0;background-color:var(--color-white);border-radius:7px;box-shadow:var(--shadow-1);transition:transform 0.3s ease}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{transform:translateX(calc(100% - 2px))}input[type="checkbox"].sc-z-toggle-switch{position:absolute;z-index:-1;opacity:0;pointer-events:none}`;const g=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.toggleClick=s(this,"toggleClick",7);this.disabled=false;this.labelPosition=a.LEFT;this.checked=false;this.htmlid=`toggle-switch-id-${o()}`}emitToggleClick(){this.toggleClick.emit({id:this.htmlid,checked:this.checked})}handleClick(e){if(this.disabled){return}this.checked=e.target.checked;this.emitToggleClick()}render(){return c(i,{key:"c682159ebad808a9e448a1a200fcc9ce49e3a2ad"},c("input",{key:"5a22ee912aeb8a212820d8d3f7b41a6029bfa530",id:this.htmlid,type:"checkbox",checked:this.checked,disabled:this.disabled,onChange:this.handleClick.bind(this)}),c("label",{key:"6c36dd15bc8fa1fcd1443cb01fe442644de8d87d",htmlFor:this.htmlid,class:{[this.labelPosition]:true,disabled:this.disabled}},c("span",{key:"b9cbb73e0de30c219443c2430fb7cb09a03ffa32"},c("slot",{key:"6b73da88f943d4c304ff3cd22c99145b2393541e"})),c("span",{key:"d7ecff8d30e2f6a43c3f010c53a6fb5fd00f7a78",class:{container:true,disabled:this.disabled,checked:this.checked}},c("span",{key:"5d4c5aba273711d3f06b6622e119bd6e81137e3d",class:"circle"},this.checked&&c("z-icon",{key:"c6dfea8a74fc0ef446588ac7c36bf06e3549f814",width:12,height:12,name:"checkmark"})))))}static get style(){return n()}},[262,"z-toggle-switch",{disabled:[516],labelPosition:[513,"label-position"],checked:[1028],htmlid:[1]}]);function h(){if(typeof customElements==="undefined"){return}const e=["z-toggle-switch","z-icon"];e.forEach((e=>{switch(e){case"z-toggle-switch":if(!customElements.get(l(e))){customElements.define(l(e),g)}break;case"z-icon":if(!customElements.get(l(e))){r()}break}}))}const d=g;const f=h;export{d as ZToggleSwitch,f as defineCustomElement};
1
+ import{p as e,H as t,c as s,h as c,d as i,t as a}from"./p-RmbDDbWd.js";import{k as o}from"./p-DdetsoIY.js";import{r as l}from"./p-8C_CrFxp.js";import{d as r}from"./p-CbXEdwLi.js";const n=()=>`.sc-z-toggle-switch-h{position:relative;display:inline-flex;font-family:var(--font-family-sans);font-weight:var(--font-rg)}label.sc-z-toggle-switch{display:flex;flex-direction:row;align-items:center;cursor:pointer}label.disabled.sc-z-toggle-switch{cursor:default}label.right.sc-z-toggle-switch{flex-direction:row-reverse}label.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{color:var(--color-default-text);letter-spacing:0}label.left.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-right:var(--space-unit)}label.right.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-left:var(--space-unit)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch{position:relative;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 4);height:18px;align-items:center;background-color:var(--gray500);border-radius:var(--space-unit);color:var(--gray500);cursor:pointer}label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch,label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch{background-color:var(--color-disabled01);cursor:default}label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch>span.circle.sc-z-toggle-switch>z-icon.sc-z-toggle-switch{fill:var(--color-disabled01)}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch{background-color:var(--color-primary01);fill:var(--color-primary01)}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled){box-shadow:var(--shadow-focus-primary);outline:none}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch{outline:none}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled):hover{background-color:var(--color-hover-primary);fill:var(--color-hover-primary)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{position:absolute;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);align-items:center;justify-content:center;margin:0;background-color:var(--color-white);border-radius:7px;box-shadow:var(--shadow-1);transition:transform 0.3s ease}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{transform:translateX(calc(100% - 2px))}input[type="checkbox"].sc-z-toggle-switch{position:absolute;z-index:-1;opacity:0;pointer-events:none}`;const g=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.toggleClick=s(this,"toggleClick",7);this.disabled=false;this.labelPosition=o.LEFT;this.checked=false;this.htmlid=`toggle-switch-id-${l()}`}emitToggleClick(){this.toggleClick.emit({id:this.htmlid,checked:this.checked})}handleClick(e){if(this.disabled){return}this.checked=e.target.checked;this.emitToggleClick()}render(){return c(i,{key:"c682159ebad808a9e448a1a200fcc9ce49e3a2ad"},c("input",{key:"5a22ee912aeb8a212820d8d3f7b41a6029bfa530",id:this.htmlid,type:"checkbox",checked:this.checked,disabled:this.disabled,onChange:this.handleClick.bind(this)}),c("label",{key:"6c36dd15bc8fa1fcd1443cb01fe442644de8d87d",htmlFor:this.htmlid,class:{[this.labelPosition]:true,disabled:this.disabled}},c("span",{key:"b9cbb73e0de30c219443c2430fb7cb09a03ffa32"},c("slot",{key:"6b73da88f943d4c304ff3cd22c99145b2393541e"})),c("span",{key:"d7ecff8d30e2f6a43c3f010c53a6fb5fd00f7a78",class:{container:true,disabled:this.disabled,checked:this.checked}},c("span",{key:"5d4c5aba273711d3f06b6622e119bd6e81137e3d",class:"circle"},this.checked&&c("z-icon",{key:"c6dfea8a74fc0ef446588ac7c36bf06e3549f814",width:12,height:12,name:"checkmark"})))))}static get style(){return n()}},[262,"z-toggle-switch",{disabled:[516],labelPosition:[513,"label-position"],checked:[1028],htmlid:[1]}]);function h(){if(typeof customElements==="undefined"){return}const e=["z-toggle-switch","z-icon"];e.forEach((e=>{switch(e){case"z-toggle-switch":if(!customElements.get(a(e))){customElements.define(a(e),g)}break;case"z-icon":if(!customElements.get(a(e))){r()}break}}))}const d=g;const f=h;export{d as ZToggleSwitch,f as defineCustomElement};
2
2
  //# sourceMappingURL=z-toggle-switch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stylesCss","ZToggleSwitch","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","disabled","labelPosition","LabelPosition","LEFT","checked","htmlid","randomId","emitToggleClick","toggleClick","emit","id","handleClick","ev","target","render","h","Host","key","type","onChange","bind","htmlFor","class","container","width","height","name"],"sources":["src/components/z-toggle-switch/styles.css?tag=z-toggle-switch&encapsulation=scoped","src/components/z-toggle-switch/index.tsx"],"sourcesContent":[":host {\n position: relative;\n display: inline-flex;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\nlabel {\n display: flex;\n flex-direction: row;\n align-items: center;\n cursor: pointer;\n}\n\nlabel.disabled {\n cursor: default;\n}\n\nlabel.right {\n flex-direction: row-reverse;\n}\n\nlabel > span:first-child {\n color: var(--color-default-text);\n letter-spacing: 0;\n}\n\nlabel.left > span:first-child {\n margin-right: var(--space-unit);\n}\n\nlabel.right > span:first-child {\n margin-left: var(--space-unit);\n}\n\nlabel > span.container {\n position: relative;\n top: 1px;\n left: 1px;\n display: flex;\n width: calc(var(--space-unit) * 4);\n height: 18px;\n align-items: center;\n background-color: var(--gray500);\n border-radius: var(--space-unit);\n color: var(--gray500);\n cursor: pointer;\n}\n\nlabel > span.container.disabled,\nlabel > span.container.checked.disabled {\n background-color: var(--color-disabled01);\n cursor: default;\n}\n\nlabel > span.container.checked.disabled > span.circle > z-icon {\n fill: var(--color-disabled01);\n}\n\nlabel > span.container.checked {\n background-color: var(--color-primary01);\n fill: var(--color-primary01);\n}\n\ninput:focus:focus-visible + label > span.container:not(.disabled) {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\ninput:focus:focus-visible + label > span.container.disabled {\n outline: none;\n}\n\nlabel > span.container:not(.disabled):hover {\n background-color: var(--color-hover-primary);\n fill: var(--color-hover-primary);\n}\n\nlabel > span.container > span.circle {\n position: absolute;\n top: 1px;\n left: 1px;\n display: flex;\n width: calc(var(--space-unit) * 2);\n height: calc(var(--space-unit) * 2);\n align-items: center;\n justify-content: center;\n margin: 0;\n background-color: var(--color-white);\n border-radius: 7px;\n box-shadow: var(--shadow-1);\n transition: transform 0.3s ease;\n}\n\nlabel > span.container.checked > span.circle {\n transform: translateX(calc(100% - 2px));\n}\n\ninput[type=\"checkbox\"] {\n position: absolute;\n z-index: -1;\n opacity: 0;\n pointer-events: none;\n}\n","import {Component, ComponentInterface, Event, EventEmitter, Host, Prop, h} from \"@stencil/core\";\nimport {LabelPosition} from \"../../beans\";\nimport {randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-toggle-switch\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZToggleSwitch implements ComponentInterface {\n /** Disabled flag */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** Label position */\n @Prop({reflect: true})\n labelPosition? = LabelPosition.LEFT;\n\n /** Checked state */\n @Prop({mutable: true})\n checked?: boolean = false;\n\n /** HTML id attribute to set to the internal checkbox */\n @Prop()\n htmlid = `toggle-switch-id-${randomId()}`;\n\n /** Toggle click event */\n @Event()\n toggleClick: EventEmitter;\n\n private emitToggleClick(): void {\n this.toggleClick.emit({\n id: this.htmlid,\n checked: this.checked,\n });\n }\n\n private handleClick(ev): void {\n if (this.disabled) {\n return;\n }\n\n this.checked = ev.target.checked;\n this.emitToggleClick();\n }\n\n render(): HTMLZToggleSwitchElement {\n return (\n <Host>\n <input\n id={this.htmlid}\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n onChange={this.handleClick.bind(this)}\n />\n <label\n htmlFor={this.htmlid}\n class={{\n [this.labelPosition]: true,\n disabled: this.disabled,\n }}\n >\n <span>\n <slot />\n </span>\n <span\n class={{\n container: true,\n disabled: this.disabled,\n checked: this.checked,\n }}\n >\n <span class=\"circle\">\n {this.checked && (\n <z-icon\n width={12}\n height={12}\n name=\"checkmark\"\n ></z-icon>\n )}\n </span>\n </span>\n </label>\n </Host>\n );\n }\n}\n"],"mappings":"uOAAA,MAAMA,EAAY,IAAM,05E,MCUXC,EAAaC,EAAA,MAAAD,UAAAE,EAN1B,WAAAC,CAAAC,G,qFASEC,KAAAC,SAAqB,MAIrBD,KAAAE,cAAiBC,EAAcC,KAI/BJ,KAAAK,QAAoB,MAIpBL,KAAAM,OAAS,oBAAoBC,KA+D9B,CAzDS,eAAAC,GACNR,KAAKS,YAAYC,KAAK,CACpBC,GAAIX,KAAKM,OACTD,QAASL,KAAKK,S,CAIV,WAAAO,CAAYC,GAClB,GAAIb,KAAKC,SAAU,CACjB,M,CAGFD,KAAKK,QAAUQ,EAAGC,OAAOT,QACzBL,KAAKQ,iB,CAGP,MAAAO,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,SAAAE,IAAA,2CACEP,GAAIX,KAAKM,OACTa,KAAK,WACLd,QAASL,KAAKK,QACdJ,SAAUD,KAAKC,SACfmB,SAAUpB,KAAKY,YAAYS,KAAKrB,QAElCgB,EAAA,SAAAE,IAAA,2CACEI,QAAStB,KAAKM,OACdiB,MAAO,CACL,CAACvB,KAAKE,eAAgB,KACtBD,SAAUD,KAAKC,WAGjBe,EAAA,QAAAE,IAAA,4CACEF,EAAA,QAAAE,IAAA,8CAEFF,EAAA,QAAAE,IAAA,2CACEK,MAAO,CACLC,UAAW,KACXvB,SAAUD,KAAKC,SACfI,QAASL,KAAKK,UAGhBW,EAAA,QAAAE,IAAA,2CAAMK,MAAM,UACTvB,KAAKK,SACJW,EAAA,UAAAE,IAAA,2CACEO,MAAO,GACPC,OAAQ,GACRC,KAAK,iB","ignoreList":[]}
1
+ {"version":3,"names":["stylesCss","ZToggleSwitch","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","disabled","labelPosition","LabelPosition","LEFT","checked","htmlid","randomId","emitToggleClick","toggleClick","emit","id","handleClick","ev","target","render","h","Host","key","type","onChange","bind","htmlFor","class","container","width","height","name"],"sources":["src/components/z-toggle-switch/styles.css?tag=z-toggle-switch&encapsulation=scoped","src/components/z-toggle-switch/index.tsx"],"sourcesContent":[":host {\n position: relative;\n display: inline-flex;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\nlabel {\n display: flex;\n flex-direction: row;\n align-items: center;\n cursor: pointer;\n}\n\nlabel.disabled {\n cursor: default;\n}\n\nlabel.right {\n flex-direction: row-reverse;\n}\n\nlabel > span:first-child {\n color: var(--color-default-text);\n letter-spacing: 0;\n}\n\nlabel.left > span:first-child {\n margin-right: var(--space-unit);\n}\n\nlabel.right > span:first-child {\n margin-left: var(--space-unit);\n}\n\nlabel > span.container {\n position: relative;\n top: 1px;\n left: 1px;\n display: flex;\n width: calc(var(--space-unit) * 4);\n height: 18px;\n align-items: center;\n background-color: var(--gray500);\n border-radius: var(--space-unit);\n color: var(--gray500);\n cursor: pointer;\n}\n\nlabel > span.container.disabled,\nlabel > span.container.checked.disabled {\n background-color: var(--color-disabled01);\n cursor: default;\n}\n\nlabel > span.container.checked.disabled > span.circle > z-icon {\n fill: var(--color-disabled01);\n}\n\nlabel > span.container.checked {\n background-color: var(--color-primary01);\n fill: var(--color-primary01);\n}\n\ninput:focus:focus-visible + label > span.container:not(.disabled) {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\ninput:focus:focus-visible + label > span.container.disabled {\n outline: none;\n}\n\nlabel > span.container:not(.disabled):hover {\n background-color: var(--color-hover-primary);\n fill: var(--color-hover-primary);\n}\n\nlabel > span.container > span.circle {\n position: absolute;\n top: 1px;\n left: 1px;\n display: flex;\n width: calc(var(--space-unit) * 2);\n height: calc(var(--space-unit) * 2);\n align-items: center;\n justify-content: center;\n margin: 0;\n background-color: var(--color-white);\n border-radius: 7px;\n box-shadow: var(--shadow-1);\n transition: transform 0.3s ease;\n}\n\nlabel > span.container.checked > span.circle {\n transform: translateX(calc(100% - 2px));\n}\n\ninput[type=\"checkbox\"] {\n position: absolute;\n z-index: -1;\n opacity: 0;\n pointer-events: none;\n}\n","import {Component, ComponentInterface, Event, EventEmitter, Host, Prop, h} from \"@stencil/core\";\nimport {LabelPosition} from \"../../beans\";\nimport {randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-toggle-switch\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZToggleSwitch implements ComponentInterface {\n /** Disabled flag */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** Label position */\n @Prop({reflect: true})\n labelPosition? = LabelPosition.LEFT;\n\n /** Checked state */\n @Prop({mutable: true})\n checked?: boolean = false;\n\n /** HTML id attribute to set to the internal checkbox */\n @Prop()\n htmlid = `toggle-switch-id-${randomId()}`;\n\n /** Toggle click event */\n @Event()\n toggleClick: EventEmitter;\n\n private emitToggleClick(): void {\n this.toggleClick.emit({\n id: this.htmlid,\n checked: this.checked,\n });\n }\n\n private handleClick(ev): void {\n if (this.disabled) {\n return;\n }\n\n this.checked = ev.target.checked;\n this.emitToggleClick();\n }\n\n render(): HTMLZToggleSwitchElement {\n return (\n <Host>\n <input\n id={this.htmlid}\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n onChange={this.handleClick.bind(this)}\n />\n <label\n htmlFor={this.htmlid}\n class={{\n [this.labelPosition]: true,\n disabled: this.disabled,\n }}\n >\n <span>\n <slot />\n </span>\n <span\n class={{\n container: true,\n disabled: this.disabled,\n checked: this.checked,\n }}\n >\n <span class=\"circle\">\n {this.checked && (\n <z-icon\n width={12}\n height={12}\n name=\"checkmark\"\n ></z-icon>\n )}\n </span>\n </span>\n </label>\n </Host>\n );\n }\n}\n"],"mappings":"mLAAA,MAAMA,EAAY,IAAM,05E,MCUXC,EAAaC,EAAA,MAAAD,UAAAE,EAN1B,WAAAC,CAAAC,G,qFASEC,KAAAC,SAAqB,MAIrBD,KAAAE,cAAiBC,EAAcC,KAI/BJ,KAAAK,QAAoB,MAIpBL,KAAAM,OAAS,oBAAoBC,KA+D9B,CAzDS,eAAAC,GACNR,KAAKS,YAAYC,KAAK,CACpBC,GAAIX,KAAKM,OACTD,QAASL,KAAKK,S,CAIV,WAAAO,CAAYC,GAClB,GAAIb,KAAKC,SAAU,CACjB,M,CAGFD,KAAKK,QAAUQ,EAAGC,OAAOT,QACzBL,KAAKQ,iB,CAGP,MAAAO,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,SAAAE,IAAA,2CACEP,GAAIX,KAAKM,OACTa,KAAK,WACLd,QAASL,KAAKK,QACdJ,SAAUD,KAAKC,SACfmB,SAAUpB,KAAKY,YAAYS,KAAKrB,QAElCgB,EAAA,SAAAE,IAAA,2CACEI,QAAStB,KAAKM,OACdiB,MAAO,CACL,CAACvB,KAAKE,eAAgB,KACtBD,SAAUD,KAAKC,WAGjBe,EAAA,QAAAE,IAAA,4CACEF,EAAA,QAAAE,IAAA,8CAEFF,EAAA,QAAAE,IAAA,2CACEK,MAAO,CACLC,UAAW,KACXvB,SAAUD,KAAKC,SACfI,QAASL,KAAKK,UAGhBW,EAAA,QAAAE,IAAA,2CAAMK,MAAM,UACTvB,KAAKK,SACJW,EAAA,UAAAE,IAAA,2CACEO,MAAO,GACPC,OAAQ,GACRC,KAAK,iB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as o,Host as n,transformTag as s}from"@stencil/core/internal/client";import{P as a,g as r}from"./index2.js";import{a as l}from"./utils.js";import{d as h}from"./index3.js";import{d}from"./index16.js";import{d as f}from"./index21.js";const b=()=>`:host,*{box-sizing:border-box}.z-tool{--z-tool-size:calc(var(--space-unit) * 5.5);--z-tool-icon-size:calc(var(--space-unit) * 2.5);position:relative;display:inline-flex;width:var(--z-tool-size);height:var(--z-tool-size);align-items:center;justify-content:center;padding:0;border:none;margin:0;background-color:var(--color-surface01);border-radius:var(--border-radius);cursor:pointer}:host(:is([active],[open])) .z-tool{box-shadow:inset 0 0 0 2px var(--color-primary01)}:host([open]) .z-tool{background:var(--color-primary03)}@media (hover: hover){:host(:hover),:host(.z-tool-tooltip-open){z-index:1}:host(:not([disabled])) .z-tool:hover{background-color:var(--color-primary03)}}.z-tool:focus:focus-visible{background-color:var(--color-primary03);outline:none}z-icon{--z-icon-width:var(--z-tool-icon-size);--z-icon-height:var(--z-tool-icon-size);display:block;fill:var(--color-default-icon)}:host([disabled]) .z-tool{color:var(--color-disabled01-icon);cursor:not-allowed}:host([disabled]) z-icon{fill:var(--color-disabled01-icon)}.z-tool-tooltip{--z-tooltip-padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);--z-tooltip-shadow-filter:drop-shadow(0 4px 8px var(--shadow-color-base));position:relative;z-index:2;font-family:var(--font-family-sans);white-space:nowrap}.z-tool-submenu{z-index:3;border-radius:calc(var(--border-radius) + var(--border-size-small))}.z-tool-submenu ::slotted(z-color-picker){border:var(--border-size-small) solid var(--color-surface03);border-radius:var(--border-radius)}@media (max-width: 767px) and (hover: none){.z-tool-tooltip{display:none !important}}`;const g=()=>`:root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}`;const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.toggleSubmenu=i(this,"toggleSubmenu",7);this.toggleTooltip=i(this,"toggleTooltip",7);this.tooltipPosition=a.TOP;this.active=false;this.disabled=false;this.open=false;this.tooltipOpen=false;this.hasSlottedContent=false;this.isMobile=false;this.hasNestedOpenTools=false;this.isNested=false;this.handleTooltipOpen=t=>{if(!this.tooltip||this.open||!this.buttonRef.contains(t.target)){return}clearTimeout(this.hoverDelay);this.hoverDelay=setTimeout((()=>{this.tooltipOpen=true}),1e3)};this.handleTooltipClose=t=>{var e;if(!this.tooltip||((e=t.relatedTarget)===null||e===void 0?void 0:e.closest("z-tooltip"))===this.tooltipRef){return}clearTimeout(this.hoverDelay);this.tooltipOpen=false};this.handleClick=()=>{if(this.disabled||!this.hasSlottedContent){return}this.open=!this.open;if(this.open){const t=this.hostElement.querySelector(":scope > z-color-picker");if(t){t.setFocus();return}const e=this.hostElement.querySelector(":scope > z-toolbar z-tool[active]:not(:disabled)")||this.hostElement.querySelector(":scope > z-toolbar z-tool:not(:disabled)");e===null||e===void 0?void 0:e.setFocus()}};this.onTooltipOpenChange=t=>{if(t.target===this.tooltipRef){return}this.tooltipOpen=t.detail.open}}handleOpenChange(){this.toggleSubmenu.emit(this.open)}handleTooltipOpenChange(){this.toggleTooltip.emit(this.tooltipOpen)}handleKeyDown(t){if(!this.open||this.hasNestedOpenTools){return}switch(t.key){case r.ESC:t.stopPropagation();this.open=false;this.setFocus();break;case r.TAB:if(t.shiftKey&&t.target.closest("z-tool:not(:scope)")===this.hostElement){this.open=false}break}}onOutsideClick(t){const e=t.composedPath()[0];if(!this.open||l(this.hostElement,e)||this.hasNestedOpenTools){return}this.open=false}onNestedToolToggle(t){if(t.target===this.hostElement){return}if(t.detail===true){this.hasNestedOpenTools=true;return}this.hasNestedOpenTools=Array.from(this.hostElement.querySelectorAll("z-tool")).some((t=>t.open))}handleColorSelected(t){if(!Array.from(this.hostElement.children).includes(t.target)){return}this.indicatorColor=t.detail;this.open=false;this.setFocus()}handleExternalFocusin(t){const e=t.target;if(!l(this.hostElement,e)){this.open=false}}async setFocus(){if(this.disabled){return}setTimeout((()=>{var t;(t=this.buttonRef)===null||t===void 0?void 0:t.focus()}),50)}async setTabIndex(t){if(!this.buttonRef){return}this.buttonRef.tabIndex=this.disabled?-1:t}async closeTooltip(){clearTimeout(this.hoverDelay);this.tooltipOpen=false}componentWillLoad(){this.hasSlottedContent=this.hostElement.children.length>0;this.isNested=!!this.hostElement.closest("z-tool:not(:scope)");this.mainToolbar=this.hostElement.closest("z-toolbar:not(z-toolbar z-toolbar)");this.hasNestedOpenTools=!!this.hostElement.querySelector("z-tool[open]");this.mql=matchMedia("(max-width: 767px)");this.onMobileViewChange=t=>this.isMobile=t.matches;this.mql.addEventListener("change",this.onMobileViewChange);this.isMobile=this.mql.matches}disconnectedCallback(){var t;clearTimeout(this.hoverDelay);(t=this.mql)===null||t===void 0?void 0:t.removeEventListener("change",this.onMobileViewChange)}render(){return o(n,{key:"a48fb610a0a937e39e8c18d38bcb816796f5d6b4",class:{"z-tool-tooltip-open":this.tooltipOpen}},o("button",{key:"d5dbd5053a068c67ed97ddc5a7f63d093972b5cb",class:"z-tool",type:"button",ref:t=>this.buttonRef=t,"aria-pressed":this.hasSlottedContent?undefined:this.active?"true":"false","aria-expanded":this.hasSlottedContent?this.open?"true":"false":undefined,"aria-haspopup":this.hasSlottedContent?"true":undefined,"aria-label":this.htmlAriaLabel||this.tooltip||undefined,disabled:this.disabled,onClick:this.handleClick,onMouseEnter:this.handleTooltipOpen,onMouseLeave:this.handleTooltipClose,onFocus:this.handleTooltipOpen,onBlur:this.handleTooltipClose},o("z-icon",{key:"32fead7901041cc31e29ec21afdd4e23db4d3db8",ref:t=>this.iconRef=t,name:this.icon,indicatorColor:this.indicatorColor})),this.tooltip&&o("z-tooltip",{key:"5b50cd97749c97edd199be309bb0b5aadd59116b",class:"z-tool-tooltip",ref:t=>this.tooltipRef=t,bindTo:this.iconRef,open:this.tooltipOpen&&!this.open,position:this.isNested?a.BOTTOM:this.tooltipPosition,dark:true,onMouseLeave:this.handleTooltipClose,onBlur:this.handleTooltipClose,onOpenChange:this.onTooltipOpenChange},o("span",{key:"768a80f59017ef7e459913f9c449673789b81c00",class:"body-4"},this.tooltip)),this.hasSlottedContent&&o("z-popover",{key:"f7a3ffa96e971fa793643944391e296ce7ce12b8",class:"z-tool-submenu",open:this.open,bindTo:this.isMobile&&this.mainToolbar?this.mainToolbar:this.hostElement,center:true,closable:false,position:this.isMobile?a.TOP:a.BOTTOM},o("slot",{key:"e4b9dd50dd26e958241db7df82ccd8a14c6a4c86"})))}get hostElement(){return this}static get watchers(){return{open:[{handleOpenChange:0}],tooltipOpen:[{handleTooltipOpenChange:0}]}}static get style(){return b()+g()}},[257,"z-tool",{icon:[1],tooltip:[1],tooltipPosition:[1,"tooltip-position"],htmlAriaLabel:[1,"html-aria-label"],active:[516],disabled:[516],open:[1540],indicatorColor:[1025,"indicator-color"],tooltipOpen:[32],hasSlottedContent:[32],isMobile:[32],hasNestedOpenTools:[32],setFocus:[64],setTabIndex:[64],closeTooltip:[64]},[[0,"keydown","handleKeyDown"],[16,"click","onOutsideClick"],[0,"toggleSubmenu","onNestedToolToggle"],[0,"colorSelected","handleColorSelected"],[17,"focusin","handleExternalFocusin"]],{open:[{handleOpenChange:0}],tooltipOpen:[{handleTooltipOpenChange:0}]}]);function v(){if(typeof customElements==="undefined"){return}const t=["z-tool","z-icon","z-popover","z-tooltip"];t.forEach((t=>{switch(t){case"z-tool":if(!customElements.get(s(t))){customElements.define(s(t),c)}break;case"z-icon":if(!customElements.get(s(t))){h()}break;case"z-popover":if(!customElements.get(s(t))){d()}break;case"z-tooltip":if(!customElements.get(s(t))){f()}break}}))}const z=c;const p=v;export{z as ZTool,p as defineCustomElement};
1
+ import{p as t,H as e,c as i,h as o,d as n,t as s}from"./p-RmbDDbWd.js";import{P as a,g as r}from"./p-DdetsoIY.js";import{a as l}from"./p-8C_CrFxp.js";import{d as h}from"./p-CbXEdwLi.js";import{d}from"./p-D8wde41u.js";import{d as f}from"./p-Ch6o4_VN.js";const b=()=>`:host,*{box-sizing:border-box}.z-tool{--z-tool-size:calc(var(--space-unit) * 5.5);--z-tool-icon-size:calc(var(--space-unit) * 2.5);position:relative;display:inline-flex;width:var(--z-tool-size);height:var(--z-tool-size);align-items:center;justify-content:center;padding:0;border:none;margin:0;background-color:var(--color-surface01);border-radius:var(--border-radius);cursor:pointer}:host(:is([active],[open])) .z-tool{box-shadow:inset 0 0 0 2px var(--color-primary01)}:host([open]) .z-tool{background:var(--color-primary03)}@media (hover: hover){:host(:hover),:host(.z-tool-tooltip-open){z-index:1}:host(:not([disabled])) .z-tool:hover{background-color:var(--color-primary03)}}.z-tool:focus:focus-visible{background-color:var(--color-primary03);outline:none}z-icon{--z-icon-width:var(--z-tool-icon-size);--z-icon-height:var(--z-tool-icon-size);display:block;fill:var(--color-default-icon)}:host([disabled]) .z-tool{color:var(--color-disabled01-icon);cursor:not-allowed}:host([disabled]) z-icon{fill:var(--color-disabled01-icon)}.z-tool-tooltip{--z-tooltip-padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);--z-tooltip-shadow-filter:drop-shadow(0 4px 8px var(--shadow-color-base));position:relative;z-index:2;font-family:var(--font-family-sans);white-space:nowrap}.z-tool-submenu{z-index:3;border-radius:calc(var(--border-radius) + var(--border-size-small))}.z-tool-submenu ::slotted(z-color-picker){border:var(--border-size-small) solid var(--color-surface03);border-radius:var(--border-radius)}@media (max-width: 767px) and (hover: none){.z-tool-tooltip{display:none !important}}`;const g=()=>`:root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}`;const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.toggleSubmenu=i(this,"toggleSubmenu",7);this.toggleTooltip=i(this,"toggleTooltip",7);this.tooltipPosition=a.TOP;this.active=false;this.disabled=false;this.open=false;this.tooltipOpen=false;this.hasSlottedContent=false;this.isMobile=false;this.hasNestedOpenTools=false;this.isNested=false;this.handleTooltipOpen=t=>{if(!this.tooltip||this.open||!this.buttonRef.contains(t.target)){return}clearTimeout(this.hoverDelay);this.hoverDelay=setTimeout((()=>{this.tooltipOpen=true}),1e3)};this.handleTooltipClose=t=>{var e;if(!this.tooltip||((e=t.relatedTarget)===null||e===void 0?void 0:e.closest("z-tooltip"))===this.tooltipRef){return}clearTimeout(this.hoverDelay);this.tooltipOpen=false};this.handleClick=()=>{if(this.disabled||!this.hasSlottedContent){return}this.open=!this.open;if(this.open){const t=this.hostElement.querySelector(":scope > z-color-picker");if(t){t.setFocus();return}const e=this.hostElement.querySelector(":scope > z-toolbar z-tool[active]:not(:disabled)")||this.hostElement.querySelector(":scope > z-toolbar z-tool:not(:disabled)");e===null||e===void 0?void 0:e.setFocus()}};this.onTooltipOpenChange=t=>{if(t.target===this.tooltipRef){return}this.tooltipOpen=t.detail.open}}handleOpenChange(){this.toggleSubmenu.emit(this.open)}handleTooltipOpenChange(){this.toggleTooltip.emit(this.tooltipOpen)}handleKeyDown(t){if(!this.open||this.hasNestedOpenTools){return}switch(t.key){case r.ESC:t.stopPropagation();this.open=false;this.setFocus();break;case r.TAB:if(t.shiftKey&&t.target.closest("z-tool:not(:scope)")===this.hostElement){this.open=false}break}}onOutsideClick(t){const e=t.composedPath()[0];if(!this.open||l(this.hostElement,e)||this.hasNestedOpenTools){return}this.open=false}onNestedToolToggle(t){if(t.target===this.hostElement){return}if(t.detail===true){this.hasNestedOpenTools=true;return}this.hasNestedOpenTools=Array.from(this.hostElement.querySelectorAll("z-tool")).some((t=>t.open))}handleColorSelected(t){if(!Array.from(this.hostElement.children).includes(t.target)){return}this.indicatorColor=t.detail;this.open=false;this.setFocus()}handleExternalFocusin(t){const e=t.target;if(!l(this.hostElement,e)){this.open=false}}async setFocus(){if(this.disabled){return}setTimeout((()=>{var t;(t=this.buttonRef)===null||t===void 0?void 0:t.focus()}),50)}async setTabIndex(t){if(!this.buttonRef){return}this.buttonRef.tabIndex=this.disabled?-1:t}async closeTooltip(){clearTimeout(this.hoverDelay);this.tooltipOpen=false}componentWillLoad(){this.hasSlottedContent=this.hostElement.children.length>0;this.isNested=!!this.hostElement.closest("z-tool:not(:scope)");this.mainToolbar=this.hostElement.closest("z-toolbar:not(z-toolbar z-toolbar)");this.hasNestedOpenTools=!!this.hostElement.querySelector("z-tool[open]");this.mql=matchMedia("(max-width: 767px)");this.onMobileViewChange=t=>this.isMobile=t.matches;this.mql.addEventListener("change",this.onMobileViewChange);this.isMobile=this.mql.matches}disconnectedCallback(){var t;clearTimeout(this.hoverDelay);(t=this.mql)===null||t===void 0?void 0:t.removeEventListener("change",this.onMobileViewChange)}render(){return o(n,{key:"a48fb610a0a937e39e8c18d38bcb816796f5d6b4",class:{"z-tool-tooltip-open":this.tooltipOpen}},o("button",{key:"d5dbd5053a068c67ed97ddc5a7f63d093972b5cb",class:"z-tool",type:"button",ref:t=>this.buttonRef=t,"aria-pressed":this.hasSlottedContent?undefined:this.active?"true":"false","aria-expanded":this.hasSlottedContent?this.open?"true":"false":undefined,"aria-haspopup":this.hasSlottedContent?"true":undefined,"aria-label":this.htmlAriaLabel||this.tooltip||undefined,disabled:this.disabled,onClick:this.handleClick,onMouseEnter:this.handleTooltipOpen,onMouseLeave:this.handleTooltipClose,onFocus:this.handleTooltipOpen,onBlur:this.handleTooltipClose},o("z-icon",{key:"32fead7901041cc31e29ec21afdd4e23db4d3db8",ref:t=>this.iconRef=t,name:this.icon,indicatorColor:this.indicatorColor})),this.tooltip&&o("z-tooltip",{key:"5b50cd97749c97edd199be309bb0b5aadd59116b",class:"z-tool-tooltip",ref:t=>this.tooltipRef=t,bindTo:this.iconRef,open:this.tooltipOpen&&!this.open,position:this.isNested?a.BOTTOM:this.tooltipPosition,dark:true,onMouseLeave:this.handleTooltipClose,onBlur:this.handleTooltipClose,onOpenChange:this.onTooltipOpenChange},o("span",{key:"768a80f59017ef7e459913f9c449673789b81c00",class:"body-4"},this.tooltip)),this.hasSlottedContent&&o("z-popover",{key:"f7a3ffa96e971fa793643944391e296ce7ce12b8",class:"z-tool-submenu",open:this.open,bindTo:this.isMobile&&this.mainToolbar?this.mainToolbar:this.hostElement,center:true,closable:false,position:this.isMobile?a.TOP:a.BOTTOM},o("slot",{key:"e4b9dd50dd26e958241db7df82ccd8a14c6a4c86"})))}get hostElement(){return this}static get watchers(){return{open:[{handleOpenChange:0}],tooltipOpen:[{handleTooltipOpenChange:0}]}}static get style(){return b()+g()}},[257,"z-tool",{icon:[1],tooltip:[1],tooltipPosition:[1,"tooltip-position"],htmlAriaLabel:[1,"html-aria-label"],active:[516],disabled:[516],open:[1540],indicatorColor:[1025,"indicator-color"],tooltipOpen:[32],hasSlottedContent:[32],isMobile:[32],hasNestedOpenTools:[32],setFocus:[64],setTabIndex:[64],closeTooltip:[64]},[[0,"keydown","handleKeyDown"],[16,"click","onOutsideClick"],[0,"toggleSubmenu","onNestedToolToggle"],[0,"colorSelected","handleColorSelected"],[17,"focusin","handleExternalFocusin"]],{open:[{handleOpenChange:0}],tooltipOpen:[{handleTooltipOpenChange:0}]}]);function v(){if(typeof customElements==="undefined"){return}const t=["z-tool","z-icon","z-popover","z-tooltip"];t.forEach((t=>{switch(t){case"z-tool":if(!customElements.get(s(t))){customElements.define(s(t),c)}break;case"z-icon":if(!customElements.get(s(t))){h()}break;case"z-popover":if(!customElements.get(s(t))){d()}break;case"z-tooltip":if(!customElements.get(s(t))){f()}break}}))}const z=c;const p=v;export{z as ZTool,p as defineCustomElement};
2
2
  //# sourceMappingURL=z-tool.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stylesCss","typographyCss","ZTool","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","tooltipPosition","PopoverPosition","TOP","active","disabled","open","tooltipOpen","hasSlottedContent","isMobile","hasNestedOpenTools","isNested","handleTooltipOpen","ev","tooltip","buttonRef","contains","target","clearTimeout","hoverDelay","setTimeout","handleTooltipClose","_a","relatedTarget","closest","tooltipRef","handleClick","colorPicker","hostElement","querySelector","setFocus","firstActiveOrEnabledNestedTool","onTooltipOpenChange","event","detail","handleOpenChange","toggleSubmenu","emit","handleTooltipOpenChange","toggleTooltip","handleKeyDown","key","KeyboardCode","ESC","stopPropagation","TAB","shiftKey","onOutsideClick","composedPath","containsElement","onNestedToolToggle","Array","from","querySelectorAll","some","tool","handleColorSelected","children","includes","indicatorColor","handleExternalFocusin","focus","setTabIndex","value","tabIndex","closeTooltip","componentWillLoad","length","mainToolbar","mql","matchMedia","onMobileViewChange","e","matches","addEventListener","disconnectedCallback","removeEventListener","render","h","Host","class","type","ref","el","undefined","htmlAriaLabel","onClick","onMouseEnter","onMouseLeave","onFocus","onBlur","iconRef","name","icon","bindTo","position","BOTTOM","dark","onOpenChange","center","closable"],"sources":["src/components/z-tool/styles.css?tag=z-tool&encapsulation=shadow","src/tokens/typography.css?tag=z-tool&encapsulation=shadow","src/components/z-tool/index.tsx"],"sourcesContent":[":host,\n* {\n box-sizing: border-box;\n}\n\n.z-tool {\n --z-tool-size: calc(var(--space-unit) * 5.5);\n --z-tool-icon-size: calc(var(--space-unit) * 2.5);\n\n position: relative;\n display: inline-flex;\n width: var(--z-tool-size);\n height: var(--z-tool-size);\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: 0;\n background-color: var(--color-surface01);\n border-radius: var(--border-radius);\n cursor: pointer;\n}\n\n:host(:is([active], [open])) .z-tool {\n box-shadow: inset 0 0 0 2px var(--color-primary01);\n}\n\n:host([open]) .z-tool {\n background: var(--color-primary03);\n}\n\n@media (hover: hover) {\n :host(:hover),\n :host(.z-tool-tooltip-open) {\n /* ensure any open tooltip is shown over sibling elements */\n z-index: 1;\n }\n\n :host(:not([disabled])) .z-tool:hover {\n background-color: var(--color-primary03);\n }\n}\n\n.z-tool:focus:focus-visible {\n background-color: var(--color-primary03);\n outline: none;\n}\n\nz-icon {\n --z-icon-width: var(--z-tool-icon-size);\n --z-icon-height: var(--z-tool-icon-size);\n\n display: block;\n fill: var(--color-default-icon);\n}\n\n:host([disabled]) .z-tool {\n color: var(--color-disabled01-icon);\n cursor: not-allowed;\n}\n\n:host([disabled]) z-icon {\n fill: var(--color-disabled01-icon);\n}\n\n.z-tool-tooltip {\n --z-tooltip-padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);\n --z-tooltip-shadow-filter: drop-shadow(0 4px 8px var(--shadow-color-base));\n\n position: relative;\n z-index: 2;\n font-family: var(--font-family-sans);\n white-space: nowrap;\n}\n\n.z-tool-submenu {\n z-index: 3;\n border-radius: calc(var(--border-radius) + var(--border-size-small));\n}\n\n.z-tool-submenu ::slotted(z-color-picker) {\n border: var(--border-size-small) solid var(--color-surface03);\n border-radius: var(--border-radius);\n}\n\n@media (max-width: 767px) and (hover: none) {\n .z-tool-tooltip {\n display: none !important;\n }\n}\n",":root {\n /* font-family */\n --font-family-sans: \"IBM Plex Sans\", sans-serif;\n --font-family-serif: \"IBM Plex Serif\", serif;\n\n /* font-weight */\n --font-lt: 300;\n --font-rg: 400;\n --font-sb: 600;\n --font-bd: 700;\n\n /* font-size type scale */\n --font-size-1: 0.75rem; /* 12px */\n --font-size-2: 0.875rem; /* 14px */\n --font-size-3: 1rem; /* assuming 16px */\n --font-size-4: 1.125rem; /* 18px */\n --font-size-5: 1.25rem; /* 20px */\n --font-size-6: 1.5rem; /* 24px */\n --font-size-7: 1.75rem; /* 28px */\n --font-size-8: 2rem; /* 32px */\n --font-size-9: 2.25rem; /* 36px */\n --font-size-10: 2.625rem; /* 42px */\n --font-size-11: 3rem; /* 48px */\n --font-size-12: 3.375rem; /* 54px */\n --font-size-13: 3.75rem; /* 60px */\n --font-size-14: 4.25rem; /* 68px */\n --font-size-15: 4.75rem; /* 76px */\n --font-size-16: 5.25rem; /* 84px */\n --font-size-17: 5.75rem; /* 92px */\n\n /* cssprops to use with `font` shorthand property */\n --section-title-1: var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);\n --section-title-2: var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);\n --section-title-3: var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);\n --section-title-4: var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);\n --section-title-5: var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);\n --section-title-6: var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif);\n}\n\n/* Typography classes */\n.heading-1,\n.heading-1-sb,\n.heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n}\n\n.heading-2,\n.heading-2-sb,\n.heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-3,\n.heading-3-sb,\n.heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-4,\n.heading-4-sb,\n.heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-1,\n.body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-2,\n.body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-3,\n.body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-4,\n.body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.body-5,\n.body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.interactive-1,\n.interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.interactive-2,\n.interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.interactive-3,\n.interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.helper,\n.helper-sb {\n font-size: var(--font-size-1);\n font-style: italic;\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n/* section title */\n.section-title-1 {\n font: var(--section-title-1);\n}\n\n.section-title-2 {\n font: var(--section-title-2);\n}\n\n.section-title-3 {\n font: var(--section-title-3);\n}\n\n.section-title-4 {\n font: var(--section-title-4);\n}\n\n.section-title-5 {\n font: var(--section-title-5);\n}\n\n.section-title-6 {\n font: var(--section-title-6);\n}\n\n/* heading-1/2 for desktop and wide viewports */\n@media (min-width: 1152px) {\n .heading-1,\n .heading-1-sb,\n .heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .heading-2,\n .heading-2-sb,\n .heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n}\n\n/* viewport classes */\n@media (max-width: 767px) {\n .mobile-heading-1,\n .mobile-heading-1-sb,\n .mobile-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .mobile-heading-2,\n .mobile-heading-2-sb,\n .mobile-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-3,\n .mobile-heading-3-sb,\n .mobile-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-4,\n .mobile-heading-4-sb,\n .mobile-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-1,\n .mobile-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-2,\n .mobile-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-3,\n .mobile-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-4,\n .mobile-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-body-5,\n .mobile-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-interactive-1,\n .mobile-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-interactive-2,\n .mobile-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-interactive-3,\n .mobile-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-section-title-1 {\n font: var(--section-title-1);\n }\n\n .mobile-section-title-2 {\n font: var(--section-title-2);\n }\n\n .mobile-section-title-3 {\n font: var(--section-title-3);\n }\n\n .mobile-section-title-4 {\n font: var(--section-title-4);\n }\n\n .mobile-section-title-5 {\n font: var(--section-title-5);\n }\n\n .mobile-section-title-6 {\n font: var(--section-title-6);\n }\n\n .mobile-heading-1-lt,\n .mobile-heading-2-lt,\n .mobile-heading-3-lt,\n .mobile-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .mobile-heading-1-sb,\n .mobile-heading-2-sb,\n .mobile-heading-3-sb,\n .mobile-heading-4-sb,\n .mobile-body-1-sb,\n .mobile-body-2-sb,\n .mobile-body-3-sb,\n .mobile-body-4-sb,\n .mobile-body-5-sb,\n .mobile-interactive-1-sb,\n .mobile-interactive-2-sb,\n .mobile-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 768px) and (max-width: 1151px) {\n .tablet-heading-1,\n .tablet-heading-1-sb,\n .tablet-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .tablet-heading-2,\n .tablet-heading-2-sb,\n .tablet-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-3,\n .tablet-heading-3-sb,\n .tablet-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-4,\n .tablet-heading-4-sb,\n .tablet-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-1,\n .tablet-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-2,\n .tablet-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-3,\n .tablet-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-4,\n .tablet-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-body-5,\n .tablet-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-interactive-1,\n .tablet-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-interactive-2,\n .tablet-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-interactive-3,\n .tablet-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-section-title-1 {\n font: var(--section-title-1);\n }\n\n .tablet-section-title-2 {\n font: var(--section-title-2);\n }\n\n .tablet-section-title-3 {\n font: var(--section-title-3);\n }\n\n .tablet-section-title-4 {\n font: var(--section-title-4);\n }\n\n .tablet-section-title-5 {\n font: var(--section-title-5);\n }\n\n .tablet-section-title-6 {\n font: var(--section-title-6);\n }\n\n .tablet-heading-1-lt,\n .tablet-heading-2-lt,\n .tablet-heading-3-lt,\n .tablet-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .tablet-heading-1-sb,\n .tablet-heading-2-sb,\n .tablet-heading-3-sb,\n .tablet-heading-4-sb,\n .tablet-body-1-sb,\n .tablet-body-2-sb,\n .tablet-body-3-sb,\n .tablet-body-4-sb,\n .tablet-body-5-sb,\n .tablet-interactive-1-sb,\n .tablet-interactive-2-sb,\n .tablet-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1152px) and (max-width: 1365px) {\n .desktop-heading-1,\n .desktop-heading-1-sb,\n .desktop-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .desktop-heading-2,\n .desktop-heading-2-sb,\n .desktop-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .desktop-heading-3,\n .desktop-heading-3-sb,\n .desktop-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .desktop-heading-4,\n .desktop-heading-4-sb,\n .desktop-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-1,\n .desktop-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-2,\n .desktop-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-3,\n .desktop-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-4,\n .desktop-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-body-5,\n .desktop-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-interactive-1,\n .desktop-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-interactive-2,\n .desktop-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-interactive-3,\n .desktop-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-section-title-1 {\n font: var(--section-title-1);\n }\n\n .desktop-section-title-2 {\n font: var(--section-title-2);\n }\n\n .desktop-section-title-3 {\n font: var(--section-title-3);\n }\n\n .desktop-section-title-4 {\n font: var(--section-title-4);\n }\n\n .desktop-section-title-5 {\n font: var(--section-title-5);\n }\n\n .desktop-section-title-6 {\n font: var(--section-title-6);\n }\n\n .desktop-heading-1-lt,\n .desktop-heading-2-lt,\n .desktop-heading-3-lt,\n .desktop-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .desktop-heading-1-sb,\n .desktop-heading-2-sb,\n .desktop-heading-3-sb,\n .desktop-heading-4-sb,\n .desktop-body-1-sb,\n .desktop-body-2-sb,\n .desktop-body-3-sb,\n .desktop-body-4-sb,\n .desktop-body-5-sb,\n .desktop-interactive-1-sb,\n .desktop-interactive-2-sb,\n .desktop-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1366px) {\n .wide-heading-1,\n .wide-heading-1-sb,\n .wide-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .wide-heading-2,\n .wide-heading-2-sb,\n .wide-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .wide-heading-3,\n .wide-heading-3-sb,\n .wide-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .wide-heading-4,\n .wide-heading-4-sb,\n .wide-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-1,\n .wide-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-2,\n .wide-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-3,\n .wide-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-4,\n .wide-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-body-5,\n .wide-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-interactive-1,\n .wide-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-interactive-2,\n .wide-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-interactive-3,\n .wide-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-section-title-1 {\n font: var(--section-title-1);\n }\n\n .wide-section-title-2 {\n font: var(--section-title-2);\n }\n\n .wide-section-title-3 {\n font: var(--section-title-3);\n }\n\n .wide-section-title-4 {\n font: var(--section-title-4);\n }\n\n .wide-section-title-5 {\n font: var(--section-title-5);\n }\n\n .wide-section-title-6 {\n font: var(--section-title-6);\n }\n\n .wide-heading-1-lt,\n .wide-heading-2-lt,\n .wide-heading-3-lt,\n .wide-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .wide-heading-1-sb,\n .wide-heading-2-sb,\n .wide-heading-3-sb,\n .wide-heading-4-sb,\n .wide-body-1-sb,\n .wide-body-2-sb,\n .wide-body-3-sb,\n .wide-body-4-sb,\n .wide-body-5-sb,\n .wide-interactive-1-sb,\n .wide-interactive-2-sb,\n .wide-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n/* font-weight variants */\n.heading-1-lt,\n.heading-2-lt,\n.heading-3-lt,\n.heading-4-lt {\n font-weight: var(--font-lt);\n}\n\n.heading-1-sb,\n.heading-2-sb,\n.heading-3-sb,\n.heading-4-sb,\n.body-1-sb,\n.body-2-sb,\n.body-3-sb,\n.body-4-sb,\n.body-5-sb,\n.interactive-1-sb,\n.interactive-2-sb,\n.interactive-3-sb,\n.helper-sb {\n font-weight: var(--font-sb);\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {ColorPickerPalette, KeyboardCode, PopoverPosition} from \"../../beans\";\nimport {ZColorPickerCustomEvent, ZToolCustomEvent, ZTooltipCustomEvent} from \"../../components\";\nimport {IconName} from \"../../constants/iconset\";\nimport {containsElement} from \"../../utils/utils\";\n\n/**\n * ZTool component. Can display an icon, an optional tooltip (mainly for hints about the tool's functionality), and can contain a nested `z-toolbar` as a submenu that opens on click.\n * @slot - Optional slot for nested content (e.g., a secondary `z-toolbar`) that appears when the tool is open/clicked.\n */\n@Component({\n tag: \"z-tool\",\n styleUrls: [\"styles.css\", \"../../tokens/typography.css\"],\n shadow: true,\n})\nexport class ZTool implements ComponentInterface {\n @Element() hostElement: HTMLZToolElement;\n\n /** Tool icon */\n @Prop()\n icon: IconName;\n\n /** Text displayed inside the tooltip. */\n @Prop()\n tooltip?: string;\n\n /** Preferred tooltip position. Defaults to true. */\n @Prop()\n tooltipPosition: PopoverPosition = PopoverPosition.TOP;\n\n /** Accessible label for the tool trigger. Falls back to tooltip content. */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Visual active state. */\n @Prop({reflect: true})\n active = false;\n\n /** Disabled state. */\n @Prop({reflect: true})\n disabled = false;\n\n /** Open state. */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Color to use to fill the icon's color indicator, if it has one.\n * Can be any valid value for the `fill` svg attribute.\n * The value of this prop is passed down to the `z-icon` component inside the tool.\n *\n * If `z-color-picker` component is used inside the tool's slot, its `colorSelected` event is listened\n * to automatically update `indicatorColor` and change the color of the icon indicator accordingly.\n */\n @Prop({mutable: true})\n indicatorColor?: string;\n\n @State()\n tooltipOpen = false;\n\n @State()\n hasSlottedContent = false;\n\n @State()\n isMobile = false;\n\n /** Indicates if the tool has nested open tools. Used to decide whether to auto-close the submenu. */\n @State()\n hasNestedOpenTools = false;\n\n /** Emitted when the open state changes. */\n @Event()\n toggleSubmenu: EventEmitter;\n\n /** Emitted when the tooltip open state changes. */\n @Event()\n toggleTooltip: EventEmitter;\n\n private buttonRef?: HTMLButtonElement;\n\n private iconRef?: HTMLElement;\n\n private tooltipRef?: HTMLZTooltipElement;\n\n private hoverDelay?: ReturnType<typeof setTimeout>;\n\n /** Indicates if the tool is nested inside another tool. */\n private isNested = false;\n\n /** Main `z-toolbar` ancestor element, meant to be the top-level toolbar not nested inside another tool. */\n private mainToolbar?: HTMLZToolbarElement;\n\n /** Media query list for detecting mobile view. */\n private mql?: MediaQueryList;\n\n /** Listener for changes in the mobile view media query. */\n private onMobileViewChange?: (e: MediaQueryListEvent) => void;\n\n /**\n * Opens the tooltip with a delay when the button is hovered or focused, and if the tool's content isn't already visible.\n */\n private handleTooltipOpen = (ev: FocusEvent | MouseEvent): void => {\n if (!this.tooltip || this.open || !this.buttonRef.contains(ev.target as Node)) {\n return;\n }\n\n clearTimeout(this.hoverDelay);\n this.hoverDelay = setTimeout(() => {\n this.tooltipOpen = true;\n }, 1000);\n };\n\n /**\n * Closes the tooltip immediately on button blur or when the mouse leaves the button or the tooltip, clearing any pending hover delay.\n */\n private handleTooltipClose = (ev: FocusEvent | MouseEvent): void => {\n if (!this.tooltip || (ev.relatedTarget as HTMLElement)?.closest(\"z-tooltip\") === this.tooltipRef) {\n return;\n }\n\n clearTimeout(this.hoverDelay);\n this.tooltipOpen = false;\n };\n\n /**\n * Handles click events on the tool's button element.\n * If the tool has slotted content, toggles the open state and focuses the active/selected item in the nested toolbar or color picker,\n * or the first item if no active/selected item is found.\n */\n private handleClick = (): void => {\n if (this.disabled || !this.hasSlottedContent) {\n return;\n }\n\n this.open = !this.open;\n if (this.open) {\n const colorPicker = this.hostElement.querySelector(\":scope > z-color-picker\") as HTMLZColorPickerElement | null;\n if (colorPicker) {\n colorPicker.setFocus();\n\n return;\n }\n\n // Focus the first active tool in the nested toolbar, or the first enabled if no active tool is found.\n const firstActiveOrEnabledNestedTool = (this.hostElement.querySelector(\n \":scope > z-toolbar z-tool[active]:not(:disabled)\"\n ) || this.hostElement.querySelector(\":scope > z-toolbar z-tool:not(:disabled)\")) as HTMLZToolElement | null;\n\n firstActiveOrEnabledNestedTool?.setFocus();\n }\n };\n\n /**\n * Handles `openChange` events from the tooltip popover to keep the `tooltipOpen` state in sync, but only if the event is coming from this tool's tooltip (and not from nested tools' tooltips).\n */\n private onTooltipOpenChange = (event: ZTooltipCustomEvent<{open: boolean}>): void => {\n if ((event.target as HTMLElement) === this.tooltipRef) {\n return;\n }\n\n this.tooltipOpen = event.detail.open;\n };\n\n @Watch(\"open\")\n handleOpenChange(): void {\n this.toggleSubmenu.emit(this.open);\n }\n\n @Watch(\"tooltipOpen\")\n handleTooltipOpenChange(): void {\n this.toggleTooltip.emit(this.tooltipOpen);\n }\n\n /**\n * Handle `ESC` and `shift+TAB` to close the submenu and move focus back to the button.\n */\n @Listen(\"keydown\")\n handleKeyDown(event: KeyboardEvent): void {\n if (!this.open || this.hasNestedOpenTools) {\n return;\n }\n\n switch (event.key) {\n case KeyboardCode.ESC:\n event.stopPropagation();\n this.open = false;\n this.setFocus();\n break;\n case KeyboardCode.TAB:\n if (event.shiftKey && (event.target as Element).closest(\"z-tool:not(:scope)\") === this.hostElement) {\n this.open = false;\n }\n break;\n }\n }\n\n /**\n * Close the popover on clicks outside the component, only if there are no nested open tools.\n * In that case any outside click should close the nested submenu(s) first.\n */\n @Listen(\"click\", {target: \"body\"})\n onOutsideClick(event: MouseEvent): void {\n const target = event.composedPath()[0] as HTMLElement;\n if (!this.open || containsElement(this.hostElement, target) || this.hasNestedOpenTools) {\n return;\n }\n\n this.open = false;\n }\n\n @Listen(\"toggleSubmenu\")\n onNestedToolToggle(ev: ZToolCustomEvent<boolean>): void {\n if (ev.target === this.hostElement) {\n return;\n }\n\n if (ev.detail === true) {\n this.hasNestedOpenTools = true;\n\n return;\n }\n\n this.hasNestedOpenTools = Array.from(this.hostElement.querySelectorAll(\"z-tool\")).some((tool) => tool.open);\n }\n\n /**\n * Handles the `colorSelected` event from a nested `z-color-picker` component.\n * Updates the `indicatorColor` and closes the tool's popover.\n */\n @Listen(\"colorSelected\")\n handleColorSelected(event: ZColorPickerCustomEvent<ColorPickerPalette>): void {\n if (!Array.from(this.hostElement.children).includes(event.target as Element)) {\n return;\n }\n\n this.indicatorColor = event.detail;\n this.open = false;\n this.setFocus();\n }\n\n /**\n * Close the submenu when focus moves outside the tool.\n */\n @Listen(\"focusin\", {target: \"body\", passive: true})\n handleExternalFocusin(ev: FocusEvent): void {\n const target = ev.target as Node;\n if (!containsElement(this.hostElement, target)) {\n this.open = false;\n }\n }\n\n /** Focuses the tool's button element. */\n @Method()\n async setFocus(): Promise<void> {\n if (this.disabled) {\n return;\n }\n\n setTimeout(() => {\n this.buttonRef?.focus();\n }, 50);\n }\n\n /** Sets the tab index of the tool's internal button element. */\n @Method()\n async setTabIndex(value: number): Promise<void> {\n if (!this.buttonRef) {\n return;\n }\n\n this.buttonRef.tabIndex = this.disabled ? -1 : value;\n }\n\n /** Closes the tooltip. */\n @Method()\n async closeTooltip(): Promise<void> {\n clearTimeout(this.hoverDelay);\n this.tooltipOpen = false;\n }\n\n componentWillLoad(): void {\n this.hasSlottedContent = this.hostElement.children.length > 0;\n this.isNested = !!this.hostElement.closest(\"z-tool:not(:scope)\");\n this.mainToolbar = this.hostElement.closest(\"z-toolbar:not(z-toolbar z-toolbar)\");\n this.hasNestedOpenTools = !!this.hostElement.querySelector(\"z-tool[open]\");\n\n this.mql = matchMedia(\"(max-width: 767px)\");\n this.onMobileViewChange = (e: MediaQueryListEvent) => (this.isMobile = e.matches);\n this.mql.addEventListener(\"change\", this.onMobileViewChange);\n this.isMobile = this.mql.matches;\n }\n\n disconnectedCallback(): void {\n clearTimeout(this.hoverDelay);\n this.mql?.removeEventListener(\"change\", this.onMobileViewChange);\n }\n\n render(): HTMLZToolElement {\n return (\n <Host class={{\"z-tool-tooltip-open\": this.tooltipOpen}}>\n <button\n class=\"z-tool\"\n type=\"button\"\n ref={(el) => (this.buttonRef = el)}\n aria-pressed={this.hasSlottedContent ? undefined : this.active ? \"true\" : \"false\"}\n aria-expanded={this.hasSlottedContent ? (this.open ? \"true\" : \"false\") : undefined}\n aria-haspopup={this.hasSlottedContent ? \"true\" : undefined}\n aria-label={this.htmlAriaLabel || this.tooltip || undefined}\n disabled={this.disabled}\n onClick={this.handleClick}\n onMouseEnter={this.handleTooltipOpen}\n onMouseLeave={this.handleTooltipClose}\n onFocus={this.handleTooltipOpen}\n onBlur={this.handleTooltipClose}\n >\n <z-icon\n ref={(el) => (this.iconRef = el)}\n name={this.icon}\n indicatorColor={this.indicatorColor}\n ></z-icon>\n </button>\n {this.tooltip && (\n <z-tooltip\n class=\"z-tool-tooltip\"\n ref={(el) => (this.tooltipRef = el)}\n bindTo={this.iconRef}\n open={this.tooltipOpen && !this.open}\n position={this.isNested ? PopoverPosition.BOTTOM : this.tooltipPosition}\n dark\n onMouseLeave={this.handleTooltipClose}\n onBlur={this.handleTooltipClose}\n onOpenChange={this.onTooltipOpenChange}\n >\n <span class=\"body-4\">{this.tooltip}</span>\n </z-tooltip>\n )}\n {this.hasSlottedContent && (\n <z-popover\n class=\"z-tool-submenu\"\n open={this.open}\n bindTo={this.isMobile && this.mainToolbar ? this.mainToolbar : this.hostElement}\n center\n /* disable auto-close to prevent unwanted close behaviors on mobile,\n when the bound element is the main toolbar */\n closable={false}\n position={this.isMobile ? PopoverPosition.TOP : PopoverPosition.BOTTOM}\n >\n <slot></slot>\n </z-popover>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"2SAAA,MAAMA,EAAY,IAAM,gkDCAxB,MAAMC,EAAgB,IAAM,k8X,MC4BfC,EAAKC,EAAA,MAAAD,UAAAE,EALlB,WAAAC,CAAAC,G,4JAkBEC,KAAAC,gBAAmCC,EAAgBC,IAQnDH,KAAAI,OAAS,MAITJ,KAAAK,SAAW,MAIXL,KAAAM,KAAO,MAcPN,KAAAO,YAAc,MAGdP,KAAAQ,kBAAoB,MAGpBR,KAAAS,SAAW,MAIXT,KAAAU,mBAAqB,MAmBbV,KAAAW,SAAW,MAcXX,KAAAY,kBAAqBC,IAC3B,IAAKb,KAAKc,SAAWd,KAAKM,OAASN,KAAKe,UAAUC,SAASH,EAAGI,QAAiB,CAC7E,M,CAGFC,aAAalB,KAAKmB,YAClBnB,KAAKmB,WAAaC,YAAW,KAC3BpB,KAAKO,YAAc,IAAI,GACtB,IAAK,EAMFP,KAAAqB,mBAAsBR,I,MAC5B,IAAKb,KAAKc,WAAWQ,EAACT,EAAGU,iBAA6B,MAAAD,SAAA,SAAAA,EAAEE,QAAQ,gBAAiBxB,KAAKyB,WAAY,CAChG,M,CAGFP,aAAalB,KAAKmB,YAClBnB,KAAKO,YAAc,KAAK,EAQlBP,KAAA0B,YAAc,KACpB,GAAI1B,KAAKK,WAAaL,KAAKQ,kBAAmB,CAC5C,M,CAGFR,KAAKM,MAAQN,KAAKM,KAClB,GAAIN,KAAKM,KAAM,CACb,MAAMqB,EAAc3B,KAAK4B,YAAYC,cAAc,2BACnD,GAAIF,EAAa,CACfA,EAAYG,WAEZ,M,CAIF,MAAMC,EAAkC/B,KAAK4B,YAAYC,cACvD,qDACG7B,KAAK4B,YAAYC,cAAc,4CAEpCE,IAA8B,MAA9BA,SAA8B,SAA9BA,EAAgCD,U,GAO5B9B,KAAAgC,oBAAuBC,IAC7B,GAAKA,EAAMhB,SAA2BjB,KAAKyB,WAAY,CACrD,M,CAGFzB,KAAKO,YAAc0B,EAAMC,OAAO5B,IAAI,CAiMvC,CA7LC,gBAAA6B,GACEnC,KAAKoC,cAAcC,KAAKrC,KAAKM,K,CAI/B,uBAAAgC,GACEtC,KAAKuC,cAAcF,KAAKrC,KAAKO,Y,CAO/B,aAAAiC,CAAcP,GACZ,IAAKjC,KAAKM,MAAQN,KAAKU,mBAAoB,CACzC,M,CAGF,OAAQuB,EAAMQ,KACZ,KAAKC,EAAaC,IAChBV,EAAMW,kBACN5C,KAAKM,KAAO,MACZN,KAAK8B,WACL,MACF,KAAKY,EAAaG,IAChB,GAAIZ,EAAMa,UAAab,EAAMhB,OAAmBO,QAAQ,wBAA0BxB,KAAK4B,YAAa,CAClG5B,KAAKM,KAAO,K,CAEd,M,CASN,cAAAyC,CAAed,GACb,MAAMhB,EAASgB,EAAMe,eAAe,GACpC,IAAKhD,KAAKM,MAAQ2C,EAAgBjD,KAAK4B,YAAaX,IAAWjB,KAAKU,mBAAoB,CACtF,M,CAGFV,KAAKM,KAAO,K,CAId,kBAAA4C,CAAmBrC,GACjB,GAAIA,EAAGI,SAAWjB,KAAK4B,YAAa,CAClC,M,CAGF,GAAIf,EAAGqB,SAAW,KAAM,CACtBlC,KAAKU,mBAAqB,KAE1B,M,CAGFV,KAAKU,mBAAqByC,MAAMC,KAAKpD,KAAK4B,YAAYyB,iBAAiB,WAAWC,MAAMC,GAASA,EAAKjD,M,CAQxG,mBAAAkD,CAAoBvB,GAClB,IAAKkB,MAAMC,KAAKpD,KAAK4B,YAAY6B,UAAUC,SAASzB,EAAMhB,QAAoB,CAC5E,M,CAGFjB,KAAK2D,eAAiB1B,EAAMC,OAC5BlC,KAAKM,KAAO,MACZN,KAAK8B,U,CAOP,qBAAA8B,CAAsB/C,GACpB,MAAMI,EAASJ,EAAGI,OAClB,IAAKgC,EAAgBjD,KAAK4B,YAAaX,GAAS,CAC9CjB,KAAKM,KAAO,K,EAMhB,cAAMwB,GACJ,GAAI9B,KAAKK,SAAU,CACjB,M,CAGFe,YAAW,K,OACTE,EAAAtB,KAAKe,aAAS,MAAAO,SAAA,SAAAA,EAAEuC,OAAO,GACtB,G,CAKL,iBAAMC,CAAYC,GAChB,IAAK/D,KAAKe,UAAW,CACnB,M,CAGFf,KAAKe,UAAUiD,SAAWhE,KAAKK,UAAW,EAAK0D,C,CAKjD,kBAAME,GACJ/C,aAAalB,KAAKmB,YAClBnB,KAAKO,YAAc,K,CAGrB,iBAAA2D,GACElE,KAAKQ,kBAAoBR,KAAK4B,YAAY6B,SAASU,OAAS,EAC5DnE,KAAKW,WAAaX,KAAK4B,YAAYJ,QAAQ,sBAC3CxB,KAAKoE,YAAcpE,KAAK4B,YAAYJ,QAAQ,sCAC5CxB,KAAKU,qBAAuBV,KAAK4B,YAAYC,cAAc,gBAE3D7B,KAAKqE,IAAMC,WAAW,sBACtBtE,KAAKuE,mBAAsBC,GAA4BxE,KAAKS,SAAW+D,EAAEC,QACzEzE,KAAKqE,IAAIK,iBAAiB,SAAU1E,KAAKuE,oBACzCvE,KAAKS,SAAWT,KAAKqE,IAAII,O,CAG3B,oBAAAE,G,MACEzD,aAAalB,KAAKmB,aAClBG,EAAAtB,KAAKqE,OAAG,MAAA/C,SAAA,SAAAA,EAAEsD,oBAAoB,SAAU5E,KAAKuE,mB,CAG/C,MAAAM,GACE,OACEC,EAACC,EAAI,CAAAtC,IAAA,2CAACuC,MAAO,CAAC,sBAAuBhF,KAAKO,cACxCuE,EAAA,UAAArC,IAAA,2CACEuC,MAAM,SACNC,KAAK,SACLC,IAAMC,GAAQnF,KAAKe,UAAYoE,EAAG,eACpBnF,KAAKQ,kBAAoB4E,UAAYpF,KAAKI,OAAS,OAAS,QAAO,gBAClEJ,KAAKQ,kBAAqBR,KAAKM,KAAO,OAAS,QAAW8E,UAAS,gBACnEpF,KAAKQ,kBAAoB,OAAS4E,UAAS,aAC9CpF,KAAKqF,eAAiBrF,KAAKc,SAAWsE,UAClD/E,SAAUL,KAAKK,SACfiF,QAAStF,KAAK0B,YACd6D,aAAcvF,KAAKY,kBACnB4E,aAAcxF,KAAKqB,mBACnBoE,QAASzF,KAAKY,kBACd8E,OAAQ1F,KAAKqB,oBAEbyD,EAAA,UAAArC,IAAA,2CACEyC,IAAMC,GAAQnF,KAAK2F,QAAUR,EAC7BS,KAAM5F,KAAK6F,KACXlC,eAAgB3D,KAAK2D,kBAGxB3D,KAAKc,SACJgE,EAAA,aAAArC,IAAA,2CACEuC,MAAM,iBACNE,IAAMC,GAAQnF,KAAKyB,WAAa0D,EAChCW,OAAQ9F,KAAK2F,QACbrF,KAAMN,KAAKO,cAAgBP,KAAKM,KAChCyF,SAAU/F,KAAKW,SAAWT,EAAgB8F,OAAShG,KAAKC,gBACxDgG,KAAI,KACJT,aAAcxF,KAAKqB,mBACnBqE,OAAQ1F,KAAKqB,mBACb6E,aAAclG,KAAKgC,qBAEnB8C,EAAA,QAAArC,IAAA,2CAAMuC,MAAM,UAAUhF,KAAKc,UAG9Bd,KAAKQ,mBACJsE,EAAA,aAAArC,IAAA,2CACEuC,MAAM,iBACN1E,KAAMN,KAAKM,KACXwF,OAAQ9F,KAAKS,UAAYT,KAAKoE,YAAcpE,KAAKoE,YAAcpE,KAAK4B,YACpEuE,OAAM,KAGNC,SAAU,MACVL,SAAU/F,KAAKS,SAAWP,EAAgBC,IAAMD,EAAgB8F,QAEhElB,EAAA,QAAArC,IAAA,8C","ignoreList":[]}
1
+ {"version":3,"names":["stylesCss","typographyCss","ZTool","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","tooltipPosition","PopoverPosition","TOP","active","disabled","open","tooltipOpen","hasSlottedContent","isMobile","hasNestedOpenTools","isNested","handleTooltipOpen","ev","tooltip","buttonRef","contains","target","clearTimeout","hoverDelay","setTimeout","handleTooltipClose","_a","relatedTarget","closest","tooltipRef","handleClick","colorPicker","hostElement","querySelector","setFocus","firstActiveOrEnabledNestedTool","onTooltipOpenChange","event","detail","handleOpenChange","toggleSubmenu","emit","handleTooltipOpenChange","toggleTooltip","handleKeyDown","key","KeyboardCode","ESC","stopPropagation","TAB","shiftKey","onOutsideClick","composedPath","containsElement","onNestedToolToggle","Array","from","querySelectorAll","some","tool","handleColorSelected","children","includes","indicatorColor","handleExternalFocusin","focus","setTabIndex","value","tabIndex","closeTooltip","componentWillLoad","length","mainToolbar","mql","matchMedia","onMobileViewChange","e","matches","addEventListener","disconnectedCallback","removeEventListener","render","h","Host","class","type","ref","el","undefined","htmlAriaLabel","onClick","onMouseEnter","onMouseLeave","onFocus","onBlur","iconRef","name","icon","bindTo","position","BOTTOM","dark","onOpenChange","center","closable"],"sources":["src/components/z-tool/styles.css?tag=z-tool&encapsulation=shadow","src/tokens/typography.css?tag=z-tool&encapsulation=shadow","src/components/z-tool/index.tsx"],"sourcesContent":[":host,\n* {\n box-sizing: border-box;\n}\n\n.z-tool {\n --z-tool-size: calc(var(--space-unit) * 5.5);\n --z-tool-icon-size: calc(var(--space-unit) * 2.5);\n\n position: relative;\n display: inline-flex;\n width: var(--z-tool-size);\n height: var(--z-tool-size);\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: 0;\n background-color: var(--color-surface01);\n border-radius: var(--border-radius);\n cursor: pointer;\n}\n\n:host(:is([active], [open])) .z-tool {\n box-shadow: inset 0 0 0 2px var(--color-primary01);\n}\n\n:host([open]) .z-tool {\n background: var(--color-primary03);\n}\n\n@media (hover: hover) {\n :host(:hover),\n :host(.z-tool-tooltip-open) {\n /* ensure any open tooltip is shown over sibling elements */\n z-index: 1;\n }\n\n :host(:not([disabled])) .z-tool:hover {\n background-color: var(--color-primary03);\n }\n}\n\n.z-tool:focus:focus-visible {\n background-color: var(--color-primary03);\n outline: none;\n}\n\nz-icon {\n --z-icon-width: var(--z-tool-icon-size);\n --z-icon-height: var(--z-tool-icon-size);\n\n display: block;\n fill: var(--color-default-icon);\n}\n\n:host([disabled]) .z-tool {\n color: var(--color-disabled01-icon);\n cursor: not-allowed;\n}\n\n:host([disabled]) z-icon {\n fill: var(--color-disabled01-icon);\n}\n\n.z-tool-tooltip {\n --z-tooltip-padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);\n --z-tooltip-shadow-filter: drop-shadow(0 4px 8px var(--shadow-color-base));\n\n position: relative;\n z-index: 2;\n font-family: var(--font-family-sans);\n white-space: nowrap;\n}\n\n.z-tool-submenu {\n z-index: 3;\n border-radius: calc(var(--border-radius) + var(--border-size-small));\n}\n\n.z-tool-submenu ::slotted(z-color-picker) {\n border: var(--border-size-small) solid var(--color-surface03);\n border-radius: var(--border-radius);\n}\n\n@media (max-width: 767px) and (hover: none) {\n .z-tool-tooltip {\n display: none !important;\n }\n}\n",":root {\n /* font-family */\n --font-family-sans: \"IBM Plex Sans\", sans-serif;\n --font-family-serif: \"IBM Plex Serif\", serif;\n\n /* font-weight */\n --font-lt: 300;\n --font-rg: 400;\n --font-sb: 600;\n --font-bd: 700;\n\n /* font-size type scale */\n --font-size-1: 0.75rem; /* 12px */\n --font-size-2: 0.875rem; /* 14px */\n --font-size-3: 1rem; /* assuming 16px */\n --font-size-4: 1.125rem; /* 18px */\n --font-size-5: 1.25rem; /* 20px */\n --font-size-6: 1.5rem; /* 24px */\n --font-size-7: 1.75rem; /* 28px */\n --font-size-8: 2rem; /* 32px */\n --font-size-9: 2.25rem; /* 36px */\n --font-size-10: 2.625rem; /* 42px */\n --font-size-11: 3rem; /* 48px */\n --font-size-12: 3.375rem; /* 54px */\n --font-size-13: 3.75rem; /* 60px */\n --font-size-14: 4.25rem; /* 68px */\n --font-size-15: 4.75rem; /* 76px */\n --font-size-16: 5.25rem; /* 84px */\n --font-size-17: 5.75rem; /* 92px */\n\n /* cssprops to use with `font` shorthand property */\n --section-title-1: var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);\n --section-title-2: var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);\n --section-title-3: var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);\n --section-title-4: var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);\n --section-title-5: var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);\n --section-title-6: var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif);\n}\n\n/* Typography classes */\n.heading-1,\n.heading-1-sb,\n.heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n}\n\n.heading-2,\n.heading-2-sb,\n.heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-3,\n.heading-3-sb,\n.heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-4,\n.heading-4-sb,\n.heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-1,\n.body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-2,\n.body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-3,\n.body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-4,\n.body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.body-5,\n.body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.interactive-1,\n.interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.interactive-2,\n.interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.interactive-3,\n.interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.helper,\n.helper-sb {\n font-size: var(--font-size-1);\n font-style: italic;\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n/* section title */\n.section-title-1 {\n font: var(--section-title-1);\n}\n\n.section-title-2 {\n font: var(--section-title-2);\n}\n\n.section-title-3 {\n font: var(--section-title-3);\n}\n\n.section-title-4 {\n font: var(--section-title-4);\n}\n\n.section-title-5 {\n font: var(--section-title-5);\n}\n\n.section-title-6 {\n font: var(--section-title-6);\n}\n\n/* heading-1/2 for desktop and wide viewports */\n@media (min-width: 1152px) {\n .heading-1,\n .heading-1-sb,\n .heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .heading-2,\n .heading-2-sb,\n .heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n}\n\n/* viewport classes */\n@media (max-width: 767px) {\n .mobile-heading-1,\n .mobile-heading-1-sb,\n .mobile-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .mobile-heading-2,\n .mobile-heading-2-sb,\n .mobile-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-3,\n .mobile-heading-3-sb,\n .mobile-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-4,\n .mobile-heading-4-sb,\n .mobile-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-1,\n .mobile-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-2,\n .mobile-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-3,\n .mobile-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-4,\n .mobile-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-body-5,\n .mobile-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-interactive-1,\n .mobile-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-interactive-2,\n .mobile-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-interactive-3,\n .mobile-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-section-title-1 {\n font: var(--section-title-1);\n }\n\n .mobile-section-title-2 {\n font: var(--section-title-2);\n }\n\n .mobile-section-title-3 {\n font: var(--section-title-3);\n }\n\n .mobile-section-title-4 {\n font: var(--section-title-4);\n }\n\n .mobile-section-title-5 {\n font: var(--section-title-5);\n }\n\n .mobile-section-title-6 {\n font: var(--section-title-6);\n }\n\n .mobile-heading-1-lt,\n .mobile-heading-2-lt,\n .mobile-heading-3-lt,\n .mobile-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .mobile-heading-1-sb,\n .mobile-heading-2-sb,\n .mobile-heading-3-sb,\n .mobile-heading-4-sb,\n .mobile-body-1-sb,\n .mobile-body-2-sb,\n .mobile-body-3-sb,\n .mobile-body-4-sb,\n .mobile-body-5-sb,\n .mobile-interactive-1-sb,\n .mobile-interactive-2-sb,\n .mobile-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 768px) and (max-width: 1151px) {\n .tablet-heading-1,\n .tablet-heading-1-sb,\n .tablet-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .tablet-heading-2,\n .tablet-heading-2-sb,\n .tablet-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-3,\n .tablet-heading-3-sb,\n .tablet-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-4,\n .tablet-heading-4-sb,\n .tablet-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-1,\n .tablet-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-2,\n .tablet-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-3,\n .tablet-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-4,\n .tablet-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-body-5,\n .tablet-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-interactive-1,\n .tablet-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-interactive-2,\n .tablet-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-interactive-3,\n .tablet-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-section-title-1 {\n font: var(--section-title-1);\n }\n\n .tablet-section-title-2 {\n font: var(--section-title-2);\n }\n\n .tablet-section-title-3 {\n font: var(--section-title-3);\n }\n\n .tablet-section-title-4 {\n font: var(--section-title-4);\n }\n\n .tablet-section-title-5 {\n font: var(--section-title-5);\n }\n\n .tablet-section-title-6 {\n font: var(--section-title-6);\n }\n\n .tablet-heading-1-lt,\n .tablet-heading-2-lt,\n .tablet-heading-3-lt,\n .tablet-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .tablet-heading-1-sb,\n .tablet-heading-2-sb,\n .tablet-heading-3-sb,\n .tablet-heading-4-sb,\n .tablet-body-1-sb,\n .tablet-body-2-sb,\n .tablet-body-3-sb,\n .tablet-body-4-sb,\n .tablet-body-5-sb,\n .tablet-interactive-1-sb,\n .tablet-interactive-2-sb,\n .tablet-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1152px) and (max-width: 1365px) {\n .desktop-heading-1,\n .desktop-heading-1-sb,\n .desktop-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .desktop-heading-2,\n .desktop-heading-2-sb,\n .desktop-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .desktop-heading-3,\n .desktop-heading-3-sb,\n .desktop-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .desktop-heading-4,\n .desktop-heading-4-sb,\n .desktop-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-1,\n .desktop-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-2,\n .desktop-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-3,\n .desktop-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-4,\n .desktop-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-body-5,\n .desktop-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-interactive-1,\n .desktop-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-interactive-2,\n .desktop-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-interactive-3,\n .desktop-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-section-title-1 {\n font: var(--section-title-1);\n }\n\n .desktop-section-title-2 {\n font: var(--section-title-2);\n }\n\n .desktop-section-title-3 {\n font: var(--section-title-3);\n }\n\n .desktop-section-title-4 {\n font: var(--section-title-4);\n }\n\n .desktop-section-title-5 {\n font: var(--section-title-5);\n }\n\n .desktop-section-title-6 {\n font: var(--section-title-6);\n }\n\n .desktop-heading-1-lt,\n .desktop-heading-2-lt,\n .desktop-heading-3-lt,\n .desktop-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .desktop-heading-1-sb,\n .desktop-heading-2-sb,\n .desktop-heading-3-sb,\n .desktop-heading-4-sb,\n .desktop-body-1-sb,\n .desktop-body-2-sb,\n .desktop-body-3-sb,\n .desktop-body-4-sb,\n .desktop-body-5-sb,\n .desktop-interactive-1-sb,\n .desktop-interactive-2-sb,\n .desktop-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1366px) {\n .wide-heading-1,\n .wide-heading-1-sb,\n .wide-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .wide-heading-2,\n .wide-heading-2-sb,\n .wide-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .wide-heading-3,\n .wide-heading-3-sb,\n .wide-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .wide-heading-4,\n .wide-heading-4-sb,\n .wide-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-1,\n .wide-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-2,\n .wide-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-3,\n .wide-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-4,\n .wide-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-body-5,\n .wide-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-interactive-1,\n .wide-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-interactive-2,\n .wide-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-interactive-3,\n .wide-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-section-title-1 {\n font: var(--section-title-1);\n }\n\n .wide-section-title-2 {\n font: var(--section-title-2);\n }\n\n .wide-section-title-3 {\n font: var(--section-title-3);\n }\n\n .wide-section-title-4 {\n font: var(--section-title-4);\n }\n\n .wide-section-title-5 {\n font: var(--section-title-5);\n }\n\n .wide-section-title-6 {\n font: var(--section-title-6);\n }\n\n .wide-heading-1-lt,\n .wide-heading-2-lt,\n .wide-heading-3-lt,\n .wide-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .wide-heading-1-sb,\n .wide-heading-2-sb,\n .wide-heading-3-sb,\n .wide-heading-4-sb,\n .wide-body-1-sb,\n .wide-body-2-sb,\n .wide-body-3-sb,\n .wide-body-4-sb,\n .wide-body-5-sb,\n .wide-interactive-1-sb,\n .wide-interactive-2-sb,\n .wide-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n/* font-weight variants */\n.heading-1-lt,\n.heading-2-lt,\n.heading-3-lt,\n.heading-4-lt {\n font-weight: var(--font-lt);\n}\n\n.heading-1-sb,\n.heading-2-sb,\n.heading-3-sb,\n.heading-4-sb,\n.body-1-sb,\n.body-2-sb,\n.body-3-sb,\n.body-4-sb,\n.body-5-sb,\n.interactive-1-sb,\n.interactive-2-sb,\n.interactive-3-sb,\n.helper-sb {\n font-weight: var(--font-sb);\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {ColorPickerPalette, KeyboardCode, PopoverPosition} from \"../../beans\";\nimport {ZColorPickerCustomEvent, ZToolCustomEvent, ZTooltipCustomEvent} from \"../../components\";\nimport {IconName} from \"../../constants/iconset\";\nimport {containsElement} from \"../../utils/utils\";\n\n/**\n * ZTool component. Can display an icon, an optional tooltip (mainly for hints about the tool's functionality), and can contain a nested `z-toolbar` as a submenu that opens on click.\n * @slot - Optional slot for nested content (e.g., a secondary `z-toolbar`) that appears when the tool is open/clicked.\n */\n@Component({\n tag: \"z-tool\",\n styleUrls: [\"styles.css\", \"../../tokens/typography.css\"],\n shadow: true,\n})\nexport class ZTool implements ComponentInterface {\n @Element() hostElement: HTMLZToolElement;\n\n /** Tool icon */\n @Prop()\n icon: IconName;\n\n /** Text displayed inside the tooltip. */\n @Prop()\n tooltip?: string;\n\n /** Preferred tooltip position. Defaults to true. */\n @Prop()\n tooltipPosition: PopoverPosition = PopoverPosition.TOP;\n\n /** Accessible label for the tool trigger. Falls back to tooltip content. */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Visual active state. */\n @Prop({reflect: true})\n active = false;\n\n /** Disabled state. */\n @Prop({reflect: true})\n disabled = false;\n\n /** Open state. */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Color to use to fill the icon's color indicator, if it has one.\n * Can be any valid value for the `fill` svg attribute.\n * The value of this prop is passed down to the `z-icon` component inside the tool.\n *\n * If `z-color-picker` component is used inside the tool's slot, its `colorSelected` event is listened\n * to automatically update `indicatorColor` and change the color of the icon indicator accordingly.\n */\n @Prop({mutable: true})\n indicatorColor?: string;\n\n @State()\n tooltipOpen = false;\n\n @State()\n hasSlottedContent = false;\n\n @State()\n isMobile = false;\n\n /** Indicates if the tool has nested open tools. Used to decide whether to auto-close the submenu. */\n @State()\n hasNestedOpenTools = false;\n\n /** Emitted when the open state changes. */\n @Event()\n toggleSubmenu: EventEmitter;\n\n /** Emitted when the tooltip open state changes. */\n @Event()\n toggleTooltip: EventEmitter;\n\n private buttonRef?: HTMLButtonElement;\n\n private iconRef?: HTMLElement;\n\n private tooltipRef?: HTMLZTooltipElement;\n\n private hoverDelay?: ReturnType<typeof setTimeout>;\n\n /** Indicates if the tool is nested inside another tool. */\n private isNested = false;\n\n /** Main `z-toolbar` ancestor element, meant to be the top-level toolbar not nested inside another tool. */\n private mainToolbar?: HTMLZToolbarElement;\n\n /** Media query list for detecting mobile view. */\n private mql?: MediaQueryList;\n\n /** Listener for changes in the mobile view media query. */\n private onMobileViewChange?: (e: MediaQueryListEvent) => void;\n\n /**\n * Opens the tooltip with a delay when the button is hovered or focused, and if the tool's content isn't already visible.\n */\n private handleTooltipOpen = (ev: FocusEvent | MouseEvent): void => {\n if (!this.tooltip || this.open || !this.buttonRef.contains(ev.target as Node)) {\n return;\n }\n\n clearTimeout(this.hoverDelay);\n this.hoverDelay = setTimeout(() => {\n this.tooltipOpen = true;\n }, 1000);\n };\n\n /**\n * Closes the tooltip immediately on button blur or when the mouse leaves the button or the tooltip, clearing any pending hover delay.\n */\n private handleTooltipClose = (ev: FocusEvent | MouseEvent): void => {\n if (!this.tooltip || (ev.relatedTarget as HTMLElement)?.closest(\"z-tooltip\") === this.tooltipRef) {\n return;\n }\n\n clearTimeout(this.hoverDelay);\n this.tooltipOpen = false;\n };\n\n /**\n * Handles click events on the tool's button element.\n * If the tool has slotted content, toggles the open state and focuses the active/selected item in the nested toolbar or color picker,\n * or the first item if no active/selected item is found.\n */\n private handleClick = (): void => {\n if (this.disabled || !this.hasSlottedContent) {\n return;\n }\n\n this.open = !this.open;\n if (this.open) {\n const colorPicker = this.hostElement.querySelector(\":scope > z-color-picker\") as HTMLZColorPickerElement | null;\n if (colorPicker) {\n colorPicker.setFocus();\n\n return;\n }\n\n // Focus the first active tool in the nested toolbar, or the first enabled if no active tool is found.\n const firstActiveOrEnabledNestedTool = (this.hostElement.querySelector(\n \":scope > z-toolbar z-tool[active]:not(:disabled)\"\n ) || this.hostElement.querySelector(\":scope > z-toolbar z-tool:not(:disabled)\")) as HTMLZToolElement | null;\n\n firstActiveOrEnabledNestedTool?.setFocus();\n }\n };\n\n /**\n * Handles `openChange` events from the tooltip popover to keep the `tooltipOpen` state in sync, but only if the event is coming from this tool's tooltip (and not from nested tools' tooltips).\n */\n private onTooltipOpenChange = (event: ZTooltipCustomEvent<{open: boolean}>): void => {\n if ((event.target as HTMLElement) === this.tooltipRef) {\n return;\n }\n\n this.tooltipOpen = event.detail.open;\n };\n\n @Watch(\"open\")\n handleOpenChange(): void {\n this.toggleSubmenu.emit(this.open);\n }\n\n @Watch(\"tooltipOpen\")\n handleTooltipOpenChange(): void {\n this.toggleTooltip.emit(this.tooltipOpen);\n }\n\n /**\n * Handle `ESC` and `shift+TAB` to close the submenu and move focus back to the button.\n */\n @Listen(\"keydown\")\n handleKeyDown(event: KeyboardEvent): void {\n if (!this.open || this.hasNestedOpenTools) {\n return;\n }\n\n switch (event.key) {\n case KeyboardCode.ESC:\n event.stopPropagation();\n this.open = false;\n this.setFocus();\n break;\n case KeyboardCode.TAB:\n if (event.shiftKey && (event.target as Element).closest(\"z-tool:not(:scope)\") === this.hostElement) {\n this.open = false;\n }\n break;\n }\n }\n\n /**\n * Close the popover on clicks outside the component, only if there are no nested open tools.\n * In that case any outside click should close the nested submenu(s) first.\n */\n @Listen(\"click\", {target: \"body\"})\n onOutsideClick(event: MouseEvent): void {\n const target = event.composedPath()[0] as HTMLElement;\n if (!this.open || containsElement(this.hostElement, target) || this.hasNestedOpenTools) {\n return;\n }\n\n this.open = false;\n }\n\n @Listen(\"toggleSubmenu\")\n onNestedToolToggle(ev: ZToolCustomEvent<boolean>): void {\n if (ev.target === this.hostElement) {\n return;\n }\n\n if (ev.detail === true) {\n this.hasNestedOpenTools = true;\n\n return;\n }\n\n this.hasNestedOpenTools = Array.from(this.hostElement.querySelectorAll(\"z-tool\")).some((tool) => tool.open);\n }\n\n /**\n * Handles the `colorSelected` event from a nested `z-color-picker` component.\n * Updates the `indicatorColor` and closes the tool's popover.\n */\n @Listen(\"colorSelected\")\n handleColorSelected(event: ZColorPickerCustomEvent<ColorPickerPalette>): void {\n if (!Array.from(this.hostElement.children).includes(event.target as Element)) {\n return;\n }\n\n this.indicatorColor = event.detail;\n this.open = false;\n this.setFocus();\n }\n\n /**\n * Close the submenu when focus moves outside the tool.\n */\n @Listen(\"focusin\", {target: \"body\", passive: true})\n handleExternalFocusin(ev: FocusEvent): void {\n const target = ev.target as Node;\n if (!containsElement(this.hostElement, target)) {\n this.open = false;\n }\n }\n\n /** Focuses the tool's button element. */\n @Method()\n async setFocus(): Promise<void> {\n if (this.disabled) {\n return;\n }\n\n setTimeout(() => {\n this.buttonRef?.focus();\n }, 50);\n }\n\n /** Sets the tab index of the tool's internal button element. */\n @Method()\n async setTabIndex(value: number): Promise<void> {\n if (!this.buttonRef) {\n return;\n }\n\n this.buttonRef.tabIndex = this.disabled ? -1 : value;\n }\n\n /** Closes the tooltip. */\n @Method()\n async closeTooltip(): Promise<void> {\n clearTimeout(this.hoverDelay);\n this.tooltipOpen = false;\n }\n\n componentWillLoad(): void {\n this.hasSlottedContent = this.hostElement.children.length > 0;\n this.isNested = !!this.hostElement.closest(\"z-tool:not(:scope)\");\n this.mainToolbar = this.hostElement.closest(\"z-toolbar:not(z-toolbar z-toolbar)\");\n this.hasNestedOpenTools = !!this.hostElement.querySelector(\"z-tool[open]\");\n\n this.mql = matchMedia(\"(max-width: 767px)\");\n this.onMobileViewChange = (e: MediaQueryListEvent) => (this.isMobile = e.matches);\n this.mql.addEventListener(\"change\", this.onMobileViewChange);\n this.isMobile = this.mql.matches;\n }\n\n disconnectedCallback(): void {\n clearTimeout(this.hoverDelay);\n this.mql?.removeEventListener(\"change\", this.onMobileViewChange);\n }\n\n render(): HTMLZToolElement {\n return (\n <Host class={{\"z-tool-tooltip-open\": this.tooltipOpen}}>\n <button\n class=\"z-tool\"\n type=\"button\"\n ref={(el) => (this.buttonRef = el)}\n aria-pressed={this.hasSlottedContent ? undefined : this.active ? \"true\" : \"false\"}\n aria-expanded={this.hasSlottedContent ? (this.open ? \"true\" : \"false\") : undefined}\n aria-haspopup={this.hasSlottedContent ? \"true\" : undefined}\n aria-label={this.htmlAriaLabel || this.tooltip || undefined}\n disabled={this.disabled}\n onClick={this.handleClick}\n onMouseEnter={this.handleTooltipOpen}\n onMouseLeave={this.handleTooltipClose}\n onFocus={this.handleTooltipOpen}\n onBlur={this.handleTooltipClose}\n >\n <z-icon\n ref={(el) => (this.iconRef = el)}\n name={this.icon}\n indicatorColor={this.indicatorColor}\n ></z-icon>\n </button>\n {this.tooltip && (\n <z-tooltip\n class=\"z-tool-tooltip\"\n ref={(el) => (this.tooltipRef = el)}\n bindTo={this.iconRef}\n open={this.tooltipOpen && !this.open}\n position={this.isNested ? PopoverPosition.BOTTOM : this.tooltipPosition}\n dark\n onMouseLeave={this.handleTooltipClose}\n onBlur={this.handleTooltipClose}\n onOpenChange={this.onTooltipOpenChange}\n >\n <span class=\"body-4\">{this.tooltip}</span>\n </z-tooltip>\n )}\n {this.hasSlottedContent && (\n <z-popover\n class=\"z-tool-submenu\"\n open={this.open}\n bindTo={this.isMobile && this.mainToolbar ? this.mainToolbar : this.hostElement}\n center\n /* disable auto-close to prevent unwanted close behaviors on mobile,\n when the bound element is the main toolbar */\n closable={false}\n position={this.isMobile ? PopoverPosition.TOP : PopoverPosition.BOTTOM}\n >\n <slot></slot>\n </z-popover>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"6PAAA,MAAMA,EAAY,IAAM,gkDCAxB,MAAMC,EAAgB,IAAM,k8X,MC4BfC,EAAKC,EAAA,MAAAD,UAAAE,EALlB,WAAAC,CAAAC,G,4JAkBEC,KAAAC,gBAAmCC,EAAgBC,IAQnDH,KAAAI,OAAS,MAITJ,KAAAK,SAAW,MAIXL,KAAAM,KAAO,MAcPN,KAAAO,YAAc,MAGdP,KAAAQ,kBAAoB,MAGpBR,KAAAS,SAAW,MAIXT,KAAAU,mBAAqB,MAmBbV,KAAAW,SAAW,MAcXX,KAAAY,kBAAqBC,IAC3B,IAAKb,KAAKc,SAAWd,KAAKM,OAASN,KAAKe,UAAUC,SAASH,EAAGI,QAAiB,CAC7E,M,CAGFC,aAAalB,KAAKmB,YAClBnB,KAAKmB,WAAaC,YAAW,KAC3BpB,KAAKO,YAAc,IAAI,GACtB,IAAK,EAMFP,KAAAqB,mBAAsBR,I,MAC5B,IAAKb,KAAKc,WAAWQ,EAACT,EAAGU,iBAA6B,MAAAD,SAAA,SAAAA,EAAEE,QAAQ,gBAAiBxB,KAAKyB,WAAY,CAChG,M,CAGFP,aAAalB,KAAKmB,YAClBnB,KAAKO,YAAc,KAAK,EAQlBP,KAAA0B,YAAc,KACpB,GAAI1B,KAAKK,WAAaL,KAAKQ,kBAAmB,CAC5C,M,CAGFR,KAAKM,MAAQN,KAAKM,KAClB,GAAIN,KAAKM,KAAM,CACb,MAAMqB,EAAc3B,KAAK4B,YAAYC,cAAc,2BACnD,GAAIF,EAAa,CACfA,EAAYG,WAEZ,M,CAIF,MAAMC,EAAkC/B,KAAK4B,YAAYC,cACvD,qDACG7B,KAAK4B,YAAYC,cAAc,4CAEpCE,IAA8B,MAA9BA,SAA8B,SAA9BA,EAAgCD,U,GAO5B9B,KAAAgC,oBAAuBC,IAC7B,GAAKA,EAAMhB,SAA2BjB,KAAKyB,WAAY,CACrD,M,CAGFzB,KAAKO,YAAc0B,EAAMC,OAAO5B,IAAI,CAiMvC,CA7LC,gBAAA6B,GACEnC,KAAKoC,cAAcC,KAAKrC,KAAKM,K,CAI/B,uBAAAgC,GACEtC,KAAKuC,cAAcF,KAAKrC,KAAKO,Y,CAO/B,aAAAiC,CAAcP,GACZ,IAAKjC,KAAKM,MAAQN,KAAKU,mBAAoB,CACzC,M,CAGF,OAAQuB,EAAMQ,KACZ,KAAKC,EAAaC,IAChBV,EAAMW,kBACN5C,KAAKM,KAAO,MACZN,KAAK8B,WACL,MACF,KAAKY,EAAaG,IAChB,GAAIZ,EAAMa,UAAab,EAAMhB,OAAmBO,QAAQ,wBAA0BxB,KAAK4B,YAAa,CAClG5B,KAAKM,KAAO,K,CAEd,M,CASN,cAAAyC,CAAed,GACb,MAAMhB,EAASgB,EAAMe,eAAe,GACpC,IAAKhD,KAAKM,MAAQ2C,EAAgBjD,KAAK4B,YAAaX,IAAWjB,KAAKU,mBAAoB,CACtF,M,CAGFV,KAAKM,KAAO,K,CAId,kBAAA4C,CAAmBrC,GACjB,GAAIA,EAAGI,SAAWjB,KAAK4B,YAAa,CAClC,M,CAGF,GAAIf,EAAGqB,SAAW,KAAM,CACtBlC,KAAKU,mBAAqB,KAE1B,M,CAGFV,KAAKU,mBAAqByC,MAAMC,KAAKpD,KAAK4B,YAAYyB,iBAAiB,WAAWC,MAAMC,GAASA,EAAKjD,M,CAQxG,mBAAAkD,CAAoBvB,GAClB,IAAKkB,MAAMC,KAAKpD,KAAK4B,YAAY6B,UAAUC,SAASzB,EAAMhB,QAAoB,CAC5E,M,CAGFjB,KAAK2D,eAAiB1B,EAAMC,OAC5BlC,KAAKM,KAAO,MACZN,KAAK8B,U,CAOP,qBAAA8B,CAAsB/C,GACpB,MAAMI,EAASJ,EAAGI,OAClB,IAAKgC,EAAgBjD,KAAK4B,YAAaX,GAAS,CAC9CjB,KAAKM,KAAO,K,EAMhB,cAAMwB,GACJ,GAAI9B,KAAKK,SAAU,CACjB,M,CAGFe,YAAW,K,OACTE,EAAAtB,KAAKe,aAAS,MAAAO,SAAA,SAAAA,EAAEuC,OAAO,GACtB,G,CAKL,iBAAMC,CAAYC,GAChB,IAAK/D,KAAKe,UAAW,CACnB,M,CAGFf,KAAKe,UAAUiD,SAAWhE,KAAKK,UAAW,EAAK0D,C,CAKjD,kBAAME,GACJ/C,aAAalB,KAAKmB,YAClBnB,KAAKO,YAAc,K,CAGrB,iBAAA2D,GACElE,KAAKQ,kBAAoBR,KAAK4B,YAAY6B,SAASU,OAAS,EAC5DnE,KAAKW,WAAaX,KAAK4B,YAAYJ,QAAQ,sBAC3CxB,KAAKoE,YAAcpE,KAAK4B,YAAYJ,QAAQ,sCAC5CxB,KAAKU,qBAAuBV,KAAK4B,YAAYC,cAAc,gBAE3D7B,KAAKqE,IAAMC,WAAW,sBACtBtE,KAAKuE,mBAAsBC,GAA4BxE,KAAKS,SAAW+D,EAAEC,QACzEzE,KAAKqE,IAAIK,iBAAiB,SAAU1E,KAAKuE,oBACzCvE,KAAKS,SAAWT,KAAKqE,IAAII,O,CAG3B,oBAAAE,G,MACEzD,aAAalB,KAAKmB,aAClBG,EAAAtB,KAAKqE,OAAG,MAAA/C,SAAA,SAAAA,EAAEsD,oBAAoB,SAAU5E,KAAKuE,mB,CAG/C,MAAAM,GACE,OACEC,EAACC,EAAI,CAAAtC,IAAA,2CAACuC,MAAO,CAAC,sBAAuBhF,KAAKO,cACxCuE,EAAA,UAAArC,IAAA,2CACEuC,MAAM,SACNC,KAAK,SACLC,IAAMC,GAAQnF,KAAKe,UAAYoE,EAAG,eACpBnF,KAAKQ,kBAAoB4E,UAAYpF,KAAKI,OAAS,OAAS,QAAO,gBAClEJ,KAAKQ,kBAAqBR,KAAKM,KAAO,OAAS,QAAW8E,UAAS,gBACnEpF,KAAKQ,kBAAoB,OAAS4E,UAAS,aAC9CpF,KAAKqF,eAAiBrF,KAAKc,SAAWsE,UAClD/E,SAAUL,KAAKK,SACfiF,QAAStF,KAAK0B,YACd6D,aAAcvF,KAAKY,kBACnB4E,aAAcxF,KAAKqB,mBACnBoE,QAASzF,KAAKY,kBACd8E,OAAQ1F,KAAKqB,oBAEbyD,EAAA,UAAArC,IAAA,2CACEyC,IAAMC,GAAQnF,KAAK2F,QAAUR,EAC7BS,KAAM5F,KAAK6F,KACXlC,eAAgB3D,KAAK2D,kBAGxB3D,KAAKc,SACJgE,EAAA,aAAArC,IAAA,2CACEuC,MAAM,iBACNE,IAAMC,GAAQnF,KAAKyB,WAAa0D,EAChCW,OAAQ9F,KAAK2F,QACbrF,KAAMN,KAAKO,cAAgBP,KAAKM,KAChCyF,SAAU/F,KAAKW,SAAWT,EAAgB8F,OAAShG,KAAKC,gBACxDgG,KAAI,KACJT,aAAcxF,KAAKqB,mBACnBqE,OAAQ1F,KAAKqB,mBACb6E,aAAclG,KAAKgC,qBAEnB8C,EAAA,QAAArC,IAAA,2CAAMuC,MAAM,UAAUhF,KAAKc,UAG9Bd,KAAKQ,mBACJsE,EAAA,aAAArC,IAAA,2CACEuC,MAAM,iBACN1E,KAAMN,KAAKM,KACXwF,OAAQ9F,KAAKS,UAAYT,KAAKoE,YAAcpE,KAAKoE,YAAcpE,KAAK4B,YACpEuE,OAAM,KAGNC,SAAU,MACVL,SAAU/F,KAAKS,SAAWP,EAAgBC,IAAMD,EAAgB8F,QAEhElB,EAAA,QAAArC,IAAA,8C","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as o,Host as s,transformTag as i}from"@stencil/core/internal/client";import{g as r}from"./index2.js";const a=()=>`:host,*{box-sizing:border-box}:host{display:flex;width:fit-content;align-items:center;padding:0;border:var(--border-size-small) solid var(--color-surface03);background-color:var(--color-surface01);border-radius:calc(var(--border-radius) + var(--border-size-small));box-shadow:var(--shadow-4);gap:calc(var(--space-unit) / 2)}::slotted(z-divider){height:calc(var(--space-unit) * 4.5) !important}@media (max-width: 767px){:host{--z-toolbar-columns:6;position:relative;display:grid;max-width:100%;background:repeating-linear-gradient( to bottom, transparent 0, transparent calc(var(--space-unit) * 5.5), var(--color-surface03) calc(var(--space-unit) * 5.5), var(--color-surface03) calc(var(--space-unit) * 5.5 + 1px) ) center / calc(100% - var(--space-unit)) 100% no-repeat var(--color-surface01);gap:var(--border-size-small) calc(var(--space-unit) / 2);grid-template-columns:repeat(var(--z-toolbar-columns, auto-fill), minmax(44px, auto))}::slotted(z-divider){display:none !important}}`;const n=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.currentFocusIndex=0;this.toolItems=[]}componentDidLoad(){this.collectToolItems();this.updateTabIndexes();let t=parseInt(getComputedStyle(this.hostElement).getPropertyValue("--z-toolbar-columns")||"6");t=this.toolItems.length<=t?this.toolItems.length:t;this.hostElement.style.setProperty("--z-toolbar-columns",t.toString())}collectToolItems(){this.toolItems=Array.from(this.hostElement.querySelectorAll("z-tool:not(:scope z-tool z-tool)"))}updateTabIndexes(){this.toolItems.forEach(((t,e)=>{t.setTabIndex(e===this.currentFocusIndex?0:-1)}))}focusToolAt(t,e="next"){const o=this.toolItems[t];if(!o){return}this.currentFocusIndex=t;if(!o.disabled){o.setFocus();this.updateTabIndexes();return}if(e==="next"){this.focusNextTool()}else{this.focusPreviousTool()}}focusNextTool(){const t=(this.currentFocusIndex+1)%this.toolItems.length;this.focusToolAt(t)}focusPreviousTool(){const t=(this.currentFocusIndex-1+this.toolItems.length)%this.toolItems.length;this.focusToolAt(t,"previous")}closeSiblingSubmenusOnOpen(t){if(t.detail!==true){return}const e=t.target.closest("z-tool");if(!e||!this.toolItems.includes(e)){return}this.toolItems.forEach((t=>{if(t!==e&&t.open){t.open=false}}))}closeSiblingTooltipsOnOpen(t){if(t.detail!==true){return}const e=t.target;if(!this.toolItems.includes(e)){return}this.toolItems.forEach((t=>{if(t!==e){t.closeTooltip()}}))}handleKeyDown(t){const e=t.target;const o=e.closest("z-tool");if(!o||!this.toolItems.includes(o)){return}const s=this.toolItems.indexOf(o);if(s!==-1){this.currentFocusIndex=s}switch(t.key){case r.ARROW_RIGHT:t.preventDefault();this.focusNextTool();break;case r.ARROW_LEFT:t.preventDefault();this.focusPreviousTool();break}}handleFocusIn(t){const e=t.target;const o=e.closest("z-tool");const s=this.toolItems.indexOf(o);if(s!==-1&&s!==this.currentFocusIndex){this.currentFocusIndex=s;this.updateTabIndexes()}}render(){return o(s,{key:"f4a79655dc3f8e4423b20683c6b3860e5007f0ee",role:"toolbar","aria-label":this.htmlAriaLabel},o("slot",{key:"d044d14607037c8e6c9977faf383c16ee6bddb8a",onSlotchange:()=>{this.collectToolItems();this.updateTabIndexes()}}))}get hostElement(){return this}static get style(){return a()}},[257,"z-toolbar",{htmlAriaLabel:[1,"html-aria-label"],currentFocusIndex:[32]},[[0,"toggleSubmenu","closeSiblingSubmenusOnOpen"],[0,"toggleTooltip","closeSiblingTooltipsOnOpen"],[0,"keydown","handleKeyDown"],[0,"focusin","handleFocusIn"]]]);function l(){if(typeof customElements==="undefined"){return}const t=["z-toolbar"];t.forEach((t=>{switch(t){case"z-toolbar":if(!customElements.get(i(t))){customElements.define(i(t),n)}break}}))}const c=n;const h=l;export{c as ZToolbar,h as defineCustomElement};
1
+ import{p as t,H as s,h as o,d as e,t as i}from"./p-RmbDDbWd.js";import{g as r}from"./p-DdetsoIY.js";const a=()=>`:host,*{box-sizing:border-box}:host{display:flex;width:fit-content;align-items:center;padding:0;border:var(--border-size-small) solid var(--color-surface03);background-color:var(--color-surface01);border-radius:calc(var(--border-radius) + var(--border-size-small));box-shadow:var(--shadow-4);gap:calc(var(--space-unit) / 2)}::slotted(z-divider){height:calc(var(--space-unit) * 4.5) !important}@media (max-width: 767px){:host{--z-toolbar-columns:6;position:relative;display:grid;max-width:100%;background:repeating-linear-gradient( to bottom, transparent 0, transparent calc(var(--space-unit) * 5.5), var(--color-surface03) calc(var(--space-unit) * 5.5), var(--color-surface03) calc(var(--space-unit) * 5.5 + 1px) ) center / calc(100% - var(--space-unit)) 100% no-repeat var(--color-surface01);gap:var(--border-size-small) calc(var(--space-unit) / 2);grid-template-columns:repeat(var(--z-toolbar-columns, auto-fill), minmax(44px, auto))}::slotted(z-divider){display:none !important}}`;const n=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.currentFocusIndex=0;this.toolItems=[]}componentDidLoad(){this.collectToolItems();this.updateTabIndexes();let t=parseInt(getComputedStyle(this.hostElement).getPropertyValue("--z-toolbar-columns")||"6");t=this.toolItems.length<=t?this.toolItems.length:t;this.hostElement.style.setProperty("--z-toolbar-columns",t.toString())}collectToolItems(){this.toolItems=Array.from(this.hostElement.querySelectorAll("z-tool:not(:scope z-tool z-tool)"))}updateTabIndexes(){this.toolItems.forEach(((t,s)=>{t.setTabIndex(s===this.currentFocusIndex?0:-1)}))}focusToolAt(t,s="next"){const o=this.toolItems[t];if(!o){return}this.currentFocusIndex=t;if(!o.disabled){o.setFocus();this.updateTabIndexes();return}if(s==="next"){this.focusNextTool()}else{this.focusPreviousTool()}}focusNextTool(){const t=(this.currentFocusIndex+1)%this.toolItems.length;this.focusToolAt(t)}focusPreviousTool(){const t=(this.currentFocusIndex-1+this.toolItems.length)%this.toolItems.length;this.focusToolAt(t,"previous")}closeSiblingSubmenusOnOpen(t){if(t.detail!==true){return}const s=t.target.closest("z-tool");if(!s||!this.toolItems.includes(s)){return}this.toolItems.forEach((t=>{if(t!==s&&t.open){t.open=false}}))}closeSiblingTooltipsOnOpen(t){if(t.detail!==true){return}const s=t.target;if(!this.toolItems.includes(s)){return}this.toolItems.forEach((t=>{if(t!==s){t.closeTooltip()}}))}handleKeyDown(t){const s=t.target;const o=s.closest("z-tool");if(!o||!this.toolItems.includes(o)){return}const e=this.toolItems.indexOf(o);if(e!==-1){this.currentFocusIndex=e}switch(t.key){case r.ARROW_RIGHT:t.preventDefault();this.focusNextTool();break;case r.ARROW_LEFT:t.preventDefault();this.focusPreviousTool();break}}handleFocusIn(t){const s=t.target;const o=s.closest("z-tool");const e=this.toolItems.indexOf(o);if(e!==-1&&e!==this.currentFocusIndex){this.currentFocusIndex=e;this.updateTabIndexes()}}render(){return o(e,{key:"f4a79655dc3f8e4423b20683c6b3860e5007f0ee",role:"toolbar","aria-label":this.htmlAriaLabel},o("slot",{key:"d044d14607037c8e6c9977faf383c16ee6bddb8a",onSlotchange:()=>{this.collectToolItems();this.updateTabIndexes()}}))}get hostElement(){return this}static get style(){return a()}},[257,"z-toolbar",{htmlAriaLabel:[1,"html-aria-label"],currentFocusIndex:[32]},[[0,"toggleSubmenu","closeSiblingSubmenusOnOpen"],[0,"toggleTooltip","closeSiblingTooltipsOnOpen"],[0,"keydown","handleKeyDown"],[0,"focusin","handleFocusIn"]]]);function l(){if(typeof customElements==="undefined"){return}const t=["z-toolbar"];t.forEach((t=>{switch(t){case"z-toolbar":if(!customElements.get(i(t))){customElements.define(i(t),n)}break}}))}const c=n;const h=l;export{c as ZToolbar,h as defineCustomElement};
2
2
  //# sourceMappingURL=z-toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stylesCss","ZToolbar","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","currentFocusIndex","toolItems","componentDidLoad","collectToolItems","updateTabIndexes","mobileColumnCount","parseInt","getComputedStyle","hostElement","getPropertyValue","length","style","setProperty","toString","Array","from","querySelectorAll","forEach","tool","index","setTabIndex","focusToolAt","fallback","disabled","setFocus","focusNextTool","focusPreviousTool","nextIndex","prevIndex","closeSiblingSubmenusOnOpen","event","detail","targetTool","target","closest","includes","open","closeSiblingTooltipsOnOpen","closeTooltip","handleKeyDown","toolElement","focusedIndex","indexOf","key","KeyboardCode","ARROW_RIGHT","preventDefault","ARROW_LEFT","handleFocusIn","render","h","Host","role","htmlAriaLabel","onSlotchange"],"sources":["src/components/z-toolbar/styles.css?tag=z-toolbar&encapsulation=shadow","src/components/z-toolbar/index.tsx"],"sourcesContent":[":host,\n* {\n box-sizing: border-box;\n}\n\n:host {\n /**\n * @prop --z-toolbar-columns: Number of items per row in the toolbar. Only applies on mobile viewport, when the toolbar can be displayed in a multi-row layout. Default: `6`.\n */\n\n display: flex;\n width: fit-content;\n align-items: center;\n padding: 0;\n border: var(--border-size-small) solid var(--color-surface03);\n background-color: var(--color-surface01);\n border-radius: calc(var(--border-radius) + var(--border-size-small)); /* ensure correct radius for nested items */\n box-shadow: var(--shadow-4);\n gap: calc(var(--space-unit) / 2);\n}\n\n::slotted(z-divider) {\n height: calc(var(--space-unit) * 4.5) !important;\n}\n\n@media (max-width: 767px) {\n :host {\n --z-toolbar-columns: 6;\n\n position: relative;\n display: grid;\n max-width: 100%;\n\n /* Draws a horizontal separator line between rows */\n background: repeating-linear-gradient(\n to bottom,\n transparent 0,\n transparent calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5 + 1px)\n )\n center / calc(100% - var(--space-unit)) 100% no-repeat var(--color-surface01);\n gap: var(--border-size-small) calc(var(--space-unit) / 2);\n grid-template-columns: repeat(var(--z-toolbar-columns, auto-fill), minmax(44px, auto));\n }\n\n ::slotted(z-divider) {\n display: none !important;\n }\n}\n","import {Component, ComponentInterface, Element, Host, Listen, Prop, State, h} from \"@stencil/core\";\nimport {KeyboardCode} from \"../../beans\";\nimport {ZToolCustomEvent} from \"../../components\";\n\n/**\n * ZToolbar component. This component mainly serves as a container for `z-tool` elements, but can also be nested inside a `z-tool` to create submenus.\n * Implements WCAG toolbar pattern with roving tabindex keyboard navigation.\n * Tools can be visually grouped using `z-divider` elements as separators.\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/\n *\n */\n@Component({\n tag: \"z-toolbar\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZToolbar implements ComponentInterface {\n @Element() hostElement: HTMLZToolbarElement;\n\n /** Accessible label for the toolbar. */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Index of the currently focusable item (roving tabindex). */\n @State()\n currentFocusIndex = 0;\n\n /** List of focusable tool elements. */\n private toolItems: HTMLZToolElement[] = [];\n\n componentDidLoad(): void {\n this.collectToolItems();\n this.updateTabIndexes();\n // set css variable `--z-toolbar-columns` based on the number of tools in the toolbar, so that the background pattern can adapt to the number of rows\n let mobileColumnCount = parseInt(getComputedStyle(this.hostElement).getPropertyValue(\"--z-toolbar-columns\") || \"6\");\n mobileColumnCount = this.toolItems.length <= mobileColumnCount ? this.toolItems.length : mobileColumnCount;\n this.hostElement.style.setProperty(\"--z-toolbar-columns\", mobileColumnCount.toString());\n }\n\n /** Collect first level children `z-tool` elements in the toolbar (not nested ones). */\n private collectToolItems(): void {\n this.toolItems = Array.from(this.hostElement.querySelectorAll(\"z-tool:not(:scope z-tool z-tool)\"));\n }\n\n /**\n * Update the `tabindex` of all children tools based on the current focus index,\n * so that only the currently focusable tool is in the tab order (tabindex=\"0\") and all others are not focusable via keyboard (tabindex=\"-1\").\n */\n private updateTabIndexes(): void {\n this.toolItems.forEach((tool, index) => {\n tool.setTabIndex(index === this.currentFocusIndex ? 0 : -1);\n });\n }\n\n private focusToolAt(index: number, fallback: \"previous\" | \"next\" = \"next\"): void {\n const tool = this.toolItems[index];\n if (!tool) {\n return;\n }\n\n this.currentFocusIndex = index;\n if (!tool.disabled) {\n tool.setFocus();\n this.updateTabIndexes();\n\n return;\n }\n\n if (fallback === \"next\") {\n this.focusNextTool();\n } else {\n this.focusPreviousTool();\n }\n }\n\n private focusNextTool(): void {\n const nextIndex = (this.currentFocusIndex + 1) % this.toolItems.length;\n this.focusToolAt(nextIndex);\n }\n\n private focusPreviousTool(): void {\n const prevIndex = (this.currentFocusIndex - 1 + this.toolItems.length) % this.toolItems.length;\n this.focusToolAt(prevIndex, \"previous\");\n }\n\n /**\n * Listen for custom \"toggleSubmenu\" events from child tools and close sibling submenus when one is opened,\n * to prevent multiple submenus from being open at the same time.\n */\n @Listen(\"toggleSubmenu\")\n closeSiblingSubmenusOnOpen(event: ZToolCustomEvent<boolean>): void {\n if (event.detail !== true) {\n return;\n }\n\n const targetTool = (event.target as HTMLElement).closest(\"z-tool\") as HTMLZToolElement | null;\n if (!targetTool || !this.toolItems.includes(targetTool)) {\n return;\n }\n\n this.toolItems.forEach((tool) => {\n if (tool !== targetTool && tool.open) {\n tool.open = false;\n }\n });\n }\n\n /**\n * Listen for custom \"toggleTooltip\" events from child tools and close sibling tooltips when one is opened,\n * to prevent multiple tooltips from being open at the same time.\n */\n @Listen(\"toggleTooltip\")\n closeSiblingTooltipsOnOpen(event: ZToolCustomEvent<boolean>): void {\n if (event.detail !== true) {\n return;\n }\n\n const targetTool = event.target;\n if (!this.toolItems.includes(targetTool)) {\n return;\n }\n\n this.toolItems.forEach((tool) => {\n if (tool !== targetTool) {\n tool.closeTooltip();\n }\n });\n }\n\n @Listen(\"keydown\")\n handleKeyDown(event: KeyboardEvent): void {\n const target = event.target as HTMLElement;\n const toolElement = target.closest(\"z-tool\") as HTMLZToolElement;\n\n if (!toolElement || !this.toolItems.includes(toolElement)) {\n return;\n }\n\n const focusedIndex = this.toolItems.indexOf(toolElement);\n if (focusedIndex !== -1) {\n this.currentFocusIndex = focusedIndex;\n }\n\n switch (event.key) {\n case KeyboardCode.ARROW_RIGHT:\n event.preventDefault();\n this.focusNextTool();\n break;\n case KeyboardCode.ARROW_LEFT:\n event.preventDefault();\n this.focusPreviousTool();\n break;\n }\n }\n\n /**\n * When focus enters the toolbar, update the current focus index to match the focused tool,\n * so that roving tabindex is in sync with actual focus.\n */\n @Listen(\"focusin\")\n handleFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement;\n const toolElement = target.closest(\"z-tool\") as HTMLZToolElement;\n const index = this.toolItems.indexOf(toolElement);\n if (index !== -1 && index !== this.currentFocusIndex) {\n this.currentFocusIndex = index;\n this.updateTabIndexes();\n }\n }\n\n render(): HTMLZToolbarElement {\n return (\n <Host\n role=\"toolbar\"\n aria-label={this.htmlAriaLabel}\n >\n <slot\n onSlotchange={() => {\n this.collectToolItems();\n this.updateTabIndexes();\n }}\n ></slot>\n </Host>\n );\n }\n}\n"],"mappings":"uJAAA,MAAMA,EAAY,IAAM,6gC,MCgBXC,EAAQC,EAAA,MAAAD,UAAAE,EALrB,WAAAC,CAAAC,G,kEAcEC,KAAAC,kBAAoB,EAGZD,KAAAE,UAAgC,EA6JzC,CA3JC,gBAAAC,GACEH,KAAKI,mBACLJ,KAAKK,mBAEL,IAAIC,EAAoBC,SAASC,iBAAiBR,KAAKS,aAAaC,iBAAiB,wBAA0B,KAC/GJ,EAAoBN,KAAKE,UAAUS,QAAUL,EAAoBN,KAAKE,UAAUS,OAASL,EACzFN,KAAKS,YAAYG,MAAMC,YAAY,sBAAuBP,EAAkBQ,W,CAItE,gBAAAV,GACNJ,KAAKE,UAAYa,MAAMC,KAAKhB,KAAKS,YAAYQ,iBAAiB,oC,CAOxD,gBAAAZ,GACNL,KAAKE,UAAUgB,SAAQ,CAACC,EAAMC,KAC5BD,EAAKE,YAAYD,IAAUpB,KAAKC,kBAAoB,GAAI,EAAG,G,CAIvD,WAAAqB,CAAYF,EAAeG,EAAgC,QACjE,MAAMJ,EAAOnB,KAAKE,UAAUkB,GAC5B,IAAKD,EAAM,CACT,M,CAGFnB,KAAKC,kBAAoBmB,EACzB,IAAKD,EAAKK,SAAU,CAClBL,EAAKM,WACLzB,KAAKK,mBAEL,M,CAGF,GAAIkB,IAAa,OAAQ,CACvBvB,KAAK0B,e,KACA,CACL1B,KAAK2B,mB,EAID,aAAAD,GACN,MAAME,GAAa5B,KAAKC,kBAAoB,GAAKD,KAAKE,UAAUS,OAChEX,KAAKsB,YAAYM,E,CAGX,iBAAAD,GACN,MAAME,GAAa7B,KAAKC,kBAAoB,EAAID,KAAKE,UAAUS,QAAUX,KAAKE,UAAUS,OACxFX,KAAKsB,YAAYO,EAAW,W,CAQ9B,0BAAAC,CAA2BC,GACzB,GAAIA,EAAMC,SAAW,KAAM,CACzB,M,CAGF,MAAMC,EAAcF,EAAMG,OAAuBC,QAAQ,UACzD,IAAKF,IAAejC,KAAKE,UAAUkC,SAASH,GAAa,CACvD,M,CAGFjC,KAAKE,UAAUgB,SAASC,IACtB,GAAIA,IAASc,GAAcd,EAAKkB,KAAM,CACpClB,EAAKkB,KAAO,K,KAUlB,0BAAAC,CAA2BP,GACzB,GAAIA,EAAMC,SAAW,KAAM,CACzB,M,CAGF,MAAMC,EAAaF,EAAMG,OACzB,IAAKlC,KAAKE,UAAUkC,SAASH,GAAa,CACxC,M,CAGFjC,KAAKE,UAAUgB,SAASC,IACtB,GAAIA,IAASc,EAAY,CACvBd,EAAKoB,c,KAMX,aAAAC,CAAcT,GACZ,MAAMG,EAASH,EAAMG,OACrB,MAAMO,EAAcP,EAAOC,QAAQ,UAEnC,IAAKM,IAAgBzC,KAAKE,UAAUkC,SAASK,GAAc,CACzD,M,CAGF,MAAMC,EAAe1C,KAAKE,UAAUyC,QAAQF,GAC5C,GAAIC,KAAiB,EAAI,CACvB1C,KAAKC,kBAAoByC,C,CAG3B,OAAQX,EAAMa,KACZ,KAAKC,EAAaC,YAChBf,EAAMgB,iBACN/C,KAAK0B,gBACL,MACF,KAAKmB,EAAaG,WAChBjB,EAAMgB,iBACN/C,KAAK2B,oBACL,M,CASN,aAAAsB,CAAclB,GACZ,MAAMG,EAASH,EAAMG,OACrB,MAAMO,EAAcP,EAAOC,QAAQ,UACnC,MAAMf,EAAQpB,KAAKE,UAAUyC,QAAQF,GACrC,GAAIrB,KAAU,GAAMA,IAAUpB,KAAKC,kBAAmB,CACpDD,KAAKC,kBAAoBmB,EACzBpB,KAAKK,kB,EAIT,MAAA6C,GACE,OACEC,EAACC,EAAI,CAAAR,IAAA,2CACHS,KAAK,UAAS,aACFrD,KAAKsD,eAEjBH,EAAA,QAAAP,IAAA,2CACEW,aAAc,KACZvD,KAAKI,mBACLJ,KAAKK,kBAAkB,I","ignoreList":[]}
1
+ {"version":3,"names":["stylesCss","ZToolbar","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","currentFocusIndex","toolItems","componentDidLoad","collectToolItems","updateTabIndexes","mobileColumnCount","parseInt","getComputedStyle","hostElement","getPropertyValue","length","style","setProperty","toString","Array","from","querySelectorAll","forEach","tool","index","setTabIndex","focusToolAt","fallback","disabled","setFocus","focusNextTool","focusPreviousTool","nextIndex","prevIndex","closeSiblingSubmenusOnOpen","event","detail","targetTool","target","closest","includes","open","closeSiblingTooltipsOnOpen","closeTooltip","handleKeyDown","toolElement","focusedIndex","indexOf","key","KeyboardCode","ARROW_RIGHT","preventDefault","ARROW_LEFT","handleFocusIn","render","h","Host","role","htmlAriaLabel","onSlotchange"],"sources":["src/components/z-toolbar/styles.css?tag=z-toolbar&encapsulation=shadow","src/components/z-toolbar/index.tsx"],"sourcesContent":[":host,\n* {\n box-sizing: border-box;\n}\n\n:host {\n /**\n * @prop --z-toolbar-columns: Number of items per row in the toolbar. Only applies on mobile viewport, when the toolbar can be displayed in a multi-row layout. Default: `6`.\n */\n\n display: flex;\n width: fit-content;\n align-items: center;\n padding: 0;\n border: var(--border-size-small) solid var(--color-surface03);\n background-color: var(--color-surface01);\n border-radius: calc(var(--border-radius) + var(--border-size-small)); /* ensure correct radius for nested items */\n box-shadow: var(--shadow-4);\n gap: calc(var(--space-unit) / 2);\n}\n\n::slotted(z-divider) {\n height: calc(var(--space-unit) * 4.5) !important;\n}\n\n@media (max-width: 767px) {\n :host {\n --z-toolbar-columns: 6;\n\n position: relative;\n display: grid;\n max-width: 100%;\n\n /* Draws a horizontal separator line between rows */\n background: repeating-linear-gradient(\n to bottom,\n transparent 0,\n transparent calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5 + 1px)\n )\n center / calc(100% - var(--space-unit)) 100% no-repeat var(--color-surface01);\n gap: var(--border-size-small) calc(var(--space-unit) / 2);\n grid-template-columns: repeat(var(--z-toolbar-columns, auto-fill), minmax(44px, auto));\n }\n\n ::slotted(z-divider) {\n display: none !important;\n }\n}\n","import {Component, ComponentInterface, Element, Host, Listen, Prop, State, h} from \"@stencil/core\";\nimport {KeyboardCode} from \"../../beans\";\nimport {ZToolCustomEvent} from \"../../components\";\n\n/**\n * ZToolbar component. This component mainly serves as a container for `z-tool` elements, but can also be nested inside a `z-tool` to create submenus.\n * Implements WCAG toolbar pattern with roving tabindex keyboard navigation.\n * Tools can be visually grouped using `z-divider` elements as separators.\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/\n *\n */\n@Component({\n tag: \"z-toolbar\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZToolbar implements ComponentInterface {\n @Element() hostElement: HTMLZToolbarElement;\n\n /** Accessible label for the toolbar. */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Index of the currently focusable item (roving tabindex). */\n @State()\n currentFocusIndex = 0;\n\n /** List of focusable tool elements. */\n private toolItems: HTMLZToolElement[] = [];\n\n componentDidLoad(): void {\n this.collectToolItems();\n this.updateTabIndexes();\n // set css variable `--z-toolbar-columns` based on the number of tools in the toolbar, so that the background pattern can adapt to the number of rows\n let mobileColumnCount = parseInt(getComputedStyle(this.hostElement).getPropertyValue(\"--z-toolbar-columns\") || \"6\");\n mobileColumnCount = this.toolItems.length <= mobileColumnCount ? this.toolItems.length : mobileColumnCount;\n this.hostElement.style.setProperty(\"--z-toolbar-columns\", mobileColumnCount.toString());\n }\n\n /** Collect first level children `z-tool` elements in the toolbar (not nested ones). */\n private collectToolItems(): void {\n this.toolItems = Array.from(this.hostElement.querySelectorAll(\"z-tool:not(:scope z-tool z-tool)\"));\n }\n\n /**\n * Update the `tabindex` of all children tools based on the current focus index,\n * so that only the currently focusable tool is in the tab order (tabindex=\"0\") and all others are not focusable via keyboard (tabindex=\"-1\").\n */\n private updateTabIndexes(): void {\n this.toolItems.forEach((tool, index) => {\n tool.setTabIndex(index === this.currentFocusIndex ? 0 : -1);\n });\n }\n\n private focusToolAt(index: number, fallback: \"previous\" | \"next\" = \"next\"): void {\n const tool = this.toolItems[index];\n if (!tool) {\n return;\n }\n\n this.currentFocusIndex = index;\n if (!tool.disabled) {\n tool.setFocus();\n this.updateTabIndexes();\n\n return;\n }\n\n if (fallback === \"next\") {\n this.focusNextTool();\n } else {\n this.focusPreviousTool();\n }\n }\n\n private focusNextTool(): void {\n const nextIndex = (this.currentFocusIndex + 1) % this.toolItems.length;\n this.focusToolAt(nextIndex);\n }\n\n private focusPreviousTool(): void {\n const prevIndex = (this.currentFocusIndex - 1 + this.toolItems.length) % this.toolItems.length;\n this.focusToolAt(prevIndex, \"previous\");\n }\n\n /**\n * Listen for custom \"toggleSubmenu\" events from child tools and close sibling submenus when one is opened,\n * to prevent multiple submenus from being open at the same time.\n */\n @Listen(\"toggleSubmenu\")\n closeSiblingSubmenusOnOpen(event: ZToolCustomEvent<boolean>): void {\n if (event.detail !== true) {\n return;\n }\n\n const targetTool = (event.target as HTMLElement).closest(\"z-tool\") as HTMLZToolElement | null;\n if (!targetTool || !this.toolItems.includes(targetTool)) {\n return;\n }\n\n this.toolItems.forEach((tool) => {\n if (tool !== targetTool && tool.open) {\n tool.open = false;\n }\n });\n }\n\n /**\n * Listen for custom \"toggleTooltip\" events from child tools and close sibling tooltips when one is opened,\n * to prevent multiple tooltips from being open at the same time.\n */\n @Listen(\"toggleTooltip\")\n closeSiblingTooltipsOnOpen(event: ZToolCustomEvent<boolean>): void {\n if (event.detail !== true) {\n return;\n }\n\n const targetTool = event.target;\n if (!this.toolItems.includes(targetTool)) {\n return;\n }\n\n this.toolItems.forEach((tool) => {\n if (tool !== targetTool) {\n tool.closeTooltip();\n }\n });\n }\n\n @Listen(\"keydown\")\n handleKeyDown(event: KeyboardEvent): void {\n const target = event.target as HTMLElement;\n const toolElement = target.closest(\"z-tool\") as HTMLZToolElement;\n\n if (!toolElement || !this.toolItems.includes(toolElement)) {\n return;\n }\n\n const focusedIndex = this.toolItems.indexOf(toolElement);\n if (focusedIndex !== -1) {\n this.currentFocusIndex = focusedIndex;\n }\n\n switch (event.key) {\n case KeyboardCode.ARROW_RIGHT:\n event.preventDefault();\n this.focusNextTool();\n break;\n case KeyboardCode.ARROW_LEFT:\n event.preventDefault();\n this.focusPreviousTool();\n break;\n }\n }\n\n /**\n * When focus enters the toolbar, update the current focus index to match the focused tool,\n * so that roving tabindex is in sync with actual focus.\n */\n @Listen(\"focusin\")\n handleFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement;\n const toolElement = target.closest(\"z-tool\") as HTMLZToolElement;\n const index = this.toolItems.indexOf(toolElement);\n if (index !== -1 && index !== this.currentFocusIndex) {\n this.currentFocusIndex = index;\n this.updateTabIndexes();\n }\n }\n\n render(): HTMLZToolbarElement {\n return (\n <Host\n role=\"toolbar\"\n aria-label={this.htmlAriaLabel}\n >\n <slot\n onSlotchange={() => {\n this.collectToolItems();\n this.updateTabIndexes();\n }}\n ></slot>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAY,IAAM,6gC,MCgBXC,EAAQC,EAAA,MAAAD,UAAAE,EALrB,WAAAC,CAAAC,G,kEAcEC,KAAAC,kBAAoB,EAGZD,KAAAE,UAAgC,EA6JzC,CA3JC,gBAAAC,GACEH,KAAKI,mBACLJ,KAAKK,mBAEL,IAAIC,EAAoBC,SAASC,iBAAiBR,KAAKS,aAAaC,iBAAiB,wBAA0B,KAC/GJ,EAAoBN,KAAKE,UAAUS,QAAUL,EAAoBN,KAAKE,UAAUS,OAASL,EACzFN,KAAKS,YAAYG,MAAMC,YAAY,sBAAuBP,EAAkBQ,W,CAItE,gBAAAV,GACNJ,KAAKE,UAAYa,MAAMC,KAAKhB,KAAKS,YAAYQ,iBAAiB,oC,CAOxD,gBAAAZ,GACNL,KAAKE,UAAUgB,SAAQ,CAACC,EAAMC,KAC5BD,EAAKE,YAAYD,IAAUpB,KAAKC,kBAAoB,GAAI,EAAG,G,CAIvD,WAAAqB,CAAYF,EAAeG,EAAgC,QACjE,MAAMJ,EAAOnB,KAAKE,UAAUkB,GAC5B,IAAKD,EAAM,CACT,M,CAGFnB,KAAKC,kBAAoBmB,EACzB,IAAKD,EAAKK,SAAU,CAClBL,EAAKM,WACLzB,KAAKK,mBAEL,M,CAGF,GAAIkB,IAAa,OAAQ,CACvBvB,KAAK0B,e,KACA,CACL1B,KAAK2B,mB,EAID,aAAAD,GACN,MAAME,GAAa5B,KAAKC,kBAAoB,GAAKD,KAAKE,UAAUS,OAChEX,KAAKsB,YAAYM,E,CAGX,iBAAAD,GACN,MAAME,GAAa7B,KAAKC,kBAAoB,EAAID,KAAKE,UAAUS,QAAUX,KAAKE,UAAUS,OACxFX,KAAKsB,YAAYO,EAAW,W,CAQ9B,0BAAAC,CAA2BC,GACzB,GAAIA,EAAMC,SAAW,KAAM,CACzB,M,CAGF,MAAMC,EAAcF,EAAMG,OAAuBC,QAAQ,UACzD,IAAKF,IAAejC,KAAKE,UAAUkC,SAASH,GAAa,CACvD,M,CAGFjC,KAAKE,UAAUgB,SAASC,IACtB,GAAIA,IAASc,GAAcd,EAAKkB,KAAM,CACpClB,EAAKkB,KAAO,K,KAUlB,0BAAAC,CAA2BP,GACzB,GAAIA,EAAMC,SAAW,KAAM,CACzB,M,CAGF,MAAMC,EAAaF,EAAMG,OACzB,IAAKlC,KAAKE,UAAUkC,SAASH,GAAa,CACxC,M,CAGFjC,KAAKE,UAAUgB,SAASC,IACtB,GAAIA,IAASc,EAAY,CACvBd,EAAKoB,c,KAMX,aAAAC,CAAcT,GACZ,MAAMG,EAASH,EAAMG,OACrB,MAAMO,EAAcP,EAAOC,QAAQ,UAEnC,IAAKM,IAAgBzC,KAAKE,UAAUkC,SAASK,GAAc,CACzD,M,CAGF,MAAMC,EAAe1C,KAAKE,UAAUyC,QAAQF,GAC5C,GAAIC,KAAiB,EAAI,CACvB1C,KAAKC,kBAAoByC,C,CAG3B,OAAQX,EAAMa,KACZ,KAAKC,EAAaC,YAChBf,EAAMgB,iBACN/C,KAAK0B,gBACL,MACF,KAAKmB,EAAaG,WAChBjB,EAAMgB,iBACN/C,KAAK2B,oBACL,M,CASN,aAAAsB,CAAclB,GACZ,MAAMG,EAASH,EAAMG,OACrB,MAAMO,EAAcP,EAAOC,QAAQ,UACnC,MAAMf,EAAQpB,KAAKE,UAAUyC,QAAQF,GACrC,GAAIrB,KAAU,GAAMA,IAAUpB,KAAKC,kBAAmB,CACpDD,KAAKC,kBAAoBmB,EACzBpB,KAAKK,kB,EAIT,MAAA6C,GACE,OACEC,EAACC,EAAI,CAAAR,IAAA,2CACHS,KAAK,UAAS,aACFrD,KAAKsD,eAEjBH,EAAA,QAAAP,IAAA,2CACEW,aAAc,KACZvD,KAAKI,mBACLJ,KAAKK,kBAAkB,I","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{Z as o,d as s}from"./index21.js";const t=o;const n=s;export{t as ZTooltip,n as defineCustomElement};
1
+ import{Z as o,d as s}from"./p-Ch6o4_VN.js";const t=o;const p=s;export{t as ZTooltip,p as defineCustomElement};
2
2
  //# sourceMappingURL=z-tooltip.js.map
@@ -1,2 +1,2 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as r,Host as a,transformTag as s}from"@stencil/core/internal/client";import{r as n}from"./utils.js";import"./index2.js";import{d as l}from"./index3.js";import"./index16.js";const d=()=>`:host{position:relative;display:grid;width:100%;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));--columns:1}*{box-sizing:border-box}:host([expandable]){--show-expandable-button:visible;cursor:pointer}:host([expandable]) ::slotted(*){grid-row:1}:host([expandable]) ::slotted(:nth-last-child(2)){border-right:none}:host([expandable]) ::slotted(*:last-child){border-top:var(--border-size-small) solid var(--color-surface03);border-left:0;grid-column:1 / span calc(var(--columns) + 1);grid-row:2}:host([expandable]:not([expanded])) ::slotted(*:last-child){display:none}:host([expanded]){margin-bottom:4px;box-shadow:0 4px 4px -2px var(--shadow-color-base)}:host([expanded]) .z-tr--expand-button-container,:host([expanded]) ::slotted(*){border-left:0 !important;background-color:var(--color-background)}:host([tabIndex]:hover) ::slotted(z-td),:host([tabIndex]:hover) ::slotted(z-th),:host([tabIndex]:hover) .z-tr--expand-button-container{background-color:var(--color-surface02)}:host([tabIndex]:hover) .z-tr--focus-overlay{border-top:var(--border-size-small) solid var(--color-surface04);border-bottom:var(--border-size-small) solid var(--color-surface04)}:host(:focus){position:relative;z-index:20;border:none !important;box-shadow:var(--shadow-focus-primary);outline:none}.z-tr--expand-button-container{display:flex;align-items:center;justify-content:center;background-color:var(--z-table--cells-background, var(--color-surface01))}.z-tr--expand-button-container button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:auto;appearance:none;background:transparent;cursor:pointer;visibility:var(--show-expandable-button, hidden)}.z-tr--expand-button-container button z-icon{--z-icon-width:16px;--z-icon-height:16px}.z-tr--focus-overlay{position:absolute;z-index:30;top:calc(var(--border-size-small) * -1);bottom:0;left:0;width:100%;height:calc(100% + (var(--border-size-small) * 2));box-shadow:none;outline:none;pointer-events:none;transition:box-shadow 0.2s}:host(:focus) .z-tr--focus-overlay{box-shadow:0 0 0 2px var(--shadow-focus-primary), var(--shadow-focus-primary);outline:none}:host(:focus) ::slotted(*){border-bottom:none}:host(:focus) .z-tr--expand-button-container{border-bottom:none}`;const i=()=>`z-table,table.z-table{background-color:var(--color-surface01);--z-table--cells-padding:calc(var(--space-unit) * 2)}table.z-table{border-collapse:collapse}z-thead,table.z-table thead{background-color:var(--color-background);--z-table--cells-bottom-border-size:var(--border-size-medium)}z-tfoot,table.z-table tfoot{border-top:var(--border-size-medium) solid var(--color-surface03);border-bottom:var(--border-size-medium) solid var(--color-surface03)}z-tfoot z-tr,table.z-table tfoot tr{border-bottom:calc(var(--z-table--cells-bottom-border-size)) solid var(--color-surface03) !important}z-tr,table.z-table tr{border-bottom:var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03)}z-td,z-th,table.z-table td,table.z-table th{padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2));text-align:left}z-th:not(:first-child),z-td:not(:first-child),table.z-table th:not(:first-child),table.z-table td:not(:first-child){border-left:var(--z-table--cell-left-border, none)}z-table[bordered],table.z-table.z-table-bordered{--z-table--cell-left-border:1px solid var(--color-surface03)}table.z-table-hover>tbody>tr:hover>td,table.z-table-hover>tfoot>tr:hover>td{position:relative;background-color:var(--color-surface02)}table.z-table-hover>tbody>tr:hover>td::after,table.z-table-hover>tfoot>tr:hover>td::after{position:absolute;z-index:1;top:0;right:0;bottom:0;left:-1px;box-shadow:inset 0 var(--border-size-small) 0 var(--color-surface04), inset 0 calc(var(--border-size-small) * -1) 0 var(--color-surface04);content:""}table.z-table-hover>tbody>tr:hover>td:first-child::after,table.z-table-hover>thead>tr:hover>th:first-child::after,table.z-table-hover>tfoot>tr:hover>td:first-child::after{left:0}`;const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.expand=o(this,"expand",7);this.expandable=false;this.expanded=false}updateColumns(){const t=Array.from(this.host.querySelectorAll("z-td, z-th"));if(this.expandable){const e=t.pop();e.id=e.id||`z-tr-expandable-content-${n()}`;this.expandableContentId=e.id}const e=t.map((t=>t.colspan||1)).reduce(((t,e)=>t+e),0);this.host.style.setProperty("--columns",`${e}`)}onRowClick(t){const e=t.target.closest(".prevent-expand");if(!this.expandable||e){return}this.expanded=!this.expanded;this.expand.emit({expanded:this.expanded})}onKeyDown(t){if(!this.expandable){return}const e=document.activeElement;if(e!==this.host){return}if(t.key==="Enter"||t.key===" "){t.preventDefault();this.expanded=!this.expanded;this.expand.emit({expanded:this.expanded})}}componentWillLoad(){this.updateColumns()}render(){return r(a,{key:"158f25d1746e340981e4facebe0f7dfd2106222a",role:"row",tabIndex:this.expandable?0:undefined,expanded:this.expanded,onClick:this.onRowClick.bind(this),onKeyDown:this.onKeyDown.bind(this)},r("div",{key:"140ddc0aac009e9e254b5ee281e292dc19326527",class:"z-tr--focus-overlay","aria-hidden":"true"}),r("div",{key:"8e5b3d3e72cfe09c1ee4f54ffab8805e0e83021c",class:"z-tr--expand-button-container"},this.expandable&&r("button",{key:"bd724740ff19d508d33527dbc657b932f73f4421",tabIndex:-1,"aria-expanded":this.expanded?"true":"false","aria-label":this.expanded?"Comprimi riga":"Espandi riga","aria-controls":this.expandableContentId,type:"button"},r("z-icon",{key:"d88a988e00c240b85806e9d0ea8d090cb404fab4",name:this.expanded?"minus-circled":"plus-circled"}))),r("slot",{key:"83cada789cfd416d9c2062ede5c10b49ac56ae56",onSlotchange:this.updateColumns.bind(this)}))}get host(){return this}static get watchers(){return{expandable:[{updateColumns:0}]}}static get style(){return d()+i()}},[257,"z-tr",{expandable:[516],expanded:[32],expandableContentId:[32]},[[0,"colspanchange","updateColumns"]],{expandable:[{updateColumns:0}]}]);function b(){if(typeof customElements==="undefined"){return}const t=["z-tr","z-icon"];t.forEach((t=>{switch(t){case"z-tr":if(!customElements.get(s(t))){customElements.define(s(t),c)}break;case"z-icon":if(!customElements.get(s(t))){l()}break}}))}const h=c;const u=b;export{h as ZTr,u as defineCustomElement};
1
+ import{p as t,H as e,c as o,h as r,d as a,t as s}from"./p-RmbDDbWd.js";import{r as n}from"./p-8C_CrFxp.js";import"./p-DdetsoIY.js";import{d as l}from"./p-CbXEdwLi.js";import"./p-D8wde41u.js";const d=()=>`:host{position:relative;display:grid;width:100%;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));--columns:1}*{box-sizing:border-box}:host([expandable]){--show-expandable-button:visible;cursor:pointer}:host([expandable]) ::slotted(*){grid-row:1}:host([expandable]) ::slotted(:nth-last-child(2)){border-right:none}:host([expandable]) ::slotted(*:last-child){border-top:var(--border-size-small) solid var(--color-surface03);border-left:0;grid-column:1 / span calc(var(--columns) + 1);grid-row:2}:host([expandable]:not([expanded])) ::slotted(*:last-child){display:none}:host([expanded]){margin-bottom:4px;box-shadow:0 4px 4px -2px var(--shadow-color-base)}:host([expanded]) .z-tr--expand-button-container,:host([expanded]) ::slotted(*){border-left:0 !important;background-color:var(--color-background)}:host([tabIndex]:hover) ::slotted(z-td),:host([tabIndex]:hover) ::slotted(z-th),:host([tabIndex]:hover) .z-tr--expand-button-container{background-color:var(--color-surface02)}:host([tabIndex]:hover) .z-tr--focus-overlay{border-top:var(--border-size-small) solid var(--color-surface04);border-bottom:var(--border-size-small) solid var(--color-surface04)}:host(:focus){position:relative;z-index:20;border:none !important;box-shadow:var(--shadow-focus-primary);outline:none}.z-tr--expand-button-container{display:flex;align-items:center;justify-content:center;background-color:var(--z-table--cells-background, var(--color-surface01))}.z-tr--expand-button-container button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:auto;appearance:none;background:transparent;cursor:pointer;visibility:var(--show-expandable-button, hidden)}.z-tr--expand-button-container button z-icon{--z-icon-width:16px;--z-icon-height:16px}.z-tr--focus-overlay{position:absolute;z-index:30;top:calc(var(--border-size-small) * -1);bottom:0;left:0;width:100%;height:calc(100% + (var(--border-size-small) * 2));box-shadow:none;outline:none;pointer-events:none;transition:box-shadow 0.2s}:host(:focus) .z-tr--focus-overlay{box-shadow:0 0 0 2px var(--shadow-focus-primary), var(--shadow-focus-primary);outline:none}:host(:focus) ::slotted(*){border-bottom:none}:host(:focus) .z-tr--expand-button-container{border-bottom:none}`;const i=()=>`z-table,table.z-table{background-color:var(--color-surface01);--z-table--cells-padding:calc(var(--space-unit) * 2)}table.z-table{border-collapse:collapse}z-thead,table.z-table thead{background-color:var(--color-background);--z-table--cells-bottom-border-size:var(--border-size-medium)}z-tfoot,table.z-table tfoot{border-top:var(--border-size-medium) solid var(--color-surface03);border-bottom:var(--border-size-medium) solid var(--color-surface03)}z-tfoot z-tr,table.z-table tfoot tr{border-bottom:calc(var(--z-table--cells-bottom-border-size)) solid var(--color-surface03) !important}z-tr,table.z-table tr{border-bottom:var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03)}z-td,z-th,table.z-table td,table.z-table th{padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2));text-align:left}z-th:not(:first-child),z-td:not(:first-child),table.z-table th:not(:first-child),table.z-table td:not(:first-child){border-left:var(--z-table--cell-left-border, none)}z-table[bordered],table.z-table.z-table-bordered{--z-table--cell-left-border:1px solid var(--color-surface03)}table.z-table-hover>tbody>tr:hover>td,table.z-table-hover>tfoot>tr:hover>td{position:relative;background-color:var(--color-surface02)}table.z-table-hover>tbody>tr:hover>td::after,table.z-table-hover>tfoot>tr:hover>td::after{position:absolute;z-index:1;top:0;right:0;bottom:0;left:-1px;box-shadow:inset 0 var(--border-size-small) 0 var(--color-surface04), inset 0 calc(var(--border-size-small) * -1) 0 var(--color-surface04);content:""}table.z-table-hover>tbody>tr:hover>td:first-child::after,table.z-table-hover>thead>tr:hover>th:first-child::after,table.z-table-hover>tfoot>tr:hover>td:first-child::after{left:0}`;const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.expand=o(this,"expand",7);this.expandable=false;this.expanded=false}updateColumns(){const t=Array.from(this.host.querySelectorAll("z-td, z-th"));if(this.expandable){const e=t.pop();e.id=e.id||`z-tr-expandable-content-${n()}`;this.expandableContentId=e.id}const e=t.map((t=>t.colspan||1)).reduce(((t,e)=>t+e),0);this.host.style.setProperty("--columns",`${e}`)}onRowClick(t){const e=t.target.closest(".prevent-expand");if(!this.expandable||e){return}this.expanded=!this.expanded;this.expand.emit({expanded:this.expanded})}onKeyDown(t){if(!this.expandable){return}const e=document.activeElement;if(e!==this.host){return}if(t.key==="Enter"||t.key===" "){t.preventDefault();this.expanded=!this.expanded;this.expand.emit({expanded:this.expanded})}}componentWillLoad(){this.updateColumns()}render(){return r(a,{key:"158f25d1746e340981e4facebe0f7dfd2106222a",role:"row",tabIndex:this.expandable?0:undefined,expanded:this.expanded,onClick:this.onRowClick.bind(this),onKeyDown:this.onKeyDown.bind(this)},r("div",{key:"140ddc0aac009e9e254b5ee281e292dc19326527",class:"z-tr--focus-overlay","aria-hidden":"true"}),r("div",{key:"8e5b3d3e72cfe09c1ee4f54ffab8805e0e83021c",class:"z-tr--expand-button-container"},this.expandable&&r("button",{key:"bd724740ff19d508d33527dbc657b932f73f4421",tabIndex:-1,"aria-expanded":this.expanded?"true":"false","aria-label":this.expanded?"Comprimi riga":"Espandi riga","aria-controls":this.expandableContentId,type:"button"},r("z-icon",{key:"d88a988e00c240b85806e9d0ea8d090cb404fab4",name:this.expanded?"minus-circled":"plus-circled"}))),r("slot",{key:"83cada789cfd416d9c2062ede5c10b49ac56ae56",onSlotchange:this.updateColumns.bind(this)}))}get host(){return this}static get watchers(){return{expandable:[{updateColumns:0}]}}static get style(){return d()+i()}},[257,"z-tr",{expandable:[516],expanded:[32],expandableContentId:[32]},[[0,"colspanchange","updateColumns"]],{expandable:[{updateColumns:0}]}]);function b(){if(typeof customElements==="undefined"){return}const t=["z-tr","z-icon"];t.forEach((t=>{switch(t){case"z-tr":if(!customElements.get(s(t))){customElements.define(s(t),c)}break;case"z-icon":if(!customElements.get(s(t))){l()}break}}))}const h=c;const p=b;export{h as ZTr,p as defineCustomElement};
2
2
  //# sourceMappingURL=z-tr.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stylesCss","ZTr","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","expandable","expanded","updateColumns","cells","Array","from","host","querySelectorAll","expandableContent","pop","id","randomId","expandableContentId","columns","map","cell","colspan","reduce","a","b","style","setProperty","onRowClick","event","preventExpand","target","closest","expand","emit","onKeyDown","active","document","activeElement","key","preventDefault","componentWillLoad","render","h","Host","role","tabIndex","undefined","onClick","bind","class","type","name","onSlotchange"],"sources":["src/components/deprecated/table/z-tr/styles.css?tag=z-tr&encapsulation=shadow","src/components/css-components/z-table/styles.css?tag=z-tr&encapsulation=shadow","src/components/deprecated/table/z-tr/index.tsx"],"sourcesContent":[":host {\n position: relative;\n display: grid;\n width: 100%;\n box-sizing: border-box;\n grid-auto-flow: column;\n grid-template-columns: var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));\n\n --columns: 1;\n}\n\n* {\n box-sizing: border-box;\n}\n\n:host([expandable]) {\n --show-expandable-button: visible;\n\n cursor: pointer;\n}\n\n:host([expandable]) ::slotted(*) {\n grid-row: 1;\n}\n\n:host([expandable]) ::slotted(:nth-last-child(2)) {\n border-right: none;\n}\n\n:host([expandable]) ::slotted(*:last-child) {\n border-top: var(--border-size-small) solid var(--color-surface03);\n border-left: 0;\n grid-column: 1 / span calc(var(--columns) + 1);\n grid-row: 2;\n}\n\n:host([expandable]:not([expanded])) ::slotted(*:last-child) {\n display: none;\n}\n\n:host([expanded]) {\n margin-bottom: 4px; /* prevents shadow to be cut by the next element */\n box-shadow: 0 4px 4px -2px var(--shadow-color-base);\n}\n\n:host([expanded]) .z-tr--expand-button-container,\n:host([expanded]) ::slotted(*) {\n border-left: 0 !important;\n background-color: var(--color-background);\n}\n\n:host([tabIndex]:hover) ::slotted(z-td),\n:host([tabIndex]:hover) ::slotted(z-th),\n:host([tabIndex]:hover) .z-tr--expand-button-container {\n background-color: var(--color-surface02);\n}\n\n:host([tabIndex]:hover) .z-tr--focus-overlay {\n border-top: var(--border-size-small) solid var(--color-surface04);\n border-bottom: var(--border-size-small) solid var(--color-surface04);\n}\n\n:host(:focus) {\n position: relative;\n z-index: 20;\n border: none !important;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-tr--expand-button-container {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--z-table--cells-background, var(--color-surface01));\n}\n\n.z-tr--expand-button-container button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: auto;\n appearance: none;\n background: transparent;\n cursor: pointer;\n visibility: var(--show-expandable-button, hidden);\n}\n\n.z-tr--expand-button-container button z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n.z-tr--focus-overlay {\n position: absolute;\n z-index: 30;\n top: calc(var(--border-size-small) * -1);\n bottom: 0;\n left: 0;\n width: 100%;\n height: calc(100% + (var(--border-size-small) * 2));\n box-shadow: none;\n outline: none;\n pointer-events: none;\n transition: box-shadow 0.2s;\n}\n\n:host(:focus) .z-tr--focus-overlay {\n box-shadow:\n 0 0 0 2px var(--shadow-focus-primary),\n var(--shadow-focus-primary);\n outline: none;\n}\n\n:host(:focus) ::slotted(*) {\n border-bottom: none;\n}\n\n:host(:focus) .z-tr--expand-button-container {\n border-bottom: none;\n}\n","z-table,\ntable.z-table {\n background-color: var(--color-surface01);\n\n --z-table--cells-padding: calc(var(--space-unit) * 2);\n}\n\ntable.z-table {\n border-collapse: collapse;\n}\n\nz-thead,\ntable.z-table thead {\n background-color: var(--color-background);\n\n --z-table--cells-bottom-border-size: var(--border-size-medium);\n}\n\nz-tfoot,\ntable.z-table tfoot {\n border-top: var(--border-size-medium) solid var(--color-surface03);\n border-bottom: var(--border-size-medium) solid var(--color-surface03);\n}\n\nz-tfoot z-tr,\ntable.z-table tfoot tr {\n border-bottom: calc(var(--z-table--cells-bottom-border-size)) solid var(--color-surface03) !important;\n}\n\nz-tr,\ntable.z-table tr {\n border-bottom: var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03);\n}\n\nz-td,\nz-th,\ntable.z-table td,\ntable.z-table th {\n padding: var(--z-table--cells-padding, calc(var(--space-unit) * 2));\n text-align: left;\n}\n\nz-th:not(:first-child),\nz-td:not(:first-child),\ntable.z-table th:not(:first-child),\ntable.z-table td:not(:first-child) {\n border-left: var(--z-table--cell-left-border, none);\n}\n\nz-table[bordered],\ntable.z-table.z-table-bordered {\n --z-table--cell-left-border: 1px solid var(--color-surface03);\n}\n\ntable.z-table-hover > tbody > tr:hover > td,\ntable.z-table-hover > tfoot > tr:hover > td {\n position: relative;\n background-color: var(--color-surface02);\n}\n\ntable.z-table-hover > tbody > tr:hover > td::after,\ntable.z-table-hover > tfoot > tr:hover > td::after {\n position: absolute;\n z-index: 1;\n top: 0;\n right: 0;\n bottom: 0;\n left: -1px;\n box-shadow:\n inset 0 var(--border-size-small) 0 var(--color-surface04),\n inset 0 calc(var(--border-size-small) * -1) 0 var(--color-surface04);\n content: \"\";\n}\n\ntable.z-table-hover > tbody > tr:hover > td:first-child::after,\ntable.z-table-hover > thead > tr:hover > th:first-child::after,\ntable.z-table-hover > tfoot > tr:hover > td:first-child::after {\n left: 0;\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {randomId} from \"../../../../utils/utils\";\nimport \"../cells/z-td/index\";\nimport \"../cells/z-th/index\";\n\n/**\n * ZTr component.\n * When the row is `expandable`, you can set the `prevent-expand` css class on an interactive element inside the row\n * to prevent the row from expanding.\n * @slot - ZTr content (`z-td` or `z-th`).\n */\n@Component({\n tag: \"z-tr\",\n styleUrls: [\"styles.css\", \"../../../css-components/z-table/styles.css\"],\n shadow: true,\n})\nexport class ZTr implements ComponentInterface {\n @Element() host: HTMLZTrElement;\n\n /**\n * Whether the row is expandable.\n * Use a `z-td` as the last cell of the row for the additional content.\n * It will show a button to expand/collapse the row.\n * The last cell will be hidden until the button or row is clicked.\n *\n * If some element inside the expandable row contains the `prevent-expand` css class,\n * the row will not expand by clicking that element.\n */\n @Prop({reflect: true})\n expandable = false;\n\n /**\n * Whether the row is currently expanded.\n */\n @State()\n expanded = false;\n\n /**\n * HTML Id of the expandable content.\n * It is used to link the button to the content through the `aria-controls` attribute.\n */\n @State()\n expandableContentId: string;\n\n /** Row has been expanded */\n @Event()\n expand: EventEmitter;\n\n @Watch(\"expandable\")\n @Listen(\"colspanchange\")\n protected updateColumns(): void {\n const cells = Array.from(this.host.querySelectorAll<HTMLZTdElement | HTMLZThElement>(\"z-td, z-th\"));\n\n if (this.expandable) {\n const expandableContent = cells.pop();\n expandableContent.id = expandableContent.id || `z-tr-expandable-content-${randomId()}`;\n this.expandableContentId = expandableContent.id;\n }\n\n const columns = cells.map((cell) => cell.colspan || 1).reduce((a, b) => a + b, 0);\n this.host.style.setProperty(\"--columns\", `${columns}`);\n }\n\n /**\n * Handle click on row.\n * Skip expansion if the click is on a element with `prevent-expand` css class.\n */\n private onRowClick(event: MouseEvent): void {\n const preventExpand = (event.target as HTMLElement).closest(\".prevent-expand\");\n if (!this.expandable || preventExpand) {\n return;\n }\n\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n if (!this.expandable) {\n return;\n }\n\n const active = document.activeElement;\n if (active !== this.host) {\n return;\n }\n\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n }\n\n componentWillLoad(): void {\n this.updateColumns();\n }\n\n render(): HTMLZTrElement {\n return (\n <Host\n role=\"row\"\n tabIndex={this.expandable ? 0 : undefined}\n expanded={this.expanded}\n onClick={this.onRowClick.bind(this)}\n onKeyDown={this.onKeyDown.bind(this)}\n >\n <div\n class=\"z-tr--focus-overlay\"\n aria-hidden=\"true\"\n ></div>\n <div class=\"z-tr--expand-button-container\">\n {this.expandable && (\n <button\n tabIndex={-1}\n aria-expanded={this.expanded ? \"true\" : \"false\"}\n aria-label={this.expanded ? \"Comprimi riga\" : \"Espandi riga\"}\n aria-controls={this.expandableContentId}\n type=\"button\"\n >\n <z-icon name={this.expanded ? \"minus-circled\" : \"plus-circled\"}></z-icon>\n </button>\n )}\n </div>\n <slot onSlotchange={this.updateColumns.bind(this)}></slot>\n </Host>\n );\n }\n}\n"],"mappings":"gPAAA,MAAMA,EAAY,IAAM,2xECAxB,MAAMA,EAAY,IAAM,6sD,MC4BXC,EAAGC,EAAA,MAAAD,UAAAE,EALhB,WAAAC,CAAAC,G,iGAkBEC,KAAAC,WAAa,MAMbD,KAAAE,SAAW,KA6FZ,CA9EW,aAAAC,GACR,MAAMC,EAAQC,MAAMC,KAAKN,KAAKO,KAAKC,iBAAkD,eAErF,GAAIR,KAAKC,WAAY,CACnB,MAAMQ,EAAoBL,EAAMM,MAChCD,EAAkBE,GAAKF,EAAkBE,IAAM,2BAA2BC,MAC1EZ,KAAKa,oBAAsBJ,EAAkBE,E,CAG/C,MAAMG,EAAUV,EAAMW,KAAKC,GAASA,EAAKC,SAAW,IAAGC,QAAO,CAACC,EAAGC,IAAMD,EAAIC,GAAG,GAC/EpB,KAAKO,KAAKc,MAAMC,YAAY,YAAa,GAAGR,I,CAOtC,UAAAS,CAAWC,GACjB,MAAMC,EAAiBD,EAAME,OAAuBC,QAAQ,mBAC5D,IAAK3B,KAAKC,YAAcwB,EAAe,CACrC,M,CAGFzB,KAAKE,UAAYF,KAAKE,SACtBF,KAAK4B,OAAOC,KAAK,CAAC3B,SAAUF,KAAKE,U,CAG3B,SAAA4B,CAAUN,GAChB,IAAKxB,KAAKC,WAAY,CACpB,M,CAGF,MAAM8B,EAASC,SAASC,cACxB,GAAIF,IAAW/B,KAAKO,KAAM,CACxB,M,CAGF,GAAIiB,EAAMU,MAAQ,SAAWV,EAAMU,MAAQ,IAAK,CAC9CV,EAAMW,iBACNnC,KAAKE,UAAYF,KAAKE,SACtBF,KAAK4B,OAAOC,KAAK,CAAC3B,SAAUF,KAAKE,U,EAIrC,iBAAAkC,GACEpC,KAAKG,e,CAGP,MAAAkC,GACE,OACEC,EAACC,EAAI,CAAAL,IAAA,2CACHM,KAAK,MACLC,SAAUzC,KAAKC,WAAa,EAAIyC,UAChCxC,SAAUF,KAAKE,SACfyC,QAAS3C,KAAKuB,WAAWqB,KAAK5C,MAC9B8B,UAAW9B,KAAK8B,UAAUc,KAAK5C,OAE/BsC,EAAA,OAAAJ,IAAA,2CACEW,MAAM,sBAAqB,cACf,SAEdP,EAAA,OAAAJ,IAAA,2CAAKW,MAAM,iCACR7C,KAAKC,YACJqC,EAAA,UAAAJ,IAAA,2CACEO,UAAU,EAAE,gBACGzC,KAAKE,SAAW,OAAS,QAAO,aACnCF,KAAKE,SAAW,gBAAkB,eAAc,gBAC7CF,KAAKa,oBACpBiC,KAAK,UAELR,EAAA,UAAAJ,IAAA,2CAAQa,KAAM/C,KAAKE,SAAW,gBAAkB,mBAItDoC,EAAA,QAAAJ,IAAA,2CAAMc,aAAchD,KAAKG,cAAcyC,KAAK5C,Q","ignoreList":[]}
1
+ {"version":3,"names":["stylesCss","ZTr","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","expandable","expanded","updateColumns","cells","Array","from","host","querySelectorAll","expandableContent","pop","id","randomId","expandableContentId","columns","map","cell","colspan","reduce","a","b","style","setProperty","onRowClick","event","preventExpand","target","closest","expand","emit","onKeyDown","active","document","activeElement","key","preventDefault","componentWillLoad","render","h","Host","role","tabIndex","undefined","onClick","bind","class","type","name","onSlotchange"],"sources":["src/components/deprecated/table/z-tr/styles.css?tag=z-tr&encapsulation=shadow","src/components/css-components/z-table/styles.css?tag=z-tr&encapsulation=shadow","src/components/deprecated/table/z-tr/index.tsx"],"sourcesContent":[":host {\n position: relative;\n display: grid;\n width: 100%;\n box-sizing: border-box;\n grid-auto-flow: column;\n grid-template-columns: var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));\n\n --columns: 1;\n}\n\n* {\n box-sizing: border-box;\n}\n\n:host([expandable]) {\n --show-expandable-button: visible;\n\n cursor: pointer;\n}\n\n:host([expandable]) ::slotted(*) {\n grid-row: 1;\n}\n\n:host([expandable]) ::slotted(:nth-last-child(2)) {\n border-right: none;\n}\n\n:host([expandable]) ::slotted(*:last-child) {\n border-top: var(--border-size-small) solid var(--color-surface03);\n border-left: 0;\n grid-column: 1 / span calc(var(--columns) + 1);\n grid-row: 2;\n}\n\n:host([expandable]:not([expanded])) ::slotted(*:last-child) {\n display: none;\n}\n\n:host([expanded]) {\n margin-bottom: 4px; /* prevents shadow to be cut by the next element */\n box-shadow: 0 4px 4px -2px var(--shadow-color-base);\n}\n\n:host([expanded]) .z-tr--expand-button-container,\n:host([expanded]) ::slotted(*) {\n border-left: 0 !important;\n background-color: var(--color-background);\n}\n\n:host([tabIndex]:hover) ::slotted(z-td),\n:host([tabIndex]:hover) ::slotted(z-th),\n:host([tabIndex]:hover) .z-tr--expand-button-container {\n background-color: var(--color-surface02);\n}\n\n:host([tabIndex]:hover) .z-tr--focus-overlay {\n border-top: var(--border-size-small) solid var(--color-surface04);\n border-bottom: var(--border-size-small) solid var(--color-surface04);\n}\n\n:host(:focus) {\n position: relative;\n z-index: 20;\n border: none !important;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-tr--expand-button-container {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--z-table--cells-background, var(--color-surface01));\n}\n\n.z-tr--expand-button-container button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: auto;\n appearance: none;\n background: transparent;\n cursor: pointer;\n visibility: var(--show-expandable-button, hidden);\n}\n\n.z-tr--expand-button-container button z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n.z-tr--focus-overlay {\n position: absolute;\n z-index: 30;\n top: calc(var(--border-size-small) * -1);\n bottom: 0;\n left: 0;\n width: 100%;\n height: calc(100% + (var(--border-size-small) * 2));\n box-shadow: none;\n outline: none;\n pointer-events: none;\n transition: box-shadow 0.2s;\n}\n\n:host(:focus) .z-tr--focus-overlay {\n box-shadow:\n 0 0 0 2px var(--shadow-focus-primary),\n var(--shadow-focus-primary);\n outline: none;\n}\n\n:host(:focus) ::slotted(*) {\n border-bottom: none;\n}\n\n:host(:focus) .z-tr--expand-button-container {\n border-bottom: none;\n}\n","z-table,\ntable.z-table {\n background-color: var(--color-surface01);\n\n --z-table--cells-padding: calc(var(--space-unit) * 2);\n}\n\ntable.z-table {\n border-collapse: collapse;\n}\n\nz-thead,\ntable.z-table thead {\n background-color: var(--color-background);\n\n --z-table--cells-bottom-border-size: var(--border-size-medium);\n}\n\nz-tfoot,\ntable.z-table tfoot {\n border-top: var(--border-size-medium) solid var(--color-surface03);\n border-bottom: var(--border-size-medium) solid var(--color-surface03);\n}\n\nz-tfoot z-tr,\ntable.z-table tfoot tr {\n border-bottom: calc(var(--z-table--cells-bottom-border-size)) solid var(--color-surface03) !important;\n}\n\nz-tr,\ntable.z-table tr {\n border-bottom: var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03);\n}\n\nz-td,\nz-th,\ntable.z-table td,\ntable.z-table th {\n padding: var(--z-table--cells-padding, calc(var(--space-unit) * 2));\n text-align: left;\n}\n\nz-th:not(:first-child),\nz-td:not(:first-child),\ntable.z-table th:not(:first-child),\ntable.z-table td:not(:first-child) {\n border-left: var(--z-table--cell-left-border, none);\n}\n\nz-table[bordered],\ntable.z-table.z-table-bordered {\n --z-table--cell-left-border: 1px solid var(--color-surface03);\n}\n\ntable.z-table-hover > tbody > tr:hover > td,\ntable.z-table-hover > tfoot > tr:hover > td {\n position: relative;\n background-color: var(--color-surface02);\n}\n\ntable.z-table-hover > tbody > tr:hover > td::after,\ntable.z-table-hover > tfoot > tr:hover > td::after {\n position: absolute;\n z-index: 1;\n top: 0;\n right: 0;\n bottom: 0;\n left: -1px;\n box-shadow:\n inset 0 var(--border-size-small) 0 var(--color-surface04),\n inset 0 calc(var(--border-size-small) * -1) 0 var(--color-surface04);\n content: \"\";\n}\n\ntable.z-table-hover > tbody > tr:hover > td:first-child::after,\ntable.z-table-hover > thead > tr:hover > th:first-child::after,\ntable.z-table-hover > tfoot > tr:hover > td:first-child::after {\n left: 0;\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {randomId} from \"../../../../utils/utils\";\nimport \"../cells/z-td/index\";\nimport \"../cells/z-th/index\";\n\n/**\n * ZTr component.\n * When the row is `expandable`, you can set the `prevent-expand` css class on an interactive element inside the row\n * to prevent the row from expanding.\n * @slot - ZTr content (`z-td` or `z-th`).\n */\n@Component({\n tag: \"z-tr\",\n styleUrls: [\"styles.css\", \"../../../css-components/z-table/styles.css\"],\n shadow: true,\n})\nexport class ZTr implements ComponentInterface {\n @Element() host: HTMLZTrElement;\n\n /**\n * Whether the row is expandable.\n * Use a `z-td` as the last cell of the row for the additional content.\n * It will show a button to expand/collapse the row.\n * The last cell will be hidden until the button or row is clicked.\n *\n * If some element inside the expandable row contains the `prevent-expand` css class,\n * the row will not expand by clicking that element.\n */\n @Prop({reflect: true})\n expandable = false;\n\n /**\n * Whether the row is currently expanded.\n */\n @State()\n expanded = false;\n\n /**\n * HTML Id of the expandable content.\n * It is used to link the button to the content through the `aria-controls` attribute.\n */\n @State()\n expandableContentId: string;\n\n /** Row has been expanded */\n @Event()\n expand: EventEmitter;\n\n @Watch(\"expandable\")\n @Listen(\"colspanchange\")\n protected updateColumns(): void {\n const cells = Array.from(this.host.querySelectorAll<HTMLZTdElement | HTMLZThElement>(\"z-td, z-th\"));\n\n if (this.expandable) {\n const expandableContent = cells.pop();\n expandableContent.id = expandableContent.id || `z-tr-expandable-content-${randomId()}`;\n this.expandableContentId = expandableContent.id;\n }\n\n const columns = cells.map((cell) => cell.colspan || 1).reduce((a, b) => a + b, 0);\n this.host.style.setProperty(\"--columns\", `${columns}`);\n }\n\n /**\n * Handle click on row.\n * Skip expansion if the click is on a element with `prevent-expand` css class.\n */\n private onRowClick(event: MouseEvent): void {\n const preventExpand = (event.target as HTMLElement).closest(\".prevent-expand\");\n if (!this.expandable || preventExpand) {\n return;\n }\n\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n if (!this.expandable) {\n return;\n }\n\n const active = document.activeElement;\n if (active !== this.host) {\n return;\n }\n\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n }\n\n componentWillLoad(): void {\n this.updateColumns();\n }\n\n render(): HTMLZTrElement {\n return (\n <Host\n role=\"row\"\n tabIndex={this.expandable ? 0 : undefined}\n expanded={this.expanded}\n onClick={this.onRowClick.bind(this)}\n onKeyDown={this.onKeyDown.bind(this)}\n >\n <div\n class=\"z-tr--focus-overlay\"\n aria-hidden=\"true\"\n ></div>\n <div class=\"z-tr--expand-button-container\">\n {this.expandable && (\n <button\n tabIndex={-1}\n aria-expanded={this.expanded ? \"true\" : \"false\"}\n aria-label={this.expanded ? \"Comprimi riga\" : \"Espandi riga\"}\n aria-controls={this.expandableContentId}\n type=\"button\"\n >\n <z-icon name={this.expanded ? \"minus-circled\" : \"plus-circled\"}></z-icon>\n </button>\n )}\n </div>\n <slot onSlotchange={this.updateColumns.bind(this)}></slot>\n </Host>\n );\n }\n}\n"],"mappings":"+LAAA,MAAMA,EAAY,IAAM,2xECAxB,MAAMA,EAAY,IAAM,6sD,MC4BXC,EAAGC,EAAA,MAAAD,UAAAE,EALhB,WAAAC,CAAAC,G,iGAkBEC,KAAAC,WAAa,MAMbD,KAAAE,SAAW,KA6FZ,CA9EW,aAAAC,GACR,MAAMC,EAAQC,MAAMC,KAAKN,KAAKO,KAAKC,iBAAkD,eAErF,GAAIR,KAAKC,WAAY,CACnB,MAAMQ,EAAoBL,EAAMM,MAChCD,EAAkBE,GAAKF,EAAkBE,IAAM,2BAA2BC,MAC1EZ,KAAKa,oBAAsBJ,EAAkBE,E,CAG/C,MAAMG,EAAUV,EAAMW,KAAKC,GAASA,EAAKC,SAAW,IAAGC,QAAO,CAACC,EAAGC,IAAMD,EAAIC,GAAG,GAC/EpB,KAAKO,KAAKc,MAAMC,YAAY,YAAa,GAAGR,I,CAOtC,UAAAS,CAAWC,GACjB,MAAMC,EAAiBD,EAAME,OAAuBC,QAAQ,mBAC5D,IAAK3B,KAAKC,YAAcwB,EAAe,CACrC,M,CAGFzB,KAAKE,UAAYF,KAAKE,SACtBF,KAAK4B,OAAOC,KAAK,CAAC3B,SAAUF,KAAKE,U,CAG3B,SAAA4B,CAAUN,GAChB,IAAKxB,KAAKC,WAAY,CACpB,M,CAGF,MAAM8B,EAASC,SAASC,cACxB,GAAIF,IAAW/B,KAAKO,KAAM,CACxB,M,CAGF,GAAIiB,EAAMU,MAAQ,SAAWV,EAAMU,MAAQ,IAAK,CAC9CV,EAAMW,iBACNnC,KAAKE,UAAYF,KAAKE,SACtBF,KAAK4B,OAAOC,KAAK,CAAC3B,SAAUF,KAAKE,U,EAIrC,iBAAAkC,GACEpC,KAAKG,e,CAGP,MAAAkC,GACE,OACEC,EAACC,EAAI,CAAAL,IAAA,2CACHM,KAAK,MACLC,SAAUzC,KAAKC,WAAa,EAAIyC,UAChCxC,SAAUF,KAAKE,SACfyC,QAAS3C,KAAKuB,WAAWqB,KAAK5C,MAC9B8B,UAAW9B,KAAK8B,UAAUc,KAAK5C,OAE/BsC,EAAA,OAAAJ,IAAA,2CACEW,MAAM,sBAAqB,cACf,SAEdP,EAAA,OAAAJ,IAAA,2CAAKW,MAAM,iCACR7C,KAAKC,YACJqC,EAAA,UAAAJ,IAAA,2CACEO,UAAU,EAAE,gBACGzC,KAAKE,SAAW,OAAS,QAAO,aACnCF,KAAKE,SAAW,gBAAkB,eAAc,gBAC7CF,KAAKa,oBACpBiC,KAAK,UAELR,EAAA,UAAAJ,IAAA,2CAAQa,KAAM/C,KAAKE,SAAW,gBAAkB,mBAItDoC,EAAA,QAAAJ,IAAA,2CAAMc,aAAchD,KAAKG,cAAcyC,KAAK5C,Q","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as l,Host as n,transformTag as s}from"@stencil/core/internal/client";import{g as r}from"./index2.js";import{d as o}from"./index5.js";import{d as a}from"./index3.js";import{d}from"./index8.js";import{d as c}from"./index9.js";const m=()=>`:host{font-family:var(--font-family-sans)}z-list-element{position:relative;display:block;padding-top:var(--space-unit)}z-list-element::before,z-list-element::after{position:absolute;z-index:100;top:0.125rem;left:-0.5rem;content:""}z-list z-list-element::before{width:var(--space-unit);height:calc(var(--space-unit) * 2);border-bottom:var(--border-size-small) solid var(--color-disabled01-icon);border-left:var(--border-size-small) solid var(--color-disabled01-icon)}z-list z-list-element::after{width:var(--space-unit);height:100%;border-left:var(--border-size-small) solid var(--color-disabled01-icon)}z-list z-list-element:last-child::after,z-list>z-list-element::before,z-list>z-list-element::after,z-list>z-list-group>z-list-element::before,z-list>z-list-group>z-list-element::after{display:none}z-list>div.children-node{padding-left:calc(var(--space-unit) * 2)}z-list-element>.list-element{z-index:100;display:flex;justify-content:space-between;padding:0;color:var(--color-default-text);font-size:var(--font-size-2);font-style:normal;font-weight:var(--font-rg);text-decoration:none}z-list-element>.list-element.link-clickable{color:var(--color-primary01)}z-list-element>.list-element.link-clickable:hover{text-decoration:underline}z-list-element>.list-element .item.ellipsis{overflow:hidden}z-list-element .list-element::after{position:absolute;top:0;right:-0.0625rem;display:block;width:100%;height:calc(var(--space-unit) * 5);content:"";transform:translateX(-100%)}.item-label{overflow:hidden;flex-grow:1;font-size:var(--font-size-2);font-style:normal;font-weight:var(--font-rg);letter-spacing:0.0032rem;line-height:1.25rem;text-overflow:ellipsis;white-space:nowrap}.item-label.bold-item{font-weight:var(--font-sb)}.item.ellipsis{display:flex;overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap}.children-node>z-list-element{padding:0;padding-top:0.125;padding-left:calc(var(--space-unit) * 1.25)}.item-icon{margin-right:var(--space-unit)}.no-icon-label{padding-left:var(--space-unit)}.children-node>z-list-element.no-icon-elm{padding-left:0}z-list-element>.list-element:focus:focus-visible{position:relative;z-index:200;box-shadow:var(--shadow-focus-primary);outline:none}@media (max-width: 767px){z-list-element::before,z-list-element::after{top:0.1875rem}z-list z-list-element::before{height:calc(var(--space-unit) * 2.5)}.children-node>z-list-element{padding-top:var(--space-unit)}}`;const f=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.treeItemClicked=i(this,"treeItemClicked",7);this.items=[];this.parsedItems=[]}watchItems(){this.parsedItems=typeof this.items==="string"?JSON.parse(this.items):this.items}componentWillLoad(){this.watchItems()}handleClick(e){this.treeItemClicked.emit({id:e.id,name:e.name,url:e.url})}getFocusableElements(){return Array.from(this.host.shadowRoot.querySelectorAll('a[tabindex="0"]'))}getAncestor(e,t){let i=e;for(let e=0;e<t;e++){i=i===null||i===void 0?void 0:i.parentElement;if(!i){return}}return i}handleArrowNav(e){if(e.code===r.TAB){e.preventDefault();return}const t=this.getFocusableElements();const i=t.indexOf(e.target);if(i===-1){return}if(e.code===r.ARROW_DOWN||e.code===r.ARROW_UP){e.preventDefault();const l=i+(e.code===r.ARROW_DOWN?1:-1);if(l<0||l>=t.length){return}t[l].focus()}if(e.code===r.ARROW_LEFT){e.preventDefault();const l=this.getAncestor(t[i],4);if(!l||!l.children[0]||l.children[0].tagName.toLowerCase()!=="a"&&l.getAttribute("tabindex")===null){return}l.children[0].focus()}if(e.code===r.ARROW_RIGHT){e.preventDefault();const t=e.target.closest("z-list-element");if(!t){return}const i=t.querySelector("z-list");if(!i){return}const l=i.querySelector('a[tabindex="0"]');if(!l){return}l.focus()}}renderTreeList(e,t,i=1){var n,s;this.htmlTag=e.url?"a":"span";const o=l("z-list-element",{id:t,class:!e.icon?"no-icon-elm":"",clickable:Boolean(e.url),hasTreeItems:true,role:"none","aria-hidden":undefined},l(this.htmlTag,{class:{"list-element":true,"z-link":Boolean(e.url),"link-clickable":Boolean(e.url)},tabIndex:e.url?0:-1,onClick:()=>this.handleClick(e),onKeyUp:t=>{if(t.code===r.ENTER||t.code===r.SPACE){this.handleClick(e)}},onKeyDown:e=>this.handleArrowNav(e),role:e.url?"treeitem":undefined,"aria-hidden":e.url?undefined:"true","aria-expanded":((n=e.children)===null||n===void 0?void 0:n.length)>0&&true,"aria-level":i,"aria-label":e.name,href:e.url},l("span",{class:"item ellipsis"},e.icon&&l("z-icon",{width:16,height:16,fill:e.url?"color-primary01":"color-default-icon",class:"item-icon",name:e.icon}),l("span",{class:{"item-label":true,"no-icon-label":!e.icon,"bold-item":e.bold},title:e.name},e.name))),((s=e.children)===null||s===void 0?void 0:s.length)>0&&l("z-list",{role:"group"},l("div",{class:"children-node"},e.children.map(((e,t)=>this.renderTreeList(e,`${t}`,i+1))))));return o}render(){const e=this.parsedItems.some((e=>!!e.url));return l(n,{key:"d4f93f20f84ac193c4b291b0cc16d4a0e6838d49",class:"tree-list",role:e?"navigation":"none","aria-hidden":e?undefined:"true","aria-labelledby":this.htmlAriaLabelledby},l("div",{key:"4d0f11bb82855843beabb2eb0ddaa30ca39d8524",tabIndex:-1,role:e?"tree":"none","aria-hidden":e?undefined:"true","aria-label":this.htmlSectionTitle},this.parsedItems.map(((e,t)=>this.renderTreeList(e,`${t}`)))))}get host(){return this}static get watchers(){return{items:[{watchItems:0}]}}static get style(){return m()}},[1,"z-tree-list",{items:[1],htmlAriaLabelledby:[513,"html-aria-labelledby"],htmlSectionTitle:[513,"html-section-title"]},undefined,{items:[{watchItems:0}]}]);function h(){if(typeof customElements==="undefined"){return}const e=["z-tree-list","z-divider","z-icon","z-list","z-list-element"];e.forEach((e=>{switch(e){case"z-tree-list":if(!customElements.get(s(e))){customElements.define(s(e),f)}break;case"z-divider":if(!customElements.get(s(e))){o()}break;case"z-icon":if(!customElements.get(s(e))){a()}break;case"z-list":if(!customElements.get(s(e))){d()}break;case"z-list-element":if(!customElements.get(s(e))){c()}break}}))}const u=f;const p=h;export{u as ZTreeList,p as defineCustomElement};
1
+ import{p as e,H as t,c as i,h as l,d as s,t as n}from"./p-RmbDDbWd.js";import{g as r}from"./p-DdetsoIY.js";import{d as o}from"./p-BolVsvfr.js";import{d as a}from"./p-CbXEdwLi.js";import{d}from"./p-cpTAMdcF.js";import{d as c}from"./p-BeSVHdId.js";const m=()=>`:host{font-family:var(--font-family-sans)}z-list-element{position:relative;display:block;padding-top:var(--space-unit)}z-list-element::before,z-list-element::after{position:absolute;z-index:100;top:0.125rem;left:-0.5rem;content:""}z-list z-list-element::before{width:var(--space-unit);height:calc(var(--space-unit) * 2);border-bottom:var(--border-size-small) solid var(--color-disabled01-icon);border-left:var(--border-size-small) solid var(--color-disabled01-icon)}z-list z-list-element::after{width:var(--space-unit);height:100%;border-left:var(--border-size-small) solid var(--color-disabled01-icon)}z-list z-list-element:last-child::after,z-list>z-list-element::before,z-list>z-list-element::after,z-list>z-list-group>z-list-element::before,z-list>z-list-group>z-list-element::after{display:none}z-list>div.children-node{padding-left:calc(var(--space-unit) * 2)}z-list-element>.list-element{z-index:100;display:flex;justify-content:space-between;padding:0;color:var(--color-default-text);font-size:var(--font-size-2);font-style:normal;font-weight:var(--font-rg);text-decoration:none}z-list-element>.list-element.link-clickable{color:var(--color-primary01)}z-list-element>.list-element.link-clickable:hover{text-decoration:underline}z-list-element>.list-element .item.ellipsis{overflow:hidden}z-list-element .list-element::after{position:absolute;top:0;right:-0.0625rem;display:block;width:100%;height:calc(var(--space-unit) * 5);content:"";transform:translateX(-100%)}.item-label{overflow:hidden;flex-grow:1;font-size:var(--font-size-2);font-style:normal;font-weight:var(--font-rg);letter-spacing:0.0032rem;line-height:1.25rem;text-overflow:ellipsis;white-space:nowrap}.item-label.bold-item{font-weight:var(--font-sb)}.item.ellipsis{display:flex;overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap}.children-node>z-list-element{padding:0;padding-top:0.125;padding-left:calc(var(--space-unit) * 1.25)}.item-icon{margin-right:var(--space-unit)}.no-icon-label{padding-left:var(--space-unit)}.children-node>z-list-element.no-icon-elm{padding-left:0}z-list-element>.list-element:focus:focus-visible{position:relative;z-index:200;box-shadow:var(--shadow-focus-primary);outline:none}@media (max-width: 767px){z-list-element::before,z-list-element::after{top:0.1875rem}z-list z-list-element::before{height:calc(var(--space-unit) * 2.5)}.children-node>z-list-element{padding-top:var(--space-unit)}}`;const f=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.treeItemClicked=i(this,"treeItemClicked",7);this.items=[];this.parsedItems=[]}watchItems(){this.parsedItems=typeof this.items==="string"?JSON.parse(this.items):this.items}componentWillLoad(){this.watchItems()}handleClick(e){this.treeItemClicked.emit({id:e.id,name:e.name,url:e.url})}getFocusableElements(){return Array.from(this.host.shadowRoot.querySelectorAll('a[tabindex="0"]'))}getAncestor(e,t){let i=e;for(let e=0;e<t;e++){i=i===null||i===void 0?void 0:i.parentElement;if(!i){return}}return i}handleArrowNav(e){if(e.code===r.TAB){e.preventDefault();return}const t=this.getFocusableElements();const i=t.indexOf(e.target);if(i===-1){return}if(e.code===r.ARROW_DOWN||e.code===r.ARROW_UP){e.preventDefault();const l=i+(e.code===r.ARROW_DOWN?1:-1);if(l<0||l>=t.length){return}t[l].focus()}if(e.code===r.ARROW_LEFT){e.preventDefault();const l=this.getAncestor(t[i],4);if(!l||!l.children[0]||l.children[0].tagName.toLowerCase()!=="a"&&l.getAttribute("tabindex")===null){return}l.children[0].focus()}if(e.code===r.ARROW_RIGHT){e.preventDefault();const t=e.target.closest("z-list-element");if(!t){return}const i=t.querySelector("z-list");if(!i){return}const l=i.querySelector('a[tabindex="0"]');if(!l){return}l.focus()}}renderTreeList(e,t,i=1){var s,n;this.htmlTag=e.url?"a":"span";const o=l("z-list-element",{id:t,class:!e.icon?"no-icon-elm":"",clickable:Boolean(e.url),hasTreeItems:true,role:"none","aria-hidden":undefined},l(this.htmlTag,{class:{"list-element":true,"z-link":Boolean(e.url),"link-clickable":Boolean(e.url)},tabIndex:e.url?0:-1,onClick:()=>this.handleClick(e),onKeyUp:t=>{if(t.code===r.ENTER||t.code===r.SPACE){this.handleClick(e)}},onKeyDown:e=>this.handleArrowNav(e),role:e.url?"treeitem":undefined,"aria-hidden":e.url?undefined:"true","aria-expanded":((s=e.children)===null||s===void 0?void 0:s.length)>0&&true,"aria-level":i,"aria-label":e.name,href:e.url},l("span",{class:"item ellipsis"},e.icon&&l("z-icon",{width:16,height:16,fill:e.url?"color-primary01":"color-default-icon",class:"item-icon",name:e.icon}),l("span",{class:{"item-label":true,"no-icon-label":!e.icon,"bold-item":e.bold},title:e.name},e.name))),((n=e.children)===null||n===void 0?void 0:n.length)>0&&l("z-list",{role:"group"},l("div",{class:"children-node"},e.children.map(((e,t)=>this.renderTreeList(e,`${t}`,i+1))))));return o}render(){const e=this.parsedItems.some((e=>!!e.url));return l(s,{key:"d4f93f20f84ac193c4b291b0cc16d4a0e6838d49",class:"tree-list",role:e?"navigation":"none","aria-hidden":e?undefined:"true","aria-labelledby":this.htmlAriaLabelledby},l("div",{key:"4d0f11bb82855843beabb2eb0ddaa30ca39d8524",tabIndex:-1,role:e?"tree":"none","aria-hidden":e?undefined:"true","aria-label":this.htmlSectionTitle},this.parsedItems.map(((e,t)=>this.renderTreeList(e,`${t}`)))))}get host(){return this}static get watchers(){return{items:[{watchItems:0}]}}static get style(){return m()}},[1,"z-tree-list",{items:[1],htmlAriaLabelledby:[513,"html-aria-labelledby"],htmlSectionTitle:[513,"html-section-title"]},undefined,{items:[{watchItems:0}]}]);function h(){if(typeof customElements==="undefined"){return}const e=["z-tree-list","z-divider","z-icon","z-list","z-list-element"];e.forEach((e=>{switch(e){case"z-tree-list":if(!customElements.get(n(e))){customElements.define(n(e),f)}break;case"z-divider":if(!customElements.get(n(e))){o()}break;case"z-icon":if(!customElements.get(n(e))){a()}break;case"z-list":if(!customElements.get(n(e))){d()}break;case"z-list-element":if(!customElements.get(n(e))){c()}break}}))}const p=f;const u=h;export{p as ZTreeList,u as defineCustomElement};
2
2
  //# sourceMappingURL=z-tree-list.js.map