@zanichelli/albe-web-components 13.1.0 → 13.1.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/cjs/z-carousel.cjs.entry.js +3 -2
  3. package/dist/cjs/z-carousel.cjs.entry.js.map +1 -1
  4. package/dist/cjs/z-popover.cjs.entry.js +3 -3
  5. package/dist/cjs/z-popover.cjs.entry.js.map +1 -1
  6. package/dist/cjs/z-table.cjs.entry.js +3 -2
  7. package/dist/cjs/z-table.cjs.entry.js.map +1 -1
  8. package/dist/collection/components/table/z-table/index.js +3 -2
  9. package/dist/collection/components/table/z-table/index.js.map +1 -1
  10. package/dist/collection/components/z-carousel/index.js +2 -1
  11. package/dist/collection/components/z-carousel/index.js.map +1 -1
  12. package/dist/collection/components/z-carousel/styles.css +1 -0
  13. package/dist/collection/components/z-popover/index.js +4 -4
  14. package/dist/collection/components/z-popover/index.js.map +1 -1
  15. package/dist/components/index25.js +3 -3
  16. package/dist/components/index25.js.map +1 -1
  17. package/dist/components/z-carousel.js +3 -2
  18. package/dist/components/z-carousel.js.map +1 -1
  19. package/dist/components/z-table.js +3 -2
  20. package/dist/components/z-table.js.map +1 -1
  21. package/dist/esm/z-carousel.entry.js +3 -2
  22. package/dist/esm/z-carousel.entry.js.map +1 -1
  23. package/dist/esm/z-popover.entry.js +3 -3
  24. package/dist/esm/z-popover.entry.js.map +1 -1
  25. package/dist/esm/z-table.entry.js +3 -2
  26. package/dist/esm/z-table.entry.js.map +1 -1
  27. package/dist/types/components/z-popover/index.d.ts +1 -0
  28. package/dist/types/components.d.ts +2 -2
  29. package/dist/web-components-library/{p-158b6dda.entry.js → p-3796ca7c.entry.js} +2 -2
  30. package/dist/web-components-library/p-3796ca7c.entry.js.map +1 -0
  31. package/dist/web-components-library/p-9a42f04c.entry.js +2 -0
  32. package/dist/web-components-library/p-9a42f04c.entry.js.map +1 -0
  33. package/{www/build/p-2637ab23.entry.js → dist/web-components-library/p-f7607ce7.entry.js} +2 -2
  34. package/dist/web-components-library/p-f7607ce7.entry.js.map +1 -0
  35. package/dist/web-components-library/web-components-library.esm.js +1 -1
  36. package/package.json +1 -1
  37. package/www/build/{p-158b6dda.entry.js → p-3796ca7c.entry.js} +2 -2
  38. package/www/build/p-3796ca7c.entry.js.map +1 -0
  39. package/www/build/{p-abb01ccd.js → p-83f1ed74.js} +1 -1
  40. package/www/build/p-9a42f04c.entry.js +2 -0
  41. package/www/build/p-9a42f04c.entry.js.map +1 -0
  42. package/{dist/web-components-library/p-2637ab23.entry.js → www/build/p-f7607ce7.entry.js} +2 -2
  43. package/www/build/p-f7607ce7.entry.js.map +1 -0
  44. package/www/build/web-components-library.esm.js +1 -1
  45. package/www/index.html +1 -1
  46. package/dist/web-components-library/p-158b6dda.entry.js.map +0 -1
  47. package/dist/web-components-library/p-2637ab23.entry.js.map +0 -1
  48. package/dist/web-components-library/p-93cb103f.entry.js +0 -2
  49. package/dist/web-components-library/p-93cb103f.entry.js.map +0 -1
  50. package/www/build/p-158b6dda.entry.js.map +0 -1
  51. package/www/build/p-2637ab23.entry.js.map +0 -1
  52. package/www/build/p-93cb103f.entry.js +0 -2
  53. package/www/build/p-93cb103f.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/z-popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAe,MAAM,eAAe,CAAC;AACrG,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAE1D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC;AAElD,SAAS,gBAAgB,CAAC,OAAgB;IACxC,IAAK,OAAO,CAAC,UAAyB,CAAC,IAAI,EAAE,CAAC;QAC5C,OA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M,GAAG,GAAG,YAAY,GAAG,YAAY,CAAC,MAAM,GAAG,cAAc,IAAI,CAAC;YAC1E,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC;YACpB,KAAK,CAAC,QAAQ,GAAG,GAAG,aAAa,IAAI,CAAC;YACtC,KAAK,CAAC,SAAS,GAAG,GAAG,YAAY,GAAG,YAAY,CAAC,MAAM,GAAG,YAAY,IAAI,CAAC;QAC7E,CAAC;QAED,IAAI,CAAC,eAAe,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,8DAAa,CAAC;IACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, h, Watch, Listen, Element, State, Event, EventEmitter} from \"@stencil/core\";\nimport {PopoverPosition, KeyboardCode} from \"../../beans\";\n\nconst DOCUMENT_ELEMENT = document.documentElement;\n\nfunction getParentElement(element: Element): ShadowRoot[\"host\"] {\n if ((element.parentNode as ShadowRoot).host) {\n return (element.parentNode as ShadowRoot).host;\n }\n\n return element.parentNode as Element;\n}\n\n/**\n * Find the closest scrollable parent of a node.\n *\n * @param {Element} element The node\n */\nfunction findScrollableParent(element: Element): Element {\n let parent = getParentElement(element);\n\n while (parent && parent !== DOCUMENT_ELEMENT) {\n const {overflow, overflowX, overflowY} = window.getComputedStyle(parent);\n if (overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\") {\n return parent;\n }\n\n if (\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\")\n ) {\n return parent;\n }\n\n parent = getParentElement(parent);\n }\n\n return DOCUMENT_ELEMENT;\n}\n\n/**\n * Calculate computed offset.\n * It includes matrix transformations.\n * @param element The target element.\n * @param targetParentOffset The relative offset parent.\n * @return A client rect object.\n */\nfunction computeOffset(element: HTMLElement, targetParentOffset?: HTMLElement): Record<string, number> {\n const rect = element.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n\n let top = 0;\n let left = 0;\n let offsetParent = element;\n while (offsetParent && offsetParent != targetParentOffset) {\n left += offsetParent.offsetLeft;\n\n // document.body sometimes has offsetTop == 0 but still has an\n // offset because of children margins!\n if (offsetParent === document.body) {\n top += offsetParent.getBoundingClientRect().top + window.scrollY;\n } else {\n top += offsetParent.offsetTop;\n }\n\n if (window.DOMMatrix) {\n const style = window.getComputedStyle(offsetParent);\n const transform = style.transform || style.webkitTransform;\n const domMatrix = new DOMMatrix(transform);\n if (domMatrix) {\n left += domMatrix.m41;\n if (offsetParent !== document.body) {\n top += domMatrix.m42;\n }\n }\n }\n\n if (!offsetParent.offsetParent) {\n break;\n }\n\n offsetParent = offsetParent.offsetParent as HTMLElement;\n }\n\n let parentWidth: number;\n let parentHeight: number;\n if (offsetParent === document.body) {\n parentWidth = window.innerWidth;\n parentHeight = window.innerHeight;\n } else {\n parentWidth = offsetParent.offsetWidth;\n parentHeight = offsetParent.offsetHeight;\n }\n\n const right = parentWidth - left - rect.width;\n const bottom = parentHeight - top - rect.height;\n\n return {top, right, bottom, left, width, height};\n}\n\n/**\n * Popover component.\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 /** Popover position. */\n @Prop({reflect: true})\n position: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * The open state of the popover.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /**\n * Whether to show popover's arrow.\n */\n @Prop({reflect: true})\n showArrow = false;\n\n /**\n * Whether to center the popup on the main side (according to \"position\").\n */\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 */\n @State()\n currentPosition?: PopoverPosition;\n\n /**\n * Position change event.\n */\n @Event()\n positionChange: EventEmitter;\n\n /**\n * Open change event.\n */\n @Event()\n openChange: EventEmitter;\n\n @Element() host: HTMLZPopoverElement;\n\n private animationFrameRequestId?: number;\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 * @param {MouseEvent} e\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n if (!this.closable || !this.open) {\n return;\n }\n\n if (!e.composedPath().includes(this.host)) {\n const target = e.target as HTMLElement;\n const triggerElemClicked =\n this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(CSS.escape(this.bindTo));\n if (triggerElemClicked) {\n e.stopPropagation();\n }\n\n this.open = false;\n this.positionChange.emit({position: this.currentPosition});\n }\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (newValue && !Object.values(PopoverPosition).includes(newValue as PopoverPosition)) {\n this.position = PopoverPosition.AUTO;\n }\n\n this.currentPosition = this.position;\n this.positionChange.emit({position: this.currentPosition});\n }\n\n /**\n * Setup popover behaviors on opening.\n */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n if (this.open) {\n const setPosition = (): void => {\n if (this.open) {\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(setPosition);\n }\n };\n\n setPosition();\n } else if (this.host.hasAttribute(\"current-position\")) {\n this.host.removeAttribute(\"current-position\");\n this.currentPosition = undefined;\n }\n\n this.openChange.emit({open: this.open});\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n /**\n * Set the position of the popover.\n */\n private setPosition(): void {\n let element: HTMLElement;\n if (typeof this.bindTo === \"string\") {\n element = this.host.ownerDocument.querySelector(CSS.escape(this.bindTo)) as HTMLElement;\n } else if (this.bindTo) {\n element = this.bindTo;\n } else {\n element = this.host.parentElement as HTMLElement;\n }\n\n if (!element) {\n return;\n }\n\n const scrollContainer = findScrollableParent(element) as HTMLElement;\n const scrollingBoundingRect = scrollContainer.getBoundingClientRect();\n const offsetContainer = this.host.offsetParent as HTMLElement;\n\n const relativeBoundingRect = offsetContainer\n ? computeOffset(offsetContainer, scrollContainer)\n : {top: 0, right: 0, bottom: 0, left: 0};\n const boundingRect = computeOffset(element, scrollContainer);\n\n const top = boundingRect.top - scrollContainer.scrollTop;\n const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;\n const left = boundingRect.left - scrollContainer.scrollLeft;\n const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;\n\n const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);\n const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);\n\n const availableTop = Math.min(top, top + scrollingBoundingRect.top);\n const availableBottom = Math.min(bottom, bottom - overflowBottom);\n const availableLeft = Math.min(left, left + scrollingBoundingRect.left);\n const availableRight = Math.min(right, right - overflowRight);\n\n const availableHeight = availableTop + availableBottom + boundingRect.height;\n const availableWidth = availableLeft + availableRight + boundingRect.width;\n\n let position = this.currentPosition;\n const positions: PopoverPosition[] = [];\n if (this.position === PopoverPosition.AUTO) {\n /**\n * The `AUTO` position tries to place the popover in the 'safest' area,\n * where there's more space available.\n */\n if (availableLeft / availableWidth > 0.6) {\n positions.push(PopoverPosition.LEFT);\n } else if (availableLeft / availableWidth < 0.4) {\n positions.push(PopoverPosition.RIGHT);\n }\n\n if (availableTop / availableHeight > 0.9) {\n positions.unshift(PopoverPosition.TOP);\n } else if (availableTop / availableHeight > 0.6) {\n positions.push(PopoverPosition.TOP);\n } else if (availableTop / availableHeight < 0.1) {\n positions.unshift(PopoverPosition.BOTTOM);\n } else {\n positions.push(PopoverPosition.BOTTOM);\n }\n\n position = positions.join(\"_\") as PopoverPosition;\n }\n\n const style = this.host.style;\n style.position = \"absolute\";\n\n const offsetTop = boundingRect.top - relativeBoundingRect.top;\n const offsetRight = boundingRect.right - relativeBoundingRect.right;\n const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;\n const offsetLeft = boundingRect.left - relativeBoundingRect.left;\n const offsetModifier = this.center ? 0.5 : 0;\n const sizeModifier = this.center ? 0.5 : 0;\n\n if (position === PopoverPosition.TOP || position === PopoverPosition.TOP_RIGHT) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableTop}px`;\n if (position === PopoverPosition.TOP_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.TOP_LEFT) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop}px`;\n } else if (position === PopoverPosition.BOTTOM || position === PopoverPosition.BOTTOM_RIGHT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableBottom}px`;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.BOTTOM_LEFT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom}px`;\n } else if (position === PopoverPosition.RIGHT || position === PopoverPosition.RIGHT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.RIGHT_TOP) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT || position === PopoverPosition.LEFT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT_TOP) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n }\n\n this.currentPosition = position || this.position;\n this.host.setAttribute(\"current-position\", this.currentPosition);\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n this.onOpen();\n }\n\n render(): HTMLSlotElement {\n return <slot></slot>;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/z-popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAe,MAAM,eAAe,CAAC;AACrG,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAE1D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC;AAElD,SAAS,gBAAgB,CAAC,OAAgB;IACxC,IAAK,OAAO,CAAC,UAAyB,CAAC,IAAI,EAAE,CAAC;QAC5C,OAAQ,OAAO,CAAC,UAAyB,CAAC,IAAI,CAAC;IACjD,CAAC;IAED,OAAO,OAAO,CAAC,UAAqB,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,OAAgB;IAC5C,IAAI,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEvC,OAAO,MAAM,IAAI,MAAM,KAAK,gBAAgB,EAAE,CAAC;QAC7C,MAAM,EAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,QAAQ,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,EA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IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,8DAAa,CAAC;IACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, h, Watch, Listen, Element, State, Event, EventEmitter} from \"@stencil/core\";\nimport {PopoverPosition, KeyboardCode} from \"../../beans\";\n\nconst DOCUMENT_ELEMENT = document.documentElement;\n\nfunction getParentElement(element: Element): ShadowRoot[\"host\"] {\n if ((element.parentNode as ShadowRoot).host) {\n return (element.parentNode as ShadowRoot).host;\n }\n\n return element.parentNode as Element;\n}\n\n/**\n * Find the closest scrollable parent of a node.\n *\n * @param {Element} element The node\n */\nfunction findScrollableParent(element: Element): Element {\n let parent = getParentElement(element);\n\n while (parent && parent !== DOCUMENT_ELEMENT) {\n const {overflow, overflowX, overflowY} = window.getComputedStyle(parent);\n if (overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\") {\n return parent;\n }\n\n if (\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\")\n ) {\n return parent;\n }\n\n parent = getParentElement(parent);\n }\n\n return DOCUMENT_ELEMENT;\n}\n\n/**\n * Calculate computed offset.\n * It includes matrix transformations.\n * @param element The target element.\n * @param targetParentOffset The relative offset parent.\n * @return A client rect object.\n */\nfunction computeOffset(element: HTMLElement, targetParentOffset?: HTMLElement): Record<string, number> {\n const rect = element.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n\n let top = 0;\n let left = 0;\n let offsetParent = element;\n while (offsetParent && offsetParent != targetParentOffset) {\n left += offsetParent.offsetLeft;\n\n // document.body sometimes has offsetTop == 0 but still has an\n // offset because of children margins!\n if (offsetParent === document.body) {\n top += offsetParent.getBoundingClientRect().top + window.scrollY;\n } else {\n top += offsetParent.offsetTop;\n }\n\n if (window.DOMMatrix) {\n const style = window.getComputedStyle(offsetParent);\n const transform = style.transform || style.webkitTransform;\n const domMatrix = new DOMMatrix(transform);\n if (domMatrix) {\n left += domMatrix.m41;\n if (offsetParent !== document.body) {\n top += domMatrix.m42;\n }\n }\n }\n\n if (!offsetParent.offsetParent) {\n break;\n }\n\n offsetParent = offsetParent.offsetParent as HTMLElement;\n }\n\n let parentWidth: number;\n let parentHeight: number;\n if (offsetParent === document.body) {\n parentWidth = window.innerWidth;\n parentHeight = window.innerHeight;\n } else {\n parentWidth = offsetParent.offsetWidth;\n parentHeight = offsetParent.offsetHeight;\n }\n\n const right = parentWidth - left - rect.width;\n const bottom = parentHeight - top - rect.height;\n\n return {top, right, bottom, left, width, height};\n}\n\n/**\n * Popover component.\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 /** Popover position. */\n @Prop({reflect: true})\n position: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * The open state of the popover.\n */\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 /**\n * Whether to show popover's arrow.\n */\n @Prop({reflect: true})\n showArrow = false;\n\n /**\n * Whether to center the popup on the main side (according to \"position\").\n */\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 */\n @State()\n currentPosition?: PopoverPosition;\n\n /**\n * Position change event.\n */\n @Event()\n positionChange: EventEmitter;\n\n /**\n * Open change event.\n */\n @Event()\n openChange: EventEmitter;\n\n @Element() host: HTMLZPopoverElement;\n\n private animationFrameRequestId?: number;\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 * @param {MouseEvent} e\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n if (!this.closable || !this.open) {\n return;\n }\n\n if (!e.composedPath().includes(this.host)) {\n const target = e.target as HTMLElement;\n const triggerElemClicked =\n this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(this.bindTo);\n if (triggerElemClicked) {\n e.stopPropagation();\n }\n\n this.open = false;\n this.positionChange.emit({position: this.currentPosition});\n }\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (newValue && !Object.values(PopoverPosition).includes(newValue as PopoverPosition)) {\n this.position = PopoverPosition.AUTO;\n }\n\n this.currentPosition = this.position;\n this.positionChange.emit({position: this.currentPosition});\n }\n\n /**\n * Setup popover behaviors on opening.\n */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n if (this.open) {\n const setPosition = (): void => {\n if (this.open) {\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(setPosition);\n }\n };\n\n setPosition();\n } else if (this.host.hasAttribute(\"current-position\")) {\n this.host.removeAttribute(\"current-position\");\n this.currentPosition = undefined;\n }\n\n this.openChange.emit({open: this.open});\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n /**\n * Set the position of the popover.\n */\n private setPosition(): void {\n let element: HTMLElement;\n if (typeof this.bindTo === \"string\") {\n element = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n element = this.bindTo;\n } else {\n element = this.host.parentElement as HTMLElement;\n }\n\n if (!element) {\n return;\n }\n\n const scrollContainer = findScrollableParent(element) as HTMLElement;\n const scrollingBoundingRect = scrollContainer.getBoundingClientRect();\n const offsetContainer = this.host.offsetParent as HTMLElement;\n\n const relativeBoundingRect = offsetContainer\n ? computeOffset(offsetContainer, scrollContainer)\n : {top: 0, right: 0, bottom: 0, left: 0};\n const boundingRect = computeOffset(element, scrollContainer);\n\n const top = boundingRect.top - scrollContainer.scrollTop;\n const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;\n const left = boundingRect.left - scrollContainer.scrollLeft;\n const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;\n\n const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);\n const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);\n\n const availableTop = Math.min(top, top + scrollingBoundingRect.top);\n const availableBottom = Math.min(bottom, bottom - overflowBottom);\n const availableLeft = Math.min(left, left + scrollingBoundingRect.left);\n const availableRight = Math.min(right, right - overflowRight);\n\n const availableHeight = availableTop + availableBottom + boundingRect.height;\n const availableWidth = availableLeft + availableRight + boundingRect.width;\n\n let position = this.currentPosition;\n const positions: PopoverPosition[] = [];\n if (this.position === PopoverPosition.AUTO) {\n /**\n * The `AUTO` position tries to place the popover in the 'safest' area,\n * where there's more space available.\n */\n if (availableLeft / availableWidth > 0.6) {\n positions.push(PopoverPosition.LEFT);\n } else if (availableLeft / availableWidth < 0.4) {\n positions.push(PopoverPosition.RIGHT);\n }\n\n if (availableTop / availableHeight > 0.9) {\n positions.unshift(PopoverPosition.TOP);\n } else if (availableTop / availableHeight > 0.6) {\n positions.push(PopoverPosition.TOP);\n } else if (availableTop / availableHeight < 0.1) {\n positions.unshift(PopoverPosition.BOTTOM);\n } else {\n positions.push(PopoverPosition.BOTTOM);\n }\n\n position = positions.join(\"_\") as PopoverPosition;\n }\n\n const style = this.host.style;\n style.position = \"absolute\";\n\n const offsetTop = boundingRect.top - relativeBoundingRect.top;\n const offsetRight = boundingRect.right - relativeBoundingRect.right;\n const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;\n const offsetLeft = boundingRect.left - relativeBoundingRect.left;\n const offsetModifier = this.center ? 0.5 : 0;\n const sizeModifier = this.center ? 0.5 : 0;\n\n if (position === PopoverPosition.TOP || position === PopoverPosition.TOP_RIGHT) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableTop}px`;\n if (position === PopoverPosition.TOP_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.TOP_LEFT) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop}px`;\n } else if (position === PopoverPosition.BOTTOM || position === PopoverPosition.BOTTOM_RIGHT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableBottom}px`;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.BOTTOM_LEFT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom}px`;\n } else if (position === PopoverPosition.RIGHT || position === PopoverPosition.RIGHT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.RIGHT_TOP) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT || position === PopoverPosition.LEFT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT_TOP) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n }\n\n this.currentPosition = position || this.position;\n this.host.setAttribute(\"current-position\", this.currentPosition);\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n this.onOpen();\n }\n\n render(): HTMLSlotElement {\n return <slot></slot>;\n }\n}\n"]}
