react-dialogger 1.1.49 → 1.1.50
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/components/DialogBase.js +3 -0
- package/models/Dialog.d.ts +2 -0
- package/models/Dialog.js +6 -2
- package/package.json +1 -1
package/components/DialogBase.js
CHANGED
|
@@ -150,6 +150,9 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
152
|
_this.kill(callbackFn);
|
|
153
|
+
if (typeof _this.props.onClose === "function") {
|
|
154
|
+
_this.props.onClose(_this);
|
|
155
|
+
}
|
|
153
156
|
};
|
|
154
157
|
_this.focus = function () {
|
|
155
158
|
if (_this._dialogRef.current) {
|
package/models/Dialog.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ declare class Dialog implements DialogProps {
|
|
|
20
20
|
private _initialValues;
|
|
21
21
|
private _headerRef;
|
|
22
22
|
private readonly _apiRef;
|
|
23
|
+
private _onCloseCallback;
|
|
23
24
|
constructor(dialogRef?: React.RefObject<IDialogApiDef | undefined | null> | null, options?: DialogOptionsType);
|
|
24
25
|
setHeader(header: TDialogCallbackFn): this;
|
|
25
26
|
setBody(body: TDialogCallbackFn): this;
|
|
@@ -33,6 +34,7 @@ declare class Dialog implements DialogProps {
|
|
|
33
34
|
initialHolder(holder: TInitialHolder): this;
|
|
34
35
|
keyboardListener(listener: (key: string, dialog: IDialogApiDef) => void): this;
|
|
35
36
|
resizeListener(listener: (size: IDialogSize, dialog: IDialogApiDef) => void): this;
|
|
37
|
+
onClose(callback: TDialogCallbackVoidFn): this;
|
|
36
38
|
private highestZ;
|
|
37
39
|
private createDom;
|
|
38
40
|
show(callback?: TDialogCallbackVoidFn): void;
|
package/models/Dialog.js
CHANGED
|
@@ -135,10 +135,14 @@ var Dialog = /** @class */ (function () {
|
|
|
135
135
|
this._resizeListener = listener;
|
|
136
136
|
return this;
|
|
137
137
|
};
|
|
138
|
+
Dialog.prototype.onClose = function (callback) {
|
|
139
|
+
this._onCloseCallback = callback;
|
|
140
|
+
return this;
|
|
141
|
+
};
|
|
138
142
|
Dialog.prototype.show = function (callback) {
|
|
139
143
|
var dom = this.createDom();
|
|
140
144
|
var root = (0, client_1.createRoot)(dom);
|
|
141
|
-
var props = __assign({
|
|
145
|
+
var props = __assign(__assign({
|
|
142
146
|
// Initials
|
|
143
147
|
initialOptions: this._dialogOptions, initialValues: this._initialValues, didMountCallback: callback,
|
|
144
148
|
// Component contents
|
|
@@ -148,7 +152,7 @@ var Dialog = /** @class */ (function () {
|
|
|
148
152
|
// Listeners
|
|
149
153
|
stateListener: this._stateListener, keyboardListener: this._keyboardListener, resizeListener: this._resizeListener,
|
|
150
154
|
// Others
|
|
151
|
-
dialogSize: this._dialogSize, initialHolder: this._initialHolder, snackbarAnchor: this._snackbarAnchor, root: root, dom: dom, parent: this }, this._apiRef ? { ref: this._apiRef } : null);
|
|
155
|
+
dialogSize: this._dialogSize, initialHolder: this._initialHolder, snackbarAnchor: this._snackbarAnchor, root: root, dom: dom, parent: this }, this._apiRef ? { ref: this._apiRef } : null), { onClose: this._onCloseCallback });
|
|
152
156
|
// @ts-ignore
|
|
153
157
|
root.render(React.createElement(DialogBase_1.default, props));
|
|
154
158
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dialogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.50",
|
|
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",
|