react-dialogger 1.1.21 → 1.1.23

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.
Files changed (54) hide show
  1. package/components/CircularProgress.d.ts +1 -2
  2. package/components/CircularProgress.js +5 -8
  3. package/components/DialogActionBase.d.ts +1 -2
  4. package/components/DialogActionBase.js +10 -11
  5. package/components/DialogBase.d.ts +4 -4
  6. package/components/DialogBase.js +115 -105
  7. package/components/Futures/DialogCloseAction.d.ts +1 -2
  8. package/components/Futures/DialogCloseAction.js +4 -28
  9. package/components/Futures/DialogFullscreenAction.d.ts +1 -2
  10. package/components/Futures/DialogFullscreenAction.js +13 -36
  11. package/components/Futures/DialogHeaderActionsWrapper.d.ts +1 -1
  12. package/components/Futures/DialogHeaderActionsWrapper.js +2 -5
  13. package/components/Futures/DialogInfoAction.d.ts +1 -2
  14. package/components/Futures/DialogInfoAction.js +4 -15
  15. package/components/Futures/DialogProcessing.d.ts +1 -2
  16. package/components/Futures/DialogProcessing.js +2 -25
  17. package/components/RippleButton.js +3 -4
  18. package/components/dialogBoundsMemoize.d.ts +20 -0
  19. package/components/dialogBoundsMemoize.js +117 -0
  20. package/components/icons/CloseIcon.d.ts +1 -2
  21. package/components/icons/CloseIcon.js +2 -7
  22. package/components/icons/FullscreenExitIcon.d.ts +1 -2
  23. package/components/icons/FullscreenExitIcon.js +2 -7
  24. package/components/icons/FullscreenIcon.d.ts +1 -2
  25. package/components/icons/FullscreenIcon.js +2 -7
  26. package/components/icons/InfoIcon.d.ts +1 -2
  27. package/components/icons/InfoIcon.js +2 -7
  28. package/components/icons/ResizeIcon.d.ts +1 -2
  29. package/components/icons/ResizeIcon.js +3 -8
  30. package/helpers/BoundTypes.d.ts +11 -0
  31. package/helpers/BoundTypes.js +2 -0
  32. package/helpers/dialogBoundsMemoize.d.ts +5 -0
  33. package/helpers/dialogBoundsMemoize.js +117 -0
  34. package/helpers/index.d.ts +2 -0
  35. package/helpers/index.js +22 -0
  36. package/helpers/initDialogMemoizeBounds.d.ts +5 -0
  37. package/helpers/initDialogMemoizeBounds.js +40 -0
  38. package/hooks/initDialogMemoizeBounds.d.ts +4 -0
  39. package/hooks/initDialogMemoizeBounds.js +39 -0
  40. package/hooks/useDialogMemoizeBounds.d.ts +1 -0
  41. package/hooks/useDialogMemoizeBounds.js +37 -0
  42. package/index.d.ts +1 -0
  43. package/index.js +3 -1
  44. package/models/DialogAction.d.ts +1 -2
  45. package/models/DialogAction.js +2 -25
  46. package/models/Resizeable.d.ts +3 -1
  47. package/models/Resizeable.js +15 -9
  48. package/package.json +2 -2
  49. package/types/DialogTypes.d.ts +5 -0
  50. package/components/Dependencies/Body.d.ts +0 -8
  51. package/components/Dependencies/Body.js +0 -40
  52. package/components/Dependencies/DialogBody.d.ts +0 -8
  53. package/components/Dependencies/DialogBody.js +0 -40
  54. package/types/FormikProps.d.ts +0 -302
@@ -1,33 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
6
  exports.DialogFullscreenAction = void 0;
30
- var React = __importStar(require("react"));
7
+ var jsx_runtime_1 = require("react/jsx-runtime");
31
8
  var FullscreenExitIcon_1 = __importDefault(require("../icons/FullscreenExitIcon"));
32
9
  var FullscreenIcon_1 = __importDefault(require("../icons/FullscreenIcon"));
33
10
  var react_1 = require("react");
