@momo-kits/calculator-keyboard 0.167.1-duo.2 → 0.167.1-duo.4
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/ios/CalculatorKeyboardView.mm +45 -18
- package/ios/InputCalculator.mm +8 -2
- package/package.json +1 -1
- package/android/app/app.iml +0 -11
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/NativeInputCalculatorManagerDelegate.java +0 -67
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/NativeInputCalculatorManagerInterface.java +0 -28
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/ComponentDescriptors.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/ComponentDescriptors.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/EventEmitters.cpp +0 -69
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/EventEmitters.h +0 -55
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/Props.cpp +0 -32
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/Props.h +0 -66
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/ShadowNodes.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/ShadowNodes.h +0 -32
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/States.cpp +0 -16
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/CalculatorKeyboardSpecs/States.h +0 -29
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
@implementation CalculatorKeyboardView {
|
|
12
12
|
CGFloat _separatorWidth;
|
|
13
|
+
UIView *_contentView;
|
|
14
|
+
NSArray<NSArray<UIButton *> *> *_buttonRows;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
@@ -85,28 +87,26 @@
|
|
|
85
87
|
|
|
86
88
|
self.backgroundColor = [Utils colorFromHex:@"#f2f2f6"];
|
|
87
89
|
|
|
88
|
-
CGFloat buttonWidth = (UIScreen.mainScreen.bounds.size.width - _separatorWidth * 2 - 4 * _separatorWidth) / 5;
|
|
89
|
-
CGFloat buttonHeight = (240 - _separatorWidth * 2 - 3 * _separatorWidth) / 4;
|
|
90
|
-
|
|
91
90
|
// Create content view
|
|
92
91
|
UIView *contentView = [[UIView alloc] init];
|
|
93
92
|
contentView.translatesAutoresizingMaskIntoConstraints = NO;
|
|
94
93
|
[self addSubview:contentView];
|
|
94
|
+
_contentView = contentView;
|
|
95
95
|
|
|
96
|
-
// Set contentView constraints
|
|
96
|
+
// Set contentView constraints, keeping clear of the side safe area (landscape, iPhone Duo)
|
|
97
97
|
[NSLayoutConstraint activateConstraints:@[
|
|
98
|
-
[contentView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:_separatorWidth],
|
|
99
|
-
[contentView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-_separatorWidth],
|
|
98
|
+
[contentView.leadingAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.leadingAnchor constant:_separatorWidth],
|
|
99
|
+
[contentView.trailingAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.trailingAnchor constant:-_separatorWidth],
|
|
100
100
|
[contentView.topAnchor constraintEqualToAnchor:self.topAnchor constant:_separatorWidth],
|
|
101
101
|
[contentView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-_separatorWidth]
|
|
102
102
|
]];
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
NSMutableArray<NSArray<UIButton *> *> *buttonRows = [NSMutableArray array];
|
|
105
105
|
NSArray<NSArray<NSString *> *> *keys = [_keyboardMode isEqualToString:@"NumDefault"] ? _defaultKeys : _numWithCTAKeys;
|
|
106
106
|
|
|
107
107
|
for (NSInteger rowIndex = 0; rowIndex < keys.count; rowIndex++) {
|
|
108
108
|
NSArray<NSString *> *row = keys[rowIndex];
|
|
109
|
-
|
|
109
|
+
NSMutableArray<UIButton *> *buttonRow = [NSMutableArray array];
|
|
110
110
|
|
|
111
111
|
for (NSInteger colIndex = 0; colIndex < row.count; colIndex++) {
|
|
112
112
|
NSString *key = row[colIndex];
|
|
@@ -124,16 +124,6 @@
|
|
|
124
124
|
button.accessibilityIdentifier = key;
|
|
125
125
|
button.tag = isMainCTAKey ? 1 : 0;
|
|
126
126
|
|
|
127
|
-
CGRect buttonFrame = CGRectMake(xOffset, yOffset, buttonWidth, buttonHeight);
|
|
128
|
-
if (isMainKey) {
|
|
129
|
-
buttonFrame.size.height = buttonHeight * 2 + _separatorWidth;
|
|
130
|
-
}
|
|
131
|
-
if ([key isEqualToString:@"000"]) {
|
|
132
|
-
buttonFrame.size.width = buttonWidth * 2 + _separatorWidth;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
button.frame = buttonFrame;
|
|
136
|
-
|
|
137
127
|
if ([key isEqualToString:@"back"]) {
|
|
138
128
|
[button setTitle:@"" forState:UIControlStateNormal];
|
|
139
129
|
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:24 weight:UIImageSymbolWeightBold];
|
|
@@ -153,7 +143,44 @@
|
|
|
153
143
|
|
|
154
144
|
[button addTarget:self action:@selector(keyPressed:) forControlEvents:UIControlEventTouchUpInside];
|
|
155
145
|
[contentView addSubview:button];
|
|
146
|
+
[buttonRow addObject:button];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
[buttonRows addObject:buttonRow];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
_buttonRows = buttonRows;
|
|
153
|
+
[self setNeedsLayout];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Size the keys from the live keyboard width, which follows the window through
|
|
157
|
+
// rotation, fold and unfold, instead of the screen width at setup
|
|
158
|
+
- (void)layoutSubviews
|
|
159
|
+
{
|
|
160
|
+
[super layoutSubviews];
|
|
161
|
+
|
|
162
|
+
CGFloat buttonWidth = (_contentView.bounds.size.width - 4 * _separatorWidth) / 5;
|
|
163
|
+
CGFloat buttonHeight = (240 - _separatorWidth * 2 - 3 * _separatorWidth) / 4;
|
|
164
|
+
CGFloat yOffset = 0;
|
|
165
|
+
|
|
166
|
+
for (NSInteger rowIndex = 0; rowIndex < _buttonRows.count; rowIndex++) {
|
|
167
|
+
NSArray<UIButton *> *row = _buttonRows[rowIndex];
|
|
168
|
+
CGFloat xOffset = 0;
|
|
169
|
+
|
|
170
|
+
for (NSInteger colIndex = 0; colIndex < row.count; colIndex++) {
|
|
171
|
+
UIButton *button = row[colIndex];
|
|
172
|
+
NSString *key = button.accessibilityIdentifier;
|
|
173
|
+
BOOL isMainKey = (colIndex == 4 && rowIndex == 2);
|
|
156
174
|
|
|
175
|
+
CGRect buttonFrame = CGRectMake(xOffset, yOffset, buttonWidth, buttonHeight);
|
|
176
|
+
if (isMainKey) {
|
|
177
|
+
buttonFrame.size.height = buttonHeight * 2 + _separatorWidth;
|
|
178
|
+
}
|
|
179
|
+
if ([key isEqualToString:@"000"]) {
|
|
180
|
+
buttonFrame.size.width = buttonWidth * 2 + _separatorWidth;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
button.frame = buttonFrame;
|
|
157
184
|
xOffset += buttonFrame.size.width + _separatorWidth;
|
|
158
185
|
}
|
|
159
186
|
|
package/ios/InputCalculator.mm
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#import <React/RCTConversions.h>
|
|
5
5
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
6
|
+
#import <React/RCTUtils.h>
|
|
6
7
|
#import <react/renderer/components/InputCalculatorSpec/InputCalculatorComponentDescriptor.h>
|
|
7
8
|
#import <react/renderer/components/InputCalculatorSpec/EventEmitters.h>
|
|
8
9
|
#import <react/renderer/components/InputCalculatorSpec/Props.h>
|
|
@@ -45,9 +46,13 @@ typedef struct {
|
|
|
45
46
|
_textField.delegate = (id<UITextFieldDelegate>)self;
|
|
46
47
|
|
|
47
48
|
// Create keyboard view
|
|
49
|
+
// UIKit sizes the input view to the keyboard width; the keys follow it in layoutSubviews
|
|
50
|
+
UIWindow *window = RCTKeyWindow();
|
|
51
|
+
CGFloat keyboardWidth = window ? window.bounds.size.width : UIScreen.mainScreen.bounds.size.width;
|
|
48
52
|
CGFloat bottomInset = [self getBottomInset];
|
|
49
|
-
CGRect keyboardFrame = CGRectMake(0, 0,
|
|
53
|
+
CGRect keyboardFrame = CGRectMake(0, 0, keyboardWidth, 240 + bottomInset);
|
|
50
54
|
_keyboardView = [[CalculatorKeyboardView alloc] initWithFrame:keyboardFrame];
|
|
55
|
+
_keyboardView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
|
51
56
|
_keyboardView.input = (id)self; // Bridge pattern
|
|
52
57
|
|
|
53
58
|
// Set custom keyboard
|
|
@@ -94,7 +99,8 @@ typedef struct {
|
|
|
94
99
|
|
|
95
100
|
- (CGFloat)getBottomInset
|
|
96
101
|
{
|
|
97
|
-
|
|
102
|
+
// key window of the active scene; windows.firstObject is unreliable with the UIScene life cycle
|
|
103
|
+
UIWindow *window = RCTKeyWindow();
|
|
98
104
|
CGFloat bottom = window.safeAreaInsets.bottom > 0 ? 21 : 0;
|
|
99
105
|
return bottom;
|
|
100
106
|
}
|
package/package.json
CHANGED
package/android/app/app.iml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$">
|
|
6
|
-
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/codegen/java" isTestSource="false" />
|
|
7
|
-
</content>
|
|
8
|
-
<orderEntry type="inheritedJdk" />
|
|
9
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
-
</component>
|
|
11
|
-
</module>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
15
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
16
|
-
import com.facebook.react.uimanager.BaseViewManager;
|
|
17
|
-
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
18
|
-
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
19
|
-
|
|
20
|
-
public class NativeInputCalculatorManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & NativeInputCalculatorManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
21
|
-
public NativeInputCalculatorManagerDelegate(U viewManager) {
|
|
22
|
-
super(viewManager);
|
|
23
|
-
}
|
|
24
|
-
@Override
|
|
25
|
-
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
26
|
-
switch (propName) {
|
|
27
|
-
case "value":
|
|
28
|
-
mViewManager.setValue(view, value == null ? null : (String) value);
|
|
29
|
-
break;
|
|
30
|
-
case "textAttributes":
|
|
31
|
-
mViewManager.setTextAttributes(view, (ReadableMap) value);
|
|
32
|
-
break;
|
|
33
|
-
case "mode":
|
|
34
|
-
mViewManager.setMode(view, value == null ? null : (String) value);
|
|
35
|
-
break;
|
|
36
|
-
case "selectionColor":
|
|
37
|
-
mViewManager.setSelectionColor(view, value == null ? null : (String) value);
|
|
38
|
-
break;
|
|
39
|
-
case "customKeyText":
|
|
40
|
-
mViewManager.setCustomKeyText(view, value == null ? null : (String) value);
|
|
41
|
-
break;
|
|
42
|
-
case "customKeyBackground":
|
|
43
|
-
mViewManager.setCustomKeyBackground(view, value == null ? null : (String) value);
|
|
44
|
-
break;
|
|
45
|
-
case "customKeyTextColor":
|
|
46
|
-
mViewManager.setCustomKeyTextColor(view, value == null ? null : (String) value);
|
|
47
|
-
break;
|
|
48
|
-
case "customKeyState":
|
|
49
|
-
mViewManager.setCustomKeyState(view, value == null ? null : (String) value);
|
|
50
|
-
break;
|
|
51
|
-
default:
|
|
52
|
-
super.setProperty(view, propName, value);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@Override
|
|
57
|
-
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
|
|
58
|
-
switch (commandName) {
|
|
59
|
-
case "focus":
|
|
60
|
-
mViewManager.focus(view);
|
|
61
|
-
break;
|
|
62
|
-
case "blur":
|
|
63
|
-
mViewManager.blur(view);
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
15
|
-
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
16
|
-
|
|
17
|
-
public interface NativeInputCalculatorManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
18
|
-
void setValue(T view, @Nullable String value);
|
|
19
|
-
void setTextAttributes(T view, @Nullable ReadableMap value);
|
|
20
|
-
void setMode(T view, @Nullable String value);
|
|
21
|
-
void setSelectionColor(T view, @Nullable String value);
|
|
22
|
-
void setCustomKeyText(T view, @Nullable String value);
|
|
23
|
-
void setCustomKeyBackground(T view, @Nullable String value);
|
|
24
|
-
void setCustomKeyTextColor(T view, @Nullable String value);
|
|
25
|
-
void setCustomKeyState(T view, @Nullable String value);
|
|
26
|
-
void focus(T view);
|
|
27
|
-
void blur(T view);
|
|
28
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/ComponentDescriptors.h>
|
|
12
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
void CalculatorKeyboardSpecs_registerComponentDescriptorsFromCodegen(
|
|
18
|
-
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
-
registry->add(concreteComponentDescriptorProvider<NativeInputCalculatorComponentDescriptor>());
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
} // namespace facebook::react
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/ShadowNodes.h>
|
|
14
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
using NativeInputCalculatorComponentDescriptor = ConcreteComponentDescriptor<NativeInputCalculatorShadowNode>;
|
|
20
|
-
|
|
21
|
-
void CalculatorKeyboardSpecs_registerComponentDescriptorsFromCodegen(
|
|
22
|
-
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
-
|
|
24
|
-
} // namespace facebook::react
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/EventEmitters.h>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
namespace facebook::react {
|
|
15
|
-
|
|
16
|
-
void NativeInputCalculatorEventEmitter::onChange(OnChange event) const {
|
|
17
|
-
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
18
|
-
auto payload = jsi::Object(runtime);
|
|
19
|
-
payload.setProperty(runtime, "text", event.text);
|
|
20
|
-
return payload;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
void NativeInputCalculatorEventEmitter::onKeyPress(OnKeyPress event) const {
|
|
26
|
-
dispatchEvent("keyPress", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
27
|
-
auto payload = jsi::Object(runtime);
|
|
28
|
-
payload.setProperty(runtime, "key", event.key);
|
|
29
|
-
return payload;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
void NativeInputCalculatorEventEmitter::onResult(OnResult event) const {
|
|
35
|
-
dispatchEvent("result", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
36
|
-
auto payload = jsi::Object(runtime);
|
|
37
|
-
payload.setProperty(runtime, "result", event.result);
|
|
38
|
-
return payload;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
void NativeInputCalculatorEventEmitter::onBlur(OnBlur event) const {
|
|
44
|
-
dispatchEvent("blur", [](jsi::Runtime &runtime) {
|
|
45
|
-
auto payload = jsi::Object(runtime);
|
|
46
|
-
|
|
47
|
-
return payload;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
void NativeInputCalculatorEventEmitter::onFocus(OnFocus event) const {
|
|
53
|
-
dispatchEvent("focus", [](jsi::Runtime &runtime) {
|
|
54
|
-
auto payload = jsi::Object(runtime);
|
|
55
|
-
|
|
56
|
-
return payload;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
void NativeInputCalculatorEventEmitter::onCustomKeyEvent(OnCustomKeyEvent event) const {
|
|
62
|
-
dispatchEvent("customKeyEvent", [](jsi::Runtime &runtime) {
|
|
63
|
-
auto payload = jsi::Object(runtime);
|
|
64
|
-
|
|
65
|
-
return payload;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
} // namespace facebook::react
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
class NativeInputCalculatorEventEmitter : public ViewEventEmitter {
|
|
17
|
-
public:
|
|
18
|
-
using ViewEventEmitter::ViewEventEmitter;
|
|
19
|
-
|
|
20
|
-
struct OnChange {
|
|
21
|
-
std::string text;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
struct OnKeyPress {
|
|
25
|
-
std::string key;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
struct OnResult {
|
|
29
|
-
std::string result;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
struct OnBlur {
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
struct OnFocus {
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
struct OnCustomKeyEvent {
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
void onChange(OnChange value) const;
|
|
44
|
-
|
|
45
|
-
void onKeyPress(OnKeyPress value) const;
|
|
46
|
-
|
|
47
|
-
void onResult(OnResult value) const;
|
|
48
|
-
|
|
49
|
-
void onBlur(OnBlur value) const;
|
|
50
|
-
|
|
51
|
-
void onFocus(OnFocus value) const;
|
|
52
|
-
|
|
53
|
-
void onCustomKeyEvent(OnCustomKeyEvent value) const;
|
|
54
|
-
};
|
|
55
|
-
} // namespace facebook::react
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/Props.h>
|
|
12
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
-
#include <react/renderer/core/propsConversions.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
NativeInputCalculatorProps::NativeInputCalculatorProps(
|
|
18
|
-
const PropsParserContext &context,
|
|
19
|
-
const NativeInputCalculatorProps &sourceProps,
|
|
20
|
-
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
21
|
-
|
|
22
|
-
value(convertRawProp(context, rawProps, "value", sourceProps.value, {})),
|
|
23
|
-
textAttributes(convertRawProp(context, rawProps, "textAttributes", sourceProps.textAttributes, {})),
|
|
24
|
-
mode(convertRawProp(context, rawProps, "mode", sourceProps.mode, {})),
|
|
25
|
-
selectionColor(convertRawProp(context, rawProps, "selectionColor", sourceProps.selectionColor, {})),
|
|
26
|
-
customKeyText(convertRawProp(context, rawProps, "customKeyText", sourceProps.customKeyText, {})),
|
|
27
|
-
customKeyBackground(convertRawProp(context, rawProps, "customKeyBackground", sourceProps.customKeyBackground, {})),
|
|
28
|
-
customKeyTextColor(convertRawProp(context, rawProps, "customKeyTextColor", sourceProps.customKeyTextColor, {})),
|
|
29
|
-
customKeyState(convertRawProp(context, rawProps, "customKeyState", sourceProps.customKeyState, {}))
|
|
30
|
-
{}
|
|
31
|
-
|
|
32
|
-
} // namespace facebook::react
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewProps.h>
|
|
13
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
-
#include <react/renderer/core/propsConversions.h>
|
|
15
|
-
|
|
16
|
-
namespace facebook::react {
|
|
17
|
-
|
|
18
|
-
struct NativeInputCalculatorTextAttributesStruct {
|
|
19
|
-
Float fontSize{0.0};
|
|
20
|
-
std::string fontWeight{};
|
|
21
|
-
std::string placeholder{};
|
|
22
|
-
std::string placeholderTextColor{};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, NativeInputCalculatorTextAttributesStruct &result) {
|
|
26
|
-
auto map = (std::unordered_map<std::string, RawValue>)value;
|
|
27
|
-
|
|
28
|
-
auto tmp_fontSize = map.find("fontSize");
|
|
29
|
-
if (tmp_fontSize != map.end()) {
|
|
30
|
-
fromRawValue(context, tmp_fontSize->second, result.fontSize);
|
|
31
|
-
}
|
|
32
|
-
auto tmp_fontWeight = map.find("fontWeight");
|
|
33
|
-
if (tmp_fontWeight != map.end()) {
|
|
34
|
-
fromRawValue(context, tmp_fontWeight->second, result.fontWeight);
|
|
35
|
-
}
|
|
36
|
-
auto tmp_placeholder = map.find("placeholder");
|
|
37
|
-
if (tmp_placeholder != map.end()) {
|
|
38
|
-
fromRawValue(context, tmp_placeholder->second, result.placeholder);
|
|
39
|
-
}
|
|
40
|
-
auto tmp_placeholderTextColor = map.find("placeholderTextColor");
|
|
41
|
-
if (tmp_placeholderTextColor != map.end()) {
|
|
42
|
-
fromRawValue(context, tmp_placeholderTextColor->second, result.placeholderTextColor);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static inline std::string toString(const NativeInputCalculatorTextAttributesStruct &value) {
|
|
47
|
-
return "[Object NativeInputCalculatorTextAttributesStruct]";
|
|
48
|
-
}
|
|
49
|
-
class NativeInputCalculatorProps final : public ViewProps {
|
|
50
|
-
public:
|
|
51
|
-
NativeInputCalculatorProps() = default;
|
|
52
|
-
NativeInputCalculatorProps(const PropsParserContext& context, const NativeInputCalculatorProps &sourceProps, const RawProps &rawProps);
|
|
53
|
-
|
|
54
|
-
#pragma mark - Props
|
|
55
|
-
|
|
56
|
-
std::string value{};
|
|
57
|
-
NativeInputCalculatorTextAttributesStruct textAttributes{};
|
|
58
|
-
std::string mode{};
|
|
59
|
-
std::string selectionColor{};
|
|
60
|
-
std::string customKeyText{};
|
|
61
|
-
std::string customKeyBackground{};
|
|
62
|
-
std::string customKeyTextColor{};
|
|
63
|
-
std::string customKeyState{};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
} // namespace facebook::react
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateShadowNodeCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/ShadowNodes.h>
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
extern const char NativeInputCalculatorComponentName[] = "NativeInputCalculator";
|
|
16
|
-
|
|
17
|
-
} // namespace facebook::react
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateShadowNodeH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/EventEmitters.h>
|
|
14
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/Props.h>
|
|
15
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/States.h>
|
|
16
|
-
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
-
#include <jsi/jsi.h>
|
|
18
|
-
|
|
19
|
-
namespace facebook::react {
|
|
20
|
-
|
|
21
|
-
JSI_EXPORT extern const char NativeInputCalculatorComponentName[];
|
|
22
|
-
|
|
23
|
-
/*
|
|
24
|
-
* `ShadowNode` for <NativeInputCalculator> component.
|
|
25
|
-
*/
|
|
26
|
-
using NativeInputCalculatorShadowNode = ConcreteViewShadowNode<
|
|
27
|
-
NativeInputCalculatorComponentName,
|
|
28
|
-
NativeInputCalculatorProps,
|
|
29
|
-
NativeInputCalculatorEventEmitter,
|
|
30
|
-
NativeInputCalculatorState>;
|
|
31
|
-
|
|
32
|
-
} // namespace facebook::react
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateStateCpp.js
|
|
9
|
-
*/
|
|
10
|
-
#include <react/renderer/components/CalculatorKeyboardSpecs/States.h>
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} // namespace facebook::react
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateStateH.js
|
|
8
|
-
*/
|
|
9
|
-
#pragma once
|
|
10
|
-
|
|
11
|
-
#ifdef ANDROID
|
|
12
|
-
#include <folly/dynamic.h>
|
|
13
|
-
#endif
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
class NativeInputCalculatorState {
|
|
18
|
-
public:
|
|
19
|
-
NativeInputCalculatorState() = default;
|
|
20
|
-
|
|
21
|
-
#ifdef ANDROID
|
|
22
|
-
NativeInputCalculatorState(NativeInputCalculatorState const &previousState, folly::dynamic data){};
|
|
23
|
-
folly::dynamic getDynamic() const {
|
|
24
|
-
return {};
|
|
25
|
-
};
|
|
26
|
-
#endif
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
} // namespace facebook::react
|