@opengeoweb/shared 4.11.0 → 4.12.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/index.esm.js +117 -93
- package/index.umd.js +117 -92
- package/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +6 -6
- package/lib/components/CustomDialog/CustomDialog.d.ts +10 -0
- package/lib/components/CustomDialog/CustomDialog.spec.d.ts +1 -0
- package/lib/components/CustomDialog/CustomDialog.stories.d.ts +13 -0
- package/lib/components/CustomDialog/index.d.ts +1 -0
- package/lib/components/DraggableResizable/Draggable.d.ts +1 -4
- package/lib/components/DraggableResizable/index.d.ts +1 -0
- package/lib/components/DraggableResizable/types.d.ts +4 -0
- package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +1 -2
- package/lib/components/index.d.ts +1 -0
- package/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +1 -1
- package/package.json +4 -4
package/index.esm.js
CHANGED
|
@@ -89,46 +89,18 @@ var StatusTag = function StatusTag(_a) {
|
|
|
89
89
|
}, content));
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
xs: '100%',
|
|
95
|
-
sm: '150px'
|
|
96
|
-
},
|
|
97
|
-
marginLeft: {
|
|
98
|
-
xs: '0px!important',
|
|
99
|
-
sm: '8px!important'
|
|
100
|
-
},
|
|
101
|
-
marginTop: {
|
|
102
|
-
xs: 2,
|
|
103
|
-
sm: 0
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
107
|
-
var open = _a.open,
|
|
108
|
-
title = _a.title,
|
|
109
|
-
_a$description = _a.description,
|
|
110
|
-
description = _a$description === void 0 ? 'Are you sure?' : _a$description,
|
|
111
|
-
_a$confirmLabel = _a.confirmLabel,
|
|
112
|
-
confirmLabel = _a$confirmLabel === void 0 ? 'Submit' : _a$confirmLabel,
|
|
113
|
-
_a$cancelLabel = _a.cancelLabel,
|
|
114
|
-
cancelLabel = _a$cancelLabel === void 0 ? 'Go back' : _a$cancelLabel,
|
|
115
|
-
onSubmit = _a.onSubmit,
|
|
92
|
+
var CustomDialog = function CustomDialog(_a) {
|
|
93
|
+
var title = _a.title,
|
|
116
94
|
_onClose = _a.onClose,
|
|
117
|
-
_a$
|
|
118
|
-
|
|
119
|
-
_a$
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"]);
|
|
124
|
-
|
|
125
|
-
other.catchOnCancel;
|
|
126
|
-
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
127
|
-
|
|
95
|
+
_a$description = _a.description,
|
|
96
|
+
description = _a$description === void 0 ? '' : _a$description,
|
|
97
|
+
_a$actions = _a.actions,
|
|
98
|
+
actions = _a$actions === void 0 ? null : _a$actions,
|
|
99
|
+
children = _a.children,
|
|
100
|
+
other = __rest(_a, ["title", "onClose", "description", "actions", "children"]);
|
|
128
101
|
|
|
129
102
|
return /*#__PURE__*/React.createElement(Dialog, Object.assign({
|
|
130
|
-
"data-testid": "
|
|
131
|
-
open: open,
|
|
103
|
+
"data-testid": "customDialog",
|
|
132
104
|
PaperProps: {
|
|
133
105
|
sx: {
|
|
134
106
|
width: '560px',
|
|
@@ -139,8 +111,10 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
|
139
111
|
transitionDuration: 0,
|
|
140
112
|
onClose: function onClose() {
|
|
141
113
|
_onClose('CLOSED');
|
|
142
|
-
}
|
|
143
|
-
|
|
114
|
+
},
|
|
115
|
+
"aria-labelledby": "dialog-title"
|
|
116
|
+
}, other), /*#__PURE__*/React.createElement(DialogTitle, {
|
|
117
|
+
id: "dialog-title",
|
|
144
118
|
sx: {
|
|
145
119
|
zIndex: 1,
|
|
146
120
|
padding: 2,
|
|
@@ -159,10 +133,10 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
|
159
133
|
sm: 400
|
|
160
134
|
}
|
|
161
135
|
},
|
|
162
|
-
"data-testid": "
|
|
136
|
+
"data-testid": "customDialog-title",
|
|
163
137
|
component: "span"
|
|
164
138
|
}, title), /*#__PURE__*/React.createElement(IconButton, {
|
|
165
|
-
"data-testid": "
|
|
139
|
+
"data-testid": "customDialog-close",
|
|
166
140
|
"aria-label": "close",
|
|
167
141
|
onClick: function onClick() {
|
|
168
142
|
return _onClose('CLOSED');
|
|
@@ -176,7 +150,7 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
|
176
150
|
}
|
|
177
151
|
}, description && /*#__PURE__*/React.createElement(Typography, {
|
|
178
152
|
variant: "body1"
|
|
179
|
-
}, description),
|
|
153
|
+
}, description), children), /*#__PURE__*/React.createElement(DialogActions, {
|
|
180
154
|
sx: {
|
|
181
155
|
padding: 2,
|
|
182
156
|
flexDirection: {
|
|
@@ -184,53 +158,100 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
|
184
158
|
sm: 'row'
|
|
185
159
|
}
|
|
186
160
|
}
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
161
|
+
}, actions));
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var confirmStyle = {
|
|
165
|
+
width: {
|
|
166
|
+
xs: '100%',
|
|
167
|
+
sm: '150px'
|
|
168
|
+
},
|
|
169
|
+
marginLeft: {
|
|
170
|
+
xs: '0px!important',
|
|
171
|
+
sm: '8px!important'
|
|
172
|
+
},
|
|
173
|
+
marginTop: {
|
|
174
|
+
xs: 2,
|
|
175
|
+
sm: 0
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
179
|
+
var open = _a.open,
|
|
180
|
+
title = _a.title,
|
|
181
|
+
_a$description = _a.description,
|
|
182
|
+
description = _a$description === void 0 ? 'Are you sure?' : _a$description,
|
|
183
|
+
_a$confirmLabel = _a.confirmLabel,
|
|
184
|
+
confirmLabel = _a$confirmLabel === void 0 ? 'Submit' : _a$confirmLabel,
|
|
185
|
+
_a$cancelLabel = _a.cancelLabel,
|
|
186
|
+
cancelLabel = _a$cancelLabel === void 0 ? 'Go back' : _a$cancelLabel,
|
|
187
|
+
onSubmit = _a.onSubmit,
|
|
188
|
+
onClose = _a.onClose,
|
|
189
|
+
_a$content = _a.content,
|
|
190
|
+
content = _a$content === void 0 ? null : _a$content,
|
|
191
|
+
_a$disableAutoFocus = _a.disableAutoFocus,
|
|
192
|
+
disableAutoFocus = _a$disableAutoFocus === void 0 ? false : _a$disableAutoFocus,
|
|
193
|
+
_a$isLoading = _a.isLoading,
|
|
194
|
+
isLoading = _a$isLoading === void 0 ? false : _a$isLoading,
|
|
195
|
+
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"]);
|
|
196
|
+
|
|
197
|
+
other.catchOnCancel;
|
|
198
|
+
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
return /*#__PURE__*/React.createElement(CustomDialog, Object.assign({
|
|
202
|
+
"data-testid": "confirmationDialog",
|
|
203
|
+
open: open,
|
|
204
|
+
title: title,
|
|
205
|
+
description: description,
|
|
206
|
+
onClose: onClose,
|
|
207
|
+
actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
208
|
+
"data-testid": "confirmationDialog-cancel",
|
|
209
|
+
variant: "tertiary",
|
|
210
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
211
|
+
sx: function sx(theme) {
|
|
212
|
+
return {
|
|
213
|
+
width: {
|
|
214
|
+
xs: '100%',
|
|
215
|
+
sm: '150px'
|
|
216
|
+
},
|
|
217
|
+
'&:focus': {
|
|
218
|
+
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
219
|
+
borderColor: 'transparent'
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
onClick: function onClick() {
|
|
224
|
+
return onClose('CANCELLED');
|
|
225
|
+
},
|
|
226
|
+
disableFocusRipple: true
|
|
227
|
+
}, cancelLabel), isLoading ? /*#__PURE__*/React.createElement(Box, {
|
|
228
|
+
"data-testid": "confirm-dialog-spinner",
|
|
229
|
+
sx: Object.assign(Object.assign({}, confirmStyle), {
|
|
230
|
+
height: '40px',
|
|
231
|
+
display: 'flex',
|
|
232
|
+
justifyContent: 'center',
|
|
233
|
+
alignItems: 'center'
|
|
234
|
+
})
|
|
235
|
+
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
|
236
|
+
size: 40,
|
|
237
|
+
color: "secondary"
|
|
238
|
+
})) : /*#__PURE__*/React.createElement(Button, {
|
|
239
|
+
"data-testid": "confirmationDialog-confirm",
|
|
240
|
+
variant: "primary",
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
242
|
+
sx: function sx(theme) {
|
|
243
|
+
return Object.assign(Object.assign({}, confirmStyle), {
|
|
244
|
+
'&:focus': {
|
|
245
|
+
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
246
|
+
borderColor: 'transparent'
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
},
|
|
250
|
+
onClick: onSubmit,
|
|
251
|
+
autoFocus: !disableAutoFocus,
|
|
252
|
+
disableFocusRipple: true
|
|
253
|
+
}, confirmLabel))
|
|
254
|
+
}, rest), content);
|
|
234
255
|
};
|
|
235
256
|
|
|
236
257
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -1064,8 +1085,8 @@ var AppHeader = function AppHeader(_ref2) {
|
|
|
1064
1085
|
* See the License for the specific language governing permissions and
|
|
1065
1086
|
* limitations under the License.
|
|
1066
1087
|
*
|
|
1067
|
-
* Copyright
|
|
1068
|
-
* Copyright
|
|
1088
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1089
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1069
1090
|
* */
|
|
1070
1091
|
|
|
1071
1092
|
var DraggableComponent$1 = function DraggableComponent(_a) {
|
|
@@ -2787,7 +2808,10 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2787
2808
|
}, /*#__PURE__*/React.createElement(Options, null))), /*#__PURE__*/React.createElement(Menu, {
|
|
2788
2809
|
anchorEl: anchorEl,
|
|
2789
2810
|
open: isOpen,
|
|
2790
|
-
onClose:
|
|
2811
|
+
onClose: function onClose(event, reason) {
|
|
2812
|
+
if (reason === 'tabKeyDown') return;
|
|
2813
|
+
handleClose(event);
|
|
2814
|
+
},
|
|
2791
2815
|
anchorOrigin: anchorOrigin,
|
|
2792
2816
|
transformOrigin: transformOrigin,
|
|
2793
2817
|
BackdropProps: {
|
|
@@ -3591,4 +3615,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
3591
3615
|
createDate: createDate
|
|
3592
3616
|
});
|
|
3593
3617
|
|
|
3594
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, EnableButton, ErrorBoundary, HIDDEN_INPUT_HELPER_IS_DRAFT, IS_JEST, ManagerButton, ManagerDeleteButton, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useDraftFormHelpers, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
|
|
3618
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, EnableButton, ErrorBoundary, HIDDEN_INPUT_HELPER_IS_DRAFT, IS_JEST, ManagerButton, ManagerDeleteButton, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useDraftFormHelpers, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
|
package/index.umd.js
CHANGED
|
@@ -161,46 +161,18 @@
|
|
|
161
161
|
}, content));
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
var
|
|
165
|
-
|
|
166
|
-
xs: '100%',
|
|
167
|
-
sm: '150px'
|
|
168
|
-
},
|
|
169
|
-
marginLeft: {
|
|
170
|
-
xs: '0px!important',
|
|
171
|
-
sm: '8px!important'
|
|
172
|
-
},
|
|
173
|
-
marginTop: {
|
|
174
|
-
xs: 2,
|
|
175
|
-
sm: 0
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
179
|
-
var open = _a.open,
|
|
180
|
-
title = _a.title,
|
|
181
|
-
_b = _a.description,
|
|
182
|
-
description = _b === void 0 ? 'Are you sure?' : _b,
|
|
183
|
-
_c = _a.confirmLabel,
|
|
184
|
-
confirmLabel = _c === void 0 ? 'Submit' : _c,
|
|
185
|
-
_d = _a.cancelLabel,
|
|
186
|
-
cancelLabel = _d === void 0 ? 'Go back' : _d,
|
|
187
|
-
onSubmit = _a.onSubmit,
|
|
164
|
+
var CustomDialog = function CustomDialog(_a) {
|
|
165
|
+
var title = _a.title,
|
|
188
166
|
_onClose = _a.onClose,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"]);
|
|
196
|
-
|
|
197
|
-
other.catchOnCancel;
|
|
198
|
-
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
199
|
-
|
|
167
|
+
_b = _a.description,
|
|
168
|
+
description = _b === void 0 ? '' : _b,
|
|
169
|
+
_c = _a.actions,
|
|
170
|
+
actions = _c === void 0 ? null : _c,
|
|
171
|
+
children = _a.children,
|
|
172
|
+
other = __rest(_a, ["title", "onClose", "description", "actions", "children"]);
|
|
200
173
|
|
|
201
174
|
return /*#__PURE__*/React__namespace.createElement(material.Dialog, __assign({
|
|
202
|
-
"data-testid": "
|
|
203
|
-
open: open,
|
|
175
|
+
"data-testid": "customDialog",
|
|
204
176
|
PaperProps: {
|
|
205
177
|
sx: {
|
|
206
178
|
width: '560px',
|
|
@@ -211,8 +183,10 @@
|
|
|
211
183
|
transitionDuration: 0,
|
|
212
184
|
onClose: function onClose() {
|
|
213
185
|
_onClose('CLOSED');
|
|
214
|
-
}
|
|
215
|
-
|
|
186
|
+
},
|
|
187
|
+
"aria-labelledby": "dialog-title"
|
|
188
|
+
}, other), /*#__PURE__*/React__namespace.createElement(material.DialogTitle, {
|
|
189
|
+
id: "dialog-title",
|
|
216
190
|
sx: {
|
|
217
191
|
zIndex: 1,
|
|
218
192
|
padding: 2,
|
|
@@ -231,10 +205,10 @@
|
|
|
231
205
|
sm: 400
|
|
232
206
|
}
|
|
233
207
|
},
|
|
234
|
-
"data-testid": "
|
|
208
|
+
"data-testid": "customDialog-title",
|
|
235
209
|
component: "span"
|
|
236
210
|
}, title), /*#__PURE__*/React__namespace.createElement(material.IconButton, {
|
|
237
|
-
"data-testid": "
|
|
211
|
+
"data-testid": "customDialog-close",
|
|
238
212
|
"aria-label": "close",
|
|
239
213
|
onClick: function onClick() {
|
|
240
214
|
return _onClose('CLOSED');
|
|
@@ -248,7 +222,7 @@
|
|
|
248
222
|
}
|
|
249
223
|
}, description && /*#__PURE__*/React__namespace.createElement(material.Typography, {
|
|
250
224
|
variant: "body1"
|
|
251
|
-
}, description),
|
|
225
|
+
}, description), children), /*#__PURE__*/React__namespace.createElement(material.DialogActions, {
|
|
252
226
|
sx: {
|
|
253
227
|
padding: 2,
|
|
254
228
|
flexDirection: {
|
|
@@ -256,53 +230,100 @@
|
|
|
256
230
|
sm: 'row'
|
|
257
231
|
}
|
|
258
232
|
}
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
233
|
+
}, actions));
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
var confirmStyle = {
|
|
237
|
+
width: {
|
|
238
|
+
xs: '100%',
|
|
239
|
+
sm: '150px'
|
|
240
|
+
},
|
|
241
|
+
marginLeft: {
|
|
242
|
+
xs: '0px!important',
|
|
243
|
+
sm: '8px!important'
|
|
244
|
+
},
|
|
245
|
+
marginTop: {
|
|
246
|
+
xs: 2,
|
|
247
|
+
sm: 0
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
251
|
+
var open = _a.open,
|
|
252
|
+
title = _a.title,
|
|
253
|
+
_b = _a.description,
|
|
254
|
+
description = _b === void 0 ? 'Are you sure?' : _b,
|
|
255
|
+
_c = _a.confirmLabel,
|
|
256
|
+
confirmLabel = _c === void 0 ? 'Submit' : _c,
|
|
257
|
+
_d = _a.cancelLabel,
|
|
258
|
+
cancelLabel = _d === void 0 ? 'Go back' : _d,
|
|
259
|
+
onSubmit = _a.onSubmit,
|
|
260
|
+
onClose = _a.onClose,
|
|
261
|
+
_e = _a.content,
|
|
262
|
+
content = _e === void 0 ? null : _e,
|
|
263
|
+
_f = _a.disableAutoFocus,
|
|
264
|
+
disableAutoFocus = _f === void 0 ? false : _f,
|
|
265
|
+
_g = _a.isLoading,
|
|
266
|
+
isLoading = _g === void 0 ? false : _g,
|
|
267
|
+
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"]);
|
|
268
|
+
|
|
269
|
+
other.catchOnCancel;
|
|
270
|
+
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
return /*#__PURE__*/React__namespace.createElement(CustomDialog, __assign({
|
|
274
|
+
"data-testid": "confirmationDialog",
|
|
275
|
+
open: open,
|
|
276
|
+
title: title,
|
|
277
|
+
description: description,
|
|
278
|
+
onClose: onClose,
|
|
279
|
+
actions: /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
280
|
+
"data-testid": "confirmationDialog-cancel",
|
|
281
|
+
variant: "tertiary",
|
|
282
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
283
|
+
sx: function sx(theme) {
|
|
284
|
+
return {
|
|
285
|
+
width: {
|
|
286
|
+
xs: '100%',
|
|
287
|
+
sm: '150px'
|
|
288
|
+
},
|
|
289
|
+
'&:focus': {
|
|
290
|
+
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
291
|
+
borderColor: 'transparent'
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
},
|
|
295
|
+
onClick: function onClick() {
|
|
296
|
+
return onClose('CANCELLED');
|
|
297
|
+
},
|
|
298
|
+
disableFocusRipple: true
|
|
299
|
+
}, cancelLabel), isLoading ? /*#__PURE__*/React__namespace.createElement(material.Box, {
|
|
300
|
+
"data-testid": "confirm-dialog-spinner",
|
|
301
|
+
sx: __assign(__assign({}, confirmStyle), {
|
|
302
|
+
height: '40px',
|
|
303
|
+
display: 'flex',
|
|
304
|
+
justifyContent: 'center',
|
|
305
|
+
alignItems: 'center'
|
|
306
|
+
})
|
|
307
|
+
}, /*#__PURE__*/React__namespace.createElement(material.CircularProgress, {
|
|
308
|
+
size: 40,
|
|
309
|
+
color: "secondary"
|
|
310
|
+
})) : /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
311
|
+
"data-testid": "confirmationDialog-confirm",
|
|
312
|
+
variant: "primary",
|
|
313
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
314
|
+
sx: function sx(theme) {
|
|
315
|
+
return __assign(__assign({}, confirmStyle), {
|
|
316
|
+
'&:focus': {
|
|
317
|
+
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
318
|
+
borderColor: 'transparent'
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
},
|
|
322
|
+
onClick: onSubmit,
|
|
323
|
+
autoFocus: !disableAutoFocus,
|
|
324
|
+
disableFocusRipple: true
|
|
325
|
+
}, confirmLabel))
|
|
326
|
+
}, rest), content);
|
|
306
327
|
};
|
|
307
328
|
|
|
308
329
|
/* *
|
|
@@ -927,8 +948,8 @@
|
|
|
927
948
|
* See the License for the specific language governing permissions and
|
|
928
949
|
* limitations under the License.
|
|
929
950
|
*
|
|
930
|
-
* Copyright
|
|
931
|
-
* Copyright
|
|
951
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
952
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
932
953
|
* */
|
|
933
954
|
|
|
934
955
|
var DraggableComponent$1 = function DraggableComponent(_a) {
|
|
@@ -2641,7 +2662,10 @@
|
|
|
2641
2662
|
}, /*#__PURE__*/React__namespace.createElement(theme.Options, null))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
|
|
2642
2663
|
anchorEl: anchorEl,
|
|
2643
2664
|
open: isOpen,
|
|
2644
|
-
onClose:
|
|
2665
|
+
onClose: function onClose(event, reason) {
|
|
2666
|
+
if (reason === 'tabKeyDown') return;
|
|
2667
|
+
handleClose(event);
|
|
2668
|
+
},
|
|
2645
2669
|
anchorOrigin: anchorOrigin,
|
|
2646
2670
|
transformOrigin: transformOrigin,
|
|
2647
2671
|
BackdropProps: {
|
|
@@ -3492,6 +3516,7 @@
|
|
|
3492
3516
|
exports.ConfirmationDialog = ConfirmationDialog;
|
|
3493
3517
|
exports.ConfirmationServiceProvider = ConfirmationServiceProvider;
|
|
3494
3518
|
exports.CustomAccordion = CustomAccordion;
|
|
3519
|
+
exports.CustomDialog = CustomDialog;
|
|
3495
3520
|
exports.CustomSlider = CustomSlider;
|
|
3496
3521
|
exports.CustomToggleButton = CustomToggleButton;
|
|
3497
3522
|
exports.CustomTooltip = CustomTooltip;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { CustomDialogProps, DialogAction } from '../CustomDialog';
|
|
2
3
|
export interface ConfirmationOptions {
|
|
3
|
-
|
|
4
|
-
title: string;
|
|
4
|
+
title?: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
catchOnCancel?: boolean;
|
|
6
7
|
confirmLabel?: string;
|
|
7
8
|
cancelLabel?: string;
|
|
8
9
|
content?: React.ReactNode;
|
|
9
|
-
disableAutoFocus?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare type ConfirmationAction = 'CANCELLED' |
|
|
12
|
-
interface ConfirmationDialogProps extends ConfirmationOptions {
|
|
13
|
-
|
|
11
|
+
export declare type ConfirmationAction = 'CANCELLED' | DialogAction;
|
|
12
|
+
export interface ConfirmationDialogProps extends ConfirmationOptions, CustomDialogProps {
|
|
13
|
+
disableAutoFocus?: boolean;
|
|
14
14
|
onSubmit: () => void;
|
|
15
15
|
onClose: (reason: ConfirmationAction) => void;
|
|
16
16
|
isLoading?: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DialogProps } from '@mui/material';
|
|
3
|
+
export declare type DialogAction = 'CLOSED';
|
|
4
|
+
export interface CustomDialogProps extends DialogProps {
|
|
5
|
+
description?: string;
|
|
6
|
+
actions?: React.ReactNode;
|
|
7
|
+
onClose: (reason: DialogAction) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const CustomDialog: React.FC<CustomDialogProps>;
|
|
10
|
+
export default CustomDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const CustomDialogLight: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const CustomDialogDark: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomDialog';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/material';
|
|
3
3
|
import { NumberSize } from 're-resizable';
|
|
4
|
-
import { DraggablePosition } from '../DraggableResizable/
|
|
5
|
-
import { Position, ResizableComponentProps, Size } from '../DraggableResizable/types';
|
|
4
|
+
import { DraggablePosition, Position, ResizableComponentProps, Size } from '../DraggableResizable/types';
|
|
6
5
|
import { HeaderSize } from './types';
|
|
7
6
|
export declare const calculateDialogSizeAndPosition: () => {
|
|
8
7
|
width: number;
|
package/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DraggablePosition } from '../../components/DraggableResizable/
|
|
2
|
+
import { DraggablePosition } from '../../components/DraggableResizable/types';
|
|
3
3
|
export declare const adjustPosition: (bbox: DOMRect, containingView: DOMRect, position: DraggablePosition, setPosition: (position: DraggablePosition) => void) => void;
|
|
4
4
|
export declare const useMakeSureContainerStaysInsideWindow: (nodeRef: React.RefObject<HTMLDivElement>, position: DraggablePosition, setPosition: (position: DraggablePosition) => void) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"typings": "./index.d.ts",
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"react": "^
|
|
15
|
+
"react": "^18.2.0",
|
|
16
16
|
"@mui/material": "^5.10.8",
|
|
17
|
-
"@opengeoweb/theme": "4.
|
|
17
|
+
"@opengeoweb/theme": "4.12.0",
|
|
18
18
|
"react-draggable": "^4.4.5",
|
|
19
19
|
"re-resizable": "^6.9.0",
|
|
20
20
|
"@redux-eggs/core": "^2.2.0",
|
|
21
21
|
"react-redux": "^8.0.4",
|
|
22
|
-
"@opengeoweb/form-fields": "4.
|
|
22
|
+
"@opengeoweb/form-fields": "4.12.0",
|
|
23
23
|
"react-hook-form": "^7.41.5",
|
|
24
24
|
"moment": "^2.29.0",
|
|
25
25
|
"moment-timezone": "^0.5.31",
|