@zanichelli/albe-web-components 19.2.3 → 19.2.5
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.
- package/CHANGELOG.md +31 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +27 -9
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-breadcrumb.cjs.entry.js +5 -5
- package/dist/cjs/z-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/z-notification.cjs.entry.js +2 -2
- package/dist/cjs/z-notification.cjs.entry.js.map +1 -1
- package/dist/collection/components/z-breadcrumb/index.js +5 -5
- package/dist/collection/components/z-breadcrumb/index.js.map +1 -1
- package/dist/collection/components/z-button/index.js +5 -2
- package/dist/collection/components/z-button/index.js.map +1 -1
- package/dist/collection/components/z-input/index.js +34 -5
- package/dist/collection/components/z-input/index.js.map +1 -1
- package/dist/collection/components/z-input-message/index.js +44 -2
- package/dist/collection/components/z-input-message/index.js.map +1 -1
- package/dist/collection/components/z-notification/index.js +3 -2
- package/dist/collection/components/z-notification/index.js.map +1 -1
- package/dist/collection/components/z-notification/index.stories.js +79 -77
- package/dist/collection/components/z-notification/index.stories.js.map +1 -1
- package/dist/collection/components/z-notification/styles.css +8 -6
- package/dist/components/index12.js +18 -5
- package/dist/components/index12.js.map +1 -1
- package/dist/components/index13.js +11 -4
- package/dist/components/index13.js.map +1 -1
- package/dist/components/index5.js +5 -2
- package/dist/components/index5.js.map +1 -1
- package/dist/components/z-breadcrumb.js +5 -5
- package/dist/components/z-breadcrumb.js.map +1 -1
- package/dist/components/z-notification.js +2 -2
- package/dist/components/z-notification.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +28 -10
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-breadcrumb.entry.js +5 -5
- package/dist/esm/z-breadcrumb.entry.js.map +1 -1
- package/dist/esm/z-notification.entry.js +2 -2
- package/dist/esm/z-notification.entry.js.map +1 -1
- package/dist/types/components/z-input/index.d.ts +3 -0
- package/dist/types/components/z-input-message/index.d.ts +4 -0
- package/dist/types/components/z-notification/index.d.ts +2 -1
- package/dist/types/components/z-notification/index.stories.d.ts +27 -22
- package/dist/types/components.d.ts +32 -4
- package/dist/web-components-library/p-07cd81f6.entry.js +2 -0
- package/dist/web-components-library/p-07cd81f6.entry.js.map +1 -0
- package/{www/build/p-9814f864.entry.js → dist/web-components-library/p-0d2a5f65.entry.js} +2 -2
- package/dist/web-components-library/p-0d2a5f65.entry.js.map +1 -0
- package/dist/web-components-library/p-299f6d64.entry.js +2 -0
- package/dist/web-components-library/p-299f6d64.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.css +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/p-07cd81f6.entry.js +2 -0
- package/www/build/p-07cd81f6.entry.js.map +1 -0
- package/{dist/web-components-library/p-9814f864.entry.js → www/build/p-0d2a5f65.entry.js} +2 -2
- package/www/build/p-0d2a5f65.entry.js.map +1 -0
- package/www/build/p-299f6d64.entry.js +2 -0
- package/www/build/p-299f6d64.entry.js.map +1 -0
- package/www/build/{p-813bd63b.css → p-c60c851a.css} +1 -1
- package/www/build/p-d969a9bf.js +2 -0
- package/www/build/web-components-library.css +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/web-components-library/p-463e0ac0.entry.js +0 -2
- package/dist/web-components-library/p-463e0ac0.entry.js.map +0 -1
- package/dist/web-components-library/p-9814f864.entry.js.map +0 -1
- package/dist/web-components-library/p-be1c414e.entry.js +0 -2
- package/dist/web-components-library/p-be1c414e.entry.js.map +0 -1
- package/www/build/p-463e0ac0.entry.js +0 -2
- package/www/build/p-463e0ac0.entry.js.map +0 -1
- package/www/build/p-9814f864.entry.js.map +0 -1
- package/www/build/p-be1c414e.entry.js +0 -2
- package/www/build/p-be1c414e.entry.js.map +0 -1
- package/www/build/p-d3d3edf1.js +0 -2
|
@@ -135,7 +135,7 @@ const ZBreadcrumb = class {
|
|
|
135
135
|
"homepage-text": this.homepageVariant === index$1.BreadcrumbHomepageVariant.TEXT,
|
|
136
136
|
}, href: this.homepageNode.path, onClick: (e) => this.handlePreventFollowUrl(e, this.homepageNode), innerHTML: this.homepageVariant === index$1.BreadcrumbHomepageVariant.ICON
|
|
137
137
|
? `<z-icon name="home" />`
|
|
138
|
-
: this.homepageNode.text || "Home" }), this.pathsList.length > 0 && (index.h("z-icon", { class: "separator", name: "chevron-right" }))));
|
|
138
|
+
: this.homepageNode.text || "Home" }), this.pathsList.length > 0 && (index.h("z-icon", { class: "separator", name: "chevron-right", "aria-hidden": "true" }))));
|
|
139
139
|
}
|
|
140
140
|
togglePopover() {
|
|
141
141
|
if (!this.collapsedElementsRef.open) {
|
|
@@ -180,7 +180,7 @@ const ZBreadcrumb = class {
|
|
|
180
180
|
setTimeout(() => {
|
|
181
181
|
this.anchorElements[0].focus();
|
|
182
182
|
}, 100);
|
|
183
|
-
}, innerHTML: "…" }), this.pathsList.length > 0 && (index.h("z-icon", { class: "separator", name: "chevron-right" }))));
|
|
183
|
+
}, innerHTML: "…" }), this.pathsList.length > 0 && (index.h("z-icon", { class: "separator", name: "chevron-right", "aria-hidden": "true" }))));
|
|
184
184
|
}
|
|
185
185
|
renderMobileItems() {
|
|
186
186
|
// show only the second to last element
|
|
@@ -206,14 +206,14 @@ const ZBreadcrumb = class {
|
|
|
206
206
|
if (item.hasTooltip) {
|
|
207
207
|
this.popoverEllipsisOpen = false;
|
|
208
208
|
}
|
|
209
|
-
}, innerHTML: item.text }), index$2 !== this.pathsList.length - 1 && (index.h("z-icon", { class: "separator", name: "chevron-right" }))))),
|
|
209
|
+
}, innerHTML: item.text }), index$2 !== this.pathsList.length - 1 && (index.h("z-icon", { class: "separator", name: "chevron-right", "aria-hidden": "true" }))))),
|
|
210
210
|
];
|
|
211
211
|
}
|
|
212
212
|
render() {
|
|
213
|
-
return (index.h(index.Host, { key: '
|
|
213
|
+
return (index.h(index.Host, { key: '993ff7342e79780d9d8f1e7e5cad29bb9de83f9b', style: { "--line-clamp-popover": `${this.overflowMenuItemRows}` } }, index.h("nav", { key: '6da884ebe41963ce1de9e6279ea4b157e9472b24', ref: (val) => (this.wrapElement = val), "aria-label": "Breadcrumb", class: {
|
|
214
214
|
semibold: this.pathStyle === index$1.BreadcrumbPathStyle.SEMIBOLD,
|
|
215
215
|
underlined: this.pathStyle === index$1.BreadcrumbPathStyle.UNDERLINED,
|
|
216
|
-
} }, index.h("ol", { key: '
|
|
216
|
+
} }, index.h("ol", { key: '26b05c1cb46299aa77c793078f3a6d9d53aede77' }, this.viewPortWidth === index$1.Device.MOBILE ? this.renderMobileItems() : this.renderItems()))));
|
|
217
217
|
}
|
|
218
218
|
get hostElement() { return index.getElement(this); }
|
|
219
219
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"z-breadcrumb.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,SAAS,GAAG,ssEAAssE,CAAC;AACztE,0BAAe,SAAS;;MCgBX,WAAW;;;;QAmDd,sBAAiB,GAAqB,EAAE,CAAC;QAQzC,iBAAY,GAAG,CAAC,CAAC;QAQjB,qBAAgB,GAAG,IAAI,CAAC;yBAzDEA,2BAAmB,CAAC,UAAU;+BAIlBC,iCAAyB,CAAC,IAAI;8BAI1D,CAAC;gCAIC,KAAK;oCAID,CAAC;4BAIT,EAAE;;2BAQJ,KAAK;mCAGG,KAAK;;IA6B3B,YAAY;QACV,IAAI,CAAC,aAAa,GAAGC,eAAS,EAAE,CAAC;QACjC,IACE,IAAI,CAAC,aAAa,KAAKC,cAAM,CAAC,MAAM;YACpC,IAAI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AAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAM,CAC3F,CACD,EACP;KACH;;;;;;;;;;;","names":["BreadcrumbPathStyle","BreadcrumbHomepageVariant","getDevice","Device","h","KeyboardCode","PopoverPosition","ListSize","index","handleKeyboardSubmit","Host"],"sources":["src/components/z-breadcrumb/styles.css?tag=z-breadcrumb&encapsulation=shadow","src/components/z-breadcrumb/index.tsx"],"sourcesContent":[":host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n\n --line-clamp-popover: 0;\n --line-clamp-mobile: 1;\n}\n\n* {\n box-sizing: border-box;\n}\n\nbutton {\n padding: 0;\n border: none;\n margin: 0;\n background-color: transparent;\n}\n\nnav {\n display: flex;\n align-items: center;\n}\n\nol {\n display: flex;\n align-items: center;\n padding: 0;\n margin: 0;\n column-gap: var(--space-unit);\n list-style: none;\n}\n\nli {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n column-gap: var(--space-unit);\n}\n\nol li > a,\nol li > button {\n font-size: var(--font-size-2);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\na:focus,\nbutton:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\na {\n color: var(--color-text-link-blue);\n white-space: nowrap;\n}\n\na.missing-path {\n color: var(--color-default-text);\n}\n\n.text-ellipsis {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--line-clamp-mobile);\n line-clamp: var(--line-clamp-mobile);\n text-overflow: ellipsis;\n white-space: initial;\n}\n\nnav.semibold > ol > li > a:not(.missing-path),\nnav.semibold > ol > li > button {\n font-weight: var(--font-sb);\n text-decoration: none;\n}\n\nnav.underlined a,\nnav.underlined button {\n text-decoration: underline;\n}\n\nz-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n\n display: block;\n fill: var(--color-text-link-blue);\n}\n\nz-icon.separator {\n --z-icon-width: 10px;\n --z-icon-height: 10px;\n\n fill: var(--gray500);\n}\n\nbutton.dots {\n display: inline-block;\n color: var(--color-text-link-blue);\n cursor: pointer;\n}\n\n.hidden-paths-popover .popover-content {\n max-width: 302px;\n padding: calc(var(--space-unit) / 2) var(--space-unit);\n text-align: left;\n}\n\n.hidden-paths-popover .popover-content a {\n font-weight: var(--font-rg);\n text-decoration: none;\n}\n\n.hidden-paths-popover {\n --z-popover-theme--surface: var(--color-background);\n --z-popover-padding: 0;\n --background-color-list-element: var(--color-background);\n}\n\n.hidden-paths-popover::before,\n.full-path-tooltip::before {\n --arrow-edge-offset: calc(100% - (var(--space-unit) * 2.55));\n}\n\n.full-path-tooltip {\n --z-popover-theme--surface: var(--color-surface05);\n --z-popover-theme--text: var(--color-text-inverse);\n --z-popover-padding: 0;\n}\n\n.tooltip-content {\n padding: 0 var(--space-unit);\n font-size: var(--font-size-2);\n}\n\n@media (min-width: 768px) {\n .text-ellipsis {\n -webkit-line-clamp: var(--line-clamp-popover);\n line-clamp: var(--line-clamp-popover);\n }\n}\n\n@media (max-width: 767px) {\n li a {\n display: flex;\n align-items: center;\n column-gap: var(--space-unit);\n }\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {\n BreadcrumbHomepageVariant,\n BreadcrumbPath,\n BreadcrumbPathStyle,\n Device,\n KeyboardCode,\n ListSize,\n PopoverPosition,\n} from \"../../beans\";\nimport {getDevice, handleKeyboardSubmit} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-breadcrumb\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZBreadcrumb {\n /* Accessibility references */\n /* Overflow-menu: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ */\n /* Breadcrumb: https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/ */\n /* Focus on multiline link: https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html */\n\n @Element() hostElement: HTMLZBreadcrumbElement;\n\n /** [optional] Sets the path style */\n @Prop({reflect: true})\n pathStyle?: BreadcrumbPathStyle = BreadcrumbPathStyle.UNDERLINED;\n\n /** [optional] Variant of first node */\n @Prop()\n homepageVariant?: BreadcrumbHomepageVariant = BreadcrumbHomepageVariant.ICON;\n\n /** [optional] Sets max number of element to show */\n @Prop()\n maxNodesToShow? = 5;\n\n /** [optional] Controls the behaviour on <a> tag click/enter */\n @Prop()\n preventFollowUrl? = false;\n\n /** [optional] Sets max number of row for each path inside the popover. Zero equals unlimited */\n @Prop()\n overflowMenuItemRows? = 0;\n\n /** [optional] Sets the maximun number of chars per single node */\n @Prop()\n truncateChar? = 30;\n\n /** Handle mobile */\n @State()\n viewPortWidth: Device;\n\n /** Detect whether the length of the nodes shown exceeds the container length */\n @State()\n hasOverflow = false;\n\n @State()\n popoverEllipsisOpen = false;\n\n /** Emitted when preventFollowUrl=true to handle custom page transition */\n @Event()\n clickOnNode: EventEmitter<BreadcrumbPath[\"path\"]>;\n\n private pathsList: BreadcrumbPath[];\n\n private pathListCopy: BreadcrumbPath[];\n\n private collapsedElements: BreadcrumbPath[] = [];\n\n private collapsedElementsRef: HTMLZPopoverElement;\n\n private triggerButton: HTMLButtonElement;\n\n private wrapElement: HTMLElement;\n\n private currentIndex = 0;\n\n private homepageNode: BreadcrumbPath;\n\n private anchorElements;\n\n private currentEllipsisText: string;\n\n private truncatePosition = null;\n\n @Listen(\"resize\", {target: \"window\"})\n handleResize(): void {\n this.viewPortWidth = getDevice();\n if (\n this.viewPortWidth !== Device.MOBILE &&\n this.wrapElement &&\n this.wrapElement.scrollWidth > this.wrapElement.clientWidth\n ) {\n this.hasOverflow = true;\n }\n }\n // eslint-disable-next-line lines-between-class-members\n @Watch(\"maxNodesToShow\")\n handlePropChange(): void {\n this.initializeBreadcrumb();\n }\n\n @Watch(\"viewPortWidth\")\n handleResizeUp(newValue: Device, oldValue: Device): void {\n if (\n newValue === Device.MOBILE ||\n (oldValue === Device.MOBILE && newValue === Device.TABLET) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.DESKTOP && newValue === Device.DESKTOP_WIDE)\n ) {\n this.initializeBreadcrumb();\n }\n }\n\n componentWillLoad(): void {\n this.viewPortWidth = getDevice();\n this.initializeBreadcrumb();\n }\n\n componentWillRender(): void {\n if (this.viewPortWidth !== Device.MOBILE && this.hasOverflow) {\n this.checkEllipsisOrOverflowMenu();\n this.hasOverflow = false;\n }\n }\n\n componentDidRender(): void {\n if (this.collapsedElementsRef) {\n this.anchorElements = Array.from(this.hostElement.shadowRoot.querySelectorAll(\"z-list-group a\"));\n }\n\n if (this.viewPortWidth !== Device.MOBILE) {\n requestAnimationFrame(() => {\n if (this.wrapElement.scrollWidth > this.wrapElement.clientWidth) {\n if (!this.hasOverflow) {\n this.hasOverflow = true;\n }\n }\n });\n }\n }\n\n private initializeBreadcrumb(): void {\n if (this.viewPortWidth === Device.MOBILE) {\n this.pathsList = this.getPathsItemsList().filter((item) => !!item.path);\n } else {\n this.pathsList = this.getPathsItemsList();\n }\n this.homepageNode = this.pathsList.shift();\n this.pathListCopy = [...this.pathsList];\n this.collapsedElements = [];\n if (this.pathsList.length > this.maxNodesToShow) {\n this.collapsedElements = this.pathsList.splice(0, this.pathsList.length - 2);\n }\n }\n\n private checkEllipsisOrOverflowMenu(): void {\n for (let i = 0; i < this.pathsList.length; i++) {\n if (this.pathsList[i].text.length <= this.truncateChar) {\n continue;\n }\n\n if (this.truncatePosition > 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition));\n this.pathsList.splice(0, this.truncatePosition);\n this.truncatePosition = 0;\n\n return;\n } else if (this.truncatePosition === 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition + 1));\n this.pathsList.splice(0, this.truncatePosition + 1);\n this.truncatePosition = null;\n\n return;\n }\n\n if (i !== this.pathsList.length - 1) {\n const truncatedString = this.truncateWithEllipsis(this.pathsList[i].text, this.truncateChar);\n this.currentEllipsisText = this.pathsList[i].text;\n this.pathsList[i].text = truncatedString;\n this.pathsList[i].hasTooltip = true;\n this.truncatePosition = i;\n\n return;\n }\n }\n }\n\n private truncateWithEllipsis(str: string, maxLength: number): string {\n if (str.length <= maxLength) {\n return str;\n }\n\n return str.substring(0, maxLength - 1) + \"…\";\n }\n\n private getPathsItemsList(): BreadcrumbPath[] {\n return Array.from(this.hostElement.children).map((item: HTMLAnchorElement) => {\n return {\n text: item.textContent,\n path: item.href,\n hasTooltip: false,\n };\n });\n }\n\n private renderHomepageNode(): HTMLLIElement {\n return (\n <li>\n <a\n class={{\n \"homepage-text\": this.homepageVariant === BreadcrumbHomepageVariant.TEXT,\n }}\n href={this.homepageNode.path}\n onClick={(e) => this.handlePreventFollowUrl(e, this.homepageNode)}\n innerHTML={\n this.homepageVariant === BreadcrumbHomepageVariant.ICON\n ? `<z-icon name=\"home\" />`\n : this.homepageNode.text || \"Home\"\n }\n />\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n />\n )}\n </li>\n );\n }\n\n private togglePopover(): void {\n if (!this.collapsedElementsRef.open) {\n this.collapsedElementsRef.open = true;\n }\n }\n\n private handlePreventFollowUrl(e: MouseEvent, item): void {\n if (this.preventFollowUrl) {\n e.preventDefault();\n this.clickOnNode.emit(item.path);\n }\n }\n\n private handleOverflowMenuAccessibility(e: KeyboardEvent): void {\n const anchorElementsLenght = this.anchorElements.length;\n if (e.key === KeyboardCode.TAB) {\n e.preventDefault();\n\n return;\n }\n e.stopPropagation();\n const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];\n if (arrows.includes(e.key as KeyboardCode)) {\n e.preventDefault();\n\n if (e.key === KeyboardCode.ARROW_DOWN) {\n this.currentIndex = anchorElementsLenght === this.currentIndex + 1 ? 0 : this.currentIndex + 1;\n }\n if (e.key === KeyboardCode.ARROW_UP) {\n this.currentIndex = this.currentIndex <= 0 ? anchorElementsLenght - 1 : this.currentIndex - 1;\n }\n\n this.anchorElements[this.currentIndex].focus();\n }\n\n if (e.key === KeyboardCode.ESC) {\n this.triggerButton.focus();\n }\n }\n\n private renderOverflowMenu(): HTMLLIElement {\n return (\n <li>\n <z-popover\n class=\"hidden-paths-popover\"\n ref={(val) => (this.collapsedElementsRef = val as HTMLZPopoverElement)}\n bindTo={this.triggerButton}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable\n showArrow\n >\n <div class=\"popover-content\">\n <z-list>\n <z-list-group size={ListSize.SMALL}>\n {this.collapsedElements.map((item, index, array) => {\n return (\n <div>\n <z-list-element clickable>\n <a\n class=\"text-ellipsis\"\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onKeyDown={(e) => this.handleOverflowMenuAccessibility(e)}\n innerHTML={item.text}\n />\n </z-list-element>\n {index < array.length - 1 && <z-divider color=\"color-surface03\"></z-divider>}\n </div>\n );\n })}\n </z-list-group>\n </z-list>\n </div>\n </z-popover>\n <button\n class=\"dots\"\n ref={(el) => (this.triggerButton = el)}\n aria-label=\"Mostra più breadcrumb\"\n aria-haspopup=\"true\"\n onClick={() => {\n this.togglePopover();\n }}\n onKeyDown={(e) => {\n handleKeyboardSubmit(e, this.togglePopover.bind(this));\n setTimeout(() => {\n this.anchorElements[0].focus();\n }, 100);\n }}\n innerHTML=\"…\"\n ></button>\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n />\n )}\n </li>\n );\n }\n\n private renderMobileItems(): HTMLLIElement {\n // show only the second to last element\n const secondToLastPath = this.pathsList[this.pathsList.length - 1];\n\n if (!secondToLastPath) {\n return;\n }\n\n return (\n <li>\n <a\n aria-current={secondToLastPath.path ? undefined : \"page\"}\n href={secondToLastPath.path}\n onClick={(e) => this.handlePreventFollowUrl(e, secondToLastPath)}\n >\n <z-icon name=\"chevron-left\" />\n <span\n class={{\n \"missing-path\": !secondToLastPath.path,\n \"text-ellipsis\": true,\n }}\n >\n {secondToLastPath.text}\n </span>\n </a>\n </li>\n );\n }\n\n private renderItems(): HTMLElement[] {\n let trigger;\n\n return [\n this.renderHomepageNode(),\n this.collapsedElements.length > 0 && this.renderOverflowMenu(),\n ...this.pathsList.map((item, index) => (\n <li>\n {item.hasTooltip && (\n <z-popover\n class=\"full-path-tooltip\"\n bindTo={trigger}\n open={this.popoverEllipsisOpen}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable={false}\n showArrow\n >\n <span class=\"tooltip-content\">{this.currentEllipsisText}</span>\n </z-popover>\n )}\n <a\n class={{\"missing-path\": !item.path}}\n ref={(val) => (trigger = val)}\n aria-current={item.path ? undefined : \"page\"}\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onMouseOver={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = true;\n }\n }}\n onMouseLeave={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = false;\n }\n }}\n innerHTML={item.text}\n />\n {index !== this.pathsList.length - 1 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n />\n )}\n </li>\n )),\n ];\n }\n\n render(): HTMLZBreadcrumbElement {\n return (\n <Host style={{\"--line-clamp-popover\": `${this.overflowMenuItemRows}`}}>\n <nav\n ref={(val) => (this.wrapElement = val)}\n aria-label=\"Breadcrumb\"\n class={{\n semibold: this.pathStyle === BreadcrumbPathStyle.SEMIBOLD,\n underlined: this.pathStyle === BreadcrumbPathStyle.UNDERLINED,\n }}\n >\n <ol>{this.viewPortWidth === Device.MOBILE ? this.renderMobileItems() : this.renderItems()}</ol>\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"z-breadcrumb.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,SAAS,GAAG,ssEAAssE,CAAC;AACztE,0BAAe,SAAS;;MCgBX,WAAW;;;;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,MAAM;QACJ,QACEA,QAACM,UAAI,qDAAC,KAAK,EAAE,EAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,oBAAoB,EAAE,EAAC,IACnEN,kEACE,GAAG,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,gBAC3B,YAAY,EACvB,KAAK,EAAE;gBACL,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAKJ,2BAAmB,CAAC,QAAQ;gBACzD,UAAU,EAAE,IAAI,CAAC,SAAS,KAAKA,2BAAmB,CAAC,UAAU;aAC9D,IAEDI,mEAAK,IAAI,CAAC,aAAa,KAAKD,cAAM,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAM,CAC3F,CACD,EACP;KACH;;;;;;;;;;;","names":["BreadcrumbPathStyle","BreadcrumbHomepageVariant","getDevice","Device","h","KeyboardCode","PopoverPosition","ListSize","index","handleKeyboardSubmit","Host"],"sources":["src/components/z-breadcrumb/styles.css?tag=z-breadcrumb&encapsulation=shadow","src/components/z-breadcrumb/index.tsx"],"sourcesContent":[":host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n\n --line-clamp-popover: 0;\n --line-clamp-mobile: 1;\n}\n\n* {\n box-sizing: border-box;\n}\n\nbutton {\n padding: 0;\n border: none;\n margin: 0;\n background-color: transparent;\n}\n\nnav {\n display: flex;\n align-items: center;\n}\n\nol {\n display: flex;\n align-items: center;\n padding: 0;\n margin: 0;\n column-gap: var(--space-unit);\n list-style: none;\n}\n\nli {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n column-gap: var(--space-unit);\n}\n\nol li > a,\nol li > button {\n font-size: var(--font-size-2);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\na:focus,\nbutton:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\na {\n color: var(--color-text-link-blue);\n white-space: nowrap;\n}\n\na.missing-path {\n color: var(--color-default-text);\n}\n\n.text-ellipsis {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--line-clamp-mobile);\n line-clamp: var(--line-clamp-mobile);\n text-overflow: ellipsis;\n white-space: initial;\n}\n\nnav.semibold > ol > li > a:not(.missing-path),\nnav.semibold > ol > li > button {\n font-weight: var(--font-sb);\n text-decoration: none;\n}\n\nnav.underlined a,\nnav.underlined button {\n text-decoration: underline;\n}\n\nz-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n\n display: block;\n fill: var(--color-text-link-blue);\n}\n\nz-icon.separator {\n --z-icon-width: 10px;\n --z-icon-height: 10px;\n\n fill: var(--gray500);\n}\n\nbutton.dots {\n display: inline-block;\n color: var(--color-text-link-blue);\n cursor: pointer;\n}\n\n.hidden-paths-popover .popover-content {\n max-width: 302px;\n padding: calc(var(--space-unit) / 2) var(--space-unit);\n text-align: left;\n}\n\n.hidden-paths-popover .popover-content a {\n font-weight: var(--font-rg);\n text-decoration: none;\n}\n\n.hidden-paths-popover {\n --z-popover-theme--surface: var(--color-background);\n --z-popover-padding: 0;\n --background-color-list-element: var(--color-background);\n}\n\n.hidden-paths-popover::before,\n.full-path-tooltip::before {\n --arrow-edge-offset: calc(100% - (var(--space-unit) * 2.55));\n}\n\n.full-path-tooltip {\n --z-popover-theme--surface: var(--color-surface05);\n --z-popover-theme--text: var(--color-text-inverse);\n --z-popover-padding: 0;\n}\n\n.tooltip-content {\n padding: 0 var(--space-unit);\n font-size: var(--font-size-2);\n}\n\n@media (min-width: 768px) {\n .text-ellipsis {\n -webkit-line-clamp: var(--line-clamp-popover);\n line-clamp: var(--line-clamp-popover);\n }\n}\n\n@media (max-width: 767px) {\n li a {\n display: flex;\n align-items: center;\n column-gap: var(--space-unit);\n }\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {\n BreadcrumbHomepageVariant,\n BreadcrumbPath,\n BreadcrumbPathStyle,\n Device,\n KeyboardCode,\n ListSize,\n PopoverPosition,\n} from \"../../beans\";\nimport {getDevice, handleKeyboardSubmit} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-breadcrumb\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZBreadcrumb {\n /* Accessibility references */\n /* Overflow-menu: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ */\n /* Breadcrumb: https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/ */\n /* Focus on multiline link: https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html */\n\n @Element() hostElement: HTMLZBreadcrumbElement;\n\n /** [optional] Sets the path style */\n @Prop({reflect: true})\n pathStyle?: BreadcrumbPathStyle = BreadcrumbPathStyle.UNDERLINED;\n\n /** [optional] Variant of first node */\n @Prop()\n homepageVariant?: BreadcrumbHomepageVariant = BreadcrumbHomepageVariant.ICON;\n\n /** [optional] Sets max number of element to show */\n @Prop()\n maxNodesToShow? = 5;\n\n /** [optional] Controls the behaviour on <a> tag click/enter */\n @Prop()\n preventFollowUrl? = false;\n\n /** [optional] Sets max number of row for each path inside the popover. Zero equals unlimited */\n @Prop()\n overflowMenuItemRows? = 0;\n\n /** [optional] Sets the maximun number of chars per single node */\n @Prop()\n truncateChar? = 30;\n\n /** Handle mobile */\n @State()\n viewPortWidth: Device;\n\n /** Detect whether the length of the nodes shown exceeds the container length */\n @State()\n hasOverflow = false;\n\n @State()\n popoverEllipsisOpen = false;\n\n /** Emitted when preventFollowUrl=true to handle custom page transition */\n @Event()\n clickOnNode: EventEmitter<BreadcrumbPath[\"path\"]>;\n\n private pathsList: BreadcrumbPath[];\n\n private pathListCopy: BreadcrumbPath[];\n\n private collapsedElements: BreadcrumbPath[] = [];\n\n private collapsedElementsRef: HTMLZPopoverElement;\n\n private triggerButton: HTMLButtonElement;\n\n private wrapElement: HTMLElement;\n\n private currentIndex = 0;\n\n private homepageNode: BreadcrumbPath;\n\n private anchorElements;\n\n private currentEllipsisText: string;\n\n private truncatePosition = null;\n\n @Listen(\"resize\", {target: \"window\"})\n handleResize(): void {\n this.viewPortWidth = getDevice();\n if (\n this.viewPortWidth !== Device.MOBILE &&\n this.wrapElement &&\n this.wrapElement.scrollWidth > this.wrapElement.clientWidth\n ) {\n this.hasOverflow = true;\n }\n }\n // eslint-disable-next-line lines-between-class-members\n @Watch(\"maxNodesToShow\")\n handlePropChange(): void {\n this.initializeBreadcrumb();\n }\n\n @Watch(\"viewPortWidth\")\n handleResizeUp(newValue: Device, oldValue: Device): void {\n if (\n newValue === Device.MOBILE ||\n (oldValue === Device.MOBILE && newValue === Device.TABLET) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.DESKTOP && newValue === Device.DESKTOP_WIDE)\n ) {\n this.initializeBreadcrumb();\n }\n }\n\n componentWillLoad(): void {\n this.viewPortWidth = getDevice();\n this.initializeBreadcrumb();\n }\n\n componentWillRender(): void {\n if (this.viewPortWidth !== Device.MOBILE && this.hasOverflow) {\n this.checkEllipsisOrOverflowMenu();\n this.hasOverflow = false;\n }\n }\n\n componentDidRender(): void {\n if (this.collapsedElementsRef) {\n this.anchorElements = Array.from(this.hostElement.shadowRoot.querySelectorAll(\"z-list-group a\"));\n }\n\n if (this.viewPortWidth !== Device.MOBILE) {\n requestAnimationFrame(() => {\n if (this.wrapElement.scrollWidth > this.wrapElement.clientWidth) {\n if (!this.hasOverflow) {\n this.hasOverflow = true;\n }\n }\n });\n }\n }\n\n private initializeBreadcrumb(): void {\n if (this.viewPortWidth === Device.MOBILE) {\n this.pathsList = this.getPathsItemsList().filter((item) => !!item.path);\n } else {\n this.pathsList = this.getPathsItemsList();\n }\n this.homepageNode = this.pathsList.shift();\n this.pathListCopy = [...this.pathsList];\n this.collapsedElements = [];\n if (this.pathsList.length > this.maxNodesToShow) {\n this.collapsedElements = this.pathsList.splice(0, this.pathsList.length - 2);\n }\n }\n\n private checkEllipsisOrOverflowMenu(): void {\n for (let i = 0; i < this.pathsList.length; i++) {\n if (this.pathsList[i].text.length <= this.truncateChar) {\n continue;\n }\n\n if (this.truncatePosition > 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition));\n this.pathsList.splice(0, this.truncatePosition);\n this.truncatePosition = 0;\n\n return;\n } else if (this.truncatePosition === 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition + 1));\n this.pathsList.splice(0, this.truncatePosition + 1);\n this.truncatePosition = null;\n\n return;\n }\n\n if (i !== this.pathsList.length - 1) {\n const truncatedString = this.truncateWithEllipsis(this.pathsList[i].text, this.truncateChar);\n this.currentEllipsisText = this.pathsList[i].text;\n this.pathsList[i].text = truncatedString;\n this.pathsList[i].hasTooltip = true;\n this.truncatePosition = i;\n\n return;\n }\n }\n }\n\n private truncateWithEllipsis(str: string, maxLength: number): string {\n if (str.length <= maxLength) {\n return str;\n }\n\n return str.substring(0, maxLength - 1) + \"…\";\n }\n\n private getPathsItemsList(): BreadcrumbPath[] {\n return Array.from(this.hostElement.children).map((item: HTMLAnchorElement) => {\n return {\n text: item.textContent,\n path: item.href,\n hasTooltip: false,\n };\n });\n }\n\n private renderHomepageNode(): HTMLLIElement {\n return (\n <li>\n <a\n class={{\n \"homepage-text\": this.homepageVariant === BreadcrumbHomepageVariant.TEXT,\n }}\n href={this.homepageNode.path}\n onClick={(e) => this.handlePreventFollowUrl(e, this.homepageNode)}\n innerHTML={\n this.homepageVariant === BreadcrumbHomepageVariant.ICON\n ? `<z-icon name=\"home\" />`\n : this.homepageNode.text || \"Home\"\n }\n />\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n aria-hidden=\"true\"\n />\n )}\n </li>\n );\n }\n\n private togglePopover(): void {\n if (!this.collapsedElementsRef.open) {\n this.collapsedElementsRef.open = true;\n }\n }\n\n private handlePreventFollowUrl(e: MouseEvent, item): void {\n if (this.preventFollowUrl) {\n e.preventDefault();\n this.clickOnNode.emit(item.path);\n }\n }\n\n private handleOverflowMenuAccessibility(e: KeyboardEvent): void {\n const anchorElementsLenght = this.anchorElements.length;\n if (e.key === KeyboardCode.TAB) {\n e.preventDefault();\n\n return;\n }\n e.stopPropagation();\n const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];\n if (arrows.includes(e.key as KeyboardCode)) {\n e.preventDefault();\n\n if (e.key === KeyboardCode.ARROW_DOWN) {\n this.currentIndex = anchorElementsLenght === this.currentIndex + 1 ? 0 : this.currentIndex + 1;\n }\n if (e.key === KeyboardCode.ARROW_UP) {\n this.currentIndex = this.currentIndex <= 0 ? anchorElementsLenght - 1 : this.currentIndex - 1;\n }\n\n this.anchorElements[this.currentIndex].focus();\n }\n\n if (e.key === KeyboardCode.ESC) {\n this.triggerButton.focus();\n }\n }\n\n private renderOverflowMenu(): HTMLLIElement {\n return (\n <li>\n <z-popover\n class=\"hidden-paths-popover\"\n ref={(val) => (this.collapsedElementsRef = val as HTMLZPopoverElement)}\n bindTo={this.triggerButton}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable\n showArrow\n >\n <div class=\"popover-content\">\n <z-list>\n <z-list-group size={ListSize.SMALL}>\n {this.collapsedElements.map((item, index, array) => {\n return (\n <div>\n <z-list-element clickable>\n <a\n class=\"text-ellipsis\"\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onKeyDown={(e) => this.handleOverflowMenuAccessibility(e)}\n innerHTML={item.text}\n />\n </z-list-element>\n {index < array.length - 1 && <z-divider color=\"color-surface03\"></z-divider>}\n </div>\n );\n })}\n </z-list-group>\n </z-list>\n </div>\n </z-popover>\n <button\n class=\"dots\"\n ref={(el) => (this.triggerButton = el)}\n aria-label=\"Mostra più breadcrumb\"\n aria-haspopup=\"true\"\n onClick={() => {\n this.togglePopover();\n }}\n onKeyDown={(e) => {\n handleKeyboardSubmit(e, this.togglePopover.bind(this));\n setTimeout(() => {\n this.anchorElements[0].focus();\n }, 100);\n }}\n innerHTML=\"…\"\n ></button>\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n aria-hidden=\"true\"\n />\n )}\n </li>\n );\n }\n\n private renderMobileItems(): HTMLLIElement {\n // show only the second to last element\n const secondToLastPath = this.pathsList[this.pathsList.length - 1];\n\n if (!secondToLastPath) {\n return;\n }\n\n return (\n <li>\n <a\n aria-current={secondToLastPath.path ? undefined : \"page\"}\n href={secondToLastPath.path}\n onClick={(e) => this.handlePreventFollowUrl(e, secondToLastPath)}\n >\n <z-icon name=\"chevron-left\" />\n <span\n class={{\n \"missing-path\": !secondToLastPath.path,\n \"text-ellipsis\": true,\n }}\n >\n {secondToLastPath.text}\n </span>\n </a>\n </li>\n );\n }\n\n private renderItems(): HTMLElement[] {\n let trigger;\n\n return [\n this.renderHomepageNode(),\n this.collapsedElements.length > 0 && this.renderOverflowMenu(),\n ...this.pathsList.map((item, index) => (\n <li>\n {item.hasTooltip && (\n <z-popover\n class=\"full-path-tooltip\"\n bindTo={trigger}\n open={this.popoverEllipsisOpen}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable={false}\n showArrow\n >\n <span class=\"tooltip-content\">{this.currentEllipsisText}</span>\n </z-popover>\n )}\n <a\n class={{\"missing-path\": !item.path}}\n ref={(val) => (trigger = val)}\n aria-current={item.path ? undefined : \"page\"}\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onMouseOver={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = true;\n }\n }}\n onMouseLeave={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = false;\n }\n }}\n innerHTML={item.text}\n />\n {index !== this.pathsList.length - 1 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n aria-hidden=\"true\"\n />\n )}\n </li>\n )),\n ];\n }\n\n render(): HTMLZBreadcrumbElement {\n return (\n <Host style={{\"--line-clamp-popover\": `${this.overflowMenuItemRows}`}}>\n <nav\n ref={(val) => (this.wrapElement = val)}\n aria-label=\"Breadcrumb\"\n class={{\n semibold: this.pathStyle === BreadcrumbPathStyle.SEMIBOLD,\n underlined: this.pathStyle === BreadcrumbPathStyle.UNDERLINED,\n }}\n >\n <ol>{this.viewPortWidth === Device.MOBILE ? this.renderMobileItems() : this.renderItems()}</ol>\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-96af6326.js');
|
|
6
6
|
|
|
7
|
-
const stylesCss = ":host{--z-notification--top-offset:0;--z-notification--content-max-width:100%;display:block;width:100%}.main-container{display:flex;max-width:var(--z-notification--content-max-width);align-items:flex-start;padding:calc(var(--space-unit) * 2);margin:0 auto;background-color:transparent;font-family:var(--font-family-sans)}:host([sticky]){position:sticky;top:var(--z-notification--top-offset)}:host([sticky]),:host([showshadow]){box-shadow:var(--shadow-3)}:host([type=\"success\"]){background:var(--color-inverse-success)}:host([type=\"warning\"]){background:var(--color-inverse-warning)}:host([type=\"error\"]){background:var(--color-inverse-error)}.status-icon,.close-button{display:flex;height:20px;align-items:center}:host([type=\"success\"]) .status-icon{fill:var(--color-default-success)}:host([type=\"warning\"]) .status-icon{fill:var(--color-default-warning)}:host([type=\"error\"]) .status-icon{fill:var(--color-default-error)}:host([borderposition=\"bottom\"]){border-bottom:var(--border-size-medium) solid var(--color-surface03)}:host([borderposition=\"top\"]){border-top:var(--border-size-medium) solid var(--color-surface03)}button{padding:0;border:none;margin:0;background:transparent;cursor:pointer;font-family:inherit}.status-icon+.content-container{margin-left:var(--space-unit)}.content-container{display:flex;flex:1 auto;flex-wrap:wrap;align-items:baseline;justify-content:space-between;row-gap:calc(var(--space-unit) * 2)}.content-text{color:var(--color-default-text);font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:
|
|
7
|
+
const stylesCss = ":host{--z-notification--top-offset:0;--z-notification--content-max-width:100%;display:block;width:100%}.main-container{display:flex;max-width:var(--z-notification--content-max-width);align-items:flex-start;padding:calc(var(--space-unit) * 2) var(--z-notification--inline-padding, calc(var(--space-unit) * 2));margin:0 auto;background-color:transparent;font-family:var(--font-family-sans)}:host([sticky]){position:sticky;top:var(--z-notification--top-offset)}:host([sticky]),:host([showshadow]){box-shadow:var(--shadow-3)}:host([type=\"success\"]){background:var(--color-inverse-success)}:host([type=\"warning\"]){background:var(--color-inverse-warning)}:host([type=\"error\"]){background:var(--color-inverse-error)}.status-icon,.close-button{display:flex;height:20px;align-items:center}:host([type=\"success\"]) .status-icon{fill:var(--color-default-success)}:host([type=\"warning\"]) .status-icon{fill:var(--color-default-warning)}:host([type=\"error\"]) .status-icon{fill:var(--color-default-error)}:host([borderposition=\"bottom\"]){border-bottom:var(--border-size-medium) solid var(--color-surface03)}:host([borderposition=\"top\"]){border-top:var(--border-size-medium) solid var(--color-surface03)}button{padding:0;border:none;margin:0;background:transparent;cursor:pointer;font-family:inherit}.status-icon+.content-container{margin-left:var(--space-unit)}.content-container{display:flex;flex:1 auto;flex-wrap:wrap;align-items:baseline;justify-content:space-between;row-gap:calc(var(--space-unit) * 2)}.content-text{width:100%;color:var(--color-default-text);font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.action-button{color:var(--color-primary01);font-size:var(--font-size-1);font-weight:var(--font-sb);letter-spacing:0.32px;line-height:1.333;outline:none}.action-button:focus-visible{box-shadow:var(--shadow-focus-primary)}.content-container+.close-button{margin-left:calc(var(--space-unit) * 2)}.close-button z-icon{fill:var(--color-primary01)}@media (min-width: 768px){.content-container{flex-wrap:nowrap}.content-text+.action-button{margin-left:calc(var(--space-unit) * 5)}}";
|
|
8
8
|
const ZNotificationStyle0 = stylesCss;
|
|
9
9
|
|
|
10
10
|
const ZNotification = class {
|
|
@@ -32,7 +32,7 @@ const ZNotification = class {
|
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
34
|
var _a;
|
|
35
|
-
return (index.h(index.Host, { key: '
|
|
35
|
+
return (index.h(index.Host, { key: '3704b1815b8b714608787f7d86e8402fe7dc4eff' }, index.h("div", { key: '79598a77b4cca9ad53babe6be8d8ea103d979f6a', class: "main-container" }, this.contenticonname && (index.h("z-icon", { key: '2a4de5808da5ec4af5bddf68376cc7510aad9cf8', class: "status-icon", name: this.contenticonname, width: 16, height: 16 })), index.h("div", { key: 'feb0b073eacb2fdb82501f3b33bdff68fef71769', class: "content-container" }, index.h("div", { key: '2a81ef0da3a0fba818025651aa64e270e833c9ed', class: "content-text" }, index.h("slot", { key: '88f8670d0a0433012aa6f6a27a40cef7c84498c5' })), !!((_a = this.actiontext) === null || _a === void 0 ? void 0 : _a.trim()) && (index.h("button", { key: '6282f5526b57131deb130c57dfe165595612d01e', class: "action-button", type: "button", onClick: this.handleActionButtonClick }, this.actiontext))), this.showclose && (index.h("button", { key: '514841e3b1a2a816c9283d05ca3d2de953269e8b', class: "close-button", type: "button", onClick: this.handleCloseButtonClick }, index.h("z-icon", { key: 'a43a9ca62b654719cd4a2bb634152b96c801cdc9', name: "multiply-circle", width: 16, height: 16 }))))));
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
ZNotification.style = ZNotificationStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"z-notification.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,
|
|
1
|
+
{"file":"z-notification.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,ulEAAulE,CAAC;AAC1mE,4BAAe,SAAS;;MCcX,aAAa;IAoChB,uBAAuB,CAAC,CAAa;QAC3C,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;KAChC;IAMO,sBAAsB,CAAC,CAAa;QAC1C,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;KAC/B;IAED;;;;;;;yBAnCsB,KAAK;0BAOJ,KAAK;sBAIT,KAAK;8BAIY,QAAQ;QAqB1C,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACtE;IAED,MAAM;;QACJ,QACEA,QAACC,UAAI,uDACHD,kEAAK,KAAK,EAAC,gBAAgB,IACxB,IAAI,CAAC,eAAe,KACnBA,qEACE,KAAK,EAAC,aAAa,EACnB,IAAI,EAAE,IAAI,CAAC,eAAe,EAC1B,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACV,CACH,EACDA,kEAAK,KAAK,EAAC,mBAAmB,IAC5BA,kEAAK,KAAK,EAAC,cAAc,IACvBA,oEAAa,CACT,EACL,CAAC,EAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,IAAI,EAAE,CAAA,KACxBA,qEACE,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,uBAAuB,IAEpC,IAAI,CAAC,UAAU,CACT,CACV,CACG,EACL,IAAI,CAAC,SAAS,KACbA,qEACE,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAEpCA,qEACE,IAAI,EAAC,iBAAiB,EACtB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACV,CACK,CACV,CACG,CACD,EACP;KACH;;;;;;","names":["h","Host"],"sources":["src/components/z-notification/styles.css?tag=z-notification&encapsulation=shadow","src/components/z-notification/index.tsx"],"sourcesContent":[":host {\n --z-notification--top-offset: 0;\n --z-notification--content-max-width: 100%;\n --z-notification--inline-padding: ;\n\n display: block;\n width: 100%;\n}\n\n.main-container {\n display: flex;\n max-width: var(--z-notification--content-max-width);\n align-items: flex-start;\n padding: calc(var(--space-unit) * 2) var(--z-notification--inline-padding, calc(var(--space-unit) * 2));\n margin: 0 auto;\n background-color: transparent;\n font-family: var(--font-family-sans);\n}\n\n:host([sticky]) {\n position: sticky;\n top: var(--z-notification--top-offset);\n}\n\n:host([sticky]),\n:host([showshadow]) {\n box-shadow: var(--shadow-3);\n}\n\n:host([type=\"success\"]) {\n background: var(--color-inverse-success);\n}\n\n:host([type=\"warning\"]) {\n background: var(--color-inverse-warning);\n}\n\n:host([type=\"error\"]) {\n background: var(--color-inverse-error);\n}\n\n.status-icon,\n.close-button {\n /* simulate the line-height of the text\n to make the icon look correctly aligned with it. */\n display: flex;\n height: 20px;\n align-items: center;\n}\n\n:host([type=\"success\"]) .status-icon {\n fill: var(--color-default-success);\n}\n\n:host([type=\"warning\"]) .status-icon {\n fill: var(--color-default-warning);\n}\n\n:host([type=\"error\"]) .status-icon {\n fill: var(--color-default-error);\n}\n\n:host([borderposition=\"bottom\"]) {\n border-bottom: var(--border-size-medium) solid var(--color-surface03);\n}\n\n:host([borderposition=\"top\"]) {\n border-top: var(--border-size-medium) solid var(--color-surface03);\n}\n\nbutton {\n padding: 0;\n border: none;\n margin: 0;\n background: transparent;\n cursor: pointer;\n font-family: inherit;\n}\n\n.status-icon + .content-container {\n margin-left: var(--space-unit);\n}\n\n.content-container {\n display: flex;\n flex: 1 auto;\n flex-wrap: wrap;\n align-items: baseline;\n justify-content: space-between;\n row-gap: calc(var(--space-unit) * 2);\n}\n\n.content-text {\n width: 100%;\n color: var(--color-default-text);\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.action-button {\n color: var(--color-primary01);\n font-size: var(--font-size-1);\n font-weight: var(--font-sb);\n letter-spacing: 0.32px;\n line-height: 1.333;\n outline: none;\n}\n\n.action-button:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n}\n\n.content-container + .close-button {\n margin-left: calc(var(--space-unit) * 2);\n}\n\n.close-button z-icon {\n fill: var(--color-primary01);\n}\n\n/* Tablet breakpoint */\n@media (min-width: 768px) {\n .content-container {\n flex-wrap: nowrap;\n }\n\n .content-text + .action-button {\n margin-left: calc(var(--space-unit) * 5);\n }\n}\n","import {Component, Event, EventEmitter, Host, Prop, h} from \"@stencil/core\";\nimport {NotificationType} from \"../../beans\";\n\n/**\n * Notification bar component.\n * @slot - The text of the notification.\n * @cssprop --z-notification--top-offset - The top offset of the notification. Use it when `sticky` prop is set to `true` and you need the notification to stay under other sticky elements. Default: 0px.\n * @cssprop --z-notification--content-max-width - The max width of the notification content. Useful to align the content with other elements on the page, keeping the colored background full width. Default: 100%. Note: the content is automatically centered, so if you want to limit the width only for the slotted content, you can wrap it in a container with the desired width and leave the `z-notification` width to 100%.\n * @cssprop --z-notification--inline-padding - The inline padding of the notification content. It can be useful to align the content when the `--z-notification--content-max-width` is set. Default: calc(var(--space-unit) * 2).\n */\n@Component({\n tag: \"z-notification\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZNotification {\n /** Name of the icon on the left of the content */\n @Prop()\n contenticonname?: string;\n\n /** Action button text */\n @Prop()\n actiontext?: string;\n\n /** Alert variant type */\n @Prop({reflect: true})\n type: NotificationType;\n\n /** Enable close icon */\n @Prop()\n showclose?: boolean = false;\n\n /**\n * Enable shadow.\n * @deprecated shadow is available only for the `sticky` version of the notification.\n */\n @Prop({reflect: true})\n showshadow?: boolean = false;\n\n /** Enable sticky notification bar. */\n @Prop({reflect: true})\n sticky?: boolean = false;\n\n /** Border position */\n @Prop({reflect: true})\n borderposition?: \"top\" | \"bottom\" = \"bottom\";\n\n /** Call to action clicked */\n @Event()\n notificationAction: EventEmitter;\n\n private handleActionButtonClick(e: MouseEvent): void {\n e.preventDefault();\n this.notificationAction.emit();\n }\n\n /** Close button clicked */\n @Event()\n notificationClose: EventEmitter;\n\n private handleCloseButtonClick(e: MouseEvent): void {\n e.preventDefault();\n this.notificationClose.emit();\n }\n\n constructor() {\n this.handleActionButtonClick = this.handleActionButtonClick.bind(this);\n this.handleCloseButtonClick = this.handleCloseButtonClick.bind(this);\n }\n\n render(): HTMLZNotificationElement {\n return (\n <Host>\n <div class=\"main-container\">\n {this.contenticonname && (\n <z-icon\n class=\"status-icon\"\n name={this.contenticonname}\n width={16}\n height={16}\n />\n )}\n <div class=\"content-container\">\n <div class=\"content-text\">\n <slot></slot>\n </div>\n {!!this.actiontext?.trim() && (\n <button\n class=\"action-button\"\n type=\"button\"\n onClick={this.handleActionButtonClick}\n >\n {this.actiontext}\n </button>\n )}\n </div>\n {this.showclose && (\n <button\n class=\"close-button\"\n type=\"button\"\n onClick={this.handleCloseButtonClick}\n >\n <z-icon\n name=\"multiply-circle\"\n width={16}\n height={16}\n />\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -124,7 +124,7 @@ export class ZBreadcrumb {
|
|
|
124
124
|
"homepage-text": this.homepageVariant === BreadcrumbHomepageVariant.TEXT,
|
|
125
125
|
}, href: this.homepageNode.path, onClick: (e) => this.handlePreventFollowUrl(e, this.homepageNode), innerHTML: this.homepageVariant === BreadcrumbHomepageVariant.ICON
|
|
126
126
|
? `<z-icon name="home" />`
|
|
127
|
-
: this.homepageNode.text || "Home" }), this.pathsList.length > 0 && (h("z-icon", { class: "separator", name: "chevron-right" }))));
|
|
127
|
+
: this.homepageNode.text || "Home" }), this.pathsList.length > 0 && (h("z-icon", { class: "separator", name: "chevron-right", "aria-hidden": "true" }))));
|
|
128
128
|
}
|
|
129
129
|
togglePopover() {
|
|
130
130
|
if (!this.collapsedElementsRef.open) {
|
|
@@ -169,7 +169,7 @@ export class ZBreadcrumb {
|
|
|
169
169
|
setTimeout(() => {
|
|
170
170
|
this.anchorElements[0].focus();
|
|
171
171
|
}, 100);
|
|
172
|
-
}, innerHTML: "…" }), this.pathsList.length > 0 && (h("z-icon", { class: "separator", name: "chevron-right" }))));
|
|
172
|
+
}, innerHTML: "…" }), this.pathsList.length > 0 && (h("z-icon", { class: "separator", name: "chevron-right", "aria-hidden": "true" }))));
|
|
173
173
|
}
|
|
174
174
|
renderMobileItems() {
|
|
175
175
|
// show only the second to last element
|
|
@@ -195,14 +195,14 @@ export class ZBreadcrumb {
|
|
|
195
195
|
if (item.hasTooltip) {
|
|
196
196
|
this.popoverEllipsisOpen = false;
|
|
197
197
|
}
|
|
198
|
-
}, innerHTML: item.text }), index !== this.pathsList.length - 1 && (h("z-icon", { class: "separator", name: "chevron-right" }))))),
|
|
198
|
+
}, innerHTML: item.text }), index !== this.pathsList.length - 1 && (h("z-icon", { class: "separator", name: "chevron-right", "aria-hidden": "true" }))))),
|
|
199
199
|
];
|
|
200
200
|
}
|
|
201
201
|
render() {
|
|
202
|
-
return (h(Host, { key: '
|
|
202
|
+
return (h(Host, { key: '993ff7342e79780d9d8f1e7e5cad29bb9de83f9b', style: { "--line-clamp-popover": `${this.overflowMenuItemRows}` } }, h("nav", { key: '6da884ebe41963ce1de9e6279ea4b157e9472b24', ref: (val) => (this.wrapElement = val), "aria-label": "Breadcrumb", class: {
|
|
203
203
|
semibold: this.pathStyle === BreadcrumbPathStyle.SEMIBOLD,
|
|
204
204
|
underlined: this.pathStyle === BreadcrumbPathStyle.UNDERLINED,
|
|
205
|
-
} }, h("ol", { key: '
|
|
205
|
+
} }, h("ol", { key: '26b05c1cb46299aa77c793078f3a6d9d53aede77' }, this.viewPortWidth === Device.MOBILE ? this.renderMobileItems() : this.renderItems()))));
|
|
206
206
|
}
|
|
207
207
|
static get is() { return "z-breadcrumb"; }
|
|
208
208
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,E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AC,oBAAoB,EAAE,EAAC;YACnE,4DACE,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,gBAC3B,YAAY,EACvB,KAAK,EAAE;oBACL,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAK,mBAAmB,CAAC,QAAQ;oBACzD,UAAU,EAAE,IAAI,CAAC,SAAS,KAAK,mBAAmB,CAAC,UAAU;iBAC9D;gBAED,6DAAK,IAAI,CAAC,aAAa,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAM,CAC3F,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {\n BreadcrumbHomepageVariant,\n BreadcrumbPath,\n BreadcrumbPathStyle,\n Device,\n KeyboardCode,\n ListSize,\n PopoverPosition,\n} from \"../../beans\";\nimport {getDevice, handleKeyboardSubmit} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-breadcrumb\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZBreadcrumb {\n /* Accessibility references */\n /* Overflow-menu: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ */\n /* Breadcrumb: https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/ */\n /* Focus on multiline link: https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html */\n\n @Element() hostElement: HTMLZBreadcrumbElement;\n\n /** [optional] Sets the path style */\n @Prop({reflect: true})\n pathStyle?: BreadcrumbPathStyle = BreadcrumbPathStyle.UNDERLINED;\n\n /** [optional] Variant of first node */\n @Prop()\n homepageVariant?: BreadcrumbHomepageVariant = BreadcrumbHomepageVariant.ICON;\n\n /** [optional] Sets max number of element to show */\n @Prop()\n maxNodesToShow? = 5;\n\n /** [optional] Controls the behaviour on <a> tag click/enter */\n @Prop()\n preventFollowUrl? = false;\n\n /** [optional] Sets max number of row for each path inside the popover. Zero equals unlimited */\n @Prop()\n overflowMenuItemRows? = 0;\n\n /** [optional] Sets the maximun number of chars per single node */\n @Prop()\n truncateChar? = 30;\n\n /** Handle mobile */\n @State()\n viewPortWidth: Device;\n\n /** Detect whether the length of the nodes shown exceeds the container length */\n @State()\n hasOverflow = false;\n\n @State()\n popoverEllipsisOpen = false;\n\n /** Emitted when preventFollowUrl=true to handle custom page transition */\n @Event()\n clickOnNode: EventEmitter<BreadcrumbPath[\"path\"]>;\n\n private pathsList: BreadcrumbPath[];\n\n private pathListCopy: BreadcrumbPath[];\n\n private collapsedElements: BreadcrumbPath[] = [];\n\n private collapsedElementsRef: HTMLZPopoverElement;\n\n private triggerButton: HTMLButtonElement;\n\n private wrapElement: HTMLElement;\n\n private currentIndex = 0;\n\n private homepageNode: BreadcrumbPath;\n\n private anchorElements;\n\n private currentEllipsisText: string;\n\n private truncatePosition = null;\n\n @Listen(\"resize\", {target: \"window\"})\n handleResize(): void {\n this.viewPortWidth = getDevice();\n if (\n this.viewPortWidth !== Device.MOBILE &&\n this.wrapElement &&\n this.wrapElement.scrollWidth > this.wrapElement.clientWidth\n ) {\n this.hasOverflow = true;\n }\n }\n // eslint-disable-next-line lines-between-class-members\n @Watch(\"maxNodesToShow\")\n handlePropChange(): void {\n this.initializeBreadcrumb();\n }\n\n @Watch(\"viewPortWidth\")\n handleResizeUp(newValue: Device, oldValue: Device): void {\n if (\n newValue === Device.MOBILE ||\n (oldValue === Device.MOBILE && newValue === Device.TABLET) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.DESKTOP && newValue === Device.DESKTOP_WIDE)\n ) {\n this.initializeBreadcrumb();\n }\n }\n\n componentWillLoad(): void {\n this.viewPortWidth = getDevice();\n this.initializeBreadcrumb();\n }\n\n componentWillRender(): void {\n if (this.viewPortWidth !== Device.MOBILE && this.hasOverflow) {\n this.checkEllipsisOrOverflowMenu();\n this.hasOverflow = false;\n }\n }\n\n componentDidRender(): void {\n if (this.collapsedElementsRef) {\n this.anchorElements = Array.from(this.hostElement.shadowRoot.querySelectorAll(\"z-list-group a\"));\n }\n\n if (this.viewPortWidth !== Device.MOBILE) {\n requestAnimationFrame(() => {\n if (this.wrapElement.scrollWidth > this.wrapElement.clientWidth) {\n if (!this.hasOverflow) {\n this.hasOverflow = true;\n }\n }\n });\n }\n }\n\n private initializeBreadcrumb(): void {\n if (this.viewPortWidth === Device.MOBILE) {\n this.pathsList = this.getPathsItemsList().filter((item) => !!item.path);\n } else {\n this.pathsList = this.getPathsItemsList();\n }\n this.homepageNode = this.pathsList.shift();\n this.pathListCopy = [...this.pathsList];\n this.collapsedElements = [];\n if (this.pathsList.length > this.maxNodesToShow) {\n this.collapsedElements = this.pathsList.splice(0, this.pathsList.length - 2);\n }\n }\n\n private checkEllipsisOrOverflowMenu(): void {\n for (let i = 0; i < this.pathsList.length; i++) {\n if (this.pathsList[i].text.length <= this.truncateChar) {\n continue;\n }\n\n if (this.truncatePosition > 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition));\n this.pathsList.splice(0, this.truncatePosition);\n this.truncatePosition = 0;\n\n return;\n } else if (this.truncatePosition === 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition + 1));\n this.pathsList.splice(0, this.truncatePosition + 1);\n this.truncatePosition = null;\n\n return;\n }\n\n if (i !== this.pathsList.length - 1) {\n const truncatedString = this.truncateWithEllipsis(this.pathsList[i].text, this.truncateChar);\n this.currentEllipsisText = this.pathsList[i].text;\n this.pathsList[i].text = truncatedString;\n this.pathsList[i].hasTooltip = true;\n this.truncatePosition = i;\n\n return;\n }\n }\n }\n\n private truncateWithEllipsis(str: string, maxLength: number): string {\n if (str.length <= maxLength) {\n return str;\n }\n\n return str.substring(0, maxLength - 1) + \"…\";\n }\n\n private getPathsItemsList(): BreadcrumbPath[] {\n return Array.from(this.hostElement.children).map((item: HTMLAnchorElement) => {\n return {\n text: item.textContent,\n path: item.href,\n hasTooltip: false,\n };\n });\n }\n\n private renderHomepageNode(): HTMLLIElement {\n return (\n <li>\n <a\n class={{\n \"homepage-text\": this.homepageVariant === BreadcrumbHomepageVariant.TEXT,\n }}\n href={this.homepageNode.path}\n onClick={(e) => this.handlePreventFollowUrl(e, this.homepageNode)}\n innerHTML={\n this.homepageVariant === BreadcrumbHomepageVariant.ICON\n ? `<z-icon name=\"home\" />`\n : this.homepageNode.text || \"Home\"\n }\n />\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n />\n )}\n </li>\n );\n }\n\n private togglePopover(): void {\n if (!this.collapsedElementsRef.open) {\n this.collapsedElementsRef.open = true;\n }\n }\n\n private handlePreventFollowUrl(e: MouseEvent, item): void {\n if (this.preventFollowUrl) {\n e.preventDefault();\n this.clickOnNode.emit(item.path);\n }\n }\n\n private handleOverflowMenuAccessibility(e: KeyboardEvent): void {\n const anchorElementsLenght = this.anchorElements.length;\n if (e.key === KeyboardCode.TAB) {\n e.preventDefault();\n\n return;\n }\n e.stopPropagation();\n const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];\n if (arrows.includes(e.key as KeyboardCode)) {\n e.preventDefault();\n\n if (e.key === KeyboardCode.ARROW_DOWN) {\n this.currentIndex = anchorElementsLenght === this.currentIndex + 1 ? 0 : this.currentIndex + 1;\n }\n if (e.key === KeyboardCode.ARROW_UP) {\n this.currentIndex = this.currentIndex <= 0 ? anchorElementsLenght - 1 : this.currentIndex - 1;\n }\n\n this.anchorElements[this.currentIndex].focus();\n }\n\n if (e.key === KeyboardCode.ESC) {\n this.triggerButton.focus();\n }\n }\n\n private renderOverflowMenu(): HTMLLIElement {\n return (\n <li>\n <z-popover\n class=\"hidden-paths-popover\"\n ref={(val) => (this.collapsedElementsRef = val as HTMLZPopoverElement)}\n bindTo={this.triggerButton}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable\n showArrow\n >\n <div class=\"popover-content\">\n <z-list>\n <z-list-group size={ListSize.SMALL}>\n {this.collapsedElements.map((item, index, array) => {\n return (\n <div>\n <z-list-element clickable>\n <a\n class=\"text-ellipsis\"\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onKeyDown={(e) => this.handleOverflowMenuAccessibility(e)}\n innerHTML={item.text}\n />\n </z-list-element>\n {index < array.length - 1 && <z-divider color=\"color-surface03\"></z-divider>}\n </div>\n );\n })}\n </z-list-group>\n </z-list>\n </div>\n </z-popover>\n <button\n class=\"dots\"\n ref={(el) => (this.triggerButton = el)}\n aria-label=\"Mostra più breadcrumb\"\n aria-haspopup=\"true\"\n onClick={() => {\n this.togglePopover();\n }}\n onKeyDown={(e) => {\n handleKeyboardSubmit(e, this.togglePopover.bind(this));\n setTimeout(() => {\n this.anchorElements[0].focus();\n }, 100);\n }}\n innerHTML=\"…\"\n ></button>\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n />\n )}\n </li>\n );\n }\n\n private renderMobileItems(): HTMLLIElement {\n // show only the second to last element\n const secondToLastPath = this.pathsList[this.pathsList.length - 1];\n\n if (!secondToLastPath) {\n return;\n }\n\n return (\n <li>\n <a\n aria-current={secondToLastPath.path ? undefined : \"page\"}\n href={secondToLastPath.path}\n onClick={(e) => this.handlePreventFollowUrl(e, secondToLastPath)}\n >\n <z-icon name=\"chevron-left\" />\n <span\n class={{\n \"missing-path\": !secondToLastPath.path,\n \"text-ellipsis\": true,\n }}\n >\n {secondToLastPath.text}\n </span>\n </a>\n </li>\n );\n }\n\n private renderItems(): HTMLElement[] {\n let trigger;\n\n return [\n this.renderHomepageNode(),\n this.collapsedElements.length > 0 && this.renderOverflowMenu(),\n ...this.pathsList.map((item, index) => (\n <li>\n {item.hasTooltip && (\n <z-popover\n class=\"full-path-tooltip\"\n bindTo={trigger}\n open={this.popoverEllipsisOpen}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable={false}\n showArrow\n >\n <span class=\"tooltip-content\">{this.currentEllipsisText}</span>\n </z-popover>\n )}\n <a\n class={{\"missing-path\": !item.path}}\n ref={(val) => (trigger = val)}\n aria-current={item.path ? undefined : \"page\"}\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onMouseOver={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = true;\n }\n }}\n onMouseLeave={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = false;\n }\n }}\n innerHTML={item.text}\n />\n {index !== this.pathsList.length - 1 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n />\n )}\n </li>\n )),\n ];\n }\n\n render(): HTMLZBreadcrumbElement {\n return (\n <Host style={{\"--line-clamp-popover\": `${this.overflowMenuItemRows}`}}>\n <nav\n ref={(val) => (this.wrapElement = val)}\n aria-label=\"Breadcrumb\"\n class={{\n semibold: this.pathStyle === BreadcrumbPathStyle.SEMIBOLD,\n underlined: this.pathStyle === BreadcrumbPathStyle.UNDERLINED,\n }}\n >\n <ol>{this.viewPortWidth === Device.MOBILE ? this.renderMobileItems() : this.renderItems()}</ol>\n </nav>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,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E,EAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,oBAAoB,EAAE,EAAC;YACnE,4DACE,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,gBAC3B,YAAY,EACvB,KAAK,EAAE;oBACL,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAK,mBAAmB,CAAC,QAAQ;oBACzD,UAAU,EAAE,IAAI,CAAC,SAAS,KAAK,mBAAmB,CAAC,UAAU;iBAC9D;gBAED,6DAAK,IAAI,CAAC,aAAa,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAM,CAC3F,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {\n BreadcrumbHomepageVariant,\n BreadcrumbPath,\n BreadcrumbPathStyle,\n Device,\n KeyboardCode,\n ListSize,\n PopoverPosition,\n} from \"../../beans\";\nimport {getDevice, handleKeyboardSubmit} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-breadcrumb\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZBreadcrumb {\n /* Accessibility references */\n /* Overflow-menu: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ */\n /* Breadcrumb: https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/ */\n /* Focus on multiline link: https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html */\n\n @Element() hostElement: HTMLZBreadcrumbElement;\n\n /** [optional] Sets the path style */\n @Prop({reflect: true})\n pathStyle?: BreadcrumbPathStyle = BreadcrumbPathStyle.UNDERLINED;\n\n /** [optional] Variant of first node */\n @Prop()\n homepageVariant?: BreadcrumbHomepageVariant = BreadcrumbHomepageVariant.ICON;\n\n /** [optional] Sets max number of element to show */\n @Prop()\n maxNodesToShow? = 5;\n\n /** [optional] Controls the behaviour on <a> tag click/enter */\n @Prop()\n preventFollowUrl? = false;\n\n /** [optional] Sets max number of row for each path inside the popover. Zero equals unlimited */\n @Prop()\n overflowMenuItemRows? = 0;\n\n /** [optional] Sets the maximun number of chars per single node */\n @Prop()\n truncateChar? = 30;\n\n /** Handle mobile */\n @State()\n viewPortWidth: Device;\n\n /** Detect whether the length of the nodes shown exceeds the container length */\n @State()\n hasOverflow = false;\n\n @State()\n popoverEllipsisOpen = false;\n\n /** Emitted when preventFollowUrl=true to handle custom page transition */\n @Event()\n clickOnNode: EventEmitter<BreadcrumbPath[\"path\"]>;\n\n private pathsList: BreadcrumbPath[];\n\n private pathListCopy: BreadcrumbPath[];\n\n private collapsedElements: BreadcrumbPath[] = [];\n\n private collapsedElementsRef: HTMLZPopoverElement;\n\n private triggerButton: HTMLButtonElement;\n\n private wrapElement: HTMLElement;\n\n private currentIndex = 0;\n\n private homepageNode: BreadcrumbPath;\n\n private anchorElements;\n\n private currentEllipsisText: string;\n\n private truncatePosition = null;\n\n @Listen(\"resize\", {target: \"window\"})\n handleResize(): void {\n this.viewPortWidth = getDevice();\n if (\n this.viewPortWidth !== Device.MOBILE &&\n this.wrapElement &&\n this.wrapElement.scrollWidth > this.wrapElement.clientWidth\n ) {\n this.hasOverflow = true;\n }\n }\n // eslint-disable-next-line lines-between-class-members\n @Watch(\"maxNodesToShow\")\n handlePropChange(): void {\n this.initializeBreadcrumb();\n }\n\n @Watch(\"viewPortWidth\")\n handleResizeUp(newValue: Device, oldValue: Device): void {\n if (\n newValue === Device.MOBILE ||\n (oldValue === Device.MOBILE && newValue === Device.TABLET) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP) ||\n (oldValue === Device.MOBILE && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP) ||\n (oldValue === Device.TABLET && newValue === Device.DESKTOP_WIDE) ||\n (oldValue === Device.DESKTOP && newValue === Device.DESKTOP_WIDE)\n ) {\n this.initializeBreadcrumb();\n }\n }\n\n componentWillLoad(): void {\n this.viewPortWidth = getDevice();\n this.initializeBreadcrumb();\n }\n\n componentWillRender(): void {\n if (this.viewPortWidth !== Device.MOBILE && this.hasOverflow) {\n this.checkEllipsisOrOverflowMenu();\n this.hasOverflow = false;\n }\n }\n\n componentDidRender(): void {\n if (this.collapsedElementsRef) {\n this.anchorElements = Array.from(this.hostElement.shadowRoot.querySelectorAll(\"z-list-group a\"));\n }\n\n if (this.viewPortWidth !== Device.MOBILE) {\n requestAnimationFrame(() => {\n if (this.wrapElement.scrollWidth > this.wrapElement.clientWidth) {\n if (!this.hasOverflow) {\n this.hasOverflow = true;\n }\n }\n });\n }\n }\n\n private initializeBreadcrumb(): void {\n if (this.viewPortWidth === Device.MOBILE) {\n this.pathsList = this.getPathsItemsList().filter((item) => !!item.path);\n } else {\n this.pathsList = this.getPathsItemsList();\n }\n this.homepageNode = this.pathsList.shift();\n this.pathListCopy = [...this.pathsList];\n this.collapsedElements = [];\n if (this.pathsList.length > this.maxNodesToShow) {\n this.collapsedElements = this.pathsList.splice(0, this.pathsList.length - 2);\n }\n }\n\n private checkEllipsisOrOverflowMenu(): void {\n for (let i = 0; i < this.pathsList.length; i++) {\n if (this.pathsList[i].text.length <= this.truncateChar) {\n continue;\n }\n\n if (this.truncatePosition > 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition));\n this.pathsList.splice(0, this.truncatePosition);\n this.truncatePosition = 0;\n\n return;\n } else if (this.truncatePosition === 0) {\n this.collapsedElements.push(...this.pathListCopy.splice(0, this.truncatePosition + 1));\n this.pathsList.splice(0, this.truncatePosition + 1);\n this.truncatePosition = null;\n\n return;\n }\n\n if (i !== this.pathsList.length - 1) {\n const truncatedString = this.truncateWithEllipsis(this.pathsList[i].text, this.truncateChar);\n this.currentEllipsisText = this.pathsList[i].text;\n this.pathsList[i].text = truncatedString;\n this.pathsList[i].hasTooltip = true;\n this.truncatePosition = i;\n\n return;\n }\n }\n }\n\n private truncateWithEllipsis(str: string, maxLength: number): string {\n if (str.length <= maxLength) {\n return str;\n }\n\n return str.substring(0, maxLength - 1) + \"…\";\n }\n\n private getPathsItemsList(): BreadcrumbPath[] {\n return Array.from(this.hostElement.children).map((item: HTMLAnchorElement) => {\n return {\n text: item.textContent,\n path: item.href,\n hasTooltip: false,\n };\n });\n }\n\n private renderHomepageNode(): HTMLLIElement {\n return (\n <li>\n <a\n class={{\n \"homepage-text\": this.homepageVariant === BreadcrumbHomepageVariant.TEXT,\n }}\n href={this.homepageNode.path}\n onClick={(e) => this.handlePreventFollowUrl(e, this.homepageNode)}\n innerHTML={\n this.homepageVariant === BreadcrumbHomepageVariant.ICON\n ? `<z-icon name=\"home\" />`\n : this.homepageNode.text || \"Home\"\n }\n />\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n aria-hidden=\"true\"\n />\n )}\n </li>\n );\n }\n\n private togglePopover(): void {\n if (!this.collapsedElementsRef.open) {\n this.collapsedElementsRef.open = true;\n }\n }\n\n private handlePreventFollowUrl(e: MouseEvent, item): void {\n if (this.preventFollowUrl) {\n e.preventDefault();\n this.clickOnNode.emit(item.path);\n }\n }\n\n private handleOverflowMenuAccessibility(e: KeyboardEvent): void {\n const anchorElementsLenght = this.anchorElements.length;\n if (e.key === KeyboardCode.TAB) {\n e.preventDefault();\n\n return;\n }\n e.stopPropagation();\n const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];\n if (arrows.includes(e.key as KeyboardCode)) {\n e.preventDefault();\n\n if (e.key === KeyboardCode.ARROW_DOWN) {\n this.currentIndex = anchorElementsLenght === this.currentIndex + 1 ? 0 : this.currentIndex + 1;\n }\n if (e.key === KeyboardCode.ARROW_UP) {\n this.currentIndex = this.currentIndex <= 0 ? anchorElementsLenght - 1 : this.currentIndex - 1;\n }\n\n this.anchorElements[this.currentIndex].focus();\n }\n\n if (e.key === KeyboardCode.ESC) {\n this.triggerButton.focus();\n }\n }\n\n private renderOverflowMenu(): HTMLLIElement {\n return (\n <li>\n <z-popover\n class=\"hidden-paths-popover\"\n ref={(val) => (this.collapsedElementsRef = val as HTMLZPopoverElement)}\n bindTo={this.triggerButton}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable\n showArrow\n >\n <div class=\"popover-content\">\n <z-list>\n <z-list-group size={ListSize.SMALL}>\n {this.collapsedElements.map((item, index, array) => {\n return (\n <div>\n <z-list-element clickable>\n <a\n class=\"text-ellipsis\"\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onKeyDown={(e) => this.handleOverflowMenuAccessibility(e)}\n innerHTML={item.text}\n />\n </z-list-element>\n {index < array.length - 1 && <z-divider color=\"color-surface03\"></z-divider>}\n </div>\n );\n })}\n </z-list-group>\n </z-list>\n </div>\n </z-popover>\n <button\n class=\"dots\"\n ref={(el) => (this.triggerButton = el)}\n aria-label=\"Mostra più breadcrumb\"\n aria-haspopup=\"true\"\n onClick={() => {\n this.togglePopover();\n }}\n onKeyDown={(e) => {\n handleKeyboardSubmit(e, this.togglePopover.bind(this));\n setTimeout(() => {\n this.anchorElements[0].focus();\n }, 100);\n }}\n innerHTML=\"…\"\n ></button>\n {this.pathsList.length > 0 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n aria-hidden=\"true\"\n />\n )}\n </li>\n );\n }\n\n private renderMobileItems(): HTMLLIElement {\n // show only the second to last element\n const secondToLastPath = this.pathsList[this.pathsList.length - 1];\n\n if (!secondToLastPath) {\n return;\n }\n\n return (\n <li>\n <a\n aria-current={secondToLastPath.path ? undefined : \"page\"}\n href={secondToLastPath.path}\n onClick={(e) => this.handlePreventFollowUrl(e, secondToLastPath)}\n >\n <z-icon name=\"chevron-left\" />\n <span\n class={{\n \"missing-path\": !secondToLastPath.path,\n \"text-ellipsis\": true,\n }}\n >\n {secondToLastPath.text}\n </span>\n </a>\n </li>\n );\n }\n\n private renderItems(): HTMLElement[] {\n let trigger;\n\n return [\n this.renderHomepageNode(),\n this.collapsedElements.length > 0 && this.renderOverflowMenu(),\n ...this.pathsList.map((item, index) => (\n <li>\n {item.hasTooltip && (\n <z-popover\n class=\"full-path-tooltip\"\n bindTo={trigger}\n open={this.popoverEllipsisOpen}\n position={PopoverPosition.BOTTOM_RIGHT}\n closable={false}\n showArrow\n >\n <span class=\"tooltip-content\">{this.currentEllipsisText}</span>\n </z-popover>\n )}\n <a\n class={{\"missing-path\": !item.path}}\n ref={(val) => (trigger = val)}\n aria-current={item.path ? undefined : \"page\"}\n href={item.path}\n onClick={(e) => this.handlePreventFollowUrl(e, item)}\n onMouseOver={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = true;\n }\n }}\n onMouseLeave={() => {\n if (item.hasTooltip) {\n this.popoverEllipsisOpen = false;\n }\n }}\n innerHTML={item.text}\n />\n {index !== this.pathsList.length - 1 && (\n <z-icon\n class=\"separator\"\n name=\"chevron-right\"\n aria-hidden=\"true\"\n />\n )}\n </li>\n )),\n ];\n }\n\n render(): HTMLZBreadcrumbElement {\n return (\n <Host style={{\"--line-clamp-popover\": `${this.overflowMenuItemRows}`}}>\n <nav\n ref={(val) => (this.wrapElement = val)}\n aria-label=\"Breadcrumb\"\n class={{\n semibold: this.pathStyle === BreadcrumbPathStyle.SEMIBOLD,\n underlined: this.pathStyle === BreadcrumbPathStyle.UNDERLINED,\n }}\n >\n <ol>{this.viewPortWidth === Device.MOBILE ? this.renderMobileItems() : this.renderItems()}</ol>\n </nav>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -32,10 +32,13 @@ export class ZButton {
|
|
|
32
32
|
return this.icon && h("z-icon", { name: this.icon });
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
const normalizedAriaLabel = ((_a = this.ariaLabel) === null || _a === void 0 ? void 0 : _a.trim()) || undefined;
|
|
37
|
+
const normalizedRole = this.htmlrole || ((_b = this.role) === null || _b === void 0 ? void 0 : _b.trim()) || undefined;
|
|
35
38
|
if (this.href) {
|
|
36
|
-
return (h("a", Object.assign({}, this.getAttributes(), { "aria-label":
|
|
39
|
+
return (h("a", Object.assign({}, this.getAttributes(), { "aria-label": normalizedAriaLabel, href: this.href, target: this.target }), this.renderIcon(), h("slot", null)));
|
|
37
40
|
}
|
|
38
|
-
return (h("button", Object.assign({}, this.getAttributes(), { "aria-label":
|
|
41
|
+
return (h("button", Object.assign({}, this.getAttributes(), { "aria-label": normalizedAriaLabel, name: this.name, type: this.type, disabled: this.disabled, role: normalizedRole }), this.renderIcon(), h("slot", null)));
|
|
39
42
|
}
|
|
40
43
|
static get is() { return "z-button"; }
|
|
41
44
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAa,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAE7F;;GAEG;AAOH,MAAM,OAAO,OAAO;;yBAKc,SAAS;oBAOlC,EAAE;;;;;;wBAwBY,KAAK;oBAIN,UAAU,CAAC,MAAM;uBAIX,aAAa,CAAC,OAAO;;4BAQjB,YAAY,CAAC,IAAI;oBAIb,WAAW,CAAC,GAAG;;IAEzC,aAAa;QACnB,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,MAAM;YACf,KAAK,EAAE;gBACL,qBAAqB,EAAE,IAAI;gBAC3B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AAI,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CACL,yBACM,IAAI,CAAC,aAAa,EAAE,kBACZ,mBAAmB,EAC/B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM;gBAElB,IAAI,CAAC,UAAU,EAAE;gBAClB,eAAQ,CACN,CACL,CAAC;QACJ,CAAC;QAED,OAAO,CACL,8BACM,IAAI,CAAC,aAAa,EAAE,kBACZ,mBAAmB,EAC/B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,cAAc;YAEnB,IAAI,CAAC,UAAU,EAAE;YAClB,eAAQ,CACD,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Prop, h} from \"@stencil/core\";\nimport {JSXBase} from \"@stencil/core/internal\";\nimport {ButtonSize, ButtonType, ButtonVariant, ControlSize, IconPosition} from \"../../beans\";\n\n/**\n * @slot - button label\n */\n@Component({\n tag: \"z-button\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZButton {\n @Element() hostElement: HTMLZButtonElement;\n\n /** defines a string value that labels the internal interactive element. Used for accessibility. */\n @Prop()\n ariaLabel: string | undefined = undefined;\n\n /**\n * **Deprecated:** Use `htmlrole` instead.\n * @deprecated This prop has been deprecated in favor of `htmlrole` for better accessibility.\n */\n @Prop()\n role = \"\";\n\n /** defines role attribute, used for accessibility. */\n @Prop()\n htmlrole?: string;\n\n /** HTML <a> href attribute. If it is set, it renders an HTML <a> tag. */\n @Prop()\n href?: string;\n\n /** HTML a target attribute. */\n @Prop()\n target?: string;\n\n /** Identifier, should be unique. */\n @Prop()\n htmlid?: string;\n\n /** HTML button name attribute. */\n @Prop()\n name?: string;\n\n /** HTML button disabled attribute. */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** HTML button type attribute. */\n @Prop()\n type?: ButtonType = ButtonType.BUTTON;\n\n /** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */\n @Prop({reflect: true})\n variant?: ButtonVariant = ButtonVariant.PRIMARY;\n\n /** `z-icon` name to use (optional). */\n @Prop()\n icon?: string;\n\n /** the button icon position. Defaults to `left` */\n @Prop({reflect: true})\n iconPosition?: IconPosition = IconPosition.LEFT;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop({reflect: true})\n size?: ButtonSize | ControlSize = ControlSize.BIG;\n\n private getAttributes(): JSXBase.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement> {\n return {\n id: this.htmlid,\n class: {\n \"z-button--container\": true,\n \"z-button--has-text\": !!this.hostElement.textContent.trim(),\n },\n };\n }\n\n private renderIcon(): JSX.Element | undefined {\n return this.icon && <z-icon name={this.icon} />;\n }\n\n render(): HTMLAnchorElement | HTMLButtonElement {\n const normalizedAriaLabel = this.ariaLabel?.trim() || undefined;\n const normalizedRole = this.htmlrole || this.role?.trim() || undefined;\n\n if (this.href) {\n return (\n <a\n {...this.getAttributes()}\n aria-label={normalizedAriaLabel}\n href={this.href}\n target={this.target}\n >\n {this.renderIcon()}\n <slot />\n </a>\n );\n }\n\n return (\n <button\n {...this.getAttributes()}\n aria-label={normalizedAriaLabel}\n name={this.name}\n type={this.type}\n disabled={this.disabled}\n role={normalizedRole}\n >\n {this.renderIcon()}\n <slot />\n </button>\n );\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { Fragment, Host } from "@stencil/core/internal";
|
|
3
|
-
import { ControlSize, InputType, LabelPosition } from "../../beans";
|
|
3
|
+
import { ControlSize, InputStatus, InputType, LabelPosition } from "../../beans";
|
|
4
4
|
import { boolean, randomId } from "../../utils/utils";
|
|
5
5
|
export class ZInput {
|
|
6
6
|
constructor() {
|
|
@@ -23,6 +23,7 @@ export class ZInput {
|
|
|
23
23
|
this.htmltitle = undefined;
|
|
24
24
|
this.status = undefined;
|
|
25
25
|
this.message = true;
|
|
26
|
+
this.htmlAriaDescribedBy = undefined;
|
|
26
27
|
this.labelPosition = LabelPosition.RIGHT;
|
|
27
28
|
this.autocomplete = undefined;
|
|
28
29
|
this.role = "";
|
|
@@ -154,6 +155,12 @@ export class ZInput {
|
|
|
154
155
|
getRoleAttribute() {
|
|
155
156
|
return this.role ? { role: this.role } : {};
|
|
156
157
|
}
|
|
158
|
+
inputHasMessage() {
|
|
159
|
+
if (boolean(this.message) === false || boolean(this.message) === true) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
157
164
|
getAriaAttrubutes() {
|
|
158
165
|
const expanded = this.htmlAriaExpanded ? { "aria-expanded": this.htmlAriaExpanded } : {};
|
|
159
166
|
const controls = this.htmlAriaControls ? { "aria-controls": this.htmlAriaControls } : {};
|
|
@@ -161,7 +168,11 @@ export class ZInput {
|
|
|
161
168
|
const activedescendant = this.htmlAriaActivedescendant
|
|
162
169
|
? { "aria-activedescendant": this.htmlAriaActivedescendant }
|
|
163
170
|
: {};
|
|
164
|
-
|
|
171
|
+
const ariaDescribedby = this.htmlAriaDescribedBy || this.inputHasMessage()
|
|
172
|
+
? { "aria-describedby": this.htmlAriaDescribedBy || `${this.htmlid}-message` }
|
|
173
|
+
: {};
|
|
174
|
+
const ariaInvalid = this.status === InputStatus.ERROR ? { "aria-invalid": "true" } : {};
|
|
175
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, expanded), controls), autocomplete), activedescendant), ariaDescribedby), ariaInvalid);
|
|
165
176
|
}
|
|
166
177
|
getFocusBlurAttributes() {
|
|
167
178
|
return {
|
|
@@ -215,13 +226,14 @@ export class ZInput {
|
|
|
215
226
|
if (boolean(this.message) === false) {
|
|
216
227
|
return;
|
|
217
228
|
}
|
|
218
|
-
return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status, class: this.size, disabled: this.disabled }));
|
|
229
|
+
return (h("z-input-message", { "html-id": `${this.htmlid}-message`, message: boolean(this.message) === true ? undefined : this.message, status: this.status, class: this.size, disabled: this.disabled }));
|
|
219
230
|
}
|
|
220
231
|
/* END text/password/email/number */
|
|
221
232
|
/* START textarea */
|
|
222
233
|
renderTextarea() {
|
|
223
234
|
const attributes = this.getTextAttributes();
|
|
224
|
-
|
|
235
|
+
const ariaAttributes = this.getAriaAttrubutes();
|
|
236
|
+
return (h(Fragment, null, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": !!attributes.readonly }) }, h("textarea", Object.assign({}, attributes, ariaAttributes, { class: Object.assign(Object.assign({}, attributes.class), { "z-scrollbar": true }), "aria-label": this.ariaLabel || undefined }, this.getRoleAttribute()))), this.renderMessage()));
|
|
225
237
|
}
|
|
226
238
|
/* END textarea */
|
|
227
239
|
handleCheck(ev) {
|
|
@@ -261,7 +273,7 @@ export class ZInput {
|
|
|
261
273
|
default:
|
|
262
274
|
input = this.renderInputText(this.type);
|
|
263
275
|
}
|
|
264
|
-
return h(Host, { key: '
|
|
276
|
+
return h(Host, { key: '5947648f0faeea551f24f57b685f0872cdabe77e' }, input);
|
|
265
277
|
}
|
|
266
278
|
static get is() { return "z-input"; }
|
|
267
279
|
static get encapsulation() { return "scoped"; }
|
|
@@ -603,6 +615,23 @@ export class ZInput {
|
|
|
603
615
|
"reflect": false,
|
|
604
616
|
"defaultValue": "true"
|
|
605
617
|
},
|
|
618
|
+
"htmlAriaDescribedBy": {
|
|
619
|
+
"type": "string",
|
|
620
|
+
"mutable": false,
|
|
621
|
+
"complexType": {
|
|
622
|
+
"original": "string",
|
|
623
|
+
"resolved": "string",
|
|
624
|
+
"references": {}
|
|
625
|
+
},
|
|
626
|
+
"required": false,
|
|
627
|
+
"optional": true,
|
|
628
|
+
"docs": {
|
|
629
|
+
"tags": [],
|
|
630
|
+
"text": "input helper message id (optional): available for text, password, number, email, textarea - if set, it will be used to populate the aria-describedby attribute, otherwise the attribute (if present) will be populated with an auto-generated value"
|
|
631
|
+
},
|
|
632
|
+
"attribute": "html-aria-described-by",
|
|
633
|
+
"reflect": false
|
|
634
|
+
},
|
|
606
635
|
"labelPosition": {
|
|
607
636
|
"type": "string",
|
|
608
637
|
"mutable": false,
|