react-dialogger 1.1.43 → 1.1.45

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.
@@ -134,7 +134,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
134
134
  * use outside Content component
135
135
  * */
136
136
  private baseZoomEffect;
137
- private withBackdrop;
137
+ private WithBackdrop;
138
138
  switchFullScreen: () => void;
139
139
  private Placeholder;
140
140
  private Header;
@@ -334,9 +334,11 @@ var DialogBase = /** @class */ (function (_super) {
334
334
  iterations: 1
335
335
  });
336
336
  };
337
- _this.withBackdrop = function (body, header, actions) {
337
+ // private withBackdrop = ( body: TDialogCallbackNodeFn, header: TDialogCallbackNodeFn, actions?: Array<DialogAction> ) => {
338
+ _this.WithBackdrop = function (_a) {
339
+ var body = _a.body, header = _a.header, actions = _a.actions;
338
340
  _this.orderPositionWithReference();
339
- var _a = _this._dialogOptions.backdrop, backgroundColor = _a.backgroundColor, opacity = _a.opacity;
341
+ var _b = _this._dialogOptions.backdrop, backgroundColor = _b.backgroundColor, opacity = _b.opacity;
340
342
  var bgCl = hexToRgb(backgroundColor, opacity);
341
343
  return (0, jsx_runtime_1.jsx)("div", { className: "dialog-backdrop dialog-backdrop-show", ref: _this._backdropRef, style: {
342
344
  justifyContent: _this._dialogOptions.base.initialAnchor.horizontal,
@@ -350,7 +352,7 @@ var DialogBase = /** @class */ (function (_super) {
350
352
  return;
351
353
  }
352
354
  _this.baseZoomEffect();
353
- }, children: (0, jsx_runtime_1.jsx)(DialogContent_1.DialogContent, { body: body, header: header, actions: actions, dialogRef: _this._dialogRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, dialogOptions: _this.dialogOptions, dom: _this._dom, keyboardListener: _this._keyboardListener, dialog: _this }) });
355
+ }, children: (0, jsx_runtime_1.jsx)(DialogContent_1.DialogContent, { body: body, header: header, actions: actions, dialogRef: _this._dialogRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, dialogOptions: _this.dialogOptions, dom: _this._dom, keyboardListener: _this._keyboardListener, dialog: _this, initialValues: _this._initialValues }) });
354
356
  };
355
357
  _this.switchFullScreen = function () {
356
358
  if (!_this.state.fullscreenMode) {
@@ -613,7 +615,8 @@ var DialogBase = /** @class */ (function (_super) {
613
615
  // return this.withBackdrop(this._body, this._header, this._actions)
614
616
  // }
615
617
  _this.render = function () {
616
- return _this.withBackdrop(_this._body, _this._header, _this._actions);
618
+ // return this.withBackdrop(this._body, this._header, this._actions)
619
+ return (0, jsx_runtime_1.jsx)(_this.WithBackdrop, { body: _this._body, header: _this._header, actions: _this._actions });
617
620
  };
618
621
  _this.state = __assign(__assign({}, _this._initialState), { fullscreenMode: false, isResizing: false,
619
622
  /**@deprecated use FormikProps Values*/
@@ -13,6 +13,7 @@ interface IContentProps {
13
13
  dom: HTMLDivElement;
14
14
  keyboardListener: BaseDialogProps['keyboardListener'];
15
15
  dialog: DialogBase<any>;
16
+ initialValues: BaseDialogProps['initialValues'];
16
17
  }
17
18
  declare const DialogContent: React.FC<IContentProps>;
18
19
  export { DialogContent };
@@ -58,6 +58,7 @@ var notistack_1 = require("notistack");
58
58
  var DialogContentHeader_1 = require("./DialogContentHeader");
59
59
  var DialogContentBody_1 = require("./DialogContentBody");
60
60
  var DialogContenFooter_1 = require("./DialogContenFooter");
61
+ var formik_1 = require("formik");
61
62
  var WithSnackbar = function (props) {
62
63
  return (0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, { ref: props.snackbarRef, maxSnack: props.maxSnack, children: props.children });
63
64
  };
@@ -77,11 +78,19 @@ var dialogAutoPos = function () {
77
78
  var DialogContent = function (_a) {
78
79
  var _b;
79
80
  var _c, _d, _e;
80
- var body = _a.body, header = _a.header, actions = _a.actions, dialogRef = _a.dialogRef, footerRef = _a.footerRef, dialogOptions = _a.dialogOptions, dom = _a.dom, backdropRef = _a.backdropRef, keyboardListener = _a.keyboardListener, dialog = _a.dialog;
81
+ var body = _a.body, header = _a.header, actions = _a.actions, dialogRef = _a.dialogRef, footerRef = _a.footerRef, dialogOptions = _a.dialogOptions, dom = _a.dom, backdropRef = _a.backdropRef, keyboardListener = _a.keyboardListener, dialog = _a.dialog, initialValues = _a.initialValues;
81
82
  var position = dialogAutoPos();
82
83
  var snackbarRef = React.useRef(null);
83
84
  var _f = React.useState(false), fullscreenMode = _f[0], setFullscreenMode = _f[1];
84
85
  var baseOptions = dialogOptions.base;
86
+ dialog.formikProps = (0, formik_1.useFormik)({
87
+ enableReinitialize: true,
88
+ initialValues: initialValues,
89
+ onSubmit: function (values, formikHelpers) {
90
+ // No Necessary
91
+ }
92
+ });
93
+ // dialog.formikProps = formikProps;
85
94
  if (dialogRef.current) {
86
95
  // Öncelikle ref'i al ve input elemanlarını bul
87
96
  var inputElements = dialogRef.current.querySelectorAll("input");
@@ -16,6 +16,7 @@ var Placeholder = function (_a) {
16
16
  };
17
17
  var DialogContentBody = function (_a) {
18
18
  var body = _a.body, dialog = _a.dialog;
19
+ console.log('DialogContentBody', dialog);
19
20
  if (body instanceof Function) {
20
21
  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)] });
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.43",
3
+ "version": "1.1.45",
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",