react-dialogger 1.1.133 → 1.1.134
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,24 +99,19 @@ var Placeholder = function (_a) {
|
|
|
99
99
|
// </div>
|
|
100
100
|
// }
|
|
101
101
|
var PlaceholderWrapper = function (_a) {
|
|
102
|
-
var _b, _c
|
|
102
|
+
var _b, _c;
|
|
103
103
|
var dialog = _a.dialog, dialogOptions = _a.dialogOptions, children = _a.children;
|
|
104
|
+
var _d = (_b = dialog.dialogOptions.slotProps.loader) !== null && _b !== void 0 ? _b : { message: null }, message = _d.message, loading = _d.loading;
|
|
104
105
|
var _e = React.useState({
|
|
105
|
-
message:
|
|
106
|
-
inProcess: true
|
|
106
|
+
message: message,
|
|
107
|
+
inProcess: typeof loading === "boolean" ? loading : true
|
|
107
108
|
}), inProcess = _e[0], setInProcess = _e[1];
|
|
108
109
|
React.useEffect(function () {
|
|
109
110
|
var unsubscribe = dialog.processingListener(function (processing) {
|
|
110
|
-
|
|
111
|
-
if (!processing) {
|
|
112
|
-
setTimeout(function () { return setInProcess(dialog.isInProcess()); }, 300);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
setInProcess(dialog.isInProcess());
|
|
116
|
-
}
|
|
111
|
+
setInProcess(dialog.isInProcess());
|
|
117
112
|
});
|
|
118
113
|
// return () => (unsubscribe as any)?.()
|
|
119
|
-
}, [
|
|
114
|
+
}, []);
|
|
120
115
|
var initialElement = React.useState(function () {
|
|
121
116
|
if (!children)
|
|
122
117
|
return null;
|
|
@@ -125,7 +120,7 @@ var PlaceholderWrapper = function (_a) {
|
|
|
125
120
|
var LoaderSlotElement = initialElement
|
|
126
121
|
? React.cloneElement(initialElement, __assign(__assign({}, dialog.dialogOptions.slotProps.loader), { values: dialog.values, inProcess: dialog.isInProcess() }))
|
|
127
122
|
: null;
|
|
128
|
-
var backgroundColor = (
|
|
123
|
+
var backgroundColor = (_c = dialogOptions.base.style.backgroundColor) !== null && _c !== void 0 ? _c : "#FFFFFF";
|
|
129
124
|
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-content-placeholder', style: { display: inProcess.inProcess ? 'flex' : 'none', backgroundColor: backgroundColor }, children: LoaderSlotElement });
|
|
130
125
|
};
|
|
131
126
|
// 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.134",
|
|
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",
|