react-dialogger 1.1.27 → 1.1.29

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;
@@ -235,6 +235,8 @@ var DialogBase = /** @class */ (function (_super) {
235
235
  _this.isInProcess = function () {
236
236
  // return this.state.inProcess;
237
237
  return _this._inProcess;
238
+ // @ts-ignore
239
+ // return this._footeRef?.current?.inProcess ?? false;
238
240
  };
239
241
  _this.close = function (callbackFn) {
240
242
  var _a;
@@ -466,8 +468,13 @@ var DialogBase = /** @class */ (function (_super) {
466
468
  setInProcess(inProcess);
467
469
  };
468
470
  React.useImperativeHandle(ref, function () { return ({
469
- setProcessing: setProcessing
471
+ setProcessing: setProcessing,
472
+ inProcess: inProcess
470
473
  }); });
474
+ // console.log('processingListener', this._processingListener);
475
+ if (typeof _this._processingListener === "function") {
476
+ _this._processingListener(inProcess);
477
+ }
471
478
  var staticProps = {
472
479
  dialogValues: _this.state.values,
473
480
  dialogOptions: _this._dialogOptions,
@@ -821,11 +828,16 @@ var DialogBase = /** @class */ (function (_super) {
821
828
  var _this = this;
822
829
  var prevState = this.state;
823
830
  _super.prototype.setState.call(this, state, function () {
824
- var _a;
825
831
  // if( typeof this.props.stateListener === "function" && JSON.stringify(prevState) !== JSON.stringify(state) ){
832
+ var _a;
833
+ // Outer State Listener
826
834
  if (typeof _this.props.stateListener === "function" && !(0, lodash_isequal_1.default)(prevState, state)) {
827
835
  _this.props.stateListener(_this.state, _this.state.values, _this);
828
836
  }
837
+ // Inner State Listener
838
+ if (typeof _this._stateListener === "function" && !(0, lodash_isequal_1.default)(prevState, state)) {
839
+ _this._stateListener(_this.state, _this.state.values, _this);
840
+ }
829
841
  for (var actionKey in _this._actionRefs) {
830
842
  var action = _this._actionRefs[actionKey];
831
843
  if (typeof action.current._stateListener === "function") {
@@ -881,6 +893,11 @@ var DialogBase = /** @class */ (function (_super) {
881
893
  this._resizeListener = listener;
882
894
  return this;
883
895
  };
896
+ DialogBase.prototype.processingListener = function (listener) {
897
+ // @ts-ignore
898
+ this._processingListener = listener;
899
+ return this;
900
+ };
884
901
  DialogBase.prototype.initialHolder = function (holder) {
885
902
  this._initialHolder = holder;
886
903
  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.29",
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. */