react-dialogger 1.1.118 → 1.1.120

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.
@@ -22,7 +22,7 @@ declare class DialogBase<V, I> extends Component<BaseDialogProps<V, I>, BaseDial
22
22
  protected _formikProps: FormikProps<any>;
23
23
  protected readonly _backdropRef: RefObject<any>;
24
24
  protected readonly _dialogRef: RefObject<any>;
25
- protected readonly _dialogBodyRef: RefObject<any>;
25
+ protected readonly _bodyRef: RefObject<any>;
26
26
  protected readonly _snackbarRef: WithBackdrop['snackbarRef'];
27
27
  protected _dialogOptions?: DialogOptionsType;
28
28
  protected _onClose: TDialogCallbackFn<V, I, void>;
@@ -132,7 +132,7 @@ var DialogBase = /** @class */ (function (_super) {
132
132
  // @ts-ignore
133
133
  (_k = _this._footerRef.current) === null || _k === void 0 ? void 0 : _k.setProcessing(_this._inProcess);
134
134
  (_l = _this._headerRef.current) === null || _l === void 0 ? void 0 : _l.setProcessing(_this._inProcess);
135
- // this._footerRef.current?.setProcessing(process);
135
+ // this._bodyRef.current?.setProcessing(this._inProcess);
136
136
  return _this;
137
137
  };
138
138
  _this.isInProcess = function () {
@@ -191,7 +191,7 @@ var DialogBase = /** @class */ (function (_super) {
191
191
  // Component
192
192
  body: _this.state.body,
193
193
  // Refs Props
194
- dialogRef: _this._dialogRef, headerRef: _this._headerRef, bodyRef: _this._dialogBodyRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, snackbarRef: _this._snackbarRef, prevDialogRect: _this.state.prevDialogRect, children: (0, jsx_runtime_1.jsx)(_components_1.DialogWithBackdropWrapper, {}) });
194
+ dialogRef: _this._dialogRef, headerRef: _this._headerRef, bodyRef: _this._bodyRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, snackbarRef: _this._snackbarRef, prevDialogRect: _this.state.prevDialogRect, children: (0, jsx_runtime_1.jsx)(_components_1.DialogWithBackdropWrapper, {}) });
195
195
  };
196
196
  // this.inject(props.inject);
197
197
  _this.state = {
@@ -235,7 +235,7 @@ var DialogBase = /** @class */ (function (_super) {
235
235
  _this._actions = props.actions;
236
236
  _this._backdropRef = React.createRef();
237
237
  _this._dialogRef = React.createRef();
238
- _this._dialogBodyRef = React.createRef();
238
+ _this._bodyRef = React.createRef();
239
239
  _this._inProcess = { inProcess: false };
240
240
  _this._snackbarRef = React.createRef();
241
241
  _this._holder = props.initialHolder;
@@ -74,7 +74,7 @@ var appLogger_1 = require("../helpers/appLogger");
74
74
  var DialogContent = function (props) {
75
75
  var _a, _b, _c, _d, _e, _f, _g;
76
76
  var firstUpdate = React.useRef(true);
77
- var _h = (0, react_1.useContext)(_context_1.DialogContentContext), dialog = _h.dialog, dialogRef = _h.dialogRef, prevDialogRect = _h.prevDialogRect, backdropRef = _h.backdropRef, snackbarRef = _h.snackbarRef, footerRef = _h.footerRef, headerRef = _h.headerRef, resizeableObject = _h.resizeableObject, body = _h.body;
77
+ var _h = (0, react_1.useContext)(_context_1.DialogContentContext), dialog = _h.dialog, dialogRef = _h.dialogRef, prevDialogRect = _h.prevDialogRect, backdropRef = _h.backdropRef, snackbarRef = _h.snackbarRef, footerRef = _h.footerRef, bodyRef = _h.bodyRef, headerRef = _h.headerRef, resizeableObject = _h.resizeableObject, body = _h.body;
78
78
  var dialogOptions = dialog.dialogOptions;
79
79
  var baseOptions = dialogOptions.base;
80
80
  var _j = React.useState(false), fullscreenMode = _j[0], setFullscreenMode = _j[1];
@@ -177,7 +177,7 @@ var DialogContent = function (props) {
177
177
  // @ts-ignore
178
178
  dialog.props.keyboardListener(e.key, _this);
179
179
  }
180
- }, 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({ height: (_b = baseOptions.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof baseOptions.size.width === "number" ? { width: "".concat(baseOptions.size.width, "px") } : { width: "".concat(baseOptions.size.width) }), { outline: 'none', fontFamily: (_c = baseOptions.style.fontFamily) !== null && _c !== void 0 ? _c : 'Arial' }), rect), { alignSelf: (_d = baseOptions.initialAnchor.vertical) !== null && _d !== void 0 ? _d : 'flex-start', justifySelf: (_e = baseOptions.initialAnchor.horizontal) !== null && _e !== void 0 ? _e : 'flex-start' }), children: (0, jsx_runtime_1.jsxs)(notistack_1.SnackbarProvider, { ref: snackbarRef, maxSnack: dialog.dialogOptions.snackbar.maxSnack, style: __assign({ width: 'min-content' }, (_g = (_f = dialog.dialogOptions) === null || _f === void 0 ? void 0 : _f.snackbar) === null || _g === void 0 ? void 0 : _g.style), children: [(dialog.props.header || dialogOptions.slot.header) && ((0, jsx_runtime_1.jsx)(_1.DialogContentHeader, { ref: headerRef, header: dialog.props.header, bounds: bounds })), (0, jsx_runtime_1.jsx)(_1.DialogContentBody, { body: body }), (0, jsx_runtime_1.jsx)(_1.DialogContentFooter, { ref: footerRef }), (baseOptions.resizeable) &&
180
+ }, 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({ height: (_b = baseOptions.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof baseOptions.size.width === "number" ? { width: "".concat(baseOptions.size.width, "px") } : { width: "".concat(baseOptions.size.width) }), { outline: 'none', fontFamily: (_c = baseOptions.style.fontFamily) !== null && _c !== void 0 ? _c : 'Arial' }), rect), { alignSelf: (_d = baseOptions.initialAnchor.vertical) !== null && _d !== void 0 ? _d : 'flex-start', justifySelf: (_e = baseOptions.initialAnchor.horizontal) !== null && _e !== void 0 ? _e : 'flex-start' }), children: (0, jsx_runtime_1.jsxs)(notistack_1.SnackbarProvider, { ref: snackbarRef, maxSnack: dialog.dialogOptions.snackbar.maxSnack, style: __assign({ width: 'min-content' }, (_g = (_f = dialog.dialogOptions) === null || _f === void 0 ? void 0 : _f.snackbar) === null || _g === void 0 ? void 0 : _g.style), children: [(dialog.props.header || dialogOptions.slot.header) && ((0, jsx_runtime_1.jsx)(_1.DialogContentHeader, { ref: headerRef, header: dialog.props.header, bounds: bounds })), (0, jsx_runtime_1.jsx)(_1.DialogContentBody, { ref: bodyRef, body: body }), (0, jsx_runtime_1.jsx)(_1.DialogContentFooter, { ref: footerRef }), (baseOptions.resizeable) &&
181
181
  (0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "resizable-handle", style: {
182
182
  zIndex: parseInt(domZIndex) + 1
183
183
  }, onMouseDown: resizeableObject === null || resizeableObject === void 0 ? void 0 : resizeableObject.resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(_icons_1.ResizeIcon, { color: '#286e94' }) }) })] }) }) });
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- import { TDialogCallbackFn } from "../types/index.js";
2
+ import { DialogContentBodyReturnType, TDialogCallbackFn } from "../types/index.js";
3
3
  interface IContentBodyProps {
4
4
  body: TDialogCallbackFn<any, any>;
5
5
  }
