@tamagui/input 2.7.7 → 3.0.0-beta.643.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.
Files changed (168) hide show
  1. package/dist/cjs/Input.cjs +78 -162
  2. package/dist/cjs/Input.native.cjs +209 -0
  3. package/dist/cjs/Input.native.js +186 -282
  4. package/dist/cjs/Input.native.js.map +1 -1
  5. package/dist/cjs/InputNativeProps.cjs +10 -11
  6. package/dist/cjs/InputNativeProps.native.cjs +19 -0
  7. package/dist/cjs/InputNativeProps.native.js +10 -10
  8. package/dist/cjs/InputNativeProps.native.js.map +1 -1
  9. package/dist/cjs/TextArea.cjs +25 -38
  10. package/dist/cjs/TextArea.native.cjs +41 -0
  11. package/dist/cjs/TextArea.native.js +25 -37
  12. package/dist/cjs/TextArea.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +16 -17
  14. package/dist/cjs/index.native.cjs +33 -0
  15. package/dist/cjs/index.native.js +16 -16
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/cjs/shared.cjs +115 -122
  18. package/dist/cjs/shared.native.cjs +144 -0
  19. package/dist/cjs/shared.native.js +120 -126
  20. package/dist/cjs/shared.native.js.map +1 -1
  21. package/dist/cjs/types.cjs +10 -11
  22. package/dist/cjs/types.native.cjs +19 -0
  23. package/dist/cjs/types.native.js +10 -10
  24. package/dist/cjs/types.native.js.map +1 -1
  25. package/dist/esm/Input.mjs +63 -137
  26. package/dist/esm/Input.mjs.map +1 -1
  27. package/dist/esm/Input.native.js +172 -259
  28. package/dist/esm/Input.native.js.map +1 -1
  29. package/dist/esm/InputNativeProps.mjs +0 -2
  30. package/dist/esm/InputNativeProps.native.js +0 -2
  31. package/dist/esm/TextArea.mjs +12 -20
  32. package/dist/esm/TextArea.mjs.map +1 -1
  33. package/dist/esm/TextArea.native.js +12 -20
  34. package/dist/esm/TextArea.native.js.map +1 -1
  35. package/dist/esm/index.js +6 -4
  36. package/dist/esm/index.mjs +6 -4
  37. package/dist/esm/index.native.js +6 -4
  38. package/dist/esm/shared.mjs +99 -104
  39. package/dist/esm/shared.mjs.map +1 -1
  40. package/dist/esm/shared.native.js +104 -109
  41. package/dist/esm/shared.native.js.map +1 -1
  42. package/dist/esm/types.mjs +0 -2
  43. package/dist/esm/types.native.js +0 -2
  44. package/dist/jsx/Input.mjs +63 -137
  45. package/dist/jsx/Input.mjs.map +1 -1
  46. package/dist/jsx/Input.native.cjs +209 -0
  47. package/dist/jsx/Input.native.js +186 -282
  48. package/dist/jsx/Input.native.js.map +1 -1
  49. package/dist/jsx/InputNativeProps.mjs +0 -2
  50. package/dist/jsx/InputNativeProps.native.cjs +19 -0
  51. package/dist/jsx/InputNativeProps.native.js +10 -10
  52. package/dist/jsx/InputNativeProps.native.js.map +1 -1
  53. package/dist/jsx/TextArea.mjs +12 -20
  54. package/dist/jsx/TextArea.mjs.map +1 -1
  55. package/dist/jsx/TextArea.native.cjs +41 -0
  56. package/dist/jsx/TextArea.native.js +25 -37
  57. package/dist/jsx/TextArea.native.js.map +1 -1
  58. package/dist/jsx/index.js +6 -4
  59. package/dist/jsx/index.mjs +6 -4
  60. package/dist/jsx/index.native.cjs +33 -0
  61. package/dist/jsx/index.native.js +16 -16
  62. package/dist/jsx/index.native.js.map +1 -1
  63. package/dist/jsx/shared.mjs +99 -104
  64. package/dist/jsx/shared.mjs.map +1 -1
  65. package/dist/jsx/shared.native.cjs +144 -0
  66. package/dist/jsx/shared.native.js +120 -126
  67. package/dist/jsx/shared.native.js.map +1 -1
  68. package/dist/jsx/types.mjs +0 -2
  69. package/dist/jsx/types.native.cjs +19 -0
  70. package/dist/jsx/types.native.js +10 -10
  71. package/dist/jsx/types.native.js.map +1 -1
  72. package/package.json +13 -15
  73. package/src/Input.native.tsx +263 -240
  74. package/src/Input.tsx +162 -152
  75. package/src/TextArea.tsx +6 -14
  76. package/src/shared.tsx +65 -70
  77. package/src/types.ts +1 -1
  78. package/types/Input.d.ts +57 -41
  79. package/types/Input.d.ts.map +1 -1
  80. package/types/Input.native.d.ts +57 -41
  81. package/types/Input.native.d.ts.map +1 -1
  82. package/types/TextArea.d.ts +172 -24
  83. package/types/TextArea.d.ts.map +1 -1
  84. package/types/shared.d.ts +14 -99
  85. package/types/shared.d.ts.map +1 -1
  86. package/types/types.d.ts +1 -1
  87. package/dist/cjs/inputTypes.test-d.cjs +0 -128
  88. package/dist/cjs/inputTypes.test-d.native.js +0 -131
  89. package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
  90. package/dist/cjs/v1/Input.cjs +0 -200
  91. package/dist/cjs/v1/Input.native.js +0 -183
  92. package/dist/cjs/v1/Input.native.js.map +0 -1
  93. package/dist/cjs/v1/TextArea.cjs +0 -52
  94. package/dist/cjs/v1/TextArea.native.js +0 -55
  95. package/dist/cjs/v1/TextArea.native.js.map +0 -1
  96. package/dist/cjs/v1/index.cjs +0 -21
  97. package/dist/cjs/v1/index.native.js +0 -24
  98. package/dist/cjs/v1/index.native.js.map +0 -1
  99. package/dist/cjs/v1/types.cjs +0 -18
  100. package/dist/cjs/v1/types.native.js +0 -21
  101. package/dist/cjs/v1/types.native.js.map +0 -1
  102. package/dist/esm/InputNativeProps.mjs.map +0 -1
  103. package/dist/esm/InputNativeProps.native.js.map +0 -1
  104. package/dist/esm/index.js.map +0 -1
  105. package/dist/esm/index.mjs.map +0 -1
  106. package/dist/esm/index.native.js.map +0 -1
  107. package/dist/esm/inputTypes.test-d.mjs +0 -129
  108. package/dist/esm/inputTypes.test-d.mjs.map +0 -1
  109. package/dist/esm/inputTypes.test-d.native.js +0 -129
  110. package/dist/esm/inputTypes.test-d.native.js.map +0 -1
  111. package/dist/esm/types.mjs.map +0 -1
  112. package/dist/esm/types.native.js.map +0 -1
  113. package/dist/esm/v1/Input.mjs +0 -164
  114. package/dist/esm/v1/Input.mjs.map +0 -1
  115. package/dist/esm/v1/Input.native.js +0 -144
  116. package/dist/esm/v1/Input.native.js.map +0 -1
  117. package/dist/esm/v1/TextArea.mjs +0 -27
  118. package/dist/esm/v1/TextArea.mjs.map +0 -1
  119. package/dist/esm/v1/TextArea.native.js +0 -27
  120. package/dist/esm/v1/TextArea.native.js.map +0 -1
  121. package/dist/esm/v1/index.mjs +0 -3
  122. package/dist/esm/v1/index.mjs.map +0 -1
  123. package/dist/esm/v1/index.native.js +0 -3
  124. package/dist/esm/v1/index.native.js.map +0 -1
  125. package/dist/esm/v1/types.mjs +0 -2
  126. package/dist/esm/v1/types.mjs.map +0 -1
  127. package/dist/esm/v1/types.native.js +0 -2
  128. package/dist/esm/v1/types.native.js.map +0 -1
  129. package/dist/jsx/InputNativeProps.mjs.map +0 -1
  130. package/dist/jsx/index.js.map +0 -1
  131. package/dist/jsx/index.mjs.map +0 -1
  132. package/dist/jsx/inputTypes.test-d.mjs +0 -129
  133. package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
  134. package/dist/jsx/inputTypes.test-d.native.js +0 -131
  135. package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
  136. package/dist/jsx/types.mjs.map +0 -1
  137. package/dist/jsx/v1/Input.mjs +0 -164
  138. package/dist/jsx/v1/Input.mjs.map +0 -1
  139. package/dist/jsx/v1/Input.native.js +0 -183
  140. package/dist/jsx/v1/Input.native.js.map +0 -1
  141. package/dist/jsx/v1/TextArea.mjs +0 -27
  142. package/dist/jsx/v1/TextArea.mjs.map +0 -1
  143. package/dist/jsx/v1/TextArea.native.js +0 -55
  144. package/dist/jsx/v1/TextArea.native.js.map +0 -1
  145. package/dist/jsx/v1/index.mjs +0 -3
  146. package/dist/jsx/v1/index.mjs.map +0 -1
  147. package/dist/jsx/v1/index.native.js +0 -24
  148. package/dist/jsx/v1/index.native.js.map +0 -1
  149. package/dist/jsx/v1/types.mjs +0 -2
  150. package/dist/jsx/v1/types.mjs.map +0 -1
  151. package/dist/jsx/v1/types.native.js +0 -21
  152. package/dist/jsx/v1/types.native.js.map +0 -1
  153. package/src/inputTypes.test-d.ts +0 -245
  154. package/src/v1/Input.native.tsx +0 -153
  155. package/src/v1/Input.tsx +0 -190
  156. package/src/v1/TextArea.tsx +0 -35
  157. package/src/v1/index.ts +0 -3
  158. package/src/v1/types.ts +0 -65
  159. package/types/v1/Input.d.ts +0 -64
  160. package/types/v1/Input.d.ts.map +0 -1
  161. package/types/v1/Input.native.d.ts +0 -63
  162. package/types/v1/Input.native.d.ts.map +0 -1
  163. package/types/v1/TextArea.d.ts +0 -41
  164. package/types/v1/TextArea.d.ts.map +0 -1
  165. package/types/v1/index.d.ts +0 -4
  166. package/types/v1/index.d.ts.map +0 -1
  167. package/types/v1/types.d.ts +0 -39
  168. package/types/v1/types.d.ts.map +0 -1
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
5
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7,36 +8,27 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
8
  var __getProtoOf = Object.getPrototypeOf;
