react-native-nitro-input 0.2.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 +38 -0
- package/README.md +43 -1
- package/android/CMakeLists.txt +4 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/cpp/JRollingEngine.cpp +3 -2
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +20 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +209 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +69 -10
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +164 -24
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +2 -1
- package/cpp/RollingEngine.cpp +12 -2
- package/cpp/RollingEngine.hpp +8 -1
- 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/ios/HybridNitroInputView.swift +15 -0
- package/ios/HybridNitroNumberFormatPlatform.swift +348 -0
- package/ios/HybridNitroNumberView.swift +19 -0
- package/ios/NitroInputView.swift +79 -19
- package/ios/NitroNumberView.swift +171 -31
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -0
- package/lib/commonjs/src/NitroInput.js +8 -6
- package/lib/commonjs/src/NitroNumber.js +4 -2
- package/lib/commonjs/src/NumberFormat.js +525 -0
- package/lib/commonjs/src/formatProps.js +48 -0
- package/lib/commonjs/src/index.js +3 -1
- package/lib/commonjs/src/specs/NumberFormat.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -0
- package/lib/module/src/NitroInput.js +8 -6
- package/lib/module/src/NitroNumber.js +4 -2
- package/lib/module/src/NumberFormat.js +521 -0
- package/lib/module/src/formatProps.js +45 -0
- package/lib/module/src/index.js +1 -0
- package/lib/module/src/specs/NumberFormat.nitro.js +1 -0
- package/lib/typescript/src/NitroInput.d.ts +22 -0
- package/lib/typescript/src/NitroNumber.d.ts +36 -1
- 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 +2 -0
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +13 -1
- package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +139 -0
- package/nitro.json +16 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +28 -0
- 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 +54 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +12 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroNumberDirection.hpp +3 -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 +30 -0
- 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 +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroPlatformNumberFormatterSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberDirection.kt +2 -1
- 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/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +63 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +40 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +18 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +12 -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.hpp +42 -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 +36 -0
- 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 +6 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +144 -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/NitroNumberDirection.swift +4 -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 +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/NitroNumberDirection.hpp +4 -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 +12 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +18 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +42 -7
- package/src/NitroNumber.tsx +57 -7
- package/src/NumberFormat.ts +563 -0
- package/src/formatProps.ts +59 -0
- package/src/index.ts +18 -0
- package/src/specs/NitroInput.nitro.ts +10 -0
- package/src/specs/NitroNumber.nitro.ts +13 -1
- package/src/specs/NumberFormat.nitro.ts +145 -0
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `HybridNitroInputViewSpec` to properly resolve imports.
|
|
12
12
|
namespace margelo::nitro::nitroinput { class HybridNitroInputViewSpec; }
|
|
13
|
+
// Forward declaration of `HybridNitroNumberFormatPlatformSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitroinput { class HybridNitroNumberFormatPlatformSpec; }
|
|
13
15
|
// Forward declaration of `HybridNitroNumberViewSpec` to properly resolve imports.
|
|
14
16
|
namespace margelo::nitro::nitroinput { class HybridNitroNumberViewSpec; }
|
|
17
|
+
// Forward declaration of `HybridNitroPlatformNumberFormatterSpec` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::nitroinput { class HybridNitroPlatformNumberFormatterSpec; }
|
|
15
19
|
// Forward declaration of `NitroInputNotation` to properly resolve imports.
|
|
16
20
|
namespace margelo::nitro::nitroinput { struct NitroInputNotation; }
|
|
17
21
|
// Forward declaration of `NitroNumberAffixAlign` to properly resolve imports.
|
|
@@ -30,12 +34,18 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTransition; }
|
|
|
30
34
|
// Forward declarations of Swift defined types
|
|
31
35
|
// Forward declaration of `HybridNitroInputViewSpec_cxx` to properly resolve imports.
|
|
32
36
|
namespace NitroInput { class HybridNitroInputViewSpec_cxx; }
|
|
37
|
+
// Forward declaration of `HybridNitroNumberFormatPlatformSpec_cxx` to properly resolve imports.
|
|
38
|
+
namespace NitroInput { class HybridNitroNumberFormatPlatformSpec_cxx; }
|
|
33
39
|
// Forward declaration of `HybridNitroNumberViewSpec_cxx` to properly resolve imports.
|
|
34
40
|
namespace NitroInput { class HybridNitroNumberViewSpec_cxx; }
|
|
41
|
+
// Forward declaration of `HybridNitroPlatformNumberFormatterSpec_cxx` to properly resolve imports.
|
|
42
|
+
namespace NitroInput { class HybridNitroPlatformNumberFormatterSpec_cxx; }
|
|
35
43
|
|
|
36
44
|
// Include C++ defined types
|
|
37
45
|
#include "HybridNitroInputViewSpec.hpp"
|
|
46
|
+
#include "HybridNitroNumberFormatPlatformSpec.hpp"
|
|
38
47
|
#include "HybridNitroNumberViewSpec.hpp"
|
|
48
|
+
#include "HybridNitroPlatformNumberFormatterSpec.hpp"
|
|
39
49
|
#include "NitroInputNotation.hpp"
|
|
40
50
|
#include "NitroNumberAffixAlign.hpp"
|
|
41
51
|
#include "NitroNumberDirection.hpp"
|
|
@@ -592,5 +602,58 @@ namespace margelo::nitro::nitroinput::bridge::swift {
|
|
|
592
602
|
// pragma MARK: std::weak_ptr<HybridNitroNumberViewSpec>
|
|
593
603
|
using std__weak_ptr_HybridNitroNumberViewSpec_ = std::weak_ptr<HybridNitroNumberViewSpec>;
|
|
594
604
|
inline std__weak_ptr_HybridNitroNumberViewSpec_ weakify_std__shared_ptr_HybridNitroNumberViewSpec_(const std::shared_ptr<HybridNitroNumberViewSpec>& strong) noexcept { return strong; }
|
|
605
|
+
|
|
606
|
+
// pragma MARK: std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>
|
|
607
|
+
/**
|
|
608
|
+
* Specialized version of `std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>`.
|
|
609
|
+
*/
|
|
610
|
+
using std__shared_ptr_HybridNitroPlatformNumberFormatterSpec_ = std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>;
|
|
611
|
+
std::shared_ptr<HybridNitroPlatformNumberFormatterSpec> create_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
612
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec_(std__shared_ptr_HybridNitroPlatformNumberFormatterSpec_ cppType);
|
|
613
|
+
|
|
614
|
+
// pragma MARK: std::weak_ptr<HybridNitroPlatformNumberFormatterSpec>
|
|
615
|
+
using std__weak_ptr_HybridNitroPlatformNumberFormatterSpec_ = std::weak_ptr<HybridNitroPlatformNumberFormatterSpec>;
|
|
616
|
+
inline std__weak_ptr_HybridNitroPlatformNumberFormatterSpec_ weakify_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec_(const std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>& strong) noexcept { return strong; }
|
|
617
|
+
|
|
618
|
+
// pragma MARK: std::vector<std::string>
|
|
619
|
+
/**
|
|
620
|
+
* Specialized version of `std::vector<std::string>`.
|
|
621
|
+
*/
|
|
622
|
+
using std__vector_std__string_ = std::vector<std::string>;
|
|
623
|
+
inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
|
|
624
|
+
std::vector<std::string> vector;
|
|
625
|
+
vector.reserve(size);
|
|
626
|
+
return vector;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// pragma MARK: std::shared_ptr<HybridNitroNumberFormatPlatformSpec>
|
|
630
|
+
/**
|
|
631
|
+
* Specialized version of `std::shared_ptr<HybridNitroNumberFormatPlatformSpec>`.
|
|
632
|
+
*/
|
|
633
|
+
using std__shared_ptr_HybridNitroNumberFormatPlatformSpec_ = std::shared_ptr<HybridNitroNumberFormatPlatformSpec>;
|
|
634
|
+
std::shared_ptr<HybridNitroNumberFormatPlatformSpec> create_std__shared_ptr_HybridNitroNumberFormatPlatformSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
635
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroNumberFormatPlatformSpec_(std__shared_ptr_HybridNitroNumberFormatPlatformSpec_ cppType);
|
|
636
|
+
|
|
637
|
+
// pragma MARK: std::weak_ptr<HybridNitroNumberFormatPlatformSpec>
|
|
638
|
+
using std__weak_ptr_HybridNitroNumberFormatPlatformSpec_ = std::weak_ptr<HybridNitroNumberFormatPlatformSpec>;
|
|
639
|
+
inline std__weak_ptr_HybridNitroNumberFormatPlatformSpec_ weakify_std__shared_ptr_HybridNitroNumberFormatPlatformSpec_(const std::shared_ptr<HybridNitroNumberFormatPlatformSpec>& strong) noexcept { return strong; }
|
|
640
|
+
|
|
641
|
+
// pragma MARK: Result<std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>>
|
|
642
|
+
using Result_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec__ = Result<std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>>;
|
|
643
|
+
inline Result_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec__ create_Result_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec__(const std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>& value) noexcept {
|
|
644
|
+
return Result<std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>>::withValue(value);
|
|
645
|
+
}
|
|
646
|
+
inline Result_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec__ create_Result_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec__(const std::exception_ptr& error) noexcept {
|
|
647
|
+
return Result<std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>>::withError(error);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// pragma MARK: Result<std::vector<std::string>>
|
|
651
|
+
using Result_std__vector_std__string__ = Result<std::vector<std::string>>;
|
|
652
|
+
inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::vector<std::string>& value) noexcept {
|
|
653
|
+
return Result<std::vector<std::string>>::withValue(value);
|
|
654
|
+
}
|
|
655
|
+
inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::exception_ptr& error) noexcept {
|
|
656
|
+
return Result<std::vector<std::string>>::withError(error);
|
|
657
|
+
}
|
|
595
658
|
|
|
596
659
|
} // namespace margelo::nitro::nitroinput::bridge::swift
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `HybridNitroInputViewSpec` to properly resolve imports.
|
|
12
12
|
namespace margelo::nitro::nitroinput { class HybridNitroInputViewSpec; }
|
|
13
|
+
// Forward declaration of `HybridNitroNumberFormatPlatformSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitroinput { class HybridNitroNumberFormatPlatformSpec; }
|
|
13
15
|
// Forward declaration of `HybridNitroNumberViewSpec` to properly resolve imports.
|
|
14
16
|
namespace margelo::nitro::nitroinput { class HybridNitroNumberViewSpec; }
|
|
17
|
+
// Forward declaration of `HybridNitroPlatformNumberFormatterSpec` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::nitroinput { class HybridNitroPlatformNumberFormatterSpec; }
|
|
15
19
|
// Forward declaration of `NitroInputAffixAlign` to properly resolve imports.
|
|
16
20
|
namespace margelo::nitro::nitroinput { enum class NitroInputAffixAlign; }
|
|
17
21
|
// Forward declaration of `NitroInputAutoCapitalize` to properly resolve imports.
|
|
@@ -54,10 +58,32 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberRevealStyle; }
|
|
|
54
58
|
namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
|
|
55
59
|
// Forward declaration of `NitroNumberTransition` to properly resolve imports.
|
|
56
60
|
namespace margelo::nitro::nitroinput { enum class NitroNumberTransition; }
|
|
61
|
+
// Forward declaration of `NumberFormatCompactDisplay` to properly resolve imports.
|
|
62
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatCompactDisplay; }
|
|
63
|
+
// Forward declaration of `NumberFormatCurrencyDisplay` to properly resolve imports.
|
|
64
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatCurrencyDisplay; }
|
|
65
|
+
// Forward declaration of `NumberFormatCurrencySign` to properly resolve imports.
|
|
66
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatCurrencySign; }
|
|
67
|
+
// Forward declaration of `NumberFormatNotation` to properly resolve imports.
|
|
68
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatNotation; }
|
|
69
|
+
// Forward declaration of `NumberFormatPlatformOptions` to properly resolve imports.
|
|
70
|
+
namespace margelo::nitro::nitroinput { struct NumberFormatPlatformOptions; }
|
|
71
|
+
// Forward declaration of `NumberFormatPlatformSymbols` to properly resolve imports.
|
|
72
|
+
namespace margelo::nitro::nitroinput { struct NumberFormatPlatformSymbols; }
|
|
73
|
+
// Forward declaration of `NumberFormatRoundingMode` to properly resolve imports.
|
|
74
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatRoundingMode; }
|
|
75
|
+
// Forward declaration of `NumberFormatSignDisplay` to properly resolve imports.
|
|
76
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatSignDisplay; }
|
|
77
|
+
// Forward declaration of `NumberFormatStyle` to properly resolve imports.
|
|
78
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatStyle; }
|
|
79
|
+
// Forward declaration of `NumberFormatUnitDisplay` to properly resolve imports.
|
|
80
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
|
|
57
81
|
|
|
58
82
|
// Include C++ defined types
|
|
59
83
|
#include "HybridNitroInputViewSpec.hpp"
|
|
84
|
+
#include "HybridNitroNumberFormatPlatformSpec.hpp"
|
|
60
85
|
#include "HybridNitroNumberViewSpec.hpp"
|
|
86
|
+
#include "HybridNitroPlatformNumberFormatterSpec.hpp"
|
|
61
87
|
#include "NitroInputAffixAlign.hpp"
|
|
62
88
|
#include "NitroInputAutoCapitalize.hpp"
|
|
63
89
|
#include "NitroInputEasing.hpp"
|
|
@@ -79,6 +105,16 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTransition; }
|
|
|
79
105
|
#include "NitroNumberRevealStyle.hpp"
|
|
80
106
|
#include "NitroNumberTextAlign.hpp"
|
|
81
107
|
#include "NitroNumberTransition.hpp"
|
|
108
|
+
#include "NumberFormatCompactDisplay.hpp"
|
|
109
|
+
#include "NumberFormatCurrencyDisplay.hpp"
|
|
110
|
+
#include "NumberFormatCurrencySign.hpp"
|
|
111
|
+
#include "NumberFormatNotation.hpp"
|
|
112
|
+
#include "NumberFormatPlatformOptions.hpp"
|
|
113
|
+
#include "NumberFormatPlatformSymbols.hpp"
|
|
114
|
+
#include "NumberFormatRoundingMode.hpp"
|
|
115
|
+
#include "NumberFormatSignDisplay.hpp"
|
|
116
|
+
#include "NumberFormatStyle.hpp"
|
|
117
|
+
#include "NumberFormatUnitDisplay.hpp"
|
|
82
118
|
#include <NitroModules/Result.hpp>
|
|
83
119
|
#include <exception>
|
|
84
120
|
#include <functional>
|
|
@@ -99,8 +135,12 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTransition; }
|
|
|
99
135
|
// Forward declarations of Swift defined types
|
|
100
136
|
// Forward declaration of `HybridNitroInputViewSpec_cxx` to properly resolve imports.
|
|
101
137
|
namespace NitroInput { class HybridNitroInputViewSpec_cxx; }
|
|
138
|
+
// Forward declaration of `HybridNitroNumberFormatPlatformSpec_cxx` to properly resolve imports.
|
|
139
|
+
namespace NitroInput { class HybridNitroNumberFormatPlatformSpec_cxx; }
|
|
102
140
|
// Forward declaration of `HybridNitroNumberViewSpec_cxx` to properly resolve imports.
|
|
103
141
|
namespace NitroInput { class HybridNitroNumberViewSpec_cxx; }
|
|
142
|
+
// Forward declaration of `HybridNitroPlatformNumberFormatterSpec_cxx` to properly resolve imports.
|
|
143
|
+
namespace NitroInput { class HybridNitroPlatformNumberFormatterSpec_cxx; }
|
|
104
144
|
|
|
105
145
|
// Include Swift defined types
|
|
106
146
|
#if __has_include("NitroInput-Swift.h")
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
#include "HybridNitroInputViewSpecSwift.hpp"
|
|
14
14
|
#include "HybridNitroInputWorklets.hpp"
|
|
15
15
|
#include "HybridNitroNumberViewSpecSwift.hpp"
|
|
16
|
+
#include "HybridNitroNumberFormatFactory.hpp"
|
|
17
|
+
#include "HybridNitroNumberFormatPlatformSpecSwift.hpp"
|
|
16
18
|
|
|
17
19
|
@interface NitroInputAutolinking : NSObject
|
|
18
20
|
@end
|
|
@@ -46,6 +48,22 @@
|
|
|
46
48
|
return hybridObject;
|
|
47
49
|
}
|
|
48
50
|
);
|
|
51
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
52
|
+
"NitroNumberFormatFactory",
|
|
53
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
54
|
+
static_assert(std::is_default_constructible_v<HybridNitroNumberFormatFactory>,
|
|
55
|
+
"The HybridObject \"HybridNitroNumberFormatFactory\" is not default-constructible! "
|
|
56
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
57
|
+
return std::make_shared<HybridNitroNumberFormatFactory>();
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
61
|
+
"NitroNumberFormatPlatform",
|
|
62
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
63
|
+
std::shared_ptr<HybridNitroNumberFormatPlatformSpec> hybridObject = NitroInput::NitroInputAutolinking::createNitroNumberFormatPlatform();
|
|
64
|
+
return hybridObject;
|
|
65
|
+
}
|
|
66
|
+
);
|
|
49
67
|
}
|
|
50
68
|
|
|
51
69
|
@end
|
|
@@ -35,4 +35,16 @@ public final class NitroInputAutolinking {
|
|
|
35
35
|
public static func isNitroNumberViewRecyclable() -> Bool {
|
|
36
36
|
return HybridNitroNumberView.self is any RecyclableView.Type
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
public static func createNitroNumberFormatPlatform() -> bridge.std__shared_ptr_HybridNitroNumberFormatPlatformSpec_ {
|
|
40
|
+
let hybridObject = HybridNitroNumberFormatPlatform()
|
|
41
|
+
return { () -> bridge.std__shared_ptr_HybridNitroNumberFormatPlatformSpec_ in
|
|
42
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
43
|
+
return __cxxWrapped.getCxxPart()
|
|
44
|
+
}()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static func isNitroNumberFormatPlatformRecyclable() -> Bool {
|
|
48
|
+
return HybridNitroNumberFormatPlatform.self is any RecyclableView.Type
|
|
49
|
+
}
|
|
38
50
|
}
|
|
@@ -303,6 +303,36 @@ namespace margelo::nitro::nitroinput {
|
|
|
303
303
|
inline void setSuffixAlign(NitroInputAffixAlign suffixAlign) noexcept override {
|
|
304
304
|
_swiftPart.setSuffixAlign(static_cast<int>(suffixAlign));
|
|
305
305
|
}
|
|
306
|
+
inline double getLetterSpacing() noexcept override {
|
|
307
|
+
return _swiftPart.getLetterSpacing();
|
|
308
|
+
}
|
|
309
|
+
inline void setLetterSpacing(double letterSpacing) noexcept override {
|
|
310
|
+
_swiftPart.setLetterSpacing(std::forward<decltype(letterSpacing)>(letterSpacing));
|
|
311
|
+
}
|
|
312
|
+
inline double getPrefixSpacing() noexcept override {
|
|
313
|
+
return _swiftPart.getPrefixSpacing();
|
|
314
|
+
}
|
|
315
|
+
inline void setPrefixSpacing(double prefixSpacing) noexcept override {
|
|
316
|
+
_swiftPart.setPrefixSpacing(std::forward<decltype(prefixSpacing)>(prefixSpacing));
|
|
317
|
+
}
|
|
318
|
+
inline double getSuffixSpacing() noexcept override {
|
|
319
|
+
return _swiftPart.getSuffixSpacing();
|
|
320
|
+
}
|
|
321
|
+
inline void setSuffixSpacing(double suffixSpacing) noexcept override {
|
|
322
|
+
_swiftPart.setSuffixSpacing(std::forward<decltype(suffixSpacing)>(suffixSpacing));
|
|
323
|
+
}
|
|
324
|
+
inline double getPrefixOffset() noexcept override {
|
|
325
|
+
return _swiftPart.getPrefixOffset();
|
|
326
|
+
}
|
|
327
|
+
inline void setPrefixOffset(double prefixOffset) noexcept override {
|
|
328
|
+
_swiftPart.setPrefixOffset(std::forward<decltype(prefixOffset)>(prefixOffset));
|
|
329
|
+
}
|
|
330
|
+
inline double getSuffixOffset() noexcept override {
|
|
331
|
+
return _swiftPart.getSuffixOffset();
|
|
332
|
+
}
|
|
333
|
+
inline void setSuffixOffset(double suffixOffset) noexcept override {
|
|
334
|
+
_swiftPart.setSuffixOffset(std::forward<decltype(suffixOffset)>(suffixOffset));
|
|
335
|
+
}
|
|
306
336
|
inline std::string getPlaceholder() noexcept override {
|
|
307
337
|
auto __result = _swiftPart.getPlaceholder();
|
|
308
338
|
return __result;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroNumberFormatPlatformSpecSwift.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 "HybridNitroNumberFormatPlatformSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitroinput {
|
|
11
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroNumberFormatPlatformSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridNitroNumberFormatPlatformSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridNitroNumberFormatPlatformSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroInput { class HybridNitroNumberFormatPlatformSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `HybridNitroPlatformNumberFormatterSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitroinput { class HybridNitroPlatformNumberFormatterSpec; }
|
|
17
|
+
// Forward declaration of `NumberFormatPlatformOptions` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::nitroinput { struct NumberFormatPlatformOptions; }
|
|
19
|
+
// Forward declaration of `NumberFormatStyle` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatStyle; }
|
|
21
|
+
// Forward declaration of `NumberFormatCurrencyDisplay` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatCurrencyDisplay; }
|
|
23
|
+
// Forward declaration of `NumberFormatCurrencySign` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatCurrencySign; }
|
|
25
|
+
// Forward declaration of `NumberFormatUnitDisplay` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
|
|
27
|
+
// Forward declaration of `NumberFormatNotation` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatNotation; }
|
|
29
|
+
// Forward declaration of `NumberFormatCompactDisplay` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatCompactDisplay; }
|
|
31
|
+
// Forward declaration of `NumberFormatRoundingMode` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatRoundingMode; }
|
|
33
|
+
// Forward declaration of `NumberFormatSignDisplay` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::nitroinput { enum class NumberFormatSignDisplay; }
|
|
35
|
+
|
|
36
|
+
#include <memory>
|
|
37
|
+
#include "HybridNitroPlatformNumberFormatterSpec.hpp"
|
|
38
|
+
#include "NumberFormatPlatformOptions.hpp"
|
|
39
|
+
#include <string>
|
|
40
|
+
#include <vector>
|
|
41
|
+
#include <optional>
|
|
42
|
+
#include "NumberFormatStyle.hpp"
|
|
43
|
+
#include "NumberFormatCurrencyDisplay.hpp"
|
|
44
|
+
#include "NumberFormatCurrencySign.hpp"
|
|
45
|
+
#include "NumberFormatUnitDisplay.hpp"
|
|
46
|
+
#include "NumberFormatNotation.hpp"
|
|
47
|
+
#include "NumberFormatCompactDisplay.hpp"
|
|
48
|
+
#include "NumberFormatRoundingMode.hpp"
|
|
49
|
+
#include "NumberFormatSignDisplay.hpp"
|
|
50
|
+
|
|
51
|
+
#include "NitroInput-Swift-Cxx-Umbrella.hpp"
|
|
52
|
+
|
|
53
|
+
namespace margelo::nitro::nitroinput {
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The C++ part of HybridNitroNumberFormatPlatformSpec_cxx.swift.
|
|
57
|
+
*
|
|
58
|
+
* HybridNitroNumberFormatPlatformSpecSwift (C++) accesses HybridNitroNumberFormatPlatformSpec_cxx (Swift), and might
|
|
59
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
60
|
+
*
|
|
61
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
62
|
+
* the future, HybridNitroNumberFormatPlatformSpec_cxx can directly inherit from the C++ class HybridNitroNumberFormatPlatformSpec
|
|
63
|
+
* to simplify the whole structure and memory management.
|
|
64
|
+
*/
|
|
65
|
+
class HybridNitroNumberFormatPlatformSpecSwift: public virtual HybridNitroNumberFormatPlatformSpec {
|
|
66
|
+
public:
|
|
67
|
+
// Constructor from a Swift instance
|
|
68
|
+
explicit HybridNitroNumberFormatPlatformSpecSwift(const NitroInput::HybridNitroNumberFormatPlatformSpec_cxx& swiftPart):
|
|
69
|
+
HybridObject(HybridNitroNumberFormatPlatformSpec::TAG),
|
|
70
|
+
_swiftPart(swiftPart) { }
|
|
71
|
+
|
|
72
|
+
public:
|
|
73
|
+
// Get the Swift part
|
|
74
|
+
inline NitroInput::HybridNitroNumberFormatPlatformSpec_cxx& getSwiftPart() noexcept {
|
|
75
|
+
return _swiftPart;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public:
|
|
79
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
80
|
+
return _swiftPart.getMemorySize();
|
|
81
|
+
}
|
|
82
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
83
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNitroNumberFormatPlatformSpecSwift>(other)) {
|
|
84
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
void dispose() noexcept override {
|
|
89
|
+
_swiftPart.dispose();
|
|
90
|
+
}
|
|
91
|
+
std::string toString() override {
|
|
92
|
+
return _swiftPart.toString();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public:
|
|
96
|
+
// Properties
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
public:
|
|
100
|
+
// Methods
|
|
101
|
+
inline std::shared_ptr<HybridNitroPlatformNumberFormatterSpec> create(const NumberFormatPlatformOptions& options) override {
|
|
102
|
+
auto __result = _swiftPart.create(std::forward<decltype(options)>(options));
|
|
103
|
+
if (__result.hasError()) [[unlikely]] {
|
|
104
|
+
std::rethrow_exception(__result.error());
|
|
105
|
+
}
|
|
106
|
+
auto __value = std::move(__result.value());
|
|
107
|
+
return __value;
|
|
108
|
+
}
|
|
109
|
+
inline std::vector<std::string> supportedLocalesOf(const std::vector<std::string>& locales) override {
|
|
110
|
+
auto __result = _swiftPart.supportedLocalesOf(locales);
|
|
111
|
+
if (__result.hasError()) [[unlikely]] {
|
|
112
|
+
std::rethrow_exception(__result.error());
|
|
113
|
+
}
|
|
114
|
+
auto __value = std::move(__result.value());
|
|
115
|
+
return __value;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private:
|
|
119
|
+
NitroInput::HybridNitroNumberFormatPlatformSpec_cxx _swiftPart;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -319,6 +319,48 @@ namespace margelo::nitro::nitroinput {
|
|
|
319
319
|
inline void setSuffixAlign(std::optional<NitroNumberAffixAlign> suffixAlign) noexcept override {
|
|
320
320
|
_swiftPart.setSuffixAlign(suffixAlign);
|
|
321
321
|
}
|
|
322
|
+
inline std::optional<double> getLetterSpacing() noexcept override {
|
|
323
|
+
auto __result = _swiftPart.getLetterSpacing();
|
|
324
|
+
return __result;
|
|
325
|
+
}
|
|
326
|
+
inline void setLetterSpacing(std::optional<double> letterSpacing) noexcept override {
|
|
327
|
+
_swiftPart.setLetterSpacing(letterSpacing);
|
|
328
|
+
}
|
|
329
|
+
inline std::optional<double> getPrefixSpacing() noexcept override {
|
|
330
|
+
auto __result = _swiftPart.getPrefixSpacing();
|
|
331
|
+
return __result;
|
|
332
|
+
}
|
|
333
|
+
inline void setPrefixSpacing(std::optional<double> prefixSpacing) noexcept override {
|
|
334
|
+
_swiftPart.setPrefixSpacing(prefixSpacing);
|
|
335
|
+
}
|
|
336
|
+
inline std::optional<double> getSuffixSpacing() noexcept override {
|
|
337
|
+
auto __result = _swiftPart.getSuffixSpacing();
|
|
338
|
+
return __result;
|
|
339
|
+
}
|
|
340
|
+
inline void setSuffixSpacing(std::optional<double> suffixSpacing) noexcept override {
|
|
341
|
+
_swiftPart.setSuffixSpacing(suffixSpacing);
|
|
342
|
+
}
|
|
343
|
+
inline std::optional<double> getPrefixOffset() noexcept override {
|
|
344
|
+
auto __result = _swiftPart.getPrefixOffset();
|
|
345
|
+
return __result;
|
|
346
|
+
}
|
|
347
|
+
inline void setPrefixOffset(std::optional<double> prefixOffset) noexcept override {
|
|
348
|
+
_swiftPart.setPrefixOffset(prefixOffset);
|
|
349
|
+
}
|
|
350
|
+
inline std::optional<double> getSuffixOffset() noexcept override {
|
|
351
|
+
auto __result = _swiftPart.getSuffixOffset();
|
|
352
|
+
return __result;
|
|
353
|
+
}
|
|
354
|
+
inline void setSuffixOffset(std::optional<double> suffixOffset) noexcept override {
|
|
355
|
+
_swiftPart.setSuffixOffset(suffixOffset);
|
|
356
|
+
}
|
|
357
|
+
inline std::optional<bool> getTabularNums() noexcept override {
|
|
358
|
+
auto __result = _swiftPart.getTabularNums();
|
|
359
|
+
return __result;
|
|
360
|
+
}
|
|
361
|
+
inline void setTabularNums(std::optional<bool> tabularNums) noexcept override {
|
|
362
|
+
_swiftPart.setTabularNums(tabularNums);
|
|
363
|
+
}
|
|
322
364
|
inline std::optional<bool> getAdjustsFontSizeToFit() noexcept override {
|
|
323
365
|
auto __result = _swiftPart.getAdjustsFontSizeToFit();
|
|
324
366
|
return __result;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroPlatformNumberFormatterSpecSwift.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 "HybridNitroPlatformNumberFormatterSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitroinput {
|
|
11
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroPlatformNumberFormatterSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridNitroPlatformNumberFormatterSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridNitroPlatformNumberFormatterSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroInput { class HybridNitroPlatformNumberFormatterSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `NumberFormatPlatformSymbols` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitroinput { struct NumberFormatPlatformSymbols; }
|
|
17
|
+
|
|
18
|
+
#include "NumberFormatPlatformSymbols.hpp"
|
|
19
|
+
#include <string>
|
|
20
|
+
|
|
21
|
+
#include "NitroInput-Swift-Cxx-Umbrella.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::nitroinput {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ part of HybridNitroPlatformNumberFormatterSpec_cxx.swift.
|
|
27
|
+
*
|
|
28
|
+
* HybridNitroPlatformNumberFormatterSpecSwift (C++) accesses HybridNitroPlatformNumberFormatterSpec_cxx (Swift), and might
|
|
29
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
30
|
+
*
|
|
31
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
32
|
+
* the future, HybridNitroPlatformNumberFormatterSpec_cxx can directly inherit from the C++ class HybridNitroPlatformNumberFormatterSpec
|
|
33
|
+
* to simplify the whole structure and memory management.
|
|
34
|
+
*/
|
|
35
|
+
class HybridNitroPlatformNumberFormatterSpecSwift: public virtual HybridNitroPlatformNumberFormatterSpec {
|
|
36
|
+
public:
|
|
37
|
+
// Constructor from a Swift instance
|
|
38
|
+
explicit HybridNitroPlatformNumberFormatterSpecSwift(const NitroInput::HybridNitroPlatformNumberFormatterSpec_cxx& swiftPart):
|
|
39
|
+
HybridObject(HybridNitroPlatformNumberFormatterSpec::TAG),
|
|
40
|
+
_swiftPart(swiftPart) { }
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
// Get the Swift part
|
|
44
|
+
inline NitroInput::HybridNitroPlatformNumberFormatterSpec_cxx& getSwiftPart() noexcept {
|
|
45
|
+
return _swiftPart;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
50
|
+
return _swiftPart.getMemorySize();
|
|
51
|
+
}
|
|
52
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
53
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNitroPlatformNumberFormatterSpecSwift>(other)) {
|
|
54
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
void dispose() noexcept override {
|
|
59
|
+
_swiftPart.dispose();
|
|
60
|
+
}
|
|
61
|
+
std::string toString() override {
|
|
62
|
+
return _swiftPart.toString();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
// Properties
|
|
67
|
+
inline NumberFormatPlatformSymbols getSymbols() noexcept override {
|
|
68
|
+
return _swiftPart.getSymbols();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public:
|
|
72
|
+
// Methods
|
|
73
|
+
inline std::string format(double value) override {
|
|
74
|
+
auto __result = _swiftPart.format(std::forward<decltype(value)>(value));
|
|
75
|
+
if (__result.hasError()) [[unlikely]] {
|
|
76
|
+
std::rethrow_exception(__result.error());
|
|
77
|
+
}
|
|
78
|
+
auto __value = std::move(__result.value());
|
|
79
|
+
return __value;
|
|
80
|
+
}
|
|
81
|
+
inline std::string formatDecimal(const std::string& value) override {
|
|
82
|
+
auto __result = _swiftPart.formatDecimal(value);
|
|
83
|
+
if (__result.hasError()) [[unlikely]] {
|
|
84
|
+
std::rethrow_exception(__result.error());
|
|
85
|
+
}
|
|
86
|
+
auto __value = std::move(__result.value());
|
|
87
|
+
return __value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private:
|
|
91
|
+
NitroInput::HybridNitroPlatformNumberFormatterSpec_cxx _swiftPart;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -278,6 +278,36 @@ using namespace margelo::nitro::nitroinput::views;
|
|
|
278
278
|
: !newViewProps.suffixAlign.hasSameValue(oldViewProps->suffixAlign)) {
|
|
279
279
|
swiftPart.setSuffixAlign(static_cast<int>(newViewProps.suffixAlign.get()));
|
|
280
280
|
}
|
|
281
|
+
// letterSpacing: number
|
|
282
|
+
if (oldViewProps == nullptr
|
|
283
|
+
? newViewProps.letterSpacing.isProvided()
|
|
284
|
+
: !newViewProps.letterSpacing.hasSameValue(oldViewProps->letterSpacing)) {
|
|
285
|
+
swiftPart.setLetterSpacing(newViewProps.letterSpacing.get());
|
|
286
|
+
}
|
|
287
|
+
// prefixSpacing: number
|
|
288
|
+
if (oldViewProps == nullptr
|
|
289
|
+
? newViewProps.prefixSpacing.isProvided()
|
|
290
|
+
: !newViewProps.prefixSpacing.hasSameValue(oldViewProps->prefixSpacing)) {
|
|
291
|
+
swiftPart.setPrefixSpacing(newViewProps.prefixSpacing.get());
|
|
292
|
+
}
|
|
293
|
+
// suffixSpacing: number
|
|
294
|
+
if (oldViewProps == nullptr
|
|
295
|
+
? newViewProps.suffixSpacing.isProvided()
|
|
296
|
+
: !newViewProps.suffixSpacing.hasSameValue(oldViewProps->suffixSpacing)) {
|
|
297
|
+
swiftPart.setSuffixSpacing(newViewProps.suffixSpacing.get());
|
|
298
|
+
}
|
|
299
|
+
// prefixOffset: number
|
|
300
|
+
if (oldViewProps == nullptr
|
|
301
|
+
? newViewProps.prefixOffset.isProvided()
|
|
302
|
+
: !newViewProps.prefixOffset.hasSameValue(oldViewProps->prefixOffset)) {
|
|
303
|
+
swiftPart.setPrefixOffset(newViewProps.prefixOffset.get());
|
|
304
|
+
}
|
|
305
|
+
// suffixOffset: number
|
|
306
|
+
if (oldViewProps == nullptr
|
|
307
|
+
? newViewProps.suffixOffset.isProvided()
|
|
308
|
+
: !newViewProps.suffixOffset.hasSameValue(oldViewProps->suffixOffset)) {
|
|
309
|
+
swiftPart.setSuffixOffset(newViewProps.suffixOffset.get());
|
|
310
|
+
}
|
|
281
311
|
// placeholder: string
|
|
282
312
|
if (oldViewProps == nullptr
|
|
283
313
|
? newViewProps.placeholder.isProvided()
|
|
@@ -302,6 +302,42 @@ using namespace margelo::nitro::nitroinput::views;
|
|
|
302
302
|
: !newViewProps.suffixAlign.hasSameValue(oldViewProps->suffixAlign)) {
|
|
303
303
|
swiftPart.setSuffixAlign(newViewProps.suffixAlign.get());
|
|
304
304
|
}
|
|
305
|
+
// letterSpacing: optional
|
|
306
|
+
if (oldViewProps == nullptr
|
|
307
|
+
? newViewProps.letterSpacing.isProvided()
|
|
308
|
+
: !newViewProps.letterSpacing.hasSameValue(oldViewProps->letterSpacing)) {
|
|
309
|
+
swiftPart.setLetterSpacing(newViewProps.letterSpacing.get());
|
|
310
|
+
}
|
|
311
|
+
// prefixSpacing: optional
|
|
312
|
+
if (oldViewProps == nullptr
|
|
313
|
+
? newViewProps.prefixSpacing.isProvided()
|
|
314
|
+
: !newViewProps.prefixSpacing.hasSameValue(oldViewProps->prefixSpacing)) {
|
|
315
|
+
swiftPart.setPrefixSpacing(newViewProps.prefixSpacing.get());
|
|
316
|
+
}
|
|
317
|
+
// suffixSpacing: optional
|
|
318
|
+
if (oldViewProps == nullptr
|
|
319
|
+
? newViewProps.suffixSpacing.isProvided()
|
|
320
|
+
: !newViewProps.suffixSpacing.hasSameValue(oldViewProps->suffixSpacing)) {
|
|
321
|
+
swiftPart.setSuffixSpacing(newViewProps.suffixSpacing.get());
|
|
322
|
+
}
|
|
323
|
+
// prefixOffset: optional
|
|
324
|
+
if (oldViewProps == nullptr
|
|
325
|
+
? newViewProps.prefixOffset.isProvided()
|
|
326
|
+
: !newViewProps.prefixOffset.hasSameValue(oldViewProps->prefixOffset)) {
|
|
327
|
+
swiftPart.setPrefixOffset(newViewProps.prefixOffset.get());
|
|
328
|
+
}
|
|
329
|
+
// suffixOffset: optional
|
|
330
|
+
if (oldViewProps == nullptr
|
|
331
|
+
? newViewProps.suffixOffset.isProvided()
|
|
332
|
+
: !newViewProps.suffixOffset.hasSameValue(oldViewProps->suffixOffset)) {
|
|
333
|
+
swiftPart.setSuffixOffset(newViewProps.suffixOffset.get());
|
|
334
|
+
}
|
|
335
|
+
// tabularNums: optional
|
|
336
|
+
if (oldViewProps == nullptr
|
|
337
|
+
? newViewProps.tabularNums.isProvided()
|
|
338
|
+
: !newViewProps.tabularNums.hasSameValue(oldViewProps->tabularNums)) {
|
|
339
|
+
swiftPart.setTabularNums(newViewProps.tabularNums.get());
|
|
340
|
+
}
|
|
305
341
|
// adjustsFontSizeToFit: optional
|
|
306
342
|
if (oldViewProps == nullptr
|
|
307
343
|
? newViewProps.adjustsFontSizeToFit.isProvided()
|
|
@@ -40,6 +40,11 @@ public protocol HybridNitroInputViewSpec_protocol: HybridObject, HybridView {
|
|
|
40
40
|
var signPlacement: NitroInputSignPlacement { get set }
|
|
41
41
|
var prefixAlign: NitroInputAffixAlign { get set }
|
|
42
42
|
var suffixAlign: NitroInputAffixAlign { get set }
|
|
43
|
+
var letterSpacing: Double { get set }
|
|
44
|
+
var prefixSpacing: Double { get set }
|
|
45
|
+
var suffixSpacing: Double { get set }
|
|
46
|
+
var prefixOffset: Double { get set }
|
|
47
|
+
var suffixOffset: Double { get set }
|
|
43
48
|
var placeholder: String { get set }
|
|
44
49
|
var placeholderColor: Double { get set }
|
|
45
50
|
var duration: Double { get set }
|