react-dialogger 1.1.42 → 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.
@@ -74,6 +74,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
74
74
  initializeActionRef: (key: string) => RefObject<DialogActionBase>;
75
75
  get dialogOptions(): DialogOptionsType;
76
76
  get holder(): DialogOptionsType;
77
+ get Resizeable(): Resizeable;
77
78
  /**@deprecate
78
79
  * @see this.state
79
80
  * */
@@ -133,7 +134,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
133
134
  * use outside Content component
134
135
  * */
135
136
  private baseZoomEffect;
136
- private withBackdrop;
137
+ private WithBackdrop;
137
138
  switchFullScreen: () => void;
138
139
  private Placeholder;
139
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, resizeHandleMouseDown: _this._Resizeable.resizeHandleMouseDown, 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*/
@@ -710,6 +713,13 @@ var DialogBase = /** @class */ (function (_super) {
710
713
  enumerable: false,
711
714
  configurable: true
712
715
  });
716
+ Object.defineProperty(DialogBase.prototype, "Resizeable", {
717
+ get: function () {
718
+ return this._Resizeable;
719
+ },
720
+ enumerable: false,
721
+ configurable: true
722
+ });
713
723
  Object.defineProperty(DialogBase.prototype, "formikProps", {
714
724
  // get state(): T | Readonly<BaseDialogState> {
715
725
  // return super.state
@@ -12,8 +12,8 @@ interface IContentProps {
12
12
  dialogOptions: DialogOptionsType;
13
13
  dom: HTMLDivElement;
14
14
  keyboardListener: BaseDialogProps['keyboardListener'];
15
- resizeHandleMouseDown: () => void;
16
15
  dialog: DialogBase<any>;
16
+ initialValues: BaseDialogProps['initialValues'];
17
17
  }
18
18
  declare const DialogContent: React.FC<IContentProps>;
19
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, resizeHandleMouseDown = _a.resizeHandleMouseDown, 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");
@@ -134,6 +143,6 @@ var DialogContent = function (_a) {
134
143
  dialog: dialog }), (0, jsx_runtime_1.jsx)(DialogContentBody_1.DialogContentBody, { dialog: dialog, body: body }), (0, jsx_runtime_1.jsx)(DialogContenFooter_1.DialogContentFooter, { dialog: dialog, ref: footerRef, actions: actions })] }), (baseOptions.resizeable) &&
135
144
  (0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "resizable-handle", style: {
136
145
  zIndex: parseInt(domZIndex) + 1
137
- }, onMouseDown: resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(ResizeIcon_1.default, { color: '#286e94' }) }) })] }) });
146
+ }, onMouseDown: dialog.Resizeable.resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(ResizeIcon_1.default, { color: '#286e94' }) }) })] }) });
138
147
  };
139
148
  exports.DialogContent = DialogContent;
@@ -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
  }
@@ -38,7 +38,7 @@ var DialogContentHeader = function (_a) {
38
38
  if ((_a = dialog === null || dialog === void 0 ? void 0 : dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.fullscreen) {
39
39
  dialog.switchFullScreen();
40
40
  }
41
- }, style: (_c = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _c === void 0 ? void 0 : _c.style, className: "dialog-header ".concat(baseOptions.draggable && !dialog.state.fullscreenMode ? 'drag-handle' : ''), children: (0, jsx_runtime_1.jsx)(DialogBase_1.WithHeaderFooterContext, { children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this })) }) });
41
+ }, style: (_c = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _c === void 0 ? void 0 : _c.style, className: "dialog-header ".concat(baseOptions.draggable && !dialog.state.fullscreenMode ? 'drag-handle' : ''), children: (0, jsx_runtime_1.jsx)(DialogBase_1.WithHeaderFooterContext, { dialog: dialog, children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this })) }) });
42
42
  }
43
43
  if (header instanceof Function) {
44
44
  return (0, jsx_runtime_1.jsxs)("div", { onDoubleClick: function (event) {
@@ -48,7 +48,7 @@ var DialogContentHeader = function (_a) {
48
48
  }, style: (_d = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _d === void 0 ? void 0 : _d.style, className: "dialog-header ".concat(baseOptions.draggable && !dialog.state.fullscreenMode ? 'drag-handle' : ''), children: [header(dialog), (baseOptions.closeable || baseOptions.fullscreen) &&
49
49
  (0, jsx_runtime_1.jsx)(DialogBase_1.WithHeaderFooterContext, { dialog: dialog, children: (0, jsx_runtime_1.jsxs)(Futures_1.DialogHeaderActionsWrapper, { children: [baseOptions.fullscreen &&
50
50
  (0, jsx_runtime_1.jsx)(Futures_1.DialogFullscreenAction, {}), baseOptions.closeable &&
51
- (0, jsx_runtime_1.jsx)(Futures_1.DialogCloseAction, {})] }) })] });
51
+ (0, jsx_runtime_1.jsx)(Futures_1.DialogCloseAction, {}), (0, jsx_runtime_1.jsx)(Futures_1.DialogInfoAction, {})] }) })] });
52
52
  }
53
53
  return (0, jsx_runtime_1.jsx)("div", { style: (_e = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _e === void 0 ? void 0 : _e.style, className: 'drag-handle dialog-header', children: header });
54
54
  };
@@ -11,20 +11,20 @@ var DialogBase_1 = require("../DialogBase");
11
11
  // const DialogCloseAction = ({dialog}:{dialog: React.RefObject<IDialogRef> | undefined}) => {
12
12
  // const DialogCloseAction = ({dialog, newProps}:{dialog: IDialogDef | undefined, newProps?: any}) => {
13
13
  var DialogCloseAction = function () {
14
- var _a, _b, _c, _d;
15
- var dialogHeaderContext = (0, react_1.useContext)(DialogBase_1.DialogHeaderFooterContext);
16
- var _dialog = dialogHeaderContext.dialog;
14
+ var _a, _b, _c, _d, _e, _f;
15
+ var dialog = (0, react_1.useContext)(DialogBase_1.DialogHeaderFooterContext).dialog;
16
+ console.log('DialogCloseAction_dialog', dialog);
17
17
  // console.log('DialogCloseAction_props', dialogHeaderContext);
18
18
  // return <div className={'close-icon-wrapper'} onClick={event => apiRef.current.close()} >
19
19
  return (0, jsx_runtime_1.jsx)("div", { className: 'close-icon-wrapper', onClick: function (event) {
20
20
  // props.dialog.close()
21
- _dialog.close();
21
+ dialog.close();
22
22
  }, children: (0, jsx_runtime_1.jsx)(CloseIcon_1.default
23
23
  // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
24
24
  // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
25
25
  , {
26
26
  // size={apiRef.current.dialogOptions.base.headerControllerIcons?.size ?? 24 }
27
27
  // color={apiRef.current.dialogOptions.base.headerControllerIcons?.color ?? null }
28
- size: (_b = (_a = _dialog.dialogOptions.base.headerControllerIcons) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 24, color: (_d = (_c = _dialog.dialogOptions.base.headerControllerIcons) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : null }) });
28
+ size: (_c = (_b = (_a = dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.headerControllerIcons) === null || _b === void 0 ? void 0 : _b.size) !== null && _c !== void 0 ? _c : 24, color: (_f = (_e = (_d = dialog.dialogOptions.base) === null || _d === void 0 ? void 0 : _d.headerControllerIcons) === null || _e === void 0 ? void 0 : _e.color) !== null && _f !== void 0 ? _f : null }) });
29
29
  };
30
30
  exports.DialogCloseAction = DialogCloseAction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.42",
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",