diff --git a/.github/workflows/compressed-size.yml b/.github/workflows/compressed-size.yml index 04e8a356f9..34f234d3eb 100644 --- a/.github/workflows/compressed-size.yml +++ b/.github/workflows/compressed-size.yml @@ -9,8 +9,14 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: compressed-size: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: write # for preactjs/compressed-size-action to create PR comments runs-on: ubuntu-latest env: CI_JOB_NUMBER: 1 diff --git a/.github/workflows/issue-check-inactive.yml b/.github/workflows/issue-check-inactive.yml index df05004109..9a79731004 100644 --- a/.github/workflows/issue-check-inactive.yml +++ b/.github/workflows/issue-check-inactive.yml @@ -4,8 +4,14 @@ on: schedule: - cron: "0 0 */15 * *" +permissions: + contents: read + jobs: issue-check-inactive: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs runs-on: ubuntu-latest steps: - name: check-inactive diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml index 3107470326..be27eb3d86 100644 --- a/.github/workflows/issue-close-require.yml +++ b/.github/workflows/issue-close-require.yml @@ -4,8 +4,14 @@ on: schedule: - cron: "0 0 * * *" +permissions: + contents: read + jobs: issue-close-require: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs runs-on: ubuntu-latest steps: - name: need reproduce diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 889557feca..6fc3d2f19f 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -6,8 +6,14 @@ on: issues: types: [labeled] +permissions: + contents: read + jobs: issue-labeled: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs runs-on: ubuntu-latest steps: - name: help wanted diff --git a/.github/workflows/issue-open-check.yml b/.github/workflows/issue-open-check.yml index 34afcd6dcd..c99f2b12be 100644 --- a/.github/workflows/issue-open-check.yml +++ b/.github/workflows/issue-open-check.yml @@ -4,8 +4,15 @@ on: issues: types: [opened] +permissions: + contents: read + jobs: issue-open-check: + permissions: + contents: read # for visiky/dingtalk-release-notify to get latest release + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs runs-on: ubuntu-latest steps: - uses: actions-cool/check-user-permission@v2 diff --git a/.github/workflows/issue-remove-inactive.yml b/.github/workflows/issue-remove-inactive.yml index 90556c416d..d52e84f39f 100644 --- a/.github/workflows/issue-remove-inactive.yml +++ b/.github/workflows/issue-remove-inactive.yml @@ -6,8 +6,14 @@ on: issue_comment: types: [created, edited] +permissions: + contents: read + jobs: issue-remove-inactive: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs runs-on: ubuntu-latest steps: - name: remove inactive diff --git a/.github/workflows/issues-similarity-analysis.yml b/.github/workflows/issues-similarity-analysis.yml index 8a378357f6..64aa8ced80 100644 --- a/.github/workflows/issues-similarity-analysis.yml +++ b/.github/workflows/issues-similarity-analysis.yml @@ -4,8 +4,13 @@ on: issues: types: [opened, edited] +permissions: + contents: read + jobs: similarity-analysis: + permissions: + issues: write # for actions-cool/issues-similarity-analysis to create issue comments runs-on: ubuntu-latest steps: - name: analysis diff --git a/.github/workflows/pr-check-ci.yml b/.github/workflows/pr-check-ci.yml index e3e608b4b5..d842bd97e7 100644 --- a/.github/workflows/pr-check-ci.yml +++ b/.github/workflows/pr-check-ci.yml @@ -5,8 +5,16 @@ on: schedule: - cron: "*/10 * * * *" +permissions: + contents: read + jobs: pr-check-ci: + permissions: + checks: read # for actions-cool/check-pr-ci to get check reference + contents: write # for actions-cool/check-pr-ci to merge PRs + issues: write # for actions-cool/check-pr-ci to update issues + pull-requests: write # for actions-cool/check-pr-ci to update PRs runs-on: ubuntu-latest steps: - uses: actions-cool/check-pr-ci@v1 diff --git a/.github/workflows/pr-check-merge.yml b/.github/workflows/pr-check-merge.yml index c2ff3d4e10..8f628af602 100644 --- a/.github/workflows/pr-check-merge.yml +++ b/.github/workflows/pr-check-merge.yml @@ -4,8 +4,14 @@ on: pull_request_target: types: [opened] +permissions: + contents: read + jobs: pr-check-merge: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs runs-on: ubuntu-latest if: (github.event.pull_request.head.ref == 'feature' || github.event.pull_request.head.ref == 'master') && github.event.pull_request.head.user.login == 'ant-design' steps: diff --git a/.github/workflows/pr-open-check.yml b/.github/workflows/pr-open-check.yml index 6dfdb39ff2..19a3bed997 100644 --- a/.github/workflows/pr-open-check.yml +++ b/.github/workflows/pr-open-check.yml @@ -4,8 +4,14 @@ on: pull_request_target: types: [opened, edited, reopened, synchronize] +permissions: + contents: read + jobs: refuse: + permissions: + issues: write # for actions-cool/pr-welcome to create, update & react on issues + pull-requests: write # for actions-cool/pr-welcome to request reviewer runs-on: ubuntu-latest steps: - uses: actions-cool/pr-welcome@v1 @@ -19,6 +25,8 @@ jobs: close: true check-changelog: + permissions: + pull-requests: write # for actions-cool/pr-check-fill to create or update PR comments runs-on: ubuntu-latest steps: - name: check fill diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index b50497d7a1..0af77d36c4 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: # Prepare node modules. Reuse cache if available setup: diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml index 6ed0f06f05..5726bb1acc 100644 --- a/.github/workflows/preview-deploy.yml +++ b/.github/workflows/preview-deploy.yml @@ -8,8 +8,15 @@ on: types: - completed +permissions: + contents: read + jobs: deploy-site: + permissions: + actions: read # for dawidd6/action-download-artifact to query and download artifacts + issues: write # for actions-cool/maintain-one-comment to modify or create issue comments + pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments name: deploy preview runs-on: ubuntu-latest if: > @@ -65,6 +72,10 @@ jobs: number: ${{ steps.pr.outputs.id }} build-site-failed: + permissions: + actions: read # for dawidd6/action-download-artifact to query and download artifacts + issues: write # for actions-cool/maintain-one-comment to modify or create issue comments + pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments name: build preview failed runs-on: ubuntu-latest if: > diff --git a/.github/workflows/preview-start.yml b/.github/workflows/preview-start.yml index fdd2ad9dd6..692b09c5ed 100644 --- a/.github/workflows/preview-start.yml +++ b/.github/workflows/preview-start.yml @@ -10,8 +10,14 @@ on: pull_request_target: types: [opened, synchronize, reopened] +permissions: + contents: read + jobs: preview-start: + permissions: + issues: write # for actions-cool/maintain-one-comment to modify or create issue comments + pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments name: start preview info runs-on: ubuntu-latest steps: diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index facf27780b..01f3942cda 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -4,8 +4,14 @@ on: issue_comment: types: [created] +permissions: + contents: read + jobs: rebase: + permissions: + contents: write # for cirrus-actions/rebase to push code to rebase + pull-requests: read # for cirrus-actions/rebase to get info about PR name: Rebase if: github.event.issue.pull_request != '' && (contains(github.event.comment.body, '/rebase') || contains(github.event.comment.body, '\rebase')) runs-on: ubuntu-latest diff --git a/.github/workflows/release-helper.yml b/.github/workflows/release-helper.yml index 05ee24a927..61723624cc 100644 --- a/.github/workflows/release-helper.yml +++ b/.github/workflows/release-helper.yml @@ -10,8 +10,13 @@ name: Release Helper on: create +permissions: + contents: read + jobs: release-helper: + permissions: + contents: write # for actions-cool/release-helper to create releases if: github.event.ref_type == 'tag' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/site-deploy.yml b/.github/workflows/site-deploy.yml index 57553c24fd..f358c15171 100644 --- a/.github/workflows/site-deploy.yml +++ b/.github/workflows/site-deploy.yml @@ -4,6 +4,9 @@ name: Deploy website on: create +permissions: + contents: read + jobs: setup: runs-on: ubuntu-latest diff --git a/.github/workflows/sync-gitee.yml b/.github/workflows/sync-gitee.yml index 4b62ef4245..b9685e8dee 100644 --- a/.github/workflows/sync-gitee.yml +++ b/.github/workflows/sync-gitee.yml @@ -10,8 +10,13 @@ on: - 3.x-stable create: +permissions: + contents: read + jobs: mirror: + permissions: + contents: none runs-on: ubuntu-latest if: github.repository == 'ant-design/ant-design' steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fda0e3ca65..a263110e3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: setup: runs-on: ubuntu-latest @@ -23,7 +26,7 @@ jobs: key: lock-${{ github.sha }} - name: create package-lock.json - run: npm i --package-lock-only --ignore-scripts --force + run: npm i --package-lock-only --ignore-scripts - name: hack for single file run: | @@ -40,7 +43,7 @@ jobs: - name: install if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci --force + run: npm ci lint: runs-on: ubuntu-latest @@ -231,8 +234,7 @@ jobs: name: test strategy: matrix: - react: ['16', '17'] - # react: ['17', '18'] + react: ['16', '17', '18'] module: ['dom', 'node', 'dist'] env: REACT: ${{ matrix.react }} @@ -349,8 +351,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - react: ['16', '17'] - # react: ['17', '18'] + react: ['16', '17', '18'] module: [lib, es] env: REACT: ${{ matrix.react }} @@ -402,4 +403,4 @@ jobs: run: npm test env: LIB_DIR: ${{ matrix.module }} - needs: compile \ No newline at end of file + needs: compile diff --git a/.github/workflows/ui-upload.yml b/.github/workflows/ui-upload.yml index a1c925f4be..632e53a1e8 100644 --- a/.github/workflows/ui-upload.yml +++ b/.github/workflows/ui-upload.yml @@ -8,8 +8,14 @@ on: types: - completed +permissions: + contents: read + jobs: upload-ui: + permissions: + actions: read # for dawidd6/action-download-artifact to query and download artifacts + pull-requests: read # for dawidd6/action-download-artifact to query commit hash name: deploy preview runs-on: ubuntu-latest if: > diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml index 5484c116a0..1b70d0aa80 100644 --- a/.github/workflows/ui.yml +++ b/.github/workflows/ui.yml @@ -12,6 +12,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/verify-files-modify.yml b/.github/workflows/verify-files-modify.yml index d76777352f..bb4c0157c7 100644 --- a/.github/workflows/verify-files-modify.yml +++ b/.github/workflows/verify-files-modify.yml @@ -4,8 +4,13 @@ on: pull_request_target: types: [opened, synchronize] +permissions: + contents: read + jobs: verify: + permissions: + pull-requests: write # for actions-cool/verify-files-modify to update status of PRs runs-on: ubuntu-latest steps: - name: verify-version diff --git a/.github/workflows/verify-package-version.yml b/.github/workflows/verify-package-version.yml index 23ad7572f4..6ff6065a35 100644 --- a/.github/workflows/verify-package-version.yml +++ b/.github/workflows/verify-package-version.yml @@ -4,8 +4,14 @@ on: pull_request: types: [opened, edited, reopened, synchronize, ready_for_review] +permissions: + contents: read + jobs: verify: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: write # for actions-cool/verify-package-version to comment on PR runs-on: ubuntu-latest if: contains(github.event.pull_request.title, 'changelog') || contains(github.event.pull_request.title, 'release') steps: diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 7897081762..c29c7204d4 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,15 @@ timeline: true --- +## 4.19.5 + +`2022-04-02` + +- 🐞 Fix Form that not keep store value when unmount and mount again. [#34845](https://github.com/ant-design/ant-design/pull/34845) +- 🐞 Fix Pagination under `` should display middle size Select. [#34756](https://github.com/ant-design/ant-design/pull/34756) +- 🐞 fix Skeleton to unable to render `childten` of non-react element. [#34751](https://github.com/ant-design/ant-design/pull/34751) [@1247748612](https://github.com/1247748612) +- 💄 Fix Tag `@tag-border-radius` less variable not work. [#34741](https://github.com/ant-design/ant-design/pull/34741) + ## 4.19.4 `2022-03-27` @@ -38,7 +47,8 @@ timeline: true - 💄 Fix missing `status` style in RangePicker. [#34509](https://github.com/ant-design/ant-design/pull/34509) - 🛎 Add warning for Input getting blurred when dynamically add `hasFeedback`. [#34475](https://github.com/ant-design/ant-design/pull/34475) - 🐞 Fix missing classname in input when Input has `prefix` or `suffix`. [#34474](https://github.com/ant-design/ant-design/pull/34474) -- 🌐 Updated it_LT locale for `typeTemplate`. [#34567](https://github.com/ant-design/ant-design/pull/34567) [@Anizcus](https://gitit_LTit_LThub.com/Anizcus) +- 🇱🇹 Updated lt_LT locale for `typeTemplate`. [#34567](https://github.com/ant-design/ant-design/pull/34567) [@Anizcus](https://gitit_LTit_LThub.com/Anizcus) +- 🇮🇹 Updated it_iT locale for `Table`. [#34566](https://github.com/ant-design/ant-design/pull/34566) [@freshgiammi](https://gitit_LTit_LThub.com/freshgiammi) ## 4.19.2 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 54b589cdbd..e2f1f1693e 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,15 @@ timeline: true --- +## 4.19.5 + +`2022-04-02` + +- 🐞 修复 Form 在整个被 unmount 后再次 mount,原 Form 的值会被重置的问题。[#34845](https://github.com/ant-design/ant-design/pull/34845) +- 🐞 修复 Pagination 在 `` 下的 Select 大小问题。[#34756](https://github.com/ant-design/ant-design/pull/34756) +- 🐞 修复 Skeleton 不渲染非 react element 类型的 `children` 问题。[#34751](https://github.com/ant-design/ant-design/pull/34751) [@1247748612](https://github.com/1247748612) +- 💄 修复 Tag `@tag-border-radius` less 变量不生效的问题。[#34741](https://github.com/ant-design/ant-design/pull/34741) + ## 4.19.4 `2022-03-27` @@ -38,7 +47,8 @@ timeline: true - 💄 修复 RangePicker `status` 相关样式丢失的问题。[#34509](https://github.com/ant-design/ant-design/pull/34509) - 🛎 为动态改变 Form.Item 的 `hasFeedback` 时 Input 焦点丢失添加警告。[#34475](https://github.com/ant-design/ant-design/pull/34475) - 🐞 修复 Input 有 `prefix` 或者 `suffix` 时 input 缺少某些 className 的问题。[#34474](https://github.com/ant-design/ant-design/pull/34474) -- 🌐 更新 it_LT 的 locale。[#34567](https://github.com/ant-desin/ant-design/pull/34567) [@Anizcus](https://github.com/Anizcus) +- 🇱🇹 更新 lt_LT 的 locale。[#34567](https://github.com/ant-design/ant-design/pull/34567) [@Anizcus](https://github.com/Anizcus) +- 🇮🇹 更新 it_iT 的 locale。[#34566](https://github.com/ant-design/ant-design/pull/34566) [@freshgiammi](https://gitit_LTit_LThub.com/freshgiammi) ## 4.19.2 diff --git a/components/_util/ActionButton.tsx b/components/_util/ActionButton.tsx index 45f209602c..0600ceeac4 100644 --- a/components/_util/ActionButton.tsx +++ b/components/_util/ActionButton.tsx @@ -12,6 +12,7 @@ export interface ActionButtonProps { buttonProps?: ButtonProps; emitEvent?: boolean; quitOnNullishReturnValue?: boolean; + children?: React.ReactNode; } function isThenable(thing?: PromiseLike): boolean { diff --git a/components/_util/throttleByAnimationFrame.tsx b/components/_util/throttleByAnimationFrame.tsx index 54516d3228..c04923cd40 100644 --- a/components/_util/throttleByAnimationFrame.tsx +++ b/components/_util/throttleByAnimationFrame.tsx @@ -1,20 +1,26 @@ import raf from 'rc-util/lib/raf'; -export function throttleByAnimationFrame(fn: (...args: any[]) => void) { +export function throttleByAnimationFrame(fn: (...args: T) => void) { let requestId: number | null; - const later = (args: any[]) => () => { + const later = (args: T) => () => { requestId = null; fn(...args); }; - const throttled = (...args: any[]) => { + const throttled: { + (...args: T): void; + cancel: () => void; + } = (...args: T) => { if (requestId == null) { requestId = raf(later(args)); } }; - (throttled as any).cancel = () => raf.cancel(requestId!); + throttled.cancel = () => { + raf.cancel(requestId!); + requestId = null; + }; return throttled; } diff --git a/components/_util/wave.tsx b/components/_util/wave.tsx index 4cd8c49ea1..bf06f49573 100644 --- a/components/_util/wave.tsx +++ b/components/_util/wave.tsx @@ -27,6 +27,7 @@ function isNotGrey(color: string) { export interface WaveProps { insertExtraNode?: boolean; disabled?: boolean; + children?: React.ReactNode; } export default class Wave extends React.Component { diff --git a/components/affix/demo/basic.md b/components/affix/demo/basic.md index 292d823058..93dcd5ae63 100644 --- a/components/affix/demo/basic.md +++ b/components/affix/demo/basic.md @@ -38,5 +38,5 @@ const Demo: React.FC = () => { ); }; -ReactDOM.render(, mountNode); +export default () => ; ``` diff --git a/components/affix/demo/debug.md b/components/affix/demo/debug.md index 5300bf5230..f8a97b4435 100644 --- a/components/affix/demo/debug.md +++ b/components/affix/demo/debug.md @@ -35,5 +35,5 @@ const Demo: React.FC = () => { ); }; -ReactDOM.render(, mountNode); +export default () => ; ``` diff --git a/components/affix/demo/on-change.md b/components/affix/demo/on-change.md index acbdd7d3c1..48cdbba705 100644 --- a/components/affix/demo/on-change.md +++ b/components/affix/demo/on-change.md @@ -16,10 +16,9 @@ Callback with affixed state. ```tsx import { Affix, Button } from 'antd'; -ReactDOM.render( +export default () => ( console.log(affixed)}> - , - mountNode, + ); ``` diff --git a/components/affix/demo/target.md b/components/affix/demo/target.md index a938374c8d..0fad871175 100644 --- a/components/affix/demo/target.md +++ b/components/affix/demo/target.md @@ -30,7 +30,7 @@ const Demo: React.FC = () => { ); }; -ReactDOM.render(, mountNode); +export default () => ; ``` ', '') .replace('