@tamagui/input 1.143.1 → 2.0.0-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 +57 -122
- package/dist/cjs/Input.js +46 -115
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Input.native.js +133 -71
- package/dist/cjs/Input.native.js.map +1 -1
- package/dist/cjs/TextArea.cjs +1 -1
- package/dist/cjs/TextArea.js +1 -1
- package/dist/cjs/TextArea.js.map +1 -1
- package/dist/cjs/TextArea.native.js +1 -1
- package/dist/cjs/TextArea.native.js.map +1 -1
- package/dist/cjs/v1/Input.cjs +190 -0
- package/dist/cjs/v1/Input.js +171 -0
- package/dist/cjs/v1/Input.js.map +6 -0
- package/dist/cjs/v1/Input.native.js +138 -0
- package/dist/cjs/v1/Input.native.js.map +1 -0
- package/dist/cjs/v1/TextArea.cjs +50 -0
- package/dist/cjs/v1/TextArea.js +43 -0
- package/dist/cjs/v1/TextArea.js.map +6 -0
- package/dist/cjs/v1/TextArea.native.js +53 -0
- package/dist/cjs/v1/TextArea.native.js.map +1 -0
- package/dist/cjs/v1/index.cjs +19 -0
- package/dist/cjs/v1/index.js +16 -0
- package/dist/cjs/v1/index.js.map +6 -0
- package/dist/cjs/v1/index.native.js +22 -0
- package/dist/cjs/v1/index.native.js.map +1 -0
- package/dist/cjs/v1/types.cjs +16 -0
- package/dist/cjs/v1/types.js +14 -0
- package/dist/cjs/v1/types.js.map +6 -0
- package/dist/cjs/v1/types.native.js +19 -0
- package/dist/cjs/v1/types.native.js.map +1 -0
- package/dist/esm/Input.js +47 -116
- package/dist/esm/Input.js.map +1 -1
- package/dist/esm/Input.mjs +58 -123
- package/dist/esm/Input.mjs.map +1 -1
- package/dist/esm/Input.native.js +134 -72
- package/dist/esm/Input.native.js.map +1 -1
- package/dist/esm/TextArea.js +1 -1
- package/dist/esm/TextArea.js.map +1 -1
- package/dist/esm/TextArea.mjs +1 -1
- package/dist/esm/TextArea.mjs.map +1 -1
- package/dist/esm/TextArea.native.js +1 -1
- package/dist/esm/TextArea.native.js.map +1 -1
- package/dist/esm/v1/Input.js +151 -0
- package/dist/esm/v1/Input.js.map +6 -0
- package/dist/esm/v1/Input.mjs +156 -0
- package/dist/esm/v1/Input.mjs.map +1 -0
- package/dist/esm/v1/Input.native.js +101 -0
- package/dist/esm/v1/Input.native.js.map +1 -0
- package/dist/esm/v1/TextArea.js +29 -0
- package/dist/esm/v1/TextArea.js.map +6 -0
- package/dist/esm/v1/TextArea.mjs +27 -0
- package/dist/esm/v1/TextArea.mjs.map +1 -0
- package/dist/esm/v1/TextArea.native.js +27 -0
- package/dist/esm/v1/TextArea.native.js.map +1 -0
- package/dist/esm/v1/index.js +3 -0
- package/dist/esm/v1/index.js.map +6 -0
- package/dist/esm/v1/index.mjs +3 -0
- package/dist/esm/v1/index.mjs.map +1 -0
- package/dist/esm/v1/index.native.js +3 -0
- package/dist/esm/v1/index.native.js.map +1 -0
- package/dist/esm/v1/types.js +1 -0
- package/dist/esm/v1/types.js.map +6 -0
- package/dist/esm/v1/types.mjs +2 -0
- package/dist/esm/v1/types.mjs.map +1 -0
- package/dist/esm/v1/types.native.js +2 -0
- package/dist/esm/v1/types.native.js.map +1 -0
- package/dist/jsx/Input.js +47 -116
- package/dist/jsx/Input.js.map +1 -1
- package/dist/jsx/Input.mjs +58 -123
- package/dist/jsx/Input.mjs.map +1 -1
- package/dist/jsx/Input.native.js +133 -71
- package/dist/jsx/Input.native.js.map +1 -1
- package/dist/jsx/TextArea.js +1 -1
- package/dist/jsx/TextArea.js.map +1 -1
- package/dist/jsx/TextArea.mjs +1 -1
- package/dist/jsx/TextArea.mjs.map +1 -1
- package/dist/jsx/TextArea.native.js +1 -1
- package/dist/jsx/TextArea.native.js.map +1 -1
- package/dist/jsx/v1/Input.js +151 -0
- package/dist/jsx/v1/Input.js.map +6 -0
- package/dist/jsx/v1/Input.mjs +156 -0
- package/dist/jsx/v1/Input.mjs.map +1 -0
- package/dist/jsx/v1/Input.native.js +138 -0
- package/dist/jsx/v1/Input.native.js.map +1 -0
- package/dist/jsx/v1/TextArea.js +29 -0
- package/dist/jsx/v1/TextArea.js.map +6 -0
- package/dist/jsx/v1/TextArea.mjs +27 -0
- package/dist/jsx/v1/TextArea.mjs.map +1 -0
- package/dist/jsx/v1/TextArea.native.js +53 -0
- package/dist/jsx/v1/TextArea.native.js.map +1 -0
- package/dist/jsx/v1/index.js +3 -0
- package/dist/jsx/v1/index.js.map +6 -0
- package/dist/jsx/v1/index.mjs +3 -0
- package/dist/jsx/v1/index.mjs.map +1 -0
- package/dist/jsx/v1/index.native.js +22 -0
- package/dist/jsx/v1/index.native.js.map +1 -0
- package/dist/jsx/v1/types.js +1 -0
- package/dist/jsx/v1/types.js.map +6 -0
- package/dist/jsx/v1/types.mjs +2 -0
- package/dist/jsx/v1/types.mjs.map +1 -0
- package/dist/jsx/v1/types.native.js +19 -0
- package/dist/jsx/v1/types.native.js.map +1 -0
- package/package.json +13 -13
- package/src/Input.native.tsx +145 -110
- package/src/Input.tsx +67 -137
- package/src/TextArea.tsx +4 -2
- package/src/index.ts +0 -1
- package/src/types.ts +52 -41
- package/src/v1/Input.native.tsx +154 -0
- package/src/v1/Input.tsx +191 -0
- package/src/v1/TextArea.tsx +35 -0
- package/src/v1/index.ts +3 -0
- package/src/v1/types.ts +65 -0
- package/types/Input.d.ts +47 -21
- package/types/Input.d.ts.map +1 -1
- package/types/Input.native.d.ts +52 -22
- package/types/Input.native.d.ts.map +1 -1
- package/types/TextArea.d.ts +25 -11
- package/types/TextArea.d.ts.map +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +47 -21
- package/types/types.d.ts.map +1 -1
- package/types/v1/Input.d.ts +115 -0
- package/types/v1/Input.d.ts.map +1 -0
- package/types/v1/Input.native.d.ts +114 -0
- package/types/v1/Input.native.d.ts.map +1 -0
- package/types/v1/TextArea.d.ts +98 -0
- package/types/v1/TextArea.d.ts.map +1 -0
- package/types/v1/index.d.ts +4 -0
- package/types/v1/index.d.ts.map +1 -0
- package/types/v1/types.d.ts +39 -0
- package/types/v1/types.d.ts.map +1 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var TextArea_exports = {};
|
|
16
|
+
__export(TextArea_exports, {
|
|
17
|
+
TextArea: () => TextArea
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(TextArea_exports);
|
|
20
|
+
var import_web = require("@tamagui/web"), import_Input = require("./Input"), import_shared = require("../shared");
|
|
21
|
+
const TextArea = (0, import_web.styled)(import_Input.Input, {
|
|
22
|
+
name: "TextArea",
|
|
23
|
+
tag: "textarea",
|
|
24
|
+
// this attribute fixes firefox newline issue
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
whiteSpace: "pre-wrap",
|
|
27
|
+
variants: {
|
|
28
|
+
unstyled: {
|
|
29
|
+
false: {
|
|
30
|
+
height: "auto",
|
|
31
|
+
...import_shared.defaultStyles,
|
|
32
|
+
numberOfLines: 3
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
"...size": import_shared.textAreaSizeVariant
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=TextArea.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/v1/TextArea.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAuB,yBACvB,eAAsB,oBACtB,gBAAmD;AAO5C,MAAM,eAAW,mBAAO,oBAAO;AAAA,EACpC,MAAM;AAAA,EACN,KAAK;AAAA;AAAA;AAAA,EAIL,YAAY;AAAA,EAEZ,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,GAAG;AAAA,QACH,eAAe;AAAA,MACjB;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;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: !0
|
|
22
|
+
}), mod);
|
|
23
|
+
var TextArea_exports = {};
|
|
24
|
+
__export(TextArea_exports, {
|
|
25
|
+
TextArea: () => TextArea
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(TextArea_exports);
|
|
28
|
+
var import_web = require("@tamagui/web"),
|
|
29
|
+
import_Input = require("./Input.native.js"),
|
|
30
|
+
import_shared = require("../shared.native.js"),
|
|
31
|
+
TextArea = (0, import_web.styled)(import_Input.Input, {
|
|
32
|
+
name: "TextArea",
|
|
33
|
+
tag: "textarea",
|
|
34
|
+
// this attribute fixes firefox newline issue
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
whiteSpace: "pre-wrap",
|
|
37
|
+
variants: {
|
|
38
|
+
unstyled: {
|
|
39
|
+
false: {
|
|
40
|
+
height: "auto",
|
|
41
|
+
...import_shared.defaultStyles,
|
|
42
|
+
numberOfLines: 3
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
"...size": import_shared.textAreaSizeVariant
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: {
|
|
50
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=TextArea.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","TextArea_exports","__export","TextArea","module","exports","import_web","require","import_Input","import_shared","styled","Input","name","tag","whiteSpace","variants","unstyled","false","height","defaultStyles","numberOfLines","size","textAreaSizeVariant","defaultVariants","process","env","TAMAGUI_HEADLESS"],"sources":["../../../src/v1/TextArea.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAuBT,YAAA,CAAAK,gBACvB;AAQO,IAAAK,UAAM,GAAAC,OAAW,gBAAO;EAAAC,YAAA,GAAAD,OAAO;EAAAE,aAAA,GAAAF,OAAA;EAAAJ,QAAA,OAAAG,UAAA,CAAAI,MAAA,EAAAF,YAAA,CAAAG,KAAA;IACpCC,IAAA,EAAM;IACNC,GAAA,EAAK;IAAA;IAAA;IAILC,UAAA,EAAY;IAEZC,QAAA,EAAU;MACRC,QAAA,EAAU;QACRC,KAAA,EAAO;UACLC,MAAA,EAAQ;UACR,GAAGT,aAAA,CAAAU,aAAA;UACHC,aAAA,EAAe;QACjB;MACF;MAEAC,IAAA,EAAM;QACJ,WAAWZ,aAAA,CAAAa;MACb;IACF;IAEAC,eAAA,EAAiB;MACfP,QAAA,EAAUQ,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;IAC7C;EACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
16
|
+
var v1_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(v1_exports);
|
|
18
|
+
__reExport(v1_exports, require("./Input.cjs"), module.exports);
|
|
19
|
+
__reExport(v1_exports, require("./TextArea.cjs"), module.exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
+
return to;
|
|
10
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
+
var v1_exports = {};
|
|
13
|
+
module.exports = __toCommonJS(v1_exports);
|
|
14
|
+
__reExport(v1_exports, require("./Input"), module.exports);
|
|
15
|
+
__reExport(v1_exports, require("./TextArea"), module.exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
return to;
|
|
13
|
+
},
|
|
14
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
+
value: !0
|
|
17
|
+
}), mod);
|
|
18
|
+
var v1_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(v1_exports);
|
|
20
|
+
__reExport(v1_exports, require("./Input.native.js"), module.exports);
|
|
21
|
+
__reExport(v1_exports, require("./TextArea.native.js"), module.exports);
|
|
22
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","v1_exports","module","exports","__reExport","require"],"sources":["../../../src/v1/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,UAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,UAAA;AACdG,UAAA,CAAAH,UAAA,EAAcI,OAAA,uBAAAH,MADd,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
};
|
|
12
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
13
|
+
value: !0
|
|
14
|
+
}), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
+
return to;
|
|
10
|
+
};
|
|
11
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
+
var types_exports = {};
|
|
13
|
+
module.exports = __toCommonJS(types_exports);
|
|
14
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
+
value: !0
|
|
16
|
+
}), mod);
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
19
|
+
//# sourceMappingURL=types.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../../src/v1/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
|
package/dist/esm/Input.js
CHANGED
|
@@ -1,117 +1,58 @@
|
|
|
1
|
-
import { View, styled, useComposedRefs,
|
|
1
|
+
import { View, styled, useComposedRefs, useTheme } from "@tamagui/core";
|
|
2
2
|
import { registerFocusable } from "@tamagui/focusable";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { styledBody } from "./shared";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
const StyledInput = styled(View, styledBody[0], styledBody[1]), Input = StyledInput.styleable((
|
|
6
|
+
const StyledInput = styled(View, styledBody[0], styledBody[1]), Input = StyledInput.styleable((props, forwardedRef) => {
|
|
7
7
|
const {
|
|
8
|
-
// some of destructed props are just to avoid passing them to ...rest because they are not in web.
|
|
9
|
-
allowFontScaling,
|
|
10
|
-
selectTextOnFocus,
|
|
11
|
-
showSoftInputOnFocus,
|
|
12
|
-
textContentType,
|
|
13
|
-
passwordRules,
|
|
14
|
-
textBreakStrategy,
|
|
15
|
-
underlineColorAndroid,
|
|
16
|
-
selection,
|
|
17
|
-
lineBreakStrategyIOS,
|
|
18
|
-
returnKeyLabel,
|
|
19
8
|
disabled,
|
|
20
|
-
onSubmitEditing,
|
|
21
|
-
caretHidden,
|
|
22
|
-
clearButtonMode,
|
|
23
|
-
clearTextOnFocus,
|
|
24
|
-
contextMenuHidden,
|
|
25
|
-
dataDetectorTypes,
|
|
26
9
|
id,
|
|
27
|
-
enablesReturnKeyAutomatically,
|
|
28
|
-
importantForAutofill,
|
|
29
|
-
inlineImageLeft,
|
|
30
|
-
inlineImagePadding,
|
|
31
|
-
inputAccessoryViewID,
|
|
32
|
-
keyboardAppearance,
|
|
33
|
-
keyboardType,
|
|
34
|
-
cursorColor,
|
|
35
|
-
disableFullscreenUI,
|
|
36
|
-
editable,
|
|
37
|
-
maxFontSizeMultiplier,
|
|
38
|
-
multiline,
|
|
39
|
-
numberOfLines,
|
|
40
10
|
onChangeText,
|
|
41
|
-
|
|
42
|
-
onEndEditing,
|
|
43
|
-
onScroll,
|
|
11
|
+
onSubmitEditing,
|
|
44
12
|
onSelectionChange,
|
|
45
|
-
|
|
13
|
+
selection,
|
|
46
14
|
placeholderTextColor,
|
|
47
|
-
blurOnSubmit,
|
|
48
|
-
enterKeyHint,
|
|
49
|
-
returnKeyType,
|
|
50
|
-
rejectResponderTermination,
|
|
51
|
-
scrollEnabled,
|
|
52
|
-
secureTextEntry,
|
|
53
15
|
selectionColor,
|
|
54
|
-
|
|
16
|
+
rows,
|
|
55
17
|
...rest
|
|
56
|
-
} =
|
|
57
|
-
const start = ref.current?.selectionStart ?? 0, end = ref.current?.selectionEnd ?? 0;
|
|
58
|
-
onSelectionChange?.({
|
|
59
|
-
nativeEvent: {
|
|
60
|
-
selection: {
|
|
61
|
-
end,
|
|
62
|
-
start
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
18
|
+
} = props, ref = React.useRef(null), theme = useTheme(), composedRefs = useComposedRefs(forwardedRef, ref);
|
|
67
19
|
React.useEffect(() => {
|
|
68
|
-
if (onSelectionChange)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
20
|
+
if (!onSelectionChange) return;
|
|
21
|
+
const node = ref.current;
|
|
22
|
+
if (!node) return;
|
|
23
|
+
const handleSelectionChange = () => {
|
|
24
|
+
onSelectionChange({
|
|
25
|
+
nativeEvent: {
|
|
26
|
+
selection: {
|
|
27
|
+
start: node.selectionStart ?? 0,
|
|
28
|
+
end: node.selectionEnd ?? 0
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return node.addEventListener("select", handleSelectionChange), () => node.removeEventListener("select", handleSelectionChange);
|
|
34
|
+
}, [onSelectionChange]), React.useEffect(() => {
|
|
35
|
+
selection && ref.current && ref.current.setSelectionRange(selection.start, selection.end ?? selection.start);
|
|
36
|
+
}, [selection?.start, selection?.end]), React.useEffect(() => {
|
|
37
|
+
if (!(!id || disabled))
|
|
38
|
+
return registerFocusable(id, {
|
|
39
|
+
focusAndSelect: () => ref.current?.focus(),
|
|
40
|
+
focus: () => ref.current?.focus()
|
|
41
|
+
});
|
|
42
|
+
}, [id, disabled]);
|
|
43
|
+
const handleKeyDown = (e) => {
|
|
44
|
+
e.key === "Enter" && onSubmitEditing && onSubmitEditing({
|
|
45
|
+
nativeEvent: { text: e.target.value }
|
|
46
|
+
}), rest.onKeyDown?.(e);
|
|
47
|
+
}, handleChange = (e) => {
|
|
48
|
+
onChangeText?.(e.target.value), rest.onChange?.(e);
|
|
49
|
+
}, finalProps = {
|
|
76
50
|
...rest,
|
|
77
51
|
disabled,
|
|
78
|
-
caretColor,
|
|
79
52
|
id,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (secureTextEntry) return "password";
|
|
84
|
-
switch (keyboardType) {
|
|
85
|
-
case "number-pad":
|
|
86
|
-
case "numeric":
|
|
87
|
-
return "number";
|
|
88
|
-
case "email-address":
|
|
89
|
-
return "email";
|
|
90
|
-
case "phone-pad":
|
|
91
|
-
return "tel";
|
|
92
|
-
case "url":
|
|
93
|
-
return "url";
|
|
94
|
-
default:
|
|
95
|
-
return "text";
|
|
96
|
-
}
|
|
97
|
-
})(),
|
|
98
|
-
inputMode: (() => {
|
|
99
|
-
switch (keyboardType) {
|
|
100
|
-
case "number-pad":
|
|
101
|
-
case "numeric":
|
|
102
|
-
return "numeric";
|
|
103
|
-
case "decimal-pad":
|
|
104
|
-
return "decimal";
|
|
105
|
-
case "email-address":
|
|
106
|
-
return "email";
|
|
107
|
-
case "phone-pad":
|
|
108
|
-
return "tel";
|
|
109
|
-
case "url":
|
|
110
|
-
return "url";
|
|
111
|
-
default:
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
})(),
|
|
53
|
+
rows,
|
|
54
|
+
onKeyDown: onSubmitEditing ? handleKeyDown : rest.onKeyDown,
|
|
55
|
+
onChange: onChangeText ? handleChange : rest.onChange,
|
|
115
56
|
style: {
|
|
116
57
|
...rest.style,
|
|
117
58
|
...placeholderTextColor && {
|
|
@@ -122,25 +63,15 @@ const StyledInput = styled(View, styledBody[0], styledBody[1]), Input = StyledIn
|
|
|
122
63
|
}
|
|
123
64
|
}
|
|
124
65
|
};
|
|
125
|
-
return
|
|
126
|
-
if (id && !disabled)
|
|
127
|
-
return registerFocusable(id, {
|
|
128
|
-
focusAndSelect: () => {
|
|
129
|
-
ref.current?.focus();
|
|
130
|
-
},
|
|
131
|
-
focus: () => {
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}, [id, disabled]), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
66
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
135
67
|
/* @__PURE__ */ jsx("style", { children: `
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
` }),
|
|
68
|
+
input::selection, textarea::selection {
|
|
69
|
+
background-color: var(--selectionColor) !important;
|
|
70
|
+
}
|
|
71
|
+
input::placeholder, textarea::placeholder {
|
|
72
|
+
color: var(--placeholderColor) !important;
|
|
73
|
+
}
|
|
74
|
+
` }),
|
|
144
75
|
/* @__PURE__ */ jsx(StyledInput, { ref: composedRefs, ...finalProps })
|
|
145
76
|
] });
|
|
146
77
|
});
|
package/dist/esm/Input.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Input.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,MAAM,QAAQ,iBAAiB,
|
|
4
|
+
"mappings": "AAAA,SAAS,MAAM,QAAQ,iBAAiB,gBAAgB;AACxD,SAAS,yBAAyB;AAClC,OAAO,WAAW;AAClB,SAAS,kBAAkB;AAqGvB,mBACE,KADF;AAlGJ,MAAM,cAAc,OAAO,MAAM,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC,GAMhD,QAAQ,YAAY,UAAsB,CAAC,OAAO,iBAAiB;AAC9E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,OAEE,MAAM,MAAM,OAAyB,IAAI,GACzC,QAAQ,SAAS,GACjB,eAAe,gBAAgB,cAAc,GAAG;AAGtD,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,kBAAmB;AAExB,UAAM,OAAO,IAAI;AACjB,QAAI,CAAC,KAAM;AAEX,UAAM,wBAAwB,MAAM;AAClC,wBAAkB;AAAA,QAChB,aAAa;AAAA,UACX,WAAW;AAAA,YACT,OAAO,KAAK,kBAAkB;AAAA,YAC9B,KAAK,KAAK,gBAAgB;AAAA,UAC5B;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAEA,gBAAK,iBAAiB,UAAU,qBAAqB,GAC9C,MAAM,KAAK,oBAAoB,UAAU,qBAAqB;AAAA,EACvE,GAAG,CAAC,iBAAiB,CAAC,GAGtB,MAAM,UAAU,MAAM;AACpB,IAAI,aAAa,IAAI,WACnB,IAAI,QAAQ,kBAAkB,UAAU,OAAO,UAAU,OAAO,UAAU,KAAK;AAAA,EAEnF,GAAG,CAAC,WAAW,OAAO,WAAW,GAAG,CAAC,GAGrC,MAAM,UAAU,MAAM;AACpB,QAAI,GAAC,MAAM;AACX,aAAO,kBAAkB,IAAI;AAAA,QAC3B,gBAAgB,MAAM,IAAI,SAAS,MAAM;AAAA,QACzC,OAAO,MAAM,IAAI,SAAS,MAAM;AAAA,MAClC,CAAC;AAAA,EACH,GAAG,CAAC,IAAI,QAAQ,CAAC;AAGjB,QAAM,gBAAgB,CAAC,MAA6C;AAClE,IAAI,EAAE,QAAQ,WAAW,mBACvB,gBAAgB;AAAA,MACd,aAAa,EAAE,MAAO,EAAE,OAA4B,MAAM;AAAA,IAC5D,CAAC,GAEH,KAAK,YAAY,CAAC;AAAA,EACpB,GAGM,eAAe,CAAC,MAA2C;AAC/D,mBAAe,EAAE,OAAO,KAAK,GAC7B,KAAK,WAAW,CAAC;AAAA,EACnB,GAEM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,kBAAkB,gBAAgB,KAAK;AAAA,IAClD,UAAU,eAAe,eAAe,KAAK;AAAA,IAC7C,OAAO;AAAA,MACL,GAAI,KAAK;AAAA,MACT,GAAI,wBAAwB;AAAA,QAC1B,sBACE,MAAM,oBAAoB,GAAG,YAAY;AAAA,MAC7C;AAAA,MACA,GAAI,kBAAkB;AAAA,QACpB,oBAAoB,MAAM,cAAc,GAAG,YAAY;AAAA,MACzD;AAAA,IACF;AAAA,EACF;AAEA,SACE,iCACE;AAAA,wBAAC,WACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAQH;AAAA,IACA,oBAAC,eAAY,KAAK,cAAe,GAAG,YAAY;AAAA,KAClD;AAEJ,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|