react-native-nitro-input 0.3.7 → 0.4.0

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.
Files changed (129) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/README.md +9 -4
  3. package/android/CMakeLists.txt +1 -0
  4. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputMeasure.kt +52 -0
  5. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +74 -80
  6. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +18 -18
  7. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +14 -14
  8. package/android/src/main/java/com/margelo/nitro/nitroinput/InputFonts.kt +199 -0
  9. package/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt +398 -0
  10. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +112 -333
  11. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +178 -30
  12. package/cpp/RollingEngine.cpp +68 -5
  13. package/cpp/RollingEngine.hpp +13 -0
  14. package/cpp/numberformat/FormatFigure.cpp +134 -0
  15. package/cpp/numberformat/FormatFigure.hpp +65 -0
  16. package/cpp/numberformat/HybridNitroNumberFormat.cpp +32 -10
  17. package/cpp/numberformat/HybridNitroNumberFormat.hpp +9 -1
  18. package/ios/HybridNitroInputView.swift +69 -75
  19. package/ios/HybridNitroNumberView.swift +18 -18
  20. package/ios/HybridNitroTextView.swift +14 -14
  21. package/ios/InputSizing.swift +534 -0
  22. package/ios/NitroInputView.swift +102 -198
  23. package/ios/NitroNumberView.swift +98 -23
  24. package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +12 -8
  25. package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -6
  26. package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +6 -6
  27. package/lib/commonjs/src/NitroInput.js +164 -23
  28. package/lib/commonjs/src/NitroNumber.js +19 -11
  29. package/lib/commonjs/src/NitroText.js +6 -6
  30. package/lib/commonjs/src/NumberFormat.js +20 -0
  31. package/lib/commonjs/src/formatProps.js +57 -81
  32. package/lib/commonjs/src/specs/NitroInputMeasure.nitro.js +2 -0
  33. package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +12 -8
  34. package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -6
  35. package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +6 -6
  36. package/lib/module/src/NitroInput.js +165 -24
  37. package/lib/module/src/NitroNumber.js +20 -12
  38. package/lib/module/src/NitroText.js +6 -6
  39. package/lib/module/src/NumberFormat.js +18 -0
  40. package/lib/module/src/formatProps.js +54 -81
  41. package/lib/module/src/specs/NitroInputMeasure.nitro.js +1 -0
  42. package/lib/typescript/src/NitroInput.d.ts +9 -16
  43. package/lib/typescript/src/NitroNumber.d.ts +25 -7
  44. package/lib/typescript/src/NumberFormat.d.ts +15 -1
  45. package/lib/typescript/src/formatProps.d.ts +23 -18
  46. package/lib/typescript/src/specs/NitroInput.nitro.d.ts +17 -8
  47. package/lib/typescript/src/specs/NitroInputMeasure.nitro.d.ts +67 -0
  48. package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +6 -6
  49. package/lib/typescript/src/specs/NitroText.nitro.d.ts +6 -6
  50. package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +33 -0
  51. package/nitro.json +10 -0
  52. package/nitrogen/generated/android/NitroInput+autolinking.cmake +2 -0
  53. package/nitrogen/generated/android/NitroInputOnLoad.cpp +16 -0
  54. package/nitrogen/generated/android/c++/JHybridNitroInputMeasureSpec.cpp +93 -0
  55. package/nitrogen/generated/android/c++/JHybridNitroInputMeasureSpec.hpp +63 -0
  56. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +76 -40
  57. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +24 -16
  58. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +30 -30
  59. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +12 -12
  60. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +30 -30
  61. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +12 -12
  62. package/nitrogen/generated/android/c++/JNitroInputSize.hpp +61 -0
  63. package/nitrogen/generated/android/c++/JNitroInputSizing.hpp +284 -0
  64. package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +44 -24
  65. package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +18 -18
  66. package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +18 -18
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputMeasureSpec.kt +56 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +32 -8
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +6 -6
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +6 -6
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSize.kt +56 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt +246 -0
  73. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +17 -0
  74. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +29 -0
  75. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +11 -0
  76. package/nitrogen/generated/ios/NitroInputAutolinking.mm +8 -0
  77. package/nitrogen/generated/ios/NitroInputAutolinking.swift +12 -0
  78. package/nitrogen/generated/ios/c++/HybridNitroInputMeasureSpecSwift.cpp +11 -0
  79. package/nitrogen/generated/ios/c++/HybridNitroInputMeasureSpecSwift.hpp +112 -0
  80. package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +56 -32
  81. package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +24 -24
  82. package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +24 -24
  83. package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +56 -32
  84. package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +24 -24
  85. package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +24 -24
  86. package/nitrogen/generated/ios/swift/HybridNitroInputMeasureSpec.swift +55 -0
  87. package/nitrogen/generated/ios/swift/HybridNitroInputMeasureSpec_cxx.swift +138 -0
  88. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +12 -8
  89. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +68 -24
  90. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +6 -6
  91. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +18 -18
  92. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +6 -6
  93. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +18 -18
  94. package/nitrogen/generated/ios/swift/NitroInputSize.swift +34 -0
  95. package/nitrogen/generated/ios/swift/NitroInputSizing.swift +242 -0
  96. package/nitrogen/generated/shared/c++/HybridNitroInputMeasureSpec.cpp +21 -0
  97. package/nitrogen/generated/shared/c++/HybridNitroInputMeasureSpec.hpp +66 -0
  98. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +24 -16
  99. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +24 -16
  100. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.cpp +2 -0
  101. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.hpp +8 -0
  102. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +12 -12
  103. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +12 -12
  104. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +12 -12
  105. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +12 -12
  106. package/nitrogen/generated/shared/c++/NitroInputSize.hpp +87 -0
  107. package/nitrogen/generated/shared/c++/NitroInputSizing.hpp +263 -0
  108. package/nitrogen/generated/shared/c++/NumberFigure.hpp +95 -0
  109. package/nitrogen/generated/shared/c++/NumberFormatLayout.hpp +112 -0
  110. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +24 -16
  111. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +36 -24
  112. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +12 -12
  113. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +18 -18
  114. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +12 -12
  115. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +18 -18
  116. package/nitrogen/generated/shared/json/NitroInputViewConfig.json +12 -8
  117. package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -6
  118. package/nitrogen/generated/shared/json/NitroTextViewConfig.json +6 -6
  119. package/package.json +5 -3
  120. package/src/NitroInput.tsx +201 -64
  121. package/src/NitroNumber.tsx +54 -25
  122. package/src/NitroText.tsx +6 -6
  123. package/src/NumberFormat.ts +22 -0
  124. package/src/formatProps.ts +59 -99
  125. package/src/specs/NitroInput.nitro.ts +17 -8
  126. package/src/specs/NitroInputMeasure.nitro.ts +76 -0
  127. package/src/specs/NitroNumber.nitro.ts +6 -6
  128. package/src/specs/NitroText.nitro.ts +6 -6
  129. package/src/specs/NumberFormat.nitro.ts +35 -0
