react-dialogger 1.1.50 → 1.1.51

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.
@@ -42,6 +42,8 @@ declare class DialogActionBase extends Component<ActionProps, ActionState> {
42
42
  * @deprecated
43
43
  * @see use isDisabled */
44
44
  getDisabled: () => boolean;
45
+ /**
46
+ * @deprecated use Options*/
45
47
  isDisabled: () => boolean;
46
48
  setInProcess: (inProcess: boolean) => DialogActionBase;
47
49
  isInProcess: () => boolean;
@@ -121,6 +121,8 @@ var DialogActionBase = /** @class */ (function (_super) {
121
121
  _this.getDisabled = function () {
122
122
  return _this._options.disabled;
123
123
  };
124
+ /**
125
+ * @deprecated use Options*/
124
126
  _this.isDisabled = function () {
125
127
  return _this._options.disabled;
126
128
  };
@@ -63,8 +63,9 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
63
63
  close: (callbackFn?: () => void) => void;
64
64
  focus: () => void;
65
65
  get actions(): {
66
- [key: string]: Pick<DialogActionBase, "setOptions" | "setInProcess" | "getLabel" | "options" | "click" | "remove">;
66
+ [key: string]: Pick<DialogActionBase, "setOptions" | "setInProcess" | "getLabel" | "options" | "click" | "remove" | "name">;
67
67
  };
68
+ updateBody(body: TDialogCallbackFn): void;
68
69
  getDom: () => HTMLDivElement;
69
70
  get snackbar(): {
70
71
  open: (message: string, severity: TSeverity, key?: string, action?: ((key: string, snackbarRef: any) => ReactNode | void), autoHideDuration?: number | null) => void;
@@ -166,13 +166,14 @@ var DialogBase = /** @class */ (function (_super) {
166
166
  console.log('this._prevDialogRect', _this.state.prevDialogRect);
167
167
  return (0, jsx_runtime_1.jsx)(_1.DialogWithBackdropWrapper, { initialValues: _this.props.initialValues, dialog: _this,
168
168
  // Component
169
- header: _this.props.header, body: _this.props.body, actions: _this.props.actions,
169
+ header: _this.props.header, body: _this.state.body, actions: _this.props.actions,
170
170
  // Refs Props
171
171
  ref: _this._dialogWithBackDropRef, dialogRef: _this._dialogRef, headerRef: _this._headerRef, bodyRef: _this._dialogBodyRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, snackbarRef: _this._snackbarRef, prevDialogRect: _this.state.prevDialogRect });
172
172
  };
173
173
  _this.state = {
174
174
  inProcess: { inProcess: false },
175
- prevDialogRect: (0, dialogRectAuto_1.dialogRectAuto)()
175
+ prevDialogRect: (0, dialogRectAuto_1.dialogRectAuto)(),
176
+ body: props.body
176
177
  };
177
178
  console.log('Class_Type', _this instanceof DialogBase);
178
179
  var defaultOptions = {
@@ -392,6 +393,10 @@ var DialogBase = /** @class */ (function (_super) {
392
393
  enumerable: false,
393
394
  configurable: true
394
395
  });
396
+ DialogBase.prototype.updateBody = function (body) {
397
+ var _this = this;
398
+ this.setState(function (prevState) { return (__assign(__assign({}, _this.state), { body: body })); });
399
+ };
395
400
  Object.defineProperty(DialogBase.prototype, "snackbar", {
396
401
  // Reference: https://notistack.com/api-reference#mutual-props
397
402
  get: function () {
@@ -49,6 +49,57 @@ var DialogAction = /** @class */ (function (_super) {
49
49
  _super.prototype.onClick.call(_this, callback);
50
50
  return _this;
51
51
  };
52
+ // /**
53
+ // * @deprecated
54
+ // * @see onClickHandler */
55
+ // public getAction(): DialogActionType {
56
+ // return this._onClick;
57
+ // }
58
+ // /**
59
+ // * @deprecated
60
+ // * @see DialogActionOptionsType
61
+ // * @info Define this prop inside new DialogAction('varName', {>here<})*/
62
+ // setVariant = ( variant: TBVariant): this => {
63
+ // if( this._baseDialogAction?.dialogBaseComponent.parent.accessFrom === "internal"){
64
+ // this._baseDialogAction.setVariant(variant);
65
+ // return this;
66
+ // }
67
+ // if (this._options) {
68
+ // this._options.variant = variant; // _options'ın başlatıldığını varsayarak erişim
69
+ // } else {
70
+ // console.error('DialogAction _options is not initialized');
71
+ // }
72
+ // return this;
73
+ // }
74
+ // getVariant = (): TBVariant => {
75
+ // if( this._baseDialogAction?.dialogBaseComponent.parent.accessFrom === "internal"){
76
+ // return this._baseDialogAction.getVariant();
77
+ // }
78
+ // return this._options.variant;
79
+ // }
80
+ // /**
81
+ // * @deprecated
82
+ // * @see DialogActionOptionsType
83
+ // * @info Define this prop inside new DialogAction('varName', {>here<})*/
84
+ // setColor = ( color: TBColor): this => {
85
+ // if( this._baseDialogAction?.dialogBaseComponent.parent.accessFrom === "internal"){
86
+ // this._baseDialogAction.setColor(color);
87
+ // return this;
88
+ // }
89
+ // if (this._options) {
90
+ // this._options.color = color; // _options'ın başlatıldığını varsayarak erişim
91
+ // } else {
92
+ // console.error('DialogAction _options is not initialized');
93
+ // }
94
+ // return this;
95
+ // }
96
+ //
97
+ // getColor = (): TBColor => {
98
+ // if( this._baseDialogAction?.dialogBaseComponent.parent.accessFrom === "internal"){
99
+ // return this._baseDialogAction.getColor();
100
+ // }
101
+ // return this._options.color;
102
+ // }
52
103
  /**
53
104
  * Only from init */
54
105
  _this.stateListener = function (listener) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.50",
3
+ "version": "1.1.51",
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",
@@ -6,8 +6,8 @@ import { CSSProperties } from "react";
6
6
  import * as React from "react";
7
7
  import { DialogAction } from "../models";
8
8
  export type ActionDialogDef = Omit<IDialogApiDef, 'switchFullScreen'>;
9
- export type ActionDef = Pick<DialogAction, 'onClick' | 'setInProcess' | 'getLabel' | 'getColor' | 'getVariant' | 'isDisabled' | 'setOptions' | 'isInProcess' | 'setLabel' | 'name'>;
10
- export type ActionBaseDef = Pick<DialogActionBase, 'setOptions' | 'setInProcess' | 'getLabel' | 'options' | 'click' | 'remove'>;
9
+ export type ActionDef = Pick<DialogAction, 'onClick' | 'setOptions' | 'name'>;
10
+ export type ActionBaseDef = Pick<DialogActionBase, 'setOptions' | 'setInProcess' | 'getLabel' | 'options' | 'click' | 'remove' | 'name'>;
11
11
  export interface IDialogActionDef extends ActionBaseDef {
12
12
  }
13
13
  export type DialogActionType = (button: ActionBaseDef, dialog: Omit<IDialogApiDef, 'switchFullScreen'>) => void;
@@ -18,6 +18,7 @@ export interface BaseDialogState {
18
18
  inProcess: IInProcess;
19
19
  fullscreenMode?: boolean;
20
20
  prevDialogRect: WithBackdrop['prevDialogRect'];
21
+ body: TDialogCallbackFn;
21
22
  }
22
23
  export interface BaseDialogProps {
23
24
  initialOptions?: DialogOptionsType;
@@ -125,7 +126,7 @@ export type TDialogStateListenerCallbackType = (values: FormikProps<any>['values
125
126
  export type TDialogCallbackFn<T = React.ReactNode> = (dialog: IDialogApiDef) => T;
126
127
  export type TDialogHeader = TDialogCallbackFn | React.ReactNode | React.JSX.Element;
127
128
  export type TDialogCallbackVoidFn = TDialogCallbackFn<void>;
128
- export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus'> {
129
+ export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'updateBody'> {
129
130
  }
130
131
  export interface IDialogCloseRef extends Pick<DialogBase<any>, 'close'> {
131
132
  }