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

Added Added horizontal menu and menu item #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ package-lock.json
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
.idea
11 changes: 11 additions & 0 deletions addon/components/s-horizontal-menu-item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Component from '@ember/component';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate this file using ember g component
This component will not work as it doesnt have boilerplate code required for addon. like importing layout

export default Component.extend({
actions: {
doAction(){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's standardise this action name like onClick, onHover or similar

if (this.get('applyAction')) {
this.get('applyAction')(this.action, this.pipelineId);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.pipelineId ? 😄

}
}
}
});
5 changes: 5 additions & 0 deletions addon/components/s-horizontal-menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Component from '@ember/component';

export default Component.extend({
})

6 changes: 6 additions & 0 deletions addon/styles/components/_s-horizontal-menu-item.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.horizontal-dropdown-item{
color: $themeTitlePrimaryColor;
}
li:hover{
background: $themeHoverColor;
}
21 changes: 21 additions & 0 deletions addon/styles/components/_s-horizontal-menu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.pointed-dropdown::before {
position: absolute;
top: -7px;
left: 11px;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid $themeFifthGrey;
border-left: 7px solid transparent;
border-bottom-color: $themeFifthGrey;
content: '';
}
.pointed-dropdown::after {
position: absolute;
top: -6px;
left: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
border-left: 6px solid transparent;
content: '';
}
1 change: 1 addition & 0 deletions addon/templates/components/s-horizontal-menu-item.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<li class="horizontal-dropdown-item pt5 pl30 pb5 pr8" {{action "doAction"}}>{{title}}</li>
5 changes: 5 additions & 0 deletions addon/templates/components/s-horizontal-menu.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul class ="q-card-dropdown-menu dropdown-menu pointed-dropdown">
{{yield (hash
menu=(component "q-horizontal-menu-item" title=title))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if title is null?

}}
</ul>
1 change: 1 addition & 0 deletions app/components/s-horizontal-menu-item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'space-ui/components/s-horizontal-menu-item';
1 change: 1 addition & 0 deletions app/components/s-horizontal-menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'space-ui/components/s-horizontal-menu';
25 changes: 25 additions & 0 deletions tests/dummy/app/templates/docs/horizontal-menu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Horizontal menu

<p>To create a dropdown menu.</p>

{{#docs-demo as |demo|}}
{{#demo.example name='demo-horizontal-menu-basic.hbs'}}


{{#s-horizontal-menu as |m|
{{m.menu title="title" applyAction=(action "onMenuClick")
action=(action "itemAction") pipelineId=pipelineId}}
{{/s-horizontal-menu}}

{{/demo.example}}

{{demo.snippet 'demo-horizontal-menu-basic.hbs'}}
{{/docs-demo}}

| Property | Description | Type | Default |
| ---------- | ---------------------------------------------------------------------------- | ------- | ------- |
| title | Name of the menu item | string | "" |
| action | Action to be performed on clicking an item from the menu | String | "" |
| pipelineID | Id of the unique identifier | String | "" |
| applyAction | Generic action that will call the "action provided" | string | "" |