react-dialogger 1.1.69 → 1.1.71
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.
|
@@ -36,7 +36,7 @@ declare class DialogBase<Values extends FormikProps<Values>> extends Component<B
|
|
|
36
36
|
private readonly _dialogWithBackDropRef;
|
|
37
37
|
protected readonly _parent: Dialog;
|
|
38
38
|
private _accessFrom;
|
|
39
|
-
private
|
|
39
|
+
private _processingListeners;
|
|
40
40
|
constructor(props?: Readonly<BaseDialogProps>);
|
|
41
41
|
private T;
|
|
42
42
|
private readonly _features;
|
package/components/DialogBase.js
CHANGED
|
@@ -70,6 +70,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
70
70
|
__extends(DialogBase, _super);
|
|
71
71
|
function DialogBase(props) {
|
|
72
72
|
if (props === void 0) { props = {}; }
|
|
73
|
+
var _a;
|
|
73
74
|
var _this = _super.call(this, props) || this;
|
|
74
75
|
// ✨✨✨✨✨✨✨✨✨✨✨
|
|
75
76
|
_this._dialogTranslate = { lastX: 0, lastY: 0 };
|
|
@@ -88,7 +89,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
88
89
|
return _this._actionRefs[key];
|
|
89
90
|
};
|
|
90
91
|
_this.setInProcess = function (process, message, holder) {
|
|
91
|
-
var _a, _b, _c;
|
|
92
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
92
93
|
_this._inProcess = __assign({ inProcess: process }, message ? { message: message } : {});
|
|
93
94
|
if (!process) {
|
|
94
95
|
_this._holder = null;
|
|
@@ -103,12 +104,12 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
103
104
|
for (var actionKey in _this._actionRefs) {
|
|
104
105
|
var action = _this._actionRefs[actionKey];
|
|
105
106
|
// Save the current disabled state before changing it
|
|
106
|
-
var currentDisabled = action.current.options.disabled;
|
|
107
|
+
var currentDisabled = (_d = (_c = action.current) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.disabled;
|
|
107
108
|
console.log('this._actions', currentDisabled, process);
|
|
108
109
|
// Set the options with prevDisabled as the current disabled state
|
|
109
110
|
if (currentDisabled !== process) {
|
|
110
111
|
action.current
|
|
111
|
-
.updateOptions(__assign(__assign({}, action.current.options), { prevDisabled: currentDisabled, disabled: process // Set the new disabled state based on the process
|
|
112
|
+
.updateOptions(__assign(__assign({}, (_f = (_e = action.current) === null || _e === void 0 ? void 0 : _e.options) !== null && _f !== void 0 ? _f : {}), { prevDisabled: currentDisabled, disabled: process // Set the new disabled state based on the process
|
|
112
113
|
}));
|
|
113
114
|
}
|
|
114
115
|
}
|
|
@@ -118,8 +119,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
118
119
|
var action = _this._actionRefs[actionKey];
|
|
119
120
|
// Restore the previous disabled state from options
|
|
120
121
|
// Call prevDisabled state from memo
|
|
121
|
-
action.current
|
|
122
|
-
.updateOptions(__assign(__assign({}, action.current.options), { disabled: action.current.options.prevDisabled // Set the new disabled state based on the process
|
|
122
|
+
(_g = action.current) === null || _g === void 0 ? void 0 : _g.updateOptions(__assign(__assign({}, (_j = (_h = action.current) === null || _h === void 0 ? void 0 : _h.options) !== null && _j !== void 0 ? _j : {}), { disabled: action.current.options.prevDisabled // Set the new disabled state based on the process
|
|
123
123
|
}));
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -127,11 +127,22 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
127
127
|
if (!process) {
|
|
128
128
|
_this.snackbar.close("kInProcess");
|
|
129
129
|
}
|
|
130
|
-
if
|
|
131
|
-
|
|
130
|
+
// if( typeof this._processingListener === "function" ){
|
|
131
|
+
// this._processingListener(process);
|
|
132
|
+
//
|
|
133
|
+
// }
|
|
134
|
+
for (var _i = 0, _l = _this._processingListeners; _i < _l.length; _i++) {
|
|
135
|
+
var listener = _l[_i];
|
|
136
|
+
if (typeof listener === "function") {
|
|
137
|
+
listener(process);
|
|
138
|
+
}
|
|
132
139
|
}
|
|
140
|
+
// if( ._processingListener === "function" ){
|
|
141
|
+
// // this._processingListener(process);
|
|
142
|
+
// //
|
|
143
|
+
// // }
|
|
133
144
|
// @ts-ignore
|
|
134
|
-
(
|
|
145
|
+
(_k = _this._footerRef.current) === null || _k === void 0 ? void 0 : _k.setProcessing(process);
|
|
135
146
|
return _this;
|
|
136
147
|
};
|
|
137
148
|
_this.isInProcess = function () {
|
|
@@ -182,7 +193,6 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
182
193
|
prevDialogRect: (0, _helpers_1.dialogRectAuto)(),
|
|
183
194
|
body: props.body
|
|
184
195
|
};
|
|
185
|
-
console.log('Class_Type', _this instanceof DialogBase);
|
|
186
196
|
var defaultOptions = {
|
|
187
197
|
base: {
|
|
188
198
|
initialAnchor: {
|
|
@@ -227,7 +237,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
227
237
|
_this._initialValues = props.initialValues;
|
|
228
238
|
_this._dialogWithBackDropRef = (0, react_1.createRef)();
|
|
229
239
|
_this._parent = props.parent;
|
|
230
|
-
_this.
|
|
240
|
+
_this._processingListeners = (_a = props.processingListeners) !== null && _a !== void 0 ? _a : [];
|
|
231
241
|
_this._features = [];
|
|
232
242
|
console.log('this._dialogOptions', _this._dialogOptions);
|
|
233
243
|
return _this;
|
|
@@ -401,7 +411,8 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
401
411
|
};
|
|
402
412
|
DialogBase.prototype.processingListener = function (listener) {
|
|
403
413
|
// @ts-ignore
|
|
404
|
-
this.
|
|
414
|
+
// this._processingListeners = listener;
|
|
415
|
+
this._processingListeners.push(listener);
|
|
405
416
|
return this;
|
|
406
417
|
};
|
|
407
418
|
Object.defineProperty(DialogBase.prototype, "snackbar", {
|
|
@@ -60,15 +60,17 @@ var DialogContentHeader = function (_a) {
|
|
|
60
60
|
var baseOptions = dialogOptions.base;
|
|
61
61
|
var _g = React.useState(bounds === null || bounds === void 0 ? void 0 : bounds.fullscreen), fullscreen = _g[0], setFullscreen = _g[1];
|
|
62
62
|
(0, react_1.useEffect)(function () {
|
|
63
|
+
var _a, _b, _c;
|
|
63
64
|
if (fullscreen) {
|
|
64
|
-
dialogRef.current.classList.add('fullscreen');
|
|
65
|
+
(_a = dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current) === null || _a === void 0 ? void 0 : _a.classList.add('fullscreen');
|
|
65
66
|
}
|
|
66
67
|
else {
|
|
67
|
-
dialogRef.current.classList.remove('fullscreen');
|
|
68
|
+
(_b = dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current) === null || _b === void 0 ? void 0 : _b.classList.remove('fullscreen');
|
|
68
69
|
}
|
|
69
|
-
dialogRef.current.classList.add('no-user-select');
|
|
70
|
+
(_c = dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current) === null || _c === void 0 ? void 0 : _c.classList.add('no-user-select');
|
|
70
71
|
setTimeout(function () {
|
|
71
|
-
|
|
72
|
+
var _a;
|
|
73
|
+
(_a = dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current) === null || _a === void 0 ? void 0 : _a.classList.remove('no-user-select');
|
|
72
74
|
}, 300);
|
|
73
75
|
}, [fullscreen]);
|
|
74
76
|
var CustomHeader = (_b = dialogOptions.slot) === null || _b === void 0 ? void 0 : _b.header;
|
package/models/Dialog.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface DialogProps {
|
|
|
5
5
|
setHeader(header: TDialogCallbackFn): Dialog;
|
|
6
6
|
}
|
|
7
7
|
declare class Dialog implements DialogProps {
|
|
8
|
-
private
|
|
8
|
+
private _processingListeners;
|
|
9
9
|
private _stateListener;
|
|
10
10
|
private _keyboardListener;
|
|
11
11
|
private _resizeListener;
|
package/models/Dialog.js
CHANGED
|
@@ -116,7 +116,7 @@ var Dialog = /** @class */ (function () {
|
|
|
116
116
|
};
|
|
117
117
|
Dialog.prototype.processingListener = function (listener) {
|
|
118
118
|
// @ts-ignore
|
|
119
|
-
this.
|
|
119
|
+
this._processingListeners = listener;
|
|
120
120
|
return this;
|
|
121
121
|
};
|
|
122
122
|
Dialog.prototype.initialValues = function (values) {
|
|
@@ -150,7 +150,7 @@ var Dialog = /** @class */ (function () {
|
|
|
150
150
|
// Refs
|
|
151
151
|
headerRef: this._headerRef,
|
|
152
152
|
// Listeners
|
|
153
|
-
stateListener: this._stateListener, keyboardListener: this._keyboardListener, resizeListener: this._resizeListener,
|
|
153
|
+
stateListener: this._stateListener, keyboardListener: this._keyboardListener, resizeListener: this._resizeListener, processingListeners: this._processingListeners,
|
|
154
154
|
// Others
|
|
155
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 });
|
|
156
156
|
// @ts-ignore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dialogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.71",
|
|
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/types/DialogTypes.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export interface BaseDialogProps {
|
|
|
42
42
|
root?: any;
|
|
43
43
|
keyboardListener: (key: string, dialog: IDialogApiDef) => void;
|
|
44
44
|
resizeListener?: (size: IDialogSize, dialog: IDialogApiDef) => void;
|
|
45
|
-
|
|
45
|
+
processingListeners?: Array<(inProcess: boolean) => void>;
|
|
46
46
|
}
|
|
47
47
|
export interface IDialogSize {
|
|
48
48
|
width?: ITypeWidth | number;
|