@ember-eui/core 16.0.1 → 16.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/declarations/-private/associate-form-row-label.d.ts +9 -0
  2. package/declarations/-private/associate-form-row-label.d.ts.map +1 -0
  3. package/declarations/-private/vis-colors.d.ts +8 -0
  4. package/declarations/-private/vis-colors.d.ts.map +1 -0
  5. package/declarations/components/eui-aspect-ratio.d.ts +5 -0
  6. package/declarations/components/eui-aspect-ratio.d.ts.map +1 -1
  7. package/declarations/components/eui-avatar.d.ts +6 -0
  8. package/declarations/components/eui-avatar.d.ts.map +1 -1
  9. package/declarations/components/eui-basic-table.d.ts.map +1 -1
  10. package/declarations/components/eui-color-picker.d.ts +3 -0
  11. package/declarations/components/eui-color-picker.d.ts.map +1 -1
  12. package/declarations/components/eui-color-stops/thumb.d.ts +3 -1
  13. package/declarations/components/eui-color-stops/thumb.d.ts.map +1 -1
  14. package/declarations/components/eui-combo-box/trigger/input.d.ts +9 -0
  15. package/declarations/components/eui-combo-box/trigger/input.d.ts.map +1 -1
  16. package/declarations/components/eui-combo-box/trigger.d.ts +13 -0
  17. package/declarations/components/eui-combo-box/trigger.d.ts.map +1 -1
  18. package/declarations/components/eui-combo-box.d.ts +26 -0
  19. package/declarations/components/eui-combo-box.d.ts.map +1 -1
  20. package/declarations/components/eui-data-grid/body.d.ts +2 -0
  21. package/declarations/components/eui-data-grid/body.d.ts.map +1 -1
  22. package/declarations/components/eui-data-grid.d.ts.map +1 -1
  23. package/declarations/components/eui-dual-range.d.ts +2 -0
  24. package/declarations/components/eui-dual-range.d.ts.map +1 -1
  25. package/declarations/components/eui-focus-trap.d.ts +1 -0
  26. package/declarations/components/eui-focus-trap.d.ts.map +1 -1
  27. package/declarations/components/eui-global-toast-list.d.ts +8 -1
  28. package/declarations/components/eui-global-toast-list.d.ts.map +1 -1
  29. package/declarations/components/eui-markdown-editor-drop-zone.d.ts.map +1 -1
  30. package/declarations/components/eui-markdown-editor.d.ts.map +1 -1
  31. package/declarations/components/eui-markdown-format.d.ts +2 -0
  32. package/declarations/components/eui-markdown-format.d.ts.map +1 -1
  33. package/declarations/components/eui-overlay-mask.d.ts +5 -2
  34. package/declarations/components/eui-overlay-mask.d.ts.map +1 -1
  35. package/declarations/components/eui-popover.d.ts +5 -1
  36. package/declarations/components/eui-popover.d.ts.map +1 -1
  37. package/declarations/components/eui-range.d.ts +3 -0
  38. package/declarations/components/eui-range.d.ts.map +1 -1
  39. package/declarations/components/eui-saturation.d.ts +3 -1
  40. package/declarations/components/eui-saturation.d.ts.map +1 -1
  41. package/declarations/components/eui-search-bar/field-value-selection-filter.d.ts.map +1 -1
  42. package/declarations/components/eui-text-color.d.ts +6 -0
  43. package/declarations/components/eui-text-color.d.ts.map +1 -1
  44. package/declarations/components/eui-text.d.ts.map +1 -1
  45. package/declarations/components/eui-token.d.ts +11 -0
  46. package/declarations/components/eui-token.d.ts.map +1 -1
  47. package/declarations/components/eui-tool-tip.d.ts +1 -2
  48. package/declarations/components/eui-tool-tip.d.ts.map +1 -1
  49. package/declarations/modifiers/outside-click-detector.d.ts +3 -0
  50. package/declarations/modifiers/outside-click-detector.d.ts.map +1 -1
  51. package/declarations/modifiers/resize-observer.d.ts +3 -0
  52. package/declarations/modifiers/resize-observer.d.ts.map +1 -1
  53. package/declarations/services/eui-config.d.ts +5 -0
  54. package/declarations/services/eui-config.d.ts.map +1 -1
  55. package/declarations/utils/common.d.ts +42 -0
  56. package/declarations/utils/common.d.ts.map +1 -0
  57. package/declarations/utils/css-mappings/eui-avatar.d.ts +1 -1
  58. package/declarations/utils/css-mappings/eui-text.d.ts +1 -0
  59. package/declarations/utils/css-mappings/eui-text.d.ts.map +1 -1
  60. package/declarations/utils/eui/combo-box.d.ts +1 -1
  61. package/declarations/utils/eui/combo-box.d.ts.map +1 -1
  62. package/declarations/utils/eui/content-blocks.d.ts +14 -0
  63. package/declarations/utils/eui/content-blocks.d.ts.map +1 -0
  64. package/declarations/utils/eui/flyout-manager/reducer.d.ts.map +1 -1
  65. package/declarations/utils/eui/styles.d.ts +5 -0
  66. package/declarations/utils/eui/styles.d.ts.map +1 -1
  67. package/declarations/utils/retain-document-listener.d.ts +8 -0
  68. package/declarations/utils/retain-document-listener.d.ts.map +1 -0
  69. package/declarations/utils/token-map.d.ts +11 -0
  70. package/declarations/utils/token-map.d.ts.map +1 -0
  71. package/declarations/utils/transition.d.ts +1 -1
  72. package/declarations/utils/transition.d.ts.map +1 -1
  73. package/dist/components/eui-aspect-ratio.js +20 -5
  74. package/dist/components/eui-aspect-ratio.js.map +1 -1
  75. package/dist/components/eui-avatar.js +16 -4
  76. package/dist/components/eui-avatar.js.map +1 -1
  77. package/dist/components/eui-basic-table.js +4 -2
  78. package/dist/components/eui-basic-table.js.map +1 -1
  79. package/dist/components/eui-color-picker.js +8 -2
  80. package/dist/components/eui-color-picker.js.map +1 -1
  81. package/dist/components/eui-color-stops/thumb.js +17 -5
  82. package/dist/components/eui-color-stops/thumb.js.map +1 -1
  83. package/dist/components/eui-combo-box/trigger/input.js +23 -2
  84. package/dist/components/eui-combo-box/trigger/input.js.map +1 -1
  85. package/dist/components/eui-combo-box/trigger.js +32 -2
  86. package/dist/components/eui-combo-box/trigger.js.map +1 -1
  87. package/dist/components/eui-combo-box.js +40 -5
  88. package/dist/components/eui-combo-box.js.map +1 -1
  89. package/dist/components/eui-data-grid/body.js +21 -1
  90. package/dist/components/eui-data-grid/body.js.map +1 -1
  91. package/dist/components/eui-data-grid.js +6 -4
  92. package/dist/components/eui-data-grid.js.map +1 -1
  93. package/dist/components/eui-dual-range.js +5 -2
  94. package/dist/components/eui-dual-range.js.map +1 -1
  95. package/dist/components/eui-focus-trap.js +4 -1
  96. package/dist/components/eui-focus-trap.js.map +1 -1
  97. package/dist/components/eui-global-toast-list.js +33 -5
  98. package/dist/components/eui-global-toast-list.js.map +1 -1
  99. package/dist/components/eui-markdown-editor-drop-zone.js +2 -0
  100. package/dist/components/eui-markdown-editor-drop-zone.js.map +1 -1
  101. package/dist/components/eui-markdown-editor.js +3 -1
  102. package/dist/components/eui-markdown-editor.js.map +1 -1
  103. package/dist/components/eui-markdown-format.js +9 -3
  104. package/dist/components/eui-markdown-format.js.map +1 -1
  105. package/dist/components/eui-overlay-mask.js +2 -0
  106. package/dist/components/eui-overlay-mask.js.map +1 -1
  107. package/dist/components/eui-popover.js +22 -2
  108. package/dist/components/eui-popover.js.map +1 -1
  109. package/dist/components/eui-range.js +10 -3
  110. package/dist/components/eui-range.js.map +1 -1
  111. package/dist/components/eui-saturation.js +16 -4
  112. package/dist/components/eui-saturation.js.map +1 -1
  113. package/dist/components/eui-search-bar/field-value-selection-filter.js +8 -3
  114. package/dist/components/eui-search-bar/field-value-selection-filter.js.map +1 -1
  115. package/dist/components/eui-text-color.js +20 -6
  116. package/dist/components/eui-text-color.js.map +1 -1
  117. package/dist/components/eui-text.js +6 -3
  118. package/dist/components/eui-text.js.map +1 -1
  119. package/dist/components/eui-token.js +31 -17
  120. package/dist/components/eui-token.js.map +1 -1
  121. package/dist/components/eui-tool-tip.js +9 -17
  122. package/dist/components/eui-tool-tip.js.map +1 -1
  123. package/dist/icons-DCTZo11a.js.map +1 -1
  124. package/dist/modifiers/outside-click-detector.js +12 -2
  125. package/dist/modifiers/outside-click-detector.js.map +1 -1
  126. package/dist/modifiers/resize-observer.js +19 -4
  127. package/dist/modifiers/resize-observer.js.map +1 -1
  128. package/dist/services/eui-config.js.map +1 -1
  129. package/dist/utils/eui/combo-box.js +6 -2
  130. package/dist/utils/eui/combo-box.js.map +1 -1
  131. package/dist/utils/eui/flyout-manager/reducer.js +7 -1
  132. package/dist/utils/eui/flyout-manager/reducer.js.map +1 -1
  133. package/dist/utils/eui/styles.js +5 -0
  134. package/dist/utils/eui/styles.js.map +1 -1
  135. package/dist/utils/retain-document-listener.js +30 -0
  136. package/dist/utils/retain-document-listener.js.map +1 -0
  137. package/dist/utils/transition.js +8 -3
  138. package/dist/utils/transition.js.map +1 -1
  139. package/package.json +2 -2
  140. package/declarations/modifiers/open-collapsible-nav.d.ts +0 -9
  141. package/declarations/modifiers/open-collapsible-nav.d.ts.map +0 -1
