@cas-smartdesign/popover 4.4.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/3_created_from_source.js +1 -1
- package/dist/docs/doc.css +1 -1
- package/dist/docs/doc.mjs +56 -49
- package/dist/docs/index.html +1 -0
- package/dist/popover.d.ts +21 -25
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.mjs +291 -307
- package/dist/popover.mjs.map +1 -1
- package/npm-third-party-licenses.json +54 -104
- package/package.json +20 -11
- package/readme.md +6 -2
- package/dist/popover-with-externals.js +0 -8
- package/dist/popover-with-externals.js.map +0 -7
package/dist/popover.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.mjs","sources":["../arrow.svg?raw","../popover.ts"],"sourcesContent":["export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"24\\\" height=\\\"12\\\" viewBox=\\\"0 0 24 12\\\">\\r\\n <path d=\\\"M0 0l11.96 12L24 0z\\\" fill=\\\"#999\\\" class=\\\"arrow-border\\\"/>\\r\\n <path d=\\\"M12 11L1 0h22z\\\" fill=\\\"#f2f2f2\\\" class=\\\"arrow-background\\\"/>\\r\\n</svg>\\r\\n\"","import { createPopper, Instance as Popper, Options, Placement } from \"@popperjs/core\";\nimport { default as arrowSvg } from \"./arrow.svg?raw\";\n\nconst isIE11 = navigator.userAgent.indexOf(\"Trident\") !== -1;\nconst arrowOverlapOffset = 1;\nconst targetClassOpen = \"sd-popover-open\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [Popover.ID]: Popover;\n }\n}\n\nexport type TriggerType = \"click\" | \"hover\" | \"manual\";\nexport type ArrowVariant = \"bottom\" | \"left\" | \"right\" | \"top\";\nexport type IOpenEvent = void;\nexport type ICloseEvent = void;\n\nexport interface CustomEventMap extends HTMLElementEventMap {\n open: CustomEvent<IOpenEvent>;\n close: CustomEvent<ICloseEvent>;\n}\n\nexport default interface Popover {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nexport default class Popover extends HTMLElement {\n public static readonly ID = \"sd-popover\";\n private _open = false;\n private _popper: Popper;\n private _targetElement: HTMLElement;\n private _container: HTMLElement;\n private _arrow: HTMLElement;\n private _content: HTMLElement;\n private _firstUpdated = false;\n private _flipPriority: Placement[];\n private _resizeObserver: ResizeObserver;\n\n public get triggerType(): TriggerType {\n return this.getAttribute(\"trigger-type\") as TriggerType;\n }\n\n public set triggerType(type: TriggerType) {\n if (type) {\n this.setAttribute(\"trigger-type\", type);\n } else {\n this.removeAttribute(\"trigger-type\");\n }\n }\n\n public get arrowSvg(): string {\n return this.getAttribute(\"arrow-svg\") || arrowSvg;\n }\n\n public set arrowSvg(arrowSvg: string) {\n if (arrowSvg) {\n this.setAttribute(\"arrow-svg\", arrowSvg);\n } else {\n this.removeAttribute(\"arrow-svg\");\n }\n if (this._arrow) {\n this._arrow.innerHTML = this.arrowSvg;\n }\n }\n\n public get placement(): Placement {\n return this.getAttribute(\"placement\") as Placement;\n }\n\n public set placement(placement: Placement) {\n if (placement) {\n this.setAttribute(\"placement\", placement);\n } else {\n this.removeAttribute(\"placement\");\n }\n }\n\n public get targetElement(): HTMLElement {\n return this._targetElement;\n }\n\n public set targetElement(element: HTMLElement) {\n this.removeTargetEventListener(this.targetElement);\n if (this._targetElement && \"true\" == this._targetElement.getAttribute(\"aria-expanded\")) {\n this._targetElement.setAttribute(\"aria-expanded\", \"false\");\n }\n this._targetElement = element;\n if (element) {\n element.setAttribute(\"aria-expanded\", \"false\");\n }\n this.addTargetEventListener(this.targetElement);\n this.updatePopper();\n }\n\n public get targetSelector(): string {\n return this.getAttribute(\"target-selector\");\n }\n\n public set targetSelector(selector: string) {\n if (selector) {\n this.setAttribute(\"target-selector\", selector);\n } else {\n this.removeAttribute(\"target-selector\");\n }\n }\n\n public get modal(): boolean {\n return this.hasAttribute(\"modal\");\n }\n\n public set modal(modal: boolean) {\n if (modal) {\n this.setAttribute(\"modal\", \"\");\n } else {\n this.removeAttribute(\"modal\");\n }\n }\n\n public get popoverFor(): string {\n return this.getAttribute(\"popover-for\");\n }\n\n public set popoverFor(popoverFor: string) {\n if (popoverFor) {\n this.setAttribute(\"popover-for\", popoverFor);\n } else {\n this.removeAttribute(\"popover-for\");\n }\n }\n\n public get flipPriority(): Placement[] {\n return this._flipPriority;\n }\n\n public set flipPriority(priority: Placement[]) {\n if (priority && priority.length > 0) {\n this._flipPriority = priority;\n } else {\n this._flipPriority = null;\n }\n this.reConfigurePopper();\n }\n\n public get offset(): number {\n return this.getAttribute(\"offset\") ? parseInt(this.getAttribute(\"offset\")) : 0;\n }\n\n public set offset(offset: number) {\n if (offset) {\n this.setAttribute(\"offset\", offset.toString());\n } else {\n this.removeAttribute(\"offset\");\n }\n this.reConfigurePopper();\n }\n\n private reConfigurePopper() {\n if (this._popper) {\n this.configurePopper();\n }\n }\n\n public get noArrow(): boolean {\n return this.hasAttribute(\"no-arrow\");\n }\n\n public set noArrow(noArrow: boolean) {\n if (noArrow) {\n this.setAttribute(\"no-arrow\", \"\");\n } else {\n this.removeAttribute(\"no-arrow\");\n }\n }\n\n static get observedAttributes(): string[] {\n return [\"placement\", \"target-selector\", \"trigger-type\"];\n }\n\n public attributeChangedCallback(name: string, oldValue: string): void {\n switch (name) {\n case \"placement\": {\n this.updatePopper();\n break;\n }\n case \"trigger-type\": {\n this.removeTargetEventListener(this.targetElement);\n this.addTargetEventListener(this.targetElement);\n break;\n }\n case \"target-selector\": {\n this.handleTargetSelectorChange(oldValue);\n break;\n }\n }\n }\n\n public connectedCallback(): void {\n if (!this._firstUpdated) {\n this.firstUpdated();\n this._firstUpdated = true;\n }\n if (this.targetElement) {\n this.addTargetEventListener(this.targetElement);\n } else if (this.targetSelector) {\n // The browser is currently attaching html nodes to the dom tree, the target may not be present in it yet.\n requestAnimationFrame(() => {\n if (this.isConnected) {\n this.handleTargetSelectorChange(null);\n }\n });\n }\n\n this._arrow = document.createElement(\"div\");\n this._arrow.classList.add(\"popover-arrow\");\n this._arrow.setAttribute(\"data-popper-arrow\", \"\");\n this._arrow.style.display = \"flex\";\n this._arrow.innerHTML = this.arrowSvg;\n }\n\n public disconnectedCallback(): void {\n if (this.targetElement) {\n this.removeTargetEventListener(this.targetElement);\n this.removeTargetClassForOpen(this.targetElement);\n }\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n this._resizeObserver = null;\n }\n }\n\n public toggle = (): void => {\n this.open = !this.open;\n };\n\n public show = (): void => {\n this.open = true;\n };\n\n public hide = (): void => {\n this.open = false;\n };\n\n private firstUpdated(): void {\n this.style.display = \"none\";\n this.triggerType = this.triggerType || \"click\";\n this.placement = this.placement || \"auto\";\n }\n\n private get open(): boolean {\n return this._open;\n }\n\n private set open(open: boolean) {\n if (open !== this._open) {\n this._open = open;\n this.handleOpenChange();\n }\n }\n\n private handleOpenChange(): void {\n if (this.open) {\n if (!this._popper) {\n this.configurePopper();\n }\n\n this._container.innerHTML = \"\";\n if (this.popoverFor) {\n this._container.setAttribute(\"popover-for\", this.popoverFor);\n }\n if (this.content) {\n this._container.prepend(this.content);\n Object.assign(this.content.style, {\n position: \"relative\",\n display: \"block\",\n zIndex: 1,\n });\n window.requestAnimationFrame(() => {\n let backgroundColor = getComputedStyle(this.content).backgroundColor;\n if (backgroundColor == \"rgba(0, 0, 0, 0)\") {\n this.content.style.background = backgroundColor = \"#f2f2f2\";\n }\n const arrowBackground = this._arrow.querySelector(\".arrow-background\") as HTMLElement;\n if (arrowBackground) {\n arrowBackground.style.fill = backgroundColor;\n }\n });\n }\n this.ensureArrowIsAdded();\n this.ownerDocument.body.appendChild(this._container);\n this.updatePopper();\n this.setAttribute(\"open\", \"\");\n\n if (this.modal) {\n window.addEventListener(\"click\", this.hideIfExternalTarget, { capture: true });\n window.addEventListener(\"focus\", this.hideIfExternalTarget, { capture: true });\n }\n if (this.targetElement) {\n this.addTargetClassForOpen(this.targetElement);\n this.targetElement.setAttribute(\"aria-expanded\", \"true\");\n }\n this.dispatchEvent(new CustomEvent(\"open\"));\n\n this._container.addEventListener(\"keydown\", this.handleTabKeyDown);\n } else {\n this.ownerDocument.body.removeChild(this._container);\n this.removeAttribute(\"open\");\n window.removeEventListener(\"click\", this.hideIfExternalTarget, { capture: true });\n window.removeEventListener(\"focus\", this.hideIfExternalTarget, { capture: true });\n\n if (this.targetElement) {\n this.removeTargetClassForOpen(this.targetElement);\n this.targetElement.setAttribute(\"aria-expanded\", \"false\");\n }\n this.dispatchEvent(new CustomEvent(\"close\"));\n\n this._container.removeEventListener(\"keydown\", this.handleTabKeyDown);\n }\n }\n\n private hideIfExternalTarget = (event: Event) => {\n const target = event.target;\n if (\n !(target instanceof HTMLElement) ||\n (!this._container.contains(target) && !this.targetElement.contains(target))\n ) {\n this.hide();\n }\n };\n\n private handleTabKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Tab\") {\n return;\n }\n\n const shift = event.shiftKey;\n let nextInsidePopover: HTMLElement | null = null;\n\n const target = event.target as Element | null;\n const root = this.content;\n\n if (target instanceof HTMLElement && root) {\n nextInsidePopover = this.findNextFocusableAfter(target, root, !shift);\n }\n\n if (nextInsidePopover) {\n // Let browser handle tabbing inside popover\n return;\n }\n\n // No more focusable elements inside popover → close it\n event.preventDefault();\n this.open = false;\n\n const next = this.findNextFocusableAfter(this.targetElement, null, !shift);\n next?.focus();\n };\n\n private handleTargetSelectorChange(oldValue: string): void {\n const oldTarget = document.querySelector<HTMLElement>(oldValue);\n if (oldTarget) {\n this.removeTargetEventListener(oldTarget);\n this.removeTargetClassForOpen(oldTarget);\n }\n if (this.targetSelector) {\n this.targetElement = document.querySelector(this.targetSelector);\n this.addTargetEventListener(this.targetElement);\n }\n }\n\n private addTargetEventListener(target: HTMLElement): void {\n if (target) {\n switch (this.triggerType) {\n case \"hover\": {\n target.addEventListener(\"mouseenter\", this.show);\n target.addEventListener(\"mouseleave\", this.hide);\n break;\n }\n case \"click\": {\n target.addEventListener(\"click\", this.toggle);\n break;\n }\n }\n }\n }\n\n private removeTargetEventListener(target: HTMLElement): void {\n if (target) {\n switch (this.triggerType) {\n case \"hover\": {\n target.removeEventListener(\"mouseenter\", this.show);\n target.removeEventListener(\"mouseleave\", this.hide);\n break;\n }\n case \"click\": {\n target.removeEventListener(\"click\", this.toggle);\n break;\n }\n }\n }\n }\n\n private configurePopper(): void {\n this.createContentContainer();\n // In popper.js 2 the arrow needs to be added before calling Popper#createPopper\n this.ensureArrowIsAdded();\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const popover = this;\n const options: Options = {\n placement: popover.placement as Placement,\n strategy: \"absolute\",\n modifiers: [\n {\n name: \"computeStyles\",\n options: {\n gpuAcceleration: !isIE11,\n },\n },\n {\n name: \"flip\",\n options: {\n fallbackPlacements: popover._flipPriority,\n },\n },\n {\n name: \"offset\",\n options: {\n offset: () => {\n return [\n 0,\n popover.noArrow ? 0 + popover.offset : this._arrow.clientHeight + popover.offset,\n ];\n },\n },\n },\n {\n name: \"arrow\",\n options: {\n padding: 6, // Avoid to reach the edges of the popper element with the arrow\n },\n },\n {\n name: \"resetArrowStyles\",\n enabled: true,\n phase: \"beforeWrite\",\n fn({ state }) {\n Object.assign(popover._arrow.style, {\n top: state.styles.arrow.top || \"\",\n left: state.styles.arrow.left || \"\",\n bottom: state.styles.arrow.bottom || \"\",\n right: state.styles.arrow.right || \"\",\n });\n },\n },\n {\n name: \"onUpdate\",\n enabled: true,\n phase: \"afterWrite\",\n fn({ state }) {\n popover.updateArrow(state.placement);\n },\n },\n ],\n };\n this._popper = createPopper(this.targetElement, this._container, options);\n }\n\n private createContentContainer(): void {\n this._container = document.createElement(\"div\");\n this._container.classList.add(\"popover-container\");\n this._container.tabIndex = 0;\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n }\n this._resizeObserver = new ResizeObserver(() => {\n if (this._popper) {\n this._popper.update();\n }\n });\n this._resizeObserver.observe(this._container);\n Object.assign(this._container.style, {\n boxShadow: `0 4px 5px 0 rgba(0, 0, 0, 0.14),\n 0 1px 10px 0 rgba(0, 0, 0, 0.12),\n 0 2px 4px -1px rgba(0, 0, 0, 0.4)`,\n border: \"1px solid #999\",\n boxSizing: \"border-box\",\n zIndex: 20000,\n });\n }\n\n private ensureArrowIsAdded() {\n if (!this.noArrow && !this._container.contains(this._arrow)) {\n this._container.appendChild(this._arrow);\n }\n }\n\n public updatePopper(): void {\n if (this._popper) {\n this._popper.state.elements.reference = this.targetElement;\n this._popper.state.options.placement = this.placement;\n\n if (this.open) {\n this._popper.update();\n }\n }\n }\n\n private updateArrow(placement: Placement): void {\n if (this._arrow) {\n const arrowVariant = this.getArrowVariant(placement);\n this._arrow.setAttribute(\"variant\", arrowVariant);\n if (this._content) {\n const svg = this._arrow.querySelector(\"svg\");\n\n const arrowWidth = this._arrow.clientWidth;\n const arrowHeight = this._arrow.clientHeight;\n const verticalOffset = `-${arrowHeight - arrowOverlapOffset}px`;\n\n const horizontalTransformationOffset = (arrowWidth - arrowHeight) / 2;\n // Note that arrowHeight is used on purpose for the horizontalOffset\n // as this is the height of the unrotated wrapper div which defines the gap between the\n // reference element and the popover.\n const horizontalOffset = `-${arrowHeight + horizontalTransformationOffset - arrowOverlapOffset}px`;\n\n switch (arrowVariant) {\n case \"bottom\": {\n this._arrow.style.top = verticalOffset;\n svg.style.transform = \"rotate(180deg)\";\n break;\n }\n case \"top\": {\n this._arrow.style.bottom = verticalOffset;\n svg.style.transform = \"rotate(0deg)\";\n break;\n }\n case \"left\": {\n this._arrow.style.right = horizontalOffset;\n svg.style.transform = \"rotate(270deg)\";\n break;\n }\n case \"right\": {\n this._arrow.style.left = horizontalOffset;\n svg.style.transform = \"rotate(90deg)\";\n break;\n }\n }\n }\n }\n }\n\n private getArrowVariant(placement: Placement): ArrowVariant {\n if (placement.indexOf(\"bottom\") !== -1) {\n return \"bottom\";\n } else if (placement.indexOf(\"top\") !== -1) {\n return \"top\";\n } else if (placement.indexOf(\"left\") !== -1) {\n return \"left\";\n } else if (placement.indexOf(\"right\") !== -1) {\n return \"right\";\n }\n }\n\n private get content(): HTMLElement {\n if (!this._content) {\n this._content = this.firstElementChild as HTMLElement;\n this._content.setAttribute(\"data-popper-content\", \"\");\n }\n return this._content;\n }\n\n private addTargetClassForOpen(target: HTMLElement): void {\n if (target) {\n target.classList.add(targetClassOpen);\n }\n }\n\n private removeTargetClassForOpen(target: HTMLElement): void {\n if (target) {\n target.classList.remove(targetClassOpen);\n }\n }\n\n private findNextFocusableAfter(\n trigger: HTMLElement | null,\n root: HTMLElement | null,\n forward: boolean,\n ): HTMLElement | null {\n if (!trigger) return null;\n\n const effectiveRoot = root ?? document.body;\n\n const walker = document.createTreeWalker(effectiveRoot, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n const el = node as HTMLElement;\n\n return el.tabIndex >= 0 && !el.hidden && el.offsetParent !== null\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP;\n },\n });\n\n walker.currentNode = trigger;\n\n const nextNode = forward ? walker.nextNode() : walker.previousNode();\n\n return nextNode as HTMLElement | null;\n }\n}\n\nif (!customElements.get(Popover.ID)) {\n customElements.define(Popover.ID, Popover);\n}\n"],"names":["arrowSvg","isIE11","arrowOverlapOffset","targetClassOpen","_Popover","event","target","shift","nextInsidePopover","root","type","placement","element","selector","modal","popoverFor","priority","offset","noArrow","name","oldValue","open","backgroundColor","arrowBackground","oldTarget","popover","options","state","createPopper","arrowVariant","svg","arrowWidth","arrowHeight","verticalOffset","horizontalTransformationOffset","horizontalOffset","trigger","forward","effectiveRoot","walker","node","el","Popover"],"mappings":";AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA,GCGTC,IAAS,UAAU,UAAU,QAAQ,SAAS,MAAM,IACpDC,IAAqB,GACrBC,IAAkB,mBA0CHC,IAArB,MAAqBA,UAAgB,YAAY;AAAA,EAAjD,cAAA;AAAA,UAAA,GAAA,SAAA,GAEI,KAAQ,QAAQ,IAMhB,KAAQ,gBAAgB,IAoMxB,KAAO,SAAS,MAAY;AACxB,WAAK,OAAO,CAAC,KAAK;AAAA,IACtB,GAEA,KAAO,OAAO,MAAY;AACtB,WAAK,OAAO;AAAA,IAChB,GAEA,KAAO,OAAO,MAAY;AACtB,WAAK,OAAO;AAAA,IAChB,GA+EA,KAAQ,uBAAuB,CAACC,MAAiB;AAC7C,YAAMC,IAASD,EAAM;AACrB,OACI,EAAEC,aAAkB,gBACnB,CAAC,KAAK,WAAW,SAASA,CAAM,KAAK,CAAC,KAAK,cAAc,SAASA,CAAM,MAEzE,KAAK,KAAA;AAAA,IAEb,GAEA,KAAQ,mBAAmB,CAACD,MAAyB;AACjD,UAAIA,EAAM,QAAQ;AACd;AAGJ,YAAME,IAAQF,EAAM;AACpB,UAAIG,IAAwC;AAE5C,YAAMF,IAASD,EAAM,QACfI,IAAO,KAAK;AAMlB,UAJIH,aAAkB,eAAeG,MACjCD,IAAoB,KAAK,uBAAuBF,GAAQG,GAAM,CAACF,CAAK,IAGpEC;AAEA;AAIJ,MAAAH,EAAM,eAAA,GACN,KAAK,OAAO,IAEC,KAAK,uBAAuB,KAAK,eAAe,MAAM,CAACE,CAAK,GACnE,MAAA;AAAA,IACV;AAAA,EAAA;AAAA,EA7TA,IAAW,cAA2B;AAClC,WAAO,KAAK,aAAa,cAAc;AAAA,EAC3C;AAAA,EAEA,IAAW,YAAYG,GAA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,MAAM;AACtC,aAAO;AAAA,EAEf;AAAA,EAEA,IAAY,UAAuB;AAC/B,WAAK,KAAK,aACN,KAAK,WAAW,KAAK,mBACrB,KAAK,SAAS,aAAa,uBAAuB,EAAE,IAEjD,KAAK;AAAA,EAChB;AAAA,EAEQ,sBAAsBL,GAA2B;AACrD,IAAIA,KACAA,EAAO,UAAU,IAAIH,CAAe;AAAA,EAE5C;AAAA,EAEQ,yBAAyBG,GAA2B;AACxD,IAAIA,KACAA,EAAO,UAAU,OAAOH,CAAe;AAAA,EAE/C;AAAA,EAEQ,uBACJiC,GACA3B,GACA4B,GACkB;AAClB,QAAI,CAACD,EAAS,QAAO;AAErB,UAAME,IAAgB7B,KAAQ,SAAS,MAEjC8B,IAAS,SAAS,iBAAiBD,GAAe,WAAW,cAAc;AAAA,MAC7E,WAAWE,GAAM;AACb,cAAMC,IAAKD;AAEX,eAAOC,EAAG,YAAY,KAAK,CAACA,EAAG,UAAUA,EAAG,iBAAiB,OACvD,WAAW,gBACX,WAAW;AAAA,MACrB;AAAA,IAAA,CACH;AAED,WAAAF,EAAO,cAAcH,GAEJC,IAAUE,EAAO,SAAA,IAAaA,EAAO,aAAA;AAAA,EAG1D;AACJ;AApkBInC,EAAuB,KAAK;AADhC,IAAqBsC,IAArBtC;AAukBK,eAAe,IAAIsC,EAAQ,EAAE,KAC9B,eAAe,OAAOA,EAAQ,IAAIA,CAAO;"}
|
|
1
|
+
{"version":3,"file":"popover.mjs","names":[],"sources":["../arrow.svg?raw","../popover.ts"],"sourcesContent":["export default \"<svg width=\\\"26\\\" height=\\\"12\\\" viewBox=\\\"0 0 26 12\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\r\\n<path d=\\\"M13.7072 0.707031L0.707153 0.707031L9.87873 9.8786C11.4408 11.4407 13.9735 11.4407 15.5356 9.8786L24.7072 0.707031L13.7072 0.707031Z\\\" fill=\\\"var(--color-bg-default, #ffffff)\\\" class=\\\"arrow-background\\\"/>\\r\\n<path d=\\\"M0.707153 0.707031L9.87872 9.8786C11.4408 11.4407 13.9735 11.4407 15.5356 9.8786L24.7072 0.707031\\\" stroke=\\\"var(--color-border-strong, #B3B3B3)\\\" stroke-linecap=\\\"square\\\" class=\\\"arrow-border\\\"/>\\r\\n</svg>\\r\\n\"","import { createPopper, type Instance as Popper, type Options, type Placement } from \"@popperjs/core\";\n\nimport { default as arrowSvg } from \"./arrow.svg?raw\";\n\nconst arrowOverlapOffset = 1;\nconst targetClassOpen = \"sd-popover-open\";\n\nlet idCounter = 0;\nconst nextId = () => {\n idCounter++;\n return idCounter;\n};\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [Popover.ID]: Popover;\n }\n interface HTMLElementEventMap {\n \"sd-popover-open\": CustomEvent<IOpenEvent>;\n \"sd-popover-close\": CustomEvent<ICloseEvent>;\n }\n}\n\nexport type TriggerType = \"click\" | \"hover\" | \"manual\";\nexport type ArrowVariant = \"bottom\" | \"left\" | \"right\" | \"top\";\nexport type IOpenEvent = void;\nexport type ICloseEvent = void;\n\nexport default class Popover extends HTMLElement {\n public static readonly ID = \"sd-popover\";\n public static ensureDefined = () => {\n if (!customElements.get(Popover.ID)) {\n customElements.define(Popover.ID, Popover);\n }\n };\n private popoverContainerId = \"popover-container-\" + nextId();\n\n private _open = false;\n private _popper?: Popper;\n private _targetElement?: HTMLElement;\n private _container?: HTMLElement;\n private _arrow?: HTMLElement;\n private _content?: HTMLElement;\n private _firstUpdated = false;\n private _flipPriority?: Placement[];\n private _resizeObserver?: ResizeObserver;\n\n public get triggerType(): TriggerType {\n return this.getAttribute(\"trigger-type\") as TriggerType;\n }\n\n public set triggerType(type: TriggerType) {\n if (type) {\n this.setAttribute(\"trigger-type\", type);\n } else {\n this.removeAttribute(\"trigger-type\");\n }\n }\n\n public get arrowSvg(): string {\n return this.getAttribute(\"arrow-svg\") || arrowSvg;\n }\n\n public set arrowSvg(arrowSvg: string) {\n if (arrowSvg) {\n this.setAttribute(\"arrow-svg\", arrowSvg);\n } else {\n this.removeAttribute(\"arrow-svg\");\n }\n if (this._arrow) {\n this._arrow.innerHTML = this.arrowSvg;\n }\n }\n\n public get placement(): Placement {\n return this.getAttribute(\"placement\") as Placement;\n }\n\n public set placement(placement: Placement) {\n if (placement) {\n this.setAttribute(\"placement\", placement);\n } else {\n this.removeAttribute(\"placement\");\n }\n }\n\n public get targetElement(): HTMLElement | undefined {\n return this._targetElement;\n }\n\n public set targetElement(element: HTMLElement | undefined) {\n this.removeTargetEventListener(this.targetElement);\n if (this._targetElement && \"true\" == this._targetElement.getAttribute(\"aria-expanded\")) {\n this._targetElement.setAttribute(\"aria-expanded\", \"false\");\n }\n this._targetElement = element;\n if (element) {\n element.setAttribute(\"aria-expanded\", \"false\");\n }\n this.addTargetEventListener(this.targetElement);\n this.updatePopper();\n }\n\n public get targetSelector(): string | null {\n return this.getAttribute(\"target-selector\");\n }\n\n public set targetSelector(selector: string) {\n if (selector) {\n this.setAttribute(\"target-selector\", selector);\n } else {\n this.removeAttribute(\"target-selector\");\n }\n }\n\n public get modal(): boolean {\n return this.hasAttribute(\"modal\");\n }\n\n public set modal(modal: boolean) {\n if (modal) {\n this.setAttribute(\"modal\", \"\");\n } else {\n this.removeAttribute(\"modal\");\n }\n }\n\n public get popoverFor(): string | null {\n return this.getAttribute(\"popover-for\");\n }\n\n public set popoverFor(popoverFor: string) {\n if (popoverFor) {\n this.setAttribute(\"popover-for\", popoverFor);\n } else {\n this.removeAttribute(\"popover-for\");\n }\n }\n\n public get flipPriority(): Placement[] | undefined {\n return this._flipPriority;\n }\n\n public set flipPriority(priority: Placement[] | undefined) {\n if (priority && priority.length > 0) {\n this._flipPriority = priority;\n } else {\n this._flipPriority = undefined;\n }\n this.reConfigurePopper();\n }\n\n public get offset(): number {\n return this.getAttribute(\"offset\") ? parseInt(this.getAttribute(\"offset\") ?? \"0\") : 0;\n }\n\n public set offset(offset: number) {\n if (offset) {\n this.setAttribute(\"offset\", offset.toString());\n } else {\n this.removeAttribute(\"offset\");\n }\n this.reConfigurePopper();\n }\n\n private reConfigurePopper() {\n if (this._popper) {\n this.configurePopper();\n }\n }\n\n public get noArrow(): boolean {\n return this.hasAttribute(\"no-arrow\");\n }\n\n public set noArrow(noArrow: boolean) {\n if (noArrow) {\n this.setAttribute(\"no-arrow\", \"\");\n } else {\n this.removeAttribute(\"no-arrow\");\n }\n }\n\n static get observedAttributes(): string[] {\n return [\"placement\", \"target-selector\", \"trigger-type\"];\n }\n\n public attributeChangedCallback(name: string, oldValue: string): void {\n switch (name) {\n case \"placement\": {\n this.updatePopper();\n break;\n }\n case \"trigger-type\": {\n this.removeTargetEventListener(this.targetElement);\n this.addTargetEventListener(this.targetElement);\n break;\n }\n case \"target-selector\": {\n this.handleTargetSelectorChange(oldValue);\n break;\n }\n }\n }\n\n public connectedCallback(): void {\n if (!this._firstUpdated) {\n this.firstUpdated();\n this._firstUpdated = true;\n }\n if (this.targetElement) {\n this.addTargetEventListener(this.targetElement);\n } else if (this.targetSelector) {\n // The browser is currently attaching html nodes to the dom tree, the target may not be present in it yet.\n requestAnimationFrame(() => {\n if (this.isConnected) {\n this.handleTargetSelectorChange(null);\n }\n });\n }\n\n this._arrow = document.createElement(\"div\");\n this._arrow.classList.add(\"popover-arrow\");\n this._arrow.setAttribute(\"data-popper-arrow\", \"\");\n this._arrow.style.display = \"flex\";\n this._arrow.innerHTML = this.arrowSvg;\n }\n\n public disconnectedCallback(): void {\n if (this.targetElement) {\n this.removeTargetEventListener(this.targetElement);\n this.removeTargetClassForOpen(this.targetElement);\n }\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n this._resizeObserver = undefined;\n }\n }\n\n public toggle = (): void => {\n this.open = !this.open;\n };\n\n public show = (): void => {\n this.open = true;\n };\n\n public hide = (): void => {\n this.open = false;\n };\n\n private firstUpdated(): void {\n this.style.display = \"none\";\n this.triggerType = this.triggerType || \"click\";\n this.placement = this.placement || \"auto\";\n }\n\n private get open(): boolean {\n return this._open;\n }\n\n private set open(open: boolean) {\n if (open !== this._open) {\n this._open = open;\n this.handleOpenChange();\n }\n }\n\n private handleOpenChange(): void {\n if (this.open) {\n if (!this._popper) {\n this.configurePopper();\n }\n if (this._container == null) {\n return;\n }\n\n this._container.innerHTML = \"\";\n const style = document.createElement(\"style\");\n style.innerHTML = `#${this.popoverContainerId} {\n box-shadow: var(--effect-shadow-strong, 1px 4px 24px 0 rgba(17, 17, 17, 0.5));\n border: 1px solid var(--color-border-strong, #B3B3B3);\n border-radius: var(--radius-s, 4px);\n box-sizing: border-box;\n z-index: 20000;\n\n > *:not(.popover-arrow) {\n border-radius: var(--radius-s, 4px);\n clip-path: inset(0 round var(--radius-s, 4px));\n }\n }`;\n this._container.appendChild(style);\n if (this.popoverFor) {\n this._container.setAttribute(\"popover-for\", this.popoverFor);\n }\n if (this.content) {\n this._container.prepend(this.content);\n Object.assign(this.content.style, {\n position: \"relative\",\n display: \"block\",\n zIndex: 1,\n });\n window.requestAnimationFrame(() => {\n let backgroundColor = getComputedStyle(this.content).backgroundColor;\n if (backgroundColor == \"rgba(0, 0, 0, 0)\") {\n this.content.style.background = backgroundColor = \"var(--color-bg-default, #ffffff)\";\n }\n if (!this._arrow) {\n return;\n }\n const arrowBackground = this._arrow.querySelector(\".arrow-background\") as HTMLElement;\n if (arrowBackground) {\n arrowBackground.style.fill = backgroundColor;\n }\n });\n }\n this.ensureArrowIsAdded();\n this.ownerDocument.body.appendChild(this._container);\n this.updatePopper();\n this.setAttribute(\"open\", \"\");\n\n if (this.modal) {\n window.addEventListener(\"click\", this.hideIfExternalTarget, { capture: true });\n window.addEventListener(\"focus\", this.hideIfExternalTarget, { capture: true });\n }\n if (this.targetElement) {\n this.addTargetClassForOpen(this.targetElement);\n this.targetElement.setAttribute(\"aria-expanded\", \"true\");\n }\n this.dispatchEvent(new CustomEvent(\"sd-popover-open\"));\n\n this._container.addEventListener(\"keydown\", this.handleTabKeyDown);\n } else {\n if (this._container != null) {\n this.ownerDocument.body.removeChild(this._container);\n }\n\n this.removeAttribute(\"open\");\n window.removeEventListener(\"click\", this.hideIfExternalTarget, { capture: true });\n window.removeEventListener(\"focus\", this.hideIfExternalTarget, { capture: true });\n\n if (this.targetElement) {\n this.removeTargetClassForOpen(this.targetElement);\n this.targetElement.setAttribute(\"aria-expanded\", \"false\");\n }\n this.dispatchEvent(new CustomEvent(\"sd-popover-close\"));\n\n if (this._container != null) {\n this._container.removeEventListener(\"keydown\", this.handleTabKeyDown);\n }\n }\n }\n\n private hideIfExternalTarget = (event: Event) => {\n const target = event.target;\n if (\n !(target instanceof HTMLElement) ||\n this._container == null ||\n this.targetElement == null ||\n (!this._container.contains(target) && !this.targetElement.contains(target))\n ) {\n this.hide();\n }\n };\n\n private handleTabKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Tab\") {\n return;\n }\n\n const shift = event.shiftKey;\n let nextInsidePopover: HTMLElement | null = null;\n\n const target = event.target as Element | null;\n const root = this.content;\n\n if (target instanceof HTMLElement && root) {\n nextInsidePopover = this.findNextFocusableAfter(target, root, !shift);\n }\n\n if (nextInsidePopover) {\n // Let browser handle tabbing inside popover\n return;\n }\n\n // No more focusable elements inside popover → close it\n event.preventDefault();\n this.open = false;\n\n const next = this.findNextFocusableAfter(this.targetElement, null, !shift);\n next?.focus();\n };\n\n private handleTargetSelectorChange(oldValue: string | null | undefined): void {\n if (oldValue != null) {\n const oldTarget = document.querySelector<HTMLElement>(oldValue);\n if (oldTarget) {\n this.removeTargetEventListener(oldTarget);\n this.removeTargetClassForOpen(oldTarget);\n }\n }\n if (this.targetSelector) {\n const target = document.querySelector(this.targetSelector);\n if (target instanceof HTMLElement) {\n this.targetElement = target;\n }\n\n this.addTargetEventListener(this.targetElement);\n }\n }\n\n private addTargetEventListener(target: HTMLElement | undefined): void {\n if (target) {\n switch (this.triggerType) {\n case \"hover\": {\n target.addEventListener(\"mouseenter\", this.show);\n target.addEventListener(\"mouseleave\", this.hide);\n break;\n }\n case \"click\": {\n target.addEventListener(\"click\", this.toggle);\n break;\n }\n }\n }\n }\n\n private removeTargetEventListener(target: HTMLElement | undefined): void {\n if (target) {\n switch (this.triggerType) {\n case \"hover\": {\n target.removeEventListener(\"mouseenter\", this.show);\n target.removeEventListener(\"mouseleave\", this.hide);\n break;\n }\n case \"click\": {\n target.removeEventListener(\"click\", this.toggle);\n break;\n }\n }\n }\n }\n\n private configurePopper(): void {\n this.createContentContainer();\n // In popper.js 2 the arrow needs to be added before calling Popper#createPopper\n this.ensureArrowIsAdded();\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const popover = this;\n const options: Options = {\n placement: popover.placement as Placement,\n strategy: \"absolute\",\n modifiers: [\n {\n name: \"computeStyles\",\n options: {\n gpuAcceleration: true,\n },\n },\n {\n name: \"flip\",\n options: {\n fallbackPlacements: popover._flipPriority,\n },\n },\n {\n name: \"offset\",\n options: {\n offset: () => {\n return [\n 0,\n popover.noArrow\n ? 0 + popover.offset\n : (this._arrow?.clientHeight ?? 0 + popover.offset),\n ];\n },\n },\n },\n {\n name: \"arrow\",\n options: {\n padding: 10, // Avoid to reach the edges of the popper element with the arrow\n },\n },\n {\n name: \"resetArrowStyles\",\n enabled: true,\n phase: \"beforeWrite\",\n fn({ state }) {\n if (popover._arrow && state.styles.arrow) {\n Object.assign(popover._arrow.style, {\n top: state.styles.arrow.top || \"\",\n left: state.styles.arrow.left || \"\",\n bottom: state.styles.arrow.bottom || \"\",\n right: state.styles.arrow.right || \"\",\n });\n }\n },\n },\n {\n name: \"onUpdate\",\n enabled: true,\n phase: \"afterWrite\",\n fn({ state }) {\n popover.updateArrow(state.placement);\n },\n },\n ],\n };\n this._popper = createPopper(this.targetElement!, this._container!, options);\n }\n\n private createContentContainer(): void {\n this._container = document.createElement(\"div\");\n this._container.id = this.popoverContainerId;\n this._container.classList.add(\"popover-container\");\n this._container.tabIndex = 0;\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n }\n this._resizeObserver = new ResizeObserver(() => {\n if (this._popper) {\n void this._popper.update();\n }\n });\n this._resizeObserver.observe(this._container);\n }\n\n private ensureArrowIsAdded() {\n if (this._container && this._arrow && !this.noArrow && !this._container.contains(this._arrow)) {\n this._container.appendChild(this._arrow);\n }\n }\n\n public updatePopper(): void {\n if (this._popper) {\n this._popper.state.elements.reference = this.targetElement ?? document.body;\n this._popper.state.options.placement = this.placement;\n\n if (this.open) {\n void this._popper.update();\n }\n }\n }\n\n private updateArrow(placement: Placement): void {\n if (this._arrow) {\n const arrowVariant = this.getArrowVariant(placement);\n this._arrow.setAttribute(\"variant\", arrowVariant);\n if (this._content) {\n const svg = this._arrow.querySelector(\"svg\")!;\n\n const arrowWidth = this._arrow.clientWidth;\n const arrowHeight = this._arrow.clientHeight;\n const verticalOffset = `-${arrowHeight - arrowOverlapOffset}px`;\n\n const horizontalTransformationOffset = (arrowWidth - arrowHeight) / 2;\n // Note that arrowHeight is used on purpose for the horizontalOffset\n // as this is the height of the unrotated wrapper div which defines the gap between the\n // reference element and the popover.\n const horizontalOffset = `-${arrowHeight + horizontalTransformationOffset - arrowOverlapOffset}px`;\n\n switch (arrowVariant) {\n case \"bottom\": {\n this._arrow.style.top = verticalOffset;\n svg.style.transform = \"rotate(180deg)\";\n break;\n }\n case \"top\": {\n this._arrow.style.bottom = verticalOffset;\n svg.style.transform = \"rotate(0deg)\";\n break;\n }\n case \"left\": {\n this._arrow.style.right = horizontalOffset;\n svg.style.transform = \"rotate(270deg)\";\n break;\n }\n case \"right\": {\n this._arrow.style.left = horizontalOffset;\n svg.style.transform = \"rotate(90deg)\";\n break;\n }\n }\n }\n }\n }\n\n private getArrowVariant(placement: Placement): ArrowVariant {\n if (placement.indexOf(\"bottom\") !== -1) {\n return \"bottom\";\n } else if (placement.indexOf(\"top\") !== -1) {\n return \"top\";\n } else if (placement.indexOf(\"left\") !== -1) {\n return \"left\";\n } else if (placement.indexOf(\"right\") !== -1) {\n return \"right\";\n }\n return \"bottom\";\n }\n\n private get content(): HTMLElement {\n if (!this._content) {\n this._content = this.firstElementChild as HTMLElement;\n this._content.setAttribute(\"data-popper-content\", \"\");\n }\n return this._content;\n }\n\n private addTargetClassForOpen(target: HTMLElement): void {\n if (target) {\n target.classList.add(targetClassOpen);\n }\n }\n\n private removeTargetClassForOpen(target: HTMLElement): void {\n if (target) {\n target.classList.remove(targetClassOpen);\n }\n }\n\n private findNextFocusableAfter(\n trigger: HTMLElement | undefined | null,\n root: HTMLElement | undefined | null,\n forward: boolean,\n ): HTMLElement | null {\n if (!trigger) return null;\n\n const effectiveRoot = root ?? document.body;\n\n const walker = document.createTreeWalker(effectiveRoot, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n const el = node as HTMLElement;\n\n return el.tabIndex >= 0 && !el.hidden && el.offsetParent !== null\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP;\n },\n });\n\n walker.currentNode = trigger;\n\n const nextNode = forward ? walker.nextNode() : walker.previousNode();\n\n return nextNode as HTMLElement | null;\n }\n}\n\nPopover.ensureDefined();\n"],"mappings":";;;ACIA,IAAM,IAAqB,GACrB,IAAkB,mBAEpB,IAAY,GACV,WACF,KACO,IAkBU,IAArB,MAAqB,UAAgB,YAAY;;yCAOhB,uBAAuB,GAAQ,eAE5C,yBAMQ,wBAoMI;AACxB,QAAK,OAAO,CAAC,KAAK;uBAGI;AACtB,QAAK,OAAO;uBAGU;AACtB,QAAK,OAAO;kCAyGgB,MAAiB;GAC7C,IAAM,IAAS,EAAM;AACrB,IACI,EAAE,aAAkB,gBACpB,KAAK,cAAc,QACnB,KAAK,iBAAiB,QACrB,CAAC,KAAK,WAAW,SAAS,EAAO,IAAI,CAAC,KAAK,cAAc,SAAS,EAAO,KAE1E,KAAK,MAAM;8BAIS,MAAyB;AACjD,OAAI,EAAM,QAAQ,MACd;GAGJ,IAAM,IAAQ,EAAM,UAChB,IAAwC,MAEtC,IAAS,EAAM,QACf,IAAO,KAAK;AAElB,GAAI,aAAkB,eAAe,MACjC,IAAoB,KAAK,uBAA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AED,MADA,KAAK,OAAO,MAAM,SAAS,GAC3B,EAAI,MAAM,YAAY;AACtB;KAEJ,KAAK;AAED,MADA,KAAK,OAAO,MAAM,QAAQ,GAC1B,EAAI,MAAM,YAAY;AACtB;KAEJ,KAAK;AAED,MADA,KAAK,OAAO,MAAM,OAAO,GACzB,EAAI,MAAM,YAAY;AACtB;;;;;CAOpB,gBAAwB,GAAoC;AAUxD,SATI,EAAU,QAAQ,SAAS,KAAK,KAEzB,EAAU,QAAQ,MAAM,KAAK,KAE7B,EAAU,QAAQ,OAAO,KAAK,KAE9B,EAAU,QAAQ,QAAQ,KAAK,KAGnC,WAFI,UAFA,SAFA,QAFA;;CAWf,IAAY,UAAuB;AAK/B,SAJK,KAAK,aACN,KAAK,WAAW,KAAK,mBACrB,KAAK,SAAS,aAAa,uBAAuB,GAAG,GAElD,KAAK;;CAGhB,sBAA8B,GAA2B;AACrD,EAAI,KACA,EAAO,UAAU,IAAI,EAAgB;;CAI7C,yBAAiC,GAA2B;AACxD,EAAI,KACA,EAAO,UAAU,OAAO,EAAgB;;CAIhD,uBACI,GACA,GACA,GACkB;AAClB,MAAI,CAAC,EAAS,QAAO;EAErB,IAAM,IAAgB,KAAQ,SAAS,MAEjC,IAAS,SAAS,iBAAiB,GAAe,WAAW,cAAc,EAC7E,WAAW,GAAM;GACb,IAAM,IAAK;AAEX,UAAO,EAAG,YAAY,KAAK,CAAC,EAAG,UAAU,EAAG,iBAAiB,OACvD,WAAW,gBACX,WAAW;KAExB,CAAC;AAMF,SAJA,EAAO,cAAc,GAEJ,IAAU,EAAO,UAAU,GAAG,EAAO,cAAc;;;AAM5E,EAAQ,eAAe"}
|
|
@@ -1,93 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@cypress/vite-dev-server@7.
|
|
2
|
+
"@cypress/vite-dev-server@7.3.2": {
|
|
3
3
|
"licenses": "MIT",
|
|
4
4
|
"repository": "https://github.com/cypress-io/cypress",
|
|
5
5
|
"licenseUrl": "https://github.com/cypress-io/cypress/tree/develop/npm/vite-dev-server#readme"
|
|
6
6
|
},
|
|
7
|
-
"@eslint/js@9.34.0": {
|
|
8
|
-
"licenses": "MIT",
|
|
9
|
-
"repository": "https://github.com/eslint/eslint",
|
|
10
|
-
"licenseUrl": "https://unpkg.com/@eslint/js@9.34.0/LICENSE"
|
|
11
|
-
},
|
|
12
7
|
"@popperjs/core@2.11.8": {
|
|
13
8
|
"licenses": "MIT",
|
|
14
9
|
"repository": "https://github.com/popperjs/popper-core",
|
|
15
10
|
"licenseUrl": "https://unpkg.com/@popperjs/core@2.11.8/LICENSE.md"
|
|
16
11
|
},
|
|
17
|
-
"@
|
|
12
|
+
"@tsdown/css@0.21.7": {
|
|
18
13
|
"licenses": "MIT",
|
|
19
|
-
"repository": "https://github.com/
|
|
20
|
-
"licenseUrl": "https://unpkg.com/@
|
|
14
|
+
"repository": "https://github.com/rolldown/tsdown",
|
|
15
|
+
"licenseUrl": "https://unpkg.com/@tsdown/css@0.21.7/LICENSE"
|
|
21
16
|
},
|
|
22
|
-
"@types/node@
|
|
17
|
+
"@types/node@25.5.2": {
|
|
23
18
|
"licenses": "MIT",
|
|
24
19
|
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
|
25
|
-
"licenseUrl": "https://unpkg.com/@types/node@
|
|
20
|
+
"licenseUrl": "https://unpkg.com/@types/node@25.5.2/LICENSE"
|
|
26
21
|
},
|
|
27
22
|
"@types/postcss-prefix-selector@1.16.3": {
|
|
28
23
|
"licenses": "MIT",
|
|
29
24
|
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
|
30
25
|
"licenseUrl": "https://unpkg.com/@types/postcss-prefix-selector@1.16.3/LICENSE"
|
|
31
26
|
},
|
|
32
|
-
"@
|
|
27
|
+
"@types/yargs@17.0.35": {
|
|
33
28
|
"licenses": "MIT",
|
|
34
|
-
"repository": "https://github.com/
|
|
35
|
-
"licenseUrl": "https://unpkg.com/@
|
|
36
|
-
},
|
|
37
|
-
"@typescript-eslint/parser@8.41.0": {
|
|
38
|
-
"licenses": "MIT",
|
|
39
|
-
"repository": "https://github.com/typescript-eslint/typescript-eslint",
|
|
40
|
-
"licenseUrl": "https://unpkg.com/@typescript-eslint/parser@8.41.0/LICENSE"
|
|
29
|
+
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
|
30
|
+
"licenseUrl": "https://unpkg.com/@types/yargs@17.0.35/LICENSE"
|
|
41
31
|
},
|
|
42
|
-
"@vitest/coverage-v8@4.
|
|
32
|
+
"@vitest/coverage-v8@4.1.2": {
|
|
43
33
|
"licenses": "MIT",
|
|
44
34
|
"repository": "https://github.com/vitest-dev/vitest",
|
|
45
|
-
"licenseUrl": "https://unpkg.com/@vitest/coverage-v8@4.
|
|
35
|
+
"licenseUrl": "https://unpkg.com/@vitest/coverage-v8@4.1.2/LICENSE"
|
|
46
36
|
},
|
|
47
|
-
"@vitest/ui@4.
|
|
37
|
+
"@vitest/ui@4.1.2": {
|
|
48
38
|
"licenses": "MIT",
|
|
49
39
|
"repository": "https://github.com/vitest-dev/vitest",
|
|
50
|
-
"licenseUrl": "https://unpkg.com/@vitest/ui@4.
|
|
40
|
+
"licenseUrl": "https://unpkg.com/@vitest/ui@4.1.2/LICENSE"
|
|
51
41
|
},
|
|
52
|
-
"axe-core@4.
|
|
42
|
+
"axe-core@4.11.2": {
|
|
53
43
|
"licenses": "MPL-2.0",
|
|
54
44
|
"repository": "https://github.com/dequelabs/axe-core",
|
|
55
|
-
"licenseUrl": "https://unpkg.com/axe-core@4.
|
|
45
|
+
"licenseUrl": "https://unpkg.com/axe-core@4.11.2/LICENSE"
|
|
56
46
|
},
|
|
57
47
|
"cypress-axe@1.7.0": {
|
|
58
48
|
"licenses": "MIT",
|
|
59
49
|
"repository": "https://github.com/component-driven/cypress-axe",
|
|
60
50
|
"licenseUrl": "https://unpkg.com/cypress-axe@1.7.0/License.md"
|
|
61
51
|
},
|
|
62
|
-
"cypress@15.
|
|
52
|
+
"cypress@15.13.0": {
|
|
63
53
|
"licenses": "MIT",
|
|
64
54
|
"repository": "https://github.com/cypress-io/cypress",
|
|
65
55
|
"licenseUrl": "https://cypress.io"
|
|
66
56
|
},
|
|
67
|
-
"
|
|
68
|
-
"licenses": "MIT",
|
|
69
|
-
"repository": "https://github.com/evanw/esbuild",
|
|
70
|
-
"licenseUrl": "https://unpkg.com/esbuild@0.27.2/LICENSE.md"
|
|
71
|
-
},
|
|
72
|
-
"eslint-config-google@0.14.0": {
|
|
73
|
-
"licenses": "Apache-2.0",
|
|
74
|
-
"repository": "https://github.com/google/eslint-config-google",
|
|
75
|
-
"licenseUrl": "https://unpkg.com/eslint-config-google@0.14.0/LICENSE"
|
|
76
|
-
},
|
|
77
|
-
"eslint-config-prettier@10.1.8": {
|
|
78
|
-
"licenses": "MIT",
|
|
79
|
-
"repository": "https://github.com/prettier/eslint-config-prettier",
|
|
80
|
-
"licenseUrl": "https://unpkg.com/eslint-config-prettier@10.1.8/LICENSE"
|
|
81
|
-
},
|
|
82
|
-
"eslint@9.34.0": {
|
|
83
|
-
"licenses": "MIT",
|
|
84
|
-
"repository": "https://github.com/eslint/eslint",
|
|
85
|
-
"licenseUrl": "https://unpkg.com/eslint@9.34.0/LICENSE"
|
|
86
|
-
},
|
|
87
|
-
"github-markdown-css@5.8.1": {
|
|
57
|
+
"github-markdown-css@5.9.0": {
|
|
88
58
|
"licenses": "MIT",
|
|
89
59
|
"repository": "https://github.com/sindresorhus/github-markdown-css",
|
|
90
|
-
"licenseUrl": "https://unpkg.com/github-markdown-css@5.
|
|
60
|
+
"licenseUrl": "https://unpkg.com/github-markdown-css@5.9.0/license"
|
|
91
61
|
},
|
|
92
62
|
"highlight.js@11.11.1": {
|
|
93
63
|
"licenses": "BSD-3-Clause",
|
|
@@ -99,95 +69,75 @@
|
|
|
99
69
|
"repository": "https://github.com/davidparsson/junit-report-builder",
|
|
100
70
|
"licenseUrl": "https://unpkg.com/junit-report-builder@5.1.1/LICENSE"
|
|
101
71
|
},
|
|
102
|
-
"lint-staged@16.
|
|
72
|
+
"lint-staged@16.4.0": {
|
|
103
73
|
"licenses": "MIT",
|
|
104
74
|
"repository": "https://github.com/lint-staged/lint-staged",
|
|
105
|
-
"licenseUrl": "https://unpkg.com/lint-staged@16.
|
|
75
|
+
"licenseUrl": "https://unpkg.com/lint-staged@16.4.0/LICENSE"
|
|
106
76
|
},
|
|
107
|
-
"marked@
|
|
77
|
+
"marked@18.0.0": {
|
|
108
78
|
"licenses": "MIT",
|
|
109
79
|
"repository": "https://github.com/markedjs/marked",
|
|
110
|
-
"licenseUrl": "https://unpkg.com/marked@
|
|
80
|
+
"licenseUrl": "https://unpkg.com/marked@18.0.0/LICENSE.md"
|
|
111
81
|
},
|
|
112
|
-
"
|
|
82
|
+
"oxfmt@0.44.0": {
|
|
113
83
|
"licenses": "MIT",
|
|
114
|
-
"repository": "https://github.com/
|
|
115
|
-
"licenseUrl": "https://unpkg.com/
|
|
84
|
+
"repository": "https://github.com/oxc-project/oxc",
|
|
85
|
+
"licenseUrl": "https://unpkg.com/oxfmt@0.44.0/LICENSE"
|
|
116
86
|
},
|
|
117
|
-
"
|
|
87
|
+
"oxlint-tsgolint@0.20.0": {
|
|
118
88
|
"licenses": "MIT",
|
|
119
|
-
"repository": "https://github.com/
|
|
120
|
-
"licenseUrl": "https://unpkg.com/
|
|
89
|
+
"repository": "https://github.com/oxc-project/tsgolint",
|
|
90
|
+
"licenseUrl": "https://unpkg.com/oxlint-tsgolint@0.20.0/LICENSE"
|
|
121
91
|
},
|
|
122
|
-
"
|
|
92
|
+
"oxlint@1.59.0": {
|
|
123
93
|
"licenses": "MIT",
|
|
124
|
-
"repository": "https://github.com/
|
|
125
|
-
"licenseUrl": "https://unpkg.com/
|
|
94
|
+
"repository": "https://github.com/oxc-project/oxc",
|
|
95
|
+
"licenseUrl": "https://unpkg.com/oxlint@1.59.0/LICENSE"
|
|
126
96
|
},
|
|
127
|
-
"
|
|
128
|
-
"licenses": "MIT",
|
|
129
|
-
"repository": "https://github.com/sindresorhus/resolve-pkg",
|
|
130
|
-
"licenseUrl": "https://unpkg.com/resolve-pkg@2.0.0/license"
|
|
131
|
-
},
|
|
132
|
-
"sass@1.91.0": {
|
|
133
|
-
"licenses": "MIT",
|
|
134
|
-
"repository": "https://github.com/sass/dart-sass",
|
|
135
|
-
"licenseUrl": "https://unpkg.com/sass@1.91.0/LICENSE"
|
|
136
|
-
},
|
|
137
|
-
"stylelint-config-recommended-scss@16.0.0": {
|
|
97
|
+
"postcss-prefix-selector@2.1.1": {
|
|
138
98
|
"licenses": "MIT",
|
|
139
|
-
"repository": "https://github.com/
|
|
140
|
-
"licenseUrl": "https://unpkg.com/
|
|
99
|
+
"repository": "https://github.com/RadValentin/postcss-prefix-selector",
|
|
100
|
+
"licenseUrl": "https://unpkg.com/postcss-prefix-selector@2.1.1/LICENSE"
|
|
141
101
|
},
|
|
142
|
-
"
|
|
102
|
+
"postcss@8.5.8": {
|
|
143
103
|
"licenses": "MIT",
|
|
144
|
-
"repository": "https://github.com/
|
|
145
|
-
"licenseUrl": "https://unpkg.com/
|
|
104
|
+
"repository": "https://github.com/postcss/postcss",
|
|
105
|
+
"licenseUrl": "https://unpkg.com/postcss@8.5.8/LICENSE"
|
|
146
106
|
},
|
|
147
|
-
"
|
|
107
|
+
"resolve-pkg@3.0.1": {
|
|
148
108
|
"licenses": "MIT",
|
|
149
|
-
"repository": "https://github.com/
|
|
150
|
-
"licenseUrl": "https://unpkg.com/
|
|
109
|
+
"repository": "https://github.com/sindresorhus/resolve-pkg",
|
|
110
|
+
"licenseUrl": "https://unpkg.com/resolve-pkg@3.0.1/license"
|
|
151
111
|
},
|
|
152
|
-
"
|
|
112
|
+
"sass@1.99.0": {
|
|
153
113
|
"licenses": "MIT",
|
|
154
|
-
"repository": "https://github.com/
|
|
155
|
-
"licenseUrl": "https://unpkg.com/
|
|
114
|
+
"repository": "https://github.com/sass/dart-sass",
|
|
115
|
+
"licenseUrl": "https://unpkg.com/sass@1.99.0/LICENSE"
|
|
156
116
|
},
|
|
157
|
-
"
|
|
117
|
+
"tsdown@0.21.7": {
|
|
158
118
|
"licenses": "MIT",
|
|
159
|
-
"repository": "https://github.com/
|
|
160
|
-
"licenseUrl": "https://unpkg.com/
|
|
119
|
+
"repository": "https://github.com/rolldown/tsdown",
|
|
120
|
+
"licenseUrl": "https://unpkg.com/tsdown@0.21.7/LICENSE"
|
|
161
121
|
},
|
|
162
|
-
"turbo@2.
|
|
122
|
+
"turbo@2.9.4": {
|
|
163
123
|
"licenses": "MIT",
|
|
164
124
|
"repository": "https://github.com/vercel/turborepo",
|
|
165
|
-
"licenseUrl": "https://unpkg.com/turbo@2.
|
|
125
|
+
"licenseUrl": "https://unpkg.com/turbo@2.9.4/LICENSE"
|
|
166
126
|
},
|
|
167
|
-
"typescript
|
|
168
|
-
"licenses": "MIT",
|
|
169
|
-
"repository": "https://github.com/typescript-eslint/typescript-eslint",
|
|
170
|
-
"licenseUrl": "https://unpkg.com/typescript-eslint@8.41.0/LICENSE"
|
|
171
|
-
},
|
|
172
|
-
"typescript@5.9.3": {
|
|
127
|
+
"typescript@6.0.2": {
|
|
173
128
|
"licenses": "Apache-2.0",
|
|
174
129
|
"repository": "https://github.com/microsoft/TypeScript",
|
|
175
|
-
"licenseUrl": "https://unpkg.com/typescript@
|
|
176
|
-
},
|
|
177
|
-
"vite-tsconfig-paths@5.1.4": {
|
|
178
|
-
"licenses": "MIT",
|
|
179
|
-
"repository": "https://github.com/aleclarson/vite-tsconfig-paths",
|
|
180
|
-
"licenseUrl": "https://unpkg.com/vite-tsconfig-paths@5.1.4/LICENSE"
|
|
130
|
+
"licenseUrl": "https://unpkg.com/typescript@6.0.2/LICENSE.txt"
|
|
181
131
|
},
|
|
182
|
-
"vite@
|
|
132
|
+
"vite@8.0.5": {
|
|
183
133
|
"licenses": "MIT",
|
|
184
134
|
"repository": "https://github.com/vitejs/vite",
|
|
185
|
-
"licenseUrl": "https://unpkg.com/vite@
|
|
135
|
+
"licenseUrl": "https://unpkg.com/vite@8.0.5/LICENSE.md"
|
|
186
136
|
},
|
|
187
|
-
"vitest@4.
|
|
137
|
+
"vitest@4.1.2": {
|
|
188
138
|
"licenses": "MIT",
|
|
189
139
|
"repository": "https://github.com/vitest-dev/vitest",
|
|
190
|
-
"licenseUrl": "https://unpkg.com/vitest@4.
|
|
140
|
+
"licenseUrl": "https://unpkg.com/vitest@4.1.2/LICENSE.md"
|
|
191
141
|
},
|
|
192
142
|
"yargs@18.0.0": {
|
|
193
143
|
"licenses": "MIT",
|
package/package.json
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cas-smartdesign/popover",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "A popover element which appears next to its target when triggered",
|
|
5
|
-
"main": "dist/popover-with-externals.js",
|
|
6
|
-
"module": "dist/popover.mjs",
|
|
7
|
-
"types": "dist/popover.d.ts",
|
|
8
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@popperjs/core": "^2.11.8"
|
|
11
|
-
},
|
|
12
6
|
"files": [
|
|
13
7
|
"dist",
|
|
14
8
|
"npm-third-party-licenses.json"
|
|
15
9
|
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "dist/popover.mjs",
|
|
12
|
+
"module": "dist/popover.mjs",
|
|
13
|
+
"types": "dist/popover.d.ts",
|
|
16
14
|
"publishConfig": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
15
|
+
"access": "public",
|
|
16
|
+
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@popperjs/core": "^2.11.8"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"@cas-smartdesign/
|
|
22
|
-
"@cas-smartdesign/
|
|
22
|
+
"@cas-smartdesign/element-preview": "^1.1.0",
|
|
23
|
+
"@cas-smartdesign/license-generator": "^1.10.0"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@cas-smartdesign/design-tokens": "^3.0.2"
|
|
27
|
+
},
|
|
28
|
+
"peerDependenciesMeta": {
|
|
29
|
+
"@cas-smartdesign/design-tokens": {
|
|
30
|
+
"optional": true
|
|
31
|
+
}
|
|
23
32
|
},
|
|
24
33
|
"scripts": {
|
|
25
34
|
"version": "pnpm version",
|
package/readme.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
A popover element with SmartDesign look & feel.
|
|
4
4
|
|
|
5
|
+
This element must be used together with the design tokens of SmartDesign.
|
|
6
|
+
For an independent application, make sure to include the @cas-smartdesign/design-tokens package.
|
|
7
|
+
For a web app / web widget, refer to the official documentation about design token usage.
|
|
8
|
+
|
|
5
9
|
## Attributes
|
|
6
10
|
|
|
7
11
|
- `placement`: **_string (default: "auto")_**
|
|
@@ -57,9 +61,9 @@ A popover element with SmartDesign look & feel.
|
|
|
57
61
|
|
|
58
62
|
## Custom events
|
|
59
63
|
|
|
60
|
-
- `open`
|
|
64
|
+
- `sd-popover-open`
|
|
61
65
|
- Dispatched when the popover has opened.
|
|
62
|
-
- `close`
|
|
66
|
+
- `sd-popover-close`
|
|
63
67
|
- Dispatched when the popover has closed.
|
|
64
68
|
|
|
65
69
|
## Adding a child element
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var window;(window||={})["@cas-smartdesign/popover"]=(()=>{var $t=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var qe=Object.prototype.hasOwnProperty;var Ue=(e,t)=>{for(var r in t)$t(e,r,{get:t[r],enumerable:!0})},Xe=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ze(t))!qe.call(e,i)&&i!==r&&$t(e,i,{get:()=>t[i],enumerable:!(o=$e(t,i))||o.enumerable});return e};var Ye=e=>Xe($t({},"__esModule",{value:!0}),e);var _r={};Ue(_r,{default:()=>jt});var E="top",S="bottom",C="right",T="left",Dt="auto",Q=[E,S,C,T],Y="start",at="end",ue="clippingParents",Rt="viewport",dt="popper",de="reference",zt=Q.reduce(function(e,t){return e.concat([t+"-"+Y,t+"-"+at])},[]),Bt=[].concat(Q,[Dt]).reduce(function(e,t){return e.concat([t,t+"-"+Y,t+"-"+at])},[]),Ke="beforeRead",Ge="read",Je="afterRead",Qe="beforeMain",Ze="main",tr="afterMain",er="beforeWrite",rr="write",or="afterWrite",ve=[Ke,Ge,Je,Qe,Ze,tr,er,rr,or];function D(e){return e?(e.nodeName||"").toLowerCase():null}function y(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function F(e){var t=y(e).Element;return e instanceof t||e instanceof Element}function _(e){var t=y(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function vt(e){if(typeof ShadowRoot>"u")return!1;var t=y(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ir(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var o=t.styles[r]||{},i=t.attributes[r]||{},a=t.elements[r];!_(a)||!D(a)||(Object.assign(a.style,o),Object.keys(i).forEach(function(f){var n=i[f];n===!1?a.removeAttribute(f):a.setAttribute(f,n===!0?"":n)}))})}function ar(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(o){var i=t.elements[o],a=t.attributes[o]||{},f=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:r[o]),n=f.reduce(function(s,l){return s[l]="",s},{});!_(i)||!D(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(s){i.removeAttribute(s)}))})}}var he={name:"applyStyles",enabled:!0,phase:"write",fn:ir,effect:ar,requires:["computeStyles"]};function R(e){return e.split("-")[0]}var q=Math.max,nt=Math.min,K=Math.round;function ht(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yt(){return!/^((?!chrome|android).)*safari/i.test(ht())}function I(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var o=e.getBoundingClientRect(),i=1,a=1;t&&_(e)&&(i=e.offsetWidth>0&&K(o.width)/e.offsetWidth||1,a=e.offsetHeight>0&&K(o.height)/e.offsetHeight||1);var f=F(e)?y(e):window,n=f.visualViewport,s=!yt()&&r,l=(o.left+(s&&n?n.offsetLeft:0))/i,p=(o.top+(s&&n?n.offsetTop:0))/a,v=o.width/i,b=o.height/a;return{width:v,height:b,top:p,right:l+v,bottom:p+b,left:l,x:l,y:p}}function st(e){var t=I(e),r=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:o}}function Ot(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&vt(r)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function j(e){return y(e).getComputedStyle(e)}function qt(e){return["table","td","th"].indexOf(D(e))>=0}function M(e){return((F(e)?e.ownerDocument:e.document)||window.document).documentElement}function G(e){return D(e)==="html"?e:e.assignedSlot||e.parentNode||(vt(e)?e.host:null)||M(e)}function ge(e){return!_(e)||j(e).position==="fixed"?null:e.offsetParent}function nr(e){var t=/firefox/i.test(ht()),r=/Trident/i.test(ht());if(r&&_(e)){var o=j(e);if(o.position==="fixed")return null}var i=G(e);for(vt(i)&&(i=i.host);_(i)&&["html","body"].indexOf(D(i))<0;){var a=j(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function U(e){for(var t=y(e),r=ge(e);r&&qt(r)&&j(r).position==="static";)r=ge(r);return r&&(D(r)==="html"||D(r)==="body"&&j(r).position==="static")?t:r||nr(e)||t}function pt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ft(e,t,r){return q(e,nt(t,r))}function be(e,t,r){var o=ft(e,t,r);return o>r?r:o}function Et(){return{top:0,right:0,bottom:0,left:0}}function At(e){return Object.assign({},Et(),e)}function Pt(e,t){return t.reduce(function(r,o){return r[o]=e,r},{})}var sr=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,At(typeof t!="number"?t:Pt(t,Q))};function pr(e){var t,r=e.state,o=e.name,i=e.options,a=r.elements.arrow,f=r.modifiersData.popperOffsets,n=R(r.placement),s=pt(n),l=[T,C].indexOf(n)>=0,p=l?"height":"width";if(!(!a||!f)){var v=sr(i.padding,r),b=st(a),c=s==="y"?E:T,w=s==="y"?S:C,d=r.rects.reference[p]+r.rects.reference[s]-f[s]-r.rects.popper[p],u=f[s]-r.rects.reference[s],x=U(a),A=x?s==="y"?x.clientHeight||0:x.clientWidth||0:0,P=d/2-u/2,m=v[c],h=A-b[p]-v[w],g=A/2-b[p]/2+P,O=ft(m,g,h),B=s;r.modifiersData[o]=(t={},t[B]=O,t.centerOffset=O-g,t)}}function fr(e){var t=e.state,r=e.options,o=r.element,i=o===void 0?"[data-popper-arrow]":o;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Ot(t.elements.popper,i)&&(t.elements.arrow=i))}var xe={name:"arrow",enabled:!0,phase:"main",fn:pr,effect:fr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function V(e){return e.split("-")[1]}var lr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function cr(e,t){var r=e.x,o=e.y,i=t.devicePixelRatio||1;return{x:K(r*i)/i||0,y:K(o*i)/i||0}}function we(e){var t,r=e.popper,o=e.popperRect,i=e.placement,a=e.variation,f=e.offsets,n=e.position,s=e.gpuAcceleration,l=e.adaptive,p=e.roundOffsets,v=e.isFixed,b=f.x,c=b===void 0?0:b,w=f.y,d=w===void 0?0:w,u=typeof p=="function"?p({x:c,y:d}):{x:c,y:d};c=u.x,d=u.y;var x=f.hasOwnProperty("x"),A=f.hasOwnProperty("y"),P=T,m=E,h=window;if(l){var g=U(r),O="clientHeight",B="clientWidth";if(g===y(r)&&(g=M(r),j(g).position!=="static"&&n==="absolute"&&(O="scrollHeight",B="scrollWidth")),g=g,i===E||(i===T||i===C)&&a===at){m=S;var k=v&&g===h&&h.visualViewport?h.visualViewport.height:g[O];d-=k-o.height,d*=s?1:-1}if(i===T||(i===E||i===S)&&a===at){P=C;var L=v&&g===h&&h.visualViewport?h.visualViewport.width:g[B];c-=L-o.width,c*=s?1:-1}}var N=Object.assign({position:n},l&&lr),$=p===!0?cr({x:c,y:d},y(r)):{x:c,y:d};if(c=$.x,d=$.y,s){var W;return Object.assign({},N,(W={},W[m]=A?"0":"",W[P]=x?"0":"",W.transform=(h.devicePixelRatio||1)<=1?"translate("+c+"px, "+d+"px)":"translate3d("+c+"px, "+d+"px, 0)",W))}return Object.assign({},N,(t={},t[m]=A?d+"px":"",t[P]=x?c+"px":"",t.transform="",t))}function mr(e){var t=e.state,r=e.options,o=r.gpuAcceleration,i=o===void 0?!0:o,a=r.adaptive,f=a===void 0?!0:a,n=r.roundOffsets,s=n===void 0?!0:n,l={placement:R(t.placement),variation:V(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,we(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:f,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,we(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var ye={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:mr,data:{}};var Mt={passive:!0};function ur(e){var t=e.state,r=e.instance,o=e.options,i=o.scroll,a=i===void 0?!0:i,f=o.resize,n=f===void 0?!0:f,s=y(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(p){p.addEventListener("scroll",r.update,Mt)}),n&&s.addEventListener("resize",r.update,Mt),function(){a&&l.forEach(function(p){p.removeEventListener("scroll",r.update,Mt)}),n&&s.removeEventListener("resize",r.update,Mt)}}var Oe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ur,data:{}};var dr={left:"right",right:"left",bottom:"top",top:"bottom"};function gt(e){return e.replace(/left|right|bottom|top/g,function(t){return dr[t]})}var vr={start:"end",end:"start"};function Nt(e){return e.replace(/start|end/g,function(t){return vr[t]})}function lt(e){var t=y(e),r=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:r,scrollTop:o}}function ct(e){return I(M(e)).left+lt(e).scrollLeft}function Ut(e,t){var r=y(e),o=M(e),i=r.visualViewport,a=o.clientWidth,f=o.clientHeight,n=0,s=0;if(i){a=i.width,f=i.height;var l=yt();(l||!l&&t==="fixed")&&(n=i.offsetLeft,s=i.offsetTop)}return{width:a,height:f,x:n+ct(e),y:s}}function Xt(e){var t,r=M(e),o=lt(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),f=q(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),n=-o.scrollLeft+ct(e),s=-o.scrollTop;return j(i||r).direction==="rtl"&&(n+=q(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:f,x:n,y:s}}function mt(e){var t=j(e),r=t.overflow,o=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+o)}function Wt(e){return["html","body","#document"].indexOf(D(e))>=0?e.ownerDocument.body:_(e)&&mt(e)?e:Wt(G(e))}function Z(e,t){var r;t===void 0&&(t=[]);var o=Wt(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=y(o),f=i?[a].concat(a.visualViewport||[],mt(o)?o:[]):o,n=t.concat(f);return i?n:n.concat(Z(G(f)))}function bt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function hr(e,t){var r=I(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function Ee(e,t,r){return t===Rt?bt(Ut(e,r)):F(t)?hr(t,r):bt(Xt(M(e)))}function gr(e){var t=Z(G(e)),r=["absolute","fixed"].indexOf(j(e).position)>=0,o=r&&_(e)?U(e):e;return F(o)?t.filter(function(i){return F(i)&&Ot(i,o)&&D(i)!=="body"}):[]}function Yt(e,t,r,o){var i=t==="clippingParents"?gr(e):[].concat(t),a=[].concat(i,[r]),f=a[0],n=a.reduce(function(s,l){var p=Ee(e,l,o);return s.top=q(p.top,s.top),s.right=nt(p.right,s.right),s.bottom=nt(p.bottom,s.bottom),s.left=q(p.left,s.left),s},Ee(e,f,o));return n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function Tt(e){var t=e.reference,r=e.element,o=e.placement,i=o?R(o):null,a=o?V(o):null,f=t.x+t.width/2-r.width/2,n=t.y+t.height/2-r.height/2,s;switch(i){case E:s={x:f,y:t.y-r.height};break;case S:s={x:f,y:t.y+t.height};break;case C:s={x:t.x+t.width,y:n};break;case T:s={x:t.x-r.width,y:n};break;default:s={x:t.x,y:t.y}}var l=i?pt(i):null;if(l!=null){var p=l==="y"?"height":"width";switch(a){case Y:s[l]=s[l]-(t[p]/2-r[p]/2);break;case at:s[l]=s[l]+(t[p]/2-r[p]/2);break;default:}}return s}function X(e,t){t===void 0&&(t={});var r=t,o=r.placement,i=o===void 0?e.placement:o,a=r.strategy,f=a===void 0?e.strategy:a,n=r.boundary,s=n===void 0?ue:n,l=r.rootBoundary,p=l===void 0?Rt:l,v=r.elementContext,b=v===void 0?dt:v,c=r.altBoundary,w=c===void 0?!1:c,d=r.padding,u=d===void 0?0:d,x=At(typeof u!="number"?u:Pt(u,Q)),A=b===dt?de:dt,P=e.rects.popper,m=e.elements[w?A:b],h=Yt(F(m)?m:m.contextElement||M(e.elements.popper),s,p,f),g=I(e.elements.reference),O=Tt({reference:g,element:P,strategy:"absolute",placement:i}),B=bt(Object.assign({},P,O)),k=b===dt?B:g,L={top:h.top-k.top+x.top,bottom:k.bottom-h.bottom+x.bottom,left:h.left-k.left+x.left,right:k.right-h.right+x.right},N=e.modifiersData.offset;if(b===dt&&N){var $=N[i];Object.keys(L).forEach(function(W){var tt=[C,S].indexOf(W)>=0?1:-1,et=[E,S].indexOf(W)>=0?"y":"x";L[W]+=$[et]*tt})}return L}function Kt(e,t){t===void 0&&(t={});var r=t,o=r.placement,i=r.boundary,a=r.rootBoundary,f=r.padding,n=r.flipVariations,s=r.allowedAutoPlacements,l=s===void 0?Bt:s,p=V(o),v=p?n?zt:zt.filter(function(w){return V(w)===p}):Q,b=v.filter(function(w){return l.indexOf(w)>=0});b.length===0&&(b=v);var c=b.reduce(function(w,d){return w[d]=X(e,{placement:d,boundary:i,rootBoundary:a,padding:f})[R(d)],w},{});return Object.keys(c).sort(function(w,d){return c[w]-c[d]})}function br(e){if(R(e)===Dt)return[];var t=gt(e);return[Nt(e),t,Nt(t)]}function xr(e){var t=e.state,r=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var i=r.mainAxis,a=i===void 0?!0:i,f=r.altAxis,n=f===void 0?!0:f,s=r.fallbackPlacements,l=r.padding,p=r.boundary,v=r.rootBoundary,b=r.altBoundary,c=r.flipVariations,w=c===void 0?!0:c,d=r.allowedAutoPlacements,u=t.options.placement,x=R(u),A=x===u,P=s||(A||!w?[gt(u)]:br(u)),m=[u].concat(P).reduce(function(ut,J){return ut.concat(R(J)===Dt?Kt(t,{placement:J,boundary:p,rootBoundary:v,padding:l,flipVariations:w,allowedAutoPlacements:d}):J)},[]),h=t.rects.reference,g=t.rects.popper,O=new Map,B=!0,k=m[0],L=0;L<m.length;L++){var N=m[L],$=R(N),W=V(N)===Y,tt=[E,S].indexOf($)>=0,et=tt?"width":"height",H=X(t,{placement:N,boundary:p,rootBoundary:v,altBoundary:b,padding:l}),z=tt?W?C:T:W?S:E;h[et]>g[et]&&(z=gt(z));var Ct=gt(z),rt=[];if(a&&rt.push(H[$]<=0),n&&rt.push(H[z]<=0,H[Ct]<=0),rt.every(function(ut){return ut})){k=N,B=!1;break}O.set(N,rt)}if(B)for(var Lt=w?3:1,Ht=function(J){var wt=m.find(function(_t){var ot=O.get(_t);if(ot)return ot.slice(0,J).every(function(Ft){return Ft})});if(wt)return k=wt,"break"},xt=Lt;xt>0;xt--){var St=Ht(xt);if(St==="break")break}t.placement!==k&&(t.modifiersData[o]._skip=!0,t.placement=k,t.reset=!0)}}var Ae={name:"flip",enabled:!0,phase:"main",fn:xr,requiresIfExists:["offset"],data:{_skip:!1}};function Pe(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Te(e){return[E,C,S,T].some(function(t){return e[t]>=0})}function wr(e){var t=e.state,r=e.name,o=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,f=X(t,{elementContext:"reference"}),n=X(t,{altBoundary:!0}),s=Pe(f,o),l=Pe(n,i,a),p=Te(s),v=Te(l);t.modifiersData[r]={referenceClippingOffsets:s,popperEscapeOffsets:l,isReferenceHidden:p,hasPopperEscaped:v},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":v})}var Ce={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wr};function yr(e,t,r){var o=R(e),i=[T,E].indexOf(o)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,f=a[0],n=a[1];return f=f||0,n=(n||0)*i,[T,C].indexOf(o)>=0?{x:n,y:f}:{x:f,y:n}}function Or(e){var t=e.state,r=e.options,o=e.name,i=r.offset,a=i===void 0?[0,0]:i,f=Bt.reduce(function(p,v){return p[v]=yr(v,t.rects,a),p},{}),n=f[t.placement],s=n.x,l=n.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=l),t.modifiersData[o]=f}var Le={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Or};function Er(e){var t=e.state,r=e.name;t.modifiersData[r]=Tt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Se={name:"popperOffsets",enabled:!0,phase:"read",fn:Er,data:{}};function Gt(e){return e==="x"?"y":"x"}function Ar(e){var t=e.state,r=e.options,o=e.name,i=r.mainAxis,a=i===void 0?!0:i,f=r.altAxis,n=f===void 0?!1:f,s=r.boundary,l=r.rootBoundary,p=r.altBoundary,v=r.padding,b=r.tether,c=b===void 0?!0:b,w=r.tetherOffset,d=w===void 0?0:w,u=X(t,{boundary:s,rootBoundary:l,padding:v,altBoundary:p}),x=R(t.placement),A=V(t.placement),P=!A,m=pt(x),h=Gt(m),g=t.modifiersData.popperOffsets,O=t.rects.reference,B=t.rects.popper,k=typeof d=="function"?d(Object.assign({},t.rects,{placement:t.placement})):d,L=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,$={x:0,y:0};if(g){if(a){var W,tt=m==="y"?E:T,et=m==="y"?S:C,H=m==="y"?"height":"width",z=g[m],Ct=z+u[tt],rt=z-u[et],Lt=c?-B[H]/2:0,Ht=A===Y?O[H]:B[H],xt=A===Y?-B[H]:-O[H],St=t.elements.arrow,ut=c&&St?st(St):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Et(),wt=J[tt],_t=J[et],ot=ft(0,O[H],ut[H]),Ft=P?O[H]/2-Lt-ot-wt-L.mainAxis:Ht-ot-wt-L.mainAxis,We=P?-O[H]/2+Lt+ot+_t+L.mainAxis:xt+ot+_t+L.mainAxis,It=t.elements.arrow&&U(t.elements.arrow),je=It?m==="y"?It.clientTop||0:It.clientLeft||0:0,ie=(W=N?.[m])!=null?W:0,He=z+Ft-ie-je,Fe=z+We-ie,ae=ft(c?nt(Ct,He):Ct,z,c?q(rt,Fe):rt);g[m]=ae,$[m]=ae-z}if(n){var ne,Ie=m==="x"?E:T,Ve=m==="x"?S:C,it=g[h],kt=h==="y"?"height":"width",se=it+u[Ie],pe=it-u[Ve],Vt=[E,T].indexOf(x)!==-1,fe=(ne=N?.[h])!=null?ne:0,le=Vt?se:it-O[kt]-B[kt]-fe+L.altAxis,ce=Vt?it+O[kt]+B[kt]-fe-L.altAxis:pe,me=c&&Vt?be(le,it,ce):ft(c?le:se,it,c?ce:pe);g[h]=me,$[h]=me-it}t.modifiersData[o]=$}}var _e={name:"preventOverflow",enabled:!0,phase:"main",fn:Ar,requiresIfExists:["offset"]};function Jt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Qt(e){return e===y(e)||!_(e)?lt(e):Jt(e)}function Pr(e){var t=e.getBoundingClientRect(),r=K(t.width)/e.offsetWidth||1,o=K(t.height)/e.offsetHeight||1;return r!==1||o!==1}function Zt(e,t,r){r===void 0&&(r=!1);var o=_(t),i=_(t)&&Pr(t),a=M(t),f=I(e,i,r),n={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!r)&&((D(t)!=="body"||mt(a))&&(n=Qt(t)),_(t)?(s=I(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):a&&(s.x=ct(a))),{x:f.left+n.scrollLeft-s.x,y:f.top+n.scrollTop-s.y,width:f.width,height:f.height}}function Tr(e){var t=new Map,r=new Set,o=[];e.forEach(function(a){t.set(a.name,a)});function i(a){r.add(a.name);var f=[].concat(a.requires||[],a.requiresIfExists||[]);f.forEach(function(n){if(!r.has(n)){var s=t.get(n);s&&i(s)}}),o.push(a)}return e.forEach(function(a){r.has(a.name)||i(a)}),o}function te(e){var t=Tr(e);return ve.reduce(function(r,o){return r.concat(t.filter(function(i){return i.phase===o}))},[])}function ee(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function re(e){var t=e.reduce(function(r,o){var i=r[o.name];return r[o.name]=i?Object.assign({},i,o,{options:Object.assign({},i.options,o.options),data:Object.assign({},i.data,o.data)}):o,r},{});return Object.keys(t).map(function(r){return t[r]})}var ke={placement:"bottom",modifiers:[],strategy:"absolute"};function De(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Re(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,o=r===void 0?[]:r,i=t.defaultOptions,a=i===void 0?ke:i;return function(n,s,l){l===void 0&&(l=a);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},ke,a),modifiersData:{},elements:{reference:n,popper:s},attributes:{},styles:{}},v=[],b=!1,c={state:p,setOptions:function(x){var A=typeof x=="function"?x(p.options):x;d(),p.options=Object.assign({},a,p.options,A),p.scrollParents={reference:F(n)?Z(n):n.contextElement?Z(n.contextElement):[],popper:Z(s)};var P=te(re([].concat(o,p.options.modifiers)));return p.orderedModifiers=P.filter(function(m){return m.enabled}),w(),c.update()},forceUpdate:function(){if(!b){var x=p.elements,A=x.reference,P=x.popper;if(De(A,P)){p.rects={reference:Zt(A,U(P),p.options.strategy==="fixed"),popper:st(P)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(L){return p.modifiersData[L.name]=Object.assign({},L.data)});for(var m=0;m<p.orderedModifiers.length;m++){if(p.reset===!0){p.reset=!1,m=-1;continue}var h=p.orderedModifiers[m],g=h.fn,O=h.options,B=O===void 0?{}:O,k=h.name;typeof g=="function"&&(p=g({state:p,options:B,name:k,instance:c})||p)}}}},update:ee(function(){return new Promise(function(u){c.forceUpdate(),u(p)})}),destroy:function(){d(),b=!0}};if(!De(n,s))return c;c.setOptions(l).then(function(u){!b&&l.onFirstUpdate&&l.onFirstUpdate(u)});function w(){p.orderedModifiers.forEach(function(u){var x=u.name,A=u.options,P=A===void 0?{}:A,m=u.effect;if(typeof m=="function"){var h=m({state:p,name:x,instance:c,options:P}),g=function(){};v.push(h||g)}})}function d(){v.forEach(function(u){return u()}),v=[]}return c}}var Cr=[Oe,Se,ye,he,Le,Ae,_e,xe,Ce],oe=Re({defaultModifiers:Cr});var Lr=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="12" viewBox="0 0 24 12">\r
|
|
2
|
-
<path d="M0 0l11.96 12L24 0z" fill="#999" class="arrow-border"/>\r
|
|
3
|
-
<path d="M12 11L1 0h22z" fill="#f2f2f2" class="arrow-background"/>\r
|
|
4
|
-
</svg>\r
|
|
5
|
-
`,Sr=navigator.userAgent.indexOf("Trident")!==-1,Be=1,Me="sd-popover-open",Ne=class extends HTMLElement{constructor(){super(...arguments),this._open=!1,this._firstUpdated=!1,this.toggle=()=>{this.open=!this.open},this.show=()=>{this.open=!0},this.hide=()=>{this.open=!1},this.hideIfExternalTarget=t=>{let r=t.target;(!(r instanceof HTMLElement)||!this._container.contains(r)&&!this.targetElement.contains(r))&&this.hide()},this.handleTabKeyDown=t=>{if(t.key!=="Tab")return;let r=t.shiftKey,o=null,i=t.target,a=this.content;i instanceof HTMLElement&&a&&(o=this.findNextFocusableAfter(i,a,!r)),!o&&(t.preventDefault(),this.open=!1,this.findNextFocusableAfter(this.targetElement,null,!r)?.focus())}}get triggerType(){return this.getAttribute("trigger-type")}set triggerType(t){t?this.setAttribute("trigger-type",t):this.removeAttribute("trigger-type")}get arrowSvg(){return this.getAttribute("arrow-svg")||Lr}set arrowSvg(t){t?this.setAttribute("arrow-svg",t):this.removeAttribute("arrow-svg"),this._arrow&&(this._arrow.innerHTML=this.arrowSvg)}get placement(){return this.getAttribute("placement")}set placement(t){t?this.setAttribute("placement",t):this.removeAttribute("placement")}get targetElement(){return this._targetElement}set targetElement(t){this.removeTargetEventListener(this.targetElement),this._targetElement&&this._targetElement.getAttribute("aria-expanded")=="true"&&this._targetElement.setAttribute("aria-expanded","false"),this._targetElement=t,t&&t.setAttribute("aria-expanded","false"),this.addTargetEventListener(this.targetElement),this.updatePopper()}get targetSelector(){return this.getAttribute("target-selector")}set targetSelector(t){t?this.setAttribute("target-selector",t):this.removeAttribute("target-selector")}get modal(){return this.hasAttribute("modal")}set modal(t){t?this.setAttribute("modal",""):this.removeAttribute("modal")}get popoverFor(){return this.getAttribute("popover-for")}set popoverFor(t){t?this.setAttribute("popover-for",t):this.removeAttribute("popover-for")}get flipPriority(){return this._flipPriority}set flipPriority(t){t&&t.length>0?this._flipPriority=t:this._flipPriority=null,this.reConfigurePopper()}get offset(){return this.getAttribute("offset")?parseInt(this.getAttribute("offset")):0}set offset(t){t?this.setAttribute("offset",t.toString()):this.removeAttribute("offset"),this.reConfigurePopper()}reConfigurePopper(){this._popper&&this.configurePopper()}get noArrow(){return this.hasAttribute("no-arrow")}set noArrow(t){t?this.setAttribute("no-arrow",""):this.removeAttribute("no-arrow")}static get observedAttributes(){return["placement","target-selector","trigger-type"]}attributeChangedCallback(t,r){switch(t){case"placement":{this.updatePopper();break}case"trigger-type":{this.removeTargetEventListener(this.targetElement),this.addTargetEventListener(this.targetElement);break}case"target-selector":{this.handleTargetSelectorChange(r);break}}}connectedCallback(){this._firstUpdated||(this.firstUpdated(),this._firstUpdated=!0),this.targetElement?this.addTargetEventListener(this.targetElement):this.targetSelector&&requestAnimationFrame(()=>{this.isConnected&&this.handleTargetSelectorChange(null)}),this._arrow=document.createElement("div"),this._arrow.classList.add("popover-arrow"),this._arrow.setAttribute("data-popper-arrow",""),this._arrow.style.display="flex",this._arrow.innerHTML=this.arrowSvg}disconnectedCallback(){this.targetElement&&(this.removeTargetEventListener(this.targetElement),this.removeTargetClassForOpen(this.targetElement)),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}firstUpdated(){this.style.display="none",this.triggerType=this.triggerType||"click",this.placement=this.placement||"auto"}get open(){return this._open}set open(t){t!==this._open&&(this._open=t,this.handleOpenChange())}handleOpenChange(){this.open?(this._popper||this.configurePopper(),this._container.innerHTML="",this.popoverFor&&this._container.setAttribute("popover-for",this.popoverFor),this.content&&(this._container.prepend(this.content),Object.assign(this.content.style,{position:"relative",display:"block",zIndex:1}),window.requestAnimationFrame(()=>{let t=getComputedStyle(this.content).backgroundColor;t=="rgba(0, 0, 0, 0)"&&(this.content.style.background=t="#f2f2f2");let r=this._arrow.querySelector(".arrow-background");r&&(r.style.fill=t)})),this.ensureArrowIsAdded(),this.ownerDocument.body.appendChild(this._container),this.updatePopper(),this.setAttribute("open",""),this.modal&&(window.addEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.addEventListener("focus",this.hideIfExternalTarget,{capture:!0})),this.targetElement&&(this.addTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","true")),this.dispatchEvent(new CustomEvent("open")),this._container.addEventListener("keydown",this.handleTabKeyDown)):(this.ownerDocument.body.removeChild(this._container),this.removeAttribute("open"),window.removeEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.removeEventListener("focus",this.hideIfExternalTarget,{capture:!0}),this.targetElement&&(this.removeTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","false")),this.dispatchEvent(new CustomEvent("close")),this._container.removeEventListener("keydown",this.handleTabKeyDown))}handleTargetSelectorChange(t){let r=document.querySelector(t);r&&(this.removeTargetEventListener(r),this.removeTargetClassForOpen(r)),this.targetSelector&&(this.targetElement=document.querySelector(this.targetSelector),this.addTargetEventListener(this.targetElement))}addTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.addEventListener("mouseenter",this.show),t.addEventListener("mouseleave",this.hide);break}case"click":{t.addEventListener("click",this.toggle);break}}}removeTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.removeEventListener("mouseenter",this.show),t.removeEventListener("mouseleave",this.hide);break}case"click":{t.removeEventListener("click",this.toggle);break}}}configurePopper(){this.createContentContainer(),this.ensureArrowIsAdded();let t=this,r={placement:t.placement,strategy:"absolute",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!Sr}},{name:"flip",options:{fallbackPlacements:t._flipPriority}},{name:"offset",options:{offset:()=>[0,t.noArrow?0+t.offset:this._arrow.clientHeight+t.offset]}},{name:"arrow",options:{padding:6}},{name:"resetArrowStyles",enabled:!0,phase:"beforeWrite",fn({state:o}){Object.assign(t._arrow.style,{top:o.styles.arrow.top||"",left:o.styles.arrow.left||"",bottom:o.styles.arrow.bottom||"",right:o.styles.arrow.right||""})}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn({state:o}){t.updateArrow(o.placement)}}]};this._popper=oe(this.targetElement,this._container,r)}createContentContainer(){this._container=document.createElement("div"),this._container.classList.add("popover-container"),this._container.tabIndex=0,this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(()=>{this._popper&&this._popper.update()}),this._resizeObserver.observe(this._container),Object.assign(this._container.style,{boxShadow:`0 4px 5px 0 rgba(0, 0, 0, 0.14),
|
|
6
|
-
0 1px 10px 0 rgba(0, 0, 0, 0.12),
|
|
7
|
-
0 2px 4px -1px rgba(0, 0, 0, 0.4)`,border:"1px solid #999",boxSizing:"border-box",zIndex:2e4})}ensureArrowIsAdded(){!this.noArrow&&!this._container.contains(this._arrow)&&this._container.appendChild(this._arrow)}updatePopper(){this._popper&&(this._popper.state.elements.reference=this.targetElement,this._popper.state.options.placement=this.placement,this.open&&this._popper.update())}updateArrow(t){if(this._arrow){let r=this.getArrowVariant(t);if(this._arrow.setAttribute("variant",r),this._content){let o=this._arrow.querySelector("svg"),i=this._arrow.clientWidth,a=this._arrow.clientHeight,f=`-${a-Be}px`,n=(i-a)/2,s=`-${a+n-Be}px`;switch(r){case"bottom":{this._arrow.style.top=f,o.style.transform="rotate(180deg)";break}case"top":{this._arrow.style.bottom=f,o.style.transform="rotate(0deg)";break}case"left":{this._arrow.style.right=s,o.style.transform="rotate(270deg)";break}case"right":{this._arrow.style.left=s,o.style.transform="rotate(90deg)";break}}}}}getArrowVariant(t){if(t.indexOf("bottom")!==-1)return"bottom";if(t.indexOf("top")!==-1)return"top";if(t.indexOf("left")!==-1)return"left";if(t.indexOf("right")!==-1)return"right"}get content(){return this._content||(this._content=this.firstElementChild,this._content.setAttribute("data-popper-content","")),this._content}addTargetClassForOpen(t){t&&t.classList.add(Me)}removeTargetClassForOpen(t){t&&t.classList.remove(Me)}findNextFocusableAfter(t,r,o){if(!t)return null;let i=r??document.body,a=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode(f){let n=f;return n.tabIndex>=0&&!n.hidden&&n.offsetParent!==null?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return a.currentNode=t,o?a.nextNode():a.previousNode()}};Ne.ID="sd-popover";var jt=Ne;customElements.get(jt.ID)||customElements.define(jt.ID,jt);return Ye(_r);})();
|
|
8
|
-
//# sourceMappingURL=popover-with-externals.js.map
|