@ember-eui/core 5.4.3 → 5.6.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.
@@ -28,27 +28,32 @@
28
28
  @paddingSize={{@paddingSize}}
29
29
  ...attributes
30
30
  >
31
- <div class="euiCard__top">
32
- {{#if (has-block "icon")}}
33
- {{yield "euiCard__icon" to="icon"}}
34
- {{else}}
35
- {{#if (or @image @icon)}}
36
- {{#if (and @image (not-eq layout "horizontal"))}}
37
- <div class="euiCard__image">
38
- <img src={{@image}} alt="card-top" />
39
- </div>
40
- {{/if}}
41
- {{#if @icon}}
42
- <EuiIcon
43
- @iconClasses="euiCard__icon"
44
- @type={{@icon}}
45
- @size={{@iconSize}}
46
- />
31
+
32
+ {{#if (or (has-block "icon") (or @image @icon))}}
33
+ <div class={{this.topClasses}}>
34
+ {{#if (has-block "icon")}}
35
+ {{yield "euiCard__icon" to="icon"}}
36
+ {{else}}
37
+ {{#if (or @image @icon)}}
38
+ {{#if (and @image (not-eq layout "horizontal"))}}
39
+ <div class="euiCard__image">
40
+ <img src={{@image}} alt="card-top" />
41
+ </div>
42
+ {{/if}}
43
+ {{#if @icon}}
44
+ <EuiIcon
45
+ @iconClasses="euiCard__icon"
46
+ @type={{@icon}}
47
+ @size={{@iconSize}}
48
+ />
49
+ {{/if}}
47
50
  {{/if}}
48
51
  {{/if}}
49
- {{/if}}
50
- </div>
51
- <div class="euiCard__content">
52
+ </div>
53
+ {{/if}}
54
+
55
+
56
+ <div class={{this.contentClasses}}>
52
57
  <EuiTitle class="euiCard__title" @size={{arg-or-default @titleSize "s"}}>
53
58
  {{#if (has-block "title")}}
54
59
  {{yield (set this "link") to="title"}}
@@ -117,7 +122,7 @@
117
122
  </span>
118
123
  {{/if}}
119
124
  {{#if (and (eq layout "vertical") (or (has-block "footer") @footer))}}
120
- <div class="euiCard__footer">
125
+ <div class={{this.footerClasses}}>
121
126
  {{#if (has-block "footer")}}
122
127
  {{yield to="footer"}}
123
128
  {{else}}
@@ -4,6 +4,20 @@ import { EuiCardSelectProps, euiCardSelectableColor } from '../eui-card-select';
4
4
 
5
5
  type EuiCardComponentArgs = {
6
6
  selectable?: EuiCardSelectProps;
7
+ /**
8
+ * Class that will apply to the card top section.
9
+ */
10
+ topClassName?: string;
11
+
12
+ /**
13
+ * Class that will apply to the card content section.
14
+ */
15
+ contentClassName?: string;
16
+
17
+ /**
18
+ * Class that will apply to the card footer section.
19
+ */
20
+ footerClassName?: string;
7
21
  };
8
22
 
9
23
  export default class EuiCardComponent extends Component<EuiCardComponentArgs> {
@@ -24,4 +38,16 @@ export default class EuiCardComponent extends Component<EuiCardComponentArgs> {
24
38
  )}`
25
39
  : undefined;
26
40
  }
41
+
42
+ get topClasses(): string {
43
+ return ['euiCard__top', this.args.topClassName].join(' ');
44
+ }
45
+
46
+ get contentClasses(): string {
47
+ return ['euiCard__content', this.args.contentClassName].join(' ');
48
+ }
49
+
50
+ get footerClasses(): string {
51
+ return ['euiCard__footer', this.args.footerClassName].join(' ');
52
+ }
27
53
  }
@@ -1,22 +1,27 @@
1
- <EuiModal class="euiModal--confirmation" @onClose={{@onCancel}} ...attributes>
2
- {{#if @title}}
1
+ <EuiModal
2
+ class="euiModal--confirmation"
3
+ @onClose={{@onCancel}}
4
+ ...attributes
5
+ >
6
+
7
+ {{#if (or @title (has-block 'title'))}}
3
8
  <EuiModalHeader>
4
9
  <EuiModalHeaderTitle>
5
10
  {{@title}}
11
+ {{yield to='title'}}
6
12
  </EuiModalHeaderTitle>
7
13
  </EuiModalHeader>
8
14
  {{/if}}
9
- {{#if (has-block)}}
10
- <EuiModalBody>
11
- {{yield}}
12
- </EuiModalBody>
13
- {{else if @message}}
15
+
16
+ {{#if (or @message (has-block))}}
14
17
  <EuiModalBody>
15
18
  <EuiText>
16
19
  {{@message}}
20
+ {{yield}}
17
21
  </EuiText>
18
22
  </EuiModalBody>
19
23
  {{/if}}
24
+
20
25
  <EuiModalFooter>
21
26
  <EuiButtonEmpty {{on "click" @onCancel}}>
22
27
  {{@cancelButtonText}}
@@ -31,4 +36,5 @@
31
36
  {{@confirmButtonText}}
32
37
  </EuiButton>
33
38
  </EuiModalFooter>
39
+
34
40
  </EuiModal>
@@ -12,7 +12,12 @@
12
12
  )
13
13
  )
14
14
  }}
15
- <span class="euiLoadingContent__singleLine">
15
+ <span
16
+ class={{class-names
17
+ "euiLoadingContent__singleLine"
18
+ @singleLineClasses
19
+ }}
20
+ >
16
21
  <span class="euiLoadingContent__singleLineBackground" />
17
22
  </span>
18
23
  {{/each}}
@@ -25,13 +25,13 @@
25
25
  isPaused=(arg-or-default @isFocusTrapPaused false)
26
26
  focusTrapOptions=(arg-or-default @focusTrapOptions (hash))
27
27
  }}
28
- {{on-key "Escape" (prevent-default (stop-propagation @onClose))}}
28
+ {{on-key "Escape" (prevent-default (stop-propagation (optional @onClose)))}}
29
29
  >
30
30
  <EuiButtonIcon
31
31
  class="euiModal__closeIcon"
32
32
  @iconType="cross"
33
33
  @color="text"
34
- {{on "click" @onClose}}
34
+ {{on "click" (optional @onClose)}}
35
35
  />
36
36
  <div class="euiModal__flex">
37
37
  {{yield}}
@@ -0,0 +1,24 @@
1
+ {{!-- TODO: not fully implemented --}}
2
+
3
+ <li
4
+ role="option"
5
+ aria-selected={{and (not @disabled) (eq (type-of @checked) 'string')}}
6
+ class={{class-names
7
+ componentName='EuiSelectableListItem'
8
+ isFocused=@isFocused
9
+ }}
10
+ aria-disabled={{@disabled}}
11
+ ...attributes
12
+ >
13
+ <span class="euiSelectableListItem__content">
14
+ {{!-- {{optionIcon}} --}}
15
+ {{!-- {{prependNode}} --}}
16
+ <span class="euiSelectableListItem__text">
17
+ {{yield}}
18
+ {{!-- {{state}} --}}
19
+ {{!-- {{children}} --}}
20
+ {{!-- {{instruction}} --}}
21
+ </span>
22
+ {{!-- {{appendNode}} --}}
23
+ </span>
24
+ </li>
@@ -2,6 +2,7 @@ import { helper } from '@ember/component/helper';
2
2
  import { assert } from '@ember/debug';
3
3
  //@ts-ignore
4
4
  import config from 'ember-get-config';
5
+ import { get } from '@ember/object';
5
6
 
6
7
  /**
7
8
  * Helper that returns a default value if the passed argument is undefined
@@ -17,7 +18,7 @@ export function argOrDefault(
17
18
  assert('`defaultValue` must be provided', defaultValue !== undefined);
18
19
  let configValue;
19
20
  if (configKey) {
20
- configValue = config['@ember-eui/core']?.[configKey];
21
+ configValue = get(config, configKey);
21
22
  }
22
23
  return value !== undefined ? value : configValue || defaultValue;
23
24
  }
@@ -0,0 +1,14 @@
1
+ export const baseClass = 'euiSelectableListItem';
2
+
3
+ export const isFocusedMapping = {
4
+ true: `${baseClass}--isFocused`
5
+ };
6
+
7
+ const mapping: ComponentMapping = {
8
+ base: baseClass,
9
+ properties: {
10
+ isFocused: isFocusedMapping
11
+ }
12
+ };
13
+
14
+ export default mapping;
@@ -54,6 +54,7 @@ import EuiProgressData from './eui-progress-data';
54
54
  import EuiRangeHighlight from './eui-range-highlight';
55
55
  import EuiRangeInput from './eui-range-input';
56
56
  import EuiRangeLevels from './eui-range-levels';
57
+ import EuiSelectableListItem from './eui-selectable-list-item';
57
58
  import EuiSpacer from './eui-spacer';
58
59
  import EuiStat from './eui-stat';
59
60
  import EuiStepNumber from './eui-step-number';
@@ -123,6 +124,7 @@ const mapping: Mapping = {
123
124
  EuiRangeHighlight,
124
125
  EuiRangeInput,
125
126
  EuiRangeLevels,
127
+ EuiSelectableListItem,
126
128
  EuiSpacer,
127
129
  EuiStat,
128
130
  EuiStepNumber,
@@ -0,0 +1 @@
1
+ export { default } from '@ember-eui/core/components/eui-selectable-list-item';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "5.4.3",
3
+ "version": "5.6.0",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -182,5 +182,5 @@
182
182
  "volta": {
183
183
  "extends": "../../package.json"
184
184
  },
185
- "gitHead": "788bc02ef42e7a278439d886bb9be04e6679f37f"
185
+ "gitHead": "7764a095d79c5241eec5c002f23721eda2dd6417"
186
186
  }