react-dialogger 1.1.41 → 1.1.42

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.
@@ -7,13 +7,14 @@ import DialogActionBase from "./DialogActionBase";
7
7
  import { IInProcess, ComponentOrderType, TInitialHolder, ISnackbarAnchor, ComponentOrderPositions, TSeverity, BaseDialogDOMRect, TAccessFrom, TInitialValues, DialogValues } from "../types/types";
8
8
  import { BaseDialogProps, BaseDialogState, IDialogSize, DialogOptionsType, TBaseDialogState, TDialogStateListenerCallbackType, IDialogDef, TDialogCallbackNodeFn, TDialogCallbackVoidFn } from "../types/DialogTypes";
9
9
  import Resizeable from "../models/Resizeable";
10
+ export declare const WithHeaderFooterContext: (props: any) => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const DialogHeaderFooterContext: React.Context<any>;
11
12
  declare class DialogBase<Values extends Record<string, any>> extends Component<BaseDialogProps, BaseDialogState> {
12
13
  get parent(): Dialog;
13
14
  protected _dom: HTMLDivElement;
14
15
  protected _innerRef: React.RefObject<any>;
15
16
  protected _stateListener: TDialogStateListenerCallbackType;
16
- protected _processingListener: (inProcess: boolean) => void;
17
+ _processingListener: (inProcess: boolean) => void;
17
18
  protected _keyboardListener: (key: string, dialog: IDialogDef) => void;
18
19
  protected _resizeListener: (size: IDialogSize, dialog: IDialogDef) => void;
19
20
  protected _initialHolder: TInitialHolder;
@@ -24,12 +25,12 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
24
25
  protected readonly _backdropRef: RefObject<any>;
25
26
  protected readonly _dialogRef: RefObject<any>;
26
27
  protected readonly _dialogBodyRef: RefObject<any>;
28
+ /**@deprecated use outside Content component*/
27
29
  protected readonly _snackbarRef: RefObject<any>;
28
30
  protected _dialogSize: IDialogSize;
29
31
  protected _holder?: TInitialHolder;
30
32
  protected _formikProps: FormikProps<any>;
31
- /**@deprecated use outside Content component*/
32
- protected _dialogTranslate: {
33
+ _dialogTranslate: {
33
34
  lastX: number;
34
35
  lastY: number;
35
36
  };
@@ -43,7 +44,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
43
44
  protected _shInterval: number;
44
45
  protected _onClose: TDialogCallbackVoidFn;
45
46
  private _inProcess;
46
- private _footeRef;
47
+ private _footerRef;
47
48
  /**
48
49
  * @deprecated
49
50
  * @see dialogOptions.snackbar.anchorOrigin */
@@ -70,8 +71,9 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
70
71
  private _storedBounds;
71
72
  constructor(props?: Readonly<BaseDialogProps>);
72
73
  get fullscreenMode(): boolean;
73
- private initializeActionRef;
74
+ initializeActionRef: (key: string) => RefObject<DialogActionBase>;
74
75
  get dialogOptions(): DialogOptionsType;
76
+ get holder(): DialogOptionsType;
75
77
  /**@deprecate
76
78
  * @see this.state
77
79
  * */
@@ -79,8 +81,8 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
79
81
  get formikProps(): FormikProps<any>;
80
82
  set formikProps(value: FormikProps<any>);
81
83
  get formikValidate(): Promise<FormikProps<any>>;
82
- get values(): DialogValues;
83
- setValues(values: DialogValues, callbackFn?: () => void): void;
84
+ get values(): Record<string, any>;
85
+ setValues(values: Record<string, any>, callbackFn?: () => void): void;
84
86
  setValue(key: string, value: any): void;
85
87
  private dialogAutoPos;
86
88
  componentDidMount(): void;
@@ -62,7 +62,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
62
62
  return (mod && mod.__esModule) ? mod : { "default": mod };
63
63
  };
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.DialogHeaderFooterContext = void 0;
65
+ exports.DialogHeaderFooterContext = exports.WithHeaderFooterContext = void 0;
66
66
  var jsx_runtime_1 = require("react/jsx-runtime");
67
67
  var react_1 = require("react");
68
68
  // import {JSX} from "react";
@@ -80,12 +80,14 @@ var ResizeIcon_1 = __importDefault(require("./icons/ResizeIcon"));
80
80
  var Futures_1 = require("./Futures");
81
81
  // Bounds methods
82
82
  var helpers_1 = require("../helpers");
83
+ var DialogContent_1 = require("./DialogContent");
83
84
  var WithSnackbar = function (props) {
84
85
  return (0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, { ref: props.snackbarRef, maxSnack: props.maxSnack, children: props.children });
85
86
  };
86
87
  var WithHeaderFooterContext = function (props) {
87
88
  return (0, jsx_runtime_1.jsx)(exports.DialogHeaderFooterContext.Provider, { value: __assign({}, props), children: props.children });
88
89
  };
90
+ exports.WithHeaderFooterContext = WithHeaderFooterContext;
89
91
  var hexToRgb = function (hex, opacity) {
90
92
  try {
91
93
  var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
@@ -109,11 +111,10 @@ var DialogBase = /** @class */ (function (_super) {
109
111
  if (props === void 0) { props = {}; }
110
112
  var _a, _b;
111
113
  var _this = _super.call(this, props) || this; // This ensures that props is treated as readonly
112
- /**@deprecated use outside Content component*/
113
114
  _this._dialogTranslate = { lastX: 0, lastY: 0 };
114
115
  _this._shInterval = 300;
115
116
  _this._inProcess = { inProcess: false };
116
- _this._footeRef = React.createRef();
117
+ _this._footerRef = React.createRef();
117
118
  // Initialize a ref for each action dynamically
118
119
  _this.initializeActionRef = function (key) {
119
120
  if (!_this._actionRefs.hasOwnProperty(key)) {
@@ -232,7 +233,7 @@ var DialogBase = /** @class */ (function (_super) {
232
233
  _this.snackbar.close("kInProcess");
233
234
  }
234
235
  // @ts-ignore
235
- (_c = _this._footeRef.current) === null || _c === void 0 ? void 0 : _c.setProcessing(process);
236
+ (_c = _this._footerRef.current) === null || _c === void 0 ? void 0 : _c.setProcessing(process);
236
237
  // this.forceUpdate();
237
238
  return _this;
238
239
  };
@@ -240,7 +241,7 @@ var DialogBase = /** @class */ (function (_super) {
240
241
  // return this.state.inProcess;
241
242
  return _this._inProcess;
242
243
  // @ts-ignore
243
- // return this._footeRef?.current?.inProcess ?? false;
244
+ // return this._footerRef?.current?.inProcess ?? false;
244
245
  };
245
246
  _this.close = function (callbackFn) {
246
247
  var _a;
@@ -349,7 +350,7 @@ var DialogBase = /** @class */ (function (_super) {
349
350
  return;
350
351
  }
351
352
  _this.baseZoomEffect();
352
- }, children: (0, jsx_runtime_1.jsx)(_this.Content, { body: body, header: header, actions: actions }) });
353
+ }, children: (0, jsx_runtime_1.jsx)(DialogContent_1.DialogContent, { body: body, header: header, actions: actions, dialogRef: _this._dialogRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, dialogOptions: _this.dialogOptions, dom: _this._dom, keyboardListener: _this._keyboardListener, resizeHandleMouseDown: _this._Resizeable.resizeHandleMouseDown, dialog: _this }) });
353
354
  };
354
355
  _this.switchFullScreen = function () {
355
356
  if (!_this.state.fullscreenMode) {
@@ -395,7 +396,7 @@ var DialogBase = /** @class */ (function (_super) {
395
396
  if (_this._fullscreen) {
396
397
  _this.switchFullScreen();
397
398
  }
398
- }, 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 })) })) });
399
+ }, 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)(exports.WithHeaderFooterContext, __assign({}, staticProps, { children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this })) })) });
399
400
  }
