tek-wallet 0.0.180 → 0.0.182
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.
|
@@ -103,8 +103,10 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
103
103
|
setOtp("");
|
|
104
104
|
};
|
|
105
105
|
var handleClose = function () {
|
|
106
|
-
var _a;
|
|
106
|
+
var _a, _b;
|
|
107
107
|
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
108
|
+
handleCleardata();
|
|
109
|
+
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
108
110
|
};
|
|
109
111
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
110
112
|
clearData: handleCleardata,
|
|
@@ -36,33 +36,44 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
36
36
|
var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children, rest = __rest(props, ["onOpen", "onClose", "onToggle", "sx", "trigger", "direction", "children"]);
|
|
37
37
|
var _b = (0, react_1.useState)(false), isShowDrawerComponent = _b[0], setIsShowDrawerComponent = _b[1];
|
|
38
38
|
var isOpen = (0, react_1.useRef)(undefined);
|
|
39
|
+
var lockStatus = function () {
|
|
40
|
+
isOpen.current = isShowDrawerComponent;
|
|
41
|
+
};
|
|
42
|
+
var unlockStatus = function () {
|
|
43
|
+
isOpen.current = undefined;
|
|
44
|
+
};
|
|
39
45
|
var handleOpen = function () {
|
|
46
|
+
unlockStatus();
|
|
40
47
|
setIsShowDrawerComponent(true);
|
|
48
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
41
49
|
};
|
|
42
50
|
var handleClose = function () {
|
|
51
|
+
unlockStatus();
|
|
43
52
|
setIsShowDrawerComponent(false);
|
|
53
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
44
54
|
};
|
|
45
55
|
var toggle = function () {
|
|
56
|
+
unlockStatus();
|
|
46
57
|
setIsShowDrawerComponent(!isShowDrawerComponent);
|
|
47
58
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!isShowDrawerComponent);
|
|
48
59
|
};
|
|
49
60
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
50
61
|
open: handleOpen,
|
|
51
62
|
close: handleClose,
|
|
52
|
-
lockStatus:
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
unlockStatus: function () {
|
|
56
|
-
isOpen.current = undefined;
|
|
57
|
-
},
|
|
63
|
+
lockStatus: lockStatus,
|
|
64
|
+
unlockStatus: unlockStatus,
|
|
58
65
|
}); });
|
|
59
66
|
var onDrawerClose = function (e) {
|
|
60
|
-
|
|
67
|
+
if (isOpen.current !== undefined) {
|
|
68
|
+
setIsShowDrawerComponent(isOpen.current);
|
|
69
|
+
}
|
|
61
70
|
setIsShowDrawerComponent(false);
|
|
62
71
|
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
63
72
|
};
|
|
64
73
|
var onDrawerOpen = function (e) {
|
|
65
|
-
|
|
74
|
+
if (isOpen.current !== undefined) {
|
|
75
|
+
setIsShowDrawerComponent(isOpen.current);
|
|
76
|
+
}
|
|
66
77
|
setIsShowDrawerComponent(true);
|
|
67
78
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
|
|
68
79
|
};
|
|
@@ -72,7 +83,7 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
72
83
|
overflow: "hidden",
|
|
73
84
|
boxShadow: "none",
|
|
74
85
|
},
|
|
75
|
-
}, anchor: direction || "bottom", open: (_a = isOpen.current) !== null && _a !== void 0 ? _a : isShowDrawerComponent, onOpen: onDrawerOpen, onClose: onDrawerClose, children: children }))] }));
|
|
86
|
+
}, anchor: direction || "bottom", open: (_a = isOpen.current) !== null && _a !== void 0 ? _a : isShowDrawerComponent, onOpen: onDrawerOpen, onClose: onDrawerClose, disableSwipeToOpen: isOpen.current !== undefined, disableDiscovery: isOpen.current !== undefined, children: children }))] }));
|
|
76
87
|
});
|
|
77
88
|
DrawerComponent.displayName = "DrawerComponent";
|
|
78
89
|
exports.default = DrawerComponent;
|