6
- declare const DialogContentBody: React.FC<IContentBodyProps>;
6
+ declare const DialogContentBody: React.ForwardRefExoticComponent<IContentBodyProps & React.RefAttributes<DialogContentBodyReturnType>>;
7
7
  export { DialogContentBody };
@@ -50,9 +50,23 @@ var Placeholder = function (_a) {
50
50
  display: placeholder ? 'flex' : 'none',
51
51
  }, children: placeholder });
52
52
  };
53
+ // const DialogContentBody: React.FC<IContentBodyProps> = React.forwardRef(({
54
+ // body
55
+ // }, ref ) => {
53
56
  var DialogContentBody = React.forwardRef(function (_a, ref) {
54
57
  var body = _a.body;
55
58
  var dialog = (0, react_1.useContext)(_context_1.DialogContentContext).dialog;
59
+ // Imperative handle
60
+ var _b = React.useState({
61
+ inProcess: false
62
+ }), inProcess = _b[0], setInProcess = _b[1];
63
+ var setProcessing = function (processing) {
64
+ setInProcess(processing);
65
+ };
66
+ React.useImperativeHandle(ref, function () { return ({
67
+ setProcessing: setProcessing,
68
+ inProcess: inProcess
69
+ }); });
56
70
  if (body instanceof Function) {
57
71
  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)] });
58
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.118",
3
+ "version": "1.1.120",
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",
@@ -52,6 +52,10 @@ export interface BaseDialogProps<V extends Record<string, any>, I> {
52
52
  processingListeners?: Array<(inProcess: boolean) => void>;
53
53
  abortedListeners?: Array<(dialog: IDialogApiDef<V, I>) => void>;
54
54
  }
55
+ export interface DialogContentBodyReturnType {
56
+ setProcessing: React.Dispatch<React.SetStateAction<InProcessType>>;
57
+ inProcess: InProcessType;
58
+ }
55
59
  export interface IDialogSize {
56
60
  width?: ITypeWidth | number;
57
61
  height?: ITypeHeight | number;
@@ -212,6 +216,7 @@ export interface IContentProps {
212
216
  snackbarRef: WithBackdrop['snackbarRef'];
213
217
  }
214
218
  import { TSnackbarHorizontal, TSnackbarVertical, TFlexPos } from "./SizePosTypes";
219
+ import { InProcessType } from "./DialogActionTypes";
215
220
  export interface ISnackbarAnchor {
216
221
  vertical?: TSnackbarVertical;
217
222
  horizontal?: TSnackbarHorizontal;