From 5c8db1bd6e84b5b87bba1bde517c1b22c3f03b2c Mon Sep 17 00:00:00 2001 From: cipchk Date: Mon, 14 May 2018 01:03:05 +0800 Subject: [PATCH] releases: 1.0.1-beta.2 - fix lint - fix @delon/abc dependencie angular5 --- docs/changelog-v6.md | 4 ++-- docs/changelog.md | 4 +++- package.json | 3 +-- .../error-collect/error-collect.component.ts | 2 +- .../footer-toolbar/footer-toolbar.component.ts | 6 ++++-- .../abc/full-content/full-content.component.ts | 2 +- packages/abc/package.json | 2 +- packages/abc/reuse-tab/reuse-tab.component.ts | 2 +- .../abc/simple-table/simple-table.component.ts | 3 +-- packages/auth/social/social.service.ts | 2 +- packages/form/src/model/form.property.ts | 17 ++++++++--------- packages/theme/services/http/http.client.ts | 6 +++--- .../theme/services/scroll/scroll.service.ts | 2 +- packages/theme/services/title/title.service.ts | 3 ++- packages/util/src/lazy/lazy.service.ts | 2 +- scaffold | 2 +- site.sh | 4 ++-- tslint.json | 1 - 18 files changed, 34 insertions(+), 33 deletions(-) diff --git a/docs/changelog-v6.md b/docs/changelog-v6.md index 91c05826e8..1b9dc59095 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 be19c5d677..abad935b78 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 692e076b29..cb1f2b7d41 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 76990f4973..ba41527405 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 da3418cfd9..bbc4c8ccaf 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 d4dd3e8377..b819a5d646 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 a897eacd23..1a60e18646 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 f4eb01afca..6939507834 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 240ad7140c..8353918b9c 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 9d4d66adec..b3ed87e858 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 a7fd644d86..d2971093e2 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 dcf902061d..0b22831eaa 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 a1a901ad80..9d60c6b68f 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 f0bbd1a7a5..7d9123cd48 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 28b8efae83..612026b18c 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 d71ed002ff..12fdf07506 160000 --- a/scaffold +++ b/scaffold @@ -1 +1 @@ -Subproject commit d71ed002ff6e7f990ca7ca2c6d64a023bc0b870b +Subproject commit 12fdf07506c42a397c01fecdf5dac0a1388bfc37 diff --git a/site.sh b/site.sh index b4c2e5120b..c3832a81bc 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 60d3a00d00..06af136d74 100644 --- a/tslint.json +++ b/tslint.json @@ -80,7 +80,6 @@ "whitespace": [ true, "check-branch", - "check-decl", "check-operator", "check-separator", "check-type"