@zanichelli/albe-web-components 18.7.1-RC3 → 18.7.2
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 +6 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/placeholder-cover-b679e768.js +7 -0
- package/dist/cjs/placeholder-cover-b679e768.js.map +1 -0
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-book-card.cjs.entry.js +5 -1
- package/dist/cjs/z-book-card.cjs.entry.js.map +1 -1
- package/dist/cjs/z-combobox.cjs.entry.js +3 -3
- package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/z-popover.cjs.entry.js +5 -18
- package/dist/cjs/z-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/z-result-card.cjs.entry.js +11 -2
- package/dist/cjs/z-result-card.cjs.entry.js.map +1 -1
- package/dist/cjs/z-select.cjs.entry.js +13 -5
- package/dist/cjs/z-select.cjs.entry.js.map +1 -1
- package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
- package/dist/cjs/z-toast-notification.cjs.entry.js.map +1 -1
- package/dist/collection/__mocks__/fileMock.js +2 -0
- package/dist/collection/__mocks__/fileMock.js.map +1 -0
- package/dist/collection/components/book-card/z-book-card/index.js +5 -1
- package/dist/collection/components/book-card/z-book-card/index.js.map +1 -1
- package/dist/collection/components/css-components/z-cover/styles.css +2 -2
- package/dist/collection/components/result-card/z-result-card/index.js +27 -1
- package/dist/collection/components/result-card/z-result-card/index.js.map +1 -1
- package/dist/collection/components/result-card/z-result-card/z-result-card.stories.js +7 -0
- package/dist/collection/components/result-card/z-result-card/z-result-card.stories.js.map +1 -1
- package/dist/collection/components/z-combobox/index.js +2 -2
- package/dist/collection/components/z-combobox/index.js.map +1 -1
- package/dist/collection/components/z-combobox/styles.css +7 -2
- package/dist/collection/components/z-popover/index.js +4 -17
- package/dist/collection/components/z-popover/index.js.map +1 -1
- package/dist/collection/components/z-popover/styles.css +6 -2
- package/dist/collection/components/z-select/index.js +13 -5
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-toast-notification/styles.css +2 -2
- package/dist/components/index23.js +5 -18
- package/dist/components/index23.js.map +1 -1
- package/dist/components/placeholder-cover.js +5 -0
- package/dist/components/placeholder-cover.js.map +1 -0
- package/dist/components/z-book-card.js +5 -1
- package/dist/components/z-book-card.js.map +1 -1
- package/dist/components/z-combobox.js +3 -3
- package/dist/components/z-combobox.js.map +1 -1
- package/dist/components/z-result-card.js +12 -2
- package/dist/components/z-result-card.js.map +1 -1
- package/dist/components/z-select.js +13 -5
- package/dist/components/z-select.js.map +1 -1
- package/dist/components/z-toast-notification.js +1 -1
- package/dist/components/z-toast-notification.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/placeholder-cover-9346be8f.js +5 -0
- package/dist/esm/placeholder-cover-9346be8f.js.map +1 -0
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-book-card.entry.js +5 -1
- package/dist/esm/z-book-card.entry.js.map +1 -1
- package/dist/esm/z-combobox.entry.js +3 -3
- package/dist/esm/z-combobox.entry.js.map +1 -1
- package/dist/esm/z-popover.entry.js +5 -18
- package/dist/esm/z-popover.entry.js.map +1 -1
- package/dist/esm/z-result-card.entry.js +11 -2
- package/dist/esm/z-result-card.entry.js.map +1 -1
- package/dist/esm/z-select.entry.js +13 -5
- package/dist/esm/z-select.entry.js.map +1 -1
- package/dist/esm/z-toast-notification.entry.js +1 -1
- package/dist/esm/z-toast-notification.entry.js.map +1 -1
- package/dist/types/__mocks__/fileMock.d.ts +2 -0
- package/dist/types/components/result-card/z-result-card/index.d.ts +2 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/global.d.ts +1 -0
- package/{www/build/p-6a62a0a7.entry.js → dist/web-components-library/p-0eab3c09.entry.js} +2 -2
- package/dist/web-components-library/{p-6a62a0a7.entry.js.map → p-0eab3c09.entry.js.map} +1 -1
- package/dist/web-components-library/p-165d5acc.entry.js +2 -0
- package/dist/web-components-library/p-165d5acc.entry.js.map +1 -0
- package/dist/web-components-library/p-22c755d5.entry.js +2 -0
- package/dist/web-components-library/p-22c755d5.entry.js.map +1 -0
- package/dist/web-components-library/{p-403d780a.entry.js → p-24474394.entry.js} +2 -2
- package/dist/web-components-library/p-24474394.entry.js.map +1 -0
- package/dist/web-components-library/p-62e1d867.entry.js +2 -0
- package/dist/web-components-library/p-62e1d867.entry.js.map +1 -0
- package/dist/web-components-library/p-8d923a1d.js +2 -0
- package/dist/web-components-library/p-8d923a1d.js.map +1 -0
- package/dist/web-components-library/p-d5a77fd2.entry.js +2 -0
- package/dist/web-components-library/p-d5a77fd2.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.css +22 -2
- 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 +2 -1
- package/www/assets/images/png/placeholder-cover.png +0 -0
- package/{dist/web-components-library/p-6a62a0a7.entry.js → www/build/p-0eab3c09.entry.js} +2 -2
- package/www/build/{p-6a62a0a7.entry.js.map → p-0eab3c09.entry.js.map} +1 -1
- package/www/build/p-165d5acc.entry.js +2 -0
- package/www/build/p-165d5acc.entry.js.map +1 -0
- package/www/build/p-22c755d5.entry.js +2 -0
- package/www/build/p-22c755d5.entry.js.map +1 -0
- package/www/build/{p-403d780a.entry.js → p-24474394.entry.js} +2 -2
- package/www/build/p-24474394.entry.js.map +1 -0
- package/www/build/{p-d9ec671d.js → p-3cb315f8.js} +1 -1
- package/www/build/p-62e1d867.entry.js +2 -0
- package/www/build/p-62e1d867.entry.js.map +1 -0
- package/www/build/{p-92615446.css → p-6f397468.css} +22 -2
- package/www/build/p-8d923a1d.js +2 -0
- package/www/build/p-8d923a1d.js.map +1 -0
- package/www/build/p-d5a77fd2.entry.js +2 -0
- package/www/build/p-d5a77fd2.entry.js.map +1 -0
- package/www/build/web-components-library.css +22 -2
- 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-2b8eb0c2.entry.js +0 -2
- package/dist/web-components-library/p-2b8eb0c2.entry.js.map +0 -1
- package/dist/web-components-library/p-302041ec.entry.js +0 -2
- package/dist/web-components-library/p-302041ec.entry.js.map +0 -1
- package/dist/web-components-library/p-403d780a.entry.js.map +0 -1
- package/dist/web-components-library/p-7c3ebd97.entry.js +0 -2
- package/dist/web-components-library/p-7c3ebd97.entry.js.map +0 -1
- package/dist/web-components-library/p-a0ed0c63.entry.js +0 -2
- package/dist/web-components-library/p-a0ed0c63.entry.js.map +0 -1
- package/www/build/p-2b8eb0c2.entry.js +0 -2
- package/www/build/p-2b8eb0c2.entry.js.map +0 -1
- package/www/build/p-302041ec.entry.js +0 -2
- package/www/build/p-302041ec.entry.js.map +0 -1
- package/www/build/p-403d780a.entry.js.map +0 -1
- package/www/build/p-7c3ebd97.entry.js +0 -2
- package/www/build/p-7c3ebd97.entry.js.map +0 -1
- package/www/build/p-a0ed0c63.entry.js +0 -2
- package/www/build/p-a0ed0c63.entry.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZPopoverStyle0","ZPopover","this","spaceTolerance","PopoverPosition","TOP","closePopoverWithKeyboard","e","closable","key","KeyboardCode","ESC","open","handleOutsideClick","target","containsElement","host","boundElement","stopPropagation","validatePosition","newValue","Object","values","includes","AUTO","position","currentPosition","setPosition","onOpen","cancelAnimationFrame","animationFrameRequestId","openChange","emit","assign","style","top","right","bottom","left","maxWidth","maxHeight","visibility","undefined","updatePositionLoop","requestAnimationFrame","setTimeout","onBindingChange","findBoundElement","offsetModifier","center","bindTo","ownerDocument","querySelector","parentElement","hasCenteredHorizontalSpace","availableLeft","availableRight","hostWidth","boundElementWidth","requiredSideSpace","hasCenteredVerticalSpace","availableTop","availableBottom","hostHeight","boundElementHeight","hasEnoughSideSpace","availableSpace","hostSize","boundElementSize","getOptimalPopoverPosition","desiredPosition","offsetWidth","offsetHeight","getBoundingClientRect","width","height","fits","pos","TOP_RIGHT","TOP_LEFT","RIGHT","RIGHT_BOTTOM","RIGHT_TOP","BOTTOM","BOTTOM_LEFT","BOTTOM_RIGHT","LEFT","LEFT_TOP","LEFT_BOTTOM","positions","positionOrder","startIndex","indexOf","i","length","posIndex","findBestFallbackPosition","bestHorizontalDirection","bestVerticalDirection","maxHorizontalSpace","Math","max","maxVerticalSpace","mainDirection","needsSecondaryDirection","minHorizontalSpace","min","minVerticalSpace","secondaryDirection","calculateAvailableSpace","boundElementRect","lastBoundRect","x","y","cachedAvailableSpace","scrollableParent","findScrollableParent","scrollableParentRect","hasNestedScrollableParent","documentElement","documentWidth","clientWidth","documentHeight","clientHeight","safeSpace","deltaTop","deltaRight","deltaBottom","deltaLeft","calculateElementOffsets","element","elementRect","viewportWidth","viewportHeight","applyPositionStyles","distanceFromBound","arrowModifier","showArrow","hostStyle","boundElementOffsets","getDevice","Device","MOBILE","isElementVisibleInContainer","positionChange","componentWillLoad","componentDidLoad","disconnectedCallback","render","h","Host"],"sources":["src/components/z-popover/styles.css?tag=z-popover&encapsulation=shadow","src/components/z-popover/index.tsx"],"sourcesContent":[":host {\n --z-popover-theme--surface: ;\n --z-popover-theme--text: ;\n --z-popover-padding: ;\n --z-popover-shadow-filter: ;\n\n position: fixed;\n display: none;\n max-width: calc(100% - var(--grid-margin) * 2);\n max-height: calc(100% - var(--grid-margin) * 2);\n padding: var(--z-popover-padding, 0);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text, var(--color-default-text));\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));\n text-align: center;\n visibility: hidden; /* hidden by default. the positioning algorithm will set it to 'visible' when needed */\n}\n\n:host([open]:not([open=\"false\"])[current-position]) {\n display: block;\n}\n\n:host([center][current-position=\"top\"]),\n:host([center][current-position=\"bottom\"]) {\n transform: translateX(-50%);\n}\n\n:host([center][current-position=\"right\"]),\n:host([center][current-position=\"left\"]) {\n transform: translateY(-50%);\n}\n\n:host([current-position^=\"top\"]) {\n margin: 0 0 var(--space-unit);\n}\n\n:host([current-position^=\"bottom\"]) {\n margin: var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"left\"]) {\n margin: 0 var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"right\"]) {\n margin: 0 0 0 var(--space-unit);\n}\n\n/* Arrow style */\n\n:host([current-position])::before {\n --arrow-size: 6px;\n --arrow-edge-offset: calc(100% - var(--space-unit) - (var(--arrow-size) / 2));\n --arrow-center-x-offset: calc(50% - (var(--arrow-size) / 2));\n --arrow-center-y-offset: calc(100% - (var(--arrow-size) / 2));\n\n position: absolute;\n display: block;\n width: var(--arrow-size);\n height: var(--arrow-size);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n content: \"\";\n transform: rotate(45deg);\n}\n\n:host([show-arrow=\"false\"])::before,\n:host(:not([show-arrow]))::before {\n display: none;\n}\n\n:host([current-position^=\"top\"])::before {\n top: var(--arrow-center-y-offset);\n}\n\n:host([current-position^=\"bottom\"])::before {\n bottom: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top\"])::before,\n:host([current-position=\"bottom\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before,\n:host([current-position=\"left\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top_right\"])::before,\n:host([current-position=\"bottom_right\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"top_left\"])::before,\n:host([current-position=\"bottom_left\"])::before {\n left: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"left_top\"])::before {\n top: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"right_bottom\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left_top\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"right_bottom\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([center][current-position=\"top\"])::before,\n:host([center][current-position=\"bottom\"])::before {\n right: auto;\n left: var(--arrow-center-x-offset);\n}\n\n:host([center][current-position=\"right\"])::before,\n:host([center][current-position=\"left\"])::before {\n top: var(--arrow-center-x-offset);\n bottom: auto;\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {Device, KeyboardCode, PopoverPosition} from \"../../beans\";\nimport {containsElement, findScrollableParent, getDevice, isElementVisibleInContainer} from \"../../utils/utils\";\n\n/** Centering offset modifier. 0 for no offset, 0.5 for centering. */\ntype OffsetModifier = 0 | 0.5;\ntype Offsets = {top: number; right: number; bottom: number; left: number};\n\n/**\n * Popover component.\n * This component displays a popover bound to an element.\n * It supports various positions and can automatically adjust it based on available space, accounting for scrollable containers.\n *\n * Notes:\n * - If positioning has an odd behavior, consider manually adjusting the size of the slotted elements (using `width`, `height`, `max-width`, `max-height`, etc...) when its content is \"fluid\" (like text), because it can interfere with the position calculation (for example a long text on one single line can be bigger than the available space, letting the algorithm think the popover doesn't fits).\n *\n * @cssprop --z-popover-theme--surface - background color of the popover.\n * @cssprop --z-popover-theme--text - foreground color of the popover.\n * @cssprop --z-popover-padding - padding of the popover.\n * @cssprop --z-popover-shadow-filter - drop-shadow filter of the popover. Defaults to `drop-shadow(0 1px 2px var(--shadow-color-base))`.\n */\n@Component({\n tag: \"z-popover\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZPopover {\n /**\n * The preferred position to render the popover.\n * The popover will automatically search another position if not enough space is available for the preferred position.\n * If the preferred position is not available, it will try to find the best position starting from `TOP` and going clockwise.\n */\n @Prop({reflect: true, mutable: true})\n position?: PopoverPosition = PopoverPosition.TOP;\n\n /** The open state of the popover. */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n * If string css selector is provided make sure to use a valid selector.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /** Whether to show popover's arrow. */\n @Prop({reflect: true})\n showArrow = false;\n\n /** Whether to center the popup on the main side (according to \"position\"). */\n @Prop({reflect: true})\n center = false;\n\n /**\n * If true, the popover can be closed by clicking outside of it or pressing the escape key.\n * Otherwise, it will be closed only programmatically (by setting `open` to `false`).\n */\n @Prop()\n closable = true;\n\n /**\n * The current position of the popover.\n * It differs from `position` only when calculated automatically for space reasons.\n */\n @State()\n currentPosition?: PopoverPosition;\n\n @Element() host: HTMLZPopoverElement;\n\n // Clockwise order of positions.\n private static readonly positionOrder: PopoverPosition[] = [\n PopoverPosition.TOP,\n PopoverPosition.TOP_RIGHT,\n PopoverPosition.TOP_LEFT,\n PopoverPosition.RIGHT,\n PopoverPosition.RIGHT_BOTTOM,\n PopoverPosition.RIGHT_TOP,\n PopoverPosition.BOTTOM,\n PopoverPosition.BOTTOM_LEFT,\n PopoverPosition.BOTTOM_RIGHT,\n PopoverPosition.LEFT,\n PopoverPosition.LEFT_TOP,\n PopoverPosition.LEFT_BOTTOM,\n ] as const;\n\n private animationFrameRequestId?: number;\n\n /** space tolerance for space calculations */\n private readonly spaceTolerance = 3;\n\n /** The element bound to the popover. */\n private boundElement?: HTMLElement;\n\n /** Cached available space around the bound element to avoid unnecessary recalculations */\n private cachedAvailableSpace?: Offsets;\n\n /** Last bounding rect of the bound element to detect changes and eventually invalidate the caches. */\n private lastBoundRect?: DOMRect;\n\n /** Fired when the position changes. */\n @Event()\n positionChange: EventEmitter;\n\n /** Open change event. */\n @Event()\n openChange: EventEmitter;\n\n @Listen(\"keyup\", {target: \"window\"})\n closePopoverWithKeyboard(e: KeyboardEvent): void {\n if (this.closable && e.key === KeyboardCode.ESC) {\n this.open = false;\n }\n }\n\n /**\n * Close the popover when clicking outside of its content.\n * Stop event propagation if the click was fired by popover's trigger element,\n * to prevent close and reopen glitches.\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n const target = e.target as Element;\n if (!this.closable || !this.open || containsElement(this.host, target)) {\n return;\n }\n\n if (containsElement(this.boundElement, target)) {\n // stop propagation if the click was on the trigger element to prevent close and reopen glitches\n e.stopPropagation();\n }\n this.open = false;\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (!Object.values(PopoverPosition).includes(newValue as PopoverPosition) || newValue === PopoverPosition.AUTO) {\n newValue = PopoverPosition.TOP;\n this.position = newValue;\n }\n this.currentPosition = newValue;\n if (this.open) {\n this.setPosition();\n }\n }\n\n /** Setup popover behaviors when `open` changes. */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n this.openChange.emit({open: this.open});\n if (!this.open) {\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n this.currentPosition = undefined;\n\n return;\n }\n\n const updatePositionLoop = (): void => {\n if (!this.open) {\n return;\n }\n\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(updatePositionLoop);\n };\n\n // call `setPosition` after a tick to ensure the DOM is ready and sizes are available\n setTimeout(() => {\n updatePositionLoop();\n }, 0);\n }\n\n @Watch(\"bindTo\")\n onBindingChange(): void {\n this.findBoundElement();\n }\n\n /** Returns the offset modifier to use in calculations to align the popover with the bound element. */\n private get offsetModifier(): OffsetModifier {\n return this.center ? 0.5 : 0;\n }\n\n private findBoundElement(): void {\n if (typeof this.bindTo === \"string\") {\n this.boundElement = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n this.boundElement = this.bindTo;\n } else {\n this.boundElement = this.host.parentElement as HTMLElement;\n }\n }\n\n /**\n * Check if element has enough space to the right and left to be centered.\n * Used for `TOP` and `BOTTOM` position.\n * When `center` is not enabled, only one side needs to be checked and `RIGHT` is the default.\n */\n private hasCenteredHorizontalSpace(\n availableLeft: number,\n availableRight: number,\n hostWidth: number,\n boundElementWidth: number\n ): boolean {\n const requiredSideSpace = (hostWidth - boundElementWidth) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableRight >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableRight >= requiredSideSpace - this.spaceTolerance &&\n availableLeft >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if element has enough space to the top and bottom to be centered.\n * Used for `RIGHT` and `LEFT` position.\n * When `center` is not enabled, only one side needs to be checked and `BOTTOM` is the default.\n */\n private hasCenteredVerticalSpace(\n availableTop: number,\n availableBottom: number,\n hostHeight: number,\n boundElementHeight: number\n ): boolean {\n const requiredSideSpace = (hostHeight - boundElementHeight) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableBottom >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableTop >= requiredSideSpace - this.spaceTolerance &&\n availableBottom >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if there is enough space in the given direction to fit the popover.\n * Used for composed positions like TOP_RIGHT, LEFT_BOTTOM, etc.\n */\n private hasEnoughSideSpace(\n availableSpace: number,\n hostSize: number,\n boundElementSize: number,\n offsetModifier: OffsetModifier\n ): boolean {\n return availableSpace >= hostSize - boundElementSize * (1 - offsetModifier) - this.spaceTolerance;\n }\n\n /**\n * Given a desired position and available space around the bound element, returns the best position\n * that fits the popover, trying all positions if needed.\n * Takes into account offsetModifier for centering.\n * @param desiredPosition The desired position of the popover.\n * @param availableSpace The available space around the bound element.\n */\n private getOptimalPopoverPosition(desiredPosition: PopoverPosition, availableSpace: Offsets): PopoverPosition {\n const hostWidth = this.host.offsetWidth;\n const hostHeight = this.host.offsetHeight;\n const boundElementWidth = this.boundElement.getBoundingClientRect().width;\n const boundElementHeight = this.boundElement.getBoundingClientRect().height;\n const offsetModifier = this.offsetModifier;\n\n /** Check if there is enough space to fit the popover in the desired position */\n const fits = (pos: PopoverPosition): boolean => {\n switch (pos) {\n case PopoverPosition.TOP:\n return (\n availableSpace.top >= hostHeight - this.spaceTolerance &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.TOP_RIGHT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.TOP_LEFT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.RIGHT:\n return (\n availableSpace.right >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.RIGHT_BOTTOM:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.RIGHT_TOP:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.BOTTOM:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.BOTTOM_LEFT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.BOTTOM_RIGHT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.LEFT:\n return (\n availableSpace.left >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.LEFT_TOP:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.LEFT_BOTTOM:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n\n default:\n return false;\n }\n };\n\n // Check desired position first\n if (fits(desiredPosition)) {\n return desiredPosition;\n }\n\n // Find position index and create rotation starting from next position\n const positions = ZPopover.positionOrder;\n const startIndex = positions.indexOf(desiredPosition);\n\n if (startIndex === -1) {\n return desiredPosition; // fallback if position not found\n }\n\n // Try all other positions starting from the next one\n for (let i = 1; i < positions.length; i++) {\n const posIndex = (startIndex + i) % positions.length;\n const pos = positions[posIndex];\n if (fits(pos)) {\n return pos;\n }\n }\n\n return this.findBestFallbackPosition(availableSpace);\n }\n\n /** Find the best fallback position based on available space when no position fits perfectly. */\n private findBestFallbackPosition(availableSpace: Offsets): PopoverPosition {\n // Determine which horizontal and vertical direction has the most available space\n const bestHorizontalDirection =\n availableSpace.right >= availableSpace.left ? PopoverPosition.RIGHT : PopoverPosition.LEFT;\n\n const bestVerticalDirection =\n availableSpace.bottom >= availableSpace.top ? PopoverPosition.BOTTOM : PopoverPosition.TOP;\n\n // Choose the main direction based on which axis has more space overall\n const maxHorizontalSpace = Math.max(availableSpace.right, availableSpace.left);\n const maxVerticalSpace = Math.max(availableSpace.bottom, availableSpace.top);\n\n const mainDirection = maxVerticalSpace >= maxHorizontalSpace ? bestVerticalDirection : bestHorizontalDirection;\n\n // Decide if a secondary direction is needed\n // Only add a secondary direction if the difference between min and max in that axis is at least double\n let needsSecondaryDirection = false;\n\n if (mainDirection === bestVerticalDirection) {\n // If main direction is vertical, check horizontal space difference\n const minHorizontalSpace = Math.min(availableSpace.right, availableSpace.left);\n needsSecondaryDirection = maxHorizontalSpace >= minHorizontalSpace * 2;\n } else {\n // If main direction is horizontal, check vertical space difference\n const minVerticalSpace = Math.min(availableSpace.bottom, availableSpace.top);\n needsSecondaryDirection = maxVerticalSpace >= minVerticalSpace * 2;\n }\n\n if (!needsSecondaryDirection) {\n return mainDirection;\n }\n\n const secondaryDirection =\n mainDirection === bestVerticalDirection ? bestHorizontalDirection : bestVerticalDirection;\n\n // Return a combined position (e.g., \"bottom_right\")\n return `${mainDirection}_${secondaryDirection}` as PopoverPosition;\n }\n\n /**\n * Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.\n *\n * Calculations for `right` and `bottom` can be a little bit confusing because `boundingRect.right` and `bottom` may not be what you expect...\n * For more information see the explanation in the docs.\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#return_value\n */\n private calculateAvailableSpace(): Offsets {\n const boundElementRect = this.boundElement.getBoundingClientRect();\n\n if (\n this.lastBoundRect &&\n this.lastBoundRect.x === boundElementRect.x &&\n this.lastBoundRect.y === boundElementRect.y &&\n this.lastBoundRect.width === boundElementRect.width &&\n this.lastBoundRect.height === boundElementRect.height &&\n this.cachedAvailableSpace\n ) {\n // If the bound element's rect hasn't changed, return the cached rect\n return this.cachedAvailableSpace;\n }\n\n this.lastBoundRect = boundElementRect;\n const scrollableParent = findScrollableParent(this.boundElement);\n const scrollableParentRect = scrollableParent.getBoundingClientRect();\n const hasNestedScrollableParent = scrollableParent !== this.boundElement.ownerDocument.documentElement;\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n const safeSpace = 8; // extra space to avoid popover being too close to the edges\n\n // These deltas represent the offset between the scrollable parent and the viewport.\n // They are used to adjust the available space calculations when the scrollable parent is not the document or body,\n // to try to fit the popover inside the scrollable parent.\n const deltaTop = hasNestedScrollableParent ? scrollableParentRect.top : 0;\n const deltaRight = hasNestedScrollableParent ? documentWidth - scrollableParentRect.right : 0;\n const deltaBottom = hasNestedScrollableParent ? documentHeight - scrollableParentRect.bottom : 0;\n const deltaLeft = hasNestedScrollableParent ? scrollableParentRect.left : 0;\n\n this.cachedAvailableSpace = {\n top: boundElementRect.top - deltaTop - safeSpace,\n right: documentWidth - boundElementRect.right - deltaRight - safeSpace,\n bottom: documentHeight - boundElementRect.bottom - deltaBottom - safeSpace,\n left: boundElementRect.left - deltaLeft - safeSpace,\n };\n\n return this.cachedAvailableSpace;\n }\n\n /** Calculate the space around an element relative to the viewport. */\n private calculateElementOffsets(element: HTMLElement): Offsets {\n const elementRect = element.getBoundingClientRect();\n const viewportWidth = element.ownerDocument.documentElement.clientWidth;\n const viewportHeight = element.ownerDocument.documentElement.clientHeight;\n\n return {\n top: elementRect.top,\n right: viewportWidth - elementRect.right,\n bottom: viewportHeight - elementRect.bottom,\n left: elementRect.left,\n };\n }\n\n /** Apply positioning styles based on passed position. */\n private applyPositionStyles(position: PopoverPosition, availableSpace: Offsets): void {\n const boundElementWidth = this.boundElement.offsetWidth;\n const boundElementHeight = this.boundElement.offsetHeight;\n /** Distance between the popover and the bound element */\n const distanceFromBound = 8;\n const offsetModifier = this.offsetModifier;\n /** Distance between the arrow center and the popover edge. Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled. */\n const arrowModifier = this.showArrow && this.center ? 8 : 0;\n const hostStyle = this.host.style;\n const boundElementOffsets = this.calculateElementOffsets(this.boundElement);\n\n let maxWidth: number;\n let maxHeight: number;\n\n switch (position) {\n case PopoverPosition.TOP:\n case PopoverPosition.TOP_RIGHT:\n hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;\n hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.top - distanceFromBound;\n if (position === PopoverPosition.TOP_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.TOP_LEFT:\n hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;\n hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.top - distanceFromBound;\n break;\n\n case PopoverPosition.BOTTOM:\n case PopoverPosition.BOTTOM_RIGHT:\n hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;\n hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.bottom - distanceFromBound;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.BOTTOM_LEFT:\n hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;\n hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.bottom - distanceFromBound;\n break;\n\n case PopoverPosition.RIGHT:\n case PopoverPosition.RIGHT_BOTTOM:\n hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n if (position === PopoverPosition.RIGHT) {\n maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;\n } else {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.RIGHT_TOP:\n hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;\n hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n\n case PopoverPosition.LEFT:\n case PopoverPosition.LEFT_BOTTOM:\n hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n if (position === PopoverPosition.LEFT_BOTTOM) {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.LEFT_TOP:\n hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;\n hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n }\n\n if (getDevice() !== Device.MOBILE) {\n // Only force max sizes on non-mobile viewports\n Object.assign(hostStyle, {\n maxWidth: maxWidth ? `${maxWidth}px` : \"\",\n maxHeight: maxHeight ? `${maxHeight}px` : \"\",\n });\n }\n }\n\n /** Set the position of the popover. */\n private setPosition(): void {\n if (!this.boundElement) {\n return;\n }\n\n if (!isElementVisibleInContainer(this.boundElement, findScrollableParent(this.boundElement))) {\n // If the bound element is not visible, hide the popover too\n this.open = false;\n\n return;\n }\n\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n\n const availableSpace = this.calculateAvailableSpace();\n const position = this.getOptimalPopoverPosition(this.position, availableSpace);\n\n this.applyPositionStyles(position, availableSpace);\n this.currentPosition = position;\n this.positionChange.emit({position: this.currentPosition});\n\n // ...then restore the visibility\n this.host.style.visibility = \"visible\";\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n }\n\n componentDidLoad(): void {\n this.findBoundElement();\n if (this.open) {\n this.onOpen();\n }\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n render(): HTMLZPopoverElement {\n return (\n <Host current-position={this.currentPosition}>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"mMAAA,MAAMA,EAAY,2iGAClB,MAAAC,EAAeD,E,MCyBFE,EAAQ,M,+GA+DFC,KAAAC,eAAiB,E,cAxDLC,EAAgBC,I,UAItC,M,qCAWK,M,YAIH,M,cAOE,K,+BAkDX,wBAAAC,CAAyBC,GACvB,GAAIL,KAAKM,UAAYD,EAAEE,MAAQC,EAAaC,IAAK,CAC/CT,KAAKU,KAAO,K,EAUhB,kBAAAC,CAAmBN,GACjB,MAAMO,EAASP,EAAEO,OACjB,IAAKZ,KAAKM,WAAaN,KAAKU,MAAQG,EAAgBb,KAAKc,KAAMF,GAAS,CACtE,M,CAGF,GAAIC,EAAgBb,KAAKe,aAAcH,GAAS,CAE9CP,EAAEW,iB,CAEJhB,KAAKU,KAAO,K,CAId,gBAAAO,CAAiBC,GACf,IAAKC,OAAOC,OAAOlB,GAAiBmB,SAASH,IAAgCA,IAAahB,EAAgBoB,KAAM,CAC9GJ,EAAWhB,EAAgBC,IAC3BH,KAAKuB,SAAWL,C,CAElBlB,KAAKwB,gBAAkBN,EACvB,GAAIlB,KAAKU,KAAM,CACbV,KAAKyB,a,EAMT,MAAAC,GACEC,qBAAqB3B,KAAK4B,yBAC1B5B,KAAK6B,WAAWC,KAAK,CAACpB,KAAMV,KAAKU,OACjC,IAAKV,KAAKU,KAAM,CACdS,OAAOY,OAAO/B,KAAKc,KAAKkB,MAAO,CAE7BC,IAAK,OACLC,MAAO,OACPC,OAAQ,OACRC,KAAM,OACNC,SAAU,GACVC,UAAW,GAEXC,WAAY,WAEdvC,KAAKwB,gBAAkBgB,UAEvB,M,CAGF,MAAMC,EAAqB,KACzB,IAAKzC,KAAKU,KAAM,CACd,M,CAGFV,KAAKyB,cACLzB,KAAK4B,wBAA0Bc,sBAAsB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C,oIAviBkBR,EAAAyF,cAAmC,CACzDtF,EAAgBC,IAChBD,EAAgB0E,UAChB1E,EAAgB2E,SAChB3E,EAAgB4E,MAChB5E,EAAgB6E,aAChB7E,EAAgB8E,UAChB9E,EAAgB+E,OAChB/E,EAAgBgF,YAChBhF,EAAgBiF,aAChBjF,EAAgBkF,KAChBlF,EAAgBmF,SAChBnF,EAAgBoF,a","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as i,h as e,a as t,g as o}from"./p-75c4a726.js";const a=":host{display:flex;overflow:hidden;min-width:0;height:calc(174px - var(--space-unit) * 2);max-height:calc(174px - var(--space-unit) * 2);padding:var(--space-unit);border:var(--border-size-medium) solid var(--color-surface02);border-radius:var(--border-size-large);cursor:pointer;font-family:var(--font-family-sans)}:host(:focus:focus-visible){z-index:1;box-shadow:var(--shadow-focus-primary);outline:none}:host(.info-card:focus:focus-visible){z-index:1;box-shadow:var(--shadow-focus-primary);outline:none}.info-container{display:flex;overflow:hidden;min-width:0;flex:1;flex-direction:column;padding-left:calc(var(--space-unit) * 2)}.authors-label{overflow:hidden;color:var(--color-default-text);font-size:var(--font-size-2);font-weight:var(--font-rg);text-overflow:ellipsis;white-space:nowrap}.card-title{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;font-size:var(--font-size-3);font-weight:var(--font-bd);-webkit-line-clamp:2;line-clamp:2;line-height:1.5;word-break:break-word}.card-subtitle{overflow:hidden;color:var(--color-default-text);text-overflow:ellipsis;white-space:nowrap}.card-subtitle.info-subtitle{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;line-height:1.2;white-space:normal;word-break:break-word}.tags-container{display:flex;max-width:100%;flex-wrap:wrap;margin-top:calc(var(--space-unit) * 2);gap:var(--space-unit)}.volumes-label{display:flex;height:auto;flex-direction:column;margin-top:auto;color:var(--color-default-text);font-size:var(--font-size-1)}:host(.info-card){display:flex;height:calc(76px - var(--space-unit) * 2);max-height:calc(76px - var(--space-unit) * 2)}.info-icon-column{display:flex;width:50px;height:100%;align-items:center;justify-content:center}.info-icon-container{display:flex;width:34px;height:34px;align-items:center;justify-content:center;margin-bottom:calc(var(--space-unit) * 3);background-color:var(--gray50);border-radius:var(--border-size-large)}.card-title.info-title{display:-webkit-box;overflow:hidden;min-width:0;max-width:100%;max-height:2.4em;margin-top:0;margin-bottom:4px;-webkit-box-orient:vertical;font-size:var(--font-size-3);font-weight:var(--font-bd);-webkit-line-clamp:1;line-clamp:1;line-height:1.2;word-break:break-word}.info-icon{width:18px;height:18px;color:var(--color-default-text)}@media (max-width: 768px){.card-title{display:block;overflow:hidden;line-height:normal;text-overflow:ellipsis;white-space:nowrap}}";const s=a;const r=".z-cover-container{position:relative;display:flex;width:119px;height:158px;align-items:center;justify-items:center}.z-cover-stack{width:100%;height:100%}.z-cover-shadow,.z-cover-img{width:117px;min-width:117px;max-width:117px;height:156px;min-height:156px;max-height:156px}.z-cover-container.has-multiple .z-cover-shadow,.z-cover-container.has-multiple .z-cover-img{width:105px;min-width:105px;max-width:105px;height:140px;min-height:140px;max-height:140px}.z-cover-shadow{position:absolute;z-index:1;background-color:var(--color-white)}.z-shadow-1{z-index:1;top:var(--space-unit);right:6px;border:var(--border-size-small) solid black}.z-shadow-2{z-index:0;top:calc(var(--space-unit) * 2);right:12px;border:var(--border-size-small) solid black}.z-cover-img{position:absolute;z-index:2;top:0;right:0;border:var(--border-size-small) solid black;object-fit:cover;object-position:left}.z-cover-container.has-multiple .z-cover-img{left:12px}";const n=r;const l=class{constructor(o){i(this,o);this.resizeHandler=()=>{this.setTooltipTitle(this.authorsRef);this.setTooltipTitle(this.titleRef);this.setTooltipTitle(this.subtitleRef)};this.renderOperaCard=()=>e(t,{tabIndex:0},e("div",{class:`z-cover-container ${this.hasMultipleCovers?"has-multiple":""}`},e("div",{class:"z-cover-stack"},this.hasMultipleCovers&&e("div",null,e("div",{class:"z-cover-shadow z-shadow-2"}),e("div",{class:"z-cover-shadow z-shadow-1"})),e("img",{src:this.cover,alt:"Book Cover",class:"z-cover-img"}))),e("div",{class:"info-container"},this.authors&&e("span",{class:"authors-label",ref:i=>this.authorsRef=i},this.authors),e("span",{class:"card-title",ref:i=>this.titleRef=i},this.cardTitle),e("span",{class:"card-subtitle",ref:i=>this.subtitleRef=i},this.cardSubtitle),e("div",{class:"tags-container"},e("slot",{name:"tags"})),e("div",{class:"volumes-label"},e("slot",{name:"volumes"}))));this.renderInfoCard=()=>e(t,{tabIndex:0,class:"info-card"},e("div",{class:"info-icon-column"},e("div",{class:"info-icon-container"},e("z-icon",{class:"info-icon",name:"link",width:18,height:18}))),e("div",{class:"info-container"},e("span",{class:"card-title info-title",ref:i=>this.titleRef=i},this.cardTitle),e("span",{class:"card-subtitle info-subtitle",ref:i=>this.subtitleRef=i},this.cardSubtitle)));this.cardTitle=undefined;this.cardSubtitle=undefined;this.authors=undefined;this.cover=undefined;this.hasMultipleCovers=false;this.isInfoCard=false}setTooltipTitle(i){if(!i){return}const e=window.getComputedStyle(i);const t=e.getPropertyValue("-webkit-line-clamp")!=="none";let o;if(t){const t=parseInt(e.lineHeight);const a=parseInt(e.getPropertyValue("-webkit-line-clamp"));const s=t*a;o=i.scrollHeight>s}else{o=i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight}if(o){i.setAttribute("title",i.textContent.trim())}else{i.removeAttribute("title")}}componentDidRender(){this.setTooltipTitle(this.authorsRef);this.setTooltipTitle(this.titleRef);this.setTooltipTitle(this.subtitleRef)}componentDidLoad(){window.addEventListener("resize",this.resizeHandler)}disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler)}render(){return this.isInfoCard?this.renderInfoCard():this.renderOperaCard()}get hostElement(){return o(this)}};l.style=s+n;export{l as z_result_card};
|
|
2
|
-
//# sourceMappingURL=p-302041ec.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZResultCardStyle0","ZResultCardStyle1","ZResultCard","this","resizeHandler","setTooltipTitle","authorsRef","titleRef","subtitleRef","renderOperaCard","h","Host","tabIndex","class","hasMultipleCovers","src","cover","alt","authors","ref","el","cardTitle","cardSubtitle","name","renderInfoCard","width","height","style","window","getComputedStyle","hasLineClamp","getPropertyValue","isTruncated","lineHeight","parseInt","maxLines","maxHeight","scrollHeight","scrollWidth","clientWidth","clientHeight","setAttribute","textContent","trim","removeAttribute","componentDidRender","componentDidLoad","addEventListener","disconnectedCallback","removeEventListener","render","isInfoCard"],"sources":["src/components/result-card/z-result-card/styles.css?tag=z-result-card&encapsulation=shadow","src/components/css-components/z-cover/styles.css?tag=z-result-card&encapsulation=shadow","src/components/result-card/z-result-card/index.tsx"],"sourcesContent":[":host {\n display: flex;\n overflow: hidden;\n min-width: 0;\n height: calc(174px - var(--space-unit) * 2);\n max-height: calc(174px - var(--space-unit) * 2);\n padding: var(--space-unit);\n border: var(--border-size-medium) solid var(--color-surface02);\n border-radius: var(--border-size-large);\n cursor: pointer;\n font-family: var(--font-family-sans);\n}\n\n:host(:focus:focus-visible) {\n z-index: 1;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host(.info-card:focus:focus-visible) {\n z-index: 1;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.info-container {\n display: flex;\n overflow: hidden;\n min-width: 0;\n flex: 1;\n flex-direction: column;\n padding-left: calc(var(--space-unit) * 2);\n}\n\n.authors-label {\n overflow: hidden;\n color: var(--color-default-text);\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.card-title {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n font-size: var(--font-size-3);\n font-weight: var(--font-bd);\n -webkit-line-clamp: 2;\n line-clamp: 2;\n line-height: 1.5;\n word-break: break-word;\n}\n\n.card-subtitle {\n overflow: hidden;\n color: var(--color-default-text);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.card-subtitle.info-subtitle {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n line-height: 1.2;\n white-space: normal;\n word-break: break-word;\n}\n\n.tags-container {\n display: flex;\n max-width: 100%;\n flex-wrap: wrap;\n margin-top: calc(var(--space-unit) * 2);\n gap: var(--space-unit);\n}\n\n.volumes-label {\n display: flex;\n height: auto;\n flex-direction: column;\n margin-top: auto;\n color: var(--color-default-text);\n font-size: var(--font-size-1);\n}\n\n:host(.info-card) {\n display: flex;\n height: calc(76px - var(--space-unit) * 2);\n max-height: calc(76px - var(--space-unit) * 2);\n}\n\n.info-icon-column {\n display: flex;\n width: 50px;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n\n.info-icon-container {\n display: flex;\n width: 34px;\n height: 34px;\n align-items: center;\n justify-content: center;\n margin-bottom: calc(var(--space-unit) * 3);\n background-color: var(--gray50);\n border-radius: var(--border-size-large);\n}\n\n.card-title.info-title {\n display: -webkit-box;\n overflow: hidden;\n min-width: 0;\n max-width: 100%;\n max-height: 2.4em;\n margin-top: 0;\n margin-bottom: 4px;\n -webkit-box-orient: vertical;\n font-size: var(--font-size-3);\n font-weight: var(--font-bd);\n -webkit-line-clamp: 1;\n line-clamp: 1;\n line-height: 1.2;\n word-break: break-word;\n}\n\n.info-icon {\n width: 18px;\n height: 18px;\n color: var(--color-default-text);\n}\n\n@media (max-width: 768px) {\n .card-title {\n display: block;\n overflow: hidden;\n line-height: normal;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n}\n",".z-cover-container {\n position: relative;\n display: flex;\n width: 119px;\n height: 158px;\n align-items: center;\n justify-items: center;\n}\n\n.z-cover-stack {\n width: 100%;\n height: 100%;\n}\n\n/* Base sizes for single cover */\n.z-cover-shadow,\n.z-cover-img {\n width: 117px;\n min-width: 117px;\n max-width: 117px;\n height: 156px;\n min-height: 156px;\n max-height: 156px;\n}\n\n/* Scaled sizes for multiple covers */\n.z-cover-container.has-multiple .z-cover-shadow,\n.z-cover-container.has-multiple .z-cover-img {\n width: 105px;\n min-width: 105px;\n max-width: 105px;\n height: 140px;\n min-height: 140px;\n max-height: 140px;\n}\n\n.z-cover-shadow {\n position: absolute;\n z-index: 1;\n background-color: var(--color-white);\n}\n\n.z-shadow-1 {\n z-index: 1;\n top: var(--space-unit);\n right: 6px;\n border: var(--border-size-small) solid black;\n}\n\n.z-shadow-2 {\n z-index: 0;\n top: calc(var(--space-unit) * 2);\n right: 12px;\n border: var(--border-size-small) solid black;\n}\n\n.z-cover-img {\n position: absolute;\n z-index: 2;\n top: 0;\n right: 0;\n border: var(--border-size-small) solid black;\n object-fit: cover;\n object-position: left;\n}\n\n.z-cover-container.has-multiple .z-cover-img {\n left: 12px;\n}\n","import {Component, Element, Host, Prop, h} from \"@stencil/core\";\n\n@Component({\n tag: \"z-result-card\",\n styleUrls: [\"styles.css\", \"../../css-components/z-cover/styles.css\"],\n shadow: true,\n})\nexport class ZResultCard {\n @Element() hostElement: HTMLZResultCardElement;\n\n /**\n * The title of the card.\n */\n @Prop()\n cardTitle: string;\n\n /**\n * The subtitle of the card.\n */\n @Prop()\n cardSubtitle: string;\n\n /**\n * The authors of the opera.\n */\n @Prop()\n authors?: string;\n\n /**\n * The URL of the cover image.\n * This is used to display the cover image of the opera.\n */\n @Prop()\n cover?: string;\n\n /**\n * Indicates whether the card has multiple covers.\n * This is used to apply specific styles when there are multiple covers.\n */\n @Prop()\n hasMultipleCovers = false;\n\n /**\n * Indicates whether the card is an info page.\n * This can be used to apply specific styles or behaviors for info pages.\n */\n @Prop()\n isInfoCard = false;\n\n private authorsRef: HTMLElement;\n\n private titleRef: HTMLElement;\n\n private subtitleRef: HTMLElement;\n\n private setTooltipTitle(el: HTMLElement): void {\n if (!el) {\n return;\n }\n\n // Check if element uses line-clamp\n const style = window.getComputedStyle(el);\n const hasLineClamp = style.getPropertyValue(\"-webkit-line-clamp\") !== \"none\";\n\n let isTruncated;\n if (hasLineClamp) {\n // For elements with line-clamp, check if content height exceeds line-clamp height\n const lineHeight = parseInt(style.lineHeight);\n const maxLines = parseInt(style.getPropertyValue(\"-webkit-line-clamp\"));\n const maxHeight = lineHeight * maxLines;\n\n isTruncated = el.scrollHeight > maxHeight;\n } else {\n // Original check for elements without line-clamp\n isTruncated = el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight;\n }\n\n if (isTruncated) {\n el.setAttribute(\"title\", el.textContent.trim());\n } else {\n el.removeAttribute(\"title\");\n }\n }\n\n componentDidRender(): void {\n this.setTooltipTitle(this.authorsRef);\n this.setTooltipTitle(this.titleRef);\n this.setTooltipTitle(this.subtitleRef);\n }\n\n private resizeHandler = (): void => {\n this.setTooltipTitle(this.authorsRef);\n this.setTooltipTitle(this.titleRef);\n this.setTooltipTitle(this.subtitleRef);\n };\n\n componentDidLoad(): void {\n window.addEventListener(\"resize\", this.resizeHandler);\n }\n\n disconnectedCallback(): void {\n window.removeEventListener(\"resize\", this.resizeHandler);\n }\n\n private renderOperaCard = (): HTMLZResultCardElement => {\n return (\n <Host tabIndex={0}>\n <div class={`z-cover-container ${this.hasMultipleCovers ? \"has-multiple\" : \"\"}`}>\n <div class=\"z-cover-stack\">\n {this.hasMultipleCovers && (\n <div>\n <div class=\"z-cover-shadow z-shadow-2\" />\n <div class=\"z-cover-shadow z-shadow-1\" />\n </div>\n )}\n <img\n src={this.cover}\n alt=\"Book Cover\"\n class=\"z-cover-img\"\n />\n </div>\n </div>\n <div class=\"info-container\">\n {this.authors && (\n <span\n class=\"authors-label\"\n ref={(el) => (this.authorsRef = el as HTMLElement)}\n >\n {this.authors}\n </span>\n )}\n <span\n class=\"card-title\"\n ref={(el) => (this.titleRef = el as HTMLElement)}\n >\n {this.cardTitle}\n </span>\n <span\n class=\"card-subtitle\"\n ref={(el) => (this.subtitleRef = el as HTMLElement)}\n >\n {this.cardSubtitle}\n </span>\n <div class=\"tags-container\">\n <slot name=\"tags\"></slot>\n </div>\n <div class=\"volumes-label\">\n <slot name=\"volumes\"></slot>\n </div>\n </div>\n </Host>\n );\n };\n\n private renderInfoCard = (): HTMLZResultCardElement => {\n return (\n <Host\n tabIndex={0}\n class=\"info-card\"\n >\n <div class=\"info-icon-column\">\n <div class=\"info-icon-container\">\n <z-icon\n class=\"info-icon\"\n name=\"link\"\n width={18}\n height={18}\n />\n </div>\n </div>\n <div class=\"info-container\">\n <span\n class=\"card-title info-title\"\n ref={(el) => (this.titleRef = el as HTMLElement)}\n >\n {this.cardTitle}\n </span>\n <span\n class=\"card-subtitle info-subtitle\"\n ref={(el) => (this.subtitleRef = el as HTMLElement)}\n >\n {this.cardSubtitle}\n </span>\n </div>\n </Host>\n );\n };\n\n render(): HTMLZResultCardElement {\n return this.isInfoCard ? this.renderInfoCard() : this.renderOperaCard();\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAY,45EAClB,MAAAC,EAAeD,ECDf,MAAMA,EAAY,26BAClB,MAAAE,EAAeF,E,MCMFG,EAAW,M,yBAmFdC,KAAAC,cAAgB,KACtBD,KAAKE,gBAAgBF,KAAKG,YAC1BH,KAAKE,gBAAgBF,KAAKI,UAC1BJ,KAAKE,gBAAgBF,KAAKK,YAAY,EAWhCL,KAAAM,gBAAkB,IAEtBC,EAACC,EAAI,CAACC,SAAU,GACdF,EAAA,OAAKG,MAAO,qBAAqBV,KAAKW,kBAAoB,eAAiB,MACzEJ,EAAA,OAAKG,MAAM,iBACRV,KAAKW,mBACJJ,EAAA,WACEA,EAAA,OAAKG,MAAM,8BACXH,EAAA,OAAKG,MAAM,+BAGfH,EAAA,OACEK,IAAKZ,KAAKa,MACVC,IAAI,aACJJ,MAAM,kBAIZH,EAAA,OAAKG,MAAM,kBACRV,KAAKe,SACJR,EAAA,QACEG,MAAM,gBACNM,IAAMC,GAAQjB,KAAKG,WAAac,GAE/BjB,KAAKe,SAGVR,EAAA,QACEG,MAAM,aACNM,IAAMC,GAAQjB,KAAKI,SAAWa,GAE7BjB,KAAKkB,WAERX,EAAA,QACEG,MAAM,gBACNM,IA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OqB,oBAAoB,SAAU9C,KAAKC,c,CAuF5C,MAAA8C,GACE,OAAO/C,KAAKgD,WAAahD,KAAKqB,iBAAmBrB,KAAKM,iB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZSelectStyle0","ZSelect","constructor","hostRef","this","itemsList","itemIdKeyMap","resetKey","randomId","ControlSize","BIG","toggleSelectUl","bind","handleSelectFocus","watchItems","getInitialItemsArray","selectedItem","findSelectedItem","flattenedList","flattenTreeItems","forEach","item","key","id","getFocusedItemHandler","e","focusedItemId","target","getSelectedItem","getValue","getSelectedValue","setValue","value","values","push","length","updateSelection","emitOptionSelect","optionSelect","emit","htmlid","selected","emitResetSelect","resetSelect","componentWillLoad","componentWillRender","filterItems","searchString","items","JSON","parse","mapSelectedItemToItemsArray","initialItemsList","map","_a","prevList","hasTreeItems","filterTree","filter","name","toUpperCase","includes","getHighlightedText","matchingParent","match","newItem","Object","assign","children","showChildrenOfMatchingParent","text","search","upperText","upperSearch","start","indexOf","end","substring","hasAutocomplete","boolean","autocomplete","handleInputChange","detail","isOpen","selectedId","found","selectItem","disabled","flatItems","index","flatten","subItems","itm","arrowsSelectNav","idOrReset","showResetIcon","resetItem","arrows","KeyboardCode","ARROW_DOWN","ARROW_UP","preventDefault","stopPropagation","f","unshift","currentIndex","findIndex","k","lastIndex","newIndex","focusSelectItem","host","querySelector","focus","selfFocusOnClose","readonly","document","addEventListener","removeEventListener","handleInputClick","closest","clickedElement","getClickedElement","hasAttribute","KeyboardEvent","ESC","ENTER","TAB","getElementTree","find","elem","nodeName","toLowerCase","MouseEvent","scrollToLetter","letter","foundItem","charAt","renderInput","h","class","placeholder","replace","label","ariaLabel","icon","hasclearicon","message","status","undefined","role","size","onClick","onKeyUp","onKeyDown","current","onInputChange","onKeyPress","String","fromCharCode","keyCode","renderSelectUl","fixed","isfixed","tabindex","listSizeType","renderResetItem","renderSelectUlItems","hide","hasGroupItems","clickable","dividerType","ListDividerType","ELEMENT","ListSize","MEDIUM","onClickItem","renderItem","lastItem","thisItemKey","HEADER","innerHTML","NONE","SMALL","X_SMALL","renderNoSearchResults","renderSelectGroupItems","renderGroupedTree","array","isLastItem","parentHasSiblings","renderTreeItems","isLastChild","isTopLevel","hasDivider","_b","tabIndex","title","child","arr","grouped","reduce","acc","category","entries","some","groupItems","slot","i","style","zIndex","height","newData","group","zListItem","color","fill","noresultslabel","renderMessage","render"],"sources":["src/components/z-select/styles.css?tag=z-select&encapsulation=scoped","src/components/z-select/index.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: inherit;\n color: var(--color-form-default-text);\n font-family: var(--font-family-sans);\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n}\n\n:host([size=\"small\"]),\n:host([size=\"x-small\"]) {\n font-size: var(--font-size-2);\n}\n\n.select-wrapper > z-input {\n width: 100%;\n}\n\n.select-wrapper > z-input .input-icon {\n cursor: pointer;\n}\n\n.select-wrapper > div {\n position: relative;\n}\n\n.select-wrapper > div.closed {\n overflow: hidden;\n height: 0;\n}\n\n.select-wrapper .ul-scroll-wrapper {\n position: absolute;\n width: 100%;\n box-sizing: border-box;\n border-top: none;\n background: var(--color-form-background);\n box-shadow: var(--shadow-2);\n outline: none;\n}\n\n.select-wrapper .closed .ul-scroll-wrapper {\n z-index: 10;\n}\n\n.select-wrapper .open .ul-scroll-wrapper {\n z-index: 20;\n}\n\n.select-wrapper .ul-scroll-wrapper.fixed {\n position: static;\n}\n\n.select-wrapper z-list {\n --background-color-list-element: var(--color-form-background);\n --background-hover-color-list-element: var(--color-form-surface03);\n --background-active-color-list-element: var(--color-form-surface03);\n}\n\n.select-wrapper .ul-scroll-wrapper > z-list {\n position: relative;\n overflow: auto;\n max-height: 240px;\n padding: var(--space-unit) calc(var(--space-unit) * 1.5);\n margin: calc(var(--space-unit) * -1) 0;\n outline: none;\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element[disabled] {\n color: var(--color-form-disabled03);\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container {\n display: flex;\n align-items: center;\n padding: calc(var(--space-unit) / 2) var(--space-unit);\n column-gap: var(--space-unit);\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container .list-element-content {\n margin-right: auto;\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon + .list-element-content {\n padding: calc(var(--space-unit) * 0.5) var(--space-unit);\n}\n\n:host([size=\"x-small\"])\n .select-wrapper\n .ul-scroll-wrapper\n z-list\n z-list-element\n .list-element-container\n .list-element-content {\n padding: 0;\n}\n\n:host([size=\"small\"]) .select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n:host([size=\"x-small\"]) .select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n}\n\n:host([size=\"x-small\"])\n .select-wrapper\n .ul-scroll-wrapper\n z-list\n z-list-element\n .list-element-container\n > z-icon\n + .list-element-content {\n padding: 0 var(--space-unit);\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container .list-element-content.selected {\n font-weight: var(--font-sb);\n}\n\n.select-wrapper .ul-scroll-wrapper .no-results z-icon {\n margin-right: var(--space-unit);\n}\n\n.z-list-group-title {\n color: var(--color-form-default-text);\n}\n\n.reset-item {\n color: var(--color-form-active-primary);\n fill: var(--color-form-active-primary);\n}\n\n.reset-item-content {\n display: flex;\n align-items: center;\n}\n\n.reset-item.reset-item-margin .reset-item-content {\n margin-left: var(--space-unit);\n}\n\n.reset-item .reset-item-content > z-icon {\n margin-right: var(--space-unit);\n}\n\n.reset-item.hide {\n display: none;\n}\n\n.tree-list-reset-item {\n padding: var(--space-unit) 0;\n}\n\nz-list-element {\n position: relative;\n display: block;\n}\n\nz-list z-list-element::before {\n position: absolute;\n z-index: 100;\n top: 3px;\n left: -15px;\n width: 8px;\n height: 1em;\n border-bottom: 1px solid var(--color-form-disabled01-icon);\n border-left: 1px solid var(--color-form-disabled01-icon);\n content: \"\";\n cursor: pointer;\n}\n\nz-list z-list-element::after {\n position: absolute;\n z-index: 100;\n top: 5px;\n left: -15px;\n width: 8px;\n height: 100%;\n border-left: 1px solid var(--color-form-disabled01-icon);\n content: \"\";\n cursor: pointer;\n}\n\nz-list z-list-element:last-child::after {\n display: none;\n}\n\nz-list > z-list-element::before,\nz-list > z-list-element::after,\nz-list > z-list-group > z-list-element::before,\nz-list > z-list-group > z-list-element::after {\n display: none;\n}\n\nz-list > div.children-node {\n padding-left: calc(var(--space-unit) * 2);\n}\n\nz-list-element.grouped-tree-parent-node {\n padding-top: 0;\n padding-left: calc(var(--space-unit) * 2);\n}\n\nz-list-element > .list-element {\n display: flex;\n justify-content: space-between;\n padding: calc(var(--space-unit) * 1.25) 0;\n cursor: pointer;\n}\n\nz-list-element > .list-element:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\nz-list-element > .list-element .item.ellipsis {\n overflow: hidden;\n}\n\nz-list-element .list-element::after {\n position: absolute;\n top: 0;\n right: -1px;\n display: block;\n width: 100%;\n height: 40px;\n content: \"\";\n transform: translateX(-100%);\n}\n\nz-list-element.tree-search-item {\n padding-top: 0;\n}\n\nz-list-element.tree-search-item .list-element::after {\n position: absolute;\n top: 8px;\n right: -25px;\n display: block;\n width: 100%;\n height: 40px;\n content: \"\";\n transform: translateX(-100%);\n}\n\nz-list-element.grouped-tree-parent-node .list-element::after {\n position: absolute;\n top: 8px;\n right: -25px;\n display: block;\n width: 100%;\n height: 40px;\n content: \"\";\n transform: translateX(-100%);\n}\n\nz-list-element:not([disabled]) > .list-element:hover,\nz-list-element:not([disabled]) > .list-element:hover::after {\n z-index: -1;\n background-color: var(--color-form-surface03);\n cursor: pointer;\n}\n\n.item-label.selected {\n font-weight: bold;\n}\n\n.item.ellipsis {\n display: inline-block;\n overflow: hidden;\n max-width: 100%;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\nz-list > z-list-element.grouped-tree-parent-node > .list-element:hover::after,\nz-list-element.tree-search-item .list-element:hover::after,\nz-list > z-list-group > z-list-element.grouped-tree-parent-node > .list-element:hover::after {\n position: absolute;\n z-index: -1;\n top: 8px;\n right: -18px;\n display: block;\n width: 100%;\n height: 40px;\n content: \"\";\n transform: translateX(-100%);\n}\n\nz-list-element > .list-element:hover::after {\n position: absolute;\n z-index: -1;\n top: 0;\n right: 0;\n display: block;\n width: 100%;\n height: 40px;\n content: \"\";\n transform: translateX(-100%);\n}\n\n.children-node z-list-element::before,\n.children-node z-list-element::after {\n left: -15px;\n}\n\n.children-node .children-node z-list-element::before,\n.children-node .children-node z-list-element::after {\n left: -15px;\n}\n\n.children-node > z-list-element {\n padding: 0;\n}\n","import {Component, Element, Event, EventEmitter, Listen, Method, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ControlSize, InputStatus, KeyboardCode, ListDividerType, ListSize, SelectItem} from \"../../beans\";\nimport {boolean, getClickedElement, getElementTree, randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-select\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZSelect {\n @Element() host: HTMLZSelectElement;\n\n /** the id of the input element */\n @Prop()\n htmlid = `id-${randomId()}`;\n\n /** the input select options */\n @Prop()\n items: SelectItem[] | string;\n\n /** the input name */\n @Prop()\n name?: string;\n\n /** the input label */\n @Prop()\n label?: string;\n\n /** the input aria-label */\n @Prop()\n ariaLabel = \"\";\n\n /** the input is disabled */\n @Prop()\n disabled?: boolean = false;\n\n /** the input is readonly */\n @Prop()\n readonly?: boolean = false;\n\n /** the input placeholder (optional) */\n @Prop()\n placeholder?: string;\n\n /** the input html title (optional) */\n @Prop()\n htmltitle?: string;\n\n /** the input status (optional) */\n @Prop()\n status?: InputStatus;\n\n /** input helper message (optional) - if set to `false` message won't be displayed */\n @Prop()\n message?: string | boolean = true;\n\n /** the input has autocomplete option */\n @Prop()\n autocomplete?: boolean = false;\n\n /** no result text message */\n @Prop()\n noresultslabel?: string = \"Nessun risultato\";\n\n /** */\n @Prop()\n hasGroupItems?: boolean;\n\n /** */\n @Prop()\n hasTreeItems?: boolean;\n\n /** If true and an item matches the search string, children of matching item are shown even if they don't match the search string */\n @Prop()\n showChildrenOfMatchingParent?: boolean;\n\n /** When fixed, it occupies space and pushes down next elements. */\n @Prop()\n isfixed?: boolean = false;\n\n /** */\n @Prop()\n resetItem?: string;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop()\n size?: ControlSize = ControlSize.BIG;\n\n @State()\n isOpen = false;\n\n @State()\n selectedItem: null | SelectItem = null;\n\n @State()\n focusedItemId: string;\n\n @State()\n searchString: null | string;\n\n @State()\n private flattenedList: {item: SelectItem; key: number}[] = [];\n\n private itemsList: SelectItem[] = [];\n\n private itemIdKeyMap: Record<string, number> = {};\n\n private readonly resetKey = -1;\n\n constructor() {\n this.toggleSelectUl = this.toggleSelectUl.bind(this);\n this.handleSelectFocus = this.handleSelectFocus.bind(this);\n }\n\n @Watch(\"items\")\n watchItems(): void {\n this.itemsList = this.getInitialItemsArray();\n\n this.selectedItem = this.findSelectedItem(this.itemsList);\n\n this.flattenedList = this.flattenTreeItems(this.itemsList);\n this.itemIdKeyMap = {};\n this.flattenedList.forEach(({item, key}) => {\n this.itemIdKeyMap[item.id] = key;\n });\n }\n\n @Listen(\"ariaDescendantFocus\")\n getFocusedItemHandler(e: CustomEvent): void {\n this.focusedItemId = (e.target as Element).id;\n }\n\n /** get the input selected options */\n @Method()\n async getSelectedItem(): Promise<SelectItem> {\n return this.selectedItem;\n }\n\n /** get the input value */\n @Method()\n async getValue(): Promise<string> {\n return this.getSelectedValue();\n }\n\n /** set the input value */\n @Method()\n async setValue(value: string | string[]): Promise<void> {\n let values: string[] = [];\n if (typeof value === \"string\") {\n values.push(value);\n } else {\n values = value;\n }\n\n this.itemsList = this.getInitialItemsArray();\n if (values.length) {\n this.updateSelection(this.itemsList, values[0]);\n }\n this.selectedItem = this.findSelectedItem(this.itemsList);\n }\n\n /** Emitted on select option selection, returns select id, selected item id */\n @Event()\n optionSelect: EventEmitter;\n\n private emitOptionSelect(): void {\n this.optionSelect.emit({\n id: this.htmlid,\n selected: this.getSelectedValue(),\n });\n }\n\n /** Emitted on reset selected item, returns select id, selected item id */\n @Event()\n resetSelect: EventEmitter;\n\n private emitResetSelect(): void {\n this.resetSelect.emit({\n id: this.htmlid,\n });\n }\n\n componentWillLoad(): void {\n this.watchItems();\n }\n\n componentWillRender(): void {\n this.filterItems(this.searchString);\n }\n\n private getInitialItemsArray(): SelectItem[] {\n return typeof this.items === \"string\" ? JSON.parse(this.items) : this.items;\n }\n\n private mapSelectedItemToItemsArray(): SelectItem[] {\n const initialItemsList = this.getInitialItemsArray();\n\n return initialItemsList.map((item: SelectItem) => {\n item.selected = item.id === this.selectedItem?.id;\n\n return item;\n });\n }\n\n private getSelectedValue(): string {\n return this.selectedItem?.id;\n }\n\n private filterItems(searchString: string): void {\n const prevList = this.mapSelectedItemToItemsArray();\n\n if (!searchString?.length) {\n this.itemsList = prevList;\n\n return;\n }\n\n if (this.hasTreeItems) {\n this.itemsList = this.filterTree(prevList, searchString, false);\n } else {\n this.itemsList = prevList\n .filter((item: SelectItem) => item.name.toUpperCase().includes(searchString.toUpperCase()))\n .map((item: SelectItem) => {\n item.name = this.getHighlightedText(item.name, searchString);\n\n return item;\n });\n }\n\n this.flattenedList = this.flattenTreeItems(this.itemsList);\n this.itemIdKeyMap = {};\n this.flattenedList.forEach(({item, key}) => {\n this.itemIdKeyMap[item.id] = key;\n });\n }\n\n private filterTree(items: SelectItem[], searchString: string, matchingParent: boolean): SelectItem[] {\n if (!items) {\n return [];\n }\n\n return items\n .map((item) => {\n const match = item.name.toUpperCase().includes(searchString.toUpperCase());\n\n const newItem: SelectItem = {...item};\n if (newItem.children && newItem.children.length > 0) {\n newItem.children = this.filterTree(newItem.children, searchString, match);\n }\n\n if (match) {\n newItem.name = this.getHighlightedText(newItem.name, searchString);\n }\n if (\n match ||\n (newItem.children && newItem.children.length > 0) ||\n (this.showChildrenOfMatchingParent && matchingParent)\n ) {\n return newItem;\n }\n\n return null;\n })\n .filter((item) => item !== null) as SelectItem[];\n }\n\n private getHighlightedText(text: string, search: string): string {\n const upperText = text.toUpperCase();\n const upperSearch = search.toUpperCase();\n const start = upperText.indexOf(upperSearch);\n\n if (start === -1) {\n return text;\n }\n\n const end = start + search.length;\n\n return text.substring(0, start) + `<strong>${text.substring(start, end)}</strong>` + text.substring(end);\n }\n\n private hasAutocomplete(): boolean {\n return boolean(this.autocomplete) === true;\n }\n\n private handleInputChange(e: CustomEvent): void {\n this.searchString = e.detail.value;\n if (!this.isOpen) {\n this.toggleSelectUl();\n }\n }\n\n private updateSelection(items: SelectItem[], selectedId: string): void {\n if (items) {\n items.forEach((item) => {\n item.selected = item.id === selectedId;\n if (item.children && item.children.length > 0) {\n this.updateSelection(item.children, selectedId);\n }\n });\n }\n }\n\n private findSelectedItem(items: SelectItem[]): SelectItem | null {\n if (items) {\n for (const item of items) {\n if (item.selected) {\n return item;\n }\n if (item.children && item.children.length > 0) {\n const found = this.findSelectedItem(item.children);\n if (found) {\n return found;\n }\n }\n }\n }\n\n return null;\n }\n\n private selectItem(selected: null | SelectItem): void {\n if (selected?.disabled) {\n return;\n }\n\n this.itemsList = this.getInitialItemsArray();\n\n if (selected) {\n this.updateSelection(this.itemsList, selected.id);\n }\n\n this.selectedItem = this.findSelectedItem(this.itemsList);\n this.emitOptionSelect();\n this.toggleSelectUl(true);\n\n if (this.searchString) {\n this.searchString = null;\n }\n }\n\n private flattenTreeItems(items: SelectItem[]): {item: SelectItem; key: number}[] {\n const flatItems: {item: SelectItem; key: number}[] = [];\n let index = 0;\n\n const flatten = (subItems: SelectItem[]): void => {\n subItems.forEach((itm) => {\n flatItems.push({item: itm, key: index++});\n if (itm.children && itm.children.length > 0) {\n flatten(itm.children);\n }\n });\n };\n\n if (items) {\n flatten(items);\n }\n\n return flatItems;\n }\n\n private arrowsSelectNav(e: KeyboardEvent, idOrReset: string | number): void {\n const showResetIcon = this.resetItem && !!this.selectedItem;\n const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];\n\n if (!arrows.includes(e.key as KeyboardCode)) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const flatItems = [...this.flattenedList].filter((f) => !f.item.disabled);\n\n if (this.resetItem && showResetIcon) {\n flatItems.unshift({\n item: {id: \"__RESET_ITEM__\"} as SelectItem,\n key: this.resetKey,\n });\n }\n\n let currentIndex: number;\n if (typeof idOrReset === \"number\") {\n currentIndex = flatItems.findIndex((f) => f.key === idOrReset);\n } else {\n const k = this.itemIdKeyMap[idOrReset];\n currentIndex = flatItems.findIndex((f) => f.key === k);\n }\n\n if (!this.isOpen) {\n this.toggleSelectUl();\n\n if (currentIndex === -1) {\n currentIndex = -1;\n }\n }\n\n const lastIndex = flatItems.length - 1;\n\n let newIndex = currentIndex;\n\n if (e.key === KeyboardCode.ARROW_DOWN) {\n do {\n newIndex = newIndex === lastIndex ? 0 : newIndex + 1;\n } while (flatItems[newIndex].item.disabled);\n } else {\n do {\n newIndex = newIndex <= 0 ? lastIndex : newIndex - 1;\n } while (flatItems[newIndex].item.disabled);\n }\n\n this.focusSelectItem(flatItems[newIndex].key);\n }\n\n private focusSelectItem(key: number): void {\n this.host.querySelector<HTMLDivElement>(`#${this.htmlid}_key_${key}`)?.focus();\n }\n\n private toggleSelectUl(selfFocusOnClose = false): void {\n if (this.disabled || this.readonly) {\n return;\n }\n\n if (!this.isOpen) {\n document.addEventListener(\"click\", this.handleSelectFocus);\n document.addEventListener(\"keyup\", this.handleSelectFocus);\n } else {\n document.removeEventListener(\"click\", this.handleSelectFocus);\n document.removeEventListener(\"keyup\", this.handleSelectFocus);\n if (selfFocusOnClose) {\n (this.host.querySelector(`#${this.htmlid}_input`) as HTMLInputElement)?.focus();\n }\n }\n\n this.focusedItemId = \"\";\n this.isOpen = !this.isOpen;\n }\n\n private handleInputClick(e: MouseEvent | KeyboardEvent): void {\n if ((e.target as HTMLElement).closest(\".reset-icon\")) {\n e.stopPropagation();\n\n return;\n }\n\n this.toggleSelectUl();\n }\n\n private handleSelectFocus(e: MouseEvent | KeyboardEvent): void {\n const clickedElement = getClickedElement();\n if (clickedElement?.hasAttribute(\"disabled\")) {\n return;\n }\n\n if (e instanceof KeyboardEvent && e.key === KeyboardCode.ESC) {\n e.stopPropagation();\n\n return this.toggleSelectUl(true);\n }\n\n if (e instanceof KeyboardEvent && (e.key === KeyboardCode.ENTER || e.key !== KeyboardCode.TAB)) {\n return;\n }\n\n if (\n !getElementTree(clickedElement).find(\n (elem: HTMLElement) => elem.nodeName.toLowerCase() === \"z-input\" && elem.id === `${this.htmlid}_input`\n )\n ) {\n this.toggleSelectUl(e instanceof MouseEvent);\n }\n }\n\n private scrollToLetter(letter: string): void {\n const foundItem = this.itemsList.findIndex((item: SelectItem) => item.name.charAt(0) === letter);\n if (foundItem > -1) {\n this.focusSelectItem(this.itemIdKeyMap[this.itemsList[foundItem].id]);\n }\n }\n\n private renderInput(): HTMLZInputElement {\n return (\n <z-input\n class={{\n \"active-select\": this.isOpen,\n \"cursor-select\": !this.autocomplete,\n }}\n id={`${this.htmlid}_input`}\n htmlid={`${this.htmlid}_select_input`}\n placeholder={this.placeholder}\n value={!this.isOpen && this.selectedItem ? this.selectedItem.name.replace(/<[^>]+>/g, \"\") : null}\n label={this.label}\n autocomplete=\"off\"\n aria-expanded={this.isOpen ? \"true\" : \"false\"}\n aria-label={this.ariaLabel}\n aria-controls={`${this.htmlid}_list`}\n aria-autocomplete={this.hasAutocomplete() ? \"list\" : \"none\"}\n aria-activedescendant={this.isOpen ? this.focusedItemId : \"\"}\n icon={this.isOpen ? \"caret-up\" : \"caret-down\"}\n hasclearicon={this.hasAutocomplete()}\n message={false}\n name={this.name}\n disabled={this.disabled}\n readonly={this.readonly || (!this.hasAutocomplete() && this.isOpen)}\n status={this.isOpen ? undefined : this.status}\n role=\"combobox\"\n size={this.size}\n onClick={(e: MouseEvent) => {\n this.handleInputClick(e);\n }}\n onKeyUp={(e: KeyboardEvent) => {\n e.preventDefault();\n this.toggleSelectUl();\n }}\n onKeyDown={(e: KeyboardEvent) => {\n const current = this.selectedItem\n ? this.itemIdKeyMap[this.selectedItem.id]\n : this.resetItem\n ? this.resetKey\n : \"\";\n\n return this.arrowsSelectNav(e, current);\n }}\n onInputChange={(e: CustomEvent) => {\n this.handleInputChange(e);\n }}\n onKeyPress={(e: KeyboardEvent) => {\n if (!this.hasAutocomplete()) {\n e.preventDefault();\n this.scrollToLetter(String.fromCharCode(e.keyCode));\n }\n }}\n />\n );\n }\n\n private renderSelectUl(): HTMLDivElement {\n return (\n <div class={this.isOpen ? \"open\" : \"closed\"}>\n <div\n class={{\n \"ul-scroll-wrapper\": true,\n \"fixed\": this.isfixed,\n }}\n >\n <z-list\n role=\"listbox\"\n aria-label={this.ariaLabel || this.label}\n tabindex={this.disabled || this.readonly || !this.isOpen ? -1 : 0}\n id={`${this.htmlid}_list`}\n aria-multiselectable={false}\n size={this.listSizeType()}\n class={{\n \"disabled\": this.disabled,\n \"readonly\": this.readonly,\n [`input-${this.status}`]: !this.isOpen && !!this.status,\n \"z-scrollbar\": true,\n }}\n >\n {this.resetItem && this.renderResetItem()}\n {this.renderSelectUlItems()}\n </z-list>\n </div>\n </div>\n );\n }\n\n private renderResetItem(): HTMLZListElementElement {\n return (\n <z-list-element\n class={{\n \"hide\": !this.selectedItem || !this.resetItem,\n \"reset-item\": true,\n \"reset-item-margin\": !this.hasGroupItems,\n }}\n clickable={true}\n disabled={false}\n dividerType={ListDividerType.ELEMENT}\n role=\"option\"\n tabindex=\"0\"\n aria-selected=\"false\"\n id={`${this.htmlid}_key_${this.resetKey}`}\n size={this.hasTreeItems ? ListSize.MEDIUM : this.listSizeType()}\n onClickItem={() => {\n this.selectedItem = null;\n this.searchString = null;\n this.emitResetSelect();\n }}\n onKeyDown={(e: KeyboardEvent) => this.arrowsSelectNav(e, this.resetKey)}\n >\n <div\n class={{\n \"reset-item-content\": true,\n \"tree-list-reset-item\": this.hasTreeItems,\n }}\n >\n <z-icon name=\"multiply-circled\" />\n <span>{this.resetItem}</span>\n </div>\n </z-list-element>\n );\n }\n\n private renderItem(item: SelectItem, lastItem: boolean): HTMLZListElementElement {\n const thisItemKey = this.itemIdKeyMap[item.id];\n\n return (\n <z-list-element\n clickable={!item.disabled}\n disabled={item.disabled}\n dividerType={lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT}\n role=\"option\"\n tabindex={item.disabled || !this.isOpen ? -1 : 0}\n aria-selected={item.selected ? \"true\" : \"false\"}\n id={`${this.htmlid}_key_${thisItemKey}`}\n size={this.listSizeType()}\n onClickItem={() => this.selectItem(item)}\n onKeyDown={(e: KeyboardEvent) => this.arrowsSelectNav(e, thisItemKey)}\n >\n <div class=\"list-element-container\">\n <div\n class={{\n \"selected\": !!item.selected,\n \"list-element-content\": true,\n }}\n innerHTML={item.name}\n />\n {item.icon && <z-tag icon={item.icon}></z-tag>}\n </div>\n </z-list-element>\n );\n }\n\n private listSizeType(): ListSize {\n if (this.hasTreeItems) {\n return ListSize.NONE;\n }\n\n if (this.size === ControlSize.SMALL || this.size === ControlSize.X_SMALL) {\n return ListSize.SMALL;\n }\n\n return ListSize.MEDIUM;\n }\n\n //eslint-disable-next-line\n private renderSelectUlItems(): any {\n if (!this.itemsList.length) {\n return this.renderNoSearchResults();\n }\n\n if (this.hasGroupItems && !this.hasTreeItems) {\n return this.renderSelectGroupItems();\n } else if (this.hasGroupItems && this.hasTreeItems) {\n return this.renderGroupedTree();\n }\n\n return this.itemsList.map((item: SelectItem, index, array) => {\n const isLastItem = index === array.length - 1;\n const parentHasSiblings = array.length > 1;\n\n if (this.hasTreeItems) {\n return this.renderTreeItems(item, isLastItem, parentHasSiblings, true);\n }\n\n return this.renderItem(item, isLastItem);\n });\n }\n\n private renderTreeItems(\n item: SelectItem,\n isLastChild: boolean,\n parentHasSiblings: boolean,\n isTopLevel?: boolean\n ): HTMLZListElementElement[] {\n const thisItemKey = this.itemIdKeyMap[item.id];\n\n const hasDivider = this.hasGroupItems\n ? undefined\n : this.hasGroupItems\n ? isLastChild && !parentHasSiblings\n ? ListDividerType.ELEMENT\n : undefined\n : isTopLevel && parentHasSiblings && !isLastChild\n ? ListDividerType.ELEMENT\n : undefined;\n\n return (\n <z-list-element\n clickable={!item.disabled}\n disabled={item.disabled}\n class={{\n \"grouped-tree-parent-node\": this.hasGroupItems && !!item.children?.length,\n \"tree-search-item\": this.hasGroupItems && isTopLevel && !item.children?.length && !!this.searchString,\n }}\n size={this.listSizeType()}\n dividerType={hasDivider}\n hasTreeItems={this.hasTreeItems}\n >\n <div\n id={`${this.htmlid}_key_${thisItemKey}`}\n role=\"option\"\n class=\"list-element\"\n tabIndex={0}\n onClick={() => this.selectItem(item)}\n onKeyDown={(e: KeyboardEvent) => {\n this.arrowsSelectNav(e, thisItemKey);\n if (e.key === KeyboardCode.ENTER) {\n this.selectItem(item);\n }\n }}\n >\n <span class=\"item ellipsis\">\n <span\n class={{\n \"item-label\": true,\n \"selected\": !!item.selected,\n }}\n title={item.name}\n innerHTML={item.selected ? `<strong>${item.name}</strong>` : item.name}\n />\n </span>\n {item.icon && <z-tag icon={item.icon}></z-tag>}\n </div>\n {item.children && item.children.length > 0 ? (\n <z-list>\n <div class=\"children-node\">\n {item.children.map((child, index, arr) =>\n this.renderTreeItems(\n child,\n index === arr.length - 1,\n arr.length > 1,\n false // isTopLevel = false for children\n )\n )}\n </div>\n </z-list>\n ) : null}\n </z-list-element>\n );\n }\n\n private renderGroupedTree(): HTMLZListGroupElement[] {\n const grouped = this.itemsList.reduce(\n (acc, item) => {\n const category = item.category || \"Altra categoria\";\n acc[category] = acc[category] || [];\n acc[category].push(item);\n\n return acc;\n },\n {} as Record<string, SelectItem[]>\n );\n\n return Object.entries(grouped).map(([category, items], index, entries) => {\n const parentHasSiblings = Object.values(grouped).some((groupItems) => groupItems.length > 1);\n // const parentHasSiblings = items.length > 1;\n\n return (\n <z-list-group\n divider-type={index === entries.length - 1 ? undefined : ListDividerType.ELEMENT}\n hasTreeItems={true}\n >\n <span\n class=\"body-3-sb z-list-group-title\"\n slot=\"header-title\"\n >\n {category}\n </span>\n <z-list>\n {items.map((item, i, arr) => [\n this.renderTreeItems(item, i === arr.length - 1, parentHasSiblings, true),\n i < arr.length - 1 ? (\n <z-divider\n key={`divider-${i}`}\n style={{zIndex: \"100\", height: \"var(--border-size-small)\"}}\n />\n ) : null,\n ])}\n </z-list>\n {index !== entries.length - 1 && <z-divider style={{zIndex: \"100\", height: \"var(--border-size-small)\"}} />}\n </z-list-group>\n );\n });\n }\n\n private renderSelectGroupItems(): HTMLZListElementElement[] {\n const newData = this.itemsList.reduce(\n (group, item, index, array) => {\n const {category} = item;\n const lastItem = array.length === index + 1;\n const zListItem = this.renderItem(item, lastItem);\n\n group[category] = group[category] ?? [];\n group[category].push(zListItem);\n\n return group;\n },\n {} as Record<string, HTMLZListElementElement[]>\n );\n\n return Object.entries(newData).map(([key, value]) => {\n return (\n <z-list-group divider-type={ListDividerType.ELEMENT}>\n <span\n class=\"body-3-sb z-list-group-title\"\n slot=\"header-title\"\n >\n {key}\n </span>\n {value.map((item) => item)}\n </z-list-group>\n );\n });\n }\n\n private renderNoSearchResults(): HTMLZListElementElement {\n return (\n <z-list-element\n color=\"color-primary01\"\n class=\"no-results\"\n size={this.hasTreeItems ? ListSize.MEDIUM : this.listSizeType()}\n >\n <z-icon\n name=\"multiply-circle\"\n fill=\"color-primary01-icon\"\n />\n {this.noresultslabel}\n </z-list-element>\n );\n }\n\n private renderMessage(): HTMLZInputMessageElement {\n if (boolean(this.message) === false) {\n return;\n }\n\n return (\n <z-input-message\n message={boolean(this.message) === true ? undefined : (this.message as string)}\n status={this.status}\n class={this.size}\n disabled={this.disabled}\n />\n );\n }\n\n render(): HTMLDivElement {\n return (\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ACER,EAAA,mBACEQ,QAASpE,EAAQ3E,KAAK+I,WAAa,KAAOE,UAAajJ,KAAK+I,QAC5DC,OAAQhJ,KAAKgJ,OACbR,MAAOxI,KAAKmJ,KACZhE,SAAUnF,KAAKmF,U,CAKrB,MAAAoI,GACE,OACEhF,EAAA,OAAArH,IAAA,2CAAKsH,MAAM,kBACRxI,KAAKsI,cACLtI,KAAK6J,iBACL7J,KAAKsN,gB","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,a as n,g as o}from"./p-75c4a726.js";import{X as a,e as l}from"./p-17af7fb2.js";const r=':host{--z-book-card-portrait-cover-height:378px;--z-book-card-title-lines:2;--z-book-card-title-word-break:initial;--z-book-card-subtitle-lines:1;--z-book-card-subtitle-word-break:break-all;--z-book-card-authors-lines:1;--z-book-card-authors-word-break:break-all;display:flex;width:304px;box-sizing:border-box;flex-direction:column;border:solid var(--border-size-medium) var(--color-surface03);background-color:var(--color-surface01);border-radius:var(--border-radius);color:var(--color-default-text);font-family:var(--font-family-sans)}:host .main-content{display:flex;height:100%;box-sizing:border-box;flex-direction:column;padding:var(--space-unit);gap:var(--space-unit)}:host .main-content .cover{position:relative;display:flex;overflow:hidden;height:var(--z-book-card-portrait-cover-height);align-items:flex-end;background:var(--color-white);border-radius:var(--border-radius)}:host .main-content .cover:focus-within{border-radius:var(--border-radius);box-shadow:var(--shadow-focus-primary);outline:none}:host .main-content .cover a{display:inline-flex;outline:none}:host .main-content .cover img{max-width:100%;max-height:100%;outline:none}::slotted([slot="coverOverlay"]){position:absolute;bottom:0;overflow:hidden;width:100%;box-sizing:border-box;padding:var(--space-unit);background-color:var(--avatar-C19);color:var(--color-white)}:host .main-content .cover ::slotted([slot="coverOverlay"]){min-height:80px;max-height:336px}:host .main-content .card-info{display:flex;flex:1;flex-direction:column;justify-content:space-between;gap:var(--space-unit)}:host .main-content .card-info .top{display:flex;flex-direction:column;gap:calc(var(--space-unit) * 2)}:host .main-content .card-info .top ::slotted([slot="tags"]){display:flex;flex-wrap:wrap;gap:var(--space-unit)}:host .main-content .card-info .top ::slotted([slot="data"]){display:flex;justify-content:space-between}:host .main-content .card-info .top .ellipsis{display:-webkit-box;overflow:hidden;height:1.4rem;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1;line-height:1.4rem;text-overflow:ellipsis;word-break:break-all}:host .main-content .card-info .top .ellipsis.opera-title{height:calc(1.5 * var(--z-book-card-title-lines)) rem;-webkit-line-clamp:var(--z-book-card-title-lines);line-clamp:var(--z-book-card-title-lines);line-height:1.5rem;word-break:var(--z-book-card-title-word-break)}:host .main-content .card-info .top .ellipsis.volume-title{height:calc(1.4 * var(--z-book-card-subtitle-lines)) rem;-webkit-line-clamp:var(--z-book-card-subtitle-lines);line-clamp:var(--z-book-card-subtitle-lines);line-height:1.4rem;word-break:var(--z-book-card-subtitle-word-break)}:host .main-content .card-info .top .ellipsis.authors{height:calc(1.4 * var(--z-book-card-authors-lines)) rem;-webkit-line-clamp:var(--z-book-card-authors-lines);line-clamp:var(--z-book-card-authors-lines);line-height:1.4rem;word-break:var(--z-book-card-authors-word-break)}:host .main-content .card-info .top .opera-title *{all:unset}:host .main-content .cta-wrapper{display:flex;justify-content:space-between;gap:calc(var(--space-unit) / 2)}:host .main-content .card-info .top .link-chip-wrapper{display:flex;justify-content:space-between}:host .main-content .card-info .bottom .ebook{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:var(--space-unit);background-color:var(--color-primary02);border-radius:var(--border-radius);gap:var(--space-unit)}:host .main-content .card-info .bottom .ebook .app-name{display:flex;align-items:center;padding:calc(var(--space-unit) / 2) 0;font-family:var(--font-family-serif);gap:calc(var(--space-unit) / 2)}:host .main-content .card-info .bottom .ebook .app-name .ebook-logo{width:1.5rem;height:1.5rem;content:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22 fill=%22none%22 aria-hidden=%22true%22%3E%3Cg clip-path=%22url(%23clip0_11996_224)%22%3E%3Cpath d=%22M14.6644 0.469604H5.00141C2.33305 0.469604 0.169922 2.63274 0.169922 5.3011V14.9641C0.169922 17.6324 2.33305 19.7956 5.00141 19.7956H14.6644C17.3328 19.7956 19.4959 17.6324 19.4959 14.9641V5.3011C19.4959 2.63274 17.3328 0.469604 14.6644 0.469604Z%22 fill=%22%23E2011A%22/%3E%3Cpath d=%22M15.9523 13.3536H12.7313C11.6861 13.3536 10.6683 13.6934 9.83241 14.3199C8.99657 13.6934 7.97873 13.3536 6.93352 13.3536H3.71252V5.30115H6.93352C7.97873 5.30115 8.99657 5.64096 9.83241 6.26745C10.6683 5.64096 11.6861 5.30115 12.7313 5.30115H15.9523V13.3536Z%22 fill=%22white%22/%3E%3Cpath d=%22M15.9523 14.3201H3.71252V14.9643H15.9523V14.3201Z%22 fill=%22black%22/%3E%3Cpath d=%22M8.22229 10.732V8.24543C8.22229 7.97165 8.51057 7.79449 8.75375 7.91689L11.2404 9.16019C11.5109 9.29548 11.5109 9.682 11.2404 9.81728L8.75375 11.0606C8.50896 11.183 8.22229 11.0058 8.22229 10.732Z%22 fill=%22black%22/%3E%3Cpath d=%22M4.35704 7.87826C5.42438 7.87826 6.28963 7.013 6.28963 5.94566C6.28963 4.87831 5.42438 4.01306 4.35704 4.01306C3.28969 4.01306 2.42444 4.87831 2.42444 5.94566C2.42444 7.013 3.28969 7.87826 4.35704 7.87826Z%22 fill=%22black%22/%3E%3Cpath d=%22M5.6454 5.62354H3.0686V6.26773H5.6454V5.62354Z%22 fill=%22white%22/%3E%3Cpath d=%22M4.67917 4.65723H4.03497V7.23402H4.67917V4.65723Z%22 fill=%22white%22/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id=%22clip0_11996_224%22%3E%3Crect width=%2219.326%22 height=%2219.326%22 fill=%22white%22 transform=%22translate(0.169922 0.469604)%22/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E")}:host([variant="landscape"]){width:635px;min-height:max(332px, 20.75rem);padding:0}:host([variant="landscape"]) .main-content{min-height:max(332px, 20.75rem);box-sizing:border-box;flex-direction:row;padding:calc(var(--space-unit) * 2);gap:calc(var(--space-unit) * 2)}:host([variant="landscape"]) .main-content .cover{display:flex;overflow:hidden;width:221px;height:300px;margin:0}:host([variant="landscape"]) .main-content .cover ::slotted([slot="coverOverlay"]){min-height:80px;max-height:256px}:host([variant="landscape"]) .main-content .card-info{gap:calc(var(--space-unit) / 2)}:host([variant="landscape"]) .main-content .card-info .top{gap:calc(var(--space-unit) / 2)}@media (max-width: 767px){:host([variant="portrait"]){width:100%;max-width:400px}}';const s=r;const d=':root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 0.9166 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.1904 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}';const h=d;const b="button.z-link{padding:0;border:0;margin:0;background-color:transparent}a.z-link,button.z-link{display:inline-flex;cursor:pointer;font-family:var(--font-family-sans);line-height:inherit;text-decoration:none}a.z-link.z-link-icon,button.z-link.z-link-icon{--z-icon-width:1.125em;--z-icon-height:1.125em;align-items:center;column-gap:0.5em}a.z-link.z-link-sb,button.z-link.z-link-sb{font-weight:var(--font-sb)}a.z-link.z-link-underline,button.z-link.z-link-underline{text-decoration:underline}a.z-link:hover,button.z-link:hover,a.z-link:focus,button.z-link:focus,a.z-link:active,button.z-link:active{text-decoration:underline}a.z-link:focus,button.z-link:focus{box-shadow:var(--shadow-focus-primary);outline:none}a.z-link.z-link-disabled,button.z-link.z-link-disabled{box-shadow:none;color:var(--color-disabled03);cursor:default;fill:var(--color-disabled03);outline:none;pointer-events:none;text-decoration:none}a.z-link,button.z-link,a.z-link.z-link-active,button.z-link.z-link-active,a.z-link:hover,button.z-link:hover,a.z-link.z-link-active:hover,button.z-link.z-link-active:hover,a.z-link:focus,button.z-link:focus,a.z-link.z-link-active:focus,button.z-link.z-link-active:focus,a.z-link:active,button.z-link:active,a.z-link.z-link-active:active,button.z-link.z-link-active:active,a.z-link:visited,button.z-link:visited,a.z-link.z-link-active:visited,button.z-link.z-link-active:visited{color:var(--color-text-link-default);fill:var(--color-text-link-default)}a.z-link.z-link-blue,button.z-link.z-link-blue,a.z-link.z-link-blue.z-link-active,button.z-link.z-link-blue.z-link-active{color:var(--color-text-link-blue);fill:var(--color-text-link-blue)}a.z-link.z-link-red,button.z-link.z-link-red,a.z-link.z-link-red.z-link-active,button.z-link.z-link-red.z-link-active{color:var(--color-text-link-red);fill:var(--color-text-link-red)}a.z-link.z-link-inverse,button.z-link.z-link-inverse,a.z-link.z-link-inverse.z-link-active,button.z-link.z-link-inverse.z-link-active{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}a.z-link.z-link-blue:hover,button.z-link.z-link-blue:hover{color:var(--color-text-link-blue-hover);fill:var(--color-text-link-blue-hover)}a.z-link.z-link-red:hover,button.z-link.z-link-red:hover{color:var(--color-text-link-red-hover);fill:var(--color-text-link-red-hover)}a.z-link.z-link-inverse:hover,button.z-link.z-link-inverse:hover{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}a.z-link.z-link-blue:active,button.z-link.z-link-blue:active,a.z-link.z-link-blue:focus,button.z-link.z-link-blue:focus{color:var(--color-text-link-blue-active);fill:var(--color-text-link-blue-active)}a.z-link.z-link-red:active,button.z-link.z-link-red:active,a.z-link.z-link-red:focus,button.z-link.z-link-red:focus{color:var(--color-text-link-red-active);fill:var(--color-text-link-red-active)}a.z-link.z-link-inverse:active,button.z-link.z-link-inverse:active,a.z-link.z-link-inverse:focus,button.z-link.z-link-inverse:focus{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}a.z-link.z-link-blue:visited,button.z-link.z-link-blue:visited{color:var(--color-text-link-blue-visited);fill:var(--color-text-link-blue-visited)}a.z-link.z-link-red:visited,button.z-link.z-link-red:visited{color:var(--color-text-link-red-visited);fill:var(--color-text-link-red-visited)}a.z-link.z-link-inverse:visited,button.z-link.z-link-inverse:visited{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}";const f=b;const c=class{constructor(i){t(this,i);this.ebookClick=e(this,"ebookClick",7);this.coverClick=e(this,"coverClick",7);this.titleClick=e(this,"titleClick",7);this.variant=a.PORTRAIT;this.cover=undefined;this.operaTitle=undefined;this.volumeTitle=undefined;this.authors=undefined;this.isbn=undefined;this.isbnLabel="";this.year=undefined;this.ebookUrl=undefined;this.fallbackCover=undefined;this.titleHtmlTag=undefined}emitEbookClick(){this.ebookClick.emit()}emitCoverClick(){this.coverClick.emit()}emitTitleClick(){this.titleClick.emit()}renderCover(){const t=i("img",{src:this.cover,onError:()=>{if(this.fallbackCover){this.cover=this.fallbackCover}},"aria-hidden":"true"});return i("div",{class:"cover"},this.ebookUrl?i("a",{tabIndex:0,class:"cover-link",href:this.ebookUrl,onClick:()=>this.emitCoverClick(),target:"_blank"},t):t,i("slot",{name:"coverOverlay"}))}renderYear(){if(!this.year){return null}return i("div",{class:"year ellipsis body-4","aria-description":"anno"},this.year)}renderAuthors(){if(!this.authors){return null}return i("div",{class:"cta-wrapper"},i("div",{class:"authors ellipsis body-4","aria-description":"autori"},this.authors),this.variant===a.LANDSCAPE?this.renderCtaSlot():null)}renderOperaTitle(){const t=this.titleHtmlTag?`<${this.titleHtmlTag}>${this.operaTitle}</${this.titleHtmlTag}>`:this.operaTitle;const e=i("div",{class:"opera-title ellipsis body-2-sb",innerHTML:t});return i("div",{class:"cta-wrapper"},this.ebookUrl?i("a",{class:"z-link",href:this.ebookUrl,onClick:()=>this.emitTitleClick(),target:"_blank"},e):e,this.variant===a.PORTRAIT?this.renderCtaSlot():null)}renderVolumeTitle(){if(!this.volumeTitle){return null}return i("div",{class:"volume-title ellipsis body-4"},this.volumeTitle)}renderIsbn(){if(!this.isbn){return null}return i("div",{class:"isbn ellipsis body-4-sb","aria-description":`isbn ${this.isbnLabel}`},this.isbn," ",this.isbnLabel?i("span",{class:"body-4"},this.isbnLabel):null)}renderEbook(){return i("div",{class:"ebook"},i("div",null,i("div",{class:"app-name"},i("img",{class:"ebook-logo","aria-hidden":"true"}),i("div",{class:"body-4-sb"},"laZ Ebook"))),i("z-button",{size:l.X_SMALL,href:this.ebookUrl,target:"_blank",onClick:()=>this.emitEbookClick(),htmlrole:"link","aria-description":`leggi l'ebook ${this.operaTitle} su laZ Ebook`},"leggi ebook"))}renderCtaSlot(){return i("slot",{name:"cta"})}render(){return i(n,{key:"390282d1103ee34c1799ac6c3827ba735932d748"},i("div",{key:"0498613fb827c04d69a8f3ae622b038a96f30f35",class:"main-content"},this.renderCover(),i("div",{key:"7b548cf67997b7654ac115e7e0c8610ab0364774",class:"card-info"},i("div",{key:"9cc219c999f12b7037b87dee93c6a4003451c532",class:"top"},i("div",{key:"7e0fda8d8e4db8f739ab1fb84ee52113b4726289"},this.renderYear(),this.renderAuthors(),this.renderOperaTitle(),this.renderVolumeTitle(),this.renderIsbn()),i("slot",{key:"a111f6a3112733c7566613f1f91aae886c3664d2",name:"tags"}),i("slot",{key:"648c50aaae28a643bad13762cfa32c36e2f68f9a",name:"data"})),i("slot",{key:"5d531aae5e1b347b05186088a3362752625b58ed",name:"ebook"},!!this.ebookUrl&&i("div",{key:"d35832672681fc37974fc5ddaa2f2c421bdafe99",class:"bottom"},this.renderEbook())))),i("slot",{key:"ffa28f796577b77ad006f223182b3742a3bc4197",name:"apps"}))}get hostElement(){return o(this)}};c.style=s+(h+f);export{c as z_book_card};
|
|
2
|
-
//# sourceMappingURL=p-7c3ebd97.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZBookCardStyle0","typographyCss","ZBookCardStyle1","ZBookCardStyle2","ZBookCard","BookCardVariant","PORTRAIT","emitEbookClick","this","ebookClick","emit","emitCoverClick","coverClick","emitTitleClick","titleClick","renderCover","coverImg","h","src","cover","onError","fallbackCover","class","ebookUrl","tabIndex","href","onClick","target","name","renderYear","year","renderAuthors","authors","variant","LANDSCAPE","renderCtaSlot","renderOperaTitle","title","titleHtmlTag","operaTitle","innerHTML","renderVolumeTitle","volumeTitle","renderIsbn","isbn","isbnLabel","renderEbook","size","ControlSize","X_SMALL","htmlrole","render","Host","key"],"sources":["src/components/book-card/z-book-card/styles.css?tag=z-book-card&encapsulation=shadow","src/tokens/typography.css?tag=z-book-card&encapsulation=shadow","src/components/css-components/z-link/styles.css?tag=z-book-card&encapsulation=shadow","src/components/book-card/z-book-card/index.tsx"],"sourcesContent":[":host {\n --z-book-card-portrait-cover-height: 378px;\n --z-book-card-title-lines: 2;\n --z-book-card-title-word-break: initial;\n --z-book-card-subtitle-lines: 1;\n --z-book-card-subtitle-word-break: break-all;\n --z-book-card-authors-lines: 1;\n --z-book-card-authors-word-break: break-all;\n\n display: flex;\n width: 304px;\n box-sizing: border-box;\n flex-direction: column;\n border: solid var(--border-size-medium) var(--color-surface03);\n background-color: var(--color-surface01);\n border-radius: var(--border-radius);\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n}\n\n:host .main-content {\n display: flex;\n height: 100%;\n box-sizing: border-box;\n flex-direction: column;\n padding: var(--space-unit);\n gap: var(--space-unit);\n}\n\n:host .main-content .cover {\n position: relative;\n display: flex;\n overflow: hidden;\n height: var(--z-book-card-portrait-cover-height);\n align-items: flex-end;\n background: var(--color-white);\n border-radius: var(--border-radius);\n}\n\n:host .main-content .cover:focus-within {\n border-radius: var(--border-radius);\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host .main-content .cover a {\n display: inline-flex;\n outline: none;\n}\n\n:host .main-content .cover img {\n max-width: 100%;\n max-height: 100%;\n outline: none;\n}\n\n::slotted([slot=\"coverOverlay\"]) {\n position: absolute;\n bottom: 0;\n overflow: hidden;\n width: 100%;\n box-sizing: border-box;\n padding: var(--space-unit);\n background-color: var(--avatar-C19);\n color: var(--color-white);\n}\n\n:host .main-content .cover ::slotted([slot=\"coverOverlay\"]) {\n min-height: 80px;\n max-height: 336px;\n}\n\n:host .main-content .card-info {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: space-between;\n gap: var(--space-unit);\n}\n\n:host .main-content .card-info .top {\n display: flex;\n flex-direction: column;\n gap: calc(var(--space-unit) * 2);\n}\n\n:host .main-content .card-info .top ::slotted([slot=\"tags\"]) {\n display: flex;\n flex-wrap: wrap;\n gap: var(--space-unit);\n}\n\n:host .main-content .card-info .top ::slotted([slot=\"data\"]) {\n display: flex;\n justify-content: space-between;\n}\n\n:host .main-content .card-info .top .ellipsis {\n display: -webkit-box;\n overflow: hidden;\n height: 1.4rem;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n line-height: 1.4rem;\n text-overflow: ellipsis;\n word-break: break-all;\n}\n\n:host .main-content .card-info .top .ellipsis.opera-title {\n height: calc(1.5 * var(--z-book-card-title-lines)) rem;\n -webkit-line-clamp: var(--z-book-card-title-lines);\n line-clamp: var(--z-book-card-title-lines);\n line-height: 1.5rem;\n word-break: var(--z-book-card-title-word-break);\n}\n\n:host .main-content .card-info .top .ellipsis.volume-title {\n height: calc(1.4 * var(--z-book-card-subtitle-lines)) rem;\n -webkit-line-clamp: var(--z-book-card-subtitle-lines);\n line-clamp: var(--z-book-card-subtitle-lines);\n line-height: 1.4rem;\n word-break: var(--z-book-card-subtitle-word-break);\n}\n\n:host .main-content .card-info .top .ellipsis.authors {\n height: calc(1.4 * var(--z-book-card-authors-lines)) rem;\n -webkit-line-clamp: var(--z-book-card-authors-lines);\n line-clamp: var(--z-book-card-authors-lines);\n line-height: 1.4rem;\n word-break: var(--z-book-card-authors-word-break);\n}\n\n:host .main-content .card-info .top .opera-title * {\n all: unset;\n}\n\n:host .main-content .cta-wrapper {\n display: flex;\n justify-content: space-between;\n gap: calc(var(--space-unit) / 2);\n}\n\n:host .main-content .card-info .top .link-chip-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n:host .main-content .card-info .bottom .ebook {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n padding: var(--space-unit);\n background-color: var(--color-primary02);\n border-radius: var(--border-radius);\n gap: var(--space-unit);\n}\n\n:host .main-content .card-info .bottom .ebook .app-name {\n display: flex;\n align-items: center;\n padding: calc(var(--space-unit) / 2) 0;\n font-family: var(--font-family-serif);\n gap: calc(var(--space-unit) / 2);\n}\n\n:host .main-content .card-info .bottom .ebook .app-name .ebook-logo {\n width: 1.5rem;\n height: 1.5rem;\n content: url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22 fill=%22none%22 aria-hidden=%22true%22%3E%3Cg clip-path=%22url(%23clip0_11996_224)%22%3E%3Cpath d=%22M14.6644 0.469604H5.00141C2.33305 0.469604 0.169922 2.63274 0.169922 5.3011V14.9641C0.169922 17.6324 2.33305 19.7956 5.00141 19.7956H14.6644C17.3328 19.7956 19.4959 17.6324 19.4959 14.9641V5.3011C19.4959 2.63274 17.3328 0.469604 14.6644 0.469604Z%22 fill=%22%23E2011A%22/%3E%3Cpath d=%22M15.9523 13.3536H12.7313C11.6861 13.3536 10.6683 13.6934 9.83241 14.3199C8.99657 13.6934 7.97873 13.3536 6.93352 13.3536H3.71252V5.30115H6.93352C7.97873 5.30115 8.99657 5.64096 9.83241 6.26745C10.6683 5.64096 11.6861 5.30115 12.7313 5.30115H15.9523V13.3536Z%22 fill=%22white%22/%3E%3Cpath d=%22M15.9523 14.3201H3.71252V14.9643H15.9523V14.3201Z%22 fill=%22black%22/%3E%3Cpath d=%22M8.22229 10.732V8.24543C8.22229 7.97165 8.51057 7.79449 8.75375 7.91689L11.2404 9.16019C11.5109 9.29548 11.5109 9.682 11.2404 9.81728L8.75375 11.0606C8.50896 11.183 8.22229 11.0058 8.22229 10.732Z%22 fill=%22black%22/%3E%3Cpath d=%22M4.35704 7.87826C5.42438 7.87826 6.28963 7.013 6.28963 5.94566C6.28963 4.87831 5.42438 4.01306 4.35704 4.01306C3.28969 4.01306 2.42444 4.87831 2.42444 5.94566C2.42444 7.013 3.28969 7.87826 4.35704 7.87826Z%22 fill=%22black%22/%3E%3Cpath d=%22M5.6454 5.62354H3.0686V6.26773H5.6454V5.62354Z%22 fill=%22white%22/%3E%3Cpath d=%22M4.67917 4.65723H4.03497V7.23402H4.67917V4.65723Z%22 fill=%22white%22/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id=%22clip0_11996_224%22%3E%3Crect width=%2219.326%22 height=%2219.326%22 fill=%22white%22 transform=%22translate(0.169922 0.469604)%22/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E\");\n}\n\n:host([variant=\"landscape\"]) {\n width: 635px;\n min-height: max(332px, 20.75rem);\n padding: 0;\n}\n\n:host([variant=\"landscape\"]) .main-content {\n min-height: max(332px, 20.75rem);\n box-sizing: border-box;\n flex-direction: row;\n padding: calc(var(--space-unit) * 2);\n gap: calc(var(--space-unit) * 2);\n}\n\n:host([variant=\"landscape\"]) .main-content .cover {\n display: flex;\n overflow: hidden;\n width: 221px;\n height: 300px;\n margin: 0;\n}\n\n:host([variant=\"landscape\"]) .main-content .cover ::slotted([slot=\"coverOverlay\"]) {\n min-height: 80px;\n max-height: 256px;\n}\n\n:host([variant=\"landscape\"]) .main-content .card-info {\n gap: calc(var(--space-unit) / 2);\n}\n\n:host([variant=\"landscape\"]) .main-content .card-info .top {\n gap: calc(var(--space-unit) / 2);\n}\n\n@media (max-width: 767px) {\n :host([variant=\"portrait\"]) {\n width: 100%;\n max-width: 400px;\n }\n}\n",":root {\n /* font-family */\n --font-family-sans: \"IBM Plex Sans\", sans-serif;\n --font-family-serif: \"IBM Plex Serif\", serif;\n\n /* font-weight */\n --font-lt: 300;\n --font-rg: 400;\n --font-sb: 600;\n --font-bd: 700;\n\n /* font-size type scale */\n --font-size-1: 0.75rem; /* 12px */\n --font-size-2: 0.875rem; /* 14px */\n --font-size-3: 1rem; /* assuming 16px */\n --font-size-4: 1.125rem; /* 18px */\n --font-size-5: 1.25rem; /* 20px */\n --font-size-6: 1.5rem; /* 24px */\n --font-size-7: 1.75rem; /* 28px */\n --font-size-8: 2rem; /* 32px */\n --font-size-9: 2.25rem; /* 36px */\n --font-size-10: 2.625rem; /* 42px */\n --font-size-11: 3rem; /* 48px */\n --font-size-12: 3.375rem; /* 54px */\n --font-size-13: 3.75rem; /* 60px */\n --font-size-14: 4.25rem; /* 68px */\n --font-size-15: 4.75rem; /* 76px */\n --font-size-16: 5.25rem; /* 84px */\n --font-size-17: 5.75rem; /* 92px */\n\n /* cssprops to use with `font` shorthand property */\n --section-title-1: var(--font-sb) var(--font-size-11) / 0.9166 var(--font-family-serif);\n --section-title-2: var(--font-sb) var(--font-size-10) / 1.1904 var(--font-family-serif);\n --section-title-3: var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);\n --section-title-4: var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);\n --section-title-5: var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);\n --section-title-6: var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif);\n}\n\n/* Typography classes */\n.heading-1,\n.heading-1-sb,\n.heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n}\n\n.heading-2,\n.heading-2-sb,\n.heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-3,\n.heading-3-sb,\n.heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-4,\n.heading-4-sb,\n.heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-1,\n.body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-2,\n.body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-3,\n.body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-4,\n.body-4-sb {\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.body-5,\n.body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.interactive-1,\n.interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.interactive-2,\n.interactive-2-sb {\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.interactive-3,\n.interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.helper,\n.helper-sb {\n font-size: var(--font-size-1);\n font-style: italic;\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n/* section title */\n.section-title-1 {\n font: var(--section-title-1);\n}\n\n.section-title-2 {\n font: var(--section-title-2);\n}\n\n.section-title-3 {\n font: var(--section-title-3);\n}\n\n.section-title-4 {\n font: var(--section-title-4);\n}\n\n.section-title-5 {\n font: var(--section-title-5);\n}\n\n.section-title-6 {\n font: var(--section-title-6);\n}\n\n/* heading-1/2 for desktop and wide viewports */\n@media (min-width: 1152px) {\n .heading-1,\n .heading-1-sb,\n .heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .heading-2,\n .heading-2-sb,\n .heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n}\n\n/* viewport classes */\n@media (max-width: 767px) {\n .mobile-heading-1,\n .mobile-heading-1-sb,\n .mobile-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .mobile-heading-2,\n .mobile-heading-2-sb,\n .mobile-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-3,\n .mobile-heading-3-sb,\n .mobile-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-4,\n .mobile-heading-4-sb,\n .mobile-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-1,\n .mobile-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-2,\n .mobile-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-3,\n .mobile-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-4,\n .mobile-body-4-sb {\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 .mobile-body-5,\n .mobile-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-interactive-1,\n .mobile-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-interactive-2,\n .mobile-interactive-2-sb {\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 .mobile-interactive-3,\n .mobile-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-section-title-1 {\n font: var(--section-title-1);\n }\n\n .mobile-section-title-2 {\n font: var(--section-title-2);\n }\n\n .mobile-section-title-3 {\n font: var(--section-title-3);\n }\n\n .mobile-section-title-4 {\n font: var(--section-title-4);\n }\n\n .mobile-section-title-5 {\n font: var(--section-title-5);\n }\n\n .mobile-section-title-6 {\n font: var(--section-title-6);\n }\n\n .mobile-heading-1-lt,\n .mobile-heading-2-lt,\n .mobile-heading-3-lt,\n .mobile-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .mobile-heading-1-sb,\n .mobile-heading-2-sb,\n .mobile-heading-3-sb,\n .mobile-heading-4-sb,\n .mobile-body-1-sb,\n .mobile-body-2-sb,\n .mobile-body-3-sb,\n .mobile-body-4-sb,\n .mobile-body-5-sb,\n .mobile-interactive-1-sb,\n .mobile-interactive-2-sb,\n .mobile-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 768px) and (max-width: 1151px) {\n .tablet-heading-1,\n .tablet-heading-1-sb,\n .tablet-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .tablet-heading-2,\n .tablet-heading-2-sb,\n .tablet-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-3,\n .tablet-heading-3-sb,\n .tablet-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-4,\n .tablet-heading-4-sb,\n .tablet-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-1,\n .tablet-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-2,\n .tablet-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-3,\n .tablet-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-4,\n .tablet-body-4-sb {\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 .tablet-body-5,\n .tablet-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-interactive-1,\n .tablet-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-interactive-2,\n .tablet-interactive-2-sb {\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 .tablet-interactive-3,\n .tablet-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-section-title-1 {\n font: var(--section-title-1);\n }\n\n .tablet-section-title-2 {\n font: var(--section-title-2);\n }\n\n .tablet-section-title-3 {\n font: var(--section-title-3);\n }\n\n .tablet-section-title-4 {\n font: var(--section-title-4);\n }\n\n .tablet-section-title-5 {\n font: var(--section-title-5);\n }\n\n .tablet-section-title-6 {\n font: var(--section-title-6);\n }\n\n .tablet-heading-1-lt,\n .tablet-heading-2-lt,\n .tablet-heading-3-lt,\n .tablet-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .tablet-heading-1-sb,\n .tablet-heading-2-sb,\n .tablet-heading-3-sb,\n .tablet-heading-4-sb,\n .tablet-body-1-sb,\n .tablet-body-2-sb,\n .tablet-body-3-sb,\n .tablet-body-4-sb,\n .tablet-body-5-sb,\n .tablet-interactive-1-sb,\n .tablet-interactive-2-sb,\n .tablet-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1152px) and (max-width: 1365px) {\n .desktop-heading-1,\n .desktop-heading-1-sb,\n .desktop-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .desktop-heading-2,\n .desktop-heading-2-sb,\n .desktop-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .desktop-heading-3,\n .desktop-heading-3-sb,\n .desktop-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .desktop-heading-4,\n .desktop-heading-4-sb,\n .desktop-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-1,\n .desktop-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-2,\n .desktop-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-3,\n .desktop-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-4,\n .desktop-body-4-sb {\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 .desktop-body-5,\n .desktop-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-interactive-1,\n .desktop-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-interactive-2,\n .desktop-interactive-2-sb {\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 .desktop-interactive-3,\n .desktop-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-section-title-1 {\n font: var(--section-title-1);\n }\n\n .desktop-section-title-2 {\n font: var(--section-title-2);\n }\n\n .desktop-section-title-3 {\n font: var(--section-title-3);\n }\n\n .desktop-section-title-4 {\n font: var(--section-title-4);\n }\n\n .desktop-section-title-5 {\n font: var(--section-title-5);\n }\n\n .desktop-section-title-6 {\n font: var(--section-title-6);\n }\n\n .desktop-heading-1-lt,\n .desktop-heading-2-lt,\n .desktop-heading-3-lt,\n .desktop-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .desktop-heading-1-sb,\n .desktop-heading-2-sb,\n .desktop-heading-3-sb,\n .desktop-heading-4-sb,\n .desktop-body-1-sb,\n .desktop-body-2-sb,\n .desktop-body-3-sb,\n .desktop-body-4-sb,\n .desktop-body-5-sb,\n .desktop-interactive-1-sb,\n .desktop-interactive-2-sb,\n .desktop-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1366px) {\n .wide-heading-1,\n .wide-heading-1-sb,\n .wide-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .wide-heading-2,\n .wide-heading-2-sb,\n .wide-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .wide-heading-3,\n .wide-heading-3-sb,\n .wide-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .wide-heading-4,\n .wide-heading-4-sb,\n .wide-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-1,\n .wide-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-2,\n .wide-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-3,\n .wide-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-4,\n .wide-body-4-sb {\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 .wide-body-5,\n .wide-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-interactive-1,\n .wide-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-interactive-2,\n .wide-interactive-2-sb {\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 .wide-interactive-3,\n .wide-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-section-title-1 {\n font: var(--section-title-1);\n }\n\n .wide-section-title-2 {\n font: var(--section-title-2);\n }\n\n .wide-section-title-3 {\n font: var(--section-title-3);\n }\n\n .wide-section-title-4 {\n font: var(--section-title-4);\n }\n\n .wide-section-title-5 {\n font: var(--section-title-5);\n }\n\n .wide-section-title-6 {\n font: var(--section-title-6);\n }\n\n .wide-heading-1-lt,\n .wide-heading-2-lt,\n .wide-heading-3-lt,\n .wide-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .wide-heading-1-sb,\n .wide-heading-2-sb,\n .wide-heading-3-sb,\n .wide-heading-4-sb,\n .wide-body-1-sb,\n .wide-body-2-sb,\n .wide-body-3-sb,\n .wide-body-4-sb,\n .wide-body-5-sb,\n .wide-interactive-1-sb,\n .wide-interactive-2-sb,\n .wide-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n/* font-weight variants */\n.heading-1-lt,\n.heading-2-lt,\n.heading-3-lt,\n.heading-4-lt {\n font-weight: var(--font-lt);\n}\n\n.heading-1-sb,\n.heading-2-sb,\n.heading-3-sb,\n.heading-4-sb,\n.body-1-sb,\n.body-2-sb,\n.body-3-sb,\n.body-4-sb,\n.body-5-sb,\n.interactive-1-sb,\n.interactive-2-sb,\n.interactive-3-sb,\n.helper-sb {\n font-weight: var(--font-sb);\n}\n","button.z-link {\n padding: 0;\n border: 0;\n margin: 0;\n background-color: transparent;\n}\n\na.z-link,\nbutton.z-link {\n display: inline-flex;\n cursor: pointer;\n font-family: var(--font-family-sans);\n line-height: inherit;\n text-decoration: none;\n}\n\na.z-link.z-link-icon,\nbutton.z-link.z-link-icon {\n --z-icon-width: 1.125em;\n --z-icon-height: 1.125em;\n\n align-items: center;\n column-gap: 0.5em;\n}\n\na.z-link.z-link-sb,\nbutton.z-link.z-link-sb {\n font-weight: var(--font-sb);\n}\n\na.z-link.z-link-underline,\nbutton.z-link.z-link-underline {\n text-decoration: underline;\n}\n\na.z-link:hover,\nbutton.z-link:hover,\na.z-link:focus,\nbutton.z-link:focus,\na.z-link:active,\nbutton.z-link:active {\n text-decoration: underline;\n}\n\na.z-link:focus,\nbutton.z-link:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\na.z-link.z-link-disabled,\nbutton.z-link.z-link-disabled {\n box-shadow: none;\n color: var(--color-disabled03);\n cursor: default;\n fill: var(--color-disabled03);\n outline: none;\n pointer-events: none;\n text-decoration: none;\n}\n\na.z-link,\nbutton.z-link,\na.z-link.z-link-active,\nbutton.z-link.z-link-active,\na.z-link:hover,\nbutton.z-link:hover,\na.z-link.z-link-active:hover,\nbutton.z-link.z-link-active:hover,\na.z-link:focus,\nbutton.z-link:focus,\na.z-link.z-link-active:focus,\nbutton.z-link.z-link-active:focus,\na.z-link:active,\nbutton.z-link:active,\na.z-link.z-link-active:active,\nbutton.z-link.z-link-active:active,\na.z-link:visited,\nbutton.z-link:visited,\na.z-link.z-link-active:visited,\nbutton.z-link.z-link-active:visited {\n color: var(--color-text-link-default);\n fill: var(--color-text-link-default);\n}\n\na.z-link.z-link-blue,\nbutton.z-link.z-link-blue,\na.z-link.z-link-blue.z-link-active,\nbutton.z-link.z-link-blue.z-link-active {\n color: var(--color-text-link-blue);\n fill: var(--color-text-link-blue);\n}\n\na.z-link.z-link-red,\nbutton.z-link.z-link-red,\na.z-link.z-link-red.z-link-active,\nbutton.z-link.z-link-red.z-link-active {\n color: var(--color-text-link-red);\n fill: var(--color-text-link-red);\n}\n\na.z-link.z-link-inverse,\nbutton.z-link.z-link-inverse,\na.z-link.z-link-inverse.z-link-active,\nbutton.z-link.z-link-inverse.z-link-active {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n\na.z-link.z-link-blue:hover,\nbutton.z-link.z-link-blue:hover {\n color: var(--color-text-link-blue-hover);\n fill: var(--color-text-link-blue-hover);\n}\n\na.z-link.z-link-red:hover,\nbutton.z-link.z-link-red:hover {\n color: var(--color-text-link-red-hover);\n fill: var(--color-text-link-red-hover);\n}\n\na.z-link.z-link-inverse:hover,\nbutton.z-link.z-link-inverse:hover {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n\na.z-link.z-link-blue:active,\nbutton.z-link.z-link-blue:active,\na.z-link.z-link-blue:focus,\nbutton.z-link.z-link-blue:focus {\n color: var(--color-text-link-blue-active);\n fill: var(--color-text-link-blue-active);\n}\n\na.z-link.z-link-red:active,\nbutton.z-link.z-link-red:active,\na.z-link.z-link-red:focus,\nbutton.z-link.z-link-red:focus {\n color: var(--color-text-link-red-active);\n fill: var(--color-text-link-red-active);\n}\n\na.z-link.z-link-inverse:active,\nbutton.z-link.z-link-inverse:active,\na.z-link.z-link-inverse:focus,\nbutton.z-link.z-link-inverse:focus {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n\na.z-link.z-link-blue:visited,\nbutton.z-link.z-link-blue:visited {\n color: var(--color-text-link-blue-visited);\n fill: var(--color-text-link-blue-visited);\n}\n\na.z-link.z-link-red:visited,\nbutton.z-link.z-link-red:visited {\n color: var(--color-text-link-red-visited);\n fill: var(--color-text-link-red-visited);\n}\n\na.z-link.z-link-inverse:visited,\nbutton.z-link.z-link-inverse:visited {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n","import {Component, Element, Event, EventEmitter, Host, Prop, h} from \"@stencil/core\";\nimport {BookCardVariant, ControlSize} from \"../../../beans\";\n\n/**\n * @slot cta - top right cta (e.g. bookmark icon)\n * @slot ebook - as default, it shows laZ ebook link\n * @slot tags - tags section, default empty\n * @slot data - external link and pill, default empty\n * @slot apps - list of card-related apps, default empty\n * @slot coverOverlay - purple layer on top of book cover\n * @cssprop --z-book-card-portrait-cover-height - set custom cover height for portrait variant - default 378px\n * @cssprop --z-book-card-title-lines - set title avilable lines - default 2\n * @cssprop --z-book-card-title-word-break - set title word-break rule - default initial\n * @cssprop --z-book-card-subtitle-lines - set subtitle available lines - default 1\n * @cssprop --z-book-card-subtitle-word-break - set subtitle word-break rule - default break-all\n * @cssprop --z-book-card-authors-lines - set authors available lines - default 1\n * @cssprop --z-book-card-authors-word-break - set authors word-break rule - default break-all\n */\n@Component({\n tag: \"z-book-card\",\n styleUrls: [\"styles.css\", \"../../../tokens/typography.css\", \"../../css-components/z-link/styles.css\"],\n shadow: true,\n})\nexport class ZBookCard {\n @Element() hostElement: HTMLZBookCardElement;\n\n /** Card variant: landscape, portrait */\n @Prop({reflect: true})\n variant: BookCardVariant = BookCardVariant.PORTRAIT;\n\n /** Cover URL */\n @Prop()\n cover: string;\n\n /** Opera title (card title) */\n @Prop()\n operaTitle: string;\n\n /** [optional] Volume title (card subvolume) */\n @Prop()\n volumeTitle?: string;\n\n /** [optional] Authors */\n @Prop()\n authors?: string;\n\n /** [optional] Main ISBN */\n @Prop()\n isbn?: string;\n\n /** [optional] ISBN label */\n @Prop()\n isbnLabel = \"\";\n\n /** [optional] year */\n @Prop()\n year?: string;\n\n /** [optional] Show link to the ebook resource. Set title and cover as clickable, opening a new tab to the ebook resource */\n @Prop()\n ebookUrl?: string;\n\n /** [optional] Fallback cover URL */\n @Prop()\n fallbackCover?: string;\n\n /** [optional] Set a specific h level as html tag for opera title */\n @Prop()\n titleHtmlTag?: string;\n\n /** click on ebook link */\n @Event()\n ebookClick: EventEmitter;\n\n /** click on cover link */\n @Event()\n coverClick: EventEmitter;\n\n /** click on title link */\n @Event()\n titleClick: EventEmitter;\n\n private emitEbookClick(): void {\n this.ebookClick.emit();\n }\n\n private emitCoverClick(): void {\n this.coverClick.emit();\n }\n\n private emitTitleClick(): void {\n this.titleClick.emit();\n }\n\n private renderCover(): HTMLDivElement {\n const coverImg: HTMLImageElement = (\n <img\n src={this.cover}\n onError={() => {\n if (this.fallbackCover) {\n this.cover = this.fallbackCover;\n }\n }}\n aria-hidden=\"true\"\n />\n );\n\n return (\n <div class=\"cover\">\n {this.ebookUrl ? (\n <a\n tabIndex={0}\n class={\"cover-link\"}\n href={this.ebookUrl}\n onClick={() => this.emitCoverClick()}\n target=\"_blank\"\n >\n {coverImg}\n </a>\n ) : (\n coverImg\n )}\n <slot name=\"coverOverlay\"></slot>\n </div>\n );\n }\n\n private renderYear(): null | HTMLDivElement {\n if (!this.year) {\n return null;\n }\n\n return (\n <div\n class=\"year ellipsis body-4\"\n aria-description=\"anno\"\n >\n {this.year}\n </div>\n );\n }\n\n private renderAuthors(): null | HTMLDivElement {\n if (!this.authors) {\n return null;\n }\n\n return (\n <div class=\"cta-wrapper\">\n <div\n class=\"authors ellipsis body-4\"\n aria-description=\"autori\"\n >\n {this.authors}\n </div>\n {this.variant === BookCardVariant.LANDSCAPE ? this.renderCtaSlot() : null}\n </div>\n );\n }\n\n private renderOperaTitle(): HTMLDivElement {\n const title = this.titleHtmlTag\n ? `<${this.titleHtmlTag}>${this.operaTitle}</${this.titleHtmlTag}>`\n : this.operaTitle;\n\n const operaTitle = (\n <div\n class=\"opera-title ellipsis body-2-sb\"\n innerHTML={title}\n />\n );\n\n return (\n <div class=\"cta-wrapper\">\n {this.ebookUrl ? (\n <a\n class=\"z-link\"\n href={this.ebookUrl}\n onClick={() => this.emitTitleClick()}\n target=\"_blank\"\n >\n {operaTitle}\n </a>\n ) : (\n operaTitle\n )}\n {this.variant === BookCardVariant.PORTRAIT ? this.renderCtaSlot() : null}\n </div>\n );\n }\n\n private renderVolumeTitle(): null | HTMLDivElement {\n if (!this.volumeTitle) {\n return null;\n }\n\n return <div class=\"volume-title ellipsis body-4\">{this.volumeTitle}</div>;\n }\n\n private renderIsbn(): null | HTMLDivElement {\n if (!this.isbn) {\n return null;\n }\n\n return (\n <div\n class=\"isbn ellipsis body-4-sb\"\n aria-description={`isbn ${this.isbnLabel}`}\n >\n {this.isbn} {this.isbnLabel ? <span class=\"body-4\">{this.isbnLabel}</span> : null}\n </div>\n );\n }\n\n private renderEbook(): HTMLDivElement {\n return (\n <div class=\"ebook\">\n <div>\n <div class=\"app-name\">\n <img\n class=\"ebook-logo\"\n aria-hidden=\"true\"\n />\n <div class=\"body-4-sb\">laZ Ebook</div>\n </div>\n </div>\n <z-button\n size={ControlSize.X_SMALL}\n href={this.ebookUrl}\n target=\"_blank\"\n onClick={() => this.emitEbookClick()}\n htmlrole=\"link\"\n aria-description={`leggi l'ebook ${this.operaTitle} su laZ Ebook`}\n >\n leggi ebook\n </z-button>\n </div>\n );\n }\n\n private renderCtaSlot(): HTMLSlotElement {\n return <slot name=\"cta\"></slot>;\n }\n\n render(): HTMLZBookCardElement {\n return (\n <Host>\n <div class=\"main-content\">\n {this.renderCover()}\n <div class=\"card-info\">\n <div class=\"top\">\n <div>\n {this.renderYear()}\n {this.renderAuthors()}\n {this.renderOperaTitle()}\n {this.renderVolumeTitle()}\n {this.renderIsbn()}\n </div>\n <slot name=\"tags\"></slot>\n <slot name=\"data\"></slot>\n </div>\n <slot name=\"ebook\">{!!this.ebookUrl && <div class=\"bottom\">{this.renderEbook()}</div>}</slot>\n </div>\n </div>\n <slot name=\"apps\"></slot>\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAY,mjMAClB,MAAAC,EAAeD,ECDf,MAAME,EAAgB,o8XACtB,MAAAC,EAAeD,ECDf,MAAMF,EAAY,05GAClB,MAAAI,EAAeJ,E,MCsBFK,EAAS,M,2JAKOC,EAAgBC,S,oIAwB/B,G,qGA8BJ,cAAAC,GACNC,KAAKC,WAAWC,M,CAGV,cAAAC,GACNH,KAAKI,WAAWF,M,CAGV,cAAAG,GACNL,KAAKM,WAAWJ,M,CAGV,WAAAK,GACN,MAAMC,EACJC,EAAA,OACEC,IAAKV,KAAKW,MACVC,QAAS,KACP,GA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AAA,QAAMK,MAAM,UAAUd,KAAKqC,WAAoB,K,CAK3E,WAAAC,GACN,OACE7B,EAAA,OAAKK,MAAM,SACTL,EAAA,WACEA,EAAA,OAAKK,MAAM,YACTL,EAAA,OACEK,MAAM,aAAY,cACN,SAEdL,EAAA,OAAKK,MAAM,aAAW,eAG1BL,EAAA,YACE8B,KAAMC,EAAYC,QAClBxB,KAAMjB,KAAKe,SACXI,OAAO,SACPD,QAAS,IAAMlB,KAAKD,iBACpB2C,SAAS,OAAM,mBACG,iBAAiB1C,KAAK+B,2BAAyB,e,CAQjE,aAAAJ,GACN,OAAOlB,EAAA,QAAMW,KAAK,O,CAGpB,MAAAuB,GACE,OACElC,EAACmC,EAAI,CAAAC,IAAA,4CACHpC,EAAA,OAAAoC,IAAA,2CAAK/B,MAAM,gBACRd,KAAKO,cACNE,EAAA,OAAAoC,IAAA,2CAAK/B,MAAM,aACTL,EAAA,OAAAoC,IAAA,2CAAK/B,MAAM,OACTL,EAAA,OAAAoC,IAAA,4CACG7C,KAAKqB,aACLrB,KAAKuB,gBACLvB,KAAK4B,mBACL5B,KAAKiC,oBACLjC,KAAKmC,cAER1B,EAAA,QAAAoC,IAAA,2CAAMzB,KAAK,SACXX,EAAA,QAAAoC,IAAA,2CAAMzB,KAAK,UAEbX,EAAA,QAAAoC,IAAA,2CAAMzB,KAAK,WAAWpB,KAAKe,UAAYN,EAAA,OAAAoC,IAAA,2CAAK/B,MAAM,UAAUd,KAAKsC,kBAGrE7B,EAAA,QAAAoC,IAAA,2CAAMzB,KAAK,S","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,g as s}from"./p-75c4a726.js";import{I as o,e as r,i as a,g as n,l as h}from"./p-17af7fb2.js";import{r as l,d}from"./p-625e2cee.js";import"./p-5145a606.js";const c='.z-label{display:block;padding-bottom:var(--space-unit);color:var(--color-default-text);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}:host{display:block;color:var(--color-form-default-text);fill:var(--color-form-default-icon);font-family:var(--font-family-sans)}:host>div.fixed{position:relative}:host>div>.header{position:relative;z-index:10;display:flex;min-height:42px;align-items:center;justify-content:space-between;padding:0 calc(var(--space-unit) * 1.5);border:var(--border-size-small) solid var(--color-form-surface04);margin:0;background-color:var(--color-form-background);border-radius:var(--border-radius-small);cursor:pointer}:host([size="small"])>div>.header{min-height:34px;font-size:var(--font-size-2)}:host([size="x-small"])>div>.header{min-height:30px;font-size:var(--font-size-2)}:host([size="x-small"])>div>.header p.body-3{padding:calc(var(--space-unit) * 0.5) 0}:host>div>.header:hover{outline:var(--border-size-medium) solid var(--color-form-surface04);outline-offset:-2px}:host>div>div.header:focus:focus-visible{z-index:16;box-shadow:var(--shadow-focus-primary);outline:none}:host>div>.header>p.body-3{padding:var(--space-unit) 0;margin:0}:host>div>.header>p.body-3>span{font-weight:var(--font-sb)}:host>div>.header>z-icon{fill:var(--color-form-default-icon);transform:rotate(360deg);transition:all 200ms linear}:host>div>.header>z-icon.small,:host>div>.header>z-icon.x-small{--z-icon-width:16px;--z-icon-height:16px}:host>div.open>.header{border:var(--border-size-small) solid var(--color-form-active-primary);border-radius:var(--border-radius-small) var(--border-radius-small) 0 0}:host>div.disabled{pointer-events:none}:host>div.disabled .header{border-color:var(--color-form-disabled03);fill:var(--color-form-disabled01-icon)}:host>div.disabled .header>p.body-3{color:var(--color-form-disabled03)}:host>div.disabled .header>z-icon:last-child{fill:var(--color-form-disabled01-icon)}:host>div.open>.header>z-icon{fill:var(--color-form-default-icon);transform:rotate(180deg);transition:all 200ms linear}:host>div.open>div.open-combo-data{position:relative;z-index:12;padding:var(--space-unit) calc(var(--space-unit) * 2);border:var(--border-size-small) solid var(--color-form-surface03);border-top:0;background-color:var(--color-form-background);border-radius:0;box-shadow:var(--shadow-2)}:host .open .open-combo-data z-input .z-label{color:var(--color-form-default-text)}:host>div.open>div.open-combo-data>div>div{overflow:auto;max-height:235px;padding:0}:host>div.open>div.open-combo-data>z-input{width:100%;margin-bottom:calc(var(--space-unit) * 2)}:host>div.open>div.open-combo-data>div>div>ul{max-height:235px;padding:0 3px;margin:0}:host .open-combo-data z-list-element{--background-color-list-element:var(--color-form-background);--background-hover-color-list-element:var(--color-form-surface03);--background-active-color-list-element:var(--color-form-surface03)}::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}@supports not selector(::-webkit-scrollbar-track){:host{scrollbar-color:var(--color-primary01) transparent}}:host>div.open>z-input{position:relative;z-index:1;width:238px;margin:0 calc(var(--space-unit) * 2);color:var(--color-form-active-primary)}:host>div.open>div.open-combo-data>div>div.search{overflow:hidden;max-height:none;margin-top:0}:host>div.open>div.open-combo-data>div>div.search>ul{overflow:auto;max-height:180px;padding:var(--space-unit) calc(var(--space-unit) * 2)}:host .open .open-combo-data .search .no-results{display:flex;align-items:center;column-gap:var(--space-unit)}:host>.open>.open-combo-data .search .close-search{display:flex;justify-content:center}:host>div.open>div.open-combo-data>div>div.search .close-search>a{display:inline-block;height:44px;color:var(--color-form-active-primary);cursor:pointer;font-size:14px;font-weight:var(--font-sb);line-height:44px;text-align:center;text-transform:uppercase}:host>div.open>div.open-combo-data>div>div.search .close-search>a:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}:host>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5);border-bottom:var(--border-size-small) solid var(--gray800);margin-bottom:var(--space-unit);text-align:left}:host([size="small"])>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5)}:host([size="x-small"])>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:var(--space-unit) calc(var(--space-unit) * 0.5)}';const p=c;const u=class{watchItems(){this.itemsList=typeof this.items==="string"?JSON.parse(this.items):this.items;this.selectedCounter=this.itemsList.filter((t=>t.checked)).length;this.updateRenderItemsList()}watchSearchValue(){this.filterItems(this.searchValue)}watchCheckboxes(){this.checkboxes.forEach(((t,e)=>t.setAttribute("tabindex",e===0?"0":"-1")))}emitComboboxChange(){this.comboboxChange.emit({id:this.inputid,items:this.itemsList})}constructor(i){t(this,i);this.comboboxChange=e(this,"comboboxChange",7);this.itemsList=[];this.inputType=o.TEXT;this.inputid=`combo-${l()}`;this.items=undefined;this.label=undefined;this.disabled=false;this.hassearch=false;this.searchlabel=undefined;this.searchplaceholder=undefined;this.searchtitle=undefined;this.noresultslabel="Nessun risultato";this.isopen=false;this.isfixed=false;this.closesearchtext="Chiudi";this.hascheckall=false;this.checkalltext="Seleziona tutti";this.uncheckalltext="Deseleziona tutti";this.maxcheckableitems=0;this.hasgroupitems=undefined;this.size=r.BIG;this.searchValue=undefined;this.selectedCounter=undefined;this.renderItemsList=[];this.focusedItemId=undefined;this.checkboxes=[];this.toggleComboBox=this.toggleComboBox.bind(this);this.closeFilterItems=this.closeFilterItems.bind(this)}componentWillLoad(){this.watchItems()}componentWillRender(){this.selectedCounter=this.itemsList.filter((t=>t.checked)).length}componentDidRender(){const t=this.getAllCheckboxes();if(JSON.stringify(t)!==JSON.stringify(this.checkboxes)){this.checkboxes=t}}getItemId(t){return`combo-checkbox-${this.inputid}-${t.id}`}getCheckboxClass(){return`combo-item-checkbox-input-${this.inputid}`}getAllCheckboxes(){return Array.from(this.element.shadowRoot.querySelectorAll(`.${this.getCheckboxClass()} input:not([disabled])`))}getControlToListSize(){switch(this.size){case r.X_SMALL:return a.SMALL;case r.SMALL:return a.MEDIUM;default:return a.LARGE}}handleSelectArrowsNavigation(t,e){if(![n.ARROW_DOWN,n.ARROW_UP].includes(t.key)||!this.isopen){return}t.preventDefault();t.stopPropagation();const i=this.element.shadowRoot.querySelector(`#${e}`);if(!i){return}const s=this.checkboxes;if(!s.length){return}const o=s.indexOf(i);const r=0;const a=s.length-1;let h=null;if(t.key===n.ARROW_DOWN){h=o===a?s[r]:s[o+1]}else if(t.key===n.ARROW_UP){h=o===r?s[a]:s[o-1]}this.focusComboboxItem(h)}handleHeaderKeyboardEvent(t){if(t.key===n.SPACE){t.preventDefault()}if(t.key===n.ARROW_DOWN&&!this.isopen||t.key===n.ARROW_UP&&this.isopen){this.toggleComboBox()}}handleCheckboxFocus(t){this.focusedItemId=t}focusComboboxItem(t){this.checkboxes.forEach((function(t){t.setAttribute("tabindex","-1")}));t.setAttribute("tabindex","0");t.focus()}updateRenderItemsList(){if(this.searchValue){this.filterItems(this.searchValue)}else{this.resetRenderItemsList()}}resetRenderItemsList(){const t=[];this.itemsList.forEach((e=>{t.push(Object.assign({},e))}));this.renderItemsList=t}filterItems(t){if(!t){return this.closeFilterItems()}this.resetRenderItemsList();this.renderItemsList=this.renderItemsList.filter((e=>{const i=e.name.toUpperCase().indexOf(t.toUpperCase());const s=i+t.length;const o=e.name.substring(0,i)+"<strong>"+e.name.substring(i,s)+"</strong>"+e.name.substring(s,e.name.length);e.name=o;return i>=0}))}checkAll(t=true){this.itemsList=this.itemsList.map((e=>Object.assign(Object.assign({},e),{checked:t})));this.resetRenderItemsList();this.emitComboboxChange()}closeFilterItems(){this.searchValue="";this.resetRenderItemsList()}toggleComboBox(){this.isopen=!this.isopen}getComboboxA11yAttributes(){return{role:"combobox","aria-label":this.label,"aria-expanded":this.isopen?"true":"false","aria-activedescendant":this.isopen?this.focusedItemId:"","aria-controls":`${this.inputid}_list`}}renderHeader(){return i("div",{class:"header",onClick:()=>this.toggleComboBox(),onKeyDown:t=>{this.handleHeaderKeyboardEvent(t)},onKeyUp:t=>d(t,this.toggleComboBox),role:"button",tabindex:0,"aria-expanded":this.isopen?"true":"false"},i("p",{class:"body-3"},this.label,i("span",null,this.selectedCounter>0&&` (${this.selectedCounter})`)),i("z-icon",{name:"caret-down",class:this.size}))}renderContent(){if(!this.isopen){return}return i("div",{class:"open-combo-data"},this.hassearch&&this.renderSearchInput(),!this.hassearch?i("span",Object.assign({},this.getComboboxA11yAttributes())):null,i("div",{role:"listbox","aria-label":this.label,"aria-multiselectable":true,id:`${this.inputid}_list`,"aria-owns":`${this.checkboxes.map((t=>t.id)).join(" ")}`},this.hascheckall&&this.renderCheckAll(),this.renderItems()))}renderItems(){return i("div",{class:this.searchValue&&"search"},this.renderList(this.renderItemsList),this.searchValue&&this.renderCloseButton())}renderItem(t,e,s){return i("z-list-element",{id:t.id,htmlTabindex:null,dividerType:e!==s-1?h.ELEMENT:h.NONE,size:this.getControlToListSize()},i("z-input",{type:o.CHECKBOX,checked:t.checked,htmlid:this.getItemId(t),label:t.name,class:this.getCheckboxClass(),disabled:!t.checked&&this.maxcheckableitems&&this.selectedCounter>=this.maxcheckableitems,size:this.size===r.X_SMALL?r.SMALL:this.size,role:"option","aria-selected":t.checked?"true":"false",onKeyDown:e=>this.handleSelectArrowsNavigation(e,this.getItemId(t)),onInputCheck:e=>{this.itemsList=this.itemsList.map((i=>{if(t.id===i.id){i.checked=e.detail.checked}return i}));this.updateRenderItemsList();this.emitComboboxChange()},onInputFocus:t=>this.handleCheckboxFocus(t.detail.id)}))}renderList(t){if(!t){return}if(!t.length&&this.searchValue){return this.renderNoSearchResults()}if(this.hasgroupitems){return this.renderGroups(t)}return i("ul",{role:"none"},t.map(((e,i)=>this.renderItem(e,i,t.length))))}renderGroups(t){const e=t.reduce(((e,i,s)=>{var o;const{category:r}=i;const a=this.renderItem(i,s,t.length);e[r]=(o=e[r])!==null&&o!==void 0?o:[];e[r].push(a);return e}),{});const s=Object.entries(e).map((([t,e])=>i("z-list-group",{"divider-type":h.ELEMENT},i("span",{class:"body-3-sb z-list-group-title",slot:"header-title"},t),e.map((t=>t)))));return i("ul",{role:"none"},s)}renderNoSearchResults(){return i("div",{class:"no-results"},i("z-icon",{name:"multiply-circle"}),i("span",null,this.noresultslabel))}renderCloseButton(){return i("div",{class:"close-search"},i("a",{onClick:()=>this.closeFilterItems(),onKeyUp:t=>d(t,this.closeFilterItems),role:"button",tabindex:0},this.closesearchtext))}renderSearchInput(){return i("z-input",Object.assign({htmlid:`${this.inputid}_search`,label:this.searchlabel,placeholder:this.searchplaceholder,htmltitle:this.searchtitle,type:this.inputType,value:this.searchValue,message:false,size:this.size,"aria-autocomplete":"list"},this.getComboboxA11yAttributes(),{onKeyUp:t=>{if(t.key===n.ESC){this.closeFilterItems()}},onInputChange:t=>{this.searchValue=t.detail.value}}))}renderCheckAll(){if(this.searchValue){return}const t=`combo-checkbox-${this.inputid}-check-all`;const e=this.selectedCounter===this.itemsList.length;return i("div",{class:"check-all-wrapper"},i("z-input",{type:o.CHECKBOX,checked:e,htmlid:t,class:this.getCheckboxClass(),label:e?this.uncheckalltext:this.checkalltext,disabled:this.maxcheckableitems&&this.maxcheckableitems<this.itemsList.length,size:this.size===r.X_SMALL?r.SMALL:this.size,role:"option","aria-selected":e?"true":"false",onKeyDown:e=>this.handleSelectArrowsNavigation(e,t),onInputCheck:t=>this.checkAll(t.detail.checked),onInputFocus:t=>this.handleCheckboxFocus(t.detail.id)}))}render(){return i("div",{key:"c746599f1d5cef116c2319d365792288d6f0f34b","data-action":`combo-${this.inputid}`,class:{open:this.isopen,fixed:this.isfixed,disabled:this.disabled},id:this.inputid},this.renderHeader(),!this.disabled&&this.renderContent())}get element(){return s(this)}static get watchers(){return{items:["watchItems"],searchValue:["watchSearchValue"],checkboxes:["watchCheckboxes"]}}};u.style=p;export{u as z_combobox};
|
|
2
|
-
//# sourceMappingURL=p-a0ed0c63.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZComboboxStyle0","ZCombobox","watchItems","this","itemsList","items","JSON","parse","selectedCounter","filter","item","checked","length","updateRenderItemsList","watchSearchValue","filterItems","searchValue","watchCheckboxes","checkboxes","forEach","index","setAttribute","emitComboboxChange","comboboxChange","emit","id","inputid","constructor","hostRef","inputType","InputType","TEXT","randomId","ControlSize","BIG","toggleComboBox","bind","closeFilterItems","componentWillLoad","componentWillRender","componentDidRender","getAllCheckboxes","stringify","getItemId","getCheckboxClass","Array","from","element","shadowRoot","querySelectorAll","getControlToListSize","size","X_SMALL","ListSize","SMALL","MEDIUM","LARGE","handleSelectArrowsNavigation","e","currId","KeyboardCode","ARROW_DOWN","ARROW_UP","includes","key","isopen","preventDefault","stopPropagation","currElem","querySelector","currElemIndex","indexOf","firstElemIndex","lastElemIndex","nextElem","focusComboboxItem","handleHeaderKeyboardEvent","ev","SPACE","handleCheckboxFocus","focusedItemId","elem","focus","resetRenderItemsList","renderItemsList","push","Object","assign","value","start","name","toUpperCase","end","newName","substring","checkAll","map","getComboboxA11yAttributes","role","label","renderHeader","h","class","onClick","onKeyDown","onKeyUp","handleKeyboardSubmit","tabindex","renderContent","hassearch","renderSearchInput","join","hascheckall","renderCheckAll","renderItems","renderList","renderCloseButton","renderItem","htmlTabindex","dividerType","ListDividerType","ELEMENT","NONE","type","CHECKBOX","htmlid","disabled","maxcheckableitems","onInputCheck","i","detail","onInputFocus","renderNoSearchResults","hasgroupitems","renderGroups","newData","reduce","group","category","zListItem","_a","listGroups","entries","slot","noresultslabel","closesearchtext","searchlabel","placeholder","searchplaceholder","htmltitle","searchtitle","message","ESC","onInputChange","checkAllId","allChecked","uncheckalltext","checkalltext","render","open","fixed","isfixed"],"sources":["src/components/z-combobox/styles.css?tag=z-combobox&encapsulation=shadow","src/components/z-combobox/index.tsx"],"sourcesContent":["@import \"../css-components/z-label/styles.css\";\n\n:host {\n display: block;\n color: var(--color-form-default-text);\n fill: var(--color-form-default-icon);\n font-family: var(--font-family-sans);\n}\n\n:host > div.fixed {\n position: relative;\n}\n\n:host > div > .header {\n position: relative;\n z-index: 10;\n display: flex;\n min-height: 42px;\n align-items: center;\n justify-content: space-between;\n padding: 0 calc(var(--space-unit) * 1.5);\n border: var(--border-size-small) solid var(--color-form-surface04);\n margin: 0;\n background-color: var(--color-form-background);\n border-radius: var(--border-radius-small);\n cursor: pointer;\n}\n\n:host([size=\"small\"]) > div > .header {\n min-height: 34px;\n font-size: var(--font-size-2);\n}\n\n:host([size=\"x-small\"]) > div > .header {\n min-height: 30px;\n font-size: var(--font-size-2);\n}\n\n:host([size=\"x-small\"]) > div > .header p.body-3 {\n padding: calc(var(--space-unit) * 0.5) 0;\n}\n\n:host > div > .header:hover {\n outline: var(--border-size-medium) solid var(--color-form-surface04);\n outline-offset: -2px;\n}\n\n:host > div > div.header:focus:focus-visible {\n z-index: 16;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host > div > .header > p.body-3 {\n padding: var(--space-unit) 0;\n margin: 0;\n}\n\n:host > div > .header > p.body-3 > span {\n font-weight: var(--font-sb);\n}\n\n:host > div > .header > z-icon {\n fill: var(--color-form-default-icon);\n transform: rotate(360deg);\n transition: all 200ms linear;\n}\n\n:host > div > .header > z-icon.small,\n:host > div > .header > z-icon.x-small {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n:host > div.open > .header {\n border: var(--border-size-small) solid var(--color-form-active-primary);\n border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;\n}\n\n:host > div.disabled {\n pointer-events: none;\n}\n\n:host > div.disabled .header {\n border-color: var(--color-form-disabled03);\n fill: var(--color-form-disabled01-icon);\n}\n\n:host > div.disabled .header > p.body-3 {\n color: var(--color-form-disabled03);\n}\n\n:host > div.disabled .header > z-icon:last-child {\n fill: var(--color-form-disabled01-icon);\n}\n\n:host > div.open > .header > z-icon {\n fill: var(--color-form-default-icon);\n transform: rotate(180deg);\n transition: all 200ms linear;\n}\n\n:host > div.open > div.open-combo-data {\n position: relative;\n z-index: 12;\n padding: var(--space-unit) calc(var(--space-unit) * 2);\n border: var(--border-size-small) solid var(--color-form-surface03);\n border-top: 0;\n background-color: var(--color-form-background);\n border-radius: 0;\n box-shadow: var(--shadow-2);\n}\n\n:host .open .open-combo-data z-input .z-label {\n color: var(--color-form-default-text);\n}\n\n:host > div.open > div.open-combo-data > div > div {\n overflow: auto;\n max-height: 235px;\n padding: 0;\n}\n\n:host > div.open > div.open-combo-data > z-input {\n width: 100%;\n margin-bottom: calc(var(--space-unit) * 2);\n}\n\n:host > div.open > div.open-combo-data > div > div > ul {\n max-height: 235px;\n padding: 0 3px; /* needed for checkbox focus shadow */\n margin: 0;\n}\n\n:host .open-combo-data z-list-element {\n --background-color-list-element: var(--color-form-background);\n --background-hover-color-list-element: var(--color-form-surface03);\n --background-active-color-list-element: var(--color-form-surface03);\n}\n\n::-webkit-scrollbar {\n width: 6px;\n background: linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px);\n}\n\n::-webkit-scrollbar-thumb {\n background-color: var(--color-primary01);\n}\n\n::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n/* Firefox scrollbar */\n@supports not selector(::-webkit-scrollbar-track) {\n :host {\n scrollbar-color: var(--color-primary01) transparent;\n }\n}\n\n:host > div.open > z-input {\n position: relative;\n z-index: 1;\n width: 238px;\n margin: 0 calc(var(--space-unit) * 2);\n color: var(--color-form-active-primary);\n}\n\n:host > div.open > div.open-combo-data > div > div.search {\n overflow: hidden;\n max-height: none;\n margin-top: 0;\n}\n\n:host > div.open > div.open-combo-data > div > div.search > ul {\n overflow: auto;\n max-height: 180px;\n padding: var(--space-unit) calc(var(--space-unit) * 2);\n}\n\n:host .open .open-combo-data .search .no-results {\n display: flex;\n align-items: center;\n column-gap: var(--space-unit);\n}\n\n:host > .open > .open-combo-data .search .close-search {\n display: flex;\n justify-content: center;\n}\n\n:host > div.open > div.open-combo-data > div > div.search .close-search > a {\n display: inline-block;\n height: 44px;\n color: var(--color-form-active-primary);\n cursor: pointer;\n font-size: 14px;\n font-weight: var(--font-sb);\n line-height: 44px;\n text-align: center;\n text-transform: uppercase;\n}\n\n:host > div.open > div.open-combo-data > div > div.search .close-search > a:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host > div.open > div.open-combo-data > div > div.check-all-wrapper {\n padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5);\n border-bottom: var(--border-size-small) solid var(--gray800);\n margin-bottom: var(--space-unit);\n text-align: left;\n}\n\n:host([size=\"small\"]) > div.open > div.open-combo-data > div > div.check-all-wrapper {\n padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5);\n}\n\n:host([size=\"x-small\"]) > div.open > div.open-combo-data > div > div.check-all-wrapper {\n padding: var(--space-unit) calc(var(--space-unit) * 0.5);\n}\n","import {Component, Element, Event, EventEmitter, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ComboItem, ControlSize, InputType, KeyboardCode, ListDividerType, ListSize} from \"../../beans\";\nimport {handleKeyboardSubmit, randomId} from \"../../utils/utils\";\nimport {ZInput} from \"../z-input\";\n\n@Component({\n tag: \"z-combobox\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZCombobox {\n @Element() element: HTMLZComboboxElement;\n\n /** input unique id */\n @Prop()\n inputid = `combo-${randomId()}`;\n\n /** list items array */\n @Prop()\n items: ComboItem[] | string;\n\n /** label text */\n @Prop()\n label: string;\n\n /** the combobox is disabled */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** show search input flag (optional) */\n @Prop()\n hassearch?: boolean = false;\n\n /** search input label text (optional) */\n @Prop()\n searchlabel?: string;\n\n /** search input placeholder text (optional) */\n @Prop()\n searchplaceholder?: string;\n\n /** search input title text (optional) */\n @Prop()\n searchtitle?: string;\n\n /** no result text message */\n @Prop()\n noresultslabel?: string = \"Nessun risultato\";\n\n /** toggle combo list opening flag */\n @Prop({mutable: true})\n isopen = false;\n\n /** fixed style flag */\n @Prop()\n isfixed = false;\n\n /** close combobox list text */\n @Prop()\n closesearchtext?: string = \"Chiudi\";\n\n /** show \"check all\" checkbox (optional) */\n @Prop()\n hascheckall?: boolean = false;\n\n /** check all label (optional) */\n @Prop()\n checkalltext?: string = \"Seleziona tutti\";\n\n /** uncheck all label (optional) */\n @Prop()\n uncheckalltext?: string = \"Deseleziona tutti\";\n\n /** max number of checkable items (0 = unlimited) */\n @Prop()\n maxcheckableitems = 0;\n\n /** group items by category */\n @Prop()\n hasgroupitems?: boolean;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop()\n size?: ControlSize = ControlSize.BIG;\n\n @State()\n searchValue: string;\n\n @State()\n selectedCounter: number;\n\n @State()\n renderItemsList: ComboItem[] = []; // used for render only\n\n @State()\n focusedItemId: string;\n\n @State()\n checkboxes: HTMLInputElement[] = [];\n\n private itemsList: ComboItem[] = [];\n\n private inputType: InputType = InputType.TEXT;\n\n @Watch(\"items\")\n watchItems(): void {\n this.itemsList = typeof this.items === \"string\" ? JSON.parse(this.items) : this.items;\n this.selectedCounter = this.itemsList.filter((item) => item.checked).length;\n this.updateRenderItemsList();\n }\n\n @Watch(\"searchValue\")\n watchSearchValue(): void {\n this.filterItems(this.searchValue);\n }\n\n @Watch(\"checkboxes\")\n watchCheckboxes(): void {\n this.checkboxes.forEach((item, index) => item.setAttribute(\"tabindex\", index === 0 ? \"0\" : \"-1\"));\n }\n\n /** Emitted when value is checked/unchecked. Returns id, items. */\n @Event()\n comboboxChange: EventEmitter;\n\n private emitComboboxChange(): void {\n this.comboboxChange.emit({id: this.inputid, items: this.itemsList});\n }\n\n constructor() {\n this.toggleComboBox = this.toggleComboBox.bind(this);\n this.closeFilterItems = this.closeFilterItems.bind(this);\n }\n\n componentWillLoad(): void {\n this.watchItems();\n }\n\n componentWillRender(): void {\n this.selectedCounter = this.itemsList.filter((item) => item.checked).length;\n }\n\n componentDidRender(): void {\n const checkboxes = this.getAllCheckboxes();\n if (JSON.stringify(checkboxes) !== JSON.stringify(this.checkboxes)) {\n this.checkboxes = checkboxes;\n }\n }\n\n private getItemId(item: ComboItem): string {\n return `combo-checkbox-${this.inputid}-${item.id}`;\n }\n\n private getCheckboxClass(): string {\n return `combo-item-checkbox-input-${this.inputid}`;\n }\n\n private getAllCheckboxes(): HTMLInputElement[] {\n return Array.from(\n this.element.shadowRoot.querySelectorAll(`.${this.getCheckboxClass()} input:not([disabled])`)\n ) as HTMLInputElement[];\n }\n\n private getControlToListSize(): ListSize {\n switch (this.size) {\n case ControlSize.X_SMALL:\n return ListSize.SMALL;\n case ControlSize.SMALL:\n return ListSize.MEDIUM;\n default:\n return ListSize.LARGE;\n }\n }\n\n private handleSelectArrowsNavigation(e: KeyboardEvent, currId: string): void {\n if (![KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP].includes(e.key as KeyboardCode) || !this.isopen) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const currElem = this.element.shadowRoot.querySelector(`#${currId}`) as HTMLInputElement;\n if (!currElem) {\n return;\n }\n\n const checkboxes = this.checkboxes;\n if (!checkboxes.length) {\n return;\n }\n\n const currElemIndex = checkboxes.indexOf(currElem);\n const firstElemIndex = 0;\n const lastElemIndex = checkboxes.length - 1;\n\n let nextElem = null;\n if (e.key === KeyboardCode.ARROW_DOWN) {\n nextElem = currElemIndex === lastElemIndex ? checkboxes[firstElemIndex] : checkboxes[currElemIndex + 1];\n } else if (e.key === KeyboardCode.ARROW_UP) {\n nextElem = currElemIndex === firstElemIndex ? checkboxes[lastElemIndex] : checkboxes[currElemIndex - 1];\n }\n\n this.focusComboboxItem(nextElem);\n }\n\n private handleHeaderKeyboardEvent(ev: KeyboardEvent): void {\n if (ev.key === KeyboardCode.SPACE) {\n ev.preventDefault();\n }\n if ((ev.key === KeyboardCode.ARROW_DOWN && !this.isopen) || (ev.key === KeyboardCode.ARROW_UP && this.isopen)) {\n this.toggleComboBox();\n }\n }\n\n private handleCheckboxFocus(id: string): void {\n this.focusedItemId = id;\n }\n\n private focusComboboxItem(elem): void {\n this.checkboxes.forEach(function (item) {\n item.setAttribute(\"tabindex\", \"-1\");\n });\n\n elem.setAttribute(\"tabindex\", \"0\");\n elem.focus();\n }\n\n private updateRenderItemsList(): void {\n if (this.searchValue) {\n this.filterItems(this.searchValue);\n } else {\n this.resetRenderItemsList();\n }\n }\n\n private resetRenderItemsList(): void {\n const renderItemsList = [];\n this.itemsList.forEach((item: ComboItem) => {\n renderItemsList.push({...item});\n });\n this.renderItemsList = renderItemsList;\n }\n\n private filterItems(value: string): void {\n if (!value) {\n return this.closeFilterItems();\n }\n\n this.resetRenderItemsList();\n this.renderItemsList = this.renderItemsList.filter((item) => {\n const start = item.name.toUpperCase().indexOf(value.toUpperCase());\n const end = start + value.length;\n const newName =\n item.name.substring(0, start) +\n \"<strong>\" +\n item.name.substring(start, end) +\n \"</strong>\" +\n item.name.substring(end, item.name.length);\n\n item.name = newName;\n\n return start >= 0;\n });\n }\n\n private checkAll(checked = true): void {\n this.itemsList = this.itemsList.map((item: ComboItem) => ({\n ...item,\n checked: checked,\n }));\n this.resetRenderItemsList();\n this.emitComboboxChange();\n }\n\n private closeFilterItems(): void {\n this.searchValue = \"\";\n this.resetRenderItemsList();\n }\n\n private toggleComboBox(): void {\n this.isopen = !this.isopen;\n }\n\n private getComboboxA11yAttributes(): Record<string, string> {\n return {\n \"role\": \"combobox\",\n \"aria-label\": this.label,\n \"aria-expanded\": this.isopen ? \"true\" : \"false\",\n \"aria-activedescendant\": this.isopen ? this.focusedItemId : \"\",\n \"aria-controls\": `${this.inputid}_list`,\n };\n }\n\n private renderHeader(): HTMLDivElement {\n return (\n <div\n class=\"header\"\n onClick={() => this.toggleComboBox()}\n onKeyDown={(ev: KeyboardEvent) => {\n this.handleHeaderKeyboardEvent(ev);\n }}\n onKeyUp={(ev: KeyboardEvent) => handleKeyboardSubmit(ev, this.toggleComboBox)}\n role=\"button\"\n tabindex={0}\n aria-expanded={this.isopen ? \"true\" : \"false\"}\n >\n <p class=\"body-3\">\n {this.label}\n <span>{this.selectedCounter > 0 && ` (${this.selectedCounter})`}</span>\n </p>\n <z-icon\n name=\"caret-down\"\n class={this.size}\n />\n </div>\n );\n }\n\n private renderContent(): HTMLDivElement {\n if (!this.isopen) {\n return;\n }\n\n return (\n <div class=\"open-combo-data\">\n {this.hassearch && this.renderSearchInput()}\n {!this.hassearch ? <span {...this.getComboboxA11yAttributes()} /> : null}\n <div\n role=\"listbox\"\n aria-label={this.label}\n aria-multiselectable={true}\n id={`${this.inputid}_list`}\n aria-owns={`${this.checkboxes.map((item) => item.id).join(\" \")}`}\n >\n {this.hascheckall && this.renderCheckAll()}\n {this.renderItems()}\n </div>\n </div>\n );\n }\n\n private renderItems(): HTMLDivElement {\n return (\n <div class={this.searchValue && \"search\"}>\n {this.renderList(this.renderItemsList)}\n {this.searchValue && this.renderCloseButton()}\n </div>\n );\n }\n\n private renderItem(item: ComboItem, index: number, length: number): HTMLZListElement {\n return (\n <z-list-element\n id={item.id}\n htmlTabindex={null}\n dividerType={index !== length - 1 ? ListDividerType.ELEMENT : ListDividerType.NONE}\n size={this.getControlToListSize()}\n >\n <z-input\n type={InputType.CHECKBOX}\n checked={item.checked}\n htmlid={this.getItemId(item)}\n label={item.name}\n class={this.getCheckboxClass()}\n disabled={!item.checked && this.maxcheckableitems && this.selectedCounter >= this.maxcheckableitems}\n size={this.size === ControlSize.X_SMALL ? ControlSize.SMALL : this.size}\n role=\"option\"\n aria-selected={item.checked ? \"true\" : \"false\"}\n onKeyDown={(e: KeyboardEvent) => this.handleSelectArrowsNavigation(e, this.getItemId(item))}\n onInputCheck={(e: CustomEvent) => {\n this.itemsList = this.itemsList.map((i: ComboItem) => {\n if (item.id === i.id) {\n i.checked = e.detail.checked;\n }\n\n return i;\n });\n this.updateRenderItemsList();\n this.emitComboboxChange();\n }}\n onInputFocus={(e: CustomEvent) => this.handleCheckboxFocus(e.detail.id)}\n />\n </z-list-element>\n );\n }\n\n private renderList(items: ComboItem[]): HTMLUListElement {\n if (!items) {\n return;\n }\n if (!items.length && this.searchValue) {\n return this.renderNoSearchResults();\n }\n\n if (this.hasgroupitems) {\n return this.renderGroups(items);\n }\n\n return (\n <ul role=\"none\">\n {items.map((item, i) => {\n return this.renderItem(item, i, items.length);\n })}\n </ul>\n );\n }\n\n private renderGroups(items: ComboItem[]): HTMLUListElement {\n const newData = items.reduce((group, item, index) => {\n const {category} = item;\n const zListItem = this.renderItem(item, index, items.length);\n\n group[category] = group[category] ?? [];\n group[category].push(zListItem);\n\n return group;\n }, {});\n\n const listGroups = Object.entries(newData as {[key: string]: HTMLZListElementElement[]}).map(([key, value]) => {\n return (\n <z-list-group divider-type={ListDividerType.ELEMENT}>\n <span\n class=\"body-3-sb z-list-group-title\"\n slot=\"header-title\"\n >\n {key}\n </span>\n {value.map((item) => item)}\n </z-list-group>\n );\n });\n\n return <ul role=\"none\">{listGroups}</ul>;\n }\n\n private renderNoSearchResults(): HTMLUListElement {\n return (\n <div class=\"no-results\">\n <z-icon name=\"multiply-circle\" />\n <span>{this.noresultslabel}</span>\n </div>\n );\n }\n\n private renderCloseButton(): HTMLDivElement {\n return (\n <div class=\"close-search\">\n <a\n onClick={() => this.closeFilterItems()}\n onKeyUp={(e: KeyboardEvent) => handleKeyboardSubmit(e, this.closeFilterItems)}\n role=\"button\"\n tabindex={0}\n >\n {this.closesearchtext}\n </a>\n </div>\n );\n }\n\n private renderSearchInput(): ZInput {\n return (\n <z-input\n htmlid={`${this.inputid}_search`}\n label={this.searchlabel}\n placeholder={this.searchplaceholder}\n htmltitle={this.searchtitle}\n type={this.inputType}\n value={this.searchValue}\n message={false}\n size={this.size}\n aria-autocomplete=\"list\"\n {...this.getComboboxA11yAttributes()}\n onKeyUp={(e: KeyboardEvent) => {\n if (e.key === KeyboardCode.ESC) {\n this.closeFilterItems();\n }\n }}\n onInputChange={(e: CustomEvent) => {\n this.searchValue = e.detail.value;\n }}\n />\n );\n }\n\n private renderCheckAll(): HTMLDivElement {\n if (this.searchValue) {\n return;\n }\n\n const checkAllId = `combo-checkbox-${this.inputid}-check-all`;\n const allChecked = this.selectedCounter === this.itemsList.length;\n\n return (\n <div class=\"check-all-wrapper\">\n <z-input\n type={InputType.CHECKBOX}\n checked={allChecked}\n htmlid={checkAllId}\n class={this.getCheckboxClass()}\n label={allChecked ? this.uncheckalltext : this.checkalltext}\n disabled={this.maxcheckableitems && this.maxcheckableitems < this.itemsList.length}\n size={this.size === ControlSize.X_SMALL ? ControlSize.SMALL : this.size}\n role=\"option\"\n aria-selected={allChecked ? \"true\" : \"false\"}\n onKeyDown={(e: KeyboardEvent) => this.handleSelectArrowsNavigation(e, checkAllId)}\n onInputCheck={(e: CustomEvent) => this.checkAll(e.detail.checked)}\n onInputFocus={(e: CustomEvent) => this.handleCheckboxFocus(e.detail.id)}\n />\n </div>\n );\n }\n\n render(): HTMLDivElement {\n return (\n <div\n data-action={`combo-${this.inputid}`}\n class={{open: this.isopen, fixed: this.isfixed, disabled: this.disabled}}\n id={this.inputid}\n >\n {this.renderHeader()}\n {!this.disabled && this.renderContent()}\n </div>\n );\n }\n}\n"],"mappings":"uLAAA,MAAMA,EAAY,4uJAClB,MAAAC,EAAeD,E,MCSFE,EAAS,MA+FpB,UAAAC,GACEC,KAAKC,iBAAmBD,KAAKE,QAAU,SAAWC,KAAKC,MAAMJ,KAAKE,OAASF,KAAKE,MAChFF,KAAKK,gBAAkBL,KAAKC,UAAUK,QAAQC,GAASA,EAAKC,UAASC,OACrET,KAAKU,uB,CAIP,gBAAAC,GACEX,KAAKY,YAAYZ,KAAKa,Y,CAIxB,eAAAC,GACEd,KAAKe,WAAWC,SAAQ,CAACT,EAAMU,IAAUV,EAAKW,aAAa,WAAYD,IAAU,EAAI,IAAM,O,CAOrF,kBAAAE,GACNnB,KAAKoB,eAAeC,KAAK,CAACC,GAAItB,KAAKuB,QAASrB,MAAOF,KAAKC,W,CAG1D,WAAAuB,CAAAC,G,yDA7BQzB,KAAAC,UAAyB,GAEzBD,KAAA0B,UAAuBC,EAAUC,K,aAvF/B,SAASC,M,wDAYE,M,eAIC,M,2GAgBI,mB,YAIjB,M,aAIC,M,qBAIiB,S,iBAIH,M,kBAIA,kB,oBAIE,oB,uBAIN,E,uCAQCC,EAAYC,I,+EASF,G,6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