@momo-kits/calculator-keyboard 0.168.1-rn862.1 → 0.169.2
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/package.json +31 -31
- package/src/index.tsx +9 -13
package/package.json
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/calculator-keyboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.169.2",
|
|
4
4
|
"description": "react native calculator keyboard",
|
|
5
|
-
"
|
|
6
|
-
"android",
|
|
7
|
-
"ios",
|
|
8
|
-
"react-native"
|
|
9
|
-
],
|
|
10
|
-
"homepage": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard#readme",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard/issues"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"author": "Dũng (Wem) <huynh.developer@gmail.com> (https://github.com/wem2017/react-native-calculator-keyboard.git)",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard.git"
|
|
19
|
-
},
|
|
5
|
+
"main": "./src/index.tsx",
|
|
20
6
|
"files": [
|
|
21
7
|
"src",
|
|
22
8
|
"lib",
|
|
@@ -37,28 +23,29 @@
|
|
|
37
23
|
"!**/__mocks__",
|
|
38
24
|
"!**/.*"
|
|
39
25
|
],
|
|
40
|
-
"main": "./src/index.tsx",
|
|
41
|
-
"publishConfig": {
|
|
42
|
-
"registry": "https://registry.npmjs.org/"
|
|
43
|
-
},
|
|
44
26
|
"scripts": {
|
|
45
27
|
"test": "jest",
|
|
46
28
|
"typecheck": "tsc",
|
|
47
29
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
48
30
|
"build": "echo"
|
|
49
31
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
32
|
+
"keywords": [
|
|
33
|
+
"react-native",
|
|
34
|
+
"ios",
|
|
35
|
+
"android"
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard.git"
|
|
54
40
|
},
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
41
|
+
"author": "Dũng (Wem) <huynh.developer@gmail.com> (https://github.com/wem2017/react-native-calculator-keyboard.git)",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard/issues"
|
|
59
45
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
46
|
+
"homepage": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard#readme",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"registry": "https://registry.npmjs.org/"
|
|
62
49
|
},
|
|
63
50
|
"codegenConfig": {
|
|
64
51
|
"name": "InputCalculatorSpec",
|
|
@@ -72,5 +59,18 @@
|
|
|
72
59
|
"InputCalculator": "InputCalculator"
|
|
73
60
|
}
|
|
74
61
|
}
|
|
75
|
-
}
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"react": "19.0.0",
|
|
65
|
+
"react-native": "0.80.1"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"react": "*",
|
|
69
|
+
"react-native": "*",
|
|
70
|
+
"@momo-kits/foundation": "*"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=18.0.0"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {}
|
|
76
76
|
}
|
package/src/index.tsx
CHANGED
|
@@ -3,25 +3,21 @@ import { useContext } from 'react';
|
|
|
3
3
|
import { ApplicationContext, Colors } from '@momo-kits/foundation';
|
|
4
4
|
import {
|
|
5
5
|
type NativeSyntheticEvent,
|
|
6
|
-
type StyleProp,
|
|
7
|
-
StyleSheet,
|
|
8
6
|
type TextInputProps,
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
StyleSheet,
|
|
8
|
+
StyleProp,
|
|
9
|
+
TextStyle, View,
|
|
11
10
|
} from 'react-native';
|
|
12
11
|
import NativeInputCalculator, {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type Size,
|
|
17
|
-
type TextAttributes,
|
|
12
|
+
OnResultEvent,
|
|
13
|
+
Size,
|
|
14
|
+
TextAttributes,
|
|
18
15
|
} from './InputCalculatorNativeComponent';
|
|
16
|
+
import { Commands } from './InputCalculatorNativeComponent';
|
|
19
17
|
|
|
20
18
|
const NativeInput = NativeInputCalculator;
|
|
21
19
|
|
|
22
|
-
type KeyPressEvent =
|
|
23
|
-
Partial<OnKeyPressEvent>;
|
|
24
|
-
type ResultEvent = NativeSyntheticEvent<OnResultEvent> & Partial<OnResultEvent>;
|
|
20
|
+
type KeyPressEvent = { nativeEvent: { key: string } };
|
|
25
21
|
|
|
26
22
|
interface InputCalculatorProps extends TextInputProps {
|
|
27
23
|
text?: string | undefined;
|
|
@@ -29,7 +25,7 @@ interface InputCalculatorProps extends TextInputProps {
|
|
|
29
25
|
selectionColor?: string | undefined;
|
|
30
26
|
onBlur?: () => void;
|
|
31
27
|
onFocus?: () => void;
|
|
32
|
-
onResult?: (e:
|
|
28
|
+
onResult?: (e: OnResultEvent) => void;
|
|
33
29
|
onKeyPress?: (e: KeyPressEvent) => void;
|
|
34
30
|
customKeyText?: string | undefined;
|
|
35
31
|
customKeyBackground?: CustomKeyBackground;
|