react-native-nitro-input 0.3.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/README.md +9 -4
  3. package/android/CMakeLists.txt +1 -0
  4. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputMeasure.kt +52 -0
  5. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +74 -80
  6. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +18 -18
  7. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +14 -14
  8. package/android/src/main/java/com/margelo/nitro/nitroinput/InputFonts.kt +199 -0
  9. package/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt +398 -0
  10. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +112 -333
  11. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +178 -30
  12. package/cpp/RollingEngine.cpp +68 -5
  13. package/cpp/RollingEngine.hpp +13 -0
  14. package/cpp/numberformat/FormatFigure.cpp +134 -0
  15. package/cpp/numberformat/FormatFigure.hpp +65 -0
  16. package/cpp/numberformat/HybridNitroNumberFormat.cpp +32 -10
  17. package/cpp/numberformat/HybridNitroNumberFormat.hpp +9 -1
  18. package/ios/HybridNitroInputView.swift +69 -75
  19. package/ios/HybridNitroNumberView.swift +18 -18
  20. package/ios/HybridNitroTextView.swift +14 -14
  21. package/ios/InputSizing.swift +534 -0
  22. package/ios/NitroInputView.swift +102 -198
  23. package/ios/NitroNumberView.swift +98 -23
  24. package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +12 -8
  25. package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -6
  26. package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +6 -6
  27. package/lib/commonjs/src/NitroInput.js +164 -23
  28. package/lib/commonjs/src/NitroNumber.js +19 -11
  29. package/lib/commonjs/src/NitroText.js +6 -6
  30. package/lib/commonjs/src/NumberFormat.js +20 -0
  31. package/lib/commonjs/src/formatProps.js +57 -81
  32. package/lib/commonjs/src/specs/NitroInputMeasure.nitro.js +2 -0
  33. package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +12 -8
  34. package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -6
  35. package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +6 -6
  36. package/lib/module/src/NitroInput.js +165 -24
  37. package/lib/module/src/NitroNumber.js +20 -12
  38. package/lib/module/src/NitroText.js +6 -6
  39. package/lib/module/src/NumberFormat.js +18 -0
  40. package/lib/module/src/formatProps.js +54 -81
  41. package/lib/module/src/specs/NitroInputMeasure.nitro.js +1 -0
  42. package/lib/typescript/src/NitroInput.d.ts +9 -16
  43. package/lib/typescript/src/NitroNumber.d.ts +25 -7
  44. package/lib/typescript/src/NumberFormat.d.ts +15 -1
  45. package/lib/typescript/src/formatProps.d.ts +23 -18
  46. package/lib/typescript/src/specs/NitroInput.nitro.d.ts +17 -8
  47. package/lib/typescript/src/specs/NitroInputMeasure.nitro.d.ts +67 -0
  48. package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +6 -6
  49. package/lib/typescript/src/specs/NitroText.nitro.d.ts +6 -6
  50. package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +33 -0
  51. package/nitro.json +10 -0
  52. package/nitrogen/generated/android/NitroInput+autolinking.cmake +2 -0
  53. package/nitrogen/generated/android/NitroInputOnLoad.cpp +16 -0
  54. package/nitrogen/generated/android/c++/JHybridNitroInputMeasureSpec.cpp +93 -0
  55. package/nitrogen/generated/android/c++/JHybridNitroInputMeasureSpec.hpp +63 -0
  56. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +76 -40
  57. package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +24 -16
  58. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +30 -30
  59. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +12 -12
  60. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +30 -30
  61. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +12 -12
  62. package/nitrogen/generated/android/c++/JNitroInputSize.hpp +61 -0
  63. package/nitrogen/generated/android/c++/JNitroInputSizing.hpp +284 -0
  64. package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +44 -24
  65. package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +18 -18
  66. package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +18 -18
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputMeasureSpec.kt +56 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +32 -8
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +6 -6
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +6 -6
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSize.kt +56 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt +246 -0
  73. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +17 -0
  74. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +29 -0
  75. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +11 -0
  76. package/nitrogen/generated/ios/NitroInputAutolinking.mm +8 -0
  77. package/nitrogen/generated/ios/NitroInputAutolinking.swift +12 -0
  78. package/nitrogen/generated/ios/c++/HybridNitroInputMeasureSpecSwift.cpp +11 -0
  79. package/nitrogen/generated/ios/c++/HybridNitroInputMeasureSpecSwift.hpp +112 -0
  80. package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +56 -32
  81. package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +24 -24
  82. package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +24 -24
  83. package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +56 -32
  84. package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +24 -24
  85. package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +24 -24
  86. package/nitrogen/generated/ios/swift/HybridNitroInputMeasureSpec.swift +55 -0
  87. package/nitrogen/generated/ios/swift/HybridNitroInputMeasureSpec_cxx.swift +138 -0
  88. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +12 -8
  89. package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +68 -24
  90. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +6 -6
  91. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +18 -18
  92. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +6 -6
  93. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +18 -18
  94. package/nitrogen/generated/ios/swift/NitroInputSize.swift +34 -0
  95. package/nitrogen/generated/ios/swift/NitroInputSizing.swift +242 -0
  96. package/nitrogen/generated/shared/c++/HybridNitroInputMeasureSpec.cpp +21 -0
  97. package/nitrogen/generated/shared/c++/HybridNitroInputMeasureSpec.hpp +66 -0
  98. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +24 -16
  99. package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +24 -16
  100. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.cpp +2 -0
  101. package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.hpp +8 -0
  102. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +12 -12
  103. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +12 -12
  104. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +12 -12
  105. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +12 -12
  106. package/nitrogen/generated/shared/c++/NitroInputSize.hpp +87 -0
  107. package/nitrogen/generated/shared/c++/NitroInputSizing.hpp +263 -0
  108. package/nitrogen/generated/shared/c++/NumberFigure.hpp +95 -0
  109. package/nitrogen/generated/shared/c++/NumberFormatLayout.hpp +112 -0
  110. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +24 -16
  111. package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +36 -24
  112. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +12 -12
  113. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +18 -18
  114. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +12 -12
  115. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +18 -18
  116. package/nitrogen/generated/shared/json/NitroInputViewConfig.json +12 -8
  117. package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -6
  118. package/nitrogen/generated/shared/json/NitroTextViewConfig.json +6 -6
  119. package/package.json +5 -3
  120. package/src/NitroInput.tsx +201 -64
  121. package/src/NitroNumber.tsx +54 -25
  122. package/src/NitroText.tsx +6 -6
  123. package/src/NumberFormat.ts +22 -0
  124. package/src/formatProps.ts +59 -99
  125. package/src/specs/NitroInput.nitro.ts +17 -8
  126. package/src/specs/NitroInputMeasure.nitro.ts +76 -0
  127. package/src/specs/NitroNumber.nitro.ts +6 -6
  128. package/src/specs/NitroText.nitro.ts +6 -6
  129. package/src/specs/NumberFormat.nitro.ts +35 -0
