@ember-eui/core 13.0.2 → 13.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 (35) hide show
  1. package/declarations/components/eui-call-out.d.ts +3 -0
  2. package/declarations/components/eui-call-out.d.ts.map +1 -1
  3. package/declarations/components/eui-combo-box/create-option.d.ts +18 -1
  4. package/declarations/components/eui-combo-box/create-option.d.ts.map +1 -1
  5. package/declarations/components/eui-combo-box/options.d.ts.map +1 -1
  6. package/declarations/components/eui-combo-box.d.ts +5 -1
  7. package/declarations/components/eui-combo-box.d.ts.map +1 -1
  8. package/declarations/components/eui-field-number.d.ts.map +1 -1
  9. package/declarations/components/eui-field-text.d.ts.map +1 -1
  10. package/declarations/components/eui-popover.d.ts +3 -2
  11. package/declarations/components/eui-popover.d.ts.map +1 -1
  12. package/declarations/components/eui-switch.d.ts +1 -1
  13. package/declarations/components/eui-switch.d.ts.map +1 -1
  14. package/declarations/components/eui-text-area.d.ts +1 -0
  15. package/declarations/components/eui-text-area.d.ts.map +1 -1
  16. package/dist/components/eui-call-out.js +1 -1
  17. package/dist/components/eui-call-out.js.map +1 -1
  18. package/dist/components/eui-code-block.js +1 -1
  19. package/dist/components/eui-code-block.js.map +1 -1
  20. package/dist/components/eui-combo-box/create-option.js +39 -9
  21. package/dist/components/eui-combo-box/create-option.js.map +1 -1
  22. package/dist/components/eui-combo-box/options.js +4 -2
  23. package/dist/components/eui-combo-box/options.js.map +1 -1
  24. package/dist/components/eui-combo-box.js +7 -4
  25. package/dist/components/eui-combo-box.js.map +1 -1
  26. package/dist/components/eui-field-number.js +1 -1
  27. package/dist/components/eui-field-number.js.map +1 -1
  28. package/dist/components/eui-field-text.js +1 -1
  29. package/dist/components/eui-field-text.js.map +1 -1
  30. package/dist/components/eui-popover.js +11 -5
  31. package/dist/components/eui-popover.js.map +1 -1
  32. package/dist/components/eui-switch.js.map +1 -1
  33. package/dist/components/eui-text-area.js +1 -1
  34. package/dist/components/eui-text-area.js.map +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sources":["../../../src/components/eui-combo-box/options.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport willDestroy from '@ember/render-modifiers/modifiers/will-destroy';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { EnsureSafeComponentHelper } from '@embroider/util';\n\n//@ts-expect-error\nimport VerticalCollection from '@html-next/vertical-collection/components/vertical-collection/component';\nimport EmberPowerSelectOptions from 'ember-power-select/components/power-select/options';\nimport emberPowerSelectIsGroupHelper, {\n emberPowerSelectIsGroup\n} from 'ember-power-select/helpers/ember-power-select-is-group';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport EuiBadge from '../eui-badge.gts';\nimport EuiFlexGroup from '../eui-flex-group.gts';\nimport EuiFlexItem from '../eui-flex-item.gts';\nimport EuiLoadingSpinner from '../eui-loading-spinner.gts';\nimport EuiText from '../eui-text.gts';\n\nimport type EuiConfigService from '../../services/eui-config';\nimport emberPowerSelectIsEqual from 'ember-power-select/helpers/ember-power-select-is-equal';\n\nexport default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {\n @service declare euiConfig: EuiConfigService;\n _optionsCache: any[] = [];\n\n get flattedOptions() {\n if (this._optionsCache !== this.args.options) {\n this._optionsCache = this.args.options;\n\n return this.args.options?.reduce((acc, curr) => {\n if (emberPowerSelectIsGroup([curr])) {\n acc.push(curr, ...curr.options);\n } else {\n acc.push(curr);\n }\n\n return acc;\n }, []);\n }\n\n return this._optionsCache;\n }\n\n _optionFromIndex(index: string) {\n let parts = index.split('.');\n let option = this.flattedOptions.at?.(parseInt(parts[0]!, 10));\n\n for (let i = 1; i < parts.length; i++) {\n option = option.options[parseInt(parts[i]!, 10)];\n }\n\n return option;\n }\n\n get configRowHeight() {\n return (\n (this.euiConfig.getConfig('euiComboBoxOptionsHeight') as number) || 29\n );\n }\n\n get rowHeight() {\n //@ts-expect-error\n return this.args.rowHeight ?? this.configRowHeight;\n }\n\n get rowHeightString() {\n return htmlSafe(`height:${this.rowHeight}px;`);\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n {{#let (component (EnsureSafeComponentHelper @groupComponent)) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup\n @gutterSize=\"s\"\n @justifyContent=\"center\"\n @responsive={{false}}\n >\n <EuiFlexItem @grow={{false}}>\n <EuiLoadingSpinner @size=\"m\" />\n </EuiFlexItem>\n <EuiFlexItem @grow={{false}}>\n {{@loadingMessage}}\n </EuiFlexItem>\n </EuiFlexGroup>\n </EuiText>\n {{else}}\n {{! template-lint-disable }}\n <VerticalCollection\n @items={{this.flattedOptions}}\n @tagName=\"div\"\n @estimateHeight={{this.rowHeight}}\n @staticHeight={{true}}\n @bufferSize={{3}}\n style=\"max-height: 200px; overflow-y: auto;\"\n role=\"listbox\"\n aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\"\n class={{@class}}\n {{didInsert this.addHandlers}}\n {{willDestroy this.removeHandlers}}\n ...attributes\n as |opt index|\n >\n {{! template-lint-enable }}\n {{#if (emberPowerSelectIsGroupHelper opt)}}\n <Group\n @group={{opt}}\n @select={{@select}}\n @extra={{@extra}}\n style={{this.rowHeightString}}\n data-option-index=\"{{index}}\"\n />\n {{else}}\n <li\n style={{this.rowHeightString}}\n class=\"euiFilterSelectItem\n {{if\n (eq opt @select.highlighted)\n ' euiFilterSelectItem-isFocused'\n }}\"\n aria-selected=\"{{emberPowerSelectIsEqual opt @select.selected}}\"\n aria-disabled={{if opt.disabled \"true\"}}\n aria-current=\"{{eq opt @select.highlighted}}\"\n data-option-index=\"{{index}}\"\n role=\"option\"\n tabindex={{if opt.disabled \"-1\" \"0\"}}\n >\n <span class=\"euiComboBoxOption__contentWrapper\">\n <span class=\"euiComboBoxOption__content\">\n {{yield opt index @select}}\n </span>\n {{#if (and (eq opt @select.highlighted) (not opt.disabled))}}\n <EuiBadge\n class=\"euiComboBoxOption__enterBadge\"\n @color=\"hollow\"\n @iconType=\"returnKey\"\n aria-hidden=\"true\"\n />\n {{/if}}\n </span>\n </li>\n {{/if}}\n </VerticalCollection>\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiComboBoxOptionsComponent","EmberPowerSelectOptions","g","prototype","service","i","void 0","_optionsCache","flattedOptions","args","options","reduce","acc","curr","emberPowerSelectIsGroup","push","_optionFromIndex","index","parts","split","option","at","parseInt","length","configRowHeight","euiConfig","getConfig","rowHeight","rowHeightString","htmlSafe","setComponentTemplate","precompileTemplate","strictMode","scope","EnsureSafeComponentHelper","EuiText","EuiFlexGroup","EuiFlexItem","EuiLoadingSpinner","VerticalCollection","didInsert","willDestroy","emberPowerSelectIsGroupHelper","eq","emberPowerSelectIsEqual","and","not","EuiBadge"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBe,MAAMA,2BAAoC,SAAAC,uBAAA,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACtDC,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;AACDC,EAAAA,aAAe,GAAQ,EAAE;EAEzB,IAAIC,cAAiBA,GAAA;IACnB,IAAI,IAAI,CAACD,aAAa,KAAK,IAAI,CAACE,IAAI,CAACC,OAAO,EAAE;AAC5C,MAAA,IAAI,CAACH,aAAa,GAAG,IAAI,CAACE,IAAI,CAACC,OAAO;AAEtC,MAAA,OAAO,IAAI,CAACD,IAAI,CAACC,OAAO,EAAEC,MAAA,CAAO,CAACC,GAAK,EAAAC,IAAA,KAAA;AACrC,QAAA,IAAIC,uBAAwB,CAAA,CAACD,IAAA,CAAK,CAAG,EAAA;UACnCD,GAAA,CAAIG,IAAI,CAACF,IAAS,EAAA,GAAAA,IAAA,CAA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AC,6BAAA;QAAAC,EAAA;QAAAC,uBAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"options.js","sources":["../../../src/components/eui-combo-box/options.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport willDestroy from '@ember/render-modifiers/modifiers/will-destroy';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { EnsureSafeComponentHelper } from '@embroider/util';\n\n//@ts-expect-error\nimport VerticalCollection from '@html-next/vertical-collection/components/vertical-collection/component';\nimport EmberPowerSelectOptions from 'ember-power-select/components/power-select/options';\nimport emberPowerSelectIsEqual from 'ember-power-select/helpers/ember-power-select-is-equal';\nimport emberPowerSelectIsGroupHelper, {\n emberPowerSelectIsGroup\n} from 'ember-power-select/helpers/ember-power-select-is-group';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport classNames from '../../helpers/class-names.ts';\nimport EuiBadge from '../eui-badge.gts';\nimport EuiFlexGroup from '../eui-flex-group.gts';\nimport EuiFlexItem from '../eui-flex-item.gts';\nimport EuiLoadingSpinner from '../eui-loading-spinner.gts';\nimport EuiText from '../eui-text.gts';\n\nimport type EuiConfigService from '../../services/eui-config';\n\nexport default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {\n @service declare euiConfig: EuiConfigService;\n _optionsCache: any[] = [];\n\n get flattedOptions() {\n if (this._optionsCache !== this.args.options) {\n this._optionsCache = this.args.options;\n\n return this.args.options?.reduce((acc, curr) => {\n if (emberPowerSelectIsGroup([curr])) {\n acc.push(curr, ...curr.options);\n } else {\n acc.push(curr);\n }\n\n return acc;\n }, []);\n }\n\n return this._optionsCache;\n }\n\n _optionFromIndex(index: string) {\n let parts = index.split('.');\n let option = this.flattedOptions.at?.(parseInt(parts[0]!, 10));\n\n for (let i = 1; i < parts.length; i++) {\n option = option.options[parseInt(parts[i]!, 10)];\n }\n\n return option;\n }\n\n get configRowHeight() {\n return (\n (this.euiConfig.getConfig('euiComboBoxOptionsHeight') as number) || 29\n );\n }\n\n get rowHeight() {\n //@ts-expect-error\n return this.args.rowHeight ?? this.configRowHeight;\n }\n\n get rowHeightString() {\n return htmlSafe(`height:${this.rowHeight}px;`);\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n {{#let (component (EnsureSafeComponentHelper @groupComponent)) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup\n @gutterSize=\"s\"\n @justifyContent=\"center\"\n @responsive={{false}}\n >\n <EuiFlexItem @grow={{false}}>\n <EuiLoadingSpinner @size=\"m\" />\n </EuiFlexItem>\n <EuiFlexItem @grow={{false}}>\n {{@loadingMessage}}\n </EuiFlexItem>\n </EuiFlexGroup>\n </EuiText>\n {{else}}\n {{! template-lint-disable }}\n <VerticalCollection\n @items={{this.flattedOptions}}\n @tagName=\"div\"\n @estimateHeight={{this.rowHeight}}\n @staticHeight={{true}}\n @bufferSize={{3}}\n style=\"overflow-y: auto;\"\n role=\"listbox\"\n aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\"\n class={{classNames \"euiComboBoxOptionsList__rowWrap\" @class}}\n {{didInsert this.addHandlers}}\n {{willDestroy this.removeHandlers}}\n ...attributes\n as |opt index|\n >\n {{! template-lint-enable }}\n {{#if (emberPowerSelectIsGroupHelper opt)}}\n <Group\n @group={{opt}}\n @select={{@select}}\n @extra={{@extra}}\n style={{this.rowHeightString}}\n data-option-index=\"{{index}}\"\n />\n {{else}}\n <button\n type=\"button\"\n style={{this.rowHeightString}}\n class=\"euiFilterSelectItem\n {{if\n (eq opt @select.highlighted)\n ' euiFilterSelectItem-isFocused'\n }}\"\n aria-selected=\"{{emberPowerSelectIsEqual opt @select.selected}}\"\n aria-disabled={{if opt.disabled \"true\"}}\n aria-current=\"{{eq opt @select.highlighted}}\"\n data-option-index=\"{{index}}\"\n role=\"option\"\n tabindex={{if opt.disabled \"-1\" \"0\"}}\n >\n <span class=\"euiComboBoxOption__contentWrapper\">\n <span class=\"euiComboBoxOption__content\">\n {{yield opt index @select}}\n </span>\n {{#if (and (eq opt @select.highlighted) (not opt.disabled))}}\n {{!template-lint-disable require-presentational-children}}\n <EuiBadge\n class=\"euiComboBoxOption__enterBadge\"\n @color=\"hollow\"\n @iconType=\"returnKey\"\n aria-hidden=\"true\"\n />\n {{/if}}\n </span>\n </button>\n {{/if}}\n </VerticalCollection>\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiComboBoxOptionsComponent","EmberPowerSelectOptions","g","prototype","service","i","void 0","_optionsCache","flattedOptions","args","options","reduce","acc","curr","emberPowerSelectIsGroup","push","_optionFromIndex","index","parts","split","option","at","parseInt","length","configRowHeight","euiConfig","getConfig","rowHeight","rowHeightString","htmlSafe","setComponentTemplate","precompileTemplate","strictMode","scope","EnsureSafeComponentHelper","EuiText","EuiFlexGroup","EuiFlexItem","EuiLoadingSpinner","VerticalCollection","classNames","didInsert","willDestroy","emberPowerSelectIsGroupHelper","eq","emberPowerSelectIsEqual","and","not","EuiBadge"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBe,MAAMA,2BAAoC,SAAAC,uBAAA,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACtDC,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;AACDC,EAAAA,aAAe,GAAQ,EAAE;EAEzB,IAAIC,cAAiBA,GAAA;IACnB,IAAI,IAAI,CAACD,aAAa,KAAK,IAAI,CAACE,IAAI,CAACC,OAAO,EAAE;AAC5C,MAAA,IAAI,CAACH,aAAa,GAAG,IAAI,CAACE,IAAI,CAACC,OAAO;AAEtC,MAAA,OAAO,IAAI,CAACD,IAAI,CAACC,OAAO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A;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,yBAAA;iBAAAC,gBAAA;QAAAC,YAAA;QAAAC,WAAA;QAAAC,iBAAA;QAAAC,kBAAA;QAAAC,UAAA;QAAAC,SAAA;QAAAC,WAAA;QAAAC,6BAAA;QAAAC,EAAA;QAAAC,uBAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1,10 +1,10 @@
