@zanichelli/albe-web-components 2.44.1 → 2.46.1

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 (262) hide show
  1. package/dist/cjs/{_commonjsHelpers-119ffc74.js → _commonjsHelpers-537d719a.js} +3 -0
  2. package/dist/cjs/{hammer-54230951.js → hammer-4f20813e.js} +1 -1
  3. package/dist/cjs/{icons-05eba7ee.js → icons-30810e62.js} +5 -1
  4. package/dist/cjs/{index-93c4c577.js → index-155b2ec5.js} +27 -10
  5. package/dist/cjs/{index-9651dba8.js → index-1fda0714.js} +1 -1
  6. package/dist/cjs/index.cjs.js +2 -2
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/{utils-23a6dee4.js → utils-4bbd782c.js} +1 -1
  9. package/dist/cjs/web-components-library.cjs.js +2 -2
  10. package/dist/cjs/{z-app-switcher_10.cjs.entry.js → z-app-switcher_11.cjs.entry.js} +34 -16
  11. package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
  12. package/dist/cjs/z-avatar.cjs.entry.js +1 -1
  13. package/dist/cjs/z-button-filter_5.cjs.entry.js +2 -2
  14. package/dist/cjs/z-chip.cjs.entry.js +1 -1
  15. package/dist/cjs/z-combobox.cjs.entry.js +2 -2
  16. package/dist/cjs/z-contextual-menu.cjs.entry.js +1 -1
  17. package/dist/cjs/z-cookiebar.cjs.entry.js +1 -1
  18. package/dist/cjs/z-date-picker.cjs.entry.js +3004 -0
  19. package/dist/cjs/z-file-upload.cjs.entry.js +2 -2
  20. package/dist/cjs/z-file.cjs.entry.js +2 -2
  21. package/dist/cjs/z-footer.cjs.entry.js +1 -1
  22. package/dist/cjs/z-icon-package.cjs.entry.js +1 -1
  23. package/dist/cjs/z-list_3.cjs.entry.js +1 -1
  24. package/dist/cjs/z-menu-dropdown_2.cjs.entry.js +2 -2
  25. package/dist/cjs/z-messages-pocket.cjs.entry.js +1 -1
  26. package/dist/cjs/z-modal-login.cjs.entry.js +1 -1
  27. package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
  28. package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
  29. package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
  30. package/dist/cjs/z-myz-card-info.cjs.entry.js +2 -2
  31. package/dist/cjs/z-myz-card_4.cjs.entry.js +1 -1
  32. package/dist/cjs/z-myz-list-item.cjs.entry.js +2 -2
  33. package/dist/cjs/z-myz-topbar.cjs.entry.js +1 -1
  34. package/dist/cjs/z-navigation-tab-link.cjs.entry.js +70 -0
  35. package/dist/cjs/z-navigation-tab.cjs.entry.js +35 -8
  36. package/dist/cjs/z-navigation-tabs.cjs.entry.js +76 -48
  37. package/dist/cjs/z-otp.cjs.entry.js +1 -1
  38. package/dist/cjs/z-pagination-bar.cjs.entry.js +4 -4
  39. package/dist/cjs/z-pocket_3.cjs.entry.js +4 -4
  40. package/dist/cjs/z-popover.cjs.entry.js +4 -4
  41. package/dist/cjs/z-section-title.cjs.entry.js +1 -1
  42. package/dist/cjs/z-slideshow.cjs.entry.js +2 -2
  43. package/dist/cjs/z-status-tag.cjs.entry.js +3 -3
  44. package/dist/cjs/z-table-cell.cjs.entry.js +3 -3
  45. package/dist/cjs/z-table-empty-box.cjs.entry.js +2 -2
  46. package/dist/cjs/z-table-header.cjs.entry.js +4 -4
  47. package/dist/cjs/z-table-row.cjs.entry.js +1 -1
  48. package/dist/cjs/z-table.cjs.entry.js +1 -1
  49. package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
  50. package/dist/cjs/z-toast-notification.cjs.entry.js +3 -3
  51. package/dist/cjs/z-toggle-switch.cjs.entry.js +2 -2
  52. package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
  53. package/dist/collection/beans/index.js +27 -10
  54. package/dist/collection/collection-manifest.json +5 -3
  55. package/dist/collection/components/icons/icons.js +5 -1
  56. package/dist/collection/components/navigation/{z-navigation-tab/styles.css → tabs/navigation-tab.css} +39 -35
  57. package/dist/collection/components/navigation/tabs/z-navigation-tab/index.js +239 -0
  58. package/dist/collection/components/navigation/tabs/z-navigation-tab-link/index.js +271 -0
  59. package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.js +207 -0
  60. package/dist/collection/components/navigation/{z-navigation-tabs → tabs/z-navigation-tabs}/styles.css +11 -10
  61. package/dist/collection/components/z-carousel/index.js +48 -1
  62. package/dist/collection/components/z-date-picker/index.js +143 -0
  63. package/dist/collection/components/z-date-picker/styles.css +515 -0
  64. package/dist/esm/{_commonjsHelpers-8b28c6fa.js → _commonjsHelpers-9943807e.js} +3 -1
  65. package/dist/esm/{hammer-501342a9.js → hammer-c3266b17.js} +1 -1
  66. package/dist/esm/{icons-bceeb196.js → icons-d8a127bf.js} +5 -1
  67. package/dist/esm/{index-023c206a.js → index-22f4a844.js} +28 -11
  68. package/dist/esm/{index-aa3a4feb.js → index-abb47b30.js} +1 -1
  69. package/dist/esm/index.js +2 -2
  70. package/dist/esm/loader.js +2 -2
  71. package/dist/esm/{utils-05b6c600.js → utils-259e2dd9.js} +1 -1
  72. package/dist/esm/web-components-library.js +2 -2
  73. package/dist/esm/{z-app-switcher_10.entry.js → z-app-switcher_11.entry.js} +34 -17
  74. package/dist/esm/z-aria-alert.entry.js +1 -1
  75. package/dist/esm/z-avatar.entry.js +1 -1
  76. package/dist/esm/z-button-filter_5.entry.js +2 -2
  77. package/dist/esm/z-chip.entry.js +1 -1
  78. package/dist/esm/z-combobox.entry.js +2 -2
  79. package/dist/esm/z-contextual-menu.entry.js +1 -1
  80. package/dist/esm/z-cookiebar.entry.js +1 -1
  81. package/dist/esm/z-date-picker.entry.js +3000 -0
  82. package/dist/esm/z-file-upload.entry.js +2 -2
  83. package/dist/esm/z-file.entry.js +2 -2
  84. package/dist/esm/z-footer.entry.js +1 -1
  85. package/dist/esm/z-icon-package.entry.js +1 -1
  86. package/dist/esm/z-list_3.entry.js +1 -1
  87. package/dist/esm/z-menu-dropdown_2.entry.js +2 -2
  88. package/dist/esm/z-messages-pocket.entry.js +1 -1
  89. package/dist/esm/z-modal-login.entry.js +1 -1
  90. package/dist/esm/z-myz-card-alert.entry.js +1 -1
  91. package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
  92. package/dist/esm/z-myz-card-footer.entry.js +1 -1
  93. package/dist/esm/z-myz-card-info.entry.js +2 -2
  94. package/dist/esm/z-myz-card_4.entry.js +1 -1
  95. package/dist/esm/z-myz-list-item.entry.js +2 -2
  96. package/dist/esm/z-myz-topbar.entry.js +1 -1
  97. package/dist/esm/z-navigation-tab-link.entry.js +66 -0
  98. package/dist/esm/z-navigation-tab.entry.js +35 -8
  99. package/dist/esm/z-navigation-tabs.entry.js +76 -48
  100. package/dist/esm/z-otp.entry.js +1 -1
  101. package/dist/esm/z-pagination-bar.entry.js +4 -4
  102. package/dist/esm/z-pocket_3.entry.js +4 -4
  103. package/dist/esm/z-popover.entry.js +4 -4
  104. package/dist/esm/z-section-title.entry.js +1 -1
  105. package/dist/esm/z-slideshow.entry.js +2 -2
  106. package/dist/esm/z-status-tag.entry.js +3 -3
  107. package/dist/esm/z-table-cell.entry.js +3 -3
  108. package/dist/esm/z-table-empty-box.entry.js +2 -2
  109. package/dist/esm/z-table-header.entry.js +4 -4
  110. package/dist/esm/z-table-row.entry.js +1 -1
  111. package/dist/esm/z-table.entry.js +1 -1
  112. package/dist/esm/z-toast-notification-list.entry.js +1 -1
  113. package/dist/esm/z-toast-notification.entry.js +3 -3
  114. package/dist/esm/z-toggle-switch.entry.js +2 -2
  115. package/dist/esm/z-tooltip.entry.js +1 -1
  116. package/dist/types/beans/index.d.ts +18 -4
  117. package/dist/types/components/icons/icons.d.ts +4 -0
  118. package/dist/types/components/navigation/tabs/z-navigation-tab/index.d.ts +48 -0
  119. package/dist/types/components/navigation/tabs/z-navigation-tab-link/index.d.ts +56 -0
  120. package/dist/types/components/navigation/tabs/z-navigation-tabs/index.d.ts +68 -0
  121. package/dist/types/components/z-carousel/index.d.ts +4 -0
  122. package/dist/types/components/z-date-picker/index.d.ts +20 -0
  123. package/dist/types/components.d.ts +198 -15
  124. package/dist/web-components-library/index.esm.js +1 -1
  125. package/dist/web-components-library/{p-2536d492.entry.js → p-0177caf2.entry.js} +1 -1
  126. package/dist/web-components-library/{p-a9a24ffd.entry.js → p-01a23d8c.entry.js} +1 -1
  127. package/dist/web-components-library/{p-5d429427.entry.js → p-02145727.entry.js} +1 -1
  128. package/{www/build/p-98cd95f3.entry.js → dist/web-components-library/p-0b0a358a.entry.js} +1 -1
  129. package/dist/web-components-library/p-0fc6feaf.entry.js +1 -0
  130. package/dist/web-components-library/{p-a8ba7c76.entry.js → p-10a2a9fe.entry.js} +1 -1
  131. package/dist/web-components-library/p-112455b1.js +1 -0
  132. package/dist/web-components-library/{p-ee229819.entry.js → p-157885b1.entry.js} +1 -1
  133. package/dist/web-components-library/p-1b34d655.entry.js +1 -0
  134. package/dist/web-components-library/{p-6b70aaa3.entry.js → p-240561e7.entry.js} +1 -1
  135. package/dist/web-components-library/{p-3247dee9.js → p-286363e2.js} +1 -1
  136. package/dist/web-components-library/p-298d324a.entry.js +1 -0
  137. package/dist/web-components-library/p-2d325b9b.entry.js +1 -0
  138. package/dist/web-components-library/{p-5651167f.entry.js → p-2de00f19.entry.js} +1 -1
  139. package/dist/web-components-library/{p-6deeeeff.entry.js → p-30c0f3f2.entry.js} +1 -1
  140. package/dist/web-components-library/{p-189c9cd3.entry.js → p-35c4d277.entry.js} +1 -1
  141. package/dist/web-components-library/{p-091b489d.entry.js → p-3bc3f32e.entry.js} +1 -1
  142. package/dist/web-components-library/{p-800e9669.entry.js → p-4a360730.entry.js} +1 -1
  143. package/dist/web-components-library/{p-04f7a407.entry.js → p-4c7250a9.entry.js} +1 -1
  144. package/dist/web-components-library/p-4e270984.entry.js +16 -0
  145. package/{www/build/p-26410b9b.entry.js → dist/web-components-library/p-4ef4c8ef.entry.js} +1 -1
  146. package/dist/web-components-library/p-4f64af13.entry.js +1 -0
  147. package/{www/build/p-82048c15.js → dist/web-components-library/p-571e9db9.js} +1 -1
  148. package/dist/web-components-library/{p-ead40844.entry.js → p-58091e1c.entry.js} +1 -1
  149. package/dist/web-components-library/{p-cd0cafe6.entry.js → p-5b2d0ccb.entry.js} +1 -1
  150. package/dist/web-components-library/{p-7bb69f45.entry.js → p-61ba9cc7.entry.js} +1 -1
  151. package/dist/web-components-library/{p-2c8e542b.entry.js → p-64b2b415.entry.js} +1 -1
  152. package/dist/web-components-library/{p-2b551b66.entry.js → p-782d01c1.entry.js} +1 -1
  153. package/dist/web-components-library/{p-bc168412.entry.js → p-7efeb668.entry.js} +1 -1
  154. package/{www/build/p-c3bd10ad.entry.js → dist/web-components-library/p-814d6b43.entry.js} +1 -1
  155. package/dist/web-components-library/{p-3b47835a.entry.js → p-88bc3cf2.entry.js} +1 -1
  156. package/dist/web-components-library/p-904375ec.entry.js +1 -0
  157. package/{www/build/p-3ade3fa4.entry.js → dist/web-components-library/p-9777ec0b.entry.js} +1 -1
  158. package/dist/web-components-library/{p-00265234.entry.js → p-9d279248.entry.js} +1 -1
  159. package/dist/web-components-library/{p-fae6d22e.entry.js → p-a6c68018.entry.js} +1 -1
  160. package/dist/web-components-library/{p-e305e1f8.entry.js → p-b260e143.entry.js} +1 -1
  161. package/dist/web-components-library/{p-94919e28.entry.js → p-c196c340.entry.js} +1 -1
  162. package/dist/web-components-library/{p-329633be.entry.js → p-c3771cc7.entry.js} +1 -1
  163. package/dist/web-components-library/{p-f938f1b0.entry.js → p-c5d6450e.entry.js} +1 -1
  164. package/dist/web-components-library/p-d2da11f4.js +1 -0
  165. package/dist/web-components-library/{p-26572e05.js → p-d34e101f.js} +1 -1
  166. package/dist/web-components-library/{p-9207c9ca.entry.js → p-d4440420.entry.js} +1 -1
  167. package/{www/build/p-33dc73f1.entry.js → dist/web-components-library/p-d502063b.entry.js} +1 -1
  168. package/dist/web-components-library/{p-1d371408.js → p-e43e61ac.js} +1 -1
  169. package/dist/web-components-library/{p-e6f63644.entry.js → p-e4dce41a.entry.js} +1 -1
  170. package/dist/web-components-library/{p-4e7c54ac.entry.js → p-eafa01a1.entry.js} +1 -1
  171. package/dist/web-components-library/p-ec361ccf.entry.js +1 -0
  172. package/dist/web-components-library/p-ef22d940.entry.js +1 -0
  173. package/dist/web-components-library/{p-92f0664e.entry.js → p-feb6ee16.entry.js} +1 -1
  174. package/dist/web-components-library/web-components-library.esm.js +1 -1
  175. package/package.json +2 -1
  176. package/react/components.d.ts +2 -0
  177. package/react/components.js +4 -2
  178. package/react/components.js.map +1 -1
  179. package/www/build/index.esm.js +1 -1
  180. package/www/build/{p-2536d492.entry.js → p-0177caf2.entry.js} +1 -1
  181. package/www/build/{p-a9a24ffd.entry.js → p-01a23d8c.entry.js} +1 -1
  182. package/www/build/{p-5d429427.entry.js → p-02145727.entry.js} +1 -1
  183. package/{dist/web-components-library/p-98cd95f3.entry.js → www/build/p-0b0a358a.entry.js} +1 -1
  184. package/www/build/p-0fc6feaf.entry.js +1 -0
  185. package/www/build/{p-a8ba7c76.entry.js → p-10a2a9fe.entry.js} +1 -1
  186. package/www/build/p-112455b1.js +1 -0
  187. package/www/build/{p-ee229819.entry.js → p-157885b1.entry.js} +1 -1
  188. package/www/build/p-1b34d655.entry.js +1 -0
  189. package/www/build/{p-6b70aaa3.entry.js → p-240561e7.entry.js} +1 -1
  190. package/www/build/{p-3247dee9.js → p-286363e2.js} +1 -1
  191. package/www/build/p-298d324a.entry.js +1 -0
  192. package/www/build/p-2d325b9b.entry.js +1 -0
  193. package/www/build/{p-5651167f.entry.js → p-2de00f19.entry.js} +1 -1
  194. package/www/build/{p-6deeeeff.entry.js → p-30c0f3f2.entry.js} +1 -1
  195. package/www/build/{p-189c9cd3.entry.js → p-35c4d277.entry.js} +1 -1
  196. package/www/build/{p-091b489d.entry.js → p-3bc3f32e.entry.js} +1 -1
  197. package/www/build/{p-800e9669.entry.js → p-4a360730.entry.js} +1 -1
  198. package/www/build/{p-04f7a407.entry.js → p-4c7250a9.entry.js} +1 -1
  199. package/www/build/p-4e270984.entry.js +16 -0
  200. package/{dist/web-components-library/p-26410b9b.entry.js → www/build/p-4ef4c8ef.entry.js} +1 -1
  201. package/www/build/p-4f64af13.entry.js +1 -0
  202. package/www/build/p-53add5a8.js +1 -0
  203. package/{dist/web-components-library/p-82048c15.js → www/build/p-571e9db9.js} +1 -1
  204. package/www/build/{p-ead40844.entry.js → p-58091e1c.entry.js} +1 -1
  205. package/www/build/{p-cd0cafe6.entry.js → p-5b2d0ccb.entry.js} +1 -1
  206. package/www/build/{p-7bb69f45.entry.js → p-61ba9cc7.entry.js} +1 -1
  207. package/www/build/{p-2c8e542b.entry.js → p-64b2b415.entry.js} +1 -1
  208. package/www/build/{p-2b551b66.entry.js → p-782d01c1.entry.js} +1 -1
  209. package/www/build/{p-bc168412.entry.js → p-7efeb668.entry.js} +1 -1
  210. package/{dist/web-components-library/p-c3bd10ad.entry.js → www/build/p-814d6b43.entry.js} +1 -1
  211. package/www/build/p-88b56b6e.css +1 -0
  212. package/www/build/{p-3b47835a.entry.js → p-88bc3cf2.entry.js} +1 -1
  213. package/www/build/p-904375ec.entry.js +1 -0
  214. package/{dist/web-components-library/p-3ade3fa4.entry.js → www/build/p-9777ec0b.entry.js} +1 -1
  215. package/www/build/{p-00265234.entry.js → p-9d279248.entry.js} +1 -1
  216. package/www/build/{p-fae6d22e.entry.js → p-a6c68018.entry.js} +1 -1
  217. package/www/build/{p-e305e1f8.entry.js → p-b260e143.entry.js} +1 -1
  218. package/www/build/{p-94919e28.entry.js → p-c196c340.entry.js} +1 -1
  219. package/www/build/{p-329633be.entry.js → p-c3771cc7.entry.js} +1 -1
  220. package/www/build/{p-f938f1b0.entry.js → p-c5d6450e.entry.js} +1 -1
  221. package/www/build/p-d2da11f4.js +1 -0
  222. package/www/build/{p-26572e05.js → p-d34e101f.js} +1 -1
  223. package/www/build/{p-9207c9ca.entry.js → p-d4440420.entry.js} +1 -1
  224. package/{dist/web-components-library/p-33dc73f1.entry.js → www/build/p-d502063b.entry.js} +1 -1
  225. package/www/build/{p-1d371408.js → p-e43e61ac.js} +1 -1
  226. package/www/build/{p-e6f63644.entry.js → p-e4dce41a.entry.js} +1 -1
  227. package/www/build/{p-4e7c54ac.entry.js → p-eafa01a1.entry.js} +1 -1
  228. package/www/build/p-ec361ccf.entry.js +1 -0
  229. package/www/build/p-ef22d940.entry.js +1 -0
  230. package/www/build/{p-92f0664e.entry.js → p-feb6ee16.entry.js} +1 -1
  231. package/www/build/web-components-library.esm.js +1 -1
  232. package/www/index.html +61 -16
  233. package/CHANGELOG.md +0 -1486
  234. package/dist/cjs/z-ghost-loading.cjs.entry.js +0 -19
  235. package/dist/collection/components/navigation/z-navigation-tab/index.js +0 -151
  236. package/dist/collection/components/navigation/z-navigation-tabs/index.js +0 -179
  237. package/dist/esm/z-ghost-loading.entry.js +0 -15
  238. package/dist/types/components/navigation/z-navigation-tab/index.d.ts +0 -16
  239. package/dist/types/components/navigation/z-navigation-tabs/index.d.ts +0 -32
  240. package/dist/web-components-library/p-1242e682.entry.js +0 -1
  241. package/dist/web-components-library/p-3d99e2b1.entry.js +0 -1
  242. package/dist/web-components-library/p-5300e675.entry.js +0 -1
  243. package/dist/web-components-library/p-5789bbe7.entry.js +0 -1
  244. package/dist/web-components-library/p-5b5d269c.js +0 -1
  245. package/dist/web-components-library/p-5e41c6c2.entry.js +0 -1
  246. package/dist/web-components-library/p-99e53bd5.entry.js +0 -1
  247. package/dist/web-components-library/p-b68038b5.js +0 -1
  248. package/dist/web-components-library/p-b9d7caa1.entry.js +0 -1
  249. package/dist/web-components-library/p-e98bb01e.entry.js +0 -1
  250. package/src-react/index.ts +0 -1
  251. package/www/build/p-1242e682.entry.js +0 -1
  252. package/www/build/p-3d99e2b1.entry.js +0 -1
  253. package/www/build/p-5300e675.entry.js +0 -1
  254. package/www/build/p-5789bbe7.entry.js +0 -1
  255. package/www/build/p-5b5d269c.js +0 -1
  256. package/www/build/p-5e41c6c2.entry.js +0 -1
  257. package/www/build/p-99e53bd5.entry.js +0 -1
  258. package/www/build/p-b68038b5.js +0 -1
  259. package/www/build/p-b9d7caa1.entry.js +0 -1
  260. package/www/build/p-d96e3b44.js +0 -129
  261. package/www/build/p-e98bb01e.entry.js +0 -1
  262. package/www/build/p-fcff1237.css +0 -812
