react-dialogger 1.1.131 → 1.1.133
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.
|
@@ -99,12 +99,21 @@ var Placeholder = function (_a) {
|
|
|
99
99
|
// </div>
|
|
100
100
|
// }
|
|
101
101
|
var PlaceholderWrapper = function (_a) {
|
|
102
|
-
var _b;
|
|
102
|
+
var _b, _c, _d;
|
|
103
103
|
var dialog = _a.dialog, dialogOptions = _a.dialogOptions, children = _a.children;
|
|
104
|
-
var
|
|
104
|
+
var _e = React.useState({
|
|
105
|
+
message: (_c = (_b = dialog.dialogOptions.slotProps.loader) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : null,
|
|
106
|
+
inProcess: true
|
|
107
|
+
}), inProcess = _e[0], setInProcess = _e[1];
|
|
105
108
|
React.useEffect(function () {
|
|
106
|
-
var unsubscribe = dialog.processingListener(function () {
|
|
107
|
-
|
|
109
|
+
var unsubscribe = dialog.processingListener(function (processing) {
|
|
110
|
+
if (inProcess.inProcess !== processing) {
|
|
111
|
+
if (!processing) {
|
|
112
|
+
setTimeout(function () { return setInProcess(dialog.isInProcess()); }, 300);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
setInProcess(dialog.isInProcess());
|
|
116
|
+
}
|
|
108
117
|
});
|
|
109
118
|
// return () => (unsubscribe as any)?.()
|
|
110
119
|
}, [dialog]);
|
|
@@ -116,7 +125,7 @@ var PlaceholderWrapper = function (_a) {
|
|
|
116
125
|
var LoaderSlotElement = initialElement
|
|
117
126
|
? React.cloneElement(initialElement, __assign(__assign({}, dialog.dialogOptions.slotProps.loader), { values: dialog.values, inProcess: dialog.isInProcess() }))
|
|
118
127
|
: null;
|
|
119
|
-
var backgroundColor = (
|
|
128
|
+
var backgroundColor = (_d = dialogOptions.base.style.backgroundColor) !== null && _d !== void 0 ? _d : "#FFFFFF";
|
|
120
129
|
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-content-placeholder', style: { display: inProcess.inProcess ? 'flex' : 'none', backgroundColor: backgroundColor }, children: LoaderSlotElement });
|
|
121
130
|
};
|
|
122
131
|
// const DialogContentBody: React.FC<IContentBodyProps> = React.forwardRef(({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dialogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.133",
|
|
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
|
@@ -100,7 +100,10 @@ interface kSlotProps {
|
|
|
100
100
|
};
|
|
101
101
|
footer?: Record<string, any>;
|
|
102
102
|
header?: Record<string, any>;
|
|
103
|
-
loader?:
|
|
103
|
+
loader?: {
|
|
104
|
+
message?: string;
|
|
105
|
+
[key: string]: any;
|
|
106
|
+
};
|
|
104
107
|
}
|
|
105
108
|
export type DialogSlotLoaderProps = kSlotProps['loader'] & Pick<IDialogApiDef, 'values'> & {
|
|
106
109
|
processing: IInProcess;
|