@@ -37,24 +14,24 @@ var DialogFullscreenAction = function () {
37
14
  var _a, _b, _c, _d, _e, _f, _g, _h;
38
15
  var dialogHeaderContext = (0, react_1.useContext)(DialogBase_1.DialogHeaderFooterContext);
39
16
  var _dialog = dialogHeaderContext.dialog;
40
- return React.createElement("div", { className: 'fullscreen-icon-wrapper', onClick: function (event) {
17
+ return (0, jsx_runtime_1.jsx)("div", { className: 'fullscreen-icon-wrapper', onClick: function (event) {
41
18
  event.stopPropagation();
42
19
  _dialog.switchFullScreen();
43
- } }, _dialog.state.fullscreenMode ?
44
- React.createElement(FullscreenExitIcon_1.default
45
- // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
46
- // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
47
- , {
48
- // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
49
- // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
50
- size: (_b = (_a = _dialog.dialogOptions.base.headerControllerIcons) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 24, color: (_d = (_c = _dialog.dialogOptions.base.headerControllerIcons) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : null })
51
- :
52
- React.createElement(FullscreenIcon_1.default
20
+ }, children: _dialog.state.fullscreenMode ?
21
+ (0, jsx_runtime_1.jsx)(FullscreenExitIcon_1.default
53
22
  // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
54
23
  // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
55
24
  , {
56
25
  // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
57
26
  // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
58
- size: (_f = (_e = _dialog.dialogOptions.base.headerControllerIcons) === null || _e === void 0 ? void 0 : _e.size) !== null && _f !== void 0 ? _f : 24, color: (_h = (_g = _dialog.dialogOptions.base.headerControllerIcons) === null || _g === void 0 ? void 0 : _g.color) !== null && _h !== void 0 ? _h : null }));
27
+ size: (_b = (_a = _dialog.dialogOptions.base.headerControllerIcons) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 24, color: (_d = (_c = _dialog.dialogOptions.base.headerControllerIcons) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : null })
28
+ :
29
+ (0, jsx_runtime_1.jsx)(FullscreenIcon_1.default
30
+ // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
31
+ // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
32
+ , {
33
+ // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
34
+ // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
35
+ size: (_f = (_e = _dialog.dialogOptions.base.headerControllerIcons) === null || _e === void 0 ? void 0 : _e.size) !== null && _f !== void 0 ? _f : 24, color: (_h = (_g = _dialog.dialogOptions.base.headerControllerIcons) === null || _g === void 0 ? void 0 : _g.color) !== null && _h !== void 0 ? _h : null }) });
59
36
  };
60
37
  exports.DialogFullscreenAction = DialogFullscreenAction;
@@ -3,5 +3,5 @@ interface IProps {
3
3
  gap?: number;
4
4
  children?: React.ReactNode;
5
5
  }
6
- declare const DialogHeaderActionsWrapper: (props: IProps) => React.JSX.Element;
6
+ declare const DialogHeaderActionsWrapper: (props: IProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export { DialogHeaderActionsWrapper };
@@ -10,14 +10,11 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
14
  exports.DialogHeaderActionsWrapper = void 0;
18
- var react_1 = __importDefault(require("react"));
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
19
16
  var DialogHeaderActionsWrapper = function (props) {
20
17
  var _a;
21
- return (react_1.default.createElement("div", __assign({}, props, { className: 'header-actions-wrapper', style: { columnGap: "".concat((_a = props.gap) !== null && _a !== void 0 ? _a : 10, "px") } }), props.children));
18
+ return ((0, jsx_runtime_1.jsx)("div", __assign({}, props, { className: 'header-actions-wrapper', style: { columnGap: "".concat((_a = props.gap) !== null && _a !== void 0 ? _a : 10, "px") }, children: props.children })));
22
19
  };
23
20
  exports.DialogHeaderActionsWrapper = DialogHeaderActionsWrapper;
@@ -1,3 +1,2 @@
1
- import * as React from "react";
2
- declare const DialogInfoAction: () => React.JSX.Element;
1
+ declare const DialogInfoAction: () => import("react/jsx-runtime").JSX.Element;
3
2
  export { DialogInfoAction };
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.DialogInfoAction = void 0;
30
- var React = __importStar(require("react"));
30
+ var jsx_runtime_1 = require("react/jsx-runtime");
31
31
  var react_1 = require("react");
32
32
  var DialogBase_1 = require("../DialogBase");
33
33
  var InfoIcon_1 = __importDefault(require("../icons/InfoIcon"));
@@ -39,7 +39,7 @@ var DialogInfoAction = function () {
39
39
  var _a, _b, _c, _d;
40
40
  var dialogHeaderContext = (0, react_1.useContext)(DialogBase_1.DialogHeaderFooterContext);
41
41
  var _dialog = dialogHeaderContext.dialog;
42
- return React.createElement("div", { className: 'info-icon-wrapper', onClick: function (event) {
42
+ return (0, jsx_runtime_1.jsx)("div", { className: 'info-icon-wrapper', onClick: function (event) {
43
43
  var closeAction = new __1.DialogAction('closeAction', {
44
44
  label: 'Close',
45
45
  variant: 'text',
@@ -72,23 +72,12 @@ var DialogInfoAction = function () {
72
72
  });
73
73
  dialog
74
74
  .setHeader(function (dialog1) { return 'Info'; })
75
- .setBody(function (dialog1) { return React.createElement("table", null,
76
- React.createElement("tbody", null,
77
- React.createElement("tr", null,
78
- React.createElement("td", null, "Name"),
79
- React.createElement("td", null, package_json_1.default.name)),
80
- React.createElement("tr", null,
81
- React.createElement("td", null, "Varsion"),
82
- React.createElement("td", null, package_json_1.default.version)),
83
- React.createElement("tr", null,
84
- React.createElement("td", null, "Author"),
85
- React.createElement("td", null, package_json_1.default.author)))); })
75
+ .setBody(function (dialog1) { return (0, jsx_runtime_1.jsx)("table", { children: (0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: "Name" }), (0, jsx_runtime_1.jsx)("td", { children: package_json_1.default.name })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: "Varsion" }), (0, jsx_runtime_1.jsx)("td", { children: package_json_1.default.version })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: "Author" }), (0, jsx_runtime_1.jsx)("td", { children: package_json_1.default.author })] })] }) }); })
86
76
  .addActions([
87
77
  closeAction
88
78
  ])
89
79
  .initialState({})
90
80
  .show();
91
- } },
92
- React.createElement(InfoIcon_1.default, { size: (_b = (_a = _dialog.dialogOptions.base.headerControllerIcons) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 24, color: (_d = (_c = _dialog.dialogOptions.base.headerControllerIcons) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : null }));
81
+ }, children: (0, jsx_runtime_1.jsx)(InfoIcon_1.default, { size: (_b = (_a = _dialog.dialogOptions.base.headerControllerIcons) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 24, color: (_d = (_c = _dialog.dialogOptions.base.headerControllerIcons) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : null }) });
93
82
  };
