dry-ux 1.52.0 → 1.53.0
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/dist/dajaxice/DajaxiceProxy.test.d.ts +1 -1
- package/dist/dajaxice/Proxy.interface.d.ts +3 -3
- package/dist/error/ErrorBoundary.d.ts +1 -1
- package/dist/error/ErrorScreen.d.ts +1 -1
- package/dist/helpers/flat.d.ts +2 -2
- package/dist/helpers/flat.js +3 -2
- package/dist/helpers/utilities.d.ts +1 -1
- package/dist/ui-utils/Modal.d.ts +1 -0
- package/dist/ui-utils/Modal.js +14 -6
- package/dist/ui-utils/Spinner.d.ts +1 -1
- package/dist/ui-utils/UIUtil.interface.d.ts +11 -6
- package/dist/ui-utils/UIUtilProvider.d.ts +1 -1
- package/dist/ui-utils/UIUtilRenderer.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Args<T = void> = {
|
|
1
|
+
export declare type Args<T = void> = {
|
|
2
2
|
args: T;
|
|
3
3
|
/**
|
|
4
4
|
* If true, it will show a loader when a Dajaxice function is called. Defaults to false.
|
|
@@ -27,9 +27,9 @@ export type Args<T = void> = {
|
|
|
27
27
|
loader?: boolean;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
type ArgType<T> = T extends void ? Omit<Args, "args"> | void : Args<T>;
|
|
30
|
+
declare type ArgType<T> = T extends void ? Omit<Args, "args"> | void : Args<T>;
|
|
31
31
|
export declare type DajaxiceFn<TArgs = void> = <TResult = any>(args: ArgType<TArgs>) => Promise<TResult>;
|
|
32
|
-
export type MethodArgs = Partial<Args<any>>;
|
|
32
|
+
export declare type MethodArgs = Partial<Args<any>>;
|
|
33
33
|
export interface IDajaxiceProxy<TModule> {
|
|
34
34
|
modules: TModule;
|
|
35
35
|
authCheck?: {
|
|
@@ -15,7 +15,7 @@ export declare class ErrorBoundary extends React.PureComponent<IErrorBoundaryPro
|
|
|
15
15
|
error: Error;
|
|
16
16
|
};
|
|
17
17
|
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
18
|
-
render: () =>
|
|
18
|
+
render: () => JSX.Element & React.ReactNode;
|
|
19
19
|
private handleError;
|
|
20
20
|
private resetError;
|
|
21
21
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare const ErrorScreen: React.MemoExoticComponent<() =>
|
|
2
|
+
export declare const ErrorScreen: React.MemoExoticComponent<() => JSX.Element>;
|
package/dist/helpers/flat.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type FlattenOptions = {
|
|
1
|
+
declare type FlattenOptions = {
|
|
2
2
|
delimiter?: string;
|
|
3
3
|
maxDepth?: number;
|
|
4
4
|
transformKey?: (key: any) => any;
|
|
@@ -12,7 +12,7 @@ type FlattenOptions = {
|
|
|
12
12
|
export declare function flatten(target: any, opts?: FlattenOptions): {
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
};
|
|
15
|
-
type UnflattenOptions = Pick<FlattenOptions, "delimiter" | "transformKey"> & {
|
|
15
|
+
declare type UnflattenOptions = Pick<FlattenOptions, "delimiter" | "transformKey"> & {
|
|
16
16
|
overwrite?: boolean;
|
|
17
17
|
object?: boolean;
|
|
18
18
|
};
|
package/dist/helpers/flat.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.flatten =
|
|
4
|
-
exports.unflatten = unflatten;
|
|
3
|
+
exports.unflatten = exports.flatten = void 0;
|
|
5
4
|
function isBuffer(obj) {
|
|
6
5
|
return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
|
|
7
6
|
}
|
|
@@ -41,6 +40,7 @@ function flatten(target, opts) {
|
|
|
41
40
|
step(target, null, null);
|
|
42
41
|
return output;
|
|
43
42
|
}
|
|
43
|
+
exports.flatten = flatten;
|
|
44
44
|
/**
|
|
45
45
|
* Unflattens an object with the paths for keys.
|
|
46
46
|
* @param target The object to unflatten.
|
|
@@ -122,3 +122,4 @@ function unflatten(target, opts) {
|
|
|
122
122
|
});
|
|
123
123
|
return result;
|
|
124
124
|
}
|
|
125
|
+
exports.unflatten = unflatten;
|
|
@@ -59,5 +59,5 @@ export declare const tryParseJson: <T = any>(json: string, errorValue?: {}) => {
|
|
|
59
59
|
export declare const useIsVisible: (ref: React.MutableRefObject<any>) => boolean;
|
|
60
60
|
export declare const usePubSub: <T>() => {
|
|
61
61
|
usePub: () => <TName extends keyof T, TPayload extends T[TName]>(event: TName, data?: TPayload) => void;
|
|
62
|
-
useSub: <
|
|
62
|
+
useSub: <TName_1 extends keyof T, TPayload_1 extends T[TName_1]>(event: TName_1, callback: (data: TPayload_1) => void) => () => void;
|
|
63
63
|
};
|
package/dist/ui-utils/Modal.d.ts
CHANGED
package/dist/ui-utils/Modal.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const react_bootstrap_1 = require("react-bootstrap");
|
|
5
|
-
const Modal = React.memo(({ handleClose, shown, options: { content, footerContent, cssClass, closeBtn, title, width, onClose, titleCloseBtn = true }, config: { defaultModalStyles = false, styles = {}, setBackdropHeight = true }, }) => {
|
|
5
|
+
const Modal = React.memo(({ handleClose, shown, options: { content, footerContent, cssClass, closeBtn, title, width, onClose, titleCloseBtn = true, centered }, config: { defaultModalStyles = false, styles = {}, setBackdropHeight = true, centered: globalCentered }, }) => {
|
|
6
|
+
const isCentered = centered !== null && centered !== void 0 ? centered : globalCentered;
|
|
6
7
|
const applyStyles = React.useCallback(() => {
|
|
7
8
|
document.querySelectorAll(".modal-dialog").forEach((el) => {
|
|
8
9
|
el.style.width = typeof width == "number" ? `${width}px` : width;
|
|
@@ -12,6 +13,13 @@ const Modal = React.memo(({ handleClose, shown, options: { content, footerConten
|
|
|
12
13
|
el.querySelectorAll(".modal-header").forEach((el) => (el.style.display = "block"));
|
|
13
14
|
el.querySelectorAll(".modal-title").forEach((el) => (el.style.marginTop = "0"));
|
|
14
15
|
}
|
|
16
|
+
if (isCentered) {
|
|
17
|
+
el.style.position = "absolute";
|
|
18
|
+
el.style.transform = "translate(-50%, -50%)";
|
|
19
|
+
el.style.top = "50%";
|
|
20
|
+
el.style.left = "50%";
|
|
21
|
+
el.style.marginTop = "unset";
|
|
22
|
+
}
|
|
15
23
|
});
|
|
16
24
|
document.querySelectorAll("[role=dialog]").forEach((el) => (el.style.opacity = "1"));
|
|
17
25
|
if (setBackdropHeight) {
|
|
@@ -26,24 +34,24 @@ const Modal = React.memo(({ handleClose, shown, options: { content, footerConten
|
|
|
26
34
|
});
|
|
27
35
|
});
|
|
28
36
|
});
|
|
29
|
-
}, [width, defaultModalStyles]);
|
|
37
|
+
}, [width, defaultModalStyles, isCentered, styles, setBackdropHeight]);
|
|
30
38
|
React.useEffect(() => {
|
|
31
39
|
if (shown) {
|
|
32
40
|
applyStyles();
|
|
33
41
|
}
|
|
34
42
|
}, [shown, width, defaultModalStyles]);
|
|
35
|
-
const
|
|
43
|
+
const onHide = () => {
|
|
36
44
|
handleClose();
|
|
37
45
|
onClose && onClose();
|
|
38
46
|
};
|
|
39
47
|
const contentToRender = typeof content == "string" ? React.createElement("div", { dangerouslySetInnerHTML: { __html: content } }) : content;
|
|
40
48
|
const showFooter = closeBtn || footerContent;
|
|
41
|
-
return (React.createElement(react_bootstrap_1.Modal, { onHide:
|
|
42
|
-
!!title && (React.createElement(react_bootstrap_1.Modal.Header, { closeButton: titleCloseBtn, onHide:
|
|
49
|
+
return (React.createElement(react_bootstrap_1.Modal, { onHide: onHide, show: shown, animation: true, autoFocus: true, keyboard: false, className: cssClass, backdropStyle: { zIndex: 1040, opacity: 0.5 }, backdrop: "static" },
|
|
50
|
+
!!title && (React.createElement(react_bootstrap_1.Modal.Header, { closeButton: titleCloseBtn, onHide: onHide },
|
|
43
51
|
React.createElement(react_bootstrap_1.Modal.Title, null, title))),
|
|
44
52
|
React.createElement(react_bootstrap_1.Modal.Body, null, contentToRender),
|
|
45
53
|
showFooter && (React.createElement(react_bootstrap_1.Modal.Footer, null,
|
|
46
54
|
footerContent,
|
|
47
|
-
closeBtn && (React.createElement(react_bootstrap_1.Button, { bsClass: "btn btn-danger", onClick:
|
|
55
|
+
closeBtn && (React.createElement(react_bootstrap_1.Button, { bsClass: "btn btn-danger", onClick: onHide }, "Close"))))));
|
|
48
56
|
});
|
|
49
57
|
exports.default = Modal;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare const Spinner: React.MemoExoticComponent<() =>
|
|
2
|
+
export declare const Spinner: React.MemoExoticComponent<() => JSX.Element>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type PopUp = {
|
|
2
3
|
/**
|
|
3
4
|
* Hides the modal.
|
|
4
5
|
*/
|
|
@@ -12,7 +13,7 @@ export type PopUp = {
|
|
|
12
13
|
*/
|
|
13
14
|
remove: () => void;
|
|
14
15
|
};
|
|
15
|
-
export type PopUpOptions = {
|
|
16
|
+
export declare type PopUpOptions = {
|
|
16
17
|
/**
|
|
17
18
|
* The content of the modal.
|
|
18
19
|
*/
|
|
@@ -49,9 +50,13 @@ export type PopUpOptions = {
|
|
|
49
50
|
* If true, the modal will be destroyed when it is closed.
|
|
50
51
|
*/
|
|
51
52
|
destroyOnClose?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* If true, the modal will be centered vertically.
|
|
55
|
+
*/
|
|
56
|
+
centered?: boolean;
|
|
52
57
|
};
|
|
53
|
-
export type ButtonType = "primary" | "info" | "success" | "warning" | "danger";
|
|
54
|
-
export type PopUpAction = {
|
|
58
|
+
export declare type ButtonType = "primary" | "info" | "success" | "warning" | "danger";
|
|
59
|
+
export declare type PopUpAction = {
|
|
55
60
|
/**
|
|
56
61
|
* The content to display in the modal.
|
|
57
62
|
*/
|
|
@@ -69,7 +74,7 @@ export type PopUpAction = {
|
|
|
69
74
|
*/
|
|
70
75
|
closeOnClick?: boolean;
|
|
71
76
|
};
|
|
72
|
-
export type UIUtilModal = {
|
|
77
|
+
export declare type UIUtilModal = {
|
|
73
78
|
/**
|
|
74
79
|
* Creates a non-unique modal.
|
|
75
80
|
* @param options The options for the modal.
|
|
@@ -128,4 +133,4 @@ export interface IUIUtilLoader {
|
|
|
128
133
|
*/
|
|
129
134
|
hide: () => void;
|
|
130
135
|
}
|
|
131
|
-
export type UIUtilPrompt = Pick<UIUtilModal, "showConfirm" | "showActions" | "instances" | "getCurrent">;
|
|
136
|
+
export declare type UIUtilPrompt = Pick<UIUtilModal, "showConfirm" | "showActions" | "instances" | "getCurrent">;
|
|
@@ -52,5 +52,5 @@ export declare class UIUtilProvider extends React.PureComponent<{}, IUIUtilProvi
|
|
|
52
52
|
removeModalInstance(id: string): void;
|
|
53
53
|
getCurrentModal(id: string): PopUp;
|
|
54
54
|
createModal(id: string, options: PopUpOptions): PopUp;
|
|
55
|
-
render():
|
|
55
|
+
render(): JSX.Element;
|
|
56
56
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IModalProps } from "./Modal";
|
|
3
|
-
export type UIUtilRendererProps = {
|
|
3
|
+
export declare type UIUtilRendererProps = {
|
|
4
4
|
modalConfig?: IModalProps["config"];
|
|
5
5
|
};
|
|
6
6
|
export declare const UIUtilRenderer: React.FC<UIUtilRendererProps>;
|