react-native-nitro-input 0.1.0 → 0.3.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 (221) hide show
  1. package/CHANGELOG.md +343 -3
  2. package/NitroInput.podspec +4 -4
  3. package/README.md +420 -53
  4. package/android/CMakeLists.txt +9 -3
  5. package/android/gradle.properties +1 -1
  6. package/android/src/main/cpp/JOutlineGeometry.hpp +1 -1
  7. package/android/src/main/cpp/JReflowEngine.cpp +132 -0
  8. package/android/src/main/cpp/{JMorphEngine.hpp → JReflowEngine.hpp} +7 -7
  9. package/android/src/main/cpp/JRollingEngine.cpp +223 -0
  10. package/android/src/main/cpp/JRollingEngine.hpp +68 -0
  11. package/android/src/main/cpp/cpp-adapter.cpp +4 -2
  12. package/android/src/main/java/com/margelo/nitro/nitroinput/AmountFormatter.kt +1 -1
  13. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +21 -1
  14. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +209 -0
  15. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +496 -0
  16. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
  17. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +107 -26
  18. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +1881 -0
  19. package/android/src/main/java/com/margelo/nitro/nitroinput/{MorphEngine.kt → ReflowEngine.kt} +2 -2
  20. package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +60 -0
  21. package/cpp/AmountFormatter.cpp +5 -0
  22. package/cpp/AmountFormatter.hpp +10 -2
  23. package/cpp/{MorphEngine.cpp → ReflowEngine.cpp} +52 -47
  24. package/cpp/{MorphEngine.hpp → ReflowEngine.hpp} +12 -4
  25. package/cpp/RollingEngine.cpp +1234 -0
  26. package/cpp/RollingEngine.hpp +475 -0
  27. package/cpp/SwiftNonCopyable.hpp +22 -0
  28. package/cpp/numberformat/HybridNitroNumberFormat.cpp +498 -0
  29. package/cpp/numberformat/HybridNitroNumberFormat.hpp +74 -0
  30. package/cpp/numberformat/HybridNitroNumberFormatFactory.hpp +11 -0
  31. package/cpp/numberformat/NumberFormatCore.cpp +629 -0
  32. package/cpp/numberformat/NumberFormatCore.hpp +154 -0
  33. package/cpp/numberformat/NumberFormatProbe.cpp +354 -0
  34. package/cpp/numberformat/NumberFormatProbe.hpp +63 -0
  35. package/cpp/worklets/NitroInputWorkletsBridge.cpp +3 -3
  36. package/cpp/worklets/NitroInputWorkletsBridge.hpp +1 -1
  37. package/ios/{HybridMorphInputView.swift → HybridNitroInputView.swift} +16 -1
  38. package/ios/HybridNitroNumberFormatPlatform.swift +348 -0
  39. package/ios/HybridNitroNumberView.swift +458 -0
  40. package/ios/NitroInputView.swift +148 -64
  41. package/ios/NitroNumberView.swift +2074 -0
  42. package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
  43. package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +61 -0
  44. package/lib/commonjs/src/NitroInput.js +27 -56
  45. package/lib/commonjs/src/NitroNumber.js +141 -0
  46. package/lib/commonjs/src/NumberFormat.js +525 -0
  47. package/lib/commonjs/src/formatProps.js +48 -0
  48. package/lib/commonjs/src/index.js +6 -3
  49. package/lib/commonjs/src/specs/NitroNumber.nitro.js +2 -0
  50. package/lib/commonjs/src/specs/NumberFormat.nitro.js +2 -0
  51. package/lib/commonjs/src/styleHelpers.js +36 -0
  52. package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
  53. package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +61 -0
  54. package/lib/module/src/NitroInput.js +18 -47
  55. package/lib/module/src/NitroNumber.js +102 -0
  56. package/lib/module/src/NumberFormat.js +521 -0
  57. package/lib/module/src/formatProps.js +45 -0
  58. package/lib/module/src/index.js +2 -1
  59. package/lib/module/src/specs/NitroNumber.nitro.js +1 -0
  60. package/lib/module/src/specs/NumberFormat.nitro.js +1 -0
  61. package/lib/module/src/styleHelpers.js +32 -0
  62. package/lib/typescript/src/NitroInput.d.ts +50 -21
  63. package/lib/typescript/src/NitroNumber.d.ts +246 -0
  64. package/lib/typescript/src/NumberFormat.d.ts +47 -0
  65. package/lib/typescript/src/formatProps.d.ts +21 -0
  66. package/lib/typescript/src/index.d.ts +5 -2
  67. package/lib/typescript/src/specs/NitroInput.nitro.d.ts +19 -9
  68. package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +250 -0
  69. package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +139 -0
  70. package/lib/typescript/src/styleHelpers.d.ts +3 -0
  71. package/nitro.json +26 -0
  72. package/nitrogen/generated/android/NitroInput+autolinking.cmake +10 -0
  73. package/nitrogen/generated/android/NitroInputOnLoad.cpp +48 -0
  74. package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
  75. package/nitrogen/generated/android/c++/JFunc_void_double_double.hpp +10 -10
  76. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +45 -0
  77. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +10 -0
  78. package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.cpp +118 -0
  79. package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.hpp +64 -0
  80. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +590 -0
  81. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +168 -0
  82. package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.cpp +65 -0
  83. package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.hpp +64 -0
  84. package/nitrogen/generated/android/c++/JNitroNumberAffixAlign.hpp +64 -0
  85. package/nitrogen/generated/android/c++/JNitroNumberDirection.hpp +64 -0
  86. package/nitrogen/generated/android/c++/JNitroNumberEasing.hpp +67 -0
  87. package/nitrogen/generated/android/c++/JNitroNumberRevealStyle.hpp +58 -0
  88. package/nitrogen/generated/android/c++/JNitroNumberTextAlign.hpp +64 -0
  89. package/nitrogen/generated/android/c++/JNitroNumberTransition.hpp +61 -0
  90. package/nitrogen/generated/android/c++/JNumberFormatCompactDisplay.hpp +58 -0
  91. package/nitrogen/generated/android/c++/JNumberFormatCurrencyDisplay.hpp +64 -0
  92. package/nitrogen/generated/android/c++/JNumberFormatCurrencySign.hpp +58 -0
  93. package/nitrogen/generated/android/c++/JNumberFormatNotation.hpp +64 -0
  94. package/nitrogen/generated/android/c++/JNumberFormatPlatformOptions.hpp +161 -0
  95. package/nitrogen/generated/android/c++/JNumberFormatPlatformSymbols.hpp +89 -0
  96. package/nitrogen/generated/android/c++/JNumberFormatRoundingMode.hpp +79 -0
  97. package/nitrogen/generated/android/c++/JNumberFormatSignDisplay.hpp +67 -0
  98. package/nitrogen/generated/android/c++/JNumberFormatStyle.hpp +64 -0
  99. package/nitrogen/generated/android/c++/JNumberFormatUnitDisplay.hpp +61 -0
  100. package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +25 -0
  101. package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +329 -0
  102. package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.hpp +54 -0
  103. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/Func_void.kt +78 -0
  104. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/Func_void_double_double.kt +9 -9
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +30 -0
  106. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatformSpec.kt +60 -0
  107. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +399 -0
  108. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroPlatformNumberFormatterSpec.kt +62 -0
  109. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberAffixAlign.kt +25 -0
  110. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberDirection.kt +25 -0
  111. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberEasing.kt +26 -0
  112. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberRevealStyle.kt +23 -0
  113. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberTextAlign.kt +25 -0
  114. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberTransition.kt +24 -0
  115. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCompactDisplay.kt +23 -0
  116. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencyDisplay.kt +25 -0
  117. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencySign.kt +23 -0
  118. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatNotation.kt +25 -0
  119. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformOptions.kt +136 -0
  120. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformSymbols.kt +91 -0
  121. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatRoundingMode.kt +30 -0
  122. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatSignDisplay.kt +26 -0
  123. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatStyle.kt +25 -0
  124. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatUnitDisplay.kt +24 -0
  125. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroNumberViewManager.kt +96 -0
  126. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroNumberViewStateUpdater.kt +23 -0
  127. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +59 -0
  128. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +311 -0
  129. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +63 -0
  130. package/nitrogen/generated/ios/NitroInputAutolinking.mm +26 -0
  131. package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
  132. package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +30 -0
  133. package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.cpp +11 -0
  134. package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.hpp +122 -0
  135. package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.cpp +11 -0
  136. package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +474 -0
  137. package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.cpp +11 -0
  138. package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.hpp +94 -0
  139. package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +30 -0
  140. package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +450 -0
  141. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  142. package/nitrogen/generated/ios/swift/Func_void_double_double.swift +5 -5
  143. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +5 -0
  144. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +55 -0
  145. package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec.swift +56 -0
  146. package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec_cxx.swift +159 -0
  147. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +108 -0
  148. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +1387 -0
  149. package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec.swift +56 -0
  150. package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec_cxx.swift +155 -0
  151. package/nitrogen/generated/ios/swift/NitroNumberAffixAlign.swift +48 -0
  152. package/nitrogen/generated/ios/swift/NitroNumberDirection.swift +48 -0
  153. package/nitrogen/generated/ios/swift/NitroNumberEasing.swift +52 -0
  154. package/nitrogen/generated/ios/swift/NitroNumberRevealStyle.swift +40 -0
  155. package/nitrogen/generated/ios/swift/NitroNumberTextAlign.swift +48 -0
  156. package/nitrogen/generated/ios/swift/NitroNumberTransition.swift +44 -0
  157. package/nitrogen/generated/ios/swift/NumberFormatCompactDisplay.swift +40 -0
  158. package/nitrogen/generated/ios/swift/NumberFormatCurrencyDisplay.swift +48 -0
  159. package/nitrogen/generated/ios/swift/NumberFormatCurrencySign.swift +40 -0
  160. package/nitrogen/generated/ios/swift/NumberFormatNotation.swift +48 -0
  161. package/nitrogen/generated/ios/swift/NumberFormatPlatformOptions.swift +159 -0
  162. package/nitrogen/generated/ios/swift/NumberFormatPlatformSymbols.swift +69 -0
  163. package/nitrogen/generated/ios/swift/NumberFormatRoundingMode.swift +68 -0
  164. package/nitrogen/generated/ios/swift/NumberFormatSignDisplay.swift +52 -0
  165. package/nitrogen/generated/ios/swift/NumberFormatStyle.swift +48 -0
  166. package/nitrogen/generated/ios/swift/NumberFormatUnitDisplay.swift +44 -0
  167. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +10 -0
  168. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +10 -0
  169. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.cpp +22 -0
  170. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.hpp +70 -0
  171. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.cpp +22 -0
  172. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.hpp +70 -0
  173. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.cpp +23 -0
  174. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.hpp +71 -0
  175. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +127 -0
  176. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +187 -0
  177. package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.cpp +23 -0
  178. package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.hpp +65 -0
  179. package/nitrogen/generated/shared/c++/NitroNumberAffixAlign.hpp +84 -0
  180. package/nitrogen/generated/shared/c++/NitroNumberDirection.hpp +84 -0
  181. package/nitrogen/generated/shared/c++/NitroNumberEasing.hpp +88 -0
  182. package/nitrogen/generated/shared/c++/NitroNumberRevealStyle.hpp +76 -0
  183. package/nitrogen/generated/shared/c++/NitroNumberTextAlign.hpp +84 -0
  184. package/nitrogen/generated/shared/c++/NitroNumberTransition.hpp +80 -0
  185. package/nitrogen/generated/shared/c++/NumberFormatCompactDisplay.hpp +76 -0
  186. package/nitrogen/generated/shared/c++/NumberFormatCurrencyDisplay.hpp +84 -0
  187. package/nitrogen/generated/shared/c++/NumberFormatCurrencySign.hpp +76 -0
  188. package/nitrogen/generated/shared/c++/NumberFormatGrouping.hpp +80 -0
  189. package/nitrogen/generated/shared/c++/NumberFormatNotation.hpp +84 -0
  190. package/nitrogen/generated/shared/c++/NumberFormatOptions.hpp +193 -0
  191. package/nitrogen/generated/shared/c++/NumberFormatPart.hpp +87 -0
  192. package/nitrogen/generated/shared/c++/NumberFormatPlatformOptions.hpp +176 -0
  193. package/nitrogen/generated/shared/c++/NumberFormatPlatformSymbols.hpp +115 -0
  194. package/nitrogen/generated/shared/c++/NumberFormatRoundingMode.hpp +104 -0
  195. package/nitrogen/generated/shared/c++/NumberFormatRoundingPriority.hpp +80 -0
  196. package/nitrogen/generated/shared/c++/NumberFormatSignDisplay.hpp +88 -0
  197. package/nitrogen/generated/shared/c++/NumberFormatStyle.hpp +84 -0
  198. package/nitrogen/generated/shared/c++/NumberFormatTrailingZeroDisplay.hpp +76 -0
  199. package/nitrogen/generated/shared/c++/NumberFormatUnitDisplay.hpp +80 -0
  200. package/nitrogen/generated/shared/c++/ResolvedNumberFormatOptions.hpp +197 -0
  201. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +10 -0
  202. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +15 -0
  203. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +136 -0
  204. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +245 -0
  205. package/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
  206. package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +61 -0
  207. package/package.json +15 -7
  208. package/src/NitroInput.tsx +79 -67
  209. package/src/NitroNumber.tsx +531 -0
  210. package/src/NumberFormat.ts +563 -0
  211. package/src/formatProps.ts +59 -0
  212. package/src/index.ts +38 -6
  213. package/src/specs/NitroInput.nitro.ts +19 -9
  214. package/src/specs/NitroNumber.nitro.ts +271 -0
  215. package/src/specs/NumberFormat.nitro.ts +145 -0
  216. package/src/styleHelpers.ts +32 -0
  217. package/android/src/main/cpp/JMorphEngine.cpp +0 -132
  218. package/lib/commonjs/src/MorphInput.js +0 -42
  219. package/lib/module/src/MorphInput.js +0 -6
  220. package/lib/typescript/src/MorphInput.d.ts +0 -18
  221. package/src/MorphInput.tsx +0 -30