8
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
10
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
14
15
  };
15
16
  var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: () => from[key],
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ return to;
23
24
  };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: true
32
28
  }) : target, mod));
33
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
- value: true
35
- }), mod);
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
30
  var Input_native_exports = {};
37
- __export(Input_native_exports, {
38
- Input: () => Input
39
- });
31
+ __export(Input_native_exports, { Input: () => Input });
40
32
  module.exports = __toCommonJS(Input_native_exports);
41
33
  var import_jsx_runtime = require("react/jsx-runtime");
42
34
  var import_react = __toESM(require("react"), 1);
@@ -46,262 +38,174 @@ var import_focusable = require("@tamagui/focusable");
46
38
  var import_element = require("@tamagui/element");
47
39
  var import_shared = require("./shared.native.js");
48
40
  var StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]);
49
- var Input = StyledInput.styleable(function (props, forwardedRef) {
50
- var {
51
- // Web props we need to convert
52
- type,
53
- disabled,
54
- readOnly,
55
- id,
56
- rows,
57
- autoComplete,
58
- enterKeyHint,
59
- // Callbacks
60
- onChange,
61
- onInput,
62
- onKeyDown,
63
- onChangeText,
64
- onSubmitEditing,
65
- onSelectionChange,
66
- onEndEditing,
67
- onContentSizeChange,
68
- onScroll,
69
- onKeyPress: onKeyPressProp,
70
- selection,
71
- // Native-only props (pass through directly)
72
- keyboardAppearance,
73
- returnKeyType: returnKeyTypeProp,
74
- submitBehavior,
75
- blurOnSubmit,
76
- caretHidden,
77
- contextMenuHidden,
78
- selectTextOnFocus,
79
- secureTextEntry: secureTextEntryProp,
80
- maxFontSizeMultiplier,
81
- allowFontScaling,
82
- multiline: multilineProp,
83
- keyboardType: keyboardTypeProp,
84
- inputMode: inputModeProp,
85
- autoCapitalize: autoCapitalizeProp,
86
- autoCorrect: autoCorrectProp,
87
- autoFocusNative,
88
- textContentType,
89
- // iOS-only props
90
- clearButtonMode,
91
- clearTextOnFocus,
92
- enablesReturnKeyAutomatically,
93
- dataDetectorTypes,
94
- scrollEnabled,
95
- passwordRules,
96
- rejectResponderTermination,
97
- spellCheck,
98
- lineBreakStrategyIOS,
99
- lineBreakModeIOS,
100
- smartInsertDelete,
101
- inputAccessoryViewID,
102
- inputAccessoryViewButtonLabel,
103
- disableKeyboardShortcuts,
104
- // Android-only props
105
- importantForAutofill,
106
- disableFullscreenUI,
107
- inlineImageLeft,
108
- inlineImagePadding,
109
- returnKeyLabel,
110
- textBreakStrategy,
111
- textAlignVertical,
112
- verticalAlign,
113
- showSoftInputOnFocus,
114
- numberOfLines: numberOfLinesProp,
115
- // Web-only props to filter out
116
- // @ts-ignore
117
- dirname,
118
- min,
119
- max,
120
- minLength,
121
- multiple,
122
- name,
123
- pattern,
124
- required,
125
- step,
126
- render,
127
- ...rest
128
- } = props;
129
- var {
130
- ref,
131
- composedRef
132
- } = (0, import_element.useNativeInputRef)(forwardedRef);
133
- var secureTextEntry = secureTextEntryProp !== null && secureTextEntryProp !== void 0 ? secureTextEntryProp : false;
134
- var keyboardType = keyboardTypeProp !== null && keyboardTypeProp !== void 0 ? keyboardTypeProp : "default";
135
- var inputMode = inputModeProp;
136
- if (!secureTextEntryProp && !keyboardTypeProp && !inputModeProp) {
137
- switch (type) {
138
- case "password":
139
- secureTextEntry = true;
140
- break;
141
- case "email":
142
- keyboardType = "email-address";
143
- inputMode = "email";
144
- break;
145
- case "tel":
146
- keyboardType = "phone-pad";
147
- inputMode = "tel";
148
- break;
149
- case "number":
150
- keyboardType = "numeric";
151
- inputMode = "numeric";
152
- break;
153
- case "url":
154
- keyboardType = "url";
155
- inputMode = "url";
156
- break;
157
- case "search":
158
- inputMode = "search";
159
- break;
160
- }
161
- }
162
- var returnKeyType = returnKeyTypeProp;
163
- if (!returnKeyType && enterKeyHint) {
164
- switch (enterKeyHint) {
165
- case "done":
166
- returnKeyType = "done";
167
- break;
168
- case "go":
169
- returnKeyType = "go";
170
- break;
171
- case "next":
172
- returnKeyType = "next";
173
- break;
174
- case "search":
175
- returnKeyType = "search";
176
- break;
177
- case "send":
178
- returnKeyType = "send";
179
- break;
180
- }
181
- }
182
- var multiline = multilineProp !== null && multilineProp !== void 0 ? multilineProp : render === "textarea" || rows && rows > 1;
183
- var numberOfLines = numberOfLinesProp !== null && numberOfLinesProp !== void 0 ? numberOfLinesProp : rows;
184
- var autoCorrect = autoCorrectProp === "on" ? true : autoCorrectProp === "off" ? false : autoCorrectProp;
185
- var autoCapitalize = autoCapitalizeProp === "on" ? "sentences" : autoCapitalizeProp === "off" ? "none" : autoCapitalizeProp;
186
- import_react.default.useEffect(function () {
187
- if (!id || disabled) return;
188
- return (0, import_focusable.registerFocusable)(id, {
189
- focusAndSelect: function () {
190
- var _ref_current;
191
- return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
192
- },
193
- focus: function () {
194
- var _ref_current;
195
- return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
196
- }
197
- });
198
- }, [id, disabled]);
199
- var handleChangeText = function (text) {
200
- onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
201
- if (onChange) {
202
- onChange({
203
- target: {
204
- value: text
205
- },
206
- type: "change"
207
- });
208
- }
209
- if (onInput) {
210
- onInput({
211
- target: {
212
- value: text
213
- },
214
- type: "input"
215
- });
216
- }
217
- };
218
- var handleKeyPress = function (e) {
219
- onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);
220
- if (onKeyDown) {
221
- var {
222
- key
223
- } = e.nativeEvent;
224
- if (key === "Backspace" || key === "Enter" || key.length === 1) {
225
- onKeyDown({
226
- key,
227
- type: "keydown"
228
- });
229
- }
230
- }
231
- };
232
- var handleSubmitEditing = function (e) {
233
- if (onKeyDown) {
234
- onKeyDown({
235
- key: "Enter",
236
- type: "keydown"
237
- });
238
- }
239
- onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);
240
- };
241
- var handleSelectionChange = function (e) {
242
- onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);
243
- };
244
- var finalProps = {
245
- ...rest,
246
- editable: !disabled && !readOnly,
247
- secureTextEntry,
248
- keyboardType,
249
- keyboardAppearance,
250
- inputMode,
251
- returnKeyType,
252
- multiline,
253
- numberOfLines,
254
- selection,
255
- autoComplete,
256
- autoFocus: autoFocusNative,
257
- // callbacks
258
- onChangeText: handleChangeText,
259
- onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,
260
- onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,
261
- onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,
262
- onEndEditing,
263
- onContentSizeChange,
264
- onScroll,
265
- // cross-platform native props
266
- submitBehavior,
267
- blurOnSubmit,
268
- caretHidden,
269
- contextMenuHidden,
270
- selectTextOnFocus,
271
- maxFontSizeMultiplier,
272
- allowFontScaling,
273
- autoCapitalize,
274
- autoCorrect,
275
- textContentType,
276
- // iOS-only props
277
- clearButtonMode,
278
- clearTextOnFocus,
279
- enablesReturnKeyAutomatically,
280
- dataDetectorTypes,
281
- scrollEnabled,
282
- passwordRules,
283
- rejectResponderTermination,
284
- spellCheck,
285
- lineBreakStrategyIOS,
286
- lineBreakModeIOS,
287
- smartInsertDelete,
288
- inputAccessoryViewID,
289
- inputAccessoryViewButtonLabel,
290
- disableKeyboardShortcuts,
291
- // Android-only props
292
- importantForAutofill,
293
- disableFullscreenUI,
294
- inlineImageLeft,
295
- inlineImagePadding,
296
- returnKeyLabel,
297
- textBreakStrategy,
298
- textAlignVertical,
299
- verticalAlign,
300
- showSoftInputOnFocus
301
- };
302
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(StyledInput, {
303
- ref: composedRef,
304
- ...finalProps
305
- });
41
+ var Input = (0, import_core.createStyledHOC)(StyledInput, function(props, forwardedRef) {
42
+ var { type, disabled, readOnly, id, rows, autoComplete, enterKeyHint, onChange, onInput, onKeyDown, onChangeText, onSubmitEditing, onSelectionChange, onEndEditing, onContentSizeChange, onScroll, onKeyPress: onKeyPressProp, selection, keyboardAppearance, returnKeyType: returnKeyTypeProp, submitBehavior, blurOnSubmit, caretHidden, contextMenuHidden, selectTextOnFocus, secureTextEntry: secureTextEntryProp, maxFontSizeMultiplier, allowFontScaling, multiline: multilineProp, keyboardType: keyboardTypeProp, inputMode: inputModeProp, autoCapitalize: autoCapitalizeProp, autoCorrect: autoCorrectProp, autoFocusNative, textContentType, clearButtonMode, clearTextOnFocus, enablesReturnKeyAutomatically, dataDetectorTypes, scrollEnabled, passwordRules, rejectResponderTermination, spellCheck, lineBreakStrategyIOS, lineBreakModeIOS, smartInsertDelete, inputAccessoryViewID, inputAccessoryViewButtonLabel, disableKeyboardShortcuts, importantForAutofill, disableFullscreenUI, inlineImageLeft, inlineImagePadding, returnKeyLabel, textBreakStrategy, textAlignVertical, verticalAlign, showSoftInputOnFocus, numberOfLines: numberOfLinesProp, dirname, min, max, minLength, multiple, name, pattern, required, step, render, caretColor, cursorColor: cursorColorProp, selectionColor: selectionColorProp, ...rest } = props;
43
+ var { ref, composedRef } = (0, import_element.useNativeInputRef)(forwardedRef);
44
+ var secureTextEntry = secureTextEntryProp !== null && secureTextEntryProp !== void 0 ? secureTextEntryProp : false;
45
+ var keyboardType = keyboardTypeProp !== null && keyboardTypeProp !== void 0 ? keyboardTypeProp : "default";
46
+ var inputMode = inputModeProp;
47
+ if (!secureTextEntryProp && !keyboardTypeProp && !inputModeProp) {
48
+ switch (type) {
49
+ case "password":
50
+ secureTextEntry = true;
51
+ break;
52
+ case "email":
53
+ keyboardType = "email-address";
54
+ inputMode = "email";
55
+ break;
56
+ case "tel":
57
+ keyboardType = "phone-pad";
58
+ inputMode = "tel";
59
+ break;
60
+ case "number":
61
+ keyboardType = "numeric";
62
+ inputMode = "numeric";
63
+ break;
64
+ case "url":
65
+ keyboardType = "url";
66
+ inputMode = "url";
67
+ break;
68
+ case "search":
69
+ inputMode = "search";
70
+ break;
71
+ }
72
+ }
73
+ var returnKeyType = returnKeyTypeProp;
74
+ if (!returnKeyType && enterKeyHint) {
75
+ switch (enterKeyHint) {
76
+ case "done":
77
+ returnKeyType = "done";
78
+ break;
79
+ case "go":
80
+ returnKeyType = "go";
81
+ break;
82
+ case "next":
83
+ returnKeyType = "next";
84
+ break;
85
+ case "search":
86
+ returnKeyType = "search";
87
+ break;
88
+ case "send":
89
+ returnKeyType = "send";
90
+ break;
91
+ }
92
+ }
93
+ var multiline = multilineProp !== null && multilineProp !== void 0 ? multilineProp : render === "textarea" || rows && rows > 1;
94
+ var numberOfLines = numberOfLinesProp !== null && numberOfLinesProp !== void 0 ? numberOfLinesProp : rows;
95
+ var autoCorrect = autoCorrectProp === "on" ? true : autoCorrectProp === "off" ? false : autoCorrectProp;
96
+ var autoCapitalize = autoCapitalizeProp === "on" ? "sentences" : autoCapitalizeProp === "off" ? "none" : autoCapitalizeProp;
97
+ import_react.default.useEffect(function() {
98
+ if (!id || disabled) return;
99
+ return (0, import_focusable.registerFocusable)(id, {
100
+ focusAndSelect: function() {
101
+ var _ref_current;
102
+ return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
103
+ },
104
+ focus: function() {
105
+ var _ref_current;
106
+ return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
107
+ }
108
+ });
109
+ }, [id, disabled]);
110
+ var handleChangeText = function(text) {
111
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
112
+ if (onChange) {
113
+ onChange({
114
+ target: { value: text },
115
+ type: "change"
116
+ });
117
+ }
118
+ if (onInput) {
119
+ onInput({
120
+ target: { value: text },
121
+ type: "input"
122
+ });
123
+ }
124
+ };
125
+ var handleKeyPress = function(e) {
126
+ onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);
127
+ if (onKeyDown) {
128
+ var { key } = e.nativeEvent;
129
+ if (key === "Backspace" || key === "Enter" || key.length === 1) {
130
+ onKeyDown({
131
+ key,
132
+ type: "keydown"
133
+ });
134
+ }
135
+ }
136
+ };
137
+ var handleSubmitEditing = function(e) {
138
+ if (onKeyDown) {
139
+ onKeyDown({
140
+ key: "Enter",
141
+ type: "keydown"
142
+ });
143
+ }
144
+ onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);
145
+ };
146
+ var handleSelectionChange = function(e) {
147
+ onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);
148
+ };
149
+ var finalProps = {
150
+ ...rest,
151
+ editable: !disabled && !readOnly,
152
+ secureTextEntry,
153
+ keyboardType,
154
+ keyboardAppearance,
155
+ inputMode,
156
+ returnKeyType,
157
+ multiline,
158
+ numberOfLines,
159
+ selection,
160
+ autoComplete,
161
+ autoFocus: autoFocusNative,
162
+ onChangeText: handleChangeText,
163
+ onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,
164
+ onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,
165
+ onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,
166
+ onEndEditing,
167
+ onContentSizeChange,
168
+ onScroll,
169
+ submitBehavior,
170
+ blurOnSubmit,
171
+ caretHidden,
172
+ contextMenuHidden,
173
+ selectTextOnFocus,
174
+ maxFontSizeMultiplier,
175
+ allowFontScaling,
176
+ autoCapitalize,
177
+ autoCorrect,
178
+ textContentType,
179
+ clearButtonMode,
180
+ clearTextOnFocus,
181
+ enablesReturnKeyAutomatically,
182
+ dataDetectorTypes,
183
+ scrollEnabled,
184
+ passwordRules,
185
+ rejectResponderTermination,
186
+ spellCheck,
187
+ lineBreakStrategyIOS,
188
+ lineBreakModeIOS,
189
+ smartInsertDelete,
190
+ inputAccessoryViewID,
191
+ inputAccessoryViewButtonLabel,
192
+ disableKeyboardShortcuts,
193
+ importantForAutofill,
194
+ disableFullscreenUI,
195
+ inlineImageLeft,
196
+ inlineImagePadding,
197
+ returnKeyLabel,
198
+ textBreakStrategy,
199
+ textAlignVertical,
200
+ verticalAlign,
201
+ showSoftInputOnFocus,
202
+ cursorColor: cursorColorProp !== null && cursorColorProp !== void 0 ? cursorColorProp : caretColor,
203
+ selectionColor: selectionColorProp !== null && selectionColorProp !== void 0 ? selectionColorProp : caretColor
204
+ };
205
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledInput, {
206
+ ref: composedRef,
207
+ ...finalProps
208
+ });
306
209
  });
