react-dialogger 1.1.96 → 1.1.98
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.
- package/README.md +33 -13
- package/components/DialogBase.d.ts +14 -8
- package/components/DialogBase.js +31 -10
- package/models/Dialog.d.ts +11 -3
- package/models/Dialog.js +5 -1
- package/package.json +1 -1
- package/types/DialogActionTypes.d.ts +2 -2
- package/types/DialogTypes.d.ts +16 -8
package/README.md
CHANGED
|
@@ -88,18 +88,24 @@ baseDialogOptions({
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
#### useDialogOptions (Slot & Slot Props)
|
|
91
|
+
|
|
91
92
|
```js
|
|
92
93
|
slot: {
|
|
93
94
|
header: HeaderSlot, // Slot for the header, can be a custom component or template
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
footer
|
|
96
|
+
:
|
|
97
|
+
FooterSlot // Slot for the footer, can be a custom component or template
|
|
98
|
+
}
|
|
99
|
+
,
|
|
96
100
|
slotProps: {
|
|
97
101
|
header: (props: IBaseHeaderProps) => {
|
|
98
102
|
return {
|
|
99
103
|
headerName: 'sampleProp' // Custom properties to be passed to the header slot component
|
|
100
104
|
}
|
|
101
105
|
},
|
|
102
|
-
footer
|
|
106
|
+
footer
|
|
107
|
+
:
|
|
108
|
+
(props: IBaseFooterProps) => {
|
|
103
109
|
return {
|
|
104
110
|
footerName: 'Footer' // Custom properties to be passed to the footer slot component
|
|
105
111
|
}
|
|
@@ -108,28 +114,39 @@ slotProps: {
|
|
|
108
114
|
|
|
109
115
|
// Header Slot Component
|
|
110
116
|
const HeaderSlot = (props: IHeaderProps) => {
|
|
111
|
-
const {
|
|
117
|
+
const {headerName} = props;
|
|
112
118
|
return <div style={{display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'space-between'}}>
|
|
113
119
|
<div>
|
|
114
120
|
{headerName}
|
|
115
121
|
{/**values.name is dynamic by updated state than will trigger re-render*/}
|
|
116
|
-
<span style={{
|
|
122
|
+
<span style={{
|
|
123
|
+
fontSize: '12px',
|
|
124
|
+
fontWeight: 'bold',
|
|
125
|
+
color: "cyan",
|
|
126
|
+
fontStyle: "italic"
|
|
127
|
+
}}>{props.values.name}</span>
|
|
117
128
|
</div>
|
|
118
129
|
{/**Use futures*/}
|
|
119
130
|
<DialogHeaderActionsWrapper>
|
|
120
|
-
<DialogFullscreenAction
|
|
121
|
-
<DialogCloseAction
|
|
131
|
+
<DialogFullscreenAction/>
|
|
132
|
+
<DialogCloseAction/>
|
|
122
133
|
</DialogHeaderActionsWrapper>
|
|
123
134
|
</div>;
|
|
124
135
|
}
|
|
125
136
|
|
|
126
137
|
// Footer Slot Component
|
|
127
138
|
const FooterSlot = (props: IFooterProps) => {
|
|
128
|
-
|
|
139
|
+
|
|
129
140
|
const {footerName, inProcess} = props;
|
|
130
|
-
return <div style={{
|
|
141
|
+
return <div style={{
|
|
142
|
+
display: 'flex',
|
|
143
|
+
flexDirection: 'column',
|
|
144
|
+
justifyContent: 'center',
|
|
145
|
+
alignItems: 'center',
|
|
146
|
+
columnGap: 2
|
|
147
|
+
}}>
|
|
131
148
|
<span>Collected: Online {props.footerName}</span>
|
|
132
|
-
<DialogProcessing
|
|
149
|
+
<DialogProcessing/>
|
|
133
150
|
</div>;
|
|
134
151
|
}
|
|
135
152
|
|
|
@@ -138,10 +155,13 @@ const FooterSlot = (props: IFooterProps) => {
|
|
|
138
155
|
// These custom props are then passed to the respective slot components, allowing dynamic and flexible content injection.
|
|
139
156
|
// The base dialog props (e.g., dialogValues, dialogOptions) are still accessible, and users can merge their own custom props as needed.
|
|
140
157
|
|
|
141
|
-
export
|
|
142
|
-
|
|
158
|
+
export
|
|
159
|
+
interface
|
|
160
|
+
BaseDialogSlotProps
|
|
161
|
+
{
|
|
162
|
+
dialogValues: DValues; // The values that the dialog holds
|
|
143
163
|
dialogOptions: DialogOptionsType; // The options controlling the dialog's behavior
|
|
144
|
-
dialog
|
|
164
|
+
dialog ? : IDialogRef; // A reference to the dialog component for external control
|
|
145
165
|
}
|
|
146
166
|
|
|
147
167
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Component, RefObject } from 'react';
|
|
2
2
|
import { FormikProps } from "formik";
|
|
3
3
|
import { DialogActionBase } from "./index.js";
|
|
4
|
-
import { BaseDialogProps, BaseDialogState, IDialogSize, DialogOptionsType, TDialogCallbackFn, TDialogCallbackVoidFn, WithBackdrop, IDialogSnackbar, IInProcess, TInitialHolder, ISnackbarAnchor, TSeverity,
|
|
4
|
+
import { BaseDialogProps, BaseDialogState, IDialogSize, DialogOptionsType, TDialogCallbackFn, TDialogCallbackVoidFn, WithBackdrop, IDialogSnackbar, IInProcess, TInitialHolder, ISnackbarAnchor, TSeverity, TAccessFrom, ActionApiDef, DialogContentFooterReturnType, DialogFormikAdapter, DialogHandlers, DialogHandlerFn, DialogValues, DialogValue } from "../types/index.js";
|
|
5
5
|
import Dialog, { DialogAction } from "../models/index.js";
|
|
6
6
|
interface IFormikAdapter extends Pick<FormikProps<any>, 'setValues' | 'setFieldValue' | 'values'> {
|
|
7
7
|
}
|
|
8
8
|
type FeatureType = Partial<Record<string, any>>;
|
|
9
|
-
declare class DialogBase<Values extends
|
|
9
|
+
declare class DialogBase<Values extends DialogValues<Record<string, any>>> extends Component<BaseDialogProps, BaseDialogState> {
|
|
10
10
|
_dialogTranslate: {
|
|
11
11
|
lastX: number;
|
|
12
12
|
lastY: number;
|
|
@@ -29,21 +29,27 @@ declare class DialogBase<Values extends FormikProps<Values>> extends Component<B
|
|
|
29
29
|
protected _onClose: TDialogCallbackVoidFn;
|
|
30
30
|
protected _shInterval: number;
|
|
31
31
|
protected _snackbarAnchor: ISnackbarAnchor;
|
|
32
|
-
protected _initialValues: DialogValues
|
|
32
|
+
protected _initialValues: DialogValues<Values>;
|
|
33
|
+
protected _parent: Dialog<Values>;
|
|
34
|
+
protected _handlers: DialogHandlers;
|
|
33
35
|
private _inProcess;
|
|
34
36
|
private _footerRef;
|
|
35
37
|
protected _headerRef: RefObject<DialogContentFooterReturnType>;
|
|
36
38
|
private readonly _dialogWithBackDropRef;
|
|
37
|
-
protected readonly _parent: Dialog;
|
|
38
39
|
private _accessFrom;
|
|
39
40
|
private readonly _processingListeners;
|
|
40
41
|
private readonly _abortedListeners;
|
|
41
|
-
constructor(props
|
|
42
|
+
constructor(props: BaseDialogProps & {
|
|
43
|
+
initialValues: DialogValues<Values>;
|
|
44
|
+
parent: Dialog<Values>;
|
|
45
|
+
});
|
|
42
46
|
private T;
|
|
43
47
|
private readonly _features;
|
|
48
|
+
get handlers(): DialogHandlers;
|
|
49
|
+
addHandler(key: string, handler: DialogHandlerFn): void;
|
|
44
50
|
addFeature(key: string, value: any): void;
|
|
45
51
|
getFeature(key: string): FeatureType;
|
|
46
|
-
get parent(): Dialog
|
|
52
|
+
get parent(): Dialog<Values>;
|
|
47
53
|
get dialogTranslate(): {
|
|
48
54
|
lastX: number;
|
|
49
55
|
lastY: number;
|
|
@@ -58,8 +64,8 @@ declare class DialogBase<Values extends FormikProps<Values>> extends Component<B
|
|
|
58
64
|
get formikValidate(): Promise<DialogFormikAdapter<any>>;
|
|
59
65
|
set inlineFormikProps(inlineFormikProps: IFormikAdapter);
|
|
60
66
|
get values(): IFormikAdapter['values'];
|
|
61
|
-
setValue(key: string, value:
|
|
62
|
-
setValues(values:
|
|
67
|
+
setValue(key: string, value: DialogValue): void;
|
|
68
|
+
setValues(values: DialogValues<Values>, callbackFn?: () => void): void;
|
|
63
69
|
componentDidMount(): void;
|
|
64
70
|
setInProcess: (process: boolean, message?: string, holder?: TInitialHolder) => this;
|
|
65
71
|
isInProcess: () => IInProcess;
|
package/components/DialogBase.js
CHANGED
|
@@ -68,8 +68,9 @@ var _helpers_1 = require("../helpers/index.js");
|
|
|
68
68
|
var _context_1 = require("../context/index.js");
|
|
69
69
|
var DialogBase = /** @class */ (function (_super) {
|
|
70
70
|
__extends(DialogBase, _super);
|
|
71
|
+
// constructor(props: Readonly<BaseDialogProps> = {} as Readonly<BaseDialogProps>) {
|
|
72
|
+
// constructor(props: BaseDialogProps) {
|
|
71
73
|
function DialogBase(props) {
|
|
72
|
-
if (props === void 0) { props = {}; }
|
|
73
74
|
var _a, _b;
|
|
74
75
|
var _this = _super.call(this, props) || this;
|
|
75
76
|
// ✨✨✨✨✨✨✨✨✨✨✨
|
|
@@ -161,11 +162,11 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
161
162
|
}, 50);
|
|
162
163
|
};
|
|
163
164
|
setTimeout(function () {
|
|
164
|
-
var _a, _b, _c, _d;
|
|
165
|
-
if (_this._footerRef.current.inProcess && !_this.state.aborted) {
|
|
166
|
-
var notify = (
|
|
165
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
166
|
+
if (((_b = (_a = _this._footerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.inProcess) && !_this.state.aborted) {
|
|
167
|
+
var notify = (_e = (_d = (_c = _this._dialogOptions) === null || _c === void 0 ? void 0 : _c.base) === null || _d === void 0 ? void 0 : _d.notifyOnClosing) !== null && _e !== void 0 ? _e : "snackbar";
|
|
167
168
|
if (notify === "snackbar") {
|
|
168
|
-
var busyMessage = (
|
|
169
|
+
var busyMessage = (_h = (_g = (_f = _this._dialogOptions) === null || _f === void 0 ? void 0 : _f.localText) === null || _g === void 0 ? void 0 : _g.busyMessage) !== null && _h !== void 0 ? _h : 'In Process, Please wait...';
|
|
169
170
|
_this.snackbar.open(busyMessage, "warning", null, function (key, snackbarRef) {
|
|
170
171
|
var _a, _b, _c;
|
|
171
172
|
return (0, jsx_runtime_1.jsx)(_components_1.DialogActionBase, { name: 'force_close', onClick: handleAbort, options: {
|
|
@@ -176,19 +177,20 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
176
177
|
});
|
|
177
178
|
}
|
|
178
179
|
else {
|
|
179
|
-
_this._dialogWithBackDropRef.current.baseZoomEffect();
|
|
180
|
+
(_k = (_j = _this._dialogWithBackDropRef) === null || _j === void 0 ? void 0 : _j.current) === null || _k === void 0 ? void 0 : _k.baseZoomEffect();
|
|
180
181
|
}
|
|
181
182
|
return;
|
|
182
183
|
}
|
|
183
184
|
_this.kill(callbackFn);
|
|
184
|
-
if (typeof _this.props.onClose === "function") {
|
|
185
|
+
if (typeof ((_l = _this.props) === null || _l === void 0 ? void 0 : _l.onClose) === "function") {
|
|
185
186
|
_this.props.onClose(_this);
|
|
186
187
|
}
|
|
187
188
|
}, 150);
|
|
188
189
|
};
|
|
189
190
|
_this.focus = function () {
|
|
190
|
-
|
|
191
|
-
|
|
191
|
+
var _a, _b, _c;
|
|
192
|
+
if ((_a = _this._dialogRef) === null || _a === void 0 ? void 0 : _a.current) {
|
|
193
|
+
(_c = (_b = _this._dialogRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
192
194
|
}
|
|
193
195
|
};
|
|
194
196
|
_this.getDom = function () {
|
|
@@ -254,13 +256,30 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
254
256
|
// Initialize _actionRefs as an empty object
|
|
255
257
|
_this._actionRefs = {};
|
|
256
258
|
_this._initialValues = props.initialValues;
|
|
257
|
-
_this._dialogWithBackDropRef = (0, react_1.createRef)();
|
|
258
259
|
_this._parent = props.parent;
|
|
260
|
+
_this._dialogWithBackDropRef = (0, react_1.createRef)();
|
|
259
261
|
_this._processingListeners = (_a = props.processingListeners) !== null && _a !== void 0 ? _a : [];
|
|
260
262
|
_this._abortedListeners = (_b = props.abortedListeners) !== null && _b !== void 0 ? _b : [];
|
|
261
263
|
_this._features = [];
|
|
264
|
+
_this._handlers = props.handlers;
|
|
262
265
|
return _this;
|
|
263
266
|
}
|
|
267
|
+
Object.defineProperty(DialogBase.prototype, "handlers", {
|
|
268
|
+
get: function () {
|
|
269
|
+
return this._handlers;
|
|
270
|
+
},
|
|
271
|
+
enumerable: false,
|
|
272
|
+
configurable: true
|
|
273
|
+
});
|
|
274
|
+
DialogBase.prototype.addHandler = function (key, handler) {
|
|
275
|
+
if (!key) {
|
|
276
|
+
throw new Error('Handler key is required');
|
|
277
|
+
}
|
|
278
|
+
if (typeof handler !== 'function') {
|
|
279
|
+
throw new Error("Handler \"".concat(key, "\" must be a function"));
|
|
280
|
+
}
|
|
281
|
+
this._handlers[key] = handler;
|
|
282
|
+
};
|
|
264
283
|
DialogBase.prototype.addFeature = function (key, value) {
|
|
265
284
|
this._features[key] = value;
|
|
266
285
|
};
|
|
@@ -349,6 +368,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
349
368
|
Object.defineProperty(DialogBase.prototype, "values", {
|
|
350
369
|
// ✨✨✨✨✨✨✨✨✨✨✨
|
|
351
370
|
get: function () {
|
|
371
|
+
// get values(): DialogValues<Values> {
|
|
352
372
|
return this._inlineFormikProps.values;
|
|
353
373
|
// UseImperative
|
|
354
374
|
// return this._dialogWithBackDropRef?.current?.formikProps.values;
|
|
@@ -364,6 +384,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
364
384
|
// this._dialogWithBackDropRef?.current?.formikProps?.setFieldValue(key, value);
|
|
365
385
|
};
|
|
366
386
|
// ✨✨✨✨✨✨✨✨✨✨✨
|
|
387
|
+
// public setValues(values: IFormikAdapter['values'], callbackFn?: () => void): void {
|
|
367
388
|
DialogBase.prototype.setValues = function (values, callbackFn) {
|
|
368
389
|
this._inlineFormikProps.setValues(values);
|
|
369
390
|
// UseImperative
|
package/models/Dialog.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { DialogAction } from "./DialogAction";
|
|
3
|
-
import { TInitialHolder,
|
|
4
|
-
declare class Dialog {
|
|
3
|
+
import { TInitialHolder, IDialogSize, TDialogStateListenerCallbackType, DialogOptionsType, IDialogApiDef, TDialogCallbackVoidFn, TDialogCallbackFn, DialogHandlers, ModelDialogValues } from "../types/index.js";
|
|
4
|
+
declare class Dialog<Values extends ModelDialogValues<Record<string, any>>> {
|
|
5
5
|
private readonly _processingListeners;
|
|
6
6
|
private readonly _abortedListeners;
|
|
7
7
|
private _stateListener;
|
|
@@ -15,6 +15,13 @@ declare class Dialog {
|
|
|
15
15
|
private readonly _dialogOptions?;
|
|
16
16
|
private _snackbarAnchor;
|
|
17
17
|
private _initialValues;
|
|
18
|
+
/**
|
|
19
|
+
* Move Fucntions
|
|
20
|
+
* behavior
|
|
21
|
+
* Fonksiyon taşıdığını net anlatıyor
|
|
22
|
+
* UI / Dialog / Form bağlamında alışıldık
|
|
23
|
+
* */
|
|
24
|
+
private _handlers;
|
|
18
25
|
private _headerRef;
|
|
19
26
|
private readonly _apiRef;
|
|
20
27
|
private _onCloseCallback;
|
|
@@ -28,7 +35,8 @@ declare class Dialog {
|
|
|
28
35
|
stateListener(listener: TDialogStateListenerCallbackType): this;
|
|
29
36
|
processingListener(listener: (inProcess: boolean) => void): this;
|
|
30
37
|
onAbort(callbackFn: TDialogCallbackFn<void>): this;
|
|
31
|
-
initialValues(values:
|
|
38
|
+
initialValues(values: ModelDialogValues<Values>): this;
|
|
39
|
+
handlers(handlers: DialogHandlers): this;
|
|
32
40
|
initialHolder(holder: TInitialHolder): this;
|
|
33
41
|
keyboardListener(listener: (key: string, dialog: IDialogApiDef) => void): this;
|
|
34
42
|
resizeListener(listener: (size: IDialogSize, dialog: IDialogApiDef) => void): this;
|
package/models/Dialog.js
CHANGED
|
@@ -132,6 +132,10 @@ var Dialog = /** @class */ (function () {
|
|
|
132
132
|
this._initialValues = values;
|
|
133
133
|
return this;
|
|
134
134
|
};
|
|
135
|
+
Dialog.prototype.handlers = function (handlers) {
|
|
136
|
+
this._handlers = handlers;
|
|
137
|
+
return this;
|
|
138
|
+
};
|
|
135
139
|
Dialog.prototype.initialHolder = function (holder) {
|
|
136
140
|
this._initialHolder = holder;
|
|
137
141
|
return this;
|
|
@@ -153,7 +157,7 @@ var Dialog = /** @class */ (function () {
|
|
|
153
157
|
var root = (0, client_1.createRoot)(dom);
|
|
154
158
|
var props = __assign(__assign({
|
|
155
159
|
// Initials
|
|
156
|
-
initialOptions: this._dialogOptions, initialValues: this._initialValues, didMountCallback: callback,
|
|
160
|
+
initialOptions: this._dialogOptions, initialValues: this._initialValues, handlers: this._handlers, didMountCallback: callback,
|
|
157
161
|
// Component contents
|
|
158
162
|
header: this._header, body: this._body, actions: this._actions,
|
|
159
163
|
// Refs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dialogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.98",
|
|
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",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDialogApiDef, IListenerDialogDef,
|
|
1
|
+
import { IDialogApiDef, IListenerDialogDef, ICoords } from "./index.js";
|
|
2
2
|
import { DialogBase, DialogActionBase } from "../components/index.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { DialogAction } from "../models/index.js";
|
|
@@ -63,7 +63,7 @@ export type DialogActionOptionsType = {
|
|
|
63
63
|
baseStyle?: React.CSSProperties;
|
|
64
64
|
};
|
|
65
65
|
type TListenerButtonType = Pick<DialogActionBase, Exclude<keyof ActionApiDef, 'onClick' | 'getStateListener' | 'name'>>;
|
|
66
|
-
export type TDialogStateListenerForActionCallbackType = (values:
|
|
66
|
+
export type TDialogStateListenerForActionCallbackType = (values: Record<string, any>, button: TListenerButtonType, dialog: IListenerDialogDef) => void;
|
|
67
67
|
export interface IContentFooterProps {
|
|
68
68
|
}
|
|
69
69
|
export interface DialogContentFooterReturnType {
|
package/types/DialogTypes.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface TBaseDialogState {
|
|
|
12
12
|
}
|
|
13
13
|
export interface BaseDialogState {
|
|
14
14
|
/**@deprecated use FormikProps Values*/
|
|
15
|
-
values: DialogValues
|
|
15
|
+
values: DialogValues<Record<string, any>>;
|
|
16
16
|
inProcess: IInProcess;
|
|
17
17
|
fullscreenMode?: boolean;
|
|
18
18
|
prevDialogRect: WithBackdrop['prevDialogRect'];
|
|
@@ -39,11 +39,12 @@ export interface BaseDialogProps {
|
|
|
39
39
|
didMountCallback?: TDialogCallbackVoidFn;
|
|
40
40
|
dialogSize?: IDialogSize;
|
|
41
41
|
stateListener: TDialogStateListenerCallbackType;
|
|
42
|
-
initialValues: DialogValues
|
|
42
|
+
initialValues: DialogValues<Record<string, any>>;
|
|
43
|
+
handlers: DialogHandlers;
|
|
43
44
|
initialHolder: TInitialHolder;
|
|
44
45
|
snackbarAnchor?: ISnackbarAnchor;
|
|
45
46
|
dom: HTMLDivElement;
|
|
46
|
-
parent?:
|
|
47
|
+
parent?: DialogValues<Record<string, any>>;
|
|
47
48
|
onClose?: TDialogCallbackVoidFn;
|
|
48
49
|
root?: any;
|
|
49
50
|
keyboardListener: (key: string, dialog: IDialogApiDef) => void;
|
|
@@ -147,7 +148,7 @@ export type TDialogStateListenerCallbackType = (values: FormikProps<any>['values
|
|
|
147
148
|
export type TDialogCallbackFn<T = React.ReactNode | React.ReactElement> = (dialog: IDialogApiDef) => T;
|
|
148
149
|
export type TDialogHeader = TDialogCallbackFn | React.ReactNode | React.JSX.Element;
|
|
149
150
|
export type TDialogCallbackVoidFn = TDialogCallbackFn<void>;
|
|
150
|
-
export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'updateBody' | 'processingListener' | 'addFeature' | 'getFeature' | 'onAbort'> {
|
|
151
|
+
export interface IDialogApiDef extends Pick<DialogBase<any>, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'updateBody' | 'processingListener' | 'addFeature' | 'getFeature' | 'onAbort' | 'handlers'> {
|
|
151
152
|
}
|
|
152
153
|
export interface IDialogCloseRef extends Pick<DialogBase<any>, 'close'> {
|
|
153
154
|
}
|
|
@@ -178,7 +179,7 @@ export interface WithBackdrop {
|
|
|
178
179
|
actions?: DialogAction[];
|
|
179
180
|
dialog: DialogBase<any>;
|
|
180
181
|
backdropRef: RefObject<any>;
|
|
181
|
-
initialValues: Partial<
|
|
182
|
+
initialValues: Partial<Record<string, any>>;
|
|
182
183
|
dialogRef: RefObject<any>;
|
|
183
184
|
headerRef: RefObject<any>;
|
|
184
185
|
bodyRef: RefObject<any>;
|
|
@@ -244,8 +245,15 @@ export type TInitialValues<T extends Record<string, any>> = T;
|
|
|
244
245
|
export type TUserProps = {
|
|
245
246
|
[K: string]: any;
|
|
246
247
|
};
|
|
247
|
-
export type
|
|
248
|
-
|
|
248
|
+
export type DialogValue = string | number | any[] | {
|
|
249
|
+
[k: string]: string | number | any[];
|
|
250
|
+
};
|
|
251
|
+
export type ModelDialogValues<T> = {
|
|
252
|
+
[K in keyof T]: DialogValue;
|
|
253
|
+
};
|
|
254
|
+
export type DialogValues<T> = ModelDialogValues<T>;
|
|
255
|
+
export type DialogHandlerFn = (...args: any[]) => any;
|
|
256
|
+
export type DialogHandlers = Record<string, DialogHandlerFn>;
|
|
249
257
|
export interface BaseDialogDOMRect {
|
|
250
258
|
height?: number;
|
|
251
259
|
width?: number;
|
|
@@ -269,6 +277,6 @@ export interface ICoords {
|
|
|
269
277
|
y: number;
|
|
270
278
|
}
|
|
271
279
|
export interface DialogProps {
|
|
272
|
-
setHeader(header: TDialogCallbackFn): Dialog
|
|
280
|
+
setHeader(header: TDialogCallbackFn): Dialog<Record<string, any>>;
|
|
273
281
|
}
|
|
274
282
|
export {};
|