diff --git a/docs/changelog-v6.md b/docs/changelog-v6.md index 91c05826e..1b9dc5909 100644 --- a/docs/changelog-v6.md +++ b/docs/changelog-v6.md @@ -14,8 +14,8 @@ Angular6(后面简称:v6)受限于 Angular Cli 的 BUG,需要额外的 - 在你升级之前请先 **务必** 再三确认引用的第三方类库是否已经支持 v6,再考虑升级。 - `@delon/cli` 不支持 v6,后续会有 `ng add` 支持 - v6 相关变更分为两个 Commit,可以根据他们了解具体的变更内容 - - 主要结构:[7927d4](https://github.com/cipchk/ng-alain/commit/6713c4) - - 示例页:[47a458](https://github.com/cipchk/ng-alain/commit/47a458) + - 主要结构:[7927d4](https://github.com/cipchk/ng-alain/commit/7927d48395755ecde8d0c4255be63011aef74d8c) + - 示例页:[47a458](https://github.com/cipchk/ng-alain/commit/47a458bc974d05c83b3d07b59caae848884b2fdf) ## 移除的部分 diff --git a/docs/changelog.md b/docs/changelog.md index be19c5d67..abad935b7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,12 +6,14 @@ title: type: Other --- -### 1.0.1-beta.1@next +### 1.0.1-beta.2@next `2018-5-14` - 支持 Angular6,见[升级指引](/docs/changelog-v6) +> invalid `1.0.1-beta.1@next` + ### 1.0.0-beta.10@next `2018-5-11` diff --git a/package.json b/package.json index 692e076b2..cb1f2b7d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "delon", - "version": "1.0.1-beta.1", + "version": "1.0.1-beta.2", "typings": "index.d.ts", "description": "Delon is a set of essential modules for ng-alain.", "repository": { @@ -93,7 +93,6 @@ "@types/jszip": "^3.1.3", "@types/mockjs": "^1.0.0", "@types/node": "~8.9.4", - "@types/ajv": "^1.0.0", "codecov": "^3.0.2", "codelyzer": "~4.2.1", "domhandler": "^2.4.2", diff --git a/packages/abc/error-collect/error-collect.component.ts b/packages/abc/error-collect/error-collect.component.ts index 76990f497..ba4152740 100644 --- a/packages/abc/error-collect/error-collect.component.ts +++ b/packages/abc/error-collect/error-collect.component.ts @@ -13,7 +13,7 @@ import { ChangeDetectorRef, } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { DOCUMENT } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { coerceNumberProperty } from '@angular/cdk/coercion'; import { AdErrorCollectConfig } from './error-collect.config'; diff --git a/packages/abc/footer-toolbar/footer-toolbar.component.ts b/packages/abc/footer-toolbar/footer-toolbar.component.ts index da3418cfd..bbc4c8cca 100644 --- a/packages/abc/footer-toolbar/footer-toolbar.component.ts +++ b/packages/abc/footer-toolbar/footer-toolbar.component.ts @@ -6,9 +6,11 @@ import { Inject, TemplateRef, ContentChild, + ElementRef, + Renderer2, + HostBinding, } from '@angular/core'; -import { ElementRef, Renderer2, HostBinding } from '@angular/core'; -import { DOCUMENT } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; const CLS = 'ad-footer-toolbar'; diff --git a/packages/abc/full-content/full-content.component.ts b/packages/abc/full-content/full-content.component.ts index d4dd3e837..b819a5d64 100644 --- a/packages/abc/full-content/full-content.component.ts +++ b/packages/abc/full-content/full-content.component.ts @@ -15,11 +15,11 @@ import { OnDestroy, AfterViewInit, } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; import { coerceBooleanProperty, coerceNumberProperty, } from '@angular/cdk/coercion'; -import { DOCUMENT } from '@angular/platform-browser'; import { Subscription, fromEvent } from 'rxjs'; import { debounceTime, filter, distinct } from 'rxjs/operators'; import { FullContentService } from './full-content.service'; diff --git a/packages/abc/package.json b/packages/abc/package.json index a897eacd2..1a60e1864 100644 --- a/packages/abc/package.json +++ b/packages/abc/package.json @@ -18,7 +18,7 @@ "keywords": ["delon", "ng-alain", "alain", "antd", "ng-zorro-antd"], "dependencies": { "file-saver": "^1.3.3", - "ngx-countdown": "^2.1.0", + "ngx-countdown": "^3.0.0", "qrious": "^4.0.2" }, "peerDependencies": { diff --git a/packages/abc/reuse-tab/reuse-tab.component.ts b/packages/abc/reuse-tab/reuse-tab.component.ts index f4eb01afc..693950783 100644 --- a/packages/abc/reuse-tab/reuse-tab.component.ts +++ b/packages/abc/reuse-tab/reuse-tab.component.ts @@ -16,7 +16,7 @@ import { Optional, } from '@angular/core'; import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; -import { DOCUMENT } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { Subscription, combineLatest } from 'rxjs'; import { filter } from 'rxjs/operators'; import { diff --git a/packages/abc/simple-table/simple-table.component.ts b/packages/abc/simple-table/simple-table.component.ts index 240ad7140..8353918b9 100644 --- a/packages/abc/simple-table/simple-table.component.ts +++ b/packages/abc/simple-table/simple-table.component.ts @@ -18,9 +18,8 @@ import { ContentChild, Optional, } from '@angular/core'; -import { DecimalPipe } from '@angular/common'; +import { DecimalPipe, DOCUMENT } from '@angular/common'; import { HttpClient } from '@angular/common/http'; -import { DOCUMENT } from '@angular/platform-browser'; import { ACLService } from '@delon/acl'; import { Observable, Subscription, of } from 'rxjs'; import { tap, map, filter } from 'rxjs/operators'; diff --git a/packages/auth/social/social.service.ts b/packages/auth/social/social.service.ts index 9d4d66ade..b3ed87e85 100644 --- a/packages/auth/social/social.service.ts +++ b/packages/auth/social/social.service.ts @@ -1,6 +1,6 @@ import { Injectable, Inject, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; -import { DOCUMENT } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { Observer, Observable } from 'rxjs'; import { diff --git a/packages/form/src/model/form.property.ts b/packages/form/src/model/form.property.ts index a7fd644d8..d2971093e 100644 --- a/packages/form/src/model/form.property.ts +++ b/packages/form/src/model/form.property.ts @@ -300,7 +300,7 @@ export abstract class FormProperty { if (typeof visibleIf === 'object' && Object.keys(visibleIf).length === 0) { this.setVisible(false); } else if (visibleIf !== undefined) { - const propertiesBinding = []; + const propertiesBinding: Observable[] = []; for (const dependencyPath in visibleIf) { if (visibleIf.hasOwnProperty(dependencyPath)) { const property = this.searchProperty(dependencyPath); @@ -318,9 +318,8 @@ export abstract class FormProperty { ); const visibilityCheck = property._visibilityChanges; const and = combineLatest( - [valueCheck, visibilityCheck], - (v1: boolean, v2: boolean) => v1 && v2, - ); + valueCheck, visibilityCheck + ).pipe(map(results => results[0] && results[1])); propertiesBinding.push(and); } else { console.warn( @@ -332,11 +331,11 @@ export abstract class FormProperty { } } - combineLatest( - propertiesBinding, - (...values: boolean[]) => values.indexOf(true) !== -1, - ) - .pipe(distinctUntilChanged()) + combineLatest(propertiesBinding) + .pipe( + map(values => values.indexOf(true) !== -1), + distinctUntilChanged() + ) .subscribe(visible => this.setVisible(visible)); } } diff --git a/packages/theme/services/http/http.client.ts b/packages/theme/services/http/http.client.ts index dcf902061..0b22831ea 100644 --- a/packages/theme/services/http/http.client.ts +++ b/packages/theme/services/http/http.client.ts @@ -7,7 +7,7 @@ import { HttpEvent, HttpRequest, } from '@angular/common/http'; -import { Observable } from 'rxjs'; +import { Observable, throwError } from 'rxjs'; import { tap, catchError } from 'rxjs/operators'; import * as parse from 'date-fns/parse'; @@ -358,7 +358,7 @@ export class _HttpClient { }), catchError(res => { this.end(); - return Observable.throw(res); + return throwError(res); }), ); } @@ -463,7 +463,7 @@ export class _HttpClient { }), catchError(res => { this.end(); - return Observable.throw(res); + return throwError(res); }), ); } diff --git a/packages/theme/services/scroll/scroll.service.ts b/packages/theme/services/scroll/scroll.service.ts index a1a901ad8..9d60c6b68 100644 --- a/packages/theme/services/scroll/scroll.service.ts +++ b/packages/theme/services/scroll/scroll.service.ts @@ -1,5 +1,5 @@ import { Injectable, Inject } from '@angular/core'; -import { DOCUMENT } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { WINDOW } from '../../win_tokens'; @Injectable() diff --git a/packages/theme/services/title/title.service.ts b/packages/theme/services/title/title.service.ts index f0bbd1a7a..7d9123cd4 100644 --- a/packages/theme/services/title/title.service.ts +++ b/packages/theme/services/title/title.service.ts @@ -6,7 +6,8 @@ import { OnDestroy, } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { Title, DOCUMENT } from '@angular/platform-browser'; +import { Title } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { Subscription } from 'rxjs'; import { MenuService } from '../menu/menu.service'; diff --git a/packages/util/src/lazy/lazy.service.ts b/packages/util/src/lazy/lazy.service.ts index 28b8efae8..612026b18 100644 --- a/packages/util/src/lazy/lazy.service.ts +++ b/packages/util/src/lazy/lazy.service.ts @@ -1,5 +1,5 @@ import { Injectable, Inject } from '@angular/core'; -import { DOCUMENT } from '@angular/platform-browser'; +import { DOCUMENT } from '@angular/common'; import { Observable, BehaviorSubject } from 'rxjs'; import { share, filter } from 'rxjs/operators'; diff --git a/scaffold b/scaffold index d71ed002f..12fdf0750 160000 --- a/scaffold +++ b/scaffold @@ -1 +1 @@ -Subproject commit d71ed002ff6e7f990ca7ca2c6d64a023bc0b870b +Subproject commit 12fdf07506c42a397c01fecdf5dac0a1388bfc37 diff --git a/site.sh b/site.sh index b4c2e5120..c3832a81b 100644 --- a/site.sh +++ b/site.sh @@ -38,9 +38,9 @@ if [[ ${BUILD} == true ]]; then rm -rf .tmp echo 'build...' - $(npm bin)/ng build --app site --prod --build-optimizer --base-href / + $(npm bin)/ng build site --prod --build-optimizer --base-href / # github pages - # $(npm bin)/ng build --app site --prod --build-optimizer --base-href /delon/ + # $(npm bin)/ng build site --prod --build-optimizer --base-href /delon/ fi if [[ ${DEPLOY} == true ]]; then diff --git a/tslint.json b/tslint.json index 60d3a00d0..06af136d7 100644 --- a/tslint.json +++ b/tslint.json @@ -80,7 +80,6 @@ "whitespace": [ true, "check-branch", - "check-decl", "check-operator", "check-separator", "check-type"