File tree Expand file tree Collapse file tree 2 files changed +13
-22
lines changed
packages/core/addon/components/eui-combo-box/options Expand file tree Collapse file tree 2 files changed +13
-22
lines changed Original file line number Diff line number Diff line change 1- {{ #let
2- (component (ensure-safe-component @groupComponent ))
3- as |Group |}}
1+ {{ #let (component (ensure-safe-component @groupComponent )) as |Group |}}
42 {{ #if @select.loading }}
53 <EuiText @size =" xs" class =" euiComboBoxOptionsList__empty" >
6- <EuiFlexGroup @gutterSize =" s" @justifyContent =" center" >
4+ <EuiFlexGroup
5+ @gutterSize =" s"
6+ @justifyContent =" center"
7+ @responsive ={{ false }}
8+ >
79 <EuiFlexItem @grow ={{ false }} >
810 <EuiLoadingSpinner @size =" m" />
911 </EuiFlexItem >
@@ -35,16 +37,12 @@ as |Group|}}
3537 @group ={{ opt }}
3638 @select ={{ @select }}
3739 @extra ={{ @extra }}
38- style ={{ html-safe
39- (concat " height:" this.rowHeight " px;" )
40- }}
40+ style ={{ html-safe (concat " height:" this.rowHeight " px;" )}}
4141 data-option-index =" {{ index }} "
4242 />
4343 {{ else }}
4444 <li
45- style ={{ html-safe
46- (concat " height:" this.rowHeight " px;" )
47- }}
45+ style ={{ html-safe (concat " height:" this.rowHeight " px;" )}}
4846 class =" euiFilterSelectItem
4947 {{ if
5048 (eq opt @select.highlighted )
Original file line number Diff line number Diff line change 11import EmberPowerSelectOptions from 'ember-power-select/components/power-select/options' ;
22import { emberPowerSelectIsGroup } from 'ember-power-select/helpers/ember-power-select-is-group' ;
3- import { tracked } from '@glimmer/tracking' ;
43import config from 'ember-get-config' ;
54
65const rowHeight = config [ '@ember-eui/core' ] ?. euiComboBoxOptionsHeight || 29 ;
76export default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {
8- @tracked flattedOptions = [ ] ;
97 _optionsCache = [ ] ;
108
11- setFlattedOptions = ( ) => {
9+ get flattedOptions ( ) {
1210 if ( this . _optionsCache !== this . args . options ) {
13- this . flattedOptions = this . args . options ?. reduce ( ( acc , curr ) => {
11+ this . _optionsCache = this . args . options ;
12+ return this . args . options ?. reduce ( ( acc , curr ) => {
1413 if ( emberPowerSelectIsGroup ( [ curr ] ) ) {
1514 acc . push ( curr , ...curr . options ) ;
1615 } else {
1716 acc . push ( curr ) ;
1817 }
1918 return acc ;
2019 } , [ ] ) ;
21- this . _optionsCache = this . args . options ;
2220 }
23- } ;
24-
25- constructor ( ) {
26- super ( ...arguments ) ;
27- this . setFlattedOptions ( ) ;
28- this . _optionsCache = this . args . options ;
21+ return this . _optionsCache ;
2922 }
3023
3124 _optionFromIndex ( index ) {
@@ -38,6 +31,6 @@ export default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions
3831 }
3932
4033 get rowHeight ( ) {
41- return this . args . rowHeight ?? rowHeight
34+ return this . args . rowHeight ?? rowHeight ;
4235 }
4336}
You can’t perform that action at this time.
0 commit comments