@ember-eui/core 5.0.0 → 5.0.1

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.
@@ -1,5 +1,16 @@
1
- {{#let (unique-id) as |id|}}
2
- <article
1
+ {{#let
2
+ (unique-id)
3
+ (element (arg-or-default @tagName 'article'))
4
+ (and
5
+ (arg-or-default @hasContextMenuBlock true)
6
+ (has-block 'contextMenu')
7
+ )
8
+ (and
9
+ (arg-or-default @hasPrimaryActionBlock true)
10
+ (has-block 'primaryAction')
11
+ )
12
+ as |id Element hasContextMenuBlock hasPrimaryActionBlock|}}
13
+ <Element
3
14
  aria-labelledby={{id}}
4
15
  key={{@id}}
5
16
  class={{class-names
@@ -41,7 +52,7 @@
41
52
  @time={{@time}}
42
53
  @onOpenContextMenu={{@onOpenContextMenu}}
43
54
  @eventName={{@title}}
44
- @hasContextMenu={{has-block 'contextMenu'}}
55
+ @hasDefaultBlock={{hasContextMenuBlock}}
45
56
  @iconColor={{@iconColor}}
46
57
  >
47
58
  {{yield to='contextMenu'}}
@@ -59,15 +70,17 @@
59
70
  as |classNames headingLevel|}}
60
71
  {{#if (or @href @onClickTitle)}}
61
72
  <EuiLink
62
- @onClick={{@onClickTitle}}
73
+ class={{classNames}}
74
+ id={{id}}
63
75
  @href={{@href}}
76
+ {{on 'click' (optional @onClickTitle)}}
64
77
  >
65
- <TextBlock @tagName={{headingLevel}} id={{id}} class={{classNames}}>
78
+ <TextBlock @tagName={{headingLevel}}>
66
79
  {{@title}}
67
80
  </TextBlock>
68
81
  </EuiLink>
69
82
  {{else if @title}}
70
- <TextBlock @tagName={{headingLevel}} id={{id}} class={{classNames}}>
83
+ <TextBlock id={{id}} class={{classNames}} @tagName={{headingLevel}}>
71
84
  {{@title}}
72
85
  </TextBlock>
73
86
  {{/if}}
@@ -80,7 +93,7 @@
80
93
  @accordionHideText={{@accordionHideText}}
81
94
  />
82
95
 
83
- {{#if (has-block 'primaryAction')}}
96
+ {{#if hasPrimaryActionBlock}}
84
97
  <div class="euiNotificationEvent__primaryAction">
85
98
  {{yield to='primaryAction'}}
86
99
  </div>
@@ -88,5 +101,5 @@
88
101
 
89
102
  </div>
90
103
 
91
- </article>
104
+ </Element>
92
105
  {{/let}}
@@ -1,84 +1,91 @@
1
- <div
2
- class={{class-names
3
- 'euiNotificationEventMeta'
4
- (if @hasContextMenu 'euiNotificationEventMeta--hasContextMenu')
5
- }}
6
- ...attributes
7
- >
8
- <div class="euiNotificationEventMeta__section">
1
+ {{#let
2
+ (and
3
+ (arg-or-default @hasDefaultBlock true)
4
+ (has-block)
5
+ )
6
+ as |hasDefaultBlock|}}
7
+ <div
8
+ class={{class-names
9
+ 'euiNotificationEventMeta'
10
+ (if hasDefaultBlock 'euiNotificationEventMeta--hasContextMenu')
11
+ }}
12
+ ...attributes
13
+ >
14
+ <div class="euiNotificationEventMeta__section">
9
15
 
10
- {{#if @iconType}}
11
- <EuiIcon
12
- @iconClasses="euiNotificationEventMeta__icon"
13
- @type={{@iconType}}
14
- @color={{@iconColor}}
15
- {{!-- TODO only add one of the following html attributes --}}
16
- aria-label={{@iconAriaLabel}}
17
- aria-hidden={{if @iconAriaLabel false true}}
18
- />
19
- {{/if}}
16
+ {{#if @iconType}}
17
+ <EuiIcon
18
+ @iconClasses="euiNotificationEventMeta__icon"
19
+ @type={{@iconType}}
20
+ @color={{@iconColor}}
21
+ {{!-- TODO only add one of the following html attributes --}}
22
+ aria-label={{@iconAriaLabel}}
23
+ aria-hidden={{if @iconAriaLabel false true}}
24
+ />
25
+ {{/if}}
20
26
 
21
- {{#if @type}}
22
- <EuiBadge
23
- class="euiNotificationEventMeta__badge"
24
- @color={{@badgeColor}}
25
- >
26
- {{#if @severity}}
27
- {{@type}}: {{@severity}}
28
- {{else}}
29
- {{@type}}
30
- {{/if}}
31
- </EuiBadge>
32
- {{/if}}
27
+ {{#if @type}}
28
+ <EuiBadge
29
+ class="euiNotificationEventMeta__badge"
30
+ @color={{@badgeColor}}
31
+ >
32
+ {{#if @severity}}
33
+ {{@type}}: {{@severity}}
34
+ {{else}}
35
+ {{@type}}
36
+ {{/if}}
37
+ </EuiBadge>
38
+ {{/if}}
33
39
 
34
- </div>
40
+ </div>
35
41
 
36
- <div class="euiNotificationEventMeta__section">
37
- <span class="euiNotificationEventMeta__time">{{@time}}</span>
38
- </div>
42
+ <div class="euiNotificationEventMeta__section">
43
+ <span class="euiNotificationEventMeta__time">{{@time}}</span>
44
+ </div>
39
45
 
40
- {{#if @hasContextMenu}}
41
- {{#let (unique-id) (use-state false) as |randomPopoverId isPopoverOpen|}}
42
- <div class="euiNotificationEventMeta__contextMenuWrapper">
43
- <EuiPopover
44
- id={{randomPopoverId}}
45
- @ownFocus={{true}}
46
- @repositionOnScroll={{true}}
47
- @isOpen={{isPopoverOpen.value}}
48
- @panelPaddingSize="none"
49
- @anchorPosition="leftUp"
50
- @closePopover={{fn isPopoverOpen.setState false}}
51
- >
46
+ {{#if hasDefaultBlock}}
47
+ {{#let (unique-id) (use-state false) as |randomPopoverId isPopoverOpen|}}
48
+ <div class="euiNotificationEventMeta__contextMenuWrapper">
49
+ <EuiPopover
50
+ id={{randomPopoverId}}
51
+ @ownFocus={{true}}
52
+ @repositionOnScroll={{true}}
53
+ @isOpen={{isPopoverOpen.value}}
54
+ @panelPaddingSize="none"
55
+ @anchorPosition="leftUp"
56
+ @closePopover={{fn isPopoverOpen.setState false}}
57
+ >
52
58
 
53
- <:button>
54
- <EuiButtonIcon
55
- {{!-- aria-label={contextMenuButton} --}}
56
- aria-controls={{randomPopoverId}}
57
- aria-expanded={{this.isPopoverOpen}}
58
- aria-haspopup="true"
59
- @iconType="boxesVertical"
60
- @color="text"
61
- data-test-subj={{concat @id '-notificationEventMetaButton'}}
62
- {{on 'click' (fn isPopoverOpen.setState true)}}
63
- />
64
- </:button>
59
+ <:button>
60
+ <EuiButtonIcon
61
+ {{!-- aria-label={contextMenuButton} --}}
62
+ aria-controls={{randomPopoverId}}
63
+ aria-expanded={{this.isPopoverOpen}}
64
+ aria-haspopup="true"
65
+ @iconType="boxesVertical"
66
+ @color="text"
67
+ data-test-subj={{concat @id '-notificationEventMetaButton'}}
68
+ {{on 'click' (fn isPopoverOpen.setState true)}}
69
+ />
70
+ </:button>
65
71
 
66
- {{!-- The EuiContextMenu is wrapped with a div so it closes after an item is clicked --}}
67
- <:content>
68
- <div
69
- {{on 'click' (queue
70
- (optional @onOpenContextMenu)
71
- (fn isPopoverOpen.setState false)
72
- )}}
73
- role="button"
74
- >
75
- {{yield}}
76
- </div>
77
- </:content>
72
+ {{!-- The EuiContextMenu is wrapped with a div so it closes after an item is clicked --}}
73
+ <:content>
74
+ <div
75
+ {{on 'click' (queue
76
+ (optional @onOpenContextMenu)
77
+ (fn isPopoverOpen.setState false)
78
+ )}}
79
+ role="button"
80
+ >
81
+ {{yield}}
82
+ </div>
83
+ </:content>
78
84
 
79
- </EuiPopover>
80
- </div>
81
- {{/let}}
82
- {{/if}}
85
+ </EuiPopover>
86
+ </div>
87
+ {{/let}}
88
+ {{/if}}
83
89
 
84
- </div>
90
+ </div>
91
+ {{/let}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
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": "7f66980612ec6a1d56c3ce7e6087b71b4a07be97"
185
+ "gitHead": "3aef480644ac4197019735532b7907b018151deb"
186
186
  }