@opengeoweb/webmap-react 6.1.1 → 7.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.esm.js +2459 -70
- package/package.json +1 -1
- package/src/lib/components/Legend/LegendDialog.d.ts +15 -0
- package/src/lib/components/Legend/index.d.ts +1 -0
- package/src/lib/components/MapControls/MapControlButton.d.ts +10 -0
- package/src/lib/components/MapControls/MapControls.d.ts +7 -0
- package/src/lib/components/MapControls/ZoomControls.d.ts +8 -0
- package/src/lib/components/MapControls/index.d.ts +3 -0
- package/src/lib/components/MapTime/MapTime.d.ts +11 -0
- package/src/lib/components/MapTime/index.d.ts +1 -0
- package/src/lib/components/MapView/MapView.d.ts +8 -0
- package/src/lib/components/{ReactMapView → MapView}/MapViewLayer.d.ts +2 -3
- package/src/lib/components/MapView/index.d.ts +2 -0
- package/src/lib/components/ReactMapView/index.d.ts +0 -2
- package/src/lib/components/index.d.ts +3 -0
- package/src/lib/index.d.ts +1 -0
- package/src/lib/layers/index.d.ts +3 -0
- package/src/lib/layers/publicLayers.d.ts +310 -0
- package/src/lib/layers/publicServices.d.ts +95 -0
- /package/src/lib/{components/ReactMapView → layers}/defaultLayers.d.ts +0 -0
package/index.esm.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { Component, forwardRef, useContext, useRef, useState, useEffect } from 'react';
|
|
3
|
+
import React__default, { Component, forwardRef, useContext, useRef, useState, useEffect, cloneElement, useCallback, isValidElement, createRef, PureComponent } from 'react';
|
|
4
4
|
import { legendImageStore, WMImageEventType, webmapUtils, getLegendGraphicURLForLayer, getMapImageStore, LayerType, WMBBOX, debug, DebugType, WMLayer, WMJSMap, tilesettings } from '@opengeoweb/webmap';
|
|
5
|
-
import { CustomTooltip, dateUtils } from '@opengeoweb/shared';
|
|
5
|
+
import { CustomTooltip, ToolContainerDraggable, dateUtils, CustomIconButton } from '@opengeoweb/shared';
|
|
6
|
+
import { findDOMNode } from 'react-dom';
|
|
7
|
+
import { Home, Add, Minus } from '@opengeoweb/theme';
|
|
6
8
|
|
|
7
9
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
8
10
|
|
|
@@ -171,7 +173,7 @@ var $documentAll = documentAll_1;
|
|
|
171
173
|
|
|
172
174
|
var documentAll = $documentAll.all;
|
|
173
175
|
|
|
174
|
-
var isObject$
|
|
176
|
+
var isObject$b = $documentAll.IS_HTMLDDA ? function (it) {
|
|
175
177
|
return typeof it == 'object' ? it !== null : isCallable$g(it) || it === documentAll;
|
|
176
178
|
} : function (it) {
|
|
177
179
|
return typeof it == 'object' ? it !== null : isCallable$g(it);
|
|
@@ -255,7 +257,7 @@ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
|
255
257
|
|
|
256
258
|
var $Object$3 = Object;
|
|
257
259
|
|
|
258
|
-
var isSymbol$
|
|
260
|
+
var isSymbol$4 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
259
261
|
return typeof it == 'symbol';
|
|
260
262
|
} : function (it) {
|
|
261
263
|
var $Symbol = getBuiltIn$2('Symbol');
|
|
@@ -295,7 +297,7 @@ var getMethod$2 = function (V, P) {
|
|
|
295
297
|
|
|
296
298
|
var call$9 = functionCall;
|
|
297
299
|
var isCallable$c = isCallable$h;
|
|
298
|
-
var isObject$
|
|
300
|
+
var isObject$a = isObject$b;
|
|
299
301
|
|
|
300
302
|
var $TypeError$6 = TypeError;
|
|
301
303
|
|
|
@@ -303,9 +305,9 @@ var $TypeError$6 = TypeError;
|
|
|
303
305
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
304
306
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
305
307
|
var fn, val;
|
|
306
|
-
if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$
|
|
307
|
-
if (isCallable$c(fn = input.valueOf) && !isObject$
|
|
308
|
-
if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$
|
|
308
|
+
if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$a(val = call$9(fn, input))) return val;
|
|
309
|
+
if (isCallable$c(fn = input.valueOf) && !isObject$a(val = call$9(fn, input))) return val;
|
|
310
|
+
if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$a(val = call$9(fn, input))) return val;
|
|
309
311
|
throw $TypeError$6("Can't convert object to primitive value");
|
|
310
312
|
};
|
|
311
313
|
|
|
@@ -357,13 +359,13 @@ var toObject$6 = function (argument) {
|
|
|
357
359
|
var uncurryThis$g = functionUncurryThis;
|
|
358
360
|
var toObject$5 = toObject$6;
|
|
359
361
|
|
|
360
|
-
var hasOwnProperty$
|
|
362
|
+
var hasOwnProperty$3 = uncurryThis$g({}.hasOwnProperty);
|
|
361
363
|
|
|
362
364
|
// `HasOwnProperty` abstract operation
|
|
363
365
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
364
366
|
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
365
367
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
366
|
-
return hasOwnProperty$
|
|
368
|
+
return hasOwnProperty$3(toObject$5(it), key);
|
|
367
369
|
};
|
|
368
370
|
|
|
369
371
|
var uncurryThis$f = functionUncurryThis;
|
|
@@ -383,21 +385,21 @@ var uid$1 = uid$2;
|
|
|
383
385
|
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
384
386
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
385
387
|
|
|
386
|
-
var Symbol$
|
|
388
|
+
var Symbol$5 = global$b.Symbol;
|
|
387
389
|
var WellKnownSymbolsStore = shared$3('wks');
|
|
388
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$
|
|
390
|
+
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$5['for'] || Symbol$5 : Symbol$5 && Symbol$5.withoutSetter || uid$1;
|
|
389
391
|
|
|
390
392
|
var wellKnownSymbol$a = function (name) {
|
|
391
393
|
if (!hasOwn$9(WellKnownSymbolsStore, name)) {
|
|
392
|
-
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$9(Symbol$
|
|
393
|
-
? Symbol$
|
|
394
|
+
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$9(Symbol$5, name)
|
|
395
|
+
? Symbol$5[name]
|
|
394
396
|
: createWellKnownSymbol('Symbol.' + name);
|
|
395
397
|
} return WellKnownSymbolsStore[name];
|
|
396
398
|
};
|
|
397
399
|
|
|
398
400
|
var call$8 = functionCall;
|
|
399
|
-
var isObject$
|
|
400
|
-
var isSymbol$
|
|
401
|
+
var isObject$9 = isObject$b;
|
|
402
|
+
var isSymbol$3 = isSymbol$4;
|
|
401
403
|
var getMethod$1 = getMethod$2;
|
|
402
404
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
403
405
|
var wellKnownSymbol$9 = wellKnownSymbol$a;
|
|
@@ -408,13 +410,13 @@ var TO_PRIMITIVE = wellKnownSymbol$9('toPrimitive');
|
|
|
408
410
|
// `ToPrimitive` abstract operation
|
|
409
411
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
410
412
|
var toPrimitive$1 = function (input, pref) {
|
|
411
|
-
if (!isObject$
|
|
413
|
+
if (!isObject$9(input) || isSymbol$3(input)) return input;
|
|
412
414
|
var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
|
|
413
415
|
var result;
|
|
414
416
|
if (exoticToPrim) {
|
|
415
417
|
if (pref === undefined) pref = 'default';
|
|
416
418
|
result = call$8(exoticToPrim, input, pref);
|
|
417
|
-
if (!isObject$
|
|
419
|
+
if (!isObject$9(result) || isSymbol$3(result)) return result;
|
|
418
420
|
throw $TypeError$5("Can't convert object to primitive value");
|
|
419
421
|
}
|
|
420
422
|
if (pref === undefined) pref = 'number';
|
|
@@ -422,21 +424,21 @@ var toPrimitive$1 = function (input, pref) {
|
|
|
422
424
|
};
|
|
423
425
|
|
|
424
426
|
var toPrimitive = toPrimitive$1;
|
|
425
|
-
var isSymbol = isSymbol$
|
|
427
|
+
var isSymbol$2 = isSymbol$4;
|
|
426
428
|
|
|
427
429
|
// `ToPropertyKey` abstract operation
|
|
428
430
|
// https://tc39.es/ecma262/#sec-topropertykey
|
|
429
431
|
var toPropertyKey$2 = function (argument) {
|
|
430
432
|
var key = toPrimitive(argument, 'string');
|
|
431
|
-
return isSymbol(key) ? key : key + '';
|
|
433
|
+
return isSymbol$2(key) ? key : key + '';
|
|
432
434
|
};
|
|
433
435
|
|
|
434
436
|
var global$a = global$h;
|
|
435
|
-
var isObject$
|
|
437
|
+
var isObject$8 = isObject$b;
|
|
436
438
|
|
|
437
439
|
var document$1 = global$a.document;
|
|
438
440
|
// typeof document.createElement is 'object' in old IE
|
|
439
|
-
var EXISTS$1 = isObject$
|
|
441
|
+
var EXISTS$1 = isObject$8(document$1) && isObject$8(document$1.createElement);
|
|
440
442
|
|
|
441
443
|
var documentCreateElement$2 = function (it) {
|
|
442
444
|
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
@@ -492,14 +494,14 @@ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$d(function () {
|
|
|
492
494
|
}).prototype !== 42;
|
|
493
495
|
});
|
|
494
496
|
|
|
495
|
-
var isObject$
|
|
497
|
+
var isObject$7 = isObject$b;
|
|
496
498
|
|
|
497
499
|
var $String$3 = String;
|
|
498
500
|
var $TypeError$4 = TypeError;
|
|
499
501
|
|
|
500
502
|
// `Assert: Type(argument) is Object`
|
|
501
503
|
var anObject$9 = function (argument) {
|
|
502
|
-
if (isObject$
|
|
504
|
+
if (isObject$7(argument)) return argument;
|
|
503
505
|
throw $TypeError$4($String$3(argument) + ' is not an object');
|
|
504
506
|
};
|
|
505
507
|
|
|
@@ -613,7 +615,7 @@ var hiddenKeys$4 = {};
|
|
|
613
615
|
|
|
614
616
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
615
617
|
var global$8 = global$h;
|
|
616
|
-
var isObject$
|
|
618
|
+
var isObject$6 = isObject$b;
|
|
617
619
|
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
|
|
618
620
|
var hasOwn$6 = hasOwnProperty_1;
|
|
619
621
|
var shared$1 = sharedStore;
|
|
@@ -632,7 +634,7 @@ var enforce = function (it) {
|
|
|
632
634
|
var getterFor = function (TYPE) {
|
|
633
635
|
return function (it) {
|
|
634
636
|
var state;
|
|
635
|
-
if (!isObject$
|
|
637
|
+
if (!isObject$6(it) || (state = get$1(it)).type !== TYPE) {
|
|
636
638
|
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
637
639
|
} return state;
|
|
638
640
|
};
|
|
@@ -1601,7 +1603,7 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
|
|
|
1601
1603
|
|
|
1602
1604
|
var fails$8 = fails$j;
|
|
1603
1605
|
var isCallable$5 = isCallable$h;
|
|
1604
|
-
var isObject$
|
|
1606
|
+
var isObject$5 = isObject$b;
|
|
1605
1607
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1606
1608
|
var defineBuiltIn$3 = defineBuiltIn$5;
|
|
1607
1609
|
var wellKnownSymbol$7 = wellKnownSymbol$a;
|
|
@@ -1624,7 +1626,7 @@ if ([].keys) {
|
|
|
1624
1626
|
}
|
|
1625
1627
|
}
|
|
1626
1628
|
|
|
1627
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$
|
|
1629
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$5(IteratorPrototype$2) || fails$8(function () {
|
|
1628
1630
|
var test = {};
|
|
1629
1631
|
// FF44- legacy iterators case
|
|
1630
1632
|
return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
|
|
@@ -2376,7 +2378,7 @@ object-assign
|
|
|
2376
2378
|
*/
|
|
2377
2379
|
/* eslint-disable no-unused-vars */
|
|
2378
2380
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
2379
|
-
var hasOwnProperty$
|
|
2381
|
+
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
2380
2382
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
2381
2383
|
|
|
2382
2384
|
function toObject$2(val) {
|
|
@@ -2440,7 +2442,7 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
|
|
|
2440
2442
|
from = Object(arguments[s]);
|
|
2441
2443
|
|
|
2442
2444
|
for (var key in from) {
|
|
2443
|
-
if (hasOwnProperty$
|
|
2445
|
+
if (hasOwnProperty$2.call(from, key)) {
|
|
2444
2446
|
to[key] = from[key];
|
|
2445
2447
|
}
|
|
2446
2448
|
}
|
|
@@ -3589,6 +3591,30 @@ function capitalize(string) {
|
|
|
3589
3591
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
3590
3592
|
}
|
|
3591
3593
|
|
|
3594
|
+
function requirePropFactory(componentNameInError, Component) {
|
|
3595
|
+
if (process.env.NODE_ENV === 'production') {
|
|
3596
|
+
return () => null;
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3599
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
3600
|
+
const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;
|
|
3601
|
+
const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
|
|
3602
|
+
const propFullNameSafe = propFullName || propName;
|
|
3603
|
+
const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
|
|
3604
|
+
if (defaultTypeChecker) {
|
|
3605
|
+
const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);
|
|
3606
|
+
if (typeCheckerResult) {
|
|
3607
|
+
return typeCheckerResult;
|
|
3608
|
+
}
|
|
3609
|
+
}
|
|
3610
|
+
if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
|
|
3611
|
+
return new Error(`The prop \`${propFullNameSafe}\` of ` + `\`${componentNameInError}\` can only be used together with the \`${requiredProp}\` prop.`);
|
|
3612
|
+
}
|
|
3613
|
+
return null;
|
|
3614
|
+
};
|
|
3615
|
+
return requireProp;
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3592
3618
|
function getTypeByValue(value) {
|
|
3593
3619
|
const valueType = typeof value;
|
|
3594
3620
|
switch (valueType) {
|
|
@@ -5664,7 +5690,7 @@ var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion'
|
|
|
5664
5690
|
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$2 ? syncFallback : useInsertionEffect || syncFallback;
|
|
5665
5691
|
|
|
5666
5692
|
var isBrowser$1 = typeof document !== 'undefined';
|
|
5667
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
5693
|
+
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
5668
5694
|
|
|
5669
5695
|
var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
5670
5696
|
// because this module is primarily intended for the browser and node
|
|
@@ -5785,7 +5811,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
5785
5811
|
var newProps = {};
|
|
5786
5812
|
|
|
5787
5813
|
for (var key in props) {
|
|
5788
|
-
if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
5814
|
+
if (hasOwnProperty$1.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
5789
5815
|
newProps[key] = props[key];
|
|
5790
5816
|
}
|
|
5791
5817
|
}
|
|
@@ -6029,7 +6055,7 @@ const internal_processStyles = (tag, processor) => {
|
|
|
6029
6055
|
}
|
|
6030
6056
|
};
|
|
6031
6057
|
|
|
6032
|
-
const _excluded$
|
|
6058
|
+
const _excluded$c = ["values", "unit", "step"];
|
|
6033
6059
|
const sortBreakpointsValues = values => {
|
|
6034
6060
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
6035
6061
|
key,
|
|
@@ -6064,7 +6090,7 @@ function createBreakpoints(breakpoints) {
|
|
|
6064
6090
|
unit = 'px',
|
|
6065
6091
|
step = 5
|
|
6066
6092
|
} = breakpoints,
|
|
6067
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
6093
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$c);
|
|
6068
6094
|
const sortedValues = sortBreakpointsValues(values);
|
|
6069
6095
|
const keys = Object.keys(sortedValues);
|
|
6070
6096
|
function up(key) {
|
|
@@ -6191,6 +6217,56 @@ function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
|
6191
6217
|
}, style);
|
|
6192
6218
|
}
|
|
6193
6219
|
|
|
6220
|
+
// compute base for responsive values; e.g.,
|
|
6221
|
+
// [1,2,3] => {xs: true, sm: true, md: true}
|
|
6222
|
+
// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}
|
|
6223
|
+
function computeBreakpointsBase(breakpointValues, themeBreakpoints) {
|
|
6224
|
+
// fixed value
|
|
6225
|
+
if (typeof breakpointValues !== 'object') {
|
|
6226
|
+
return {};
|
|
6227
|
+
}
|
|
6228
|
+
const base = {};
|
|
6229
|
+
const breakpointsKeys = Object.keys(themeBreakpoints);
|
|
6230
|
+
if (Array.isArray(breakpointValues)) {
|
|
6231
|
+
breakpointsKeys.forEach((breakpoint, i) => {
|
|
6232
|
+
if (i < breakpointValues.length) {
|
|
6233
|
+
base[breakpoint] = true;
|
|
6234
|
+
}
|
|
6235
|
+
});
|
|
6236
|
+
} else {
|
|
6237
|
+
breakpointsKeys.forEach(breakpoint => {
|
|
6238
|
+
if (breakpointValues[breakpoint] != null) {
|
|
6239
|
+
base[breakpoint] = true;
|
|
6240
|
+
}
|
|
6241
|
+
});
|
|
6242
|
+
}
|
|
6243
|
+
return base;
|
|
6244
|
+
}
|
|
6245
|
+
function resolveBreakpointValues({
|
|
6246
|
+
values: breakpointValues,
|
|
6247
|
+
breakpoints: themeBreakpoints,
|
|
6248
|
+
base: customBase
|
|
6249
|
+
}) {
|
|
6250
|
+
const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);
|
|
6251
|
+
const keys = Object.keys(base);
|
|
6252
|
+
if (keys.length === 0) {
|
|
6253
|
+
return breakpointValues;
|
|
6254
|
+
}
|
|
6255
|
+
let previous;
|
|
6256
|
+
return keys.reduce((acc, breakpoint, i) => {
|
|
6257
|
+
if (Array.isArray(breakpointValues)) {
|
|
6258
|
+
acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
|
|
6259
|
+
previous = i;
|
|
6260
|
+
} else if (typeof breakpointValues === 'object') {
|
|
6261
|
+
acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];
|
|
6262
|
+
previous = breakpoint;
|
|
6263
|
+
} else {
|
|
6264
|
+
acc[breakpoint] = breakpointValues;
|
|
6265
|
+
}
|
|
6266
|
+
return acc;
|
|
6267
|
+
}, {});
|
|
6268
|
+
}
|
|
6269
|
+
|
|
6194
6270
|
function getPath(obj, path, checkVars = true) {
|
|
6195
6271
|
if (!path || typeof path !== 'string') {
|
|
6196
6272
|
return null;
|
|
@@ -7105,7 +7181,7 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
|
7105
7181
|
styleFunctionSx.filterProps = ['sx'];
|
|
7106
7182
|
var styleFunctionSx$1 = styleFunctionSx;
|
|
7107
7183
|
|
|
7108
|
-
const _excluded$
|
|
7184
|
+
const _excluded$b = ["breakpoints", "palette", "spacing", "shape"];
|
|
7109
7185
|
function createTheme$1(options = {}, ...args) {
|
|
7110
7186
|
const {
|
|
7111
7187
|
breakpoints: breakpointsInput = {},
|
|
@@ -7113,7 +7189,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
7113
7189
|
spacing: spacingInput,
|
|
7114
7190
|
shape: shapeInput = {}
|
|
7115
7191
|
} = options,
|
|
7116
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
7192
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$b);
|
|
7117
7193
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
7118
7194
|
const spacing = createSpacing(spacingInput);
|
|
7119
7195
|
let muiTheme = deepmerge({
|
|
@@ -7151,7 +7227,7 @@ function useTheme$1(defaultTheme = systemDefaultTheme$1) {
|
|
|
7151
7227
|
return useTheme$2(defaultTheme);
|
|
7152
7228
|
}
|
|
7153
7229
|
|
|
7154
|
-
const _excluded$
|
|
7230
|
+
const _excluded$a = ["sx"];
|
|
7155
7231
|
const splitProps = props => {
|
|
7156
7232
|
var _props$theme$unstable, _props$theme;
|
|
7157
7233
|
const result = {
|
|
@@ -7172,7 +7248,7 @@ function extendSxProp(props) {
|
|
|
7172
7248
|
const {
|
|
7173
7249
|
sx: inSx
|
|
7174
7250
|
} = props,
|
|
7175
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
7251
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
|
7176
7252
|
const {
|
|
7177
7253
|
systemProps,
|
|
7178
7254
|
otherProps
|
|
@@ -7198,7 +7274,7 @@ function extendSxProp(props) {
|
|
|
7198
7274
|
|
|
7199
7275
|
function r$2(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$2(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$2(e))&&(n&&(n+=" "),n+=t);return n}
|
|
7200
7276
|
|
|
7201
|
-
const _excluded$
|
|
7277
|
+
const _excluded$9 = ["className", "component"];
|
|
7202
7278
|
function createBox(options = {}) {
|
|
7203
7279
|
const {
|
|
7204
7280
|
themeId,
|
|
@@ -7216,7 +7292,7 @@ function createBox(options = {}) {
|
|
|
7216
7292
|
className,
|
|
7217
7293
|
component = 'div'
|
|
7218
7294
|
} = _extendSxProp,
|
|
7219
|
-
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$
|
|
7295
|
+
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$9);
|
|
7220
7296
|
return /*#__PURE__*/jsx(BoxRoot, _extends({
|
|
7221
7297
|
as: component,
|
|
7222
7298
|
ref: ref,
|
|
@@ -7227,7 +7303,7 @@ function createBox(options = {}) {
|
|
|
7227
7303
|
return Box;
|
|
7228
7304
|
}
|
|
7229
7305
|
|
|
7230
|
-
const _excluded$
|
|
7306
|
+
const _excluded$8 = ["variant"];
|
|
7231
7307
|
function isEmpty$1(string) {
|
|
7232
7308
|
return string.length === 0;
|
|
7233
7309
|
}
|
|
@@ -7241,7 +7317,7 @@ function propsToClassKey(props) {
|
|
|
7241
7317
|
const {
|
|
7242
7318
|
variant
|
|
7243
7319
|
} = props,
|
|
7244
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
7320
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
|
7245
7321
|
let classKey = variant || '';
|
|
7246
7322
|
Object.keys(other).sort().forEach(key => {
|
|
7247
7323
|
if (key === 'color') {
|
|
@@ -7253,7 +7329,7 @@ function propsToClassKey(props) {
|
|
|
7253
7329
|
return classKey;
|
|
7254
7330
|
}
|
|
7255
7331
|
|
|
7256
|
-
const _excluded$
|
|
7332
|
+
const _excluded$7 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
7257
7333
|
function isEmpty(obj) {
|
|
7258
7334
|
return Object.keys(obj).length === 0;
|
|
7259
7335
|
}
|
|
@@ -7359,7 +7435,7 @@ function createStyled(input = {}) {
|
|
|
7359
7435
|
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
7360
7436
|
overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
|
|
7361
7437
|
} = inputOptions,
|
|
7362
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
7438
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$7);
|
|
7363
7439
|
|
|
7364
7440
|
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
7365
7441
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
|
|
@@ -7760,7 +7836,7 @@ function createMixins(breakpoints, mixins) {
|
|
|
7760
7836
|
}, mixins);
|
|
7761
7837
|
}
|
|
7762
7838
|
|
|
7763
|
-
const _excluded$
|
|
7839
|
+
const _excluded$6 = ["mode", "contrastThreshold", "tonalOffset"];
|
|
7764
7840
|
const light = {
|
|
7765
7841
|
// The colors used to style the text.
|
|
7766
7842
|
text: {
|
|
@@ -7929,7 +8005,7 @@ function createPalette(palette) {
|
|
|
7929
8005
|
contrastThreshold = 3,
|
|
7930
8006
|
tonalOffset = 0.2
|
|
7931
8007
|
} = palette,
|
|
7932
|
-
other = _objectWithoutPropertiesLoose(palette, _excluded$
|
|
8008
|
+
other = _objectWithoutPropertiesLoose(palette, _excluded$6);
|
|
7933
8009
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
7934
8010
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
7935
8011
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -8053,7 +8129,7 @@ const theme2 = createTheme({ palette: {
|
|
|
8053
8129
|
return paletteOutput;
|
|
8054
8130
|
}
|
|
8055
8131
|
|
|
8056
|
-
const _excluded$
|
|
8132
|
+
const _excluded$5 = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
8057
8133
|
function round(value) {
|
|
8058
8134
|
return Math.round(value * 1e5) / 1e5;
|
|
8059
8135
|
}
|
|
@@ -8084,7 +8160,7 @@ function createTypography(palette, typography) {
|
|
|
8084
8160
|
allVariants,
|
|
8085
8161
|
pxToRem: pxToRem2
|
|
8086
8162
|
} = _ref,
|
|
8087
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8163
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
8088
8164
|
if (process.env.NODE_ENV !== 'production') {
|
|
8089
8165
|
if (typeof fontSize !== 'number') {
|
|
8090
8166
|
console.error('MUI: `fontSize` is required to be a number.');
|
|
@@ -8151,7 +8227,7 @@ function createShadow(...px) {
|
|
|
8151
8227
|
const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
8152
8228
|
var shadows$1 = shadows;
|
|
8153
8229
|
|
|
8154
|
-
const _excluded$
|
|
8230
|
+
const _excluded$4 = ["duration", "easing", "delay"];
|
|
8155
8231
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
8156
8232
|
// to learn the context in which each easing should be used.
|
|
8157
8233
|
const easing = {
|
|
@@ -8202,7 +8278,7 @@ function createTransitions(inputTransitions) {
|
|
|
8202
8278
|
easing: easingOption = mergedEasing.easeInOut,
|
|
8203
8279
|
delay = 0
|
|
8204
8280
|
} = options,
|
|
8205
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
8281
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$4);
|
|
8206
8282
|
if (process.env.NODE_ENV !== 'production') {
|
|
8207
8283
|
const isString = value => typeof value === 'string';
|
|
8208
8284
|
// IE11 support, replace with Number.isNaN
|
|
@@ -8249,7 +8325,7 @@ const zIndex = {
|
|
|
8249
8325
|
};
|
|
8250
8326
|
var zIndex$1 = zIndex;
|
|
8251
8327
|
|
|
8252
|
-
const _excluded$
|
|
8328
|
+
const _excluded$3 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
8253
8329
|
function createTheme(options = {}, ...args) {
|
|
8254
8330
|
const {
|
|
8255
8331
|
mixins: mixinsInput = {},
|
|
@@ -8257,7 +8333,7 @@ function createTheme(options = {}, ...args) {
|
|
|
8257
8333
|
transitions: transitionsInput = {},
|
|
8258
8334
|
typography: typographyInput = {}
|
|
8259
8335
|
} = options,
|
|
8260
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
8336
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$3);
|
|
8261
8337
|
if (options.vars) {
|
|
8262
8338
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
|
|
8263
8339
|
Please use another name.` : formatMuiErrorMessage(18));
|
|
@@ -8366,8 +8442,8 @@ function getPaperUtilityClass(slot) {
|
|
|
8366
8442
|
}
|
|
8367
8443
|
generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);
|
|
8368
8444
|
|
|
8369
|
-
const _excluded$
|
|
8370
|
-
const useUtilityClasses$
|
|
8445
|
+
const _excluded$2 = ["className", "component", "elevation", "square", "variant"];
|
|
8446
|
+
const useUtilityClasses$2 = ownerState => {
|
|
8371
8447
|
const {
|
|
8372
8448
|
square,
|
|
8373
8449
|
elevation,
|
|
@@ -8421,14 +8497,14 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
|
|
|
8421
8497
|
square = false,
|
|
8422
8498
|
variant = 'elevation'
|
|
8423
8499
|
} = props,
|
|
8424
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
8500
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2);
|
|
8425
8501
|
const ownerState = _extends({}, props, {
|
|
8426
8502
|
component,
|
|
8427
8503
|
elevation,
|
|
8428
8504
|
square,
|
|
8429
8505
|
variant
|
|
8430
8506
|
});
|
|
8431
|
-
const classes = useUtilityClasses$
|
|
8507
|
+
const classes = useUtilityClasses$2(ownerState);
|
|
8432
8508
|
if (process.env.NODE_ENV !== 'production') {
|
|
8433
8509
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
8434
8510
|
const theme = useTheme();
|
|
@@ -8502,8 +8578,8 @@ function getTypographyUtilityClass(slot) {
|
|
|
8502
8578
|
}
|
|
8503
8579
|
generateUtilityClasses('MuiTypography', ['root', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'inherit', 'button', 'caption', 'overline', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'noWrap', 'gutterBottom', 'paragraph']);
|
|
8504
8580
|
|
|
8505
|
-
const _excluded = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"];
|
|
8506
|
-
const useUtilityClasses = ownerState => {
|
|
8581
|
+
const _excluded$1 = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"];
|
|
8582
|
+
const useUtilityClasses$1 = ownerState => {
|
|
8507
8583
|
const {
|
|
8508
8584
|
align,
|
|
8509
8585
|
gutterBottom,
|
|
@@ -8586,7 +8662,7 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
|
|
|
8586
8662
|
variant = 'body1',
|
|
8587
8663
|
variantMapping = defaultVariantMapping
|
|
8588
8664
|
} = props,
|
|
8589
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
8665
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
8590
8666
|
const ownerState = _extends({}, props, {
|
|
8591
8667
|
align,
|
|
8592
8668
|
color,
|
|
@@ -8599,7 +8675,7 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
|
|
|
8599
8675
|
variantMapping
|
|
8600
8676
|
});
|
|
8601
8677
|
const Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
|
|
8602
|
-
const classes = useUtilityClasses(ownerState);
|
|
8678
|
+
const classes = useUtilityClasses$1(ownerState);
|
|
8603
8679
|
return /*#__PURE__*/jsx(TypographyRoot, _extends({
|
|
8604
8680
|
as: Component,
|
|
8605
8681
|
ref: ref,
|
|
@@ -8712,6 +8788,575 @@ process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
|
|
|
8712
8788
|
} : void 0;
|
|
8713
8789
|
var Box$1 = Box;
|
|
8714
8790
|
|
|
8791
|
+
/**
|
|
8792
|
+
* @ignore - internal component.
|
|
8793
|
+
*/
|
|
8794
|
+
const GridContext = /*#__PURE__*/React.createContext();
|
|
8795
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
8796
|
+
GridContext.displayName = 'GridContext';
|
|
8797
|
+
}
|
|
8798
|
+
var GridContext$1 = GridContext;
|
|
8799
|
+
|
|
8800
|
+
function getGridUtilityClass(slot) {
|
|
8801
|
+
return generateUtilityClass('MuiGrid', slot);
|
|
8802
|
+
}
|
|
8803
|
+
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
8804
|
+
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
|
8805
|
+
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
|
8806
|
+
const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
8807
|
+
const gridClasses = generateUtilityClasses('MuiGrid', ['root', 'container', 'item', 'zeroMinWidth',
|
|
8808
|
+
// spacings
|
|
8809
|
+
...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
|
|
8810
|
+
// direction values
|
|
8811
|
+
...DIRECTIONS.map(direction => `direction-xs-${direction}`),
|
|
8812
|
+
// wrap values
|
|
8813
|
+
...WRAPS.map(wrap => `wrap-xs-${wrap}`),
|
|
8814
|
+
// grid sizes for all breakpoints
|
|
8815
|
+
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
|
|
8816
|
+
|
|
8817
|
+
const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"];
|
|
8818
|
+
function getOffset(val) {
|
|
8819
|
+
const parse = parseFloat(val);
|
|
8820
|
+
return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
|
|
8821
|
+
}
|
|
8822
|
+
function generateGrid({
|
|
8823
|
+
theme,
|
|
8824
|
+
ownerState
|
|
8825
|
+
}) {
|
|
8826
|
+
let size;
|
|
8827
|
+
return theme.breakpoints.keys.reduce((globalStyles, breakpoint) => {
|
|
8828
|
+
// Use side effect over immutability for better performance.
|
|
8829
|
+
let styles = {};
|
|
8830
|
+
if (ownerState[breakpoint]) {
|
|
8831
|
+
size = ownerState[breakpoint];
|
|
8832
|
+
}
|
|
8833
|
+
if (!size) {
|
|
8834
|
+
return globalStyles;
|
|
8835
|
+
}
|
|
8836
|
+
if (size === true) {
|
|
8837
|
+
// For the auto layouting
|
|
8838
|
+
styles = {
|
|
8839
|
+
flexBasis: 0,
|
|
8840
|
+
flexGrow: 1,
|
|
8841
|
+
maxWidth: '100%'
|
|
8842
|
+
};
|
|
8843
|
+
} else if (size === 'auto') {
|
|
8844
|
+
styles = {
|
|
8845
|
+
flexBasis: 'auto',
|
|
8846
|
+
flexGrow: 0,
|
|
8847
|
+
flexShrink: 0,
|
|
8848
|
+
maxWidth: 'none',
|
|
8849
|
+
width: 'auto'
|
|
8850
|
+
};
|
|
8851
|
+
} else {
|
|
8852
|
+
const columnsBreakpointValues = resolveBreakpointValues({
|
|
8853
|
+
values: ownerState.columns,
|
|
8854
|
+
breakpoints: theme.breakpoints.values
|
|
8855
|
+
});
|
|
8856
|
+
const columnValue = typeof columnsBreakpointValues === 'object' ? columnsBreakpointValues[breakpoint] : columnsBreakpointValues;
|
|
8857
|
+
if (columnValue === undefined || columnValue === null) {
|
|
8858
|
+
return globalStyles;
|
|
8859
|
+
}
|
|
8860
|
+
// Keep 7 significant numbers.
|
|
8861
|
+
const width = `${Math.round(size / columnValue * 10e7) / 10e5}%`;
|
|
8862
|
+
let more = {};
|
|
8863
|
+
if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
|
|
8864
|
+
const themeSpacing = theme.spacing(ownerState.columnSpacing);
|
|
8865
|
+
if (themeSpacing !== '0px') {
|
|
8866
|
+
const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
|
|
8867
|
+
more = {
|
|
8868
|
+
flexBasis: fullWidth,
|
|
8869
|
+
maxWidth: fullWidth
|
|
8870
|
+
};
|
|
8871
|
+
}
|
|
8872
|
+
}
|
|
8873
|
+
|
|
8874
|
+
// Close to the bootstrap implementation:
|
|
8875
|
+
// https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
|
|
8876
|
+
styles = _extends({
|
|
8877
|
+
flexBasis: width,
|
|
8878
|
+
flexGrow: 0,
|
|
8879
|
+
maxWidth: width
|
|
8880
|
+
}, more);
|
|
8881
|
+
}
|
|
8882
|
+
|
|
8883
|
+
// No need for a media query for the first size.
|
|
8884
|
+
if (theme.breakpoints.values[breakpoint] === 0) {
|
|
8885
|
+
Object.assign(globalStyles, styles);
|
|
8886
|
+
} else {
|
|
8887
|
+
globalStyles[theme.breakpoints.up(breakpoint)] = styles;
|
|
8888
|
+
}
|
|
8889
|
+
return globalStyles;
|
|
8890
|
+
}, {});
|
|
8891
|
+
}
|
|
8892
|
+
function generateDirection({
|
|
8893
|
+
theme,
|
|
8894
|
+
ownerState
|
|
8895
|
+
}) {
|
|
8896
|
+
const directionValues = resolveBreakpointValues({
|
|
8897
|
+
values: ownerState.direction,
|
|
8898
|
+
breakpoints: theme.breakpoints.values
|
|
8899
|
+
});
|
|
8900
|
+
return handleBreakpoints({
|
|
8901
|
+
theme
|
|
8902
|
+
}, directionValues, propValue => {
|
|
8903
|
+
const output = {
|
|
8904
|
+
flexDirection: propValue
|
|
8905
|
+
};
|
|
8906
|
+
if (propValue.indexOf('column') === 0) {
|
|
8907
|
+
output[`& > .${gridClasses.item}`] = {
|
|
8908
|
+
maxWidth: 'none'
|
|
8909
|
+
};
|
|
8910
|
+
}
|
|
8911
|
+
return output;
|
|
8912
|
+
});
|
|
8913
|
+
}
|
|
8914
|
+
|
|
8915
|
+
/**
|
|
8916
|
+
* Extracts zero value breakpoint keys before a non-zero value breakpoint key.
|
|
8917
|
+
* @example { xs: 0, sm: 0, md: 2, lg: 0, xl: 0 } or [0, 0, 2, 0, 0]
|
|
8918
|
+
* @returns [xs, sm]
|
|
8919
|
+
*/
|
|
8920
|
+
function extractZeroValueBreakpointKeys({
|
|
8921
|
+
breakpoints,
|
|
8922
|
+
values
|
|
8923
|
+
}) {
|
|
8924
|
+
let nonZeroKey = '';
|
|
8925
|
+
Object.keys(values).forEach(key => {
|
|
8926
|
+
if (nonZeroKey !== '') {
|
|
8927
|
+
return;
|
|
8928
|
+
}
|
|
8929
|
+
if (values[key] !== 0) {
|
|
8930
|
+
nonZeroKey = key;
|
|
8931
|
+
}
|
|
8932
|
+
});
|
|
8933
|
+
const sortedBreakpointKeysByValue = Object.keys(breakpoints).sort((a, b) => {
|
|
8934
|
+
return breakpoints[a] - breakpoints[b];
|
|
8935
|
+
});
|
|
8936
|
+
return sortedBreakpointKeysByValue.slice(0, sortedBreakpointKeysByValue.indexOf(nonZeroKey));
|
|
8937
|
+
}
|
|
8938
|
+
function generateRowGap({
|
|
8939
|
+
theme,
|
|
8940
|
+
ownerState
|
|
8941
|
+
}) {
|
|
8942
|
+
const {
|
|
8943
|
+
container,
|
|
8944
|
+
rowSpacing
|
|
8945
|
+
} = ownerState;
|
|
8946
|
+
let styles = {};
|
|
8947
|
+
if (container && rowSpacing !== 0) {
|
|
8948
|
+
const rowSpacingValues = resolveBreakpointValues({
|
|
8949
|
+
values: rowSpacing,
|
|
8950
|
+
breakpoints: theme.breakpoints.values
|
|
8951
|
+
});
|
|
8952
|
+
let zeroValueBreakpointKeys;
|
|
8953
|
+
if (typeof rowSpacingValues === 'object') {
|
|
8954
|
+
zeroValueBreakpointKeys = extractZeroValueBreakpointKeys({
|
|
8955
|
+
breakpoints: theme.breakpoints.values,
|
|
8956
|
+
values: rowSpacingValues
|
|
8957
|
+
});
|
|
8958
|
+
}
|
|
8959
|
+
styles = handleBreakpoints({
|
|
8960
|
+
theme
|
|
8961
|
+
}, rowSpacingValues, (propValue, breakpoint) => {
|
|
8962
|
+
var _zeroValueBreakpointK;
|
|
8963
|
+
const themeSpacing = theme.spacing(propValue);
|
|
8964
|
+
if (themeSpacing !== '0px') {
|
|
8965
|
+
return {
|
|
8966
|
+
marginTop: `-${getOffset(themeSpacing)}`,
|
|
8967
|
+
[`& > .${gridClasses.item}`]: {
|
|
8968
|
+
paddingTop: getOffset(themeSpacing)
|
|
8969
|
+
}
|
|
8970
|
+
};
|
|
8971
|
+
}
|
|
8972
|
+
if ((_zeroValueBreakpointK = zeroValueBreakpointKeys) != null && _zeroValueBreakpointK.includes(breakpoint)) {
|
|
8973
|
+
return {};
|
|
8974
|
+
}
|
|
8975
|
+
return {
|
|
8976
|
+
marginTop: 0,
|
|
8977
|
+
[`& > .${gridClasses.item}`]: {
|
|
8978
|
+
paddingTop: 0
|
|
8979
|
+
}
|
|
8980
|
+
};
|
|
8981
|
+
});
|
|
8982
|
+
}
|
|
8983
|
+
return styles;
|
|
8984
|
+
}
|
|
8985
|
+
function generateColumnGap({
|
|
8986
|
+
theme,
|
|
8987
|
+
ownerState
|
|
8988
|
+
}) {
|
|
8989
|
+
const {
|
|
8990
|
+
container,
|
|
8991
|
+
columnSpacing
|
|
8992
|
+
} = ownerState;
|
|
8993
|
+
let styles = {};
|
|
8994
|
+
if (container && columnSpacing !== 0) {
|
|
8995
|
+
const columnSpacingValues = resolveBreakpointValues({
|
|
8996
|
+
values: columnSpacing,
|
|
8997
|
+
breakpoints: theme.breakpoints.values
|
|
8998
|
+
});
|
|
8999
|
+
let zeroValueBreakpointKeys;
|
|
9000
|
+
if (typeof columnSpacingValues === 'object') {
|
|
9001
|
+
zeroValueBreakpointKeys = extractZeroValueBreakpointKeys({
|
|
9002
|
+
breakpoints: theme.breakpoints.values,
|
|
9003
|
+
values: columnSpacingValues
|
|
9004
|
+
});
|
|
9005
|
+
}
|
|
9006
|
+
styles = handleBreakpoints({
|
|
9007
|
+
theme
|
|
9008
|
+
}, columnSpacingValues, (propValue, breakpoint) => {
|
|
9009
|
+
var _zeroValueBreakpointK2;
|
|
9010
|
+
const themeSpacing = theme.spacing(propValue);
|
|
9011
|
+
if (themeSpacing !== '0px') {
|
|
9012
|
+
return {
|
|
9013
|
+
width: `calc(100% + ${getOffset(themeSpacing)})`,
|
|
9014
|
+
marginLeft: `-${getOffset(themeSpacing)}`,
|
|
9015
|
+
[`& > .${gridClasses.item}`]: {
|
|
9016
|
+
paddingLeft: getOffset(themeSpacing)
|
|
9017
|
+
}
|
|
9018
|
+
};
|
|
9019
|
+
}
|
|
9020
|
+
if ((_zeroValueBreakpointK2 = zeroValueBreakpointKeys) != null && _zeroValueBreakpointK2.includes(breakpoint)) {
|
|
9021
|
+
return {};
|
|
9022
|
+
}
|
|
9023
|
+
return {
|
|
9024
|
+
width: '100%',
|
|
9025
|
+
marginLeft: 0,
|
|
9026
|
+
[`& > .${gridClasses.item}`]: {
|
|
9027
|
+
paddingLeft: 0
|
|
9028
|
+
}
|
|
9029
|
+
};
|
|
9030
|
+
});
|
|
9031
|
+
}
|
|
9032
|
+
return styles;
|
|
9033
|
+
}
|
|
9034
|
+
function resolveSpacingStyles(spacing, breakpoints, styles = {}) {
|
|
9035
|
+
// undefined/null or `spacing` <= 0
|
|
9036
|
+
if (!spacing || spacing <= 0) {
|
|
9037
|
+
return [];
|
|
9038
|
+
}
|
|
9039
|
+
// in case of string/number `spacing`
|
|
9040
|
+
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
9041
|
+
return [styles[`spacing-xs-${String(spacing)}`]];
|
|
9042
|
+
}
|
|
9043
|
+
// in case of object `spacing`
|
|
9044
|
+
const spacingStyles = [];
|
|
9045
|
+
breakpoints.forEach(breakpoint => {
|
|
9046
|
+
const value = spacing[breakpoint];
|
|
9047
|
+
if (Number(value) > 0) {
|
|
9048
|
+
spacingStyles.push(styles[`spacing-${breakpoint}-${String(value)}`]);
|
|
9049
|
+
}
|
|
9050
|
+
});
|
|
9051
|
+
return spacingStyles;
|
|
9052
|
+
}
|
|
9053
|
+
|
|
9054
|
+
// Default CSS values
|
|
9055
|
+
// flex: '0 1 auto',
|
|
9056
|
+
// flexDirection: 'row',
|
|
9057
|
+
// alignItems: 'flex-start',
|
|
9058
|
+
// flexWrap: 'nowrap',
|
|
9059
|
+
// justifyContent: 'flex-start',
|
|
9060
|
+
const GridRoot = styled$1('div', {
|
|
9061
|
+
name: 'MuiGrid',
|
|
9062
|
+
slot: 'Root',
|
|
9063
|
+
overridesResolver: (props, styles) => {
|
|
9064
|
+
const {
|
|
9065
|
+
ownerState
|
|
9066
|
+
} = props;
|
|
9067
|
+
const {
|
|
9068
|
+
container,
|
|
9069
|
+
direction,
|
|
9070
|
+
item,
|
|
9071
|
+
spacing,
|
|
9072
|
+
wrap,
|
|
9073
|
+
zeroMinWidth,
|
|
9074
|
+
breakpoints
|
|
9075
|
+
} = ownerState;
|
|
9076
|
+
let spacingStyles = [];
|
|
9077
|
+
|
|
9078
|
+
// in case of grid item
|
|
9079
|
+
if (container) {
|
|
9080
|
+
spacingStyles = resolveSpacingStyles(spacing, breakpoints, styles);
|
|
9081
|
+
}
|
|
9082
|
+
const breakpointsStyles = [];
|
|
9083
|
+
breakpoints.forEach(breakpoint => {
|
|
9084
|
+
const value = ownerState[breakpoint];
|
|
9085
|
+
if (value) {
|
|
9086
|
+
breakpointsStyles.push(styles[`grid-${breakpoint}-${String(value)}`]);
|
|
9087
|
+
}
|
|
9088
|
+
});
|
|
9089
|
+
return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth, ...spacingStyles, direction !== 'row' && styles[`direction-xs-${String(direction)}`], wrap !== 'wrap' && styles[`wrap-xs-${String(wrap)}`], ...breakpointsStyles];
|
|
9090
|
+
}
|
|
9091
|
+
})(({
|
|
9092
|
+
ownerState
|
|
9093
|
+
}) => _extends({
|
|
9094
|
+
boxSizing: 'border-box'
|
|
9095
|
+
}, ownerState.container && {
|
|
9096
|
+
display: 'flex',
|
|
9097
|
+
flexWrap: 'wrap',
|
|
9098
|
+
width: '100%'
|
|
9099
|
+
}, ownerState.item && {
|
|
9100
|
+
margin: 0 // For instance, it's useful when used with a `figure` element.
|
|
9101
|
+
}, ownerState.zeroMinWidth && {
|
|
9102
|
+
minWidth: 0
|
|
9103
|
+
}, ownerState.wrap !== 'wrap' && {
|
|
9104
|
+
flexWrap: ownerState.wrap
|
|
9105
|
+
}), generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
9106
|
+
function resolveSpacingClasses(spacing, breakpoints) {
|
|
9107
|
+
// undefined/null or `spacing` <= 0
|
|
9108
|
+
if (!spacing || spacing <= 0) {
|
|
9109
|
+
return [];
|
|
9110
|
+
}
|
|
9111
|
+
// in case of string/number `spacing`
|
|
9112
|
+
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
9113
|
+
return [`spacing-xs-${String(spacing)}`];
|
|
9114
|
+
}
|
|
9115
|
+
// in case of object `spacing`
|
|
9116
|
+
const classes = [];
|
|
9117
|
+
breakpoints.forEach(breakpoint => {
|
|
9118
|
+
const value = spacing[breakpoint];
|
|
9119
|
+
if (Number(value) > 0) {
|
|
9120
|
+
const className = `spacing-${breakpoint}-${String(value)}`;
|
|
9121
|
+
classes.push(className);
|
|
9122
|
+
}
|
|
9123
|
+
});
|
|
9124
|
+
return classes;
|
|
9125
|
+
}
|
|
9126
|
+
const useUtilityClasses = ownerState => {
|
|
9127
|
+
const {
|
|
9128
|
+
classes,
|
|
9129
|
+
container,
|
|
9130
|
+
direction,
|
|
9131
|
+
item,
|
|
9132
|
+
spacing,
|
|
9133
|
+
wrap,
|
|
9134
|
+
zeroMinWidth,
|
|
9135
|
+
breakpoints
|
|
9136
|
+
} = ownerState;
|
|
9137
|
+
let spacingClasses = [];
|
|
9138
|
+
|
|
9139
|
+
// in case of grid item
|
|
9140
|
+
if (container) {
|
|
9141
|
+
spacingClasses = resolveSpacingClasses(spacing, breakpoints);
|
|
9142
|
+
}
|
|
9143
|
+
const breakpointsClasses = [];
|
|
9144
|
+
breakpoints.forEach(breakpoint => {
|
|
9145
|
+
const value = ownerState[breakpoint];
|
|
9146
|
+
if (value) {
|
|
9147
|
+
breakpointsClasses.push(`grid-${breakpoint}-${String(value)}`);
|
|
9148
|
+
}
|
|
9149
|
+
});
|
|
9150
|
+
const slots = {
|
|
9151
|
+
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth', ...spacingClasses, direction !== 'row' && `direction-xs-${String(direction)}`, wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...breakpointsClasses]
|
|
9152
|
+
};
|
|
9153
|
+
return composeClasses(slots, getGridUtilityClass, classes);
|
|
9154
|
+
};
|
|
9155
|
+
const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
9156
|
+
const themeProps = useThemeProps({
|
|
9157
|
+
props: inProps,
|
|
9158
|
+
name: 'MuiGrid'
|
|
9159
|
+
});
|
|
9160
|
+
const {
|
|
9161
|
+
breakpoints
|
|
9162
|
+
} = useTheme();
|
|
9163
|
+
const props = extendSxProp(themeProps);
|
|
9164
|
+
const {
|
|
9165
|
+
className,
|
|
9166
|
+
columns: columnsProp,
|
|
9167
|
+
columnSpacing: columnSpacingProp,
|
|
9168
|
+
component = 'div',
|
|
9169
|
+
container = false,
|
|
9170
|
+
direction = 'row',
|
|
9171
|
+
item = false,
|
|
9172
|
+
rowSpacing: rowSpacingProp,
|
|
9173
|
+
spacing = 0,
|
|
9174
|
+
wrap = 'wrap',
|
|
9175
|
+
zeroMinWidth = false
|
|
9176
|
+
} = props,
|
|
9177
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
9178
|
+
const rowSpacing = rowSpacingProp || spacing;
|
|
9179
|
+
const columnSpacing = columnSpacingProp || spacing;
|
|
9180
|
+
const columnsContext = React.useContext(GridContext$1);
|
|
9181
|
+
|
|
9182
|
+
// columns set with default breakpoint unit of 12
|
|
9183
|
+
const columns = container ? columnsProp || 12 : columnsContext;
|
|
9184
|
+
const breakpointsValues = {};
|
|
9185
|
+
const otherFiltered = _extends({}, other);
|
|
9186
|
+
breakpoints.keys.forEach(breakpoint => {
|
|
9187
|
+
if (other[breakpoint] != null) {
|
|
9188
|
+
breakpointsValues[breakpoint] = other[breakpoint];
|
|
9189
|
+
delete otherFiltered[breakpoint];
|
|
9190
|
+
}
|
|
9191
|
+
});
|
|
9192
|
+
const ownerState = _extends({}, props, {
|
|
9193
|
+
columns,
|
|
9194
|
+
container,
|
|
9195
|
+
direction,
|
|
9196
|
+
item,
|
|
9197
|
+
rowSpacing,
|
|
9198
|
+
columnSpacing,
|
|
9199
|
+
wrap,
|
|
9200
|
+
zeroMinWidth,
|
|
9201
|
+
spacing
|
|
9202
|
+
}, breakpointsValues, {
|
|
9203
|
+
breakpoints: breakpoints.keys
|
|
9204
|
+
});
|
|
9205
|
+
const classes = useUtilityClasses(ownerState);
|
|
9206
|
+
return /*#__PURE__*/jsx(GridContext$1.Provider, {
|
|
9207
|
+
value: columns,
|
|
9208
|
+
children: /*#__PURE__*/jsx(GridRoot, _extends({
|
|
9209
|
+
ownerState: ownerState,
|
|
9210
|
+
className: clsx(classes.root, className),
|
|
9211
|
+
as: component,
|
|
9212
|
+
ref: ref
|
|
9213
|
+
}, otherFiltered))
|
|
9214
|
+
});
|
|
9215
|
+
});
|
|
9216
|
+
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
|
|
9217
|
+
// ----------------------------- Warning --------------------------------
|
|
9218
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
9219
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
9220
|
+
// ----------------------------------------------------------------------
|
|
9221
|
+
/**
|
|
9222
|
+
* The content of the component.
|
|
9223
|
+
*/
|
|
9224
|
+
children: PropTypes.node,
|
|
9225
|
+
/**
|
|
9226
|
+
* Override or extend the styles applied to the component.
|
|
9227
|
+
*/
|
|
9228
|
+
classes: PropTypes.object,
|
|
9229
|
+
/**
|
|
9230
|
+
* @ignore
|
|
9231
|
+
*/
|
|
9232
|
+
className: PropTypes.string,
|
|
9233
|
+
/**
|
|
9234
|
+
* The number of columns.
|
|
9235
|
+
* @default 12
|
|
9236
|
+
*/
|
|
9237
|
+
columns: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
|
|
9238
|
+
/**
|
|
9239
|
+
* Defines the horizontal space between the type `item` components.
|
|
9240
|
+
* It overrides the value of the `spacing` prop.
|
|
9241
|
+
*/
|
|
9242
|
+
columnSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
9243
|
+
/**
|
|
9244
|
+
* The component used for the root node.
|
|
9245
|
+
* Either a string to use a HTML element or a component.
|
|
9246
|
+
*/
|
|
9247
|
+
component: PropTypes.elementType,
|
|
9248
|
+
/**
|
|
9249
|
+
* If `true`, the component will have the flex *container* behavior.
|
|
9250
|
+
* You should be wrapping *items* with a *container*.
|
|
9251
|
+
* @default false
|
|
9252
|
+
*/
|
|
9253
|
+
container: PropTypes.bool,
|
|
9254
|
+
/**
|
|
9255
|
+
* Defines the `flex-direction` style property.
|
|
9256
|
+
* It is applied for all screen sizes.
|
|
9257
|
+
* @default 'row'
|
|
9258
|
+
*/
|
|
9259
|
+
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
9260
|
+
/**
|
|
9261
|
+
* If `true`, the component will have the flex *item* behavior.
|
|
9262
|
+
* You should be wrapping *items* with a *container*.
|
|
9263
|
+
* @default false
|
|
9264
|
+
*/
|
|
9265
|
+
item: PropTypes.bool,
|
|
9266
|
+
/**
|
|
9267
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
9268
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
9269
|
+
* If 'auto', the grid item's width matches its content.
|
|
9270
|
+
* If false, the prop is ignored.
|
|
9271
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
9272
|
+
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
9273
|
+
* @default false
|
|
9274
|
+
*/
|
|
9275
|
+
lg: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
9276
|
+
/**
|
|
9277
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
9278
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
9279
|
+
* If 'auto', the grid item's width matches its content.
|
|
9280
|
+
* If false, the prop is ignored.
|
|
9281
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
9282
|
+
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
9283
|
+
* @default false
|
|
9284
|
+
*/
|
|
9285
|
+
md: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
9286
|
+
/**
|
|
9287
|
+
* Defines the vertical space between the type `item` components.
|
|
9288
|
+
* It overrides the value of the `spacing` prop.
|
|
9289
|
+
*/
|
|
9290
|
+
rowSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
9291
|
+
/**
|
|
9292
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
9293
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
9294
|
+
* If 'auto', the grid item's width matches its content.
|
|
9295
|
+
* If false, the prop is ignored.
|
|
9296
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
9297
|
+
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
9298
|
+
* @default false
|
|
9299
|
+
*/
|
|
9300
|
+
sm: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
9301
|
+
/**
|
|
9302
|
+
* Defines the space between the type `item` components.
|
|
9303
|
+
* It can only be used on a type `container` component.
|
|
9304
|
+
* @default 0
|
|
9305
|
+
*/
|
|
9306
|
+
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
9307
|
+
/**
|
|
9308
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
9309
|
+
*/
|
|
9310
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
9311
|
+
/**
|
|
9312
|
+
* Defines the `flex-wrap` style property.
|
|
9313
|
+
* It's applied for all screen sizes.
|
|
9314
|
+
* @default 'wrap'
|
|
9315
|
+
*/
|
|
9316
|
+
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
|
|
9317
|
+
/**
|
|
9318
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
9319
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
9320
|
+
* If 'auto', the grid item's width matches its content.
|
|
9321
|
+
* If false, the prop is ignored.
|
|
9322
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
9323
|
+
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
9324
|
+
* @default false
|
|
9325
|
+
*/
|
|
9326
|
+
xl: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
9327
|
+
/**
|
|
9328
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
9329
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
9330
|
+
* If 'auto', the grid item's width matches its content.
|
|
9331
|
+
* If false, the prop is ignored.
|
|
9332
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
9333
|
+
* The value is applied for all the screen sizes with the lowest priority.
|
|
9334
|
+
* @default false
|
|
9335
|
+
*/
|
|
9336
|
+
xs: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
9337
|
+
/**
|
|
9338
|
+
* If `true`, it sets `min-width: 0` on the item.
|
|
9339
|
+
* Refer to the limitations section of the documentation to better understand the use case.
|
|
9340
|
+
* @default false
|
|
9341
|
+
*/
|
|
9342
|
+
zeroMinWidth: PropTypes.bool
|
|
9343
|
+
} : void 0;
|
|
9344
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9345
|
+
const requireProp = requirePropFactory('Grid', Grid);
|
|
9346
|
+
// eslint-disable-next-line no-useless-concat
|
|
9347
|
+
Grid['propTypes' + ''] = _extends({}, Grid.propTypes, {
|
|
9348
|
+
direction: requireProp('container'),
|
|
9349
|
+
lg: requireProp('item'),
|
|
9350
|
+
md: requireProp('item'),
|
|
9351
|
+
sm: requireProp('item'),
|
|
9352
|
+
spacing: requireProp('container'),
|
|
9353
|
+
wrap: requireProp('container'),
|
|
9354
|
+
xs: requireProp('item'),
|
|
9355
|
+
zeroMinWidth: requireProp('item')
|
|
9356
|
+
});
|
|
9357
|
+
}
|
|
9358
|
+
var Grid$1 = Grid;
|
|
9359
|
+
|
|
8715
9360
|
const LegendLayout = ({
|
|
8716
9361
|
title,
|
|
8717
9362
|
name,
|
|
@@ -8912,6 +9557,64 @@ const Legend = ({
|
|
|
8912
9557
|
}));
|
|
8913
9558
|
};
|
|
8914
9559
|
|
|
9560
|
+
const LegendDialog = ({
|
|
9561
|
+
layers,
|
|
9562
|
+
isOpen,
|
|
9563
|
+
onClose,
|
|
9564
|
+
onMouseDown: _onMouseDown = () => {},
|
|
9565
|
+
mapId,
|
|
9566
|
+
showMapId: _showMapId = false,
|
|
9567
|
+
order: _order = 0,
|
|
9568
|
+
source: _source = 'app'
|
|
9569
|
+
}) => {
|
|
9570
|
+
return jsx(ToolContainerDraggable, Object.assign({
|
|
9571
|
+
startPosition: {
|
|
9572
|
+
right: 20,
|
|
9573
|
+
top: 50
|
|
9574
|
+
},
|
|
9575
|
+
minWidth: 100,
|
|
9576
|
+
onClose: onClose,
|
|
9577
|
+
title: _showMapId ? `Legend ${mapId}` : 'Legend',
|
|
9578
|
+
initialMaxHeight: 440,
|
|
9579
|
+
isOpen: isOpen,
|
|
9580
|
+
"data-testid": "moveable-legend",
|
|
9581
|
+
bounds: "parent",
|
|
9582
|
+
onMouseDown: _onMouseDown,
|
|
9583
|
+
order: _order,
|
|
9584
|
+
source: _source
|
|
9585
|
+
}, {
|
|
9586
|
+
children: jsx(Box$1, Object.assign({
|
|
9587
|
+
sx: {
|
|
9588
|
+
padding: 0.5
|
|
9589
|
+
}
|
|
9590
|
+
}, {
|
|
9591
|
+
children: layers && layers.length > 0 ? jsx(Box$1, Object.assign({
|
|
9592
|
+
"data-testid": "LegendList",
|
|
9593
|
+
sx: {
|
|
9594
|
+
display: 'flex',
|
|
9595
|
+
flexDirection: 'column',
|
|
9596
|
+
'&>div:last-child': {
|
|
9597
|
+
marginBottom: 0
|
|
9598
|
+
}
|
|
9599
|
+
}
|
|
9600
|
+
}, {
|
|
9601
|
+
children: layers.map(layer => jsx(Legend, {
|
|
9602
|
+
layer: layer
|
|
9603
|
+
}, layer.id))
|
|
9604
|
+
})) : jsx(Typography$1, Object.assign({
|
|
9605
|
+
"data-testid": "NoLayers",
|
|
9606
|
+
variant: "body1",
|
|
9607
|
+
style: {
|
|
9608
|
+
fontWeight: 500,
|
|
9609
|
+
fontSize: 14
|
|
9610
|
+
}
|
|
9611
|
+
}, {
|
|
9612
|
+
children: "No layers"
|
|
9613
|
+
}))
|
|
9614
|
+
}))
|
|
9615
|
+
}));
|
|
9616
|
+
};
|
|
9617
|
+
|
|
8915
9618
|
var wellKnownSymbol$3 = wellKnownSymbol$a;
|
|
8916
9619
|
|
|
8917
9620
|
var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
|
|
@@ -9003,8 +9706,8 @@ var trim = stringTrim.trim;
|
|
|
9003
9706
|
var whitespaces = whitespaces$2;
|
|
9004
9707
|
|
|
9005
9708
|
var $parseInt$1 = global$5.parseInt;
|
|
9006
|
-
var Symbol$
|
|
9007
|
-
var ITERATOR = Symbol$
|
|
9709
|
+
var Symbol$4 = global$5.Symbol;
|
|
9710
|
+
var ITERATOR = Symbol$4 && Symbol$4.iterator;
|
|
9008
9711
|
var hex = /^[+-]?0x/i;
|
|
9009
9712
|
var exec$1 = uncurryThis$7(hex.exec);
|
|
9010
9713
|
var FORCED$1 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
|
@@ -33806,7 +34509,7 @@ function isNumber(num) {
|
|
|
33806
34509
|
* turf.isObject('foo')
|
|
33807
34510
|
* //=false
|
|
33808
34511
|
*/
|
|
33809
|
-
function isObject(input) {
|
|
34512
|
+
function isObject$4(input) {
|
|
33810
34513
|
return !!input && input.constructor === Object;
|
|
33811
34514
|
}
|
|
33812
34515
|
|
|
@@ -34659,7 +35362,7 @@ function simplify(points, tolerance, highestQuality) {
|
|
|
34659
35362
|
function simplify$1(geojson, options) {
|
|
34660
35363
|
// Optional parameters
|
|
34661
35364
|
options = options || {};
|
|
34662
|
-
if (!isObject(options)) throw new Error("options is invalid");
|
|
35365
|
+
if (!isObject$4(options)) throw new Error("options is invalid");
|
|
34663
35366
|
var tolerance = options.tolerance !== undefined ? options.tolerance : 1;
|
|
34664
35367
|
var highQuality = options.highQuality || false;
|
|
34665
35368
|
var mutate = options.mutate || false;
|
|
@@ -40474,7 +41177,7 @@ const ReactMapViewLayer = props => {
|
|
|
40474
41177
|
*
|
|
40475
41178
|
* @returns {Function} A new, throttled, function.
|
|
40476
41179
|
*/
|
|
40477
|
-
function throttle (delay, callback, options) {
|
|
41180
|
+
function throttle$1 (delay, callback, options) {
|
|
40478
41181
|
var _ref = options || {},
|
|
40479
41182
|
_ref$noTrailing = _ref.noTrailing,
|
|
40480
41183
|
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
|
|
@@ -40611,12 +41314,12 @@ function throttle (delay, callback, options) {
|
|
|
40611
41314
|
* @returns {Function} A new, debounced function.
|
|
40612
41315
|
*/
|
|
40613
41316
|
|
|
40614
|
-
function debounce (delay, callback, options) {
|
|
41317
|
+
function debounce$2 (delay, callback, options) {
|
|
40615
41318
|
var _ref = options || {},
|
|
40616
41319
|
_ref$atBegin = _ref.atBegin,
|
|
40617
41320
|
atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
|
|
40618
41321
|
|
|
40619
|
-
return throttle(delay, callback, {
|
|
41322
|
+
return throttle$1(delay, callback, {
|
|
40620
41323
|
debounceMode: atBegin !== false
|
|
40621
41324
|
});
|
|
40622
41325
|
}
|
|
@@ -41104,7 +41807,7 @@ class ReactMapView extends React.Component {
|
|
|
41104
41807
|
};
|
|
41105
41808
|
this.resize = this.resize.bind(this);
|
|
41106
41809
|
this.handleWindowResize = this.handleWindowResize.bind(this);
|
|
41107
|
-
this.drawDebounced = debounce(600, this.drawDebounced);
|
|
41810
|
+
this.drawDebounced = debounce$2(600, this.drawDebounced);
|
|
41108
41811
|
this.updateWMJSMapProps = this.updateWMJSMapProps.bind(this);
|
|
41109
41812
|
this.mountWMJSMap = this.mountWMJSMap.bind(this);
|
|
41110
41813
|
this.onAfterSetBBoxListener = this.onAfterSetBBoxListener.bind(this);
|
|
@@ -41312,6 +42015,7 @@ class ReactMapView extends React.Component {
|
|
|
41312
42015
|
const myChildren = [];
|
|
41313
42016
|
const takenIds = new Set();
|
|
41314
42017
|
React.Children.forEach(children, child => {
|
|
42018
|
+
var _a;
|
|
41315
42019
|
if (child) {
|
|
41316
42020
|
const {
|
|
41317
42021
|
props: childProps
|
|
@@ -41321,7 +42025,7 @@ class ReactMapView extends React.Component {
|
|
|
41321
42025
|
myChildren.push(child);
|
|
41322
42026
|
takenIds.add(childProps.id);
|
|
41323
42027
|
} else {
|
|
41324
|
-
childProps.onLayerError(childProps, new Error(`Duplicate layer id "${childProps.id}" encountered within this mapTypes.WebMap`), wmjsMap);
|
|
42028
|
+
(_a = childProps.onLayerError) === null || _a === void 0 ? void 0 : _a.call(childProps, childProps, new Error(`Duplicate layer id "${childProps.id}" encountered within this mapTypes.WebMap`), wmjsMap);
|
|
41325
42029
|
console.warn('ReactWMJSLayer has a duplicate id', child);
|
|
41326
42030
|
}
|
|
41327
42031
|
} else {
|
|
@@ -41690,6 +42394,1173 @@ ReactMapView.defaultProps = {
|
|
|
41690
42394
|
}
|
|
41691
42395
|
};
|
|
41692
42396
|
|
|
42397
|
+
/******************************************************************************
|
|
42398
|
+
Copyright (c) Microsoft Corporation.
|
|
42399
|
+
|
|
42400
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
42401
|
+
purpose with or without fee is hereby granted.
|
|
42402
|
+
|
|
42403
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
42404
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
42405
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
42406
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
42407
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
42408
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
42409
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
42410
|
+
***************************************************************************** */
|
|
42411
|
+
|
|
42412
|
+
function __rest$1(s, e) {
|
|
42413
|
+
var t = {};
|
|
42414
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
42415
|
+
t[p] = s[p];
|
|
42416
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
42417
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42418
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42419
|
+
t[p[i]] = s[p[i]];
|
|
42420
|
+
}
|
|
42421
|
+
return t;
|
|
42422
|
+
}
|
|
42423
|
+
|
|
42424
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
42425
|
+
var e = new Error(message);
|
|
42426
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
42427
|
+
};
|
|
42428
|
+
|
|
42429
|
+
/**
|
|
42430
|
+
* Checks if `value` is the
|
|
42431
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
42432
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
42433
|
+
*
|
|
42434
|
+
* @static
|
|
42435
|
+
* @memberOf _
|
|
42436
|
+
* @since 0.1.0
|
|
42437
|
+
* @category Lang
|
|
42438
|
+
* @param {*} value The value to check.
|
|
42439
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
42440
|
+
* @example
|
|
42441
|
+
*
|
|
42442
|
+
* _.isObject({});
|
|
42443
|
+
* // => true
|
|
42444
|
+
*
|
|
42445
|
+
* _.isObject([1, 2, 3]);
|
|
42446
|
+
* // => true
|
|
42447
|
+
*
|
|
42448
|
+
* _.isObject(_.noop);
|
|
42449
|
+
* // => true
|
|
42450
|
+
*
|
|
42451
|
+
* _.isObject(null);
|
|
42452
|
+
* // => false
|
|
42453
|
+
*/
|
|
42454
|
+
|
|
42455
|
+
function isObject$3(value) {
|
|
42456
|
+
var type = typeof value;
|
|
42457
|
+
return value != null && (type == 'object' || type == 'function');
|
|
42458
|
+
}
|
|
42459
|
+
|
|
42460
|
+
var isObject_1 = isObject$3;
|
|
42461
|
+
|
|
42462
|
+
/** Detect free variable `global` from Node.js. */
|
|
42463
|
+
|
|
42464
|
+
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
42465
|
+
|
|
42466
|
+
var _freeGlobal = freeGlobal$1;
|
|
42467
|
+
|
|
42468
|
+
var freeGlobal = _freeGlobal;
|
|
42469
|
+
|
|
42470
|
+
/** Detect free variable `self`. */
|
|
42471
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
42472
|
+
|
|
42473
|
+
/** Used as a reference to the global object. */
|
|
42474
|
+
var root$2 = freeGlobal || freeSelf || Function('return this')();
|
|
42475
|
+
|
|
42476
|
+
var _root = root$2;
|
|
42477
|
+
|
|
42478
|
+
var root$1 = _root;
|
|
42479
|
+
|
|
42480
|
+
/**
|
|
42481
|
+
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
42482
|
+
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
42483
|
+
*
|
|
42484
|
+
* @static
|
|
42485
|
+
* @memberOf _
|
|
42486
|
+
* @since 2.4.0
|
|
42487
|
+
* @category Date
|
|
42488
|
+
* @returns {number} Returns the timestamp.
|
|
42489
|
+
* @example
|
|
42490
|
+
*
|
|
42491
|
+
* _.defer(function(stamp) {
|
|
42492
|
+
* console.log(_.now() - stamp);
|
|
42493
|
+
* }, _.now());
|
|
42494
|
+
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
42495
|
+
*/
|
|
42496
|
+
var now$1 = function() {
|
|
42497
|
+
return root$1.Date.now();
|
|
42498
|
+
};
|
|
42499
|
+
|
|
42500
|
+
var now_1 = now$1;
|
|
42501
|
+
|
|
42502
|
+
/** Used to match a single whitespace character. */
|
|
42503
|
+
|
|
42504
|
+
var reWhitespace = /\s/;
|
|
42505
|
+
|
|
42506
|
+
/**
|
|
42507
|
+
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
|
42508
|
+
* character of `string`.
|
|
42509
|
+
*
|
|
42510
|
+
* @private
|
|
42511
|
+
* @param {string} string The string to inspect.
|
|
42512
|
+
* @returns {number} Returns the index of the last non-whitespace character.
|
|
42513
|
+
*/
|
|
42514
|
+
function trimmedEndIndex$1(string) {
|
|
42515
|
+
var index = string.length;
|
|
42516
|
+
|
|
42517
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
|
42518
|
+
return index;
|
|
42519
|
+
}
|
|
42520
|
+
|
|
42521
|
+
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
42522
|
+
|
|
42523
|
+
var trimmedEndIndex = _trimmedEndIndex;
|
|
42524
|
+
|
|
42525
|
+
/** Used to match leading whitespace. */
|
|
42526
|
+
var reTrimStart = /^\s+/;
|
|
42527
|
+
|
|
42528
|
+
/**
|
|
42529
|
+
* The base implementation of `_.trim`.
|
|
42530
|
+
*
|
|
42531
|
+
* @private
|
|
42532
|
+
* @param {string} string The string to trim.
|
|
42533
|
+
* @returns {string} Returns the trimmed string.
|
|
42534
|
+
*/
|
|
42535
|
+
function baseTrim$1(string) {
|
|
42536
|
+
return string
|
|
42537
|
+
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
|
42538
|
+
: string;
|
|
42539
|
+
}
|
|
42540
|
+
|
|
42541
|
+
var _baseTrim = baseTrim$1;
|
|
42542
|
+
|
|
42543
|
+
var root = _root;
|
|
42544
|
+
|
|
42545
|
+
/** Built-in value references. */
|
|
42546
|
+
var Symbol$3 = root.Symbol;
|
|
42547
|
+
|
|
42548
|
+
var _Symbol = Symbol$3;
|
|
42549
|
+
|
|
42550
|
+
var Symbol$2 = _Symbol;
|
|
42551
|
+
|
|
42552
|
+
/** Used for built-in method references. */
|
|
42553
|
+
var objectProto$1 = Object.prototype;
|
|
42554
|
+
|
|
42555
|
+
/** Used to check objects for own properties. */
|
|
42556
|
+
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
42557
|
+
|
|
42558
|
+
/**
|
|
42559
|
+
* Used to resolve the
|
|
42560
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
42561
|
+
* of values.
|
|
42562
|
+
*/
|
|
42563
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
42564
|
+
|
|
42565
|
+
/** Built-in value references. */
|
|
42566
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
42567
|
+
|
|
42568
|
+
/**
|
|
42569
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
42570
|
+
*
|
|
42571
|
+
* @private
|
|
42572
|
+
* @param {*} value The value to query.
|
|
42573
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
42574
|
+
*/
|
|
42575
|
+
function getRawTag$1(value) {
|
|
42576
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
42577
|
+
tag = value[symToStringTag$1];
|
|
42578
|
+
|
|
42579
|
+
try {
|
|
42580
|
+
value[symToStringTag$1] = undefined;
|
|
42581
|
+
var unmasked = true;
|
|
42582
|
+
} catch (e) {}
|
|
42583
|
+
|
|
42584
|
+
var result = nativeObjectToString$1.call(value);
|
|
42585
|
+
if (unmasked) {
|
|
42586
|
+
if (isOwn) {
|
|
42587
|
+
value[symToStringTag$1] = tag;
|
|
42588
|
+
} else {
|
|
42589
|
+
delete value[symToStringTag$1];
|
|
42590
|
+
}
|
|
42591
|
+
}
|
|
42592
|
+
return result;
|
|
42593
|
+
}
|
|
42594
|
+
|
|
42595
|
+
var _getRawTag = getRawTag$1;
|
|
42596
|
+
|
|
42597
|
+
/** Used for built-in method references. */
|
|
42598
|
+
|
|
42599
|
+
var objectProto = Object.prototype;
|
|
42600
|
+
|
|
42601
|
+
/**
|
|
42602
|
+
* Used to resolve the
|
|
42603
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
42604
|
+
* of values.
|
|
42605
|
+
*/
|
|
42606
|
+
var nativeObjectToString = objectProto.toString;
|
|
42607
|
+
|
|
42608
|
+
/**
|
|
42609
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
42610
|
+
*
|
|
42611
|
+
* @private
|
|
42612
|
+
* @param {*} value The value to convert.
|
|
42613
|
+
* @returns {string} Returns the converted string.
|
|
42614
|
+
*/
|
|
42615
|
+
function objectToString$1(value) {
|
|
42616
|
+
return nativeObjectToString.call(value);
|
|
42617
|
+
}
|
|
42618
|
+
|
|
42619
|
+
var _objectToString = objectToString$1;
|
|
42620
|
+
|
|
42621
|
+
var Symbol$1 = _Symbol,
|
|
42622
|
+
getRawTag = _getRawTag,
|
|
42623
|
+
objectToString = _objectToString;
|
|
42624
|
+
|
|
42625
|
+
/** `Object#toString` result references. */
|
|
42626
|
+
var nullTag = '[object Null]',
|
|
42627
|
+
undefinedTag = '[object Undefined]';
|
|
42628
|
+
|
|
42629
|
+
/** Built-in value references. */
|
|
42630
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
42631
|
+
|
|
42632
|
+
/**
|
|
42633
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
42634
|
+
*
|
|
42635
|
+
* @private
|
|
42636
|
+
* @param {*} value The value to query.
|
|
42637
|
+
* @returns {string} Returns the `toStringTag`.
|
|
42638
|
+
*/
|
|
42639
|
+
function baseGetTag$1(value) {
|
|
42640
|
+
if (value == null) {
|
|
42641
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
42642
|
+
}
|
|
42643
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
42644
|
+
? getRawTag(value)
|
|
42645
|
+
: objectToString(value);
|
|
42646
|
+
}
|
|
42647
|
+
|
|
42648
|
+
var _baseGetTag = baseGetTag$1;
|
|
42649
|
+
|
|
42650
|
+
/**
|
|
42651
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
42652
|
+
* and has a `typeof` result of "object".
|
|
42653
|
+
*
|
|
42654
|
+
* @static
|
|
42655
|
+
* @memberOf _
|
|
42656
|
+
* @since 4.0.0
|
|
42657
|
+
* @category Lang
|
|
42658
|
+
* @param {*} value The value to check.
|
|
42659
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
42660
|
+
* @example
|
|
42661
|
+
*
|
|
42662
|
+
* _.isObjectLike({});
|
|
42663
|
+
* // => true
|
|
42664
|
+
*
|
|
42665
|
+
* _.isObjectLike([1, 2, 3]);
|
|
42666
|
+
* // => true
|
|
42667
|
+
*
|
|
42668
|
+
* _.isObjectLike(_.noop);
|
|
42669
|
+
* // => false
|
|
42670
|
+
*
|
|
42671
|
+
* _.isObjectLike(null);
|
|
42672
|
+
* // => false
|
|
42673
|
+
*/
|
|
42674
|
+
|
|
42675
|
+
function isObjectLike$1(value) {
|
|
42676
|
+
return value != null && typeof value == 'object';
|
|
42677
|
+
}
|
|
42678
|
+
|
|
42679
|
+
var isObjectLike_1 = isObjectLike$1;
|
|
42680
|
+
|
|
42681
|
+
var baseGetTag = _baseGetTag,
|
|
42682
|
+
isObjectLike = isObjectLike_1;
|
|
42683
|
+
|
|
42684
|
+
/** `Object#toString` result references. */
|
|
42685
|
+
var symbolTag = '[object Symbol]';
|
|
42686
|
+
|
|
42687
|
+
/**
|
|
42688
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
42689
|
+
*
|
|
42690
|
+
* @static
|
|
42691
|
+
* @memberOf _
|
|
42692
|
+
* @since 4.0.0
|
|
42693
|
+
* @category Lang
|
|
42694
|
+
* @param {*} value The value to check.
|
|
42695
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
42696
|
+
* @example
|
|
42697
|
+
*
|
|
42698
|
+
* _.isSymbol(Symbol.iterator);
|
|
42699
|
+
* // => true
|
|
42700
|
+
*
|
|
42701
|
+
* _.isSymbol('abc');
|
|
42702
|
+
* // => false
|
|
42703
|
+
*/
|
|
42704
|
+
function isSymbol$1(value) {
|
|
42705
|
+
return typeof value == 'symbol' ||
|
|
42706
|
+
(isObjectLike(value) && baseGetTag(value) == symbolTag);
|
|
42707
|
+
}
|
|
42708
|
+
|
|
42709
|
+
var isSymbol_1 = isSymbol$1;
|
|
42710
|
+
|
|
42711
|
+
var baseTrim = _baseTrim,
|
|
42712
|
+
isObject$2 = isObject_1,
|
|
42713
|
+
isSymbol = isSymbol_1;
|
|
42714
|
+
|
|
42715
|
+
/** Used as references for various `Number` constants. */
|
|
42716
|
+
var NAN = 0 / 0;
|
|
42717
|
+
|
|
42718
|
+
/** Used to detect bad signed hexadecimal string values. */
|
|
42719
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
42720
|
+
|
|
42721
|
+
/** Used to detect binary string values. */
|
|
42722
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
42723
|
+
|
|
42724
|
+
/** Used to detect octal string values. */
|
|
42725
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
42726
|
+
|
|
42727
|
+
/** Built-in method references without a dependency on `root`. */
|
|
42728
|
+
var freeParseInt = parseInt;
|
|
42729
|
+
|
|
42730
|
+
/**
|
|
42731
|
+
* Converts `value` to a number.
|
|
42732
|
+
*
|
|
42733
|
+
* @static
|
|
42734
|
+
* @memberOf _
|
|
42735
|
+
* @since 4.0.0
|
|
42736
|
+
* @category Lang
|
|
42737
|
+
* @param {*} value The value to process.
|
|
42738
|
+
* @returns {number} Returns the number.
|
|
42739
|
+
* @example
|
|
42740
|
+
*
|
|
42741
|
+
* _.toNumber(3.2);
|
|
42742
|
+
* // => 3.2
|
|
42743
|
+
*
|
|
42744
|
+
* _.toNumber(Number.MIN_VALUE);
|
|
42745
|
+
* // => 5e-324
|
|
42746
|
+
*
|
|
42747
|
+
* _.toNumber(Infinity);
|
|
42748
|
+
* // => Infinity
|
|
42749
|
+
*
|
|
42750
|
+
* _.toNumber('3.2');
|
|
42751
|
+
* // => 3.2
|
|
42752
|
+
*/
|
|
42753
|
+
function toNumber$1(value) {
|
|
42754
|
+
if (typeof value == 'number') {
|
|
42755
|
+
return value;
|
|
42756
|
+
}
|
|
42757
|
+
if (isSymbol(value)) {
|
|
42758
|
+
return NAN;
|
|
42759
|
+
}
|
|
42760
|
+
if (isObject$2(value)) {
|
|
42761
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
42762
|
+
value = isObject$2(other) ? (other + '') : other;
|
|
42763
|
+
}
|
|
42764
|
+
if (typeof value != 'string') {
|
|
42765
|
+
return value === 0 ? value : +value;
|
|
42766
|
+
}
|
|
42767
|
+
value = baseTrim(value);
|
|
42768
|
+
var isBinary = reIsBinary.test(value);
|
|
42769
|
+
return (isBinary || reIsOctal.test(value))
|
|
42770
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
42771
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
|
42772
|
+
}
|
|
42773
|
+
|
|
42774
|
+
var toNumber_1 = toNumber$1;
|
|
42775
|
+
|
|
42776
|
+
var isObject$1 = isObject_1,
|
|
42777
|
+
now = now_1,
|
|
42778
|
+
toNumber = toNumber_1;
|
|
42779
|
+
|
|
42780
|
+
/** Error message constants. */
|
|
42781
|
+
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
|
42782
|
+
|
|
42783
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
42784
|
+
var nativeMax = Math.max,
|
|
42785
|
+
nativeMin = Math.min;
|
|
42786
|
+
|
|
42787
|
+
/**
|
|
42788
|
+
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
42789
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
42790
|
+
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
42791
|
+
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
42792
|
+
* Provide `options` to indicate whether `func` should be invoked on the
|
|
42793
|
+
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
42794
|
+
* with the last arguments provided to the debounced function. Subsequent
|
|
42795
|
+
* calls to the debounced function return the result of the last `func`
|
|
42796
|
+
* invocation.
|
|
42797
|
+
*
|
|
42798
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
42799
|
+
* invoked on the trailing edge of the timeout only if the debounced function
|
|
42800
|
+
* is invoked more than once during the `wait` timeout.
|
|
42801
|
+
*
|
|
42802
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
42803
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
42804
|
+
*
|
|
42805
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
42806
|
+
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
42807
|
+
*
|
|
42808
|
+
* @static
|
|
42809
|
+
* @memberOf _
|
|
42810
|
+
* @since 0.1.0
|
|
42811
|
+
* @category Function
|
|
42812
|
+
* @param {Function} func The function to debounce.
|
|
42813
|
+
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
42814
|
+
* @param {Object} [options={}] The options object.
|
|
42815
|
+
* @param {boolean} [options.leading=false]
|
|
42816
|
+
* Specify invoking on the leading edge of the timeout.
|
|
42817
|
+
* @param {number} [options.maxWait]
|
|
42818
|
+
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
42819
|
+
* @param {boolean} [options.trailing=true]
|
|
42820
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
42821
|
+
* @returns {Function} Returns the new debounced function.
|
|
42822
|
+
* @example
|
|
42823
|
+
*
|
|
42824
|
+
* // Avoid costly calculations while the window size is in flux.
|
|
42825
|
+
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
42826
|
+
*
|
|
42827
|
+
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
42828
|
+
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
42829
|
+
* 'leading': true,
|
|
42830
|
+
* 'trailing': false
|
|
42831
|
+
* }));
|
|
42832
|
+
*
|
|
42833
|
+
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
42834
|
+
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
42835
|
+
* var source = new EventSource('/stream');
|
|
42836
|
+
* jQuery(source).on('message', debounced);
|
|
42837
|
+
*
|
|
42838
|
+
* // Cancel the trailing debounced invocation.
|
|
42839
|
+
* jQuery(window).on('popstate', debounced.cancel);
|
|
42840
|
+
*/
|
|
42841
|
+
function debounce$1(func, wait, options) {
|
|
42842
|
+
var lastArgs,
|
|
42843
|
+
lastThis,
|
|
42844
|
+
maxWait,
|
|
42845
|
+
result,
|
|
42846
|
+
timerId,
|
|
42847
|
+
lastCallTime,
|
|
42848
|
+
lastInvokeTime = 0,
|
|
42849
|
+
leading = false,
|
|
42850
|
+
maxing = false,
|
|
42851
|
+
trailing = true;
|
|
42852
|
+
|
|
42853
|
+
if (typeof func != 'function') {
|
|
42854
|
+
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
42855
|
+
}
|
|
42856
|
+
wait = toNumber(wait) || 0;
|
|
42857
|
+
if (isObject$1(options)) {
|
|
42858
|
+
leading = !!options.leading;
|
|
42859
|
+
maxing = 'maxWait' in options;
|
|
42860
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
42861
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
42862
|
+
}
|
|
42863
|
+
|
|
42864
|
+
function invokeFunc(time) {
|
|
42865
|
+
var args = lastArgs,
|
|
42866
|
+
thisArg = lastThis;
|
|
42867
|
+
|
|
42868
|
+
lastArgs = lastThis = undefined;
|
|
42869
|
+
lastInvokeTime = time;
|
|
42870
|
+
result = func.apply(thisArg, args);
|
|
42871
|
+
return result;
|
|
42872
|
+
}
|
|
42873
|
+
|
|
42874
|
+
function leadingEdge(time) {
|
|
42875
|
+
// Reset any `maxWait` timer.
|
|
42876
|
+
lastInvokeTime = time;
|
|
42877
|
+
// Start the timer for the trailing edge.
|
|
42878
|
+
timerId = setTimeout(timerExpired, wait);
|
|
42879
|
+
// Invoke the leading edge.
|
|
42880
|
+
return leading ? invokeFunc(time) : result;
|
|
42881
|
+
}
|
|
42882
|
+
|
|
42883
|
+
function remainingWait(time) {
|
|
42884
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
42885
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
|
42886
|
+
timeWaiting = wait - timeSinceLastCall;
|
|
42887
|
+
|
|
42888
|
+
return maxing
|
|
42889
|
+
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
42890
|
+
: timeWaiting;
|
|
42891
|
+
}
|
|
42892
|
+
|
|
42893
|
+
function shouldInvoke(time) {
|
|
42894
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
42895
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
|
42896
|
+
|
|
42897
|
+
// Either this is the first call, activity has stopped and we're at the
|
|
42898
|
+
// trailing edge, the system time has gone backwards and we're treating
|
|
42899
|
+
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
42900
|
+
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
42901
|
+
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
42902
|
+
}
|
|
42903
|
+
|
|
42904
|
+
function timerExpired() {
|
|
42905
|
+
var time = now();
|
|
42906
|
+
if (shouldInvoke(time)) {
|
|
42907
|
+
return trailingEdge(time);
|
|
42908
|
+
}
|
|
42909
|
+
// Restart the timer.
|
|
42910
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
42911
|
+
}
|
|
42912
|
+
|
|
42913
|
+
function trailingEdge(time) {
|
|
42914
|
+
timerId = undefined;
|
|
42915
|
+
|
|
42916
|
+
// Only invoke if we have `lastArgs` which means `func` has been
|
|
42917
|
+
// debounced at least once.
|
|
42918
|
+
if (trailing && lastArgs) {
|
|
42919
|
+
return invokeFunc(time);
|
|
42920
|
+
}
|
|
42921
|
+
lastArgs = lastThis = undefined;
|
|
42922
|
+
return result;
|
|
42923
|
+
}
|
|
42924
|
+
|
|
42925
|
+
function cancel() {
|
|
42926
|
+
if (timerId !== undefined) {
|
|
42927
|
+
clearTimeout(timerId);
|
|
42928
|
+
}
|
|
42929
|
+
lastInvokeTime = 0;
|
|
42930
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
42931
|
+
}
|
|
42932
|
+
|
|
42933
|
+
function flush() {
|
|
42934
|
+
return timerId === undefined ? result : trailingEdge(now());
|
|
42935
|
+
}
|
|
42936
|
+
|
|
42937
|
+
function debounced() {
|
|
42938
|
+
var time = now(),
|
|
42939
|
+
isInvoking = shouldInvoke(time);
|
|
42940
|
+
|
|
42941
|
+
lastArgs = arguments;
|
|
42942
|
+
lastThis = this;
|
|
42943
|
+
lastCallTime = time;
|
|
42944
|
+
|
|
42945
|
+
if (isInvoking) {
|
|
42946
|
+
if (timerId === undefined) {
|
|
42947
|
+
return leadingEdge(lastCallTime);
|
|
42948
|
+
}
|
|
42949
|
+
if (maxing) {
|
|
42950
|
+
// Handle invocations in a tight loop.
|
|
42951
|
+
clearTimeout(timerId);
|
|
42952
|
+
timerId = setTimeout(timerExpired, wait);
|
|
42953
|
+
return invokeFunc(lastCallTime);
|
|
42954
|
+
}
|
|
42955
|
+
}
|
|
42956
|
+
if (timerId === undefined) {
|
|
42957
|
+
timerId = setTimeout(timerExpired, wait);
|
|
42958
|
+
}
|
|
42959
|
+
return result;
|
|
42960
|
+
}
|
|
42961
|
+
debounced.cancel = cancel;
|
|
42962
|
+
debounced.flush = flush;
|
|
42963
|
+
return debounced;
|
|
42964
|
+
}
|
|
42965
|
+
|
|
42966
|
+
var debounce_1 = debounce$1;
|
|
42967
|
+
|
|
42968
|
+
var debounce = debounce_1,
|
|
42969
|
+
isObject = isObject_1;
|
|
42970
|
+
|
|
42971
|
+
/** Error message constants. */
|
|
42972
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
42973
|
+
|
|
42974
|
+
/**
|
|
42975
|
+
* Creates a throttled function that only invokes `func` at most once per
|
|
42976
|
+
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
42977
|
+
* method to cancel delayed `func` invocations and a `flush` method to
|
|
42978
|
+
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
42979
|
+
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
42980
|
+
* timeout. The `func` is invoked with the last arguments provided to the
|
|
42981
|
+
* throttled function. Subsequent calls to the throttled function return the
|
|
42982
|
+
* result of the last `func` invocation.
|
|
42983
|
+
*
|
|
42984
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
42985
|
+
* invoked on the trailing edge of the timeout only if the throttled function
|
|
42986
|
+
* is invoked more than once during the `wait` timeout.
|
|
42987
|
+
*
|
|
42988
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
42989
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
42990
|
+
*
|
|
42991
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
42992
|
+
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
42993
|
+
*
|
|
42994
|
+
* @static
|
|
42995
|
+
* @memberOf _
|
|
42996
|
+
* @since 0.1.0
|
|
42997
|
+
* @category Function
|
|
42998
|
+
* @param {Function} func The function to throttle.
|
|
42999
|
+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
43000
|
+
* @param {Object} [options={}] The options object.
|
|
43001
|
+
* @param {boolean} [options.leading=true]
|
|
43002
|
+
* Specify invoking on the leading edge of the timeout.
|
|
43003
|
+
* @param {boolean} [options.trailing=true]
|
|
43004
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
43005
|
+
* @returns {Function} Returns the new throttled function.
|
|
43006
|
+
* @example
|
|
43007
|
+
*
|
|
43008
|
+
* // Avoid excessively updating the position while scrolling.
|
|
43009
|
+
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
43010
|
+
*
|
|
43011
|
+
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
43012
|
+
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
43013
|
+
* jQuery(element).on('click', throttled);
|
|
43014
|
+
*
|
|
43015
|
+
* // Cancel the trailing throttled invocation.
|
|
43016
|
+
* jQuery(window).on('popstate', throttled.cancel);
|
|
43017
|
+
*/
|
|
43018
|
+
function throttle(func, wait, options) {
|
|
43019
|
+
var leading = true,
|
|
43020
|
+
trailing = true;
|
|
43021
|
+
|
|
43022
|
+
if (typeof func != 'function') {
|
|
43023
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
43024
|
+
}
|
|
43025
|
+
if (isObject(options)) {
|
|
43026
|
+
leading = 'leading' in options ? !!options.leading : leading;
|
|
43027
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
43028
|
+
}
|
|
43029
|
+
return debounce(func, wait, {
|
|
43030
|
+
'leading': leading,
|
|
43031
|
+
'maxWait': wait,
|
|
43032
|
+
'trailing': trailing
|
|
43033
|
+
});
|
|
43034
|
+
}
|
|
43035
|
+
|
|
43036
|
+
var throttle_1 = throttle;
|
|
43037
|
+
|
|
43038
|
+
/* global Reflect, Promise */
|
|
43039
|
+
|
|
43040
|
+
var extendStatics = function(d, b) {
|
|
43041
|
+
extendStatics = Object.setPrototypeOf ||
|
|
43042
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
43043
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
43044
|
+
return extendStatics(d, b);
|
|
43045
|
+
};
|
|
43046
|
+
|
|
43047
|
+
function __extends(d, b) {
|
|
43048
|
+
extendStatics(d, b);
|
|
43049
|
+
function __() { this.constructor = d; }
|
|
43050
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
43051
|
+
}
|
|
43052
|
+
|
|
43053
|
+
var __assign = function() {
|
|
43054
|
+
__assign = Object.assign || function __assign(t) {
|
|
43055
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
43056
|
+
s = arguments[i];
|
|
43057
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
43058
|
+
}
|
|
43059
|
+
return t;
|
|
43060
|
+
};
|
|
43061
|
+
return __assign.apply(this, arguments);
|
|
43062
|
+
};
|
|
43063
|
+
|
|
43064
|
+
function __rest(s, e) {
|
|
43065
|
+
var t = {};
|
|
43066
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
43067
|
+
t[p] = s[p];
|
|
43068
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
43069
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
43070
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43071
|
+
t[p[i]] = s[p[i]];
|
|
43072
|
+
}
|
|
43073
|
+
return t;
|
|
43074
|
+
}var patchResizeCallback = function (resizeCallback, refreshMode, refreshRate, refreshOptions) {
|
|
43075
|
+
switch (refreshMode) {
|
|
43076
|
+
case 'debounce':
|
|
43077
|
+
return debounce_1(resizeCallback, refreshRate, refreshOptions);
|
|
43078
|
+
case 'throttle':
|
|
43079
|
+
return throttle_1(resizeCallback, refreshRate, refreshOptions);
|
|
43080
|
+
default:
|
|
43081
|
+
return resizeCallback;
|
|
43082
|
+
}
|
|
43083
|
+
};
|
|
43084
|
+
var isFunction = function (fn) { return typeof fn === 'function'; };
|
|
43085
|
+
var isSSR = function () { return typeof window === 'undefined'; };
|
|
43086
|
+
var isDOMElement = function (element) {
|
|
43087
|
+
return element instanceof Element || element instanceof HTMLDocument;
|
|
43088
|
+
};/** @class */ ((function (_super) {
|
|
43089
|
+
__extends(ResizeDetector, _super);
|
|
43090
|
+
function ResizeDetector(props) {
|
|
43091
|
+
var _this = _super.call(this, props) || this;
|
|
43092
|
+
_this.cancelHandler = function () {
|
|
43093
|
+
if (_this.resizeHandler && _this.resizeHandler.cancel) {
|
|
43094
|
+
// cancel debounced handler
|
|
43095
|
+
_this.resizeHandler.cancel();
|
|
43096
|
+
_this.resizeHandler = null;
|
|
43097
|
+
}
|
|
43098
|
+
};
|
|
43099
|
+
_this.attachObserver = function () {
|
|
43100
|
+
var _a = _this.props, targetRef = _a.targetRef, observerOptions = _a.observerOptions;
|
|
43101
|
+
if (isSSR()) {
|
|
43102
|
+
return;
|
|
43103
|
+
}
|
|
43104
|
+
if (targetRef && targetRef.current) {
|
|
43105
|
+
_this.targetRef.current = targetRef.current;
|
|
43106
|
+
}
|
|
43107
|
+
var element = _this.getElement();
|
|
43108
|
+
if (!element) {
|
|
43109
|
+
// can't find element to observe
|
|
43110
|
+
return;
|
|
43111
|
+
}
|
|
43112
|
+
if (_this.observableElement && _this.observableElement === element) {
|
|
43113
|
+
// element is already observed
|
|
43114
|
+
return;
|
|
43115
|
+
}
|
|
43116
|
+
_this.observableElement = element;
|
|
43117
|
+
_this.resizeObserver.observe(element, observerOptions);
|
|
43118
|
+
};
|
|
43119
|
+
_this.getElement = function () {
|
|
43120
|
+
var _a = _this.props, querySelector = _a.querySelector, targetDomEl = _a.targetDomEl;
|
|
43121
|
+
if (isSSR())
|
|
43122
|
+
return null;
|
|
43123
|
+
// in case we pass a querySelector
|
|
43124
|
+
if (querySelector)
|
|
43125
|
+
return document.querySelector(querySelector);
|
|
43126
|
+
// in case we pass a DOM element
|
|
43127
|
+
if (targetDomEl && isDOMElement(targetDomEl))
|
|
43128
|
+
return targetDomEl;
|
|
43129
|
+
// in case we pass a React ref using React.createRef()
|
|
43130
|
+
if (_this.targetRef && isDOMElement(_this.targetRef.current))
|
|
43131
|
+
return _this.targetRef.current;
|
|
43132
|
+
// the worse case when we don't receive any information from the parent and the library doesn't add any wrappers
|
|
43133
|
+
// we have to use a deprecated `findDOMNode` method in order to find a DOM element to attach to
|
|
43134
|
+
var currentElement = findDOMNode(_this);
|
|
43135
|
+
if (!currentElement)
|
|
43136
|
+
return null;
|
|
43137
|
+
var renderType = _this.getRenderType();
|
|
43138
|
+
switch (renderType) {
|
|
43139
|
+
case 'renderProp':
|
|
43140
|
+
return currentElement;
|
|
43141
|
+
case 'childFunction':
|
|
43142
|
+
return currentElement;
|
|
43143
|
+
case 'child':
|
|
43144
|
+
return currentElement;
|
|
43145
|
+
case 'childArray':
|
|
43146
|
+
return currentElement;
|
|
43147
|
+
default:
|
|
43148
|
+
return currentElement.parentElement;
|
|
43149
|
+
}
|
|
43150
|
+
};
|
|
43151
|
+
_this.createResizeHandler = function (entries) {
|
|
43152
|
+
var _a = _this.props, _b = _a.handleWidth, handleWidth = _b === void 0 ? true : _b, _c = _a.handleHeight, handleHeight = _c === void 0 ? true : _c, onResize = _a.onResize;
|
|
43153
|
+
if (!handleWidth && !handleHeight)
|
|
43154
|
+
return;
|
|
43155
|
+
var notifyResize = function (_a) {
|
|
43156
|
+
var width = _a.width, height = _a.height;
|
|
43157
|
+
if (_this.state.width === width && _this.state.height === height) {
|
|
43158
|
+
// skip if dimensions haven't changed
|
|
43159
|
+
return;
|
|
43160
|
+
}
|
|
43161
|
+
if ((_this.state.width === width && !handleHeight) || (_this.state.height === height && !handleWidth)) {
|
|
43162
|
+
// process `handleHeight/handleWidth` props
|
|
43163
|
+
return;
|
|
43164
|
+
}
|
|
43165
|
+
onResize === null || onResize === void 0 ? void 0 : onResize(width, height);
|
|
43166
|
+
_this.setState({ width: width, height: height });
|
|
43167
|
+
};
|
|
43168
|
+
entries.forEach(function (entry) {
|
|
43169
|
+
var _a = (entry && entry.contentRect) || {}, width = _a.width, height = _a.height;
|
|
43170
|
+
var shouldSetSize = !_this.skipOnMount && !isSSR();
|
|
43171
|
+
if (shouldSetSize) {
|
|
43172
|
+
notifyResize({ width: width, height: height });
|
|
43173
|
+
}
|
|
43174
|
+
_this.skipOnMount = false;
|
|
43175
|
+
});
|
|
43176
|
+
};
|
|
43177
|
+
_this.getRenderType = function () {
|
|
43178
|
+
var _a = _this.props, render = _a.render, children = _a.children;
|
|
43179
|
+
if (isFunction(render)) {
|
|
43180
|
+
// DEPRECATED. Use `Child Function Pattern` instead
|
|
43181
|
+
return 'renderProp';
|
|
43182
|
+
}
|
|
43183
|
+
if (isFunction(children)) {
|
|
43184
|
+
return 'childFunction';
|
|
43185
|
+
}
|
|
43186
|
+
if (isValidElement(children)) {
|
|
43187
|
+
return 'child';
|
|
43188
|
+
}
|
|
43189
|
+
if (Array.isArray(children)) {
|
|
43190
|
+
// DEPRECATED. Wrap children with a single parent
|
|
43191
|
+
return 'childArray';
|
|
43192
|
+
}
|
|
43193
|
+
// DEPRECATED. Use `Child Function Pattern` instead
|
|
43194
|
+
return 'parent';
|
|
43195
|
+
};
|
|
43196
|
+
var skipOnMount = props.skipOnMount, refreshMode = props.refreshMode, _a = props.refreshRate, refreshRate = _a === void 0 ? 1000 : _a, refreshOptions = props.refreshOptions;
|
|
43197
|
+
_this.state = {
|
|
43198
|
+
width: undefined,
|
|
43199
|
+
height: undefined
|
|
43200
|
+
};
|
|
43201
|
+
_this.sizeRef = {
|
|
43202
|
+
current: _this.state
|
|
43203
|
+
};
|
|
43204
|
+
_this.skipOnMount = skipOnMount;
|
|
43205
|
+
_this.targetRef = createRef();
|
|
43206
|
+
_this.observableElement = null;
|
|
43207
|
+
if (isSSR()) {
|
|
43208
|
+
return _this;
|
|
43209
|
+
}
|
|
43210
|
+
_this.resizeHandler = patchResizeCallback(_this.createResizeHandler, refreshMode, refreshRate, refreshOptions);
|
|
43211
|
+
_this.resizeObserver = new window.ResizeObserver(_this.resizeHandler);
|
|
43212
|
+
return _this;
|
|
43213
|
+
}
|
|
43214
|
+
ResizeDetector.prototype.componentDidMount = function () {
|
|
43215
|
+
this.attachObserver();
|
|
43216
|
+
};
|
|
43217
|
+
ResizeDetector.prototype.componentDidUpdate = function () {
|
|
43218
|
+
this.attachObserver();
|
|
43219
|
+
this.sizeRef.current = this.state;
|
|
43220
|
+
};
|
|
43221
|
+
ResizeDetector.prototype.componentWillUnmount = function () {
|
|
43222
|
+
if (isSSR()) {
|
|
43223
|
+
return;
|
|
43224
|
+
}
|
|
43225
|
+
this.observableElement = null;
|
|
43226
|
+
this.resizeObserver.disconnect();
|
|
43227
|
+
this.cancelHandler();
|
|
43228
|
+
};
|
|
43229
|
+
ResizeDetector.prototype.render = function () {
|
|
43230
|
+
var _a = this.props, render = _a.render, children = _a.children, _b = _a.nodeType, WrapperTag = _b === void 0 ? 'div' : _b;
|
|
43231
|
+
var _c = this.state, width = _c.width, height = _c.height;
|
|
43232
|
+
var childProps = { width: width, height: height, targetRef: this.targetRef };
|
|
43233
|
+
var renderType = this.getRenderType();
|
|
43234
|
+
switch (renderType) {
|
|
43235
|
+
case 'renderProp':
|
|
43236
|
+
return render === null || render === void 0 ? void 0 : render(childProps);
|
|
43237
|
+
case 'childFunction': {
|
|
43238
|
+
var childFunction = children;
|
|
43239
|
+
return childFunction === null || childFunction === void 0 ? void 0 : childFunction(childProps);
|
|
43240
|
+
}
|
|
43241
|
+
case 'child': {
|
|
43242
|
+
// @TODO bug prone logic
|
|
43243
|
+
var child = children;
|
|
43244
|
+
if (child.type && typeof child.type === 'string') {
|
|
43245
|
+
// child is a native DOM elements such as div, span etc
|
|
43246
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43247
|
+
childProps.targetRef; var nativeProps = __rest(childProps, ["targetRef"]);
|
|
43248
|
+
return cloneElement(child, nativeProps);
|
|
43249
|
+
}
|
|
43250
|
+
// class or functional component otherwise
|
|
43251
|
+
return cloneElement(child, childProps);
|
|
43252
|
+
}
|
|
43253
|
+
case 'childArray': {
|
|
43254
|
+
var childArray = children;
|
|
43255
|
+
return childArray.map(function (el) { return !!el && cloneElement(el, childProps); });
|
|
43256
|
+
}
|
|
43257
|
+
default:
|
|
43258
|
+
return React__default.createElement(WrapperTag, null);
|
|
43259
|
+
}
|
|
43260
|
+
};
|
|
43261
|
+
return ResizeDetector;
|
|
43262
|
+
})(PureComponent));function useResizeDetector(_a) {
|
|
43263
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.skipOnMount, skipOnMount = _c === void 0 ? false : _c, refreshMode = _b.refreshMode, _d = _b.refreshRate, refreshRate = _d === void 0 ? 1000 : _d, refreshOptions = _b.refreshOptions, _e = _b.handleWidth, handleWidth = _e === void 0 ? true : _e, _f = _b.handleHeight, handleHeight = _f === void 0 ? true : _f, targetRef = _b.targetRef, observerOptions = _b.observerOptions, onResize = _b.onResize;
|
|
43264
|
+
var skipResize = useRef(skipOnMount);
|
|
43265
|
+
var _g = useState({
|
|
43266
|
+
width: undefined,
|
|
43267
|
+
height: undefined
|
|
43268
|
+
}), size = _g[0], setSize = _g[1];
|
|
43269
|
+
// we are going to use this ref to store the last element that was passed to the hook
|
|
43270
|
+
var _h = useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null), refElement = _h[0], setRefElement = _h[1];
|
|
43271
|
+
// if targetRef is passed, we need to update the refElement
|
|
43272
|
+
// we have to use setTimeout because ref get assigned after the hook is called
|
|
43273
|
+
// in the future releases we are going to remove targetRef and force users to use ref returned by the hook
|
|
43274
|
+
if (targetRef) {
|
|
43275
|
+
setTimeout(function () {
|
|
43276
|
+
if (targetRef.current !== refElement) {
|
|
43277
|
+
setRefElement(targetRef.current);
|
|
43278
|
+
}
|
|
43279
|
+
}, 0);
|
|
43280
|
+
}
|
|
43281
|
+
// this is a callback that will be called every time the ref is changed
|
|
43282
|
+
// we call setState inside to trigger rerender
|
|
43283
|
+
var onRefChange = useCallback(function (node) {
|
|
43284
|
+
if (node !== refElement) {
|
|
43285
|
+
setRefElement(node);
|
|
43286
|
+
}
|
|
43287
|
+
}, [refElement]);
|
|
43288
|
+
// adding `current` to make it compatible with useRef shape
|
|
43289
|
+
onRefChange.current = refElement;
|
|
43290
|
+
useEffect(function () {
|
|
43291
|
+
return function () {
|
|
43292
|
+
// component is unmounted
|
|
43293
|
+
// clear ref to avoid memory leaks
|
|
43294
|
+
setRefElement(null);
|
|
43295
|
+
onRefChange.current = null;
|
|
43296
|
+
};
|
|
43297
|
+
}, []);
|
|
43298
|
+
var shouldSetSize = useCallback(function (prevSize, nextSize) {
|
|
43299
|
+
if (prevSize.width === nextSize.width && prevSize.height === nextSize.height) {
|
|
43300
|
+
// skip if dimensions haven't changed
|
|
43301
|
+
return false;
|
|
43302
|
+
}
|
|
43303
|
+
if ((prevSize.width === nextSize.width && !handleHeight) ||
|
|
43304
|
+
(prevSize.height === nextSize.height && !handleWidth)) {
|
|
43305
|
+
// process `handleHeight/handleWidth` props
|
|
43306
|
+
return false;
|
|
43307
|
+
}
|
|
43308
|
+
return true;
|
|
43309
|
+
}, [handleWidth, handleHeight]);
|
|
43310
|
+
var resizeCallback = useCallback(function (entries) {
|
|
43311
|
+
if (!handleWidth && !handleHeight)
|
|
43312
|
+
return;
|
|
43313
|
+
if (skipResize.current) {
|
|
43314
|
+
skipResize.current = false;
|
|
43315
|
+
return;
|
|
43316
|
+
}
|
|
43317
|
+
entries.forEach(function (entry) {
|
|
43318
|
+
var _a = (entry === null || entry === void 0 ? void 0 : entry.contentRect) || {}, width = _a.width, height = _a.height;
|
|
43319
|
+
setSize(function (prevSize) {
|
|
43320
|
+
if (!shouldSetSize(prevSize, { width: width, height: height }))
|
|
43321
|
+
return prevSize;
|
|
43322
|
+
return { width: width, height: height };
|
|
43323
|
+
});
|
|
43324
|
+
});
|
|
43325
|
+
}, [handleWidth, handleHeight, skipResize, shouldSetSize]);
|
|
43326
|
+
var resizeHandler = useCallback(patchResizeCallback(resizeCallback, refreshMode, refreshRate, refreshOptions), [
|
|
43327
|
+
resizeCallback,
|
|
43328
|
+
refreshMode,
|
|
43329
|
+
refreshRate,
|
|
43330
|
+
refreshOptions
|
|
43331
|
+
]);
|
|
43332
|
+
// on refElement change
|
|
43333
|
+
useEffect(function () {
|
|
43334
|
+
var resizeObserver;
|
|
43335
|
+
if (refElement) {
|
|
43336
|
+
resizeObserver = new window.ResizeObserver(resizeHandler);
|
|
43337
|
+
resizeObserver.observe(refElement, observerOptions);
|
|
43338
|
+
}
|
|
43339
|
+
else {
|
|
43340
|
+
if (size.width || size.height) {
|
|
43341
|
+
setSize({ width: undefined, height: undefined });
|
|
43342
|
+
}
|
|
43343
|
+
}
|
|
43344
|
+
return function () {
|
|
43345
|
+
var _a, _b, _c;
|
|
43346
|
+
(_a = resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect) === null || _a === void 0 ? void 0 : _a.call(resizeObserver);
|
|
43347
|
+
(_c = (_b = resizeHandler).cancel) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
43348
|
+
};
|
|
43349
|
+
}, [resizeHandler, refElement]);
|
|
43350
|
+
useEffect(function () {
|
|
43351
|
+
onResize === null || onResize === void 0 ? void 0 : onResize(size.width, size.height);
|
|
43352
|
+
}, [size]);
|
|
43353
|
+
return __assign({ ref: onRefChange }, size);
|
|
43354
|
+
}
|
|
43355
|
+
|
|
43356
|
+
const MapControlButton = _a => {
|
|
43357
|
+
var {
|
|
43358
|
+
onClick,
|
|
43359
|
+
children,
|
|
43360
|
+
title,
|
|
43361
|
+
placement = 'right',
|
|
43362
|
+
isActive = false
|
|
43363
|
+
} = _a,
|
|
43364
|
+
props = __rest$1(_a, ["onClick", "children", "title", "placement", "isActive"]);
|
|
43365
|
+
return jsx(CustomIconButton, Object.assign({
|
|
43366
|
+
variant: "tool",
|
|
43367
|
+
tooltipProps: {
|
|
43368
|
+
placement,
|
|
43369
|
+
title
|
|
43370
|
+
},
|
|
43371
|
+
onClick: onClick,
|
|
43372
|
+
isSelected: isActive
|
|
43373
|
+
}, props, {
|
|
43374
|
+
children: children
|
|
43375
|
+
}));
|
|
43376
|
+
};
|
|
43377
|
+
|
|
43378
|
+
const ZoomControls = ({
|
|
43379
|
+
onZoomIn,
|
|
43380
|
+
onZoomOut,
|
|
43381
|
+
onZoomReset
|
|
43382
|
+
}) => {
|
|
43383
|
+
return jsxs(Fragment, {
|
|
43384
|
+
children: [jsx(MapControlButton, Object.assign({
|
|
43385
|
+
title: "Reset zoom",
|
|
43386
|
+
"data-testid": "zoom-reset",
|
|
43387
|
+
onClick: onZoomReset
|
|
43388
|
+
}, {
|
|
43389
|
+
children: jsx(Home, {})
|
|
43390
|
+
})), jsx(MapControlButton, Object.assign({
|
|
43391
|
+
title: "Zoom in",
|
|
43392
|
+
"data-testid": "zoom-in",
|
|
43393
|
+
onClick: onZoomIn
|
|
43394
|
+
}, {
|
|
43395
|
+
children: jsx(Add, {})
|
|
43396
|
+
})), jsx(MapControlButton, Object.assign({
|
|
43397
|
+
title: "Zoom out",
|
|
43398
|
+
"data-testid": "zoom-out",
|
|
43399
|
+
onClick: onZoomOut
|
|
43400
|
+
}, {
|
|
43401
|
+
children: jsx(Minus, {})
|
|
43402
|
+
}))]
|
|
43403
|
+
});
|
|
43404
|
+
};
|
|
43405
|
+
|
|
43406
|
+
const MapControls = _a => {
|
|
43407
|
+
var {
|
|
43408
|
+
children
|
|
43409
|
+
} = _a,
|
|
43410
|
+
props = __rest$1(_a, ["children"]);
|
|
43411
|
+
return jsx(Box$1, Object.assign({
|
|
43412
|
+
sx: {
|
|
43413
|
+
position: 'absolute',
|
|
43414
|
+
overflow: 'visible',
|
|
43415
|
+
display: 'block',
|
|
43416
|
+
left: 0,
|
|
43417
|
+
margin: 1,
|
|
43418
|
+
zIndex: 50,
|
|
43419
|
+
top: '96px',
|
|
43420
|
+
userSelect: 'none'
|
|
43421
|
+
}
|
|
43422
|
+
}, props, {
|
|
43423
|
+
children: jsx(Grid$1, Object.assign({
|
|
43424
|
+
sx: {
|
|
43425
|
+
'& > button': {
|
|
43426
|
+
marginBottom: 1
|
|
43427
|
+
}
|
|
43428
|
+
},
|
|
43429
|
+
container: true,
|
|
43430
|
+
direction: "column"
|
|
43431
|
+
}, {
|
|
43432
|
+
children: children
|
|
43433
|
+
}))
|
|
43434
|
+
}));
|
|
43435
|
+
};
|
|
43436
|
+
|
|
43437
|
+
const getTimeDimension = dimensions => dimensions.find(dimension => dimension.name === 'time' && dimension.currentValue !== undefined);
|
|
43438
|
+
const formatTime = (time, timeFormat) => dateUtils.dateToString(dateUtils.utc(time), timeFormat);
|
|
43439
|
+
const defaultTimeFormat = "EEE dd MMM yyyy HH:mm 'UTC'";
|
|
43440
|
+
const MapTime = ({
|
|
43441
|
+
dimensions,
|
|
43442
|
+
timeFormat: _timeFormat = defaultTimeFormat
|
|
43443
|
+
}) => {
|
|
43444
|
+
const timeDimension = getTimeDimension(dimensions);
|
|
43445
|
+
if (!timeDimension) {
|
|
43446
|
+
return null;
|
|
43447
|
+
}
|
|
43448
|
+
const mapTime = formatTime(timeDimension.currentValue, _timeFormat);
|
|
43449
|
+
return jsx(Box$1, Object.assign({
|
|
43450
|
+
"data-testid": "map-time",
|
|
43451
|
+
sx: {
|
|
43452
|
+
zIndex: 10,
|
|
43453
|
+
justifySelf: 'center',
|
|
43454
|
+
bottom: '12px',
|
|
43455
|
+
position: 'absolute'
|
|
43456
|
+
}
|
|
43457
|
+
}, {
|
|
43458
|
+
children: jsx(Box$1, {
|
|
43459
|
+
children: jsx(Typography$1, Object.assign({
|
|
43460
|
+
variant: "caption",
|
|
43461
|
+
sx: {
|
|
43462
|
+
fontWeight: 500
|
|
43463
|
+
}
|
|
43464
|
+
}, {
|
|
43465
|
+
children: mapTime
|
|
43466
|
+
}))
|
|
43467
|
+
})
|
|
43468
|
+
}));
|
|
43469
|
+
};
|
|
43470
|
+
|
|
43471
|
+
const MapView = _a => {
|
|
43472
|
+
var {
|
|
43473
|
+
children,
|
|
43474
|
+
controls = {
|
|
43475
|
+
zoomControls: true
|
|
43476
|
+
},
|
|
43477
|
+
displayTimeInMap = true,
|
|
43478
|
+
onWMJSMount
|
|
43479
|
+
} = _a,
|
|
43480
|
+
// rest props
|
|
43481
|
+
props = __rest$1(_a, ["children", "controls", "displayTimeInMap", "onWMJSMount"]);
|
|
43482
|
+
const {
|
|
43483
|
+
dimensions,
|
|
43484
|
+
mapId: mapIdProp
|
|
43485
|
+
} = props;
|
|
43486
|
+
const wmjsMapRef = React.useRef(null);
|
|
43487
|
+
const mapId = React.useRef(mapIdProp).current;
|
|
43488
|
+
if (mapIdProp !== mapId) {
|
|
43489
|
+
console.warn(`Warning, MapId ${mapId} has been updated to ${mapIdProp} on an already mounted component. Keeping ${mapId}`);
|
|
43490
|
+
}
|
|
43491
|
+
const {
|
|
43492
|
+
ref,
|
|
43493
|
+
height,
|
|
43494
|
+
width
|
|
43495
|
+
} = useResizeDetector();
|
|
43496
|
+
React.useEffect(() => {
|
|
43497
|
+
if (wmjsMapRef.current && !!width && !!height) {
|
|
43498
|
+
const {
|
|
43499
|
+
height: mapHeight,
|
|
43500
|
+
width: mapWidth
|
|
43501
|
+
} = wmjsMapRef.current.getSize();
|
|
43502
|
+
if (width !== mapWidth || height !== mapHeight) {
|
|
43503
|
+
wmjsMapRef.current.setSize(Math.ceil(width), Math.ceil(height));
|
|
43504
|
+
}
|
|
43505
|
+
}
|
|
43506
|
+
}, [width, height]);
|
|
43507
|
+
const reactMapViewProps = Object.assign(Object.assign({}, props), {
|
|
43508
|
+
mapId
|
|
43509
|
+
});
|
|
43510
|
+
return jsxs(Box$1, Object.assign({
|
|
43511
|
+
ref: ref,
|
|
43512
|
+
sx: {
|
|
43513
|
+
display: 'grid',
|
|
43514
|
+
width: '100%',
|
|
43515
|
+
height: '100%',
|
|
43516
|
+
position: 'relative',
|
|
43517
|
+
overflow: 'hidden'
|
|
43518
|
+
}
|
|
43519
|
+
}, {
|
|
43520
|
+
children: [controls && controls.zoomControls && jsx(MapControls, Object.assign({
|
|
43521
|
+
style: {
|
|
43522
|
+
top: 0,
|
|
43523
|
+
position: 'absolute'
|
|
43524
|
+
}
|
|
43525
|
+
}, {
|
|
43526
|
+
children: jsx(ZoomControls, {
|
|
43527
|
+
onZoomIn: () => {
|
|
43528
|
+
const wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
43529
|
+
wmjsMap.zoomIn(undefined);
|
|
43530
|
+
},
|
|
43531
|
+
onZoomOut: () => {
|
|
43532
|
+
const wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
43533
|
+
wmjsMap.zoomOut();
|
|
43534
|
+
},
|
|
43535
|
+
onZoomReset: () => {
|
|
43536
|
+
const wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
43537
|
+
wmjsMap.zoomToLayer(wmjsMap.getActiveLayer());
|
|
43538
|
+
}
|
|
43539
|
+
})
|
|
43540
|
+
})), jsx(Box$1, Object.assign({
|
|
43541
|
+
sx: {
|
|
43542
|
+
gridColumnStart: 1,
|
|
43543
|
+
gridRowStart: 1
|
|
43544
|
+
}
|
|
43545
|
+
}, {
|
|
43546
|
+
children: jsx(ReactMapView, Object.assign({}, reactMapViewProps, {
|
|
43547
|
+
showLegend: false,
|
|
43548
|
+
displayTimeInMap: false,
|
|
43549
|
+
onWMJSMount: id => {
|
|
43550
|
+
wmjsMapRef.current = webmapUtils.getWMJSMapById(id);
|
|
43551
|
+
if (onWMJSMount) {
|
|
43552
|
+
onWMJSMount(id);
|
|
43553
|
+
}
|
|
43554
|
+
}
|
|
43555
|
+
}, {
|
|
43556
|
+
children: children
|
|
43557
|
+
}))
|
|
43558
|
+
})), displayTimeInMap && dimensions && jsx(MapTime, {
|
|
43559
|
+
dimensions: dimensions
|
|
43560
|
+
})]
|
|
43561
|
+
}));
|
|
43562
|
+
};
|
|
43563
|
+
|
|
41693
43564
|
/* *
|
|
41694
43565
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
41695
43566
|
* you may not use this file except in compliance with the License.
|
|
@@ -41733,4 +43604,522 @@ var defaultLayers = /*#__PURE__*/Object.freeze({
|
|
|
41733
43604
|
overLayer: overLayer
|
|
41734
43605
|
});
|
|
41735
43606
|
|
|
41736
|
-
|
|
43607
|
+
/* *
|
|
43608
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
43609
|
+
* you may not use this file except in compliance with the License.
|
|
43610
|
+
* You may obtain a copy of the License at
|
|
43611
|
+
*
|
|
43612
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
43613
|
+
*
|
|
43614
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
43615
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
43616
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
43617
|
+
* See the License for the specific language governing permissions and
|
|
43618
|
+
* limitations under the License.
|
|
43619
|
+
*
|
|
43620
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
43621
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
43622
|
+
* */
|
|
43623
|
+
const DWD = {
|
|
43624
|
+
name: 'DWD',
|
|
43625
|
+
url: 'https://maps.dwd.de/geoserver/ows?',
|
|
43626
|
+
id: 'dwd'
|
|
43627
|
+
};
|
|
43628
|
+
const nationaalgeoregister = {
|
|
43629
|
+
name: 'nationaalgeoregister.nl',
|
|
43630
|
+
url: 'https://geodata.nationaalgeoregister.nl/cbsgebiedsindelingen/wms?request=GetCapabilities&service=wms',
|
|
43631
|
+
id: 'nationaalgeoregister'
|
|
43632
|
+
};
|
|
43633
|
+
const KNMImsgcpp = {
|
|
43634
|
+
name: 'KNMImsgcpp',
|
|
43635
|
+
url: 'https://adaguc-server-msg-cpp-portal.pmc.knmi.cloud/wms?DATASET=msgrt&',
|
|
43636
|
+
id: 'msgcpp-ogc-realtime'
|
|
43637
|
+
};
|
|
43638
|
+
const HeiGit = {
|
|
43639
|
+
name: 'HeiGit',
|
|
43640
|
+
url: 'https://maps.heigit.org/osm-wms/service',
|
|
43641
|
+
id: 'HeiGit-osm-wms'
|
|
43642
|
+
};
|
|
43643
|
+
const ArcGisCanvas = {
|
|
43644
|
+
name: 'ArcGisCanvas',
|
|
43645
|
+
url: 'https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/',
|
|
43646
|
+
id: 'ArcGisCanvas'
|
|
43647
|
+
};
|
|
43648
|
+
const KNMIgeoservicesRadar = {
|
|
43649
|
+
name: 'KNMIgeoservicesRadar',
|
|
43650
|
+
url: 'https://geoservices.knmi.nl/wms?dataset=RADAR&',
|
|
43651
|
+
id: 'KNMIgeoservicesRadar'
|
|
43652
|
+
};
|
|
43653
|
+
const KNMIgeoservicesObs = {
|
|
43654
|
+
name: 'KNMIgeoservicesObs',
|
|
43655
|
+
url: 'https://geoservices.knmi.nl/adagucserver?dataset=OBS',
|
|
43656
|
+
id: 'KNMIgeoservicesObs'
|
|
43657
|
+
};
|
|
43658
|
+
const KNMIgeoservicesKlimaatAtlas = {
|
|
43659
|
+
name: 'KNMIgeoservicesKlimaatAtlas',
|
|
43660
|
+
url: 'https://geoservices.knmi.nl/wms?DATASET=gsie-dataset&SERVICE=WMS&',
|
|
43661
|
+
id: 'KNMIgeoservicesKlimaatAtlas'
|
|
43662
|
+
};
|
|
43663
|
+
const KNMIgeoservicesHarmonie = {
|
|
43664
|
+
name: 'KNMIgeoservicesHarmonie',
|
|
43665
|
+
url: 'https://geoservices.knmi.nl/wms?DATASET=HARM_N25&',
|
|
43666
|
+
id: 'KNMIgeoservicesKliKNMIgeoservicesHarmoniemaatAtlas'
|
|
43667
|
+
};
|
|
43668
|
+
const KNMIgeoservicesHarmonieMLService = {
|
|
43669
|
+
name: 'KNMI Harmonie ML',
|
|
43670
|
+
url: 'https://geoservices.knmi.nl/wms?DATASET=HARM_N25_ML&SERVICE=WMS&',
|
|
43671
|
+
id: 'harmonieML'
|
|
43672
|
+
};
|
|
43673
|
+
const MetNorwayService = {
|
|
43674
|
+
name: 'MetNorwayService',
|
|
43675
|
+
url: 'https://wms-e1.geoweb.met.no/wms?',
|
|
43676
|
+
id: 'MetNorwayService'
|
|
43677
|
+
};
|
|
43678
|
+
const FMIopenwms = {
|
|
43679
|
+
name: 'FMIopenwms',
|
|
43680
|
+
url: 'https://openwms.fmi.fi/geoserver/wms?',
|
|
43681
|
+
id: 'FMIopenwms'
|
|
43682
|
+
};
|
|
43683
|
+
const DWDObservations = {
|
|
43684
|
+
name: 'DWDObservations',
|
|
43685
|
+
url: 'https://maps.dwd.de/geoserver/dwd/Wetter_Beobachtungen/ows?',
|
|
43686
|
+
id: 'DWDObservations'
|
|
43687
|
+
};
|
|
43688
|
+
const DWDWarnings = {
|
|
43689
|
+
name: 'DWDWarnings',
|
|
43690
|
+
url: 'https://maps.dwd.de/geoserver/dwd/Warnungen_Gemeinden_vereinigt/ows?',
|
|
43691
|
+
id: 'DWDWarnings'
|
|
43692
|
+
};
|
|
43693
|
+
const DWDWXProdukt = {
|
|
43694
|
+
name: 'DWDWXProdukt',
|
|
43695
|
+
url: 'https://maps.dwd.de/geoserver/dwd/WX-Produkt/ows?',
|
|
43696
|
+
id: 'DWDWXProdukt'
|
|
43697
|
+
};
|
|
43698
|
+
const EUMETSAT = {
|
|
43699
|
+
name: 'EUMETSAT',
|
|
43700
|
+
url: 'https://view.eumetsat.int/geoserver/wms?',
|
|
43701
|
+
id: 'EUMETSAT'
|
|
43702
|
+
};
|
|
43703
|
+
const eumetviewEUMETSAT = {
|
|
43704
|
+
name: 'eumetviewEUMETSAT',
|
|
43705
|
+
url: 'https://eumetview.eumetsat.int/geoserv/wms?',
|
|
43706
|
+
id: 'eumetviewEUMETSAT'
|
|
43707
|
+
};
|
|
43708
|
+
const ECMWFPublicService = {
|
|
43709
|
+
name: 'ECMWF',
|
|
43710
|
+
url: 'https://eccharts.ecmwf.int/wms/?token=public',
|
|
43711
|
+
id: 'ecmwf'
|
|
43712
|
+
};
|
|
43713
|
+
const MeteoCanada = {
|
|
43714
|
+
name: 'Meteo Canada',
|
|
43715
|
+
url: 'https://geo.weather.gc.ca/geomet/?lang=en&',
|
|
43716
|
+
id: 'MeteoCanada'
|
|
43717
|
+
};
|
|
43718
|
+
|
|
43719
|
+
var publicServices = /*#__PURE__*/Object.freeze({
|
|
43720
|
+
__proto__: null,
|
|
43721
|
+
DWD: DWD,
|
|
43722
|
+
nationaalgeoregister: nationaalgeoregister,
|
|
43723
|
+
KNMImsgcpp: KNMImsgcpp,
|
|
43724
|
+
HeiGit: HeiGit,
|
|
43725
|
+
ArcGisCanvas: ArcGisCanvas,
|
|
43726
|
+
KNMIgeoservicesRadar: KNMIgeoservicesRadar,
|
|
43727
|
+
KNMIgeoservicesObs: KNMIgeoservicesObs,
|
|
43728
|
+
KNMIgeoservicesKlimaatAtlas: KNMIgeoservicesKlimaatAtlas,
|
|
43729
|
+
KNMIgeoservicesHarmonie: KNMIgeoservicesHarmonie,
|
|
43730
|
+
KNMIgeoservicesHarmonieMLService: KNMIgeoservicesHarmonieMLService,
|
|
43731
|
+
MetNorwayService: MetNorwayService,
|
|
43732
|
+
FMIopenwms: FMIopenwms,
|
|
43733
|
+
DWDObservations: DWDObservations,
|
|
43734
|
+
DWDWarnings: DWDWarnings,
|
|
43735
|
+
DWDWXProdukt: DWDWXProdukt,
|
|
43736
|
+
EUMETSAT: EUMETSAT,
|
|
43737
|
+
eumetviewEUMETSAT: eumetviewEUMETSAT,
|
|
43738
|
+
ECMWFPublicService: ECMWFPublicService,
|
|
43739
|
+
MeteoCanada: MeteoCanada
|
|
43740
|
+
});
|
|
43741
|
+
|
|
43742
|
+
/* *
|
|
43743
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
43744
|
+
* you may not use this file except in compliance with the License.
|
|
43745
|
+
* You may obtain a copy of the License at
|
|
43746
|
+
*
|
|
43747
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
43748
|
+
*
|
|
43749
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
43750
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
43751
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
43752
|
+
* See the License for the specific language governing permissions and
|
|
43753
|
+
* limitations under the License.
|
|
43754
|
+
*
|
|
43755
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
43756
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
43757
|
+
* */
|
|
43758
|
+
const baseLayer = {
|
|
43759
|
+
name: 'arcGisSat',
|
|
43760
|
+
title: 'arcGisSat',
|
|
43761
|
+
type: 'twms',
|
|
43762
|
+
layerType: LayerType.baseLayer,
|
|
43763
|
+
enabled: true,
|
|
43764
|
+
id: webmapUtils.generateLayerId()
|
|
43765
|
+
};
|
|
43766
|
+
// Base Layers List
|
|
43767
|
+
const baseLayerOpenStreetMapNL = {
|
|
43768
|
+
id: 'base-layer-2',
|
|
43769
|
+
name: 'OpenStreetMap_NL',
|
|
43770
|
+
type: 'twms',
|
|
43771
|
+
layerType: LayerType.baseLayer,
|
|
43772
|
+
enabled: true
|
|
43773
|
+
};
|
|
43774
|
+
const baseLayerArcGisCanvas = {
|
|
43775
|
+
service: ArcGisCanvas.url,
|
|
43776
|
+
id: webmapUtils.generateLayerId(),
|
|
43777
|
+
name: 'arcGisCanvas',
|
|
43778
|
+
type: 'twms',
|
|
43779
|
+
enabled: true,
|
|
43780
|
+
layerType: LayerType.baseLayer
|
|
43781
|
+
};
|
|
43782
|
+
const baseLayerWorldMap = {
|
|
43783
|
+
id: webmapUtils.generateLayerId(),
|
|
43784
|
+
name: 'WorldMap',
|
|
43785
|
+
type: 'twms',
|
|
43786
|
+
layerType: LayerType.baseLayer,
|
|
43787
|
+
enabled: true
|
|
43788
|
+
};
|
|
43789
|
+
const baseLayerHeiGit = {
|
|
43790
|
+
service: HeiGit.url,
|
|
43791
|
+
id: webmapUtils.generateLayerId(),
|
|
43792
|
+
name: 'osm_auto:all',
|
|
43793
|
+
layerType: LayerType.baseLayer
|
|
43794
|
+
};
|
|
43795
|
+
// KNMI msgcpp List
|
|
43796
|
+
const msgCppLayer = {
|
|
43797
|
+
// doesn't work with https
|
|
43798
|
+
service: KNMImsgcpp.url,
|
|
43799
|
+
name: 'lwe_precipitation_rate',
|
|
43800
|
+
format: 'image/png',
|
|
43801
|
+
enabled: true,
|
|
43802
|
+
style: 'precip-transparent/nearest',
|
|
43803
|
+
id: webmapUtils.generateLayerId(),
|
|
43804
|
+
layerType: LayerType.mapLayer
|
|
43805
|
+
};
|
|
43806
|
+
// Nederlandse Nationaal Georegister Layers list
|
|
43807
|
+
const veiligheidsRegiosGebiedsIndelingenLabels = {
|
|
43808
|
+
service: nationaalgeoregister.url,
|
|
43809
|
+
name: 'cbsgebiedsindelingen:cbs_veiligheidsregio_2020_labelpoint',
|
|
43810
|
+
style: 'CBS_Label',
|
|
43811
|
+
enabled: false,
|
|
43812
|
+
layerType: LayerType.mapLayer
|
|
43813
|
+
};
|
|
43814
|
+
const veiligheidsRegiosGebiedsIndelingen = {
|
|
43815
|
+
service: nationaalgeoregister.url,
|
|
43816
|
+
name: 'cbsgebiedsindelingen:cbs_veiligheidsregio_2020_gegeneraliseerd',
|
|
43817
|
+
style: 'CBS_Gebiedsindeling',
|
|
43818
|
+
enabled: false,
|
|
43819
|
+
layerType: LayerType.mapLayer
|
|
43820
|
+
};
|
|
43821
|
+
// KNMI Geoservices Layers List
|
|
43822
|
+
const radarLayer = {
|
|
43823
|
+
service: KNMIgeoservicesRadar.url,
|
|
43824
|
+
name: 'RAD_NL25_PCP_CM',
|
|
43825
|
+
format: 'image/png',
|
|
43826
|
+
enabled: true,
|
|
43827
|
+
style: 'radar/nearest',
|
|
43828
|
+
id: webmapUtils.generateLayerId(),
|
|
43829
|
+
layerType: LayerType.mapLayer
|
|
43830
|
+
};
|
|
43831
|
+
const radarLayerWithError = {
|
|
43832
|
+
service: KNMIgeoservicesRadar.url,
|
|
43833
|
+
name: 'radarLayer',
|
|
43834
|
+
format: 'image/png',
|
|
43835
|
+
enabled: true,
|
|
43836
|
+
style: 'knmiradar/nearest',
|
|
43837
|
+
id: webmapUtils.generateLayerId(),
|
|
43838
|
+
layerType: LayerType.mapLayer
|
|
43839
|
+
};
|
|
43840
|
+
const obsAirTemperature = {
|
|
43841
|
+
service: KNMIgeoservicesObs.url,
|
|
43842
|
+
name: '10M/ta',
|
|
43843
|
+
id: webmapUtils.generateLayerId(),
|
|
43844
|
+
layerType: LayerType.mapLayer
|
|
43845
|
+
};
|
|
43846
|
+
const obsWind = {
|
|
43847
|
+
service: KNMIgeoservicesObs.url,
|
|
43848
|
+
name: '10M/wind',
|
|
43849
|
+
id: webmapUtils.generateLayerId(),
|
|
43850
|
+
layerType: LayerType.mapLayer
|
|
43851
|
+
};
|
|
43852
|
+
const obsAirPressureAtSeaLevel = {
|
|
43853
|
+
service: KNMIgeoservicesObs.url,
|
|
43854
|
+
name: '10M/pp',
|
|
43855
|
+
id: webmapUtils.generateLayerId(),
|
|
43856
|
+
layerType: LayerType.mapLayer
|
|
43857
|
+
};
|
|
43858
|
+
const obsRelativeHumidity = {
|
|
43859
|
+
service: KNMIgeoservicesObs.url,
|
|
43860
|
+
name: '10M/rh',
|
|
43861
|
+
id: webmapUtils.generateLayerId(),
|
|
43862
|
+
layerType: LayerType.mapLayer
|
|
43863
|
+
};
|
|
43864
|
+
const obsGlobalSolarRadiation = {
|
|
43865
|
+
service: KNMIgeoservicesObs.url,
|
|
43866
|
+
name: '10M/qg',
|
|
43867
|
+
id: webmapUtils.generateLayerId(),
|
|
43868
|
+
layerType: LayerType.mapLayer
|
|
43869
|
+
};
|
|
43870
|
+
const obsPrecipitationIntensityPWS = {
|
|
43871
|
+
service: KNMIgeoservicesObs.url,
|
|
43872
|
+
name: '10M/pg',
|
|
43873
|
+
id: webmapUtils.generateLayerId(),
|
|
43874
|
+
layerType: LayerType.mapLayer
|
|
43875
|
+
};
|
|
43876
|
+
const harmonieRelativeHumidityPl = {
|
|
43877
|
+
service: KNMIgeoservicesHarmonie.url,
|
|
43878
|
+
name: 'relative_humidity__at_pl',
|
|
43879
|
+
id: webmapUtils.generateLayerId(),
|
|
43880
|
+
layerType: LayerType.mapLayer,
|
|
43881
|
+
enabled: true
|
|
43882
|
+
};
|
|
43883
|
+
const harmonieWindPl = {
|
|
43884
|
+
service: KNMIgeoservicesHarmonie.url,
|
|
43885
|
+
name: 'wind__at_pl',
|
|
43886
|
+
id: webmapUtils.generateLayerId(),
|
|
43887
|
+
layerType: LayerType.mapLayer,
|
|
43888
|
+
enabled: true
|
|
43889
|
+
};
|
|
43890
|
+
const harmonieAirTemperature = {
|
|
43891
|
+
service: KNMIgeoservicesHarmonie.url,
|
|
43892
|
+
name: 'air_temperature__at_2m',
|
|
43893
|
+
id: webmapUtils.generateLayerId(),
|
|
43894
|
+
layerType: LayerType.mapLayer,
|
|
43895
|
+
enabled: true
|
|
43896
|
+
};
|
|
43897
|
+
const harmoniePrecipitation = {
|
|
43898
|
+
service: KNMIgeoservicesHarmonie.url,
|
|
43899
|
+
name: 'precipitation_flux',
|
|
43900
|
+
id: webmapUtils.generateLayerId(),
|
|
43901
|
+
layerType: LayerType.mapLayer,
|
|
43902
|
+
enabled: true
|
|
43903
|
+
};
|
|
43904
|
+
const harmoniePressure = {
|
|
43905
|
+
service: KNMIgeoservicesHarmonie.url,
|
|
43906
|
+
name: 'air_pressure_at_sea_level',
|
|
43907
|
+
id: webmapUtils.generateLayerId(),
|
|
43908
|
+
layerType: LayerType.mapLayer,
|
|
43909
|
+
enabled: true
|
|
43910
|
+
};
|
|
43911
|
+
const harmonieWindFlags = {
|
|
43912
|
+
service: KNMIgeoservicesHarmonie.url,
|
|
43913
|
+
name: 'wind__at_10m',
|
|
43914
|
+
enabled: true,
|
|
43915
|
+
id: webmapUtils.generateLayerId(),
|
|
43916
|
+
layerType: LayerType.mapLayer
|
|
43917
|
+
};
|
|
43918
|
+
const klimaatAtlasTG3 = {
|
|
43919
|
+
service: KNMIgeoservicesKlimaatAtlas.url,
|
|
43920
|
+
name: 'TG3',
|
|
43921
|
+
enabled: true,
|
|
43922
|
+
id: webmapUtils.generateLayerId(),
|
|
43923
|
+
layerType: LayerType.mapLayer
|
|
43924
|
+
};
|
|
43925
|
+
// DWD Layers List
|
|
43926
|
+
const dwdWarningLayer = {
|
|
43927
|
+
service: DWDWarnings.url,
|
|
43928
|
+
name: 'Warnungen_Gemeinden_vereinigt',
|
|
43929
|
+
format: 'image/png',
|
|
43930
|
+
// style: 'warnungen_gemeinden_vereinigt_event_seamless_param',
|
|
43931
|
+
enabled: true,
|
|
43932
|
+
id: webmapUtils.generateLayerId(),
|
|
43933
|
+
layerType: LayerType.mapLayer
|
|
43934
|
+
};
|
|
43935
|
+
const dwdRadarLayer = {
|
|
43936
|
+
service: DWDWXProdukt.url,
|
|
43937
|
+
name: 'WX-Produkt',
|
|
43938
|
+
format: 'image/png',
|
|
43939
|
+
enabled: true,
|
|
43940
|
+
id: webmapUtils.generateLayerId(),
|
|
43941
|
+
layerType: LayerType.mapLayer
|
|
43942
|
+
};
|
|
43943
|
+
// this needs authentication to work
|
|
43944
|
+
const dwdObservationsWetterLayer = {
|
|
43945
|
+
service: DWDObservations.url,
|
|
43946
|
+
name: 'Wetter_Beobachtungen',
|
|
43947
|
+
style: 'Wetter_Symbole',
|
|
43948
|
+
format: 'image/png',
|
|
43949
|
+
enabled: true,
|
|
43950
|
+
id: webmapUtils.generateLayerId(),
|
|
43951
|
+
layerType: LayerType.mapLayer
|
|
43952
|
+
// headers: [{ name: 'Authorization', value: 'Basic ...' }]
|
|
43953
|
+
};
|
|
43954
|
+
|
|
43955
|
+
const dwdObservationsWetterLayerWithHeader = {
|
|
43956
|
+
service: DWDObservations.url,
|
|
43957
|
+
name: 'Wetter_Beobachtungen',
|
|
43958
|
+
style: 'Wetter_Symbole',
|
|
43959
|
+
format: 'image/png',
|
|
43960
|
+
enabled: true,
|
|
43961
|
+
id: webmapUtils.generateLayerId(),
|
|
43962
|
+
layerType: LayerType.mapLayer,
|
|
43963
|
+
headers: [{
|
|
43964
|
+
name: 'authorization',
|
|
43965
|
+
value: 'Basic aW50cmFuZXQtdXNlcjpDQnMjMTEh'
|
|
43966
|
+
}]
|
|
43967
|
+
};
|
|
43968
|
+
// this needs authentication to work
|
|
43969
|
+
const dwdObservationsWindLayer = {
|
|
43970
|
+
service: DWDObservations.url,
|
|
43971
|
+
name: 'Wetter_Beobachtungen',
|
|
43972
|
+
style: 'Wetter_Wind',
|
|
43973
|
+
format: 'image/png',
|
|
43974
|
+
enabled: true,
|
|
43975
|
+
id: webmapUtils.generateLayerId(),
|
|
43976
|
+
layerType: LayerType.mapLayer
|
|
43977
|
+
};
|
|
43978
|
+
// FMI open wms Layers List
|
|
43979
|
+
const FMITemp = {
|
|
43980
|
+
service: FMIopenwms.url,
|
|
43981
|
+
name: 'temperature-forecast',
|
|
43982
|
+
format: 'image/png',
|
|
43983
|
+
enabled: true,
|
|
43984
|
+
id: webmapUtils.generateLayerId(),
|
|
43985
|
+
layerType: LayerType.mapLayer
|
|
43986
|
+
};
|
|
43987
|
+
// Met Norway Layers List
|
|
43988
|
+
const MetNoTemp = {
|
|
43989
|
+
service: MetNorwayService.url,
|
|
43990
|
+
name: 'thredds_meps_latest_wind',
|
|
43991
|
+
format: 'image/png',
|
|
43992
|
+
enabled: true,
|
|
43993
|
+
id: webmapUtils.generateLayerId(),
|
|
43994
|
+
layerType: LayerType.mapLayer
|
|
43995
|
+
};
|
|
43996
|
+
const metNorwayWind1 = {
|
|
43997
|
+
service: MetNorwayService.url,
|
|
43998
|
+
name: 'thredds_meps_latest_wind',
|
|
43999
|
+
format: 'image/png',
|
|
44000
|
+
enabled: true,
|
|
44001
|
+
id: webmapUtils.generateLayerId(),
|
|
44002
|
+
layerType: LayerType.mapLayer
|
|
44003
|
+
};
|
|
44004
|
+
const metNorwayWind2 = {
|
|
44005
|
+
service: MetNorwayService.url,
|
|
44006
|
+
name: 'thredds_aromearctic_extracted_t',
|
|
44007
|
+
format: 'image/png',
|
|
44008
|
+
enabled: true,
|
|
44009
|
+
id: webmapUtils.generateLayerId(),
|
|
44010
|
+
layerType: LayerType.mapLayer
|
|
44011
|
+
};
|
|
44012
|
+
const metNorwayWind3 = {
|
|
44013
|
+
service: MetNorwayService.url,
|
|
44014
|
+
name: 'thredds_nk800_temperature',
|
|
44015
|
+
format: 'image/png',
|
|
44016
|
+
enabled: true,
|
|
44017
|
+
id: webmapUtils.generateLayerId(),
|
|
44018
|
+
layerType: LayerType.mapLayer
|
|
44019
|
+
};
|
|
44020
|
+
const metNorwayLatestT = {
|
|
44021
|
+
service: MetNorwayService.url,
|
|
44022
|
+
name: 'thredds_meps_latest_t',
|
|
44023
|
+
format: 'image/png',
|
|
44024
|
+
enabled: true,
|
|
44025
|
+
id: webmapUtils.generateLayerId(),
|
|
44026
|
+
layerType: LayerType.mapLayer
|
|
44027
|
+
};
|
|
44028
|
+
const metNorwaySalinaty = {
|
|
44029
|
+
service: MetNorwayService.url,
|
|
44030
|
+
name: 'thredds_barents_2_5km_1h_salinity',
|
|
44031
|
+
format: 'image/png',
|
|
44032
|
+
enabled: true,
|
|
44033
|
+
id: webmapUtils.generateLayerId(),
|
|
44034
|
+
layerType: LayerType.mapLayer
|
|
44035
|
+
};
|
|
44036
|
+
const msgFesEUMETSAT = {
|
|
44037
|
+
service: EUMETSAT.url,
|
|
44038
|
+
name: 'msg_fes:rgb_eview',
|
|
44039
|
+
enabled: true,
|
|
44040
|
+
id: webmapUtils.generateLayerId(),
|
|
44041
|
+
layerType: LayerType.mapLayer
|
|
44042
|
+
};
|
|
44043
|
+
const msgNaturalenhncdEUMETSAT = {
|
|
44044
|
+
service: eumetviewEUMETSAT.url,
|
|
44045
|
+
name: 'meteosat:msg_naturalenhncd',
|
|
44046
|
+
enabled: true,
|
|
44047
|
+
id: webmapUtils.generateLayerId(),
|
|
44048
|
+
layerType: LayerType.mapLayer
|
|
44049
|
+
};
|
|
44050
|
+
const msgAshEUMETSAT = {
|
|
44051
|
+
service: eumetviewEUMETSAT.url,
|
|
44052
|
+
name: 'meteosat:msg_ash',
|
|
44053
|
+
enabled: true,
|
|
44054
|
+
id: webmapUtils.generateLayerId(),
|
|
44055
|
+
layerType: LayerType.mapLayer
|
|
44056
|
+
};
|
|
44057
|
+
const msgCthEUMETSAT = {
|
|
44058
|
+
service: eumetviewEUMETSAT.url,
|
|
44059
|
+
name: 'meteosat:msg_cth',
|
|
44060
|
+
enabled: true,
|
|
44061
|
+
id: webmapUtils.generateLayerId(),
|
|
44062
|
+
layerType: LayerType.mapLayer
|
|
44063
|
+
};
|
|
44064
|
+
const msgFogEUMETSAT = {
|
|
44065
|
+
service: eumetviewEUMETSAT.url,
|
|
44066
|
+
name: 'meteosat:msg_fog',
|
|
44067
|
+
enabled: true,
|
|
44068
|
+
id: webmapUtils.generateLayerId(),
|
|
44069
|
+
layerType: LayerType.mapLayer
|
|
44070
|
+
};
|
|
44071
|
+
const msgNaturalEUMETSAT = {
|
|
44072
|
+
service: eumetviewEUMETSAT.url,
|
|
44073
|
+
name: 'meteosat:msg_natural',
|
|
44074
|
+
enabled: true,
|
|
44075
|
+
id: webmapUtils.generateLayerId(),
|
|
44076
|
+
layerType: LayerType.mapLayer
|
|
44077
|
+
};
|
|
44078
|
+
|
|
44079
|
+
var publicLayers = /*#__PURE__*/Object.freeze({
|
|
44080
|
+
__proto__: null,
|
|
44081
|
+
defaultLayers: defaultLayers,
|
|
44082
|
+
baseLayer: baseLayer,
|
|
44083
|
+
baseLayerOpenStreetMapNL: baseLayerOpenStreetMapNL,
|
|
44084
|
+
baseLayerArcGisCanvas: baseLayerArcGisCanvas,
|
|
44085
|
+
baseLayerWorldMap: baseLayerWorldMap,
|
|
44086
|
+
baseLayerHeiGit: baseLayerHeiGit,
|
|
44087
|
+
msgCppLayer: msgCppLayer,
|
|
44088
|
+
veiligheidsRegiosGebiedsIndelingenLabels: veiligheidsRegiosGebiedsIndelingenLabels,
|
|
44089
|
+
veiligheidsRegiosGebiedsIndelingen: veiligheidsRegiosGebiedsIndelingen,
|
|
44090
|
+
radarLayer: radarLayer,
|
|
44091
|
+
radarLayerWithError: radarLayerWithError,
|
|
44092
|
+
obsAirTemperature: obsAirTemperature,
|
|
44093
|
+
obsWind: obsWind,
|
|
44094
|
+
obsAirPressureAtSeaLevel: obsAirPressureAtSeaLevel,
|
|
44095
|
+
obsRelativeHumidity: obsRelativeHumidity,
|
|
44096
|
+
obsGlobalSolarRadiation: obsGlobalSolarRadiation,
|
|
44097
|
+
obsPrecipitationIntensityPWS: obsPrecipitationIntensityPWS,
|
|
44098
|
+
harmonieRelativeHumidityPl: harmonieRelativeHumidityPl,
|
|
44099
|
+
harmonieWindPl: harmonieWindPl,
|
|
44100
|
+
harmonieAirTemperature: harmonieAirTemperature,
|
|
44101
|
+
harmoniePrecipitation: harmoniePrecipitation,
|
|
44102
|
+
harmoniePressure: harmoniePressure,
|
|
44103
|
+
harmonieWindFlags: harmonieWindFlags,
|
|
44104
|
+
klimaatAtlasTG3: klimaatAtlasTG3,
|
|
44105
|
+
dwdWarningLayer: dwdWarningLayer,
|
|
44106
|
+
dwdRadarLayer: dwdRadarLayer,
|
|
44107
|
+
dwdObservationsWetterLayer: dwdObservationsWetterLayer,
|
|
44108
|
+
dwdObservationsWetterLayerWithHeader: dwdObservationsWetterLayerWithHeader,
|
|
44109
|
+
dwdObservationsWindLayer: dwdObservationsWindLayer,
|
|
44110
|
+
FMITemp: FMITemp,
|
|
44111
|
+
MetNoTemp: MetNoTemp,
|
|
44112
|
+
metNorwayWind1: metNorwayWind1,
|
|
44113
|
+
metNorwayWind2: metNorwayWind2,
|
|
44114
|
+
metNorwayWind3: metNorwayWind3,
|
|
44115
|
+
metNorwayLatestT: metNorwayLatestT,
|
|
44116
|
+
metNorwaySalinaty: metNorwaySalinaty,
|
|
44117
|
+
msgFesEUMETSAT: msgFesEUMETSAT,
|
|
44118
|
+
msgNaturalenhncdEUMETSAT: msgNaturalenhncdEUMETSAT,
|
|
44119
|
+
msgAshEUMETSAT: msgAshEUMETSAT,
|
|
44120
|
+
msgCthEUMETSAT: msgCthEUMETSAT,
|
|
44121
|
+
msgFogEUMETSAT: msgFogEUMETSAT,
|
|
44122
|
+
msgNaturalEUMETSAT: msgNaturalEUMETSAT
|
|
44123
|
+
});
|
|
44124
|
+
|
|
44125
|
+
export { CanvasComponent, DRAWMODE, EDITMODE, Legend, LegendDialog, LegendLayout, MapControlButton, MapControls, MapDrawContainer, MapTime, MapView, MapViewLayer, ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION, ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO, ReactMapView, ReactMapViewLayer, ZoomControls, addFeatureProperties, checkHoverFeatures, createInterSections, defaultLayers, defaultStyleProperties, defaultTimeFormat, distance, emptyGeoJSON, featureBox, featureMultiPoint, featurePoint, featurePolygon, formatTime, getDrawFunctionFromStore, getFeatureCollection, getGeoJson, getTimeDimension, intersectGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isGeoJSONFeatureCreatedByTool, lineString, publicLayers, publicServices, registerDrawFunction, simpleBoxGeoJSON, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON };
|