@ember-eui/core 3.0.2 → 3.1.0

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,15 @@
2
2
 
3
3
  ### Master
4
4
 
5
+ ### 3.1.0
6
+ 🚀 Enhancements
7
+ `@ember-eui/*`
8
+ - Embroider ready, in order to use staticComponents you need to have `@embroider` > 1.2.0
9
+
10
+ 🐛 Bug / Fixes
11
+ `@ember-eui/core`
12
+ - `<EuiMarkdownFormat />` and `<EuiMarkdownEditor />` styling bugs and double render issues fixed
13
+
5
14
  ### 3.0.2
6
15
  `@ember-eui/core`
7
16
  🐛 Bug / Fixes
@@ -54,11 +54,7 @@
54
54
  @allowClear={{@isClearable}}
55
55
  @loadingMessage={{@loadingMessage}}
56
56
  @selectedItemComponent={{@selectedItemComponent}}
57
- @beforeOptionsComponent={{if
58
- @beforeOptionsComponent
59
- @beforeOptionsComponent
60
- null
61
- }}
57
+ @beforeOptionsComponent={{@beforeOptionsComponent}}
62
58
  @placeholder={{@placeholder}}
63
59
  @searchPlaceholder={{@searchPlaceholder}}
64
60
  @optionsComponent={{component "eui-combo-box/options" rowHeight=@rowHeight}}
