@opengeoweb/shared 4.22.0 → 5.0.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.js
CHANGED
|
@@ -2,8 +2,8 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { useRef, createContext, useContext } from 'react';
|
|
3
3
|
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
4
4
|
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown } from '@opengeoweb/theme';
|
|
5
|
-
import require$$2 from 'react-dom';
|
|
6
|
-
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, isBefore as isBefore$1, isAfter as isAfter$1 } from 'date-fns';
|
|
5
|
+
import require$$2, { flushSync } from 'react-dom';
|
|
6
|
+
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1 } from 'date-fns';
|
|
7
7
|
|
|
8
8
|
/******************************************************************************
|
|
9
9
|
Copyright (c) Microsoft Corporation.
|
|
@@ -21228,7 +21228,7 @@ var __extends$1 = (undefined && undefined.__extends) || (function () {
|
|
|
21228
21228
|
var extendStatics = function (d, b) {
|
|
21229
21229
|
extendStatics = Object.setPrototypeOf ||
|
|
21230
21230
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21231
|
-
function (d, b) { for (var p in b) if (
|
|
21231
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
21232
21232
|
return extendStatics(d, b);
|
|
21233
21233
|
};
|
|
21234
21234
|
return function (d, b) {
|
|
@@ -21248,67 +21248,34 @@ var __assign$1 = (undefined && undefined.__assign) || function () {
|
|
|
21248
21248
|
};
|
|
21249
21249
|
return __assign$1.apply(this, arguments);
|
|
21250
21250
|
};
|
|
21251
|
+
var rowSizeBase = {
|
|
21252
|
+
width: '100%',
|
|
21253
|
+
height: '10px',
|
|
21254
|
+
top: '0px',
|
|
21255
|
+
left: '0px',
|
|
21256
|
+
cursor: 'row-resize',
|
|
21257
|
+
};
|
|
21258
|
+
var colSizeBase = {
|
|
21259
|
+
width: '10px',
|
|
21260
|
+
height: '100%',
|
|
21261
|
+
top: '0px',
|
|
21262
|
+
left: '0px',
|
|
21263
|
+
cursor: 'col-resize',
|
|
21264
|
+
};
|
|
21265
|
+
var edgeBase = {
|
|
21266
|
+
width: '20px',
|
|
21267
|
+
height: '20px',
|
|
21268
|
+
position: 'absolute',
|
|
21269
|
+
};
|
|
21251
21270
|
var styles$5 = {
|
|
21252
|
-
top: {
|
|
21253
|
-
|
|
21254
|
-
|
|
21255
|
-
|
|
21256
|
-
|
|
21257
|
-
|
|
21258
|
-
},
|
|
21259
|
-
|
|
21260
|
-
width: '10px',
|
|
21261
|
-
height: '100%',
|
|
21262
|
-
top: '0px',
|
|
21263
|
-
right: '-5px',
|
|
21264
|
-
cursor: 'col-resize',
|
|
21265
|
-
},
|
|
21266
|
-
bottom: {
|
|
21267
|
-
width: '100%',
|
|
21268
|
-
height: '10px',
|
|
21269
|
-
bottom: '-5px',
|
|
21270
|
-
left: '0px',
|
|
21271
|
-
cursor: 'row-resize',
|
|
21272
|
-
},
|
|
21273
|
-
left: {
|
|
21274
|
-
width: '10px',
|
|
21275
|
-
height: '100%',
|
|
21276
|
-
top: '0px',
|
|
21277
|
-
left: '-5px',
|
|
21278
|
-
cursor: 'col-resize',
|
|
21279
|
-
},
|
|
21280
|
-
topRight: {
|
|
21281
|
-
width: '20px',
|
|
21282
|
-
height: '20px',
|
|
21283
|
-
position: 'absolute',
|
|
21284
|
-
right: '-10px',
|
|
21285
|
-
top: '-10px',
|
|
21286
|
-
cursor: 'ne-resize',
|
|
21287
|
-
},
|
|
21288
|
-
bottomRight: {
|
|
21289
|
-
width: '20px',
|
|
21290
|
-
height: '20px',
|
|
21291
|
-
position: 'absolute',
|
|
21292
|
-
right: '-10px',
|
|
21293
|
-
bottom: '-10px',
|
|
21294
|
-
cursor: 'se-resize',
|
|
21295
|
-
},
|
|
21296
|
-
bottomLeft: {
|
|
21297
|
-
width: '20px',
|
|
21298
|
-
height: '20px',
|
|
21299
|
-
position: 'absolute',
|
|
21300
|
-
left: '-10px',
|
|
21301
|
-
bottom: '-10px',
|
|
21302
|
-
cursor: 'sw-resize',
|
|
21303
|
-
},
|
|
21304
|
-
topLeft: {
|
|
21305
|
-
width: '20px',
|
|
21306
|
-
height: '20px',
|
|
21307
|
-
position: 'absolute',
|
|
21308
|
-
left: '-10px',
|
|
21309
|
-
top: '-10px',
|
|
21310
|
-
cursor: 'nw-resize',
|
|
21311
|
-
},
|
|
21271
|
+
top: __assign$1(__assign$1({}, rowSizeBase), { top: '-5px' }),
|
|
21272
|
+
right: __assign$1(__assign$1({}, colSizeBase), { left: undefined, right: '-5px' }),
|
|
21273
|
+
bottom: __assign$1(__assign$1({}, rowSizeBase), { top: undefined, bottom: '-5px' }),
|
|
21274
|
+
left: __assign$1(__assign$1({}, colSizeBase), { left: '-5px' }),
|
|
21275
|
+
topRight: __assign$1(__assign$1({}, edgeBase), { right: '-10px', top: '-10px', cursor: 'ne-resize' }),
|
|
21276
|
+
bottomRight: __assign$1(__assign$1({}, edgeBase), { right: '-10px', bottom: '-10px', cursor: 'se-resize' }),
|
|
21277
|
+
bottomLeft: __assign$1(__assign$1({}, edgeBase), { left: '-10px', bottom: '-10px', cursor: 'sw-resize' }),
|
|
21278
|
+
topLeft: __assign$1(__assign$1({}, edgeBase), { left: '-10px', top: '-10px', cursor: 'nw-resize' }),
|
|
21312
21279
|
};
|
|
21313
21280
|
var Resizer = /** @class */ (function (_super) {
|
|
21314
21281
|
__extends$1(Resizer, _super);
|
|
@@ -21328,160 +21295,11 @@ var Resizer = /** @class */ (function (_super) {
|
|
|
21328
21295
|
return Resizer;
|
|
21329
21296
|
}(React$1.PureComponent));
|
|
21330
21297
|
|
|
21331
|
-
var src = {exports: {}};
|
|
21332
|
-
|
|
21333
|
-
//
|
|
21334
|
-
// Main
|
|
21335
|
-
//
|
|
21336
|
-
|
|
21337
|
-
function memoize (fn, options) {
|
|
21338
|
-
var cache = options && options.cache
|
|
21339
|
-
? options.cache
|
|
21340
|
-
: cacheDefault;
|
|
21341
|
-
|
|
21342
|
-
var serializer = options && options.serializer
|
|
21343
|
-
? options.serializer
|
|
21344
|
-
: serializerDefault;
|
|
21345
|
-
|
|
21346
|
-
var strategy = options && options.strategy
|
|
21347
|
-
? options.strategy
|
|
21348
|
-
: strategyDefault;
|
|
21349
|
-
|
|
21350
|
-
return strategy(fn, {
|
|
21351
|
-
cache: cache,
|
|
21352
|
-
serializer: serializer
|
|
21353
|
-
})
|
|
21354
|
-
}
|
|
21355
|
-
|
|
21356
|
-
//
|
|
21357
|
-
// Strategy
|
|
21358
|
-
//
|
|
21359
|
-
|
|
21360
|
-
function isPrimitive (value) {
|
|
21361
|
-
return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === "string" 'unsafe' primitive for our needs
|
|
21362
|
-
}
|
|
21363
|
-
|
|
21364
|
-
function monadic (fn, cache, serializer, arg) {
|
|
21365
|
-
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
21366
|
-
|
|
21367
|
-
var computedValue = cache.get(cacheKey);
|
|
21368
|
-
if (typeof computedValue === 'undefined') {
|
|
21369
|
-
computedValue = fn.call(this, arg);
|
|
21370
|
-
cache.set(cacheKey, computedValue);
|
|
21371
|
-
}
|
|
21372
|
-
|
|
21373
|
-
return computedValue
|
|
21374
|
-
}
|
|
21375
|
-
|
|
21376
|
-
function variadic (fn, cache, serializer) {
|
|
21377
|
-
var args = Array.prototype.slice.call(arguments, 3);
|
|
21378
|
-
var cacheKey = serializer(args);
|
|
21379
|
-
|
|
21380
|
-
var computedValue = cache.get(cacheKey);
|
|
21381
|
-
if (typeof computedValue === 'undefined') {
|
|
21382
|
-
computedValue = fn.apply(this, args);
|
|
21383
|
-
cache.set(cacheKey, computedValue);
|
|
21384
|
-
}
|
|
21385
|
-
|
|
21386
|
-
return computedValue
|
|
21387
|
-
}
|
|
21388
|
-
|
|
21389
|
-
function assemble (fn, context, strategy, cache, serialize) {
|
|
21390
|
-
return strategy.bind(
|
|
21391
|
-
context,
|
|
21392
|
-
fn,
|
|
21393
|
-
cache,
|
|
21394
|
-
serialize
|
|
21395
|
-
)
|
|
21396
|
-
}
|
|
21397
|
-
|
|
21398
|
-
function strategyDefault (fn, options) {
|
|
21399
|
-
var strategy = fn.length === 1 ? monadic : variadic;
|
|
21400
|
-
|
|
21401
|
-
return assemble(
|
|
21402
|
-
fn,
|
|
21403
|
-
this,
|
|
21404
|
-
strategy,
|
|
21405
|
-
options.cache.create(),
|
|
21406
|
-
options.serializer
|
|
21407
|
-
)
|
|
21408
|
-
}
|
|
21409
|
-
|
|
21410
|
-
function strategyVariadic (fn, options) {
|
|
21411
|
-
var strategy = variadic;
|
|
21412
|
-
|
|
21413
|
-
return assemble(
|
|
21414
|
-
fn,
|
|
21415
|
-
this,
|
|
21416
|
-
strategy,
|
|
21417
|
-
options.cache.create(),
|
|
21418
|
-
options.serializer
|
|
21419
|
-
)
|
|
21420
|
-
}
|
|
21421
|
-
|
|
21422
|
-
function strategyMonadic (fn, options) {
|
|
21423
|
-
var strategy = monadic;
|
|
21424
|
-
|
|
21425
|
-
return assemble(
|
|
21426
|
-
fn,
|
|
21427
|
-
this,
|
|
21428
|
-
strategy,
|
|
21429
|
-
options.cache.create(),
|
|
21430
|
-
options.serializer
|
|
21431
|
-
)
|
|
21432
|
-
}
|
|
21433
|
-
|
|
21434
|
-
//
|
|
21435
|
-
// Serializer
|
|
21436
|
-
//
|
|
21437
|
-
|
|
21438
|
-
function serializerDefault () {
|
|
21439
|
-
return JSON.stringify(arguments)
|
|
21440
|
-
}
|
|
21441
|
-
|
|
21442
|
-
//
|
|
21443
|
-
// Cache
|
|
21444
|
-
//
|
|
21445
|
-
|
|
21446
|
-
function ObjectWithoutPrototypeCache () {
|
|
21447
|
-
this.cache = Object.create(null);
|
|
21448
|
-
}
|
|
21449
|
-
|
|
21450
|
-
ObjectWithoutPrototypeCache.prototype.has = function (key) {
|
|
21451
|
-
return (key in this.cache)
|
|
21452
|
-
};
|
|
21453
|
-
|
|
21454
|
-
ObjectWithoutPrototypeCache.prototype.get = function (key) {
|
|
21455
|
-
return this.cache[key]
|
|
21456
|
-
};
|
|
21457
|
-
|
|
21458
|
-
ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
|
|
21459
|
-
this.cache[key] = value;
|
|
21460
|
-
};
|
|
21461
|
-
|
|
21462
|
-
var cacheDefault = {
|
|
21463
|
-
create: function create () {
|
|
21464
|
-
return new ObjectWithoutPrototypeCache()
|
|
21465
|
-
}
|
|
21466
|
-
};
|
|
21467
|
-
|
|
21468
|
-
//
|
|
21469
|
-
// API
|
|
21470
|
-
//
|
|
21471
|
-
|
|
21472
|
-
src.exports = memoize;
|
|
21473
|
-
src.exports.strategies = {
|
|
21474
|
-
variadic: strategyVariadic,
|
|
21475
|
-
monadic: strategyMonadic
|
|
21476
|
-
};
|
|
21477
|
-
|
|
21478
|
-
var memoize$1 = src.exports;
|
|
21479
|
-
|
|
21480
21298
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
21481
21299
|
var extendStatics = function (d, b) {
|
|
21482
21300
|
extendStatics = Object.setPrototypeOf ||
|
|
21483
21301
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21484
|
-
function (d, b) { for (var p in b) if (
|
|
21302
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
21485
21303
|
return extendStatics(d, b);
|
|
21486
21304
|
};
|
|
21487
21305
|
return function (d, b) {
|
|
@@ -21505,11 +21323,11 @@ var DEFAULT_SIZE = {
|
|
|
21505
21323
|
width: 'auto',
|
|
21506
21324
|
height: 'auto',
|
|
21507
21325
|
};
|
|
21508
|
-
var clamp =
|
|
21509
|
-
var snap =
|
|
21510
|
-
var hasDirection =
|
|
21326
|
+
var clamp = function (n, min, max) { return Math.max(Math.min(n, max), min); };
|
|
21327
|
+
var snap = function (n, size) { return Math.round(n / size) * size; };
|
|
21328
|
+
var hasDirection = function (dir, target) {
|
|
21511
21329
|
return new RegExp(dir, 'i').test(target);
|
|
21512
|
-
}
|
|
21330
|
+
};
|
|
21513
21331
|
// INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.
|
|
21514
21332
|
var isTouchEvent = function (event) {
|
|
21515
21333
|
return Boolean(event.touches && event.touches.length);
|
|
@@ -21518,61 +21336,58 @@ var isMouseEvent = function (event) {
|
|
|
21518
21336
|
return Boolean((event.clientX || event.clientX === 0) &&
|
|
21519
21337
|
(event.clientY || event.clientY === 0));
|
|
21520
21338
|
};
|
|
21521
|
-
var findClosestSnap =
|
|
21339
|
+
var findClosestSnap = function (n, snapArray, snapGap) {
|
|
21522
21340
|
if (snapGap === void 0) { snapGap = 0; }
|
|
21523
21341
|
var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);
|
|
21524
21342
|
var gap = Math.abs(snapArray[closestGapIndex] - n);
|
|
21525
21343
|
return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
|
|
21526
|
-
}
|
|
21527
|
-
var
|
|
21528
|
-
return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
|
|
21529
|
-
});
|
|
21530
|
-
var getStringSize = memoize$1(function (n) {
|
|
21344
|
+
};
|
|
21345
|
+
var getStringSize = function (n) {
|
|
21531
21346
|
n = n.toString();
|
|
21532
21347
|
if (n === 'auto') {
|
|
21533
21348
|
return n;
|
|
21534
21349
|
}
|
|
21535
|
-
if (endsWith(
|
|
21350
|
+
if (n.endsWith('px')) {
|
|
21536
21351
|
return n;
|
|
21537
21352
|
}
|
|
21538
|
-
if (endsWith(
|
|
21353
|
+
if (n.endsWith('%')) {
|
|
21539
21354
|
return n;
|
|
21540
21355
|
}
|
|
21541
|
-
if (endsWith(
|
|
21356
|
+
if (n.endsWith('vh')) {
|
|
21542
21357
|
return n;
|
|
21543
21358
|
}
|
|
21544
|
-
if (endsWith(
|
|
21359
|
+
if (n.endsWith('vw')) {
|
|
21545
21360
|
return n;
|
|
21546
21361
|
}
|
|
21547
|
-
if (endsWith(
|
|
21362
|
+
if (n.endsWith('vmax')) {
|
|
21548
21363
|
return n;
|
|
21549
21364
|
}
|
|
21550
|
-
if (endsWith(
|
|
21365
|
+
if (n.endsWith('vmin')) {
|
|
21551
21366
|
return n;
|
|
21552
21367
|
}
|
|
21553
21368
|
return n + "px";
|
|
21554
|
-
}
|
|
21369
|
+
};
|
|
21555
21370
|
var getPixelSize = function (size, parentSize, innerWidth, innerHeight) {
|
|
21556
21371
|
if (size && typeof size === 'string') {
|
|
21557
|
-
if (endsWith(
|
|
21372
|
+
if (size.endsWith('px')) {
|
|
21558
21373
|
return Number(size.replace('px', ''));
|
|
21559
21374
|
}
|
|
21560
|
-
if (endsWith(
|
|
21375
|
+
if (size.endsWith('%')) {
|
|
21561
21376
|
var ratio = Number(size.replace('%', '')) / 100;
|
|
21562
21377
|
return parentSize * ratio;
|
|
21563
21378
|
}
|
|
21564
|
-
if (endsWith(
|
|
21379
|
+
if (size.endsWith('vw')) {
|
|
21565
21380
|
var ratio = Number(size.replace('vw', '')) / 100;
|
|
21566
21381
|
return innerWidth * ratio;
|
|
21567
21382
|
}
|
|
21568
|
-
if (endsWith(
|
|
21383
|
+
if (size.endsWith('vh')) {
|
|
21569
21384
|
var ratio = Number(size.replace('vh', '')) / 100;
|
|
21570
21385
|
return innerHeight * ratio;
|
|
21571
21386
|
}
|
|
21572
21387
|
}
|
|
21573
21388
|
return size;
|
|
21574
21389
|
};
|
|
21575
|
-
var calculateNewMax =
|
|
21390
|
+
var calculateNewMax = function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
|
|
21576
21391
|
maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
|
|
21577
21392
|
maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
|
|
21578
21393
|
minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
|
|
@@ -21583,7 +21398,7 @@ var calculateNewMax = memoize$1(function (parentSize, innerWidth, innerHeight, m
|
|
|
21583
21398
|
minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
|
|
21584
21399
|
minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),
|
|
21585
21400
|
};
|
|
21586
|
-
}
|
|
21401
|
+
};
|
|
21587
21402
|
var definedProps = [
|
|
21588
21403
|
'as',
|
|
21589
21404
|
'style',
|
|
@@ -21648,7 +21463,7 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
21648
21463
|
element.style.position = 'absolute';
|
|
21649
21464
|
element.style.transform = 'scale(0, 0)';
|
|
21650
21465
|
element.style.left = '0';
|
|
21651
|
-
element.style.flex = '0';
|
|
21466
|
+
element.style.flex = '0 0 100%';
|
|
21652
21467
|
if (element.classList) {
|
|
21653
21468
|
element.classList.add(baseClassName);
|
|
21654
21469
|
}
|
|
@@ -21767,8 +21582,8 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
21767
21582
|
if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
|
|
21768
21583
|
return 'auto';
|
|
21769
21584
|
}
|
|
21770
|
-
if (_this.propsSize && _this.propsSize[key] &&
|
|
21771
|
-
if (
|
|
21585
|
+
if (_this.propsSize && _this.propsSize[key] && _this.propsSize[key].toString().endsWith('%')) {
|
|
21586
|
+
if (_this.state[key].toString().endsWith('%')) {
|
|
21772
21587
|
return _this.state[key].toString();
|
|
21773
21588
|
}
|
|
21774
21589
|
var parentSize = _this.getParentSize();
|
|
@@ -21810,6 +21625,7 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
21810
21625
|
}
|
|
21811
21626
|
base.style.position = 'relative';
|
|
21812
21627
|
base.style.minWidth = '100%';
|
|
21628
|
+
base.style.minHeight = '100%';
|
|
21813
21629
|
var size = {
|
|
21814
21630
|
width: base.offsetWidth,
|
|
21815
21631
|
height: base.offsetHeight,
|
|
@@ -22000,12 +21816,6 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
22000
21816
|
if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {
|
|
22001
21817
|
clientX = event.nativeEvent.clientX;
|
|
22002
21818
|
clientY = event.nativeEvent.clientY;
|
|
22003
|
-
// When user click with right button the resize is stuck in resizing mode
|
|
22004
|
-
// until users clicks again, dont continue if right click is used.
|
|
22005
|
-
// HACK: MouseEvent does not have `which` from flow-bin v0.68.
|
|
22006
|
-
if (event.nativeEvent.which === 3) {
|
|
22007
|
-
return;
|
|
22008
|
-
}
|
|
22009
21819
|
}
|
|
22010
21820
|
else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {
|
|
22011
21821
|
clientX = event.nativeEvent.touches[0].clientX;
|
|
@@ -22059,6 +21869,7 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
22059
21869
|
this.setState(state);
|
|
22060
21870
|
};
|
|
22061
21871
|
Resizable.prototype.onMouseMove = function (event) {
|
|
21872
|
+
var _this = this;
|
|
22062
21873
|
if (!this.state.isResizing || !this.resizable || !this.window) {
|
|
22063
21874
|
return;
|
|
22064
21875
|
}
|
|
@@ -22085,6 +21896,12 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
22085
21896
|
var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;
|
|
22086
21897
|
// Calculate max size from boundary settings
|
|
22087
21898
|
var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);
|
|
21899
|
+
if (this.props.snap && this.props.snap.x) {
|
|
21900
|
+
newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
|
|
21901
|
+
}
|
|
21902
|
+
if (this.props.snap && this.props.snap.y) {
|
|
21903
|
+
newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
|
|
21904
|
+
}
|
|
22088
21905
|
// Calculate new size from aspect ratio
|
|
22089
21906
|
var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });
|
|
22090
21907
|
newWidth = newSize.newWidth;
|
|
@@ -22096,40 +21913,34 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
22096
21913
|
newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
|
|
22097
21914
|
newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
|
|
22098
21915
|
}
|
|
22099
|
-
if (this.props.snap && this.props.snap.x) {
|
|
22100
|
-
newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
|
|
22101
|
-
}
|
|
22102
|
-
if (this.props.snap && this.props.snap.y) {
|
|
22103
|
-
newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
|
|
22104
|
-
}
|
|
22105
21916
|
var delta = {
|
|
22106
21917
|
width: newWidth - original.width,
|
|
22107
21918
|
height: newHeight - original.height,
|
|
22108
21919
|
};
|
|
22109
21920
|
if (width && typeof width === 'string') {
|
|
22110
|
-
if (endsWith(
|
|
21921
|
+
if (width.endsWith('%')) {
|
|
22111
21922
|
var percent = (newWidth / parentSize.width) * 100;
|
|
22112
21923
|
newWidth = percent + "%";
|
|
22113
21924
|
}
|
|
22114
|
-
else if (endsWith(
|
|
21925
|
+
else if (width.endsWith('vw')) {
|
|
22115
21926
|
var vw = (newWidth / this.window.innerWidth) * 100;
|
|
22116
21927
|
newWidth = vw + "vw";
|
|
22117
21928
|
}
|
|
22118
|
-
else if (endsWith(
|
|
21929
|
+
else if (width.endsWith('vh')) {
|
|
22119
21930
|
var vh = (newWidth / this.window.innerHeight) * 100;
|
|
22120
21931
|
newWidth = vh + "vh";
|
|
22121
21932
|
}
|
|
22122
21933
|
}
|
|
22123
21934
|
if (height && typeof height === 'string') {
|
|
22124
|
-
if (endsWith(
|
|
21935
|
+
if (height.endsWith('%')) {
|
|
22125
21936
|
var percent = (newHeight / parentSize.height) * 100;
|
|
22126
21937
|
newHeight = percent + "%";
|
|
22127
21938
|
}
|
|
22128
|
-
else if (endsWith(
|
|
21939
|
+
else if (height.endsWith('vw')) {
|
|
22129
21940
|
var vw = (newHeight / this.window.innerWidth) * 100;
|
|
22130
21941
|
newHeight = vw + "vw";
|
|
22131
21942
|
}
|
|
22132
|
-
else if (endsWith(
|
|
21943
|
+
else if (height.endsWith('vh')) {
|
|
22133
21944
|
var vh = (newHeight / this.window.innerHeight) * 100;
|
|
22134
21945
|
newHeight = vh + "vh";
|
|
22135
21946
|
}
|
|
@@ -22144,7 +21955,10 @@ var Resizable = /** @class */ (function (_super) {
|
|
|
22144
21955
|
else if (this.flexDir === 'column') {
|
|
22145
21956
|
newState.flexBasis = newState.height;
|
|
22146
21957
|
}
|
|
22147
|
-
|
|
21958
|
+
// For v18, update state sync
|
|
21959
|
+
flushSync(function () {
|
|
21960
|
+
_this.setState(newState);
|
|
21961
|
+
});
|
|
22148
21962
|
if (this.props.onResize) {
|
|
22149
21963
|
this.props.onResize(event, direction, this.resizable, delta);
|
|
22150
21964
|
}
|
|
@@ -25445,6 +25259,14 @@ var getOffsetStr = function getOffsetStr(input) {
|
|
|
25445
25259
|
var groups = input.match(isoDatePattern);
|
|
25446
25260
|
return groups ? groups[4] : null;
|
|
25447
25261
|
};
|
|
25262
|
+
/**
|
|
25263
|
+
* Check if a date object is valid
|
|
25264
|
+
* @param {Date} date - date to be checked
|
|
25265
|
+
* @returns {boolean} - True if valid
|
|
25266
|
+
*/
|
|
25267
|
+
var isValid = function isValid(input) {
|
|
25268
|
+
return isValid$1(input);
|
|
25269
|
+
};
|
|
25448
25270
|
|
|
25449
25271
|
/* *
|
|
25450
25272
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -25477,7 +25299,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
25477
25299
|
differenceInHours: differenceInHours,
|
|
25478
25300
|
isBefore: isBefore,
|
|
25479
25301
|
isAfter: isAfter,
|
|
25480
|
-
utc: utc
|
|
25302
|
+
utc: utc,
|
|
25303
|
+
isValid: isValid
|
|
25481
25304
|
});
|
|
25482
25305
|
|
|
25483
25306
|
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, ResizeComponent as Resizable, SearchHighlight, StatusTag, ToggleMenu, 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, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.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": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"dependencies": {},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@mui/material": "5.12.0",
|
|
17
|
-
"@opengeoweb/theme": "
|
|
17
|
+
"@opengeoweb/theme": "5.0.0",
|
|
18
18
|
"@redux-eggs/core": "2.2.0",
|
|
19
|
-
"axios": "
|
|
19
|
+
"axios": "1.4.0",
|
|
20
20
|
"date-fns": "2.29.3",
|
|
21
21
|
"lodash": "4.17.21",
|
|
22
|
-
"re-resizable": "6.9.
|
|
22
|
+
"re-resizable": "6.9.9",
|
|
23
23
|
"react": "18.2.0",
|
|
24
24
|
"react-draggable": "4.4.5",
|
|
25
25
|
"react-redux": "8.0.4"
|
|
@@ -18,7 +18,7 @@ export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, E
|
|
|
18
18
|
static defaultProps: {
|
|
19
19
|
onError: () => void;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
constructor(props: ErrorBoundaryProps);
|
|
22
22
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
23
23
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
24
24
|
render(): React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosError } from 'axios';
|
|
2
2
|
export declare const DEFAULT_ERROR_MESSAGE = "An error has occurred";
|
|
3
|
-
export declare const isAxiosError: (error: AxiosError | Error) => error is AxiosError<
|
|
3
|
+
export declare const isAxiosError: (error: AxiosError | Error) => error is AxiosError<unknown, any>;
|
|
4
4
|
export declare const getAxiosErrorMessage: (error: AxiosError) => string;
|
|
5
5
|
export declare const getErrorMessage: (error: Error | AxiosError) => string;
|
|
6
6
|
export declare const getAxiosWarningMessage: (error: AxiosError) => string;
|
|
@@ -183,3 +183,9 @@ export declare const isAfter: (date: Date | number, dateToCompare: Date | number
|
|
|
183
183
|
* @returns {Date} - Date in UTC
|
|
184
184
|
*/
|
|
185
185
|
export declare const utc: (dateStr?: string | undefined) => Date;
|
|
186
|
+
/**
|
|
187
|
+
* Check if a date object is valid
|
|
188
|
+
* @param {Date} date - date to be checked
|
|
189
|
+
* @returns {boolean} - True if valid
|
|
190
|
+
*/
|
|
191
|
+
export declare const isValid: (input: Date) => boolean;
|