@tamagui/focusable 1.108.0 → 1.108.2
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/focusableInputHOC.js +13 -5
- package/dist/cjs/focusableInputHOC.js.map +2 -2
- package/dist/cjs/focusableInputHOC.native.js +13 -5
- package/dist/cjs/focusableInputHOC.native.js.map +2 -2
- package/dist/esm/focusableInputHOC.js +3 -3
- package/dist/esm/focusableInputHOC.js.map +1 -1
- package/dist/esm/focusableInputHOC.mjs +5 -5
- package/dist/esm/focusableInputHOC.mjs.map +1 -1
- package/dist/esm/focusableInputHOC.native.js +3 -3
- package/dist/esm/focusableInputHOC.native.js.map +2 -2
- package/dist/jsx/focusableInputHOC.js +3 -3
- package/dist/jsx/focusableInputHOC.js.map +1 -1
- package/dist/jsx/focusableInputHOC.mjs +5 -5
- package/dist/jsx/focusableInputHOC.mjs.map +1 -1
- package/dist/jsx/focusableInputHOC.native.js +3 -3
- package/dist/jsx/focusableInputHOC.native.js.map +2 -2
- package/package.json +4 -4
- package/src/focusableInputHOC.tsx +7 -10
- package/types/focusableInputHOC.d.ts +1 -1
- package/types/focusableInputHOC.d.ts.map +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
7
|
for (var name in all)
|
|
7
8
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -11,20 +12,27 @@ var __export = (target, all) => {
|
|
|
11
12
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
13
|
return to;
|
|
13
14
|
};
|
|
14
|
-
var
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
23
|
var focusableInputHOC_exports = {};
|
|
16
24
|
__export(focusableInputHOC_exports, {
|
|
17
25
|
focusableInputHOC: () => focusableInputHOC,
|
|
18
26
|
useFocusable: () => useFocusable
|
|
19
27
|
});
|
|
20
28
|
module.exports = __toCommonJS(focusableInputHOC_exports);
|
|
21
|
-
var
|
|
29
|
+
var import_react = __toESM(require("react")), import_compose_refs = require("@tamagui/compose-refs"), import_web = require("@tamagui/web"), import_registerFocusable = require("./registerFocusable"), import_jsx_runtime = require("react/jsx-runtime");
|
|
22
30
|
function useFocusable({
|
|
23
31
|
isInput,
|
|
24
32
|
props,
|
|
25
33
|
ref
|
|
26
34
|
}) {
|
|
27
|
-
const { id, onChangeText, value, defaultValue } = props, inputValue =
|
|
35
|
+
const { id, onChangeText, value, defaultValue } = props, inputValue = import_react.default.useRef(value || defaultValue || ""), unregisterFocusable = import_react.default.useRef(), inputRef = import_react.default.useCallback(
|
|
28
36
|
(input) => {
|
|
29
37
|
id && input && (unregisterFocusable.current?.(), unregisterFocusable.current = (0, import_registerFocusable.registerFocusable)(id, {
|
|
30
38
|
focus: input.focus,
|
|
@@ -38,7 +46,7 @@ function useFocusable({
|
|
|
38
46
|
},
|
|
39
47
|
[isInput, id]
|
|
40
48
|
), combinedRefs = (0, import_compose_refs.composeRefs)(ref, inputRef);
|
|
41
|
-
return
|
|
49
|
+
return import_react.default.useEffect(() => () => {
|
|
42
50
|
unregisterFocusable.current?.();
|
|
43
51
|
}, []), {
|
|
44
52
|
ref: combinedRefs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["value"]
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,2BAClB,sBAA4B,kCAE5B,aAAyB,yBAGzB,2BAAkC,gCAyEvB;AAhEJ,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,GAA8E;AAC5E,QAAM,EAAE,IAAI,cAAc,OAAO,aAAa,IAAI,OAC5C,aAAa,aAAAA,QAAM,OAAO,SAAS,gBAAgB,EAAE,GACrD,sBAAsB,aAAAA,QAAM,OAA+B,GAE3D,WAAW,aAAAA,QAAM;AAAA,IACrB,CAAC,UAAU;AACT,MAAK,MACA,UACL,oBAAoB,UAAU,GAC9B,oBAAoB,cAAU,4CAAkB,IAAI;AAAA,QAClD,OAAO,MAAM;AAAA,QAEb,GAAI,WAAW;AAAA;AAAA,UAEb,iBAAiB;AACf,kBAAM,MAAM,GACR,MAAM,gBAAgB,OAAO,WAAW,WAAY,YACtD,MAAM,aAAa,GAAG,WAAW,QAAQ,MAAM;AAAA,UAEnD;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS,EAAE;AAAA,EACd,GAEM,mBAAe,iCAAY,KAAK,QAAQ;AAE9C,sBAAAA,QAAM,UAAU,MACP,MAAM;AACX,wBAAoB,UAAU;AAAA,EAChC,GACC,CAAC,CAAC,GAEE;AAAA,IACL,KAAK;AAAA,IACL,kBAAc,qBAAS,CAACC,WAAU;AAChC,iBAAW,UAAUA,QACrB,eAAeA,MAAK;AAAA,IACtB,CAAC;AAAA,EACH;AACF;AAEO,SAAS,kBAA8C,WAAiB;AAC7E,SAAO,UAAU,UAAU,CAAC,OAAuB,QAAQ;AACzD,UAAM,UAAU,UAAU,cAAc,SAClC,EAAE,KAAK,aAAa,aAAa,IAAI,aAAa;AAAA,MACtD;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,GACK,aAAa,UACf;AAAA,MACE,GAAG;AAAA,MACH;AAAA,IACF,IACA;AAGJ,WAAO,4CAAC,aAAU,KAAK,aAAc,GAAG,YAAY;AAAA,EACtD,CAAC;AACH;",
|
|
5
|
+
"names": ["React", "value"]
|
|
6
6
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -12,14 +13,21 @@ var __export = (target, all) => {
|
|
|
12
13
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
14
|
return to;
|
|
14
15
|
};
|
|
15
|
-
var
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
24
|
var focusableInputHOC_exports = {};
|
|
17
25
|
__export(focusableInputHOC_exports, {
|
|
18
26
|
focusableInputHOC: () => focusableInputHOC,
|
|
19
27
|
useFocusable: () => useFocusable
|
|
20
28
|
});
|
|
21
29
|
module.exports = __toCommonJS(focusableInputHOC_exports);
|
|
22
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_compose_refs = require("@tamagui/compose-refs"), import_web = require("@tamagui/web"), import_registerFocusable = require("./registerFocusable");
|
|
23
31
|
function _define_property(obj, key, value) {
|
|
24
32
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
25
33
|
value,
|
|
@@ -55,7 +63,7 @@ function _object_spread_props(target, source) {
|
|
|
55
63
|
}), target;
|
|
56
64
|
}
|
|
57
65
|
function useFocusable(param) {
|
|
58
|
-
var isInput = param.isInput, props = param.props, ref = param.ref, id = props.id, onChangeText = props.onChangeText, value = props.value, defaultValue = props.defaultValue, inputValue =
|
|
66
|
+
var isInput = param.isInput, props = param.props, ref = param.ref, id = props.id, onChangeText = props.onChangeText, value = props.value, defaultValue = props.defaultValue, inputValue = import_react.default.useRef(value || defaultValue || ""), unregisterFocusable = import_react.default.useRef(), inputRef = import_react.default.useCallback(function(input) {
|
|
59
67
|
var _unregisterFocusable_current;
|
|
60
68
|
id && input && ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = (0, import_registerFocusable.registerFocusable)(id, _object_spread({
|
|
61
69
|
focus: input.focus
|
|
@@ -69,7 +77,7 @@ function useFocusable(param) {
|
|
|
69
77
|
isInput,
|
|
70
78
|
id
|
|
71
79
|
]), combinedRefs = (0, import_compose_refs.composeRefs)(ref, inputRef);
|
|
72
|
-
return
|
|
80
|
+
return import_react.default.useEffect(function() {
|
|
73
81
|
return function() {
|
|
74
82
|
var _unregisterFocusable_current;
|
|
75
83
|
(_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/focusable/src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["useFocusable", "isInput", "props", "ref", "id", "onChangeText", "value", "defaultValue", "inputValue", "useRef", "unregisterFocusable", "inputRef", "useCallback", "input", "current", "registerFocusable", "focus", "focusAndSelect", "setSelection", "length", "combinedRefs", "composeRefs", "useEffect", "useEvent", "focusableInputHOC", "Component", "styleable", "staticConfig", "combinedRef", "finalProps", "_jsx"]
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAClB,sBAA4B,kCAE5B,aAAyB,yBAGzB,2BAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAS3B,SAASA,aAAa,OAI+C;MAH1EC,UAD2B,MAC3BA,SACAC,QAF2B,MAE3BA,OACAC,MAH2B,MAG3BA,KAEQC,KAA0CF,MAA1CE,IAAIC,eAAsCH,MAAtCG,cAAcC,QAAwBJ,MAAxBI,OAAOC,eAAiBL,MAAjBK,cAC3BC,aAAaC,aAAAA,QAAMC,OAAOJ,SAASC,gBAAgB,EAAA,GACnDI,sBAAsBF,aAAAA,QAAMC,OAAM,GAElCE,WAAWH,aAAAA,QAAMI,YACrB,SAACC,OAAAA;QAGCH;AAFA,IAAKP,MACAU,WACLH,+BAAAA,oBAAoBI,aAAO,QAA3BJ,iCAAAA,UAAAA,6BAAAA,KAAAA,mBAAAA,GACAA,oBAAoBI,cAAUC,4CAAkBZ,IAAI,eAAA;MAClDa,OAAOH,MAAMG;OAEThB,WAAW;;MAEbiB,gBAAAA,WAAAA;AACEJ,cAAMG,MAAK,GACPH,MAAMK,gBAAgB,OAAOX,WAAWO,WAAY,YACtDD,MAAMK,aAAa,GAAGX,WAAWO,QAAQK,MAAM;MAEnD;IACF,CAAA,CAAA;EAEJ,GACA;IAACnB;IAASG;GAAG,GAGTiB,mBAAeC,iCAAYnB,KAAKS,QAAAA;AAEtCH,sBAAAA,QAAMc,UAAU,WAAA;AACd,WAAO,WAAA;UACLZ;OAAAA,+BAAAA,oBAAoBI,aAAO,QAA3BJ,iCAAAA,UAAAA,6BAAAA,KAAAA,mBAAAA;IACF;EACF,GAAG,CAAA,CAAE,GAEE;IACLR,KAAKkB;IACLhB,kBAAcmB,qBAAS,SAAClB,QAAAA;AACtBE,iBAAWO,UAAUT,QACrBD,gBAAAA,QAAAA,aAAeC,MAAAA;IACjB,CAAA;EACF;AACF;AAEO,SAASmB,kBAA8CC,WAAY;AACxE,SAAOA,UAAUC,UAAU,SAACzB,OAAuBC,KAAAA;QACjCuB,yBAAVzB,WAAUyB,0BAAAA,UAAUE,kBAAY,QAAtBF,4BAAAA,SAAAA,SAAAA,wBAAwBzB,SACGD,gBAAAA,aAAa;MACtDG;MACAD;MACAD;IACF,CAAA,GAJa4B,cAA8B7B,cAAnCG,KAAkBE,eAAiBL,cAAjBK,cAKpByB,aAAa7B,UACf,qBAAA,eAAA,CAAA,GACKC,KAAAA,GAAAA;MACHG;SAEFH;AAGJ,WAAO,uCAAA6B,KAACL,WAAAA,eAAAA;MAAUvB,KAAK0B;OAAiBC,UAAAA,CAAAA;EAC1C,CAAA;AACF;",
|
|
5
|
+
"names": ["useFocusable", "isInput", "props", "ref", "id", "onChangeText", "value", "defaultValue", "inputValue", "React", "useRef", "unregisterFocusable", "inputRef", "useCallback", "input", "current", "registerFocusable", "focus", "focusAndSelect", "setSelection", "length", "combinedRefs", "composeRefs", "useEffect", "useEvent", "focusableInputHOC", "Component", "styleable", "staticConfig", "combinedRef", "finalProps", "_jsx"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { composeRefs } from "@tamagui/compose-refs";
|
|
2
3
|
import { useEvent } from "@tamagui/web";
|
|
3
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
4
4
|
import { registerFocusable } from "./registerFocusable";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function useFocusable({
|
|
@@ -8,7 +8,7 @@ function useFocusable({
|
|
|
8
8
|
props,
|
|
9
9
|
ref
|
|
10
10
|
}) {
|
|
11
|
-
const { id, onChangeText, value, defaultValue } = props, inputValue = useRef(value || defaultValue || ""), unregisterFocusable = useRef(), inputRef = useCallback(
|
|
11
|
+
const { id, onChangeText, value, defaultValue } = props, inputValue = React.useRef(value || defaultValue || ""), unregisterFocusable = React.useRef(), inputRef = React.useCallback(
|
|
12
12
|
(input) => {
|
|
13
13
|
id && input && (unregisterFocusable.current?.(), unregisterFocusable.current = registerFocusable(id, {
|
|
14
14
|
focus: input.focus,
|
|
@@ -22,7 +22,7 @@ function useFocusable({
|
|
|
22
22
|
},
|
|
23
23
|
[isInput, id]
|
|
24
24
|
), combinedRefs = composeRefs(ref, inputRef);
|
|
25
|
-
return useEffect(() => () => {
|
|
25
|
+
return React.useEffect(() => () => {
|
|
26
26
|
unregisterFocusable.current?.();
|
|
27
27
|
}, []), {
|
|
28
28
|
ref: combinedRefs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,gBAAgB;
|
|
4
|
+
"mappings": "AAAA,OA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|
"names": ["value"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { composeRefs } from "@tamagui/compose-refs";
|
|
2
3
|
import { useEvent } from "@tamagui/web";
|
|
3
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
4
4
|
import { registerFocusable } from "./registerFocusable.mjs";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function useFocusable({
|
|
@@ -14,9 +14,9 @@ function useFocusable({
|
|
|
14
14
|
value,
|
|
15
15
|
defaultValue
|
|
16
16
|
} = props,
|
|
17
|
-
inputValue = useRef(value || defaultValue || ""),
|
|
18
|
-
unregisterFocusable = useRef(),
|
|
19
|
-
inputRef = useCallback(input => {
|
|
17
|
+
inputValue = React.useRef(value || defaultValue || ""),
|
|
18
|
+
unregisterFocusable = React.useRef(),
|
|
19
|
+
inputRef = React.useCallback(input => {
|
|
20
20
|
id && input && (unregisterFocusable.current?.(), unregisterFocusable.current = registerFocusable(id, {
|
|
21
21
|
focus: input.focus,
|
|
22
22
|
...(isInput && {
|
|
@@ -28,7 +28,7 @@ function useFocusable({
|
|
|
28
28
|
}));
|
|
29
29
|
}, [isInput, id]),
|
|
30
30
|
combinedRefs = composeRefs(ref, inputRef);
|
|
31
|
-
return useEffect(() => () => {
|
|
31
|
+
return React.useEffect(() => () => {
|
|
32
32
|
unregisterFocusable.current?.();
|
|
33
33
|
}, []), {
|
|
34
34
|
ref: combinedRefs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","composeRefs","useEvent","registerFocusable","jsx","useFocusable","isInput","props","ref","id","onChangeText","value","defaultValue","inputValue","useRef","unregisterFocusable","inputRef","useCallback","input","current","focus","focusAndSelect","setSelection","length","combinedRefs","useEffect","value2","focusableInputHOC","Component","styleable","staticConfig","combinedRef","finalProps"],"sources":["../../src/focusableInputHOC.tsx"],"sourcesContent":[null],"mappings":"AAAA,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AASC,kBAA8CC,SAAA,EAAiB;EAC7E,OAAOA,SAAA,CAAUC,SAAA,CAAU,CAACtB,KAAA,EAAuBC,GAAA,KAAQ;IACzD,MAAMF,OAAA,GAAUsB,SAAA,CAAUE,YAAA,EAAcxB,OAAA;MAClC;QAAEE,GAAA,EAAKuB,WAAA;QAAarB;MAAa,IAAIL,YAAA,CAAa;QACtDG,GAAA;QACAD,KAAA;QACAD;MACF,CAAC;MACK0B,UAAA,GAAa1B,OAAA,GACf;QACE,GAAGC,KAAA;QACHG;MACF,IACAH,KAAA;IAGJ,OAAO,eAAAH,GAAA,CAACwB,SAAA;MAAUpB,GAAA,EAAKuB,WAAA;MAAc,GAAGC;IAAA,CAAY;EACtD,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { composeRefs } from "@tamagui/compose-refs";
|
|
3
4
|
import { useEvent } from "@tamagui/web";
|
|
4
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
5
5
|
import { registerFocusable } from "./registerFocusable";
|
|
6
6
|
function _define_property(obj, key, value) {
|
|
7
7
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
@@ -38,7 +38,7 @@ function _object_spread_props(target, source) {
|
|
|
38
38
|
}), target;
|
|
39
39
|
}
|
|
40
40
|
function useFocusable(param) {
|
|
41
|
-
var isInput = param.isInput, props = param.props, ref = param.ref, id = props.id, onChangeText = props.onChangeText, value = props.value, defaultValue = props.defaultValue, inputValue = useRef(value || defaultValue || ""), unregisterFocusable = useRef(), inputRef = useCallback(function(input) {
|
|
41
|
+
var isInput = param.isInput, props = param.props, ref = param.ref, id = props.id, onChangeText = props.onChangeText, value = props.value, defaultValue = props.defaultValue, inputValue = React.useRef(value || defaultValue || ""), unregisterFocusable = React.useRef(), inputRef = React.useCallback(function(input) {
|
|
42
42
|
var _unregisterFocusable_current;
|
|
43
43
|
id && input && ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = registerFocusable(id, _object_spread({
|
|
44
44
|
focus: input.focus
|
|
@@ -52,7 +52,7 @@ function useFocusable(param) {
|
|
|
52
52
|
isInput,
|
|
53
53
|
id
|
|
54
54
|
]), combinedRefs = composeRefs(ref, inputRef);
|
|
55
|
-
return useEffect(function() {
|
|
55
|
+
return React.useEffect(function() {
|
|
56
56
|
return function() {
|
|
57
57
|
var _unregisterFocusable_current;
|
|
58
58
|
(_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/focusable/src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": ";AAAA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";AAAA,OAAOA,WAAW;AAClB,SAASC,mBAAmB;AAE5B,SAASC,gBAAgB;AAGzB,SAASC,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAS3B,SAASC,aAAa,OAI+C;MAH1EC,UAD2B,MAC3BA,SACAC,QAF2B,MAE3BA,OACAC,MAH2B,MAG3BA,KAEQC,KAA0CF,MAA1CE,IAAIC,eAAsCH,MAAtCG,cAAcC,QAAwBJ,MAAxBI,OAAOC,eAAiBL,MAAjBK,cAC3BC,aAAaZ,MAAMa,OAAOH,SAASC,gBAAgB,EAAA,GACnDG,sBAAsBd,MAAMa,OAAM,GAElCE,WAAWf,MAAMgB,YACrB,SAACC,OAAAA;QAGCH;AAFA,IAAKN,MACAS,WACLH,+BAAAA,oBAAoBI,aAAO,QAA3BJ,iCAAAA,UAAAA,6BAAAA,KAAAA,mBAAAA,GACAA,oBAAoBI,UAAUf,kBAAkBK,IAAI,eAAA;MAClDW,OAAOF,MAAME;OAETd,WAAW;;MAEbe,gBAAAA,WAAAA;AACEH,cAAME,MAAK,GACPF,MAAMI,gBAAgB,OAAOT,WAAWM,WAAY,YACtDD,MAAMI,aAAa,GAAGT,WAAWM,QAAQI,MAAM;MAEnD;IACF,CAAA,CAAA;EAEJ,GACA;IAACjB;IAASG;GAAG,GAGTe,eAAetB,YAAYM,KAAKQ,QAAAA;AAEtCf,eAAMwB,UAAU,WAAA;AACd,WAAO,WAAA;UACLV;OAAAA,+BAAAA,oBAAoBI,aAAO,QAA3BJ,iCAAAA,UAAAA,6BAAAA,KAAAA,mBAAAA;IACF;EACF,GAAG,CAAA,CAAE,GAEE;IACLP,KAAKgB;IACLd,cAAcP,SAAS,SAACQ,QAAAA;AACtBE,iBAAWM,UAAUR,QACrBD,gBAAAA,QAAAA,aAAeC,MAAAA;IACjB,CAAA;EACF;AACF;AAEO,SAASe,kBAA8CC,WAAY;AACxE,SAAOA,UAAUC,UAAU,SAACrB,OAAuBC,KAAAA;QACjCmB,yBAAVrB,WAAUqB,0BAAAA,UAAUE,kBAAY,QAAtBF,4BAAAA,SAAAA,SAAAA,wBAAwBrB,SACGD,gBAAAA,aAAa;MACtDG;MACAD;MACAD;IACF,CAAA,GAJawB,cAA8BzB,cAAnCG,KAAkBE,eAAiBL,cAAjBK,cAKpBqB,aAAazB,UACf,qBAAA,eAAA,CAAA,GACKC,KAAAA,GAAAA;MACHG;SAEFH;AAGJ,WAAO,qBAACoB,WAAAA,eAAAA;MAAUnB,KAAKsB;OAAiBC,UAAAA,CAAAA;EAC1C,CAAA;AACF;",
|
|
5
|
+
"names": ["React", "composeRefs", "useEvent", "registerFocusable", "useFocusable", "isInput", "props", "ref", "id", "onChangeText", "value", "defaultValue", "inputValue", "useRef", "unregisterFocusable", "inputRef", "useCallback", "input", "current", "focus", "focusAndSelect", "setSelection", "length", "combinedRefs", "useEffect", "focusableInputHOC", "Component", "styleable", "staticConfig", "combinedRef", "finalProps"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { composeRefs } from "@tamagui/compose-refs";
|
|
2
3
|
import { useEvent } from "@tamagui/web";
|
|
3
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
4
4
|
import { registerFocusable } from "./registerFocusable";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function useFocusable({
|
|
@@ -8,7 +8,7 @@ function useFocusable({
|
|
|
8
8
|
props,
|
|
9
9
|
ref
|
|
10
10
|
}) {
|
|
11
|
-
const { id, onChangeText, value, defaultValue } = props, inputValue = useRef(value || defaultValue || ""), unregisterFocusable = useRef(), inputRef = useCallback(
|
|
11
|
+
const { id, onChangeText, value, defaultValue } = props, inputValue = React.useRef(value || defaultValue || ""), unregisterFocusable = React.useRef(), inputRef = React.useCallback(
|
|
12
12
|
(input) => {
|
|
13
13
|
id && input && (unregisterFocusable.current?.(), unregisterFocusable.current = registerFocusable(id, {
|
|
14
14
|
focus: input.focus,
|
|
@@ -22,7 +22,7 @@ function useFocusable({
|
|
|
22
22
|
},
|
|
23
23
|
[isInput, id]
|
|
24
24
|
), combinedRefs = composeRefs(ref, inputRef);
|
|
25
|
-
return useEffect(() => () => {
|
|
25
|
+
return React.useEffect(() => () => {
|
|
26
26
|
unregisterFocusable.current?.();
|
|
27
27
|
}, []), {
|
|
28
28
|
ref: combinedRefs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,gBAAgB;
|
|
4
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,mBAAmB;AAE5B,SAAS,gBAAgB;AAGzB,SAAS,yBAAyB;AAyEvB;AAhEJ,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,GAA8E;AAC5E,QAAM,EAAE,IAAI,cAAc,OAAO,aAAa,IAAI,OAC5C,aAAa,MAAM,OAAO,SAAS,gBAAgB,EAAE,GACrD,sBAAsB,MAAM,OAA+B,GAE3D,WAAW,MAAM;AAAA,IACrB,CAAC,UAAU;AACT,MAAK,MACA,UACL,oBAAoB,UAAU,GAC9B,oBAAoB,UAAU,kBAAkB,IAAI;AAAA,QAClD,OAAO,MAAM;AAAA,QAEb,GAAI,WAAW;AAAA;AAAA,UAEb,iBAAiB;AACf,kBAAM,MAAM,GACR,MAAM,gBAAgB,OAAO,WAAW,WAAY,YACtD,MAAM,aAAa,GAAG,WAAW,QAAQ,MAAM;AAAA,UAEnD;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS,EAAE;AAAA,EACd,GAEM,eAAe,YAAY,KAAK,QAAQ;AAE9C,eAAM,UAAU,MACP,MAAM;AACX,wBAAoB,UAAU;AAAA,EAChC,GACC,CAAC,CAAC,GAEE;AAAA,IACL,KAAK;AAAA,IACL,cAAc,SAAS,CAACA,WAAU;AAChC,iBAAW,UAAUA,QACrB,eAAeA,MAAK;AAAA,IACtB,CAAC;AAAA,EACH;AACF;AAEO,SAAS,kBAA8C,WAAiB;AAC7E,SAAO,UAAU,UAAU,CAAC,OAAuB,QAAQ;AACzD,UAAM,UAAU,UAAU,cAAc,SAClC,EAAE,KAAK,aAAa,aAAa,IAAI,aAAa;AAAA,MACtD;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,GACK,aAAa,UACf;AAAA,MACE,GAAG;AAAA,MACH;AAAA,IACF,IACA;AAGJ,WAAO,oBAAC,aAAU,KAAK,aAAc,GAAG,YAAY;AAAA,EACtD,CAAC;AACH;",
|
|
5
5
|
"names": ["value"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { composeRefs } from "@tamagui/compose-refs";
|
|
2
3
|
import { useEvent } from "@tamagui/web";
|
|
3
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
4
4
|
import { registerFocusable } from "./registerFocusable.mjs";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function useFocusable({
|
|
@@ -14,9 +14,9 @@ function useFocusable({
|
|
|
14
14
|
value,
|
|
15
15
|
defaultValue
|
|
16
16
|
} = props,
|
|
17
|
-
inputValue = useRef(value || defaultValue || ""),
|
|
18
|
-
unregisterFocusable = useRef(),
|
|
19
|
-
inputRef = useCallback(input => {
|
|
17
|
+
inputValue = React.useRef(value || defaultValue || ""),
|
|
18
|
+
unregisterFocusable = React.useRef(),
|
|
19
|
+
inputRef = React.useCallback(input => {
|
|
20
20
|
id && input && (unregisterFocusable.current?.(), unregisterFocusable.current = registerFocusable(id, {
|
|
21
21
|
focus: input.focus,
|
|
22
22
|
...(isInput && {
|
|
@@ -28,7 +28,7 @@ function useFocusable({
|
|
|
28
28
|
}));
|
|
29
29
|
}, [isInput, id]),
|
|
30
30
|
combinedRefs = composeRefs(ref, inputRef);
|
|
31
|
-
return useEffect(() => () => {
|
|
31
|
+
return React.useEffect(() => () => {
|
|
32
32
|
unregisterFocusable.current?.();
|
|
33
33
|
}, []), {
|
|
34
34
|
ref: combinedRefs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","composeRefs","useEvent","registerFocusable","jsx","useFocusable","isInput","props","ref","id","onChangeText","value","defaultValue","inputValue","useRef","unregisterFocusable","inputRef","useCallback","input","current","focus","focusAndSelect","setSelection","length","combinedRefs","useEffect","value2","focusableInputHOC","Component","styleable","staticConfig","combinedRef","finalProps"],"sources":["../../src/focusableInputHOC.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SAASC,WAAA,QAAmB;AAE5B,SAASC,QAAA,QAAgB;AAGzB,SAASC,iBAAA,QAAyB;AAyEvB,SAAAC,GAAA;AAhEJ,SAASC,aAAa;EAC3BC,OAAA;EACAC,KAAA;EAC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QAAEE,GAAA,EAAKuB,WAAA;QAAarB;MAAa,IAAIL,YAAA,CAAa;QACtDG,GAAA;QACAD,KAAA;QACAD;MACF,CAAC;MACK0B,UAAA,GAAa1B,OAAA,GACf;QACE,GAAGC,KAAA;QACHG;MACF,IACAH,KAAA;IAGJ,OAAO,eAAAH,GAAA,CAACwB,SAAA;MAAUpB,GAAA,EAAKuB,WAAA;MAAc,GAAGC;IAAA,CAAY;EACtD,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { composeRefs } from "@tamagui/compose-refs";
|
|
3
4
|
import { useEvent } from "@tamagui/web";
|
|
4
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
5
5
|
import { registerFocusable } from "./registerFocusable";
|
|
6
6
|
function _define_property(obj, key, value) {
|
|
7
7
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
@@ -38,7 +38,7 @@ function _object_spread_props(target, source) {
|
|
|
38
38
|
}), target;
|
|
39
39
|
}
|
|
40
40
|
function useFocusable(param) {
|
|
41
|
-
var isInput = param.isInput, props = param.props, ref = param.ref, id = props.id, onChangeText = props.onChangeText, value = props.value, defaultValue = props.defaultValue, inputValue = useRef(value || defaultValue || ""), unregisterFocusable = useRef(), inputRef = useCallback(function(input) {
|
|
41
|
+
var isInput = param.isInput, props = param.props, ref = param.ref, id = props.id, onChangeText = props.onChangeText, value = props.value, defaultValue = props.defaultValue, inputValue = React.useRef(value || defaultValue || ""), unregisterFocusable = React.useRef(), inputRef = React.useCallback(function(input) {
|
|
42
42
|
var _unregisterFocusable_current;
|
|
43
43
|
id && input && ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = registerFocusable(id, _object_spread({
|
|
44
44
|
focus: input.focus
|
|
@@ -52,7 +52,7 @@ function useFocusable(param) {
|
|
|
52
52
|
isInput,
|
|
53
53
|
id
|
|
54
54
|
]), combinedRefs = composeRefs(ref, inputRef);
|
|
55
|
-
return useEffect(function() {
|
|
55
|
+
return React.useEffect(function() {
|
|
56
56
|
return function() {
|
|
57
57
|
var _unregisterFocusable_current;
|
|
58
58
|
(_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/focusable/src/focusableInputHOC.tsx"],
|
|
4
|
-
"mappings": ";AAAA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";AAAA,OAAOA,WAAW;AAClB,SAASC,mBAAmB;AAE5B,SAASC,gBAAgB;AAGzB,SAASC,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAS3B,SAASC,aAAa,OAI+C;MAH1EC,UAD2B,MAC3BA,SACAC,QAF2B,MAE3BA,OACAC,MAH2B,MAG3BA,KAEQC,KAA0CF,MAA1CE,IAAIC,eAAsCH,MAAtCG,cAAcC,QAAwBJ,MAAxBI,OAAOC,eAAiBL,MAAjBK,cAC3BC,aAAaZ,MAAMa,OAAOH,SAASC,gBAAgB,EAAA,GACnDG,sBAAsBd,MAAMa,OAAM,GAElCE,WAAWf,MAAMgB,YACrB,SAACC,OAAAA;QAGCH;AAFA,IAAKN,MACAS,WACLH,+BAAAA,oBAAoBI,aAAO,QAA3BJ,iCAAAA,UAAAA,6BAAAA,KAAAA,mBAAAA,GACAA,oBAAoBI,UAAUf,kBAAkBK,IAAI,eAAA;MAClDW,OAAOF,MAAME;OAETd,WAAW;;MAEbe,gBAAAA,WAAAA;AACEH,cAAME,MAAK,GACPF,MAAMI,gBAAgB,OAAOT,WAAWM,WAAY,YACtDD,MAAMI,aAAa,GAAGT,WAAWM,QAAQI,MAAM;MAEnD;IACF,CAAA,CAAA;EAEJ,GACA;IAACjB;IAASG;GAAG,GAGTe,eAAetB,YAAYM,KAAKQ,QAAAA;AAEtCf,eAAMwB,UAAU,WAAA;AACd,WAAO,WAAA;UACLV;OAAAA,+BAAAA,oBAAoBI,aAAO,QAA3BJ,iCAAAA,UAAAA,6BAAAA,KAAAA,mBAAAA;IACF;EACF,GAAG,CAAA,CAAE,GAEE;IACLP,KAAKgB;IACLd,cAAcP,SAAS,SAACQ,QAAAA;AACtBE,iBAAWM,UAAUR,QACrBD,gBAAAA,QAAAA,aAAeC,MAAAA;IACjB,CAAA;EACF;AACF;AAEO,SAASe,kBAA8CC,WAAY;AACxE,SAAOA,UAAUC,UAAU,SAACrB,OAAuBC,KAAAA;QACjCmB,yBAAVrB,WAAUqB,0BAAAA,UAAUE,kBAAY,QAAtBF,4BAAAA,SAAAA,SAAAA,wBAAwBrB,SACGD,gBAAAA,aAAa;MACtDG;MACAD;MACAD;IACF,CAAA,GAJawB,cAA8BzB,cAAnCG,KAAkBE,eAAiBL,cAAjBK,cAKpBqB,aAAazB,UACf,qBAAA,eAAA,CAAA,GACKC,KAAAA,GAAAA;MACHG;SAEFH;AAGJ,WAAO,qBAACoB,WAAAA,eAAAA;MAAUnB,KAAKsB;OAAiBC,UAAAA,CAAAA;EAC1C,CAAA;AACF;",
|
|
5
|
+
"names": ["React", "composeRefs", "useEvent", "registerFocusable", "useFocusable", "isInput", "props", "ref", "id", "onChangeText", "value", "defaultValue", "inputValue", "useRef", "unregisterFocusable", "inputRef", "useCallback", "input", "current", "focus", "focusAndSelect", "setSelection", "length", "combinedRefs", "useEffect", "focusableInputHOC", "Component", "styleable", "staticConfig", "combinedRef", "finalProps"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/focusable",
|
|
3
|
-
"version": "1.108.
|
|
3
|
+
"version": "1.108.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tamagui/compose-refs": "1.108.
|
|
35
|
-
"@tamagui/web": "1.108.
|
|
34
|
+
"@tamagui/compose-refs": "1.108.2",
|
|
35
|
+
"@tamagui/web": "1.108.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@tamagui/build": "1.108.
|
|
38
|
+
"@tamagui/build": "1.108.2",
|
|
39
39
|
"react": "^18.2.0 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import { composeRefs } from '@tamagui/compose-refs'
|
|
2
3
|
import type { TamaguiComponent } from '@tamagui/web'
|
|
3
4
|
import { useEvent } from '@tamagui/web'
|
|
4
|
-
import {
|
|
5
|
+
import type { MutableRefObject } from 'react'
|
|
5
6
|
|
|
6
7
|
import { registerFocusable } from './registerFocusable'
|
|
7
8
|
|
|
@@ -16,16 +17,12 @@ export function useFocusable({
|
|
|
16
17
|
isInput,
|
|
17
18
|
props,
|
|
18
19
|
ref,
|
|
19
|
-
}: {
|
|
20
|
-
isInput?: boolean
|
|
21
|
-
props: FocusableProps
|
|
22
|
-
ref?: MutableRefObject<any>
|
|
23
|
-
}) {
|
|
20
|
+
}: { isInput?: boolean; props: FocusableProps; ref?: MutableRefObject<any> }) {
|
|
24
21
|
const { id, onChangeText, value, defaultValue } = props
|
|
25
|
-
const inputValue = useRef(value || defaultValue || '')
|
|
26
|
-
const unregisterFocusable = useRef<() => void | undefined>()
|
|
22
|
+
const inputValue = React.useRef(value || defaultValue || '')
|
|
23
|
+
const unregisterFocusable = React.useRef<() => void | undefined>()
|
|
27
24
|
|
|
28
|
-
const inputRef = useCallback(
|
|
25
|
+
const inputRef = React.useCallback(
|
|
29
26
|
(input) => {
|
|
30
27
|
if (!id) return
|
|
31
28
|
if (!input) return
|
|
@@ -49,7 +46,7 @@ export function useFocusable({
|
|
|
49
46
|
|
|
50
47
|
const combinedRefs = composeRefs(ref, inputRef)
|
|
51
48
|
|
|
52
|
-
useEffect(() => {
|
|
49
|
+
React.useEffect(() => {
|
|
53
50
|
return () => {
|
|
54
51
|
unregisterFocusable.current?.()
|
|
55
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusableInputHOC.d.ts","sourceRoot":"","sources":["../src/focusableInputHOC.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focusableInputHOC.d.ts","sourceRoot":"","sources":["../src/focusableInputHOC.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAI7C,KAAK,cAAc,GAAG;IACpB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,GAAG,GACJ,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,CAAC;IAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAA;CAAE;;;EA0C3E;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,gBAAgB,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAkB7E"}
|