@ember-eui/core 5.0.0-alpha.3 → 5.0.0-alpha.6
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/addon/components/eui-accordion/index.hbs +2 -2
- package/addon/components/eui-code-block/controls/index.hbs +1 -1
- package/addon/components/eui-loading-logo/index.hbs +1 -1
- package/addon/components/eui-notification-event/index.hbs +92 -0
- package/addon/components/eui-notification-event-messages/index.hbs +49 -0
- package/addon/components/eui-notification-event-meta/index.hbs +84 -0
- package/addon/components/eui-notification-event-read-button/index.hbs +13 -0
- package/addon/components/eui-notification-event-read-icon/index.hbs +21 -0
- package/addon/components/eui-tab/index.hbs +4 -4
- package/addon/components/eui-tabbed-content/index.hbs +14 -27
- package/addon/components/eui-tabbed-content/index.ts +134 -0
- package/addon/styles/ember-eui.css +4 -0
- package/addon/utils/css-mappings/eui-image.ts +1 -1
- package/app/components/eui-notification-event/index.js +1 -0
- package/app/components/eui-notification-event-messages/index.js +1 -0
- package/app/components/eui-notification-event-meta/index.js +1 -0
- package/app/components/eui-notification-event-read-button/index.js +1 -0
- package/app/components/eui-notification-event-read-icon/index.js +1 -0
- package/docs/display/avatar-demo/demo1.md +0 -8
- package/docs/display/avatar.md +9 -0
- package/docs/display/badge-demo/demo1.md +0 -8
- package/docs/display/badge.md +7 -0
- package/docs/display/comment-list.md +2 -1
- package/docs/display/description-list.md +2 -1
- package/docs/display/empty-prompt.md +2 -1
- package/docs/display/icons.md +1 -0
- package/docs/display/notification-event/demo/demo1.md +83 -0
- package/docs/display/notification-event/demo/demo2.md +141 -0
- package/docs/display/notification-event/demo/demo3.md +112 -0
- package/docs/display/notification-event/index.md +6 -0
- package/docs/navigation/tabs-demo/demo1.md +46 -71
- package/docs/navigation/tabs-demo/demo2.md +45 -28
- package/docs/navigation/tabs-demo/demo3.md +57 -27
- package/docs/navigation/tabs-demo/demo4.md +17 -38
- package/docs/navigation/tabs-demo/demo5.md +86 -0
- package/package.json +2 -2
- package/addon/helpers/get-tab-id.ts +0 -23
- package/app/helpers/get-tab-id.js +0 -1
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
{{on "click" this.onToggle}}
|
|
41
41
|
>
|
|
42
42
|
<span class={{this.buttonContentClasses}}>
|
|
43
|
-
{{yield to="buttonContent"}}
|
|
43
|
+
{{yield this.isOpen to="buttonContent"}}
|
|
44
44
|
</span>
|
|
45
45
|
</ButtonElement>
|
|
46
46
|
{{#if (and @extraAction (not this.isLoading))}}
|
|
47
47
|
<div class="euiAccordion__optionalAction">
|
|
48
|
-
{{yield to="extraAction"}}
|
|
48
|
+
{{yield this.isOpen to="extraAction"}}
|
|
49
49
|
</div>
|
|
50
50
|
{{else if this.isLoading}}
|
|
51
51
|
<div class="euiAccordion__optionalAction">
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{{#let (unique-id) as |id|}}
|
|
2
|
+
<article
|
|
3
|
+
aria-labelledby={{id}}
|
|
4
|
+
key={{@id}}
|
|
5
|
+
class={{class-names
|
|
6
|
+
'euiNotificationEvent'
|
|
7
|
+
(if (eq (type-of @isRead) "boolean") 'euiNotificationEvent--withReadState')
|
|
8
|
+
}}
|
|
9
|
+
...attributes
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
{{#if (eq (type-of @isRead) "boolean")}}
|
|
13
|
+
<div class="euiNotificationEvent__readButton">
|
|
14
|
+
{{#if @onRead}}
|
|
15
|
+
<EuiNotificationEventReadButton
|
|
16
|
+
@id={{@id}}
|
|
17
|
+
@isRead={{@isRead}}
|
|
18
|
+
@eventName={{@title}}
|
|
19
|
+
{{on "click" @onRead}}
|
|
20
|
+
/>
|
|
21
|
+
{{else}}
|
|
22
|
+
<EuiNotificationEventReadIcon
|
|
23
|
+
@id={{@id}}
|
|
24
|
+
@isRead={{@isRead}}
|
|
25
|
+
@eventName={{@title}}
|
|
26
|
+
@readIconColor={{@readIconColor}}
|
|
27
|
+
/>
|
|
28
|
+
{{/if}}
|
|
29
|
+
</div>
|
|
30
|
+
{{/if}}
|
|
31
|
+
|
|
32
|
+
<div class="euiNotificationEvent__content">
|
|
33
|
+
<EuiNotificationEventMeta
|
|
34
|
+
@id={{@id}}
|
|
35
|
+
@type={{@type}}
|
|
36
|
+
@event={{@title}}
|
|
37
|
+
@severity={{@severity}}
|
|
38
|
+
@badgeColor={{@badgeColor}}
|
|
39
|
+
@iconType={{@iconType}}
|
|
40
|
+
@iconAriaLabel={{@iconAriaLabel}}
|
|
41
|
+
@time={{@time}}
|
|
42
|
+
@onOpenContextMenu={{@onOpenContextMenu}}
|
|
43
|
+
@eventName={{@title}}
|
|
44
|
+
@hasContextMenu={{has-block 'contextMenu'}}
|
|
45
|
+
@iconColor={{@iconColor}}
|
|
46
|
+
>
|
|
47
|
+
{{yield to='contextMenu'}}
|
|
48
|
+
</EuiNotificationEventMeta>
|
|
49
|
+
|
|
50
|
+
{{#let
|
|
51
|
+
(class-names
|
|
52
|
+
'euiNotificationEvent__title'
|
|
53
|
+
(if @isRead 'euiNotificationEvent__title--isRead')
|
|
54
|
+
)
|
|
55
|
+
(arg-or-default
|
|
56
|
+
@headingLevel
|
|
57
|
+
'h2'
|
|
58
|
+
)
|
|
59
|
+
as |classNames headingLevel|}}
|
|
60
|
+
{{#if (or @href @onClickTitle)}}
|
|
61
|
+
<EuiLink
|
|
62
|
+
@onClick={{@onClickTitle}}
|
|
63
|
+
@href={{@href}}
|
|
64
|
+
>
|
|
65
|
+
<TextBlock @tagName={{headingLevel}} id={{id}} class={{classNames}}>
|
|
66
|
+
{{@title}}
|
|
67
|
+
</TextBlock>
|
|
68
|
+
</EuiLink>
|
|
69
|
+
{{else if @title}}
|
|
70
|
+
<TextBlock @tagName={{headingLevel}} id={{id}} class={{classNames}}>
|
|
71
|
+
{{@title}}
|
|
72
|
+
</TextBlock>
|
|
73
|
+
{{/if}}
|
|
74
|
+
{{/let}}
|
|
75
|
+
|
|
76
|
+
<EuiNotificationEventMessages
|
|
77
|
+
@messages={{@messages}}
|
|
78
|
+
@eventName={{@title}}
|
|
79
|
+
@accordionButtonText={{@accordionButtonText}}
|
|
80
|
+
@accordionHideText={{@accordionHideText}}
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
{{#if (has-block 'primaryAction')}}
|
|
84
|
+
<div class="euiNotificationEvent__primaryAction">
|
|
85
|
+
{{yield to='primaryAction'}}
|
|
86
|
+
</div>
|
|
87
|
+
{{/if}}
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
</article>
|
|
92
|
+
{{/let}}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class="euiNotificationEventMessages"
|
|
3
|
+
...attributes
|
|
4
|
+
>
|
|
5
|
+
{{#let
|
|
6
|
+
(object-at 0 @messages)
|
|
7
|
+
(without (object-at 0 @messages) @messages)
|
|
8
|
+
as |first rest|}}
|
|
9
|
+
|
|
10
|
+
{{#if first}}
|
|
11
|
+
<EuiText @size="s" @color="subdued">
|
|
12
|
+
<p>{{first}}</p>
|
|
13
|
+
</EuiText>
|
|
14
|
+
{{/if}}
|
|
15
|
+
|
|
16
|
+
{{#if rest}}
|
|
17
|
+
|
|
18
|
+
<EuiAccordion
|
|
19
|
+
{{!-- onToggle={{@onToggle}} --}}
|
|
20
|
+
{{!-- @buttonProps={{hash
|
|
21
|
+
aria-label = accordionAriaLabelButtonText
|
|
22
|
+
}} --}}
|
|
23
|
+
id={{concat 'euiNotificationEventMessagesAccordion' (unique-id)}}
|
|
24
|
+
class="euiNotificationEventMessages__accordion"
|
|
25
|
+
@buttonClassName="euiNotificationEventMessages__accordionButton"
|
|
26
|
+
@arrowDisplay="none"
|
|
27
|
+
>
|
|
28
|
+
<:buttonContent as |isOpen|>
|
|
29
|
+
{{@accordionButtonText}}
|
|
30
|
+
{{#unless isOpen}}
|
|
31
|
+
({{@accordionHideText}})
|
|
32
|
+
{{/unless}}
|
|
33
|
+
</:buttonContent>
|
|
34
|
+
|
|
35
|
+
<:content>
|
|
36
|
+
<div class="euiNotificationEventMessages__accordionContent">
|
|
37
|
+
{{#each rest as |msg|}}
|
|
38
|
+
<EuiText @size="s" @color="subdued">
|
|
39
|
+
<p>{{msg}}</p>
|
|
40
|
+
</EuiText>
|
|
41
|
+
{{/each}}
|
|
42
|
+
</div>
|
|
43
|
+
</:content>
|
|
44
|
+
|
|
45
|
+
</EuiAccordion>
|
|
46
|
+
{{/if}}
|
|
47
|
+
|
|
48
|
+
{{/let}}
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class={{class-names
|
|
3
|
+
'euiNotificationEventMeta'
|
|
4
|
+
(if @hasContextMenu 'euiNotificationEventMeta--hasContextMenu')
|
|
5
|
+
}}
|
|
6
|
+
...attributes
|
|
7
|
+
>
|
|
8
|
+
<div class="euiNotificationEventMeta__section">
|
|
9
|
+
|
|
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}}
|
|
20
|
+
|
|
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}}
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="euiNotificationEventMeta__section">
|
|
37
|
+
<span class="euiNotificationEventMeta__time">{{@time}}</span>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
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
|
+
>
|
|
52
|
+
|
|
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>
|
|
65
|
+
|
|
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>
|
|
78
|
+
|
|
79
|
+
</EuiPopover>
|
|
80
|
+
</div>
|
|
81
|
+
{{/let}}
|
|
82
|
+
{{/if}}
|
|
83
|
+
|
|
84
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{!-- ToDo: title and aria-label translations --}}
|
|
2
|
+
<EuiButtonIcon
|
|
3
|
+
@iconType="dot"
|
|
4
|
+
aria-label={{if @isRead (concat 'Mark ' @eventName ' as unread') (concat 'Mark ' @eventName ' as read')}}
|
|
5
|
+
title={{if @isRead 'Read' 'Unread'}}
|
|
6
|
+
class={{class-names
|
|
7
|
+
'euiNotificationEventReadButton'
|
|
8
|
+
(if @isRead 'euiNotificationEventReadButton--isRead')
|
|
9
|
+
}}
|
|
10
|
+
data-test-subj={{concat @id '-notificationEventReadButton'}}
|
|
11
|
+
id={{@id}}
|
|
12
|
+
...attributes
|
|
13
|
+
/>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{!-- ToDo: title and aria-label translations --}}
|
|
2
|
+
<div
|
|
3
|
+
class={{class-names
|
|
4
|
+
'euiNotificationEventReadIcon'
|
|
5
|
+
(if @isRead 'euiNotificationEventReadIcon--isRead')
|
|
6
|
+
}}
|
|
7
|
+
...attributes
|
|
8
|
+
>
|
|
9
|
+
<EuiIcon
|
|
10
|
+
@type="dot"
|
|
11
|
+
aria-label={{if
|
|
12
|
+
@isRead
|
|
13
|
+
(concat @eventName ' is read')
|
|
14
|
+
(concat @eventName ' is unread')
|
|
15
|
+
}}
|
|
16
|
+
title={{if @isRead 'Read' 'Unread'}}
|
|
17
|
+
@color={{arg-or-default @readIconColor 'primary'}}
|
|
18
|
+
data-test-subj={{concat @id '-notificationEventReadIcon'}}
|
|
19
|
+
id={{@id}}
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...attributes
|
|
15
15
|
>
|
|
16
16
|
{{#if (has-block "prepend")}}
|
|
17
|
-
<span
|
|
17
|
+
<span class="euiTab__prepend">
|
|
18
18
|
{{yield to="prepend"}}
|
|
19
19
|
</span>
|
|
20
20
|
{{/if}}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</span>
|
|
25
25
|
|
|
26
26
|
{{#if (has-block "append")}}
|
|
27
|
-
<span
|
|
27
|
+
<span class="euiTab__append">
|
|
28
28
|
{{yield to="append"}}
|
|
29
29
|
</span>
|
|
30
30
|
{{/if}}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
...attributes
|
|
45
45
|
>
|
|
46
46
|
{{#if (has-block "prepend")}}
|
|
47
|
-
<span
|
|
47
|
+
<span class="euiTab__prepend">
|
|
48
48
|
{{yield to="prepend"}}
|
|
49
49
|
</span>
|
|
50
50
|
{{/if}}
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
</span>
|
|
55
55
|
|
|
56
56
|
{{#if (has-block "append")}}
|
|
57
|
-
<span
|
|
57
|
+
<span class="euiTab__append">
|
|
58
58
|
{{yield to="append"}}
|
|
59
59
|
</span>
|
|
60
60
|
{{/if}}
|
|
@@ -1,45 +1,32 @@
|
|
|
1
|
-
{{#let
|
|
2
|
-
(unique-id)
|
|
3
|
-
(optional @onTabClick)
|
|
4
|
-
(arg-or-default @autoFocus 'initial')
|
|
5
|
-
(use-state
|
|
6
|
-
(get-tab-id
|
|
7
|
-
(arg-or-default (or @selectedTab @initialSelectedTab) (object-at 0 @tabs))
|
|
8
|
-
)
|
|
9
|
-
)
|
|
10
|
-
as |id onTabClick autoFocus selectedTab|
|
|
11
|
-
}}
|
|
1
|
+
{{#let (unique-id) as |rootId|}}
|
|
12
2
|
<div class={{@className}} ...attributes>
|
|
13
3
|
<EuiTabs
|
|
14
|
-
@selectedTab={{selectedTab.value}}
|
|
15
4
|
@expand={{@expand}}
|
|
16
5
|
@display={{@display}}
|
|
17
6
|
@size={{@size}}
|
|
18
|
-
|
|
7
|
+
{{on "focus" this.initializeFocus}}
|
|
8
|
+
{{did-insert this.setTabsRef}}
|
|
19
9
|
>
|
|
20
10
|
{{#each @tabs as |tab|}}
|
|
21
11
|
<EuiTab
|
|
22
12
|
@id={{tab.id}}
|
|
23
|
-
aria-controls={{
|
|
24
|
-
@
|
|
25
|
-
@onClick={{pipe selectedTab.setState (fn onTabClick tab)}}
|
|
26
|
-
@focusFn={{selectedTab.setState}}
|
|
13
|
+
aria-controls={{rootId}}
|
|
14
|
+
@isSelected={{eq tab.id this.selectedTab.id}}
|
|
27
15
|
@disabled={{tab.disabled}}
|
|
16
|
+
{{on "click" (fn this.onTabClick tab)}}
|
|
28
17
|
>
|
|
29
18
|
{{tab.name}}
|
|
30
19
|
</EuiTab>
|
|
31
20
|
{{/each}}
|
|
32
21
|
</EuiTabs>
|
|
33
|
-
{{#let (find-by "id" selectedTab.
|
|
34
|
-
{{
|
|
35
|
-
|
|
36
|
-
{{
|
|
37
|
-
|
|
38
|
-
{{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</div>
|
|
42
|
-
{{/if}}
|
|
22
|
+
{{#let (find-by "id" this.selectedTab.id @tabs) as |currentTab|}}
|
|
23
|
+
<div role="tabpanel" id={{rootId}} aria-labelledby={{currentTab.id}}>
|
|
24
|
+
{{#if (has-block "selectedTabContent")}}
|
|
25
|
+
{{yield currentTab to="selectedTabContent"}}
|
|
26
|
+
{{else}}
|
|
27
|
+
{{currentTab.content}}
|
|
28
|
+
{{/if}}
|
|
29
|
+
</div>
|
|
43
30
|
{{/let}}
|
|
44
31
|
</div>
|
|
45
32
|
{{/let}}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { scheduleOnce } from '@ember/runloop';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { CommonArgs } from '../common';
|
|
5
|
+
|
|
6
|
+
export interface EuiTabbedContentTab {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
content: Component;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type EuiTabbedContentArgs = CommonArgs & {
|
|
13
|
+
/**
|
|
14
|
+
* When tabbing into the tabs, set the focus on `initial` for the first tab,
|
|
15
|
+
* or `selected` for the currently selected tab. Best use case is for inside of
|
|
16
|
+
* overlay content like popovers or flyouts.
|
|
17
|
+
*/
|
|
18
|
+
autoFocus?: 'initial' | 'selected';
|
|
19
|
+
/**
|
|
20
|
+
* Choose `default` or alternative `condensed` display styles
|
|
21
|
+
*/
|
|
22
|
+
display?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Evenly stretches each tab to fill the horizontal space
|
|
25
|
+
*/
|
|
26
|
+
expand?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Use this prop to set the initially selected tab while letting the tabbed content component
|
|
29
|
+
* control selection state internally
|
|
30
|
+
*/
|
|
31
|
+
initialSelectedTab?: EuiTabbedContentTab;
|
|
32
|
+
onTabClick?: (selectedTab: EuiTabbedContentTab) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Use this prop if you want to control selection state within the owner component
|
|
35
|
+
*/
|
|
36
|
+
selectedTab?: EuiTabbedContentTab;
|
|
37
|
+
size?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Each tab needs id and content properties, so we can associate it with its panel for accessibility.
|
|
40
|
+
* The name property (a node) is also required to display to the user.
|
|
41
|
+
*/
|
|
42
|
+
tabs: EuiTabbedContentTab[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default class EuiTabbedContentComponent extends Component<EuiTabbedContentArgs> {
|
|
46
|
+
@tracked selectedTabId;
|
|
47
|
+
@tracked inFocus: boolean = false;
|
|
48
|
+
tabsRef?: Element;
|
|
49
|
+
|
|
50
|
+
get autoFocus() {
|
|
51
|
+
return this.args.autoFocus || 'initial';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
constructor(owner: unknown, args: EuiTabbedContentArgs) {
|
|
55
|
+
super(owner, args);
|
|
56
|
+
|
|
57
|
+
const { initialSelectedTab, selectedTab, tabs } = this.args;
|
|
58
|
+
|
|
59
|
+
// Only track selection state if it's not controlled externally.
|
|
60
|
+
if (!selectedTab) {
|
|
61
|
+
this.selectedTabId =
|
|
62
|
+
(initialSelectedTab && initialSelectedTab.id) || tabs[0].id;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get selectedTab() {
|
|
67
|
+
const { selectedTab: externalSelectedTab, tabs } = this.args;
|
|
68
|
+
return (
|
|
69
|
+
externalSelectedTab ||
|
|
70
|
+
tabs.find((tab: EuiTabbedContentTab) => tab.id === this.selectedTabId)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
setTabsRef = (element: Element) => {
|
|
75
|
+
this.tabsRef = element;
|
|
76
|
+
// Current short-term solution for event listener (see https://github.com/elastic/eui/pull/2717)
|
|
77
|
+
this.tabsRef.addEventListener('focusout' as 'blur', this.removeFocus);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
willDestroy(): void {
|
|
81
|
+
super.willDestroy();
|
|
82
|
+
if (this.tabsRef) {
|
|
83
|
+
this.tabsRef.removeEventListener('focusout' as 'blur', this.removeFocus);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
removeFocus = (blurEvent: FocusEvent) => {
|
|
88
|
+
// only set inFocus to false if the wrapping div doesn't contain the now-focusing element
|
|
89
|
+
const currentTarget = blurEvent.currentTarget! as HTMLElement;
|
|
90
|
+
const relatedTarget = blurEvent.relatedTarget! as HTMLElement;
|
|
91
|
+
if (currentTarget.contains(relatedTarget) === false) {
|
|
92
|
+
this.inFocus = true;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
onTabClick = (selectedTab: EuiTabbedContentTab) => {
|
|
97
|
+
const { onTabClick, selectedTab: externalSelectedTab } = this.args;
|
|
98
|
+
|
|
99
|
+
if (onTabClick) {
|
|
100
|
+
onTabClick(selectedTab);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Only track selection state if it's not controlled externally.
|
|
104
|
+
if (!externalSelectedTab) {
|
|
105
|
+
this.selectedTabId = selectedTab.id;
|
|
106
|
+
const focusTab = () => {
|
|
107
|
+
this.focusTab();
|
|
108
|
+
};
|
|
109
|
+
scheduleOnce('afterRender', this, focusTab);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
focusTab = () => {
|
|
114
|
+
if (this.tabsRef) {
|
|
115
|
+
const targetTab: HTMLDivElement | null = this.tabsRef.querySelector(
|
|
116
|
+
`#${this.selectedTabId}`
|
|
117
|
+
);
|
|
118
|
+
targetTab!.focus();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
initializeFocus = () => {
|
|
123
|
+
if (!this.inFocus && this.autoFocus === 'selected') {
|
|
124
|
+
// Must wait for setState to finish before calling `.focus()`
|
|
125
|
+
// as the focus call triggers a blur on the first tab
|
|
126
|
+
this.inFocus = true;
|
|
127
|
+
|
|
128
|
+
const focusTab = () => {
|
|
129
|
+
this.focusTab();
|
|
130
|
+
};
|
|
131
|
+
scheduleOnce('afterRender', this, focusTab);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@ember-eui/core/components/eui-notification-event';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@ember-eui/core/components/eui-notification-event-messages';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@ember-eui/core/components/eui-notification-event-meta';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@ember-eui/core/components/eui-notification-event-read-button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@ember-eui/core/components/eui-notification-event-read-icon';
|
|
@@ -4,14 +4,6 @@ order: 1
|
|
|
4
4
|
|
|
5
5
|
# Basic
|
|
6
6
|
|
|
7
|
-
<EuiText>
|
|
8
|
-
<p>
|
|
9
|
-
|
|
10
|
-
The <strong>EuiAvatar</strong> component typically creates a user icon. It will accept <EuiCode>name</EuiCode> (required) and <EuiCode>image</EuiCode> props and will configure the display and accessibility as needed. By default, the background colors come from the set of colors used for visualizations. Otherwise you can pass a hex value to the <EuiCode>color</EuiCode> prop.
|
|
11
|
-
|
|
12
|
-
</p>
|
|
13
|
-
</EuiText>
|
|
14
|
-
|
|
15
7
|
```hbs template
|
|
16
8
|
<div>
|
|
17
9
|
<EuiAvatar @size='s' @name='Raphael' />
|
package/docs/display/avatar.md
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
1
|
<EuiPageHeader @pageTitle="Avatar"/>
|
|
2
|
+
<EuiHorizontalRule />
|
|
3
|
+
<EuiText>
|
|
4
|
+
|
|
5
|
+
<p>
|
|
6
|
+
|
|
7
|
+
The <strong>EuiAvatar</strong> component typically creates a user icon. It will accept <EuiCode>name</EuiCode> (required) and <EuiCode>image</EuiCode> props and will configure the display and accessibility as needed. By default, the background colors come from the set of colors used for visualizations. Otherwise you can pass a hex value to the <EuiCode>color</EuiCode> prop.
|
|
8
|
+
|
|
9
|
+
</p>
|
|
10
|
+
</EuiText>
|
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
order: 1
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
<EuiText>
|
|
6
|
-
<p>
|
|
7
|
-
|
|
8
|
-
<strong>EuiBadges</strong> are used to focus on important bits of information. Although they will automatically space themselves if you use them in a repetitive fashion it is good form to wrap them using a <strong>EuiBadgeGroup</strong> so that they will wrap when width is constrained (as seen below).
|
|
9
|
-
|
|
10
|
-
</p>
|
|
11
|
-
</EuiText>
|
|
12
|
-
|
|
13
5
|
```hbs template
|
|
14
6
|
<EuiTitle @size='xs'>
|
|
15
7
|
Accepted color names
|
package/docs/display/badge.md
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
1
|
<EuiPageHeader @pageTitle="Badge"/>
|
|
2
|
+
<EuiHorizontalRule />
|
|
3
|
+
<EuiText>
|
|
4
|
+
|
|
5
|
+
<p>
|
|
6
|
+
<strong>EuiBadges</strong> are used to focus on important bits of information. Although they will automatically space themselves if you use them in a repetitive fashion it is good form to wrap them using a <strong>EuiBadgeGroup</strong> so that they will wrap when width is constrained (as seen below).
|
|
7
|
+
</p>
|
|
8
|
+
</EuiText>
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
<EuiPageHeader @pageTitle="Comment List"/>
|
|
1
|
+
<EuiPageHeader @pageTitle="Comment List"/>
|
|
2
|
+
<EuiHorizontalRule />
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
<EuiPageHeader @pageTitle="Description list"/>
|
|
1
|
+
<EuiPageHeader @pageTitle="Description list"/>
|
|
2
|
+
<EuiHorizontalRule />
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
<EuiPageHeader @pageTitle="Empty Prompt"/>
|
|
1
|
+
<EuiPageHeader @pageTitle="Empty Prompt"/>
|
|
2
|
+
<EuiHorizontalRule />
|
package/docs/display/icons.md
CHANGED