diff --git a/en/react-native-picker-picker(nocodegen).md b/en/react-native-picker-picker(nocodegen).md index 81b267e6a2c977e85e9a27fe07b7b0334657c7b9..e8ae2bdad2b6327367c4312bc0f689802aa0d6cf 100644 --- a/en/react-native-picker-picker(nocodegen).md +++ b/en/react-native-picker-picker(nocodegen).md @@ -274,7 +274,7 @@ Check the release version information in the release address of the third-party |----------------------|----------------------------------------------------------------------------------------------------------|---------------|----------|----------|-------------------| | `label` | Displayed value on the Picker Item. | string | Yes | All | Yes | | `value` | Actual value on the Picker Item. | number,string | Yes | All | Yes | -| `color` | Displayed color on the Picker Item. | ColorValue | Yes | All | No | +| `color` | Displayed color on the Picker Item. | ColorValue | No | All | No | | `fontFamily` | Displayed fontFamily on the Picker Item. | string | No | All | No | | `style` | Style to apply to individual item labels. | ViewStyleProp | No | Android | No | | `enabled` | If set to false, the specific item will be disabled, i.e. the user will not be able to make a selection. | boolean | No | Android | No | diff --git a/en/react-native-picker-picker.md b/en/react-native-picker-picker.md index 954f5aa40d0be5686be55291f1bb9e87f4c91c3b..2d8c8413e1b086803fe5e6c0eeecee9bf0ac27c0 100644 --- a/en/react-native-picker-picker.md +++ b/en/react-native-picker-picker.md @@ -19,21 +19,35 @@ Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. Go to the project directory and execute the following instruction: +| Library Version | Release Info | Supported RN Version | +| :--- | :--- | :--- | +| 2.6.1 | [@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases) | 0.72 | +| 2.11.1 | [@react-native-ohos/picker Releases]() | 0.77 | +For older versions not published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package. +Navigate to your project directory and enter the following commands: #### **npm** ```bash +# V2.6.1 npm install @react-native-oh-tpl/picker + +# V2.11.1 +npm install @react-native-ohos/picker ``` #### **yarn** ```bash +# V2.6.1 yarn add @react-native-oh-tpl/picker + +# V2.11.1 +yarn add @react-native-ohos/picker ``` @@ -44,7 +58,7 @@ The following code shows the basic use scenario of the repository: ```js import * as React from "react"; -import { Picker } from "@react-native-oh-tpl/picker"; +import { Picker } from "@react-native-picker/picker"; import { View } from "react-native"; export const PickerExample = ()=>{ @@ -94,6 +108,8 @@ Method 1 (recommended): Use the HAR file. Open `entry/oh-package.json5` file and add the following dependencies: +- V2.6.1 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -102,10 +118,18 @@ Open `entry/oh-package.json5` file and add the following dependencies: } ``` -Click the `sync` button in the upper right corner. +- V2.11.1 -Alternatively, run the following instruction on the terminal: +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/picker": "file:../../node_modules/@react-native-ohos/picker/harmony/picker.har", + } +``` +Click the `sync` button in the top-right corner. + +Or, run the following in your terminal: ```bash cd entry ohpm install @@ -140,7 +164,12 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) +# V2.6.1 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/picker/src/main/cpp" ./picker) + +# V2.11.1 ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/picker/src/main/cpp" ./picker) + # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -185,8 +214,12 @@ Find `function buildCustomRNComponent()`, which is usually located in `entry/src ```diff ... +// V2.6.1 + import { RNCPicker, PICKER_TYPE } from "@react-native-oh-tpl/picker" +// V2.11.1 ++ import { RNCPicker, PICKER_TYPE } from "@react-native-ohos/picker" + @Builder export function buildCustomRNComponent(ctx: ComponentBuilderContext) { ... @@ -220,8 +253,12 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... +// V2.6.1 + import { RNCPickerPackage } from '@react-native-oh-tpl/picker/ts'; +// V2.11.1 ++ import { RNCPickerPackage } from '@react-native-ohos/picker/ts'; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -251,6 +288,11 @@ To use this repository, you need to use the correct React-Native and RNOH versio Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases) +| Library Version | Release Info | Supported RN Version | +| :--- | :--- | :--- | +| 2.6.1 | [@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases) | 0.72 | +| 2.11.1 | [@react-native-ohos/picker Releases]() | 0.77 | + ## Properties > [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. @@ -283,7 +325,7 @@ Check the release version information in the release address of the third-party |----------------------|----------------------------------------------------------------------------------------------------------|---------------|----------|----------|-------------------| | `label` | Displayed value on the Picker Item. | string | Yes | All | Yes | | `value` | Actual value on the Pickmodeler Item. | number,string | Yes | All | Yes | -| `color` | Displayed color on the Picker Item. | ColorValue | Yes | All | No | +| `color` | Displayed color on the Picker Item. | ColorValue | No | All | No | | `fontFamily` | Displayed fontFamily on the Picker Item. | string | No | All | No | | `style` | Style to apply to individual item labels. | ViewStyleProp | No | Android | No | | `enabled` | If set to false, the specific item will be disabled, i.e. the user will not be able to make a selection. | boolean | No | Android | No | @@ -291,9 +333,6 @@ Check the release version information in the release address of the third-party ## Static Methods -> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. - -> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | |---------|---------------------------------|----------|----------|----------|-------------------| diff --git a/zh-cn/react-native-picker-picker(nocodegen).md b/zh-cn/react-native-picker-picker(nocodegen).md index 34d1eb4e1fd0bf3486543f79f0fe9effdf137ac6..ec80d654032337358b132d20ec05cc6e6e8a60b9 100644 --- a/zh-cn/react-native-picker-picker(nocodegen).md +++ b/zh-cn/react-native-picker-picker(nocodegen).md @@ -277,7 +277,7 @@ ohpm install |----------------------|----------------------------------------------------------------------------------------------------------|---------------|----------|----------|-------------------| | `label` | Displayed value on the Picker Item. | string | Yes | All | Yes | | `value` | Actual value on the Picker Item. | number,string | Yes | All | Yes | -| `color` | Displayed color on the Picker Item. | ColorValue | Yes | All | No | +| `color` | Displayed color on the Picker Item. | ColorValue | No | All | No | | `fontFamily` | Displayed fontFamily on the Picker Item. | string | No | All | No | | `style` | Style to apply to individual item labels. | ViewStyleProp | No | Android | No | | `enabled` | If set to false, the specific item will be disabled, i.e. the user will not be able to make a selection. | boolean | No | Android | No | diff --git a/zh-cn/react-native-picker-picker.md b/zh-cn/react-native-picker-picker.md index 99d08e884c92a35c701360adabb6c0d32d3c23d4..09870206330884da7f830ec977d2ae53479ce705 100644 --- a/zh-cn/react-native-picker-picker.md +++ b/zh-cn/react-native-picker-picker.md @@ -16,7 +16,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.6.1 | [@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases) | 0.72 | +| 2.11.1 | [@react-native-ohos/picker Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +32,21 @@ #### **npm** ```bash +# V2.6.1 npm install @react-native-oh-tpl/picker + +# V2.11.1 +npm install @react-native-ohos/picker ``` #### **yarn** ```bash +# V2.6.1 yarn add @react-native-oh-tpl/picker + +# V2.11.1 +yarn add @react-native-ohos/picker ``` @@ -42,7 +57,8 @@ yarn add @react-native-oh-tpl/picker ```js import * as React from "react"; -import { Picker } from "@react-native-oh-tpl/picker"; +import { Picker } from "@react-native-picker/picker"; + import { View } from "react-native"; export const PickerExample = ()=>{ @@ -63,6 +79,8 @@ export const PickerExample = ()=>{ ## 使用 Codegen +> [!TIP] V2.11.1 不需要执行 Codegen。 + 本库已经适配了 Codegen ,在使用前需要主动执行生成三方库桥接代码,详细请参考 [Codegen 使用文档。](/zh-cn/codegen.md) ## Link @@ -95,6 +113,8 @@ export const PickerExample = ()=>{ 打开 `entry/oh-package.json5`,添加以下依赖 +- V2.6.1 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -103,6 +123,16 @@ export const PickerExample = ()=>{ } ``` +- V2.11.1 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + + "@react-native-ohos/picker": "file:../../node_modules/@react-native-ohos/picker/harmony/picker.har", + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -140,7 +170,12 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) +# V2.6.1 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/picker/src/main/cpp" ./picker) + +# V2.11.1 ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/picker/src/main/cpp" ./picker) + # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -184,8 +219,12 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... +// V2.6.1 + import { RNCPicker, PICKER_TYPE } from "@react-native-oh-tpl/picker" +// V2.11.1 ++ import { RNCPicker, PICKER_TYPE } from "@react-native-ohos/picker" + @Builder export function buildCustomRNComponent(ctx: ComponentBuilderContext) { ... @@ -219,8 +258,12 @@ const arkTsComponentNames: Array = [ ```diff ... +// V2.6.1 + import { RNCPickerPackage } from '@react-native-oh-tpl/picker/ts'; +// V2.11.1 ++ import { RNCPickerPackage } from '@react-native-ohos/picker/ts'; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -248,7 +291,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.6.1 | [@react-native-oh-tpl/picker Releases](https://github.com/react-native-oh-library/picker/releases) | 0.72 | +| 2.11.1 | [@react-native-ohos/picker Releases]() | 0.77 | ## 属性 @@ -282,7 +330,7 @@ ohpm install |----------------------|----------------------------------------------------------------------------------------------------------|---------------|----------|----------|-------------------| | `label` | Displayed value on the Picker Item. | string | Yes | All | Yes | | `value` | Actual value on the Pickmodeler Item. | number,string | Yes | All | Yes | -| `color` | Displayed color on the Picker Item. | ColorValue | Yes | All | No | +| `color` | Displayed color on the Picker Item. | ColorValue | No | All | No | | `fontFamily` | Displayed fontFamily on the Picker Item. | string | No | All | No | | `style` | Style to apply to individual item labels. | ViewStyleProp | No | Android | No | | `enabled` | If set to false, the specific item will be disabled, i.e. the user will not be able to make a selection. | boolean | No | Android | No | @@ -306,4 +354,4 @@ ohpm install ## 开源协议 -本项目基于 [The MIT License (MIT)](https://github.com/react-native-picker/picker/blob/master/LICENSE) ,请自由地享受和参与开源。 +本项目基于 [The MIT License (MIT)](https://github.com/react-native-picker/picker/blob/master/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file