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.
- package/CHANGELOG.md +343 -3
- package/NitroInput.podspec +4 -4
- package/README.md +420 -53
- package/android/CMakeLists.txt +9 -3
- package/android/gradle.properties +1 -1
- package/android/src/main/cpp/JOutlineGeometry.hpp +1 -1
- package/android/src/main/cpp/JReflowEngine.cpp +132 -0
- package/android/src/main/cpp/{JMorphEngine.hpp → JReflowEngine.hpp} +7 -7
- package/android/src/main/cpp/JRollingEngine.cpp +223 -0
- package/android/src/main/cpp/JRollingEngine.hpp +68 -0
- package/android/src/main/cpp/cpp-adapter.cpp +4 -2
- package/android/src/main/java/com/margelo/nitro/nitroinput/AmountFormatter.kt +1 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +21 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +209 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +496 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +107 -26
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +1881 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/{MorphEngine.kt → ReflowEngine.kt} +2 -2
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +60 -0
- package/cpp/AmountFormatter.cpp +5 -0
- package/cpp/AmountFormatter.hpp +10 -2
- package/cpp/{MorphEngine.cpp → ReflowEngine.cpp} +52 -47
- package/cpp/{MorphEngine.hpp → ReflowEngine.hpp} +12 -4
- package/cpp/RollingEngine.cpp +1234 -0
- package/cpp/RollingEngine.hpp +475 -0
- package/cpp/SwiftNonCopyable.hpp +22 -0
- package/cpp/numberformat/HybridNitroNumberFormat.cpp +498 -0
- package/cpp/numberformat/HybridNitroNumberFormat.hpp +74 -0
- package/cpp/numberformat/HybridNitroNumberFormatFactory.hpp +11 -0
- package/cpp/numberformat/NumberFormatCore.cpp +629 -0
- package/cpp/numberformat/NumberFormatCore.hpp +154 -0
- package/cpp/numberformat/NumberFormatProbe.cpp +354 -0
- package/cpp/numberformat/NumberFormatProbe.hpp +63 -0
- package/cpp/worklets/NitroInputWorkletsBridge.cpp +3 -3
- package/cpp/worklets/NitroInputWorkletsBridge.hpp +1 -1
- package/ios/{HybridMorphInputView.swift → HybridNitroInputView.swift} +16 -1
- package/ios/HybridNitroNumberFormatPlatform.swift +348 -0
- package/ios/HybridNitroNumberView.swift +458 -0
- package/ios/NitroInputView.swift +148 -64
- package/ios/NitroNumberView.swift +2074 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +61 -0
- package/lib/commonjs/src/NitroInput.js +27 -56
- package/lib/commonjs/src/NitroNumber.js +141 -0
- package/lib/commonjs/src/NumberFormat.js +525 -0
- package/lib/commonjs/src/formatProps.js +48 -0
- package/lib/commonjs/src/index.js +6 -3
- package/lib/commonjs/src/specs/NitroNumber.nitro.js +2 -0
- package/lib/commonjs/src/specs/NumberFormat.nitro.js +2 -0
- package/lib/commonjs/src/styleHelpers.js +36 -0
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +61 -0
- package/lib/module/src/NitroInput.js +18 -47
- package/lib/module/src/NitroNumber.js +102 -0
- package/lib/module/src/NumberFormat.js +521 -0
- package/lib/module/src/formatProps.js +45 -0
- package/lib/module/src/index.js +2 -1
- package/lib/module/src/specs/NitroNumber.nitro.js +1 -0
- package/lib/module/src/specs/NumberFormat.nitro.js +1 -0
- package/lib/module/src/styleHelpers.js +32 -0
- package/lib/typescript/src/NitroInput.d.ts +50 -21
- package/lib/typescript/src/NitroNumber.d.ts +246 -0
- package/lib/typescript/src/NumberFormat.d.ts +47 -0
- package/lib/typescript/src/formatProps.d.ts +21 -0
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +19 -9
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +250 -0
- package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +139 -0
- package/lib/typescript/src/styleHelpers.d.ts +3 -0
- package/nitro.json +26 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +10 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +48 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_double_double.hpp +10 -10
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +45 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +10 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.cpp +118 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +590 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +168 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroNumberAffixAlign.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroNumberDirection.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroNumberEasing.hpp +67 -0
- package/nitrogen/generated/android/c++/JNitroNumberRevealStyle.hpp +58 -0
- package/nitrogen/generated/android/c++/JNitroNumberTextAlign.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroNumberTransition.hpp +61 -0
- package/nitrogen/generated/android/c++/JNumberFormatCompactDisplay.hpp +58 -0
- package/nitrogen/generated/android/c++/JNumberFormatCurrencyDisplay.hpp +64 -0
- package/nitrogen/generated/android/c++/JNumberFormatCurrencySign.hpp +58 -0
- package/nitrogen/generated/android/c++/JNumberFormatNotation.hpp +64 -0
- package/nitrogen/generated/android/c++/JNumberFormatPlatformOptions.hpp +161 -0
- package/nitrogen/generated/android/c++/JNumberFormatPlatformSymbols.hpp +89 -0
- package/nitrogen/generated/android/c++/JNumberFormatRoundingMode.hpp +79 -0
- package/nitrogen/generated/android/c++/JNumberFormatSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/JNumberFormatStyle.hpp +64 -0
- package/nitrogen/generated/android/c++/JNumberFormatUnitDisplay.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +25 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +329 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/Func_void.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/Func_void_double_double.kt +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatformSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +399 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroPlatformNumberFormatterSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberAffixAlign.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberDirection.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberEasing.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberRevealStyle.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberTextAlign.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberTransition.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCompactDisplay.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencyDisplay.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencySign.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatNotation.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformOptions.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformSymbols.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatRoundingMode.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatStyle.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatUnitDisplay.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroNumberViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroNumberViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +59 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +311 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +63 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +26 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +30 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.hpp +122 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +474 -0
- package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.hpp +94 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +30 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +450 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double_double.swift +5 -5
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +5 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec_cxx.swift +159 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +108 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +1387 -0
- package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec_cxx.swift +155 -0
- package/nitrogen/generated/ios/swift/NitroNumberAffixAlign.swift +48 -0
- package/nitrogen/generated/ios/swift/NitroNumberDirection.swift +48 -0
- package/nitrogen/generated/ios/swift/NitroNumberEasing.swift +52 -0
- package/nitrogen/generated/ios/swift/NitroNumberRevealStyle.swift +40 -0
- package/nitrogen/generated/ios/swift/NitroNumberTextAlign.swift +48 -0
- package/nitrogen/generated/ios/swift/NitroNumberTransition.swift +44 -0
- package/nitrogen/generated/ios/swift/NumberFormatCompactDisplay.swift +40 -0
- package/nitrogen/generated/ios/swift/NumberFormatCurrencyDisplay.swift +48 -0
- package/nitrogen/generated/ios/swift/NumberFormatCurrencySign.swift +40 -0
- package/nitrogen/generated/ios/swift/NumberFormatNotation.swift +48 -0
- package/nitrogen/generated/ios/swift/NumberFormatPlatformOptions.swift +159 -0
- package/nitrogen/generated/ios/swift/NumberFormatPlatformSymbols.swift +69 -0
- package/nitrogen/generated/ios/swift/NumberFormatRoundingMode.swift +68 -0
- package/nitrogen/generated/ios/swift/NumberFormatSignDisplay.swift +52 -0
- package/nitrogen/generated/ios/swift/NumberFormatStyle.swift +48 -0
- package/nitrogen/generated/ios/swift/NumberFormatUnitDisplay.swift +44 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +10 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +10 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +127 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +187 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/NitroNumberAffixAlign.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroNumberDirection.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroNumberEasing.hpp +88 -0
- package/nitrogen/generated/shared/c++/NitroNumberRevealStyle.hpp +76 -0
- package/nitrogen/generated/shared/c++/NitroNumberTextAlign.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroNumberTransition.hpp +80 -0
- package/nitrogen/generated/shared/c++/NumberFormatCompactDisplay.hpp +76 -0
- package/nitrogen/generated/shared/c++/NumberFormatCurrencyDisplay.hpp +84 -0
- package/nitrogen/generated/shared/c++/NumberFormatCurrencySign.hpp +76 -0
- package/nitrogen/generated/shared/c++/NumberFormatGrouping.hpp +80 -0
- package/nitrogen/generated/shared/c++/NumberFormatNotation.hpp +84 -0
- package/nitrogen/generated/shared/c++/NumberFormatOptions.hpp +193 -0
- package/nitrogen/generated/shared/c++/NumberFormatPart.hpp +87 -0
- package/nitrogen/generated/shared/c++/NumberFormatPlatformOptions.hpp +176 -0
- package/nitrogen/generated/shared/c++/NumberFormatPlatformSymbols.hpp +115 -0
- package/nitrogen/generated/shared/c++/NumberFormatRoundingMode.hpp +104 -0
- package/nitrogen/generated/shared/c++/NumberFormatRoundingPriority.hpp +80 -0
- package/nitrogen/generated/shared/c++/NumberFormatSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/NumberFormatStyle.hpp +84 -0
- package/nitrogen/generated/shared/c++/NumberFormatTrailingZeroDisplay.hpp +76 -0
- package/nitrogen/generated/shared/c++/NumberFormatUnitDisplay.hpp +80 -0
- package/nitrogen/generated/shared/c++/ResolvedNumberFormatOptions.hpp +197 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +10 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +15 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +136 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +245 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +61 -0
- package/package.json +15 -7
- package/src/NitroInput.tsx +79 -67
- package/src/NitroNumber.tsx +531 -0
- package/src/NumberFormat.ts +563 -0
- package/src/formatProps.ts +59 -0
- package/src/index.ts +38 -6
- package/src/specs/NitroInput.nitro.ts +19 -9
- package/src/specs/NitroNumber.nitro.ts +271 -0
- package/src/specs/NumberFormat.nitro.ts +145 -0
- package/src/styleHelpers.ts +32 -0
- package/android/src/main/cpp/JMorphEngine.cpp +0 -132
- package/lib/commonjs/src/MorphInput.js +0 -42
- package/lib/module/src/MorphInput.js +0 -6
- package/lib/typescript/src/MorphInput.d.ts +0 -18
- 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
|