@zanichelli/albe-web-components 10.0.7 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/cjs/{icons-7da210ed.js → icons-b3352331.js} +77 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/web-components-library.cjs.js +1 -1
  4. package/dist/cjs/z-app-header_11.cjs.entry.js +4 -4
  5. package/dist/cjs/z-navigation-tab-link.cjs.entry.js +6 -3
  6. package/dist/cjs/z-navigation-tab.cjs.entry.js +2 -2
  7. package/dist/cjs/z-navigation-tabs.cjs.entry.js +108 -96
  8. package/dist/cjs/z-popover.cjs.entry.js +2 -2
  9. package/dist/collection/collection-manifest.json +3 -3
  10. package/dist/collection/components/icons/icons.js +77 -0
  11. package/dist/collection/components/inputs/z-searchbar/styles.css +1 -1
  12. package/dist/collection/components/navigation/z-app-header/index.js +3 -2
  13. package/dist/collection/components/navigation/z-app-header/styles.css +9 -1
  14. package/dist/collection/components/navigation/z-navigation-tabs/index.js +335 -0
  15. package/dist/collection/components/navigation/z-navigation-tabs/index.stories.js +12 -0
  16. package/dist/collection/components/navigation/z-navigation-tabs/styles.css +212 -0
  17. package/dist/collection/components/z-popover/index.js +2 -2
  18. package/dist/collection/{components/navigation/tabs → deprecated}/navigation-tab.css +5 -4
  19. package/dist/collection/deprecated/z-link/index.js +1 -0
  20. package/dist/collection/{components/navigation/tabs → deprecated}/z-navigation-tab/index.js +8 -5
  21. package/dist/collection/{components/navigation/tabs → deprecated}/z-navigation-tab-link/index.js +7 -3
  22. package/dist/esm/{icons-4b57811d.js → icons-6b29d7ea.js} +77 -0
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/esm/web-components-library.js +1 -1
  25. package/dist/esm/z-app-header_11.entry.js +4 -4
  26. package/dist/esm/z-navigation-tab-link.entry.js +6 -3
  27. package/dist/esm/z-navigation-tab.entry.js +2 -2
  28. package/dist/esm/z-navigation-tabs.entry.js +110 -98
  29. package/dist/esm/z-popover.entry.js +2 -2
  30. package/dist/types/components/icons/icons.d.ts +154 -1
  31. package/dist/types/components/navigation/z-app-header/index.d.ts +2 -1
  32. package/dist/types/components/navigation/{tabs/z-navigation-tabs → z-navigation-tabs}/index.d.ts +43 -31
  33. package/dist/types/components.d.ts +20 -2
  34. package/dist/types/deprecated/z-link/index.d.ts +1 -0
  35. package/dist/types/{components/navigation/tabs → deprecated}/z-navigation-tab/index.d.ts +2 -1
  36. package/dist/types/{components/navigation/tabs → deprecated}/z-navigation-tab-link/index.d.ts +2 -1
  37. package/dist/web-components-library/p-0b1c8f55.entry.js +1 -0
  38. package/dist/web-components-library/p-31a19318.entry.js +1 -0
  39. package/dist/web-components-library/p-6c452dbc.entry.js +1 -0
  40. package/dist/web-components-library/p-9f2bfd3b.entry.js +1 -0
  41. package/dist/web-components-library/{p-f5b5f897.entry.js → p-a69d9a1c.entry.js} +1 -1
  42. package/dist/web-components-library/p-e90c27f8.js +1 -0
  43. package/dist/web-components-library/web-components-library.css +1 -1
  44. package/dist/web-components-library/web-components-library.esm.js +1 -1
  45. package/package.json +1 -1
  46. package/www/build/p-0b1c8f55.entry.js +1 -0
  47. package/www/build/p-31a19318.entry.js +1 -0
  48. package/www/build/{p-d7785559.js → p-5db9e573.js} +1 -1
  49. package/www/build/{p-06f4a3d5.css → p-5fcf6d3b.css} +1 -1
  50. package/www/build/p-6c452dbc.entry.js +1 -0
  51. package/www/build/p-9f2bfd3b.entry.js +1 -0
  52. package/www/build/{p-f5b5f897.entry.js → p-a69d9a1c.entry.js} +1 -1
  53. package/www/build/p-e90c27f8.js +1 -0
  54. package/www/build/web-components-library.css +1 -1
  55. package/www/build/web-components-library.esm.js +1 -1
  56. package/www/index.html +1 -1
  57. package/CHANGELOG.md +0 -2751
  58. package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.js +0 -291
  59. package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.stories.js +0 -11
  60. package/dist/collection/components/navigation/tabs/z-navigation-tabs/styles.css +0 -102
  61. package/dist/web-components-library/p-0d2c1891.entry.js +0 -1
  62. package/dist/web-components-library/p-0d38e9a8.js +0 -1
  63. package/dist/web-components-library/p-36487afc.entry.js +0 -1
  64. package/dist/web-components-library/p-5505a3c0.entry.js +0 -1
  65. package/dist/web-components-library/p-fa7b1ee3.entry.js +0 -1
  66. package/src-react/index.ts +0 -1
  67. package/www/build/p-0d2c1891.entry.js +0 -1
  68. package/www/build/p-0d38e9a8.js +0 -1
  69. package/www/build/p-36487afc.entry.js +0 -1
  70. package/www/build/p-5505a3c0.entry.js +0 -1
  71. package/www/build/p-fa7b1ee3.entry.js +0 -1
