react-dialogger 1.1.93 → 1.1.95

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.
@@ -72,13 +72,13 @@ var jumper_animate_1 = require("../utils/effects/jumper-animate");
72
72
  var _context_1 = require("../context/index.js");
73
73
  var appLogger_1 = require("../helpers/appLogger");
74
74
  var DialogContent = function (props) {
75
- var _a, _b, _c, _d, _e;
75
+ var _a, _b, _c, _d, _e, _f, _g;
76
76
  var firstUpdate = React.useRef(true);
77
- var _f = (0, react_1.useContext)(_context_1.DialogContentContext), dialog = _f.dialog, dialogRef = _f.dialogRef, prevDialogRect = _f.prevDialogRect, backdropRef = _f.backdropRef, snackbarRef = _f.snackbarRef, footerRef = _f.footerRef, resizeableObject = _f.resizeableObject, body = _f.body;
77
+ var _h = (0, react_1.useContext)(_context_1.DialogContentContext), dialog = _h.dialog, dialogRef = _h.dialogRef, prevDialogRect = _h.prevDialogRect, backdropRef = _h.backdropRef, snackbarRef = _h.snackbarRef, footerRef = _h.footerRef, resizeableObject = _h.resizeableObject, body = _h.body;
78
78
  var dialogOptions = dialog.dialogOptions;
79
79
  var baseOptions = dialogOptions.base;
80
- var _g = React.useState(false), fullscreenMode = _g[0], setFullscreenMode = _g[1];
81
- var _h = React.useState(null), rect = _h[0], setRect = _h[1];
80
+ var _j = React.useState(false), fullscreenMode = _j[0], setFullscreenMode = _j[1];
81
+ var _k = React.useState(null), rect = _k[0], setRect = _k[1];
82
82
  var bounds = ((_a = dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.memoBounds) ? (0, _helpers_1.getDialogBounds)(dialog.dialogOptions.base.id) : null;
83
83
  var domZIndex = window.getComputedStyle(dialog.getDom()).zIndex;
84
84
  var positionSelector = function () {
@@ -177,7 +177,7 @@ var DialogContent = function (props) {
177
177
  // @ts-ignore
178
178
  dialog.props.keyboardListener(e.key, _this);
179
179
  }
180
- }, className: baseOptions.size.width === 'auto' ? 'auto' : "dialog-width-".concat(dialogOptions.base.size.width, " dialog-main show-opacity show-position-").concat(baseOptions.initialAnchor.vertical), style: __assign(__assign(__assign(__assign({ height: (_b = baseOptions.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof baseOptions.size.width === "number" ? { width: "".concat(baseOptions.size.width, "px") } : { width: "".concat(baseOptions.size.width) }), { outline: 'none', fontFamily: (_c = baseOptions.style.fontFamily) !== null && _c !== void 0 ? _c : 'Arial' }), rect), { alignSelf: (_d = baseOptions.initialAnchor.vertical) !== null && _d !== void 0 ? _d : 'flex-start', justifySelf: (_e = baseOptions.initialAnchor.horizontal) !== null && _e !== void 0 ? _e : 'flex-start' }), children: (0, jsx_runtime_1.jsxs)(notistack_1.SnackbarProvider, { ref: snackbarRef, maxSnack: dialog.dialogOptions.snackbar.maxSnack, children: [(dialog.props.header || dialogOptions.slot.header) && ((0, jsx_runtime_1.jsx)(_1.DialogContentHeader, { header: dialog.props.header, bounds: bounds })), (0, jsx_runtime_1.jsx)(_1.DialogContentBody, { body: body }), (0, jsx_runtime_1.jsx)(_1.DialogContentFooter, { ref: footerRef }), (baseOptions.resizeable) &&
180
+ }, className: baseOptions.size.width === 'auto' ? 'auto' : "dialog-width-".concat(dialogOptions.base.size.width, " dialog-main show-opacity show-position-").concat(baseOptions.initialAnchor.vertical), style: __assign(__assign(__assign(__assign({ height: (_b = baseOptions.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof baseOptions.size.width === "number" ? { width: "".concat(baseOptions.size.width, "px") } : { width: "".concat(baseOptions.size.width) }), { outline: 'none', fontFamily: (_c = baseOptions.style.fontFamily) !== null && _c !== void 0 ? _c : 'Arial' }), rect), { alignSelf: (_d = baseOptions.initialAnchor.vertical) !== null && _d !== void 0 ? _d : 'flex-start', justifySelf: (_e = baseOptions.initialAnchor.horizontal) !== null && _e !== void 0 ? _e : 'flex-start' }), children: (0, jsx_runtime_1.jsxs)(notistack_1.SnackbarProvider, { ref: snackbarRef, maxSnack: dialog.dialogOptions.snackbar.maxSnack, style: __assign({ width: 'min-content' }, (_g = (_f = dialog.dialogOptions) === null || _f === void 0 ? void 0 : _f.snackbar) === null || _g === void 0 ? void 0 : _g.style), children: [(dialog.props.header || dialogOptions.slot.header) && ((0, jsx_runtime_1.jsx)(_1.DialogContentHeader, { header: dialog.props.header, bounds: bounds })), (0, jsx_runtime_1.jsx)(_1.DialogContentBody, { body: body }), (0, jsx_runtime_1.jsx)(_1.DialogContentFooter, { ref: footerRef }), (baseOptions.resizeable) &&
181
181
  (0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "resizable-handle", style: {
182
182
  zIndex: parseInt(domZIndex) + 1
183
183
  }, onMouseDown: resizeableObject === null || resizeableObject === void 0 ? void 0 : resizeableObject.resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(_icons_1.ResizeIcon, { color: '#286e94' }) }) })] }) }) });
@@ -74,10 +74,12 @@ var DialogContentFooter = (0, react_1.forwardRef)(function (props, ref) {
74
74
  };
75
75
  var footerProps = {};
76
76
  if (dialogOptions.slotProps.footer) {
77
- footerProps = dialogOptions.slotProps.footer({
78
- dialogOptions: dialogOptions,
79
- inProcess: dialog.isInProcess()
80
- });
77
+ // footerProps = dialogOptions.slotProps.footer({
78
+ // dialogOptions: dialogOptions,
79
+ // inProcess: dialog.isInProcess()
80
+ // })
81
+ // footerProps = {...dialogOptions.slotProps.footer, dialogOptions: dialogOptions, inProcess: dialog.isInProcess() }
82
+ footerProps = dialogOptions.slotProps.footer;
81
83
  }
82
84
  return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-footer', style: (_c = (_b = dialogOptions.base) === null || _b === void 0 ? void 0 : _b.footer) === null || _c === void 0 ? void 0 : _c.style, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(_context_1.WithHeaderFooterContext, __assign({}, staticProps, { dialog: dialog, children: dialogOptions.slot.footer ?
83
85
  (0, jsx_runtime_1.jsx)(CustomFooter, __assign({}, staticProps, footerProps))
@@ -43,7 +43,6 @@ var __importStar = (this && this.__importStar) || (function () {
43
43
  return result;
44
44
  };
45
45
  })();
46
- var _this = this;
47
46
  Object.defineProperty(exports, "__esModule", { value: true });
48
47
  exports.DialogContentHeader = void 0;
49
48
  var jsx_runtime_1 = require("react/jsx-runtime");
@@ -79,13 +78,19 @@ var DialogContentHeader = function (_a) {
79
78
  dialog: dialog
80
79
  };
81
80
  if (dialogOptions.slot.header) {
82
- var headerProps = dialogOptions.slotProps.header ? __assign({}, dialogOptions.slotProps.header(staticProps)) : {};
81
+ // const headerProps = dialogOptions.slotProps.header ? {...dialogOptions.slotProps.header(staticProps)} : {};
82
+ console.log('CustomHeader_Content', dialogOptions.slot.header, fullscreen);
83
+ var headerProps = dialogOptions.slotProps.header;
83
84
  return (0, jsx_runtime_1.jsx)("div", { onDoubleClick: function (event) {
84
- var _a;
85
- if ((_a = dialog === null || dialog === void 0 ? void 0 : dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.fullscreen) {
85
+ if (baseOptions.fullscreen) {
86
+ if (bounds) {
87
+ (0, _helpers_1.setDialogBounds)(dialog.dialogOptions.base.id, __assign(__assign({}, bounds), { fullscreen: !fullscreen }), dialogRef);
88
+ }
86
89
  setFullscreen(!fullscreen);
90
+ event.stopPropagation();
91
+ event.preventDefault();
87
92
  }
88
- }, 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)(_context_1.WithHeaderFooterContext, { dialog: dialog, children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this })) }) });
93
+ }, 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 && !fullscreen ? 'drag-handle' : ''), children: (0, jsx_runtime_1.jsx)(_context_1.WithHeaderFooterContext, { dialog: dialog, fullscreen: fullscreen, setFullscreen: setFullscreen, children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps)) }) });
89
94
  }
