@evergis/react 2.0.156 → 2.0.158

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.
@@ -1,4 +1,5 @@
1
1
  export * from './MapLegend';
2
2
  export * from './MapLegendSymbol';
3
3
  export * from './MapLegendDescription';
4
- export { MapLegendContainer, MapLegendHeader, MapLegendValueDescr, MapLegendExpandButton, MapLegendValues, MapLegendItem, SizeMinimizedLegendDown, SizeMinimizedLegendUp, MapLegendDescriptionContainer, } from './styled';
4
+ export * from './MinimizedLegend';
5
+ export { MapLegendContainer, MapLegendHeader, MapLegendValueDescr, MapLegendExpandButton, MapLegendValues, MapLegendItems, MapLegendItem, MapLegendOther, SizeMinimizedLegendDown, SizeMinimizedLegendUp, MapLegendDescriptionContainer, } from './styled';
@@ -1,30 +1,27 @@
1
+ import { ClassificationParameterExtended } from "../../core";
2
+ import { MapLegendItemProps } from "./types";
1
3
  export declare const MapLegendControl: import("styled-components").StyledComponent<"div", any, {}, never>;
2
4
  export declare const MapLegendContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
5
  export declare const MapLegendHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
4
6
  export declare const MapLegendDescriptionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
7
  export declare const MinimizedLegendContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
8
  export declare const MapLegendValueDescr: import("styled-components").StyledComponent<"div", any, {}, never>;
7
- export declare const MapLegendItem: import("styled-components").StyledComponent<"div", any, {
8
- value?: string | number | undefined;
9
- parameter?: "symbol" | "height" | "width" | "strokeWidth" | "size" | "fill.color" | "fill.hatchColor" | "stroke.width" | "stroke.color" | "background.fillColor" | "background.strokeColor" | "background.strokeWidth" | "figure.fillColor" | "fillColor" | "strokeColor" | "angle" | "maskedColor" | undefined;
10
- }, never>;
11
- export declare const MapLegendOther: import("styled-components").StyledComponent<"div", any, {
12
- value?: string | number | undefined;
13
- parameter?: "symbol" | "height" | "width" | "strokeWidth" | "size" | "fill.color" | "fill.hatchColor" | "stroke.width" | "stroke.color" | "background.fillColor" | "background.strokeColor" | "background.strokeWidth" | "figure.fillColor" | "fillColor" | "strokeColor" | "angle" | "maskedColor" | undefined;
14
- }, never>;
9
+ export declare const MapLegendItem: import("styled-components").StyledComponent<"div", any, MapLegendItemProps, never>;
10
+ export declare const MapLegendOther: import("styled-components").StyledComponent<"div", any, MapLegendItemProps, never>;
15
11
  export declare const SizeMinimizedLegend: import("styled-components").StyledComponent<"div", any, {}, never>;
16
12
  export declare const SizeMinimizedLegendSymbol: import("styled-components").StyledComponent<"div", any, {}, never>;
17
13
  export declare const SizeMinimizedLegendLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
18
14
  export declare const SizeMinimizedLegendDown: import("styled-components").StyledComponent<"div", any, {}, never>;
19
15
  export declare const SizeMinimizedLegendUp: import("styled-components").StyledComponent<"div", any, {}, never>;
20
16
  export declare const MapLegendItems: import("styled-components").StyledComponent<"div", any, {
17
+ parameter: ClassificationParameterExtended;
21
18
  isSize?: boolean | undefined;
22
19
  isStrokeWidth?: boolean | undefined;
20
+ isStrokeColor?: boolean | undefined;
21
+ isSingle?: boolean | undefined;
23
22
  }, never>;
23
+ export declare const MapLegendItemsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
24
24
  export declare const MapLegendValues: import("styled-components").StyledComponent<"div", any, {}, never>;
25
25
  export declare const MapLegendValuesRange: import("styled-components").StyledComponent<"div", any, {}, never>;
