From a1fcc61d3b472bb911dfc69b67d8318b340ab6b9 Mon Sep 17 00:00:00 2001 From: Manuel Mtz-Almeida Date: Fri, 15 Sep 2017 11:45:19 -0500 Subject: [PATCH] chore(animations): using named functions - rollup generates a better code - better for dev debugging --- .../action-sheet-controller.tsx | 2 +- .../action-sheet/animations/ios.enter.ts | 2 +- .../action-sheet/animations/ios.leave.ts | 2 +- .../alert-controller/alert-controller.tsx | 2 +- .../components/alert/animations/ios.enter.ts | 2 +- .../components/alert/animations/ios.leave.ts | 2 +- .../components/item-sliding/item-sliding.tsx | 31 +++++++++---------- .../loading-controller/loading-controller.tsx | 2 +- .../loading/animations/ios.enter.ts | 2 +- .../loading/animations/ios.leave.ts | 2 +- .../components/modal/animations/ios.enter.ts | 2 +- .../components/modal/animations/ios.leave.ts | 2 +- .../popover/animations/ios.enter.ts | 2 +- .../popover/animations/ios.leave.ts | 2 +- .../core/src/components/select/select.tsx | 2 +- .../components/toast/animations/ios.enter.ts | 4 +-- .../components/toast/animations/ios.leave.ts | 4 +-- 17 files changed, 33 insertions(+), 34 deletions(-) diff --git a/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx b/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx index de08ec7d90..f5b39b6725 100644 --- a/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx +++ b/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx @@ -11,7 +11,7 @@ export class ActionSheetController { private actionSheets: ActionSheet[] = []; @Method() - create(opts?: ActionSheetOptions) { + create(opts?: ActionSheetOptions): Promise { // create ionic's wrapping ion-action-sheet component const actionSheet = document.createElement('ion-action-sheet'); diff --git a/packages/core/src/components/action-sheet/animations/ios.enter.ts b/packages/core/src/components/action-sheet/animations/ios.enter.ts index 5b7f7d09fa..e0ea75fcb9 100644 --- a/packages/core/src/components/action-sheet/animations/ios.enter.ts +++ b/packages/core/src/components/action-sheet/animations/ios.enter.ts @@ -3,7 +3,7 @@ import { Animation } from '../../../index'; /** * iOS Action Sheet Enter Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/action-sheet/animations/ios.leave.ts b/packages/core/src/components/action-sheet/animations/ios.leave.ts index d534e389be..a4170c00c7 100644 --- a/packages/core/src/components/action-sheet/animations/ios.leave.ts +++ b/packages/core/src/components/action-sheet/animations/ios.leave.ts @@ -3,7 +3,7 @@ import { Animation } from '../../../index'; /** * iOS Action Sheet Leave Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/alert-controller/alert-controller.tsx b/packages/core/src/components/alert-controller/alert-controller.tsx index 5a20cc5459..7a79407289 100644 --- a/packages/core/src/components/alert-controller/alert-controller.tsx +++ b/packages/core/src/components/alert-controller/alert-controller.tsx @@ -11,7 +11,7 @@ export class AlertController { private alerts: Alert[] = []; @Method() - create(opts?: AlertOptions) { + create(opts?: AlertOptions): Promise { // create ionic's wrapping ion-alert component const alert = document.createElement('ion-alert'); diff --git a/packages/core/src/components/alert/animations/ios.enter.ts b/packages/core/src/components/alert/animations/ios.enter.ts index a315ecf245..d3d549155f 100644 --- a/packages/core/src/components/alert/animations/ios.enter.ts +++ b/packages/core/src/components/alert/animations/ios.enter.ts @@ -3,7 +3,7 @@ import { Animation } from '../../../index'; /** * iOS Alert Enter Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/alert/animations/ios.leave.ts b/packages/core/src/components/alert/animations/ios.leave.ts index 295f49cf58..e9a4421d5e 100644 --- a/packages/core/src/components/alert/animations/ios.leave.ts +++ b/packages/core/src/components/alert/animations/ios.leave.ts @@ -3,7 +3,7 @@ import { Animation } from '../../../index'; /** * iOS Alert Leave Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/item-sliding/item-sliding.tsx b/packages/core/src/components/item-sliding/item-sliding.tsx index 16a635d2ff..c78c8ec518 100644 --- a/packages/core/src/components/item-sliding/item-sliding.tsx +++ b/packages/core/src/components/item-sliding/item-sliding.tsx @@ -485,22 +485,21 @@ export class ItemSliding { render() { return ( - - - - + + + ); } } diff --git a/packages/core/src/components/loading-controller/loading-controller.tsx b/packages/core/src/components/loading-controller/loading-controller.tsx index cd985e9f6b..68d4105457 100644 --- a/packages/core/src/components/loading-controller/loading-controller.tsx +++ b/packages/core/src/components/loading-controller/loading-controller.tsx @@ -11,7 +11,7 @@ export class LoadingController { private loadings: Loading[] = []; @Method() - create(opts?: LoadingOptions) { + create(opts?: LoadingOptions): Promise { // create ionic's wrapping ion-loading component const loading = document.createElement('ion-loading'); diff --git a/packages/core/src/components/loading/animations/ios.enter.ts b/packages/core/src/components/loading/animations/ios.enter.ts index 7335291b8d..6985f7820b 100644 --- a/packages/core/src/components/loading/animations/ios.enter.ts +++ b/packages/core/src/components/loading/animations/ios.enter.ts @@ -4,7 +4,7 @@ import { Animation } from '../../../index'; /** * iOS Loading Enter Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/loading/animations/ios.leave.ts b/packages/core/src/components/loading/animations/ios.leave.ts index be387c48df..b5106968bd 100644 --- a/packages/core/src/components/loading/animations/ios.leave.ts +++ b/packages/core/src/components/loading/animations/ios.leave.ts @@ -4,7 +4,7 @@ import { Animation } from '../../../index'; /** * iOS Loading Leave Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/modal/animations/ios.enter.ts b/packages/core/src/components/modal/animations/ios.enter.ts index ba3749637c..bf0466be27 100644 --- a/packages/core/src/components/modal/animations/ios.enter.ts +++ b/packages/core/src/components/modal/animations/ios.enter.ts @@ -4,7 +4,7 @@ import { Animation } from '../../../index'; /** * iOS Modal Enter Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/modal/animations/ios.leave.ts b/packages/core/src/components/modal/animations/ios.leave.ts index 4f7790c070..65627de396 100644 --- a/packages/core/src/components/modal/animations/ios.leave.ts +++ b/packages/core/src/components/modal/animations/ios.leave.ts @@ -4,7 +4,7 @@ import { Animation } from '../../../index'; /** * iOS Modal Leave Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/popover/animations/ios.enter.ts b/packages/core/src/components/popover/animations/ios.enter.ts index ed533233d7..bce0738517 100644 --- a/packages/core/src/components/popover/animations/ios.enter.ts +++ b/packages/core/src/components/popover/animations/ios.enter.ts @@ -4,7 +4,7 @@ import { Animation } from '../../../index'; /** * iOS Popover Enter Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/popover/animations/ios.leave.ts b/packages/core/src/components/popover/animations/ios.leave.ts index a46266738f..f20ca4c7da 100644 --- a/packages/core/src/components/popover/animations/ios.leave.ts +++ b/packages/core/src/components/popover/animations/ios.leave.ts @@ -3,7 +3,7 @@ import { Animation } from '../../../index'; /** * iOS Popover Leave Animation */ -export default function(Animation: Animation, baseElm: HTMLElement) { +export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); diff --git a/packages/core/src/components/select/select.tsx b/packages/core/src/components/select/select.tsx index 480df00b85..231a87f682 100644 --- a/packages/core/src/components/select/select.tsx +++ b/packages/core/src/components/select/select.tsx @@ -398,4 +398,4 @@ export class Select { ]; } -} \ No newline at end of file +} diff --git a/packages/core/src/components/toast/animations/ios.enter.ts b/packages/core/src/components/toast/animations/ios.enter.ts index 7587690b36..8ef83c3a04 100644 --- a/packages/core/src/components/toast/animations/ios.enter.ts +++ b/packages/core/src/components/toast/animations/ios.enter.ts @@ -3,11 +3,11 @@ import { Animation } from '../../../index'; /** * iOS Toast Enter Animation */ -export default function( +export default function iOSEnterAnimation( Animation: Animation, baseElm: HTMLElement, position: string -) { +): Animation { const baseAnimation = new Animation(); const wrapperAnimation = new Animation(); diff --git a/packages/core/src/components/toast/animations/ios.leave.ts b/packages/core/src/components/toast/animations/ios.leave.ts index ab3e9166e2..b5282911f1 100644 --- a/packages/core/src/components/toast/animations/ios.leave.ts +++ b/packages/core/src/components/toast/animations/ios.leave.ts @@ -3,11 +3,11 @@ import { Animation } from '../../../index'; /** * iOS Toast Leave Animation */ -export default function( +export default function iOSLeaveAnimation( Animation: Animation, baseElm: HTMLElement, position: string -) { +): Animation { const baseAnimation = new Animation(); const wrapperAnimation = new Animation();