1
+ import 'ember-basic-dropdown/styles';
1
2
  import Component from '@glimmer/component';
2
3
  import { tracked, cached } from '@glimmer/tracking';
3
4
  import { isArray } from '@ember/array';
4
5
  import { action } from '@ember/object';
5
6
  import { inject } from '@ember/service';
6
7
  import { isEqual } from '@ember/utils';
7
- import 'ember-basic-dropdown/styles';
8
8
  import optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';
9
9
  import queue from '@nullvoxpopuli/ember-composable-helpers/helpers/queue';
10
10
  import PowerSelectMultiple from 'ember-power-select/components/power-select-multiple';
@@ -12,7 +12,7 @@ import { emberPowerSelectIsGroup } from 'ember-power-select/helpers/ember-power-
12
12
  import { not, and } from 'ember-truth-helpers';
13
13
  import argOrDefault from '../helpers/arg-or-default.js';
14
14
  import classNames from '../helpers/class-names.js';
15
- import EuiAccordionAccordionComponent from './eui-combo-box/create-option.js';
15
+ import EuiComboBoxCreateOptionComponent from './eui-combo-box/create-option.js';
16
16
  import EuiComboBoxGroup from './eui-combo-box/group.js';
17
17
  import NoMatchesMessageComponent from './eui-combo-box/no-matches-message.js';
18
18
  import EuiComboBoxOptionsComponent from './eui-combo-box/options.js';