@@ -80,8 +80,8 @@ namespace margelo::nitro::nitroinput {
80
80
  prototype.registerHybridSetter("shimmerDirection", &HybridNitroNumberViewSpec::setShimmerDirection);
81
81
  prototype.registerHybridGetter("shimmerDelay", &HybridNitroNumberViewSpec::getShimmerDelay);
82
82
  prototype.registerHybridSetter("shimmerDelay", &HybridNitroNumberViewSpec::setShimmerDelay);
83
- prototype.registerHybridGetter("fontSize", &HybridNitroNumberViewSpec::getFontSize);
84
- prototype.registerHybridSetter("fontSize", &HybridNitroNumberViewSpec::setFontSize);
83
+ prototype.registerHybridGetter("textSize", &HybridNitroNumberViewSpec::getTextSize);
84
+ prototype.registerHybridSetter("textSize", &HybridNitroNumberViewSpec::setTextSize);
85
85
  prototype.registerHybridGetter("prefixFontSize", &HybridNitroNumberViewSpec::getPrefixFontSize);
86
86
  prototype.registerHybridSetter("prefixFontSize", &HybridNitroNumberViewSpec::setPrefixFontSize);
87
87
  prototype.registerHybridGetter("suffixFontSize", &HybridNitroNumberViewSpec::getSuffixFontSize);
@@ -92,8 +92,8 @@ namespace margelo::nitro::nitroinput {
92
92
  prototype.registerHybridSetter("prefixAlign", &HybridNitroNumberViewSpec::setPrefixAlign);
93
93
  prototype.registerHybridGetter("suffixAlign", &HybridNitroNumberViewSpec::getSuffixAlign);
94
94
  prototype.registerHybridSetter("suffixAlign", &HybridNitroNumberViewSpec::setSuffixAlign);
95
- prototype.registerHybridGetter("letterSpacing", &HybridNitroNumberViewSpec::getLetterSpacing);
96
- prototype.registerHybridSetter("letterSpacing", &HybridNitroNumberViewSpec::setLetterSpacing);
95
+ prototype.registerHybridGetter("textLetterSpacing", &HybridNitroNumberViewSpec::getTextLetterSpacing);
96
+ prototype.registerHybridSetter("textLetterSpacing", &HybridNitroNumberViewSpec::setTextLetterSpacing);
97
97
  prototype.registerHybridGetter("prefixSpacing", &HybridNitroNumberViewSpec::getPrefixSpacing);
98
98
  prototype.registerHybridSetter("prefixSpacing", &HybridNitroNumberViewSpec::setPrefixSpacing);
99
99
  prototype.registerHybridGetter("suffixSpacing", &HybridNitroNumberViewSpec::getSuffixSpacing);
@@ -138,14 +138,14 @@ namespace margelo::nitro::nitroinput {
138
138
  prototype.registerHybridSetter("allowFontScaling", &HybridNitroNumberViewSpec::setAllowFontScaling);
139
139
  prototype.registerHybridGetter("maxFontSizeMultiplier", &HybridNitroNumberViewSpec::getMaxFontSizeMultiplier);
140
140
  prototype.registerHybridSetter("maxFontSizeMultiplier", &HybridNitroNumberViewSpec::setMaxFontSizeMultiplier);
141
- prototype.registerHybridGetter("fontWeight", &HybridNitroNumberViewSpec::getFontWeight);
142
- prototype.registerHybridSetter("fontWeight", &HybridNitroNumberViewSpec::setFontWeight);
143
- prototype.registerHybridGetter("fontFamily", &HybridNitroNumberViewSpec::getFontFamily);
144
- prototype.registerHybridSetter("fontFamily", &HybridNitroNumberViewSpec::setFontFamily);
145
- prototype.registerHybridGetter("color", &HybridNitroNumberViewSpec::getColor);
146
- prototype.registerHybridSetter("color", &HybridNitroNumberViewSpec::setColor);
147
- prototype.registerHybridGetter("textAlign", &HybridNitroNumberViewSpec::getTextAlign);
148
- prototype.registerHybridSetter("textAlign", &HybridNitroNumberViewSpec::setTextAlign);
141
+ prototype.registerHybridGetter("textWeight", &HybridNitroNumberViewSpec::getTextWeight);
142
+ prototype.registerHybridSetter("textWeight", &HybridNitroNumberViewSpec::setTextWeight);
143
+ prototype.registerHybridGetter("textFamily", &HybridNitroNumberViewSpec::getTextFamily);
144
+ prototype.registerHybridSetter("textFamily", &HybridNitroNumberViewSpec::setTextFamily);
145
+ prototype.registerHybridGetter("textColor", &HybridNitroNumberViewSpec::getTextColor);
146
+ prototype.registerHybridSetter("textColor", &HybridNitroNumberViewSpec::setTextColor);
147
+ prototype.registerHybridGetter("textAlignment", &HybridNitroNumberViewSpec::getTextAlignment);
148
+ prototype.registerHybridSetter("textAlignment", &HybridNitroNumberViewSpec::setTextAlignment);
149
149
  prototype.registerHybridGetter("rightToLeft", &HybridNitroNumberViewSpec::getRightToLeft);
150
150
  prototype.registerHybridSetter("rightToLeft", &HybridNitroNumberViewSpec::setRightToLeft);
151
151
  prototype.registerHybridGetter("onSizeChange", &HybridNitroNumberViewSpec::getOnSizeChange);
@@ -136,8 +136,8 @@ namespace margelo::nitro::nitroinput {
136
136
  virtual void setShimmerDirection(std::optional<NitroNumberShimmerDirection> shimmerDirection) = 0;
137
137
  virtual std::optional<double> getShimmerDelay() = 0;
138
138
  virtual void setShimmerDelay(std::optional<double> shimmerDelay) = 0;
139
- virtual std::optional<double> getFontSize() = 0;
140
- virtual void setFontSize(std::optional<double> fontSize) = 0;
139
+ virtual std::optional<double> getTextSize() = 0;
140
+ virtual void setTextSize(std::optional<double> textSize) = 0;
141
141
  virtual std::optional<double> getPrefixFontSize() = 0;
142
142
  virtual void setPrefixFontSize(std::optional<double> prefixFontSize) = 0;
143
143
  virtual std::optional<double> getSuffixFontSize() = 0;
@@ -148,8 +148,8 @@ namespace margelo::nitro::nitroinput {
148
148
  virtual void setPrefixAlign(std::optional<NitroNumberAffixAlign> prefixAlign) = 0;
149
149
  virtual std::optional<NitroNumberAffixAlign> getSuffixAlign() = 0;
150
150
  virtual void setSuffixAlign(std::optional<NitroNumberAffixAlign> suffixAlign) = 0;
151
- virtual std::optional<double> getLetterSpacing() = 0;
152
- virtual void setLetterSpacing(std::optional<double> letterSpacing) = 0;
151
+ virtual std::optional<double> getTextLetterSpacing() = 0;
152
+ virtual void setTextLetterSpacing(std::optional<double> textLetterSpacing) = 0;
153
153
  virtual std::optional<double> getPrefixSpacing() = 0;
154
154
  virtual void setPrefixSpacing(std::optional<double> prefixSpacing) = 0;
155
155
  virtual std::optional<double> getSuffixSpacing() = 0;
@@ -194,14 +194,14 @@ namespace margelo::nitro::nitroinput {
194
194
  virtual void setAllowFontScaling(std::optional<bool> allowFontScaling) = 0;
195
195
  virtual std::optional<double> getMaxFontSizeMultiplier() = 0;
196
196
  virtual void setMaxFontSizeMultiplier(std::optional<double> maxFontSizeMultiplier) = 0;
197
- virtual std::optional<double> getFontWeight() = 0;
198
- virtual void setFontWeight(std::optional<double> fontWeight) = 0;
199
- virtual std::optional<std::string> getFontFamily() = 0;
200
- virtual void setFontFamily(const std::optional<std::string>& fontFamily) = 0;
201
- virtual std::optional<double> getColor() = 0;
202
- virtual void setColor(std::optional<double> color) = 0;
203
- virtual std::optional<NitroNumberTextAlign> getTextAlign() = 0;
204
- virtual void setTextAlign(std::optional<NitroNumberTextAlign> textAlign) = 0;
197
+ virtual std::optional<double> getTextWeight() = 0;
198
+ virtual void setTextWeight(std::optional<double> textWeight) = 0;
199
+ virtual std::optional<std::string> getTextFamily() = 0;
200
+ virtual void setTextFamily(const std::optional<std::string>& textFamily) = 0;
201
+ virtual std::optional<double> getTextColor() = 0;
202
+ virtual void setTextColor(std::optional<double> textColor) = 0;
203
+ virtual std::optional<NitroNumberTextAlign> getTextAlignment() = 0;
204
+ virtual void setTextAlignment(std::optional<NitroNumberTextAlign> textAlignment) = 0;
205
205
  virtual std::optional<bool> getRightToLeft() = 0;
206
206
  virtual void setRightToLeft(std::optional<bool> rightToLeft) = 0;
207
207
  virtual std::optional<std::function<void(double /* width */, double /* height */)>> getOnSizeChange() = 0;
@@ -16,18 +16,18 @@ namespace margelo::nitro::nitroinput {
16
16
  registerHybrids(this, [](Prototype& prototype) {
17
17
  prototype.registerHybridGetter("text", &HybridNitroTextViewSpec::getText);
18
18
  prototype.registerHybridSetter("text", &HybridNitroTextViewSpec::setText);
19
- prototype.registerHybridGetter("fontSize", &HybridNitroTextViewSpec::getFontSize);
20
- prototype.registerHybridSetter("fontSize", &HybridNitroTextViewSpec::setFontSize);
21
- prototype.registerHybridGetter("fontWeight", &HybridNitroTextViewSpec::getFontWeight);
22
- prototype.registerHybridSetter("fontWeight", &HybridNitroTextViewSpec::setFontWeight);
23
- prototype.registerHybridGetter("fontFamily", &HybridNitroTextViewSpec::getFontFamily);
24
- prototype.registerHybridSetter("fontFamily", &HybridNitroTextViewSpec::setFontFamily);
25
- prototype.registerHybridGetter("color", &HybridNitroTextViewSpec::getColor);
26
- prototype.registerHybridSetter("color", &HybridNitroTextViewSpec::setColor);
27
- prototype.registerHybridGetter("letterSpacing", &HybridNitroTextViewSpec::getLetterSpacing);
28
- prototype.registerHybridSetter("letterSpacing", &HybridNitroTextViewSpec::setLetterSpacing);
29
- prototype.registerHybridGetter("textAlign", &HybridNitroTextViewSpec::getTextAlign);
30
- prototype.registerHybridSetter("textAlign", &HybridNitroTextViewSpec::setTextAlign);
19
+ prototype.registerHybridGetter("textSize", &HybridNitroTextViewSpec::getTextSize);
20
+ prototype.registerHybridSetter("textSize", &HybridNitroTextViewSpec::setTextSize);
21
+ prototype.registerHybridGetter("textWeight", &HybridNitroTextViewSpec::getTextWeight);
22
+ prototype.registerHybridSetter("textWeight", &HybridNitroTextViewSpec::setTextWeight);
23
+ prototype.registerHybridGetter("textFamily", &HybridNitroTextViewSpec::getTextFamily);
24
+ prototype.registerHybridSetter("textFamily", &HybridNitroTextViewSpec::setTextFamily);
25
+ prototype.registerHybridGetter("textColor", &HybridNitroTextViewSpec::getTextColor);
26
+ prototype.registerHybridSetter("textColor", &HybridNitroTextViewSpec::setTextColor);
27
+ prototype.registerHybridGetter("textLetterSpacing", &HybridNitroTextViewSpec::getTextLetterSpacing);
28
+ prototype.registerHybridSetter("textLetterSpacing", &HybridNitroTextViewSpec::setTextLetterSpacing);
29
+ prototype.registerHybridGetter("textAlignment", &HybridNitroTextViewSpec::getTextAlignment);
30
+ prototype.registerHybridSetter("textAlignment", &HybridNitroTextViewSpec::setTextAlignment);
31
31
  prototype.registerHybridGetter("rightToLeft", &HybridNitroTextViewSpec::getRightToLeft);
32
32
  prototype.registerHybridSetter("rightToLeft", &HybridNitroTextViewSpec::setRightToLeft);
33
33
  prototype.registerHybridGetter("duration", &HybridNitroTextViewSpec::getDuration);
@@ -58,18 +58,18 @@ namespace margelo::nitro::nitroinput {
58
58
  // Properties
59
59
  virtual std::string getText() = 0;
60
60
  virtual void setText(const std::string& text) = 0;
61
- virtual std::optional<double> getFontSize() = 0;
62
- virtual void setFontSize(std::optional<double> fontSize) = 0;
63
- virtual std::optional<double> getFontWeight() = 0;
64
- virtual void setFontWeight(std::optional<double> fontWeight) = 0;
65
- virtual std::optional<std::string> getFontFamily() = 0;
66
- virtual void setFontFamily(const std::optional<std::string>& fontFamily) = 0;
67
- virtual std::optional<double> getColor() = 0;
68
- virtual void setColor(std::optional<double> color) = 0;
69
- virtual std::optional<double> getLetterSpacing() = 0;
70
- virtual void setLetterSpacing(std::optional<double> letterSpacing) = 0;
71
- virtual std::optional<NitroNumberTextAlign> getTextAlign() = 0;
72
- virtual void setTextAlign(std::optional<NitroNumberTextAlign> textAlign) = 0;
61
+ virtual std::optional<double> getTextSize() = 0;
62
+ virtual void setTextSize(std::optional<double> textSize) = 0;
63
+ virtual std::optional<double> getTextWeight() = 0;
64
+ virtual void setTextWeight(std::optional<double> textWeight) = 0;
65
+ virtual std::optional<std::string> getTextFamily() = 0;
66
+ virtual void setTextFamily(const std::optional<std::string>& textFamily) = 0;
67
+ virtual std::optional<double> getTextColor() = 0;
68
+ virtual void setTextColor(std::optional<double> textColor) = 0;
69
+ virtual std::optional<double> getTextLetterSpacing() = 0;
70
+ virtual void setTextLetterSpacing(std::optional<double> textLetterSpacing) = 0;
71
+ virtual std::optional<NitroNumberTextAlign> getTextAlignment() = 0;
72
+ virtual void setTextAlignment(std::optional<NitroNumberTextAlign> textAlignment) = 0;
73
73
  virtual std::optional<bool> getRightToLeft() = 0;
74
74
  virtual void setRightToLeft(std::optional<bool> rightToLeft) = 0;
75
75
  virtual std::optional<double> getDuration() = 0;
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// NitroInputSize.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+
34
+
35
+ namespace margelo::nitro::nitroinput {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (NitroInputSize).
39
+ */
40
+ struct NitroInputSize final {
41
+ public:
42
+ double width SWIFT_PRIVATE;
43
+ double height SWIFT_PRIVATE;
44
+
45
+ public:
46
+ NitroInputSize() = default;
47
+ explicit NitroInputSize(double width, double height): width(width), height(height) {}
48
+
49
+ public:
50
+ friend bool operator==(const NitroInputSize& lhs, const NitroInputSize& rhs) = default;
51
+ };
52
+
53
+ } // namespace margelo::nitro::nitroinput
54
+
55
+ namespace margelo::nitro {
56
+
57
+ // C++ NitroInputSize <> JS NitroInputSize (object)
58
+ template <>
59
+ struct JSIConverter<margelo::nitro::nitroinput::NitroInputSize> final {
60
+ static inline margelo::nitro::nitroinput::NitroInputSize fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
61
+ jsi::Object obj = arg.asObject(runtime);
62
+ return margelo::nitro::nitroinput::NitroInputSize(
63
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width"))),
64
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height")))
65
+ );
66
+ }
67
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroinput::NitroInputSize& arg) {
68
+ jsi::Object obj(runtime);
69
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "width"), JSIConverter<double>::toJSI(runtime, arg.width));
70
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "height"), JSIConverter<double>::toJSI(runtime, arg.height));
71
+ return obj;
72
+ }
73
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
74
+ if (!value.isObject()) {
75
+ return false;
76
+ }
77
+ jsi::Object obj = value.getObject(runtime);
78
+ if (!nitro::isPlainObject(runtime, obj)) {
79
+ return false;
80
+ }
81
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width")))) return false;
82
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height")))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,263 @@
1
+ ///
2
+ /// NitroInputSizing.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `NitroInputMode` to properly resolve imports.
32
+ namespace margelo::nitro::nitroinput { enum class NitroInputMode; }
33
+ // Forward declaration of `NitroInputSignPlacement` to properly resolve imports.
34
+ namespace margelo::nitro::nitroinput { enum class NitroInputSignPlacement; }
35
+ // Forward declaration of `NitroInputNotation` to properly resolve imports.
36
+ namespace margelo::nitro::nitroinput { struct NitroInputNotation; }
37
+ // Forward declaration of `NitroInputMaskAffinity` to properly resolve imports.
38
+ namespace margelo::nitro::nitroinput { enum class NitroInputMaskAffinity; }
39
+ // Forward declaration of `NitroInputTextCase` to properly resolve imports.
40
+ namespace margelo::nitro::nitroinput { enum class NitroInputTextCase; }
41
+ // Forward declaration of `NitroInputCharacterMapping` to properly resolve imports.
42
+ namespace margelo::nitro::nitroinput { struct NitroInputCharacterMapping; }
43
+ // Forward declaration of `NitroInputVariant` to properly resolve imports.
44
+ namespace margelo::nitro::nitroinput { enum class NitroInputVariant; }
45
+ // Forward declaration of `NitroInputLabelBehavior` to properly resolve imports.
46
+ namespace margelo::nitro::nitroinput { enum class NitroInputLabelBehavior; }
47
+
48
+ #include <string>
49
+ #include "NitroInputMode.hpp"
50
+ #include "NitroInputSignPlacement.hpp"
51
+ #include "NitroInputNotation.hpp"
52
+ #include <vector>
53
+ #include "NitroInputMaskAffinity.hpp"
54
+ #include "NitroInputTextCase.hpp"
55
+ #include "NitroInputCharacterMapping.hpp"
56
+ #include "NitroInputVariant.hpp"
57
+ #include "NitroInputLabelBehavior.hpp"
58
+
59
+ namespace margelo::nitro::nitroinput {
60
+
61
+ /**
62
+ * A struct which can be represented as a JavaScript object (NitroInputSizing).
63
+ */
64
+ struct NitroInputSizing final {
65
+ public:
66
+ std::string text SWIFT_PRIVATE;
67
+ NitroInputMode mode SWIFT_PRIVATE;
68
+ bool plain SWIFT_PRIVATE;
69
+ bool multiline SWIFT_PRIVATE;
70
+ bool secureTextEntry SWIFT_PRIVATE;
71
+ double maxLength SWIFT_PRIVATE;
72
+ double fractionDigits SWIFT_PRIVATE;
73
+ double maxIntegerDigits SWIFT_PRIVATE;
74
+ std::string groupingSeparator SWIFT_PRIVATE;
75
+ std::string decimalSeparator SWIFT_PRIVATE;
76
+ std::string prefix SWIFT_PRIVATE;
77
+ std::string suffix SWIFT_PRIVATE;
78
+ NitroInputSignPlacement signPlacement SWIFT_PRIVATE;
79
+ std::string placeholder SWIFT_PRIVATE;
80
+ std::string mask SWIFT_PRIVATE;
81
+ std::vector<NitroInputNotation> maskNotations SWIFT_PRIVATE;
82
+ bool maskAutocomplete SWIFT_PRIVATE;
83
+ bool maskAutoSkip SWIFT_PRIVATE;
84
+ std::vector<std::string> maskAffinityFormats SWIFT_PRIVATE;
85
+ NitroInputMaskAffinity maskAffinityStrategy SWIFT_PRIVATE;
86
+ NitroInputTextCase maskTextCase SWIFT_PRIVATE;
87
+ std::vector<NitroInputCharacterMapping> maskCharacterMap SWIFT_PRIVATE;
88
+ std::string maskSlotPlaceholder SWIFT_PRIVATE;
89
+ bool keepPlaceholder SWIFT_PRIVATE;
90
+ double textSize SWIFT_PRIVATE;
91
+ double textLineHeight SWIFT_PRIVATE;
92
+ double prefixFontSize SWIFT_PRIVATE;
93
+ double suffixFontSize SWIFT_PRIVATE;
94
+ double textWeight SWIFT_PRIVATE;
95
+ std::string textFamily SWIFT_PRIVATE;
96
+ double textLetterSpacing SWIFT_PRIVATE;
97
+ double prefixSpacing SWIFT_PRIVATE;
98
+ double suffixSpacing SWIFT_PRIVATE;
99
+ bool allowFontScaling SWIFT_PRIVATE;
100
+ double maxFontSizeMultiplier SWIFT_PRIVATE;
101
+ NitroInputVariant variant SWIFT_PRIVATE;
102
+ std::string label SWIFT_PRIVATE;
103
+ NitroInputLabelBehavior labelBehavior SWIFT_PRIVATE;
104
+ double labelFontSize SWIFT_PRIVATE;
105
+ double cornerRadius SWIFT_PRIVATE;
106
+
107
+ public:
108
+ NitroInputSizing() = default;
109
+ explicit NitroInputSizing(std::string text, NitroInputMode mode, bool plain, bool multiline, bool secureTextEntry, double maxLength, double fractionDigits, double maxIntegerDigits, std::string groupingSeparator, std::string decimalSeparator, std::string prefix, std::string suffix, NitroInputSignPlacement signPlacement, std::string placeholder, std::string mask, std::vector<NitroInputNotation> maskNotations, bool maskAutocomplete, bool maskAutoSkip, std::vector<std::string> maskAffinityFormats, NitroInputMaskAffinity maskAffinityStrategy, NitroInputTextCase maskTextCase, std::vector<NitroInputCharacterMapping> maskCharacterMap, std::string maskSlotPlaceholder, bool keepPlaceholder, double textSize, double textLineHeight, double prefixFontSize, double suffixFontSize, double textWeight, std::string textFamily, double textLetterSpacing, double prefixSpacing, double suffixSpacing, bool allowFontScaling, double maxFontSizeMultiplier, NitroInputVariant variant, std::string label, NitroInputLabelBehavior labelBehavior, double labelFontSize, double cornerRadius): text(text), mode(mode), plain(plain), multiline(multiline), secureTextEntry(secureTextEntry), maxLength(maxLength), fractionDigits(fractionDigits), maxIntegerDigits(maxIntegerDigits), groupingSeparator(groupingSeparator), decimalSeparator(decimalSeparator), prefix(prefix), suffix(suffix), signPlacement(signPlacement), placeholder(placeholder), mask(mask), maskNotations(maskNotations), maskAutocomplete(maskAutocomplete), maskAutoSkip(maskAutoSkip), maskAffinityFormats(maskAffinityFormats), maskAffinityStrategy(maskAffinityStrategy), maskTextCase(maskTextCase), maskCharacterMap(maskCharacterMap), maskSlotPlaceholder(maskSlotPlaceholder), keepPlaceholder(keepPlaceholder), textSize(textSize), textLineHeight(textLineHeight), prefixFontSize(prefixFontSize), suffixFontSize(suffixFontSize), textWeight(textWeight), textFamily(textFamily), textLetterSpacing(textLetterSpacing), prefixSpacing(prefixSpacing), suffixSpacing(suffixSpacing), allowFontScaling(allowFontScaling), maxFontSizeMultiplier(maxFontSizeMultiplier), variant(variant), label(label), labelBehavior(labelBehavior), labelFontSize(labelFontSize), cornerRadius(cornerRadius) {}
110
+
111
+ public:
112
+ friend bool operator==(const NitroInputSizing& lhs, const NitroInputSizing& rhs) = default;
113
+ };
114
+
115
+ } // namespace margelo::nitro::nitroinput
116
+
117
+ namespace margelo::nitro {
118
+
119
+ // C++ NitroInputSizing <> JS NitroInputSizing (object)
120
+ template <>
121
+ struct JSIConverter<margelo::nitro::nitroinput::NitroInputSizing> final {
122
+ static inline margelo::nitro::nitroinput::NitroInputSizing fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
123
+ jsi::Object obj = arg.asObject(runtime);
124
+ return margelo::nitro::nitroinput::NitroInputSizing(
125
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "text"))),
126
+ JSIConverter<margelo::nitro::nitroinput::NitroInputMode>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode"))),
127
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "plain"))),
128
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "multiline"))),
129
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "secureTextEntry"))),
130
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxLength"))),
131
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fractionDigits"))),
132
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxIntegerDigits"))),
133
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "groupingSeparator"))),
134
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "decimalSeparator"))),
135
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefix"))),
136
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffix"))),
137
+ JSIConverter<margelo::nitro::nitroinput::NitroInputSignPlacement>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signPlacement"))),
138
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "placeholder"))),
139
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mask"))),
140
+ JSIConverter<std::vector<margelo::nitro::nitroinput::NitroInputNotation>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskNotations"))),
141
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAutocomplete"))),
142
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAutoSkip"))),
143
+ JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAffinityFormats"))),
144
+ JSIConverter<margelo::nitro::nitroinput::NitroInputMaskAffinity>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAffinityStrategy"))),
145
+ JSIConverter<margelo::nitro::nitroinput::NitroInputTextCase>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskTextCase"))),
146
+ JSIConverter<std::vector<margelo::nitro::nitroinput::NitroInputCharacterMapping>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskCharacterMap"))),
147
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskSlotPlaceholder"))),
148
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keepPlaceholder"))),
149
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textSize"))),
150
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLineHeight"))),
151
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixFontSize"))),
152
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixFontSize"))),
153
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textWeight"))),
154
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textFamily"))),
155
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLetterSpacing"))),
156
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixSpacing"))),
157
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixSpacing"))),
158
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "allowFontScaling"))),
159
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxFontSizeMultiplier"))),
160
+ JSIConverter<margelo::nitro::nitroinput::NitroInputVariant>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "variant"))),
161
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "label"))),
162
+ JSIConverter<margelo::nitro::nitroinput::NitroInputLabelBehavior>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "labelBehavior"))),
163
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "labelFontSize"))),
164
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cornerRadius")))
165
+ );
166
+ }
167
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroinput::NitroInputSizing& arg) {
168
+ jsi::Object obj(runtime);
169
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "text"), JSIConverter<std::string>::toJSI(runtime, arg.text));
170
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "mode"), JSIConverter<margelo::nitro::nitroinput::NitroInputMode>::toJSI(runtime, arg.mode));
171
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "plain"), JSIConverter<bool>::toJSI(runtime, arg.plain));
172
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "multiline"), JSIConverter<bool>::toJSI(runtime, arg.multiline));
173
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "secureTextEntry"), JSIConverter<bool>::toJSI(runtime, arg.secureTextEntry));
174
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxLength"), JSIConverter<double>::toJSI(runtime, arg.maxLength));
175
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "fractionDigits"), JSIConverter<double>::toJSI(runtime, arg.fractionDigits));
176
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxIntegerDigits"), JSIConverter<double>::toJSI(runtime, arg.maxIntegerDigits));
177
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "groupingSeparator"), JSIConverter<std::string>::toJSI(runtime, arg.groupingSeparator));
178
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "decimalSeparator"), JSIConverter<std::string>::toJSI(runtime, arg.decimalSeparator));
179
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "prefix"), JSIConverter<std::string>::toJSI(runtime, arg.prefix));
180
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "suffix"), JSIConverter<std::string>::toJSI(runtime, arg.suffix));
181
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "signPlacement"), JSIConverter<margelo::nitro::nitroinput::NitroInputSignPlacement>::toJSI(runtime, arg.signPlacement));
182
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "placeholder"), JSIConverter<std::string>::toJSI(runtime, arg.placeholder));
183
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "mask"), JSIConverter<std::string>::toJSI(runtime, arg.mask));
184
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskNotations"), JSIConverter<std::vector<margelo::nitro::nitroinput::NitroInputNotation>>::toJSI(runtime, arg.maskNotations));
185
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskAutocomplete"), JSIConverter<bool>::toJSI(runtime, arg.maskAutocomplete));
186
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskAutoSkip"), JSIConverter<bool>::toJSI(runtime, arg.maskAutoSkip));
187
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskAffinityFormats"), JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.maskAffinityFormats));
188
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskAffinityStrategy"), JSIConverter<margelo::nitro::nitroinput::NitroInputMaskAffinity>::toJSI(runtime, arg.maskAffinityStrategy));
189
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskTextCase"), JSIConverter<margelo::nitro::nitroinput::NitroInputTextCase>::toJSI(runtime, arg.maskTextCase));
190
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskCharacterMap"), JSIConverter<std::vector<margelo::nitro::nitroinput::NitroInputCharacterMapping>>::toJSI(runtime, arg.maskCharacterMap));
191
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskSlotPlaceholder"), JSIConverter<std::string>::toJSI(runtime, arg.maskSlotPlaceholder));
192
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "keepPlaceholder"), JSIConverter<bool>::toJSI(runtime, arg.keepPlaceholder));
193
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "textSize"), JSIConverter<double>::toJSI(runtime, arg.textSize));
194
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "textLineHeight"), JSIConverter<double>::toJSI(runtime, arg.textLineHeight));
195
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "prefixFontSize"), JSIConverter<double>::toJSI(runtime, arg.prefixFontSize));
196
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "suffixFontSize"), JSIConverter<double>::toJSI(runtime, arg.suffixFontSize));
197
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "textWeight"), JSIConverter<double>::toJSI(runtime, arg.textWeight));
198
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "textFamily"), JSIConverter<std::string>::toJSI(runtime, arg.textFamily));
199
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "textLetterSpacing"), JSIConverter<double>::toJSI(runtime, arg.textLetterSpacing));
200
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "prefixSpacing"), JSIConverter<double>::toJSI(runtime, arg.prefixSpacing));
201
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "suffixSpacing"), JSIConverter<double>::toJSI(runtime, arg.suffixSpacing));
202
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "allowFontScaling"), JSIConverter<bool>::toJSI(runtime, arg.allowFontScaling));
203
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxFontSizeMultiplier"), JSIConverter<double>::toJSI(runtime, arg.maxFontSizeMultiplier));
204
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "variant"), JSIConverter<margelo::nitro::nitroinput::NitroInputVariant>::toJSI(runtime, arg.variant));
205
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "label"), JSIConverter<std::string>::toJSI(runtime, arg.label));
206
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "labelBehavior"), JSIConverter<margelo::nitro::nitroinput::NitroInputLabelBehavior>::toJSI(runtime, arg.labelBehavior));
207
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "labelFontSize"), JSIConverter<double>::toJSI(runtime, arg.labelFontSize));
208
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "cornerRadius"), JSIConverter<double>::toJSI(runtime, arg.cornerRadius));
209
+ return obj;
210
+ }
211
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
212
+ if (!value.isObject()) {
213
+ return false;
214
+ }
215
+ jsi::Object obj = value.getObject(runtime);
216
+ if (!nitro::isPlainObject(runtime, obj)) {
217
+ return false;
218
+ }
219
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "text")))) return false;
220
+ if (!JSIConverter<margelo::nitro::nitroinput::NitroInputMode>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode")))) return false;
221
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "plain")))) return false;
222
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "multiline")))) return false;
223
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "secureTextEntry")))) return false;
224
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxLength")))) return false;
225
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fractionDigits")))) return false;
226
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxIntegerDigits")))) return false;
227
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "groupingSeparator")))) return false;
228
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "decimalSeparator")))) return false;
229
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefix")))) return false;
230
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffix")))) return false;
231
+ if (!JSIConverter<margelo::nitro::nitroinput::NitroInputSignPlacement>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signPlacement")))) return false;
232
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "placeholder")))) return false;
233
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mask")))) return false;
234
+ if (!JSIConverter<std::vector<margelo::nitro::nitroinput::NitroInputNotation>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskNotations")))) return false;
235
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAutocomplete")))) return false;
236
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAutoSkip")))) return false;
237
+ if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAffinityFormats")))) return false;
238
+ if (!JSIConverter<margelo::nitro::nitroinput::NitroInputMaskAffinity>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskAffinityStrategy")))) return false;
239
+ if (!JSIConverter<margelo::nitro::nitroinput::NitroInputTextCase>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskTextCase")))) return false;
240
+ if (!JSIConverter<std::vector<margelo::nitro::nitroinput::NitroInputCharacterMapping>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskCharacterMap")))) return false;
241
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskSlotPlaceholder")))) return false;
242
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keepPlaceholder")))) return false;
243
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textSize")))) return false;
244
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLineHeight")))) return false;
245
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixFontSize")))) return false;
246
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixFontSize")))) return false;
247
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textWeight")))) return false;
248
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textFamily")))) return false;
249
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLetterSpacing")))) return false;
250
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixSpacing")))) return false;
251
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixSpacing")))) return false;
252
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "allowFontScaling")))) return false;
253
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxFontSizeMultiplier")))) return false;
254
+ if (!JSIConverter<margelo::nitro::nitroinput::NitroInputVariant>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "variant")))) return false;
255
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "label")))) return false;
256
+ if (!JSIConverter<margelo::nitro::nitroinput::NitroInputLabelBehavior>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "labelBehavior")))) return false;
257
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "labelFontSize")))) return false;
258
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cornerRadius")))) return false;
259
+ return true;
260
+ }
261
+ };
262
+
263
+ } // namespace margelo::nitro
@@ -0,0 +1,95 @@
1
+ ///
2
+ /// NumberFigure.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::nitroinput {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (NumberFigure).
39
+ */
40
+ struct NumberFigure final {
41
+ public:
42
+ double value SWIFT_PRIVATE;
43
+ double fractionDigits SWIFT_PRIVATE;
44
+ std::string prefix SWIFT_PRIVATE;
45
+ std::string suffix SWIFT_PRIVATE;
46
+
47
+ public:
48
+ NumberFigure() = default;
49
+ explicit NumberFigure(double value, double fractionDigits, std::string prefix, std::string suffix): value(value), fractionDigits(fractionDigits), prefix(prefix), suffix(suffix) {}
50
+
51
+ public:
52
+ friend bool operator==(const NumberFigure& lhs, const NumberFigure& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::nitroinput
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ NumberFigure <> JS NumberFigure (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::nitroinput::NumberFigure> final {
62
+ static inline margelo::nitro::nitroinput::NumberFigure fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::nitroinput::NumberFigure(
65
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "value"))),
66
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fractionDigits"))),
67
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefix"))),
68
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffix")))
69
+ );
70
+ }
71
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroinput::NumberFigure& arg) {
72
+ jsi::Object obj(runtime);
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "value"), JSIConverter<double>::toJSI(runtime, arg.value));
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "fractionDigits"), JSIConverter<double>::toJSI(runtime, arg.fractionDigits));
75
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "prefix"), JSIConverter<std::string>::toJSI(runtime, arg.prefix));
76
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "suffix"), JSIConverter<std::string>::toJSI(runtime, arg.suffix));
77
+ return obj;
78
+ }
79
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
80
+ if (!value.isObject()) {
81
+ return false;
82
+ }
83
+ jsi::Object obj = value.getObject(runtime);
84
+ if (!nitro::isPlainObject(runtime, obj)) {
85
+ return false;
86
+ }
87
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "value")))) return false;
88
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fractionDigits")))) return false;
89
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefix")))) return false;
90
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffix")))) return false;
91
+ return true;
92
+ }
93
+ };
94
+
95
+ } // namespace margelo::nitro