@@ -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,CAAC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,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,G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AAA;QAAAC,EAAA;QAAAjH,YAAA;QAAAkH,cAAA;QAAA7G,QAAA;QAAAD,UAAA;QAAA+G,YAAA;yBAAAC,wBAAA;QAAAC,GAAA;QAAAC,GAAA;QAAAC,EAAA;yBAAAC,wBAAA;QAAAC,EAAA;QAAAC,QAAA;QAAApH,UAAA;iCAAAqH,gCAAA;QAAAC,mBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -65,13 +65,25 @@ class EuiComboBoxComponent extends Component {
65
65
  g(this.prototype, "euiI18n", [service]);
66
66
  }
67
67
  #euiI18n = (i(this, "euiI18n"), void 0);
68
+ static {
69
+ g(this.prototype, "euiConfig", [service('eui-config')]);
70
+ }
71
+ #euiConfig = (i(this, "euiConfig"), void 0);
72
+ /**
73
+ * `@ignoreAccents`, else the app's `euiComboBox.ignoreAccents`
74
+ * (eui-config), else `false` (upstream).
75
+ */
76
+ get ignoreAccents() {
77
+ return this.args.ignoreAccents ?? this.euiConfig?.getConfig('euiComboBox.ignoreAccents') ?? false;
78
+ }
79
+ // UI state only: everything else is derived from the arguments
80
+ /** ember-power-select's API (open state, highlighted option, …). */
68
81
  static {
69
82
  g(this.prototype, "select", [tracked], function () {
70
83
  return null;
71
84
  });
72
85
  }
