react-dialogger 1.1.27 → 1.1.28

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.
@@ -13,6 +13,7 @@ declare class DialogBase extends Component<BaseDialogProps, BaseDialogState> {
13
13
  protected _dom: HTMLDivElement;
14
14
  protected _innerRef: React.RefObject<any>;
15
15
  protected _stateListener: TDialogStateListenerCallbackType;
16
+ protected _processingListener: (inProcess: boolean) => void;
16
17
  protected _keyboardListener: (key: string, dialog: IDialogDef) => void;
17
18
  protected _resizeListener: (size: IDialogSize, dialog: IDialogDef) => void;
18
19
  protected _initialHolder: TInitialHolder;
@@ -91,6 +92,7 @@ declare class DialogBase extends Component<BaseDialogProps, BaseDialogState> {
91
92
  stateListener(listener: TDialogStateListenerCallbackType): DialogBase;
92
93
  protected keyboardListener(listener: (key: string, dialog: IDialogDef) => void): DialogBase;
93
94
  protected resizeListener(listener: (size: IDialogSize, dialog: IDialogDef) => void): DialogBase;
95
+ processingListener(listener: (inProcess: boolean) => void): DialogBase;
94
96
  protected initialHolder(holder: TInitialHolder): DialogBase;
95
97
  protected onClose(callback: TDialogCallbackVoidFn): DialogBase;
96
98
  setInProcess_noRef: (process: boolean, message?: string, holder?: TInitialHolder) => DialogBase;
@@ -233,8 +233,11 @@ var DialogBase = /** @class */ (function (_super) {
233
233
  return _this;
234
234
  };
235
235
  _this.isInProcess = function () {
236
+ var _a, _b, _c;
236
237
  // return this.state.inProcess;
237
- return _this._inProcess;
238
+ // return this._inProcess;
239
+ // @ts-ignore
240
+ return (_c = (_b = (_a = _this._footeRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.inProcess) !== null && _c !== void 0 ? _c : false;
238
241
  };
239
242
  _this.close = function (callbackFn) {
240
243
  var _a;
@@ -466,8 +469,13 @@ var DialogBase = /** @class */ (function (_super) {
466
469
  setInProcess(inProcess);
467
470
  };
468
471
  React.useImperativeHandle(ref, function () { return ({
469
- setProcessing: setProcessing
472
+ setProcessing: setProcessing,
473
+ inProcess: inProcess
470
474
  }); });
475
+ // console.log('processingListener', this._processingListener);
476
+ if (typeof _this._processingListener === "function") {
477
+ _this._processingListener(inProcess);
478
+ }
471
479
  var staticProps = {
472
480
  dialogValues: _this.state.values,
473
481
  dialogOptions: _this._dialogOptions,
@@ -821,11 +829,16 @@ var DialogBase = /** @class */ (function (_super) {
821
829
  var _this = this;
822
830
  var prevState = this.state;
823
831
  _super.prototype.setState.call(this, state, function () {
824
- var _a;
825
832
  // if( typeof this.props.stateListener === "function" && JSON.stringify(prevState) !== JSON.stringify(state) ){
833
+ var _a;
834
+ // Outer State Listener
826
835
  if (typeof _this.props.stateListener === "function" && !(0, lodash_isequal_1.default)(prevState, state)) {
827
836
  _this.props.stateListener(_this.state, _this.state.values, _this);
828
837
  }
838
+ // Inner State Listener
839
+ if (typeof _this._stateListener === "function" && !(0, lodash_isequal_1.default)(prevState, state)) {
840
+ _this._stateListener(_this.state, _this.state.values, _this);
841
+ }
829
842
  for (var actionKey in _this._actionRefs) {
830
843
  var action = _this._actionRefs[actionKey];
831
844
  if (typeof action.current._stateListener === "function") {
@@ -881,6 +894,11 @@ var DialogBase = /** @class */ (function (_super) {
881
894
  this._resizeListener = listener;
882
895
  return this;
883
896
  };
897
+ DialogBase.prototype.processingListener = function (listener) {
898
+ // @ts-ignore
899
+ this._processingListener = listener;
900
+ return this;
901
+ };
884
902
  DialogBase.prototype.initialHolder = function (holder) {
885
903
  this._initialHolder = holder;
886
904
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
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",
@@ -123,7 +123,7 @@ export type TDialogStateListenerCallbackType = (state: IStateDef, values: Dialog
123
123
  type TDialogCallbackFn<T> = (dialog?: IDialogDef) => T;
124
124
  export type TDialogCallbackNodeFn = TDialogCallbackFn<string | React.ReactElement<any>> | React.ReactNode | React.JSX.Element;
125
125
  export type TDialogCallbackVoidFn = TDialogCallbackFn<void>;
126
- export interface IDialogDef extends Omit<Partial<Pick<DialogBase, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'switchFullScreen' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'setOrder' | 'setBody' | 'onResize'>>, 'switchFullScreen'> {
126
+ export interface IDialogDef extends Omit<Partial<Pick<DialogBase, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'switchFullScreen' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'setOrder' | 'setBody' | 'onResize' | 'processingListener'>>, 'switchFullScreen'> {
127
127
  /** @deprecated Deprecated, use setValues instead. */
128
128
  switchFullScreen?: DialogBase['switchFullScreen'];
129
129
  /** @deprecated Deprecated, never use. */