Skip to content

Commit 5968e3b

Browse files
authored
Merge pull request #149 from prysmex/pv_modal_optional_onclose
Modal fixes, EuiSelectableListItem skeleton
2 parents ff5f296 + bb56396 commit 5968e3b

File tree

8 files changed

+85
-28
lines changed

8 files changed

+85
-28
lines changed

packages/core/addon/components/eui-card/index.hbs

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,31 @@
2828
@paddingSize={{@paddingSize}}
2929
...attributes
3030
>
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="euiCard__top">
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}}
4750
{{/if}}
4851
{{/if}}
49-
{{/if}}
50-
</div>
52+
</div>
53+
{{/if}}
54+
55+
5156
<div class="euiCard__content">
5257
<EuiTitle class="euiCard__title" @size={{arg-or-default @titleSize "s"}}>
5358
{{#if (has-block "title")}}
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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'))}}
38
<EuiModalHeader>
49
<EuiModalHeaderTitle>
510
{{@title}}
11+
{{yield to='title'}}
612
</EuiModalHeaderTitle>
713
</EuiModalHeader>
814
{{/if}}
9-
{{#if (has-block)}}
10-
<EuiModalBody>
11-
{{yield}}
12-
</EuiModalBody>
13-
{{else if @message}}
15+
16+
{{#if (or @message (has-block))}}
1417
<EuiModalBody>
1518
<EuiText>
1619
{{@message}}
20+
{{yield}}
1721
</EuiText>
1822
</EuiModalBody>
1923
{{/if}}
24+
2025
<EuiModalFooter>
2126
<EuiButtonEmpty {{on "click" @onCancel}}>
2227
{{@cancelButtonText}}
@@ -31,4 +36,5 @@
3136
{{@confirmButtonText}}
3237
</EuiButton>
3338
</EuiModalFooter>
39+
3440
</EuiModal>

packages/core/addon/components/eui-loading-content/index.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
)
1313
)
1414
}}
15-
<span class="euiLoadingContent__singleLine">
15+
<span
16+
class={{class-names
17+
"euiLoadingContent__singleLine"
18+
@singleLineClasses
19+
}}
20+
>
1621
<span class="euiLoadingContent__singleLineBackground" />
1722
</span>
1823
{{/each}}

packages/core/addon/components/eui-modal/index.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
isPaused=(arg-or-default @isFocusTrapPaused false)
2626
focusTrapOptions=(arg-or-default @focusTrapOptions (hash))
2727
}}
28-
{{on-key "Escape" (prevent-default (stop-propagation @onClose))}}
28+
{{on-key "Escape" (prevent-default (stop-propagation (optional @onClose)))}}
2929
>
3030
<EuiButtonIcon
3131
class="euiModal__closeIcon"
3232
@iconType="cross"
3333
@color="text"
34-
{{on "click" @onClose}}
34+
{{on "click" (optional @onClose)}}
3535
/>
3636
<div class="euiModal__flex">
3737
{{yield}}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

packages/core/addon/utils/css-mappings/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import EuiProgressData from './eui-progress-data';
5454
import EuiRangeHighlight from './eui-range-highlight';
5555
import EuiRangeInput from './eui-range-input';
5656
import EuiRangeLevels from './eui-range-levels';
57+
import EuiSelectableListItem from './eui-selectable-list-item';
5758
import EuiSpacer from './eui-spacer';
5859
import EuiStat from './eui-stat';
5960
import EuiStepNumber from './eui-step-number';
@@ -123,6 +124,7 @@ const mapping: Mapping = {
123124
EuiRangeHighlight,
124125
EuiRangeInput,
125126
EuiRangeLevels,
127+
EuiSelectableListItem,
126128
EuiSpacer,
127129
EuiStat,
128130
EuiStepNumber,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@ember-eui/core/components/eui-selectable-list-item';

0 commit comments

Comments
 (0)