@ember-eui/core 16.0.1 → 16.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.
- package/declarations/-private/associate-form-row-label.d.ts +9 -0
- package/declarations/-private/associate-form-row-label.d.ts.map +1 -0
- package/declarations/-private/vis-colors.d.ts +8 -0
- package/declarations/-private/vis-colors.d.ts.map +1 -0
- package/declarations/components/eui-aspect-ratio.d.ts +5 -0
- package/declarations/components/eui-aspect-ratio.d.ts.map +1 -1
- package/declarations/components/eui-avatar.d.ts +6 -0
- package/declarations/components/eui-avatar.d.ts.map +1 -1
- package/declarations/components/eui-basic-table.d.ts.map +1 -1
- package/declarations/components/eui-color-picker.d.ts +3 -0
- package/declarations/components/eui-color-picker.d.ts.map +1 -1
- package/declarations/components/eui-color-stops/thumb.d.ts +3 -1
- package/declarations/components/eui-color-stops/thumb.d.ts.map +1 -1
- package/declarations/components/eui-combo-box/trigger/input.d.ts +9 -0
- package/declarations/components/eui-combo-box/trigger/input.d.ts.map +1 -1
- package/declarations/components/eui-combo-box/trigger.d.ts +13 -0
- package/declarations/components/eui-combo-box/trigger.d.ts.map +1 -1
- package/declarations/components/eui-combo-box.d.ts +26 -0
- package/declarations/components/eui-combo-box.d.ts.map +1 -1
- package/declarations/components/eui-data-grid/body.d.ts +2 -0
- package/declarations/components/eui-data-grid/body.d.ts.map +1 -1
- package/declarations/components/eui-data-grid.d.ts.map +1 -1
- package/declarations/components/eui-dual-range.d.ts +2 -0
- package/declarations/components/eui-dual-range.d.ts.map +1 -1
- package/declarations/components/eui-focus-trap.d.ts +1 -0
- package/declarations/components/eui-focus-trap.d.ts.map +1 -1
- package/declarations/components/eui-global-toast-list.d.ts +8 -1
- package/declarations/components/eui-global-toast-list.d.ts.map +1 -1
- package/declarations/components/eui-markdown-editor-drop-zone.d.ts.map +1 -1
- package/declarations/components/eui-markdown-editor.d.ts.map +1 -1
- package/declarations/components/eui-markdown-format.d.ts +2 -0
- package/declarations/components/eui-markdown-format.d.ts.map +1 -1
- package/declarations/components/eui-overlay-mask.d.ts +5 -2
- package/declarations/components/eui-overlay-mask.d.ts.map +1 -1
- package/declarations/components/eui-popover.d.ts +5 -1
- package/declarations/components/eui-popover.d.ts.map +1 -1
- package/declarations/components/eui-range.d.ts +3 -0
- package/declarations/components/eui-range.d.ts.map +1 -1
- package/declarations/components/eui-saturation.d.ts +3 -1
- package/declarations/components/eui-saturation.d.ts.map +1 -1
- package/declarations/components/eui-search-bar/field-value-selection-filter.d.ts.map +1 -1
- package/declarations/components/eui-text-color.d.ts +6 -0
- package/declarations/components/eui-text-color.d.ts.map +1 -1
- package/declarations/components/eui-text.d.ts.map +1 -1
- package/declarations/components/eui-token.d.ts +11 -0
- package/declarations/components/eui-token.d.ts.map +1 -1
- package/declarations/components/eui-tool-tip.d.ts +1 -2
- package/declarations/components/eui-tool-tip.d.ts.map +1 -1
- package/declarations/modifiers/outside-click-detector.d.ts +3 -0
- package/declarations/modifiers/outside-click-detector.d.ts.map +1 -1
- package/declarations/modifiers/resize-observer.d.ts +3 -0
- package/declarations/modifiers/resize-observer.d.ts.map +1 -1
- package/declarations/services/eui-config.d.ts +5 -0
- package/declarations/services/eui-config.d.ts.map +1 -1
- package/declarations/utils/common.d.ts +42 -0
- package/declarations/utils/common.d.ts.map +1 -0
- package/declarations/utils/css-mappings/eui-avatar.d.ts +1 -1
- package/declarations/utils/css-mappings/eui-text.d.ts +1 -0
- package/declarations/utils/css-mappings/eui-text.d.ts.map +1 -1
- package/declarations/utils/eui/combo-box.d.ts +1 -1
- package/declarations/utils/eui/combo-box.d.ts.map +1 -1
- package/declarations/utils/eui/content-blocks.d.ts +14 -0
- package/declarations/utils/eui/content-blocks.d.ts.map +1 -0
- package/declarations/utils/eui/flyout-manager/reducer.d.ts.map +1 -1
- package/declarations/utils/eui/styles.d.ts +5 -0
- package/declarations/utils/eui/styles.d.ts.map +1 -1
- package/declarations/utils/retain-document-listener.d.ts +8 -0
- package/declarations/utils/retain-document-listener.d.ts.map +1 -0
- package/declarations/utils/token-map.d.ts +11 -0
- package/declarations/utils/token-map.d.ts.map +1 -0
- package/declarations/utils/transition.d.ts +1 -1
- package/declarations/utils/transition.d.ts.map +1 -1
- package/dist/components/eui-aspect-ratio.js +20 -5
- package/dist/components/eui-aspect-ratio.js.map +1 -1
- package/dist/components/eui-avatar.js +16 -4
- package/dist/components/eui-avatar.js.map +1 -1
- package/dist/components/eui-basic-table.js +4 -2
- package/dist/components/eui-basic-table.js.map +1 -1
- package/dist/components/eui-color-picker.js +8 -2
- package/dist/components/eui-color-picker.js.map +1 -1
- package/dist/components/eui-color-stops/thumb.js +17 -5
- package/dist/components/eui-color-stops/thumb.js.map +1 -1
- package/dist/components/eui-combo-box/trigger/input.js +23 -2
- package/dist/components/eui-combo-box/trigger/input.js.map +1 -1
- package/dist/components/eui-combo-box/trigger.js +32 -2
- package/dist/components/eui-combo-box/trigger.js.map +1 -1
- package/dist/components/eui-combo-box.js +40 -5
- package/dist/components/eui-combo-box.js.map +1 -1
- package/dist/components/eui-data-grid/body.js +21 -1
- package/dist/components/eui-data-grid/body.js.map +1 -1
- package/dist/components/eui-data-grid.js +6 -4
- package/dist/components/eui-data-grid.js.map +1 -1
- package/dist/components/eui-dual-range.js +5 -2
- package/dist/components/eui-dual-range.js.map +1 -1
- package/dist/components/eui-focus-trap.js +4 -1
- package/dist/components/eui-focus-trap.js.map +1 -1
- package/dist/components/eui-global-toast-list.js +33 -5
- package/dist/components/eui-global-toast-list.js.map +1 -1
- package/dist/components/eui-markdown-editor-drop-zone.js +2 -0
- package/dist/components/eui-markdown-editor-drop-zone.js.map +1 -1
- package/dist/components/eui-markdown-editor.js +3 -1
- package/dist/components/eui-markdown-editor.js.map +1 -1
- package/dist/components/eui-markdown-format.js +9 -3
- package/dist/components/eui-markdown-format.js.map +1 -1
- package/dist/components/eui-overlay-mask.js +2 -0
- package/dist/components/eui-overlay-mask.js.map +1 -1
- package/dist/components/eui-popover.js +22 -2
- package/dist/components/eui-popover.js.map +1 -1
- package/dist/components/eui-range.js +10 -3
- package/dist/components/eui-range.js.map +1 -1
- package/dist/components/eui-saturation.js +16 -4
- package/dist/components/eui-saturation.js.map +1 -1
- package/dist/components/eui-search-bar/field-value-selection-filter.js +8 -3
- package/dist/components/eui-search-bar/field-value-selection-filter.js.map +1 -1
- package/dist/components/eui-text-color.js +20 -6
- package/dist/components/eui-text-color.js.map +1 -1
- package/dist/components/eui-text.js +6 -3
- package/dist/components/eui-text.js.map +1 -1
- package/dist/components/eui-token.js +31 -17
- package/dist/components/eui-token.js.map +1 -1
- package/dist/components/eui-tool-tip.js +9 -17
- package/dist/components/eui-tool-tip.js.map +1 -1
- package/dist/icons-DCTZo11a.js.map +1 -1
- package/dist/modifiers/outside-click-detector.js +12 -2
- package/dist/modifiers/outside-click-detector.js.map +1 -1
- package/dist/modifiers/resize-observer.js +19 -4
- package/dist/modifiers/resize-observer.js.map +1 -1
- package/dist/services/eui-config.js.map +1 -1
- package/dist/utils/eui/combo-box.js +6 -2
- package/dist/utils/eui/combo-box.js.map +1 -1
- package/dist/utils/eui/flyout-manager/reducer.js +7 -1
- package/dist/utils/eui/flyout-manager/reducer.js.map +1 -1
- package/dist/utils/eui/styles.js +5 -0
- package/dist/utils/eui/styles.js.map +1 -1
- package/dist/utils/retain-document-listener.js +30 -0
- package/dist/utils/retain-document-listener.js.map +1 -0
- package/dist/utils/transition.js +8 -3
- package/dist/utils/transition.js.map +1 -1
- package/package.json +2 -2
- package/declarations/modifiers/open-collapsible-nav.d.ts +0 -9
- package/declarations/modifiers/open-collapsible-nav.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-markdown-format.js","sources":["../../src/components/eui-markdown-format.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { isArray } from '@ember/array';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport unified from 'unified';\n\nimport { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport {\n euiMarkdownFormatStyles,\n euiTextStyles\n} from '../utils/eui/styles.generated.ts';\nimport {\n defaultParsingPlugins,\n defaultProcessingPlugins\n} from '../utils/markdown/plugins/markdown-default-plugins/index.ts';\nimport { toDOM } from '../utils/markdown/plugins/to-dom.ts';\nimport { euiTextAlignCss } from './eui-text-align.gts';\nimport { TEXT_COLORS, euiTextColorCss } from './eui-text-color.gts';\nimport { euiTextReset } from './eui-text.gts';\n\nimport type {\n EuiMarkdownAstNodePosition,\n RehypeNode\n} from '../utils/markdown/markdown-types';\nimport type { EuiTextAlignment } from './eui-text-align.gts';\nimport type { EuiTextColorValue } from './eui-text-color.gts';\nimport type { EuiTextSignature } from './eui-text.gts';\nimport type { CSSObject } from '@emotion/css/create-instance';\nimport type { Processor } from 'unified';\n\nexport type Replacer = (\n position: EuiMarkdownAstNodePosition,\n str: string\n) => void;\n\n/** React's global table reset, which EuiText's scoped reset leaves out. */\nconst TABLE_RESET: CSSObject = {\n '& :where(table)': { borderCollapse: 'collapse', borderSpacing: 0 }\n};\n\n/**\n * Ember-only structure: plugin components render inside `<span|div\n * class=\"component\">` wrappers, so upstream's task list rule\n * (`.euiCheckbox:has(+ :not(.euiCheckbox))`, see `utils/eui/markdown.ts`)\n * moves to the checkbox wrappers, which become blocks like upstream's\n * `EuiCheckbox` root.\n */\nconst markdownFormatEmberCss: CSSObject = {\n '& .euiMarkdownFormat__checkbox': { display: 'block' },\n '& .euiMarkdownFormat__checkbox:has(+ :not(.euiMarkdownFormat__checkbox))':\n { marginBlockEnd: '1em' }\n};\n\ntype MarkdownFormatColor = keyof ReturnType<\n typeof euiMarkdownFormatStyles\n>['colors'];\n\n/**\n * Renders markdown as EUI-styled content (headings, lists, code blocks,\n * tables, checkboxes, tooltips and emoji):\n * `<EuiMarkdownFormat @value={{this.markdown}} />`. Attributes go to the\n * root `<div class=\"euiMarkdownFormat\">`.\n */\nexport interface EuiMarkdownFormatSignature {\n Element: HTMLDivElement;\n Args: {\n /** remark parsing plugins. Defaults to `getDefaultEuiMarkdownParsingPlugins()`. */\n parsingPluginList?: typeof defaultParsingPlugins;\n /** Processing plugins. Defaults to `getDefaultEuiMarkdownProcessingPlugins()`. */\n processingPluginList?: typeof defaultProcessingPlugins;\n /**\n * Called when rendered content edits the markdown, e.g. clicking a\n * task list checkbox (`- [ ] todo`), with the node's position in the\n * source and its new text. Splice it into your value to make checkboxes\n * interactive; EuiMarkdownEditor does this for you.\n */\n replaceNode?: Replacer;\n /** Renders interactive plugin content (task list checkboxes) read-only. */\n readOnly?: boolean;\n /** The markdown to render. */\n value: string;\n /** Extra class(es) for the root element: a string or an array of strings. */\n rootClasses?: string | string[];\n /**\n * Text size, any `EuiText` size; `'relative'` scales with the parent's\n * font size. Defaults to `'m'`.\n */\n textSize?: EuiTextSignature['Args']['size'];\n /**\n * Any EuiText color: a named color (`'subdued'`, `'danger'`…) or a CSS\n * color. Also tints blockquote, rule and table borders. Defaults to\n * `'default'`.\n */\n color?: EuiTextColorValue;\n /**\n * Applies EuiText typography (and the `euiText` class) to the content.\n * Defaults to `true`; `false` keeps only the markdown-specific styles.\n */\n shouldIncludeDefaultRootClasses?: boolean;\n /**\n * The root element: `'div'` (default), `'span'` or `'p'` (upstream\n * EuiText's `component`). Only `'div'` can hold block content such as\n * headings, lists and tables.\n */\n component?: 'div' | 'span' | 'p';\n /**\n * `true` (default) lets the text span the container's full width;\n * `false` caps lines at a readable width (EuiText's `grow`).\n */\n grow?: boolean;\n /** `'left'`, `'center'` or `'right'` (logical, so they flip in RTL). */\n textAlign?: EuiTextAlignment;\n };\n}\n\n/**\n * The root tag. Typed as `'div'` so callers keep `HTMLDivElement`\n * attributes; `@component` may be `'span'` or `'p'` too.\n */\nfunction tagName(component: string | undefined): 'div' {\n return (component || 'div') as 'div';\n}\n\nexport default class EuiMarkdownFormat extends Component<EuiMarkdownFormatSignature> {\n get parsingPluginList() {\n return this.args.parsingPluginList || defaultParsingPlugins;\n }\n\n get processingPluginList() {\n return this.args.processingPluginList || defaultProcessingPlugins;\n }\n\n @cached\n get processor() {\n const Compiler = (tree: any) => {\n return tree;\n };\n\n function identityCompiler(this: Processor) {\n //eslint-disable-next-line\n this.Compiler = Compiler;\n }\n\n return unified()\n .use(this.parsingPluginList)\n .use(this.processingPluginList)\n .use(identityCompiler);\n }\n\n get shouldIncludeDefaultRootClasses() {\n return this.args.shouldIncludeDefaultRootClasses ?? true;\n }\n\n get textSize() {\n return this.args.textSize || 'm';\n }\n\n get color(): EuiTextColorValue {\n return this.args.color ?? 'default';\n }\n\n @cached\n get extraRootClasses(): string[] {\n const { rootClasses } = this.args;\n\n if (!rootClasses) return [];\n\n return isArray(rootClasses)\n ? (rootClasses as string[])\n : (rootClasses as string).trim().split(/\\s+/);\n }\n\n /** Upstream: EuiText (size, color) with the markdown css composed last. */\n @cached\n get styleClass() {\n const context = getEuiThemeContext(this);\n const markdown = useEuiBorealisStyles(context, euiMarkdownFormatStyles);\n const size = this.textSize;\n const color = this.color;\n const { grow, textAlign } = this.args;\n // Upstream EuiText: `constrainedWidth` unless it grows, and the\n // alignment last (EuiTextAlign clones the element).\n const align = textAlign ? euiTextAlignCss(textAlign) : undefined;\n const borderColor: MarkdownFormatColor = (\n TEXT_COLORS as readonly string[]\n ).includes(color)\n ? (color as MarkdownFormatColor)\n : 'custom';\n\n if (!this.shouldIncludeDefaultRootClasses) {\n return euiClass(\n context,\n markdown.euiMarkdownFormat,\n markdown[size],\n markdown.colors[borderColor],\n markdownFormatEmberCss,\n align\n );\n }\n\n const text = useEuiBorealisStyles(context, euiTextStyles);\n\n return euiClass(\n context,\n euiTextReset(context.upstream),\n TABLE_RESET,\n text.euiText,\n grow === false ? text.constrainedWidth : undefined,\n text[size],\n euiTextColorCss(context, color),\n markdown.euiMarkdownFormat,\n markdown[size],\n markdown.colors[borderColor],\n markdownFormatEmberCss,\n align\n );\n }\n\n @cached\n get rootClassName() {\n return [\n 'euiMarkdownFormat',\n this.shouldIncludeDefaultRootClasses ? 'euiText' : undefined,\n this.styleClass,\n ...this.extraRootClasses\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n @cached\n get result() {\n try {\n const processed = this.processor.processSync(this.args.value);\n const { element, components } = toDOM(processed['result'] as RehypeNode);\n\n return {\n nodes: element ? Array.from(element.childNodes) : [],\n components\n };\n } catch (e) {\n console.warn(e);\n }\n\n return null;\n }\n\n <template>\n {{! This hbs was inspired by https://github.com/ampatspell/ember-cli-remark-static/blob/v3.0.5/addon/components/remark.hbs }}\n {{#let (element (tagName @component)) as |Tag|}}\n <Tag class={{this.rootClassName}} ...attributes>\n {{#if this.result}}\n {{#each this.result.nodes as |node|}}{{node}}{{/each}}\n {{/if}}\n </Tag>\n {{/let}}\n {{#if this.result}}\n {{#each this.result.components as |CompNode|}}\n {{#in-element CompNode.element}}\n {{#if CompNode.componentName}}\n {{#let\n (component CompNode.componentName)\n as |DynamicComponent|\n }}\n <DynamicComponent\n @replaceNode={{optional @replaceNode}}\n @readOnly={{@readOnly}}\n @node={{CompNode}}\n />\n {{/let}}\n {{/if}}\n {{/in-element}}\n {{/each}}\n {{/if}}\n </template>\n}\n"],"names":["TABLE_RESET","borderCollapse","borderSpacing","markdownFormatEmberCss","display","marginBlockEnd","tagName","component","EuiMarkdownFormat","Component","parsingPluginList","args","defaultParsingPlugins","processingPluginList","defaultProcessingPlugins","processor","Compiler","tree","identityCompiler","unified","use","n","prototype","cached","shouldIncludeDefaultRootClasses","textSize","color","extraRootClasses","rootClasses","isArray","trim","split","styleClass","context","getEuiThemeContext","markdown","useEuiBorealisStyles","euiMarkdownFormatStyles","size","grow","textAlign","align","euiTextAlignCss","undefined","borderColor","TEXT_COLORS","includes","euiClass","euiMarkdownFormat","colors","text","euiTextStyles","euiTextReset","upstream","euiText","constrainedWidth","euiTextColorCss","rootClassName","filter","Boolean","join","result","processed","processSync","value","element","components","toDOM","nodes","Array","from","childNodes","e","console","warn","setComponentTemplate","precompileTemplate","strictMode","scope","optional"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,2EACA,MAAMA,WAAa,GAAY;AAC7B,EAAA,iBAAA,EAAmB;AAAEC,IAAAA,cAAA,EAAgB,UAAA;AAAYC,IAAAA,aAAA,EAAe;AAAE;AACpE,CAAA;AAEA;;;;;;;AAOA,MAAMC,sBAAwB,GAAY;AACxC,EAAA,gCAAA,EAAkC;AAAEC,IAAAA,OAAA,EAAS;GAAQ;AACrD,EAAA,0EAAA,EACE;AAAEC,IAAAA,cAAA,EAAgB;AAAM;AAC5B,CAAA;;AAMA;;;;;AAKC;;AAqDD;;;AAGC;AACD,SAASC,OAAAA,CAAQC,SAA6B,EAAG;EAC/C,OAAQA,SAAA,IAAa,KAAK;AAC5B;AAEe,MAAMC,0BAA0BC,SAAA,CAAU;EACvD,IAAIC,iBAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,iBAAiB,IAAIE,qBAAA;AACxC,EAAA;EAEA,IAAIC,oBAAAA,GAAuB;AACzB,IAAA,OAAO,IAAI,CAACF,IAAI,CAACE,oBAAoB,IAAIC,wBAAA;AAC3C,EAAA;EAEA,IACIC,SAAAA,GAAY;IACd,MAAMC,QAAA,GAAYC,IAAS,IAAA;AACzB,MAAA,OAAOA,IAAA;IACT,CAAA;IAEA,SAASC,gBAAAA,GAAgC;AACvC;MACA,IAAI,CAACF,QAAQ,GAAGA,QAAA;AAClB,IAAA;IAEA,OAAOG,OAAA,EAAA,CACJC,GAAG,CAAC,IAAI,CAACV,iBAAiB,CAAA,CAC1BU,GAAG,CAAC,IAAI,CAACP,oBAAoB,CAAA,CAC7BO,GAAG,CAACF,gBAAA,CAAA;AACT,EAAA;AAAA,EAAA;IAAAG,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAfCC,MAAA,CAAA,CAAA;AAAA;EAiBD,IAAIC,+BAAAA,GAAkC;AACpC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;MAC5D,MAAM;QAAEC,OAAO;AAAEC,QAAAA;AAAU,OAAE,GAAGC,KAAA,CAAML,SAAS,CAAC,QAAA,CAAa,CAAA;MAE7D,OAAO;AACLM,QAAAA,KAAA,EAAOH,UAAUI,KAAA,CAAMC,IAAI,CAACL,OAAA,CAAQM,UAAU,IAAI,EAAE;AACpDL,QAAAA;OACF;IACF,CAAA,CAAE,OAAOM,CAAA,EAAG;AACVC,MAAAA,OAAA,CAAQC,IAAI,CAACF,CAAA,CAAA;AACf,IAAA;AAEA,IAAA,OAAO,IAAA;AACT,EAAA;AAAA,EAAA;IAAAnD,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAfCC,MAAA,CAAA,CAAA;AAAA;AAiBD,EAAA;IAAAoD,oBAAA,CAAAC,kBAAA,CAAA,6vBAAA,EA2BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAxE,OAAA;AAAAyE,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
1
|
+
{"version":3,"file":"eui-markdown-format.js","sources":["../../src/components/eui-markdown-format.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { isArray } from '@ember/array';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport style from 'ember-style-modifier/modifiers/style';\nimport unified from 'unified';\n\nimport { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport {\n euiMarkdownFormatStyles,\n euiTextStyles\n} from '../utils/eui/styles.generated.ts';\nimport {\n defaultParsingPlugins,\n defaultProcessingPlugins\n} from '../utils/markdown/plugins/markdown-default-plugins/index.ts';\nimport { toDOM } from '../utils/markdown/plugins/to-dom.ts';\nimport { euiTextAlignCss } from './eui-text-align.gts';\nimport {\n TEXT_COLORS,\n euiTextColorCss,\n euiTextColorInlineStyle\n} from './eui-text-color.gts';\nimport { euiTextReset } from './eui-text.gts';\n\nimport type {\n EuiMarkdownAstNodePosition,\n RehypeNode\n} from '../utils/markdown/markdown-types';\nimport type { EuiTextAlignment } from './eui-text-align.gts';\nimport type { EuiTextColorValue } from './eui-text-color.gts';\nimport type { EuiTextSignature } from './eui-text.gts';\nimport type { CSSObject } from '@emotion/css/create-instance';\nimport type { Processor } from 'unified';\n\nexport type Replacer = (\n position: EuiMarkdownAstNodePosition,\n str: string\n) => void;\n\n/** React's global table reset, which EuiText's scoped reset leaves out. */\nconst TABLE_RESET: CSSObject = {\n '& :where(table)': { borderCollapse: 'collapse', borderSpacing: 0 }\n};\n\n/**\n * Ember-only structure: plugin components render inside `<span|div\n * class=\"component\">` wrappers, so upstream's task list rule\n * (`.euiCheckbox:has(+ :not(.euiCheckbox))`, see `utils/eui/markdown.ts`)\n * moves to the checkbox wrappers, which become blocks like upstream's\n * `EuiCheckbox` root.\n */\nconst markdownFormatEmberCss: CSSObject = {\n '& .euiMarkdownFormat__checkbox': { display: 'block' },\n '& .euiMarkdownFormat__checkbox:has(+ :not(.euiMarkdownFormat__checkbox))':\n { marginBlockEnd: '1em' }\n};\n\ntype MarkdownFormatColor = keyof ReturnType<\n typeof euiMarkdownFormatStyles\n>['colors'];\n\n/**\n * Renders markdown as EUI-styled content (headings, lists, code blocks,\n * tables, checkboxes, tooltips and emoji):\n * `<EuiMarkdownFormat @value={{this.markdown}} />`. Attributes go to the\n * root `<div class=\"euiMarkdownFormat\">`.\n */\nexport interface EuiMarkdownFormatSignature {\n Element: HTMLDivElement;\n Args: {\n /** remark parsing plugins. Defaults to `getDefaultEuiMarkdownParsingPlugins()`. */\n parsingPluginList?: typeof defaultParsingPlugins;\n /** Processing plugins. Defaults to `getDefaultEuiMarkdownProcessingPlugins()`. */\n processingPluginList?: typeof defaultProcessingPlugins;\n /**\n * Called when rendered content edits the markdown, e.g. clicking a\n * task list checkbox (`- [ ] todo`), with the node's position in the\n * source and its new text. Splice it into your value to make checkboxes\n * interactive; EuiMarkdownEditor does this for you.\n */\n replaceNode?: Replacer;\n /** Renders interactive plugin content (task list checkboxes) read-only. */\n readOnly?: boolean;\n /** The markdown to render. */\n value: string;\n /** Extra class(es) for the root element: a string or an array of strings. */\n rootClasses?: string | string[];\n /**\n * Text size, any `EuiText` size; `'relative'` scales with the parent's\n * font size. Defaults to `'m'`.\n */\n textSize?: EuiTextSignature['Args']['size'];\n /**\n * Any EuiText color: a named color (`'subdued'`, `'danger'`…) or a CSS\n * color. Also tints blockquote, rule and table borders. Defaults to\n * `'default'`.\n */\n color?: EuiTextColorValue;\n /**\n * Applies EuiText typography (and the `euiText` class) to the content.\n * Defaults to `true`; `false` keeps only the markdown-specific styles.\n */\n shouldIncludeDefaultRootClasses?: boolean;\n /**\n * The root element: `'div'` (default), `'span'` or `'p'` (upstream\n * EuiText's `component`). Only `'div'` can hold block content such as\n * headings, lists and tables.\n */\n component?: 'div' | 'span' | 'p';\n /**\n * `true` (default) lets the text span the container's full width;\n * `false` caps lines at a readable width (EuiText's `grow`).\n */\n grow?: boolean;\n /** `'left'`, `'center'` or `'right'` (logical, so they flip in RTL). */\n textAlign?: EuiTextAlignment;\n };\n}\n\n/**\n * The root tag. Typed as `'div'` so callers keep `HTMLDivElement`\n * attributes; `@component` may be `'span'` or `'p'` too.\n */\nfunction tagName(component: string | undefined): 'div' {\n return (component || 'div') as 'div';\n}\n\nexport default class EuiMarkdownFormat extends Component<EuiMarkdownFormatSignature> {\n get parsingPluginList() {\n return this.args.parsingPluginList || defaultParsingPlugins;\n }\n\n get processingPluginList() {\n return this.args.processingPluginList || defaultProcessingPlugins;\n }\n\n @cached\n get processor() {\n const Compiler = (tree: any) => {\n return tree;\n };\n\n function identityCompiler(this: Processor) {\n //eslint-disable-next-line\n this.Compiler = Compiler;\n }\n\n return unified()\n .use(this.parsingPluginList)\n .use(this.processingPluginList)\n .use(identityCompiler);\n }\n\n get shouldIncludeDefaultRootClasses() {\n return this.args.shouldIncludeDefaultRootClasses ?? true;\n }\n\n get textSize() {\n return this.args.textSize || 'm';\n }\n\n get color(): EuiTextColorValue {\n return this.args.color ?? 'default';\n }\n\n @cached\n get extraRootClasses(): string[] {\n const { rootClasses } = this.args;\n\n if (!rootClasses) return [];\n\n return isArray(rootClasses)\n ? (rootClasses as string[])\n : (rootClasses as string).trim().split(/\\s+/);\n }\n\n /** A custom text color, inline (only with the default EuiText classes). */\n get inlineStyle(): Record<string, string> {\n return this.shouldIncludeDefaultRootClasses\n ? euiTextColorInlineStyle(this.color)\n : {};\n }\n\n /** Upstream: EuiText (size, color) with the markdown css composed last. */\n @cached\n get styleClass() {\n const context = getEuiThemeContext(this);\n const markdown = useEuiBorealisStyles(context, euiMarkdownFormatStyles);\n const size = this.textSize;\n const color = this.color;\n const { grow, textAlign } = this.args;\n // Upstream EuiText: `constrainedWidth` unless it grows, and the\n // alignment last (EuiTextAlign clones the element).\n const align = textAlign ? euiTextAlignCss(textAlign) : undefined;\n const borderColor: MarkdownFormatColor = (\n TEXT_COLORS as readonly string[]\n ).includes(color)\n ? (color as MarkdownFormatColor)\n : 'custom';\n\n if (!this.shouldIncludeDefaultRootClasses) {\n return euiClass(\n context,\n markdown.euiMarkdownFormat,\n markdown[size],\n markdown.colors[borderColor],\n markdownFormatEmberCss,\n align\n );\n }\n\n const text = useEuiBorealisStyles(context, euiTextStyles);\n\n return euiClass(\n context,\n euiTextReset(context.upstream),\n TABLE_RESET,\n text.euiText,\n grow === false ? text.constrainedWidth : undefined,\n text[size],\n euiTextColorCss(context, color),\n markdown.euiMarkdownFormat,\n markdown[size],\n markdown.colors[borderColor],\n markdownFormatEmberCss,\n align\n );\n }\n\n @cached\n get rootClassName() {\n return [\n 'euiMarkdownFormat',\n this.shouldIncludeDefaultRootClasses ? 'euiText' : undefined,\n this.styleClass,\n ...this.extraRootClasses\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n @cached\n get result() {\n try {\n const processed = this.processor.processSync(this.args.value);\n const { element, components } = toDOM(processed['result'] as RehypeNode);\n\n return {\n nodes: element ? Array.from(element.childNodes) : [],\n components\n };\n } catch (e) {\n console.warn(e);\n }\n\n return null;\n }\n\n <template>\n {{! This hbs was inspired by https://github.com/ampatspell/ember-cli-remark-static/blob/v3.0.5/addon/components/remark.hbs }}\n {{#let (element (tagName @component)) as |Tag|}}\n <Tag class={{this.rootClassName}} ...attributes {{style this.inlineStyle}}>\n {{#if this.result}}\n {{#each this.result.nodes as |node|}}{{node}}{{/each}}\n {{/if}}\n </Tag>\n {{/let}}\n {{#if this.result}}\n {{#each this.result.components as |CompNode|}}\n {{#in-element CompNode.element}}\n {{#if CompNode.componentName}}\n {{#let\n (component CompNode.componentName)\n as |DynamicComponent|\n }}\n <DynamicComponent\n @replaceNode={{optional @replaceNode}}\n @readOnly={{@readOnly}}\n @node={{CompNode}}\n />\n {{/let}}\n {{/if}}\n {{/in-element}}\n {{/each}}\n {{/if}}\n </template>\n}\n"],"names":["TABLE_RESET","borderCollapse","borderSpacing","markdownFormatEmberCss","display","marginBlockEnd","tagName","component","EuiMarkdownFormat","Component","parsingPluginList","args","defaultParsingPlugins","processingPluginList","defaultProcessingPlugins","processor","Compiler","tree","identityCompiler","unified","use","n","prototype","cached","shouldIncludeDefaultRootClasses","textSize","color","extraRootClasses","rootClasses","isArray","trim","split","inlineStyle","euiTextColorInlineStyle","styleClass","context","getEuiThemeContext","markdown","useEuiBorealisStyles","euiMarkdownFormatStyles","size","grow","textAlign","align","euiTextAlignCss","undefined","borderColor","TEXT_COLORS","includes","euiClass","euiMarkdownFormat","colors","text","euiTextStyles","euiTextReset","upstream","euiText","constrainedWidth","euiTextColorCss","rootClassName","filter","Boolean","join","result","processed","processSync","value","element","components","toDOM","nodes","Array","from","childNodes","e","console","warn","setComponentTemplate","precompileTemplate","strictMode","scope","style","optional"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0CA,2EACA,MAAMA,WAAa,GAAY;AAC7B,EAAA,iBAAA,EAAmB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,MAAM;QAAEC,OAAO;AAAEC,QAAAA;AAAU,OAAE,GAAGC,KAAA,CAAML,SAAS,CAAC,QAAA,CAAa,CAAA;MAE7D,OAAO;AACLM,QAAAA,KAAA,EAAOH,UAAUI,KAAA,CAAMC,IAAI,CAACL,OAAA,CAAQM,UAAU,IAAI,EAAE;AACpDL,QAAAA;OACF;IACF,CAAA,CAAE,OAAOM,CAAA,EAAG;AACVC,MAAAA,OAAA,CAAQC,IAAI,CAACF,CAAA,CAAA;AACf,IAAA;AAEA,IAAA,OAAO,IAAA;AACT,EAAA;AAAA,EAAA;IAAArD,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAfCC,MAAA,CAAA,CAAA;AAAA;AAiBD,EAAA;IAAAsD,oBAAA,CAAAC,kBAAA,CAAA,wxBAAA,EA2BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAA1E,OAAA;QAAA2E,KAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -12,6 +12,8 @@ import { n } from 'decorator-transforms/runtime-esm';
|
|
|
12
12
|
|
|
13
13
|
const callWith = modifier((element, [callback]) => {
|
|
14
14
|
callback?.(element);
|
|
15
|
+
// like a React ref: `null` when the mask goes away (or the callback changes)
|
|
16
|
+
return () => callback?.(null);
|
|
15
17
|
});
|
|
16
18
|
class EuiOverlayMaskComponent extends Component {
|
|
17
19
|
destinationElement = document.body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-overlay-mask.js","sources":["../../src/components/eui-overlay-mask.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\n\nimport { modifier } from 'ember-modifier';\n\nimport setBodyClass from '../-private/set-body-class.ts';\nimport { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport { euiOverlayMaskStyles } from '../utils/eui/utilities.ts';\n\ninterface EuiOverlayMaskArgs {\n /** Called when the mask itself (not its content) is clicked. */\n onClick?: (e: MouseEvent) => void;\n /**\n * Whether the mask covers the page header (`'above'`, z-index\n * `levels.mask`) or leaves it visible (`'below'`, z-index\n * `levels.maskBelowHeader`, starting below `--euiFixedHeadersOffset`).\n * Defaults to `'above'`.\n */\n headerZindexLocation?: 'above' | 'below';\n /** Fades the mask in. Defaults to `true`. */\n hasAnimation?: boolean;\n
|
|
1
|
+
{"version":3,"file":"eui-overlay-mask.js","sources":["../../src/components/eui-overlay-mask.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\n\nimport { modifier } from 'ember-modifier';\n\nimport setBodyClass from '../-private/set-body-class.ts';\nimport { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport { euiOverlayMaskStyles } from '../utils/eui/utilities.ts';\n\ninterface EuiOverlayMaskArgs {\n /** Called when the mask itself (not its content) is clicked. */\n onClick?: (e: MouseEvent) => void;\n /**\n * Whether the mask covers the page header (`'above'`, z-index\n * `levels.mask`) or leaves it visible (`'below'`, z-index\n * `levels.maskBelowHeader`, starting below `--euiFixedHeadersOffset`).\n * Defaults to `'above'`.\n */\n headerZindexLocation?: 'above' | 'below';\n /** Fades the mask in. Defaults to `true`. */\n hasAnimation?: boolean;\n /**\n * Called with the mask element once it is rendered, and with `null` when it\n * is removed.\n */\n // method syntax keeps existing `(element: HTMLDivElement) => void`\n // callbacks assignable\n maskRef?(element: HTMLDivElement | null): void;\n}\n\n/**\n * A dark overlay covering the page, rendered at the end of `<body>`, e.g.\n * behind a modal. Prevents scrolling the page while shown.\n */\nexport interface EuiOverlayMaskSignature {\n Element: HTMLDivElement;\n Args: EuiOverlayMaskArgs;\n Blocks: {\n /** Content shown above the mask. */\n default: [];\n };\n}\n\nconst callWith = modifier(\n (\n element: HTMLDivElement,\n [callback]: [((el: HTMLDivElement | null) => void)?]\n ) => {\n callback?.(element);\n\n // like a React ref: `null` when the mask goes away (or the callback changes)\n return () => callback?.(null);\n }\n);\n\nexport default class EuiOverlayMaskComponent extends Component<EuiOverlayMaskSignature> {\n destinationElement = document.body;\n\n get headerZindexLocation() {\n return this.args.headerZindexLocation === 'below' ? 'below' : 'above';\n }\n\n @cached\n get classes() {\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiOverlayMaskStyles);\n return `euiOverlayMask ${euiClass(\n context,\n styles.euiOverlayMask,\n styles[`${this.headerZindexLocation}Header`],\n this.args.hasAnimation === false ? styles.noAnimation : undefined\n )}`;\n }\n\n /** Upstream renders a global `body { overflow: hidden }`; a ref-counted body class here. */\n @cached\n get bodyClasses() {\n return `euiBody-hasOverlayMask ${euiClass(getEuiThemeContext(this), {\n overflow: 'hidden'\n })}`;\n }\n\n onClick = (e: MouseEvent) => {\n if (e.target === e.currentTarget) this.args.onClick?.(e);\n };\n\n <template>\n {{(setBodyClass this.bodyClasses)}}\n {{#in-element this.destinationElement insertBefore=null}}\n <div\n class={{this.classes}}\n data-relative-to-header={{this.headerZindexLocation}}\n {{callWith @maskRef}}\n {{! template-lint-disable no-invalid-interactive }}\n {{on \"click\" this.onClick}}\n ...attributes\n >\n {{yield}}\n </div>\n {{/in-element}}\n </template>\n}\n"],"names":["callWith","modifier","element","callback","EuiOverlayMaskComponent","Component","destinationElement","document","body","headerZindexLocation","args","classes","context","getEuiThemeContext","styles","useEuiBorealisStyles","euiOverlayMaskStyles","euiClass","euiOverlayMask","hasAnimation","noAnimation","undefined","n","prototype","cached","bodyClasses","overflow","onClick","e","target","currentTarget","setComponentTemplate","precompileTemplate","strictMode","scope","setBodyClass","on"],"mappings":";;;;;;;;;;;;AA6CA,MAAMA,QAAA,GAAWC,QAAA,CACf,CACEC,OAAS,EACT,CAACC,QAAA,CAAmD,KAAA;EAEpDA,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AA,CAAA;EACxD,CAAA;AAEA,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAAA,0VAAA,EAcA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;sBAAAC,YAAA;QAAAnC,QAAA;AAAAoC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -5,6 +5,7 @@ import { concat, hash } from '@ember/helper';
|
|
|
5
5
|
import { action } from '@ember/object';
|
|
6
6
|
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
|
|
7
7
|
import didUpdate from '@ember/render-modifiers/modifiers/did-update';
|
|
8
|
+
import willDestroy from '@ember/render-modifiers/modifiers/will-destroy';
|
|
8
9
|
import { cancel, later, scheduleOnce } from '@ember/runloop';
|
|
9
10
|
import { service } from '@ember/service';
|
|
10
11
|
import { htmlSafe } from '@ember/template';
|
|
@@ -523,16 +524,27 @@ class EuiPopoverComponent extends Component {
|
|
|
523
524
|
cancel(this.respositionTimeout);
|
|
524
525
|
cancel(this.closingTransitionTimeout);
|
|
525
526
|
cancelAnimationFrame(this.closingTransitionAnimationFrame);
|
|
527
|
+
this.cancelPositionOnFrame?.();
|
|
528
|
+
this.cancelPositionOnFrame = undefined;
|
|
526
529
|
this.cancelUpdateFocus();
|
|
527
530
|
}
|
|
528
531
|
onMutation(records) {
|
|
529
532
|
const waitDuration = getWaitDuration(records);
|
|
530
533
|
this.positionPopoverFixed();
|
|
531
|
-
|
|
534
|
+
// Upstream starts a new, uncancellable frame loop per mutation (it keeps
|
|
535
|
+
// running after unmount there too). Here one loop runs until the latest
|
|
536
|
+
// transition ends, and willDestroy cancels it.
|
|
537
|
+
const now = Date.now();
|
|
538
|
+
const remaining = Math.max(waitDuration, this.positionOnFrameUntil - now);
|
|
539
|
+
this.cancelPositionOnFrame?.();
|
|
540
|
+
this.positionOnFrameUntil = now + remaining;
|
|
541
|
+
this.cancelPositionOnFrame = performOnFrame(remaining, this.positionPopoverFixed);
|
|
532
542
|
}
|
|
533
543
|
static {
|
|
534
544
|
n(this.prototype, "onMutation", [action]);
|
|
535
545
|
}
|
|
546
|
+
positionOnFrameUntil = 0;
|
|
547
|
+
cancelPositionOnFrame;
|
|
536
548
|
positionPopover(allowEnforcePosition) {
|
|
537
549
|
if (this.button == null || this.panel == null) return;
|
|
538
550
|
// upstream: no extra distance by default with an arrow, 4px without
|
|
@@ -765,9 +777,16 @@ class EuiPopoverComponent extends Component {
|
|
|
765
777
|
this._button = btn;
|
|
766
778
|
this.args.buttonRef?.(btn);
|
|
767
779
|
}
|
|
780
|
+
/** Upstream's `panelRef(null)`: the panel left the DOM. */
|
|
768
781
|
static {
|
|
769
782
|
n(this.prototype, "registerButton", [action]);
|
|
770
783
|
}
|
|
784
|
+
unregisterPanel() {
|
|
785
|
+
this.registerPanel(null);
|
|
786
|
+
}
|
|
787
|
+
static {
|
|
788
|
+
n(this.prototype, "unregisterPanel", [action]);
|
|
789
|
+
}
|
|
771
790
|
registerPanel(panel) {
|
|
772
791
|
this.panel = panel;
|
|
773
792
|
this.args.panelRef?.(panel);
|
|
@@ -789,7 +808,7 @@ class EuiPopoverComponent extends Component {
|
|
|
789
808
|
n(this.prototype, "registerPanel", [action]);
|
|
790
809
|
}
|
|
791
810
|
static {
|
|
792
|
-
setComponentTemplate(precompileTemplate("<div class=\"{{this.classes}} {{if this.isOpening \"euiPopover-isOpen\"}}\" {{onKey \"_all\" this.onKeyDown priority=1}} {{didInsert this.didInsertPopover}} {{didUpdate this.didUpdateIsOpen @isOpen}} {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}} {{didUpdate this.didUpdatePlacementArgs @anchorPosition @buffer @offset @panelPaddingSize}} {{didInsert (optional @popoverRef)}} ...attributes>\n\n {{!-- button --}}\n {{#if (has-block \"button\")}}\n <div class=\"euiPopover__anchor {{@anchorClassName}}\" {{didInsert this.registerButton}}>\n {{yield to=\"button\"}}\n </div>\n {{/if}}\n\n {{!-- content --}}\n {{#if (and (not this.suppressingPopover) (or this.isCurrentlyOpen this.isClosing))}}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n <div id={{this.panelId}} class={{this.panelClasses}} data-popover-panel=\"true\" data-popover-open={{if this.isOpening \"true\"}} aria-live={{if this.focusesPanel \"off\" \"assertive\"}} role={{this.panelRole}} aria-label={{@ariaLabel}} aria-labelledby={{@ariaLabelledBy}} aria-modal={{this.panelAriaModal}} aria-describedby={{if this.hasDescription this.descriptionId}} tabindex={{this.tabindex}} {{simpleStyle this._popoverStyles}} {{didInsert this.registerPanel}} {{this.joinFocusTraps}} {{this.applyPanelProps @panelProps}} {{outsideClickDetector onOutsideClick=this.onClickOutside}} {{onKey \"Escape\" this.onEscapeKey}} {{!-- the trap only traps: updateFocus sets the initial focus,\n once the panel is positioned and visible --}} {{focusTrap _createFocusTrap=focusTrapFactory isActive=this.isFocusTrapActive shouldSelfFocus=this.shouldSelfFocus isPaused=this.isFocusTrapPaused additionalElements=@focusTrapProps.shards focusTrapOptions=(merge (hash returnFocusOnDeactivate=this.isOpenStable initialFocus=false onDeactivate=(optional @onTrapDeactivation) preventScroll=true clickOutsideDeactivates=true fallbackFocus=(concat \"#\" this.panelId)) this.focusTrapReturnFocus @focusTrapOptions)}}>\n {{#if this.showArrow}}\n {{#if this.arrowClasses}}\n <div class={{this.arrowClasses.wrapper}} style={{this._arrowStyles}}>\n <div class={{this.arrowClasses.arrow}} data-popover-arrow={{this.arrowPosition}}></div>\n {{yield to=\"arrowChildren\"}}\n </div>\n {{/if}}\n {{/if}}\n {{#if this.hasDescription}}\n <p id={{this.descriptionId}} {{screenReaderOnly}}>\n {{#if this.ownFocus}}{{this.screenReaderAnnouncement}}{{/if}}\n {{@popoverScreenReaderText}}\n </p>\n {{/if}}\n <div {{mutationObserver onMutation=this.onMutation observerOptions=(merge (hash attributes=true childList=true characterData=true subtree=true) @mutationObserverOptions)}}>\n {{yield to=\"content\"}}\n </div>\n </div>\n </EuiPortal>\n {{/if}}\n\n</div>", {
|
|
811
|
+
setComponentTemplate(precompileTemplate("<div class=\"{{this.classes}} {{if this.isOpening \"euiPopover-isOpen\"}}\" {{onKey \"_all\" this.onKeyDown priority=1}} {{didInsert this.didInsertPopover}} {{didUpdate this.didUpdateIsOpen @isOpen}} {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}} {{didUpdate this.didUpdatePlacementArgs @anchorPosition @buffer @offset @panelPaddingSize}} {{didInsert (optional @popoverRef)}} ...attributes>\n\n {{!-- button --}}\n {{#if (has-block \"button\")}}\n <div class=\"euiPopover__anchor {{@anchorClassName}}\" {{didInsert this.registerButton}}>\n {{yield to=\"button\"}}\n </div>\n {{/if}}\n\n {{!-- content --}}\n {{#if (and (not this.suppressingPopover) (or this.isCurrentlyOpen this.isClosing))}}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n <div id={{this.panelId}} class={{this.panelClasses}} data-popover-panel=\"true\" data-popover-open={{if this.isOpening \"true\"}} aria-live={{if this.focusesPanel \"off\" \"assertive\"}} role={{this.panelRole}} aria-label={{@ariaLabel}} aria-labelledby={{@ariaLabelledBy}} aria-modal={{this.panelAriaModal}} aria-describedby={{if this.hasDescription this.descriptionId}} tabindex={{this.tabindex}} {{simpleStyle this._popoverStyles}} {{didInsert this.registerPanel}} {{willDestroy this.unregisterPanel}} {{this.joinFocusTraps}} {{this.applyPanelProps @panelProps}} {{outsideClickDetector onOutsideClick=this.onClickOutside}} {{onKey \"Escape\" this.onEscapeKey}} {{!-- the trap only traps: updateFocus sets the initial focus,\n once the panel is positioned and visible --}} {{focusTrap _createFocusTrap=focusTrapFactory isActive=this.isFocusTrapActive shouldSelfFocus=this.shouldSelfFocus isPaused=this.isFocusTrapPaused additionalElements=@focusTrapProps.shards focusTrapOptions=(merge (hash returnFocusOnDeactivate=this.isOpenStable initialFocus=false onDeactivate=(optional @onTrapDeactivation) preventScroll=true clickOutsideDeactivates=true fallbackFocus=(concat \"#\" this.panelId)) this.focusTrapReturnFocus @focusTrapOptions)}}>\n {{#if this.showArrow}}\n {{#if this.arrowClasses}}\n <div class={{this.arrowClasses.wrapper}} style={{this._arrowStyles}}>\n <div class={{this.arrowClasses.arrow}} data-popover-arrow={{this.arrowPosition}}></div>\n {{yield to=\"arrowChildren\"}}\n </div>\n {{/if}}\n {{/if}}\n {{#if this.hasDescription}}\n <p id={{this.descriptionId}} {{screenReaderOnly}}>\n {{#if this.ownFocus}}{{this.screenReaderAnnouncement}}{{/if}}\n {{@popoverScreenReaderText}}\n </p>\n {{/if}}\n <div {{mutationObserver onMutation=this.onMutation observerOptions=(merge (hash attributes=true childList=true characterData=true subtree=true) @mutationObserverOptions)}}>\n {{yield to=\"content\"}}\n </div>\n </div>\n </EuiPortal>\n {{/if}}\n\n</div>", {
|
|
793
812
|
strictMode: true,
|
|
794
813
|
scope: () => ({
|
|
795
814
|
onKey,
|
|
@@ -801,6 +820,7 @@ class EuiPopoverComponent extends Component {
|
|
|
801
820
|
or,
|
|
802
821
|
EuiPortal,
|
|
803
822
|
simpleStyle,
|
|
823
|
+
willDestroy,
|
|
804
824
|
outsideClickDetector: OutsideClickDetector,
|
|
805
825
|
focusTrap,
|
|
806
826
|
focusTrapFactory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-popover.js","sources":["../../src/components/eui-popover.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, 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 { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { buildWaiter } from '@ember/test-waiters';\nimport type Owner from '@ember/owner';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { focusTrap } from 'ember-focus-trap';\nimport { modifier } from 'ember-modifier';\nimport {\n attachToFocusTraps,\n focusTrapFactory\n} from '../-private/focus-trap-registry.ts';\nimport { provide } from 'ember-provide-consume-context';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { and, not, or } from 'ember-truth-helpers';\nimport { focusable, tabbable } from 'tabbable';\n\nimport { EUI_POPOVER_PANEL_CONTEXT } from '../-private/eui-popover-panel-context.ts';\nimport { randomId as generateId } from '../-private/random-id.ts';\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.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 { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport type { EuiCss } from '../utils/eui/styles.ts';\nimport {\n euiBackgroundColor,\n euiBorderColor,\n euiPaddingSize,\n euiPanelStyles,\n euiPopoverArrowStyles,\n euiPopoverPanelStyles,\n euiPopoverStyles\n} from '../utils/eui/styles.generated.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 EuiPortal from './eui-portal.gts';\n\nimport type {\n EuiPopoverPanelContext,\n EuiPopoverPanelPaddingSize\n} from '../-private/eui-popover-panel-context.ts';\nimport type EuiI18n from '../services/eui-i18n.ts';\nimport type { EuiPopoverPosition } from '../utils/popover/types';\nimport type { EmberKeyboardEvent } from 'ember-keyboard/modifiers/on-key';\n\n/** Panel padding; `xs`/`xl` exist upstream but are discouraged. */\ntype PanelPaddingSize = EuiPopoverPanelPaddingSize;\n\n/** `'inlineBlock'`/`'block'`, or any CSS `display` value (upstream). */\ntype PopoverDisplay = 'inlineBlock' | 'block' | (string & {});\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\n/**\n * Upstream `focusTrapProps` (`EuiFocusTrap` props). They replace the\n * popover's own values, as upstream spreads them last.\n */\nexport interface EuiPopoverFocusTrapProps {\n /** Turns the trap off (replaces the popover's own condition). */\n disabled?: boolean;\n /**\n * Whether closing returns focus to the element focused before opening:\n * `false` opts out, a function receives that element and returns `false`\n * to skip it. Defaults to `true`.\n */\n returnFocus?:\n | boolean\n | FocusOptions\n | ((returnTo: Element) => boolean | FocusOptions);\n /** The element to focus on activation (replaces `@initialFocus`). */\n initialFocus?: FocusTarget;\n /** Called on Escape, instead of closing the popover. */\n onEscapeKey?: (event: KeyboardEvent) => void;\n /** Called on a press outside, instead of closing the popover. */\n onClickOutside?: (event: Event) => void;\n /** Extra elements that count as part of the popover for the trap. */\n shards?: HTMLElement[];\n}\n\n/**\n * Upstream `panelProps` (EuiPanel props, without `style`, `hasShadow`,\n * `hasBorder` and `color`). `className`, `css`, `tabIndex`, `role` and\n * `aria-modal` change the panel itself, `on<Event>` keys add listeners and\n * any other key (`aria-*`, `data-*`, `title`, ...) is set as an attribute.\n * `id` is not applied: the trigger's `aria-controls` uses the panel's id.\n */\nexport interface EuiPopoverPanelProps {\n className?: string;\n css?: EuiCss;\n tabIndex?: number | string;\n role?: string;\n 'aria-modal'?: string | boolean;\n [key: string]: unknown;\n}\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 * Where the popover opens relative to the button: `'upCenter'`,\n * `'upLeft'`, `'upRight'`, `'downCenter'`, `'downLeft'`, `'downRight'`,\n * `'leftCenter'`, `'leftUp'`, `'leftDown'`, `'rightCenter'`, `'rightUp'`\n * or `'rightDown'`. It flips when there is no room. Defaults to\n * `'downLeft'` (upstream EUI default).\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 * Element to align the popover to, instead of the `<:button>` block's\n * content.\n */\n button?: HTMLElement;\n /** Called with the element wrapping the `<:button>` block. */\n buttonRef?: (e: HTMLDivElement) => unknown;\n /**\n * Called to close the popover (Escape, clicks outside); set `@isOpen` to\n * `false` here.\n */\n closePopover: () => void;\n /**\n * Restrict the popover's position within this element\n */\n container?: HTMLElement;\n /**\n * CSS display of the popover's root: `'inlineBlock'`, `'block'` or any\n * CSS `display` value. Defaults to `'inlineBlock'`.\n */\n display?: PopoverDisplay;\n /**\n * Show an arrow pointing to the anchor. Defaults to `false` (upstream EUI\n * default).\n */\n hasArrow?: boolean;\n /**\n * The element to focus when the popover opens: a DOM node, a selector\n * (for `document.querySelector()`) or a function returning a node. It is\n * focused once the panel is positioned and visible (so the page does not\n * scroll to a panel still being placed), also without `@ownFocus`.\n * `false` focuses nothing. Without it, `@ownFocus` popovers (and panels\n * with an `aria-modal` other than `true`) focus the panel itself, like\n * upstream; Tab then moves to the first tabbable element.\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 * Whether the popover is open. Toggle it from the `<:button>` block's\n * button. Defaults to `false`.\n */\n isOpen?: boolean;\n /**\n * Traps tab focus within the popover contents. Defaults to `true`.\n */\n ownFocus?: boolean;\n /**\n * Custom class added to the panel containing the popover contents\n */\n panelClassName?: string;\n /**\n * Padding of the popover: `'none'`, `'s'`, `'m'` or `'l'` (`'xs'` and\n * `'xl'` are discouraged upstream). Defaults to `'m'`.\n */\n panelPaddingSize?: PanelPaddingSize;\n /** Inline styles for the panel (positioning styles win). */\n panelStyle?: { [i: string]: string };\n /**\n * Extra screen reader text, announced with the panel (with `@ownFocus`\n * it follows the default \"You are in a dialog…\" instructions).\n */\n popoverScreenReaderText?: string;\n /**\n * Props for the panel (upstream `panelProps`), see\n * {@link EuiPopoverPanelProps}. `tabIndex` wins over `@tabindex`; a\n * `role` or `aria-modal` of its own replaces `dialog` / `true`; an\n * `aria-modal` other than `true` makes the popover focus its panel like\n * `@ownFocus` does.\n */\n panelProps?: EuiPopoverPanelProps;\n /**\n * Props for the focus trap (upstream `focusTrapProps`), see\n * {@link EuiPopoverFocusTrapProps}. They replace the popover's own\n * values.\n */\n focusTrapProps?: EuiPopoverFocusTrapProps;\n /**\n * Called with the position the popover ended up in (`'top'`, `'right'`,\n * `'bottom'` or `'left'`) each time it is positioned.\n */\n onPositionChange?: (position: EuiPopoverPosition) => void;\n /** Called with the popover's panel element (`null` when it closes). */\n panelRef?: (e: HTMLElement | null) => unknown;\n /** Called with the popover's root element. */\n popoverRef?: (e: HTMLElement) => unknown;\n\n /**\n * When not `false`, a popover opened from inside another popover\n * positions itself relative to that one. Defaults to `true`.\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 * Whether the popover may move to the cross axis (e.g. from below to the\n * side of the anchor) when there is no room. Defaults to `true`.\n */\n repositionToCrossAxis?: boolean;\n /**\n * @private Styles composed last into the root's class (e.g.\n * EuiInputPopover's max width), like upstream's `css` prop.\n */\n rootCss?: EuiCss;\n /**\n * Extra styles composed last into the root's class (like upstream's `css`\n * prop). Prefer this to an extra class when styling it from a parent.\n */\n css?: EuiCss;\n /**\n * Extra styles composed last into the panel's class (like upstream's\n * `panelProps.css`). Prefer this to `@panelClassName` for styles.\n */\n panelCss?: EuiCss;\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. Defaults\n * to `0` with an arrow and `4` without (upstream).\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 /** @deprecated Has no effect, use the `<:arrowChildren>` block. */\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` of the panel. Defaults to `'0'`. */\n tabindex?: string | number;\n\n /** Focuses the panel itself when it opens. Defaults to `true`. */\n shouldSelfFocus?: boolean;\n\n /** Pauses the focus trap, e.g. while a nested popover has focus. */\n isFocusTrapPaused?: boolean;\n\n /** Options for the focus trap (focus-trap library). */\n focusTrapOptions?: {\n [key: string]: any;\n onClickOutside?: (e: Event) => void;\n };\n\n /**\n * What content changes reposition the popover (MutationObserver\n * options). Defaults to watching the panel's subtree.\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: 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 const DISPLAY = ['inlineBlock', 'block'];\n\n/** Ember display names mapped to the CSS values upstream takes. */\nconst DISPLAY_CSS: Record<string, string> = {\n inlineBlock: 'inline-block',\n block: 'block'\n};\n\n/** Upstream `EuiPopover` closing transition time (ms). */\nconst CLOSING_TRANSITION_TIME = 250;\n// tests settle once an opening popover has set its focus\nconst focusWaiter = buildWaiter('@ember-eui/core:eui-popover-focus');\n\nexport type FocusTarget = HTMLElement | string | (() => HTMLElement | null);\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\n/**\n * A floating panel anchored to a button, e.g. a menu or a small form. You\n * control `@isOpen` and close it in `@closePopover`.\n */\nexport interface EuiPopoverSignature {\n Element: HTMLDivElement;\n Args: EuiPopoverArgs;\n Blocks: {\n /**\n * The element opening the popover, e.g.\n * `<EuiButton {{on \"click\" (set this \"isOpen\" true)}}>`.\n */\n button: [];\n /** The popover's content. */\n content: [];\n /** Content inside the arrow (rarely needed). */\n arrowChildren: [];\n };\n}\n\nexport default class EuiPopoverComponent\n extends Component<EuiPopoverSignature>\n implements EuiPopoverPanelContext\n{\n @service declare euiI18n: EuiI18n;\n\n /** EuiPopoverTitle/Footer inherit the panel padding (upstream context). */\n @provide(EUI_POPOVER_PANEL_CONTEXT)\n get panelContext(): EuiPopoverPanelContext {\n return this;\n }\n\n get paddingSize(): PanelPaddingSize {\n return this.panelPaddingSize;\n }\n\n /** Id of the panel, for the trigger's `aria-controls`. */\n panelId = generateId();\n /** Id of the screen reader description. */\n descriptionId = generateId();\n\n // Defaults\n @argOrDefaultDecorator(false) isOpen!: boolean;\n @argOrDefaultDecorator(true) ownFocus!: boolean;\n @argOrDefaultDecorator('downLeft') anchorPosition!: PopoverAnchorPosition;\n @argOrDefaultDecorator('m') panelPaddingSize!: PanelPaddingSize;\n @argOrDefaultDecorator(false) 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 updateFocusToken: unknown;\n private hasSetInitialFocus: boolean = false;\n @tracked _button: HTMLElement | null = null;\n\n /**\n * The portalled panel counts as inside the modal, flyout or popover focus\n * trap its anchor is in (upstream's react-focus-on follows React portals).\n */\n joinFocusTraps = modifier((panel: HTMLElement) =>\n attachToFocusTraps(this._button, panel)\n );\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\n if (this.args.focusTrapProps?.onEscapeKey) {\n this.args.focusTrapProps.onEscapeKey(event as KeyboardEvent);\n } else {\n this.closePopover();\n }\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.focusTrapProps?.onClickOutside) {\n this.args.focusTrapProps.onClickOutside(event);\n } else 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 private cancelUpdateFocus(): void {\n cancelAnimationFrame(this.updateFocusAnimationFrame as number);\n\n if (this.updateFocusToken) {\n focusWaiter.endAsync(this.updateFocusToken);\n this.updateFocusToken = undefined;\n }\n }\n\n updateFocus(): void {\n this.cancelUpdateFocus();\n\n const token = focusWaiter.beginAsync();\n\n this.updateFocusToken = token;\n // Wait for the DOM to update.\n this.updateFocusAnimationFrame = window.requestAnimationFrame(() => {\n focusWaiter.endAsync(token);\n this.updateFocusToken = undefined;\n\n // without @ownFocus, only an explicit @initialFocus moves the focus\n const initialFocus =\n this.args.focusTrapProps?.initialFocus ?? this.args.initialFocus;\n const hasInitialFocus = initialFocus !== undefined && initialFocus !== null;\n\n if (\n !(this.focusesPanel || hasInitialFocus) ||\n !this.panel ||\n initialFocus === false ||\n this.args.focusTrapProps?.disabled\n ) {\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 (initialFocus != null) {\n focusTarget = getElementFromInitialFocus(initialFocus);\n } else {\n // upstream: the panel itself, then Tab reaches the first element\n focusTarget = this.panel;\n }\n\n if (focusTarget == null) {\n // an `initialFocus` that matches nothing: the first tabbable item\n focusTarget = tabbable(this.panel)[0];\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.updateTriggerAria();\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 CLOSING_TRANSITION_TIME\n );\n }\n\n if (!!this.prevIsOpen !== !!this.args.isOpen) {\n this.updateTriggerAria();\n }\n\n this.prevIsOpen = this.args.isOpen;\n }\n\n /**\n * Upstream: the first focusable element of the anchor, when it is a\n * button (or `role=\"button\"`), gets `aria-expanded`, and `aria-controls`\n * pointing at the panel while open. Inputs and other elements are left\n * alone.\n */\n getFocusableToggleButton(): HTMLElement | undefined {\n const anchor = this.args.button ?? this._button;\n\n if (!anchor) return undefined;\n\n try {\n return focusable(anchor, { includeContainer: !!this.args.button })[0] as\n | HTMLElement\n | undefined;\n } catch {\n return undefined;\n }\n }\n\n @action\n updateTriggerAria(): void {\n const toggleButton = this.getFocusableToggleButton();\n\n if (!toggleButton) return;\n\n const tag = toggleButton.tagName.toLowerCase();\n const role = toggleButton.getAttribute('role')?.toLowerCase();\n\n if (tag !== 'button' && role !== 'button') return;\n\n toggleButton.setAttribute('aria-expanded', this.isOpen ? 'true' : 'false');\n\n if (this.isOpen) {\n toggleButton.setAttribute('aria-controls', this.panelId);\n } else {\n toggleButton.removeAttribute('aria-controls');\n }\n }\n\n /** Upstream repositions an open popover when these args change. */\n @action\n didUpdatePlacementArgs(): void {\n if (this.isOpen) this.positionPopoverFluid();\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 this.cancelUpdateFocus();\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 // upstream: no extra distance by default with an arrow, 4px without\n const offset = this.args.offset ?? (this.hasArrow ? 0 : 4);\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 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: this.args.attachToAnchor\n ? offset\n : this.hasArrow\n ? 16 + offset\n : 8 + offset,\n // upstream Borealis arrow: 16px wide, kept out of the 12px corners\n arrowConfig: this.hasArrow\n ? { arrowWidth: 16, arrowBuffer: 10, borderRadius: 12 }\n : { arrowWidth: 0, arrowBuffer: 0 },\n returnBoundingBox: this.args.attachToAnchor,\n allowCrossAxis: this.args.repositionToCrossAxis ?? true,\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.args.onPositionChange?.(arrowPosition);\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 // upstream: reduces the risk of a blurry animation in Chrome 86+\n willChange: this.isOpenStable ? 'auto' : 'transform, opacity'\n };\n }\n\n get showArrow(): boolean {\n return this.hasArrow && !this.args.attachToAnchor;\n }\n\n /** Root: upstream `euiPopoverStyles` plus the display. */\n @cached\n get classes(): string {\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiPopoverStyles);\n const display = DISPLAY_CSS[this.display] ?? this.display;\n\n return `euiPopover ${euiClass(\n context,\n styles.euiPopover,\n { display, label: display },\n this.args.rootCss,\n this.args.css\n )}`;\n }\n\n /**\n * The panel: upstream `EuiPopoverPanel`, i.e. an `EuiPanel` (plain, no\n * shadow or border, padding and radius m) composed with the popover panel\n * styles in a single class, so no rule order between two classes matters.\n */\n @cached\n get panelClasses(): string {\n const context = getEuiThemeContext(this);\n const upstream = context.upstream;\n const panel = useEuiBorealisStyles(context, euiPanelStyles);\n const styles = useEuiBorealisStyles(context, euiPopoverPanelStyles);\n const isOpen = this.isOpening;\n const position = this.arrowPosition;\n const colorMode = upstream.colorMode === 'DARK' ? 'dark' : 'light';\n const generated = euiClass(\n context,\n // no React global reset; portaled content also leaves the provider's\n // color wrapper, so the panel sets the theme's text color itself\n {\n boxSizing: 'border-box',\n color: upstream.euiTheme.colors.textParagraph,\n textAlign: 'start'\n },\n panel.euiPanel,\n panel.grow,\n panel.radius.m,\n { padding: euiPaddingSize(upstream, this.panelPaddingSize) ?? 0 },\n { backgroundColor: euiBackgroundColor(upstream, 'plain') },\n upstream.highContrastMode && {\n border: upstream.euiTheme.border.thin,\n borderColor: euiBorderColor(upstream, 'plain')\n },\n styles.euiPopover__panel,\n styles[colorMode],\n isOpen && styles.isOpen,\n ...(this.args.attachToAnchor\n ? [styles.isAttached.isAttached, position && styles.isAttached[position]]\n : [\n styles.hasTransform.hasTransform,\n isOpen && position && styles.hasTransform[position]\n ]),\n this.args.panelCss,\n this.args.panelProps?.css\n );\n\n return [\n 'euiPanel euiPanel--plain euiPopover__panel',\n this.panelClassNames,\n generated\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n @cached\n get arrowClasses(): { wrapper: string; arrow: string } | undefined {\n const position = this.arrowPosition;\n\n if (!position) return undefined;\n\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiPopoverArrowStyles);\n\n return {\n wrapper: `euiPopover__arrowWrapper ${euiClass(context, styles.euiPopoverArrowWrapper)}`,\n arrow: `euiPopover__arrow ${euiClass(context, styles.euiPopoverArrow, styles[position])}`\n };\n }\n\n get screenReaderAnnouncement(): string {\n return this.euiI18n.lookupToken(\n 'euiPopover.screenReaderAnnouncement',\n 'You are in a dialog. Press Escape, or tap/click outside the dialog to close.'\n );\n }\n\n get hasDescription(): boolean {\n return this.ownFocus || !!this.args.popoverScreenReaderText;\n }\n\n get panelRole(): string | undefined {\n const props = this.args.panelProps;\n\n return props && 'role' in props ? (props.role as string) : 'dialog';\n }\n\n get panelAriaModal(): string | undefined {\n const props = this.args.panelProps;\n const value = props && 'aria-modal' in props ? props['aria-modal'] : 'true';\n\n return value == null ? undefined : String(value);\n }\n\n /** Upstream: `ownFocus`, or a panel that is not a modal dialog. */\n get focusesPanel(): boolean {\n return this.ownFocus || this.panelAriaModal !== 'true';\n }\n\n get tabindex() {\n const own = this.args.panelProps?.tabIndex;\n\n if (this.focusesPanel) {\n return own ?? this.args.tabindex ?? '0';\n }\n\n return own ?? '-1';\n }\n\n /** The panel's classes: `@panelClassName` and `panelProps.className`. */\n get panelClassNames(): string {\n return [this.args.panelClassName, this.args.panelProps?.className]\n .filter(Boolean)\n .join(' ');\n }\n\n /** `panelProps` that are not handled by the template. */\n applyPanelProps = modifier(\n (panel: HTMLElement, [props]: [EuiPopoverPanelProps | undefined]) => {\n const cleanups: Array<() => void> = [];\n const handled = new Set([\n 'className',\n 'css',\n 'tabIndex',\n 'role',\n 'aria-modal',\n 'id',\n 'style',\n 'hasShadow',\n 'hasBorder',\n 'color'\n ]);\n\n for (const [key, value] of Object.entries(props ?? {})) {\n if (handled.has(key) || value === undefined) continue;\n\n if (/^on[A-Z]/.test(key) && typeof value === 'function') {\n const type = key.slice(2).toLowerCase();\n\n panel.addEventListener(type, value as EventListener);\n cleanups.push(() =>\n panel.removeEventListener(type, value as EventListener)\n );\n } else if (value === false || value === null) {\n panel.removeAttribute(key);\n } else {\n panel.setAttribute(key, value === true ? '' : String(value as string | number));\n cleanups.push(() => panel.removeAttribute(key));\n }\n }\n\n return () => cleanups.forEach((cleanup) => cleanup());\n }\n );\n\n /** Upstream `EuiFocusTrap` `returnFocus` as focus-trap options. */\n get focusTrapReturnFocus(): Record<string, unknown> {\n const returnFocus = this.args.focusTrapProps?.returnFocus;\n\n if (returnFocus === false) {\n return { returnFocusOnDeactivate: false };\n }\n\n if (typeof returnFocus === 'function') {\n return {\n setReturnFocus: (previous: HTMLElement | SVGElement) =>\n returnFocus(previous) === false ? false : previous\n };\n }\n\n return {};\n }\n\n get isFocusTrapActive(): boolean {\n const { disabled } = this.args.focusTrapProps ?? {};\n\n return !(\n disabled ??\n (!this.ownFocus || !this.isOpenStable || this.isClosing)\n );\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 <div\n class=\"{{this.classes}} {{if this.isOpening 'euiPopover-isOpen'}}\"\n {{onKey \"_all\" this.onKeyDown priority=1}}\n {{didInsert this.didInsertPopover}}\n {{didUpdate this.didUpdateIsOpen @isOpen}}\n {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}}\n {{didUpdate\n this.didUpdatePlacementArgs\n @anchorPosition\n @buffer\n @offset\n @panelPaddingSize\n }}\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) (or this.isCurrentlyOpen this.isClosing)\n )\n }}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n <div\n id={{this.panelId}}\n class={{this.panelClasses}}\n data-popover-panel=\"true\"\n data-popover-open={{if this.isOpening \"true\"}}\n aria-live={{if this.focusesPanel \"off\" \"assertive\"}}\n role={{this.panelRole}}\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledBy}}\n aria-modal={{this.panelAriaModal}}\n aria-describedby={{if this.hasDescription this.descriptionId}}\n tabindex={{this.tabindex}}\n {{simpleStyle this._popoverStyles}}\n {{didInsert this.registerPanel}}\n {{this.joinFocusTraps}}\n {{this.applyPanelProps @panelProps}}\n {{outsideClickDetector onOutsideClick=this.onClickOutside}}\n {{onKey \"Escape\" this.onEscapeKey}}\n {{! the trap only traps: updateFocus sets the initial focus,\n once the panel is positioned and visible }}\n {{focusTrap\n _createFocusTrap=focusTrapFactory\n isActive=this.isFocusTrapActive\n shouldSelfFocus=this.shouldSelfFocus\n isPaused=this.isFocusTrapPaused\n additionalElements=@focusTrapProps.shards\n focusTrapOptions=(merge\n (hash\n returnFocusOnDeactivate=this.isOpenStable\n initialFocus=false\n onDeactivate=(optional @onTrapDeactivation)\n preventScroll=true\n clickOutsideDeactivates=true\n fallbackFocus=(concat \"#\" this.panelId)\n )\n this.focusTrapReturnFocus\n @focusTrapOptions\n )\n }}\n >\n {{#if this.showArrow}}\n {{#if this.arrowClasses}}\n <div\n class={{this.arrowClasses.wrapper}}\n style={{this._arrowStyles}}\n >\n <div\n class={{this.arrowClasses.arrow}}\n data-popover-arrow={{this.arrowPosition}}\n ></div>\n {{yield to=\"arrowChildren\"}}\n </div>\n {{/if}}\n {{/if}}\n {{#if this.hasDescription}}\n <p id={{this.descriptionId}} {{screenReaderOnly}}>\n {{#if this.ownFocus}}{{this.screenReaderAnnouncement}}{{/if}}\n {{@popoverScreenReaderText}}\n </p>\n {{/if}}\n <div\n {{mutationObserver\n onMutation=this.onMutation\n observerOptions=(merge\n (hash\n attributes=true childList=true characterData=true subtree=true\n )\n @mutationObserverOptions\n )\n }}\n >\n {{yield to=\"content\"}}\n </div>\n </div>\n </EuiPortal>\n {{/if}}\n\n </div>\n </template>\n}\n"],"names":["anchorPositionToPopoverPositionMap","up","right","down","left","getPopoverPositionFromAnchorPosition","anchorPosition","match","length","getPopoverAlignFromAnchorPosition","toLowerCase","ANCHOR_POSITIONS","DISPLAY","DISPLAY_CSS","inlineBlock","block","CLOSING_TRANSITION_TIME","focusWaiter","buildWaiter","DEFAULT_POPOVER_STYLES","top","getElementFromInitialFocus","initialFocus","initialFocusType","document","querySelector","EuiPopoverComponent","Component","g","prototype","service","i","panelContext","n","provide","EUI_POPOVER_PANEL_CONTEXT","paddingSize","panelPaddingSize","panelId","generateId","descriptionId","argOrDefaultDecorator","tracked","respositionTimeout","closingTransitionTimeout","closingTransitionAnimationFrame","updateFocusAnimationFrame","updateFocusToken","hasSetInitialFocus","joinFocusTraps","modifier","panel","attachToFocusTraps","_button","constructor","owner","args","assert","closePopover","prevIsOpen","isOpen","suppressingPopover","isCurrentlyOpen","button","insert","shouldAccountForOtherPopovers","popoverHost","sibling","children","position","undefined","action","onEscapeKey","event","ekEvent","stopPropagation","stopImmediatePropagation","preventDefault","focusTrapProps","onKeyDown","key","cascadingMenuKeys","ESCAPE","onClickOutside","focusTrapOptions","contains","target","cancelUpdateFocus","cancelAnimationFrame","endAsync","updateFocus","token","beginAsync","window","requestAnimationFrame","hasInitialFocus","focusesPanel","disabled","activeElement","focusTarget","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","updateTriggerAria","didUpdateRepositionOnScroll","removeEventListener","didUpdateIsOpen","isClosing","getFocusableToggleButton","anchor","focusable","includeContainer","toggleButton","tag","tagName","role","getAttribute","setAttribute","removeAttribute","didUpdatePlacementArgs","positionPopoverFluid","willDestroy","onMutation","records","waitDuration","getWaitDuration","performOnFrame","positionPopover","allowEnforcePosition","offset","hasArrow","forcePosition","openPosition","foundPosition","arrow","anchorBoundingBox","findPopoverPosition","container","host","align","popover","attachToAnchor","arrowConfig","arrowWidth","arrowBuffer","borderRadius","returnBoundingBox","allowCrossAxis","repositionToCrossAxis","buffer","zIndex","zIndexProp","getElementZIndex","popoverStyles","willRenderArrow","arrowStyles","arrowPosition","onPositionChange","_arrowStyles","htmlSafe","_popoverStyles","panelStyle","willChange","showArrow","classes","context","getEuiThemeContext","styles","useEuiBorealisStyles","euiPopoverStyles","display","euiClass","euiPopover","label","rootCss","css","cached","panelClasses","upstream","euiPanelStyles","euiPopoverPanelStyles","colorMode","generated","boxSizing","color","euiTheme","colors","textParagraph","textAlign","euiPanel","grow","radius","m","padding","euiPaddingSize","backgroundColor","euiBackgroundColor","highContrastMode","border","thin","borderColor","euiBorderColor","euiPopover__panel","isAttached","hasTransform","panelCss","panelProps","panelClassNames","filter","Boolean","join","arrowClasses","euiPopoverArrowStyles","wrapper","euiPopoverArrowWrapper","euiPopoverArrow","screenReaderAnnouncement","euiI18n","lookupToken","hasDescription","ownFocus","popoverScreenReaderText","panelRole","props","panelAriaModal","value","String","tabindex","own","tabIndex","panelClassName","className","applyPanelProps","cleanups","handled","Set","Object","entries","has","test","type","push","forEach","cleanup","focusTrapReturnFocus","returnFocus","returnFocusOnDeactivate","setReturnFocus","previous","isFocusTrapActive","registerButton","btn","buttonRef","registerPanel","panelRef","setComponentTemplate","precompileTemplate","strictMode","scope","onKey","didInsert","didUpdate","optional","and","not","or","EuiPortal","simpleStyle","outsideClickDetector","focusTrap","focusTrapFactory","merge","hash","concat","screenReaderOnly","mutationObserver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgVA,MAAMA,kCAEF,GAAA;AACFC,EAAAA,EAAA,EAAI,KAAA;AACJC,EAAAA,KAAA,EAAO,OAAA;AACP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AAAC,GAAA;QAAAC,GAAA;QAAAC,EAAA;QAAAC,SAAA;QAAAC,WAAA;8BAAAC,oBAAA;QAAAC,SAAA;QAAAC,gBAAA;QAAAC,KAAA;QAAAC,IAAA;QAAAC,MAAA;0BAAAC,wBAAA;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 { cached, 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 willDestroy from '@ember/render-modifiers/modifiers/will-destroy';\nimport { cancel, later, scheduleOnce } from '@ember/runloop';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { buildWaiter } from '@ember/test-waiters';\nimport type Owner from '@ember/owner';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { focusTrap } from 'ember-focus-trap';\nimport { modifier } from 'ember-modifier';\nimport {\n attachToFocusTraps,\n focusTrapFactory\n} from '../-private/focus-trap-registry.ts';\nimport { provide } from 'ember-provide-consume-context';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { and, not, or } from 'ember-truth-helpers';\nimport { focusable, tabbable } from 'tabbable';\n\nimport { EUI_POPOVER_PANEL_CONTEXT } from '../-private/eui-popover-panel-context.ts';\nimport { randomId as generateId } from '../-private/random-id.ts';\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.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 { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport type { EuiCss } from '../utils/eui/styles.ts';\nimport {\n euiBackgroundColor,\n euiBorderColor,\n euiPaddingSize,\n euiPanelStyles,\n euiPopoverArrowStyles,\n euiPopoverPanelStyles,\n euiPopoverStyles\n} from '../utils/eui/styles.generated.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 EuiPortal from './eui-portal.gts';\n\nimport type {\n EuiPopoverPanelContext,\n EuiPopoverPanelPaddingSize\n} from '../-private/eui-popover-panel-context.ts';\nimport type EuiI18n from '../services/eui-i18n.ts';\nimport type { EuiPopoverPosition } from '../utils/popover/types';\nimport type { EmberKeyboardEvent } from 'ember-keyboard/modifiers/on-key';\n\n/** Panel padding; `xs`/`xl` exist upstream but are discouraged. */\ntype PanelPaddingSize = EuiPopoverPanelPaddingSize;\n\n/** `'inlineBlock'`/`'block'`, or any CSS `display` value (upstream). */\ntype PopoverDisplay = 'inlineBlock' | 'block' | (string & {});\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\n/**\n * Upstream `focusTrapProps` (`EuiFocusTrap` props). They replace the\n * popover's own values, as upstream spreads them last.\n */\nexport interface EuiPopoverFocusTrapProps {\n /** Turns the trap off (replaces the popover's own condition). */\n disabled?: boolean;\n /**\n * Whether closing returns focus to the element focused before opening:\n * `false` opts out, a function receives that element and returns `false`\n * to skip it. Defaults to `true`.\n */\n returnFocus?:\n | boolean\n | FocusOptions\n | ((returnTo: Element) => boolean | FocusOptions);\n /** The element to focus on activation (replaces `@initialFocus`). */\n initialFocus?: FocusTarget;\n /** Called on Escape, instead of closing the popover. */\n onEscapeKey?: (event: KeyboardEvent) => void;\n /** Called on a press outside, instead of closing the popover. */\n onClickOutside?: (event: Event) => void;\n /** Extra elements that count as part of the popover for the trap. */\n shards?: HTMLElement[];\n}\n\n/**\n * Upstream `panelProps` (EuiPanel props, without `style`, `hasShadow`,\n * `hasBorder` and `color`). `className`, `css`, `tabIndex`, `role` and\n * `aria-modal` change the panel itself, `on<Event>` keys add listeners and\n * any other key (`aria-*`, `data-*`, `title`, ...) is set as an attribute.\n * `id` is not applied: the trigger's `aria-controls` uses the panel's id.\n */\nexport interface EuiPopoverPanelProps {\n className?: string;\n css?: EuiCss;\n tabIndex?: number | string;\n role?: string;\n 'aria-modal'?: string | boolean;\n [key: string]: unknown;\n}\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 * Where the popover opens relative to the button: `'upCenter'`,\n * `'upLeft'`, `'upRight'`, `'downCenter'`, `'downLeft'`, `'downRight'`,\n * `'leftCenter'`, `'leftUp'`, `'leftDown'`, `'rightCenter'`, `'rightUp'`\n * or `'rightDown'`. It flips when there is no room. Defaults to\n * `'downLeft'` (upstream EUI default).\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 * Element to align the popover to, instead of the `<:button>` block's\n * content.\n */\n button?: HTMLElement;\n /** Called with the element wrapping the `<:button>` block. */\n buttonRef?: (e: HTMLDivElement) => unknown;\n /**\n * Called to close the popover (Escape, clicks outside); set `@isOpen` to\n * `false` here.\n */\n closePopover: () => void;\n /**\n * Restrict the popover's position within this element\n */\n container?: HTMLElement;\n /**\n * CSS display of the popover's root: `'inlineBlock'`, `'block'` or any\n * CSS `display` value. Defaults to `'inlineBlock'`.\n */\n display?: PopoverDisplay;\n /**\n * Show an arrow pointing to the anchor. Defaults to `false` (upstream EUI\n * default).\n */\n hasArrow?: boolean;\n /**\n * The element to focus when the popover opens: a DOM node, a selector\n * (for `document.querySelector()`) or a function returning a node. It is\n * focused once the panel is positioned and visible (so the page does not\n * scroll to a panel still being placed), also without `@ownFocus`.\n * `false` focuses nothing. Without it, `@ownFocus` popovers (and panels\n * with an `aria-modal` other than `true`) focus the panel itself, like\n * upstream; Tab then moves to the first tabbable element.\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 * Whether the popover is open. Toggle it from the `<:button>` block's\n * button. Defaults to `false`.\n */\n isOpen?: boolean;\n /**\n * Traps tab focus within the popover contents. Defaults to `true`.\n */\n ownFocus?: boolean;\n /**\n * Custom class added to the panel containing the popover contents\n */\n panelClassName?: string;\n /**\n * Padding of the popover: `'none'`, `'s'`, `'m'` or `'l'` (`'xs'` and\n * `'xl'` are discouraged upstream). Defaults to `'m'`.\n */\n panelPaddingSize?: PanelPaddingSize;\n /** Inline styles for the panel (positioning styles win). */\n panelStyle?: { [i: string]: string };\n /**\n * Extra screen reader text, announced with the panel (with `@ownFocus`\n * it follows the default \"You are in a dialog…\" instructions).\n */\n popoverScreenReaderText?: string;\n /**\n * Props for the panel (upstream `panelProps`), see\n * {@link EuiPopoverPanelProps}. `tabIndex` wins over `@tabindex`; a\n * `role` or `aria-modal` of its own replaces `dialog` / `true`; an\n * `aria-modal` other than `true` makes the popover focus its panel like\n * `@ownFocus` does.\n */\n panelProps?: EuiPopoverPanelProps;\n /**\n * Props for the focus trap (upstream `focusTrapProps`), see\n * {@link EuiPopoverFocusTrapProps}. They replace the popover's own\n * values.\n */\n focusTrapProps?: EuiPopoverFocusTrapProps;\n /**\n * Called with the position the popover ended up in (`'top'`, `'right'`,\n * `'bottom'` or `'left'`) each time it is positioned.\n */\n onPositionChange?: (position: EuiPopoverPosition) => void;\n /** Called with the popover's panel element (`null` when it closes). */\n panelRef?: (e: HTMLElement | null) => unknown;\n /** Called with the popover's root element. */\n popoverRef?: (e: HTMLElement) => unknown;\n\n /**\n * When not `false`, a popover opened from inside another popover\n * positions itself relative to that one. Defaults to `true`.\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 * Whether the popover may move to the cross axis (e.g. from below to the\n * side of the anchor) when there is no room. Defaults to `true`.\n */\n repositionToCrossAxis?: boolean;\n /**\n * @private Styles composed last into the root's class (e.g.\n * EuiInputPopover's max width), like upstream's `css` prop.\n */\n rootCss?: EuiCss;\n /**\n * Extra styles composed last into the root's class (like upstream's `css`\n * prop). Prefer this to an extra class when styling it from a parent.\n */\n css?: EuiCss;\n /**\n * Extra styles composed last into the panel's class (like upstream's\n * `panelProps.css`). Prefer this to `@panelClassName` for styles.\n */\n panelCss?: EuiCss;\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. Defaults\n * to `0` with an arrow and `4` without (upstream).\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 /** @deprecated Has no effect, use the `<:arrowChildren>` block. */\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` of the panel. Defaults to `'0'`. */\n tabindex?: string | number;\n\n /** Focuses the panel itself when it opens. Defaults to `true`. */\n shouldSelfFocus?: boolean;\n\n /** Pauses the focus trap, e.g. while a nested popover has focus. */\n isFocusTrapPaused?: boolean;\n\n /** Options for the focus trap (focus-trap library). */\n focusTrapOptions?: {\n [key: string]: any;\n onClickOutside?: (e: Event) => void;\n };\n\n /**\n * What content changes reposition the popover (MutationObserver\n * options). Defaults to watching the panel's subtree.\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: 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 const DISPLAY = ['inlineBlock', 'block'];\n\n/** Ember display names mapped to the CSS values upstream takes. */\nconst DISPLAY_CSS: Record<string, string> = {\n inlineBlock: 'inline-block',\n block: 'block'\n};\n\n/** Upstream `EuiPopover` closing transition time (ms). */\nconst CLOSING_TRANSITION_TIME = 250;\n// tests settle once an opening popover has set its focus\nconst focusWaiter = buildWaiter('@ember-eui/core:eui-popover-focus');\n\nexport type FocusTarget = HTMLElement | string | (() => HTMLElement | null);\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\n/**\n * A floating panel anchored to a button, e.g. a menu or a small form. You\n * control `@isOpen` and close it in `@closePopover`.\n */\nexport interface EuiPopoverSignature {\n Element: HTMLDivElement;\n Args: EuiPopoverArgs;\n Blocks: {\n /**\n * The element opening the popover, e.g.\n * `<EuiButton {{on \"click\" (set this \"isOpen\" true)}}>`.\n */\n button: [];\n /** The popover's content. */\n content: [];\n /** Content inside the arrow (rarely needed). */\n arrowChildren: [];\n };\n}\n\nexport default class EuiPopoverComponent\n extends Component<EuiPopoverSignature>\n implements EuiPopoverPanelContext\n{\n @service declare euiI18n: EuiI18n;\n\n /** EuiPopoverTitle/Footer inherit the panel padding (upstream context). */\n @provide(EUI_POPOVER_PANEL_CONTEXT)\n get panelContext(): EuiPopoverPanelContext {\n return this;\n }\n\n get paddingSize(): PanelPaddingSize {\n return this.panelPaddingSize;\n }\n\n /** Id of the panel, for the trigger's `aria-controls`. */\n panelId = generateId();\n /** Id of the screen reader description. */\n descriptionId = generateId();\n\n // Defaults\n @argOrDefaultDecorator(false) isOpen!: boolean;\n @argOrDefaultDecorator(true) ownFocus!: boolean;\n @argOrDefaultDecorator('downLeft') anchorPosition!: PopoverAnchorPosition;\n @argOrDefaultDecorator('m') panelPaddingSize!: PanelPaddingSize;\n @argOrDefaultDecorator(false) 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 updateFocusToken: unknown;\n private hasSetInitialFocus: boolean = false;\n @tracked _button: HTMLElement | null = null;\n\n /**\n * The portalled panel counts as inside the modal, flyout or popover focus\n * trap its anchor is in (upstream's react-focus-on follows React portals).\n */\n joinFocusTraps = modifier((panel: HTMLElement) =>\n attachToFocusTraps(this._button, panel)\n );\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\n if (this.args.focusTrapProps?.onEscapeKey) {\n this.args.focusTrapProps.onEscapeKey(event as KeyboardEvent);\n } else {\n this.closePopover();\n }\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.focusTrapProps?.onClickOutside) {\n this.args.focusTrapProps.onClickOutside(event);\n } else 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 private cancelUpdateFocus(): void {\n cancelAnimationFrame(this.updateFocusAnimationFrame as number);\n\n if (this.updateFocusToken) {\n focusWaiter.endAsync(this.updateFocusToken);\n this.updateFocusToken = undefined;\n }\n }\n\n updateFocus(): void {\n this.cancelUpdateFocus();\n\n const token = focusWaiter.beginAsync();\n\n this.updateFocusToken = token;\n // Wait for the DOM to update.\n this.updateFocusAnimationFrame = window.requestAnimationFrame(() => {\n focusWaiter.endAsync(token);\n this.updateFocusToken = undefined;\n\n // without @ownFocus, only an explicit @initialFocus moves the focus\n const initialFocus =\n this.args.focusTrapProps?.initialFocus ?? this.args.initialFocus;\n const hasInitialFocus = initialFocus !== undefined && initialFocus !== null;\n\n if (\n !(this.focusesPanel || hasInitialFocus) ||\n !this.panel ||\n initialFocus === false ||\n this.args.focusTrapProps?.disabled\n ) {\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 (initialFocus != null) {\n focusTarget = getElementFromInitialFocus(initialFocus);\n } else {\n // upstream: the panel itself, then Tab reaches the first element\n focusTarget = this.panel;\n }\n\n if (focusTarget == null) {\n // an `initialFocus` that matches nothing: the first tabbable item\n focusTarget = tabbable(this.panel)[0];\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.updateTriggerAria();\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 CLOSING_TRANSITION_TIME\n );\n }\n\n if (!!this.prevIsOpen !== !!this.args.isOpen) {\n this.updateTriggerAria();\n }\n\n this.prevIsOpen = this.args.isOpen;\n }\n\n /**\n * Upstream: the first focusable element of the anchor, when it is a\n * button (or `role=\"button\"`), gets `aria-expanded`, and `aria-controls`\n * pointing at the panel while open. Inputs and other elements are left\n * alone.\n */\n getFocusableToggleButton(): HTMLElement | undefined {\n const anchor = this.args.button ?? this._button;\n\n if (!anchor) return undefined;\n\n try {\n return focusable(anchor, { includeContainer: !!this.args.button })[0] as\n | HTMLElement\n | undefined;\n } catch {\n return undefined;\n }\n }\n\n @action\n updateTriggerAria(): void {\n const toggleButton = this.getFocusableToggleButton();\n\n if (!toggleButton) return;\n\n const tag = toggleButton.tagName.toLowerCase();\n const role = toggleButton.getAttribute('role')?.toLowerCase();\n\n if (tag !== 'button' && role !== 'button') return;\n\n toggleButton.setAttribute('aria-expanded', this.isOpen ? 'true' : 'false');\n\n if (this.isOpen) {\n toggleButton.setAttribute('aria-controls', this.panelId);\n } else {\n toggleButton.removeAttribute('aria-controls');\n }\n }\n\n /** Upstream repositions an open popover when these args change. */\n @action\n didUpdatePlacementArgs(): void {\n if (this.isOpen) this.positionPopoverFluid();\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 this.cancelPositionOnFrame?.();\n this.cancelPositionOnFrame = undefined;\n this.cancelUpdateFocus();\n }\n\n @action\n onMutation(records: MutationRecord[]): void {\n const waitDuration = getWaitDuration(records);\n\n this.positionPopoverFixed();\n\n // Upstream starts a new, uncancellable frame loop per mutation (it keeps\n // running after unmount there too). Here one loop runs until the latest\n // transition ends, and willDestroy cancels it.\n const now = Date.now();\n const remaining = Math.max(waitDuration, this.positionOnFrameUntil - now);\n\n this.cancelPositionOnFrame?.();\n this.positionOnFrameUntil = now + remaining;\n this.cancelPositionOnFrame = performOnFrame(\n remaining,\n this.positionPopoverFixed\n );\n }\n\n positionOnFrameUntil = 0;\n cancelPositionOnFrame?: () => void;\n\n @action\n positionPopover(allowEnforcePosition: boolean): void {\n if (this.button == null || this.panel == null) return;\n\n // upstream: no extra distance by default with an arrow, 4px without\n const offset = this.args.offset ?? (this.hasArrow ? 0 : 4);\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 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: this.args.attachToAnchor\n ? offset\n : this.hasArrow\n ? 16 + offset\n : 8 + offset,\n // upstream Borealis arrow: 16px wide, kept out of the 12px corners\n arrowConfig: this.hasArrow\n ? { arrowWidth: 16, arrowBuffer: 10, borderRadius: 12 }\n : { arrowWidth: 0, arrowBuffer: 0 },\n returnBoundingBox: this.args.attachToAnchor,\n allowCrossAxis: this.args.repositionToCrossAxis ?? true,\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.args.onPositionChange?.(arrowPosition);\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 // upstream: reduces the risk of a blurry animation in Chrome 86+\n willChange: this.isOpenStable ? 'auto' : 'transform, opacity'\n };\n }\n\n get showArrow(): boolean {\n return this.hasArrow && !this.args.attachToAnchor;\n }\n\n /** Root: upstream `euiPopoverStyles` plus the display. */\n @cached\n get classes(): string {\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiPopoverStyles);\n const display = DISPLAY_CSS[this.display] ?? this.display;\n\n return `euiPopover ${euiClass(\n context,\n styles.euiPopover,\n { display, label: display },\n this.args.rootCss,\n this.args.css\n )}`;\n }\n\n /**\n * The panel: upstream `EuiPopoverPanel`, i.e. an `EuiPanel` (plain, no\n * shadow or border, padding and radius m) composed with the popover panel\n * styles in a single class, so no rule order between two classes matters.\n */\n @cached\n get panelClasses(): string {\n const context = getEuiThemeContext(this);\n const upstream = context.upstream;\n const panel = useEuiBorealisStyles(context, euiPanelStyles);\n const styles = useEuiBorealisStyles(context, euiPopoverPanelStyles);\n const isOpen = this.isOpening;\n const position = this.arrowPosition;\n const colorMode = upstream.colorMode === 'DARK' ? 'dark' : 'light';\n const generated = euiClass(\n context,\n // no React global reset; portaled content also leaves the provider's\n // color wrapper, so the panel sets the theme's text color itself\n {\n boxSizing: 'border-box',\n color: upstream.euiTheme.colors.textParagraph,\n textAlign: 'start'\n },\n panel.euiPanel,\n panel.grow,\n panel.radius.m,\n { padding: euiPaddingSize(upstream, this.panelPaddingSize) ?? 0 },\n { backgroundColor: euiBackgroundColor(upstream, 'plain') },\n upstream.highContrastMode && {\n border: upstream.euiTheme.border.thin,\n borderColor: euiBorderColor(upstream, 'plain')\n },\n styles.euiPopover__panel,\n styles[colorMode],\n isOpen && styles.isOpen,\n ...(this.args.attachToAnchor\n ? [styles.isAttached.isAttached, position && styles.isAttached[position]]\n : [\n styles.hasTransform.hasTransform,\n isOpen && position && styles.hasTransform[position]\n ]),\n this.args.panelCss,\n this.args.panelProps?.css\n );\n\n return [\n 'euiPanel euiPanel--plain euiPopover__panel',\n this.panelClassNames,\n generated\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n @cached\n get arrowClasses(): { wrapper: string; arrow: string } | undefined {\n const position = this.arrowPosition;\n\n if (!position) return undefined;\n\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiPopoverArrowStyles);\n\n return {\n wrapper: `euiPopover__arrowWrapper ${euiClass(context, styles.euiPopoverArrowWrapper)}`,\n arrow: `euiPopover__arrow ${euiClass(context, styles.euiPopoverArrow, styles[position])}`\n };\n }\n\n get screenReaderAnnouncement(): string {\n return this.euiI18n.lookupToken(\n 'euiPopover.screenReaderAnnouncement',\n 'You are in a dialog. Press Escape, or tap/click outside the dialog to close.'\n );\n }\n\n get hasDescription(): boolean {\n return this.ownFocus || !!this.args.popoverScreenReaderText;\n }\n\n get panelRole(): string | undefined {\n const props = this.args.panelProps;\n\n return props && 'role' in props ? (props.role as string) : 'dialog';\n }\n\n get panelAriaModal(): string | undefined {\n const props = this.args.panelProps;\n const value = props && 'aria-modal' in props ? props['aria-modal'] : 'true';\n\n return value == null ? undefined : String(value);\n }\n\n /** Upstream: `ownFocus`, or a panel that is not a modal dialog. */\n get focusesPanel(): boolean {\n return this.ownFocus || this.panelAriaModal !== 'true';\n }\n\n get tabindex() {\n const own = this.args.panelProps?.tabIndex;\n\n if (this.focusesPanel) {\n return own ?? this.args.tabindex ?? '0';\n }\n\n return own ?? '-1';\n }\n\n /** The panel's classes: `@panelClassName` and `panelProps.className`. */\n get panelClassNames(): string {\n return [this.args.panelClassName, this.args.panelProps?.className]\n .filter(Boolean)\n .join(' ');\n }\n\n /** `panelProps` that are not handled by the template. */\n applyPanelProps = modifier(\n (panel: HTMLElement, [props]: [EuiPopoverPanelProps | undefined]) => {\n const cleanups: Array<() => void> = [];\n const handled = new Set([\n 'className',\n 'css',\n 'tabIndex',\n 'role',\n 'aria-modal',\n 'id',\n 'style',\n 'hasShadow',\n 'hasBorder',\n 'color'\n ]);\n\n for (const [key, value] of Object.entries(props ?? {})) {\n if (handled.has(key) || value === undefined) continue;\n\n if (/^on[A-Z]/.test(key) && typeof value === 'function') {\n const type = key.slice(2).toLowerCase();\n\n panel.addEventListener(type, value as EventListener);\n cleanups.push(() =>\n panel.removeEventListener(type, value as EventListener)\n );\n } else if (value === false || value === null) {\n panel.removeAttribute(key);\n } else {\n panel.setAttribute(key, value === true ? '' : String(value as string | number));\n cleanups.push(() => panel.removeAttribute(key));\n }\n }\n\n return () => cleanups.forEach((cleanup) => cleanup());\n }\n );\n\n /** Upstream `EuiFocusTrap` `returnFocus` as focus-trap options. */\n get focusTrapReturnFocus(): Record<string, unknown> {\n const returnFocus = this.args.focusTrapProps?.returnFocus;\n\n if (returnFocus === false) {\n return { returnFocusOnDeactivate: false };\n }\n\n if (typeof returnFocus === 'function') {\n return {\n setReturnFocus: (previous: HTMLElement | SVGElement) =>\n returnFocus(previous) === false ? false : previous\n };\n }\n\n return {};\n }\n\n get isFocusTrapActive(): boolean {\n const { disabled } = this.args.focusTrapProps ?? {};\n\n return !(\n disabled ??\n (!this.ownFocus || !this.isOpenStable || this.isClosing)\n );\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 /** Upstream's `panelRef(null)`: the panel left the DOM. */\n @action\n unregisterPanel(): void {\n this.registerPanel(null);\n }\n\n @action\n registerPanel(panel: HTMLElement | null): 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 <div\n class=\"{{this.classes}} {{if this.isOpening 'euiPopover-isOpen'}}\"\n {{onKey \"_all\" this.onKeyDown priority=1}}\n {{didInsert this.didInsertPopover}}\n {{didUpdate this.didUpdateIsOpen @isOpen}}\n {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}}\n {{didUpdate\n this.didUpdatePlacementArgs\n @anchorPosition\n @buffer\n @offset\n @panelPaddingSize\n }}\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) (or this.isCurrentlyOpen this.isClosing)\n )\n }}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n <div\n id={{this.panelId}}\n class={{this.panelClasses}}\n data-popover-panel=\"true\"\n data-popover-open={{if this.isOpening \"true\"}}\n aria-live={{if this.focusesPanel \"off\" \"assertive\"}}\n role={{this.panelRole}}\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledBy}}\n aria-modal={{this.panelAriaModal}}\n aria-describedby={{if this.hasDescription this.descriptionId}}\n tabindex={{this.tabindex}}\n {{simpleStyle this._popoverStyles}}\n {{didInsert this.registerPanel}}\n {{willDestroy this.unregisterPanel}}\n {{this.joinFocusTraps}}\n {{this.applyPanelProps @panelProps}}\n {{outsideClickDetector onOutsideClick=this.onClickOutside}}\n {{onKey \"Escape\" this.onEscapeKey}}\n {{! the trap only traps: updateFocus sets the initial focus,\n once the panel is positioned and visible }}\n {{focusTrap\n _createFocusTrap=focusTrapFactory\n isActive=this.isFocusTrapActive\n shouldSelfFocus=this.shouldSelfFocus\n isPaused=this.isFocusTrapPaused\n additionalElements=@focusTrapProps.shards\n focusTrapOptions=(merge\n (hash\n returnFocusOnDeactivate=this.isOpenStable\n initialFocus=false\n onDeactivate=(optional @onTrapDeactivation)\n preventScroll=true\n clickOutsideDeactivates=true\n fallbackFocus=(concat \"#\" this.panelId)\n )\n this.focusTrapReturnFocus\n @focusTrapOptions\n )\n }}\n >\n {{#if this.showArrow}}\n {{#if this.arrowClasses}}\n <div\n class={{this.arrowClasses.wrapper}}\n style={{this._arrowStyles}}\n >\n <div\n class={{this.arrowClasses.arrow}}\n data-popover-arrow={{this.arrowPosition}}\n ></div>\n {{yield to=\"arrowChildren\"}}\n </div>\n {{/if}}\n {{/if}}\n {{#if this.hasDescription}}\n <p id={{this.descriptionId}} {{screenReaderOnly}}>\n {{#if this.ownFocus}}{{this.screenReaderAnnouncement}}{{/if}}\n {{@popoverScreenReaderText}}\n </p>\n {{/if}}\n <div\n {{mutationObserver\n onMutation=this.onMutation\n observerOptions=(merge\n (hash\n attributes=true childList=true characterData=true subtree=true\n )\n @mutationObserverOptions\n )\n }}\n >\n {{yield to=\"content\"}}\n </div>\n </div>\n </EuiPortal>\n {{/if}}\n\n </div>\n </template>\n}\n"],"names":["anchorPositionToPopoverPositionMap","up","right","down","left","getPopoverPositionFromAnchorPosition","anchorPosition","match","length","getPopoverAlignFromAnchorPosition","toLowerCase","ANCHOR_POSITIONS","DISPLAY","DISPLAY_CSS","inlineBlock","block","CLOSING_TRANSITION_TIME","focusWaiter","buildWaiter","DEFAULT_POPOVER_STYLES","top","getElementFromInitialFocus","initialFocus","initialFocusType","document","querySelector","EuiPopoverComponent","Component","g","prototype","service","i","panelContext","n","provide","EUI_POPOVER_PANEL_CONTEXT","paddingSize","panelPaddingSize","panelId","generateId","descriptionId","argOrDefaultDecorator","tracked","respositionTimeout","closingTransitionTimeout","closingTransitionAnimationFrame","updateFocusAnimationFrame","updateFocusToken","hasSetInitialFocus","joinFocusTraps","modifier","panel","attachToFocusTraps","_button","constructor","owner","args","assert","closePopover","prevIsOpen","isOpen","suppressingPopover","isCurrentlyOpen","button","insert","shouldAccountForOtherPopovers","popoverHost","sibling","children","position","undefined","action","onEscapeKey","event","ekEvent","stopPropagation","stopImmediatePropagation","preventDefault","focusTrapProps","onKeyDown","key","cascadingMenuKeys","ESCAPE","onClickOutside","focusTrapOptions","contains","target","cancelUpdateFocus","cancelAnimationFrame","endAsync","updateFocus","token","beginAsync","window","requestAnimationFrame","hasInitialFocus","focusesPanel","disabled","activeElement","focusTarget","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","updateTriggerAria","didUpdateRepositionOnScroll","removeEventListener","didUpdateIsOpen","isClosing","getFocusableToggleButton","anchor","focusable","includeContainer","toggleButton","tag","tagName","role","getAttribute","setAttribute","removeAttribute","didUpdatePlacementArgs","positionPopoverFluid","willDestroy","cancelPositionOnFrame","onMutation","records","waitDuration","getWaitDuration","now","Date","remaining","positionOnFrameUntil","performOnFrame","positionPopover","allowEnforcePosition","offset","hasArrow","forcePosition","openPosition","foundPosition","arrow","anchorBoundingBox","findPopoverPosition","container","host","align","popover","attachToAnchor","arrowConfig","arrowWidth","arrowBuffer","borderRadius","returnBoundingBox","allowCrossAxis","repositionToCrossAxis","buffer","zIndex","zIndexProp","getElementZIndex","popoverStyles","willRenderArrow","arrowStyles","arrowPosition","onPositionChange","_arrowStyles","htmlSafe","_popoverStyles","panelStyle","willChange","showArrow","classes","context","getEuiThemeContext","styles","useEuiBorealisStyles","euiPopoverStyles","display","euiClass","euiPopover","label","rootCss","css","cached","panelClasses","upstream","euiPanelStyles","euiPopoverPanelStyles","colorMode","generated","boxSizing","color","euiTheme","colors","textParagraph","textAlign","euiPanel","grow","radius","m","padding","euiPaddingSize","backgroundColor","euiBackgroundColor","highContrastMode","border","thin","borderColor","euiBorderColor","euiPopover__panel","isAttached","hasTransform","panelCss","panelProps","panelClassNames","filter","Boolean","join","arrowClasses","euiPopoverArrowStyles","wrapper","euiPopoverArrowWrapper","euiPopoverArrow","screenReaderAnnouncement","euiI18n","lookupToken","hasDescription","ownFocus","popoverScreenReaderText","panelRole","props","panelAriaModal","value","String","tabindex","own","tabIndex","panelClassName","className","applyPanelProps","cleanups","handled","Set","Object","entries","has","test","type","push","forEach","cleanup","focusTrapReturnFocus","returnFocus","returnFocusOnDeactivate","setReturnFocus","previous","isFocusTrapActive","registerButton","btn","buttonRef","unregisterPanel","registerPanel","panelRef","setComponentTemplate","precompileTemplate","strictMode","scope","onKey","didInsert","didUpdate","optional","and","not","or","EuiPortal","simpleStyle","outsideClickDetector","focusTrap","focusTrapFactory","merge","hash","concat","screenReaderOnly","mutationObserver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiVA,MAAMA,kCAEF,GAAA;AACFC,EAAAA,EAAA,EAAI,KAAA;AACJC,EAAAA,KAAA,EAAO,OAAA;AACPC,EAAAA,IAAA,EAAM,QAAA;AACNC,EAAAA,IAAA,EAAM;AACR,CAA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