@evergis/react 2.0.191 → 2.0.193
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 +238 -141
- 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 +237 -142
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/legend.d.ts +12 -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
|
};
|
|
@@ -2583,14 +2583,20 @@ const checkLayerHasLegend = layerInfo => {
|
|
|
2583
2583
|
return (paramValue == null ? void 0 : paramValue.type) === 'byAttribute';
|
|
2584
2584
|
})) || false;
|
|
2585
2585
|
};
|
|
2586
|
-
const getTitleFromCondition =
|
|
2586
|
+
const getTitleFromCondition = _ref2 => {
|
|
2587
2587
|
var _parts$;
|
|
2588
2588
|
|
|
2589
|
-
|
|
2590
|
-
|
|
2589
|
+
let {
|
|
2590
|
+
condition,
|
|
2591
|
+
attribute,
|
|
2592
|
+
formatValue
|
|
2593
|
+
} = _ref2;
|
|
2594
|
+
const parts = condition == null ? void 0 : condition.split(' == ');
|
|
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) : '';
|
|
2591
2597
|
};
|
|
2592
|
-
|
|
2593
|
-
|
|
2598
|
+
function createValueTitleFromCondition(paramValue, attribute, formatValue, index) {
|
|
2599
|
+
if (!attribute) return '';
|
|
2594
2600
|
if (paramValue.title) return paramValue.title;
|
|
2595
2601
|
const value = {
|
|
2596
2602
|
parameterValue: getParameterValue(paramValue.value),
|
|
@@ -2607,7 +2613,6 @@ function createValueTitle$1(paramValue, attribute, formatValue, index) {
|
|
|
2607
2613
|
// пункт "Настраиваемые значения параметров символики в системе"
|
|
2608
2614
|
// Для добавления подготовленных значений размеров символов нужно использовать константу PREPARED_SYMBOL_SIZES
|
|
2609
2615
|
|
|
2610
|
-
|
|
2611
2616
|
const DEFAULT_LEGEND_STYLES = {
|
|
2612
2617
|
[0
|
|
2613
2618
|
/* Point */
|
|
@@ -2902,12 +2907,14 @@ const getMinimizedLegendValues = (attribute, classified, formatValue, index, oth
|
|
|
2902
2907
|
const to = getValueFromConditionPart(paramValue.condition, 2);
|
|
2903
2908
|
result.from = from ? isNumeric(from) ? +from : formatDate(from) : null;
|
|
2904
2909
|
result.to = to ? isNumeric(to) ? +to : formatDate(to) : null;
|
|
2905
|
-
result.title =
|
|
2910
|
+
result.title = createValueTitleFromCondition(paramValue, attribute, formatValue, index);
|
|
2906
2911
|
return result;
|
|
2907
2912
|
}
|
|
2908
2913
|
|
|
2909
2914
|
result.uniqueValue = formatValue ? formatValue(attribute.type, paramValue.value, attribute.stringFormat) : paramValue.value.toString();
|
|
2910
|
-
result.title = getTitleFromCondition(
|
|
2915
|
+
result.title = getTitleFromCondition({
|
|
2916
|
+
condition: paramValue.condition
|
|
2917
|
+
});
|
|
2911
2918
|
result.hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.value, result.title, new ClassificationCondition(paramValue.condition)));
|
|
2912
2919
|
return result;
|
|
2913
2920
|
});
|
|
@@ -2928,7 +2935,9 @@ const getMaximizedLegendValues = (attribute, param, params, classified, symbol,
|
|
|
2928
2935
|
const result = {
|
|
2929
2936
|
symbol: createLegendSymbol(paramValue.value, param, params, symbol)
|
|
2930
2937
|
};
|
|
2931
|
-
result.title = isRangeCondition(paramValue.condition) ?
|
|
2938
|
+
result.title = isRangeCondition(paramValue.condition) ? createValueTitleFromCondition(paramValue, attribute, formatValue, sectionIndex) : getTitleFromCondition({
|
|
2939
|
+
condition: paramValue.condition
|
|
2940
|
+
});
|
|
2932
2941
|
result.hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.value, result.title, new ClassificationCondition(classified.values[index].condition)));
|
|
2933
2942
|
return result;
|
|
2934
2943
|
});
|
|
@@ -2940,11 +2949,26 @@ const getMaximizedLegendValues = (attribute, param, params, classified, symbol,
|
|
|
2940
2949
|
return [...items, other];
|
|
2941
2950
|
};
|
|
2942
2951
|
const getClassified = layerInfo => {
|
|
2952
|
+
var _layerInfo$style2, _layerInfo$style2$chi;
|
|
2953
|
+
|
|
2954
|
+
if ((_layerInfo$style2 = layerInfo.style) != null && (_layerInfo$style2$chi = _layerInfo$style2.children) != null && _layerInfo$style2$chi.length) {
|
|
2955
|
+
var _layerInfo$style3;
|
|
2956
|
+
|
|
2957
|
+
return {
|
|
2958
|
+
symbol: {
|
|
2959
|
+
type: 'byAttribute',
|
|
2960
|
+
defaultValue: layerInfo.style.symbol,
|
|
2961
|
+
title: null,
|
|
2962
|
+
values: (_layerInfo$style3 = layerInfo.style) == null ? void 0 : _layerInfo$style3.children
|
|
2963
|
+
}
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2943
2967
|
const classifyParams = SYMBOL_CLASSIFICATION[layerInfo.geometryType];
|
|
2944
2968
|
return classifyParams == null ? void 0 : classifyParams.reduce((result, classified) => {
|
|
2945
|
-
var _layerInfo$
|
|
2969
|
+
var _layerInfo$style4;
|
|
2946
2970
|
|
|
2947
|
-
const param = get((_layerInfo$
|
|
2971
|
+
const param = get((_layerInfo$style4 = layerInfo.style) == null ? void 0 : _layerInfo$style4.symbol, classified);
|
|
2948
2972
|
return (param == null ? void 0 : param.type) === 'byAttribute' ? _extends({}, result, {
|
|
2949
2973
|
[classified]: param
|
|
2950
2974
|
}) : result;
|
|
@@ -3071,7 +3095,6 @@ function getAttributeType(layer, attributeName) {
|
|
|
3071
3095
|
const attribute = attributes[attributeName];
|
|
3072
3096
|
return attribute ? attribute.type : AttributeType.Unknown;
|
|
3073
3097
|
}
|
|
3074
|
-
|
|
3075
3098
|
const getClassificationValue = (parameterValue, title, condition) => _extends({
|
|
3076
3099
|
parameterValue,
|
|
3077
3100
|
title
|
|
@@ -6282,6 +6305,46 @@ const LegendSymbolRenderer = /*#__PURE__*/memo(_ref => {
|
|
|
6282
6305
|
});
|
|
6283
6306
|
});
|
|
6284
6307
|
|
|
6308
|
+
const isHiddenLegend = (hiddenCondition, hiddenLegends) => !!(hiddenLegends != null && hiddenLegends.includes(hiddenCondition));
|
|
6309
|
+
|
|
6310
|
+
const renderColumn = (column, index) => {
|
|
6311
|
+
const dateTime = column.split(' ');
|
|
6312
|
+
return React.createElement(Fragment, {
|
|
6313
|
+
key: index
|
|
6314
|
+
}, React.createElement(ItemText, {
|
|
6315
|
+
title: column
|
|
6316
|
+
}, dateTime[0], React.createElement(MapLegendDescription, null, dateTime[1])), index === 0 && React.createElement(ItemSeparator, null));
|
|
6317
|
+
};
|
|
6318
|
+
|
|
6319
|
+
const getLegendText = _ref => {
|
|
6320
|
+
let {
|
|
6321
|
+
title,
|
|
6322
|
+
index,
|
|
6323
|
+
isDate
|
|
6324
|
+
} = _ref;
|
|
6325
|
+
|
|
6326
|
+
if (!title) {
|
|
6327
|
+
return React.createElement(ItemText, null, "\u0414\u0440\u0443\u0433\u043E\u0435");
|
|
6328
|
+
}
|
|
6329
|
+
|
|
6330
|
+
const columns = title == null ? void 0 : title.split(' - ');
|
|
6331
|
+
const isSingleColumn = (columns == null ? void 0 : columns.length) === 1;
|
|
6332
|
+
|
|
6333
|
+
if (!isDate || index && isSingleColumn) {
|
|
6334
|
+
return React.createElement(ItemText, {
|
|
6335
|
+
title: title
|
|
6336
|
+
}, title);
|
|
6337
|
+
}
|
|
6338
|
+
|
|
6339
|
+
if (!index && isSingleColumn) {
|
|
6340
|
+
return React.createElement(React.Fragment, null, React.createElement(ItemText, {
|
|
6341
|
+
title: "\u221E"
|
|
6342
|
+
}, "\u221E"), React.createElement(ItemSeparator, null), renderColumn(title));
|
|
6343
|
+
}
|
|
6344
|
+
|
|
6345
|
+
return React.createElement(React.Fragment, null, columns.map(renderColumn));
|
|
6346
|
+
};
|
|
6347
|
+
|
|
6285
6348
|
const MaximizedLegend = _ref => {
|
|
6286
6349
|
let {
|
|
6287
6350
|
innerRef,
|
|
@@ -6300,37 +6363,6 @@ const MaximizedLegend = _ref => {
|
|
|
6300
6363
|
const isStrokeWidth = isParameterType(['strokeWidth', 'stroke.width'], parameter);
|
|
6301
6364
|
const isStrokeColor = isParameterType(['strokeColor', 'stroke.color'], parameter);
|
|
6302
6365
|
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
6366
|
const renderLegend = useCallback((_ref2, index) => {
|
|
6335
6367
|
var _parameterValue$value;
|
|
6336
6368
|
|
|
@@ -6343,7 +6375,7 @@ const MaximizedLegend = _ref => {
|
|
|
6343
6375
|
const isClusterFillColor$1 = isClusterFillColor(symbol, parameter);
|
|
6344
6376
|
return React.createElement(ClassifiedItem, {
|
|
6345
6377
|
key: sectionIndex + title + index,
|
|
6346
|
-
isHidden:
|
|
6378
|
+
isHidden: isHiddenLegend(hiddenCondition, hiddenLegends),
|
|
6347
6379
|
isClusterFillColor: isClusterFillColor$1,
|
|
6348
6380
|
onClick: () => toggleHiddenLegend == null ? void 0 : toggleHiddenLegend(layerName, hiddenCondition)
|
|
6349
6381
|
}, isSize || isStrokeWidth || isStrokeColor ? React.createElement(MapLegendItems, {
|
|
@@ -6359,8 +6391,12 @@ const MaximizedLegend = _ref => {
|
|
|
6359
6391
|
parameter: parameter
|
|
6360
6392
|
})) : React.createElement(SymbolContainer, null, React.createElement(LegendSymbolRenderer, {
|
|
6361
6393
|
symbol: isClusterFillColor$1 ? symbol : getExtractedSymbol(symbol, true)
|
|
6362
|
-
})),
|
|
6363
|
-
|
|
6394
|
+
})), getLegendText({
|
|
6395
|
+
title,
|
|
6396
|
+
index,
|
|
6397
|
+
isDate
|
|
6398
|
+
}));
|
|
6399
|
+
}, [parameter, sectionIndex, hiddenLegends, isSize, isStrokeWidth, isStrokeColor, parameterValue, isDate, toggleHiddenLegend, layerName]);
|
|
6364
6400
|
return React.createElement(MaximizedLegendContainer, {
|
|
6365
6401
|
ref: innerRef,
|
|
6366
6402
|
isShown: isShown
|
|
@@ -6393,6 +6429,7 @@ const LegendSection = _ref => {
|
|
|
6393
6429
|
const [isExpanded, toggleExpanded] = useToggle();
|
|
6394
6430
|
const [maxRef, maxNode] = useNode();
|
|
6395
6431
|
const [minRef, minNode] = useNode();
|
|
6432
|
+
if (!attribute) return null;
|
|
6396
6433
|
return React.createElement(MapLegendSectionContainer, null, React.createElement(MapLegendHeader, null, attribute.alias || attribute.name), React.createElement(LegendParameterDescription, {
|
|
6397
6434
|
parameter: parameter
|
|
6398
6435
|
}), React.createElement(MapLegendSectionItems, {
|
|
@@ -6421,49 +6458,107 @@ const LegendSection = _ref => {
|
|
|
6421
6458
|
}, isExpanded ? 'Свернуть' : 'Развернуть'));
|
|
6422
6459
|
};
|
|
6423
6460
|
|
|
6424
|
-
const
|
|
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
|
+
const _excluded$3 = ["layerInfo", "formatValue", "hiddenLegends", "toggleHiddenLegend"];
|
|
6425
6523
|
const Legend = /*#__PURE__*/memo(_ref => {
|
|
6524
|
+
var _layerInfo$style, _layerInfo$style$chil;
|
|
6525
|
+
|
|
6426
6526
|
let {
|
|
6427
|
-
layerInfo
|
|
6527
|
+
layerInfo,
|
|
6528
|
+
formatValue,
|
|
6529
|
+
hiddenLegends,
|
|
6530
|
+
toggleHiddenLegend
|
|
6428
6531
|
} = _ref,
|
|
6429
6532
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
6430
6533
|
|
|
6534
|
+
if ((_layerInfo$style = layerInfo.style) != null && (_layerInfo$style$chil = _layerInfo$style.children) != null && _layerInfo$style$chil.length) {
|
|
6535
|
+
return React.createElement(LegendChildren, {
|
|
6536
|
+
layerInfo: layerInfo,
|
|
6537
|
+
formatValue: formatValue,
|
|
6538
|
+
hiddenLegends: hiddenLegends,
|
|
6539
|
+
toggleHiddenLegend: toggleHiddenLegend
|
|
6540
|
+
});
|
|
6541
|
+
}
|
|
6542
|
+
|
|
6543
|
+
const attributes = getLayerAttributes(layerInfo.layerDefinition);
|
|
6431
6544
|
const classified = getClassified(layerInfo);
|
|
6432
6545
|
if (!classified) return null;
|
|
6433
6546
|
const parameters = Object.keys(classified);
|
|
6434
|
-
const attributes = getLayerAttributes(layerInfo.layerDefinition);
|
|
6435
6547
|
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
|
-
}
|
|
6548
|
+
var _layerInfo$style2, _classified$param, _classified$param$val;
|
|
6457
6549
|
|
|
6458
6550
|
return React.createElement(LegendSection, Object.assign({
|
|
6459
6551
|
key: index,
|
|
6460
6552
|
layerName: layerInfo.name,
|
|
6461
|
-
symbol: (_layerInfo$
|
|
6462
|
-
attribute:
|
|
6553
|
+
symbol: (_layerInfo$style2 = layerInfo.style) == null ? void 0 : _layerInfo$style2.symbol,
|
|
6554
|
+
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
6555
|
classified: classified[param],
|
|
6464
6556
|
parameter: param,
|
|
6465
6557
|
parameters: parameters,
|
|
6466
|
-
index: index
|
|
6558
|
+
index: index,
|
|
6559
|
+
formatValue: formatValue,
|
|
6560
|
+
hiddenLegends: hiddenLegends,
|
|
6561
|
+
toggleHiddenLegend: toggleHiddenLegend
|
|
6467
6562
|
}, rest));
|
|
6468
6563
|
}));
|
|
6469
6564
|
});
|
|
@@ -6870,5 +6965,5 @@ const DraggableMarker = _ref => {
|
|
|
6870
6965
|
return React.createElement(Fragment, null);
|
|
6871
6966
|
};
|
|
6872
6967
|
|
|
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 };
|
|
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 };
|
|
6874
6969
|
//# sourceMappingURL=react.esm.js.map
|