react-native-nitro-input 0.3.1 → 0.3.3
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 +114 -0
- package/README.md +75 -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 +49 -4
- package/android/src/main/java/com/margelo/nitro/nitroinput/MaskEngine.kt +16 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +266 -8
- package/android/src/main/java/com/margelo/nitro/nitroinput/UnmountHandoffs.kt +57 -0
- package/cpp/MaskEngine.cpp +294 -33
- package/cpp/MaskEngine.hpp +68 -0
- package/ios/HybridNitroInputView.swift +37 -4
- package/ios/NitroInputCommands.mm +10 -0
- package/ios/NitroInputView.swift +474 -20
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +8 -0
- package/lib/commonjs/src/NitroInput.js +116 -15
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +8 -0
- package/lib/module/src/NitroInput.js +117 -16
- package/lib/typescript/src/NitroInput.d.ts +55 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +65 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +124 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +17 -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 +40 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +52 -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 +68 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +48 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +9 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +111 -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 +17 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +26 -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 +16 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +27 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +8 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +190 -11
- package/src/index.ts +3 -0
- package/src/specs/NitroInput.nitro.ts +68 -0
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;
|
|
@@ -587,6 +637,18 @@ namespace margelo::nitro::nitroinput {
|
|
|
587
637
|
inline void setClearTextOnFocus(bool clearTextOnFocus) noexcept override {
|
|
588
638
|
_swiftPart.setClearTextOnFocus(std::forward<decltype(clearTextOnFocus)>(clearTextOnFocus));
|
|
589
639
|
}
|
|
640
|
+
inline double getKeyboardHandoffMs() noexcept override {
|
|
641
|
+
return _swiftPart.getKeyboardHandoffMs();
|
|
642
|
+
}
|
|
643
|
+
inline void setKeyboardHandoffMs(double keyboardHandoffMs) noexcept override {
|
|
644
|
+
_swiftPart.setKeyboardHandoffMs(std::forward<decltype(keyboardHandoffMs)>(keyboardHandoffMs));
|
|
645
|
+
}
|
|
646
|
+
inline bool getReturnKeyBar() noexcept override {
|
|
647
|
+
return _swiftPart.getReturnKeyBar();
|
|
648
|
+
}
|
|
649
|
+
inline void setReturnKeyBar(bool returnKeyBar) noexcept override {
|
|
650
|
+
_swiftPart.setReturnKeyBar(std::forward<decltype(returnKeyBar)>(returnKeyBar));
|
|
651
|
+
}
|
|
590
652
|
inline bool getContextMenuHidden() noexcept override {
|
|
591
653
|
return _swiftPart.getContextMenuHidden();
|
|
592
654
|
}
|
|
@@ -791,6 +853,12 @@ namespace margelo::nitro::nitroinput {
|
|
|
791
853
|
std::rethrow_exception(__result.error());
|
|
792
854
|
}
|
|
793
855
|
}
|
|
856
|
+
inline void prepareForUnmount() override {
|
|
857
|
+
auto __result = _swiftPart.prepareForUnmount();
|
|
858
|
+
if (__result.hasError()) [[unlikely]] {
|
|
859
|
+
std::rethrow_exception(__result.error());
|
|
860
|
+
}
|
|
861
|
+
}
|
|
794
862
|
|
|
795
863
|
private:
|
|
796
864
|
NitroInput::HybridNitroInputViewSpec_cxx _swiftPart;
|
|
@@ -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()
|
|
@@ -548,6 +584,18 @@ using namespace margelo::nitro::nitroinput::views;
|
|
|
548
584
|
: !newViewProps.clearTextOnFocus.hasSameValue(oldViewProps->clearTextOnFocus)) {
|
|
549
585
|
swiftPart.setClearTextOnFocus(newViewProps.clearTextOnFocus.get());
|
|
550
586
|
}
|
|
587
|
+
// keyboardHandoffMs: number
|
|
588
|
+
if (oldViewProps == nullptr
|
|
589
|
+
? newViewProps.keyboardHandoffMs.isProvided()
|
|
590
|
+
: !newViewProps.keyboardHandoffMs.hasSameValue(oldViewProps->keyboardHandoffMs)) {
|
|
591
|
+
swiftPart.setKeyboardHandoffMs(newViewProps.keyboardHandoffMs.get());
|
|
592
|
+
}
|
|
593
|
+
// returnKeyBar: boolean
|
|
594
|
+
if (oldViewProps == nullptr
|
|
595
|
+
? newViewProps.returnKeyBar.isProvided()
|
|
596
|
+
: !newViewProps.returnKeyBar.hasSameValue(oldViewProps->returnKeyBar)) {
|
|
597
|
+
swiftPart.setReturnKeyBar(newViewProps.returnKeyBar.get());
|
|
598
|
+
}
|
|
551
599
|
// contextMenuHidden: boolean
|
|
552
600
|
if (oldViewProps == nullptr
|
|
553
601
|
? newViewProps.contextMenuHidden.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 }
|
|
@@ -85,6 +91,8 @@ public protocol HybridNitroInputViewSpec_protocol: HybridObject, HybridView {
|
|
|
85
91
|
var showSoftInputOnFocus: Bool { get set }
|
|
86
92
|
var selectTextOnFocus: Bool { get set }
|
|
87
93
|
var clearTextOnFocus: Bool { get set }
|
|
94
|
+
var keyboardHandoffMs: Double { get set }
|
|
95
|
+
var returnKeyBar: Bool { get set }
|
|
88
96
|
var contextMenuHidden: Bool { get set }
|
|
89
97
|
var spellCheck: Bool { get set }
|
|
90
98
|
var selectionStart: Double { get set }
|
|
@@ -118,6 +126,7 @@ public protocol HybridNitroInputViewSpec_protocol: HybridObject, HybridView {
|
|
|
118
126
|
func getValue() throws -> Double
|
|
119
127
|
func isFocused() throws -> Bool
|
|
120
128
|
func setSelection(start: Double, end: Double) throws -> Void
|
|
129
|
+
func prepareForUnmount() throws -> Void
|
|
121
130
|
}
|
|
122
131
|
|
|
123
132
|
public extension HybridNitroInputViewSpec_protocol {
|
|
@@ -237,6 +237,84 @@ open class HybridNitroInputViewSpec_cxx {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
public final var maskAffinityFormats: bridge.std__vector_std__string_ {
|
|
241
|
+
@inline(__always)
|
|
242
|
+
get {
|
|
243
|
+
return { () -> bridge.std__vector_std__string_ in
|
|
244
|
+
var __vector = bridge.create_std__vector_std__string_(self.__implementation.maskAffinityFormats.count)
|
|
245
|
+
for __item in self.__implementation.maskAffinityFormats {
|
|
246
|
+
__vector.push_back(std.string(__item))
|
|
247
|
+
}
|
|
248
|
+
return __vector
|
|
249
|
+
}()
|
|
250
|
+
}
|
|
251
|
+
@inline(__always)
|
|
252
|
+
set {
|
|
253
|
+
self.__implementation.maskAffinityFormats = newValue.map({ __item in String(__item) })
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public final var maskAffinityStrategy: Int32 {
|
|
258
|
+
@inline(__always)
|
|
259
|
+
get {
|
|
260
|
+
return self.__implementation.maskAffinityStrategy.rawValue
|
|
261
|
+
}
|
|
262
|
+
@inline(__always)
|
|
263
|
+
set {
|
|
264
|
+
self.__implementation.maskAffinityStrategy = margelo.nitro.nitroinput.NitroInputMaskAffinity(rawValue: newValue)!
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
public final var maskTextCase: Int32 {
|
|
269
|
+
@inline(__always)
|
|
270
|
+
get {
|
|
271
|
+
return self.__implementation.maskTextCase.rawValue
|
|
272
|
+
}
|
|
273
|
+
@inline(__always)
|
|
274
|
+
set {
|
|
275
|
+
self.__implementation.maskTextCase = margelo.nitro.nitroinput.NitroInputTextCase(rawValue: newValue)!
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
public final var maskCharacterMap: bridge.std__vector_NitroInputCharacterMapping_ {
|
|
280
|
+
@inline(__always)
|
|
281
|
+
get {
|
|
282
|
+
return { () -> bridge.std__vector_NitroInputCharacterMapping_ in
|
|
283
|
+
var __vector = bridge.create_std__vector_NitroInputCharacterMapping_(self.__implementation.maskCharacterMap.count)
|
|
284
|
+
for __item in self.__implementation.maskCharacterMap {
|
|
285
|
+
__vector.push_back(__item)
|
|
286
|
+
}
|
|
287
|
+
return __vector
|
|
288
|
+
}()
|
|
289
|
+
}
|
|
290
|
+
@inline(__always)
|
|
291
|
+
set {
|
|
292
|
+
self.__implementation.maskCharacterMap = newValue.map({ __item in __item })
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
public final var maskSlotPlaceholder: std.string {
|
|
297
|
+
@inline(__always)
|
|
298
|
+
get {
|
|
299
|
+
return std.string(self.__implementation.maskSlotPlaceholder)
|
|
300
|
+
}
|
|
301
|
+
@inline(__always)
|
|
302
|
+
set {
|
|
303
|
+
self.__implementation.maskSlotPlaceholder = String(newValue)
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
public final var keepPlaceholder: Bool {
|
|
308
|
+
@inline(__always)
|
|
309
|
+
get {
|
|
310
|
+
return self.__implementation.keepPlaceholder
|
|
311
|
+
}
|
|
312
|
+
@inline(__always)
|
|
313
|
+
set {
|
|
314
|
+
self.__implementation.keepPlaceholder = newValue
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
240
318
|
public final var groupingSeparator: std.string {
|
|
241
319
|
@inline(__always)
|
|
242
320
|
get {
|
|
@@ -952,6 +1030,28 @@ open class HybridNitroInputViewSpec_cxx {
|
|
|
952
1030
|
}
|
|
953
1031
|
}
|
|
954
1032
|
|
|
1033
|
+
public final var keyboardHandoffMs: Double {
|
|
1034
|
+
@inline(__always)
|
|
1035
|
+
get {
|
|
1036
|
+
return self.__implementation.keyboardHandoffMs
|
|
1037
|
+
}
|
|
1038
|
+
@inline(__always)
|
|
1039
|
+
set {
|
|
1040
|
+
self.__implementation.keyboardHandoffMs = newValue
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
public final var returnKeyBar: Bool {
|
|
1045
|
+
@inline(__always)
|
|
1046
|
+
get {
|
|
1047
|
+
return self.__implementation.returnKeyBar
|
|
1048
|
+
}
|
|
1049
|
+
@inline(__always)
|
|
1050
|
+
set {
|
|
1051
|
+
self.__implementation.returnKeyBar = newValue
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
|
|
955
1055
|
public final var contextMenuHidden: Bool {
|
|
956
1056
|
@inline(__always)
|
|
957
1057
|
get {
|
|
@@ -1486,6 +1586,17 @@ open class HybridNitroInputViewSpec_cxx {
|
|
|
1486
1586
|
}
|
|
1487
1587
|
}
|
|
1488
1588
|
|
|
1589
|
+
@inline(__always)
|
|
1590
|
+
public final func prepareForUnmount() -> bridge.Result_void_ {
|
|
1591
|
+
do {
|
|
1592
|
+
try self.__implementation.prepareForUnmount()
|
|
1593
|
+
return bridge.create_Result_void_()
|
|
1594
|
+
} catch (let __error) {
|
|
1595
|
+
let __exceptionPtr = __error.toCpp()
|
|
1596
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1489
1600
|
public final func getView() -> UnsafeMutableRawPointer {
|
|
1490
1601
|
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
1491
1602
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputCharacterMapping.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `NitroInputCharacterMapping`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroInputCharacterMapping = margelo.nitro.nitroinput.NitroInputCharacterMapping
|
|
14
|
+
|
|
15
|
+
public extension NitroInputCharacterMapping {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitroinput.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroInputCharacterMapping`.
|
|
20
|
+
*/
|
|
21
|
+
init(from: String, to: String) {
|
|
22
|
+
self.init(std.string(from), std.string(to))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@inline(__always)
|
|
26
|
+
var from: String {
|
|
27
|
+
return String(self.__from)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@inline(__always)
|
|
31
|
+
var to: String {
|
|
32
|
+
return String(self.__to)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskAffinity.swift
|
|
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
|
+
/**
|
|
9
|
+
* Represents the JS union `NitroInputMaskAffinity`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias NitroInputMaskAffinity = margelo.nitro.nitroinput.NitroInputMaskAffinity
|
|
12
|
+
|
|
13
|
+
public extension NitroInputMaskAffinity {
|
|
14
|
+
/**
|
|
15
|
+
* Get a NitroInputMaskAffinity for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "wholeString":
|
|
21
|
+
self = .wholestring
|
|
22
|
+
case "prefix":
|
|
23
|
+
self = .prefix
|
|
24
|
+
case "capacity":
|
|
25
|
+
self = .capacity
|
|
26
|
+
case "extractedValueCapacity":
|
|
27
|
+
self = .extractedvaluecapacity
|
|
28
|
+
default:
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the String value this NitroInputMaskAffinity represents.
|
|
35
|
+
*/
|
|
36
|
+
var stringValue: String {
|
|
37
|
+
switch self {
|
|
38
|
+
case .wholestring:
|
|
39
|
+
return "wholeString"
|
|
40
|
+
case .prefix:
|
|
41
|
+
return "prefix"
|
|
42
|
+
case .capacity:
|
|
43
|
+
return "capacity"
|
|
44
|
+
case .extractedvaluecapacity:
|
|
45
|
+
return "extractedValueCapacity"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputTextCase.swift
|
|
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
|
+
/**
|
|
9
|
+
* Represents the JS union `NitroInputTextCase`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias NitroInputTextCase = margelo.nitro.nitroinput.NitroInputTextCase
|
|
12
|
+
|
|
13
|
+
public extension NitroInputTextCase {
|
|
14
|
+
/**
|
|
15
|
+
* Get a NitroInputTextCase for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "none":
|
|
21
|
+
self = .none
|
|
22
|
+
case "upper":
|
|
23
|
+
self = .upper
|
|
24
|
+
case "lower":
|
|
25
|
+
self = .lower
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this NitroInputTextCase represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .none:
|
|
37
|
+
return "none"
|
|
38
|
+
case .upper:
|
|
39
|
+
return "upper"
|
|
40
|
+
case .lower:
|
|
41
|
+
return "lower"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -34,6 +34,18 @@ namespace margelo::nitro::nitroinput {
|
|
|
34
34
|
prototype.registerHybridSetter("maskAutocomplete", &HybridNitroInputViewSpec::setMaskAutocomplete);
|
|
35
35
|
prototype.registerHybridGetter("maskAutoSkip", &HybridNitroInputViewSpec::getMaskAutoSkip);
|
|
36
36
|
prototype.registerHybridSetter("maskAutoSkip", &HybridNitroInputViewSpec::setMaskAutoSkip);
|
|
37
|
+
prototype.registerHybridGetter("maskAffinityFormats", &HybridNitroInputViewSpec::getMaskAffinityFormats);
|
|
38
|
+
prototype.registerHybridSetter("maskAffinityFormats", &HybridNitroInputViewSpec::setMaskAffinityFormats);
|
|
39
|
+
prototype.registerHybridGetter("maskAffinityStrategy", &HybridNitroInputViewSpec::getMaskAffinityStrategy);
|
|
40
|
+
prototype.registerHybridSetter("maskAffinityStrategy", &HybridNitroInputViewSpec::setMaskAffinityStrategy);
|
|
41
|
+
prototype.registerHybridGetter("maskTextCase", &HybridNitroInputViewSpec::getMaskTextCase);
|
|
42
|
+
prototype.registerHybridSetter("maskTextCase", &HybridNitroInputViewSpec::setMaskTextCase);
|
|
43
|
+
prototype.registerHybridGetter("maskCharacterMap", &HybridNitroInputViewSpec::getMaskCharacterMap);
|
|
44
|
+
prototype.registerHybridSetter("maskCharacterMap", &HybridNitroInputViewSpec::setMaskCharacterMap);
|
|
45
|
+
prototype.registerHybridGetter("maskSlotPlaceholder", &HybridNitroInputViewSpec::getMaskSlotPlaceholder);
|
|
46
|
+
prototype.registerHybridSetter("maskSlotPlaceholder", &HybridNitroInputViewSpec::setMaskSlotPlaceholder);
|
|
47
|
+
prototype.registerHybridGetter("keepPlaceholder", &HybridNitroInputViewSpec::getKeepPlaceholder);
|
|
48
|
+
prototype.registerHybridSetter("keepPlaceholder", &HybridNitroInputViewSpec::setKeepPlaceholder);
|
|
37
49
|
prototype.registerHybridGetter("groupingSeparator", &HybridNitroInputViewSpec::getGroupingSeparator);
|
|
38
50
|
prototype.registerHybridSetter("groupingSeparator", &HybridNitroInputViewSpec::setGroupingSeparator);
|
|
39
51
|
prototype.registerHybridGetter("decimalSeparator", &HybridNitroInputViewSpec::getDecimalSeparator);
|
|
@@ -164,6 +176,10 @@ namespace margelo::nitro::nitroinput {
|
|
|
164
176
|
prototype.registerHybridSetter("selectTextOnFocus", &HybridNitroInputViewSpec::setSelectTextOnFocus);
|
|
165
177
|
prototype.registerHybridGetter("clearTextOnFocus", &HybridNitroInputViewSpec::getClearTextOnFocus);
|
|
166
178
|
prototype.registerHybridSetter("clearTextOnFocus", &HybridNitroInputViewSpec::setClearTextOnFocus);
|
|
179
|
+
prototype.registerHybridGetter("keyboardHandoffMs", &HybridNitroInputViewSpec::getKeyboardHandoffMs);
|
|
180
|
+
prototype.registerHybridSetter("keyboardHandoffMs", &HybridNitroInputViewSpec::setKeyboardHandoffMs);
|
|
181
|
+
prototype.registerHybridGetter("returnKeyBar", &HybridNitroInputViewSpec::getReturnKeyBar);
|
|
182
|
+
prototype.registerHybridSetter("returnKeyBar", &HybridNitroInputViewSpec::setReturnKeyBar);
|
|
167
183
|
prototype.registerHybridGetter("contextMenuHidden", &HybridNitroInputViewSpec::getContextMenuHidden);
|
|
168
184
|
prototype.registerHybridSetter("contextMenuHidden", &HybridNitroInputViewSpec::setContextMenuHidden);
|
|
169
185
|
prototype.registerHybridGetter("spellCheck", &HybridNitroInputViewSpec::getSpellCheck);
|
|
@@ -217,6 +233,7 @@ namespace margelo::nitro::nitroinput {
|
|
|
217
233
|
prototype.registerHybridMethod("getValue", &HybridNitroInputViewSpec::getValue);
|
|
218
234
|
prototype.registerHybridMethod("isFocused", &HybridNitroInputViewSpec::isFocused);
|
|
219
235
|
prototype.registerHybridMethod("setSelection", &HybridNitroInputViewSpec::setSelection);
|
|
236
|
+
prototype.registerHybridMethod("prepareForUnmount", &HybridNitroInputViewSpec::prepareForUnmount);
|
|
220
237
|
});
|
|
221
238
|
}
|
|
222
239
|
|