@ember-eui/core 5.0.2 → 5.2.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/addon/components/eui-accordion/index.hbs +1 -1
- package/addon/components/eui-breadcrumbs/index.hbs +9 -1
- package/addon/components/eui-context-menu-item/index.hbs +60 -0
- package/addon/components/eui-context-menu-item/index.ts +12 -0
- package/addon/components/eui-context-menu-panel/index.hbs +5 -0
- package/addon/components/eui-header-links/index.hbs +1 -1
- package/addon/components/eui-input-popover/index.hbs +37 -31
- package/addon/components/eui-popover/index.hbs +61 -102
- package/addon/components/eui-step-horizontal/index.hbs +11 -6
- package/addon/helpers/merge.ts +5 -0
- package/addon/utils/css-mappings/eui-avatar.ts +1 -0
- package/addon/utils/css-mappings/eui-context-menu-item.ts +26 -0
- package/addon/utils/css-mappings/eui-header-links.ts +1 -1
- package/addon/utils/css-mappings/index.ts +98 -96
- package/app/components/eui-context-menu-item/index.js +1 -0
- package/app/components/eui-context-menu-panel/index.js +1 -0
- package/app/helpers/merge.js +1 -0
- package/docs/display/notification-event/demo/demo2.md +3 -10
- package/docs/layout/{accordion.md → accordion/demo/d01-simple-and-unstyle.md} +18 -22
- package/docs/layout/accordion/demo/d02-arrow-display.md +34 -0
- package/docs/layout/{accordion-demo/demo2.md → accordion/demo/d03-multiple-accordions.md} +6 -5
- package/docs/layout/{accordion-demo/demo3.md → accordion/demo/d04-extra-actions.md} +2 -2
- package/docs/layout/{accordion-demo/demo4.md → accordion/demo/d05-opened-on-initial-render.md} +2 -2
- package/docs/layout/{accordion-demo/demo5.md → accordion/demo/d06-controlling-toggled-state.md} +3 -2
- package/docs/layout/{accordion-demo/demo6.md → accordion/demo/d07-loading-state.md} +2 -1
- package/docs/layout/accordion/demo/d08-when-content-changes-dynamically.md +71 -0
- package/docs/layout/{accordion-demo/demo8.md → accordion/demo/d09-interactive-content-in-the-trigger.md} +4 -4
- package/docs/layout/{accordion-demo/demo9.md → accordion/demo/d10-styled-for-forms.md} +44 -44
- package/docs/layout/accordion/index.md +23 -0
- package/docs/layout/{bottom-bar-demo/demo1.md → bottom-bar/demo/d01-basic.md} +0 -2
- package/docs/layout/{bottom-bar-demo/demo2.md → bottom-bar/demo/d02-positions.md} +0 -0
- package/docs/layout/{bottom-bar-demo/demo3.md → bottom-bar/demo/d03-displacement.md} +1 -0
- package/docs/layout/bottom-bar/index.md +18 -0
- package/docs/layout/flex/demo/d01-flex-group-is-for-a-single-row-layout.md +19 -0
- package/docs/layout/flex/demo/d02-flex-items-are-also-flex.md +18 -0
- package/docs/layout/flex/demo/d03-spans-instead-of-divs.md +19 -0
- package/docs/layout/flex/demo/d04-panels-grow-to-fill-flex-items.md +32 -0
- package/docs/layout/flex/demo/d05-turn-off-item-streching.md +12 -0
- package/docs/layout/flex/demo/d06-proportional-widths-of-items.md +32 -0
- package/docs/layout/flex/demo/d07-justify-and-align.md +11 -0
- package/docs/layout/flex/demo/d08-allowing-flex-items-to-wrap.md +43 -0
- package/docs/layout/flex/demo/d09-change-direction.md +13 -0
- package/docs/layout/flex/demo/d10-flex-grids-are-for-repeatable-items.md +33 -0
- package/docs/layout/flex/demo/d11-flex-grids-can-change-direction.md +33 -0
- package/docs/layout/flex/demo/d12-flex-grids-and-flex-groups-can-nest.md +30 -0
- package/docs/layout/flex/demo/d13-gutter-sizing.md +61 -0
- package/docs/layout/flex/demo/d14-responsive-layouts.md +29 -0
- package/docs/layout/flex/index.md +18 -0
- package/docs/layout/{flyout-demo/demo1.md → flyout/demo/d01-basic.md} +12 -16
- package/docs/layout/flyout/demo/d02-more-complicated-flyout.md +195 -0
- package/docs/layout/{flyout-demo/demo3.md → flyout/demo/d03-sizing.md} +5 -17
- package/docs/layout/{flyout-demo/demo4.md → flyout/demo/d04-adjusting-padding.md} +29 -36
- package/docs/layout/{flyout-demo/demo5.md → flyout/demo/d05-adding-a-banner.md} +6 -6
- package/docs/layout/{flyout-demo/demo6.md → flyout/demo/d06-without-ownfocus.md} +11 -14
- package/docs/layout/{flyout-demo/demo7.md → flyout/demo/d07-push-versus-overlay.md} +17 -3
- package/docs/layout/flyout/demo/d08-understanding-max-width.md +9 -0
- package/docs/layout/flyout/index.md +7 -0
- package/docs/layout/{header-demo/demo1.md → header/demo/d01-header.md} +138 -120
- package/docs/layout/header/demo/d02-sections.md +9 -0
- package/docs/layout/{header-demo/demo2.md → header/demo/d03-header-links.md} +2 -2
- package/docs/layout/{header-demo/demo3.md → header/demo/d04-fixed-header.md} +1 -1
- package/docs/layout/{header-demo/demo4.md → header/demo/d05-dark-theme.md} +3 -3
- package/docs/layout/{header-demo/demo5.md → header/demo/d06-portal-content-in-the-header.md} +20 -9
- package/docs/layout/{header-demo/demo6.md → header/demo/d07-header-notifications.md} +1 -1
- package/docs/layout/{header-demo/demo7.md → header/demo/d08-stacked-headers.md} +47 -26
- package/docs/layout/header/demo/d09-the-elastic-navigation-pattern.md +9 -0
- package/docs/layout/header/index.md +7 -0
- package/docs/layout/horizontal-rule/demo/d01-size.md +14 -0
- package/docs/layout/horizontal-rule/demo/d02-margins.md +38 -0
- package/docs/layout/horizontal-rule/horizontal-rule.md +7 -0
- package/docs/layout/modal/demo/d01-modal.md +73 -0
- package/docs/layout/modal/demo/d02-forms-in-a-modal.md +107 -0
- package/docs/layout/modal/demo/d03-confirm-modal.md +86 -0
- package/docs/layout/modal/demo/d04-loading-and-disabling-confirm-button.md +80 -0
- package/docs/layout/{modal-demo/demo5.md → modal/demo/d05-widths.md} +20 -39
- package/docs/layout/modal/index.md +13 -0
- package/docs/layout/page-header/demo/{demo1.md → d01-basic.md} +0 -2
- package/docs/layout/page-header/demo/{demo2.md → d02-tabs-in-the-page-header.md} +1 -2
- package/docs/layout/page-header/demo/{demo3.md → d03-tabs-in-the-page-header.md} +2 -3
- package/docs/layout/page-header/demo/{demo4.md → d04-breadcrumbs-in-the-page-header.md} +3 -2
- package/docs/layout/page-header/demo/{demo5.md → d05-breadcrumbs-in-the-page-header.md} +1 -28
- package/docs/layout/page-header/demo/{demo6.md → d06-customizing-the-page-header.md} +0 -0
- package/docs/layout/page-header/index.md +1 -2
- package/docs/layout/{panel-demo/demo1.md → panel/demo/d01-padding.md} +0 -0
- package/docs/layout/{panel-demo/demo2.md → panel/demo/d02-shadow-and-border.md} +2 -2
- package/docs/layout/{panel-demo/demo3.md → panel/demo/d03-colors-and-corners.md} +0 -0
- package/docs/layout/{panel-demo/demo4.md → panel/demo/d04-growing-height.md} +0 -0
- package/docs/layout/{panel-demo/demo5.md → panel/demo/d05-split-panels.md} +1 -1
- package/docs/layout/{panel.md → panel/index.md} +4 -0
- package/docs/layout/{popover-demo/demo1.md → popover/demo/d01-basic.md} +6 -4
- package/docs/layout/{popover-demo/demo2.md → popover/demo/d02-anchor-position.md} +0 -0
- package/docs/layout/popover/demo/d03-popover-titles-and-footers.md +133 -0
- package/docs/layout/{popover-demo/demo5.md → popover/demo/d04-popover-padding-sizes.md} +56 -31
- package/docs/layout/{popover-demo/demo6.md → popover/demo/d05-panel-class-name.md} +3 -3
- package/docs/layout/{popover-demo/demo7.md → popover/demo/d06-popover-with-block-level-display.md} +2 -3
- package/docs/layout/{popover-demo/demo3.md → popover/demo/d07-popover-on-a-fixed-element.md} +3 -11
- package/docs/layout/{popover-demo/demo8.md → popover/demo/d08-constraining-a-popover-inside-a-container.md} +0 -0
- package/docs/layout/{popover-demo/demo9.md → popover/demo/d09-popover-attached-to-input-element.md} +14 -12
- package/docs/layout/popover/demo/d10-setting-an-initial-focus.md +61 -0
- package/docs/layout/{popover-demo/demo10.md → popover/demo/d11-removing-the-focus-trap.md} +1 -1
- package/docs/layout/popover/demo/d12-popover-using-and-html-element-as-the-anchor.md +9 -0
- package/docs/layout/popover/index.md +7 -0
- package/docs/layout/resizable-container/demo/d01-horizontal-resizing.md +10 -0
- package/docs/layout/resizable-container/demo/d02-resizable-panel-options.md +10 -0
- package/docs/layout/resizable-container/demo/d03-horizontal-resizing-with-controlled-widths.md +10 -0
- package/docs/layout/resizable-container/demo/d04-vertical-resizing.md +10 -0
- package/docs/layout/resizable-container/demo/d05-collapsible-resizable-panels.md +10 -0
- package/docs/layout/resizable-container/demo/d06-responsive-layout.md +10 -0
- package/docs/layout/resizable-container/demo/d07-collapsible-panels-options.md +10 -0
- package/docs/layout/resizable-container/demo/d08-collapsible-panels-with-external-control.md +10 -0
- package/docs/layout/resizable-container/index.md +15 -0
- package/docs/layout/spacer/demo/d01-basic.md +44 -0
- package/docs/layout/spacer/index.md +7 -0
- package/docs/navigation/{breadcrumbs-demo/demo1.md → breadcrumbs/demo/d01-basic.md} +9 -6
- package/docs/navigation/{breadcrumbs-demo/demo2.md → breadcrumbs/demo/d02-limit-the-number-of-breadcrumbs.md} +0 -0
- package/docs/navigation/{breadcrumbs-demo/demo3.md → breadcrumbs/demo/d03-truncate-each-breadcrumb.md} +0 -0
- package/docs/navigation/{breadcrumbs-demo/demo4.md → breadcrumbs/demo/d04-truncate-each-breadcrumb-on-each-object.md} +0 -0
- package/docs/navigation/{breadcrumbs-demo/demo5.md → breadcrumbs/demo/d05-responsive.md} +14 -0
- package/docs/navigation/{breadcrumbs-demo/demo6.md → breadcrumbs/demo/d06-color-for-emphasis.md} +12 -23
- package/docs/navigation/breadcrumbs/index.md +7 -0
- package/docs/navigation/button/demo/d01-basic.md +85 -0
- package/docs/navigation/button/demo/d02-empty-button.md +68 -0
- package/docs/navigation/button/demo/d03-flush-empty-button.md +32 -0
- package/docs/navigation/button/demo/d04-buttons-with-icons.md +213 -0
- package/docs/navigation/button/demo/d05-icon-buttons.md +139 -0
- package/docs/navigation/button/demo/d06-buttons-as-links.md +51 -0
- package/docs/navigation/button/demo/d07-loading-state.md +38 -0
- package/docs/navigation/button/demo/d08-split-buttons.md +43 -0
- package/docs/navigation/button/demo/d09-toggle-buttons.md +10 -0
- package/docs/navigation/button/demo/d10-button-groups.md +10 -0
- package/docs/navigation/button/demo/d11-ghost.md +10 -0
- package/docs/navigation/button/index.md +13 -0
- package/docs/navigation/steps-demo/demo3.md +0 -1
- package/docs/{layout/page-template/demo/demo1.md → templates/page-template/demo/d01-a-full-page-with-everything.md} +1 -24
- package/docs/{layout/page-template/demo/demo2.md → templates/page-template/demo/d02-restricting-page-width.md} +0 -0
- package/docs/{layout/page-template/demo/demo3.md → templates/page-template/demo/d03-showing-a-bottom-bar.md} +0 -0
- package/docs/{layout/page-template/demo/demo4.md → templates/page-template/demo/d04-centered-body.md} +1 -1
- package/docs/{layout/page-template/demo/demo5.md → templates/page-template/demo/d05-centered-content.md} +1 -1
- package/docs/{layout/page-template/demo/demo6.md → templates/page-template/demo/d06-a-simple-page-with-tabs.md} +0 -0
- package/docs/{layout/page-template/demo/demo7.md → templates/page-template/demo/d07-full-height-layout.md} +0 -0
- package/docs/{layout/page-template/demo/demo8.md → templates/page-template/demo/d08-simple-layout-with-centered-body.md} +0 -0
- package/docs/{layout/page-template/demo/demo9.md → templates/page-template/demo/d09-simple-layout-with-centered-content.md} +0 -0
- package/docs/{layout/page-template/demo/demo10.md → templates/page-template/demo/d10-a-simple-page-layout-with-custom-content.md} +0 -0
- package/docs/templates/page-template/index.md +37 -0
- package/docs/templates/sitewide-search/demo/d01-basic-setup.md +10 -0
- package/docs/templates/sitewide-search/demo/d02-options.md +10 -0
- package/docs/templates/sitewide-search/index.md +9 -0
- package/docs/templates/super-date-picker/demo/d01-update-button.md +10 -0
- package/docs/templates/super-date-picker/demo/d02-quick-select-panels.md +10 -0
- package/docs/templates/super-date-picker/demo/d03-sizing.md +10 -0
- package/docs/templates/super-date-picker/demo/d04-auto-refresh.md +11 -0
- package/docs/templates/super-date-picker/demo/d05-elastic-pattern-with-kql.md +10 -0
- package/docs/templates/super-date-picker/index.md +12 -0
- package/package.json +3 -3
- package/docs/layout/accordion-demo/demo1.md +0 -33
- package/docs/layout/accordion-demo/demo7.md +0 -66
- package/docs/layout/bottom-bar.md +0 -1
- package/docs/layout/flex-demo/demo1.md +0 -358
- package/docs/layout/flex.md +0 -1
- package/docs/layout/flyout-demo/demo2.md +0 -87
- package/docs/layout/flyout.md +0 -1
- package/docs/layout/header.md +0 -1
- package/docs/layout/horizontal-rule-demo/demo1.md +0 -70
- package/docs/layout/horizontal-rule.md +0 -1
- package/docs/layout/modal-demo/demo1.md +0 -97
- package/docs/layout/modal-demo/demo2.md +0 -126
- package/docs/layout/modal-demo/demo3.md +0 -55
- package/docs/layout/modal-demo/demo4.md +0 -65
- package/docs/layout/modal.md +0 -1
- package/docs/layout/page-template/index.md +0 -11
- package/docs/layout/popover-demo/demo4.md +0 -118
- package/docs/layout/popover.md +0 -1
- package/docs/navigation/breadcrumbs.md +0 -1
- package/docs/navigation/button-demo/demo1.md +0 -413
- package/docs/navigation/button.md +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Margins
|
|
6
|
+
|
|
7
|
+
```hbs template
|
|
8
|
+
<div class="horizontal-rule-demo">
|
|
9
|
+
<EuiCode>none</EuiCode>
|
|
10
|
+
<div>
|
|
11
|
+
<EuiHorizontalRule @margin="none" />
|
|
12
|
+
</div>
|
|
13
|
+
<EuiCode>xs</EuiCode>
|
|
14
|
+
<div>
|
|
15
|
+
<EuiHorizontalRule @margin="xs" />
|
|
16
|
+
</div>
|
|
17
|
+
<EuiCode>s</EuiCode>
|
|
18
|
+
<div>
|
|
19
|
+
<EuiHorizontalRule @margin="s" />
|
|
20
|
+
</div>
|
|
21
|
+
<EuiCode>m</EuiCode>
|
|
22
|
+
<div>
|
|
23
|
+
<EuiHorizontalRule @margin="m" />
|
|
24
|
+
</div>
|
|
25
|
+
<EuiCode>l (default)</EuiCode>
|
|
26
|
+
<div>
|
|
27
|
+
<EuiHorizontalRule @margin="l" />
|
|
28
|
+
</div>
|
|
29
|
+
<EuiCode>xl</EuiCode>
|
|
30
|
+
<div>
|
|
31
|
+
<EuiHorizontalRule @margin="xl" />
|
|
32
|
+
</div>
|
|
33
|
+
<EuiCode>xxl</EuiCode>
|
|
34
|
+
<div>
|
|
35
|
+
<EuiHorizontalRule @margin="xxl" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 1
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<!-- <EuiText>
|
|
6
|
+
Each <strong>EuiModal</strong> requires a specific set of nested child components. They can be omitted if necessary, but the order cannot be changed or interrupted.
|
|
7
|
+
|
|
8
|
+
Modals come a wrapping <strong>EuiOverlayMask</strong> to obscure the content beneath, but unlike flyouts, modals cannot be dismissed by clicking on the overlay mask. This is inline with our modal usage guidelines which requires there to be a primary action button, even if that button simply closes the modal.
|
|
9
|
+
</EuiText> -->
|
|
10
|
+
|
|
11
|
+
```hbs template
|
|
12
|
+
<EuiButton
|
|
13
|
+
@color='primary'
|
|
14
|
+
{{on 'click' this.activateModal}}
|
|
15
|
+
>
|
|
16
|
+
Show modal
|
|
17
|
+
</EuiButton>
|
|
18
|
+
|
|
19
|
+
{{#if this.isActive}}
|
|
20
|
+
|
|
21
|
+
<EuiModal
|
|
22
|
+
@onClose={{this.deactivateModal}}
|
|
23
|
+
>
|
|
24
|
+
<EuiModalHeader>
|
|
25
|
+
<EuiTitle @size='m'>
|
|
26
|
+
Modal title
|
|
27
|
+
</EuiTitle>
|
|
28
|
+
</EuiModalHeader>
|
|
29
|
+
<EuiModalBody>
|
|
30
|
+
<EuiText>
|
|
31
|
+
<p>
|
|
32
|
+
This modal has the following setup:
|
|
33
|
+
</p>
|
|
34
|
+
<p>
|
|
35
|
+
<EuiCodeBlock @isCopyable={{true}}>
|
|
36
|
+
some code here...
|
|
37
|
+
</EuiCodeBlock>
|
|
38
|
+
</p>
|
|
39
|
+
</EuiText>
|
|
40
|
+
</EuiModalBody>
|
|
41
|
+
<EuiModalFooter>
|
|
42
|
+
<EuiButton
|
|
43
|
+
{{on 'click' this.deactivateModal}}
|
|
44
|
+
@color='primary'
|
|
45
|
+
@fill={{true}}
|
|
46
|
+
>
|
|
47
|
+
Close
|
|
48
|
+
</EuiButton>
|
|
49
|
+
</EuiModalFooter>
|
|
50
|
+
</EuiModal>
|
|
51
|
+
{{/if}}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```js component
|
|
55
|
+
import Component from '@glimmer/component';
|
|
56
|
+
import { tracked } from '@glimmer/tracking';
|
|
57
|
+
import { action } from '@ember/object';
|
|
58
|
+
|
|
59
|
+
export default class DemoModalComponent extends Component {
|
|
60
|
+
@tracked isActive = false;
|
|
61
|
+
|
|
62
|
+
@action
|
|
63
|
+
activateModal(modal) {
|
|
64
|
+
this.isActive = true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@action
|
|
68
|
+
deactivateModal(modal) {
|
|
69
|
+
this.isActive = false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Forms in a modal
|
|
6
|
+
|
|
7
|
+
```hbs template
|
|
8
|
+
<EuiButton
|
|
9
|
+
@color='primary'
|
|
10
|
+
{{on 'click' this.activateModal}}
|
|
11
|
+
>
|
|
12
|
+
Show form modal
|
|
13
|
+
</EuiButton>
|
|
14
|
+
|
|
15
|
+
{{#if this.isActive}}
|
|
16
|
+
|
|
17
|
+
<EuiModal
|
|
18
|
+
@onClose={{this.deactivateModal}}
|
|
19
|
+
>
|
|
20
|
+
<EuiModalHeader>
|
|
21
|
+
<EuiTitle @size='m'>
|
|
22
|
+
Modal title
|
|
23
|
+
</EuiTitle>
|
|
24
|
+
</EuiModalHeader>
|
|
25
|
+
<EuiModalBody>
|
|
26
|
+
<EuiForm>
|
|
27
|
+
{{#let
|
|
28
|
+
(unique-id)
|
|
29
|
+
(unique-id)
|
|
30
|
+
(unique-id)
|
|
31
|
+
(unique-id)
|
|
32
|
+
as |switchId textId rangeId selectId|}}
|
|
33
|
+
<EuiFormRow @id={{switchId}}>
|
|
34
|
+
<EuiSwitch
|
|
35
|
+
@id={{switchId}}
|
|
36
|
+
@label='Cool modal form'
|
|
37
|
+
@checked={{this.switchValue}}
|
|
38
|
+
@onChange={{pick 'target.checked' (set this 'switchValue')}}
|
|
39
|
+
/>
|
|
40
|
+
</EuiFormRow>
|
|
41
|
+
<EuiFormRow @label='A text field' @id={{textId}}>
|
|
42
|
+
<EuiFieldText
|
|
43
|
+
@value={{this.textValue}}
|
|
44
|
+
@id={{textId}}
|
|
45
|
+
{{on 'input' (pick 'target.value' (set this 'textValue'))}}
|
|
46
|
+
/>
|
|
47
|
+
</EuiFormRow>
|
|
48
|
+
<EuiFormRow @label='Range' @id={{textId}}>
|
|
49
|
+
<EuiRange
|
|
50
|
+
@min={{0}}
|
|
51
|
+
@max={{10}}
|
|
52
|
+
@step={{1}}
|
|
53
|
+
@value={{this.rangeValue}}
|
|
54
|
+
@onChange={{pick 'target.value' (set this 'rangeValue')}}
|
|
55
|
+
@showLabels={{false}}
|
|
56
|
+
aria-describedby={{rangeId}}
|
|
57
|
+
/>
|
|
58
|
+
<EuiFormHelpText id={{rangeId}}>
|
|
59
|
+
Some help text for the range
|
|
60
|
+
</EuiFormHelpText>
|
|
61
|
+
|
|
62
|
+
</EuiFormRow>
|
|
63
|
+
<EuiFormRow @label='An EuiSuperSelect' @id={{textId}}>
|
|
64
|
+
<TodoText @text='missing eui-super-select'/>
|
|
65
|
+
</EuiFormRow>
|
|
66
|
+
{{/let}}
|
|
67
|
+
</EuiForm>
|
|
68
|
+
</EuiModalBody>
|
|
69
|
+
<EuiModalFooter>
|
|
70
|
+
<EuiButton
|
|
71
|
+
{{on 'click' this.deactivateModal}}
|
|
72
|
+
@color='primary'
|
|
73
|
+
>
|
|
74
|
+
Cancel
|
|
75
|
+
</EuiButton>
|
|
76
|
+
<EuiButton
|
|
77
|
+
{{on 'click' this.deactivateModal}}
|
|
78
|
+
@color='primary'
|
|
79
|
+
@fill={{true}}
|
|
80
|
+
>
|
|
81
|
+
Save
|
|
82
|
+
</EuiButton>
|
|
83
|
+
</EuiModalFooter>
|
|
84
|
+
</EuiModal>
|
|
85
|
+
{{/if}}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```js component
|
|
89
|
+
import Component from '@glimmer/component';
|
|
90
|
+
import { tracked } from '@glimmer/tracking';
|
|
91
|
+
import { action } from '@ember/object';
|
|
92
|
+
|
|
93
|
+
export default class DemoModalComponent extends Component {
|
|
94
|
+
@tracked isActive = false;
|
|
95
|
+
|
|
96
|
+
@action
|
|
97
|
+
activateModal(modal) {
|
|
98
|
+
this.isActive = true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@action
|
|
102
|
+
deactivateModal(modal) {
|
|
103
|
+
this.isActive = false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
```
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 3
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Confirm Modal
|
|
6
|
+
|
|
7
|
+
```hbs template
|
|
8
|
+
|
|
9
|
+
<!-- buttons -->
|
|
10
|
+
|
|
11
|
+
<EuiFlexGroup>
|
|
12
|
+
<EuiFlexItem>
|
|
13
|
+
<EuiButton
|
|
14
|
+
@color='primary'
|
|
15
|
+
{{on 'click' (fn this.activateModal 'confirmModalActive')}}
|
|
16
|
+
>
|
|
17
|
+
Show confirm modal
|
|
18
|
+
</EuiButton>
|
|
19
|
+
</EuiFlexItem>
|
|
20
|
+
<EuiFlexItem>
|
|
21
|
+
<EuiButton
|
|
22
|
+
@color='primary'
|
|
23
|
+
{{on 'click' (fn this.activateModal 'dangerousConfirmModalActive')}}
|
|
24
|
+
>
|
|
25
|
+
Show dangerous confirm modal
|
|
26
|
+
</EuiButton>
|
|
27
|
+
</EuiFlexItem>
|
|
28
|
+
</EuiFlexGroup>
|
|
29
|
+
|
|
30
|
+
<!-- modals -->
|
|
31
|
+
|
|
32
|
+
{{#if this.confirmModalActive}}
|
|
33
|
+
<EuiConfirmModal
|
|
34
|
+
@title='Do this thing'
|
|
35
|
+
@onConfirm={{fn this.deactivateModal 'confirmModalActive'}}
|
|
36
|
+
@buttonColor='primary'
|
|
37
|
+
@confirmButtonText='Yes, do it'
|
|
38
|
+
@cancelButtonText="No, don't do it"
|
|
39
|
+
@onCancel={{fn this.deactivateModal 'confirmModalActive'}}
|
|
40
|
+
>
|
|
41
|
+
<EuiText>
|
|
42
|
+
<p>You are about to do something</p>
|
|
43
|
+
<p>Are you sure you want to do this?</p>
|
|
44
|
+
</EuiText>
|
|
45
|
+
</EuiConfirmModal>
|
|
46
|
+
{{/if}}
|
|
47
|
+
|
|
48
|
+
{{#if this.dangerousConfirmModalActive}}
|
|
49
|
+
<EuiConfirmModal
|
|
50
|
+
@title='Do this destructive thing'
|
|
51
|
+
@onConfirm={{fn this.deactivateModal 'dangerousConfirmModalActive'}}
|
|
52
|
+
@buttonColor='danger'
|
|
53
|
+
@confirmButtonText='Yes, do it'
|
|
54
|
+
@cancelButtonText="No, don't do it"
|
|
55
|
+
@onCancel={{fn this.deactivateModal 'dangerousConfirmModalActive'}}
|
|
56
|
+
>
|
|
57
|
+
<EuiText>
|
|
58
|
+
<p>You’re about to destroy something.</p>
|
|
59
|
+
<p>Are you sure you want to do this?</p>
|
|
60
|
+
</EuiText>
|
|
61
|
+
</EuiConfirmModal>
|
|
62
|
+
{{/if}}
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```js component
|
|
67
|
+
import Component from '@glimmer/component';
|
|
68
|
+
import { tracked } from '@glimmer/tracking';
|
|
69
|
+
import { action } from '@ember/object';
|
|
70
|
+
|
|
71
|
+
export default class DemoModalComponent extends Component {
|
|
72
|
+
@tracked confirmModalActive = false;
|
|
73
|
+
@tracked dangerousConfirmModalActive = false;
|
|
74
|
+
|
|
75
|
+
@action
|
|
76
|
+
activateModal(modal) {
|
|
77
|
+
this[modal] = true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@action
|
|
81
|
+
deactivateModal(modal) {
|
|
82
|
+
this[modal] = false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 4
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Loading and disabling confirm button
|
|
6
|
+
|
|
7
|
+
<EuiText>
|
|
8
|
+
<strong>EuiConfirmModal</strong> supports being able to apply loading and disabled states to the confirm button with the <EuiCode>confirmButtonDisabled</EuiCode> and <EuiCode>isLoading</EuiCode> props respectively. This is helpful to indicate the fetching of data and/or to wait for a user's input before enabling the confirm action.
|
|
9
|
+
</EuiText>
|
|
10
|
+
|
|
11
|
+
```hbs template
|
|
12
|
+
<EuiButton
|
|
13
|
+
@color='primary'
|
|
14
|
+
{{on 'click' (fn this.activateModal 'modalActive')}}
|
|
15
|
+
>
|
|
16
|
+
Show loading confirm modal
|
|
17
|
+
</EuiButton>
|
|
18
|
+
{{#if this.modalActive}}
|
|
19
|
+
<EuiConfirmModal
|
|
20
|
+
@title='Delete the EUI repo?'
|
|
21
|
+
@onConfirm={{this.alertMessage}}
|
|
22
|
+
@buttonColor='danger'
|
|
23
|
+
@confirmButtonText='Delete'
|
|
24
|
+
@cancelButtonText='Cancel'
|
|
25
|
+
@isLoading={{this.isLoading}}
|
|
26
|
+
@confirmButtonDisabled={{(if
|
|
27
|
+
(eq this.textValue 'delete')
|
|
28
|
+
false
|
|
29
|
+
true
|
|
30
|
+
)}}
|
|
31
|
+
@onCancel={{fn this.deactivateModal 'modalActive'}}
|
|
32
|
+
>
|
|
33
|
+
<EuiText>
|
|
34
|
+
{{#let
|
|
35
|
+
(unique-id)
|
|
36
|
+
as |textId|}}
|
|
37
|
+
<EuiFormRow @label="Type the word 'delete' to confirm" @id={{textId}}>
|
|
38
|
+
<EuiFieldText
|
|
39
|
+
@value={{this.textValue}}
|
|
40
|
+
@id={{textId}}
|
|
41
|
+
@isLoading={{this.isLoading}}
|
|
42
|
+
{{on 'input' (pick 'target.value' (set this 'textValue'))}}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
</EuiFormRow>
|
|
46
|
+
{{/let}}
|
|
47
|
+
</EuiText>
|
|
48
|
+
</EuiConfirmModal>
|
|
49
|
+
{{/if}}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```js component
|
|
53
|
+
import Component from '@glimmer/component';
|
|
54
|
+
import { tracked } from '@glimmer/tracking';
|
|
55
|
+
import { action } from '@ember/object';
|
|
56
|
+
|
|
57
|
+
export default class DemoModalComponent extends Component {
|
|
58
|
+
@tracked modalActive = false;
|
|
59
|
+
@tracked isLoading = true;
|
|
60
|
+
|
|
61
|
+
@action
|
|
62
|
+
activateModal(modal) {
|
|
63
|
+
this[modal] = true
|
|
64
|
+
this.isLoading = true
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
this.isLoading = false
|
|
67
|
+
}, 1000);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@action
|
|
71
|
+
deactivateModal(modal) {
|
|
72
|
+
this[modal] = false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@action
|
|
76
|
+
alertMessage() {
|
|
77
|
+
confirm('Shame on you!')
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
@@ -15,54 +15,35 @@ order: 5
|
|
|
15
15
|
```hbs template
|
|
16
16
|
<EuiButton
|
|
17
17
|
@color='primary'
|
|
18
|
-
{{on 'click' (fn this.activateModal '
|
|
18
|
+
{{on 'click' (fn this.activateModal 'modalActive')}}
|
|
19
19
|
>
|
|
20
|
-
Show
|
|
20
|
+
Show modal with custom width
|
|
21
21
|
</EuiButton>
|
|
22
|
-
{{#if this.
|
|
22
|
+
{{#if this.modalActive}}
|
|
23
23
|
|
|
24
24
|
<EuiModal
|
|
25
|
-
@onClose={{fn this.deactivateModal '
|
|
26
|
-
|
|
27
|
-
style='width: 800px'
|
|
25
|
+
@onClose={{fn this.deactivateModal 'modalActive'}}
|
|
26
|
+
style='width: {{this.width}}px'
|
|
28
27
|
>
|
|
29
28
|
<EuiModalHeader>
|
|
30
|
-
<EuiTitle
|
|
31
|
-
|
|
29
|
+
<EuiTitle>
|
|
30
|
+
Modal title
|
|
32
31
|
</EuiTitle>
|
|
33
32
|
</EuiModalHeader>
|
|
34
33
|
<EuiModalBody>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
This modal has many
|
|
41
|
-
<a id='focusee' href='#'>
|
|
42
|
-
different
|
|
43
|
-
</a>
|
|
44
|
-
<a href='#'>
|
|
45
|
-
focusable
|
|
46
|
-
</a>
|
|
47
|
-
<a href='#'>
|
|
48
|
-
items
|
|
49
|
-
</a>
|
|
50
|
-
.
|
|
51
|
-
</p>
|
|
52
|
-
</EuiText>
|
|
34
|
+
This modal has the following setup:
|
|
35
|
+
<EuiSpacer/>
|
|
36
|
+
<EuiCodeBlock @isCopyable={{true}}>
|
|
37
|
+
{{this.code}}
|
|
38
|
+
</EuiCodeBlock>
|
|
53
39
|
</EuiModalBody>
|
|
54
40
|
<EuiModalFooter>
|
|
55
|
-
<EuiButtonEmpty
|
|
56
|
-
{{on 'click' (fn this.deactivateModal 'widthModalActive')}}
|
|
57
|
-
>
|
|
58
|
-
Cancel
|
|
59
|
-
</EuiButtonEmpty>
|
|
60
41
|
<EuiButton
|
|
61
|
-
{{on 'click' (fn this.deactivateModal '
|
|
42
|
+
{{on 'click' (fn this.deactivateModal 'modalActive')}}
|
|
62
43
|
@color='primary'
|
|
63
44
|
@fill={{true}}
|
|
64
45
|
>
|
|
65
|
-
|
|
46
|
+
close
|
|
66
47
|
</EuiButton>
|
|
67
48
|
</EuiModalFooter>
|
|
68
49
|
</EuiModal>
|
|
@@ -76,7 +57,12 @@ import { tracked } from '@glimmer/tracking';
|
|
|
76
57
|
import { action } from '@ember/object';
|
|
77
58
|
|
|
78
59
|
export default class DemoModalComponent extends Component {
|
|
79
|
-
@tracked
|
|
60
|
+
@tracked modalActive = false;
|
|
61
|
+
width = 800
|
|
62
|
+
|
|
63
|
+
code = `
|
|
64
|
+
<EuiModal style='width: ${this.width}'>...</EuiModal>
|
|
65
|
+
`
|
|
80
66
|
|
|
81
67
|
@action
|
|
82
68
|
activateModal(modal) {
|
|
@@ -87,10 +73,5 @@ export default class DemoModalComponent extends Component {
|
|
|
87
73
|
deactivateModal(modal) {
|
|
88
74
|
this[modal] = false;
|
|
89
75
|
}
|
|
90
|
-
|
|
91
|
-
@action
|
|
92
|
-
reloadPage() {
|
|
93
|
-
location.reload();
|
|
94
|
-
}
|
|
95
76
|
}
|
|
96
77
|
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Modal
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<EuiPageHeader @pageTitle="Modal"/>
|
|
6
|
+
|
|
7
|
+
<EuiSpacer @size="l" />
|
|
8
|
+
|
|
9
|
+
<EuiText>
|
|
10
|
+
A modal works best for focusing users' attention on a <strong>short</strong> amount of content and getting them to make a decision. Use it to temporarily interrupt a user’s current task and block interactions to the content below it. If your modal content is more complex, or requires considerable time to complete, consider using an EuiFlyout instead.
|
|
11
|
+
</EuiText>
|
|
12
|
+
|
|
13
|
+
<EuiHorizontalRule/>
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
order: 2
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Tabs
|
|
5
|
+
# Tabs in the page header
|
|
6
6
|
|
|
7
7
|
```hbs template
|
|
8
8
|
<EuiPageHeader
|
|
9
9
|
@bottomBorder={{true}}
|
|
10
10
|
@pageTitle="Page title"
|
|
11
|
-
@description='This description should be describing the current page as depicted by the page title. It will never extend beneath the right side content.'
|
|
12
11
|
@tabs={{array (hash label="Tab 1" isSelected=true) (hash label="Tab 2")}}
|
|
13
12
|
>
|
|
14
13
|
<:rightSideItems>
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
order: 3
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Tabs
|
|
6
|
-
|
|
7
5
|
```hbs template
|
|
6
|
+
<!-- example 2 -->
|
|
8
7
|
<EuiPageHeader
|
|
9
8
|
@bottomBorder={{true}}
|
|
10
|
-
@description='This description should be describing the current page as depicted by the
|
|
9
|
+
@description='This description should be describing the current page as depicted by the current tab. It has grow set to false to ensure a readable line-length.'
|
|
11
10
|
@dumb={{true}}
|
|
12
11
|
@tabs={{array (hash label="Tab 1" isSelected=true) (hash label="Tab 2")}}
|
|
13
12
|
/>
|
|
@@ -9,11 +9,12 @@ order: 4
|
|
|
9
9
|
</EuiText>
|
|
10
10
|
|
|
11
11
|
```hbs template
|
|
12
|
+
<!-- example 1 -->
|
|
12
13
|
<EuiPageHeader
|
|
13
14
|
@bottomBorder={{true}}
|
|
14
15
|
@pageTitle='Page title'
|
|
15
16
|
@description='Example of a description.'
|
|
16
|
-
@breadcrumbs={{this.
|
|
17
|
+
@breadcrumbs={{this.breadcrumbsExample1}}
|
|
17
18
|
>
|
|
18
19
|
<:rightSideItems>
|
|
19
20
|
<EuiFlexItem>
|
|
@@ -31,7 +32,7 @@ import Component from '@glimmer/component';
|
|
|
31
32
|
import { tracked } from '@glimmer/tracking';
|
|
32
33
|
|
|
33
34
|
export default class AccordionDemo1Component extends Component {
|
|
34
|
-
|
|
35
|
+
breadcrumbsExample1 = [
|
|
35
36
|
{
|
|
36
37
|
text: 'Breadcrumb 1',
|
|
37
38
|
href: '#',
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
order: 5
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Common pattern
|
|
6
|
-
|
|
7
5
|
<EuiText>
|
|
8
6
|
A common pattern is to use a single breadcrumb to return the user to a listing page from which the current page was navigated to
|
|
9
7
|
</EuiText>
|
|
@@ -36,29 +34,4 @@ order: 5
|
|
|
36
34
|
</EuiFlexItem>
|
|
37
35
|
</:rightSideItems>
|
|
38
36
|
</EuiPageHeader>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```js component
|
|
42
|
-
import Component from '@glimmer/component';
|
|
43
|
-
import { tracked } from '@glimmer/tracking';
|
|
44
|
-
|
|
45
|
-
export default class AccordionDemo1Component extends Component {
|
|
46
|
-
breadcrumbs = [
|
|
47
|
-
{
|
|
48
|
-
text: 'Breadcrumb 1',
|
|
49
|
-
href: '#',
|
|
50
|
-
onClick: (e) => e.preventDefault()
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
text: 'Breadcrumb 2',
|
|
54
|
-
href: '#',
|
|
55
|
-
onClick: (e) => e.preventDefault()
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
text: 'Current',
|
|
59
|
-
href: '#',
|
|
60
|
-
onClick: (e) => e.preventDefault()
|
|
61
|
-
}
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
```
|
|
37
|
+
```
|
|
File without changes
|
|
File without changes
|
|
@@ -13,10 +13,10 @@ order: 2
|
|
|
13
13
|
```hbs template
|
|
14
14
|
<EuiSpacer @size='l' />
|
|
15
15
|
<EuiPanel @hasShadow={{false}}>
|
|
16
|
-
|
|
16
|
+
<EuiCode>@hasShadow={{false}}</EuiCode>
|
|
17
17
|
</EuiPanel>
|
|
18
18
|
<EuiSpacer @size='l' />
|
|
19
19
|
<EuiPanel @hasBorder={{true}}>
|
|
20
|
-
|
|
20
|
+
<EuiCode>@hasBorder={{true}}</EuiCode>
|
|
21
21
|
</EuiPanel>
|
|
22
22
|
```
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
order: 4
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Split
|
|
5
|
+
# Split panels
|
|
6
6
|
|
|
7
7
|
<EuiText>
|
|
8
8
|
<p><strong>EuiSplitPanel</strong> is a composition of an outer and multiple inner <strong>EuiPanels</strong>. It is a namespaced component that you consume using <EuiCode>EuiSplitPanel.Outer</EuiCode> and <EuiCode>EuiSplitPanel.Inner</EuiCode> respectively. You can supply the same panel props to both components with the exception of a few to ensure the visual layout is correct. It also has two directions, <EuiCode>column</EuiCode> (default) and <EuiCode>row</EuiCode>.</p><p>For custom responsiveness, you can adjust at which breakpoints a <EuiCode>row</EuiCode> layout will stack by passing a new array of breakpoint names <EuiCode>['xs', 's']</EuiCode> to the <EuiCode>responsive</EuiCode> prop, or completely turn it off with <EuiCode>false</EuiCode>.</p>
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
order: 1
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Basic
|
|
6
|
-
|
|
7
5
|
<EuiText>
|
|
8
6
|
<p>
|
|
9
7
|
Use the
|
|
@@ -30,7 +28,7 @@ order: 1
|
|
|
30
28
|
<EuiPopover
|
|
31
29
|
@ownFocus={{true}}
|
|
32
30
|
@isOpen={{this.popover}}
|
|
33
|
-
@anchorPosition='
|
|
31
|
+
@anchorPosition='downCenter'
|
|
34
32
|
@closePopover={{set this 'popover' false}}
|
|
35
33
|
>
|
|
36
34
|
<:button>
|
|
@@ -43,7 +41,11 @@ order: 1
|
|
|
43
41
|
</EuiButton>
|
|
44
42
|
</:button>
|
|
45
43
|
<:content>
|
|
46
|
-
|
|
44
|
+
<EuiText @size="m" style="width: 300px;">
|
|
45
|
+
<p>
|
|
46
|
+
Popover content that’s wider than the default width
|
|
47
|
+
</p>
|
|
48
|
+
</EuiText>
|
|
47
49
|
</:content>
|
|
48
50
|
</EuiPopover>
|
|
49
51
|
</div>
|