@@ -5,11 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-e3299e0a.js');
6
6
  const index$1 = require('./index-e8ce94a1.js');
7
7
 
8
- const stylesCss = ":host{--z-navigation-tabs-nav-buttons-bg:var(--color-white);--z-navigation-tabs-nav-buttons-fg:var(--color-primary01);position:relative;z-index:0;display:flex;overflow:hidden;flex-direction:row;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host,:host *,::slotted(*){box-sizing:border-box}::-webkit-scrollbar{display:none}.navigation-button{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:0;background:var(--z-navigation-tabs-nav-buttons-bg);border-radius:var(--border-no-radius);box-shadow:0 0 4px 1px var(--shadow-color-base);cursor:pointer;fill:var(--z-navigation-tabs-nav-buttons-fg);outline:none}.navigation-button:disabled{display:none}nav{display:flex;overflow:auto;align-items:center;justify-content:flex-start;scroll-behavior:smooth;scrollbar-width:none}:host([orientation=\"horizontal\"]) nav{width:100%}:host([orientation=\"horizontal\"]) .navigation-button{top:0;width:calc(var(--space-unit) * 4);height:100%}:host([orientation=\"horizontal\"]) .navigation-button:first-child{left:0}:host([orientation=\"horizontal\"]) .navigation-button:last-child{right:0}:host([orientation=\"vertical\"]){width:fit-content;flex-direction:column}:host([orientation=\"vertical\"]) nav{height:100%;flex-direction:column;align-items:stretch}:host([orientation=\"vertical\"]) .navigation-button{left:0;width:100%;height:calc(var(--space-unit) * 4)}:host([orientation=\"vertical\"]) .navigation-button:first-child{top:0}:host([orientation=\"vertical\"]) .navigation-button:last-child{bottom:0}:host([size=\"small\"][orientation=\"vertical\"]) .navigation-button{height:calc(var(--space-unit) * 4)}";
8
+ const stylesCss = "z-navigation-tabs{position:relative;z-index:0;display:flex;overflow:hidden;flex-direction:row;font-family:var(--font-family-sans);font-weight:var(--font-rg)}z-navigation-tabs,z-navigation-tabs *{box-sizing:border-box}z-navigation-tabs>nav::-webkit-scrollbar{display:none}.navigation-button{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:0;background-color:var(--z-navigation-tabs-nav-buttons-bg, var(--color-surface01));border-radius:var(--border-no-radius);box-shadow:0 0 4px 1px var(--shadow-color-base);cursor:pointer;fill:var(--z-navigation-tabs-nav-buttons-fg, var(--color-primary01));outline:none}z-navigation-tabs .navigation-button:disabled{display:none}z-navigation-tabs>nav{z-index:0;display:flex;overflow:auto;align-items:center;justify-content:flex-start;scroll-behavior:smooth;scrollbar-width:none}z-navigation-tabs[orientation=\"horizontal\"]>nav{width:100%}z-navigation-tabs[orientation=\"horizontal\"] .navigation-button{top:0;width:calc(var(--space-unit) * 4);height:100%}z-navigation-tabs[orientation=\"horizontal\"] .navigation-button:first-child{left:0}z-navigation-tabs[orientation=\"horizontal\"] .navigation-button:last-child{right:0}z-navigation-tabs[orientation=\"vertical\"]{width:fit-content;flex-direction:column}z-navigation-tabs[orientation=\"vertical\"]>nav{height:100%;flex-direction:column;align-items:stretch}z-navigation-tabs[orientation=\"vertical\"] .navigation-button{left:0;width:100%;height:calc(var(--space-unit) * 4)}z-navigation-tabs[orientation=\"vertical\"] .navigation-button:first-child{top:0}z-navigation-tabs[orientation=\"vertical\"] .navigation-button:last-child{bottom:0}z-navigation-tabs[size=\"small\"][orientation=\"vertical\"] .navigation-button{height:calc(var(--space-unit) * 4)}z-navigation-tabs>nav>*{position:relative;z-index:0;display:inline-flex;width:auto;align-items:center;justify-content:center;padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 5);border:none;margin:0;background-color:unset;border-radius:var(--border-no-radius);color:var(--color-primary01);cursor:pointer;fill:currentcolor;font-family:var(--font-family-sans);font-size:inherit;gap:var(--space-unit);letter-spacing:inherit;line-height:inherit;outline:none;text-align:center;white-space:nowrap}z-navigation-tabs>nav>a{text-decoration:none}z-navigation-tabs>nav>*:focus:focus-visible{z-index:1;box-shadow:inset 0 0 4px 3px var(--color-highlight)}z-navigation-tabs>nav>:not([disabled]):hover{background-color:var(--color-surface02)}z-navigation-tabs>nav>button[disabled]{color:var(--color-disabled03);cursor:not-allowed;fill:currentcolor;pointer-events:all}z-navigation-tabs>nav>:not([disabled]):hover,nav>[aria-selected=\"true\"]{color:var(--color-hover-secondary);fill:currentcolor}z-navigation-tabs>nav>:not([disabled]):hover::after,nav>[aria-selected=\"true\"]::after{position:absolute;background-color:var(--color-hover-secondary);content:\"\"}z-navigation-tabs[orientation=\"horizontal\"]>nav>:not([disabled]):hover::after,z-navigation-tabs[orientation=\"horizontal\"]>nav>[aria-selected=\"true\"]::after{bottom:0;left:0;width:100%;height:var(--border-size-large)}z-navigation-tabs>nav>* z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);display:flex;margin:0}z-navigation-tabs[size=\"small\"][orientation=\"horizontal\"]>nav>*{padding:var(--space-unit) calc(var(--space-unit) * 2)}z-navigation-tabs[size=\"small\"][orientation=\"horizontal\"]>nav>:not([disabled]):hover::after,z-navigation-tabs[size=\"small\"][orientation=\"horizontal\"]>nav>[aria-selected=\"true\"]::after{height:var(--border-size-medium)}z-navigation-tabs[size=\"small\"]:not([orientation=\"vertical\"])>nav>* z-icon{--z-icon-width:14px;--z-icon-height:14px}z-navigation-tabs[orientation=\"vertical\"]>nav>*{padding:calc(var(--space-unit) * 3) calc(var(--space-unit) * 2)}z-navigation-tabs[orientation=\"vertical\"]>nav>*>:not(z-icon){display:none}z-navigation-tabs[orientation=\"vertical\"]>nav>:not([disabled]):hover::after,z-navigation-tabs[orientation=\"vertical\"]>nav>[aria-selected=\"true\"]::after{top:0;right:0;width:var(--border-size-large);height:100%}";
9
9
 