@@ -1,4 +1,4 @@
1
- {{#let (component @groupComponent) as |Group|}}
1
+ {{#let (component (ensure-safe-component @groupComponent)) as |Group|}}
2
2
  {{#if @select.loading}}
3
3
  <EuiText @size="xs" class="euiComboBoxOptionsList__empty">
4
4
  <EuiFlexGroup @gutterSize="s" @justifyContent="center">
@@ -23,7 +23,8 @@
23
23
  aria-controls="ember-power-select-trigger-{{@select.uniqueId}}"
24
24
  ...attributes
25
25
  {{did-insert this.addHandlers}}
26
- {{will-destroy this.removeHandlers}} as |opt index|
26
+ {{will-destroy this.removeHandlers}}
27
+ as |opt index|
27
28
  >
28
29
  {{! template-lint-enable }}
29
30
  {{#if (ember-power-select-is-group opt)}}
@@ -31,10 +32,14 @@
31
32
  {{else}}
32
33
  <li
33
34
  class="euiFilterSelectItem
34
- {{if (eq opt @select.highlighted) " euiFilterSelectItem-isFocused"
35
- }}"
36
- aria-selected="{{ember-power-select-is-selected opt @select.selected
35
+ {{if
36
+ (eq opt @select.highlighted)
37
+ ' euiFilterSelectItem-isFocused'
37
38
  }}"
39
+ aria-selected="{{ember-power-select-is-selected
40
+ opt
41
+ @select.selected
42
+ }}"
38
43
  aria-disabled={{if opt.disabled "true"}}
39
44
  aria-current="{{eq opt @select.highlighted}}"
40
45
  data-option-index="{{index}}"
@@ -38,7 +38,7 @@
38
38
  {{#each @select.selected as |opt idx|}}
39
39
  {{#if @selectedItemComponent}}
40
40
  {{component
41
- @selectedItemComponent
41
+ (ensure-safe-component @selectedItemComponent)
42
42
  extra=@extra
43
43
  option=opt
44
44
  select=@select
@@ -48,7 +48,7 @@
48
48
  class="ember-power-select-multiple-option
49
49
  {{if
50
50
  opt.disabled
51
- "ember-power-select-multiple-option--disabled"
51
+ 'ember-power-select-multiple-option--disabled'
52
52
  }}"
53
53
  @option={{opt}}
54
54
  @onClose={{if
@@ -1,6 +1,6 @@
1
1
  {{#if @useComponent}}
2
2
  {{! has the shape of a curried component }}
3
- {{#let (component this.icon) as |IconComponent|}}
3
+ {{#let (component (ensure-safe-component this.icon)) as |IconComponent|}}
4
4
  {{!template-lint-disable}}
5
5
  <IconComponent
6
6
  class={{class-names
@@ -62,6 +62,6 @@
62
62
  </span>
63
63
  {{/if}}
64
64
  {{#if @extraAction}}
65
- {{component @extraAction}}
65
+ {{component (ensure-safe-component @extraAction)}}
66
66
  {{/if}}
67
67
  </li>
@@ -20,6 +20,7 @@ import {
20
20
  EuiMarkdownAstNode
21
21
  } from '../../utils/markdown/markdown-types';
22
22
  import { Processor } from 'unified';
23
+ import { scheduleOnce } from '@ember/runloop';
23
24
 
24
25
  export interface EuiMarkdownEditorArgs {
25
26
  initialViewMode?: string;
@@ -119,7 +120,11 @@ export default class EuiMarkdownEditorComponent extends Component<EuiMarkdownEdi
119
120
  const resizedTextareaHeight =
120
121
  this.textareaRef.offsetHeight + this.editorFooterHeight;
121
122
 
122
- this.currentHeight = resizedTextareaHeight;
123
+ const update = () => {
124
+ this.currentHeight = resizedTextareaHeight;
125
+ };
126
+
127
+ scheduleOnce('afterRender', this, update);
123
128
  }
124
129
  }
125
130
 
@@ -144,7 +149,13 @@ export default class EuiMarkdownEditorComponent extends Component<EuiMarkdownEdi
144
149
  // then add an extra pixel for safety and because the scrollHeight value is rounded
145
150
  const extraHeight = borderWidth + marginWidth + 1;
146
151
 
147
- this.currentHeight = previewRef.scrollHeight + extraHeight;
152
+ const update = () => {
153
+ if (previewRef) {
154
+ this.currentHeight = previewRef.scrollHeight + extraHeight;
155
+ }
156
+ };
157
+
158
+ scheduleOnce('afterRender', this, update);
148
159
  }
149
160
  }
150
161
  }
@@ -20,7 +20,7 @@
20
20
  {{on "click" (fn this.handleMdButtonClick item.id)}}
21
21
  @iconType={{if
22
22
  item.iconType.component
23
- (component item.iconType.component)
23
+ (component (ensure-safe-component item.iconType.component))
24
24
  item.iconType
25
25
  }}
26
26
  @useComponent={{item.iconType.component}}
@@ -1,9 +1,19 @@
1
1
  {{! This hbs was inspired by https://github.com/ampatspell/ember-cli-remark-static/blob/v3.0.5/addon/components/remark.hbs }}
2
- <div class="euiMarkdownFormat">
2
+ <EuiText
3
+ class="euiMarkdownFormat"
4
+ @color={{@color}}
5
+ @grow={{@grow}}
6
+ @size={{@textSize}}
7
+ @textAlign={{@textAlign}}
8
+ ...attributes
9
+ >
3
10
  {{this.result.element}}
4
11
  {{#each this.result.components as |CompNode|}}
5
12
  {{#in-element CompNode.element}}
6
- {{#let (component CompNode.componentName) as |DynamicComponent|}}
13
+ {{#let
14
+ (component (ensure-safe-component CompNode.componentName))
15
+ as |DynamicComponent|
16
+ }}
7
17
  <DynamicComponent
8
18
  @replaceNode={{optional @replaceNode}}
9
19
  @node={{CompNode}}
@@ -11,4 +21,4 @@
11
21
  {{/let}}
12
22
  {{/in-element}}
13
23
  {{/each}}
14
- </div>
24
+ </EuiText>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "3.0.2",
3
+ "version": "3.1.0",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -95,6 +95,7 @@
95
95
  "@ember/optional-features": "^2.0.0",
96
96
  "@ember/test-helpers": "^2.6.0",
97
97
  "@embroider/test-setup": "^1.0.0",
98
+ "@embroider/util": "^1.2.0",
98
99
  "@glimmer/component": "^1.0.4",
99
100
  "@glimmer/tracking": "^1.0.4",
100
101
  "@types/ember": "^3.16.0",
@@ -172,5 +173,5 @@
172
173
  "volta": {
173
174
  "node": "12.22.1"
174
175
  },
175
- "gitHead": "4954f174f17915ab6fa301a875071705ef3a6d0b"
176
+ "gitHead": "f8ceacd6404b806669edf7bbd1eb2d79aac1f4bf"
176
177
  }
@@ -1 +0,0 @@
1
- export { default } from '@ember-eui/core/components/eui-text-field';