@onekeyfe/react-native-auto-size-input 3.0.132 → 3.0.133
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/android/src/main/java/com/margelo/nitro/autosizeinput/AutoSizeInput.kt +2 -0
- package/ios/AutoSizeInput.swift +16 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +9 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +2 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +5 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +6 -0
- package/lib/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +7 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +6 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +1 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +24 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +2 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +2 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +2 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +3 -0
- package/lib/nitrogen/generated/shared/json/AutoSizeInputConfig.json +1 -0
- package/lib/typescript/src/AutoSizeInput.nitro.d.ts +1 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +5 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +6 -0
- package/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +7 -0
- package/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +6 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +24 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +2 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +3 -0
- package/nitrogen/generated/shared/json/AutoSizeInputConfig.json +1 -0
- package/package.json +1 -1
- package/src/AutoSizeInput.nitro.ts +1 -0
package/ios/AutoSizeInput.swift
CHANGED
|
@@ -203,6 +203,14 @@ class HybridAutoSizeInput: HybridAutoSizeInputSpec {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
var keyboardAppearance: String? {
|
|
207
|
+
didSet {
|
|
208
|
+
let appearance = keyboardAppearanceFrom(keyboardAppearance)
|
|
209
|
+
singleLineInput.keyboardAppearance = appearance
|
|
210
|
+
multiLineInput.keyboardAppearance = appearance
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
206
214
|
var returnKeyType: String? {
|
|
207
215
|
didSet {
|
|
208
216
|
let rkt = returnKeyTypeFrom(returnKeyType)
|
|
@@ -703,6 +711,14 @@ class HybridAutoSizeInput: HybridAutoSizeInputSpec {
|
|
|
703
711
|
}
|
|
704
712
|
}
|
|
705
713
|
|
|
714
|
+
private func keyboardAppearanceFrom(_ appearance: String?) -> UIKeyboardAppearance {
|
|
715
|
+
switch appearance {
|
|
716
|
+
case "light": return .light
|
|
717
|
+
case "dark": return .dark
|
|
718
|
+
default: return .default
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
706
722
|
private func autoCapitalizeTypeFrom(_ type: String?) -> UITextAutocapitalizationType {
|
|
707
723
|
switch type {
|
|
708
724
|
case "characters": return .allCharacters
|
|
@@ -208,6 +208,15 @@ namespace margelo::nitro::autosizeinput {
|
|
|
208
208
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* keyboardType */)>("setKeyboardType");
|
|
209
209
|
method(_javaPart, keyboardType.has_value() ? jni::make_jstring(keyboardType.value()) : nullptr);
|
|
210
210
|
}
|
|
211
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getKeyboardAppearance() {
|
|
212
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getKeyboardAppearance");
|
|
213
|
+
auto __result = method(_javaPart);
|
|
214
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
215
|
+
}
|
|
216
|
+
void JHybridAutoSizeInputSpec::setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) {
|
|
217
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* keyboardAppearance */)>("setKeyboardAppearance");
|
|
218
|
+
method(_javaPart, keyboardAppearance.has_value() ? jni::make_jstring(keyboardAppearance.value()) : nullptr);
|
|
219
|
+
}
|
|
211
220
|
std::optional<std::string> JHybridAutoSizeInputSpec::getReturnKeyType() {
|
|
212
221
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getReturnKeyType");
|
|
213
222
|
auto __result = method(_javaPart);
|
|
@@ -86,6 +86,8 @@ namespace margelo::nitro::autosizeinput {
|
|
|
86
86
|
void setEditable(std::optional<bool> editable) override;
|
|
87
87
|
std::optional<std::string> getKeyboardType() override;
|
|
88
88
|
void setKeyboardType(const std::optional<std::string>& keyboardType) override;
|
|
89
|
+
std::optional<std::string> getKeyboardAppearance() override;
|
|
90
|
+
void setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) override;
|
|
89
91
|
std::optional<std::string> getReturnKeyType() override;
|
|
90
92
|
void setReturnKeyType(const std::optional<std::string>& returnKeyType) override;
|
|
91
93
|
std::optional<bool> getAutoCorrect() override;
|
|
@@ -143,6 +143,11 @@ void JHybridAutoSizeInputStateUpdater::updateViewProps(jni::alias_ref<jni::JClas
|
|
|
143
143
|
: !newProps->keyboardType.hasSameValue(oldProps->keyboardType)) {
|
|
144
144
|
hybridView->setKeyboardType(newProps->keyboardType.get());
|
|
145
145
|
}
|
|
146
|
+
if (oldProps == nullptr
|
|
147
|
+
? newProps->keyboardAppearance.isProvided()
|
|
148
|
+
: !newProps->keyboardAppearance.hasSameValue(oldProps->keyboardAppearance)) {
|
|
149
|
+
hybridView->setKeyboardAppearance(newProps->keyboardAppearance.get());
|
|
150
|
+
}
|
|
146
151
|
if (oldProps == nullptr
|
|
147
152
|
? newProps->returnKeyType.isProvided()
|
|
148
153
|
: !newProps->returnKeyType.hasSameValue(oldProps->returnKeyType)) {
|
|
@@ -135,6 +135,12 @@ abstract class HybridAutoSizeInputSpec: HybridView() {
|
|
|
135
135
|
@set:Keep
|
|
136
136
|
abstract var keyboardType: String?
|
|
137
137
|
|
|
138
|
+
@get:DoNotStrip
|
|
139
|
+
@get:Keep
|
|
140
|
+
@set:DoNotStrip
|
|
141
|
+
@set:Keep
|
|
142
|
+
abstract var keyboardAppearance: String?
|
|
143
|
+
|
|
138
144
|
@get:DoNotStrip
|
|
139
145
|
@get:Keep
|
|
140
146
|
@set:DoNotStrip
|
|
@@ -190,6 +190,13 @@ namespace margelo::nitro::autosizeinput {
|
|
|
190
190
|
inline void setKeyboardType(const std::optional<std::string>& keyboardType) noexcept override {
|
|
191
191
|
_swiftPart.setKeyboardType(keyboardType);
|
|
192
192
|
}
|
|
193
|
+
inline std::optional<std::string> getKeyboardAppearance() noexcept override {
|
|
194
|
+
auto __result = _swiftPart.getKeyboardAppearance();
|
|
195
|
+
return __result;
|
|
196
|
+
}
|
|
197
|
+
inline void setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) noexcept override {
|
|
198
|
+
_swiftPart.setKeyboardAppearance(keyboardAppearance);
|
|
199
|
+
}
|
|
193
200
|
inline std::optional<std::string> getReturnKeyType() noexcept override {
|
|
194
201
|
auto __result = _swiftPart.getReturnKeyType();
|
|
195
202
|
return __result;
|
|
@@ -206,6 +206,12 @@ using namespace margelo::nitro::autosizeinput::views;
|
|
|
206
206
|
: !newViewProps.keyboardType.hasSameValue(oldViewProps->keyboardType)) {
|
|
207
207
|
swiftPart.setKeyboardType(newViewProps.keyboardType.get());
|
|
208
208
|
}
|
|
209
|
+
// keyboardAppearance: optional
|
|
210
|
+
if (oldViewProps == nullptr
|
|
211
|
+
? newViewProps.keyboardAppearance.isProvided()
|
|
212
|
+
: !newViewProps.keyboardAppearance.hasSameValue(oldViewProps->keyboardAppearance)) {
|
|
213
|
+
swiftPart.setKeyboardAppearance(newViewProps.keyboardAppearance.get());
|
|
214
|
+
}
|
|
209
215
|
// returnKeyType: optional
|
|
210
216
|
if (oldViewProps == nullptr
|
|
211
217
|
? newViewProps.returnKeyType.isProvided()
|
|
@@ -28,6 +28,7 @@ public protocol HybridAutoSizeInputSpec_protocol: HybridObject, HybridView {
|
|
|
28
28
|
var fontWeight: String? { get set }
|
|
29
29
|
var editable: Bool? { get set }
|
|
30
30
|
var keyboardType: String? { get set }
|
|
31
|
+
var keyboardAppearance: String? { get set }
|
|
31
32
|
var returnKeyType: String? { get set }
|
|
32
33
|
var autoCorrect: Bool? { get set }
|
|
33
34
|
var autoCapitalize: String? { get set }
|
|
@@ -553,6 +553,30 @@ open class HybridAutoSizeInputSpec_cxx {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
+
public final var keyboardAppearance: bridge.std__optional_std__string_ {
|
|
557
|
+
@inline(__always)
|
|
558
|
+
get {
|
|
559
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
560
|
+
if let __unwrappedValue = self.__implementation.keyboardAppearance {
|
|
561
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
562
|
+
} else {
|
|
563
|
+
return .init()
|
|
564
|
+
}
|
|
565
|
+
}()
|
|
566
|
+
}
|
|
567
|
+
@inline(__always)
|
|
568
|
+
set {
|
|
569
|
+
self.__implementation.keyboardAppearance = { () -> String? in
|
|
570
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
571
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
572
|
+
return String(__unwrapped)
|
|
573
|
+
} else {
|
|
574
|
+
return nil
|
|
575
|
+
}
|
|
576
|
+
}()
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
556
580
|
public final var returnKeyType: bridge.std__optional_std__string_ {
|
|
557
581
|
@inline(__always)
|
|
558
582
|
get {
|
|
@@ -50,6 +50,8 @@ namespace margelo::nitro::autosizeinput {
|
|
|
50
50
|
prototype.registerHybridSetter("editable", &HybridAutoSizeInputSpec::setEditable);
|
|
51
51
|
prototype.registerHybridGetter("keyboardType", &HybridAutoSizeInputSpec::getKeyboardType);
|
|
52
52
|
prototype.registerHybridSetter("keyboardType", &HybridAutoSizeInputSpec::setKeyboardType);
|
|
53
|
+
prototype.registerHybridGetter("keyboardAppearance", &HybridAutoSizeInputSpec::getKeyboardAppearance);
|
|
54
|
+
prototype.registerHybridSetter("keyboardAppearance", &HybridAutoSizeInputSpec::setKeyboardAppearance);
|
|
53
55
|
prototype.registerHybridGetter("returnKeyType", &HybridAutoSizeInputSpec::getReturnKeyType);
|
|
54
56
|
prototype.registerHybridSetter("returnKeyType", &HybridAutoSizeInputSpec::setReturnKeyType);
|
|
55
57
|
prototype.registerHybridGetter("autoCorrect", &HybridAutoSizeInputSpec::getAutoCorrect);
|
|
@@ -82,6 +82,8 @@ namespace margelo::nitro::autosizeinput {
|
|
|
82
82
|
virtual void setEditable(std::optional<bool> editable) = 0;
|
|
83
83
|
virtual std::optional<std::string> getKeyboardType() = 0;
|
|
84
84
|
virtual void setKeyboardType(const std::optional<std::string>& keyboardType) = 0;
|
|
85
|
+
virtual std::optional<std::string> getKeyboardAppearance() = 0;
|
|
86
|
+
virtual void setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) = 0;
|
|
85
87
|
virtual std::optional<std::string> getReturnKeyType() = 0;
|
|
86
88
|
virtual void setReturnKeyType(const std::optional<std::string>& returnKeyType) = 0;
|
|
87
89
|
virtual std::optional<bool> getAutoCorrect() = 0;
|
|
@@ -38,6 +38,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
38
38
|
fontWeight(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "fontWeight", rawProps, sourceProps.fontWeight)),
|
|
39
39
|
editable(nitro::ReactProp<std::optional<bool>>::fromRawValue("AutoSizeInput", "editable", rawProps, sourceProps.editable)),
|
|
40
40
|
keyboardType(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "keyboardType", rawProps, sourceProps.keyboardType)),
|
|
41
|
+
keyboardAppearance(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "keyboardAppearance", rawProps, sourceProps.keyboardAppearance)),
|
|
41
42
|
returnKeyType(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "returnKeyType", rawProps, sourceProps.returnKeyType)),
|
|
42
43
|
autoCorrect(nitro::ReactProp<std::optional<bool>>::fromRawValue("AutoSizeInput", "autoCorrect", rawProps, sourceProps.autoCorrect)),
|
|
43
44
|
autoCapitalize(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "autoCapitalize", rawProps, sourceProps.autoCapitalize)),
|
|
@@ -73,6 +74,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
73
74
|
case hashString("fontWeight"): return true;
|
|
74
75
|
case hashString("editable"): return true;
|
|
75
76
|
case hashString("keyboardType"): return true;
|
|
77
|
+
case hashString("keyboardAppearance"): return true;
|
|
76
78
|
case hashString("returnKeyType"): return true;
|
|
77
79
|
case hashString("autoCorrect"): return true;
|
|
78
80
|
case hashString("autoCapitalize"): return true;
|
|
@@ -61,6 +61,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
61
61
|
nitro::ReactProp<std::optional<std::string>> fontWeight;
|
|
62
62
|
nitro::ReactProp<std::optional<bool>> editable;
|
|
63
63
|
nitro::ReactProp<std::optional<std::string>> keyboardType;
|
|
64
|
+
nitro::ReactProp<std::optional<std::string>> keyboardAppearance;
|
|
64
65
|
nitro::ReactProp<std::optional<std::string>> returnKeyType;
|
|
65
66
|
nitro::ReactProp<std::optional<bool>> autoCorrect;
|
|
66
67
|
nitro::ReactProp<std::optional<std::string>> autoCapitalize;
|
|
@@ -96,6 +97,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
96
97
|
fontWeight.hasSameValue(other.fontWeight) &&
|
|
97
98
|
editable.hasSameValue(other.editable) &&
|
|
98
99
|
keyboardType.hasSameValue(other.keyboardType) &&
|
|
100
|
+
keyboardAppearance.hasSameValue(other.keyboardAppearance) &&
|
|
99
101
|
returnKeyType.hasSameValue(other.returnKeyType) &&
|
|
100
102
|
autoCorrect.hasSameValue(other.autoCorrect) &&
|
|
101
103
|
autoCapitalize.hasSameValue(other.autoCapitalize) &&
|
|
@@ -132,6 +134,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
132
134
|
fontWeight.isProvided() ||
|
|
133
135
|
editable.isProvided() ||
|
|
134
136
|
keyboardType.isProvided() ||
|
|
137
|
+
keyboardAppearance.isProvided() ||
|
|
135
138
|
returnKeyType.isProvided() ||
|
|
136
139
|
autoCorrect.isProvided() ||
|
|
137
140
|
autoCapitalize.isProvided() ||
|
|
@@ -208,6 +208,15 @@ namespace margelo::nitro::autosizeinput {
|
|
|
208
208
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* keyboardType */)>("setKeyboardType");
|
|
209
209
|
method(_javaPart, keyboardType.has_value() ? jni::make_jstring(keyboardType.value()) : nullptr);
|
|
210
210
|
}
|
|
211
|
+
std::optional<std::string> JHybridAutoSizeInputSpec::getKeyboardAppearance() {
|
|
212
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getKeyboardAppearance");
|
|
213
|
+
auto __result = method(_javaPart);
|
|
214
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
215
|
+
}
|
|
216
|
+
void JHybridAutoSizeInputSpec::setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) {
|
|
217
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* keyboardAppearance */)>("setKeyboardAppearance");
|
|
218
|
+
method(_javaPart, keyboardAppearance.has_value() ? jni::make_jstring(keyboardAppearance.value()) : nullptr);
|
|
219
|
+
}
|
|
211
220
|
std::optional<std::string> JHybridAutoSizeInputSpec::getReturnKeyType() {
|
|
212
221
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getReturnKeyType");
|
|
213
222
|
auto __result = method(_javaPart);
|
|
@@ -86,6 +86,8 @@ namespace margelo::nitro::autosizeinput {
|
|
|
86
86
|
void setEditable(std::optional<bool> editable) override;
|
|
87
87
|
std::optional<std::string> getKeyboardType() override;
|
|
88
88
|
void setKeyboardType(const std::optional<std::string>& keyboardType) override;
|
|
89
|
+
std::optional<std::string> getKeyboardAppearance() override;
|
|
90
|
+
void setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) override;
|
|
89
91
|
std::optional<std::string> getReturnKeyType() override;
|
|
90
92
|
void setReturnKeyType(const std::optional<std::string>& returnKeyType) override;
|
|
91
93
|
std::optional<bool> getAutoCorrect() override;
|
|
@@ -143,6 +143,11 @@ void JHybridAutoSizeInputStateUpdater::updateViewProps(jni::alias_ref<jni::JClas
|
|
|
143
143
|
: !newProps->keyboardType.hasSameValue(oldProps->keyboardType)) {
|
|
144
144
|
hybridView->setKeyboardType(newProps->keyboardType.get());
|
|
145
145
|
}
|
|
146
|
+
if (oldProps == nullptr
|
|
147
|
+
? newProps->keyboardAppearance.isProvided()
|
|
148
|
+
: !newProps->keyboardAppearance.hasSameValue(oldProps->keyboardAppearance)) {
|
|
149
|
+
hybridView->setKeyboardAppearance(newProps->keyboardAppearance.get());
|
|
150
|
+
}
|
|
146
151
|
if (oldProps == nullptr
|
|
147
152
|
? newProps->returnKeyType.isProvided()
|
|
148
153
|
: !newProps->returnKeyType.hasSameValue(oldProps->returnKeyType)) {
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt
CHANGED
|
@@ -135,6 +135,12 @@ abstract class HybridAutoSizeInputSpec: HybridView() {
|
|
|
135
135
|
@set:Keep
|
|
136
136
|
abstract var keyboardType: String?
|
|
137
137
|
|
|
138
|
+
@get:DoNotStrip
|
|
139
|
+
@get:Keep
|
|
140
|
+
@set:DoNotStrip
|
|
141
|
+
@set:Keep
|
|
142
|
+
abstract var keyboardAppearance: String?
|
|
143
|
+
|
|
138
144
|
@get:DoNotStrip
|
|
139
145
|
@get:Keep
|
|
140
146
|
@set:DoNotStrip
|
|
@@ -190,6 +190,13 @@ namespace margelo::nitro::autosizeinput {
|
|
|
190
190
|
inline void setKeyboardType(const std::optional<std::string>& keyboardType) noexcept override {
|
|
191
191
|
_swiftPart.setKeyboardType(keyboardType);
|
|
192
192
|
}
|
|
193
|
+
inline std::optional<std::string> getKeyboardAppearance() noexcept override {
|
|
194
|
+
auto __result = _swiftPart.getKeyboardAppearance();
|
|
195
|
+
return __result;
|
|
196
|
+
}
|
|
197
|
+
inline void setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) noexcept override {
|
|
198
|
+
_swiftPart.setKeyboardAppearance(keyboardAppearance);
|
|
199
|
+
}
|
|
193
200
|
inline std::optional<std::string> getReturnKeyType() noexcept override {
|
|
194
201
|
auto __result = _swiftPart.getReturnKeyType();
|
|
195
202
|
return __result;
|
|
@@ -206,6 +206,12 @@ using namespace margelo::nitro::autosizeinput::views;
|
|
|
206
206
|
: !newViewProps.keyboardType.hasSameValue(oldViewProps->keyboardType)) {
|
|
207
207
|
swiftPart.setKeyboardType(newViewProps.keyboardType.get());
|
|
208
208
|
}
|
|
209
|
+
// keyboardAppearance: optional
|
|
210
|
+
if (oldViewProps == nullptr
|
|
211
|
+
? newViewProps.keyboardAppearance.isProvided()
|
|
212
|
+
: !newViewProps.keyboardAppearance.hasSameValue(oldViewProps->keyboardAppearance)) {
|
|
213
|
+
swiftPart.setKeyboardAppearance(newViewProps.keyboardAppearance.get());
|
|
214
|
+
}
|
|
209
215
|
// returnKeyType: optional
|
|
210
216
|
if (oldViewProps == nullptr
|
|
211
217
|
? newViewProps.returnKeyType.isProvided()
|
|
@@ -28,6 +28,7 @@ public protocol HybridAutoSizeInputSpec_protocol: HybridObject, HybridView {
|
|
|
28
28
|
var fontWeight: String? { get set }
|
|
29
29
|
var editable: Bool? { get set }
|
|
30
30
|
var keyboardType: String? { get set }
|
|
31
|
+
var keyboardAppearance: String? { get set }
|
|
31
32
|
var returnKeyType: String? { get set }
|
|
32
33
|
var autoCorrect: Bool? { get set }
|
|
33
34
|
var autoCapitalize: String? { get set }
|
|
@@ -553,6 +553,30 @@ open class HybridAutoSizeInputSpec_cxx {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
+
public final var keyboardAppearance: bridge.std__optional_std__string_ {
|
|
557
|
+
@inline(__always)
|
|
558
|
+
get {
|
|
559
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
560
|
+
if let __unwrappedValue = self.__implementation.keyboardAppearance {
|
|
561
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
562
|
+
} else {
|
|
563
|
+
return .init()
|
|
564
|
+
}
|
|
565
|
+
}()
|
|
566
|
+
}
|
|
567
|
+
@inline(__always)
|
|
568
|
+
set {
|
|
569
|
+
self.__implementation.keyboardAppearance = { () -> String? in
|
|
570
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
571
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
572
|
+
return String(__unwrapped)
|
|
573
|
+
} else {
|
|
574
|
+
return nil
|
|
575
|
+
}
|
|
576
|
+
}()
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
556
580
|
public final var returnKeyType: bridge.std__optional_std__string_ {
|
|
557
581
|
@inline(__always)
|
|
558
582
|
get {
|
|
@@ -50,6 +50,8 @@ namespace margelo::nitro::autosizeinput {
|
|
|
50
50
|
prototype.registerHybridSetter("editable", &HybridAutoSizeInputSpec::setEditable);
|
|
51
51
|
prototype.registerHybridGetter("keyboardType", &HybridAutoSizeInputSpec::getKeyboardType);
|
|
52
52
|
prototype.registerHybridSetter("keyboardType", &HybridAutoSizeInputSpec::setKeyboardType);
|
|
53
|
+
prototype.registerHybridGetter("keyboardAppearance", &HybridAutoSizeInputSpec::getKeyboardAppearance);
|
|
54
|
+
prototype.registerHybridSetter("keyboardAppearance", &HybridAutoSizeInputSpec::setKeyboardAppearance);
|
|
53
55
|
prototype.registerHybridGetter("returnKeyType", &HybridAutoSizeInputSpec::getReturnKeyType);
|
|
54
56
|
prototype.registerHybridSetter("returnKeyType", &HybridAutoSizeInputSpec::setReturnKeyType);
|
|
55
57
|
prototype.registerHybridGetter("autoCorrect", &HybridAutoSizeInputSpec::getAutoCorrect);
|
|
@@ -82,6 +82,8 @@ namespace margelo::nitro::autosizeinput {
|
|
|
82
82
|
virtual void setEditable(std::optional<bool> editable) = 0;
|
|
83
83
|
virtual std::optional<std::string> getKeyboardType() = 0;
|
|
84
84
|
virtual void setKeyboardType(const std::optional<std::string>& keyboardType) = 0;
|
|
85
|
+
virtual std::optional<std::string> getKeyboardAppearance() = 0;
|
|
86
|
+
virtual void setKeyboardAppearance(const std::optional<std::string>& keyboardAppearance) = 0;
|
|
85
87
|
virtual std::optional<std::string> getReturnKeyType() = 0;
|
|
86
88
|
virtual void setReturnKeyType(const std::optional<std::string>& returnKeyType) = 0;
|
|
87
89
|
virtual std::optional<bool> getAutoCorrect() = 0;
|
|
@@ -38,6 +38,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
38
38
|
fontWeight(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "fontWeight", rawProps, sourceProps.fontWeight)),
|
|
39
39
|
editable(nitro::ReactProp<std::optional<bool>>::fromRawValue("AutoSizeInput", "editable", rawProps, sourceProps.editable)),
|
|
40
40
|
keyboardType(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "keyboardType", rawProps, sourceProps.keyboardType)),
|
|
41
|
+
keyboardAppearance(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "keyboardAppearance", rawProps, sourceProps.keyboardAppearance)),
|
|
41
42
|
returnKeyType(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "returnKeyType", rawProps, sourceProps.returnKeyType)),
|
|
42
43
|
autoCorrect(nitro::ReactProp<std::optional<bool>>::fromRawValue("AutoSizeInput", "autoCorrect", rawProps, sourceProps.autoCorrect)),
|
|
43
44
|
autoCapitalize(nitro::ReactProp<std::optional<std::string>>::fromRawValue("AutoSizeInput", "autoCapitalize", rawProps, sourceProps.autoCapitalize)),
|
|
@@ -73,6 +74,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
73
74
|
case hashString("fontWeight"): return true;
|
|
74
75
|
case hashString("editable"): return true;
|
|
75
76
|
case hashString("keyboardType"): return true;
|
|
77
|
+
case hashString("keyboardAppearance"): return true;
|
|
76
78
|
case hashString("returnKeyType"): return true;
|
|
77
79
|
case hashString("autoCorrect"): return true;
|
|
78
80
|
case hashString("autoCapitalize"): return true;
|
|
@@ -61,6 +61,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
61
61
|
nitro::ReactProp<std::optional<std::string>> fontWeight;
|
|
62
62
|
nitro::ReactProp<std::optional<bool>> editable;
|
|
63
63
|
nitro::ReactProp<std::optional<std::string>> keyboardType;
|
|
64
|
+
nitro::ReactProp<std::optional<std::string>> keyboardAppearance;
|
|
64
65
|
nitro::ReactProp<std::optional<std::string>> returnKeyType;
|
|
65
66
|
nitro::ReactProp<std::optional<bool>> autoCorrect;
|
|
66
67
|
nitro::ReactProp<std::optional<std::string>> autoCapitalize;
|
|
@@ -96,6 +97,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
96
97
|
fontWeight.hasSameValue(other.fontWeight) &&
|
|
97
98
|
editable.hasSameValue(other.editable) &&
|
|
98
99
|
keyboardType.hasSameValue(other.keyboardType) &&
|
|
100
|
+
keyboardAppearance.hasSameValue(other.keyboardAppearance) &&
|
|
99
101
|
returnKeyType.hasSameValue(other.returnKeyType) &&
|
|
100
102
|
autoCorrect.hasSameValue(other.autoCorrect) &&
|
|
101
103
|
autoCapitalize.hasSameValue(other.autoCapitalize) &&
|
|
@@ -132,6 +134,7 @@ namespace margelo::nitro::autosizeinput::views {
|
|
|
132
134
|
fontWeight.isProvided() ||
|
|
133
135
|
editable.isProvided() ||
|
|
134
136
|
keyboardType.isProvided() ||
|
|
137
|
+
keyboardAppearance.isProvided() ||
|
|
135
138
|
returnKeyType.isProvided() ||
|
|
136
139
|
autoCorrect.isProvided() ||
|
|
137
140
|
autoCapitalize.isProvided() ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-auto-size-input",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.133",
|
|
4
4
|
"description": "Auto-sizing text input with font scaling, prefix and suffix support",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|