@@ -229,7 +229,7 @@ abstract class HybridNitroNumberViewSpec: HybridView() {
229
229
  @get:Keep
230
230
  @set:DoNotStrip
231
231
  @set:Keep
232
- abstract var fontSize: Double?
232
+ abstract var textSize: Double?
233
233
 
234
234
  @get:DoNotStrip
235
235
  @get:Keep
@@ -265,7 +265,7 @@ abstract class HybridNitroNumberViewSpec: HybridView() {
265
265
  @get:Keep
266
266
  @set:DoNotStrip
267
267
  @set:Keep
268
- abstract var letterSpacing: Double?
268
+ abstract var textLetterSpacing: Double?
269
269
 
270
270
  @get:DoNotStrip
271
271
  @get:Keep
@@ -403,25 +403,25 @@ abstract class HybridNitroNumberViewSpec: HybridView() {
403
403
  @get:Keep
404
404
  @set:DoNotStrip
405
405
  @set:Keep
406
- abstract var fontWeight: Double?
406
+ abstract var textWeight: Double?
407
407
 
408
408
  @get:DoNotStrip
409
409
  @get:Keep
410
410
  @set:DoNotStrip
411
411
  @set:Keep
412
- abstract var fontFamily: String?
412
+ abstract var textFamily: String?
413
413
 
414
414
  @get:DoNotStrip
415
415
  @get:Keep
416
416
  @set:DoNotStrip
417
417
  @set:Keep
418
- abstract var color: Double?
418
+ abstract var textColor: Double?
419
419
 
420
420
  @get:DoNotStrip
421
421
  @get:Keep
422
422
  @set:DoNotStrip
423
423
  @set:Keep
424
- abstract var textAlign: NitroNumberTextAlign?
424
+ abstract var textAlignment: NitroNumberTextAlign?
425
425
 
426
426
  @get:DoNotStrip
427
427
  @get:Keep
@@ -37,37 +37,37 @@ abstract class HybridNitroTextViewSpec: HybridView() {
37
37
  @get:Keep
38
38
  @set:DoNotStrip
39
39
  @set:Keep
40
- abstract var fontSize: Double?
40
+ abstract var textSize: Double?
41
41
 
42
42
  @get:DoNotStrip
43
43
  @get:Keep
44
44
  @set:DoNotStrip
45
45
  @set:Keep
46
- abstract var fontWeight: Double?
46
+ abstract var textWeight: Double?
47
47
 
48
48
  @get:DoNotStrip
49
49
  @get:Keep
50
50
  @set:DoNotStrip
51
51
  @set:Keep
52
- abstract var fontFamily: String?
52
+ abstract var textFamily: String?
53
53
 
54
54
  @get:DoNotStrip
55
55
  @get:Keep
56
56
  @set:DoNotStrip
57
57
  @set:Keep
58
- abstract var color: Double?
58
+ abstract var textColor: Double?
59
59
 
60
60
  @get:DoNotStrip
61
61
  @get:Keep
62
62
  @set:DoNotStrip
63
63
  @set:Keep
64
- abstract var letterSpacing: Double?
64
+ abstract var textLetterSpacing: Double?
65
65
 
66
66
  @get:DoNotStrip
67
67
  @get:Keep
68
68
  @set:DoNotStrip
69
69
  @set:Keep
70
- abstract var textAlign: NitroNumberTextAlign?
70
+ abstract var textAlignment: NitroNumberTextAlign?
71
71
 
72
72
  @get:DoNotStrip
73
73
  @get:Keep
@@ -0,0 +1,56 @@
1
+ ///
2
+ /// NitroInputSize.kt
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
+ package com.margelo.nitro.nitroinput
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "NitroInputSize".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class NitroInputSize(
21
+ @DoNotStrip
22
+ @Keep
23
+ val width: Double,
24
+ @DoNotStrip
25
+ @Keep
26
+ val height: Double
27
+ ) {
28
+ /* primary constructor */
29
+
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is NitroInputSize) return false
33
+ return Objects.deepEquals(this.width, other.width)
34
+ && Objects.deepEquals(this.height, other.height)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ width,
40
+ height
41
+ ).contentDeepHashCode()
42
+ }
43
+
44
+ companion object {
45
+ /**
46
+ * Constructor called from C++
47
+ */
48
+ @DoNotStrip
49
+ @Keep
50
+ @Suppress("unused")
51
+ @JvmStatic
52
+ private fun fromCpp(width: Double, height: Double): NitroInputSize {
53
+ return NitroInputSize(width, height)
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,246 @@
1
+ ///
2
+ /// NitroInputSizing.kt
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
+ package com.margelo.nitro.nitroinput
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "NitroInputSizing".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class NitroInputSizing(
21
+ @DoNotStrip
22
+ @Keep
23
+ val text: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val mode: NitroInputMode,
27
+ @DoNotStrip
28
+ @Keep
29
+ val plain: Boolean,
30
+ @DoNotStrip
31
+ @Keep
32
+ val multiline: Boolean,
33
+ @DoNotStrip
34
+ @Keep
35
+ val secureTextEntry: Boolean,
36
+ @DoNotStrip
37
+ @Keep
38
+ val maxLength: Double,
39
+ @DoNotStrip
40
+ @Keep
41
+ val fractionDigits: Double,
42
+ @DoNotStrip
43
+ @Keep
44
+ val maxIntegerDigits: Double,
45
+ @DoNotStrip
46
+ @Keep
47
+ val groupingSeparator: String,
48
+ @DoNotStrip
49
+ @Keep
50
+ val decimalSeparator: String,
51
+ @DoNotStrip
52
+ @Keep
53
+ val prefix: String,
54
+ @DoNotStrip
55
+ @Keep
56
+ val suffix: String,
57
+ @DoNotStrip
58
+ @Keep
59
+ val signPlacement: NitroInputSignPlacement,
60
+ @DoNotStrip
61
+ @Keep
62
+ val placeholder: String,
63
+ @DoNotStrip
64
+ @Keep
65
+ val mask: String,
66
+ @DoNotStrip
67
+ @Keep
68
+ val maskNotations: Array<NitroInputNotation>,
69
+ @DoNotStrip
70
+ @Keep
71
+ val maskAutocomplete: Boolean,
72
+ @DoNotStrip
73
+ @Keep
74
+ val maskAutoSkip: Boolean,
75
+ @DoNotStrip
76
+ @Keep
77
+ val maskAffinityFormats: Array<String>,
78
+ @DoNotStrip
79
+ @Keep
80
+ val maskAffinityStrategy: NitroInputMaskAffinity,
81
+ @DoNotStrip
82
+ @Keep
83
+ val maskTextCase: NitroInputTextCase,
84
+ @DoNotStrip
85
+ @Keep
86
+ val maskCharacterMap: Array<NitroInputCharacterMapping>,
87
+ @DoNotStrip
88
+ @Keep
89
+ val maskSlotPlaceholder: String,
90
+ @DoNotStrip
91
+ @Keep
92
+ val keepPlaceholder: Boolean,
93
+ @DoNotStrip
94
+ @Keep
95
+ val textSize: Double,
96
+ @DoNotStrip
97
+ @Keep
98
+ val textLineHeight: Double,
99
+ @DoNotStrip
100
+ @Keep
101
+ val prefixFontSize: Double,
102
+ @DoNotStrip
103
+ @Keep
104
+ val suffixFontSize: Double,
105
+ @DoNotStrip
106
+ @Keep
107
+ val textWeight: Double,
108
+ @DoNotStrip
109
+ @Keep
110
+ val textFamily: String,
111
+ @DoNotStrip
112
+ @Keep
113
+ val textLetterSpacing: Double,
114
+ @DoNotStrip
115
+ @Keep
116
+ val prefixSpacing: Double,
117
+ @DoNotStrip
118
+ @Keep
119
+ val suffixSpacing: Double,
120
+ @DoNotStrip
121
+ @Keep
122
+ val allowFontScaling: Boolean,
123
+ @DoNotStrip
124
+ @Keep
125
+ val maxFontSizeMultiplier: Double,
126
+ @DoNotStrip
127
+ @Keep
128
+ val variant: NitroInputVariant,
129
+ @DoNotStrip
130
+ @Keep
131
+ val label: String,
132
+ @DoNotStrip
133
+ @Keep
134
+ val labelBehavior: NitroInputLabelBehavior,
135
+ @DoNotStrip
136
+ @Keep
137
+ val labelFontSize: Double,
138
+ @DoNotStrip
139
+ @Keep
140
+ val cornerRadius: Double
141
+ ) {
142
+ /* primary constructor */
143
+
144
+ override fun equals(other: Any?): Boolean {
145
+ if (this === other) return true
146
+ if (other !is NitroInputSizing) return false
147
+ return Objects.deepEquals(this.text, other.text)
148
+ && Objects.deepEquals(this.mode, other.mode)
149
+ && Objects.deepEquals(this.plain, other.plain)
150
+ && Objects.deepEquals(this.multiline, other.multiline)
151
+ && Objects.deepEquals(this.secureTextEntry, other.secureTextEntry)
152
+ && Objects.deepEquals(this.maxLength, other.maxLength)
153
+ && Objects.deepEquals(this.fractionDigits, other.fractionDigits)
154
+ && Objects.deepEquals(this.maxIntegerDigits, other.maxIntegerDigits)
155
+ && Objects.deepEquals(this.groupingSeparator, other.groupingSeparator)
156
+ && Objects.deepEquals(this.decimalSeparator, other.decimalSeparator)
157
+ && Objects.deepEquals(this.prefix, other.prefix)
158
+ && Objects.deepEquals(this.suffix, other.suffix)
159
+ && Objects.deepEquals(this.signPlacement, other.signPlacement)
160
+ && Objects.deepEquals(this.placeholder, other.placeholder)
161
+ && Objects.deepEquals(this.mask, other.mask)
162
+ && Objects.deepEquals(this.maskNotations, other.maskNotations)
163
+ && Objects.deepEquals(this.maskAutocomplete, other.maskAutocomplete)
164
+ && Objects.deepEquals(this.maskAutoSkip, other.maskAutoSkip)
165
+ && Objects.deepEquals(this.maskAffinityFormats, other.maskAffinityFormats)
166
+ && Objects.deepEquals(this.maskAffinityStrategy, other.maskAffinityStrategy)
167
+ && Objects.deepEquals(this.maskTextCase, other.maskTextCase)
168
+ && Objects.deepEquals(this.maskCharacterMap, other.maskCharacterMap)
169
+ && Objects.deepEquals(this.maskSlotPlaceholder, other.maskSlotPlaceholder)
170
+ && Objects.deepEquals(this.keepPlaceholder, other.keepPlaceholder)
171
+ && Objects.deepEquals(this.textSize, other.textSize)
172
+ && Objects.deepEquals(this.textLineHeight, other.textLineHeight)
173
+ && Objects.deepEquals(this.prefixFontSize, other.prefixFontSize)
174
+ && Objects.deepEquals(this.suffixFontSize, other.suffixFontSize)
175
+ && Objects.deepEquals(this.textWeight, other.textWeight)
176
+ && Objects.deepEquals(this.textFamily, other.textFamily)
177
+ && Objects.deepEquals(this.textLetterSpacing, other.textLetterSpacing)
178
+ && Objects.deepEquals(this.prefixSpacing, other.prefixSpacing)
179
+ && Objects.deepEquals(this.suffixSpacing, other.suffixSpacing)
180
+ && Objects.deepEquals(this.allowFontScaling, other.allowFontScaling)
181
+ && Objects.deepEquals(this.maxFontSizeMultiplier, other.maxFontSizeMultiplier)
182
+ && Objects.deepEquals(this.variant, other.variant)
183
+ && Objects.deepEquals(this.label, other.label)
184
+ && Objects.deepEquals(this.labelBehavior, other.labelBehavior)
185
+ && Objects.deepEquals(this.labelFontSize, other.labelFontSize)
186
+ && Objects.deepEquals(this.cornerRadius, other.cornerRadius)
187
+ }
188
+
189
+ override fun hashCode(): Int {
190
+ return arrayOf<Any?>(
191
+ text,
192
+ mode,
193
+ plain,
194
+ multiline,
195
+ secureTextEntry,
196
+ maxLength,
197
+ fractionDigits,
198
+ maxIntegerDigits,
199
+ groupingSeparator,
200
+ decimalSeparator,
201
+ prefix,
202
+ suffix,
203
+ signPlacement,
204
+ placeholder,
205
+ mask,
206
+ maskNotations,
207
+ maskAutocomplete,
208
+ maskAutoSkip,
209
+ maskAffinityFormats,
210
+ maskAffinityStrategy,
211
+ maskTextCase,
212
+ maskCharacterMap,
213
+ maskSlotPlaceholder,
214
+ keepPlaceholder,
215
+ textSize,
216
+ textLineHeight,
217
+ prefixFontSize,
218
+ suffixFontSize,
219
+ textWeight,
220
+ textFamily,
221
+ textLetterSpacing,
222
+ prefixSpacing,
223
+ suffixSpacing,
224
+ allowFontScaling,
225
+ maxFontSizeMultiplier,
226
+ variant,
227
+ label,
228
+ labelBehavior,
229
+ labelFontSize,
230
+ cornerRadius
231
+ ).contentDeepHashCode()
232
+ }
233
+
234
+ companion object {
235
+ /**
236
+ * Constructor called from C++
237
+ */
238
+ @DoNotStrip
239
+ @Keep
240
+ @Suppress("unused")
241
+ @JvmStatic
242
+ private fun fromCpp(text: String, mode: NitroInputMode, plain: Boolean, multiline: Boolean, secureTextEntry: Boolean, maxLength: Double, fractionDigits: Double, maxIntegerDigits: Double, groupingSeparator: String, decimalSeparator: String, prefix: String, suffix: String, signPlacement: NitroInputSignPlacement, placeholder: String, mask: String, maskNotations: Array<NitroInputNotation>, maskAutocomplete: Boolean, maskAutoSkip: Boolean, maskAffinityFormats: Array<String>, maskAffinityStrategy: NitroInputMaskAffinity, maskTextCase: NitroInputTextCase, maskCharacterMap: Array<NitroInputCharacterMapping>, maskSlotPlaceholder: String, keepPlaceholder: Boolean, textSize: Double, textLineHeight: Double, prefixFontSize: Double, suffixFontSize: Double, textWeight: Double, textFamily: String, textLetterSpacing: Double, prefixSpacing: Double, suffixSpacing: Double, allowFontScaling: Boolean, maxFontSizeMultiplier: Double, variant: NitroInputVariant, label: String, labelBehavior: NitroInputLabelBehavior, labelFontSize: Double, cornerRadius: Double): NitroInputSizing {
243
+ return NitroInputSizing(text, mode, plain, multiline, secureTextEntry, maxLength, fractionDigits, maxIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, signPlacement, placeholder, mask, maskNotations, maskAutocomplete, maskAutoSkip, maskAffinityFormats, maskAffinityStrategy, maskTextCase, maskCharacterMap, maskSlotPlaceholder, keepPlaceholder, textSize, textLineHeight, prefixFontSize, suffixFontSize, textWeight, textFamily, textLetterSpacing, prefixSpacing, suffixSpacing, allowFontScaling, maxFontSizeMultiplier, variant, label, labelBehavior, labelFontSize, cornerRadius)
244
+ }
245
+ }
246
+ }
@@ -8,6 +8,7 @@
8
8
  #include "NitroInput-Swift-Cxx-Bridge.hpp"
9
9
 
10
10
  // Include C++ implementation defined types
11
+ #include "HybridNitroInputMeasureSpecSwift.hpp"
11
12
  #include "HybridNitroInputViewSpecSwift.hpp"
12
13
  #include "HybridNitroNumberFormatPlatformSpecSwift.hpp"
13
14
  #include "HybridNitroNumberViewSpecSwift.hpp"
@@ -83,6 +84,22 @@ namespace margelo::nitro::nitroinput::bridge::swift {
83
84
  return swiftPart.toUnsafe();
84
85
  }
85
86
 
87
+ // pragma MARK: std::shared_ptr<HybridNitroInputMeasureSpec>
88
+ std::shared_ptr<HybridNitroInputMeasureSpec> create_std__shared_ptr_HybridNitroInputMeasureSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
89
+ NitroInput::HybridNitroInputMeasureSpec_cxx swiftPart = NitroInput::HybridNitroInputMeasureSpec_cxx::fromUnsafe(swiftUnsafePointer);
90
+ return std::make_shared<margelo::nitro::nitroinput::HybridNitroInputMeasureSpecSwift>(swiftPart);
91
+ }
92
+ void* NON_NULL get_std__shared_ptr_HybridNitroInputMeasureSpec_(std__shared_ptr_HybridNitroInputMeasureSpec_ cppType) {
93
+ std::shared_ptr<margelo::nitro::nitroinput::HybridNitroInputMeasureSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitroinput::HybridNitroInputMeasureSpecSwift>(cppType);
94
+ #ifdef NITRO_DEBUG
95
+ if (swiftWrapper == nullptr) [[unlikely]] {
96
+ throw std::runtime_error("Class \"HybridNitroInputMeasureSpec\" is not implemented in Swift!");
97
+ }
98
+ #endif
99
+ NitroInput::HybridNitroInputMeasureSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
100
+ return swiftPart.toUnsafe();
101
+ }
102
+
86
103
  // pragma MARK: std::function<void()>
87
104
  Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
88
105
  auto swiftClosure = NitroInput::Func_void::fromUnsafe(swiftClosureWrapper);
@@ -8,6 +8,8 @@
8
8
  #pragma once
9
9
 
10
10
  // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridNitroInputMeasureSpec` to properly resolve imports.
12
+ namespace margelo::nitro::nitroinput { class HybridNitroInputMeasureSpec; }
11
13
  // Forward declaration of `HybridNitroInputViewSpec` to properly resolve imports.
12
14
  namespace margelo::nitro::nitroinput { class HybridNitroInputViewSpec; }
13
15
  // Forward declaration of `HybridNitroNumberFormatPlatformSpec` to properly resolve imports.
@@ -28,6 +30,8 @@ namespace margelo::nitro::nitroinput { enum class NitroInputEasing; }
28
30
  namespace margelo::nitro::nitroinput { enum class NitroInputEffect; }
29
31
  // Forward declaration of `NitroInputNotation` to properly resolve imports.
30
32
  namespace margelo::nitro::nitroinput { struct NitroInputNotation; }
33
+ // Forward declaration of `NitroInputSize` to properly resolve imports.
34
+ namespace margelo::nitro::nitroinput { struct NitroInputSize; }
31
35
  // Forward declaration of `NitroNumberAffixAlign` to properly resolve imports.
32
36
  namespace margelo::nitro::nitroinput { enum class NitroNumberAffixAlign; }
33
37
  // Forward declaration of `NitroNumberDirection` to properly resolve imports.
@@ -46,6 +50,8 @@ namespace margelo::nitro::nitroinput { enum class NitroNumberTextAlign; }
46
50
  namespace margelo::nitro::nitroinput { enum class NitroNumberTransition; }
47
51
 
48
52
  // Forward declarations of Swift defined types
53
+ // Forward declaration of `HybridNitroInputMeasureSpec_cxx` to properly resolve imports.
54
+ namespace NitroInput { class HybridNitroInputMeasureSpec_cxx; }
49
55
  // Forward declaration of `HybridNitroInputViewSpec_cxx` to properly resolve imports.
50
56
  namespace NitroInput { class HybridNitroInputViewSpec_cxx; }
51
57
  // Forward declaration of `HybridNitroNumberFormatPlatformSpec_cxx` to properly resolve imports.
@@ -60,6 +66,7 @@ namespace NitroInput { class HybridNitroTextMeasureSpec_cxx; }
60
66
  namespace NitroInput { class HybridNitroTextViewSpec_cxx; }
61
67
 
62
68
  // Include C++ defined types
69
+ #include "HybridNitroInputMeasureSpec.hpp"
63
70
  #include "HybridNitroInputViewSpec.hpp"
64
71
  #include "HybridNitroNumberFormatPlatformSpec.hpp"
65
72
  #include "HybridNitroNumberViewSpec.hpp"
@@ -70,6 +77,7 @@ namespace NitroInput { class HybridNitroTextViewSpec_cxx; }
70
77
  #include "NitroInputEasing.hpp"
71
78
  #include "NitroInputEffect.hpp"
72
79
  #include "NitroInputNotation.hpp"
80
+ #include "NitroInputSize.hpp"
73
81
  #include "NitroNumberAffixAlign.hpp"
74
82
  #include "NitroNumberDirection.hpp"
75
83
  #include "NitroNumberEasing.hpp"
@@ -425,6 +433,27 @@ namespace margelo::nitro::nitroinput::bridge::swift {
425
433
  return Result<bool>::withError(error);
426
434
  }
427
435
 
436
+ // pragma MARK: std::shared_ptr<HybridNitroInputMeasureSpec>
437
+ /**
438
+ * Specialized version of `std::shared_ptr<HybridNitroInputMeasureSpec>`.
439
+ */
440
+ using std__shared_ptr_HybridNitroInputMeasureSpec_ = std::shared_ptr<HybridNitroInputMeasureSpec>;
441
+ std::shared_ptr<HybridNitroInputMeasureSpec> create_std__shared_ptr_HybridNitroInputMeasureSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
442
+ void* NON_NULL get_std__shared_ptr_HybridNitroInputMeasureSpec_(std__shared_ptr_HybridNitroInputMeasureSpec_ cppType);
443
+
444
+ // pragma MARK: std::weak_ptr<HybridNitroInputMeasureSpec>
445
+ using std__weak_ptr_HybridNitroInputMeasureSpec_ = std::weak_ptr<HybridNitroInputMeasureSpec>;
446
+ inline std__weak_ptr_HybridNitroInputMeasureSpec_ weakify_std__shared_ptr_HybridNitroInputMeasureSpec_(const std::shared_ptr<HybridNitroInputMeasureSpec>& strong) noexcept { return strong; }
447
+
448
+ // pragma MARK: Result<NitroInputSize>
449
+ using Result_NitroInputSize_ = Result<NitroInputSize>;
450
+ inline Result_NitroInputSize_ create_Result_NitroInputSize_(const NitroInputSize& value) noexcept {
451
+ return Result<NitroInputSize>::withValue(value);
452
+ }
453
+ inline Result_NitroInputSize_ create_Result_NitroInputSize_(const std::exception_ptr& error) noexcept {
454
+ return Result<NitroInputSize>::withError(error);
455
+ }
456
+
428
457
  // pragma MARK: std::optional<double>
429
458
  /**
430
459
  * Specialized version of `std::optional<double>`.
@@ -8,6 +8,8 @@
8
8
  #pragma once
9
9
 
10
10
  // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridNitroInputMeasureSpec` to properly resolve imports.
12
+ namespace margelo::nitro::nitroinput { class HybridNitroInputMeasureSpec; }
11
13
  // Forward declaration of `HybridNitroInputViewSpec` to properly resolve imports.
12
14
  namespace margelo::nitro::nitroinput { class HybridNitroInputViewSpec; }
13
15
  // Forward declaration of `HybridNitroNumberFormatPlatformSpec` to properly resolve imports.
@@ -46,6 +48,10 @@ namespace margelo::nitro::nitroinput { struct NitroInputNotation; }
46
48
  namespace margelo::nitro::nitroinput { enum class NitroInputReturnKeyType; }
47
49
  // Forward declaration of `NitroInputSignPlacement` to properly resolve imports.
48
50
  namespace margelo::nitro::nitroinput { enum class NitroInputSignPlacement; }
51
+ // Forward declaration of `NitroInputSize` to properly resolve imports.
52
+ namespace margelo::nitro::nitroinput { struct NitroInputSize; }
53
+ // Forward declaration of `NitroInputSizing` to properly resolve imports.
54
+ namespace margelo::nitro::nitroinput { struct NitroInputSizing; }
49
55
  // Forward declaration of `NitroInputSubmitBehavior` to properly resolve imports.
50
56
  namespace margelo::nitro::nitroinput { enum class NitroInputSubmitBehavior; }
51
57
  // Forward declaration of `NitroInputTextAlignVertical` to properly resolve imports.
@@ -94,6 +100,7 @@ namespace margelo::nitro::nitroinput { enum class NumberFormatStyle; }
94
100
  namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
95
101
 
96
102
  // Include C++ defined types
103
+ #include "HybridNitroInputMeasureSpec.hpp"
97
104
  #include "HybridNitroInputViewSpec.hpp"
98
105
  #include "HybridNitroNumberFormatPlatformSpec.hpp"
99
106
  #include "HybridNitroNumberViewSpec.hpp"
@@ -113,6 +120,8 @@ namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
113
120
  #include "NitroInputNotation.hpp"
114
121
  #include "NitroInputReturnKeyType.hpp"
115
122
  #include "NitroInputSignPlacement.hpp"
123
+ #include "NitroInputSize.hpp"
124
+ #include "NitroInputSizing.hpp"
116
125
  #include "NitroInputSubmitBehavior.hpp"
117
126
  #include "NitroInputTextAlign.hpp"
118
127
  #include "NitroInputTextAlignVertical.hpp"
@@ -154,6 +163,8 @@ namespace margelo::nitro::nitroinput { enum class NumberFormatUnitDisplay; }
154
163
  #include <NitroModules/DateToChronoDate.hpp>
155
164
 
156
165
  // Forward declarations of Swift defined types
166
+ // Forward declaration of `HybridNitroInputMeasureSpec_cxx` to properly resolve imports.
167
+ namespace NitroInput { class HybridNitroInputMeasureSpec_cxx; }
157
168
  // Forward declaration of `HybridNitroInputViewSpec_cxx` to properly resolve imports.
158
169
  namespace NitroInput { class HybridNitroInputViewSpec_cxx; }
159
170
  // Forward declaration of `HybridNitroNumberFormatPlatformSpec_cxx` to properly resolve imports.
@@ -17,6 +17,7 @@
17
17
  #include "HybridNitroNumberFormatPlatformSpecSwift.hpp"
18
18
  #include "HybridNitroTextViewSpecSwift.hpp"
19
19
  #include "HybridNitroTextMeasureSpecSwift.hpp"
20
+ #include "HybridNitroInputMeasureSpecSwift.hpp"
20
21
 
21
22
  @interface NitroInputAutolinking : NSObject
22
23
  @end
@@ -80,6 +81,13 @@
80
81
  return hybridObject;
81
82
  }
82
83
  );
84
+ HybridObjectRegistry::registerHybridObjectConstructor(
85
+ "NitroInputMeasure",
86
+ []() -> std::shared_ptr<HybridObject> {
87
+ std::shared_ptr<HybridNitroInputMeasureSpec> hybridObject = NitroInput::NitroInputAutolinking::createNitroInputMeasure();
88
+ return hybridObject;
89
+ }
90
+ );
83
91
  }
84
92
 
85
93
  @end
@@ -71,4 +71,16 @@ public final class NitroInputAutolinking {
71
71
  public static func isNitroTextMeasureRecyclable() -> Bool {
72
72
  return HybridNitroTextMeasure.self is any RecyclableView.Type
73
73
  }
74
+
75
+ public static func createNitroInputMeasure() -> bridge.std__shared_ptr_HybridNitroInputMeasureSpec_ {
76
+ let hybridObject = HybridNitroInputMeasure()
77
+ return { () -> bridge.std__shared_ptr_HybridNitroInputMeasureSpec_ in
78
+ let __cxxWrapped = hybridObject.getCxxWrapper()
79
+ return __cxxWrapped.getCxxPart()
80
+ }()
81
+ }
82
+
83
+ public static func isNitroInputMeasureRecyclable() -> Bool {
84
+ return HybridNitroInputMeasure.self is any RecyclableView.Type
85
+ }
74
86
  }
@@ -0,0 +1,11 @@
1
+ ///
2
+ /// HybridNitroInputMeasureSpecSwift.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 "HybridNitroInputMeasureSpecSwift.hpp"
9
+
10
+ namespace margelo::nitro::nitroinput {
11
+ } // namespace margelo::nitro::nitroinput