@zanichelli/albe-web-components 7.4.0 → 7.4.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 (75) hide show
  1. package/dist/cjs/index-e3299e0a.js +10 -2
  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_13.cjs.entry.js → z-app-header_11.cjs.entry.js} +22 -571
  5. package/dist/cjs/z-breadcrumb.cjs.entry.js +237 -0
  6. package/dist/cjs/z-popover.cjs.entry.js +328 -0
  7. package/dist/collection/components/navigation/z-app-header/index.js +1 -1
  8. package/dist/collection/components/navigation/z-app-header/styles.css +5 -0
  9. package/dist/esm/index-a2ca4b97.js +10 -2
  10. package/dist/esm/index.js +1 -1
  11. package/dist/esm/loader.js +1 -1
  12. package/dist/esm/{utils-b7bdd1bf.js → utils-825aed23.js} +1 -1
  13. package/dist/esm/web-components-library.js +1 -1
  14. package/dist/esm/{z-app-header_13.entry.js → z-app-header_11.entry.js} +24 -571
  15. package/dist/esm/z-breadcrumb.entry.js +233 -0
  16. package/dist/esm/z-chip.entry.js +1 -1
  17. package/dist/esm/z-combobox.entry.js +1 -1
  18. package/dist/esm/z-file-upload.entry.js +1 -1
  19. package/dist/esm/z-myz-card-info.entry.js +1 -1
  20. package/dist/esm/z-myz-list-item.entry.js +1 -1
  21. package/dist/esm/z-pocket_3.entry.js +1 -1
  22. package/dist/esm/z-popover.entry.js +324 -0
  23. package/dist/esm/z-select.entry.js +1 -1
  24. package/dist/esm/z-skip-to-content.entry.js +1 -1
  25. package/dist/esm/z-slideshow.entry.js +1 -1
  26. package/dist/esm/z-table-header.entry.js +1 -1
  27. package/dist/esm/z-toggle-switch.entry.js +1 -1
  28. package/dist/web-components-library/index.esm.js +1 -1
  29. package/dist/web-components-library/{p-d011d1b5.entry.js → p-0b942851.entry.js} +1 -1
  30. package/dist/web-components-library/{p-1e7ef8ca.entry.js → p-0eb7cb35.entry.js} +1 -1
  31. package/dist/web-components-library/p-0fd40ac5.entry.js +1 -0
  32. package/dist/web-components-library/{p-0397366d.js → p-14c2c56c.js} +1 -1
  33. package/dist/web-components-library/{p-0235869e.entry.js → p-2e7da553.entry.js} +1 -1
  34. package/dist/web-components-library/p-39863e41.entry.js +1 -0
  35. package/dist/web-components-library/p-447a7c51.entry.js +1 -0
  36. package/dist/web-components-library/{p-bda48953.entry.js → p-5825ef19.entry.js} +1 -1
  37. package/dist/web-components-library/p-98dcf178.entry.js +1 -0
  38. package/dist/web-components-library/p-98df8460.entry.js +1 -0
  39. package/dist/web-components-library/{p-a250409a.entry.js → p-9e400a11.entry.js} +1 -1
  40. package/dist/web-components-library/{p-485bff7b.entry.js → p-b44030d0.entry.js} +1 -1
  41. package/dist/web-components-library/p-b8a2aea6.entry.js +1 -0
  42. package/dist/web-components-library/{p-c8b36560.entry.js → p-dcad3493.entry.js} +1 -1
  43. package/dist/web-components-library/{p-c8bdfb84.entry.js → p-fa7a11fd.entry.js} +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/index.esm.js +1 -1
  47. package/www/build/{p-d011d1b5.entry.js → p-0b942851.entry.js} +1 -1
  48. package/www/build/{p-1e7ef8ca.entry.js → p-0eb7cb35.entry.js} +1 -1
  49. package/www/build/p-0fd40ac5.entry.js +1 -0
  50. package/www/build/{p-0397366d.js → p-14c2c56c.js} +1 -1
  51. package/www/build/{p-0235869e.entry.js → p-2e7da553.entry.js} +1 -1
  52. package/www/build/p-39863e41.entry.js +1 -0
  53. package/www/build/p-3d1f6711.js +1 -0
  54. package/www/build/p-447a7c51.entry.js +1 -0
  55. package/www/build/{p-bda48953.entry.js → p-5825ef19.entry.js} +1 -1
  56. package/www/build/p-98dcf178.entry.js +1 -0
  57. package/www/build/p-98df8460.entry.js +1 -0
  58. package/www/build/{p-a250409a.entry.js → p-9e400a11.entry.js} +1 -1
  59. package/www/build/{p-485bff7b.entry.js → p-b44030d0.entry.js} +1 -1
  60. package/www/build/p-b8a2aea6.entry.js +1 -0
  61. package/www/build/{p-c8b36560.entry.js → p-dcad3493.entry.js} +1 -1
  62. package/www/build/{p-c8bdfb84.entry.js → p-fa7a11fd.entry.js} +1 -1
  63. package/www/build/web-components-library.esm.js +1 -1
  64. package/www/index.html +1 -127
  65. package/CHANGELOG.md +0 -2540
  66. package/dist/web-components-library/p-14ab82cd.entry.js +0 -1
  67. package/dist/web-components-library/p-515c2acf.entry.js +0 -1
  68. package/dist/web-components-library/p-685ae50d.entry.js +0 -1
  69. package/dist/web-components-library/p-a4b91a8f.entry.js +0 -1
  70. package/src-react/index.ts +0 -1
  71. package/www/build/p-14ab82cd.entry.js +0 -1
  72. package/www/build/p-515c2acf.entry.js +0 -1
  73. package/www/build/p-685ae50d.entry.js +0 -1
  74. package/www/build/p-a4b91a8f.entry.js +0 -1
  75. package/www/build/p-e35c7022.js +0 -1
