Skip to content

Commit a1eb1cf

Browse files
committed
chore: cleanup
1 parent 84bf1aa commit a1eb1cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2102
-660
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dist
1414
!/nativescript-angular/hooks/**/*.js
1515
!/nativescript-angular/gulpfile.js
1616
!/nativescript-angular/zone-js/dist/*.js
17+
!/nativescript-angular/zone-js/dist/zone-nativescript.ts
1718

1819
/nativescript-angular-package/**/*.d.ts
1920
/nativescript-angular-package/**/*.js

nativescript-angular/animations/animation-driver.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { AnimationPlayer } from "@angular/animations";
2-
import { AnimationDriver } from "@angular/animations/browser";
3-
import { createSelector, SelectorCore } from "@nativescript/core/ui/styling/css-selector";
4-
import { CssAnimationProperty } from "@nativescript/core/ui/core/properties";
5-
import { eachDescendant } from "@nativescript/core/ui/core/view";
6-
import { ProxyViewContainer } from "@nativescript/core/ui/proxy-view-container";
7-
8-
import { NativeScriptAnimationPlayer } from "./animation-player";
1+
import { AnimationPlayer } from '@angular/animations';
2+
import { AnimationDriver } from '@angular/animations/browser';
3+
import { createSelector, SelectorCore } from '@nativescript/core/ui/styling/css-selector';
4+
import { CssAnimationProperty } from '@nativescript/core/ui/core/properties';
5+
import { eachDescendant } from '@nativescript/core/ui/core/view';
6+
import { ProxyViewContainer } from '@nativescript/core/ui/proxy-view-container';
7+
8+
import { NativeScriptAnimationPlayer } from './animation-player';
99
import {
1010
Keyframe,
1111
dashCaseToCamelCase,
12-
} from "./utils";
13-
import { NgView, InvisibleNode } from "../element-registry";
14-
import { NativeScriptDebug } from "../trace";
12+
} from './utils';
13+
import { NgView, InvisibleNode } from '../element-registry';
14+
import { NativeScriptDebug } from '../trace';
1515

1616

