Skip to content

Commit

Permalink
build: update to 11.1 (#6365)
Browse files Browse the repository at this point in the history
close #6359
  • Loading branch information
vthinkxie authored Jan 22, 2021
1 parent 7545b74 commit 1e769d1
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 43 deletions.
6 changes: 3 additions & 3 deletions components/cascader/cascader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2097,23 +2097,23 @@ export class NzDemoCascaderLoadDataComponent {
label: 'Zhejiang'
}
];
resolve();
resolve(null);
} else if (index === 0) {
node.children = [
{
value: 'hangzhou',
label: 'Hangzhou'
}
];
resolve();
resolve(null);
} else if (index === 1) {
node.children = [
{
value: 'xihu',
label: 'West Lake'
}
];
resolve();
resolve(null);
} else {
reject();
}
Expand Down
4 changes: 2 additions & 2 deletions components/modal/modal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ describe('NzModal', () => {
onClick: () => {
return new Promise(resolve => {
setTimeout(() => {
resolve();
resolve(null);
}, 200);
});
}
Expand All @@ -1182,7 +1182,7 @@ describe('NzModal', () => {
onClick: () => {
return new Promise(resolve => {
setTimeout(() => {
resolve();
resolve(null);
}, 200);
});
}
Expand Down
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
},
Expand Down
32 changes: 29 additions & 3 deletions schematics/utils/build-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand All @@ -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;
Expand Down
37 changes: 21 additions & 16 deletions scripts/site/_site/doc/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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%);
@image-preview-operation-disabled-color: fade(@image-preview-operation-color, 25%);

0 comments on commit 1e769d1

Please sign in to comment.