diff --git a/src/components.js b/src/components.js index 77e25eefd5..34044bd9f1 100644 --- a/src/components.js +++ b/src/components.js @@ -1,3 +1,5 @@ +export * from 'ionic2/components/action-menu/action-menu' +export * from 'ionic2/components/alert/alert' export * from 'ionic2/components/aside/aside' export * from 'ionic2/components/checkbox/checkbox' export * from 'ionic2/components/content/content' diff --git a/src/components/action-menu/action-menu.js b/src/components/action-menu/action-menu.js index e69de29bb2..6f08f95c4c 100644 --- a/src/components/action-menu/action-menu.js +++ b/src/components/action-menu/action-menu.js @@ -0,0 +1,43 @@ +import {NgElement, Component, Template, Parent} from 'angular2/angular2' +import {ComponentConfig} from 'ionic2/config/component-config' + +export let ActionMenuConfig = new ComponentConfig('action-menu') + +@Component({ + selector: 'ion-action-menu', + services: [ActionMenuConfig] +}) +@Template({ + inline: ` +
+ ` +}) +export class ActionMenu { + constructor( + configFactory: ActionMenuConfig, + @NgElement() ngElement:NgElement + ) { + this.domElement = ngElement.domElement + this.domElement.classList.add('pane') + this.domElement.classList.add('pane-overlay') + this.config = configFactory.create(this) + } +} diff --git a/src/components/action-menu/action-menu.scss b/src/components/action-menu/action-menu.scss index df39da3d55..96691386d7 100644 --- a/src/components/action-menu/action-menu.scss +++ b/src/components/action-menu/action-menu.scss @@ -2,7 +2,6 @@ // Action Menu // -------------------------------------------------- -$action-menu-group-margin: 15px !default; $action-menu-background-color: rgba(243,243,243,.95) !default; $action-menu-button-text-color: #007aff !default; @@ -15,21 +14,12 @@ $action-menu-button-text-color: #007aff !default; width: 100%; } -.action-menu-group { - margin: $action-menu-group-margin; -} - .action-menu-group .action-menu-label { display: block; width: 100%; - text-align: center; - background: $action-menu-background-color; } .action-menu-group .action-menu-button { display: block; width: 100%; - text-align: center; - background: $action-menu-background-color; - color: $action-menu-button-text-color; } diff --git a/src/components/action-menu/extensions/ios.scss b/src/components/action-menu/extensions/ios.scss new file mode 100644 index 0000000000..a300f5a262 --- /dev/null +++ b/src/components/action-menu/extensions/ios.scss @@ -0,0 +1,79 @@ + +// iOS Action Menu +// -------------------------------------------------- + +$action-menu-ios-group-margin: 8px !default; +$action-menu-ios-background-color: rgba(243,243,243,.95) !default; + +$action-menu-ios-border-color: #d2d2d6 !default; +$action-menu-ios-border-radius: 4px !default; + +$action-menu-ios-label-color: #8a8a8a !default; +$action-menu-ios-label-font-size: 1.3rem !default; + +$action-menu-ios-button-color: #007aff !default; +$action-menu-ios-button-font-size: 2rem !default; + + +.action-menu-ios { + text-align: center; + + .action-menu-group { + margin: $action-menu-ios-group-margin; + } + + .action-menu-label, + .action-menu-button { + position: relative; + @include flex-display(); + @include flex-justify-content(center); + @include flex-align-items(center); + + border: 0; + min-height: 44px; + + background: $action-menu-ios-background-color; + font-weight: 400; + + &:after { + position: absolute; + top: auto; + right: auto; + bottom: 0; + left: 0; + z-index: $z-index-list-border; + display: block; + + width: 100%; + height: 1px; + @include transform-origin(50%, 0); + + background-color: $action-menu-ios-border-color; + + content: ''; + } + } + + .action-menu-label { + font-size: $action-menu-ios-label-font-size; + color: $action-menu-ios-label-color; + } + + .action-menu-button { + font-size: $action-menu-ios-button-font-size; + color: $action-menu-ios-button-color; + } + + .action-menu-label:first-child, + .action-menu-button:first-child { + border-top-left-radius: $action-menu-ios-border-radius; + border-top-right-radius: $action-menu-ios-border-radius; + } + + .action-menu-label:last-child, + .action-menu-button:last-child { + border-bottom-left-radius: $action-menu-ios-border-radius; + border-bottom-right-radius: $action-menu-ios-border-radius; + } + +} diff --git a/src/components/action-menu/test/basic/main.html b/src/components/action-menu/test/basic/main.html index b8ed156c81..c225943164 100644 --- a/src/components/action-menu/test/basic/main.html +++ b/src/components/action-menu/test/basic/main.html @@ -1,26 +1,4 @@ - + diff --git a/src/components/action-menu/test/basic/main.js b/src/components/action-menu/test/basic/main.js index d0bbf22754..c0bac17c9c 100644 --- a/src/components/action-menu/test/basic/main.js +++ b/src/components/action-menu/test/basic/main.js @@ -1,12 +1,12 @@ import {bootstrap} from 'angular2/core'; import {Component, Template} from 'angular2/angular2'; -import {View} from 'ionic2/components/view/view'; -import {Content} from 'ionic2/components/content/content'; +import {ActionMenu} from 'ionic2/components/action-menu/action-menu'; + @Component({ selector: '[ion-app]' }) @Template({ url: 'main.html', - directives: [View, Content] + directives: [ActionMenu] }) class IonicApp { constructor() { diff --git a/src/components/alert/alert.js b/src/components/alert/alert.js index e69de29bb2..daa1cc1c72 100644 --- a/src/components/alert/alert.js +++ b/src/components/alert/alert.js @@ -0,0 +1,35 @@ +import {NgElement, Component, Template, Parent} from 'angular2/angular2' +import {ComponentConfig} from 'ionic2/config/component-config' + +export let AlertConfig = new ComponentConfig('alert') + +@Component({ + selector: 'ion-alert', + services: [AlertConfig] +}) +@Template({ + inline: ` + +