From 966faa2cd60a02a1ff3bc43307bca2ae2eafa0b6 Mon Sep 17 00:00:00 2001 From: cipchk Date: Fri, 21 Jul 2023 15:05:13 +0800 Subject: [PATCH 1/4] chore: bump angular to 16.1.x --- package.json | 92 ++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 7be0dffb9..d195ef434 100644 --- a/package.json +++ b/package.json @@ -57,61 +57,61 @@ "ssr:prerender": "npm run ng-high-memory run site:prerender" }, "dependencies": { - "@angular/animations": "^16.0.3", - "@angular/common": "^16.0.3", - "@angular/compiler": "^16.0.3", - "@angular/core": "^16.0.3", - "@angular/forms": "^16.0.3", - "@angular/platform-browser": "^16.0.3", - "@angular/platform-browser-dynamic": "^16.0.3", - "@angular/router": "^16.0.3", + "@angular/animations": "^16.1.0", + "@angular/common": "^16.1.0", + "@angular/compiler": "^16.1.0", + "@angular/core": "^16.1.0", + "@angular/forms": "^16.1.0", + "@angular/platform-browser": "^16.1.0", + "@angular/platform-browser-dynamic": "^16.1.0", + "@angular/router": "^16.1.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.13.0", - "@angular/service-worker": "^16.0.3", - "@angular/platform-server": "^16.0.3", - "@angular/elements": "^16.0.3", + "@angular/service-worker": "^16.1.0", + "@angular/platform-server": "^16.1.0", + "@angular/elements": "^16.1.0", "@antv/data-set": "^0.11.8", "@antv/g2": "^4.2.10", - "echarts": "^5.4.2", + "echarts": "^5.4.3", "@stackblitz/sdk": "^1.9.0", "codesandbox": "^2.2.3", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", "extend": "^3.0.2", "file-saver": "^2.0.5", - "ng-github-button": "^15.0.0", + "ng-github-button": "^16.0.0", "ng-zorro-antd": "^16.1.0", "ngx-color": "~9.0.0", - "ngx-countdown": "^15.0.0", - "ngx-highlight-js": "^15.0.0", - "ngx-tinymce": "^15.0.0", + "ngx-countdown": "^16.0.0", + "ngx-highlight-js": "^16.0.0", + "ngx-tinymce": "^16.0.0", "qrious": "^4.0.2", "@webcomponents/custom-elements": "^1.6.0", "aos": "^3.0.0-beta.6", - "@ng-util/monaco-editor": "^15.0.0", - "@nguniversal/express-engine": "~16.0.2", + "@ng-util/monaco-editor": "^16.0.0", + "@nguniversal/express-engine": "^16.1.0", "express": "^4.18.2", "isutf8": "^4.0.0", "@github/hotkey": "^2.0.1" }, "devDependencies": { - "@angular-devkit/build-angular": "^16.0.3", - "@angular/cli": "~16.0.3", - "@angular/compiler-cli": "^16.0.3", + "@angular-devkit/build-angular": "^16.1.5", + "@angular/cli": "~16.1.5", + "@angular/compiler-cli": "^16.1.0", "@types/jasmine": "~4.3.0", "jasmine-core": "~4.6.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", - "karma-jasmine-html-reporter": "~2.0.0", - "typescript": "~5.0.4", + "karma-jasmine-html-reporter": "~2.1.0", + "typescript": "~5.1.3", "codelyzer": "^6.0.2", "jasmine-spec-reporter": "^7.0.0", "protractor": "~7.0.0", "ts-node": "~10.9.1", - "@angular/language-service": "^16.0.3", + "@angular/language-service": "^16.1.0", "@types/jasminewd2": "~2.0.10", "karma-junit-reporter": "^2.0.1", "karma-spec-reporter": "0.0.36", @@ -127,7 +127,7 @@ "karma-parallel": "^0.3.1", "chalk": "^4.1.0", "codecov": "^3.8.3", - "conventional-changelog-cli": "^2.2.2", + "conventional-changelog-cli": "^3.0.0", "fs-extra": "^9.0.0", "husky": "^7.0.4", "jsonml.js": "^0.1.0", @@ -138,14 +138,14 @@ "mark-twain": "^2.0.3", "mockjs": "^1.1.0", "mustache": "^4.2.0", - "ng-packagr": "^16.0.1", + "ng-packagr": "^16.1.0", "parse5": "^7.1.2", - "prettier": "^2.8.8", + "prettier": "^3.0.0", "readline-sync": "^1.4.10", "stream": "0.0.2", - "stylelint": "^15.6.2", + "stylelint": "^15.10.2", "stylelint-config-rational-order": "^0.1.2", - "stylelint-config-standard": "^33.0.0", + "stylelint-config-standard": "^34.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.7.0", "stylelint-order": "^6.0.3", "source-map-explorer": "^2.5.3", @@ -159,29 +159,29 @@ "ng-alain-sts": "^0.0.2", "ng-alain-plugin-theme": "^15.0.1", "tsconfig-paths": "^4.2.0", - "@nguniversal/builders": "^16.0.2", + "@nguniversal/builders": "^16.1.1", "@types/express": "^4.17.17", "html-minifier-terser": "^7.2.0", - "terser": "^5.17.6", - "@commitlint/cli": "^17.6.3", - "@commitlint/config-angular": "^17.6.3", - "@angular-eslint/builder": "~16.0.3", - "@angular-eslint/eslint-plugin": "~16.0.3", - "@angular-eslint/eslint-plugin-template": "~16.0.3", - "@angular-eslint/schematics": "~16.0.3", - "@angular-eslint/template-parser": "~16.0.3", - "@typescript-eslint/eslint-plugin": "~5.59.8", - "@typescript-eslint/parser": "~5.59.8", - "eslint": "^8.41.0", + "terser": "^5.19.1", + "@commitlint/cli": "^17.6.7", + "@commitlint/config-angular": "^17.6.7", + "@angular-eslint/builder": "~16.1.0", + "@angular-eslint/eslint-plugin": "~16.1.0", + "@angular-eslint/eslint-plugin-template": "~16.1.0", + "@angular-eslint/schematics": "~16.1.0", + "@angular-eslint/template-parser": "~16.1.0", + "@typescript-eslint/eslint-plugin": "~6.1.0", + "@typescript-eslint/parser": "~6.1.0", + "eslint": "^8.45.0", "eslint-config-prettier": "~8.8.0", - "eslint-plugin-import": "~2.25.3", - "eslint-plugin-jsdoc": "~45.0.0", + "eslint-plugin-import": "~2.27.5", + "eslint-plugin-jsdoc": "~46.4.4", "eslint-plugin-prefer-arrow": "~1.2.3", - "eslint-plugin-prettier": "~4.2.1", + "eslint-plugin-prettier": "~5.0.0", "eslint-plugin-deprecation": "~1.4.1", - "lint-staged": "^13.2.2", + "lint-staged": "^13.2.3", "raw-loader": "^4.0.2", - "swagger-typescript-api": "^12.0.4", + "swagger-typescript-api": "^13.0.0", "sitemap": "^7.1.1" }, "lint-staged": { From 7d4de01709efb60fc1ab327e96ea3662267b63ef Mon Sep 17 00:00:00 2001 From: cipchk Date: Fri, 21 Jul 2023 15:24:05 +0800 Subject: [PATCH 2/4] chore: fix code style --- package.json | 2 +- .../abc/auto-focus/auto-focus.directive.ts | 6 ++++- .../abc/avatar-list/avatar-list.component.ts | 5 +++- packages/abc/down-file/down-file.directive.ts | 5 +++- .../footer-toolbar.component.ts | 6 ++++- .../abc/footer-toolbar/footer-toolbar.spec.ts | 2 +- packages/abc/hotkey/hotkey.directive.ts | 6 ++++- packages/abc/hotkey/hotkey.spec.ts | 2 +- packages/abc/lodop/lodop.service.ts | 5 +++- packages/abc/media/media.service.ts | 5 +++- .../abc/notice-icon/notice-icon.component.ts | 5 +++- packages/abc/observers/observer-size.ts | 6 ++++- packages/abc/page-header/page-header.spec.ts | 2 +- packages/abc/qr/qr.spec.ts | 2 +- .../abc/quick-menu/quick-menu.component.ts | 6 ++++- .../abc/reuse-tab/reuse-tab.component.spec.ts | 2 +- packages/abc/reuse-tab/reuse-tab.component.ts | 2 +- packages/abc/st/st-row.directive.ts | 5 +++- packages/abc/st/st-widget-host.directive.ts | 5 +++- packages/abc/st/test/base.spec.ts | 6 +++-- packages/abc/st/test/st-expand.spec.ts | 2 +- packages/abc/st/test/st-filter.spec.ts | 2 +- packages/abc/st/test/st-sort.spec.ts | 2 +- packages/abc/st/test/st.spec.ts | 24 +++++++++---------- packages/abc/sv/sv-container.component.ts | 6 ++++- packages/acl/src/acl-guard.ts | 6 ++++- packages/acl/src/acl-if.directive.ts | 6 ++++- packages/acl/src/acl.directive.ts | 6 ++++- .../auth/src/social/social.service.spec.ts | 2 +- .../src/store/cookie-storage.service.spec.ts | 2 +- .../auth/src/store/cookie-storage.service.ts | 2 +- packages/auth/src/store/interface.ts | 2 +- .../src/store/local-storage.service.spec.ts | 2 +- .../auth/src/store/local-storage.service.ts | 2 +- .../auth/src/store/memory.service.spec.ts | 2 +- packages/auth/src/store/memory.service.ts | 2 +- .../src/store/session-storage.service.spec.ts | 2 +- .../auth/src/store/session-storage.service.ts | 2 +- .../auth/src/token/base.interceptor.spec.ts | 4 ++-- packages/auth/src/token/base.interceptor.ts | 9 ++++--- packages/auth/src/token/helper.spec.ts | 2 +- packages/auth/src/token/jwt/jwt.guard.spec.ts | 2 +- packages/auth/src/token/jwt/jwt.guard.ts | 7 ++++-- .../src/token/jwt/jwt.interceptor.spec.ts | 4 ++-- .../auth/src/token/jwt/jwt.interceptor.ts | 2 +- packages/auth/src/token/jwt/jwt.model.ts | 2 +- .../src/token/simple/simple.guard.spec.ts | 2 +- .../auth/src/token/simple/simple.guard.ts | 7 ++++-- .../token/simple/simple.interceptor.spec.ts | 4 ++-- .../src/token/simple/simple.interceptor.ts | 2 +- packages/auth/src/token/token.service.ts | 7 ++++-- .../chart/chart-echarts/echarts.service.ts | 5 +++- packages/chart/core/g2.servicce.ts | 5 +++- packages/chart/custom/custom.spec.ts | 2 +- .../mini-progress/mini-progress.component.ts | 5 +++- packages/form/spec/form.spec.ts | 2 +- packages/form/spec/schema.spec.ts | 2 +- packages/form/src/model/array.property.ts | 6 ++--- packages/form/src/model/atomic.property.ts | 2 +- packages/form/src/model/boolean.property.ts | 2 +- .../form/src/model/form.property.factory.ts | 17 +++++++------ packages/form/src/model/number.property.ts | 2 +- packages/form/src/model/object.property.ts | 4 ++-- packages/form/src/model/string.property.ts | 2 +- packages/form/src/sf-fixed.directive.ts | 5 +++- packages/form/src/sf-item.component.ts | 5 +++- packages/form/src/validator.factory.ts | 5 +++- .../src/widgets/array/array.widget.spec.ts | 2 +- .../autocomplete/autocomplete.widget.spec.ts | 4 ++-- .../autocomplete/autocomplete.widget.ts | 2 +- .../src/widgets/boolean/boolean.widget.ts | 2 +- .../widgets/cascader/cascader.widget.spec.ts | 2 +- .../src/widgets/cascader/cascader.widget.ts | 2 +- packages/form/src/widgets/cascader/schema.ts | 2 +- .../widgets/checkbox/checkbox.widget.spec.ts | 2 +- .../src/widgets/checkbox/checkbox.widget.ts | 2 +- .../form/src/widgets/custom/custom.widget.ts | 2 +- .../widgets/custom/sf-template.directive.ts | 5 +++- .../form/src/widgets/date/date.widget.spec.ts | 10 +++++--- packages/form/src/widgets/date/date.widget.ts | 2 +- .../widgets/mention/mention.widget.spec.ts | 2 +- .../src/widgets/mention/mention.widget.ts | 2 +- .../src/widgets/number/number.widget.spec.ts | 2 +- .../form/src/widgets/number/number.widget.ts | 2 +- .../form/src/widgets/nz-widget.registry.ts | 2 +- .../src/widgets/object/object.widget.spec.ts | 2 +- .../form/src/widgets/object/object.widget.ts | 2 +- .../form/src/widgets/radio/radio.widget.ts | 2 +- packages/form/src/widgets/rate/rate.widget.ts | 2 +- .../src/widgets/select/select.widget.spec.ts | 4 ++-- .../form/src/widgets/select/select.widget.ts | 2 +- .../src/widgets/slider/slider.widget.spec.ts | 2 +- .../form/src/widgets/slider/slider.widget.ts | 2 +- .../src/widgets/string/string.widget.spec.ts | 2 +- .../form/src/widgets/string/string.widget.ts | 2 +- packages/form/src/widgets/tag/tag.widget.ts | 2 +- .../form/src/widgets/text/text.widget.spec.ts | 2 +- packages/form/src/widgets/text/text.widget.ts | 2 +- .../widgets/textarea/textarea.widget.spec.ts | 2 +- .../src/widgets/textarea/textarea.widget.ts | 2 +- .../form/src/widgets/time/time.widget.spec.ts | 2 +- packages/form/src/widgets/time/time.widget.ts | 2 +- .../src/widgets/transfer/transfer.widget.ts | 2 +- .../widgets/tree-select/tree-select.widget.ts | 2 +- .../src/widgets/upload/upload.widget.spec.ts | 2 +- .../form/src/widgets/upload/upload.widget.ts | 2 +- packages/mock/src/mock.interceptor.ts | 5 +++- packages/mock/src/mock.service.spec.ts | 2 +- packages/mock/src/status.error.ts | 5 +++- .../layout-default/layout-header.component.ts | 6 ++++- .../layout-default/layout.component.spec.ts | 4 ++-- .../theme/src/pipes/date/date.pipe.spec.ts | 2 +- packages/theme/src/pipes/yn/yn.pipe.spec.ts | 4 ++-- .../theme/src/services/drawer/drawer.spec.ts | 2 +- .../theme/src/services/http/http.client.ts | 5 +++- packages/theme/src/services/i18n/i18n.spec.ts | 4 ++-- .../src/services/menu/menu.service.spec.ts | 2 +- .../theme/src/services/menu/menu.service.ts | 2 +- .../theme/src/services/modal/modal.helper.ts | 6 ++++- .../theme/src/services/modal/modal.spec.ts | 7 ++++-- .../src/services/rtl/rtl.service.spec.ts | 2 +- .../src/services/settings/settings.service.ts | 5 +++- .../src/services/settings/settings.spec.ts | 2 +- .../src/services/title/title.service.spec.ts | 2 +- packages/util/browser/cookie.service.ts | 5 +++- packages/util/browser/scroll.service.ts | 5 +++- packages/util/form/validate.spec.ts | 2 +- packages/util/math/in-range.spec.ts | 4 +++- packages/util/pipes/currency/cny.pipe.spec.ts | 2 +- .../util/pipes/currency/mega.pipe.spec.ts | 2 +- packages/util/pipes/currency/mega.pipe.ts | 5 +++- .../util/pipes/currency/price.pipe.spec.ts | 2 +- .../util/pipes/filter/filter.pipe.spec.ts | 2 +- packages/util/pipes/format/mask.pipe.spec.ts | 2 +- schematics/application/index.ts | 2 +- schematics/edit/index.ts | 2 +- schematics/empty/index.ts | 2 +- schematics/list/index.ts | 2 +- schematics/module/index.spec.ts | 2 +- schematics/module/index.ts | 2 +- schematics/ng-add/index.ts | 2 +- schematics/plugin/index.ts | 2 +- schematics/plugin/plugin.code-style.ts | 2 +- schematics/plugin/plugin.default-language.ts | 2 +- schematics/plugin/plugin.docker.ts | 2 +- schematics/plugin/plugin.icon.ts | 2 +- schematics/plugin/plugin.rtl.ts | 2 +- schematics/plugin/plugin.sts.ts | 2 +- schematics/sta/index.ts | 4 ++-- schematics/tpl/index.ts | 2 +- schematics/utils/alain.spec.ts | 2 +- schematics/view/index.ts | 2 +- scripts/site/utils/generate-demo.ts | 2 +- scripts/site/utils/generate-example.ts | 2 +- scripts/site/utils/generate-md.ts | 2 +- scripts/site/utils/parse-md.ts | 2 +- src/app/core/code/code.service.ts | 9 ++++--- src/app/core/meta.service.ts | 2 +- .../routes/form-pages/form-pages.module.ts | 2 +- src/app/routes/routes.module.ts | 4 ++-- .../components/content/content.component.ts | 6 ++++- .../edit-button/edit-button.component.ts | 5 +++- .../match-router/match-router.directive.ts | 6 ++++- src/app/shared/st-widget/st-widget.module.ts | 2 +- src/dev/dev.module.ts | 2 +- src/dev/lazy/lazy.module.ts | 2 +- src/dev/list/list.module.ts | 2 +- 167 files changed, 355 insertions(+), 208 deletions(-) diff --git a/package.json b/package.json index d195ef434..56b252f9b 100644 --- a/package.json +++ b/package.json @@ -181,7 +181,7 @@ "eslint-plugin-deprecation": "~1.4.1", "lint-staged": "^13.2.3", "raw-loader": "^4.0.2", - "swagger-typescript-api": "^13.0.0", + "swagger-typescript-api": "^12.0.4", "sitemap": "^7.1.1" }, "lint-staged": { diff --git a/packages/abc/auto-focus/auto-focus.directive.ts b/packages/abc/auto-focus/auto-focus.directive.ts index ca451dd9d..14b187774 100644 --- a/packages/abc/auto-focus/auto-focus.directive.ts +++ b/packages/abc/auto-focus/auto-focus.directive.ts @@ -16,7 +16,11 @@ export class AutoFocusDirective implements AfterViewInit, OnDestroy { @Input() @InputBoolean() enabled = true; @Input() @InputNumber() delay = 300; - constructor(private el: ElementRef, private cdr: ChangeDetectorRef, private platform: Platform) {} + constructor( + private el: ElementRef, + private cdr: ChangeDetectorRef, + private platform: Platform + ) {} ngAfterViewInit(): void { const el = this.el.nativeElement; diff --git a/packages/abc/avatar-list/avatar-list.component.ts b/packages/abc/avatar-list/avatar-list.component.ts index ca35933e7..d9d6b4a99 100644 --- a/packages/abc/avatar-list/avatar-list.component.ts +++ b/packages/abc/avatar-list/avatar-list.component.ts @@ -62,7 +62,10 @@ export class AvatarListComponent implements AfterViewInit, OnChanges, OnDestroy @Input() @InputNumber() maxLength = 0; @Input() excessItemsStyle: NgStyleInterface | null = null; - constructor(private cdr: ChangeDetectorRef, @Optional() private directionality: Directionality) {} + constructor( + private cdr: ChangeDetectorRef, + @Optional() private directionality: Directionality + ) {} private gen(): void { const { _items } = this; diff --git a/packages/abc/down-file/down-file.directive.ts b/packages/abc/down-file/down-file.directive.ts index 18e93cecd..91e540256 100644 --- a/packages/abc/down-file/down-file.directive.ts +++ b/packages/abc/down-file/down-file.directive.ts @@ -39,7 +39,10 @@ export class DownFileDirective { return arr.reduce((_o, item) => item, {}); } - constructor(private el: ElementRef, private _http: _HttpClient) { + constructor( + private el: ElementRef, + private _http: _HttpClient + ) { let isFileSaverSupported = false; try { isFileSaverSupported = !!new Blob(); diff --git a/packages/abc/footer-toolbar/footer-toolbar.component.ts b/packages/abc/footer-toolbar/footer-toolbar.component.ts index c266e4dcc..848a128eb 100644 --- a/packages/abc/footer-toolbar/footer-toolbar.component.ts +++ b/packages/abc/footer-toolbar/footer-toolbar.component.ts @@ -31,7 +31,11 @@ export class FooterToolbarComponent implements OnInit, OnDestroy { @Input() @InputBoolean() errorCollect = false; @Input() extra?: string | TemplateRef; - constructor(private el: ElementRef, private renderer: Renderer2, @Inject(DOCUMENT) private doc: NzSafeAny) {} + constructor( + private el: ElementRef, + private renderer: Renderer2, + @Inject(DOCUMENT) private doc: NzSafeAny + ) {} private get bodyCls(): DOMTokenList { return (this.doc.querySelector('body') as HTMLElement).classList; diff --git a/packages/abc/footer-toolbar/footer-toolbar.spec.ts b/packages/abc/footer-toolbar/footer-toolbar.spec.ts index 089580ce5..d6c799c1b 100644 --- a/packages/abc/footer-toolbar/footer-toolbar.spec.ts +++ b/packages/abc/footer-toolbar/footer-toolbar.spec.ts @@ -2,8 +2,8 @@ import { Component, DebugElement } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ErrorCollectModule } from '../error-collect/error-collect.module'; import { FooterToolbarModule } from './footer-toolbar.module'; +import { ErrorCollectModule } from '../error-collect/error-collect.module'; describe('abc: footer-toolbar', () => { let fixture: ComponentFixture; diff --git a/packages/abc/hotkey/hotkey.directive.ts b/packages/abc/hotkey/hotkey.directive.ts index 98322a9cb..1ca9981d4 100644 --- a/packages/abc/hotkey/hotkey.directive.ts +++ b/packages/abc/hotkey/hotkey.directive.ts @@ -17,7 +17,11 @@ export class HotkeyDirective implements OnDestroy { this.ngZone.runOutsideAngular(() => install(this.el.nativeElement, key)); } - constructor(private el: ElementRef, private ngZone: NgZone, private platform: Platform) {} + constructor( + private el: ElementRef, + private ngZone: NgZone, + private platform: Platform + ) {} ngOnDestroy(): void { if (!this.platform.isBrowser) return; diff --git a/packages/abc/hotkey/hotkey.spec.ts b/packages/abc/hotkey/hotkey.spec.ts index 8a3a0ad22..f42588720 100644 --- a/packages/abc/hotkey/hotkey.spec.ts +++ b/packages/abc/hotkey/hotkey.spec.ts @@ -2,9 +2,9 @@ import { Platform } from '@angular/cdk/platform'; import { Component, ViewChild } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { createTestContext } from '../../testing'; import { HotkeyDirective } from './hotkey.directive'; import { HotkeyModule } from './hotkey.module'; +import { createTestContext } from '../../testing'; describe('abc: hotkey', () => { let context: TestComponent; diff --git a/packages/abc/lodop/lodop.service.ts b/packages/abc/lodop/lodop.service.ts index a4c0ecedd..d82bddc3e 100644 --- a/packages/abc/lodop/lodop.service.ts +++ b/packages/abc/lodop/lodop.service.ts @@ -17,7 +17,10 @@ export class LodopService implements OnDestroy { private _events = new Subject(); private printBuffer: NzSafeAny[] = []; - constructor(private scriptSrv: LazyService, configSrv: AlainConfigService) { + constructor( + private scriptSrv: LazyService, + configSrv: AlainConfigService + ) { this.defaultConfig = configSrv.merge('lodop', { url: '//localhost:8443/CLodopfuncs.js', name: 'CLODOP', diff --git a/packages/abc/media/media.service.ts b/packages/abc/media/media.service.ts index fffd07396..6fedd1e7c 100644 --- a/packages/abc/media/media.service.ts +++ b/packages/abc/media/media.service.ts @@ -24,7 +24,10 @@ export class MediaService { )!; } - constructor(private cogSrv: AlainConfigService, private lazySrv: LazyService) {} + constructor( + private cogSrv: AlainConfigService, + private lazySrv: LazyService + ) {} load(): this { if (this.loading) { diff --git a/packages/abc/notice-icon/notice-icon.component.ts b/packages/abc/notice-icon/notice-icon.component.ts index f94a24774..8dfd2b23e 100644 --- a/packages/abc/notice-icon/notice-icon.component.ts +++ b/packages/abc/notice-icon/notice-icon.component.ts @@ -51,7 +51,10 @@ export class NoticeIconComponent implements OnInit, OnChanges, OnDestroy { return `header-dropdown notice-icon${!this.centered ? ' notice-icon__tab-left' : ''}`; } - constructor(private i18n: DelonLocaleService, private cdr: ChangeDetectorRef) {} + constructor( + private i18n: DelonLocaleService, + private cdr: ChangeDetectorRef + ) {} onVisibleChange(result: boolean): void { this.popoverVisibleChange.emit(result); diff --git a/packages/abc/observers/observer-size.ts b/packages/abc/observers/observer-size.ts index dd06fd032..a094874bf 100644 --- a/packages/abc/observers/observer-size.ts +++ b/packages/abc/observers/observer-size.ts @@ -86,7 +86,11 @@ export class ObserverSize implements AfterViewInit, OnDestroy { private _sub$: Subscription | null = null; @Output('observeSize') readonly event = new EventEmitter(); - constructor(private _obs: SizeObserver, private el: ElementRef, private ngZone: NgZone) {} + constructor( + private _obs: SizeObserver, + private el: ElementRef, + private ngZone: NgZone + ) {} ngAfterViewInit(): void { if (!this._sub$) { diff --git a/packages/abc/page-header/page-header.spec.ts b/packages/abc/page-header/page-header.spec.ts index ae8d04475..1a9c9449b 100644 --- a/packages/abc/page-header/page-header.spec.ts +++ b/packages/abc/page-header/page-header.spec.ts @@ -18,9 +18,9 @@ import { import { NzAffixComponent } from 'ng-zorro-antd/affix'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { ReuseTabService } from '../reuse-tab/reuse-tab.service'; import { PageHeaderComponent } from './page-header.component'; import { PageHeaderModule } from './page-header.module'; +import { ReuseTabService } from '../reuse-tab/reuse-tab.service'; class MockI18NServiceFake extends AlainI18NServiceFake { fanyi(key: string): string { diff --git a/packages/abc/qr/qr.spec.ts b/packages/abc/qr/qr.spec.ts index 03f81467a..154ffcdfd 100644 --- a/packages/abc/qr/qr.spec.ts +++ b/packages/abc/qr/qr.spec.ts @@ -6,9 +6,9 @@ import { of } from 'rxjs'; import { createTestContext } from '@delon/testing'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { AlainConfigService, LazyService } from '../../util'; import { QRComponent } from './qr.component'; import { QRModule } from './qr.module'; +import { AlainConfigService, LazyService } from '../../util'; describe('abc: qr', () => { let fixture: ComponentFixture; diff --git a/packages/abc/quick-menu/quick-menu.component.ts b/packages/abc/quick-menu/quick-menu.component.ts index a9dfb4a94..a9be7ad56 100644 --- a/packages/abc/quick-menu/quick-menu.component.ts +++ b/packages/abc/quick-menu/quick-menu.component.ts @@ -32,7 +32,11 @@ export class QuickMenuComponent implements OnInit, OnChanges { static ngAcceptInputType_width: NumberInput; static ngAcceptInputType_expand: BooleanInput; - constructor(private cdr: ChangeDetectorRef, private el: ElementRef, private render: Renderer2) {} + constructor( + private cdr: ChangeDetectorRef, + private el: ElementRef, + private render: Renderer2 + ) {} ctrlStyle: { [key: string]: string | undefined } = {}; @Input() icon: string | TemplateRef = 'question-circle'; diff --git a/packages/abc/reuse-tab/reuse-tab.component.spec.ts b/packages/abc/reuse-tab/reuse-tab.component.spec.ts index d7470b6ce..0210d123d 100644 --- a/packages/abc/reuse-tab/reuse-tab.component.spec.ts +++ b/packages/abc/reuse-tab/reuse-tab.component.spec.ts @@ -9,7 +9,6 @@ import { ALAIN_I18N_TOKEN, DelonLocaleModule, DelonLocaleService, en_US, MenuSer import { ScrollService } from '@delon/util/browser'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { AlainI18NServiceFake } from '../../theme/src/services/i18n/i18n'; import { ReuseTabComponent } from './reuse-tab.component'; import { ReuseCanClose, @@ -22,6 +21,7 @@ import { ReuseTabModule } from './reuse-tab.module'; import { ReuseTabService } from './reuse-tab.service'; import { REUSE_TAB_STORAGE_STATE } from './reuse-tab.state'; import { ReuseTabStrategy } from './reuse-tab.strategy'; +import { AlainI18NServiceFake } from '../../theme/src/services/i18n/i18n'; let i18nResult = 'zh'; @Injectable() diff --git a/packages/abc/reuse-tab/reuse-tab.component.ts b/packages/abc/reuse-tab/reuse-tab.component.ts index 41d6c02ee..c33cfaaef 100644 --- a/packages/abc/reuse-tab/reuse-tab.component.ts +++ b/packages/abc/reuse-tab/reuse-tab.component.ts @@ -150,7 +150,7 @@ export class ReuseTabComponent implements OnInit, OnChanges, OnDestroy { index, active: false, last: false - } as ReuseItem) + }) as ReuseItem ); // debugger; diff --git a/packages/abc/st/st-row.directive.ts b/packages/abc/st/st-row.directive.ts index e0156b14e..a5801b190 100644 --- a/packages/abc/st/st-row.directive.ts +++ b/packages/abc/st/st-row.directive.ts @@ -24,7 +24,10 @@ export class STRowDirective implements OnInit { @Input() type?: 'title'; - constructor(private ref: TemplateRef, @Host() private source: STRowSource) {} + constructor( + private ref: TemplateRef, + @Host() private source: STRowSource + ) {} ngOnInit(): void { this.source.add(this.type, this.id, this.ref); diff --git a/packages/abc/st/st-widget-host.directive.ts b/packages/abc/st/st-widget-host.directive.ts index 5ee83920d..c8775ef8f 100644 --- a/packages/abc/st/st-widget-host.directive.ts +++ b/packages/abc/st/st-widget-host.directive.ts @@ -10,7 +10,10 @@ export class STWidgetHostDirective implements OnInit { @Input() record!: STData; @Input() column!: STColumn; - constructor(private stWidgetRegistry: STWidgetRegistry, private viewContainerRef: ViewContainerRef) {} + constructor( + private stWidgetRegistry: STWidgetRegistry, + private viewContainerRef: ViewContainerRef + ) {} ngOnInit(): void { const widget = this.column.widget!; diff --git a/packages/abc/st/test/base.spec.ts b/packages/abc/st/test/base.spec.ts index b30a18b9b..d53de457b 100644 --- a/packages/abc/st/test/base.spec.ts +++ b/packages/abc/st/test/base.spec.ts @@ -16,6 +16,7 @@ import { NzDrawerModule } from 'ng-zorro-antd/drawer'; import { NzModalModule } from 'ng-zorro-antd/modal'; import { NzPaginationComponent } from 'ng-zorro-antd/pagination'; +import { STWidgetRegistry } from './../st-widget'; import { AlainI18NService, AlainI18NServiceFake } from '../../../theme/src/services/i18n/i18n'; import { STComponent } from '../st.component'; import { @@ -34,7 +35,6 @@ import { } from '../st.interfaces'; import { STModule } from '../st.module'; import { _STColumn } from '../st.types'; -import { STWidgetRegistry } from './../st-widget'; export const MOCKDATE = new Date(); export const MOCKIMG = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg==`; @@ -263,7 +263,9 @@ export class PageObject { expectData(row: number, path: string, valule: NzSafeAny, options?: { message?: string }): this { const ret = deepGet(this.comp._data[row - 1], path); if (options?.message != null) { - expect(ret).withContext(options?.message).toBe(valule); + expect(ret) + .withContext(options?.message) + .toBe(valule); } else { expect(ret).toBe(valule); } diff --git a/packages/abc/st/test/st-expand.spec.ts b/packages/abc/st/test/st-expand.spec.ts index 2c56d7b98..2d6926148 100644 --- a/packages/abc/st/test/st-expand.spec.ts +++ b/packages/abc/st/test/st-expand.spec.ts @@ -3,8 +3,8 @@ import { fakeAsync } from '@angular/core/testing'; import { deepCopy } from '@delon/util/other'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { _STColumn } from '../st.types'; import { PageObject, genModule, TestExpandComponent, USERS } from './base.spec'; +import { _STColumn } from '../st.types'; describe('abc: st-expand', () => { let page: PageObject; diff --git a/packages/abc/st/test/st-filter.spec.ts b/packages/abc/st/test/st-filter.spec.ts index bf141387c..cf7ff41b7 100644 --- a/packages/abc/st/test/st-filter.spec.ts +++ b/packages/abc/st/test/st-filter.spec.ts @@ -4,11 +4,11 @@ import { DebugElement } from '@angular/core'; import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { PageObject, TestComponent, genModule } from './base.spec'; import { STFilterComponent } from '../st-filter.component'; import { STComponent } from '../st.component'; import { STColumnFilter } from '../st.interfaces'; import { _STColumn } from '../st.types'; -import { PageObject, TestComponent, genModule } from './base.spec'; registerLocaleData(zh); diff --git a/packages/abc/st/test/st-sort.spec.ts b/packages/abc/st/test/st-sort.spec.ts index 2d438374d..5bed0f706 100644 --- a/packages/abc/st/test/st-sort.spec.ts +++ b/packages/abc/st/test/st-sort.spec.ts @@ -3,10 +3,10 @@ import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { AlainConfig, ALAIN_CONFIG } from '@delon/util/config'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { PageObject, TestComponent, genModule } from './base.spec'; import { STComponent } from '../st.component'; import { STMultiSort } from '../st.interfaces'; import { _STColumn } from '../st.types'; -import { PageObject, TestComponent, genModule } from './base.spec'; describe('abc: st-sort', () => { let page: PageObject; diff --git a/packages/abc/st/test/st.spec.ts b/packages/abc/st/test/st.spec.ts index 2a0528f05..298193fe0 100644 --- a/packages/abc/st/test/st.spec.ts +++ b/packages/abc/st/test/st.spec.ts @@ -17,18 +17,6 @@ import { import { deepCopy } from '@delon/util/other'; import { NzPaginationComponent } from 'ng-zorro-antd/pagination'; -import { STDataSource } from '../st-data-source'; -import { STExport } from '../st-export'; -import { STComponent } from '../st.component'; -import { - STClickRowClassNameType, - STColumn, - STColumnBadge, - STColumnTag, - STContextmenuItem, - STResReNameType -} from '../st.interfaces'; -import { _STColumn } from '../st.types'; import { STWidgetRegistry } from './../st-widget'; import { PS, @@ -42,6 +30,18 @@ import { TestComponent, genModule } from './base.spec'; +import { STDataSource } from '../st-data-source'; +import { STExport } from '../st-export'; +import { STComponent } from '../st.component'; +import { + STClickRowClassNameType, + STColumn, + STColumnBadge, + STColumnTag, + STContextmenuItem, + STResReNameType +} from '../st.interfaces'; +import { _STColumn } from '../st.types'; describe('abc: st', () => { let fixture: ComponentFixture; diff --git a/packages/abc/sv/sv-container.component.ts b/packages/abc/sv/sv-container.component.ts index 7ece27a1b..bac5e8363 100644 --- a/packages/abc/sv/sv-container.component.ts +++ b/packages/abc/sv/sv-container.component.ts @@ -80,7 +80,11 @@ export class SVContainerComponent { }) export class SVTitleComponent implements OnInit { private el: HTMLElement; - constructor(el: ElementRef, @Host() @Optional() private parent: SVContainerComponent, private ren: Renderer2) { + constructor( + el: ElementRef, + @Host() @Optional() private parent: SVContainerComponent, + private ren: Renderer2 + ) { if (parent == null) { throw new Error(`[sv-title] must include 'sv-container' component`); } diff --git a/packages/acl/src/acl-guard.ts b/packages/acl/src/acl-guard.ts index 8adf1f441..990779f8f 100644 --- a/packages/acl/src/acl-guard.ts +++ b/packages/acl/src/acl-guard.ts @@ -27,7 +27,11 @@ import { ACLCanType, ACLGuardType } from './acl.type'; */ @Injectable({ providedIn: 'root' }) export class ACLGuard implements CanActivate, CanActivateChild, CanMatch { - constructor(private srv: ACLService, private router: Router, private injector: Injector) {} + constructor( + private srv: ACLService, + private router: Router, + private injector: Injector + ) {} private process(data: Data): Observable { data = { diff --git a/packages/acl/src/acl-if.directive.ts b/packages/acl/src/acl-if.directive.ts index 444e3acd5..50bad0218 100644 --- a/packages/acl/src/acl-if.directive.ts +++ b/packages/acl/src/acl-if.directive.ts @@ -19,7 +19,11 @@ export class ACLIfDirective implements OnDestroy { private _elseViewRef: EmbeddedViewRef | null = null; private _except = false; - constructor(templateRef: TemplateRef, private srv: ACLService, private _viewContainer: ViewContainerRef) { + constructor( + templateRef: TemplateRef, + private srv: ACLService, + private _viewContainer: ViewContainerRef + ) { this._change$ = this.srv.change.pipe(filter(r => r != null)).subscribe(() => this._updateView()); this._thenTemplateRef = templateRef; } diff --git a/packages/acl/src/acl.directive.ts b/packages/acl/src/acl.directive.ts index d5e3f7ba3..9a5a5bdcd 100644 --- a/packages/acl/src/acl.directive.ts +++ b/packages/acl/src/acl.directive.ts @@ -33,7 +33,11 @@ export class ACLDirective implements OnDestroy { } } - constructor(private el: ElementRef, private renderer: Renderer2, protected srv: ACLService) { + constructor( + private el: ElementRef, + private renderer: Renderer2, + protected srv: ACLService + ) { this.change$ = this.srv.change.pipe(filter(r => r != null)).subscribe(() => this.set(this._value)); } diff --git a/packages/auth/src/social/social.service.spec.ts b/packages/auth/src/social/social.service.spec.ts index cc57d32d6..fe7faba1f 100644 --- a/packages/auth/src/social/social.service.spec.ts +++ b/packages/auth/src/social/social.service.spec.ts @@ -5,10 +5,10 @@ import { discardPeriodicTasks, fakeAsync, TestBed, tick } from '@angular/core/te import { DefaultUrlSerializer, Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; +import { SocialService } from './social.service'; import { DelonAuthModule } from '../auth.module'; import { DA_SERVICE_TOKEN, ITokenModel } from '../token/interface'; import { SimpleTokenModel } from '../token/simple/simple.model'; -import { SocialService } from './social.service'; const mockRouter = { url: '', diff --git a/packages/auth/src/store/cookie-storage.service.spec.ts b/packages/auth/src/store/cookie-storage.service.spec.ts index 16af9f190..ae9119848 100644 --- a/packages/auth/src/store/cookie-storage.service.spec.ts +++ b/packages/auth/src/store/cookie-storage.service.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { ITokenModel } from '../token/interface'; import { CookieStorageStore } from './cookie-storage.service'; +import { ITokenModel } from '../token/interface'; describe('auth: cookie-storage', () => { let data: { [key: string]: any } = {}; diff --git a/packages/auth/src/store/cookie-storage.service.ts b/packages/auth/src/store/cookie-storage.service.ts index 2971ff163..768c8dc75 100644 --- a/packages/auth/src/store/cookie-storage.service.ts +++ b/packages/auth/src/store/cookie-storage.service.ts @@ -1,7 +1,7 @@ import { CookieService } from '@delon/util/browser'; -import { ITokenModel } from '../token/interface'; import { IStore } from './interface'; +import { ITokenModel } from '../token/interface'; /** * `cookie` storage diff --git a/packages/auth/src/store/interface.ts b/packages/auth/src/store/interface.ts index 18bce9f05..790a8ac0a 100644 --- a/packages/auth/src/store/interface.ts +++ b/packages/auth/src/store/interface.ts @@ -1,7 +1,7 @@ import { InjectionToken } from '@angular/core'; -import { ITokenModel } from '../token/interface'; import { DA_STORE_TOKEN_LOCAL_FACTORY } from './local-storage.service'; +import { ITokenModel } from '../token/interface'; export const DA_STORE_TOKEN = new InjectionToken('AUTH_STORE_TOKEN', { providedIn: 'root', diff --git a/packages/auth/src/store/local-storage.service.spec.ts b/packages/auth/src/store/local-storage.service.spec.ts index 23d13e715..dc18e1d4f 100644 --- a/packages/auth/src/store/local-storage.service.spec.ts +++ b/packages/auth/src/store/local-storage.service.spec.ts @@ -1,5 +1,5 @@ -import { ITokenModel } from '../token/interface'; import { LocalStorageStore } from './local-storage.service'; +import { ITokenModel } from '../token/interface'; describe('auth: local-storage', () => { const store = new LocalStorageStore(); diff --git a/packages/auth/src/store/local-storage.service.ts b/packages/auth/src/store/local-storage.service.ts index 8934eacad..8553d2fe9 100644 --- a/packages/auth/src/store/local-storage.service.ts +++ b/packages/auth/src/store/local-storage.service.ts @@ -1,5 +1,5 @@ -import { ITokenModel } from '../token/interface'; import { IStore } from './interface'; +import { ITokenModel } from '../token/interface'; export function DA_STORE_TOKEN_LOCAL_FACTORY(): IStore { return new LocalStorageStore(); diff --git a/packages/auth/src/store/memory.service.spec.ts b/packages/auth/src/store/memory.service.spec.ts index 3d94d75cd..7e67960f7 100644 --- a/packages/auth/src/store/memory.service.spec.ts +++ b/packages/auth/src/store/memory.service.spec.ts @@ -1,5 +1,5 @@ -import { ITokenModel } from '../token/interface'; import { MemoryStore } from './memory.service'; +import { ITokenModel } from '../token/interface'; describe('auth: memory', () => { const store = new MemoryStore(); diff --git a/packages/auth/src/store/memory.service.ts b/packages/auth/src/store/memory.service.ts index 1ce50fa75..3e9d3d0ec 100644 --- a/packages/auth/src/store/memory.service.ts +++ b/packages/auth/src/store/memory.service.ts @@ -1,5 +1,5 @@ -import { ITokenModel } from '../token/interface'; import { IStore } from './interface'; +import { ITokenModel } from '../token/interface'; /** * 内存存储,关掉浏览器标签后**丢失**。 diff --git a/packages/auth/src/store/session-storage.service.spec.ts b/packages/auth/src/store/session-storage.service.spec.ts index 84fecd777..01ff213ff 100644 --- a/packages/auth/src/store/session-storage.service.spec.ts +++ b/packages/auth/src/store/session-storage.service.spec.ts @@ -1,5 +1,5 @@ -import { ITokenModel } from '../token/interface'; import { SessionStorageStore } from './session-storage.service'; +import { ITokenModel } from '../token/interface'; describe('auth: session-storage', () => { const store = new SessionStorageStore(); diff --git a/packages/auth/src/store/session-storage.service.ts b/packages/auth/src/store/session-storage.service.ts index 70e9d1a69..3a45daf32 100644 --- a/packages/auth/src/store/session-storage.service.ts +++ b/packages/auth/src/store/session-storage.service.ts @@ -1,5 +1,5 @@ -import { ITokenModel } from '../token/interface'; import { IStore } from './interface'; +import { ITokenModel } from '../token/interface'; /** * `sessionStorage` storage, **lost after closing the browser**. diff --git a/packages/auth/src/token/base.interceptor.spec.ts b/packages/auth/src/token/base.interceptor.spec.ts index 60ff8477c..6d4754029 100644 --- a/packages/auth/src/token/base.interceptor.spec.ts +++ b/packages/auth/src/token/base.interceptor.spec.ts @@ -19,11 +19,11 @@ import { Observable, throwError, catchError } from 'rxjs'; import { AlainAuthConfig, ALAIN_CONFIG } from '@delon/util/config'; -import { DelonAuthModule } from '../auth.module'; -import { ALLOW_ANONYMOUS } from '../token'; import { AuthReferrer, DA_SERVICE_TOKEN, ITokenModel, ITokenService } from './interface'; import { SimpleInterceptor } from './simple/simple.interceptor'; import { SimpleTokenModel } from './simple/simple.model'; +import { DelonAuthModule } from '../auth.module'; +import { ALLOW_ANONYMOUS } from '../token'; function genModel(modelType: new () => T, token: string | null = `123`): any { const model: any = new modelType(); diff --git a/packages/auth/src/token/base.interceptor.ts b/packages/auth/src/token/base.interceptor.ts index 21937e517..9de285ffe 100644 --- a/packages/auth/src/token/base.interceptor.ts +++ b/packages/auth/src/token/base.interceptor.ts @@ -12,13 +12,16 @@ import { Observable, Observer } from 'rxjs'; import { AlainAuthConfig, AlainConfigService } from '@delon/util/config'; -import { mergeConfig } from '../auth.config'; -import { ALLOW_ANONYMOUS } from '../token'; import { ToLogin } from './helper'; import { ITokenModel } from './interface'; +import { mergeConfig } from '../auth.config'; +import { ALLOW_ANONYMOUS } from '../token'; class HttpAuthInterceptorHandler implements HttpHandler { - constructor(private next: HttpHandler, private interceptor: HttpInterceptor) {} + constructor( + private next: HttpHandler, + private interceptor: HttpInterceptor + ) {} handle(req: HttpRequest): Observable> { return this.interceptor.intercept(req, this.next); diff --git a/packages/auth/src/token/helper.spec.ts b/packages/auth/src/token/helper.spec.ts index c2ad6a891..eab094421 100644 --- a/packages/auth/src/token/helper.spec.ts +++ b/packages/auth/src/token/helper.spec.ts @@ -1,5 +1,5 @@ -import { JWTTokenModel } from '../..'; import { CheckJwt } from './helper'; +import { JWTTokenModel } from '../..'; describe('helper: CheckJwt', () => { it('invalid jwt token should return false', () => { diff --git a/packages/auth/src/token/jwt/jwt.guard.spec.ts b/packages/auth/src/token/jwt/jwt.guard.spec.ts index b6fb18d21..314a5e660 100644 --- a/packages/auth/src/token/jwt/jwt.guard.spec.ts +++ b/packages/auth/src/token/jwt/jwt.guard.spec.ts @@ -3,9 +3,9 @@ import { fakeAsync, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; +import { JWTGuard } from './jwt.guard'; import { DelonAuthModule } from '../../auth.module'; import { DA_SERVICE_TOKEN, ITokenService } from '../interface'; -import { JWTGuard } from './jwt.guard'; describe('auth: JWTGuard', () => { let srv: ITokenService; diff --git a/packages/auth/src/token/jwt/jwt.guard.ts b/packages/auth/src/token/jwt/jwt.guard.ts index 3cde3969b..1b3de4665 100644 --- a/packages/auth/src/token/jwt/jwt.guard.ts +++ b/packages/auth/src/token/jwt/jwt.guard.ts @@ -10,9 +10,9 @@ import { import { AlainAuthConfig } from '@delon/util/config'; +import { JWTTokenModel } from './jwt.model'; import { CheckJwt, ToLogin } from '../helper'; import { DA_SERVICE_TOKEN, ITokenService } from '../interface'; -import { JWTTokenModel } from './jwt.model'; /** * JWT 路由守卫, [ACL Document](https://ng-alain.com/auth/guard). @@ -39,7 +39,10 @@ export class JWTGuard implements CanActivate, CanActivateChild, CanMatch { return this.srv.options; } - constructor(@Inject(DA_SERVICE_TOKEN) private srv: ITokenService, private injector: Injector) {} + constructor( + @Inject(DA_SERVICE_TOKEN) private srv: ITokenService, + private injector: Injector + ) {} private process(): boolean { const res = CheckJwt(this.srv.get(JWTTokenModel), this.cog.token_exp_offset!); diff --git a/packages/auth/src/token/jwt/jwt.interceptor.spec.ts b/packages/auth/src/token/jwt/jwt.interceptor.spec.ts index f8374ab2b..56e311b79 100644 --- a/packages/auth/src/token/jwt/jwt.interceptor.spec.ts +++ b/packages/auth/src/token/jwt/jwt.interceptor.spec.ts @@ -7,10 +7,10 @@ import { of, catchError } from 'rxjs'; import { AlainAuthConfig, ALAIN_CONFIG } from '@delon/util/config'; -import { DelonAuthModule } from '../../auth.module'; -import { DA_SERVICE_TOKEN } from '../interface'; import { JWTInterceptor } from './jwt.interceptor'; import { JWTTokenModel } from './jwt.model'; +import { DelonAuthModule } from '../../auth.module'; +import { DA_SERVICE_TOKEN } from '../interface'; function genModel( token: diff --git a/packages/auth/src/token/jwt/jwt.interceptor.ts b/packages/auth/src/token/jwt/jwt.interceptor.ts index 6a37e388e..fab94cd8f 100644 --- a/packages/auth/src/token/jwt/jwt.interceptor.ts +++ b/packages/auth/src/token/jwt/jwt.interceptor.ts @@ -3,10 +3,10 @@ import { Injectable } from '@angular/core'; import { AlainAuthConfig } from '@delon/util/config'; +import { JWTTokenModel } from './jwt.model'; import { BaseInterceptor } from '../base.interceptor'; import { CheckJwt } from '../helper'; import { DA_SERVICE_TOKEN } from '../interface'; -import { JWTTokenModel } from './jwt.model'; /** * JWT 拦截器 diff --git a/packages/auth/src/token/jwt/jwt.model.ts b/packages/auth/src/token/jwt/jwt.model.ts index 8bee28a4d..82c4a5701 100644 --- a/packages/auth/src/token/jwt/jwt.model.ts +++ b/packages/auth/src/token/jwt/jwt.model.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { ITokenModel } from '../interface'; import { urlBase64Decode } from './jwt.helper'; +import { ITokenModel } from '../interface'; export interface JWT { /** diff --git a/packages/auth/src/token/simple/simple.guard.spec.ts b/packages/auth/src/token/simple/simple.guard.spec.ts index 6fd00b040..ffa5e54f2 100644 --- a/packages/auth/src/token/simple/simple.guard.spec.ts +++ b/packages/auth/src/token/simple/simple.guard.spec.ts @@ -3,9 +3,9 @@ import { fakeAsync, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; +import { SimpleGuard } from './simple.guard'; import { DelonAuthModule } from '../../auth.module'; import { DA_SERVICE_TOKEN, ITokenService } from '../interface'; -import { SimpleGuard } from './simple.guard'; describe('auth: SimpleGuard', () => { let srv: ITokenService; diff --git a/packages/auth/src/token/simple/simple.guard.ts b/packages/auth/src/token/simple/simple.guard.ts index 26db318b3..e2c54863c 100644 --- a/packages/auth/src/token/simple/simple.guard.ts +++ b/packages/auth/src/token/simple/simple.guard.ts @@ -10,9 +10,9 @@ import { import { AlainAuthConfig } from '@delon/util/config'; +import { SimpleTokenModel } from './simple.model'; import { CheckSimple, ToLogin } from '../helper'; import { DA_SERVICE_TOKEN, ITokenService } from '../interface'; -import { SimpleTokenModel } from './simple.model'; /** * Simple 路由守卫, [ACL Document](https://ng-alain.com/auth/guard). @@ -39,7 +39,10 @@ export class SimpleGuard implements CanActivate, CanActivateChild, CanMatch { return this.srv.options; } - constructor(@Inject(DA_SERVICE_TOKEN) private srv: ITokenService, private injector: Injector) {} + constructor( + @Inject(DA_SERVICE_TOKEN) private srv: ITokenService, + private injector: Injector + ) {} private process(): boolean { const res = CheckSimple(this.srv.get() as SimpleTokenModel); diff --git a/packages/auth/src/token/simple/simple.interceptor.spec.ts b/packages/auth/src/token/simple/simple.interceptor.spec.ts index 72db7fa3e..adb4cadda 100644 --- a/packages/auth/src/token/simple/simple.interceptor.spec.ts +++ b/packages/auth/src/token/simple/simple.interceptor.spec.ts @@ -9,10 +9,10 @@ import { Observable } from 'rxjs'; import { AlainAuthConfig, ALAIN_CONFIG } from '@delon/util/config'; -import { DelonAuthModule } from '../../auth.module'; -import { DA_SERVICE_TOKEN, ITokenModel, ITokenService } from '../interface'; import { SimpleInterceptor } from './simple.interceptor'; import { SimpleTokenModel } from './simple.model'; +import { DelonAuthModule } from '../../auth.module'; +import { DA_SERVICE_TOKEN, ITokenModel, ITokenService } from '../interface'; function genModel(token: string = `123`): SimpleTokenModel { const model = new SimpleTokenModel(); diff --git a/packages/auth/src/token/simple/simple.interceptor.ts b/packages/auth/src/token/simple/simple.interceptor.ts index e25e024e1..b83c898c5 100644 --- a/packages/auth/src/token/simple/simple.interceptor.ts +++ b/packages/auth/src/token/simple/simple.interceptor.ts @@ -4,10 +4,10 @@ import { Injectable } from '@angular/core'; import { AlainAuthConfig } from '@delon/util/config'; +import { SimpleTokenModel } from './simple.model'; import { BaseInterceptor } from '../base.interceptor'; import { CheckSimple } from '../helper'; import { DA_SERVICE_TOKEN } from '../interface'; -import { SimpleTokenModel } from './simple.model'; /** * Simple 拦截器 diff --git a/packages/auth/src/token/token.service.ts b/packages/auth/src/token/token.service.ts index 99a79483b..8f6cad619 100644 --- a/packages/auth/src/token/token.service.ts +++ b/packages/auth/src/token/token.service.ts @@ -3,9 +3,9 @@ import { BehaviorSubject, interval, Observable, Subject, Subscription, filter, m import { AlainAuthConfig, AlainConfigService } from '@delon/util/config'; +import { AuthReferrer, ITokenModel, ITokenService } from './interface'; import { mergeConfig } from '../auth.config'; import { DA_STORE_TOKEN, IStore } from '../store/interface'; -import { AuthReferrer, ITokenModel, ITokenService } from './interface'; export function DA_SERVICE_TOKEN_FACTORY(): ITokenService { return new TokenService(inject(AlainConfigService), inject(DA_STORE_TOKEN)); @@ -22,7 +22,10 @@ export class TokenService implements ITokenService, OnDestroy { private _referrer: AuthReferrer = {}; private _options: AlainAuthConfig; - constructor(configSrv: AlainConfigService, @Inject(DA_STORE_TOKEN) private store: IStore) { + constructor( + configSrv: AlainConfigService, + @Inject(DA_STORE_TOKEN) private store: IStore + ) { this._options = mergeConfig(configSrv); } diff --git a/packages/chart/chart-echarts/echarts.service.ts b/packages/chart/chart-echarts/echarts.service.ts index 4250a4f65..029c78b21 100644 --- a/packages/chart/chart-echarts/echarts.service.ts +++ b/packages/chart/chart-echarts/echarts.service.ts @@ -25,7 +25,10 @@ export class ChartEChartsService implements OnDestroy { )!; } - constructor(private cogSrv: AlainConfigService, private lazySrv: LazyService) { + constructor( + private cogSrv: AlainConfigService, + private lazySrv: LazyService + ) { this.cog = { theme: '' }; } diff --git a/packages/chart/core/g2.servicce.ts b/packages/chart/core/g2.servicce.ts index b10b8034a..8189d89c3 100644 --- a/packages/chart/core/g2.servicce.ts +++ b/packages/chart/core/g2.servicce.ts @@ -28,7 +28,10 @@ export class G2Service implements OnDestroy { )!; } - constructor(private cogSrv: AlainConfigService, private lazySrv: LazyService) { + constructor( + private cogSrv: AlainConfigService, + private lazySrv: LazyService + ) { this.cog = { theme: '' }; } diff --git a/packages/chart/custom/custom.spec.ts b/packages/chart/custom/custom.spec.ts index 8bc3f8a85..b105ba357 100644 --- a/packages/chart/custom/custom.spec.ts +++ b/packages/chart/custom/custom.spec.ts @@ -4,9 +4,9 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin import { createTestContext } from '@delon/testing'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { G2Service } from '../core'; import { G2CustomComponent } from './custom.component'; import { G2CustomModule } from './custom.module'; +import { G2Service } from '../core'; describe('chart: custom', () => { let fixture: ComponentFixture; diff --git a/packages/chart/mini-progress/mini-progress.component.ts b/packages/chart/mini-progress/mini-progress.component.ts index 54f1d40f8..fed168fa5 100644 --- a/packages/chart/mini-progress/mini-progress.component.ts +++ b/packages/chart/mini-progress/mini-progress.component.ts @@ -29,7 +29,10 @@ export class G2MiniProgressComponent implements OnChanges { @Input() @InputNumber() percent?: number | null; @Input() @InputNumber() strokeWidth?: number | null; - constructor(public i18n: DelonLocaleService, private cdr: ChangeDetectorRef) {} + constructor( + public i18n: DelonLocaleService, + private cdr: ChangeDetectorRef + ) {} private fixNum(value: number | undefined | null): number { return Math.min(Math.max(toNumber(value), 0), 100); diff --git a/packages/form/spec/form.spec.ts b/packages/form/spec/form.spec.ts index 93daa8e5b..f80022766 100644 --- a/packages/form/spec/form.spec.ts +++ b/packages/form/spec/form.spec.ts @@ -12,11 +12,11 @@ import { deepCopy } from '@delon/util/other'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzIconService } from 'ng-zorro-antd/icon'; +import { SCHEMA, SFPage, TestFormComponent } from './base.spec'; import { FormPropertyFactory } from '../src/model/form.property.factory'; import { DelonFormModule } from '../src/module'; import { SFSchema } from '../src/schema/index'; import { WidgetRegistry } from '../src/widget.factory'; -import { SCHEMA, SFPage, TestFormComponent } from './base.spec'; registerLocaleData(zh); describe('form: component', () => { diff --git a/packages/form/spec/schema.spec.ts b/packages/form/spec/schema.spec.ts index 85c3c3746..c1e183b7e 100644 --- a/packages/form/spec/schema.spec.ts +++ b/packages/form/spec/schema.spec.ts @@ -5,10 +5,10 @@ import { createTestContext } from '@delon/testing'; import { deepCopy } from '@delon/util/other'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { configureSFTestSuite, SFPage, TestFormComponent } from './base.spec'; import { ObjectProperty } from '../src/model/object.property'; import { SFSchema } from '../src/schema/index'; import { SFUISchema, SFUISchemaItem } from '../src/schema/ui'; -import { configureSFTestSuite, SFPage, TestFormComponent } from './base.spec'; describe('form: schema', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/model/array.property.ts b/packages/form/src/model/array.property.ts index e897a0489..a2016ba33 100644 --- a/packages/form/src/model/array.property.ts +++ b/packages/form/src/model/array.property.ts @@ -2,14 +2,14 @@ import { AlainSFConfig } from '@delon/util/config'; import { deepCopy } from '@delon/util/other'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { FormProperty, PropertyGroup } from './form.property'; +import { FormPropertyFactory } from './form.property.factory'; +import { ObjectProperty } from './object.property'; import { SF_SEQ } from '../const'; import { SFValue } from '../interface'; import { SFSchema } from '../schema/index'; import { SFUISchema, SFUISchemaItem } from '../schema/ui'; import { SchemaValidatorFactory } from '../validator.factory'; -import { FormProperty, PropertyGroup } from './form.property'; -import { FormPropertyFactory } from './form.property.factory'; -import { ObjectProperty } from './object.property'; export class ArrayProperty extends PropertyGroup { constructor( diff --git a/packages/form/src/model/atomic.property.ts b/packages/form/src/model/atomic.property.ts index a96a09946..6e2a7e7aa 100644 --- a/packages/form/src/model/atomic.property.ts +++ b/packages/form/src/model/atomic.property.ts @@ -1,5 +1,5 @@ -import { SFValue } from '../interface'; import { FormProperty } from './form.property'; +import { SFValue } from '../interface'; export abstract class AtomicProperty extends FormProperty { abstract fallbackValue(): SFValue; diff --git a/packages/form/src/model/boolean.property.ts b/packages/form/src/model/boolean.property.ts index b3981a29a..fd997b91d 100644 --- a/packages/form/src/model/boolean.property.ts +++ b/packages/form/src/model/boolean.property.ts @@ -1,5 +1,5 @@ -import { SFValue } from '../interface'; import { AtomicProperty } from './atomic.property'; +import { SFValue } from '../interface'; export class BooleanProperty extends AtomicProperty { fallbackValue(): SFValue { diff --git a/packages/form/src/model/form.property.factory.ts b/packages/form/src/model/form.property.factory.ts index b989bdbd0..4bd5293eb 100644 --- a/packages/form/src/model/form.property.factory.ts +++ b/packages/form/src/model/form.property.factory.ts @@ -1,21 +1,24 @@ import { AlainConfigService, AlainSFConfig } from '@delon/util/config'; -import { mergeConfig } from '../config'; -import { SF_SEQ } from '../const'; -import { SFSchema } from '../schema/index'; -import { SFUISchema, SFUISchemaItem } from '../schema/ui'; -import { retrieveSchema } from '../utils'; -import { SchemaValidatorFactory } from '../validator.factory'; import { ArrayProperty } from './array.property'; import { BooleanProperty } from './boolean.property'; import { FormProperty, PropertyGroup } from './form.property'; import { NumberProperty } from './number.property'; import { ObjectProperty } from './object.property'; import { StringProperty } from './string.property'; +import { mergeConfig } from '../config'; +import { SF_SEQ } from '../const'; +import { SFSchema } from '../schema/index'; +import { SFUISchema, SFUISchemaItem } from '../schema/ui'; +import { retrieveSchema } from '../utils'; +import { SchemaValidatorFactory } from '../validator.factory'; export class FormPropertyFactory { private options: AlainSFConfig; - constructor(private schemaValidatorFactory: SchemaValidatorFactory, cogSrv: AlainConfigService) { + constructor( + private schemaValidatorFactory: SchemaValidatorFactory, + cogSrv: AlainConfigService + ) { this.options = mergeConfig(cogSrv); } diff --git a/packages/form/src/model/number.property.ts b/packages/form/src/model/number.property.ts index 3fdc234fd..28980c174 100644 --- a/packages/form/src/model/number.property.ts +++ b/packages/form/src/model/number.property.ts @@ -1,5 +1,5 @@ -import { SFValue } from '../interface'; import { AtomicProperty } from './atomic.property'; +import { SFValue } from '../interface'; export class NumberProperty extends AtomicProperty { fallbackValue(): null { diff --git a/packages/form/src/model/object.property.ts b/packages/form/src/model/object.property.ts index 1699a703b..73fdc7449 100644 --- a/packages/form/src/model/object.property.ts +++ b/packages/form/src/model/object.property.ts @@ -1,13 +1,13 @@ import { AlainSFConfig } from '@delon/util/config'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { FormProperty, PropertyGroup } from './form.property'; +import { FormPropertyFactory } from './form.property.factory'; import { SFValue } from '../interface'; import { SFSchema } from '../schema/index'; import { SFUISchema, SFUISchemaItem } from '../schema/ui'; import { orderProperties } from '../utils'; import { SchemaValidatorFactory } from '../validator.factory'; -import { FormProperty, PropertyGroup } from './form.property'; -import { FormPropertyFactory } from './form.property.factory'; export class ObjectProperty extends PropertyGroup { private _propertiesId: string[] = []; diff --git a/packages/form/src/model/string.property.ts b/packages/form/src/model/string.property.ts index c7a6981e0..19afc00b6 100644 --- a/packages/form/src/model/string.property.ts +++ b/packages/form/src/model/string.property.ts @@ -1,5 +1,5 @@ -import { SFValue } from '../interface'; import { AtomicProperty } from './atomic.property'; +import { SFValue } from '../interface'; export class StringProperty extends AtomicProperty { fallbackValue(): null { diff --git a/packages/form/src/sf-fixed.directive.ts b/packages/form/src/sf-fixed.directive.ts index b1acd4fcc..74af209b9 100644 --- a/packages/form/src/sf-fixed.directive.ts +++ b/packages/form/src/sf-fixed.directive.ts @@ -24,7 +24,10 @@ export class SFFixedDirective implements AfterViewInit, OnChanges { } } - constructor(er: ElementRef, private render: Renderer2) { + constructor( + er: ElementRef, + private render: Renderer2 + ) { this.el = er.nativeElement as HTMLDivElement; } diff --git a/packages/form/src/sf-item.component.ts b/packages/form/src/sf-item.component.ts index d08856271..e9ea85227 100644 --- a/packages/form/src/sf-item.component.ts +++ b/packages/form/src/sf-item.component.ts @@ -45,7 +45,10 @@ export class SFItemComponent implements OnInit, OnChanges, OnDestroy { @ViewChild('target', { read: ViewContainerRef, static: true }) private container!: ViewContainerRef; - constructor(private widgetFactory: WidgetFactory, private terminator: TerminatorService) {} + constructor( + private widgetFactory: WidgetFactory, + private terminator: TerminatorService + ) {} onWidgetInstanciated(widget: Widget): void { this.widget = widget; diff --git a/packages/form/src/validator.factory.ts b/packages/form/src/validator.factory.ts index fe54438c7..0876605d6 100644 --- a/packages/form/src/validator.factory.ts +++ b/packages/form/src/validator.factory.ts @@ -25,7 +25,10 @@ export class AjvSchemaValidatorFactory extends SchemaValidatorFactory { protected ajv!: Ajv; protected options!: AlainSFConfig; - constructor(@Inject(AlainConfigService) cogSrv: AlainConfigService, private ngZone: NgZone) { + constructor( + @Inject(AlainConfigService) cogSrv: AlainConfigService, + private ngZone: NgZone + ) { super(); if (!(typeof document === 'object' && !!document)) { return; diff --git a/packages/form/src/widgets/array/array.widget.spec.ts b/packages/form/src/widgets/array/array.widget.spec.ts index 4cfb9d26b..01ad4d2c1 100644 --- a/packages/form/src/widgets/array/array.widget.spec.ts +++ b/packages/form/src/widgets/array/array.widget.spec.ts @@ -5,10 +5,10 @@ import { createTestContext } from '@delon/testing'; import { deepCopy } from '@delon/util/other'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { SFArrayWidgetSchema } from './schema'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { ArrayProperty, FormProperty } from '../../model'; import { SFSchema } from '../../schema'; -import { SFArrayWidgetSchema } from './schema'; describe('form: widget: array', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/autocomplete/autocomplete.widget.spec.ts b/packages/form/src/widgets/autocomplete/autocomplete.widget.spec.ts index 6e7ff46aa..4da11bcb5 100644 --- a/packages/form/src/widgets/autocomplete/autocomplete.widget.spec.ts +++ b/packages/form/src/widgets/autocomplete/autocomplete.widget.spec.ts @@ -6,11 +6,11 @@ import { createTestContext } from '@delon/testing'; import { AlainConfigService } from '@delon/util/config'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { AutoCompleteWidget } from './autocomplete.widget'; +import { SFAutoCompleteWidgetSchema } from './schema'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema, SFSchemaEnum } from '../../../src/schema/index'; import { mergeConfig } from '../../config'; -import { AutoCompleteWidget } from './autocomplete.widget'; -import { SFAutoCompleteWidgetSchema } from './schema'; describe('form: widget: autocomplete', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/autocomplete/autocomplete.widget.ts b/packages/form/src/widgets/autocomplete/autocomplete.widget.ts index ad4fbc308..2a0acb9fd 100644 --- a/packages/form/src/widgets/autocomplete/autocomplete.widget.ts +++ b/packages/form/src/widgets/autocomplete/autocomplete.widget.ts @@ -5,11 +5,11 @@ import { Observable, of, debounceTime, map, mergeMap, startWith, takeUntil } fro import { NzAutocompleteOptionComponent } from 'ng-zorro-antd/auto-complete'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { SFAutoCompleteWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getCopyEnum, getEnum, toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFAutoCompleteWidgetSchema } from './schema'; @Component({ selector: 'sf-autocomplete', diff --git a/packages/form/src/widgets/boolean/boolean.widget.ts b/packages/form/src/widgets/boolean/boolean.widget.ts index 14ff6f23b..46fdb5135 100644 --- a/packages/form/src/widgets/boolean/boolean.widget.ts +++ b/packages/form/src/widgets/boolean/boolean.widget.ts @@ -1,7 +1,7 @@ import { Component, ViewEncapsulation } from '@angular/core'; -import { ControlUIWidget } from '../../widget'; import { SFBooleanWidgetSchema } from './schema'; +import { ControlUIWidget } from '../../widget'; @Component({ selector: 'sf-boolean', diff --git a/packages/form/src/widgets/cascader/cascader.widget.spec.ts b/packages/form/src/widgets/cascader/cascader.widget.spec.ts index 641ca3b84..f0c60873a 100644 --- a/packages/form/src/widgets/cascader/cascader.widget.spec.ts +++ b/packages/form/src/widgets/cascader/cascader.widget.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { createTestContext } from '@delon/testing'; -import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { CascaderWidget } from './cascader.widget'; +import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; describe('form: widget: cascader', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/cascader/cascader.widget.ts b/packages/form/src/widgets/cascader/cascader.widget.ts index e7be295ef..63ff4b810 100644 --- a/packages/form/src/widgets/cascader/cascader.widget.ts +++ b/packages/form/src/widgets/cascader/cascader.widget.ts @@ -3,11 +3,11 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { NzCascaderOption } from 'ng-zorro-antd/cascader'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { SFCascaderWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getData, toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFCascaderWidgetSchema } from './schema'; @Component({ selector: 'sf-cascader', diff --git a/packages/form/src/widgets/cascader/schema.ts b/packages/form/src/widgets/cascader/schema.ts index 16d6e9487..09f7068c4 100644 --- a/packages/form/src/widgets/cascader/schema.ts +++ b/packages/form/src/widgets/cascader/schema.ts @@ -1,8 +1,8 @@ import { NzCascaderExpandTrigger, NzCascaderOption, NzShowSearchOptions } from 'ng-zorro-antd/cascader'; import { NgStyleInterface, NzSafeAny } from 'ng-zorro-antd/core/types'; -import { SFUISchemaItem } from '../../schema/ui'; import { CascaderWidget } from './cascader.widget'; +import { SFUISchemaItem } from '../../schema/ui'; export interface SFCascaderWidgetSchema extends SFUISchemaItem { /** diff --git a/packages/form/src/widgets/checkbox/checkbox.widget.spec.ts b/packages/form/src/widgets/checkbox/checkbox.widget.spec.ts index b3ad4c5e2..6ebb698bf 100644 --- a/packages/form/src/widgets/checkbox/checkbox.widget.spec.ts +++ b/packages/form/src/widgets/checkbox/checkbox.widget.spec.ts @@ -4,9 +4,9 @@ import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { createTestContext } from '@delon/testing'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { CheckboxWidget } from './checkbox.widget'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../schema'; -import { CheckboxWidget } from './checkbox.widget'; describe('form: widget: checkbox', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/checkbox/checkbox.widget.ts b/packages/form/src/widgets/checkbox/checkbox.widget.ts index dd0809e1a..f9a36a977 100644 --- a/packages/form/src/widgets/checkbox/checkbox.widget.ts +++ b/packages/form/src/widgets/checkbox/checkbox.widget.ts @@ -1,10 +1,10 @@ import { Component, ViewEncapsulation } from '@angular/core'; +import { SFCheckboxWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getData } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFCheckboxWidgetSchema } from './schema'; @Component({ selector: 'sf-checkbox', diff --git a/packages/form/src/widgets/custom/custom.widget.ts b/packages/form/src/widgets/custom/custom.widget.ts index 44b441a49..4a6eced7d 100644 --- a/packages/form/src/widgets/custom/custom.widget.ts +++ b/packages/form/src/widgets/custom/custom.widget.ts @@ -1,7 +1,7 @@ import { Component, ViewEncapsulation } from '@angular/core'; -import { ControlUIWidget } from '../../widget'; import { SFCustomWidgetSchema } from './schema'; +import { ControlUIWidget } from '../../widget'; @Component({ selector: 'sf-custom', diff --git a/packages/form/src/widgets/custom/sf-template.directive.ts b/packages/form/src/widgets/custom/sf-template.directive.ts index 1fe4be4ce..c4dbf5b8e 100644 --- a/packages/form/src/widgets/custom/sf-template.directive.ts +++ b/packages/form/src/widgets/custom/sf-template.directive.ts @@ -9,7 +9,10 @@ import { SFComponent } from '../../sf.component'; export class SFTemplateDirective implements OnInit { @Input('sf-template') path!: string; - constructor(private templateRef: TemplateRef, private table: SFComponent) {} + constructor( + private templateRef: TemplateRef, + private table: SFComponent + ) {} ngOnInit(): void { this.table._addTpl(this.path.startsWith(SF_SEQ) ? this.path : SF_SEQ + this.path, this.templateRef); diff --git a/packages/form/src/widgets/date/date.widget.spec.ts b/packages/form/src/widgets/date/date.widget.spec.ts index a2ccc6780..9456a462d 100644 --- a/packages/form/src/widgets/date/date.widget.spec.ts +++ b/packages/form/src/widgets/date/date.widget.spec.ts @@ -9,10 +9,10 @@ import { createTestContext } from '@delon/testing'; import { deepCopy } from '@delon/util/other'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; -import { SFSchema } from '../../../src/schema/index'; import { DateWidget } from './date.widget'; import { SFDateWidgetSchema } from './schema'; +import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; +import { SFSchema } from '../../../src/schema/index'; registerLocaleData(zh); @@ -80,7 +80,11 @@ describe('form: widget: date', () => { const s: SFSchema = { properties: { a: { type: 'string', format: 'date-time', ui: { widget } } } }; - page.newSchema(s).checkValue('a', null).setValue('a', new Date(2019, 0, 1)).dc(1); + page + .newSchema(s) + .checkValue('a', null) + .setValue('a', new Date(2019, 0, 1)) + .dc(1); flush(); const ipt = page.getEl('.ant-picker-input input') as HTMLInputElement; expect(ipt.value).toContain(`2019-01-01`); diff --git a/packages/form/src/widgets/date/date.widget.ts b/packages/form/src/widgets/date/date.widget.ts index 8a67e26b5..e1af4be7f 100644 --- a/packages/form/src/widgets/date/date.widget.ts +++ b/packages/form/src/widgets/date/date.widget.ts @@ -5,11 +5,11 @@ import { format } from 'date-fns'; import { toDate } from '@delon/util/date-time'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { SFDateWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { FormProperty } from '../../model/form.property'; import { toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFDateWidgetSchema } from './schema'; @Component({ selector: 'sf-date', diff --git a/packages/form/src/widgets/mention/mention.widget.spec.ts b/packages/form/src/widgets/mention/mention.widget.spec.ts index 5966272b7..ed1cf6330 100644 --- a/packages/form/src/widgets/mention/mention.widget.spec.ts +++ b/packages/form/src/widgets/mention/mention.widget.spec.ts @@ -5,9 +5,9 @@ import { of } from 'rxjs'; import { createTestContext } from '@delon/testing'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { MentionWidget } from './mention.widget'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../../src/schema/index'; -import { MentionWidget } from './mention.widget'; const DATA = ['asdf', 'cipchk', '中文', 'にほんご']; diff --git a/packages/form/src/widgets/mention/mention.widget.ts b/packages/form/src/widgets/mention/mention.widget.ts index 8ba2bfe8d..3e1f88d72 100644 --- a/packages/form/src/widgets/mention/mention.widget.ts +++ b/packages/form/src/widgets/mention/mention.widget.ts @@ -4,11 +4,11 @@ import { map, tap } from 'rxjs'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; import { MentionOnSearchTypes, NzMentionComponent } from 'ng-zorro-antd/mention'; +import { SFMentionWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getData, getEnum } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFMentionWidgetSchema } from './schema'; @Component({ selector: 'sf-mention', diff --git a/packages/form/src/widgets/number/number.widget.spec.ts b/packages/form/src/widgets/number/number.widget.spec.ts index e693b9814..a72b8e618 100644 --- a/packages/form/src/widgets/number/number.widget.spec.ts +++ b/packages/form/src/widgets/number/number.widget.spec.ts @@ -3,9 +3,9 @@ import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { createTestContext } from '@delon/testing'; +import { SFNumberWidgetSchema } from './schema'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../../src/schema/index'; -import { SFNumberWidgetSchema } from './schema'; describe('form: widget: number', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/number/number.widget.ts b/packages/form/src/widgets/number/number.widget.ts index a23f746e9..b7cb06313 100644 --- a/packages/form/src/widgets/number/number.widget.ts +++ b/packages/form/src/widgets/number/number.widget.ts @@ -1,7 +1,7 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; -import { ControlUIWidget } from '../../widget'; import { SFNumberWidgetSchema } from './schema'; +import { ControlUIWidget } from '../../widget'; @Component({ selector: 'sf-number', diff --git a/packages/form/src/widgets/nz-widget.registry.ts b/packages/form/src/widgets/nz-widget.registry.ts index 473a43e96..089889450 100644 --- a/packages/form/src/widgets/nz-widget.registry.ts +++ b/packages/form/src/widgets/nz-widget.registry.ts @@ -1,4 +1,3 @@ -import { WidgetRegistry } from '../widget.factory'; import { ArrayWidget } from './array/array.widget'; import { AutoCompleteWidget } from './autocomplete/autocomplete.widget'; import { BooleanWidget } from './boolean/boolean.widget'; @@ -21,6 +20,7 @@ import { TimeWidget } from './time/time.widget'; import { TransferWidget } from './transfer/transfer.widget'; import { TreeSelectWidget } from './tree-select/tree-select.widget'; import { UploadWidget } from './upload/upload.widget'; +import { WidgetRegistry } from '../widget.factory'; export class NzWidgetRegistry extends WidgetRegistry { constructor() { diff --git a/packages/form/src/widgets/object/object.widget.spec.ts b/packages/form/src/widgets/object/object.widget.spec.ts index f842a6845..6ff132301 100644 --- a/packages/form/src/widgets/object/object.widget.spec.ts +++ b/packages/form/src/widgets/object/object.widget.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { createTestContext } from '@delon/testing'; -import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFObjectWidgetSchema } from './schema'; +import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; describe('form: widget: object', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/object/object.widget.ts b/packages/form/src/widgets/object/object.widget.ts index aa58db7ee..7f5ec73e7 100644 --- a/packages/form/src/widgets/object/object.widget.ts +++ b/packages/form/src/widgets/object/object.widget.ts @@ -2,12 +2,12 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import type { SFObjectWidgetRenderType } from './schema'; import { ArrayProperty } from '../../model/array.property'; import { FormProperty } from '../../model/form.property'; import type { SFGridSchema } from '../../schema/ui'; import { toBool } from '../../utils'; import { ObjectLayoutWidget } from '../../widget'; -import type { SFObjectWidgetRenderType } from './schema'; @Component({ selector: 'sf-object', diff --git a/packages/form/src/widgets/radio/radio.widget.ts b/packages/form/src/widgets/radio/radio.widget.ts index 6f9f94e91..8b5fe120a 100644 --- a/packages/form/src/widgets/radio/radio.widget.ts +++ b/packages/form/src/widgets/radio/radio.widget.ts @@ -1,10 +1,10 @@ import { Component, ViewEncapsulation } from '@angular/core'; +import { SFRadioWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema/index'; import { getData } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFRadioWidgetSchema } from './schema'; @Component({ selector: 'sf-radio', diff --git a/packages/form/src/widgets/rate/rate.widget.ts b/packages/form/src/widgets/rate/rate.widget.ts index 2661e1796..fd4e565b9 100644 --- a/packages/form/src/widgets/rate/rate.widget.ts +++ b/packages/form/src/widgets/rate/rate.widget.ts @@ -1,8 +1,8 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { SFRateWidgetSchema } from './schema'; import { toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFRateWidgetSchema } from './schema'; @Component({ selector: 'sf-rate', diff --git a/packages/form/src/widgets/select/select.widget.spec.ts b/packages/form/src/widgets/select/select.widget.spec.ts index 46f0c371e..c0c165a3b 100644 --- a/packages/form/src/widgets/select/select.widget.spec.ts +++ b/packages/form/src/widgets/select/select.widget.spec.ts @@ -3,10 +3,10 @@ import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { createTestContext } from '@delon/testing'; -import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; -import { SFSchema, SFSchemaEnumType } from '../../../src/schema/index'; import { SFSelectWidgetSchema } from './schema'; import { SelectWidget } from './select.widget'; +import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; +import { SFSchema, SFSchemaEnumType } from '../../../src/schema/index'; describe('form: widget: select', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/select/select.widget.ts b/packages/form/src/widgets/select/select.widget.ts index 4aaa7aaf8..ee30884f4 100644 --- a/packages/form/src/widgets/select/select.widget.ts +++ b/packages/form/src/widgets/select/select.widget.ts @@ -4,11 +4,11 @@ import { Subject, catchError, debounceTime, distinctUntilChanged, switchMap, tak import { ArrayService } from '@delon/util/array'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { SFSelectWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getData, toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFSelectWidgetSchema } from './schema'; @Component({ selector: 'sf-select', diff --git a/packages/form/src/widgets/slider/slider.widget.spec.ts b/packages/form/src/widgets/slider/slider.widget.spec.ts index 3af6d60ea..190fe6396 100644 --- a/packages/form/src/widgets/slider/slider.widget.spec.ts +++ b/packages/form/src/widgets/slider/slider.widget.spec.ts @@ -5,9 +5,9 @@ import { createTestContext } from '@delon/testing'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzSliderComponent } from 'ng-zorro-antd/slider'; +import { SliderWidget } from './slider.widget'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../../src/schema/index'; -import { SliderWidget } from './slider.widget'; describe('form: widget: slider', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/slider/slider.widget.ts b/packages/form/src/widgets/slider/slider.widget.ts index f508e76d8..459b4a883 100644 --- a/packages/form/src/widgets/slider/slider.widget.ts +++ b/packages/form/src/widgets/slider/slider.widget.ts @@ -2,8 +2,8 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { NzMarks, NzSliderValue } from 'ng-zorro-antd/slider'; -import { ControlUIWidget } from '../../widget'; import { SFSliderWidgetSchema } from './schema'; +import { ControlUIWidget } from '../../widget'; @Component({ selector: 'sf-slider', diff --git a/packages/form/src/widgets/string/string.widget.spec.ts b/packages/form/src/widgets/string/string.widget.spec.ts index 4eb86b2d2..3fd0da422 100644 --- a/packages/form/src/widgets/string/string.widget.spec.ts +++ b/packages/form/src/widgets/string/string.widget.spec.ts @@ -4,9 +4,9 @@ import { of } from 'rxjs'; import { createTestContext } from '@delon/testing'; +import { SFStringWidgetSchema } from './schema'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../schema'; -import { SFStringWidgetSchema } from './schema'; describe('form: widget: string', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/string/string.widget.ts b/packages/form/src/widgets/string/string.widget.ts index c929082d9..e59e85d44 100644 --- a/packages/form/src/widgets/string/string.widget.ts +++ b/packages/form/src/widgets/string/string.widget.ts @@ -1,9 +1,9 @@ import { Component, ElementRef, OnInit, ViewEncapsulation } from '@angular/core'; import { BehaviorSubject, debounceTime, switchMap, takeUntil } from 'rxjs'; +import { SFStringWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { ControlUIWidget } from '../../widget'; -import { SFStringWidgetSchema } from './schema'; @Component({ selector: 'sf-string', diff --git a/packages/form/src/widgets/tag/tag.widget.ts b/packages/form/src/widgets/tag/tag.widget.ts index 917788e6b..52a0e81aa 100644 --- a/packages/form/src/widgets/tag/tag.widget.ts +++ b/packages/form/src/widgets/tag/tag.widget.ts @@ -1,10 +1,10 @@ import { Component, ViewEncapsulation } from '@angular/core'; +import { SFTagWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getData } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFTagWidgetSchema } from './schema'; @Component({ selector: 'sf-tag', diff --git a/packages/form/src/widgets/text/text.widget.spec.ts b/packages/form/src/widgets/text/text.widget.spec.ts index 3d12fca14..da1fb87c0 100644 --- a/packages/form/src/widgets/text/text.widget.spec.ts +++ b/packages/form/src/widgets/text/text.widget.spec.ts @@ -3,9 +3,9 @@ import { ComponentFixture } from '@angular/core/testing'; import { createTestContext } from '@delon/testing'; +import { SFTextWidgetSchema } from './schema'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../../src/schema/index'; -import { SFTextWidgetSchema } from './schema'; describe('form: widget: text', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/text/text.widget.ts b/packages/form/src/widgets/text/text.widget.ts index 9e0be96b3..5a8106354 100644 --- a/packages/form/src/widgets/text/text.widget.ts +++ b/packages/form/src/widgets/text/text.widget.ts @@ -1,9 +1,9 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { SFTextWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFTextWidgetSchema } from './schema'; @Component({ selector: 'sf-text', diff --git a/packages/form/src/widgets/textarea/textarea.widget.spec.ts b/packages/form/src/widgets/textarea/textarea.widget.spec.ts index 0bb4790c7..1dfae2759 100644 --- a/packages/form/src/widgets/textarea/textarea.widget.spec.ts +++ b/packages/form/src/widgets/textarea/textarea.widget.spec.ts @@ -3,9 +3,9 @@ import { ComponentFixture, fakeAsync } from '@angular/core/testing'; import { createTestContext } from '@delon/testing'; +import { SFTextareaWidgetSchema } from './schema'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../../src/schema/index'; -import { SFTextareaWidgetSchema } from './schema'; describe('form: widget: textarea', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/textarea/textarea.widget.ts b/packages/form/src/widgets/textarea/textarea.widget.ts index 003c20bde..24e124c3b 100644 --- a/packages/form/src/widgets/textarea/textarea.widget.ts +++ b/packages/form/src/widgets/textarea/textarea.widget.ts @@ -2,8 +2,8 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import type { AutoSizeType } from 'ng-zorro-antd/input'; -import { ControlUIWidget } from '../../widget'; import { SFTextareaWidgetSchema } from './schema'; +import { ControlUIWidget } from '../../widget'; @Component({ selector: 'sf-textarea', diff --git a/packages/form/src/widgets/time/time.widget.spec.ts b/packages/form/src/widgets/time/time.widget.spec.ts index ef856c1bc..4d07cdd40 100644 --- a/packages/form/src/widgets/time/time.widget.spec.ts +++ b/packages/form/src/widgets/time/time.widget.spec.ts @@ -5,9 +5,9 @@ import { format } from 'date-fns'; import { createTestContext } from '@delon/testing'; +import { TimeWidget } from './time.widget'; import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { SFSchema } from '../../../src/schema/index'; -import { TimeWidget } from './time.widget'; const FORMAT = 'yyyy-MM-dd HH:mm:ss'; diff --git a/packages/form/src/widgets/time/time.widget.ts b/packages/form/src/widgets/time/time.widget.ts index 3c8102783..e3cfbd59c 100644 --- a/packages/form/src/widgets/time/time.widget.ts +++ b/packages/form/src/widgets/time/time.widget.ts @@ -4,10 +4,10 @@ import { format } from 'date-fns'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { SFTimeWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFTimeWidgetSchema } from './schema'; @Component({ selector: 'sf-time', diff --git a/packages/form/src/widgets/transfer/transfer.widget.ts b/packages/form/src/widgets/transfer/transfer.widget.ts index 2a798355a..7b87eb1aa 100644 --- a/packages/form/src/widgets/transfer/transfer.widget.ts +++ b/packages/form/src/widgets/transfer/transfer.widget.ts @@ -10,11 +10,11 @@ import { TransferSelectChange } from 'ng-zorro-antd/transfer'; +import { SFTransferWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getData } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFTransferWidgetSchema } from './schema'; @Component({ selector: 'sf-transfer', diff --git a/packages/form/src/widgets/tree-select/tree-select.widget.ts b/packages/form/src/widgets/tree-select/tree-select.widget.ts index c09e16475..9b67ec3ce 100644 --- a/packages/form/src/widgets/tree-select/tree-select.widget.ts +++ b/packages/form/src/widgets/tree-select/tree-select.widget.ts @@ -2,11 +2,11 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/core/tree'; +import { SFTreeSelectWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { SFSchemaEnum } from '../../schema'; import { getData, toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFTreeSelectWidgetSchema } from './schema'; @Component({ selector: 'sf-tree-select', diff --git a/packages/form/src/widgets/upload/upload.widget.spec.ts b/packages/form/src/widgets/upload/upload.widget.spec.ts index df1f91f34..48f7a8746 100644 --- a/packages/form/src/widgets/upload/upload.widget.spec.ts +++ b/packages/form/src/widgets/upload/upload.widget.spec.ts @@ -7,8 +7,8 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzModalService } from 'ng-zorro-antd/modal'; import { NzUploadComponent } from 'ng-zorro-antd/upload'; -import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; import { UploadWidget } from './upload.widget'; +import { configureSFTestSuite, SFPage, TestFormComponent } from '../../../spec/base.spec'; describe('form: widget: upload', () => { let fixture: ComponentFixture; diff --git a/packages/form/src/widgets/upload/upload.widget.ts b/packages/form/src/widgets/upload/upload.widget.ts index 90badc738..49ecf797b 100644 --- a/packages/form/src/widgets/upload/upload.widget.ts +++ b/packages/form/src/widgets/upload/upload.widget.ts @@ -6,10 +6,10 @@ import type { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzModalService } from 'ng-zorro-antd/modal'; import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload'; +import { SFUploadWidgetSchema } from './schema'; import { SFValue } from '../../interface'; import { getData, toBool } from '../../utils'; import { ControlUIWidget } from '../../widget'; -import { SFUploadWidgetSchema } from './schema'; @Component({ selector: 'sf-upload', diff --git a/packages/mock/src/mock.interceptor.ts b/packages/mock/src/mock.interceptor.ts index 3c3ee4194..f58fea69b 100644 --- a/packages/mock/src/mock.interceptor.ts +++ b/packages/mock/src/mock.interceptor.ts @@ -20,7 +20,10 @@ import { MockService } from './mock.service'; import { MockStatusError } from './status.error'; class HttpMockInterceptorHandler implements HttpHandler { - constructor(private next: HttpHandler, private interceptor: HttpInterceptor) {} + constructor( + private next: HttpHandler, + private interceptor: HttpInterceptor + ) {} handle(req: HttpRequest): Observable> { return this.interceptor.intercept(req, this.next); diff --git a/packages/mock/src/mock.service.spec.ts b/packages/mock/src/mock.service.spec.ts index 7fcfccd77..915f09df8 100644 --- a/packages/mock/src/mock.service.spec.ts +++ b/packages/mock/src/mock.service.spec.ts @@ -5,9 +5,9 @@ import * as Mock from 'mockjs'; import { AlainMockConfig, ALAIN_CONFIG } from '@delon/util/config'; -import { DelonMockModule } from '../index'; import { MockOptions, MockRequest, MockRule } from './interface'; import { MockService } from './mock.service'; +import { DelonMockModule } from '../index'; const DATA = { USERS: { diff --git a/packages/mock/src/status.error.ts b/packages/mock/src/status.error.ts index acecc5b7f..a6e123c1b 100644 --- a/packages/mock/src/status.error.ts +++ b/packages/mock/src/status.error.ts @@ -3,5 +3,8 @@ export class MockStatusError { statusText?: string; - constructor(public status: number, public error?: any) {} + constructor( + public status: number, + public error?: any + ) {} } diff --git a/packages/theme/layout-default/layout-header.component.ts b/packages/theme/layout-default/layout-header.component.ts index 5a182b97f..a25cfa3c8 100644 --- a/packages/theme/layout-default/layout-header.component.ts +++ b/packages/theme/layout-default/layout-header.component.ts @@ -86,7 +86,11 @@ export class LayoutDefaultHeaderComponent implements AfterViewInit, OnDestroy { return this.srv.collapsedIcon; } - constructor(private srv: LayoutDefaultService, private settings: SettingsService, private cdr: ChangeDetectorRef) {} + constructor( + private srv: LayoutDefaultService, + private settings: SettingsService, + private cdr: ChangeDetectorRef + ) {} private refresh(): void { const arr = this.items.toArray(); diff --git a/packages/theme/layout-default/layout.component.spec.ts b/packages/theme/layout-default/layout.component.spec.ts index d554c389e..211a9cf06 100644 --- a/packages/theme/layout-default/layout.component.spec.ts +++ b/packages/theme/layout-default/layout.component.spec.ts @@ -8,12 +8,12 @@ import { createTestContext } from '@delon/testing'; import { NzIconTestModule } from 'ng-zorro-antd/icon/testing'; import { NzMessageService } from 'ng-zorro-antd/message'; -import { SettingsService } from '../src/services/settings/settings.service'; -import { AlainThemeModule } from '../src/theme.module'; import { LayoutDefaultComponent } from './layout.component'; import { LayoutDefaultModule } from './layout.module'; import { LayoutDefaultService } from './layout.service'; import { LayoutDefaultOptions } from './types'; +import { SettingsService } from '../src/services/settings/settings.service'; +import { AlainThemeModule } from '../src/theme.module'; describe('theme: layout-default', () => { let fixture: ComponentFixture; diff --git a/packages/theme/src/pipes/date/date.pipe.spec.ts b/packages/theme/src/pipes/date/date.pipe.spec.ts index e03fe241e..9226f5786 100644 --- a/packages/theme/src/pipes/date/date.pipe.spec.ts +++ b/packages/theme/src/pipes/date/date.pipe.spec.ts @@ -59,7 +59,7 @@ describe('Pipe: _date', () => { }); @Component({ - template: `

{{ value | _date : format }}

` + template: `

{{ value | _date: format }}

` }) class TestComponent { value?: Date | string | number; diff --git a/packages/theme/src/pipes/yn/yn.pipe.spec.ts b/packages/theme/src/pipes/yn/yn.pipe.spec.ts index 036a25547..c2868293f 100644 --- a/packages/theme/src/pipes/yn/yn.pipe.spec.ts +++ b/packages/theme/src/pipes/yn/yn.pipe.spec.ts @@ -2,8 +2,8 @@ import { Component } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { AlainThemeModule } from '../../theme.module'; import { YNMode } from './yn.pipe'; +import { AlainThemeModule } from '../../theme.module'; describe('Pipe: yn', () => { let fixture: ComponentFixture; @@ -85,7 +85,7 @@ describe('Pipe: yn', () => { }); @Component({ - template: `
` + template: `
` }) class TestComponent { value = true; diff --git a/packages/theme/src/services/drawer/drawer.spec.ts b/packages/theme/src/services/drawer/drawer.spec.ts index f53aa34d5..29bab5f51 100644 --- a/packages/theme/src/services/drawer/drawer.spec.ts +++ b/packages/theme/src/services/drawer/drawer.spec.ts @@ -5,8 +5,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NzDrawerModule, NzDrawerRef } from 'ng-zorro-antd/drawer'; -import { AlainThemeModule } from '../../theme.module'; import { DrawerHelper } from './drawer.helper'; +import { AlainThemeModule } from '../../theme.module'; describe('theme: DrawerHelper', () => { let drawer: DrawerHelper; diff --git a/packages/theme/src/services/http/http.client.ts b/packages/theme/src/services/http/http.client.ts index c59fb9db0..6e1d63032 100644 --- a/packages/theme/src/services/http/http.client.ts +++ b/packages/theme/src/services/http/http.client.ts @@ -18,7 +18,10 @@ export type HttpObserve = 'body' | 'events' | 'response'; @Injectable({ providedIn: 'root' }) export class _HttpClient { private cog: AlainThemeHttpClientConfig; - constructor(private http: HttpClient, cogSrv: AlainConfigService) { + constructor( + private http: HttpClient, + cogSrv: AlainConfigService + ) { this.cog = cogSrv.merge('themeHttp', { nullValueHandling: 'include', dateValueHandling: 'timestamp' diff --git a/packages/theme/src/services/i18n/i18n.spec.ts b/packages/theme/src/services/i18n/i18n.spec.ts index db45c25b9..9f86ae4c0 100644 --- a/packages/theme/src/services/i18n/i18n.spec.ts +++ b/packages/theme/src/services/i18n/i18n.spec.ts @@ -6,9 +6,9 @@ import { RouterTestingModule } from '@angular/router/testing'; import { AlainConfig, ALAIN_CONFIG } from '@delon/util/config'; -import { AlainThemeModule } from '../../theme.module'; import { AlainI18NService, ALAIN_I18N_TOKEN } from './i18n'; import { AlainI18NGuard } from './i18n-url.guard'; +import { AlainThemeModule } from '../../theme.module'; describe('theme: i18n', () => { let fixture: ComponentFixture; @@ -151,7 +151,7 @@ describe('theme: i18n', () => { @Component({ template: `
{{ key | i18n }}
-
{{ key | i18n : params }}
+
{{ key | i18n: params }}
` }) class TestComponent { diff --git a/packages/theme/src/services/menu/menu.service.spec.ts b/packages/theme/src/services/menu/menu.service.spec.ts index 1d62222ba..671c535e7 100644 --- a/packages/theme/src/services/menu/menu.service.spec.ts +++ b/packages/theme/src/services/menu/menu.service.spec.ts @@ -5,9 +5,9 @@ import { ACLService } from '@delon/acl'; import { deepCopy } from '@delon/util/other'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { AlainI18NServiceFake, ALAIN_I18N_TOKEN } from '../i18n/i18n'; import { Menu, MenuInner } from './interface'; import { MenuService } from './menu.service'; +import { AlainI18NServiceFake, ALAIN_I18N_TOKEN } from '../i18n/i18n'; class MockACLService { can(val: string): boolean { diff --git a/packages/theme/src/services/menu/menu.service.ts b/packages/theme/src/services/menu/menu.service.ts index ca5f36360..162cb4c60 100644 --- a/packages/theme/src/services/menu/menu.service.ts +++ b/packages/theme/src/services/menu/menu.service.ts @@ -4,8 +4,8 @@ import { BehaviorSubject, Observable, Subscription, share } from 'rxjs'; import { ACLService } from '@delon/acl'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { AlainI18NService, ALAIN_I18N_TOKEN } from '../i18n/i18n'; import { Menu, MenuIcon, MenuInner } from './interface'; +import { AlainI18NService, ALAIN_I18N_TOKEN } from '../i18n/i18n'; /** * 菜单服务,[在线文档](https://ng-alain.com/theme/menu) diff --git a/packages/theme/src/services/modal/modal.helper.ts b/packages/theme/src/services/modal/modal.helper.ts index 2af723ffc..15a745d3d 100644 --- a/packages/theme/src/services/modal/modal.helper.ts +++ b/packages/theme/src/services/modal/modal.helper.ts @@ -41,7 +41,11 @@ export class ModalHelper { private document: Document; private dragClsPrefix = 'MODAL-DRAG'; - constructor(private srv: NzModalService, private drag: DragDrop, @Inject(DOCUMENT) doc: NzSafeAny) { + constructor( + private srv: NzModalService, + private drag: DragDrop, + @Inject(DOCUMENT) doc: NzSafeAny + ) { this.document = doc; } diff --git a/packages/theme/src/services/modal/modal.spec.ts b/packages/theme/src/services/modal/modal.spec.ts index 19f4678d0..ad36fb377 100644 --- a/packages/theme/src/services/modal/modal.spec.ts +++ b/packages/theme/src/services/modal/modal.spec.ts @@ -5,8 +5,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NZ_MODAL_DATA, NzModalModule, NzModalRef } from 'ng-zorro-antd/modal'; -import { AlainThemeModule } from '../../theme.module'; import { ModalHelper } from './modal.helper'; +import { AlainThemeModule } from '../../theme.module'; describe('theme: ModalHelper', () => { let modal: ModalHelper; @@ -158,7 +158,10 @@ class TestModalComponent { id = ''; ret = 'true'; - constructor(private modal: NzModalRef, @Inject(NZ_MODAL_DATA) public data: { ret: string }) { + constructor( + private modal: NzModalRef, + @Inject(NZ_MODAL_DATA) public data: { ret: string } + ) { setTimeout(() => { if (this.ret === 'destroy') { this.modal.destroy(); diff --git a/packages/theme/src/services/rtl/rtl.service.spec.ts b/packages/theme/src/services/rtl/rtl.service.spec.ts index ffc6b2dbb..b7e568c7d 100644 --- a/packages/theme/src/services/rtl/rtl.service.spec.ts +++ b/packages/theme/src/services/rtl/rtl.service.spec.ts @@ -2,8 +2,8 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { AlainThemeModule } from '../../theme.module'; import { LTR, RTL, RTLService } from './rtl.service'; +import { AlainThemeModule } from '../../theme.module'; describe('Service: RTL', () => { let srv: RTLService; diff --git a/packages/theme/src/services/settings/settings.service.ts b/packages/theme/src/services/settings/settings.service.ts index 363cbc925..8b7d54a37 100644 --- a/packages/theme/src/services/settings/settings.service.ts +++ b/packages/theme/src/services/settings/settings.service.ts @@ -24,7 +24,10 @@ export class SettingsService { let srv: SettingsService; diff --git a/packages/theme/src/services/title/title.service.spec.ts b/packages/theme/src/services/title/title.service.spec.ts index ade1dd656..774ed4ced 100644 --- a/packages/theme/src/services/title/title.service.spec.ts +++ b/packages/theme/src/services/title/title.service.spec.ts @@ -7,11 +7,11 @@ import { of } from 'rxjs'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { RouteTitle, TitleService } from './title.service'; import { AlainThemeModule } from '../../theme.module'; import { AlainI18NService, AlainI18NServiceFake, ALAIN_I18N_TOKEN } from '../i18n/i18n'; import { Menu } from '../menu/interface'; import { MenuService } from '../menu/menu.service'; -import { RouteTitle, TitleService } from './title.service'; describe('Service: Title', () => { let getPathByUrlData: NzSafeAny; diff --git a/packages/util/browser/cookie.service.ts b/packages/util/browser/cookie.service.ts index 74ca34ac0..b53438ce8 100644 --- a/packages/util/browser/cookie.service.ts +++ b/packages/util/browser/cookie.service.ts @@ -38,7 +38,10 @@ export class CookieService { return this.platform.isBrowser ? this.doc.cookie : ''; } - constructor(@Inject(DOCUMENT) private _doc: NzSafeAny, private platform: Platform) {} + constructor( + @Inject(DOCUMENT) private _doc: NzSafeAny, + private platform: Platform + ) {} /** * Get all cookie key-value pairs diff --git a/packages/util/browser/scroll.service.ts b/packages/util/browser/scroll.service.ts index 172a99974..6462913d7 100644 --- a/packages/util/browser/scroll.service.ts +++ b/packages/util/browser/scroll.service.ts @@ -15,7 +15,10 @@ export class ScrollService { return doc.defaultView || window; } - constructor(@Inject(DOCUMENT) private _doc: NzSafeAny, private platform: Platform) {} + constructor( + @Inject(DOCUMENT) private _doc: NzSafeAny, + private platform: Platform + ) {} /** * 获取滚动条位置 diff --git a/packages/util/form/validate.spec.ts b/packages/util/form/validate.spec.ts index 48aae21e2..c4ef92fe1 100644 --- a/packages/util/form/validate.spec.ts +++ b/packages/util/form/validate.spec.ts @@ -2,8 +2,8 @@ import { AbstractControl, FormControl, ValidationErrors } from '@angular/forms'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { TEST_DATA } from '../format/validate.spec'; import { _Validators } from './validators'; +import { TEST_DATA } from '../format/validate.spec'; describe('utils: form-validate', () => { function process(methodName: keyof typeof _Validators, data: Array<{ k: string; v: boolean }>): void { diff --git a/packages/util/math/in-range.spec.ts b/packages/util/math/in-range.spec.ts index 8016cb37b..5bf79919d 100644 --- a/packages/util/math/in-range.spec.ts +++ b/packages/util/math/in-range.spec.ts @@ -21,7 +21,9 @@ describe('util.inRange', () => { inRange(value, start, end); }).toThrow(); } else { - expect(inRange(value, start, end)).withContext(`${item.k} must be ${item.v}`).toBe(item.v); + expect(inRange(value, start, end)) + .withContext(`${item.k} must be ${item.v}`) + .toBe(item.v); } } }); diff --git a/packages/util/pipes/currency/cny.pipe.spec.ts b/packages/util/pipes/currency/cny.pipe.spec.ts index 2086c6844..3fa864624 100644 --- a/packages/util/pipes/currency/cny.pipe.spec.ts +++ b/packages/util/pipes/currency/cny.pipe.spec.ts @@ -30,7 +30,7 @@ describe('Pipe: cny', () => { }); @Component({ - template: `

{{ value | cny : options }}

` + template: `

{{ value | cny: options }}

` }) class TestComponent { value?: number; diff --git a/packages/util/pipes/currency/mega.pipe.spec.ts b/packages/util/pipes/currency/mega.pipe.spec.ts index b7950d192..3c3e02890 100644 --- a/packages/util/pipes/currency/mega.pipe.spec.ts +++ b/packages/util/pipes/currency/mega.pipe.spec.ts @@ -48,7 +48,7 @@ describe('Pipe: mega', () => { }); @Component({ - template: `

{{ value | mega : options }}

` + template: `

{{ value | mega: options }}

` }) class TestComponent { value?: number; diff --git a/packages/util/pipes/currency/mega.pipe.ts b/packages/util/pipes/currency/mega.pipe.ts index 95c3b2f3b..8ef856feb 100644 --- a/packages/util/pipes/currency/mega.pipe.ts +++ b/packages/util/pipes/currency/mega.pipe.ts @@ -5,7 +5,10 @@ import { CurrencyMegaOptions, CurrencyService } from '@delon/util/format'; @Pipe({ name: 'mega' }) export class CurrencyMegaPipe implements PipeTransform { private isCN = false; - constructor(private srv: CurrencyService, @Inject(LOCALE_ID) locale: string) { + constructor( + private srv: CurrencyService, + @Inject(LOCALE_ID) locale: string + ) { this.isCN = locale.startsWith('zh'); } diff --git a/packages/util/pipes/currency/price.pipe.spec.ts b/packages/util/pipes/currency/price.pipe.spec.ts index a7a9acc27..f95a985e5 100644 --- a/packages/util/pipes/currency/price.pipe.spec.ts +++ b/packages/util/pipes/currency/price.pipe.spec.ts @@ -30,7 +30,7 @@ describe('Pipe: price', () => { }); @Component({ - template: `

{{ value | price : options }}

` + template: `

{{ value | price: options }}

` }) class TestComponent { value?: number; diff --git a/packages/util/pipes/filter/filter.pipe.spec.ts b/packages/util/pipes/filter/filter.pipe.spec.ts index 67f52f152..a23b511d8 100644 --- a/packages/util/pipes/filter/filter.pipe.spec.ts +++ b/packages/util/pipes/filter/filter.pipe.spec.ts @@ -26,7 +26,7 @@ describe('Pipe: filter', () => { }); @Component({ - template: `

{{ list | filter : matcher : other }}

` + template: `

{{ list | filter: matcher : other }}

` }) class TestComponent { list = [1, 2, 3]; diff --git a/packages/util/pipes/format/mask.pipe.spec.ts b/packages/util/pipes/format/mask.pipe.spec.ts index bf30f1af9..ea67e6e89 100644 --- a/packages/util/pipes/format/mask.pipe.spec.ts +++ b/packages/util/pipes/format/mask.pipe.spec.ts @@ -21,7 +21,7 @@ describe('Pipe: mask', () => { }); @Component({ - template: `

{{ value | mask : maskStr }}

` + template: `

{{ value | mask: maskStr }}

` }) class TestComponent { value = '123'; diff --git a/schematics/application/index.ts b/schematics/application/index.ts index ad85ac2dd..9cecc1475 100644 --- a/schematics/application/index.ts +++ b/schematics/application/index.ts @@ -16,6 +16,7 @@ import { } from '@angular-devkit/schematics'; import { getWorkspace, updateWorkspace } from '@schematics/angular/utility/workspace'; +import { Schema as ApplicationOptions } from './schema'; import { getLangData } from '../core/lang.config'; import { addAllowedCommonJsDependencies, @@ -43,7 +44,6 @@ import { } from '../utils'; import { addImportNotation } from '../utils/less'; import { addESLintRule, UpgradeMainVersions } from '../utils/versions'; -import { Schema as ApplicationOptions } from './schema'; let project: ProjectDefinition; diff --git a/schematics/edit/index.ts b/schematics/edit/index.ts index 3ce31d10b..609bfb23d 100644 --- a/schematics/edit/index.ts +++ b/schematics/edit/index.ts @@ -1,7 +1,7 @@ import { chain, Rule } from '@angular-devkit/schematics'; -import { buildAlain } from '../utils'; import { Schema } from './schema'; +import { buildAlain } from '../utils'; export default function (options: Schema): Rule { return chain([buildAlain({ schematicName: 'edit', ...options })]); diff --git a/schematics/empty/index.ts b/schematics/empty/index.ts index 32dfc5576..f143634c8 100644 --- a/schematics/empty/index.ts +++ b/schematics/empty/index.ts @@ -1,7 +1,7 @@ import { chain, Rule } from '@angular-devkit/schematics'; -import { buildAlain } from '../utils'; import { Schema } from './schema'; +import { buildAlain } from '../utils'; export default function (options: Schema): Rule { return chain([buildAlain({ schematicName: 'empty', ...options })]); diff --git a/schematics/list/index.ts b/schematics/list/index.ts index 70b053e37..761dd4762 100644 --- a/schematics/list/index.ts +++ b/schematics/list/index.ts @@ -1,7 +1,7 @@ import { chain, Rule } from '@angular-devkit/schematics'; -import { buildAlain } from '../utils'; import { Schema } from './schema'; +import { buildAlain } from '../utils'; export default function (options: Schema): Rule { return chain([buildAlain({ schematicName: 'list', ...options })]); diff --git a/schematics/module/index.spec.ts b/schematics/module/index.spec.ts index ca0d99871..929155f5f 100644 --- a/schematics/module/index.spec.ts +++ b/schematics/module/index.spec.ts @@ -1,7 +1,7 @@ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import { createAlainApp } from '../utils/testing'; import { Schema as ModuleOptions } from './schema'; +import { createAlainApp } from '../utils/testing'; describe('NgAlainSchematic: module', () => { let runner: SchematicTestRunner; diff --git a/schematics/module/index.ts b/schematics/module/index.ts index 15daf7cbf..7c8358510 100644 --- a/schematics/module/index.ts +++ b/schematics/module/index.ts @@ -19,8 +19,8 @@ import { findModuleFromOptions, buildRelativePath } from '@schematics/angular/ut import { parseName } from '@schematics/angular/utility/parse-name'; import * as ts from 'typescript'; -import { addProviderToModule, getProject, refreshPathRoot } from '../utils'; import { Schema as ModuleSchema } from './schema'; +import { addProviderToModule, getProject, refreshPathRoot } from '../utils'; function addDeclarationToNgModule(options: ModuleSchema): Rule { return (tree: Tree) => { diff --git a/schematics/ng-add/index.ts b/schematics/ng-add/index.ts index 59d79c819..c15bb4a95 100644 --- a/schematics/ng-add/index.ts +++ b/schematics/ng-add/index.ts @@ -2,10 +2,10 @@ import { chain, Rule, schematic, Tree, SchematicContext, SchematicsException } f import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; import * as colors from 'ansi-colors'; +import { Schema as NgAddOptions } from './schema'; import { Schema as ApplicationOptions } from '../application/schema'; import { DEFAULT_WORKSPACE_PATH, readJSON, readPackage } from '../utils'; import { getNodeMajorVersion } from '../utils/node'; -import { Schema as NgAddOptions } from './schema'; const V = 16; diff --git a/schematics/plugin/index.ts b/schematics/plugin/index.ts index 288525584..22c003848 100644 --- a/schematics/plugin/index.ts +++ b/schematics/plugin/index.ts @@ -1,7 +1,6 @@ import { chain, Rule, SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; -import { getProject } from '../utils'; import { PluginOptions } from './interface'; import { pluginAsdf } from './plugin.asdf'; import { pluginCodeStyle } from './plugin.code-style'; @@ -12,6 +11,7 @@ import { pluginNetworkEnv } from './plugin.network-env'; import { pluginRTL } from './plugin.rtl'; import { pluginSTS } from './plugin.sts'; import { Schema as PluginSchema } from './schema'; +import { getProject } from '../utils'; function installPackages(): (_host: Tree, context: SchematicContext) => void { return (_host: Tree, context: SchematicContext) => { diff --git a/schematics/plugin/plugin.code-style.ts b/schematics/plugin/plugin.code-style.ts index 6134ab846..d69140c7c 100644 --- a/schematics/plugin/plugin.code-style.ts +++ b/schematics/plugin/plugin.code-style.ts @@ -1,8 +1,8 @@ import { Rule, Tree } from '@angular-devkit/schematics'; +import { PluginOptions } from './interface'; import { readPackage, writePackage } from '../utils'; import { LINT_STAGED, LINT_STAGED_CONFIG } from '../utils/code-style'; -import { PluginOptions } from './interface'; export function pluginCodeStyle(options: PluginOptions): Rule { return (tree: Tree) => { diff --git a/schematics/plugin/plugin.default-language.ts b/schematics/plugin/plugin.default-language.ts index 1dbfd5b9d..def03cbee 100644 --- a/schematics/plugin/plugin.default-language.ts +++ b/schematics/plugin/plugin.default-language.ts @@ -1,8 +1,8 @@ import { Rule, SchematicsException, Tree } from '@angular-devkit/schematics'; +import { PluginOptions } from './interface'; import { getLangConfig } from '../core/lang.config'; import { getProject } from '../utils'; -import { PluginOptions } from './interface'; export function pluginDefaultLanguage(options: PluginOptions): Rule { return async (tree: Tree) => { diff --git a/schematics/plugin/plugin.docker.ts b/schematics/plugin/plugin.docker.ts index 06f8507d5..226402c6a 100644 --- a/schematics/plugin/plugin.docker.ts +++ b/schematics/plugin/plugin.docker.ts @@ -1,7 +1,7 @@ import { Rule, Tree } from '@angular-devkit/schematics'; -import { tryAddFile, tryDelFile } from '../utils'; import { PluginOptions } from './interface'; +import { tryAddFile, tryDelFile } from '../utils'; function setIgnore(tree: Tree, options: PluginOptions): void { const filePath = `${options.root}/.dockerignore`; diff --git a/schematics/plugin/plugin.icon.ts b/schematics/plugin/plugin.icon.ts index 7dc0ccf30..3a8abcb45 100644 --- a/schematics/plugin/plugin.icon.ts +++ b/schematics/plugin/plugin.icon.ts @@ -6,8 +6,8 @@ import type { Attribute } from 'parse5/dist/common/token'; import type { Element } from 'parse5/dist/tree-adapters/default'; import * as ts from 'typescript'; -import { getSourceFile } from '../utils'; import { PluginOptions } from './interface'; +import { getSourceFile } from '../utils'; // includes ng-zorro-antd & @delon/* const WHITE_ICONS = [ diff --git a/schematics/plugin/plugin.rtl.ts b/schematics/plugin/plugin.rtl.ts index 1017deb58..c967faf7f 100644 --- a/schematics/plugin/plugin.rtl.ts +++ b/schematics/plugin/plugin.rtl.ts @@ -2,8 +2,8 @@ import { normalize } from '@angular-devkit/core'; import { ProjectDefinition } from '@angular-devkit/core/src/workspace'; import { apply, chain, mergeWith, move, Rule, SchematicsException, Tree, url } from '@angular-devkit/schematics'; -import { addImportToModule, addValueToVariable, getProject, overwriteIfExists, readContent } from '../utils'; import { PluginOptions } from './interface'; +import { addImportToModule, addValueToVariable, getProject, overwriteIfExists, readContent } from '../utils'; let project: ProjectDefinition; diff --git a/schematics/plugin/plugin.sts.ts b/schematics/plugin/plugin.sts.ts index 5cceb3a84..86923af03 100644 --- a/schematics/plugin/plugin.sts.ts +++ b/schematics/plugin/plugin.sts.ts @@ -11,8 +11,8 @@ import { } from '@angular-devkit/schematics'; import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; -import { addPackage, removePackage } from '../utils'; import { PluginOptions } from './interface'; +import { addPackage, removePackage } from '../utils'; function fixPackage(options: PluginOptions): Rule { return (tree: Tree) => { diff --git a/schematics/sta/index.ts b/schematics/sta/index.ts index a868cba40..b1ed810a4 100644 --- a/schematics/sta/index.ts +++ b/schematics/sta/index.ts @@ -9,10 +9,10 @@ import { parse } from 'jsonc-parser'; import { resolve, join } from 'path'; import { generateApi, GenerateApiOutput, GenerateApiParams } from 'swagger-typescript-api'; -import { readJSON, writeJSON } from '../utils/json'; -import { getProject } from '../utils/workspace'; import { Schema } from './schema'; import { STAConfig } from './types'; +import { readJSON, writeJSON } from '../utils/json'; +import { getProject } from '../utils/workspace'; let project: ProjectDefinition; diff --git a/schematics/tpl/index.ts b/schematics/tpl/index.ts index 6f7c912d2..d70d26e82 100644 --- a/schematics/tpl/index.ts +++ b/schematics/tpl/index.ts @@ -2,8 +2,8 @@ import { Rule, SchematicsException } from '@angular-devkit/schematics'; import * as fs from 'fs'; import * as path from 'path'; -import { buildAlain } from '../utils'; import { Schema } from './schema'; +import { buildAlain } from '../utils'; const REFER = `, please refer to: https://ng-alain.com/cli/generate#Customtemplatepage`; diff --git a/schematics/utils/alain.spec.ts b/schematics/utils/alain.spec.ts index 245a58d84..33b9fa82c 100644 --- a/schematics/utils/alain.spec.ts +++ b/schematics/utils/alain.spec.ts @@ -1,7 +1,7 @@ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import { createAlainAndModuleApp } from '../utils/testing'; import { addValueToVariable, CommonSchema } from './alain'; +import { createAlainAndModuleApp } from '../utils/testing'; describe('Schematic: alain', () => { let runner: SchematicTestRunner; diff --git a/schematics/view/index.ts b/schematics/view/index.ts index cf6cfec90..4e08ed43c 100644 --- a/schematics/view/index.ts +++ b/schematics/view/index.ts @@ -1,7 +1,7 @@ import { chain, Rule } from '@angular-devkit/schematics'; -import { buildAlain } from '../utils'; import { Schema } from './schema'; +import { buildAlain } from '../utils'; export default function (options: Schema): Rule { return chain([buildAlain({ schematicName: 'view', ...options })]); diff --git a/scripts/site/utils/generate-demo.ts b/scripts/site/utils/generate-demo.ts index 3c83764cf..a888d7bd9 100755 --- a/scripts/site/utils/generate-demo.ts +++ b/scripts/site/utils/generate-demo.ts @@ -3,9 +3,9 @@ import * as fs from 'fs'; import * as fse from 'fs-extra'; import * as path from 'path'; -import { ModuleConfig, SiteConfig } from '../interfaces'; import { toHtml } from './generate-md'; import { getCode, genUpperName, genUrl, generateDoc } from './utils'; +import { ModuleConfig, SiteConfig } from '../interfaces'; const JsonML = require('jsonml.js/lib/utils'); const MT = require('mark-twain'); diff --git a/scripts/site/utils/generate-example.ts b/scripts/site/utils/generate-example.ts index a32d53f5b..66a6763ea 100755 --- a/scripts/site/utils/generate-example.ts +++ b/scripts/site/utils/generate-example.ts @@ -1,8 +1,8 @@ import * as fs from 'fs'; import * as path from 'path'; -import { ExampleModules, SiteConfig } from '../interfaces'; import { generateDoc } from './utils'; +import { ExampleModules, SiteConfig } from '../interfaces'; export function generateExampleModule(rootDir: string, siteConfig: SiteConfig, options: ExampleModules): void { const targetDir = path.join(rootDir, `./src/app/routes/gen/examples`); diff --git a/scripts/site/utils/generate-md.ts b/scripts/site/utils/generate-md.ts index 59aa598e7..62930b528 100755 --- a/scripts/site/utils/generate-md.ts +++ b/scripts/site/utils/generate-md.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { highlight } from '../converters/highlight'; import { escapeHTML, genAttr, generateSluggedId, isHeading, isStandalone } from './utils'; +import { highlight } from '../converters/highlight'; const JsonML = require('jsonml.js/lib/utils'); diff --git a/scripts/site/utils/parse-md.ts b/scripts/site/utils/parse-md.ts index 024daeb07..7a9cecddf 100755 --- a/scripts/site/utils/parse-md.ts +++ b/scripts/site/utils/parse-md.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import * as fse from 'fs-extra'; +import { generateMd } from './generate-md'; import { SiteConfig } from '../interfaces'; import { toc } from '../plugins/toc'; -import { generateMd } from './generate-md'; const MT = require('mark-twain'); diff --git a/src/app/core/code/code.service.ts b/src/app/core/code/code.service.ts index 9722a7cfd..0a156a9e9 100644 --- a/src/app/core/code/code.service.ts +++ b/src/app/core/code/code.service.ts @@ -7,8 +7,6 @@ import { getParameters } from 'codesandbox/lib/api/define'; import { deepCopy } from '@delon/util/other'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; -import pkg from '../../../../package.json'; -import { AppService } from '../app.service'; import angularJSON from './files/angular.json'; import appModuleTS from './files/app.module'; import delonABCModuleTS from './files/delon-abc.module'; @@ -24,6 +22,8 @@ import readme from './files/readme-cli'; import sandboxConfigJSON from './files/sandbox.config.json'; import startupServiceTS from './files/startup.service'; import tsconfigJSON from './files/tsconfig.json'; +import pkg from '../../../../package.json'; +import { AppService } from '../app.service'; @Injectable({ providedIn: 'root' }) export class CodeService { @@ -138,7 +138,10 @@ export class CodeService { return res; } - constructor(private appSrv: AppService, @Inject(DOCUMENT) document: NzSafeAny) { + constructor( + private appSrv: AppService, + @Inject(DOCUMENT) document: NzSafeAny + ) { this.document = document; } diff --git a/src/app/core/meta.service.ts b/src/app/core/meta.service.ts index 8f5fcce4b..75a4736ce 100644 --- a/src/app/core/meta.service.ts +++ b/src/app/core/meta.service.ts @@ -3,6 +3,7 @@ import { Inject, Injectable } from '@angular/core'; import { ALAIN_I18N_TOKEN } from '@delon/theme'; +import { I18NService } from './i18n/service'; import { Meta, MetaList, MetaSearchGroup, MetaSearchGroupItem } from '../interfaces'; import { META as ACLMeta } from '../routes/gen/acl/meta'; import { META as AuthMeta } from '../routes/gen/auth/meta'; @@ -15,7 +16,6 @@ import { META as FormMeta } from '../routes/gen/form/meta'; import { META as MockMeta } from '../routes/gen/mock/meta'; import { META as ThemeMeta } from '../routes/gen/theme/meta'; import { META as UtilMeta } from '../routes/gen/util/meta'; -import { I18NService } from './i18n/service'; const FULLMETAS = [ DocsMeta, diff --git a/src/app/routes/form-pages/form-pages.module.ts b/src/app/routes/form-pages/form-pages.module.ts index 01dd02ea5..468c8f7dc 100644 --- a/src/app/routes/form-pages/form-pages.module.ts +++ b/src/app/routes/form-pages/form-pages.module.ts @@ -3,9 +3,9 @@ import { RouterModule, Routes } from '@angular/router'; import { NuMonacoEditorModule } from '@ng-util/monaco-editor'; +import { FormValidatorComponent } from './validator/validator.component'; import { ContentComponent } from '../../shared/components/content/content.component'; import { SharedModule } from '../../shared/shared.module'; -import { FormValidatorComponent } from './validator/validator.component'; const COMPONENTS = [FormValidatorComponent]; diff --git a/src/app/routes/routes.module.ts b/src/app/routes/routes.module.ts index d38d25c38..4e805da6b 100644 --- a/src/app/routes/routes.module.ts +++ b/src/app/routes/routes.module.ts @@ -3,10 +3,10 @@ import { Route, RouterModule } from '@angular/router'; import { AlainI18NGuard } from '@delon/theme'; -import { LayoutComponent } from '../layout/layout.component'; -import { SharedModule } from '../shared/shared.module'; import { NotFoundComponent } from './404/404.component'; import { HomeComponent } from './home/home.component'; +import { LayoutComponent } from '../layout/layout.component'; +import { SharedModule } from '../shared/shared.module'; const COMPONENTS = [HomeComponent, NotFoundComponent]; diff --git a/src/app/shared/components/content/content.component.ts b/src/app/shared/components/content/content.component.ts index 35fbd8564..8aec358f3 100644 --- a/src/app/shared/components/content/content.component.ts +++ b/src/app/shared/components/content/content.component.ts @@ -16,7 +16,11 @@ export class ContentComponent implements OnInit, OnDestroy { isMobile!: boolean; opened = false; - constructor(public meta: MetaService, private mobileSrv: MobileService, private cdr: ChangeDetectorRef) {} + constructor( + public meta: MetaService, + private mobileSrv: MobileService, + private cdr: ChangeDetectorRef + ) {} ngOnInit(): void { this.mobileSrv.change.pipe(takeUntil(this.destroy$)).subscribe(res => { diff --git a/src/app/shared/components/edit-button/edit-button.component.ts b/src/app/shared/components/edit-button/edit-button.component.ts index c94fd1de5..51a2b1547 100644 --- a/src/app/shared/components/edit-button/edit-button.component.ts +++ b/src/app/shared/components/edit-button/edit-button.component.ts @@ -26,5 +26,8 @@ export class EditButtonComponent { this._full = `${this.meta.github}/edit/master/${this.i18n.get(data.urls)}`; } - constructor(private meta: MetaService, @Inject(ALAIN_I18N_TOKEN) private i18n: I18NService) {} + constructor( + private meta: MetaService, + @Inject(ALAIN_I18N_TOKEN) private i18n: I18NService + ) {} } diff --git a/src/app/shared/components/match-router/match-router.directive.ts b/src/app/shared/components/match-router/match-router.directive.ts index 6d2e4d883..a621fecbd 100644 --- a/src/app/shared/components/match-router/match-router.directive.ts +++ b/src/app/shared/components/match-router/match-router.directive.ts @@ -19,7 +19,11 @@ export class MatchRouterDirective implements AfterViewInit, OnDestroy { this._options = { cls: 'ant-menu-item-selected', ...val }; } - constructor(private router: Router, private element: ElementRef, private renderer: Renderer2) {} + constructor( + private router: Router, + private element: ElementRef, + private renderer: Renderer2 + ) {} private setCls(): void { if (!this.router.navigated) { diff --git a/src/app/shared/st-widget/st-widget.module.ts b/src/app/shared/st-widget/st-widget.module.ts index ca3d26ed5..71f288eb7 100644 --- a/src/app/shared/st-widget/st-widget.module.ts +++ b/src/app/shared/st-widget/st-widget.module.ts @@ -2,8 +2,8 @@ import { NgModule } from '@angular/core'; import { STWidgetRegistry } from '@delon/abc/st'; -import { SharedModule } from '../shared.module'; import { STImgWidget } from './img.widget'; +import { SharedModule } from '../shared.module'; export const STWIDGET_COMPONENTS = [STImgWidget]; diff --git a/src/dev/dev.module.ts b/src/dev/dev.module.ts index e66a8f462..9a274cc28 100644 --- a/src/dev/dev.module.ts +++ b/src/dev/dev.module.ts @@ -3,11 +3,11 @@ import { RouterModule, Routes } from '@angular/router'; import { LayoutDefaultModule } from '@delon/theme/layout-default'; -import { SharedModule } from '../app/shared/shared.module'; import { DemoComponent } from './demo.component'; import { DevHomeComponent } from './home/home.component'; import { DevLayoutComponent } from './layout.component'; import { DevPageComponent } from './pages/page.component'; +import { SharedModule } from '../app/shared/shared.module'; const COMPONENTS = [DevLayoutComponent, DevHomeComponent, DevPageComponent, DemoComponent]; diff --git a/src/dev/lazy/lazy.module.ts b/src/dev/lazy/lazy.module.ts index 1867f2249..6a8ec3149 100644 --- a/src/dev/lazy/lazy.module.ts +++ b/src/dev/lazy/lazy.module.ts @@ -1,9 +1,9 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { SharedModule } from '../../app/shared/shared.module'; import { DevLazyLayoutComponent } from './layout.component'; import { DevLazyPageComponent } from './test.component'; +import { SharedModule } from '../../app/shared/shared.module'; const COMPONENTS = [DevLazyLayoutComponent, DevLazyPageComponent]; diff --git a/src/dev/list/list.module.ts b/src/dev/list/list.module.ts index e68ebeffc..2d709c3b6 100644 --- a/src/dev/list/list.module.ts +++ b/src/dev/list/list.module.ts @@ -1,10 +1,10 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { SharedModule } from '../../app/shared/shared.module'; import { DevLayoutListComponent } from './layout.component'; import { DevListItemComponent } from './list-item.component'; import { DevListComponent } from './list.component'; +import { SharedModule } from '../../app/shared/shared.module'; const COMPONENTS = [DevLayoutListComponent, DevListComponent, DevListItemComponent]; From 9341de72a4dbf67018dea9f40445b3ba8eee3fbd Mon Sep 17 00:00:00 2001 From: cipchk Date: Fri, 21 Jul 2023 15:31:21 +0800 Subject: [PATCH 3/4] chore: fix ElementRef type --- packages/abc/sv/sv-container.component.ts | 8 +++----- packages/form/src/sf-fixed.directive.ts | 10 ++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/abc/sv/sv-container.component.ts b/packages/abc/sv/sv-container.component.ts index bac5e8363..4d373f380 100644 --- a/packages/abc/sv/sv-container.component.ts +++ b/packages/abc/sv/sv-container.component.ts @@ -79,21 +79,19 @@ export class SVContainerComponent { encapsulation: ViewEncapsulation.None }) export class SVTitleComponent implements OnInit { - private el: HTMLElement; constructor( - el: ElementRef, + private el: ElementRef, @Host() @Optional() private parent: SVContainerComponent, private ren: Renderer2 ) { if (parent == null) { throw new Error(`[sv-title] must include 'sv-container' component`); } - this.el = el.nativeElement; } private setClass(): void { - const { gutter } = this.parent; - const { el } = this; + const gutter = this.parent.gutter; + const el = this.el.nativeElement; this.ren.setStyle(el, 'padding-left', `${gutter / 2}px`); this.ren.setStyle(el, 'padding-right', `${gutter / 2}px`); } diff --git a/packages/form/src/sf-fixed.directive.ts b/packages/form/src/sf-fixed.directive.ts index 74af209b9..c37814ddf 100644 --- a/packages/form/src/sf-fixed.directive.ts +++ b/packages/form/src/sf-fixed.directive.ts @@ -4,14 +4,14 @@ import { InputNumber } from '@delon/util/decorator'; @Directive({ selector: '[fixed-label]' }) export class SFFixedDirective implements AfterViewInit, OnChanges { - private el: HTMLDivElement; private _inited = false; @Input('fixed-label') @InputNumber() num?: number | null; private init(): void { if (!this._inited || this.num == null || this.num <= 0) return; - const widgetEl = this.el.querySelector('.ant-row') || this.el; + const el = this.el.nativeElement; + const widgetEl = el.querySelector('.ant-row') || el; this.render.addClass(widgetEl, 'sf__fixed'); const labelEl = widgetEl.querySelector('.ant-form-item-label'); const controlEl = widgetEl.querySelector('.ant-form-item-control-wrapper,.ant-form-item-control'); @@ -25,11 +25,9 @@ export class SFFixedDirective implements AfterViewInit, OnChanges { } constructor( - er: ElementRef, + private el: ElementRef, private render: Renderer2 - ) { - this.el = er.nativeElement as HTMLDivElement; - } + ) {} ngAfterViewInit(): void { this._inited = true; From 7218d18ef02c13f530a99616f0b3bbd0c62bd3e5 Mon Sep 17 00:00:00 2001 From: cipchk Date: Fri, 21 Jul 2023 15:44:25 +0800 Subject: [PATCH 4/4] chore: fix style --- .stylelintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.stylelintrc b/.stylelintrc index 6df3c741f..11a7241d0 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -53,6 +53,7 @@ ], "no-invalid-double-slash-comments": null, "import-notation": "string", - "media-feature-range-notation": "prefix" + "media-feature-range-notation": "prefix", + "media-query-no-invalid": null } }