Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from ant-design:master #207

Closed
wants to merge 87 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6af1d95
feat: Input & TextArea support count (#45140)
zombieJ Oct 10, 2023
bef9539
feat: Table support `scrollTo` `reference` (#45245)
zombieJ Oct 11, 2023
012e878
Merge pull request #45271 from ant-design/master
zombieJ Oct 12, 2023
eaf4949
feat: App support component (#45292)
zombieJ Oct 12, 2023
44e1493
feat: Watermark support inherit to disable passing (#45319)
zombieJ Oct 13, 2023
8b486f3
Merge branch master into master-merge-feature
li-jia-nan Oct 15, 2023
5b47f16
Merge branch master into master-merge-feature
li-jia-nan Oct 15, 2023
442e175
feat: update snap
kiner-tang Oct 15, 2023
0de095c
Merge branch 'master' into master-merge-feature
li-jia-nan Oct 15, 2023
bb6ef6f
fix: update snap
li-jia-nan Oct 15, 2023
00d74a3
Merge branch 'master' into master-merge-feature
li-jia-nan Oct 15, 2023
f9e5547
fix: update snap
li-jia-nan Oct 15, 2023
1474006
feat: update snap
kiner-tang Oct 16, 2023
cb7e11a
feat: update snap
kiner-tang Oct 16, 2023
e62197a
Merge pull request #45347 from ant-design/master-merge-feature
zombieJ Oct 16, 2023
9a04519
fix: InputNumber dynamic formatter (#45325)
zombieJ Oct 16, 2023
98a8d30
feat: Tabs items support destroyInactiveTabPane (#45359)
zombieJ Oct 16, 2023
11cdac4
chore: bump rc-tabs (#45370)
zombieJ Oct 17, 2023
d8140e0
Merge pull request #45381 from ant-design/master
zombieJ Oct 17, 2023
a337fee
fix: dropdown not trigger onOpenChange when click menu item (#45378)
zombieJ Oct 17, 2023
3ab42ad
feat: support dirty (#45389)
zombieJ Oct 17, 2023
2e8e67f
feat: support changeOnBlur (#45395)
zombieJ Oct 18, 2023
cc223a1
feat(spin): Adds `fullscreen` property to `<Spin />` component (#44986)
Rafael-Martins Oct 19, 2023
dde3651
feat: Modal & Select support z-index context to manage z-index (#45346)
kiner-tang Oct 19, 2023
d51de67
Merge branch 'feature' into refactor-z-index-context
kiner-tang Oct 20, 2023
f25fd3c
chore: auto merge branches (#45444)
github-actions[bot] Oct 20, 2023
bff04cd
Merge branch 'feature' into refactor-z-index-context
kiner-tang Oct 20, 2023
0fd730a
feat: Popconfirm support z-index manager (#45421)
kiner-tang Oct 20, 2023
8c49b38
feat: Popover support z-index manager (#45420)
kiner-tang Oct 20, 2023
bf1468a
feat: Tooltip support z-index manager (#45422)
kiner-tang Oct 20, 2023
193c3b4
feat: Tour support z-index manager (#45425)
kiner-tang Oct 20, 2023
30c8e42
feat: add transition to spin fullscreen (#45436)
li-jia-nan Oct 20, 2023
3627031
feat: Drawer support z-index manager (#45417)
kiner-tang Oct 20, 2023
7784617
Merge branch 'master' into feature-merge-master
yoyo837 Oct 21, 2023
c7661ce
chore: update site snap
yoyo837 Oct 21, 2023
7c31c62
chore: auto merge branches (#45464)
github-actions[bot] Oct 21, 2023
e740269
feat: z-index container opt (#45490)
kiner-tang Oct 23, 2023
6d9db9f
feat: dropdown support z-index manager (#45486)
kiner-tang Oct 23, 2023
2940f62
chore: auto merge branches (#45501)
github-actions[bot] Oct 23, 2023
d04e9ef
feat: config-provider support rangePicker className and style (#45479)
Yueyanc Oct 23, 2023
3cb2738
feat: SelectLike components support z-index manager (#45494)
kiner-tang Oct 24, 2023
a29a079
feat: columnTitle render props (#41937)
Zhou-Bill Oct 24, 2023
e7109d3
feat: ColorPicker support z-index manager (#45496)
kiner-tang Oct 24, 2023
3ec0ec2
feat: DatePicker & TimePicker support z-index manager (#45497)
kiner-tang Oct 24, 2023
de442ca
feat: menu support z-index manager (#45498)
kiner-tang Oct 24, 2023
bceb2e2
Merge branch 'feature' into refactor-z-index-context
kiner-tang Oct 24, 2023
90c4fab
Merge pull request #45512 from ant-design/refactor-z-index-context
kiner-tang Oct 25, 2023
5a45276
feat: Add useMultipleSelect hooks, transfer supports multiple select …
zbw-zbw Oct 26, 2023
2dbcd20
feat: Pagination support combine simple and pageSizeChanger (#45538)
MadCcc Oct 26, 2023
661f3e8
Merge branch 'master' into feature-merge-master
li-jia-nan Oct 29, 2023
cd60418
chore: auto merge branches (#45572)
github-actions[bot] Oct 29, 2023
fc56106
feat: Implement `optionRender` API (#45529)
RedJue Oct 31, 2023
b14faf0
feat: CP support Dropdown className and style (#45621)
li-jia-nan Nov 1, 2023
300c1f3
docs: remove dead links (#45624)
jibolash Nov 2, 2023
d8fbefc
feat(Modal): Modal static function accept 'styles' (#45558)
KotoriK Nov 2, 2023
923aaba
chore: add lodash eslint (#45627)
crazyair Nov 2, 2023
9f1b8f1
docs: fix code selection style issue (#45631)
MadCcc Nov 2, 2023
95322ea
fix: InputNumber in Form with hasFeedback should not lose focus (#45632)
MadCcc Nov 2, 2023
e6d9232
docs: fix demo editor shadow (#45636)
MadCcc Nov 2, 2023
d9902eb
chore(deps-dev): bump eslint-plugin-unicorn from 48.0.1 to 49.0.0 (#4…
dependabot[bot] Nov 2, 2023
56c2b56
docs(input): add placeholder (#45643)
Simon-He95 Nov 2, 2023
bf15203
Docs: usage with next.js, add information about workaround for Next.j…
pavelee Nov 2, 2023
52d2439
Merge branch 'master' into feature-merge-master
MadCcc Nov 3, 2023
da9ca05
chore: auto merge branches (#45645)
github-actions[bot] Nov 3, 2023
99138cb
feat(color-picker): preset colors support collapsing at initializatio…
Wxh16144 Nov 3, 2023
ad3b73a
chore: auto merge branches (#45648)
github-actions[bot] Nov 3, 2023
d7e2330
chore: bump rc-* (#45650)
yoyo837 Nov 3, 2023
f46587b
fix: Slider handler should be movable after click tracker (#45651)
afc163 Nov 3, 2023
321dfd8
feat: show Slider tooltip when focus handler (#45653)
afc163 Nov 3, 2023
f3c37a3
refactor(color-picker): rename `defaultCollapsed` => `defaultOpen` (#…
Wxh16144 Nov 3, 2023
7616c35
✨ docs: changelog 5.11.0 (#45649)
MadCcc Nov 3, 2023
e0a6244
test: fix test case
afc163 Nov 3, 2023
f15bddf
chore: fix ci download artifact logic (#45661)
Wxh16144 Nov 3, 2023
13ae715
docs: solve error about dropdown (#45662)
kiner-tang Nov 3, 2023
38c2002
style: fix Upload border color when drag over (#45663)
Oceansdeep7 Nov 3, 2023
b888f69
test: fix Slider test case in React 16 (#45664)
kiner-tang Nov 3, 2023
bcd8a78
ci: timed check for dependency updates (#45593)
Wxh16144 Nov 3, 2023
fe59bb0
docs: optimize (#45659)
MadCcc Nov 3, 2023
d1ed469
type: add generics to AppProps (#45669)
JexLau Nov 3, 2023
f693a68
fix(Image): using chinese language in image components API's table (#…
ParsaArvanehPA Nov 5, 2023
ea25528
chore(deps): update npm to v10.2.3 (#45675)
renovate[bot] Nov 5, 2023
3f683d7
fix: fix App error when component === false (#45671)
li-jia-nan Nov 5, 2023
d9a60a4
docs: Update README.md Contributor Section (#45674)
Aylee-Shomali Nov 5, 2023
3b5a915
fix: notification style width (#45681)
MadCcc Nov 6, 2023
284347c
chore: upgrade deps (#45692)
github-actions[bot] Nov 6, 2023
4a68036
chore: remove unused config files (#45697)
afc163 Nov 7, 2023
d3fc8ed
chore: fix codesandbox ci (#45698)
afc163 Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Implement optionRender API (ant-design#45529)
* feat: implement optionRender api

* chore: bump rc-cascader

* chore: bump rc-tree-select

* docs: update demo

* Update components/select/demo/option-render.md

Co-authored-by: kiner-tang(文辉) <[email protected]>
Signed-off-by: 红果汁 <[email protected]>

* Update components/select/demo/option-render.md

Co-authored-by: kiner-tang(文辉) <[email protected]>
Signed-off-by: 红果汁 <[email protected]>

* Update components/select/index.en-US.md

Co-authored-by: kiner-tang(文辉) <[email protected]>
Signed-off-by: 红果汁 <[email protected]>

* Update components/select/index.zh-CN.md

Co-authored-by: kiner-tang(文辉) <[email protected]>
Signed-off-by: 红果汁 <[email protected]>

* docs: fix doc

* test: update snap

* docs: rename prop

---------

Signed-off-by: 红果汁 <[email protected]>
Co-authored-by: kiner-tang(文辉) <[email protected]>
RedJue and kiner-tang authored Oct 31, 2023
commit fc5610653e5ce6f044dcfebcff03b34c7742118e
Original file line number Diff line number Diff line change
@@ -7380,13 +7380,15 @@ exports[`renders components/select/demo/option-label-prop.tsx extend context cor
style="height: 0px; width: 0px; overflow: hidden;"
>
<div
aria-label="China"
aria-selected="true"
id="rc_select_TEST_OR_SSR_list_0"
role="option"
>
china
</div>
<div
aria-label="USA"
aria-selected="false"
id="rc_select_TEST_OR_SSR_list_1"
role="option"
@@ -7410,7 +7412,7 @@ exports[`renders components/select/demo/option-label-prop.tsx extend context cor
<div
aria-selected="true"
class="ant-select-item ant-select-item-option ant-select-item-option-active ant-select-item-option-selected"
label="China"
title="China"
>
<div
class="ant-select-item-option-content"
@@ -7465,7 +7467,7 @@ exports[`renders components/select/demo/option-label-prop.tsx extend context cor
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
label="USA"
title="USA"
>
<div
class="ant-select-item-option-content"
@@ -7494,7 +7496,7 @@ exports[`renders components/select/demo/option-label-prop.tsx extend context cor
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
label="Japan"
title="Japan"
>
<div
class="ant-select-item-option-content"
@@ -7523,7 +7525,7 @@ exports[`renders components/select/demo/option-label-prop.tsx extend context cor
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
label="Korea"
title="Korea"
>
<div
class="ant-select-item-option-content"
68 changes: 35 additions & 33 deletions components/select/demo/option-label-prop.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
import React from 'react';
import type { SelectProps } from 'antd';
import { Select, Space } from 'antd';

const { Option } = Select;

const handleChange = (value: string[]) => {
console.log(`selected ${value}`);
};

const options: SelectProps['options'] = [
{
label: 'China',
value: 'china',
emoji: '🇨🇳',
desc: 'China (中国)',
},
{
label: 'USA',
value: 'usa',
emoji: '🇺🇸',
desc: 'USA (美国)',
},
{
label: 'Japan',
value: 'japan',
emoji: '🇯🇵',
desc: 'Japan (日本)',
},
{
label: 'Korea',
value: 'korea',
emoji: '🇰🇷',
desc: 'Korea (韩国)',
},
];

const App: React.FC = () => (
<Select
mode="multiple"
@@ -15,40 +41,16 @@ const App: React.FC = () => (
defaultValue={['china']}
onChange={handleChange}
optionLabelProp="label"
>
<Option value="china" label="China">
<Space>
<span role="img" aria-label="China">
🇨🇳
</span>
China (中国)
</Space>
</Option>
<Option value="usa" label="USA">
<Space>
<span role="img" aria-label="USA">
🇺🇸
</span>
USA (美国)
</Space>
</Option>
<Option value="japan" label="Japan">
<Space>
<span role="img" aria-label="Japan">
🇯🇵
</span>
Japan (日本)
</Space>
</Option>
<Option value="korea" label="Korea">
options={options}
optionRender={(option) => (
<Space>
<span role="img" aria-label="Korea">
🇰🇷
<span role="img" aria-label={option.data.label}>
{option.data.emoji}
</span>
Korea (韩国)
{option.data.desc}
</Space>
</Option>
</Select>
)}
/>
);

export default App;
1 change: 1 addition & 0 deletions components/select/index.en-US.md
Original file line number Diff line number Diff line change
@@ -85,6 +85,7 @@ Common props ref:[Common props](/docs/react/common-props)
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true. If `options` is set, it should be set to `label` | string | `value` | |
| optionLabelProp | Which prop value of option will render as content of select. [Example](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `children` | |
| options | Select options. Will get better perf than jsx definition | { label, value }\[] | - | |
| optionRender | Customize the rendering dropdown options | (option: FlattenOptionData\<BaseOptionType\> , info: { index: number }) => React.ReactNode | - | 5.11.0 |
| placeholder | Placeholder of select | ReactNode | - | |
| placement | The position where the selection box pops up | `bottomLeft` `bottomRight` `topLeft` `topRight` | bottomLeft | |
| removeIcon | The custom remove icon | ReactNode | - | |
1 change: 1 addition & 0 deletions components/select/index.zh-CN.md
Original file line number Diff line number Diff line change
@@ -86,6 +86,7 @@ demo:
| optionFilterProp | 搜索时过滤对应的 `option` 属性,如设置为 `children` 表示对内嵌内容进行搜索。若通过 `options` 属性配置选项内容,建议设置 `optionFilterProp="label"` 来对内容进行搜索。 | string | `value` | |
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。[示例](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `children` | |
| options | 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能 | { label, value }\[] | - | |
| optionRender | 自定义渲染下拉选项 | (option: FlattenOptionData\<BaseOptionType\> , info: { index: number }) => React.ReactNode | - | 5.11.0 |
| placeholder | 选择框默认文本 | string | - | |
| placement | 选择框弹出的位置 | `bottomLeft` `bottomRight` `topLeft` `topRight` | bottomLeft | |
| removeIcon | 自定义的多选框清除图标 | ReactNode | - | |
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@
"copy-to-clipboard": "^3.3.3",
"dayjs": "^1.11.1",
"qrcode.react": "^3.1.0",
"rc-cascader": "~3.19.1",
"rc-cascader": "~3.20.0",
"rc-checkbox": "~3.1.0",
"rc-collapse": "~3.7.1",
"rc-dialog": "~9.3.4",
@@ -144,7 +144,7 @@
"rc-rate": "~2.12.0",
"rc-resize-observer": "^1.4.0",
"rc-segmented": "~2.2.2",
"rc-select": "~14.9.2",
"rc-select": "~14.10.0",
"rc-slider": "~10.3.1",
"rc-steps": "~6.0.1",
"rc-switch": "~4.1.0",
@@ -153,7 +153,7 @@
"rc-textarea": "~1.5.1",
"rc-tooltip": "~6.1.1",
"rc-tree": "~5.8.0",
"rc-tree-select": "~5.14.0",
"rc-tree-select": "~5.15.0",
"rc-upload": "~4.3.5",
"rc-util": "^5.38.0",
"scroll-into-view-if-needed": "^3.1.0",
@@ -339,4 +339,4 @@
"dumi": "^2.3.0-alpha.4"
}
}
}
}