tamagui 1.92.0 → 1.92.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/views/Input.js +3 -3
- package/dist/cjs/views/Input.js.map +1 -1
- package/dist/cjs/views/Input.native.js +17 -4
- package/dist/cjs/views/Input.native.js.map +2 -2
- package/dist/cjs/views/TextArea.js +10 -8
- package/dist/cjs/views/TextArea.js.map +1 -1
- package/dist/cjs/views/TextArea.native.js +17 -4
- package/dist/cjs/views/TextArea.native.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/setup.js +1 -1
- package/dist/esm/setup.mjs +0 -1
- package/dist/esm/views/Input.js +4 -3
- package/dist/esm/views/Input.js.map +1 -1
- package/dist/esm/views/Input.mjs +6 -3
- package/dist/esm/views/Input.native.js +19 -5
- package/dist/esm/views/Input.native.js.map +2 -2
- package/dist/esm/views/TextArea.js +12 -8
- package/dist/esm/views/TextArea.js.map +1 -1
- package/dist/esm/views/TextArea.mjs +6 -3
- package/dist/esm/views/TextArea.native.js +19 -4
- package/dist/esm/views/TextArea.native.js.map +2 -2
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.mjs +0 -1
- package/dist/jsx/setup.js +1 -1
- package/dist/jsx/setup.mjs +0 -1
- package/dist/jsx/views/Input.js +4 -3
- package/dist/jsx/views/Input.js.map +1 -1
- package/dist/jsx/views/Input.mjs +6 -3
- package/dist/jsx/views/Input.native.js +19 -5
- package/dist/jsx/views/Input.native.js.map +2 -2
- package/dist/jsx/views/TextArea.js +12 -8
- package/dist/jsx/views/TextArea.js.map +1 -1
- package/dist/jsx/views/TextArea.mjs +6 -3
- package/dist/jsx/views/TextArea.native.js +19 -4
- package/dist/jsx/views/TextArea.native.js.map +2 -2
- package/dist/native.js +313 -273
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +308 -268
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
- package/src/views/Input.tsx +22 -4
- package/src/views/TextArea.tsx +31 -9
- package/types/views/Input.d.ts.map +1 -1
- package/types/views/TextArea.d.ts.map +1 -1
package/dist/cjs/views/Input.js
CHANGED
|
@@ -20,7 +20,7 @@ __export(Input_exports, {
|
|
|
20
20
|
useInputProps: () => useInputProps
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(Input_exports);
|
|
23
|
-
var import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_focusable = require("@tamagui/focusable"), import_react_native = require("react-native-web"), import_inputHelpers = require("../helpers/inputHelpers"), import_jsx_runtime = require("react/jsx-runtime");
|
|
23
|
+
var import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_focusable = require("@tamagui/focusable"), import_react_native = require("react-native-web"), import_inputHelpers = require("../helpers/inputHelpers"), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime");
|
|
24
24
|
const defaultStyles = {
|
|
25
25
|
size: "$true",
|
|
26
26
|
fontFamily: "$body",
|
|
@@ -73,8 +73,8 @@ const defaultStyles = {
|
|
|
73
73
|
selectionColor: "color"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
), Input = InputFrame.styleable((propsIn,
|
|
77
|
-
const props = useInputProps(propsIn,
|
|
76
|
+
), Input = InputFrame.styleable((propsIn, forwardedRef) => {
|
|
77
|
+
const ref = (0, import_react.useRef)(null), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref), props = useInputProps(propsIn, composedRefs);
|
|
78
78
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputFrame, { ...props });
|
|
79
79
|
});
|
|
80
80
|
function useInputProps(props, ref) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Input.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB,+BAEtB,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C,CAAC;AAEM,SAAS,cAAc,OAAmB,KAAU;AACzD,QAAM,YAAQ,sBAAS,GACjB,EAAE,cAAc,KAAK,YAAY,QAAI,+BAAa;AAAA;AAAA,IAEtD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,CAAC,GAEK,uBAAuB,MAAM,sBAC7B,uBACJ,MAAM,oBAA2B,GAAG,IAAI,KACxC,wBACA,MAAM,kBAAkB,IAAI;AAE9B,SAAO;AAAA,IACL,KAAK;AAAA,IACL,UAAU,MAAM;AAAA,IAChB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -21,7 +21,7 @@ __export(Input_exports, {
|
|
|
21
21
|
useInputProps: () => useInputProps
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Input_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_focusable = require("@tamagui/focusable"), import_react_native = require("react-native"), import_inputHelpers = require("../helpers/inputHelpers");
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_focusable = require("@tamagui/focusable"), import_react_native = require("react-native"), import_inputHelpers = require("../helpers/inputHelpers"), import_react = require("react");
|
|
25
25
|
function _define_property(obj, key, value) {
|
|
26
26
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
27
27
|
value,
|
|
@@ -104,9 +104,22 @@ var defaultStyles = _object_spread_props(_object_spread({
|
|
|
104
104
|
placeholderTextColor: "color",
|
|
105
105
|
selectionColor: "color"
|
|
106
106
|
}
|
|
107
|
-
}), Input = InputFrame.styleable(function(propsIn,
|
|
108
|
-
var props = useInputProps(propsIn,
|
|
109
|
-
return
|
|
107
|
+
}), Input = InputFrame.styleable(function(propsIn, forwardedRef) {
|
|
108
|
+
var ref = (0, import_react.useRef)(null), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref), props = useInputProps(propsIn, composedRefs);
|
|
109
|
+
return (0, import_react.useEffect)(function() {
|
|
110
|
+
if (props.id && !props.disabled)
|
|
111
|
+
return (0, import_focusable.registerFocusable)(props.id, {
|
|
112
|
+
focusAndSelect: function() {
|
|
113
|
+
var _ref_current;
|
|
114
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus();
|
|
115
|
+
},
|
|
116
|
+
focus: function() {
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}, [
|
|
120
|
+
props.id,
|
|
121
|
+
props.disabled
|
|
122
|
+
]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputFrame, _object_spread({}, props));
|
|
110
123
|
});
|
|
111
124
|
function useInputProps(props, ref) {
|
|
112
125
|
var _theme_placeholderColorProp, _theme_placeholderColor, theme = (0, import_core.useTheme)(), _useFocusable = (0, import_focusable.useFocusable)({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/tamagui/src/views/Input.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;uDAAA,mBAAsB,+BAEtB,
|
|
5
|
-
"names": ["defaultStyles", "size", "fontFamily", "borderWidth", "outlineWidth", "color", "isWeb", "tabIndex", "focusable", "borderColor", "backgroundColor", "minWidth", "hoverStyle", "focusStyle", "focusVisibleStyle", "outlineColor", "outlineStyle", "InputFrame", "styled", "TextInput", "name", "variants", "unstyled", "false", "inputSizeVariant", "disabled", "true", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "isInput", "accept", "placeholderTextColor", "selectionColor", "Input", "styleable", "propsIn", "ref", "props", "useInputProps", "_jsx", "theme", "useTheme", "useFocusable", "onChangeText", "combinedRef", "placeholderColorProp", "get", "placeholderColor", "readOnly"]
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;uDAAA,mBAAsB,+BA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KAAAA,CAAAA;AACzB,CAAA;AAEO,SAASC,cAAcD,OAAmBJ,KAAQ;MAWrDa,6BAEAA,yBAZIA,YAAQC,sBAAAA,GAC6BC,oBAAAA,+BAAa;;IAEtDX;IACAJ;IACAR,SAAS;EACX,CAAA,GALQwB,eAAmCD,cAAnCC,cAAmBC,cAAgBF,cAArBf,KAOhBkB,uBAAuBd,MAAMV,sBAEjCmB,iCAAAA,MADInB,wBACJmB,QAAAA,mCAAAA,8BAAAA,MAAMK,oBAAAA,OAA4B,QAAlCL,gCAAAA,SAAAA,SAAAA,4BAAoCM,IAAG,OAAA,QAAvCN,oCAAAA,SAAAA,kCACAK,0BAAAA,QADAL,SAAAA,SAAAA,QAEAA,0BAAAA,MAAMO,sBAAgB,QAAtBP,4BAAAA,SAAAA,SAAAA,wBAAwBM,IAAG;AAE7B,SAAO,qBAAA,eAAA;IACLnB,KAAKiB;IACLI,UAAUjB,MAAMlB;KACbkB,KAAAA,GAAAA;IACHV;IACAsB;;AAEJ;",
|
|
5
|
+
"names": ["defaultStyles", "size", "fontFamily", "borderWidth", "outlineWidth", "color", "isWeb", "tabIndex", "focusable", "borderColor", "backgroundColor", "minWidth", "hoverStyle", "focusStyle", "focusVisibleStyle", "outlineColor", "outlineStyle", "InputFrame", "styled", "TextInput", "name", "variants", "unstyled", "false", "inputSizeVariant", "disabled", "true", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "isInput", "accept", "placeholderTextColor", "selectionColor", "Input", "styleable", "propsIn", "forwardedRef", "ref", "useRef", "composedRefs", "useComposedRefs", "props", "useInputProps", "useEffect", "id", "registerFocusable", "focusAndSelect", "current", "focus", "_jsx", "theme", "useTheme", "useFocusable", "onChangeText", "combinedRef", "placeholderColorProp", "get", "placeholderColor", "readOnly"]
|
|
6
6
|
}
|
|
@@ -18,7 +18,7 @@ __export(TextArea_exports, {
|
|
|
18
18
|
TextAreaFrame: () => TextAreaFrame
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(TextArea_exports);
|
|
21
|
-
var import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_inputHelpers = require("../helpers/inputHelpers"), import_Input = require("./Input"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
var import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_inputHelpers = require("../helpers/inputHelpers"), import_Input = require("./Input"), import_focusable = require("@tamagui/focusable"), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime");
|
|
22
22
|
const TextAreaFrame = (0, import_core.styled)(import_Input.InputFrame, {
|
|
23
23
|
name: "TextArea",
|
|
24
24
|
multiline: !0,
|
|
@@ -38,11 +38,13 @@ const TextAreaFrame = (0, import_core.styled)(import_Input.InputFrame, {
|
|
|
38
38
|
defaultVariants: {
|
|
39
39
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
40
40
|
}
|
|
41
|
-
}), TextArea = TextAreaFrame.styleable(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
41
|
+
}), TextArea = TextAreaFrame.styleable(
|
|
42
|
+
(propsIn, forwardedRef) => {
|
|
43
|
+
const ref = (0, import_react.useRef)(null), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref), props = (0, import_Input.useInputProps)(propsIn, composedRefs), linesProp = {
|
|
44
|
+
// web uses rows now, but native not caught up :/
|
|
45
|
+
[import_constants.isWeb ? "rows" : "numberOfLines"]: propsIn.unstyled ? void 0 : 4
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAreaFrame, { ...linesProp, ...props });
|
|
48
|
+
}
|
|
49
|
+
);
|
|
48
50
|
//# sourceMappingURL=TextArea.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/TextArea.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB,+BACtB,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB,+BACtB,cAAwC,0BAExC,sBAAoC,oCAEpC,eAAyD,oBACzD,mBAAkC,+BAClC,eAAkC,kBA0DvB;AApDJ,MAAM,oBAAgB,oBAAO,yBAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA;AAAA,EAEX,YAAY;AAAA,EAEZ,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU,QAAQ,IAAI,qBAAqB;AAAA,EAC7C;AACF,CAAC,GAIY,WAAW,cAAc;AAAA,EACpC,CAAC,SAAS,iBAAiB;AACzB,UAAM,UAAM,qBAAc,IAAI,GACxB,mBAAe,6BAAgB,cAAc,GAAG,GAEhD,YAAQ,4BAAc,SAAS,YAAY,GAE3C,YAAY;AAAA;AAAA,MAEhB,CAAC,yBAAQ,SAAS,eAAe,GAAG,QAAQ,WAAW,SAAY;AAAA,IACrE;AAgBA,WAAO,4CAAC,iBAAe,GAAG,WAAY,GAAG,OAAO;AAAA,EAClD;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -19,7 +19,7 @@ __export(TextArea_exports, {
|
|
|
19
19
|
TextAreaFrame: () => TextAreaFrame
|
|
20
20
|
});
|
|
21
21
|
module.exports = __toCommonJS(TextArea_exports);
|
|
22
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_inputHelpers = require("../helpers/inputHelpers"), import_Input = require("./Input");
|
|
22
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_inputHelpers = require("../helpers/inputHelpers"), import_Input = require("./Input"), import_focusable = require("@tamagui/focusable"), import_react = require("react");
|
|
23
23
|
function _define_property(obj, key, value) {
|
|
24
24
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
25
25
|
value,
|
|
@@ -57,12 +57,25 @@ var TextAreaFrame = (0, import_core.styled)(import_Input.InputFrame, {
|
|
|
57
57
|
defaultVariants: {
|
|
58
58
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
59
59
|
}
|
|
60
|
-
}), TextArea = TextAreaFrame.styleable(function(propsIn,
|
|
61
|
-
var props = (0, import_Input.useInputProps)(propsIn,
|
|
60
|
+
}), TextArea = TextAreaFrame.styleable(function(propsIn, forwardedRef) {
|
|
61
|
+
var ref = (0, import_react.useRef)(null), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref), props = (0, import_Input.useInputProps)(propsIn, composedRefs), linesProp = (
|
|
62
62
|
// web uses rows now, but native not caught up :/
|
|
63
63
|
_define_property({}, import_constants.isWeb ? "rows" : "numberOfLines", propsIn.unstyled ? void 0 : 4)
|
|
64
64
|
);
|
|
65
|
-
return
|
|
65
|
+
return (0, import_react.useEffect)(function() {
|
|
66
|
+
if (props.id && !props.disabled)
|
|
67
|
+
return (0, import_focusable.registerFocusable)(props.id, {
|
|
68
|
+
focusAndSelect: function() {
|
|
69
|
+
var _ref_current;
|
|
70
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus();
|
|
71
|
+
},
|
|
72
|
+
focus: function() {
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}, [
|
|
76
|
+
props.id,
|
|
77
|
+
props.disabled
|
|
78
|
+
]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAreaFrame, _object_spread({}, linesProp, props));
|
|
66
79
|
});
|
|
67
80
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
81
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/tamagui/src/views/TextArea.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;uDAAA,mBAAsB,+BACtB,
|
|
5
|
-
"names": ["TextAreaFrame", "styled", "InputFrame", "name", "multiline", "whiteSpace", "variants", "unstyled", "false", "height", "defaultStyles", "size", "textAreaSizeVariant", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "TextArea", "styleable", "propsIn", "ref", "props", "useInputProps", "linesProp", "isWeb", "undefined", "_jsx"]
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;uDAAA,mBAAsB,+BACtB,cAAwC,0BAExC,sBAAoC,oCAEpC,eAAyD,oBACzD,mBAAkC,+BAClC,eAAkC;;;;;;;;;;;;;;;;;;;;AAM3B,IAAMA,oBAAgBC,oBAAOC,yBAAY;EAC9CC,MAAM;EACNC,WAAW;;EAEXC,YAAY;EAEZC,UAAU;IACRC,UAAU;MACRC,OAAO,eAAA;QACLC,QAAQ;SACLC,0BAAAA;IAEP;IAEAC,MAAM;MACJ,WAAWC;IACb;EACF;EAEAC,iBAAiB;IACfN,UAAUO,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA,GAIaC,WAAWjB,cAAckB,UACpC,SAACC,SAASC,cAAAA;AACR,MAAMC,UAAMC,qBAAc,IAAA,GACpBC,mBAAeC,6BAAgBJ,cAAcC,GAAAA,GAE7CI,YAAQC,4BAAcP,SAASI,YAAAA,GAE/BI;;IAEJ,iBAAA,CAAA,GAACC,yBAAQ,SAAS,iBAAkBT,QAAQZ,WAAWsB,SAAY,CAAA;;AAInEC,qCAAU,WAAA;AACR,QAAKL,MAAMM,MACPN,OAAMO;AAEV,iBAAOC,oCAAkBR,MAAMM,IAAI;QACjCG,gBAAgB,WAAA;cACdb;WAAAA,eAAAA,IAAIc,aAAO,QAAXd,iBAAAA,UAAAA,aAAae,MAAK;QACpB;QACAA,OAAO,WAAA;QAAO;MAChB,CAAA;EACF,GAAG;IAACX,MAAMM;IAAIN,MAAMO;GAAS,GAGxB,uCAAAK,KAACrC,eAAAA,eAAAA,CAAAA,GAAkB2B,WAAeF,KAAAA,CAAAA;AAC3C,CAAA;",
|
|
5
|
+
"names": ["TextAreaFrame", "styled", "InputFrame", "name", "multiline", "whiteSpace", "variants", "unstyled", "false", "height", "defaultStyles", "size", "textAreaSizeVariant", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "TextArea", "styleable", "propsIn", "forwardedRef", "ref", "useRef", "composedRefs", "useComposedRefs", "props", "useInputProps", "linesProp", "isWeb", "undefined", "useEffect", "id", "disabled", "registerFocusable", "focusAndSelect", "current", "focus", "_jsx"]
|
|
6
6
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.mjs
CHANGED
package/dist/esm/setup.js
CHANGED
package/dist/esm/setup.mjs
CHANGED
package/dist/esm/views/Input.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { styled, useTheme } from "@tamagui/core";
|
|
2
|
+
import { styled, useComposedRefs, useTheme } from "@tamagui/core";
|
|
3
3
|
import { useFocusable } from "@tamagui/focusable";
|
|
4
4
|
import { TextInput } from "react-native-web";
|
|
5
5
|
import { inputSizeVariant } from "../helpers/inputHelpers";
|
|
6
|
+
import { useRef } from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
const defaultStyles = {
|
|
8
9
|
size: "$true",
|
|
@@ -56,8 +57,8 @@ const defaultStyles = {
|
|
|
56
57
|
selectionColor: "color"
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
), Input = InputFrame.styleable((propsIn,
|
|
60
|
-
const props = useInputProps(propsIn,
|
|
60
|
+
), Input = InputFrame.styleable((propsIn, forwardedRef) => {
|
|
61
|
+
const ref = useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), props = useInputProps(propsIn, composedRefs);
|
|
61
62
|
return /* @__PURE__ */ jsx(InputFrame, { ...props });
|
|
62
63
|
});
|
|
63
64
|
function useInputProps(props, ref) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Input.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,QAAQ,gBAAgB;
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,QAAQ,iBAAiB,gBAAgB;AAClD,SAA4B,oBAAoB;AAChD,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AACjC,SAAoB,cAAc;AAsGzB;AApGF,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,EAEP,GAAI,QACA;AAAA,IACE,UAAU;AAAA,EACZ,IACA;AAAA,IACE,WAAW;AAAA,EACb;AAAA,EAEJ,aAAa;AAAA,EACb,iBAAiB;AAAA;AAAA,EAGjB,UAAU;AAAA,EAEV,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,mBAAmB;AAAA,IACjB,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,EAChB;AACF,GAEa,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IAEN,UAAU;AAAA,MACR,UAAU;AAAA,QACR,OAAO;AAAA,MACT;AAAA,MAEA,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MAEA,UAAU;AAAA,QACR,MAAM,CAAC;AAAA,MACT;AAAA,IACF;AAAA,IAEA,iBAAiB;AAAA,MACf,UAAU,QAAQ,IAAI,qBAAqB;AAAA,IAC7C;AAAA,EACF;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IAET,QAAQ;AAAA,MACN,sBAAsB;AAAA,MACtB,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF,GAca,QAAQ,WAAW,UAA2B,CAAC,SAAS,iBAAiB;AACpF,QAAM,MAAM,OAAc,IAAI,GACxB,eAAe,gBAAgB,cAAc,GAAG,GAChD,QAAQ,cAAc,SAAS,YAAY;AAgBjD,SAAO,oBAAC,cAAY,GAAG,OAAO;AAChC,CAAC;AAEM,SAAS,cAAc,OAAmB,KAAU;AACzD,QAAM,QAAQ,SAAS,GACjB,EAAE,cAAc,KAAK,YAAY,IAAI,aAAa;AAAA;AAAA,IAEtD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,CAAC,GAEK,uBAAuB,MAAM,sBAC7B,uBACJ,MAAM,oBAA2B,GAAG,IAAI,KACxC,wBACA,MAAM,kBAAkB,IAAI;AAE9B,SAAO;AAAA,IACL,KAAK;AAAA,IACL,UAAU,MAAM;AAAA,IAChB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/views/Input.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { styled, useTheme } from "@tamagui/core";
|
|
2
|
+
import { styled, useComposedRefs, useTheme } from "@tamagui/core";
|
|
3
3
|
import { useFocusable } from "@tamagui/focusable";
|
|
4
4
|
import { TextInput } from "react-native-web";
|
|
5
5
|
import { inputSizeVariant } from "../helpers/inputHelpers.mjs";
|
|
6
|
+
import { useRef } from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
const defaultStyles = {
|
|
8
9
|
size: "$true",
|
|
@@ -54,8 +55,10 @@ const defaultStyles = {
|
|
|
54
55
|
selectionColor: "color"
|
|
55
56
|
}
|
|
56
57
|
}),
|
|
57
|
-
Input = InputFrame.styleable((propsIn,
|
|
58
|
-
const
|
|
58
|
+
Input = InputFrame.styleable((propsIn, forwardedRef) => {
|
|
59
|
+
const ref = useRef(null),
|
|
60
|
+
composedRefs = useComposedRefs(forwardedRef, ref),
|
|
61
|
+
props = useInputProps(propsIn, composedRefs);
|
|
59
62
|
return /* @__PURE__ */jsx(InputFrame, {
|
|
60
63
|
...props
|
|
61
64
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
|
-
import { styled, useTheme } from "@tamagui/core";
|
|
4
|
-
import { useFocusable } from "@tamagui/focusable";
|
|
3
|
+
import { styled, useComposedRefs, useTheme } from "@tamagui/core";
|
|
4
|
+
import { registerFocusable, useFocusable } from "@tamagui/focusable";
|
|
5
5
|
import { TextInput } from "react-native";
|
|
6
6
|
import { inputSizeVariant } from "../helpers/inputHelpers";
|
|
7
|
+
import { useEffect, useRef } from "react";
|
|
7
8
|
function _define_property(obj, key, value) {
|
|
8
9
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
9
10
|
value,
|
|
@@ -86,9 +87,22 @@ var defaultStyles = _object_spread_props(_object_spread({
|
|
|
86
87
|
placeholderTextColor: "color",
|
|
87
88
|
selectionColor: "color"
|
|
88
89
|
}
|
|
89
|
-
}), Input = InputFrame.styleable(function(propsIn,
|
|
90
|
-
var props = useInputProps(propsIn,
|
|
91
|
-
return
|
|
90
|
+
}), Input = InputFrame.styleable(function(propsIn, forwardedRef) {
|
|
91
|
+
var ref = useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), props = useInputProps(propsIn, composedRefs);
|
|
92
|
+
return useEffect(function() {
|
|
93
|
+
if (props.id && !props.disabled)
|
|
94
|
+
return registerFocusable(props.id, {
|
|
95
|
+
focusAndSelect: function() {
|
|
96
|
+
var _ref_current;
|
|
97
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus();
|
|
98
|
+
},
|
|
99
|
+
focus: function() {
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}, [
|
|
103
|
+
props.id,
|
|
104
|
+
props.disabled
|
|
105
|
+
]), /* @__PURE__ */ _jsx(InputFrame, _object_spread({}, props));
|
|
92
106
|
});
|
|
93
107
|
function useInputProps(props, ref) {
|
|
94
108
|
var _theme_placeholderColorProp, _theme_placeholderColor, theme = useTheme(), _useFocusable = useFocusable({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/tamagui/src/views/Input.tsx"],
|
|
4
|
-
"mappings": ";AAAA,SAASA,aAAa;AAEtB,SAASC,QAAQC,gBAAgB;
|
|
5
|
-
"names": ["isWeb", "styled", "useTheme", "useFocusable", "TextInput", "inputSizeVariant", "defaultStyles", "size", "fontFamily", "borderWidth", "outlineWidth", "color", "tabIndex", "focusable", "borderColor", "backgroundColor", "minWidth", "hoverStyle", "focusStyle", "focusVisibleStyle", "outlineColor", "outlineStyle", "InputFrame", "name", "variants", "unstyled", "false", "disabled", "true", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "isInput", "accept", "placeholderTextColor", "selectionColor", "Input", "styleable", "propsIn", "ref", "props", "useInputProps", "theme", "onChangeText", "combinedRef", "placeholderColorProp", "get", "placeholderColor", "readOnly"]
|
|
4
|
+
"mappings": ";AAAA,SAASA,aAAa;AAEtB,SAASC,QAAQC,iBAAiBC,gBAAgB;AAClD,SAASC,mBAAmBC,oBAAoB;AAChD,SAASC,iBAAiB;AAE1B,SAASC,wBAAwB;AACjC,SAASC,WAAWC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3B,IAAMC,gBAAgB,qBAAA,eAAA;EAC3BC,MAAM;EACNC,YAAY;EACZC,aAAa;EACbC,cAAc;EACdC,OAAO;GAEHf,QACA;EACEgB,UAAU;AACZ,IACA;EACEC,WAAW;AACb,CAAA,GAAA;EAEJC,aAAa;EACbC,iBAAiB;;EAGjBC,UAAU;EAEVC,YAAY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AAAA,4BAAoCI,IAAG,OAAA,QAAvCJ,oCAAAA,SAAAA,kCACAG,0BAAAA,QADAH,SAAAA,SAAAA,QAEAA,0BAAAA,MAAMK,sBAAgB,QAAtBL,4BAAAA,SAAAA,SAAAA,wBAAwBI,IAAG;AAE7B,SAAO,qBAAA,eAAA;IACLZ,KAAKU;IACLI,UAAUZ,MAAMhB;KACbgB,KAAAA,GAAAA;IACHR;IACAe;;AAEJ;",
|
|
5
|
+
"names": ["isWeb", "styled", "useComposedRefs", "useTheme", "registerFocusable", "useFocusable", "TextInput", "inputSizeVariant", "useEffect", "useRef", "defaultStyles", "size", "fontFamily", "borderWidth", "outlineWidth", "color", "tabIndex", "focusable", "borderColor", "backgroundColor", "minWidth", "hoverStyle", "focusStyle", "focusVisibleStyle", "outlineColor", "outlineStyle", "InputFrame", "name", "variants", "unstyled", "false", "disabled", "true", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "isInput", "accept", "placeholderTextColor", "selectionColor", "Input", "styleable", "propsIn", "forwardedRef", "ref", "composedRefs", "props", "useInputProps", "id", "focusAndSelect", "current", "focus", "theme", "onChangeText", "combinedRef", "placeholderColorProp", "get", "placeholderColor", "readOnly"]
|
|
6
6
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { styled } from "@tamagui/core";
|
|
2
|
+
import { styled, useComposedRefs } from "@tamagui/core";
|
|
3
3
|
import { textAreaSizeVariant } from "../helpers/inputHelpers";
|
|
4
4
|
import { InputFrame, defaultStyles, useInputProps } from "./Input";
|
|
5
|
+
|
|
6
|
+
import { useRef } from "react";
|
|
5
7
|
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
const TextAreaFrame = styled(InputFrame, {
|
|
7
9
|
name: "TextArea",
|
|
@@ -22,13 +24,15 @@ const TextAreaFrame = styled(InputFrame, {
|
|
|
22
24
|
defaultVariants: {
|
|
23
25
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
24
26
|
}
|
|
25
|
-
}), TextArea = TextAreaFrame.styleable(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
27
|
+
}), TextArea = TextAreaFrame.styleable(
|
|
28
|
+
(propsIn, forwardedRef) => {
|
|
29
|
+
const ref = useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), props = useInputProps(propsIn, composedRefs), linesProp = {
|
|
30
|
+
// web uses rows now, but native not caught up :/
|
|
31
|
+
[isWeb ? "rows" : "numberOfLines"]: propsIn.unstyled ? void 0 : 4
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ jsx(TextAreaFrame, { ...linesProp, ...props });
|
|
34
|
+
}
|
|
35
|
+
);
|
|
32
36
|
export {
|
|
33
37
|
TextArea,
|
|
34
38
|
TextAreaFrame
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/TextArea.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,aAAa;AACtB,SAAS,
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AACtB,SAAS,QAAQ,uBAAuB;AAExC,SAAS,2BAA2B;AAEpC,SAAS,YAAY,eAAe,qBAAqB;AACzD,OAAkC;AAClC,SAAoB,cAAc;AA0DvB;AApDJ,MAAM,gBAAgB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA;AAAA,EAEX,YAAY;AAAA,EAEZ,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU,QAAQ,IAAI,qBAAqB;AAAA,EAC7C;AACF,CAAC,GAIY,WAAW,cAAc;AAAA,EACpC,CAAC,SAAS,iBAAiB;AACzB,UAAM,MAAM,OAAc,IAAI,GACxB,eAAe,gBAAgB,cAAc,GAAG,GAEhD,QAAQ,cAAc,SAAS,YAAY,GAE3C,YAAY;AAAA;AAAA,MAEhB,CAAC,QAAQ,SAAS,eAAe,GAAG,QAAQ,WAAW,SAAY;AAAA,IACrE;AAgBA,WAAO,oBAAC,iBAAe,GAAG,WAAY,GAAG,OAAO;AAAA,EAClD;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { styled } from "@tamagui/core";
|
|
2
|
+
import { styled, useComposedRefs } from "@tamagui/core";
|
|
3
3
|
import { textAreaSizeVariant } from "../helpers/inputHelpers.mjs";
|
|
4
4
|
import { InputFrame, defaultStyles, useInputProps } from "./Input.mjs";
|
|
5
|
+
import { useRef } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
const TextAreaFrame = styled(InputFrame, {
|
|
7
8
|
name: "TextArea",
|
|
@@ -23,8 +24,10 @@ const TextAreaFrame = styled(InputFrame, {
|
|
|
23
24
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
24
25
|
}
|
|
25
26
|
}),
|
|
26
|
-
TextArea = TextAreaFrame.styleable((propsIn,
|
|
27
|
-
const
|
|
27
|
+
TextArea = TextAreaFrame.styleable((propsIn, forwardedRef) => {
|
|
28
|
+
const ref = useRef(null),
|
|
29
|
+
composedRefs = useComposedRefs(forwardedRef, ref),
|
|
30
|
+
props = useInputProps(propsIn, composedRefs),
|
|
28
31
|
linesProp = {
|
|
29
32
|
// web uses rows now, but native not caught up :/
|
|
30
33
|
[isWeb ? "rows" : "numberOfLines"]: propsIn.unstyled ? void 0 : 4
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
|
-
import { styled } from "@tamagui/core";
|
|
3
|
+
import { styled, useComposedRefs } from "@tamagui/core";
|
|
4
4
|
import { textAreaSizeVariant } from "../helpers/inputHelpers";
|
|
5
5
|
import { InputFrame, defaultStyles, useInputProps } from "./Input";
|
|
6
|
+
import { registerFocusable } from "@tamagui/focusable";
|
|
7
|
+
import { useEffect, useRef } from "react";
|
|
6
8
|
function _define_property(obj, key, value) {
|
|
7
9
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
8
10
|
value,
|
|
@@ -40,12 +42,25 @@ var TextAreaFrame = styled(InputFrame, {
|
|
|
40
42
|
defaultVariants: {
|
|
41
43
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
42
44
|
}
|
|
43
|
-
}), TextArea = TextAreaFrame.styleable(function(propsIn,
|
|
44
|
-
var props = useInputProps(propsIn,
|
|
45
|
+
}), TextArea = TextAreaFrame.styleable(function(propsIn, forwardedRef) {
|
|
46
|
+
var ref = useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), props = useInputProps(propsIn, composedRefs), linesProp = (
|
|
45
47
|
// web uses rows now, but native not caught up :/
|
|
46
48
|
_define_property({}, isWeb ? "rows" : "numberOfLines", propsIn.unstyled ? void 0 : 4)
|
|
47
49
|
);
|
|
48
|
-
return
|
|
50
|
+
return useEffect(function() {
|
|
51
|
+
if (props.id && !props.disabled)
|
|
52
|
+
return registerFocusable(props.id, {
|
|
53
|
+
focusAndSelect: function() {
|
|
54
|
+
var _ref_current;
|
|
55
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus();
|
|
56
|
+
},
|
|
57
|
+
focus: function() {
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}, [
|
|
61
|
+
props.id,
|
|
62
|
+
props.disabled
|
|
63
|
+
]), /* @__PURE__ */ _jsx(TextAreaFrame, _object_spread({}, linesProp, props));
|
|
49
64
|
});
|
|
50
65
|
export {
|
|
51
66
|
TextArea,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/tamagui/src/views/TextArea.tsx"],
|
|
4
|
-
"mappings": ";AAAA,SAASA,aAAa;AACtB,SAASC,
|
|
5
|
-
"names": ["isWeb", "styled", "textAreaSizeVariant", "InputFrame", "defaultStyles", "useInputProps", "TextAreaFrame", "name", "multiline", "whiteSpace", "variants", "unstyled", "false", "height", "size", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "TextArea", "styleable", "propsIn", "ref", "props", "linesProp", "undefined"]
|
|
4
|
+
"mappings": ";AAAA,SAASA,aAAa;AACtB,SAASC,QAAQC,uBAAuB;AAExC,SAASC,2BAA2B;AAEpC,SAASC,YAAYC,eAAeC,qBAAqB;AACzD,SAASC,yBAAyB;AAClC,SAASC,WAAWC,cAAc;;;;;;;;;;;;;;;;;;;;AAM3B,IAAMC,gBAAgBT,OAAOG,YAAY;EAC9CO,MAAM;EACNC,WAAW;;EAEXC,YAAY;EAEZC,UAAU;IACRC,UAAU;MACRC,OAAO,eAAA;QACLC,QAAQ;SACLZ,aAAAA;IAEP;IAEAa,MAAM;MACJ,WAAWf;IACb;EACF;EAEAgB,iBAAiB;IACfJ,UAAUK,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA,GAIaC,WAAWb,cAAcc,UACpC,SAACC,SAASC,cAAAA;AACR,MAAMC,MAAMlB,OAAc,IAAA,GACpBmB,eAAe1B,gBAAgBwB,cAAcC,GAAAA,GAE7CE,QAAQvB,cAAcmB,SAASG,YAAAA,GAE/BE;;IAEJ,iBAAA,CAAA,GAAC9B,QAAQ,SAAS,iBAAkByB,QAAQV,WAAWgB,SAAY,CAAA;;AAInEvB,mBAAU,WAAA;AACR,QAAKqB,MAAMG,MACPH,OAAMI;AAEV,aAAO1B,kBAAkBsB,MAAMG,IAAI;QACjCE,gBAAgB,WAAA;cACdP;WAAAA,eAAAA,IAAIQ,aAAO,QAAXR,iBAAAA,UAAAA,aAAaS,MAAK;QACpB;QACAA,OAAO,WAAA;QAAO;MAChB,CAAA;EACF,GAAG;IAACP,MAAMG;IAAIH,MAAMI;GAAS,GAGxB,qBAACvB,eAAAA,eAAAA,CAAAA,GAAkBoB,WAAeD,KAAAA,CAAAA;AAC3C,CAAA;",
|
|
5
|
+
"names": ["isWeb", "styled", "useComposedRefs", "textAreaSizeVariant", "InputFrame", "defaultStyles", "useInputProps", "registerFocusable", "useEffect", "useRef", "TextAreaFrame", "name", "multiline", "whiteSpace", "variants", "unstyled", "false", "height", "size", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "TextArea", "styleable", "propsIn", "forwardedRef", "ref", "composedRefs", "props", "linesProp", "undefined", "id", "disabled", "focusAndSelect", "current", "focus"]
|
|
6
6
|
}
|
package/dist/jsx/index.js
CHANGED
package/dist/jsx/index.mjs
CHANGED
package/dist/jsx/setup.js
CHANGED
package/dist/jsx/setup.mjs
CHANGED
package/dist/jsx/views/Input.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { styled, useTheme } from "@tamagui/core";
|
|
2
|
+
import { styled, useComposedRefs, useTheme } from "@tamagui/core";
|
|
3
3
|
import { useFocusable } from "@tamagui/focusable";
|
|
4
4
|
import { TextInput } from "react-native-web";
|
|
5
5
|
import { inputSizeVariant } from "../helpers/inputHelpers";
|
|
6
|
+
import { useRef } from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
const defaultStyles = {
|
|
8
9
|
size: "$true",
|
|
@@ -56,8 +57,8 @@ const defaultStyles = {
|
|
|
56
57
|
selectionColor: "color"
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
), Input = InputFrame.styleable((propsIn,
|
|
60
|
-
const props = useInputProps(propsIn,
|
|
60
|
+
), Input = InputFrame.styleable((propsIn, forwardedRef) => {
|
|
61
|
+
const ref = useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), props = useInputProps(propsIn, composedRefs);
|
|
61
62
|
return /* @__PURE__ */ jsx(InputFrame, { ...props });
|
|
62
63
|
});
|
|
63
64
|
function useInputProps(props, ref) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Input.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,QAAQ,gBAAgB;
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,QAAQ,iBAAiB,gBAAgB;AAClD,SAA4B,oBAAoB;AAChD,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AACjC,SAAoB,cAAc;AAsGzB;AApGF,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,EAEP,GAAI,QACA;AAAA,IACE,UAAU;AAAA,EACZ,IACA;AAAA,IACE,WAAW;AAAA,EACb;AAAA,EAEJ,aAAa;AAAA,EACb,iBAAiB;AAAA;AAAA,EAGjB,UAAU;AAAA,EAEV,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,mBAAmB;AAAA,IACjB,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,EAChB;AACF,GAEa,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IAEN,UAAU;AAAA,MACR,UAAU;AAAA,QACR,OAAO;AAAA,MACT;AAAA,MAEA,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MAEA,UAAU;AAAA,QACR,MAAM,CAAC;AAAA,MACT;AAAA,IACF;AAAA,IAEA,iBAAiB;AAAA,MACf,UAAU,QAAQ,IAAI,qBAAqB;AAAA,IAC7C;AAAA,EACF;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IAET,QAAQ;AAAA,MACN,sBAAsB;AAAA,MACtB,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF,GAca,QAAQ,WAAW,UAA2B,CAAC,SAAS,iBAAiB;AACpF,QAAM,MAAM,OAAc,IAAI,GACxB,eAAe,gBAAgB,cAAc,GAAG,GAChD,QAAQ,cAAc,SAAS,YAAY;AAgBjD,SAAO,oBAAC,cAAY,GAAG,OAAO;AAChC,CAAC;AAEM,SAAS,cAAc,OAAmB,KAAU;AACzD,QAAM,QAAQ,SAAS,GACjB,EAAE,cAAc,KAAK,YAAY,IAAI,aAAa;AAAA;AAAA,IAEtD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,CAAC,GAEK,uBAAuB,MAAM,sBAC7B,uBACJ,MAAM,oBAA2B,GAAG,IAAI,KACxC,wBACA,MAAM,kBAAkB,IAAI;AAE9B,SAAO;AAAA,IACL,KAAK;AAAA,IACL,UAAU,MAAM;AAAA,IAChB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/jsx/views/Input.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { styled, useTheme } from "@tamagui/core";
|
|
2
|
+
import { styled, useComposedRefs, useTheme } from "@tamagui/core";
|
|
3
3
|
import { useFocusable } from "@tamagui/focusable";
|
|
4
4
|
import { TextInput } from "react-native-web";
|
|
5
5
|
import { inputSizeVariant } from "../helpers/inputHelpers.mjs";
|
|
6
|
+
import { useRef } from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
const defaultStyles = {
|
|
8
9
|
size: "$true",
|
|
@@ -54,8 +55,10 @@ const defaultStyles = {
|
|
|
54
55
|
selectionColor: "color"
|
|
55
56
|
}
|
|
56
57
|
}),
|
|
57
|
-
Input = InputFrame.styleable((propsIn,
|
|
58
|
-
const
|
|
58
|
+
Input = InputFrame.styleable((propsIn, forwardedRef) => {
|
|
59
|
+
const ref = useRef(null),
|
|
60
|
+
composedRefs = useComposedRefs(forwardedRef, ref),
|
|
61
|
+
props = useInputProps(propsIn, composedRefs);
|
|
59
62
|
return /* @__PURE__ */jsx(InputFrame, {
|
|
60
63
|
...props
|
|
61
64
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
|
-
import { styled, useTheme } from "@tamagui/core";
|
|
4
|
-
import { useFocusable } from "@tamagui/focusable";
|
|
3
|
+
import { styled, useComposedRefs, useTheme } from "@tamagui/core";
|
|
4
|
+
import { registerFocusable, useFocusable } from "@tamagui/focusable";
|
|
5
5
|
import { TextInput } from "react-native";
|
|
6
6
|
import { inputSizeVariant } from "../helpers/inputHelpers";
|
|
7
|
+
import { useEffect, useRef } from "react";
|
|
7
8
|
function _define_property(obj, key, value) {
|
|
8
9
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
9
10
|
value,
|
|
@@ -86,9 +87,22 @@ var defaultStyles = _object_spread_props(_object_spread({
|
|
|
86
87
|
placeholderTextColor: "color",
|
|
87
88
|
selectionColor: "color"
|
|
88
89
|
}
|
|
89
|
-
}), Input = InputFrame.styleable(function(propsIn,
|
|
90
|
-
var props = useInputProps(propsIn,
|
|
91
|
-
return
|
|
90
|
+
}), Input = InputFrame.styleable(function(propsIn, forwardedRef) {
|
|
91
|
+
var ref = useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), props = useInputProps(propsIn, composedRefs);
|
|
92
|
+
return useEffect(function() {
|
|
93
|
+
if (props.id && !props.disabled)
|
|
94
|
+
return registerFocusable(props.id, {
|
|
95
|
+
focusAndSelect: function() {
|
|
96
|
+
var _ref_current;
|
|
97
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus();
|
|
98
|
+
},
|
|
99
|
+
focus: function() {
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}, [
|
|
103
|
+
props.id,
|
|
104
|
+
props.disabled
|
|
105
|
+
]), /* @__PURE__ */ _jsx(InputFrame, _object_spread({}, props));
|
|
92
106
|
});
|
|
93
107
|
function useInputProps(props, ref) {
|
|
94
108
|
var _theme_placeholderColorProp, _theme_placeholderColor, theme = useTheme(), _useFocusable = useFocusable({
|