@banyan_cloud/roots 1.0.56 → 1.0.58
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/dist/cjs/index.js +2369 -286
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +2368 -288
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +2368 -288
- package/package.json +4 -1
- package/styles/_colors.exports.scss +2 -1
package/dist/cjs/index.js
CHANGED
|
@@ -80,6 +80,33 @@ function _defineProperty$1(obj, key, value) {
|
|
|
80
80
|
}
|
|
81
81
|
return obj;
|
|
82
82
|
}
|
|
83
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
84
|
+
if (source == null) return {};
|
|
85
|
+
var target = {};
|
|
86
|
+
var sourceKeys = Object.keys(source);
|
|
87
|
+
var key, i;
|
|
88
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
89
|
+
key = sourceKeys[i];
|
|
90
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
91
|
+
target[key] = source[key];
|
|
92
|
+
}
|
|
93
|
+
return target;
|
|
94
|
+
}
|
|
95
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
96
|
+
if (source == null) return {};
|
|
97
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
98
|
+
var key, i;
|
|
99
|
+
if (Object.getOwnPropertySymbols) {
|
|
100
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
101
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
102
|
+
key = sourceSymbolKeys[i];
|
|
103
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
104
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
105
|
+
target[key] = source[key];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return target;
|
|
109
|
+
}
|
|
83
110
|
function _slicedToArray(arr, i) {
|
|
84
111
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
|
|
85
112
|
}
|
|
@@ -3296,10 +3323,6 @@ Accordion.defaultProps = {
|
|
|
3296
3323
|
onExpand: null
|
|
3297
3324
|
};
|
|
3298
3325
|
|
|
3299
|
-
var css$Q = ".Alert_module_root__b5fc9a1d {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n position: fixed;\n padding: 0.938rem;\n width: 500px;\n}\n.Alert_module_root__b5fc9a1d.Alert_module_positionBottomCenter__b5fc9a1d {\n left: 50%;\n bottom: 1rem;\n transform: translate(-50%, 0);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_positionTopRight__b5fc9a1d {\n right: 1rem;\n top: 1rem;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_left__b5fc9a1d {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: flex-start;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_left__b5fc9a1d .Alert_module_icons__b5fc9a1d {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 0.313rem 0.938rem 0rem 0rem;\n height: auto;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_left__b5fc9a1d .Alert_module_icons__b5fc9a1d .Alert_module_icon__b5fc9a1d {\n width: 1.25rem;\n height: 1.25rem;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_left__b5fc9a1d .Alert_module_content__b5fc9a1d {\n padding: 0.188rem 0.938rem 0rem 0rem;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_left__b5fc9a1d .Alert_module_content__b5fc9a1d .Alert_module_title__b5fc9a1d {\n font-size: 0.875rem;\n font-weight: 600;\n padding-right: 2px;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_left__b5fc9a1d .Alert_module_content__b5fc9a1d .Alert_module_description__b5fc9a1d {\n word-wrap: break-word;\n height: auto;\n font-size: 0.875rem;\n font-weight: 400;\n margin-bottom: 0.5rem;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_actions__b5fc9a1d {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n gap: 5px;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_actions__b5fc9a1d .Alert_module_button__b5fc9a1d {\n padding: 0.313rem 1rem;\n font-weight: 400;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_actions__b5fc9a1d .Alert_module_close__b5fc9a1d {\n padding-top: 0.313rem;\n}\n.Alert_module_root__b5fc9a1d .Alert_module_actions__b5fc9a1d .Alert_module_close__b5fc9a1d .Alert_module_icon__b5fc9a1d {\n width: 1.25rem;\n height: 1.25rem;\n fill: var(--black);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_borderDefault__b5fc9a1d {\n border-width: 0.063rem;\n}\n.Alert_module_root__b5fc9a1d.Alert_module_borderThickLeft__b5fc9a1d {\n border-width: 0.063rem 0.063rem 0.063rem 0.25rem;\n}\n.Alert_module_root__b5fc9a1d.Alert_module_borderNone__b5fc9a1d {\n border-width: 0rem 0rem 0rem 0.25rem;\n}\n.Alert_module_root__b5fc9a1d.Alert_module_info__b5fc9a1d {\n border-style: solid;\n border-color: var(--info);\n background-color: #edf5ff;\n}\n.Alert_module_root__b5fc9a1d.Alert_module_info__b5fc9a1d .Alert_module_icon__b5fc9a1d {\n fill: var(--info);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_success__b5fc9a1d {\n border-style: solid;\n border-color: var(--success);\n background-color: var(--success-bg);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_success__b5fc9a1d .Alert_module_icon__b5fc9a1d {\n fill: var(--success);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_danger__b5fc9a1d {\n border-style: solid;\n border-color: var(--error);\n background-color: var(--error-bg);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_danger__b5fc9a1d .Alert_module_icon__b5fc9a1d {\n fill: var(--error);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_warning__b5fc9a1d {\n border-style: solid;\n border-color: var(--warning);\n background-color: var(--warning-bg);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_warning__b5fc9a1d .Alert_module_icon__b5fc9a1d {\n fill: var(--warning);\n}\n.Alert_module_root__b5fc9a1d.Alert_module_shadow__b5fc9a1d {\n box-shadow: 0.125rem 0.5rem 1rem rgba(60, 60, 60, 0.12);\n}";
|
|
3300
|
-
var modules_3a764ea3 = {"root":"Alert_module_root__b5fc9a1d","position-bottom-center":"Alert_module_positionBottomCenter__b5fc9a1d","position-top-right":"Alert_module_positionTopRight__b5fc9a1d","left":"Alert_module_left__b5fc9a1d","icons":"Alert_module_icons__b5fc9a1d","icon":"Alert_module_icon__b5fc9a1d","content":"Alert_module_content__b5fc9a1d","title":"Alert_module_title__b5fc9a1d","description":"Alert_module_description__b5fc9a1d","actions":"Alert_module_actions__b5fc9a1d","button":"Alert_module_button__b5fc9a1d","close":"Alert_module_close__b5fc9a1d","border-default":"Alert_module_borderDefault__b5fc9a1d","border-thick-left":"Alert_module_borderThickLeft__b5fc9a1d","border-none":"Alert_module_borderNone__b5fc9a1d","info":"Alert_module_info__b5fc9a1d","success":"Alert_module_success__b5fc9a1d","danger":"Alert_module_danger__b5fc9a1d","warning":"Alert_module_warning__b5fc9a1d","shadow":"Alert_module_shadow__b5fc9a1d"};
|
|
3301
|
-
n(css$Q,{});
|
|
3302
|
-
|
|
3303
3326
|
function getSide(placement) {
|
|
3304
3327
|
return placement.split('-')[0];
|
|
3305
3328
|
}
|
|
@@ -3584,7 +3607,7 @@ async function detectOverflow(middlewareArguments, options) {
|
|
|
3584
3607
|
const min$3 = Math.min;
|
|
3585
3608
|
const max$3 = Math.max;
|
|
3586
3609
|
|
|
3587
|
-
function within(min$1, value, max$1) {
|
|
3610
|
+
function within$1(min$1, value, max$1) {
|
|
3588
3611
|
return max$3(min$1, min$3(value, max$1));
|
|
3589
3612
|
}
|
|
3590
3613
|
|
|
@@ -3645,7 +3668,7 @@ const arrow$1 = options => ({
|
|
|
3645
3668
|
const min = paddingObject[minProp];
|
|
3646
3669
|
const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
|
3647
3670
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
3648
|
-
const offset = within(min, center, max); // Make sure that arrow points at the reference
|
|
3671
|
+
const offset = within$1(min, center, max); // Make sure that arrow points at the reference
|
|
3649
3672
|
|
|
3650
3673
|
const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
|
|
3651
3674
|
const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
|
|
@@ -3944,7 +3967,7 @@ const shift = function (options) {
|
|
|
3944
3967
|
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
3945
3968
|
const min = mainAxisCoord + overflow[minSide];
|
|
3946
3969
|
const max = mainAxisCoord - overflow[maxSide];
|
|
3947
|
-
mainAxisCoord = within(min, mainAxisCoord, max);
|
|
3970
|
+
mainAxisCoord = within$1(min, mainAxisCoord, max);
|
|
3948
3971
|
}
|
|
3949
3972
|
|
|
3950
3973
|
if (checkCrossAxis) {
|
|
@@ -3952,7 +3975,7 @@ const shift = function (options) {
|
|
|
3952
3975
|
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
3953
3976
|
const min = crossAxisCoord + overflow[minSide];
|
|
3954
3977
|
const max = crossAxisCoord - overflow[maxSide];
|
|
3955
|
-
crossAxisCoord = within(min, crossAxisCoord, max);
|
|
3978
|
+
crossAxisCoord = within$1(min, crossAxisCoord, max);
|
|
3956
3979
|
}
|
|
3957
3980
|
|
|
3958
3981
|
const limitedCoords = limiter.fn({ ...middlewareArguments,
|
|
@@ -5258,10 +5281,10 @@ function getChildren(nodes, id) {
|
|
|
5258
5281
|
return allChildren;
|
|
5259
5282
|
}
|
|
5260
5283
|
|
|
5261
|
-
const DEFAULT_ID = 'floating-ui-root';
|
|
5284
|
+
const DEFAULT_ID$1 = 'floating-ui-root';
|
|
5262
5285
|
const useFloatingPortalNode = function (_temp) {
|
|
5263
5286
|
let {
|
|
5264
|
-
id = DEFAULT_ID,
|
|
5287
|
+
id = DEFAULT_ID$1,
|
|
5265
5288
|
enabled = true
|
|
5266
5289
|
} = _temp === void 0 ? {} : _temp;
|
|
5267
5290
|
const [portalEl, setPortalEl] = React__namespace.useState(null);
|
|
@@ -5294,7 +5317,7 @@ const useFloatingPortalNode = function (_temp) {
|
|
|
5294
5317
|
const FloatingPortal = _ref => {
|
|
5295
5318
|
let {
|
|
5296
5319
|
children,
|
|
5297
|
-
id = DEFAULT_ID,
|
|
5320
|
+
id = DEFAULT_ID$1,
|
|
5298
5321
|
root = null
|
|
5299
5322
|
} = _ref;
|
|
5300
5323
|
const portalNode = useFloatingPortalNode({
|
|
@@ -7136,6 +7159,10 @@ const useListNavigation = function (_ref, _temp2) {
|
|
|
7136
7159
|
};
|
|
7137
7160
|
};
|
|
7138
7161
|
|
|
7162
|
+
var css$Q = ".Alert_module_root__f2bc8467 {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n position: fixed;\n padding: 0.938rem;\n width: 500px;\n}\n.Alert_module_root__f2bc8467.Alert_module_positionBottomCenter__f2bc8467 {\n left: 50%;\n bottom: 1rem;\n transform: translate(-50%, 0);\n}\n.Alert_module_root__f2bc8467.Alert_module_positionTopRight__f2bc8467 {\n right: 1rem;\n top: 1rem;\n}\n.Alert_module_root__f2bc8467 .Alert_module_left__f2bc8467 {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: flex-start;\n}\n.Alert_module_root__f2bc8467 .Alert_module_left__f2bc8467 .Alert_module_icons__f2bc8467 {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 0.313rem 0.938rem 0rem 0rem;\n height: auto;\n}\n.Alert_module_root__f2bc8467 .Alert_module_left__f2bc8467 .Alert_module_icons__f2bc8467 .Alert_module_icon__f2bc8467 {\n width: 1.25rem;\n height: 1.25rem;\n}\n.Alert_module_root__f2bc8467 .Alert_module_left__f2bc8467 .Alert_module_content__f2bc8467 {\n padding: 0.188rem 0.938rem 0rem 0rem;\n}\n.Alert_module_root__f2bc8467 .Alert_module_left__f2bc8467 .Alert_module_content__f2bc8467 .Alert_module_title__f2bc8467 {\n font-size: 0.875rem;\n font-weight: 600;\n padding-right: 2px;\n}\n.Alert_module_root__f2bc8467 .Alert_module_left__f2bc8467 .Alert_module_content__f2bc8467 .Alert_module_description__f2bc8467 {\n word-wrap: break-word;\n height: auto;\n font-size: 0.875rem;\n font-weight: 400;\n margin-bottom: 0.5rem;\n}\n.Alert_module_root__f2bc8467 .Alert_module_actions__f2bc8467 {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n gap: 5px;\n}\n.Alert_module_root__f2bc8467 .Alert_module_actions__f2bc8467 .Alert_module_button__f2bc8467 {\n padding: 0.313rem 1rem;\n font-weight: 400;\n}\n.Alert_module_root__f2bc8467 .Alert_module_actions__f2bc8467 .Alert_module_close__f2bc8467 {\n height: auto;\n}\n.Alert_module_root__f2bc8467 .Alert_module_actions__f2bc8467 .Alert_module_close__f2bc8467 .Alert_module_icon__f2bc8467 {\n width: 1.25rem;\n height: 1.25rem;\n fill: var(--black);\n}\n.Alert_module_root__f2bc8467.Alert_module_borderDefault__f2bc8467 {\n border-width: 0.063rem;\n}\n.Alert_module_root__f2bc8467.Alert_module_borderThickLeft__f2bc8467 {\n border-width: 0.063rem 0.063rem 0.063rem 0.25rem;\n}\n.Alert_module_root__f2bc8467.Alert_module_borderNone__f2bc8467 {\n border-width: 0rem 0rem 0rem 0.25rem;\n}\n.Alert_module_root__f2bc8467.Alert_module_info__f2bc8467 {\n border-style: solid;\n border-color: var(--info);\n background-color: #edf5ff;\n}\n.Alert_module_root__f2bc8467.Alert_module_info__f2bc8467 .Alert_module_icon__f2bc8467 {\n fill: var(--info);\n}\n.Alert_module_root__f2bc8467.Alert_module_success__f2bc8467 {\n border-style: solid;\n border-color: var(--success);\n background-color: var(--success-bg);\n}\n.Alert_module_root__f2bc8467.Alert_module_success__f2bc8467 .Alert_module_icon__f2bc8467 {\n fill: var(--success);\n}\n.Alert_module_root__f2bc8467.Alert_module_danger__f2bc8467 {\n border-style: solid;\n border-color: var(--error);\n background-color: var(--error-bg);\n}\n.Alert_module_root__f2bc8467.Alert_module_danger__f2bc8467 .Alert_module_icon__f2bc8467 {\n fill: var(--error);\n}\n.Alert_module_root__f2bc8467.Alert_module_warning__f2bc8467 {\n border-style: solid;\n border-color: var(--warning);\n background-color: var(--warning-bg);\n}\n.Alert_module_root__f2bc8467.Alert_module_warning__f2bc8467 .Alert_module_icon__f2bc8467 {\n fill: var(--warning);\n}\n.Alert_module_root__f2bc8467.Alert_module_shadow__f2bc8467 {\n box-shadow: 0.125rem 0.5rem 1rem rgba(60, 60, 60, 0.12);\n}";
|
|
7163
|
+
var modules_3a764ea3 = {"root":"Alert_module_root__f2bc8467","position-bottom-center":"Alert_module_positionBottomCenter__f2bc8467","position-top-right":"Alert_module_positionTopRight__f2bc8467","left":"Alert_module_left__f2bc8467","icons":"Alert_module_icons__f2bc8467","icon":"Alert_module_icon__f2bc8467","content":"Alert_module_content__f2bc8467","title":"Alert_module_title__f2bc8467","description":"Alert_module_description__f2bc8467","actions":"Alert_module_actions__f2bc8467","button":"Alert_module_button__f2bc8467","close":"Alert_module_close__f2bc8467","border-default":"Alert_module_borderDefault__f2bc8467","border-thick-left":"Alert_module_borderThickLeft__f2bc8467","border-none":"Alert_module_borderNone__f2bc8467","info":"Alert_module_info__f2bc8467","success":"Alert_module_success__f2bc8467","danger":"Alert_module_danger__f2bc8467","warning":"Alert_module_warning__f2bc8467","shadow":"Alert_module_shadow__f2bc8467"};
|
|
7164
|
+
n(css$Q,{});
|
|
7165
|
+
|
|
7139
7166
|
var css$P = ".Popper_module_backdrop__0c794282 {\n position: fixed;\n z-index: 100;\n inset: 0;\n background: rgba(0, 0, 0, 0.4);\n}\n.Popper_module_backdrop__0c794282.Popper_module_transparent__0c794282 {\n background: none;\n}\n.Popper_module_backdrop__0c794282.Popper_module_hideBackdrop__0c794282 {\n position: static !important;\n}";
|
|
7140
7167
|
var modules_fe46b225 = {"backdrop":"Popper_module_backdrop__0c794282","transparent":"Popper_module_transparent__0c794282","hide-backdrop":"Popper_module_hideBackdrop__0c794282"};
|
|
7141
7168
|
n(css$P,{});
|
|
@@ -7181,101 +7208,6 @@ Popper.defaultProps = {
|
|
|
7181
7208
|
transparent: true
|
|
7182
7209
|
};
|
|
7183
7210
|
|
|
7184
|
-
var useRowFilter = function useRowFilter(props) {
|
|
7185
|
-
var _props$initialState = props.initialState,
|
|
7186
|
-
initialState = _props$initialState === void 0 ? {} : _props$initialState,
|
|
7187
|
-
_props$length = props.length,
|
|
7188
|
-
length = _props$length === void 0 ? 0 : _props$length,
|
|
7189
|
-
tableData = props.tableData;
|
|
7190
|
-
var _useState = React.useState(function () {
|
|
7191
|
-
return _toConsumableArray$1(Array(length).keys()).fill(initialState);
|
|
7192
|
-
}),
|
|
7193
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
7194
|
-
filters = _useState2[0],
|
|
7195
|
-
setFilters = _useState2[1];
|
|
7196
|
-
React.useEffect(function () {
|
|
7197
|
-
setFilters(_toConsumableArray$1(Array(length).keys()).fill(initialState));
|
|
7198
|
-
}, [initialState, length, tableData]);
|
|
7199
|
-
|
|
7200
|
-
/**
|
|
7201
|
-
*
|
|
7202
|
-
* @param {number} index - row index
|
|
7203
|
-
* @param {string} name - filter name / column id
|
|
7204
|
-
* @param {Array} value - filter value / checked items
|
|
7205
|
-
*/
|
|
7206
|
-
var applyFilter = function applyFilter(index, name) {
|
|
7207
|
-
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
7208
|
-
setFilters(function (prevFilters) {
|
|
7209
|
-
var newFilters = cloneDeep(prevFilters);
|
|
7210
|
-
newFilters.splice(index, 1, _objectSpread2(_objectSpread2({}, newFilters[index]), {}, _defineProperty$1({}, name, value)));
|
|
7211
|
-
return newFilters;
|
|
7212
|
-
});
|
|
7213
|
-
};
|
|
7214
|
-
return {
|
|
7215
|
-
filters: filters,
|
|
7216
|
-
applyFilter: applyFilter
|
|
7217
|
-
};
|
|
7218
|
-
};
|
|
7219
|
-
|
|
7220
|
-
var useOutsideClickListener = function useOutsideClickListener(ref, callback) {
|
|
7221
|
-
React.useEffect(function () {
|
|
7222
|
-
var handleClickOutside = function handleClickOutside(event) {
|
|
7223
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
|
7224
|
-
callback();
|
|
7225
|
-
}
|
|
7226
|
-
};
|
|
7227
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
7228
|
-
return function () {
|
|
7229
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
7230
|
-
};
|
|
7231
|
-
}, [ref]);
|
|
7232
|
-
};
|
|
7233
|
-
|
|
7234
|
-
var useResize = function useResize(props) {
|
|
7235
|
-
var ref = props.ref,
|
|
7236
|
-
_props$styles = props.styles,
|
|
7237
|
-
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
7238
|
-
enabled = props.enabled;
|
|
7239
|
-
var minWidth = styles.minWidth,
|
|
7240
|
-
maxWidth = styles.maxWidth,
|
|
7241
|
-
borderSize = styles.borderSize;
|
|
7242
|
-
React.useEffect(function () {
|
|
7243
|
-
if (enabled) {
|
|
7244
|
-
var _ref$current, _ref$current$getBound, _ref$current3;
|
|
7245
|
-
var mPos = null;
|
|
7246
|
-
var itemRect = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$getBound = _ref$current.getBoundingClientRect) === null || _ref$current$getBound === void 0 ? void 0 : _ref$current$getBound.call(_ref$current);
|
|
7247
|
-
var resize = function resize(event) {
|
|
7248
|
-
var dX = event.x - mPos;
|
|
7249
|
-
// eslint-disable-next-line no-param-reassign
|
|
7250
|
-
var newWidth = parseInt(itemRect.width, 10) + dX;
|
|
7251
|
-
if (newWidth > minWidth && newWidth < maxWidth && ref.current != null) {
|
|
7252
|
-
ref.current.style.width = "".concat(newWidth, "px");
|
|
7253
|
-
}
|
|
7254
|
-
};
|
|
7255
|
-
var onMouseDown = function onMouseDown(evt) {
|
|
7256
|
-
if (itemRect.width - evt.offsetX < borderSize) {
|
|
7257
|
-
mPos = evt.x;
|
|
7258
|
-
document.addEventListener('mousemove', resize);
|
|
7259
|
-
}
|
|
7260
|
-
};
|
|
7261
|
-
var onMouseUp = function onMouseUp(evt) {
|
|
7262
|
-
var _ref$current2, _ref$current2$getBoun, _ref$current2$getBoun2;
|
|
7263
|
-
mPos = evt.x;
|
|
7264
|
-
itemRect.width = ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : (_ref$current2$getBoun = _ref$current2.getBoundingClientRect) === null || _ref$current2$getBoun === void 0 ? void 0 : (_ref$current2$getBoun2 = _ref$current2$getBoun.call(_ref$current2)) === null || _ref$current2$getBoun2 === void 0 ? void 0 : _ref$current2$getBoun2.width;
|
|
7265
|
-
document.removeEventListener('mousemove', resize);
|
|
7266
|
-
};
|
|
7267
|
-
ref === null || ref === void 0 ? void 0 : (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.addEventListener('mousedown', onMouseDown, false);
|
|
7268
|
-
document.documentElement.addEventListener('mouseup', onMouseUp, false);
|
|
7269
|
-
return function () {
|
|
7270
|
-
var _ref$current4, _ref$current4$removeE;
|
|
7271
|
-
ref === null || ref === void 0 ? void 0 : (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : (_ref$current4$removeE = _ref$current4.removeEventListener) === null || _ref$current4$removeE === void 0 ? void 0 : _ref$current4$removeE.call(_ref$current4, 'mousedown', onMouseDown, false);
|
|
7272
|
-
document.documentElement.removeEventListener('mouseup', onMouseUp, false);
|
|
7273
|
-
};
|
|
7274
|
-
}
|
|
7275
|
-
return function () {};
|
|
7276
|
-
}, [enabled]);
|
|
7277
|
-
};
|
|
7278
|
-
|
|
7279
7211
|
var Alert = function Alert(props) {
|
|
7280
7212
|
var action = props.action,
|
|
7281
7213
|
AlertTypeIcon = props.icon,
|
|
@@ -7321,18 +7253,22 @@ var Alert = function Alert(props) {
|
|
|
7321
7253
|
break;
|
|
7322
7254
|
}
|
|
7323
7255
|
}
|
|
7324
|
-
var
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7256
|
+
var _useFloating = useFloating({
|
|
7257
|
+
open: open,
|
|
7258
|
+
onOpenChange: toggle
|
|
7259
|
+
}),
|
|
7260
|
+
floating = _useFloating.floating,
|
|
7261
|
+
context = _useFloating.context;
|
|
7262
|
+
var _useInteractions = useInteractions([useDismiss(context)]),
|
|
7263
|
+
getFloatingProps = _useInteractions.getFloatingProps;
|
|
7328
7264
|
return /*#__PURE__*/jsxRuntime.jsx(Popper, {
|
|
7329
7265
|
open: open,
|
|
7330
7266
|
className: modules_3a764ea3.popper,
|
|
7331
7267
|
id: "alert-popper",
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7268
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({}, getFloatingProps({
|
|
7269
|
+
ref: floating,
|
|
7270
|
+
className: classes(modules_3a764ea3.root, modules_3a764ea3[color], modules_3a764ea3["border-".concat(border)], shadow ? modules_3a764ea3.shadow : '', modules_3a764ea3["position-".concat(position)])
|
|
7271
|
+
})), {}, {
|
|
7336
7272
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7337
7273
|
className: modules_3a764ea3.left,
|
|
7338
7274
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -7356,15 +7292,19 @@ var Alert = function Alert(props) {
|
|
|
7356
7292
|
variant: "text",
|
|
7357
7293
|
color: "primary",
|
|
7358
7294
|
className: modules_3a764ea3.button
|
|
7359
|
-
}), close && /*#__PURE__*/jsxRuntime.jsx(
|
|
7295
|
+
}), close && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
7296
|
+
size: "auto",
|
|
7297
|
+
variant: "text",
|
|
7360
7298
|
onClick: toggle,
|
|
7361
7299
|
className: modules_3a764ea3.close,
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7300
|
+
leftComponent: function leftComponent() {
|
|
7301
|
+
return /*#__PURE__*/jsxRuntime.jsx(Cross$1, {
|
|
7302
|
+
className: modules_3a764ea3.icon
|
|
7303
|
+
});
|
|
7304
|
+
}
|
|
7365
7305
|
})]
|
|
7366
7306
|
})]
|
|
7367
|
-
})
|
|
7307
|
+
}))
|
|
7368
7308
|
});
|
|
7369
7309
|
};
|
|
7370
7310
|
Alert.propTypes = {
|
|
@@ -7792,7 +7732,7 @@ var checkForListedLanguage = (function (astGenerator, language) {
|
|
|
7792
7732
|
return langs.indexOf(language) !== -1;
|
|
7793
7733
|
});
|
|
7794
7734
|
|
|
7795
|
-
var _excluded = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
|
|
7735
|
+
var _excluded$1 = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
|
|
7796
7736
|
|
|
7797
7737
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7798
7738
|
|
|
@@ -8137,7 +8077,7 @@ function highlight$1 (defaultAstGenerator, defaultStyle) {
|
|
|
8137
8077
|
_ref7$code = _ref7.code,
|
|
8138
8078
|
code = _ref7$code === void 0 ? (Array.isArray(children) ? children[0] : children) || '' : _ref7$code,
|
|
8139
8079
|
astGenerator = _ref7.astGenerator,
|
|
8140
|
-
rest = _objectWithoutProperties(_ref7, _excluded);
|
|
8080
|
+
rest = _objectWithoutProperties(_ref7, _excluded$1);
|
|
8141
8081
|
|
|
8142
8082
|
astGenerator = astGenerator || defaultAstGenerator;
|
|
8143
8083
|
var allLineNumbers = showLineNumbers ? /*#__PURE__*/React.createElement(AllLineNumbers, {
|
|
@@ -8212,18 +8152,18 @@ var supportedLanguages = ['abap', 'abnf', 'actionscript', 'ada', 'agda', 'al', '
|
|
|
8212
8152
|
|
|
8213
8153
|
var hastscript = {exports: {}};
|
|
8214
8154
|
|
|
8215
|
-
var immutable = extend$
|
|
8155
|
+
var immutable = extend$3;
|
|
8216
8156
|
|
|
8217
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
8157
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
8218
8158
|
|
|
8219
|
-
function extend$
|
|
8159
|
+
function extend$3() {
|
|
8220
8160
|
var target = {};
|
|
8221
8161
|
|
|
8222
8162
|
for (var i = 0; i < arguments.length; i++) {
|
|
8223
8163
|
var source = arguments[i];
|
|
8224
8164
|
|
|
8225
8165
|
for (var key in source) {
|
|
8226
|
-
if (hasOwnProperty.call(source, key)) {
|
|
8166
|
+
if (hasOwnProperty$1.call(source, key)) {
|
|
8227
8167
|
target[key] = source[key];
|
|
8228
8168
|
}
|
|
8229
8169
|
}
|
|
@@ -8252,9 +8192,9 @@ function Schema$2(property, normal, space) {
|
|
|
8252
8192
|
var xtend = immutable;
|
|
8253
8193
|
var Schema$1 = schema$1;
|
|
8254
8194
|
|
|
8255
|
-
var merge_1 = merge$
|
|
8195
|
+
var merge_1 = merge$3;
|
|
8256
8196
|
|
|
8257
|
-
function merge$
|
|
8197
|
+
function merge$3(definitions) {
|
|
8258
8198
|
var length = definitions.length;
|
|
8259
8199
|
var property = [];
|
|
8260
8200
|
var normal = [];
|
|
@@ -8836,14 +8776,14 @@ var html$2 = create$2({
|
|
|
8836
8776
|
}
|
|
8837
8777
|
});
|
|
8838
8778
|
|
|
8839
|
-
var merge$
|
|
8779
|
+
var merge$2 = merge_1;
|
|
8840
8780
|
var xlink = xlink$1;
|
|
8841
8781
|
var xml = xml$1;
|
|
8842
8782
|
var xmlns = xmlns$1;
|
|
8843
8783
|
var aria = aria$1;
|
|
8844
8784
|
var html$1 = html$2;
|
|
8845
8785
|
|
|
8846
|
-
var html_1$1 = merge$
|
|
8786
|
+
var html_1$1 = merge$2([xml, xlink, xmlns, aria, html$1]);
|
|
8847
8787
|
|
|
8848
8788
|
var normalize$3 = normalize_1;
|
|
8849
8789
|
var DefinedInfo = definedInfo;
|
|
@@ -11298,7 +11238,7 @@ var radic = "√";
|
|
|
11298
11238
|
var raemptyv = "⦳";
|
|
11299
11239
|
var rang = "⟩";
|
|
11300
11240
|
var rangd = "⦒";
|
|
11301
|
-
var range = "⦥";
|
|
11241
|
+
var range$1 = "⦥";
|
|
11302
11242
|
var rangle = "⟩";
|
|
11303
11243
|
var raqu = "»";
|
|
11304
11244
|
var raquo = "»";
|
|
@@ -13521,7 +13461,7 @@ var require$$0$1 = {
|
|
|
13521
13461
|
raemptyv: raemptyv,
|
|
13522
13462
|
rang: rang,
|
|
13523
13463
|
rangd: rangd,
|
|
13524
|
-
range: range,
|
|
13464
|
+
range: range$1,
|
|
13525
13465
|
rangle: rangle,
|
|
13526
13466
|
raqu: raqu,
|
|
13527
13467
|
raquo: raquo,
|
|
@@ -14008,7 +13948,7 @@ var parseEntities_1 = parseEntities;
|
|
|
14008
13948
|
|
|
14009
13949
|
var own$1 = {}.hasOwnProperty;
|
|
14010
13950
|
var fromCharCode = String.fromCharCode;
|
|
14011
|
-
var noop$
|
|
13951
|
+
var noop$2 = Function.prototype;
|
|
14012
13952
|
|
|
14013
13953
|
// Default settings.
|
|
14014
13954
|
var defaults$1 = {
|
|
@@ -14155,7 +14095,7 @@ function parse$1(value, settings) {
|
|
|
14155
14095
|
prev = now();
|
|
14156
14096
|
|
|
14157
14097
|
// Wrap `handleWarning`.
|
|
14158
|
-
warning = handleWarning ? parseError : noop$
|
|
14098
|
+
warning = handleWarning ? parseError : noop$2;
|
|
14159
14099
|
|
|
14160
14100
|
// Ensure the algorithm walks over the first character and the end
|
|
14161
14101
|
// (inclusive).
|
|
@@ -41795,6 +41735,101 @@ function sub$1(date, duration) {
|
|
|
41795
41735
|
return finalDate;
|
|
41796
41736
|
}
|
|
41797
41737
|
|
|
41738
|
+
var useRowFilter = function useRowFilter(props) {
|
|
41739
|
+
var _props$initialState = props.initialState,
|
|
41740
|
+
initialState = _props$initialState === void 0 ? {} : _props$initialState,
|
|
41741
|
+
_props$length = props.length,
|
|
41742
|
+
length = _props$length === void 0 ? 0 : _props$length,
|
|
41743
|
+
tableData = props.tableData;
|
|
41744
|
+
var _useState = React.useState(function () {
|
|
41745
|
+
return _toConsumableArray$1(Array(length).keys()).fill(initialState);
|
|
41746
|
+
}),
|
|
41747
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41748
|
+
filters = _useState2[0],
|
|
41749
|
+
setFilters = _useState2[1];
|
|
41750
|
+
React.useEffect(function () {
|
|
41751
|
+
setFilters(_toConsumableArray$1(Array(length).keys()).fill(initialState));
|
|
41752
|
+
}, [initialState, length, tableData]);
|
|
41753
|
+
|
|
41754
|
+
/**
|
|
41755
|
+
*
|
|
41756
|
+
* @param {number} index - row index
|
|
41757
|
+
* @param {string} name - filter name / column id
|
|
41758
|
+
* @param {Array} value - filter value / checked items
|
|
41759
|
+
*/
|
|
41760
|
+
var applyFilter = function applyFilter(index, name) {
|
|
41761
|
+
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
41762
|
+
setFilters(function (prevFilters) {
|
|
41763
|
+
var newFilters = cloneDeep(prevFilters);
|
|
41764
|
+
newFilters.splice(index, 1, _objectSpread2(_objectSpread2({}, newFilters[index]), {}, _defineProperty$1({}, name, value)));
|
|
41765
|
+
return newFilters;
|
|
41766
|
+
});
|
|
41767
|
+
};
|
|
41768
|
+
return {
|
|
41769
|
+
filters: filters,
|
|
41770
|
+
applyFilter: applyFilter
|
|
41771
|
+
};
|
|
41772
|
+
};
|
|
41773
|
+
|
|
41774
|
+
var useOutsideClickListener = function useOutsideClickListener(ref, callback) {
|
|
41775
|
+
React.useEffect(function () {
|
|
41776
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
41777
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
41778
|
+
callback();
|
|
41779
|
+
}
|
|
41780
|
+
};
|
|
41781
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
41782
|
+
return function () {
|
|
41783
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
41784
|
+
};
|
|
41785
|
+
}, [ref]);
|
|
41786
|
+
};
|
|
41787
|
+
|
|
41788
|
+
var useResize = function useResize(props) {
|
|
41789
|
+
var ref = props.ref,
|
|
41790
|
+
_props$styles = props.styles,
|
|
41791
|
+
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
41792
|
+
enabled = props.enabled;
|
|
41793
|
+
var minWidth = styles.minWidth,
|
|
41794
|
+
maxWidth = styles.maxWidth,
|
|
41795
|
+
borderSize = styles.borderSize;
|
|
41796
|
+
React.useEffect(function () {
|
|
41797
|
+
if (enabled) {
|
|
41798
|
+
var _ref$current, _ref$current$getBound, _ref$current3;
|
|
41799
|
+
var mPos = null;
|
|
41800
|
+
var itemRect = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$getBound = _ref$current.getBoundingClientRect) === null || _ref$current$getBound === void 0 ? void 0 : _ref$current$getBound.call(_ref$current);
|
|
41801
|
+
var resize = function resize(event) {
|
|
41802
|
+
var dX = event.x - mPos;
|
|
41803
|
+
// eslint-disable-next-line no-param-reassign
|
|
41804
|
+
var newWidth = parseInt(itemRect.width, 10) + dX;
|
|
41805
|
+
if (newWidth > minWidth && newWidth < maxWidth && ref.current != null) {
|
|
41806
|
+
ref.current.style.width = "".concat(newWidth, "px");
|
|
41807
|
+
}
|
|
41808
|
+
};
|
|
41809
|
+
var onMouseDown = function onMouseDown(evt) {
|
|
41810
|
+
if (itemRect.width - evt.offsetX < borderSize) {
|
|
41811
|
+
mPos = evt.x;
|
|
41812
|
+
document.addEventListener('mousemove', resize);
|
|
41813
|
+
}
|
|
41814
|
+
};
|
|
41815
|
+
var onMouseUp = function onMouseUp(evt) {
|
|
41816
|
+
var _ref$current2, _ref$current2$getBoun, _ref$current2$getBoun2;
|
|
41817
|
+
mPos = evt.x;
|
|
41818
|
+
itemRect.width = ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : (_ref$current2$getBoun = _ref$current2.getBoundingClientRect) === null || _ref$current2$getBoun === void 0 ? void 0 : (_ref$current2$getBoun2 = _ref$current2$getBoun.call(_ref$current2)) === null || _ref$current2$getBoun2 === void 0 ? void 0 : _ref$current2$getBoun2.width;
|
|
41819
|
+
document.removeEventListener('mousemove', resize);
|
|
41820
|
+
};
|
|
41821
|
+
ref === null || ref === void 0 ? void 0 : (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.addEventListener('mousedown', onMouseDown, false);
|
|
41822
|
+
document.documentElement.addEventListener('mouseup', onMouseUp, false);
|
|
41823
|
+
return function () {
|
|
41824
|
+
var _ref$current4, _ref$current4$removeE;
|
|
41825
|
+
ref === null || ref === void 0 ? void 0 : (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : (_ref$current4$removeE = _ref$current4.removeEventListener) === null || _ref$current4$removeE === void 0 ? void 0 : _ref$current4$removeE.call(_ref$current4, 'mousedown', onMouseDown, false);
|
|
41826
|
+
document.documentElement.removeEventListener('mouseup', onMouseUp, false);
|
|
41827
|
+
};
|
|
41828
|
+
}
|
|
41829
|
+
return function () {};
|
|
41830
|
+
}, [enabled]);
|
|
41831
|
+
};
|
|
41832
|
+
|
|
41798
41833
|
var css$I = ".Header_module_container__26bf5a9c {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 0rem 1.5625rem;\n}\n.Header_module_container__26bf5a9c .Header_module_title__26bf5a9c {\n font-weight: 400;\n font-size: 0.8rem;\n color: var(--black);\n}\n.Header_module_container__26bf5a9c .Header_module_icon__26bf5a9c {\n width: 1.5rem;\n height: 1.5rem;\n stroke: #181818;\n cursor: pointer;\n}";
|
|
41799
41834
|
var modules_cf337dc1 = {"container":"Header_module_container__26bf5a9c","title":"Header_module_title__26bf5a9c","icon":"Header_module_icon__26bf5a9c"};
|
|
41800
41835
|
n(css$I,{});
|
|
@@ -43596,8 +43631,8 @@ DatePicker.defaultProps = {
|
|
|
43596
43631
|
onClear: function onClear() {}
|
|
43597
43632
|
};
|
|
43598
43633
|
|
|
43599
|
-
var css$v = ".
|
|
43600
|
-
var modules_6d03d164 = {"root":"
|
|
43634
|
+
var css$v = ".HierarchyItem_module_root__5ef1c91d {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: stretch;\n flex: 1;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 0.25rem;\n min-height: 2rem;\n height: auto;\n padding: 0rem 0.5rem;\n cursor: pointer;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component1], .HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component3] {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component1] .HierarchyItem_module_expand__5ef1c91d, .HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component3] .HierarchyItem_module_expand__5ef1c91d {\n padding: 0;\n height: auto;\n width: 1rem;\n height: 1rem;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component1] .HierarchyItem_module_expand__5ef1c91d .HierarchyItem_module_icon__5ef1c91d, .HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component3] .HierarchyItem_module_expand__5ef1c91d .HierarchyItem_module_icon__5ef1c91d {\n transform: rotate(-90deg);\n width: 1rem;\n height: 1rem;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component2] {\n flex: 1 1 auto;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d > [data-elem=component2] .HierarchyItem_module_title__5ef1c91d {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: auto;\n padding: 0.25rem 0rem;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d:hover {\n background: var(--background);\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d:hover .HierarchyItem_module_icon__5ef1c91d,\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d:hover .HierarchyItem_module_title__5ef1c91d,\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_header__5ef1c91d:hover .HierarchyItem_module_title__5ef1c91d svg {\n color: var(--highlight);\n fill: var(--highlight);\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_body__5ef1c91d {\n display: none;\n flex: 1 0 auto;\n padding: 0px 0rem 0px 0.25rem;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_body__5ef1c91d > [data-elem=component1] {\n flex: 0 0 1.6rem;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_body__5ef1c91d > [data-elem=component1] .HierarchyItem_module_tail__5ef1c91d {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n width: 1.6rem;\n height: 100%;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_body__5ef1c91d > [data-elem=component1] .HierarchyItem_module_tail__5ef1c91d::after {\n content: \"\";\n display: block;\n margin: auto;\n width: 1px;\n flex: 1;\n background: var(--grey1);\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_body__5ef1c91d > [data-elem=component2] {\n flex: 1 0 auto;\n}\n.HierarchyItem_module_root__5ef1c91d .HierarchyItem_module_body__5ef1c91d > [data-elem=component2] .HierarchyItem_module_children__5ef1c91d {\n flex: 1 0 auto;\n}\n.HierarchyItem_module_root__5ef1c91d.HierarchyItem_module_open__5ef1c91d > .HierarchyItem_module_header__5ef1c91d .HierarchyItem_module_expand__5ef1c91d .HierarchyItem_module_icon__5ef1c91d {\n transform: none;\n}\n.HierarchyItem_module_root__5ef1c91d.HierarchyItem_module_open__5ef1c91d > .HierarchyItem_module_body__5ef1c91d {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: stretch;\n gap: 0.25rem;\n height: auto;\n}\n.HierarchyItem_module_root__5ef1c91d.HierarchyItem_module_active__5ef1c91d > .HierarchyItem_module_header__5ef1c91d {\n background: var(--background);\n}\n.HierarchyItem_module_root__5ef1c91d.HierarchyItem_module_active__5ef1c91d > .HierarchyItem_module_header__5ef1c91d .HierarchyItem_module_icon__5ef1c91d,\n.HierarchyItem_module_root__5ef1c91d.HierarchyItem_module_active__5ef1c91d > .HierarchyItem_module_header__5ef1c91d .HierarchyItem_module_title__5ef1c91d,\n.HierarchyItem_module_root__5ef1c91d.HierarchyItem_module_active__5ef1c91d > .HierarchyItem_module_header__5ef1c91d .HierarchyItem_module_title__5ef1c91d svg {\n color: var(--highlight);\n fill: var(--highlight);\n}";
|
|
43635
|
+
var modules_6d03d164 = {"root":"HierarchyItem_module_root__5ef1c91d","header":"HierarchyItem_module_header__5ef1c91d","expand":"HierarchyItem_module_expand__5ef1c91d","icon":"HierarchyItem_module_icon__5ef1c91d","title":"HierarchyItem_module_title__5ef1c91d","body":"HierarchyItem_module_body__5ef1c91d","tail":"HierarchyItem_module_tail__5ef1c91d","children":"HierarchyItem_module_children__5ef1c91d","open":"HierarchyItem_module_open__5ef1c91d","active":"HierarchyItem_module_active__5ef1c91d"};
|
|
43601
43636
|
n(css$v,{});
|
|
43602
43637
|
|
|
43603
43638
|
var HierarchyItem = function HierarchyItem(props) {
|
|
@@ -43606,7 +43641,8 @@ var HierarchyItem = function HierarchyItem(props) {
|
|
|
43606
43641
|
title = props.title,
|
|
43607
43642
|
children = props.children,
|
|
43608
43643
|
_onClick = props.onClick,
|
|
43609
|
-
onDoubleClick = props.onDoubleClick
|
|
43644
|
+
onDoubleClick = props.onDoubleClick,
|
|
43645
|
+
active = props.active;
|
|
43610
43646
|
var _useState = React.useState(defaultOpen),
|
|
43611
43647
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43612
43648
|
open = _useState2[0],
|
|
@@ -43631,7 +43667,7 @@ var HierarchyItem = function HierarchyItem(props) {
|
|
|
43631
43667
|
}
|
|
43632
43668
|
});
|
|
43633
43669
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
43634
|
-
className: classes(modules_6d03d164.root, open ? modules_6d03d164.open : ''),
|
|
43670
|
+
className: classes(modules_6d03d164.root, open ? modules_6d03d164.open : '', active ? modules_6d03d164.active : ''),
|
|
43635
43671
|
children: [/*#__PURE__*/jsxRuntime.jsx(BaseCell, {
|
|
43636
43672
|
flexible: true,
|
|
43637
43673
|
size: "auto",
|
|
@@ -43680,13 +43716,15 @@ HierarchyItem.propTypes = {
|
|
|
43680
43716
|
iconPlacement: propTypes$1.exports.oneOf(['left', 'right', 'none']),
|
|
43681
43717
|
title: propTypes$1.exports.node,
|
|
43682
43718
|
defaultOpen: propTypes$1.exports.bool,
|
|
43683
|
-
onClick: propTypes$1.exports.func
|
|
43719
|
+
onClick: propTypes$1.exports.func,
|
|
43720
|
+
active: propTypes$1.exports.bool
|
|
43684
43721
|
};
|
|
43685
43722
|
HierarchyItem.defaultProps = {
|
|
43686
43723
|
iconPlacement: 'left',
|
|
43687
43724
|
title: null,
|
|
43688
43725
|
defaultOpen: false,
|
|
43689
|
-
onClick: function onClick() {}
|
|
43726
|
+
onClick: function onClick() {},
|
|
43727
|
+
active: false
|
|
43690
43728
|
};
|
|
43691
43729
|
|
|
43692
43730
|
var css$u = ".HierarchyBrowser_module_root__649d3da2 {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: stretch;\n width: 20rem;\n position: relative;\n}\n.HierarchyBrowser_module_root__649d3da2 .HierarchyBrowser_module_header__649d3da2 {\n padding: 0.5rem;\n background: var(--dark-grey);\n color: var(--white);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.HierarchyBrowser_module_root__649d3da2 .HierarchyBrowser_module_body__649d3da2 {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: stretch;\n overflow: auto;\n}\n.HierarchyBrowser_module_root__649d3da2 .HierarchyBrowser_module_item__649d3da2 {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 0.25rem;\n}\n.HierarchyBrowser_module_root__649d3da2 .HierarchyBrowser_module_item__649d3da2 .HierarchyBrowser_module_itemIcon__649d3da2 {\n width: 1rem;\n}\n.HierarchyBrowser_module_root__649d3da2::after {\n position: absolute;\n right: 0;\n content: \"\";\n width: 1px;\n height: 100%;\n background: var(--grey4);\n}\n.HierarchyBrowser_module_root__649d3da2.HierarchyBrowser_module_resizable__649d3da2:hover::after {\n width: 3px;\n cursor: col-resize;\n}";
|
|
@@ -44378,7 +44416,7 @@ var css$p = ".Stepper_module_root__781d3116 {\n display: flex;\n flex-directio
|
|
|
44378
44416
|
var modules_bbfded44 = {"root":"Stepper_module_root__781d3116","step":"Stepper_module_step__781d3116","title":"Stepper_module_title__781d3116","left":"Stepper_module_left__781d3116","icon":"Stepper_module_icon__781d3116","error-icon":"Stepper_module_errorIcon__781d3116","completion-icon":"Stepper_module_completionIcon__781d3116","active":"Stepper_module_active__781d3116","progress":"Stepper_module_progress__781d3116","right":"Stepper_module_right__781d3116","description":"Stepper_module_description__781d3116","completed":"Stepper_module_completed__781d3116","error":"Stepper_module_error__781d3116"};
|
|
44379
44417
|
n(css$p,{});
|
|
44380
44418
|
|
|
44381
|
-
var css$o = ":root {\n --white: #ffffff;\n --black: #000000;\n --dark-grey: #333333;\n --dark-grey-o-85: rgba(51, 51, 51, 0.85);\n --grey: #737373;\n --grey1: #888888;\n --grey2: #a6a6a6;\n --grey3: #bbbbbb;\n --grey4: #c4c4c4;\n --grey5: #dddddd;\n --grey6: #e8e8e8;\n --grey7: #eeeeee;\n --grey8: #f2f2f2;\n --grey9: #eff0f0;\n --grey10: #f7f7f7;\n --highlight: #0f62fe;\n --dark-blue: #001833;\n --background: #d0e2ff;\n --banyan-blue: #00037c;\n --banyan-orange: #ff892a;\n --banyan-pink: #ff1597;\n --banyan-gradient: linear-gradient(\n \t84.71deg,\n \tvar(--banyan-pink) 0.48%,\n \tvar(--banyan-orange) 99.57%\n );\n --error: #
|
|
44419
|
+
var css$o = ":root {\n --white: #ffffff;\n --black: #000000;\n --dark-grey: #333333;\n --dark-grey-o-85: rgba(51, 51, 51, 0.85);\n --grey: #737373;\n --grey1: #888888;\n --grey2: #a6a6a6;\n --grey3: #bbbbbb;\n --grey4: #c4c4c4;\n --grey5: #dddddd;\n --grey6: #e8e8e8;\n --grey7: #eeeeee;\n --grey8: #f2f2f2;\n --grey9: #eff0f0;\n --grey10: #f7f7f7;\n --highlight: #0f62fe;\n --dark-blue: #001833;\n --background: #d0e2ff;\n --banyan-blue: #00037c;\n --banyan-orange: #ff892a;\n --banyan-pink: #ff1597;\n --banyan-gradient: linear-gradient(\n \t84.71deg,\n \tvar(--banyan-pink) 0.48%,\n \tvar(--banyan-orange) 99.57%\n );\n --error: #ff626a;\n --error-bg: #fff1f1;\n --error-outline: rgba(218, 30, 40, 0.08);\n --success: #24a148;\n --success-bg: #defbe6;\n --success-outline: rgba(36, 161, 72, 0.08);\n --warning: #f1c21b;\n --warning-bg: #fff8e1;\n --warning-outline: rgba(203, 160, 6, 0.08);\n --info: #0043ce;\n --info-bg: #edf5ff;\n --info-outline: #2864db98;\n}";
|
|
44382
44420
|
var modules_dd21d9e9 = {"white":"--white","black":"--black","dark-grey":"--dark-grey","dark-grey-o-85":"--dark-grey-o-85","grey":"--grey","grey1":"--grey1","grey2":"--grey2","grey3":"--grey3","grey4":"--grey4","grey5":"--grey5","grey6":"--grey6","grey7":"--grey7","grey8":"--grey8","grey9":"--grey9","grey10":"--grey10","highlight":"--highlight","dark-blue":"--dark-blue","background":"--background","banyan-blue":"--banyan-blue","banyan-orange":"--banyan-orange","banyan-pink":"--banyan-pink","banyan-gradient":"--banyan-gradient","error":"--error","error-bg":"--error-bg","error-outline":"--error-outline","success":"--success","success-bg":"--success-bg","success-outline":"--success-outline","warning":"--warning","warning-bg":"--warning-bg","warning-outline":"--warning-outline","info":"--info","info-bg":"--info-bg","info-outline":"--info-outline"};
|
|
44383
44421
|
n(css$o,{});
|
|
44384
44422
|
|
|
@@ -45996,7 +46034,7 @@ var __assign = function() {
|
|
|
45996
46034
|
return __assign.apply(this, arguments);
|
|
45997
46035
|
};
|
|
45998
46036
|
|
|
45999
|
-
function __rest(s, e) {
|
|
46037
|
+
function __rest$1(s, e) {
|
|
46000
46038
|
var t = {};
|
|
46001
46039
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
46002
46040
|
t[p] = s[p];
|
|
@@ -46206,7 +46244,7 @@ var tslib_es6 = /*#__PURE__*/Object.freeze({
|
|
|
46206
46244
|
__proto__: null,
|
|
46207
46245
|
__extends: __extends$2,
|
|
46208
46246
|
get __assign () { return __assign; },
|
|
46209
|
-
__rest: __rest,
|
|
46247
|
+
__rest: __rest$1,
|
|
46210
46248
|
__decorate: __decorate,
|
|
46211
46249
|
__param: __param,
|
|
46212
46250
|
__metadata: __metadata,
|
|
@@ -46719,7 +46757,7 @@ var isEqual = {};
|
|
|
46719
46757
|
|
|
46720
46758
|
|
|
46721
46759
|
|
|
46722
|
-
var fastDeepEqual = function equal(a, b) {
|
|
46760
|
+
var fastDeepEqual$1 = function equal(a, b) {
|
|
46723
46761
|
if (a === b) return true;
|
|
46724
46762
|
|
|
46725
46763
|
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
@@ -46763,7 +46801,7 @@ var fastDeepEqual = function equal(a, b) {
|
|
|
46763
46801
|
Object.defineProperty(isEqual, "__esModule", { value: true });
|
|
46764
46802
|
isEqual.isEqual = void 0;
|
|
46765
46803
|
var tslib_1$1 = require$$0;
|
|
46766
|
-
var fast_deep_equal_1 = (0, tslib_1$1.__importDefault)(fastDeepEqual);
|
|
46804
|
+
var fast_deep_equal_1 = (0, tslib_1$1.__importDefault)(fastDeepEqual$1);
|
|
46767
46805
|
isEqual.isEqual = fast_deep_equal_1.default;
|
|
46768
46806
|
|
|
46769
46807
|
Object.defineProperty(core, "__esModule", { value: true });
|
|
@@ -47205,7 +47243,7 @@ function clone$3(source) {
|
|
|
47205
47243
|
}
|
|
47206
47244
|
return result;
|
|
47207
47245
|
}
|
|
47208
|
-
function merge(target, source, overwrite) {
|
|
47246
|
+
function merge$1(target, source, overwrite) {
|
|
47209
47247
|
if (!isObject$3(source) || !isObject$3(target)) {
|
|
47210
47248
|
return overwrite ? clone$3(source) : target;
|
|
47211
47249
|
}
|
|
@@ -47223,7 +47261,7 @@ function merge(target, source, overwrite) {
|
|
|
47223
47261
|
&& !isBuiltInObject(targetProp)
|
|
47224
47262
|
&& !isPrimitive(sourceProp)
|
|
47225
47263
|
&& !isPrimitive(targetProp)) {
|
|
47226
|
-
merge(targetProp, sourceProp, overwrite);
|
|
47264
|
+
merge$1(targetProp, sourceProp, overwrite);
|
|
47227
47265
|
}
|
|
47228
47266
|
else if (overwrite || !(key in target)) {
|
|
47229
47267
|
target[key] = clone$3(source[key]);
|
|
@@ -47235,11 +47273,11 @@ function merge(target, source, overwrite) {
|
|
|
47235
47273
|
function mergeAll(targetAndSources, overwrite) {
|
|
47236
47274
|
var result = targetAndSources[0];
|
|
47237
47275
|
for (var i = 1, len = targetAndSources.length; i < len; i++) {
|
|
47238
|
-
result = merge(result, targetAndSources[i], overwrite);
|
|
47276
|
+
result = merge$1(result, targetAndSources[i], overwrite);
|
|
47239
47277
|
}
|
|
47240
47278
|
return result;
|
|
47241
47279
|
}
|
|
47242
|
-
function extend(target, source) {
|
|
47280
|
+
function extend$2(target, source) {
|
|
47243
47281
|
if (Object.assign) {
|
|
47244
47282
|
Object.assign(target, source);
|
|
47245
47283
|
}
|
|
@@ -47599,7 +47637,7 @@ function createObject(proto, properties) {
|
|
|
47599
47637
|
obj = new StyleCtor();
|
|
47600
47638
|
}
|
|
47601
47639
|
if (properties) {
|
|
47602
|
-
extend(obj, properties);
|
|
47640
|
+
extend$2(obj, properties);
|
|
47603
47641
|
}
|
|
47604
47642
|
return obj;
|
|
47605
47643
|
}
|
|
@@ -47613,7 +47651,7 @@ function disableUserSelect(dom) {
|
|
|
47613
47651
|
function hasOwn(own, prop) {
|
|
47614
47652
|
return own.hasOwnProperty(prop);
|
|
47615
47653
|
}
|
|
47616
|
-
function noop() { }
|
|
47654
|
+
function noop$1() { }
|
|
47617
47655
|
var RADIAN_TO_DEGREE = 180 / Math.PI;
|
|
47618
47656
|
|
|
47619
47657
|
var util$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -47621,9 +47659,9 @@ var util$1 = /*#__PURE__*/Object.freeze({
|
|
|
47621
47659
|
guid: guid,
|
|
47622
47660
|
logError: logError,
|
|
47623
47661
|
clone: clone$3,
|
|
47624
|
-
merge: merge,
|
|
47662
|
+
merge: merge$1,
|
|
47625
47663
|
mergeAll: mergeAll,
|
|
47626
|
-
extend: extend,
|
|
47664
|
+
extend: extend$2,
|
|
47627
47665
|
defaults: defaults,
|
|
47628
47666
|
createCanvas: createCanvas,
|
|
47629
47667
|
indexOf: indexOf,
|
|
@@ -47666,7 +47704,7 @@ var util$1 = /*#__PURE__*/Object.freeze({
|
|
|
47666
47704
|
createObject: createObject,
|
|
47667
47705
|
disableUserSelect: disableUserSelect,
|
|
47668
47706
|
hasOwn: hasOwn,
|
|
47669
|
-
noop: noop,
|
|
47707
|
+
noop: noop$1,
|
|
47670
47708
|
RADIAN_TO_DEGREE: RADIAN_TO_DEGREE
|
|
47671
47709
|
});
|
|
47672
47710
|
|
|
@@ -50421,9 +50459,9 @@ var Clip = (function () {
|
|
|
50421
50459
|
this._life = opts.life || 1000;
|
|
50422
50460
|
this._delay = opts.delay || 0;
|
|
50423
50461
|
this.loop = opts.loop || false;
|
|
50424
|
-
this.onframe = opts.onframe || noop;
|
|
50425
|
-
this.ondestroy = opts.ondestroy || noop;
|
|
50426
|
-
this.onrestart = opts.onrestart || noop;
|
|
50462
|
+
this.onframe = opts.onframe || noop$1;
|
|
50463
|
+
this.ondestroy = opts.ondestroy || noop$1;
|
|
50464
|
+
this.onrestart = opts.onrestart || noop$1;
|
|
50427
50465
|
opts.easing && this.setEasing(opts.easing);
|
|
50428
50466
|
}
|
|
50429
50467
|
Clip.prototype.step = function (globalTime, deltaTime) {
|
|
@@ -51219,7 +51257,7 @@ var Track = (function () {
|
|
|
51219
51257
|
}
|
|
51220
51258
|
}
|
|
51221
51259
|
else if (isGradientObject(rawValue)) {
|
|
51222
|
-
var parsedGradient = extend({}, value);
|
|
51260
|
+
var parsedGradient = extend$2({}, value);
|
|
51223
51261
|
parsedGradient.colorStops = map$1(rawValue.colorStops, function (colorStop) { return ({
|
|
51224
51262
|
offset: colorStop.offset,
|
|
51225
51263
|
color: parse(colorStop.color)
|
|
@@ -51968,9 +52006,9 @@ function isLocalEl(instance, el) {
|
|
|
51968
52006
|
}
|
|
51969
52007
|
var FakeGlobalEvent = (function () {
|
|
51970
52008
|
function FakeGlobalEvent(instance, event) {
|
|
51971
|
-
this.stopPropagation = noop;
|
|
51972
|
-
this.stopImmediatePropagation = noop;
|
|
51973
|
-
this.preventDefault = noop;
|
|
52009
|
+
this.stopPropagation = noop$1;
|
|
52010
|
+
this.stopImmediatePropagation = noop$1;
|
|
52011
|
+
this.preventDefault = noop$1;
|
|
51974
52012
|
this.type = event.type;
|
|
51975
52013
|
this.target = this.currentTarget = instance.dom;
|
|
51976
52014
|
this.pointerType = event.pointerType;
|
|
@@ -52809,7 +52847,7 @@ var Element = (function () {
|
|
|
52809
52847
|
}
|
|
52810
52848
|
else if (key === 'extra') {
|
|
52811
52849
|
this.extra = this.extra || {};
|
|
52812
|
-
extend(this.extra, value);
|
|
52850
|
+
extend$2(this.extra, value);
|
|
52813
52851
|
}
|
|
52814
52852
|
else {
|
|
52815
52853
|
this[key] = value;
|
|
@@ -53050,10 +53088,10 @@ var Element = (function () {
|
|
|
53050
53088
|
var mergedTextConfig;
|
|
53051
53089
|
for (var i = 0; i < states.length; i++) {
|
|
53052
53090
|
var state = states[i];
|
|
53053
|
-
extend(mergedState, state);
|
|
53091
|
+
extend$2(mergedState, state);
|
|
53054
53092
|
if (state.textConfig) {
|
|
53055
53093
|
mergedTextConfig = mergedTextConfig || {};
|
|
53056
|
-
extend(mergedTextConfig, state.textConfig);
|
|
53094
|
+
extend$2(mergedTextConfig, state.textConfig);
|
|
53057
53095
|
}
|
|
53058
53096
|
}
|
|
53059
53097
|
if (mergedTextConfig) {
|
|
@@ -53064,8 +53102,8 @@ var Element = (function () {
|
|
|
53064
53102
|
Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
|
|
53065
53103
|
var needsRestoreToNormal = !(state && keepCurrentStates);
|
|
53066
53104
|
if (state && state.textConfig) {
|
|
53067
|
-
this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);
|
|
53068
|
-
extend(this.textConfig, state.textConfig);
|
|
53105
|
+
this.textConfig = extend$2({}, keepCurrentStates ? this.textConfig : normalState.textConfig);
|
|
53106
|
+
extend$2(this.textConfig, state.textConfig);
|
|
53069
53107
|
}
|
|
53070
53108
|
else if (needsRestoreToNormal) {
|
|
53071
53109
|
if (normalState.textConfig) {
|
|
@@ -53184,7 +53222,7 @@ var Element = (function () {
|
|
|
53184
53222
|
if (!this.textConfig) {
|
|
53185
53223
|
this.textConfig = {};
|
|
53186
53224
|
}
|
|
53187
|
-
extend(this.textConfig, cfg);
|
|
53225
|
+
extend$2(this.textConfig, cfg);
|
|
53188
53226
|
this.markRedraw();
|
|
53189
53227
|
};
|
|
53190
53228
|
Element.prototype.removeTextConfig = function () {
|
|
@@ -55491,7 +55529,7 @@ function enableClassExtend(rootClz, mandatoryMethods) {
|
|
|
55491
55529
|
inherits(ExtendedClass, this);
|
|
55492
55530
|
}
|
|
55493
55531
|
|
|
55494
|
-
extend(ExtendedClass.prototype, proto);
|
|
55532
|
+
extend$2(ExtendedClass.prototype, proto);
|
|
55495
55533
|
ExtendedClass[IS_EXTENDED_CLASS] = true;
|
|
55496
55534
|
ExtendedClass.extend = this.extend;
|
|
55497
55535
|
ExtendedClass.superCall = superCall;
|
|
@@ -55826,7 +55864,7 @@ function truncateText(text, containerWidth, font, ellipsis, options) {
|
|
|
55826
55864
|
}
|
|
55827
55865
|
function prepareTruncateOptions(containerWidth, font, ellipsis, options) {
|
|
55828
55866
|
options = options || {};
|
|
55829
|
-
var preparedOpts = extend({}, options);
|
|
55867
|
+
var preparedOpts = extend$2({}, options);
|
|
55830
55868
|
preparedOpts.font = font;
|
|
55831
55869
|
ellipsis = retrieve2(ellipsis, '...');
|
|
55832
55870
|
preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);
|
|
@@ -56432,7 +56470,7 @@ var Displayable = (function (_super) {
|
|
|
56432
56470
|
this.style[keyOrObj] = value;
|
|
56433
56471
|
}
|
|
56434
56472
|
else {
|
|
56435
|
-
extend(this.style, keyOrObj);
|
|
56473
|
+
extend$2(this.style, keyOrObj);
|
|
56436
56474
|
}
|
|
56437
56475
|
this.dirtyStyle();
|
|
56438
56476
|
return this;
|
|
@@ -56559,7 +56597,7 @@ var Displayable = (function (_super) {
|
|
|
56559
56597
|
return mergedState;
|
|
56560
56598
|
};
|
|
56561
56599
|
Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {
|
|
56562
|
-
extend(targetStyle, sourceStyle);
|
|
56600
|
+
extend$2(targetStyle, sourceStyle);
|
|
56563
56601
|
return targetStyle;
|
|
56564
56602
|
};
|
|
56565
56603
|
Displayable.prototype.getAnimationStyleProps = function () {
|
|
@@ -57889,11 +57927,11 @@ var Path = (function (_super) {
|
|
|
57889
57927
|
this.useStyle(value);
|
|
57890
57928
|
}
|
|
57891
57929
|
else {
|
|
57892
|
-
extend(this.style, value);
|
|
57930
|
+
extend$2(this.style, value);
|
|
57893
57931
|
}
|
|
57894
57932
|
}
|
|
57895
57933
|
else if (key === 'shape') {
|
|
57896
|
-
extend(this.shape, value);
|
|
57934
|
+
extend$2(this.shape, value);
|
|
57897
57935
|
}
|
|
57898
57936
|
else {
|
|
57899
57937
|
_super.prototype.attrKV.call(this, key, value);
|
|
@@ -58076,7 +58114,7 @@ var Path = (function (_super) {
|
|
|
58076
58114
|
shape[keyOrObj] = value;
|
|
58077
58115
|
}
|
|
58078
58116
|
else {
|
|
58079
|
-
extend(shape, keyOrObj);
|
|
58117
|
+
extend$2(shape, keyOrObj);
|
|
58080
58118
|
}
|
|
58081
58119
|
this.dirtyShape();
|
|
58082
58120
|
return this;
|
|
@@ -58091,7 +58129,7 @@ var Path = (function (_super) {
|
|
|
58091
58129
|
_super.prototype._innerSaveToNormal.call(this, toState);
|
|
58092
58130
|
var normalState = this._normalState;
|
|
58093
58131
|
if (toState.shape && !normalState.shape) {
|
|
58094
|
-
normalState.shape = extend({}, this.shape);
|
|
58132
|
+
normalState.shape = extend$2({}, this.shape);
|
|
58095
58133
|
}
|
|
58096
58134
|
};
|
|
58097
58135
|
Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
|
|
@@ -58104,13 +58142,13 @@ var Path = (function (_super) {
|
|
|
58104
58142
|
targetShape = state.shape;
|
|
58105
58143
|
}
|
|
58106
58144
|
else {
|
|
58107
|
-
targetShape = extend({}, normalState.shape);
|
|
58108
|
-
extend(targetShape, state.shape);
|
|
58145
|
+
targetShape = extend$2({}, normalState.shape);
|
|
58146
|
+
extend$2(targetShape, state.shape);
|
|
58109
58147
|
}
|
|
58110
58148
|
}
|
|
58111
58149
|
else {
|
|
58112
|
-
targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);
|
|
58113
|
-
extend(targetShape, state.shape);
|
|
58150
|
+
targetShape = extend$2({}, keepCurrentStates ? this.shape : normalState.shape);
|
|
58151
|
+
extend$2(targetShape, state.shape);
|
|
58114
58152
|
}
|
|
58115
58153
|
}
|
|
58116
58154
|
else if (needsRestoreToNormal) {
|
|
@@ -58118,7 +58156,7 @@ var Path = (function (_super) {
|
|
|
58118
58156
|
}
|
|
58119
58157
|
if (targetShape) {
|
|
58120
58158
|
if (transition) {
|
|
58121
|
-
this.shape = extend({}, this.shape);
|
|
58159
|
+
this.shape = extend$2({}, this.shape);
|
|
58122
58160
|
var targetShapePrimaryProps = {};
|
|
58123
58161
|
var shapeKeys = keys(targetShape);
|
|
58124
58162
|
for (var i = 0; i < shapeKeys.length; i++) {
|
|
@@ -58653,7 +58691,7 @@ var ZRText = (function (_super) {
|
|
|
58653
58691
|
}
|
|
58654
58692
|
var sourceRich = sourceStyle.rich;
|
|
58655
58693
|
var targetRich = targetStyle.rich || (sourceRich && {});
|
|
58656
|
-
extend(targetStyle, sourceStyle);
|
|
58694
|
+
extend$2(targetStyle, sourceStyle);
|
|
58657
58695
|
if (sourceRich && targetRich) {
|
|
58658
58696
|
this._mergeRich(targetRich, sourceRich);
|
|
58659
58697
|
targetStyle.rich = targetRich;
|
|
@@ -58668,7 +58706,7 @@ var ZRText = (function (_super) {
|
|
|
58668
58706
|
for (var i = 0; i < richNames.length; i++) {
|
|
58669
58707
|
var richName = richNames[i];
|
|
58670
58708
|
targetRich[richName] = targetRich[richName] || {};
|
|
58671
|
-
extend(targetRich[richName], sourceRich[richName]);
|
|
58709
|
+
extend$2(targetRich[richName], sourceRich[richName]);
|
|
58672
58710
|
}
|
|
58673
58711
|
};
|
|
58674
58712
|
ZRText.prototype.getAnimationStyleProps = function () {
|
|
@@ -59107,7 +59145,7 @@ function liftColor(color$1) {
|
|
|
59107
59145
|
|
|
59108
59146
|
return liftedColor;
|
|
59109
59147
|
} else if (isGradientObject(color$1)) {
|
|
59110
|
-
var ret = extend({}, color$1);
|
|
59148
|
+
var ret = extend$2({}, color$1);
|
|
59111
59149
|
ret.colorStops = map$1(color$1.colorStops, function (stop) {
|
|
59112
59150
|
return {
|
|
59113
59151
|
offset: stop.offset,
|
|
@@ -59228,22 +59266,22 @@ function createEmphasisDefaultState(el, stateName, targetStates, state) {
|
|
|
59228
59266
|
|
|
59229
59267
|
if (emphasisStyle.fill === 'inherit') {
|
|
59230
59268
|
cloned = true;
|
|
59231
|
-
state = extend({}, state);
|
|
59232
|
-
emphasisStyle = extend({}, emphasisStyle);
|
|
59269
|
+
state = extend$2({}, state);
|
|
59270
|
+
emphasisStyle = extend$2({}, emphasisStyle);
|
|
59233
59271
|
emphasisStyle.fill = fromFill;
|
|
59234
59272
|
} // Apply default color lift
|
|
59235
59273
|
else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {
|
|
59236
59274
|
cloned = true; // Not modify the original value.
|
|
59237
59275
|
|
|
59238
|
-
state = extend({}, state);
|
|
59239
|
-
emphasisStyle = extend({}, emphasisStyle); // Already being applied 'emphasis'. DON'T lift color multiple times.
|
|
59276
|
+
state = extend$2({}, state);
|
|
59277
|
+
emphasisStyle = extend$2({}, emphasisStyle); // Already being applied 'emphasis'. DON'T lift color multiple times.
|
|
59240
59278
|
|
|
59241
59279
|
emphasisStyle.fill = liftColor(fromFill);
|
|
59242
59280
|
} // Not highlight stroke if fill has been highlighted.
|
|
59243
59281
|
else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {
|
|
59244
59282
|
if (!cloned) {
|
|
59245
|
-
state = extend({}, state);
|
|
59246
|
-
emphasisStyle = extend({}, emphasisStyle);
|
|
59283
|
+
state = extend$2({}, state);
|
|
59284
|
+
emphasisStyle = extend$2({}, emphasisStyle);
|
|
59247
59285
|
}
|
|
59248
59286
|
|
|
59249
59287
|
emphasisStyle.stroke = liftColor(fromStroke);
|
|
@@ -59257,7 +59295,7 @@ function createEmphasisDefaultState(el, stateName, targetStates, state) {
|
|
|
59257
59295
|
// TODO Share with textContent?
|
|
59258
59296
|
if (state.z2 == null) {
|
|
59259
59297
|
if (!cloned) {
|
|
59260
|
-
state = extend({}, state);
|
|
59298
|
+
state = extend$2({}, state);
|
|
59261
59299
|
}
|
|
59262
59300
|
|
|
59263
59301
|
var z2EmphasisLift = el.z2EmphasisLift;
|
|
@@ -59273,7 +59311,7 @@ function createSelectDefaultState(el, stateName, state) {
|
|
|
59273
59311
|
if (state) {
|
|
59274
59312
|
// TODO Share with textContent?
|
|
59275
59313
|
if (state.z2 == null) {
|
|
59276
|
-
state = extend({}, state);
|
|
59314
|
+
state = extend$2({}, state);
|
|
59277
59315
|
var z2SelectLift = el.z2SelectLift;
|
|
59278
59316
|
state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);
|
|
59279
59317
|
}
|
|
@@ -59293,8 +59331,8 @@ function createBlurDefaultState(el, stateName, state) {
|
|
|
59293
59331
|
|
|
59294
59332
|
if (blurStyle.opacity == null) {
|
|
59295
59333
|
// clone state
|
|
59296
|
-
state = extend({}, state);
|
|
59297
|
-
blurStyle = extend({
|
|
59334
|
+
state = extend$2({}, state);
|
|
59335
|
+
blurStyle = extend$2({
|
|
59298
59336
|
// Already being applied 'emphasis'. DON'T mul opacity multiple times.
|
|
59299
59337
|
opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1
|
|
59300
59338
|
}, blurStyle);
|
|
@@ -60187,7 +60225,7 @@ function isPathProxy(path) {
|
|
|
60187
60225
|
}
|
|
60188
60226
|
function createPathOptions(str, opts) {
|
|
60189
60227
|
var pathProxy = createPathProxyFromString(str);
|
|
60190
|
-
var innerOpts = extend({}, opts);
|
|
60228
|
+
var innerOpts = extend$2({}, opts);
|
|
60191
60229
|
innerOpts.buildPath = function (path) {
|
|
60192
60230
|
if (isPathProxy(path)) {
|
|
60193
60231
|
path.setData(pathProxy.data);
|
|
@@ -61766,7 +61804,7 @@ function groupTransition(g1, g2, animatableModel) {
|
|
|
61766
61804
|
};
|
|
61767
61805
|
|
|
61768
61806
|
if (isPath(el)) {
|
|
61769
|
-
obj.shape = extend({}, el.shape);
|
|
61807
|
+
obj.shape = extend$2({}, el.shape);
|
|
61770
61808
|
}
|
|
61771
61809
|
|
|
61772
61810
|
return obj;
|
|
@@ -61820,7 +61858,7 @@ function clipRectByRect(targetRect, rect) {
|
|
|
61820
61858
|
}
|
|
61821
61859
|
function createIcon(iconStr, // Support 'image://' or 'path://' or direct svg path.
|
|
61822
61860
|
opt, rect) {
|
|
61823
|
-
var innerOpts = extend({
|
|
61861
|
+
var innerOpts = extend$2({
|
|
61824
61862
|
rectHover: true
|
|
61825
61863
|
}, opt);
|
|
61826
61864
|
var style = innerOpts.style = {
|
|
@@ -62200,7 +62238,7 @@ opt, isNotNormal, isAttached // If text is attached on an element. If so, auto c
|
|
|
62200
62238
|
) {
|
|
62201
62239
|
var textStyle = {};
|
|
62202
62240
|
setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);
|
|
62203
|
-
specifiedTextStyle && extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
|
|
62241
|
+
specifiedTextStyle && extend$2(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
|
|
62204
62242
|
|
|
62205
62243
|
return textStyle;
|
|
62206
62244
|
}
|
|
@@ -62635,7 +62673,7 @@ function () {
|
|
|
62635
62673
|
|
|
62636
62674
|
|
|
62637
62675
|
Model.prototype.mergeOption = function (option, ecModel) {
|
|
62638
|
-
merge(this.option, option, true);
|
|
62676
|
+
merge$1(this.option, option, true);
|
|
62639
62677
|
}; // `path` can be 'a.b.c', so the return value type have to be `ModelOption`
|
|
62640
62678
|
// TODO: TYPE strict key check?
|
|
62641
62679
|
// get(path: string | string[], ignoreParent?: boolean): ModelOption;
|
|
@@ -62924,7 +62962,7 @@ function enableTopologicalTravel(entity, dependencyGetter) {
|
|
|
62924
62962
|
}
|
|
62925
62963
|
function inheritDefaultOption(superOption, subOption) {
|
|
62926
62964
|
// See also `model/Component.ts#getDefaultOption`
|
|
62927
|
-
return merge(merge({}, superOption, true), subOption, true);
|
|
62965
|
+
return merge$1(merge$1({}, superOption, true), subOption, true);
|
|
62928
62966
|
}
|
|
62929
62967
|
|
|
62930
62968
|
/*
|
|
@@ -63261,10 +63299,10 @@ function createLocaleObject(locale) {
|
|
|
63261
63299
|
if (locale === LOCALE_ZH || locale === LOCALE_EN) {
|
|
63262
63300
|
return clone$3(localeObj);
|
|
63263
63301
|
} else {
|
|
63264
|
-
return merge(clone$3(localeObj), clone$3(localeStorage[DEFAULT_LOCALE]), false);
|
|
63302
|
+
return merge$1(clone$3(localeObj), clone$3(localeStorage[DEFAULT_LOCALE]), false);
|
|
63265
63303
|
}
|
|
63266
63304
|
} else {
|
|
63267
|
-
return merge(clone$3(locale), clone$3(localeStorage[DEFAULT_LOCALE]), false);
|
|
63305
|
+
return merge$1(clone$3(locale), clone$3(localeStorage[DEFAULT_LOCALE]), false);
|
|
63268
63306
|
}
|
|
63269
63307
|
}
|
|
63270
63308
|
function getLocaleModel(lang) {
|
|
@@ -63378,7 +63416,7 @@ function leveledFormat(tick, idx, formatter, lang, isUTC) {
|
|
|
63378
63416
|
level: tick.level
|
|
63379
63417
|
});
|
|
63380
63418
|
} else {
|
|
63381
|
-
var defaults$1 = extend({}, defaultLeveledFormatter);
|
|
63419
|
+
var defaults$1 = extend$2({}, defaultLeveledFormatter);
|
|
63382
63420
|
|
|
63383
63421
|
if (tick.level > 0) {
|
|
63384
63422
|
for (var i = 0; i < primaryTimeUnits.length; ++i) {
|
|
@@ -64192,8 +64230,8 @@ function (_super) {
|
|
|
64192
64230
|
var layoutMode = fetchLayoutMode(this);
|
|
64193
64231
|
var inputPositionParams = layoutMode ? getLayoutParams(option) : {};
|
|
64194
64232
|
var themeModel = ecModel.getTheme();
|
|
64195
|
-
merge(option, themeModel.get(this.mainType));
|
|
64196
|
-
merge(option, this.getDefaultOption());
|
|
64233
|
+
merge$1(option, themeModel.get(this.mainType));
|
|
64234
|
+
merge$1(option, this.getDefaultOption());
|
|
64197
64235
|
|
|
64198
64236
|
if (layoutMode) {
|
|
64199
64237
|
mergeLayoutParam(option, inputPositionParams, layoutMode);
|
|
@@ -64201,7 +64239,7 @@ function (_super) {
|
|
|
64201
64239
|
};
|
|
64202
64240
|
|
|
64203
64241
|
ComponentModel.prototype.mergeOption = function (option, ecModel) {
|
|
64204
|
-
merge(this.option, option, true);
|
|
64242
|
+
merge$1(this.option, option, true);
|
|
64205
64243
|
var layoutMode = fetchLayoutMode(this);
|
|
64206
64244
|
|
|
64207
64245
|
if (layoutMode) {
|
|
@@ -64296,7 +64334,7 @@ function (_super) {
|
|
|
64296
64334
|
var defaultOption = {};
|
|
64297
64335
|
|
|
64298
64336
|
for (var i = optList.length - 1; i >= 0; i--) {
|
|
64299
|
-
defaultOption = merge(defaultOption, optList[i], true);
|
|
64337
|
+
defaultOption = merge$1(defaultOption, optList[i], true);
|
|
64300
64338
|
}
|
|
64301
64339
|
|
|
64302
64340
|
fields.defaultOption = defaultOption;
|
|
@@ -65174,7 +65212,7 @@ function (_super) {
|
|
|
65174
65212
|
|
|
65175
65213
|
if (!ComponentModel$1.hasClass(mainType)) {
|
|
65176
65214
|
// globalSettingTask.dirty();
|
|
65177
|
-
option[mainType] = option[mainType] == null ? clone$3(componentOption) : merge(option[mainType], componentOption, true);
|
|
65215
|
+
option[mainType] = option[mainType] == null ? clone$3(componentOption) : merge$1(option[mainType], componentOption, true);
|
|
65178
65216
|
} else if (mainType) {
|
|
65179
65217
|
newCmptTypes.push(mainType);
|
|
65180
65218
|
newCmptTypeMap.set(mainType, true);
|
|
@@ -65277,12 +65315,12 @@ function (_super) {
|
|
|
65277
65315
|
componentModel.optionUpdated(newCmptOption, false);
|
|
65278
65316
|
} else {
|
|
65279
65317
|
// PENDING Global as parent ?
|
|
65280
|
-
var extraOpt = extend({
|
|
65318
|
+
var extraOpt = extend$2({
|
|
65281
65319
|
componentIndex: index
|
|
65282
65320
|
}, resultItem.keyInfo);
|
|
65283
65321
|
componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); // Assign `keyInfo`
|
|
65284
65322
|
|
|
65285
|
-
extend(componentModel, extraOpt);
|
|
65323
|
+
extend$2(componentModel, extraOpt);
|
|
65286
65324
|
|
|
65287
65325
|
if (resultItem.brandNew) {
|
|
65288
65326
|
componentModel.__requireNewView = true;
|
|
@@ -65682,7 +65720,7 @@ function (_super) {
|
|
|
65682
65720
|
|
|
65683
65721
|
mergeTheme(baseOption, ecModel._theme.option); // TODO Needs clone when merging to the unexisted property
|
|
65684
65722
|
|
|
65685
|
-
merge(baseOption, globalDefault, false);
|
|
65723
|
+
merge$1(baseOption, globalDefault, false);
|
|
65686
65724
|
|
|
65687
65725
|
ecModel._mergeOption(baseOption, null);
|
|
65688
65726
|
};
|
|
@@ -65713,7 +65751,7 @@ function mergeTheme(option, theme) {
|
|
|
65713
65751
|
|
|
65714
65752
|
if (!ComponentModel$1.hasClass(name)) {
|
|
65715
65753
|
if (typeof themeItem === 'object') {
|
|
65716
|
-
option[name] = !option[name] ? clone$3(themeItem) : merge(option[name], themeItem, false);
|
|
65754
|
+
option[name] = !option[name] ? clone$3(themeItem) : merge$1(option[name], themeItem, false);
|
|
65717
65755
|
} else {
|
|
65718
65756
|
if (option[name] == null) {
|
|
65719
65757
|
option[name] = themeItem;
|
|
@@ -66300,7 +66338,7 @@ function compatEC2ItemStyle(opt) {
|
|
|
66300
66338
|
if (!opt[styleName].normal) {
|
|
66301
66339
|
opt[styleName].normal = normalItemStyleOpt[styleName];
|
|
66302
66340
|
} else {
|
|
66303
|
-
merge(opt[styleName].normal, normalItemStyleOpt[styleName]);
|
|
66341
|
+
merge$1(opt[styleName].normal, normalItemStyleOpt[styleName]);
|
|
66304
66342
|
}
|
|
66305
66343
|
|
|
66306
66344
|
normalItemStyleOpt[styleName] = null;
|
|
@@ -66316,7 +66354,7 @@ function compatEC2ItemStyle(opt) {
|
|
|
66316
66354
|
if (!opt[styleName].emphasis) {
|
|
66317
66355
|
opt[styleName].emphasis = emphasisItemStyleOpt[styleName];
|
|
66318
66356
|
} else {
|
|
66319
|
-
merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);
|
|
66357
|
+
merge$1(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);
|
|
66320
66358
|
}
|
|
66321
66359
|
|
|
66322
66360
|
emphasisItemStyleOpt[styleName] = null;
|
|
@@ -67361,7 +67399,7 @@ function () {
|
|
|
67361
67399
|
assert(methods, 'Invalide sourceFormat: ' + sourceFormat);
|
|
67362
67400
|
}
|
|
67363
67401
|
|
|
67364
|
-
extend(provider, methods);
|
|
67402
|
+
extend$2(provider, methods);
|
|
67365
67403
|
|
|
67366
67404
|
if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {
|
|
67367
67405
|
provider.getItem = getItemForTypedArray;
|
|
@@ -68460,7 +68498,7 @@ function cloneRawData(upstream) {
|
|
|
68460
68498
|
|
|
68461
68499
|
for (var i = 0, len = data.length; i < len; i++) {
|
|
68462
68500
|
// Not strictly clone for performance
|
|
68463
|
-
result.push(extend({}, data[i]));
|
|
68501
|
+
result.push(extend$2({}, data[i]));
|
|
68464
68502
|
}
|
|
68465
68503
|
|
|
68466
68504
|
return result;
|
|
@@ -70377,7 +70415,7 @@ function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {
|
|
|
70377
70415
|
each$9(subBlocks, function (subBlock, idx) {
|
|
70378
70416
|
var valueFormatter = fragment.valueFormatter;
|
|
70379
70417
|
var subMarkupText = getBuilder(subBlock)( // Inherit valueFormatter
|
|
70380
|
-
valueFormatter ? extend(extend({}, ctx), {
|
|
70418
|
+
valueFormatter ? extend$2(extend$2({}, ctx), {
|
|
70381
70419
|
valueFormatter: valueFormatter
|
|
70382
70420
|
}) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle);
|
|
70383
70421
|
subMarkupText != null && subMarkupTextList.push(subMarkupText);
|
|
@@ -70570,10 +70608,10 @@ function () {
|
|
|
70570
70608
|
|
|
70571
70609
|
if (isArray$1(styles)) {
|
|
70572
70610
|
each$9(styles, function (stl) {
|
|
70573
|
-
return extend(finalStl, stl);
|
|
70611
|
+
return extend$2(finalStl, stl);
|
|
70574
70612
|
});
|
|
70575
70613
|
} else {
|
|
70576
|
-
extend(finalStl, styles);
|
|
70614
|
+
extend$2(finalStl, styles);
|
|
70577
70615
|
}
|
|
70578
70616
|
|
|
70579
70617
|
var styleName = this._generateStyleName();
|
|
@@ -70770,8 +70808,8 @@ function (_super) {
|
|
|
70770
70808
|
themeSubType += 'Series';
|
|
70771
70809
|
}
|
|
70772
70810
|
|
|
70773
|
-
merge(option, ecModel.getTheme().get(this.subType));
|
|
70774
|
-
merge(option, this.getDefaultOption()); // Default label emphasis `show`
|
|
70811
|
+
merge$1(option, ecModel.getTheme().get(this.subType));
|
|
70812
|
+
merge$1(option, this.getDefaultOption()); // Default label emphasis `show`
|
|
70775
70813
|
|
|
70776
70814
|
defaultEmphasis(option, 'label', ['show']);
|
|
70777
70815
|
this.fillDataTextStyle(option.data);
|
|
@@ -70783,7 +70821,7 @@ function (_super) {
|
|
|
70783
70821
|
|
|
70784
70822
|
SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {
|
|
70785
70823
|
// this.settingTask.dirty();
|
|
70786
|
-
newSeriesOption = merge(this.option, newSeriesOption, true);
|
|
70824
|
+
newSeriesOption = merge$1(this.option, newSeriesOption, true);
|
|
70787
70825
|
this.fillDataTextStyle(newSeriesOption.data);
|
|
70788
70826
|
var layoutMode = fetchLayoutMode(this);
|
|
70789
70827
|
|
|
@@ -71809,7 +71847,7 @@ var seriesStyleTask = {
|
|
|
71809
71847
|
return {
|
|
71810
71848
|
dataEach: function (data, idx) {
|
|
71811
71849
|
var dataParams = seriesModel.getDataParams(idx);
|
|
71812
|
-
var itemStyle = extend({}, globalStyle);
|
|
71850
|
+
var itemStyle = extend$2({}, globalStyle);
|
|
71813
71851
|
itemStyle[colorKey] = colorCallback(dataParams);
|
|
71814
71852
|
data.setItemVisual(idx, 'style', itemStyle);
|
|
71815
71853
|
}
|
|
@@ -71840,7 +71878,7 @@ var dataStyleTask = {
|
|
|
71840
71878
|
sharedModel.option = rawItem[stylePath];
|
|
71841
71879
|
var style = getStyle(sharedModel);
|
|
71842
71880
|
var existsStyle = data.ensureUniqueItemVisual(idx, 'style');
|
|
71843
|
-
extend(existsStyle, style);
|
|
71881
|
+
extend$2(existsStyle, style);
|
|
71844
71882
|
|
|
71845
71883
|
if (sharedModel.option.decal) {
|
|
71846
71884
|
data.setItemVisual(idx, 'decal', sharedModel.option.decal);
|
|
@@ -72530,7 +72568,7 @@ function mockMethods(target, Clz) {
|
|
|
72530
72568
|
/* eslint-disable */
|
|
72531
72569
|
for (var name_1 in Clz.prototype) {
|
|
72532
72570
|
// Do not use hasOwnProperty
|
|
72533
|
-
target[name_1] = noop;
|
|
72571
|
+
target[name_1] = noop$1;
|
|
72534
72572
|
}
|
|
72535
72573
|
/* eslint-enable */
|
|
72536
72574
|
|
|
@@ -72958,7 +72996,7 @@ var seriesSymbolTask = {
|
|
|
72958
72996
|
}
|
|
72959
72997
|
|
|
72960
72998
|
symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol;
|
|
72961
|
-
data.setVisual(extend({
|
|
72999
|
+
data.setVisual(extend$2({
|
|
72962
73000
|
legendIcon: seriesModel.legendIcon || symbolOptions.symbol,
|
|
72963
73001
|
symbolKeepAspect: seriesModel.get('symbolKeepAspect')
|
|
72964
73002
|
}, symbolOptions)); // Only visible series has each data be visual encoded
|
|
@@ -73148,13 +73186,13 @@ function createLegacyDataSelectAction(seriesType, ecRegisterAction) {
|
|
|
73148
73186
|
|
|
73149
73187
|
each$9([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) {
|
|
73150
73188
|
ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {
|
|
73151
|
-
payload = extend({}, payload);
|
|
73189
|
+
payload = extend$2({}, payload);
|
|
73152
73190
|
|
|
73153
73191
|
if (process.env.NODE_ENV !== 'production') {
|
|
73154
73192
|
deprecateReplaceLog(payload.type, eventsMap[1]);
|
|
73155
73193
|
}
|
|
73156
73194
|
|
|
73157
|
-
api.dispatchAction(extend(payload, {
|
|
73195
|
+
api.dispatchAction(extend$2(payload, {
|
|
73158
73196
|
type: eventsMap[1],
|
|
73159
73197
|
seriesIndex: getSeriesIndices(ecModel, payload)
|
|
73160
73198
|
}));
|
|
@@ -73186,7 +73224,7 @@ function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payl
|
|
|
73186
73224
|
type: legacyEventName,
|
|
73187
73225
|
seriesId: seriesModel.id,
|
|
73188
73226
|
name: isArray$1(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),
|
|
73189
|
-
selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap)
|
|
73227
|
+
selected: isString(selectedMap) ? selectedMap : extend$2({}, selectedMap)
|
|
73190
73228
|
});
|
|
73191
73229
|
}
|
|
73192
73230
|
}
|
|
@@ -75465,7 +75503,7 @@ function (_super) {
|
|
|
75465
75503
|
return true;
|
|
75466
75504
|
} // If element has custom eventData of components
|
|
75467
75505
|
else if (ecData.eventData) {
|
|
75468
|
-
params = extend({}, ecData.eventData);
|
|
75506
|
+
params = extend$2({}, ecData.eventData);
|
|
75469
75507
|
return true;
|
|
75470
75508
|
}
|
|
75471
75509
|
}, true);
|
|
@@ -75634,7 +75672,7 @@ function (_super) {
|
|
|
75634
75672
|
needPrepare && prepare(this);
|
|
75635
75673
|
updateMethods.update.call(this, {
|
|
75636
75674
|
type: 'resize',
|
|
75637
|
-
animation: extend({
|
|
75675
|
+
animation: extend$2({
|
|
75638
75676
|
// Disable animation
|
|
75639
75677
|
duration: 0
|
|
75640
75678
|
}, opts && opts.animation)
|
|
@@ -75692,7 +75730,7 @@ function (_super) {
|
|
|
75692
75730
|
};
|
|
75693
75731
|
|
|
75694
75732
|
ECharts.prototype.makeActionFromEvent = function (eventObj) {
|
|
75695
|
-
var payload = extend({}, eventObj);
|
|
75733
|
+
var payload = extend$2({}, eventObj);
|
|
75696
75734
|
payload.type = eventActionMap[eventObj.type];
|
|
75697
75735
|
return payload;
|
|
75698
75736
|
};
|
|
@@ -76194,7 +76232,7 @@ function (_super) {
|
|
|
76194
76232
|
if (payload.batch) {
|
|
76195
76233
|
batched = true;
|
|
76196
76234
|
payloads = map$1(payload.batch, function (item) {
|
|
76197
|
-
item = defaults(extend({}, item), payload);
|
|
76235
|
+
item = defaults(extend$2({}, item), payload);
|
|
76198
76236
|
item.batch = null;
|
|
76199
76237
|
return item;
|
|
76200
76238
|
});
|
|
@@ -76213,7 +76251,7 @@ function (_super) {
|
|
|
76213
76251
|
// Action can specify the event by return it.
|
|
76214
76252
|
eventObj = actionWrap.action(batchItem, _this._model, _this._api); // Emit event outside
|
|
76215
76253
|
|
|
76216
|
-
eventObj = eventObj || extend({}, batchItem); // Convert type to eventType
|
|
76254
|
+
eventObj = eventObj || extend$2({}, batchItem); // Convert type to eventType
|
|
76217
76255
|
|
|
76218
76256
|
eventObj.type = actionInfo.event || eventObj.type;
|
|
76219
76257
|
eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual.
|
|
@@ -76461,7 +76499,7 @@ function (_super) {
|
|
|
76461
76499
|
renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) {
|
|
76462
76500
|
// Render all charts
|
|
76463
76501
|
var scheduler = ecIns._scheduler;
|
|
76464
|
-
updateParams = extend(updateParams || {}, {
|
|
76502
|
+
updateParams = extend$2(updateParams || {}, {
|
|
76465
76503
|
updatedSeries: ecModel.getSeries()
|
|
76466
76504
|
}); // TODO progressive?
|
|
76467
76505
|
|
|
@@ -77214,27 +77252,27 @@ registerAction({
|
|
|
77214
77252
|
type: HIGHLIGHT_ACTION_TYPE,
|
|
77215
77253
|
event: HIGHLIGHT_ACTION_TYPE,
|
|
77216
77254
|
update: HIGHLIGHT_ACTION_TYPE
|
|
77217
|
-
}, noop);
|
|
77255
|
+
}, noop$1);
|
|
77218
77256
|
registerAction({
|
|
77219
77257
|
type: DOWNPLAY_ACTION_TYPE,
|
|
77220
77258
|
event: DOWNPLAY_ACTION_TYPE,
|
|
77221
77259
|
update: DOWNPLAY_ACTION_TYPE
|
|
77222
|
-
}, noop);
|
|
77260
|
+
}, noop$1);
|
|
77223
77261
|
registerAction({
|
|
77224
77262
|
type: SELECT_ACTION_TYPE,
|
|
77225
77263
|
event: SELECT_ACTION_TYPE,
|
|
77226
77264
|
update: SELECT_ACTION_TYPE
|
|
77227
|
-
}, noop);
|
|
77265
|
+
}, noop$1);
|
|
77228
77266
|
registerAction({
|
|
77229
77267
|
type: UNSELECT_ACTION_TYPE,
|
|
77230
77268
|
event: UNSELECT_ACTION_TYPE,
|
|
77231
77269
|
update: UNSELECT_ACTION_TYPE
|
|
77232
|
-
}, noop);
|
|
77270
|
+
}, noop$1);
|
|
77233
77271
|
registerAction({
|
|
77234
77272
|
type: TOGGLE_SELECT_ACTION_TYPE,
|
|
77235
77273
|
event: TOGGLE_SELECT_ACTION_TYPE,
|
|
77236
77274
|
update: TOGGLE_SELECT_ACTION_TYPE
|
|
77237
|
-
}, noop); // Default theme
|
|
77275
|
+
}, noop$1); // Default theme
|
|
77238
77276
|
|
|
77239
77277
|
registerTheme('light', lightTheme);
|
|
77240
77278
|
registerTheme('dark', darkTheme); // For backward compatibility, where the namespace `dataTool` will
|
|
@@ -77725,7 +77763,7 @@ function () {
|
|
|
77725
77763
|
this.otherDims = {};
|
|
77726
77764
|
|
|
77727
77765
|
if (opt != null) {
|
|
77728
|
-
extend(this, opt);
|
|
77766
|
+
extend$2(this, opt);
|
|
77729
77767
|
}
|
|
77730
77768
|
}
|
|
77731
77769
|
|
|
@@ -78439,7 +78477,7 @@ function () {
|
|
|
78439
78477
|
};
|
|
78440
78478
|
|
|
78441
78479
|
SeriesData.prototype.setCalculationInfo = function (key, value) {
|
|
78442
|
-
isObject$1(key) ? extend(this._calculationInfo, key) : this._calculationInfo[key] = value;
|
|
78480
|
+
isObject$1(key) ? extend$2(this._calculationInfo, key) : this._calculationInfo[key] = value;
|
|
78443
78481
|
};
|
|
78444
78482
|
/**
|
|
78445
78483
|
* @return Never be null/undefined. `number` will be converted to string. Becuase:
|
|
@@ -78791,7 +78829,7 @@ function () {
|
|
|
78791
78829
|
this._visual = this._visual || {};
|
|
78792
78830
|
|
|
78793
78831
|
if (isObject$1(kvObj)) {
|
|
78794
|
-
extend(this._visual, kvObj);
|
|
78832
|
+
extend$2(this._visual, kvObj);
|
|
78795
78833
|
} else {
|
|
78796
78834
|
this._visual[kvObj] = val;
|
|
78797
78835
|
}
|
|
@@ -78843,7 +78881,7 @@ function () {
|
|
|
78843
78881
|
if (isArray$1(val)) {
|
|
78844
78882
|
val = val.slice();
|
|
78845
78883
|
} else if (isObject$1(val)) {
|
|
78846
|
-
val = extend({}, val);
|
|
78884
|
+
val = extend$2({}, val);
|
|
78847
78885
|
}
|
|
78848
78886
|
|
|
78849
78887
|
itemVisual[key] = val;
|
|
@@ -78858,7 +78896,7 @@ function () {
|
|
|
78858
78896
|
this._itemVisuals[idx] = itemVisual;
|
|
78859
78897
|
|
|
78860
78898
|
if (isObject$1(key)) {
|
|
78861
|
-
extend(itemVisual, key);
|
|
78899
|
+
extend$2(itemVisual, key);
|
|
78862
78900
|
} else {
|
|
78863
78901
|
itemVisual[key] = value;
|
|
78864
78902
|
}
|
|
@@ -78874,7 +78912,7 @@ function () {
|
|
|
78874
78912
|
};
|
|
78875
78913
|
|
|
78876
78914
|
SeriesData.prototype.setLayout = function (key, val) {
|
|
78877
|
-
isObject$1(key) ? extend(this._layout, key) : this._layout[key] = val;
|
|
78915
|
+
isObject$1(key) ? extend$2(this._layout, key) : this._layout[key] = val;
|
|
78878
78916
|
};
|
|
78879
78917
|
/**
|
|
78880
78918
|
* Get layout property.
|
|
@@ -78898,7 +78936,7 @@ function () {
|
|
|
78898
78936
|
|
|
78899
78937
|
|
|
78900
78938
|
SeriesData.prototype.setItemLayout = function (idx, layout, merge) {
|
|
78901
|
-
this._itemLayouts[idx] = merge ? extend(this._itemLayouts[idx] || {}, layout) : layout;
|
|
78939
|
+
this._itemLayouts[idx] = merge ? extend$2(this._itemLayouts[idx] || {}, layout) : layout;
|
|
78902
78940
|
};
|
|
78903
78941
|
/**
|
|
78904
78942
|
* Clear all layout of single data item
|
|
@@ -79046,7 +79084,7 @@ function () {
|
|
|
79046
79084
|
each$9(CLONE_PROPERTIES, function (propName) {
|
|
79047
79085
|
target[propName] = clone$3(source[propName]);
|
|
79048
79086
|
});
|
|
79049
|
-
target._calculationInfo = extend({}, source._calculationInfo);
|
|
79087
|
+
target._calculationInfo = extend$2({}, source._calculationInfo);
|
|
79050
79088
|
};
|
|
79051
79089
|
|
|
79052
79090
|
makeIdFromName = function (data, idx) {
|
|
@@ -79208,7 +79246,7 @@ source, opt) {
|
|
|
79208
79246
|
coordDim = sysDimItem.name;
|
|
79209
79247
|
var ordinalMeta = sysDimItem.ordinalMeta;
|
|
79210
79248
|
sysDimItem.ordinalMeta = null;
|
|
79211
|
-
sysDimItem = extend({}, sysDimItem);
|
|
79249
|
+
sysDimItem = extend$2({}, sysDimItem);
|
|
79212
79250
|
sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.
|
|
79213
79251
|
|
|
79214
79252
|
sysDimItemDimsDef = sysDimItem.dimsDef;
|
|
@@ -82984,10 +83022,10 @@ var util = /*#__PURE__*/Object.freeze({
|
|
|
82984
83022
|
isString: isString,
|
|
82985
83023
|
isObject: isObject$3,
|
|
82986
83024
|
isFunction: isFunction,
|
|
82987
|
-
extend: extend,
|
|
83025
|
+
extend: extend$2,
|
|
82988
83026
|
defaults: defaults,
|
|
82989
83027
|
clone: clone$3,
|
|
82990
|
-
merge: merge
|
|
83028
|
+
merge: merge$1
|
|
82991
83029
|
});
|
|
82992
83030
|
|
|
82993
83031
|
var inner$4 = makeInner();
|
|
@@ -85524,7 +85562,7 @@ var clip = {
|
|
|
85524
85562
|
var elementCreator = {
|
|
85525
85563
|
cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {
|
|
85526
85564
|
var rect = new Rect$1({
|
|
85527
|
-
shape: extend({}, layout),
|
|
85565
|
+
shape: extend$2({}, layout),
|
|
85528
85566
|
z2: 1
|
|
85529
85567
|
});
|
|
85530
85568
|
rect.__dataIndex = newIndex;
|
|
@@ -86730,7 +86768,7 @@ function (_super) {
|
|
|
86730
86768
|
var layout = data.getItemLayout(idx); // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified.
|
|
86731
86769
|
// see `setItemLayout` in `pieLayout.ts`.
|
|
86732
86770
|
|
|
86733
|
-
var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout); // Ignore NaN data.
|
|
86771
|
+
var sectorShape = extend$2(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout); // Ignore NaN data.
|
|
86734
86772
|
|
|
86735
86773
|
if (isNaN(sectorShape.startAngle)) {
|
|
86736
86774
|
// Use NaN shape to avoid drawing shape.
|
|
@@ -86802,25 +86840,25 @@ function (_super) {
|
|
|
86802
86840
|
|
|
86803
86841
|
this._updateLabel(seriesModel, data, idx);
|
|
86804
86842
|
|
|
86805
|
-
sector.ensureState('emphasis').shape = extend({
|
|
86843
|
+
sector.ensureState('emphasis').shape = extend$2({
|
|
86806
86844
|
r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0)
|
|
86807
86845
|
}, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));
|
|
86808
|
-
extend(sector.ensureState('select'), {
|
|
86846
|
+
extend$2(sector.ensureState('select'), {
|
|
86809
86847
|
x: dx,
|
|
86810
86848
|
y: dy,
|
|
86811
86849
|
shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)
|
|
86812
86850
|
});
|
|
86813
|
-
extend(sector.ensureState('blur'), {
|
|
86851
|
+
extend$2(sector.ensureState('blur'), {
|
|
86814
86852
|
shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)
|
|
86815
86853
|
});
|
|
86816
86854
|
var labelLine = sector.getTextGuideLine();
|
|
86817
86855
|
var labelText = sector.getTextContent();
|
|
86818
|
-
labelLine && extend(labelLine.ensureState('select'), {
|
|
86856
|
+
labelLine && extend$2(labelLine.ensureState('select'), {
|
|
86819
86857
|
x: dx,
|
|
86820
86858
|
y: dy
|
|
86821
86859
|
}); // TODO: needs dx, dy in zrender?
|
|
86822
86860
|
|
|
86823
|
-
extend(labelText.ensureState('select'), {
|
|
86861
|
+
extend$2(labelText.ensureState('select'), {
|
|
86824
86862
|
x: dx,
|
|
86825
86863
|
y: dy
|
|
86826
86864
|
});
|
|
@@ -86977,7 +87015,7 @@ var PieView$1 = PieView;
|
|
|
86977
87015
|
function createSeriesDataSimply(seriesModel, opt, nameList) {
|
|
86978
87016
|
opt = isArray$1(opt) && {
|
|
86979
87017
|
coordDimensions: opt
|
|
86980
|
-
} || extend({
|
|
87018
|
+
} || extend$2({
|
|
86981
87019
|
encodeDefine: seriesModel.getEncode()
|
|
86982
87020
|
}, opt);
|
|
86983
87021
|
var source = seriesModel.getSource();
|
|
@@ -87412,7 +87450,7 @@ var defaultOption$1 = {
|
|
|
87412
87450
|
}
|
|
87413
87451
|
}
|
|
87414
87452
|
};
|
|
87415
|
-
var categoryAxis = merge({
|
|
87453
|
+
var categoryAxis = merge$1({
|
|
87416
87454
|
// The gap at both ends of the axis. For categoryAxis, boolean.
|
|
87417
87455
|
boundaryGap: true,
|
|
87418
87456
|
// Set false to faster category collection.
|
|
@@ -87432,7 +87470,7 @@ var categoryAxis = merge({
|
|
|
87432
87470
|
interval: 'auto'
|
|
87433
87471
|
}
|
|
87434
87472
|
}, defaultOption$1);
|
|
87435
|
-
var valueAxis = merge({
|
|
87473
|
+
var valueAxis = merge$1({
|
|
87436
87474
|
boundaryGap: [0, 0],
|
|
87437
87475
|
axisLine: {
|
|
87438
87476
|
// Not shown when other axis is categoryAxis in cartesian
|
|
@@ -87464,7 +87502,7 @@ var valueAxis = merge({
|
|
|
87464
87502
|
}
|
|
87465
87503
|
}
|
|
87466
87504
|
}, defaultOption$1);
|
|
87467
|
-
var timeAxis = merge({
|
|
87505
|
+
var timeAxis = merge$1({
|
|
87468
87506
|
splitNumber: 6,
|
|
87469
87507
|
axisLabel: {
|
|
87470
87508
|
// To eliminate labels that are not nice
|
|
@@ -87546,7 +87584,7 @@ var AXIS_TYPES = {
|
|
|
87546
87584
|
|
|
87547
87585
|
function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {
|
|
87548
87586
|
each$9(AXIS_TYPES, function (v, axisType) {
|
|
87549
|
-
var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);
|
|
87587
|
+
var defaultOption = merge$1(merge$1({}, axisDefault[axisType], true), extraDefaultOption, true);
|
|
87550
87588
|
|
|
87551
87589
|
var AxisModel =
|
|
87552
87590
|
/** @class */
|
|
@@ -87564,8 +87602,8 @@ function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultO
|
|
|
87564
87602
|
var layoutMode = fetchLayoutMode(this);
|
|
87565
87603
|
var inputPositionParams = layoutMode ? getLayoutParams(option) : {};
|
|
87566
87604
|
var themeModel = ecModel.getTheme();
|
|
87567
|
-
merge(option, themeModel.get(axisType + 'Axis'));
|
|
87568
|
-
merge(option, this.getDefaultOption());
|
|
87605
|
+
merge$1(option, themeModel.get(axisType + 'Axis'));
|
|
87606
|
+
merge$1(option, this.getDefaultOption());
|
|
87569
87607
|
option.type = getAxisType(option);
|
|
87570
87608
|
|
|
87571
87609
|
if (layoutMode) {
|
|
@@ -88696,7 +88734,7 @@ var builders = {
|
|
|
88696
88734
|
applyTransform$1(pt2, pt2, matrix);
|
|
88697
88735
|
}
|
|
88698
88736
|
|
|
88699
|
-
var lineStyle = extend({
|
|
88737
|
+
var lineStyle = extend$2({
|
|
88700
88738
|
lineCap: 'round'
|
|
88701
88739
|
}, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());
|
|
88702
88740
|
var line = new Line$1({
|
|
@@ -89639,7 +89677,7 @@ function (_super) {
|
|
|
89639
89677
|
|
|
89640
89678
|
var gridModel = axisModel.getCoordSysModel();
|
|
89641
89679
|
var layout$1 = layout(gridModel, axisModel);
|
|
89642
|
-
var axisBuilder = new AxisBuilder$1(axisModel, extend({
|
|
89680
|
+
var axisBuilder = new AxisBuilder$1(axisModel, extend$2({
|
|
89643
89681
|
handleAutoShown: function (elementType) {
|
|
89644
89682
|
var cartesians = gridModel.coordinateSystem.getCartesians();
|
|
89645
89683
|
|
|
@@ -89900,7 +89938,7 @@ registerAction({
|
|
|
89900
89938
|
type: 'takeGlobalCursor',
|
|
89901
89939
|
event: 'globalCursorTaken',
|
|
89902
89940
|
update: 'update'
|
|
89903
|
-
}, noop);
|
|
89941
|
+
}, noop$1);
|
|
89904
89942
|
|
|
89905
89943
|
var RoamController =
|
|
89906
89944
|
/** @class */
|
|
@@ -91991,7 +92029,7 @@ function () {
|
|
|
91991
92029
|
controller.off('pan').on('pan', function (e) {
|
|
91992
92030
|
this._mouseDownFlag = false;
|
|
91993
92031
|
updateViewOnPan(controllerHost, e.dx, e.dy);
|
|
91994
|
-
api.dispatchAction(extend(makeActionBase(), {
|
|
92032
|
+
api.dispatchAction(extend$2(makeActionBase(), {
|
|
91995
92033
|
dx: e.dx,
|
|
91996
92034
|
dy: e.dy,
|
|
91997
92035
|
animation: {
|
|
@@ -92002,7 +92040,7 @@ function () {
|
|
|
92002
92040
|
controller.off('zoom').on('zoom', function (e) {
|
|
92003
92041
|
this._mouseDownFlag = false;
|
|
92004
92042
|
updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);
|
|
92005
|
-
api.dispatchAction(extend(makeActionBase(), {
|
|
92043
|
+
api.dispatchAction(extend$2(makeActionBase(), {
|
|
92006
92044
|
zoom: e.scale,
|
|
92007
92045
|
originX: e.originX,
|
|
92008
92046
|
originY: e.originY,
|
|
@@ -93348,7 +93386,7 @@ function () {
|
|
|
93348
93386
|
|
|
93349
93387
|
ecModel.eachComponent('geo', function (geoModel, idx) {
|
|
93350
93388
|
var mapName = geoModel.get('map');
|
|
93351
|
-
var geo = new Geo$1(mapName + idx, mapName, extend({
|
|
93389
|
+
var geo = new Geo$1(mapName + idx, mapName, extend$2({
|
|
93352
93390
|
nameMap: geoModel.get('nameMap')
|
|
93353
93391
|
}, getCommonGeoProperties(geoModel)));
|
|
93354
93392
|
geo.zoomLimit = geoModel.get('scaleLimit');
|
|
@@ -93381,7 +93419,7 @@ function () {
|
|
|
93381
93419
|
var nameMapList = map$1(mapSeries, function (singleMapSeries) {
|
|
93382
93420
|
return singleMapSeries.get('nameMap');
|
|
93383
93421
|
});
|
|
93384
|
-
var geo = new Geo$1(mapType, mapType, extend({
|
|
93422
|
+
var geo = new Geo$1(mapType, mapType, extend$2({
|
|
93385
93423
|
nameMap: mergeAll(nameMapList)
|
|
93386
93424
|
}, getCommonGeoProperties(mapSeries[0])));
|
|
93387
93425
|
geo.zoomLimit = retrieve.apply(null, map$1(mapSeries, function (singleMapSeries) {
|
|
@@ -94383,7 +94421,7 @@ var normalizers = {
|
|
|
94383
94421
|
|
|
94384
94422
|
return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;
|
|
94385
94423
|
},
|
|
94386
|
-
fixed: noop
|
|
94424
|
+
fixed: noop$1
|
|
94387
94425
|
};
|
|
94388
94426
|
|
|
94389
94427
|
function littleThan(close, a, b) {
|
|
@@ -95597,7 +95635,7 @@ function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {
|
|
|
95597
95635
|
// By default use the first involved series data as a sample to connect.
|
|
95598
95636
|
|
|
95599
95637
|
if (payloadBatch[0] && outputFinder.seriesIndex == null) {
|
|
95600
|
-
extend(outputFinder, payloadBatch[0]);
|
|
95638
|
+
extend$2(outputFinder, payloadBatch[0]);
|
|
95601
95639
|
} // If no linkSource input, this process is for collecting link
|
|
95602
95640
|
// target, where snap should not be accepted.
|
|
95603
95641
|
|
|
@@ -97002,7 +97040,7 @@ function (_super) {
|
|
|
97002
97040
|
|
|
97003
97041
|
if (frag) {
|
|
97004
97042
|
var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter');
|
|
97005
|
-
axisSectionMarkup.blocks.push(valueFormatter ? extend({
|
|
97043
|
+
axisSectionMarkup.blocks.push(valueFormatter ? extend$2({
|
|
97006
97044
|
valueFormatter: valueFormatter
|
|
97007
97045
|
}, frag) : frag);
|
|
97008
97046
|
}
|
|
@@ -97070,7 +97108,7 @@ function (_super) {
|
|
|
97070
97108
|
var orderMode = tooltipModel.get('order');
|
|
97071
97109
|
var valueFormatter = tooltipModel.get('valueFormatter');
|
|
97072
97110
|
var frag = seriesTooltipResult.frag;
|
|
97073
|
-
var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({
|
|
97111
|
+
var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend$2({
|
|
97074
97112
|
valueFormatter: valueFormatter
|
|
97075
97113
|
}, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text;
|
|
97076
97114
|
var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;
|
|
@@ -97537,12 +97575,12 @@ function install$9(registers) {
|
|
|
97537
97575
|
type: 'showTip',
|
|
97538
97576
|
event: 'showTip',
|
|
97539
97577
|
update: 'tooltip:manuallyShowTip'
|
|
97540
|
-
}, noop);
|
|
97578
|
+
}, noop$1);
|
|
97541
97579
|
registers.registerAction({
|
|
97542
97580
|
type: 'hideTip',
|
|
97543
97581
|
event: 'hideTip',
|
|
97544
97582
|
update: 'tooltip:manuallyHideTip'
|
|
97545
|
-
}, noop);
|
|
97583
|
+
}, noop$1);
|
|
97546
97584
|
}
|
|
97547
97585
|
|
|
97548
97586
|
var each$4 = each$9;
|
|
@@ -97927,7 +97965,7 @@ function (_super) {
|
|
|
97927
97965
|
isString(item) && (item = {
|
|
97928
97966
|
type: item
|
|
97929
97967
|
});
|
|
97930
|
-
selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));
|
|
97968
|
+
selector[index] = merge$1(item, getDefaultSelectorOptions(ecModel, item.type));
|
|
97931
97969
|
});
|
|
97932
97970
|
}
|
|
97933
97971
|
};
|
|
@@ -98326,7 +98364,7 @@ function (_super) {
|
|
|
98326
98364
|
if (colorArr && colorArr[3] === 0) {
|
|
98327
98365
|
colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA
|
|
98328
98366
|
|
|
98329
|
-
style = extend(extend({}, style), {
|
|
98367
|
+
style = extend$2(extend$2({}, style), {
|
|
98330
98368
|
fill: stringify(colorArr, 'rgba')
|
|
98331
98369
|
});
|
|
98332
98370
|
}
|
|
@@ -99652,9 +99690,9 @@ function (_super) {
|
|
|
99652
99690
|
};
|
|
99653
99691
|
var target = thisOption.target || (thisOption.target = {});
|
|
99654
99692
|
var controller = thisOption.controller || (thisOption.controller = {});
|
|
99655
|
-
merge(target, base); // Do not override
|
|
99693
|
+
merge$1(target, base); // Do not override
|
|
99656
99694
|
|
|
99657
|
-
merge(controller, base); // Do not override
|
|
99695
|
+
merge$1(controller, base); // Do not override
|
|
99658
99696
|
|
|
99659
99697
|
var isCategory = this.isCategory();
|
|
99660
99698
|
completeSingle.call(this, target);
|
|
@@ -100490,7 +100528,7 @@ function (_super) {
|
|
|
100490
100528
|
|
|
100491
100529
|
if (indicator instanceof ZRImage$1) {
|
|
100492
100530
|
var pathStyle = indicator.style;
|
|
100493
|
-
indicator.useStyle(extend({
|
|
100531
|
+
indicator.useStyle(extend$2({
|
|
100494
100532
|
// TODO other properties like x, y ?
|
|
100495
100533
|
image: pathStyle.image,
|
|
100496
100534
|
x: pathStyle.x,
|
|
@@ -102261,7 +102299,7 @@ var CanvasPainter = (function () {
|
|
|
102261
102299
|
this.type = 'canvas';
|
|
102262
102300
|
var singleCanvas = !root.nodeName
|
|
102263
102301
|
|| root.nodeName.toUpperCase() === 'CANVAS';
|
|
102264
|
-
this._opts = opts = extend({}, opts || {});
|
|
102302
|
+
this._opts = opts = extend$2({}, opts || {});
|
|
102265
102303
|
this.dpr = opts.devicePixelRatio || devicePixelRatio;
|
|
102266
102304
|
this._singleCanvas = singleCanvas;
|
|
102267
102305
|
this.root = root;
|
|
@@ -102546,10 +102584,10 @@ var CanvasPainter = (function () {
|
|
|
102546
102584
|
layer.zlevel = zlevel;
|
|
102547
102585
|
layer.__builtin__ = true;
|
|
102548
102586
|
if (this._layerConfig[zlevel]) {
|
|
102549
|
-
merge(layer, this._layerConfig[zlevel], true);
|
|
102587
|
+
merge$1(layer, this._layerConfig[zlevel], true);
|
|
102550
102588
|
}
|
|
102551
102589
|
else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {
|
|
102552
|
-
merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);
|
|
102590
|
+
merge$1(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);
|
|
102553
102591
|
}
|
|
102554
102592
|
if (virtual) {
|
|
102555
102593
|
layer.virtual = virtual;
|
|
@@ -102737,13 +102775,13 @@ var CanvasPainter = (function () {
|
|
|
102737
102775
|
layerConfig[zlevel] = config;
|
|
102738
102776
|
}
|
|
102739
102777
|
else {
|
|
102740
|
-
merge(layerConfig[zlevel], config, true);
|
|
102778
|
+
merge$1(layerConfig[zlevel], config, true);
|
|
102741
102779
|
}
|
|
102742
102780
|
for (var i = 0; i < this._zlevelList.length; i++) {
|
|
102743
102781
|
var _zlevel = this._zlevelList[i];
|
|
102744
102782
|
if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {
|
|
102745
102783
|
var layer = this._layers[_zlevel];
|
|
102746
|
-
merge(layer, layerConfig[zlevel], true);
|
|
102784
|
+
merge$1(layer, layerConfig[zlevel], true);
|
|
102747
102785
|
}
|
|
102748
102786
|
}
|
|
102749
102787
|
}
|
|
@@ -103746,6 +103784,2048 @@ DisplayPicture.defaultProps = {
|
|
|
103746
103784
|
size: 'sm'
|
|
103747
103785
|
};
|
|
103748
103786
|
|
|
103787
|
+
// do not edit .js files directly - edit src/index.jst
|
|
103788
|
+
|
|
103789
|
+
|
|
103790
|
+
|
|
103791
|
+
var fastDeepEqual = function equal(a, b) {
|
|
103792
|
+
if (a === b) return true;
|
|
103793
|
+
|
|
103794
|
+
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
103795
|
+
if (a.constructor !== b.constructor) return false;
|
|
103796
|
+
|
|
103797
|
+
var length, i, keys;
|
|
103798
|
+
if (Array.isArray(a)) {
|
|
103799
|
+
length = a.length;
|
|
103800
|
+
if (length != b.length) return false;
|
|
103801
|
+
for (i = length; i-- !== 0;)
|
|
103802
|
+
if (!equal(a[i], b[i])) return false;
|
|
103803
|
+
return true;
|
|
103804
|
+
}
|
|
103805
|
+
|
|
103806
|
+
|
|
103807
|
+
|
|
103808
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
103809
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
103810
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
103811
|
+
|
|
103812
|
+
keys = Object.keys(a);
|
|
103813
|
+
length = keys.length;
|
|
103814
|
+
if (length !== Object.keys(b).length) return false;
|
|
103815
|
+
|
|
103816
|
+
for (i = length; i-- !== 0;)
|
|
103817
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
103818
|
+
|
|
103819
|
+
for (i = length; i-- !== 0;) {
|
|
103820
|
+
var key = keys[i];
|
|
103821
|
+
|
|
103822
|
+
if (!equal(a[key], b[key])) return false;
|
|
103823
|
+
}
|
|
103824
|
+
|
|
103825
|
+
return true;
|
|
103826
|
+
}
|
|
103827
|
+
|
|
103828
|
+
// true if both NaN, false otherwise
|
|
103829
|
+
return a!==a && b!==b;
|
|
103830
|
+
};
|
|
103831
|
+
|
|
103832
|
+
/**
|
|
103833
|
+
* Copyright 2019 Google LLC. All Rights Reserved.
|
|
103834
|
+
*
|
|
103835
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
103836
|
+
* you may not use this file except in compliance with the License.
|
|
103837
|
+
* You may obtain a copy of the License at.
|
|
103838
|
+
*
|
|
103839
|
+
* Http://www.apache.org/licenses/LICENSE-2.0.
|
|
103840
|
+
*
|
|
103841
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
103842
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
103843
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
103844
|
+
* See the License for the specific language governing permissions and
|
|
103845
|
+
* limitations under the License.
|
|
103846
|
+
*/
|
|
103847
|
+
const DEFAULT_ID = "__googleMapsScriptId";
|
|
103848
|
+
/**
|
|
103849
|
+
* The status of the [[Loader]].
|
|
103850
|
+
*/
|
|
103851
|
+
var LoaderStatus;
|
|
103852
|
+
(function (LoaderStatus) {
|
|
103853
|
+
LoaderStatus[LoaderStatus["INITIALIZED"] = 0] = "INITIALIZED";
|
|
103854
|
+
LoaderStatus[LoaderStatus["LOADING"] = 1] = "LOADING";
|
|
103855
|
+
LoaderStatus[LoaderStatus["SUCCESS"] = 2] = "SUCCESS";
|
|
103856
|
+
LoaderStatus[LoaderStatus["FAILURE"] = 3] = "FAILURE";
|
|
103857
|
+
})(LoaderStatus || (LoaderStatus = {}));
|
|
103858
|
+
/**
|
|
103859
|
+
* [[Loader]] makes it easier to add Google Maps JavaScript API to your application
|
|
103860
|
+
* dynamically using
|
|
103861
|
+
* [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
|
|
103862
|
+
* It works by dynamically creating and appending a script node to the the
|
|
103863
|
+
* document head and wrapping the callback function so as to return a promise.
|
|
103864
|
+
*
|
|
103865
|
+
* ```
|
|
103866
|
+
* const loader = new Loader({
|
|
103867
|
+
* apiKey: "",
|
|
103868
|
+
* version: "weekly",
|
|
103869
|
+
* libraries: ["places"]
|
|
103870
|
+
* });
|
|
103871
|
+
*
|
|
103872
|
+
* loader.load().then((google) => {
|
|
103873
|
+
* const map = new google.maps.Map(...)
|
|
103874
|
+
* })
|
|
103875
|
+
* ```
|
|
103876
|
+
*/
|
|
103877
|
+
class Loader {
|
|
103878
|
+
/**
|
|
103879
|
+
* Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
|
|
103880
|
+
* using this library, instead the defaults are set by the Google Maps
|
|
103881
|
+
* JavaScript API server.
|
|
103882
|
+
*
|
|
103883
|
+
* ```
|
|
103884
|
+
* const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
|
|
103885
|
+
* ```
|
|
103886
|
+
*/
|
|
103887
|
+
constructor({ apiKey, authReferrerPolicy, channel, client, id = DEFAULT_ID, language, libraries = [], mapIds, nonce, region, retries = 3, url = "https://maps.googleapis.com/maps/api/js", version, }) {
|
|
103888
|
+
this.CALLBACK = "__googleMapsCallback";
|
|
103889
|
+
this.callbacks = [];
|
|
103890
|
+
this.done = false;
|
|
103891
|
+
this.loading = false;
|
|
103892
|
+
this.errors = [];
|
|
103893
|
+
this.apiKey = apiKey;
|
|
103894
|
+
this.authReferrerPolicy = authReferrerPolicy;
|
|
103895
|
+
this.channel = channel;
|
|
103896
|
+
this.client = client;
|
|
103897
|
+
this.id = id || DEFAULT_ID; // Do not allow empty string
|
|
103898
|
+
this.language = language;
|
|
103899
|
+
this.libraries = libraries;
|
|
103900
|
+
this.mapIds = mapIds;
|
|
103901
|
+
this.nonce = nonce;
|
|
103902
|
+
this.region = region;
|
|
103903
|
+
this.retries = retries;
|
|
103904
|
+
this.url = url;
|
|
103905
|
+
this.version = version;
|
|
103906
|
+
if (Loader.instance) {
|
|
103907
|
+
if (!fastDeepEqual(this.options, Loader.instance.options)) {
|
|
103908
|
+
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`);
|
|
103909
|
+
}
|
|
103910
|
+
return Loader.instance;
|
|
103911
|
+
}
|
|
103912
|
+
Loader.instance = this;
|
|
103913
|
+
}
|
|
103914
|
+
get options() {
|
|
103915
|
+
return {
|
|
103916
|
+
version: this.version,
|
|
103917
|
+
apiKey: this.apiKey,
|
|
103918
|
+
channel: this.channel,
|
|
103919
|
+
client: this.client,
|
|
103920
|
+
id: this.id,
|
|
103921
|
+
libraries: this.libraries,
|
|
103922
|
+
language: this.language,
|
|
103923
|
+
region: this.region,
|
|
103924
|
+
mapIds: this.mapIds,
|
|
103925
|
+
nonce: this.nonce,
|
|
103926
|
+
url: this.url,
|
|
103927
|
+
authReferrerPolicy: this.authReferrerPolicy,
|
|
103928
|
+
};
|
|
103929
|
+
}
|
|
103930
|
+
get status() {
|
|
103931
|
+
if (this.errors.length) {
|
|
103932
|
+
return LoaderStatus.FAILURE;
|
|
103933
|
+
}
|
|
103934
|
+
if (this.done) {
|
|
103935
|
+
return LoaderStatus.SUCCESS;
|
|
103936
|
+
}
|
|
103937
|
+
if (this.loading) {
|
|
103938
|
+
return LoaderStatus.LOADING;
|
|
103939
|
+
}
|
|
103940
|
+
return LoaderStatus.INITIALIZED;
|
|
103941
|
+
}
|
|
103942
|
+
get failed() {
|
|
103943
|
+
return this.done && !this.loading && this.errors.length >= this.retries + 1;
|
|
103944
|
+
}
|
|
103945
|
+
/**
|
|
103946
|
+
* CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
|
|
103947
|
+
*
|
|
103948
|
+
* @ignore
|
|
103949
|
+
*/
|
|
103950
|
+
createUrl() {
|
|
103951
|
+
let url = this.url;
|
|
103952
|
+
url += `?callback=${this.CALLBACK}`;
|
|
103953
|
+
if (this.apiKey) {
|
|
103954
|
+
url += `&key=${this.apiKey}`;
|
|
103955
|
+
}
|
|
103956
|
+
if (this.channel) {
|
|
103957
|
+
url += `&channel=${this.channel}`;
|
|
103958
|
+
}
|
|
103959
|
+
if (this.client) {
|
|
103960
|
+
url += `&client=${this.client}`;
|
|
103961
|
+
}
|
|
103962
|
+
if (this.libraries.length > 0) {
|
|
103963
|
+
url += `&libraries=${this.libraries.join(",")}`;
|
|
103964
|
+
}
|
|
103965
|
+
if (this.language) {
|
|
103966
|
+
url += `&language=${this.language}`;
|
|
103967
|
+
}
|
|
103968
|
+
if (this.region) {
|
|
103969
|
+
url += `®ion=${this.region}`;
|
|
103970
|
+
}
|
|
103971
|
+
if (this.version) {
|
|
103972
|
+
url += `&v=${this.version}`;
|
|
103973
|
+
}
|
|
103974
|
+
if (this.mapIds) {
|
|
103975
|
+
url += `&map_ids=${this.mapIds.join(",")}`;
|
|
103976
|
+
}
|
|
103977
|
+
if (this.authReferrerPolicy) {
|
|
103978
|
+
url += `&auth_referrer_policy=${this.authReferrerPolicy}`;
|
|
103979
|
+
}
|
|
103980
|
+
return url;
|
|
103981
|
+
}
|
|
103982
|
+
deleteScript() {
|
|
103983
|
+
const script = document.getElementById(this.id);
|
|
103984
|
+
if (script) {
|
|
103985
|
+
script.remove();
|
|
103986
|
+
}
|
|
103987
|
+
}
|
|
103988
|
+
/**
|
|
103989
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
103990
|
+
*/
|
|
103991
|
+
load() {
|
|
103992
|
+
return this.loadPromise();
|
|
103993
|
+
}
|
|
103994
|
+
/**
|
|
103995
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
103996
|
+
*
|
|
103997
|
+
* @ignore
|
|
103998
|
+
*/
|
|
103999
|
+
loadPromise() {
|
|
104000
|
+
return new Promise((resolve, reject) => {
|
|
104001
|
+
this.loadCallback((err) => {
|
|
104002
|
+
if (!err) {
|
|
104003
|
+
resolve(window.google);
|
|
104004
|
+
}
|
|
104005
|
+
else {
|
|
104006
|
+
reject(err.error);
|
|
104007
|
+
}
|
|
104008
|
+
});
|
|
104009
|
+
});
|
|
104010
|
+
}
|
|
104011
|
+
/**
|
|
104012
|
+
* Load the Google Maps JavaScript API script with a callback.
|
|
104013
|
+
*/
|
|
104014
|
+
loadCallback(fn) {
|
|
104015
|
+
this.callbacks.push(fn);
|
|
104016
|
+
this.execute();
|
|
104017
|
+
}
|
|
104018
|
+
/**
|
|
104019
|
+
* Set the script on document.
|
|
104020
|
+
*/
|
|
104021
|
+
setScript() {
|
|
104022
|
+
if (document.getElementById(this.id)) {
|
|
104023
|
+
// TODO wrap onerror callback for cases where the script was loaded elsewhere
|
|
104024
|
+
this.callback();
|
|
104025
|
+
return;
|
|
104026
|
+
}
|
|
104027
|
+
const url = this.createUrl();
|
|
104028
|
+
const script = document.createElement("script");
|
|
104029
|
+
script.id = this.id;
|
|
104030
|
+
script.type = "text/javascript";
|
|
104031
|
+
script.src = url;
|
|
104032
|
+
script.onerror = this.loadErrorCallback.bind(this);
|
|
104033
|
+
script.defer = true;
|
|
104034
|
+
script.async = true;
|
|
104035
|
+
if (this.nonce) {
|
|
104036
|
+
script.nonce = this.nonce;
|
|
104037
|
+
}
|
|
104038
|
+
document.head.appendChild(script);
|
|
104039
|
+
}
|
|
104040
|
+
/**
|
|
104041
|
+
* Reset the loader state.
|
|
104042
|
+
*/
|
|
104043
|
+
reset() {
|
|
104044
|
+
this.deleteScript();
|
|
104045
|
+
this.done = false;
|
|
104046
|
+
this.loading = false;
|
|
104047
|
+
this.errors = [];
|
|
104048
|
+
this.onerrorEvent = null;
|
|
104049
|
+
}
|
|
104050
|
+
resetIfRetryingFailed() {
|
|
104051
|
+
if (this.failed) {
|
|
104052
|
+
this.reset();
|
|
104053
|
+
}
|
|
104054
|
+
}
|
|
104055
|
+
loadErrorCallback(e) {
|
|
104056
|
+
this.errors.push(e);
|
|
104057
|
+
if (this.errors.length <= this.retries) {
|
|
104058
|
+
const delay = this.errors.length * Math.pow(2, this.errors.length);
|
|
104059
|
+
console.log(`Failed to load Google Maps script, retrying in ${delay} ms.`);
|
|
104060
|
+
setTimeout(() => {
|
|
104061
|
+
this.deleteScript();
|
|
104062
|
+
this.setScript();
|
|
104063
|
+
}, delay);
|
|
104064
|
+
}
|
|
104065
|
+
else {
|
|
104066
|
+
this.onerrorEvent = e;
|
|
104067
|
+
this.callback();
|
|
104068
|
+
}
|
|
104069
|
+
}
|
|
104070
|
+
setCallback() {
|
|
104071
|
+
window.__googleMapsCallback = this.callback.bind(this);
|
|
104072
|
+
}
|
|
104073
|
+
callback() {
|
|
104074
|
+
this.done = true;
|
|
104075
|
+
this.loading = false;
|
|
104076
|
+
this.callbacks.forEach((cb) => {
|
|
104077
|
+
cb(this.onerrorEvent);
|
|
104078
|
+
});
|
|
104079
|
+
this.callbacks = [];
|
|
104080
|
+
}
|
|
104081
|
+
execute() {
|
|
104082
|
+
this.resetIfRetryingFailed();
|
|
104083
|
+
if (this.done) {
|
|
104084
|
+
this.callback();
|
|
104085
|
+
}
|
|
104086
|
+
else {
|
|
104087
|
+
// short circuit and warn if google.maps is already loaded
|
|
104088
|
+
if (window.google && window.google.maps && window.google.maps.version) {
|
|
104089
|
+
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader." +
|
|
104090
|
+
"This may result in undesirable behavior as options and script parameters may not match.");
|
|
104091
|
+
this.callback();
|
|
104092
|
+
return;
|
|
104093
|
+
}
|
|
104094
|
+
if (this.loading) ;
|
|
104095
|
+
else {
|
|
104096
|
+
this.loading = true;
|
|
104097
|
+
this.setCallback();
|
|
104098
|
+
this.setScript();
|
|
104099
|
+
}
|
|
104100
|
+
}
|
|
104101
|
+
}
|
|
104102
|
+
}
|
|
104103
|
+
|
|
104104
|
+
/**
|
|
104105
|
+
* Copyright 2021 Google LLC. All Rights Reserved.
|
|
104106
|
+
*
|
|
104107
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
104108
|
+
* you may not use this file except in compliance with the License.
|
|
104109
|
+
* You may obtain a copy of the License at.
|
|
104110
|
+
*
|
|
104111
|
+
* Http://www.apache.org/licenses/LICENSE-2.0.
|
|
104112
|
+
*
|
|
104113
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
104114
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
104115
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104116
|
+
* See the License for the specific language governing permissions and
|
|
104117
|
+
* limitations under the License.
|
|
104118
|
+
*/
|
|
104119
|
+
var Status;
|
|
104120
|
+
(function (Status) {
|
|
104121
|
+
Status["LOADING"] = "LOADING";
|
|
104122
|
+
Status["FAILURE"] = "FAILURE";
|
|
104123
|
+
Status["SUCCESS"] = "SUCCESS";
|
|
104124
|
+
})(Status || (Status = {}));
|
|
104125
|
+
/**
|
|
104126
|
+
* A component to wrap the loading of the Google Maps JavaScript API.
|
|
104127
|
+
*
|
|
104128
|
+
* ```
|
|
104129
|
+
* import { Wrapper } from '@googlemaps/react-wrapper';
|
|
104130
|
+
*
|
|
104131
|
+
* const MyApp = () => (
|
|
104132
|
+
* <Wrapper apiKey={'YOUR_API_KEY'}>
|
|
104133
|
+
* <MyMapComponent />
|
|
104134
|
+
* </Wrapper>
|
|
104135
|
+
* );
|
|
104136
|
+
* ```
|
|
104137
|
+
*
|
|
104138
|
+
* @param props
|
|
104139
|
+
*/
|
|
104140
|
+
const Wrapper = ({ children, render, callback, ...options }) => {
|
|
104141
|
+
const [status, setStatus] = React.useState(Status.LOADING);
|
|
104142
|
+
React.useEffect(() => {
|
|
104143
|
+
const loader = new Loader(options);
|
|
104144
|
+
const setStatusAndExecuteCallback = (status) => {
|
|
104145
|
+
if (callback)
|
|
104146
|
+
callback(status, loader);
|
|
104147
|
+
setStatus(status);
|
|
104148
|
+
};
|
|
104149
|
+
setStatusAndExecuteCallback(Status.LOADING);
|
|
104150
|
+
loader.load().then(() => setStatusAndExecuteCallback(Status.SUCCESS), () => setStatusAndExecuteCallback(Status.FAILURE));
|
|
104151
|
+
}, []);
|
|
104152
|
+
if (status === Status.SUCCESS && children)
|
|
104153
|
+
return React.createElement(React.Fragment, null, children);
|
|
104154
|
+
if (render)
|
|
104155
|
+
return render(status);
|
|
104156
|
+
return React.createElement(React.Fragment, null);
|
|
104157
|
+
};
|
|
104158
|
+
|
|
104159
|
+
function sortKD(ids, coords, nodeSize, left, right, depth) {
|
|
104160
|
+
if (right - left <= nodeSize) return;
|
|
104161
|
+
|
|
104162
|
+
const m = (left + right) >> 1;
|
|
104163
|
+
|
|
104164
|
+
select(ids, coords, m, left, right, depth % 2);
|
|
104165
|
+
|
|
104166
|
+
sortKD(ids, coords, nodeSize, left, m - 1, depth + 1);
|
|
104167
|
+
sortKD(ids, coords, nodeSize, m + 1, right, depth + 1);
|
|
104168
|
+
}
|
|
104169
|
+
|
|
104170
|
+
function select(ids, coords, k, left, right, inc) {
|
|
104171
|
+
|
|
104172
|
+
while (right > left) {
|
|
104173
|
+
if (right - left > 600) {
|
|
104174
|
+
const n = right - left + 1;
|
|
104175
|
+
const m = k - left + 1;
|
|
104176
|
+
const z = Math.log(n);
|
|
104177
|
+
const s = 0.5 * Math.exp(2 * z / 3);
|
|
104178
|
+
const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
|
|
104179
|
+
const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
|
|
104180
|
+
const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
|
|
104181
|
+
select(ids, coords, k, newLeft, newRight, inc);
|
|
104182
|
+
}
|
|
104183
|
+
|
|
104184
|
+
const t = coords[2 * k + inc];
|
|
104185
|
+
let i = left;
|
|
104186
|
+
let j = right;
|
|
104187
|
+
|
|
104188
|
+
swapItem(ids, coords, left, k);
|
|
104189
|
+
if (coords[2 * right + inc] > t) swapItem(ids, coords, left, right);
|
|
104190
|
+
|
|
104191
|
+
while (i < j) {
|
|
104192
|
+
swapItem(ids, coords, i, j);
|
|
104193
|
+
i++;
|
|
104194
|
+
j--;
|
|
104195
|
+
while (coords[2 * i + inc] < t) i++;
|
|
104196
|
+
while (coords[2 * j + inc] > t) j--;
|
|
104197
|
+
}
|
|
104198
|
+
|
|
104199
|
+
if (coords[2 * left + inc] === t) swapItem(ids, coords, left, j);
|
|
104200
|
+
else {
|
|
104201
|
+
j++;
|
|
104202
|
+
swapItem(ids, coords, j, right);
|
|
104203
|
+
}
|
|
104204
|
+
|
|
104205
|
+
if (j <= k) left = j + 1;
|
|
104206
|
+
if (k <= j) right = j - 1;
|
|
104207
|
+
}
|
|
104208
|
+
}
|
|
104209
|
+
|
|
104210
|
+
function swapItem(ids, coords, i, j) {
|
|
104211
|
+
swap(ids, i, j);
|
|
104212
|
+
swap(coords, 2 * i, 2 * j);
|
|
104213
|
+
swap(coords, 2 * i + 1, 2 * j + 1);
|
|
104214
|
+
}
|
|
104215
|
+
|
|
104216
|
+
function swap(arr, i, j) {
|
|
104217
|
+
const tmp = arr[i];
|
|
104218
|
+
arr[i] = arr[j];
|
|
104219
|
+
arr[j] = tmp;
|
|
104220
|
+
}
|
|
104221
|
+
|
|
104222
|
+
function range(ids, coords, minX, minY, maxX, maxY, nodeSize) {
|
|
104223
|
+
const stack = [0, ids.length - 1, 0];
|
|
104224
|
+
const result = [];
|
|
104225
|
+
let x, y;
|
|
104226
|
+
|
|
104227
|
+
while (stack.length) {
|
|
104228
|
+
const axis = stack.pop();
|
|
104229
|
+
const right = stack.pop();
|
|
104230
|
+
const left = stack.pop();
|
|
104231
|
+
|
|
104232
|
+
if (right - left <= nodeSize) {
|
|
104233
|
+
for (let i = left; i <= right; i++) {
|
|
104234
|
+
x = coords[2 * i];
|
|
104235
|
+
y = coords[2 * i + 1];
|
|
104236
|
+
if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);
|
|
104237
|
+
}
|
|
104238
|
+
continue;
|
|
104239
|
+
}
|
|
104240
|
+
|
|
104241
|
+
const m = Math.floor((left + right) / 2);
|
|
104242
|
+
|
|
104243
|
+
x = coords[2 * m];
|
|
104244
|
+
y = coords[2 * m + 1];
|
|
104245
|
+
|
|
104246
|
+
if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);
|
|
104247
|
+
|
|
104248
|
+
const nextAxis = (axis + 1) % 2;
|
|
104249
|
+
|
|
104250
|
+
if (axis === 0 ? minX <= x : minY <= y) {
|
|
104251
|
+
stack.push(left);
|
|
104252
|
+
stack.push(m - 1);
|
|
104253
|
+
stack.push(nextAxis);
|
|
104254
|
+
}
|
|
104255
|
+
if (axis === 0 ? maxX >= x : maxY >= y) {
|
|
104256
|
+
stack.push(m + 1);
|
|
104257
|
+
stack.push(right);
|
|
104258
|
+
stack.push(nextAxis);
|
|
104259
|
+
}
|
|
104260
|
+
}
|
|
104261
|
+
|
|
104262
|
+
return result;
|
|
104263
|
+
}
|
|
104264
|
+
|
|
104265
|
+
function within(ids, coords, qx, qy, r, nodeSize) {
|
|
104266
|
+
const stack = [0, ids.length - 1, 0];
|
|
104267
|
+
const result = [];
|
|
104268
|
+
const r2 = r * r;
|
|
104269
|
+
|
|
104270
|
+
while (stack.length) {
|
|
104271
|
+
const axis = stack.pop();
|
|
104272
|
+
const right = stack.pop();
|
|
104273
|
+
const left = stack.pop();
|
|
104274
|
+
|
|
104275
|
+
if (right - left <= nodeSize) {
|
|
104276
|
+
for (let i = left; i <= right; i++) {
|
|
104277
|
+
if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);
|
|
104278
|
+
}
|
|
104279
|
+
continue;
|
|
104280
|
+
}
|
|
104281
|
+
|
|
104282
|
+
const m = Math.floor((left + right) / 2);
|
|
104283
|
+
|
|
104284
|
+
const x = coords[2 * m];
|
|
104285
|
+
const y = coords[2 * m + 1];
|
|
104286
|
+
|
|
104287
|
+
if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);
|
|
104288
|
+
|
|
104289
|
+
const nextAxis = (axis + 1) % 2;
|
|
104290
|
+
|
|
104291
|
+
if (axis === 0 ? qx - r <= x : qy - r <= y) {
|
|
104292
|
+
stack.push(left);
|
|
104293
|
+
stack.push(m - 1);
|
|
104294
|
+
stack.push(nextAxis);
|
|
104295
|
+
}
|
|
104296
|
+
if (axis === 0 ? qx + r >= x : qy + r >= y) {
|
|
104297
|
+
stack.push(m + 1);
|
|
104298
|
+
stack.push(right);
|
|
104299
|
+
stack.push(nextAxis);
|
|
104300
|
+
}
|
|
104301
|
+
}
|
|
104302
|
+
|
|
104303
|
+
return result;
|
|
104304
|
+
}
|
|
104305
|
+
|
|
104306
|
+
function sqDist(ax, ay, bx, by) {
|
|
104307
|
+
const dx = ax - bx;
|
|
104308
|
+
const dy = ay - by;
|
|
104309
|
+
return dx * dx + dy * dy;
|
|
104310
|
+
}
|
|
104311
|
+
|
|
104312
|
+
const defaultGetX = p => p[0];
|
|
104313
|
+
const defaultGetY = p => p[1];
|
|
104314
|
+
|
|
104315
|
+
class KDBush {
|
|
104316
|
+
constructor(points, getX = defaultGetX, getY = defaultGetY, nodeSize = 64, ArrayType = Float64Array) {
|
|
104317
|
+
this.nodeSize = nodeSize;
|
|
104318
|
+
this.points = points;
|
|
104319
|
+
|
|
104320
|
+
const IndexArrayType = points.length < 65536 ? Uint16Array : Uint32Array;
|
|
104321
|
+
|
|
104322
|
+
const ids = this.ids = new IndexArrayType(points.length);
|
|
104323
|
+
const coords = this.coords = new ArrayType(points.length * 2);
|
|
104324
|
+
|
|
104325
|
+
for (let i = 0; i < points.length; i++) {
|
|
104326
|
+
ids[i] = i;
|
|
104327
|
+
coords[2 * i] = getX(points[i]);
|
|
104328
|
+
coords[2 * i + 1] = getY(points[i]);
|
|
104329
|
+
}
|
|
104330
|
+
|
|
104331
|
+
sortKD(ids, coords, nodeSize, 0, ids.length - 1, 0);
|
|
104332
|
+
}
|
|
104333
|
+
|
|
104334
|
+
range(minX, minY, maxX, maxY) {
|
|
104335
|
+
return range(this.ids, this.coords, minX, minY, maxX, maxY, this.nodeSize);
|
|
104336
|
+
}
|
|
104337
|
+
|
|
104338
|
+
within(x, y, r) {
|
|
104339
|
+
return within(this.ids, this.coords, x, y, r, this.nodeSize);
|
|
104340
|
+
}
|
|
104341
|
+
}
|
|
104342
|
+
|
|
104343
|
+
const defaultOptions = {
|
|
104344
|
+
minZoom: 0, // min zoom to generate clusters on
|
|
104345
|
+
maxZoom: 16, // max zoom level to cluster the points on
|
|
104346
|
+
minPoints: 2, // minimum points to form a cluster
|
|
104347
|
+
radius: 40, // cluster radius in pixels
|
|
104348
|
+
extent: 512, // tile extent (radius is calculated relative to it)
|
|
104349
|
+
nodeSize: 64, // size of the KD-tree leaf node, affects performance
|
|
104350
|
+
log: false, // whether to log timing info
|
|
104351
|
+
|
|
104352
|
+
// whether to generate numeric ids for input features (in vector tiles)
|
|
104353
|
+
generateId: false,
|
|
104354
|
+
|
|
104355
|
+
// a reduce function for calculating custom cluster properties
|
|
104356
|
+
reduce: null, // (accumulated, props) => { accumulated.sum += props.sum; }
|
|
104357
|
+
|
|
104358
|
+
// properties to use for individual points when running the reducer
|
|
104359
|
+
map: props => props // props => ({sum: props.my_value})
|
|
104360
|
+
};
|
|
104361
|
+
|
|
104362
|
+
const fround = Math.fround || (tmp => ((x) => { tmp[0] = +x; return tmp[0]; }))(new Float32Array(1));
|
|
104363
|
+
|
|
104364
|
+
class Supercluster {
|
|
104365
|
+
constructor(options) {
|
|
104366
|
+
this.options = extend$1(Object.create(defaultOptions), options);
|
|
104367
|
+
this.trees = new Array(this.options.maxZoom + 1);
|
|
104368
|
+
}
|
|
104369
|
+
|
|
104370
|
+
load(points) {
|
|
104371
|
+
const {log, minZoom, maxZoom, nodeSize} = this.options;
|
|
104372
|
+
|
|
104373
|
+
if (log) console.time('total time');
|
|
104374
|
+
|
|
104375
|
+
const timerId = `prepare ${ points.length } points`;
|
|
104376
|
+
if (log) console.time(timerId);
|
|
104377
|
+
|
|
104378
|
+
this.points = points;
|
|
104379
|
+
|
|
104380
|
+
// generate a cluster object for each point and index input points into a KD-tree
|
|
104381
|
+
let clusters = [];
|
|
104382
|
+
for (let i = 0; i < points.length; i++) {
|
|
104383
|
+
if (!points[i].geometry) continue;
|
|
104384
|
+
clusters.push(createPointCluster(points[i], i));
|
|
104385
|
+
}
|
|
104386
|
+
this.trees[maxZoom + 1] = new KDBush(clusters, getX, getY, nodeSize, Float32Array);
|
|
104387
|
+
|
|
104388
|
+
if (log) console.timeEnd(timerId);
|
|
104389
|
+
|
|
104390
|
+
// cluster points on max zoom, then cluster the results on previous zoom, etc.;
|
|
104391
|
+
// results in a cluster hierarchy across zoom levels
|
|
104392
|
+
for (let z = maxZoom; z >= minZoom; z--) {
|
|
104393
|
+
const now = +Date.now();
|
|
104394
|
+
|
|
104395
|
+
// create a new set of clusters for the zoom and index them with a KD-tree
|
|
104396
|
+
clusters = this._cluster(clusters, z);
|
|
104397
|
+
this.trees[z] = new KDBush(clusters, getX, getY, nodeSize, Float32Array);
|
|
104398
|
+
|
|
104399
|
+
if (log) console.log('z%d: %d clusters in %dms', z, clusters.length, +Date.now() - now);
|
|
104400
|
+
}
|
|
104401
|
+
|
|
104402
|
+
if (log) console.timeEnd('total time');
|
|
104403
|
+
|
|
104404
|
+
return this;
|
|
104405
|
+
}
|
|
104406
|
+
|
|
104407
|
+
getClusters(bbox, zoom) {
|
|
104408
|
+
let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;
|
|
104409
|
+
const minLat = Math.max(-90, Math.min(90, bbox[1]));
|
|
104410
|
+
let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;
|
|
104411
|
+
const maxLat = Math.max(-90, Math.min(90, bbox[3]));
|
|
104412
|
+
|
|
104413
|
+
if (bbox[2] - bbox[0] >= 360) {
|
|
104414
|
+
minLng = -180;
|
|
104415
|
+
maxLng = 180;
|
|
104416
|
+
} else if (minLng > maxLng) {
|
|
104417
|
+
const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);
|
|
104418
|
+
const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);
|
|
104419
|
+
return easternHem.concat(westernHem);
|
|
104420
|
+
}
|
|
104421
|
+
|
|
104422
|
+
const tree = this.trees[this._limitZoom(zoom)];
|
|
104423
|
+
const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));
|
|
104424
|
+
const clusters = [];
|
|
104425
|
+
for (const id of ids) {
|
|
104426
|
+
const c = tree.points[id];
|
|
104427
|
+
clusters.push(c.numPoints ? getClusterJSON(c) : this.points[c.index]);
|
|
104428
|
+
}
|
|
104429
|
+
return clusters;
|
|
104430
|
+
}
|
|
104431
|
+
|
|
104432
|
+
getChildren(clusterId) {
|
|
104433
|
+
const originId = this._getOriginId(clusterId);
|
|
104434
|
+
const originZoom = this._getOriginZoom(clusterId);
|
|
104435
|
+
const errorMsg = 'No cluster with the specified id.';
|
|
104436
|
+
|
|
104437
|
+
const index = this.trees[originZoom];
|
|
104438
|
+
if (!index) throw new Error(errorMsg);
|
|
104439
|
+
|
|
104440
|
+
const origin = index.points[originId];
|
|
104441
|
+
if (!origin) throw new Error(errorMsg);
|
|
104442
|
+
|
|
104443
|
+
const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));
|
|
104444
|
+
const ids = index.within(origin.x, origin.y, r);
|
|
104445
|
+
const children = [];
|
|
104446
|
+
for (const id of ids) {
|
|
104447
|
+
const c = index.points[id];
|
|
104448
|
+
if (c.parentId === clusterId) {
|
|
104449
|
+
children.push(c.numPoints ? getClusterJSON(c) : this.points[c.index]);
|
|
104450
|
+
}
|
|
104451
|
+
}
|
|
104452
|
+
|
|
104453
|
+
if (children.length === 0) throw new Error(errorMsg);
|
|
104454
|
+
|
|
104455
|
+
return children;
|
|
104456
|
+
}
|
|
104457
|
+
|
|
104458
|
+
getLeaves(clusterId, limit, offset) {
|
|
104459
|
+
limit = limit || 10;
|
|
104460
|
+
offset = offset || 0;
|
|
104461
|
+
|
|
104462
|
+
const leaves = [];
|
|
104463
|
+
this._appendLeaves(leaves, clusterId, limit, offset, 0);
|
|
104464
|
+
|
|
104465
|
+
return leaves;
|
|
104466
|
+
}
|
|
104467
|
+
|
|
104468
|
+
getTile(z, x, y) {
|
|
104469
|
+
const tree = this.trees[this._limitZoom(z)];
|
|
104470
|
+
const z2 = Math.pow(2, z);
|
|
104471
|
+
const {extent, radius} = this.options;
|
|
104472
|
+
const p = radius / extent;
|
|
104473
|
+
const top = (y - p) / z2;
|
|
104474
|
+
const bottom = (y + 1 + p) / z2;
|
|
104475
|
+
|
|
104476
|
+
const tile = {
|
|
104477
|
+
features: []
|
|
104478
|
+
};
|
|
104479
|
+
|
|
104480
|
+
this._addTileFeatures(
|
|
104481
|
+
tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom),
|
|
104482
|
+
tree.points, x, y, z2, tile);
|
|
104483
|
+
|
|
104484
|
+
if (x === 0) {
|
|
104485
|
+
this._addTileFeatures(
|
|
104486
|
+
tree.range(1 - p / z2, top, 1, bottom),
|
|
104487
|
+
tree.points, z2, y, z2, tile);
|
|
104488
|
+
}
|
|
104489
|
+
if (x === z2 - 1) {
|
|
104490
|
+
this._addTileFeatures(
|
|
104491
|
+
tree.range(0, top, p / z2, bottom),
|
|
104492
|
+
tree.points, -1, y, z2, tile);
|
|
104493
|
+
}
|
|
104494
|
+
|
|
104495
|
+
return tile.features.length ? tile : null;
|
|
104496
|
+
}
|
|
104497
|
+
|
|
104498
|
+
getClusterExpansionZoom(clusterId) {
|
|
104499
|
+
let expansionZoom = this._getOriginZoom(clusterId) - 1;
|
|
104500
|
+
while (expansionZoom <= this.options.maxZoom) {
|
|
104501
|
+
const children = this.getChildren(clusterId);
|
|
104502
|
+
expansionZoom++;
|
|
104503
|
+
if (children.length !== 1) break;
|
|
104504
|
+
clusterId = children[0].properties.cluster_id;
|
|
104505
|
+
}
|
|
104506
|
+
return expansionZoom;
|
|
104507
|
+
}
|
|
104508
|
+
|
|
104509
|
+
_appendLeaves(result, clusterId, limit, offset, skipped) {
|
|
104510
|
+
const children = this.getChildren(clusterId);
|
|
104511
|
+
|
|
104512
|
+
for (const child of children) {
|
|
104513
|
+
const props = child.properties;
|
|
104514
|
+
|
|
104515
|
+
if (props && props.cluster) {
|
|
104516
|
+
if (skipped + props.point_count <= offset) {
|
|
104517
|
+
// skip the whole cluster
|
|
104518
|
+
skipped += props.point_count;
|
|
104519
|
+
} else {
|
|
104520
|
+
// enter the cluster
|
|
104521
|
+
skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped);
|
|
104522
|
+
// exit the cluster
|
|
104523
|
+
}
|
|
104524
|
+
} else if (skipped < offset) {
|
|
104525
|
+
// skip a single point
|
|
104526
|
+
skipped++;
|
|
104527
|
+
} else {
|
|
104528
|
+
// add a single point
|
|
104529
|
+
result.push(child);
|
|
104530
|
+
}
|
|
104531
|
+
if (result.length === limit) break;
|
|
104532
|
+
}
|
|
104533
|
+
|
|
104534
|
+
return skipped;
|
|
104535
|
+
}
|
|
104536
|
+
|
|
104537
|
+
_addTileFeatures(ids, points, x, y, z2, tile) {
|
|
104538
|
+
for (const i of ids) {
|
|
104539
|
+
const c = points[i];
|
|
104540
|
+
const isCluster = c.numPoints;
|
|
104541
|
+
|
|
104542
|
+
let tags, px, py;
|
|
104543
|
+
if (isCluster) {
|
|
104544
|
+
tags = getClusterProperties(c);
|
|
104545
|
+
px = c.x;
|
|
104546
|
+
py = c.y;
|
|
104547
|
+
} else {
|
|
104548
|
+
const p = this.points[c.index];
|
|
104549
|
+
tags = p.properties;
|
|
104550
|
+
px = lngX(p.geometry.coordinates[0]);
|
|
104551
|
+
py = latY(p.geometry.coordinates[1]);
|
|
104552
|
+
}
|
|
104553
|
+
|
|
104554
|
+
const f = {
|
|
104555
|
+
type: 1,
|
|
104556
|
+
geometry: [[
|
|
104557
|
+
Math.round(this.options.extent * (px * z2 - x)),
|
|
104558
|
+
Math.round(this.options.extent * (py * z2 - y))
|
|
104559
|
+
]],
|
|
104560
|
+
tags
|
|
104561
|
+
};
|
|
104562
|
+
|
|
104563
|
+
// assign id
|
|
104564
|
+
let id;
|
|
104565
|
+
if (isCluster) {
|
|
104566
|
+
id = c.id;
|
|
104567
|
+
} else if (this.options.generateId) {
|
|
104568
|
+
// optionally generate id
|
|
104569
|
+
id = c.index;
|
|
104570
|
+
} else if (this.points[c.index].id) {
|
|
104571
|
+
// keep id if already assigned
|
|
104572
|
+
id = this.points[c.index].id;
|
|
104573
|
+
}
|
|
104574
|
+
|
|
104575
|
+
if (id !== undefined) f.id = id;
|
|
104576
|
+
|
|
104577
|
+
tile.features.push(f);
|
|
104578
|
+
}
|
|
104579
|
+
}
|
|
104580
|
+
|
|
104581
|
+
_limitZoom(z) {
|
|
104582
|
+
return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));
|
|
104583
|
+
}
|
|
104584
|
+
|
|
104585
|
+
_cluster(points, zoom) {
|
|
104586
|
+
const clusters = [];
|
|
104587
|
+
const {radius, extent, reduce, minPoints} = this.options;
|
|
104588
|
+
const r = radius / (extent * Math.pow(2, zoom));
|
|
104589
|
+
|
|
104590
|
+
// loop through each point
|
|
104591
|
+
for (let i = 0; i < points.length; i++) {
|
|
104592
|
+
const p = points[i];
|
|
104593
|
+
// if we've already visited the point at this zoom level, skip it
|
|
104594
|
+
if (p.zoom <= zoom) continue;
|
|
104595
|
+
p.zoom = zoom;
|
|
104596
|
+
|
|
104597
|
+
// find all nearby points
|
|
104598
|
+
const tree = this.trees[zoom + 1];
|
|
104599
|
+
const neighborIds = tree.within(p.x, p.y, r);
|
|
104600
|
+
|
|
104601
|
+
const numPointsOrigin = p.numPoints || 1;
|
|
104602
|
+
let numPoints = numPointsOrigin;
|
|
104603
|
+
|
|
104604
|
+
// count the number of points in a potential cluster
|
|
104605
|
+
for (const neighborId of neighborIds) {
|
|
104606
|
+
const b = tree.points[neighborId];
|
|
104607
|
+
// filter out neighbors that are already processed
|
|
104608
|
+
if (b.zoom > zoom) numPoints += b.numPoints || 1;
|
|
104609
|
+
}
|
|
104610
|
+
|
|
104611
|
+
// if there were neighbors to merge, and there are enough points to form a cluster
|
|
104612
|
+
if (numPoints > numPointsOrigin && numPoints >= minPoints) {
|
|
104613
|
+
let wx = p.x * numPointsOrigin;
|
|
104614
|
+
let wy = p.y * numPointsOrigin;
|
|
104615
|
+
|
|
104616
|
+
let clusterProperties = reduce && numPointsOrigin > 1 ? this._map(p, true) : null;
|
|
104617
|
+
|
|
104618
|
+
// encode both zoom and point index on which the cluster originated -- offset by total length of features
|
|
104619
|
+
const id = (i << 5) + (zoom + 1) + this.points.length;
|
|
104620
|
+
|
|
104621
|
+
for (const neighborId of neighborIds) {
|
|
104622
|
+
const b = tree.points[neighborId];
|
|
104623
|
+
|
|
104624
|
+
if (b.zoom <= zoom) continue;
|
|
104625
|
+
b.zoom = zoom; // save the zoom (so it doesn't get processed twice)
|
|
104626
|
+
|
|
104627
|
+
const numPoints2 = b.numPoints || 1;
|
|
104628
|
+
wx += b.x * numPoints2; // accumulate coordinates for calculating weighted center
|
|
104629
|
+
wy += b.y * numPoints2;
|
|
104630
|
+
|
|
104631
|
+
b.parentId = id;
|
|
104632
|
+
|
|
104633
|
+
if (reduce) {
|
|
104634
|
+
if (!clusterProperties) clusterProperties = this._map(p, true);
|
|
104635
|
+
reduce(clusterProperties, this._map(b));
|
|
104636
|
+
}
|
|
104637
|
+
}
|
|
104638
|
+
|
|
104639
|
+
p.parentId = id;
|
|
104640
|
+
clusters.push(createCluster(wx / numPoints, wy / numPoints, id, numPoints, clusterProperties));
|
|
104641
|
+
|
|
104642
|
+
} else { // left points as unclustered
|
|
104643
|
+
clusters.push(p);
|
|
104644
|
+
|
|
104645
|
+
if (numPoints > 1) {
|
|
104646
|
+
for (const neighborId of neighborIds) {
|
|
104647
|
+
const b = tree.points[neighborId];
|
|
104648
|
+
if (b.zoom <= zoom) continue;
|
|
104649
|
+
b.zoom = zoom;
|
|
104650
|
+
clusters.push(b);
|
|
104651
|
+
}
|
|
104652
|
+
}
|
|
104653
|
+
}
|
|
104654
|
+
}
|
|
104655
|
+
|
|
104656
|
+
return clusters;
|
|
104657
|
+
}
|
|
104658
|
+
|
|
104659
|
+
// get index of the point from which the cluster originated
|
|
104660
|
+
_getOriginId(clusterId) {
|
|
104661
|
+
return (clusterId - this.points.length) >> 5;
|
|
104662
|
+
}
|
|
104663
|
+
|
|
104664
|
+
// get zoom of the point from which the cluster originated
|
|
104665
|
+
_getOriginZoom(clusterId) {
|
|
104666
|
+
return (clusterId - this.points.length) % 32;
|
|
104667
|
+
}
|
|
104668
|
+
|
|
104669
|
+
_map(point, clone) {
|
|
104670
|
+
if (point.numPoints) {
|
|
104671
|
+
return clone ? extend$1({}, point.properties) : point.properties;
|
|
104672
|
+
}
|
|
104673
|
+
const original = this.points[point.index].properties;
|
|
104674
|
+
const result = this.options.map(original);
|
|
104675
|
+
return clone && result === original ? extend$1({}, result) : result;
|
|
104676
|
+
}
|
|
104677
|
+
}
|
|
104678
|
+
|
|
104679
|
+
function createCluster(x, y, id, numPoints, properties) {
|
|
104680
|
+
return {
|
|
104681
|
+
x: fround(x), // weighted cluster center; round for consistency with Float32Array index
|
|
104682
|
+
y: fround(y),
|
|
104683
|
+
zoom: Infinity, // the last zoom the cluster was processed at
|
|
104684
|
+
id, // encodes index of the first child of the cluster and its zoom level
|
|
104685
|
+
parentId: -1, // parent cluster id
|
|
104686
|
+
numPoints,
|
|
104687
|
+
properties
|
|
104688
|
+
};
|
|
104689
|
+
}
|
|
104690
|
+
|
|
104691
|
+
function createPointCluster(p, id) {
|
|
104692
|
+
const [x, y] = p.geometry.coordinates;
|
|
104693
|
+
return {
|
|
104694
|
+
x: fround(lngX(x)), // projected point coordinates
|
|
104695
|
+
y: fround(latY(y)),
|
|
104696
|
+
zoom: Infinity, // the last zoom the point was processed at
|
|
104697
|
+
index: id, // index of the source feature in the original input array,
|
|
104698
|
+
parentId: -1 // parent cluster id
|
|
104699
|
+
};
|
|
104700
|
+
}
|
|
104701
|
+
|
|
104702
|
+
function getClusterJSON(cluster) {
|
|
104703
|
+
return {
|
|
104704
|
+
type: 'Feature',
|
|
104705
|
+
id: cluster.id,
|
|
104706
|
+
properties: getClusterProperties(cluster),
|
|
104707
|
+
geometry: {
|
|
104708
|
+
type: 'Point',
|
|
104709
|
+
coordinates: [xLng(cluster.x), yLat(cluster.y)]
|
|
104710
|
+
}
|
|
104711
|
+
};
|
|
104712
|
+
}
|
|
104713
|
+
|
|
104714
|
+
function getClusterProperties(cluster) {
|
|
104715
|
+
const count = cluster.numPoints;
|
|
104716
|
+
const abbrev =
|
|
104717
|
+
count >= 10000 ? `${Math.round(count / 1000) }k` :
|
|
104718
|
+
count >= 1000 ? `${Math.round(count / 100) / 10 }k` : count;
|
|
104719
|
+
return extend$1(extend$1({}, cluster.properties), {
|
|
104720
|
+
cluster: true,
|
|
104721
|
+
cluster_id: cluster.id,
|
|
104722
|
+
point_count: count,
|
|
104723
|
+
point_count_abbreviated: abbrev
|
|
104724
|
+
});
|
|
104725
|
+
}
|
|
104726
|
+
|
|
104727
|
+
// longitude/latitude to spherical mercator in [0..1] range
|
|
104728
|
+
function lngX(lng) {
|
|
104729
|
+
return lng / 360 + 0.5;
|
|
104730
|
+
}
|
|
104731
|
+
function latY(lat) {
|
|
104732
|
+
const sin = Math.sin(lat * Math.PI / 180);
|
|
104733
|
+
const y = (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI);
|
|
104734
|
+
return y < 0 ? 0 : y > 1 ? 1 : y;
|
|
104735
|
+
}
|
|
104736
|
+
|
|
104737
|
+
// spherical mercator to longitude/latitude
|
|
104738
|
+
function xLng(x) {
|
|
104739
|
+
return (x - 0.5) * 360;
|
|
104740
|
+
}
|
|
104741
|
+
function yLat(y) {
|
|
104742
|
+
const y2 = (180 - y * 360) * Math.PI / 180;
|
|
104743
|
+
return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;
|
|
104744
|
+
}
|
|
104745
|
+
|
|
104746
|
+
function extend$1(dest, src) {
|
|
104747
|
+
for (const id in src) dest[id] = src[id];
|
|
104748
|
+
return dest;
|
|
104749
|
+
}
|
|
104750
|
+
|
|
104751
|
+
function getX(p) {
|
|
104752
|
+
return p.x;
|
|
104753
|
+
}
|
|
104754
|
+
function getY(p) {
|
|
104755
|
+
return p.y;
|
|
104756
|
+
}
|
|
104757
|
+
|
|
104758
|
+
/*! *****************************************************************************
|
|
104759
|
+
Copyright (c) Microsoft Corporation.
|
|
104760
|
+
|
|
104761
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
104762
|
+
purpose with or without fee is hereby granted.
|
|
104763
|
+
|
|
104764
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
104765
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
104766
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
104767
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
104768
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
104769
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
104770
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
104771
|
+
***************************************************************************** */
|
|
104772
|
+
|
|
104773
|
+
function __rest(s, e) {
|
|
104774
|
+
var t = {};
|
|
104775
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
104776
|
+
t[p] = s[p];
|
|
104777
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
104778
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
104779
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
104780
|
+
t[p[i]] = s[p[i]];
|
|
104781
|
+
}
|
|
104782
|
+
return t;
|
|
104783
|
+
}
|
|
104784
|
+
|
|
104785
|
+
/**
|
|
104786
|
+
* Copyright 2021 Google LLC
|
|
104787
|
+
*
|
|
104788
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
104789
|
+
* you may not use this file except in compliance with the License.
|
|
104790
|
+
* You may obtain a copy of the License at
|
|
104791
|
+
*
|
|
104792
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
104793
|
+
*
|
|
104794
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
104795
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
104796
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104797
|
+
* See the License for the specific language governing permissions and
|
|
104798
|
+
* limitations under the License.
|
|
104799
|
+
*/
|
|
104800
|
+
class Cluster {
|
|
104801
|
+
constructor({ markers, position }) {
|
|
104802
|
+
this.markers = markers;
|
|
104803
|
+
if (position) {
|
|
104804
|
+
if (position instanceof google.maps.LatLng) {
|
|
104805
|
+
this._position = position;
|
|
104806
|
+
}
|
|
104807
|
+
else {
|
|
104808
|
+
this._position = new google.maps.LatLng(position);
|
|
104809
|
+
}
|
|
104810
|
+
}
|
|
104811
|
+
}
|
|
104812
|
+
get bounds() {
|
|
104813
|
+
if (this.markers.length === 0 && !this._position) {
|
|
104814
|
+
return undefined;
|
|
104815
|
+
}
|
|
104816
|
+
return this.markers.reduce((bounds, marker) => {
|
|
104817
|
+
return bounds.extend(marker.getPosition());
|
|
104818
|
+
}, new google.maps.LatLngBounds(this._position, this._position));
|
|
104819
|
+
}
|
|
104820
|
+
get position() {
|
|
104821
|
+
return this._position || this.bounds.getCenter();
|
|
104822
|
+
}
|
|
104823
|
+
/**
|
|
104824
|
+
* Get the count of **visible** markers.
|
|
104825
|
+
*/
|
|
104826
|
+
get count() {
|
|
104827
|
+
return this.markers.filter((m) => m.getVisible())
|
|
104828
|
+
.length;
|
|
104829
|
+
}
|
|
104830
|
+
/**
|
|
104831
|
+
* Add a marker to the cluster.
|
|
104832
|
+
*/
|
|
104833
|
+
push(marker) {
|
|
104834
|
+
this.markers.push(marker);
|
|
104835
|
+
}
|
|
104836
|
+
/**
|
|
104837
|
+
* Cleanup references and remove marker from map.
|
|
104838
|
+
*/
|
|
104839
|
+
delete() {
|
|
104840
|
+
if (this.marker) {
|
|
104841
|
+
this.marker.setMap(null);
|
|
104842
|
+
delete this.marker;
|
|
104843
|
+
}
|
|
104844
|
+
this.markers.length = 0;
|
|
104845
|
+
}
|
|
104846
|
+
}
|
|
104847
|
+
|
|
104848
|
+
/**
|
|
104849
|
+
* Copyright 2021 Google LLC
|
|
104850
|
+
*
|
|
104851
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
104852
|
+
* you may not use this file except in compliance with the License.
|
|
104853
|
+
* You may obtain a copy of the License at
|
|
104854
|
+
*
|
|
104855
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
104856
|
+
*
|
|
104857
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
104858
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
104859
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104860
|
+
* See the License for the specific language governing permissions and
|
|
104861
|
+
* limitations under the License.
|
|
104862
|
+
*/
|
|
104863
|
+
/**
|
|
104864
|
+
* @hidden
|
|
104865
|
+
*/
|
|
104866
|
+
class AbstractAlgorithm {
|
|
104867
|
+
constructor({ maxZoom = 16 }) {
|
|
104868
|
+
this.maxZoom = maxZoom;
|
|
104869
|
+
}
|
|
104870
|
+
/**
|
|
104871
|
+
* Helper function to bypass clustering based upon some map state such as
|
|
104872
|
+
* zoom, number of markers, etc.
|
|
104873
|
+
*
|
|
104874
|
+
* ```typescript
|
|
104875
|
+
* cluster({markers, map}: AlgorithmInput): Cluster[] {
|
|
104876
|
+
* if (shouldBypassClustering(map)) {
|
|
104877
|
+
* return this.noop({markers, map})
|
|
104878
|
+
* }
|
|
104879
|
+
* }
|
|
104880
|
+
* ```
|
|
104881
|
+
*/
|
|
104882
|
+
noop({ markers }) {
|
|
104883
|
+
return noop(markers);
|
|
104884
|
+
}
|
|
104885
|
+
}
|
|
104886
|
+
/**
|
|
104887
|
+
* @hidden
|
|
104888
|
+
*/
|
|
104889
|
+
const noop = (markers) => {
|
|
104890
|
+
const clusters = markers.map((marker) => new Cluster({
|
|
104891
|
+
position: marker.getPosition(),
|
|
104892
|
+
markers: [marker],
|
|
104893
|
+
}));
|
|
104894
|
+
return clusters;
|
|
104895
|
+
};
|
|
104896
|
+
|
|
104897
|
+
/**
|
|
104898
|
+
* Copyright 2021 Google LLC
|
|
104899
|
+
*
|
|
104900
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
104901
|
+
* you may not use this file except in compliance with the License.
|
|
104902
|
+
* You may obtain a copy of the License at
|
|
104903
|
+
*
|
|
104904
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
104905
|
+
*
|
|
104906
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
104907
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
104908
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104909
|
+
* See the License for the specific language governing permissions and
|
|
104910
|
+
* limitations under the License.
|
|
104911
|
+
*/
|
|
104912
|
+
/**
|
|
104913
|
+
* A very fast JavaScript algorithm for geospatial point clustering using KD trees.
|
|
104914
|
+
*
|
|
104915
|
+
* @see https://www.npmjs.com/package/supercluster for more information on options.
|
|
104916
|
+
*/
|
|
104917
|
+
class SuperClusterAlgorithm extends AbstractAlgorithm {
|
|
104918
|
+
constructor(_a) {
|
|
104919
|
+
var { maxZoom, radius = 60 } = _a, options = __rest(_a, ["maxZoom", "radius"]);
|
|
104920
|
+
super({ maxZoom });
|
|
104921
|
+
this.superCluster = new Supercluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));
|
|
104922
|
+
this.state = { zoom: null };
|
|
104923
|
+
}
|
|
104924
|
+
calculate(input) {
|
|
104925
|
+
let changed = false;
|
|
104926
|
+
if (!fastDeepEqual$1(input.markers, this.markers)) {
|
|
104927
|
+
changed = true;
|
|
104928
|
+
// TODO use proxy to avoid copy?
|
|
104929
|
+
this.markers = [...input.markers];
|
|
104930
|
+
const points = this.markers.map((marker) => {
|
|
104931
|
+
return {
|
|
104932
|
+
type: "Feature",
|
|
104933
|
+
geometry: {
|
|
104934
|
+
type: "Point",
|
|
104935
|
+
coordinates: [
|
|
104936
|
+
marker.getPosition().lng(),
|
|
104937
|
+
marker.getPosition().lat(),
|
|
104938
|
+
],
|
|
104939
|
+
},
|
|
104940
|
+
properties: { marker },
|
|
104941
|
+
};
|
|
104942
|
+
});
|
|
104943
|
+
this.superCluster.load(points);
|
|
104944
|
+
}
|
|
104945
|
+
const state = { zoom: input.map.getZoom() };
|
|
104946
|
+
if (!changed) {
|
|
104947
|
+
if (this.state.zoom > this.maxZoom && state.zoom > this.maxZoom) ;
|
|
104948
|
+
else {
|
|
104949
|
+
changed = changed || !fastDeepEqual$1(this.state, state);
|
|
104950
|
+
}
|
|
104951
|
+
}
|
|
104952
|
+
this.state = state;
|
|
104953
|
+
if (changed) {
|
|
104954
|
+
this.clusters = this.cluster(input);
|
|
104955
|
+
}
|
|
104956
|
+
return { clusters: this.clusters, changed };
|
|
104957
|
+
}
|
|
104958
|
+
cluster({ map }) {
|
|
104959
|
+
return this.superCluster
|
|
104960
|
+
.getClusters([-180, -90, 180, 90], Math.round(map.getZoom()))
|
|
104961
|
+
.map(this.transformCluster.bind(this));
|
|
104962
|
+
}
|
|
104963
|
+
transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) {
|
|
104964
|
+
if (properties.cluster) {
|
|
104965
|
+
return new Cluster({
|
|
104966
|
+
markers: this.superCluster
|
|
104967
|
+
.getLeaves(properties.cluster_id, Infinity)
|
|
104968
|
+
.map((leaf) => leaf.properties.marker),
|
|
104969
|
+
position: new google.maps.LatLng({ lat, lng }),
|
|
104970
|
+
});
|
|
104971
|
+
}
|
|
104972
|
+
else {
|
|
104973
|
+
const marker = properties.marker;
|
|
104974
|
+
return new Cluster({
|
|
104975
|
+
markers: [marker],
|
|
104976
|
+
position: marker.getPosition(),
|
|
104977
|
+
});
|
|
104978
|
+
}
|
|
104979
|
+
}
|
|
104980
|
+
}
|
|
104981
|
+
|
|
104982
|
+
/**
|
|
104983
|
+
* Copyright 2021 Google LLC
|
|
104984
|
+
*
|
|
104985
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
104986
|
+
* you may not use this file except in compliance with the License.
|
|
104987
|
+
* You may obtain a copy of the License at
|
|
104988
|
+
*
|
|
104989
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
104990
|
+
*
|
|
104991
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
104992
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
104993
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104994
|
+
* See the License for the specific language governing permissions and
|
|
104995
|
+
* limitations under the License.
|
|
104996
|
+
*/
|
|
104997
|
+
/**
|
|
104998
|
+
* Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}.
|
|
104999
|
+
*/
|
|
105000
|
+
class ClusterStats {
|
|
105001
|
+
constructor(markers, clusters) {
|
|
105002
|
+
this.markers = { sum: markers.length };
|
|
105003
|
+
const clusterMarkerCounts = clusters.map((a) => a.count);
|
|
105004
|
+
const clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0);
|
|
105005
|
+
this.clusters = {
|
|
105006
|
+
count: clusters.length,
|
|
105007
|
+
markers: {
|
|
105008
|
+
mean: clusterMarkerSum / clusters.length,
|
|
105009
|
+
sum: clusterMarkerSum,
|
|
105010
|
+
min: Math.min(...clusterMarkerCounts),
|
|
105011
|
+
max: Math.max(...clusterMarkerCounts),
|
|
105012
|
+
},
|
|
105013
|
+
};
|
|
105014
|
+
}
|
|
105015
|
+
}
|
|
105016
|
+
class DefaultRenderer {
|
|
105017
|
+
/**
|
|
105018
|
+
* The default render function for the library used by {@link MarkerClusterer}.
|
|
105019
|
+
*
|
|
105020
|
+
* Currently set to use the following:
|
|
105021
|
+
*
|
|
105022
|
+
* ```typescript
|
|
105023
|
+
* // change color if this cluster has more markers than the mean cluster
|
|
105024
|
+
* const color =
|
|
105025
|
+
* count > Math.max(10, stats.clusters.markers.mean)
|
|
105026
|
+
* ? "#ff0000"
|
|
105027
|
+
* : "#0000ff";
|
|
105028
|
+
*
|
|
105029
|
+
* // create svg url with fill color
|
|
105030
|
+
* const svg = window.btoa(`
|
|
105031
|
+
* <svg fill="${color}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
|
|
105032
|
+
* <circle cx="120" cy="120" opacity=".6" r="70" />
|
|
105033
|
+
* <circle cx="120" cy="120" opacity=".3" r="90" />
|
|
105034
|
+
* <circle cx="120" cy="120" opacity=".2" r="110" />
|
|
105035
|
+
* <circle cx="120" cy="120" opacity=".1" r="130" />
|
|
105036
|
+
* </svg>`);
|
|
105037
|
+
*
|
|
105038
|
+
* // create marker using svg icon
|
|
105039
|
+
* return new google.maps.Marker({
|
|
105040
|
+
* position,
|
|
105041
|
+
* icon: {
|
|
105042
|
+
* url: `data:image/svg+xml;base64,${svg}`,
|
|
105043
|
+
* scaledSize: new google.maps.Size(45, 45),
|
|
105044
|
+
* },
|
|
105045
|
+
* label: {
|
|
105046
|
+
* text: String(count),
|
|
105047
|
+
* color: "rgba(255,255,255,0.9)",
|
|
105048
|
+
* fontSize: "12px",
|
|
105049
|
+
* },
|
|
105050
|
+
* // adjust zIndex to be above other markers
|
|
105051
|
+
* zIndex: 1000 + count,
|
|
105052
|
+
* });
|
|
105053
|
+
* ```
|
|
105054
|
+
*/
|
|
105055
|
+
render({ count, position }, stats) {
|
|
105056
|
+
// change color if this cluster has more markers than the mean cluster
|
|
105057
|
+
const color = count > Math.max(10, stats.clusters.markers.mean) ? "#ff0000" : "#0000ff";
|
|
105058
|
+
// create svg url with fill color
|
|
105059
|
+
const svg = window.btoa(`
|
|
105060
|
+
<svg fill="${color}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
|
|
105061
|
+
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
105062
|
+
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
105063
|
+
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
105064
|
+
</svg>`);
|
|
105065
|
+
// create marker using svg icon
|
|
105066
|
+
return new google.maps.Marker({
|
|
105067
|
+
position,
|
|
105068
|
+
icon: {
|
|
105069
|
+
url: `data:image/svg+xml;base64,${svg}`,
|
|
105070
|
+
scaledSize: new google.maps.Size(45, 45),
|
|
105071
|
+
},
|
|
105072
|
+
label: {
|
|
105073
|
+
text: String(count),
|
|
105074
|
+
color: "rgba(255,255,255,0.9)",
|
|
105075
|
+
fontSize: "12px",
|
|
105076
|
+
},
|
|
105077
|
+
title: `Cluster of ${count} markers`,
|
|
105078
|
+
// adjust zIndex to be above other markers
|
|
105079
|
+
zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count,
|
|
105080
|
+
});
|
|
105081
|
+
}
|
|
105082
|
+
}
|
|
105083
|
+
|
|
105084
|
+
/**
|
|
105085
|
+
* Copyright 2019 Google LLC. All Rights Reserved.
|
|
105086
|
+
*
|
|
105087
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
105088
|
+
* you may not use this file except in compliance with the License.
|
|
105089
|
+
* You may obtain a copy of the License at
|
|
105090
|
+
*
|
|
105091
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
105092
|
+
*
|
|
105093
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
105094
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
105095
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
105096
|
+
* See the License for the specific language governing permissions and
|
|
105097
|
+
* limitations under the License.
|
|
105098
|
+
*/
|
|
105099
|
+
/**
|
|
105100
|
+
* Extends an object's prototype by another's.
|
|
105101
|
+
*
|
|
105102
|
+
* @param type1 The Type to be extended.
|
|
105103
|
+
* @param type2 The Type to extend with.
|
|
105104
|
+
* @ignore
|
|
105105
|
+
*/
|
|
105106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105107
|
+
function extend(type1, type2) {
|
|
105108
|
+
/* istanbul ignore next */
|
|
105109
|
+
// eslint-disable-next-line prefer-const
|
|
105110
|
+
for (let property in type2.prototype) {
|
|
105111
|
+
type1.prototype[property] = type2.prototype[property];
|
|
105112
|
+
}
|
|
105113
|
+
}
|
|
105114
|
+
/**
|
|
105115
|
+
* @ignore
|
|
105116
|
+
*/
|
|
105117
|
+
class OverlayViewSafe {
|
|
105118
|
+
constructor() {
|
|
105119
|
+
// MarkerClusterer implements google.maps.OverlayView interface. We use the
|
|
105120
|
+
// extend function to extend MarkerClusterer with google.maps.OverlayView
|
|
105121
|
+
// because it might not always be available when the code is defined so we
|
|
105122
|
+
// look for it at the last possible moment. If it doesn't exist now then
|
|
105123
|
+
// there is no point going ahead :)
|
|
105124
|
+
extend(OverlayViewSafe, google.maps.OverlayView);
|
|
105125
|
+
}
|
|
105126
|
+
}
|
|
105127
|
+
|
|
105128
|
+
/**
|
|
105129
|
+
* Copyright 2021 Google LLC
|
|
105130
|
+
*
|
|
105131
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
105132
|
+
* you may not use this file except in compliance with the License.
|
|
105133
|
+
* You may obtain a copy of the License at
|
|
105134
|
+
*
|
|
105135
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
105136
|
+
*
|
|
105137
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
105138
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
105139
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
105140
|
+
* See the License for the specific language governing permissions and
|
|
105141
|
+
* limitations under the License.
|
|
105142
|
+
*/
|
|
105143
|
+
var MarkerClustererEvents;
|
|
105144
|
+
(function (MarkerClustererEvents) {
|
|
105145
|
+
MarkerClustererEvents["CLUSTERING_BEGIN"] = "clusteringbegin";
|
|
105146
|
+
MarkerClustererEvents["CLUSTERING_END"] = "clusteringend";
|
|
105147
|
+
MarkerClustererEvents["CLUSTER_CLICK"] = "click";
|
|
105148
|
+
})(MarkerClustererEvents || (MarkerClustererEvents = {}));
|
|
105149
|
+
const defaultOnClusterClickHandler = (_, cluster, map) => {
|
|
105150
|
+
map.fitBounds(cluster.bounds);
|
|
105151
|
+
};
|
|
105152
|
+
/**
|
|
105153
|
+
* MarkerClusterer creates and manages per-zoom-level clusters for large amounts
|
|
105154
|
+
* of markers. See {@link MarkerClustererOptions} for more details.
|
|
105155
|
+
*
|
|
105156
|
+
*/
|
|
105157
|
+
class MarkerClusterer extends OverlayViewSafe {
|
|
105158
|
+
constructor({ map, markers = [], algorithm = new SuperClusterAlgorithm({}), renderer = new DefaultRenderer(), onClusterClick = defaultOnClusterClickHandler, }) {
|
|
105159
|
+
super();
|
|
105160
|
+
this.markers = [...markers];
|
|
105161
|
+
this.clusters = [];
|
|
105162
|
+
this.algorithm = algorithm;
|
|
105163
|
+
this.renderer = renderer;
|
|
105164
|
+
this.onClusterClick = onClusterClick;
|
|
105165
|
+
if (map) {
|
|
105166
|
+
this.setMap(map);
|
|
105167
|
+
}
|
|
105168
|
+
}
|
|
105169
|
+
addMarker(marker, noDraw) {
|
|
105170
|
+
if (this.markers.includes(marker)) {
|
|
105171
|
+
return;
|
|
105172
|
+
}
|
|
105173
|
+
this.markers.push(marker);
|
|
105174
|
+
if (!noDraw) {
|
|
105175
|
+
this.render();
|
|
105176
|
+
}
|
|
105177
|
+
}
|
|
105178
|
+
addMarkers(markers, noDraw) {
|
|
105179
|
+
markers.forEach((marker) => {
|
|
105180
|
+
this.addMarker(marker, true);
|
|
105181
|
+
});
|
|
105182
|
+
if (!noDraw) {
|
|
105183
|
+
this.render();
|
|
105184
|
+
}
|
|
105185
|
+
}
|
|
105186
|
+
removeMarker(marker, noDraw) {
|
|
105187
|
+
const index = this.markers.indexOf(marker);
|
|
105188
|
+
if (index === -1) {
|
|
105189
|
+
// Marker is not in our list of markers, so do nothing:
|
|
105190
|
+
return false;
|
|
105191
|
+
}
|
|
105192
|
+
marker.setMap(null);
|
|
105193
|
+
this.markers.splice(index, 1); // Remove the marker from the list of managed markers
|
|
105194
|
+
if (!noDraw) {
|
|
105195
|
+
this.render();
|
|
105196
|
+
}
|
|
105197
|
+
return true;
|
|
105198
|
+
}
|
|
105199
|
+
removeMarkers(markers, noDraw) {
|
|
105200
|
+
let removed = false;
|
|
105201
|
+
markers.forEach((marker) => {
|
|
105202
|
+
removed = this.removeMarker(marker, true) || removed;
|
|
105203
|
+
});
|
|
105204
|
+
if (removed && !noDraw) {
|
|
105205
|
+
this.render();
|
|
105206
|
+
}
|
|
105207
|
+
return removed;
|
|
105208
|
+
}
|
|
105209
|
+
clearMarkers(noDraw) {
|
|
105210
|
+
this.markers.length = 0;
|
|
105211
|
+
if (!noDraw) {
|
|
105212
|
+
this.render();
|
|
105213
|
+
}
|
|
105214
|
+
}
|
|
105215
|
+
/**
|
|
105216
|
+
* Recalculates and draws all the marker clusters.
|
|
105217
|
+
*/
|
|
105218
|
+
render() {
|
|
105219
|
+
const map = this.getMap();
|
|
105220
|
+
if (map instanceof google.maps.Map && this.getProjection()) {
|
|
105221
|
+
google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);
|
|
105222
|
+
const { clusters, changed } = this.algorithm.calculate({
|
|
105223
|
+
markers: this.markers,
|
|
105224
|
+
map,
|
|
105225
|
+
mapCanvasProjection: this.getProjection(),
|
|
105226
|
+
});
|
|
105227
|
+
// allow algorithms to return flag on whether the clusters/markers have changed
|
|
105228
|
+
if (changed || changed == undefined) {
|
|
105229
|
+
// reset visibility of markers and clusters
|
|
105230
|
+
this.reset();
|
|
105231
|
+
// store new clusters
|
|
105232
|
+
this.clusters = clusters;
|
|
105233
|
+
this.renderClusters();
|
|
105234
|
+
}
|
|
105235
|
+
google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);
|
|
105236
|
+
}
|
|
105237
|
+
}
|
|
105238
|
+
onAdd() {
|
|
105239
|
+
this.idleListener = this.getMap().addListener("idle", this.render.bind(this));
|
|
105240
|
+
this.render();
|
|
105241
|
+
}
|
|
105242
|
+
onRemove() {
|
|
105243
|
+
google.maps.event.removeListener(this.idleListener);
|
|
105244
|
+
this.reset();
|
|
105245
|
+
}
|
|
105246
|
+
reset() {
|
|
105247
|
+
this.markers.forEach((marker) => marker.setMap(null));
|
|
105248
|
+
this.clusters.forEach((cluster) => cluster.delete());
|
|
105249
|
+
this.clusters = [];
|
|
105250
|
+
}
|
|
105251
|
+
renderClusters() {
|
|
105252
|
+
// generate stats to pass to renderers
|
|
105253
|
+
const stats = new ClusterStats(this.markers, this.clusters);
|
|
105254
|
+
const map = this.getMap();
|
|
105255
|
+
this.clusters.forEach((cluster) => {
|
|
105256
|
+
if (cluster.markers.length === 1) {
|
|
105257
|
+
cluster.marker = cluster.markers[0];
|
|
105258
|
+
}
|
|
105259
|
+
else {
|
|
105260
|
+
cluster.marker = this.renderer.render(cluster, stats);
|
|
105261
|
+
if (this.onClusterClick) {
|
|
105262
|
+
cluster.marker.addListener("click",
|
|
105263
|
+
/* istanbul ignore next */
|
|
105264
|
+
(event) => {
|
|
105265
|
+
google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster);
|
|
105266
|
+
this.onClusterClick(event, cluster, map);
|
|
105267
|
+
});
|
|
105268
|
+
}
|
|
105269
|
+
}
|
|
105270
|
+
cluster.marker.setMap(map);
|
|
105271
|
+
});
|
|
105272
|
+
}
|
|
105273
|
+
}
|
|
105274
|
+
|
|
105275
|
+
/**
|
|
105276
|
+
* Default equality comparator pass-through, used as the standard `isEqual` creator for
|
|
105277
|
+
* use inside the built comparator.
|
|
105278
|
+
*/
|
|
105279
|
+
function createDefaultIsNestedEqual(comparator) {
|
|
105280
|
+
return function isEqual(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, meta) {
|
|
105281
|
+
return comparator(a, b, meta);
|
|
105282
|
+
};
|
|
105283
|
+
}
|
|
105284
|
+
/**
|
|
105285
|
+
* Wrap the provided `areItemsEqual` method to manage the circular cache, allowing
|
|
105286
|
+
* for circular references to be safely included in the comparison without creating
|
|
105287
|
+
* stack overflows.
|
|
105288
|
+
*/
|
|
105289
|
+
function createIsCircular(areItemsEqual) {
|
|
105290
|
+
return function isCircular(a, b, isEqual, cache) {
|
|
105291
|
+
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
|
|
105292
|
+
return areItemsEqual(a, b, isEqual, cache);
|
|
105293
|
+
}
|
|
105294
|
+
var cachedA = cache.get(a);
|
|
105295
|
+
var cachedB = cache.get(b);
|
|
105296
|
+
if (cachedA && cachedB) {
|
|
105297
|
+
return cachedA === b && cachedB === a;
|
|
105298
|
+
}
|
|
105299
|
+
cache.set(a, b);
|
|
105300
|
+
cache.set(b, a);
|
|
105301
|
+
var result = areItemsEqual(a, b, isEqual, cache);
|
|
105302
|
+
cache.delete(a);
|
|
105303
|
+
cache.delete(b);
|
|
105304
|
+
return result;
|
|
105305
|
+
};
|
|
105306
|
+
}
|
|
105307
|
+
/**
|
|
105308
|
+
* Targeted shallow merge of two objects.
|
|
105309
|
+
*
|
|
105310
|
+
* @NOTE
|
|
105311
|
+
* This exists as a tinier compiled version of the `__assign` helper that
|
|
105312
|
+
* `tsc` injects in case of `Object.assign` not being present.
|
|
105313
|
+
*/
|
|
105314
|
+
function merge(a, b) {
|
|
105315
|
+
var merged = {};
|
|
105316
|
+
for (var key in a) {
|
|
105317
|
+
merged[key] = a[key];
|
|
105318
|
+
}
|
|
105319
|
+
for (var key in b) {
|
|
105320
|
+
merged[key] = b[key];
|
|
105321
|
+
}
|
|
105322
|
+
return merged;
|
|
105323
|
+
}
|
|
105324
|
+
/**
|
|
105325
|
+
* Whether the value is a plain object.
|
|
105326
|
+
*
|
|
105327
|
+
* @NOTE
|
|
105328
|
+
* This is a same-realm compariosn only.
|
|
105329
|
+
*/
|
|
105330
|
+
function isPlainObject(value) {
|
|
105331
|
+
return value.constructor === Object || value.constructor == null;
|
|
105332
|
+
}
|
|
105333
|
+
/**
|
|
105334
|
+
* When the value is `Promise`-like, aka "then-able".
|
|
105335
|
+
*/
|
|
105336
|
+
function isPromiseLike(value) {
|
|
105337
|
+
return typeof value.then === 'function';
|
|
105338
|
+
}
|
|
105339
|
+
/**
|
|
105340
|
+
* Whether the values passed are strictly equal or both NaN.
|
|
105341
|
+
*/
|
|
105342
|
+
function sameValueZeroEqual(a, b) {
|
|
105343
|
+
return a === b || (a !== a && b !== b);
|
|
105344
|
+
}
|
|
105345
|
+
|
|
105346
|
+
var ARGUMENTS_TAG = '[object Arguments]';
|
|
105347
|
+
var BOOLEAN_TAG = '[object Boolean]';
|
|
105348
|
+
var DATE_TAG = '[object Date]';
|
|
105349
|
+
var REG_EXP_TAG = '[object RegExp]';
|
|
105350
|
+
var MAP_TAG = '[object Map]';
|
|
105351
|
+
var NUMBER_TAG = '[object Number]';
|
|
105352
|
+
var OBJECT_TAG = '[object Object]';
|
|
105353
|
+
var SET_TAG = '[object Set]';
|
|
105354
|
+
var STRING_TAG = '[object String]';
|
|
105355
|
+
var toString = Object.prototype.toString;
|
|
105356
|
+
function createComparator(_a) {
|
|
105357
|
+
var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areMapsEqual = _a.areMapsEqual, areObjectsEqual = _a.areObjectsEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, createIsNestedEqual = _a.createIsNestedEqual;
|
|
105358
|
+
var isEqual = createIsNestedEqual(comparator);
|
|
105359
|
+
/**
|
|
105360
|
+
* compare the value of the two objects and return true if they are equivalent in values
|
|
105361
|
+
*/
|
|
105362
|
+
function comparator(a, b, meta) {
|
|
105363
|
+
// If the items are strictly equal, no need to do a value comparison.
|
|
105364
|
+
if (a === b) {
|
|
105365
|
+
return true;
|
|
105366
|
+
}
|
|
105367
|
+
// If the items are not non-nullish objects, then the only possibility
|
|
105368
|
+
// of them being equal but not strictly is if they are both `NaN`. Since
|
|
105369
|
+
// `NaN` is uniquely not equal to itself, we can use self-comparison of
|
|
105370
|
+
// both objects, which is faster than `isNaN()`.
|
|
105371
|
+
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
|
|
105372
|
+
return a !== a && b !== b;
|
|
105373
|
+
}
|
|
105374
|
+
// Checks are listed in order of commonality of use-case:
|
|
105375
|
+
// 1. Common complex object types (plain object, array)
|
|
105376
|
+
// 2. Common data values (date, regexp)
|
|
105377
|
+
// 3. Less-common complex object types (map, set)
|
|
105378
|
+
// 4. Less-common data values (promise, primitive wrappers)
|
|
105379
|
+
// Inherently this is both subjective and assumptive, however
|
|
105380
|
+
// when reviewing comparable libraries in the wild this order
|
|
105381
|
+
// appears to be generally consistent.
|
|
105382
|
+
// `isPlainObject` only checks against the object's own realm. Cross-realm
|
|
105383
|
+
// comparisons are rare, and will be handled in the ultimate fallback, so
|
|
105384
|
+
// we can avoid the `toString.call()` cost unless necessary.
|
|
105385
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
105386
|
+
return areObjectsEqual(a, b, isEqual, meta);
|
|
105387
|
+
}
|
|
105388
|
+
// `isArray()` works on subclasses and is cross-realm, so we can again avoid
|
|
105389
|
+
// the `toString.call()` cost unless necessary by just checking if either
|
|
105390
|
+
// and then both are arrays.
|
|
105391
|
+
var aArray = Array.isArray(a);
|
|
105392
|
+
var bArray = Array.isArray(b);
|
|
105393
|
+
if (aArray || bArray) {
|
|
105394
|
+
return aArray === bArray && areArraysEqual(a, b, isEqual, meta);
|
|
105395
|
+
}
|
|
105396
|
+
// Since this is a custom object, use the classic `toString.call()` to get its
|
|
105397
|
+
// type. This is reasonably performant in modern environments like v8 and
|
|
105398
|
+
// SpiderMonkey, and allows for cross-realm comparison when other checks like
|
|
105399
|
+
// `instanceof` do not.
|
|
105400
|
+
var aTag = toString.call(a);
|
|
105401
|
+
if (aTag !== toString.call(b)) {
|
|
105402
|
+
return false;
|
|
105403
|
+
}
|
|
105404
|
+
if (aTag === DATE_TAG) {
|
|
105405
|
+
// `getTime()` showed better results compared to alternatives like `valueOf()`
|
|
105406
|
+
// or the unary `+` operator.
|
|
105407
|
+
return areDatesEqual(a, b, isEqual, meta);
|
|
105408
|
+
}
|
|
105409
|
+
if (aTag === REG_EXP_TAG) {
|
|
105410
|
+
return areRegExpsEqual(a, b, isEqual, meta);
|
|
105411
|
+
}
|
|
105412
|
+
if (aTag === MAP_TAG) {
|
|
105413
|
+
return areMapsEqual(a, b, isEqual, meta);
|
|
105414
|
+
}
|
|
105415
|
+
if (aTag === SET_TAG) {
|
|
105416
|
+
return areSetsEqual(a, b, isEqual, meta);
|
|
105417
|
+
}
|
|
105418
|
+
// If a simple object tag, then we can prioritize a simple object comparison because
|
|
105419
|
+
// it is likely a custom class. If an arguments tag, it should be treated as a standard
|
|
105420
|
+
// object.
|
|
105421
|
+
if (aTag === OBJECT_TAG || aTag === ARGUMENTS_TAG) {
|
|
105422
|
+
// The exception for value comparison is `Promise`-like contracts. These should be
|
|
105423
|
+
// treated the same as standard `Promise` objects, which means strict equality.
|
|
105424
|
+
return isPromiseLike(a) || isPromiseLike(b)
|
|
105425
|
+
? false
|
|
105426
|
+
: areObjectsEqual(a, b, isEqual, meta);
|
|
105427
|
+
}
|
|
105428
|
+
// As the penultimate fallback, check if the values passed are primitive wrappers. This
|
|
105429
|
+
// is very rare in modern JS, which is why it is deprioritized compared to all other object
|
|
105430
|
+
// types.
|
|
105431
|
+
if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {
|
|
105432
|
+
return sameValueZeroEqual(a.valueOf(), b.valueOf());
|
|
105433
|
+
}
|
|
105434
|
+
// If not matching any tags that require a specific type of comparison, then we hard-code false because
|
|
105435
|
+
// the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
|
|
105436
|
+
// - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
|
|
105437
|
+
// comparison that can be made.
|
|
105438
|
+
// - For types that can be introspected, but rarely have requirements to be compared
|
|
105439
|
+
// (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
|
|
105440
|
+
// use-cases (may be included in a future release, if requested enough).
|
|
105441
|
+
// - For types that can be introspected but do not have an objective definition of what
|
|
105442
|
+
// equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
|
|
105443
|
+
// In all cases, these decisions should be reevaluated based on changes to the language and
|
|
105444
|
+
// common development practices.
|
|
105445
|
+
return false;
|
|
105446
|
+
}
|
|
105447
|
+
return comparator;
|
|
105448
|
+
}
|
|
105449
|
+
|
|
105450
|
+
/**
|
|
105451
|
+
* Whether the arrays are equal in value.
|
|
105452
|
+
*/
|
|
105453
|
+
function areArraysEqual(a, b, isEqual, meta) {
|
|
105454
|
+
var index = a.length;
|
|
105455
|
+
if (b.length !== index) {
|
|
105456
|
+
return false;
|
|
105457
|
+
}
|
|
105458
|
+
// Decrementing `while` showed faster results than either incrementing or
|
|
105459
|
+
// decrementing `for` loop and than an incrementing `while` loop. Declarative
|
|
105460
|
+
// methods like `some` / `every` were not used to avoid incurring the garbage
|
|
105461
|
+
// cost of anonymous callbacks.
|
|
105462
|
+
while (index-- > 0) {
|
|
105463
|
+
if (!isEqual(a[index], b[index], index, index, a, b, meta)) {
|
|
105464
|
+
return false;
|
|
105465
|
+
}
|
|
105466
|
+
}
|
|
105467
|
+
return true;
|
|
105468
|
+
}
|
|
105469
|
+
/**
|
|
105470
|
+
* Whether the arrays are equal in value, including circular references.
|
|
105471
|
+
*/
|
|
105472
|
+
var areArraysEqualCircular = createIsCircular(areArraysEqual);
|
|
105473
|
+
|
|
105474
|
+
/**
|
|
105475
|
+
* Whether the dates passed are equal in value.
|
|
105476
|
+
*
|
|
105477
|
+
* @NOTE
|
|
105478
|
+
* This is a standalone function instead of done inline in the comparator
|
|
105479
|
+
* to allow for overrides.
|
|
105480
|
+
*/
|
|
105481
|
+
function areDatesEqual(a, b) {
|
|
105482
|
+
return sameValueZeroEqual(a.valueOf(), b.valueOf());
|
|
105483
|
+
}
|
|
105484
|
+
|
|
105485
|
+
/**
|
|
105486
|
+
* Whether the `Map`s are equal in value.
|
|
105487
|
+
*/
|
|
105488
|
+
function areMapsEqual(a, b, isEqual, meta) {
|
|
105489
|
+
var isValueEqual = a.size === b.size;
|
|
105490
|
+
if (!isValueEqual) {
|
|
105491
|
+
return false;
|
|
105492
|
+
}
|
|
105493
|
+
if (!a.size) {
|
|
105494
|
+
return true;
|
|
105495
|
+
}
|
|
105496
|
+
// The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and
|
|
105497
|
+
// the inability to control the performance of the resulting code. It also avoids excessive
|
|
105498
|
+
// iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,
|
|
105499
|
+
// we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the
|
|
105500
|
+
// equality checks themselves.
|
|
105501
|
+
var matchedIndices = {};
|
|
105502
|
+
var indexA = 0;
|
|
105503
|
+
a.forEach(function (aValue, aKey) {
|
|
105504
|
+
if (!isValueEqual) {
|
|
105505
|
+
return;
|
|
105506
|
+
}
|
|
105507
|
+
var hasMatch = false;
|
|
105508
|
+
var matchIndexB = 0;
|
|
105509
|
+
b.forEach(function (bValue, bKey) {
|
|
105510
|
+
if (!hasMatch &&
|
|
105511
|
+
!matchedIndices[matchIndexB] &&
|
|
105512
|
+
(hasMatch =
|
|
105513
|
+
isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&
|
|
105514
|
+
isEqual(aValue, bValue, aKey, bKey, a, b, meta))) {
|
|
105515
|
+
matchedIndices[matchIndexB] = true;
|
|
105516
|
+
}
|
|
105517
|
+
matchIndexB++;
|
|
105518
|
+
});
|
|
105519
|
+
indexA++;
|
|
105520
|
+
isValueEqual = hasMatch;
|
|
105521
|
+
});
|
|
105522
|
+
return isValueEqual;
|
|
105523
|
+
}
|
|
105524
|
+
/**
|
|
105525
|
+
* Whether the `Map`s are equal in value, including circular references.
|
|
105526
|
+
*/
|
|
105527
|
+
var areMapsEqualCircular = createIsCircular(areMapsEqual);
|
|
105528
|
+
|
|
105529
|
+
var OWNER = '_owner';
|
|
105530
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
105531
|
+
/**
|
|
105532
|
+
* Whether the objects are equal in value.
|
|
105533
|
+
*/
|
|
105534
|
+
function areObjectsEqual(a, b, isEqual, meta) {
|
|
105535
|
+
var keysA = Object.keys(a);
|
|
105536
|
+
var index = keysA.length;
|
|
105537
|
+
if (Object.keys(b).length !== index) {
|
|
105538
|
+
return false;
|
|
105539
|
+
}
|
|
105540
|
+
var key;
|
|
105541
|
+
// Decrementing `while` showed faster results than either incrementing or
|
|
105542
|
+
// decrementing `for` loop and than an incrementing `while` loop. Declarative
|
|
105543
|
+
// methods like `some` / `every` were not used to avoid incurring the garbage
|
|
105544
|
+
// cost of anonymous callbacks.
|
|
105545
|
+
while (index-- > 0) {
|
|
105546
|
+
key = keysA[index];
|
|
105547
|
+
if (key === OWNER) {
|
|
105548
|
+
var reactElementA = !!a.$$typeof;
|
|
105549
|
+
var reactElementB = !!b.$$typeof;
|
|
105550
|
+
if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {
|
|
105551
|
+
return false;
|
|
105552
|
+
}
|
|
105553
|
+
}
|
|
105554
|
+
if (!hasOwnProperty.call(b, key) ||
|
|
105555
|
+
!isEqual(a[key], b[key], key, key, a, b, meta)) {
|
|
105556
|
+
return false;
|
|
105557
|
+
}
|
|
105558
|
+
}
|
|
105559
|
+
return true;
|
|
105560
|
+
}
|
|
105561
|
+
/**
|
|
105562
|
+
* Whether the objects are equal in value, including circular references.
|
|
105563
|
+
*/
|
|
105564
|
+
var areObjectsEqualCircular = createIsCircular(areObjectsEqual);
|
|
105565
|
+
|
|
105566
|
+
/**
|
|
105567
|
+
* Whether the regexps passed are equal in value.
|
|
105568
|
+
*
|
|
105569
|
+
* @NOTE
|
|
105570
|
+
* This is a standalone function instead of done inline in the comparator
|
|
105571
|
+
* to allow for overrides. An example of this would be supporting a
|
|
105572
|
+
* pre-ES2015 environment where the `flags` property is not available.
|
|
105573
|
+
*/
|
|
105574
|
+
function areRegExpsEqual(a, b) {
|
|
105575
|
+
return a.source === b.source && a.flags === b.flags;
|
|
105576
|
+
}
|
|
105577
|
+
|
|
105578
|
+
/**
|
|
105579
|
+
* Whether the `Set`s are equal in value.
|
|
105580
|
+
*/
|
|
105581
|
+
function areSetsEqual(a, b, isEqual, meta) {
|
|
105582
|
+
var isValueEqual = a.size === b.size;
|
|
105583
|
+
if (!isValueEqual) {
|
|
105584
|
+
return false;
|
|
105585
|
+
}
|
|
105586
|
+
if (!a.size) {
|
|
105587
|
+
return true;
|
|
105588
|
+
}
|
|
105589
|
+
// The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and
|
|
105590
|
+
// the inability to control the performance of the resulting code. It also avoids excessive
|
|
105591
|
+
// iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,
|
|
105592
|
+
// we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the
|
|
105593
|
+
// equality checks themselves.
|
|
105594
|
+
var matchedIndices = {};
|
|
105595
|
+
a.forEach(function (aValue, aKey) {
|
|
105596
|
+
if (!isValueEqual) {
|
|
105597
|
+
return;
|
|
105598
|
+
}
|
|
105599
|
+
var hasMatch = false;
|
|
105600
|
+
var matchIndex = 0;
|
|
105601
|
+
b.forEach(function (bValue, bKey) {
|
|
105602
|
+
if (!hasMatch &&
|
|
105603
|
+
!matchedIndices[matchIndex] &&
|
|
105604
|
+
(hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta))) {
|
|
105605
|
+
matchedIndices[matchIndex] = true;
|
|
105606
|
+
}
|
|
105607
|
+
matchIndex++;
|
|
105608
|
+
});
|
|
105609
|
+
isValueEqual = hasMatch;
|
|
105610
|
+
});
|
|
105611
|
+
return isValueEqual;
|
|
105612
|
+
}
|
|
105613
|
+
/**
|
|
105614
|
+
* Whether the `Set`s are equal in value, including circular references.
|
|
105615
|
+
*/
|
|
105616
|
+
var areSetsEqualCircular = createIsCircular(areSetsEqual);
|
|
105617
|
+
|
|
105618
|
+
var DEFAULT_CONFIG = Object.freeze({
|
|
105619
|
+
areArraysEqual: areArraysEqual,
|
|
105620
|
+
areDatesEqual: areDatesEqual,
|
|
105621
|
+
areMapsEqual: areMapsEqual,
|
|
105622
|
+
areObjectsEqual: areObjectsEqual,
|
|
105623
|
+
areRegExpsEqual: areRegExpsEqual,
|
|
105624
|
+
areSetsEqual: areSetsEqual,
|
|
105625
|
+
createIsNestedEqual: createDefaultIsNestedEqual,
|
|
105626
|
+
});
|
|
105627
|
+
var DEFAULT_CIRCULAR_CONFIG = Object.freeze({
|
|
105628
|
+
areArraysEqual: areArraysEqualCircular,
|
|
105629
|
+
areDatesEqual: areDatesEqual,
|
|
105630
|
+
areMapsEqual: areMapsEqualCircular,
|
|
105631
|
+
areObjectsEqual: areObjectsEqualCircular,
|
|
105632
|
+
areRegExpsEqual: areRegExpsEqual,
|
|
105633
|
+
areSetsEqual: areSetsEqualCircular,
|
|
105634
|
+
createIsNestedEqual: createDefaultIsNestedEqual,
|
|
105635
|
+
});
|
|
105636
|
+
createComparator(DEFAULT_CONFIG);
|
|
105637
|
+
createComparator(merge(DEFAULT_CONFIG, { createIsNestedEqual: function () { return sameValueZeroEqual; } }));
|
|
105638
|
+
createComparator(DEFAULT_CIRCULAR_CONFIG);
|
|
105639
|
+
createComparator(merge(DEFAULT_CIRCULAR_CONFIG, {
|
|
105640
|
+
createIsNestedEqual: function () { return sameValueZeroEqual; },
|
|
105641
|
+
}));
|
|
105642
|
+
/**
|
|
105643
|
+
* Create a custom equality comparison method.
|
|
105644
|
+
*
|
|
105645
|
+
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
105646
|
+
* where the standard methods are not performant enough, but can also be used to provide
|
|
105647
|
+
* support for legacy environments that do not support expected features like
|
|
105648
|
+
* `RegExp.prototype.flags` out of the box.
|
|
105649
|
+
*/
|
|
105650
|
+
function createCustomEqual(getComparatorOptions) {
|
|
105651
|
+
return createComparator(merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG)));
|
|
105652
|
+
}
|
|
105653
|
+
|
|
105654
|
+
var deepCompareEqualsForMaps = createCustomEqual(function (deepEqual) {
|
|
105655
|
+
return function (a, b) {
|
|
105656
|
+
if (a instanceof google.maps.LatLng || b instanceof google.maps.LatLng) {
|
|
105657
|
+
return new google.maps.LatLng(a).equals(new google.maps.LatLng(b));
|
|
105658
|
+
}
|
|
105659
|
+
|
|
105660
|
+
// TODO extend to other types
|
|
105661
|
+
|
|
105662
|
+
// use fast-equals for other objects
|
|
105663
|
+
return deepEqual(a, b);
|
|
105664
|
+
};
|
|
105665
|
+
});
|
|
105666
|
+
function useDeepCompareEffectForMaps(callback, dependencies) {
|
|
105667
|
+
React.useEffect(callback, dependencies.map(useDeepCompareMemoize));
|
|
105668
|
+
}
|
|
105669
|
+
function useDeepCompareMemoize(value) {
|
|
105670
|
+
var ref = React.useRef();
|
|
105671
|
+
if (!deepCompareEqualsForMaps(value, ref.current)) {
|
|
105672
|
+
ref.current = value;
|
|
105673
|
+
}
|
|
105674
|
+
return ref.current;
|
|
105675
|
+
}
|
|
105676
|
+
|
|
105677
|
+
var _excluded = ["onClick", "onIdle", "children", "style", "mapId", "clustered", "fitBounds"];
|
|
105678
|
+
var BaseMap = function BaseMap(props) {
|
|
105679
|
+
// eslint-disable-next-line object-curly-newline
|
|
105680
|
+
var onClick = props.onClick,
|
|
105681
|
+
onIdle = props.onIdle,
|
|
105682
|
+
children = props.children,
|
|
105683
|
+
style = props.style,
|
|
105684
|
+
mapId = props.mapId,
|
|
105685
|
+
clustered = props.clustered,
|
|
105686
|
+
fitBounds = props.fitBounds,
|
|
105687
|
+
options = _objectWithoutProperties$1(props, _excluded);
|
|
105688
|
+
var ref = React.useRef(null);
|
|
105689
|
+
var _useState = React.useState(),
|
|
105690
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
105691
|
+
map = _useState2[0],
|
|
105692
|
+
setMap = _useState2[1];
|
|
105693
|
+
React.useEffect(function () {
|
|
105694
|
+
if (ref.current && !map) {
|
|
105695
|
+
setMap(new window.google.maps.Map(ref.current, {
|
|
105696
|
+
mapId: mapId
|
|
105697
|
+
}));
|
|
105698
|
+
}
|
|
105699
|
+
}, [map]);
|
|
105700
|
+
React.useEffect(function () {
|
|
105701
|
+
if (clustered && map && React.Children.count(children) > 0) {
|
|
105702
|
+
var markers = React.Children.map(children, function (child) {
|
|
105703
|
+
return new google.maps.Marker({
|
|
105704
|
+
position: child.props.position
|
|
105705
|
+
});
|
|
105706
|
+
});
|
|
105707
|
+
// eslint-disable-next-line no-new
|
|
105708
|
+
new MarkerClusterer({
|
|
105709
|
+
map: map,
|
|
105710
|
+
markers: markers
|
|
105711
|
+
});
|
|
105712
|
+
}
|
|
105713
|
+
}, [clustered, children, map]);
|
|
105714
|
+
React.useEffect(function () {
|
|
105715
|
+
if (map && React.Children.count(children) > 0) {
|
|
105716
|
+
var bounds = new google.maps.LatLngBounds();
|
|
105717
|
+
React.Children.forEach(children, function (child) {
|
|
105718
|
+
bounds.extend(new google.maps.LatLng(child.props.position.lat, child.props.position.lng));
|
|
105719
|
+
});
|
|
105720
|
+
map.fitBounds(bounds);
|
|
105721
|
+
}
|
|
105722
|
+
}, [fitBounds, map]);
|
|
105723
|
+
useDeepCompareEffectForMaps(function () {
|
|
105724
|
+
if (map) {
|
|
105725
|
+
map.setOptions(options);
|
|
105726
|
+
}
|
|
105727
|
+
}, [map, options]);
|
|
105728
|
+
React.useEffect(function () {
|
|
105729
|
+
if (map) {
|
|
105730
|
+
['click', 'idle'].forEach(function (eventName) {
|
|
105731
|
+
return google.maps.event.clearListeners(map, eventName);
|
|
105732
|
+
});
|
|
105733
|
+
if (onClick) {
|
|
105734
|
+
map.addListener('click', onClick);
|
|
105735
|
+
}
|
|
105736
|
+
if (onIdle) {
|
|
105737
|
+
map.addListener('idle', function () {
|
|
105738
|
+
return onIdle(map);
|
|
105739
|
+
});
|
|
105740
|
+
}
|
|
105741
|
+
}
|
|
105742
|
+
}, [map, onClick, onIdle]);
|
|
105743
|
+
React.useEffect(function () {
|
|
105744
|
+
if (map) {
|
|
105745
|
+
['click', 'idle'].forEach(function (eventName) {
|
|
105746
|
+
return google.maps.event.clearListeners(map, eventName);
|
|
105747
|
+
});
|
|
105748
|
+
if (onClick) {
|
|
105749
|
+
map.addListener('click', onClick);
|
|
105750
|
+
}
|
|
105751
|
+
if (onIdle) {
|
|
105752
|
+
map.addListener('idle', function () {
|
|
105753
|
+
return onIdle(map);
|
|
105754
|
+
});
|
|
105755
|
+
}
|
|
105756
|
+
}
|
|
105757
|
+
}, [map, onClick, onIdle]);
|
|
105758
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
105759
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
105760
|
+
ref: ref,
|
|
105761
|
+
style: style
|
|
105762
|
+
}), !clustered && React.Children.map(children, function (child) {
|
|
105763
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
105764
|
+
// set the map prop on the child component
|
|
105765
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
105766
|
+
map: map
|
|
105767
|
+
});
|
|
105768
|
+
}
|
|
105769
|
+
return null;
|
|
105770
|
+
})]
|
|
105771
|
+
});
|
|
105772
|
+
};
|
|
105773
|
+
BaseMap.defaultProps = {
|
|
105774
|
+
clustered: false,
|
|
105775
|
+
fitBounds: false,
|
|
105776
|
+
zoom: 1,
|
|
105777
|
+
center: {
|
|
105778
|
+
lat: 0,
|
|
105779
|
+
lng: 0
|
|
105780
|
+
}
|
|
105781
|
+
};
|
|
105782
|
+
|
|
105783
|
+
var Map$1 = function Map(props) {
|
|
105784
|
+
var options = props.options,
|
|
105785
|
+
apiKey = props.apiKey,
|
|
105786
|
+
libraries = props.libraries,
|
|
105787
|
+
children = props.children;
|
|
105788
|
+
return /*#__PURE__*/jsxRuntime.jsx(Wrapper, {
|
|
105789
|
+
apiKey: apiKey,
|
|
105790
|
+
libraries: libraries,
|
|
105791
|
+
children: /*#__PURE__*/jsxRuntime.jsx(BaseMap, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
105792
|
+
children: children
|
|
105793
|
+
}))
|
|
105794
|
+
});
|
|
105795
|
+
};
|
|
105796
|
+
Map$1.propTypes = {
|
|
105797
|
+
apiKey: propTypes$1.exports.string.isRequired,
|
|
105798
|
+
libraries: propTypes$1.exports.arrayOf(propTypes$1.exports.string)
|
|
105799
|
+
};
|
|
105800
|
+
Map$1.defaultProps = {
|
|
105801
|
+
libraries: undefined
|
|
105802
|
+
};
|
|
105803
|
+
|
|
105804
|
+
var Marker = function Marker(options) {
|
|
105805
|
+
var _useState = React.useState(),
|
|
105806
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
105807
|
+
marker = _useState2[0],
|
|
105808
|
+
setMarker = _useState2[1];
|
|
105809
|
+
React.useEffect(function () {
|
|
105810
|
+
if (!marker) {
|
|
105811
|
+
setMarker(new google.maps.Marker());
|
|
105812
|
+
}
|
|
105813
|
+
|
|
105814
|
+
// remove marker from map on unmount
|
|
105815
|
+
return function () {
|
|
105816
|
+
if (marker) {
|
|
105817
|
+
marker.setMap(null);
|
|
105818
|
+
}
|
|
105819
|
+
};
|
|
105820
|
+
}, [marker]);
|
|
105821
|
+
React.useEffect(function () {
|
|
105822
|
+
if (marker) {
|
|
105823
|
+
marker.setOptions(options);
|
|
105824
|
+
}
|
|
105825
|
+
}, [marker, options]);
|
|
105826
|
+
return null;
|
|
105827
|
+
};
|
|
105828
|
+
|
|
103749
105829
|
exports.Accordion = Accordion;
|
|
103750
105830
|
exports.Alert = Alert;
|
|
103751
105831
|
exports.AlertIcon = AlertIcon;
|
|
@@ -103755,6 +105835,7 @@ exports.BASE_URLS = BASE_URLS;
|
|
|
103755
105835
|
exports.BaseButton = BaseButton;
|
|
103756
105836
|
exports.BaseCell = BaseCell;
|
|
103757
105837
|
exports.BaseHorizontalBarChart = BaseHorizontalBarChart;
|
|
105838
|
+
exports.BaseMap = BaseMap;
|
|
103758
105839
|
exports.BaseModal = BaseModal;
|
|
103759
105840
|
exports.BasePieChart = BasePieChart;
|
|
103760
105841
|
exports.BaseRegionChart = BaseRegionChart;
|
|
@@ -103797,6 +105878,8 @@ exports.HierarchyItem = HierarchyItem;
|
|
|
103797
105878
|
exports.Link = Link;
|
|
103798
105879
|
exports.MONTHS = MONTHS;
|
|
103799
105880
|
exports.MagnifyingGlassIcon = MagnifyingGlass;
|
|
105881
|
+
exports.Map = Map$1;
|
|
105882
|
+
exports.Marker = Marker;
|
|
103800
105883
|
exports.NutIcon = Nut;
|
|
103801
105884
|
exports.PageHeader = PageHeader;
|
|
103802
105885
|
exports.Pagination = Pagination;
|