@opengeoweb/shared 4.18.0 → 4.19.1
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 +331 -318
- package/index.umd.js +211 -182
- package/lib/components/CustomIconButton/CustomIconButton.d.ts +10 -0
- package/lib/components/CustomIconButton/CustomIconButton.stories.d.ts +25 -0
- package/lib/components/CustomIconButton/index.d.ts +1 -0
- package/lib/components/ToggleMenu/ToggleMenu.d.ts +1 -0
- package/lib/components/index.d.ts +1 -1
- package/lib/utils/dateUtils/dateUtils.d.ts +30 -0
- package/package.json +4 -3
- package/lib/components/ManagerButton/ManagerButton.d.ts +0 -11
- package/lib/components/ManagerButton/ManagerButton.stories.d.ts +0 -13
- package/lib/components/ManagerButton/index.d.ts +0 -1
- /package/lib/components/{ManagerButton/ManagerButton.spec.d.ts → CustomIconButton/CustomIconButton.spec.d.ts} +0 -0
package/index.umd.js
CHANGED
|
@@ -161,6 +161,115 @@
|
|
|
161
161
|
}, content));
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
+
/* *
|
|
165
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
166
|
+
* you may not use this file except in compliance with the License.
|
|
167
|
+
* You may obtain a copy of the License at
|
|
168
|
+
*
|
|
169
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
170
|
+
*
|
|
171
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
172
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
173
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
174
|
+
* See the License for the specific language governing permissions and
|
|
175
|
+
* limitations under the License.
|
|
176
|
+
*
|
|
177
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
178
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
179
|
+
* */
|
|
180
|
+
var defaultDelay = 1000;
|
|
181
|
+
var useControlledTooltip = function useControlledTooltip() {
|
|
182
|
+
var _a = __read(React__namespace.useState(false), 2),
|
|
183
|
+
tooltipOpen = _a[0],
|
|
184
|
+
setTooltipOpen = _a[1];
|
|
185
|
+
|
|
186
|
+
var _b = __read(React__namespace.useState(false), 2),
|
|
187
|
+
delayedTooltip = _b[0],
|
|
188
|
+
setDelayedTooltip = _b[1];
|
|
189
|
+
|
|
190
|
+
React__namespace.useEffect(function () {
|
|
191
|
+
if (tooltipOpen === true) {
|
|
192
|
+
var timer_1 = setTimeout(function () {
|
|
193
|
+
return setDelayedTooltip(true);
|
|
194
|
+
}, defaultDelay);
|
|
195
|
+
return function () {
|
|
196
|
+
clearTimeout(timer_1);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
setDelayedTooltip(false);
|
|
201
|
+
return function () {};
|
|
202
|
+
}, [tooltipOpen]);
|
|
203
|
+
return [delayedTooltip, setTooltipOpen];
|
|
204
|
+
};
|
|
205
|
+
var CustomTooltip = function CustomTooltip(props) {
|
|
206
|
+
return /*#__PURE__*/React__namespace.createElement(material.Tooltip, __assign({}, props, {
|
|
207
|
+
enterDelay: defaultDelay,
|
|
208
|
+
enterNextDelay: defaultDelay,
|
|
209
|
+
disableInteractive: true
|
|
210
|
+
}));
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/* *
|
|
214
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
215
|
+
* you may not use this file except in compliance with the License.
|
|
216
|
+
* You may obtain a copy of the License at
|
|
217
|
+
*
|
|
218
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
219
|
+
*
|
|
220
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
221
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
222
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
223
|
+
* See the License for the specific language governing permissions and
|
|
224
|
+
* limitations under the License.
|
|
225
|
+
*
|
|
226
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
227
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
228
|
+
* */
|
|
229
|
+
var CustomIconButton = /*#__PURE__*/React__namespace.forwardRef(function (_a, ref) {
|
|
230
|
+
var _b = _a.tooltipTitle,
|
|
231
|
+
tooltipTitle = _b === void 0 ? '' : _b,
|
|
232
|
+
_c = _a.variant,
|
|
233
|
+
variant = _c === void 0 ? 'flat' : _c,
|
|
234
|
+
_d = _a.isSelected,
|
|
235
|
+
isSelected = _d === void 0 ? false : _d,
|
|
236
|
+
_e = _a.shouldShowAsDisabled,
|
|
237
|
+
shouldShowAsDisabled = _e === void 0 ? false : _e,
|
|
238
|
+
_f = _a.size,
|
|
239
|
+
size = _f === void 0 ? 'small' : _f,
|
|
240
|
+
children = _a.children,
|
|
241
|
+
className = _a.className,
|
|
242
|
+
props = __rest(_a, ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className"]);
|
|
243
|
+
|
|
244
|
+
var classNames = __spreadArray(__spreadArray(__spreadArray([], __read(className ? [className] : [])), __read(isSelected ? ['Mui-selected'] : [])), [variant]).join(' ');
|
|
245
|
+
|
|
246
|
+
var renderIconButton = function renderIconButton() {
|
|
247
|
+
return /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
|
|
248
|
+
"aria-label": tooltipTitle
|
|
249
|
+
}, props, {
|
|
250
|
+
size: size,
|
|
251
|
+
className: classNames,
|
|
252
|
+
ref: ref,
|
|
253
|
+
sx: __assign(__assign({}, props.sx), shouldShowAsDisabled && {
|
|
254
|
+
'&.MuiIconButton-root': {
|
|
255
|
+
color: "geowebColors.iconButtons." + variant + ".disabled.color"
|
|
256
|
+
},
|
|
257
|
+
'&.Mui-focusVisible': {
|
|
258
|
+
color: "geowebColors.iconButtons." + variant + ".default.color"
|
|
259
|
+
}
|
|
260
|
+
})
|
|
261
|
+
}), children);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
return tooltipTitle ? /*#__PURE__*/React__namespace.createElement(CustomTooltip, {
|
|
265
|
+
title: tooltipTitle,
|
|
266
|
+
placement: "top",
|
|
267
|
+
sx: {
|
|
268
|
+
pointerEvents: 'none'
|
|
269
|
+
}
|
|
270
|
+
}, renderIconButton()) : renderIconButton();
|
|
271
|
+
});
|
|
272
|
+
|
|
164
273
|
var CustomDialog = function CustomDialog(_a) {
|
|
165
274
|
var title = _a.title,
|
|
166
275
|
_onClose = _a.onClose,
|
|
@@ -202,13 +311,17 @@
|
|
|
202
311
|
},
|
|
203
312
|
"data-testid": "customDialog-title",
|
|
204
313
|
component: "span"
|
|
205
|
-
}, title), /*#__PURE__*/React__namespace.createElement(
|
|
314
|
+
}, title), /*#__PURE__*/React__namespace.createElement(CustomIconButton, {
|
|
206
315
|
"data-testid": "customDialog-close",
|
|
207
316
|
"aria-label": "close",
|
|
208
317
|
onClick: function onClick() {
|
|
209
318
|
return _onClose('CLOSED');
|
|
210
319
|
},
|
|
211
|
-
|
|
320
|
+
sx: {
|
|
321
|
+
'&.MuiIconButton-root': {
|
|
322
|
+
color: 'geowebColors.greys.accessible'
|
|
323
|
+
}
|
|
324
|
+
}
|
|
212
325
|
}, /*#__PURE__*/React__namespace.createElement(theme.Close, {
|
|
213
326
|
"data-testid": "CloseIcon"
|
|
214
327
|
}))), /*#__PURE__*/React__namespace.createElement(material.DialogContent, {
|
|
@@ -282,7 +395,7 @@
|
|
|
282
395
|
sm: '150px'
|
|
283
396
|
},
|
|
284
397
|
'&:focus': {
|
|
285
|
-
outline: theme.palette.geowebColors.buttons.
|
|
398
|
+
outline: theme.palette.geowebColors.buttons.primary.focus.outline,
|
|
286
399
|
borderColor: 'transparent'
|
|
287
400
|
}
|
|
288
401
|
};
|
|
@@ -308,7 +421,7 @@
|
|
|
308
421
|
sx: function sx(theme) {
|
|
309
422
|
return __assign(__assign({}, confirmStyle), {
|
|
310
423
|
'&:focus': {
|
|
311
|
-
outline: theme.palette.geowebColors.buttons.
|
|
424
|
+
outline: theme.palette.geowebColors.buttons.primary.focus.outline,
|
|
312
425
|
borderColor: 'transparent'
|
|
313
426
|
}
|
|
314
427
|
});
|
|
@@ -1120,8 +1233,8 @@
|
|
|
1120
1233
|
* See the License for the specific language governing permissions and
|
|
1121
1234
|
* limitations under the License.
|
|
1122
1235
|
*
|
|
1123
|
-
* Copyright
|
|
1124
|
-
* Copyright
|
|
1236
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1237
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1125
1238
|
* */
|
|
1126
1239
|
var styles$3 = {
|
|
1127
1240
|
container: {
|
|
@@ -1141,15 +1254,6 @@
|
|
|
1141
1254
|
paddingLeft: 2,
|
|
1142
1255
|
paddingRight: 2
|
|
1143
1256
|
}
|
|
1144
|
-
},
|
|
1145
|
-
button: {
|
|
1146
|
-
padding: 0,
|
|
1147
|
-
border: 'none',
|
|
1148
|
-
background: 'transparent',
|
|
1149
|
-
'&:hover': {
|
|
1150
|
-
border: 'none',
|
|
1151
|
-
background: 'transparent'
|
|
1152
|
-
}
|
|
1153
1257
|
}
|
|
1154
1258
|
};
|
|
1155
1259
|
|
|
@@ -1162,11 +1266,19 @@
|
|
|
1162
1266
|
onClose = _d === void 0 ? function () {} : _d,
|
|
1163
1267
|
children = _a.children,
|
|
1164
1268
|
initials = _a.initials;
|
|
1165
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(
|
|
1269
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(CustomIconButton, {
|
|
1166
1270
|
"data-testid": "userButton",
|
|
1167
1271
|
onClick: onToggle,
|
|
1168
|
-
sx:
|
|
1169
|
-
|
|
1272
|
+
sx: {
|
|
1273
|
+
'&.MuiButtonBase-root': {
|
|
1274
|
+
background: 'transparent',
|
|
1275
|
+
'&:hover': {
|
|
1276
|
+
border: 'none',
|
|
1277
|
+
background: 'transparent'
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1281
|
+
size: "medium"
|
|
1170
1282
|
}, /*#__PURE__*/React__default["default"].createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default["default"].createElement(material.Paper, {
|
|
1171
1283
|
sx: styles$3.container,
|
|
1172
1284
|
"data-testid": "userMenu"
|
|
@@ -1269,57 +1381,8 @@
|
|
|
1269
1381
|
* See the License for the specific language governing permissions and
|
|
1270
1382
|
* limitations under the License.
|
|
1271
1383
|
*
|
|
1272
|
-
* Copyright
|
|
1273
|
-
* Copyright
|
|
1274
|
-
* */
|
|
1275
|
-
var defaultDelay = 1000;
|
|
1276
|
-
var useControlledTooltip = function useControlledTooltip() {
|
|
1277
|
-
var _a = __read(React__namespace.useState(false), 2),
|
|
1278
|
-
tooltipOpen = _a[0],
|
|
1279
|
-
setTooltipOpen = _a[1];
|
|
1280
|
-
|
|
1281
|
-
var _b = __read(React__namespace.useState(false), 2),
|
|
1282
|
-
delayedTooltip = _b[0],
|
|
1283
|
-
setDelayedTooltip = _b[1];
|
|
1284
|
-
|
|
1285
|
-
React__namespace.useEffect(function () {
|
|
1286
|
-
if (tooltipOpen === true) {
|
|
1287
|
-
var timer_1 = setTimeout(function () {
|
|
1288
|
-
return setDelayedTooltip(true);
|
|
1289
|
-
}, defaultDelay);
|
|
1290
|
-
return function () {
|
|
1291
|
-
clearTimeout(timer_1);
|
|
1292
|
-
};
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
setDelayedTooltip(false);
|
|
1296
|
-
return function () {};
|
|
1297
|
-
}, [tooltipOpen]);
|
|
1298
|
-
return [delayedTooltip, setTooltipOpen];
|
|
1299
|
-
};
|
|
1300
|
-
var CustomTooltip = function CustomTooltip(props) {
|
|
1301
|
-
return /*#__PURE__*/React__namespace.createElement(material.Tooltip, __assign({}, props, {
|
|
1302
|
-
enterDelay: defaultDelay,
|
|
1303
|
-
enterNextDelay: defaultDelay,
|
|
1304
|
-
disableInteractive: true
|
|
1305
|
-
}));
|
|
1306
|
-
};
|
|
1307
|
-
|
|
1308
|
-
/* *
|
|
1309
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1310
|
-
* you may not use this file except in compliance with the License.
|
|
1311
|
-
* You may obtain a copy of the License at
|
|
1312
|
-
*
|
|
1313
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1314
|
-
*
|
|
1315
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1316
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1317
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1318
|
-
* See the License for the specific language governing permissions and
|
|
1319
|
-
* limitations under the License.
|
|
1320
|
-
*
|
|
1321
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1322
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
1384
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1385
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1323
1386
|
* */
|
|
1324
1387
|
|
|
1325
1388
|
var getStyle = function getStyle(size) {
|
|
@@ -1417,13 +1480,13 @@
|
|
|
1417
1480
|
}, isDraggable && size !== 'xxs' && !leftHeaderComponent && /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1418
1481
|
container: true,
|
|
1419
1482
|
justifyContent: "flex-start"
|
|
1420
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
1483
|
+
}, /*#__PURE__*/React__default["default"].createElement(CustomIconButton, {
|
|
1421
1484
|
"data-testid": "dragBtn",
|
|
1422
1485
|
disableRipple: true,
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
}
|
|
1486
|
+
sx: {
|
|
1487
|
+
pointerEvents: 'none',
|
|
1488
|
+
'&.MuiIconButton-root': iconStyle
|
|
1489
|
+
}
|
|
1427
1490
|
}, /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null))), leftHeaderComponent && leftHeaderComponent), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1428
1491
|
className: "header-title",
|
|
1429
1492
|
item: true,
|
|
@@ -1439,15 +1502,16 @@
|
|
|
1439
1502
|
fontSize: styles.fontSize,
|
|
1440
1503
|
fontWeight: styles.fontWeight
|
|
1441
1504
|
}
|
|
1442
|
-
}, title), size === 'xxs' && /*#__PURE__*/React__default["default"].createElement(
|
|
1505
|
+
}, title), size === 'xxs' && /*#__PURE__*/React__default["default"].createElement(CustomIconButton, {
|
|
1443
1506
|
"data-testid": "dragBtn-xxs",
|
|
1444
1507
|
disableRipple: true,
|
|
1445
|
-
|
|
1446
|
-
sx: __assign(__assign({}, iconStyle), {
|
|
1508
|
+
sx: {
|
|
1447
1509
|
pointerEvents: 'none',
|
|
1448
1510
|
transform: 'rotate(90deg)',
|
|
1449
|
-
|
|
1450
|
-
|
|
1511
|
+
'&.MuiButtonBase-root.MuiIconButton-root': __assign(__assign({}, iconStyle), {
|
|
1512
|
+
height: 12
|
|
1513
|
+
})
|
|
1514
|
+
}
|
|
1451
1515
|
}, /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null)))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1452
1516
|
className: "header-right",
|
|
1453
1517
|
item: true,
|
|
@@ -1460,12 +1524,13 @@
|
|
|
1460
1524
|
sx: {
|
|
1461
1525
|
pointerEvents: 'none'
|
|
1462
1526
|
}
|
|
1463
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
1527
|
+
}, /*#__PURE__*/React__default["default"].createElement(CustomIconButton, {
|
|
1464
1528
|
"data-testid": "closeBtn",
|
|
1465
1529
|
onClick: onClose,
|
|
1466
1530
|
onTouchEnd: onClose,
|
|
1467
|
-
|
|
1468
|
-
|
|
1531
|
+
sx: {
|
|
1532
|
+
'&.MuiButtonBase-root.MuiIconButton-root': iconStyle
|
|
1533
|
+
}
|
|
1469
1534
|
}, /*#__PURE__*/React__default["default"].createElement(theme.Close, {
|
|
1470
1535
|
"data-testid": "CloseIcon"
|
|
1471
1536
|
}))))));
|
|
@@ -2587,17 +2652,19 @@
|
|
|
2587
2652
|
menuTitle = _e === void 0 ? '' : _e,
|
|
2588
2653
|
variant = _a.variant,
|
|
2589
2654
|
_f = _a.isDefaultOpen,
|
|
2590
|
-
isDefaultOpen = _f === void 0 ? false : _f
|
|
2655
|
+
isDefaultOpen = _f === void 0 ? false : _f,
|
|
2656
|
+
_g = _a.buttonIcon,
|
|
2657
|
+
buttonIcon = _g === void 0 ? /*#__PURE__*/React__namespace.createElement(theme.Options, null) : _g;
|
|
2591
2658
|
|
|
2592
|
-
var
|
|
2593
|
-
anchorEl =
|
|
2594
|
-
setAnchorEl =
|
|
2659
|
+
var _h = __read(React__namespace.useState(null), 2),
|
|
2660
|
+
anchorEl = _h[0],
|
|
2661
|
+
setAnchorEl = _h[1];
|
|
2595
2662
|
|
|
2596
2663
|
var isOpen = Boolean(anchorEl);
|
|
2597
2664
|
|
|
2598
|
-
var
|
|
2599
|
-
anchorOrigin =
|
|
2600
|
-
transformOrigin =
|
|
2665
|
+
var _j = getPosition(menuPosition),
|
|
2666
|
+
anchorOrigin = _j.anchorOrigin,
|
|
2667
|
+
transformOrigin = _j.transformOrigin;
|
|
2601
2668
|
|
|
2602
2669
|
var handleClick = function handleClick(event) {
|
|
2603
2670
|
event.stopPropagation();
|
|
@@ -2624,7 +2691,7 @@
|
|
|
2624
2691
|
"data-testid": buttonTestId,
|
|
2625
2692
|
variant: variant,
|
|
2626
2693
|
id: buttonTestId
|
|
2627
|
-
},
|
|
2694
|
+
}, buttonIcon)), /*#__PURE__*/React__namespace.createElement(material.Menu, {
|
|
2628
2695
|
anchorEl: anchorEl,
|
|
2629
2696
|
open: isOpen,
|
|
2630
2697
|
onClose: function onClose(event, reason) {
|
|
@@ -2653,7 +2720,7 @@
|
|
|
2653
2720
|
sx: {
|
|
2654
2721
|
fontSize: '12px'
|
|
2655
2722
|
}
|
|
2656
|
-
}, menuTitle)), menuItems && menuItems.map(function (menuItem) {
|
|
2723
|
+
}, menuTitle)), menuItems && menuItems.length ? menuItems.map(function (menuItem) {
|
|
2657
2724
|
var text = menuItem.text,
|
|
2658
2725
|
icon = menuItem.icon,
|
|
2659
2726
|
action = menuItem.action;
|
|
@@ -2664,92 +2731,8 @@
|
|
|
2664
2731
|
handleClose(event);
|
|
2665
2732
|
}
|
|
2666
2733
|
}, icon && /*#__PURE__*/React__namespace.createElement(material.ListItemIcon, null, icon), /*#__PURE__*/React__namespace.createElement(material.Typography, null, text));
|
|
2667
|
-
}),
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
/* *
|
|
2671
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2672
|
-
* you may not use this file except in compliance with the License.
|
|
2673
|
-
* You may obtain a copy of the License at
|
|
2674
|
-
*
|
|
2675
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2676
|
-
*
|
|
2677
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2678
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2679
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2680
|
-
* See the License for the specific language governing permissions and
|
|
2681
|
-
* limitations under the License.
|
|
2682
|
-
*
|
|
2683
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2684
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2685
|
-
* */
|
|
2686
|
-
|
|
2687
|
-
var makeButtonStyles = function makeButtonStyles(isActive, isEnabled, isAccessible) {
|
|
2688
|
-
return {
|
|
2689
|
-
height: '24px',
|
|
2690
|
-
width: '24px',
|
|
2691
|
-
borderRadius: '5px',
|
|
2692
|
-
marginTop: 'auto',
|
|
2693
|
-
marginBottom: 'auto',
|
|
2694
|
-
color: function color() {
|
|
2695
|
-
if (!isEnabled) {
|
|
2696
|
-
return 'geowebColors.buttons.flat.disabled.color';
|
|
2697
|
-
}
|
|
2698
|
-
|
|
2699
|
-
if (isAccessible) {
|
|
2700
|
-
return 'geowebColors.greys.accessible';
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
if (isActive) {
|
|
2704
|
-
return 'common.white';
|
|
2705
|
-
}
|
|
2706
|
-
|
|
2707
|
-
return 'geowebColors.buttons.flat.default.color';
|
|
2708
|
-
},
|
|
2709
|
-
backgroundColor: function backgroundColor() {
|
|
2710
|
-
return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
|
|
2711
|
-
},
|
|
2712
|
-
'&:hover': {
|
|
2713
|
-
backgroundColor: function backgroundColor() {
|
|
2714
|
-
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
};
|
|
2718
|
-
};
|
|
2719
|
-
|
|
2720
|
-
var ManagerButton = function ManagerButton(_a) {
|
|
2721
|
-
var _b = _a.tooltipTitle,
|
|
2722
|
-
tooltipTitle = _b === void 0 ? '' : _b,
|
|
2723
|
-
_c = _a.onClick,
|
|
2724
|
-
onClick = _c === void 0 ? function () {} : _c,
|
|
2725
|
-
_d = _a.isActive,
|
|
2726
|
-
isActive = _d === void 0 ? false : _d,
|
|
2727
|
-
_e = _a.isEnabled,
|
|
2728
|
-
isEnabled = _e === void 0 ? true : _e,
|
|
2729
|
-
icon = _a.icon,
|
|
2730
|
-
_f = _a.isAccessible,
|
|
2731
|
-
isAccessible = _f === void 0 ? false : _f,
|
|
2732
|
-
sx = _a.sx,
|
|
2733
|
-
children = _a.children,
|
|
2734
|
-
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "isAccessible", "sx", "children"]);
|
|
2735
|
-
|
|
2736
|
-
var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
|
|
2737
|
-
|
|
2738
|
-
var handleClick = function handleClick(event) {
|
|
2739
|
-
onClick(event);
|
|
2740
|
-
};
|
|
2741
|
-
|
|
2742
|
-
return /*#__PURE__*/React__namespace.createElement(CustomTooltip, {
|
|
2743
|
-
title: tooltipTitle,
|
|
2744
|
-
placement: "top",
|
|
2745
|
-
sx: {
|
|
2746
|
-
pointerEvents: 'none'
|
|
2747
|
-
}
|
|
2748
|
-
}, children || /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
|
|
2749
|
-
size: "small",
|
|
2750
|
-
onClick: handleClick,
|
|
2751
|
-
sx: __assign(__assign({}, buttonStyles), sx)
|
|
2752
|
-
}, props), icon));
|
|
2734
|
+
}) : /*#__PURE__*/React__namespace.createElement("div", null) // Needed to make the menu work without any menuItems
|
|
2735
|
+
, children));
|
|
2753
2736
|
};
|
|
2754
2737
|
|
|
2755
2738
|
/* *
|
|
@@ -2793,7 +2776,7 @@
|
|
|
2793
2776
|
},
|
|
2794
2777
|
'&.Mui-focused .MuiSelect-select': {
|
|
2795
2778
|
outline: function outline(theme) {
|
|
2796
|
-
return theme.palette.geowebColors.buttons.
|
|
2779
|
+
return theme.palette.geowebColors.buttons.tool.focus.outline;
|
|
2797
2780
|
},
|
|
2798
2781
|
borderRadius: 0
|
|
2799
2782
|
},
|
|
@@ -2815,7 +2798,7 @@
|
|
|
2815
2798
|
},
|
|
2816
2799
|
'&.Mui-focused .MuiSelect-select': {
|
|
2817
2800
|
outline: function outline(theme) {
|
|
2818
|
-
return theme.palette.geowebColors.buttons.
|
|
2801
|
+
return theme.palette.geowebColors.buttons.tool.focus.outline;
|
|
2819
2802
|
},
|
|
2820
2803
|
borderRadius: 0,
|
|
2821
2804
|
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
@@ -2825,7 +2808,7 @@
|
|
|
2825
2808
|
},
|
|
2826
2809
|
'&:focus&.MuiButton-root': {
|
|
2827
2810
|
border: function border(theme) {
|
|
2828
|
-
return theme.palette.geowebColors.buttons.
|
|
2811
|
+
return theme.palette.geowebColors.buttons.tool.focus.outline;
|
|
2829
2812
|
},
|
|
2830
2813
|
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill',
|
|
2831
2814
|
transition: 'border'
|
|
@@ -3329,6 +3312,48 @@
|
|
|
3329
3312
|
|
|
3330
3313
|
return new Date(yearOrIsoString, month, day, hours, minutes, seconds, milliseconds);
|
|
3331
3314
|
};
|
|
3315
|
+
/**
|
|
3316
|
+
*
|
|
3317
|
+
* @param date
|
|
3318
|
+
* @param duration
|
|
3319
|
+
* @returns {Date} the new Date
|
|
3320
|
+
*/
|
|
3321
|
+
|
|
3322
|
+
var add = function add(date, duration) {
|
|
3323
|
+
return dateFns.add(date, duration);
|
|
3324
|
+
};
|
|
3325
|
+
/**
|
|
3326
|
+
*
|
|
3327
|
+
* @param date
|
|
3328
|
+
* @param duration
|
|
3329
|
+
* @returns {Date} the new Date
|
|
3330
|
+
*/
|
|
3331
|
+
|
|
3332
|
+
var sub = function sub(date, duration) {
|
|
3333
|
+
return dateFns.sub(date, duration);
|
|
3334
|
+
};
|
|
3335
|
+
/**
|
|
3336
|
+
* Finds the number of minuts between to dates
|
|
3337
|
+
*
|
|
3338
|
+
* @param dateLeft - the later date
|
|
3339
|
+
* @param dateRight - the earlier date
|
|
3340
|
+
* @returns {number} the number of minutes
|
|
3341
|
+
*/
|
|
3342
|
+
|
|
3343
|
+
var differenceInMinutes = function differenceInMinutes(dateLeft, dateRight) {
|
|
3344
|
+
return dateFns.differenceInMinutes(dateLeft, dateRight);
|
|
3345
|
+
};
|
|
3346
|
+
/**
|
|
3347
|
+
* Finds the number of hours between to dates
|
|
3348
|
+
*
|
|
3349
|
+
* @param dateLeft - the later date
|
|
3350
|
+
* @param dateRight - the earlier date
|
|
3351
|
+
* @returns {number} the number of hours
|
|
3352
|
+
*/
|
|
3353
|
+
|
|
3354
|
+
var differenceInHours = function differenceInHours(dateLeft, dateRight) {
|
|
3355
|
+
return dateFns.differenceInHours(dateLeft, dateRight);
|
|
3356
|
+
};
|
|
3332
3357
|
|
|
3333
3358
|
/* *
|
|
3334
3359
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -3354,7 +3379,11 @@
|
|
|
3354
3379
|
setUTCDate: setUTCDate,
|
|
3355
3380
|
dateToString: dateToString,
|
|
3356
3381
|
isBetween: isBetween,
|
|
3357
|
-
createDate: createDate
|
|
3382
|
+
createDate: createDate,
|
|
3383
|
+
add: add,
|
|
3384
|
+
sub: sub,
|
|
3385
|
+
differenceInMinutes: differenceInMinutes,
|
|
3386
|
+
differenceInHours: differenceInHours
|
|
3358
3387
|
});
|
|
3359
3388
|
|
|
3360
3389
|
exports.AlertBanner = AlertBanner;
|
|
@@ -3366,13 +3395,13 @@
|
|
|
3366
3395
|
exports.ConfirmationServiceProvider = ConfirmationServiceProvider;
|
|
3367
3396
|
exports.CustomAccordion = CustomAccordion;
|
|
3368
3397
|
exports.CustomDialog = CustomDialog;
|
|
3398
|
+
exports.CustomIconButton = CustomIconButton;
|
|
3369
3399
|
exports.CustomSlider = CustomSlider;
|
|
3370
3400
|
exports.CustomToggleButton = CustomToggleButton;
|
|
3371
3401
|
exports.CustomTooltip = CustomTooltip;
|
|
3372
3402
|
exports.DEFAULT_ERROR_MESSAGE = DEFAULT_ERROR_MESSAGE;
|
|
3373
3403
|
exports.Draggable = DraggableComponent$1;
|
|
3374
3404
|
exports.ErrorBoundary = ErrorBoundary;
|
|
3375
|
-
exports.ManagerButton = ManagerButton;
|
|
3376
3405
|
exports.Resizable = ResizeComponent;
|
|
3377
3406
|
exports.StatusTag = StatusTag;
|
|
3378
3407
|
exports.ToggleMenu = ToggleMenu;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconButtonProps } from '@mui/material';
|
|
3
|
+
export declare type Variant = 'flat' | 'tool' | 'boxed';
|
|
4
|
+
export interface CustomIconProps extends IconButtonProps {
|
|
5
|
+
tooltipTitle?: string;
|
|
6
|
+
variant?: Variant;
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
shouldShowAsDisabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const CustomIconButton: React.FC<CustomIconProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const CustomIconButtonLight: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
parameters: {
|
|
10
|
+
zeplinLink: {
|
|
11
|
+
name: string;
|
|
12
|
+
link: string;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const CustomIconButtonDark: {
|
|
17
|
+
(): React.ReactElement;
|
|
18
|
+
storyName: string;
|
|
19
|
+
parameters: {
|
|
20
|
+
zeplinLink: {
|
|
21
|
+
name: string;
|
|
22
|
+
link: string;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomIconButton';
|
|
@@ -11,7 +11,6 @@ export * from './CustomSlider';
|
|
|
11
11
|
export * from './CustomToggleButton';
|
|
12
12
|
export * from './ToolButton';
|
|
13
13
|
export * from './ToggleMenu';
|
|
14
|
-
export * from './ManagerButton';
|
|
15
14
|
export * from './AlertIcon';
|
|
16
15
|
export * from './TooltipSelect';
|
|
17
16
|
export * from './Avatar';
|
|
@@ -19,3 +18,4 @@ export * from './WithEggs';
|
|
|
19
18
|
export * from './CustomTooltip';
|
|
20
19
|
export * from './CustomAccordion';
|
|
21
20
|
export * from './CustomDialog';
|
|
21
|
+
export * from './CustomIconButton';
|
|
@@ -131,3 +131,33 @@ export declare const isBetween: (date: Date, from: Date, to: Date, inclusivity?:
|
|
|
131
131
|
* // => 2022-12-13T00:00:00.000Z
|
|
132
132
|
*/
|
|
133
133
|
export declare const createDate: (yearOrIsoString?: string | number | undefined, month?: number | undefined, day?: number | undefined, hours?: number, minutes?: number, seconds?: number, milliseconds?: number) => Date;
|
|
134
|
+
/**
|
|
135
|
+
*
|
|
136
|
+
* @param date
|
|
137
|
+
* @param duration
|
|
138
|
+
* @returns {Date} the new Date
|
|
139
|
+
*/
|
|
140
|
+
export declare const add: (date: Date | number, duration: Duration) => Date;
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param date
|
|
144
|
+
* @param duration
|
|
145
|
+
* @returns {Date} the new Date
|
|
146
|
+
*/
|
|
147
|
+
export declare const sub: (date: Date | number, duration: Duration) => Date;
|
|
148
|
+
/**
|
|
149
|
+
* Finds the number of minuts between to dates
|
|
150
|
+
*
|
|
151
|
+
* @param dateLeft - the later date
|
|
152
|
+
* @param dateRight - the earlier date
|
|
153
|
+
* @returns {number} the number of minutes
|
|
154
|
+
*/
|
|
155
|
+
export declare const differenceInMinutes: (dateLeft: Date | number, dateRight: Date | number) => number;
|
|
156
|
+
/**
|
|
157
|
+
* Finds the number of hours between to dates
|
|
158
|
+
*
|
|
159
|
+
* @param dateLeft - the later date
|
|
160
|
+
* @param dateRight - the earlier date
|
|
161
|
+
* @returns {number} the number of hours
|
|
162
|
+
*/
|
|
163
|
+
export declare const differenceInHours: (dateLeft: Date | number, dateRight: Date | number) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.1",
|
|
4
4
|
"description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^18.2.0",
|
|
16
|
-
"@mui/material": "^5.
|
|
17
|
-
"@opengeoweb/theme": "4.
|
|
16
|
+
"@mui/material": "^5.12.0",
|
|
17
|
+
"@opengeoweb/theme": "4.19.1",
|
|
18
|
+
"@mui/x-date-pickers": "^6.2.1",
|
|
18
19
|
"react-draggable": "^4.4.5",
|
|
19
20
|
"re-resizable": "^6.9.0",
|
|
20
21
|
"@redux-eggs/core": "^2.2.0",
|