Skip to content

Commit

Permalink
feat(module: all): support Angular 12 (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuonuoge committed Aug 6, 2021
1 parent 77f36ab commit 26201a9
Show file tree
Hide file tree
Showing 33 changed files with 113 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,7 @@ sudo: required
dist: trusty
language: node_js
node_js:
- '12.3.1'
- '14.15.0'

env:
- TASK=pre-release
Expand Down
26 changes: 19 additions & 7 deletions angular.json
Expand Up @@ -16,7 +16,6 @@
"main": "./site/src/main.ts",
"tsConfig": "./site/src/tsconfig.app.json",
"polyfills": "./site/src/polyfills.ts",
"aot": true,
"assets": [
"site/src/assets",
"site/src/favicon.ico",
Expand All @@ -31,7 +30,13 @@
"styles": [
"site/src/styles.less"
],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -47,16 +52,23 @@
"with": "./site/src/environments/environment.prod.ts"
}
],
"optimization": true,
"optimization": {
"scripts": true,
"styles": {
"minify": true,
"inlineCritical": false
},
"fonts": true
},
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": false,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": false
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down Expand Up @@ -93,7 +105,7 @@
"prefix": "",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "components/tsconfig.lib.json",
"project": "components/ng-package.json"
Expand All @@ -103,7 +115,7 @@
"tsConfig": "components/tsconfig.lib.prod.json"
}
}
},
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down
12 changes: 6 additions & 6 deletions components/badge/demo/basic.ts
Expand Up @@ -52,7 +52,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .dot-badge .am-badge-dot {
:host ::ng-deep .dot-badge .am-badge-dot {
right: -8px;
}
.corner-badge {
Expand All @@ -62,25 +62,25 @@ import { Component } from '@angular/core';
font-size: 17px;
color: #000;
}
/deep/ .special-badge .am-list-line {
:host ::ng-deep .special-badge .am-list-line {
padding-right: 0;
}
/deep/ .special-badge .am-list-line .am-list-extra {
:host ::ng-deep .special-badge .am-list-line .am-list-extra {
padding: 0;
height: 44px;
}
/deep/ .special-badge .am-badge {
:host ::ng-deep .special-badge .am-badge {
transform: rotate(45deg);
transform-origin: right bottom;
right: 0px;
top: 13px;
width: 50px;
}
/deep/ .special-badge .am-badge-text {
:host ::ng-deep .special-badge .am-badge-text {
border-radius: 1px;
}
/deep/ .am-badge {
:host ::ng-deep .am-badge {
text-align: right;
font-size: 17px;
color: #000;
Expand Down
4 changes: 2 additions & 2 deletions components/calendar/style/index.less
Expand Up @@ -171,7 +171,7 @@
.cell {
height: 24 * @hd;
display: flex;
width: 100/7%;
width: calc(100% / 7);
justify-content: center;
align-items: center;
color: @color-text-base;
Expand Down Expand Up @@ -293,7 +293,7 @@
.cell {
display: flex;
flex-direction: column;
width: 100/7%;
width: calc(100% / 7);
justify-content: center;
align-items: center;

Expand Down
6 changes: 3 additions & 3 deletions components/drawer/demo/basic.ts
Expand Up @@ -38,19 +38,19 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .my-drawer {
:host ::ng-deep .my-drawer {
position: relative;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
/deep/ .my-drawer .am-drawer-sidebar {
:host ::ng-deep .my-drawer .am-drawer-sidebar {
background-color: #fff;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
/deep/ .my-drawer .am-drawer-sidebar .am-list {
:host ::ng-deep .my-drawer .am-drawer-sidebar .am-list {
width: 300px;
padding: 0;
}
Expand Down
6 changes: 3 additions & 3 deletions components/drawer/demo/dock.ts
Expand Up @@ -39,19 +39,19 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .my-drawer {
:host ::ng-deep .my-drawer {
position: relative;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
/deep/ .my-drawer .am-drawer-sidebar {
:host ::ng-deep .my-drawer .am-drawer-sidebar {
background-color: #fff;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
/deep/ .my-drawer .am-drawer-sidebar .am-list {
:host ::ng-deep .my-drawer .am-drawer-sidebar .am-list {
width: 300px;
padding: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion components/grid/demo/basic.ts
Expand Up @@ -50,7 +50,7 @@ import { Component } from '@angular/core';
font-size: 14px;
padding: 15px 0 9px 15px;
}
/deep/.not-square-grid .am-grid-icon {
:host ::ng-deep.not-square-grid .am-grid-icon {
width: 40px;
height: 60px;
}
Expand Down
2 changes: 1 addition & 1 deletion components/input-item/demo/basic.ts
Expand Up @@ -171,7 +171,7 @@ import { ToastService } from 'ng-zorro-antd-mobile';
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/deep/ .am-list-body InputItem:not(:last-child) .am-list-line {
:host ::ng-deep .am-list-body InputItem:not(:last-child) .am-list-line {
border-bottom: 1px solid #ddd;
}
Expand Down
12 changes: 8 additions & 4 deletions components/karma.conf.js
Expand Up @@ -9,15 +9,19 @@ module.exports = function(config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
coverageReporter: {
subdir: '.',
dir: require('path').join(__dirname, '../coverage'),
reporters: [
{ type: 'html' },
{ type: 'lcovonly' },
],
},
angularCli: {
environment: 'dev'
Expand Down
2 changes: 1 addition & 1 deletion components/list/demo/basic.ts
Expand Up @@ -90,7 +90,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .my-list .spe .am-list-extra {
:host ::ng-deep .my-list .spe .am-list-extra {
flex-basis: initial;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/list/demo/form.ts
Expand Up @@ -59,7 +59,7 @@ import { FormGroup, Validators, FormControl } from '@angular/forms';
`,
styles: [
`
/deep/ .my-list .spe .am-list-extra {
:host ::ng-deep .my-list .spe .am-list-extra {
flex-basis: initial;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/modal/demo/prompt.ts
Expand Up @@ -33,7 +33,7 @@ export class DemoModalPromptComponent {
new Promise(resolve => {
this._toast.info('onPress promise resolve', 1000);
setTimeout(() => {
resolve();
resolve(value);
console.log(`value:${value}`);
}, 1000);
})
Expand Down
2 changes: 1 addition & 1 deletion components/modal/modal.component.spec.ts
Expand Up @@ -345,7 +345,7 @@ export class TestModalBasicComponent {
onPress: value =>
new Promise(resolve => {
setTimeout(() => {
resolve();
resolve(value);
console.log(`value:${value}`);
}, 1000);
})
Expand Down
33 changes: 16 additions & 17 deletions components/package.json
Expand Up @@ -22,27 +22,26 @@
"url": "https://github.com/NG-ZORRO/ng-zorro-antd-mobile/issues"
},
"dependencies": {
"@angular/cdk": "^11.0.3",
"@angular/animations": "^11.0.5",
"@ant-design/icons-angular": "^11.0.1"
"@angular/animations": "^12.1.1",
"@angular/cdk": "^12.1.1",
"@angular/common": "^12.1.1",
"@angular/compiler": "^12.1.1",
"@angular/core": "^12.1.1",
"@angular/forms": "^12.1.1",
"@angular/platform-browser": "^12.1.1",
"@angular/platform-browser-dynamic": "^12.1.1",
"@angular/router": "^12.1.1",
"@ant-design/icons-angular": "^12.0.3"
},
"devDependencies": {
"@angular/common": "^11.0.5",
"@angular/compiler": "^11.0.5",
"@angular/core": "^11.0.5",
"@angular/forms": "^11.0.5",
"@angular/http": "^7.2.16",
"@angular/platform-browser": "^11.0.5",
"@angular/platform-browser-dynamic": "^11.0.5",
"@angular/router": "^11.0.5",
"@angular/upgrade": "^11.0.5",
"@angular/upgrade": "^12.1.1",
"@angular-devkit/build-angular": "^0.1100.5",
"@angular/cli": "^11.0.5",
"@angular/compiler-cli": "^11.0.5",
"@angular/platform-server": "^11.0.5",
"tslib": "^2.0.1",
"@angular/cli": "^12.1.1",
"@angular/compiler-cli": "^12.1.1",
"@angular/platform-server": "^12.1.1",
"tslib": "^2.3.0",
"tslint": "~6.1.3",
"typescript": "~4.0.5"
"typescript": "~4.3.5"
},
"lint-staged": {
"{src,docs}/**/*.{scss}": [
Expand Down
2 changes: 1 addition & 1 deletion components/polyfills.ts
Expand Up @@ -49,7 +49,7 @@ import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/***************************************************************************************************
* Zone JS is required by Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/***************************************************************************************************
* APPLICATION IMPORTS
Expand Down
2 changes: 1 addition & 1 deletion components/radio/demo/basic.ts
Expand Up @@ -53,7 +53,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .my-radio .am-radio {
:host ::ng-deep .my-radio .am-radio {
padding: 2.5px;
border: 1px solid #ccc;
border-radius: 50%;
Expand Down
2 changes: 1 addition & 1 deletion components/swipe-action/demo/basic.ts
Expand Up @@ -67,7 +67,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/.btnClass {
:host ::ng-deep.btnClass {
background-color: #f4333c;
color: white;
}
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/demo/basic.ts
Expand Up @@ -76,7 +76,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .am-badge {
:host ::ng-deep .am-badge {
text-align: right;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/demo/dynamic.ts
Expand Up @@ -24,7 +24,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .am-badge {
:host ::ng-deep .am-badge {
text-align: right;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/demo/fixedtabtitlesize.ts
Expand Up @@ -70,7 +70,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .am-badge {
:host ::ng-deep .am-badge {
text-align: right;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/demo/multitabs.ts
Expand Up @@ -59,7 +59,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .am-badge {
:host ::ng-deep .am-badge {
text-align: right;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/demo/noanim.ts
Expand Up @@ -36,7 +36,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .am-badge {
:host ::ng-deep .am-badge {
text-align: right;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/demo/vertical.ts
Expand Up @@ -37,7 +37,7 @@ import { Component } from '@angular/core';
`,
styles: [
`
/deep/ .am-badge {
:host ::ng-deep .am-badge {
text-align: right;
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/tabs.component.spec.ts
Expand Up @@ -442,7 +442,7 @@ describe('tab', () => {
`,
styles: [
`
/deep/ .am-tabs-default-bar-content {
:host ::ng-deep .am-tabs-default-bar-content {
height: 100px;
}
`
Expand Down

0 comments on commit 26201a9

Please sign in to comment.