90
95
  if (header instanceof Function) {
91
96
  return (0, jsx_runtime_1.jsxs)("div", { onDoubleClick: function (event) {
@@ -10,6 +10,7 @@ var DialogFullscreenAction = function () {
10
10
  var _a, _b, _c, _d, _e, _f, _g, _h;
11
11
  // use this owned context while setFullscreen mode declared
12
12
  var _j = (0, react_1.useContext)(_context_1.DialogHeaderFooterContext), dialog = _j.dialog, setFullscreen = _j.setFullscreen, fullscreen = _j.fullscreen;
13
+ console.log('DialogFullscreenAction', fullscreen, setFullscreen);
13
14
  return (0, jsx_runtime_1.jsx)("div", { className: 'fullscreen-icon-wrapper', onClick: function (event) {
14
15
  setFullscreen(!fullscreen);
15
16
  (0, _helpers_1.setDialogBound)(dialog.dialogOptions.base.id, "fullscreen", !fullscreen);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.93",
3
+ "version": "1.1.95",
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",
@@ -3,4 +3,5 @@ div[role=alert][aria-describedby=notistack-snackbar] {
3
3
  }
4
4
  div[role=alert][aria-describedby=notistack-snackbar] > div:nth-of-type(2) {
5
5
  margin-left: auto !important;
6
+ padding-left: initial !important;
6
7
  }
@@ -3,7 +3,7 @@ import Dialog, { DialogAction } from "../models/index.js";
3
3
  import type { ITypeHeight, ITypeWidth } from "./SizePosTypes";
4
4
  import { DialogBase } from "../components/index.js";
5
5
  import type { FormikProps } from "formik";
6
- import type { RefObject } from "react";
6
+ import type { CSSProperties, RefObject } from "react";
7
7
  import { Resizeable } from "../helpers/index.js";
8
8
  import type { DialogContentFooterReturnType, IActionIntents } from "./DialogActionTypes";
9
9
  import { SharedProps, SnackbarKey, SnackbarProvider, VariantType } from "notistack";
@@ -67,6 +67,7 @@ interface IDialogOptionsType {
67
67
  /**@deprecated
68
68
  * @link IDialogOptionsType['localText']*/
69
69
  busyMessage?: string;
70
+ style?: CSSProperties;
70
71
  };
71
72
  animate: 'jumper' | 'none';
72
73
  slot?: kSlot;
@@ -87,8 +88,8 @@ interface kSlotProps {
87
88
  style?: React.CSSProperties;
88
89
  [k: string]: any;
89
90
  };
90
- footer?: (props: IBaseFooterProps) => Record<string, any>;
91
- header?: (props: IBaseHeaderProps) => Record<string, any>;
91
+ footer?: Record<string, any>;
92
+ header?: Record<string, any>;
92
93
  }
93
94
  export interface IBaseDialogOptions {
94
95
  closeable?: boolean;
@@ -128,11 +129,11 @@ export interface IBaseDialogProgressOptions {
128
129
  export interface IBaseFooterProps extends BaseDialogSlotProps {
129
130
  inProcess?: IInProcess;
130
131
  }
131
- type FooterSlotProps = ReturnType<NonNullable<kSlotProps['footer']>>;
132
+ type FooterSlotProps = kSlotProps['footer'];
132
133
  export type IFooterProps = IBaseFooterProps & FooterSlotProps;
133
134
  export interface IBaseHeaderProps extends BaseDialogSlotProps {
134
135
  }
135
- type HeaderSlotProps = ReturnType<NonNullable<kSlotProps['header']>>;
136
+ type HeaderSlotProps = kSlotProps['header'];
136
137
  export type IHeaderProps = IBaseHeaderProps & HeaderSlotProps;
137
138
  export interface BaseDialogSlotProps {
138
139
  dialogOptions: DialogOptionsType;