1717
interface ViewMatchResult {
@@ -44,11 +44,11 @@ class Selector {
4444
}
4545

4646
private parse(rawSelector: string) {
47-
const selectors = rawSelector.split(",").map(s => s.trim());
47+
const selectors = rawSelector.split(',').map(s => s.trim());
4848

4949
this.nsSelectors = selectors.map(createSelector);
5050
this.classSelectors = selectors
51-
.filter(s => s.startsWith("."))
51+
.filter(s => s.startsWith('.'))
5252
.map(s => s.substring(1));
5353
}
5454

@@ -64,14 +64,14 @@ class Selector {
6464
// that are dynamically added by the animation engine
6565
// such as .ng-trigger, that's added for every :enter view
6666
private hasClass(element: NgView, cls: string) {
67-
return element && element["$$classes"] && element["$$classes"][cls];
67+
return element && element['$$classes'] && element['$$classes'][cls];
6868
}
6969
}
7070

7171
export class NativeScriptAnimationDriver implements AnimationDriver {
7272
private static validProperties = [
7373
...CssAnimationProperty._getPropertyNames(),
74-
"transform",
74+
'transform',
7575
];
7676

7777
validateStyleProperty(property: string): boolean {
@@ -97,7 +97,7 @@ export class NativeScriptAnimationDriver implements AnimationDriver {
9797
);
9898

9999
// Checking if the parent is our fake body object
100-
if (elm1["isOverride"]) {
100+
if (elm1['isOverride']) {
101101
return true;
102102
}
103103

nativescript-angular/animations/animation-player.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { AnimationPlayer } from "@angular/animations";
1+
import { AnimationPlayer } from '@angular/animations';
22
import { KeyframeAnimation }
3-
from "@nativescript/core/ui/animation/keyframe-animation";
4-
import { View, EventData } from "@nativescript/core/ui/core/view";
3+
from '@nativescript/core/ui/animation/keyframe-animation';
4+
import { View, EventData } from '@nativescript/core/ui/core/view';
55

6-
import { Keyframe, createKeyframeAnimation } from "./utils";
7-
import { NgView } from "../element-registry";
8-
import { NativeScriptDebug } from "../trace";
6+
import { Keyframe, createKeyframeAnimation } from './utils';
7+
import { NgView } from '../element-registry';
8+
import { NativeScriptDebug } from '../trace';
99

1010
export class NativeScriptAnimationPlayer implements AnimationPlayer {
1111
public parentPlayer: AnimationPlayer = null;
@@ -110,7 +110,7 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer {
110110
}
111111

112112
setPosition(_p: any): void {
113-
throw new Error("AnimationPlayer.setPosition method is not supported!");
113+
throw new Error('AnimationPlayer.setPosition method is not supported!');
114114
}
115115

116116
getPosition(): number {

nativescript-angular/animations/animations.module.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ import {
66
RendererFactory2,
77
Optional,
88
SkipSelf,
9-
} from "@angular/core";
10-
import { DOCUMENT } from "@angular/common";
11-
import { AnimationBuilder } from "@angular/animations";
9+
} from '@angular/core';
10+
import { DOCUMENT } from '@angular/common';
11+
import { AnimationBuilder } from '@angular/animations';
1212

1313
import {
1414
AnimationDriver,
1515
ɵAnimationStyleNormalizer as AnimationStyleNormalizer,
1616
ɵWebAnimationsStyleNormalizer as WebAnimationsStyleNormalizer,
1717
ɵAnimationEngine as AnimationEngine,
18-
} from "@angular/animations/browser";
18+
} from '@angular/animations/browser';
1919

2020
import {
2121
ɵAnimationRendererFactory as AnimationRendererFactory,
2222
ɵBrowserAnimationBuilder as BrowserAnimationBuilder,
23-
} from "@angular/platform-browser/animations";
23+
} from '@angular/platform-browser/animations';
2424

2525
// import { NativeScriptModule } from "../nativescript.module";
26-
import { NativeScriptRendererFactory } from "../renderer";
27-
import { NativeScriptAnimationDriver } from "./animation-driver";
28-
import { throwIfAlreadyLoaded } from "../common/utils";
29-
import { NativeScriptCommonModule } from "../common";
26+
import { NativeScriptRendererFactory } from '../renderer';
27+
import { NativeScriptAnimationDriver } from './animation-driver';
28+
import { throwIfAlreadyLoaded } from '../common/utils';
29+
import { NativeScriptCommonModule } from '../common';
3030

3131
@Injectable()
3232
export class InjectableAnimationEngine extends AnimationEngine {
@@ -80,6 +80,6 @@ export class NativeScriptAnimationsModule {
8080
@Optional() @SkipSelf() parentModule: NativeScriptAnimationsModule
8181
) {
8282
// Prevents NativeScriptAnimationsModule from getting imported multiple times
83-
throwIfAlreadyLoaded(parentModule, "NativeScriptAnimationsModule");
83+
throwIfAlreadyLoaded(parentModule, 'NativeScriptAnimationsModule');
8484
}
8585
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * from "./animations.module";
2-
export * from "./animation-player";
3-
export * from "./animation-driver";
4-
export * from "./utils";
1+
export * from './animations.module';
2+
export * from './animation-player';
3+
export * from './animation-driver';
4+
export * from './utils';

nativescript-angular/animations/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {
33
KeyframeAnimationInfo,
44
KeyframeDeclaration,
55
KeyframeInfo,
6-
} from "@nativescript/core/ui/animation/keyframe-animation";
7-
import { parseKeyframeDeclarations } from "@nativescript/core/ui/styling/css-animation-parser";
8-
import { animationTimingFunctionConverter } from "@nativescript/core/ui/styling/converters";
6+
} from '@nativescript/core/ui/animation/keyframe-animation';
7+
import { parseKeyframeDeclarations } from '@nativescript/core/ui/styling/css-animation-parser';
8+
import { animationTimingFunctionConverter } from '@nativescript/core/ui/styling/converters';
99

1010
export interface Keyframe {
1111
[key: string]: string | number;

nativescript-angular/app-host-view.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ContentView } from "@nativescript/core/ui/content-view";
2-
import { GridLayout } from "@nativescript/core/ui/layouts/grid-layout";
3-
import { ProxyViewContainer } from "@nativescript/core/ui/proxy-view-container";
4-
import { View } from "@nativescript/core/ui/core/view";
1+
import { ContentView } from '@nativescript/core/ui/content-view';
2+
import { GridLayout } from '@nativescript/core/ui/layouts/grid-layout';
3+
import { ProxyViewContainer } from '@nativescript/core/ui/proxy-view-container';
4+
import { View } from '@nativescript/core/ui/core/view';
55

66
export class AppHostView extends ContentView {
77

nativescript-angular/common.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { CommonModule } from "@angular/common";
2-
import { NO_ERRORS_SCHEMA, NgModule } from "@angular/core";
1+
import { CommonModule } from '@angular/common';
2+
import { NO_ERRORS_SCHEMA, NgModule } from '@angular/core';
33

4-
import { ModalDialogService } from "./directives/dialogs";
4+
import { ModalDialogService } from './directives/dialogs';
55
import {
66
defaultDeviceProvider,
77
defaultFrameProvider,
88
defaultPageProvider,
9-
} from "./platform-providers";
10-
import { ListViewComponent } from "./directives/list-view-comp";
11-
import { TemplateKeyDirective } from "./directives/templated-items-comp";
12-
import { TabViewDirective, TabViewItemDirective } from "./directives/tab-view";
9+
} from './platform-providers';
10+
import { ListViewComponent } from './directives/list-view-comp';
11+
import { TemplateKeyDirective } from './directives/templated-items-comp';
12+
import { TabViewDirective, TabViewItemDirective } from './directives/tab-view';
1313
import {
1414
ActionBarComponent,
1515
ActionBarScope,
1616
ActionItemDirective,
1717
NavigationButtonDirective,
18-
} from "./directives/action-bar";
18+
} from './directives/action-bar';
1919
import {
2020
AndroidFilterComponent,
2121
IosFilterComponent,
22-
} from "./directives/platform-filters";
22+
} from './directives/platform-filters';
2323

2424
@NgModule({
2525
declarations: [
@@ -58,4 +58,4 @@ import {
5858
})
5959
export class NativeScriptCommonModule {}
6060

61-
export * from "./directives";
61+
export * from './directives';

nativescript-angular/common/detached-loader.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
22
ComponentRef, ComponentFactory, ViewContainerRef,
33
Component, Type, ComponentFactoryResolver, ChangeDetectorRef
4-
} from "@angular/core";
5-
import { write } from "@nativescript/core/trace";
4+
} from '@angular/core';
5+
import { write } from '@nativescript/core/trace';
66

7-
export const CATEGORY = "detached-loader";
7+
export const CATEGORY = 'detached-loader';
88
function log(message: string) {
99
write(message, CATEGORY);
1010
}
@@ -16,7 +16,7 @@ function log(message: string) {
1616
* the visual tree.
1717
*/
1818
@Component({
19-
selector: "DetachedContainer",
19+
selector: 'DetachedContainer',
2020
template: `<Placeholder #loader></Placeholder>`
2121
})
2222
export class DetachedLoader { // tslint:disable-line:component-class-suffix
@@ -35,7 +35,7 @@ export class DetachedLoader { // tslint:disable-line:component-class-suffix
3535
// inside component with OnPush CD strategy. Mark us for check to be sure CD will reach us.
3636
// We are inside a promise here so no need for setTimeout - CD should trigger
3737
// after the promise.
38-
log("DetachedLoader.loadInLocation component loaded -> markForCheck");
38+
log('DetachedLoader.loadInLocation component loaded -> markForCheck');
3939

4040
return Promise.resolve(componentRef);
4141
}
@@ -46,7 +46,7 @@ export class DetachedLoader { // tslint:disable-line:component-class-suffix
4646

4747
// TODO: change this API -- async promises not needed here anymore.
4848
public loadComponent(componentType: Type<any>): Promise<ComponentRef<any>> {
49-
log("DetachedLoader.loadComponent");
49+
log('DetachedLoader.loadComponent');
5050
return this.loadInLocation(componentType);
5151
}
5252

nativescript-angular/directives/action-bar.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { Directive, Component, ElementRef, Optional, OnDestroy } from "@angular/core";
1+
import { Directive, Component, ElementRef, Optional, OnDestroy } from '@angular/core';
22
import {
33
ActionBar,
44
ActionItem,
55
ActionItems,
66
NavigationButton,
7-
} from "@nativescript/core/ui/action-bar";
8-
import { Page } from "@nativescript/core/ui/page";
7+
} from '@nativescript/core/ui/action-bar';
8+
import { Page } from '@nativescript/core/ui/page';
99

10-
import { isBlank } from "../lang-facade";
10+
import { isBlank } from '../lang-facade';
1111
import {
1212
NgView,
1313
ViewClassMeta,
1414
ViewExtensions,
1515
isInvisibleNode,
1616
isView,
1717
registerElement,
18-
} from "../element-registry";
18+
} from '../element-registry';
1919

2020
export function isActionItem(view: any): view is ActionItem {
2121
return view instanceof ActionItem;
@@ -82,18 +82,18 @@ const appendActionItem = (bar: NgActionBar, item: ActionItem) => {
8282
bar.actionItems.addItem(item);
8383
};
8484

85-
registerElement("ActionBar", () => ActionBar, actionBarMeta);
86-
registerElement("ActionItem", () => <any>ActionItem);
87-
registerElement("NavigationButton", () => <any>NavigationButton);
85+
registerElement('ActionBar', () => ActionBar, actionBarMeta);
86+
registerElement('ActionItem', () => <any>ActionItem);
87+
registerElement('NavigationButton', () => <any>NavigationButton);
8888

8989
@Component({
90-
selector: "ActionBar",
91-
template: "<ng-content></ng-content>"
90+
selector: 'ActionBar',
91+
template: '<ng-content></ng-content>'
9292
})
9393
export class ActionBarComponent {
9494
constructor(public element: ElementRef, private page: Page) {
9595
if (!this.page) {
96-
throw new Error("Inside ActionBarComponent but no Page found in DI.");
96+
throw new Error('Inside ActionBarComponent but no Page found in DI.');
9797
}
9898

9999
if (isBlank(this.page.actionBarHidden)) {
@@ -105,13 +105,13 @@ export class ActionBarComponent {
105105
}
106106

107107
@Component({
108-
selector: "ActionBarExtension",
109-
template: ""
108+
selector: 'ActionBarExtension',
109+
template: ''
110110
})
111111
export class ActionBarScope { // tslint:disable-line:component-class-suffix
112112
constructor(private page: Page) {
113113
if (!this.page) {
114-
throw new Error("Inside ActionBarScope but no Page found in DI.");
114+
throw new Error('Inside ActionBarScope but no Page found in DI.');
115115
}
116116
}
117117

@@ -138,7 +138,7 @@ export class ActionBarScope { // tslint:disable-line:component-class-suffix
138138
}
139139

140140
@Directive({
141-
selector: "ActionItem" // tslint:disable-line:directive-selector
141+
selector: 'ActionItem' // tslint:disable-line:directive-selector
142142
})
143143
export class ActionItemDirective implements OnDestroy {
144144
constructor(public element: ElementRef, @Optional() private ownerScope: ActionBarScope) {
@@ -155,7 +155,7 @@ export class ActionItemDirective implements OnDestroy {
155155
}
156156

157157
@Directive({
158-
selector: "NavigationButton" // tslint:disable-line:directive-selector
158+
selector: 'NavigationButton' // tslint:disable-line:directive-selector
159159
})
160160
export class NavigationButtonDirective implements OnDestroy {
161161
constructor(public element: ElementRef, @Optional() private ownerScope: ActionBarScope) {

0 commit comments

Comments
 (0)