From b49bb2215b8b1b7c670fdbeea713073481bd77ab Mon Sep 17 00:00:00 2001
From: zogpap
Date: Mon, 8 Jul 2024 19:16:29 +0800
Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#IABGMU]=20=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0react-native-modals=E6=8C=87=E5=AF=BC=E6=96=87?=
=?UTF-8?q?=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zh-cn/react-native-modals.md | 243 +++++++++++++++++++++++++++++++++++
1 file changed, 243 insertions(+)
create mode 100644 zh-cn/react-native-modals.md
diff --git a/zh-cn/react-native-modals.md b/zh-cn/react-native-modals.md
new file mode 100644
index 00000000..d9b3dd6b
--- /dev/null
+++ b/zh-cn/react-native-modals.md
@@ -0,0 +1,243 @@
+
+模板版本:v0.2.2
+
+
+
react-native-modals
+
+
+
+
+
+
+
+
+
+
+
+
+> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-modals)
+
+
+## 安装与使用
+
+请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-modals Releases](https://github.com/react-native-oh-library/react-native-modals/releases),并下载适用版本的 tgz 包。
+
+进入到工程目录并输入以下命令:
+
+> [!TIP] # 处替换为 tgz 包的路径
+
+
+
+#### **npm**
+
+```bash
+npm install @react-native-oh-tpl/react-native-modals@file:#
+```
+
+#### **yarn**
+
+```bash
+yarn add @react-native-oh-tpl/react-native-modals@file:#
+```
+
+
+
+下面的代码展示了这个库的基本使用场景:
+
+> [!WARNING] 使用时 import 的库名不变。
+
+```js
+
+import { ModalPortal } from 'react-native-modals';
+import { Provider } from 'react-redux';
+
+const Root = () => {
+ return (
+
+
+
+
+ );
+}
+
+```
+
+
+```js
+import React, { useState } from 'react'
+import { Modal, ModalContent } from 'react-native-modals';
+import { Button } from 'react-native'
+
+export default () => {
+
+ return (
+ <>
+
+
+ >
+ )
+}
+
+
+```
+
+## Link
+
+目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。
+
+首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`
+
+### 兼容性
+
+要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+
+
+请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-date-picker Releases](https://github.com/react-native-oh-library/react-native-modals/releases)
+
+
+
+## 属性
+
+> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+
+> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+
+### Modal/BottomModal
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| visible | show or hide the modal by setting true/false.default is false. | Boolean | yes | all | yes|
+| rounded | Whether the content of the modal box is rounded by setting true/false.default is true. | Boolean | yes | all | yes|
+| useNativeDriver | Whether to enable the native animation driver by setting the default animation of the true/false modal box.default is true. | Boolean | yes | all | yes|
+| children | Content component displayed in the modal box. | React Element | yes | all | yes|
+| modalTitle | You can pass a modalTitle component or pass a View for customizing titlebar | React Element | yes | all | yes|
+| width | The Width of modal, you can use fixed width or use percentage. For example 0.5 it means 50%.default is your device width. | Number | yes | all | yes|
+| height | The Height of modal, you can use fixed height or use percentage. For example 0.5 it means 50%.default is 300 | Number | yes | all | yes|
+| modalAnimation | animation for modal.default is FadeAnimation. | Animation | yes | all | yes|
+| modalStyle | Set a custom style for the modal box content. | Object | yes | all | yes|
+| style | Set custom styles for the modal box itself | Object | yes | all | yes|
+| animationDuration | Set modal box animation time.default is 200 | Number | yes | all | yes|
+| overlayPointerEvents | Available option: auto, none. | 'auto' \| 'none' | yes | all | yes|
+| overlayBackgroundColor | Sets the background color of the overlay area outside the modal box.default is #000 | String | yes | all | yes|
+| overlayOpacity | Sets the transparency of the overlay area outside the modal box.default is 0.5 | Number | yes | all | yes|
+| hasOverlay | Set the display and hiding of overlay in the area outside the modal box.default is true. | Boolean | yes | all | yes|
+| onShow | You can pass shown function as a callback function, will call the function when modal shown | ()=>void | yes | all | yes|
+| onDismiss | You can pass onDismiss function as a callback function, will call the function when modal dismissed | ()=>void | yes | all | yes|
+| onTouchOutside | Sets the click event of the overlay area outside the modal box. | () => void | yes | all | yes|
+| onHardwareBackPress | [Handle hardware button presses](https://facebook.github.io/react-native/docs/backhandler) | () => true | yes | Android | yes|
+| onMove | Sets the callback for the modal box content swipe animation value | (e:DragEvent)=>void | yes | all | yes|
+| onSwiping | Sets the callback for moving the modal box content. | (e:DragEvent)=>void | yes | all | yes|
+| onSwipeRelease | Set the end of the modal box swipe gesture | (e:DragEvent)=>void | yes | all | yes|
+| onSwipingOut | Sets a callback for the modalbox spool reaching the specified threshold | (e:DragEvent)=>void | yes | all | yes|
+| onSwipeOut | Sets the callback function of the animation when the modal box swipe reaches the threshold. | (e:DragEvent)=>void | yes | all | yes|
+| swipeDirection | Available option: up, down, left, right.The prop is only bottom of BottomModal. | String or Array\ | yes | all | yes|
+| swipeThreshold | Set the threshold of the swipe movement.default is 100 | Number | yes | all | yes|
+| footer | for example: | React Element | yes | all | yes|
+
+
+### ModalTitle
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| title | set title text | String | yes | all | yes|
+| style | Setting a Custom Container Style | Object | yes | all | yes|
+| textStyle | Set custom style for title text | Object | yes | all | yes|
+| align | Available option: left, center, right | 'left' \| 'center'\|'right' | yes | all | yes|
+| hasTitleBar | Sets the component to the specified TitleBar style.default is true. | Boolean | yes | all | yes|
+
+### ModalContent
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| children | Set Container Subcomponent | any | yes | all | yes|
+| style | Setting a Custom Container Style | any | yes | all | yes|
+
+
+### ModalFooter
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| children | Set Container Subcomponent | ModalButton | yes | all | yes|
+| bordered | Set the display and close of the container top dividing line.default is true. | Boolean | yes | all | yes|
+| style | Setting a Custom Container Style | any | yes | all | yes|
+
+
+### ModalButton
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| text | Set button text | String | yes | all | yes|
+| onPress | | () => void | yes | all | yes|
+| align | Available option: left, center, right.default is center. | 'left' \| 'center'\|'right' | yes | all | yes|
+| style | Setting a Custom Container Style | Object | yes | all | yes|
+| textStyle | Set the button text custom style | Object | yes | all | yes|
+| activeOpacity | Set button click background opacity. default is 0.6 | Number | yes | all | yes|
+| disabled | Sets whether the button is available.default is false. | Boolean | yes | all | yes|
+| bordered | Sets whether there is a dividing line on the left of the button.default is false. | Boolean | yes | all | yes|
+
+
+### Backdrop
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| visible | Set Container Subcomponent | ModalButton | yes | all | yes|
+| opacity | Set the transparency of the component container.default is 0.5. | Number | yes | all | yes|
+| onPress | Setting the container click event. | ()=>void | yes | all | yes|
+| backgroundColor | Setting the Background of a Component Container.default is #000 | String | yes | all | yes|
+| animationDuration | Set animation time.default is 200 | Number | yes | all | yes|
+| pointerEvents | Available option: auto, none | 'auto' \| 'none' | yes | all | yes|
+| useNativeDriver | Whether to enable the native animation driver. default is true. | Boolean | yes | all | yes|
+
+### Animation
+
+#### Params for (*)Animation
+
+#### FadeAnimation
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| initialValue | Set Animated Initial Value.default is 0. | Number | yes | all | yes|
+| animationDuration | Set Animation Execution Time.default is 150. | Number | yes | all | yes|
+| useNativeDriver | Whether to enable the native animation driver. default is true. | Boolean | yes | all | yes|
+
+#### ScaleAnimation
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| initialValue | Set Animated Initial Value.default is 0. | Number | yes | all | yes|
+| useNativeDriver | Whether to enable the native animation driver. default is true. | Boolean | yes | all | yes|
+
+#### SlideAnimation
+
+| props | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | ---- | ------------ |
+| initialValue | Set Animated Initial Value.default is 0. | Number | yes | all | yes|
+| slideFrom | Available option: top, bottom, left, right.default is bottom. | 'top' \| 'bottom' \|'left' \| 'right' | yes | all | yes|
+| useNativeDriver | Whether to enable the native animation driver. default is true. | Boolean | yes | all | yes|
+
+
+## 遗留问题
+
+## 其他
+
+## 开源协议
+
+本项目基于 [The MIT License (MIT)](https://github.com/jacklam718/react-native-modals/blob/master/LICENSE.md) ,请自由地享受和参与开源。
+
+
\ No newline at end of file
--
Gitee