@ember-eui/core 14.1.1 → 14.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/eui-combo-box/options.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/eui-combo-box/options.gts"],"names":[],"mappings":"AAqJA,OAAO,uBAAuB,MAAM,oDAAoD,CAAC;AAYzF,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,uBAAuB;IAC7D,SAAS,EAAE,gBAAgB,CAAC;IAE7C;;;OAGG;IACH,IACI,cAAc,IAAI,OAAO,EAAE,CAI9B;IAED,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAW9B,IAAI,eAAe,WAIlB;IAED,IAAI,SAAS,QAGZ;IAED,IAAI,eAAe,0CAElB;CA0JF"}
|
|
@@ -50,7 +50,7 @@ class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {
|
|
|
50
50
|
return htmlSafe(`height:${this.rowHeight}px;`);
|
|
51
51
|
}
|
|
52
52
|
static {
|
|
53
|
-
setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n{{#let (component @groupComponent) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup @gutterSize=\"s\" @justifyContent=\"center\" @responsive={{false}}>\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 @items={{this.flattedOptions}} @tagName=\"div\" @estimateHeight={{this.rowHeight}} @staticHeight={{true}} @bufferSize={{3}} style=\"overflow-y: auto;\" role=\"listbox\" aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\" class={{classNames \"euiComboBoxOptionsList__rowWrap\" @class}} {{this.setupHandlers}} ...attributes as |opt index|>\n {{!-- template-lint-enable --}}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group @group={{opt}} @select={{@select}} @extra={{@extra}} style={{this.rowHeightString}}
|
|
53
|
+
setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n{{#let (component @groupComponent) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup @gutterSize=\"s\" @justifyContent=\"center\" @responsive={{false}}>\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 @items={{this.flattedOptions}} @tagName=\"div\" @estimateHeight={{this.rowHeight}} @staticHeight={{true}} @bufferSize={{3}} style=\"overflow-y: auto;\" role=\"listbox\" aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\" class={{classNames \"euiComboBoxOptionsList__rowWrap\" @class}} {{this.setupHandlers}} ...attributes as |opt index|>\n {{!-- template-lint-enable --}}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group @group={{opt}} @select={{@select}} @extra={{@extra}} style={{this.rowHeightString}} />\n {{else}}\n <button type=\"button\" style={{this.rowHeightString}} class=\"euiFilterSelectItem\n {{if (eq opt @select.highlighted) \" euiFilterSelectItem-isFocused\"}}\" aria-selected=\"{{emberPowerSelectIsEqual opt @select.selected}}\" aria-disabled={{if opt.disabled \"true\"}} aria-current=\"{{eq opt @select.highlighted}}\" data-option-index=\"{{index}}\" role=\"option\" tabindex={{if opt.disabled \"-1\" \"0\"}}>\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 class=\"euiComboBoxOption__enterBadge\" @color=\"hollow\" @iconType=\"returnKey\" aria-hidden=\"true\" />\n {{/if}}\n </span>\n </button>\n {{/if}}\n </VerticalCollection>\n {{/if}}\n{{/let}}", {
|
|
54
54
|
strictMode: true,
|
|
55
55
|
scope: () => ({
|
|
56
56
|
EuiText: EuiTextComponent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sources":["../../../src/components/eui-combo-box/options.gts"],"sourcesContent":["import { cached } from '@glimmer/tracking';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\n//@ts-expect-error\nimport { VerticalCollection } from '@html-next/vertical-collection';\nimport EmberPowerSelectOptions from 'ember-power-select/components/power-select/options';\nimport emberPowerSelectIsEqual from 'ember-power-select/helpers/ember-power-select-is-equal';\nimport emberPowerSelectIsGroup 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\n/**\n * @private EuiComboBox's options list: virtualized, with groups. Extends\n * ember-power-select's options component.\n */\nexport default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {\n @service declare euiConfig: EuiConfigService;\n\n /**\n * Groups followed by their options, in one list (the rows of the\n * virtualized list; `data-option-index` is an index in it).\n */\n @cached\n get flattedOptions(): unknown[] {\n return (this.args.options ?? []).flatMap((option) =>\n emberPowerSelectIsGroup(option) ? [option, ...option.options] : [option]\n );\n }\n\n _optionFromIndex(index: string) {\n const parts = index.split('.');\n let option: any = this.flattedOptions[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 @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 {{this.setupHandlers}}\n ...attributes\n as |opt index|\n >\n {{! template-lint-enable }}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group\n @group={{opt}}\n @select={{@select}}\n @extra={{@extra}}\n style={{this.rowHeightString}}\n
|
|
1
|
+
{"version":3,"file":"options.js","sources":["../../../src/components/eui-combo-box/options.gts"],"sourcesContent":["import { cached } from '@glimmer/tracking';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\n//@ts-expect-error\nimport { VerticalCollection } from '@html-next/vertical-collection';\nimport EmberPowerSelectOptions from 'ember-power-select/components/power-select/options';\nimport emberPowerSelectIsEqual from 'ember-power-select/helpers/ember-power-select-is-equal';\nimport emberPowerSelectIsGroup 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\n/**\n * @private EuiComboBox's options list: virtualized, with groups. Extends\n * ember-power-select's options component.\n */\nexport default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {\n @service declare euiConfig: EuiConfigService;\n\n /**\n * Groups followed by their options, in one list (the rows of the\n * virtualized list; `data-option-index` is an index in it).\n */\n @cached\n get flattedOptions(): unknown[] {\n return (this.args.options ?? []).flatMap((option) =>\n emberPowerSelectIsGroup(option) ? [option, ...option.options] : [option]\n );\n }\n\n _optionFromIndex(index: string) {\n const parts = index.split('.');\n let option: any = this.flattedOptions[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 @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 {{this.setupHandlers}}\n ...attributes\n as |opt index|\n >\n {{! template-lint-enable }}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group\n @group={{opt}}\n @select={{@select}}\n @extra={{@extra}}\n style={{this.rowHeightString}}\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","flattedOptions","args","options","flatMap","option","emberPowerSelectIsGroup","n","cached","_optionFromIndex","index","parts","split","parseInt","length","configRowHeight","euiConfig","getConfig","rowHeight","rowHeightString","htmlSafe","setComponentTemplate","precompileTemplate","strictMode","scope","EuiText","EuiFlexGroup","EuiFlexItem","EuiLoadingSpinner","VerticalCollection","classNames","eq","emberPowerSelectIsEqual","and","not","EuiBadge"],"mappings":";;;;;;;;;;;;;;;;;;AAwBe,MAAMA,2BAAA,SAAoCC,uBAAA,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACtDC,OAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAED;;;AAGC;EACD,IACIC,cAAAA,GAA4B;AAC9B,IAAA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACC,OAAO,IAAI,EAAE,EAAEC,OAAO,CAAEC,MAAA,IACxCC,wBAAwBD,MAAA,CAAA,GAAU,CAACA,MAAA,EAAW,GAAAA,MAAA,CAAOF,OAAO,CAAC,GAAG,CAACE,MAAA,CAAO,CAAA;AAE5E,EAAA;AAAA,EAAA;IAAAE,CAAA,CAAA,IAAA,CAAAT,SAAA,EAAA,gBAAA,EAAA,CALCU,MAAA,CAAA,CAAA;AAAA;EAODC,gBAAAA,CAAiBC,KAAa,EAAE;AAC9B,IAAA,MAAMC,KAAA,GAAQD,KAAA,CAAME,KAAK,CAAC,GAAA,CAAA;AAC1B,IAAA,IAAIP,MAAW,GAAG,IAAI,CAACJ,cAAc,CAACY,QAAA,CAASF,KAAK,CAAC,CAAA,CAAE,EAAG,EAAA,CAAA,CAAI;AAE9D,IAAA,KAAK,IAAIX,CAAA,GAAI,CAAA,EAAGA,IAAIW,KAAA,CAAMG,MAAM,EAAEd,CAAA,EAAA,EAAK;AACrCK,MAAAA,MAAA,GAASA,MAAA,CAAOF,OAAO,CAACU,QAAA,CAASF,KAAK,CAACX,CAAA,CAAE,EAAG,EAAA,CAAA,CAAI;AAClD,IAAA;AAEA,IAAA,OAAOK,MAAA;AACT,EAAA;EAEA,IAAIU,eAAAA,GAAkB;IACpB,OACG,IAAI,CAACC,SAAS,CAACC,SAAS,CAAC,0BAAA,CAAA,IAA0C,EACtE;AACF,EAAA;EAEA,IAAIC,SAAAA,GAAY;AACd;IACA,OAAO,IAAI,CAAChB,IAAI,CAACgB,SAAS,IAAI,IAAI,CAACH,eAAe;AACpD,EAAA;EAEA,IAAII,eAAAA,GAAkB;AACpB,IAAA,OAAOC,QAAA,CAAS,CAAA,OAAA,EAAU,IAAI,CAACF,SAAS,KAAK,CAAA;AAC/C,EAAA;AAEA,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAAA,qnEAAA,EA6EA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;iBAAAC,gBAAA;QAAAC,YAAA;QAAAC,WAAA;QAAAC,iBAAA;QAAAC,kBAAA;QAAAC,UAAA;QAAAxB,uBAAA;QAAAyB,EAAA;QAAAC,uBAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|