10
10
  const ZNavigationTabs = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
+ this.selected = index.createEvent(this, "selected", 7);
13
14
  /**
14
15
  * Navigation tabs orientation.
15
16
  */
@@ -18,6 +19,14 @@ const ZNavigationTabs = class {
18
19
  * Navigation tabs size.
19
20
  */
20
21
  this.size = index$1.NavigationTabsSize.BIG;
22
+ /**
23
+ * Index of the selected tab.
24
+ */
25
+ this.selectedTab = undefined;
26
+ /**
27
+ * Index of the last tab that held focus.
28
+ */
29
+ this.focusedTab = 0;
21
30
  }
22
31
  /**
23
32
  * Getter for the direction to check based on current orientation.
@@ -32,158 +41,161 @@ const ZNavigationTabs = class {
32
41
  return this.orientation == index$1.NavigationTabsOrientation.HORIZONTAL ? "Width" : "Height";
33
42
  }
34
43
  get tabs() {
35
- return Array.from(this.host.children);
44
+ return Array.from(this.nav.children);
36
45
  }
37
46
  /**
38
- * Set the `size` prop to all `z-navigation-tab` children.
47
+ * Scroll into view to center the tab.
39
48
  */
40
- setChildrenSize() {
41
- this.tabs.forEach((tab) => {
42
- tab.size = this.size;
49
+ scrollToTab(tabElement) {
50
+ const scrollOptions = (this.orientation === index$1.NavigationTabsOrientation.HORIZONTAL
51
+ ? { block: "nearest", inline: "center" }
52
+ : { block: "center", inline: "nearest" });
53
+ tabElement.scrollIntoView(Object.assign({ behavior: "smooth" }, scrollOptions));
54
+ }
55
+ /**
56
+ * Scroll the navigation bar half of its size backward.
57
+ */
58
+ navigateBackwards() {
59
+ this.nav.scrollBy({
60
+ [this.direction.toLowerCase()]: 0 - this.nav[`client${this.dimension}`] / 2,
61
+ behavior: "smooth",
43
62
  });
44
63
  }
45
64
  /**
46
- * Set the `orientation` prop to all `z-navigation-tab` children.
65
+ * Scroll the navigation bar half of its size forward.
47
66
  */
48
- setChildrenOrientation() {
49
- this.tabs.forEach((tab) => {
50
- tab.orientation = this.orientation;
67
+ navigateForward() {
68
+ this.nav.scrollBy({
69
+ [this.direction.toLowerCase()]: this.nav[`scroll${this.direction}`] + this.nav[`client${this.dimension}`] / 2,
70
+ behavior: "smooth",
51
71
  });
52
72
  }
53
73
  /**
54
- * Check if the navigation buttons are needed on window resize.
74
+ * Check if a keyboard event was triggered by an arrow key.
55
75
  */
56
- checkScrollVisible() {
57
- if (!this.tabsNav) {
58
- return;
59
- }
60
- this.canNavigate = this.tabsNav[`scroll${this.dimension}`] > this.tabsNav[`client${this.dimension}`];
76
+ isArrowNavigation(e) {
77
+ return Object.values(index$1.NavigationTabsKeyboardEvents).includes(e.key);
61
78
  }
62
79
  /**
63
80
  * Check if navigation buttons can be enabled for each direction.
64
81
  */
65
82
  checkScrollEnabled() {
66
- if (!this.tabsNav) {
83
+ if (!this.nav) {
67
84
  return;
68
85
  }
69
86
  this.canNavigateNext =
70
- this.tabsNav[`scroll${this.direction}`] + this.tabsNav[`client${this.dimension}`] <
71
- this.tabsNav[`scroll${this.dimension}`];
72
- this.canNavigatePrev = this.tabsNav[`scroll${this.direction}`] > 0;
87
+ this.nav[`scroll${this.direction}`] + this.nav[`client${this.dimension}`] < this.nav[`scroll${this.dimension}`];
88
+ this.canNavigatePrev = this.nav[`scroll${this.direction}`] > 0;
73
89
  }
74
90
  /**
75
- * Listen for child tab selection.
76
- * Deselect all other previously selected tabs,
77
- * then scroll to the new selected tab and center it.
78
- * @param {CustomEvent} event `selected` event triggered by a child tab
91
+ * When the selected tab changes, update the `aria-selected` attribute on each tab and scroll to the selected tab.
79
92
  */
80
- onTabSelected(event) {
81
- const selectedTab = event.target;
93
+ onTabSelected() {
82
94
  this.tabs.forEach((tab, i) => {
83
- if (tab !== selectedTab) {
84
- tab.selected = undefined;
85
- }
86
- else {
87
- this.tabFocus = i;
95
+ const zicon = tab.querySelector("z-icon");
96
+ const strokeIcon = zicon === null || zicon === void 0 ? void 0 : zicon.getAttribute("name").replace("-filled", "");
97
+ if (i !== this.selectedTab) {
98
+ tab.setAttribute("aria-selected", "false");
99
+ tab.tabIndex = -1;
100
+ zicon === null || zicon === void 0 ? void 0 : zicon.setAttribute("name", strokeIcon);
101
+ return;
88
102
  }
103
+ zicon === null || zicon === void 0 ? void 0 : zicon.setAttribute("name", `${strokeIcon}-filled`);
104
+ tab.tabIndex = 0;
105
+ tab.setAttribute("aria-selected", "true");
89
106
  });
107
+ this.scrollToTab(this.tabs[this.selectedTab]);
108
+ this.selected.emit(this.selectedTab);
90
109
  }
91
110
  /**
92
- * Scroll the navigation bar half of its size backward.
111
+ * Check if the navigation buttons are needed on window resize.
93
112
  */
94
- navigateBackwards() {
95
- this.tabsNav.scrollBy({
96
- [this.direction.toLowerCase()]: 0 - this.tabsNav[`client${this.dimension}`] / 2,
97
- behavior: "smooth",
98
- });
113
+ checkScrollVisible() {
114
+ if (!this.nav) {
115
+ return;
116
+ }
117
+ this.canNavigate = this.nav[`scroll${this.dimension}`] > this.nav[`client${this.dimension}`];
99
118
  }
100
119
  /**
101
- * Scroll the navigation bar half of its size forward.
120
+ * Handle click on the tabs.
121
+ * @param event `click` event triggered by a child tab
102
122
  */
103
- navigateForward() {
104
- this.tabsNav.scrollBy({
105
- [this.direction.toLowerCase()]: this.tabsNav[`scroll${this.direction}`] + this.tabsNav[`client${this.dimension}`] / 2,
106
- behavior: "smooth",
107
- });
123
+ handleTabClick(event) {
124
+ const clickedTab = event.target.closest("[role='tab']");
125
+ if (!this.tabs.some((child) => child.contains(clickedTab))) {
126
+ return;
127
+ }
128
+ this.selectedTab = this.tabs.indexOf(clickedTab);
108
129
  }
109
130
  /**
110
- * Move focus through tabs using keyboard arrows.
111
- * When `TAB` is pressed, focus the currently selected tab, if any.
131
+ * Move focus through tabs when an arrow key is pressed.
132
+ * When `TAB` is pressed, focus the currently selected tab if any.
112
133
  */
113
- navigateThroughTabs(e) {
114
- const tabs = this.tabs;
115
- if (e.key === index$1.KeyboardCode.TAB) {
116
- tabs.forEach((tab, i) => {
117
- if (tab.selected && tabs.some((tab) => tab === e.target)) {
118
- this.tabFocus = i;
119
- }
120
- });
121
- tabs[this.tabFocus].children[0].tabIndex = 0;
122
- tabs[this.tabFocus].children[0].focus();
134
+ navigateThroughTabs(event) {
135
+ if (!this.tabs.some((tab) => tab.contains(event.target))) {
136
+ return true;
137
+ }
138
+ if (event.key === index$1.KeyboardCode.TAB) {
139
+ this.focusedTab = this.selectedTab || 0;
140
+ this.tabs[this.focusedTab].focus({ preventScroll: true });
123
141
  return;
124
142
  }
125
- if (!this.isArrowNavigation(e)) {
143
+ if (!this.isArrowNavigation(event)) {
126
144
  return true;
127
145
  }
128
- e.preventDefault();
129
- tabs[this.tabFocus].children[0].tabIndex = -1;
130
- // Move forward
131
- if ((e.key === index$1.NavigationTabsKeyboardEvents.RIGHT && this.orientation == index$1.NavigationTabsOrientation.HORIZONTAL) ||
132
- (e.key === index$1.NavigationTabsKeyboardEvents.DOWN && this.orientation == index$1.NavigationTabsOrientation.VERTICAL)) {
133
- this.tabFocus++;
134
- if (this.tabFocus >= tabs.length) {
135
- this.tabFocus = 0;
146
+ event.preventDefault();
147
+ this.tabs[this.focusedTab].tabIndex = -1;
148
+ if ((event.key === index$1.NavigationTabsKeyboardEvents.RIGHT && this.orientation == index$1.NavigationTabsOrientation.HORIZONTAL) ||
149
+ (event.key === index$1.NavigationTabsKeyboardEvents.DOWN && this.orientation == index$1.NavigationTabsOrientation.VERTICAL)) {
150
+ // Move forward
151
+ this.focusedTab++;
152
+ if (this.focusedTab >= this.tabs.length) {
153
+ this.focusedTab = 0;
136
154
  }
137
- // Move backward
138
155
  }
139
- else if ((e.key === index$1.NavigationTabsKeyboardEvents.LEFT && this.orientation == index$1.NavigationTabsOrientation.HORIZONTAL) ||
140
- (e.key === index$1.NavigationTabsKeyboardEvents.UP && this.orientation == index$1.NavigationTabsOrientation.VERTICAL)) {
141
- this.tabFocus--;
142
- if (this.tabFocus < 0) {
143
- this.tabFocus = tabs.length - 1;
156
+ else if ((event.key === index$1.NavigationTabsKeyboardEvents.LEFT && this.orientation == index$1.NavigationTabsOrientation.HORIZONTAL) ||
157
+ (event.key === index$1.NavigationTabsKeyboardEvents.UP && this.orientation == index$1.NavigationTabsOrientation.VERTICAL)) {
158
+ // Move backward
159
+ this.focusedTab--;
160
+ if (this.focusedTab < 0) {
161
+ this.focusedTab = this.tabs.length - 1;
144
162
  }
145
163
  }
146
- // ignore disabled tabs
147
- if (tabs[this.tabFocus].disabled) {
148
- this.navigateThroughTabs(e);
149
- }
150
- else {
151
- tabs[this.tabFocus].children[0].tabIndex = 0;
152
- tabs[this.tabFocus].children[0].focus();
164
+ // Ignore disabled tabs
165
+ if (this.tabs[this.focusedTab].hasAttribute("disabled") &&
166
+ this.tabs[this.focusedTab].getAttribute("disabled") !== "false") {
167
+ return this.navigateThroughTabs(event);
153
168
  }
154
- }
155
- /**
156
- * Check if a keyboard event was triggered by an arrow key.
157
- */
158
- isArrowNavigation(e) {
159
- return Object.values(index$1.NavigationTabsKeyboardEvents).includes(e.key);
169
+ this.tabs[this.focusedTab].tabIndex = 0;
170
+ this.tabs[this.focusedTab].focus();
171
+ this.scrollToTab(this.tabs[this.focusedTab]);
160
172
  }
161
173
  componentDidRender() {
162
- this.setChildrenSize();
163
- this.setChildrenOrientation();
164
174
  this.checkScrollVisible();
165
- const tabActive = this.tabs.findIndex((tab) => tab.ariaSelected === "true");
166
- if ((!this.tabFocus && tabActive < 0) || this.tabFocus === undefined) {
167
- this.tabFocus = tabActive >= 0 ? tabActive : 0;
168
- const tabChild = this.tabs[this.tabFocus].children[0];
169
- if (tabChild) {
170
- tabChild.tabIndex = 0;
171
- }
175
+ }
176
+ componentDidLoad() {
177
+ // Set role and tabindex to each slotted tab
178
+ this.tabs.forEach((tab) => {
179
+ tab.setAttribute("role", "tab");
180
+ tab.tabIndex = -1;
181
+ });
182
+ this.tabs[0].tabIndex = 0;
183
+ if (this.selectedTab !== undefined) {
184
+ this.onTabSelected();
172
185
  }
173
186
  }
174
187
  render() {
175
188
  return (index.h(index.Host, { class: {
176
189
  "interactive-2": this.size === index$1.NavigationTabsSize.SMALL,
177
190
  "interactive-1": this.size !== index$1.NavigationTabsSize.SMALL,
178
- }, scrollable: this.canNavigate }, this.canNavigate && (index.h("button", { class: "navigation-button", onClick: this.navigateBackwards.bind(this), tabindex: "-1", disabled: !this.canNavigatePrev, "aria-label": "Mostra elementi precedenti" }, index.h("z-icon", { name: this.orientation === index$1.NavigationTabsOrientation.HORIZONTAL ? "chevron-left" : "chevron-up", width: 16, height: 16 }))), index.h("nav", { role: "tablist", "aria-label": this.ariaLabel, ref: (el) => (this.tabsNav = el !== null && el !== void 0 ? el : this.tabsNav), onScroll: this.checkScrollEnabled.bind(this), "aria-orientation": this.orientation }, index.h("slot", null)), this.canNavigate && (index.h("button", { class: "navigation-button", onClick: this.navigateForward.bind(this), onKeyDown: (e) => {
191
+ }, scrollable: this.canNavigate }, this.canNavigate && (index.h("button", { class: "navigation-button", onClick: this.navigateBackwards.bind(this), tabIndex: -1, disabled: !this.canNavigatePrev, "aria-label": "Mostra elementi precedenti" }, index.h("z-icon", { name: this.orientation === index$1.NavigationTabsOrientation.HORIZONTAL ? "chevron-left" : "chevron-up", width: 16, height: 16 }))), index.h("nav", { role: "tablist", "aria-label": this.ariaLabel, ref: (el) => (this.nav = el !== null && el !== void 0 ? el : this.nav), onScroll: this.checkScrollEnabled.bind(this), "aria-orientation": this.orientation }, index.h("slot", null)), this.canNavigate && (index.h("button", { class: "navigation-button", onClick: this.navigateForward.bind(this), onKeyDown: (e) => {
179
192
  this.navigateThroughTabs(e);
180
193
  }, tabindex: "-1", disabled: !this.canNavigateNext, "aria-label": "Mostra elementi successivi" }, index.h("z-icon", { name: this.orientation === index$1.NavigationTabsOrientation.HORIZONTAL ? "chevron-right" : "chevron-down", width: 16, height: 16 })))));
181
194
  }
182
195
  get host() { return index.getElement(this); }
183
196
  static get watchers() { return {
184
- "size": ["setChildrenSize"],
185
- "orientation": ["setChildrenOrientation"],
186
- "canNavigate": ["checkScrollEnabled"]
197
+ "canNavigate": ["checkScrollEnabled"],
198
+ "selectedTab": ["onTabSelected"]
187
199
  }; }
188
200
  };
189
201
  ZNavigationTabs.style = stylesCss;
@@ -130,7 +130,7 @@ const ZPopover = class {
130
130
  }
131
131
  if (!e.composedPath().includes(this.host)) {
132
132
  const target = e.target;
133
- const triggerElemClicked = this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(this.bindTo);
133
+ const triggerElemClicked = this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(CSS.escape(this.bindTo));
134
134
  if (triggerElemClicked) {
135
135
  e.stopPropagation();
136
136
  }
@@ -174,7 +174,7 @@ const ZPopover = class {
174
174
  setPosition() {
175
175
  let element;
176
176
  if (typeof this.bindTo === "string") {
177
- element = this.host.ownerDocument.querySelector(this.bindTo);
177
+ element = this.host.ownerDocument.querySelector(CSS.escape(this.bindTo));
178
178
  }
179
179
  else if (this.bindTo) {
180
180
  element = this.bindTo;
@@ -25,12 +25,10 @@
25
25
  "./components/list/z-toast-notification-list/index.js",
26
26
  "./components/logo/z-logo/index.js",
27
27
  "./components/modal/z-modal/index.js",
28
- "./components/navigation/tabs/z-navigation-tab/index.js",
29
- "./components/navigation/tabs/z-navigation-tab-link/index.js",
30
- "./components/navigation/tabs/z-navigation-tabs/index.js",
31
28
  "./components/navigation/z-app-header/index.js",
32
29
  "./components/navigation/z-menu/index.js",
33
30
  "./components/navigation/z-menu-section/index.js",
31
+ "./components/navigation/z-navigation-tabs/index.js",
34
32
  "./components/notification/z-info-box/index.js",
35
33
  "./components/notification/z-notification/index.js",
36
34
  "./components/notification/z-toast-notification/index.js",
@@ -64,6 +62,8 @@
64
62
  "./components/z-tag/index.js",
65
63
  "./components/z-visually-hidden/index.js",
66
64
  "./deprecated/z-link/index.js",
65
+ "./deprecated/z-navigation-tab/index.js",
66
+ "./deprecated/z-navigation-tab-link/index.js",
67
67
  "./deprecated/z-table-deprecated/z-table-body/index.js",
68
68
  "./deprecated/z-table-deprecated/z-table-cell/index.js",
69
69
  "./deprecated/z-table-deprecated/z-table-empty-box/index.js",