26
- export declare const MapLegendValuesOther: import("styled-components").StyledComponent<"div", any, {
27
- value?: string | number | undefined;
28
- parameter?: "symbol" | "height" | "width" | "strokeWidth" | "size" | "fill.color" | "fill.hatchColor" | "stroke.width" | "stroke.color" | "background.fillColor" | "background.strokeColor" | "background.strokeWidth" | "figure.fillColor" | "fillColor" | "strokeColor" | "angle" | "maskedColor" | undefined;
29
- }, never>;
26
+ export declare const MapLegendValuesOther: import("styled-components").StyledComponent<"div", any, MapLegendItemProps, never>;
30
27
  export declare const MapLegendExpandButton: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -12,4 +12,10 @@ export declare type MinimizedLegendProps = {
12
12
  defaultValue: string;
13
13
  values: LegendValueType[];
14
14
  parameter: ClassificationParameterExtended;
15
+ hiddenLegends?: string[];
16
+ };
17
+ export declare type MapLegendItemProps = {
18
+ value?: string | number;
19
+ parameter?: ClassificationParameterExtended;
20
+ isHidden?: boolean;
15
21
  };
@@ -7,6 +7,7 @@ import { CompositeSymbolType, ParameterValueWithSymbol, StyleSymbolType, Unclass
7
7
  export declare type LegendValueType = {
8
8
  title: string;
9
9
  parameterValue: ParameterValueWithSymbol;
10
+ hiddenCondition?: string;
10
11
  };
11
12
  export declare type LegendItem = {
12
13
  attribute?: ClassificationAttribute;
@@ -4885,7 +4885,7 @@ const Legend = _ref => {
4885
4885
  } = legend || {};
4886
4886
 
4887
4887
  if (!legend && !renderCustomLegend) {
4888
- return React__default.createElement(React__default.Fragment, null);
4888
+ return null;
4889
4889
  }
4890
4890
 
4891
4891
  return React__default.createElement(LegendProvider, {
@@ -5027,7 +5027,7 @@ const Fullscreen = () => {
5027
5027
  }));
5028
5028
  };
5029
5029
 
5030
- var _templateObject$6, _templateObject2$6, _templateObject3$4, _templateObject4$4, _templateObject5$4, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22;
5030
+ var _templateObject$6, _templateObject2$6, _templateObject3$4, _templateObject4$4, _templateObject5$4, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26;
5031
5031
  const MapLegendControl = /*#__PURE__*/styled__default(MapControl)(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: default;\n"])));
5032
5032
  const MapLegendContainer = /*#__PURE__*/styled__default.div(_templateObject2$6 || (_templateObject2$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 12.5rem;\n padding-bottom: 1rem;\n box-sizing: border-box;\n\n canvas {\n height: 1.625rem;\n width: 1.625rem;\n }\n"])));
5033
5033
  const MapLegendHeader = /*#__PURE__*/styled__default(LegendSectionHeader)(_templateObject3$4 || (_templateObject3$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: 15rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n"])));
@@ -5040,7 +5040,7 @@ const SizeLegendItemMixin = function SizeLegendItemMixin(value) {
5040
5040
  value = 0;
5041
5041
  }
5042
5042
 
5043
- return styled.css(_templateObject7$2 || (_templateObject7$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 50%;\n flex: none;\n height: inherit;\n width: inherit;\n margin: 0 0 0 -1rem;\n background: none;\n border: none;\n\n :after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 50%;\n border: 1px rgba(48, 69, 79, 0.28) solid;\n border-radius: 50%;\n margin: 0 0 0 -", "px;\n width: ", "px;\n height: ", "px;\n }\n"])), value / 2, value, value);
5043
+ return styled.css(_templateObject7$2 || (_templateObject7$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 50%;\n flex: none;\n height: inherit;\n width: inherit;\n margin: 0 auto;\n background: none;\n border: none;\n\n :after {\n content: \"\";\n display: flex;\n border: 1px rgba(48, 69, 79, 0.28) solid;\n border-radius: 50%;\n margin: 0 0 0 -", "px;\n width: ", "px;\n height: ", "px;\n }\n"])), value / 2, value, value);
5044
5044
  };
5045
5045
 
5046
5046
  const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
@@ -5048,10 +5048,11 @@ const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
5048
5048
  value = 0;
5049
5049
  }
5050
5050
 
5051
- return styled.css(_templateObject8$2 || (_templateObject8$2 = _taggedTemplateLiteralLoose(["\n position: relative;\n background: none;\n border: none;\n display: flex;\n align-items: center;\n flex: none;\n min-height: 1rem;\n height: auto;\n width: calc(100% - 2rem);\n margin: 0 0 0.25rem 0;\n padding-left: 2rem;\n font-size: 0.75rem;\n \n :after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 0;\n width: 1.5rem;\n height: ", "px;\n margin-top: -", ";\n background: rgb(224, 224, 224);\n }\n"])), value, Math.round(value / 2));
5051
+ return styled.css(_templateObject8$2 || (_templateObject8$2 = _taggedTemplateLiteralLoose(["\n position: relative;\n background: none;\n border: none;\n display: flex;\n align-items: center;\n flex: none;\n width: calc(100% - 2rem);\n height: ", "px;\n margin: 0 0 0.25rem 0;\n padding-left: 2rem;\n font-size: 0.75rem;\n \n :first-child, :last-child {\n height: auto;\n }\n \n :after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 0;\n width: 1.5rem;\n height: ", "px;\n margin-top: -", "px;\n background: rgb(224, 224, 224);\n }\n"])), value, value, Math.round(value / 2));
5052
5052
  };
5053
5053
 
5054
- const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject9$1 || (_templateObject9$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n height: ", "rem;\n background: ", ";\n border: 1px rgba(48, 69, 79, 0.1) solid;\n margin-right: -1px;\n\n ", "\n\n ", "\n"])), _ref => {
5054
+ const StrokeColorLegendItemMixin = /*#__PURE__*/styled.css(_templateObject9$1 || (_templateObject9$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 0.5rem;\n width: 1.5rem;\n"])));
5055
+ const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject10$1 || (_templateObject10$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n height: ", "rem;\n background: ", ";\n border: 1px rgba(48, 69, 79, 0.1) solid;\n margin-right: -1px;\n opacity: ", ";\n\n ", "\n\n ", "\n"])), _ref => {
5055
5056
  let {
5056
5057
  parameter
5057
5058
  } = _ref;
@@ -5063,40 +5064,107 @@ const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject9$1 || (_t
5063
5064
  return typeof value === "number" ? "none" : value;
5064
5065
  }, _ref3 => {
5065
5066
  let {
5066
- value,
5067
- parameter
5067
+ isHidden
5068
5068
  } = _ref3;
5069
- return isParameterType("size", parameter) && SizeLegendItemMixin(value);
5069
+ return isHidden ? 0.28 : 1;
5070
5070
  }, _ref4 => {
5071
5071
  let {
5072
5072
  value,
5073
5073
  parameter
5074
5074
  } = _ref4;
5075
+ return isParameterType("size", parameter) && SizeLegendItemMixin(value);
5076
+ }, _ref5 => {
5077
+ let {
5078
+ value,
5079
+ parameter
5080
+ } = _ref5;
5075
5081
  return isParameterType(["strokeWidth", "stroke.width"], parameter) && StrokeWidthLegendItemMixin(value);
5076
5082
  });
5077
- const MapLegendOther = /*#__PURE__*/styled__default(MapLegendItem)(_templateObject10$1 || (_templateObject10$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: none;\n position: relative;\n width: 1rem;\n margin-left: 0.25rem;\n border-radius: 0.125rem;\n"])));
5078
- const SizeLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject11$1 || (_templateObject11$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 2rem;\n height: 2rem;\n margin: 0 auto;\n\n ", " {\n width: auto;\n margin-left: 0;\n }\n"])), MapLegendOther);
5079
- const StrokeWidthLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject12$1 || (_templateObject12$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n flex-direction: column;\n\n ", " {\n width: calc(100% - 2rem);\n margin-left: 0;\n }\n"])), MapLegendOther);
5080
- const SizeMinimizedLegend = /*#__PURE__*/styled__default.div(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n margin-top: 0.5rem;\n"])));
5081
- const SizeMinimizedLegendSymbol = /*#__PURE__*/styled__default.div(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n"])));
5082
- const SizeMinimizedLegendLabel = /*#__PURE__*/styled__default.div(_templateObject15$1 || (_templateObject15$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
5083
- const SizeMinimizedLegendDown = /*#__PURE__*/styled__default.div(_templateObject16$1 || (_templateObject16$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.28;\n"])));
5084
- const SizeMinimizedLegendUp = /*#__PURE__*/styled__default.div(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
5085
- const MapLegendItems = /*#__PURE__*/styled__default.div(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n ", ";\n"])), _ref5 => {
5083
+ const MapLegendOther = /*#__PURE__*/styled__default(MapLegendItem)(_templateObject11$1 || (_templateObject11$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: none;\n position: relative;\n width: 1rem;\n margin-left: 0.25rem;\n border-radius: 0.125rem;\n"])));
5084
+ const SizeLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject12$1 || (_templateObject12$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 2rem;\n height: 2rem;\n margin: 0 auto;\n\n ", " {\n width: auto;\n margin-left: 0;\n }\n"])), MapLegendOther);
5085
+ const StrokeWidthLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n flex-direction: column;\n width: auto;\n\n ", " {\n width: calc(100% - 2rem);\n margin-left: 0;\n }\n"])), MapLegendOther);
5086
+ const SizeMinimizedLegend = /*#__PURE__*/styled__default.div(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n margin-top: 0.5rem;\n"])));
5087
+ const SizeMinimizedLegendSymbol = /*#__PURE__*/styled__default.div(_templateObject15$1 || (_templateObject15$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n"])));
5088
+ const SizeMinimizedLegendLabel = /*#__PURE__*/styled__default.div(_templateObject16$1 || (_templateObject16$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
5089
+ const SizeMinimizedLegendDown = /*#__PURE__*/styled__default.div(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
5090
+ const SizeMinimizedLegendUp = /*#__PURE__*/styled__default(SizeMinimizedLegendDown)(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
5091
+ const SingleSizeLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n\n ", ":after {\n margin: 0 auto;\n }\n"])), MapLegendItem);
5092
+ const SingleLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n justify-content: center;\n width: 2rem;\n margin: 0;\n ", "\n \n ", " {\n position: relative;\n top: 0;\n left: 0;\n display: flex;\n align-content: center;\n justify-content: center;\n margin: 0;\n height: auto;\n width: auto;\n\n ", "\n }\n"])), _ref6 => {
5086
5093
  let {
5087
5094
  isSize
5088
- } = _ref5;
5095
+ } = _ref6;
5096
+ return isSize && SingleSizeLegendItemsMixin;
5097
+ }, MapLegendItem, _ref7 => {
5098
+ let {
5099
+ parameter
5100
+ } = _ref7;
5101
+ return isParameterType(["strokeColor", "stroke.color"], parameter) && StrokeColorLegendItemMixin;
5102
+ });
5103
+ const MapLegendItems = /*#__PURE__*/styled__default.div(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n ", ";\n ", ";\n"])), _ref8 => {
5104
+ let {
5105
+ isSize
5106
+ } = _ref8;
5089
5107
  return isSize && SizeLegendItemsMixin;
5090
- }, _ref6 => {
5108
+ }, _ref9 => {
5091
5109
  let {
5092
5110
  isStrokeWidth
5093
- } = _ref6;
5111
+ } = _ref9;
5094
5112
  return isStrokeWidth && StrokeWidthLegendItemsMixin;
5113
+ }, _ref10 => {
5114
+ let {
5115
+ isSingle
5116
+ } = _ref10;
5117
+ return isSingle && SingleLegendItemsMixin;
5095
5118
  });
5096
- const MapLegendValues = /*#__PURE__*/styled__default.div(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n font-size: 0.75rem;\n color: rgba(48, 69, 79, 0.65);\n"])));
5097
- const MapLegendValuesRange = /*#__PURE__*/styled__default.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
5098
- const MapLegendValuesOther = /*#__PURE__*/styled__default(MapLegendOther)(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
5099
- const MapLegendExpandButton = /*#__PURE__*/styled__default.div(_templateObject22 || (_templateObject22 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
5119
+ const MapLegendItemsContainer = /*#__PURE__*/styled__default.div(_templateObject22 || (_templateObject22 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n \n ", " {\n :first-child {\n border-top-left-radius: 0.125rem;\n border-bottom-left-radius: 0.125rem;\n }\n\n :last-child {\n border-top-right-radius: 0.125rem;\n border-bottom-right-radius: 0.125rem;\n }\n }\n"])), MapLegendItem);
5120
+ const MapLegendValues = /*#__PURE__*/styled__default.div(_templateObject23 || (_templateObject23 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n font-size: 0.75rem;\n color: rgba(48, 69, 79, 0.65);\n"])));
5121
+ const MapLegendValuesRange = /*#__PURE__*/styled__default.div(_templateObject24 || (_templateObject24 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: calc(100% - 1.25rem);\n \n div {\n flex: 1;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n :first-child {\n margin-right: 0.5rem;\n }\n\n :last-child {\n margin-left: 0.5rem;\n }\n }\n"])));
5122
+ const MapLegendValuesOther = /*#__PURE__*/styled__default(MapLegendOther)(_templateObject25 || (_templateObject25 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
5123
+ const MapLegendExpandButton = /*#__PURE__*/styled__default.div(_templateObject26 || (_templateObject26 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
5124
+
5125
+ const MapLegend = _ref => {
5126
+ let {
5127
+ layer,
5128
+ config,
5129
+ className,
5130
+ hideTitle
5131
+ } = _ref;
5132
+ const legend = useMapLegend(layer, config);
5133
+
5134
+ if (!legend) {
5135
+ return null;
5136
+ }
5137
+
5138
+ const {
5139
+ symbol,
5140
+ items
5141
+ } = legend;
5142
+ return React__default.createElement(LegendProvider, {
5143
+ symbol: symbol
5144
+ }, React__default.createElement(MapLegendControl, {
5145
+ className: className
5146
+ }, !hideTitle && React__default.createElement(MapLegendHeader, null, layer == null ? void 0 : layer.alias), !!items.length && React__default.createElement(MapLegendContainer, null, React__default.createElement(Legend, {
5147
+ layer: layer,
5148
+ config: config
5149
+ }))));
5150
+ };
5151
+
5152
+ const MAX_SIZE$2 = 100;
5153
+ const MapLegendSymbol = _ref => {
5154
+ let {
5155
+ value,
5156
+ parameter
5157
+ } = _ref;
5158
+ return React__default.createElement(LegendSymbol, {
5159
+ key: value.title,
5160
+ parameter: parameter,
5161
+ parameterValue: value.parameterValue
5162
+ }, symbol => React__default.createElement(Symbol, {
5163
+ render: getMapLegendSymbolRenders,
5164
+ symbol: symbol,
5165
+ size: MAX_SIZE$2
5166
+ }));
5167
+ };
5100
5168
 
5101
5169
  const MapLegendDescription = _ref => {
5102
5170
  let {
@@ -5109,14 +5177,17 @@ const MapLegendDescription = _ref => {
5109
5177
  };
5110
5178
 
5111
5179
  const getValueFromLegendTitle = (title, minOrMax) => {
5112
- var _title$split;
5113
-
5114
5180
  if (title.includes(" - ")) {
5115
5181
  const result = title == null ? void 0 : title.split(" - ");
5116
5182
  return minOrMax === "min" ? result == null ? void 0 : result[0] : result == null ? void 0 : result[1];
5117
5183
  }
5118
5184
 
5119
- return (title == null ? void 0 : (_title$split = title.split(" ")) == null ? void 0 : _title$split.find(isNumeric)) || "";
5185
+ if (title.includes(",")) {
5186
+ const result = title == null ? void 0 : title.split(",");
5187
+ return result.join(", ");
5188
+ }
5189
+
5190
+ return title.split(" ").find(isNumeric) || title || "";
5120
5191
  };
5121
5192
 
5122
5193
  const MinimizedLegend = _ref => {
@@ -5125,7 +5196,8 @@ const MinimizedLegend = _ref => {
5125
5196
  let {
5126
5197
  values,
5127
5198
  title,
5128
- parameter
5199
+ parameter,
5200
+ hiddenLegends
5129
5201
  } = _ref;
5130
5202
  const currentValues = [...values];
5131
5203
  const other = currentValues.pop();
@@ -5133,101 +5205,52 @@ const MinimizedLegend = _ref => {
5133
5205
  const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
5134
5206
  const titleMax = getValueFromLegendTitle((_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title, "max");
5135
5207
  const titleMin = getValueFromLegendTitle((_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title, "min");
5136
- return React__default.createElement(MinimizedLegendContainer, null, !!title && React__default.createElement(MapLegendValueDescr, null, title), React__default.createElement(MapLegendDescription, {
5137
- parameter: parameter
5138
- }), isSize ? React__default.createElement(React__default.Fragment, null, React__default.createElement(SizeMinimizedLegend, null, React__default.createElement(SizeMinimizedLegendSymbol, null, React__default.createElement(MapLegendItems, {
5208
+ const checkIsHidden = React.useCallback(hiddenCondition => hiddenCondition ? hiddenLegends == null ? void 0 : hiddenLegends.some(condition => hiddenCondition.includes(condition)) : false, [hiddenLegends]);
5209
+ return React__default.createElement(MinimizedLegendContainer, null, !!title && React__default.createElement(MapLegendValueDescr, null, title), isSize ? React__default.createElement(React__default.Fragment, null, React__default.createElement(SizeMinimizedLegend, null, React__default.createElement(SizeMinimizedLegendSymbol, null, React__default.createElement(MapLegendItems, {
5210
+ parameter: parameter,
5139
5211
  isSize: true
5140
5212
  }, currentValues.map((value, index) => React__default.createElement(MapLegendItem, {
5141
5213
  key: "" + value.title + index,
5142
5214
  title: value.title,
5143
5215
  value: value.parameterValue,
5144
- parameter: parameter
5216
+ parameter: parameter,
5217
+ isHidden: checkIsHidden(value.hiddenCondition)
5145
5218
  })))), React__default.createElement(SizeMinimizedLegendLabel, null, React__default.createElement(SizeMinimizedLegendDown, null, (_currentValues$2 = currentValues[0]) == null ? void 0 : _currentValues$2.title), React__default.createElement(SizeMinimizedLegendUp, null, (_currentValues2 = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues2.title))), React__default.createElement(SizeMinimizedLegend, null, React__default.createElement(SizeMinimizedLegendSymbol, null, React__default.createElement(MapLegendItems, {
5219
+ parameter: parameter,
5146
5220
  isSize: true
5147
5221
  }, React__default.createElement(MapLegendOther, {
5148
5222
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5149
5223
  value: other == null ? void 0 : other.parameterValue,
5150
- parameter: parameter
5224
+ parameter: parameter,
5225
+ isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
5151
5226
  }))), React__default.createElement(SizeMinimizedLegendLabel, null, React__default.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : isStrokeWidth ? React__default.createElement(MapLegendItems, {
5227
+ parameter: parameter,
5152
5228
  isStrokeWidth: true
5153
5229
  }, currentValues.map((value, index) => React__default.createElement(MapLegendItem, {
5154
5230
  key: "" + value.title + index,
5155
5231
  title: value.title,
5156
5232
  value: value.parameterValue,
5157
- parameter: parameter
5233
+ parameter: parameter,
5234
+ isHidden: checkIsHidden(value.hiddenCondition)
5158
5235
  }, (!index || index === currentValues.length - 1) && value.title)), React__default.createElement(MapLegendOther, {
5159
5236
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5160
5237
  value: other == null ? void 0 : other.parameterValue,
5238
+ parameter: parameter,
5239
+ isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
5240
+ }, "\u0414\u0440\u0443\u0433\u043E\u0435")) : React__default.createElement(MapLegendItems, {
5161
5241
  parameter: parameter
5162
- }, "\u0414\u0440\u0443\u0433\u043E\u0435")) : React__default.createElement(MapLegendItems, null, currentValues.map((value, index) => React__default.createElement(MapLegendItem, {
5242
+ }, React__default.createElement(MapLegendItemsContainer, null, currentValues.map((value, index) => React__default.createElement(MapLegendItem, {
5163
5243
  key: "" + value.title + index,
5164
5244
  title: value.title,
5165
5245
  value: value.parameterValue,
5166
- parameter: parameter
5167
- })), React__default.createElement(MapLegendOther, {
5246
+ parameter: parameter,
5247
+ isHidden: checkIsHidden(value.hiddenCondition)
5248
+ }))), React__default.createElement(MapLegendOther, {
5168
5249
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5169
5250
  value: other == null ? void 0 : other.parameterValue,
5170
- parameter: parameter
5171
- })), typeof (other == null ? void 0 : other.parameterValue) === "string" && (titleMax || titleMin) && React__default.createElement(MapLegendValues, null, React__default.createElement(MapLegendValuesRange, null, React__default.createElement("div", null, titleMax), React__default.createElement("div", null, titleMin)), React__default.createElement(MapLegendValuesOther, null, "-")));
5172
- };
5173
-
5174
- const MapLegend = _ref => {
5175
- let {
5176
- layer,
5177
- config,
5178
- className,
5179
- hideTitle
5180
- } = _ref;
5181
- const legend = useMapLegend(layer, config);
5182
- const [isExpanded, toggleExpanded] = useToggle();
5183
-
5184
- if (!legend) {
5185
- return null;
5186
- }
5187
-
5188
- const {
5189
- symbol,
5190
- items
5191
- } = legend;
5192
- return React__default.createElement(LegendProvider, {
5193
- symbol: symbol
5194
- }, React__default.createElement(MapLegendControl, {
5195
- className: className
5196
- }, !hideTitle && React__default.createElement(MapLegendHeader, null, layer == null ? void 0 : layer.alias), !!items.length && React__default.createElement(MapLegendContainer, null, isExpanded ? React__default.createElement(Legend, {
5197
- layer: layer,
5198
- config: config
5199
- }) : React__default.createElement(React__default.Fragment, null, items.map(item => {
5200
- var _symbol$fill;
5201
-
5202
- return React__default.createElement(React.Fragment, {
5203
- key: [layer == null ? void 0 : layer.name, item.title, item.parameter].join("-")
5204
- }, React__default.createElement(MinimizedLegend, {
5205
- values: item.values,
5206
- defaultValue: (_symbol$fill = symbol.fill) == null ? void 0 : _symbol$fill.color,
5207
- title: item.title !== (layer == null ? void 0 : layer.alias) ? item.title : "",
5208
- parameter: item.parameter
5209
- }));
5210
- })), React__default.createElement(MapLegendExpandButton, {
5211
- onClick: toggleExpanded,
5212
- "data-html2canvas-ignore": true
5213
- }, isExpanded ? "Свернуть" : "Развернуть"))));
5214
- };
5215
-
5216
- const MAX_SIZE$2 = 100;
5217
- const MapLegendSymbol = _ref => {
5218
- let {
5219
- value,
5220
- parameter
5221
- } = _ref;
5222
- return React__default.createElement(LegendSymbol, {
5223
- key: value.title,
5224
5251
  parameter: parameter,
5225
- parameterValue: value.parameterValue
5226
- }, symbol => React__default.createElement(Symbol, {
5227
- render: getMapLegendSymbolRenders,
5228
- symbol: symbol,
5229
- size: MAX_SIZE$2
5230
- }));
5252
+ isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
5253
+ })), typeof (other == null ? void 0 : other.parameterValue) === "string" && (titleMax || titleMin) && React__default.createElement(MapLegendValues, null, React__default.createElement(MapLegendValuesRange, null, React__default.createElement("div", null, titleMax), React__default.createElement("div", null, titleMin)), React__default.createElement(MapLegendValuesOther, null, "-")));
5231
5254
  };
5232
5255
 
5233
5256
  let MeasureTool = /*#__PURE__*/function (_React$Component) {
@@ -5659,6 +5682,8 @@ exports.MapLegendDescriptionContainer = MapLegendDescriptionContainer;
5659
5682
  exports.MapLegendExpandButton = MapLegendExpandButton;
5660
5683
  exports.MapLegendHeader = MapLegendHeader;
5661
5684
  exports.MapLegendItem = MapLegendItem;
5685
+ exports.MapLegendItems = MapLegendItems;
5686
+ exports.MapLegendOther = MapLegendOther;
5662
5687
  exports.MapLegendSymbol = MapLegendSymbol;
5663
5688
  exports.MapLegendValueDescr = MapLegendValueDescr;
5664
5689
  exports.MapLegendValues = MapLegendValues;
@@ -5666,6 +5691,7 @@ exports.MapProvider = MapProvider;
5666
5691
  exports.Measure = Measure;
5667
5692
  exports.MeasureTool = MeasureTool;
5668
5693
  exports.Measurer = Measurer;
5694
+ exports.MinimizedLegend = MinimizedLegend;
5669
5695
  exports.NO_CONTENT_VALUE = NO_CONTENT_VALUE;
5670
5696
  exports.Noop = Noop;
5671
5697
  exports.PREVIEW_LIMITS = PREVIEW_LIMITS;