@@ -0,0 +1,237 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e3299e0a.js');
6
+ const index$1 = require('./index-b7c319f2.js');
7
+ const utils = require('./utils-38f8555a.js');
8
+ require('./breakpoints-ebe1a437.js');
9
+
10
+ const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg);--line-clamp-popover:0;--line-clamp-mobile:1}button{padding:0;border:none;margin:0;background-color:transparent}nav{display:flex;height:30px;align-items:center;padding-left:calc(var(--space-unit) / 2);overflow-x:hidden}li{display:flex;align-items:baseline}:host a:focus,:host button:focus{box-shadow:var(--shadow-focus-primary);outline:0}:host a{color:var(--color-link-primary);font-size:var(--font-size-2);text-decoration:none;white-space:nowrap}:host a.homepage-icon{display:list-item}:host a.homepage-text{display:initial}:host a.missing-path{color:var(--color-text01)}:host a.text-ellipsis{display:-webkit-box !important;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:var(--line-clamp-mobile);text-overflow:ellipsis;white-space:normal}:host ol{display:flex;padding:0;margin:0;list-style-type:none}:host ol>li:not(:last-child){margin-right:var(--space-unit)}nav.underlined>ol>li a:not(.missing-path),nav.underlined>ol>li button{text-decoration:underline}nav.semibold>ol>li a:not(.missing-path),nav.semibold>ol>li button{font-weight:var(--font-sb)}:host z-icon{margin-right:var(--space-unit);--z-icon-width:12px;--z-icon-height:12px}:host button.dots{display:inline-block;color:var(--color-link-primary);cursor:pointer}:host .popover-content{max-width:302px;padding:calc(var(--space-unit) / 2) var(--space-unit);text-align:left}:host .popover-content a{font-weight:var(--font-rg);text-decoration:none}:host .hidden-paths-popover{--z-popover-theme--surface:var(--color-surface02);--z-popover-padding:0}:host .full-path-tooltip{--z-popover-theme--surface:var(--color-surface05);--z-popover-theme--text:var(--color-text-inverse);--z-popover-padding:0}:host .tooltip-content{padding:0 var(--space-unit);font-size:var(--font-size-2)}@media (min-width: 768px){:host ol>li+li::before{display:inline-block;width:10px;height:10px;flex:1;color:var(--color-disabled03);content:\"\\203A\"}:host a.text-ellipsis{-webkit-line-clamp:var(--line-clamp-popover)}}";
11
+
12
+ const ZBreadcrumb = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.clickOnNode = index.createEvent(this, "clickOnNode", 7);
16
+ /** [optional] Sets the path style */
17
+ this.pathStyle = index$1.BreadcrumbPathStyle.UNDERLINED;
18
+ /** [optional] Variant of first node */
19
+ this.homepageVariant = index$1.BreadcrumbHomepageVariant.ICON;
20
+ /** [optional] Sets max number of element to show */
21
+ this.maxNodesToShow = 5;
22
+ /** [optional] Controls the behaviour on <a> tag click/enter */
23
+ this.preventFollowUrl = false;
24
+ /** [optional] Sets max number of row for each path inside the popover. Zero equals unlimited */
25
+ this.overflowMenuItemRows = 0;
26
+ /** [optional] Sets the maximun number of chars per single node */
27
+ this.truncateChar = 30;
28
+ /** Detect whether the length of the nodes shown exceeds the container length */
29
+ this.hasOverflow = false;
30
+ this.popoverEllipsisOpen = false;
31
+ this.collapsedElements = [];
32
+ this.currentIndex = 0;
33
+ this.truncatePosition = null;
34
+ }
35
+ handleResize() {
36
+ this.viewPortWidth = utils.getDevice();
37
+ if (this.viewPortWidth !== index$1.Device.MOBILE &&
38
+ this.wrapElement &&
39
+ this.wrapElement.scrollWidth > this.wrapElement.clientWidth) {
40
+ this.hasOverflow = true;
41
+ }
42
+ }
43
+ // eslint-disable-next-line lines-between-class-members
44
+ handlePropChange() {
45
+ this.initializeBreadcrumb(this.viewPortWidth === index$1.Device.MOBILE);
46
+ }
47
+ handleResizeUp(newValue, oldValue) {
48
+ if (newValue === index$1.Device.MOBILE ||
49
+ (oldValue === index$1.Device.MOBILE && newValue === index$1.Device.TABLET) ||
50
+ (oldValue === index$1.Device.MOBILE && newValue === index$1.Device.DESKTOP) ||
51
+ (oldValue === index$1.Device.MOBILE && newValue === index$1.Device.DESKTOP_WIDE) ||
52
+ (oldValue === index$1.Device.TABLET && newValue === index$1.Device.DESKTOP) ||
53
+ (oldValue === index$1.Device.TABLET && newValue === index$1.Device.DESKTOP_WIDE) ||
54
+ (oldValue === index$1.Device.DESKTOP && newValue === index$1.Device.DESKTOP_WIDE)) {
55
+ this.initializeBreadcrumb(this.viewPortWidth === index$1.Device.MOBILE);
56
+ }
57
+ }
58
+ componentWillLoad() {
59
+ this.viewPortWidth = utils.getDevice();
60
+ this.initializeBreadcrumb(this.viewPortWidth === index$1.Device.MOBILE);
61
+ }
62
+ componentWillRender() {
63
+ if (this.viewPortWidth !== index$1.Device.MOBILE && this.hasOverflow) {
64
+ this.checkEllipsisOrOverflowMenu();
65
+ this.hasOverflow = false;
66
+ }
67
+ }
68
+ componentDidRender() {
69
+ if (this.collapsedElementsRef) {
70
+ this.anchorElements = Array.from(this.hostElement.shadowRoot.querySelectorAll("z-list-group a"));
71
+ }
72
+ if (this.viewPortWidth !== index$1.Device.MOBILE && this.wrapElement.scrollWidth > this.wrapElement.clientWidth) {
73
+ this.hasOverflow = true;
74
+ }
75
+ }
76
+ initializeBreadcrumb(isMobile) {
77
+ if (isMobile) {
78
+ this.pathsList = this.getPathsItemsList().filter((item) => !!item.path);
79
+ }
80
+ else {
81
+ this.pathsList = this.getPathsItemsList();
82
+ }
83
+ this.totalLenght = this.pathsList.length;
84
+ this.homepageNode = this.pathsList.shift();
85
+ this.pathListCopy = JSON.parse(JSON.stringify(this.pathsList));
86
+ this.collapsedElements = [];
87
+ if (this.totalLenght > this.maxNodesToShow) {
88
+ this.collapsedElements = this.pathsList.splice(0, this.pathsList.length - 2);
89
+ }
90
+ }
91
+ checkEllipsisOrOverflowMenu() {
92
+ if (this.pathListCopy.length > 0) {
93
+ for (let i = 0; i < this.pathsList.length; i++) {
94
+ if (this.pathsList[i].text.length > this.truncateChar) {
95
+ if (this.truncatePosition !== null) {
96
+ if (this.truncatePosition > 0) {
97
+ const arrayToPush = this.pathListCopy.splice(0, this.truncatePosition);
98
+ arrayToPush.forEach((item) => {
99
+ this.collapsedElements.push(item);
100
+ });
101
+ this.pathsList.splice(0, this.truncatePosition);
102
+ this.truncatePosition = 0;
103
+ return;
104
+ }
105
+ if (this.truncatePosition === 0) {
106
+ const arrayToPush = this.pathListCopy.splice(0, this.truncatePosition + 1);
107
+ this.collapsedElements.push(...arrayToPush);
108
+ this.pathsList.splice(0, this.truncatePosition + 1);
109
+ this.truncatePosition = null;
110
+ return;
111
+ }
112
+ }
113
+ if (i !== this.pathsList.length - 1) {
114
+ const truncatedString = this.truncateWithEllipsis(this.pathsList[i].text, this.truncateChar);
115
+ this.currentEllipsisText = this.pathsList[i].text;
116
+ this.pathsList[i].text = truncatedString;
117
+ this.pathsList[i].hasTooltip = true;
118
+ this.truncatePosition = i;
119
+ return;
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+ truncateWithEllipsis(str, length) {
126
+ const ending = "&mldr;";
127
+ if (str.length > length) {
128
+ return str.substring(0, length - 1) + ending;
129
+ }
130
+ return str;
131
+ }
132
+ getPathsItemsList() {
133
+ if (!this.paths) {
134
+ return Array.from(this.hostElement.children).map((item) => {
135
+ return {
136
+ text: item.textContent,
137
+ path: item.href,
138
+ hasTooltip: false,
139
+ };
140
+ });
141
+ }
142
+ const ret = typeof this.paths === "string" ? JSON.parse(this.paths) : this.paths;
143
+ return ret.map((item) => {
144
+ return Object.assign(Object.assign({}, item), { hasTooltip: false });
145
+ });
146
+ }
147
+ renderMobileBreadcrumb() {
148
+ const lastPath = this.pathsList[this.pathsList.length - 1];
149
+ return (index.h("nav", { "aria-label": "Breadcrumb", class: {
150
+ underlined: this.pathStyle === index$1.BreadcrumbPathStyle.UNDERLINED,
151
+ semibold: this.pathStyle === index$1.BreadcrumbPathStyle.SEMIBOLD,
152
+ } }, index.h("ol", null, this.renderNode(lastPath, true))));
153
+ }
154
+ renderHomepageNode(item) {
155
+ return (index.h("li", null, index.h("a", { class: {
156
+ "homepage-icon": this.homepageVariant === index$1.BreadcrumbHomepageVariant.ICON,
157
+ "homepage-text": this.homepageVariant === index$1.BreadcrumbHomepageVariant.TEXT,
158
+ }, href: item.path, onClick: (e) => this.handlePreventFollowUrl(e, item) }, this.homepageVariant === index$1.BreadcrumbHomepageVariant.ICON ? (index.h("z-icon", { name: "home", fill: "color-link-primary", height: 16, width: 16 })) : ("Home"))));
159
+ }
160
+ renderNode(item, mobile) {
161
+ return (index.h("li", null, item.hasTooltip && (index.h("z-popover", { class: "full-path-tooltip", "bind-to": this.triggerEllipsis, open: this.popoverEllipsisOpen, position: index$1.PopoverPosition.BOTTOM, closable: false, showArrow: true }, index.h("span", { class: "tooltip-content" }, this.currentEllipsisText))), index.h("a", { class: {
162
+ "missing-path": !item.path,
163
+ "text-ellipsis": mobile,
164
+ }, ref: (val) => (this.triggerEllipsis = val), "aria-current": item.path ? undefined : "page", href: item.path, onClick: (e) => this.handlePreventFollowUrl(e, item), onMouseOver: () => {
165
+ if (item.hasTooltip) {
166
+ this.popoverEllipsisOpen = true;
167
+ }
168
+ }, onMouseLeave: () => {
169
+ if (item.hasTooltip) {
170
+ this.popoverEllipsisOpen = false;
171
+ }
172
+ }, innerHTML: mobile ? `<z-icon fill="color-link-primary" name="chevron-left"></z-icon> ${item.text}` : item.text })));
173
+ }
174
+ renderBreadcrumb() {
175
+ return (index.h("nav", { ref: (val) => (this.wrapElement = val), "aria-label": "Breadcrumb", class: {
176
+ underlined: this.pathStyle === index$1.BreadcrumbPathStyle.UNDERLINED,
177
+ semibold: this.pathStyle === index$1.BreadcrumbPathStyle.SEMIBOLD,
178
+ } }, index.h("ol", null, this.renderHomepageNode(this.homepageNode), this.collapsedElements.length ? this.renderOverflowMenu() : "", this.pathsList.map((item) => this.renderNode(item, false)))));
179
+ }
180
+ togglePopover() {
181
+ if (!this.collapsedElementsRef.open) {
182
+ this.collapsedElementsRef.open = true;
183
+ }
184
+ }
185
+ handlePreventFollowUrl(e, item) {
186
+ if (this.preventFollowUrl) {
187
+ e.preventDefault();
188
+ this.clickOnNode.emit(item.path);
189
+ }
190
+ }
191
+ handleOverflowMenuAccessibility(e) {
192
+ const anchorElementsLenght = this.anchorElements.length;
193
+ if (e.key === index$1.KeyboardCode.TAB) {
194
+ e.preventDefault();
195
+ return;
196
+ }
197
+ e.stopPropagation();
198
+ const arrows = [index$1.KeyboardCode.ARROW_DOWN, index$1.KeyboardCode.ARROW_UP];
199
+ if (arrows.includes(e.key)) {
200
+ e.preventDefault();
201
+ if (e.key === index$1.KeyboardCode.ARROW_DOWN) {
202
+ this.currentIndex = anchorElementsLenght === this.currentIndex + 1 ? 0 : this.currentIndex + 1;
203
+ }
204
+ if (e.key === index$1.KeyboardCode.ARROW_UP) {
205
+ this.currentIndex = this.currentIndex <= 0 ? anchorElementsLenght - 1 : this.currentIndex - 1;
206
+ }
207
+ this.anchorElements[this.currentIndex].focus();
208
+ }
209
+ if (e.key === index$1.KeyboardCode.ESC) {
210
+ this.triggerButton.focus();
211
+ }
212
+ }
213
+ renderOverflowMenu() {
214
+ if (this.collapsedElements.length) {
215
+ return (index.h("li", null, index.h("z-popover", { class: "hidden-paths-popover", ref: (val) => (this.collapsedElementsRef = val), "bind-to": this.triggerButton, position: index$1.PopoverPosition.BOTTOM_RIGHT, closable: true, showArrow: true }, index.h("div", { class: "popover-content" }, index.h("z-list", null, index.h("z-list-group", { dividerType: index$1.ListDividerType.ELEMENT, size: index$1.ListSize.SMALL }, this.collapsedElements.map((item) => (index.h("z-list-element", { clickable: true }, index.h("a", { class: "text-ellipsis", href: item.path, onClick: (e) => this.handlePreventFollowUrl(e, item), onKeyDown: (e) => this.handleOverflowMenuAccessibility(e) }, item.text)))))))), index.h("button", { "aria-label": "Mostra pi\u00F9 breadcrumb", "aria-haspopup": "true", ref: (el) => (this.triggerButton = el), class: "dots", onClick: () => {
216
+ this.togglePopover();
217
+ }, onKeyDown: (e) => {
218
+ utils.handleKeyboardSubmit(e, this.togglePopover.bind(this));
219
+ setTimeout(() => {
220
+ this.anchorElements[0].focus();
221
+ }, 100);
222
+ } }, "...")));
223
+ }
224
+ }
225
+ render() {
226
+ return (index.h(index.Host, { style: { "--line-clamp": `${this.overflowMenuItemRows}` } }, this.viewPortWidth === index$1.Device.MOBILE ? this.renderMobileBreadcrumb() : this.renderBreadcrumb()));
227
+ }
228
+ get hostElement() { return index.getElement(this); }
229
+ static get watchers() { return {
230
+ "paths": ["handlePropChange"],
231
+ "maxNodesToShow": ["handlePropChange"],
232
+ "viewPortWidth": ["handleResizeUp"]
233
+ }; }
234
+ };
235
+ ZBreadcrumb.style = stylesCss;
236
+
237
+ exports.z_breadcrumb = ZBreadcrumb;
@@ -0,0 +1,328 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e3299e0a.js');
6
+ const index$1 = require('./index-b7c319f2.js');
7
+
8
+ const stylesCss = ":host{--z-popover-theme--surface:var(--color-surface01);--z-popover-theme--text:var(--color-text01);--z-popover-padding:0;--z-popover-shadow-filter:drop-shadow(0 1px 2px var(--shadow-color-base));position:relative;display:none;min-width:calc(var(--space-unit) * 8);min-height:calc(var(--space-unit) * 4);align-items:center;justify-content:center;padding:var(--z-popover-padding);background:var(--z-popover-theme--surface);border-radius:var(--border-radius-small);color:var(--z-popover-theme--text);fill:currentcolor;filter:var(--z-popover-shadow-filter);font-family:var(--font-family-sans);text-align:center}:host([open][current-position]),:host([open=\"true\"][current-position]){display:flex}:host([center][current-position=\"top\"]),:host([center][current-position=\"bottom\"]){transform:translateX(-50%)}:host([center][current-position=\"right\"]),:host([center][current-position=\"left\"]){transform:translateY(-50%)}:host([current-position^=\"top\"]){margin:0 0 var(--space-unit)}:host([current-position^=\"bottom\"]){margin:var(--space-unit) 0 0}:host([current-position^=\"left\"]){margin:0 var(--space-unit) 0 0}:host([current-position^=\"right\"]){margin:0 0 0 var(--space-unit)}:host([current-position])::before{--arrow-size:6px;--arrow-edge-offset:calc(100% - var(--space-unit) - (var(--arrow-size) / 2));--arrow-center-x-offset:calc(50% - (var(--arrow-size) / 2));--arrow-center-y-offset:calc(100% - (var(--arrow-size) / 2));position:absolute;display:block;width:var(--arrow-size);height:var(--arrow-size);background:var(--z-popover-theme--surface);content:\"\";transform:rotate(45deg)}:host([show-arrow=\"false\"])::before,:host(:not([show-arrow]))::before{display:none}:host([current-position^=\"top\"])::before{top:var(--arrow-center-y-offset)}:host([current-position^=\"bottom\"])::before{bottom:var(--arrow-center-y-offset)}:host([current-position=\"top\"])::before,:host([current-position=\"bottom\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before,:host([current-position=\"left\"])::before{bottom:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"top_right\"])::before,:host([current-position=\"bottom_right\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"top_left\"])::before,:host([current-position=\"bottom_left\"])::before{left:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"left_top\"])::before{top:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"right_bottom\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left_top\"])::before,:host([current-position=\"left_bottom\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"right_bottom\"])::before,:host([current-position=\"left_bottom\"])::before{bottom:var(--arrow-edge-offset)}:host([center][current-position=\"top\"])::before,:host([center][current-position=\"bottom\"])::before{right:auto;left:var(--arrow-center-x-offset)}:host([center][current-position=\"right\"])::before,:host([center][current-position=\"left\"])::before{top:var(--arrow-center-x-offset);bottom:auto}::slotted(*){overflow:auto;flex:1 auto}";
9
+
10
+ const DOCUMENT_ELEMENT = document.documentElement;
11
+ function getParentElement(element) {
12
+ if (element.parentNode.host) {
13
+ return element.parentNode.host;
14
+ }
15
+ return element.parentNode;
16
+ }
17
+ /**
18
+ * Find the closest scrollable parent of a node.
19
+ *
20
+ * @param {Element} element The node
21
+ */
22
+ function findScrollableParent(element) {
23
+ let parent = getParentElement(element);
24
+ while (parent && parent !== DOCUMENT_ELEMENT) {
25
+ const { overflow, overflowX, overflowY } = window.getComputedStyle(parent);
26
+ if (overflow === "hidden" || overflowY === "hidden" || overflowX === "hidden") {
27
+ return parent;
28
+ }
29
+ if ((parent.scrollHeight > parent.clientHeight && overflow !== "visible" && overflowY !== "visible") ||
30
+ (parent.scrollWidth > parent.clientWidth && overflow !== "visible" && overflowX !== "visible")) {
31
+ return parent;
32
+ }
33
+ parent = getParentElement(parent);
34
+ }
35
+ return DOCUMENT_ELEMENT;
36
+ }
37
+ /**
38
+ * Calculate computed offset.
39
+ * It includes matrix transformations.
40
+ * @param element The target element.
41
+ * @param targetParentOffset The relative offset parent.
42
+ * @return A client rect object.
43
+ */
44
+ function computeOffset(element, targetParentOffset) {
45
+ const rect = element.getBoundingClientRect();
46
+ const width = rect.width;
47
+ const height = rect.height;
48
+ let top = 0;
49
+ let left = 0;
50
+ let offsetParent = element;
51
+ while (offsetParent && offsetParent != targetParentOffset) {
52
+ left += offsetParent.offsetLeft;
53
+ // document.body sometimes has offsetTop == 0 but still has an
54
+ // offset because of children margins!
55
+ if (offsetParent === document.body) {
56
+ top += offsetParent.getBoundingClientRect().top + window.scrollY;
57
+ }
58
+ else {
59
+ top += offsetParent.offsetTop;
60
+ }
61
+ if (window.DOMMatrix) {
62
+ const style = window.getComputedStyle(offsetParent);
63
+ const transform = style.transform || style.webkitTransform;
64
+ const domMatrix = new DOMMatrix(transform);
65
+ if (domMatrix) {
66
+ left += domMatrix.m41;
67
+ if (offsetParent !== document.body) {
68
+ top += domMatrix.m42;
69
+ }
70
+ }
71
+ }
72
+ if (!offsetParent.offsetParent) {
73
+ break;
74
+ }
75
+ offsetParent = offsetParent.offsetParent;
76
+ }
77
+ let parentWidth;
78
+ let parentHeight;
79
+ if (offsetParent === document.body) {
80
+ parentWidth = window.innerWidth;
81
+ parentHeight = window.innerHeight;
82
+ }
83
+ else {
84
+ parentWidth = offsetParent.offsetWidth;
85
+ parentHeight = offsetParent.offsetHeight;
86
+ }
87
+ const right = parentWidth - left - rect.width;
88
+ const bottom = parentHeight - top - rect.height;
89
+ return { top, right, bottom, left, width, height };
90
+ }
91
+ const ZPopover = class {
92
+ constructor(hostRef) {
93
+ index.registerInstance(this, hostRef);
94
+ this.positionChange = index.createEvent(this, "positionChange", 7);
95
+ this.openChange = index.createEvent(this, "openChange", 7);
96
+ /** Popover position. */
97
+ this.position = index$1.PopoverPosition.AUTO;
98
+ /**
99
+ * The open state of the popover.
100
+ */
101
+ this.open = false;
102
+ /**
103
+ * Whether to show popover's arrow.
104
+ */
105
+ this.showArrow = false;
106
+ /**
107
+ * Whether to center the popup on the main side (according to "position").
108
+ */
109
+ this.center = false;
110
+ /**
111
+ * If true, the popover can be closed by clicking outside of it or pressing the escape key.
112
+ * Otherwise, it will be closed only programmatically (by setting `open` to `false`).
113
+ */
114
+ this.closable = true;
115
+ }
116
+ closePopoverWithKeyboard(e) {
117
+ if (this.closable && e.key === index$1.KeyboardCode.ESC) {
118
+ this.open = false;
119
+ }
120
+ }
121
+ /**
122
+ * Close the popover when clicking outside of its content.
123
+ * Stop event propagation if the click was fired by popover's trigger element,
124
+ * to prevent close and reopen glitches.
125
+ * @param {MouseEvent} e
126
+ */
127
+ handleOutsideClick(e) {
128
+ if (!this.closable || !this.open) {
129
+ return;
130
+ }
131
+ if (!e.composedPath().includes(this.host)) {
132
+ const target = e.target;
133
+ const triggerElemClicked = this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(this.bindTo);
134
+ if (triggerElemClicked) {
135
+ e.stopPropagation();
136
+ }
137
+ this.open = false;
138
+ this.positionChange.emit({ position: this.currentPosition });
139
+ }
140
+ }
141
+ validatePosition(newValue) {
142
+ if (newValue && !Object.values(index$1.PopoverPosition).includes(newValue)) {
143
+ this.position = index$1.PopoverPosition.AUTO;
144
+ }
145
+ this.currentPosition = this.position;
146
+ this.positionChange.emit({ position: this.currentPosition });
147
+ }
148
+ /**
149
+ * Setup popover behaviors on opening.
150
+ */
151
+ onOpen() {
152
+ cancelAnimationFrame(this.animationFrameRequestId);
153
+ if (this.open) {
154
+ const setPosition = () => {
155
+ if (this.open) {
156
+ this.setPosition();
157
+ this.animationFrameRequestId = requestAnimationFrame(setPosition);
158
+ }
159
+ };
160
+ setPosition();
161
+ }
162
+ else if (this.host.hasAttribute("current-position")) {
163
+ this.host.removeAttribute("current-position");
164
+ this.currentPosition = undefined;
165
+ }
166
+ this.openChange.emit({ open: this.open });
167
+ }
168
+ disconnectedCallback() {
169
+ cancelAnimationFrame(this.animationFrameRequestId);
170
+ }
171
+ /**
172
+ * Set the position of the popover.
173
+ */
174
+ setPosition() {
175
+ let element;
176
+ if (typeof this.bindTo === "string") {
177
+ element = this.host.ownerDocument.querySelector(this.bindTo);
178
+ }
179
+ else if (this.bindTo) {
180
+ element = this.bindTo;
181
+ }
182
+ else {
183
+ element = this.host.parentElement;
184
+ }
185
+ if (!element) {
186
+ return;
187
+ }
188
+ const scrollContainer = findScrollableParent(element);
189
+ const scrollingBoundingRect = scrollContainer.getBoundingClientRect();
190
+ const offsetContainer = this.host.offsetParent;
191
+ const relativeBoundingRect = offsetContainer
192
+ ? computeOffset(offsetContainer, scrollContainer)
193
+ : { top: 0, right: 0, bottom: 0, left: 0 };
194
+ const boundingRect = computeOffset(element, scrollContainer);
195
+ const top = boundingRect.top - scrollContainer.scrollTop;
196
+ const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;
197
+ const left = boundingRect.left - scrollContainer.scrollLeft;
198
+ const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;
199
+ const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);
200
+ const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);
201
+ const availableTop = Math.min(top, top + scrollingBoundingRect.top);
202
+ const availableBottom = Math.min(bottom, bottom - overflowBottom);
203
+ const availableLeft = Math.min(left, left + scrollingBoundingRect.left);
204
+ const availableRight = Math.min(right, right - overflowRight);
205
+ const availableHeight = availableTop + availableBottom + boundingRect.height;
206
+ const availableWidth = availableLeft + availableRight + boundingRect.width;
207
+ let position = this.currentPosition;
208
+ const positions = [];
209
+ if (this.position === index$1.PopoverPosition.AUTO) {
210
+ /**
211
+ * The `AUTO` position tries to place the popover in the 'safest' area,
212
+ * where there's more space available.
213
+ */
214
+ if (availableLeft / availableWidth > 0.6) {
215
+ positions.push(index$1.PopoverPosition.LEFT);
216
+ }
217
+ else if (availableLeft / availableWidth < 0.4) {
218
+ positions.push(index$1.PopoverPosition.RIGHT);
219
+ }
220
+ if (availableTop / availableHeight > 0.9) {
221
+ positions.unshift(index$1.PopoverPosition.TOP);
222
+ }
223
+ else if (availableTop / availableHeight > 0.6) {
224
+ positions.push(index$1.PopoverPosition.TOP);
225
+ }
226
+ else if (availableTop / availableHeight < 0.1) {
227
+ positions.unshift(index$1.PopoverPosition.BOTTOM);
228
+ }
229
+ else {
230
+ positions.push(index$1.PopoverPosition.BOTTOM);
231
+ }
232
+ position = positions.join("_");
233
+ }
234
+ const style = this.host.style;
235
+ style.position = "absolute";
236
+ const offsetTop = boundingRect.top - relativeBoundingRect.top;
237
+ const offsetRight = boundingRect.right - relativeBoundingRect.right;
238
+ const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;
239
+ const offsetLeft = boundingRect.left - relativeBoundingRect.left;
240
+ const offsetModifier = this.center ? 0.5 : 0;
241
+ const sizeModifier = this.center ? 0.5 : 0;
242
+ if (position === index$1.PopoverPosition.TOP || position === index$1.PopoverPosition.TOP_RIGHT) {
243
+ style.top = "auto";
244
+ style.right = "auto";
245
+ style.bottom = `${offsetBottom + boundingRect.height}px`;
246
+ style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;
247
+ style.maxHeight = `${availableTop}px`;
248
+ if (position === index$1.PopoverPosition.TOP_RIGHT) {
249
+ style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;
250
+ }
251
+ }
252
+ else if (position === index$1.PopoverPosition.TOP_LEFT) {
253
+ style.top = "auto";
254
+ style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;
255
+ style.bottom = `${offsetBottom + boundingRect.height}px`;
256
+ style.left = "auto";
257
+ style.maxWidth = `${availableLeft}px`;
258
+ style.maxHeight = `${availableTop}px`;
259
+ }
260
+ else if (position === index$1.PopoverPosition.BOTTOM || position === index$1.PopoverPosition.BOTTOM_RIGHT) {
261
+ style.top = `${offsetTop + boundingRect.height}px`;
262
+ style.right = "auto";
263
+ style.bottom = "auto";
264
+ style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;
265
+ style.maxHeight = `${availableBottom}px`;
266
+ if (position === index$1.PopoverPosition.BOTTOM_RIGHT) {
267
+ style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;
268
+ }
269
+ }
270
+ else if (position === index$1.PopoverPosition.BOTTOM_LEFT) {
271
+ style.top = `${offsetTop + boundingRect.height}px`;
272
+ style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;
273
+ style.bottom = "auto";
274
+ style.left = "auto";
275
+ style.maxWidth = `${availableLeft}px`;
276
+ style.maxHeight = `${availableBottom}px`;
277
+ }
278
+ else if (position === index$1.PopoverPosition.RIGHT || position === index$1.PopoverPosition.RIGHT_BOTTOM) {
279
+ style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;
280
+ style.right = "auto";
281
+ style.bottom = "auto";
282
+ style.left = `${offsetLeft + boundingRect.width}px`;
283
+ style.maxWidth = `${availableRight}px`;
284
+ style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;
285
+ }
286
+ else if (position === index$1.PopoverPosition.RIGHT_TOP) {
287
+ style.top = "auto";
288
+ style.right = "auto";
289
+ style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;
290
+ style.left = `${offsetLeft + boundingRect.width}px`;
291
+ style.maxWidth = `${availableRight}px`;
292
+ style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;
293
+ }
294
+ else if (position === index$1.PopoverPosition.LEFT || position === index$1.PopoverPosition.LEFT_BOTTOM) {
295
+ style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;
296
+ style.right = `${offsetRight + boundingRect.width}px`;
297
+ style.bottom = "auto";
298
+ style.left = "auto";
299
+ style.maxWidth = `${availableLeft}px`;
300
+ style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;
301
+ }
302
+ else if (position === index$1.PopoverPosition.LEFT_TOP) {
303
+ style.top = "auto";
304
+ style.right = `${offsetRight + boundingRect.width}px`;
305
+ style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;
306
+ style.left = "auto";
307
+ style.maxWidth = `${availableLeft}px`;
308
+ style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;
309
+ }
310
+ this.currentPosition = position || this.position;
311
+ this.host.setAttribute("current-position", this.currentPosition);
312
+ }
313
+ componentWillLoad() {
314
+ this.validatePosition(this.position);
315
+ this.onOpen();
316
+ }
317
+ render() {
318
+ return index.h("slot", null);
319
+ }
320
+ get host() { return index.getElement(this); }
321
+ static get watchers() { return {
322
+ "position": ["validatePosition"],
323
+ "open": ["onOpen"]
324
+ }; }
325
+ };
326
+ ZPopover.style = stylesCss;
327
+
328
+ exports.z_popover = ZPopover;
@@ -153,7 +153,7 @@ export class ZAppHeader {
153
153
  return parent;
154
154
  }
155
155
  get canShowMenu() {
156
- return this.menuLength > 0 && this.flow !== "offcanvas" && this.currentViewport !== "mobile" && !this.drawerOpen;
156
+ return this.flow !== "offcanvas" && this.currentViewport !== "mobile" && !this.drawerOpen;
157
157
  }
158
158
  get canShowSearchbar() {
159
159
  if (!this.enableSearch) {
@@ -163,6 +163,11 @@
163
163
  flex-flow: row wrap;
164
164
  }
165
165
 
166
+ :host([menu-length="0"]:not([enable-search])) .menu-container,
167
+ .menu-container:empty {
168
+ display: none;
169
+ }
170
+
166
171
  .menu-container ::slotted([open]) {
167
172
  position: relative;
168
173
  z-index: 3;
@@ -1892,10 +1892,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1892
1892
  }
1893
1893
  switch(bundleId) {
1894
1894
 
1895
- case 'z-app-header_13':
1895
+ case 'z-app-header_11':
1896
1896
  return import(
1897
1897
  /* webpackMode: "lazy" */
1898
- './z-app-header_13.entry.js').then(processMod, consoleError);
1898
+ './z-app-header_11.entry.js').then(processMod, consoleError);
1899
1899
  case 'z-anchor-navigation':
1900
1900
  return import(
1901
1901
  /* webpackMode: "lazy" */
@@ -1912,6 +1912,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1912
1912
  return import(
1913
1913
  /* webpackMode: "lazy" */
1914
1914
  './z-body.entry.js').then(processMod, consoleError);
1915
+ case 'z-breadcrumb':
1916
+ return import(
1917
+ /* webpackMode: "lazy" */
1918
+ './z-breadcrumb.entry.js').then(processMod, consoleError);
1915
1919
  case 'z-button-sort':
1916
1920
  return import(
1917
1921
  /* webpackMode: "lazy" */
@@ -2176,6 +2180,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2176
2180
  return import(
2177
2181
  /* webpackMode: "lazy" */
2178
2182
  './z-typography.entry.js').then(processMod, consoleError);
2183
+ case 'z-popover':
2184
+ return import(
2185
+ /* webpackMode: "lazy" */
2186
+ './z-popover.entry.js').then(processMod, consoleError);
2179
2187
  }
2180
2188
  }
2181
2189
  return import(
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as colorFromId } from './utils-b7bdd1bf.js';
1
+ import { c as colorFromId } from './utils-825aed23.js';
2
2
  export { p as AlertType, A as AvatarSize, X as BreadcrumbHomepageVariant, W as BreadcrumbPathStyle, d as ButtonSize, c as ButtonType, B as ButtonVariant, C as CardVariant, U as CarouselArrowsPosition, V as CarouselProgressMode, e as ControlSize, R as CoverHeroContentPosition, Q as CoverHeroVariant, q as Device, h as DividerOrientation, D as DividerSize, k as ExpandableListButtonAlign, E as ExpandableListStyle, M as InfoRevealPosition, f as InputStatus, I as InputType, g as KeyboardCode, K as KeyboardKeyCode, l as LabelPosition, L as LicenseType, m as ListDividerType, i as ListSize, n as ListType, b as NavigationTabsKeyboardEvents, N as NavigationTabsOrientation, a as NavigationTabsSize, o as NotificationType, O as OffCanvasVariant, r as PocketStatus, P as PopoverPosition, j as Size, S as SortDirection, T as ThemeVariant, s as ToastNotification, u as ToastNotificationPosition, t as ToastNotificationTransition, w as TransitionDirection, v as ZAriaAlertMode, y as ZChipType, F as ZDatePickerMode, G as ZDatePickerModeValue, H as ZDatePickerPosition, x as ZFileUploadType, J as ZRangePickerMode, z as ZSectionTitleDividerPosition, Z as ZTableRowExpandedType } from './index-7e4df1be.js';
3
3
  import './breakpoints-9b81eb1b.js';
4
4