@tamagui/focusable 1.135.4 → 1.135.6
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/focusable.native.js +9 -5
- package/dist/cjs/focusable.native.js.map +1 -6
- package/dist/cjs/focusableInputHOC.cjs +1 -1
- package/dist/cjs/focusableInputHOC.js +1 -1
- package/dist/cjs/focusableInputHOC.js.map +1 -1
- package/dist/cjs/focusableInputHOC.native.js +64 -48
- package/dist/cjs/focusableInputHOC.native.js.map +1 -6
- package/dist/cjs/index.native.js +15 -16
- package/dist/cjs/index.native.js.map +1 -6
- package/dist/cjs/registerFocusable.native.js +32 -27
- package/dist/cjs/registerFocusable.native.js.map +1 -6
- package/dist/jsx/focusable.native.js +19 -1
- package/dist/jsx/focusable.native.js.map +1 -6
- package/dist/jsx/focusableInputHOC.native.js +81 -39
- package/dist/jsx/focusableInputHOC.native.js.map +1 -6
- package/dist/jsx/index.native.js +23 -4
- package/dist/jsx/index.native.js.map +1 -6
- package/dist/jsx/registerFocusable.native.js +45 -17
- package/dist/jsx/registerFocusable.native.js.map +1 -6
- package/package.json +5 -4
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
});
|
|
10
12
|
return to;
|
|
11
13
|
};
|
|
12
|
-
var __toCommonJS =
|
|
14
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
+
value: !0
|
|
16
|
+
}), mod);
|
|
13
17
|
var focusable_exports = {};
|
|
14
18
|
module.exports = __toCommonJS(focusable_exports);
|
|
15
|
-
//# sourceMappingURL=focusable.js.map
|
|
19
|
+
//# sourceMappingURL=focusable.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/focusable.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;AAAA;AAAA;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","focusable_exports"],"sources":["../../src/focusable.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,iBAAA","ignoreList":[]}
|
|
@@ -36,7 +36,7 @@ __export(focusableInputHOC_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(focusableInputHOC_exports);
|
|
37
37
|
var import_compose_refs = require("@tamagui/compose-refs"),
|
|
38
38
|
import_web = require("@tamagui/web"),
|
|
39
|
-
import_react = __toESM(require("react")),
|
|
39
|
+
import_react = __toESM(require("react"), 1),
|
|
40
40
|
import_registerFocusable = require("./registerFocusable.cjs");
|
|
41
41
|
function useFocusable({
|
|
42
42
|
isInput,
|
|
@@ -25,7 +25,7 @@ __export(focusableInputHOC_exports, {
|
|
|
25
25
|
useFocusable: () => useFocusable
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(focusableInputHOC_exports);
|
|
28
|
-
var import_compose_refs = require("@tamagui/compose-refs"), import_web = require("@tamagui/web"), import_react = __toESM(require("react")), import_registerFocusable = require("./registerFocusable");
|
|
28
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_web = require("@tamagui/web"), import_react = __toESM(require("react"), 1), import_registerFocusable = require("./registerFocusable");
|
|
29
29
|
function useFocusable({
|
|
30
30
|
isInput,
|
|
31
31
|
props,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B,kCAC5B,aAAyB,yBAEzB,eAAkB,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B,kCAC5B,aAAyB,yBAEzB,eAAkB,8BAElB,2BAAkC;AAS3B,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,EAAE,IAAI,cAAc,OAAO,aAAa,IAAI,OAC5C,aAAa,aAAAA,QAAM,OAAO,SAAS,gBAAgB,EAAE,GACrD,sBAAsB,aAAAA,QAAM,OAA+B,MAAS,GAEpE,iBAAiB,aAAAA,QAAM,YAAY,CAAC,UAAe;AACvD,UAAM,MAAM,GACR,MAAM,gBAAgB,OAAO,WAAW,WAAY,YACtD,MAAM,aAAa,GAAG,WAAW,QAAQ,MAAM;AAAA,EAEnD,GAAG,CAAC,CAAC,GAEC,2BAA2B,aAAAA,QAAM;AAAA,IACrC,CAAC,UAAe;AACd,MAAI,CAAC,MAAM,CAAC,UAEZ,oBAAoB,UAAU,GAC9B,oBAAoB,cAAU,4CAAkB,IAAI;AAAA,QAClD,OAAO,MAAM;AAAA,QACb,GAAI,WAAW;AAAA,UACb,gBAAgB,MAAM,eAAe,KAAK;AAAA,QAC5C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,CAAC,IAAI,SAAS,cAAc;AAAA,EAC9B,GAEM,WAAW,aAAAA,QAAM;AAAA,IACrB,CAAC,UAAe;AACd,MAAI,SACF,yBAAyB,KAAK;AAAA,IAElC;AAAA,IACA,CAAC,wBAAwB;AAAA,EAC3B,GAEM,uBAAmB,qBAAS,CAACC,WAAkB;AACnD,eAAW,UAAUA,QACrB,eAAeA,MAAK;AAAA,EACtB,CAAC;AAED,sBAAAD,QAAM,UAAU,MACP,MAAM;AACX,wBAAoB,UAAU;AAAA,EAChC,GACC,CAAC,CAAC,GAEE;AAAA,IACL,KAAK,aAAAA,QAAM,QAAQ,UAAM,iCAAY,KAAK,QAAQ,GAAG,CAAC,KAAK,QAAQ,CAAC;AAAA,IACpE,cAAc;AAAA,EAChB;AACF;",
|
|
5
5
|
"names": ["React", "value"]
|
|
6
6
|
}
|
|
@@ -1,73 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
__copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
16
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
23
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
24
|
// file that has been converted to a CommonJS file using a Babel-
|
|
19
25
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
26
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: !0
|
|
30
|
+
}) : target, mod)),
|
|
31
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: !0
|
|
33
|
+
}), mod);
|
|
24
34
|
var focusableInputHOC_exports = {};
|
|
25
35
|
__export(focusableInputHOC_exports, {
|
|
26
36
|
useFocusable: () => useFocusable
|
|
27
37
|
});
|
|
28
38
|
module.exports = __toCommonJS(focusableInputHOC_exports);
|
|
29
|
-
var import_compose_refs = require("@tamagui/compose-refs"),
|
|
39
|
+
var import_compose_refs = require("@tamagui/compose-refs"),
|
|
40
|
+
import_web = require("@tamagui/web"),
|
|
41
|
+
import_react = __toESM(require("react"), 1),
|
|
42
|
+
import_registerFocusable = require("./registerFocusable.native.js");
|
|
30
43
|
function useFocusable(param) {
|
|
31
|
-
var {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
var {
|
|
45
|
+
isInput,
|
|
46
|
+
props,
|
|
47
|
+
ref
|
|
48
|
+
} = param,
|
|
49
|
+
{
|
|
50
|
+
id,
|
|
51
|
+
onChangeText,
|
|
52
|
+
value,
|
|
53
|
+
defaultValue
|
|
54
|
+
} = props,
|
|
55
|
+
inputValue = import_react.default.useRef(value || defaultValue || ""),
|
|
56
|
+
unregisterFocusable = import_react.default.useRef(void 0),
|
|
57
|
+
focusAndSelect = import_react.default.useCallback(function (input) {
|
|
58
|
+
input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
|
|
59
|
+
}, []),
|
|
60
|
+
registerFocusableHandler = import_react.default.useCallback(function (input) {
|
|
61
|
+
var _unregisterFocusable_current;
|
|
62
|
+
!id || !input || ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = (0, import_registerFocusable.registerFocusable)(id, {
|
|
63
|
+
focus: input.focus,
|
|
64
|
+
...(isInput && {
|
|
65
|
+
focusAndSelect: function () {
|
|
66
|
+
return focusAndSelect(input);
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
}, [id, isInput, focusAndSelect]),
|
|
71
|
+
inputRef = import_react.default.useCallback(function (input) {
|
|
72
|
+
input && registerFocusableHandler(input);
|
|
73
|
+
}, [registerFocusableHandler]),
|
|
74
|
+
handleChangeText = (0, import_web.useEvent)(function (value2) {
|
|
75
|
+
inputValue.current = value2, onChangeText?.(value2);
|
|
76
|
+
});
|
|
77
|
+
return import_react.default.useEffect(function () {
|
|
78
|
+
return function () {
|
|
56
79
|
var _unregisterFocusable_current;
|
|
57
80
|
(_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable);
|
|
58
81
|
};
|
|
59
82
|
}, []), {
|
|
60
|
-
ref: import_react.default.useMemo(function() {
|
|
83
|
+
ref: import_react.default.useMemo(function () {
|
|
61
84
|
return (0, import_compose_refs.composeRefs)(ref, inputRef);
|
|
62
|
-
}, [
|
|
63
|
-
ref,
|
|
64
|
-
inputRef
|
|
65
|
-
]),
|
|
85
|
+
}, [ref, inputRef]),
|
|
66
86
|
onChangeText: handleChangeText
|
|
67
87
|
};
|
|
68
88
|
}
|
|
69
|
-
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
useFocusable
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=focusableInputHOC.js.map
|
|
89
|
+
//# sourceMappingURL=focusableInputHOC.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B,kCAC5B,aAAyB,yBACzB,eAAkB,2BAClB,2BAAkC;AAC3B,SAAS,aAAa,OAAO;AAChC,MAAI,EAAE,SAAS,OAAO,IAAI,IAAI,OAC1B,EAAE,IAAI,cAAc,OAAO,aAAa,IAAI,OAC5C,aAAa,aAAAA,QAAM,OAAO,SAAS,gBAAgB,EAAE,GACrD,sBAAsB,aAAAA,QAAM,OAAO,MAAS,GAC5C,iBAAiB,aAAAA,QAAM,YAAY,SAAS,OAAO;AACnD,UAAM,MAAM,GACR,MAAM,gBAAgB,OAAO,WAAW,WAAY,YACpD,MAAM,aAAa,GAAG,WAAW,QAAQ,MAAM;AAAA,EAEvD,GAAG,CAAC,CAAC,GACD,2BAA2B,aAAAA,QAAM,YAAY,SAAS,OAAO;AAC7D,QAAI;AACJ,IAAI,CAAC,MAAM,CAAC,WACX,+BAA+B,oBAAoB,aAAa,QAAQ,iCAAiC,UAAkB,6BAA6B,KAAK,mBAAmB,GACjL,oBAAoB,cAAU,4CAAkB,IAAI;AAAA,MAChD,OAAO,MAAM;AAAA,MACb,GAAG,WAAW;AAAA,QACV,gBAAgB,WAAW;AACvB,iBAAO,eAAe,KAAK;AAAA,QAC/B;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL,GAAG;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAC,GACG,WAAW,aAAAA,QAAM,YAAY,SAAS,OAAO;AAC7C,IAAI,SACA,yBAAyB,KAAK;AAAA,EAEtC,GAAG;AAAA,IACC;AAAA,EACJ,CAAC,GACG,uBAAmB,qBAAS,SAASC,QAAO;AAC5C,eAAW,UAAUA,QACrB,gBAAiB,QAA2C,aAAaA,MAAK;AAAA,EAClF,CAAC;AACD,sBAAAD,QAAM,UAAU,WAAW;AACvB,WAAO,WAAW;AACd,UAAI;AACJ,OAAC,+BAA+B,oBAAoB,aAAa,QAAQ,iCAAiC,UAAkB,6BAA6B,KAAK,mBAAmB;AAAA,IACrL;AAAA,EACJ,GAAG,CAAC,CAAC,GACE;AAAA,IACH,KAAK,aAAAA,QAAM,QAAQ,WAAW;AAC1B,iBAAO,iCAAY,KAAK,QAAQ;AAAA,IACpC,GAAG;AAAA,MACC;AAAA,MACA;AAAA,IACJ,CAAC;AAAA,IACD,cAAc;AAAA,EAClB;AACJ;",
|
|
5
|
-
"names": ["React", "value"]
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","focusableInputHOC_exports","__export","useFocusable","module","exports","import_compose_refs","require","import_web","import_react","__toESM","import_registerFocusable","param","isInput","props","ref","id","onChangeText","defaultValue","inputValue","default","useRef","unregisterFocusable","focusAndSelect","useCallback","input","focus","setSelection","current","length","registerFocusableHandler","_unregisterFocusable_current","call","registerFocusable","inputRef","handleChangeText","useEvent","value2","useEffect","useMemo"],"sources":["../../src/focusableInputHOC.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAA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,SAAAA,CAAA;YAEE,OAAOA,cAAM,CAAAE,KAAA;UACb;QAAe;MAC6B;IAC5C,IAEJT,EAAA,EACAH,OAAK,EACPU,cAEiB,CAAM,CACrB;IAACW,QAAA,GAAezB,YAAA,CAAAW,OAAA,CAAAI,WAAA,WAAAC,KAAA;MACdA,KAAI,IAAAK,wBACF,CAAAL,KAAyB;IAAK,GAElC,CACAK,wBAAC,CACH;IAEMK,gBAAA,OAAmB3B,UAAA,CAAA4B,QAAA,EAAU,UAAAC,MAAkB;MACnDlB,UAAA,CAAWS,OAAA,GAAUS,MAAA,EACrBpB,YAAA,GAAeoB,MAAK;IACtB,CAAC;EAED,OAAA5B,YAAA,CAAAW,OAAA,CAAMkB,SAAA,CAAU,YACP;IACL;MAEA,IAEGP,4BAAA;MACL,CAAAA,4BAAW,GAAQT,mBAAM,CAAAM,OAAA,cAAAG,4BAAkC,KAAS,UAAAA,4BAAA,CAAAC,IAAA,CAAAV,mBAAA;IACpE;EACF;IACFP,GAAA,EAAAN,YAAA,CAAAW,OAAA,CAAAmB,OAAA","ignoreList":[]}
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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);
|
|
13
18
|
var index_exports = {};
|
|
14
19
|
module.exports = __toCommonJS(index_exports);
|
|
15
|
-
__reExport(index_exports, require("./registerFocusable"), module.exports);
|
|
16
|
-
__reExport(index_exports, require("./focusableInputHOC"), module.exports);
|
|
17
|
-
__reExport(index_exports, require("./focusable"), module.exports);
|
|
18
|
-
|
|
19
|
-
0 && (module.exports = {
|
|
20
|
-
...require("./registerFocusable"),
|
|
21
|
-
...require("./focusableInputHOC"),
|
|
22
|
-
...require("./focusable")
|
|
23
|
-
});
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
20
|
+
__reExport(index_exports, require("./registerFocusable.native.js"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./focusableInputHOC.native.js"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./focusable.native.js"), module.exports);
|
|
23
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,gCAAd;AACA,0BAAc,gCADd;AAEA,0BAAc,wBAFd;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,mCADdH,MAAA,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,gCAFd,GAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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);
|
|
16
23
|
var registerFocusable_native_exports = {};
|
|
17
24
|
__export(registerFocusable_native_exports, {
|
|
18
25
|
focusFocusable: () => focusFocusable,
|
|
@@ -20,24 +27,22 @@ __export(registerFocusable_native_exports, {
|
|
|
20
27
|
unregisterFocusable: () => unregisterFocusable
|
|
21
28
|
});
|
|
22
29
|
module.exports = __toCommonJS(registerFocusable_native_exports);
|
|
23
|
-
var InputsMap = /* @__PURE__ */
|
|
24
|
-
|
|
30
|
+
var InputsMap = /* @__PURE__ */new Map(),
|
|
31
|
+
registerFocusable = function (id, input) {
|
|
32
|
+
return process.env.NODE_ENV === "development" && InputsMap.has(id) && console.warn(`Warning, duplicate ID for input: ${id}`), InputsMap.set(id, input), function () {
|
|
33
|
+
InputsMap.delete(id);
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
unregisterFocusable = function (id) {
|
|
25
37
|
InputsMap.delete(id);
|
|
38
|
+
},
|
|
39
|
+
focusFocusable = function (id) {
|
|
40
|
+
var select = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1,
|
|
41
|
+
input = InputsMap.get(id);
|
|
42
|
+
if (!input) {
|
|
43
|
+
process.env.NODE_ENV === "development" && console.warn("No input found for id", id);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
select || !input.focusAndSelect ? input.focus() : input.focusAndSelect();
|
|
26
47
|
};
|
|
27
|
-
}, unregisterFocusable = function(id) {
|
|
28
|
-
InputsMap.delete(id);
|
|
29
|
-
}, focusFocusable = function(id) {
|
|
30
|
-
var select = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, input = InputsMap.get(id);
|
|
31
|
-
if (!input) {
|
|
32
|
-
process.env.NODE_ENV === "development" && console.warn("No input found for id", id);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
select || !input.focusAndSelect ? input.focus() : input.focusAndSelect();
|
|
36
|
-
};
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
focusFocusable,
|
|
40
|
-
registerFocusable,
|
|
41
|
-
unregisterFocusable
|
|
42
|
-
});
|
|
43
48
|
//# sourceMappingURL=registerFocusable.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/registerFocusable.native.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAI,YAAY,oBAAI,IAAI,GACb,oBAAoB,SAAS,IAAI,OAAO;AAC/C,SAAI,QAAQ,IAAI,aAAa,iBACrB,UAAU,IAAI,EAAE,KAChB,QAAQ,KAAK,oCAAoC,EAAE,EAAE,GAG7D,UAAU,IAAI,IAAI,KAAK,GAChB,WAAW;AACd,cAAU,OAAO,EAAE;AAAA,EACvB;AACJ,GACW,sBAAsB,SAAS,IAAI;AAC1C,YAAU,OAAO,EAAE;AACvB,GACW,iBAAiB,SAAS,IAAI;AACrC,MAAI,SAAS,UAAU,SAAS,KAAK,UAAU,CAAC,MAAM,SAAS,UAAU,CAAC,IAAI,IAC1E,QAAQ,UAAU,IAAI,EAAE;AAC5B,MAAI,CAAC,OAAO;AACR,IAAI,QAAQ,IAAI,aAAa,iBACzB,QAAQ,KAAK,yBAAyB,EAAE;AAE5C;AAAA,EACJ;AACA,EAAI,UAAU,CAAC,MAAM,iBACjB,MAAM,MAAM,IAEZ,MAAM,eAAe;AAE7B;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["registerFocusable_native_exports","__export","focusFocusable","registerFocusable","unregisterFocusable","module","exports","__toCommonJS","InputsMap","Map","id","input","process","env","NODE_ENV","has","console","warn","set","delete","select","arguments","length","get","focusAndSelect","focus"],"sources":["../../src/registerFocusable.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gCAAA;AAAAC,QAAA,CAAAD,gCAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,gCAAA;AACA,IAAIQ,SAAA,GAAY,mBAAIC,GAAA,CAAI;EACbN,iBAAA,GAAoB,SAAAA,CAASO,EAAA,EAAIC,KAAA,EAAO;IAC/C,OAAIC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBACrBN,SAAA,CAAUO,GAAA,CAAIL,EAAE,KAChBM,OAAA,CAAQC,IAAA,CAAK,oCAAoCP,EAAE,EAAE,GAG7DF,SAAA,CAAUU,GAAA,CAAIR,EAAA,EAAIC,KAAK,GAChB,YAAW;MACdH,SAAA,CAAUW,MAAA,CAAOT,EAAE;IACvB;EACJ;EACWN,mBAAA,GAAsB,SAAAA,CAASM,EAAA,EAAI;IAC1CF,SAAA,CAAUW,MAAA,CAAOT,EAAE;EACvB;EACWR,cAAA,GAAiB,SAAAA,CAASQ,EAAA,EAAI;IACrC,IAAIU,MAAA,GAASC,SAAA,CAAUC,MAAA,GAAS,KAAKD,SAAA,CAAU,CAAC,MAAM,SAASA,SAAA,CAAU,CAAC,IAAI;MAC1EV,KAAA,GAAQH,SAAA,CAAUe,GAAA,CAAIb,EAAE;IAC5B,IAAI,CAACC,KAAA,EAAO;MACJC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBACzBE,OAAA,CAAQC,IAAA,CAAK,yBAAyBP,EAAE;MAE5C;IACJ;IACIU,MAAA,IAAU,CAACT,KAAA,CAAMa,cAAA,GACjBb,KAAA,CAAMc,KAAA,CAAM,IAEZd,KAAA,CAAMa,cAAA,CAAe;EAE7B","ignoreList":[]}
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
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 focusable_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(focusable_exports);
|
|
19
|
+
//# sourceMappingURL=focusable.native.js.map
|
|
@@ -1,47 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
__copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: !0
|
|
30
|
+
}) : target, mod)),
|
|
31
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: !0
|
|
33
|
+
}), mod);
|
|
34
|
+
var focusableInputHOC_exports = {};
|
|
35
|
+
__export(focusableInputHOC_exports, {
|
|
36
|
+
useFocusable: () => useFocusable
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(focusableInputHOC_exports);
|
|
39
|
+
var import_compose_refs = require("@tamagui/compose-refs"),
|
|
40
|
+
import_web = require("@tamagui/web"),
|
|
41
|
+
import_react = __toESM(require("react"), 1),
|
|
42
|
+
import_registerFocusable = require("./registerFocusable.native.js");
|
|
5
43
|
function useFocusable(param) {
|
|
6
|
-
var {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
var {
|
|
45
|
+
isInput,
|
|
46
|
+
props,
|
|
47
|
+
ref
|
|
48
|
+
} = param,
|
|
49
|
+
{
|
|
50
|
+
id,
|
|
51
|
+
onChangeText,
|
|
52
|
+
value,
|
|
53
|
+
defaultValue
|
|
54
|
+
} = props,
|
|
55
|
+
inputValue = import_react.default.useRef(value || defaultValue || ""),
|
|
56
|
+
unregisterFocusable = import_react.default.useRef(void 0),
|
|
57
|
+
focusAndSelect = import_react.default.useCallback(function (input) {
|
|
58
|
+
input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
|
|
59
|
+
}, []),
|
|
60
|
+
registerFocusableHandler = import_react.default.useCallback(function (input) {
|
|
61
|
+
var _unregisterFocusable_current;
|
|
62
|
+
!id || !input || ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = (0, import_registerFocusable.registerFocusable)(id, {
|
|
63
|
+
focus: input.focus,
|
|
64
|
+
...(isInput && {
|
|
65
|
+
focusAndSelect: function () {
|
|
66
|
+
return focusAndSelect(input);
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
}, [id, isInput, focusAndSelect]),
|
|
71
|
+
inputRef = import_react.default.useCallback(function (input) {
|
|
72
|
+
input && registerFocusableHandler(input);
|
|
73
|
+
}, [registerFocusableHandler]),
|
|
74
|
+
handleChangeText = (0, import_web.useEvent)(function (value2) {
|
|
75
|
+
inputValue.current = value2, onChangeText?.(value2);
|
|
76
|
+
});
|
|
77
|
+
return import_react.default.useEffect(function () {
|
|
78
|
+
return function () {
|
|
31
79
|
var _unregisterFocusable_current;
|
|
32
80
|
(_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable);
|
|
33
81
|
};
|
|
34
82
|
}, []), {
|
|
35
|
-
ref:
|
|
36
|
-
return composeRefs(ref, inputRef);
|
|
37
|
-
}, [
|
|
38
|
-
ref,
|
|
39
|
-
inputRef
|
|
40
|
-
]),
|
|
83
|
+
ref: import_react.default.useMemo(function () {
|
|
84
|
+
return (0, import_compose_refs.composeRefs)(ref, inputRef);
|
|
85
|
+
}, [ref, inputRef]),
|
|
41
86
|
onChangeText: handleChangeText
|
|
42
87
|
};
|
|
43
88
|
}
|
|
44
|
-
|
|
45
|
-
useFocusable
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=focusableInputHOC.js.map
|
|
89
|
+
//# sourceM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AO,WAAW;AACd,UAAI;AACJ,OAAC,+BAA+B,oBAAoB,aAAa,QAAQ,iCAAiC,UAAkB,6BAA6B,KAAK,mBAAmB;AAAA,IACrL;AAAA,EACJ,GAAG,CAAC,CAAC,GACE;AAAA,IACH,KAAK,MAAM,QAAQ,WAAW;AAC1B,aAAO,YAAY,KAAK,QAAQ;AAAA,IACpC,GAAG;AAAA,MACC;AAAA,MACA;AAAA,IACJ,CAAC;AAAA,IACD,cAAc;AAAA,EAClB;AACJ;",
|
|
5
|
-
"names": ["value"]
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","focusableInputHOC_exports","useFocusable","module","exports","import_compose_refs","require","import_web","import_react","import_registerFocusable","param","isInput","props","ref","id","onChangeText","defaultValue","inputValue","default","useRef","unregisterFocusable","focusAndSelect","useCallback","input","focus","setSelection","current","length","registerFocusableHandler","_unregisterFocusable_current","registerFocusable"],"sources":["../../src/focusableInputHOC.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AACT,IAAAA,QAAS,GAAAC,MAAA,CAAAC,MAAgB;AAEzB,IAAAC,SAAO,GAAAF,MAAW,CAAAG,cAAA;AAElB,IAAAC,gBAAS,GAAAJ,MAAA,CAAAK,wBAAyB;AAS3B,IAAAC,iBAAS,GAAaN,MAAA,CAAAO,mBAAA;AAAA,IAC3BC,YAAA,GAAAR,MAAA,CAAAS,cAAA;EAAAC,YAAA,GAAAV,MAAA,CAAAW,SAAA,CAAAC,cAAA;AAAA,IACAC,QAAA,GAAAA,CAAAC,MAAA,EAAAC,GAAA;IACA,SAAAC,IAAA,IAAAD,GAAA,EAKCb,SAAA,CAAAY,MAAA,EAAAE,IA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EAAAG,wBAAA,GAAAH,OAAA;AAED,SAAAJ,YAAMA,CAAAQ,KAAU;EAEZ;MAAAC,OAAA;MAAAC,KAAA;MAAoBC;IAAA,IAAAH,KAAU;IAAA;MAAAI,EAAA;MAAAC,YAAA;MAAAhB,KAAA;MAAAiB;IAAA,IAAAJ,KAAA;IAAAK,UAAA,GAAAT,YAAA,CAAAU,OAAA,CAAAC,MAAA,CAAApB,KAAA,IAAAiB,YAAA;IAAAI,mBAAA,GAAAZ,YAAA,CAAAU,OAAA,CAAAC,MAAA;IAAAE,cAAA,GAAAb,YAAA,CAAAU,OAAA,CAAAI,WAAA,WAAAC,KAAA;MAChCA,KACG,CAEEC,KAAA,IAAAD,KAAA,CAAAE,YAAA,WAAAR,UAAA,CAAAS,OAAA,gBAAAH,KAAA,CAAAE,YAAA,IAAAR,UAAA,CAAAS,OAAA,CAAAC,MAAA;IAAA,GACL;IAAKC,wBAAoB,GAAApB,YAAiB,CAAAU,OAAW,CAACI,WAAK,WAASC,KAAA;MACpE,IAAAM,4BAAc;MAChB,CAAAf,EAAA,KAAAS,KAAA,MAAAM,4BAAA,GAAAT,mBAAA,CAAAM,OAAA,cAAAG,4BAAA,eAAAA,4BAAA,CAAAnC,IAAA,CAAA0B,mBAAA,GAAAA,mBAAA,CAAAM,OAAA,OAAAjB,wBAAA,CAAAqB,iBAAA,EAAAhB,EAAA;QACFU,KAAA,EAAAD,KAAA,CAAAC,KAAA","ignoreList":[]}
|
package/dist/jsx/index.native.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 index_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(index_exports);
|
|
20
|
+
__reExport(index_exports, require("./registerFocusable.native.js"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./focusableInputHOC.native.js"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./focusable.native.js"), module.exports);
|
|
23
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,SAAA,GAAcC,MAAA,CAAAC,cAAA;AACd,IAAAC,gBAAc,GAAAF,MAAA,CAAAG,wBAAA","ignoreList":[]}
|
|
@@ -1,20 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 registerFocusable_native_exports = {};
|
|
24
|
+
__export(registerFocusable_native_exports, {
|
|
25
|
+
focusFocusable: () => focusFocusable,
|
|
26
|
+
registerFocusable: () => registerFocusable,
|
|
27
|
+
unregisterFocusable: () => unregisterFocusable
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(registerFocusable_native_exports);
|
|
30
|
+
var InputsMap = /* @__PURE__ */new Map(),
|
|
31
|
+
registerFocusable = function (id, input) {
|
|
32
|
+
return process.env.NODE_ENV === "development" && InputsMap.has(id) && console.warn(`Warning, duplicate ID for input: ${id}`), InputsMap.set(id, input), function () {
|
|
33
|
+
InputsMap.delete(id);
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
unregisterFocusable = function (id) {
|
|
3
37
|
InputsMap.delete(id);
|
|
38
|
+
},
|
|
39
|
+
focusFocusable = function (id) {
|
|
40
|
+
var select = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1,
|
|
41
|
+
input = InputsMap.get(id);
|
|
42
|
+
if (!input) {
|
|
43
|
+
process.env.NODE_ENV === "development" && console.warn("No input found for id", id);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
select || !input.focusAndSelect ? input.focus() : input.focusAndSelect();
|
|
4
47
|
};
|
|
5
|
-
}, unregisterFocusable = function(id) {
|
|
6
|
-
InputsMap.delete(id);
|
|
7
|
-
}, focusFocusable = function(id) {
|
|
8
|
-
var select = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, input = InputsMap.get(id);
|
|
9
|
-
if (!input) {
|
|
10
|
-
process.env.NODE_ENV === "development" && console.warn("No input found for id", id);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
select || !input.focusAndSelect ? input.focus() : input.focusAndSelect();
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
focusFocusable,
|
|
17
|
-
registerFocusable,
|
|
18
|
-
unregisterFocusable
|
|
19
|
-
};
|
|
20
48
|
//# sourceMappingURL=registerFocusable.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/registerFocusable.native.ts"],
|
|
4
|
-
"mappings": "AACA,IAAI,YAAY,oBAAI,IAAI,GACb,oBAAoB,SAAS,IAAI,OAAO;AAC/C,SAAI,QAAQ,IAAI,aAAa,iBACrB,UAAU,IAAI,EAAE,KAChB,QAAQ,KAAK,oCAAoC,EAAE,EAAE,GAG7D,UAAU,IAAI,IAAI,KAAK,GAChB,WAAW;AACd,cAAU,OAAO,EAAE;AAAA,EACvB;AACJ,GACW,sBAAsB,SAAS,IAAI;AAC1C,YAAU,OAAO,EAAE;AACvB,GACW,iBAAiB,SAAS,IAAI;AACrC,MAAI,SAAS,UAAU,SAAS,KAAK,UAAU,CAAC,MAAM,SAAS,UAAU,CAAC,IAAI,IAC1E,QAAQ,UAAU,IAAI,EAAE;AAC5B,MAAI,CAAC,OAAO;AACR,IAAI,QAAQ,IAAI,aAAa,iBACzB,QAAQ,KAAK,yBAAyB,EAAE;AAE5C;AAAA,EACJ;AACA,EAAI,UAAU,CAAC,MAAM,iBACjB,MAAM,MAAM,IAEZ,MAAM,eAAe;AAE7B;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["registerFocusable_native_exports","__export","focusFocusable","registerFocusable","unregisterFocusable","module","exports","__toCommonJS","InputsMap","Map","id","input","process","env","NODE_ENV","has","console","warn","set","delete","select","arguments","length","get","focusAndSelect","focus"],"sources":["../../src/registerFocusable.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gCAAA;AAAAC,QAAA,CAAAD,gCAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,gCAAA;AACA,IAAIQ,SAAA,GAAY,mBAAIC,GAAA,CAAI;EACbN,iBAAA,GAAoB,SAAAA,CAASO,EAAA,EAAIC,KAAA,EAAO;IAC/C,OAAIC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBACrBN,SAAA,CAAUO,GAAA,CAAIL,EAAE,KAChBM,OAAA,CAAQC,IAAA,CAAK,oCAAoCP,EAAE,EAAE,GAG7DF,SAAA,CAAUU,GAAA,CAAIR,EAAA,EAAIC,KAAK,GAChB,YAAW;MACdH,SAAA,CAAUW,MAAA,CAAOT,EAAE;IACvB;EACJ;EACWN,mBAAA,GAAsB,SAAAA,CAASM,EAAA,EAAI;IAC1CF,SAAA,CAAUW,MAAA,CAAOT,EAAE;EACvB;EACWR,cAAA,GAAiB,SAAAA,CAASQ,EAAA,EAAI;IACrC,IAAIU,MAAA,GAASC,SAAA,CAAUC,MAAA,GAAS,KAAKD,SAAA,CAAU,CAAC,MAAM,SAASA,SAAA,CAAU,CAAC,IAAI;MAC1EV,KAAA,GAAQH,SAAA,CAAUe,GAAA,CAAIb,EAAE;IAC5B,IAAI,CAACC,KAAA,EAAO;MACJC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBACzBE,OAAA,CAAQC,IAAA,CAAK,yBAAyBP,EAAE;MAE5C;IACJ;IACIU,MAAA,IAAU,CAACT,KAAA,CAAMa,cAAA,GACjBb,KAAA,CAAMc,KAAA,CAAM,IAEZd,KAAA,CAAMa,cAAA,CAAe;EAE7B","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/focusable",
|
|
3
|
-
"version": "1.135.
|
|
3
|
+
"version": "1.135.6",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"sideEffects": false,
|
|
5
6
|
"source": "src/index.ts",
|
|
6
7
|
"types": "./types/index.d.ts",
|
|
@@ -35,11 +36,11 @@
|
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@tamagui/compose-refs": "1.135.
|
|
39
|
-
"@tamagui/web": "1.135.
|
|
39
|
+
"@tamagui/compose-refs": "1.135.6",
|
|
40
|
+
"@tamagui/web": "1.135.6"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.135.
|
|
43
|
+
"@tamagui/build": "1.135.6",
|
|
43
44
|
"react": "*"
|
|
44
45
|
},
|
|
45
46
|
"publishConfig": {
|