@@ -0,0 +1,197 @@
1
+ ///
2
+ /// ResolvedNumberFormatOptions.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 `NumberFormatStyle` to properly resolve imports.
32
+ namespace margelo::nitro::nitroinput { enum class NumberFormatStyle; }
33
+ // Forward declaration of `NumberFormatCurrencyDisplay` to properly resolve imports.
34
+ namespace margelo::nitro::nitroinput { enum class NumberFormatCurrencyDisplay; }
35
+ // Forward declaration of `NumberFormatCurrencySign` to properly resolve imports.
36
+ namespace margelo::nitro::nitroinput { enum class NumberFormatCurrencySign; }
37
+ // Forward declaration of `NumberFormatUnitDisplay` to properly resolve imports.
38
+ namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
39
+ // Forward declaration of `NumberFormatGrouping` to properly resolve imports.
40
+ namespace margelo::nitro::nitroinput { enum class NumberFormatGrouping; }
41
+ // Forward declaration of `NumberFormatNotation` to properly resolve imports.
42
+ namespace margelo::nitro::nitroinput { enum class NumberFormatNotation; }
43
+ // Forward declaration of `NumberFormatCompactDisplay` to properly resolve imports.
44
+ namespace margelo::nitro::nitroinput { enum class NumberFormatCompactDisplay; }
45
+ // Forward declaration of `NumberFormatSignDisplay` to properly resolve imports.
46
+ namespace margelo::nitro::nitroinput { enum class NumberFormatSignDisplay; }
47
+ // Forward declaration of `NumberFormatRoundingMode` to properly resolve imports.
48
+ namespace margelo::nitro::nitroinput { enum class NumberFormatRoundingMode; }
49
+ // Forward declaration of `NumberFormatRoundingPriority` to properly resolve imports.
50
+ namespace margelo::nitro::nitroinput { enum class NumberFormatRoundingPriority; }
51
+ // Forward declaration of `NumberFormatTrailingZeroDisplay` to properly resolve imports.
52
+ namespace margelo::nitro::nitroinput { enum class NumberFormatTrailingZeroDisplay; }
53
+
54
+ #include <string>
55
+ #include "NumberFormatStyle.hpp"
56
+ #include <optional>
57
+ #include "NumberFormatCurrencyDisplay.hpp"
58
+ #include "NumberFormatCurrencySign.hpp"
59
+ #include "NumberFormatUnitDisplay.hpp"
60
+ #include "NumberFormatGrouping.hpp"
61
+ #include <variant>
62
+ #include "NumberFormatNotation.hpp"
63
+ #include "NumberFormatCompactDisplay.hpp"
64
+ #include "NumberFormatSignDisplay.hpp"
65
+ #include "NumberFormatRoundingMode.hpp"
66
+ #include "NumberFormatRoundingPriority.hpp"
67
+ #include "NumberFormatTrailingZeroDisplay.hpp"
68
+
69
+ namespace margelo::nitro::nitroinput {
70
+
71
+ /**
72
+ * A struct which can be represented as a JavaScript object (ResolvedNumberFormatOptions).
73
+ */
74
+ struct ResolvedNumberFormatOptions final {
75
+ public:
76
+ std::string locale SWIFT_PRIVATE;
77
+ std::string numberingSystem SWIFT_PRIVATE;
78
+ NumberFormatStyle style SWIFT_PRIVATE;
79
+ std::optional<std::string> currency SWIFT_PRIVATE;
80
+ std::optional<NumberFormatCurrencyDisplay> currencyDisplay SWIFT_PRIVATE;
81
+ std::optional<NumberFormatCurrencySign> currencySign SWIFT_PRIVATE;
82
+ std::optional<std::string> unit SWIFT_PRIVATE;
83
+ std::optional<NumberFormatUnitDisplay> unitDisplay SWIFT_PRIVATE;
84
+ double minimumIntegerDigits SWIFT_PRIVATE;
85
+ std::optional<double> minimumFractionDigits SWIFT_PRIVATE;
86
+ std::optional<double> maximumFractionDigits SWIFT_PRIVATE;
87
+ std::optional<double> minimumSignificantDigits SWIFT_PRIVATE;
88
+ std::optional<double> maximumSignificantDigits SWIFT_PRIVATE;
89
+ std::variant<bool, NumberFormatGrouping> useGrouping SWIFT_PRIVATE;
90
+ NumberFormatNotation notation SWIFT_PRIVATE;
91
+ std::optional<NumberFormatCompactDisplay> compactDisplay SWIFT_PRIVATE;
92
+ NumberFormatSignDisplay signDisplay SWIFT_PRIVATE;
93
+ double roundingIncrement SWIFT_PRIVATE;
94
+ NumberFormatRoundingMode roundingMode SWIFT_PRIVATE;
95
+ NumberFormatRoundingPriority roundingPriority SWIFT_PRIVATE;
96
+ NumberFormatTrailingZeroDisplay trailingZeroDisplay SWIFT_PRIVATE;
97
+
98
+ public:
99
+ ResolvedNumberFormatOptions() = default;
100
+ explicit ResolvedNumberFormatOptions(std::string locale, std::string numberingSystem, NumberFormatStyle style, std::optional<std::string> currency, std::optional<NumberFormatCurrencyDisplay> currencyDisplay, std::optional<NumberFormatCurrencySign> currencySign, std::optional<std::string> unit, std::optional<NumberFormatUnitDisplay> unitDisplay, double minimumIntegerDigits, std::optional<double> minimumFractionDigits, std::optional<double> maximumFractionDigits, std::optional<double> minimumSignificantDigits, std::optional<double> maximumSignificantDigits, std::variant<bool, NumberFormatGrouping> useGrouping, NumberFormatNotation notation, std::optional<NumberFormatCompactDisplay> compactDisplay, NumberFormatSignDisplay signDisplay, double roundingIncrement, NumberFormatRoundingMode roundingMode, NumberFormatRoundingPriority roundingPriority, NumberFormatTrailingZeroDisplay trailingZeroDisplay): locale(locale), numberingSystem(numberingSystem), style(style), currency(currency), currencyDisplay(currencyDisplay), currencySign(currencySign), unit(unit), unitDisplay(unitDisplay), minimumIntegerDigits(minimumIntegerDigits), minimumFractionDigits(minimumFractionDigits), maximumFractionDigits(maximumFractionDigits), minimumSignificantDigits(minimumSignificantDigits), maximumSignificantDigits(maximumSignificantDigits), useGrouping(useGrouping), notation(notation), compactDisplay(compactDisplay), signDisplay(signDisplay), roundingIncrement(roundingIncrement), roundingMode(roundingMode), roundingPriority(roundingPriority), trailingZeroDisplay(trailingZeroDisplay) {}
101
+
102
+ public:
103
+ friend bool operator==(const ResolvedNumberFormatOptions& lhs, const ResolvedNumberFormatOptions& rhs) = default;
104
+ };
105
+
106
+ } // namespace margelo::nitro::nitroinput
107
+
108
+ namespace margelo::nitro {
109
+
110
+ // C++ ResolvedNumberFormatOptions <> JS ResolvedNumberFormatOptions (object)
111
+ template <>
112
+ struct JSIConverter<margelo::nitro::nitroinput::ResolvedNumberFormatOptions> final {
113
+ static inline margelo::nitro::nitroinput::ResolvedNumberFormatOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
114
+ jsi::Object obj = arg.asObject(runtime);
115
+ return margelo::nitro::nitroinput::ResolvedNumberFormatOptions(
116
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locale"))),
117
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "numberingSystem"))),
118
+ JSIConverter<margelo::nitro::nitroinput::NumberFormatStyle>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "style"))),
119
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currency"))),
120
+ JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCurrencyDisplay>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencyDisplay"))),
121
+ JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCurrencySign>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencySign"))),
122
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unit"))),
123
+ JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatUnitDisplay>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unitDisplay"))),
124
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumIntegerDigits"))),
125
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumFractionDigits"))),
126
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumFractionDigits"))),
127
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumSignificantDigits"))),
128
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumSignificantDigits"))),
129
+ JSIConverter<std::variant<bool, margelo::nitro::nitroinput::NumberFormatGrouping>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "useGrouping"))),
130
+ JSIConverter<margelo::nitro::nitroinput::NumberFormatNotation>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notation"))),
131
+ JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCompactDisplay>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "compactDisplay"))),
132
+ JSIConverter<margelo::nitro::nitroinput::NumberFormatSignDisplay>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signDisplay"))),
133
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "roundingIncrement"))),
134
+ JSIConverter<margelo::nitro::nitroinput::NumberFormatRoundingMode>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "roundingMode"))),
135
+ JSIConverter<margelo::nitro::nitroinput::NumberFormatRoundingPriority>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "roundingPriority"))),
136
+ JSIConverter<margelo::nitro::nitroinput::NumberFormatTrailingZeroDisplay>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "trailingZeroDisplay")))
137
+ );
138
+ }
139
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroinput::ResolvedNumberFormatOptions& arg) {
140
+ jsi::Object obj(runtime);
141
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "locale"), JSIConverter<std::string>::toJSI(runtime, arg.locale));
142
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "numberingSystem"), JSIConverter<std::string>::toJSI(runtime, arg.numberingSystem));
143
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "style"), JSIConverter<margelo::nitro::nitroinput::NumberFormatStyle>::toJSI(runtime, arg.style));
144
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "currency"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.currency));
145
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "currencyDisplay"), JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCurrencyDisplay>>::toJSI(runtime, arg.currencyDisplay));
146
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "currencySign"), JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCurrencySign>>::toJSI(runtime, arg.currencySign));
147
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "unit"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
148
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "unitDisplay"), JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatUnitDisplay>>::toJSI(runtime, arg.unitDisplay));
149
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "minimumIntegerDigits"), JSIConverter<double>::toJSI(runtime, arg.minimumIntegerDigits));
150
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "minimumFractionDigits"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.minimumFractionDigits));
151
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maximumFractionDigits"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maximumFractionDigits));
152
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "minimumSignificantDigits"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.minimumSignificantDigits));
153
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maximumSignificantDigits"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maximumSignificantDigits));
154
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "useGrouping"), JSIConverter<std::variant<bool, margelo::nitro::nitroinput::NumberFormatGrouping>>::toJSI(runtime, arg.useGrouping));
155
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "notation"), JSIConverter<margelo::nitro::nitroinput::NumberFormatNotation>::toJSI(runtime, arg.notation));
156
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "compactDisplay"), JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCompactDisplay>>::toJSI(runtime, arg.compactDisplay));
157
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "signDisplay"), JSIConverter<margelo::nitro::nitroinput::NumberFormatSignDisplay>::toJSI(runtime, arg.signDisplay));
158
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "roundingIncrement"), JSIConverter<double>::toJSI(runtime, arg.roundingIncrement));
159
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "roundingMode"), JSIConverter<margelo::nitro::nitroinput::NumberFormatRoundingMode>::toJSI(runtime, arg.roundingMode));
160
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "roundingPriority"), JSIConverter<margelo::nitro::nitroinput::NumberFormatRoundingPriority>::toJSI(runtime, arg.roundingPriority));
161
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "trailingZeroDisplay"), JSIConverter<margelo::nitro::nitroinput::NumberFormatTrailingZeroDisplay>::toJSI(runtime, arg.trailingZeroDisplay));
162
+ return obj;
163
+ }
164
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
165
+ if (!value.isObject()) {
166
+ return false;
167
+ }
168
+ jsi::Object obj = value.getObject(runtime);
169
+ if (!nitro::isPlainObject(runtime, obj)) {
170
+ return false;
171
+ }
172
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locale")))) return false;
173
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "numberingSystem")))) return false;
174
+ if (!JSIConverter<margelo::nitro::nitroinput::NumberFormatStyle>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "style")))) return false;
175
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currency")))) return false;
176
+ if (!JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCurrencyDisplay>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencyDisplay")))) return false;
177
+ if (!JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCurrencySign>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencySign")))) return false;
178
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unit")))) return false;
179
+ if (!JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatUnitDisplay>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unitDisplay")))) return false;
180
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumIntegerDigits")))) return false;
181
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumFractionDigits")))) return false;
182
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumFractionDigits")))) return false;
183
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumSignificantDigits")))) return false;
184
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumSignificantDigits")))) return false;
185
+ if (!JSIConverter<std::variant<bool, margelo::nitro::nitroinput::NumberFormatGrouping>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "useGrouping")))) return false;
186
+ if (!JSIConverter<margelo::nitro::nitroinput::NumberFormatNotation>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notation")))) return false;
187
+ if (!JSIConverter<std::optional<margelo::nitro::nitroinput::NumberFormatCompactDisplay>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "compactDisplay")))) return false;
188
+ if (!JSIConverter<margelo::nitro::nitroinput::NumberFormatSignDisplay>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signDisplay")))) return false;
189
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "roundingIncrement")))) return false;
190
+ if (!JSIConverter<margelo::nitro::nitroinput::NumberFormatRoundingMode>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "roundingMode")))) return false;
191
+ if (!JSIConverter<margelo::nitro::nitroinput::NumberFormatRoundingPriority>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "roundingPriority")))) return false;
192
+ if (!JSIConverter<margelo::nitro::nitroinput::NumberFormatTrailingZeroDisplay>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "trailingZeroDisplay")))) return false;
193
+ return true;
194
+ }
195
+ };
196
+
197
+ } // namespace margelo::nitro
@@ -50,6 +50,11 @@ namespace margelo::nitro::nitroinput::views {
50
50
  signPlacement(nitro::ReactProp<NitroInputSignPlacement>::fromRawValue("NitroInputView", "signPlacement", rawProps, sourceProps.signPlacement)),
51
51
  prefixAlign(nitro::ReactProp<NitroInputAffixAlign>::fromRawValue("NitroInputView", "prefixAlign", rawProps, sourceProps.prefixAlign)),
52
52
  suffixAlign(nitro::ReactProp<NitroInputAffixAlign>::fromRawValue("NitroInputView", "suffixAlign", rawProps, sourceProps.suffixAlign)),
53
+ letterSpacing(nitro::ReactProp<double>::fromRawValue("NitroInputView", "letterSpacing", rawProps, sourceProps.letterSpacing)),
54
+ prefixSpacing(nitro::ReactProp<double>::fromRawValue("NitroInputView", "prefixSpacing", rawProps, sourceProps.prefixSpacing)),
55
+ suffixSpacing(nitro::ReactProp<double>::fromRawValue("NitroInputView", "suffixSpacing", rawProps, sourceProps.suffixSpacing)),
56
+ prefixOffset(nitro::ReactProp<double>::fromRawValue("NitroInputView", "prefixOffset", rawProps, sourceProps.prefixOffset)),
57
+ suffixOffset(nitro::ReactProp<double>::fromRawValue("NitroInputView", "suffixOffset", rawProps, sourceProps.suffixOffset)),
53
58
  placeholder(nitro::ReactProp<std::string>::fromRawValue("NitroInputView", "placeholder", rawProps, sourceProps.placeholder)),
54
59
  placeholderColor(nitro::ReactProp<double>::fromRawValue("NitroInputView", "placeholderColor", rawProps, sourceProps.placeholderColor)),
55
60
  duration(nitro::ReactProp<double>::fromRawValue("NitroInputView", "duration", rawProps, sourceProps.duration)),
@@ -146,6 +151,11 @@ namespace margelo::nitro::nitroinput::views {
146
151
  case hashString("signPlacement"): return true;
147
152
  case hashString("prefixAlign"): return true;
148
153
  case hashString("suffixAlign"): return true;
154
+ case hashString("letterSpacing"): return true;
155
+ case hashString("prefixSpacing"): return true;
156
+ case hashString("suffixSpacing"): return true;
157
+ case hashString("prefixOffset"): return true;
158
+ case hashString("suffixOffset"): return true;
149
159
  case hashString("placeholder"): return true;
150
160
  case hashString("placeholderColor"): return true;
151
161
  case hashString("duration"): return true;
@@ -89,6 +89,11 @@ namespace margelo::nitro::nitroinput::views {
89
89
  nitro::ReactProp<NitroInputSignPlacement> signPlacement;
90
90
  nitro::ReactProp<NitroInputAffixAlign> prefixAlign;
91
91
  nitro::ReactProp<NitroInputAffixAlign> suffixAlign;
92
+ nitro::ReactProp<double> letterSpacing;
93
+ nitro::ReactProp<double> prefixSpacing;
94
+ nitro::ReactProp<double> suffixSpacing;
95
+ nitro::ReactProp<double> prefixOffset;
96
+ nitro::ReactProp<double> suffixOffset;
92
97
  nitro::ReactProp<std::string> placeholder;
93
98
  nitro::ReactProp<double> placeholderColor;
94
99
  nitro::ReactProp<double> duration;
@@ -185,6 +190,11 @@ namespace margelo::nitro::nitroinput::views {
185
190
  signPlacement.hasSameValue(other.signPlacement) &&
186
191
  prefixAlign.hasSameValue(other.prefixAlign) &&
187
192
  suffixAlign.hasSameValue(other.suffixAlign) &&
193
+ letterSpacing.hasSameValue(other.letterSpacing) &&
194
+ prefixSpacing.hasSameValue(other.prefixSpacing) &&
195
+ suffixSpacing.hasSameValue(other.suffixSpacing) &&
196
+ prefixOffset.hasSameValue(other.prefixOffset) &&
197
+ suffixOffset.hasSameValue(other.suffixOffset) &&
188
198
  placeholder.hasSameValue(other.placeholder) &&
189
199
  placeholderColor.hasSameValue(other.placeholderColor) &&
190
200
  duration.hasSameValue(other.duration) &&
@@ -282,6 +292,11 @@ namespace margelo::nitro::nitroinput::views {
282
292
  signPlacement.isProvided() ||
283
293
  prefixAlign.isProvided() ||
284
294
  suffixAlign.isProvided() ||
295
+ letterSpacing.isProvided() ||
296
+ prefixSpacing.isProvided() ||
297
+ suffixSpacing.isProvided() ||
298
+ prefixOffset.isProvided() ||
299
+ suffixOffset.isProvided() ||
285
300
  placeholder.isProvided() ||
286
301
  placeholderColor.isProvided() ||
287
302
  duration.isProvided() ||
@@ -0,0 +1,136 @@
1
+ ///
2
+ /// HybridNitroNumberViewComponent.cpp
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
+ #include "HybridNitroNumberViewComponent.hpp"
9
+
10
+ #include <NitroModules/NitroHash.hpp>
11
+ #include <NitroModules/ReactProp.hpp>
12
+
13
+ namespace margelo::nitro::nitroinput::views {
14
+
15
+ using namespace facebook;
16
+
17
+ extern const char HybridNitroNumberViewComponentName[] = "NitroNumberView";
18
+
19
+ HybridNitroNumberViewProps::HybridNitroNumberViewProps(const react::PropsParserContext& context,
20
+ const HybridNitroNumberViewProps& sourceProps,
21
+ const react::RawProps& rawProps):
22
+ react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
23
+ value(nitro::ReactProp<double>::fromRawValue("NitroNumberView", "value", rawProps, sourceProps.value)),
24
+ fractionDigits(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "fractionDigits", rawProps, sourceProps.fractionDigits)),
25
+ minimumIntegerDigits(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "minimumIntegerDigits", rawProps, sourceProps.minimumIntegerDigits)),
26
+ groupingSeparator(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroNumberView", "groupingSeparator", rawProps, sourceProps.groupingSeparator)),
27
+ decimalSeparator(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroNumberView", "decimalSeparator", rawProps, sourceProps.decimalSeparator)),
28
+ prefix(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroNumberView", "prefix", rawProps, sourceProps.prefix)),
29
+ suffix(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroNumberView", "suffix", rawProps, sourceProps.suffix)),
30
+ duration(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "duration", rawProps, sourceProps.duration)),
31
+ easing(nitro::ReactProp<std::optional<NitroNumberEasing>>::fromRawValue("NitroNumberView", "easing", rawProps, sourceProps.easing)),
32
+ bounce(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "bounce", rawProps, sourceProps.bounce)),
33
+ stagger(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "stagger", rawProps, sourceProps.stagger)),
34
+ transition(nitro::ReactProp<std::optional<NitroNumberTransition>>::fromRawValue("NitroNumberView", "transition", rawProps, sourceProps.transition)),
35
+ flashUpColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "flashUpColor", rawProps, sourceProps.flashUpColor)),
36
+ flashDownColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "flashDownColor", rawProps, sourceProps.flashDownColor)),
37
+ flashDuration(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "flashDuration", rawProps, sourceProps.flashDuration)),
38
+ popOnChange(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "popOnChange", rawProps, sourceProps.popOnChange)),
39
+ rollDirection(nitro::ReactProp<std::optional<NitroNumberDirection>>::fromRawValue("NitroNumberView", "rollDirection", rawProps, sourceProps.rollDirection)),
40
+ revealState(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "revealState", rawProps, sourceProps.revealState)),
41
+ revealStyle(nitro::ReactProp<std::optional<NitroNumberRevealStyle>>::fromRawValue("NitroNumberView", "revealStyle", rawProps, sourceProps.revealStyle)),
42
+ revealDuration(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "revealDuration", rawProps, sourceProps.revealDuration)),
43
+ revealBounce(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "revealBounce", rawProps, sourceProps.revealBounce)),
44
+ revealGrow(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "revealGrow", rawProps, sourceProps.revealGrow)),
45
+ revealStagger(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "revealStagger", rawProps, sourceProps.revealStagger)),
46
+ revealMilestones(nitro::ReactProp<std::optional<std::vector<double>>>::fromRawValue("NitroNumberView", "revealMilestones", rawProps, sourceProps.revealMilestones)),
47
+ revealMilestoneHold(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "revealMilestoneHold", rawProps, sourceProps.revealMilestoneHold)),
48
+ loading(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "loading", rawProps, sourceProps.loading)),
49
+ shimmerColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerColor", rawProps, sourceProps.shimmerColor)),
50
+ shimmerDuration(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerDuration", rawProps, sourceProps.shimmerDuration)),
51
+ fontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "fontSize", rawProps, sourceProps.fontSize)),
52
+ prefixFontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "prefixFontSize", rawProps, sourceProps.prefixFontSize)),
53
+ suffixFontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "suffixFontSize", rawProps, sourceProps.suffixFontSize)),
54
+ affixAlign(nitro::ReactProp<std::optional<NitroNumberAffixAlign>>::fromRawValue("NitroNumberView", "affixAlign", rawProps, sourceProps.affixAlign)),
55
+ prefixAlign(nitro::ReactProp<std::optional<NitroNumberAffixAlign>>::fromRawValue("NitroNumberView", "prefixAlign", rawProps, sourceProps.prefixAlign)),
56
+ suffixAlign(nitro::ReactProp<std::optional<NitroNumberAffixAlign>>::fromRawValue("NitroNumberView", "suffixAlign", rawProps, sourceProps.suffixAlign)),
57
+ letterSpacing(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "letterSpacing", rawProps, sourceProps.letterSpacing)),
58
+ prefixSpacing(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "prefixSpacing", rawProps, sourceProps.prefixSpacing)),
59
+ suffixSpacing(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "suffixSpacing", rawProps, sourceProps.suffixSpacing)),
60
+ prefixOffset(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "prefixOffset", rawProps, sourceProps.prefixOffset)),
61
+ suffixOffset(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "suffixOffset", rawProps, sourceProps.suffixOffset)),
62
+ tabularNums(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "tabularNums", rawProps, sourceProps.tabularNums)),
63
+ adjustsFontSizeToFit(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "adjustsFontSizeToFit", rawProps, sourceProps.adjustsFontSizeToFit)),
64
+ minimumFontScale(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "minimumFontScale", rawProps, sourceProps.minimumFontScale)),
65
+ allowFontScaling(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "allowFontScaling", rawProps, sourceProps.allowFontScaling)),
66
+ maxFontSizeMultiplier(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "maxFontSizeMultiplier", rawProps, sourceProps.maxFontSizeMultiplier)),
67
+ fontWeight(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "fontWeight", rawProps, sourceProps.fontWeight)),
68
+ fontFamily(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroNumberView", "fontFamily", rawProps, sourceProps.fontFamily)),
69
+ color(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "color", rawProps, sourceProps.color)),
70
+ textAlign(nitro::ReactProp<std::optional<NitroNumberTextAlign>>::fromRawValue("NitroNumberView", "textAlign", rawProps, sourceProps.textAlign)),
71
+ rightToLeft(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "rightToLeft", rawProps, sourceProps.rightToLeft)),
72
+ onSizeChange(nitro::ReactProp<std::optional<std::function<void(double /* width */, double /* height */)>>>::fromRawValue("NitroNumberView", "onSizeChange", rawProps, sourceProps.onSizeChange)),
73
+ onRevealEnd(nitro::ReactProp<std::optional<std::function<void()>>>::fromRawValue("NitroNumberView", "onRevealEnd", rawProps, sourceProps.onRevealEnd)),
74
+ onRevealMilestone(nitro::ReactProp<std::optional<std::function<void(double /* index */, double /* value */)>>>::fromRawValue("NitroNumberView", "onRevealMilestone", rawProps, sourceProps.onRevealMilestone)),
75
+ hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNitroNumberViewSpec>& /* ref */)>>>::fromRawValue("NitroNumberView", "hybridRef", rawProps, sourceProps.hybridRef)) { }
76
+
77
+ bool HybridNitroNumberViewProps::filterObjectKeys(const std::string& propName) {
78
+ switch (hashString(propName)) {
79
+ case hashString("value"): return true;
80
+ case hashString("fractionDigits"): return true;
81
+ case hashString("minimumIntegerDigits"): return true;
82
+ case hashString("groupingSeparator"): return true;
83
+ case hashString("decimalSeparator"): return true;
84
+ case hashString("prefix"): return true;
85
+ case hashString("suffix"): return true;
86
+ case hashString("duration"): return true;
87
+ case hashString("easing"): return true;
88
+ case hashString("bounce"): return true;
89
+ case hashString("stagger"): return true;
90
+ case hashString("transition"): return true;
91
+ case hashString("flashUpColor"): return true;
92
+ case hashString("flashDownColor"): return true;
93
+ case hashString("flashDuration"): return true;
94
+ case hashString("popOnChange"): return true;
95
+ case hashString("rollDirection"): return true;
96
+ case hashString("revealState"): return true;
97
+ case hashString("revealStyle"): return true;
98
+ case hashString("revealDuration"): return true;
99
+ case hashString("revealBounce"): return true;
100
+ case hashString("revealGrow"): return true;
101
+ case hashString("revealStagger"): return true;
102
+ case hashString("revealMilestones"): return true;
103
+ case hashString("revealMilestoneHold"): return true;
104
+ case hashString("loading"): return true;
105
+ case hashString("shimmerColor"): return true;
106
+ case hashString("shimmerDuration"): return true;
107
+ case hashString("fontSize"): return true;
108
+ case hashString("prefixFontSize"): return true;
109
+ case hashString("suffixFontSize"): return true;
110
+ case hashString("affixAlign"): return true;
111
+ case hashString("prefixAlign"): return true;
112
+ case hashString("suffixAlign"): return true;
113
+ case hashString("letterSpacing"): return true;
114
+ case hashString("prefixSpacing"): return true;
115
+ case hashString("suffixSpacing"): return true;
116
+ case hashString("prefixOffset"): return true;
117
+ case hashString("suffixOffset"): return true;
118
+ case hashString("tabularNums"): return true;
119
+ case hashString("adjustsFontSizeToFit"): return true;
120
+ case hashString("minimumFontScale"): return true;
121
+ case hashString("allowFontScaling"): return true;
122
+ case hashString("maxFontSizeMultiplier"): return true;
123
+ case hashString("fontWeight"): return true;
124
+ case hashString("fontFamily"): return true;
125
+ case hashString("color"): return true;
126
+ case hashString("textAlign"): return true;
127
+ case hashString("rightToLeft"): return true;
128
+ case hashString("onSizeChange"): return true;
129
+ case hashString("onRevealEnd"): return true;
130
+ case hashString("onRevealMilestone"): return true;
131
+ case hashString("hybridRef"): return true;
132
+ default: return false;
133
+ }
134
+ }
135
+
136
+ } // namespace margelo::nitro::nitroinput::views