dry-ux 1.28.0 → 1.30.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.
|
@@ -12,9 +12,9 @@ export declare class UIUtilProvider extends React.PureComponent<{}, IUIUtilProvi
|
|
|
12
12
|
constructor(props: any);
|
|
13
13
|
get modalDefaults(): {
|
|
14
14
|
create: any;
|
|
15
|
-
show: (options:
|
|
15
|
+
show: (options: ModalOptions) => IModalCreate;
|
|
16
16
|
getCurrent: () => IModalCreate;
|
|
17
|
-
showAlert: (content:
|
|
17
|
+
showAlert: (content: ModalOptions["content"]) => IModalCreate;
|
|
18
18
|
showConfirm: (options: ModalOptions, onYes: () => void, onNo?: () => void) => IModalCreate;
|
|
19
19
|
showActions: (options: ModalOptions, actions: IUtilModalAction[]) => IModalCreate;
|
|
20
20
|
instances: {
|
|
@@ -33,12 +33,12 @@ class UIUtilProvider extends React.PureComponent {
|
|
|
33
33
|
this.state = Object.assign(Object.assign({}, defaultState), { modal: this.modalDefaults, alert: this.alertDefaults, loader: this.loaderDefaults });
|
|
34
34
|
}
|
|
35
35
|
get modalDefaults() {
|
|
36
|
-
return Object.assign(Object.assign({}, defaultState.modal), { create: this.createModal.bind(this), show: options => this.createModal(null, options), getCurrent: () => {
|
|
36
|
+
return Object.assign(Object.assign({}, defaultState.modal), { create: this.createModal.bind(this), show: (options) => this.createModal(null, options), getCurrent: () => {
|
|
37
37
|
const { modal: { instances }, } = this.state;
|
|
38
38
|
const id = Object.keys(instances).find(id => instances[id].shown);
|
|
39
39
|
return this.getCurrentModal(id);
|
|
40
|
-
}, showAlert: content => this.createModal(null, {
|
|
41
|
-
content: React.createElement("h4", { className: "text-center mtop" }, content),
|
|
40
|
+
}, showAlert: (content) => this.createModal(null, {
|
|
41
|
+
content: typeof content == "string" ? React.createElement("h4", { className: "text-center mtop" }, content) : content,
|
|
42
42
|
destroyOnClose: true,
|
|
43
43
|
closeBtn: true,
|
|
44
44
|
width: 400,
|
|
@@ -33,7 +33,7 @@ export declare type ModalOptions = {
|
|
|
33
33
|
/**
|
|
34
34
|
* The title of the modal.
|
|
35
35
|
*/
|
|
36
|
-
title?: string;
|
|
36
|
+
title?: JSX.Element | string;
|
|
37
37
|
/**
|
|
38
38
|
* If true, the modal will have a close button in the title bar.
|
|
39
39
|
*/
|
|
@@ -101,7 +101,7 @@ export interface IUIUtilModal {
|
|
|
101
101
|
* Shows an alert style modal.
|
|
102
102
|
* @param content The content to display in the modal.
|
|
103
103
|
*/
|
|
104
|
-
showAlert: (content:
|
|
104
|
+
showAlert: (content: ModalOptions["content"]) => IModalCreate;
|
|
105
105
|
/**
|
|
106
106
|
* Shows a confirm style modal.
|
|
107
107
|
* @param options The options for the modal.
|