-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: created directives for menu addon (#1183)
* #1132 add a menu example with an addon * #1132 add directives for the addon * #1132 update the directived * #1132 add a checkbox example
- Loading branch information
Showing
10 changed files
with
119 additions
and
10 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
docs/app/documentation/component-docs/menu/examples/menu-addon-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<fd-menu fd-menu-addon> | ||
<ul fd-menu-list> | ||
<li> | ||
<div fd-menu-item-addon> | ||
<fd-icon [glyph]="'cart-5'"></fd-icon> | ||
</div> | ||
<a href="" | ||
fd-menu-item>Option 1</a> | ||
</li> | ||
<li> | ||
<div fd-menu-item-addon> | ||
<fd-icon [glyph]="'accept'"></fd-icon> | ||
</div> | ||
<a href="" | ||
fd-menu-item>Option 2</a> | ||
</li> | ||
<li> | ||
<div fd-menu-item-addon></div> | ||
<a href="" | ||
fd-menu-item>Option 3</a> | ||
</li> | ||
<li> | ||
<div fd-menu-item-addon> | ||
<input type="checkbox" class="fd-form__control"> | ||
</div> | ||
<a href="" | ||
fd-menu-item>Option 4</a> | ||
</li> | ||
<li> | ||
<div fd-menu-item-addon> | ||
<fd-icon [glyph]="'cart'"></fd-icon> | ||
</div> | ||
<a href="" | ||
fd-menu-item>Option 5</a> | ||
</li> | ||
</ul> | ||
</fd-menu> |
7 changes: 7 additions & 0 deletions
7
docs/app/documentation/component-docs/menu/examples/menu-addon-examples.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-menu-addon-example', | ||
templateUrl: './menu-addon-example.component.html' | ||
}) | ||
export class MenuAddonExampleComponent { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Directive, HostBinding } from '@angular/core'; | ||
|
||
/** | ||
* The directive for menu addon(for icons). | ||
*/ | ||
@Directive({ | ||
selector: '[fd-menu-addon], [fdMenuAddon]' | ||
}) | ||
export class MenuAddonDirective { | ||
/** @hidden */ | ||
@HostBinding('class.fd-menu--addon-before') | ||
fdMenuAddonClass: boolean = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Directive, HostBinding } from '@angular/core'; | ||
|
||
/** | ||
* The directive for menu item addon(for icons). | ||
*/ | ||
@Directive({ | ||
selector: '[fd-menu-item-addon], [fdMenuItemAddon]' | ||
}) | ||
export class MenuItemAddonDirective { | ||
/** @hidden */ | ||
@HostBinding('class.fd-menu__addon-before') | ||
fdMenuItemAddonClass: boolean = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters