dry-ux 1.29.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: any) => IModalCreate;
15
+ show: (options: ModalOptions) => IModalCreate;
16
16
  getCurrent: () => IModalCreate;
17
- showAlert: (content: any) => IModalCreate;
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,
@@ -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: string) => IModalCreate;
104
+ showAlert: (content: ModalOptions["content"]) => IModalCreate;
105
105
  /**
106
106
  * Shows a confirm style modal.
107
107
  * @param options The options for the modal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dry-ux",
3
- "version": "1.29.0",
3
+ "version": "1.30.0",
4
4
  "description": "",
5
5
  "main": "dist/index",
6
6
  "scripts": {