400
401
  if (header instanceof Function) {
401
402
  return (0, jsx_runtime_1.jsxs)("div", { onDoubleClick: function (event) {
@@ -403,12 +404,13 @@ var DialogBase = /** @class */ (function (_super) {
403
404
  _this.switchFullScreen();
404
405
  }
405
406
  }, 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) &&
406
- (0, jsx_runtime_1.jsx)(WithHeaderFooterContext, { dialog: _this, children: (0, jsx_runtime_1.jsxs)(Futures_1.DialogHeaderActionsWrapper, { children: [_this._fullscreen &&
407
+ (0, jsx_runtime_1.jsx)(exports.WithHeaderFooterContext, { dialog: _this, children: (0, jsx_runtime_1.jsxs)(Futures_1.DialogHeaderActionsWrapper, { children: [_this._fullscreen &&
407
408
  (0, jsx_runtime_1.jsx)(Futures_1.DialogFullscreenAction, {}), _this._closeable &&
408
409
  (0, jsx_runtime_1.jsx)(Futures_1.DialogCloseAction, {})] }) })] });
409
410
  }
410
411
  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 });
411
412
  };
413
+ // TODO Body
412
414
  _this.Body = function (_a) {
413
415
  var body = _a.body;
414
416
  if (body instanceof Function) {
@@ -499,7 +501,7 @@ var DialogBase = /** @class */ (function (_super) {
499
501
  });
500
502
  }
501
503
  console.log('FooterSlot_props_Y', footerProps, staticProps, 'V6 ya hazirlik -2');
502
- 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 ?
504
+ 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)(exports.WithHeaderFooterContext, __assign({}, staticProps, { dialog: _this, children: _this._dialogOptions.slot.footer ?
503
505
  /*<CustomFooter inProcess={this._inProcess} dialogValues={this.state.values} dialogOptions={this._dialogOptions} />*/
504
506
  (0, jsx_runtime_1.jsx)(CustomFooter, __assign({}, staticProps, footerProps))
505
507
  :
@@ -590,7 +592,7 @@ var DialogBase = /** @class */ (function (_super) {
590
592
  }
591
593
  },
592
594
  // className={this._dialogSize.width === 'auto' ? 'auto' : `dialog-width-${this._dialogSize.width} dialog-main show-opacity show-position-${this._dialogOptions.base.initialAnchor.vertical}`}
593
- 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: (_c = _this._dialogOptions.base.size.height) !== null && _c !== void 0 ? _c : 'auto' }, typeof _this._dialogOptions.base.size.width === "number" ? { width: _this._dialogOptions.base.size.width } : null), (_b = { outline: 'none' }, _b[yKey] = _this.dialogPosFromMultipleDialogs.top + 'px', _b[xKey] = _this.dialogPosFromMultipleDialogs.left + 'px', _b)), _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), (0, jsx_runtime_1.jsx)(_this.Body, { body: body }), (0, jsx_runtime_1.jsx)(_this.Footer, { ref: _this._footeRef, actions: actions })] }), (_this._dialogOptions.base.resizeable) &&
595
+ 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: (_c = _this._dialogOptions.base.size.height) !== null && _c !== void 0 ? _c : 'auto' }, typeof _this._dialogOptions.base.size.width === "number" ? { width: _this._dialogOptions.base.size.width } : null), (_b = { outline: 'none' }, _b[yKey] = _this.dialogPosFromMultipleDialogs.top + 'px', _b[xKey] = _this.dialogPosFromMultipleDialogs.left + 'px', _b)), _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), (0, jsx_runtime_1.jsx)(_this.Body, { body: body }), (0, jsx_runtime_1.jsx)(_this.Footer, { ref: _this._footerRef, actions: actions })] }), (_this._dialogOptions.base.resizeable) &&
594
596
  (0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "resizable-handle", style: {
595
597
  zIndex: parseInt(domZIndex) + 1
596
598
  }, onMouseDown: (_d = _this._Resizeable) === null || _d === void 0 ? void 0 : _d.resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(ResizeIcon_1.default, { color: '#286e94' }) }) })] }) });
