From f704cc3e97b10d1810142e94707ae5d31191580f Mon Sep 17 00:00:00 2001
From: Adam Bradley
Date: Thu, 17 Sep 2015 23:41:09 -0500
Subject: [PATCH] rename ActionMenu to ActionSheet
---
demos/action-menu/main.html | 3 -
demos/{action-menu => action-sheet}/index.ts | 12 +--
demos/action-sheet/main.html | 3 +
demos/material/index.ts | 12 +--
demos/modal/index.ts | 16 +--
demos/sink/index.ts | 8 +-
.../pages/{action-menu.ts => action-sheet.ts} | 24 ++---
ionic/components.ts | 2 +-
ionic/components/action-menu/action-menu.scss | 100 ------------------
ionic/components/action-menu/modes/ios.scss | 98 -----------------
ionic/components/action-menu/modes/md.scss | 82 --------------
.../action-menu/test/basic/main.html | 3 -
.../components/action-sheet/action-sheet.scss | 100 ++++++++++++++++++
.../action-sheet.ts} | 70 ++++++------
ionic/components/action-sheet/modes/ios.scss | 98 +++++++++++++++++
ionic/components/action-sheet/modes/md.scss | 82 ++++++++++++++
.../test/basic/e2e.ts | 2 +-
.../test/basic/index.ts | 12 +--
.../action-sheet/test/basic/main.html | 3 +
ionic/components/app/app.ts | 8 +-
ionic/components/modal/test/basic/index.ts | 16 +--
ionic/config/modes.ts | 16 +--
ionic/ionic.core.scss | 2 +-
ionic/ionic.ios.scss | 2 +-
ionic/ionic.md.scss | 2 +-
25 files changed, 388 insertions(+), 388 deletions(-)
delete mode 100644 demos/action-menu/main.html
rename demos/{action-menu => action-sheet}/index.ts (72%)
create mode 100644 demos/action-sheet/main.html
rename demos/sink/pages/{action-menu.ts => action-sheet.ts} (64%)
delete mode 100644 ionic/components/action-menu/action-menu.scss
delete mode 100644 ionic/components/action-menu/modes/ios.scss
delete mode 100644 ionic/components/action-menu/modes/md.scss
delete mode 100644 ionic/components/action-menu/test/basic/main.html
create mode 100644 ionic/components/action-sheet/action-sheet.scss
rename ionic/components/{action-menu/action-menu.ts => action-sheet/action-sheet.ts} (62%)
create mode 100644 ionic/components/action-sheet/modes/ios.scss
create mode 100644 ionic/components/action-sheet/modes/md.scss
rename ionic/components/{action-menu => action-sheet}/test/basic/e2e.ts (75%)
rename ionic/components/{action-menu => action-sheet}/test/basic/index.ts (72%)
create mode 100644 ionic/components/action-sheet/test/basic/main.html
diff --git a/demos/action-menu/main.html b/demos/action-menu/main.html
deleted file mode 100644
index ad6b69032a..0000000000
--- a/demos/action-menu/main.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Open Action Menu
-
diff --git a/demos/action-menu/index.ts b/demos/action-sheet/index.ts
similarity index 72%
rename from demos/action-menu/index.ts
rename to demos/action-sheet/index.ts
index 776ca6a9e1..5775b714b8 100644
--- a/demos/action-menu/index.ts
+++ b/demos/action-sheet/index.ts
@@ -1,4 +1,4 @@
-import {App, ActionMenu} from 'ionic/ionic';
+import {App, ActionSheet} from 'ionic/ionic';
@App({
@@ -6,13 +6,13 @@ import {App, ActionMenu} from 'ionic/ionic';
})
class IonicApp {
- constructor(actionMenu: ActionMenu) {
- this.actionMenu = actionMenu;
+ constructor(actionSheet: ActionSheet) {
+ this.actionSheet = actionSheet;
}
openMenu() {
- this.actionMenu.open({
+ this.actionSheet.open({
buttons: [
{ text: 'Share This' },
{ text: 'Move' }
@@ -32,8 +32,8 @@ class IonicApp {
return true;
}
- }).then(actionMenuRef => {
- this.actionMenuRef = actionMenuRef;
+ }).then(actionSheetRef => {
+ this.actionSheetRef = actionSheetRef;
});
}
diff --git a/demos/action-sheet/main.html b/demos/action-sheet/main.html
new file mode 100644
index 0000000000..c09a23b5e0
--- /dev/null
+++ b/demos/action-sheet/main.html
@@ -0,0 +1,3 @@
+
+ Open Action Sheet
+
diff --git a/demos/material/index.ts b/demos/material/index.ts
index 7216186557..bcf90a8c80 100644
--- a/demos/material/index.ts
+++ b/demos/material/index.ts
@@ -1,6 +1,6 @@
import {Component, Directive} from 'angular2/angular2';
-import {App, ActionMenu, IonicApp, IonicView, Register} from 'ionic/ionic';
+import {App, ActionSheet, IonicApp, IonicView, Register} from 'ionic/ionic';
@IonicView({
template: '' +
@@ -48,12 +48,12 @@ import {App, ActionMenu, IonicApp, IonicView, Register} from 'ionic/ionic';
''
})
export class FirstPage {
- constructor(app: IonicApp, actionMenu: ActionMenu) {
+ constructor(app: IonicApp, actionSheet: ActionSheet) {
this.app = app;
- this.actionMenu = actionMenu;
+ this.actionSheet = actionSheet;
}
showMoreMenu() {
- this.actionMenu.open({
+ this.actionSheet.open({
buttons: [
{ icon: 'ion-android-share-alt', text: 'Share' },
{ icon: 'ion-arrow-move', text: 'Move' }
@@ -72,8 +72,8 @@ export class FirstPage {
if(index == 1) { return false; }
return true;
}
- }).then(actionMenuRef => {
- this.actionMenuRef = actionMenuRef;
+ }).then(actionSheetRef => {
+ this.actionSheetRef = actionSheetRef;
});
}
diff --git a/demos/modal/index.ts b/demos/modal/index.ts
index d817a58057..7e7675c0c7 100644
--- a/demos/modal/index.ts
+++ b/demos/modal/index.ts
@@ -1,5 +1,5 @@
import {App, IonicView, IonicApp, IonicConfig, IonicPlatform} from 'ionic/ionic';
-import {Modal, ActionMenu, NavController, NavParams, Animation} from 'ionic/ionic';
+import {Modal, ActionSheet, NavController, NavParams, Animation} from 'ionic/ionic';
@App({
@@ -81,7 +81,7 @@ export class ContactModal {
Push (Go to 2nd)
- Open Action Menu
+ Open Action Sheet
Close By Handle
@@ -95,11 +95,11 @@ export class ModalFirstPage {
constructor(
nav: NavController,
modal: Modal,
- actionMenu: ActionMenu
+ actionSheet: ActionSheet
) {
this.nav = nav;
this.modal = modal;
- this.actionMenu = actionMenu;
+ this.actionSheet = actionSheet;
}
push() {
@@ -116,8 +116,8 @@ export class ModalFirstPage {
modal.close();
}
- openActionMenu() {
- this.actionMenu.open({
+ openActionSheet() {
+ this.actionSheet.open({
buttons: [
{ text: 'Share This' },
{ text: 'Move' }
@@ -136,8 +136,8 @@ export class ModalFirstPage {
if(index == 1) { return false; }
return true;
}
- }).then(actionMenuRef => {
- this.actionMenuRef = actionMenuRef;
+ }).then(actionSheetRef => {
+ this.actionSheetRef = actionSheetRef;
});
}
}
diff --git a/demos/sink/index.ts b/demos/sink/index.ts
index 5c439bae6b..27b082b229 100644
--- a/demos/sink/index.ts
+++ b/demos/sink/index.ts
@@ -15,7 +15,7 @@ import {TabsPage} from './pages/tabs'
import {MenuPage} from './pages/menu'
import {AnimationPage} from './pages/animation'
import {SlidePage} from './pages/slides'
-import {ActionMenuPage} from './pages/action-menu'
+import {ActionSheetPage} from './pages/action-sheet'
import {ModalPage} from './pages/modal'
@@ -66,8 +66,8 @@ import {ModalPage} from './pages/modal'
path: '/slides',
component: SlidePage
}, {
- path: '/action-menu',
- component: ActionMenuPage
+ path: '/action-sheet',
+ component: ActionSheetPage
}
]
})
@@ -92,7 +92,7 @@ class MyApp {
{ title: 'Menu', component: MenuPage },
{ title: 'Animation', component: AnimationPage },
{ title: 'Slides', component: SlidePage},
- { title: 'Action Menu', component: ActionMenuPage },
+ { title: 'Action Sheet', component: ActionSheetPage },
];
}
diff --git a/demos/sink/pages/action-menu.ts b/demos/sink/pages/action-sheet.ts
similarity index 64%
rename from demos/sink/pages/action-menu.ts
rename to demos/sink/pages/action-sheet.ts
index e1d72ab9cf..e5db5feca1 100644
--- a/demos/sink/pages/action-menu.ts
+++ b/demos/sink/pages/action-sheet.ts
@@ -1,38 +1,38 @@
-import {IonicApp, IonicView, NavController, ActionMenu} from 'ionic/ionic';
+import {IonicApp, IonicView, NavController, ActionSheet} from 'ionic/ionic';
import {SinkPage} from '../sink-page';
@IonicView({
template: `
- Action Menu
+ Action Sheet
- Action Menu
+ Action Sheet
- The Action Menu, similar to Action Sheet's on iOS, is a slide-up prompt
+ The Action Sheet, similar to Action Sheet's on iOS, is a slide-up prompt
that displays several options for the user to choose from before an action is performed.
- Action Menu's are great for prompting for dangerous actions (like deleting a photo album),
+ Action Sheet's are great for prompting for dangerous actions (like deleting a photo album),
or showing a "context menu" with multiple actions the user can perform on something.
Open Menu
`
})
-export class ActionMenuPage extends SinkPage {
- constructor(app: IonicApp, nav: NavController, actionMenu: ActionMenu) {
+export class ActionSheetPage extends SinkPage {
+ constructor(app: IonicApp, nav: NavController, actionSheet: ActionSheet) {
super(app);
this.nav = nav;
- this.actionMenu = actionMenu;
+ this.actionSheet = actionSheet;
}
openMenu() {
- console.log('Opening ActionMenu')
+ console.log('Opening ActionSheet')
- this.actionMenu.open({
+ this.actionSheet.open({
buttons: [
{ text: 'Share This' },
{ text: 'Move' }
@@ -52,8 +52,8 @@ export class ActionMenuPage extends SinkPage {
if(index == 1) { return false; }
return true;
}
- }).then(actionMenuRef => {
- this.actionMenuRef = actionMenuRef;
+ }).then(actionSheetRef => {
+ this.actionSheetRef = actionSheetRef;
})
}
diff --git a/ionic/components.ts b/ionic/components.ts
index 4cfba11d25..216f4e57ea 100644
--- a/ionic/components.ts
+++ b/ionic/components.ts
@@ -1,7 +1,7 @@
export * from 'ionic/components/app/app'
export * from 'ionic/components/app/id'
-export * from 'ionic/components/action-menu/action-menu'
+export * from 'ionic/components/action-sheet/action-sheet'
export * from 'ionic/components/button/button'
export * from 'ionic/components/card/card'
export * from 'ionic/components/checkbox/checkbox'
diff --git a/ionic/components/action-menu/action-menu.scss b/ionic/components/action-menu/action-menu.scss
deleted file mode 100644
index 371ff02a46..0000000000
--- a/ionic/components/action-menu/action-menu.scss
+++ /dev/null
@@ -1,100 +0,0 @@
-
-// Action Menu
-// --------------------------------------------------
-
-$action-menu-width: 100% !default;
-$action-menu-max-width: 520px !default;
-$action-menu-background-color: rgba(243,243,243,.95) !default;
-$action-menu-button-text-color: #007aff !default;
-
-$action-menu-options-bg-color: #f1f2f3 !default;
-$action-menu-options-bg-active-color: #e4e5e7 !default;
-$action-menu-options-text-color: #007aff !default;
-$action-menu-options-border-color: #d1d3d6 !default;
-
-
-ion-action-menu {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- display: block;
- z-index: $z-index-overlay;
-}
-
-action-menu-wrapper {
- position: absolute;
- z-index: $z-index-overlay-wrapper;
- bottom: 0;
- left: 0;
- right: 0;
- width: 100%;
- display: block;
- max-width: 500px;
- margin: auto;
-
- transform: translate3d(0, 100%, 0);
-}
-
-.action-menu-container {
- width: auto;
- overflow: hidden;
-
- button {
- display: block;
- padding: 1px;
- width: 100%;
- margin: 0;
- border-radius: 0;
- border-color: $action-menu-options-border-color;
- background-color: transparent;
-
- color: $action-menu-options-text-color;
- font-size: 21px;
-
- &:hover {
- color: $action-menu-options-text-color;
- }
- }
-
- button.activated {
- box-shadow: none;
- border-color: $action-menu-options-border-color;
- color: $action-menu-options-text-color;
- background: $action-menu-options-bg-active-color;
- }
-}
-
-.action-menu-has-icons .icon {
- position: absolute;
- left: 16px;
-}
-
-.action-menu-title {
- padding: 10px;
- color: #8f8f8f;
- text-align: center;
- font-size: 13px;
-}
-
-.action-menu-group {
- background-color: #fff;
- overflow: hidden;
-
- button {
- border-width: 1px 0px 0px 0px;
- }
-
- button:first-child:last-child {
- border-width: 0;
- }
-}
-
-.action-menu-options {
- background: $action-menu-options-bg-color;
-}
-
-.action-menu-cancel button {
- font-weight: 500;
-}
diff --git a/ionic/components/action-menu/modes/ios.scss b/ionic/components/action-menu/modes/ios.scss
deleted file mode 100644
index fff73b0dfb..0000000000
--- a/ionic/components/action-menu/modes/ios.scss
+++ /dev/null
@@ -1,98 +0,0 @@
-
-// iOS Action Menu
-// --------------------------------------------------
-
-$action-menu-ios-group-margin: 10px !default;
-$action-menu-ios-background-color: rgba(243,243,243,.95) !default;
-
-$action-menu-ios-height: 5.6rem !default;
-$action-menu-ios-padding: 1.8rem !default;
-$action-menu-ios-border-color: #d2d2d6 !default;
-$action-menu-ios-border-radius: 1.3rem !default;
-
-$action-menu-ios-title-color: #5f5f5f !default;
-$action-menu-ios-title-font-size: 1.2rem !default;
-
-$action-menu-ios-button-text-color: #007aff !default;
-$action-menu-ios-button-font-size: 2rem !default;
-$action-menu-ios-background-active: #ebebeb !default;
-
-$action-menu-ios-icon-font-size: 1.4em !default;
-
-
-ion-action-menu {
- text-align: center;
-}
-
-.action-menu-container {
- padding: 0 $action-menu-ios-group-margin;
-}
-
-ion-action-menu button {
- min-height: $action-menu-ios-height;
- padding: $action-menu-ios-padding;
-
- margin: 0;
- border: 0;
-
- background: transparent;
-
- &.activated {
- background: $action-menu-ios-background-active;
- }
-}
-
-.action-menu-group {
- margin-bottom: $action-menu-ios-group-margin - 2;
- border-radius: $action-menu-ios-border-radius;
-}
-
-.action-menu-group:last-child {
- margin-bottom: $action-menu-ios-group-margin;
-}
-
-.action-menu-title,
-.action-menu-option {
- min-height: $action-menu-ios-height;
-
- background: $action-menu-ios-background-color;
- font-weight: 400;
-
- border-bottom: 1px solid $action-menu-ios-border-color;
-}
-
-.action-menu-title {
- padding: 2rem;
- font-size: $action-menu-ios-title-font-size;
- font-weight: 500;
- color: $action-menu-ios-title-color;
- border-radius: 0;
-}
-
-.action-menu-option {
- font-size: $action-menu-ios-button-font-size;
- color: $action-menu-ios-button-text-color;
- border-radius: 0;
-}
-
-.action-menu-title:first-child,
-.action-menu-button:first-child,
-.action-menu-group button:first-child {
- border-top-left-radius: $action-menu-ios-border-radius;
- border-top-right-radius: $action-menu-ios-border-radius;
-}
-
-.action-menu-title:last-child,
-.action-menu-button:last-child,
-.action-menu-group button:last-child {
- border-bottom-left-radius: $action-menu-ios-border-radius;
- border-bottom-right-radius: $action-menu-ios-border-radius;
-}
-
-
-&.hairlines .action-menu {
- .action-menu-title,
- .action-menu-option {
- border-bottom-width: 0.55px;
- }
-}
diff --git a/ionic/components/action-menu/modes/md.scss b/ionic/components/action-menu/modes/md.scss
deleted file mode 100644
index 4eb055f7e9..0000000000
--- a/ionic/components/action-menu/modes/md.scss
+++ /dev/null
@@ -1,82 +0,0 @@
-
-// Material Design Action Menu
-// --------------------------------------------------
-
-$action-menu-md-background-color: #fafafa !default;
-
-$action-menu-md-height: 4.8rem !default;
-
-$action-menu-md-title-color: #757575 !default;
-$action-menu-md-title-font-size: 1.6rem !default;
-$action-menu-md-title-padding: 1.9rem 1.6rem 1.7rem !default;
-
-$action-menu-md-button-text-color: #222 !default;
-$action-menu-md-button-font-size: 1.6rem !default;
-$action-menu-md-background-active: #f1f1f1 !default;
-
-$action-menu-md-icon-font-size: 2.4rem !default;
-$action-menu-md-icon-margin: 0 28px 0 0 !default;
-
-
-ion-action-menu {
- margin: 0;
-}
-
-.action-menu-container {
- margin: 0;
-}
-
-.action-menu-title,
-.action-menu-option,
-.action-menu-destructive,
-.action-menu-cancel button {
- text-align: left;
- border-color: transparent;
- font-size: $action-menu-md-button-font-size;
- color: $action-menu-md-button-text-color;
- box-shadow: none;
- text-transform: none;
-}
-
-ion-action-menu icon {
- display: inline-block;
- margin: $action-menu-md-icon-margin;
- min-width: 24px;
- text-align: center;
- vertical-align: middle;
- font-size: $action-menu-md-icon-font-size;
-}
-
-.action-menu-title {
- padding: $action-menu-md-title-padding;
- font-size: $action-menu-md-title-font-size;
- color: $action-menu-md-title-color;
-}
-
-ion-action-menu button {
- font-weight: normal;
- min-height: $action-menu-md-height;
-
- &.activated {
- background: $action-menu-md-background-active;
- border-radius: 0;
- box-shadow: none;
- }
-}
-
-.action-menu-group {
- margin: 0;
- border-radius: 0;
- background-color: $action-menu-md-background-color;
-
- &:last-child button {
- margin-bottom: 8px;
- }
-}
-
-.action-menu-cancel {
- background-color: $action-menu-md-background-color;
- width: auto;
- border: none;
-}
-
diff --git a/ionic/components/action-menu/test/basic/main.html b/ionic/components/action-menu/test/basic/main.html
deleted file mode 100644
index ad6b69032a..0000000000
--- a/ionic/components/action-menu/test/basic/main.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Open Action Menu
-
diff --git a/ionic/components/action-sheet/action-sheet.scss b/ionic/components/action-sheet/action-sheet.scss
new file mode 100644
index 0000000000..63be5a5e92
--- /dev/null
+++ b/ionic/components/action-sheet/action-sheet.scss
@@ -0,0 +1,100 @@
+
+// Action Sheet
+// --------------------------------------------------
+
+$action-sheet-width: 100% !default;
+$action-sheet-max-width: 520px !default;
+$action-sheet-background-color: rgba(243,243,243,.95) !default;
+$action-sheet-button-text-color: #007aff !default;
+
+$action-sheet-options-bg-color: #f1f2f3 !default;
+$action-sheet-options-bg-active-color: #e4e5e7 !default;
+$action-sheet-options-text-color: #007aff !default;
+$action-sheet-options-border-color: #d1d3d6 !default;
+
+
+ion-action-sheet {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ display: block;
+ z-index: $z-index-overlay;
+}
+
+action-sheet-wrapper {
+ position: absolute;
+ z-index: $z-index-overlay-wrapper;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: 100%;
+ display: block;
+ max-width: 500px;
+ margin: auto;
+
+ transform: translate3d(0, 100%, 0);
+}
+
+.action-sheet-container {
+ width: auto;
+ overflow: hidden;
+
+ button {
+ display: block;
+ padding: 1px;
+ width: 100%;
+ margin: 0;
+ border-radius: 0;
+ border-color: $action-sheet-options-border-color;
+ background-color: transparent;
+
+ color: $action-sheet-options-text-color;
+ font-size: 21px;
+
+ &:hover {
+ color: $action-sheet-options-text-color;
+ }
+ }
+
+ button.activated {
+ box-shadow: none;
+ border-color: $action-sheet-options-border-color;
+ color: $action-sheet-options-text-color;
+ background: $action-sheet-options-bg-active-color;
+ }
+}
+
+.action-sheet-has-icons .icon {
+ position: absolute;
+ left: 16px;
+}
+
+.action-sheet-title {
+ padding: 10px;
+ color: #8f8f8f;
+ text-align: center;
+ font-size: 13px;
+}
+
+.action-sheet-group {
+ background-color: #fff;
+ overflow: hidden;
+
+ button {
+ border-width: 1px 0px 0px 0px;
+ }
+
+ button:first-child:last-child {
+ border-width: 0;
+ }
+}
+
+.action-sheet-options {
+ background: $action-sheet-options-bg-color;
+}
+
+.action-sheet-cancel button {
+ font-weight: 500;
+}
diff --git a/ionic/components/action-menu/action-menu.ts b/ionic/components/action-sheet/action-sheet.ts
similarity index 62%
rename from ionic/components/action-menu/action-menu.ts
rename to ionic/components/action-sheet/action-sheet.ts
index 53cf96c8f7..3f98e29fb8 100644
--- a/ionic/components/action-menu/action-menu.ts
+++ b/ionic/components/action-sheet/action-sheet.ts
@@ -1,9 +1,9 @@
/**
* @ngdoc service
-* @name ActionMenu
+* @name ActionSheet
* @module ionic
* @description
-* The ActionMenu is a modal menu with options to select based on an action.
+* The ActionSheet is a modal menu with options to select based on an action.
*/
import {View, Injectable, NgFor, NgIf} from 'angular2/angular2';
@@ -15,9 +15,9 @@ import * as util from 'ionic/util';
/**
- * @name ActionMenu
+ * @name ActionSheet
* @description
- * The Action Menu is a slide-up pane that lets the user choose from a set of options. Dangerous options are made obvious.
+ * The Action Sheet is a slide-up pane that lets the user choose from a set of options. Dangerous options are made obvious.
*
* There are easy ways to cancel out of the action sheet, such as tapping the backdrop or even hitting escape on the keyboard for desktop testing.
*
@@ -25,7 +25,7 @@ import * as util from 'ionic/util';
* ```ts
* openMenu() {
*
- * this.actionMenu.open({
+ * this.actionSheet.open({
* buttons: [
* { text: 'Share This' },
* { text: 'Move' }
@@ -45,8 +45,8 @@ import * as util from 'ionic/util';
* return true;
* }
*
- * }).then(actionMenuRef => {
- * this.actionMenuRef = actionMenuRef;
+ * }).then(actionSheetRef => {
+ * this.actionSheetRef = actionSheetRef;
* });
*
* }
@@ -55,28 +55,28 @@ import * as util from 'ionic/util';
@View({
template:
' ' +
- '' +
- '