diff --git a/.eslintrc.js b/.eslintrc.js index 659960753..4817296b7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -189,6 +189,10 @@ module.exports = { rules: { 'prettier/prettier': ['error', { parser: 'angular' }] } + }, + { + files: ['*.js'], + parserOptions: { sourceType: 'module' } } ] }; diff --git a/CHANGELOG.md b/CHANGELOG.md index f18a5f12d..54b797eed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +# [16.3.0](https://github.com/ng-alain/delon/compare/16.2.1...16.3.0) (2023-09-01) + + +### Bug Fixes + +* **abc:pdf:** fix ignore dependency `pdfjs-dist` ([#1641](https://github.com/ng-alain/delon/issues/1641)) ([b987bab](https://github.com/ng-alain/delon/commit/b987baba6035eb60872c4ee48198568df140869c)) +* **form:select:** fix ignore reset option data when set `onSearch` ([#1644](https://github.com/ng-alain/delon/issues/1644)) ([1f8def7](https://github.com/ng-alain/delon/commit/1f8def70856c091ed677cbd47aed7ca230a2aa79)) +* **theme:http:** fix missing `content` of `HttpOptions` ([#1640](https://github.com/ng-alain/delon/issues/1640)) ([28eeceb](https://github.com/ng-alain/delon/commit/28eecebd7ab71a1b9a8345c0af1ebe22fd3bc1a6)) + + +### Features + +* **abc:cell:** add `cell` component ([#1530](https://github.com/ng-alain/delon/issues/1530)) ([26023ca](https://github.com/ng-alain/delon/commit/26023cac7a91cae5383cfffd26d44fba6a95fb9f)) +* **abc:page-header:** add `titleSub` property ([#1643](https://github.com/ng-alain/delon/issues/1643)) ([79e229f](https://github.com/ng-alain/delon/commit/79e229f5c1b509dd463c48e4a82b361e5d923920)) +* **abc:st:** add `tooltip` in tag or badge ([#1634](https://github.com/ng-alain/delon/issues/1634)) ([0e9006e](https://github.com/ng-alain/delon/commit/0e9006e5b9fd30092b5a808f9b3d8012fd3a060c)) +* **abc:sv:** add `bordered` property ([#1628](https://github.com/ng-alain/delon/issues/1628)) ([ccfa5e1](https://github.com/ng-alain/delon/commit/ccfa5e1d6f5cf1d3f9bc5360bc2e373604ae22a2)) +* **cli:** add `bindToComponentInputs` of `ng add` ([#1630](https://github.com/ng-alain/delon/issues/1630)) ([9717d9d](https://github.com/ng-alain/delon/commit/9717d9dd4ee1d5ab1526616a99da7b70e8664bd2)) +* **theme:drawer:** add `closeAll`, `openDrawers` method ([#1627](https://github.com/ng-alain/delon/issues/1627)) ([bab3d0c](https://github.com/ng-alain/delon/commit/bab3d0c3c648d933784c4623b2714ac227219c5c)) +* **theme:modal:** add size support percentage ([#1626](https://github.com/ng-alain/delon/issues/1626)) ([8b52a08](https://github.com/ng-alain/delon/commit/8b52a08d82378a42e06c316757e19e5434e109dc)) + + + ## [16.2.1](https://github.com/ng-alain/delon/compare/16.2.0...16.2.1) (2023-08-06) diff --git a/docs/changelog.en-US.md b/docs/changelog.en-US.md index d4a1e81fa..2d949aa74 100644 --- a/docs/changelog.en-US.md +++ b/docs/changelog.en-US.md @@ -14,6 +14,29 @@ NG-ALAIN strictly follows [Semantic Versioning 2.0.0](http://semver.org/lang/zh- --- +# [16.3.0](https://github.com/ng-alain/delon/compare/16.2.1...16.3.0) (2023-09-01) + +### SCAFFOLDING + +* enabled `bindToComponentInputs` [#2409](https://github.com/ng-alain/ng-alain/pull/2409/files). + +### Bug Fixes + +* **abc:pdf:** fix ignore dependency `pdfjs-dist` (If you [use local path](https://ng-alain.com/components/pdf) to load the libary, you need to install the dependency yourself. `pdfjs-dist` depends on `canvas`, which may be slow to install dependencies due to environmental factors) ([#1641](https://github.com/ng-alain/delon/issues/1641)) ([#1641](https://github.com/ng-alain/delon/issues/1641)) ([b987bab](https://github.com/ng-alain/delon/commit/b987baba6035eb60872c4ee48198568df140869c)) +* **form:select:** fix ignore reset option data when set `onSearch` ([#1644](https://github.com/ng-alain/delon/issues/1644)) ([1f8def7](https://github.com/ng-alain/delon/commit/1f8def70856c091ed677cbd47aed7ca230a2aa79)) +* **theme:http:** fix missing `content` of `HttpOptions` ([#1640](https://github.com/ng-alain/delon/issues/1640)) ([28eeceb](https://github.com/ng-alain/delon/commit/28eecebd7ab71a1b9a8345c0af1ebe22fd3bc1a6)) + +### Features + +* **abc:cell:** add `cell` component ([#1530](https://github.com/ng-alain/delon/issues/1530)) ([26023ca](https://github.com/ng-alain/delon/commit/26023cac7a91cae5383cfffd26d44fba6a95fb9f)) +* **abc:page-header:** add `titleSub` property ([#1643](https://github.com/ng-alain/delon/issues/1643)) ([79e229f](https://github.com/ng-alain/delon/commit/79e229f5c1b509dd463c48e4a82b361e5d923920)) +* **abc:st:** add `tooltip` in tag or badge ([#1634](https://github.com/ng-alain/delon/issues/1634)) ([0e9006e](https://github.com/ng-alain/delon/commit/0e9006e5b9fd30092b5a808f9b3d8012fd3a060c)) +* **abc:sv:** add `bordered` property ([#1628](https://github.com/ng-alain/delon/issues/1628)) ([ccfa5e1](https://github.com/ng-alain/delon/commit/ccfa5e1d6f5cf1d3f9bc5360bc2e373604ae22a2)) +* **cli:** add `bindToComponentInputs` of `ng add` ([#1630](https://github.com/ng-alain/delon/issues/1630)) ([9717d9d](https://github.com/ng-alain/delon/commit/9717d9dd4ee1d5ab1526616a99da7b70e8664bd2)) +* **theme:drawer:** add `closeAll`, `openDrawers` method ([#1627](https://github.com/ng-alain/delon/issues/1627)) ([bab3d0c](https://github.com/ng-alain/delon/commit/bab3d0c3c648d933784c4623b2714ac227219c5c)) +* **theme:modal:** add size support percentage ([#1626](https://github.com/ng-alain/delon/issues/1626)) ([8b52a08](https://github.com/ng-alain/delon/commit/8b52a08d82378a42e06c316757e19e5434e109dc)) + + ## [16.2.1](https://github.com/ng-alain/delon/compare/16.2.0...16.2.1) (2023-08-06) ### Bug Fixes diff --git a/docs/changelog.zh-CN.md b/docs/changelog.zh-CN.md index 82d7789d0..ce80eb501 100644 --- a/docs/changelog.zh-CN.md +++ b/docs/changelog.zh-CN.md @@ -14,6 +14,29 @@ NG-ALAIN 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) --- +# [16.3.0](https://github.com/ng-alain/delon/compare/16.2.1...16.3.0) (2023-09-01) + +### SCAFFOLDING + +* 启用 `bindToComponentInputs` [#2409](https://github.com/ng-alain/ng-alain/pull/2409/files). + +### Bug Fixes + +* **abc:pdf:** 忽略依赖 `pdfjs-dist`(若使用[本地](https://ng-alain.com/components/pdf)加载模式,需要自行安装该依赖,`pdfjs-dist` 依赖了 `canvas` 可能会因为环境因素安装依赖很慢) ([#1641](https://github.com/ng-alain/delon/issues/1641)) ([b987bab](https://github.com/ng-alain/delon/commit/b987baba6035eb60872c4ee48198568df140869c)) +* **form:select:** 当设置 `onSearch` 时重置数据时会忽略更新预选数据 ([#1644](https://github.com/ng-alain/delon/issues/1644)) ([1f8def7](https://github.com/ng-alain/delon/commit/1f8def70856c091ed677cbd47aed7ca230a2aa79)) +* **theme:http:** 纠正 `HttpOptions` 缺少 `content` ([#1640](https://github.com/ng-alain/delon/issues/1640)) ([28eeceb](https://github.com/ng-alain/delon/commit/28eecebd7ab71a1b9a8345c0af1ebe22fd3bc1a6)) + +### Features + +* **abc:cell:** 新增 `cell` 单元格数据组件 ([#1530](https://github.com/ng-alain/delon/issues/1530)) ([26023ca](https://github.com/ng-alain/delon/commit/26023cac7a91cae5383cfffd26d44fba6a95fb9f)) +* **abc:page-header:** 新增 `titleSub` 子标题属性 ([#1643](https://github.com/ng-alain/delon/issues/1643)) ([79e229f](https://github.com/ng-alain/delon/commit/79e229f5c1b509dd463c48e4a82b361e5d923920)) +* **abc:st:** 标签或徽标支持 `tooltip` ([#1634](https://github.com/ng-alain/delon/issues/1634)) ([0e9006e](https://github.com/ng-alain/delon/commit/0e9006e5b9fd30092b5a808f9b3d8012fd3a060c)) +* **abc:sv:** 新增 `bordered` 是否显示边框 ([#1628](https://github.com/ng-alain/delon/issues/1628)) ([ccfa5e1](https://github.com/ng-alain/delon/commit/ccfa5e1d6f5cf1d3f9bc5360bc2e373604ae22a2)) +* **cli:** `ng add` 开启 `bindToComponentInputs` ([#1630](https://github.com/ng-alain/delon/issues/1630)) ([9717d9d](https://github.com/ng-alain/delon/commit/9717d9dd4ee1d5ab1526616a99da7b70e8664bd2)) +* **theme:drawer:** 新增 `closeAll`, `openDrawers` 方法 ([#1627](https://github.com/ng-alain/delon/issues/1627)) ([bab3d0c](https://github.com/ng-alain/delon/commit/bab3d0c3c648d933784c4623b2714ac227219c5c)) +* **theme:modal:** 支持百分比大小 ([#1626](https://github.com/ng-alain/delon/issues/1626)) ([8b52a08](https://github.com/ng-alain/delon/commit/8b52a08d82378a42e06c316757e19e5434e109dc)) + + ## [16.2.1](https://github.com/ng-alain/delon/compare/16.2.0...16.2.1) (2023-08-06) ### Bug Fixes diff --git a/package.json b/package.json index 2c36e0635..125dded58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "delon", - "version": "16.2.1", + "version": "16.3.0", "description": "Delon is a set of essential modules for NG-ALAIN.", "keywords": [ "delon", diff --git a/scripts/publish/package.json b/scripts/publish/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/scripts/publish/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/scripts/publish/publish-scaffold.js b/scripts/publish/publish-scaffold.js index b0305835c..dc27b3d56 100755 --- a/scripts/publish/publish-scaffold.js +++ b/scripts/publish/publish-scaffold.js @@ -1,13 +1,17 @@ -const chalk = require('chalk'); -const fs = require('fs-extra'); -const path = require('path'); +import chalk from 'chalk'; +import { readJSONSync } from 'fs-extra/esm'; +import { join, resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; -const nextVersion = fs.readJSONSync(path.join(__dirname, '../../package.json')) +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const nextVersion = readJSONSync(join(__dirname, '../../package.json')) .version; -const root = path.resolve(__dirname, `../../../ng-alain`); +const root = resolve(__dirname, `../../../ng-alain`); /* Shortcut methods */ -const execSync = require('child_process').execSync; +import { execSync } from 'child_process'; const execSyncOptions = { cwd: root, }; diff --git a/scripts/publish/publish.js b/scripts/publish/publish.js index 8acb27a7c..79c1540e8 100755 --- a/scripts/publish/publish.js +++ b/scripts/publish/publish.js @@ -1,12 +1,16 @@ -const chalk = require('chalk'); -const fs = require('fs-extra'); -const path = require('path'); -const read = require('readline-sync'); +import { writeFileSync, readFileSync } from 'fs'; +import { readJSONSync } from 'fs-extra/esm'; +import { resolve, join, dirname } from 'path'; +import { question } from 'readline-sync'; +import chalk from 'chalk'; +import { execSync } from 'child_process'; +import { fileURLToPath } from 'url'; -const root = path.resolve(__dirname, `../..`); +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const root = resolve(__dirname, `../..`); /* Shortcut methods */ -const execSync = require('child_process').execSync; const print = console.log; const log = { info: msg => { @@ -26,7 +30,7 @@ const log = { /* The whole process */ log.info('Starting publishing process...'); -const nextVersion = fs.readJSONSync(path.join(root, 'package.json')).version; +const nextVersion = readJSONSync(join(root, 'package.json')).version; fetchOlderVersions(); generatingPublishNote(); @@ -49,7 +53,7 @@ function generatingPublishNote() { let completeEditing = false; while (!completeEditing) { - const result = read.question( + const result = question( chalk.bgYellow.black( 'Please manually update docs/changelog. Press [Y] if you are done:', ) + ' ', @@ -64,16 +68,16 @@ function generatingPublishNote() { function fixDependenciePath() { log.info('Fix dependencie paths...'); - const packageData = fs.readJSONSync(path.join(root, 'package.json')); + const packageData = readJSONSync(join(root, 'package.json')); const versionData = { ...packageData.dependencies, ...packageData.devDependencies }; log.info('>> fix ajv version path in code service'); - const codeServicePath = path.join(root, 'src/app/core/code.service.ts'); - fs.writeFileSync(codeServicePath, - fs.readFileSync(codeServicePath, 'utf-8') - .replace(/\/ajv\/[^\/]+\//g, `/ajv/${versionData['ajv'].replace(/\^/g, '').replace(/\~/g, '')}/`) + const codeServicePath = join(root, 'src/app/core/code.service.ts'); + writeFileSync(codeServicePath, + readFileSync(codeServicePath, 'utf-8') + .replace(/\/ajv\/[^\/]+\//g, `/ajv/${versionData['ajv'].replace(/\^/g, '').replace(/\~/g, '')}/`) ); } diff --git a/scripts/publish/sync-scaffold-version.js b/scripts/publish/sync-scaffold-version.js index 07deab2e9..c5d4ad8dd 100755 --- a/scripts/publish/sync-scaffold-version.js +++ b/scripts/publish/sync-scaffold-version.js @@ -1,22 +1,27 @@ // node scripts/publish/sync-scaffold-version.js // node scripts/publish/sync-scaffold-version.js theme -const fs = require('fs-extra'); -const path = require('path'); +import { existsSync } from 'fs'; +import { readJSONSync, writeJSONSync } from 'fs-extra/esm'; +import { join, resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; -const nextJson = fs.readJSONSync(path.join(__dirname, '../../package.json')); +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const nextJson = readJSONSync(join(__dirname, '../../package.json')); const nextVersion = nextJson.version; const nextVersions = { ...nextJson.dependencies, ...nextJson.devDependencies, }; const name = (process.argv.length >= 2 ? process.argv[2] : '') || 'ng-alain'; -const packagePath = path.resolve(__dirname, name.startsWith('../') ? name : `../../../${name}/package.json`); +const packagePath = resolve(__dirname, name.startsWith('../') ? name : `../../../${name}/package.json`); console.log(`Use packagePath: ` + packagePath); -if (!fs.existsSync(packagePath)) { +if (!existsSync(packagePath)) { throw Error(`所选的文件不存在, ${packagePath}`) } -const json = fs.readJSONSync(packagePath); +const json = readJSONSync(packagePath); // Update third party ['dependencies', 'devDependencies'].forEach(type => { Object.keys(json[type]) @@ -36,6 +41,6 @@ json.devDependencies[`@delon/testing`] = `^${nextVersion}`; json.devDependencies[`ng-alain`] = `^${nextVersion}`; // Save -fs.writeJSONSync(packagePath, json, { +writeJSONSync(packagePath, json, { spaces: 2, });