@zanichelli/albe-web-components 2.46.0 → 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 (211) hide show
  1. package/dist/cjs/{index-78d71393.js → index-155b2ec5.js} +10 -10
  2. package/dist/cjs/index.cjs.js +2 -2
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{utils-bb43ad49.js → utils-4bbd782c.js} +1 -1
  5. package/dist/cjs/web-components-library.cjs.js +1 -1
  6. package/dist/cjs/z-app-switcher_11.cjs.entry.js +1 -1
  7. package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
  8. package/dist/cjs/z-avatar.cjs.entry.js +1 -1
  9. package/dist/cjs/z-button-filter_5.cjs.entry.js +2 -2
  10. package/dist/cjs/z-chip.cjs.entry.js +1 -1
  11. package/dist/cjs/z-combobox.cjs.entry.js +2 -2
  12. package/dist/cjs/z-contextual-menu.cjs.entry.js +1 -1
  13. package/dist/cjs/z-cookiebar.cjs.entry.js +1 -1
  14. package/dist/cjs/z-date-picker.cjs.entry.js +1 -1
  15. package/dist/cjs/z-file-upload.cjs.entry.js +2 -2
  16. package/dist/cjs/z-file.cjs.entry.js +2 -2
  17. package/dist/cjs/z-footer.cjs.entry.js +1 -1
  18. package/dist/cjs/z-list_3.cjs.entry.js +1 -1
  19. package/dist/cjs/z-menu-dropdown_2.cjs.entry.js +2 -2
  20. package/dist/cjs/z-messages-pocket.cjs.entry.js +1 -1
  21. package/dist/cjs/z-modal-login.cjs.entry.js +1 -1
  22. package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
  23. package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
  24. package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
  25. package/dist/cjs/z-myz-card-info.cjs.entry.js +2 -2
  26. package/dist/cjs/z-myz-card_4.cjs.entry.js +1 -1
  27. package/dist/cjs/z-myz-list-item.cjs.entry.js +2 -2
  28. package/dist/cjs/z-myz-topbar.cjs.entry.js +1 -1
  29. package/dist/cjs/z-navigation-tab-link.cjs.entry.js +70 -0
  30. package/dist/cjs/z-navigation-tab.cjs.entry.js +35 -8
  31. package/dist/cjs/z-navigation-tabs.cjs.entry.js +76 -48
  32. package/dist/cjs/z-otp.cjs.entry.js +1 -1
  33. package/dist/cjs/z-pagination-bar.cjs.entry.js +2 -2
  34. package/dist/cjs/z-pocket_3.cjs.entry.js +2 -2
  35. package/dist/cjs/z-popover.cjs.entry.js +2 -2
  36. package/dist/cjs/z-section-title.cjs.entry.js +1 -1
  37. package/dist/cjs/z-slideshow.cjs.entry.js +2 -2
  38. package/dist/cjs/z-status-tag.cjs.entry.js +1 -1
  39. package/dist/cjs/z-table-cell.cjs.entry.js +1 -1
  40. package/dist/cjs/z-table-header.cjs.entry.js +2 -2
  41. package/dist/cjs/z-table-row.cjs.entry.js +1 -1
  42. package/dist/cjs/z-table.cjs.entry.js +1 -1
  43. package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
  44. package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
  45. package/dist/cjs/z-toggle-switch.cjs.entry.js +2 -2
  46. package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
  47. package/dist/collection/beans/index.js +10 -10
  48. package/dist/collection/collection-manifest.json +3 -2
  49. package/dist/collection/components/navigation/{z-navigation-tab/styles.css → tabs/navigation-tab.css} +34 -29
  50. package/dist/collection/components/navigation/tabs/z-navigation-tab/index.js +239 -0
  51. package/dist/collection/components/navigation/tabs/z-navigation-tab-link/index.js +271 -0
  52. package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.js +207 -0
  53. package/dist/collection/components/navigation/{z-navigation-tabs → tabs/z-navigation-tabs}/styles.css +11 -10
  54. package/dist/esm/{index-5fef5bc0.js → index-22f4a844.js} +11 -11
  55. package/dist/esm/index.js +2 -2
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/esm/{utils-9d3aa32a.js → utils-259e2dd9.js} +1 -1
  58. package/dist/esm/web-components-library.js +1 -1
  59. package/dist/esm/z-app-switcher_11.entry.js +1 -1
  60. package/dist/esm/z-aria-alert.entry.js +1 -1
  61. package/dist/esm/z-avatar.entry.js +1 -1
  62. package/dist/esm/z-button-filter_5.entry.js +2 -2
  63. package/dist/esm/z-chip.entry.js +1 -1
  64. package/dist/esm/z-combobox.entry.js +2 -2
  65. package/dist/esm/z-contextual-menu.entry.js +1 -1
  66. package/dist/esm/z-cookiebar.entry.js +1 -1
  67. package/dist/esm/z-date-picker.entry.js +1 -1
  68. package/dist/esm/z-file-upload.entry.js +2 -2
  69. package/dist/esm/z-file.entry.js +2 -2
  70. package/dist/esm/z-footer.entry.js +1 -1
  71. package/dist/esm/z-list_3.entry.js +1 -1
  72. package/dist/esm/z-menu-dropdown_2.entry.js +2 -2
  73. package/dist/esm/z-messages-pocket.entry.js +1 -1
  74. package/dist/esm/z-modal-login.entry.js +1 -1
  75. package/dist/esm/z-myz-card-alert.entry.js +1 -1
  76. package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
  77. package/dist/esm/z-myz-card-footer.entry.js +1 -1
  78. package/dist/esm/z-myz-card-info.entry.js +2 -2
  79. package/dist/esm/z-myz-card_4.entry.js +1 -1
  80. package/dist/esm/z-myz-list-item.entry.js +2 -2
  81. package/dist/esm/z-myz-topbar.entry.js +1 -1
  82. package/dist/esm/z-navigation-tab-link.entry.js +66 -0
  83. package/dist/esm/z-navigation-tab.entry.js +35 -8
  84. package/dist/esm/z-navigation-tabs.entry.js +76 -48
  85. package/dist/esm/z-otp.entry.js +1 -1
  86. package/dist/esm/z-pagination-bar.entry.js +2 -2
  87. package/dist/esm/z-pocket_3.entry.js +2 -2
  88. package/dist/esm/z-popover.entry.js +2 -2
  89. package/dist/esm/z-section-title.entry.js +1 -1
  90. package/dist/esm/z-slideshow.entry.js +2 -2
  91. package/dist/esm/z-status-tag.entry.js +1 -1
  92. package/dist/esm/z-table-cell.entry.js +1 -1
  93. package/dist/esm/z-table-header.entry.js +2 -2
  94. package/dist/esm/z-table-row.entry.js +1 -1
  95. package/dist/esm/z-table.entry.js +1 -1
  96. package/dist/esm/z-toast-notification-list.entry.js +1 -1
  97. package/dist/esm/z-toast-notification.entry.js +1 -1
  98. package/dist/esm/z-toggle-switch.entry.js +2 -2
  99. package/dist/esm/z-tooltip.entry.js +1 -1
  100. package/dist/types/beans/index.d.ts +4 -4
  101. package/dist/types/components/navigation/tabs/z-navigation-tab/index.d.ts +48 -0
  102. package/dist/types/components/navigation/tabs/z-navigation-tab-link/index.d.ts +56 -0
  103. package/dist/types/components/navigation/tabs/z-navigation-tabs/index.d.ts +68 -0
  104. package/dist/types/components.d.ts +147 -13
  105. package/dist/web-components-library/index.esm.js +1 -1
  106. package/dist/web-components-library/{p-70fda8d4.entry.js → p-0177caf2.entry.js} +1 -1
  107. package/dist/web-components-library/{p-2fbbabae.entry.js → p-01a23d8c.entry.js} +1 -1
  108. package/dist/web-components-library/{p-4f06bdb1.entry.js → p-02145727.entry.js} +1 -1
  109. package/{www/build/p-57d62830.entry.js → dist/web-components-library/p-0b0a358a.entry.js} +1 -1
  110. package/dist/web-components-library/p-0fc6feaf.entry.js +1 -0
  111. package/dist/web-components-library/{p-c55157a0.entry.js → p-10a2a9fe.entry.js} +1 -1
  112. package/dist/web-components-library/{p-5f179a34.entry.js → p-157885b1.entry.js} +1 -1
  113. package/dist/web-components-library/p-1b34d655.entry.js +1 -0
  114. package/dist/web-components-library/{p-89cfc0a8.entry.js → p-240561e7.entry.js} +1 -1
  115. package/dist/web-components-library/p-298d324a.entry.js +1 -0
  116. package/dist/web-components-library/{p-4e4cd7f4.entry.js → p-2d325b9b.entry.js} +1 -1
  117. package/dist/web-components-library/{p-207f741f.entry.js → p-30c0f3f2.entry.js} +1 -1
  118. package/dist/web-components-library/{p-55e762bf.entry.js → p-35c4d277.entry.js} +1 -1
  119. package/{www/build/p-9c5b1ff6.entry.js → dist/web-components-library/p-3bc3f32e.entry.js} +1 -1
  120. package/dist/web-components-library/{p-ac8185d4.entry.js → p-4a360730.entry.js} +1 -1
  121. package/dist/web-components-library/{p-007504c5.entry.js → p-4c7250a9.entry.js} +1 -1
  122. package/dist/web-components-library/{p-4cc87fd0.entry.js → p-4e270984.entry.js} +1 -1
  123. package/dist/web-components-library/{p-e7847ab0.entry.js → p-4ef4c8ef.entry.js} +1 -1
  124. package/dist/web-components-library/{p-712c320a.entry.js → p-4f64af13.entry.js} +1 -1
  125. package/dist/web-components-library/{p-eaa6346b.entry.js → p-58091e1c.entry.js} +1 -1
  126. package/dist/web-components-library/{p-3c0a76b4.entry.js → p-5b2d0ccb.entry.js} +1 -1
  127. package/dist/web-components-library/{p-46ffaa5c.entry.js → p-61ba9cc7.entry.js} +1 -1
  128. package/dist/web-components-library/{p-ffcee00e.entry.js → p-782d01c1.entry.js} +1 -1
  129. package/{www/build/p-23438a53.entry.js → dist/web-components-library/p-7efeb668.entry.js} +1 -1
  130. package/dist/web-components-library/{p-f9196dd5.entry.js → p-814d6b43.entry.js} +1 -1
  131. package/dist/web-components-library/{p-489b248e.entry.js → p-88bc3cf2.entry.js} +1 -1
  132. package/dist/web-components-library/{p-db485c6c.entry.js → p-904375ec.entry.js} +1 -1
  133. package/dist/web-components-library/{p-b59924c0.entry.js → p-9777ec0b.entry.js} +1 -1
  134. package/dist/web-components-library/{p-c8f73284.entry.js → p-9d279248.entry.js} +1 -1
  135. package/dist/web-components-library/{p-df9ef43e.entry.js → p-a6c68018.entry.js} +1 -1
  136. package/dist/web-components-library/{p-e6240652.entry.js → p-b260e143.entry.js} +1 -1
  137. package/dist/web-components-library/{p-965c3ccc.entry.js → p-c196c340.entry.js} +1 -1
  138. package/dist/web-components-library/{p-9d68a948.entry.js → p-c3771cc7.entry.js} +1 -1
  139. package/dist/web-components-library/{p-86e25e99.entry.js → p-c5d6450e.entry.js} +1 -1
  140. package/dist/web-components-library/{p-9fabd2ed.js → p-d2da11f4.js} +1 -1
  141. package/dist/web-components-library/{p-27795c58.js → p-d34e101f.js} +1 -1
  142. package/dist/web-components-library/{p-537d81aa.entry.js → p-d4440420.entry.js} +1 -1
  143. package/{www/build/p-306865df.entry.js → dist/web-components-library/p-d502063b.entry.js} +1 -1
  144. package/dist/web-components-library/{p-75278ab8.entry.js → p-e4dce41a.entry.js} +1 -1
  145. package/dist/web-components-library/{p-5bf347d4.entry.js → p-eafa01a1.entry.js} +1 -1
  146. package/{www/build/p-d1230b51.entry.js → dist/web-components-library/p-ec361ccf.entry.js} +1 -1
  147. package/dist/web-components-library/{p-0406567e.entry.js → p-ef22d940.entry.js} +1 -1
  148. package/dist/web-components-library/{p-fafc4c81.entry.js → p-feb6ee16.entry.js} +1 -1
  149. package/dist/web-components-library/web-components-library.esm.js +1 -1
  150. package/package.json +1 -1
  151. package/react/components.d.ts +1 -0
  152. package/react/components.js +2 -1
  153. package/react/components.js.map +1 -1
  154. package/www/build/index.esm.js +1 -1
  155. package/www/build/{p-70fda8d4.entry.js → p-0177caf2.entry.js} +1 -1
  156. package/www/build/{p-2fbbabae.entry.js → p-01a23d8c.entry.js} +1 -1
  157. package/www/build/{p-4f06bdb1.entry.js → p-02145727.entry.js} +1 -1
  158. package/{dist/web-components-library/p-57d62830.entry.js → www/build/p-0b0a358a.entry.js} +1 -1
  159. package/www/build/p-0fc6feaf.entry.js +1 -0
  160. package/www/build/{p-c55157a0.entry.js → p-10a2a9fe.entry.js} +1 -1
  161. package/www/build/{p-5f179a34.entry.js → p-157885b1.entry.js} +1 -1
  162. package/www/build/p-1b34d655.entry.js +1 -0
  163. package/www/build/{p-89cfc0a8.entry.js → p-240561e7.entry.js} +1 -1
  164. package/www/build/p-298d324a.entry.js +1 -0
  165. package/www/build/{p-4e4cd7f4.entry.js → p-2d325b9b.entry.js} +1 -1
  166. package/www/build/{p-207f741f.entry.js → p-30c0f3f2.entry.js} +1 -1
  167. package/www/build/{p-55e762bf.entry.js → p-35c4d277.entry.js} +1 -1
  168. package/{dist/web-components-library/p-9c5b1ff6.entry.js → www/build/p-3bc3f32e.entry.js} +1 -1
  169. package/www/build/{p-ac8185d4.entry.js → p-4a360730.entry.js} +1 -1
  170. package/www/build/{p-007504c5.entry.js → p-4c7250a9.entry.js} +1 -1
  171. package/www/build/{p-4cc87fd0.entry.js → p-4e270984.entry.js} +1 -1
  172. package/www/build/{p-e7847ab0.entry.js → p-4ef4c8ef.entry.js} +1 -1
  173. package/www/build/{p-712c320a.entry.js → p-4f64af13.entry.js} +1 -1
  174. package/www/build/p-53add5a8.js +1 -0
  175. package/www/build/{p-eaa6346b.entry.js → p-58091e1c.entry.js} +1 -1
  176. package/www/build/{p-3c0a76b4.entry.js → p-5b2d0ccb.entry.js} +1 -1
  177. package/www/build/{p-46ffaa5c.entry.js → p-61ba9cc7.entry.js} +1 -1
  178. package/www/build/{p-ffcee00e.entry.js → p-782d01c1.entry.js} +1 -1
  179. package/{dist/web-components-library/p-23438a53.entry.js → www/build/p-7efeb668.entry.js} +1 -1
  180. package/www/build/{p-f9196dd5.entry.js → p-814d6b43.entry.js} +1 -1
  181. package/www/build/{p-489b248e.entry.js → p-88bc3cf2.entry.js} +1 -1
  182. package/www/build/{p-db485c6c.entry.js → p-904375ec.entry.js} +1 -1
  183. package/www/build/{p-b59924c0.entry.js → p-9777ec0b.entry.js} +1 -1
  184. package/www/build/{p-c8f73284.entry.js → p-9d279248.entry.js} +1 -1
  185. package/www/build/{p-df9ef43e.entry.js → p-a6c68018.entry.js} +1 -1
  186. package/www/build/{p-e6240652.entry.js → p-b260e143.entry.js} +1 -1
  187. package/www/build/{p-965c3ccc.entry.js → p-c196c340.entry.js} +1 -1
  188. package/www/build/{p-9d68a948.entry.js → p-c3771cc7.entry.js} +1 -1
  189. package/www/build/{p-86e25e99.entry.js → p-c5d6450e.entry.js} +1 -1
  190. package/www/build/{p-9fabd2ed.js → p-d2da11f4.js} +1 -1
  191. package/www/build/{p-27795c58.js → p-d34e101f.js} +1 -1
  192. package/www/build/{p-537d81aa.entry.js → p-d4440420.entry.js} +1 -1
  193. package/{dist/web-components-library/p-306865df.entry.js → www/build/p-d502063b.entry.js} +1 -1
  194. package/www/build/{p-75278ab8.entry.js → p-e4dce41a.entry.js} +1 -1
  195. package/www/build/{p-5bf347d4.entry.js → p-eafa01a1.entry.js} +1 -1
  196. package/{dist/web-components-library/p-d1230b51.entry.js → www/build/p-ec361ccf.entry.js} +1 -1
  197. package/www/build/{p-0406567e.entry.js → p-ef22d940.entry.js} +1 -1
  198. package/www/build/{p-fafc4c81.entry.js → p-feb6ee16.entry.js} +1 -1
  199. package/www/build/web-components-library.esm.js +1 -1
  200. package/www/index.html +1 -1
  201. package/CHANGELOG.md +0 -1515
  202. package/dist/collection/components/navigation/z-navigation-tab/index.js +0 -151
  203. package/dist/collection/components/navigation/z-navigation-tabs/index.js +0 -179
  204. package/dist/types/components/navigation/z-navigation-tab/index.d.ts +0 -16
  205. package/dist/types/components/navigation/z-navigation-tabs/index.d.ts +0 -32
  206. package/dist/web-components-library/p-624062ac.entry.js +0 -1
  207. package/dist/web-components-library/p-cd88c42b.entry.js +0 -1
  208. package/src-react/index.ts +0 -1
  209. package/www/build/p-1e04617b.js +0 -1
  210. package/www/build/p-624062ac.entry.js +0 -1
  211. package/www/build/p-cd88c42b.entry.js +0 -1
