From d8566ded5ae33aaa4a3e5dc3786cad2a14262370 Mon Sep 17 00:00:00 2001 From: vthinkxie Date: Thu, 21 Jan 2021 17:50:47 +0800 Subject: [PATCH] build: update to 11.1 close #6359 --- components/cascader/cascader.spec.ts | 6 ++--- components/modal/modal.spec.ts | 4 +-- package.json | 39 ++++++++++++++-------------- schematics/utils/build-component.ts | 32 ++++++++++++++++++++--- scripts/site/_site/doc/theme.less | 37 ++++++++++++++------------ 5 files changed, 75 insertions(+), 43 deletions(-) diff --git a/components/cascader/cascader.spec.ts b/components/cascader/cascader.spec.ts index d0398bc500..2a863bf1ac 100644 --- a/components/cascader/cascader.spec.ts +++ b/components/cascader/cascader.spec.ts @@ -2097,7 +2097,7 @@ export class NzDemoCascaderLoadDataComponent { label: 'Zhejiang' } ]; - resolve(); + resolve(null); } else if (index === 0) { node.children = [ { @@ -2105,7 +2105,7 @@ export class NzDemoCascaderLoadDataComponent { label: 'Hangzhou' } ]; - resolve(); + resolve(null); } else if (index === 1) { node.children = [ { @@ -2113,7 +2113,7 @@ export class NzDemoCascaderLoadDataComponent { label: 'West Lake' } ]; - resolve(); + resolve(null); } else { reject(); } diff --git a/components/modal/modal.spec.ts b/components/modal/modal.spec.ts index 3340c3462d..0507b1438c 100644 --- a/components/modal/modal.spec.ts +++ b/components/modal/modal.spec.ts @@ -1167,7 +1167,7 @@ describe('NzModal', () => { onClick: () => { return new Promise(resolve => { setTimeout(() => { - resolve(); + resolve(null); }, 200); }); } @@ -1182,7 +1182,7 @@ describe('NzModal', () => { onClick: () => { return new Promise(resolve => { setTimeout(() => { - resolve(); + resolve(null); }, 200); }); } diff --git a/package.json b/package.json index 3e2865650e..d17e761c9e 100644 --- a/package.json +++ b/package.json @@ -29,22 +29,22 @@ "resize-observer-polyfill": "^1.5.1" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.1100.5", - "@angular-devkit/core": "^11.0.5", - "@angular-devkit/schematics": "^11.0.5", - "@angular/animations": "^11.0.5", - "@angular/cli": "~11.0.5", - "@angular/common": "^11.0.5", - "@angular/compiler": "^11.0.5", - "@angular/compiler-cli": "~11.0.5", - "@angular/core": "^11.0.5", - "@angular/forms": "^11.0.5", - "@angular/language-service": "^11.0.5", - "@angular/platform-browser": "^11.0.5", - "@angular/platform-browser-dynamic": "^11.0.5", - "@angular/platform-server": "^11.0.5", - "@angular/router": "^11.0.5", - "@angular/service-worker": "^11.0.5", + "@angular-devkit/build-angular": "~0.1101.0", + "@angular-devkit/core": "^11.1.0", + "@angular-devkit/schematics": "^11.1.0", + "@angular/animations": "^11.1.0", + "@angular/cli": "~11.1.0", + "@angular/common": "^11.1.0", + "@angular/compiler": "^11.1.0", + "@angular/compiler-cli": "~11.1.0", + "@angular/core": "^11.1.0", + "@angular/forms": "^11.1.0", + "@angular/language-service": "^11.1.0", + "@angular/platform-browser": "^11.1.0", + "@angular/platform-browser-dynamic": "^11.1.0", + "@angular/platform-server": "^11.1.0", + "@angular/router": "^11.1.0", + "@angular/service-worker": "^11.1.0", "@ant-design/dark-theme": "^2.0.2", "@commitlint/cli": "^11.0.0", "@commitlint/config-angular": "^11.0.0", @@ -91,7 +91,7 @@ "karma-junit-reporter": "^2.0.1", "karma-spec-reporter": "0.0.32", "karma-viewport": "^1.0.7", - "less": "^3.10.3", + "less": "^4.1.0", "less-plugin-clean-css": "^1.5.1", "less-plugin-npm-import": "^2.1.0", "less-vars-to-js": "^1.3.0", @@ -100,10 +100,11 @@ "marked": "^1.2.7", "minimist": "^1.2.5", "monaco-editor": "^0.21.2", - "ng-packagr": "^11.0.3", + "ng-packagr": "^11.1.2", "ngx-color": "^6.2.0", "node-prismjs": "^0.1.2", "parse5": "^6.0.1", + "postcss": "^8.2.4", "prettier": "^2.2.1", "prismjs": "^1.22.0", "process": "^0.11.10", @@ -119,7 +120,7 @@ "ts-node": "~9.1.1", "tslib": "^2.0.3", "tslint": "~6.1.3", - "typescript": "~4.0.2", + "typescript": "~4.1.2", "yaml-front-matter": "^4.1.1", "zone.js": "~0.11.3" }, diff --git a/schematics/utils/build-component.ts b/schematics/utils/build-component.ts index 08f0ba44b0..18d3875db7 100644 --- a/schematics/utils/build-component.ts +++ b/schematics/utils/build-component.ts @@ -7,7 +7,7 @@ */ import { strings, template as interpolateTemplate } from '@angular-devkit/core'; -import { ProjectDefinition, WorkspaceDefinition } from '@angular-devkit/core/src/workspace'; +import { ProjectDefinition } from '@angular-devkit/core/src/workspace'; import { apply, applyTemplates, @@ -25,11 +25,12 @@ import { import { FileSystemSchematicContext } from '@angular-devkit/schematics/tools'; import { getDefaultComponentOptions, getProjectFromWorkspace } from '@angular/cdk/schematics'; import { Schema as ComponentOptions, Style } from '@schematics/angular/component/schema'; +import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'; import { addDeclarationToModule, addEntryComponentToModule, addExportToModule, - getFirstNgModuleName + getDecoratorMetadata } from '@schematics/angular/utility/ast-utils'; import { InsertChange } from '@schematics/angular/utility/change'; import { buildRelativePath, findModuleFromOptions } from '@schematics/angular/utility/find-module'; @@ -39,7 +40,32 @@ import { getWorkspace } from '@schematics/angular/utility/workspace'; import { ProjectType } from '@schematics/angular/utility/workspace-models'; import { readFileSync, statSync } from 'fs'; import { dirname, join, resolve } from 'path'; -import * as ts from 'typescript'; + +function findClassDeclarationParent(node: ts.Node): ts.ClassDeclaration|undefined { + if (ts.isClassDeclaration(node)) { + return node; + } + + return node.parent && findClassDeclarationParent(node.parent); +} + +function getFirstNgModuleName(source: ts.SourceFile): string|undefined { + // First, find the @NgModule decorators. + const ngModulesMetadata = getDecoratorMetadata(source, 'NgModule', '@angular/core'); + if (ngModulesMetadata.length === 0) { + return undefined; + } + + // Then walk parent pointers up the AST, looking for the ClassDeclaration parent of the NgModule + // metadata. + const moduleClass = findClassDeclarationParent(ngModulesMetadata[0]); + if (!moduleClass || !moduleClass.name) { + return undefined; + } + + // Get the class name of the module ClassDeclaration. + return moduleClass.name.text; +} export interface ZorroComponentOptions extends ComponentOptions { classnameWithModule: boolean; diff --git a/scripts/site/_site/doc/theme.less b/scripts/site/_site/doc/theme.less index e9ab3c05f7..8a18e324e3 100755 --- a/scripts/site/_site/doc/theme.less +++ b/scripts/site/_site/doc/theme.less @@ -385,16 +385,18 @@ @input-padding-horizontal-sm: @control-padding-horizontal-sm - 1px; @input-padding-horizontal-lg: @input-padding-horizontal; @input-padding-vertical-base: max( - round((@input-height-base - @font-size-base * @line-height-base) / 2 * 10) / 10 - + (round(((@input-height-base - @font-size-base * @line-height-base) / 2) * 10) / 10) - @border-width-base, 3px ); @input-padding-vertical-sm: max( - round((@input-height-sm - @font-size-base * @line-height-base) / 2 * 10) / 10 - @border-width-base, + (round(((@input-height-sm - @font-size-base * @line-height-base) / 2) * 10) / 10) - + @border-width-base, 0 ); -@input-padding-vertical-lg: ceil((@input-height-lg - @font-size-lg * @line-height-base) / 2 * 10) / - 10 - @border-width-base; +@input-padding-vertical-lg: ( + ceil(((@input-height-lg - @font-size-lg * @line-height-base) / 2) * 10) / 10 + ) - @border-width-base; @input-placeholder-color: hsv(0, 0, 75%); @input-color: @text-color; @input-icon-color: @input-color; @@ -436,7 +438,7 @@ @select-single-item-height-lg: 40px; @select-multiple-item-height: @input-height-base - @input-padding-vertical-base * 2; // Normal 24px @select-multiple-item-height-lg: 32px; -@select-multiple-item-spacing-half: ceil(@input-padding-vertical-base / 2); +@select-multiple-item-spacing-half: ceil((@input-padding-vertical-base / 2)); @select-multiple-disabled-background: @input-disabled-bg; @select-multiple-item-disabled-color: #bfbfbf; @select-multiple-item-disabled-border-color: @select-border-color; @@ -590,10 +592,11 @@ @table-expanded-row-bg: #fbfbfb; @table-padding-vertical: 16px; @table-padding-horizontal: 16px; -@table-padding-vertical-md: @table-padding-vertical * 3 / 4; -@table-padding-horizontal-md: @table-padding-horizontal / 2; -@table-padding-vertical-sm: @table-padding-vertical / 2; -@table-padding-horizontal-sm: @table-padding-horizontal / 2; +@table-padding-vertical-md: (@table-padding-vertical * 3 / 4); +@table-padding-horizontal-md: (@table-padding-horizontal / 2); +@table-padding-vertical-sm: (@table-padding-vertical / 2); +@table-padding-horizontal-sm: (@table-padding-horizontal / 2); +@table-border-color: @border-color-split; @table-border-radius-base: @border-radius-base; @table-footer-bg: @background-color-light; @table-footer-color: @heading-color; @@ -680,12 +683,12 @@ @card-head-font-size: @font-size-lg; @card-head-font-size-sm: @font-size-base; @card-head-padding: 16px; -@card-head-padding-sm: @card-head-padding / 2; +@card-head-padding-sm: (@card-head-padding / 2); @card-head-height: 48px; @card-head-height-sm: 36px; @card-inner-head-padding: 12px; @card-padding-base: 24px; -@card-padding-base-sm: @card-padding-base / 2; +@card-padding-base-sm: (@card-padding-base / 2); @card-actions-background: @component-background; @card-actions-li-margin: 12px 0; @card-skeleton-bg: #cfd8dc; @@ -716,8 +719,9 @@ @tabs-card-head-background: @background-color-light; @tabs-card-height: 40px; @tabs-card-active-color: @primary-color; -@tabs-card-horizontal-padding: (@tabs-card-height - floor(@font-size-base * @line-height-base)) / 2 - - @border-width-base @padding-md; +@tabs-card-horizontal-padding: ( + (@tabs-card-height - floor(@font-size-base * @line-height-base)) / 2 + ) - @border-width-base @padding-md; @tabs-card-horizontal-padding-sm: 6px @padding-md; @tabs-card-horizontal-padding-lg: 7px @padding-md 6px; @tabs-title-font-size: @font-size-base; @@ -905,7 +909,7 @@ @alert-with-description-padding-vertical: @padding-md - 1px; @alert-with-description-padding: @alert-with-description-padding-vertical 15px @alert-with-description-no-icon-padding-vertical @alert-with-description-icon-size; -@alert-icon-top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2; +@alert-icon-top: 8px + @font-size-base * (@line-height-base / 2) - (@font-size-base / 2); @alert-with-description-icon-size: 24px; // List @@ -975,7 +979,7 @@ @steps-dot-size: 8px; @steps-dot-top: 2px; @steps-current-dot-size: 10px; -@steps-desciption-max-width: 140px; +@steps-description-max-width: 140px; @steps-nav-content-max-width: auto; @steps-vertical-icon-width: 16px; @steps-vertical-tail-width: 16px; @@ -1000,6 +1004,7 @@ @image-font-size-base: 24px; @image-bg: #f5f5f5; @image-color: #fff; +@image-mask-font-size: 16px; @image-preview-operation-size: 18px; @image-preview-operation-color: @text-color-dark; -@image-preview-operation-disabled-color: fade(@image-preview-operation-color, 25%); \ No newline at end of file +@image-preview-operation-disabled-color: fade(@image-preview-operation-color, 25%);