210
+
307
211
  //# sourceMappingURL=Input.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Input_native_exports","__export","Input","module","exports","__toCommonJS","import_jsx_runtime","require","import_react","__toESM","import_react_native","import_core","import_focusable","import_element","import_shared","StyledInput","styled","TextInput","styledBody","styleable","props","forwardedRef","type","disabled","readOnly","id","rows","autoComplete","enterKeyHint","onChange","onInput","onKeyDown","onChangeText","onSubmitEditing","onSelectionChange","onEndEditing","onContentSizeChange","onScroll","onKeyPress","onKeyPressProp","selection","keyboardAppearance","returnKeyType","returnKeyTypeProp","submitBehavior","blurOnSubmit","caretHidden","contextMenuHidden","selectTextOnFocus","secureTextEntry","secureTextEntryProp","maxFontSizeMultiplier","allowFontScaling","multiline","multilineProp","keyboardType","keyboardTypeProp","inputMode","inputModeProp","autoCapitalize","autoCapitalizeProp","autoCorrect","autoCorrectProp","autoFocusNative","textContentType","clearButtonMode","clearTextOnFocus","enablesReturnKeyAutomatically","dataDetectorTypes","scrollEnabled","passwordRules","rejectResponderTermination","spellCheck","lineBreakStrategyIOS","lineBreakModeIOS","smartInsertDelete","inputAccessoryViewID","inputAccessoryViewButtonLabel","disableKeyboardShortcuts","importantForAutofill","disableFullscreenUI","inlineImageLeft","inlineImagePadding","returnKeyLabel","textBreakStrategy","textAlignVertical","verticalAlign","showSoftInputOnFocus","numberOfLines","numberOfLinesProp","dirname","min","max","minLength","multiple","name","pattern","required","step","render","rest","ref","composedRef","useNativeInputRef","default","useEffect","registerFocusable","focusAndSelect","_ref_current","current","focus","handleChangeText","text","target","value","handleKeyPress","e","key","nativeEvent","length","handleSubmitEditing","handleSelectionChange","finalProps","editable","autoFocus","jsx"],"sources":["../../src/Input.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,KAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,oBAAA;AAAA,IAAAM,kBAAA,GAA4BC,OAAA;AAC5B,IAAAC,YAAA,GAAkBC,OAAA,CAAAF,OAAA;AAClB,IAAAG,mBAAA,GAA0BH,OAAA;AAC1B,IAAAI,WAAA,GAAuBJ,OAAA;AACvB,IAAAK,gBAAA,GAAkCL,OAAA;AAClC,IAAAM,cAAA,GAAkCN,OAAA;AAClC,IAAAO,aAAA,GAA2BP,OAAA;AAC3B,IAAIQ,WAAA,OAAcJ,WAAA,CAAAK,MAAA,EAAON,mBAAA,CAAAO,SAAA,EAAWH,aAAA,CAAAI,UAAA,CAAW,CAAC,GAAGJ,aAAA,CAAAI,UAAA,CAAW,CAAC,CAAC;AAIrD,IAAIhB,KAAA,GAAQa,WAAA,CAAYI,SAAA,CAAU,UAASC,KAAA,EAAOC,YAAA,EAAc;EACvE,IAAI;IAAA;IACJC,IAAA;IAAMC,QAAA;IAAUC,QAAA;IAAUC,EAAA;IAAIC,IAAA;IAAMC,YAAA;IAAcC,YAAA;IAAA;IAClDC,QA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AC,6BAAA;IACAC,wBAAA;IAAA;IAEAC,oBAAA;IACAC,mBAAA;IACAC,eAAA;IACAC,kBAAA;IACAC,cAAA;IACAC,iBAAA;IACAC,iBAAA;IACAC,aAAA;IACAC;EACJ;EACA,OAAqB,mBAAAjF,kBAAA,CAAAuH,GAAA,EAAK9G,WAAA,EAAa;IACnCsF,GAAA,EAAKC,WAAA;IACL,GAAGoB;EACP,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Input.native.js","names":[],"sources":["cjs/Input.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Input_native_exports = {};\n__export(Input_native_exports, {\n Input: () => Input\n});\nmodule.exports = __toCommonJS(Input_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_core = require(\"@tamagui/core\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_element = require(\"@tamagui/element\");\nvar import_shared = require(\"./shared\");\nvar StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]);\nvar Input = (0, import_core.createStyledHOC)(StyledInput, function(props, forwardedRef) {\n var {\n // Web props we need to convert\n type,\n disabled,\n readOnly,\n id,\n rows,\n autoComplete,\n enterKeyHint,\n // Callbacks\n onChange,\n onInput,\n onKeyDown,\n onChangeText,\n onSubmitEditing,\n onSelectionChange,\n onEndEditing,\n onContentSizeChange,\n onScroll,\n onKeyPress: onKeyPressProp,\n selection,\n // Native-only props (pass through directly)\n keyboardAppearance,\n returnKeyType: returnKeyTypeProp,\n submitBehavior,\n blurOnSubmit,\n caretHidden,\n contextMenuHidden,\n selectTextOnFocus,\n secureTextEntry: secureTextEntryProp,\n maxFontSizeMultiplier,\n allowFontScaling,\n multiline: multilineProp,\n keyboardType: keyboardTypeProp,\n inputMode: inputModeProp,\n autoCapitalize: autoCapitalizeProp,\n autoCorrect: autoCorrectProp,\n autoFocusNative,\n textContentType,\n // iOS-only props\n clearButtonMode,\n clearTextOnFocus,\n enablesReturnKeyAutomatically,\n dataDetectorTypes,\n scrollEnabled,\n passwordRules,\n rejectResponderTermination,\n spellCheck,\n lineBreakStrategyIOS,\n lineBreakModeIOS,\n smartInsertDelete,\n inputAccessoryViewID,\n inputAccessoryViewButtonLabel,\n disableKeyboardShortcuts,\n // Android-only props\n importantForAutofill,\n disableFullscreenUI,\n inlineImageLeft,\n inlineImagePadding,\n returnKeyLabel,\n textBreakStrategy,\n textAlignVertical,\n verticalAlign,\n showSoftInputOnFocus,\n numberOfLines: numberOfLinesProp,\n // Web-only props to filter out\n // @ts-ignore\n dirname,\n min,\n max,\n minLength,\n multiple,\n name,\n pattern,\n required,\n step,\n render,\n // caretColor is web-only as a CSS prop; on native forward to\n // cursorColor (Android) + selectionColor (iOS+Android caret) unless\n // those are explicitly set.\n // @ts-ignore - caretColor is typed as web-only in core\n caretColor,\n cursorColor: cursorColorProp,\n selectionColor: selectionColorProp,\n ...rest\n } = props;\n var { ref, composedRef } = (0, import_element.useNativeInputRef)(forwardedRef);\n var secureTextEntry = secureTextEntryProp !== null && secureTextEntryProp !== void 0 ? secureTextEntryProp : false;\n var keyboardType = keyboardTypeProp !== null && keyboardTypeProp !== void 0 ? keyboardTypeProp : \"default\";\n var inputMode = inputModeProp;\n if (!secureTextEntryProp && !keyboardTypeProp && !inputModeProp) {\n switch (type) {\n case \"password\":\n secureTextEntry = true;\n break;\n case \"email\":\n keyboardType = \"email-address\";\n inputMode = \"email\";\n break;\n case \"tel\":\n keyboardType = \"phone-pad\";\n inputMode = \"tel\";\n break;\n case \"number\":\n keyboardType = \"numeric\";\n inputMode = \"numeric\";\n break;\n case \"url\":\n keyboardType = \"url\";\n inputMode = \"url\";\n break;\n case \"search\":\n inputMode = \"search\";\n break;\n }\n }\n var returnKeyType = returnKeyTypeProp;\n if (!returnKeyType && enterKeyHint) {\n switch (enterKeyHint) {\n case \"done\":\n returnKeyType = \"done\";\n break;\n case \"go\":\n returnKeyType = \"go\";\n break;\n case \"next\":\n returnKeyType = \"next\";\n break;\n case \"search\":\n returnKeyType = \"search\";\n break;\n case \"send\":\n returnKeyType = \"send\";\n break;\n }\n }\n var multiline = multilineProp !== null && multilineProp !== void 0 ? multilineProp : render === \"textarea\" || rows && rows > 1;\n var numberOfLines = numberOfLinesProp !== null && numberOfLinesProp !== void 0 ? numberOfLinesProp : rows;\n var autoCorrect = autoCorrectProp === \"on\" ? true : autoCorrectProp === \"off\" ? false : autoCorrectProp;\n var autoCapitalize = autoCapitalizeProp === \"on\" ? \"sentences\" : autoCapitalizeProp === \"off\" ? \"none\" : autoCapitalizeProp;\n import_react.default.useEffect(function() {\n if (!id || disabled) return;\n return (0, import_focusable.registerFocusable)(id, {\n focusAndSelect: function() {\n var _ref_current;\n return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n },\n focus: function() {\n var _ref_current;\n return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n }\n });\n }, [\n id,\n disabled\n ]);\n var handleChangeText = function(text) {\n onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);\n if (onChange) {\n onChange({\n target: {\n value: text\n },\n type: \"change\"\n });\n }\n if (onInput) {\n onInput({\n target: {\n value: text\n },\n type: \"input\"\n });\n }\n };\n var handleKeyPress = function(e) {\n onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);\n if (onKeyDown) {\n var { key } = e.nativeEvent;\n if (key === \"Backspace\" || key === \"Enter\" || key.length === 1) {\n onKeyDown({\n key,\n type: \"keydown\"\n });\n }\n }\n };\n var handleSubmitEditing = function(e) {\n if (onKeyDown) {\n onKeyDown({\n key: \"Enter\",\n type: \"keydown\"\n });\n }\n onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);\n };\n var handleSelectionChange = function(e) {\n onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);\n };\n var finalProps = {\n ...rest,\n editable: !disabled && !readOnly,\n secureTextEntry,\n keyboardType,\n keyboardAppearance,\n inputMode,\n returnKeyType,\n multiline,\n numberOfLines,\n selection,\n autoComplete,\n autoFocus: autoFocusNative,\n // callbacks\n onChangeText: handleChangeText,\n onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,\n onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,\n onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,\n onEndEditing,\n onContentSizeChange,\n onScroll,\n // cross-platform native props\n submitBehavior,\n blurOnSubmit,\n caretHidden,\n contextMenuHidden,\n selectTextOnFocus,\n maxFontSizeMultiplier,\n allowFontScaling,\n autoCapitalize,\n autoCorrect,\n textContentType,\n // iOS-only props\n clearButtonMode,\n clearTextOnFocus,\n enablesReturnKeyAutomatically,\n dataDetectorTypes,\n scrollEnabled,\n passwordRules,\n rejectResponderTermination,\n spellCheck,\n lineBreakStrategyIOS,\n lineBreakModeIOS,\n smartInsertDelete,\n inputAccessoryViewID,\n inputAccessoryViewButtonLabel,\n disableKeyboardShortcuts,\n // Android-only props\n importantForAutofill,\n disableFullscreenUI,\n inlineImageLeft,\n inlineImagePadding,\n returnKeyLabel,\n textBreakStrategy,\n textAlignVertical,\n verticalAlign,\n showSoftInputOnFocus,\n // caretColor → cursorColor (Android) + selectionColor (iOS+Android),\n // unless the caller passed those explicitly.\n cursorColor: cursorColorProp !== null && cursorColorProp !== void 0 ? cursorColorProp : caretColor,\n selectionColor: selectionColorProp !== null && selectionColorProp !== void 0 ? selectionColorProp : caretColor\n };\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledInput, {\n ref: composedRef,\n ...finalProps\n });\n});\n//# sourceMappingURL=Input.native.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;A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,iBAAiB,aAAa,kBAAkB,sBAAsB,KAAK;EAC3E,mBAAmB,oBAAoB,wBAAwB,KAAK;EACpE;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA,aAAa,oBAAoB,QAAQ,oBAAoB,KAAK,IAAI,kBAAkB;EACxF,gBAAgB,uBAAuB,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB;CACtG;CACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,aAAa;EAC9D,KAAK;EACL,GAAG;CACL,CAAC;AACH,CAAC"}
@@ -1,18 +1,17 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ }
13
+ return to;
13
14
  };
14
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
15
- value: true
16
- }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
17
16
  var InputNativeProps_exports = {};
18
- module.exports = __toCommonJS(InputNativeProps_exports);
17
+ module.exports = __toCommonJS(InputNativeProps_exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var InputNativeProps_exports = {};
19
+ module.exports = __toCommonJS(InputNativeProps_exports);
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
15
16
  };
16
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
17
- value: true
18
- }), mod);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
18
  var InputNativeProps_exports = {};
20
19
  module.exports = __toCommonJS(InputNativeProps_exports);
20
+
21
21
  //# sourceMappingURL=InputNativeProps.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","InputNativeProps_exports"],"sources":["../../src/InputNativeProps.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA","ignoreList":[]}
1
+ {"version":3,"file":"InputNativeProps.native.js","names":[],"sources":["cjs/InputNativeProps.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar InputNativeProps_exports = {};\nmodule.exports = __toCommonJS(InputNativeProps_exports);\n//# sourceMappingURL=InputNativeProps.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,2BAA2B,CAAC;AAChC,OAAO,UAAU,aAAa,wBAAwB"}