@@ -71,8 +71,11 @@ class EuiComboBoxComponent extends Component {
71
71
  get searchMessage() {
72
72
  return this.args.searchMessage || this.euiI18n.lookupToken('euiComboBox.searchMessage', 'Type to search');
73
73
  }
74
+ get alwaysShowCreateOption() {
75
+ return this.args.onCreateOption && this.args.alwaysShowCreateOption;
76
+ }
74
77
  static {
75
- setComponentTemplate(precompileTemplate("\n {{!-- @glint-nocheck: not typesafe yet --}}\n <PowerSelectMultiple ...attributes @onChange={{this.onChange}} @onFocus={{@onFocus}} @onBlur={{@onBlur}} @onOpen={{@onOpen}} @onClose={{@onClose}} @placeholderComponent={{@placeholderComponent}} @searchMessage={{this.searchMessage}} @searchMessageComponent={{if @searchMessageComponent @searchMessageComponent EuiComboBoxSearchMessage}} @noMatchesMessage={{this.noMatchesMessage}} @matchTriggerWidth={{@matchTriggerWidth}} @options={{this.options}} @selected={{@selectedOptions}} @closeOnSelect={{@closeOnSelect}} @defaultHighlighted={{@defaultHighlighted}} @searchField={{@searchField}} @searchEnabled={{argOrDefault @searchEnabled true}} @tabindex={{@tabindex}} @initiallyOpened={{and (not @isDisabled) @autoFocus}} @triggerComponent={{component EuiComboBoxTrigger fullWidth=@fullWidth compressed=@compressed isInvalid=@isInvalid singleSelection=@singleSelection onClose=@removeTag onCreateOption=(if @onCreateOption this.onCreateOption) isLoading=@isLoading autoFocus=(and (not @isDisabled) @autoFocus) icon=@triggerIcon}} @matcher={{@matcher}} @initiallyOpen={{@initiallyOpen}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @buildSelection={{this.buildSelection}} @search={{@search}} @onInput={{@onInput}} @onKeydown={{@onKeydown}} @scrollTo={{this.scrollTo}} @registerAPI={{queue this.registerAPI (optional @registerApi)}} @horizontalPosition={{@horizontalPosition}} @destination={{@destination}} @preventScroll={{@preventScroll}} @renderInPlace={{@renderInPlace}} @verticalPosition={{@verticalPosition}} @disabled={{@isDisabled}} @calculatePosition={{@calculatePosition}} @eventType={{@eventType}} @ariaLabel={{@ariaLabel}} @ariaLabelledBy={{@ariaLabelledBy}} @required={{@required}} @triggerRole={{@triggerRole}} @title={{@title}} @triggerId={{@triggerId}} @allowClear={{and (argOrDefault @isClearable true) (not @isDisabled)}} @loadingMessage={{this.loadingMessage}} @selectedItemComponent={{@selectedItemComponent}} @beforeOptionsComponent={{@beforeOptionsComponent}} @afterOptionsComponent={{@afterOptionsComponent}} @placeholder={{@placeholder}} @searchPlaceholder={{@searchPlaceholder}} @optionsComponent={{component EuiComboBoxOptions rowHeight=@rowHeight class=@optionsClass}} @extra={{@extra}} @groupComponent={{component EuiComboBoxGroup}} @triggerClass={{classNames \"euiComboBox\" (if @compressed \"euiComboBox--compressed\") (if @fullWidth \"euiComboBox--fullWidth\") (if @isDisabled \"euiComboBox-isDisabled\") (if @isInvalid \"euiComboBox-isInvalid\") (if this.select.isOpen \"euiComboBox-isOpen\")}} @noMatchesMessageComponent={{if @onCreateOption (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select) (component EuiComboBoxNoMatchesMessage)}} @dropdownClass=\"euiComboBoxOptionsList euiPanel euiPanel--borderRadiusMedium euiPanel--noShadow euiPanel--plain euiPopover__panel-isAttached euiPopover__panel euiPopover__panel-noArrow euiPopover__panel--bottom euiPopover__panel-isOpen euiComboBoxOptionsList__rowWrap {{@dropdownClass}}\" as |option i|>\n {{yield option i}}\n </PowerSelectMultiple>\n ", {
78
+ setComponentTemplate(precompileTemplate("\n {{!-- @glint-nocheck: not typesafe yet --}}\n\n <PowerSelectMultiple ...attributes @onChange={{this.onChange}} @onFocus={{@onFocus}} @onBlur={{@onBlur}} @onOpen={{@onOpen}} @onClose={{@onClose}} @placeholderComponent={{@placeholderComponent}} @searchMessage={{this.searchMessage}} @searchMessageComponent={{if @searchMessageComponent @searchMessageComponent EuiComboBoxSearchMessage}} @noMatchesMessage={{this.noMatchesMessage}} @matchTriggerWidth={{@matchTriggerWidth}} @options={{this.options}} @selected={{@selectedOptions}} @closeOnSelect={{@closeOnSelect}} @defaultHighlighted={{@defaultHighlighted}} @searchField={{@searchField}} @searchEnabled={{argOrDefault @searchEnabled true}} @tabindex={{@tabindex}} @initiallyOpened={{and (not @isDisabled) @autoFocus}} @triggerComponent={{component EuiComboBoxTrigger fullWidth=@fullWidth compressed=@compressed isInvalid=@isInvalid singleSelection=@singleSelection onClose=@removeTag onCreateOption=(if @onCreateOption this.onCreateOption) isLoading=@isLoading autoFocus=(and (not @isDisabled) @autoFocus) icon=@triggerIcon}} @matcher={{@matcher}} @initiallyOpen={{@initiallyOpen}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @buildSelection={{this.buildSelection}} @search={{@search}} @onInput={{@onInput}} @onKeydown={{@onKeydown}} @scrollTo={{this.scrollTo}} @registerAPI={{queue this.registerAPI (optional @registerApi)}} @horizontalPosition={{@horizontalPosition}} @destination={{@destination}} @preventScroll={{@preventScroll}} @renderInPlace={{@renderInPlace}} @verticalPosition={{@verticalPosition}} @disabled={{@isDisabled}} @calculatePosition={{@calculatePosition}} @eventType={{@eventType}} @ariaLabel={{@ariaLabel}} @ariaLabelledBy={{@ariaLabelledBy}} @required={{@required}} @triggerRole={{@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) this.select.searchText this.alwaysShowCreateOption) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=true))}} @placeholder={{@placeholder}} @searchPlaceholder={{@searchPlaceholder}} @optionsComponent={{component EuiComboBoxOptions rowHeight=@rowHeight class=@optionsClass}} @extra={{@extra}} @groupComponent={{component EuiComboBoxGroup}} @triggerClass={{classNames \"euiComboBox\" (if @compressed \"euiComboBox--compressed\") (if @fullWidth \"euiComboBox--fullWidth\") (if @isDisabled \"euiComboBox-isDisabled\") (if @isInvalid \"euiComboBox-isInvalid\") (if this.select.isOpen \"euiComboBox-isOpen\")}} @noMatchesMessageComponent={{if (and @onCreateOption (not this.alwaysShowCreateOption)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=false) (component EuiComboBoxNoMatchesMessage)}} @dropdownClass=\"euiComboBoxOptionsList euiPanel euiPanel--borderRadiusMedium euiPanel--noShadow euiPanel--plain euiPopover__panel-isAttached euiPopover__panel euiPopover__panel-noArrow euiPopover__panel--bottom euiPopover__panel-isOpen {{@dropdownClass}}\" as |option i|>\n {{yield option i}}\n </PowerSelectMultiple>\n ", {
76
79
  strictMode: true,
77
80
  scope: () => ({
78
81
  PowerSelectMultiple,
@@ -83,10 +86,10 @@ class EuiComboBoxComponent extends Component {
83
86
  EuiComboBoxTrigger: EuiComboBoxTriggerComponent,
84
87
  queue,
85
88
  optional,
89
+ EuiComboBoxCreateOption: EuiComboBoxCreateOptionComponent,
86
90
  EuiComboBoxOptions: EuiComboBoxOptionsComponent,
87
91
  EuiComboBoxGroup,
88
92
  classNames,
89
- EuiComboBoxCreateOption: EuiAccordionAccordionComponent,
90
93
  EuiComboBoxNoMatchesMessage: NoMatchesMessageComponent
91
94
  })
92
95
  }), this);
@@ -1 +1 @@
1
- {"version":3,"file":"eui-combo-box.js","sources":["../../src/components/eui-combo-box.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { isArray } from '@ember/array';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { isEqual } from '@ember/utils';\nimport 'ember-basic-dropdown/styles';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport queue from '@nullvoxpopuli/ember-composable-helpers/helpers/queue';\nimport PowerSelectMultiple from 'ember-power-select/components/power-select-multiple';\nimport { emberPowerSelectIsGroup } from 'ember-power-select/helpers/ember-power-select-is-group';\nimport { and, not } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport EuiComboBoxCreateOption from './eui-combo-box/create-option.gts';\nimport EuiComboBoxGroup from './eui-combo-box/group.gts';\nimport EuiComboBoxNoMatchesMessage from './eui-combo-box/no-matches-message.gts';\nimport EuiComboBoxOptions from './eui-combo-box/options.gts';\nimport EuiComboBoxSearchMessage from './eui-combo-box/search-message.gts';\nimport EuiComboBoxTrigger from './eui-combo-box/trigger.gts';\n\nimport type EuiI18n from '../services/eui-i18n';\n\ninterface PromiseProxy<T> extends Promise<T> {\n content: any;\n}\n\ninterface Select {\n selected: any;\n actions: {\n search: (str: string) => void;\n };\n}\n\nexport interface EuiComboBoxSignature {\n Element: HTMLDivElement;\n Args: {\n singleSelection?:\n | boolean\n | {\n asPlainText?: boolean;\n };\n onCreateOption?: (search: string) => boolean | undefined;\n options: any[];\n search?: (term: string, select: Select) => any[] | PromiseProxy<any[]>;\n searchField?: string;\n isInvalid?: boolean;\n fullWidth?: boolean;\n searchMessage?: string;\n searchEnabled?: boolean;\n isClearable?: boolean;\n isLoading?: boolean;\n isDisabled?: boolean;\n readOnly?: boolean;\n searchMessageComponent?: any;\n compressed?: boolean;\n onFocus?: (e: FocusEvent) => void;\n onBlur?: (e: FocusEvent) => void;\n onClose?: (e: Event) => void;\n onOpen?: (e: Event) => void;\n renderInPlace?: boolean;\n customOptionText?: string;\n loadingMessage?: any;\n selectedItemComponent?: any;\n beforeOptionsComponent?: any;\n placeholderComponent?: any;\n afterOptionsComponent?: any;\n searchPlaceholder?: any;\n dropdownClass?: string;\n selectedOptions?: any[];\n onChange: (selected: any[]) => void;\n placeholder?: string;\n extra?: any;\n closeOnSelect?: boolean;\n autoFocus?: boolean;\n defaultHighlighted?: any;\n matchTriggerWidth?: boolean;\n tabindex?: number;\n initiallyOpen?: boolean;\n horizontalPosition?: string;\n verticalPosition?: string;\n destination?: string;\n preventScroll?: boolean;\n noMatchesMessage?: string;\n noMatchesMessageComponent?: any;\n };\n Blocks: {\n default: [any, number, Select];\n };\n}\n\ninterface Sliceable<T> {\n slice(): T[];\n}\n\nconst isSliceable = <T,>(coll: any): coll is Sliceable<T> => {\n return isArray(coll);\n};\n\nexport const toPlainArray = <T,>(collection: T[] | Sliceable<T>): T[] => {\n if (isSliceable<T>(collection)) {\n return collection.slice();\n } else {\n return collection;\n }\n};\n\nexport default class EuiComboBoxComponent extends Component<EuiComboBoxSignature> {\n @service declare euiI18n: EuiI18n;\n\n @tracked select: any = null;\n @tracked private _resolvedOptions?: any[];\n @tracked searchText = '';\n @tracked private _searchResult?: any[];\n\n private _filterResultsCache: {\n results: any[];\n options: any[];\n searchText: string;\n } = { results: [], options: [], searchText: this.searchText };\n\n get loadingMessage() {\n return (\n this.args.loadingMessage ||\n this.euiI18n.lookupToken(\n 'euiComboBox.loadingMessage',\n 'Loading options...'\n )\n );\n }\n\n get noMatchesMessage() {\n return (\n this.args.noMatchesMessage ||\n this.euiI18n.lookupToken(\n 'euiComboBox.noMatchesMessage',\n 'No results found'\n )\n );\n }\n\n get searchMessage() {\n return (\n this.args.searchMessage ||\n this.euiI18n.lookupToken('euiComboBox.searchMessage', 'Type to search')\n );\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n <PowerSelectMultiple\n ...attributes\n @onChange={{this.onChange}}\n @onFocus={{@onFocus}}\n @onBlur={{@onBlur}}\n @onOpen={{@onOpen}}\n @onClose={{@onClose}}\n @placeholderComponent={{@placeholderComponent}}\n @searchMessage={{this.searchMessage}}\n @searchMessageComponent={{if\n @searchMessageComponent\n @searchMessageComponent\n EuiComboBoxSearchMessage\n }}\n @noMatchesMessage={{this.noMatchesMessage}}\n @matchTriggerWidth={{@matchTriggerWidth}}\n @options={{this.options}}\n @selected={{@selectedOptions}}\n @closeOnSelect={{@closeOnSelect}}\n @defaultHighlighted={{@defaultHighlighted}}\n @searchField={{@searchField}}\n @searchEnabled={{argOrDefault @searchEnabled true}}\n @tabindex={{@tabindex}}\n @initiallyOpened={{and (not @isDisabled) @autoFocus}}\n @triggerComponent={{component\n EuiComboBoxTrigger\n fullWidth=@fullWidth\n compressed=@compressed\n isInvalid=@isInvalid\n singleSelection=@singleSelection\n onClose=@removeTag\n onCreateOption=(if @onCreateOption this.onCreateOption)\n isLoading=@isLoading\n autoFocus=(and (not @isDisabled) @autoFocus)\n icon=@triggerIcon\n }}\n @matcher={{@matcher}}\n @initiallyOpen={{@initiallyOpen}}\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\n @buildSelection={{this.buildSelection}}\n @search={{@search}}\n @onInput={{@onInput}}\n @onKeydown={{@onKeydown}}\n @scrollTo={{this.scrollTo}}\n @registerAPI={{queue this.registerAPI (optional @registerApi)}}\n @horizontalPosition={{@horizontalPosition}}\n @destination={{@destination}}\n @preventScroll={{@preventScroll}}\n @renderInPlace={{@renderInPlace}}\n @verticalPosition={{@verticalPosition}}\n @disabled={{@isDisabled}}\n @calculatePosition={{@calculatePosition}}\n @eventType={{@eventType}}\n @ariaLabel={{@ariaLabel}}\n @ariaLabelledBy={{@ariaLabelledBy}}\n @required={{@required}}\n @triggerRole={{@triggerRole}}\n @title={{@title}}\n @triggerId={{@triggerId}}\n @allowClear={{and (argOrDefault @isClearable true) (not @isDisabled)}}\n @loadingMessage={{this.loadingMessage}}\n @selectedItemComponent={{@selectedItemComponent}}\n @beforeOptionsComponent={{@beforeOptionsComponent}}\n @afterOptionsComponent={{@afterOptionsComponent}}\n @placeholder={{@placeholder}}\n @searchPlaceholder={{@searchPlaceholder}}\n @optionsComponent={{component\n EuiComboBoxOptions\n rowHeight=@rowHeight\n class=@optionsClass\n }}\n @extra={{@extra}}\n @groupComponent={{component EuiComboBoxGroup}}\n @triggerClass={{classNames\n \"euiComboBox\"\n (if @compressed \"euiComboBox--compressed\")\n (if @fullWidth \"euiComboBox--fullWidth\")\n (if @isDisabled \"euiComboBox-isDisabled\")\n (if @isInvalid \"euiComboBox-isInvalid\")\n (if this.select.isOpen \"euiComboBox-isOpen\")\n }}\n @noMatchesMessageComponent={{if\n @onCreateOption\n (component\n EuiComboBoxCreateOption\n customOptionText=@customOptionText\n onCreateOption=this.onCreateOption\n select=this.select\n )\n (component EuiComboBoxNoMatchesMessage)\n }}\n @dropdownClass=\"euiComboBoxOptionsList euiPanel euiPanel--borderRadiusMedium euiPanel--noShadow euiPanel--plain euiPopover__panel-isAttached euiPopover__panel euiPopover__panel-noArrow euiPopover__panel--bottom euiPopover__panel-isOpen euiComboBoxOptionsList__rowWrap {{@dropdownClass}}\"\n as |option i|\n >\n {{yield option i}}\n </PowerSelectMultiple>\n </template>\n\n //This is to allow scrolling between virtualized groups\n @cached\n get opts() {\n return this.results.reduce((acc, curr) => {\n if (emberPowerSelectIsGroup([curr])) {\n acc.push(curr, ...curr.options);\n } else {\n acc.push(curr);\n }\n\n return acc;\n }, []);\n }\n\n @cached\n get options(): any[] {\n if (this._resolvedOptions) return toPlainArray(this._resolvedOptions);\n\n if (this.args.options) {\n return toPlainArray(this.args.options);\n } else {\n return [];\n }\n }\n\n @cached\n get results(): any[] {\n if (this.searchText.length > 0) {\n if (this.args.search) {\n return toPlainArray(this._searchResult || this.options);\n } else {\n if (\n this._filterResultsCache.options === this.options &&\n this._filterResultsCache.searchText === this.searchText\n ) {\n // This is an optimization to avoid filtering several times, which may be a bit expensive\n // if there are many options, if neither the options nor the searchtext have changed\n return this._filterResultsCache.results;\n }\n\n //@ts-ignore\n let results = this._filter(this.options, this.searchText);\n //eslint-disable-next-line\n this._filterResultsCache = {\n results,\n options: this.options,\n searchText: this.searchText\n };\n\n return results;\n }\n } else {\n return this.options;\n }\n }\n\n @action\n scrollTo(option: any, select: { results: []; uniqueId: string }): void {\n let optionsList = document.querySelector(\n `[aria-controls=\"ember-power-select-trigger-${select.uniqueId}\"]`\n ) as HTMLElement;\n\n if (!optionsList) {\n return;\n }\n\n let index = this.opts.indexOf(option);\n\n if (index === -1) {\n return;\n }\n\n let optionElement = optionsList.querySelector(\n `[data-option-index=\"${index}\"]`\n ) as HTMLElement;\n\n if (!optionElement) {\n return;\n }\n\n let optionTopScroll = optionElement.offsetTop;\n let optionBottomScroll = optionTopScroll + optionElement.offsetHeight;\n\n if (optionBottomScroll > optionsList.offsetHeight + optionsList.scrollTop) {\n optionsList.scrollTop = optionBottomScroll - optionsList.offsetHeight;\n } else if (optionTopScroll < optionsList.scrollTop) {\n optionsList.scrollTop = optionTopScroll;\n }\n }\n\n @action\n registerAPI(select: Select) {\n this.select = select;\n }\n\n @action\n onChange(selected: any[]) {\n if (this.args.singleSelection) {\n return selected.length > 0 ? [selected[selected.length - 1]] : [];\n }\n\n this.args.onChange(selected);\n }\n\n @action\n onCreateOption() {\n let option;\n\n if (\n this.args.onCreateOption &&\n typeof this.args.onCreateOption === 'function'\n ) {\n // The `onCreateOption` function can be used to sanitize the input or explicitly return `false` to reject the input\n option = this.args.onCreateOption(this.select.searchText);\n\n if (option === false) {\n return;\n }\n }\n\n let search = option || this.select.searchText;\n\n this.select.actions.search('');\n this.select.actions.close();\n\n return search;\n }\n\n @action\n buildSelection(option: any, select: Select) {\n let newSelection = (select.selected || []).slice(0);\n let idx = -1;\n\n for (let i = 0; i < newSelection.length; i++) {\n if (isEqual(newSelection[i], option)) {\n idx = i;\n\n break;\n }\n }\n\n if (idx > -1) {\n newSelection.splice(idx, 1);\n } else {\n newSelection.push(option);\n }\n\n if (this.args.singleSelection && newSelection.length === 0) {\n select.actions.search('');\n }\n\n if (select?.selected?.length < newSelection.length) {\n select.actions.search('');\n }\n\n return newSelection;\n }\n}\n"],"names":["isSliceable","coll","isArray","toPlainArray","collection","slice","EuiComboBoxComponent","Component","g","prototype","service","i","void 0","tracked","_filterResultsCache","results","options","searchText","loadingMessage","args","euiI18n","lookupToken","noMatchesMessage","searchMessage","setComponentTemplate","precompileTemplate","strictMode","scope","PowerSelectMultiple","EuiComboBoxSearchMessage","argOrDefault","and","not","EuiComboBoxTrigger","queue","optional","EuiComboBoxOptions","EuiComboBoxGroup","classNames","EuiComboBoxCreateOption","EuiComboBoxNoMatchesMessage","opts","reduce","acc","curr","emberPowerSelectIsGroup","push","n","cached","_resolvedOptions","length","search","_searchResult","_filter","scrollTo","option","select","optionsList","document","querySelector","uniqueId","index","indexOf","optionElement","optionTopScroll","offsetTop","optionBottomScroll","offsetHeight","scrollTop","action","registerAPI","onChange","selected","singleSelection","onCreateOption","actions","close","buildSelection","newSelection","idx","isEqual","splice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiGA,MAAMA,cAAmBC,IAAS,IAAqB;EACrD,OAAOC,OAAQ,CAAAD,IAAA,CAAA;AACjB,CAAA;AAEaE,MAAAA,YAAe,GAAKC,UAAiC,IAAA;AAChE,EAAA,IAAIJ,WAAA,CAAeI,UAAa,CAAA,EAAA;AAC9B,IAAA,OAAOA,WAAWC,KAAK,EAAA;AACzB,GAAO,MAAA;AACL,IAAA,OAAOD,UAAA;AACT;AACF;AAEe,MAAME,6BAA6BC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CACzDC,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,QAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,SAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;IAAAJ,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAEAI,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAsB,IAAK;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,OAAA,IAAAF,CAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;IAAAJ,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,kBAAA,EAAA,CAC3BI,OAAA,CAAA,CAAA;AAAA;AAAA,EAAA,iBAAA,IAAAF,CAAA,CAAA,IAAA,EAAA,kBAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;IAAAJ,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,YAAA,EAAA,CACAI,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAqB,EAAG;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,WAAA,IAA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AAtC,SAAA,EAAA,gBAAA,EAAA,CA5BC4D,MAAA,CAAA,CAAA;AAAA;AA6BH;;;;"}
1
+ {"version":3,"file":"eui-combo-box.js","sources":["../../src/components/eui-combo-box.gts"],"sourcesContent":["import 'ember-basic-dropdown/styles';\n\nimport Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { isArray } from '@ember/array';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { isEqual } from '@ember/utils';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport queue from '@nullvoxpopuli/ember-composable-helpers/helpers/queue';\nimport PowerSelectMultiple from 'ember-power-select/components/power-select-multiple';\nimport { emberPowerSelectIsGroup } from 'ember-power-select/helpers/ember-power-select-is-group';\nimport { and, not } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport EuiComboBoxCreateOption from './eui-combo-box/create-option.gts';\nimport EuiComboBoxGroup from './eui-combo-box/group.gts';\nimport EuiComboBoxNoMatchesMessage from './eui-combo-box/no-matches-message.gts';\nimport EuiComboBoxOptions from './eui-combo-box/options.gts';\nimport EuiComboBoxSearchMessage from './eui-combo-box/search-message.gts';\nimport EuiComboBoxTrigger from './eui-combo-box/trigger.gts';\n\nimport type EuiI18n from '../services/eui-i18n';\n\ninterface PromiseProxy<T> extends Promise<T> {\n content: any;\n}\n\ninterface Select {\n selected: any;\n actions: {\n search: (str: string) => void;\n };\n}\n\nexport interface EuiComboBoxSignature {\n Element: HTMLDivElement;\n Args: {\n singleSelection?:\n | boolean\n | {\n asPlainText?: boolean;\n };\n onCreateOption?: (search: string) => boolean | undefined;\n alwaysShowCreateOption?: boolean;\n options: any[];\n search?: (term: string, select: Select) => any[] | PromiseProxy<any[]>;\n searchField?: string;\n isInvalid?: boolean;\n fullWidth?: boolean;\n searchMessage?: string;\n searchEnabled?: boolean;\n isClearable?: boolean;\n isLoading?: boolean;\n isDisabled?: boolean;\n readOnly?: boolean;\n searchMessageComponent?: any;\n compressed?: boolean;\n onFocus?: (e: FocusEvent) => void;\n onBlur?: (e: FocusEvent) => void;\n onClose?: (e: Event) => void;\n onOpen?: (e: Event) => void;\n renderInPlace?: boolean;\n customOptionText?: string;\n loadingMessage?: any;\n selectedItemComponent?: any;\n beforeOptionsComponent?: any;\n placeholderComponent?: any;\n afterOptionsComponent?: any;\n searchPlaceholder?: any;\n dropdownClass?: string;\n selectedOptions?: any[];\n onChange: (selected: any[]) => void;\n placeholder?: string;\n extra?: any;\n closeOnSelect?: boolean;\n autoFocus?: boolean;\n defaultHighlighted?: any;\n matchTriggerWidth?: boolean;\n tabindex?: number;\n initiallyOpen?: boolean;\n horizontalPosition?: string;\n verticalPosition?: string;\n destination?: string;\n preventScroll?: boolean;\n noMatchesMessage?: string;\n noMatchesMessageComponent?: any;\n optionsClass?: string;\n rowHeight?: number;\n };\n Blocks: {\n default: [any, number, Select];\n };\n}\n\ninterface Sliceable<T> {\n slice(): T[];\n}\n\nconst isSliceable = <T,>(coll: any): coll is Sliceable<T> => {\n return isArray(coll);\n};\n\nexport const toPlainArray = <T,>(collection: T[] | Sliceable<T>): T[] => {\n if (isSliceable<T>(collection)) {\n return collection.slice();\n } else {\n return collection;\n }\n};\n\nexport default class EuiComboBoxComponent extends Component<EuiComboBoxSignature> {\n @service declare euiI18n: EuiI18n;\n\n @tracked select: any = null;\n @tracked private _resolvedOptions?: any[];\n @tracked searchText = '';\n @tracked private _searchResult?: any[];\n\n private _filterResultsCache: {\n results: any[];\n options: any[];\n searchText: string;\n } = { results: [], options: [], searchText: this.searchText };\n\n get loadingMessage() {\n return (\n this.args.loadingMessage ||\n this.euiI18n.lookupToken(\n 'euiComboBox.loadingMessage',\n 'Loading options...'\n )\n );\n }\n\n get noMatchesMessage() {\n return (\n this.args.noMatchesMessage ||\n this.euiI18n.lookupToken(\n 'euiComboBox.noMatchesMessage',\n 'No results found'\n )\n );\n }\n\n get searchMessage() {\n return (\n this.args.searchMessage ||\n this.euiI18n.lookupToken('euiComboBox.searchMessage', 'Type to search')\n );\n }\n\n get alwaysShowCreateOption() {\n return this.args.onCreateOption && this.args.alwaysShowCreateOption;\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n\n <PowerSelectMultiple\n ...attributes\n @onChange={{this.onChange}}\n @onFocus={{@onFocus}}\n @onBlur={{@onBlur}}\n @onOpen={{@onOpen}}\n @onClose={{@onClose}}\n @placeholderComponent={{@placeholderComponent}}\n @searchMessage={{this.searchMessage}}\n @searchMessageComponent={{if\n @searchMessageComponent\n @searchMessageComponent\n EuiComboBoxSearchMessage\n }}\n @noMatchesMessage={{this.noMatchesMessage}}\n @matchTriggerWidth={{@matchTriggerWidth}}\n @options={{this.options}}\n @selected={{@selectedOptions}}\n @closeOnSelect={{@closeOnSelect}}\n @defaultHighlighted={{@defaultHighlighted}}\n @searchField={{@searchField}}\n @searchEnabled={{argOrDefault @searchEnabled true}}\n @tabindex={{@tabindex}}\n @initiallyOpened={{and (not @isDisabled) @autoFocus}}\n @triggerComponent={{component\n EuiComboBoxTrigger\n fullWidth=@fullWidth\n compressed=@compressed\n isInvalid=@isInvalid\n singleSelection=@singleSelection\n onClose=@removeTag\n onCreateOption=(if @onCreateOption this.onCreateOption)\n isLoading=@isLoading\n autoFocus=(and (not @isDisabled) @autoFocus)\n icon=@triggerIcon\n }}\n @matcher={{@matcher}}\n @initiallyOpen={{@initiallyOpen}}\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\n @buildSelection={{this.buildSelection}}\n @search={{@search}}\n @onInput={{@onInput}}\n @onKeydown={{@onKeydown}}\n @scrollTo={{this.scrollTo}}\n @registerAPI={{queue this.registerAPI (optional @registerApi)}}\n @horizontalPosition={{@horizontalPosition}}\n @destination={{@destination}}\n @preventScroll={{@preventScroll}}\n @renderInPlace={{@renderInPlace}}\n @verticalPosition={{@verticalPosition}}\n @disabled={{@isDisabled}}\n @calculatePosition={{@calculatePosition}}\n @eventType={{@eventType}}\n @ariaLabel={{@ariaLabel}}\n @ariaLabelledBy={{@ariaLabelledBy}}\n @required={{@required}}\n @triggerRole={{@triggerRole}}\n @title={{@title}}\n @triggerId={{@triggerId}}\n @allowClear={{and (argOrDefault @isClearable true) (not @isDisabled)}}\n @loadingMessage={{this.loadingMessage}}\n @selectedItemComponent={{@selectedItemComponent}}\n @beforeOptionsComponent={{@beforeOptionsComponent}}\n @afterOptionsComponent={{if\n @afterOptionsComponent\n @afterOptionsComponent\n (if\n (and\n @onCreateOption\n (not this.select.loading)\n this.select.searchText\n this.alwaysShowCreateOption\n )\n (component\n EuiComboBoxCreateOption\n customOptionText=@customOptionText\n onCreateOption=this.onCreateOption\n select=this.select\n alwaysShow=true\n )\n )\n }}\n @placeholder={{@placeholder}}\n @searchPlaceholder={{@searchPlaceholder}}\n @optionsComponent={{component\n EuiComboBoxOptions\n rowHeight=@rowHeight\n class=@optionsClass\n }}\n @extra={{@extra}}\n @groupComponent={{component EuiComboBoxGroup}}\n @triggerClass={{classNames\n \"euiComboBox\"\n (if @compressed \"euiComboBox--compressed\")\n (if @fullWidth \"euiComboBox--fullWidth\")\n (if @isDisabled \"euiComboBox-isDisabled\")\n (if @isInvalid \"euiComboBox-isInvalid\")\n (if this.select.isOpen \"euiComboBox-isOpen\")\n }}\n @noMatchesMessageComponent={{if\n (and @onCreateOption (not this.alwaysShowCreateOption))\n (component\n EuiComboBoxCreateOption\n customOptionText=@customOptionText\n onCreateOption=this.onCreateOption\n select=this.select\n alwaysShow=false\n )\n (component EuiComboBoxNoMatchesMessage)\n }}\n @dropdownClass=\"euiComboBoxOptionsList euiPanel euiPanel--borderRadiusMedium euiPanel--noShadow euiPanel--plain euiPopover__panel-isAttached euiPopover__panel euiPopover__panel-noArrow euiPopover__panel--bottom euiPopover__panel-isOpen {{@dropdownClass}}\"\n as |option i|\n >\n {{yield option i}}\n </PowerSelectMultiple>\n </template>\n\n //This is to allow scrolling between virtualized groups\n @cached\n get opts() {\n return this.results.reduce((acc, curr) => {\n if (emberPowerSelectIsGroup([curr])) {\n acc.push(curr, ...curr.options);\n } else {\n acc.push(curr);\n }\n\n return acc;\n }, []);\n }\n\n @cached\n get options(): any[] {\n if (this._resolvedOptions) return toPlainArray(this._resolvedOptions);\n\n if (this.args.options) {\n return toPlainArray(this.args.options);\n } else {\n return [];\n }\n }\n\n @cached\n get results(): any[] {\n if (this.searchText.length > 0) {\n if (this.args.search) {\n return toPlainArray(this._searchResult || this.options);\n } else {\n if (\n this._filterResultsCache.options === this.options &&\n this._filterResultsCache.searchText === this.searchText\n ) {\n // This is an optimization to avoid filtering several times, which may be a bit expensive\n // if there are many options, if neither the options nor the searchtext have changed\n return this._filterResultsCache.results;\n }\n\n //@ts-ignore\n let results = this._filter(this.options, this.searchText);\n //eslint-disable-next-line\n this._filterResultsCache = {\n results,\n options: this.options,\n searchText: this.searchText\n };\n\n return results;\n }\n } else {\n return this.options;\n }\n }\n\n @action\n scrollTo(option: any, select: { results: []; uniqueId: string }): void {\n let optionsList = document.querySelector(\n `[aria-controls=\"ember-power-select-trigger-${select.uniqueId}\"]`\n ) as HTMLElement;\n\n if (!optionsList) {\n return;\n }\n\n let index = this.opts.indexOf(option);\n\n if (index === -1) {\n return;\n }\n\n let optionElement = optionsList.querySelector(\n `[data-option-index=\"${index}\"]`\n ) as HTMLElement;\n\n if (!optionElement) {\n return;\n }\n\n let optionTopScroll = optionElement.offsetTop;\n let optionBottomScroll = optionTopScroll + optionElement.offsetHeight;\n\n if (optionBottomScroll > optionsList.offsetHeight + optionsList.scrollTop) {\n optionsList.scrollTop = optionBottomScroll - optionsList.offsetHeight;\n } else if (optionTopScroll < optionsList.scrollTop) {\n optionsList.scrollTop = optionTopScroll;\n }\n }\n\n @action\n registerAPI(select: Select) {\n this.select = select;\n }\n\n @action\n onChange(selected: any[]) {\n if (this.args.singleSelection) {\n return selected.length > 0 ? [selected[selected.length - 1]] : [];\n }\n\n this.args.onChange(selected);\n }\n\n @action\n onCreateOption() {\n let option;\n\n if (\n this.args.onCreateOption &&\n typeof this.args.onCreateOption === 'function'\n ) {\n // The `onCreateOption` function can be used to sanitize the input or explicitly return `false` to reject the input\n option = this.args.onCreateOption(this.select.searchText);\n\n if (option === false) {\n return;\n }\n }\n\n let search = option || this.select.searchText;\n\n this.select.actions.search('');\n this.select.actions.close();\n\n return search;\n }\n\n @action\n buildSelection(option: any, select: Select) {\n let newSelection = (select.selected || []).slice(0);\n let idx = -1;\n\n for (let i = 0; i < newSelection.length; i++) {\n if (isEqual(newSelection[i], option)) {\n idx = i;\n\n break;\n }\n }\n\n if (idx > -1) {\n newSelection.splice(idx, 1);\n } else {\n newSelection.push(option);\n }\n\n if (this.args.singleSelection && newSelection.length === 0) {\n select.actions.search('');\n }\n\n if (select?.selected?.length < newSelection.length) {\n select.actions.search('');\n }\n\n return newSelection;\n }\n}\n"],"names":["isSliceable","coll","isArray","toPlainArray","collection","slice","EuiComboBoxComponent","Component","g","prototype","service","i","void 0","tracked","_filterResultsCache","results","options","searchText","loadingMessage","args","euiI18n","lookupToken","noMatchesMessage","searchMessage","alwaysShowCreateOption","onCreateOption","setComponentTemplate","precompileTemplate","strictMode","scope","PowerSelectMultiple","EuiComboBoxSearchMessage","argOrDefault","and","not","EuiComboBoxTrigger","queue","optional","EuiComboBoxCreateOption","EuiComboBoxOptions","EuiComboBoxGroup","classNames","EuiComboBoxNoMatchesMessage","opts","reduce","acc","curr","emberPowerSelectIsGroup","push","n","cached","_resolvedOptions","length","search","_searchResult","_filter","scrollTo","option","select","optionsList","document","querySelector","uniqueId","index","indexOf","optionElement","optionTopScroll","offsetTop","optionBottomScroll","offsetHeight","scrollTop","action","registerAPI","onChange","selected","singleSelection","actions","close","buildSelection","newSelection","idx","isEqual","splice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqGA,MAAMA,cAAmBC,IAAS,IAAqB;EACrD,OAAOC,OAAQ,CAAAD,IAAA,CAAA;AACjB,CAAA;AAEaE,MAAAA,Y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AAA,gBAAA,EAAA,CAtBC8D,MAAA,CAAA,CAAA;AAAA;AAyBDO,EAAAA,cAAAA,CAAerB,MAAW,EAAEC,MAAc,EAAE;AAC1C,IAAA,IAAIqB,YAAA,GAAe,CAACrB,MAAO,CAAAgB,QAAQ,IAAI,EAAE,EAAErE,KAAK,CAAC,CAAA,CAAA;IACjD,IAAI2E,MAAM,EAAC;AAEX,IAAA,KAAK,IAAIrE,CAAI,GAAA,CAAA,EAAGA,IAAIoE,YAAa,CAAA3B,MAAM,EAAEzC,CAAK,EAAA,EAAA;MAC5C,IAAIsE,OAAQ,CAAAF,YAAY,CAACpE,CAAA,CAAE,EAAE8C,MAAS,CAAA,EAAA;AACpCuB,QAAAA,GAAM,GAAArE,CAAA;AAEN,QAAA;AACF;AACF;AAEA,IAAA,IAAIqE,GAAA,GAAM,EAAI,EAAA;AACZD,MAAAA,YAAa,CAAAG,MAAM,CAACF,GAAK,EAAA,CAAA,CAAA;AAC3B,KAAO,MAAA;AACLD,MAAAA,YAAA,CAAa/B,IAAI,CAACS,MAAA,CAAA;AACpB;IAEA,IAAI,IAAI,CAACtC,IAAI,CAACwD,eAAe,IAAII,YAAA,CAAa3B,MAAM,KAAK,CAAG,EAAA;AAC1DM,MAAAA,MAAO,CAAAkB,OAAO,CAACvB,MAAM,CAAC,EAAA,CAAA;AACxB;IAEA,IAAIK,MAAQ,EAAAgB,QAAA,EAAUtB,MAAS,GAAA2B,YAAA,CAAa3B,MAAM,EAAE;AAClDM,MAAAA,MAAO,CAAAkB,OAAO,CAACvB,MAAM,CAAC,EAAA,CAAA;AACxB;AAEA,IAAA,OAAO0B,YAAA;AACT;AAAA,EAAA;IAAA9B,CAAA,CAAA,IAAA,CAAAxC,SAAA,EAAA,gBAAA,EAAA,CA5BC8D,MAAA,CAAA,CAAA;AAAA;AA6BH;;;;"}
@@ -10,7 +10,7 @@ import { precompileTemplate } from '@ember/template-compilation';
10
10
  import { setComponentTemplate } from '@ember/component';
11
11
  import templateOnly from '@ember/component/template-only';
12
12
 
13
- const EuiFieldNumber = setComponentTemplate(precompileTemplate("\n {{#let (and (argOrDefault @isPrependProvided true) (has-block \"prepend\")) (and (argOrDefault @isAppendProvided true) (has-block \"append\")) (argOrDefault @id (randomId)) as |hasPrepend hasAppend inputId|}}\n {{#let (classNames (if @icon \"euiFieldNumber--withIcon\") (if @fullWidth \"euiFieldNumber--fullWidth\") (if @compressed \"euiFieldNumber--compressed\") (if (or hasPrepend hasAppend) \"euiFieldNumber--inGroup\") (if @isLoading \"euiFieldNumber--isLoading\") \"euiFieldNumber\") as |classes|}}\n {{#if @controlOnly}}\n <input id={{@id}} class={{classes}} value={{@value}} min={{@min}} max={{@max}} disabled={{@disabled}} step={{@step}} type=\"number\" {{validatableControl @isInvalid}} {{didInsert (optional @inputRef)}} ...attributes />\n {{else}}\n <EuiFormControlLayout @icon={{@icon}} @clear={{@clear}} @fullWidth={{@fullWidth}} @isLoading={{@isLoading}} @compressed={{@compressed}} @readOnly={{@readOnly}} @disabled={{@disabled}} @useGroup={{or hasPrepend hasAppend}}>\n <:prepend as |prependClasses|>\n {{yield prependClasses to=\"prepend\"}}\n </:prepend>\n <:field>\n <input id={{inputId}} class={{classes}} value={{@value}} min={{@min}} max={{@max}} disabled={{@disabled}} step={{@step}} type=\"number\" {{validatableControl @isInvalid}} ...attributes />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n ", {
13
+ const EuiFieldNumber = setComponentTemplate(precompileTemplate("\n {{#let (and (argOrDefault @isPrependProvided true) (has-block \"prepend\")) (and (argOrDefault @isAppendProvided true) (has-block \"append\")) (argOrDefault @id (randomId)) as |hasPrepend hasAppend inputId|}}\n {{#let (classNames (if @icon \"euiFieldNumber--withIcon\") (if @fullWidth \"euiFieldNumber--fullWidth\") (if @compressed \"euiFieldNumber--compressed\") (if (or hasPrepend hasAppend) \"euiFieldNumber--inGroup\") (if @isLoading \"euiFieldNumber--isLoading\") \"euiFieldNumber\") as |classes|}}\n {{#if @controlOnly}}\n <input id={{@id}} class={{classes}} value={{@value}} min={{@min}} max={{@max}} disabled={{@disabled}} step={{@step}} type=\"number\" readonly={{@readOnly}} {{validatableControl @isInvalid}} {{didInsert (optional @inputRef)}} ...attributes />\n {{else}}\n <EuiFormControlLayout @icon={{@icon}} @clear={{@clear}} @fullWidth={{@fullWidth}} @isLoading={{@isLoading}} @compressed={{@compressed}} @readOnly={{@readOnly}} @disabled={{@disabled}} @useGroup={{or hasPrepend hasAppend}}>\n <:prepend as |prependClasses|>\n {{yield prependClasses to=\"prepend\"}}\n </:prepend>\n <:field>\n <input id={{inputId}} class={{classes}} value={{@value}} min={{@min}} max={{@max}} disabled={{@disabled}} step={{@step}} type=\"number\" readonly={{@readOnly}} {{validatableControl @isInvalid}} ...attributes />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n ", {
14
14
  strictMode: true,
15
15
  scope: () => ({
16
16
  and,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-field-number.js","sources":["../../src/components/eui-field-number.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { and, or } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\nimport EuiFormControlLayout from './eui-form-control-layout.gts';\n\nimport type { CommonArgs } from './common.ts';\nimport type { EuiFormControlLayoutSignature } from './eui-form-control-layout';\nimport type { IconType } from './eui-icon';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport type EuiFieldNumberArgs = CommonArgs & {\n id?: string;\n icon?: IconType;\n isInvalid?: boolean;\n fullWidth?: boolean;\n isLoading?: boolean;\n readOnly?: boolean;\n min?: number | string;\n max?: number | string;\n value?: number | string;\n disabled?: boolean;\n\n /**\n * Specifies the granularity that the value must adhere to.\n * Accepts a `number` or the string `'any'` for no stepping to allow for any value.\n * Defaults to `1`\n */\n step?: number | 'any';\n inputRef?: (ele: Element) => void;\n\n /**\n * Creates an input group with element(s) coming before input.\n * `string` | `Component` or an array of these\n */\n prepend?: EuiFormControlLayoutSignature['Blocks']['prepend'];\n\n /**\n * Creates an input group with element(s) coming after input.\n * `string` | `Component` or an array of these\n */\n append?: EuiFormControlLayoutSignature['Blocks']['append'];\n\n /**\n * Completely removes form control layout wrapper and ignores\n * icon, prepend, and append. Best used inside EuiFormControlLayoutDelimited.\n */\n controlOnly?: boolean;\n\n /**\n * when `true` creates a shorter height input\n */\n compressed?: boolean;\n\n isPrependProvided?: boolean;\n isAppendProvided?: boolean;\n\n clear?: EuiFormControlLayoutSignature['Args']['clear'];\n};\n\nexport interface EuiFieldNumberSignature {\n Element: HTMLInputElement;\n Args: EuiFieldNumberArgs;\n Blocks: {\n default: [string];\n prepend: [string];\n append: [string];\n };\n}\n\nconst EuiFieldNumber: TemplateOnlyComponent<EuiFieldNumberSignature> =\n <template>\n {{#let\n (and (argOrDefault @isPrependProvided true) (has-block \"prepend\"))\n (and (argOrDefault @isAppendProvided true) (has-block \"append\"))\n (argOrDefault @id (randomId))\n as |hasPrepend hasAppend inputId|\n }}\n {{#let\n (classNames\n (if @icon \"euiFieldNumber--withIcon\")\n (if @fullWidth \"euiFieldNumber--fullWidth\")\n (if @compressed \"euiFieldNumber--compressed\")\n (if (or hasPrepend hasAppend) \"euiFieldNumber--inGroup\")\n (if @isLoading \"euiFieldNumber--isLoading\")\n \"euiFieldNumber\"\n )\n as |classes|\n }}\n {{#if @controlOnly}}\n <input\n id={{@id}}\n class={{classes}}\n value={{@value}}\n min={{@min}}\n max={{@max}}\n disabled={{@disabled}}\n step={{@step}}\n type=\"number\"\n {{validatableControl @isInvalid}}\n {{didInsert (optional @inputRef)}}\n ...attributes\n />\n {{else}}\n <EuiFormControlLayout\n @icon={{@icon}}\n @clear={{@clear}}\n @fullWidth={{@fullWidth}}\n @isLoading={{@isLoading}}\n @compressed={{@compressed}}\n @readOnly={{@readOnly}}\n @disabled={{@disabled}}\n @useGroup={{or hasPrepend hasAppend}}\n >\n <:prepend as |prependClasses|>\n {{yield prependClasses to=\"prepend\"}}\n </:prepend>\n <:field>\n <input\n id={{inputId}}\n class={{classes}}\n value={{@value}}\n min={{@min}}\n max={{@max}}\n disabled={{@disabled}}\n step={{@step}}\n type=\"number\"\n {{validatableControl @isInvalid}}\n ...attributes\n />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n </template>;\n\nexport default EuiFieldNumber;\n"],"names":["EuiFieldNumber","setComponentTemplate","precompileTemplate","strictMode","scope","and","argOrDefault","randomId","classNames","or","validatableControl","didInsert","optional","EuiFormControlLayout","templateOnly"],"mappings":";;;;;;;;;;;;AA2EA,MAAMA,cACJ,GAAAC,oBAAA,CAAAC,kBAAA,CAmEA,qkDAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,GAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,kBAAA;IAAAC,SAAA;IAAAC,QAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"eui-field-number.js","sources":["../../src/components/eui-field-number.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { and, or } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\nimport EuiFormControlLayout from './eui-form-control-layout.gts';\n\nimport type { CommonArgs } from './common.ts';\nimport type { EuiFormControlLayoutSignature } from './eui-form-control-layout';\nimport type { IconType } from './eui-icon';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport type EuiFieldNumberArgs = CommonArgs & {\n id?: string;\n icon?: IconType;\n isInvalid?: boolean;\n fullWidth?: boolean;\n isLoading?: boolean;\n readOnly?: boolean;\n min?: number | string;\n max?: number | string;\n value?: number | string;\n disabled?: boolean;\n\n /**\n * Specifies the granularity that the value must adhere to.\n * Accepts a `number` or the string `'any'` for no stepping to allow for any value.\n * Defaults to `1`\n */\n step?: number | 'any';\n inputRef?: (ele: Element) => void;\n\n /**\n * Creates an input group with element(s) coming before input.\n * `string` | `Component` or an array of these\n */\n prepend?: EuiFormControlLayoutSignature['Blocks']['prepend'];\n\n /**\n * Creates an input group with element(s) coming after input.\n * `string` | `Component` or an array of these\n */\n append?: EuiFormControlLayoutSignature['Blocks']['append'];\n\n /**\n * Completely removes form control layout wrapper and ignores\n * icon, prepend, and append. Best used inside EuiFormControlLayoutDelimited.\n */\n controlOnly?: boolean;\n\n /**\n * when `true` creates a shorter height input\n */\n compressed?: boolean;\n\n isPrependProvided?: boolean;\n isAppendProvided?: boolean;\n\n clear?: EuiFormControlLayoutSignature['Args']['clear'];\n};\n\nexport interface EuiFieldNumberSignature {\n Element: HTMLInputElement;\n Args: EuiFieldNumberArgs;\n Blocks: {\n default: [string];\n prepend: [string];\n append: [string];\n };\n}\n\nconst EuiFieldNumber: TemplateOnlyComponent<EuiFieldNumberSignature> =\n <template>\n {{#let\n (and (argOrDefault @isPrependProvided true) (has-block \"prepend\"))\n (and (argOrDefault @isAppendProvided true) (has-block \"append\"))\n (argOrDefault @id (randomId))\n as |hasPrepend hasAppend inputId|\n }}\n {{#let\n (classNames\n (if @icon \"euiFieldNumber--withIcon\")\n (if @fullWidth \"euiFieldNumber--fullWidth\")\n (if @compressed \"euiFieldNumber--compressed\")\n (if (or hasPrepend hasAppend) \"euiFieldNumber--inGroup\")\n (if @isLoading \"euiFieldNumber--isLoading\")\n \"euiFieldNumber\"\n )\n as |classes|\n }}\n {{#if @controlOnly}}\n <input\n id={{@id}}\n class={{classes}}\n value={{@value}}\n min={{@min}}\n max={{@max}}\n disabled={{@disabled}}\n step={{@step}}\n type=\"number\"\n readonly={{@readOnly}}\n {{validatableControl @isInvalid}}\n {{didInsert (optional @inputRef)}}\n ...attributes\n />\n {{else}}\n <EuiFormControlLayout\n @icon={{@icon}}\n @clear={{@clear}}\n @fullWidth={{@fullWidth}}\n @isLoading={{@isLoading}}\n @compressed={{@compressed}}\n @readOnly={{@readOnly}}\n @disabled={{@disabled}}\n @useGroup={{or hasPrepend hasAppend}}\n >\n <:prepend as |prependClasses|>\n {{yield prependClasses to=\"prepend\"}}\n </:prepend>\n <:field>\n <input\n id={{inputId}}\n class={{classes}}\n value={{@value}}\n min={{@min}}\n max={{@max}}\n disabled={{@disabled}}\n step={{@step}}\n type=\"number\"\n readonly={{@readOnly}}\n {{validatableControl @isInvalid}}\n ...attributes\n />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n </template>;\n\nexport default EuiFieldNumber;\n"],"names":["EuiFieldNumber","setComponentTemplate","precompileTemplate","strictMode","scope","and","argOrDefault","randomId","classNames","or","validatableControl","didInsert","optional","EuiFormControlLayout","templateOnly"],"mappings":";;;;;;;;;;;;AA2EA,MAAMA,cACJ,GAAAC,oBAAA,CAAAC,kBAAA,CAqEA,mnDAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,GAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,kBAAA;IAAAC,SAAA;IAAAC,QAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
@@ -10,7 +10,7 @@ import { precompileTemplate } from '@ember/template-compilation';
10
10
  import { setComponentTemplate } from '@ember/component';
11
11
  import templateOnly from '@ember/component/template-only';
12
12
 
13
- const EuiFieldText = setComponentTemplate(precompileTemplate("\n {{#let (and (not (argOrDefault @isFakePrependBlock false)) (has-block \"prepend\")) (and (not (argOrDefault @isFakeAppendBlock false)) (has-block \"append\")) (argOrDefault @id (randomId)) as |hasPrepend hasAppend inputId|}}\n {{#let (classNames (if @icon \"euiFieldText--withIcon\") (if @fullWidth \"euiFieldText--fullWidth\") (if @compressed \"euiFieldText--compressed\") (if (or hasPrepend hasAppend) \"euiFieldText--inGroup\") (if @isLoading \"euiFieldText--isLoading\") \"euiFieldText\") as |classes|}}\n {{#if @controlOnly}}\n <input id={{inputId}} value={{@value}} class={{classes}} disabled={{@disabled}} type=\"text\" placeholder={{@placeholder}} ...attributes {{validatableControl @isInvalid}} {{didInsert (optional @inputRef)}} />\n {{else}}\n <EuiFormControlLayout @icon={{@icon}} @clear={{@clear}} @fullWidth={{@fullWidth}} @isLoading={{@isLoading}} @compressed={{@compressed}} @readOnly={{@readOnly}} @disabled={{@disabled}} @useGroup={{or hasPrepend hasAppend}}>\n <:prepend as |prependClasses|>\n {{yield prependClasses inputId to=\"prepend\"}}\n </:prepend>\n <:field>\n <input id={{inputId}} value={{@value}} class={{classes}} disabled={{@disabled}} type=\"text\" placeholder={{@placeholder}} readonly={{@readOnly}} ...attributes {{validatableControl @isInvalid}} />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses inputId to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n", {
13
+ const EuiFieldText = setComponentTemplate(precompileTemplate("\n {{#let (and (not (argOrDefault @isFakePrependBlock false)) (has-block \"prepend\")) (and (not (argOrDefault @isFakeAppendBlock false)) (has-block \"append\")) (argOrDefault @id (randomId)) as |hasPrepend hasAppend inputId|}}\n {{#let (classNames (if @icon \"euiFieldText--withIcon\") (if @fullWidth \"euiFieldText--fullWidth\") (if @compressed \"euiFieldText--compressed\") (if (or hasPrepend hasAppend) \"euiFieldText--inGroup\") (if @isLoading \"euiFieldText--isLoading\") \"euiFieldText\") as |classes|}}\n {{#if @controlOnly}}\n <input id={{inputId}} value={{@value}} class={{classes}} disabled={{@disabled}} type=\"text\" placeholder={{@placeholder}} readonly={{@readOnly}} ...attributes {{validatableControl @isInvalid}} {{didInsert (optional @inputRef)}} />\n {{else}}\n <EuiFormControlLayout @icon={{@icon}} @clear={{@clear}} @fullWidth={{@fullWidth}} @isLoading={{@isLoading}} @compressed={{@compressed}} @readOnly={{@readOnly}} @disabled={{@disabled}} @useGroup={{or hasPrepend hasAppend}}>\n <:prepend as |prependClasses|>\n {{yield prependClasses inputId to=\"prepend\"}}\n </:prepend>\n <:field>\n <input id={{inputId}} value={{@value}} class={{classes}} disabled={{@disabled}} type=\"text\" placeholder={{@placeholder}} readonly={{@readOnly}} ...attributes {{validatableControl @isInvalid}} />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses inputId to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n", {
14
14
  strictMode: true,
15
15
  scope: () => ({
16
16
  and,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-field-text.js","sources":["../../src/components/eui-field-text.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { and, not, or } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\nimport EuiFormControlLayout from './eui-form-control-layout.gts';\n\nimport type { EuiFormControlLayoutSignature } from './eui-form-control-layout';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiFieldTextSignature {\n Element: HTMLInputElement;\n Args: {\n id?: string;\n value?: string;\n placeholder?: string;\n icon?: EuiFormControlLayoutSignature['Args']['icon'];\n fullWidth?: boolean;\n isLoading?: boolean;\n compressed?: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n clear?: () => void;\n controlOnly?: boolean;\n isInvalid?: boolean;\n inputRef?: (element: HTMLInputElement | null) => void;\n isFakePrependBlock?: boolean;\n isFakeAppendBlock?: boolean;\n };\n Blocks: {\n prepend: [...EuiFormControlLayoutSignature['Blocks']['prepend'], string];\n append: [...EuiFormControlLayoutSignature['Blocks']['append'], string];\n };\n}\n\nconst EuiFieldText: TemplateOnlyComponent<EuiFieldTextSignature> = <template>\n {{#let\n (and (not (argOrDefault @isFakePrependBlock false)) (has-block \"prepend\"))\n (and (not (argOrDefault @isFakeAppendBlock false)) (has-block \"append\"))\n (argOrDefault @id (randomId))\n as |hasPrepend hasAppend inputId|\n }}\n {{#let\n (classNames\n (if @icon \"euiFieldText--withIcon\")\n (if @fullWidth \"euiFieldText--fullWidth\")\n (if @compressed \"euiFieldText--compressed\")\n (if (or hasPrepend hasAppend) \"euiFieldText--inGroup\")\n (if @isLoading \"euiFieldText--isLoading\")\n \"euiFieldText\"\n )\n as |classes|\n }}\n {{#if @controlOnly}}\n <input\n id={{inputId}}\n value={{@value}}\n class={{classes}}\n disabled={{@disabled}}\n type=\"text\"\n placeholder={{@placeholder}}\n ...attributes\n {{validatableControl @isInvalid}}\n {{didInsert (optional @inputRef)}}\n />\n {{else}}\n <EuiFormControlLayout\n @icon={{@icon}}\n @clear={{@clear}}\n @fullWidth={{@fullWidth}}\n @isLoading={{@isLoading}}\n @compressed={{@compressed}}\n @readOnly={{@readOnly}}\n @disabled={{@disabled}}\n @useGroup={{or hasPrepend hasAppend}}\n >\n <:prepend as |prependClasses|>\n {{yield prependClasses inputId to=\"prepend\"}}\n </:prepend>\n <:field>\n <input\n id={{inputId}}\n value={{@value}}\n class={{classes}}\n disabled={{@disabled}}\n type=\"text\"\n placeholder={{@placeholder}}\n readonly={{@readOnly}}\n ...attributes\n {{validatableControl @isInvalid}}\n />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses inputId to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n</template>;\n\nexport default EuiFieldText;\n"],"names":["EuiFieldText","setComponentTemplate","precompileTemplate","strictMode","scope","and","not","argOrDefault","randomId","classNames","or","validatableControl","didInsert","optional","EuiFormControlLayout","templateOnly"],"mappings":";;;;;;;;;;;;AAuCA,MAAMA,YAA6D,GAAAC,oBAAA,CAAAC,kBAAA,CAgEnE,gjDAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,GAAA;IAAAC,GAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,kBAAA;IAAAC,SAAA;IAAAC,QAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"eui-field-text.js","sources":["../../src/components/eui-field-text.gts"],"sourcesContent":["import didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { and, not, or } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\nimport EuiFormControlLayout from './eui-form-control-layout.gts';\n\nimport type { EuiFormControlLayoutSignature } from './eui-form-control-layout';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiFieldTextSignature {\n Element: HTMLInputElement;\n Args: {\n id?: string;\n value?: string;\n placeholder?: string;\n icon?: EuiFormControlLayoutSignature['Args']['icon'];\n fullWidth?: boolean;\n isLoading?: boolean;\n compressed?: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n clear?: () => void;\n controlOnly?: boolean;\n isInvalid?: boolean;\n inputRef?: (element: HTMLInputElement | null) => void;\n isFakePrependBlock?: boolean;\n isFakeAppendBlock?: boolean;\n };\n Blocks: {\n prepend: [...EuiFormControlLayoutSignature['Blocks']['prepend'], string];\n append: [...EuiFormControlLayoutSignature['Blocks']['append'], string];\n };\n}\n\nconst EuiFieldText: TemplateOnlyComponent<EuiFieldTextSignature> = <template>\n {{#let\n (and (not (argOrDefault @isFakePrependBlock false)) (has-block \"prepend\"))\n (and (not (argOrDefault @isFakeAppendBlock false)) (has-block \"append\"))\n (argOrDefault @id (randomId))\n as |hasPrepend hasAppend inputId|\n }}\n {{#let\n (classNames\n (if @icon \"euiFieldText--withIcon\")\n (if @fullWidth \"euiFieldText--fullWidth\")\n (if @compressed \"euiFieldText--compressed\")\n (if (or hasPrepend hasAppend) \"euiFieldText--inGroup\")\n (if @isLoading \"euiFieldText--isLoading\")\n \"euiFieldText\"\n )\n as |classes|\n }}\n {{#if @controlOnly}}\n <input\n id={{inputId}}\n value={{@value}}\n class={{classes}}\n disabled={{@disabled}}\n type=\"text\"\n placeholder={{@placeholder}}\n readonly={{@readOnly}}\n ...attributes\n {{validatableControl @isInvalid}}\n {{didInsert (optional @inputRef)}}\n />\n {{else}}\n <EuiFormControlLayout\n @icon={{@icon}}\n @clear={{@clear}}\n @fullWidth={{@fullWidth}}\n @isLoading={{@isLoading}}\n @compressed={{@compressed}}\n @readOnly={{@readOnly}}\n @disabled={{@disabled}}\n @useGroup={{or hasPrepend hasAppend}}\n >\n <:prepend as |prependClasses|>\n {{yield prependClasses inputId to=\"prepend\"}}\n </:prepend>\n <:field>\n <input\n id={{inputId}}\n value={{@value}}\n class={{classes}}\n disabled={{@disabled}}\n type=\"text\"\n placeholder={{@placeholder}}\n readonly={{@readOnly}}\n ...attributes\n {{validatableControl @isInvalid}}\n />\n </:field>\n <:append as |appendClasses|>\n {{yield appendClasses inputId to=\"append\"}}\n </:append>\n </EuiFormControlLayout>\n {{/if}}\n {{/let}}\n {{/let}}\n</template>;\n\nexport default EuiFieldText;\n"],"names":["EuiFieldText","setComponentTemplate","precompileTemplate","strictMode","scope","and","not","argOrDefault","randomId","classNames","or","validatableControl","didInsert","optional","EuiFormControlLayout","templateOnly"],"mappings":";;;;;;;;;;;;AAuCA,MAAMA,YAA6D,GAAAC,oBAAA,CAAAC,kBAAA,CAiEnE,ukDAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,GAAA;IAAAC,GAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,kBAAA;IAAAC,SAAA;IAAAC,QAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
@@ -180,11 +180,11 @@ class EuiPopoverComponent extends Component {
180
180
  updateFocusAnimationFrame;
181
181
  hasSetInitialFocus = false;
182
182
  static {
183
- g(this.prototype, "button", [tracked], function () {
183
+ g(this.prototype, "_button", [tracked], function () {
184
184
  return null;
185
185
  });
186
186
  }
187
- #button = (i(this, "button"), void 0);
187
+ #_button = (i(this, "_button"), void 0);
188
188
  static {
189
189
  g(this.prototype, "panel", [tracked], function () {
190
190
  return null;
@@ -198,6 +198,12 @@ class EuiPopoverComponent extends Component {
198
198
  this.suppressingPopover = this.isOpen;
199
199
  this.isCurrentlyOpen = this.isOpen;
200
200
  }
201
+ get button() {
202
+ if (this.args.button) {
203
+ return this.args.button;
204
+ }
205
+ return this._button;
206
+ }
201
207
  get insert() {
202
208
  if (this.args.insert) {
203
209
  return this.args.insert;
@@ -400,7 +406,7 @@ class EuiPopoverComponent extends Component {
400
406
  window.removeEventListener('scroll', this.positionPopoverFixed, true);
401
407
  window.removeEventListener('resize', this.positionPopoverFluid);
402
408
  this.popoverHost = null;
403
- this.button = null;
409
+ this._button = null;
404
410
  this.panel = null;
405
411
  cancel(this.respositionTimeout);
406
412
  cancel(this.closingTransitionTimeout);
@@ -507,7 +513,7 @@ class EuiPopoverComponent extends Component {
507
513
  n(this.prototype, "positionPopoverFluid", [action]);
508
514
  }
509
515
  registerButton(btn) {
510
- this.button = btn;
516
+ this._button = btn;
511
517
  this.args.buttonRef?.(btn);
512
518
  }
513
519
  static {
@@ -534,7 +540,7 @@ class EuiPopoverComponent extends Component {
534
540
  n(this.prototype, "registerPanel", [action]);
535
541
  }
536
542
  static {
537
- setComponentTemplate(precompileTemplate("\n {{#let (randomId) (classNames (if this.isOpening \"euiPopover-isOpen\") position=this.anchorPosition display=this.display componentName=\"EuiPopover\") (classNames \"euiPopover__panel\" (concat \"euiPopover__panel--\" this.arrowPosition) (if this.isOpening \"euiPopover__panel-isOpen\") (if (or (not this.hasArrow) @attachToAnchor) \"euiPopover__panel-noArrow\") (if @attachToAnchor \"euiPopover__panel-isAttached\") @panelClassName) as |descriptionId classes panelClasses|}}\n <div class={{classes}} {{onKey \"_all\" this.onKeyDown priority=1}} {{didInsert this.didInsertPopover}} {{didUpdate this.didUpdateIsOpen @isOpen}} {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}} {{didInsert (optional @popoverRef)}} ...attributes>\n\n {{!-- button --}}\n <div class=\"euiPopover__anchor {{@anchorClassName}}\" {{didInsert this.registerButton}}>\n {{yield to=\"button\"}}\n </div>\n\n {{!-- content --}}\n {{#if (and (not this.suppressingPopover) (or this.isCurrentlyOpen this.isClosing))}}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n {{#let (randomId) as |panelId|}}\n <EuiPanel id={{panelId}} class={{panelClasses}} aria-live={{if this.ownFocus \"off\" \"assertive\"}} role=\"dialog\" aria-label={{@ariaLabel}} aria-labelledby={{@ariaLabelledBy}} aria-modal=\"true\" aria-describedby={{if this.ownFocus descriptionId}} tabindex={{this.tabindex}} @hasShadow={{false}} @paddingSize={{this.panelPaddingSize}} {{simpleStyle this._popoverStyles}} {{didInsert this.registerPanel}} {{outsideClickDetector onOutsideClick=this.onClickOutside}} {{onKey \"Escape\" this.onEscapeKey}} {{focusTrap isActive=(not (or (not this.ownFocus) (not this.isOpenStable) this.isClosing)) shouldSelfFocus=this.shouldSelfFocus isPaused=this.isFocusTrapPaused focusTrapOptions=(merge (hash returnFocusOnDeactivate=this.isOpenStable initialFocus=(or @initialFocus this.panel) onDeactivate=(optional @onTrapDeactivation) preventScroll=true clickOutsideDeactivates=true fallbackFocus=(concat \"#\" panelId)) @focusTrapOptions)}}>\n <div class={{concat \"euiPopover__panelArrow euiPopover__panelArrow--\" this.arrowPosition}} style={{this._arrowStyles}}>\n {{yield to=\"arrowChildren\"}}\n </div>\n {{#if this.ownFocus}}\n <p id={{descriptionId}} {{screenReaderOnly}}>\n You are in a dialog. To close this dialog, hit escape.\n </p>\n {{/if}}\n <div {{mutationObserver onMutation=this.onMutation observerOptions=(merge (hash attributes=true childList=true characterData=true subtree=true) @mutationObserverOptions)}}>\n {{yield to=\"content\"}}\n </div>\n </EuiPanel>\n {{/let}}\n </EuiPortal>\n {{/if}}\n\n </div>\n {{/let}}\n ", {
543
+ setComponentTemplate(precompileTemplate("\n {{#let (randomId) (classNames (if this.isOpening \"euiPopover-isOpen\") position=this.anchorPosition display=this.display componentName=\"EuiPopover\") (classNames \"euiPopover__panel\" (concat \"euiPopover__panel--\" this.arrowPosition) (if this.isOpening \"euiPopover__panel-isOpen\") (if (or (not this.hasArrow) @attachToAnchor) \"euiPopover__panel-noArrow\") (if @attachToAnchor \"euiPopover__panel-isAttached\") @panelClassName) as |descriptionId classes panelClasses|}}\n <div class={{classes}} {{onKey \"_all\" this.onKeyDown priority=1}} {{didInsert this.didInsertPopover}} {{didUpdate this.didUpdateIsOpen @isOpen}} {{didUpdate this.didUpdateRepositionOnScroll @repositionOnScroll}} {{didInsert (optional @popoverRef)}} ...attributes>\n\n {{!-- button --}}\n {{#if (has-block \"button\")}}\n <div class=\"euiPopover__anchor {{@anchorClassName}}\" {{didInsert this.registerButton}}>\n {{yield to=\"button\"}}\n </div>\n {{/if}}\n \n {{!-- content --}}\n {{#if (and (not this.suppressingPopover) (or this.isCurrentlyOpen this.isClosing))}}\n <EuiPortal @insert={{this.insert}} @portalRef={{@portalRef}}>\n {{#let (randomId) as |panelId|}}\n <EuiPanel id={{panelId}} class={{panelClasses}} aria-live={{if this.ownFocus \"off\" \"assertive\"}} role=\"dialog\" aria-label={{@ariaLabel}} aria-labelledby={{@ariaLabelledBy}} aria-modal=\"true\" aria-describedby={{if this.ownFocus descriptionId}} tabindex={{this.tabindex}} @hasShadow={{false}} @paddingSize={{this.panelPaddingSize}} {{simpleStyle this._popoverStyles}} {{didInsert this.registerPanel}} {{outsideClickDetector onOutsideClick=this.onClickOutside}} {{onKey \"Escape\" this.onEscapeKey}} {{focusTrap isActive=(not (or (not this.ownFocus) (not this.isOpenStable) this.isClosing)) shouldSelfFocus=this.shouldSelfFocus isPaused=this.isFocusTrapPaused focusTrapOptions=(merge (hash returnFocusOnDeactivate=this.isOpenStable initialFocus=(or @initialFocus this.panel) onDeactivate=(optional @onTrapDeactivation) preventScroll=true clickOutsideDeactivates=true fallbackFocus=(concat \"#\" panelId)) @focusTrapOptions)}}>\n <div class={{concat \"euiPopover__panelArrow euiPopover__panelArrow--\" this.arrowPosition}} style={{this._arrowStyles}}>\n {{yield to=\"arrowChildren\"}}\n </div>\n {{#if this.ownFocus}}\n <p id={{descriptionId}} {{screenReaderOnly}}>\n You are in a dialog. To close this dialog, hit escape.\n </p>\n {{/if}}\n <div {{mutationObserver onMutation=this.onMutation observerOptions=(merge (hash attributes=true childList=true characterData=true subtree=true) @mutationObserverOptions)}}>\n {{yield to=\"content\"}}\n </div>\n </EuiPanel>\n {{/let}}\n </EuiPortal>\n {{/if}}\n\n </div>\n {{/let}}\n ", {
538
544
  strictMode: true,
539
545
  scope: () => ({
540
546
  randomId,