@@ -0,0 +1,239 @@
1
+ import { Component, Prop, h, Element, Listen, Event, Watch } from "@stencil/core";
2
+ import { NavigationTabsOrientations, NavigationTabsSizes } from "../../../../beans";
3
+ import { icons } from "../../../icons/icons";
4
+ /**
5
+ * Single tab component to use inside `z-navigation-tabs`. It renders a button.
6
+ * @slot icon - Tab icon. If no extra customization is needed, use the `icon` prop passing the icon's name.
7
+ */
8
+ export class ZNavigationTab {
9
+ constructor() {
10
+ /**
11
+ * Whether the tab is selected.
12
+ */
13
+ this.selected = false;
14
+ /**
15
+ * Whether the tab is disabled.
16
+ */
17
+ this.disabled = false;
18
+ /**
19
+ * Tab orientation. Do not set this manually: `z-navigation-tabs` will handle this.
20
+ */
21
+ this.orientation = NavigationTabsOrientations.horizontal;
22
+ /**
23
+ * Tab size. Do not set this manually: `z-navigation-tabs` will handle this.
24
+ */
25
+ this.size = NavigationTabsSizes.big;
26
+ }
27
+ onFocus() {
28
+ this.host.scrollIntoView({
29
+ behavior: "smooth",
30
+ block: "nearest",
31
+ inline: "nearest",
32
+ });
33
+ }
34
+ onClick() {
35
+ if (!this.disabled) {
36
+ this.selected = true;
37
+ }
38
+ }
39
+ onSelected() {
40
+ if (this.selected) {
41
+ this.emitSelected.emit();
42
+ }
43
+ }
44
+ /**
45
+ * Render the icon component using the icon's name passed from prop.
46
+ * Use the `filled` version when the tab is `selected`.
47
+ * @returns {HTMLElement}
48
+ */
49
+ renderIcon() {
50
+ let icon = this.icon;
51
+ const iconFilled = `${icon.replace(/-filled$/, '')}-filled`;
52
+ if (this.selected && Object.keys(icons).includes(iconFilled)) {
53
+ icon = iconFilled;
54
+ }
55
+ return h("z-icon", { name: icon });
56
+ }
57
+ render() {
58
+ return (h("button", { role: "tab", disabled: this.disabled, title: this.htmlTitle },
59
+ h("slot", { name: "icon" }, this.icon && this.renderIcon()),
60
+ this.orientation === "horizontal" && this.label));
61
+ }
62
+ static get is() { return "z-navigation-tab"; }
63
+ static get encapsulation() { return "shadow"; }
64
+ static get originalStyleUrls() { return {
65
+ "$": ["../navigation-tab.css"]
66
+ }; }
67
+ static get styleUrls() { return {
68
+ "$": ["../navigation-tab.css"]
69
+ }; }
70
+ static get properties() { return {
71
+ "selected": {
72
+ "type": "boolean",
73
+ "mutable": true,
74
+ "complexType": {
75
+ "original": "boolean",
76
+ "resolved": "boolean",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": true,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": "Whether the tab is selected."
84
+ },
85
+ "attribute": "selected",
86
+ "reflect": true,
87
+ "defaultValue": "false"
88
+ },
89
+ "disabled": {
90
+ "type": "boolean",
91
+ "mutable": false,
92
+ "complexType": {
93
+ "original": "boolean",
94
+ "resolved": "boolean",
95
+ "references": {}
96
+ },
97
+ "required": false,
98
+ "optional": true,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": "Whether the tab is disabled."
102
+ },
103
+ "attribute": "disabled",
104
+ "reflect": true,
105
+ "defaultValue": "false"
106
+ },
107
+ "orientation": {
108
+ "type": "string",
109
+ "mutable": false,
110
+ "complexType": {
111
+ "original": "NavigationTabsOrientation",
112
+ "resolved": "\"horizontal\" | \"vertical\"",
113
+ "references": {
114
+ "NavigationTabsOrientation": {
115
+ "location": "import",
116
+ "path": "../../../../beans"
117
+ }
118
+ }
119
+ },
120
+ "required": false,
121
+ "optional": false,
122
+ "docs": {
123
+ "tags": [],
124
+ "text": "Tab orientation. Do not set this manually: `z-navigation-tabs` will handle this."
125
+ },
126
+ "attribute": "orientation",
127
+ "reflect": true,
128
+ "defaultValue": "NavigationTabsOrientations.horizontal"
129
+ },
130
+ "size": {
131
+ "type": "string",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "NavigationTabsSize",
135
+ "resolved": "\"big\" | \"small\"",
136
+ "references": {
137
+ "NavigationTabsSize": {
138
+ "location": "import",
139
+ "path": "../../../../beans"
140
+ }
141
+ }
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": "Tab size. Do not set this manually: `z-navigation-tabs` will handle this."
148
+ },
149
+ "attribute": "size",
150
+ "reflect": true,
151
+ "defaultValue": "NavigationTabsSizes.big"
152
+ },
153
+ "icon": {
154
+ "type": "string",
155
+ "mutable": false,
156
+ "complexType": {
157
+ "original": "string",
158
+ "resolved": "string",
159
+ "references": {}
160
+ },
161
+ "required": false,
162
+ "optional": false,
163
+ "docs": {
164
+ "tags": [],
165
+ "text": "Name of the icon to use. Use the slot `icon` for extra customization.\nThe `filled` version will be automatically used (if found) when the tab is `selected`."
166
+ },
167
+ "attribute": "icon",
168
+ "reflect": false
169
+ },
170
+ "label": {
171
+ "type": "string",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "string",
175
+ "resolved": "string",
176
+ "references": {}
177
+ },
178
+ "required": false,
179
+ "optional": false,
180
+ "docs": {
181
+ "tags": [],
182
+ "text": "Label to show in the tab."
183
+ },
184
+ "attribute": "label",
185
+ "reflect": false
186
+ },
187
+ "htmlTitle": {
188
+ "type": "string",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "string",
192
+ "resolved": "string",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": false,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": "Html `title` attribute for the button."
200
+ },
201
+ "attribute": "html-title",
202
+ "reflect": false
203
+ }
204
+ }; }
205
+ static get events() { return [{
206
+ "method": "emitSelected",
207
+ "name": "selected",
208
+ "bubbles": true,
209
+ "cancelable": true,
210
+ "composed": true,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": ""
214
+ },
215
+ "complexType": {
216
+ "original": "any",
217
+ "resolved": "any",
218
+ "references": {}
219
+ }
220
+ }]; }
221
+ static get elementRef() { return "host"; }
222
+ static get watchers() { return [{
223
+ "propName": "selected",
224
+ "methodName": "onSelected"
225
+ }]; }
226
+ static get listeners() { return [{
227
+ "name": "focus",
228
+ "method": "onFocus",
229
+ "target": undefined,
230
+ "capture": false,
231
+ "passive": false
232
+ }, {
233
+ "name": "click",
234
+ "method": "onClick",
235
+ "target": undefined,
236
+ "capture": false,
237
+ "passive": false
238
+ }]; }
239
+ }
@@ -0,0 +1,271 @@
1
+ import { Component, Prop, h, Element, Listen, Event, Watch, } from "@stencil/core";
2
+ import { NavigationTabsOrientations, NavigationTabsSizes, } from "../../../../beans";
3
+ import { icons } from "../../../icons/icons";
4
+ /**
5
+ * Single tab component to use inside `z-navigation-tabs`. It renders an anchor element.
6
+ * @slot icon - Tab icon. If no extra customization is needed, use the `icon` prop passing the icon's name.
7
+ */
8
+ export class ZNavigationTabLink {
9
+ constructor() {
10
+ /**
11
+ * Whether the tab is selected.
12
+ */
13
+ this.selected = false;
14
+ /**
15
+ * Whether the tab is disabled.
16
+ */
17
+ this.disabled = false;
18
+ /**
19
+ * Tab orientation. Do not set this manually: `z-navigation-tabs` will handle this.
20
+ */
21
+ this.orientation = NavigationTabsOrientations.horizontal;
22
+ /**
23
+ * Tab size. Do not set this manually: `z-navigation-tabs` will handle this.
24
+ */
25
+ this.size = NavigationTabsSizes.big;
26
+ }
27
+ onFocus() {
28
+ this.host.scrollIntoView({
29
+ behavior: "smooth",
30
+ block: "nearest",
31
+ inline: "nearest",
32
+ });
33
+ }
34
+ onClick() {
35
+ this.selected = true;
36
+ }
37
+ onSelected() {
38
+ if (this.selected) {
39
+ this.emitSelected.emit();
40
+ }
41
+ }
42
+ /**
43
+ * Render the icon component using the icon's name passed from prop.
44
+ * Use the `filled` version when the tab is `selected`.
45
+ * @returns {HTMLElement}
46
+ */
47
+ renderIcon() {
48
+ let icon = this.icon;
49
+ const iconFilled = `${icon.replace(/-filled$/, '')}-filled`;
50
+ if (this.selected && Object.keys(icons).includes(iconFilled)) {
51
+ icon = iconFilled;
52
+ }
53
+ return h("z-icon", { name: icon });
54
+ }
55
+ render() {
56
+ return (h("a", { role: "tab", href: !this.disabled && this.href, title: this.htmlTitle, target: this.target },
57
+ h("slot", { name: "icon" }, this.icon && this.renderIcon()),
58
+ this.orientation === "horizontal" && this.label));
59
+ }
60
+ static get is() { return "z-navigation-tab-link"; }
61
+ static get encapsulation() { return "shadow"; }
62
+ static get originalStyleUrls() { return {
63
+ "$": ["../navigation-tab.css", "styles.css"]
64
+ }; }
65
+ static get styleUrls() { return {
66
+ "$": ["../navigation-tab.css", "styles.css"]
67
+ }; }
68
+ static get properties() { return {
69
+ "selected": {
70
+ "type": "boolean",
71
+ "mutable": true,
72
+ "complexType": {
73
+ "original": "boolean",
74
+ "resolved": "boolean",
75
+ "references": {}
76
+ },
77
+ "required": false,
78
+ "optional": true,
79
+ "docs": {
80
+ "tags": [],
81
+ "text": "Whether the tab is selected."
82
+ },
83
+ "attribute": "selected",
84
+ "reflect": true,
85
+ "defaultValue": "false"
86
+ },
87
+ "disabled": {
88
+ "type": "boolean",
89
+ "mutable": false,
90
+ "complexType": {
91
+ "original": "boolean",
92
+ "resolved": "boolean",
93
+ "references": {}
94
+ },
95
+ "required": false,
96
+ "optional": true,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": "Whether the tab is disabled."
100
+ },
101
+ "attribute": "disabled",
102
+ "reflect": true,
103
+ "defaultValue": "false"
104
+ },
105
+ "orientation": {
106
+ "type": "string",
107
+ "mutable": false,
108
+ "complexType": {
109
+ "original": "NavigationTabsOrientation",
110
+ "resolved": "\"horizontal\" | \"vertical\"",
111
+ "references": {
112
+ "NavigationTabsOrientation": {
113
+ "location": "import",
114
+ "path": "../../../../beans"
115
+ }
116
+ }
117
+ },
118
+ "required": false,
119
+ "optional": false,
120
+ "docs": {
121
+ "tags": [],
122
+ "text": "Tab orientation. Do not set this manually: `z-navigation-tabs` will handle this."
123
+ },
124
+ "attribute": "orientation",
125
+ "reflect": true,
126
+ "defaultValue": "NavigationTabsOrientations.horizontal"
127
+ },
128
+ "size": {
129
+ "type": "string",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "NavigationTabsSize",
133
+ "resolved": "\"big\" | \"small\"",
134
+ "references": {
135
+ "NavigationTabsSize": {
136
+ "location": "import",
137
+ "path": "../../../../beans"
138
+ }
139
+ }
140
+ },
141
+ "required": false,
142
+ "optional": false,
143
+ "docs": {
144
+ "tags": [],
145
+ "text": "Tab size. Do not set this manually: `z-navigation-tabs` will handle this."
146
+ },
147
+ "attribute": "size",
148
+ "reflect": true,
149
+ "defaultValue": "NavigationTabsSizes.big"
150
+ },
151
+ "htmlTitle": {
152
+ "type": "string",
153
+ "mutable": false,
154
+ "complexType": {
155
+ "original": "string",
156
+ "resolved": "string",
157
+ "references": {}
158
+ },
159
+ "required": false,
160
+ "optional": false,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": "Html title attribute for the anchor element."
164
+ },
165
+ "attribute": "html-title",
166
+ "reflect": false
167
+ },
168
+ "target": {
169
+ "type": "string",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "string",
173
+ "resolved": "string",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": false,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": "Html `target` attribute for the anchor element."
181
+ },
182
+ "attribute": "target",
183
+ "reflect": false
184
+ },
185
+ "href": {
186
+ "type": "string",
187
+ "mutable": false,
188
+ "complexType": {
189
+ "original": "string",
190
+ "resolved": "string",
191
+ "references": {}
192
+ },
193
+ "required": false,
194
+ "optional": false,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": "Url to set to the anchor element."
198
+ },
199
+ "attribute": "href",
200
+ "reflect": false
201
+ },
202
+ "icon": {
203
+ "type": "string",
204
+ "mutable": false,
205
+ "complexType": {
206
+ "original": "string",
207
+ "resolved": "string",
208
+ "references": {}
209
+ },
210
+ "required": false,
211
+ "optional": false,
212
+ "docs": {
213
+ "tags": [],
214
+ "text": "Name of the icon to use. Use the slot `icon` for extra customization.\nThe `filled` version will be automatically used (if found) when the tab is `selected`."
215
+ },
216
+ "attribute": "icon",
217
+ "reflect": false
218
+ },
219
+ "label": {
220
+ "type": "string",
221
+ "mutable": false,
222
+ "complexType": {
223
+ "original": "string",
224
+ "resolved": "string",
225
+ "references": {}
226
+ },
227
+ "required": false,
228
+ "optional": false,
229
+ "docs": {
230
+ "tags": [],
231
+ "text": "Label to show in the tab."
232
+ },
233
+ "attribute": "label",
234
+ "reflect": false
235
+ }
236
+ }; }
237
+ static get events() { return [{
238
+ "method": "emitSelected",
239
+ "name": "selected",
240
+ "bubbles": true,
241
+ "cancelable": true,
242
+ "composed": true,
243
+ "docs": {
244
+ "tags": [],
245
+ "text": ""
246
+ },
247
+ "complexType": {
248
+ "original": "any",
249
+ "resolved": "any",
250
+ "references": {}
251
+ }
252
+ }]; }
253
+ static get elementRef() { return "host"; }
254
+ static get watchers() { return [{
255
+ "propName": "selected",
256
+ "methodName": "onSelected"
257
+ }]; }
258
+ static get listeners() { return [{
259
+ "name": "focus",
260
+ "method": "onFocus",
261
+ "target": undefined,
262
+ "capture": false,
263
+ "passive": false
264
+ }, {
265
+ "name": "click",
266
+ "method": "onClick",
267
+ "target": undefined,
268
+ "capture": false,
269
+ "passive": false
270
+ }]; }
271
+ }