forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: select component token (ant-design#44228)
* feat: select token * feat: select token * docs: add demo
- Loading branch information
Showing
12 changed files
with
276 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { extendTest } from '../../../tests/shared/demoTest'; | ||
|
||
extendTest('select', { skip: ['render-panel.tsx', 'big-data.tsx'] }); | ||
extendTest('select', { skip: ['render-panel.tsx', 'big-data.tsx', 'component-token.tsx'] }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## zh-CN | ||
|
||
组件 Token | ||
|
||
## en-US | ||
|
||
Component Token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { ConfigProvider, Select, Space } from 'antd'; | ||
import type { SelectProps } from 'antd'; | ||
|
||
const options: SelectProps['options'] = []; | ||
|
||
for (let i = 10; i < 36; i++) { | ||
options.push({ | ||
label: i.toString(36) + i, | ||
value: i.toString(36) + i, | ||
}); | ||
} | ||
|
||
const handleChange = (value: string[]) => { | ||
console.log(`selected ${value}`); | ||
}; | ||
|
||
const App: React.FC = () => ( | ||
<ConfigProvider | ||
theme={{ | ||
components: { | ||
Select: { | ||
multipleItemBorderColor: 'rgba(0,0,0,0.06)', | ||
multipleItemBorderColorDisabled: 'rgba(0,0,0,0.06)', | ||
optionSelectedColor: '#1677ff', | ||
}, | ||
}, | ||
}} | ||
> | ||
<Space style={{ width: '100%' }} direction="vertical"> | ||
<Select | ||
mode="multiple" | ||
allowClear | ||
style={{ width: '100%' }} | ||
placeholder="Please select" | ||
defaultValue={['a10', 'c12']} | ||
onChange={handleChange} | ||
options={options} | ||
/> | ||
<Select | ||
mode="multiple" | ||
disabled | ||
style={{ width: '100%' }} | ||
placeholder="Please select" | ||
defaultValue={['a10', 'c12']} | ||
onChange={handleChange} | ||
options={options} | ||
/> | ||
</Space> | ||
</ConfigProvider> | ||
); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.