Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eui flyout eui collapsible nav update #109

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ if so, you can force that all packages use the same dependency with npm `overrid

```
"resolutions": {
"@embroider/macros": "^1.3.0",
"@embroider/shared-internals": "^1.3.0",
"@embroider/util": "^1.3.0"
"@embroider/macros": "^1.5.0",
"@embroider/shared-internals": "^1.5.0",
"@embroider/util": "^1.5.0"
}
```

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"lerna": "^4.0.0"
},
"resolutions": {
"@embroider/macros": "^1.3.0",
"@embroider/shared-internals": "^1.3.0",
"@embroider/util": "^1.3.0"
"@embroider/macros": "^1.5.0",
"@embroider/shared-internals": "^1.5.0",
"@embroider/util": "^1.5.0"
},
"volta": {
"node": "16.14.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/changeset-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"@ember/optional-features": "^2.0.0",
"@ember/render-modifiers": "^1.0.2",
"@ember/test-helpers": "^2.6.0",
"@embroider/test-setup": "^1.0.0",
"@embroider/util": "^1.3.0",
"@embroider/test-setup": "^1.5.0",
"@embroider/util": "^1.5.0",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"@types/ember": "^3.16.4",
Expand Down
16 changes: 16 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

### Master

### 5.0.0
💥 Breaking change
`@ember-eui/core`
- Deprecate `<EuiFlyoutBody::Content />` and `<EuiFlyoutBody::Banner>`, we now use named blocks `<:content>` `<:banner>`

🐛 Bug / Fixes
`@ember-eui/core`
- `<EuiOverlayMask />` now correctly only executes outside clicks, you must provide `{{@onClick}}` argument for that.

🚀 Enhancements
`@ember-eui/core`
Update core components to @elastic/eui v4.1.4
- `<EuiFlyout>`
- `<EuiCollapsibleNav>`


### 4.2.5
🐛 Bug / Fixes
`@ember-eui/core`
Expand Down
180 changes: 114 additions & 66 deletions packages/core/addon/components/eui-collapsible-nav-group/index.hbs
Original file line number Diff line number Diff line change
@@ -1,76 +1,124 @@
{{#let (unique-id) as |groupId|}}
{{#if (and @isCollapsible (has-block "title"))}}
<EuiAccordion
id={{groupId}}
class={{class-names
(if (has-block "title") "euiCollapsibleNavGroup--withHeading")
componentName="EuiCollapsibleNavGroup"
backgroundColor=(arg-or-default @background "none")
}}
@buttonClassName="euiCollapsibleNavGroup__heading"
@initialIsOpen={{arg-or-default @initialIsOpen true}}
@arrowDisplay="right"
...attributes
>
<:buttonContent>
<EuiFlexGroup @gutterSize="m" @alignItems="center" @responsive={{false}}>
{{#if @iconType}}
<div class="euiFlexItem euiFlexItem--flexGrowZero">
<EuiIcon @type={{@iconType}} @size={{arg-or-default @iconSize "l"}} />
</div>
{{/if}}
<EuiFlexItem>
<EuiTitle
id={{concat groupId "__title"}}
class="euiCollapsibleNavGroup__title"
@tagName={{arg-or-default @titleTagName "h3"}}
@size={{arg-or-default @titleSize "xxs"}}
>
{{yield to="title"}}
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
</:buttonContent>
<:content>
<div class="euiCollapsibleNavGroup__children">
{{yield to="content"}}
</div>
</:content>
</EuiAccordion>
{{else}}
<div
id={{groupId}}
class={{class-names
(if (has-block "title") "euiCollapsibleNavGroup--withHeading")
componentName="EuiCollapsibleNavGroup"
backgroundColor=(arg-or-default @background "none")
}}
...attributes
>
{{#if (has-block "title")}}
<div class="euiCollapsibleNavGroup__heading">
<EuiFlexGroup @gutterSize="m" @alignItems="center" @responsive={{false}}>
{{#let
(arg-or-default @id (unique-id))
(arg-or-default @titleElement "h3")
as |groupID titleElement|
}}
{{#let (concat groupID "__title") as |titleID|}}
{{#if (and @isCollapsible (has-block "title"))}}
<EuiAccordion
id={{groupID}}
class={{class-names
(if (has-block "title") "euiCollapsibleNavGroup--withHeading")
componentName="EuiCollapsibleNavGroup"
backgroundColor=(arg-or-default @background "none")
}}
@buttonClassName="euiCollapsibleNavGroup__heading"
@initialIsOpen={{arg-or-default @initialIsOpen true}}
@arrowDisplay="right"
...attributes
>
<:buttonContent>
<EuiFlexGroup
@gutterSize="m"
@alignItems="center"
@responsive={{false}}
>
{{#if @iconType}}
<div class="euiFlexItem euiFlexItem--flexGrowZero">
<EuiIcon @type={{@iconType}} @size={{@iconSize}} />
</div>
<EuiFlexItem @grow={{false}}>
<EuiIcon
@type={{@iconType}}
@size={{arg-or-default @iconSize "l"}}
/>
</EuiFlexItem>
{{/if}}
<EuiFlexItem>
<EuiTitle
id={{concat groupId "__title"}}
class="euiCollapsibleNavGroup__title"
<EuiTitle
id={{concat groupID "__title"}}
@tagName={{arg-or-default @titleTagName "h3"}}
@size={{arg-or-default @titleSize "xxs"}}
>
{{yield to="title"}}
{{#if (not-eq titleElement "h3")}}
{{#let (element titleElement) as |TitleElement|}}
<TitleElement
id={{titleID}}
class="euiCollapsibleNavGroup__title"
>
{{yield to="title"}}
</TitleElement>
{{/let}}
{{else}}
<h3 id={{titleID}} class="euiCollapsibleNavGroup__title">
{{yield to="title"}}
</h3>
{{/if}}
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
</div>
{{/if}}
<div class="euiCollapsibleNavGroup__children">
{{yield to="content"}}
</:buttonContent>
<:content>
{{#if (has-block "content")}}
<div class="euiCollapsibleNavGroup__children">
{{yield to="content"}}
</div>
{{/if}}
</:content>
</EuiAccordion>
{{else}}
<div
id={{groupID}}
class={{class-names
(if (has-block "title") "euiCollapsibleNavGroup--withHeading")
componentName="EuiCollapsibleNavGroup"
backgroundColor=(arg-or-default @background "none")
}}
...attributes
>
{{#if (has-block "title")}}
<div class="euiCollapsibleNavGroup__heading">
<EuiFlexGroup
@gutterSize="m"
@alignItems="center"
@responsive={{false}}
>
{{#if @iconType}}
<EuiFlexItem @grow={{false}}>
<EuiIcon
@type={{@iconType}}
@size={{arg-or-default @iconSize "l"}}
/>
</EuiFlexItem>
{{/if}}
<EuiFlexItem>
<EuiTitle
id={{concat groupID "__title"}}
@tagName={{arg-or-default @titleTagName "h3"}}
@size={{arg-or-default @titleSize "xxs"}}
>
{{#if (not-eq titleElement "h3")}}
{{#let (element titleElement) as |TitleElement|}}
<TitleElement
id={{titleID}}
class="euiCollapsibleNavGroup__title"
>
{{yield to="title"}}
</TitleElement>
{{/let}}
{{else}}
<h3 id={{titleID}} class="euiCollapsibleNavGroup__title">
{{yield to="title"}}
</h3>
{{/if}}
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
</div>
{{/if}}
{{#if (has-block "content")}}
<div class="euiCollapsibleNavGroup__children">
{{yield to="content"}}
</div>
{{/if}}
</div>
</div>
{{/if}}
{{/let}}
{{/if}}
{{/let}}
{{/let}}
79 changes: 35 additions & 44 deletions packages/core/addon/components/eui-collapsible-nav/index.hbs
Original file line number Diff line number Diff line change
@@ -1,47 +1,38 @@
{{!
Trigger button itself
By using a named block you can place any button as the trigger:
eg. HeaderSectionItem, EuiButton, EuiButtonIcon, or any custom button
}}
{{#if (not (and @navIsDocked (not @showButtonIfDocked)))}}
{{yield to="button"}}
{{/if}}
{{!
The side navigation panel, acts the same way as a flyout
}}
{{#if @isOpen}}
{{#let (unique-id) as |flyoutId|}}
{{#unless @navIsDocked}}
<EuiOverlayMask
@headerZindexLocation="below"
{{on "click" (unless @navIsDocked @onClose (noop))}}
/>
{{/unless}}
<nav
id={{flyoutId}}
class={{class-names "euiCollapsibleNav" (if @navIsDocked "euiCollapsibleNav--isDocked")}}
<span
{{this.onWindowResize
isDocked=this.isDocked
functionToCallOnWindowResize=this.functionToCallOnWindowResize
}}
></span>
{{#let (arg-or-default @id (unique-id)) as |flyoutID|}}

{{#if (not (and this.navIsDocked (not this.showButtonIfDocked)))}}
{{yield
(modifier this.triggerHandlers isOpen=@isOpen flyoutID=flyoutID)
to="button"
}}
{{/if}}

{{#if (or @isOpen this.navIsDocked)}}
<EuiFlyout
id={{flyoutID}}
class="euiCollapsibleNav"
@as={{this.as}}
@size={{this.size}}
@side={{this.side}}
@role={{this.role}}
@ownFocus={{this.ownFocus}}
@outsideClickCloses={{this.outsideClickCloses}}
@closeButtonPosition={{this.closeButtonPosition}}
@paddingSize={{this.paddingSize}}
@type={{if this.navIsDocked "push" "overlay"}}
@hideCloseButton={{this.navIsDocked}}
@pushMinBreakpoint={{this.dockedBreakpoint}}
@onClose={{@onClose}}
{{this.windowResize}}
...attributes
{{open-collapsible-nav @navIsDocked}}
{{on-key "Escape" (unless @navIsDocked @onClose)}}
{{focus-trap isActive=(not @navIsDocked) focusTrapOptions=(hash allowOutsideClick=true)}}
>
{{yield to="content"}}
{{!
Close button is for accessibility purposes only
To close, use ESC key, or click outside the Nav.
Commented for the time being
}}
{{!-- {{#if @showCloseButton}}
<EuiButtonEmpty
@onClick={{unless @navIsDocked @onClose}}
@size="xs"
@textClasses="euiCollapsibleNav__closeButtonText"
@iconType="cross"
class="euiCollapsibleNav__closeButton"
>
{{@closeButtonLabel}}
</EuiButtonEmpty>
{{/if}} --}}
</nav>
{{/let}}
{{/if}}
</EuiFlyout>
{{/if}}
{{/let}}
Loading