dry-ux 1.58.0 → 1.59.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.
|
@@ -79,6 +79,7 @@ class UIUtilProvider extends React.PureComponent {
|
|
|
79
79
|
} });
|
|
80
80
|
}
|
|
81
81
|
toggleModalInstance(id, shown, destroyOnClose = false) {
|
|
82
|
+
var _a, _b;
|
|
82
83
|
const { modal: { instances }, } = this.state;
|
|
83
84
|
const instance = instances[id];
|
|
84
85
|
if (!instance) {
|
|
@@ -86,6 +87,9 @@ class UIUtilProvider extends React.PureComponent {
|
|
|
86
87
|
}
|
|
87
88
|
// Hide all other instances
|
|
88
89
|
Object.keys(instances).forEach(id => (instances[id].shown = false));
|
|
90
|
+
if (!shown) {
|
|
91
|
+
(_b = (_a = instance.options).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
92
|
+
}
|
|
89
93
|
if (!shown && destroyOnClose && instance.options.destroyOnClose) {
|
|
90
94
|
this.removeModalInstance(id);
|
|
91
95
|
}
|
|
@@ -97,7 +101,10 @@ class UIUtilProvider extends React.PureComponent {
|
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
removeModalInstance(id) {
|
|
104
|
+
var _a, _b;
|
|
100
105
|
const { modal: { instances }, } = this.state;
|
|
106
|
+
const instance = instances[id];
|
|
107
|
+
(_b = (_a = instance.options).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
101
108
|
delete instances[id];
|
|
102
109
|
this.setState({
|
|
103
110
|
modal: Object.assign(Object.assign({}, this.state.modal), { instances }),
|