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.
- package/components/CircularProgress.d.ts +1 -2
- package/components/CircularProgress.js +5 -8
- package/components/DialogActionBase.d.ts +1 -2
- package/components/DialogActionBase.js +10 -11
- package/components/DialogBase.d.ts +4 -4
- package/components/DialogBase.js +115 -105
- package/components/Futures/DialogCloseAction.d.ts +1 -2
- package/components/Futures/DialogCloseAction.js +4 -28
- package/components/Futures/DialogFullscreenAction.d.ts +1 -2
- package/components/Futures/DialogFullscreenAction.js +13 -36
- package/components/Futures/DialogHeaderActionsWrapper.d.ts +1 -1
- package/components/Futures/DialogHeaderActionsWrapper.js +2 -5
- package/components/Futures/DialogInfoAction.d.ts +1 -2
- package/components/Futures/DialogInfoAction.js +4 -15
- package/components/Futures/DialogProcessing.d.ts +1 -2
- package/components/Futures/DialogProcessing.js +2 -25
- package/components/RippleButton.js +3 -4
- package/components/dialogBoundsMemoize.d.ts +20 -0
- package/components/dialogBoundsMemoize.js +117 -0
- package/components/icons/CloseIcon.d.ts +1 -2
- package/components/icons/CloseIcon.js +2 -7
- package/components/icons/FullscreenExitIcon.d.ts +1 -2
- package/components/icons/FullscreenExitIcon.js +2 -7
- package/components/icons/FullscreenIcon.d.ts +1 -2
- package/components/icons/FullscreenIcon.js +2 -7
- package/components/icons/InfoIcon.d.ts +1 -2
- package/components/icons/InfoIcon.js +2 -7
- package/components/icons/ResizeIcon.d.ts +1 -2
- package/components/icons/ResizeIcon.js +3 -8
- package/helpers/BoundTypes.d.ts +11 -0
- package/helpers/BoundTypes.js +2 -0
- package/helpers/dialogBoundsMemoize.d.ts +5 -0
- package/helpers/dialogBoundsMemoize.js +117 -0
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +22 -0
- package/helpers/initDialogMemoizeBounds.d.ts +5 -0
- package/helpers/initDialogMemoizeBounds.js +40 -0
- package/hooks/initDialogMemoizeBounds.d.ts +4 -0
- package/hooks/initDialogMemoizeBounds.js +39 -0
- package/hooks/useDialogMemoizeBounds.d.ts +1 -0
- package/hooks/useDialogMemoizeBounds.js +37 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/models/DialogAction.d.ts +1 -2
- package/models/DialogAction.js +2 -25
- package/models/Resizeable.d.ts +3 -1
- package/models/Resizeable.js +15 -9
- package/package.json +2 -2
- package/types/DialogTypes.d.ts +5 -0
- package/components/Dependencies/Body.d.ts +0 -8
- package/components/Dependencies/Body.js +0 -40
- package/components/Dependencies/DialogBody.d.ts +0 -8
- package/components/Dependencies/DialogBody.js +0 -40
- package/types/FormikProps.d.ts +0 -302
@@ -1,8 +1,7 @@
|
|
1
|
-
import * as React from "react";
|
2
1
|
import { IInProcess } from "../types/types";
|
3
2
|
declare const _default: ({ size, color, inProcess }: {
|
4
3
|
color?: string;
|
5
4
|
inProcess: IInProcess;
|
6
5
|
size: number;
|
7
|
-
}) =>
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
8
7
|
export default _default;
|
@@ -34,17 +34,14 @@ 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
|
exports.default = (function (_a) {
|
39
40
|
var size = _a.size, color = _a.color, inProcess = _a.inProcess;
|
40
41
|
if (inProcess === null || inProcess === void 0 ? void 0 : inProcess.inProcess) {
|
41
|
-
return
|
42
|
-
|
43
|
-
|
44
|
-
React.createElement("circle", { className: "circular-circle", cx: "44", cy: "44", r: "20.2", fill: "none", strokeWidth: "3.6" }))),
|
45
|
-
inProcess.message
|
46
|
-
&&
|
47
|
-
React.createElement("span", { style: { fontStyle: 'normal', fontSize: 12 } }, inProcess.message));
|
42
|
+
return (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'row', columnGap: 10, alignItems: 'center' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "circular-root", style: __assign({ display: 'flex', flex: 1, width: size, height: size }, color ? { color: color } : {}), role: "progressbar", children: (0, jsx_runtime_1.jsx)("svg", { className: "circular", viewBox: "22 22 44 44", children: (0, jsx_runtime_1.jsx)("circle", { className: "circular-circle", cx: "44", cy: "44", r: "20.2", fill: "none", strokeWidth: "3.6" }) }) }), inProcess.message
|
43
|
+
&&
|
44
|
+
(0, jsx_runtime_1.jsx)("span", { style: { fontStyle: 'normal', fontSize: 12 }, children: inProcess.message })] });
|
48
45
|
}
|
49
|
-
return
|
46
|
+
return (0, jsx_runtime_1.jsx)(React.Fragment, {});
|
50
47
|
});
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { Component } from "react";
|
2
|
-
import * as React from "react";
|
3
2
|
import DialogBase from "./DialogBase";
|
4
3
|
import { ActionProps, ActionState, DialogActionType, TBVariant, TBColor, DialogActionOptionsType, TDialogStateListenerForActionCallbackType } from "../types/DialogActionTypes";
|
5
4
|
declare class DialogActionBase extends Component<ActionProps, ActionState> {
|
@@ -39,6 +38,6 @@ declare class DialogActionBase extends Component<ActionProps, ActionState> {
|
|
39
38
|
remove: () => void;
|
40
39
|
click: () => void;
|
41
40
|
onClickHandler: () => DialogActionType;
|
42
|
-
render: () =>
|
41
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
43
42
|
}
|
44
43
|
export default DialogActionBase;
|
@@ -52,6 +52,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
52
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
53
53
|
};
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
55
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
55
56
|
var react_1 = require("react");
|
56
57
|
var React = __importStar(require("react"));
|
57
58
|
var RippleButton_1 = __importDefault(require("./RippleButton"));
|
@@ -133,22 +134,20 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
133
134
|
};
|
134
135
|
_this.render = function () {
|
135
136
|
console.log('this._options.style.render', _this._options);
|
136
|
-
return
|
137
|
+
return (0, jsx_runtime_1.jsx)(RippleButton_1.default, { ref: _this._buttonRef, innerRef: _this._rippleButtonRef, variant: _this._options.variant, color: _this._options.color, disabled: _this._options.disabled, onClick: function (e) {
|
137
138
|
if (_this._options.disabled || _this.isInProcess())
|
138
139
|
return;
|
139
140
|
// @ts-ignore
|
140
141
|
_this._onClick(_this, _this._dialogBaseComponent);
|
141
|
-
}, style: _this._options.style, baseStyle: _this.props.baseStyle, fontFamily: _this.props.fontFamily
|
142
|
-
|
143
|
-
|
144
|
-
|
142
|
+
}, style: _this._options.style, baseStyle: _this.props.baseStyle, fontFamily: _this.props.fontFamily, children: function (buttonRef) {
|
143
|
+
if (buttonRef) {
|
144
|
+
if (!_this.isInProcess()) {
|
145
|
+
buttonRef.style.minWidth = buttonRef.getBoundingClientRect().width + 'px';
|
146
|
+
}
|
145
147
|
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
!_this.isInProcess() &&
|
150
|
-
_this._options.label);
|
151
|
-
});
|
148
|
+
return (0, jsx_runtime_1.jsxs)(React.Fragment, { children: [(0, jsx_runtime_1.jsx)(CircularProgress_1.default, { size: 15, inProcess: { inProcess: _this.isInProcess() } }), !_this.isInProcess() &&
|
149
|
+
_this._options.label] });
|
150
|
+
} });
|
152
151
|
};
|
153
152
|
_this._options = props.options;
|
154
153
|
// this._label = props.label;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Component, ReactNode, RefObject } from "react";
|
2
|
-
import { FormikProps } from "
|
2
|
+
import { FormikProps } from "formik";
|
3
3
|
import * as React from "react";
|
4
4
|
import Dialog from "../models/Dialog";
|
5
5
|
import { DialogAction } from "../models/DialogAction";
|
@@ -64,6 +64,7 @@ declare class DialogBase extends Component<BaseDialogProps, BaseDialogState> {
|
|
64
64
|
* which is not assignable to that type.
|
65
65
|
* */
|
66
66
|
private readonly _fontFamily;
|
67
|
+
private _storedBounds;
|
67
68
|
constructor(props?: Readonly<BaseDialogProps>);
|
68
69
|
get fullscreenMode(): boolean;
|
69
70
|
private initializeActionRef;
|
@@ -81,7 +82,6 @@ declare class DialogBase extends Component<BaseDialogProps, BaseDialogState> {
|
|
81
82
|
private dialogAutoPos;
|
82
83
|
componentDidMount(): void;
|
83
84
|
onResize(callbackFn: (size: IDialogSize, dialog: IDialogDef) => void): void;
|
84
|
-
componentDidUpdate(prevProps: Readonly<BaseDialogProps>, prevState: Readonly<BaseDialogState>, snapshot?: any): void;
|
85
85
|
componentWillUnmount(): void;
|
86
86
|
setState<K extends keyof BaseDialogState>(state: ((prevState: Readonly<BaseDialogState>, props: Readonly<BaseDialogProps>) => (Pick<BaseDialogState, K> | BaseDialogState | null)) | Pick<BaseDialogState, K> | BaseDialogState | null, callback?: () => void): void;
|
87
87
|
protected setHeader(header: TDialogCallbackNodeFn): DialogBase;
|
@@ -99,7 +99,7 @@ declare class DialogBase extends Component<BaseDialogProps, BaseDialogState> {
|
|
99
99
|
close: (callbackFn?: any) => void;
|
100
100
|
focus: () => void;
|
101
101
|
get actions(): {
|
102
|
-
[key: string]: Pick<DialogActionBase, "
|
102
|
+
[key: string]: Pick<DialogActionBase, "options" | "setInProcess" | "setOptions" | "getLabel" | "click" | "remove">;
|
103
103
|
};
|
104
104
|
private orderPositionWithReference;
|
105
105
|
/**
|
@@ -132,6 +132,6 @@ declare class DialogBase extends Component<BaseDialogProps, BaseDialogState> {
|
|
132
132
|
private Actions;
|
133
133
|
private Content;
|
134
134
|
protected show(callback?: TDialogCallbackVoidFn): void;
|
135
|
-
render: () =>
|
135
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
136
136
|
}
|
137
137
|
export default DialogBase;
|
package/components/DialogBase.js
CHANGED
@@ -53,6 +53,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
53
53
|
};
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
55
55
|
exports.DialogHeaderFooterContext = void 0;
|
56
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
56
57
|
var react_1 = require("react");
|
57
58
|
var React = __importStar(require("react"));
|
58
59
|
var react_draggable_1 = __importDefault(require("react-draggable"));
|
@@ -64,11 +65,13 @@ var client_1 = require("react-dom/client");
|
|
64
65
|
var Resizeable_1 = __importDefault(require("../models/Resizeable"));
|
65
66
|
var ResizeIcon_1 = __importDefault(require("./icons/ResizeIcon"));
|
66
67
|
var Futures_1 = require("./Futures");
|
68
|
+
// Bounds methods
|
69
|
+
var helpers_1 = require("../helpers");
|
67
70
|
var WithSnackbar = function (props) {
|
68
|
-
return
|
71
|
+
return (0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, { ref: props.snackbarRef, maxSnack: props.maxSnack, children: props.children });
|
69
72
|
};
|
70
73
|
var WithHeaderFooterContext = function (props) {
|
71
|
-
return
|
74
|
+
return (0, jsx_runtime_1.jsx)(exports.DialogHeaderFooterContext.Provider, { value: __assign({}, props), children: props.children });
|
72
75
|
};
|
73
76
|
var hexToRgb = function (hex, opacity) {
|
74
77
|
try {
|
@@ -86,11 +89,12 @@ var hexToRgb = function (hex, opacity) {
|
|
86
89
|
return '';
|
87
90
|
};
|
88
91
|
exports.DialogHeaderFooterContext = React.createContext(null);
|
92
|
+
// export const DialogContext = React.createContext(null);
|
89
93
|
var DialogBase = /** @class */ (function (_super) {
|
90
94
|
__extends(DialogBase, _super);
|
91
95
|
function DialogBase(props) {
|
92
96
|
if (props === void 0) { props = {}; }
|
93
|
-
var _a;
|
97
|
+
var _a, _b;
|
94
98
|
var _this = _super.call(this, props) || this; // This ensures that props is treated as readonly
|
95
99
|
_this._dialogTranslate = { lastX: 0, lastY: 0 };
|
96
100
|
_this._shInterval = 300;
|
@@ -296,6 +300,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
296
300
|
return _this._dialogSize;
|
297
301
|
};
|
298
302
|
_this.baseZoomEffect = function () {
|
303
|
+
console.log('this._dialogTranslate', _this._dialogTranslate);
|
299
304
|
var _a = _this._dialogTranslate, lastX = _a.lastX, lastY = _a.lastY;
|
300
305
|
_this._dialogRef.current.animate([
|
301
306
|
// key frames
|
@@ -313,7 +318,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
313
318
|
_this.orderPositionWithReference();
|
314
319
|
var _a = _this._dialogOptions.backdrop, backgroundColor = _a.backgroundColor, opacity = _a.opacity;
|
315
320
|
var bgCl = hexToRgb(backgroundColor, opacity);
|
316
|
-
return
|
321
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "dialog-backdrop dialog-backdrop-show", ref: _this._backdropRef, style: {
|
317
322
|
justifyContent: _this._dialogOptions.base.initialAnchor.horizontal,
|
318
323
|
// alignItems: dialogOptions.base.initialAnchor.vertical,
|
319
324
|
background: bgCl
|
@@ -325,7 +330,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
325
330
|
return;
|
326
331
|
}
|
327
332
|
_this.baseZoomEffect();
|
328
|
-
}
|
333
|
+
}, children: _this.Content(body, header, actions) });
|
329
334
|
};
|
330
335
|
_this.switchFullScreen = function () {
|
331
336
|
if (!_this.state.fullscreenMode) {
|
@@ -346,11 +351,11 @@ var DialogBase = /** @class */ (function (_super) {
|
|
346
351
|
_this._dialogOptions.base.style.backgroundColor : "#FFFFFF";
|
347
352
|
var bg = _this._dialogOptions.base.style.background ?
|
348
353
|
_this._dialogOptions.base.style.background : "#FFFFFF";
|
349
|
-
return
|
354
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-content-placeholder', style: {
|
350
355
|
backgroundColor: bgColor,
|
351
356
|
background: bg,
|
352
357
|
display: placeholder ? 'flex' : 'none',
|
353
|
-
}
|
358
|
+
}, children: placeholder });
|
354
359
|
};
|
355
360
|
_this.Header = function (header) {
|
356
361
|
var _a, _b, _c, _d, _e, _f, _g;
|
@@ -367,42 +372,33 @@ var DialogBase = /** @class */ (function (_super) {
|
|
367
372
|
headerProps = _this._dialogOptions.slotProps.header(staticProps);
|
368
373
|
}
|
369
374
|
if (_this._dialogOptions.slot.header) {
|
370
|
-
return
|
375
|
+
return (0, jsx_runtime_1.jsx)("div", { onDoubleClick: function (event) {
|
371
376
|
if (_this._fullscreen) {
|
372
377
|
_this.switchFullScreen();
|
373
378
|
}
|
374
|
-
}, style: (_c = (_b = _this._dialogOptions.base) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.style, className: "dialog-header ".concat(_this._draggable && !_this.state.fullscreenMode ? 'drag-handle' : '') },
|
375
|
-
React.createElement(WithHeaderFooterContext, __assign({}, staticProps),
|
376
|
-
React.createElement(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this }))));
|
379
|
+
}, style: (_c = (_b = _this._dialogOptions.base) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.style, className: "dialog-header ".concat(_this._draggable && !_this.state.fullscreenMode ? 'drag-handle' : ''), children: (0, jsx_runtime_1.jsx)(WithHeaderFooterContext, __assign({}, staticProps, { children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this })) })) });
|
377
380
|
}
|
378
381
|
if (header instanceof Function) {
|
379
|
-
return
|
382
|
+
return (0, jsx_runtime_1.jsxs)("div", { onDoubleClick: function (event) {
|
380
383
|
if (_this._fullscreen) {
|
381
384
|
_this.switchFullScreen();
|
382
385
|
}
|
383
|
-
}, style: (_e = (_d = _this._dialogOptions.base) === null || _d === void 0 ? void 0 : _d.header) === null || _e === void 0 ? void 0 : _e.style, className: "dialog-header ".concat(_this._draggable && !_this.state.fullscreenMode ? 'drag-handle' : '')
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
React.createElement(Futures_1.DialogHeaderActionsWrapper, null,
|
388
|
-
_this._fullscreen &&
|
389
|
-
React.createElement(Futures_1.DialogFullscreenAction, null),
|
390
|
-
_this._closeable &&
|
391
|
-
React.createElement(Futures_1.DialogCloseAction, null))));
|
386
|
+
}, style: (_e = (_d = _this._dialogOptions.base) === null || _d === void 0 ? void 0 : _d.header) === null || _e === void 0 ? void 0 : _e.style, className: "dialog-header ".concat(_this._draggable && !_this.state.fullscreenMode ? 'drag-handle' : ''), children: [header(_this), (_this._closeable || _this._fullscreen) &&
|
387
|
+
(0, jsx_runtime_1.jsx)(WithHeaderFooterContext, { dialog: _this, children: (0, jsx_runtime_1.jsxs)(Futures_1.DialogHeaderActionsWrapper, { children: [_this._fullscreen &&
|
388
|
+
(0, jsx_runtime_1.jsx)(Futures_1.DialogFullscreenAction, {}), _this._closeable &&
|
389
|
+
(0, jsx_runtime_1.jsx)(Futures_1.DialogCloseAction, {})] }) })] });
|
392
390
|
}
|
393
|
-
return
|
391
|
+
return (0, jsx_runtime_1.jsx)("div", { style: (_g = (_f = _this._dialogOptions.base) === null || _f === void 0 ? void 0 : _f.header) === null || _g === void 0 ? void 0 : _g.style, className: 'drag-handle dialog-header', children: header });
|
394
392
|
};
|
395
393
|
_this.Body = function (body) {
|
396
394
|
if (body instanceof Function) {
|
397
|
-
return
|
398
|
-
_this.Placeholder(_this._holder),
|
399
|
-
body(_this));
|
395
|
+
return (0, jsx_runtime_1.jsxs)("div", { ref: _this._dialogBodyRef, className: 'dialog-body', style: { height: '100%' }, children: [_this.Placeholder(_this._holder), body(_this)] });
|
400
396
|
}
|
401
|
-
return
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
397
|
+
return (0, jsx_runtime_1.jsx)("div", { style: { height: '100%', padding: 10 }, children: _this._holder ?
|
398
|
+
_this.Placeholder(_this._holder)
|
399
|
+
:
|
400
|
+
//@ts-ignore
|
401
|
+
body });
|
406
402
|
};
|
407
403
|
// private Footer = (actions?: DialogAction[]) => {
|
408
404
|
//
|
@@ -449,6 +445,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
449
445
|
// </div>
|
450
446
|
//
|
451
447
|
// };
|
448
|
+
// Bu islem Dialog Base state inden bagimsiz calisir
|
452
449
|
_this.Footer = React.forwardRef(function (_a, ref) {
|
453
450
|
var _b, _c, _d;
|
454
451
|
var actions = _a.actions;
|
@@ -477,43 +474,38 @@ var DialogBase = /** @class */ (function (_super) {
|
|
477
474
|
});
|
478
475
|
}
|
479
476
|
console.log('FooterSlot_props_Y', footerProps, staticProps, 'V6 ya hazirlik -2');
|
480
|
-
return
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
:
|
486
|
-
React.createElement(Futures_1.DialogProcessing, null)
|
487
|
-
/*<CircularProgress size={20} inProcess={this._inProcess} color={this._dialogOptions.progress.color}/>*/
|
488
|
-
)),
|
489
|
-
_this.Actions(actions));
|
477
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-footer', style: (_d = (_c = _this._dialogOptions.base) === null || _c === void 0 ? void 0 : _c.footer) === null || _d === void 0 ? void 0 : _d.style, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(WithHeaderFooterContext, __assign({}, staticProps, { dialog: _this, children: _this._dialogOptions.slot.footer ?
|
478
|
+
/*<CustomFooter inProcess={this._inProcess} dialogValues={this.state.values} dialogOptions={this._dialogOptions} />*/
|
479
|
+
(0, jsx_runtime_1.jsx)(CustomFooter, __assign({}, staticProps, footerProps))
|
480
|
+
:
|
481
|
+
(0, jsx_runtime_1.jsx)(Futures_1.DialogProcessing, {}) })) }), _this.Actions(actions)] });
|
490
482
|
});
|
491
483
|
_this.Actions = function (actions) {
|
492
|
-
return
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
484
|
+
return (0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', display: 'flex', flexDirection: 'row', columnGap: 10, alignItems: 'center' }, children: actions.map(function (action, index) {
|
485
|
+
// const ref = this.slotActionsRef[index];
|
486
|
+
// const ActionSlot = this._dialogOptions?.slot?.action;
|
487
|
+
// // console.log('ActionSlot',ActionSlot);
|
488
|
+
// if (ActionSlot) {
|
489
|
+
// return <ActionSlot
|
490
|
+
// ref={ref}
|
491
|
+
// key={index.toString()}
|
492
|
+
// {...this._dialogOptions?.slotProps?.action}
|
493
|
+
// onClick={ (event: React.MouseEvent) => {
|
494
|
+
// action._onClickSlot( ref, this );
|
495
|
+
// }}
|
496
|
+
// label={action.options.label}
|
497
|
+
// style={{...this._dialogOptions.slotProps?.action?.style, ...action.options.style }}
|
498
|
+
// />
|
499
|
+
//
|
500
|
+
// }
|
501
|
+
var referencedAction = _this.initializeActionRef(action.name);
|
502
|
+
// this._actions[action.name] = referencedAction.current
|
503
|
+
return (0, jsx_runtime_1.jsx)(DialogActionBase_1.default, { name: action.name, ref: referencedAction, dialogBaseComponent: _this, options: action.options, onClick: action.onClickHandler(), inProcess: action.isInProcess(),
|
504
|
+
// onLoad={ dialogAction => {
|
505
|
+
// action.baseDialogAction = dialogAction;
|
506
|
+
// }}
|
507
|
+
style: action.options.style, baseStyle: _this._dialogOptions.base.actions.baseStyle, fontFamily: _this._fontFamily, stateListener: action._stateListener }, index.toString());
|
508
|
+
}) });
|
517
509
|
};
|
518
510
|
_this.Content = function (body, header, actions) {
|
519
511
|
var _a;
|
@@ -533,11 +525,27 @@ var DialogBase = /** @class */ (function (_super) {
|
|
533
525
|
console.log('Content:', actions);
|
534
526
|
var xKey = _this.dialogPosFromMultipleDialogs.isMultiple ? "left" : "marginLeft";
|
535
527
|
var yKey = _this.dialogPosFromMultipleDialogs.isMultiple ? "top" : "marginTop";
|
536
|
-
|
528
|
+
/**
|
529
|
+
* default null
|
530
|
+
* eget momoize islemi uygulanmissa read from memory
|
531
|
+
* */
|
532
|
+
var bounds = _this._storedBounds;
|
533
|
+
return (0, jsx_runtime_1.jsx)(react_draggable_1.default, { disabled: !_this._draggable || _this.state.fullscreenMode, axis: 'both', handle: _this._draggable ? '.drag-handle' : '', scale: 1, ref: _this._backdropRef, onDrag: function (event, data) {
|
537
534
|
event.stopPropagation();
|
538
535
|
_this._dialogTranslate = { lastX: data.lastX, lastY: data.lastY };
|
539
|
-
}
|
540
|
-
|
536
|
+
}, onStop: function (event, data) {
|
537
|
+
var _a;
|
538
|
+
event.stopPropagation();
|
539
|
+
event.preventDefault();
|
540
|
+
console.log('onDragStop', 'fired');
|
541
|
+
var _b = (_a = _this._dialogRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(), width = _b.width, height = _b.height, x = _b.x, y = _b.y;
|
542
|
+
(0, helpers_1.setDialogBounds)(_this._dialogOptions.base.id, {
|
543
|
+
width: width,
|
544
|
+
height: height,
|
545
|
+
x: x,
|
546
|
+
y: y
|
547
|
+
}, _this._dialogRef);
|
548
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { id: "dialog-main", ref: _this._dialogRef, onClick: function (e) {
|
541
549
|
e.stopPropagation();
|
542
550
|
}, onKeyDown: function (e) {
|
543
551
|
if (typeof _this.props.keyboardListener === "function") {
|
@@ -546,16 +554,13 @@ var DialogBase = /** @class */ (function (_super) {
|
|
546
554
|
}
|
547
555
|
},
|
548
556
|
// className={this._dialogSize.width === 'auto' ? 'auto' : `dialog-width-${this._dialogSize.width} dialog-main show-opacity show-position-${this._dialogOptions.base.initialAnchor.vertical}`}
|
549
|
-
className: _this._dialogOptions.base.size.width === 'auto' ? 'auto' : "dialog-width-".concat(_this._dialogOptions.base.size.width, " dialog-main show-opacity show-position-").concat(_this._dialogOptions.base.initialAnchor.vertical), style: __assign(__assign(__assign(__assign({ alignSelf: _this._dialogOptions.base.initialAnchor.vertical, height: (_b = _this._dialogOptions.base.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof _this._dialogOptions.base.size.width === "number" ? { width: _this._dialogOptions.base.size.width } : null), (_a = { outline: 'none' }, _a[yKey] = _this.dialogPosFromMultipleDialogs.top + 'px', _a[xKey] = _this.dialogPosFromMultipleDialogs.left + 'px', _a)), _this._dialogOptions.base.style), { fontFamily: _this._fontFamily }) },
|
550
|
-
|
551
|
-
(_this._header || _this._dialogOptions.slot.header) && _this.Header(header),
|
552
|
-
_this.Body(body),
|
553
|
-
React.createElement(_this.Footer, { ref: _this._footeRef, actions: actions })),
|
554
|
-
(_this._dialogOptions.base.resizeable) &&
|
555
|
-
React.createElement(React.Fragment, null,
|
556
|
-
React.createElement("div", { className: "resizable-handle", onMouseDown: (_c = _this._Resizeable) === null || _c === void 0 ? void 0 : _c.resizeHandleMouseDown },
|
557
|
-
React.createElement(ResizeIcon_1.default, { color: '#286e94' })))));
|
557
|
+
className: _this._dialogOptions.base.size.width === 'auto' ? 'auto' : "dialog-width-".concat(_this._dialogOptions.base.size.width, " dialog-main show-opacity show-position-").concat(_this._dialogOptions.base.initialAnchor.vertical), style: __assign(__assign(__assign(__assign(__assign({ alignSelf: _this._dialogOptions.base.initialAnchor.vertical, height: (_b = _this._dialogOptions.base.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof _this._dialogOptions.base.size.width === "number" ? { width: _this._dialogOptions.base.size.width } : null), (_a = { outline: 'none' }, _a[yKey] = _this.dialogPosFromMultipleDialogs.top + 'px', _a[xKey] = _this.dialogPosFromMultipleDialogs.left + 'px', _a)), _this._dialogOptions.base.style), { fontFamily: _this._fontFamily }), bounds ? { position: 'absolute', top: bounds.y, left: bounds.x, width: bounds.width, height: bounds.height } : null), children: [(0, jsx_runtime_1.jsxs)(WithSnackbar, { snackbarRef: _this._snackbarRef, maxSnack: _this._dialogOptions.snackbar.maxSnack, children: [(_this._header || _this._dialogOptions.slot.header) && _this.Header(header), _this.Body(body), (0, jsx_runtime_1.jsx)(_this.Footer, { ref: _this._footeRef, actions: actions })] }), (_this._dialogOptions.base.resizeable) &&
|
558
|
+
(0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "resizable-handle", onMouseDown: (_c = _this._Resizeable) === null || _c === void 0 ? void 0 : _c.resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(ResizeIcon_1.default, { color: '#286e94' }) }) })] }) });
|
558
559
|
};
|
560
|
+
// render = () => {
|
561
|
+
//
|
562
|
+
// return this.withBackdrop(this._body, this._header, this._actions)
|
563
|
+
// }
|
559
564
|
_this.render = function () {
|
560
565
|
return _this.withBackdrop(_this._body, _this._header, _this._actions);
|
561
566
|
};
|
@@ -618,6 +623,10 @@ var DialogBase = /** @class */ (function (_super) {
|
|
618
623
|
// this._slots = this._dialogOptions.base.slots
|
619
624
|
_this._initialValues = props.initialValues;
|
620
625
|
_this._resizeListenersStore = [];
|
626
|
+
// Fetch Initial Dialog Bounds
|
627
|
+
var base = _this._dialogOptions.base;
|
628
|
+
var memoBounds = base.memoBounds;
|
629
|
+
_this._storedBounds = ((_b = _this._dialogOptions.base) === null || _b === void 0 ? void 0 : _b.memoBounds) ? (0, helpers_1.getDialogBounds)(base) : null;
|
621
630
|
return _this;
|
622
631
|
}
|
623
632
|
Object.defineProperty(DialogBase.prototype, "parent", {
|
@@ -700,9 +709,10 @@ var DialogBase = /** @class */ (function (_super) {
|
|
700
709
|
};
|
701
710
|
DialogBase.prototype.componentDidMount = function () {
|
702
711
|
var _this = this;
|
703
|
-
var _a, _b;
|
712
|
+
var _a, _b, _c, _d;
|
713
|
+
console.log('clalisan componentDidMount');
|
704
714
|
// İlk konumları global seçeneklerden al
|
705
|
-
var
|
715
|
+
var _e = this._dialogOptions.snackbar.anchorOrigin, vertical = _e.vertical, horizontal = _e.horizontal;
|
706
716
|
var initialAnchor = { vertical: vertical, horizontal: horizontal };
|
707
717
|
// Kullanıcı tanımlı konumlar varsa, onları ilk konumlarla birleştir
|
708
718
|
this._snackbarAnchor = __assign(__assign(__assign({}, initialAnchor), (((_a = this.props.snackbarAnchor) === null || _a === void 0 ? void 0 : _a.vertical) ? { vertical: this.props.snackbarAnchor.vertical } : {})), (((_b = this.props.snackbarAnchor) === null || _b === void 0 ? void 0 : _b.horizontal) ? { horizontal: this.props.snackbarAnchor.horizontal } : {}));
|
@@ -730,7 +740,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
730
740
|
this._dialogRef.current.tabIndex = 0; // Odaklanabilir hale getirir
|
731
741
|
this._dialogRef.current.focus();
|
732
742
|
if (this._Resizeable) {
|
733
|
-
this._Resizeable.setContainer(this._dialogRef.
|
743
|
+
this._Resizeable.setContainer(this._dialogRef, this._dialogOptions);
|
734
744
|
this._Resizeable.onResizeListener(function (width, height) {
|
735
745
|
if (typeof _this.props.resizeListener === "function") {
|
736
746
|
_this._resizeListenersStore.push(_this.props.resizeListener);
|
@@ -756,6 +766,28 @@ var DialogBase = /** @class */ (function (_super) {
|
|
756
766
|
// }
|
757
767
|
// Parent objesinin accessFrom özelliğini ayarla
|
758
768
|
this.props.parent.accessFrom = "internal";
|
769
|
+
// Check This
|
770
|
+
try {
|
771
|
+
var t = window.localStorage.getItem('react-super-dialog');
|
772
|
+
console.log('Parsed Bounds Store', JSON.parse(t));
|
773
|
+
}
|
774
|
+
catch (e) {
|
775
|
+
}
|
776
|
+
// Register Dialog Bounds
|
777
|
+
if ((_c = this._dialogOptions.base) === null || _c === void 0 ? void 0 : _c.memoBounds) {
|
778
|
+
if (!helpers_1.InitDialogMemoizeBoundsDeclared) {
|
779
|
+
throw new Error('InitDialogMemoizeBounds is not defined. Please make sure to declare it only once, at the top‑level of your module—outside of App or its render logic.\n' +
|
780
|
+
'InitDialogMemoizeBounds()\n' +
|
781
|
+
'const App() => {...');
|
782
|
+
}
|
783
|
+
var _f = (_d = this._dialogRef.current) === null || _d === void 0 ? void 0 : _d.getBoundingClientRect(), width = _f.width, height = _f.height, x = _f.x, y = _f.y;
|
784
|
+
(0, helpers_1.dialogRegister)(this._dialogOptions.base, {
|
785
|
+
width: width,
|
786
|
+
height: height,
|
787
|
+
x: x,
|
788
|
+
y: y
|
789
|
+
});
|
790
|
+
}
|
759
791
|
};
|
760
792
|
DialogBase.prototype.onResize = function (callbackFn) {
|
761
793
|
if (typeof callbackFn === "function") {
|
@@ -763,32 +795,8 @@ var DialogBase = /** @class */ (function (_super) {
|
|
763
795
|
// Bu olay overwite olmasinin onune gecer
|
764
796
|
// Cunku en sonku callback calistirildigi icin ornedin header ve
|
765
797
|
this._resizeListenersStore.push(callbackFn);
|
766
|
-
// if(this._Resizeable){
|
767
|
-
// this._Resizeable.onResizeListener((width, height) => {
|
768
|
-
// // @ts-ignore
|
769
|
-
// callbackFn({width, height}, this);
|
770
|
-
// });
|
771
|
-
// }
|
772
798
|
}
|
773
799
|
};
|
774
|
-
// onResize: (callbackFn: (size: IDialogSize, dialog: IDialogDef) => void){
|
775
|
-
// if(typeof callbackFn === "function"){
|
776
|
-
//
|
777
|
-
// }
|
778
|
-
// }
|
779
|
-
DialogBase.prototype.componentDidUpdate = function (prevProps, prevState, snapshot) {
|
780
|
-
/*if(this._dialogRef.current && this._dialogOptions.base.resizeable && !this._Resizeable){
|
781
|
-
console.log('this._Resizeable.onResizeListener', this._Resizeable );
|
782
|
-
|
783
|
-
this._Resizeable.onResizeListener((width, height) => {
|
784
|
-
console.log('this._Resizeable.onResizeListener', width, height );
|
785
|
-
this._dialogRef.current.style.width = width + 'px';
|
786
|
-
this._dialogRef.current.style.height = height + 'px';
|
787
|
-
})
|
788
|
-
}*/
|
789
|
-
};
|
790
|
-
// getSnapshotBeforeUpdate(prevProps: Readonly<BaseDialogProps>, prevState: Readonly<BaseDialogState>): any {
|
791
|
-
// }
|
792
800
|
DialogBase.prototype.componentWillUnmount = function () {
|
793
801
|
if (this._Resizeable) {
|
794
802
|
// Temizlik fonksiyonu
|
@@ -941,8 +949,10 @@ var DialogBase = /** @class */ (function (_super) {
|
|
941
949
|
this._dom.classList.add('appinsource-dialog-root');
|
942
950
|
// Find root element
|
943
951
|
var rootElement = document.getElementById('root');
|
952
|
+
var AppElement = rootElement.firstElementChild;
|
944
953
|
if (rootElement) {
|
945
|
-
rootElement.appendChild(this._dom);
|
954
|
+
// rootElement.appendChild(this._dom);
|
955
|
+
AppElement.prepend(this._dom);
|
946
956
|
}
|
947
957
|
else {
|
948
958
|
document.body.appendChild(this._dom);
|
@@ -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.DialogCloseAction = void 0;
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
30
8
|
var CloseIcon_1 = __importDefault(require("../icons/CloseIcon"));
|
31
|
-
var React = __importStar(require("react"));
|
32
9
|
var react_1 = require("react");
|
33
10
|
var DialogBase_1 = require("../DialogBase");
|
34
11
|
// const DialogCloseAction = ({dialog}:{dialog: React.RefObject<IDialogRef> | undefined}) => {
|
@@ -39,16 +16,15 @@ var DialogCloseAction = function () {
|
|
39
16
|
var _dialog = dialogHeaderContext.dialog;
|
40
17
|
// console.log('DialogCloseAction_props', dialogHeaderContext);
|
41
18
|
// return <div className={'close-icon-wrapper'} onClick={event => apiRef.current.close()} >
|
42
|
-
return
|
19
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'close-icon-wrapper', onClick: function (event) {
|
43
20
|
// props.dialog.close()
|
44
21
|
_dialog.close();
|
45
|
-
}
|
46
|
-
React.createElement(CloseIcon_1.default
|
22
|
+
}, children: (0, jsx_runtime_1.jsx)(CloseIcon_1.default
|
47
23
|
// size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
|
48
24
|
// color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
|
49
25
|
, {
|
50
26
|
// size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
|
51
27
|
// color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
|
52
|
-
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
|
+
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 }) });
|
53
29
|
};
|
54
30
|
exports.DialogCloseAction = DialogCloseAction;
|