@ember-eui/core 13.0.1 → 13.0.3

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 (34) hide show
  1. package/declarations/components/eui-call-out.d.ts +3 -0
  2. package/declarations/components/eui-call-out.d.ts.map +1 -1
  3. package/declarations/components/eui-combo-box.d.ts +3 -1
  4. package/declarations/components/eui-combo-box.d.ts.map +1 -1
  5. package/declarations/components/eui-field-number.d.ts.map +1 -1
  6. package/declarations/components/eui-field-text.d.ts.map +1 -1
  7. package/declarations/components/eui-page-template.d.ts.map +1 -1
  8. package/declarations/components/eui-popover.d.ts +3 -2
  9. package/declarations/components/eui-popover.d.ts.map +1 -1
  10. package/declarations/components/eui-switch.d.ts +1 -1
  11. package/declarations/components/eui-switch.d.ts.map +1 -1
  12. package/declarations/components/eui-text-area.d.ts +1 -0
  13. package/declarations/components/eui-text-area.d.ts.map +1 -1
  14. package/declarations/helpers/hex-to-rgb.d.ts +1 -0
  15. package/declarations/helpers/hex-to-rgb.d.ts.map +1 -1
  16. package/dist/components/eui-call-out.js +1 -1
  17. package/dist/components/eui-call-out.js.map +1 -1
  18. package/dist/components/eui-code-block.js +1 -1
  19. package/dist/components/eui-code-block.js.map +1 -1
  20. package/dist/components/eui-combo-box.js +1 -1
  21. package/dist/components/eui-combo-box.js.map +1 -1
  22. package/dist/components/eui-field-number.js +1 -1
  23. package/dist/components/eui-field-number.js.map +1 -1
  24. package/dist/components/eui-field-text.js +1 -1
  25. package/dist/components/eui-field-text.js.map +1 -1
  26. package/dist/components/eui-page-template.js +1 -1
  27. package/dist/components/eui-page-template.js.map +1 -1
  28. package/dist/components/eui-popover.js +11 -5
  29. package/dist/components/eui-popover.js.map +1 -1
  30. package/dist/components/eui-switch.js.map +1 -1
  31. package/dist/components/eui-text-area.js +1 -1
  32. package/dist/components/eui-text-area.js.map +1 -1
  33. package/dist/helpers/hex-to-rgb.js.map +1 -1
  34. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"eui-popover.js","sources":["../../src/components/eui-popover.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { assert } from '@ember/debug';\nimport { hash } from '@ember/helper';\nimport { concat } from '@ember/helper';\nimport { action } from '@ember/object';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport { cancel, later, scheduleOnce } from '@ember/runloop';\nimport { htmlSafe } from '@ember/template';\nimport type Owner from '@ember/owner';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { and, not, or } from 'ember-truth-helpers';\nimport { tabbable } from 'tabbable';\n\nimport randomId from '../-private/random-id.ts';\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport merge from '../helpers/merge.ts';\nimport mutationObserver from '../modifiers/mutation-observer.ts';\nimport outsideClickDetector from '../modifiers/outside-click-detector.ts';\nimport screenReaderOnly from '../modifiers/screen-reader-only.ts';\nimport simpleStyle from '../modifiers/simple-style.ts';\nimport { cascadingMenuKeys } from '../utils/accesibility/index.ts';\nimport {\n anchorPositionMapping,\n displayMapping\n} from '../utils/css-mappings/eui-popover.ts';\nimport {\n findPopoverPosition,\n getElementZIndex\n} from '../utils/popover/index.ts';\nimport {\n getTransitionTimings,\n getWaitDuration,\n performOnFrame\n} from '../utils/transition.ts';\nimport EuiPanel from './eui-panel.gts';\nimport EuiPortal from './eui-portal.gts';\n\nimport type { paddingSizeMapping } from '../utils/css-mappings/eui-panel.ts';\nimport type { EuiPopoverPosition } from '../utils/popover/types';\nimport type { EmberKeyboardEvent } from 'ember-keyboard/modifiers/on-key';\n\ntype PanelPaddingSize = keyof typeof paddingSizeMapping;\n\nexport type PopoverAnchorPosition =\n | 'upCenter'\n | 'upLeft'\n | 'upRight'\n | 'downCenter'\n | 'downLeft'\n | 'downRight'\n | 'leftCenter'\n | 'leftUp'\n | 'leftDown'\n | 'rightCenter'\n | 'rightUp'\n | 'rightDown';\n\nexport type EuiPopoverArgs = {\n /**\n * Callback to have a reference to the portal element\n */\n portalRef?: (ref: HTMLElement) => void;\n /**\n * Class name passed to the direct parent of the button\n */\n anchorClassName?: string;\n /**\n * Alignment of the popover and arrow relative to the button\n */\n anchorPosition?: PopoverAnchorPosition;\n /**\n * Style and position alteration for arrow-less, left-aligned\n * attachment. Intended for use with inputs as anchors, e.g.\n * EuiInputPopover\n */\n attachToAnchor?: boolean;\n /**\n * Triggering element for which to align the popover to\n */\n button?: Component;\n buttonRef?: (e: HTMLDivElement) => unknown;\n /**\n * Callback to handle hiding of the popover\n */\n closePopover: () => void;\n /**\n * Restrict the popover's position within this element\n */\n container?: HTMLElement;\n /**\n * CSS display type for both the popover and anchor\n */\n display?: keyof typeof displayMapping;\n /**\n * Show arrow indicating to originating button\n */\n hasArrow?: boolean;\n /**\n * Specifies what element should initially have focus; Can be a DOM\n * node, or a selector string (which will be passed to\n * document.querySelector() to find the DOM node), or a function that\n * returns a DOM node\n */\n initialFocus?: FocusTarget | false;\n /**\n * Passed directly to EuiPortal for DOM positioning. Both properties are\n * required if prop is specified\n */\n insert?: {\n sibling: HTMLElement;\n position: 'before' | 'after';\n };\n /**\n * Visibility state of the popover\n */\n isOpen?: boolean;\n /**\n * Traps tab focus within the popover contents\n */\n ownFocus?: boolean;\n /**\n * Custom class added to the EuiPanel containing the popover contents\n */\n panelClassName?: string;\n /**\n * EuiPanel padding on all sides\n */\n panelPaddingSize?: PanelPaddingSize;\n /**\n * Standard DOM `style` attribute. Passed to the EuiPanel\n */\n panelStyle?: { [i: string]: string };\n panelRef?: (e: HTMLElement | null) => unknown;\n popoverRef?: (e: HTMLElement) => unknown;\n\n /**\n * when not `false`, the popover will check if this popover is inside another popover and if so. will reposition itself to be inside the other popover\n */\n shouldAccountForOtherPopovers?: boolean;\n\n /**\n * When `true`, the popover's position is re-calculated when the user\n * scrolls, this supports having fixed-position popover anchors\n */\n repositionOnScroll?: boolean;\n /**\n * By default, popover content inherits the z-index of the anchor\n * component; pass `zIndex` to override\n */\n zIndex?: number;\n /**\n * Function callback for when the focus trap is deactivated\n */\n onTrapDeactivation?: () => void;\n /**\n * Distance away from the anchor that the popover will render\n */\n offset?: number;\n /**\n * Minimum distance between the popover and the bounding container;\n * Pass an array of 4 values to adjust each side differently: `[top, right, bottom, left]`\n * Default is 16\n */\n buffer?: number | [number, number, number, number];\n /**\n * Element to pass as the child element of the arrow;\n * Use case is typically limited to an accompanying `EuiBeacon`\n */\n arrowChildren?: Component;\n /**\n * Provide a name to the popover panel\n */\n ariaLabel?: string;\n /**\n * Alternative option to `aria-label` that takes an `id`.\n * Usually takes the `id` of the popover title\n */\n ariaLabelledBy?: string;\n\n tabindex?: string | number;\n\n shouldSelfFocus?: boolean;\n\n isFocusTrapPaused?: boolean;\n\n focusTrapOptions?: {\n onClickOutside?: (e: Event) => void;\n };\n\n mutationObserverOptions?: {\n attributes?: boolean;\n childList?: boolean;\n characterData?: boolean;\n subtree?: boolean;\n };\n};\n\ntype AnchorPosition = 'up' | 'right' | 'down' | 'left';\n\nconst anchorPositionToPopoverPositionMap: {\n [position in AnchorPosition]: EuiPopoverPosition;\n} = {\n up: 'top',\n right: 'right',\n down: 'bottom',\n left: 'left'\n};\n\nexport function getPopoverPositionFromAnchorPosition(\n anchorPosition: PopoverAnchorPosition\n): EuiPopoverPosition {\n // maps the anchor position to the matching popover position\n // e.g. \"upLeft\" -> \"top\", \"downRight\" -> \"bottom\"\n\n // extract the first positional word from anchorPosition:\n // starts at the beginning (\" ^ \") of anchorPosition and\n // captures all of the characters (\" (.*?) \") until the\n // first capital letter (\" [A-Z] \") is encountered\n const match = anchorPosition.match(/^(.*?)[A-Z]/);\n\n if (match?.length && match.length > 1) {\n return anchorPositionToPopoverPositionMap[match[1] as AnchorPosition];\n }\n\n return anchorPositionToPopoverPositionMap['up'];\n}\n\nexport function getPopoverAlignFromAnchorPosition(\n anchorPosition: PopoverAnchorPosition\n): EuiPopoverPosition {\n // maps the gravity to the matching popover position\n // e.g. \"upLeft\" -> \"left\", \"rightDown\" -> \"bottom\"\n\n // extract the second positional word from anchorPosition:\n // starts a capture group at the first capital letter\n // and includes everything after it\n const match = anchorPosition.match(/([A-Z].*)/);\n\n // this performs two tasks:\n // 1. normalizes the align position by lowercasing it\n // 2. `center` doesn't exist in the lookup map which converts it to `undefined` meaning no align\n if (match?.length && match.length > 1) {\n return anchorPositionToPopoverPositionMap[\n match[1]?.toLowerCase() as AnchorPosition\n ];\n }\n\n return anchorPositionToPopoverPositionMap['left'];\n}\n\nexport const ANCHOR_POSITIONS = Object.keys(anchorPositionMapping);\nexport const DISPLAY = Object.keys(displayMapping);\nexport type FocusTarget = HTMLElement | string | (() => HTMLElement);\n\nconst DEFAULT_POPOVER_STYLES = {\n top: 50,\n left: 50\n};\n\nfunction getElementFromInitialFocus(\n initialFocus?: FocusTarget\n): HTMLElement | null {\n const initialFocusType = typeof initialFocus;\n\n if (initialFocusType === 'string') {\n return document.querySelector(initialFocus as string);\n }\n\n if (initialFocusType === 'function') {\n return (initialFocus as () => HTMLElement | null)();\n }\n\n return initialFocus as HTMLElement | null;\n}\n\ntype CssProps = {\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n zIndex?: number;\n};\n\nexport interface EuiPopoverSignature {\n Element: HTMLDivElement;\n Args: EuiPopoverArgs;\n Blocks: {\n button: [];\n content: [];\n arrowChildren: [];\n };\n}\n\nexport default class EuiPopoverComponent extends Component<EuiPopoverSignature> {\n // Defaults\n @argOrDefaultDecorator(false) isOpen!: boolean;\n @argOrDefaultDecorator(true) ownFocus!: boolean;\n @argOrDefaultDecorator('downCenter') anchorPosition!: PopoverAnchorPosition;\n @argOrDefaultDecorator('m') panelPaddingSize!: PanelPaddingSize;\n @argOrDefaultDecorator(true) hasArrow!: boolean;\n @argOrDefaultDecorator('inlineBlock') display!: string;\n @argOrDefaultDecorator(true) shouldSelfFocus!: boolean;\n @argOrDefaultDecorator(false) isFocusTrapPaused!: boolean;\n\n //State\n @tracked prevIsOpen: boolean | undefined;\n @tracked suppressingPopover: boolean | undefined;\n @tracked isClosing = false;\n @tracked isOpening = false;\n @tracked popoverStyles: CssProps = {};\n @tracked arrowStyles: CssProps | undefined = {};\n @tracked arrowPosition: EuiPopoverPosition | null = null;\n @tracked openPosition: EuiPopoverPosition | null = null;\n @tracked isOpenStable = false;\n @tracked isCurrentlyOpen: boolean | undefined;\n @tracked popoverHost?: HTMLElement | null = null;\n ///\n\n private respositionTimeout: ReturnType<typeof later> | null = null;\n private closingTransitionTimeout: ReturnType<typeof later> | null = null;\n private closingTransitionAnimationFrame: number | undefined;\n private updateFocusAnimationFrame: number | undefined;\n private hasSetInitialFocus: boolean = false;\n @tracked button: HTMLElement | null = null;\n @tracked panel: HTMLElement | null = null;\n\n constructor(owner: Owner, args: EuiPopoverArgs) {\n super(owner, args);\n assert(`Must provide closePopover function`, this.args.closePopover);\n this.prevIsOpen = this.isOpen;\n this.suppressingPopover = this.isOpen;\n this.isCurrentlyOpen = this.isOpen;\n }\n\n get insert() {\n if (this.args.insert) {\n return this.args.insert;\n }\n\n if (this.shouldAccountForOtherPopovers) {\n if (this.popoverHost) {\n return {\n sibling: this.popoverHost.children[0] as HTMLElement,\n position: 'after'\n };\n }\n }\n\n return undefined;\n }\n\n @action\n closePopover(): void {\n if (this.isOpen) {\n this.args.closePopover();\n }\n }\n\n @action\n onEscapeKey(event: Event, ekEvent?: EmberKeyboardEvent): void {\n if (this.isOpen) {\n ekEvent?.stopPropagation();\n ekEvent?.stopImmediatePropagation();\n event.preventDefault();\n event.stopPropagation();\n this.closePopover();\n }\n }\n\n @action\n onKeyDown(event: KeyboardEvent, ekEvent: EmberKeyboardEvent): void {\n if (event.key === cascadingMenuKeys.ESCAPE) {\n this.onEscapeKey(event as unknown as Event, ekEvent as unknown as Event);\n }\n }\n\n @action\n onClickOutside(event: Event): void {\n if (this.args.focusTrapOptions?.onClickOutside) {\n this.args.focusTrapOptions.onClickOutside(event);\n } else {\n // only close the popover if the event source isn't the anchor button\n // otherwise, it is up to the anchor to toggle the popover's open status\n if (this.button && this.button.contains(event.target as Node) === false) {\n this.closePopover();\n }\n }\n }\n\n updateFocus(): void {\n // Wait for the DOM to update.\n this.updateFocusAnimationFrame = window.requestAnimationFrame(() => {\n if (!this.ownFocus || !this.panel || this.args.initialFocus === false) {\n return;\n }\n\n // If we've already focused on something inside the panel, everything's fine.\n if (\n this.hasSetInitialFocus &&\n this.panel.contains(document.activeElement)\n ) {\n return;\n }\n\n // Otherwise let's focus the first tabbable item and expedite input from the user.\n let focusTarget;\n\n if (this.args.initialFocus != null) {\n focusTarget = getElementFromInitialFocus(this.args.initialFocus);\n } else {\n const tabbableItems = tabbable(this.panel);\n\n if (tabbableItems.length) {\n focusTarget = tabbableItems[0];\n }\n }\n\n // there's a race condition between the popover content becoming visible and this function call\n // if the element isn't visible yet (due to css styling) then it can't accept focus\n // so wait for another render and try again\n if (focusTarget == null) {\n // there isn't a focus target, one of two reasons:\n // #1 is the whole panel hidden? If so, schedule another check\n // #2 panel is visible but no tabbables exist, move focus to the panel\n const panelVisibility = window.getComputedStyle(this.panel).opacity;\n\n if (panelVisibility === '0') {\n // #1\n this.updateFocus();\n } else {\n // #2\n focusTarget = this.panel;\n }\n } else {\n // found an element to focus, but is it visible?\n const visibility = window.getComputedStyle(focusTarget).visibility;\n\n if (visibility === 'hidden') {\n // not visible, check again next render frame\n this.updateFocus();\n }\n }\n\n if (focusTarget != null) {\n this.hasSetInitialFocus = true;\n focusTarget.focus();\n }\n });\n }\n\n @action\n onOpenPopover(): void {\n cancel(this.closingTransitionTimeout as ReturnType<typeof later>);\n // We need to set this state a beat after the render takes place, so that the CSS\n // transition can take effect.\n this.closingTransitionAnimationFrame = window.requestAnimationFrame(() => {\n this.isOpening = true;\n });\n\n // for each child element of `this.panel`, find any transition duration we should wait for before stabilizing\n const { durationMatch, delayMatch } = Array.prototype.slice\n .call(this.panel ? this.panel.children : [])\n .reduce(\n (\n {\n durationMatch,\n delayMatch\n }: { durationMatch: number; delayMatch: number },\n element: HTMLElement\n ) => {\n const transitionTimings = getTransitionTimings(element);\n\n return {\n durationMatch: Math.max(\n durationMatch,\n transitionTimings.durationMatch\n ),\n delayMatch: Math.max(delayMatch, transitionTimings.delayMatch)\n };\n },\n { durationMatch: 0, delayMatch: 0 }\n );\n\n this.respositionTimeout = later(\n this,\n () => {\n this.isOpenStable = true;\n\n const fn = (): void => {\n this.positionPopoverFixed();\n this.updateFocus();\n };\n\n scheduleOnce('afterRender', this, fn);\n },\n durationMatch + delayMatch\n );\n }\n\n get shouldAccountForOtherPopovers() {\n return this.args.shouldAccountForOtherPopovers ?? true;\n }\n\n checkIfPopoverIsInsideAnotherPopover(ele: HTMLElement) {\n const otherPopover = ele.closest<HTMLDivElement>('div.euiPopover__panel');\n\n this.popoverHost = otherPopover;\n }\n\n @action\n didInsertPopover(ele: HTMLDivElement): void {\n if (this.suppressingPopover) {\n // component was created with isOpen=true; now that it's inserted\n // stop suppressing and start opening\n this.suppressingPopover = false;\n this.isOpening = true;\n\n const fn = (): void => this.onOpenPopover();\n\n scheduleOnce('afterRender', this, fn);\n }\n\n if (this.args.repositionOnScroll) {\n window.addEventListener('scroll', this.positionPopoverFixed, true);\n }\n\n if (this.shouldAccountForOtherPopovers) {\n this.checkIfPopoverIsInsideAnotherPopover(ele);\n }\n\n this.updateFocus();\n }\n\n @action\n didUpdateRepositionOnScroll(): void {\n if (this.args.repositionOnScroll) {\n window.addEventListener('scroll', this.positionPopoverFixed, true);\n } else {\n window.removeEventListener('scroll', this.positionPopoverFixed, true);\n }\n }\n\n @action\n didUpdateIsOpen(): void {\n this.isCurrentlyOpen = this.isOpen;\n\n if (!this.prevIsOpen && this.args.isOpen) {\n this.onOpenPopover();\n }\n\n if (this.prevIsOpen && !this.args.isOpen) {\n // If the user has just closed the popover, queue up the removal of the content after the\n // transition is complete.\n this.isClosing = true;\n this.isOpening = false;\n this.closingTransitionTimeout = later(\n this,\n () => {\n this.isClosing = false;\n },\n 250\n );\n }\n\n this.prevIsOpen = this.args.isOpen;\n }\n\n willDestroy(): void {\n super.willDestroy();\n window.removeEventListener('scroll', this.positionPopoverFixed, true);\n window.removeEventListener('resize', this.positionPopoverFluid);\n this.popoverHost = null;\n this.button = null;\n this.panel = null;\n cancel(this.respositionTimeout as ReturnType<typeof later>);\n cancel(this.closingTransitionTimeout as ReturnType<typeof later>);\n cancelAnimationFrame(this.closingTransitionAnimationFrame as number);\n cancelAnimationFrame(this.updateFocusAnimationFrame as number);\n }\n\n @action\n onMutation(records: MutationRecord[]): void {\n const waitDuration = getWaitDuration(records);\n\n this.positionPopoverFixed();\n\n performOnFrame(waitDuration, this.positionPopoverFixed);\n }\n\n @action\n positionPopover(allowEnforcePosition: boolean): void {\n if (this.button == null || this.panel == null) return;\n\n let position = getPopoverPositionFromAnchorPosition(this.anchorPosition);\n let forcePosition = undefined;\n\n if (\n allowEnforcePosition &&\n this.isOpenStable &&\n this.openPosition != null\n ) {\n position = this.openPosition;\n forcePosition = true;\n }\n\n // get the position of the element relative to the offsetParent, which could be the document\n function getPos(ele: HTMLElement): [number, number] {\n let currTop = 0;\n let currLeft = 0;\n\n if (ele.offsetParent) {\n do {\n currTop += ele.offsetTop;\n currLeft += ele.offsetLeft;\n } while ((ele = ele.offsetParent as HTMLElement));\n } else {\n currTop = ele.offsetTop;\n currLeft = ele.offsetLeft;\n }\n\n return [currTop, currLeft];\n }\n\n const {\n top,\n left,\n position: foundPosition,\n arrow,\n anchorBoundingBox\n } = findPopoverPosition({\n container: this.args.container,\n host: this.shouldAccountForOtherPopovers ? this.popoverHost : null,\n position,\n forcePosition,\n align: getPopoverAlignFromAnchorPosition(this.anchorPosition),\n anchor: this.button,\n popover: this.panel,\n offset:\n !this.args.attachToAnchor && this.hasArrow\n ? 16 + (this.args.offset || 0)\n : 8 + (this.args.offset || 0),\n arrowConfig: {\n arrowWidth: 24,\n arrowBuffer: 10\n },\n returnBoundingBox: this.args.attachToAnchor,\n buffer: this.args.buffer\n });\n\n // the popover's z-index must inherit from the button\n // this keeps a button's popover under a flyout that would cover the button\n // but a popover triggered inside a flyout will appear over that flyout\n const { zIndex: zIndexProp } = this.args;\n const zIndex =\n zIndexProp == null\n ? getElementZIndex(this.button, this.panel) + 2000\n : zIndexProp;\n\n const popoverStyles = {\n top,\n left:\n this.args.attachToAnchor && anchorBoundingBox\n ? anchorBoundingBox.left\n : left,\n zIndex\n };\n\n const willRenderArrow = !this.args.attachToAnchor && this.hasArrow;\n const arrowStyles = willRenderArrow ? arrow : undefined;\n const arrowPosition = foundPosition;\n\n this.popoverStyles = popoverStyles;\n this.arrowStyles = arrowStyles;\n this.arrowPosition = arrowPosition;\n this.openPosition = foundPosition;\n }\n\n get _arrowStyles(): ReturnType<typeof htmlSafe> | undefined {\n const { arrowStyles } = this;\n\n return arrowStyles\n ? htmlSafe(`top: ${arrowStyles?.top}px; left: ${arrowStyles?.left}px;`)\n : undefined;\n }\n\n get _popoverStyles(): { [i: string]: string } {\n const { panelStyle } = this.args;\n const { popoverStyles } = this;\n\n return {\n ...panelStyle,\n top: `${popoverStyles.top}px`,\n left: `${popoverStyles.left}px`,\n zIndex: `${popoverStyles.zIndex}`\n };\n }\n\n get tabindex() {\n if (this.ownFocus) {\n return this.args.tabindex ?? '0';\n }\n\n return '-1';\n }\n\n @action\n positionPopoverFixed(): void {\n this.positionPopover(true);\n }\n\n @action\n positionPopoverFluid(): void {\n this.positionPopover(false);\n }\n\n @action\n registerButton(btn: HTMLDivElement): void {\n this.button = btn;\n this.args.buttonRef?.(btn);\n }\n\n @action\n registerPanel(panel: HTMLElement): void {\n this.panel = panel;\n this.args.panelRef?.(panel);\n\n if (panel === null) {\n // panel has unmounted, restore the state defaults\n this.popoverStyles = DEFAULT_POPOVER_STYLES;\n this.arrowStyles = {};\n this.arrowPosition = null;\n this.openPosition = null;\n this.isOpenStable = false;\n window.removeEventListener('resize', this.positionPopoverFluid);\n } else {\n // panel is coming into existence\n this.positionPopoverFluid();\n window.addEventListener('resize', this.positionPopoverFluid);\n }\n }\n\n <template>\n {{#let\n (randomId)\n (classNames\n (if this.isOpening \"euiPopover-isOpen\")\n position=this.anchorPosition\n display=this.display\n componentName=\"EuiPopover\"\n )\n (classNames\n \"euiPopover__panel\"\n (concat \"euiPopover__panel--\" this.arrowPosition)\n (if this.isOpening \"euiPopover__panel-isOpen\")\n (if\n (or (not this.hasArrow) @attachToAnchor) \"euiPopover__panel-noArrow\"\n )\n (if @attachToAnchor \"euiPopover__panel-isAttached\")\n @panelClassName\n )\n as |descriptionId classes panelClasses|\n }}\n <div\n class={{classes}}\n {{onKey \"_all\" this.onKeyDown priority=1}}\n {{didInsert this.didInsertPopover}}\n {{didUpdate this.didUpdateIsOpen @isOpen}}\n {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}}\n {{didInsert (optional @popoverRef)}}\n ...attributes\n >\n\n {{! button }}\n <div\n class=\"euiPopover__anchor {{@anchorClassName}}\"\n {{didInsert this.registerButton}}\n >\n {{yield to=\"button\"}}\n </div>\n\n {{! content }}\n {{#if\n (and\n (not this.suppressingPopover)\n (or this.isCurrentlyOpen this.isClosing)\n )\n }}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n {{#let (randomId) as |panelId|}}\n <EuiPanel\n id={{panelId}}\n class={{panelClasses}}\n aria-live={{if this.ownFocus \"off\" \"assertive\"}}\n role=\"dialog\"\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledBy}}\n aria-modal=\"true\"\n aria-describedby={{if this.ownFocus descriptionId}}\n tabindex={{this.tabindex}}\n @hasShadow={{false}}\n @paddingSize={{this.panelPaddingSize}}\n {{simpleStyle this._popoverStyles}}\n {{didInsert this.registerPanel}}\n {{outsideClickDetector onOutsideClick=this.onClickOutside}}\n {{onKey \"Escape\" this.onEscapeKey}}\n {{focusTrap\n isActive=(not\n (or\n (not this.ownFocus) (not this.isOpenStable) this.isClosing\n )\n )\n shouldSelfFocus=this.shouldSelfFocus\n isPaused=this.isFocusTrapPaused\n focusTrapOptions=(merge\n (hash\n returnFocusOnDeactivate=this.isOpenStable\n initialFocus=(or @initialFocus this.panel)\n onDeactivate=(optional @onTrapDeactivation)\n preventScroll=true\n clickOutsideDeactivates=true\n fallbackFocus=(concat \"#\" panelId)\n )\n @focusTrapOptions\n )\n }}\n >\n <div\n class={{concat\n \"euiPopover__panelArrow euiPopover__panelArrow--\"\n this.arrowPosition\n }}\n style={{this._arrowStyles}}\n >\n {{yield to=\"arrowChildren\"}}\n </div>\n {{#if this.ownFocus}}\n <p id={{descriptionId}} {{screenReaderOnly}}>\n You are in a dialog. To close this dialog, hit escape.\n </p>\n {{/if}}\n <div\n {{mutationObserver\n onMutation=this.onMutation\n observerOptions=(merge\n (hash\n attributes=true\n childList=true\n characterData=true\n subtree=true\n )\n @mutationObserverOptions\n )\n }}\n >\n {{yield to=\"content\"}}\n </div>\n </EuiPanel>\n {{/let}}\n </EuiPortal>\n {{/if}}\n\n </div>\n {{/let}}\n </template>\n}\n"],"names":["anchorPositionToPopoverPositionMap","up","right","down","left","getPopoverPositionFromAnchorPosition","anchorPosition","match","length","getPopoverAlignFromAnchorPosition","toLowerCase","ANCHOR_POSITIONS","Object","keys","anchorPositionMapping","DISPLAY","displayMapping","DEFAULT_POPOVER_STYLES","top","getElementFromInitialFocus","initialFocus","initialFocusType","document","querySelector","EuiPopoverComponent","Component","g","prototype","argOrDefaultDecorator","i","void 0","tracked","respositionTimeout","closingTransitionTimeout","closingTransitionAnimationFrame","updateFocusAnimationFrame","hasSetInitialFocus","constructor","owner","args","assert","closePopover","prevIsOpen","isOpen","suppressingPopover","isCurrentlyOpen","insert","shouldAccountForOtherPopovers","popoverHost","sibling","children","position","undefined","n","action","onEscapeKey","event","ekEvent","stopPropagation","stopImmediatePropagation","preventDefault","onKeyDown","key","cascadingMenuKeys","ESCAPE","onClickOutside","focusTrapOptions","button","contains","target","updateFocus","window","requestAnimationFrame","ownFocus","panel","activeElement","focusTarget","tabbableItems","tabbable","panelVisibility","getComputedStyle","opacity","visibility","focus","onOpenPopover","cancel","isOpening","durationMatch","delayMatch","Array","slice","call","reduce","element","transitionTimings","getTransitionTimings","Math","max","later","isOpenStable","fn","positionPopoverFixed","scheduleOnce","checkIfPopoverIsInsideAnotherPopover","ele","otherPopover","closest","didInsertPopover","repositionOnScroll","addEventListener","didUpdateRepositionOnScroll","removeEventListener","didUpdateIsOpen","isClosing","willDestroy","positionPopoverFluid","cancelAnimationFrame","onMutation","records","waitDuration","getWaitDuration","performOnFrame","positionPopover","allowEnforcePosition","forcePosition","openPosition","foundPosition","arrow","anchorBoundingBox","findPopoverPosition","container","host","align","anchor","popover","offset","attachToAnchor","hasArrow","arrowConfig","arrowWidth","arrowBuffer","returnBoundingBox","buffer","zIndex","zIndexProp","getElementZIndex","popoverStyles","willRenderArrow","arrowStyles","arrowPosition","_arrowStyles","htmlSafe","_popoverStyles","panelStyle","tabindex","registerButton","btn","buttonRef","registerPanel","panelRef","setComponentTemplate","precompileTemplate","strictMode","scope","randomId","classNames","concat","or","not","onKey","didInsert","didUpdate","optional","and","EuiPortal","EuiPanel","simpleStyle","outsideClickDetector","focusTrap","merge","hash","screenReaderOnly","mutationObserver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6MA,MAAMA,kCAEF,GAAA;AACFC,EAAAA,EAAI,EAAA,KAAA;AACJC,EAAAA,KAAO,EAAA,OAAA;AACPC,EAAAA,IAAM,EAAA,QAAA;AACNC,EAAAA,IAAM,EAAA;AACR,CAAA;AAEO,SAASC,oCAAAA,CACdC,cAAqC,EACpC;AACD;AACA;AAEA;AACA;AACA;AACA;AACA,EAAA,MAAMC,KAAA,GAAQD,cAAe,CAAAC,KAAK,CAAC,aAAA,CAAA;EAEnC,IAAIA,KAAO,EAAAC,MAAA,IA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QAAU,EAAA,IAAI,CAACM,oBAAoB,CAAA;AAC7D;AACF;AAAA,EAAA;IAAA9D,CAAA,CAAA,IAAA,CAAA1B,SAAA,EAAA,eAAA,EAAA,CAlBC2B,MAAA,CAAA,CAAA;AAAA;AAoBD,EAAA;IAAA0G,oBAAA,CAAAC,kBAAA,CA0HA,q4FAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,QAAA;QAAAC,UAAA;QAAAC,MAAA;QAAAC,EAAA;QAAAC,GAAA;QAAAC,KAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,GAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,WAAA;8BAAAC,oBAAA;QAAAC,SAAA;QAAAC,KAAA;QAAAC,IAAA;QAAAC,gBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"eui-popover.js","sources":["../../src/components/eui-popover.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { assert } from '@ember/debug';\nimport { hash } from '@ember/helper';\nimport { concat } from '@ember/helper';\nimport { action } from '@ember/object';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport { cancel, later, scheduleOnce } from '@ember/runloop';\nimport { htmlSafe } from '@ember/template';\nimport type Owner from '@ember/owner';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { and, not, or } from 'ember-truth-helpers';\nimport { tabbable } from 'tabbable';\n\nimport randomId from '../-private/random-id.ts';\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport merge from '../helpers/merge.ts';\nimport mutationObserver from '../modifiers/mutation-observer.ts';\nimport outsideClickDetector from '../modifiers/outside-click-detector.ts';\nimport screenReaderOnly from '../modifiers/screen-reader-only.ts';\nimport simpleStyle from '../modifiers/simple-style.ts';\nimport { cascadingMenuKeys } from '../utils/accesibility/index.ts';\nimport {\n anchorPositionMapping,\n displayMapping\n} from '../utils/css-mappings/eui-popover.ts';\nimport {\n findPopoverPosition,\n getElementZIndex\n} from '../utils/popover/index.ts';\nimport {\n getTransitionTimings,\n getWaitDuration,\n performOnFrame\n} from '../utils/transition.ts';\nimport EuiPanel from './eui-panel.gts';\nimport EuiPortal from './eui-portal.gts';\n\nimport type { paddingSizeMapping } from '../utils/css-mappings/eui-panel.ts';\nimport type { EuiPopoverPosition } from '../utils/popover/types';\nimport type { EmberKeyboardEvent } from 'ember-keyboard/modifiers/on-key';\n\ntype PanelPaddingSize = keyof typeof paddingSizeMapping;\n\nexport type PopoverAnchorPosition =\n | 'upCenter'\n | 'upLeft'\n | 'upRight'\n | 'downCenter'\n | 'downLeft'\n | 'downRight'\n | 'leftCenter'\n | 'leftUp'\n | 'leftDown'\n | 'rightCenter'\n | 'rightUp'\n | 'rightDown';\n\nexport type EuiPopoverArgs = {\n /**\n * Callback to have a reference to the portal element\n */\n portalRef?: (ref: HTMLElement) => void;\n /**\n * Class name passed to the direct parent of the button\n */\n anchorClassName?: string;\n /**\n * Alignment of the popover and arrow relative to the button\n */\n anchorPosition?: PopoverAnchorPosition;\n /**\n * Style and position alteration for arrow-less, left-aligned\n * attachment. Intended for use with inputs as anchors, e.g.\n * EuiInputPopover\n */\n attachToAnchor?: boolean;\n /**\n * Triggering element for which to align the popover to\n */\n button?: HTMLElement;\n buttonRef?: (e: HTMLDivElement) => unknown;\n /**\n * Callback to handle hiding of the popover\n */\n closePopover: () => void;\n /**\n * Restrict the popover's position within this element\n */\n container?: HTMLElement;\n /**\n * CSS display type for both the popover and anchor\n */\n display?: keyof typeof displayMapping;\n /**\n * Show arrow indicating to originating button\n */\n hasArrow?: boolean;\n /**\n * Specifies what element should initially have focus; Can be a DOM\n * node, or a selector string (which will be passed to\n * document.querySelector() to find the DOM node), or a function that\n * returns a DOM node\n */\n initialFocus?: FocusTarget | false;\n /**\n * Passed directly to EuiPortal for DOM positioning. Both properties are\n * required if prop is specified\n */\n insert?: {\n sibling: HTMLElement;\n position: 'before' | 'after';\n };\n /**\n * Visibility state of the popover\n */\n isOpen?: boolean;\n /**\n * Traps tab focus within the popover contents\n */\n ownFocus?: boolean;\n /**\n * Custom class added to the EuiPanel containing the popover contents\n */\n panelClassName?: string;\n /**\n * EuiPanel padding on all sides\n */\n panelPaddingSize?: PanelPaddingSize;\n /**\n * Standard DOM `style` attribute. Passed to the EuiPanel\n */\n panelStyle?: { [i: string]: string };\n panelRef?: (e: HTMLElement | null) => unknown;\n popoverRef?: (e: HTMLElement) => unknown;\n\n /**\n * when not `false`, the popover will check if this popover is inside another popover and if so. will reposition itself to be inside the other popover\n */\n shouldAccountForOtherPopovers?: boolean;\n\n /**\n * When `true`, the popover's position is re-calculated when the user\n * scrolls, this supports having fixed-position popover anchors\n */\n repositionOnScroll?: boolean;\n /**\n * By default, popover content inherits the z-index of the anchor\n * component; pass `zIndex` to override\n */\n zIndex?: number;\n /**\n * Function callback for when the focus trap is deactivated\n */\n onTrapDeactivation?: () => void;\n /**\n * Distance away from the anchor that the popover will render\n */\n offset?: number;\n /**\n * Minimum distance between the popover and the bounding container;\n * Pass an array of 4 values to adjust each side differently: `[top, right, bottom, left]`\n * Default is 16\n */\n buffer?: number | [number, number, number, number];\n /**\n * Element to pass as the child element of the arrow;\n * Use case is typically limited to an accompanying `EuiBeacon`\n */\n arrowChildren?: Component;\n /**\n * Provide a name to the popover panel\n */\n ariaLabel?: string;\n /**\n * Alternative option to `aria-label` that takes an `id`.\n * Usually takes the `id` of the popover title\n */\n ariaLabelledBy?: string;\n\n tabindex?: string | number;\n\n shouldSelfFocus?: boolean;\n\n isFocusTrapPaused?: boolean;\n\n focusTrapOptions?: {\n onClickOutside?: (e: Event) => void;\n };\n\n mutationObserverOptions?: {\n attributes?: boolean;\n childList?: boolean;\n characterData?: boolean;\n subtree?: boolean;\n };\n};\n\ntype AnchorPosition = 'up' | 'right' | 'down' | 'left';\n\nconst anchorPositionToPopoverPositionMap: {\n [position in AnchorPosition]: EuiPopoverPosition;\n} = {\n up: 'top',\n right: 'right',\n down: 'bottom',\n left: 'left'\n};\n\nexport function getPopoverPositionFromAnchorPosition(\n anchorPosition: PopoverAnchorPosition\n): EuiPopoverPosition {\n // maps the anchor position to the matching popover position\n // e.g. \"upLeft\" -> \"top\", \"downRight\" -> \"bottom\"\n\n // extract the first positional word from anchorPosition:\n // starts at the beginning (\" ^ \") of anchorPosition and\n // captures all of the characters (\" (.*?) \") until the\n // first capital letter (\" [A-Z] \") is encountered\n const match = anchorPosition.match(/^(.*?)[A-Z]/);\n\n if (match?.length && match.length > 1) {\n return anchorPositionToPopoverPositionMap[match[1] as AnchorPosition];\n }\n\n return anchorPositionToPopoverPositionMap['up'];\n}\n\nexport function getPopoverAlignFromAnchorPosition(\n anchorPosition: PopoverAnchorPosition\n): EuiPopoverPosition {\n // maps the gravity to the matching popover position\n // e.g. \"upLeft\" -> \"left\", \"rightDown\" -> \"bottom\"\n\n // extract the second positional word from anchorPosition:\n // starts a capture group at the first capital letter\n // and includes everything after it\n const match = anchorPosition.match(/([A-Z].*)/);\n\n // this performs two tasks:\n // 1. normalizes the align position by lowercasing it\n // 2. `center` doesn't exist in the lookup map which converts it to `undefined` meaning no align\n if (match?.length && match.length > 1) {\n return anchorPositionToPopoverPositionMap[\n match[1]?.toLowerCase() as AnchorPosition\n ];\n }\n\n return anchorPositionToPopoverPositionMap['left'];\n}\n\nexport const ANCHOR_POSITIONS = Object.keys(anchorPositionMapping);\nexport const DISPLAY = Object.keys(displayMapping);\nexport type FocusTarget = HTMLElement | string | (() => HTMLElement);\n\nconst DEFAULT_POPOVER_STYLES = {\n top: 50,\n left: 50\n};\n\nfunction getElementFromInitialFocus(\n initialFocus?: FocusTarget\n): HTMLElement | null {\n const initialFocusType = typeof initialFocus;\n\n if (initialFocusType === 'string') {\n return document.querySelector(initialFocus as string);\n }\n\n if (initialFocusType === 'function') {\n return (initialFocus as () => HTMLElement | null)();\n }\n\n return initialFocus as HTMLElement | null;\n}\n\ntype CssProps = {\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n zIndex?: number;\n};\n\nexport interface EuiPopoverSignature {\n Element: HTMLDivElement;\n Args: EuiPopoverArgs;\n Blocks: {\n button: [];\n content: [];\n arrowChildren: [];\n };\n}\n\nexport default class EuiPopoverComponent extends Component<EuiPopoverSignature> {\n // Defaults\n @argOrDefaultDecorator(false) isOpen!: boolean;\n @argOrDefaultDecorator(true) ownFocus!: boolean;\n @argOrDefaultDecorator('downCenter') anchorPosition!: PopoverAnchorPosition;\n @argOrDefaultDecorator('m') panelPaddingSize!: PanelPaddingSize;\n @argOrDefaultDecorator(true) hasArrow!: boolean;\n @argOrDefaultDecorator('inlineBlock') display!: string;\n @argOrDefaultDecorator(true) shouldSelfFocus!: boolean;\n @argOrDefaultDecorator(false) isFocusTrapPaused!: boolean;\n\n //State\n @tracked prevIsOpen: boolean | undefined;\n @tracked suppressingPopover: boolean | undefined;\n @tracked isClosing = false;\n @tracked isOpening = false;\n @tracked popoverStyles: CssProps = {};\n @tracked arrowStyles: CssProps | undefined = {};\n @tracked arrowPosition: EuiPopoverPosition | null = null;\n @tracked openPosition: EuiPopoverPosition | null = null;\n @tracked isOpenStable = false;\n @tracked isCurrentlyOpen: boolean | undefined;\n @tracked popoverHost?: HTMLElement | null = null;\n ///\n\n private respositionTimeout: ReturnType<typeof later> | null = null;\n private closingTransitionTimeout: ReturnType<typeof later> | null = null;\n private closingTransitionAnimationFrame: number | undefined;\n private updateFocusAnimationFrame: number | undefined;\n private hasSetInitialFocus: boolean = false;\n @tracked _button: HTMLElement | null = null;\n @tracked panel: HTMLElement | null = null;\n\n constructor(owner: Owner, args: EuiPopoverArgs) {\n super(owner, args);\n assert(`Must provide closePopover function`, this.args.closePopover);\n this.prevIsOpen = this.isOpen;\n this.suppressingPopover = this.isOpen;\n this.isCurrentlyOpen = this.isOpen;\n }\n\n get button() {\n if (this.args.button) {\n return this.args.button;\n }\n\n return this._button;\n }\n\n get insert() {\n if (this.args.insert) {\n return this.args.insert;\n }\n\n if (this.shouldAccountForOtherPopovers) {\n if (this.popoverHost) {\n return {\n sibling: this.popoverHost.children[0] as HTMLElement,\n position: 'after'\n };\n }\n }\n\n return undefined;\n }\n\n @action\n closePopover(): void {\n if (this.isOpen) {\n this.args.closePopover();\n }\n }\n\n @action\n onEscapeKey(event: Event, ekEvent?: EmberKeyboardEvent): void {\n if (this.isOpen) {\n ekEvent?.stopPropagation();\n ekEvent?.stopImmediatePropagation();\n event.preventDefault();\n event.stopPropagation();\n this.closePopover();\n }\n }\n\n @action\n onKeyDown(event: KeyboardEvent, ekEvent: EmberKeyboardEvent): void {\n if (event.key === cascadingMenuKeys.ESCAPE) {\n this.onEscapeKey(event as unknown as Event, ekEvent as unknown as Event);\n }\n }\n\n @action\n onClickOutside(event: Event): void {\n if (this.args.focusTrapOptions?.onClickOutside) {\n this.args.focusTrapOptions.onClickOutside(event);\n } else {\n // only close the popover if the event source isn't the anchor button\n // otherwise, it is up to the anchor to toggle the popover's open status\n if (this.button && this.button.contains(event.target as Node) === false) {\n this.closePopover();\n }\n }\n }\n\n updateFocus(): void {\n // Wait for the DOM to update.\n this.updateFocusAnimationFrame = window.requestAnimationFrame(() => {\n if (!this.ownFocus || !this.panel || this.args.initialFocus === false) {\n return;\n }\n\n // If we've already focused on something inside the panel, everything's fine.\n if (\n this.hasSetInitialFocus &&\n this.panel.contains(document.activeElement)\n ) {\n return;\n }\n\n // Otherwise let's focus the first tabbable item and expedite input from the user.\n let focusTarget;\n\n if (this.args.initialFocus != null) {\n focusTarget = getElementFromInitialFocus(this.args.initialFocus);\n } else {\n const tabbableItems = tabbable(this.panel);\n\n if (tabbableItems.length) {\n focusTarget = tabbableItems[0];\n }\n }\n\n // there's a race condition between the popover content becoming visible and this function call\n // if the element isn't visible yet (due to css styling) then it can't accept focus\n // so wait for another render and try again\n if (focusTarget == null) {\n // there isn't a focus target, one of two reasons:\n // #1 is the whole panel hidden? If so, schedule another check\n // #2 panel is visible but no tabbables exist, move focus to the panel\n const panelVisibility = window.getComputedStyle(this.panel).opacity;\n\n if (panelVisibility === '0') {\n // #1\n this.updateFocus();\n } else {\n // #2\n focusTarget = this.panel;\n }\n } else {\n // found an element to focus, but is it visible?\n const visibility = window.getComputedStyle(focusTarget).visibility;\n\n if (visibility === 'hidden') {\n // not visible, check again next render frame\n this.updateFocus();\n }\n }\n\n if (focusTarget != null) {\n this.hasSetInitialFocus = true;\n focusTarget.focus();\n }\n });\n }\n\n @action\n onOpenPopover(): void {\n cancel(this.closingTransitionTimeout as ReturnType<typeof later>);\n // We need to set this state a beat after the render takes place, so that the CSS\n // transition can take effect.\n this.closingTransitionAnimationFrame = window.requestAnimationFrame(() => {\n this.isOpening = true;\n });\n\n // for each child element of `this.panel`, find any transition duration we should wait for before stabilizing\n const { durationMatch, delayMatch } = Array.prototype.slice\n .call(this.panel ? this.panel.children : [])\n .reduce(\n (\n {\n durationMatch,\n delayMatch\n }: { durationMatch: number; delayMatch: number },\n element: HTMLElement\n ) => {\n const transitionTimings = getTransitionTimings(element);\n\n return {\n durationMatch: Math.max(\n durationMatch,\n transitionTimings.durationMatch\n ),\n delayMatch: Math.max(delayMatch, transitionTimings.delayMatch)\n };\n },\n { durationMatch: 0, delayMatch: 0 }\n );\n\n this.respositionTimeout = later(\n this,\n () => {\n this.isOpenStable = true;\n\n const fn = (): void => {\n this.positionPopoverFixed();\n this.updateFocus();\n };\n\n scheduleOnce('afterRender', this, fn);\n },\n durationMatch + delayMatch\n );\n }\n\n get shouldAccountForOtherPopovers() {\n return this.args.shouldAccountForOtherPopovers ?? true;\n }\n\n checkIfPopoverIsInsideAnotherPopover(ele: HTMLElement) {\n const otherPopover = ele.closest<HTMLDivElement>('div.euiPopover__panel');\n\n this.popoverHost = otherPopover;\n }\n\n @action\n didInsertPopover(ele: HTMLDivElement): void {\n if (this.suppressingPopover) {\n // component was created with isOpen=true; now that it's inserted\n // stop suppressing and start opening\n this.suppressingPopover = false;\n this.isOpening = true;\n\n const fn = (): void => this.onOpenPopover();\n\n scheduleOnce('afterRender', this, fn);\n }\n\n if (this.args.repositionOnScroll) {\n window.addEventListener('scroll', this.positionPopoverFixed, true);\n }\n\n if (this.shouldAccountForOtherPopovers) {\n this.checkIfPopoverIsInsideAnotherPopover(ele);\n }\n\n this.updateFocus();\n }\n\n @action\n didUpdateRepositionOnScroll(): void {\n if (this.args.repositionOnScroll) {\n window.addEventListener('scroll', this.positionPopoverFixed, true);\n } else {\n window.removeEventListener('scroll', this.positionPopoverFixed, true);\n }\n }\n\n @action\n didUpdateIsOpen(): void {\n this.isCurrentlyOpen = this.isOpen;\n\n if (!this.prevIsOpen && this.args.isOpen) {\n this.onOpenPopover();\n }\n\n if (this.prevIsOpen && !this.args.isOpen) {\n // If the user has just closed the popover, queue up the removal of the content after the\n // transition is complete.\n this.isClosing = true;\n this.isOpening = false;\n this.closingTransitionTimeout = later(\n this,\n () => {\n this.isClosing = false;\n },\n 250\n );\n }\n\n this.prevIsOpen = this.args.isOpen;\n }\n\n willDestroy(): void {\n super.willDestroy();\n window.removeEventListener('scroll', this.positionPopoverFixed, true);\n window.removeEventListener('resize', this.positionPopoverFluid);\n this.popoverHost = null;\n this._button = null;\n this.panel = null;\n cancel(this.respositionTimeout as ReturnType<typeof later>);\n cancel(this.closingTransitionTimeout as ReturnType<typeof later>);\n cancelAnimationFrame(this.closingTransitionAnimationFrame as number);\n cancelAnimationFrame(this.updateFocusAnimationFrame as number);\n }\n\n @action\n onMutation(records: MutationRecord[]): void {\n const waitDuration = getWaitDuration(records);\n\n this.positionPopoverFixed();\n\n performOnFrame(waitDuration, this.positionPopoverFixed);\n }\n\n @action\n positionPopover(allowEnforcePosition: boolean): void {\n if (this.button == null || this.panel == null) return;\n\n let position = getPopoverPositionFromAnchorPosition(this.anchorPosition);\n let forcePosition = undefined;\n\n if (\n allowEnforcePosition &&\n this.isOpenStable &&\n this.openPosition != null\n ) {\n position = this.openPosition;\n forcePosition = true;\n }\n\n // get the position of the element relative to the offsetParent, which could be the document\n function getPos(ele: HTMLElement): [number, number] {\n let currTop = 0;\n let currLeft = 0;\n\n if (ele.offsetParent) {\n do {\n currTop += ele.offsetTop;\n currLeft += ele.offsetLeft;\n } while ((ele = ele.offsetParent as HTMLElement));\n } else {\n currTop = ele.offsetTop;\n currLeft = ele.offsetLeft;\n }\n\n return [currTop, currLeft];\n }\n\n const {\n top,\n left,\n position: foundPosition,\n arrow,\n anchorBoundingBox\n } = findPopoverPosition({\n container: this.args.container,\n host: this.shouldAccountForOtherPopovers ? this.popoverHost : null,\n position,\n forcePosition,\n align: getPopoverAlignFromAnchorPosition(this.anchorPosition),\n anchor: this.button,\n popover: this.panel,\n offset:\n !this.args.attachToAnchor && this.hasArrow\n ? 16 + (this.args.offset || 0)\n : 8 + (this.args.offset || 0),\n arrowConfig: {\n arrowWidth: 24,\n arrowBuffer: 10\n },\n returnBoundingBox: this.args.attachToAnchor,\n buffer: this.args.buffer\n });\n\n // the popover's z-index must inherit from the button\n // this keeps a button's popover under a flyout that would cover the button\n // but a popover triggered inside a flyout will appear over that flyout\n const { zIndex: zIndexProp } = this.args;\n const zIndex =\n zIndexProp == null\n ? getElementZIndex(this.button, this.panel) + 2000\n : zIndexProp;\n\n const popoverStyles = {\n top,\n left:\n this.args.attachToAnchor && anchorBoundingBox\n ? anchorBoundingBox.left\n : left,\n zIndex\n };\n\n const willRenderArrow = !this.args.attachToAnchor && this.hasArrow;\n const arrowStyles = willRenderArrow ? arrow : undefined;\n const arrowPosition = foundPosition;\n\n this.popoverStyles = popoverStyles;\n this.arrowStyles = arrowStyles;\n this.arrowPosition = arrowPosition;\n this.openPosition = foundPosition;\n }\n\n get _arrowStyles(): ReturnType<typeof htmlSafe> | undefined {\n const { arrowStyles } = this;\n\n return arrowStyles\n ? htmlSafe(`top: ${arrowStyles?.top}px; left: ${arrowStyles?.left}px;`)\n : undefined;\n }\n\n get _popoverStyles(): { [i: string]: string } {\n const { panelStyle } = this.args;\n const { popoverStyles } = this;\n\n return {\n ...panelStyle,\n top: `${popoverStyles.top}px`,\n left: `${popoverStyles.left}px`,\n zIndex: `${popoverStyles.zIndex}`\n };\n }\n\n get tabindex() {\n if (this.ownFocus) {\n return this.args.tabindex ?? '0';\n }\n\n return '-1';\n }\n\n @action\n positionPopoverFixed(): void {\n this.positionPopover(true);\n }\n\n @action\n positionPopoverFluid(): void {\n this.positionPopover(false);\n }\n\n @action\n registerButton(btn: HTMLDivElement): void {\n this._button = btn;\n this.args.buttonRef?.(btn);\n }\n\n @action\n registerPanel(panel: HTMLElement): void {\n this.panel = panel;\n this.args.panelRef?.(panel);\n\n if (panel === null) {\n // panel has unmounted, restore the state defaults\n this.popoverStyles = DEFAULT_POPOVER_STYLES;\n this.arrowStyles = {};\n this.arrowPosition = null;\n this.openPosition = null;\n this.isOpenStable = false;\n window.removeEventListener('resize', this.positionPopoverFluid);\n } else {\n // panel is coming into existence\n this.positionPopoverFluid();\n window.addEventListener('resize', this.positionPopoverFluid);\n }\n }\n\n <template>\n {{#let\n (randomId)\n (classNames\n (if this.isOpening \"euiPopover-isOpen\")\n position=this.anchorPosition\n display=this.display\n componentName=\"EuiPopover\"\n )\n (classNames\n \"euiPopover__panel\"\n (concat \"euiPopover__panel--\" this.arrowPosition)\n (if this.isOpening \"euiPopover__panel-isOpen\")\n (if\n (or (not this.hasArrow) @attachToAnchor) \"euiPopover__panel-noArrow\"\n )\n (if @attachToAnchor \"euiPopover__panel-isAttached\")\n @panelClassName\n )\n as |descriptionId classes panelClasses|\n }}\n <div\n class={{classes}}\n {{onKey \"_all\" this.onKeyDown priority=1}}\n {{didInsert this.didInsertPopover}}\n {{didUpdate this.didUpdateIsOpen @isOpen}}\n {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}}\n {{didInsert (optional @popoverRef)}}\n ...attributes\n >\n\n {{! button }}\n {{#if (has-block \"button\")}}\n <div\n class=\"euiPopover__anchor {{@anchorClassName}}\"\n {{didInsert this.registerButton}}\n >\n {{yield to=\"button\"}}\n </div>\n {{/if}}\n \n {{! content }}\n {{#if\n (and\n (not this.suppressingPopover)\n (or this.isCurrentlyOpen this.isClosing)\n )\n }}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n {{#let (randomId) as |panelId|}}\n <EuiPanel\n id={{panelId}}\n class={{panelClasses}}\n aria-live={{if this.ownFocus \"off\" \"assertive\"}}\n role=\"dialog\"\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledBy}}\n aria-modal=\"true\"\n aria-describedby={{if this.ownFocus descriptionId}}\n tabindex={{this.tabindex}}\n @hasShadow={{false}}\n @paddingSize={{this.panelPaddingSize}}\n {{simpleStyle this._popoverStyles}}\n {{didInsert this.registerPanel}}\n {{outsideClickDetector onOutsideClick=this.onClickOutside}}\n {{onKey \"Escape\" this.onEscapeKey}}\n {{focusTrap\n isActive=(not\n (or\n (not this.ownFocus) (not this.isOpenStable) this.isClosing\n )\n )\n shouldSelfFocus=this.shouldSelfFocus\n isPaused=this.isFocusTrapPaused\n focusTrapOptions=(merge\n (hash\n returnFocusOnDeactivate=this.isOpenStable\n initialFocus=(or @initialFocus this.panel)\n onDeactivate=(optional @onTrapDeactivation)\n preventScroll=true\n clickOutsideDeactivates=true\n fallbackFocus=(concat \"#\" panelId)\n )\n @focusTrapOptions\n )\n }}\n >\n <div\n class={{concat\n \"euiPopover__panelArrow euiPopover__panelArrow--\"\n this.arrowPosition\n }}\n style={{this._arrowStyles}}\n >\n {{yield to=\"arrowChildren\"}}\n </div>\n {{#if this.ownFocus}}\n <p id={{descriptionId}} {{screenReaderOnly}}>\n You are in a dialog. To close this dialog, hit escape.\n </p>\n {{/if}}\n <div\n {{mutationObserver\n onMutation=this.onMutation\n observerOptions=(merge\n (hash\n attributes=true\n childList=true\n characterData=true\n subtree=true\n )\n @mutationObserverOptions\n )\n }}\n >\n {{yield to=\"content\"}}\n </div>\n </EuiPanel>\n {{/let}}\n </EuiPortal>\n {{/if}}\n\n </div>\n {{/let}}\n </template>\n}\n"],"names":["anchorPositionToPopoverPositionMap","up","right","down","left","getPopoverPositionFromAnchorPosition","anchorPosition","match","length","getPopoverAlignFromAnchorPosition","toLowerCase","ANCHOR_POSITIONS","Object","keys","anchorPositionMapping","DISPLAY","displayMapping","DEFAULT_POPOVER_STYLES","top","getElementFromInitialFocus","initialFocus","initialFocusType","document","querySelector","EuiPopoverComponent","Component","g","prototype","argOrDefaultDecorator","i","void 0","tracked","respositionTimeout","closingTransitionTimeout","closingTransitionAnimationFrame","updateFocusAnimationFrame","hasSetInitialFocus","constructor","owner","args","assert","closePopover","prevIsOpen","isOpen","suppressingPopover","isCurrentlyOpen","button","_button","insert","shouldAccountForOtherPopovers","popoverHost","sibling","children","position","undefined","n","action","onEscapeKey","event","ekEvent","stopPropagation","stopImmediatePropagation","preventDefault","onKeyDown","key","cascadingMenuKeys","ESCAPE","onClickOutside","focusTrapOptions","contains","target","updateFocus","window","requestAnimationFrame","ownFocus","panel","activeElement","focusTarget","tabbableItems","tabbable","panelVisibility","getComputedStyle","opacity","visibility","focus","onOpenPopover","cancel","isOpening","durationMatch","delayMatch","Array","slice","call","reduce","element","transitionTimings","getTransitionTimings","Math","max","later","isOpenStable","fn","positionPopoverFixed","scheduleOnce","checkIfPopoverIsInsideAnotherPopover","ele","otherPopover","closest","didInsertPopover","repositionOnScroll","addEventListener","didUpdateRepositionOnScroll","removeEventListener","didUpdateIsOpen","isClosing","willDestroy","positionPopoverFluid","cancelAnimationFrame","onMutation","records","waitDuration","getWaitDuration","performOnFrame","positionPopover","allowEnforcePosition","forcePosition","openPosition","foundPosition","arrow","anchorBoundingBox","findPopoverPosition","container","host","align","anchor","popover","offset","attachToAnchor","hasArrow","arrowConfig","arrowWidth","arrowBuffer","returnBoundingBox","buffer","zIndex","zIndexProp","getElementZIndex","popoverStyles","willRenderArrow","arrowStyles","arrowPosition","_arrowStyles","htmlSafe","_popoverStyles","panelStyle","tabindex","registerButton","btn","buttonRef","registerPanel","panelRef","setComponentTemplate","precompileTemplate","strictMode","scope","randomId","classNames","concat","or","not","onKey","didInsert","didUpdate","optional","and","EuiPortal","EuiPanel","simpleStyle","outsideClickDetector","focusTrap","merge","hash","screenReaderOnly","mutationObserver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6MA,MAAMA,kCAEF,GAAA;AACFC,EAAAA,EAAI,EAAA,KAAA;AACJC,EAAAA,KAAO,EAAA,OAAA;AACPC,EAAAA,IAAM,EAAA,QAAA;AACNC,EAAAA,IAAM,EAAA;AACR,CAAA;AAEO,SAASC,oCAAAA,CACdC,cAAqC,EACpC;AACD;AACA;AAEA;AACA;AACA;AACA;AACA,EAAA,MAAMC,KAAA,GAAQD,cAAe,CAAAC,KAAK,CAAC,aAAA,CAAA;EAEnC,IAAIA,KAAO,EAAAC,MAAA,IAAUD,KAAM,CAAAC,MAAM,GAAG,CAAG,EAAA;AACrC,IAAA,OAAOR,kCAAkC,CAACO,KAAK,CAAC,CAAA,CAAE,CAAmB;AACvE;EAEA,OAAOP,kCAAkC,CAAC,IAAK,CAAA;AACjD;AAEO,SAASS,iCAAAA,CACdH,cAAqC,EACpC;AACD;AACA;AAEA;AACA;AACA;AACA,EAAA,MAAMC,KAAA,GAAQD,cAAe,CAAAC,KAAK,CAAC,WAAA,CAAA;AAEnC;AACA;AACA;EACA,IAAIA,KAAO,EAAAC,MAAA,IAAUD,KAAM,CAAAC,MAAM,GAAG,CAAG,EAAA;IACrC,OAAOR,kCAAkC,CACvCO,KAAK,CAAC,CAAE,CAAA,EAAEG,cACX;AACH;EAEA,OAAOV,kCAAkC,CAAC,MAAO,CAAA;AACnD;AAEO,MAAMW,gBAAA,GAAmBC,MAAO,CAAAC,IAAI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,SAAA;QAAAC,QAAA;QAAAC,GAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,WAAA;8BAAAC,oBAAA;QAAAC,SAAA;QAAAC,KAAA;QAAAC,IAAA;QAAAC,gBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"eui-switch.js","sources":["../../src/components/eui-switch.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\nimport { and, not } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport EuiIcon from './eui-icon.gts';\n\nexport interface EuiSwitchSignature {\n Element: HTMLButtonElement;\n Args: {\n id?: string;\n /**\n * Whether to render the render the text label\n */\n showLabel?: boolean;\n /**\n * Must be a string if `showLabel` prop is true\n */\n label?: string;\n checked: boolean;\n onChange: (event: MouseEvent) => void;\n disabled?: boolean;\n compressed?: boolean;\n type?: 'submit' | 'reset' | 'button';\n\n containerClass?: string;\n isFakeLabelBlock?: boolean;\n };\n Blocks: {\n default: [];\n label: [];\n };\n}\n\nexport default class EuiSwitch extends Component<EuiSwitchSignature> {\n @action\n onClick(e: MouseEvent): void {\n if (this.args.disabled) {\n return;\n }\n\n (e.target as HTMLInputElement).checked = !this.args.checked;\n\n this.args.onChange?.(e);\n }\n\n <template>\n {{#let\n (argOrDefault @type \"button\")\n (argOrDefault @showLabel true)\n (argOrDefault @id (randomId))\n (randomId)\n (and (has-block \"label\") (not (argOrDefault @isFakeLabelBlock false)))\n as |type showLabel switchId labelId hasLabelBlock|\n }}\n {{#let\n (classNames\n (if @compressed \"euiSwitch--compressed\") \"euiSwitch\" @containerClass\n )\n as |classes|\n }}\n <div class={{classes}}>\n <button\n type={{type}}\n id={{switchId}}\n aria-checked={{if @checked \"true\" \"false\"}}\n class=\"euiSwitch__button\"\n role=\"switch\"\n aria-label={{if (not showLabel) @label}}\n aria-labelledby={{if showLabel labelId undefined}}\n disabled={{@disabled}}\n ...attributes\n {{on \"click\" this.onClick}}\n >\n <span class=\"euiSwitch__body\">\n <span class=\"euiSwitch__thumb\"></span>\n <span class=\"euiSwitch__track\">\n {{#unless @compressed}}\n <EuiIcon\n @type=\"cross\"\n @size=\"m\"\n @iconClasses=\"euiSwitch__icon\"\n />\n <EuiIcon\n @type=\"check\"\n @size=\"m\"\n @iconClasses=\"euiSwitch__icon euiSwitch__icon--checked\"\n />\n {{/unless}}\n </span>\n </span>\n </button>\n {{#if showLabel}}\n {{! template-lint-disable}}\n <span\n class=\"euiSwitch__label\"\n id={{labelId}}\n {{on \"click\" this.onClick}}\n >\n {{#if hasLabelBlock}}\n {{yield to=\"label\"}}\n {{else}}\n {{@label}}\n {{/if}}\n </span>\n {{! template-lint-enable}}\n {{/if}}\n </div>\n {{/let}}\n {{/let}}\n </template>\n}\n"],"names":["EuiSwitch","Component","onClick","e","args","disabled","target","checked","onChange","n","prototype","action","setComponentTemplate","precompileTemplate","strictMode","scope","argOrDefault","randomId","and","not","classNames","on","EuiIcon"],"mappings":";;;;;;;;;;;;AAsCe,MAAMA,kBAAkBC,SAAU,CAAA;EAE/CC,OAAAA,CAAQC,CAAa,EAAQ;AAC3B,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,QAAQ,EAAE;AACtB,MAAA;AACF;IAECF,CAAE,CAAAG,MAAM,CAAsBC,OAAO,GAAG,CAAC,IAAI,CAACH,IAAI,CAACG,OAAO;AAE3D,IAAA,IAAI,CAACH,IAAI,CAACI,QAAQ,GAAGL,CAAA,CAAA;AACvB;AAAA,EAAA;IAAAM,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CATCC,MAAA,CAAA,CAAA;AAAA;AAWD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAgEA,wmDAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,GAAA;QAAAC,GAAA;QAAAC,UAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"eui-switch.js","sources":["../../src/components/eui-switch.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\nimport { and, not } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport EuiIcon from './eui-icon.gts';\n\nexport interface EuiSwitchSignature {\n Element: HTMLButtonElement;\n Args: {\n id?: string;\n /**\n * Whether to render the render the text label\n */\n showLabel?: boolean;\n /**\n * Must be a string if `showLabel` prop is true\n */\n label?: string;\n checked: boolean;\n onChange?: (event: MouseEvent) => void;\n disabled?: boolean;\n compressed?: boolean;\n type?: 'submit' | 'reset' | 'button';\n\n containerClass?: string;\n isFakeLabelBlock?: boolean;\n };\n Blocks: {\n default: [];\n label: [];\n };\n}\n\nexport default class EuiSwitch extends Component<EuiSwitchSignature> {\n @action\n onClick(e: MouseEvent): void {\n if (this.args.disabled) {\n return;\n }\n\n (e.target as HTMLInputElement).checked = !this.args.checked;\n\n this.args.onChange?.(e);\n }\n\n <template>\n {{#let\n (argOrDefault @type \"button\")\n (argOrDefault @showLabel true)\n (argOrDefault @id (randomId))\n (randomId)\n (and (has-block \"label\") (not (argOrDefault @isFakeLabelBlock false)))\n as |type showLabel switchId labelId hasLabelBlock|\n }}\n {{#let\n (classNames\n (if @compressed \"euiSwitch--compressed\") \"euiSwitch\" @containerClass\n )\n as |classes|\n }}\n <div class={{classes}}>\n <button\n type={{type}}\n id={{switchId}}\n aria-checked={{if @checked \"true\" \"false\"}}\n class=\"euiSwitch__button\"\n role=\"switch\"\n aria-label={{if (not showLabel) @label}}\n aria-labelledby={{if showLabel labelId undefined}}\n disabled={{@disabled}}\n ...attributes\n {{on \"click\" this.onClick}}\n >\n <span class=\"euiSwitch__body\">\n <span class=\"euiSwitch__thumb\"></span>\n <span class=\"euiSwitch__track\">\n {{#unless @compressed}}\n <EuiIcon\n @type=\"cross\"\n @size=\"m\"\n @iconClasses=\"euiSwitch__icon\"\n />\n <EuiIcon\n @type=\"check\"\n @size=\"m\"\n @iconClasses=\"euiSwitch__icon euiSwitch__icon--checked\"\n />\n {{/unless}}\n </span>\n </span>\n </button>\n {{#if showLabel}}\n {{! template-lint-disable}}\n <span\n class=\"euiSwitch__label\"\n id={{labelId}}\n {{on \"click\" this.onClick}}\n >\n {{#if hasLabelBlock}}\n {{yield to=\"label\"}}\n {{else}}\n {{@label}}\n {{/if}}\n </span>\n {{! template-lint-enable}}\n {{/if}}\n </div>\n {{/let}}\n {{/let}}\n </template>\n}\n"],"names":["EuiSwitch","Component","onClick","e","args","disabled","target","checked","onChange","n","prototype","action","setComponentTemplate","precompileTemplate","strictMode","scope","argOrDefault","randomId","and","not","classNames","on","EuiIcon"],"mappings":";;;;;;;;;;;;AAsCe,MAAMA,kBAAkBC,SAAU,CAAA;EAE/CC,OAAAA,CAAQC,CAAa,EAAQ;AAC3B,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,QAAQ,EAAE;AACtB,MAAA;AACF;IAECF,CAAE,CAAAG,MAAM,CAAsBC,OAAO,GAAG,CAAC,IAAI,CAACH,IAAI,CAACG,OAAO;AAE3D,IAAA,IAAI,CAACH,IAAI,CAACI,QAAQ,GAAGL,CAAA,CAAA;AACvB;AAAA,EAAA;IAAAM,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CATCC,MAAA,CAAA,CAAA;AAAA;AAWD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAgEA,wmDAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,GAAA;QAAAC,GAAA;QAAAC,UAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -8,7 +8,7 @@ import { precompileTemplate } from '@ember/template-compilation';
8
8
  import { setComponentTemplate } from '@ember/component';
9
9
  import templateOnly from '@ember/component/template-only';
10
10
 
11
- const EuiTextArea = setComponentTemplate(precompileTemplate("\n {{#let (classNames (if @fullWidth \"euiTextArea--fullWidth\") (if @compressed \"euiTextArea--compressed\") componentName=\"EuiTextArea\" resize=(argOrDefault @resize \"vertical\")) (if @rows @rows (if @compressed 3 6)) (argOrDefault @id (randomId)) as |classes definedRows id|}}\n <textarea id={{id}} value={{@value}} class={{classes}} rows={{definedRows}} disabled={{@disabled}} ...attributes {{validatableControl @isInvalid}} {{didInsert (optional @inputRef)}}>\n {{yield}}\n </textarea>\n {{/let}}\n", {
11
+ const EuiTextArea = setComponentTemplate(precompileTemplate("\n {{#let (classNames (if @fullWidth \"euiTextArea--fullWidth\") (if @compressed \"euiTextArea--compressed\") componentName=\"EuiTextArea\" resize=(argOrDefault @resize \"vertical\")) (if @rows @rows (if @compressed 3 6)) (argOrDefault @id (randomId)) as |classes definedRows id|}}\n <textarea id={{id}} value={{@value}} class={{classes}} rows={{definedRows}} disabled={{@disabled}} readonly={{@readOnly}} ...attributes {{validatableControl @isInvalid}} {{didInsert (optional @inputRef)}}>\n {{yield}}\n </textarea>\n {{/let}}\n", {
12
12
  strictMode: true,
13
13
  scope: () => ({
14
14
  classNames,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-text-area.js","sources":["../../src/components/eui-text-area.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\n\nimport type { resizeMapping } from '../utils/css-mappings/eui-text-area.ts';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiTextAreaSignature {\n Element: HTMLTextAreaElement;\n Args: {\n id?: string;\n value?: string;\n fullWidth?: boolean;\n compressed?: boolean;\n disabled?: boolean;\n isInvalid?: boolean;\n inputRef?: (element: HTMLTextAreaElement | null) => void;\n rows?: number;\n resize?: keyof typeof resizeMapping;\n };\n Blocks: {\n default: [];\n };\n}\n\nconst EuiTextArea: TemplateOnlyComponent<EuiTextAreaSignature> = <template>\n {{#let\n (classNames\n (if @fullWidth \"euiTextArea--fullWidth\")\n (if @compressed \"euiTextArea--compressed\")\n componentName=\"EuiTextArea\"\n resize=(argOrDefault @resize \"vertical\")\n )\n (if @rows @rows (if @compressed 3 6))\n (argOrDefault @id (randomId))\n as |classes definedRows id|\n }}\n <textarea\n id={{id}}\n value={{@value}}\n class={{classes}}\n rows={{definedRows}}\n disabled={{@disabled}}\n ...attributes\n {{validatableControl @isInvalid}}\n {{didInsert (optional @inputRef)}}\n >\n {{yield}}\n </textarea>\n {{/let}}\n</template>;\n\nexport default EuiTextArea;\n"],"names":["EuiTextArea","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","argOrDefault","randomId","validatableControl","didInsert","optional","templateOnly"],"mappings":";;;;;;;;;;AA8BA,MAAMA,WAA2D,GAAAC,oBAAA,CAAAC,kBAAA,CAyBjE,wgBAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,kBAAA;IAAAC,SAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"eui-text-area.js","sources":["../../src/components/eui-text-area.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\n\nimport type { resizeMapping } from '../utils/css-mappings/eui-text-area.ts';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiTextAreaSignature {\n Element: HTMLTextAreaElement;\n Args: {\n id?: string;\n value?: string;\n fullWidth?: boolean;\n compressed?: boolean;\n disabled?: boolean;\n isInvalid?: boolean;\n inputRef?: (element: HTMLTextAreaElement | null) => void;\n rows?: number;\n resize?: keyof typeof resizeMapping;\n readOnly?: boolean;\n };\n Blocks: {\n default: [];\n };\n}\n\nconst EuiTextArea: TemplateOnlyComponent<EuiTextAreaSignature> = <template>\n {{#let\n (classNames\n (if @fullWidth \"euiTextArea--fullWidth\")\n (if @compressed \"euiTextArea--compressed\")\n componentName=\"EuiTextArea\"\n resize=(argOrDefault @resize \"vertical\")\n )\n (if @rows @rows (if @compressed 3 6))\n (argOrDefault @id (randomId))\n as |classes definedRows id|\n }}\n <textarea\n id={{id}}\n value={{@value}}\n class={{classes}}\n rows={{definedRows}}\n disabled={{@disabled}}\n readonly={{@readOnly}}\n ...attributes\n {{validatableControl @isInvalid}}\n {{didInsert (optional @inputRef)}}\n >\n {{yield}}\n </textarea>\n {{/let}}\n</template>;\n\nexport default EuiTextArea;\n"],"names":["EuiTextArea","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","argOrDefault","randomId","validatableControl","didInsert","optional","templateOnly"],"mappings":";;;;;;;;;;AA+BA,MAAMA,WAA2D,GAAAC,oBAAA,CAAAC,kBAAA,CA0BjE,+hBAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,kBAAA;IAAAC,SAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hex-to-rgb.js","sources":["../../src/helpers/hex-to-rgb.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// Convert hexadecimal color into an array of RGB integer values\n// Modified from https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb\n\nimport { helper } from '@ember/component/helper';\n\nexport function hexToRgb(hex: string): rgbDef {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n\n hex = hex.replace(\n shorthandRegex,\n (_m, r1, g1, b1) => r1 + r1 + g1 + g1 + b1 + b1\n );\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)!;\n\n if (result) {\n const [, r, g, b] = result;\n\n return [parseInt(r!, 16), parseInt(g!, 16), parseInt(b!, 16)];\n }\n\n // fallback to prevent errors\n return [0, 0, 0];\n}\n\nexport default helper(function ([hex]: [string]) {\n return hexToRgb(hex);\n});\n"],"names":["hexToRgb","hex","shorthandRegex","replace","_m","r1","g1","b1","result","exec","r","g","b","parseInt","helper"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,SAASA,QAAQA,CAACC,GAAW,EAAU;AAC5C;EACA,MAAMC,cAAc,GAAG,kCAAkC;EAEzDD,GAAG,GAAGA,GAAG,CAACE,OAAO,CACfD,cAAc,EACd,CAACE,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,EAAE,KAAKF,EAAE,GAAGA,EAAE,GAAGC,EAAE,GAAGA,EAAE,GAAGC,EAAE,GAAGA,EAC/C,CAAC;AAED,EAAA,MAAMC,MAAM,GAAG,2CAA2C,CAACC,IAAI,CAACR,GAAG,CAAE;AAErE,EAAA,IAAIO,MAAM,EAAE;IACV,MAAM,GAAGE,CAAC,EAAEC,CAAC,EAAEC,CAAC,CAAC,GAAGJ,MAAM;IAE1B,OAAO,CAACK,QAAQ,CAACH,CAAC,EAAG,EAAE,CAAC,EAAEG,QAAQ,CAACF,CAAC,EAAG,EAAE,CAAC,EAAEE,QAAQ,CAACD,CAAC,EAAG,EAAE,CAAC,CAAC;AAC/D;;AAEA;AACA,EAAA,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAClB;AAEA,iBAAeE,MAAM,CAAC,UAAU,CAACb,GAAG,CAAW,EAAE;EAC/C,OAAOD,QAAQ,CAACC,GAAG,CAAC;AACtB,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"hex-to-rgb.js","sources":["../../src/helpers/hex-to-rgb.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// Convert hexadecimal color into an array of RGB integer values\n// Modified from https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb\n\nimport { helper } from '@ember/component/helper';\n\ntype rgbDef = [number, number, number];\n\nexport function hexToRgb(hex: string): rgbDef {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n\n hex = hex.replace(\n shorthandRegex,\n (_m, r1, g1, b1) => r1 + r1 + g1 + g1 + b1 + b1\n );\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)!;\n\n if (result) {\n const [, r, g, b] = result;\n\n return [parseInt(r!, 16), parseInt(g!, 16), parseInt(b!, 16)];\n }\n\n // fallback to prevent errors\n return [0, 0, 0];\n}\n\nexport default helper(function ([hex]: [string]) {\n return hexToRgb(hex);\n});\n"],"names":["hexToRgb","hex","shorthandRegex","replace","_m","r1","g1","b1","result","exec","r","g","b","parseInt","helper"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASO,SAASA,QAAQA,CAACC,GAAW,EAAU;AAC5C;EACA,MAAMC,cAAc,GAAG,kCAAkC;EAEzDD,GAAG,GAAGA,GAAG,CAACE,OAAO,CACfD,cAAc,EACd,CAACE,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,EAAE,KAAKF,EAAE,GAAGA,EAAE,GAAGC,EAAE,GAAGA,EAAE,GAAGC,EAAE,GAAGA,EAC/C,CAAC;AAED,EAAA,MAAMC,MAAM,GAAG,2CAA2C,CAACC,IAAI,CAACR,GAAG,CAAE;AAErE,EAAA,IAAIO,MAAM,EAAE;IACV,MAAM,GAAGE,CAAC,EAAEC,CAAC,EAAEC,CAAC,CAAC,GAAGJ,MAAM;IAE1B,OAAO,CAACK,QAAQ,CAACH,CAAC,EAAG,EAAE,CAAC,EAAEG,QAAQ,CAACF,CAAC,EAAG,EAAE,CAAC,EAAEE,QAAQ,CAACD,CAAC,EAAG,EAAE,CAAC,CAAC;AAC/D;;AAEA;AACA,EAAA,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAClB;AAEA,iBAAeE,MAAM,CAAC,UAAU,CAACb,GAAG,CAAW,EAAE;EAC/C,OAAOD,QAAQ,CAACC,GAAG,CAAC;AACtB,CAAC,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "13.0.1",
3
+ "version": "13.0.3",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",