@evergis/react 2.0.191 → 2.0.192
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/LegendChildren.d.ts +3 -0
- package/dist/components/Legend/types.d.ts +6 -3
- package/dist/components/Legend/utils/getConditionAttribute.d.ts +2 -0
- package/dist/components/Legend/utils/getLegendText.d.ts +5 -0
- package/dist/components/Legend/utils/isHiddenLegend.d.ts +1 -0
- package/dist/core/classification/getClassifications.d.ts +2 -2
- package/dist/core/classification/parameterValue.d.ts +4 -4
- package/dist/core/classification/types.d.ts +1 -1
- package/dist/core/style/types/parameterValue.d.ts +2 -2
- package/dist/react.cjs.development.js +222 -139
- 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 +221 -140
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/legend.d.ts +8 -6
- package/package.json +2 -2
package/dist/react.esm.js
CHANGED
|
@@ -719,6 +719,73 @@ const isParameterValueSymbol = parameterValue => !isParameterValueSimple(paramet
|
|
|
719
719
|
|
|
720
720
|
const isStyle = value => 'symbol' in value;
|
|
721
721
|
|
|
722
|
+
let EvergisStyle = /*#__PURE__*/function () {
|
|
723
|
+
function EvergisStyle(style) {
|
|
724
|
+
_classCallCheck(this, EvergisStyle);
|
|
725
|
+
|
|
726
|
+
this.style = extractStyle(style);
|
|
727
|
+
this.classificationManager = new ClassificationManager(this.style);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
_createClass(EvergisStyle, [{
|
|
731
|
+
key: "serialize",
|
|
732
|
+
value: function serialize() {
|
|
733
|
+
return packStyle(this.style);
|
|
734
|
+
}
|
|
735
|
+
}, {
|
|
736
|
+
key: "hasRasters",
|
|
737
|
+
value: function hasRasters() {
|
|
738
|
+
return !!(this.style.raster || (this.style.children || []).some(style => style.raster));
|
|
739
|
+
}
|
|
740
|
+
}, {
|
|
741
|
+
key: "symbol",
|
|
742
|
+
get: function get() {
|
|
743
|
+
return this.style.symbol;
|
|
744
|
+
}
|
|
745
|
+
}, {
|
|
746
|
+
key: "raster",
|
|
747
|
+
get: function get() {
|
|
748
|
+
return this.style.raster;
|
|
749
|
+
}
|
|
750
|
+
}, {
|
|
751
|
+
key: "label",
|
|
752
|
+
get: function get() {
|
|
753
|
+
return this.style.label;
|
|
754
|
+
}
|
|
755
|
+
}, {
|
|
756
|
+
key: "children",
|
|
757
|
+
get: function get() {
|
|
758
|
+
return this.style.children;
|
|
759
|
+
}
|
|
760
|
+
}, {
|
|
761
|
+
key: "title",
|
|
762
|
+
get: function get() {
|
|
763
|
+
return this.style.title;
|
|
764
|
+
}
|
|
765
|
+
}, {
|
|
766
|
+
key: "condition",
|
|
767
|
+
get: function get() {
|
|
768
|
+
return this.style.condition;
|
|
769
|
+
}
|
|
770
|
+
}, {
|
|
771
|
+
key: "ignoreLabel",
|
|
772
|
+
get: function get() {
|
|
773
|
+
return this.style.ignoreLabel;
|
|
774
|
+
}
|
|
775
|
+
}, {
|
|
776
|
+
key: "resolution",
|
|
777
|
+
get: function get() {
|
|
778
|
+
const {
|
|
779
|
+
minResolution,
|
|
780
|
+
maxResolution
|
|
781
|
+
} = this.style;
|
|
782
|
+
return minResolution === void 0 || maxResolution === void 0 ? null : [minResolution, maxResolution];
|
|
783
|
+
}
|
|
784
|
+
}]);
|
|
785
|
+
|
|
786
|
+
return EvergisStyle;
|
|
787
|
+
}();
|
|
788
|
+
|
|
722
789
|
const toClassificationClass = (parameterValue, title, condition) => _extends({
|
|
723
790
|
parameterValue,
|
|
724
791
|
title
|
|
@@ -894,73 +961,6 @@ function getRangeValues(_ref, isDouble, isDate, index) {
|
|
|
894
961
|
};
|
|
895
962
|
}
|
|
896
963
|
|
|
897
|
-
let EvergisStyle = /*#__PURE__*/function () {
|
|
898
|
-
function EvergisStyle(style) {
|
|
899
|
-
_classCallCheck(this, EvergisStyle);
|
|
900
|
-
|
|
901
|
-
this.style = extractStyle(style);
|
|
902
|
-
this.classificationManager = new ClassificationManager(this.style);
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
_createClass(EvergisStyle, [{
|
|
906
|
-
key: "serialize",
|
|
907
|
-
value: function serialize() {
|
|
908
|
-
return packStyle(this.style);
|
|
909
|
-
}
|
|
910
|
-
}, {
|
|
911
|
-
key: "hasRasters",
|
|
912
|
-
value: function hasRasters() {
|
|
913
|
-
return !!(this.style.raster || (this.style.children || []).some(style => style.raster));
|
|
914
|
-
}
|
|
915
|
-
}, {
|
|
916
|
-
key: "symbol",
|
|
917
|
-
get: function get() {
|
|
918
|
-
return this.style.symbol;
|
|
919
|
-
}
|
|
920
|
-
}, {
|
|
921
|
-
key: "raster",
|
|
922
|
-
get: function get() {
|
|
923
|
-
return this.style.raster;
|
|
924
|
-
}
|
|
925
|
-
}, {
|
|
926
|
-
key: "label",
|
|
927
|
-
get: function get() {
|
|
928
|
-
return this.style.label;
|
|
929
|
-
}
|
|
930
|
-
}, {
|
|
931
|
-
key: "children",
|
|
932
|
-
get: function get() {
|
|
933
|
-
return this.style.children;
|
|
934
|
-
}
|
|
935
|
-
}, {
|
|
936
|
-
key: "title",
|
|
937
|
-
get: function get() {
|
|
938
|
-
return this.style.title;
|
|
939
|
-
}
|
|
940
|
-
}, {
|
|
941
|
-
key: "condition",
|
|
942
|
-
get: function get() {
|
|
943
|
-
return this.style.condition;
|
|
944
|
-
}
|
|
945
|
-
}, {
|
|
946
|
-
key: "ignoreLabel",
|
|
947
|
-
get: function get() {
|
|
948
|
-
return this.style.ignoreLabel;
|
|
949
|
-
}
|
|
950
|
-
}, {
|
|
951
|
-
key: "resolution",
|
|
952
|
-
get: function get() {
|
|
953
|
-
const {
|
|
954
|
-
minResolution,
|
|
955
|
-
maxResolution
|
|
956
|
-
} = this.style;
|
|
957
|
-
return minResolution === void 0 || maxResolution === void 0 ? null : [minResolution, maxResolution];
|
|
958
|
-
}
|
|
959
|
-
}]);
|
|
960
|
-
|
|
961
|
-
return EvergisStyle;
|
|
962
|
-
}();
|
|
963
|
-
|
|
964
964
|
const getHexColor = colorString => colorString ? new Color(colorString).toString('hex') : undefined;
|
|
965
965
|
|
|
966
966
|
// TODO reduce
|
|
@@ -2530,7 +2530,7 @@ const getValueFromConditionPart = (condition, partIndex) => {
|
|
|
2530
2530
|
|
|
2531
2531
|
return (_getExprFromCondition2 = getExprFromCondition(condition, partIndex)) == null ? void 0 : _getExprFromCondition2[2];
|
|
2532
2532
|
};
|
|
2533
|
-
const isRangeCondition = condition => condition.includes('(');
|
|
2533
|
+
const isRangeCondition = condition => (condition == null ? void 0 : condition.includes('(')) || false;
|
|
2534
2534
|
const getSymbolParameterInfo = parameter => {
|
|
2535
2535
|
return PARAMETER_INFOS[parameter] || DEFAULT_PARAMETER_INFO;
|
|
2536
2536
|
};
|
|
@@ -2586,11 +2586,11 @@ const checkLayerHasLegend = layerInfo => {
|
|
|
2586
2586
|
const getTitleFromCondition = condition => {
|
|
2587
2587
|
var _parts$;
|
|
2588
2588
|
|
|
2589
|
-
const parts = condition.split(' == ');
|
|
2590
|
-
return (_parts$ = parts[1]) == null ? void 0 : _parts$.slice(1, -1);
|
|
2589
|
+
const parts = condition == null ? void 0 : condition.split(' == ');
|
|
2590
|
+
return (parts == null ? void 0 : (_parts$ = parts[1]) == null ? void 0 : _parts$.slice(1, -1)) || '';
|
|
2591
2591
|
};
|
|
2592
|
-
|
|
2593
|
-
|
|
2592
|
+
function createValueTitleFromCondition(paramValue, attribute, formatValue, index) {
|
|
2593
|
+
if (!attribute) return '';
|
|
2594
2594
|
if (paramValue.title) return paramValue.title;
|
|
2595
2595
|
const value = {
|
|
2596
2596
|
parameterValue: getParameterValue(paramValue.value),
|
|
@@ -2607,7 +2607,6 @@ function createValueTitle$1(paramValue, attribute, formatValue, index) {
|
|
|
2607
2607
|
// пункт "Настраиваемые значения параметров символики в системе"
|
|
2608
2608
|
// Для добавления подготовленных значений размеров символов нужно использовать константу PREPARED_SYMBOL_SIZES
|
|
2609
2609
|
|
|
2610
|
-
|
|
2611
2610
|
const DEFAULT_LEGEND_STYLES = {
|
|
2612
2611
|
[0
|
|
2613
2612
|
/* Point */
|
|
@@ -2902,7 +2901,7 @@ const getMinimizedLegendValues = (attribute, classified, formatValue, index, oth
|
|
|
2902
2901
|
const to = getValueFromConditionPart(paramValue.condition, 2);
|
|
2903
2902
|
result.from = from ? isNumeric(from) ? +from : formatDate(from) : null;
|
|
2904
2903
|
result.to = to ? isNumeric(to) ? +to : formatDate(to) : null;
|
|
2905
|
-
result.title =
|
|
2904
|
+
result.title = createValueTitleFromCondition(paramValue, attribute, formatValue, index);
|
|
2906
2905
|
return result;
|
|
2907
2906
|
}
|
|
2908
2907
|
|
|
@@ -2928,7 +2927,7 @@ const getMaximizedLegendValues = (attribute, param, params, classified, symbol,
|
|
|
2928
2927
|
const result = {
|
|
2929
2928
|
symbol: createLegendSymbol(paramValue.value, param, params, symbol)
|
|
2930
2929
|
};
|
|
2931
|
-
result.title = isRangeCondition(paramValue.condition) ?
|
|
2930
|
+
result.title = isRangeCondition(paramValue.condition) ? createValueTitleFromCondition(paramValue, attribute, formatValue, sectionIndex) : getTitleFromCondition(paramValue.condition);
|
|
2932
2931
|
result.hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.value, result.title, new ClassificationCondition(classified.values[index].condition)));
|
|
2933
2932
|
return result;
|
|
2934
2933
|
});
|
|
@@ -2940,11 +2939,26 @@ const getMaximizedLegendValues = (attribute, param, params, classified, symbol,
|
|
|
2940
2939
|
return [...items, other];
|
|
2941
2940
|
};
|
|
2942
2941
|
const getClassified = layerInfo => {
|
|
2942
|
+
var _layerInfo$style2, _layerInfo$style2$chi;
|
|
2943
|
+
|
|
2944
|
+
if ((_layerInfo$style2 = layerInfo.style) != null && (_layerInfo$style2$chi = _layerInfo$style2.children) != null && _layerInfo$style2$chi.length) {
|
|
2945
|
+
var _layerInfo$style3;
|
|
2946
|
+
|
|
2947
|
+
return {
|
|
2948
|
+
symbol: {
|
|
2949
|
+
type: 'byAttribute',
|
|
2950
|
+
defaultValue: layerInfo.style.symbol,
|
|
2951
|
+
title: null,
|
|
2952
|
+
values: (_layerInfo$style3 = layerInfo.style) == null ? void 0 : _layerInfo$style3.children
|
|
2953
|
+
}
|
|
2954
|
+
};
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2943
2957
|
const classifyParams = SYMBOL_CLASSIFICATION[layerInfo.geometryType];
|
|
2944
2958
|
return classifyParams == null ? void 0 : classifyParams.reduce((result, classified) => {
|
|
2945
|
-
var _layerInfo$
|
|
2959
|
+
var _layerInfo$style4;
|
|
2946
2960
|
|
|
2947
|
-
const param = get((_layerInfo$
|
|
2961
|
+
const param = get((_layerInfo$style4 = layerInfo.style) == null ? void 0 : _layerInfo$style4.symbol, classified);
|
|
2948
2962
|
return (param == null ? void 0 : param.type) === 'byAttribute' ? _extends({}, result, {
|
|
2949
2963
|
[classified]: param
|
|
2950
2964
|
}) : result;
|
|
@@ -3071,7 +3085,6 @@ function getAttributeType(layer, attributeName) {
|
|
|
3071
3085
|
const attribute = attributes[attributeName];
|
|
3072
3086
|
return attribute ? attribute.type : AttributeType.Unknown;
|
|
3073
3087
|
}
|
|
3074
|
-
|
|
3075
3088
|
const getClassificationValue = (parameterValue, title, condition) => _extends({
|
|
3076
3089
|
parameterValue,
|
|
3077
3090
|
title
|
|
@@ -6282,6 +6295,46 @@ const LegendSymbolRenderer = /*#__PURE__*/memo(_ref => {
|
|
|
6282
6295
|
});
|
|
6283
6296
|
});
|
|
6284
6297
|
|
|
6298
|
+
const isHiddenLegend = (hiddenCondition, hiddenLegends) => !!(hiddenLegends != null && hiddenLegends.includes(hiddenCondition));
|
|
6299
|
+
|
|
6300
|
+
const renderColumn = (column, index) => {
|
|
6301
|
+
const dateTime = column.split(' ');
|
|
6302
|
+
return React.createElement(Fragment, {
|
|
6303
|
+
key: index
|
|
6304
|
+
}, React.createElement(ItemText, {
|
|
6305
|
+
title: column
|
|
6306
|
+
}, dateTime[0], React.createElement(MapLegendDescription, null, dateTime[1])), index === 0 && React.createElement(ItemSeparator, null));
|
|
6307
|
+
};
|
|
6308
|
+
|
|
6309
|
+
const getLegendText = _ref => {
|
|
6310
|
+
let {
|
|
6311
|
+
title,
|
|
6312
|
+
index,
|
|
6313
|
+
isDate
|
|
6314
|
+
} = _ref;
|
|
6315
|
+
|
|
6316
|
+
if (!title) {
|
|
6317
|
+
return React.createElement(ItemText, null, "\u0414\u0440\u0443\u0433\u043E\u0435");
|
|
6318
|
+
}
|
|
6319
|
+
|
|
6320
|
+
const columns = title == null ? void 0 : title.split(' - ');
|
|
6321
|
+
const isSingleColumn = (columns == null ? void 0 : columns.length) === 1;
|
|
6322
|
+
|
|
6323
|
+
if (!isDate || index && isSingleColumn) {
|
|
6324
|
+
return React.createElement(ItemText, {
|
|
6325
|
+
title: title
|
|
6326
|
+
}, title);
|
|
6327
|
+
}
|
|
6328
|
+
|
|
6329
|
+
if (!index && isSingleColumn) {
|
|
6330
|
+
return React.createElement(React.Fragment, null, React.createElement(ItemText, {
|
|
6331
|
+
title: "\u221E"
|
|
6332
|
+
}, "\u221E"), React.createElement(ItemSeparator, null), renderColumn(title));
|
|
6333
|
+
}
|
|
6334
|
+
|
|
6335
|
+
return React.createElement(React.Fragment, null, columns.map(renderColumn));
|
|
6336
|
+
};
|
|
6337
|
+
|
|
6285
6338
|
const MaximizedLegend = _ref => {
|
|
6286
6339
|
let {
|
|
6287
6340
|
innerRef,
|
|
@@ -6300,37 +6353,6 @@ const MaximizedLegend = _ref => {
|
|
|
6300
6353
|
const isStrokeWidth = isParameterType(['strokeWidth', 'stroke.width'], parameter);
|
|
6301
6354
|
const isStrokeColor = isParameterType(['strokeColor', 'stroke.color'], parameter);
|
|
6302
6355
|
const parameterValue = useMemo(() => get(sectionSymbol, parameter), [sectionSymbol, parameter]);
|
|
6303
|
-
const renderColumn = useCallback((column, index) => {
|
|
6304
|
-
const dateTime = column.split(' ');
|
|
6305
|
-
return React.createElement(Fragment, {
|
|
6306
|
-
key: index
|
|
6307
|
-
}, React.createElement(ItemText, {
|
|
6308
|
-
title: column
|
|
6309
|
-
}, dateTime[0], React.createElement(MapLegendDescription, null, dateTime[1])), index === 0 && React.createElement(ItemSeparator, null));
|
|
6310
|
-
}, []);
|
|
6311
|
-
const renderItemText = useCallback((title, index) => {
|
|
6312
|
-
if (!title) {
|
|
6313
|
-
return React.createElement(ItemText, null, "\u0414\u0440\u0443\u0433\u043E\u0435");
|
|
6314
|
-
}
|
|
6315
|
-
|
|
6316
|
-
const columns = title == null ? void 0 : title.split(' - ');
|
|
6317
|
-
const isSingleColumn = (columns == null ? void 0 : columns.length) === 1;
|
|
6318
|
-
|
|
6319
|
-
if (!isDate || index && isSingleColumn) {
|
|
6320
|
-
return React.createElement(ItemText, {
|
|
6321
|
-
title: title
|
|
6322
|
-
}, title);
|
|
6323
|
-
}
|
|
6324
|
-
|
|
6325
|
-
if (!index && isSingleColumn) {
|
|
6326
|
-
return React.createElement(React.Fragment, null, React.createElement(ItemText, {
|
|
6327
|
-
title: "\u221E"
|
|
6328
|
-
}, "\u221E"), React.createElement(ItemSeparator, null), renderColumn(title));
|
|
6329
|
-
}
|
|
6330
|
-
|
|
6331
|
-
return React.createElement(React.Fragment, null, columns.map(renderColumn));
|
|
6332
|
-
}, [isDate, renderColumn]);
|
|
6333
|
-
const isHidden = useCallback(hiddenCondition => !!(hiddenLegends != null && hiddenLegends.includes(hiddenCondition)), [hiddenLegends]);
|
|
6334
6356
|
const renderLegend = useCallback((_ref2, index) => {
|
|
6335
6357
|
var _parameterValue$value;
|
|
6336
6358
|
|
|
@@ -6343,7 +6365,7 @@ const MaximizedLegend = _ref => {
|
|
|
6343
6365
|
const isClusterFillColor$1 = isClusterFillColor(symbol, parameter);
|
|
6344
6366
|
return React.createElement(ClassifiedItem, {
|
|
6345
6367
|
key: sectionIndex + title + index,
|
|
6346
|
-
isHidden:
|
|
6368
|
+
isHidden: isHiddenLegend(hiddenCondition, hiddenLegends),
|
|
6347
6369
|
isClusterFillColor: isClusterFillColor$1,
|
|
6348
6370
|
onClick: () => toggleHiddenLegend == null ? void 0 : toggleHiddenLegend(layerName, hiddenCondition)
|
|
6349
6371
|
}, isSize || isStrokeWidth || isStrokeColor ? React.createElement(MapLegendItems, {
|
|
@@ -6359,8 +6381,12 @@ const MaximizedLegend = _ref => {
|
|
|
6359
6381
|
parameter: parameter
|
|
6360
6382
|
})) : React.createElement(SymbolContainer, null, React.createElement(LegendSymbolRenderer, {
|
|
6361
6383
|
symbol: isClusterFillColor$1 ? symbol : getExtractedSymbol(symbol, true)
|
|
6362
|
-
})),
|
|
6363
|
-
|
|
6384
|
+
})), getLegendText({
|
|
6385
|
+
title,
|
|
6386
|
+
index,
|
|
6387
|
+
isDate
|
|
6388
|
+
}));
|
|
6389
|
+
}, [parameter, sectionIndex, hiddenLegends, isSize, isStrokeWidth, isStrokeColor, parameterValue, isDate, toggleHiddenLegend, layerName]);
|
|
6364
6390
|
return React.createElement(MaximizedLegendContainer, {
|
|
6365
6391
|
ref: innerRef,
|
|
6366
6392
|
isShown: isShown
|
|
@@ -6393,6 +6419,7 @@ const LegendSection = _ref => {
|
|
|
6393
6419
|
const [isExpanded, toggleExpanded] = useToggle();
|
|
6394
6420
|
const [maxRef, maxNode] = useNode();
|
|
6395
6421
|
const [minRef, minNode] = useNode();
|
|
6422
|
+
if (!attribute) return null;
|
|
6396
6423
|
return React.createElement(MapLegendSectionContainer, null, React.createElement(MapLegendHeader, null, attribute.alias || attribute.name), React.createElement(LegendParameterDescription, {
|
|
6397
6424
|
parameter: parameter
|
|
6398
6425
|
}), React.createElement(MapLegendSectionItems, {
|
|
@@ -6421,49 +6448,103 @@ const LegendSection = _ref => {
|
|
|
6421
6448
|
}, isExpanded ? 'Свернуть' : 'Развернуть'));
|
|
6422
6449
|
};
|
|
6423
6450
|
|
|
6424
|
-
const
|
|
6451
|
+
const getConditionAttribute = (attributes, condition) => {
|
|
6452
|
+
if (!condition) return null;
|
|
6453
|
+
const attributeName = getAttributeNameFromCondition(condition);
|
|
6454
|
+
let attribute = attributes.find(_ref => {
|
|
6455
|
+
let {
|
|
6456
|
+
name
|
|
6457
|
+
} = _ref;
|
|
6458
|
+
return name === attributeName;
|
|
6459
|
+
});
|
|
6460
|
+
|
|
6461
|
+
if (!attribute) {
|
|
6462
|
+
if (attributeName === 'count') {
|
|
6463
|
+
attribute = {
|
|
6464
|
+
name: 'count',
|
|
6465
|
+
alias: 'Количество',
|
|
6466
|
+
type: AttributeType.Int32
|
|
6467
|
+
};
|
|
6468
|
+
} else {
|
|
6469
|
+
return null;
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6472
|
+
|
|
6473
|
+
return attribute;
|
|
6474
|
+
};
|
|
6475
|
+
|
|
6476
|
+
const LegendChildren = _ref => {
|
|
6477
|
+
var _layerInfo$style, _layerInfo$style$chil;
|
|
6478
|
+
|
|
6479
|
+
let {
|
|
6480
|
+
layerInfo,
|
|
6481
|
+
hiddenLegends,
|
|
6482
|
+
toggleHiddenLegend,
|
|
6483
|
+
formatValue
|
|
6484
|
+
} = _ref;
|
|
6485
|
+
if (!((_layerInfo$style = layerInfo.style) != null && (_layerInfo$style$chil = _layerInfo$style.children) != null && _layerInfo$style$chil.length)) return null;
|
|
6486
|
+
const attributes = getLayerAttributes(layerInfo.layerDefinition);
|
|
6487
|
+
return React.createElement(MapLegendContainer, null, layerInfo.style.children.map((paramValue, index) => {
|
|
6488
|
+
var _getConditionAttribut;
|
|
6489
|
+
|
|
6490
|
+
const attribute = getConditionAttribute(attributes, paramValue.condition);
|
|
6491
|
+
if (!attribute) return null;
|
|
6492
|
+
const hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.symbol, paramValue.title, new ClassificationCondition(paramValue.condition)));
|
|
6493
|
+
const legendText = getLegendText({
|
|
6494
|
+
title: isRangeCondition(paramValue.condition) ? createValueTitleFromCondition(paramValue, attribute, formatValue, index) : getTitleFromCondition(paramValue.condition),
|
|
6495
|
+
index,
|
|
6496
|
+
isDate: ((_getConditionAttribut = getConditionAttribute(attributes, paramValue.condition)) == null ? void 0 : _getConditionAttribut.type) === 'DateTime'
|
|
6497
|
+
});
|
|
6498
|
+
return React.createElement(ClassifiedItem, {
|
|
6499
|
+
key: index,
|
|
6500
|
+
isHidden: isHiddenLegend(hiddenCondition, hiddenLegends == null ? void 0 : hiddenLegends[layerInfo.name]),
|
|
6501
|
+
onClick: () => toggleHiddenLegend == null ? void 0 : toggleHiddenLegend(layerInfo.name, hiddenCondition)
|
|
6502
|
+
}, React.createElement(SymbolContainer, null, React.createElement(LegendSymbolRenderer, {
|
|
6503
|
+
symbol: paramValue.symbol
|
|
6504
|
+
})), legendText);
|
|
6505
|
+
}));
|
|
6506
|
+
};
|
|
6507
|
+
|
|
6508
|
+
const _excluded$3 = ["layerInfo", "formatValue", "hiddenLegends", "toggleHiddenLegend"];
|
|
6425
6509
|
const Legend = /*#__PURE__*/memo(_ref => {
|
|
6510
|
+
var _layerInfo$style, _layerInfo$style$chil;
|
|
6511
|
+
|
|
6426
6512
|
let {
|
|
6427
|
-
layerInfo
|
|
6513
|
+
layerInfo,
|
|
6514
|
+
formatValue,
|
|
6515
|
+
hiddenLegends,
|
|
6516
|
+
toggleHiddenLegend
|
|
6428
6517
|
} = _ref,
|
|
6429
6518
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
6430
6519
|
|
|
6520
|
+
if ((_layerInfo$style = layerInfo.style) != null && (_layerInfo$style$chil = _layerInfo$style.children) != null && _layerInfo$style$chil.length) {
|
|
6521
|
+
return React.createElement(LegendChildren, {
|
|
6522
|
+
layerInfo: layerInfo,
|
|
6523
|
+
formatValue: formatValue,
|
|
6524
|
+
hiddenLegends: hiddenLegends,
|
|
6525
|
+
toggleHiddenLegend: toggleHiddenLegend
|
|
6526
|
+
});
|
|
6527
|
+
}
|
|
6528
|
+
|
|
6529
|
+
const attributes = getLayerAttributes(layerInfo.layerDefinition);
|
|
6431
6530
|
const classified = getClassified(layerInfo);
|
|
6432
6531
|
if (!classified) return null;
|
|
6433
6532
|
const parameters = Object.keys(classified);
|
|
6434
|
-
const attributes = getLayerAttributes(layerInfo.layerDefinition);
|
|
6435
6533
|
return React.createElement(MapLegendContainer, null, Object.keys(classified).map((param, index) => {
|
|
6436
|
-
var _classified$param
|
|
6437
|
-
|
|
6438
|
-
const attributeName = getAttributeNameFromCondition((_classified$param$val = classified[param].values[0]) == null ? void 0 : _classified$param$val.condition);
|
|
6439
|
-
let attribute = attributes.find(_ref2 => {
|
|
6440
|
-
let {
|
|
6441
|
-
name
|
|
6442
|
-
} = _ref2;
|
|
6443
|
-
return name === attributeName;
|
|
6444
|
-
});
|
|
6445
|
-
|
|
6446
|
-
if (!attribute) {
|
|
6447
|
-
if (attributeName === 'count') {
|
|
6448
|
-
attribute = {
|
|
6449
|
-
name: 'count',
|
|
6450
|
-
alias: 'Количество',
|
|
6451
|
-
type: AttributeType.Int32
|
|
6452
|
-
};
|
|
6453
|
-
} else {
|
|
6454
|
-
return null;
|
|
6455
|
-
}
|
|
6456
|
-
}
|
|
6534
|
+
var _layerInfo$style2, _classified$param, _classified$param$val;
|
|
6457
6535
|
|
|
6458
6536
|
return React.createElement(LegendSection, Object.assign({
|
|
6459
6537
|
key: index,
|
|
6460
6538
|
layerName: layerInfo.name,
|
|
6461
|
-
symbol: (_layerInfo$
|
|
6462
|
-
attribute:
|
|
6539
|
+
symbol: (_layerInfo$style2 = layerInfo.style) == null ? void 0 : _layerInfo$style2.symbol,
|
|
6540
|
+
attribute: getConditionAttribute(attributes, (_classified$param = classified[param]) == null ? void 0 : (_classified$param$val = _classified$param.values[0]) == null ? void 0 : _classified$param$val.condition),
|
|
6463
6541
|
classified: classified[param],
|
|
6464
6542
|
parameter: param,
|
|
6465
6543
|
parameters: parameters,
|
|
6466
|
-
index: index
|
|
6544
|
+
index: index,
|
|
6545
|
+
formatValue: formatValue,
|
|
6546
|
+
hiddenLegends: hiddenLegends,
|
|
6547
|
+
toggleHiddenLegend: toggleHiddenLegend
|
|
6467
6548
|
}, rest));
|
|
6468
6549
|
}));
|
|
6469
6550
|
});
|
|
@@ -6870,5 +6951,5 @@ const DraggableMarker = _ref => {
|
|
|
6870
6951
|
return React.createElement(Fragment, null);
|
|
6871
6952
|
};
|
|
6872
6953
|
|
|
6873
|
-
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, dateComparisonOperators, defaultOffset, defineStrokeStylePreset, deserializeSymbol, evaluateFeature, extractStyle, extractSymbol, findChildFeatureStyle, findChildFeatureSymbol, formatArea, formatAttributeValue, formatDate, formatLength, formatPolygonMeasure, formatRangeClassValue, formatUniqueClassValue, getAttributeFromCondition, getAttributeNameFromClassified, getAttributeNameFromCondition, getAttributeType, getAttributesConfiguration, getChildSymbols, 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 };
|
|
6954
|
+
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 };
|
|
6874
6955
|
//# sourceMappingURL=react.esm.js.map
|