-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ConfigProvider): add icons config
- Loading branch information
Showing
47 changed files
with
422 additions
and
137 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,72 @@ | ||
# ConfigProvider | ||
|
||
Configure locale messages and custom icons globally. | ||
|
||
## When to use | ||
|
||
- You want to use other languages than English | ||
- You want to use your own icon set instead of `antd-mobile-icons` | ||
|
||
## Demos | ||
|
||
<code src="./demos/demo1.tsx" ></code> | ||
|
||
<code src="./demos/demo2.tsx" ></code> | ||
|
||
## ConfigProvider | ||
|
||
### Props | ||
|
||
| Name | Description | Type | Default | | ||
| --- | --- | --- | --- | | ||
| locale | Locale messages | `Locale` | [base] | | ||
| checkList | CheckList config | `{ activeIcon?: ReactNode }` | - | | ||
| collapse | Collapse config | `{ arrow?: ReactNode \| ((active: boolean) => ReactNode) }` | - | | ||
| dropdownItem | Dropdown.Item config | `{ arrow?: ReactNode }` | - | | ||
| formItem | FormItem config | `{ helpIcon?: ReactNode }` | - | | ||
| imageUploader | ImageUploader config | `{ uploadIcon?: ReactNode, deleteIcon?: ReactNode }` | - | | ||
| input | Input config | `{ clearIcon?: ReactNode }` | - | | ||
| listItem | List.Item config | `{ arrow?: ReactNode }` | - | | ||
| navBar | NavBar config | `{ backArrow?: ReactNode }` | - | | ||
| noticeBar | NoticeBar config | `{ icon?: ReactNode, closeIcon?: ReactNode }` | - | | ||
| numberKeyboard | NumberKeyboard config | `{ closeIcon?: ReactNode, deleteIcon?: ReactNode }` | - | | ||
| popup | Popup config | `{ closeIcon?: ReactNode }` | - | | ||
| result | Result config | `{ successIcon?: ReactNode, errorIcon?: ReactNode, infoIcon?: ReactNode, waitingIcon?: ReactNode, warningIcon?: ReactNode }` | - | | ||
| searchBar | SearchBar config | `{ icon?: ReactNode }` | - | | ||
| stepper | Stepper config | `{ plusIcon?: ReactNode, minusIcon?: ReactNode }` | - | | ||
| toast | Toast config | `{ successIcon?: ReactNode, failIcon?: ReactNode, loadingIcon?: ReactNode }` | - | | ||
|
||
## IconConfig | ||
|
||
Default icons are all from `antd-mobile-icons` package, except for SpinLoading which is a `antd-mobile` component. | ||
|
||
### Props | ||
|
||
| Name | Related components | Description | Default | | ||
| --- | --- | --- | --- | | ||
| CheckListActive | CheckList | Check mark | CheckOutline | | ||
| CollapseArrow | Collapse | Expand/collapse | DownOutline | | ||
| DropdownItemArrow | DropdownItem | Down arrow | DownFill | | ||
| FormItemHelp | FormItem | Help indicator | QuestionCircleOutline | | ||
| ImageUploaderUpload | ImageUploader | Upload button | AddOutline | | ||
| ImageUploaderDelete | ImageUploader | Delete button | CloseOutline | | ||
| InputClear | Input, SearchBar, VirtualInput | Clear button | CloseCircleFill | | ||
| NavBarBackArrow | NavBar | Back button | LeftOutline | | ||
| NoticeBarClose | NoticeBar | Close button | CloseOutline | | ||
| NoticeBarNotice | NoticeBar | Notice | SoundOutline | | ||
| NumberKeyboardClose | NumberKeyboard | Close/hide button | DownOutline | | ||
| NumberKeyboardDelete | NumberKeyboard | Delete button | TextDeletionOutline | | ||
| PopupClose | Popup, CenterPopup | Close button | CloseOutline | | ||
| ResultSuccess | Result, ResultPage | Success status | CheckCircleFill | | ||
| ResultError | Result, ResultPage | Error status | CloseCircleFill | | ||
| ResultInfo | Result, ResultPage | Information status | InformationCircleFill | | ||
| ResultWaiting | Result, ResultPage | Waiting status | ClockCircleFill | | ||
| ResultWarning | Result, ResultPage | Warning status | ExclamationCircleFill | | ||
| SearchBarSearch | SearchBar | Search | SearchOutline | | ||
| StepperPlus | Stepper | Plus button | AddOutline | | ||
| StepperMinus | Stepper | Minus button | MinusOutline | | ||
| ToastSuccess | Toast | Success status | CheckOutline | | ||
| ToastFail | Toast | Fail status | CloseOutline | | ||
| ToastLoading | Toast | Loading status | SpinLoading | | ||
|
||
[base]: https://github.com/ant-design/ant-design-mobile/blob/master/src/locales/base.ts |
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,7 +1,39 @@ | ||
# ConfigProvider 配置 | ||
|
||
用于全局配置本地化文案和个性化图标。 | ||
|
||
## 何时使用 | ||
|
||
- 您想使用除英文之外的语言。 | ||
- 您想使用自己的图标集,而不是内置的 `antd-mobile-icons`。 | ||
|
||
## 示例 | ||
|
||
<code src="./demos/demo1.tsx" ></code> | ||
|
||
<code src="./demos/demo2.tsx" ></code> | ||
|
||
## ConfigProvider | ||
|
||
### 属性 | ||
|
||
| 属性 | 说明 | 类型 | 默认值 | | ||
| --- | --- | --- | --- | | ||
| locale | 本地化文案 | `Locale` | [base] | | ||
| checkList | CheckList 配置 | `{ activeIcon?: ReactNode }` | - | | ||
| collapse | Collapse 配置 | `{ arrow?: ReactNode \| ((active: boolean) => ReactNode) }` | - | | ||
| dropdownItem | Dropdown.Item 配置 | `{ arrow?: ReactNode }` | - | | ||
| formItem | FormItem 配置 | `{ helpIcon?: ReactNode }` | - | | ||
| imageUploader | ImageUploader 配置 | `{ uploadIcon?: ReactNode, deleteIcon?: ReactNode }` | - | | ||
| input | Input 配置 | `{ clearIcon?: ReactNode }` | - | | ||
| listItem | List.Item 配置 | `{ arrow?: ReactNode }` | - | | ||
| navBar | NavBar 配置 | `{ backArrow?: ReactNode }` | - | | ||
| noticeBar | NoticeBar 配置 | `{ icon?: ReactNode, closeIcon?: ReactNode }` | - | | ||
| numberKeyboard | NumberKeyboard 配置 | `{ closeIcon?: ReactNode, deleteIcon?: ReactNode }` | - | | ||
| popup | Popup 配置 | `{ closeIcon?: ReactNode }` | - | | ||
| result | Result 配置 | `{ successIcon?: ReactNode, errorIcon?: ReactNode, infoIcon?: ReactNode, waitingIcon?: ReactNode, warningIcon?: ReactNode }` | - | | ||
| searchBar | SearchBar 配置 | `{ icon?: ReactNode }` | - | | ||
| stepper | Stepper 配置 | `{ plusIcon?: ReactNode, minusIcon?: ReactNode }` | - | | ||
| toast | Toast 配置 | `{ successIcon?: ReactNode, failIcon?: ReactNode, loadingIcon?: ReactNode }` | - | | ||
|
||
[base]: https://github.com/ant-design/ant-design-mobile/blob/master/src/locales/base.ts |
Oops, something went wrong.