diff --git a/.github/workflows/chain-alert.yml b/.github/workflows/chain-alert.yml new file mode 100644 index 0000000000..edb9c6af7e --- /dev/null +++ b/.github/workflows/chain-alert.yml @@ -0,0 +1,12 @@ +name: ChainAlert +on: + schedule: + - cron: '0 0 * * *' + push: + branches: [ master ] +jobs: + chainalert: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: checkmarx/chainalert-github-action@v1 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index b46c47fa42..3c2456cfcd 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -13,7 +13,7 @@ timeline: true - 次版本号:每月发布一个带有新特性的向下兼容的版本。 - 主版本号:含有破坏性更新和新特性,不在发布周期内。 --- +--- ## 4.19.2 diff --git a/components/badge/style/rtl.less b/components/badge/style/rtl.less index 7d7c02867c..a322596929 100644 --- a/components/badge/style/rtl.less +++ b/components/badge/style/rtl.less @@ -6,7 +6,7 @@ &:not(&-not-a-wrapper) &-count, &:not(&-not-a-wrapper) &-dot, &:not(&-not-a-wrapper) .@{number-prefix-cls}-custom-component { - .@{badge-prefix-cls}-rtl & { + .@{badge-prefix-cls}-rtl& { right: auto; left: 0; direction: ltr; diff --git a/components/grid/style/index.less b/components/grid/style/index.less index 10f2136094..1369f0035c 100644 --- a/components/grid/style/index.less +++ b/components/grid/style/index.less @@ -2,9 +2,6 @@ @import '../../style/mixins/index'; @import './mixin'; -@row-prefix-cls: ~'@{ant-prefix}-row'; -@col-prefix-cls: ~'@{ant-prefix}-col'; - // Grid system .@{row-prefix-cls} { display: flex; diff --git a/components/grid/style/mixin.less b/components/grid/style/mixin.less index 4d9de47060..7182bf4e45 100644 --- a/components/grid/style/mixin.less +++ b/components/grid/style/mixin.less @@ -1,49 +1,52 @@ @import '../../style/mixins/index'; +@row-prefix-cls: ~'@{ant-prefix}-row'; +@col-prefix-cls: ~'@{ant-prefix}-col'; + // mixins for grid system // ------------------------ .loop-grid-columns(@index, @class) when (@index > 0) { - .@{ant-prefix}-col@{class}-@{index} { + .@{col-prefix-cls}@{class}-@{index} { display: block; flex: 0 0 percentage((@index / @grid-columns)); max-width: percentage((@index / @grid-columns)); } - .@{ant-prefix}-col@{class}-push-@{index} { + .@{col-prefix-cls}@{class}-push-@{index} { left: percentage((@index / @grid-columns)); } - .@{ant-prefix}-col@{class}-pull-@{index} { + .@{col-prefix-cls}@{class}-pull-@{index} { right: percentage((@index / @grid-columns)); } - .@{ant-prefix}-col@{class}-offset-@{index} { + .@{col-prefix-cls}@{class}-offset-@{index} { margin-left: percentage((@index / @grid-columns)); } - .@{ant-prefix}-col@{class}-order-@{index} { + .@{col-prefix-cls}@{class}-order-@{index} { order: @index; } .loop-grid-columns((@index - 1), @class); } .loop-grid-columns(@index, @class) when (@index = 0) { - .@{ant-prefix}-col@{class}-@{index} { + .@{col-prefix-cls}@{class}-@{index} { display: none; } - .@{ant-prefix}-col-push-@{index} { + .@{col-prefix-cls}-push-@{index} { left: auto; } - .@{ant-prefix}-col-pull-@{index} { + .@{col-prefix-cls}-pull-@{index} { right: auto; } - .@{ant-prefix}-col@{class}-push-@{index} { + .@{col-prefix-cls}@{class}-push-@{index} { left: auto; } - .@{ant-prefix}-col@{class}-pull-@{index} { + .@{col-prefix-cls}@{class}-pull-@{index} { right: auto; } - .@{ant-prefix}-col@{class}-offset-@{index} { + .@{col-prefix-cls}@{class}-offset-@{index} { margin-left: 0; } - .@{ant-prefix}-col@{class}-order-@{index} { + .@{col-prefix-cls}@{class}-order-@{index} { order: 0; } } diff --git a/components/grid/style/rtl.less b/components/grid/style/rtl.less index 5a9e7256b8..b098812bc5 100644 --- a/components/grid/style/rtl.less +++ b/components/grid/style/rtl.less @@ -1,7 +1,8 @@ @import '../../style/themes/index'; @import '../../style/mixins/index'; +@import './mixin'; -.@{ant-prefix}-row { +.@{row-prefix-cls} { &-rtl { direction: rtl; } @@ -9,25 +10,25 @@ // mixin .loop-grid-columns(@index, @class) when (@index > 0) { - .@{ant-prefix}-col@{class}-push-@{index} { + .@{col-prefix-cls}@{class}-push-@{index} { // reset property in RTL direction - &.@{ant-prefix}-col-rtl { + &.@{col-prefix-cls}-rtl { right: percentage((@index / @grid-columns)); left: auto; } } - .@{ant-prefix}-col@{class}-pull-@{index} { + .@{col-prefix-cls}@{class}-pull-@{index} { // reset property in RTL direction - &.@{ant-prefix}-col-rtl { + &.@{col-prefix-cls}-rtl { right: auto; left: percentage((@index / @grid-columns)); } } - .@{ant-prefix}-col@{class}-offset-@{index} { + .@{col-prefix-cls}@{class}-offset-@{index} { // reset property in RTL direction - &.@{ant-prefix}-col-rtl { + &.@{col-prefix-cls}-rtl { margin-right: percentage((@index / @grid-columns)); margin-left: 0; } @@ -35,33 +36,33 @@ } .loop-grid-columns(@index, @class) when (@index = 0) { - .@{ant-prefix}-col-push-@{index} { + .@{col-prefix-cls}-push-@{index} { // reset property in RTL direction - &.@{ant-prefix}-col-rtl { + &.@{col-prefix-cls}-rtl { right: auto; } } - .@{ant-prefix}-col-pull-@{index} { - &.@{ant-prefix}-col-rtl { + .@{col-prefix-cls}-pull-@{index} { + &.@{col-prefix-cls}-rtl { left: auto; } } - .@{ant-prefix}-col@{class}-push-@{index} { - &.@{ant-prefix}-col-rtl { + .@{col-prefix-cls}@{class}-push-@{index} { + &.@{col-prefix-cls}-rtl { right: auto; } } - .@{ant-prefix}-col@{class}-pull-@{index} { - &.@{ant-prefix}-col-rtl { + .@{col-prefix-cls}@{class}-pull-@{index} { + &.@{col-prefix-cls}-rtl { left: auto; } } - .@{ant-prefix}-col@{class}-offset-@{index} { - &.@{ant-prefix}-col-rtl { + .@{col-prefix-cls}@{class}-offset-@{index} { + &.@{col-prefix-cls}-rtl { margin-right: 0; } } diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 50ff4b9b53..d7e922192d 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -146,7 +146,7 @@ const Input = forwardRef((props, ref) => { // Style const [wrapSSR, hashId] = useStyle(prefixCls, iconPrefixCls); - // ===================== Status ===================== + // ===================== Size ===================== const size = React.useContext(SizeContext); const mergedSize = customSize || size; diff --git a/components/input/__tests__/type.test.tsx b/components/input/__tests__/type.test.tsx new file mode 100644 index 0000000000..58acf6fb19 --- /dev/null +++ b/components/input/__tests__/type.test.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Input from '..'; +import { InputProps } from '../Input'; + +describe('Input types', () => { + it('should support data-attributes', () => { + const dataProps: InputProps = { + 'data-test': 'test', + size: 'large', + }; + const wrapper = mount(); + expect(wrapper.find('input').prop('data-test')).toBe('test'); + const wrapper2 = mount(); + expect(wrapper2.find('input').prop('data-test')).toBe('test'); + }); +}); diff --git a/components/input/index.en-US.md b/components/input/index.en-US.md index 2a563d7a47..fabcc3865b 100644 --- a/components/input/index.en-US.md +++ b/components/input/index.en-US.md @@ -29,7 +29,7 @@ A basic widget for getting the user input is a text field. Keyboard and mouse ca | showCount | Whether show text count | boolean \| { formatter: ({ count: number, maxLength?: number }) => ReactNode } | false | 4.18.0 | | status | Set validation status | 'error' \| 'warning' | - | 4.19.0 | | prefix | The prefix icon for the Input | ReactNode | - | | -| size | The size of the input box. Note: in the context of a form, the `large` size is used | `large` \| `middle` \| `small` | - | | +| size | The size of the input box. Note: in the context of a form, the `middle` size is used | `large` \| `middle` \| `small` | - | | | suffix | The suffix icon for the Input | ReactNode | - | | | type | The type of input, see: [MDN](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)( use `Input.TextArea` instead of `type="textarea"`) | string | `text` | | | value | The input content value | string | - | | diff --git a/components/input/index.zh-CN.md b/components/input/index.zh-CN.md index c745afd66a..9ed2c1deda 100644 --- a/components/input/index.zh-CN.md +++ b/components/input/index.zh-CN.md @@ -30,7 +30,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/xS9YEJhfe/Input.svg | showCount | 是否展示字数 | boolean \| { formatter: ({ count: number, maxLength?: number }) => ReactNode } | false | 4.18.0 | | status | 设置校验状态 | 'error' \| 'warning' | - | 4.19.0 | | prefix | 带有前缀图标的 input | ReactNode | - | | -| size | 控件大小。注:标准表单内的输入框大小限制为 `large` | `large` \| `middle` \| `small` | - | | +| size | 控件大小。注:标准表单内的输入框大小限制为 `middle` | `large` \| `middle` \| `small` | - | | | suffix | 带有后缀图标的 input | ReactNode | - | | | type | 声明 input 类型,同原生 input 标签的 type 属性,见:[MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input#属性)(请直接使用 `Input.TextArea` 代替 `type="textarea"`) | string | `text` | | | value | 输入框内容 | string | - | | diff --git a/components/locale/it_IT.tsx b/components/locale/it_IT.tsx index a22dbca301..17a64c0823 100644 --- a/components/locale/it_IT.tsx +++ b/components/locale/it_IT.tsx @@ -17,6 +17,8 @@ const localeValues: Locale = { filterTitle: 'Menù Filtro', filterConfirm: 'OK', filterReset: 'Reset', + selectNone: 'Deseleziona tutto', + selectionAll: 'Seleziona tutto', selectAll: 'Seleziona pagina corrente', selectInvert: 'Inverti selezione nella pagina corrente', sortTitle: 'Ordina', diff --git a/components/locale/lt_LT.tsx b/components/locale/lt_LT.tsx index 857d6ffda5..0573b87718 100644 --- a/components/locale/lt_LT.tsx +++ b/components/locale/lt_LT.tsx @@ -6,7 +6,7 @@ import TimePicker from '../time-picker/locale/lt_LT'; import Calendar from '../calendar/locale/lt_LT'; import { Locale } from '../locale-provider'; -const typeTemplate: string = '${label} не является типом ${type}'; +const typeTemplate: string = '${label} neatitinka tipo ${type}'; const localeValues: Locale = { locale: 'lt', diff --git a/components/tooltip/style/index.less b/components/tooltip/style/index.less index 697f685574..129ab7fc43 100644 --- a/components/tooltip/style/index.less +++ b/components/tooltip/style/index.less @@ -201,7 +201,7 @@ } .@{tooltip-prefix-cls}-arrow { &-content::before { - background-color: @@lightColor; + background: @@lightColor; } } } diff --git a/components/tree-select/index.en-US.md b/components/tree-select/index.en-US.md index 4a8a49c1c0..feae8947e8 100644 --- a/components/tree-select/index.en-US.md +++ b/components/tree-select/index.en-US.md @@ -55,6 +55,7 @@ Tree selection control. | treeDefaultExpandedKeys | Default expanded treeNodes | string\[] | - | | | treeExpandedKeys | Set expanded keys | string\[] | - | | | treeIcon | Shows the icon before a TreeNode's title. There is no default style; you must set a custom style for it if set to `true` | boolean | false | | +| treeLoadedKeys | (Controlled) Set loaded tree nodes, work with `loadData` only | string[] | [] | | | treeLine | Show the line. Ref [Tree - showLine](/components/tree/#components-tree-demo-line) | boolean \| object | false | 4.17.0 | | treeNodeFilterProp | Will be used for filtering if `filterTreeNode` returns true | string | `value` | | | treeNodeLabelProp | Will render as content of select | string | `title` | | diff --git a/components/tree-select/index.zh-CN.md b/components/tree-select/index.zh-CN.md index 83e6179403..a5e3cbdca7 100644 --- a/components/tree-select/index.zh-CN.md +++ b/components/tree-select/index.zh-CN.md @@ -57,6 +57,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Ax4DA0njr/TreeSelect.svg | treeExpandedKeys | 设置展开的树节点 | string\[] | - | | | treeIcon | 是否展示 TreeNode title 前的图标,没有默认样式,如设置为 true,需要自行定义图标相关样式 | boolean | false | | | treeLine | 是否展示线条样式,请参考 [Tree - showLine](/components/tree/#components-tree-demo-line) | boolean \| object | false | 4.17.0 | +| treeLoadedKeys | (受控)已经加载的节点,需要配合 `loadData` 使用 | string[] | [] | | | treeNodeFilterProp | 输入项过滤对应的 treeNode 属性 | string | `value` | | | treeNodeLabelProp | 作为显示的 prop 设置 | string | `title` | | | value | 指定当前选中的条目 | string \| string\[] | - | | diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index c80ccc84c5..90b7b29f63 100644 --- a/components/tree/index.en-US.md +++ b/components/tree/index.en-US.md @@ -45,7 +45,6 @@ Almost anything can be represented in a tree structure. Examples include directo | switcherIcon | Customize collapse/expand icon of tree node | ReactNode | - | | | titleRender | Customize tree node title render | (nodeData) => ReactNode | - | 4.5.0 | | treeData | The treeNodes data Array, if set it then you need not to construct children TreeNode. (key should be unique across the whole array) | array<{ key, title, children, \[disabled, selectable] }> | - | | -| treeLoadedKeys | (Controlled) Set loaded tree nodes, work with `loadData` only | string[] | [] | | | virtual | Disable virtual scroll when set to false | boolean | true | 4.1.0 | | onCheck | Callback function for when the onCheck event occurs | function(checkedKeys, e:{checked: bool, checkedNodes, node, event, halfCheckedKeys}) | - | | | onDragEnd | Callback function for when the onDragEnd event occurs | function({event, node}) | - | | diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index a8d9e0211f..97a80356b2 100644 --- a/components/tree/index.zh-CN.md +++ b/components/tree/index.zh-CN.md @@ -46,7 +46,6 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Xh-oWqg9k/Tree.svg | switcherIcon | 自定义树节点的展开/折叠图标 | ReactNode | - | | | titleRender | 自定义渲染节点 | (nodeData) => ReactNode | - | 4.5.0 | | treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点(key 在整个树范围内唯一) | array<{key, title, children, \[disabled, selectable]}> | - | | -| treeLoadedKeys | (受控)已经加载的节点,需要配合 `loadData` 使用 | string[] | [] | | | virtual | 设置 false 时关闭虚拟滚动 | boolean | true | 4.1.0 | | onCheck | 点击复选框触发 | function(checkedKeys, e:{checked: bool, checkedNodes, node, event, halfCheckedKeys}) | - | | | onDragEnd | dragend 触发时调用 | function({event, node}) | - | | diff --git a/docs/react/recommendation.en-US.md b/docs/react/recommendation.en-US.md index 64ea436e38..f189ce8a40 100644 --- a/docs/react/recommendation.en-US.md +++ b/docs/react/recommendation.en-US.md @@ -39,6 +39,7 @@ title: Third-Party Libraries | Animation | [react-move](https://github.com/react-tools/react-move) [Ant Motion](https://motion.ant.design/components/tween-one) [react-spring](https://www.react-spring.io) | | Page Footer | [rc-footer](https://github.com/react-component/footer) | | Water Mark | [WaterMark](https://procomponents.ant.design/components/water-mark) | +| Currency | [react-number-format](https://github.com/s-yadav/react-number-format) [react-currency-input-fiel](https://github.com/cchanxzy/react-currency-input-field) | ## Products we are using ✨ diff --git a/docs/react/recommendation.zh-CN.md b/docs/react/recommendation.zh-CN.md index 8c34b9c779..a7318a333a 100644 --- a/docs/react/recommendation.zh-CN.md +++ b/docs/react/recommendation.zh-CN.md @@ -39,6 +39,7 @@ title: 社区精选组件 | 动画 | [react-move](https://github.com/react-tools/react-move) [Ant Motion](https://motion.ant.design/components/tween-one) [react-spring](https://www.react-spring.io) | | 页脚 | [rc-footer](https://github.com/react-component/footer) | | 水印 | [WaterMark](https://procomponents.ant.design/components/water-mark) | +| 金额格式化 | [react-number-format](https://github.com/s-yadav/react-number-format) [react-currency-input-fiel](https://github.com/cchanxzy/react-currency-input-field) | ## 推荐产品 ✨ diff --git a/package.json b/package.json index cd3eec670f..8a51777265 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,7 @@ "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.4", "@types/enzyme": "^3.10.5", - "@types/gtag.js": "^0.0.8", + "@types/gtag.js": "^0.0.10", "@types/jest": "^27.0.0", "@types/jest-axe": "^3.5.3", "@types/jest-environment-puppeteer": "^5.0.0",