-
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
25 changed files
with
353 additions
and
81 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,58 @@ | ||
# 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] | | ||
| icons | Custom icon set | `IconConfig` | `{}` | | ||
|
||
## 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,58 @@ | ||
# ConfigProvider 配置 | ||
|
||
用于全局配置本地化文案和个性化图标。 | ||
|
||
## 何时使用 | ||
|
||
- 您想使用除英文之外的语言。 | ||
- 您想使用自己的图标集,而不是内置的 `antd-mobile-icons`。 | ||
|
||
## 示例 | ||
|
||
<code src="./demos/demo1.tsx" ></code> | ||
|
||
<code src="./demos/demo2.tsx" ></code> | ||
|
||
## ConfigProvider | ||
|
||
### 属性 | ||
|
||
| 属性 | 说明 | 类型 | 默认值 | | ||
| ------ | ---------- | ------------ | ------ | | ||
| locale | 本地化文案 | `Locale` | [base] | | ||
| icons | 自定义图标 | `IconConfig` | `{}` | | ||
|
||
## IconConfig | ||
|
||
除了 SpinLoading 是一个 `antd-mobile` 组件外,其余默认图标都取自 `antd-mobile-icons` 包。 | ||
|
||
### 属性 | ||
|
||
| 属性 | 相关组件 | 说明 | 默认值 | | ||
| -------------------- | ------------------------------ | --------------- | --------------------- | | ||
| CheckListActive | CheckList | 选中标记 | CheckOutline | | ||
| CollapseArrow | Collapse | 展开收起箭头 | DownOutline | | ||
| DropdownItemArrow | DropdownItem | 下拉箭头 | DownFill | | ||
| FormItemHelp | FormItem | 帮助提示 | QuestionCircleOutline | | ||
| ImageUploaderUpload | ImageUploader | 上传按钮 | AddOutline | | ||
| ImageUploaderDelete | ImageUploader | 删除按钮 | CloseOutline | | ||
| InputClear | Input, SearchBar, VirtualInput | 清除按钮 | CloseCircleFill | | ||
| NavBarBackArrow | NavBar | 返回按钮 | LeftOutline | | ||
| NoticeBarClose | NoticeBar | 关闭按钮 | CloseOutline | | ||
| NoticeBarNotice | NoticeBar | 左侧图标 | SoundOutline | | ||
| NumberKeyboardClose | NumberKeyboard | 收起按钮 | DownOutline | | ||
| NumberKeyboardDelete | NumberKeyboard | 删除按钮 | TextDeletionOutline | | ||
| PopupClose | Popup, CenterPopup | 关闭按钮 | CloseOutline | | ||
| ResultSuccess | Result, ResultPage | 成功状态 | CheckCircleFill | | ||
| ResultError | Result, ResultPage | 错误状态 | CloseCircleFill | | ||
| ResultInfo | Result, ResultPage | 信息状态 | InformationCircleFill | | ||
| ResultWaiting | Result, ResultPage | 等待状态 | ClockCircleFill | | ||
| ResultWarning | Result, ResultPage | 警告状态 | ExclamationCircleFill | | ||
| SearchBarSearch | SearchBar | 搜索图标 | SearchOutline | | ||
| StepperPlus | Stepper | 增加按钮 | AddOutline | | ||
| StepperMinus | Stepper | 减少按钮 | MinusOutline | | ||
| ToastSuccess | Toast | 成功状态 | CheckOutline | | ||
| ToastFail | Toast | 失败状态 | CloseOutline | | ||
| ToastLoading | Toast | 加载状态 | 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
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.