@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.
- package/dist/cjs/Input.cjs +78 -162
- package/dist/cjs/Input.native.cjs +209 -0
- package/dist/cjs/Input.native.js +186 -282
- package/dist/cjs/Input.native.js.map +1 -1
- package/dist/cjs/InputNativeProps.cjs +10 -11
- package/dist/cjs/InputNativeProps.native.cjs +19 -0
- package/dist/cjs/InputNativeProps.native.js +10 -10
- package/dist/cjs/InputNativeProps.native.js.map +1 -1
- package/dist/cjs/TextArea.cjs +25 -38
- package/dist/cjs/TextArea.native.cjs +41 -0
- package/dist/cjs/TextArea.native.js +25 -37
- package/dist/cjs/TextArea.native.js.map +1 -1
- package/dist/cjs/index.cjs +16 -17
- package/dist/cjs/index.native.cjs +33 -0
- package/dist/cjs/index.native.js +16 -16
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared.cjs +115 -122
- package/dist/cjs/shared.native.cjs +144 -0
- package/dist/cjs/shared.native.js +120 -126
- package/dist/cjs/shared.native.js.map +1 -1
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/Input.mjs +63 -137
- package/dist/esm/Input.mjs.map +1 -1
- package/dist/esm/Input.native.js +172 -259
- package/dist/esm/Input.native.js.map +1 -1
- package/dist/esm/InputNativeProps.mjs +0 -2
- package/dist/esm/InputNativeProps.native.js +0 -2
- package/dist/esm/TextArea.mjs +12 -20
- package/dist/esm/TextArea.mjs.map +1 -1
- package/dist/esm/TextArea.native.js +12 -20
- package/dist/esm/TextArea.native.js.map +1 -1
- package/dist/esm/index.js +6 -4
- package/dist/esm/index.mjs +6 -4
- package/dist/esm/index.native.js +6 -4
- package/dist/esm/shared.mjs +99 -104
- package/dist/esm/shared.mjs.map +1 -1
- package/dist/esm/shared.native.js +104 -109
- package/dist/esm/shared.native.js.map +1 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/dist/jsx/Input.mjs +63 -137
- package/dist/jsx/Input.mjs.map +1 -1
- package/dist/jsx/Input.native.cjs +209 -0
- package/dist/jsx/Input.native.js +186 -282
- package/dist/jsx/Input.native.js.map +1 -1
- package/dist/jsx/InputNativeProps.mjs +0 -2
- package/dist/jsx/InputNativeProps.native.cjs +19 -0
- package/dist/jsx/InputNativeProps.native.js +10 -10
- package/dist/jsx/InputNativeProps.native.js.map +1 -1
- package/dist/jsx/TextArea.mjs +12 -20
- package/dist/jsx/TextArea.mjs.map +1 -1
- package/dist/jsx/TextArea.native.cjs +41 -0
- package/dist/jsx/TextArea.native.js +25 -37
- package/dist/jsx/TextArea.native.js.map +1 -1
- package/dist/jsx/index.js +6 -4
- package/dist/jsx/index.mjs +6 -4
- package/dist/jsx/index.native.cjs +33 -0
- package/dist/jsx/index.native.js +16 -16
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared.mjs +99 -104
- package/dist/jsx/shared.mjs.map +1 -1
- package/dist/jsx/shared.native.cjs +144 -0
- package/dist/jsx/shared.native.js +120 -126
- package/dist/jsx/shared.native.js.map +1 -1
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.native.cjs +19 -0
- package/dist/jsx/types.native.js +10 -10
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +13 -15
- package/src/Input.native.tsx +263 -240
- package/src/Input.tsx +162 -152
- package/src/TextArea.tsx +6 -14
- package/src/shared.tsx +65 -70
- package/src/types.ts +1 -1
- package/types/Input.d.ts +57 -41
- package/types/Input.d.ts.map +1 -1
- package/types/Input.native.d.ts +57 -41
- package/types/Input.native.d.ts.map +1 -1
- package/types/TextArea.d.ts +172 -24
- package/types/TextArea.d.ts.map +1 -1
- package/types/shared.d.ts +14 -99
- package/types/shared.d.ts.map +1 -1
- package/types/types.d.ts +1 -1
- package/dist/cjs/inputTypes.test-d.cjs +0 -128
- package/dist/cjs/inputTypes.test-d.native.js +0 -131
- package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
- package/dist/cjs/v1/Input.cjs +0 -200
- package/dist/cjs/v1/Input.native.js +0 -183
- package/dist/cjs/v1/Input.native.js.map +0 -1
- package/dist/cjs/v1/TextArea.cjs +0 -52
- package/dist/cjs/v1/TextArea.native.js +0 -55
- package/dist/cjs/v1/TextArea.native.js.map +0 -1
- package/dist/cjs/v1/index.cjs +0 -21
- package/dist/cjs/v1/index.native.js +0 -24
- package/dist/cjs/v1/index.native.js.map +0 -1
- package/dist/cjs/v1/types.cjs +0 -18
- package/dist/cjs/v1/types.native.js +0 -21
- package/dist/cjs/v1/types.native.js.map +0 -1
- package/dist/esm/InputNativeProps.mjs.map +0 -1
- package/dist/esm/InputNativeProps.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/inputTypes.test-d.mjs +0 -129
- package/dist/esm/inputTypes.test-d.mjs.map +0 -1
- package/dist/esm/inputTypes.test-d.native.js +0 -129
- package/dist/esm/inputTypes.test-d.native.js.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
- package/dist/esm/v1/Input.mjs +0 -164
- package/dist/esm/v1/Input.mjs.map +0 -1
- package/dist/esm/v1/Input.native.js +0 -144
- package/dist/esm/v1/Input.native.js.map +0 -1
- package/dist/esm/v1/TextArea.mjs +0 -27
- package/dist/esm/v1/TextArea.mjs.map +0 -1
- package/dist/esm/v1/TextArea.native.js +0 -27
- package/dist/esm/v1/TextArea.native.js.map +0 -1
- package/dist/esm/v1/index.mjs +0 -3
- package/dist/esm/v1/index.mjs.map +0 -1
- package/dist/esm/v1/index.native.js +0 -3
- package/dist/esm/v1/index.native.js.map +0 -1
- package/dist/esm/v1/types.mjs +0 -2
- package/dist/esm/v1/types.mjs.map +0 -1
- package/dist/esm/v1/types.native.js +0 -2
- package/dist/esm/v1/types.native.js.map +0 -1
- package/dist/jsx/InputNativeProps.mjs.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/inputTypes.test-d.mjs +0 -129
- package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
- package/dist/jsx/inputTypes.test-d.native.js +0 -131
- package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
- package/dist/jsx/types.mjs.map +0 -1
- package/dist/jsx/v1/Input.mjs +0 -164
- package/dist/jsx/v1/Input.mjs.map +0 -1
- package/dist/jsx/v1/Input.native.js +0 -183
- package/dist/jsx/v1/Input.native.js.map +0 -1
- package/dist/jsx/v1/TextArea.mjs +0 -27
- package/dist/jsx/v1/TextArea.mjs.map +0 -1
- package/dist/jsx/v1/TextArea.native.js +0 -55
- package/dist/jsx/v1/TextArea.native.js.map +0 -1
- package/dist/jsx/v1/index.mjs +0 -3
- package/dist/jsx/v1/index.mjs.map +0 -1
- package/dist/jsx/v1/index.native.js +0 -24
- package/dist/jsx/v1/index.native.js.map +0 -1
- package/dist/jsx/v1/types.mjs +0 -2
- package/dist/jsx/v1/types.mjs.map +0 -1
- package/dist/jsx/v1/types.native.js +0 -21
- package/dist/jsx/v1/types.native.js.map +0 -1
- package/src/inputTypes.test-d.ts +0 -245
- package/src/v1/Input.native.tsx +0 -153
- package/src/v1/Input.tsx +0 -190
- package/src/v1/TextArea.tsx +0 -35
- package/src/v1/index.ts +0 -3
- package/src/v1/types.ts +0 -65
- package/types/v1/Input.d.ts +0 -64
- package/types/v1/Input.d.ts.map +0 -1
- package/types/v1/Input.native.d.ts +0 -63
- package/types/v1/Input.native.d.ts.map +0 -1
- package/types/v1/TextArea.d.ts +0 -41
- package/types/v1/TextArea.d.ts.map +0 -1
- package/types/v1/index.d.ts +0 -4
- package/types/v1/index.d.ts.map +0 -1
- package/types/v1/types.d.ts +0 -39
- package/types/v1/types.d.ts.map +0 -1
package/dist/esm/Input.native.js
CHANGED
|
@@ -1,268 +1,181 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { TextInput } from "react-native";
|
|
4
|
-
import { styled } from "@tamagui/core";
|
|
4
|
+
import { createStyledHOC, styled } from "@tamagui/core";
|
|
5
5
|
import { registerFocusable } from "@tamagui/focusable";
|
|
6
6
|
import { useNativeInputRef } from "@tamagui/element";
|
|
7
7
|
import { styledBody } from "./shared.native.js";
|
|
8
|
+
|
|
8
9
|
var StyledInput = styled(TextInput, styledBody[0], styledBody[1]);
|
|
9
|
-
var Input = StyledInput
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
};
|
|
178
|
-
var handleKeyPress = function (e) {
|
|
179
|
-
onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);
|
|
180
|
-
if (onKeyDown) {
|
|
181
|
-
var {
|
|
182
|
-
key
|
|
183
|
-
} = e.nativeEvent;
|
|
184
|
-
if (key === "Backspace" || key === "Enter" || key.length === 1) {
|
|
185
|
-
onKeyDown({
|
|
186
|
-
key,
|
|
187
|
-
type: "keydown"
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
var handleSubmitEditing = function (e) {
|
|
193
|
-
if (onKeyDown) {
|
|
194
|
-
onKeyDown({
|
|
195
|
-
key: "Enter",
|
|
196
|
-
type: "keydown"
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);
|
|
200
|
-
};
|
|
201
|
-
var handleSelectionChange = function (e) {
|
|
202
|
-
onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);
|
|
203
|
-
};
|
|
204
|
-
var finalProps = {
|
|
205
|
-
...rest,
|
|
206
|
-
editable: !disabled && !readOnly,
|
|
207
|
-
secureTextEntry,
|
|
208
|
-
keyboardType,
|
|
209
|
-
keyboardAppearance,
|
|
210
|
-
inputMode,
|
|
211
|
-
returnKeyType,
|
|
212
|
-
multiline,
|
|
213
|
-
numberOfLines,
|
|
214
|
-
selection,
|
|
215
|
-
autoComplete,
|
|
216
|
-
autoFocus: autoFocusNative,
|
|
217
|
-
// callbacks
|
|
218
|
-
onChangeText: handleChangeText,
|
|
219
|
-
onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,
|
|
220
|
-
onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,
|
|
221
|
-
onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,
|
|
222
|
-
onEndEditing,
|
|
223
|
-
onContentSizeChange,
|
|
224
|
-
onScroll,
|
|
225
|
-
// cross-platform native props
|
|
226
|
-
submitBehavior,
|
|
227
|
-
blurOnSubmit,
|
|
228
|
-
caretHidden,
|
|
229
|
-
contextMenuHidden,
|
|
230
|
-
selectTextOnFocus,
|
|
231
|
-
maxFontSizeMultiplier,
|
|
232
|
-
allowFontScaling,
|
|
233
|
-
autoCapitalize,
|
|
234
|
-
autoCorrect,
|
|
235
|
-
textContentType,
|
|
236
|
-
// iOS-only props
|
|
237
|
-
clearButtonMode,
|
|
238
|
-
clearTextOnFocus,
|
|
239
|
-
enablesReturnKeyAutomatically,
|
|
240
|
-
dataDetectorTypes,
|
|
241
|
-
scrollEnabled,
|
|
242
|
-
passwordRules,
|
|
243
|
-
rejectResponderTermination,
|
|
244
|
-
spellCheck,
|
|
245
|
-
lineBreakStrategyIOS,
|
|
246
|
-
lineBreakModeIOS,
|
|
247
|
-
smartInsertDelete,
|
|
248
|
-
inputAccessoryViewID,
|
|
249
|
-
inputAccessoryViewButtonLabel,
|
|
250
|
-
disableKeyboardShortcuts,
|
|
251
|
-
// Android-only props
|
|
252
|
-
importantForAutofill,
|
|
253
|
-
disableFullscreenUI,
|
|
254
|
-
inlineImageLeft,
|
|
255
|
-
inlineImagePadding,
|
|
256
|
-
returnKeyLabel,
|
|
257
|
-
textBreakStrategy,
|
|
258
|
-
textAlignVertical,
|
|
259
|
-
verticalAlign,
|
|
260
|
-
showSoftInputOnFocus
|
|
261
|
-
};
|
|
262
|
-
return /* @__PURE__ */_jsx(StyledInput, {
|
|
263
|
-
ref: composedRef,
|
|
264
|
-
...finalProps
|
|
265
|
-
});
|
|
10
|
+
var Input = createStyledHOC(StyledInput, function(props, forwardedRef) {
|
|
11
|
+
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;
|
|
12
|
+
var { ref, composedRef } = useNativeInputRef(forwardedRef);
|
|
13
|
+
var secureTextEntry = secureTextEntryProp !== null && secureTextEntryProp !== void 0 ? secureTextEntryProp : false;
|
|
14
|
+
var keyboardType = keyboardTypeProp !== null && keyboardTypeProp !== void 0 ? keyboardTypeProp : "default";
|
|
15
|
+
var inputMode = inputModeProp;
|
|
16
|
+
if (!secureTextEntryProp && !keyboardTypeProp && !inputModeProp) {
|
|
17
|
+
switch (type) {
|
|
18
|
+
case "password":
|
|
19
|
+
secureTextEntry = true;
|
|
20
|
+
break;
|
|
21
|
+
case "email":
|
|
22
|
+
keyboardType = "email-address";
|
|
23
|
+
inputMode = "email";
|
|
24
|
+
break;
|
|
25
|
+
case "tel":
|
|
26
|
+
keyboardType = "phone-pad";
|
|
27
|
+
inputMode = "tel";
|
|
28
|
+
break;
|
|
29
|
+
case "number":
|
|
30
|
+
keyboardType = "numeric";
|
|
31
|
+
inputMode = "numeric";
|
|
32
|
+
break;
|
|
33
|
+
case "url":
|
|
34
|
+
keyboardType = "url";
|
|
35
|
+
inputMode = "url";
|
|
36
|
+
break;
|
|
37
|
+
case "search":
|
|
38
|
+
inputMode = "search";
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
var returnKeyType = returnKeyTypeProp;
|
|
43
|
+
if (!returnKeyType && enterKeyHint) {
|
|
44
|
+
switch (enterKeyHint) {
|
|
45
|
+
case "done":
|
|
46
|
+
returnKeyType = "done";
|
|
47
|
+
break;
|
|
48
|
+
case "go":
|
|
49
|
+
returnKeyType = "go";
|
|
50
|
+
break;
|
|
51
|
+
case "next":
|
|
52
|
+
returnKeyType = "next";
|
|
53
|
+
break;
|
|
54
|
+
case "search":
|
|
55
|
+
returnKeyType = "search";
|
|
56
|
+
break;
|
|
57
|
+
case "send":
|
|
58
|
+
returnKeyType = "send";
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
var multiline = multilineProp !== null && multilineProp !== void 0 ? multilineProp : render === "textarea" || rows && rows > 1;
|
|
63
|
+
var numberOfLines = numberOfLinesProp !== null && numberOfLinesProp !== void 0 ? numberOfLinesProp : rows;
|
|
64
|
+
var autoCorrect = autoCorrectProp === "on" ? true : autoCorrectProp === "off" ? false : autoCorrectProp;
|
|
65
|
+
var autoCapitalize = autoCapitalizeProp === "on" ? "sentences" : autoCapitalizeProp === "off" ? "none" : autoCapitalizeProp;
|
|
66
|
+
React.useEffect(function() {
|
|
67
|
+
if (!id || disabled) return;
|
|
68
|
+
return registerFocusable(id, {
|
|
69
|
+
focusAndSelect: function() {
|
|
70
|
+
var _ref_current;
|
|
71
|
+
return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
72
|
+
},
|
|
73
|
+
focus: function() {
|
|
74
|
+
var _ref_current;
|
|
75
|
+
return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}, [id, disabled]);
|
|
79
|
+
var handleChangeText = function(text) {
|
|
80
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
|
|
81
|
+
if (onChange) {
|
|
82
|
+
onChange({
|
|
83
|
+
target: { value: text },
|
|
84
|
+
type: "change"
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (onInput) {
|
|
88
|
+
onInput({
|
|
89
|
+
target: { value: text },
|
|
90
|
+
type: "input"
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var handleKeyPress = function(e) {
|
|
95
|
+
onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);
|
|
96
|
+
if (onKeyDown) {
|
|
97
|
+
var { key } = e.nativeEvent;
|
|
98
|
+
if (key === "Backspace" || key === "Enter" || key.length === 1) {
|
|
99
|
+
onKeyDown({
|
|
100
|
+
key,
|
|
101
|
+
type: "keydown"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var handleSubmitEditing = function(e) {
|
|
107
|
+
if (onKeyDown) {
|
|
108
|
+
onKeyDown({
|
|
109
|
+
key: "Enter",
|
|
110
|
+
type: "keydown"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);
|
|
114
|
+
};
|
|
115
|
+
var handleSelectionChange = function(e) {
|
|
116
|
+
onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);
|
|
117
|
+
};
|
|
118
|
+
var finalProps = {
|
|
119
|
+
...rest,
|
|
120
|
+
editable: !disabled && !readOnly,
|
|
121
|
+
secureTextEntry,
|
|
122
|
+
keyboardType,
|
|
123
|
+
keyboardAppearance,
|
|
124
|
+
inputMode,
|
|
125
|
+
returnKeyType,
|
|
126
|
+
multiline,
|
|
127
|
+
numberOfLines,
|
|
128
|
+
selection,
|
|
129
|
+
autoComplete,
|
|
130
|
+
autoFocus: autoFocusNative,
|
|
131
|
+
onChangeText: handleChangeText,
|
|
132
|
+
onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,
|
|
133
|
+
onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,
|
|
134
|
+
onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,
|
|
135
|
+
onEndEditing,
|
|
136
|
+
onContentSizeChange,
|
|
137
|
+
onScroll,
|
|
138
|
+
submitBehavior,
|
|
139
|
+
blurOnSubmit,
|
|
140
|
+
caretHidden,
|
|
141
|
+
contextMenuHidden,
|
|
142
|
+
selectTextOnFocus,
|
|
143
|
+
maxFontSizeMultiplier,
|
|
144
|
+
allowFontScaling,
|
|
145
|
+
autoCapitalize,
|
|
146
|
+
autoCorrect,
|
|
147
|
+
textContentType,
|
|
148
|
+
clearButtonMode,
|
|
149
|
+
clearTextOnFocus,
|
|
150
|
+
enablesReturnKeyAutomatically,
|
|
151
|
+
dataDetectorTypes,
|
|
152
|
+
scrollEnabled,
|
|
153
|
+
passwordRules,
|
|
154
|
+
rejectResponderTermination,
|
|
155
|
+
spellCheck,
|
|
156
|
+
lineBreakStrategyIOS,
|
|
157
|
+
lineBreakModeIOS,
|
|
158
|
+
smartInsertDelete,
|
|
159
|
+
inputAccessoryViewID,
|
|
160
|
+
inputAccessoryViewButtonLabel,
|
|
161
|
+
disableKeyboardShortcuts,
|
|
162
|
+
importantForAutofill,
|
|
163
|
+
disableFullscreenUI,
|
|
164
|
+
inlineImageLeft,
|
|
165
|
+
inlineImagePadding,
|
|
166
|
+
returnKeyLabel,
|
|
167
|
+
textBreakStrategy,
|
|
168
|
+
textAlignVertical,
|
|
169
|
+
verticalAlign,
|
|
170
|
+
showSoftInputOnFocus,
|
|
171
|
+
cursorColor: cursorColorProp !== null && cursorColorProp !== void 0 ? cursorColorProp : caretColor,
|
|
172
|
+
selectionColor: selectionColorProp !== null && selectionColorProp !== void 0 ? selectionColorProp : caretColor
|
|
173
|
+
};
|
|
174
|
+
return /* @__PURE__ */ jsx(StyledInput, {
|
|
175
|
+
ref: composedRef,
|
|
176
|
+
...finalProps
|
|
177
|
+
});
|
|
266
178
|
});
|
|
179
|
+
|
|
267
180
|
export { Input };
|
|
268
181
|
//# sourceMappingURL=Input.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","React","TextInput","styled","registerFocusable","useNativeInputRef","styledBody","StyledInput","Input","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","useEffect","focusAndSelect","_ref_current","current","focus","handleChangeText","text","target","value","handleKeyPress","e","key","nativeEvent","length","handleSubmitEditing","handleSelectionChange","finalProps","editable","autoFocus"],"sources":["../../src/Input.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAOC,IAAA,QAAY;AAC5B,OAAOC,KAAA,MAAW;AAClB,SAASC,SAAA,QAAiB;AAC1B,SAASC,MAAA,QAAc;AACvB,SAASC,iBA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AC/DnF,YAAA;IACAC,mBAAA;IACAC,QAAA;IAAA;IAEAO,cAAA;IACAC,YAAA;IACAC,WAAA;IACAC,iBAAA;IACAC,iBAAA;IACAG,qBAAA;IACAC,gBAAA;IACAO,cAAA;IACAE,WAAA;IACAG,eAAA;IAAA;IAEAC,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;IAEAC,oBAAA;IACAC,mBAAA;IACAC,eAAA;IACAC,kBAAA;IACAC,cAAA;IACAC,iBAAA;IACAC,iBAAA;IACAC,aAAA;IACAC;EACJ;EACA,OAAqB,eAAA7E,IAAA,CAAKO,WAAA,EAAa;IACnCoF,GAAA,EAAKC,WAAA;IACL,GAAGiB;EACP,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Input.native.js","names":[],"sources":["esm/Input.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { TextInput } from \"react-native\";\nimport { createStyledHOC, styled } from \"@tamagui/core\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport { useNativeInputRef } from \"@tamagui/element\";\nimport { styledBody } from \"./shared\";\nvar StyledInput = styled(TextInput, styledBody[0], styledBody[1]);\nvar Input = 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 } = 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 React.useEffect(function() {\n if (!id || disabled) return;\n return 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__ */ _jsx(StyledInput, {\n ref: composedRef,\n ...finalProps\n });\n});\nexport {\n Input\n};\n//# sourceMappingURL=Input.native.js.map\n"],"mappings":";;;;;;;;;AAOA,IAAI,cAAc,OAAO,WAAW,WAAW,IAAI,WAAW,EAAE;AAChE,IAAI,QAAQ,gBAAgB,aAAa,SAAS,OAAO,cAAc;CACrE,IAAI,EAEF,MACA,UACA,UACA,IACA,MACA,cACA,cAEA,UACA,SACA,WACA,cACA,iBACA,mBACA,cACA,qBACA,UACA,YAAY,gBACZ,WAEA,oBACA,eAAe,mBACf,gBACA,cACA,aACA,mBACA,mBACA,iBAAiB,qBACjB,uBACA,kBACA,WAAW,eACX,cAAc,kBACd,WAAW,eACX,gBAAgB,oBAChB,aAAa,iBACb,iBACA,iBAEA,iBACA,kBACA,+BACA,mBACA,eACA,eACA,4BACA,YACA,sBACA,kBACA,mBACA,sBACA,+BACA,0BAEA,sBACA,qBACA,iBACA,oBACA,gBACA,mBACA,mBACA,eACA,sBACA,eAAe,mBAGf,SACA,KACA,KACA,WACA,UACA,MACA,SACA,UACA,MACA,QAKA,YACA,aAAa,iBACb,gBAAgB,oBAChB,GAAG,SACD;CACJ,IAAI,EAAE,KAAK,gBAAgB,kBAAkB,YAAY;CACzD,IAAI,kBAAkB,wBAAwB,QAAQ,wBAAwB,KAAK,IAAI,sBAAsB;CAC7G,IAAI,eAAe,qBAAqB,QAAQ,qBAAqB,KAAK,IAAI,mBAAmB;CACjG,IAAI,YAAY;CAChB,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,eAAe;EAC/D,QAAQ,MAAR;GACE,KAAK;IACH,kBAAkB;IAClB;GACF,KAAK;IACH,eAAe;IACf,YAAY;IACZ;GACF,KAAK;IACH,eAAe;IACf,YAAY;IACZ;GACF,KAAK;IACH,eAAe;IACf,YAAY;IACZ;GACF,KAAK;IACH,eAAe;IACf,YAAY;IACZ;GACF,KAAK;IACH,YAAY;IACZ;EACJ;CACF;CACA,IAAI,gBAAgB;CACpB,IAAI,CAAC,iBAAiB,cAAc;EAClC,QAAQ,cAAR;GACE,KAAK;IACH,gBA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WAAW,IAAI,WAAW,GAAG;IAC9D,UAAU;KACR;KACA,MAAM;IACR,CAAC;GACH;EACF;CACF;CACA,IAAI,sBAAsB,SAAS,GAAG;EACpC,IAAI,WAAW;GACb,UAAU;IACR,KAAK;IACL,MAAM;GACR,CAAC;EACH;EACA,oBAAoB,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,CAAC;CACrF;CACA,IAAI,wBAAwB,SAAS,GAAG;EACtC,sBAAsB,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,CAAC;CAC3F;CACA,IAAI,aAAa;EACf,GAAG;EACH,UAAU,CAAC,YAAY,CAAC;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EAEX,cAAc;EACd,YAAY,kBAAkB,YAAY,iBAAiB,KAAK;EAChE,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,oBAAK,aAAa;EACvC,KAAK;EACL,GAAG;CACL,CAAC;AACH,CAAC"}
|
package/dist/esm/TextArea.mjs
CHANGED
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import { styled } from "@tamagui/web";
|
|
2
2
|
import { Input } from "./Input.mjs";
|
|
3
3
|
import { defaultStyles, textAreaSizeVariant } from "./shared.mjs";
|
|
4
|
+
|
|
4
5
|
const TextArea = styled(Input, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rows: 3
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
"...size": textAreaSizeVariant
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
24
|
-
}
|
|
6
|
+
displayName: "TextArea",
|
|
7
|
+
render: "textarea",
|
|
8
|
+
whiteSpace: "pre-wrap",
|
|
9
|
+
height: "auto",
|
|
10
|
+
...defaultStyles,
|
|
11
|
+
rows: 3,
|
|
12
|
+
variants: { size: {
|
|
13
|
+
true: textAreaSizeVariant,
|
|
14
|
+
Size: textAreaSizeVariant
|
|
15
|
+
} }
|
|
25
16
|
});
|
|
17
|
+
|
|
26
18
|
export { TextArea };
|
|
27
19
|
//# sourceMappingURL=TextArea.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"TextArea.js","names":[],"sources":["esm/TextArea.js"],"sourcesContent":["import { styled } from \"@tamagui/web\";\nimport { Input } from \"./Input\";\nimport { defaultStyles, textAreaSizeVariant } from \"./shared\";\nconst TextArea = styled(Input, {\n displayName: \"TextArea\",\n render: \"textarea\",\n // this attribute fixes firefox newline issue\n // @ts-ignore\n whiteSpace: \"pre-wrap\",\n height: \"auto\",\n ...defaultStyles,\n rows: 3,\n variants: {\n size: {\n true: textAreaSizeVariant,\n Size: textAreaSizeVariant\n }\n }\n});\nexport {\n TextArea\n};\n//# sourceMappingURL=TextArea.js.map\n"],"mappings":";;;;;AAGA,MAAM,WAAW,OAAO,OAAO;CAC7B,aAAa;CACb,QAAQ;CAGR,YAAY;CACZ,QAAQ;CACR,GAAG;CACH,MAAM;CACN,UAAU,EACR,MAAM;EACJ,MAAM;EACN,MAAM;CACR,EACF;AACF,CAAC"}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import { styled } from "@tamagui/web";
|
|
2
2
|
import { Input } from "./Input.native.js";
|
|
3
3
|
import { defaultStyles, textAreaSizeVariant } from "./shared.native.js";
|
|
4
|
+
|
|
4
5
|
var TextArea = styled(Input, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rows: 3
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
"...size": textAreaSizeVariant
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
24
|
-
}
|
|
6
|
+
displayName: "TextArea",
|
|
7
|
+
render: "textarea",
|
|
8
|
+
whiteSpace: "pre-wrap",
|
|
9
|
+
height: "auto",
|
|
10
|
+
...defaultStyles,
|
|
11
|
+
rows: 3,
|
|
12
|
+
variants: { size: {
|
|
13
|
+
true: textAreaSizeVariant,
|
|
14
|
+
Size: textAreaSizeVariant
|
|
15
|
+
} }
|
|
25
16
|
});
|
|
17
|
+
|
|
26
18
|
export { TextArea };
|
|
27
19
|
//# sourceMappingURL=TextArea.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"TextArea.native.js","names":[],"sources":["esm/TextArea.native.js"],"sourcesContent":["import { styled } from \"@tamagui/web\";\nimport { Input } from \"./Input\";\nimport { defaultStyles, textAreaSizeVariant } from \"./shared\";\nvar TextArea = styled(Input, {\n displayName: \"TextArea\",\n render: \"textarea\",\n // this attribute fixes firefox newline issue\n // @ts-ignore\n whiteSpace: \"pre-wrap\",\n height: \"auto\",\n ...defaultStyles,\n rows: 3,\n variants: {\n size: {\n true: textAreaSizeVariant,\n Size: textAreaSizeVariant\n }\n }\n});\nexport {\n TextArea\n};\n//# sourceMappingURL=TextArea.js.map\n"],"mappings":";;;;;AAGA,IAAI,WAAW,OAAO,OAAO;CAC3B,aAAa;CACb,QAAQ;CAGR,YAAY;CACZ,QAAQ;CACR,GAAG;CACH,MAAM;CACN,UAAU,EACR,MAAM;EACJ,MAAM;EACN,MAAM;CACR,EACF;AACF,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from "./Input.mjs";
|
|
2
|
-
export * from "./TextArea.mjs";
|
|
3
1
|
import { inputSizeVariant, textAreaSizeVariant } from "./shared.mjs";
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
export * from "./Input.mjs"
|
|
4
|
+
|
|
5
|
+
export * from "./TextArea.mjs"
|
|
6
|
+
|
|
7
|
+
export { inputSizeVariant, textAreaSizeVariant };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from "./Input.mjs";
|
|
2
|
-
export * from "./TextArea.mjs";
|
|
3
1
|
import { inputSizeVariant, textAreaSizeVariant } from "./shared.mjs";
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
export * from "./Input.mjs"
|
|
4
|
+
|
|
5
|
+
export * from "./TextArea.mjs"
|
|
6
|
+
|
|
7
|
+
export { inputSizeVariant, textAreaSizeVariant };
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from "./Input.native.js";
|
|
2
|
-
export * from "./TextArea.native.js";
|
|
3
1
|
import { inputSizeVariant, textAreaSizeVariant } from "./shared.native.js";
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
export * from "./Input.native.js"
|
|
4
|
+
|
|
5
|
+
export * from "./TextArea.native.js"
|
|
6
|
+
|
|
7
|
+
export { inputSizeVariant, textAreaSizeVariant };
|