Skip to content

Commit 86a3652

Browse files
committed
chore: cleanup
1 parent 4cff0e8 commit 86a3652

Some content is hidden

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

51 files changed

+660
-673
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
# [9.0.0](https://github.com/NativeScript/nativescript-angular/compare/8.20.4...9.0.0) (2020-06-03)
33

44

5+
6+
### Bug Fixes
7+
8+
* **bindable:** parent referenced expression-values now load properly using an update call ([#8670](https://github.com/NativeScript/NativeScript/issues/8670)) ([6b0028a](https://github.com/NativeScript/NativeScript/commit/6b0028afd7b554914b039cdf371e8e30f6e02dac)), closes [#8666](https://github.com/NativeScript/NativeScript/issues/8666) [#6981](https://github.com/NativeScript/NativeScript/issues/6981) [#5054](https://github.com/NativeScript/NativeScript/issues/5054)
9+
* **scroll-view:** android 'isScrollEnabled' will apply if changed while gesture is underway ([#8695](https://github.com/NativeScript/NativeScript/issues/8695)) ([02ec7f1](https://github.com/NativeScript/NativeScript/commit/02ec7f104d327df53df687ddd1b8ac5b1cdc04ba))
10+
* **snapshots:** android is not defined ([#8691](https://github.com/NativeScript/NativeScript/issues/8691)) ([a8bbd7c](https://github.com/NativeScript/NativeScript/commit/a8bbd7c1e580e77e7ad5ddc7be6845e3d8fb02de))
11+
* **text-view:** only reload text if hint is showing on ios ([#8662](https://github.com/NativeScript/NativeScript/issues/8662)) ([ec17727](https://github.com/NativeScript/NativeScript/commit/ec17727e91f7a3209ada2c7de0bcf59c98c4e62a))
12+
13+
14+
### Features
15+
16+
* **connectivity:** getActiveNetworkInfo and NetworkInfo modern compliance [#8580](https://github.com/NativeScript/NativeScript/issues/8580) ([#8652](https://github.com/NativeScript/NativeScript/issues/8652)) ([635f31f](https://github.com/NativeScript/NativeScript/commit/635f31f81f7826112142c707aff2a66c2b480b0e))
17+
* **dialog:** ios destructive style from options ([#8676](https://github.com/NativeScript/NativeScript/issues/8676)) ([bb531ce](https://github.com/NativeScript/NativeScript/commit/bb531ce71028f9c4fd4d753df16c82104f158e35))
18+
* **ImageSource:** resize method ([#8678](https://github.com/NativeScript/NativeScript/issues/8678)) ([bd12baf](https://github.com/NativeScript/NativeScript/commit/bd12bafb4aae8f1c523be4c7e04fa73722092304))
19+
* **text-view:** allow easy subclassing on ios ([#8663](https://github.com/NativeScript/NativeScript/issues/8663)) ([7d36447](https://github.com/NativeScript/NativeScript/commit/7d364474c23e17acf7696f159d3945d8a73d63e6))
20+
21+
522
### Features
623

724
* angular 9 ivy ([fbe2450](https://github.com/NativeScript/nativescript-angular/commit/fbe2450))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.btn-primary {
2+
background-color: pink;
3+
}

e2e/animation-examples/app/animation-builder.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { Component, ViewChild } from '@angular/core';
44
@Component({
55
template: `
66
<Button #button (tap)="makeAnimation()" class="btn btn-primary" automationText="tapToDisappear" text="Tap to disappear!"></Button>
7-
`
7+
`,
8+
styleUrls: ['./animation-builder.component.scss']
89
})
910
export class AnimationBuilderComponent {
1011
@ViewChild('button', { static: false }) button;

e2e/animation-examples/app/main.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
import { platformNativeScript, NativeScriptDebug } from "@nativescript/angular";
2-
import { setCategories, enable } from "@nativescript/core/trace";
3-
import {
4-
GridLayout,
5-
ItemSpec,
6-
GridUnitType,
7-
} from '@nativescript/core/ui/layouts/grid-layout';
8-
import {
9-
HorizontalAlignment,
10-
VerticalAlignment,
11-
} from '@nativescript/core/ui/enums/enums';
2+
import { Trace, GridLayout, GridUnitType, ItemSpec, VerticalAlignment } from "@nativescript/core";
123

134
import { AppModule } from "./app.module";
145

15-
setCategories(NativeScriptDebug.animationsTraceCategory);
16-
enable();
6+
Trace.setCategories(NativeScriptDebug.animationsTraceCategory);
7+
Trace.enable();
178

189
class LaunchAnimation extends GridLayout {
1910
circle: GridLayout;
@@ -34,8 +25,8 @@ class LaunchAnimation extends GridLayout {
3425
this.circle.width = 30;
3526
this.circle.height = 30;
3627
this.circle.borderRadius = 15;
37-
this.circle.horizontalAlignment = HorizontalAlignment.center;
38-
this.circle.verticalAlignment = VerticalAlignment.center;
28+
this.circle.horizontalAlignment = 'center';
29+
this.circle.verticalAlignment = 'middle';
3930
this.circle.backgroundColor = '#fff';
4031
this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.STAR));
4132
this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.AUTO));

e2e/animation-examples/ngcc.config.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

e2e/animation-examples/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"nativescript-theme-core": "~1.0.2",
2626
"reflect-metadata": "~0.1.8",
2727
"rxjs": "~6.5.5",
28-
"@nativescript/core": "~6.5.8",
28+
"@nativescript/core": "~7.0.0-rc.9",
2929
"zone.js": "^0.10.3"
3030
},
3131
"devDependencies": {
@@ -41,13 +41,16 @@
4141
"lazy": "~1.0.11",
4242
"mocha": "~8.0.1",
4343
"mochawesome": "~6.1.1",
44+
"node-sass": "~4.14.1",
4445
"nativescript-css-loader": "~0.26.0",
45-
"@nativescript/webpack": "~2.0.0-alpha.2",
46+
"@nativescript/webpack": "~2.0.0-alpha.3",
4647
"typescript": "~3.9.0"
4748
},
4849
"scripts": {
4950
"clean": "npx rimraf hooks node_modules platforms package-lock.json",
5051
"setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/animation-examples && npm run clean",
52+
"ngcc": "ngcc --properties es2015 module main --first-only",
53+
"postinstall": "npm run ngcc",
5154
"u": "update-ns-webpack",
5255
"e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json",
5356
"e2e-watch": "tsc -p e2e --watch",

e2e/animation-examples/tsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "es5",
3+
"module": "ESNext",
4+
"target": "es2015",
55
"experimentalDecorators": true,
66
"emitDecoratorMetadata": true,
77
"noEmitHelpers": true,
@@ -16,9 +16,6 @@
1616
"paths": {
1717
"~/*": [
1818
"app/*"
19-
],
20-
"*": [
21-
"./node_modules/*"
2219
]
2320
}
2421
},

e2e/modal-navigation-ng/app/home/home.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { ModalViewComponent } from "../modal-shared/modal-view.component";
99
import { confirm } from "@nativescript/core/ui/dialogs";
1010

1111
import { AppModule } from "../app.module";
12-
import { PageService } from "@nativescript/angular";
1312

1413
@Component({
1514
moduleId: module.id,
@@ -21,9 +20,8 @@ export class HomeComponent {
2120
private modal: ModalDialogService,
2221
private vcRef: ViewContainerRef,
2322
private viewContainerRefService: ViewContainerRefService,
24-
private pageService: PageService,
2523
private routerExtension: RouterExtensions) {
26-
this.pageService.inPage$.subscribe((inPage) => console.log("HomeComponent - inPage", inPage));
24+
2725
}
2826

2927
onNavigateSecond() {

nativescript-angular/animations/animation-driver.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { AnimationPlayer } from '@angular/animations';
22
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';
3+
import { ProxyViewContainer, eachDescendant, CssAnimationProperty, CSSHelper } from '@nativescript/core';
74

85
import { NativeScriptAnimationPlayer } from './animation-player';
96
import {
@@ -32,7 +29,7 @@ interface QueryResult {
3229
}
3330

3431
class Selector {
35-
private nsSelectors: SelectorCore[];
32+
private nsSelectors: CSSHelper.SelectorCore[];
3633
private classSelectors: string[];
3734

3835
constructor(rawSelector: string) {
@@ -46,7 +43,7 @@ class Selector {
4643
private parse(rawSelector: string) {
4744
const selectors = rawSelector.split(',').map(s => s.trim());
4845

49-
this.nsSelectors = selectors.map(createSelector);
46+
this.nsSelectors = selectors.map(CSSHelper.createSelector);
5047
this.classSelectors = selectors
5148
.filter(s => s.startsWith('.'))
5249
.map(s => s.substring(1));

nativescript-angular/animations/animation-player.ts

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

64
import { Keyframe, createKeyframeAnimation } from './utils';
75
import { NgView } from '../element-registry';

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+
parseKeyframeDeclarations,
7+
animationTimingFunctionConverter
8+
} from '@nativescript/core';
99

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

nativescript-angular/app-host-view.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
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, View, ProxyViewContainer, GridLayout } from '@nativescript/core';
52

63
export class AppHostView extends ContentView {
74

@@ -28,7 +25,7 @@ export class AppHostView extends ContentView {
2825
this._content = value;
2926

3027
if (value) {
31-
this._content.parentNode = this;
28+
this._content.parentNode = <any>this;
3229
}
3330

3431
this.ngAppRoot = value;

nativescript-angular/common/detached-loader.ts

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

77
export const CATEGORY = 'detached-loader';
88
function log(message: string) {
9-
write(message, CATEGORY);
9+
Trace.write(message, CATEGORY);
1010
}
1111

1212

nativescript-angular/directives/action-bar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {
44
ActionItem,
55
ActionItems,
66
NavigationButton,
7-
} from '@nativescript/core/ui/action-bar';
8-
import { Page } from '@nativescript/core/ui/page';
7+
Page,
8+
} from '@nativescript/core';
99

1010
import { isBlank } from '../lang-facade';
1111
import {

nativescript-angular/directives/dialogs.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ import {
77
Type,
88
ViewContainerRef
99
} from '@angular/core';
10+
import { Frame, View, ViewBase, ProxyViewContainer, ShowModalOptions } from '@nativescript/core';
1011

1112
import { NSLocationStrategy } from '../router/ns-location-strategy';
12-
import { View, ViewBase } from '@nativescript/core/ui/core/view';
13-
import { ProxyViewContainer } from '@nativescript/core/ui/proxy-view-container/proxy-view-container';
14-
1513
import { AppHostView } from '../app-host-view';
1614
import { DetachedLoader } from '../common/detached-loader';
1715
import { PageFactory, PAGE_FACTORY } from '../platform-providers';
1816
import { once } from '../common/utils';
19-
import { Frame } from '@nativescript/core/ui/frame';
20-
import { ShowModalOptions } from '@nativescript/core/ui/core/view';
2117

2218
export type BaseShowModalOptions = Pick<ShowModalOptions, Exclude<keyof ShowModalOptions, 'closeCallback' | 'context'>>;
2319

nativescript-angular/directives/list-view-comp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
IterableDiffers,
66
forwardRef
77
} from '@angular/core';
8-
import { ListView } from '@nativescript/core/ui/list-view';
8+
import { ListView } from '@nativescript/core';
99
import { TEMPLATED_ITEMS_COMPONENT, TemplatedItemsComponent } from './templated-items-comp';
1010

1111
@Component({

nativescript-angular/directives/platform-filters.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Inject } from '@angular/core';
2-
import { Device, platformNames } from '@nativescript/core/platform';
2+
import { IDevice, platformNames } from '@nativescript/core';
33
import { DEVICE } from '../platform-providers';
44

55
@Component({
@@ -8,7 +8,7 @@ import { DEVICE } from '../platform-providers';
88
})
99
export class AndroidFilterComponent {
1010
public show: boolean;
11-
constructor( @Inject(DEVICE) device: Device) {
11+
constructor( @Inject(DEVICE) device: IDevice) {
1212
this.show = (device.os === platformNames.android);
1313
}
1414
}
@@ -19,7 +19,7 @@ export class AndroidFilterComponent {
1919
})
2020
export class IosFilterComponent {
2121
public show: boolean;
22-
constructor( @Inject(DEVICE) device: Device) {
22+
constructor( @Inject(DEVICE) device: IDevice) {
2323
this.show = (device.os === platformNames.ios);
2424
}
2525
}

nativescript-angular/directives/tab-view.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import {
77
TemplateRef,
88
ViewContainerRef,
99
} from '@angular/core';
10-
import { TabView, TabViewItem } from '@nativescript/core/ui/tab-view';
11-
import { TextTransform } from '@nativescript/core/ui/text-base';
10+
import { TabView, TabViewItem } from '@nativescript/core';
1211

1312
import { InvisibleNode } from '../element-registry';
1413
import { NativeScriptDebug } from '../trace';
1514
import { isBlank } from '../lang-facade';
1615

16+
type TextTransform = 'initial' | 'none' | 'capitalize' | 'uppercase' | 'lowercase';
1717
export interface TabViewItemDef {
1818
title?: string;
1919
iconSource?: string;

nativescript-angular/directives/templated-items-comp.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@ import {
2020
ɵisListLikeIterable as isListLikeIterable,
2121
Injectable
2222
} from '@angular/core';
23-
// tslint:disable: max-line-length
24-
// TODO: refactor core module imports to allow this to work properly
25-
// import { View, LayoutBase, KeyedTemplate, ItemEventData, TemplatedItemsView, ObservableArray } from "@nativescript/core";
26-
// Ivy entry points get out of order and will cause issues like this:
27-
// node_modules/@nativescript/core/ui/html-view/html-view-common.js:26:0: JS ERROR TypeError: undefined is not an object (evaluating 'color_1.Color.equals') if not using deep imports like the following for the moment
28-
// tslint:enable: max-line-length
29-
import { ItemEventData, TemplatedItemsView } from '@nativescript/core/ui/list-view';
30-
import { View, KeyedTemplate } from '@nativescript/core/ui/core/view';
31-
import { LayoutBase } from '@nativescript/core/ui/layouts/layout-base';
32-
import { ObservableArray } from '@nativescript/core/data/observable-array';
33-
import { profile } from '@nativescript/core/profiling';
23+
import { ObservableArray, View, KeyedTemplate, LayoutBase, ItemEventData, TemplatedItemsView, profile } from '@nativescript/core';
3424

3525
import { getSingleViewRecursive } from '../element-registry';
3626
import { NativeScriptDebug } from '../trace';

0 commit comments

Comments
 (0)