@evergis/react 2.0.193 → 2.0.195
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/components/Legend/components/ClusterSymbolPreview.d.ts +1 -0
- package/dist/components/Legend/components/LegendSymbolRenderer.d.ts +1 -0
- package/dist/components/Legend/components/index.d.ts +3 -1
- package/dist/components/Legend/hooks/useSvgSymbol.d.ts +6 -5
- package/dist/components/Legend/types.d.ts +1 -0
- package/dist/react.cjs.development.js +262 -219
- package/dist/react.cjs.development.js.map +1 -1
- package/dist/react.cjs.production.min.js +1 -1
- package/dist/react.cjs.production.min.js.map +1 -1
- package/dist/react.esm.js +261 -220
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/svg.d.ts +10 -4
- package/package.json +2 -2
package/dist/react.esm.js
CHANGED
|
@@ -2593,7 +2593,7 @@ const getTitleFromCondition = _ref2 => {
|
|
|
2593
2593
|
} = _ref2;
|
|
2594
2594
|
const parts = condition == null ? void 0 : condition.split(' == ');
|
|
2595
2595
|
const uniqueValue = (parts == null ? void 0 : (_parts$ = parts[1]) == null ? void 0 : _parts$.slice(1, -1)) || '';
|
|
2596
|
-
return attribute && formatValue ? formatValue(attribute.type, uniqueValue, attribute.stringFormat) :
|
|
2596
|
+
return attribute && formatValue ? formatValue(attribute.type, uniqueValue, attribute.stringFormat) : uniqueValue;
|
|
2597
2597
|
};
|
|
2598
2598
|
function createValueTitleFromCondition(paramValue, attribute, formatValue, index) {
|
|
2599
2599
|
if (!attribute) return '';
|
|
@@ -3225,7 +3225,7 @@ var SvgSymbolBg;
|
|
|
3225
3225
|
})(SvgSymbolBg || (SvgSymbolBg = {}));
|
|
3226
3226
|
|
|
3227
3227
|
const convertSvgToBase64 = svg => "data:image/svg+xml;base64," + window.btoa(svg);
|
|
3228
|
-
const createSvgGradient = (svg, values) => svg.gradient(
|
|
3228
|
+
const createSvgGradient = (svg, values) => svg.gradient('linear', add => {
|
|
3229
3229
|
values == null ? void 0 : values.forEach((_ref, index) => {
|
|
3230
3230
|
let {
|
|
3231
3231
|
value
|
|
@@ -3234,9 +3234,16 @@ const createSvgGradient = (svg, values) => svg.gradient("linear", add => {
|
|
|
3234
3234
|
});
|
|
3235
3235
|
}).from(0, 0).to(1, 1); // eslint-disable-next-line max-lines-per-function
|
|
3236
3236
|
|
|
3237
|
-
const manipulateSvgSymbol =
|
|
3237
|
+
const manipulateSvgSymbol = _ref2 => {
|
|
3238
3238
|
var _$exec2;
|
|
3239
3239
|
|
|
3240
|
+
let {
|
|
3241
|
+
SVGContainer,
|
|
3242
|
+
symbol,
|
|
3243
|
+
svg,
|
|
3244
|
+
bg,
|
|
3245
|
+
isClassifiedValue
|
|
3246
|
+
} = _ref2;
|
|
3240
3247
|
if (!symbol) return SVGContainer;
|
|
3241
3248
|
const symbolData = getParameterValue(svg || symbol.data);
|
|
3242
3249
|
if (!symbolData) return SVGContainer;
|
|
@@ -3247,8 +3254,8 @@ const manipulateSvgSymbol = (SVGContainer, symbol, svg, bg) => {
|
|
|
3247
3254
|
background,
|
|
3248
3255
|
figure
|
|
3249
3256
|
} = symbol;
|
|
3250
|
-
const isUploadedFile = !bg && !symbolData.includes(
|
|
3251
|
-
const innerSvg = symbolData.replace(/<\?xml[^?]*\?>|<svg[^>]*>|<\/svg>/g,
|
|
3257
|
+
const isUploadedFile = !bg && !symbolData.includes('symbol-bg') && !symbolData.includes('symbol-figure');
|
|
3258
|
+
const innerSvg = symbolData.replace(/<\?xml[^?]*\?>|<svg[^>]*>|<\/svg>/g, '');
|
|
3252
3259
|
|
|
3253
3260
|
if (isUploadedFile) {
|
|
3254
3261
|
var _$exec;
|
|
@@ -3262,11 +3269,11 @@ const manipulateSvgSymbol = (SVGContainer, symbol, svg, bg) => {
|
|
|
3262
3269
|
|
|
3263
3270
|
SVGContainer.size(size);
|
|
3264
3271
|
} else {
|
|
3265
|
-
const hasBg = bg || (innerSvg == null ? void 0 : innerSvg.includes(
|
|
3272
|
+
const hasBg = bg || (innerSvg == null ? void 0 : innerSvg.includes('symbol-bg'));
|
|
3266
3273
|
let defaultSize = hasBg ? DEFAULT_SYMBOL_WITH_BG_SIZE : DEFAULT_SYMBOL_SIZE;
|
|
3267
3274
|
const currentSize = size || defaultSize;
|
|
3268
3275
|
let viewBox = [0, 0, defaultSize, defaultSize];
|
|
3269
|
-
const strokeWidth = getParameterValue(background == null ? void 0 : background.strokeWidth) || (typeof (background == null ? void 0 : background.strokeColor) ===
|
|
3276
|
+
const strokeWidth = getParameterValue(background == null ? void 0 : background.strokeWidth) || (typeof (background == null ? void 0 : background.strokeColor) === 'object' ? 1 : 0);
|
|
3270
3277
|
|
|
3271
3278
|
if (strokeWidth) {
|
|
3272
3279
|
defaultSize += strokeWidth;
|
|
@@ -3274,7 +3281,7 @@ const manipulateSvgSymbol = (SVGContainer, symbol, svg, bg) => {
|
|
|
3274
3281
|
}
|
|
3275
3282
|
|
|
3276
3283
|
if (hasBg) {
|
|
3277
|
-
SVGContainer.size(currentSize + "px", currentSize + "px").viewbox(viewBox.join(
|
|
3284
|
+
SVGContainer.size(currentSize + "px", currentSize + "px").viewbox(viewBox.join(' '));
|
|
3278
3285
|
const currentBg = bg || (background == null ? void 0 : background.type);
|
|
3279
3286
|
|
|
3280
3287
|
if (currentBg) {
|
|
@@ -3282,23 +3289,38 @@ const manipulateSvgSymbol = (SVGContainer, symbol, svg, bg) => {
|
|
|
3282
3289
|
const fillColor = getParameterValue(background == null ? void 0 : background.fillColor);
|
|
3283
3290
|
SVGContainer.svg(currentBg === SvgSymbolBg.Circle ? "<circle\n id=\"symbol-bg\"\n cx=\"" + DEFAULT_SYMBOL_WITH_BG_SIZE / 2 + "\"\n cy=\"" + DEFAULT_SYMBOL_WITH_BG_SIZE / 2 + "\"\n r=\"" + DEFAULT_SYMBOL_WITH_BG_SIZE / 2 + "\"\n fill=\"" + (fillColor || DEFAULT_SYMBOL_FILL_COLOR) + "\"\n stroke=\"" + (strokeColor || DEFAULT_SYMBOL_STROKE_COLOR) + "\"\n stroke-width=\"" + strokeWidth + "\"\n />" : "<rect\n id=\"symbol-bg\"\n width=\"" + DEFAULT_SYMBOL_WITH_BG_SIZE + "\"\n height=\"" + DEFAULT_SYMBOL_WITH_BG_SIZE + "\"\n rx=\"4\"\n fill=\"" + (fillColor || DEFAULT_SYMBOL_FILL_COLOR) + "\"\n stroke=\"" + (strokeColor || DEFAULT_SYMBOL_STROKE_COLOR) + "\"\n stroke-width=\"" + strokeWidth + "\"\n />");
|
|
3284
3291
|
SVGContainer.svg(innerSvg);
|
|
3285
|
-
SVGContainer.find(
|
|
3286
|
-
SVGContainer.find(
|
|
3292
|
+
SVGContainer.find('#symbol-bg:not(:first-child)').each(item => item.remove());
|
|
3293
|
+
SVGContainer.find(':not(#symbol-bg)').each(item => item.center(DEFAULT_SYMBOL_WITH_BG_SIZE / 2, DEFAULT_SYMBOL_WITH_BG_SIZE / 2).fill('white'));
|
|
3294
|
+
const symbolBg = SVGContainer.find('#symbol-bg')[0];
|
|
3295
|
+
|
|
3296
|
+
if (isClassifiedValue) {
|
|
3297
|
+
symbolBg == null ? void 0 : symbolBg.stroke({
|
|
3298
|
+
opacity: 0.28
|
|
3299
|
+
});
|
|
3300
|
+
} // eslint-disable-next-line max-depth
|
|
3301
|
+
|
|
3287
3302
|
|
|
3288
3303
|
if (isParameterByAttribute(background == null ? void 0 : background.fillColor)) {
|
|
3289
|
-
var _background$fillColor
|
|
3304
|
+
var _background$fillColor;
|
|
3290
3305
|
|
|
3291
3306
|
const gradient = createSvgGradient(SVGContainer, background == null ? void 0 : (_background$fillColor = background.fillColor) == null ? void 0 : _background$fillColor.values);
|
|
3292
|
-
|
|
3307
|
+
symbolBg == null ? void 0 : symbolBg.fill(gradient);
|
|
3308
|
+
|
|
3309
|
+
if (isParameterByAttribute(background == null ? void 0 : background.strokeColor)) {
|
|
3310
|
+
symbolBg == null ? void 0 : symbolBg.stroke({
|
|
3311
|
+
color: gradient,
|
|
3312
|
+
opacity: 0.28
|
|
3313
|
+
});
|
|
3314
|
+
}
|
|
3293
3315
|
}
|
|
3294
3316
|
} else {
|
|
3295
3317
|
SVGContainer.svg(innerSvg);
|
|
3296
3318
|
}
|
|
3297
3319
|
} else {
|
|
3298
3320
|
const fillColor = getParameterValue(figure == null ? void 0 : figure.fillColor);
|
|
3299
|
-
SVGContainer.size(currentSize + "px", currentSize + "px").viewbox(viewBox.join(
|
|
3321
|
+
SVGContainer.size(currentSize + "px", currentSize + "px").viewbox(viewBox.join(' '));
|
|
3300
3322
|
SVGContainer.svg(innerSvg);
|
|
3301
|
-
SVGContainer.find(
|
|
3323
|
+
SVGContainer.find('#symbol-figure').each(item => {
|
|
3302
3324
|
item.center(DEFAULT_SYMBOL_SIZE / 2, DEFAULT_SYMBOL_SIZE / 2).fill(fillColor || DEFAULT_SYMBOL_FILL_COLOR);
|
|
3303
3325
|
});
|
|
3304
3326
|
}
|
|
@@ -3307,13 +3329,13 @@ const manipulateSvgSymbol = (SVGContainer, symbol, svg, bg) => {
|
|
|
3307
3329
|
const rootTransform = (_$exec2 = /<svg[^>]*transform="([^"]+)"/g.exec(symbolData)) == null ? void 0 : _$exec2[1];
|
|
3308
3330
|
|
|
3309
3331
|
if (rootTransform) {
|
|
3310
|
-
const transformParts = rootTransform.slice(0, -1).split(
|
|
3332
|
+
const transformParts = rootTransform.slice(0, -1).split('(');
|
|
3311
3333
|
SVGContainer.transform({
|
|
3312
|
-
[transformParts[0]]: transformParts[1].split(
|
|
3334
|
+
[transformParts[0]]: transformParts[1].split(',')
|
|
3313
3335
|
});
|
|
3314
3336
|
}
|
|
3315
3337
|
|
|
3316
|
-
const rotatedAngle = SVGContainer.transform(
|
|
3338
|
+
const rotatedAngle = SVGContainer.transform('rotate');
|
|
3317
3339
|
|
|
3318
3340
|
if (rotatedAngle) {
|
|
3319
3341
|
SVGContainer.rotate(-rotatedAngle, 0, 0);
|
|
@@ -5996,89 +6018,7 @@ const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject
|
|
|
5996
6018
|
const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject36 || (_templateObject36 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-top: 0.1rem;\n font-size: 0.625rem;\n color: #1fb3aa;\n"])));
|
|
5997
6019
|
const ClusterLegendContainer = /*#__PURE__*/styled.div(_templateObject37 || (_templateObject37 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: -0.9rem;\n transform: scale(0.5);\n"])));
|
|
5998
6020
|
|
|
5999
|
-
const
|
|
6000
|
-
if (title.includes(" - ")) {
|
|
6001
|
-
const result = title == null ? void 0 : title.split(" - ");
|
|
6002
|
-
return minOrMax === "min" ? result == null ? void 0 : result[0] : result == null ? void 0 : result[1];
|
|
6003
|
-
}
|
|
6004
|
-
|
|
6005
|
-
if (title.includes(",")) {
|
|
6006
|
-
const result = title == null ? void 0 : title.split(",");
|
|
6007
|
-
return result.join(", ");
|
|
6008
|
-
}
|
|
6009
|
-
|
|
6010
|
-
return title.split(" ").find(isNumeric) || title || "";
|
|
6011
|
-
};
|
|
6012
|
-
|
|
6013
|
-
const MinimizedLegend = _ref => {
|
|
6014
|
-
var _currentValues$, _currentValues, _currentValues$2, _currentValues2;
|
|
6015
|
-
|
|
6016
|
-
let {
|
|
6017
|
-
innerRef,
|
|
6018
|
-
isShown,
|
|
6019
|
-
values,
|
|
6020
|
-
title,
|
|
6021
|
-
parameter,
|
|
6022
|
-
hiddenLegends
|
|
6023
|
-
} = _ref;
|
|
6024
|
-
const currentValues = [...values];
|
|
6025
|
-
const other = currentValues.pop();
|
|
6026
|
-
const isSize = isParameterType("size", parameter);
|
|
6027
|
-
const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
|
|
6028
|
-
const titleMax = getValueFromLegendTitle((_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title, "max");
|
|
6029
|
-
const titleMin = getValueFromLegendTitle((_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title, "min");
|
|
6030
|
-
const checkIsHidden = useCallback(hiddenCondition => hiddenCondition ? hiddenLegends == null ? void 0 : hiddenLegends.some(condition => hiddenCondition.includes(condition)) : false, [hiddenLegends]);
|
|
6031
|
-
return React.createElement(MinimizedLegendContainer, {
|
|
6032
|
-
ref: innerRef,
|
|
6033
|
-
isShown: isShown
|
|
6034
|
-
}, !!title && React.createElement(MapLegendValueDescr, null, title), isSize ? React.createElement(React.Fragment, null, React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
|
|
6035
|
-
parameter: parameter,
|
|
6036
|
-
isSize: true
|
|
6037
|
-
}, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
6038
|
-
key: "" + value.title + index,
|
|
6039
|
-
title: value.title,
|
|
6040
|
-
value: value.parameterValue,
|
|
6041
|
-
parameter: parameter,
|
|
6042
|
-
isHidden: checkIsHidden(value.hiddenCondition)
|
|
6043
|
-
})))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendDown, null, (_currentValues$2 = currentValues[0]) == null ? void 0 : _currentValues$2.title), React.createElement(SizeMinimizedLegendUp, null, (_currentValues2 = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues2.title))), React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
|
|
6044
|
-
parameter: parameter,
|
|
6045
|
-
isSize: true
|
|
6046
|
-
}, React.createElement(MapLegendOther, {
|
|
6047
|
-
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
6048
|
-
value: other == null ? void 0 : other.parameterValue,
|
|
6049
|
-
parameter: parameter,
|
|
6050
|
-
isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
|
|
6051
|
-
}))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : isStrokeWidth ? React.createElement(MapLegendItems, {
|
|
6052
|
-
parameter: parameter,
|
|
6053
|
-
isStrokeWidth: true
|
|
6054
|
-
}, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
6055
|
-
key: "" + value.title + index,
|
|
6056
|
-
title: value.title,
|
|
6057
|
-
value: value.parameterValue,
|
|
6058
|
-
parameter: parameter,
|
|
6059
|
-
isHidden: checkIsHidden(value.hiddenCondition)
|
|
6060
|
-
}, (!index || index === currentValues.length - 1) && value.title)), React.createElement(MapLegendOther, {
|
|
6061
|
-
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
6062
|
-
value: other == null ? void 0 : other.parameterValue,
|
|
6063
|
-
parameter: parameter,
|
|
6064
|
-
isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
|
|
6065
|
-
}, "\u0414\u0440\u0443\u0433\u043E\u0435")) : React.createElement(MapLegendItems, {
|
|
6066
|
-
parameter: parameter
|
|
6067
|
-
}, React.createElement(MapLegendItemsContainer, null, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
6068
|
-
key: "" + value.title + index,
|
|
6069
|
-
title: value.title,
|
|
6070
|
-
value: value.parameterValue,
|
|
6071
|
-
parameter: parameter,
|
|
6072
|
-
isHidden: checkIsHidden(value.hiddenCondition)
|
|
6073
|
-
}))), React.createElement(MapLegendOther, {
|
|
6074
|
-
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
6075
|
-
value: other == null ? void 0 : other.parameterValue,
|
|
6076
|
-
parameter: parameter,
|
|
6077
|
-
isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
|
|
6078
|
-
})), typeof (other == null ? void 0 : other.parameterValue) === "string" && (titleMax || titleMin) && React.createElement(MapLegendValues, null, React.createElement(MapLegendValuesRange, null, React.createElement("div", null, titleMax), React.createElement("div", null, titleMin)), React.createElement(MapLegendValuesOther, null, "-")));
|
|
6079
|
-
};
|
|
6080
|
-
|
|
6081
|
-
const useSvgSymbol = (symbol, skipOffset) => {
|
|
6021
|
+
const useSvgSymbol = (symbol, skipOffset, isClassifiedValue) => {
|
|
6082
6022
|
const SVGWrapperRefElement = useRef(null);
|
|
6083
6023
|
const SVGContainer = useMemo(() => SVG(), []);
|
|
6084
6024
|
const initSvg = useCallback(() => {
|
|
@@ -6089,9 +6029,16 @@ const useSvgSymbol = (symbol, skipOffset) => {
|
|
|
6089
6029
|
let {
|
|
6090
6030
|
svg,
|
|
6091
6031
|
bg,
|
|
6092
|
-
newSymbol
|
|
6032
|
+
newSymbol,
|
|
6033
|
+
isClassifiedValue
|
|
6093
6034
|
} = _ref;
|
|
6094
|
-
manipulateSvgSymbol(
|
|
6035
|
+
manipulateSvgSymbol({
|
|
6036
|
+
SVGContainer,
|
|
6037
|
+
symbol: newSymbol || symbol,
|
|
6038
|
+
svg,
|
|
6039
|
+
bg,
|
|
6040
|
+
isClassifiedValue
|
|
6041
|
+
});
|
|
6095
6042
|
}, [SVGContainer, symbol]);
|
|
6096
6043
|
const getUpdatedSvgSymbol = useCallback((field, value) => {
|
|
6097
6044
|
var _newSymbol$background;
|
|
@@ -6100,27 +6047,27 @@ const useSvgSymbol = (symbol, skipOffset) => {
|
|
|
6100
6047
|
data,
|
|
6101
6048
|
offset
|
|
6102
6049
|
} = symbol;
|
|
6103
|
-
const newValue = value instanceof Color$1 ? value.toString(
|
|
6050
|
+
const newValue = value instanceof Color$1 ? value.toString('rgba') : value;
|
|
6104
6051
|
|
|
6105
6052
|
const newSymbol = _extends({}, JSON.parse(JSON.stringify(symbol)), {
|
|
6106
6053
|
offset: skipOffset ? DEFAULT_SYMBOL_OFFSET : isSizeClassification(field) ? getOffsetParameterValue(offset) : offset
|
|
6107
6054
|
});
|
|
6108
6055
|
|
|
6109
|
-
if (field.indexOf(
|
|
6056
|
+
if (field.indexOf('.') !== -1) {
|
|
6110
6057
|
var _newSymbol$parts$;
|
|
6111
6058
|
|
|
6112
|
-
const parts = field.split(
|
|
6059
|
+
const parts = field.split('.');
|
|
6113
6060
|
|
|
6114
6061
|
if ((_newSymbol$parts$ = newSymbol[parts[0]]) != null && _newSymbol$parts$[parts[1]]) {
|
|
6115
6062
|
newSymbol[parts[0]][parts[1]] = newValue;
|
|
6116
6063
|
} else {
|
|
6117
6064
|
newSymbol[parts[0]] = _extends({}, newSymbol[parts[0]], {
|
|
6118
6065
|
[parts[1]]: newValue
|
|
6119
|
-
}, parts[0] ===
|
|
6066
|
+
}, parts[0] === 'background' ? {
|
|
6120
6067
|
type: newSymbol.background.type,
|
|
6121
|
-
id:
|
|
6122
|
-
} : parts[0] ===
|
|
6123
|
-
id:
|
|
6068
|
+
id: 'symbol-bg'
|
|
6069
|
+
} : parts[0] === 'figure' ? {
|
|
6070
|
+
id: 'symbol-figure'
|
|
6124
6071
|
} : {});
|
|
6125
6072
|
}
|
|
6126
6073
|
} else {
|
|
@@ -6130,7 +6077,8 @@ const useSvgSymbol = (symbol, skipOffset) => {
|
|
|
6130
6077
|
manipulateSvg({
|
|
6131
6078
|
svg: getParameterValue(data),
|
|
6132
6079
|
newSymbol,
|
|
6133
|
-
bg: (_newSymbol$background = newSymbol.background) == null ? void 0 : _newSymbol$background.type
|
|
6080
|
+
bg: (_newSymbol$background = newSymbol.background) == null ? void 0 : _newSymbol$background.type,
|
|
6081
|
+
isClassifiedValue
|
|
6134
6082
|
});
|
|
6135
6083
|
return _extends({}, newSymbol, {
|
|
6136
6084
|
data: SVGContainer.svg()
|
|
@@ -6184,9 +6132,10 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6184
6132
|
bg,
|
|
6185
6133
|
symbol,
|
|
6186
6134
|
title,
|
|
6187
|
-
skipOffset,
|
|
6188
6135
|
text,
|
|
6189
6136
|
fontSettings,
|
|
6137
|
+
skipOffset,
|
|
6138
|
+
isClassifiedValue,
|
|
6190
6139
|
onClick
|
|
6191
6140
|
} = _ref7;
|
|
6192
6141
|
const {
|
|
@@ -6194,7 +6143,7 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6194
6143
|
initSvg,
|
|
6195
6144
|
getSvgData,
|
|
6196
6145
|
manipulateSvg
|
|
6197
|
-
} = useSvgSymbol(symbol, skipOffset);
|
|
6146
|
+
} = useSvgSymbol(symbol, skipOffset, isClassifiedValue);
|
|
6198
6147
|
const onSelectSymbol = useCallback(() => {
|
|
6199
6148
|
onClick == null ? void 0 : onClick(getSvgData(), _extends({}, symbol, bg ? {
|
|
6200
6149
|
background: _extends({}, symbol.background, {
|
|
@@ -6214,9 +6163,10 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6214
6163
|
manipulateSvg({
|
|
6215
6164
|
svg,
|
|
6216
6165
|
bg,
|
|
6217
|
-
newSymbol: symbol
|
|
6166
|
+
newSymbol: symbol,
|
|
6167
|
+
isClassifiedValue
|
|
6218
6168
|
});
|
|
6219
|
-
}, [svg, symbol, bg, manipulateSvg]);
|
|
6169
|
+
}, [svg, symbol, bg, manipulateSvg, isClassifiedValue]);
|
|
6220
6170
|
return text ? React.createElement(SvgSymbolContainer, null, renderSymbol, React.createElement(SvgSymbolLabel, {
|
|
6221
6171
|
fontSettings: fontSettings
|
|
6222
6172
|
}, text), !!(fontSettings != null && fontSettings.haloColor) && !!(fontSettings != null && fontSettings.haloWidth) && React.createElement(SvgSymbolLabel, {
|
|
@@ -6227,41 +6177,19 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6227
6177
|
}, text)) : renderSymbol;
|
|
6228
6178
|
});
|
|
6229
6179
|
|
|
6230
|
-
const SymbolByType = _ref => {
|
|
6231
|
-
let {
|
|
6232
|
-
type,
|
|
6233
|
-
symbol,
|
|
6234
|
-
size,
|
|
6235
|
-
svg,
|
|
6236
|
-
skipOffset
|
|
6237
|
-
} = _ref;
|
|
6238
|
-
const defaultSymbol = useMemo(() => React.createElement(Symbol, {
|
|
6239
|
-
symbol: symbol,
|
|
6240
|
-
size: size
|
|
6241
|
-
}), [symbol, size]);
|
|
6242
|
-
|
|
6243
|
-
switch (type) {
|
|
6244
|
-
case "svgPointSymbol":
|
|
6245
|
-
return svg ? React.createElement(SvgSymbol, {
|
|
6246
|
-
svg: svg,
|
|
6247
|
-
size: size,
|
|
6248
|
-
skipOffset: skipOffset,
|
|
6249
|
-
symbol: serializeSvgPointSymbol(symbol)
|
|
6250
|
-
}) : defaultSymbol;
|
|
6251
|
-
|
|
6252
|
-
default:
|
|
6253
|
-
return defaultSymbol;
|
|
6254
|
-
}
|
|
6255
|
-
};
|
|
6256
|
-
|
|
6257
6180
|
const ClusterSymbolPreview = _ref => {
|
|
6258
|
-
var _symbol$labelSymbol;
|
|
6181
|
+
var _symbol$fillColor$val, _symbol$labelSymbol;
|
|
6259
6182
|
|
|
6260
6183
|
let {
|
|
6261
6184
|
symbol,
|
|
6185
|
+
index,
|
|
6262
6186
|
size = 56,
|
|
6263
6187
|
fontSize = '1.25rem'
|
|
6264
6188
|
} = _ref;
|
|
6189
|
+
const isClassified = isParameterByAttribute(symbol.fillColor);
|
|
6190
|
+
const isClassifiedValue = isClassified && index !== undefined;
|
|
6191
|
+
const fillColor = isClassifiedValue ? ((_symbol$fillColor$val = symbol.fillColor.values[index]) == null ? void 0 : _symbol$fillColor$val.value) || symbol.fillColor.defaultValue : symbol.fillColor;
|
|
6192
|
+
const strokeColor = isClassified ? fillColor : symbol.strokeColor;
|
|
6265
6193
|
const svgSymbol = {
|
|
6266
6194
|
type: 'svgPointSymbol',
|
|
6267
6195
|
size,
|
|
@@ -6269,8 +6197,8 @@ const ClusterSymbolPreview = _ref => {
|
|
|
6269
6197
|
angle: 0,
|
|
6270
6198
|
background: {
|
|
6271
6199
|
id: 'symbol-bg',
|
|
6272
|
-
fillColor
|
|
6273
|
-
strokeColor
|
|
6200
|
+
fillColor,
|
|
6201
|
+
strokeColor,
|
|
6274
6202
|
strokeWidth: 6,
|
|
6275
6203
|
type: 'circle'
|
|
6276
6204
|
}
|
|
@@ -6278,6 +6206,7 @@ const ClusterSymbolPreview = _ref => {
|
|
|
6278
6206
|
return React.createElement(SvgSymbol, {
|
|
6279
6207
|
svg: DEFAULT_CLUSTER_SVG,
|
|
6280
6208
|
symbol: svgSymbol,
|
|
6209
|
+
isClassifiedValue: isClassifiedValue,
|
|
6281
6210
|
text: '99',
|
|
6282
6211
|
fontSettings: _extends({}, symbol.labelSymbol, {
|
|
6283
6212
|
fontSize: fontSize || ((_symbol$labelSymbol = symbol.labelSymbol) == null ? void 0 : _symbol$labelSymbol.fontSize)
|
|
@@ -6285,14 +6214,43 @@ const ClusterSymbolPreview = _ref => {
|
|
|
6285
6214
|
});
|
|
6286
6215
|
};
|
|
6287
6216
|
|
|
6217
|
+
const SymbolByType = _ref => {
|
|
6218
|
+
let {
|
|
6219
|
+
type,
|
|
6220
|
+
symbol,
|
|
6221
|
+
size,
|
|
6222
|
+
svg,
|
|
6223
|
+
skipOffset
|
|
6224
|
+
} = _ref;
|
|
6225
|
+
const defaultSymbol = useMemo(() => React.createElement(Symbol, {
|
|
6226
|
+
symbol: symbol,
|
|
6227
|
+
size: size
|
|
6228
|
+
}), [symbol, size]);
|
|
6229
|
+
|
|
6230
|
+
switch (type) {
|
|
6231
|
+
case "svgPointSymbol":
|
|
6232
|
+
return svg ? React.createElement(SvgSymbol, {
|
|
6233
|
+
svg: svg,
|
|
6234
|
+
size: size,
|
|
6235
|
+
skipOffset: skipOffset,
|
|
6236
|
+
symbol: serializeSvgPointSymbol(symbol)
|
|
6237
|
+
}) : defaultSymbol;
|
|
6238
|
+
|
|
6239
|
+
default:
|
|
6240
|
+
return defaultSymbol;
|
|
6241
|
+
}
|
|
6242
|
+
};
|
|
6243
|
+
|
|
6288
6244
|
const LegendSymbolRenderer = /*#__PURE__*/memo(_ref => {
|
|
6289
6245
|
let {
|
|
6290
|
-
symbol
|
|
6246
|
+
symbol,
|
|
6247
|
+
index
|
|
6291
6248
|
} = _ref;
|
|
6292
6249
|
|
|
6293
6250
|
if (isClusterSymbol(symbol)) {
|
|
6294
6251
|
return React.createElement(ClusterLegendContainer, null, React.createElement(ClusterSymbolPreview, {
|
|
6295
|
-
symbol: symbol
|
|
6252
|
+
symbol: symbol,
|
|
6253
|
+
index: index
|
|
6296
6254
|
}));
|
|
6297
6255
|
}
|
|
6298
6256
|
|
|
@@ -6305,6 +6263,31 @@ const LegendSymbolRenderer = /*#__PURE__*/memo(_ref => {
|
|
|
6305
6263
|
});
|
|
6306
6264
|
});
|
|
6307
6265
|
|
|
6266
|
+
const getConditionAttribute = (attributes, condition) => {
|
|
6267
|
+
if (!condition) return null;
|
|
6268
|
+
const attributeName = getAttributeNameFromCondition(condition);
|
|
6269
|
+
let attribute = attributes.find(_ref => {
|
|
6270
|
+
let {
|
|
6271
|
+
name
|
|
6272
|
+
} = _ref;
|
|
6273
|
+
return name === attributeName;
|
|
6274
|
+
});
|
|
6275
|
+
|
|
6276
|
+
if (!attribute) {
|
|
6277
|
+
if (attributeName === 'count') {
|
|
6278
|
+
attribute = {
|
|
6279
|
+
name: 'count',
|
|
6280
|
+
alias: 'Количество',
|
|
6281
|
+
type: AttributeType.Int32
|
|
6282
|
+
};
|
|
6283
|
+
} else {
|
|
6284
|
+
return null;
|
|
6285
|
+
}
|
|
6286
|
+
}
|
|
6287
|
+
|
|
6288
|
+
return attribute;
|
|
6289
|
+
};
|
|
6290
|
+
|
|
6308
6291
|
const isHiddenLegend = (hiddenCondition, hiddenLegends) => !!(hiddenLegends != null && hiddenLegends.includes(hiddenCondition));
|
|
6309
6292
|
|
|
6310
6293
|
const renderColumn = (column, index) => {
|
|
@@ -6345,6 +6328,134 @@ const getLegendText = _ref => {
|
|
|
6345
6328
|
return React.createElement(React.Fragment, null, columns.map(renderColumn));
|
|
6346
6329
|
};
|
|
6347
6330
|
|
|
6331
|
+
const LegendChildren = _ref => {
|
|
6332
|
+
var _layerInfo$style, _layerInfo$style$chil;
|
|
6333
|
+
|
|
6334
|
+
let {
|
|
6335
|
+
layerInfo,
|
|
6336
|
+
hiddenLegends,
|
|
6337
|
+
toggleHiddenLegend,
|
|
6338
|
+
formatValue
|
|
6339
|
+
} = _ref;
|
|
6340
|
+
if (!((_layerInfo$style = layerInfo.style) != null && (_layerInfo$style$chil = _layerInfo$style.children) != null && _layerInfo$style$chil.length)) return null;
|
|
6341
|
+
const attributes = getLayerAttributes(layerInfo.layerDefinition);
|
|
6342
|
+
return React.createElement(MapLegendContainer, null, layerInfo.style.children.map((paramValue, index) => {
|
|
6343
|
+
var _getConditionAttribut;
|
|
6344
|
+
|
|
6345
|
+
const attribute = getConditionAttribute(attributes, paramValue.condition);
|
|
6346
|
+
if (!attribute) return null;
|
|
6347
|
+
const hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.symbol, paramValue.title, new ClassificationCondition(paramValue.condition)));
|
|
6348
|
+
const legendText = getLegendText({
|
|
6349
|
+
title: isRangeCondition(paramValue.condition) ? createValueTitleFromCondition(paramValue, attribute, formatValue, index) : getTitleFromCondition({
|
|
6350
|
+
condition: paramValue.condition,
|
|
6351
|
+
attribute,
|
|
6352
|
+
formatValue
|
|
6353
|
+
}),
|
|
6354
|
+
index,
|
|
6355
|
+
isDate: ((_getConditionAttribut = getConditionAttribute(attributes, paramValue.condition)) == null ? void 0 : _getConditionAttribut.type) === 'DateTime'
|
|
6356
|
+
});
|
|
6357
|
+
return React.createElement(ClassifiedItem, {
|
|
6358
|
+
key: index,
|
|
6359
|
+
isHidden: isHiddenLegend(hiddenCondition, hiddenLegends == null ? void 0 : hiddenLegends[layerInfo.name]),
|
|
6360
|
+
onClick: () => toggleHiddenLegend == null ? void 0 : toggleHiddenLegend(layerInfo.name, hiddenCondition)
|
|
6361
|
+
}, React.createElement(SymbolContainer, null, React.createElement(LegendSymbolRenderer, {
|
|
6362
|
+
symbol: paramValue.symbol
|
|
6363
|
+
})), legendText);
|
|
6364
|
+
}));
|
|
6365
|
+
};
|
|
6366
|
+
|
|
6367
|
+
const LegendParameterDescription = _ref => {
|
|
6368
|
+
let {
|
|
6369
|
+
parameter
|
|
6370
|
+
} = _ref;
|
|
6371
|
+
const isSize = isParameterType("size", parameter);
|
|
6372
|
+
const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
|
|
6373
|
+
const isStrokeColor = isParameterType(["strokeColor", "stroke.color"], parameter);
|
|
6374
|
+
return React.createElement(MapLegendDescriptionContainer, null, isStrokeWidth || isStrokeColor ? isStrokeWidth ? "Толщина обводки" : "Цвет обводки" : isSize ? "Размер знака" : "Цвет символа");
|
|
6375
|
+
};
|
|
6376
|
+
|
|
6377
|
+
const getValueFromLegendTitle = (title, minOrMax) => {
|
|
6378
|
+
if (title.includes(" - ")) {
|
|
6379
|
+
const result = title == null ? void 0 : title.split(" - ");
|
|
6380
|
+
return minOrMax === "min" ? result == null ? void 0 : result[0] : result == null ? void 0 : result[1];
|
|
6381
|
+
}
|
|
6382
|
+
|
|
6383
|
+
if (title.includes(",")) {
|
|
6384
|
+
const result = title == null ? void 0 : title.split(",");
|
|
6385
|
+
return result.join(", ");
|
|
6386
|
+
}
|
|
6387
|
+
|
|
6388
|
+
return title.split(" ").find(isNumeric) || title || "";
|
|
6389
|
+
};
|
|
6390
|
+
|
|
6391
|
+
const MinimizedLegend = _ref => {
|
|
6392
|
+
var _currentValues$, _currentValues, _currentValues$2, _currentValues2;
|
|
6393
|
+
|
|
6394
|
+
let {
|
|
6395
|
+
innerRef,
|
|
6396
|
+
isShown,
|
|
6397
|
+
values,
|
|
6398
|
+
title,
|
|
6399
|
+
parameter,
|
|
6400
|
+
hiddenLegends
|
|
6401
|
+
} = _ref;
|
|
6402
|
+
const currentValues = [...values];
|
|
6403
|
+
const other = currentValues.pop();
|
|
6404
|
+
const isSize = isParameterType("size", parameter);
|
|
6405
|
+
const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
|
|
6406
|
+
const titleMax = getValueFromLegendTitle((_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title, "max");
|
|
6407
|
+
const titleMin = getValueFromLegendTitle((_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title, "min");
|
|
6408
|
+
const checkIsHidden = useCallback(hiddenCondition => hiddenCondition ? hiddenLegends == null ? void 0 : hiddenLegends.some(condition => hiddenCondition.includes(condition)) : false, [hiddenLegends]);
|
|
6409
|
+
return React.createElement(MinimizedLegendContainer, {
|
|
6410
|
+
ref: innerRef,
|
|
6411
|
+
isShown: isShown
|
|
6412
|
+
}, !!title && React.createElement(MapLegendValueDescr, null, title), isSize ? React.createElement(React.Fragment, null, React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
|
|
6413
|
+
parameter: parameter,
|
|
6414
|
+
isSize: true
|
|
6415
|
+
}, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
6416
|
+
key: "" + value.title + index,
|
|
6417
|
+
title: value.title,
|
|
6418
|
+
value: value.parameterValue,
|
|
6419
|
+
parameter: parameter,
|
|
6420
|
+
isHidden: checkIsHidden(value.hiddenCondition)
|
|
6421
|
+
})))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendDown, null, (_currentValues$2 = currentValues[0]) == null ? void 0 : _currentValues$2.title), React.createElement(SizeMinimizedLegendUp, null, (_currentValues2 = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues2.title))), React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
|
|
6422
|
+
parameter: parameter,
|
|
6423
|
+
isSize: true
|
|
6424
|
+
}, React.createElement(MapLegendOther, {
|
|
6425
|
+
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
6426
|
+
value: other == null ? void 0 : other.parameterValue,
|
|
6427
|
+
parameter: parameter,
|
|
6428
|
+
isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
|
|
6429
|
+
}))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : isStrokeWidth ? React.createElement(MapLegendItems, {
|
|
6430
|
+
parameter: parameter,
|
|
6431
|
+
isStrokeWidth: true
|
|
6432
|
+
}, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
6433
|
+
key: "" + value.title + index,
|
|
6434
|
+
title: value.title,
|
|
6435
|
+
value: value.parameterValue,
|
|
6436
|
+
parameter: parameter,
|
|
6437
|
+
isHidden: checkIsHidden(value.hiddenCondition)
|
|
6438
|
+
}, (!index || index === currentValues.length - 1) && value.title)), React.createElement(MapLegendOther, {
|
|
6439
|
+
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
6440
|
+
value: other == null ? void 0 : other.parameterValue,
|
|
6441
|
+
parameter: parameter,
|
|
6442
|
+
isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
|
|
6443
|
+
}, "\u0414\u0440\u0443\u0433\u043E\u0435")) : React.createElement(MapLegendItems, {
|
|
6444
|
+
parameter: parameter
|
|
6445
|
+
}, React.createElement(MapLegendItemsContainer, null, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
6446
|
+
key: "" + value.title + index,
|
|
6447
|
+
title: value.title,
|
|
6448
|
+
value: value.parameterValue,
|
|
6449
|
+
parameter: parameter,
|
|
6450
|
+
isHidden: checkIsHidden(value.hiddenCondition)
|
|
6451
|
+
}))), React.createElement(MapLegendOther, {
|
|
6452
|
+
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
6453
|
+
value: other == null ? void 0 : other.parameterValue,
|
|
6454
|
+
parameter: parameter,
|
|
6455
|
+
isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
|
|
6456
|
+
})), typeof (other == null ? void 0 : other.parameterValue) === "string" && (titleMax || titleMin) && React.createElement(MapLegendValues, null, React.createElement(MapLegendValuesRange, null, React.createElement("div", null, titleMax), React.createElement("div", null, titleMin)), React.createElement(MapLegendValuesOther, null, "-")));
|
|
6457
|
+
};
|
|
6458
|
+
|
|
6348
6459
|
const MaximizedLegend = _ref => {
|
|
6349
6460
|
let {
|
|
6350
6461
|
innerRef,
|
|
@@ -6390,29 +6501,20 @@ const MaximizedLegend = _ref => {
|
|
|
6390
6501
|
value: (parameterValue == null ? void 0 : (_parameterValue$value = parameterValue.values[(parameterValue == null ? void 0 : parameterValue.values.length) - index - 1]) == null ? void 0 : _parameterValue$value.value) || (parameterValue == null ? void 0 : parameterValue.defaultValue),
|
|
6391
6502
|
parameter: parameter
|
|
6392
6503
|
})) : React.createElement(SymbolContainer, null, React.createElement(LegendSymbolRenderer, {
|
|
6393
|
-
|
|
6504
|
+
index: index,
|
|
6505
|
+
symbol: isClusterFillColor$1 ? sectionSymbol : getExtractedSymbol(symbol, true)
|
|
6394
6506
|
})), getLegendText({
|
|
6395
6507
|
title,
|
|
6396
6508
|
index,
|
|
6397
6509
|
isDate
|
|
6398
6510
|
}));
|
|
6399
|
-
}, [parameter, sectionIndex, hiddenLegends, isSize, isStrokeWidth, isStrokeColor, parameterValue, isDate, toggleHiddenLegend, layerName]);
|
|
6511
|
+
}, [parameter, sectionIndex, hiddenLegends, isSize, isStrokeWidth, isStrokeColor, parameterValue, sectionSymbol, isDate, toggleHiddenLegend, layerName]);
|
|
6400
6512
|
return React.createElement(MaximizedLegendContainer, {
|
|
6401
6513
|
ref: innerRef,
|
|
6402
6514
|
isShown: isShown
|
|
6403
6515
|
}, values.map(renderLegend));
|
|
6404
6516
|
};
|
|
6405
6517
|
|
|
6406
|
-
const LegendParameterDescription = _ref => {
|
|
6407
|
-
let {
|
|
6408
|
-
parameter
|
|
6409
|
-
} = _ref;
|
|
6410
|
-
const isSize = isParameterType("size", parameter);
|
|
6411
|
-
const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
|
|
6412
|
-
const isStrokeColor = isParameterType(["strokeColor", "stroke.color"], parameter);
|
|
6413
|
-
return React.createElement(MapLegendDescriptionContainer, null, isStrokeWidth || isStrokeColor ? isStrokeWidth ? "Толщина обводки" : "Цвет обводки" : isSize ? "Размер знака" : "Цвет символа");
|
|
6414
|
-
};
|
|
6415
|
-
|
|
6416
6518
|
const LegendSection = _ref => {
|
|
6417
6519
|
let {
|
|
6418
6520
|
layerName,
|
|
@@ -6458,67 +6560,6 @@ const LegendSection = _ref => {
|
|
|
6458
6560
|
}, isExpanded ? 'Свернуть' : 'Развернуть'));
|
|
6459
6561
|
};
|
|
6460
6562
|
|
|
6461
|
-
const getConditionAttribute = (attributes, condition) => {
|
|
6462
|
-
if (!condition) return null;
|
|
6463
|
-
const attributeName = getAttributeNameFromCondition(condition);
|
|
6464
|
-
let attribute = attributes.find(_ref => {
|
|
6465
|
-
let {
|
|
6466
|
-
name
|
|
6467
|
-
} = _ref;
|
|
6468
|
-
return name === attributeName;
|
|
6469
|
-
});
|
|
6470
|
-
|
|
6471
|
-
if (!attribute) {
|
|
6472
|
-
if (attributeName === 'count') {
|
|
6473
|
-
attribute = {
|
|
6474
|
-
name: 'count',
|
|
6475
|
-
alias: 'Количество',
|
|
6476
|
-
type: AttributeType.Int32
|
|
6477
|
-
};
|
|
6478
|
-
} else {
|
|
6479
|
-
return null;
|
|
6480
|
-
}
|
|
6481
|
-
}
|
|
6482
|
-
|
|
6483
|
-
return attribute;
|
|
6484
|
-
};
|
|
6485
|
-
|
|
6486
|
-
const LegendChildren = _ref => {
|
|
6487
|
-
var _layerInfo$style, _layerInfo$style$chil;
|
|
6488
|
-
|
|
6489
|
-
let {
|
|
6490
|
-
layerInfo,
|
|
6491
|
-
hiddenLegends,
|
|
6492
|
-
toggleHiddenLegend,
|
|
6493
|
-
formatValue
|
|
6494
|
-
} = _ref;
|
|
6495
|
-
if (!((_layerInfo$style = layerInfo.style) != null && (_layerInfo$style$chil = _layerInfo$style.children) != null && _layerInfo$style$chil.length)) return null;
|
|
6496
|
-
const attributes = getLayerAttributes(layerInfo.layerDefinition);
|
|
6497
|
-
return React.createElement(MapLegendContainer, null, layerInfo.style.children.map((paramValue, index) => {
|
|
6498
|
-
var _getConditionAttribut;
|
|
6499
|
-
|
|
6500
|
-
const attribute = getConditionAttribute(attributes, paramValue.condition);
|
|
6501
|
-
if (!attribute) return null;
|
|
6502
|
-
const hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.symbol, paramValue.title, new ClassificationCondition(paramValue.condition)));
|
|
6503
|
-
const legendText = getLegendText({
|
|
6504
|
-
title: isRangeCondition(paramValue.condition) ? createValueTitleFromCondition(paramValue, attribute, formatValue, index) : getTitleFromCondition({
|
|
6505
|
-
condition: paramValue.condition,
|
|
6506
|
-
attribute,
|
|
6507
|
-
formatValue
|
|
6508
|
-
}),
|
|
6509
|
-
index,
|
|
6510
|
-
isDate: ((_getConditionAttribut = getConditionAttribute(attributes, paramValue.condition)) == null ? void 0 : _getConditionAttribut.type) === 'DateTime'
|
|
6511
|
-
});
|
|
6512
|
-
return React.createElement(ClassifiedItem, {
|
|
6513
|
-
key: index,
|
|
6514
|
-
isHidden: isHiddenLegend(hiddenCondition, hiddenLegends == null ? void 0 : hiddenLegends[layerInfo.name]),
|
|
6515
|
-
onClick: () => toggleHiddenLegend == null ? void 0 : toggleHiddenLegend(layerInfo.name, hiddenCondition)
|
|
6516
|
-
}, React.createElement(SymbolContainer, null, React.createElement(LegendSymbolRenderer, {
|
|
6517
|
-
symbol: paramValue.symbol
|
|
6518
|
-
})), legendText);
|
|
6519
|
-
}));
|
|
6520
|
-
};
|
|
6521
|
-
|
|
6522
6563
|
const _excluded$3 = ["layerInfo", "formatValue", "hiddenLegends", "toggleHiddenLegend"];
|
|
6523
6564
|
const Legend = /*#__PURE__*/memo(_ref => {
|
|
6524
6565
|
var _layerInfo$style, _layerInfo$style$chil;
|
|
@@ -6965,5 +7006,5 @@ const DraggableMarker = _ref => {
|
|
|
6965
7006
|
return React.createElement(Fragment, null);
|
|
6966
7007
|
};
|
|
6967
7008
|
|
|
6968
|
-
export { ArrowLineMiterRender, BASE_OPERATORS, BETWEEN_OPERATORS, BaseMeasureToolCreator, BaseMeasureToolEditor, CONTAINS_OPERATORS, CRS_MAP, CardAttributes, CardHeader, CircleLineMiterRender, ClassificationCondition, ClassificationManager, ClassifiedItem, ClusterLayer, ClusterLegendContainer, ClusterSymbol, ComparisonOperator, CompoundIcon, DEFAULT_CLUSTER_SVG, DEFAULT_CRS, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LEGEND_SIZES, DEFAULT_LEGEND_STYLES, DEFAULT_LEGEND_SYMBOL_SIZE, DEFAULT_PARAMETER_INFO, DEFAULT_SRID, DEFAULT_SYMBOL_FILL_COLOR, DEFAULT_SYMBOL_OFFSET, DEFAULT_SYMBOL_SIZE, DEFAULT_SYMBOL_STROKE_COLOR, DEFAULT_SYMBOL_WITH_BG_SIZE, DateFormat, DraggableMarker, ENDS_WITH_OPERATORS, EXTRA_BORDER_SIZE, EvergisCard, EvergisCardAttribute, AttributeContainer as EvergisCardAttributeContainer, AttributeTitle as EvergisCardAttributeTitle, AttributeValueContainer as EvergisCardAttributeValueContainer, CardControls as EvergisCardCardControls, CardTitle as EvergisCardCardTitle, EvergisCardContainer, CurrentFeatureIndex as EvergisCardCurrentFeatureIndex, FeatureName as EvergisCardFeatureName, LayerName as EvergisCardLayerName, CardPagination as EvergisCardPagination, PaginationDescription as EvergisCardPaginationDescription, SimpleAttribute as EvergisCardSimpleValue, StickyHeader as EvergisCardStickyHeader, ValueLink as EvergisCardValueLink, EvergisDynamicLayer, EvergisFeature, EvergisLayer, EvergisProvider, EvergisSelect, EvergisSelectLayer, EvergisSelectProvider, EvergisStyle, EvergisTileLayer, FILLED_OPERATORS, FeatureLayer, FilterConditionOperation, Fullscreen, GEOMETRY_ATTRIBUTE, ItemSeparator, ItemText, LabelSymbol, Legend, LegendParameterDescription, LegendProvider, LegendSection, LegendSymbolRenderer, LineMiterRender, Map, MapControl, MapControls, MapLegendContainer, MapLegendControl, MapLegendDescription, MapLegendDescriptionContainer, MapLegendExpandButton, MapLegendHeader, MapLegendItem, MapLegendItems, MapLegendItemsContainer, MapLegendOther, MapLegendSectionContainer, MapLegendSectionItems, MapLegendValueDescr, MapLegendValues, MapLegendValuesOther, MapLegendValuesRange, MapProvider, MaximizedLegend, MaximizedLegendContainer, Measure, MeasureTool, Measurer, MinimizedLegend, MinimizedLegendContainer, NO_CONTENT_VALUE, Noop, OPERATOR_CONDITION_REMAP, PARAMETER_INFOS, PREVIEW_LIMITS, RANGE_OPERATORS, SGisBrushFill, SGisImageFill, SGisPolygonSymbol, SGisPolylineSymbol, SOLID_INTERVALS, STARTS_WITH_OPERATORS, SVGPoly, SYMBOL_CLASSIFICATION, SYMBOL_LIMITS, SYMBOL_SIZE_PARAMETERS, ScaleRuler, ScaleRulerBlock, ScaleRulerContainer, Search, SelectedPointSymbol, SelectedPolySymbol, ShadowedPointSymbol, ShadowedPolySymbol, SizeMinimizedLegend, SizeMinimizedLegendDown, SizeMinimizedLegendLabel, SizeMinimizedLegendSymbol, SizeMinimizedLegendUp, SquareLineMiterRender, SrId, StyleSymbol, SvgSymbol, SvgSymbolBg, Symbol, SymbolButton, SymbolByType, SymbolContainer, TextContainer, TileLayer, Tooltip, TooltipComponent, TooltipProvider, Zoom, ZoomLevel, adjustSymbol, applyParameterValue, checkLayerHasLegend, clamp, convertSvgToBase64, copyRings, createCompositeSymbol, createHiddenCondition, createLabelSymbol, createLegendSymbol, createOtherHiddenCondition, createSvgGradient, createValueTitle, createValueTitleFromCondition, dateComparisonOperators, defaultOffset, defineStrokeStylePreset, deserializeSymbol, evaluateFeature, extractStyle, extractSymbol, findChildFeatureStyle, findChildFeatureSymbol, formatArea, formatAttributeValue, formatDate, formatLength, formatPolygonMeasure, formatRangeClassValue, formatUniqueClassValue, getAttributeFromCondition, getAttributeNameFromClassified, getAttributeNameFromCondition, getAttributeType, getAttributesConfiguration, getChildSymbols, getClassificationValue, getClassified, getCrs, getDashStylePreset, getDate, getDimensions, getExprFromCondition, getExtractedSymbol, getFeatureSymbol, getHexColor, getLayerDefinition, getLegendSymbolRenders, getLegendSymbolSize, getLineDash, getMapLegendSymbolRenders, getMapState, getMaximizedLegendValues, getMinimizedLegendValues, getOffsetParameterValue, getParameterFromSymbol, getParameterValue, getRangeValues$1 as getRangeValues, getScale, getServiceConfiguration, getSignFromConditionPart, getSymbolParameterInfo, getSymbolRenders, getSymbolStrokeWidth, getTitleFromCondition, getValueFromConditionPart, isArrowLineMiter, isCalculatedParameter, isCircleLineMiter, isClusterFillColor, isClusterSymbol, isCompositeSymbol, isDashedBrush, isFilledLineMitter, isH3GridSymbol, isHatchBrush, isImageSymbol, isLabelSymbol, isLayerService, isMaskedImageSymbol, isMiterExist, isNumeric, isObject, isParameterByAttribute, isParameterType, isParameterValueSimple, isParameterValueSymbol, isPatternBrush, isPointLabelSymbol, isPointSymbol, isPolygonHasHatchBrush, isPolygonHasPatternBrush, isPolygonLabelSymbol, isPolygonSymbol, isPolylineLabelSymbol, isPolylineLikePolygon, isPolylineSymbol, isPolylineSymbols, isRangeClass, isRangeCondition, isRasterSymbol, isRequisiteNumbers, isSGisClusterSymbol, isSGisCombinedPolylineSymbol, isSGisH3Symbol, isSGisImageSymbol, isSGisPointSymbol, isSGisPolygonSymbol, isSGisPolylineSymbol, isScalablePolylineSymbol, isSimpleOffset, isSimplePolylineSymbol, isSimpleSymbol, isSizableSymbol, isSizeClassification, isSolidBrush, isSquareLineMiter, isSquareSymbol, isStaticImageSymbol, isStringAsInn, isStringAsKpp, isStringAsMail, isStringAsOgrn, isStringAsPhone, isStringAsUrl, isStringContainsDate, isStringParameterValue, isStrokeStyledSymbol, isStyle, isSvgPointSymbol, isSymbolWithOffset, isTwoDimensionalSymbol, isUniqueClass, isValidParameter, isValidUrl, mailHref, manipulateSvgSymbol, matchPhone, measureAreaSymbol, measureLengthSymbol, measurePolygonSnapSymbol, metersToPixels, numberComparisonOperators, numberWithSpaces, packStyle, phoneHref, polygonCircleFromPoint, printRangeClass, renderSymbolToCanvas, selectedPoint, selectedPolygon, selectedPolyline, serializeSvgPointSymbol, setDefaultParameterValue, setParameterValue, shouldUpdateMapState, solidStrokeStylePreset, strokeStylePresets, symbolParameterWalker, symbolTypeGuard, textComparisonOperators, toIntervals, toLineDash, unClassify, updateMapResolution, updateSymbolParameter, urlHref, useCanvas, useClusterLayer, useCrs, useDebouncedCallback, useDraggableMarker, useEventPoint, useEvergisContext, useEvergisDynamicLayer, useEvergisSelect, useEvergisSelectContext, useEvergisTileLayer, useFeatureLayer, useLayerOrder, useLayerVisibility, useLegendContext, useMapBboxChange, useMapContext, useMapLevel, useMapPick, useMapResize, useMapState, useMapView, useMapViewActions, useMapWrapper, useMaxMinScale, useMetersToPixels, useMetersToPixelsCb, useMount, useNode, useProperty, useScale, useSvgSymbol, useSymbol, useToggle, useTooltip, useTooltipContext, useUpdate, useUpdateMapView };
|
|
7009
|
+
export { ArrowLineMiterRender, BASE_OPERATORS, BETWEEN_OPERATORS, BaseMeasureToolCreator, BaseMeasureToolEditor, CONTAINS_OPERATORS, CRS_MAP, CardAttributes, CardHeader, CircleLineMiterRender, ClassificationCondition, ClassificationManager, ClassifiedItem, ClusterLayer, ClusterLegendContainer, ClusterSymbol, ClusterSymbolPreview, ComparisonOperator, CompoundIcon, DEFAULT_CLUSTER_SVG, DEFAULT_CRS, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LEGEND_SIZES, DEFAULT_LEGEND_STYLES, DEFAULT_LEGEND_SYMBOL_SIZE, DEFAULT_PARAMETER_INFO, DEFAULT_SRID, DEFAULT_SYMBOL_FILL_COLOR, DEFAULT_SYMBOL_OFFSET, DEFAULT_SYMBOL_SIZE, DEFAULT_SYMBOL_STROKE_COLOR, DEFAULT_SYMBOL_WITH_BG_SIZE, DateFormat, DraggableMarker, ENDS_WITH_OPERATORS, EXTRA_BORDER_SIZE, EvergisCard, EvergisCardAttribute, AttributeContainer as EvergisCardAttributeContainer, AttributeTitle as EvergisCardAttributeTitle, AttributeValueContainer as EvergisCardAttributeValueContainer, CardControls as EvergisCardCardControls, CardTitle as EvergisCardCardTitle, EvergisCardContainer, CurrentFeatureIndex as EvergisCardCurrentFeatureIndex, FeatureName as EvergisCardFeatureName, LayerName as EvergisCardLayerName, CardPagination as EvergisCardPagination, PaginationDescription as EvergisCardPaginationDescription, SimpleAttribute as EvergisCardSimpleValue, StickyHeader as EvergisCardStickyHeader, ValueLink as EvergisCardValueLink, EvergisDynamicLayer, EvergisFeature, EvergisLayer, EvergisProvider, EvergisSelect, EvergisSelectLayer, EvergisSelectProvider, EvergisStyle, EvergisTileLayer, FILLED_OPERATORS, FeatureLayer, FilterConditionOperation, Fullscreen, GEOMETRY_ATTRIBUTE, ItemSeparator, ItemText, LabelSymbol, Legend, LegendChildren, LegendParameterDescription, LegendProvider, LegendSection, LegendSymbolRenderer, LineMiterRender, Map, MapControl, MapControls, MapLegendContainer, MapLegendControl, MapLegendDescription, MapLegendDescriptionContainer, MapLegendExpandButton, MapLegendHeader, MapLegendItem, MapLegendItems, MapLegendItemsContainer, MapLegendOther, MapLegendSectionContainer, MapLegendSectionItems, MapLegendValueDescr, MapLegendValues, MapLegendValuesOther, MapLegendValuesRange, MapProvider, MaximizedLegend, MaximizedLegendContainer, Measure, MeasureTool, Measurer, MinimizedLegend, MinimizedLegendContainer, NO_CONTENT_VALUE, Noop, OPERATOR_CONDITION_REMAP, PARAMETER_INFOS, PREVIEW_LIMITS, RANGE_OPERATORS, SGisBrushFill, SGisImageFill, SGisPolygonSymbol, SGisPolylineSymbol, SOLID_INTERVALS, STARTS_WITH_OPERATORS, SVGPoly, SYMBOL_CLASSIFICATION, SYMBOL_LIMITS, SYMBOL_SIZE_PARAMETERS, ScaleRuler, ScaleRulerBlock, ScaleRulerContainer, Search, SelectedPointSymbol, SelectedPolySymbol, ShadowedPointSymbol, ShadowedPolySymbol, SizeMinimizedLegend, SizeMinimizedLegendDown, SizeMinimizedLegendLabel, SizeMinimizedLegendSymbol, SizeMinimizedLegendUp, SquareLineMiterRender, SrId, StyleSymbol, SvgSymbol, SvgSymbolBg, Symbol, SymbolButton, SymbolByType, SymbolContainer, TextContainer, TileLayer, Tooltip, TooltipComponent, TooltipProvider, Zoom, ZoomLevel, adjustSymbol, applyParameterValue, checkLayerHasLegend, clamp, convertSvgToBase64, copyRings, createCompositeSymbol, createHiddenCondition, createLabelSymbol, createLegendSymbol, createOtherHiddenCondition, createSvgGradient, createValueTitle, createValueTitleFromCondition, dateComparisonOperators, defaultOffset, defineStrokeStylePreset, deserializeSymbol, evaluateFeature, extractStyle, extractSymbol, findChildFeatureStyle, findChildFeatureSymbol, formatArea, formatAttributeValue, formatDate, formatLength, formatPolygonMeasure, formatRangeClassValue, formatUniqueClassValue, getAttributeFromCondition, getAttributeNameFromClassified, getAttributeNameFromCondition, getAttributeType, getAttributesConfiguration, getChildSymbols, getClassificationValue, getClassified, getCrs, getDashStylePreset, getDate, getDimensions, getExprFromCondition, getExtractedSymbol, getFeatureSymbol, getHexColor, getLayerDefinition, getLegendSymbolRenders, getLegendSymbolSize, getLineDash, getMapLegendSymbolRenders, getMapState, getMaximizedLegendValues, getMinimizedLegendValues, getOffsetParameterValue, getParameterFromSymbol, getParameterValue, getRangeValues$1 as getRangeValues, getScale, getServiceConfiguration, getSignFromConditionPart, getSymbolParameterInfo, getSymbolRenders, getSymbolStrokeWidth, getTitleFromCondition, getValueFromConditionPart, isArrowLineMiter, isCalculatedParameter, isCircleLineMiter, isClusterFillColor, isClusterSymbol, isCompositeSymbol, isDashedBrush, isFilledLineMitter, isH3GridSymbol, isHatchBrush, isImageSymbol, isLabelSymbol, isLayerService, isMaskedImageSymbol, isMiterExist, isNumeric, isObject, isParameterByAttribute, isParameterType, isParameterValueSimple, isParameterValueSymbol, isPatternBrush, isPointLabelSymbol, isPointSymbol, isPolygonHasHatchBrush, isPolygonHasPatternBrush, isPolygonLabelSymbol, isPolygonSymbol, isPolylineLabelSymbol, isPolylineLikePolygon, isPolylineSymbol, isPolylineSymbols, isRangeClass, isRangeCondition, isRasterSymbol, isRequisiteNumbers, isSGisClusterSymbol, isSGisCombinedPolylineSymbol, isSGisH3Symbol, isSGisImageSymbol, isSGisPointSymbol, isSGisPolygonSymbol, isSGisPolylineSymbol, isScalablePolylineSymbol, isSimpleOffset, isSimplePolylineSymbol, isSimpleSymbol, isSizableSymbol, isSizeClassification, isSolidBrush, isSquareLineMiter, isSquareSymbol, isStaticImageSymbol, isStringAsInn, isStringAsKpp, isStringAsMail, isStringAsOgrn, isStringAsPhone, isStringAsUrl, isStringContainsDate, isStringParameterValue, isStrokeStyledSymbol, isStyle, isSvgPointSymbol, isSymbolWithOffset, isTwoDimensionalSymbol, isUniqueClass, isValidParameter, isValidUrl, mailHref, manipulateSvgSymbol, matchPhone, measureAreaSymbol, measureLengthSymbol, measurePolygonSnapSymbol, metersToPixels, numberComparisonOperators, numberWithSpaces, packStyle, phoneHref, polygonCircleFromPoint, printRangeClass, renderSymbolToCanvas, selectedPoint, selectedPolygon, selectedPolyline, serializeSvgPointSymbol, setDefaultParameterValue, setParameterValue, shouldUpdateMapState, solidStrokeStylePreset, strokeStylePresets, symbolParameterWalker, symbolTypeGuard, textComparisonOperators, toIntervals, toLineDash, unClassify, updateMapResolution, updateSymbolParameter, urlHref, useCanvas, useClusterLayer, useCrs, useDebouncedCallback, useDraggableMarker, useEventPoint, useEvergisContext, useEvergisDynamicLayer, useEvergisSelect, useEvergisSelectContext, useEvergisTileLayer, useFeatureLayer, useLayerOrder, useLayerVisibility, useLegendContext, useMapBboxChange, useMapContext, useMapLevel, useMapPick, useMapResize, useMapState, useMapView, useMapViewActions, useMapWrapper, useMaxMinScale, useMetersToPixels, useMetersToPixelsCb, useMount, useNode, useProperty, useScale, useSvgSymbol, useSymbol, useToggle, useTooltip, useTooltipContext, useUpdate, useUpdateMapView };
|
|
6969
7010
|
//# sourceMappingURL=react.esm.js.map
|