react-native-nitro-input 0.3.0 → 0.3.1
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 +49 -0
- package/README.md +90 -2
- package/android/src/main/cpp/JReflowEngine.cpp +32 -0
- package/android/src/main/cpp/JReflowEngine.hpp +13 -0
- package/android/src/main/cpp/JRollingEngine.cpp +42 -2
- package/android/src/main/cpp/JRollingEngine.hpp +9 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +76 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +88 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +388 -136
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +13 -2
- package/cpp/RollingEngine.cpp +92 -8
- package/cpp/RollingEngine.hpp +36 -2
- package/ios/HybridNitroNumberFormatPlatform.swift +87 -9
- package/ios/HybridNitroNumberView.swift +82 -1
- package/ios/HybridNitroTextView.swift +134 -0
- package/ios/NitroNumberView.swift +368 -135
- package/ios/NitroTextView.swift +583 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/commonjs/src/NitroNumber.js +52 -3
- package/lib/commonjs/src/NitroText.js +138 -0
- package/lib/commonjs/src/NitroTime.js +65 -0
- package/lib/commonjs/src/formatProps.js +76 -16
- package/lib/commonjs/src/index.js +6 -1
- package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/module/src/NitroNumber.js +53 -4
- package/lib/module/src/NitroText.js +98 -0
- package/lib/module/src/NitroTime.js +29 -0
- package/lib/module/src/formatProps.js +76 -17
- package/lib/module/src/index.js +2 -0
- package/lib/module/src/specs/NitroText.nitro.js +1 -0
- package/lib/typescript/src/NitroNumber.d.ts +79 -1
- package/lib/typescript/src/NitroText.d.ts +67 -0
- package/lib/typescript/src/NitroTime.d.ts +19 -0
- package/lib/typescript/src/formatProps.d.ts +30 -4
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +67 -0
- package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +34 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +243 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +40 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
- package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +100 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +132 -11
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +146 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +120 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +20 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +493 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
- package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +46 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +40 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +62 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/package.json +1 -1
- package/src/NitroNumber.tsx +183 -9
- package/src/NitroText.tsx +166 -0
- package/src/NitroTime.tsx +68 -0
- package/src/formatProps.ts +108 -18
- package/src/index.ts +5 -0
- package/src/specs/NitroNumber.nitro.ts +69 -0
- package/src/specs/NitroText.nitro.ts +65 -0
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextViewSpec_cxx.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A class implementation that bridges HybridNitroTextViewSpec over to C++.
|
|
12
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
+
*
|
|
14
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
+
*/
|
|
19
|
+
open class HybridNitroTextViewSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::nitroinput::bridge::swift`)
|
|
22
|
+
* from `NitroInput-Swift-Cxx-Bridge.hpp`.
|
|
23
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
+
*/
|
|
25
|
+
public typealias bridge = margelo.nitro.nitroinput.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridNitroTextViewSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridNitroTextViewSpec
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
+
*/
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridNitroTextViewSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridNitroTextViewSpec_cxx` that wraps the given `HybridNitroTextViewSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridNitroTextViewSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridNitroTextViewSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridNitroTextViewSpec() -> any HybridNitroTextViewSpec {
|
|
52
|
+
return __implementation
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
+
* This acquires one additional strong reference on the object!
|
|
58
|
+
*/
|
|
59
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Casts an unsafe pointer to a `HybridNitroTextViewSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridNitroTextViewSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNitroTextViewSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridNitroTextViewSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridNitroTextViewSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridNitroTextViewSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridNitroTextViewSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridNitroTextViewSpec_(newCxxPart)
|
|
83
|
+
return newCxxPart
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
+
*/
|
|
93
|
+
@inline(__always)
|
|
94
|
+
public var memorySize: Int {
|
|
95
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridNitroTextViewSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Call dispose() on the Swift class.
|
|
108
|
+
* This _may_ be called manually from JS.
|
|
109
|
+
*/
|
|
110
|
+
@inline(__always)
|
|
111
|
+
public func dispose() {
|
|
112
|
+
self.__implementation.dispose()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Properties
|
|
124
|
+
public final var text: std.string {
|
|
125
|
+
@inline(__always)
|
|
126
|
+
get {
|
|
127
|
+
return std.string(self.__implementation.text)
|
|
128
|
+
}
|
|
129
|
+
@inline(__always)
|
|
130
|
+
set {
|
|
131
|
+
self.__implementation.text = String(newValue)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public final var fontSize: bridge.std__optional_double_ {
|
|
136
|
+
@inline(__always)
|
|
137
|
+
get {
|
|
138
|
+
return { () -> bridge.std__optional_double_ in
|
|
139
|
+
if let __unwrappedValue = self.__implementation.fontSize {
|
|
140
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
141
|
+
} else {
|
|
142
|
+
return .init()
|
|
143
|
+
}
|
|
144
|
+
}()
|
|
145
|
+
}
|
|
146
|
+
@inline(__always)
|
|
147
|
+
set {
|
|
148
|
+
self.__implementation.fontSize = { () -> Double? in
|
|
149
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
150
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
151
|
+
return __unwrapped
|
|
152
|
+
} else {
|
|
153
|
+
return nil
|
|
154
|
+
}
|
|
155
|
+
}()
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
public final var fontWeight: bridge.std__optional_double_ {
|
|
160
|
+
@inline(__always)
|
|
161
|
+
get {
|
|
162
|
+
return { () -> bridge.std__optional_double_ in
|
|
163
|
+
if let __unwrappedValue = self.__implementation.fontWeight {
|
|
164
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
165
|
+
} else {
|
|
166
|
+
return .init()
|
|
167
|
+
}
|
|
168
|
+
}()
|
|
169
|
+
}
|
|
170
|
+
@inline(__always)
|
|
171
|
+
set {
|
|
172
|
+
self.__implementation.fontWeight = { () -> Double? in
|
|
173
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
174
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
175
|
+
return __unwrapped
|
|
176
|
+
} else {
|
|
177
|
+
return nil
|
|
178
|
+
}
|
|
179
|
+
}()
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public final var fontFamily: bridge.std__optional_std__string_ {
|
|
184
|
+
@inline(__always)
|
|
185
|
+
get {
|
|
186
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
187
|
+
if let __unwrappedValue = self.__implementation.fontFamily {
|
|
188
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
189
|
+
} else {
|
|
190
|
+
return .init()
|
|
191
|
+
}
|
|
192
|
+
}()
|
|
193
|
+
}
|
|
194
|
+
@inline(__always)
|
|
195
|
+
set {
|
|
196
|
+
self.__implementation.fontFamily = { () -> String? in
|
|
197
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
198
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
199
|
+
return String(__unwrapped)
|
|
200
|
+
} else {
|
|
201
|
+
return nil
|
|
202
|
+
}
|
|
203
|
+
}()
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
public final var color: bridge.std__optional_double_ {
|
|
208
|
+
@inline(__always)
|
|
209
|
+
get {
|
|
210
|
+
return { () -> bridge.std__optional_double_ in
|
|
211
|
+
if let __unwrappedValue = self.__implementation.color {
|
|
212
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
213
|
+
} else {
|
|
214
|
+
return .init()
|
|
215
|
+
}
|
|
216
|
+
}()
|
|
217
|
+
}
|
|
218
|
+
@inline(__always)
|
|
219
|
+
set {
|
|
220
|
+
self.__implementation.color = { () -> Double? in
|
|
221
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
222
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
223
|
+
return __unwrapped
|
|
224
|
+
} else {
|
|
225
|
+
return nil
|
|
226
|
+
}
|
|
227
|
+
}()
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
public final var letterSpacing: bridge.std__optional_double_ {
|
|
232
|
+
@inline(__always)
|
|
233
|
+
get {
|
|
234
|
+
return { () -> bridge.std__optional_double_ in
|
|
235
|
+
if let __unwrappedValue = self.__implementation.letterSpacing {
|
|
236
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
237
|
+
} else {
|
|
238
|
+
return .init()
|
|
239
|
+
}
|
|
240
|
+
}()
|
|
241
|
+
}
|
|
242
|
+
@inline(__always)
|
|
243
|
+
set {
|
|
244
|
+
self.__implementation.letterSpacing = { () -> Double? in
|
|
245
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
246
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
247
|
+
return __unwrapped
|
|
248
|
+
} else {
|
|
249
|
+
return nil
|
|
250
|
+
}
|
|
251
|
+
}()
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
public final var textAlign: bridge.std__optional_NitroNumberTextAlign_ {
|
|
256
|
+
@inline(__always)
|
|
257
|
+
get {
|
|
258
|
+
return { () -> bridge.std__optional_NitroNumberTextAlign_ in
|
|
259
|
+
if let __unwrappedValue = self.__implementation.textAlign {
|
|
260
|
+
return bridge.create_std__optional_NitroNumberTextAlign_(__unwrappedValue)
|
|
261
|
+
} else {
|
|
262
|
+
return .init()
|
|
263
|
+
}
|
|
264
|
+
}()
|
|
265
|
+
}
|
|
266
|
+
@inline(__always)
|
|
267
|
+
set {
|
|
268
|
+
self.__implementation.textAlign = newValue.value
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
public final var rightToLeft: bridge.std__optional_bool_ {
|
|
273
|
+
@inline(__always)
|
|
274
|
+
get {
|
|
275
|
+
return { () -> bridge.std__optional_bool_ in
|
|
276
|
+
if let __unwrappedValue = self.__implementation.rightToLeft {
|
|
277
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
278
|
+
} else {
|
|
279
|
+
return .init()
|
|
280
|
+
}
|
|
281
|
+
}()
|
|
282
|
+
}
|
|
283
|
+
@inline(__always)
|
|
284
|
+
set {
|
|
285
|
+
self.__implementation.rightToLeft = { () -> Bool? in
|
|
286
|
+
if bridge.has_value_std__optional_bool_(newValue) {
|
|
287
|
+
let __unwrapped = bridge.get_std__optional_bool_(newValue)
|
|
288
|
+
return __unwrapped
|
|
289
|
+
} else {
|
|
290
|
+
return nil
|
|
291
|
+
}
|
|
292
|
+
}()
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
public final var duration: bridge.std__optional_double_ {
|
|
297
|
+
@inline(__always)
|
|
298
|
+
get {
|
|
299
|
+
return { () -> bridge.std__optional_double_ in
|
|
300
|
+
if let __unwrappedValue = self.__implementation.duration {
|
|
301
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
302
|
+
} else {
|
|
303
|
+
return .init()
|
|
304
|
+
}
|
|
305
|
+
}()
|
|
306
|
+
}
|
|
307
|
+
@inline(__always)
|
|
308
|
+
set {
|
|
309
|
+
self.__implementation.duration = { () -> Double? in
|
|
310
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
311
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
312
|
+
return __unwrapped
|
|
313
|
+
} else {
|
|
314
|
+
return nil
|
|
315
|
+
}
|
|
316
|
+
}()
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
public final var easing: bridge.std__optional_NitroInputEasing_ {
|
|
321
|
+
@inline(__always)
|
|
322
|
+
get {
|
|
323
|
+
return { () -> bridge.std__optional_NitroInputEasing_ in
|
|
324
|
+
if let __unwrappedValue = self.__implementation.easing {
|
|
325
|
+
return bridge.create_std__optional_NitroInputEasing_(__unwrappedValue)
|
|
326
|
+
} else {
|
|
327
|
+
return .init()
|
|
328
|
+
}
|
|
329
|
+
}()
|
|
330
|
+
}
|
|
331
|
+
@inline(__always)
|
|
332
|
+
set {
|
|
333
|
+
self.__implementation.easing = newValue.value
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
public final var bounce: bridge.std__optional_double_ {
|
|
338
|
+
@inline(__always)
|
|
339
|
+
get {
|
|
340
|
+
return { () -> bridge.std__optional_double_ in
|
|
341
|
+
if let __unwrappedValue = self.__implementation.bounce {
|
|
342
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
343
|
+
} else {
|
|
344
|
+
return .init()
|
|
345
|
+
}
|
|
346
|
+
}()
|
|
347
|
+
}
|
|
348
|
+
@inline(__always)
|
|
349
|
+
set {
|
|
350
|
+
self.__implementation.bounce = { () -> Double? in
|
|
351
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
352
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
353
|
+
return __unwrapped
|
|
354
|
+
} else {
|
|
355
|
+
return nil
|
|
356
|
+
}
|
|
357
|
+
}()
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
public final var effect: bridge.std__optional_NitroInputEffect_ {
|
|
362
|
+
@inline(__always)
|
|
363
|
+
get {
|
|
364
|
+
return { () -> bridge.std__optional_NitroInputEffect_ in
|
|
365
|
+
if let __unwrappedValue = self.__implementation.effect {
|
|
366
|
+
return bridge.create_std__optional_NitroInputEffect_(__unwrappedValue)
|
|
367
|
+
} else {
|
|
368
|
+
return .init()
|
|
369
|
+
}
|
|
370
|
+
}()
|
|
371
|
+
}
|
|
372
|
+
@inline(__always)
|
|
373
|
+
set {
|
|
374
|
+
self.__implementation.effect = newValue.value
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
public final var respectReduceMotion: bridge.std__optional_bool_ {
|
|
379
|
+
@inline(__always)
|
|
380
|
+
get {
|
|
381
|
+
return { () -> bridge.std__optional_bool_ in
|
|
382
|
+
if let __unwrappedValue = self.__implementation.respectReduceMotion {
|
|
383
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
384
|
+
} else {
|
|
385
|
+
return .init()
|
|
386
|
+
}
|
|
387
|
+
}()
|
|
388
|
+
}
|
|
389
|
+
@inline(__always)
|
|
390
|
+
set {
|
|
391
|
+
self.__implementation.respectReduceMotion = { () -> Bool? in
|
|
392
|
+
if bridge.has_value_std__optional_bool_(newValue) {
|
|
393
|
+
let __unwrapped = bridge.get_std__optional_bool_(newValue)
|
|
394
|
+
return __unwrapped
|
|
395
|
+
} else {
|
|
396
|
+
return nil
|
|
397
|
+
}
|
|
398
|
+
}()
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
public final var loading: bridge.std__optional_bool_ {
|
|
403
|
+
@inline(__always)
|
|
404
|
+
get {
|
|
405
|
+
return { () -> bridge.std__optional_bool_ in
|
|
406
|
+
if let __unwrappedValue = self.__implementation.loading {
|
|
407
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
408
|
+
} else {
|
|
409
|
+
return .init()
|
|
410
|
+
}
|
|
411
|
+
}()
|
|
412
|
+
}
|
|
413
|
+
@inline(__always)
|
|
414
|
+
set {
|
|
415
|
+
self.__implementation.loading = { () -> Bool? in
|
|
416
|
+
if bridge.has_value_std__optional_bool_(newValue) {
|
|
417
|
+
let __unwrapped = bridge.get_std__optional_bool_(newValue)
|
|
418
|
+
return __unwrapped
|
|
419
|
+
} else {
|
|
420
|
+
return nil
|
|
421
|
+
}
|
|
422
|
+
}()
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
public final var shimmerColor: bridge.std__optional_double_ {
|
|
427
|
+
@inline(__always)
|
|
428
|
+
get {
|
|
429
|
+
return { () -> bridge.std__optional_double_ in
|
|
430
|
+
if let __unwrappedValue = self.__implementation.shimmerColor {
|
|
431
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
432
|
+
} else {
|
|
433
|
+
return .init()
|
|
434
|
+
}
|
|
435
|
+
}()
|
|
436
|
+
}
|
|
437
|
+
@inline(__always)
|
|
438
|
+
set {
|
|
439
|
+
self.__implementation.shimmerColor = { () -> Double? in
|
|
440
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
441
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
442
|
+
return __unwrapped
|
|
443
|
+
} else {
|
|
444
|
+
return nil
|
|
445
|
+
}
|
|
446
|
+
}()
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
public final var shimmerDuration: bridge.std__optional_double_ {
|
|
451
|
+
@inline(__always)
|
|
452
|
+
get {
|
|
453
|
+
return { () -> bridge.std__optional_double_ in
|
|
454
|
+
if let __unwrappedValue = self.__implementation.shimmerDuration {
|
|
455
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
456
|
+
} else {
|
|
457
|
+
return .init()
|
|
458
|
+
}
|
|
459
|
+
}()
|
|
460
|
+
}
|
|
461
|
+
@inline(__always)
|
|
462
|
+
set {
|
|
463
|
+
self.__implementation.shimmerDuration = { () -> Double? in
|
|
464
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
465
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
466
|
+
return __unwrapped
|
|
467
|
+
} else {
|
|
468
|
+
return nil
|
|
469
|
+
}
|
|
470
|
+
}()
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
public final var shimmerAngle: bridge.std__optional_double_ {
|
|
475
|
+
@inline(__always)
|
|
476
|
+
get {
|
|
477
|
+
return { () -> bridge.std__optional_double_ in
|
|
478
|
+
if let __unwrappedValue = self.__implementation.shimmerAngle {
|
|
479
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
480
|
+
} else {
|
|
481
|
+
return .init()
|
|
482
|
+
}
|
|
483
|
+
}()
|
|
484
|
+
}
|
|
485
|
+
@inline(__always)
|
|
486
|
+
set {
|
|
487
|
+
self.__implementation.shimmerAngle = { () -> Double? in
|
|
488
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
489
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
490
|
+
return __unwrapped
|
|
491
|
+
} else {
|
|
492
|
+
return nil
|
|
493
|
+
}
|
|
494
|
+
}()
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
public final var shimmerWidth: bridge.std__optional_double_ {
|
|
499
|
+
@inline(__always)
|
|
500
|
+
get {
|
|
501
|
+
return { () -> bridge.std__optional_double_ in
|
|
502
|
+
if let __unwrappedValue = self.__implementation.shimmerWidth {
|
|
503
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
504
|
+
} else {
|
|
505
|
+
return .init()
|
|
506
|
+
}
|
|
507
|
+
}()
|
|
508
|
+
}
|
|
509
|
+
@inline(__always)
|
|
510
|
+
set {
|
|
511
|
+
self.__implementation.shimmerWidth = { () -> Double? in
|
|
512
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
513
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
514
|
+
return __unwrapped
|
|
515
|
+
} else {
|
|
516
|
+
return nil
|
|
517
|
+
}
|
|
518
|
+
}()
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
public final var shimmerBaseColor: bridge.std__optional_double_ {
|
|
523
|
+
@inline(__always)
|
|
524
|
+
get {
|
|
525
|
+
return { () -> bridge.std__optional_double_ in
|
|
526
|
+
if let __unwrappedValue = self.__implementation.shimmerBaseColor {
|
|
527
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
528
|
+
} else {
|
|
529
|
+
return .init()
|
|
530
|
+
}
|
|
531
|
+
}()
|
|
532
|
+
}
|
|
533
|
+
@inline(__always)
|
|
534
|
+
set {
|
|
535
|
+
self.__implementation.shimmerBaseColor = { () -> Double? in
|
|
536
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
537
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
538
|
+
return __unwrapped
|
|
539
|
+
} else {
|
|
540
|
+
return nil
|
|
541
|
+
}
|
|
542
|
+
}()
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public final var shimmerDirection: bridge.std__optional_NitroNumberShimmerDirection_ {
|
|
547
|
+
@inline(__always)
|
|
548
|
+
get {
|
|
549
|
+
return { () -> bridge.std__optional_NitroNumberShimmerDirection_ in
|
|
550
|
+
if let __unwrappedValue = self.__implementation.shimmerDirection {
|
|
551
|
+
return bridge.create_std__optional_NitroNumberShimmerDirection_(__unwrappedValue)
|
|
552
|
+
} else {
|
|
553
|
+
return .init()
|
|
554
|
+
}
|
|
555
|
+
}()
|
|
556
|
+
}
|
|
557
|
+
@inline(__always)
|
|
558
|
+
set {
|
|
559
|
+
self.__implementation.shimmerDirection = newValue.value
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
public final var shimmerDelay: bridge.std__optional_double_ {
|
|
564
|
+
@inline(__always)
|
|
565
|
+
get {
|
|
566
|
+
return { () -> bridge.std__optional_double_ in
|
|
567
|
+
if let __unwrappedValue = self.__implementation.shimmerDelay {
|
|
568
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
569
|
+
} else {
|
|
570
|
+
return .init()
|
|
571
|
+
}
|
|
572
|
+
}()
|
|
573
|
+
}
|
|
574
|
+
@inline(__always)
|
|
575
|
+
set {
|
|
576
|
+
self.__implementation.shimmerDelay = { () -> Double? in
|
|
577
|
+
if bridge.has_value_std__optional_double_(newValue) {
|
|
578
|
+
let __unwrapped = bridge.get_std__optional_double_(newValue)
|
|
579
|
+
return __unwrapped
|
|
580
|
+
} else {
|
|
581
|
+
return nil
|
|
582
|
+
}
|
|
583
|
+
}()
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// Methods
|
|
588
|
+
public final func getView() -> UnsafeMutableRawPointer {
|
|
589
|
+
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
public final func beforeUpdate() {
|
|
593
|
+
__implementation.beforeUpdate()
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
public final func afterUpdate() {
|
|
597
|
+
__implementation.afterUpdate()
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
public final func maybePrepareForRecycle() {
|
|
601
|
+
guard let recyclable = __implementation as? any RecyclableView else { return }
|
|
602
|
+
recyclable.prepareForRecycle()
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
public final func onDropView() {
|
|
606
|
+
__implementation.onDropView()
|
|
607
|
+
}
|
|
608
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroNumberShimmerDirection.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `NitroNumberShimmerDirection`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias NitroNumberShimmerDirection = margelo.nitro.nitroinput.NitroNumberShimmerDirection
|
|
12
|
+
|
|
13
|
+
public extension NitroNumberShimmerDirection {
|
|
14
|
+
/**
|
|
15
|
+
* Get a NitroNumberShimmerDirection for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "auto":
|
|
21
|
+
self = .auto
|
|
22
|
+
case "ltr":
|
|
23
|
+
self = .ltr
|
|
24
|
+
case "rtl":
|
|
25
|
+
self = .rtl
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this NitroNumberShimmerDirection represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .auto:
|
|
37
|
+
return "auto"
|
|
38
|
+
case .ltr:
|
|
39
|
+
return "ltr"
|
|
40
|
+
case .rtl:
|
|
41
|
+
return "rtl"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroNumberSignDisplay.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `NitroNumberSignDisplay`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias NitroNumberSignDisplay = margelo.nitro.nitroinput.NitroNumberSignDisplay
|
|
12
|
+
|
|
13
|
+
public extension NitroNumberSignDisplay {
|
|
14
|
+
/**
|
|
15
|
+
* Get a NitroNumberSignDisplay for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "auto":
|
|
21
|
+
self = .auto
|
|
22
|
+
case "always":
|
|
23
|
+
self = .always
|
|
24
|
+
case "never":
|
|
25
|
+
self = .never
|
|
26
|
+
case "exceptZero":
|
|
27
|
+
self = .exceptzero
|
|
28
|
+
case "negative":
|
|
29
|
+
self = .negative
|
|
30
|
+
default:
|
|
31
|
+
return nil
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the String value this NitroNumberSignDisplay represents.
|
|
37
|
+
*/
|
|
38
|
+
var stringValue: String {
|
|
39
|
+
switch self {
|
|
40
|
+
case .auto:
|
|
41
|
+
return "auto"
|
|
42
|
+
case .always:
|
|
43
|
+
return "always"
|
|
44
|
+
case .never:
|
|
45
|
+
return "never"
|
|
46
|
+
case .exceptzero:
|
|
47
|
+
return "exceptZero"
|
|
48
|
+
case .negative:
|
|
49
|
+
return "negative"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|