react-dialogger 1.1.52 → 1.1.53

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.
@@ -5,54 +5,9 @@ var jsx_runtime_1 = require("react/jsx-runtime");
5
5
  var react_1 = require("react");
6
6
  var DialogContent_1 = require("./DialogContent");
7
7
  var hexToRgb_1 = require("../helpers/hexToRgb");
8
- var Resizeable_1 = require("../helpers/Resizeable");
9
- var formik_1 = require("formik");
10
- var resizeManager = function (dialogRef, dialog) {
11
- var _a;
12
- dialogRef.current ? dialogRef.current.tabIndex = 0 : undefined; // Odaklanabilir hale getirir
13
- (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.focus();
14
- if (!(dialog === null || dialog === void 0 ? void 0 : dialog.props.initialOptions.base.resizeable))
15
- return;
16
- var rs = new Resizeable_1.Resizeable();
17
- rs.setContainer(dialogRef, dialog.props.initialOptions);
18
- rs.onResizeListener(function (width, height, rect) {
19
- var _a;
20
- if (typeof ((_a = dialog.props) === null || _a === void 0 ? void 0 : _a.resizeListener) === "function") {
21
- dialog.props.resizeListener({ width: width, height: height, rect: rect }, dialog);
22
- }
23
- });
24
- return rs;
25
- };
26
- var DialogWithBackdropWrapper = (0, react_1.forwardRef)(function (_a, ref) {
27
- var body = _a.body, header = _a.header, actions = _a.actions, dialog = _a.dialog, dialogRef = _a.dialogRef, headerRef = _a.headerRef, bodyRef = _a.bodyRef, backdropRef = _a.backdropRef, footerRef = _a.footerRef, prevDialogRect = _a.prevDialogRect, snackbarRef = _a.snackbarRef;
28
- var resizeableObject = (0, react_1.useState)(resizeManager(dialogRef, dialog))[0];
29
- (0, react_1.useImperativeHandle)(ref, function () { return ({
30
- baseZoomEffect: baseZoomEffect
31
- }); });
32
- dialog.inlineFormikProps = (0, formik_1.useFormik)({
33
- initialValues: dialog.props.initialValues,
34
- onSubmit: function (values, formikHelpers) { }
35
- });
36
- // Call only on initialize
37
- (0, react_1.useEffect)(function () {
38
- return function () {
39
- resizeableObject === null || resizeableObject === void 0 ? void 0 : resizeableObject.cleanUp();
40
- };
41
- }, []);
42
- var baseZoomEffect = function () {
43
- var _a = dialog.dialogTranslate, lastX = _a.lastX, lastY = _a.lastY;
44
- dialogRef.current.animate([
45
- // key frames
46
- { transform: "translate(".concat(lastX, "px, ").concat(lastY, "px) scale(1)") },
47
- { transform: "translate(".concat(lastX, "px, ").concat(lastY, "px) scale(1.01)") },
48
- // { boxShadow: `0 0 20px red`},
49
- { transform: "translate(".concat(lastX, "px, ").concat(lastY, "px) scale(1)") }
50
- ], {
51
- // sync options
52
- duration: 300,
53
- iterations: 1
54
- });
55
- };
8
+ var DialogContentContextProvider_1 = require("../context/DialogContentContextProvider");
9
+ var DialogWithBackdropWrapper = function () {
10
+ var _a = (0, react_1.useContext)(DialogContentContextProvider_1.DialogContentContext), dialog = _a.dialog, backdropRef = _a.backdropRef, baseZoomEffect = _a.baseZoomEffect;
56
11
  var _b = dialog.dialogOptions.backdrop, backgroundColor = _b.backgroundColor, opacity = _b.opacity;
57
12
  var bgCl = (0, hexToRgb_1.hexToRgb)(backgroundColor, opacity);
58
13
  return (0, jsx_runtime_1.jsx)("div", { className: "dialog-backdrop dialog-backdrop-show", ref: backdropRef, style: {
@@ -67,6 +22,6 @@ var DialogWithBackdropWrapper = (0, react_1.forwardRef)(function (_a, ref) {
67
22
  return;
68
23
  }
69
24
  baseZoomEffect();
70
- }, children: (0, jsx_runtime_1.jsx)(DialogContent_1.DialogContent, { body: body, header: header, actions: actions, dialogRef: dialogRef, headerRef: headerRef, bodyRef: bodyRef, footerRef: footerRef, backdropRef: backdropRef, dialogOptions: dialog.dialogOptions, dialog: dialog, resizeableObject: resizeableObject, prevDialogRect: prevDialogRect, snackbarRef: snackbarRef }) });
71
- });
25
+ }, children: (0, jsx_runtime_1.jsx)(DialogContent_1.DialogContent, {}) });
26
+ };
72
27
  exports.DialogWithBackdropWrapper = DialogWithBackdropWrapper;
