@ember-eui/core 16.0.2 → 16.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/-private/accents.d.ts +15 -0
- package/declarations/-private/accents.d.ts.map +1 -0
- package/declarations/-private/eui-render-node.d.ts +8 -3
- package/declarations/-private/eui-render-node.d.ts.map +1 -1
- package/declarations/components/eui-accordion.d.ts.map +1 -1
- package/declarations/components/eui-combo-box/option-text.d.ts +7 -1
- package/declarations/components/eui-combo-box/option-text.d.ts.map +1 -1
- package/declarations/components/eui-combo-box/trigger/input.d.ts +9 -0
- package/declarations/components/eui-combo-box/trigger/input.d.ts.map +1 -1
- package/declarations/components/eui-combo-box/trigger.d.ts +13 -0
- package/declarations/components/eui-combo-box/trigger.d.ts.map +1 -1
- package/declarations/components/eui-combo-box.d.ts +26 -1
- package/declarations/components/eui-combo-box.d.ts.map +1 -1
- package/declarations/components/eui-highlight.d.ts +12 -3
- package/declarations/components/eui-highlight.d.ts.map +1 -1
- package/declarations/components/eui-toast.d.ts.map +1 -1
- package/declarations/services/eui-config.d.ts +5 -0
- package/declarations/services/eui-config.d.ts.map +1 -1
- package/declarations/utils/eui/combo-box.d.ts +1 -5
- package/declarations/utils/eui/combo-box.d.ts.map +1 -1
- package/dist/-private/accents.js +40 -0
- package/dist/-private/accents.js.map +1 -0
- package/dist/-private/eui-render-node.js +6 -4
- package/dist/-private/eui-render-node.js.map +1 -1
- package/dist/components/eui-accordion.js +17 -3
- package/dist/components/eui-accordion.js.map +1 -1
- package/dist/components/eui-combo-box/option-text.js +14 -6
- package/dist/components/eui-combo-box/option-text.js.map +1 -1
- package/dist/components/eui-combo-box/trigger/input.js +23 -2
- package/dist/components/eui-combo-box/trigger/input.js.map +1 -1
- package/dist/components/eui-combo-box/trigger.js +32 -2
- package/dist/components/eui-combo-box/trigger.js.map +1 -1
- package/dist/components/eui-combo-box.js +24 -5
- package/dist/components/eui-combo-box.js.map +1 -1
- package/dist/components/eui-highlight.js +22 -8
- package/dist/components/eui-highlight.js.map +1 -1
- package/dist/components/eui-toast.js +6 -4
- package/dist/components/eui-toast.js.map +1 -1
- package/dist/services/eui-config.js.map +1 -1
- package/dist/utils/eui/combo-box.js +5 -3
- package/dist/utils/eui/combo-box.js.map +1 -1
- package/package.json +1 -1
|
@@ -65,13 +65,25 @@ class EuiComboBoxComponent extends Component {
|
|
|
65
65
|
g(this.prototype, "euiI18n", [service]);
|
|
66
66
|
}
|
|
67
67
|
#euiI18n = (i(this, "euiI18n"), void 0);
|
|
68
|
+
static {
|
|
69
|
+
g(this.prototype, "euiConfig", [service('eui-config')]);
|
|
70
|
+
}
|
|
71
|
+
#euiConfig = (i(this, "euiConfig"), void 0);
|
|
72
|
+
/**
|
|
73
|
+
* `@ignoreAccents`, else the app's `euiComboBox.ignoreAccents`
|
|
74
|
+
* (eui-config), else `false` (upstream).
|
|
75
|
+
*/
|
|
76
|
+
get ignoreAccents() {
|
|
77
|
+
return this.args.ignoreAccents ?? this.euiConfig?.getConfig('euiComboBox.ignoreAccents') ?? false;
|
|
78
|
+
}
|
|
79
|
+
// UI state only: everything else is derived from the arguments
|
|
80
|
+
/** ember-power-select's API (open state, highlighted option, …). */
|
|
68
81
|
static {
|
|
69
82
|
g(this.prototype, "select", [tracked], function () {
|
|
70
83
|
return null;
|
|
71
84
|
});
|
|
72
85
|
}
|
|
73
|
-
#select = (i(this, "select"), void 0);
|
|
74
|
-
/** ember-power-select's API (open state, highlighted option, …). */
|
|
86
|
+
#select = (i(this, "select"), void 0);
|
|
75
87
|
static {
|
|
76
88
|
g(this.prototype, "searchValue", [tracked], function () {
|
|
77
89
|
return '';
|
|
@@ -258,7 +270,7 @@ class EuiComboBoxComponent extends Component {
|
|
|
258
270
|
searchValue
|
|
259
271
|
}) => matcher(option, searchValue) >= 0;
|
|
260
272
|
}
|
|
261
|
-
return createPartialStringEqualityOptionMatcher(searchField);
|
|
273
|
+
return createPartialStringEqualityOptionMatcher(searchField, this.ignoreAccents);
|
|
262
274
|
}
|
|
263
275
|
/** Upstream `getMatchingOptions` (with group titles) for a search text. */
|
|
264
276
|
static {
|
|
@@ -440,7 +452,7 @@ class EuiComboBoxComponent extends Component {
|
|
|
440
452
|
/** ember-power-select must not filter the matches again. */
|
|
441
453
|
matchAll = () => 0;
|
|
442
454
|
static {
|
|
443
|
-
setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n\n<PowerSelect @multiple={{true}} {{spreadAttributes @inputPopoverProps this.inputPopoverArgs}} ...attributes @onChange={{this.onChange}} @onFocus={{this.onFocus}} @onBlur={{this.onBlur}} @onOpen={{this.onOpen}} @onClose={{this.onClose}} @placeholderComponent={{@placeholderComponent}} @searchMessage={{this.searchMessage}} @searchMessageComponent={{if @searchMessageComponent @searchMessageComponent EuiComboBoxSearchMessage}} @noMatchesMessage={{this.noMatchesMessage}} @matchTriggerWidth={{@matchTriggerWidth}} @options={{this.powerSelectOptions}} @selected={{@selectedOptions}} @closeOnSelect={{this.closeOnSelect}} @defaultHighlighted={{if @defaultHighlighted @defaultHighlighted this.defaultHighlighted}} @highlightOnHover={{false}} @searchField={{@searchField}} @searchEnabled={{argOrDefault @searchEnabled true}} @tabindex={{if (argOrDefault @searchEnabled true) \"-1\" @tabindex}} @initiallyOpened={{and (not @isDisabled) @autoFocus (not @noSuggestions)}} @triggerComponent={{component EuiComboBoxTrigger fullWidth=@fullWidth compressed=@compressed isInvalid=this.markAsInvalid singleSelection=@singleSelection onClose=@removeTag isLoading=@isLoading autoFocus=(and (not @isDisabled) @autoFocus) icon=@triggerIcon prepend=@prepend append=@append noSuggestions=@noSuggestions inputTabindex=@tabindex inputRef=@inputRef inputRole=@triggerRole inputAriaLabel=@ariaLabel inputAriaLabelledBy=@ariaLabelledBy inputRequired=@required onClear=this.clearSelectedOptions onToggleList=this.onToggleListClick onToggleBlur=this.onToggleBlur onToggleKeydown=this.onToggleKeydown onPlainTextClick=this.onPlainTextClick screenReaderInstructions=this.screenReaderInstructions}} @matcher={{this.matchAll}} @initiallyOpen={{@initiallyOpen}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @buildSelection={{this.buildSelection}} @search={{this.search}} @onInput={{this.onInput}} @onKeydown={{this.onKeydown}} @scrollTo={{this.scrollTo}} @registerAPI={{queue this.registerAPI (optional @registerApi)}} @horizontalPosition={{@horizontalPosition}} @destination={{@destination}} @preventScroll={{@preventScroll}} @renderInPlace={{@renderInPlace}} @verticalPosition={{this.verticalPosition}} @disabled={{@isDisabled}} @calculatePosition={{this.calculatePosition}} @eventType={{@eventType}} @ariaLabel={{unless (argOrDefault @searchEnabled true) @ariaLabel}} @ariaLabelledBy={{unless (argOrDefault @searchEnabled true) @ariaLabelledBy}} @required={{unless (argOrDefault @searchEnabled true) @required}} @triggerRole={{if (argOrDefault @searchEnabled true) \"presentation\" @triggerRole}} @title={{@title}} @triggerId={{@triggerId}} @allowClear={{and (argOrDefault @isClearable true) (not @isDisabled)}} @loadingMessage={{this.loadingMessage}} @selectedItemComponent={{@selectedItemComponent}} @beforeOptionsComponent={{@beforeOptionsComponent}} @afterOptionsComponent={{if @afterOptionsComponent @afterOptionsComponent (if (and @onCreateOption (not this.select.loading) (not this.isLoadingOptions) this.searchValue this.alwaysShowCreateOption (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=true delimiter=@delimiter))}} @placeholder={{@placeholder}} @searchPlaceholder={{@searchPlaceholder}} @optionsComponent={{component EuiComboBoxOptions rowHeight=@rowHeight truncationProps=@truncationProps class=@optionsClass singleSelection=(if @singleSelection true false) selectedOptions=this.selectedOptions searchField=@searchField isLoading=this.isLoadingOptions onFocusBadge=@onFocusBadge listboxAriaLabel=this.listboxAriaLabel}} @extra={{@extra}} @groupComponent={{component EuiComboBoxGroup}} @triggerClass={{classNames \"euiComboBox\" this.rootClass @inputPopoverProps.className (if @isDisabled \"euiComboBox-isDisabled\") (if this.markAsInvalid \"euiComboBox-isInvalid\") (if this.select.isOpen \"euiComboBox-isOpen\")}} @noMatchesMessageComponent={{if this.isLoadingOptions (component EuiComboBoxOptions isLoading=true loadingMessage=this.loadingMessage) (if (and @onCreateOption this.searchValue (not this.alwaysShowCreateOption) (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=false delimiter=@delimiter) (component EuiComboBoxNoMatchesMessage message=(if this.alreadyAddedMessage this.alreadyAddedMessage this.emptyStateMessage)))}} @dropdownClass={{this.dropdownClass}} as |option i|>\n {{#if (has-block)}}\n {{yield option i (if (this.isOptionRow i) this.searchValue \"\")}}\n {{else if (this.isOptionRow i)}}\n <EuiComboBoxOptionText @text={{this.labelFor option}} @search={{this.searchValue}} @isCaseSensitive={{@isCaseSensitive}} @rowHeight={{@rowHeight}} @truncationProps={{this.truncationFor option}} @width={{this.optionWidth}} @onResize={{this.setOptionWidth}} />\n {{else}}\n {{this.labelFor option}}\n {{/if}}\n</PowerSelect>", {
|
|
455
|
+
setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n\n<PowerSelect @multiple={{true}} {{spreadAttributes @inputPopoverProps this.inputPopoverArgs}} ...attributes @onChange={{this.onChange}} @onFocus={{this.onFocus}} @onBlur={{this.onBlur}} @onOpen={{this.onOpen}} @onClose={{this.onClose}} @placeholderComponent={{@placeholderComponent}} @searchMessage={{this.searchMessage}} @searchMessageComponent={{if @searchMessageComponent @searchMessageComponent EuiComboBoxSearchMessage}} @noMatchesMessage={{this.noMatchesMessage}} @matchTriggerWidth={{@matchTriggerWidth}} @options={{this.powerSelectOptions}} @selected={{@selectedOptions}} @closeOnSelect={{this.closeOnSelect}} @defaultHighlighted={{if @defaultHighlighted @defaultHighlighted this.defaultHighlighted}} @highlightOnHover={{false}} @searchField={{@searchField}} @searchEnabled={{argOrDefault @searchEnabled true}} @tabindex={{if (argOrDefault @searchEnabled true) \"-1\" @tabindex}} @initiallyOpened={{and (not @isDisabled) @autoFocus (not @noSuggestions)}} @triggerComponent={{component EuiComboBoxTrigger fullWidth=@fullWidth compressed=@compressed isInvalid=this.markAsInvalid singleSelection=@singleSelection hasOptionBlock=(has-block) onClose=@removeTag isLoading=@isLoading autoFocus=(and (not @isDisabled) @autoFocus) icon=@triggerIcon prepend=@prepend append=@append noSuggestions=@noSuggestions inputTabindex=@tabindex inputRef=@inputRef inputRole=@triggerRole inputAriaLabel=@ariaLabel inputAriaLabelledBy=@ariaLabelledBy inputRequired=@required onClear=this.clearSelectedOptions onToggleList=this.onToggleListClick onToggleBlur=this.onToggleBlur onToggleKeydown=this.onToggleKeydown onPlainTextClick=this.onPlainTextClick screenReaderInstructions=this.screenReaderInstructions}} @matcher={{this.matchAll}} @initiallyOpen={{@initiallyOpen}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @buildSelection={{this.buildSelection}} @search={{this.search}} @onInput={{this.onInput}} @onKeydown={{this.onKeydown}} @scrollTo={{this.scrollTo}} @registerAPI={{queue this.registerAPI (optional @registerApi)}} @horizontalPosition={{@horizontalPosition}} @destination={{@destination}} @preventScroll={{@preventScroll}} @renderInPlace={{@renderInPlace}} @verticalPosition={{this.verticalPosition}} @disabled={{@isDisabled}} @calculatePosition={{this.calculatePosition}} @eventType={{@eventType}} @ariaLabel={{unless (argOrDefault @searchEnabled true) @ariaLabel}} @ariaLabelledBy={{unless (argOrDefault @searchEnabled true) @ariaLabelledBy}} @required={{unless (argOrDefault @searchEnabled true) @required}} @triggerRole={{if (argOrDefault @searchEnabled true) \"presentation\" @triggerRole}} @title={{@title}} @triggerId={{@triggerId}} @allowClear={{and (argOrDefault @isClearable true) (not @isDisabled)}} @loadingMessage={{this.loadingMessage}} @selectedItemComponent={{@selectedItemComponent}} @beforeOptionsComponent={{@beforeOptionsComponent}} @afterOptionsComponent={{if @afterOptionsComponent @afterOptionsComponent (if (and @onCreateOption (not this.select.loading) (not this.isLoadingOptions) this.searchValue this.alwaysShowCreateOption (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=true delimiter=@delimiter))}} @placeholder={{@placeholder}} @searchPlaceholder={{@searchPlaceholder}} @optionsComponent={{component EuiComboBoxOptions rowHeight=@rowHeight truncationProps=@truncationProps class=@optionsClass singleSelection=(if @singleSelection true false) selectedOptions=this.selectedOptions searchField=@searchField isLoading=this.isLoadingOptions onFocusBadge=@onFocusBadge listboxAriaLabel=this.listboxAriaLabel}} @extra={{@extra}} @groupComponent={{component EuiComboBoxGroup}} @triggerClass={{classNames \"euiComboBox\" this.rootClass @inputPopoverProps.className (if @isDisabled \"euiComboBox-isDisabled\") (if this.markAsInvalid \"euiComboBox-isInvalid\") (if this.select.isOpen \"euiComboBox-isOpen\")}} @noMatchesMessageComponent={{if this.isLoadingOptions (component EuiComboBoxOptions isLoading=true loadingMessage=this.loadingMessage) (if (and @onCreateOption this.searchValue (not this.alwaysShowCreateOption) (not this.alreadyAddedMessage)) (component EuiComboBoxCreateOption customOptionText=@customOptionText onCreateOption=this.onCreateOption select=this.select alwaysShow=false delimiter=@delimiter) (component EuiComboBoxNoMatchesMessage message=(if this.alreadyAddedMessage this.alreadyAddedMessage this.emptyStateMessage)))}} @dropdownClass={{this.dropdownClass}} as |option i|>\n {{#if (has-block)}}\n {{yield option i (if (this.isOptionRow i) this.searchValue \"\")}}\n {{else if (this.isOptionRow i)}}\n <EuiComboBoxOptionText @text={{this.labelFor option}} @search={{this.searchValue}} @isCaseSensitive={{@isCaseSensitive}} @ignoreAccents={{this.ignoreAccents}} @rowHeight={{@rowHeight}} @truncationProps={{this.truncationFor option}} @width={{this.optionWidth}} @onResize={{this.setOptionWidth}} />\n {{else}}\n {{this.labelFor option}}\n {{/if}}\n</PowerSelect>", {
|
|
444
456
|
strictMode: true,
|
|
445
457
|
scope: () => ({
|
|
446
458
|
PowerSelect,
|
|
@@ -1133,7 +1145,14 @@ function toList(collection) {
|
|
|
1133
1145
|
if (!collection) return [];
|
|
1134
1146
|
if (Array.isArray(collection)) return collection;
|
|
1135
1147
|
if (isArray(collection)) {
|
|
1136
|
-
|
|
1148
|
+
// Ember arrays, ArrayProxy, PromiseManyArray (ember-data), …
|
|
1149
|
+
const list = collection;
|
|
1150
|
+
if (typeof list.slice === 'function') return list.slice();
|
|
1151
|
+
if (typeof list.toArray === 'function') return list.toArray();
|
|
1152
|
+
if (typeof list[Symbol.iterator] === 'function') {
|
|
1153
|
+
return Array.from(list);
|
|
1154
|
+
}
|
|
1155
|
+
return list.content ? toList(list.content) : [];
|
|
1137
1156
|
}
|
|
1138
1157
|
return [];
|
|
1139
1158
|
}
|