react-native-nitro-input 0.3.1 → 0.3.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/CHANGELOG.md +31 -0
- package/README.md +30 -3
- package/android/src/main/cpp/JMaskEngine.cpp +45 -0
- package/android/src/main/cpp/JMaskEngine.hpp +9 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/MaskEngine.kt +16 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +96 -6
- package/cpp/MaskEngine.cpp +294 -33
- package/cpp/MaskEngine.hpp +68 -0
- package/ios/HybridNitroInputView.swift +18 -0
- package/ios/NitroInputView.swift +125 -7
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/commonjs/src/NitroInput.js +15 -2
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/module/src/NitroInput.js +15 -2
- package/lib/typescript/src/NitroInput.d.ts +39 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +43 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +102 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +12 -0
- package/nitrogen/generated/android/c++/JNitroInputCharacterMapping.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroInputMaskAffinity.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroInputTextCase.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputCharacterMapping.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputMaskAffinity.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputTextCase.kt +24 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +25 -11
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +50 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +36 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +6 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +78 -0
- package/nitrogen/generated/ios/swift/NitroInputCharacterMapping.swift +34 -0
- package/nitrogen/generated/ios/swift/NitroInputMaskAffinity.swift +48 -0
- package/nitrogen/generated/ios/swift/NitroInputTextCase.swift +44 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +21 -0
- package/nitrogen/generated/shared/c++/NitroInputCharacterMapping.hpp +87 -0
- package/nitrogen/generated/shared/c++/NitroInputMaskAffinity.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroInputTextCase.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +21 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +73 -0
- package/src/index.ts +3 -0
- package/src/specs/NitroInput.nitro.ts +46 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroInputCharacterMapping.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroInputCharacterMapping.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitroinput {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "NitroInputCharacterMapping" and the Kotlin data class "NitroInputCharacterMapping".
|
|
21
|
+
*/
|
|
22
|
+
struct JNitroInputCharacterMapping final: public jni::JavaClass<JNitroInputCharacterMapping> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NitroInputCharacterMapping;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroInputCharacterMapping by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
NitroInputCharacterMapping toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldFrom = clazz->getField<jni::JString>("from");
|
|
35
|
+
jni::local_ref<jni::JString> from = this->getFieldValue(fieldFrom);
|
|
36
|
+
static const auto fieldTo = clazz->getField<jni::JString>("to");
|
|
37
|
+
jni::local_ref<jni::JString> to = this->getFieldValue(fieldTo);
|
|
38
|
+
return NitroInputCharacterMapping(
|
|
39
|
+
from->toStdString(),
|
|
40
|
+
to->toStdString()
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
static jni::local_ref<JNitroInputCharacterMapping::javaobject> fromCpp(const NitroInputCharacterMapping& value) {
|
|
50
|
+
using JSignature = JNitroInputCharacterMapping(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
+
return create(
|
|
54
|
+
clazz,
|
|
55
|
+
jni::make_jstring(value.from),
|
|
56
|
+
jni::make_jstring(value.to)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroInputMaskAffinity.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroInputMaskAffinity.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NitroInputMaskAffinity" and the Kotlin enum "NitroInputMaskAffinity".
|
|
19
|
+
*/
|
|
20
|
+
struct JNitroInputMaskAffinity final: public jni::JavaClass<JNitroInputMaskAffinity> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NitroInputMaskAffinity;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NitroInputMaskAffinity.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NitroInputMaskAffinity toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<NitroInputMaskAffinity>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JNitroInputMaskAffinity> fromCpp(NitroInputMaskAffinity value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NitroInputMaskAffinity::WHOLESTRING:
|
|
46
|
+
static const auto fieldWHOLESTRING = clazz->getStaticField<JNitroInputMaskAffinity>("WHOLESTRING");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldWHOLESTRING);
|
|
48
|
+
case NitroInputMaskAffinity::PREFIX:
|
|
49
|
+
static const auto fieldPREFIX = clazz->getStaticField<JNitroInputMaskAffinity>("PREFIX");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldPREFIX);
|
|
51
|
+
case NitroInputMaskAffinity::CAPACITY:
|
|
52
|
+
static const auto fieldCAPACITY = clazz->getStaticField<JNitroInputMaskAffinity>("CAPACITY");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldCAPACITY);
|
|
54
|
+
case NitroInputMaskAffinity::EXTRACTEDVALUECAPACITY:
|
|
55
|
+
static const auto fieldEXTRACTEDVALUECAPACITY = clazz->getStaticField<JNitroInputMaskAffinity>("EXTRACTEDVALUECAPACITY");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldEXTRACTEDVALUECAPACITY);
|
|
57
|
+
default:
|
|
58
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
59
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroInputTextCase.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroInputTextCase.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NitroInputTextCase" and the Kotlin enum "NitroInputTextCase".
|
|
19
|
+
*/
|
|
20
|
+
struct JNitroInputTextCase final: public jni::JavaClass<JNitroInputTextCase> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NitroInputTextCase;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NitroInputTextCase.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NitroInputTextCase toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<NitroInputTextCase>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JNitroInputTextCase> fromCpp(NitroInputTextCase value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NitroInputTextCase::NONE:
|
|
46
|
+
static const auto fieldNONE = clazz->getStaticField<JNitroInputTextCase>("NONE");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldNONE);
|
|
48
|
+
case NitroInputTextCase::UPPER:
|
|
49
|
+
static const auto fieldUPPER = clazz->getStaticField<JNitroInputTextCase>("UPPER");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldUPPER);
|
|
51
|
+
case NitroInputTextCase::LOWER:
|
|
52
|
+
static const auto fieldLOWER = clazz->getStaticField<JNitroInputTextCase>("LOWER");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldLOWER);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -103,6 +103,36 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_ref<jni::JCla
|
|
|
103
103
|
: !newProps->maskAutoSkip.hasSameValue(oldProps->maskAutoSkip)) {
|
|
104
104
|
hybridView->setMaskAutoSkip(newProps->maskAutoSkip.get());
|
|
105
105
|
}
|
|
106
|
+
if (oldProps == nullptr
|
|
107
|
+
? newProps->maskAffinityFormats.isProvided()
|
|
108
|
+
: !newProps->maskAffinityFormats.hasSameValue(oldProps->maskAffinityFormats)) {
|
|
109
|
+
hybridView->setMaskAffinityFormats(newProps->maskAffinityFormats.get());
|
|
110
|
+
}
|
|
111
|
+
if (oldProps == nullptr
|
|
112
|
+
? newProps->maskAffinityStrategy.isProvided()
|
|
113
|
+
: !newProps->maskAffinityStrategy.hasSameValue(oldProps->maskAffinityStrategy)) {
|
|
114
|
+
hybridView->setMaskAffinityStrategy(newProps->maskAffinityStrategy.get());
|
|
115
|
+
}
|
|
116
|
+
if (oldProps == nullptr
|
|
117
|
+
? newProps->maskTextCase.isProvided()
|
|
118
|
+
: !newProps->maskTextCase.hasSameValue(oldProps->maskTextCase)) {
|
|
119
|
+
hybridView->setMaskTextCase(newProps->maskTextCase.get());
|
|
120
|
+
}
|
|
121
|
+
if (oldProps == nullptr
|
|
122
|
+
? newProps->maskCharacterMap.isProvided()
|
|
123
|
+
: !newProps->maskCharacterMap.hasSameValue(oldProps->maskCharacterMap)) {
|
|
124
|
+
hybridView->setMaskCharacterMap(newProps->maskCharacterMap.get());
|
|
125
|
+
}
|
|
126
|
+
if (oldProps == nullptr
|
|
127
|
+
? newProps->maskSlotPlaceholder.isProvided()
|
|
128
|
+
: !newProps->maskSlotPlaceholder.hasSameValue(oldProps->maskSlotPlaceholder)) {
|
|
129
|
+
hybridView->setMaskSlotPlaceholder(newProps->maskSlotPlaceholder.get());
|
|
130
|
+
}
|
|
131
|
+
if (oldProps == nullptr
|
|
132
|
+
? newProps->keepPlaceholder.isProvided()
|
|
133
|
+
: !newProps->keepPlaceholder.hasSameValue(oldProps->keepPlaceholder)) {
|
|
134
|
+
hybridView->setKeepPlaceholder(newProps->keepPlaceholder.get());
|
|
135
|
+
}
|
|
106
136
|
if (oldProps == nullptr
|
|
107
137
|
? newProps->groupingSeparator.isProvided()
|
|
108
138
|
: !newProps->groupingSeparator.hasSameValue(oldProps->groupingSeparator)) {
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt
CHANGED
|
@@ -87,6 +87,42 @@ abstract class HybridNitroInputViewSpec: HybridView() {
|
|
|
87
87
|
@set:Keep
|
|
88
88
|
abstract var maskAutoSkip: Boolean
|
|
89
89
|
|
|
90
|
+
@get:DoNotStrip
|
|
91
|
+
@get:Keep
|
|
92
|
+
@set:DoNotStrip
|
|
93
|
+
@set:Keep
|
|
94
|
+
abstract var maskAffinityFormats: Array<String>
|
|
95
|
+
|
|
96
|
+
@get:DoNotStrip
|
|
97
|
+
@get:Keep
|
|
98
|
+
@set:DoNotStrip
|
|
99
|
+
@set:Keep
|
|
100
|
+
abstract var maskAffinityStrategy: NitroInputMaskAffinity
|
|
101
|
+
|
|
102
|
+
@get:DoNotStrip
|
|
103
|
+
@get:Keep
|
|
104
|
+
@set:DoNotStrip
|
|
105
|
+
@set:Keep
|
|
106
|
+
abstract var maskTextCase: NitroInputTextCase
|
|
107
|
+
|
|
108
|
+
@get:DoNotStrip
|
|
109
|
+
@get:Keep
|
|
110
|
+
@set:DoNotStrip
|
|
111
|
+
@set:Keep
|
|
112
|
+
abstract var maskCharacterMap: Array<NitroInputCharacterMapping>
|
|
113
|
+
|
|
114
|
+
@get:DoNotStrip
|
|
115
|
+
@get:Keep
|
|
116
|
+
@set:DoNotStrip
|
|
117
|
+
@set:Keep
|
|
118
|
+
abstract var maskSlotPlaceholder: String
|
|
119
|
+
|
|
120
|
+
@get:DoNotStrip
|
|
121
|
+
@get:Keep
|
|
122
|
+
@set:DoNotStrip
|
|
123
|
+
@set:Keep
|
|
124
|
+
abstract var keepPlaceholder: Boolean
|
|
125
|
+
|
|
90
126
|
@get:DoNotStrip
|
|
91
127
|
@get:Keep
|
|
92
128
|
@set:DoNotStrip
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputCharacterMapping.kt
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputCharacterMapping.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "NitroInputCharacterMapping".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class NitroInputCharacterMapping(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val from: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val to: String
|
|
27
|
+
) {
|
|
28
|
+
/* primary constructor */
|
|
29
|
+
|
|
30
|
+
override fun equals(other: Any?): Boolean {
|
|
31
|
+
if (this === other) return true
|
|
32
|
+
if (other !is NitroInputCharacterMapping) return false
|
|
33
|
+
return Objects.deepEquals(this.from, other.from)
|
|
34
|
+
&& Objects.deepEquals(this.to, other.to)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun hashCode(): Int {
|
|
38
|
+
return arrayOf<Any?>(
|
|
39
|
+
from,
|
|
40
|
+
to
|
|
41
|
+
).contentDeepHashCode()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
companion object {
|
|
45
|
+
/**
|
|
46
|
+
* Constructor called from C++
|
|
47
|
+
*/
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
@Suppress("unused")
|
|
51
|
+
@JvmStatic
|
|
52
|
+
private fun fromCpp(from: String, to: String): NitroInputCharacterMapping {
|
|
53
|
+
return NitroInputCharacterMapping(from, to)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputMaskAffinity.kt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskAffinity.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NitroInputMaskAffinity".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NitroInputMaskAffinity(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
WHOLESTRING(0),
|
|
20
|
+
PREFIX(1),
|
|
21
|
+
CAPACITY(2),
|
|
22
|
+
EXTRACTEDVALUECAPACITY(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputTextCase.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NitroInputTextCase".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NitroInputTextCase(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NONE(0),
|
|
20
|
+
UPPER(1),
|
|
21
|
+
LOWER(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
|
@@ -20,6 +20,8 @@ namespace margelo::nitro::nitroinput { class HybridNitroPlatformNumberFormatterS
|
|
|
20
20
|
namespace margelo::nitro::nitroinput { class HybridNitroTextMeasureSpec; }
|
|
21
21
|
// Forward declaration of `HybridNitroTextViewSpec` to properly resolve imports.
|
|
22
22
|
namespace margelo::nitro::nitroinput { class HybridNitroTextViewSpec; }
|
|
23
|
+
// Forward declaration of `NitroInputCharacterMapping` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitroinput { struct NitroInputCharacterMapping; }
|
|
23
25
|
// Forward declaration of `NitroInputEasing` to properly resolve imports.
|
|
24
26
|
namespace margelo::nitro::nitroinput { enum class NitroInputEasing; }
|
|
25
27
|
// Forward declaration of `NitroInputEffect` to properly resolve imports.
|
|
@@ -64,6 +66,7 @@ namespace NitroInput { class HybridNitroTextViewSpec_cxx; }
|
|
|
64
66
|
#include "HybridNitroPlatformNumberFormatterSpec.hpp"
|
|
65
67
|
#include "HybridNitroTextMeasureSpec.hpp"
|
|
66
68
|
#include "HybridNitroTextViewSpec.hpp"
|
|
69
|
+
#include "NitroInputCharacterMapping.hpp"
|
|
67
70
|
#include "NitroInputEasing.hpp"
|
|
68
71
|
#include "NitroInputEffect.hpp"
|
|
69
72
|
#include "NitroInputNotation.hpp"
|
|
@@ -100,6 +103,28 @@ namespace margelo::nitro::nitroinput::bridge::swift {
|
|
|
100
103
|
return vector;
|
|
101
104
|
}
|
|
102
105
|
|
|
106
|
+
// pragma MARK: std::vector<std::string>
|
|
107
|
+
/**
|
|
108
|
+
* Specialized version of `std::vector<std::string>`.
|
|
109
|
+
*/
|
|
110
|
+
using std__vector_std__string_ = std::vector<std::string>;
|
|
111
|
+
inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
|
|
112
|
+
std::vector<std::string> vector;
|
|
113
|
+
vector.reserve(size);
|
|
114
|
+
return vector;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// pragma MARK: std::vector<NitroInputCharacterMapping>
|
|
118
|
+
/**
|
|
119
|
+
* Specialized version of `std::vector<NitroInputCharacterMapping>`.
|
|
120
|
+
*/
|
|
121
|
+
using std__vector_NitroInputCharacterMapping_ = std::vector<NitroInputCharacterMapping>;
|
|
122
|
+
inline std::vector<NitroInputCharacterMapping> create_std__vector_NitroInputCharacterMapping_(size_t size) noexcept {
|
|
123
|
+
std::vector<NitroInputCharacterMapping> vector;
|
|
124
|
+
vector.reserve(size);
|
|
125
|
+
return vector;
|
|
126
|
+
}
|
|
127
|
+
|
|
103
128
|
// pragma MARK: std::function<void(const std::string& /* text */, double /* eventCount */)>
|
|
104
129
|
/**
|
|
105
130
|
* Specialized version of `std::function<void(const std::string&, double)>`.
|
|
@@ -576,17 +601,6 @@ namespace margelo::nitro::nitroinput::bridge::swift {
|
|
|
576
601
|
return optional.value();
|
|
577
602
|
}
|
|
578
603
|
|
|
579
|
-
// pragma MARK: std::vector<std::string>
|
|
580
|
-
/**
|
|
581
|
-
* Specialized version of `std::vector<std::string>`.
|
|
582
|
-
*/
|
|
583
|
-
using std__vector_std__string_ = std::vector<std::string>;
|
|
584
|
-
inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
|
|
585
|
-
std::vector<std::string> vector;
|
|
586
|
-
vector.reserve(size);
|
|
587
|
-
return vector;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
604
|
// pragma MARK: std::optional<std::vector<std::string>>
|
|
591
605
|
/**
|
|
592
606
|
* Specialized version of `std::optional<std::vector<std::string>>`.
|
|
@@ -24,6 +24,8 @@ namespace margelo::nitro::nitroinput { class HybridNitroTextViewSpec; }
|
|
|
24
24
|
namespace margelo::nitro::nitroinput { enum class NitroInputAffixAlign; }
|
|
25
25
|
// Forward declaration of `NitroInputAutoCapitalize` to properly resolve imports.
|
|
26
26
|
namespace margelo::nitro::nitroinput { enum class NitroInputAutoCapitalize; }
|
|
27
|
+
// Forward declaration of `NitroInputCharacterMapping` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::nitroinput { struct NitroInputCharacterMapping; }
|
|
27
29
|
// Forward declaration of `NitroInputEasing` to properly resolve imports.
|
|
28
30
|
namespace margelo::nitro::nitroinput { enum class NitroInputEasing; }
|
|
29
31
|
// Forward declaration of `NitroInputEffect` to properly resolve imports.
|
|
@@ -34,6 +36,8 @@ namespace margelo::nitro::nitroinput { enum class NitroInputKeyboardAppearance;
|
|
|
34
36
|
namespace margelo::nitro::nitroinput { enum class NitroInputKeyboardType; }
|
|
35
37
|
// Forward declaration of `NitroInputLabelBehavior` to properly resolve imports.
|
|
36
38
|
namespace margelo::nitro::nitroinput { enum class NitroInputLabelBehavior; }
|
|
39
|
+
// Forward declaration of `NitroInputMaskAffinity` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputMaskAffinity; }
|
|
37
41
|
// Forward declaration of `NitroInputMode` to properly resolve imports.
|
|
38
42
|
namespace margelo::nitro::nitroinput { enum class NitroInputMode; }
|
|
39
43
|
// Forward declaration of `NitroInputNotation` to properly resolve imports.
|
|
@@ -48,6 +52,8 @@ namespace margelo::nitro::nitroinput { enum class NitroInputSubmitBehavior; }
|
|
|
48
52
|
namespace margelo::nitro::nitroinput { enum class NitroInputTextAlignVertical; }
|
|
49
53
|
// Forward declaration of `NitroInputTextAlign` to properly resolve imports.
|
|
50
54
|
namespace margelo::nitro::nitroinput { enum class NitroInputTextAlign; }
|
|
55
|
+
// Forward declaration of `NitroInputTextCase` to properly resolve imports.
|
|
56
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputTextCase; }
|
|
51
57
|
// Forward declaration of `NitroInputVariant` to properly resolve imports.
|
|
52
58
|
namespace margelo::nitro::nitroinput { enum class NitroInputVariant; }
|
|
53
59
|
// Forward declaration of `NitroNumberAffixAlign` to properly resolve imports.
|
|
@@ -96,11 +102,13 @@ namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
|
|
|
96
102
|
#include "HybridNitroTextViewSpec.hpp"
|
|
97
103
|
#include "NitroInputAffixAlign.hpp"
|
|
98
104
|
#include "NitroInputAutoCapitalize.hpp"
|
|
105
|
+
#include "NitroInputCharacterMapping.hpp"
|
|
99
106
|
#include "NitroInputEasing.hpp"
|
|
100
107
|
#include "NitroInputEffect.hpp"
|
|
101
108
|
#include "NitroInputKeyboardAppearance.hpp"
|
|
102
109
|
#include "NitroInputKeyboardType.hpp"
|
|
103
110
|
#include "NitroInputLabelBehavior.hpp"
|
|
111
|
+
#include "NitroInputMaskAffinity.hpp"
|
|
104
112
|
#include "NitroInputMode.hpp"
|
|
105
113
|
#include "NitroInputNotation.hpp"
|
|
106
114
|
#include "NitroInputReturnKeyType.hpp"
|
|
@@ -108,6 +116,7 @@ namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
|
|
|
108
116
|
#include "NitroInputSubmitBehavior.hpp"
|
|
109
117
|
#include "NitroInputTextAlign.hpp"
|
|
110
118
|
#include "NitroInputTextAlignVertical.hpp"
|
|
119
|
+
#include "NitroInputTextCase.hpp"
|
|
111
120
|
#include "NitroInputVariant.hpp"
|
|
112
121
|
#include "NitroNumberAffixAlign.hpp"
|
|
113
122
|
#include "NitroNumberDirection.hpp"
|
|
@@ -16,6 +16,12 @@ namespace NitroInput { class HybridNitroInputViewSpec_cxx; }
|
|
|
16
16
|
namespace margelo::nitro::nitroinput { enum class NitroInputMode; }
|
|
17
17
|
// Forward declaration of `NitroInputNotation` to properly resolve imports.
|
|
18
18
|
namespace margelo::nitro::nitroinput { struct NitroInputNotation; }
|
|
19
|
+
// Forward declaration of `NitroInputMaskAffinity` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputMaskAffinity; }
|
|
21
|
+
// Forward declaration of `NitroInputTextCase` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::nitroinput { enum class NitroInputTextCase; }
|
|
23
|
+
// Forward declaration of `NitroInputCharacterMapping` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitroinput { struct NitroInputCharacterMapping; }
|
|
19
25
|
// Forward declaration of `NitroInputVariant` to properly resolve imports.
|
|
20
26
|
namespace margelo::nitro::nitroinput { enum class NitroInputVariant; }
|
|
21
27
|
// Forward declaration of `NitroInputLabelBehavior` to properly resolve imports.
|
|
@@ -47,6 +53,9 @@ namespace margelo::nitro::nitroinput { enum class NitroInputKeyboardAppearance;
|
|
|
47
53
|
#include "NitroInputMode.hpp"
|
|
48
54
|
#include "NitroInputNotation.hpp"
|
|
49
55
|
#include <vector>
|
|
56
|
+
#include "NitroInputMaskAffinity.hpp"
|
|
57
|
+
#include "NitroInputTextCase.hpp"
|
|
58
|
+
#include "NitroInputCharacterMapping.hpp"
|
|
50
59
|
#include "NitroInputVariant.hpp"
|
|
51
60
|
#include "NitroInputLabelBehavior.hpp"
|
|
52
61
|
#include "NitroInputSignPlacement.hpp"
|
|
@@ -173,6 +182,47 @@ namespace margelo::nitro::nitroinput {
|
|
|
173
182
|
inline void setMaskAutoSkip(bool maskAutoSkip) noexcept override {
|
|
174
183
|
_swiftPart.setMaskAutoSkip(std::forward<decltype(maskAutoSkip)>(maskAutoSkip));
|
|
175
184
|
}
|
|
185
|
+
inline std::vector<std::string> getMaskAffinityFormats() noexcept override {
|
|
186
|
+
auto __result = _swiftPart.getMaskAffinityFormats();
|
|
187
|
+
return __result;
|
|
188
|
+
}
|
|
189
|
+
inline void setMaskAffinityFormats(const std::vector<std::string>& maskAffinityFormats) noexcept override {
|
|
190
|
+
_swiftPart.setMaskAffinityFormats(maskAffinityFormats);
|
|
191
|
+
}
|
|
192
|
+
inline NitroInputMaskAffinity getMaskAffinityStrategy() noexcept override {
|
|
193
|
+
auto __result = _swiftPart.getMaskAffinityStrategy();
|
|
194
|
+
return static_cast<NitroInputMaskAffinity>(__result);
|
|
195
|
+
}
|
|
196
|
+
inline void setMaskAffinityStrategy(NitroInputMaskAffinity maskAffinityStrategy) noexcept override {
|
|
197
|
+
_swiftPart.setMaskAffinityStrategy(static_cast<int>(maskAffinityStrategy));
|
|
198
|
+
}
|
|
199
|
+
inline NitroInputTextCase getMaskTextCase() noexcept override {
|
|
200
|
+
auto __result = _swiftPart.getMaskTextCase();
|
|
201
|
+
return static_cast<NitroInputTextCase>(__result);
|
|
202
|
+
}
|
|
203
|
+
inline void setMaskTextCase(NitroInputTextCase maskTextCase) noexcept override {
|
|
204
|
+
_swiftPart.setMaskTextCase(static_cast<int>(maskTextCase));
|
|
205
|
+
}
|
|
206
|
+
inline std::vector<NitroInputCharacterMapping> getMaskCharacterMap() noexcept override {
|
|
207
|
+
auto __result = _swiftPart.getMaskCharacterMap();
|
|
208
|
+
return __result;
|
|
209
|
+
}
|
|
210
|
+
inline void setMaskCharacterMap(const std::vector<NitroInputCharacterMapping>& maskCharacterMap) noexcept override {
|
|
211
|
+
_swiftPart.setMaskCharacterMap(maskCharacterMap);
|
|
212
|
+
}
|
|
213
|
+
inline std::string getMaskSlotPlaceholder() noexcept override {
|
|
214
|
+
auto __result = _swiftPart.getMaskSlotPlaceholder();
|
|
215
|
+
return __result;
|
|
216
|
+
}
|
|
217
|
+
inline void setMaskSlotPlaceholder(const std::string& maskSlotPlaceholder) noexcept override {
|
|
218
|
+
_swiftPart.setMaskSlotPlaceholder(maskSlotPlaceholder);
|
|
219
|
+
}
|
|
220
|
+
inline bool getKeepPlaceholder() noexcept override {
|
|
221
|
+
return _swiftPart.getKeepPlaceholder();
|
|
222
|
+
}
|
|
223
|
+
inline void setKeepPlaceholder(bool keepPlaceholder) noexcept override {
|
|
224
|
+
_swiftPart.setKeepPlaceholder(std::forward<decltype(keepPlaceholder)>(keepPlaceholder));
|
|
225
|
+
}
|
|
176
226
|
inline std::string getGroupingSeparator() noexcept override {
|
|
177
227
|
auto __result = _swiftPart.getGroupingSeparator();
|
|
178
228
|
return __result;
|
|
@@ -158,6 +158,42 @@ using namespace margelo::nitro::nitroinput::views;
|
|
|
158
158
|
: !newViewProps.maskAutoSkip.hasSameValue(oldViewProps->maskAutoSkip)) {
|
|
159
159
|
swiftPart.setMaskAutoSkip(newViewProps.maskAutoSkip.get());
|
|
160
160
|
}
|
|
161
|
+
// maskAffinityFormats: array
|
|
162
|
+
if (oldViewProps == nullptr
|
|
163
|
+
? newViewProps.maskAffinityFormats.isProvided()
|
|
164
|
+
: !newViewProps.maskAffinityFormats.hasSameValue(oldViewProps->maskAffinityFormats)) {
|
|
165
|
+
swiftPart.setMaskAffinityFormats(newViewProps.maskAffinityFormats.get());
|
|
166
|
+
}
|
|
167
|
+
// maskAffinityStrategy: enum
|
|
168
|
+
if (oldViewProps == nullptr
|
|
169
|
+
? newViewProps.maskAffinityStrategy.isProvided()
|
|
170
|
+
: !newViewProps.maskAffinityStrategy.hasSameValue(oldViewProps->maskAffinityStrategy)) {
|
|
171
|
+
swiftPart.setMaskAffinityStrategy(static_cast<int>(newViewProps.maskAffinityStrategy.get()));
|
|
172
|
+
}
|
|
173
|
+
// maskTextCase: enum
|
|
174
|
+
if (oldViewProps == nullptr
|
|
175
|
+
? newViewProps.maskTextCase.isProvided()
|
|
176
|
+
: !newViewProps.maskTextCase.hasSameValue(oldViewProps->maskTextCase)) {
|
|
177
|
+
swiftPart.setMaskTextCase(static_cast<int>(newViewProps.maskTextCase.get()));
|
|
178
|
+
}
|
|
179
|
+
// maskCharacterMap: array
|
|
180
|
+
if (oldViewProps == nullptr
|
|
181
|
+
? newViewProps.maskCharacterMap.isProvided()
|
|
182
|
+
: !newViewProps.maskCharacterMap.hasSameValue(oldViewProps->maskCharacterMap)) {
|
|
183
|
+
swiftPart.setMaskCharacterMap(newViewProps.maskCharacterMap.get());
|
|
184
|
+
}
|
|
185
|
+
// maskSlotPlaceholder: string
|
|
186
|
+
if (oldViewProps == nullptr
|
|
187
|
+
? newViewProps.maskSlotPlaceholder.isProvided()
|
|
188
|
+
: !newViewProps.maskSlotPlaceholder.hasSameValue(oldViewProps->maskSlotPlaceholder)) {
|
|
189
|
+
swiftPart.setMaskSlotPlaceholder(newViewProps.maskSlotPlaceholder.get());
|
|
190
|
+
}
|
|
191
|
+
// keepPlaceholder: boolean
|
|
192
|
+
if (oldViewProps == nullptr
|
|
193
|
+
? newViewProps.keepPlaceholder.isProvided()
|
|
194
|
+
: !newViewProps.keepPlaceholder.hasSameValue(oldViewProps->keepPlaceholder)) {
|
|
195
|
+
swiftPart.setKeepPlaceholder(newViewProps.keepPlaceholder.get());
|
|
196
|
+
}
|
|
161
197
|
// groupingSeparator: string
|
|
162
198
|
if (oldViewProps == nullptr
|
|
163
199
|
? newViewProps.groupingSeparator.isProvided()
|
|
@@ -20,6 +20,12 @@ public protocol HybridNitroInputViewSpec_protocol: HybridObject, HybridView {
|
|
|
20
20
|
var maskNotations: [NitroInputNotation] { get set }
|
|
21
21
|
var maskAutocomplete: Bool { get set }
|
|
22
22
|
var maskAutoSkip: Bool { get set }
|
|
23
|
+
var maskAffinityFormats: [String] { get set }
|
|
24
|
+
var maskAffinityStrategy: NitroInputMaskAffinity { get set }
|
|
25
|
+
var maskTextCase: NitroInputTextCase { get set }
|
|
26
|
+
var maskCharacterMap: [NitroInputCharacterMapping] { get set }
|
|
27
|
+
var maskSlotPlaceholder: String { get set }
|
|
28
|
+
var keepPlaceholder: Bool { get set }
|
|
23
29
|
var groupingSeparator: String { get set }
|
|
24
30
|
var decimalSeparator: String { get set }
|
|
25
31
|
var variant: NitroInputVariant { get set }
|