73
- #select = (i(this, "select"), void 0); // UI state only: everything else is derived from the arguments
74
- /** ember-power-select's API (open state, highlighted option, …). */
86
+ #select = (i(this, "select"), void 0);
75
87
  static {
76
88
  g(this.prototype, "searchValue", [tracked], function () {
77
89
  return '';
@@ -258,7 +270,7 @@ class EuiComboBoxComponent extends Component {
258
270
  searchValue
259
271
  }) => matcher(option, searchValue) >= 0;
260
272
  }
261
- return createPartialStringEqualityOptionMatcher(searchField);
273
+ return createPartialStringEqualityOptionMatcher(searchField, this.ignoreAccents);
262
274
  }
263
275
  /** Upstream `getMatchingOptions` (with group titles) for a search text. */
264
276
  static {
@@ -440,7 +452,7 @@ class EuiComboBoxComponent extends Component {
440
452
  /** ember-power-select must not filter the matches again. */
441
453
  matchAll = () => 0;
442
454
  static {
443
- setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n\n<PowerSelect @multiple={{true}} {{spreadAttributes @inputPopoverProps this.inputPopoverArgs}} ...attributes @onChange={{this.onChange}} @onFocus={{this.onFocus}} @onBlur={{this.onBlur}} @onOpen={{this.onOpen}} @onClose={{this.onClose}} @placeholderComponent={{@placeholderComponent}} @searchMessage={{this.searchMessage}} @searchMessageComponent={{if @searchMessageComponent @searchMessageComponent EuiComboBoxSearchMessage}} @noMatchesMessage={{this.noMatchesMessage}} @matchTriggerWidth={{@matchTriggerWidth}} @options={{this.powerSelectOptions}} @selected={{@selectedOptions}} @closeOnSelect={{this.closeOnSelect}} @defaultHighlighted={{if @defaultHighlighted @defaultHighlighted this.defaultHighlighted}} @highlightOnHover={{false}} @searchField={{@searchField}} @searchEnabled={{argOrDefault @searchEnabled true}} @tabindex={{if (argOrDefault @searchEnabled true) \"-1\" @tabindex}} @initiallyOpened={{and (not @isDisabled) @autoFocus (not @noSuggestions)}} @triggerComponent={{component EuiComboBoxTrigger fullWidth=@fullWidth compressed=@compressed isInvalid=this.markAsInvalid singleSelection=@singleSelection onClose=@removeTag isLoading=@isLoading autoFocus=(and (not @isDisabled) @autoFocus) icon=@triggerIcon prepend=@prepend append=@append noSuggestions=@noSuggestions inputTabindex=@tabindex inputRef=@inputRef inputRole=@triggerRole inputAriaLabel=@ariaLabel inputAriaLabelledBy=@ariaLabelledBy inputRequired=@required onClear=this.clearSelectedOptions onToggleList=this.onToggleListClick onToggleBlur=this.onToggleBlur onToggleKeydown=this.onToggleKeydown onPlainTextClick=this.onPlainTextClick screenReaderInstructions=this.screenReaderInstructions}} @matcher={{this.matchAll}} @initiallyOpen={{@initiallyOpen}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @buildSelection={{this.buildSelection}} @search={{this.search}} @onInput={{this.onInput}} @onKeydown={{this.onKeydown}} @scrollTo={{this.scrollTo}} @registerAPI={{queue this.registerAPI (optional @registerApi)}} @horizontalPosition={{@horizontalPosition}} @destination={{@destination}} @preventScroll={{@preventScroll}} @renderInPlace={{@renderInPlace}} @verticalPosition={{this.verticalPosition}} @disabled={{@isDisabled}} @calculatePosition={{this.calculatePosition}} @eventType={{@eventType}} @ariaLabel={{unless (argOrDefault @searchEnabled true) @ariaLabel}} @ariaLabelledBy={{unless (argOrDefault @searchEnabled true) @ariaLabelledBy}} @required={{unless (argOrDefault @searchEnabled true) @required}} @triggerRole={{if (argOrDefault @searchEnabled true) \"presentation\" @triggerRole}} @title={{@title}} @triggerId={{@triggerId}} @allowClear={{and (argOrDefault @isClearable true) (not @isDisabled)}} @loadingMessage={{this.loadingMessage}} @selectedItemComponent={{@selectedItemComponent}} @beforeOptionsComponent={{@beforeOptionsComponent}} @afterOptionsComponent={{if @afterOptionsComponent @afterOptionsComponent (if (and @onCreateOption (not this.select.loading) (not this.isLoadingOptions) this.searchValue this.alwaysShowCreateOption (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=true delimiter=@delimiter))}} @placeholder={{@placeholder}} @searchPlaceholder={{@searchPlaceholder}} @optionsComponent={{component EuiComboBoxOptions rowHeight=@rowHeight truncationProps=@truncationProps class=@optionsClass singleSelection=(if @singleSelection true false) selectedOptions=this.selectedOptions searchField=@searchField isLoading=this.isLoadingOptions onFocusBadge=@onFocusBadge listboxAriaLabel=this.listboxAriaLabel}} @extra={{@extra}} @groupComponent={{component EuiComboBoxGroup}} @triggerClass={{classNames \"euiComboBox\" this.rootClass @inputPopoverProps.className (if @isDisabled \"euiComboBox-isDisabled\") (if this.markAsInvalid \"euiComboBox-isInvalid\") (if this.select.isOpen \"euiComboBox-isOpen\")}} @noMatchesMessageComponent={{if this.isLoadingOptions (component EuiComboBoxOptions isLoading=true loadingMessage=this.loadingMessage) (if (and @onCreateOption this.searchValue (not this.alwaysShowCreateOption) (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=false delimiter=@delimiter) (component EuiComboBoxNoMatchesMessage message=(if this.alreadyAddedMessage this.alreadyAddedMessage this.emptyStateMessage)))}} @dropdownClass={{this.dropdownClass}} as |option i|>\n {{#if (has-block)}}\n {{yield option i (if (this.isOptionRow i) this.searchValue \"\")}}\n {{else if (this.isOptionRow i)}}\n <EuiComboBoxOptionText @text={{this.labelFor option}} @search={{this.searchValue}} @isCaseSensitive={{@isCaseSensitive}} @rowHeight={{@rowHeight}} @truncationProps={{this.truncationFor option}} @width={{this.optionWidth}} @onResize={{this.setOptionWidth}} />\n {{else}}\n {{this.labelFor option}}\n {{/if}}\n</PowerSelect>", {
455
+ setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n\n<PowerSelect @multiple={{true}} {{spreadAttributes @inputPopoverProps this.inputPopoverArgs}} ...attributes @onChange={{this.onChange}} @onFocus={{this.onFocus}} @onBlur={{this.onBlur}} @onOpen={{this.onOpen}} @onClose={{this.onClose}} @placeholderComponent={{@placeholderComponent}} @searchMessage={{this.searchMessage}} @searchMessageComponent={{if @searchMessageComponent @searchMessageComponent EuiComboBoxSearchMessage}} @noMatchesMessage={{this.noMatchesMessage}} @matchTriggerWidth={{@matchTriggerWidth}} @options={{this.powerSelectOptions}} @selected={{@selectedOptions}} @closeOnSelect={{this.closeOnSelect}} @defaultHighlighted={{if @defaultHighlighted @defaultHighlighted this.defaultHighlighted}} @highlightOnHover={{false}} @searchField={{@searchField}} @searchEnabled={{argOrDefault @searchEnabled true}} @tabindex={{if (argOrDefault @searchEnabled true) \"-1\" @tabindex}} @initiallyOpened={{and (not @isDisabled) @autoFocus (not @noSuggestions)}} @triggerComponent={{component EuiComboBoxTrigger fullWidth=@fullWidth compressed=@compressed isInvalid=this.markAsInvalid singleSelection=@singleSelection hasOptionBlock=(has-block) onClose=@removeTag isLoading=@isLoading autoFocus=(and (not @isDisabled) @autoFocus) icon=@triggerIcon prepend=@prepend append=@append noSuggestions=@noSuggestions inputTabindex=@tabindex inputRef=@inputRef inputRole=@triggerRole inputAriaLabel=@ariaLabel inputAriaLabelledBy=@ariaLabelledBy inputRequired=@required onClear=this.clearSelectedOptions onToggleList=this.onToggleListClick onToggleBlur=this.onToggleBlur onToggleKeydown=this.onToggleKeydown onPlainTextClick=this.onPlainTextClick screenReaderInstructions=this.screenReaderInstructions}} @matcher={{this.matchAll}} @initiallyOpen={{@initiallyOpen}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @buildSelection={{this.buildSelection}} @search={{this.search}} @onInput={{this.onInput}} @onKeydown={{this.onKeydown}} @scrollTo={{this.scrollTo}} @registerAPI={{queue this.registerAPI (optional @registerApi)}} @horizontalPosition={{@horizontalPosition}} @destination={{@destination}} @preventScroll={{@preventScroll}} @renderInPlace={{@renderInPlace}} @verticalPosition={{this.verticalPosition}} @disabled={{@isDisabled}} @calculatePosition={{this.calculatePosition}} @eventType={{@eventType}} @ariaLabel={{unless (argOrDefault @searchEnabled true) @ariaLabel}} @ariaLabelledBy={{unless (argOrDefault @searchEnabled true) @ariaLabelledBy}} @required={{unless (argOrDefault @searchEnabled true) @required}} @triggerRole={{if (argOrDefault @searchEnabled true) \"presentation\" @triggerRole}} @title={{@title}} @triggerId={{@triggerId}} @allowClear={{and (argOrDefault @isClearable true) (not @isDisabled)}} @loadingMessage={{this.loadingMessage}} @selectedItemComponent={{@selectedItemComponent}} @beforeOptionsComponent={{@beforeOptionsComponent}} @afterOptionsComponent={{if @afterOptionsComponent @afterOptionsComponent (if (and @onCreateOption (not this.select.loading) (not this.isLoadingOptions) this.searchValue this.alwaysShowCreateOption (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=true delimiter=@delimiter))}} @placeholder={{@placeholder}} @searchPlaceholder={{@searchPlaceholder}} @optionsComponent={{component EuiComboBoxOptions rowHeight=@rowHeight truncationProps=@truncationProps class=@optionsClass singleSelection=(if @singleSelection true false) selectedOptions=this.selectedOptions searchField=@searchField isLoading=this.isLoadingOptions onFocusBadge=@onFocusBadge listboxAriaLabel=this.listboxAriaLabel}} @extra={{@extra}} @groupComponent={{component EuiComboBoxGroup}} @triggerClass={{classNames \"euiComboBox\" this.rootClass @inputPopoverProps.className (if @isDisabled \"euiComboBox-isDisabled\") (if this.markAsInvalid \"euiComboBox-isInvalid\") (if this.select.isOpen \"euiComboBox-isOpen\")}} @noMatchesMessageComponent={{if this.isLoadingOptions (component EuiComboBoxOptions isLoading=true loadingMessage=this.loadingMessage) (if (and @onCreateOption this.searchValue (not this.alwaysShowCreateOption) (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=false delimiter=@delimiter) (component EuiComboBoxNoMatchesMessage message=(if this.alreadyAddedMessage this.alreadyAddedMessage this.emptyStateMessage)))}} @dropdownClass={{this.dropdownClass}} as |option i|>\n {{#if (has-block)}}\n {{yield option i (if (this.isOptionRow i) this.searchValue \"\")}}\n {{else if (this.isOptionRow i)}}\n <EuiComboBoxOptionText @text={{this.labelFor option}} @search={{this.searchValue}} @isCaseSensitive={{@isCaseSensitive}} @rowHeight={{@rowHeight}} @truncationProps={{this.truncationFor option}} @width={{this.optionWidth}} @onResize={{this.setOptionWidth}} />\n {{else}}\n {{this.labelFor option}}\n {{/if}}\n</PowerSelect>", {
444
456
  strictMode: true,
445
457
  scope: () => ({
446
458
  PowerSelect,
@@ -975,6 +987,22 @@ class EuiComboBoxComponent extends Component {
975
987
  if (api?.highlighted !== undefined) api.actions.highlight?.(undefined);
976
988
  return;
977
989
  }
990
+ if (!next) {
991
+ // Focus left for nowhere, which is also what Chrome reports when it
992
+ // blurs the focused input while Glimmer removes the combo box. That
993
+ // happens inside the render, which has already read ember-basic-
994
+ // dropdown's `_isOpen`, so closing the list there trips an autotracking
995
+ // assertion (development builds). Leave after the render instead, and
996
+ // not at all when the combo box is being torn down.
997
+ schedule('actions', this, this.leaveComboBox, event, api);
998
+ return;
999
+ }
1000
+ this.leaveComboBox(event, api);
1001
+ }
1002
+ /** The rest of `containerBlur`: focus has left the combo box. */
1003
+ leaveComboBox(event, blurApi) {
1004
+ if (this.isDestroying || this.isDestroyed) return;
1005
+ const api = this.select ?? blurApi;
978
1006
  this.args.onBlur?.(api, event);
979
1007
  const hasActiveOption = Boolean(api?.isOpen && api.highlighted !== undefined);
980
1008
  this.hasFocus = false;
@@ -1117,7 +1145,14 @@ function toList(collection) {
1117
1145
  if (!collection) return [];
1118
1146
  if (Array.isArray(collection)) return collection;
1119
1147
  if (isArray(collection)) {
1120
- return collection.slice();
1148
+ // Ember arrays, ArrayProxy, PromiseManyArray (ember-data), …
1149
+ const list = collection;
1150
+ if (typeof list.slice === 'function') return list.slice();
1151
+ if (typeof list.toArray === 'function') return list.toArray();
1152
+ if (typeof list[Symbol.iterator] === 'function') {
1153
+ return Array.from(list);
1154
+ }
1155
+ return list.content ? toList(list.content) : [];
1121
1156
  }
1122
1157
  return [];
1123
1158
  }