@@ -117,7 +117,7 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
117
117
  }
118
118
  if (!e.composedPath().includes(this.host)) {
119
119
  const target = e.target;
120
- const triggerElemClicked = this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(CSS.escape(this.bindTo));
120
+ const triggerElemClicked = this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(this.bindTo);
121
121
  if (triggerElemClicked) {
122
122
  e.stopPropagation();
123
123
  }
@@ -161,7 +161,7 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
161
161
  setPosition() {
162
162
  let element;
163
163
  if (typeof this.bindTo === "string") {
164
- element = this.host.ownerDocument.querySelector(CSS.escape(this.bindTo));
164
+ element = this.host.ownerDocument.querySelector(this.bindTo);
165
165
  }
166
166
  else if (this.bindTo) {
167
167
  element = this.bindTo;
@@ -302,7 +302,7 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
302
302
  this.onOpen();
303
303
  }
304
304
  render() {
305
- return h("slot", { key: '70c742e7871fbf8a871165a4de625dda200ae024' });
305
+ return h("slot", { key: 'dd51a369f1d5c8097418f1e69dd52c155adbe46e' });
306
306
  }
307
307
  get host() { return this; }
308
308
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"index25.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,sxGAAsxG,CAAC;AACzyG,uBAAe,SAAS;;ACExB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC;AAElD,SAAS,gBAAgB,CAAC,OAAgB;IACxC,IAAK,OAAO,CAAC,UAAyB,CAAC,IAAI,EAAE;QAC3C,OAAQ,OAAO,CAAC,UAAyB,CAAC,IAAI,CAAC;KAChD;IAED,OAAO,OAAO,CAAC,UAAqB,CAAC;AACvC,CAAC;AAED;;;;;AAKA,SAAS,oBAAoB,CAAC,OAAgB;IAC5C,IAAI,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEvC,OAAO,MAAM,IAAI,MAAM,KAAK,gBAAgB,EAAE;QAC5C,MAAM,EAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,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AAQ,EAAE;YAChD,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC;YACnB,KAAK,CAAC,KAAK,GAAG,GAAG,WAAW,GAAG,YAAY,CAAC,KAAK,IAAI,CAAC;YACtD,KAAK,CAAC,MAAM,GAAG,GAAG,YAAY,GAAG,YAAY,CAAC,MAAM,GAAG,cAAc,IAAI,CAAC;YAC1E,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC;YACpB,KAAK,CAAC,QAAQ,GAAG,GAAG,aAAa,IAAI,CAAC;YACtC,KAAK,CAAC,SAAS,GAAG,GAAG,YAAY,GAAG,YAAY,CAAC,MAAM,GAAG,YAAY,IAAI,CAAC;SAC5E;QAED,IAAI,CAAC,eAAe,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;KAClE;IAED,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;KACf;IAED,MAAM;QACJ,OAAO,8DAAa,CAAC;KACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"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: var(--color-surface01);\n --z-popover-theme--text: var(--color-text01);\n --z-popover-padding: 0;\n --z-popover-shadow-filter: drop-shadow(0 1px 2px var(--shadow-color-base));\n\n position: relative;\n display: none;\n min-width: calc(var(--space-unit) * 8);\n min-height: calc(var(--space-unit) * 4);\n align-items: center;\n justify-content: center;\n padding: var(--z-popover-padding);\n background: var(--z-popover-theme--surface);\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text);\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter);\n font-family: var(--font-family-sans);\n text-align: center;\n}\n\n:host([open][current-position]),\n:host([open=\"true\"][current-position]) {\n display: flex;\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);\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\n::slotted(*) {\n overflow: auto;\n flex: 1 auto;\n}\n","import {Component, Prop, h, Watch, Listen, Element, State, Event, EventEmitter} from \"@stencil/core\";\nimport {PopoverPosition, KeyboardCode} from \"../../beans\";\n\nconst DOCUMENT_ELEMENT = document.documentElement;\n\nfunction getParentElement(element: Element): ShadowRoot[\"host\"] {\n if ((element.parentNode as ShadowRoot).host) {\n return (element.parentNode as ShadowRoot).host;\n }\n\n return element.parentNode as Element;\n}\n\n/**\n * Find the closest scrollable parent of a node.\n *\n * @param {Element} element The node\n */\nfunction findScrollableParent(element: Element): Element {\n let parent = getParentElement(element);\n\n while (parent && parent !== DOCUMENT_ELEMENT) {\n const {overflow, overflowX, overflowY} = window.getComputedStyle(parent);\n if (overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\") {\n return parent;\n }\n\n if (\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\")\n ) {\n return parent;\n }\n\n parent = getParentElement(parent);\n }\n\n return DOCUMENT_ELEMENT;\n}\n\n/**\n * Calculate computed offset.\n * It includes matrix transformations.\n * @param element The target element.\n * @param targetParentOffset The relative offset parent.\n * @return A client rect object.\n */\nfunction computeOffset(element: HTMLElement, targetParentOffset?: HTMLElement): Record<string, number> {\n const rect = element.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n\n let top = 0;\n let left = 0;\n let offsetParent = element;\n while (offsetParent && offsetParent != targetParentOffset) {\n left += offsetParent.offsetLeft;\n\n // document.body sometimes has offsetTop == 0 but still has an\n // offset because of children margins!\n if (offsetParent === document.body) {\n top += offsetParent.getBoundingClientRect().top + window.scrollY;\n } else {\n top += offsetParent.offsetTop;\n }\n\n if (window.DOMMatrix) {\n const style = window.getComputedStyle(offsetParent);\n const transform = style.transform || style.webkitTransform;\n const domMatrix = new DOMMatrix(transform);\n if (domMatrix) {\n left += domMatrix.m41;\n if (offsetParent !== document.body) {\n top += domMatrix.m42;\n }\n }\n }\n\n if (!offsetParent.offsetParent) {\n break;\n }\n\n offsetParent = offsetParent.offsetParent as HTMLElement;\n }\n\n let parentWidth: number;\n let parentHeight: number;\n if (offsetParent === document.body) {\n parentWidth = window.innerWidth;\n parentHeight = window.innerHeight;\n } else {\n parentWidth = offsetParent.offsetWidth;\n parentHeight = offsetParent.offsetHeight;\n }\n\n const right = parentWidth - left - rect.width;\n const bottom = parentHeight - top - rect.height;\n\n return {top, right, bottom, left, width, height};\n}\n\n/**\n * Popover component.\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 /** Popover position. */\n @Prop({reflect: true})\n position: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * The open state of the popover.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /**\n * Whether to show popover's arrow.\n */\n @Prop({reflect: true})\n showArrow = false;\n\n /**\n * Whether to center the popup on the main side (according to \"position\").\n */\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 */\n @State()\n currentPosition?: PopoverPosition;\n\n /**\n * Position change event.\n */\n @Event()\n positionChange: EventEmitter;\n\n /**\n * Open change event.\n */\n @Event()\n openChange: EventEmitter;\n\n @Element() host: HTMLZPopoverElement;\n\n private animationFrameRequestId?: number;\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 * @param {MouseEvent} e\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n if (!this.closable || !this.open) {\n return;\n }\n\n if (!e.composedPath().includes(this.host)) {\n const target = e.target as HTMLElement;\n const triggerElemClicked =\n this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(CSS.escape(this.bindTo));\n if (triggerElemClicked) {\n e.stopPropagation();\n }\n\n this.open = false;\n this.positionChange.emit({position: this.currentPosition});\n }\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (newValue && !Object.values(PopoverPosition).includes(newValue as PopoverPosition)) {\n this.position = PopoverPosition.AUTO;\n }\n\n this.currentPosition = this.position;\n this.positionChange.emit({position: this.currentPosition});\n }\n\n /**\n * Setup popover behaviors on opening.\n */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n if (this.open) {\n const setPosition = (): void => {\n if (this.open) {\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(setPosition);\n }\n };\n\n setPosition();\n } else if (this.host.hasAttribute(\"current-position\")) {\n this.host.removeAttribute(\"current-position\");\n this.currentPosition = undefined;\n }\n\n this.openChange.emit({open: this.open});\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n /**\n * Set the position of the popover.\n */\n private setPosition(): void {\n let element: HTMLElement;\n if (typeof this.bindTo === \"string\") {\n element = this.host.ownerDocument.querySelector(CSS.escape(this.bindTo)) as HTMLElement;\n } else if (this.bindTo) {\n element = this.bindTo;\n } else {\n element = this.host.parentElement as HTMLElement;\n }\n\n if (!element) {\n return;\n }\n\n const scrollContainer = findScrollableParent(element) as HTMLElement;\n const scrollingBoundingRect = scrollContainer.getBoundingClientRect();\n const offsetContainer = this.host.offsetParent as HTMLElement;\n\n const relativeBoundingRect = offsetContainer\n ? computeOffset(offsetContainer, scrollContainer)\n : {top: 0, right: 0, bottom: 0, left: 0};\n const boundingRect = computeOffset(element, scrollContainer);\n\n const top = boundingRect.top - scrollContainer.scrollTop;\n const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;\n const left = boundingRect.left - scrollContainer.scrollLeft;\n const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;\n\n const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);\n const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);\n\n const availableTop = Math.min(top, top + scrollingBoundingRect.top);\n const availableBottom = Math.min(bottom, bottom - overflowBottom);\n const availableLeft = Math.min(left, left + scrollingBoundingRect.left);\n const availableRight = Math.min(right, right - overflowRight);\n\n const availableHeight = availableTop + availableBottom + boundingRect.height;\n const availableWidth = availableLeft + availableRight + boundingRect.width;\n\n let position = this.currentPosition;\n const positions: PopoverPosition[] = [];\n if (this.position === PopoverPosition.AUTO) {\n /**\n * The `AUTO` position tries to place the popover in the 'safest' area,\n * where there's more space available.\n */\n if (availableLeft / availableWidth > 0.6) {\n positions.push(PopoverPosition.LEFT);\n } else if (availableLeft / availableWidth < 0.4) {\n positions.push(PopoverPosition.RIGHT);\n }\n\n if (availableTop / availableHeight > 0.9) {\n positions.unshift(PopoverPosition.TOP);\n } else if (availableTop / availableHeight > 0.6) {\n positions.push(PopoverPosition.TOP);\n } else if (availableTop / availableHeight < 0.1) {\n positions.unshift(PopoverPosition.BOTTOM);\n } else {\n positions.push(PopoverPosition.BOTTOM);\n }\n\n position = positions.join(\"_\") as PopoverPosition;\n }\n\n const style = this.host.style;\n style.position = \"absolute\";\n\n const offsetTop = boundingRect.top - relativeBoundingRect.top;\n const offsetRight = boundingRect.right - relativeBoundingRect.right;\n const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;\n const offsetLeft = boundingRect.left - relativeBoundingRect.left;\n const offsetModifier = this.center ? 0.5 : 0;\n const sizeModifier = this.center ? 0.5 : 0;\n\n if (position === PopoverPosition.TOP || position === PopoverPosition.TOP_RIGHT) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableTop}px`;\n if (position === PopoverPosition.TOP_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.TOP_LEFT) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop}px`;\n } else if (position === PopoverPosition.BOTTOM || position === PopoverPosition.BOTTOM_RIGHT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableBottom}px`;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.BOTTOM_LEFT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom}px`;\n } else if (position === PopoverPosition.RIGHT || position === PopoverPosition.RIGHT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.RIGHT_TOP) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT || position === PopoverPosition.LEFT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT_TOP) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n }\n\n this.currentPosition = position || this.position;\n this.host.setAttribute(\"current-position\", this.currentPosition);\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n this.onOpen();\n }\n\n render(): HT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;IAED,MAAM;QACJ,OAAO,8DAAa,CAAC;KACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"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: var(--color-surface01);\n --z-popover-theme--text: var(--color-text01);\n --z-popover-padding: 0;\n --z-popover-shadow-filter: drop-shadow(0 1px 2px var(--shadow-color-base));\n\n position: relative;\n display: none;\n min-width: calc(var(--space-unit) * 8);\n min-height: calc(var(--space-unit) * 4);\n align-items: center;\n justify-content: center;\n padding: var(--z-popover-padding);\n background: var(--z-popover-theme--surface);\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text);\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter);\n font-family: var(--font-family-sans);\n text-align: center;\n}\n\n:host([open][current-position]),\n:host([open=\"true\"][current-position]) {\n display: flex;\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);\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\n::slotted(*) {\n overflow: auto;\n flex: 1 auto;\n}\n","import {Component, Prop, h, Watch, Listen, Element, State, Event, EventEmitter} from \"@stencil/core\";\nimport {PopoverPosition, KeyboardCode} from \"../../beans\";\n\nconst DOCUMENT_ELEMENT = document.documentElement;\n\nfunction getParentElement(element: Element): ShadowRoot[\"host\"] {\n if ((element.parentNode as ShadowRoot).host) {\n return (element.parentNode as ShadowRoot).host;\n }\n\n return element.parentNode as Element;\n}\n\n/**\n * Find the closest scrollable parent of a node.\n *\n * @param {Element} element The node\n */\nfunction findScrollableParent(element: Element): Element {\n let parent = getParentElement(element);\n\n while (parent && parent !== DOCUMENT_ELEMENT) {\n const {overflow, overflowX, overflowY} = window.getComputedStyle(parent);\n if (overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\") {\n return parent;\n }\n\n if (\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\")\n ) {\n return parent;\n }\n\n parent = getParentElement(parent);\n }\n\n return DOCUMENT_ELEMENT;\n}\n\n/**\n * Calculate computed offset.\n * It includes matrix transformations.\n * @param element The target element.\n * @param targetParentOffset The relative offset parent.\n * @return A client rect object.\n */\nfunction computeOffset(element: HTMLElement, targetParentOffset?: HTMLElement): Record<string, number> {\n const rect = element.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n\n let top = 0;\n let left = 0;\n let offsetParent = element;\n while (offsetParent && offsetParent != targetParentOffset) {\n left += offsetParent.offsetLeft;\n\n // document.body sometimes has offsetTop == 0 but still has an\n // offset because of children margins!\n if (offsetParent === document.body) {\n top += offsetParent.getBoundingClientRect().top + window.scrollY;\n } else {\n top += offsetParent.offsetTop;\n }\n\n if (window.DOMMatrix) {\n const style = window.getComputedStyle(offsetParent);\n const transform = style.transform || style.webkitTransform;\n const domMatrix = new DOMMatrix(transform);\n if (domMatrix) {\n left += domMatrix.m41;\n if (offsetParent !== document.body) {\n top += domMatrix.m42;\n }\n }\n }\n\n if (!offsetParent.offsetParent) {\n break;\n }\n\n offsetParent = offsetParent.offsetParent as HTMLElement;\n }\n\n let parentWidth: number;\n let parentHeight: number;\n if (offsetParent === document.body) {\n parentWidth = window.innerWidth;\n parentHeight = window.innerHeight;\n } else {\n parentWidth = offsetParent.offsetWidth;\n parentHeight = offsetParent.offsetHeight;\n }\n\n const right = parentWidth - left - rect.width;\n const bottom = parentHeight - top - rect.height;\n\n return {top, right, bottom, left, width, height};\n}\n\n/**\n * Popover component.\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 /** Popover position. */\n @Prop({reflect: true})\n position: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * The open state of the popover.\n */\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 /**\n * Whether to show popover's arrow.\n */\n @Prop({reflect: true})\n showArrow = false;\n\n /**\n * Whether to center the popup on the main side (according to \"position\").\n */\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 */\n @State()\n currentPosition?: PopoverPosition;\n\n /**\n * Position change event.\n */\n @Event()\n positionChange: EventEmitter;\n\n /**\n * Open change event.\n */\n @Event()\n openChange: EventEmitter;\n\n @Element() host: HTMLZPopoverElement;\n\n private animationFrameRequestId?: number;\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 * @param {MouseEvent} e\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n if (!this.closable || !this.open) {\n return;\n }\n\n if (!e.composedPath().includes(this.host)) {\n const target = e.target as HTMLElement;\n const triggerElemClicked =\n this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(this.bindTo);\n if (triggerElemClicked) {\n e.stopPropagation();\n }\n\n this.open = false;\n this.positionChange.emit({position: this.currentPosition});\n }\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (newValue && !Object.values(PopoverPosition).includes(newValue as PopoverPosition)) {\n this.position = PopoverPosition.AUTO;\n }\n\n this.currentPosition = this.position;\n this.positionChange.emit({position: this.currentPosition});\n }\n\n /**\n * Setup popover behaviors on opening.\n */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n if (this.open) {\n const setPosition = (): void => {\n if (this.open) {\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(setPosition);\n }\n };\n\n setPosition();\n } else if (this.host.hasAttribute(\"current-position\")) {\n this.host.removeAttribute(\"current-position\");\n this.currentPosition = undefined;\n }\n\n this.openChange.emit({open: this.open});\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n /**\n * Set the position of the popover.\n */\n private setPosition(): void {\n let element: HTMLElement;\n if (typeof this.bindTo === \"string\") {\n element = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n element = this.bindTo;\n } else {\n element = this.host.parentElement as HTMLElement;\n }\n\n if (!element) {\n return;\n }\n\n const scrollContainer = findScrollableParent(element) as HTMLElement;\n const scrollingBoundingRect = scrollContainer.getBoundingClientRect();\n const offsetContainer = this.host.offsetParent as HTMLElement;\n\n const relativeBoundingRect = offsetContainer\n ? computeOffset(offsetContainer, scrollContainer)\n : {top: 0, right: 0, bottom: 0, left: 0};\n const boundingRect = computeOffset(element, scrollContainer);\n\n const top = boundingRect.top - scrollContainer.scrollTop;\n const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;\n const left = boundingRect.left - scrollContainer.scrollLeft;\n const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;\n\n const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);\n const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);\n\n const availableTop = Math.min(top, top + scrollingBoundingRect.top);\n const availableBottom = Math.min(bottom, bottom - overflowBottom);\n const availableLeft = Math.min(left, left + scrollingBoundingRect.left);\n const availableRight = Math.min(right, right - overflowRight);\n\n const availableHeight = availableTop + availableBottom + boundingRect.height;\n const availableWidth = availableLeft + availableRight + boundingRect.width;\n\n let position = this.currentPosition;\n const positions: PopoverPosition[] = [];\n if (this.position === PopoverPosition.AUTO) {\n /**\n * The `AUTO` position tries to place the popover in the 'safest' area,\n * where there's more space available.\n */\n if (availableLeft / availableWidth > 0.6) {\n positions.push(PopoverPosition.LEFT);\n } else if (availableLeft / availableWidth < 0.4) {\n positions.push(PopoverPosition.RIGHT);\n }\n\n if (availableTop / availableHeight > 0.9) {\n positions.unshift(PopoverPosition.TOP);\n } else if (availableTop / availableHeight > 0.6) {\n positions.push(PopoverPosition.TOP);\n } else if (availableTop / availableHeight < 0.1) {\n positions.unshift(PopoverPosition.BOTTOM);\n } else {\n positions.push(PopoverPosition.BOTTOM);\n }\n\n position = positions.join(\"_\") as PopoverPosition;\n }\n\n const style = this.host.style;\n style.position = \"absolute\";\n\n const offsetTop = boundingRect.top - relativeBoundingRect.top;\n const offsetRight = boundingRect.right - relativeBoundingRect.right;\n const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;\n const offsetLeft = boundingRect.left - relativeBoundingRect.left;\n const offsetModifier = this.center ? 0.5 : 0;\n const sizeModifier = this.center ? 0.5 : 0;\n\n if (position === PopoverPosition.TOP || position === PopoverPosition.TOP_RIGHT) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableTop}px`;\n if (position === PopoverPosition.TOP_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.TOP_LEFT) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop}px`;\n } else if (position === PopoverPosition.BOTTOM || position === PopoverPosition.BOTTOM_RIGHT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableBottom}px`;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.BOTTOM_LEFT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom}px`;\n } else if (position === PopoverPosition.RIGHT || position === PopoverPosition.RIGHT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.RIGHT_TOP) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT || position === PopoverPosition.LEFT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT_TOP) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n }\n\n this.currentPosition = position || this.position;\n this.host.setAttribute(\"current-position\", this.currentPosition);\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n this.onOpen();\n }\n\n render(): HTMLSlotElement {\n return <slot></slot>;\n }\n}\n"],"version":3}
@@ -4,7 +4,7 @@ import { d as defineCustomElement$4 } from './index4.js';
4
4
  import { d as defineCustomElement$3 } from './index8.js';