94
83
  exports.DialogInfoAction = DialogInfoAction;
@@ -1,3 +1,2 @@
1
- import * as React from "react";
2
- declare const DialogProcessing: () => React.JSX.Element;
1
+ declare const DialogProcessing: () => import("react/jsx-runtime").JSX.Element;
3
2
  export { DialogProcessing };
@@ -1,34 +1,11 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
6
  exports.DialogProcessing = void 0;
7
+ var jsx_runtime_1 = require("react/jsx-runtime");
30
8
  var CircularProgress_1 = __importDefault(require("../CircularProgress"));
31
- var React = __importStar(require("react"));
32
9
  var react_1 = require("react");
33
10
  var DialogBase_1 = require("../DialogBase");
34
11
  var DialogProcessing = function () {
@@ -36,6 +13,6 @@ var DialogProcessing = function () {
36
13
  var dialogHeaderContext = (0, react_1.useContext)(DialogBase_1.DialogHeaderFooterContext);
37
14
  var _dialog = dialogHeaderContext.dialog;
38
15
  console.log('_dialog_isInProcess', _dialog.isInProcess());
39
- return React.createElement(CircularProgress_1.default, { size: (_a = _dialog.dialogOptions.progress.size) !== null && _a !== void 0 ? _a : 20, inProcess: _dialog.isInProcess(), color: (_c = (_b = _dialog.dialogOptions.progress) === null || _b === void 0 ? void 0 : _b.color) !== null && _c !== void 0 ? _c : '#399aec' });
16
+ return (0, jsx_runtime_1.jsx)(CircularProgress_1.default, { size: (_a = _dialog.dialogOptions.progress.size) !== null && _a !== void 0 ? _a : 20, inProcess: _dialog.isInProcess(), color: (_c = (_b = _dialog.dialogOptions.progress) === null || _b === void 0 ? void 0 : _b.color) !== null && _c !== void 0 ? _c : '#399aec' });
40
17
  };
41
18
  exports.DialogProcessing = DialogProcessing;
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
34
34
  return result;
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
+ var jsx_runtime_1 = require("react/jsx-runtime");
37
38
  var React = __importStar(require("react"));
38
39
  var react_1 = require("react");
39
40
  exports.default = React.forwardRef(function (_a, ref) {
@@ -66,7 +67,7 @@ exports.default = React.forwardRef(function (_a, ref) {
66
67
  rippleEffect: rippleEffect
67
68
  }); });
68
69
  console.log('Ripple_button_style', style);
69
- return (React.createElement("button", {
70
+ return ((0, jsx_runtime_1.jsxs)("button", {
70
71
  // ref={buttonRef}
71
72
  ref: ref, disabled: disabled, className: "ripple-button ripple-button-".concat(variant, " ripple-button-").concat(color, " ").concat(disabled ? 'ripple-button-disabled' : ''), onClick: function (e) {
72
73
  //@ts-ignore
@@ -75,7 +76,5 @@ exports.default = React.forwardRef(function (_a, ref) {
75
76
  setTimeout(function () {
76
77
  onClick && onClick(e);
77
78
  }, 200);
78
- }, style: __assign(__assign(__assign({}, baseStyle), style), { fontFamily: fontFamily }) },
79
- isRippling && React.createElement("span", { className: "ripple", style: { left: coords.x, top: coords.y } }),
80
- React.createElement("span", { className: "content" }, children(ref.current))));
79
+ }, style: __assign(__assign(__assign({}, baseStyle), style), { fontFamily: fontFamily }), children: [isRippling && (0, jsx_runtime_1.jsx)("span", { className: "ripple", style: { left: coords.x, top: coords.y } }), (0, jsx_runtime_1.jsx)("span", { className: "content", children: children(ref.current) })] }));
81
80
  });
