diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml
index 527479dac2..066084e65e 100644
--- a/.github/workflows/deploy-site.yml
+++ b/.github/workflows/deploy-site.yml
@@ -16,7 +16,7 @@ jobs:
- name: build
run: |
- yarn run site:build:ssr
+ yarn run site:build
cp ./src/dist/browser/index.html ./src/dist/browser/404.html
cp ./Dockerfile.docs ./src/dist/browser/Dockerfile.docs
cp -r ./_nginx/ ./src/dist/browser/_nginx
diff --git a/.nvmrc b/.nvmrc
index 3e558c9b3c..d939939b25 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-18.12.0
+18.13.0
diff --git a/README.md b/README.md
index f7f56178bf..5710239440 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Delon
- Delon is a set of essential modules for [ng-alain](https://ng-alain.com).
+ Delon is a set of essential modules for [NG-ALAIN](https://ng-alain.com).
[![Build Status](https://dev.azure.com/ng-alain/delon/_apis/build/status/delon-CI?branchName=master)](https://dev.azure.com/ng-alain/delon/_build/latest?definitionId=1&branchName=master)
[![Codecov](https://img.shields.io/codecov/c/github/ng-alain/delon.svg?style=flat-square)](https://codecov.io/gh/ng-alain/delon)
diff --git a/angular.json b/angular.json
index 66810daee0..d2706bc05f 100644
--- a/angular.json
+++ b/angular.json
@@ -21,13 +21,17 @@
"prefix": "app",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:browser",
+ "builder": "@angular-devkit/build-angular:application",
"options": {
- "outputPath": "src/dist/browser",
+ "outputPath": "src/dist",
"index": "src/index.html",
- "main": "src/main.ts",
+ "browser": "src/main.ts",
"tsConfig": "src/tsconfig.json",
- "polyfills": "src/polyfills.ts",
+ "polyfills": [
+ "@webcomponents/custom-elements",
+ "@webcomponents/custom-elements/src/native-shim",
+ "zone.js"
+ ],
"assets": [
"src/assets",
"src/manifest.json",
@@ -89,16 +93,12 @@
}
],
"outputHashing": "all",
- "serviceWorker": true,
- "ngswConfigPath": "ngsw-config.json"
+ "serviceWorker": "ngsw-config.json"
},
"development": {
- "buildOptimizer": false,
"optimization": false,
- "vendorChunk": true,
"extractLicenses": false,
- "sourceMap": true,
- "namedChunks": true
+ "sourceMap": true
}
},
"defaultConfiguration": "production"
@@ -107,10 +107,10 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
- "browserTarget": "site:build:production"
+ "buildTarget": "site:build:production"
},
"development": {
- "browserTarget": "site:build:development"
+ "buildTarget": "site:build:development"
}
},
"defaultConfiguration": "development"
@@ -140,7 +140,10 @@
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "site:build",
- "serverTarget": "site:server"
+ "serverTarget": "site:server",
+ "polyfills": [
+ "zone.js"
+ ]
},
"configurations": {
"production": {
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 6f9514cf73..81cd450d63 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -40,7 +40,7 @@ stages:
ACCESS_REPO: $(ACCESS_REPO)
ACCESS_TOKEN: $(ACCESS_TOKEN)
- script: |
- yarn run site:build:ssr
+ yarn run site:build
displayName: 'Build site'
- script: |
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ng-alain-delon.surge.sh
diff --git a/package.json b/package.json
index b6a1268502..0ce002e59d 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
},
"homepage": "https://ng-alain.com",
"engines": {
- "node": "^18.10.0"
+ "node": "^18.13.0"
},
"scripts": {
"ng-high-memory": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng",
@@ -55,20 +55,20 @@
"ssr:prerender": "npm run ng-high-memory run site:prerender"
},
"dependencies": {
- "@angular/animations": "^16.2.0",
- "@angular/common": "^16.2.0",
- "@angular/compiler": "^16.2.0",
- "@angular/core": "^16.2.0",
- "@angular/forms": "^16.2.0",
- "@angular/platform-browser": "^16.2.0",
- "@angular/platform-browser-dynamic": "^16.2.0",
- "@angular/router": "^16.2.0",
+ "@angular/animations": "^17.0.0",
+ "@angular/common": "^17.0.0",
+ "@angular/compiler": "^17.0.0",
+ "@angular/core": "^17.0.0",
+ "@angular/forms": "^17.0.0",
+ "@angular/platform-browser": "^17.0.0",
+ "@angular/platform-browser-dynamic": "^17.0.0",
+ "@angular/router": "^17.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
- "zone.js": "~0.13.0",
- "@angular/service-worker": "^16.2.0",
- "@angular/platform-server": "^16.2.0",
- "@angular/elements": "^16.2.0",
+ "zone.js": "~0.14.2",
+ "@angular/service-worker": "^17.0.0",
+ "@angular/platform-server": "^17.0.0",
+ "@angular/elements": "^17.0.0",
"@antv/data-set": "^0.11.8",
"@antv/g2": "^4.2.10",
"echarts": "^5.4.3",
@@ -78,56 +78,55 @@
"ajv-formats": "^2.1.1",
"extend": "^3.0.2",
"file-saver": "^2.0.5",
- "ng-github-button": "^16.0.0",
- "ng-zorro-antd": "^16.2.2",
+ "ng-github-button": "^17.0.0",
+ "ng-zorro-antd": "^17.0.0-beta.0",
"ngx-color": "~9.0.0",
- "ngx-countdown": "^16.0.0",
- "ngx-highlight-js": "^16.1.0",
- "ngx-tinymce": "^16.0.0",
+ "ngx-countdown": "^17.0.0",
+ "ngx-highlight-js": "^17.0.0",
+ "ngx-tinymce": "^17.0.0",
"qrious": "^4.0.2",
"@webcomponents/custom-elements": "^1.6.0",
"aos": "^3.0.0-beta.6",
- "@ng-util/monaco-editor": "^16.0.1",
+ "@ng-util/monaco-editor": "^17.0.0",
"@nguniversal/express-engine": "^16.2.0",
"express": "^4.18.2",
"isutf8": "^4.0.0",
- "@github/hotkey": "^2.0.1",
+ "@github/hotkey": "^2.3.0",
"ng-antd-color-picker": "^0.0.2"
},
"devDependencies": {
- "@angular-devkit/build-angular": "^16.2.0",
- "@angular/cli": "~16.2.0",
- "@angular/compiler-cli": "^16.2.0",
- "@types/jasmine": "~4.3.0",
- "jasmine-core": "~4.6.0",
+ "@angular-devkit/build-angular": "^17.0.0",
+ "@angular/cli": "^17.0.0",
+ "@angular/compiler-cli": "^17.0.0",
+ "@types/jasmine": "~5.1.0",
+ "jasmine-core": "~5.1.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.1.0",
- "typescript": "~5.1.3",
- "codelyzer": "^6.0.2",
+ "typescript": "~5.2.2",
+ "jasmine": "^5.1.0",
"jasmine-spec-reporter": "^7.0.0",
- "protractor": "~7.0.0",
"ts-node": "~10.9.1",
- "@angular/language-service": "^16.2.0",
- "@types/jasminewd2": "~2.0.10",
+ "@angular/language-service": "^17.0.0",
+ "@types/jasminewd2": "~2.0.13",
"karma-junit-reporter": "^2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-viewport": "^1.0.9",
- "@types/aos": "^3.0.4",
- "@types/file-saver": "^2.0.5",
- "@types/deep-extend": "^0.6.0",
- "@types/extend": "^3.0.1",
- "@types/mockjs": "^1.0.7",
+ "@types/aos": "^3.0.7",
+ "@types/file-saver": "^2.0.7",
+ "@types/deep-extend": "^0.6.2",
+ "@types/extend": "^3.0.4",
+ "@types/mockjs": "^1.0.10",
"@types/parse5": "^7.0.0",
"karma-summary-reporter": "^3.1.1",
"karma-parallel": "^0.3.1",
"chalk": "^5.3.0",
"codecov": "^3.8.3",
- "conventional-changelog-cli": "^4.0.0",
+ "conventional-changelog-cli": "^4.1.0",
"fs-extra": "^11.1.1",
- "@types/fs-extra": "^11.0.1",
+ "@types/fs-extra": "^11.0.4",
"husky": "^8.0.3",
"jsonml.js": "^0.1.0",
"klaw-sync": "^6.0.0",
@@ -137,12 +136,12 @@
"mark-twain": "^2.0.3",
"mockjs": "^1.1.0",
"mustache": "^4.2.0",
- "ng-packagr": "^16.2.1",
+ "ng-packagr": "^17.0.0",
"parse5": "^7.1.2",
- "prettier": "^3.0.2",
+ "prettier": "^3.0.3",
"readline-sync": "^1.4.10",
"stream": "0.0.2",
- "stylelint": "^15.10.3",
+ "stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.7.0",
"stylelint-config-clean-order": "^5.2.0",
@@ -152,32 +151,30 @@
"plyr": "^3.7.8",
"screenfull": "^6.0.2",
"less-bundle-promise": "^1.0.11",
- "ng-alain-codelyzer": "^0.0.1",
"ng-alain-sts": "^0.0.2",
"ng-alain-plugin-theme": "^16.0.0",
"tsconfig-paths": "^4.2.0",
"@nguniversal/builders": "^16.2.0",
- "@types/express": "^4.17.17",
+ "@types/express": "^4.17.21",
"html-minifier-terser": "^7.2.0",
"terser": "^5.19.2",
- "@commitlint/cli": "^17.7.1",
- "@commitlint/config-angular": "^17.7.0",
- "@angular-eslint/builder": "~16.1.1",
- "@angular-eslint/eslint-plugin": "~16.1.1",
- "@angular-eslint/eslint-plugin-template": "~16.1.1",
- "@angular-eslint/schematics": "~16.1.1",
- "@angular-eslint/template-parser": "~16.1.1",
- "@typescript-eslint/eslint-plugin": "~6.4.1",
- "@typescript-eslint/parser": "~6.4.1",
- "eslint": "^8.48.0",
+ "@commitlint/cli": "^17.8.1",
+ "@commitlint/config-angular": "^17.8.1",
+ "@angular-eslint/builder": "^17.0.0",
+ "@angular-eslint/eslint-plugin": "^17.0.0",
+ "@angular-eslint/eslint-plugin-template": "^17.0.0",
+ "@angular-eslint/schematics": "^17.0.0",
+ "@angular-eslint/template-parser": "^17.0.0",
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
+ "@typescript-eslint/parser": "^6.10.0",
+ "eslint": "^8.53.0",
"eslint-config-prettier": "~9.0.0",
- "eslint-plugin-import": "~2.28.1",
- "eslint-plugin-jsdoc": "~46.5.0",
+ "eslint-plugin-import": "~2.29.0",
+ "eslint-plugin-jsdoc": "~46.5.1",
"eslint-plugin-prefer-arrow": "~1.2.3",
- "eslint-plugin-prettier": "~5.0.0",
- "eslint-plugin-deprecation": "~1.5.0",
+ "eslint-plugin-prettier": "~5.0.1",
+ "eslint-plugin-deprecation": "~2.0.0",
"lint-staged": "^14.0.1",
- "raw-loader": "^4.0.2",
"swagger-typescript-api": "^12.0.4",
"sitemap": "^7.1.1"
},
diff --git a/packages/abc/ellipsis/ellipsis.component.html b/packages/abc/ellipsis/ellipsis.component.html
index dfdc9fa0b5..3c0684641b 100644
--- a/packages/abc/ellipsis/ellipsis.component.html
+++ b/packages/abc/ellipsis/ellipsis.component.html
@@ -13,18 +13,18 @@
-
+
{{ text }}
-
+
-
+
{{ linsWord }}
diff --git a/packages/abc/st/st-td.component.html b/packages/abc/st/st-td.component.html
index f57ba9532c..3e1dd5ae21 100644
--- a/packages/abc/st/st-td.component.html
+++ b/packages/abc/st/st-td.component.html
@@ -1,9 +1,9 @@
-
+
-
+
@@ -80,7 +80,7 @@
/>
|
-
+
-
+
`,
host: {
'[style.height.px]': 'height'
diff --git a/packages/form/src/widgets/custom/custom.widget.ts b/packages/form/src/widgets/custom/custom.widget.ts
index 4a6eced7d7..187a03c46b 100644
--- a/packages/form/src/widgets/custom/custom.widget.ts
+++ b/packages/form/src/widgets/custom/custom.widget.ts
@@ -17,7 +17,7 @@ import { ControlUIWidget } from '../../widget';
+ />
`,
preserveWhitespaces: false,
diff --git a/packages/util/pipes/currency/demo/currency-cny.md b/packages/util/pipes/currency/demo/currency-cny.md
index a1da075f7a..1cfddc57bc 100644
--- a/packages/util/pipes/currency/demo/currency-cny.md
+++ b/packages/util/pipes/currency/demo/currency-cny.md
@@ -9,7 +9,7 @@ import { Component } from '@angular/core';
selector: 'app-demo',
template: `
- {{ {{ value }} | cny }} = {{ value | cny }}
+ {{ {{ value }} | cny }} = {{ value | cny }}
diff --git a/packages/util/pipes/currency/demo/currency-mega.md b/packages/util/pipes/currency/demo/currency-mega.md
index 46949d9dc6..e1a4029f5f 100644
--- a/packages/util/pipes/currency/demo/currency-mega.md
+++ b/packages/util/pipes/currency/demo/currency-mega.md
@@ -9,12 +9,12 @@ import { Component } from '@angular/core';
selector: 'app-demo',
template: `
- {{ {{ value }} | mega }} = {{ value | mega }}
+ {{ {{ value }} | mega }} = {{ value | mega }}
- {{
+ {{
{{ value }} | mega: 大括号 precision: {{ precision }} 大括号 }} =
+ >}} =
{{ value | mega: { precision: precision } }}
diff --git a/packages/util/pipes/currency/demo/currency-price.md b/packages/util/pipes/currency/demo/currency-price.md
index 6086e6b113..c4fa9b9f18 100644
--- a/packages/util/pipes/currency/demo/currency-price.md
+++ b/packages/util/pipes/currency/demo/currency-price.md
@@ -9,7 +9,7 @@ import { Component } from '@angular/core';
selector: 'app-demo',
template: `
- {{ {{ value }} | price }} = {{ value | price: { precision: precision } }}
+ {{ {{ value }} | price }} = {{ value | price: { precision: precision } }}
diff --git a/packages/util/pipes/filter/demo/filter.md b/packages/util/pipes/filter/demo/filter.md
index 5d90adc99b..e8e0dcf719 100644
--- a/packages/util/pipes/filter/demo/filter.md
+++ b/packages/util/pipes/filter/demo/filter.md
@@ -9,7 +9,7 @@ import { Component } from '@angular/core';
selector: 'app-demo',
template: `
- {{ {{ list | json }} | filter: matcher }} = {{ list | filter: matcher:number | json }}
+ {{ {{ list | json }} | filter: matcher }} = {{ list | filter: matcher:number | json }}
matcher = (item: PriceObject, number: number) => item.price > number;
diff --git a/packages/util/pipes/format/demo/format-mask.md b/packages/util/pipes/format/demo/format-mask.md
index 08e4382d91..ea475abd46 100644
--- a/packages/util/pipes/format/demo/format-mask.md
+++ b/packages/util/pipes/format/demo/format-mask.md
@@ -9,7 +9,7 @@ import { Component } from '@angular/core';
selector: 'app-demo',
template: `
- {{ {{ value }} | mask: {{ maskStr | json }} }} = {{ value | mask: maskStr }}
+ {{ {{ value }} | mask: {{ maskStr | json }} }} = {{ value | mask: maskStr }}
diff --git a/schematics/migration.json b/schematics/migration.json
index bb7bd15335..b8aecd331c 100644
--- a/schematics/migration.json
+++ b/schematics/migration.json
@@ -1,14 +1,9 @@
{
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
- "migration-v16": {
- "version": "16",
- "description": "Updates NG-ALAIN to v16 [https://github.com/ng-alain/ng-alain/issues/2390]",
- "factory": "./ng-update/index#updateToV16"
- },
"migration-v17": {
"version": "17",
- "description": "Updates NG-ALAIN to v17 [https://github.com/ng-alain/ng-alain/issues/2390]",
+ "description": "Updates NG-ALAIN to v17 [https://github.com/ng-alain/ng-alain/issues/2440]",
"factory": "./ng-update/index#updateToV17"
},
"ng-post-update": {
diff --git a/schematics/ng-add/index.ts b/schematics/ng-add/index.ts
index a8cb65ddc6..bdbfc8bf69 100644
--- a/schematics/ng-add/index.ts
+++ b/schematics/ng-add/index.ts
@@ -7,7 +7,7 @@ import { Schema as ApplicationOptions } from '../application/schema';
import { DEFAULT_WORKSPACE_PATH, readJSON, readPackage } from '../utils';
import { getNodeMajorVersion } from '../utils/node';
-const V = 16;
+const V = 17;
function genRules(options: NgAddOptions): Rule {
return () => {
diff --git a/schematics/ng-update/data/attribute-selectors.ts b/schematics/ng-update/data/attribute-selectors.ts
index 15de9ca5c3..99fb8069c0 100644
--- a/schematics/ng-update/data/attribute-selectors.ts
+++ b/schematics/ng-update/data/attribute-selectors.ts
@@ -1,5 +1,5 @@
import { AttributeSelectorUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const attributeSelectors: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/class-names.ts b/schematics/ng-update/data/class-names.ts
index 50b6d2307a..15f218f96f 100644
--- a/schematics/ng-update/data/class-names.ts
+++ b/schematics/ng-update/data/class-names.ts
@@ -1,5 +1,5 @@
import { ClassNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const classNames: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/constructor-checks.ts b/schematics/ng-update/data/constructor-checks.ts
index 8e1b8c4e3f..fa4b4fc406 100644
--- a/schematics/ng-update/data/constructor-checks.ts
+++ b/schematics/ng-update/data/constructor-checks.ts
@@ -6,5 +6,5 @@ import { ConstructorChecksUpgradeData, TargetVersion, VersionChanges } from '@an
* automatically through type checking.
*/
export const constructorChecks: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/css-selectors.ts b/schematics/ng-update/data/css-selectors.ts
index 4cfe940443..b5af06ba5b 100644
--- a/schematics/ng-update/data/css-selectors.ts
+++ b/schematics/ng-update/data/css-selectors.ts
@@ -1,5 +1,5 @@
import { CssSelectorUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const cssSelectors: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/element-selectors.ts b/schematics/ng-update/data/element-selectors.ts
index 3cfe48af73..cc1bf62bca 100644
--- a/schematics/ng-update/data/element-selectors.ts
+++ b/schematics/ng-update/data/element-selectors.ts
@@ -1,5 +1,5 @@
import { ElementSelectorUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const elementSelectors: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/input-names.ts b/schematics/ng-update/data/input-names.ts
index 2a3cb90ee2..9eb63b727a 100644
--- a/schematics/ng-update/data/input-names.ts
+++ b/schematics/ng-update/data/input-names.ts
@@ -1,5 +1,5 @@
import { InputNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const inputNames: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/method-call-checks.ts b/schematics/ng-update/data/method-call-checks.ts
index 67ebc83f84..ad4716d886 100644
--- a/schematics/ng-update/data/method-call-checks.ts
+++ b/schematics/ng-update/data/method-call-checks.ts
@@ -1,5 +1,5 @@
import { MethodCallUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const methodCallChecks: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/output-names.ts b/schematics/ng-update/data/output-names.ts
index 53cf03d777..0743366b2e 100644
--- a/schematics/ng-update/data/output-names.ts
+++ b/schematics/ng-update/data/output-names.ts
@@ -1,5 +1,5 @@
import { OutputNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const outputNames: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/data/property-names.ts b/schematics/ng-update/data/property-names.ts
index 2f8e4df8ca..b51d3cd45d 100644
--- a/schematics/ng-update/data/property-names.ts
+++ b/schematics/ng-update/data/property-names.ts
@@ -1,5 +1,5 @@
import { PropertyNameUpgradeData, TargetVersion, VersionChanges } from '@angular/cdk/schematics';
export const propertyNames: VersionChanges = {
- [TargetVersion.V16]: []
+ [TargetVersion.V17]: []
};
diff --git a/schematics/ng-update/index.ts b/schematics/ng-update/index.ts
index 8ef558cdd2..6d0991db07 100644
--- a/schematics/ng-update/index.ts
+++ b/schematics/ng-update/index.ts
@@ -3,18 +3,12 @@ import { createMigrationSchematicRule, NullableDevkitMigration, TargetVersion }
import { chain, Rule, SchematicContext } from '@angular-devkit/schematics';
import { ruleUpgradeData } from './upgrade-data';
-import { v16Rule } from './upgrade-rules/v16';
import { v17Rule } from './upgrade-rules/v17';
const migrations: NullableDevkitMigration[] = [];
-export function updateToV16(): Rule {
- return chain([v16Rule(), createMigrationSchematicRule(TargetVersion.V16, migrations, ruleUpgradeData, postUpdate)]);
-}
-
export function updateToV17(): Rule {
- // , createMigrationSchematicRule(TargetVersion.V17, migrations, ruleUpgradeData, postUpdate)
- return chain([v17Rule()]);
+ return chain([v17Rule(), createMigrationSchematicRule(TargetVersion.V17, migrations, ruleUpgradeData, postUpdate)]);
}
/** Post-update schematic to be called when update is finished. */
diff --git a/schematics/ng-update/upgrade-rules/v16/index.spec.ts b/schematics/ng-update/upgrade-rules/v16/index.spec.ts
deleted file mode 100644
index 20ad1a413a..0000000000
--- a/schematics/ng-update/upgrade-rules/v16/index.spec.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { JsonObject } from '@angular-devkit/core';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-
-import { createAlainApp, migrationCollection } from '../../../utils/testing';
-
-describe('Schematic: ng-update: v16Rule', () => {
- let runner: SchematicTestRunner;
- let tree: UnitTestTree;
- const logs: string[] = [];
-
- beforeEach(async () => {
- ({ runner, tree } = await createAlainApp());
- });
-
- async function runMigration(): Promise {
- logs.length = 0;
- runner = new SchematicTestRunner('schematics', migrationCollection);
- runner.logger.subscribe(e => logs.push(e.message));
- await runner.runSchematic('migration-v16', {}, tree);
- }
-
- it('should be remote stylelint-config-prettier', async () => {
- const filePath = 'package.json';
- let json = tree.readJson(filePath) as JsonObject;
- const key = 'stylelint-config-prettier';
- json['devDependencies']!![key] = '*';
- tree.overwrite(filePath, JSON.stringify(json));
- await runMigration();
- const migrationPackageJson = tree.readJson(filePath) as JsonObject;
- expect(migrationPackageJson['devDependencies']!![key]).not.toBeDefined();
- });
-});
diff --git a/schematics/ng-update/upgrade-rules/v16/index.ts b/schematics/ng-update/upgrade-rules/v16/index.ts
deleted file mode 100644
index 12cb6bc5b2..0000000000
--- a/schematics/ng-update/upgrade-rules/v16/index.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
-import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
-import * as colors from 'ansi-colors';
-
-import { logStart, readJSON, readPackage, writeJSON, writePackage } from '../../../utils';
-import { UpgradeMainVersions } from '../../../utils/versions';
-import { updateMockPath } from '../base';
-
-function removeStylelintConfigPrettier(): Rule {
- return (tree: Tree, context: SchematicContext) => {
- const key = `stylelint-config-prettier`;
- context.logger.info(colors.yellow(` ${key} have been deprecated`));
- // remove package.json
- const packageJson = readPackage(tree);
- if (packageJson != null) {
- delete packageJson.devDependencies[key];
- writePackage(tree, packageJson);
- }
-
- // remote .stylelintrc
- const stylelintrcFilePath = '.stylelintrc';
- const stylelintrcjson = readJSON(tree, stylelintrcFilePath);
- if (stylelintrcjson != null) {
- if (!Array.isArray(stylelintrcjson.extends)) stylelintrcjson.extends = [];
- const arr: string[] = stylelintrcjson.extends;
- const idx = arr.indexOf(key);
- if (idx !== -1) {
- arr.splice(idx, 1);
- writeJSON(tree, stylelintrcFilePath, stylelintrcjson);
- }
- }
- };
-}
-
-function finished(): Rule {
- return (_tree: Tree, context: SchematicContext) => {
- context.addTask(new NodePackageInstallTask());
-
- context.logger.info(
- colors.green(
- ` ✓ Congratulations, Abort more detail please refer to upgrade guide https://github.com/ng-alain/ng-alain/issues/2390`
- )
- );
- };
-}
-
-export function v16Rule(): Rule {
- return async (tree: Tree, context: SchematicContext) => {
- logStart(context, `Upgrade @delon/* version number`);
- UpgradeMainVersions(tree);
- return chain([removeStylelintConfigPrettier(), updateMockPath(), finished()]);
- };
-}
diff --git a/scripts/site/route-paths.txt b/scripts/site/route-paths.txt
index cf57abb3e2..b0c862c7e7 100644
--- a/scripts/site/route-paths.txt
+++ b/scripts/site/route-paths.txt
@@ -241,6 +241,8 @@
/form/rate/zh
/form/schema/en
/form/schema/zh
+/form/segmented/en
+/form/segmented/zh
/form/select/en
/form/select/zh
/form/slider/en
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 08151bfcb9..9f3f288446 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -4,9 +4,10 @@ import { LayoutModule } from '@angular/cdk/layout';
import { isPlatformBrowser, registerLocaleData } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import localeZh from '@angular/common/locales/zh';
-import { APP_INITIALIZER, ErrorHandler, Inject, Injector, NgModule, PLATFORM_ID } from '@angular/core';
+import { APP_INITIALIZER, ErrorHandler, Inject, Injector, NgModule, PLATFORM_ID, APP_ID } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { createCustomElement } from '@angular/elements';
import { NZ_DATE_LOCALE } from 'ng-zorro-antd/i18n';
import { zhCN as dateLang } from 'date-fns/locale';
@@ -45,7 +46,6 @@ function registerElements(injector: Injector, platformId: {}): void {
if (!isPlatformBrowser(platformId) || customElements.get('nz-icon')) {
return;
}
- const { createCustomElement } = require('@angular/elements');
Object.keys(EXAMPLE_COMPONENTS).forEach(key => {
const element = createCustomElement(EXAMPLE_COMPONENTS[key].component, {
injector
@@ -61,7 +61,7 @@ function registerElements(injector: Injector, platformId: {}): void {
@NgModule({
imports: [
- BrowserModule.withServerTransition({ appId: 'serverApp' }),
+ BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
BidiModule,
@@ -82,6 +82,7 @@ function registerElements(injector: Injector, platformId: {}): void {
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })
],
providers: [
+ { provide: APP_ID, useValue: 'serverApp' },
// {
// provide: RouteReuseStrategy,
// useClass: ReuseTabStrategy,
diff --git a/src/app/core/code/code.service.ts b/src/app/core/code/code.service.ts
index 0a156a9e93..d85b1523b9 100644
--- a/src/app/core/code/code.service.ts
+++ b/src/app/core/code/code.service.ts
@@ -15,6 +15,7 @@ import environmentTS from './files/environment';
import globalConfigTS from './files/global-config.module';
import mainTS from './files/main';
import mainCliTS from './files/main-cli';
+import mockUser from './files/mock-user';
import nzZorroAntdModuleTS from './files/ng-zorro-antd.module';
import packageJSON from './files/package.json';
import polyfillTS from './files/polyfill';
@@ -151,7 +152,7 @@ export class CodeService {
private get genMock(): { [key: string]: string } {
return {
- '_mock/user.ts': require('!!raw-loader!../../../../_mock/user.ts').default,
+ '_mock/user.ts': mockUser,
'_mock/index.ts': `export * from './user';`
};
}
diff --git a/src/app/core/code/files/mock-user.ts b/src/app/core/code/files/mock-user.ts
new file mode 100644
index 0000000000..03313f1bea
--- /dev/null
+++ b/src/app/core/code/files/mock-user.ts
@@ -0,0 +1,57 @@
+export default `import { MockStatusError, MockRequest, r } from '@delon/mock';
+import type { NzSafeAny } from 'ng-zorro-antd/core/types';
+// import * as Mock from 'mockjs';
+
+export const USERS = {
+ // 支持值为 Object 和 Array
+ 'GET /users': (req: MockRequest) => {
+ const total = req.queryString.total || 100;
+ const res: NzSafeAny = {
+ list: [],
+ total
+ };
+ for (let i = 0; i < +req.queryString.ps; i++) {
+ res.list.push({
+ id: i + 1,
+ type: r(1, 3),
+ picture: {
+ thumbnail: \`https://randomuser.me/api/portraits/thumb/\${r(0, 1) === 0 ? 'men' : 'women'}/\${r(1, 50)}.jpg\`
+ },
+ name: {
+ last: \`last-\${r(1, 10)}\`,
+ first: \`first-\${r(10, 20)}\`
+ },
+ nat: ['CH', 'US', 'DE'][i % 3],
+ gender: ['male', 'female'][i % 2],
+ email: \`aaa\${r(1, 10)}@qq.com\`,
+ phone: \`phone-\${r(1000, 100000)}\`,
+ price: r(10, 10000000),
+ total: r(10, 10000000),
+ website: \`https://\${r(10, 10000000)}.com/\`,
+ disabled: r(1, 100) > 50,
+ registered: new Date()
+ });
+ }
+ return res;
+ },
+ 'GET /user/check/': () => false,
+ 'GET /user/check/:name': (req: MockRequest) => req.params.name === 'cipchk',
+ // GET POST 可省略
+ // '/users/1': Mock.mock({ id: 1, 'rank|3': '★★★' }),
+ // 发送 Status 错误
+ '/500': () => {
+ throw new MockStatusError(500);
+ },
+ '/404': () => {
+ throw new MockStatusError(404);
+ },
+ '/user/:id': (req: MockRequest) => {
+ return { id: req.params.id, name: 'detail' };
+ },
+ '/user/:id/edit': (req: MockRequest) => {
+ return { id: req.params.id, name: 'edit' };
+ },
+ '/user/:id/upload': (req: MockRequest) => {
+ return { id: req.params.id, name: 'upload' };
+ }
+};`;
diff --git a/src/app/layout/header/header.component.html b/src/app/layout/header/header.component.html
index 47b8fa933e..3a475e2c99 100644
--- a/src/app/layout/header/header.component.html
+++ b/src/app/layout/header/header.component.html
@@ -13,7 +13,7 @@
nz-menu-item
routerLink="/{{ i.name }}/{{ i.default || 'getting-started' }}/{{ i18n.zone }}"
>
- @delon/{{ i.name }}-{{ 'app.header.menu.' + i.name | i18n }}
+ @delon/{{ i.name }}-{{ 'app.header.menu.' + i.name | i18n }}
@@ -29,7 +29,7 @@
nz-menu-item
routerLink="/{{ i.name }}/{{ i.default || 'getting-started' }}/{{ i18n.zone }}"
>
- @delon/{{ i.name }}-{{ 'app.header.menu.' + i.name | i18n }}
+ @delon/{{ i.name }}-{{ 'app.header.menu.' + i.name | i18n }}
@@ -78,7 +78,7 @@