@react-native-oh/react-native-harmony 0.72.39-13 → 0.72.39-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Alert/Alert.harmony.js +9 -3
- package/Libraries/Alert/AlertManager.ts +3 -0
- package/README.md +13 -0
- package/harmony/.keep +0 -0
- package/harmony/rnoh-hvigor-plugin-0.2.0.tgz +0 -0
- package/index.js +7 -0
- package/jest.config.js +7 -0
- package/metro.config.js +7 -0
- package/package.json +11 -3
- package/react-native.config.js +7 -0
- package/react_native_openharmony.har +0 -0
- package/react_native_openharmony_release.har +0 -0
- package/types/index.d.ts +7 -0
|
@@ -40,10 +40,11 @@ class Alert {
|
|
|
40
40
|
alertOptions.cancelable = options.cancelable;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// At most
|
|
44
|
-
const validButtons: Buttons = (buttons ?? [{text: "OK"}]).slice(0,
|
|
45
|
-
const secondaryButton = validButtons.pop();
|
|
43
|
+
// At most three buttons. Ignore rest.
|
|
44
|
+
const validButtons: Buttons = (buttons ?? [{text: "OK"}]).slice(0, 3)
|
|
46
45
|
const primaryButton = validButtons.pop();
|
|
46
|
+
const secondaryButton = validButtons.pop();
|
|
47
|
+
const thirdaryButton = validButtons.pop();
|
|
47
48
|
|
|
48
49
|
if (primaryButton) {
|
|
49
50
|
alertOptions.primaryButton = primaryButton.text || "";
|
|
@@ -51,6 +52,9 @@ class Alert {
|
|
|
51
52
|
if (secondaryButton) {
|
|
52
53
|
alertOptions.secondaryButton = secondaryButton.text || "";
|
|
53
54
|
}
|
|
55
|
+
if (thirdaryButton) {
|
|
56
|
+
alertOptions.thirdaryButton = thirdaryButton.text || "";
|
|
57
|
+
}
|
|
54
58
|
|
|
55
59
|
const onAction = (action, buttonKey) => {
|
|
56
60
|
if (action === constants.buttonClicked) {
|
|
@@ -58,6 +62,8 @@ class Alert {
|
|
|
58
62
|
primaryButton.onPress && primaryButton.onPress();
|
|
59
63
|
} else if (buttonKey === constants.secondaryButton) {
|
|
60
64
|
secondaryButton.onPress && secondaryButton.onPress();
|
|
65
|
+
} else if (buttonKey === constants.thirdaryButton) {
|
|
66
|
+
thirdaryButton.onPress && thirdaryButton.onPress();
|
|
61
67
|
}
|
|
62
68
|
} else if (action === constants.dismissed) {
|
|
63
69
|
options && options.onDismiss && options.onDismiss();
|
|
@@ -7,6 +7,7 @@ type AlertAction = string;
|
|
|
7
7
|
/*
|
|
8
8
|
primaryButton = 1,
|
|
9
9
|
secondaryButton = 2,
|
|
10
|
+
thirdaryButton = 3,
|
|
10
11
|
*/
|
|
11
12
|
type AlertButtonKey = number;
|
|
12
13
|
export type AlertOptions = {
|
|
@@ -14,6 +15,7 @@ export type AlertOptions = {
|
|
|
14
15
|
message?: string;
|
|
15
16
|
primaryButton?: string;
|
|
16
17
|
secondaryButton?: string;
|
|
18
|
+
thirdaryButton?: string;
|
|
17
19
|
items?: Array<string>;
|
|
18
20
|
cancelable?: boolean;
|
|
19
21
|
};
|
|
@@ -24,6 +26,7 @@ export interface Spec extends TurboModule {
|
|
|
24
26
|
dismissed: AlertAction;
|
|
25
27
|
primaryButton: AlertButtonKey;
|
|
26
28
|
secondaryButton: AlertButtonKey;
|
|
29
|
+
thirdaryButton: AlertButtonKey;
|
|
27
30
|
};
|
|
28
31
|
alert: (
|
|
29
32
|
options: AlertOptions,
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @react-native-oh/react-native-harmony
|
|
2
|
+
|
|
3
|
+
Please refer to: [RNOH repo](https://gitee.com/openharmony-sig/ohos_react_native) for more detail.
|
|
4
|
+
|
|
5
|
+
# Documentation
|
|
6
|
+
|
|
7
|
+
- [中文](https://gitee.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/README.md)
|
|
8
|
+
- [English](https://gitee.com/openharmony-sig/ohos_react_native/blob/master/docs/en/README.md)
|
|
9
|
+
|
|
10
|
+
# License
|
|
11
|
+
|
|
12
|
+
This library is licensed under The [MIT License (MIT)](https://gitee.com/openharmony-sig/ohos_react_native)
|
|
13
|
+
|
package/harmony/.keep
ADDED
|
File without changes
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE-MIT file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
module.exports = {
|
|
2
9
|
get AccessibilityInfo() {
|
|
3
10
|
return require('./Libraries/Components/AccessibilityInfo/AccessibilityInfo')
|
package/jest.config.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE-MIT file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
2
9
|
module.exports = {
|
|
3
10
|
preset: 'ts-jest',
|
package/metro.config.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE-MIT file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
//@ts-check
|
|
2
9
|
const pathUtils = require('path');
|
|
3
10
|
const fs = require('fs');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-oh/react-native-harmony",
|
|
3
|
-
"version": "0.72.39-
|
|
3
|
+
"version": "0.72.39-14",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test": "jest"
|
|
18
18
|
},
|
|
19
19
|
"author": "",
|
|
20
|
-
"license": "
|
|
20
|
+
"license": "MIT",
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react-native": "0.72.5"
|
|
23
23
|
},
|
|
@@ -49,10 +49,18 @@
|
|
|
49
49
|
"./*.har"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@react-native-oh/react-native-harmony-cli": "^0.0.
|
|
52
|
+
"@react-native-oh/react-native-harmony-cli": "^0.0.28",
|
|
53
53
|
"colors": "^1.4.0",
|
|
54
54
|
"fs-extra": "^11.1.1",
|
|
55
55
|
"metro": "^0.76.3",
|
|
56
56
|
"metro-config": "^0.76.3"
|
|
57
|
+
},
|
|
58
|
+
"harmony": {
|
|
59
|
+
"autolinking": null
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://gitee.com/openharmony-sig/ohos_react_native",
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "gitee",
|
|
64
|
+
"url": "https://gitee.com/openharmony-sig/ohos_react_native"
|
|
57
65
|
}
|
|
58
66
|
}
|
package/react-native.config.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE-MIT file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
const { config: harmonyConfig } = require('@react-native-oh/react-native-harmony-cli')
|
|
2
9
|
|
|
3
10
|
/**
|
|
Binary file
|
|
Binary file
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024 Huawei Technologies Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE-MIT file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
// export * from 'react-native/Libraries/ActionSheetIOS/ActionSheetIOS';
|
|
2
9
|
export * from 'react-native/Libraries/Alert/Alert';
|
|
3
10
|
export * from 'react-native/Libraries/Animated/Animated';
|