@@ -701,6 +703,13 @@ var DialogBase = /** @class */ (function (_super) {
701
703
  enumerable: false,
702
704
  configurable: true
703
705
  });
706
+ Object.defineProperty(DialogBase.prototype, "holder", {
707
+ get: function () {
708
+ return this._holder;
709
+ },
710
+ enumerable: false,
711
+ configurable: true
712
+ });
704
713
  Object.defineProperty(DialogBase.prototype, "formikProps", {
705
714
  // get state(): T | Readonly<BaseDialogState> {
706
715
  // return super.state
@@ -738,13 +747,13 @@ var DialogBase = /** @class */ (function (_super) {
738
747
  Object.defineProperty(DialogBase.prototype, "values", {
739
748
  // get values(): DialogValues {
740
749
  get: function () {
741
- var _a;
742
- // return this.state.values;
743
- return (_a = this._formikProps) === null || _a === void 0 ? void 0 : _a.values;
750
+ return this.state.values;
751
+ // return this._formikProps?.values;
744
752
  },
745
753
  enumerable: false,
746
754
  configurable: true
747
755
  });
756
+ // public setValues(values: DialogValues, callbackFn?: () => void): void {
748
757
  DialogBase.prototype.setValues = function (values, callbackFn) {
749
758
  var prevValues = __assign({}, this.state.values);
750
759
  // this.setState( prevState => ({...prevState, values: {...prevValues, ...values}}) );
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import DialogBase from "./DialogBase";
3
+ import { DialogAction } from "../models/DialogAction";
4
+ interface IContentFooterProps {
5
+ dialog: DialogBase<any>;
6
+ actions?: DialogAction[];
7
+ }
8
+ export interface DialogContentFooterReturnType {
9
+ setProcessing: React.Dispatch<React.SetStateAction<boolean>>;
10
+ inProcess: boolean;
11
+ }
12
+ declare const DialogContentFooter: React.ForwardRefExoticComponent<IContentFooterProps & React.RefAttributes<DialogContentFooterReturnType>>;
13
+ export { DialogContentFooter };
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __importDefault = (this && this.__importDefault) || function (mod) {
47
+ return (mod && mod.__esModule) ? mod : { "default": mod };
48
+ };
49
+ var _this = this;
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.DialogContentFooter = void 0;
52
+ var jsx_runtime_1 = require("react/jsx-runtime");
53
+ var React = __importStar(require("react"));
54
+ var react_1 = require("react");
55
+ var DialogBase_1 = require("./DialogBase");
56
+ var Futures_1 = require("./Futures");
57
+ var DialogActionBase_1 = __importDefault(require("./DialogActionBase"));
58
+ var Actions = function (_a) {
59
+ var actions = _a.actions, dialog = _a.dialog;
60
+ var dialogOptions = dialog.dialogOptions;
61
+ console.log('Actions', actions);
62
+ return (0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', display: 'flex', flexDirection: 'row', columnGap: 10, alignItems: 'center' }, children: actions.map(function (action, index) {
63
+ var referencedAction = dialog.initializeActionRef(action.name);
64
+ // this._actions[action.name] = referencedAction.current
65
+ return (0, jsx_runtime_1.jsx)(DialogActionBase_1.default, { name: action.name, ref: referencedAction, dialogBaseComponent: dialog, options: action.options, onClick: action.onClickHandler(), inProcess: action.isInProcess(),
66
+ // onLoad={ dialogAction => {
67
+ // action.baseDialogAction = dialogAction;
68
+ // }}
69
+ style: action.options.style, baseStyle: dialogOptions.base.actions.baseStyle, fontFamily: dialogOptions.base.style.fontFamily, stateListener: action._stateListener }, index.toString());
70
+ }) });
71
+ };
72
+ var DialogContentFooter = (0, react_1.forwardRef)(function (_a, ref) {
73
+ var _b, _c, _d;
74
+ var actions = _a.actions, dialog = _a.dialog;
75
+ var state = dialog.state, dialogOptions = dialog.dialogOptions;
76
+ console.log('DialogContentHeader', dialog);
77
+ var baseOptions = dialogOptions.base;
78
+ var CustomFooter = (_b = dialogOptions.slot) === null || _b === void 0 ? void 0 : _b.footer;
79
+ // Imperative handle
80
+ var _e = React.useState(false), inProcess = _e[0], setInProcess = _e[1];
81
+ var setProcessing = function (inProcess) {
82
+ setInProcess(inProcess);
83
+ };
84
+ React.useImperativeHandle(ref, function () { return ({
85
+ setProcessing: setProcessing,
86
+ inProcess: inProcess
87
+ }); });
88
+ // console.log('processingListener', this._processingListener);
89
+ if (typeof dialog._processingListener === "function") {
90
+ dialog._processingListener(inProcess);
91
+ }
92
+ var staticProps = {
93
+ dialogValues: dialog.state.values,
94
+ dialogOptions: dialogOptions,
95
+ dialog: _this
96
+ };
97
+ var footerProps = {};
98
+ if (dialogOptions.slotProps.footer) {
99
+ footerProps = dialogOptions.slotProps.footer({
100
+ dialogValues: dialog.state.values,
101
+ dialogOptions: dialogOptions,
102
+ inProcess: dialog.isInProcess()
103
+ });
104
+ }
105
+ console.log('FooterSlot_props_Y', footerProps, staticProps, 'V6 ya hazirlik -2');
106
+ return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-footer', style: (_d = (_c = 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)(DialogBase_1.WithHeaderFooterContext, __assign({}, staticProps, { dialog: dialog, children: dialogOptions.slot.footer ?
107
+ /*<CustomFooter inProcess={this._inProcess} dialogValues={this.state.values} dialogOptions={this._dialogOptions} />*/
108
+ (0, jsx_runtime_1.jsx)(CustomFooter, __assign({}, staticProps, footerProps))
109
+ :
110
+ (0, jsx_runtime_1.jsx)(Futures_1.DialogProcessing, {}) })) }), (0, jsx_runtime_1.jsx)(Actions, { dialog: dialog, actions: actions })] });
111
+ });
112
+ exports.DialogContentFooter = DialogContentFooter;
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { BaseDialogProps, DialogOptionsType, TDialogCallbackNodeFn } from "../types/DialogTypes";
3
+ import DialogBase from "./DialogBase";
4
+ import { DialogContentFooterReturnType } from "./DialogContenFooter";
5
+ interface IContentProps {
6
+ body: TDialogCallbackNodeFn;
7
+ header: TDialogCallbackNodeFn;
8
+ actions: any;
9
+ dialogRef: React.RefObject<any>;
10
+ footerRef: React.RefObject<DialogContentFooterReturnType>;
11
+ backdropRef: React.RefObject<any>;
12
+ dialogOptions: DialogOptionsType;
13
+ dom: HTMLDivElement;
14
+ keyboardListener: BaseDialogProps['keyboardListener'];
15
+ resizeHandleMouseDown: () => void;
16
+ dialog: DialogBase<any>;
17
+ }
18
+ declare const DialogContent: React.FC<IContentProps>;
19
+ export { DialogContent };
@@ -1,181 +1,139 @@
1
- // import Draggable from "react-draggable";
2
- // import {setDialogBounds} from "../helpers";
3
- // import * as React from "react";
4
- // import ResizeIcon from "./icons/ResizeIcon";
5
- // import {IBaseDialogOptions, TDialogCallbackNodeFn} from "../types/DialogTypes";
6
- // import {Dialog} from "../index";
7
- // import {BaseDialogDOMRect} from "../types/types";
8
- //
9
- // interface IBodyProps {
10
- // body: TDialogCallbackNodeFn;
11
- // header: TDialogCallbackNodeFn;
12
- // actions: any;
13
- // dialogRef: React.RefObject<Dialog>;
14
- // backdropRef: React.RefObject<any>; // 👈 Type ???
15
- // baseOptions: IBaseDialogOptions;
16
- // dom: HTMLDivElement;
17
- // }
18
- //
19
- // const dialogAutoPos = (): BaseDialogDOMRect => {
20
- // const nodes = Array.from(document.querySelectorAll('.appinsource-dialog-root'));
21
- // if(nodes.length > 1 ) {
22
- // const lastDialog = nodes[nodes.length - 2];
23
- // const dialogMain = lastDialog.querySelector('#dialog-main')
24
- // return {
25
- // top: dialogMain?.getBoundingClientRect().top + 10,
26
- // left: dialogMain?.getBoundingClientRect().left + 10,
27
- // isMultiple: true
28
- // }
29
- // }
30
- // return {top: 0 ,left: 0, isMultiple: false}
31
- // }
32
- //
33
- // const baseZoomEffect = (dialogRef: React.RefObject<Dialog>, lastX: number, lastY: number) => {
34
- //
35
- // // const {lastX, lastY} = this._dialogTranslate;
36
- // dialogRef.current.animate([
37
- // // key frames
38
- // { transform: `translate(${lastX}px, ${lastY}px) scale(1)` },
39
- // { transform: `translate(${lastX}px, ${lastY}px) scale(1.01)`},
40
- // // { boxShadow: `0 0 20px red`},
41
- // { transform: `translate(${lastX}px, ${lastY}px) scale(1)` }
42
- // ], {
43
- // // sync options
44
- // duration: 300,
45
- // iterations: 1
46
- // });
47
- // }
48
- //
49
- // const DialogContent: React.FC<IBodyProps> = ({
50
- // body,
51
- // header,
52
- // actions,
53
- // dialogRef,
54
- // baseOptions,
55
- // dom,
56
- // backdropRef
57
- //
58
- // }) => {
59
- //
60
- // const position: BaseDialogDOMRect = dialogAutoPos();
61
- //
62
- // const [fullscreenMode, setFullscreenMode] = React.useState<booleab>(false);
63
- // const [dialogTranslate, setDialogTranslate] = React.useState<{lastX: number, lastY: number}>({lastX: 0, lastY: 0});
64
- //
65
- //
66
- // if(dialogRef.current){
67
- // // Öncelikle ref'i al ve input elemanlarını bul
68
- // const inputElements = dialogRef.current.querySelectorAll("input");
69
- // // Tüm input elemanlarını döngüye al
70
- // inputElements.forEach((input) => {
71
- // console.log(input); // Her bir input elemanını burada işleyebilirsiniz
72
- // // Örneğin, input değerini okuma veya ayarlama
73
- // input.addEventListener('keydown', (e: KeyboardEvent) => e.key === "Enter" && e.preventDefault()); // Değerini boşaltmak için örnek
74
- // input.addEventListener('keyup', (e: KeyboardEvent) => e.key === "Enter" && e.preventDefault()); // Değerini boşaltmak için örnek
75
- // input.addEventListener('keypress', (e: KeyboardEvent) => e.key === "Enter" && e.preventDefault()); // Değerini boşaltmak için örnek
76
- // });
77
- // }
78
- //
79
- //
80
- // console.log('Content:', actions);
81
- //
82
- // const xKey = position.isMultiple ? "left":"marginLeft"
83
- // const yKey = position.isMultiple ? "top":"marginTop"
84
- //
85
- // /**
86
- // * default null
87
- // * eget momoize islemi uygulanmissa read from memory
88
- // * */
89
- // const bounds = baseOptions.memoBounds;
90
- //
91
- // // console.log('MAIN DOM', window.getComputedStyle(this.props.dom).zIndex);
92
- // const domZIndex = window.getComputedStyle(dom).zIndex;
93
- //
94
- //
95
- // // Burda kaldik
96
- //
97
- // return <Draggable
98
- // disabled={!baseOptions.draggable || fullscreenMode}
99
- // axis={'both'}
100
- // handle={baseOptions.draggable ? '.drag-handle' : ''}
101
- // scale={1}
102
- // ref={backdropRef}
103
- // onDrag={(event, data) => {
104
- // event.stopPropagation();
105
- // setDialogTranslate({lastX: data.lastX, lastY: data.lastY})
106
- // }}
107
- // onStop={(event, data) => {
108
- // event.stopPropagation();
109
- // event.preventDefault();
110
- //
111
- // console.log('onDragStop', 'fired');
112
- //
113
- // const {width, height, x, y} = this._dialogRef.current?.getBoundingClientRect()
114
- // setDialogBounds(
115
- // this._dialogOptions.base.id,
116
- // {
117
- // width, height, x, y
118
- // },
119
- // this._dialogRef
120
- // );
121
- // }}
122
- // >
123
- // <div
124
- // id={"dialog-main"}
125
- // ref={this._dialogRef}
126
- // onClick={e => {
127
- // e.stopPropagation()
128
- // }}
129
- // onKeyDown={e => {
130
- //
131
- // if (typeof this.props.keyboardListener === "function") {
132
- // // @ts-ignore
133
- // this.props.keyboardListener(e.key, this);
134
- // }
135
- // }}
136
- // // className={this._dialogSize.width === 'auto' ? 'auto' : `dialog-width-${this._dialogSize.width} dialog-main show-opacity show-position-${this._dialogOptions.base.initialAnchor.vertical}`}
137
- // className={this._dialogOptions.base.size.width === 'auto' ? 'auto' : `dialog-width-${this._dialogOptions.base.size.width} dialog-main show-opacity show-position-${this._dialogOptions.base.initialAnchor.vertical}`}
138
- // style={{
139
- //
140
- // alignSelf: this._dialogOptions.base.initialAnchor.vertical,
141
- // height: this._dialogOptions.base.size.height ?? 'auto',
142
- // ...typeof this._dialogOptions.base.size.width === "number" ? {width: this._dialogOptions.base.size.width} : null,
143
- // outline: 'none',
144
- // [yKey]: this.dialogPosFromMultipleDialogs.top + 'px',
145
- // [xKey]: this.dialogPosFromMultipleDialogs.left + 'px',
146
- // //...this._Resizeable ? {width: this._Resizeable.width } : null,
147
- // // ...this._Resizeable ? {height: this._Resizeable.height } : null,
148
- // ...this._dialogOptions.base.style,
149
- // fontFamily: this._fontFamily,
150
- //
151
- // // overwrite
152
- // ...bounds ? {position: 'absolute', top: bounds.y, left: bounds.x, width: bounds.width, height: bounds.height} : null
153
- //
154
- // }}
155
- // >
156
- // <WithSnackbar snackbarRef={this._snackbarRef} maxSnack={this._dialogOptions.snackbar.maxSnack} >
157
- // { (this._header || this._dialogOptions.slot.header) && this.Header(header)}
158
- // {this.Body(body)}
159
- // {/*{this.Footer(actions)}*/}
160
- // <this.Footer ref={this._footeRef} actions={actions} />
161
- // </WithSnackbar>
162
- //
163
- // {
164
- // (this._dialogOptions.base.resizeable) &&
165
- // <React.Fragment>
166
- // <div className="resizable-handle" style={{
167
- // zIndex: parseInt(domZIndex) + 1
168
- // }}
169
- // onMouseDown={this._Resizeable?.resizeHandleMouseDown}
170
- // >
171
- // <ResizeIcon color={'#286e94'} />
172
- // </div>
173
- //
174
- // </React.Fragment>
175
- // }
176
- //
177
- // </div>
178
- //
179
- //
180
- // </Draggable>
181
- // }
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __importDefault = (this && this.__importDefault) || function (mod) {
47
+ return (mod && mod.__esModule) ? mod : { "default": mod };
48
+ };
49
+ var _this = this;
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.DialogContent = void 0;
52
+ var jsx_runtime_1 = require("react/jsx-runtime");
53
+ var react_draggable_1 = __importDefault(require("react-draggable"));
54
+ var helpers_1 = require("../helpers");
55
+ var React = __importStar(require("react"));
56
+ var ResizeIcon_1 = __importDefault(require("./icons/ResizeIcon"));
57
+ var notistack_1 = require("notistack");
58
+ var DialogContentHeader_1 = require("./DialogContentHeader");
59
+ var DialogContentBody_1 = require("./DialogContentBody");
60
+ var DialogContenFooter_1 = require("./DialogContenFooter");
61
+ var WithSnackbar = function (props) {
62
+ return (0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, { ref: props.snackbarRef, maxSnack: props.maxSnack, children: props.children });
63
+ };
64
+ var dialogAutoPos = function () {
65
+ var nodes = Array.from(document.querySelectorAll('.appinsource-dialog-root'));
66
+ if (nodes.length > 1) {
67
+ var lastDialog = nodes[nodes.length - 2];
68
+ var dialogMain = lastDialog.querySelector('#dialog-main');
69
+ return {
70
+ top: (dialogMain === null || dialogMain === void 0 ? void 0 : dialogMain.getBoundingClientRect().top) + 10,
71
+ left: (dialogMain === null || dialogMain === void 0 ? void 0 : dialogMain.getBoundingClientRect().left) + 10,
72
+ isMultiple: true
73
+ };
74
+ }
75
+ return { top: 0, left: 0, isMultiple: false };
76
+ };
77
+ var DialogContent = function (_a) {
78
+ var _b;
79
+ var _c, _d, _e;
80
+ var body = _a.body, header = _a.header, actions = _a.actions, dialogRef = _a.dialogRef, footerRef = _a.footerRef, dialogOptions = _a.dialogOptions, dom = _a.dom, backdropRef = _a.backdropRef, keyboardListener = _a.keyboardListener, resizeHandleMouseDown = _a.resizeHandleMouseDown, dialog = _a.dialog;
81
+ var position = dialogAutoPos();
82
+ var snackbarRef = React.useRef(null);
83
+ var _f = React.useState(false), fullscreenMode = _f[0], setFullscreenMode = _f[1];
84
+ var baseOptions = dialogOptions.base;
85
+ if (dialogRef.current) {
86
+ // Öncelikle ref'i al ve input elemanlarını bul
87
+ var inputElements = dialogRef.current.querySelectorAll("input");
88
+ // Tüm input elemanlarını döngüye al
89
+ inputElements.forEach(function (input) {
90
+ console.log(input); // Her bir input elemanını burada işleyebilirsiniz
91
+ // Örneğin, input değerini okuma veya ayarlama
92
+ input.addEventListener('keydown', function (e) { return e.key === "Enter" && e.preventDefault(); }); // Değerini boşaltmak için örnek
93
+ input.addEventListener('keyup', function (e) { return e.key === "Enter" && e.preventDefault(); }); // Değerini boşaltmak için örnek
94
+ input.addEventListener('keypress', function (e) { return e.key === "Enter" && e.preventDefault(); }); // Değerini boşaltmak için örnek
95
+ });
96
+ }
97
+ var xKey = position.isMultiple ? "left" : "marginLeft";
98
+ var yKey = position.isMultiple ? "top" : "marginTop";
99
+ /**
100
+ * default null
101
+ * eget momoize islemi uygulanmissa read from memory
102
+ * */
103
+ var base = dialogOptions.base;
104
+ var bounds = ((_c = dialogOptions.base) === null || _c === void 0 ? void 0 : _c.memoBounds) ? (0, helpers_1.getDialogBounds)(base) : null;
105
+ // console.log('MAIN DOM', window.getComputedStyle(this.props.dom).zIndex);
106
+ var domZIndex = window.getComputedStyle(dialog.getDom()).zIndex;
107
+ // Burda kaldik
108
+ return (0, jsx_runtime_1.jsx)(react_draggable_1.default, { disabled: !baseOptions.draggable || fullscreenMode, axis: 'both', handle: baseOptions.draggable ? '.drag-handle' : '', scale: 1, ref: backdropRef, onDrag: function (event, data) {
109
+ event.stopPropagation();
110
+ dialog._dialogTranslate = { lastX: data.lastX, lastY: data.lastY };
111
+ }, onStop: function (event, data) {
112
+ var _a;
113
+ event.stopPropagation();
114
+ event.preventDefault();
115
+ console.log('onDragStop', 'fired');
116
+ var _b = (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(), width = _b.width, height = _b.height, x = _b.x, y = _b.y;
117
+ (0, helpers_1.setDialogBounds)(dialogOptions.base.id, {
118
+ width: width,
119
+ height: height,
120
+ x: x,
121
+ y: y
122
+ }, dialogRef);
123
+ }, children: (0, jsx_runtime_1.jsxs)("div", { id: "dialog-main", ref: dialogRef, onClick: function (e) {
124
+ e.stopPropagation();
125
+ }, onKeyDown: function (e) {
126
+ if (typeof keyboardListener === "function") {
127
+ // @ts-ignore
128
+ keyboardListener(e.key, _this);
129
+ }
130
+ },
131
+ // className={this._dialogSize.width === 'auto' ? 'auto' : `dialog-width-${this._dialogSize.width} dialog-main show-opacity show-position-${this._dialogOptions.base.initialAnchor.vertical}`}
132
+ className: baseOptions.size.width === 'auto' ? 'auto' : "dialog-width-".concat(dialogOptions.base.size.width, " dialog-main show-opacity show-position-").concat(baseOptions.initialAnchor.vertical), style: __assign(__assign(__assign(__assign(__assign({ alignSelf: baseOptions.initialAnchor.vertical, height: (_d = baseOptions.size.height) !== null && _d !== void 0 ? _d : 'auto' }, typeof baseOptions.size.width === "number" ? { width: baseOptions.size.width } : null), (_b = { outline: 'none' }, _b[yKey] = position.top + 'px', _b[xKey] = position.left + 'px', _b)), baseOptions.style), { fontFamily: (_e = baseOptions.style.fontFamily) !== null && _e !== void 0 ? _e : 'Arial' }), bounds ? { position: 'absolute', top: bounds.y, left: bounds.x, width: bounds.width, height: bounds.height } : null), children: [(0, jsx_runtime_1.jsxs)(WithSnackbar, { snackbarRef: snackbarRef, maxSnack: dialogOptions.snackbar.maxSnack, children: [(header || dialogOptions.slot.header) && (0, jsx_runtime_1.jsx)(DialogContentHeader_1.DialogContentHeader, { header: header,
133
+ // dialogOptions={dialogOptions}
134
+ dialog: dialog }), (0, jsx_runtime_1.jsx)(DialogContentBody_1.DialogContentBody, { dialog: dialog, body: body }), (0, jsx_runtime_1.jsx)(DialogContenFooter_1.DialogContentFooter, { dialog: dialog, ref: footerRef, actions: actions })] }), (baseOptions.resizeable) &&
135
+ (0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "resizable-handle", style: {
136
+ zIndex: parseInt(domZIndex) + 1
137
+ }, onMouseDown: resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(ResizeIcon_1.default, { color: '#286e94' }) }) })] }) });
138
+ };
139
+ exports.DialogContent = DialogContent;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { TDialogCallbackNodeFn } from "../types/DialogTypes";
3
+ import DialogBase from "./DialogBase";
4
+ interface IContentBodyProps {
5
+ body: TDialogCallbackNodeFn;
6
+ dialog: DialogBase<any>;
7
+ }
8
+ declare const DialogContentBody: React.FC<IContentBodyProps>;
9
+ export { DialogContentBody };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DialogContentBody = void 0;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var Placeholder = function (_a) {
6
+ var dialogOptions = _a.dialogOptions, placeholder = _a.placeholder;
7
+ var bgColor = dialogOptions.base.style.backgroundColor ?
8
+ dialogOptions.base.style.backgroundColor : "#FFFFFF";
9
+ var bg = dialogOptions.base.style.background ?
10
+ dialogOptions.base.style.background : "#FFFFFF";
11
+ return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-content-placeholder', style: {
12
+ backgroundColor: bgColor,
13
+ background: bg,
14
+ display: placeholder ? 'flex' : 'none',
15
+ }, children: placeholder });
16
+ };
17
+ var DialogContentBody = function (_a) {
18
+ var body = _a.body, dialog = _a.dialog;
19
+ if (body instanceof Function) {
20
+ return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-body', style: { height: '100%' }, children: [dialog.holder && (0, jsx_runtime_1.jsx)(Placeholder, { dialogOptions: dialog.dialogOptions, placeholder: dialog.holder }), body(dialog)] });
21
+ }
22
+ return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-body', style: { height: '100%', padding: 10 }, children: dialog.holder ?
23
+ // this.Placeholder(this._holder)
24
+ (0, jsx_runtime_1.jsx)(Placeholder, { dialogOptions: dialog.dialogOptions, placeholder: dialog.holder })
25
+ :
26
+ //@ts-ignore
27
+ body });
28
+ };
29
+ exports.DialogContentBody = DialogContentBody;
@@ -0,0 +1,9 @@
1
+ import { TDialogCallbackNodeFn } from "../types/DialogTypes";
2
+ import * as React from "react";
3
+ import DialogBase from "./DialogBase";
4
+ interface IContentHeaderProps {
5
+ header: TDialogCallbackNodeFn;
6
+ dialog: DialogBase<any>;
7
+ }
8
+ declare const DialogContentHeader: React.FC<IContentHeaderProps>;
9
+ export { DialogContentHeader };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var _this = this;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DialogContentHeader = void 0;
16
+ var jsx_runtime_1 = require("react/jsx-runtime");
17
+ var Futures_1 = require("./Futures");
18
+ var DialogBase_1 = require("./DialogBase");
19
+ var DialogContentHeader = function (_a) {
20
+ var _b, _c, _d, _e;
21
+ var header = _a.header, dialog = _a.dialog;
22
+ var state = dialog.state, dialogOptions = dialog.dialogOptions;
23
+ console.log('DialogContentHeader', dialog);
24
+ var baseOptions = dialogOptions.base;
25
+ var CustomHeader = (_b = dialogOptions.slot) === null || _b === void 0 ? void 0 : _b.header;
26
+ var staticProps = {
27
+ dialogValues: state.values,
28
+ dialogOptions: dialogOptions,
29
+ dialog: dialog
30
+ };
31
+ var headerProps = {};
32
+ if (dialogOptions.slotProps.header) {
33
+ headerProps = dialogOptions.slotProps.header(staticProps);
34
+ }
35
+ if (dialogOptions.slot.header) {
36
+ return (0, jsx_runtime_1.jsx)("div", { onDoubleClick: function (event) {
37
+ var _a;
38
+ if ((_a = dialog === null || dialog === void 0 ? void 0 : dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.fullscreen) {
39
+ dialog.switchFullScreen();
40
+ }
41
+ }, style: (_c = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _c === void 0 ? void 0 : _c.style, className: "dialog-header ".concat(baseOptions.draggable && !dialog.state.fullscreenMode ? 'drag-handle' : ''), children: (0, jsx_runtime_1.jsx)(DialogBase_1.WithHeaderFooterContext, { children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this })) }) });
42
+ }
43
+ if (header instanceof Function) {
44
+ return (0, jsx_runtime_1.jsxs)("div", { onDoubleClick: function (event) {
45
+ if (baseOptions.fullscreen) {
46
+ dialog.switchFullScreen();
47
+ }
48
+ }, style: (_d = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _d === void 0 ? void 0 : _d.style, className: "dialog-header ".concat(baseOptions.draggable && !dialog.state.fullscreenMode ? 'drag-handle' : ''), children: [header(dialog), (baseOptions.closeable || baseOptions.fullscreen) &&
49
+ (0, jsx_runtime_1.jsx)(DialogBase_1.WithHeaderFooterContext, { dialog: dialog, children: (0, jsx_runtime_1.jsxs)(Futures_1.DialogHeaderActionsWrapper, { children: [baseOptions.fullscreen &&
50
+ (0, jsx_runtime_1.jsx)(Futures_1.DialogFullscreenAction, {}), baseOptions.closeable &&
51
+ (0, jsx_runtime_1.jsx)(Futures_1.DialogCloseAction, {})] }) })] });
52
+ }
53
+ return (0, jsx_runtime_1.jsx)("div", { style: (_e = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _e === void 0 ? void 0 : _e.style, className: 'drag-handle dialog-header', children: header });
54
+ };
55
+ exports.DialogContentHeader = DialogContentHeader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.41",
3
+ "version": "1.1.42",
4
4
  "description": "This package is a continuation of the react-araci package. Due to an error, react-araci was removed, and it has been decided to continue under the new package name react-dialogger",
5
5
  "main": "index.js",
6
6
  "author": "Sueleyman Topaloglu",