react-dialogger 1.1.130 → 1.1.132
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,9 +99,12 @@ 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
109
|
var unsubscribe = dialog.processingListener(function () {
|
|
107
110
|
setInProcess(dialog.isInProcess());
|
|
@@ -116,8 +119,8 @@ var PlaceholderWrapper = function (_a) {
|
|
|
116
119
|
var LoaderSlotElement = initialElement
|
|
117
120
|
? React.cloneElement(initialElement, __assign(__assign({}, dialog.dialogOptions.slotProps.loader), { values: dialog.values, inProcess: dialog.isInProcess() }))
|
|
118
121
|
: null;
|
|
119
|
-
var backgroundColor = (
|
|
120
|
-
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-content-placeholder', style: { display: 'flex', backgroundColor: backgroundColor }, children: LoaderSlotElement });
|
|
122
|
+
var backgroundColor = (_d = dialogOptions.base.style.backgroundColor) !== null && _d !== void 0 ? _d : "#FFFFFF";
|
|
123
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-content-placeholder', style: { display: inProcess.inProcess ? 'flex' : 'none', backgroundColor: backgroundColor }, children: LoaderSlotElement });
|
|
121
124
|
};
|
|
122
125
|
// const DialogContentBody: React.FC<IContentBodyProps> = React.forwardRef(({
|
|
123
126
|
// body
|
|
@@ -150,7 +153,8 @@ var DialogContentBody = React.forwardRef(function (_a, ref) {
|
|
|
150
153
|
return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-body', style: { height: '100%' }, children: [dialog.holder && (0, jsx_runtime_1.jsx)(PlaceholderWrapper, { dialog: dialog, dialogOptions: dialog.dialogOptions, children: dialog.holder }), body(dialog)] });
|
|
151
154
|
}
|
|
152
155
|
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-body', style: { height: '100%', padding: 10 }, children: dialog.holder ?
|
|
153
|
-
|
|
156
|
+
// <Placeholder dialogOptions={dialog.dialogOptions} placeholder={dialog.holder} />
|
|
157
|
+
(0, jsx_runtime_1.jsx)(PlaceholderWrapper, { dialog: dialog, dialogOptions: dialog.dialogOptions, children: dialog.holder })
|
|
154
158
|
:
|
|
155
159
|
body });
|
|
156
160
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dialogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.132",
|
|
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,8 +100,14 @@ 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
|
}
|
|
108
|
+
export type DialogSlotLoaderProps = kSlotProps['loader'] & Pick<IDialogApiDef, 'values'> & {
|
|
109
|
+
processing: IInProcess;
|
|
110
|
+
};
|
|
105
111
|
export interface IBaseDialogOptions {
|
|
106
112
|
closeable?: boolean;
|
|
107
113
|
initialAnchor?: IDialogAnchor;
|