@opengeoweb/warnings 8.3.1 → 8.4.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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useContext, useRef, useCallback, useDebugValue,
|
|
2
|
+
import React__default, { useContext, useRef, useCallback, useDebugValue, createElement, PureComponent, useState, useEffect } from 'react';
|
|
3
3
|
import 'react-dom';
|
|
4
4
|
import { Polygons, Share, ExitDomain, Edit, Delete, DrawPolygon, Visibility, Add, breakpoints, CoastalEvent, Fog, TemperatureHigh, TemperatureLow, Rain, Snow, Lightning, Wind } from '@opengeoweb/theme';
|
|
5
5
|
import { uiActions, uiTypes, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, snackbarActions } from '@opengeoweb/store';
|
|
6
6
|
import { emptyGeoJSON, MapControlButton, getGeoJSONPropertyValue, getIcon, currentlySupportedDrawModes } from '@opengeoweb/webmap-react';
|
|
7
7
|
import { useSetupDialog } from '@opengeoweb/core';
|
|
8
|
-
import { dateUtils, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, CustomIconButton, SwitchButton, isAxiosError } from '@opengeoweb/shared';
|
|
9
|
-
import {
|
|
8
|
+
import { dateUtils, ToggleMenu, getHeight, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, CustomIconButton, SwitchButton, isAxiosError } from '@opengeoweb/shared';
|
|
9
|
+
import { Box, Typography, ListItem, Paper, ListItemButton, Stack, LinearProgress, Button, Grid, FormHelperText, MenuItem, Tabs, Tab, FormControl, Card, CardContent, styled, ListItemIcon, FormControlLabel, Radio } from '@mui/material';
|
|
10
10
|
import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
11
11
|
import { ReactHookFormProvider, defaultFormOptions, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormSelect, ReactHookFormTextField, ReactHookFormDateTime, ReactHookFormRadioGroup } from '@opengeoweb/form-fields';
|
|
12
12
|
|
|
@@ -663,6 +663,21 @@ function createSelectorHook(context = ReactReduxContext) {
|
|
|
663
663
|
|
|
664
664
|
const useSelector = /*#__PURE__*/createSelectorHook();
|
|
665
665
|
|
|
666
|
+
function _extends() {
|
|
667
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
668
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
669
|
+
var source = arguments[i];
|
|
670
|
+
for (var key in source) {
|
|
671
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
672
|
+
target[key] = source[key];
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return target;
|
|
677
|
+
};
|
|
678
|
+
return _extends.apply(this, arguments);
|
|
679
|
+
}
|
|
680
|
+
|
|
666
681
|
var reactIs$1 = {exports: {}};
|
|
667
682
|
|
|
668
683
|
var reactIs_production_min$1 = {};
|
|
@@ -3241,6 +3256,913 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
3241
3256
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3242
3257
|
};
|
|
3243
3258
|
|
|
3259
|
+
function _assertThisInitialized(self) {
|
|
3260
|
+
if (self === void 0) {
|
|
3261
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3262
|
+
}
|
|
3263
|
+
return self;
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
function _setPrototypeOf(o, p) {
|
|
3267
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
3268
|
+
o.__proto__ = p;
|
|
3269
|
+
return o;
|
|
3270
|
+
};
|
|
3271
|
+
return _setPrototypeOf(o, p);
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
function _inheritsLoose(subClass, superClass) {
|
|
3275
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
3276
|
+
subClass.prototype.constructor = subClass;
|
|
3277
|
+
_setPrototypeOf(subClass, superClass);
|
|
3278
|
+
}
|
|
3279
|
+
|
|
3280
|
+
var safeIsNaN = Number.isNaN ||
|
|
3281
|
+
function ponyfill(value) {
|
|
3282
|
+
return typeof value === 'number' && value !== value;
|
|
3283
|
+
};
|
|
3284
|
+
function isEqual(first, second) {
|
|
3285
|
+
if (first === second) {
|
|
3286
|
+
return true;
|
|
3287
|
+
}
|
|
3288
|
+
if (safeIsNaN(first) && safeIsNaN(second)) {
|
|
3289
|
+
return true;
|
|
3290
|
+
}
|
|
3291
|
+
return false;
|
|
3292
|
+
}
|
|
3293
|
+
function areInputsEqual(newInputs, lastInputs) {
|
|
3294
|
+
if (newInputs.length !== lastInputs.length) {
|
|
3295
|
+
return false;
|
|
3296
|
+
}
|
|
3297
|
+
for (var i = 0; i < newInputs.length; i++) {
|
|
3298
|
+
if (!isEqual(newInputs[i], lastInputs[i])) {
|
|
3299
|
+
return false;
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
return true;
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
function memoizeOne(resultFn, isEqual) {
|
|
3306
|
+
if (isEqual === void 0) { isEqual = areInputsEqual; }
|
|
3307
|
+
var lastThis;
|
|
3308
|
+
var lastArgs = [];
|
|
3309
|
+
var lastResult;
|
|
3310
|
+
var calledOnce = false;
|
|
3311
|
+
function memoized() {
|
|
3312
|
+
var newArgs = [];
|
|
3313
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3314
|
+
newArgs[_i] = arguments[_i];
|
|
3315
|
+
}
|
|
3316
|
+
if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
|
|
3317
|
+
return lastResult;
|
|
3318
|
+
}
|
|
3319
|
+
lastResult = resultFn.apply(this, newArgs);
|
|
3320
|
+
calledOnce = true;
|
|
3321
|
+
lastThis = this;
|
|
3322
|
+
lastArgs = newArgs;
|
|
3323
|
+
return lastResult;
|
|
3324
|
+
}
|
|
3325
|
+
return memoized;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
// Animation frame based implementation of setTimeout.
|
|
3329
|
+
// Inspired by Joe Lambert, https://gist.github.com/joelambert/1002116#file-requesttimeout-js
|
|
3330
|
+
var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
|
|
3331
|
+
var now = hasNativePerformanceNow ? function () {
|
|
3332
|
+
return performance.now();
|
|
3333
|
+
} : function () {
|
|
3334
|
+
return Date.now();
|
|
3335
|
+
};
|
|
3336
|
+
function cancelTimeout(timeoutID) {
|
|
3337
|
+
cancelAnimationFrame(timeoutID.id);
|
|
3338
|
+
}
|
|
3339
|
+
function requestTimeout(callback, delay) {
|
|
3340
|
+
var start = now();
|
|
3341
|
+
|
|
3342
|
+
function tick() {
|
|
3343
|
+
if (now() - start >= delay) {
|
|
3344
|
+
callback.call(null);
|
|
3345
|
+
} else {
|
|
3346
|
+
timeoutID.id = requestAnimationFrame(tick);
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
var timeoutID = {
|
|
3351
|
+
id: requestAnimationFrame(tick)
|
|
3352
|
+
};
|
|
3353
|
+
return timeoutID;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
var size = -1; // This utility copied from "dom-helpers" package.
|
|
3357
|
+
|
|
3358
|
+
function getScrollbarSize(recalculate) {
|
|
3359
|
+
if (recalculate === void 0) {
|
|
3360
|
+
recalculate = false;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
if (size === -1 || recalculate) {
|
|
3364
|
+
var div = document.createElement('div');
|
|
3365
|
+
var style = div.style;
|
|
3366
|
+
style.width = '50px';
|
|
3367
|
+
style.height = '50px';
|
|
3368
|
+
style.overflow = 'scroll';
|
|
3369
|
+
document.body.appendChild(div);
|
|
3370
|
+
size = div.offsetWidth - div.clientWidth;
|
|
3371
|
+
document.body.removeChild(div);
|
|
3372
|
+
}
|
|
3373
|
+
|
|
3374
|
+
return size;
|
|
3375
|
+
}
|
|
3376
|
+
var cachedRTLResult = null; // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
3377
|
+
// Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).
|
|
3378
|
+
// Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.
|
|
3379
|
+
// The safest way to check this is to intentionally set a negative offset,
|
|
3380
|
+
// and then verify that the subsequent "scroll" event matches the negative offset.
|
|
3381
|
+
// If it does not match, then we can assume a non-standard RTL scroll implementation.
|
|
3382
|
+
|
|
3383
|
+
function getRTLOffsetType(recalculate) {
|
|
3384
|
+
if (recalculate === void 0) {
|
|
3385
|
+
recalculate = false;
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
if (cachedRTLResult === null || recalculate) {
|
|
3389
|
+
var outerDiv = document.createElement('div');
|
|
3390
|
+
var outerStyle = outerDiv.style;
|
|
3391
|
+
outerStyle.width = '50px';
|
|
3392
|
+
outerStyle.height = '50px';
|
|
3393
|
+
outerStyle.overflow = 'scroll';
|
|
3394
|
+
outerStyle.direction = 'rtl';
|
|
3395
|
+
var innerDiv = document.createElement('div');
|
|
3396
|
+
var innerStyle = innerDiv.style;
|
|
3397
|
+
innerStyle.width = '100px';
|
|
3398
|
+
innerStyle.height = '100px';
|
|
3399
|
+
outerDiv.appendChild(innerDiv);
|
|
3400
|
+
document.body.appendChild(outerDiv);
|
|
3401
|
+
|
|
3402
|
+
if (outerDiv.scrollLeft > 0) {
|
|
3403
|
+
cachedRTLResult = 'positive-descending';
|
|
3404
|
+
} else {
|
|
3405
|
+
outerDiv.scrollLeft = 1;
|
|
3406
|
+
|
|
3407
|
+
if (outerDiv.scrollLeft === 0) {
|
|
3408
|
+
cachedRTLResult = 'negative';
|
|
3409
|
+
} else {
|
|
3410
|
+
cachedRTLResult = 'positive-ascending';
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
document.body.removeChild(outerDiv);
|
|
3415
|
+
return cachedRTLResult;
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
return cachedRTLResult;
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
if (process.env.NODE_ENV !== 'production') ;
|
|
3422
|
+
|
|
3423
|
+
var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150;
|
|
3424
|
+
|
|
3425
|
+
var defaultItemKey$1 = function defaultItemKey(index, data) {
|
|
3426
|
+
return index;
|
|
3427
|
+
}; // In DEV mode, this Set helps us only log a warning once per component instance.
|
|
3428
|
+
// This avoids spamming the console every time a render happens.
|
|
3429
|
+
|
|
3430
|
+
|
|
3431
|
+
var devWarningsDirection = null;
|
|
3432
|
+
var devWarningsTagName$1 = null;
|
|
3433
|
+
|
|
3434
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3435
|
+
if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
|
|
3436
|
+
devWarningsDirection = /*#__PURE__*/new WeakSet();
|
|
3437
|
+
devWarningsTagName$1 = /*#__PURE__*/new WeakSet();
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3441
|
+
function createListComponent(_ref) {
|
|
3442
|
+
var _class;
|
|
3443
|
+
|
|
3444
|
+
var getItemOffset = _ref.getItemOffset,
|
|
3445
|
+
getEstimatedTotalSize = _ref.getEstimatedTotalSize,
|
|
3446
|
+
getItemSize = _ref.getItemSize,
|
|
3447
|
+
getOffsetForIndexAndAlignment = _ref.getOffsetForIndexAndAlignment,
|
|
3448
|
+
getStartIndexForOffset = _ref.getStartIndexForOffset,
|
|
3449
|
+
getStopIndexForStartIndex = _ref.getStopIndexForStartIndex,
|
|
3450
|
+
initInstanceProps = _ref.initInstanceProps,
|
|
3451
|
+
shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange,
|
|
3452
|
+
validateProps = _ref.validateProps;
|
|
3453
|
+
return _class = /*#__PURE__*/function (_PureComponent) {
|
|
3454
|
+
_inheritsLoose(List, _PureComponent);
|
|
3455
|
+
|
|
3456
|
+
// Always use explicit constructor for React components.
|
|
3457
|
+
// It produces less code after transpilation. (#26)
|
|
3458
|
+
// eslint-disable-next-line no-useless-constructor
|
|
3459
|
+
function List(props) {
|
|
3460
|
+
var _this;
|
|
3461
|
+
|
|
3462
|
+
_this = _PureComponent.call(this, props) || this;
|
|
3463
|
+
_this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_this));
|
|
3464
|
+
_this._outerRef = void 0;
|
|
3465
|
+
_this._resetIsScrollingTimeoutId = null;
|
|
3466
|
+
_this.state = {
|
|
3467
|
+
instance: _assertThisInitialized(_this),
|
|
3468
|
+
isScrolling: false,
|
|
3469
|
+
scrollDirection: 'forward',
|
|
3470
|
+
scrollOffset: typeof _this.props.initialScrollOffset === 'number' ? _this.props.initialScrollOffset : 0,
|
|
3471
|
+
scrollUpdateWasRequested: false
|
|
3472
|
+
};
|
|
3473
|
+
_this._callOnItemsRendered = void 0;
|
|
3474
|
+
_this._callOnItemsRendered = memoizeOne(function (overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
|
|
3475
|
+
return _this.props.onItemsRendered({
|
|
3476
|
+
overscanStartIndex: overscanStartIndex,
|
|
3477
|
+
overscanStopIndex: overscanStopIndex,
|
|
3478
|
+
visibleStartIndex: visibleStartIndex,
|
|
3479
|
+
visibleStopIndex: visibleStopIndex
|
|
3480
|
+
});
|
|
3481
|
+
});
|
|
3482
|
+
_this._callOnScroll = void 0;
|
|
3483
|
+
_this._callOnScroll = memoizeOne(function (scrollDirection, scrollOffset, scrollUpdateWasRequested) {
|
|
3484
|
+
return _this.props.onScroll({
|
|
3485
|
+
scrollDirection: scrollDirection,
|
|
3486
|
+
scrollOffset: scrollOffset,
|
|
3487
|
+
scrollUpdateWasRequested: scrollUpdateWasRequested
|
|
3488
|
+
});
|
|
3489
|
+
});
|
|
3490
|
+
_this._getItemStyle = void 0;
|
|
3491
|
+
|
|
3492
|
+
_this._getItemStyle = function (index) {
|
|
3493
|
+
var _this$props = _this.props,
|
|
3494
|
+
direction = _this$props.direction,
|
|
3495
|
+
itemSize = _this$props.itemSize,
|
|
3496
|
+
layout = _this$props.layout;
|
|
3497
|
+
|
|
3498
|
+
var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);
|
|
3499
|
+
|
|
3500
|
+
var style;
|
|
3501
|
+
|
|
3502
|
+
if (itemStyleCache.hasOwnProperty(index)) {
|
|
3503
|
+
style = itemStyleCache[index];
|
|
3504
|
+
} else {
|
|
3505
|
+
var _offset = getItemOffset(_this.props, index, _this._instanceProps);
|
|
3506
|
+
|
|
3507
|
+
var size = getItemSize(_this.props, index, _this._instanceProps); // TODO Deprecate direction "horizontal"
|
|
3508
|
+
|
|
3509
|
+
var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
|
|
3510
|
+
var isRtl = direction === 'rtl';
|
|
3511
|
+
var offsetHorizontal = isHorizontal ? _offset : 0;
|
|
3512
|
+
itemStyleCache[index] = style = {
|
|
3513
|
+
position: 'absolute',
|
|
3514
|
+
left: isRtl ? undefined : offsetHorizontal,
|
|
3515
|
+
right: isRtl ? offsetHorizontal : undefined,
|
|
3516
|
+
top: !isHorizontal ? _offset : 0,
|
|
3517
|
+
height: !isHorizontal ? size : '100%',
|
|
3518
|
+
width: isHorizontal ? size : '100%'
|
|
3519
|
+
};
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
return style;
|
|
3523
|
+
};
|
|
3524
|
+
|
|
3525
|
+
_this._getItemStyleCache = void 0;
|
|
3526
|
+
_this._getItemStyleCache = memoizeOne(function (_, __, ___) {
|
|
3527
|
+
return {};
|
|
3528
|
+
});
|
|
3529
|
+
|
|
3530
|
+
_this._onScrollHorizontal = function (event) {
|
|
3531
|
+
var _event$currentTarget = event.currentTarget,
|
|
3532
|
+
clientWidth = _event$currentTarget.clientWidth,
|
|
3533
|
+
scrollLeft = _event$currentTarget.scrollLeft,
|
|
3534
|
+
scrollWidth = _event$currentTarget.scrollWidth;
|
|
3535
|
+
|
|
3536
|
+
_this.setState(function (prevState) {
|
|
3537
|
+
if (prevState.scrollOffset === scrollLeft) {
|
|
3538
|
+
// Scroll position may have been updated by cDM/cDU,
|
|
3539
|
+
// In which case we don't need to trigger another render,
|
|
3540
|
+
// And we don't want to update state.isScrolling.
|
|
3541
|
+
return null;
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
var direction = _this.props.direction;
|
|
3545
|
+
var scrollOffset = scrollLeft;
|
|
3546
|
+
|
|
3547
|
+
if (direction === 'rtl') {
|
|
3548
|
+
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
3549
|
+
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
|
|
3550
|
+
// It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
|
|
3551
|
+
// So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
|
|
3552
|
+
switch (getRTLOffsetType()) {
|
|
3553
|
+
case 'negative':
|
|
3554
|
+
scrollOffset = -scrollLeft;
|
|
3555
|
+
break;
|
|
3556
|
+
|
|
3557
|
+
case 'positive-descending':
|
|
3558
|
+
scrollOffset = scrollWidth - clientWidth - scrollLeft;
|
|
3559
|
+
break;
|
|
3560
|
+
}
|
|
3561
|
+
} // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
|
|
3562
|
+
|
|
3563
|
+
|
|
3564
|
+
scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
|
|
3565
|
+
return {
|
|
3566
|
+
isScrolling: true,
|
|
3567
|
+
scrollDirection: prevState.scrollOffset < scrollLeft ? 'forward' : 'backward',
|
|
3568
|
+
scrollOffset: scrollOffset,
|
|
3569
|
+
scrollUpdateWasRequested: false
|
|
3570
|
+
};
|
|
3571
|
+
}, _this._resetIsScrollingDebounced);
|
|
3572
|
+
};
|
|
3573
|
+
|
|
3574
|
+
_this._onScrollVertical = function (event) {
|
|
3575
|
+
var _event$currentTarget2 = event.currentTarget,
|
|
3576
|
+
clientHeight = _event$currentTarget2.clientHeight,
|
|
3577
|
+
scrollHeight = _event$currentTarget2.scrollHeight,
|
|
3578
|
+
scrollTop = _event$currentTarget2.scrollTop;
|
|
3579
|
+
|
|
3580
|
+
_this.setState(function (prevState) {
|
|
3581
|
+
if (prevState.scrollOffset === scrollTop) {
|
|
3582
|
+
// Scroll position may have been updated by cDM/cDU,
|
|
3583
|
+
// In which case we don't need to trigger another render,
|
|
3584
|
+
// And we don't want to update state.isScrolling.
|
|
3585
|
+
return null;
|
|
3586
|
+
} // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
|
|
3587
|
+
|
|
3588
|
+
|
|
3589
|
+
var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
|
|
3590
|
+
return {
|
|
3591
|
+
isScrolling: true,
|
|
3592
|
+
scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
|
|
3593
|
+
scrollOffset: scrollOffset,
|
|
3594
|
+
scrollUpdateWasRequested: false
|
|
3595
|
+
};
|
|
3596
|
+
}, _this._resetIsScrollingDebounced);
|
|
3597
|
+
};
|
|
3598
|
+
|
|
3599
|
+
_this._outerRefSetter = function (ref) {
|
|
3600
|
+
var outerRef = _this.props.outerRef;
|
|
3601
|
+
_this._outerRef = ref;
|
|
3602
|
+
|
|
3603
|
+
if (typeof outerRef === 'function') {
|
|
3604
|
+
outerRef(ref);
|
|
3605
|
+
} else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {
|
|
3606
|
+
outerRef.current = ref;
|
|
3607
|
+
}
|
|
3608
|
+
};
|
|
3609
|
+
|
|
3610
|
+
_this._resetIsScrollingDebounced = function () {
|
|
3611
|
+
if (_this._resetIsScrollingTimeoutId !== null) {
|
|
3612
|
+
cancelTimeout(_this._resetIsScrollingTimeoutId);
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3615
|
+
_this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);
|
|
3616
|
+
};
|
|
3617
|
+
|
|
3618
|
+
_this._resetIsScrolling = function () {
|
|
3619
|
+
_this._resetIsScrollingTimeoutId = null;
|
|
3620
|
+
|
|
3621
|
+
_this.setState({
|
|
3622
|
+
isScrolling: false
|
|
3623
|
+
}, function () {
|
|
3624
|
+
// Clear style cache after state update has been committed.
|
|
3625
|
+
// This way we don't break pure sCU for items that don't use isScrolling param.
|
|
3626
|
+
_this._getItemStyleCache(-1, null);
|
|
3627
|
+
});
|
|
3628
|
+
};
|
|
3629
|
+
|
|
3630
|
+
return _this;
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
List.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
|
3634
|
+
validateSharedProps$1(nextProps, prevState);
|
|
3635
|
+
validateProps(nextProps);
|
|
3636
|
+
return null;
|
|
3637
|
+
};
|
|
3638
|
+
|
|
3639
|
+
var _proto = List.prototype;
|
|
3640
|
+
|
|
3641
|
+
_proto.scrollTo = function scrollTo(scrollOffset) {
|
|
3642
|
+
scrollOffset = Math.max(0, scrollOffset);
|
|
3643
|
+
this.setState(function (prevState) {
|
|
3644
|
+
if (prevState.scrollOffset === scrollOffset) {
|
|
3645
|
+
return null;
|
|
3646
|
+
}
|
|
3647
|
+
|
|
3648
|
+
return {
|
|
3649
|
+
scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
|
|
3650
|
+
scrollOffset: scrollOffset,
|
|
3651
|
+
scrollUpdateWasRequested: true
|
|
3652
|
+
};
|
|
3653
|
+
}, this._resetIsScrollingDebounced);
|
|
3654
|
+
};
|
|
3655
|
+
|
|
3656
|
+
_proto.scrollToItem = function scrollToItem(index, align) {
|
|
3657
|
+
if (align === void 0) {
|
|
3658
|
+
align = 'auto';
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
var _this$props2 = this.props,
|
|
3662
|
+
itemCount = _this$props2.itemCount,
|
|
3663
|
+
layout = _this$props2.layout;
|
|
3664
|
+
var scrollOffset = this.state.scrollOffset;
|
|
3665
|
+
index = Math.max(0, Math.min(index, itemCount - 1)); // The scrollbar size should be considered when scrolling an item into view, to ensure it's fully visible.
|
|
3666
|
+
// But we only need to account for its size when it's actually visible.
|
|
3667
|
+
// This is an edge case for lists; normally they only scroll in the dominant direction.
|
|
3668
|
+
|
|
3669
|
+
var scrollbarSize = 0;
|
|
3670
|
+
|
|
3671
|
+
if (this._outerRef) {
|
|
3672
|
+
var outerRef = this._outerRef;
|
|
3673
|
+
|
|
3674
|
+
if (layout === 'vertical') {
|
|
3675
|
+
scrollbarSize = outerRef.scrollWidth > outerRef.clientWidth ? getScrollbarSize() : 0;
|
|
3676
|
+
} else {
|
|
3677
|
+
scrollbarSize = outerRef.scrollHeight > outerRef.clientHeight ? getScrollbarSize() : 0;
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
this.scrollTo(getOffsetForIndexAndAlignment(this.props, index, align, scrollOffset, this._instanceProps, scrollbarSize));
|
|
3682
|
+
};
|
|
3683
|
+
|
|
3684
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
3685
|
+
var _this$props3 = this.props,
|
|
3686
|
+
direction = _this$props3.direction,
|
|
3687
|
+
initialScrollOffset = _this$props3.initialScrollOffset,
|
|
3688
|
+
layout = _this$props3.layout;
|
|
3689
|
+
|
|
3690
|
+
if (typeof initialScrollOffset === 'number' && this._outerRef != null) {
|
|
3691
|
+
var outerRef = this._outerRef; // TODO Deprecate direction "horizontal"
|
|
3692
|
+
|
|
3693
|
+
if (direction === 'horizontal' || layout === 'horizontal') {
|
|
3694
|
+
outerRef.scrollLeft = initialScrollOffset;
|
|
3695
|
+
} else {
|
|
3696
|
+
outerRef.scrollTop = initialScrollOffset;
|
|
3697
|
+
}
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3700
|
+
this._callPropsCallbacks();
|
|
3701
|
+
};
|
|
3702
|
+
|
|
3703
|
+
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
3704
|
+
var _this$props4 = this.props,
|
|
3705
|
+
direction = _this$props4.direction,
|
|
3706
|
+
layout = _this$props4.layout;
|
|
3707
|
+
var _this$state = this.state,
|
|
3708
|
+
scrollOffset = _this$state.scrollOffset,
|
|
3709
|
+
scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;
|
|
3710
|
+
|
|
3711
|
+
if (scrollUpdateWasRequested && this._outerRef != null) {
|
|
3712
|
+
var outerRef = this._outerRef; // TODO Deprecate direction "horizontal"
|
|
3713
|
+
|
|
3714
|
+
if (direction === 'horizontal' || layout === 'horizontal') {
|
|
3715
|
+
if (direction === 'rtl') {
|
|
3716
|
+
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
3717
|
+
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
|
|
3718
|
+
// So we need to determine which browser behavior we're dealing with, and mimic it.
|
|
3719
|
+
switch (getRTLOffsetType()) {
|
|
3720
|
+
case 'negative':
|
|
3721
|
+
outerRef.scrollLeft = -scrollOffset;
|
|
3722
|
+
break;
|
|
3723
|
+
|
|
3724
|
+
case 'positive-ascending':
|
|
3725
|
+
outerRef.scrollLeft = scrollOffset;
|
|
3726
|
+
break;
|
|
3727
|
+
|
|
3728
|
+
default:
|
|
3729
|
+
var clientWidth = outerRef.clientWidth,
|
|
3730
|
+
scrollWidth = outerRef.scrollWidth;
|
|
3731
|
+
outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;
|
|
3732
|
+
break;
|
|
3733
|
+
}
|
|
3734
|
+
} else {
|
|
3735
|
+
outerRef.scrollLeft = scrollOffset;
|
|
3736
|
+
}
|
|
3737
|
+
} else {
|
|
3738
|
+
outerRef.scrollTop = scrollOffset;
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
this._callPropsCallbacks();
|
|
3743
|
+
};
|
|
3744
|
+
|
|
3745
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
3746
|
+
if (this._resetIsScrollingTimeoutId !== null) {
|
|
3747
|
+
cancelTimeout(this._resetIsScrollingTimeoutId);
|
|
3748
|
+
}
|
|
3749
|
+
};
|
|
3750
|
+
|
|
3751
|
+
_proto.render = function render() {
|
|
3752
|
+
var _this$props5 = this.props,
|
|
3753
|
+
children = _this$props5.children,
|
|
3754
|
+
className = _this$props5.className,
|
|
3755
|
+
direction = _this$props5.direction,
|
|
3756
|
+
height = _this$props5.height,
|
|
3757
|
+
innerRef = _this$props5.innerRef,
|
|
3758
|
+
innerElementType = _this$props5.innerElementType,
|
|
3759
|
+
innerTagName = _this$props5.innerTagName,
|
|
3760
|
+
itemCount = _this$props5.itemCount,
|
|
3761
|
+
itemData = _this$props5.itemData,
|
|
3762
|
+
_this$props5$itemKey = _this$props5.itemKey,
|
|
3763
|
+
itemKey = _this$props5$itemKey === void 0 ? defaultItemKey$1 : _this$props5$itemKey,
|
|
3764
|
+
layout = _this$props5.layout,
|
|
3765
|
+
outerElementType = _this$props5.outerElementType,
|
|
3766
|
+
outerTagName = _this$props5.outerTagName,
|
|
3767
|
+
style = _this$props5.style,
|
|
3768
|
+
useIsScrolling = _this$props5.useIsScrolling,
|
|
3769
|
+
width = _this$props5.width;
|
|
3770
|
+
var isScrolling = this.state.isScrolling; // TODO Deprecate direction "horizontal"
|
|
3771
|
+
|
|
3772
|
+
var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
|
|
3773
|
+
var onScroll = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;
|
|
3774
|
+
|
|
3775
|
+
var _this$_getRangeToRend = this._getRangeToRender(),
|
|
3776
|
+
startIndex = _this$_getRangeToRend[0],
|
|
3777
|
+
stopIndex = _this$_getRangeToRend[1];
|
|
3778
|
+
|
|
3779
|
+
var items = [];
|
|
3780
|
+
|
|
3781
|
+
if (itemCount > 0) {
|
|
3782
|
+
for (var _index = startIndex; _index <= stopIndex; _index++) {
|
|
3783
|
+
items.push(createElement(children, {
|
|
3784
|
+
data: itemData,
|
|
3785
|
+
key: itemKey(_index, itemData),
|
|
3786
|
+
index: _index,
|
|
3787
|
+
isScrolling: useIsScrolling ? isScrolling : undefined,
|
|
3788
|
+
style: this._getItemStyle(_index)
|
|
3789
|
+
}));
|
|
3790
|
+
}
|
|
3791
|
+
} // Read this value AFTER items have been created,
|
|
3792
|
+
// So their actual sizes (if variable) are taken into consideration.
|
|
3793
|
+
|
|
3794
|
+
|
|
3795
|
+
var estimatedTotalSize = getEstimatedTotalSize(this.props, this._instanceProps);
|
|
3796
|
+
return createElement(outerElementType || outerTagName || 'div', {
|
|
3797
|
+
className: className,
|
|
3798
|
+
onScroll: onScroll,
|
|
3799
|
+
ref: this._outerRefSetter,
|
|
3800
|
+
style: _extends({
|
|
3801
|
+
position: 'relative',
|
|
3802
|
+
height: height,
|
|
3803
|
+
width: width,
|
|
3804
|
+
overflow: 'auto',
|
|
3805
|
+
WebkitOverflowScrolling: 'touch',
|
|
3806
|
+
willChange: 'transform',
|
|
3807
|
+
direction: direction
|
|
3808
|
+
}, style)
|
|
3809
|
+
}, createElement(innerElementType || innerTagName || 'div', {
|
|
3810
|
+
children: items,
|
|
3811
|
+
ref: innerRef,
|
|
3812
|
+
style: {
|
|
3813
|
+
height: isHorizontal ? '100%' : estimatedTotalSize,
|
|
3814
|
+
pointerEvents: isScrolling ? 'none' : undefined,
|
|
3815
|
+
width: isHorizontal ? estimatedTotalSize : '100%'
|
|
3816
|
+
}
|
|
3817
|
+
}));
|
|
3818
|
+
};
|
|
3819
|
+
|
|
3820
|
+
_proto._callPropsCallbacks = function _callPropsCallbacks() {
|
|
3821
|
+
if (typeof this.props.onItemsRendered === 'function') {
|
|
3822
|
+
var itemCount = this.props.itemCount;
|
|
3823
|
+
|
|
3824
|
+
if (itemCount > 0) {
|
|
3825
|
+
var _this$_getRangeToRend2 = this._getRangeToRender(),
|
|
3826
|
+
_overscanStartIndex = _this$_getRangeToRend2[0],
|
|
3827
|
+
_overscanStopIndex = _this$_getRangeToRend2[1],
|
|
3828
|
+
_visibleStartIndex = _this$_getRangeToRend2[2],
|
|
3829
|
+
_visibleStopIndex = _this$_getRangeToRend2[3];
|
|
3830
|
+
|
|
3831
|
+
this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3835
|
+
if (typeof this.props.onScroll === 'function') {
|
|
3836
|
+
var _this$state2 = this.state,
|
|
3837
|
+
_scrollDirection = _this$state2.scrollDirection,
|
|
3838
|
+
_scrollOffset = _this$state2.scrollOffset,
|
|
3839
|
+
_scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;
|
|
3840
|
+
|
|
3841
|
+
this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);
|
|
3842
|
+
}
|
|
3843
|
+
} // Lazily create and cache item styles while scrolling,
|
|
3844
|
+
// So that pure component sCU will prevent re-renders.
|
|
3845
|
+
// We maintain this cache, and pass a style prop rather than index,
|
|
3846
|
+
// So that List can clear cached styles and force item re-render if necessary.
|
|
3847
|
+
;
|
|
3848
|
+
|
|
3849
|
+
_proto._getRangeToRender = function _getRangeToRender() {
|
|
3850
|
+
var _this$props6 = this.props,
|
|
3851
|
+
itemCount = _this$props6.itemCount,
|
|
3852
|
+
overscanCount = _this$props6.overscanCount;
|
|
3853
|
+
var _this$state3 = this.state,
|
|
3854
|
+
isScrolling = _this$state3.isScrolling,
|
|
3855
|
+
scrollDirection = _this$state3.scrollDirection,
|
|
3856
|
+
scrollOffset = _this$state3.scrollOffset;
|
|
3857
|
+
|
|
3858
|
+
if (itemCount === 0) {
|
|
3859
|
+
return [0, 0, 0, 0];
|
|
3860
|
+
}
|
|
3861
|
+
|
|
3862
|
+
var startIndex = getStartIndexForOffset(this.props, scrollOffset, this._instanceProps);
|
|
3863
|
+
var stopIndex = getStopIndexForStartIndex(this.props, startIndex, scrollOffset, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.
|
|
3864
|
+
// If there isn't at least one extra item, tab loops back around.
|
|
3865
|
+
|
|
3866
|
+
var overscanBackward = !isScrolling || scrollDirection === 'backward' ? Math.max(1, overscanCount) : 1;
|
|
3867
|
+
var overscanForward = !isScrolling || scrollDirection === 'forward' ? Math.max(1, overscanCount) : 1;
|
|
3868
|
+
return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
|
|
3869
|
+
};
|
|
3870
|
+
|
|
3871
|
+
return List;
|
|
3872
|
+
}(PureComponent), _class.defaultProps = {
|
|
3873
|
+
direction: 'ltr',
|
|
3874
|
+
itemData: undefined,
|
|
3875
|
+
layout: 'vertical',
|
|
3876
|
+
overscanCount: 2,
|
|
3877
|
+
useIsScrolling: false
|
|
3878
|
+
}, _class;
|
|
3879
|
+
} // NOTE: I considered further wrapping individual items with a pure ListItem component.
|
|
3880
|
+
// This would avoid ever calling the render function for the same index more than once,
|
|
3881
|
+
// But it would also add the overhead of a lot of components/fibers.
|
|
3882
|
+
// I assume people already do this (render function returning a class component),
|
|
3883
|
+
// So my doing it would just unnecessarily double the wrappers.
|
|
3884
|
+
|
|
3885
|
+
var validateSharedProps$1 = function validateSharedProps(_ref2, _ref3) {
|
|
3886
|
+
var children = _ref2.children,
|
|
3887
|
+
direction = _ref2.direction,
|
|
3888
|
+
height = _ref2.height,
|
|
3889
|
+
layout = _ref2.layout,
|
|
3890
|
+
innerTagName = _ref2.innerTagName,
|
|
3891
|
+
outerTagName = _ref2.outerTagName,
|
|
3892
|
+
width = _ref2.width;
|
|
3893
|
+
var instance = _ref3.instance;
|
|
3894
|
+
|
|
3895
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3896
|
+
if (innerTagName != null || outerTagName != null) {
|
|
3897
|
+
if (devWarningsTagName$1 && !devWarningsTagName$1.has(instance)) {
|
|
3898
|
+
devWarningsTagName$1.add(instance);
|
|
3899
|
+
console.warn('The innerTagName and outerTagName props have been deprecated. ' + 'Please use the innerElementType and outerElementType props instead.');
|
|
3900
|
+
}
|
|
3901
|
+
} // TODO Deprecate direction "horizontal"
|
|
3902
|
+
|
|
3903
|
+
|
|
3904
|
+
var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
|
|
3905
|
+
|
|
3906
|
+
switch (direction) {
|
|
3907
|
+
case 'horizontal':
|
|
3908
|
+
case 'vertical':
|
|
3909
|
+
if (devWarningsDirection && !devWarningsDirection.has(instance)) {
|
|
3910
|
+
devWarningsDirection.add(instance);
|
|
3911
|
+
console.warn('The direction prop should be either "ltr" (default) or "rtl". ' + 'Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.');
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
break;
|
|
3915
|
+
|
|
3916
|
+
case 'ltr':
|
|
3917
|
+
case 'rtl':
|
|
3918
|
+
// Valid values
|
|
3919
|
+
break;
|
|
3920
|
+
|
|
3921
|
+
default:
|
|
3922
|
+
throw Error('An invalid "direction" prop has been specified. ' + 'Value should be either "ltr" or "rtl". ' + ("\"" + direction + "\" was specified."));
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
switch (layout) {
|
|
3926
|
+
case 'horizontal':
|
|
3927
|
+
case 'vertical':
|
|
3928
|
+
// Valid values
|
|
3929
|
+
break;
|
|
3930
|
+
|
|
3931
|
+
default:
|
|
3932
|
+
throw Error('An invalid "layout" prop has been specified. ' + 'Value should be either "horizontal" or "vertical". ' + ("\"" + layout + "\" was specified."));
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
if (children == null) {
|
|
3936
|
+
throw Error('An invalid "children" prop has been specified. ' + 'Value should be a React component. ' + ("\"" + (children === null ? 'null' : typeof children) + "\" was specified."));
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
if (isHorizontal && typeof width !== 'number') {
|
|
3940
|
+
throw Error('An invalid "width" prop has been specified. ' + 'Horizontal lists must specify a number for width. ' + ("\"" + (width === null ? 'null' : typeof width) + "\" was specified."));
|
|
3941
|
+
} else if (!isHorizontal && typeof height !== 'number') {
|
|
3942
|
+
throw Error('An invalid "height" prop has been specified. ' + 'Vertical lists must specify a number for height. ' + ("\"" + (height === null ? 'null' : typeof height) + "\" was specified."));
|
|
3943
|
+
}
|
|
3944
|
+
}
|
|
3945
|
+
};
|
|
3946
|
+
|
|
3947
|
+
var DEFAULT_ESTIMATED_ITEM_SIZE$1 = 50;
|
|
3948
|
+
|
|
3949
|
+
var getItemMetadata$1 = function getItemMetadata(props, index, instanceProps) {
|
|
3950
|
+
var _ref = props,
|
|
3951
|
+
itemSize = _ref.itemSize;
|
|
3952
|
+
var itemMetadataMap = instanceProps.itemMetadataMap,
|
|
3953
|
+
lastMeasuredIndex = instanceProps.lastMeasuredIndex;
|
|
3954
|
+
|
|
3955
|
+
if (index > lastMeasuredIndex) {
|
|
3956
|
+
var offset = 0;
|
|
3957
|
+
|
|
3958
|
+
if (lastMeasuredIndex >= 0) {
|
|
3959
|
+
var itemMetadata = itemMetadataMap[lastMeasuredIndex];
|
|
3960
|
+
offset = itemMetadata.offset + itemMetadata.size;
|
|
3961
|
+
}
|
|
3962
|
+
|
|
3963
|
+
for (var i = lastMeasuredIndex + 1; i <= index; i++) {
|
|
3964
|
+
var size = itemSize(i);
|
|
3965
|
+
itemMetadataMap[i] = {
|
|
3966
|
+
offset: offset,
|
|
3967
|
+
size: size
|
|
3968
|
+
};
|
|
3969
|
+
offset += size;
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3972
|
+
instanceProps.lastMeasuredIndex = index;
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
return itemMetadataMap[index];
|
|
3976
|
+
};
|
|
3977
|
+
|
|
3978
|
+
var findNearestItem$1 = function findNearestItem(props, instanceProps, offset) {
|
|
3979
|
+
var itemMetadataMap = instanceProps.itemMetadataMap,
|
|
3980
|
+
lastMeasuredIndex = instanceProps.lastMeasuredIndex;
|
|
3981
|
+
var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;
|
|
3982
|
+
|
|
3983
|
+
if (lastMeasuredItemOffset >= offset) {
|
|
3984
|
+
// If we've already measured items within this range just use a binary search as it's faster.
|
|
3985
|
+
return findNearestItemBinarySearch$1(props, instanceProps, lastMeasuredIndex, 0, offset);
|
|
3986
|
+
} else {
|
|
3987
|
+
// If we haven't yet measured this high, fallback to an exponential search with an inner binary search.
|
|
3988
|
+
// The exponential search avoids pre-computing sizes for the full set of items as a binary search would.
|
|
3989
|
+
// The overall complexity for this approach is O(log n).
|
|
3990
|
+
return findNearestItemExponentialSearch$1(props, instanceProps, Math.max(0, lastMeasuredIndex), offset);
|
|
3991
|
+
}
|
|
3992
|
+
};
|
|
3993
|
+
|
|
3994
|
+
var findNearestItemBinarySearch$1 = function findNearestItemBinarySearch(props, instanceProps, high, low, offset) {
|
|
3995
|
+
while (low <= high) {
|
|
3996
|
+
var middle = low + Math.floor((high - low) / 2);
|
|
3997
|
+
var currentOffset = getItemMetadata$1(props, middle, instanceProps).offset;
|
|
3998
|
+
|
|
3999
|
+
if (currentOffset === offset) {
|
|
4000
|
+
return middle;
|
|
4001
|
+
} else if (currentOffset < offset) {
|
|
4002
|
+
low = middle + 1;
|
|
4003
|
+
} else if (currentOffset > offset) {
|
|
4004
|
+
high = middle - 1;
|
|
4005
|
+
}
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
if (low > 0) {
|
|
4009
|
+
return low - 1;
|
|
4010
|
+
} else {
|
|
4011
|
+
return 0;
|
|
4012
|
+
}
|
|
4013
|
+
};
|
|
4014
|
+
|
|
4015
|
+
var findNearestItemExponentialSearch$1 = function findNearestItemExponentialSearch(props, instanceProps, index, offset) {
|
|
4016
|
+
var itemCount = props.itemCount;
|
|
4017
|
+
var interval = 1;
|
|
4018
|
+
|
|
4019
|
+
while (index < itemCount && getItemMetadata$1(props, index, instanceProps).offset < offset) {
|
|
4020
|
+
index += interval;
|
|
4021
|
+
interval *= 2;
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
return findNearestItemBinarySearch$1(props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset);
|
|
4025
|
+
};
|
|
4026
|
+
|
|
4027
|
+
var getEstimatedTotalSize = function getEstimatedTotalSize(_ref2, _ref3) {
|
|
4028
|
+
var itemCount = _ref2.itemCount;
|
|
4029
|
+
var itemMetadataMap = _ref3.itemMetadataMap,
|
|
4030
|
+
estimatedItemSize = _ref3.estimatedItemSize,
|
|
4031
|
+
lastMeasuredIndex = _ref3.lastMeasuredIndex;
|
|
4032
|
+
var totalSizeOfMeasuredItems = 0; // Edge case check for when the number of items decreases while a scroll is in progress.
|
|
4033
|
+
// https://github.com/bvaughn/react-window/pull/138
|
|
4034
|
+
|
|
4035
|
+
if (lastMeasuredIndex >= itemCount) {
|
|
4036
|
+
lastMeasuredIndex = itemCount - 1;
|
|
4037
|
+
}
|
|
4038
|
+
|
|
4039
|
+
if (lastMeasuredIndex >= 0) {
|
|
4040
|
+
var itemMetadata = itemMetadataMap[lastMeasuredIndex];
|
|
4041
|
+
totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size;
|
|
4042
|
+
}
|
|
4043
|
+
|
|
4044
|
+
var numUnmeasuredItems = itemCount - lastMeasuredIndex - 1;
|
|
4045
|
+
var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
|
|
4046
|
+
return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
|
|
4047
|
+
};
|
|
4048
|
+
|
|
4049
|
+
var VariableSizeList = /*#__PURE__*/createListComponent({
|
|
4050
|
+
getItemOffset: function getItemOffset(props, index, instanceProps) {
|
|
4051
|
+
return getItemMetadata$1(props, index, instanceProps).offset;
|
|
4052
|
+
},
|
|
4053
|
+
getItemSize: function getItemSize(props, index, instanceProps) {
|
|
4054
|
+
return instanceProps.itemMetadataMap[index].size;
|
|
4055
|
+
},
|
|
4056
|
+
getEstimatedTotalSize: getEstimatedTotalSize,
|
|
4057
|
+
getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
|
|
4058
|
+
var direction = props.direction,
|
|
4059
|
+
height = props.height,
|
|
4060
|
+
layout = props.layout,
|
|
4061
|
+
width = props.width; // TODO Deprecate direction "horizontal"
|
|
4062
|
+
|
|
4063
|
+
var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
|
|
4064
|
+
var size = isHorizontal ? width : height;
|
|
4065
|
+
var itemMetadata = getItemMetadata$1(props, index, instanceProps); // Get estimated total size after ItemMetadata is computed,
|
|
4066
|
+
// To ensure it reflects actual measurements instead of just estimates.
|
|
4067
|
+
|
|
4068
|
+
var estimatedTotalSize = getEstimatedTotalSize(props, instanceProps);
|
|
4069
|
+
var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, itemMetadata.offset));
|
|
4070
|
+
var minOffset = Math.max(0, itemMetadata.offset - size + itemMetadata.size + scrollbarSize);
|
|
4071
|
+
|
|
4072
|
+
if (align === 'smart') {
|
|
4073
|
+
if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
|
|
4074
|
+
align = 'auto';
|
|
4075
|
+
} else {
|
|
4076
|
+
align = 'center';
|
|
4077
|
+
}
|
|
4078
|
+
}
|
|
4079
|
+
|
|
4080
|
+
switch (align) {
|
|
4081
|
+
case 'start':
|
|
4082
|
+
return maxOffset;
|
|
4083
|
+
|
|
4084
|
+
case 'end':
|
|
4085
|
+
return minOffset;
|
|
4086
|
+
|
|
4087
|
+
case 'center':
|
|
4088
|
+
return Math.round(minOffset + (maxOffset - minOffset) / 2);
|
|
4089
|
+
|
|
4090
|
+
case 'auto':
|
|
4091
|
+
default:
|
|
4092
|
+
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
|
|
4093
|
+
return scrollOffset;
|
|
4094
|
+
} else if (scrollOffset < minOffset) {
|
|
4095
|
+
return minOffset;
|
|
4096
|
+
} else {
|
|
4097
|
+
return maxOffset;
|
|
4098
|
+
}
|
|
4099
|
+
|
|
4100
|
+
}
|
|
4101
|
+
},
|
|
4102
|
+
getStartIndexForOffset: function getStartIndexForOffset(props, offset, instanceProps) {
|
|
4103
|
+
return findNearestItem$1(props, instanceProps, offset);
|
|
4104
|
+
},
|
|
4105
|
+
getStopIndexForStartIndex: function getStopIndexForStartIndex(props, startIndex, scrollOffset, instanceProps) {
|
|
4106
|
+
var direction = props.direction,
|
|
4107
|
+
height = props.height,
|
|
4108
|
+
itemCount = props.itemCount,
|
|
4109
|
+
layout = props.layout,
|
|
4110
|
+
width = props.width; // TODO Deprecate direction "horizontal"
|
|
4111
|
+
|
|
4112
|
+
var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
|
|
4113
|
+
var size = isHorizontal ? width : height;
|
|
4114
|
+
var itemMetadata = getItemMetadata$1(props, startIndex, instanceProps);
|
|
4115
|
+
var maxOffset = scrollOffset + size;
|
|
4116
|
+
var offset = itemMetadata.offset + itemMetadata.size;
|
|
4117
|
+
var stopIndex = startIndex;
|
|
4118
|
+
|
|
4119
|
+
while (stopIndex < itemCount - 1 && offset < maxOffset) {
|
|
4120
|
+
stopIndex++;
|
|
4121
|
+
offset += getItemMetadata$1(props, stopIndex, instanceProps).size;
|
|
4122
|
+
}
|
|
4123
|
+
|
|
4124
|
+
return stopIndex;
|
|
4125
|
+
},
|
|
4126
|
+
initInstanceProps: function initInstanceProps(props, instance) {
|
|
4127
|
+
var _ref4 = props,
|
|
4128
|
+
estimatedItemSize = _ref4.estimatedItemSize;
|
|
4129
|
+
var instanceProps = {
|
|
4130
|
+
itemMetadataMap: {},
|
|
4131
|
+
estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE$1,
|
|
4132
|
+
lastMeasuredIndex: -1
|
|
4133
|
+
};
|
|
4134
|
+
|
|
4135
|
+
instance.resetAfterIndex = function (index, shouldForceUpdate) {
|
|
4136
|
+
if (shouldForceUpdate === void 0) {
|
|
4137
|
+
shouldForceUpdate = true;
|
|
4138
|
+
}
|
|
4139
|
+
|
|
4140
|
+
instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index - 1); // We could potentially optimize further by only evicting styles after this index,
|
|
4141
|
+
// But since styles are only cached while scrolling is in progress-
|
|
4142
|
+
// It seems an unnecessary optimization.
|
|
4143
|
+
// It's unlikely that resetAfterIndex() will be called while a user is scrolling.
|
|
4144
|
+
|
|
4145
|
+
instance._getItemStyleCache(-1);
|
|
4146
|
+
|
|
4147
|
+
if (shouldForceUpdate) {
|
|
4148
|
+
instance.forceUpdate();
|
|
4149
|
+
}
|
|
4150
|
+
};
|
|
4151
|
+
|
|
4152
|
+
return instanceProps;
|
|
4153
|
+
},
|
|
4154
|
+
shouldResetStyleCacheOnItemSizeChange: false,
|
|
4155
|
+
validateProps: function validateProps(_ref5) {
|
|
4156
|
+
var itemSize = _ref5.itemSize;
|
|
4157
|
+
|
|
4158
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4159
|
+
if (typeof itemSize !== 'function') {
|
|
4160
|
+
throw Error('An invalid "itemSize" prop has been specified. ' + 'Value should be a function. ' + ("\"" + (itemSize === null ? 'null' : typeof itemSize) + "\" was specified."));
|
|
4161
|
+
}
|
|
4162
|
+
}
|
|
4163
|
+
}
|
|
4164
|
+
});
|
|
4165
|
+
|
|
3244
4166
|
/* *
|
|
3245
4167
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3246
4168
|
* you may not use this file except in compliance with the License.
|
|
@@ -3259,23 +4181,54 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
3259
4181
|
* */
|
|
3260
4182
|
var DATE_FORMAT = 'dd/MM/yyyy HH:mm';
|
|
3261
4183
|
var DATE_FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
4184
|
+
var DATE_FORMAT_HEADER = 'EEEE, MMMM dd';
|
|
4185
|
+
|
|
4186
|
+
var DEFAULT_DIALOG_HEIGHT = 500;
|
|
4187
|
+
var DEFAULT_ADD_BUTTON_HEIGHT = 80;
|
|
4188
|
+
var DEFAULT_PADDING_TOP = 6;
|
|
4189
|
+
var OBJECT_ITEM_SIZE = 50;
|
|
4190
|
+
var HEADER_ITEM_SIZE = 23;
|
|
4191
|
+
var MIN_HEIGHT_SCROLLABLE_LIST = 90; // Slightly less than 2 rows
|
|
4192
|
+
var useGetRequiredHeights = function useGetRequiredHeights() {
|
|
4193
|
+
var listRef = React__default.useRef(null);
|
|
4194
|
+
// Used to store the height of the list dialog content
|
|
4195
|
+
var _React$useState = React__default.useState(DEFAULT_DIALOG_HEIGHT),
|
|
4196
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
4197
|
+
dialogHeight = _React$useState2[0],
|
|
4198
|
+
setDialogHeight = _React$useState2[1];
|
|
4199
|
+
// Used to store the height of the "Add new object" button
|
|
4200
|
+
var _React$useState3 = React__default.useState(DEFAULT_ADD_BUTTON_HEIGHT),
|
|
4201
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
4202
|
+
addButtonHeight = _React$useState4[0],
|
|
4203
|
+
setAddButtonHeight = _React$useState4[1];
|
|
4204
|
+
// Obtain the height of of the list dialog content
|
|
4205
|
+
React__default.useLayoutEffect(function () {
|
|
4206
|
+
var _a;
|
|
4207
|
+
var dialogElement = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
4208
|
+
(dialogElement === null || dialogElement === void 0 ? void 0 : dialogElement.offsetHeight) && setDialogHeight(dialogElement === null || dialogElement === void 0 ? void 0 : dialogElement.offsetHeight);
|
|
4209
|
+
var observer = new ResizeObserver(function () {
|
|
4210
|
+
var height = getHeight(dialogElement);
|
|
4211
|
+
height && setDialogHeight(height);
|
|
4212
|
+
});
|
|
4213
|
+
observer.observe(dialogElement);
|
|
4214
|
+
return function () {
|
|
4215
|
+
observer.disconnect();
|
|
4216
|
+
};
|
|
4217
|
+
}, [listRef]);
|
|
4218
|
+
// Obtain height of the "Add new object" button
|
|
4219
|
+
React__default.useEffect(function () {
|
|
4220
|
+
var _a, _b;
|
|
4221
|
+
var buttonElement = (_b = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.lastChild;
|
|
4222
|
+
var height = getHeight(buttonElement);
|
|
4223
|
+
height && setAddButtonHeight(height);
|
|
4224
|
+
}, []);
|
|
4225
|
+
var availableSpaceForList = dialogHeight - addButtonHeight - DEFAULT_PADDING_TOP;
|
|
4226
|
+
var listHeight = availableSpaceForList && availableSpaceForList < MIN_HEIGHT_SCROLLABLE_LIST ? MIN_HEIGHT_SCROLLABLE_LIST : availableSpaceForList;
|
|
4227
|
+
return {
|
|
4228
|
+
listRef: listRef,
|
|
4229
|
+
listHeight: listHeight
|
|
4230
|
+
};
|
|
4231
|
+
};
|
|
3279
4232
|
var NO_OBJECTS_FOUND = 'No objects found';
|
|
3280
4233
|
var BUTTON_EDIT$1 = 'Edit';
|
|
3281
4234
|
var BUTTON_DELETE$1 = 'Delete';
|
|
@@ -3284,6 +4237,33 @@ var BUTTON_AIRMET = 'AIRMET';
|
|
|
3284
4237
|
var BUTTON_SIGMET = 'SIGMET';
|
|
3285
4238
|
var BUTTON_PUBLIC_WARNING = 'PUBLIC WARNING';
|
|
3286
4239
|
var MENU_SHARE = 'Share object to';
|
|
4240
|
+
var getListInclHeaders = function getListInclHeaders(objects) {
|
|
4241
|
+
var listInclHeaders = [];
|
|
4242
|
+
var headerList = [];
|
|
4243
|
+
// Construct list incl day headers
|
|
4244
|
+
objects.forEach(function (object, index) {
|
|
4245
|
+
var objectDate = dateUtils.isoStringToDate(object.lastUpdatedTime);
|
|
4246
|
+
var header = dateUtils.dateToString(objectDate, DATE_FORMAT_HEADER, true);
|
|
4247
|
+
var isNewDay = !headerList.find(function (item) {
|
|
4248
|
+
return item === header;
|
|
4249
|
+
});
|
|
4250
|
+
if (isNewDay) {
|
|
4251
|
+
var newLength = headerList.push(header);
|
|
4252
|
+
listInclHeaders.push({
|
|
4253
|
+
isObject: false,
|
|
4254
|
+
index: newLength - 1
|
|
4255
|
+
});
|
|
4256
|
+
}
|
|
4257
|
+
listInclHeaders.push({
|
|
4258
|
+
isObject: true,
|
|
4259
|
+
index: index
|
|
4260
|
+
});
|
|
4261
|
+
});
|
|
4262
|
+
return {
|
|
4263
|
+
listInclHeaders: listInclHeaders,
|
|
4264
|
+
headerList: headerList
|
|
4265
|
+
};
|
|
4266
|
+
};
|
|
3287
4267
|
var Objects = function Objects(_ref) {
|
|
3288
4268
|
var objects = _ref.objects,
|
|
3289
4269
|
onClickObject = _ref.onClickObject,
|
|
@@ -3293,40 +4273,60 @@ var Objects = function Objects(_ref) {
|
|
|
3293
4273
|
activeObject = _ref.activeObject,
|
|
3294
4274
|
_ref$isLoading = _ref.isLoading,
|
|
3295
4275
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
4276
|
+
// Used to store the height of the list dialog content
|
|
4277
|
+
var _useGetRequiredHeight = useGetRequiredHeights(),
|
|
4278
|
+
listRef = _useGetRequiredHeight.listRef,
|
|
4279
|
+
listHeight = _useGetRequiredHeight.listHeight;
|
|
4280
|
+
var _getListInclHeaders = getListInclHeaders(objects),
|
|
4281
|
+
listInclHeaders = _getListInclHeaders.listInclHeaders,
|
|
4282
|
+
headerList = _getListInclHeaders.headerList;
|
|
4283
|
+
var getItemSize = function getItemSize(index) {
|
|
4284
|
+
var item = listInclHeaders[index];
|
|
4285
|
+
if (item.isObject) {
|
|
4286
|
+
return OBJECT_ITEM_SIZE;
|
|
4287
|
+
}
|
|
4288
|
+
return HEADER_ITEM_SIZE;
|
|
4289
|
+
};
|
|
4290
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
4291
|
+
ref: listRef,
|
|
3307
4292
|
sx: {
|
|
3308
|
-
|
|
3309
|
-
overflow: 'auto'
|
|
4293
|
+
paddingTop: 0.75
|
|
3310
4294
|
}
|
|
3311
|
-
}, objects.
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
4295
|
+
}, !isLoading && objects.length === 0 ? /*#__PURE__*/React__default.createElement(Typography, {
|
|
4296
|
+
sx: {
|
|
4297
|
+
paddingLeft: '16px',
|
|
4298
|
+
paddingTop: '8px'
|
|
4299
|
+
},
|
|
4300
|
+
variant: "body1"
|
|
4301
|
+
}, NO_OBJECTS_FOUND) : /*#__PURE__*/React__default.createElement(VariableSizeList, {
|
|
4302
|
+
height: listHeight,
|
|
4303
|
+
itemCount: listInclHeaders.length,
|
|
4304
|
+
itemSize: getItemSize,
|
|
4305
|
+
width: "100%"
|
|
4306
|
+
}, function (_ref2) {
|
|
4307
|
+
var index = _ref2.index,
|
|
4308
|
+
style = _ref2.style;
|
|
4309
|
+
var listItem = listInclHeaders[index];
|
|
4310
|
+
if (!listItem.isObject) {
|
|
4311
|
+
var header = headerList[listItem.index];
|
|
4312
|
+
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
4313
|
+
style: style,
|
|
4314
|
+
key: listItem.index,
|
|
4315
|
+
sx: {
|
|
4316
|
+
paddingLeft: 2.5,
|
|
4317
|
+
paddingBottom: 0.5,
|
|
4318
|
+
paddingTop: 0.5,
|
|
4319
|
+
opacity: 0.67
|
|
4320
|
+
},
|
|
4321
|
+
variant: "caption"
|
|
4322
|
+
}, header);
|
|
3319
4323
|
}
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
paddingLeft: 2.5,
|
|
3325
|
-
opacity: 0.67
|
|
3326
|
-
},
|
|
3327
|
-
variant: "caption"
|
|
3328
|
-
}, header), /*#__PURE__*/React__default.createElement(ListItem, {
|
|
4324
|
+
var object = objects[listItem.index];
|
|
4325
|
+
var objectDate = dateUtils.isoStringToDate(object.lastUpdatedTime);
|
|
4326
|
+
return /*#__PURE__*/React__default.createElement(ListItem, {
|
|
4327
|
+
style: style,
|
|
3329
4328
|
disablePadding: true,
|
|
4329
|
+
key: object.id,
|
|
3330
4330
|
sx: {
|
|
3331
4331
|
'& .MuiListItemSecondaryAction-root': {
|
|
3332
4332
|
right: '8px'
|
|
@@ -3402,7 +4402,7 @@ var Objects = function Objects(_ref) {
|
|
|
3402
4402
|
sx: {
|
|
3403
4403
|
opacity: 0.67
|
|
3404
4404
|
}
|
|
3405
|
-
}, object.scope === 'global' && 'Global: ', dateUtils.dateToString(objectDate, DATE_FORMAT, true), ' ', "UTC")))))
|
|
4405
|
+
}, object.scope === 'global' && 'Global: ', dateUtils.dateToString(objectDate, DATE_FORMAT, true), ' ', "UTC")))));
|
|
3406
4406
|
}));
|
|
3407
4407
|
};
|
|
3408
4408
|
|
|
@@ -3415,7 +4415,7 @@ var DEFAULT_OBJECT_MANAGER_POSITION = {
|
|
|
3415
4415
|
left: 50
|
|
3416
4416
|
};
|
|
3417
4417
|
var DEFAULT_OBJECT_MANAGER_MIN_SIZE = {
|
|
3418
|
-
width:
|
|
4418
|
+
width: 200,
|
|
3419
4419
|
height: 300
|
|
3420
4420
|
};
|
|
3421
4421
|
var BUTTON_ADD_OBJECT$1 = 'Add a new object';
|
|
@@ -23089,15 +24089,18 @@ var probablityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
|
|
|
23089
24089
|
var levelOptions = [{
|
|
23090
24090
|
title: 'Moderate',
|
|
23091
24091
|
key: 'moderate',
|
|
23092
|
-
color: '#FAE21E'
|
|
24092
|
+
color: '#FAE21E',
|
|
24093
|
+
textColor: '#051039'
|
|
23093
24094
|
}, {
|
|
23094
24095
|
title: 'Severe',
|
|
23095
24096
|
key: 'severe',
|
|
23096
|
-
color: '#E27000'
|
|
24097
|
+
color: '#E27000',
|
|
24098
|
+
textColor: '#051039'
|
|
23097
24099
|
}, {
|
|
23098
24100
|
title: 'Extreme',
|
|
23099
24101
|
key: 'extreme',
|
|
23100
|
-
color: '#D62A20'
|
|
24102
|
+
color: '#D62A20',
|
|
24103
|
+
textColor: '#ffffff'
|
|
23101
24104
|
}];
|
|
23102
24105
|
var warningPhenomena = [{
|
|
23103
24106
|
title: 'Coastal event',
|
|
@@ -23293,6 +24296,7 @@ var Form = function Form(_ref5) {
|
|
|
23293
24296
|
rules: {},
|
|
23294
24297
|
sx: {
|
|
23295
24298
|
'& .MuiSelect-select.MuiSelect-filled': {
|
|
24299
|
+
color: (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.textColor) || 'none',
|
|
23296
24300
|
backgroundColor: (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color) || 'none',
|
|
23297
24301
|
backgroundClip: 'content-box'
|
|
23298
24302
|
}
|
|
@@ -23303,20 +24307,22 @@ var Form = function Form(_ref5) {
|
|
|
23303
24307
|
key: level.key,
|
|
23304
24308
|
sx: {
|
|
23305
24309
|
'&.MuiMenuItem-root ': {
|
|
24310
|
+
color: level.textColor,
|
|
23306
24311
|
background: level.color,
|
|
23307
24312
|
backgroundClip: 'content-box',
|
|
24313
|
+
padding: '12px 8px',
|
|
23308
24314
|
'&:hover': {
|
|
23309
24315
|
backgroundColor: "".concat(level.color),
|
|
23310
24316
|
backgroundClip: 'content-box',
|
|
23311
24317
|
boxShadow: function boxShadow(theme) {
|
|
23312
|
-
return "inset -
|
|
24318
|
+
return "inset -8px -12px ".concat(theme.palette.geowebColors.cards.cardContainerMouseOver, ", inset 8px 12px ").concat(theme.palette.geowebColors.cards.cardContainerMouseOver);
|
|
23313
24319
|
}
|
|
23314
24320
|
},
|
|
23315
24321
|
'&.Mui-selected': {
|
|
23316
24322
|
backgroundColor: "".concat(level.color),
|
|
23317
24323
|
'&:hover': {
|
|
23318
24324
|
boxShadow: function boxShadow(theme) {
|
|
23319
|
-
return "inset 4px 0px 0px 0px ".concat(theme.palette.geowebColors.typographyAndIcons.iconLinkActive, ", inset -
|
|
24325
|
+
return "inset 4px 0px 0px 0px ".concat(theme.palette.geowebColors.typographyAndIcons.iconLinkActive, ", inset -8px -12px ").concat(theme.palette.geowebColors.cards.cardContainerMouseOver, ", inset 8px 12px ").concat(theme.palette.geowebColors.cards.cardContainerMouseOver);
|
|
23320
24326
|
}
|
|
23321
24327
|
}
|
|
23322
24328
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@mui/material": "5.12.0",
|
|
12
|
-
"@opengeoweb/api": "8.
|
|
13
|
-
"@opengeoweb/core": "8.
|
|
14
|
-
"@opengeoweb/form-fields": "8.
|
|
15
|
-
"@opengeoweb/shared": "8.
|
|
16
|
-
"@opengeoweb/store": "8.
|
|
17
|
-
"@opengeoweb/theme": "8.
|
|
18
|
-
"@opengeoweb/webmap": "8.
|
|
19
|
-
"@opengeoweb/webmap-react": "8.
|
|
12
|
+
"@opengeoweb/api": "8.4.1",
|
|
13
|
+
"@opengeoweb/core": "8.4.1",
|
|
14
|
+
"@opengeoweb/form-fields": "8.4.1",
|
|
15
|
+
"@opengeoweb/shared": "8.4.1",
|
|
16
|
+
"@opengeoweb/store": "8.4.1",
|
|
17
|
+
"@opengeoweb/theme": "8.4.1",
|
|
18
|
+
"@opengeoweb/webmap": "8.4.1",
|
|
19
|
+
"@opengeoweb/webmap-react": "8.4.1",
|
|
20
20
|
"@redux-eggs/redux-toolkit": "2.2.0",
|
|
21
21
|
"@redux-eggs/saga-extension": "2.2.0",
|
|
22
22
|
"@reduxjs/toolkit": "1.9.7",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"react": "18.2.0",
|
|
26
26
|
"react-hook-form": "7.47.0",
|
|
27
27
|
"react-redux": "8.1.3",
|
|
28
|
+
"react-window": "1.8.9",
|
|
28
29
|
"redux-saga": "1.2.3"
|
|
29
30
|
},
|
|
30
31
|
"module": "./index.esm.js",
|
|
@@ -8,6 +8,14 @@ export declare const BUTTON_AIRMET = "AIRMET";
|
|
|
8
8
|
export declare const BUTTON_SIGMET = "SIGMET";
|
|
9
9
|
export declare const BUTTON_PUBLIC_WARNING = "PUBLIC WARNING";
|
|
10
10
|
export declare const MENU_SHARE = "Share object to";
|
|
11
|
+
type ListInclHeadersType = {
|
|
12
|
+
isObject: boolean;
|
|
13
|
+
index: number;
|
|
14
|
+
}[];
|
|
15
|
+
export declare const getListInclHeaders: (objects: DrawingListItem[]) => {
|
|
16
|
+
listInclHeaders: ListInclHeadersType;
|
|
17
|
+
headerList: string[];
|
|
18
|
+
};
|
|
11
19
|
export declare const Objects: FC<{
|
|
12
20
|
objects: DrawingListItem[];
|
|
13
21
|
onClickObject: (object: DrawingListItem) => void;
|
|
@@ -17,3 +25,4 @@ export declare const Objects: FC<{
|
|
|
17
25
|
activeObject: string;
|
|
18
26
|
isLoading?: boolean;
|
|
19
27
|
}>;
|
|
28
|
+
export {};
|