@ember-eui/core 16.0.2 → 16.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/declarations/-private/accents.d.ts +15 -0
  2. package/declarations/-private/accents.d.ts.map +1 -0
  3. package/declarations/-private/eui-render-node.d.ts +8 -3
  4. package/declarations/-private/eui-render-node.d.ts.map +1 -1
  5. package/declarations/components/eui-accordion.d.ts.map +1 -1
  6. package/declarations/components/eui-combo-box/option-text.d.ts +7 -1
  7. package/declarations/components/eui-combo-box/option-text.d.ts.map +1 -1
  8. package/declarations/components/eui-combo-box/trigger/input.d.ts +9 -0
  9. package/declarations/components/eui-combo-box/trigger/input.d.ts.map +1 -1
  10. package/declarations/components/eui-combo-box/trigger.d.ts +13 -0
  11. package/declarations/components/eui-combo-box/trigger.d.ts.map +1 -1
  12. package/declarations/components/eui-combo-box.d.ts +26 -1
  13. package/declarations/components/eui-combo-box.d.ts.map +1 -1
  14. package/declarations/components/eui-highlight.d.ts +12 -3
  15. package/declarations/components/eui-highlight.d.ts.map +1 -1
  16. package/declarations/components/eui-toast.d.ts.map +1 -1
  17. package/declarations/services/eui-config.d.ts +5 -0
  18. package/declarations/services/eui-config.d.ts.map +1 -1
  19. package/declarations/utils/eui/combo-box.d.ts +1 -5
  20. package/declarations/utils/eui/combo-box.d.ts.map +1 -1
  21. package/dist/-private/accents.js +40 -0
  22. package/dist/-private/accents.js.map +1 -0
  23. package/dist/-private/eui-render-node.js +6 -4
  24. package/dist/-private/eui-render-node.js.map +1 -1
  25. package/dist/components/eui-accordion.js +17 -3
  26. package/dist/components/eui-accordion.js.map +1 -1
  27. package/dist/components/eui-combo-box/option-text.js +14 -6
  28. package/dist/components/eui-combo-box/option-text.js.map +1 -1
  29. package/dist/components/eui-combo-box/trigger/input.js +23 -2
  30. package/dist/components/eui-combo-box/trigger/input.js.map +1 -1
  31. package/dist/components/eui-combo-box/trigger.js +32 -2
  32. package/dist/components/eui-combo-box/trigger.js.map +1 -1
  33. package/dist/components/eui-combo-box.js +24 -5
  34. package/dist/components/eui-combo-box.js.map +1 -1
  35. package/dist/components/eui-highlight.js +22 -8
  36. package/dist/components/eui-highlight.js.map +1 -1
  37. package/dist/components/eui-toast.js +6 -4
  38. package/dist/components/eui-toast.js.map +1 -1
  39. package/dist/services/eui-config.js.map +1 -1
  40. package/dist/utils/eui/combo-box.js +5 -3
  41. package/dist/utils/eui/combo-box.js.map +1 -1
  42. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"eui-accordion.js","sources":["../../src/components/eui-accordion.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { guidFor } from '@ember/object/internals';\nimport { on } from '@ember/modifier';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport type Owner from '@ember/owner';\n\nimport { modifier } from 'ember-modifier';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport {\n euiAccordionArrowStyles,\n euiAccordionButtonStyles,\n euiAccordionChildrenStyles,\n euiAccordionChildWrapperStyles,\n euiAccordionStyles\n} from '../utils/eui/styles.generated.ts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiText from './eui-text.gts';\n\nimport type EuiI18n from '../services/eui-i18n';\nimport type { EuiCss } from '../utils/eui/styles.ts';\nimport type { CommonArgs } from './common.ts';\n\nexport type EuiAccordionPaddingSize = 'none' | 'xs' | 's' | 'm' | 'l' | 'xl';\nexport type EuiAccordionBorders = 'none' | 'horizontal' | 'all';\ntype TriggerElement = 'div' | 'legend' | 'button';\n\n/** Upstream's flex row holding the arrow, trigger and extra action. */\nconst TRIGGER_WRAPPER = {\n display: 'flex',\n alignItems: 'center',\n label: 'EuiAccordionTrigger'\n} as const;\nconst OPTIONAL_ACTION = { flexShrink: 0, label: 'optionalAction' } as const;\n\n/**\n * Scoped equivalent of React's global button reset (the trigger is a native\n * `<button>`/`<legend>`); upstream's button styles come after it and win.\n */\nconst TRIGGER_RESET = {\n boxSizing: 'border-box',\n margin: 0,\n padding: 0,\n border: 'none',\n background: 'none',\n color: 'inherit',\n font: 'inherit'\n} as const;\n\n/**\n * Measures the children's layout height (unaffected by CSS transforms) and\n * reports it after layout, like upstream's `EuiResizeObserver` (rounded).\n */\nconst observeHeight = modifier(\n (element: HTMLElement, [onResize]: [(height: number) => void]) => {\n if (typeof ResizeObserver === 'undefined') {\n onResize(element.offsetHeight);\n return;\n }\n const observer = new ResizeObserver(() =>\n onResize(Math.round(element.offsetHeight))\n );\n observer.observe(element);\n return () => observer.disconnect();\n }\n);\n\n/** Upstream's one-way `hasTransition` state (an untracked flag). */\nfunction enableTransition(state: { enabled: boolean }): void {\n state.enabled = true;\n}\n\ntype AccordionArgs = {\n /**\n * Id of the collapsible content region; the trigger's `aria-controls`\n * points to it. Defaults to a generated id.\n */\n id?: string;\n /**\n * Element wrapping the accordion. With `'fieldset'` the trigger renders as\n * a `<legend>`, for accordions that group form controls.\n * Defaults to `'div'`.\n */\n element?: 'div' | 'fieldset';\n /**\n * ARIA role of the content region. Defaults to `'group'` (upstream);\n * pass `'region'` for landmark-worthy sections.\n */\n role?: string;\n /** Class that will apply to the trigger for the accordion. */\n buttonClassName?: string;\n /**\n * Extra props for the trigger: `id` (defaults to a generated id),\n * `className`, `data-test-subj`, `paddingSize` (`'s'`, `'m'` or `'l'`)\n * to pad the trigger (not on the arrow's side), and `css`: extra styles\n * composed last into the trigger's class (upstream `buttonProps.css`).\n */\n buttonProps?: CommonArgs & { paddingSize?: 's' | 'm' | 'l'; css?: EuiCss };\n /**\n * Element of the trigger: `'button'` (default) or `'div'`, e.g. when the\n * trigger content holds interactive elements. A non-button trigger makes\n * the arrow the focusable control. Always `'legend'` when\n * `@element=\"fieldset\"`.\n */\n buttonElement?: TriggerElement;\n /** Extra props for the arrow's EuiButtonIcon: `className` and `css`. */\n arrowProps?: {\n className?: string;\n css?: EuiCss;\n };\n /** Class that will apply to the trigger content for the accordion. */\n buttonContentClassName?: string;\n /**\n * Text content of the trigger. Use the `<:buttonContent>` block for\n * markup; the block wins when both are given.\n */\n buttonContent?: string;\n /**\n * Set to `true` to render the `<:extraAction>` block, right aligned next\n * to the trigger (e.g. a delete button). The block is ignored without it.\n */\n extraAction?: boolean;\n /** The accordion will start in the open state. Defaults to `false`. */\n initialIsOpen?: boolean;\n /**\n * Called with the new open state (`true` = open) when the trigger or arrow\n * is clicked. With `@forceState`, use it to update the state you control.\n */\n onToggle?: (isOpen: boolean) => void;\n /**\n * Padding around the content: `'none'`, `'xs'`, `'s'`, `'m'`, `'l'` or\n * `'xl'`. Defaults to `'none'`.\n */\n paddingSize?: EuiAccordionPaddingSize;\n /**\n * Borders around the accordion: `'none'`, `'horizontal'` (top and bottom)\n * or `'all'`. Adjacent bordered accordions share one border.\n * Defaults to `'none'`.\n */\n borders?: EuiAccordionBorders;\n /**\n * Placement of the arrow indicator, or `'none'` to hide it (only possible\n * when the trigger is a button). Defaults to `'left'`.\n */\n arrowDisplay?: 'left' | 'right' | 'none';\n /**\n * Controls the open state from outside: `'open'` or `'closed'`. Clicking\n * the trigger then only calls `@onToggle`; update `@forceState` there.\n */\n forceState?: 'closed' | 'open';\n /**\n * Shows a loading spinner in place of the `<:extraAction>` block.\n * Defaults to `false`.\n */\n isLoading?: boolean;\n /**\n * While `@isLoading`, replace the content with a spinner and a message:\n * `true` for \"Loading\" (i18n token `euiAccordionChildrenLoading.message`),\n * or a string for your own message. Defaults to `false` (the content\n * stays visible).\n */\n isLoadingMessage?: boolean | string;\n /**\n * Disables the trigger and the arrow (greyed out, not clickable).\n * Defaults to `false`.\n */\n isDisabled?: boolean;\n /** @deprecated Has no effect, use `@initialIsOpen` or `@forceState`. */\n isOpen?: boolean;\n /** Class for the element wrapping the content (`.euiAccordion__children`). */\n childClassName?: string;\n /** Class for the row holding the arrow, trigger and extra action. */\n triggerClassName?: string;\n /** @deprecated Has no effect, use `@childClassName`. */\n childContentClassName?: string;\n /**\n * Extra styles composed last into this component's class (like upstream's\n * `css` prop). Prefer this to an extra class when styling it from a parent.\n */\n css?: EuiCss;\n};\n\nexport interface EuiAccordionSignature {\n Element: any;\n Args: AccordionArgs;\n Blocks: {\n /** The trigger's content (usually a title); yields whether it is open. */\n buttonContent: [boolean | undefined];\n /** The collapsible content. */\n content: [];\n /**\n * Rendered next to the trigger when `@extraAction={{true}}`; yields\n * whether it is open.\n */\n extraAction: [boolean | undefined];\n };\n}\n\n/** Native Ember accordion on the upstream EUI 123 / Borealis factories. */\nexport default class EuiAccordionComponent extends Component<EuiAccordionSignature> {\n @service declare euiI18n: EuiI18n;\n\n observeHeight = observeHeight;\n\n @tracked _opened: boolean;\n @tracked contentHeight = 0;\n\n /** Set once an initially open accordion closes; enables transitions. */\n transition = { enabled: false };\n\n generatedRegionId = `euiAccordion-${guidFor(this)}`;\n generatedButtonId = `euiAccordionButton-${guidFor(this)}`;\n\n constructor(owner: Owner, args: AccordionArgs) {\n super(owner, args);\n this._opened = args.forceState\n ? args.forceState === 'open'\n : Boolean(args.initialIsOpen);\n }\n\n get context() {\n return getEuiThemeContext(this);\n }\n\n get tagName(): 'div' | 'fieldset' {\n return this.args.element === 'fieldset' ? 'fieldset' : 'div';\n }\n\n get buttonElement(): TriggerElement {\n if (this.tagName === 'fieldset') return 'legend';\n const element = this.args.buttonElement;\n return element === 'div' || element === 'legend' ? element : 'button';\n }\n\n get buttonIsInteractive(): boolean {\n return this.buttonElement === 'button';\n }\n\n /** Upstream forces the arrow when the trigger is not focusable. */\n get arrowDisplay(): 'left' | 'right' | 'none' {\n const display = this.args.arrowDisplay ?? 'left';\n return display === 'none' && !this.buttonIsInteractive ? 'left' : display;\n }\n\n get isOpen(): boolean {\n return this.args.forceState\n ? this.args.forceState === 'open'\n : this._opened;\n }\n\n get isDisabled(): boolean {\n return Boolean(this.args.isDisabled);\n }\n\n get isLoading(): boolean {\n return Boolean(this.args.isLoading);\n }\n\n get showLoadingMessage(): boolean {\n return this.isLoading && Boolean(this.args.isLoadingMessage);\n }\n\n get loadingMessage(): string {\n const message = this.args.isLoadingMessage;\n return typeof message === 'string' && message\n ? message\n : this.euiI18n.lookupToken(\n 'euiAccordionChildrenLoading.message',\n 'Loading'\n );\n }\n\n get regionId(): string {\n return this.args.id ?? this.generatedRegionId;\n }\n\n get buttonId(): string {\n return this.args.buttonProps?.id ?? this.generatedButtonId;\n }\n\n get borders(): EuiAccordionBorders {\n const borders = this.args.borders;\n return borders === 'horizontal' || borders === 'all' ? borders : 'none';\n }\n\n get paddingSize(): EuiAccordionPaddingSize {\n return this.args.paddingSize ?? 'none';\n }\n\n get role(): string {\n return this.args.role ?? 'group';\n }\n\n @cached\n get rootClass(): string {\n const styles = useEuiBorealisStyles(this.context, euiAccordionStyles);\n const borders = this.borders;\n return euiClass(\n this.context,\n styles.euiAccordion,\n borders !== 'none' && styles.borders.borders,\n borders !== 'none' && styles.borders[borders],\n this.args.css\n );\n }\n\n @cached\n get triggerWrapperClass(): string {\n return euiClass(this.context, TRIGGER_WRAPPER);\n }\n\n @cached\n get optionalActionClass(): string {\n return euiClass(this.context, OPTIONAL_ACTION);\n }\n\n @cached\n get buttonClass(): string {\n const styles = useEuiBorealisStyles(this.context, euiAccordionButtonStyles);\n const padding = this.args.buttonProps?.paddingSize;\n const arrow = this.arrowDisplay;\n return euiClass(\n this.context,\n TRIGGER_RESET,\n styles.euiAccordion__button,\n this.isDisabled && styles.disabled,\n padding && styles[padding],\n padding && arrow === 'left' && styles.arrowLeft,\n padding && arrow === 'right' && styles.arrowRight,\n this.args.buttonProps?.css\n );\n }\n\n /** Arrow styles composed into the EuiButtonIcon's own class (`@css`). */\n @cached\n get arrowCss() {\n const styles = useEuiBorealisStyles(this.context, euiAccordionArrowStyles);\n const side = this.arrowDisplay === 'right' ? 'right' : 'left';\n return [\n styles.euiAccordion__arrow,\n styles[side],\n this.isOpen ? styles.isOpen : styles.isClosed,\n this.args.arrowProps?.css\n ];\n }\n\n get arrowClasses(): string {\n return ['euiAccordion__arrow', this.args.arrowProps?.className]\n .filter(Boolean)\n .join(' ');\n }\n\n get noTransition(): boolean {\n const initialIsOpen = Boolean(this.args.initialIsOpen);\n // Upstream: the first close of an initially open accordion turns\n // transitions on for good (untracked flag, read with `isOpen`).\n if (initialIsOpen && !this.isOpen) enableTransition(this.transition);\n return initialIsOpen && !this.transition.enabled && this.isOpen;\n }\n\n @cached\n get childWrapperClass(): string {\n const styles = useEuiBorealisStyles(\n this.context,\n euiAccordionChildWrapperStyles\n );\n return euiClass(\n this.context,\n styles.euiAccordion__childWrapper,\n this.isOpen ? styles.isOpen : styles.isClosed,\n this.noTransition && styles.noTransition\n );\n }\n\n @cached\n get childrenClass(): string {\n const styles = useEuiBorealisStyles(\n this.context,\n euiAccordionChildrenStyles\n );\n const padding = this.paddingSize;\n return euiClass(\n this.context,\n styles.euiAccordion__children,\n this.isLoading && styles.isLoading,\n padding !== 'none' && styles[padding]\n );\n }\n\n /** Upstream's `css` on the loading message's spinner. */\n @cached\n get spinnerCss(): EuiCss {\n return { marginInlineEnd: this.context.upstream.euiTheme.size.xs };\n }\n\n /** Upstream's inline `blockSize`: the measured content height when open. */\n get childWrapperStyle() {\n return htmlSafe(`block-size: ${this.isOpen ? this.contentHeight : 0}px`);\n }\n\n get buttonClasses(): string {\n return [\n 'euiAccordion__button',\n this.args.buttonClassName,\n this.args.buttonProps?.className,\n this.buttonClass\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n get buttonContentClasses(): string {\n return ['euiAccordion__buttonContent', this.args.buttonContentClassName]\n .filter(Boolean)\n .join(' ');\n }\n\n get childrenClasses(): string {\n return [\n 'euiAccordion__children',\n this.isLoading && 'euiAccordion__children-isLoading',\n this.args.childClassName,\n this.childrenClass\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n onResize = (height: number): void => {\n if (height !== this.contentHeight) this.contentHeight = height;\n };\n\n onToggle = (): void => {\n if (this.isDisabled) return;\n if (this.args.forceState) {\n this.args.onToggle?.(!this.isOpen);\n } else {\n this._opened = !this._opened;\n this.args.onToggle?.(this._opened);\n }\n };\n\n <template>\n {{#let\n (element this.tagName) (element this.buttonElement)\n as |Accordion ButtonElement|\n }}\n <Accordion\n class=\"euiAccordion {{if this.isOpen 'euiAccordion-isOpen'}} {{this.rootClass}}\"\n ...attributes\n >\n <div\n class=\"euiAccordion__triggerWrapper {{this.triggerWrapperClass}} {{@triggerClassName}}\"\n >\n {{#if (eq this.arrowDisplay \"left\")}}\n <EuiButtonIcon\n class={{this.arrowClasses}}\n @color=\"text\"\n @iconType=\"chevronSingleRight\"\n @isDisabled={{this.isDisabled}}\n @css={{this.arrowCss}}\n aria-controls={{this.regionId}}\n aria-expanded={{if this.isOpen \"true\" \"false\"}}\n aria-labelledby={{this.buttonId}}\n aria-hidden={{if this.buttonIsInteractive \"true\" \"false\"}}\n tabindex={{if this.buttonIsInteractive \"-1\" \"0\"}}\n {{on \"click\" this.onToggle}}\n />\n {{/if}}\n <ButtonElement\n type={{if this.buttonIsInteractive \"button\"}}\n disabled={{if this.buttonIsInteractive this.isDisabled}}\n id={{this.buttonId}}\n class={{this.buttonClasses}}\n aria-controls={{this.regionId}}\n aria-expanded={{if\n this.buttonIsInteractive\n (if this.isOpen \"true\" \"false\")\n }}\n data-test-subj={{@buttonProps.data-test-subj}}\n {{on \"click\" this.onToggle}}\n >\n <span class={{this.buttonContentClasses}}>\n {{#if (has-block \"buttonContent\")}}\n {{yield this.isOpen to=\"buttonContent\"}}\n {{else}}\n {{@buttonContent}}\n {{/if}}\n </span>\n </ButtonElement>\n {{#if this.isLoading}}\n <div\n class=\"euiAccordion__optionalAction {{this.optionalActionClass}}\"\n >\n <EuiLoadingSpinner />\n </div>\n {{else if (and @extraAction (has-block \"extraAction\"))}}\n <div\n class=\"euiAccordion__optionalAction {{this.optionalActionClass}}\"\n >\n {{yield this.isOpen to=\"extraAction\"}}\n </div>\n {{/if}}\n {{#if (eq this.arrowDisplay \"right\")}}\n <EuiButtonIcon\n class={{this.arrowClasses}}\n @color=\"text\"\n @iconType=\"chevronSingleRight\"\n @isDisabled={{this.isDisabled}}\n @css={{this.arrowCss}}\n aria-controls={{this.regionId}}\n aria-expanded={{if this.isOpen \"true\" \"false\"}}\n aria-labelledby={{this.buttonId}}\n aria-hidden={{if this.buttonIsInteractive \"true\" \"false\"}}\n tabindex={{if this.buttonIsInteractive \"-1\" \"0\"}}\n {{on \"click\" this.onToggle}}\n />\n {{/if}}\n </div>\n <div\n class=\"euiAccordion__childWrapper {{this.childWrapperClass}}\"\n style={{this.childWrapperStyle}}\n role={{this.role}}\n id={{this.regionId}}\n aria-labelledby={{this.buttonId}}\n inert={{not this.isOpen}}\n >\n <div\n class={{this.childrenClasses}}\n {{this.observeHeight this.onResize}}\n >\n {{#if this.showLoadingMessage}}\n <EuiLoadingSpinner\n class=\"euiAccordion__spinner\"\n @css={{this.spinnerCss}}\n />\n <EuiText @size=\"s\"><p>{{this.loadingMessage}}</p></EuiText>\n {{else}}\n {{yield to=\"content\"}}\n {{/if}}\n </div>\n </div>\n </Accordion>\n {{/let}}\n </template>\n}\n"],"names":["TRIGGER_WRAPPER","display","alignItems","label","OPTIONAL_ACTION","flexShrink","TRIGGER_RESET","boxSizing","margin","padding","border","background","color","font","observeHeight","modifier","element","onResize","ResizeObserver","offsetHeight","observer","Math","round","observe","disconnect","enableTransition","state","enabled","EuiAccordionComponent","Component","g","prototype","service","i","tracked","transition","generatedRegionId","guidFor","generatedButtonId","constructor","owner","args","_opened","forceState","Boolean","initialIsOpen","context","getEuiThemeContext","tagName","buttonElement","buttonIsInteractive","arrowDisplay","isOpen","isDisabled","isLoading","showLoadingMessage","isLoadingMessage","loadingMessage","message","euiI18n","lookupToken","regionId","id","buttonId","buttonProps","borders","paddingSize","role","rootClass","styles","useEuiBorealisStyles","euiAccordionStyles","euiClass","euiAccordion","css","n","cached","triggerWrapperClass","optionalActionClass","buttonClass","euiAccordionButtonStyles","arrow","euiAccordion__button","disabled","arrowLeft","arrowRight","arrowCss","euiAccordionArrowStyles","side","euiAccordion__arrow","isClosed","arrowProps","arrowClasses","className","filter","join","noTransition","childWrapperClass","euiAccordionChildWrapperStyles","euiAccordion__childWrapper","childrenClass","euiAccordionChildrenStyles","euiAccordion__children","spinnerCss","marginInlineEnd","upstream","euiTheme","size","xs","childWrapperStyle","htmlSafe","contentHeight","buttonClasses","buttonClassName","buttonContentClasses","buttonContentClassName","childrenClasses","childClassName","height","onToggle","setComponentTemplate","precompileTemplate","strictMode","scope","eq","EuiButtonIcon","on","EuiLoadingSpinner","and","not","EuiText"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,uEACA,MAAMA,eAAA,GAAkB;AACtBC,EAAAA,OAAA,EAAS,MAAA;AACTC,EAAAA,UAAA,EAAY,QAAA;AACZC,EAAAA,KAAA,EAAO;AACT,CAAA;AACA,MAAMC,eAAA,GAAkB;AAAEC,EAAAA,UAAA,EAAY,CAAA;AAAGF,EAAAA,KAAA,EAAO;AAAiB,CAAA;AAEjE;;;AAGC;AACD,MAAMG,aAAA,GAAgB;AACpBC,EAAAA,SAAA,EAAW,YAAA;AACXC,EAAAA,MAAA,EAAQ,CAAA;AACRC,EAAAA,OAAA,EAAS,CAAA;AACTC,EAAAA,MAAA,EAAQ,MAAA;AACRC,EAAAA,UAAA,EAAY,MAAA;AACZC,EAAAA,KAAA,EAAO,SAAA;AACPC,EAAAA,IAAA,EAAM;AACR,CAAA;AAEA;;;AAGC;AACD,MAAMC,aAAA,GAAgBC,QAAA,CACpB,CAACC,OAAS,EAAa,CAACC,QAAA,CAAqC,KAAA;AAC3D,EAAA,IAAI,OAAOC,mBAAmB,WAAA,EAAa;AACzCD,IAAAA,QAAA,CAASD,QAAQG,YAAY,CAAA;AAC7B,IAAA;AACF,EAAA;AACA,EAAA,MAAMC,QAAA,GAA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8E,QAAQ,GAAG,IAAI,CAAC7E,OAAO,CAAA;AACnC,IAAA;EACF,CAAA;AAEA,EAAA;IAAA8E,oBAAA,CAAAC,kBAAA,CAAA,83FAAA,EAsGA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;QAAAC,aAAA;QAAAC,EAAA;QAAAC,iBAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"eui-accordion.js","sources":["../../src/components/eui-accordion.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { guidFor } from '@ember/object/internals';\nimport { on } from '@ember/modifier';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport type Owner from '@ember/owner';\n\nimport { modifier } from 'ember-modifier';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport { getEuiThemeContext } from '../utils/emotion/consume.ts';\nimport { euiClass, useEuiBorealisStyles } from '../utils/eui/styles.ts';\nimport {\n euiAccordionArrowStyles,\n euiAccordionButtonStyles,\n euiAccordionChildrenStyles,\n euiAccordionChildWrapperStyles,\n euiAccordionStyles\n} from '../utils/eui/styles.generated.ts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiText from './eui-text.gts';\n\nimport type EuiI18n from '../services/eui-i18n';\nimport type { EuiCss } from '../utils/eui/styles.ts';\nimport type { CommonArgs } from './common.ts';\n\nexport type EuiAccordionPaddingSize = 'none' | 'xs' | 's' | 'm' | 'l' | 'xl';\nexport type EuiAccordionBorders = 'none' | 'horizontal' | 'all';\ntype TriggerElement = 'div' | 'legend' | 'button';\n\n/** Upstream's flex row holding the arrow, trigger and extra action. */\nconst TRIGGER_WRAPPER = {\n display: 'flex',\n alignItems: 'center',\n label: 'EuiAccordionTrigger'\n} as const;\nconst OPTIONAL_ACTION = { flexShrink: 0, label: 'optionalAction' } as const;\n\n/**\n * Scoped equivalent of React's global button reset (the trigger is a native\n * `<button>`/`<legend>`); upstream's button styles come after it and win.\n */\nconst TRIGGER_RESET = {\n boxSizing: 'border-box',\n margin: 0,\n padding: 0,\n border: 'none',\n background: 'none',\n color: 'inherit',\n font: 'inherit'\n} as const;\n\n/**\n * Measures the children's layout height (unaffected by CSS transforms) and\n * reports it after layout, like upstream's `EuiResizeObserver` (rounded).\n *\n * One ResizeObserver serves every accordion on the page, not one each. Each\n * observer's callback runs on its own, and the tracked height it sets\n * schedules a render of its own: a form with a hundred section rows\n * re-rendered a hundred times as it mounted. One observer reports every\n * accordion in a single callback, so the heights land in one render.\n */\nconst heightCallbacks = new WeakMap<Element, () => void>();\nlet heightObserver: ResizeObserver | undefined;\n\nconst observeHeight = modifier(\n (element: HTMLElement, [onResize]: [(height: number) => void]) => {\n if (typeof ResizeObserver === 'undefined') {\n onResize(element.offsetHeight);\n return;\n }\n heightObserver ??= new ResizeObserver((entries) => {\n for (const entry of entries) heightCallbacks.get(entry.target)?.();\n });\n heightCallbacks.set(element, () =>\n onResize(Math.round(element.offsetHeight))\n );\n heightObserver.observe(element);\n return () => {\n heightCallbacks.delete(element);\n heightObserver?.unobserve(element);\n };\n }\n);\n\n/** Upstream's one-way `hasTransition` state (an untracked flag). */\nfunction enableTransition(state: { enabled: boolean }): void {\n state.enabled = true;\n}\n\ntype AccordionArgs = {\n /**\n * Id of the collapsible content region; the trigger's `aria-controls`\n * points to it. Defaults to a generated id.\n */\n id?: string;\n /**\n * Element wrapping the accordion. With `'fieldset'` the trigger renders as\n * a `<legend>`, for accordions that group form controls.\n * Defaults to `'div'`.\n */\n element?: 'div' | 'fieldset';\n /**\n * ARIA role of the content region. Defaults to `'group'` (upstream);\n * pass `'region'` for landmark-worthy sections.\n */\n role?: string;\n /** Class that will apply to the trigger for the accordion. */\n buttonClassName?: string;\n /**\n * Extra props for the trigger: `id` (defaults to a generated id),\n * `className`, `data-test-subj`, `paddingSize` (`'s'`, `'m'` or `'l'`)\n * to pad the trigger (not on the arrow's side), and `css`: extra styles\n * composed last into the trigger's class (upstream `buttonProps.css`).\n */\n buttonProps?: CommonArgs & { paddingSize?: 's' | 'm' | 'l'; css?: EuiCss };\n /**\n * Element of the trigger: `'button'` (default) or `'div'`, e.g. when the\n * trigger content holds interactive elements. A non-button trigger makes\n * the arrow the focusable control. Always `'legend'` when\n * `@element=\"fieldset\"`.\n */\n buttonElement?: TriggerElement;\n /** Extra props for the arrow's EuiButtonIcon: `className` and `css`. */\n arrowProps?: {\n className?: string;\n css?: EuiCss;\n };\n /** Class that will apply to the trigger content for the accordion. */\n buttonContentClassName?: string;\n /**\n * Text content of the trigger. Use the `<:buttonContent>` block for\n * markup; the block wins when both are given.\n */\n buttonContent?: string;\n /**\n * Set to `true` to render the `<:extraAction>` block, right aligned next\n * to the trigger (e.g. a delete button). The block is ignored without it.\n */\n extraAction?: boolean;\n /** The accordion will start in the open state. Defaults to `false`. */\n initialIsOpen?: boolean;\n /**\n * Called with the new open state (`true` = open) when the trigger or arrow\n * is clicked. With `@forceState`, use it to update the state you control.\n */\n onToggle?: (isOpen: boolean) => void;\n /**\n * Padding around the content: `'none'`, `'xs'`, `'s'`, `'m'`, `'l'` or\n * `'xl'`. Defaults to `'none'`.\n */\n paddingSize?: EuiAccordionPaddingSize;\n /**\n * Borders around the accordion: `'none'`, `'horizontal'` (top and bottom)\n * or `'all'`. Adjacent bordered accordions share one border.\n * Defaults to `'none'`.\n */\n borders?: EuiAccordionBorders;\n /**\n * Placement of the arrow indicator, or `'none'` to hide it (only possible\n * when the trigger is a button). Defaults to `'left'`.\n */\n arrowDisplay?: 'left' | 'right' | 'none';\n /**\n * Controls the open state from outside: `'open'` or `'closed'`. Clicking\n * the trigger then only calls `@onToggle`; update `@forceState` there.\n */\n forceState?: 'closed' | 'open';\n /**\n * Shows a loading spinner in place of the `<:extraAction>` block.\n * Defaults to `false`.\n */\n isLoading?: boolean;\n /**\n * While `@isLoading`, replace the content with a spinner and a message:\n * `true` for \"Loading\" (i18n token `euiAccordionChildrenLoading.message`),\n * or a string for your own message. Defaults to `false` (the content\n * stays visible).\n */\n isLoadingMessage?: boolean | string;\n /**\n * Disables the trigger and the arrow (greyed out, not clickable).\n * Defaults to `false`.\n */\n isDisabled?: boolean;\n /** @deprecated Has no effect, use `@initialIsOpen` or `@forceState`. */\n isOpen?: boolean;\n /** Class for the element wrapping the content (`.euiAccordion__children`). */\n childClassName?: string;\n /** Class for the row holding the arrow, trigger and extra action. */\n triggerClassName?: string;\n /** @deprecated Has no effect, use `@childClassName`. */\n childContentClassName?: string;\n /**\n * Extra styles composed last into this component's class (like upstream's\n * `css` prop). Prefer this to an extra class when styling it from a parent.\n */\n css?: EuiCss;\n};\n\nexport interface EuiAccordionSignature {\n Element: any;\n Args: AccordionArgs;\n Blocks: {\n /** The trigger's content (usually a title); yields whether it is open. */\n buttonContent: [boolean | undefined];\n /** The collapsible content. */\n content: [];\n /**\n * Rendered next to the trigger when `@extraAction={{true}}`; yields\n * whether it is open.\n */\n extraAction: [boolean | undefined];\n };\n}\n\n/** Native Ember accordion on the upstream EUI 123 / Borealis factories. */\nexport default class EuiAccordionComponent extends Component<EuiAccordionSignature> {\n @service declare euiI18n: EuiI18n;\n\n observeHeight = observeHeight;\n\n @tracked _opened: boolean;\n @tracked contentHeight = 0;\n\n /** Set once an initially open accordion closes; enables transitions. */\n transition = { enabled: false };\n\n generatedRegionId = `euiAccordion-${guidFor(this)}`;\n generatedButtonId = `euiAccordionButton-${guidFor(this)}`;\n\n constructor(owner: Owner, args: AccordionArgs) {\n super(owner, args);\n this._opened = args.forceState\n ? args.forceState === 'open'\n : Boolean(args.initialIsOpen);\n }\n\n get context() {\n return getEuiThemeContext(this);\n }\n\n get tagName(): 'div' | 'fieldset' {\n return this.args.element === 'fieldset' ? 'fieldset' : 'div';\n }\n\n get buttonElement(): TriggerElement {\n if (this.tagName === 'fieldset') return 'legend';\n const element = this.args.buttonElement;\n return element === 'div' || element === 'legend' ? element : 'button';\n }\n\n get buttonIsInteractive(): boolean {\n return this.buttonElement === 'button';\n }\n\n /** Upstream forces the arrow when the trigger is not focusable. */\n get arrowDisplay(): 'left' | 'right' | 'none' {\n const display = this.args.arrowDisplay ?? 'left';\n return display === 'none' && !this.buttonIsInteractive ? 'left' : display;\n }\n\n get isOpen(): boolean {\n return this.args.forceState\n ? this.args.forceState === 'open'\n : this._opened;\n }\n\n get isDisabled(): boolean {\n return Boolean(this.args.isDisabled);\n }\n\n get isLoading(): boolean {\n return Boolean(this.args.isLoading);\n }\n\n get showLoadingMessage(): boolean {\n return this.isLoading && Boolean(this.args.isLoadingMessage);\n }\n\n get loadingMessage(): string {\n const message = this.args.isLoadingMessage;\n return typeof message === 'string' && message\n ? message\n : this.euiI18n.lookupToken(\n 'euiAccordionChildrenLoading.message',\n 'Loading'\n );\n }\n\n get regionId(): string {\n return this.args.id ?? this.generatedRegionId;\n }\n\n get buttonId(): string {\n return this.args.buttonProps?.id ?? this.generatedButtonId;\n }\n\n get borders(): EuiAccordionBorders {\n const borders = this.args.borders;\n return borders === 'horizontal' || borders === 'all' ? borders : 'none';\n }\n\n get paddingSize(): EuiAccordionPaddingSize {\n return this.args.paddingSize ?? 'none';\n }\n\n get role(): string {\n return this.args.role ?? 'group';\n }\n\n @cached\n get rootClass(): string {\n const styles = useEuiBorealisStyles(this.context, euiAccordionStyles);\n const borders = this.borders;\n return euiClass(\n this.context,\n styles.euiAccordion,\n borders !== 'none' && styles.borders.borders,\n borders !== 'none' && styles.borders[borders],\n this.args.css\n );\n }\n\n @cached\n get triggerWrapperClass(): string {\n return euiClass(this.context, TRIGGER_WRAPPER);\n }\n\n @cached\n get optionalActionClass(): string {\n return euiClass(this.context, OPTIONAL_ACTION);\n }\n\n @cached\n get buttonClass(): string {\n const styles = useEuiBorealisStyles(this.context, euiAccordionButtonStyles);\n const padding = this.args.buttonProps?.paddingSize;\n const arrow = this.arrowDisplay;\n return euiClass(\n this.context,\n TRIGGER_RESET,\n styles.euiAccordion__button,\n this.isDisabled && styles.disabled,\n padding && styles[padding],\n padding && arrow === 'left' && styles.arrowLeft,\n padding && arrow === 'right' && styles.arrowRight,\n this.args.buttonProps?.css\n );\n }\n\n /** Arrow styles composed into the EuiButtonIcon's own class (`@css`). */\n @cached\n get arrowCss() {\n const styles = useEuiBorealisStyles(this.context, euiAccordionArrowStyles);\n const side = this.arrowDisplay === 'right' ? 'right' : 'left';\n return [\n styles.euiAccordion__arrow,\n styles[side],\n this.isOpen ? styles.isOpen : styles.isClosed,\n this.args.arrowProps?.css\n ];\n }\n\n get arrowClasses(): string {\n return ['euiAccordion__arrow', this.args.arrowProps?.className]\n .filter(Boolean)\n .join(' ');\n }\n\n get noTransition(): boolean {\n const initialIsOpen = Boolean(this.args.initialIsOpen);\n // Upstream: the first close of an initially open accordion turns\n // transitions on for good (untracked flag, read with `isOpen`).\n if (initialIsOpen && !this.isOpen) enableTransition(this.transition);\n return initialIsOpen && !this.transition.enabled && this.isOpen;\n }\n\n @cached\n get childWrapperClass(): string {\n const styles = useEuiBorealisStyles(\n this.context,\n euiAccordionChildWrapperStyles\n );\n return euiClass(\n this.context,\n styles.euiAccordion__childWrapper,\n this.isOpen ? styles.isOpen : styles.isClosed,\n this.noTransition && styles.noTransition\n );\n }\n\n @cached\n get childrenClass(): string {\n const styles = useEuiBorealisStyles(\n this.context,\n euiAccordionChildrenStyles\n );\n const padding = this.paddingSize;\n return euiClass(\n this.context,\n styles.euiAccordion__children,\n this.isLoading && styles.isLoading,\n padding !== 'none' && styles[padding]\n );\n }\n\n /** Upstream's `css` on the loading message's spinner. */\n @cached\n get spinnerCss(): EuiCss {\n return { marginInlineEnd: this.context.upstream.euiTheme.size.xs };\n }\n\n /** Upstream's inline `blockSize`: the measured content height when open. */\n get childWrapperStyle() {\n return htmlSafe(`block-size: ${this.isOpen ? this.contentHeight : 0}px`);\n }\n\n get buttonClasses(): string {\n return [\n 'euiAccordion__button',\n this.args.buttonClassName,\n this.args.buttonProps?.className,\n this.buttonClass\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n get buttonContentClasses(): string {\n return ['euiAccordion__buttonContent', this.args.buttonContentClassName]\n .filter(Boolean)\n .join(' ');\n }\n\n get childrenClasses(): string {\n return [\n 'euiAccordion__children',\n this.isLoading && 'euiAccordion__children-isLoading',\n this.args.childClassName,\n this.childrenClass\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n onResize = (height: number): void => {\n if (height !== this.contentHeight) this.contentHeight = height;\n };\n\n onToggle = (): void => {\n if (this.isDisabled) return;\n if (this.args.forceState) {\n this.args.onToggle?.(!this.isOpen);\n } else {\n this._opened = !this._opened;\n this.args.onToggle?.(this._opened);\n }\n };\n\n <template>\n {{#let\n (element this.tagName) (element this.buttonElement)\n as |Accordion ButtonElement|\n }}\n <Accordion\n class=\"euiAccordion {{if this.isOpen 'euiAccordion-isOpen'}} {{this.rootClass}}\"\n ...attributes\n >\n <div\n class=\"euiAccordion__triggerWrapper {{this.triggerWrapperClass}} {{@triggerClassName}}\"\n >\n {{#if (eq this.arrowDisplay \"left\")}}\n <EuiButtonIcon\n class={{this.arrowClasses}}\n @color=\"text\"\n @iconType=\"chevronSingleRight\"\n @isDisabled={{this.isDisabled}}\n @css={{this.arrowCss}}\n aria-controls={{this.regionId}}\n aria-expanded={{if this.isOpen \"true\" \"false\"}}\n aria-labelledby={{this.buttonId}}\n aria-hidden={{if this.buttonIsInteractive \"true\" \"false\"}}\n tabindex={{if this.buttonIsInteractive \"-1\" \"0\"}}\n {{on \"click\" this.onToggle}}\n />\n {{/if}}\n <ButtonElement\n type={{if this.buttonIsInteractive \"button\"}}\n disabled={{if this.buttonIsInteractive this.isDisabled}}\n id={{this.buttonId}}\n class={{this.buttonClasses}}\n aria-controls={{this.regionId}}\n aria-expanded={{if\n this.buttonIsInteractive\n (if this.isOpen \"true\" \"false\")\n }}\n data-test-subj={{@buttonProps.data-test-subj}}\n {{on \"click\" this.onToggle}}\n >\n <span class={{this.buttonContentClasses}}>\n {{#if (has-block \"buttonContent\")}}\n {{yield this.isOpen to=\"buttonContent\"}}\n {{else}}\n {{@buttonContent}}\n {{/if}}\n </span>\n </ButtonElement>\n {{#if this.isLoading}}\n <div\n class=\"euiAccordion__optionalAction {{this.optionalActionClass}}\"\n >\n <EuiLoadingSpinner />\n </div>\n {{else if (and @extraAction (has-block \"extraAction\"))}}\n <div\n class=\"euiAccordion__optionalAction {{this.optionalActionClass}}\"\n >\n {{yield this.isOpen to=\"extraAction\"}}\n </div>\n {{/if}}\n {{#if (eq this.arrowDisplay \"right\")}}\n <EuiButtonIcon\n class={{this.arrowClasses}}\n @color=\"text\"\n @iconType=\"chevronSingleRight\"\n @isDisabled={{this.isDisabled}}\n @css={{this.arrowCss}}\n aria-controls={{this.regionId}}\n aria-expanded={{if this.isOpen \"true\" \"false\"}}\n aria-labelledby={{this.buttonId}}\n aria-hidden={{if this.buttonIsInteractive \"true\" \"false\"}}\n tabindex={{if this.buttonIsInteractive \"-1\" \"0\"}}\n {{on \"click\" this.onToggle}}\n />\n {{/if}}\n </div>\n <div\n class=\"euiAccordion__childWrapper {{this.childWrapperClass}}\"\n style={{this.childWrapperStyle}}\n role={{this.role}}\n id={{this.regionId}}\n aria-labelledby={{this.buttonId}}\n inert={{not this.isOpen}}\n >\n <div\n class={{this.childrenClasses}}\n {{this.observeHeight this.onResize}}\n >\n {{#if this.showLoadingMessage}}\n <EuiLoadingSpinner\n class=\"euiAccordion__spinner\"\n @css={{this.spinnerCss}}\n />\n <EuiText @size=\"s\"><p>{{this.loadingMessage}}</p></EuiText>\n {{else}}\n {{yield to=\"content\"}}\n {{/if}}\n </div>\n </div>\n </Accordion>\n {{/let}}\n </template>\n}\n"],"names":["TRIGGER_WRAPPER","display","alignItems","label","OPTIONAL_ACTION","flexShrink","TRIGGER_RESET","boxSizing","margin","padding","border","background","color","font","heightCallbacks","WeakMap","heightObserver","observeHeight","modifier","element","onResize","ResizeObserver","offsetHeight","entries","entry","get","target","set","Math","round","observe","delete","unobserve","enableTransition","state","enabled","EuiAccordionComponent","Component","g","prototype","service","i","tracked","transition","generatedRegionId","guidFor","generatedButtonId","constructor","owner","args","_opened","forceState","Boolean","initialIsOpen","context","getEuiThemeContext","tagName","buttonElement","buttonIsInteractive","arrowDisplay","isOpen","isDisabled","isLoading","showLoadingMessage","isLoadingMessage","loadingMessage","message","euiI18n","lookupToken","regionId","id","buttonId","buttonProps","borders","paddingSize","role","rootClass","styles","useEuiBorealisStyles","euiAccordionStyles","euiClass","euiAccordion","css","n","cached","triggerWrapperClass","optionalActionClass","buttonClass","euiAccordionButtonStyles","arrow","euiAccordion__button","disabled","arrowLeft","arrowRight","arrowCss","euiAccordionArrowStyles","side","euiAccordion__arrow","isClosed","arrowProps","arrowClasses","className","filter","join","noTransition","childWrapperClass","euiAccordionChildWrapperStyles","euiAccordion__childWrapper","childrenClass","euiAccordionChildrenStyles","euiAccordion__children","spinnerCss","marginInlineEnd","upstream","euiTheme","size","xs","childWrapperStyle","htmlSafe","contentHeight","buttonClasses","buttonClassName","buttonContentClasses","buttonContentClassName","childrenClasses","childClassName","height","onToggle","setComponentTemplate","precompileTemplate","strictMode","scope","eq","EuiButtonIcon","on","EuiLoadingSpinner","and","not","EuiText"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,uEACA,MAAMA,eAAA,GAAkB;AACtBC,EAAAA,OAAA,EAAS,MAAA;AACTC,EAAAA,UAAA,EAAY,QAAA;AACZC,EAAAA,KAAA,EAAO;AACT,CAAA;AACA,MAAMC,eAAA,GAAkB;AAAEC,EAAAA,UAAA,EAAY,CAAA;AAAGF,EAAAA,KAAA,EAAO;AAAiB,CAAA;AAEjE;;;AAGC;AACD,MAAMG,aAAA,GAAgB;AACpBC,EAAAA,SAAA,EAAW,YAAA;AACXC,EAAAA,MAAA,EAAQ,CAAA;AACRC,EAAAA,OAAA,EAAS,CAAA;AACTC,EAAAA,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AI,CAAC,GAAA,CAAA;AACV,EAAA;EAEA,IAAIqB,eAAAA,GAA0B;AAC5B,IAAA,OAAO,CACL,wBAAA,EACA,IAAI,CAAC9D,SAAS,IAAI,kCAAA,EAClB,IAAI,CAACb,IAAI,CAAC4E,cAAc,EACxB,IAAI,CAACjB,aAAa,CACnB,CACEN,MAAM,CAAClD,OAAA,CAAA,CACPmD,IAAI,CAAC,GAAA,CAAA;AACV,EAAA;EAEAnF,QAAA,GAAY0G,MAAc,IAAO;IAC/B,IAAIA,MAAA,KAAW,IAAI,CAACP,aAAa,EAAE,IAAI,CAACA,aAAa,GAAGO,MAAA;EAC1D,CAAA;EAEAC,QAAA,GAAWA,MAAQ;IACjB,IAAI,IAAI,CAAClE,UAAU,EAAE;AACrB,IAAA,IAAI,IAAI,CAACZ,IAAI,CAACE,UAAU,EAAE;MACxB,IAAI,CAACF,IAAI,CAAC8E,QAAQ,GAAG,CAAC,IAAI,CAACnE,MAAM,CAAA;AACnC,IAAA,CAAA,MAAO;AACL,MAAA,IAAI,CAACV,OAAO,GAAG,CAAC,IAAI,CAACA,OAAO;MAC5B,IAAI,CAACD,IAAI,CAAC8E,QAAQ,GAAG,IAAI,CAAC7E,OAAO,CAAA;AACnC,IAAA;EACF,CAAA;AAEA,EAAA;IAAA8E,oBAAA,CAAAC,kBAAA,CAAA,83FAAA,EAsGA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;QAAAC,aAAA;QAAAC,EAAA;QAAAC,iBAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1,5 +1,5 @@
1
1
  import Component from '@glimmer/component';
2
- import EuiHighlight from '../eui-highlight.js';
2
+ import EuiHighlight, { highlightChunks } from '../eui-highlight.js';
3
3
  import EuiMark from '../eui-mark.js';
4
4
  import EuiTextTruncate from '../eui-text-truncate.js';
5
5
  import { precompileTemplate } from '@ember/template-compilation';
@@ -19,20 +19,28 @@ class EuiComboBoxOptionText extends Component {
19
19
  get isAuto() {
20
20
  return this.args.rowHeight === 'auto';
21
21
  }
22
- /** Upstream `searchPositionCenter`. */
22
+ /**
23
+ * Upstream `searchPositionCenter`: the middle of the match, found like
24
+ * EuiHighlight finds it (the match is not always the search's length
25
+ * when ignoring accents).
26
+ */
23
27
  get truncationPosition() {
24
28
  const {
25
29
  text,
26
- isCaseSensitive
30
+ isCaseSensitive,
31
+ ignoreAccents
27
32
  } = this.args;
28
33
  const search = this.search;
29
- const start = isCaseSensitive ? text.indexOf(search) : text.toLowerCase().indexOf(search.toLowerCase());
30
- return start + Math.floor(search.length / 2);
34
+ const chunks = highlightChunks(text, search, isCaseSensitive, false, ignoreAccents);
35
+ const index = chunks.findIndex(chunk => chunk.highlight);
36
+ if (index < 0) return -1 + Math.floor(search.length / 2);
37
+ const start = chunks.slice(0, index).reduce((length, chunk) => length + chunk.text.length, 0);
38
+ return start + Math.floor(chunks[index].text.length / 2);
31
39
  }
32
40
  /** Shorter truncated text than the search: mark all of it (upstream). */
33
41
  isShort = text => text.length < this.search.length;
34
42
  static {
35
- setComponentTemplate(precompileTemplate("{{#if this.isAuto}}\n {{#if this.search}}\n <EuiHighlight @text={{@text}} @search={{this.search}} @strict={{@isCaseSensitive}} />\n {{else}}\n {{@text}}\n {{/if}}\n{{else if this.search}}\n <EuiTextTruncate @text={{@text}} @width={{if @truncationProps.width @truncationProps.width @width}} @onResize={{@onResize}} @truncationOffset={{@truncationProps.truncationOffset}} @ellipsis={{@truncationProps.ellipsis}} @calculationDelayMs={{@truncationProps.calculationDelayMs}} @toolTipProps={{@truncationProps.toolTipProps}} @truncation=\"startEnd\" @truncationPosition={{this.truncationPosition}} as |text|>\n {{#if (this.isShort text)}}\n <EuiMark>{{text}}</EuiMark>\n {{else}}\n <EuiHighlight @text={{text}} @search={{this.search}} @strict={{@isCaseSensitive}} />\n {{/if}}\n </EuiTextTruncate>\n{{else if @truncationProps}}\n <EuiTextTruncate @text={{@text}} @width={{if @truncationProps.width @truncationProps.width @width}} @onResize={{@onResize}} @truncation={{@truncationProps.truncation}} @truncationOffset={{@truncationProps.truncationOffset}} @truncationPosition={{@truncationProps.truncationPosition}} @ellipsis={{@truncationProps.ellipsis}} @calculationDelayMs={{@truncationProps.calculationDelayMs}} @toolTipProps={{@truncationProps.toolTipProps}} />\n{{else}}\n {{@text}}\n{{/if}}", {
43
+ setComponentTemplate(precompileTemplate("{{#if this.isAuto}}\n {{#if this.search}}\n <EuiHighlight @text={{@text}} @search={{this.search}} @strict={{@isCaseSensitive}} @ignoreAccents={{@ignoreAccents}} />\n {{else}}\n {{@text}}\n {{/if}}\n{{else if this.search}}\n <EuiTextTruncate @text={{@text}} @width={{if @truncationProps.width @truncationProps.width @width}} @onResize={{@onResize}} @truncationOffset={{@truncationProps.truncationOffset}} @ellipsis={{@truncationProps.ellipsis}} @calculationDelayMs={{@truncationProps.calculationDelayMs}} @toolTipProps={{@truncationProps.toolTipProps}} @truncation=\"startEnd\" @truncationPosition={{this.truncationPosition}} as |text|>\n {{#if (this.isShort text)}}\n <EuiMark>{{text}}</EuiMark>\n {{else}}\n <EuiHighlight @text={{text}} @search={{this.search}} @strict={{@isCaseSensitive}} @ignoreAccents={{@ignoreAccents}} />\n {{/if}}\n </EuiTextTruncate>\n{{else if @truncationProps}}\n <EuiTextTruncate @text={{@text}} @width={{if @truncationProps.width @truncationProps.width @width}} @onResize={{@onResize}} @truncation={{@truncationProps.truncation}} @truncationOffset={{@truncationProps.truncationOffset}} @truncationPosition={{@truncationProps.truncationPosition}} @ellipsis={{@truncationProps.ellipsis}} @calculationDelayMs={{@truncationProps.calculationDelayMs}} @toolTipProps={{@truncationProps.toolTipProps}} />\n{{else}}\n {{@text}}\n{{/if}}", {
36
44
  strictMode: true,
37
45
  scope: () => ({
38
46
  EuiHighlight,
@@ -1 +1 @@
1
- {"version":3,"file":"option-text.js","sources":["../../../src/components/eui-combo-box/option-text.gts"],"sourcesContent":["import Component from '@glimmer/component';\n\nimport EuiHighlight from '../eui-highlight.gts';\nimport EuiMark from '../eui-mark.gts';\nimport EuiTextTruncate from '../eui-text-truncate.gts';\n\nimport type { EuiTextTruncateSignature } from '../eui-text-truncate';\n\n/** EuiTextTruncate arguments for options (upstream `truncationProps`). */\nexport type EuiComboBoxTruncationProps = Partial<\n Omit<EuiTextTruncateSignature['Args'], 'text'>\n>;\n\ninterface Signature {\n Args: {\n /** The option's label. */\n text: string;\n /** The search text (untrimmed). */\n search?: string;\n isCaseSensitive?: boolean;\n /** `'auto'` wraps the text instead of truncating it. */\n rowHeight?: number | 'auto';\n /** EuiComboBox's `@truncationProps` merged with the option's own. */\n truncationProps?: EuiComboBoxTruncationProps;\n /** Width shared by the rows, so only the first ones measure. */\n width?: number;\n onResize?: (width: number) => void;\n };\n}\n\n/**\n * @private The default option content of EuiComboBox's list, upstream\n * `renderTruncatedOption` / `renderVariableHeightOption`: CSS truncation\n * by default, EuiTextTruncate with `truncationProps`, and while searching\n * the match is highlighted and kept visible (`startEnd` truncation\n * around it).\n */\nexport default class EuiComboBoxOptionText extends Component<Signature> {\n get search(): string {\n return (this.args.search ?? '').trim();\n }\n\n get isAuto(): boolean {\n return this.args.rowHeight === 'auto';\n }\n\n /** Upstream `searchPositionCenter`. */\n get truncationPosition(): number {\n const { text, isCaseSensitive } = this.args;\n const search = this.search;\n const start = isCaseSensitive\n ? text.indexOf(search)\n : text.toLowerCase().indexOf(search.toLowerCase());\n\n return start + Math.floor(search.length / 2);\n }\n\n /** Shorter truncated text than the search: mark all of it (upstream). */\n isShort = (text: string) => text.length < this.search.length;\n\n <template>\n {{#if this.isAuto}}\n {{#if this.search}}\n <EuiHighlight\n @text={{@text}}\n @search={{this.search}}\n @strict={{@isCaseSensitive}}\n />\n {{else}}\n {{@text}}\n {{/if}}\n {{else if this.search}}\n <EuiTextTruncate\n @text={{@text}}\n @width={{if @truncationProps.width @truncationProps.width @width}}\n @onResize={{@onResize}}\n @truncationOffset={{@truncationProps.truncationOffset}}\n @ellipsis={{@truncationProps.ellipsis}}\n @calculationDelayMs={{@truncationProps.calculationDelayMs}}\n @toolTipProps={{@truncationProps.toolTipProps}}\n @truncation=\"startEnd\"\n @truncationPosition={{this.truncationPosition}}\n as |text|\n >\n {{#if (this.isShort text)}}\n <EuiMark>{{text}}</EuiMark>\n {{else}}\n <EuiHighlight\n @text={{text}}\n @search={{this.search}}\n @strict={{@isCaseSensitive}}\n />\n {{/if}}\n </EuiTextTruncate>\n {{else if @truncationProps}}\n <EuiTextTruncate\n @text={{@text}}\n @width={{if @truncationProps.width @truncationProps.width @width}}\n @onResize={{@onResize}}\n @truncation={{@truncationProps.truncation}}\n @truncationOffset={{@truncationProps.truncationOffset}}\n @truncationPosition={{@truncationProps.truncationPosition}}\n @ellipsis={{@truncationProps.ellipsis}}\n @calculationDelayMs={{@truncationProps.calculationDelayMs}}\n @toolTipProps={{@truncationProps.toolTipProps}}\n />\n {{else}}\n {{@text}}\n {{/if}}\n </template>\n}\n"],"names":["EuiComboBoxOptionText","Component","search","args","trim","isAuto","rowHeight","truncationPosition","text","isCaseSensitive","start","indexOf","toLowerCase","Math","floor","length","isShort","setComponentTemplate","precompileTemplate","strictMode","scope","EuiHighlight","EuiTextTruncate","EuiMark"],"mappings":";;;;;;;AA8BA;;;;;;;AAOe,MAAMA,qBAAA,SAA8BC,SAAA,CAAU;EAC3D,IAAIC,MAAAA,GAAiB;IACnB,OAAO,CAAC,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,EAAE,EAAEE,IAAI,EAAA;AACtC,EAAA;EAEA,IAAIC,MAAAA,GAAkB;AACpB,IAAA,OAAO,IAAI,CAACF,IAAI,CAACG,SAAS,KAAK,MAAA;AACjC,EAAA;AAEA;EACA,IAAIC,kBAAAA,GAA6B;IAC/B,MAAM;MAAEC,IAAI;AAAEC,MAAAA;KAAiB,GAAG,IAAI,CAACN,IAAI;AAC3C,IAAA,MAAMD,MAAA,GAAS,IAAI,CAACA,MAAM;IAC1B,MAAMQ,KAAA,GAAQD,eAAA,GACVD,IAAA,CAAKG,OAAO,CAACT,MAAA,CAAA,GACbM,IAAA,CAAKI,WAAW,EAAA,CAAGD,OAAO,CAACT,MAAA,CAAOU,WAAW,EAAA,CAAA;IAEjD,OAAOF,QAAQG,IAAA,CAAKC,KAAK,CAACZ,MAAA,CAAOa,MAAM,GAAG,CAAA,CAAA;AAC5C,EAAA;AAEA;EACAC,OAAA,GAAWR,IAAY,IAAKA,IAAA,CAAKO,MAAM,GAAG,IAAI,CAACb,MAAM,CAACa,MAAM;AAE5D,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,0yCAAA,EAiDA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,YAAA;QAAAC,eAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"option-text.js","sources":["../../../src/components/eui-combo-box/option-text.gts"],"sourcesContent":["import Component from '@glimmer/component';\n\nimport EuiHighlight, { highlightChunks } from '../eui-highlight.gts';\nimport EuiMark from '../eui-mark.gts';\nimport EuiTextTruncate from '../eui-text-truncate.gts';\n\nimport type { EuiTextTruncateSignature } from '../eui-text-truncate';\n\n/** EuiTextTruncate arguments for options (upstream `truncationProps`). */\nexport type EuiComboBoxTruncationProps = Partial<\n Omit<EuiTextTruncateSignature['Args'], 'text'>\n>;\n\ninterface Signature {\n Args: {\n /** The option's label. */\n text: string;\n /** The search text (untrimmed). */\n search?: string;\n isCaseSensitive?: boolean;\n /** EuiComboBox's `ignoreAccents`, to highlight what it matched. */\n ignoreAccents?: boolean;\n /** `'auto'` wraps the text instead of truncating it. */\n rowHeight?: number | 'auto';\n /** EuiComboBox's `@truncationProps` merged with the option's own. */\n truncationProps?: EuiComboBoxTruncationProps;\n /** Width shared by the rows, so only the first ones measure. */\n width?: number;\n onResize?: (width: number) => void;\n };\n}\n\n/**\n * @private The default option content of EuiComboBox's list, upstream\n * `renderTruncatedOption` / `renderVariableHeightOption`: CSS truncation\n * by default, EuiTextTruncate with `truncationProps`, and while searching\n * the match is highlighted and kept visible (`startEnd` truncation\n * around it).\n */\nexport default class EuiComboBoxOptionText extends Component<Signature> {\n get search(): string {\n return (this.args.search ?? '').trim();\n }\n\n get isAuto(): boolean {\n return this.args.rowHeight === 'auto';\n }\n\n /**\n * Upstream `searchPositionCenter`: the middle of the match, found like\n * EuiHighlight finds it (the match is not always the search's length\n * when ignoring accents).\n */\n get truncationPosition(): number {\n const { text, isCaseSensitive, ignoreAccents } = this.args;\n const search = this.search;\n const chunks = highlightChunks(text, search, isCaseSensitive, false, ignoreAccents);\n const index = chunks.findIndex((chunk) => chunk.highlight);\n\n if (index < 0) return -1 + Math.floor(search.length / 2);\n\n const start = chunks.slice(0, index).reduce((length, chunk) => length + chunk.text.length, 0);\n\n return start + Math.floor(chunks[index]!.text.length / 2);\n }\n\n /** Shorter truncated text than the search: mark all of it (upstream). */\n isShort = (text: string) => text.length < this.search.length;\n\n <template>\n {{#if this.isAuto}}\n {{#if this.search}}\n <EuiHighlight\n @text={{@text}}\n @search={{this.search}}\n @strict={{@isCaseSensitive}}\n @ignoreAccents={{@ignoreAccents}}\n />\n {{else}}\n {{@text}}\n {{/if}}\n {{else if this.search}}\n <EuiTextTruncate\n @text={{@text}}\n @width={{if @truncationProps.width @truncationProps.width @width}}\n @onResize={{@onResize}}\n @truncationOffset={{@truncationProps.truncationOffset}}\n @ellipsis={{@truncationProps.ellipsis}}\n @calculationDelayMs={{@truncationProps.calculationDelayMs}}\n @toolTipProps={{@truncationProps.toolTipProps}}\n @truncation=\"startEnd\"\n @truncationPosition={{this.truncationPosition}}\n as |text|\n >\n {{#if (this.isShort text)}}\n <EuiMark>{{text}}</EuiMark>\n {{else}}\n <EuiHighlight\n @text={{text}}\n @search={{this.search}}\n @strict={{@isCaseSensitive}}\n @ignoreAccents={{@ignoreAccents}}\n />\n {{/if}}\n </EuiTextTruncate>\n {{else if @truncationProps}}\n <EuiTextTruncate\n @text={{@text}}\n @width={{if @truncationProps.width @truncationProps.width @width}}\n @onResize={{@onResize}}\n @truncation={{@truncationProps.truncation}}\n @truncationOffset={{@truncationProps.truncationOffset}}\n @truncationPosition={{@truncationProps.truncationPosition}}\n @ellipsis={{@truncationProps.ellipsis}}\n @calculationDelayMs={{@truncationProps.calculationDelayMs}}\n @toolTipProps={{@truncationProps.toolTipProps}}\n />\n {{else}}\n {{@text}}\n {{/if}}\n </template>\n}\n"],"names":["EuiComboBoxOptionText","Component","search","args","trim","isAuto","rowHeight","truncationPosition","text","isCaseSensitive","ignoreAccents","chunks","highlightChunks","index","findIndex","chunk","highlight","Math","floor","length","start","slice","reduce","isShort","setComponentTemplate","precompileTemplate","strictMode","scope","EuiHighlight","EuiTextTruncate","EuiMark"],"mappings":";;;;;;;AAgCA;;;;;;;AAOe,MAAMA,qBAAA,SAA8BC,SAAA,CAAU;EAC3D,IAAIC,MAAAA,GAAiB;IACnB,OAAO,CAAC,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,EAAE,EAAEE,IAAI,EAAA;AACtC,EAAA;EAEA,IAAIC,MAAAA,GAAkB;AACpB,IAAA,OAAO,IAAI,CAACF,IAAI,CAACG,SAAS,KAAK,MAAA;AACjC,EAAA;AAEA;;;;;EAKA,IAAIC,kBAAAA,GAA6B;IAC/B,MAAM;MAAEC,IAAI;MAAEC,eAAe;AAAEC,MAAAA;KAAe,GAAG,IAAI,CAACP,IAAI;AAC1D,IAAA,MAAMD,MAAA,GAAS,IAAI,CAACA,MAAM;AAC1B,IAAA,MAAMS,MAAA,GAASC,eAAA,CAAgBJ,IAAA,EAAMN,MAAA,EAAQO,iBAAiB,KAAA,EAAOC,aAAA,CAAA;IACrE,MAAMG,QAAQF,MAAA,CAAOG,SAAS,CAAEC,KAAA,IAAUA,MAAMC,SAAS,CAAA;AAEzD,IAAA,IAAIH,KAAA,GAAQ,CAAA,EAAG,OAAO,EAAC,GAAII,KAAKC,KAAK,CAAChB,MAAA,CAAOiB,MAAM,GAAG,CAAA,CAAA;IAEtD,MAAMC,QAAQT,MAAA,CAAOU,KAAK,CAAC,CAAA,EAAGR,OAAOS,MAAM,CAAC,CAACH,MAAA,EAAQJ,UAAUI,MAAA,GAASJ,KAAA,CAAMP,IAAI,CAACW,MAAM,EAAE,CAAA,CAAA;AAE3F,IAAA,OAAOC,KAAA,GAAQH,IAAA,CAAKC,KAAK,CAACP,MAAM,CAACE,KAAA,CAAM,CAAEL,IAAI,CAACW,MAAM,GAAG,CAAA,CAAA;AACzD,EAAA;AAEA;EACAI,OAAA,GAAWf,IAAY,IAAKA,IAAA,CAAKW,MAAM,GAAG,IAAI,CAACjB,MAAM,CAACiB,MAAM;AAE5D,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAAA,82CAAA,EAmDA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,YAAA;QAAAC,eAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -46,6 +46,10 @@ class EuiComboBoxTriggerInputComponent extends PowerSelectInput {
46
46
  * input sizes to its content (`field-sizing`) and fills the rest of the
47
47
  * row, so it wraps below the pills like upstream's. With a placeholder or
48
48
  * plain text selection it takes the whole row.
49
+ *
50
+ * Not upstream: under a plain text selection rendered with EuiComboBox's
51
+ * block (`@hidesValue`), the text is transparent but the caret is not.
52
+ * The value stays the label (screen readers, typing over it).
49
53
  */
50
54
  get inputClass() {
51
55
  const context = getEuiThemeContext(this);
@@ -59,6 +63,13 @@ class EuiComboBoxTriggerInputComponent extends PowerSelectInput {
59
63
  fieldSizing: 'content',
60
64
  // @ts-expect-error `fillWidth` is passed by EuiComboBoxTrigger
61
65
  inlineSize: this.args.fillWidth ? '100%' : undefined
66
+ },
67
+ // @ts-expect-error `hidesValue` is passed by EuiComboBoxTrigger
68
+ this.args.hidesValue && {
69
+ '&, &:disabled': {
70
+ color: 'transparent',
71
+ caretColor: context.upstream.euiTheme.colors.textParagraph
72
+ }
62
73
  });
63
74
  }
64
75
  /** An option is highlighted in the open list (`aria-activedescendant`). */
@@ -119,16 +130,26 @@ class EuiComboBoxTriggerInputComponent extends PowerSelectInput {
119
130
  const onClick = this.args.onPlainTextClick;
120
131
  // @ts-expect-error `asPlainText` is passed by EuiComboBoxTrigger
121
132
  if (this.args.asPlainText) onClick?.(event);
133
+ this.selectHiddenValue(event);
122
134
  }
123
- /** The id of the options list while it is open (upstream `aria-controls`). */
135
+ /**
136
+ * Not upstream: under a selection's block the value's text is hidden, so
137
+ * typing replaces it (as a new search) instead of adding to it.
138
+ */
124
139
  static {
125
140
  n(this.prototype, "handleClick", [action]);
126
141
  }
142
+ selectHiddenValue = event => {
143
+ // @ts-expect-error `hidesValue` is passed by EuiComboBoxTrigger
144
+ if (!this.args.hidesValue) return;
145
+ event.target?.select?.();
146
+ };
147
+ /** The id of the options list while it is open (upstream `aria-controls`). */
127
148
  get ariaControls() {
128
149
  return this.args.select.isOpen ? this.args.listboxId : undefined;
129
150
  }
130
151
  static {
131
- setComponentTemplate(precompileTemplate("<div class={{this.containerClass}}>\n <input tabindex=\"-1\" aria-hidden=\"true\" style=\"opacity: 0; width:0px; height:0px; position: absolute; top: 40%; border:solid 1px transparent !important; margin:0px !important; padding: 0; pointer-events: none;\" class=\"fake-input-for-html-form-validity\" {{!--@glint-expect-error--}} {{validatableControl @isInvalid}} />\n <input class=\"ember-power-select-trigger-multiple-input euiComboBox__input\n {{this.inputClass}}\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" {{!--@glint-expect-error--}} autofocus={{@autoFocus}} spellcheck={{false}} id=\"ember-power-select-trigger-multiple-input-{{@select.uniqueId}}\" data-test-subj=\"comboBoxSearchInput\" value={{this.value}} role={{if @role @role \"combobox\"}} aria-autocomplete=\"list\" aria-haspopup=\"listbox\" aria-expanded={{if @select.isOpen \"true\" \"false\"}} aria-controls={{this.ariaControls}} {{!-- @glint-expect-error `required` is passed by EuiComboBoxTrigger --}} aria-required={{if @required \"true\"}} aria-activedescendant={{if this.hasActiveOption @ariaActiveDescendant}} aria-label={{@ariaLabel}} aria-labelledby={{@ariaLabelledBy}} aria-describedby={{@ariaDescribedBy}} {{!-- @glint-expect-error `isInvalid` is passed by EuiComboBoxTrigger --}} aria-invalid={{if @isInvalid \"true\"}} placeholder={{this.maybePlaceholder}} disabled={{@select.disabled}} tabindex={{@tabindex}} form=\"power-select-fake-form\" {{on \"focus\" this.handleFocus}} {{on \"blur\" this.handleBlur}} {{on \"input\" this.handleInput}} {{on \"keydown\" this.handleKeydown}} {{on \"click\" this.handleClick}} {{this.registerInput}} />\n</div>", {
152
+ setComponentTemplate(precompileTemplate("<div class={{this.containerClass}}>\n <input tabindex=\"-1\" aria-hidden=\"true\" style=\"opacity: 0; width:0px; height:0px; position: absolute; top: 40%; border:solid 1px transparent !important; margin:0px !important; padding: 0; pointer-events: none;\" class=\"fake-input-for-html-form-validity\" {{!--@glint-expect-error--}} {{validatableControl @isInvalid}} />\n <input class=\"ember-power-select-trigger-multiple-input euiComboBox__input\n {{this.inputClass}}\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" {{!--@glint-expect-error--}} autofocus={{@autoFocus}} spellcheck={{false}} id=\"ember-power-select-trigger-multiple-input-{{@select.uniqueId}}\" data-test-subj=\"comboBoxSearchInput\" value={{this.value}} role={{if @role @role \"combobox\"}} aria-autocomplete=\"list\" aria-haspopup=\"listbox\" aria-expanded={{if @select.isOpen \"true\" \"false\"}} aria-controls={{this.ariaControls}} {{!-- @glint-expect-error `required` is passed by EuiComboBoxTrigger --}} aria-required={{if @required \"true\"}} aria-activedescendant={{if this.hasActiveOption @ariaActiveDescendant}} aria-label={{@ariaLabel}} aria-labelledby={{@ariaLabelledBy}} aria-describedby={{@ariaDescribedBy}} {{!-- @glint-expect-error `isInvalid` is passed by EuiComboBoxTrigger --}} aria-invalid={{if @isInvalid \"true\"}} placeholder={{this.maybePlaceholder}} disabled={{@select.disabled}} tabindex={{@tabindex}} form=\"power-select-fake-form\" {{on \"focus\" this.handleFocus}} {{on \"focus\" this.selectHiddenValue}} {{on \"blur\" this.handleBlur}} {{on \"input\" this.handleInput}} {{on \"keydown\" this.handleKeydown}} {{on \"click\" this.handleClick}} {{this.registerInput}} />\n</div>", {
132
153
  strictMode: true,
133
154
  scope: () => ({
134
155
  validatableControl,
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sources":["../../../../src/components/eui-combo-box/trigger/input.gts"],"sourcesContent":["import { cached } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\nimport { modifier } from 'ember-modifier';\nimport PowerSelectInput from 'ember-power-select/components/power-select/input';\n\nimport validatableControl from '../../../modifiers/validatable-control.ts';\nimport { getEuiThemeContext } from '../../../utils/emotion/consume.ts';\nimport { euiComboBoxInputStyles } from '../../../utils/eui/styles.generated.ts';\nimport { euiClass, useEuiBorealisStyles } from '../../../utils/eui/styles.ts';\n\n/** Holds the search input and the hidden validity input. */\nconst INPUT_CONTAINER = {\n position: 'relative',\n display: 'flex',\n flexGrow: 1,\n minInlineSize: '2px',\n maxInlineSize: '100%'\n} as const;\n\n/** @private The search input inside EuiComboBox's trigger. */\nexport default class EuiComboBoxTriggerInputComponent extends PowerSelectInput {\n /** Upstream `inputRef`: the search input, or `null` when it goes away. */\n registerInput = modifier((element: HTMLInputElement) => {\n // @ts-expect-error `inputRef` is passed by EuiComboBoxTrigger\n const inputRef = this.args.inputRef as\n | ((element: HTMLInputElement | null) => void)\n | undefined;\n\n inputRef?.(element);\n\n return () => inputRef?.(null);\n });\n\n /**\n * Shows @placeholder while nothing is selected (power-select 9's own\n * `placeholder` getter uses @searchPlaceholder instead).\n */\n get maybePlaceholder(): string | undefined {\n if (!this.args.isDefaultPlaceholder) {\n return undefined;\n }\n\n const selected = this.args.select.selected as unknown[] | undefined;\n\n // upstream: no placeholder while searching\n if (this.args.select.searchText) return '';\n\n // @ts-expect-error `placeholder` is passed by EuiComboBoxTrigger\n return !selected || selected.length === 0 ? this.args.placeholder || '' : '';\n }\n\n /**\n * Upstream `euiComboBoxInput`: transparent, borderless, the form control\n * text. Upstream measures the typed text for the input's width; here the\n * input sizes to its content (`field-sizing`) and fills the rest of the\n * row, so it wraps below the pills like upstream's. With a placeholder or\n * plain text selection it takes the whole row.\n */\n @cached\n get inputClass(): string {\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiComboBoxInputStyles);\n\n return euiClass(\n context,\n { boxSizing: 'border-box', margin: 0, padding: 0 },\n styles.euiComboBoxInput,\n {\n flexGrow: 1,\n fieldSizing: 'content',\n // @ts-expect-error `fillWidth` is passed by EuiComboBoxTrigger\n inlineSize: this.args.fillWidth ? '100%' : undefined\n }\n );\n }\n\n /** An option is highlighted in the open list (`aria-activedescendant`). */\n get hasActiveOption(): boolean {\n const select = this.args.select;\n\n return Boolean(select.isOpen && select.highlighted != null);\n }\n\n @cached\n get containerClass(): string {\n const context = getEuiThemeContext(this);\n\n return euiClass(context, INPUT_CONTAINER);\n }\n\n /**\n * Keys go to EuiComboBox first (through ember-power-select's keydown\n * handler): it handles Enter, Escape, Tab, the arrows and Backspace\n * like upstream.\n */\n @action\n handleKeydown(e: KeyboardEvent): false | void {\n if (e.target === null) return;\n\n if (this.args.onKeydown && this.args.onKeydown(e) === false) {\n e.stopPropagation();\n\n return false;\n }\n\n if (\n e.key === 'Backspace' ||\n (e.key?.length === 1 && /[a-z0-9 ]/i.test(e.key))\n ) {\n // Backspace, keys 0-9, a-z or SPACE edit the text\n e.stopPropagation();\n }\n }\n\n /** Upstream keeps the typed text on blur (EuiComboBox decides). */\n @action\n handleBlur(event: FocusEvent): void {\n this.args.onBlur?.(event);\n }\n\n /**\n * Upstream `searchValue`: plain text single selection shows the search\n * text, else the selected option's label, as the input's value.\n */\n get value(): string {\n const search = this.args.select.searchText;\n // @ts-expect-error `plainTextValue` is passed by EuiComboBoxTrigger\n const plainText = this.args.plainTextValue as string | undefined;\n\n if (plainText === undefined) return search;\n\n return search || plainText;\n }\n\n /** Upstream re-opens the list on every click of a plain text input. */\n @action\n handleClick(event: MouseEvent): void {\n // @ts-expect-error `onPlainTextClick` is passed by EuiComboBoxTrigger\n const onClick = this.args.onPlainTextClick as\n | ((event: MouseEvent) => void)\n | undefined;\n\n // @ts-expect-error `asPlainText` is passed by EuiComboBoxTrigger\n if (this.args.asPlainText) onClick?.(event);\n }\n\n /** The id of the options list while it is open (upstream `aria-controls`). */\n get ariaControls(): string | undefined {\n return this.args.select.isOpen ? this.args.listboxId : undefined;\n }\n\n <template>\n <div class={{this.containerClass}}>\n <input\n tabindex=\"-1\"\n aria-hidden=\"true\"\n style=\"opacity: 0; width:0px; height:0px; position: absolute; top: 40%; border:solid 1px transparent !important; margin:0px !important; padding: 0; pointer-events: none;\"\n class=\"fake-input-for-html-form-validity\"\n {{!@glint-expect-error}}\n {{validatableControl @isInvalid}}\n />\n <input\n class=\"ember-power-select-trigger-multiple-input euiComboBox__input\n {{this.inputClass}}\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n {{!@glint-expect-error}}\n autofocus={{@autoFocus}}\n spellcheck={{false}}\n id=\"ember-power-select-trigger-multiple-input-{{@select.uniqueId}}\"\n data-test-subj=\"comboBoxSearchInput\"\n value={{this.value}}\n role={{if @role @role \"combobox\"}}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded={{if @select.isOpen \"true\" \"false\"}}\n aria-controls={{this.ariaControls}}\n {{! @glint-expect-error `required` is passed by EuiComboBoxTrigger }}\n aria-required={{if @required \"true\"}}\n aria-activedescendant={{if this.hasActiveOption @ariaActiveDescendant}}\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledBy}}\n aria-describedby={{@ariaDescribedBy}}\n {{! @glint-expect-error `isInvalid` is passed by EuiComboBoxTrigger }}\n aria-invalid={{if @isInvalid \"true\"}}\n placeholder={{this.maybePlaceholder}}\n disabled={{@select.disabled}}\n tabindex={{@tabindex}}\n form=\"power-select-fake-form\"\n {{on \"focus\" this.handleFocus}}\n {{on \"blur\" this.handleBlur}}\n {{on \"input\" this.handleInput}}\n {{on \"keydown\" this.handleKeydown}}\n {{on \"click\" this.handleClick}}\n {{this.registerInput}}\n />\n </div>\n </template>\n}\n"],"names":["INPUT_CONTAINER","position","display","flexGrow","minInlineSize","maxInlineSize","EuiComboBoxTriggerInputComponent","PowerSelectInput","registerInput","modifier","element","inputRef","args","maybePlaceholder","isDefaultPlaceholder","undefined","selected","select","searchText","length","placeholder","inputClass","context","getEuiThemeContext","styles","useEuiBorealisStyles","euiComboBoxInputStyles","euiClass","boxSizing","margin","padding","euiComboBoxInput","fieldSizing","inlineSize","fillWidth","n","prototype","cached","hasActiveOption","Boolean","isOpen","highlighted","containerClass","handleKeydown","e","target","onKeydown","stopPropagation","key","test","action","handleBlur","event","onBlur","value","search","plainText","plainTextValue","handleClick","onClick","onPlainTextClick","asPlainText","ariaControls","listboxId","setComponentTemplate","precompileTemplate","strictMode","scope","validatableControl","on"],"mappings":";;;;;;;;;;;;;AAaA,MAAMA,eAAA,GAAkB;AACtBC,EAAAA,QAAA,EAAU,UAAA;AACVC,EAAAA,OAAA,EAAS,MAAA;AACTC,EAAAA,QAAA,EAAU,CAAA;AACVC,EAAAA,aAAA,EAAe,KAAA;AACfC,EAAAA,aAAA,EAAe;AACjB,CAAA;AAEA;AACe,MAAMC,gCAAA,SAAyCC,gBAAA,CAAA;AAC5D,4EACAC,aAAA,GAAgBC,QAAA,CAAUC,OAAS,IAAA;AACjC;AACA,IAAA,MAAMC,QAAA,GAAW,IAAI,CAACC,IAAI,CAACD,QAEd;IAEbA,QAAA,GAAWD,OAAA,CAAA;AAEX,IAAA,OAAO,MAAMC,QAAA,GAAW,IAAA,CAAA;AAC1B,EAAA,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AI,CAAC5C,IAAI,CAAC6C,cAAoC;AAEhE,IAAA,IAAID,SAAA,KAAczC,WAAW,OAAOwC,MAAA;IAEpC,OAAOA,MAAA,IAAUC,SAAA;AACnB,EAAA;AAEA;EAEAE,WAAAA,CAAYN,KAAiB,EAAQ;AACnC;AACA,IAAA,MAAMO,OAAA,GAAU,IAAI,CAAC/C,IAAI,CAACgD,gBAEb;AAEb;IACA,IAAI,IAAI,CAAChD,IAAI,CAACiD,WAAW,EAAEF,OAAA,GAAUP,KAAA,CAAA;AACvC,EAAA;AAEA;AAAA,EAAA;IAAAjB,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,aAAA,EAAA,CAXCc,MAAA,CAAA,CAAA;AAAA;EAYD,IAAIY,YAAAA,GAAmC;AACrC,IAAA,OAAO,IAAI,CAAClD,IAAI,CAACK,MAAM,CAACuB,MAAM,GAAG,IAAI,CAAC5B,IAAI,CAACmD,SAAS,GAAGhD,SAAA;AACzD,EAAA;AAEA,EAAA;IAAAiD,oBAAA,CAAAC,kBAAA,CAAA,unDAAA,EA+CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,kBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"input.js","sources":["../../../../src/components/eui-combo-box/trigger/input.gts"],"sourcesContent":["import { cached } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\nimport { modifier } from 'ember-modifier';\nimport PowerSelectInput from 'ember-power-select/components/power-select/input';\n\nimport validatableControl from '../../../modifiers/validatable-control.ts';\nimport { getEuiThemeContext } from '../../../utils/emotion/consume.ts';\nimport { euiComboBoxInputStyles } from '../../../utils/eui/styles.generated.ts';\nimport { euiClass, useEuiBorealisStyles } from '../../../utils/eui/styles.ts';\n\n/** Holds the search input and the hidden validity input. */\nconst INPUT_CONTAINER = {\n position: 'relative',\n display: 'flex',\n flexGrow: 1,\n minInlineSize: '2px',\n maxInlineSize: '100%'\n} as const;\n\n/** @private The search input inside EuiComboBox's trigger. */\nexport default class EuiComboBoxTriggerInputComponent extends PowerSelectInput {\n /** Upstream `inputRef`: the search input, or `null` when it goes away. */\n registerInput = modifier((element: HTMLInputElement) => {\n // @ts-expect-error `inputRef` is passed by EuiComboBoxTrigger\n const inputRef = this.args.inputRef as\n | ((element: HTMLInputElement | null) => void)\n | undefined;\n\n inputRef?.(element);\n\n return () => inputRef?.(null);\n });\n\n /**\n * Shows @placeholder while nothing is selected (power-select 9's own\n * `placeholder` getter uses @searchPlaceholder instead).\n */\n get maybePlaceholder(): string | undefined {\n if (!this.args.isDefaultPlaceholder) {\n return undefined;\n }\n\n const selected = this.args.select.selected as unknown[] | undefined;\n\n // upstream: no placeholder while searching\n if (this.args.select.searchText) return '';\n\n // @ts-expect-error `placeholder` is passed by EuiComboBoxTrigger\n return !selected || selected.length === 0 ? this.args.placeholder || '' : '';\n }\n\n /**\n * Upstream `euiComboBoxInput`: transparent, borderless, the form control\n * text. Upstream measures the typed text for the input's width; here the\n * input sizes to its content (`field-sizing`) and fills the rest of the\n * row, so it wraps below the pills like upstream's. With a placeholder or\n * plain text selection it takes the whole row.\n *\n * Not upstream: under a plain text selection rendered with EuiComboBox's\n * block (`@hidesValue`), the text is transparent but the caret is not.\n * The value stays the label (screen readers, typing over it).\n */\n @cached\n get inputClass(): string {\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiComboBoxInputStyles);\n\n return euiClass(\n context,\n { boxSizing: 'border-box', margin: 0, padding: 0 },\n styles.euiComboBoxInput,\n {\n flexGrow: 1,\n fieldSizing: 'content',\n // @ts-expect-error `fillWidth` is passed by EuiComboBoxTrigger\n inlineSize: this.args.fillWidth ? '100%' : undefined\n },\n // @ts-expect-error `hidesValue` is passed by EuiComboBoxTrigger\n this.args.hidesValue && {\n '&, &:disabled': {\n color: 'transparent',\n caretColor: context.upstream.euiTheme.colors.textParagraph\n }\n }\n );\n }\n\n /** An option is highlighted in the open list (`aria-activedescendant`). */\n get hasActiveOption(): boolean {\n const select = this.args.select;\n\n return Boolean(select.isOpen && select.highlighted != null);\n }\n\n @cached\n get containerClass(): string {\n const context = getEuiThemeContext(this);\n\n return euiClass(context, INPUT_CONTAINER);\n }\n\n /**\n * Keys go to EuiComboBox first (through ember-power-select's keydown\n * handler): it handles Enter, Escape, Tab, the arrows and Backspace\n * like upstream.\n */\n @action\n handleKeydown(e: KeyboardEvent): false | void {\n if (e.target === null) return;\n\n if (this.args.onKeydown && this.args.onKeydown(e) === false) {\n e.stopPropagation();\n\n return false;\n }\n\n if (\n e.key === 'Backspace' ||\n (e.key?.length === 1 && /[a-z0-9 ]/i.test(e.key))\n ) {\n // Backspace, keys 0-9, a-z or SPACE edit the text\n e.stopPropagation();\n }\n }\n\n /** Upstream keeps the typed text on blur (EuiComboBox decides). */\n @action\n handleBlur(event: FocusEvent): void {\n this.args.onBlur?.(event);\n }\n\n /**\n * Upstream `searchValue`: plain text single selection shows the search\n * text, else the selected option's label, as the input's value.\n */\n get value(): string {\n const search = this.args.select.searchText;\n // @ts-expect-error `plainTextValue` is passed by EuiComboBoxTrigger\n const plainText = this.args.plainTextValue as string | undefined;\n\n if (plainText === undefined) return search;\n\n return search || plainText;\n }\n\n /** Upstream re-opens the list on every click of a plain text input. */\n @action\n handleClick(event: MouseEvent): void {\n // @ts-expect-error `onPlainTextClick` is passed by EuiComboBoxTrigger\n const onClick = this.args.onPlainTextClick as\n | ((event: MouseEvent) => void)\n | undefined;\n\n // @ts-expect-error `asPlainText` is passed by EuiComboBoxTrigger\n if (this.args.asPlainText) onClick?.(event);\n\n this.selectHiddenValue(event);\n }\n\n /**\n * Not upstream: under a selection's block the value's text is hidden, so\n * typing replaces it (as a new search) instead of adding to it.\n */\n selectHiddenValue = (event: Event): void => {\n // @ts-expect-error `hidesValue` is passed by EuiComboBoxTrigger\n if (!this.args.hidesValue) return;\n\n (event.target as HTMLInputElement | null)?.select?.();\n };\n\n /** The id of the options list while it is open (upstream `aria-controls`). */\n get ariaControls(): string | undefined {\n return this.args.select.isOpen ? this.args.listboxId : undefined;\n }\n\n <template>\n <div class={{this.containerClass}}>\n <input\n tabindex=\"-1\"\n aria-hidden=\"true\"\n style=\"opacity: 0; width:0px; height:0px; position: absolute; top: 40%; border:solid 1px transparent !important; margin:0px !important; padding: 0; pointer-events: none;\"\n class=\"fake-input-for-html-form-validity\"\n {{!@glint-expect-error}}\n {{validatableControl @isInvalid}}\n />\n <input\n class=\"ember-power-select-trigger-multiple-input euiComboBox__input\n {{this.inputClass}}\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n {{!@glint-expect-error}}\n autofocus={{@autoFocus}}\n spellcheck={{false}}\n id=\"ember-power-select-trigger-multiple-input-{{@select.uniqueId}}\"\n data-test-subj=\"comboBoxSearchInput\"\n value={{this.value}}\n role={{if @role @role \"combobox\"}}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded={{if @select.isOpen \"true\" \"false\"}}\n aria-controls={{this.ariaControls}}\n {{! @glint-expect-error `required` is passed by EuiComboBoxTrigger }}\n aria-required={{if @required \"true\"}}\n aria-activedescendant={{if this.hasActiveOption @ariaActiveDescendant}}\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledBy}}\n aria-describedby={{@ariaDescribedBy}}\n {{! @glint-expect-error `isInvalid` is passed by EuiComboBoxTrigger }}\n aria-invalid={{if @isInvalid \"true\"}}\n placeholder={{this.maybePlaceholder}}\n disabled={{@select.disabled}}\n tabindex={{@tabindex}}\n form=\"power-select-fake-form\"\n {{on \"focus\" this.handleFocus}}\n {{on \"focus\" this.selectHiddenValue}}\n {{on \"blur\" this.handleBlur}}\n {{on \"input\" this.handleInput}}\n {{on \"keydown\" this.handleKeydown}}\n {{on \"click\" this.handleClick}}\n {{this.registerInput}}\n />\n </div>\n </template>\n}\n"],"names":["INPUT_CONTAINER","position","display","flexGrow","minInlineSize","maxInlineSize","EuiComboBoxTriggerInputComponent","PowerSelectInput","registerInput","modifier","element","inputRef","args","maybePlaceholder","isDefaultPlaceholder","undefined","selected","select","searchText","length","placeholder","inputClass","context","getEuiThemeContext","styles","useEuiBorealisStyles","euiComboBoxInputStyles","euiClass","boxSizing","margin","padding","euiComboBoxInput","fieldSizing","inlineSize","fillWidth","hidesValue","color","caretColor","upstream","euiTheme","colors","textParagraph","n","prototype","cached","hasActiveOption","Boolean","isOpen","highlighted","containerClass","handleKeydown","e","target","onKeydown","stopPropagation","key","test","action","handleBlur","event","onBlur","value","search","plainText","plainTextValue","handleClick","onClick","onPlainTextClick","asPlainText","selectHiddenValue","ariaControls","listboxId","setComponentTemplate","precompileTemplate","strictMode","scope","validatableControl","on"],"mappings":";;;;;;;;;;;;;AAaA,MAAMA,eAAA,GAAkB;AACtBC,EAAAA,QAAA,EAAU,UAAA;AACVC,EAAAA,OAAA,EAAS,MAAA;AACTC,EAAAA,QAAA,EAAU,CAAA;AACVC,EAAAA,aAAA,EAAe,KAAA;AACfC,EAAAA,aAAA,EAAe;AACjB,CAAA;AAEA;AACe,MAAMC,gCAAA,SAAyCC,gBAAA,CAAA;AAC5D,4EACAC,aAAA,GAAgBC,QAAA,CAAUC,OAAS,IAAA;AACjC;AACA,IAAA,MAAMC,QAAA,GAAW,IAAI,CAACC,IAAI,CAACD,QAEd;IAEbA,QAAA,GAAWD,OAAA,CAAA;AAEX,IAAA,OAAO,MAAMC,QAAA,GAAW,IAAA,CAAA;AAC1B,EAAA,CAAA,CAAA;AAEA;;;AAGC;EACD,IAAIE,gBAAAA,GAAuC;AACzC,IAAA,IAAI,CAAC,IAAI,CAACD,IAAI,CAACE,oBAAoB,EAAE;AACnC,MAAA,OAAOC,SAAA;AACT,IAAA;IAEA,MAAMC,QAAA,GAAW,IAAI,CAACJ,IAAI,CAACK,MAAM,CAACD,QAAiC;AAEnE;IACA,IAAI,IAAI,CAACJ,IAAI,CAACK,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O+C,MAAA;IAEpC,OAAOA,MAAA,IAAUC,SAAA;AACnB,EAAA;AAEA;EAEAE,WAAAA,CAAYN,KAAiB,EAAQ;AACnC;AACA,IAAA,MAAMO,OAAA,GAAU,IAAI,CAACtD,IAAI,CAACuD,gBAEb;AAEb;IACA,IAAI,IAAI,CAACvD,IAAI,CAACwD,WAAW,EAAEF,OAAA,GAAUP,KAAA,CAAA;AAErC,IAAA,IAAI,CAACU,iBAAiB,CAACV,KAAA,CAAA;AACzB,EAAA;AAEA;;;AAGC;AAHD,EAAA;IAAAjB,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,aAAA,EAAA,CAbCc,MAAA,CAAA,CAAA;AAAA;EAiBDY,iBAAA,GAAqBV,KAAO,IAAY;AACtC;AACA,IAAA,IAAI,CAAC,IAAI,CAAC/C,IAAI,CAACuB,UAAU,EAAE;AAE1BwB,IAAAA,KAAA,CAAMP,MAAM,EAA8BnC,MAAA,IAAA;EAC7C,CAAA;AAEA;EACA,IAAIqD,YAAAA,GAAmC;AACrC,IAAA,OAAO,IAAI,CAAC1D,IAAI,CAACK,MAAM,CAAC8B,MAAM,GAAG,IAAI,CAACnC,IAAI,CAAC2D,SAAS,GAAGxD,SAAA;AACzD,EAAA;AAEA,EAAA;IAAAyD,oBAAA,CAAAC,kBAAA,CAAA,+pDAAA,EAgDA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,kBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -103,7 +103,35 @@ class EuiComboBoxTriggerComponent extends PowerSelectTrigger {
103
103
  if (option === undefined) return undefined;
104
104
  return comboBoxOptionLabel(option, this.comboArgs.searchField) ?? '';
105
105
  }
106
+ /**
107
+ * Not upstream: with a caller's block, the plain text selection is
108
+ * rendered with it (as ember-eui 14 did) while nothing is typed; the
109
+ * input's text is hidden under it.
110
+ */
111
+ get showsPlainTextBlock() {
112
+ return Boolean(this.comboArgs.hasOptionBlock && this.plainTextOption !== undefined && !this.comboArgs.select.searchText);
113
+ }
114
+ /**
115
+ * The block over the input wrap, inside its padding, centered like the
116
+ * input's text; clicks go through to the input.
117
+ */
118
+ get plainTextBlockClass() {
119
+ const context = getEuiThemeContext(this);
120
+ return euiClass(context, {
121
+ position: 'absolute',
122
+ inset: 0,
123
+ padding: 'inherit',
124
+ display: 'flex',
125
+ alignItems: 'center',
126
+ minWidth: 0,
127
+ overflow: 'hidden',
128
+ pointerEvents: 'none'
129
+ });
130
+ }
106
131
  /** Plain text selection's option prepend/append: upstream `xxs` spacing. */
132
+ static {
133
+ n(this.prototype, "plainTextBlockClass", [cached]);
134
+ }
107
135
  get plainTextSideClasses() {
108
136
  const context = getEuiThemeContext(this);
109
137
  const styles = comboBoxAppendPrependStyles(String(context.upstream.euiTheme.size.xxs));
@@ -174,7 +202,9 @@ class EuiComboBoxTriggerComponent extends PowerSelectTrigger {
174
202
  {
175
203
  margin: 0,
176
204
  listStyle: 'none'
177
- }, styles.euiComboBoxInputWrapper, !singleSelection && styles.multiSelect, compressed ? styles.compressed : styles.uncompressed, ...(plainText ? [styles.plainText.plainText, compressed ? styles.plainText.compressed : styles.plainText.uncompressed] : []), select.disabled ? styles.disabled : stateCss, Boolean(this.prepend || this.append) && styles.inGroup);
205
+ }, styles.euiComboBoxInputWrapper, !singleSelection && styles.multiSelect, compressed ? styles.compressed : styles.uncompressed, ...(plainText ? [styles.plainText.plainText, compressed ? styles.plainText.compressed : styles.plainText.uncompressed] : []), select.disabled ? styles.disabled : stateCss, Boolean(this.prepend || this.append) && styles.inGroup, this.showsPlainTextBlock && {
206
+ position: 'relative'
207
+ });
178
208
  }
179
209
  /**
180
210
  * Placeholder shown when searching is disabled: the form control
@@ -210,7 +240,7 @@ class EuiComboBoxTriggerComponent extends PowerSelectTrigger {
210
240
  n(this.prototype, "spacerClass", [cached]);
211
241
  }
212
242
  static {
213
- setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n<EuiFormControlLayout @icon={{this.icon}} @inputId={{this.inputId}} @isPrependProvided={{if this.prepend true false}} @isAppendProvided={{if this.append true false}} @iconSide=\"right\" {{on \"mousedown\" this.keepToggle capture=true}} {{on \"touchstart\" this.keepToggle capture=true}} {{on \"touchend\" this.keepToggle capture=true}} {{on \"focusout\" this.toggleBlur}} {{on \"keydown\" this.toggleKeydown}} @fullWidth={{@fullWidth}} @compressed={{@compressed}} @readOnly={{@readOnly}} @isInvalid={{@isInvalid}} @clear={{this.clearProps}} @isLoading={{@isLoading}} @disabled={{@select.disabled}} @css={{this.layoutCss}}>\n <:prepend>\n {{#if (isSingleText this.prepend)}}\n <EuiFormPrepend @label={{this.prepend}} @inputId={{this.inputId}} @compressed={{@compressed}} />\n {{else}}\n {{#each (nodeList this.prepend) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:prepend>\n <:field>\n {{!-- template-lint-disable --}}\n <div id=\"ember-power-select-multiple-options-{{@select.uniqueId}}\" class=\"euiComboBox__inputWrap ember-power-select-multiple-options\n {{if this.asPlainText \"euiComboBox__inputWrap--plainText\"}}\n {{this.wrapClass}}\" data-test-subj=\"comboBoxInput\" ...attributes {{!-- no ember-power-select openChange: upstream keeps the search\n text when the list closes (leftover text marks it invalid) --}} {{on \"touchstart\" this.chooseOption}} {{on \"mousedown\" this.chooseOption}}>\n {{!-- template-lint-enable --}}\n {{!-- upstream: no pill for plain text (the input shows it), and\n no single selection pill while searching --}}\n {{#if (and (not this.asPlainText) (or (and @singleSelection (not @select.searchText)) (not @singleSelection)))}}\n {{#each @select.selected as |opt idx|}}\n {{#if @selectedItemComponent}}\n {{#let (component @selectedItemComponent extra=@extra option=opt select=@select) as |SelectedItemComponent|}}\n <SelectedItemComponent />\n {{/let}}\n {{else}}\n <EuiComboBoxPill class=\"ember-power-select-multiple-option\n {{if opt.disabled \"ember-power-select-multiple-option--disabled\"}}\" @option={{opt}} @searchField={{@searchField}} @onClose={{if (or @select.disabled @singleSelection) false (if @onClose (fn (optional @onClose) opt) true)}} @dataSelectedIconIndex={{idx}} @color={{opt.color}} @asPlainText={{this.asPlainText}}>\n {{yield opt @select}}\n </EuiComboBoxPill>\n {{/if}}\n {{else}}{{#if (and @placeholder (not @searchEnabled))}}\n <span class=\"ember-power-select-placeholder {{this.placeholderClass}}\">\n {{@placeholder}}\n </span>\n {{/if}}{{/each}}\n {{/if}}\n {{#let (optionNode this.plainTextOption \"prepend\") (optionNode this.plainTextOption \"append\") as |plainPrepend plainAppend|}}\n {{#if plainPrepend}}\n <span class=\"euiComboBoxPlainTextSelection__prepend\n {{this.plainTextSideClasses.prepend}}\"><EuiComboBoxNode @node={{plainPrepend}} @option={{this.plainTextOption}} /></span>\n {{/if}}\n {{#if @searchEnabled}}\n {{#let (component EuiComboBoxTriggerInput select=@select ariaActiveDescendant=@ariaActiveDescendant ariaLabelledBy=(or @inputAriaLabelledBy @ariaLabelledBy) ariaDescribedBy=@ariaDescribedBy ariaLabel=(or @inputAriaLabel @ariaLabel) listboxId=@listboxId tabindex=@inputTabindex inputRef=@inputRef role=@inputRole required=@inputRequired buildSelection=@buildSelection placeholder=@placeholder placeholderComponent=@placeholderComponent searchField=@searchField onFocus=@onFocus isInvalid=@isInvalid fillWidth=(or this.asPlainText this.showPlaceholder) onBlur=@onBlur onKeydown=@onKeydown onInput=@onInput noSuggestions=@noSuggestions plainTextValue=this.plainTextValue asPlainText=this.asPlainText onPlainTextClick=@onPlainTextClick) as |InputComponent|}}\n {{#let (component @placeholderComponent select=@select placeholder=@placeholder isMultipleWithSearch=true inputComponent=InputComponent displayPlaceholder=(and (not @select.searchText) (not @select.selected))) as |PlaceholderComponent|}}\n <PlaceholderComponent />\n {{/let}}\n {{/let}}\n {{else}}\n {{#if this.asPlainText}}\n {{#each @select.selected as |opt|}}\n <EuiComboBoxPill @option={{opt}} @searchField={{@searchField}} @asPlainText={{true}}>{{yield opt @select}}</EuiComboBoxPill>\n {{/each}}\n {{/if}}\n <div class=\"euiComboBox__input {{this.spacerClass}}\"></div>\n {{/if}}\n {{#if plainAppend}}\n <span class=\"euiComboBoxPlainTextSelection__append\n {{this.plainTextSideClasses.append}}\"><EuiComboBoxNode @node={{plainAppend}} @option={{this.plainTextOption}} /></span>\n {{/if}}\n {{/let}}\n {{#if @screenReaderInstructions}}\n {{!-- upstream: read when the input gets focus --}}\n <EuiScreenReaderOnly>\n <span aria-live=\"polite\" id=\"{{@select.uniqueId}}_removeOptionMessage\">{{@screenReaderInstructions}}</span>\n </EuiScreenReaderOnly>\n {{/if}}\n </div>\n </:field>\n <:append>\n {{#if (isSingleText this.append)}}\n <EuiFormAppend @label={{this.append}} @inputId={{this.inputId}} @compressed={{@compressed}} />\n {{else}}\n {{#each (nodeList this.append) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:append>\n</EuiFormControlLayout>", {
243
+ setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n<EuiFormControlLayout @icon={{this.icon}} @inputId={{this.inputId}} @isPrependProvided={{if this.prepend true false}} @isAppendProvided={{if this.append true false}} @iconSide=\"right\" {{on \"mousedown\" this.keepToggle capture=true}} {{on \"touchstart\" this.keepToggle capture=true}} {{on \"touchend\" this.keepToggle capture=true}} {{on \"focusout\" this.toggleBlur}} {{on \"keydown\" this.toggleKeydown}} @fullWidth={{@fullWidth}} @compressed={{@compressed}} @readOnly={{@readOnly}} @isInvalid={{@isInvalid}} @clear={{this.clearProps}} @isLoading={{@isLoading}} @disabled={{@select.disabled}} @css={{this.layoutCss}}>\n <:prepend>\n {{#if (isSingleText this.prepend)}}\n <EuiFormPrepend @label={{this.prepend}} @inputId={{this.inputId}} @compressed={{@compressed}} />\n {{else}}\n {{#each (nodeList this.prepend) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:prepend>\n <:field>\n {{!-- template-lint-disable --}}\n <div id=\"ember-power-select-multiple-options-{{@select.uniqueId}}\" class=\"euiComboBox__inputWrap ember-power-select-multiple-options\n {{if this.asPlainText \"euiComboBox__inputWrap--plainText\"}}\n {{this.wrapClass}}\" data-test-subj=\"comboBoxInput\" ...attributes {{!-- no ember-power-select openChange: upstream keeps the search\n text when the list closes (leftover text marks it invalid) --}} {{on \"touchstart\" this.chooseOption}} {{on \"mousedown\" this.chooseOption}}>\n {{!-- template-lint-enable --}}\n {{!-- upstream: no pill for plain text (the input shows it), and\n no single selection pill while searching --}}\n {{#if (and (not this.asPlainText) (or (and @singleSelection (not @select.searchText)) (not @singleSelection)))}}\n {{#each @select.selected as |opt idx|}}\n {{#if @selectedItemComponent}}\n {{#let (component @selectedItemComponent extra=@extra option=opt select=@select) as |SelectedItemComponent|}}\n <SelectedItemComponent />\n {{/let}}\n {{else}}\n <EuiComboBoxPill class=\"ember-power-select-multiple-option\n {{if opt.disabled \"ember-power-select-multiple-option--disabled\"}}\" @option={{opt}} @searchField={{@searchField}} @onClose={{if (or @select.disabled @singleSelection) false (if @onClose (fn (optional @onClose) opt) true)}} @dataSelectedIconIndex={{idx}} @color={{opt.color}} @asPlainText={{this.asPlainText}}>\n {{yield opt @select}}\n </EuiComboBoxPill>\n {{/if}}\n {{else}}{{#if (and @placeholder (not @searchEnabled))}}\n <span class=\"ember-power-select-placeholder {{this.placeholderClass}}\">\n {{@placeholder}}\n </span>\n {{/if}}{{/each}}\n {{/if}}\n {{#let (optionNode this.plainTextOption \"prepend\") (optionNode this.plainTextOption \"append\") as |plainPrepend plainAppend|}}\n {{#if plainPrepend}}\n <span class=\"euiComboBoxPlainTextSelection__prepend\n {{this.plainTextSideClasses.prepend}}\"><EuiComboBoxNode @node={{plainPrepend}} @option={{this.plainTextOption}} /></span>\n {{/if}}\n {{#if @searchEnabled}}\n {{#if this.showsPlainTextBlock}}\n <span class=\"euiComboBoxPlainTextSelection__block\n {{this.plainTextBlockClass}}\" aria-hidden=\"true\">{{yield this.plainTextOption @select}}</span>\n {{/if}}\n {{#let (component EuiComboBoxTriggerInput select=@select ariaActiveDescendant=@ariaActiveDescendant ariaLabelledBy=(or @inputAriaLabelledBy @ariaLabelledBy) ariaDescribedBy=@ariaDescribedBy ariaLabel=(or @inputAriaLabel @ariaLabel) listboxId=@listboxId tabindex=@inputTabindex inputRef=@inputRef role=@inputRole required=@inputRequired buildSelection=@buildSelection placeholder=@placeholder placeholderComponent=@placeholderComponent searchField=@searchField onFocus=@onFocus isInvalid=@isInvalid fillWidth=(or this.asPlainText this.showPlaceholder) onBlur=@onBlur onKeydown=@onKeydown onInput=@onInput noSuggestions=@noSuggestions plainTextValue=this.plainTextValue asPlainText=this.asPlainText hidesValue=this.showsPlainTextBlock onPlainTextClick=@onPlainTextClick) as |InputComponent|}}\n {{#let (component @placeholderComponent select=@select placeholder=@placeholder isMultipleWithSearch=true inputComponent=InputComponent displayPlaceholder=(and (not @select.searchText) (not @select.selected))) as |PlaceholderComponent|}}\n <PlaceholderComponent />\n {{/let}}\n {{/let}}\n {{else}}\n {{#if this.asPlainText}}\n {{#each @select.selected as |opt|}}\n <EuiComboBoxPill @option={{opt}} @searchField={{@searchField}} @asPlainText={{true}}>{{yield opt @select}}</EuiComboBoxPill>\n {{/each}}\n {{/if}}\n <div class=\"euiComboBox__input {{this.spacerClass}}\"></div>\n {{/if}}\n {{#if plainAppend}}\n <span class=\"euiComboBoxPlainTextSelection__append\n {{this.plainTextSideClasses.append}}\"><EuiComboBoxNode @node={{plainAppend}} @option={{this.plainTextOption}} /></span>\n {{/if}}\n {{/let}}\n {{#if @screenReaderInstructions}}\n {{!-- upstream: read when the input gets focus --}}\n <EuiScreenReaderOnly>\n <span aria-live=\"polite\" id=\"{{@select.uniqueId}}_removeOptionMessage\">{{@screenReaderInstructions}}</span>\n </EuiScreenReaderOnly>\n {{/if}}\n </div>\n </:field>\n <:append>\n {{#if (isSingleText this.append)}}\n <EuiFormAppend @label={{this.append}} @inputId={{this.inputId}} @compressed={{@compressed}} />\n {{else}}\n {{#each (nodeList this.append) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:append>\n</EuiFormControlLayout>", {
214
244
  strictMode: true,
215
245
  scope: () => ({
216
246
  EuiFormControlLayout,
@@ -1 +1 @@
1
- {"version":3,"file":"trigger.js","sources":["../../../src/components/eui-combo-box/trigger.gts"],"sourcesContent":["import { cached } from '@glimmer/tracking';\nimport { fn } from '@ember/helper';\nimport { on } from '@ember/modifier';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport PowerSelectTrigger from 'ember-power-select/components/power-select/trigger';\nimport { and, not, or } from 'ember-truth-helpers';\n\nimport { getEuiThemeContext } from '../../utils/emotion/consume.ts';\nimport {\n euiComboBoxInputStyles,\n euiFontSize,\n euiFormVariables\n} from '../../utils/eui/styles.generated.ts';\nimport { euiClass, useEuiBorealisStyles } from '../../utils/eui/styles.ts';\nimport EuiComboBoxPill from '../eui-combo-box-pill.gts';\nimport EuiFormControlLayout from '../eui-form-control-layout.gts';\nimport EuiFormLabel from '../eui-form-label.gts';\nimport EuiFormAppend from '../eui-form-append.gts';\nimport EuiFormPrepend from '../eui-form-prepend.gts';\nimport EuiScreenReaderOnly from '../eui-screen-reader-only.gts';\nimport EuiComboBoxNode from './node.gts';\nimport EuiComboBoxTriggerInput from './trigger/input.gts';\nimport {\n comboBoxAppendPrependStyles,\n comboBoxOptionLabel,\n isTextNode\n} from '../../utils/eui/combo-box.ts';\n\nimport type {\n EuiFormControlLayoutClearProps,\n EuiFormControlLayoutIconShape\n} from '../eui-form-control-layout-icons.gts';\n\nimport type { CSSInterpolation } from '@emotion/css/create-instance';\n\ninterface TriggerSelect {\n uniqueId: string;\n isOpen: boolean;\n disabled: boolean;\n searchText: string;\n selected?: unknown[];\n}\n\ninterface TriggerArgs {\n select: TriggerSelect;\n compressed?: boolean;\n fullWidth?: boolean;\n isInvalid?: boolean;\n placeholder?: string;\n searchEnabled?: boolean;\n singleSelection?: boolean | { asPlainText?: boolean };\n prepend?: unknown;\n append?: unknown;\n noSuggestions?: boolean;\n screenReaderInstructions?: string;\n searchField?: string;\n /** Called with the search input once rendered, and `null` on removal. */\n inputRef?: (element: HTMLInputElement | null) => void;\n allowClear?: boolean;\n onClear?: (event?: Event) => void;\n onToggleList?: (event: MouseEvent) => void;\n /** Focus left the toggle button (upstream `onContainerBlur`). */\n onToggleBlur?: (event: FocusEvent) => void;\n /** A key on the focused toggle button; `true` stops it here. */\n onToggleKeydown?: (event: KeyboardEvent) => boolean;\n}\n\n/** The chevron (`comboBoxToggleListButton`) or an element in it. */\nexport const isToggleButton = (target: EventTarget | null): boolean =>\n Boolean(\n (target as Element | null)?.closest?.(\n '[data-test-subj=\"comboBoxToggleListButton\"]'\n )\n );\n\n/** Upstream side nodes: one string is an EuiFormPrepend/Append label. */\nconst isSingleText = (node: unknown) => !Array.isArray(node) && isTextNode(node);\n\nconst nodeList = (node: unknown): unknown[] =>\n Array.isArray(node) ? node : [node];\n\nconst optionNode = (option: unknown, key: 'prepend' | 'append') =>\n option && typeof option === 'object'\n ? (option as Record<string, unknown>)[key]\n : undefined;\n\n/**\n * @private EuiComboBox's input with the selected pills. Extends\n * ember-power-select's multiple trigger.\n */\nexport default class EuiComboBoxTriggerComponent extends PowerSelectTrigger {\n get comboArgs(): TriggerArgs {\n return this.args as unknown as TriggerArgs;\n }\n\n get asPlainText(): boolean {\n const single = this.comboArgs.singleSelection;\n\n return Boolean(single && typeof single === 'object' && single.asPlainText);\n }\n\n get hasSelection(): boolean {\n return Boolean(this.comboArgs.select.selected?.length);\n }\n\n /**\n * Upstream: `@prepend` / `@append` only show with single selection, so\n * pills never wrap onto rows taller than them.\n */\n get prepend(): unknown {\n return this.comboArgs.singleSelection ? this.comboArgs.prepend : undefined;\n }\n\n get append(): unknown {\n return this.comboArgs.singleSelection ? this.comboArgs.append : undefined;\n }\n\n get inputId(): string {\n return `ember-power-select-trigger-multiple-input-${this.comboArgs.select.uniqueId}`;\n }\n\n /**\n * Upstream's toggle button (`comboBoxToggleListButton`): the chevron is a\n * button opening or closing the list. Upstream `noIcon={!!noSuggestions}`:\n * no list, no chevron; none while disabled either.\n */\n @cached\n get icon(): EuiFormControlLayoutIconShape | undefined {\n const { select, noSuggestions, onToggleList } = this.comboArgs;\n\n if (select.disabled || noSuggestions) return undefined;\n\n return {\n // @ts-expect-error `icon` is curried by EuiComboBox\n type: this.args.icon ?? 'chevronSingleDown',\n side: 'right',\n 'aria-label': select.isOpen\n ? 'Close list of options'\n : 'Open list of options',\n 'data-test-subj': 'comboBoxToggleListButton',\n tabIndex: -1,\n onClick: (event: MouseEvent) => onToggleList?.(event)\n };\n }\n\n /** Upstream `clear` props: `comboBoxClearButton`, shown with a selection. */\n @cached\n get clearProps(): EuiFormControlLayoutClearProps | undefined {\n const { allowClear, onClear } = this.comboArgs;\n\n if (!allowClear || !onClear || !this.hasSelection) return undefined;\n\n return {\n 'data-test-subj': 'comboBoxClearButton',\n onClick: (event: MouseEvent) => onClear(event)\n };\n }\n\n /** Plain text selection: the selected option, shown as the input's text. */\n get plainTextOption(): unknown {\n return this.asPlainText ? this.comboArgs.select.selected?.[0] : undefined;\n }\n\n /** Upstream: the input shows the search text, else the selection's label. */\n get plainTextValue(): string | undefined {\n const option = this.plainTextOption;\n\n if (option === undefined) return undefined;\n\n return comboBoxOptionLabel(option, this.comboArgs.searchField) ?? '';\n }\n\n /** Plain text selection's option prepend/append: upstream `xxs` spacing. */\n @cached\n get plainTextSideClasses(): { prepend: string; append: string } {\n const context = getEuiThemeContext(this);\n const styles = comboBoxAppendPrependStyles(\n String(context.upstream.euiTheme.size.xxs)\n );\n\n return {\n prepend: euiClass(context, styles.prepend),\n append: euiClass(context, styles.append)\n };\n }\n\n /**\n * The toggle button handles its own clicks: ember-basic-dropdown's\n * trigger must not toggle the list on the same press. The press focuses\n * the button, as upstream (the input blurs; the combo box keeps focus).\n */\n keepToggle = (event: Event) => {\n if (!isToggleButton(event.target)) return;\n\n event.stopPropagation();\n };\n\n /**\n * Keys on the focused toggle button run upstream's container `onKeyDown`\n * before ember-basic-dropdown's trigger sees them.\n */\n toggleKeydown = (event: KeyboardEvent) => {\n if (!isToggleButton(event.target)) return;\n\n if (this.comboArgs.onToggleKeydown?.(event)) event.stopPropagation();\n };\n\n /** Upstream `onContainerBlur` for the toggle button. */\n toggleBlur = (event: FocusEvent) => {\n if (!isToggleButton(event.target)) return;\n\n this.comboArgs.onToggleBlur?.(event);\n };\n\n /** Upstream `showPlaceholder`: a placeholder, no selection, no search. */\n get showPlaceholder(): boolean {\n const { placeholder, select } = this.comboArgs;\n\n return Boolean(placeholder && !this.hasSelection && !select.searchText);\n }\n\n /** EuiFormControlLayout grows with the rows of pills (multi selection). */\n @cached\n get layoutCss(): CSSInterpolation[] {\n const styles = useEuiBorealisStyles(\n getEuiThemeContext(this),\n euiComboBoxInputStyles\n );\n\n return [\n styles.formLayout.euiComboBox__formControlLayout,\n !this.comboArgs.singleSelection && styles.formLayout.multiSelect\n ];\n }\n\n /**\n * Upstream `euiComboBoxInputWrapper`: the element that looks like the form\n * control (border, background, padding, focus/invalid/disabled states),\n * holding the pills and the search input.\n */\n @cached\n get wrapClass(): string {\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiComboBoxInputStyles);\n const { compressed, isInvalid, select, singleSelection } = this.comboArgs;\n const plainText = this.asPlainText || this.showPlaceholder;\n const stateCss = select.isOpen\n ? styles.open\n : isInvalid\n ? styles.invalid\n : undefined;\n\n return euiClass(\n context,\n // the wrap is a <div>, but keep any list or prose margins off it\n { margin: 0, listStyle: 'none' },\n styles.euiComboBoxInputWrapper,\n !singleSelection && styles.multiSelect,\n compressed ? styles.compressed : styles.uncompressed,\n ...(plainText\n ? [\n styles.plainText.plainText,\n compressed\n ? styles.plainText.compressed\n : styles.plainText.uncompressed\n ]\n : []),\n select.disabled ? styles.disabled : stateCss,\n Boolean(this.prepend || this.append) && styles.inGroup\n );\n }\n\n /**\n * Placeholder shown when searching is disabled: the form control\n * placeholder color and size (the input shows it otherwise).\n */\n @cached\n get placeholderClass(): string {\n const context = getEuiThemeContext(this);\n const form = useEuiBorealisStyles(context, euiFormVariables);\n\n return euiClass(context, {\n alignSelf: 'center',\n fontSize: euiFontSize(context.upstream, 's', undefined).fontSize,\n color: form.controlPlaceholderText,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n });\n }\n\n /** Keeps the wrap one input tall without a search input. */\n @cached\n get spacerClass(): string {\n const context = getEuiThemeContext(this);\n\n return euiClass(context, {\n blockSize: context.upstream.euiTheme.size.l,\n minInlineSize: '2px'\n });\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n <EuiFormControlLayout\n @icon={{this.icon}}\n @inputId={{this.inputId}}\n @isPrependProvided={{if this.prepend true false}}\n @isAppendProvided={{if this.append true false}}\n @iconSide=\"right\"\n {{on \"mousedown\" this.keepToggle capture=true}}\n {{on \"touchstart\" this.keepToggle capture=true}}\n {{on \"touchend\" this.keepToggle capture=true}}\n {{on \"focusout\" this.toggleBlur}}\n {{on \"keydown\" this.toggleKeydown}}\n @fullWidth={{@fullWidth}}\n @compressed={{@compressed}}\n @readOnly={{@readOnly}}\n @isInvalid={{@isInvalid}}\n @clear={{this.clearProps}}\n @isLoading={{@isLoading}}\n @disabled={{@select.disabled}}\n @css={{this.layoutCss}}\n >\n <:prepend>\n {{#if (isSingleText this.prepend)}}\n <EuiFormPrepend\n @label={{this.prepend}}\n @inputId={{this.inputId}}\n @compressed={{@compressed}}\n />\n {{else}}\n {{#each (nodeList this.prepend) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:prepend>\n <:field>\n {{! template-lint-disable }}\n <div\n id=\"ember-power-select-multiple-options-{{@select.uniqueId}}\"\n class=\"euiComboBox__inputWrap ember-power-select-multiple-options\n {{if this.asPlainText 'euiComboBox__inputWrap--plainText'}}\n {{this.wrapClass}}\"\n data-test-subj=\"comboBoxInput\"\n ...attributes\n {{! no ember-power-select openChange: upstream keeps the search\n text when the list closes (leftover text marks it invalid) }}\n {{on \"touchstart\" this.chooseOption}}\n {{on \"mousedown\" this.chooseOption}}\n >\n {{! template-lint-enable }}\n {{! upstream: no pill for plain text (the input shows it), and\n no single selection pill while searching }}\n {{#if\n (and\n (not this.asPlainText)\n (or\n (and @singleSelection (not @select.searchText))\n (not @singleSelection)\n )\n )\n }}\n {{#each @select.selected as |opt idx|}}\n {{#if @selectedItemComponent}}\n {{#let\n (component\n @selectedItemComponent\n extra=@extra\n option=opt\n select=@select\n )\n as |SelectedItemComponent|\n }}\n <SelectedItemComponent />\n {{/let}}\n {{else}}\n <EuiComboBoxPill\n class=\"ember-power-select-multiple-option\n {{if\n opt.disabled\n 'ember-power-select-multiple-option--disabled'\n }}\"\n @option={{opt}}\n @searchField={{@searchField}}\n @onClose={{if\n (or @select.disabled @singleSelection)\n false\n (if @onClose (fn (optional @onClose) opt) true)\n }}\n @dataSelectedIconIndex={{idx}}\n @color={{opt.color}}\n @asPlainText={{this.asPlainText}}\n >\n {{yield opt @select}}\n </EuiComboBoxPill>\n {{/if}}\n {{else}}{{#if (and @placeholder (not @searchEnabled))}}\n <span\n class=\"ember-power-select-placeholder {{this.placeholderClass}}\"\n >\n {{@placeholder}}\n </span>\n {{/if}}{{/each}}\n {{/if}}\n {{#let\n (optionNode this.plainTextOption \"prepend\")\n (optionNode this.plainTextOption \"append\")\n as |plainPrepend plainAppend|\n }}\n {{#if plainPrepend}}\n <span\n class=\"euiComboBoxPlainTextSelection__prepend\n {{this.plainTextSideClasses.prepend}}\"\n ><EuiComboBoxNode\n @node={{plainPrepend}}\n @option={{this.plainTextOption}}\n /></span>\n {{/if}}\n {{#if @searchEnabled}}\n {{#let\n (component\n EuiComboBoxTriggerInput\n select=@select\n ariaActiveDescendant=@ariaActiveDescendant\n ariaLabelledBy=(or @inputAriaLabelledBy @ariaLabelledBy)\n ariaDescribedBy=@ariaDescribedBy\n ariaLabel=(or @inputAriaLabel @ariaLabel)\n listboxId=@listboxId\n tabindex=@inputTabindex\n inputRef=@inputRef\n role=@inputRole\n required=@inputRequired\n buildSelection=@buildSelection\n placeholder=@placeholder\n placeholderComponent=@placeholderComponent\n searchField=@searchField\n onFocus=@onFocus\n isInvalid=@isInvalid\n fillWidth=(or this.asPlainText this.showPlaceholder)\n onBlur=@onBlur\n onKeydown=@onKeydown\n onInput=@onInput\n noSuggestions=@noSuggestions\n plainTextValue=this.plainTextValue\n asPlainText=this.asPlainText\n onPlainTextClick=@onPlainTextClick\n )\n as |InputComponent|\n }}\n {{#let\n (component\n @placeholderComponent\n select=@select\n placeholder=@placeholder\n isMultipleWithSearch=true\n inputComponent=InputComponent\n displayPlaceholder=(and\n (not @select.searchText) (not @select.selected)\n )\n )\n as |PlaceholderComponent|\n }}\n <PlaceholderComponent />\n {{/let}}\n {{/let}}\n {{else}}\n {{#if this.asPlainText}}\n {{#each @select.selected as |opt|}}\n <EuiComboBoxPill\n @option={{opt}}\n @searchField={{@searchField}}\n @asPlainText={{true}}\n >{{yield opt @select}}</EuiComboBoxPill>\n {{/each}}\n {{/if}}\n <div class=\"euiComboBox__input {{this.spacerClass}}\"></div>\n {{/if}}\n {{#if plainAppend}}\n <span\n class=\"euiComboBoxPlainTextSelection__append\n {{this.plainTextSideClasses.append}}\"\n ><EuiComboBoxNode\n @node={{plainAppend}}\n @option={{this.plainTextOption}}\n /></span>\n {{/if}}\n {{/let}}\n {{#if @screenReaderInstructions}}\n {{! upstream: read when the input gets focus }}\n <EuiScreenReaderOnly>\n <span\n aria-live=\"polite\"\n id=\"{{@select.uniqueId}}_removeOptionMessage\"\n >{{@screenReaderInstructions}}</span>\n </EuiScreenReaderOnly>\n {{/if}}\n </div>\n </:field>\n <:append>\n {{#if (isSingleText this.append)}}\n <EuiFormAppend\n @label={{this.append}}\n @inputId={{this.inputId}}\n @compressed={{@compressed}}\n />\n {{else}}\n {{#each (nodeList this.append) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:append>\n </EuiFormControlLayout>\n </template>\n}\n"],"names":["isToggleButton","target","Boolean","closest","isSingleText","node","Array","isArray","isTextNode","nodeList","optionNode","option","key","undefined","EuiComboBoxTriggerComponent","PowerSelectTrigger","comboArgs","args","asPlainText","single","singleSelection","hasSelection","select","selected","length","prepend","append","inputId","uniqueId","icon","noSuggestions","onToggleList","disabled","type","side","isOpen","tabIndex","onClick","event","n","prototype","cached","clearProps","allowClear","onClear","plainTextOption","plainTextValue","comboBoxOptionLabel","searchField","plainTextSideClasses","context","getEuiThemeContext","styles","comboBoxAppendPrependStyles","String","upstream","euiTheme","size","xxs","euiClass","keepToggle","stopPropagation","toggleKeydown","onToggleKeydown","toggleBlur","onToggleBlur","showPlaceholder","placeholder","searchText","layoutCss","useEuiBorealisStyles","euiComboBoxInputStyles","formLayout","euiComboBox__formControlLayout","multiSelect","wrapClass","compressed","isInvalid","plainText","stateCss","open","invalid","margin","listStyle","euiComboBoxInputWrapper","uncompressed","inGroup","placeholderClass","form","euiFormVariables","alignSelf","fontSize","euiFontSize","color","controlPlaceholderText","overflow","textOverflow","whiteSpace","spacerClass","blockSize","l","minInlineSize","setComponentTemplate","precompileTemplate","strictMode","scope","EuiFormControlLayout","on","EuiFormPrepend","EuiFormLabel","EuiComboBoxNode","and","not","or","EuiComboBoxPill","fn","optional","EuiComboBoxTriggerInput","EuiScreenReaderOnly","EuiFormAppend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoEA,oEACO,MAAMA,iBAAkBC,MAA0B,IACvDC,QACGD,MAAA,EAA2BE,UAC1B,6CAAA,CAAA;AAIN;AACA,MAAMC,YAAA,GAAgBC,IAAa,IAAK,CAACC,KAAA,CAAMC,OAAO,CAACF,IAAA,CAAA,IAASG,UAAA,CAAWH,IAAA,CAAA;AAE3E,MAAMI,QAAA,GAAYJ,IAAa,IAC7BC,KAAA,CAAMC,OAAO,CAACF,IAAA,CAAA,GAAQA,IAAA,GAAO,CAACA,IAAA,CAAK;AAErC,MAAMK,UAAA,GAAaA,CAACC,MAAe,EAAEC,GAAiB,KACpDD,MAAA,IAAU,OAAOA,MAAA,KAAW,WACvBA,MAAA,CAAmCC,GAAA,CAAI,GACxCC,SAAA;AAEN;;;;AAIe,MAAMC,2BAAA,SAAoCC,kBAAA,CAAA;EACvD,IAAIC,YAAyB;IAC3B,OAAO,IAAI,CAACC,IAAI;AAClB,EAAA;EAEA,IAAIC,WAAAA,GAAuB;AACzB,IAAA,MAAMC,MAAA,GAAS,IAAI,CAACH,SAAS,CAACI,eAAe;AAE7C,IAAA,OAAOlB,QAAQiB,MAAA,IAAU,OAAOA,MAAA,KAAW,QAAA,IAAYA,OAAOD,WAAW,CAAA;AAC3E,EAAA;EAEA,IAAIG,YAAAA,GAAwB;IAC1B,OAAOnB,OAAA,CAAQ,IAAI,CAACc,SAAS,CAACM,MAAM,CAACC,QAAQ,EAAEC,MAAA,CAAA;AACjD,EAAA;AAEA;;;;EAIA,IAAIC,OAAAA,GAAmB;AACrB,IAAA,OAAO,IAAI,CAACT,SAAS,CAACI,eAAe,GAAG,IAAI,CAACJ,SAAS,CAACS,OAAO,GA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W8E,QAAQ;MAChEE,KAAA,EAAOL,KAAKM,sBAAsB;AAClCC,MAAAA,QAAA,EAAU,QAAA;AACVC,MAAAA,YAAA,EAAc,UAAA;AACdC,MAAAA,UAAA,EAAY;AACd,KAAA,CAAA;AACF,EAAA;AAEA;AAAA,EAAA;IAAA1D,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,kBAAA,EAAA,CAfCC,MAAA,CAAA,CAAA;AAAA;EAgBD,IACIyD,WAAAA,GAAsB;AACxB,IAAA,MAAMhD,OAAA,GAAUC,mBAAmB,IAAI,CAAA;IAEvC,OAAOQ,SAAST,OAAA,EAAS;MACvBiD,SAAA,EAAWjD,QAAQK,QAAQ,CAACC,QAAQ,CAACC,IAAI,CAAC2C,CAAC;AAC3CC,MAAAA,aAAA,EAAe;AACjB,KAAA,CAAA;AACF,EAAA;AAAA,EAAA;IAAA9D,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,aAAA,EAAA,CARCC,MAAA,CAAA,CAAA;AAAA;AAUD,EAAA;IAAA6D,oBAAA,CAAAC,kBAAA,CAAA,6xLAAA,EA2NA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,oBAAA;QAAAC,EAAA;QAAAvG,YAAA;QAAAwG,cAAA;QAAAnG,QAAA;QAAAD,UAAA;QAAAqG,YAAA;yBAAAC,wBAAA;QAAAC,GAAA;QAAAC,GAAA;QAAAC,EAAA;yBAAAC,wBAAA;QAAAC,EAAA;QAAAC,QAAA;QAAA1G,UAAA;iCAAA2G,gCAAA;QAAAC,mBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"trigger.js","sources":["../../../src/components/eui-combo-box/trigger.gts"],"sourcesContent":["import { cached } from '@glimmer/tracking';\nimport { fn } from '@ember/helper';\nimport { on } from '@ember/modifier';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport PowerSelectTrigger from 'ember-power-select/components/power-select/trigger';\nimport { and, not, or } from 'ember-truth-helpers';\n\nimport { getEuiThemeContext } from '../../utils/emotion/consume.ts';\nimport {\n euiComboBoxInputStyles,\n euiFontSize,\n euiFormVariables\n} from '../../utils/eui/styles.generated.ts';\nimport { euiClass, useEuiBorealisStyles } from '../../utils/eui/styles.ts';\nimport EuiComboBoxPill from '../eui-combo-box-pill.gts';\nimport EuiFormControlLayout from '../eui-form-control-layout.gts';\nimport EuiFormLabel from '../eui-form-label.gts';\nimport EuiFormAppend from '../eui-form-append.gts';\nimport EuiFormPrepend from '../eui-form-prepend.gts';\nimport EuiScreenReaderOnly from '../eui-screen-reader-only.gts';\nimport EuiComboBoxNode from './node.gts';\nimport EuiComboBoxTriggerInput from './trigger/input.gts';\nimport {\n comboBoxAppendPrependStyles,\n comboBoxOptionLabel,\n isTextNode\n} from '../../utils/eui/combo-box.ts';\n\nimport type {\n EuiFormControlLayoutClearProps,\n EuiFormControlLayoutIconShape\n} from '../eui-form-control-layout-icons.gts';\n\nimport type { CSSInterpolation } from '@emotion/css/create-instance';\n\ninterface TriggerSelect {\n uniqueId: string;\n isOpen: boolean;\n disabled: boolean;\n searchText: string;\n selected?: unknown[];\n}\n\ninterface TriggerArgs {\n select: TriggerSelect;\n compressed?: boolean;\n fullWidth?: boolean;\n isInvalid?: boolean;\n placeholder?: string;\n searchEnabled?: boolean;\n singleSelection?: boolean | { asPlainText?: boolean };\n /** EuiComboBox's caller passed a block (renders the options). */\n hasOptionBlock?: boolean;\n prepend?: unknown;\n append?: unknown;\n noSuggestions?: boolean;\n screenReaderInstructions?: string;\n searchField?: string;\n /** Called with the search input once rendered, and `null` on removal. */\n inputRef?: (element: HTMLInputElement | null) => void;\n allowClear?: boolean;\n onClear?: (event?: Event) => void;\n onToggleList?: (event: MouseEvent) => void;\n /** Focus left the toggle button (upstream `onContainerBlur`). */\n onToggleBlur?: (event: FocusEvent) => void;\n /** A key on the focused toggle button; `true` stops it here. */\n onToggleKeydown?: (event: KeyboardEvent) => boolean;\n}\n\n/** The chevron (`comboBoxToggleListButton`) or an element in it. */\nexport const isToggleButton = (target: EventTarget | null): boolean =>\n Boolean(\n (target as Element | null)?.closest?.(\n '[data-test-subj=\"comboBoxToggleListButton\"]'\n )\n );\n\n/** Upstream side nodes: one string is an EuiFormPrepend/Append label. */\nconst isSingleText = (node: unknown) => !Array.isArray(node) && isTextNode(node);\n\nconst nodeList = (node: unknown): unknown[] =>\n Array.isArray(node) ? node : [node];\n\nconst optionNode = (option: unknown, key: 'prepend' | 'append') =>\n option && typeof option === 'object'\n ? (option as Record<string, unknown>)[key]\n : undefined;\n\n/**\n * @private EuiComboBox's input with the selected pills. Extends\n * ember-power-select's multiple trigger.\n */\nexport default class EuiComboBoxTriggerComponent extends PowerSelectTrigger {\n get comboArgs(): TriggerArgs {\n return this.args as unknown as TriggerArgs;\n }\n\n get asPlainText(): boolean {\n const single = this.comboArgs.singleSelection;\n\n return Boolean(single && typeof single === 'object' && single.asPlainText);\n }\n\n get hasSelection(): boolean {\n return Boolean(this.comboArgs.select.selected?.length);\n }\n\n /**\n * Upstream: `@prepend` / `@append` only show with single selection, so\n * pills never wrap onto rows taller than them.\n */\n get prepend(): unknown {\n return this.comboArgs.singleSelection ? this.comboArgs.prepend : undefined;\n }\n\n get append(): unknown {\n return this.comboArgs.singleSelection ? this.comboArgs.append : undefined;\n }\n\n get inputId(): string {\n return `ember-power-select-trigger-multiple-input-${this.comboArgs.select.uniqueId}`;\n }\n\n /**\n * Upstream's toggle button (`comboBoxToggleListButton`): the chevron is a\n * button opening or closing the list. Upstream `noIcon={!!noSuggestions}`:\n * no list, no chevron; none while disabled either.\n */\n @cached\n get icon(): EuiFormControlLayoutIconShape | undefined {\n const { select, noSuggestions, onToggleList } = this.comboArgs;\n\n if (select.disabled || noSuggestions) return undefined;\n\n return {\n // @ts-expect-error `icon` is curried by EuiComboBox\n type: this.args.icon ?? 'chevronSingleDown',\n side: 'right',\n 'aria-label': select.isOpen\n ? 'Close list of options'\n : 'Open list of options',\n 'data-test-subj': 'comboBoxToggleListButton',\n tabIndex: -1,\n onClick: (event: MouseEvent) => onToggleList?.(event)\n };\n }\n\n /** Upstream `clear` props: `comboBoxClearButton`, shown with a selection. */\n @cached\n get clearProps(): EuiFormControlLayoutClearProps | undefined {\n const { allowClear, onClear } = this.comboArgs;\n\n if (!allowClear || !onClear || !this.hasSelection) return undefined;\n\n return {\n 'data-test-subj': 'comboBoxClearButton',\n onClick: (event: MouseEvent) => onClear(event)\n };\n }\n\n /** Plain text selection: the selected option, shown as the input's text. */\n get plainTextOption(): unknown {\n return this.asPlainText ? this.comboArgs.select.selected?.[0] : undefined;\n }\n\n /** Upstream: the input shows the search text, else the selection's label. */\n get plainTextValue(): string | undefined {\n const option = this.plainTextOption;\n\n if (option === undefined) return undefined;\n\n return comboBoxOptionLabel(option, this.comboArgs.searchField) ?? '';\n }\n\n /**\n * Not upstream: with a caller's block, the plain text selection is\n * rendered with it (as ember-eui 14 did) while nothing is typed; the\n * input's text is hidden under it.\n */\n get showsPlainTextBlock(): boolean {\n return Boolean(\n this.comboArgs.hasOptionBlock &&\n this.plainTextOption !== undefined &&\n !this.comboArgs.select.searchText\n );\n }\n\n /**\n * The block over the input wrap, inside its padding, centered like the\n * input's text; clicks go through to the input.\n */\n @cached\n get plainTextBlockClass(): string {\n const context = getEuiThemeContext(this);\n\n return euiClass(context, {\n position: 'absolute',\n inset: 0,\n padding: 'inherit',\n display: 'flex',\n alignItems: 'center',\n minWidth: 0,\n overflow: 'hidden',\n pointerEvents: 'none'\n });\n }\n\n /** Plain text selection's option prepend/append: upstream `xxs` spacing. */\n @cached\n get plainTextSideClasses(): { prepend: string; append: string } {\n const context = getEuiThemeContext(this);\n const styles = comboBoxAppendPrependStyles(\n String(context.upstream.euiTheme.size.xxs)\n );\n\n return {\n prepend: euiClass(context, styles.prepend),\n append: euiClass(context, styles.append)\n };\n }\n\n /**\n * The toggle button handles its own clicks: ember-basic-dropdown's\n * trigger must not toggle the list on the same press. The press focuses\n * the button, as upstream (the input blurs; the combo box keeps focus).\n */\n keepToggle = (event: Event) => {\n if (!isToggleButton(event.target)) return;\n\n event.stopPropagation();\n };\n\n /**\n * Keys on the focused toggle button run upstream's container `onKeyDown`\n * before ember-basic-dropdown's trigger sees them.\n */\n toggleKeydown = (event: KeyboardEvent) => {\n if (!isToggleButton(event.target)) return;\n\n if (this.comboArgs.onToggleKeydown?.(event)) event.stopPropagation();\n };\n\n /** Upstream `onContainerBlur` for the toggle button. */\n toggleBlur = (event: FocusEvent) => {\n if (!isToggleButton(event.target)) return;\n\n this.comboArgs.onToggleBlur?.(event);\n };\n\n /** Upstream `showPlaceholder`: a placeholder, no selection, no search. */\n get showPlaceholder(): boolean {\n const { placeholder, select } = this.comboArgs;\n\n return Boolean(placeholder && !this.hasSelection && !select.searchText);\n }\n\n /** EuiFormControlLayout grows with the rows of pills (multi selection). */\n @cached\n get layoutCss(): CSSInterpolation[] {\n const styles = useEuiBorealisStyles(\n getEuiThemeContext(this),\n euiComboBoxInputStyles\n );\n\n return [\n styles.formLayout.euiComboBox__formControlLayout,\n !this.comboArgs.singleSelection && styles.formLayout.multiSelect\n ];\n }\n\n /**\n * Upstream `euiComboBoxInputWrapper`: the element that looks like the form\n * control (border, background, padding, focus/invalid/disabled states),\n * holding the pills and the search input.\n */\n @cached\n get wrapClass(): string {\n const context = getEuiThemeContext(this);\n const styles = useEuiBorealisStyles(context, euiComboBoxInputStyles);\n const { compressed, isInvalid, select, singleSelection } = this.comboArgs;\n const plainText = this.asPlainText || this.showPlaceholder;\n const stateCss = select.isOpen\n ? styles.open\n : isInvalid\n ? styles.invalid\n : undefined;\n\n return euiClass(\n context,\n // the wrap is a <div>, but keep any list or prose margins off it\n { margin: 0, listStyle: 'none' },\n styles.euiComboBoxInputWrapper,\n !singleSelection && styles.multiSelect,\n compressed ? styles.compressed : styles.uncompressed,\n ...(plainText\n ? [\n styles.plainText.plainText,\n compressed\n ? styles.plainText.compressed\n : styles.plainText.uncompressed\n ]\n : []),\n select.disabled ? styles.disabled : stateCss,\n Boolean(this.prepend || this.append) && styles.inGroup,\n this.showsPlainTextBlock && { position: 'relative' }\n );\n }\n\n /**\n * Placeholder shown when searching is disabled: the form control\n * placeholder color and size (the input shows it otherwise).\n */\n @cached\n get placeholderClass(): string {\n const context = getEuiThemeContext(this);\n const form = useEuiBorealisStyles(context, euiFormVariables);\n\n return euiClass(context, {\n alignSelf: 'center',\n fontSize: euiFontSize(context.upstream, 's', undefined).fontSize,\n color: form.controlPlaceholderText,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n });\n }\n\n /** Keeps the wrap one input tall without a search input. */\n @cached\n get spacerClass(): string {\n const context = getEuiThemeContext(this);\n\n return euiClass(context, {\n blockSize: context.upstream.euiTheme.size.l,\n minInlineSize: '2px'\n });\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n <EuiFormControlLayout\n @icon={{this.icon}}\n @inputId={{this.inputId}}\n @isPrependProvided={{if this.prepend true false}}\n @isAppendProvided={{if this.append true false}}\n @iconSide=\"right\"\n {{on \"mousedown\" this.keepToggle capture=true}}\n {{on \"touchstart\" this.keepToggle capture=true}}\n {{on \"touchend\" this.keepToggle capture=true}}\n {{on \"focusout\" this.toggleBlur}}\n {{on \"keydown\" this.toggleKeydown}}\n @fullWidth={{@fullWidth}}\n @compressed={{@compressed}}\n @readOnly={{@readOnly}}\n @isInvalid={{@isInvalid}}\n @clear={{this.clearProps}}\n @isLoading={{@isLoading}}\n @disabled={{@select.disabled}}\n @css={{this.layoutCss}}\n >\n <:prepend>\n {{#if (isSingleText this.prepend)}}\n <EuiFormPrepend\n @label={{this.prepend}}\n @inputId={{this.inputId}}\n @compressed={{@compressed}}\n />\n {{else}}\n {{#each (nodeList this.prepend) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:prepend>\n <:field>\n {{! template-lint-disable }}\n <div\n id=\"ember-power-select-multiple-options-{{@select.uniqueId}}\"\n class=\"euiComboBox__inputWrap ember-power-select-multiple-options\n {{if this.asPlainText 'euiComboBox__inputWrap--plainText'}}\n {{this.wrapClass}}\"\n data-test-subj=\"comboBoxInput\"\n ...attributes\n {{! no ember-power-select openChange: upstream keeps the search\n text when the list closes (leftover text marks it invalid) }}\n {{on \"touchstart\" this.chooseOption}}\n {{on \"mousedown\" this.chooseOption}}\n >\n {{! template-lint-enable }}\n {{! upstream: no pill for plain text (the input shows it), and\n no single selection pill while searching }}\n {{#if\n (and\n (not this.asPlainText)\n (or\n (and @singleSelection (not @select.searchText))\n (not @singleSelection)\n )\n )\n }}\n {{#each @select.selected as |opt idx|}}\n {{#if @selectedItemComponent}}\n {{#let\n (component\n @selectedItemComponent\n extra=@extra\n option=opt\n select=@select\n )\n as |SelectedItemComponent|\n }}\n <SelectedItemComponent />\n {{/let}}\n {{else}}\n <EuiComboBoxPill\n class=\"ember-power-select-multiple-option\n {{if\n opt.disabled\n 'ember-power-select-multiple-option--disabled'\n }}\"\n @option={{opt}}\n @searchField={{@searchField}}\n @onClose={{if\n (or @select.disabled @singleSelection)\n false\n (if @onClose (fn (optional @onClose) opt) true)\n }}\n @dataSelectedIconIndex={{idx}}\n @color={{opt.color}}\n @asPlainText={{this.asPlainText}}\n >\n {{yield opt @select}}\n </EuiComboBoxPill>\n {{/if}}\n {{else}}{{#if (and @placeholder (not @searchEnabled))}}\n <span\n class=\"ember-power-select-placeholder {{this.placeholderClass}}\"\n >\n {{@placeholder}}\n </span>\n {{/if}}{{/each}}\n {{/if}}\n {{#let\n (optionNode this.plainTextOption \"prepend\")\n (optionNode this.plainTextOption \"append\")\n as |plainPrepend plainAppend|\n }}\n {{#if plainPrepend}}\n <span\n class=\"euiComboBoxPlainTextSelection__prepend\n {{this.plainTextSideClasses.prepend}}\"\n ><EuiComboBoxNode\n @node={{plainPrepend}}\n @option={{this.plainTextOption}}\n /></span>\n {{/if}}\n {{#if @searchEnabled}}\n {{#if this.showsPlainTextBlock}}\n <span\n class=\"euiComboBoxPlainTextSelection__block\n {{this.plainTextBlockClass}}\"\n aria-hidden=\"true\"\n >{{yield this.plainTextOption @select}}</span>\n {{/if}}\n {{#let\n (component\n EuiComboBoxTriggerInput\n select=@select\n ariaActiveDescendant=@ariaActiveDescendant\n ariaLabelledBy=(or @inputAriaLabelledBy @ariaLabelledBy)\n ariaDescribedBy=@ariaDescribedBy\n ariaLabel=(or @inputAriaLabel @ariaLabel)\n listboxId=@listboxId\n tabindex=@inputTabindex\n inputRef=@inputRef\n role=@inputRole\n required=@inputRequired\n buildSelection=@buildSelection\n placeholder=@placeholder\n placeholderComponent=@placeholderComponent\n searchField=@searchField\n onFocus=@onFocus\n isInvalid=@isInvalid\n fillWidth=(or this.asPlainText this.showPlaceholder)\n onBlur=@onBlur\n onKeydown=@onKeydown\n onInput=@onInput\n noSuggestions=@noSuggestions\n plainTextValue=this.plainTextValue\n asPlainText=this.asPlainText\n hidesValue=this.showsPlainTextBlock\n onPlainTextClick=@onPlainTextClick\n )\n as |InputComponent|\n }}\n {{#let\n (component\n @placeholderComponent\n select=@select\n placeholder=@placeholder\n isMultipleWithSearch=true\n inputComponent=InputComponent\n displayPlaceholder=(and\n (not @select.searchText) (not @select.selected)\n )\n )\n as |PlaceholderComponent|\n }}\n <PlaceholderComponent />\n {{/let}}\n {{/let}}\n {{else}}\n {{#if this.asPlainText}}\n {{#each @select.selected as |opt|}}\n <EuiComboBoxPill\n @option={{opt}}\n @searchField={{@searchField}}\n @asPlainText={{true}}\n >{{yield opt @select}}</EuiComboBoxPill>\n {{/each}}\n {{/if}}\n <div class=\"euiComboBox__input {{this.spacerClass}}\"></div>\n {{/if}}\n {{#if plainAppend}}\n <span\n class=\"euiComboBoxPlainTextSelection__append\n {{this.plainTextSideClasses.append}}\"\n ><EuiComboBoxNode\n @node={{plainAppend}}\n @option={{this.plainTextOption}}\n /></span>\n {{/if}}\n {{/let}}\n {{#if @screenReaderInstructions}}\n {{! upstream: read when the input gets focus }}\n <EuiScreenReaderOnly>\n <span\n aria-live=\"polite\"\n id=\"{{@select.uniqueId}}_removeOptionMessage\"\n >{{@screenReaderInstructions}}</span>\n </EuiScreenReaderOnly>\n {{/if}}\n </div>\n </:field>\n <:append>\n {{#if (isSingleText this.append)}}\n <EuiFormAppend\n @label={{this.append}}\n @inputId={{this.inputId}}\n @compressed={{@compressed}}\n />\n {{else}}\n {{#each (nodeList this.append) as |node|}}\n {{#if (isTextNode node)}}\n <EuiFormLabel @for={{this.inputId}}>{{node}}</EuiFormLabel>\n {{else}}\n <EuiComboBoxNode @node={{node}} />\n {{/if}}\n {{/each}}\n {{/if}}\n </:append>\n </EuiFormControlLayout>\n </template>\n}\n"],"names":["isToggleButton","target","Boolean","closest","isSingleText","node","Array","isArray","isTextNode","nodeList","optionNode","option","key","undefined","EuiComboBoxTriggerComponent","PowerSelectTrigger","comboArgs","args","asPlainText","single","singleSelection","hasSelection","select","selected","length","prepend","append","inputId","uniqueId","icon","noSuggestions","onToggleList","disabled","type","side","isOpen","tabIndex","onClick","event","n","prototype","cached","clearProps","allowClear","onClear","plainTextOption","plainTextValue","comboBoxOptionLabel","searchField","showsPlainTextBlock","hasOptionBlock","searchText","plainTextBlockClass","context","getEuiThemeContext","euiClass","position","inset","padding","display","alignItems","minWidth","overflow","pointerEvents","plainTextSideClasses","styles","comboBoxAppendPrependStyles","String","upstream","euiTheme","size","xxs","keepToggle","stopPropagation","toggleKeydown","onToggleKeydown","toggleBlur","onToggleBlur","showPlaceholder","placeholder","layoutCss","useEuiBorealisStyles","euiComboBoxInputStyles","formLayout","euiComboBox__formControlLayout","multiSelect","wrapClass","compressed","isInvalid","plainText","stateCss","open","invalid","margin","listStyle","euiComboBoxInputWrapper","uncompressed","inGroup","placeholderClass","form","euiFormVariables","alignSelf","fontSize","euiFontSize","color","controlPlaceholderText","textOverflow","whiteSpace","spacerClass","blockSize","l","minInlineSize","setComponentTemplate","precompileTemplate","strictMode","scope","EuiFormControlLayout","on","EuiFormPrepend","EuiFormLabel","EuiComboBoxNode","and","not","or","EuiComboBoxPill","fn","optional","EuiComboBoxTriggerInput","EuiScreenReaderOnly","EuiFormAppend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsEA,oEACO,MAAMA,iBAAkBC,MAA0B,IACvDC,QACGD,MAAA,EAA2BE,UAC1B,6CAAA,CAAA;AAIN;AACA,MAAMC,YAAA,GAAgBC,IAAa,IAAK,CAACC,KAAA,CAAMC,OAAO,CAACF,IAAA,CAAA,IAASG,UAAA,CAAWH,IAAA,CAAA;AAE3E,MAAMI,QAAA,GAAYJ,IAAa,IAC7BC,KAAA,CAAMC,OAAO,CAACF,IAAA,CAAA,GAAQA,IAAA,GAAO,CAACA,IAAA,CAAK;AAErC,MAAMK,UAAA,GAAaA,CAACC,MAAe,EAAEC,GAAiB,KACpDD,MAAA,IAAU,OAAOA,MAAA,KAAW,WACvBA,MAAA,CAAmCC,GAAA,CAAI,GACxCC,SAAA;AAEN;;;;AAIe,MAAMC,2BAAA,SAAoCC,kBAAA,CAAA;EACvD,IAAIC,YAAyB;IAC3B,OAAO,IAAI,CAACC,IAAI;AAClB,EAAA;EAEA,IAAIC,WAAAA,GAAuB;AACzB,IAAA,MAAMC,MAAA,GAAS,IAAI,CAACH,SAAS,CAACI,eAAe;AAE7C,IAAA,OAAOlB,QAAQiB,MAAA,IAAU,OAAOA,MAAA,KAAW,QAAA,IAAYA,OAAOD,WAAW,CAAA;AAC3E,EAAA;EAEA,IAAIG,YAAAA,GAAwB;IAC1B,OAAOnB,OAAA,CAAQ,IAAI,CAACc,SAAS,CAACM,MAAM,CAACC,QAAQ,EAAEC,MAAA,CAAA;AACjD,EAAA;AAEA;;;;EAIA,IAAIC,OAAAA,GAAmB;AACrB,IAAA,OAAO,IAAI,CAACT,SAAS,CAAC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