@ember-eui/core 4.0.1 → 4.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ### Master
4
4
 
5
+ ### 4.0.4
6
+ 🐛 Bug / Fixes
7
+ `@ember-eui/core`
8
+ - Fixes some dependencies issues with 4.x breakings
9
+ - Adds a blueprint to install ember-focus-trap in host
10
+ - Fixes `<EuiPikaday />`
11
+
5
12
  ### 4.0.0
6
13
  💥 Breaking change
7
14
  `@ember-eui/*`
@@ -53,7 +60,11 @@
53
60
  💥 Breaking change
54
61
  `@ember-eui/core`
55
62
  - Deprecate `ember-svg-jar` `hbs` strategy for now, just use stock `ember-svg-jar`
56
- ### 1.6.4
63
+ ### 1.6.7
64
+ 🐛 Bug / Fixes
65
+ `@ember-eui/core`
66
+ - `<EuiComboBox />` Call `onChange` after `onCreateOption` is triggered
67
+ ### 1.6.5
57
68
  🐛 Bug / Fixes
58
69
  `@ember-eui/core`
59
70
  - `<EuiComboBox />` hide clear button when disabled
package/README.md CHANGED
@@ -15,6 +15,7 @@ var app = new EmberApp(defaults, {
15
15
  svgJar: {
16
16
  sourceDirs: [
17
17
  'public/assets',
18
+ '../node_modules/@ember-eui/core/public',
18
19
  'node_modules/@elastic/eui/lib/components/icon',
19
20
  ],
20
21
  },
@@ -10,7 +10,7 @@
10
10
  (if (and (eq @display "plain") (not @selectable)) "euiCard--plain")
11
11
  (if @isDisabled "euiCard-isDisabled")
12
12
  (if (has-block) "euiCard--hasChildren")
13
- (if @icon "euiCard--hasIcon" (if has-block "icon" "euiCard--hasIcon"))
13
+ (if @icon "euiCard--hasIcon" (if (has-block) "icon" "euiCard--hasIcon"))
14
14
  (if @betaBadgeLabel "euiCard--hasBetaBadge")
15
15
  (if
16
16
  (or titleId (and @selectable (not @selectable.isDisabled)))
@@ -27,7 +27,6 @@
27
27
  onCreateOption=(if
28
28
  @onCreateOption (pipe this.onCreateOption @onCreateOption)
29
29
  )
30
- isClearable=(and @isClearable (not @disabled))
31
30
  }}
32
31
  @matcher={{@matcher}}
33
32
  @initiallyOpen={{@initiallyOpen}}
@@ -51,7 +50,10 @@
51
50
  @triggerRole={{@triggerRole}}
52
51
  @title={{@title}}
53
52
  @triggerId={{@triggerId}}
54
- @allowClear={{and @isClearable (not @disabled)}}
53
+ @allowClear={{and
54
+ (arg-or-default @isClearable true)
55
+ (not (or @isDisabled @disabled))
56
+ }}
55
57
  @loadingMessage={{@loadingMessage}}
56
58
  @selectedItemComponent={{@selectedItemComponent}}
57
59
  @beforeOptionsComponent={{@beforeOptionsComponent}}
@@ -66,6 +66,7 @@ export default class EuiComboBoxComponent extends Component<EuiComboBoxArgs> {
66
66
  onCreateOption() {
67
67
  let search = this.select.searchText;
68
68
  this.select.actions.search('');
69
+ this.select.actions.select(search);
69
70
  this.select.actions.close();
70
71
  return search;
71
72
  }
@@ -1,121 +1,118 @@
1
- {{#let (arg-or-default @isClearable true) as |isClearable|}}
2
- <EuiFormControlLayout
3
- @icon="arrowDown"
4
- @iconSide="right"
5
- @fullWidth={{@fullWidth}}
6
- @compressed={{@compressed}}
7
- @readOnly={{@readOnly}}
8
- @clear={{if
9
- (and @select.selected isClearable)
10
- (fn @select.actions.select (array))
11
- }}
12
- @disabled={{@select.disabled}}
13
- >
14
- <:field>
15
- {{! template-lint-disable }}
16
- <ul
17
- id="ember-power-select-multiple-options-{{@select.uniqueId}}"
18
- class={{class-names
19
- "euiComboBox__inputWrap ember-power-select-multiple-options"
20
- (if @compressed "euiComboBox__inputWrap--compressed")
21
- (if @fullWidth "euiComboBox__inputWrap--fullWidth")
22
- (if @singleSelection "euiComboBox__inputWrap--noWrap")
23
- (if @isLoading "euiComboBox__inputWrap--isLoading")
24
- (if isClearable "euiComboBox__inputWrap-isClearable")
25
- }}
26
- ...attributes
27
- {{did-update this.openChanged @select.isOpen}}
28
- {{on "touchstart" this.chooseOption}}
29
- {{on "mousedown" this.chooseOption}}
30
- >
31
- {{! template-lint-enable }}
32
- {{#if
33
- (or
34
- (and @singleSelection (not @select.searchText))
35
- (not @singleSelection)
36
- )
37
- }}
38
- {{#each @select.selected as |opt idx|}}
39
- {{#if @selectedItemComponent}}
40
- {{component
41
- (ensure-safe-component @selectedItemComponent)
42
- extra=@extra
43
- option=opt
44
- select=@select
1
+ <EuiFormControlLayout
2
+ @icon="arrowDown"
3
+ @iconSide="right"
4
+ @fullWidth={{@fullWidth}}
5
+ @compressed={{@compressed}}
6
+ @readOnly={{@readOnly}}
7
+ @clear={{if
8
+ (and @select.selected @allowClear)
9
+ (fn @select.actions.select (array))
10
+ }}
11
+ @disabled={{@select.disabled}}
12
+ >
13
+ <:field>
14
+ {{! template-lint-disable }}
15
+ <ul
16
+ id="ember-power-select-multiple-options-{{@select.uniqueId}}"
17
+ class={{class-names
18
+ "euiComboBox__inputWrap ember-power-select-multiple-options"
19
+ (if @compressed "euiComboBox__inputWrap--compressed")
20
+ (if @fullWidth "euiComboBox__inputWrap--fullWidth")
21
+ (if @singleSelection "euiComboBox__inputWrap--noWrap")
22
+ (if @isLoading "euiComboBox__inputWrap--isLoading")
23
+ (if @allowClear "euiComboBox__inputWrap-isClearable")
24
+ }}
25
+ ...attributes
26
+ {{did-update this.openChanged @select.isOpen}}
27
+ {{on "touchstart" this.chooseOption}}
28
+ {{on "mousedown" this.chooseOption}}
29
+ >
30
+ {{! template-lint-enable }}
31
+ {{#if
32
+ (or
33
+ (and @singleSelection (not @select.searchText)) (not @singleSelection)
34
+ )
35
+ }}
36
+ {{#each @select.selected as |opt idx|}}
37
+ {{#if @selectedItemComponent}}
38
+ {{component
39
+ @selectedItemComponent
40
+ extra=@extra
41
+ option=opt
42
+ select=@select
43
+ }}
44
+ {{else}}
45
+ <EuiComboBoxPill
46
+ class="ember-power-select-multiple-option
47
+ {{if
48
+ opt.disabled
49
+ "ember-power-select-multiple-option--disabled"
50
+ }}"
51
+ @option={{opt}}
52
+ @onClose={{if
53
+ (or @select.disabled @singleSelection)
54
+ false
55
+ (if @onClose (fn (optional @onClose) opt) true)
45
56
  }}
46
- {{else}}
47
- <EuiComboBoxPill
48
- class="ember-power-select-multiple-option
49
- {{if
50
- opt.disabled
51
- 'ember-power-select-multiple-option--disabled'
52
- }}"
53
- @option={{opt}}
54
- @onClose={{if
55
- (or @select.disabled @singleSelection)
56
- false
57
- (if @onClose (fn (optional @onClose) opt) true)
58
- }}
59
- @dataSelectedIconIndex={{idx}}
60
- @color={{opt.color}}
61
- @asPlainText={{@singleSelection.asPlainText}}
62
- >
63
- {{yield opt @select}}
64
- </EuiComboBoxPill>
65
- {{/if}}
66
- {{else if (and @placeholder (not @searchEnabled))}}
67
- <span class="ember-power-select-placeholder">
68
- {{@placeholder}}
69
- </span>
70
- {{/each}}
71
- {{/if}}
72
- {{#if @searchEnabled}}
73
- {{! template-lint-disable }}
74
- {{#if (and this.maybePlaceholder (not @select.searchText))}}
75
- <p class="euiComboBoxPlaceholder">
76
- {{this.maybePlaceholder}}
77
- </p>
57
+ @dataSelectedIconIndex={{idx}}
58
+ @color={{opt.color}}
59
+ @asPlainText={{@singleSelection.asPlainText}}
60
+ >
61
+ {{yield opt @select}}
62
+ </EuiComboBoxPill>
78
63
  {{/if}}
79
- <div
80
- class="euiComboBox__input"
81
- style="font-size: 14px; display: inline-block; position: relative;"
82
- >
83
- <input
84
- tabindex="-1"
85
- style="opacity: 0px; width:0px; height:0px; position: absolute; top: 40%; border:solid 1px transparent !important; margin:0px !important;"
86
- class="fake-input-for-html-form-validity"
87
- {{validatable-control @isInvalid}}
88
- />
89
- <input
90
- class="ember-power-select-trigger-multiple-input euiComboBox__input"
91
- autocomplete="off"
92
- autocorrect="off"
93
- autocapitalize="off"
94
- spellcheck={{false}}
95
- id="ember-power-select-trigger-multiple-input-{{@select.uniqueId}}"
96
- value={{@select.searchText}}
97
- aria-controls={{@listboxId}}
98
- style={{this.triggerMultipleInputStyle}}
99
- disabled={{@select.disabled}}
100
- tabindex={{@tabindex}}
101
- form="power-select-fake-form"
102
- {{on "focus" @onFocus}}
103
- {{on "blur" @onBlur}}
104
- {{on "input" this.handleInput}}
105
- {{on "keydown" this.handleKeydown}}
106
- {{did-insert this.storeInputStyles}}
107
- />
108
- </div>
109
- {{! template-lint-enable }}
110
- {{else}}
111
- {{! template-lint-disable }}
112
- <div
113
- class="euiComboBox__input"
114
- style="font-size: 14px; display: inline-block;"
115
- ></div>
116
- {{! template-lint-enable }}
64
+ {{else if (and @placeholder (not @searchEnabled))}}
65
+ <span class="ember-power-select-placeholder">
66
+ {{@placeholder}}
67
+ </span>
68
+ {{/each}}
69
+ {{/if}}
70
+ {{#if @searchEnabled}}
71
+ {{! template-lint-disable }}
72
+ {{#if (and this.maybePlaceholder (not @select.searchText))}}
73
+ <p class="euiComboBoxPlaceholder">
74
+ {{this.maybePlaceholder}}
75
+ </p>
117
76
  {{/if}}
118
- </ul>
119
- </:field>
120
- </EuiFormControlLayout>
121
- {{/let}}
77
+ <div
78
+ class="euiComboBox__input"
79
+ style="font-size: 14px; display: inline-block; position: relative;"
80
+ >
81
+ <input
82
+ tabindex="-1"
83
+ style="opacity: 0px; width:0px; height:0px; position: absolute; top: 40%; border:solid 1px transparent !important; margin:0px !important;"
84
+ class="fake-input-for-html-form-validity"
85
+ {{validatable-control @isInvalid}}
86
+ />
87
+ <input
88
+ class="ember-power-select-trigger-multiple-input euiComboBox__input"
89
+ autocomplete="off"
90
+ autocorrect="off"
91
+ autocapitalize="off"
92
+ spellcheck={{false}}
93
+ id="ember-power-select-trigger-multiple-input-{{@select.uniqueId}}"
94
+ value={{@select.searchText}}
95
+ aria-controls={{@listboxId}}
96
+ style={{this.triggerMultipleInputStyle}}
97
+ disabled={{@select.disabled}}
98
+ tabindex={{@tabindex}}
99
+ form="power-select-fake-form"
100
+ {{on "focus" @onFocus}}
101
+ {{on "blur" @onBlur}}
102
+ {{on "input" this.handleInput}}
103
+ {{on "keydown" this.handleKeydown}}
104
+ {{did-insert this.storeInputStyles}}
105
+ />
106
+ </div>
107
+ {{! template-lint-enable }}
108
+ {{else}}
109
+ {{! template-lint-disable }}
110
+ <div
111
+ class="euiComboBox__input"
112
+ style="font-size: 14px; display: inline-block;"
113
+ ></div>
114
+ {{! template-lint-enable }}
115
+ {{/if}}
116
+ </ul>
117
+ </:field>
118
+ </EuiFormControlLayout>
@@ -1,10 +1,19 @@
1
+ import { scheduleOnce } from '@ember/runloop';
1
2
  import { modifier } from 'ember-modifier';
2
3
 
3
4
  export default modifier(function focusTab(
4
5
  _element: HTMLElement,
5
- [selectedTabId, isDisabled, focusFn]: [Tab, boolean, (...args: unknown[]) => void, boolean]
6
+ [selectedTabId, isDisabled, focusFn]: [
7
+ Tab,
8
+ boolean,
9
+ (...args: unknown[]) => void,
10
+ boolean
11
+ ]
6
12
  ) {
7
13
  if (selectedTabId === undefined && !isDisabled) {
8
- focusFn();
14
+ const fn = () => {
15
+ focusFn();
16
+ };
17
+ scheduleOnce('afterRender', null, fn);
9
18
  }
10
19
  });
@@ -1,7 +1,7 @@
1
- 'use strict'
1
+ 'use strict';
2
2
 
3
3
  module.exports = {
4
- description: 'Installs ember-cli-sass',
4
+ description: 'Installs ember-focus-trap',
5
5
 
6
6
  normalizeEntityName() {
7
7
  // this prevents an error when the entityName is
@@ -9,6 +9,6 @@ module.exports = {
9
9
  },
10
10
 
11
11
  afterInstall() {
12
- return this.addAddonToProject('ember-cli-sass');
12
+ return this.addAddonToProject('ember-focus-trap');
13
13
  }
14
- };
14
+ };
@@ -18,24 +18,19 @@ order: 1
18
18
  @value={{this.htmlCode}}
19
19
  {{on 'input' (pick 'target.value' (set this 'htmlCode'))}}
20
20
  />
21
+ <EuiFormRow @label='Choose a Language'>
22
+ <EuiSelect
23
+ @value={{this.language}}
24
+ @hasNoInitialSelection={{true}}
25
+ @options={{array
26
+ (hash value='javascript' text='javascript')
27
+ (hash value='html' text='html')
28
+ (hash value='golang' text='golang')
29
+ }}
30
+ {{on 'change' (pick 'target.value' (set this 'language'))}}
31
+ />
21
32
 
22
- <EuiSelect
23
- @value={{this.language}}
24
- @hasNoInitialSelection={{true}}
25
- @options={{array
26
- (hash value='javascript' text='javascript')
27
- (hash value='html' text='html')
28
- (hash value='golang' text='golang')
29
- }}
30
- @id={{selectId}}
31
- {{on 'change' (pick 'target.value' (set this 'language'))}}
32
- >
33
- <:prepend as |classes|>
34
- <EuiFormLabel class={{classes}} for={{selectId}}>
35
- Choose a language
36
- </EuiFormLabel>
37
- </:prepend>
38
- </EuiSelect>
33
+ </EuiFormRow>
39
34
  ```
40
35
 
41
36
  ```javascript component
@@ -17,7 +17,7 @@
17
17
  />
18
18
  </EuiFormControlLayout>
19
19
  <EuiSpacer @size="m" />
20
- <EuiFormControlLayout @clear={{optional}}>
20
+ <EuiFormControlLayout @clear={{(optional)}}>
21
21
  <input
22
22
  type="text"
23
23
  class="euiFieldText"
@@ -25,7 +25,7 @@
25
25
  />
26
26
  </EuiFormControlLayout>
27
27
  <EuiSpacer size="m" />
28
- <EuiFormControlLayout @isLoading={{true}} @clear={{optional}}>
28
+ <EuiFormControlLayout @isLoading={{true}} @clear={{(optional)}}>
29
29
  <input
30
30
  type="text"
31
31
  class="euiFieldText"
@@ -49,7 +49,7 @@
49
49
  />
50
50
  </EuiFormControlLayout>
51
51
  <EuiSpacer size="m" />
52
- <EuiFormControlLayout @clear={{optional}} @icon="search">
52
+ <EuiFormControlLayout @clear={{(optional)}} @icon="search">
53
53
  <input
54
54
  type="text"
55
55
  class="euiFieldText"
@@ -57,7 +57,7 @@
57
57
  />
58
58
  </EuiFormControlLayout>
59
59
  <EuiSpacer size="m" />
60
- <EuiFormControlLayout @clear={{optional}} @icon="arrowDown" @iconSide="right">
60
+ <EuiFormControlLayout @clear={{(optional)}} @icon="arrowDown" @iconSide="right">
61
61
  <input
62
62
  type="text"
63
63
  class="euiFieldText"
@@ -65,7 +65,7 @@
65
65
  />
66
66
  </EuiFormControlLayout>
67
67
  <EuiSpacer @size="m" />
68
- <EuiFormControlLayout @isLoading={{true}} @clear={{optional}} @icon="search">
68
+ <EuiFormControlLayout @isLoading={{true}} @clear={{(optional)}} @icon="search">
69
69
  <input
70
70
  type="text"
71
71
  class="euiFieldText"
@@ -73,7 +73,7 @@
73
73
  />
74
74
  </EuiFormControlLayout>
75
75
  <EuiSpacer @size="m" />
76
- <EuiFormControlLayout @isLoading={{true}} @clear={{optional}} @icon="arrowDown" @iconSide="right">
76
+ <EuiFormControlLayout @isLoading={{true}} @clear={{(optional)}} @icon="arrowDown" @iconSide="right">
77
77
  <input
78
78
  type="text"
79
79
  class="euiFieldText"
@@ -81,7 +81,7 @@
81
81
  />
82
82
  </EuiFormControlLayout>
83
83
  <EuiSpacer @size="m" />
84
- <EuiFormControlLayout @isLoading={{true}} @clear={{optional}} @icon="search">
84
+ <EuiFormControlLayout @isLoading={{true}} @clear={{(optional)}} @icon="search">
85
85
  <input
86
86
  type="text"
87
87
  class="euiFieldText"
@@ -128,7 +128,7 @@
128
128
  </:field>
129
129
  </EuiFormControlLayout>
130
130
  <EuiSpacer @size="m" />
131
- <EuiFormControlLayout @isLoading={{true}} @clear={{optional}}>
131
+ <EuiFormControlLayout @isLoading={{true}} @clear={{(optional)}}>
132
132
  <:prepend as |classes|>
133
133
  <EuiButtonEmpty @size="xs" @iconType="arrowDown" @iconSide="right" class={{classes}}>
134
134
  Button
@@ -20,7 +20,7 @@
20
20
  <EuiFlexItem @grow={{false}}>
21
21
  <EuiPanel @grow={{false}}>
22
22
  <ul>
23
- {{#each items as |item|}}
23
+ {{#each this.items as |item|}}
24
24
  <li>
25
25
  {{item}}
26
26
  </li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "4.0.1",
3
+ "version": "4.0.4",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -62,17 +62,14 @@
62
62
  "ember-cli-htmlbars": "^6.0.1",
63
63
  "ember-cli-typescript": "4.2.1",
64
64
  "ember-composable-helpers": "^4.4.1",
65
- "ember-element-helper": "^0.5.5",
66
- "ember-focus-trap": "^0.7.0",
67
- "ember-in-element-polyfill": "^1.0.0",
65
+ "ember-element-helper": "^0.6.0",
68
66
  "ember-keyboard": "^7.0.1",
69
67
  "ember-math-helpers": "^2.15.0",
70
- "ember-modifier": "^2.1.2",
71
- "ember-named-blocks-polyfill": "^0.2.3",
68
+ "ember-modifier": "^3.1.0",
72
69
  "ember-power-select": "^5.0.2",
73
70
  "ember-set-body-class": "^1.0.2",
74
71
  "ember-set-helper": "^2.0.1",
75
- "ember-style-modifier": "^0.6.0",
72
+ "ember-style-modifier": "^0.7.0",
76
73
  "ember-svg-jar": "^2.3.4",
77
74
  "ember-truth-helpers": "^3.0.0",
78
75
  "highlight.js": "^9.18.5",
@@ -90,6 +87,9 @@
90
87
  "unified": "^9.2.0",
91
88
  "vfile": "^4.2.0"
92
89
  },
90
+ "peerDependencies": {
91
+ "ember-focus-trap": "^1.0.1"
92
+ },
93
93
  "devDependencies": {
94
94
  "@ember/optional-features": "^2.0.0",
95
95
  "@ember/test-helpers": "^2.6.0",
@@ -132,6 +132,7 @@
132
132
  "ember-cli-typescript-blueprints": "^3.0.0",
133
133
  "ember-disable-prototype-extensions": "^1.1.3",
134
134
  "ember-export-application-global": "^2.0.1",
135
+ "ember-focus-trap": "^1.0.1",
135
136
  "ember-get-config": "~1.0.2",
136
137
  "ember-load-initializers": "^2.1.2",
137
138
  "ember-page-title": "^7.0.0",
@@ -167,10 +168,11 @@
167
168
  "edition": "octane"
168
169
  },
169
170
  "ember-addon": {
170
- "configPath": "tests/dummy/config"
171
+ "configPath": "tests/dummy/config",
172
+ "defaultBluerprint": "ember-eui-core"
171
173
  },
172
174
  "volta": {
173
175
  "extends": "../../package.json"
174
176
  },
175
- "gitHead": "ab324804766c49f4991f91c8b988868c4a826208"
177
+ "gitHead": "d0007138cff1b49a85ad28a59bc4080d57042990"
176
178
  }
@@ -1 +0,0 @@
1
- @import 'ember-eui';