@@ -1,10 +1,15 @@
1
- button {
1
+ *::before,
2
+ *::after {
3
+ box-sizing: border-box;
4
+ }
5
+
6
+ :host > * {
2
7
  position: relative;
3
8
  z-index: 0;
4
- display: flex;
9
+ display: inline-flex;
5
10
  align-items: center;
6
11
  justify-content: center;
7
- width: 100%;
12
+ width: auto;
8
13
  margin: 0;
9
14
  padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 5);
10
15
  background-color: unset;
@@ -22,51 +27,54 @@ button {
22
27
  cursor: pointer;
23
28
  }
24
29
 
25
- *::before,
26
- *::after {
27
- box-sizing: border-box;
30
+ :host > a {
31
+ text-decoration: none;
28
32
  }
29
33
 
30
- :host(:hover:not([disabled])) button,
31
- :host([selected]) button {
34
+ :host(:not([disabled]):hover) > *,
35
+ :host([selected]) > * {
32
36
  color: var(--color-hover-secondary);
33
37
  fill: currentColor;
34
38
  }
35
39
 
36
- :host(:hover:not([disabled])) button::after,
37
- :host([selected]) button::after {
40
+ :host(:not([disabled]):hover) > *::after,
41
+ :host([selected]) > *::after {
38
42
  content: '';
39
43
  position: absolute;
40
44
  background-color: var(--color-hover-secondary);
41
45
  }
42
46
 
43
- :host([orientation='horizontal']:not([disabled]):hover) button::after,
44
- :host([orientation='horizontal'][selected]) button::after {
47
+ :host([orientation='horizontal']:not([disabled]):hover) > *::after,
48
+ :host([orientation='horizontal'][selected]) > *::after {
45
49
  bottom: 0;
46
50
  left: 0;
47
51
  width: 100%;
48
52
  height: var(--border-size-large);
49
53
  }
50
54
 
51
- ::slotted(z-icon) {
55
+ slot[name="icon"] z-icon,
56
+ ::slotted([slot="icon"]) {
52
57
  --z-icon-width: calc(var(--space-unit) * 2);
53
58
  --z-icon-height: calc(var(--space-unit) * 2);
59
+
60
+ display: flex;
54
61
  margin: 0;
55
62
  }
56
63
 
57
- :host([orientation='horizontal']) ::slotted(z-icon) {
64
+ :host([orientation='horizontal']) slot[name="icon"] z-icon,
65
+ :host([orientation='horizontal']) ::slotted([slot="icon"]) {
58
66
  margin-right: var(--space-unit);
59
67
  }
60
68
 
61
- :host(:hover:not([disabled])) button {
69
+ :host(:not([disabled]):hover) > * {
62
70
  background-color: var(--color-background);
63
71
  }
64
72
 
65
- button:focus:focus-visible {
73
+ > *:focus:focus-visible {
66
74
  box-shadow: var(--shadow-focus-primary);
67
75
  }
68
76
 
69
- :host([disabled]) button {
77
+ :host([disabled]) > * {
70
78
  pointer-events: all;
71
79
  cursor: not-allowed;
72
80
  color: var(--gray500);
@@ -74,39 +82,36 @@ button:focus:focus-visible {
74
82
  }
75
83
 
76
84
  /* Size small (only available for horizontal) */
77
- :host([size='small']) button {
85
+ :host([size='small']) > * {
78
86
  font-size: var(--font-size-2);
79
87
  line-height: 1.4;
80
88
  letter-spacing: 0.16px;
81
89
  }
82
90
 
83
- :host([size='small'][orientation='horizontal']) button {
91
+ :host([size='small'][orientation='horizontal']) > * {
84
92
  padding: var(--space-unit) calc(var(--space-unit) * 2);
85
93
  }
86
94
 
87
- :host([size='small'][orientation='horizontal']:not([disabled]):hover) button::after,
88
- :host([size='small'][orientation='horizontal'][selected]) button::after {
95
+ :host([size='small'][orientation='horizontal']:not([disabled]):hover) > *::after,
96
+ :host([size='small'][orientation='horizontal'][selected]) > *::after {
89
97
  height: var(--border-size-medium);
90
98
  }
91
99
 
92
- :host([size='small']:not([orientation='vertical'])) ::slotted(z-icon) {
100
+ :host([size='small']:not([orientation='vertical'])) slot[name="icon"] z-icon,
101
+ :host([size='small']:not([orientation='vertical'])) ::slotted([slot="icon"]) {
93
102
  --z-icon-width: 14px;
94
103
  --z-icon-height: 14px;
95
104
  }
96
105
 
97
106
  /* Orientation Vertical */
98
- :host([orientation='vertical']) button {
107
+ :host([orientation='vertical']) > * {
99
108
  padding: calc(var(--space-unit) * 3) calc(var(--space-unit) * 2);
100
109
  }
101
110
 
102
- :host([orientation='vertical']:hover:not([disabled])) button::after,
103
- :host([orientation='vertical'][selected]) button::after {
111
+ :host([orientation='vertical']:hover:not([disabled])) > *::after,
112
+ :host([orientation='vertical'][selected]) > *::after {
104
113
  width: var(--border-size-large);
105
114
  height: 100%;
106
115
  top: 0;
107
116
  right: 0;
108
117
  }
109
-
110
- :host([orientation='vertical']) ::slotted([slot='label']) {
111
- display: none;
112
- }
@@ -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
+ }