@@ -12,6 +12,7 @@ var context_1 = require("../../context");
12
12
  var helpers_1 = require("../../helpers");
13
13
  var DialogFullscreenAction = function () {
14
14
  var _a, _b, _c, _d, _e, _f, _g, _h;
15
+ // use this owned context while setFullscreen mode declared
15
16
  var _j = (0, react_1.useContext)(context_1.DialogHeaderFooterContext), dialog = _j.dialog, setFullscreen = _j.setFullscreen, fullscreen = _j.fullscreen;
16
17
  return (0, jsx_runtime_1.jsx)("div", { className: 'fullscreen-icon-wrapper', onClick: function (event) {
17
18
  setFullscreen(!fullscreen);
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import DialogBase from "../DialogBase";
3
+ import { Resizeable } from "../../helpers/Resizeable";
4
+ declare const resizeManager: (dialogRef: React.RefObject<HTMLDivElement>, dialog: DialogBase<any>) => Resizeable | null;
5
+ export { resizeManager };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resizeManager = void 0;
4
+ var Resizeable_1 = require("../../helpers/Resizeable");
5
+ var resizeManager = function (dialogRef, dialog) {
6
+ var _a;
7
+ dialogRef.current ? dialogRef.current.tabIndex = 0 : undefined; // Odaklanabilir hale getirir
8
+ (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.focus();
9
+ if (!(dialog === null || dialog === void 0 ? void 0 : dialog.props.initialOptions.base.resizeable))
10
+ return;
11
+ var rs = new Resizeable_1.Resizeable();
12
+ rs.setContainer(dialogRef, dialog.props.initialOptions);
13
+ rs.onResizeListener(function (width, height, rect) {
14
+ var _a;
15
+ if (typeof ((_a = dialog.props) === null || _a === void 0 ? void 0 : _a.resizeListener) === "function") {
16
+ dialog.props.resizeListener({ width: width, height: height, rect: rect }, dialog);
17
+ }
18
+ });
19
+ return rs;
20
+ };
21
+ exports.resizeManager = resizeManager;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { DialogContentContextProviderProps, DialogContentContextProviderSharedProps } from "../types/DialogContentContextTypes";
3
+ export declare const DialogContentContext: React.Context<DialogContentContextProviderSharedProps>;
4
+ declare const DialogContentContextProvider: React.FC<DialogContentContextProviderProps>;
5
+ export default DialogContentContextProvider;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __rest = (this && this.__rest) || function (s, e) {
47
+ var t = {};
48
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49
+ t[p] = s[p];
50
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
51
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53
+ t[p[i]] = s[p[i]];
54
+ }
55
+ return t;
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.DialogContentContext = void 0;
59
+ var jsx_runtime_1 = require("react/jsx-runtime");
60
+ var react_1 = __importStar(require("react"));
61
+ var resizeManager_1 = require("../components/utils/resizeManager");
62
+ var formik_1 = require("formik");
63
+ exports.DialogContentContext = react_1.default.createContext(null);
64
+ var DialogContentContextProvider = function (props) {
65
+ var dialogBase = props.dialogBase, children = props.children,
66
+ // dialogRef,
67
+ // headerRef,
68
+ // bodyRef,
69
+ // footerRef,
70
+ // backdropRef,
71
+ // snackbarRef,
72
+ // prevDialogRect,
73
+ restProps = __rest(props, ["dialogBase", "children"]);
74
+ var resizeableObject = (0, react_1.useState)((0, resizeManager_1.resizeManager)(props.dialogRef, props.dialogBase))[0];
75
+ // const bounds = props.dialogBase.dialogOptions.base?.memoBounds ? getDialogBounds(dialogBase.dialogOptions.base.id) : null;
76
+ var baseZoomEffect = function () {
77
+ var _a = props.dialogBase.dialogTranslate, lastX = _a.lastX, lastY = _a.lastY;
78
+ props.dialogRef.current.animate([
79
+ // key frames
80
+ { transform: "translate(".concat(lastX, "px, ").concat(lastY, "px) scale(1)") },
81
+ { transform: "translate(".concat(lastX, "px, ").concat(lastY, "px) scale(1.01)") },
82
+ // { boxShadow: `0 0 20px red`},
83
+ { transform: "translate(".concat(lastX, "px, ").concat(lastY, "px) scale(1)") }
84
+ ], {
85
+ // sync options
86
+ duration: 300,
87
+ iterations: 1
88
+ });
89
+ };
90
+ var _a = react_1.default.useState(false), inProcess = _a[0], setInProcess = _a[1];
91
+ var values = __assign({ baseZoomEffect: baseZoomEffect, dialog: dialogBase,
92
+ // bounds,
93
+ resizeableObject: resizeableObject }, restProps);
94
+ // Call only on initialize
95
+ (0, react_1.useEffect)(function () {
96
+ return function () {
97
+ resizeableObject === null || resizeableObject === void 0 ? void 0 : resizeableObject.cleanUp();
98
+ };
99
+ }, []);
100
+ props.dialogBase.inlineFormikProps = (0, formik_1.useFormik)({
101
+ initialValues: props.dialogBase.props.initialValues,
102
+ onSubmit: function (values, formikHelpers) { }
103
+ });
104
+ return (0, jsx_runtime_1.jsx)(exports.DialogContentContext.Provider, { value: values, children: children });
105
+ };
106
+ exports.default = DialogContentContextProvider;
@@ -46,7 +46,7 @@ var dialogRegister = function (dialogId, initialBounds) {
46
46
  };
47
47
  // To RAM
48
48
  initDialogMemoizeBounds_1.registeredDialogs.set(combined.join('-'), newDialogBounds);
49
- console.log('dialogRegister_combined', newDialogBounds, combined.join('-'), initDialogMemoizeBounds_1.registeredDialogs, Array.from(initDialogMemoizeBounds_1.registeredDialogs));
49
+ console.log('dialogRegister_combined', initialBounds, newDialogBounds, combined.join('-'), initDialogMemoizeBounds_1.registeredDialogs, Array.from(initDialogMemoizeBounds_1.registeredDialogs));
50
50
  // To Store
51
51
  try {
52
52
  window.localStorage.setItem(initDialogMemoizeBounds_1.BOUNDS_STORE_KEY, JSON.stringify(Array.from(initDialogMemoizeBounds_1.registeredDialogs)));
@@ -1,9 +1,25 @@
1
- import { TDialogStateListenerForActionCallbackType, DialogActionOptionsType, DialogActionType } from "../types/DialogActionTypes";
1
+ import { TDialogStateListenerForActionCallbackType, DialogActionOptionsType, DialogActionType, ActionIntentType } from "../types/DialogActionTypes";
2
2
  import DialogActionBase from "../components/DialogActionBase";
3
3
  declare const ActionProgress: () => import("react/jsx-runtime").JSX.Element;
4
4
  export { ActionProgress };
5
+ export declare const ACTION_INTENTS: {
6
+ readonly positive: {
7
+ readonly color: "primary";
8
+ readonly variant: "contained";
9
+ };
10
+ readonly negative: {
11
+ readonly color: "error";
12
+ readonly variant: "contained";
13
+ };
14
+ readonly neutral: {
15
+ readonly variant: "text";
16
+ readonly color: "primary";
17
+ };
18
+ };
5
19
  declare class DialogAction extends DialogActionBase {
6
20
  constructor(name: string, options?: DialogActionOptionsType);
21
+ setIntent(intent: ActionIntentType): this;
22
+ getIntent(): import("../types/DialogActionTypes").ActionIntent;
7
23
  setOptions: (options: DialogActionOptionsType) => this;
8
24
  get options(): DialogActionOptionsType;
9
25
  get name(): string;
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.DialogAction = exports.ActionProgress = void 0;
32
+ exports.DialogAction = exports.ACTION_INTENTS = exports.ActionProgress = void 0;
33
33
  var jsx_runtime_1 = require("react/jsx-runtime");
34
34
  var DialogActionBase_1 = __importDefault(require("../components/DialogActionBase"));
35
35
  var components_1 = require("../components");
@@ -37,6 +37,20 @@ var ActionProgress = function () {
37
37
  return (0, jsx_runtime_1.jsx)(components_1.CircularProgress, { size: 20, inProcess: { inProcess: true } });
38
38
  };
39
39
  exports.ActionProgress = ActionProgress;
40
+ exports.ACTION_INTENTS = {
41
+ positive: {
42
+ color: 'primary',
43
+ variant: 'contained',
44
+ },
45
+ negative: {
46
+ color: 'error',
47
+ variant: 'contained',
48
+ },
49
+ neutral: {
50
+ variant: 'text',
51
+ color: 'primary',
52
+ },
53
+ };
40
54
  var DialogAction = /** @class */ (function (_super) {
41
55
  __extends(DialogAction, _super);
42
56
  function DialogAction(name, options) {
@@ -49,57 +63,6 @@ var DialogAction = /** @class */ (function (_super) {
49
63
  _super.prototype.onClick.call(_this, callback);
50
64
  return _this;
51
65
  };
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
- // }
103
66
  /**
104
67
  * Only from init */
105
68
  _this.stateListener = function (listener) {
@@ -108,15 +71,23 @@ var DialogAction = /** @class */ (function (_super) {
108
71
  };
109
72
  _this._name = name;
110
73
  var defaultOptions = {
111
- label: 'Button',
74
+ label: null,
112
75
  variant: 'contained',
113
76
  color: 'default',
114
77
  disabled: false,
115
78
  prevDisabled: false
116
79
  };
117
80
  _this._options = __assign(__assign({}, defaultOptions), (options !== null && options !== void 0 ? options : {}));
81
+ _this._intent = null;
118
82
  return _this;
119
83
  }
84
+ DialogAction.prototype.setIntent = function (intent) {
85
+ this._intent = exports.ACTION_INTENTS[intent];
86
+ return this;
87
+ };
88
+ DialogAction.prototype.getIntent = function () {
89
+ return this._intent;
90
+ };
120
91
  Object.defineProperty(DialogAction.prototype, "options", {
121
92
  get: function () {
122
93
  return this._options;
@@ -12,6 +12,19 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.baseDialogOptions = void 0;
15
+ /**
16
+ * R*E*A*D*M*E
17
+ * 🔥 LocalText
18
+ * Automatic Action Label Resolution
19
+ * If a DialogAction is created without providing options.label, Dialogger automatically resolves the action label based on the action name.
20
+ * The resolution flow works as follows:
21
+ * The action’s name is used as the source (e.g. okAction, cancelAction).
22
+ * The Action suffix is automatically removed.
23
+ * A semantic key is derived (e.g. ok, cancel).
24
+ * This key is looked up in the localText (i18n) dictionary.
25
+ * If a matching entry exists, the label is resolved from localText.
26
+ * If no entry is found, the semantic key itself is used as a fallback label.
27
+ * */
15
28
  /**
16
29
  * BASE (immutable template)
17
30
  */
@@ -49,6 +62,12 @@ var BASE_DIALOG_OPTIONS = {
49
62
  slotProps: {
50
63
  action: {},
51
64
  },
65
+ localText: {
66
+ // Static
67
+ busyMessage: "Please wait...",
68
+ // Dynamic
69
+ // It's free declaration
70
+ }
52
71
  };
53
72
  window["dialogOptions"] = structuredClone(BASE_DIALOG_OPTIONS);
54
73
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.52",
3
+ "version": "1.1.53",
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",
package/styles/dialog.css CHANGED
@@ -201,7 +201,7 @@
201
201
  }
202
202
 
203
203
  .dialog-main {
204
- top: 20px;
204
+ top: 100px;
205
205
  box-shadow: 0 0 20px #252525;
206
206
  border-radius: 10px;
207
207
  background-color: white;
@@ -5,9 +5,10 @@ import DialogActionBase from "../components/DialogActionBase";
5
5
  import { CSSProperties } from "react";
6
6
  import * as React from "react";
7
7
  import { DialogAction } from "../models";
8
+ import { ACTION_INTENTS } from "../models/DialogAction";
8
9
  export type ActionDialogDef = Omit<IDialogApiDef, 'switchFullScreen'>;
9
10
  export type ActionDef = Pick<DialogAction, 'onClick' | 'setOptions' | 'name'>;
10
- export type ActionBaseDef = Pick<DialogActionBase, 'setOptions' | 'setInProcess' | 'getLabel' | 'options' | 'click' | 'remove' | 'name'>;
11
+ export type ActionBaseDef = Pick<DialogActionBase, 'updateOptions' | 'setInProcess' | 'getLabel' | 'options' | 'click' | 'remove' | 'name'>;
11
12
  export interface IDialogActionDef extends ActionBaseDef {
12
13
  }
13
14
  export type DialogActionType = (button: ActionBaseDef, dialog: Omit<IDialogApiDef, 'switchFullScreen'>) => void;
@@ -45,10 +46,12 @@ export interface ActionProps {
45
46
  baseStyle?: CSSProperties;
46
47
  fontFamily?: string;
47
48
  stateListener?: TDialogStateListenerForActionCallbackType;
49
+ intent: ActionIntent;
48
50
  }
49
51
  export interface ActionState {
50
52
  isRippling: boolean;
51
53
  coords: ICoords;
54
+ intent: ActionIntent;
52
55
  }
53
56
  export type TBVariant = "contained" | "outlined" | "text";
54
57
  export type TBColor = "primary" | "success" | "error" | "warning" | "info" | "secondary" | "default";
@@ -61,14 +64,16 @@ export type DialogActionOptionsType = {
61
64
  style?: React.CSSProperties;
62
65
  baseStyle?: React.CSSProperties;
63
66
  };
64
- type TListenerButtonType = Pick<DialogActionBase, Exclude<keyof ActionDef, 'onClick' | 'getStateListener' | 'name'>>;
67
+ type TListenerButtonType = Pick<DialogActionBase, Exclude<keyof ActionDef, 'onClick' | 'getStateListener' | 'name' | 'setOptions'>>;
65
68
  export type TDialogStateListenerForActionCallbackType = (values: TValues, button: TListenerButtonType, dialog: IListenerDialogDef) => void;
66
69
  export interface IContentFooterProps {
67
- dialog: DialogBase<any>;
68
- actions?: DialogAction[];
69
70
  }
70
71
  export interface DialogContentFooterReturnType {
71
72
  setProcessing: React.Dispatch<React.SetStateAction<boolean>>;
72
73
  inProcess: boolean;
73
74
  }
75
+ export type ActionIntentType = keyof typeof ACTION_INTENTS;
76
+ export type ActionIntentsType = "positive" | "negative" | "neutral";
77
+ export interface ActionIntent extends Partial<Pick<DialogActionOptionsType, 'variant' | 'color'>> {
78
+ }
74
79
  export {};
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  ;
4
+ ;
@@ -0,0 +1,22 @@
1
+ import { TDialogCallbackFn } from "./DialogTypes";
2
+ import DialogBase from "../components/DialogBase";
3
+ import { ReactNode, RefObject } from "react";
4
+ import { BaseDialogDOMRect } from "./types";
5
+ import { Resizeable } from "../helpers/Resizeable";
6
+ export interface DialogContentContextProviderProps {
7
+ dialogBase: DialogBase<any>;
8
+ body: TDialogCallbackFn<ReturnType<any>>;
9
+ dialogRef: RefObject<any>;
10
+ headerRef: RefObject<any>;
11
+ bodyRef: RefObject<any>;
12
+ footerRef: RefObject<any>;
13
+ backdropRef: RefObject<any>;
14
+ snackbarRef: RefObject<any>;
15
+ prevDialogRect: BaseDialogDOMRect;
16
+ children: ReactNode;
17
+ }
18
+ export interface DialogContentContextProviderSharedProps extends Partial<Pick<DialogContentContextProviderProps, 'dialogRef' | 'headerRef' | 'bodyRef' | 'footerRef' | 'backdropRef' | 'snackbarRef' | 'prevDialogRect'>> {
19
+ baseZoomEffect: () => void;
20
+ dialog: DialogBase<any>;
21
+ resizeableObject: Resizeable | null;
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,7 +7,7 @@ import { FormikProps } from "formik";
7
7
  import { RefObject } from "react";
8
8
  import { DialogAction } from "../models";
9
9
  import { Resizeable } from "../helpers/Resizeable";
10
- import { DialogContentFooterReturnType } from "./DialogActionTypes";
10
+ import { ActionIntentsType, DialogContentFooterReturnType } from "./DialogActionTypes";
11
11
  import { SnackbarKey, VariantType } from "notistack";
12
12
  export interface TBaseDialogState {
13
13
  [K: string]: any;
@@ -52,13 +52,20 @@ interface IDialogOptionsType {
52
52
  anchorOrigin?: ISnackbarAnchor;
53
53
  autoHideDuration?: number | null;
54
54
  maxSnack?: number;
55
+ /**@deprecated
56
+ * @link IDialogOptionsType['localText']*/
55
57
  busyMessage?: string;
56
58
  };
57
59
  animate: 'jumper' | 'none';
58
60
  slot?: kSlot;
59
61
  slotProps?: kSlotProps;
62
+ localText?: {
63
+ busyMessage?: string;
64
+ [k: string]: any;
65
+ };
66
+ actionsIntents?: ActionIntentsType;
60
67
  }
61
- export type DialogOptionsType = Partial<Pick<IDialogOptionsType, 'base' | 'snackbar' | 'backdrop' | 'slotProps' | 'slot' | 'animate' | 'progress'>>;
68
+ export type DialogOptionsType = Partial<Pick<IDialogOptionsType, 'base' | 'snackbar' | 'backdrop' | 'slotProps' | 'slot' | 'animate' | 'progress' | 'localText' | 'actionsIntents'>>;
62
69
  interface kSlot {
63
70
  action?: React.JSXElementConstructor<any>;
64
71
  footer?: React.JSXElementConstructor<any>;
@@ -124,10 +131,10 @@ export interface IStateDef extends Pick<BaseDialogState, "values" | "fullscreenM
124
131
  export interface IListenerDialogDef extends Omit<IDialogApiDef, "values" | "setValues"> {
125
132
  }
126
133
  export type TDialogStateListenerCallbackType = (values: FormikProps<any>['values'], dialog: IListenerDialogDef) => void;
127
- export type TDialogCallbackFn<T = React.ReactNode> = (dialog: IDialogApiDef) => T;
134
+ export type TDialogCallbackFn<T = React.ReactNode | React.ReactElement> = (dialog: IDialogApiDef) => T;
128
135
  export type TDialogHeader = TDialogCallbackFn | React.ReactNode | React.JSX.Element;
129
136
  export type TDialogCallbackVoidFn = TDialogCallbackFn<void>;
130
- export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'updateBody' | 'processingListener'> {
137
+ export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'updateBody' | 'processingListener' | 'addFeature' | 'getFeature'> {
131
138
  }
132
139
  export interface IDialogCloseRef extends Pick<DialogBase<any>, 'close'> {
133
140
  }