tek-wallet 0.0.181 → 0.0.183

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,47 +36,54 @@ 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 DrawerElement = (0, react_1.useMemo)(function () {
40
- if (isOpen.current === undefined) {
41
- return material_1.SwipeableDrawer;
42
- }
43
- return material_1.Drawer;
44
- }, [isOpen]);
39
+ var lockStatus = function () {
40
+ isOpen.current = isShowDrawerComponent;
41
+ };
42
+ var unlockStatus = function () {
43
+ isOpen.current = undefined;
44
+ };
45
45
  var handleOpen = function () {
46
+ unlockStatus();
46
47
  setIsShowDrawerComponent(true);
48
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
47
49
  };
48
50
  var handleClose = function () {
51
+ unlockStatus();
49
52
  setIsShowDrawerComponent(false);
53
+ onClose === null || onClose === void 0 ? void 0 : onClose();
50
54
  };
51
55
  var toggle = function () {
56
+ unlockStatus();
52
57
  setIsShowDrawerComponent(!isShowDrawerComponent);
53
58
  onToggle === null || onToggle === void 0 ? void 0 : onToggle(!isShowDrawerComponent);
54
59
  };
55
60
  (0, react_1.useImperativeHandle)(ref, function () { return ({
56
61
  open: handleOpen,
57
62
  close: handleClose,
58
- lockStatus: function () {
59
- isOpen.current = isShowDrawerComponent;
60
- },
61
- unlockStatus: function () {
62
- isOpen.current = undefined;
63
- },
63
+ lockStatus: lockStatus,
64
+ unlockStatus: unlockStatus,
64
65
  }); });
65
66
  var onDrawerClose = function (e) {
67
+ if (isOpen.current !== undefined) {
68
+ setIsShowDrawerComponent(isOpen.current);
69
+ }
66
70
  setIsShowDrawerComponent(false);
67
71
  onClose === null || onClose === void 0 ? void 0 : onClose(e);
68
72
  };
69
73
  var onDrawerOpen = function (e) {
74
+ if (isOpen.current !== undefined) {
75
+ setIsShowDrawerComponent(isOpen.current);
76
+ }
70
77
  setIsShowDrawerComponent(true);
71
78
  onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
72
79
  };
73
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(DrawerElement, __assign({}, rest, { sx: {
80
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, __assign({}, rest, { sx: {
74
81
  "& .MuiDrawer-paper": {
75
82
  backgroundColor: "transparent",
76
83
  overflow: "hidden",
77
84
  boxShadow: "none",
78
85
  },
79
- }, 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 }))] }));
80
87
  });
81
88
  DrawerComponent.displayName = "DrawerComponent";
82
89
  exports.default = DrawerComponent;
@@ -30,7 +30,7 @@ var LoadingLayout = (0, react_1.forwardRef)(function (props, ref) {
30
30
  setLoading(false);
31
31
  },
32
32
  }); });
33
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({ position: "absolute", inset: 0 }, theme.mixins.whiteLoadingOverlay), { zIndex: 1000 }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.center), children: loadingMessage }) }))] }));
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({ position: "absolute", inset: 0 }, theme.mixins.whiteLoadingOverlay), { zIndex: 1000, pointerEvents: "none" }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.center), children: loadingMessage }) }))] }));
34
34
  });
35
35
  LoadingLayout.displayName = "LoadingLayout";
36
36
  exports.default = LoadingLayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.181",
3
+ "version": "0.0.183",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",