5
5
  import { d as defineCustomElement$2 } from './index9.js';
6
6
 
7
- const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg);--z-carousel-gutter:0}:host([single]){display:flex;flex-direction:column;align-items:center;justify-content:center}:host([single]) .z-carousel-container{width:fit-content;max-width:100%}.z-carousel-container{display:flex;flex-direction:column}.z-carousel-title{margin-bottom:calc(var(--space-unit) * 2)}.z-carousel-wrapper{position:relative}.z-carousel-items-container{display:flex;max-width:100%;flex-direction:row;margin:0;column-gap:var(--z-carousel-gutter);list-style:none;-ms-overflow-style:none;overflow-x:scroll;padding-inline-start:0;scroll-behavior:smooth;scroll-snap-type:x mandatory;scrollbar-width:none;}.z-carousel-items-container::-webkit-scrollbar{display:none}.z-carousel-items-container ::slotted(*){scroll-snap-align:center}.z-carousel-navigation-arrow[hidden]{display:none}.z-carousel-navigation-arrow[data-direction]{position:absolute;bottom:50%;transform:translateY(50%)}.z-carousel-navigation-arrow[data-direction=\"next\"]{right:0}:host(:not([fixed-arrows])) .z-carousel-wrapper .z-carousel-navigation-arrow{display:none}.z-carousel-footer{display:flex;flex-direction:row;align-items:center;justify-content:center;column-gap:calc(var(--space-unit) * 3)}:host([arrows-position=\"bottom\"]) .z-carousel-footer{margin-top:calc(var(--space-unit) * 0.75)}.z-carousel-footer .numbers-progress,.z-carousel-footer .dots-progress{display:flex;align-items:center;justify-content:center}.z-carousel-footer .dots-progress{column-gap:calc(var(--space-unit) * 3)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .dots-progress{margin-top:calc(var(--space-unit) * 2)}.z-carousel-footer .dots-progress button{display:flex;width:calc(var(--space-unit) * 3);height:calc(var(--space-unit) * 3);align-items:center;padding:0;border:none;margin:0;background-color:var(--color-surface03);border-radius:calc(var(--space-unit) * 3)}.z-carousel-footer .dots-progress button.current{background-color:var(--color-primary01)}.z-carousel-footer .dots-progress button:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-carousel-footer .dots-progress button:not(.current){cursor:pointer}.z-carousel-footer .numbers-progress{column-gap:calc(var(--space-unit) / 2)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .numbers-progress{margin-top:var(--space-unit)}.z-carousel-footer .numbers-progress .current{font-weight:var(--font-sb)}@media (min-width: 768px){:host(:not([fixed-arrows])) .z-carousel-wrapper:hover .z-carousel-navigation-arrow:not([hidden]){display:flex}}";
7
+ const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg);--z-carousel-gutter:0}:host([single]){display:flex;flex-direction:column;align-items:center;justify-content:center}:host([single]) .z-carousel-container{width:fit-content;max-width:100%}.z-carousel-container{display:flex;flex-direction:column}.z-carousel-title{margin-bottom:calc(var(--space-unit) * 2)}.z-carousel-wrapper{position:relative}.z-carousel-items-container{display:flex;max-width:100%;flex-direction:row;margin:0;column-gap:var(--z-carousel-gutter);list-style:none;-ms-overflow-style:none;overflow-x:scroll;padding-inline-start:0;scroll-behavior:smooth;scroll-snap-type:x mandatory;scrollbar-width:none;}.z-carousel-items-container::-webkit-scrollbar{display:none}.z-carousel-items-container ::slotted(*){scroll-snap-align:center}.z-carousel-navigation-arrow[hidden]{display:none}.z-carousel-navigation-arrow[data-direction]{position:absolute;z-index:1;bottom:50%;transform:translateY(50%)}.z-carousel-navigation-arrow[data-direction=\"next\"]{right:0}:host(:not([fixed-arrows])) .z-carousel-wrapper .z-carousel-navigation-arrow{display:none}.z-carousel-footer{display:flex;flex-direction:row;align-items:center;justify-content:center;column-gap:calc(var(--space-unit) * 3)}:host([arrows-position=\"bottom\"]) .z-carousel-footer{margin-top:calc(var(--space-unit) * 0.75)}.z-carousel-footer .numbers-progress,.z-carousel-footer .dots-progress{display:flex;align-items:center;justify-content:center}.z-carousel-footer .dots-progress{column-gap:calc(var(--space-unit) * 3)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .dots-progress{margin-top:calc(var(--space-unit) * 2)}.z-carousel-footer .dots-progress button{display:flex;width:calc(var(--space-unit) * 3);height:calc(var(--space-unit) * 3);align-items:center;padding:0;border:none;margin:0;background-color:var(--color-surface03);border-radius:calc(var(--space-unit) * 3)}.z-carousel-footer .dots-progress button.current{background-color:var(--color-primary01)}.z-carousel-footer .dots-progress button:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-carousel-footer .dots-progress button:not(.current){cursor:pointer}.z-carousel-footer .numbers-progress{column-gap:calc(var(--space-unit) / 2)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .numbers-progress{margin-top:var(--space-unit)}.z-carousel-footer .numbers-progress .current{font-weight:var(--font-sb)}@media (min-width: 768px){:host(:not([fixed-arrows])) .z-carousel-wrapper:hover .z-carousel-navigation-arrow:not([hidden]){display:flex}}";
8
8
  const ZCarouselStyle0 = stylesCss;
9
9
 
10
10
  const ZCarousel$1 = /*@__PURE__*/ proxyCustomElement(class ZCarousel extends HTMLElement {
@@ -152,7 +152,8 @@ const ZCarousel$1 = /*@__PURE__*/ proxyCustomElement(class ZCarousel extends HTM
152
152
  });
153
153
  }
154
154
  componentDidLoad() {
155
- this.itemsContainer.addEventListener("scroll", this.checkNavigationValidity.bind(this), { passive: true });
155
+ var _a;
156
+ (_a = this.itemsContainer) === null || _a === void 0 ? void 0 : _a.addEventListener("scroll", this.checkNavigationValidity.bind(this), { passive: true });
156
157
  this.resizeObserver = new ResizeObserver(this.checkNavigationValidity.bind(this));
157
158
  this.resizeObserver.observe(this.itemsContainer);
158
159
  this.setupItems();
@@ -1 +1 @@
1
- {"file":"z-carousel.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,mhFAAmhF,CAAC;AACtiF,wBAAe,SAAS;;MCYXA,WAAS;;;;;;;QAmEZ,gBAAW,GAAW,IAAI,CAAC;;;sBAtD1B,KAAK;;;2BAgBA,IAAI;kCAIG,GAAG;wBAIb,KAAK;uBAIN,CAAC;;;;;;IAiCX,aAAa;QACX,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC,CAAC;KACpD;IAGD,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC7C,IAAI,CAAC,uBAAuB,EAAE,CAAC;SAChC;KACF;IAGD,oBAAoB;QAClB,IAAI,CAAC,uBAAuB,EAAE,CAAC;KAChC;;;;;;IAOO,uBAAuB;QAC7B,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAClD,CAAC,OAAO;YACN,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAC,cAAc,EAAC,KAAK,cAAc,CAAC,CAAC;YACjE,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO;aACR;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC;Y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;;;;;;;;;;;;;;;;;;;;","names":["ZCarousel"],"sources":["src/components/z-carousel/styles.css?tag=z-carousel&encapsulation=shadow","src/components/z-carousel/index.tsx"],"sourcesContent":[":host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n\n --z-carousel-gutter: 0;\n}\n\n:host([single]) {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n:host([single]) .z-carousel-container {\n width: fit-content;\n max-width: 100%;\n}\n\n.z-carousel-container {\n display: flex;\n flex-direction: column;\n}\n\n.z-carousel-title {\n margin-bottom: calc(var(--space-unit) * 2);\n}\n\n.z-carousel-wrapper {\n position: relative;\n}\n\n.z-carousel-items-container {\n display: flex;\n max-width: 100%;\n flex-direction: row;\n margin: 0;\n column-gap: var(--z-carousel-gutter);\n list-style: none;\n -ms-overflow-style: none; /* IE and Edge */\n overflow-x: scroll;\n padding-inline-start: 0;\n scroll-behavior: smooth;\n scroll-snap-type: x mandatory;\n\n /* Hide scrollbar for IE, Edge and Firefox */\n scrollbar-width: none; /* Firefox */\n}\n\n/* Hide scrollbar for Chrome, Safari and Opera */\n.z-carousel-items-container::-webkit-scrollbar {\n display: none;\n}\n\n.z-carousel-items-container ::slotted(*) {\n scroll-snap-align: center;\n}\n\n.z-carousel-navigation-arrow[hidden] {\n display: none;\n}\n\n.z-carousel-navigation-arrow[data-direction] {\n position: absolute;\n bottom: 50%;\n transform: translateY(50%);\n}\n\n.z-carousel-navigation-arrow[data-direction=\"next\"] {\n right: 0;\n}\n\n:host(:not([fixed-arrows])) .z-carousel-wrapper .z-carousel-navigation-arrow {\n display: none;\n}\n\n.z-carousel-footer {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n column-gap: calc(var(--space-unit) * 3);\n}\n\n:host([arrows-position=\"bottom\"]) .z-carousel-footer {\n margin-top: calc(var(--space-unit) * 0.75);\n}\n\n.z-carousel-footer .numbers-progress,\n.z-carousel-footer .dots-progress {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.z-carousel-footer .dots-progress {\n column-gap: calc(var(--space-unit) * 3);\n}\n\n:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .dots-progress {\n margin-top: calc(var(--space-unit) * 2);\n}\n\n.z-carousel-footer .dots-progress button {\n display: flex;\n width: calc(var(--space-unit) * 3);\n height: calc(var(--space-unit) * 3);\n align-items: center;\n padding: 0;\n border: none;\n margin: 0;\n background-color: var(--color-surface03);\n border-radius: calc(var(--space-unit) * 3);\n}\n\n.z-carousel-footer .dots-progress button.current {\n background-color: var(--color-primary01);\n}\n\n.z-carousel-footer .dots-progress button:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-carousel-footer .dots-progress button:not(.current) {\n cursor: pointer;\n}\n\n.z-carousel-footer .numbers-progress {\n column-gap: calc(var(--space-unit) / 2);\n}\n\n:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .numbers-progress {\n margin-top: var(--space-unit);\n}\n\n.z-carousel-footer .numbers-progress .current {\n font-weight: var(--font-sb);\n}\n\n@media (min-width: 768px) {\n :host(:not([fixed-arrows])) .z-carousel-wrapper:hover .z-carousel-navigation-arrow:not([hidden]) {\n display: flex;\n }\n}\n","import {Component, h, Prop, Element, Watch, Event, EventEmitter, State, Host} from \"@stencil/core\";\nimport {CarouselArrowsPosition, CarouselProgressMode, ButtonVariant} from \"../../beans\";\n\n/**\n * ZCarousel component.\n * @cssprop --z-carousel-gutter - The gutter between items.\n * @slot - Carousel items. Use `<li>` elements inside this slot.\n */\n@Component({\n tag: \"z-carousel\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZCarousel {\n @Element() host: HTMLZCarouselElement;\n\n /** The z-carousel is on loading state */\n @Prop()\n isLoading: boolean;\n\n /** The z-carousel title */\n @Prop()\n label?: string;\n\n /** Shows only one content at a time */\n @Prop({reflect: true})\n single = false;\n\n /** Arrow buttons position */\n @Prop({reflect: true})\n arrowsPosition?: CarouselArrowsPosition;\n\n /** Progress indicator type. Only available for `single` mode */\n @Prop()\n progressMode?: CarouselProgressMode;\n\n /**\n * Whether the navigation arrow buttons over the items are always visible or only on mouse hover.\n * If set to `false`, the arrows will not be visible on mobile.\n * Only meaningful with `arrowsPosition` set to `OVER`.\n */\n @Prop({reflect: true})\n fixedArrows = true;\n\n /** The height of the ghost loader (only visible when `isLoading` is set to `true`) */\n @Prop()\n ghostLoadingHeight = 100;\n\n /** When enabled, navigating next the last item will go back to the first item and vice versa. */\n @Prop()\n infinite = false;\n\n /** Current item index for single mode. */\n @State()\n current = 0;\n\n /** Items on the slider. */\n @State()\n items: HTMLLIElement[];\n\n /** Index of the indicator to highlight. */\n @State()\n highlightedIndicator: number;\n\n @State()\n canNavigatePrev: boolean;\n\n @State()\n canNavigateNext: boolean;\n\n /** Reference for the items container element. */\n protected itemsContainer: HTMLUListElement;\n\n /** Observer that handles current index change when scrolling on single mode. */\n private intersectionObserver: IntersectionObserver;\n\n /** Observer to check if navigation can still be enabled/showed when the size of the items' container changes */\n private resizeObserver: ResizeObserver;\n\n /** Flag indicating the items container is about to scroll programmatically towards the stored index. */\n private scrollingTo: number = null;\n\n /** Emitted on index change and only in `single` mode. */\n @Event()\n indexChange: EventEmitter<{currentItem: number}>;\n\n @Watch(\"current\")\n onIndexChange(): void {\n this.indexChange.emit({currentItem: this.current});\n }\n\n @Watch(\"single\")\n onSingleModeChange(): void {\n if (this.single && !this.intersectionObserver) {\n this.setIntersectionObserver();\n }\n }\n\n @Watch(\"infinite\")\n onInfiniteModeChange(): void {\n this.checkNavigationValidity();\n }\n\n /**\n * Set an intersection observer to:\n * - highlight the indicator of the intersecting item during scroll\n * - set the current item to the last intersecting item\n */\n private setIntersectionObserver(): void {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n const entry = entries.find(({isIntersecting}) => isIntersecting);\n if (!entry) {\n return;\n }\n\n const entryIndex = this.items.findIndex((item) => item === entry.target);\n this.highlightedIndicator = entryIndex;\n\n /* skip setting the current item if intersection has been triggered by a programmatic scroll\n (@see `goTo` function) and the final index has not been reached */\n if (this.scrollingTo !== null && entryIndex !== this.scrollingTo) {\n return;\n }\n\n this.scrollingTo = null;\n this.current = entryIndex;\n },\n {\n root: this.itemsContainer,\n threshold: 0.5,\n }\n );\n\n this.items.forEach((element) => this.intersectionObserver.observe(element));\n }\n\n /** Update items' list and check conditions to allow navigation */\n private onSlotChange(): void {\n this.items = Array.from(this.host.children) as HTMLLIElement[];\n this.checkNavigationValidity();\n this.setIntersectionObserver();\n this.goTo(this.current);\n }\n\n private onPrev(): void {\n if (this.single) {\n this.goTo(this.infinite && this.current - 1 < 0 ? this.items.length - 1 : Math.max(0, this.current - 1));\n\n return;\n }\n\n this.itemsContainer.scrollBy({\n left:\n this.infinite && this.itemsContainer.scrollLeft == 0\n ? this.itemsContainer.scrollWidth - this.itemsContainer.clientWidth\n : -this.itemsContainer.clientWidth / 2,\n behavior: \"smooth\",\n });\n }\n\n private onNext(): void {\n if (this.single) {\n const next =\n this.infinite && this.current + 1 > this.items.length - 1\n ? 0\n : Math.min(this.current + 1, this.items.length - 1);\n\n return this.goTo(next);\n }\n\n this.itemsContainer.scrollBy({\n left:\n this.infinite &&\n this.itemsContainer.scrollLeft == this.itemsContainer.scrollWidth - this.itemsContainer.clientWidth\n ? -this.itemsContainer.scrollWidth\n : this.itemsContainer.clientWidth / 2,\n behavior: \"smooth\",\n });\n }\n\n /**\n * Check if navigation buttons can be enabled and set the related local states.\n */\n private checkNavigationValidity(): void {\n if (this.single) {\n this.canNavigatePrev = this.current > 0;\n this.canNavigateNext = this.current < this.items.length - 1;\n\n return;\n }\n\n this.canNavigatePrev = this.itemsContainer.scrollLeft > 0;\n this.canNavigateNext =\n this.itemsContainer.scrollLeft < this.itemsContainer.scrollWidth - this.itemsContainer.clientWidth;\n }\n\n /**\n * Check if footer has to be rendered.\n */\n private canShowFooter(): boolean {\n if (!this.canNavigatePrev && !this.canNavigateNext) {\n return false;\n }\n\n return (\n this.arrowsPosition === CarouselArrowsPosition.BOTTOM ||\n this.progressMode === CarouselProgressMode.DOTS ||\n this.progressMode === CarouselProgressMode.NUMBERS\n );\n }\n\n /**\n * Set current item to passed index.\n * @param index Index to set\n */\n private goTo(index: number): void {\n if (this.current === index) {\n return;\n }\n\n this.scrollingTo = index;\n const left = this.items.slice(0, index).reduce((acc, item) => (acc += item.clientWidth), 0);\n // the scroll will trigger the IntersectionObserver and set the current item\n this.itemsContainer.scroll({\n left,\n behavior: \"smooth\",\n });\n }\n\n /** Check if navigation of at least one direction is enabled */\n private get canNavigate(): boolean {\n return this.canNavigatePrev || this.canNavigateNext;\n }\n\n private setupItems(): void {\n this.items = Array.from(this.host.children) as HTMLLIElement[];\n this.items.forEach((item) => {\n item.setAttribute(\"role\", \"group\");\n item.setAttribute(\"aria-roledescription\", \"slide\");\n });\n }\n\n componentDidLoad(): void {\n this.itemsContainer.addEventListener(\"scroll\", this.checkNavigationValidity.bind(this), {passive: true});\n this.resizeObserver = new ResizeObserver(this.checkNavigationValidity.bind(this));\n this.resizeObserver.observe(this.itemsContainer);\n this.setupItems();\n if (this.single) {\n this.setIntersectionObserver();\n }\n this.checkNavigationValidity();\n }\n\n disconnectedCallback(): void {\n this.resizeObserver?.disconnect();\n }\n\n render(): HTMLDivElement | HTMLZCarouselElement {\n if (this.isLoading) {\n return (\n <div class=\"z-carousel-container\">\n {this.label && <div class=\"heading-3-sb z-carousel-title\">{this.label}</div>}\n <div style={{height: `${this.ghostLoadingHeight}px`}}>\n <z-ghost-loading></z-ghost-loading>\n </div>\n </div>\n );\n }\n\n return (\n <Host>\n <div\n class=\"z-carousel-container\"\n role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label={this.label || \"Carousel\"}\n >\n {this.label && <div class=\"z-carousel-title heading-3-sb\">{this.label}</div>}\n <div class=\"z-carousel-wrapper\">\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.SECONDARY}\n data-direction=\"prev\"\n icon=\"arrow-left\"\n onClick={this.onPrev.bind(this)}\n disabled={!this.infinite && !this.canNavigatePrev}\n hidden={this.arrowsPosition !== CarouselArrowsPosition.OVER || !this.canNavigate}\n ariaLabel={this.single ? \"Mostra l'elemento precedente\" : \"Mostra gli elementi precedenti\"}\n />\n <ul\n class=\"z-carousel-items-container\"\n aria-atomic=\"false\"\n aria-live=\"polite\"\n ref={(el) => (this.itemsContainer = el)}\n >\n <slot onSlotchange={this.onSlotChange.bind(this)} />\n </ul>\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.SECONDARY}\n data-direction=\"next\"\n icon=\"arrow-right\"\n onClick={this.onNext.bind(this)}\n disabled={!this.infinite && !this.canNavigateNext}\n hidden={this.arrowsPosition !== CarouselArrowsPosition.OVER || !this.canNavigate}\n ariaLabel={this.single ? \"Mostra l'elemento successivo\" : \"Mostra gli elementi successivi\"}\n />\n </div>\n </div>\n\n {this.canShowFooter() && (\n <div class=\"z-carousel-footer\">\n {this.arrowsPosition === CarouselArrowsPosition.BOTTOM && (\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.TERTIARY}\n icon=\"arrow-left\"\n onClick={this.onPrev.bind(this)}\n disabled={!this.infinite && !this.canNavigatePrev}\n ariaLabel={this.single ? \"Mostra l'elemento precedente\" : \"Mostra gli elementi precedenti\"}\n />\n )}\n {this.progressMode === CarouselProgressMode.DOTS && this.single && this.items && (\n <div class=\"dots-progress\">\n {this.items.map((_, index) => (\n <button\n type=\"button\"\n class={{current: this.highlightedIndicator === index}}\n aria-label={\n this.highlightedIndicator === index ? \"Elemento corrente\" : `Spostati all'elemento ${index + 1}`\n }\n onClick={() => this.goTo(index)}\n />\n ))}\n </div>\n )}\n {this.progressMode === CarouselProgressMode.NUMBERS && this.single && this.items && (\n <div class=\"numbers-progress interactive-1\">\n <span class=\"current\">{this.current + 1}</span>\n <span>di</span>\n <span>{this.items.length}</span>\n </div>\n )}\n {this.arrowsPosition === CarouselArrowsPosition.BOTTOM && (\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.TERTIARY}\n icon=\"arrow-right\"\n onClick={this.onNext.bind(this)}\n disabled={!this.infinite && !this.canNavigateNext}\n ariaLabel={this.single ? \"Mostra l'elemento successivo\" : \"Mostra gli elementi successivi\"}\n />\n )}\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"z-carousel.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,6hFAA6hF,CAAC;AAChjF,wBAAe,SAAS;;MCYXA,WAAS;;;;;;;QAmEZ,gBAAW,GAAW,IAAI,CAAC;;;sBAtD1B,KAAK;;;2BAgBA,IAAI;kCAIG,GAAG;wBAIb,KAAK;uBAIN,CAAC;;;;;;IAiCX,aAAa;QACX,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC,CAAC;KACpD;IAGD,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC7C,IAAI,CAAC,uBAAuB,EAAE,CAAC;SAChC;KACF;IAGD,oBAAoB;QAClB,IAAI,CAAC,uBAAuB,EAAE,CAAC;KAChC;;;;;;IAOO,uBAAuB;QAC7B,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAClD,CAAC,OAAO;YACN,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAC,cAAc,EAAC,KAAK,cAAc,CAAC,CAAC;YACjE,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO;aACR;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC;YACzE,IAAI,CAAC,oBAAoB,GAAG,UAAU,CAAC;;;YAIvC,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,IAAI,UAAU,KAAK,IAAI,CAAC,WAAW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,IAAI,CAAC,KAAK,KAC3E,WAAK,KAAK,EAAC,eAAe,IACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MACvB,cACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,EAAC,OAAO,EAAE,IAAI,CAAC,oBAAoB,KAAK,KAAK,EAAC,gBAEnD,IAAI,CAAC,oBAAoB,KAAK,KAAK,GAAG,mBAAmB,GAAG,yBAAyB,KAAK,GAAG,CAAC,EAAE,EAElG,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAC/B,CACH,CAAC,CACE,CACP,EACA,IAAI,CAAC,YAAY,KAAK,oBAAoB,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,KAC9E,WAAK,KAAK,EAAC,gCAAgC,IACzC,YAAM,KAAK,EAAC,SAAS,IAAE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAQ,EAC/C,qBAAe,EACf,gBAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAQ,CAC5B,CACP,EACA,IAAI,CAAC,cAAc,KAAK,sBAAsB,CAAC,MAAM,KACpD,gBACE,KAAK,EAAC,6BAA6B,EACnC,OAAO,EAAE,aAAa,CAAC,QAAQ,EAC/B,IAAI,EAAC,aAAa,EAClB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,eAAe,EACjD,SAAS,EAAE,IAAI,CAAC,MAAM,GAAG,8BAA8B,GAAG,gCAAgC,GAC1F,CACH,CACG,CACP,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZCarousel"],"sources":["src/components/z-carousel/styles.css?tag=z-carousel&encapsulation=shadow","src/components/z-carousel/index.tsx"],"sourcesContent":[":host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n\n --z-carousel-gutter: 0;\n}\n\n:host([single]) {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n:host([single]) .z-carousel-container {\n width: fit-content;\n max-width: 100%;\n}\n\n.z-carousel-container {\n display: flex;\n flex-direction: column;\n}\n\n.z-carousel-title {\n margin-bottom: calc(var(--space-unit) * 2);\n}\n\n.z-carousel-wrapper {\n position: relative;\n}\n\n.z-carousel-items-container {\n display: flex;\n max-width: 100%;\n flex-direction: row;\n margin: 0;\n column-gap: var(--z-carousel-gutter);\n list-style: none;\n -ms-overflow-style: none; /* IE and Edge */\n overflow-x: scroll;\n padding-inline-start: 0;\n scroll-behavior: smooth;\n scroll-snap-type: x mandatory;\n\n /* Hide scrollbar for IE, Edge and Firefox */\n scrollbar-width: none; /* Firefox */\n}\n\n/* Hide scrollbar for Chrome, Safari and Opera */\n.z-carousel-items-container::-webkit-scrollbar {\n display: none;\n}\n\n.z-carousel-items-container ::slotted(*) {\n scroll-snap-align: center;\n}\n\n.z-carousel-navigation-arrow[hidden] {\n display: none;\n}\n\n.z-carousel-navigation-arrow[data-direction] {\n position: absolute;\n z-index: 1;\n bottom: 50%;\n transform: translateY(50%);\n}\n\n.z-carousel-navigation-arrow[data-direction=\"next\"] {\n right: 0;\n}\n\n:host(:not([fixed-arrows])) .z-carousel-wrapper .z-carousel-navigation-arrow {\n display: none;\n}\n\n.z-carousel-footer {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n column-gap: calc(var(--space-unit) * 3);\n}\n\n:host([arrows-position=\"bottom\"]) .z-carousel-footer {\n margin-top: calc(var(--space-unit) * 0.75);\n}\n\n.z-carousel-footer .numbers-progress,\n.z-carousel-footer .dots-progress {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.z-carousel-footer .dots-progress {\n column-gap: calc(var(--space-unit) * 3);\n}\n\n:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .dots-progress {\n margin-top: calc(var(--space-unit) * 2);\n}\n\n.z-carousel-footer .dots-progress button {\n display: flex;\n width: calc(var(--space-unit) * 3);\n height: calc(var(--space-unit) * 3);\n align-items: center;\n padding: 0;\n border: none;\n margin: 0;\n background-color: var(--color-surface03);\n border-radius: calc(var(--space-unit) * 3);\n}\n\n.z-carousel-footer .dots-progress button.current {\n background-color: var(--color-primary01);\n}\n\n.z-carousel-footer .dots-progress button:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-carousel-footer .dots-progress button:not(.current) {\n cursor: pointer;\n}\n\n.z-carousel-footer .numbers-progress {\n column-gap: calc(var(--space-unit) / 2);\n}\n\n:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .numbers-progress {\n margin-top: var(--space-unit);\n}\n\n.z-carousel-footer .numbers-progress .current {\n font-weight: var(--font-sb);\n}\n\n@media (min-width: 768px) {\n :host(:not([fixed-arrows])) .z-carousel-wrapper:hover .z-carousel-navigation-arrow:not([hidden]) {\n display: flex;\n }\n}\n","import {Component, h, Prop, Element, Watch, Event, EventEmitter, State, Host} from \"@stencil/core\";\nimport {CarouselArrowsPosition, CarouselProgressMode, ButtonVariant} from \"../../beans\";\n\n/**\n * ZCarousel component.\n * @cssprop --z-carousel-gutter - The gutter between items.\n * @slot - Carousel items. Use `<li>` elements inside this slot.\n */\n@Component({\n tag: \"z-carousel\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZCarousel {\n @Element() host: HTMLZCarouselElement;\n\n /** The z-carousel is on loading state */\n @Prop()\n isLoading: boolean;\n\n /** The z-carousel title */\n @Prop()\n label?: string;\n\n /** Shows only one content at a time */\n @Prop({reflect: true})\n single = false;\n\n /** Arrow buttons position */\n @Prop({reflect: true})\n arrowsPosition?: CarouselArrowsPosition;\n\n /** Progress indicator type. Only available for `single` mode */\n @Prop()\n progressMode?: CarouselProgressMode;\n\n /**\n * Whether the navigation arrow buttons over the items are always visible or only on mouse hover.\n * If set to `false`, the arrows will not be visible on mobile.\n * Only meaningful with `arrowsPosition` set to `OVER`.\n */\n @Prop({reflect: true})\n fixedArrows = true;\n\n /** The height of the ghost loader (only visible when `isLoading` is set to `true`) */\n @Prop()\n ghostLoadingHeight = 100;\n\n /** When enabled, navigating next the last item will go back to the first item and vice versa. */\n @Prop()\n infinite = false;\n\n /** Current item index for single mode. */\n @State()\n current = 0;\n\n /** Items on the slider. */\n @State()\n items: HTMLLIElement[];\n\n /** Index of the indicator to highlight. */\n @State()\n highlightedIndicator: number;\n\n @State()\n canNavigatePrev: boolean;\n\n @State()\n canNavigateNext: boolean;\n\n /** Reference for the items container element. */\n protected itemsContainer: HTMLUListElement;\n\n /** Observer that handles current index change when scrolling on single mode. */\n private intersectionObserver: IntersectionObserver;\n\n /** Observer to check if navigation can still be enabled/showed when the size of the items' container changes */\n private resizeObserver: ResizeObserver;\n\n /** Flag indicating the items container is about to scroll programmatically towards the stored index. */\n private scrollingTo: number = null;\n\n /** Emitted on index change and only in `single` mode. */\n @Event()\n indexChange: EventEmitter<{currentItem: number}>;\n\n @Watch(\"current\")\n onIndexChange(): void {\n this.indexChange.emit({currentItem: this.current});\n }\n\n @Watch(\"single\")\n onSingleModeChange(): void {\n if (this.single && !this.intersectionObserver) {\n this.setIntersectionObserver();\n }\n }\n\n @Watch(\"infinite\")\n onInfiniteModeChange(): void {\n this.checkNavigationValidity();\n }\n\n /**\n * Set an intersection observer to:\n * - highlight the indicator of the intersecting item during scroll\n * - set the current item to the last intersecting item\n */\n private setIntersectionObserver(): void {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n const entry = entries.find(({isIntersecting}) => isIntersecting);\n if (!entry) {\n return;\n }\n\n const entryIndex = this.items.findIndex((item) => item === entry.target);\n this.highlightedIndicator = entryIndex;\n\n /* skip setting the current item if intersection has been triggered by a programmatic scroll\n (@see `goTo` function) and the final index has not been reached */\n if (this.scrollingTo !== null && entryIndex !== this.scrollingTo) {\n return;\n }\n\n this.scrollingTo = null;\n this.current = entryIndex;\n },\n {\n root: this.itemsContainer,\n threshold: 0.5,\n }\n );\n\n this.items.forEach((element) => this.intersectionObserver.observe(element));\n }\n\n /** Update items' list and check conditions to allow navigation */\n private onSlotChange(): void {\n this.items = Array.from(this.host.children) as HTMLLIElement[];\n this.checkNavigationValidity();\n this.setIntersectionObserver();\n this.goTo(this.current);\n }\n\n private onPrev(): void {\n if (this.single) {\n this.goTo(this.infinite && this.current - 1 < 0 ? this.items.length - 1 : Math.max(0, this.current - 1));\n\n return;\n }\n\n this.itemsContainer.scrollBy({\n left:\n this.infinite && this.itemsContainer.scrollLeft == 0\n ? this.itemsContainer.scrollWidth - this.itemsContainer.clientWidth\n : -this.itemsContainer.clientWidth / 2,\n behavior: \"smooth\",\n });\n }\n\n private onNext(): void {\n if (this.single) {\n const next =\n this.infinite && this.current + 1 > this.items.length - 1\n ? 0\n : Math.min(this.current + 1, this.items.length - 1);\n\n return this.goTo(next);\n }\n\n this.itemsContainer.scrollBy({\n left:\n this.infinite &&\n this.itemsContainer.scrollLeft == this.itemsContainer.scrollWidth - this.itemsContainer.clientWidth\n ? -this.itemsContainer.scrollWidth\n : this.itemsContainer.clientWidth / 2,\n behavior: \"smooth\",\n });\n }\n\n /**\n * Check if navigation buttons can be enabled and set the related local states.\n */\n private checkNavigationValidity(): void {\n if (this.single) {\n this.canNavigatePrev = this.current > 0;\n this.canNavigateNext = this.current < this.items.length - 1;\n\n return;\n }\n\n this.canNavigatePrev = this.itemsContainer.scrollLeft > 0;\n this.canNavigateNext =\n this.itemsContainer.scrollLeft < this.itemsContainer.scrollWidth - this.itemsContainer.clientWidth;\n }\n\n /**\n * Check if footer has to be rendered.\n */\n private canShowFooter(): boolean {\n if (!this.canNavigatePrev && !this.canNavigateNext) {\n return false;\n }\n\n return (\n this.arrowsPosition === CarouselArrowsPosition.BOTTOM ||\n this.progressMode === CarouselProgressMode.DOTS ||\n this.progressMode === CarouselProgressMode.NUMBERS\n );\n }\n\n /**\n * Set current item to passed index.\n * @param index Index to set\n */\n private goTo(index: number): void {\n if (this.current === index) {\n return;\n }\n\n this.scrollingTo = index;\n const left = this.items.slice(0, index).reduce((acc, item) => (acc += item.clientWidth), 0);\n // the scroll will trigger the IntersectionObserver and set the current item\n this.itemsContainer.scroll({\n left,\n behavior: \"smooth\",\n });\n }\n\n /** Check if navigation of at least one direction is enabled */\n private get canNavigate(): boolean {\n return this.canNavigatePrev || this.canNavigateNext;\n }\n\n private setupItems(): void {\n this.items = Array.from(this.host.children) as HTMLLIElement[];\n this.items.forEach((item) => {\n item.setAttribute(\"role\", \"group\");\n item.setAttribute(\"aria-roledescription\", \"slide\");\n });\n }\n\n componentDidLoad(): void {\n this.itemsContainer?.addEventListener(\"scroll\", this.checkNavigationValidity.bind(this), {passive: true});\n this.resizeObserver = new ResizeObserver(this.checkNavigationValidity.bind(this));\n this.resizeObserver.observe(this.itemsContainer);\n this.setupItems();\n if (this.single) {\n this.setIntersectionObserver();\n }\n this.checkNavigationValidity();\n }\n\n disconnectedCallback(): void {\n this.resizeObserver?.disconnect();\n }\n\n render(): HTMLDivElement | HTMLZCarouselElement {\n if (this.isLoading) {\n return (\n <div class=\"z-carousel-container\">\n {this.label && <div class=\"heading-3-sb z-carousel-title\">{this.label}</div>}\n <div style={{height: `${this.ghostLoadingHeight}px`}}>\n <z-ghost-loading></z-ghost-loading>\n </div>\n </div>\n );\n }\n\n return (\n <Host>\n <div\n class=\"z-carousel-container\"\n role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label={this.label || \"Carousel\"}\n >\n {this.label && <div class=\"z-carousel-title heading-3-sb\">{this.label}</div>}\n <div class=\"z-carousel-wrapper\">\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.SECONDARY}\n data-direction=\"prev\"\n icon=\"arrow-left\"\n onClick={this.onPrev.bind(this)}\n disabled={!this.infinite && !this.canNavigatePrev}\n hidden={this.arrowsPosition !== CarouselArrowsPosition.OVER || !this.canNavigate}\n ariaLabel={this.single ? \"Mostra l'elemento precedente\" : \"Mostra gli elementi precedenti\"}\n />\n <ul\n class=\"z-carousel-items-container\"\n aria-atomic=\"false\"\n aria-live=\"polite\"\n ref={(el) => (this.itemsContainer = el)}\n >\n <slot onSlotchange={this.onSlotChange.bind(this)} />\n </ul>\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.SECONDARY}\n data-direction=\"next\"\n icon=\"arrow-right\"\n onClick={this.onNext.bind(this)}\n disabled={!this.infinite && !this.canNavigateNext}\n hidden={this.arrowsPosition !== CarouselArrowsPosition.OVER || !this.canNavigate}\n ariaLabel={this.single ? \"Mostra l'elemento successivo\" : \"Mostra gli elementi successivi\"}\n />\n </div>\n </div>\n\n {this.canShowFooter() && (\n <div class=\"z-carousel-footer\">\n {this.arrowsPosition === CarouselArrowsPosition.BOTTOM && (\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.TERTIARY}\n icon=\"arrow-left\"\n onClick={this.onPrev.bind(this)}\n disabled={!this.infinite && !this.canNavigatePrev}\n ariaLabel={this.single ? \"Mostra l'elemento precedente\" : \"Mostra gli elementi precedenti\"}\n />\n )}\n {this.progressMode === CarouselProgressMode.DOTS && this.single && this.items && (\n <div class=\"dots-progress\">\n {this.items.map((_, index) => (\n <button\n type=\"button\"\n class={{current: this.highlightedIndicator === index}}\n aria-label={\n this.highlightedIndicator === index ? \"Elemento corrente\" : `Spostati all'elemento ${index + 1}`\n }\n onClick={() => this.goTo(index)}\n />\n ))}\n </div>\n )}\n {this.progressMode === CarouselProgressMode.NUMBERS && this.single && this.items && (\n <div class=\"numbers-progress interactive-1\">\n <span class=\"current\">{this.current + 1}</span>\n <span>di</span>\n <span>{this.items.length}</span>\n </div>\n )}\n {this.arrowsPosition === CarouselArrowsPosition.BOTTOM && (\n <z-button\n class=\"z-carousel-navigation-arrow\"\n variant={ButtonVariant.TERTIARY}\n icon=\"arrow-right\"\n onClick={this.onNext.bind(this)}\n disabled={!this.infinite && !this.canNavigateNext}\n ariaLabel={this.single ? \"Mostra l'elemento successivo\" : \"Mostra gli elementi successivi\"}\n />\n )}\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -32,10 +32,11 @@ const ZTable$1 = /*@__PURE__*/ proxyCustomElement(class ZTable extends HTMLEleme
32
32
  });
33
33
  }
34
34
  disconnectedCallback() {
35
- this.expandableMutationObserver.disconnect();
35
+ var _a;
36
+ (_a = this.expandableMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
36
37
  }
37
38
  render() {
38
- return (h(Host, { key: '4c33beca2ea12f899450df4a244ea271ea30c018', expandable: this.expandable }, h("div", { key: 'e5f6e45535e0251091d58b9784cfbe0b9bfc8f7e', class: "table", role: "table" }, h("slot", { key: 'd244f077dd25df7f2189f5b5f4b6f89e69db4768' }))));
39
+ return (h(Host, { key: 'd404e04cce15f5c9c01d1d90477b0b073ce4fb18', expandable: this.expandable }, h("div", { key: '093877b6d4f94257a4178c2d0647107a91cd782b', class: "table", role: "table" }, h("slot", { key: '19e147c5cb2e20287208e39085e816cfc62f3f5e' }))));
39
40
  }
40
41
  get host() { return this; }
41
42
  static get style() { return ZTableStyle0; }
@@ -1 +1 @@
1
- {"file":"z-table.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,2VAA2V,CAAC;AAC9W,qBAAe,SAAS;;MCeXA,QAAM;;;;;wBAON,KAAK;0BAMH,KAAK;;IAEV,gBAAgB;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;KAC7E;;;;IAOD,iBAAiB;QACf,IAAI,CAAC,0BAA0B,GAAG,IAAI,gBAAgB,CAAC;YACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACjD,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,CAAC,YAAY,CAAC;YAC/B,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC;KACJ;IAED,oBAAoB;QAClB,IAAI,CAAC,0BAA0B,CAAC,UAAU,EAAE,CAAC;KAC9C;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,UAAU,EAAE,IAAI,CAAC,UAAU,IAC/B,4DACE,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,OAAO,IAEZ,8DAAa,CACT,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZTable"],"sources":["src/components/table/z-table/styles.css?tag=z-table&encapsulation=shadow","src/components/table/z-table/index.tsx"],"sourcesContent":[":host {\n --z-table--cells-padding: calc(var(--space-unit) * 2);\n\n position: relative;\n display: block;\n overflow: auto;\n max-width: 100%;\n box-sizing: border-box;\n background-color: var(--color-surface01);\n}\n\n:host([expandable]) {\n --z-table--expand-button-size: 40px;\n}\n\n:host([bordered]) {\n --z-table--cell-left-border: 1px solid var(--color-surface03);\n}\n\n.table {\n min-width: max-content;\n}\n","import {Component, Element, Host, Prop, State, h} from \"@stencil/core\";\nimport \"../z-thead/index\";\nimport \"../z-tbody/index\";\nimport \"../z-tr/index\";\nimport \"../z-tfoot/index\";\n\n/**\n * ZTable component.\n * @slot - Table content (`z-thead`, `z-tbody`, `z-tfoot`, `z-tr`).\n * @cssprop --z-table--cells-padding - Padding of the cells.\n */\n@Component({\n tag: \"z-table\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTable {\n @Element() host: HTMLZTableElement;\n\n /**\n * Whether the table cells should show a border between them.\n */\n @Prop({reflect: true})\n bordered = false;\n\n /**\n * Whether the table contains some expandable rows.\n */\n @State()\n expandable = false;\n\n private updateExpandable(): void {\n this.expandable = this.host.querySelectorAll(\"z-tr[expandable]\").length > 0;\n }\n\n private expandableMutationObserver: MutationObserver;\n\n /**\n * Setup the table creating a mutation observer for the expandable attribute.\n */\n componentWillLoad(): void {\n this.expandableMutationObserver = new MutationObserver(() => {\n this.updateExpandable();\n });\n this.expandableMutationObserver.observe(this.host, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"expandable\"],\n attributeOldValue: false,\n });\n }\n\n disconnectedCallback(): void {\n this.expandableMutationObserver.disconnect();\n }\n\n render(): HTMLZTableElement {\n return (\n <Host expandable={this.expandable}>\n <div\n class=\"table\"\n role=\"table\"\n >\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"z-table.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,2VAA2V,CAAC;AAC9W,qBAAe,SAAS;;MCeXA,QAAM;;;;;wBAON,KAAK;0BAMH,KAAK;;IAEV,gBAAgB;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;KAC7E;;;;IAOD,iBAAiB;QACf,IAAI,CAAC,0BAA0B,GAAG,IAAI,gBAAgB,CAAC;YACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACjD,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,CAAC,YAAY,CAAC;YAC/B,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC;KACJ;IAED,oBAAoB;;QAClB,MAAA,IAAI,CAAC,0BAA0B,0CAAE,UAAU,EAAE,CAAC;KAC/C;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,UAAU,EAAE,IAAI,CAAC,UAAU,IAC/B,4DACE,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,OAAO,IAEZ,8DAAa,CACT,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZTable"],"sources":["src/components/table/z-table/styles.css?tag=z-table&encapsulation=shadow","src/components/table/z-table/index.tsx"],"sourcesContent":[":host {\n --z-table--cells-padding: calc(var(--space-unit) * 2);\n\n position: relative;\n display: block;\n overflow: auto;\n max-width: 100%;\n box-sizing: border-box;\n background-color: var(--color-surface01);\n}\n\n:host([expandable]) {\n --z-table--expand-button-size: 40px;\n}\n\n:host([bordered]) {\n --z-table--cell-left-border: 1px solid var(--color-surface03);\n}\n\n.table {\n min-width: max-content;\n}\n","import {Component, Element, Host, Prop, State, h} from \"@stencil/core\";\nimport \"../z-thead/index\";\nimport \"../z-tbody/index\";\nimport \"../z-tr/index\";\nimport \"../z-tfoot/index\";\n\n/**\n * ZTable component.\n * @slot - Table content (`z-thead`, `z-tbody`, `z-tfoot`, `z-tr`).\n * @cssprop --z-table--cells-padding - Padding of the cells.\n */\n@Component({\n tag: \"z-table\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTable {\n @Element() host: HTMLZTableElement;\n\n /**\n * Whether the table cells should show a border between them.\n */\n @Prop({reflect: true})\n bordered = false;\n\n /**\n * Whether the table contains some expandable rows.\n */\n @State()\n expandable = false;\n\n private updateExpandable(): void {\n this.expandable = this.host.querySelectorAll(\"z-tr[expandable]\").length > 0;\n }\n\n private expandableMutationObserver: MutationObserver;\n\n /**\n * Setup the table creating a mutation observer for the expandable attribute.\n */\n componentWillLoad(): void {\n this.expandableMutationObserver = new MutationObserver(() => {\n this.updateExpandable();\n });\n this.expandableMutationObserver.observe(this.host, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"expandable\"],\n attributeOldValue: false,\n });\n }\n\n disconnectedCallback(): void {\n this.expandableMutationObserver?.disconnect();\n }\n\n render(): HTMLZTableElement {\n return (\n <Host expandable={this.expandable}>\n <div\n class=\"table\"\n role=\"table\"\n >\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-f16bc2ca.js';
2
2
  import { R as CarouselArrowsPosition, U as CarouselProgressMode, B as ButtonVariant } from './index-2255c6c8.js';
3
3
 
4
- const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg);--z-carousel-gutter:0}:host([single]){display:flex;flex-direction:column;align-items:center;justify-content:center}:host([single]) .z-carousel-container{width:fit-content;max-width:100%}.z-carousel-container{display:flex;flex-direction:column}.z-carousel-title{margin-bottom:calc(var(--space-unit) * 2)}.z-carousel-wrapper{position:relative}.z-carousel-items-container{display:flex;max-width:100%;flex-direction:row;margin:0;column-gap:var(--z-carousel-gutter);list-style:none;-ms-overflow-style:none;overflow-x:scroll;padding-inline-start:0;scroll-behavior:smooth;scroll-snap-type:x mandatory;scrollbar-width:none;}.z-carousel-items-container::-webkit-scrollbar{display:none}.z-carousel-items-container ::slotted(*){scroll-snap-align:center}.z-carousel-navigation-arrow[hidden]{display:none}.z-carousel-navigation-arrow[data-direction]{position:absolute;bottom:50%;transform:translateY(50%)}.z-carousel-navigation-arrow[data-direction=\"next\"]{right:0}:host(:not([fixed-arrows])) .z-carousel-wrapper .z-carousel-navigation-arrow{display:none}.z-carousel-footer{display:flex;flex-direction:row;align-items:center;justify-content:center;column-gap:calc(var(--space-unit) * 3)}:host([arrows-position=\"bottom\"]) .z-carousel-footer{margin-top:calc(var(--space-unit) * 0.75)}.z-carousel-footer .numbers-progress,.z-carousel-footer .dots-progress{display:flex;align-items:center;justify-content:center}.z-carousel-footer .dots-progress{column-gap:calc(var(--space-unit) * 3)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .dots-progress{margin-top:calc(var(--space-unit) * 2)}.z-carousel-footer .dots-progress button{display:flex;width:calc(var(--space-unit) * 3);height:calc(var(--space-unit) * 3);align-items:center;padding:0;border:none;margin:0;background-color:var(--color-surface03);border-radius:calc(var(--space-unit) * 3)}.z-carousel-footer .dots-progress button.current{background-color:var(--color-primary01)}.z-carousel-footer .dots-progress button:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-carousel-footer .dots-progress button:not(.current){cursor:pointer}.z-carousel-footer .numbers-progress{column-gap:calc(var(--space-unit) / 2)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .numbers-progress{margin-top:var(--space-unit)}.z-carousel-footer .numbers-progress .current{font-weight:var(--font-sb)}@media (min-width: 768px){:host(:not([fixed-arrows])) .z-carousel-wrapper:hover .z-carousel-navigation-arrow:not([hidden]){display:flex}}";
4
+ const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg);--z-carousel-gutter:0}:host([single]){display:flex;flex-direction:column;align-items:center;justify-content:center}:host([single]) .z-carousel-container{width:fit-content;max-width:100%}.z-carousel-container{display:flex;flex-direction:column}.z-carousel-title{margin-bottom:calc(var(--space-unit) * 2)}.z-carousel-wrapper{position:relative}.z-carousel-items-container{display:flex;max-width:100%;flex-direction:row;margin:0;column-gap:var(--z-carousel-gutter);list-style:none;-ms-overflow-style:none;overflow-x:scroll;padding-inline-start:0;scroll-behavior:smooth;scroll-snap-type:x mandatory;scrollbar-width:none;}.z-carousel-items-container::-webkit-scrollbar{display:none}.z-carousel-items-container ::slotted(*){scroll-snap-align:center}.z-carousel-navigation-arrow[hidden]{display:none}.z-carousel-navigation-arrow[data-direction]{position:absolute;z-index:1;bottom:50%;transform:translateY(50%)}.z-carousel-navigation-arrow[data-direction=\"next\"]{right:0}:host(:not([fixed-arrows])) .z-carousel-wrapper .z-carousel-navigation-arrow{display:none}.z-carousel-footer{display:flex;flex-direction:row;align-items:center;justify-content:center;column-gap:calc(var(--space-unit) * 3)}:host([arrows-position=\"bottom\"]) .z-carousel-footer{margin-top:calc(var(--space-unit) * 0.75)}.z-carousel-footer .numbers-progress,.z-carousel-footer .dots-progress{display:flex;align-items:center;justify-content:center}.z-carousel-footer .dots-progress{column-gap:calc(var(--space-unit) * 3)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .dots-progress{margin-top:calc(var(--space-unit) * 2)}.z-carousel-footer .dots-progress button{display:flex;width:calc(var(--space-unit) * 3);height:calc(var(--space-unit) * 3);align-items:center;padding:0;border:none;margin:0;background-color:var(--color-surface03);border-radius:calc(var(--space-unit) * 3)}.z-carousel-footer .dots-progress button.current{background-color:var(--color-primary01)}.z-carousel-footer .dots-progress button:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-carousel-footer .dots-progress button:not(.current){cursor:pointer}.z-carousel-footer .numbers-progress{column-gap:calc(var(--space-unit) / 2)}:host(:not([arrows-position=\"bottom\"])) .z-carousel-footer .numbers-progress{margin-top:var(--space-unit)}.z-carousel-footer .numbers-progress .current{font-weight:var(--font-sb)}@media (min-width: 768px){:host(:not([fixed-arrows])) .z-carousel-wrapper:hover .z-carousel-navigation-arrow:not([hidden]){display:flex}}";
5
5
  const ZCarouselStyle0 = stylesCss;
6
6
 
7
7
  const ZCarousel = class {
@@ -147,7 +147,8 @@ const ZCarousel = class {
147
147
  });
148
148
  }
149
149
  componentDidLoad() {
150
- this.itemsContainer.addEventListener("scroll", this.checkNavigationValidity.bind(this), { passive: true });
150
+ var _a;
151
+ (_a = this.itemsContainer) === null || _a === void 0 ? void 0 : _a.addEventListener("scroll", this.checkNavigationValidity.bind(this), { passive: true });
151
152
  this.resizeObserver = new ResizeObserver(this.checkNavigationValidity.bind(this));
152
153
  this.resizeObserver.observe(this.itemsContainer);
153
154
  this.setupItems();