@@ -0,0 +1,20 @@
1
+ import { IBaseDialogOptions } from "../types/DialogTypes";
2
+ /**
3
+ * RAM den okuyoruz...
4
+ * */
5
+ declare const dialogInStore: (options: IBaseDialogOptions) => IDialogBoundDef | undefined;
6
+ declare const dialogRegister: (options: IBaseDialogOptions, initialBounds: IDialogBoundsDef) => IDialogBoundsDef;
7
+ declare const getDialogBounds: (options: IBaseDialogOptions) => IDialogBoundsDef | undefined;
8
+ declare const setDialogBounds: (dialogId: string, bounds: IDialogBoundsDef, dialogRef: React.RefObject<any>) => void;
9
+ export { dialogRegister, getDialogBounds, setDialogBounds, dialogInStore };
10
+ export type IDialogBoundsMemoKey = string | number;
11
+ export interface IDialogBoundsDef {
12
+ width: number;
13
+ height: number;
14
+ x: number;
15
+ y: number;
16
+ }
17
+ export interface IDialogBoundDef {
18
+ id: string;
19
+ bounds: IDialogBoundsDef;
20
+ }
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dialogInStore = exports.setDialogBounds = exports.getDialogBounds = exports.dialogRegister = void 0;
4
+ var initDialogMemoizeBounds_1 = require("../hooks/initDialogMemoizeBounds");
5
+ var BOUNDS_STORE_KEY = 'react-super-dialog';
6
+ // const boundStoreExists = () => {
7
+ // try{
8
+ // return !!window.localStorage.getItem(BOUNDS_STORE_KEY);
9
+ // } catch (e){
10
+ // return false;
11
+ // }
12
+ // }
13
+ // const createBoundStore = () => {
14
+ // if (!boundStoreExists()) {
15
+ // try{
16
+ // window.localStorage.setItem(BOUNDS_STORE_KEY, JSON.stringify([]));
17
+ // } catch (e){
18
+ // console.log(e);
19
+ // }
20
+ // }
21
+ // }
22
+ /**
23
+ * RAM den okuyoruz...
24
+ * */
25
+ var dialogInStore = function (options) {
26
+ var stores = initDialogMemoizeBounds_1.registeredDialogs;
27
+ console.log('dialogInStoreX1', stores);
28
+ if (!stores)
29
+ return undefined;
30
+ var parsedStores = stores; // JSON.parse(stores);
31
+ var foundedStore = parsedStores.find(function (store) { return store.id === options.id; });
32
+ return foundedStore;
33
+ };
34
+ exports.dialogInStore = dialogInStore;
35
+ var dialogRegister = function (options, initialBounds) {
36
+ console.log('Regsister fired!!!', options);
37
+ if (dialogInStore(options))
38
+ return;
39
+ if (!options.id) {
40
+ throw new Error('Dialog bounds can not be memoized. Dialog id is required.');
41
+ }
42
+ // createBoundStore();
43
+ var newBounds = {
44
+ id: options.id,
45
+ bounds: {
46
+ width: initialBounds.width,
47
+ height: initialBounds.height,
48
+ x: initialBounds.x,
49
+ y: initialBounds.y + 100
50
+ }
51
+ };
52
+ var foundedDialog = initDialogMemoizeBounds_1.registeredDialogs.find(function (b) { return b.id === options.id; });
53
+ console.log('foundedDialog', foundedDialog);
54
+ if (!foundedDialog) {
55
+ initDialogMemoizeBounds_1.registeredDialogs.push(newBounds);
56
+ }
57
+ console.log('foundedDialog_2', initDialogMemoizeBounds_1.registeredDialogs);
58
+ // Register to Cookie
59
+ try {
60
+ window.localStorage.setItem(BOUNDS_STORE_KEY, JSON.stringify(initDialogMemoizeBounds_1.registeredDialogs));
61
+ }
62
+ catch (e) {
63
+ console.log(e);
64
+ }
65
+ // registeredDialogs.push(newBounds);
66
+ console.log('Dialog_Bounds, initialBounds-A', initialBounds);
67
+ var bounds = getDialogBounds(options);
68
+ return bounds;
69
+ };
70
+ exports.dialogRegister = dialogRegister;
71
+ var getDialogBounds = function (options) {
72
+ var dialog = dialogInStore(options);
73
+ if (!options.id) {
74
+ throw new Error('Dialog bounds can not be memoized. Dialog id is required.');
75
+ }
76
+ // Eget local vaiable icinde bulunamassa localStorage'dan al
77
+ if (!dialog) {
78
+ var boundsRaw = window.localStorage.getItem(BOUNDS_STORE_KEY);
79
+ var boundsArray = boundsRaw ? JSON.parse(boundsRaw) : [];
80
+ var founded = boundsArray.find(function (b) { return b.id === options.id; });
81
+ if (founded) {
82
+ return {
83
+ width: founded.bounds.width,
84
+ height: founded.bounds.height,
85
+ x: founded.bounds.x,
86
+ y: founded.bounds.y
87
+ };
88
+ }
89
+ }
90
+ if (dialog) {
91
+ return {
92
+ width: dialog.bounds.width,
93
+ height: dialog.bounds.height,
94
+ x: dialog.bounds.x,
95
+ y: dialog.bounds.y
96
+ };
97
+ }
98
+ return undefined;
99
+ };
100
+ exports.getDialogBounds = getDialogBounds;
101
+ var setDialogBounds = function (dialogId, bounds, dialogRef) {
102
+ var newBounds = {
103
+ id: dialogId,
104
+ bounds: bounds
105
+ };
106
+ var founded = initDialogMemoizeBounds_1.registeredDialogs.find(function (b) { return b.id === dialogId; });
107
+ if (founded) {
108
+ founded.bounds = bounds;
109
+ try {
110
+ window.localStorage.setItem(BOUNDS_STORE_KEY, JSON.stringify(initDialogMemoizeBounds_1.registeredDialogs));
111
+ }
112
+ catch (e) {
113
+ console.log(e);
114
+ }
115
+ }
116
+ };
117
+ exports.setDialogBounds = setDialogBounds;
@@ -1,6 +1,5 @@
1
- import React from "react";
2
1
  declare const _default: ({ size, color }: {
3
2
  size?: number;
4
3
  color?: string;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default _default;
@@ -10,14 +10,9 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
15
  exports.default = (function (_a) {
19
16
  var size = _a.size, color = _a.color;
20
- return react_1.default.createElement("div", { className: 'close-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null) },
21
- react_1.default.createElement("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "CloseIcon" },
22
- react_1.default.createElement("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })));
17
+ return (0, jsx_runtime_1.jsx)("div", { className: 'close-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null), children: (0, jsx_runtime_1.jsx)("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "CloseIcon", children: (0, jsx_runtime_1.jsx)("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) }) });
23
18
  });
@@ -1,6 +1,5 @@
1
- import React from "react";
2
1
  declare const _default: ({ size, color }: {
3
2
  size?: number;
4
3
  color?: string;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default _default;
@@ -10,14 +10,9 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
15
  exports.default = (function (_a) {
19
16
  var size = _a.size, color = _a.color;
20
- return react_1.default.createElement("div", { className: 'fullscreen-exit-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null) },
21
- react_1.default.createElement("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "FullscreenExitIcon" },
22
- react_1.default.createElement("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" })));
17
+ return (0, jsx_runtime_1.jsx)("div", { className: 'fullscreen-exit-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null), children: (0, jsx_runtime_1.jsx)("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "FullscreenExitIcon", children: (0, jsx_runtime_1.jsx)("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" }) }) });
23
18
  });
@@ -1,6 +1,5 @@
1
- import React from "react";
2
1
  declare const _default: ({ size, color }: {
3
2
  size?: number;
4
3
  color?: string;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default _default;
@@ -10,14 +10,9 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
15
  exports.default = (function (_a) {
19
16
  var size = _a.size, color = _a.color;
20
- return react_1.default.createElement("div", { className: 'fullscreen-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null) },
21
- react_1.default.createElement("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "FullscreenIcon", color: color },
22
- react_1.default.createElement("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" })));
17
+ return (0, jsx_runtime_1.jsx)("div", { className: 'fullscreen-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null), children: (0, jsx_runtime_1.jsx)("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "FullscreenIcon", color: color, children: (0, jsx_runtime_1.jsx)("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" }) }) });
23
18
  });
@@ -1,6 +1,5 @@
1
- import React from "react";
2
1
  declare const _default: ({ size, color }: {
3
2
  size?: number;
4
3
  color?: string;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default _default;
@@ -10,14 +10,9 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
15
  exports.default = (function (_a) {
19
16
  var size = _a.size, color = _a.color;
20
- return react_1.default.createElement("div", { className: 'info-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null) },
21
- react_1.default.createElement("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "InfoIcon" },
22
- react_1.default.createElement("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z" })));
17
+ return (0, jsx_runtime_1.jsx)("div", { className: 'info-icon icon-base', style: __assign({ fill: color }, size ? { width: size } : null), children: (0, jsx_runtime_1.jsx)("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "InfoIcon", children: (0, jsx_runtime_1.jsx)("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z" }) }) });
23
18
  });
@@ -1,6 +1,5 @@
1
- import React from "react";
2
1
  declare const _default: ({ size, color }: {
3
2
  size?: number;
4
3
  color?: string;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default _default;
@@ -1,14 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
3
+ var jsx_runtime_1 = require("react/jsx-runtime");
7
4
  exports.default = (function (_a) {
8
5
  var size = _a.size, color = _a.color;
9
- return react_1.default.createElement("div", { className: 'resizable-handle-icon icon-base', style: {
6
+ return (0, jsx_runtime_1.jsx)("div", { className: 'resizable-handle-icon icon-base', style: {
10
7
  fill: color
11
- } },
12
- react_1.default.createElement("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "ArrowBackIosNewIcon" },
13
- react_1.default.createElement("path", { d: "M17.77 3.77 16 2 6 12l10 10 1.77-1.77L9.54 12z" })));
8
+ }, children: (0, jsx_runtime_1.jsx)("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "ArrowBackIosNewIcon", children: (0, jsx_runtime_1.jsx)("path", { d: "M17.77 3.77 16 2 6 12l10 10 1.77-1.77L9.54 12z" }) }) });
14
9
  });
@@ -0,0 +1,11 @@
1
+ export type IDialogBoundsMemoKey = string;
2
+ export interface IDialogBoundsDef {
3
+ width: number;
4
+ height: number;
5
+ x: number;
6
+ y: number;
7
+ }
8
+ export interface IDialogBoundDef {
9
+ id: string;
10
+ bounds: IDialogBoundsDef;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { IDialogBoundsDef } from "./BoundTypes";
2
+ import { IBaseDialogOptions } from "../types/DialogTypes";
3
+ export declare const dialogRegister: (options: IBaseDialogOptions, initialBounds: IDialogBoundsDef) => IDialogBoundsDef;
4
+ export declare const getDialogBounds: (options: IBaseDialogOptions) => IDialogBoundsDef | undefined;
5
+ export declare const setDialogBounds: (dialogId: string, bounds: IDialogBoundsDef, dialogRef: React.RefObject<any>) => void;