react-dialogger 1.1.51 → 1.1.52

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.
@@ -38,6 +38,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
38
38
  private readonly _dialogWithBackDropRef;
39
39
  protected readonly _parent: Dialog;
40
40
  private _accessFrom;
41
+ private _processingListener;
41
42
  constructor(props?: Readonly<BaseDialogProps>);
42
43
  get parent(): Dialog;
43
44
  get dialogTranslate(): {
@@ -66,6 +67,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
66
67
  [key: string]: Pick<DialogActionBase, "setOptions" | "setInProcess" | "getLabel" | "options" | "click" | "remove" | "name">;
67
68
  };
68
69
  updateBody(body: TDialogCallbackFn): void;
70
+ processingListener(listener: (inProcess: boolean) => void): this;
69
71
  getDom: () => HTMLDivElement;
70
72
  get snackbar(): {
71
73
  open: (message: string, severity: TSeverity, key?: string, action?: ((key: string, snackbarRef: any) => ReactNode | void), autoHideDuration?: number | null) => void;
@@ -126,6 +126,9 @@ var DialogBase = /** @class */ (function (_super) {
126
126
  if (!process) {
127
127
  _this.snackbar.close("kInProcess");
128
128
  }
129
+ if (typeof _this._processingListener === "function") {
130
+ _this._processingListener(process);
131
+ }
129
132
  // @ts-ignore
130
133
  (_c = _this._footerRef.current) === null || _c === void 0 ? void 0 : _c.setProcessing(process);
131
134
  return _this;
@@ -219,6 +222,7 @@ var DialogBase = /** @class */ (function (_super) {
219
222
  _this._initialValues = props.initialValues;
220
223
  _this._dialogWithBackDropRef = (0, react_1.createRef)();
221
224
  _this._parent = props.parent;
225
+ _this._processingListener = props.processingListener;
222
226
  console.log('this._dialogOptions', _this._dialogOptions);
223
227
  return _this;
224
228
  }
@@ -397,6 +401,11 @@ var DialogBase = /** @class */ (function (_super) {
397
401
  var _this = this;
398
402
  this.setState(function (prevState) { return (__assign(__assign({}, _this.state), { body: body })); });
399
403
  };
404
+ DialogBase.prototype.processingListener = function (listener) {
405
+ // @ts-ignore
406
+ this._processingListener = listener;
407
+ return this;
408
+ };
400
409
  Object.defineProperty(DialogBase.prototype, "snackbar", {
401
410
  // Reference: https://notistack.com/api-reference#mutual-props
402
411
  get: function () {
package/models/Dialog.js CHANGED
@@ -150,7 +150,7 @@ var Dialog = /** @class */ (function () {
150
150
  // Refs
151
151
  headerRef: this._headerRef,
152
152
  // Listeners
153
- stateListener: this._stateListener, keyboardListener: this._keyboardListener, resizeListener: this._resizeListener,
153
+ stateListener: this._stateListener, keyboardListener: this._keyboardListener, resizeListener: this._resizeListener, processingListener: this._processingListener,
154
154
  // Others
155
155
  dialogSize: this._dialogSize, initialHolder: this._initialHolder, snackbarAnchor: this._snackbarAnchor, root: root, dom: dom, parent: this }, this._apiRef ? { ref: this._apiRef } : null), { onClose: this._onCloseCallback });
156
156
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.51",
3
+ "version": "1.1.52",
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",
@@ -37,6 +37,7 @@ export interface BaseDialogProps {
37
37
  root?: any;
38
38
  keyboardListener: (key: string, dialog: IDialogApiDef) => void;
39
39
  resizeListener?: (size: IDialogSize, dialog: IDialogApiDef) => void;
40
+ processingListener?: (inProcess: boolean) => void;
40
41
  }
41
42
  export interface IDialogSize {
42
43
  width?: ITypeWidth | number;
@@ -120,13 +121,13 @@ export interface BaseDialogSlotProps {
120
121
  }
121
122
  export interface IStateDef extends Pick<BaseDialogState, "values" | "fullscreenMode" | "inProcess"> {
122
123
  }
123
- export interface IListenerDialogDef extends Omit<IDialogApiDef, "state" | "values" | "setValues"> {
124
+ export interface IListenerDialogDef extends Omit<IDialogApiDef, "values" | "setValues"> {
124
125
  }
125
126
  export type TDialogStateListenerCallbackType = (values: FormikProps<any>['values'], dialog: IListenerDialogDef) => void;
126
127
  export type TDialogCallbackFn<T = React.ReactNode> = (dialog: IDialogApiDef) => T;
127
128
  export type TDialogHeader = TDialogCallbackFn | React.ReactNode | React.JSX.Element;
128
129
  export type TDialogCallbackVoidFn = TDialogCallbackFn<void>;
129
- export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'updateBody'> {
130
+ export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'updateBody' | 'processingListener'> {
130
131
  }
131
132
  export interface IDialogCloseRef extends Pick<DialogBase<any>, 'close'> {
132
133
  }