@tamagui/input 2.7.7 → 3.0.0-beta.1091.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 (169) hide show
  1. package/dist/cjs/Input.cjs +72 -163
  2. package/dist/cjs/Input.native.cjs +208 -0
  3. package/dist/cjs/Input.native.js +186 -283
  4. package/dist/cjs/Input.native.js.map +1 -1
  5. package/dist/cjs/InputNativeProps.cjs +9 -11
  6. package/dist/cjs/InputNativeProps.native.cjs +18 -0
  7. package/dist/cjs/InputNativeProps.native.js +9 -10
  8. package/dist/cjs/InputNativeProps.native.js.map +1 -1
  9. package/dist/cjs/TextArea.cjs +23 -39
  10. package/dist/cjs/TextArea.native.cjs +38 -0
  11. package/dist/cjs/TextArea.native.js +23 -38
  12. package/dist/cjs/TextArea.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +15 -17
  14. package/dist/cjs/index.native.cjs +32 -0
  15. package/dist/cjs/index.native.js +15 -16
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/cjs/shared.cjs +74 -124
  18. package/dist/cjs/shared.native.cjs +101 -0
  19. package/dist/cjs/shared.native.js +80 -129
  20. package/dist/cjs/shared.native.js.map +1 -1
  21. package/dist/cjs/types.cjs +9 -11
  22. package/dist/cjs/types.native.cjs +18 -0
  23. package/dist/cjs/types.native.js +9 -10
  24. package/dist/cjs/types.native.js.map +1 -1
  25. package/dist/esm/Input.mjs +59 -139
  26. package/dist/esm/Input.mjs.map +1 -1
  27. package/dist/esm/Input.native.js +174 -261
  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 -22
  32. package/dist/esm/TextArea.mjs.map +1 -1
  33. package/dist/esm/TextArea.native.js +12 -22
  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 +59 -107
  39. package/dist/esm/shared.mjs.map +1 -1
  40. package/dist/esm/shared.native.js +64 -112
  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 +59 -139
  45. package/dist/jsx/Input.mjs.map +1 -1
  46. package/dist/jsx/Input.native.cjs +208 -0
  47. package/dist/jsx/Input.native.js +186 -283
  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 +18 -0
  51. package/dist/jsx/InputNativeProps.native.js +9 -10
  52. package/dist/jsx/InputNativeProps.native.js.map +1 -1
  53. package/dist/jsx/TextArea.mjs +12 -22
  54. package/dist/jsx/TextArea.mjs.map +1 -1
  55. package/dist/jsx/TextArea.native.cjs +38 -0
  56. package/dist/jsx/TextArea.native.js +23 -38
  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 +32 -0
  61. package/dist/jsx/index.native.js +15 -16
  62. package/dist/jsx/index.native.js.map +1 -1
  63. package/dist/jsx/shared.mjs +59 -107
  64. package/dist/jsx/shared.mjs.map +1 -1
  65. package/dist/jsx/shared.native.cjs +101 -0
  66. package/dist/jsx/shared.native.js +80 -129
  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 +18 -0
  70. package/dist/jsx/types.native.js +9 -10
  71. package/dist/jsx/types.native.js.map +1 -1
  72. package/package.json +17 -17
  73. package/src/Input.native.tsx +267 -242
  74. package/src/Input.tsx +150 -154
  75. package/src/TextArea.tsx +9 -18
  76. package/src/shared.tsx +56 -109
  77. package/src/types.ts +2 -2
  78. package/types/Input.d.ts +32 -50
  79. package/types/Input.d.ts.map +1 -1
  80. package/types/Input.native.d.ts +32 -50
  81. package/types/Input.native.d.ts.map +1 -1
  82. package/types/TextArea.d.ts +16 -34
  83. package/types/TextArea.d.ts.map +1 -1
  84. package/types/shared.d.ts +38 -109
  85. package/types/shared.d.ts.map +1 -1
  86. package/types/types.d.ts +2 -2
  87. package/types/types.d.ts.map +1 -1
  88. package/dist/cjs/inputTypes.test-d.cjs +0 -128
  89. package/dist/cjs/inputTypes.test-d.native.js +0 -131
  90. package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
  91. package/dist/cjs/v1/Input.cjs +0 -200
  92. package/dist/cjs/v1/Input.native.js +0 -183
  93. package/dist/cjs/v1/Input.native.js.map +0 -1
  94. package/dist/cjs/v1/TextArea.cjs +0 -52
  95. package/dist/cjs/v1/TextArea.native.js +0 -55
  96. package/dist/cjs/v1/TextArea.native.js.map +0 -1
  97. package/dist/cjs/v1/index.cjs +0 -21
  98. package/dist/cjs/v1/index.native.js +0 -24
  99. package/dist/cjs/v1/index.native.js.map +0 -1
  100. package/dist/cjs/v1/types.cjs +0 -18
  101. package/dist/cjs/v1/types.native.js +0 -21
  102. package/dist/cjs/v1/types.native.js.map +0 -1
  103. package/dist/esm/InputNativeProps.mjs.map +0 -1
  104. package/dist/esm/InputNativeProps.native.js.map +0 -1
  105. package/dist/esm/index.js.map +0 -1
  106. package/dist/esm/index.mjs.map +0 -1
  107. package/dist/esm/index.native.js.map +0 -1
  108. package/dist/esm/inputTypes.test-d.mjs +0 -129
  109. package/dist/esm/inputTypes.test-d.mjs.map +0 -1
  110. package/dist/esm/inputTypes.test-d.native.js +0 -129
  111. package/dist/esm/inputTypes.test-d.native.js.map +0 -1
  112. package/dist/esm/types.mjs.map +0 -1
  113. package/dist/esm/types.native.js.map +0 -1
  114. package/dist/esm/v1/Input.mjs +0 -164
  115. package/dist/esm/v1/Input.mjs.map +0 -1
  116. package/dist/esm/v1/Input.native.js +0 -144
  117. package/dist/esm/v1/Input.native.js.map +0 -1
  118. package/dist/esm/v1/TextArea.mjs +0 -27
  119. package/dist/esm/v1/TextArea.mjs.map +0 -1
  120. package/dist/esm/v1/TextArea.native.js +0 -27
  121. package/dist/esm/v1/TextArea.native.js.map +0 -1
  122. package/dist/esm/v1/index.mjs +0 -3
  123. package/dist/esm/v1/index.mjs.map +0 -1
  124. package/dist/esm/v1/index.native.js +0 -3
  125. package/dist/esm/v1/index.native.js.map +0 -1
  126. package/dist/esm/v1/types.mjs +0 -2
  127. package/dist/esm/v1/types.mjs.map +0 -1
  128. package/dist/esm/v1/types.native.js +0 -2
  129. package/dist/esm/v1/types.native.js.map +0 -1
  130. package/dist/jsx/InputNativeProps.mjs.map +0 -1
  131. package/dist/jsx/index.js.map +0 -1
  132. package/dist/jsx/index.mjs.map +0 -1
  133. package/dist/jsx/inputTypes.test-d.mjs +0 -129
  134. package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
  135. package/dist/jsx/inputTypes.test-d.native.js +0 -131
  136. package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
  137. package/dist/jsx/types.mjs.map +0 -1
  138. package/dist/jsx/v1/Input.mjs +0 -164
  139. package/dist/jsx/v1/Input.mjs.map +0 -1
  140. package/dist/jsx/v1/Input.native.js +0 -183
  141. package/dist/jsx/v1/Input.native.js.map +0 -1
  142. package/dist/jsx/v1/TextArea.mjs +0 -27
  143. package/dist/jsx/v1/TextArea.mjs.map +0 -1
  144. package/dist/jsx/v1/TextArea.native.js +0 -55
  145. package/dist/jsx/v1/TextArea.native.js.map +0 -1
  146. package/dist/jsx/v1/index.mjs +0 -3
  147. package/dist/jsx/v1/index.mjs.map +0 -1
  148. package/dist/jsx/v1/index.native.js +0 -24
  149. package/dist/jsx/v1/index.native.js.map +0 -1
  150. package/dist/jsx/v1/types.mjs +0 -2
  151. package/dist/jsx/v1/types.mjs.map +0 -1
  152. package/dist/jsx/v1/types.native.js +0 -21
  153. package/dist/jsx/v1/types.native.js.map +0 -1
  154. package/src/inputTypes.test-d.ts +0 -245
  155. package/src/v1/Input.native.tsx +0 -153
  156. package/src/v1/Input.tsx +0 -190
  157. package/src/v1/TextArea.tsx +0 -35
  158. package/src/v1/index.ts +0 -3
  159. package/src/v1/types.ts +0 -65
  160. package/types/v1/Input.d.ts +0 -64
  161. package/types/v1/Input.d.ts.map +0 -1
  162. package/types/v1/Input.native.d.ts +0 -63
  163. package/types/v1/Input.native.d.ts.map +0 -1
  164. package/types/v1/TextArea.d.ts +0 -41
  165. package/types/v1/TextArea.d.ts.map +0 -1
  166. package/types/v1/index.d.ts +0 -4
  167. package/types/v1/index.d.ts.map +0 -1
  168. package/types/v1/types.d.ts +0 -39
  169. package/types/v1/types.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["View","styled","useTheme","registerFocusable","useWebRef","React","styledBody","jsx","StyledInput","Input","styleable","props","_forwardedRef","disabled","id","onChangeText","onSubmitEditing","onSelectionChange","selection","placeholderTextColor","selectionColor","rows","keyboardAppearance","returnKeyType","submitBehavior","blurOnSubmit","caretHidden","contextMenuHidden","selectTextOnFocus","secureTextEntry","maxFontSizeMultiplier","allowFontScaling","multiline","keyboardType","autoCapitalize","autoCapitalizeProp","autoCorrect","autoCorrectProp","autoFocusNative","textContentType","onEndEditing","onContentSizeChange","onScroll","onKeyPress","clearButtonMode","clearTextOnFocus","enablesReturnKeyAutomatically","dataDetectorTypes","scrollEnabled","passwordRules","rejectResponderTermination","spellCheck","lineBreakStrategyIOS","lineBreakModeIOS","smartInsertDelete","inputAccessoryViewID","inputAccessoryViewButtonLabel","disableKeyboardShortcuts","cursorColor","selectionHandleColor","underlineColorAndroid","importantForAutofill","disableFullscreenUI","inlineImageLeft","inlineImagePadding","returnKeyLabel","textBreakStrategy","textAlignVertical","verticalAlign","showSoftInputOnFocus","numberOfLines","rest","ref","composedRef","theme","useEffect","node","current","handleSelectionChange","nativeEvent","start","selectionStart","end","selectionEnd","addEventListener","removeEventListener","setSelectionRange","focusAndSelect","focus","handleKeyDown","e","key","text","target","value","onKeyDown","handleChange","onChange","finalProps","style","variable"],"sources":["../../src/Input.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAwBA,IAAA,EAAMC,MAAA,EAAQC,QAAA,QAAgB;AACtD,SAASC,iBAAA,QAAyB;AAClC,SAASC,SAAA,QAAiB;AAC1B,OAAOC,KAAA,MAAW;AAClB,SAASC,UAAA,QAAkB;AAqKlB,SAAAC,GAAA;AAlKT,MAAMC,WAAA,GAAcP,MAAA,CAAOD,IAAA,EAAMM,UAAA,CAAW,CAAC,GAAGA,UAAA,CAAW,CAAC,CAAC;AAMtD,MAAMG,KAAA,GAAQD,WAAA,CAAYE,SAAA,CAA2B,CAACC,KAAA,EAAOC,aAAA,KAAkB;EACpF,MAAM;IACJC,QAAA;IACAC,EAAA;IACAC,YAAA;IACAC,eAAA;IACAC,iBAAA;IACAC,SAAA;IACAC,oBAAA;IACAC,cAAA;IACAC,IAAA;IAAA;IAGAC,kBAAA;IACAC,aAAA;IACAC,cAAA;IACAC,YAAA;IACAC,WAAA;IACAC,iBAAA;IACAC,iBAAA;IACAC,eAAA;IACAC,qBAAA;IACAC,gBAAA;IACAC,SAAA;IACAC,YAAA;IACAC,cAAA,EAAgBC,kBAAA;IAChBC,WAAA,EAAaC,eAAA;IACbC,eAAA;IACAC,eAAA;IACAC,YAAA;IACAC,mBAAA;IACAC,QAAA;IACAC,UAAA;IAAA;IAGAC,eAAA;IACAC,gBAAA;IACAC,6BAAA;IACAC,iBAAA;IACAC,aAAA;IACAC,aAAA;IACAC,0BAAA;IACAC,UAAA;IACAC,oBAAA;IACAC,gBAAA;IACAC,iBAAA;IACAC,oBAAA;IACAC,6BAAA;IACAC,wBAAA;IAAA;IAGAC,WAAA;IACAC,oBAAA;IACAC,qBAAA;IACAC,oBAAA;IACAC,mBAAA;IACAC,eAAA;IACAC,kBAAA;IACAC,cAAA;IACAC,iBAAA;IACAC,iBAAA;IACAC,aAAA;IACAC,oBAAA;IACAC,aAAA;IAEA,GAAGC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A;IAAYgE,GAAA,EAAKC,WAAA;IAAc,GAAGyB;EAAA,CAAY;AACxD,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Input.js","names":[],"sources":["jsx/Input.js"],"sourcesContent":["import { createStyledHOC, View, styled } from \"@tamagui/core\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport { useWebRef } from \"@tamagui/element\";\nimport React from \"react\";\nimport { resolveMultilineInputSize, styledBody } from \"./shared\";\nimport { jsx } from \"react/jsx-runtime\";\nconst StyledInput = styled(View, styledBody[0], styledBody[1]).resolve(\n resolveMultilineInputSize\n);\nconst Input = createStyledHOC(\n StyledInput,\n (props, _forwardedRef) => {\n const {\n disabled,\n id,\n onChangeText,\n onSubmitEditing,\n onSelectionChange,\n selection,\n rows,\n // Native-only props (ignored on web)\n keyboardAppearance,\n returnKeyType,\n submitBehavior,\n blurOnSubmit,\n caretHidden,\n contextMenuHidden,\n selectTextOnFocus,\n secureTextEntry,\n maxFontSizeMultiplier,\n allowFontScaling,\n multiline,\n keyboardType,\n autoCapitalize: autoCapitalizeProp,\n autoCorrect: autoCorrectProp,\n autoFocusNative,\n textContentType,\n onEndEditing,\n onContentSizeChange,\n onScroll,\n onKeyPress,\n // iOS-only props (ignored on web)\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 (ignored on web)\n underlineColorAndroid,\n importantForAutofill,\n disableFullscreenUI,\n inlineImageLeft,\n inlineImagePadding,\n returnKeyLabel,\n textBreakStrategy,\n textAlignVertical,\n verticalAlign,\n showSoftInputOnFocus,\n numberOfLines,\n ...rest\n } = props;\n const { ref, composedRef } = useWebRef(_forwardedRef);\n const autoCorrect = autoCorrectProp === true ? \"on\" : autoCorrectProp === false ? \"off\" : autoCorrectProp;\n const autoCapitalize = autoCapitalizeProp === \"sentences\" || autoCapitalizeProp === \"words\" ? \"on\" : autoCapitalizeProp === \"none\" || autoCapitalizeProp === \"characters\" ? \"off\" : autoCapitalizeProp;\n React.useEffect(() => {\n if (!onSelectionChange) return;\n const node = ref.current;\n if (!node) return;\n const handleSelectionChange = () => {\n onSelectionChange({\n nativeEvent: {\n selection: {\n start: node.selectionStart ?? 0,\n end: node.selectionEnd ?? 0\n }\n }\n });\n };\n node.addEventListener(\"select\", handleSelectionChange);\n return () => node.removeEventListener(\"select\", handleSelectionChange);\n }, [onSelectionChange]);\n React.useEffect(() => {\n if (selection && ref.current) {\n ref.current.setSelectionRange(selection.start, selection.end ?? selection.start);\n }\n }, [selection?.start, selection?.end]);\n React.useEffect(() => {\n if (!id || disabled) return;\n return registerFocusable(id, {\n focusAndSelect: () => ref.current?.focus(),\n focus: () => ref.current?.focus()\n });\n }, [id, disabled]);\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\" && onSubmitEditing) {\n onSubmitEditing({\n nativeEvent: { text: e.target.value }\n });\n }\n rest.onKeyDown?.(e);\n };\n const handleChange = (e) => {\n onChangeText?.(e.target.value);\n rest.onChange?.(e);\n };\n const finalProps = {\n ...rest,\n disabled,\n id,\n rows,\n autoCorrect,\n autoCapitalize,\n onKeyDown: onSubmitEditing ? handleKeyDown : rest.onKeyDown,\n onChange: onChangeText ? handleChange : rest.onChange\n };\n return /* @__PURE__ */ jsx(StyledInput, { ref: composedRef, ...finalProps });\n }\n);\nexport {\n Input\n};\n//# sourceMappingURL=Input.js.map\n"],"mappings":";;;;;;;;AAMA,MAAM,cAAc,OAAO,MAAM,WAAW,IAAI,WAAW,EAAE,CAAC,CAAC,QAC7D,yBACF;AACA,MAAM,QAAQ,gBACZ,cACC,OAAO,kBAAkB;CACxB,MAAM,EACJ,UACA,IACA,cACA,iBACA,mBACA,WACA,MAEA,oBACA,eACA,gBACA,cACA,aACA,mBACA,mBACA,iB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AAE,MAAM,EAAE,OAAO,MAAM,EACtC,CAAC;EACH;EACA,KAAK,YAAY,CAAC;CACpB;CACA,MAAM,gBAAgB,MAAM;EAC1B,eAAe,EAAE,OAAO,KAAK;EAC7B,KAAK,WAAW,CAAC;CACnB;CACA,MAAM,aAAa;EACjB,GAAG;EACH;EACA;EACA;EACA;EACA;EACA,WAAW,kBAAkB,gBAAgB,KAAK;EAClD,UAAU,eAAe,eAAe,KAAK;CAC/C;CACA,OAAuB,oBAAI,aAAa;EAAE,KAAK;EAAa,GAAG;CAAW,CAAC;AAC7E,CACF"}
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ 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;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var Input_native_exports = {};
30
+ __export(Input_native_exports, { Input: () => Input });
31
+ module.exports = __toCommonJS(Input_native_exports);
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var import_react = __toESM(require("react"), 1);
34
+ var import_react_native = require("react-native");
35
+ var import_core = require("@tamagui/core");
36
+ var import_focusable = require("@tamagui/focusable");
37
+ var import_element = require("@tamagui/element");
38
+ var import_shared = require("./shared.native.js");
39
+ var StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]).resolve(import_shared.resolveMultilineInputSize);
40
+ var Input = (0, import_core.createStyledHOC)(StyledInput, function(props, forwardedRef) {
41
+ 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;
42
+ var { ref, composedRef } = (0, import_element.useNativeInputRef)(forwardedRef);
43
+ var secureTextEntry = secureTextEntryProp !== null && secureTextEntryProp !== void 0 ? secureTextEntryProp : false;
44
+ var keyboardType = keyboardTypeProp !== null && keyboardTypeProp !== void 0 ? keyboardTypeProp : "default";
45
+ var inputMode = inputModeProp;
46
+ if (!secureTextEntryProp && !keyboardTypeProp && !inputModeProp) {
47
+ switch (type) {
48
+ case "password":
49
+ secureTextEntry = true;
50
+ break;
51
+ case "email":
52
+ keyboardType = "email-address";
53
+ inputMode = "email";
54
+ break;
55
+ case "tel":
56
+ keyboardType = "phone-pad";
57
+ inputMode = "tel";
58
+ break;
59
+ case "number":
60
+ keyboardType = "numeric";
61
+ inputMode = "numeric";
62
+ break;
63
+ case "url":
64
+ keyboardType = "url";
65
+ inputMode = "url";
66
+ break;
67
+ case "search":
68
+ inputMode = "search";
69
+ break;
70
+ }
71
+ }
72
+ var returnKeyType = returnKeyTypeProp;
73
+ if (!returnKeyType && enterKeyHint) {
74
+ switch (enterKeyHint) {
75
+ case "done":
76
+ returnKeyType = "done";
77
+ break;
78
+ case "go":
79
+ returnKeyType = "go";
80
+ break;
81
+ case "next":
82
+ returnKeyType = "next";
83
+ break;
84
+ case "search":
85
+ returnKeyType = "search";
86
+ break;
87
+ case "send":
88
+ returnKeyType = "send";
89
+ break;
90
+ }
91
+ }
92
+ var multiline = multilineProp !== null && multilineProp !== void 0 ? multilineProp : render === "textarea" || rows && rows > 1;
93
+ var numberOfLines = numberOfLinesProp !== null && numberOfLinesProp !== void 0 ? numberOfLinesProp : rows;
94
+ var autoCorrect = autoCorrectProp === "on" ? true : autoCorrectProp === "off" ? false : autoCorrectProp;
95
+ var autoCapitalize = autoCapitalizeProp === "on" ? "sentences" : autoCapitalizeProp === "off" ? "none" : autoCapitalizeProp;
96
+ import_react.default.useEffect(function() {
97
+ if (!id || disabled) return;
98
+ return (0, import_focusable.registerFocusable)(id, {
99
+ focusAndSelect: function() {
100
+ var _ref_current;
101
+ return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
102
+ },
103
+ focus: function() {
104
+ var _ref_current;
105
+ return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
106
+ }
107
+ });
108
+ }, [id, disabled]);
109
+ var handleChangeText = function(text) {
110
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
111
+ if (onChange) {
112
+ onChange({
113
+ target: { value: text },
114
+ type: "change"
115
+ });
116
+ }
117
+ if (onInput) {
118
+ onInput({
119
+ target: { value: text },
120
+ type: "input"
121
+ });
122
+ }
123
+ };
124
+ var handleKeyPress = function(e) {
125
+ onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);
126
+ if (onKeyDown) {
127
+ var { key } = e.nativeEvent;
128
+ if (key === "Backspace" || key === "Enter" || key.length === 1) {
129
+ onKeyDown({
130
+ key,
131
+ type: "keydown"
132
+ });
133
+ }
134
+ }
135
+ };
136
+ var handleSubmitEditing = function(e) {
137
+ if (onKeyDown) {
138
+ onKeyDown({
139
+ key: "Enter",
140
+ type: "keydown"
141
+ });
142
+ }
143
+ onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);
144
+ };
145
+ var handleSelectionChange = function(e) {
146
+ onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);
147
+ };
148
+ var finalProps = {
149
+ ...rest,
150
+ editable: !disabled && !readOnly,
151
+ secureTextEntry,
152
+ keyboardType,
153
+ keyboardAppearance,
154
+ inputMode,
155
+ returnKeyType,
156
+ multiline,
157
+ numberOfLines,
158
+ selection,
159
+ autoComplete,
160
+ autoFocus: autoFocusNative,
161
+ onChangeText: handleChangeText,
162
+ onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,
163
+ onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,
164
+ onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,
165
+ onEndEditing,
166
+ onContentSizeChange,
167
+ onScroll,
168
+ submitBehavior,
169
+ blurOnSubmit,
170
+ caretHidden,
171
+ contextMenuHidden,
172
+ selectTextOnFocus,
173
+ maxFontSizeMultiplier,
174
+ allowFontScaling,
175
+ autoCapitalize,
176
+ autoCorrect,
177
+ textContentType,
178
+ clearButtonMode,
179
+ clearTextOnFocus,
180
+ enablesReturnKeyAutomatically,
181
+ dataDetectorTypes,
182
+ scrollEnabled,
183
+ passwordRules,
184
+ rejectResponderTermination,
185
+ spellCheck,
186
+ lineBreakStrategyIOS,
187
+ lineBreakModeIOS,
188
+ smartInsertDelete,
189
+ inputAccessoryViewID,
190
+ inputAccessoryViewButtonLabel,
191
+ disableKeyboardShortcuts,
192
+ importantForAutofill,
193
+ disableFullscreenUI,
194
+ inlineImageLeft,
195
+ inlineImagePadding,
196
+ returnKeyLabel,
197
+ textBreakStrategy,
198
+ textAlignVertical,
199
+ verticalAlign,
200
+ showSoftInputOnFocus,
201
+ cursorColor: cursorColorProp !== null && cursorColorProp !== void 0 ? cursorColorProp : caretColor,
202
+ selectionColor: selectionColorProp !== null && selectionColorProp !== void 0 ? selectionColorProp : caretColor
203
+ };
204
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledInput, {
205
+ ref: composedRef,
206
+ ...finalProps
207
+ });
208
+ });