react-dialogger 1.1.53 → 1.1.55
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/Actions.d.ts +2 -2
- package/components/Actions.js +6 -5
- package/components/CircularProgress.d.ts +1 -1
- package/components/DialogActionBase.d.ts +8 -3
- package/components/DialogActionBase.js +11 -3
- package/components/DialogBase.d.ts +11 -12
- package/components/DialogBase.js +23 -11
- package/components/DialogContent.js +8 -8
- package/components/DialogContentBody.d.ts +1 -1
- package/components/DialogContentBody.js +3 -5
- package/components/DialogContentFooter.d.ts +1 -1
- package/components/DialogContentFooter.js +6 -6
- package/components/DialogContentHeader.d.ts +1 -2
- package/components/DialogContentHeader.js +10 -11
- package/components/DialogWithBackdropWrapper.js +6 -6
- package/components/RippleButton.d.ts +1 -1
- package/components/index.d.ts +2 -1
- package/components/index.js +5 -3
- package/context/DialogContentContextProvider.d.ts +2 -2
- package/context/DialogContentContextProvider.js +4 -4
- package/context/WithHeaderFooterContext.d.ts +3 -0
- package/context/WithHeaderFooterContext.js +54 -0
- package/context/index.d.ts +2 -3
- package/context/index.js +5 -41
- package/features/DialogCloseAction.js +15 -0
- package/features/DialogFullscreenAction.js +21 -0
- package/{components/Features → features}/DialogInfoAction.js +7 -7
- package/features/DialogProcessing.js +14 -0
- package/helpers/Resizeable.d.ts +1 -1
- package/helpers/Resizeable.js +2 -2
- package/helpers/dialogBoundsMemoize.d.ts +1 -1
- package/helpers/dialogRectAuto.d.ts +1 -1
- package/helpers/index.d.ts +3 -0
- package/helpers/index.js +6 -1
- package/helpers/initDialogMemoizeBounds.d.ts +1 -1
- package/icons/index.d.ts +5 -0
- package/icons/index.js +16 -0
- package/index.d.ts +3 -3
- package/index.js +8 -8
- package/models/Dialog.d.ts +1 -2
- package/models/DialogAction.d.ts +9 -5
- package/models/DialogAction.js +22 -40
- package/models/baseDialogOptions.d.ts +1 -1
- package/models/index.d.ts +1 -1
- package/models/index.js +16 -4
- package/package.json +1 -1
- package/types/DialogActionTypes.d.ts +7 -8
- package/types/DialogContentContextTypes.d.ts +3 -3
- package/types/DialogTypes.d.ts +74 -9
- package/types/index.d.ts +5 -5
- package/types/index.js +20 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +17 -0
- package/{components/utils → utils}/resizeManager.d.ts +2 -2
- package/{components/utils → utils}/resizeManager.js +2 -2
- package/components/Features/DialogCloseAction.js +0 -18
- package/components/Features/DialogFullscreenAction.js +0 -25
- package/components/Features/DialogProcessing.js +0 -14
- package/types/types.d.ts +0 -60
- package/types/types.js +0 -2
- /package/{components/Features → features}/DialogCloseAction.d.ts +0 -0
- /package/{components/Features → features}/DialogFullscreenAction.d.ts +0 -0
- /package/{components/Features → features}/DialogHeaderActionsWrapper.d.ts +0 -0
- /package/{components/Features → features}/DialogHeaderActionsWrapper.js +0 -0
- /package/{components/Features → features}/DialogInfoAction.d.ts +0 -0
- /package/{components/Features → features}/DialogProcessing.d.ts +0 -0
- /package/{components/Features → features}/index.d.ts +0 -0
- /package/{components/Features → features}/index.js +0 -0
- /package/{components/icons → icons}/CloseIcon.d.ts +0 -0
- /package/{components/icons → icons}/CloseIcon.js +0 -0
- /package/{components/icons → icons}/FullscreenExitIcon.d.ts +0 -0
- /package/{components/icons → icons}/FullscreenExitIcon.js +0 -0
- /package/{components/icons → icons}/FullscreenIcon.d.ts +0 -0
- /package/{components/icons → icons}/FullscreenIcon.js +0 -0
- /package/{components/icons → icons}/InfoIcon.d.ts +0 -0
- /package/{components/icons → icons}/InfoIcon.js +0 -0
- /package/{components/icons → icons}/ResizeIcon.d.ts +0 -0
- /package/{components/icons → icons}/ResizeIcon.js +0 -0
- /package/{components/utils → utils}/effects/jumper-animate.d.ts +0 -0
- /package/{components/utils → utils}/effects/jumper-animate.js +0 -0
package/components/Actions.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DialogAction } from "../models";
|
|
2
|
-
import DialogBase from "./
|
|
1
|
+
import { DialogAction } from "../models/index.js";
|
|
2
|
+
import { DialogBase } from "./index.js";
|
|
3
3
|
declare const Actions: ({ actions, dialog }: {
|
|
4
4
|
actions?: DialogAction[];
|
|
5
5
|
dialog: DialogBase<any>;
|
package/components/Actions.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Actions = void 0;
|
|
7
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
var
|
|
5
|
+
var _components_1 = require("./index.js");
|
|
9
6
|
var Actions = function (_a) {
|
|
10
7
|
var actions = _a.actions, dialog = _a.dialog;
|
|
11
8
|
var dialogOptions = dialog.dialogOptions;
|
|
12
9
|
return (0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', display: 'flex', flexDirection: 'row', columnGap: 10, alignItems: 'center' }, children: actions.map(function (action, index) {
|
|
13
10
|
console.log('Actions_action', action, action.getIntent());
|
|
14
11
|
var referencedAction = dialog.initializeActionRef(action.name);
|
|
15
|
-
return (0, jsx_runtime_1.jsx)(
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(_components_1.DialogActionBase, { name: action.name, ref: referencedAction, dialogBaseComponent: dialog, options: action.options,
|
|
13
|
+
//onClick={ action.onClickHandler() }
|
|
14
|
+
onClick: action._onCLick,
|
|
15
|
+
// inProcess={action.isInProcess()}
|
|
16
|
+
style: action.options.style, baseStyle: dialogOptions.base.actions.baseStyle, fontFamily: dialogOptions.base.style.fontFamily, stateListener: action._stateListener, intent: action.getIntent() }, index.toString());
|
|
16
17
|
}) });
|
|
17
18
|
};
|
|
18
19
|
exports.Actions = Actions;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Component } from "react";
|
|
2
|
-
import DialogBase from "./
|
|
3
|
-
import { ActionProps, ActionState, DialogActionType, TBVariant, TBColor, DialogActionOptionsType, TDialogStateListenerForActionCallbackType, ActionIntent } from "../types/
|
|
2
|
+
import { DialogBase } from "./index.js";
|
|
3
|
+
import { ActionProps, ActionState, DialogActionType, TBVariant, TBColor, DialogActionOptionsType, TDialogStateListenerForActionCallbackType, ActionIntent } from "../types/index.js";
|
|
4
4
|
declare class DialogActionBase extends Component<ActionProps, ActionState> {
|
|
5
5
|
get dialogBaseComponent(): DialogBase<any>;
|
|
6
6
|
protected _options: DialogActionOptionsType;
|
|
7
7
|
protected _intent: ActionIntent;
|
|
8
8
|
_stateListener: TDialogStateListenerForActionCallbackType;
|
|
9
9
|
protected _baseDialogAction?: DialogActionBase;
|
|
10
|
-
|
|
10
|
+
private readonly _name;
|
|
11
11
|
protected _onClick: ActionProps['onClick'];
|
|
12
12
|
private readonly _dialogBaseComponent;
|
|
13
13
|
protected _inProcess: ActionProps['inProcess'];
|
|
@@ -20,6 +20,11 @@ declare class DialogActionBase extends Component<ActionProps, ActionState> {
|
|
|
20
20
|
get baseDialogAction(): DialogActionBase;
|
|
21
21
|
getInitialClickHandler: () => DialogActionType;
|
|
22
22
|
updateOptions(options: DialogActionOptionsType): this;
|
|
23
|
+
/**
|
|
24
|
+
* use updateOptions
|
|
25
|
+
* @deprecated
|
|
26
|
+
* @link updateOptions */
|
|
27
|
+
setOptions(options: DialogActionOptionsType): this;
|
|
23
28
|
get options(): DialogActionOptionsType;
|
|
24
29
|
updateLabel: (label: string) => DialogActionBase;
|
|
25
30
|
getLabel(): string;
|
|
@@ -62,7 +62,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
62
62
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
63
63
|
var react_1 = require("react");
|
|
64
64
|
var React = __importStar(require("react"));
|
|
65
|
-
var
|
|
65
|
+
var _components_1 = require("./index.js");
|
|
66
66
|
var DialogActionBase = /** @class */ (function (_super) {
|
|
67
67
|
__extends(DialogActionBase, _super);
|
|
68
68
|
function DialogActionBase(props) {
|
|
@@ -157,7 +157,7 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
157
157
|
// Set as default converted from action name prop
|
|
158
158
|
var converted = (_b = (_a = _this.props.name) === null || _a === void 0 ? void 0 : _a.replace(/action/i, '')) !== null && _b !== void 0 ? _b : _this.props.name;
|
|
159
159
|
_this._options.label = (_g = ((_f = (_e = (_d = (_c = _this.props.dialogBaseComponent) === null || _c === void 0 ? void 0 : _c.dialogOptions) === null || _d === void 0 ? void 0 : _d.localText) === null || _e === void 0 ? void 0 : _e[converted]) !== null && _f !== void 0 ? _f : converted)) !== null && _g !== void 0 ? _g : 'Button';
|
|
160
|
-
return (0, jsx_runtime_1.jsx)(
|
|
160
|
+
return (0, jsx_runtime_1.jsx)(_components_1.RippleButton, { ref: _this._buttonRef, innerRef: _this._rippleButtonRef,
|
|
161
161
|
// Intent Based
|
|
162
162
|
variant: (_k = (_j = (_h = _this.state) === null || _h === void 0 ? void 0 : _h.intent) === null || _j === void 0 ? void 0 : _j.variant) !== null && _k !== void 0 ? _k : _this._options.variant,
|
|
163
163
|
// Intent Based
|
|
@@ -180,7 +180,7 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
180
180
|
* i → case-insensitive
|
|
181
181
|
* Daha temiz, daha kısa
|
|
182
182
|
*/
|
|
183
|
-
return (0, jsx_runtime_1.jsxs)(React.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
183
|
+
return (0, jsx_runtime_1.jsxs)(React.Fragment, { children: [(0, jsx_runtime_1.jsx)(_components_1.CircularProgress, { size: 15, inProcess: { inProcess: _this.isInProcess() } }), !_this.isInProcess() &&
|
|
184
184
|
_this.options.label] });
|
|
185
185
|
} });
|
|
186
186
|
};
|
|
@@ -235,6 +235,14 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
235
235
|
this.forceUpdate();
|
|
236
236
|
return this;
|
|
237
237
|
};
|
|
238
|
+
/**
|
|
239
|
+
* use updateOptions
|
|
240
|
+
* @deprecated
|
|
241
|
+
* @link updateOptions */
|
|
242
|
+
DialogActionBase.prototype.setOptions = function (options) {
|
|
243
|
+
this.updateOptions(options);
|
|
244
|
+
return this;
|
|
245
|
+
};
|
|
238
246
|
Object.defineProperty(DialogActionBase.prototype, "options", {
|
|
239
247
|
get: function () {
|
|
240
248
|
return this._options;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { Component, ReactNode, RefObject } from
|
|
1
|
+
import { Component, ReactNode, RefObject } from 'react';
|
|
2
2
|
import { FormikProps } from "formik";
|
|
3
|
-
import { DialogActionBase } from "./";
|
|
4
|
-
import { IInProcess, TInitialHolder, ISnackbarAnchor, TSeverity, DialogValues, TAccessFrom } from "../types/
|
|
5
|
-
import
|
|
6
|
-
import { DialogContentFooterReturnType } from "../types/DialogActionTypes";
|
|
7
|
-
import Dialog, { DialogAction } from "../index";
|
|
3
|
+
import { DialogActionBase } from "./index.js";
|
|
4
|
+
import { BaseDialogProps, BaseDialogState, IDialogSize, DialogOptionsType, TDialogCallbackFn, TDialogCallbackVoidFn, WithBackdrop, IInProcess, TInitialHolder, ISnackbarAnchor, TSeverity, DialogValues, TAccessFrom, ActionBaseDef, DialogContentFooterReturnType, DialogFormikAdapter } from "../types/index.js";
|
|
5
|
+
import Dialog, { DialogAction } from "../models/index.js";
|
|
8
6
|
interface IFormikAdapter extends Pick<FormikProps<any>, 'setValues' | 'setFieldValue' | 'values'> {
|
|
9
7
|
}
|
|
10
8
|
type FeatureType = Partial<Record<string, any>>;
|
|
11
|
-
declare class DialogBase<Values extends
|
|
9
|
+
declare class DialogBase<Values extends FormikProps<Values>> extends Component<BaseDialogProps, BaseDialogState> {
|
|
12
10
|
_dialogTranslate: {
|
|
13
11
|
lastX: number;
|
|
14
12
|
lastY: number;
|
|
@@ -22,7 +20,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
|
|
|
22
20
|
protected _actions: DialogAction[];
|
|
23
21
|
protected _dialogSize: IDialogSize;
|
|
24
22
|
protected _holder?: TInitialHolder;
|
|
25
|
-
protected _formikProps:
|
|
23
|
+
protected _formikProps: DialogFormikAdapter<any>;
|
|
26
24
|
protected readonly _backdropRef: RefObject<any>;
|
|
27
25
|
protected readonly _dialogRef: RefObject<any>;
|
|
28
26
|
protected readonly _dialogBodyRef: RefObject<any>;
|
|
@@ -54,9 +52,9 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
|
|
|
54
52
|
initializeActionRef: (key: string) => RefObject<DialogActionBase>;
|
|
55
53
|
get dialogOptions(): DialogOptionsType;
|
|
56
54
|
get holder(): DialogOptionsType;
|
|
57
|
-
get formikProps():
|
|
58
|
-
set formikProps(value:
|
|
59
|
-
get formikValidate(): Promise<
|
|
55
|
+
get formikProps(): DialogFormikAdapter<any>;
|
|
56
|
+
set formikProps(value: DialogFormikAdapter<any>);
|
|
57
|
+
get formikValidate(): Promise<DialogFormikAdapter<any>>;
|
|
60
58
|
set inlineFormikProps(inlineFormikProps: IFormikAdapter);
|
|
61
59
|
get values(): IFormikAdapter['values'];
|
|
62
60
|
setValue(key: string, value: any): void;
|
|
@@ -68,7 +66,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
|
|
|
68
66
|
close: (callbackFn?: () => void) => void;
|
|
69
67
|
focus: () => void;
|
|
70
68
|
get actions(): {
|
|
71
|
-
[key: string]:
|
|
69
|
+
[key: string]: ActionBaseDef;
|
|
72
70
|
};
|
|
73
71
|
updateBody(body: TDialogCallbackFn): void;
|
|
74
72
|
processingListener(listener: (inProcess: boolean) => void): this;
|
|
@@ -84,6 +82,7 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
|
|
|
84
82
|
}) => void;
|
|
85
83
|
close: (key?: string) => void;
|
|
86
84
|
};
|
|
85
|
+
private Body;
|
|
87
86
|
render: () => import("react/jsx-runtime").JSX.Element;
|
|
88
87
|
}
|
|
89
88
|
export default DialogBase;
|
package/components/DialogBase.js
CHANGED
|
@@ -58,17 +58,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
58
58
|
return result;
|
|
59
59
|
};
|
|
60
60
|
})();
|
|
61
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
-
};
|
|
64
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
62
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
66
63
|
var react_1 = require("react");
|
|
64
|
+
var formik_1 = require("formik");
|
|
67
65
|
var React = __importStar(require("react"));
|
|
68
66
|
var lodash_1 = require("lodash");
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
67
|
+
var _components_1 = require("./index.js");
|
|
68
|
+
var _helpers_1 = require("../helpers/index.js");
|
|
69
|
+
var _context_1 = require("../context/index.js");
|
|
72
70
|
var DialogBase = /** @class */ (function (_super) {
|
|
73
71
|
__extends(DialogBase, _super);
|
|
74
72
|
function DialogBase(props) {
|
|
@@ -166,21 +164,35 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
166
164
|
_this.getDom = function () {
|
|
167
165
|
return _this.props.dom;
|
|
168
166
|
};
|
|
167
|
+
_this.Body = function (_a) {
|
|
168
|
+
var body = _a.body;
|
|
169
|
+
var formikProps = (0, formik_1.useFormik)({
|
|
170
|
+
initialValues: {},
|
|
171
|
+
onSubmit: function (values, formikHelpers) { }
|
|
172
|
+
});
|
|
173
|
+
console.log('Body_formikProps', formikProps);
|
|
174
|
+
if (body instanceof Function) {
|
|
175
|
+
return (0, jsx_runtime_1.jsxs)("div", { ref: _this._dialogBodyRef, className: 'dialog-body', style: { height: '100%' }, children: ["N", body(_this)] });
|
|
176
|
+
}
|
|
177
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-body', style: { height: '100%', padding: 10 }, children: body });
|
|
178
|
+
};
|
|
169
179
|
_this.render = function () {
|
|
170
180
|
console.log('this._prevDialogRect', _this.state.prevDialogRect);
|
|
171
|
-
return (0, jsx_runtime_1.jsx)(
|
|
181
|
+
return (0, jsx_runtime_1.jsx)(_context_1.DialogContentContextProvider
|
|
172
182
|
// 1️⃣initialValues={this.props.initialValues}
|
|
173
183
|
, {
|
|
174
184
|
// 1️⃣initialValues={this.props.initialValues}
|
|
175
185
|
dialogBase: _this,
|
|
176
186
|
// Component
|
|
187
|
+
// body={this.state.body(this)}
|
|
177
188
|
body: _this.state.body,
|
|
189
|
+
// body={<this.Body body={this.state.body} /> as any}
|
|
178
190
|
// Refs Props
|
|
179
|
-
dialogRef: _this._dialogRef, headerRef: _this._headerRef, bodyRef: _this._dialogBodyRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, snackbarRef: _this._snackbarRef, prevDialogRect: _this.state.prevDialogRect, children: (0, jsx_runtime_1.jsx)(
|
|
191
|
+
dialogRef: _this._dialogRef, headerRef: _this._headerRef, bodyRef: _this._dialogBodyRef, footerRef: _this._footerRef, backdropRef: _this._backdropRef, snackbarRef: _this._snackbarRef, prevDialogRect: _this.state.prevDialogRect, children: (0, jsx_runtime_1.jsx)(_components_1.DialogWithBackdropWrapper, {}) });
|
|
180
192
|
};
|
|
181
193
|
_this.state = {
|
|
182
194
|
inProcess: { inProcess: false },
|
|
183
|
-
prevDialogRect: (0,
|
|
195
|
+
prevDialogRect: (0, _helpers_1.dialogRectAuto)(),
|
|
184
196
|
body: props.body
|
|
185
197
|
};
|
|
186
198
|
console.log('Class_Type', _this instanceof DialogBase);
|
|
@@ -385,8 +397,8 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
385
397
|
var _this = this;
|
|
386
398
|
var __actions = {};
|
|
387
399
|
this._actions.forEach(function (action, index) {
|
|
388
|
-
var _a
|
|
389
|
-
__actions[action.name] = (
|
|
400
|
+
var _a;
|
|
401
|
+
__actions[action.name] = (_a = _this._actionRefs[action.name]) === null || _a === void 0 ? void 0 : _a.current; // ?? action;
|
|
390
402
|
});
|
|
391
403
|
return __actions;
|
|
392
404
|
},
|
|
@@ -64,16 +64,16 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
64
64
|
var react_draggable_1 = __importDefault(require("react-draggable"));
|
|
65
65
|
var helpers_1 = require("../helpers");
|
|
66
66
|
var React = __importStar(require("react"));
|
|
67
|
-
var
|
|
67
|
+
var _icons_1 = require("../icons/index.js");
|
|
68
68
|
var notistack_1 = require("notistack");
|
|
69
69
|
var _1 = require("./");
|
|
70
70
|
var react_1 = require("react");
|
|
71
|
-
var
|
|
72
|
-
var jumper_animate_1 = require("
|
|
73
|
-
var
|
|
71
|
+
var _helpers_1 = require("../helpers/index.js");
|
|
72
|
+
var jumper_animate_1 = require("../utils/effects/jumper-animate");
|
|
73
|
+
var _context_1 = require("../context/index.js");
|
|
74
74
|
var DialogContent = function (props) {
|
|
75
75
|
var _a, _b, _c, _d, _e;
|
|
76
|
-
var _f = (0, react_1.useContext)(
|
|
76
|
+
var _f = (0, react_1.useContext)(_context_1.DialogContentContext), dialog = _f.dialog, dialogRef = _f.dialogRef, prevDialogRect = _f.prevDialogRect, backdropRef = _f.backdropRef, snackbarRef = _f.snackbarRef, footerRef = _f.footerRef, resizeableObject = _f.resizeableObject, body = _f.body;
|
|
77
77
|
var dialogOptions = dialog.dialogOptions;
|
|
78
78
|
var baseOptions = dialogOptions.base;
|
|
79
79
|
var _g = React.useState(false), fullscreenMode = _g[0], setFullscreenMode = _g[1];
|
|
@@ -108,7 +108,7 @@ var DialogContent = function (props) {
|
|
|
108
108
|
// Listener & Animate
|
|
109
109
|
(0, react_1.useEffect)(function () {
|
|
110
110
|
// setDialogRect();
|
|
111
|
-
(0,
|
|
111
|
+
(0, _helpers_1.formInputKeyListeners)(dialogRef.current);
|
|
112
112
|
if (dialog.dialogOptions.animate === 'jumper') {
|
|
113
113
|
(0, jumper_animate_1.jumperAnimate)(dialogRef.current);
|
|
114
114
|
}
|
|
@@ -168,9 +168,9 @@ var DialogContent = function (props) {
|
|
|
168
168
|
// @ts-ignore
|
|
169
169
|
dialog.props.keyboardListener(e.key, _this);
|
|
170
170
|
}
|
|
171
|
-
}, className: baseOptions.size.width === 'auto' ? 'auto' : "dialog-width-".concat(dialogOptions.base.size.width, " dialog-main show-opacity show-position-").concat(baseOptions.initialAnchor.vertical), style: __assign(__assign(__assign(__assign({ height: (_b = baseOptions.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof baseOptions.size.width === "number" ? { width: "".concat(baseOptions.size.width, "px") } : { width: "".concat(baseOptions.size.width) }), { outline: 'none', fontFamily: (_c = baseOptions.style.fontFamily) !== null && _c !== void 0 ? _c : 'Arial' }), rect), { alignSelf: (_d = baseOptions.initialAnchor.vertical) !== null && _d !== void 0 ? _d : 'flex-start', justifySelf: (_e = baseOptions.initialAnchor.horizontal) !== null && _e !== void 0 ? _e : 'flex-start' }), children: (0, jsx_runtime_1.jsxs)(notistack_1.SnackbarProvider, { ref: snackbarRef, maxSnack: dialog.dialogOptions.snackbar.maxSnack, children: [(dialog.props.header || dialogOptions.slot.header) && ((0, jsx_runtime_1.jsx)(_1.DialogContentHeader, { header: dialog.props.header, bounds: bounds })), (0, jsx_runtime_1.jsx)(_1.DialogContentBody, { body:
|
|
171
|
+
}, className: baseOptions.size.width === 'auto' ? 'auto' : "dialog-width-".concat(dialogOptions.base.size.width, " dialog-main show-opacity show-position-").concat(baseOptions.initialAnchor.vertical), style: __assign(__assign(__assign(__assign({ height: (_b = baseOptions.size.height) !== null && _b !== void 0 ? _b : 'auto' }, typeof baseOptions.size.width === "number" ? { width: "".concat(baseOptions.size.width, "px") } : { width: "".concat(baseOptions.size.width) }), { outline: 'none', fontFamily: (_c = baseOptions.style.fontFamily) !== null && _c !== void 0 ? _c : 'Arial' }), rect), { alignSelf: (_d = baseOptions.initialAnchor.vertical) !== null && _d !== void 0 ? _d : 'flex-start', justifySelf: (_e = baseOptions.initialAnchor.horizontal) !== null && _e !== void 0 ? _e : 'flex-start' }), children: (0, jsx_runtime_1.jsxs)(notistack_1.SnackbarProvider, { ref: snackbarRef, maxSnack: dialog.dialogOptions.snackbar.maxSnack, children: [(dialog.props.header || dialogOptions.slot.header) && ((0, jsx_runtime_1.jsx)(_1.DialogContentHeader, { header: dialog.props.header, bounds: bounds })), (0, jsx_runtime_1.jsx)(_1.DialogContentBody, { body: body }), (0, jsx_runtime_1.jsx)(_1.DialogContentFooter, { ref: footerRef }), (baseOptions.resizeable) &&
|
|
172
172
|
(0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "resizable-handle", style: {
|
|
173
173
|
zIndex: parseInt(domZIndex) + 1
|
|
174
|
-
}, onMouseDown: resizeableObject === null || resizeableObject === void 0 ? void 0 : resizeableObject.resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(
|
|
174
|
+
}, onMouseDown: resizeableObject === null || resizeableObject === void 0 ? void 0 : resizeableObject.resizeHandleMouseDown, children: (0, jsx_runtime_1.jsx)(_icons_1.ResizeIcon, { color: '#286e94' }) }) })] }) }) });
|
|
175
175
|
};
|
|
176
176
|
exports.DialogContent = DialogContent;
|
|
@@ -37,7 +37,7 @@ exports.DialogContentBody = void 0;
|
|
|
37
37
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
var React = __importStar(require("react"));
|
|
39
39
|
var react_1 = require("react");
|
|
40
|
-
var
|
|
40
|
+
var _context_1 = require("../context/index.js");
|
|
41
41
|
var Placeholder = function (_a) {
|
|
42
42
|
var dialogOptions = _a.dialogOptions, placeholder = _a.placeholder;
|
|
43
43
|
var bgColor = dialogOptions.base.style.backgroundColor ?
|
|
@@ -53,14 +53,12 @@ var Placeholder = function (_a) {
|
|
|
53
53
|
var DialogContentBody = React.forwardRef(function (_a, ref) {
|
|
54
54
|
// const [localBody, setLocalBody] = React.useState(null);
|
|
55
55
|
var body = _a.body;
|
|
56
|
-
var dialog = (0, react_1.useContext)(
|
|
56
|
+
var dialog = (0, react_1.useContext)(_context_1.DialogContentContext).dialog;
|
|
57
57
|
// useEffect(() => {
|
|
58
58
|
// setLocalBody(body(dialog));
|
|
59
59
|
// }, [body]);
|
|
60
60
|
if (body instanceof Function) {
|
|
61
|
-
|
|
62
|
-
console.log('Typeof BodyElement', BodyElement);
|
|
63
|
-
return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-body', style: { height: '100%' }, children: [dialog.holder && (0, jsx_runtime_1.jsx)(Placeholder, { dialogOptions: dialog.dialogOptions, placeholder: dialog.holder }), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: BodyElement })] });
|
|
61
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-body', style: { height: '100%' }, children: [dialog.holder && (0, jsx_runtime_1.jsx)(Placeholder, { dialogOptions: dialog.dialogOptions, placeholder: dialog.holder }), body] });
|
|
64
62
|
}
|
|
65
63
|
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-body', style: { height: '100%', padding: 10 }, children: dialog.holder ?
|
|
66
64
|
(0, jsx_runtime_1.jsx)(Placeholder, { dialogOptions: dialog.dialogOptions, placeholder: dialog.holder })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { DialogContentFooterReturnType, IContentFooterProps } from "../types/
|
|
2
|
+
import { DialogContentFooterReturnType, IContentFooterProps } from "../types/index.js";
|
|
3
3
|
declare const DialogContentFooter: React.ForwardRefExoticComponent<IContentFooterProps & React.RefAttributes<DialogContentFooterReturnType>>;
|
|
4
4
|
export { DialogContentFooter };
|
|
@@ -49,13 +49,13 @@ exports.DialogContentFooter = void 0;
|
|
|
49
49
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
50
50
|
var React = __importStar(require("react"));
|
|
51
51
|
var react_1 = require("react");
|
|
52
|
-
var
|
|
53
|
-
var
|
|
52
|
+
var _features_1 = require("../features/index.js");
|
|
53
|
+
var _context_1 = require("../context/index.js");
|
|
54
54
|
var _1 = require("./");
|
|
55
|
-
var
|
|
55
|
+
var _context_2 = require("../context/index.js");
|
|
56
56
|
var DialogContentFooter = (0, react_1.forwardRef)(function (props, ref) {
|
|
57
57
|
var _a, _b, _c;
|
|
58
|
-
var dialog = (0, react_1.useContext)(
|
|
58
|
+
var dialog = (0, react_1.useContext)(_context_2.DialogContentContext).dialog;
|
|
59
59
|
var dialogOptions = dialog.dialogOptions;
|
|
60
60
|
var CustomFooter = (_a = dialogOptions.slot) === null || _a === void 0 ? void 0 : _a.footer;
|
|
61
61
|
// Imperative handle
|
|
@@ -78,9 +78,9 @@ var DialogContentFooter = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
78
78
|
inProcess: dialog.isInProcess()
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-footer', style: (_c = (_b = dialogOptions.base) === null || _b === void 0 ? void 0 : _b.footer) === null || _c === void 0 ? void 0 : _c.style, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(
|
|
81
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-footer', style: (_c = (_b = dialogOptions.base) === null || _b === void 0 ? void 0 : _b.footer) === null || _c === void 0 ? void 0 : _c.style, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(_context_1.WithHeaderFooterContext, __assign({}, staticProps, { dialog: dialog, children: dialogOptions.slot.footer ?
|
|
82
82
|
(0, jsx_runtime_1.jsx)(CustomFooter, __assign({}, staticProps, footerProps))
|
|
83
83
|
:
|
|
84
|
-
(0, jsx_runtime_1.jsx)(
|
|
84
|
+
(0, jsx_runtime_1.jsx)(_features_1.DialogProcessing, {}) })) }), (0, jsx_runtime_1.jsx)(_1.Actions, { dialog: dialog, actions: dialog.props.actions })] });
|
|
85
85
|
});
|
|
86
86
|
exports.DialogContentFooter = DialogContentFooter;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { TDialogCallbackFn } from "../types/
|
|
1
|
+
import { TDialogCallbackFn, IDialogBoundsDef } from "../types/index.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { IDialogBoundsDef } from "../types/BoundTypes";
|
|
4
3
|
interface IContentHeaderProps {
|
|
5
4
|
header: TDialogCallbackFn;
|
|
6
5
|
bounds: IDialogBoundsDef;
|
|
@@ -47,16 +47,15 @@ var _this = this;
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.DialogContentHeader = void 0;
|
|
49
49
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
50
|
-
var
|
|
50
|
+
var _features_1 = require("../features/index.js");
|
|
51
51
|
var React = __importStar(require("react"));
|
|
52
52
|
var react_1 = require("react");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var DialogContentContextProvider_1 = require("../context/DialogContentContextProvider");
|
|
53
|
+
var _helpers_1 = require("../helpers/index.js");
|
|
54
|
+
var _context_1 = require("../context/index.js");
|
|
56
55
|
var DialogContentHeader = function (_a) {
|
|
57
56
|
var _b, _c, _d, _e;
|
|
58
57
|
var header = _a.header, bounds = _a.bounds;
|
|
59
|
-
var _f = (0, react_1.useContext)(
|
|
58
|
+
var _f = (0, react_1.useContext)(_context_1.DialogContentContext), dialog = _f.dialog, dialogRef = _f.dialogRef;
|
|
60
59
|
var dialogOptions = dialog.dialogOptions;
|
|
61
60
|
var baseOptions = dialogOptions.base;
|
|
62
61
|
var _g = React.useState(bounds === null || bounds === void 0 ? void 0 : bounds.fullscreen), fullscreen = _g[0], setFullscreen = _g[1];
|
|
@@ -84,23 +83,23 @@ var DialogContentHeader = function (_a) {
|
|
|
84
83
|
if ((_a = dialog === null || dialog === void 0 ? void 0 : dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.fullscreen) {
|
|
85
84
|
setFullscreen(!fullscreen);
|
|
86
85
|
}
|
|
87
|
-
}, style: (_c = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _c === void 0 ? void 0 : _c.style, className: "dialog-header ".concat(baseOptions.draggable && !dialog.state.fullscreenMode ? 'drag-handle' : ''), children: (0, jsx_runtime_1.jsx)(
|
|
86
|
+
}, style: (_c = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _c === void 0 ? void 0 : _c.style, className: "dialog-header ".concat(baseOptions.draggable && !dialog.state.fullscreenMode ? 'drag-handle' : ''), children: (0, jsx_runtime_1.jsx)(_context_1.WithHeaderFooterContext, { dialog: dialog, children: (0, jsx_runtime_1.jsx)(CustomHeader, __assign({}, staticProps, headerProps, { dialog: _this })) }) });
|
|
88
87
|
}
|
|
89
88
|
if (header instanceof Function) {
|
|
90
89
|
return (0, jsx_runtime_1.jsxs)("div", { onDoubleClick: function (event) {
|
|
91
90
|
if (baseOptions.fullscreen) {
|
|
92
91
|
if (bounds) {
|
|
93
|
-
(0,
|
|
92
|
+
(0, _helpers_1.setDialogBounds)(dialog.dialogOptions.base.id, __assign(__assign({}, bounds), { fullscreen: !fullscreen }), dialogRef);
|
|
94
93
|
}
|
|
95
94
|
setFullscreen(!fullscreen);
|
|
96
95
|
event.stopPropagation();
|
|
97
96
|
event.preventDefault();
|
|
98
97
|
}
|
|
99
98
|
}, style: (_d = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _d === void 0 ? void 0 : _d.style, className: "dialog-header ".concat(baseOptions.draggable && !fullscreen ? 'drag-handle' : ''), children: [header(dialog), (baseOptions.closeable || baseOptions.fullscreen) &&
|
|
100
|
-
(0, jsx_runtime_1.jsx)(
|
|
101
|
-
(0, jsx_runtime_1.jsx)(
|
|
102
|
-
(0, jsx_runtime_1.jsx)(
|
|
103
|
-
(0, jsx_runtime_1.jsx)(
|
|
99
|
+
(0, jsx_runtime_1.jsx)(_context_1.WithHeaderFooterContext, { dialog: dialog, fullscreen: fullscreen, setFullscreen: setFullscreen, children: (0, jsx_runtime_1.jsxs)(_features_1.DialogHeaderActionsWrapper, { children: [baseOptions.fullscreen &&
|
|
100
|
+
(0, jsx_runtime_1.jsx)(_features_1.DialogFullscreenAction, {}), baseOptions.closeable &&
|
|
101
|
+
(0, jsx_runtime_1.jsx)(_features_1.DialogCloseAction, {}), baseOptions.about &&
|
|
102
|
+
(0, jsx_runtime_1.jsx)(_features_1.DialogInfoAction, {})] }) })] });
|
|
104
103
|
}
|
|
105
104
|
return (0, jsx_runtime_1.jsx)("div", { style: (_e = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.header) === null || _e === void 0 ? void 0 : _e.style, className: 'drag-handle dialog-header', children: header });
|
|
106
105
|
};
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DialogWithBackdropWrapper = void 0;
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var react_1 = require("react");
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var _components_1 = require("./index.js");
|
|
7
|
+
var _helpers_1 = require("../helpers/index.js");
|
|
8
|
+
var _context_1 = require("../context/index.js");
|
|
9
9
|
var DialogWithBackdropWrapper = function () {
|
|
10
|
-
var _a = (0, react_1.useContext)(
|
|
10
|
+
var _a = (0, react_1.useContext)(_context_1.DialogContentContext), dialog = _a.dialog, backdropRef = _a.backdropRef, baseZoomEffect = _a.baseZoomEffect;
|
|
11
11
|
var _b = dialog.dialogOptions.backdrop, backgroundColor = _b.backgroundColor, opacity = _b.opacity;
|
|
12
|
-
var bgCl = (0,
|
|
12
|
+
var bgCl = (0, _helpers_1.hexToRgb)(backgroundColor, opacity);
|
|
13
13
|
return (0, jsx_runtime_1.jsx)("div", { className: "dialog-backdrop dialog-backdrop-show", ref: backdropRef, style: {
|
|
14
14
|
justifyContent: dialog.dialogOptions.base.initialAnchor.horizontal,
|
|
15
15
|
// alignItems: dialogOptions.base.initialAnchor.vertical,
|
|
@@ -22,6 +22,6 @@ var DialogWithBackdropWrapper = function () {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
baseZoomEffect();
|
|
25
|
-
}, children: (0, jsx_runtime_1.jsx)(
|
|
25
|
+
}, children: (0, jsx_runtime_1.jsx)(_components_1.DialogContent, {}) });
|
|
26
26
|
};
|
|
27
27
|
exports.DialogWithBackdropWrapper = DialogWithBackdropWrapper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CSSProperties, ReactNode } from "react";
|
|
3
|
-
import { TBVariant, TBColor } from '../types/
|
|
3
|
+
import { TBVariant, TBColor } from '../types/index.js';
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<{
|
|
5
5
|
variant: TBVariant;
|
|
6
6
|
color: TBColor;
|
package/components/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ export { default as CircularProgress } from "./CircularProgress";
|
|
|
2
2
|
export { DialogContentFooter } from "./DialogContentFooter";
|
|
3
3
|
export { DialogContentBody } from "./DialogContentBody";
|
|
4
4
|
export { DialogContent } from "./DialogContent";
|
|
5
|
-
export { default as DialogActionBase } from "./DialogActionBase";
|
|
6
5
|
export { DialogContentHeader } from "./DialogContentHeader";
|
|
7
6
|
export { DialogWithBackdropWrapper } from "./DialogWithBackdropWrapper";
|
|
8
7
|
export { Actions } from "./Actions";
|
|
9
8
|
export { default as RippleButton } from "./RippleButton";
|
|
9
|
+
export { default as DialogBase } from "./DialogBase";
|
|
10
|
+
export { default as DialogActionBase } from "./DialogActionBase";
|
package/components/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.DialogActionBase = exports.DialogBase = exports.RippleButton = exports.Actions = exports.DialogWithBackdropWrapper = exports.DialogContentHeader = exports.DialogContent = exports.DialogContentBody = exports.DialogContentFooter = exports.CircularProgress = void 0;
|
|
7
7
|
var CircularProgress_1 = require("./CircularProgress");
|
|
8
8
|
Object.defineProperty(exports, "CircularProgress", { enumerable: true, get: function () { return __importDefault(CircularProgress_1).default; } });
|
|
9
9
|
var DialogContentFooter_1 = require("./DialogContentFooter");
|
|
@@ -12,8 +12,6 @@ var DialogContentBody_1 = require("./DialogContentBody");
|
|
|
12
12
|
Object.defineProperty(exports, "DialogContentBody", { enumerable: true, get: function () { return DialogContentBody_1.DialogContentBody; } });
|
|
13
13
|
var DialogContent_1 = require("./DialogContent");
|
|
14
14
|
Object.defineProperty(exports, "DialogContent", { enumerable: true, get: function () { return DialogContent_1.DialogContent; } });
|
|
15
|
-
var DialogActionBase_1 = require("./DialogActionBase");
|
|
16
|
-
Object.defineProperty(exports, "DialogActionBase", { enumerable: true, get: function () { return __importDefault(DialogActionBase_1).default; } });
|
|
17
15
|
var DialogContentHeader_1 = require("./DialogContentHeader");
|
|
18
16
|
Object.defineProperty(exports, "DialogContentHeader", { enumerable: true, get: function () { return DialogContentHeader_1.DialogContentHeader; } });
|
|
19
17
|
var DialogWithBackdropWrapper_1 = require("./DialogWithBackdropWrapper");
|
|
@@ -22,3 +20,7 @@ var Actions_1 = require("./Actions");
|
|
|
22
20
|
Object.defineProperty(exports, "Actions", { enumerable: true, get: function () { return Actions_1.Actions; } });
|
|
23
21
|
var RippleButton_1 = require("./RippleButton");
|
|
24
22
|
Object.defineProperty(exports, "RippleButton", { enumerable: true, get: function () { return __importDefault(RippleButton_1).default; } });
|
|
23
|
+
var DialogBase_1 = require("./DialogBase");
|
|
24
|
+
Object.defineProperty(exports, "DialogBase", { enumerable: true, get: function () { return __importDefault(DialogBase_1).default; } });
|
|
25
|
+
var DialogActionBase_1 = require("./DialogActionBase");
|
|
26
|
+
Object.defineProperty(exports, "DialogActionBase", { enumerable: true, get: function () { return __importDefault(DialogActionBase_1).default; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DialogContentContextProviderProps, DialogContentContextProviderSharedProps } from "../types/
|
|
2
|
+
import { DialogContentContextProviderProps, DialogContentContextProviderSharedProps } from "../types/index.js";
|
|
3
3
|
export declare const DialogContentContext: React.Context<DialogContentContextProviderSharedProps>;
|
|
4
4
|
declare const DialogContentContextProvider: React.FC<DialogContentContextProviderProps>;
|
|
5
|
-
export
|
|
5
|
+
export { DialogContentContextProvider };
|
|
@@ -55,10 +55,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
55
|
return t;
|
|
56
56
|
};
|
|
57
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.DialogContentContext = void 0;
|
|
58
|
+
exports.DialogContentContextProvider = exports.DialogContentContext = void 0;
|
|
59
59
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
60
60
|
var react_1 = __importStar(require("react"));
|
|
61
|
-
var
|
|
61
|
+
var _utils_1 = require("../utils/index.js");
|
|
62
62
|
var formik_1 = require("formik");
|
|
63
63
|
exports.DialogContentContext = react_1.default.createContext(null);
|
|
64
64
|
var DialogContentContextProvider = function (props) {
|
|
@@ -71,7 +71,7 @@ var DialogContentContextProvider = function (props) {
|
|
|
71
71
|
// snackbarRef,
|
|
72
72
|
// prevDialogRect,
|
|
73
73
|
restProps = __rest(props, ["dialogBase", "children"]);
|
|
74
|
-
var resizeableObject = (0, react_1.useState)((0,
|
|
74
|
+
var resizeableObject = (0, react_1.useState)((0, _utils_1.resizeManager)(props.dialogRef, props.dialogBase))[0];
|
|
75
75
|
// const bounds = props.dialogBase.dialogOptions.base?.memoBounds ? getDialogBounds(dialogBase.dialogOptions.base.id) : null;
|
|
76
76
|
var baseZoomEffect = function () {
|
|
77
77
|
var _a = props.dialogBase.dialogTranslate, lastX = _a.lastX, lastY = _a.lastY;
|
|
@@ -103,4 +103,4 @@ var DialogContentContextProvider = function (props) {
|
|
|
103
103
|
});
|
|
104
104
|
return (0, jsx_runtime_1.jsx)(exports.DialogContentContext.Provider, { value: values, children: children });
|
|
105
105
|
};
|
|
106
|
-
exports.
|
|
106
|
+
exports.DialogContentContextProvider = DialogContentContextProvider;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.DialogHeaderFooterContext = exports.WithHeaderFooterContext = void 0;
|
|
48
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
|
+
var React = __importStar(require("react"));
|
|
50
|
+
var WithHeaderFooterContext = function (props) {
|
|
51
|
+
return (0, jsx_runtime_1.jsx)(exports.DialogHeaderFooterContext.Provider, { value: __assign({}, props), children: props.children });
|
|
52
|
+
};
|
|
53
|
+
exports.WithHeaderFooterContext = WithHeaderFooterContext;
|
|
54
|
+
exports.DialogHeaderFooterContext = React.createContext(null);
|
package/context/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare const DialogHeaderFooterContext: React.Context<any>;
|
|
1
|
+
export * from "./WithHeaderFooterContext";
|
|
2
|
+
export * from "./DialogContentContextProvider";
|