@evergis/react 2.0.150 → 2.0.152

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.
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { ClassificationParameterExtended } from "../../core";
3
+ export declare const MapLegendDescription: FC<{
4
+ parameter: ClassificationParameterExtended;
5
+ }>;
@@ -1,3 +1,4 @@
1
1
  export * from './MapLegend';
2
2
  export * from './MapLegendSymbol';
3
- export { MapLegendContainer, MapLegendHeader, MapLegendValueDescr, MapLegendExpandButton, MapLegendValues, MapLegendItem, SizeMinimizedLegendDown, SizeMinimizedLegendUp, } from './styled';
3
+ export * from './MapLegendDescription';
4
+ export { MapLegendContainer, MapLegendHeader, MapLegendValueDescr, MapLegendExpandButton, MapLegendValues, MapLegendItem, SizeMinimizedLegendDown, SizeMinimizedLegendUp, MapLegendDescriptionContainer, } from './styled';
@@ -1,12 +1,16 @@
1
1
  export declare const MapLegendControl: import("styled-components").StyledComponent<"div", any, {}, never>;
2
2
  export declare const MapLegendContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
3
  export declare const MapLegendHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const MapLegendDescriptionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const MinimizedLegendContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
4
6
  export declare const MapLegendValueDescr: import("styled-components").StyledComponent<"div", any, {}, never>;
5
7
  export declare const MapLegendItem: import("styled-components").StyledComponent<"div", any, {
6
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;
7
10
  }, never>;
8
11
  export declare const MapLegendOther: import("styled-components").StyledComponent<"div", any, {
9
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;
10
14
  }, never>;
11
15
  export declare const SizeMinimizedLegend: import("styled-components").StyledComponent<"div", any, {}, never>;
12
16
  export declare const SizeMinimizedLegendSymbol: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -14,11 +18,13 @@ export declare const SizeMinimizedLegendLabel: import("styled-components").Style
14
18
  export declare const SizeMinimizedLegendDown: import("styled-components").StyledComponent<"div", any, {}, never>;
15
19
  export declare const SizeMinimizedLegendUp: import("styled-components").StyledComponent<"div", any, {}, never>;
16
20
  export declare const MapLegendItems: import("styled-components").StyledComponent<"div", any, {
17
- overlay?: boolean | undefined;
21
+ isSize?: boolean | undefined;
22
+ isStrokeWidth?: boolean | undefined;
18
23
  }, never>;
19
24
  export declare const MapLegendValues: import("styled-components").StyledComponent<"div", any, {}, never>;
20
25
  export declare const MapLegendValuesRange: import("styled-components").StyledComponent<"div", any, {}, never>;
21
26
  export declare const MapLegendValuesOther: import("styled-components").StyledComponent<"div", any, {
22
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;
23
29
  }, never>;
24
30
  export declare const MapLegendExpandButton: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { LegendProps } from "../Legend";
3
- import { LegendValueType } from "../../core";
3
+ import { ClassificationParameterExtended, LegendValueType } from "../../core";
4
4
  export declare type MapLegendProps = LegendProps & {
5
5
  fromToTitle?: [string, string];
6
6
  isExpanded?: boolean;
@@ -11,5 +11,5 @@ export declare type MinimizedLegendProps = {
11
11
  title?: string | ReactNode;
12
12
  defaultValue: string;
13
13
  values: LegendValueType[];
14
- isSize?: boolean;
14
+ parameter: ClassificationParameterExtended;
15
15
  };
package/dist/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from './utils/math';
9
9
  export * from './utils/metersToPixels';
10
10
  export * from './utils/polygonCircleFromPoint';
11
11
  export * from './utils/isNumeric';
12
+ export * from './utils/isParameterType';
@@ -1947,6 +1947,16 @@ const polygonCircleFromPoint = (center, diameter) => {
1947
1947
 
1948
1948
  const isNumeric = number => !isNaN(parseFloat(number)) && isFinite(number);
1949
1949
 
1950
+ const isParameterType = (types, parameter) => {
1951
+ var _parameter$toLowerCas;
1952
+
1953
+ return (typeof types === "string" ? parameter == null ? void 0 : (_parameter$toLowerCas = parameter.toLowerCase()) == null ? void 0 : _parameter$toLowerCas.includes(types.toLowerCase()) : types.some(type => {
1954
+ var _parameter$toLowerCas2;
1955
+
1956
+ return parameter == null ? void 0 : (_parameter$toLowerCas2 = parameter.toLowerCase()) == null ? void 0 : _parameter$toLowerCas2.includes(type.toLowerCase());
1957
+ })) || false;
1958
+ };
1959
+
1950
1960
  let CircleLineMiterRender = /*#__PURE__*/function (_LineMiterRender) {
1951
1961
  _inherits(CircleLineMiterRender, _LineMiterRender);
1952
1962
 
@@ -4885,13 +4895,13 @@ const Legend = _ref => {
4885
4895
  className: className
4886
4896
  }, searchable && searchLayer && React__default.createElement(SearchInput, {
4887
4897
  onChange: searchLayer
4888
- }), renderCustomLegend && layer ? renderCustomLegend(layer) : children ? legend && children(legend) : legend && legend.items.map(legendItem => React__default.createElement(LegendSection, {
4898
+ }), renderCustomLegend && layer ? renderCustomLegend(layer) : children ? legend && children(legend) : legend && legend.items.map((legendItem, index) => React__default.createElement(LegendSection, {
4889
4899
  key: legendItem.attribute + "-" + legendItem.parameter,
4890
4900
  item: legendItem,
4891
4901
  hideTitle: (layer == null ? void 0 : layer.alias) === legendItem.title,
4892
4902
  renderLegendTitle: config && config.renderLegendTitle
4893
4903
  }, legendValue => React__default.createElement(LegendValue, {
4894
- key: legendValue.title,
4904
+ key: legendValue.title + "-" + index,
4895
4905
  value: legendValue,
4896
4906
  parameter: legendItem.parameter,
4897
4907
  maxSize: getSymbolSize({
@@ -5018,49 +5028,88 @@ const Fullscreen = () => {
5018
5028
  }));
5019
5029
  };
5020
5030
 
5021
- 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;
5031
+ 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;
5022
5032
  const MapLegendControl = /*#__PURE__*/styled__default(MapControl)(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: default;\n"])));
5023
5033
  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"])));
5024
5034
  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"])));
5025
- const MapLegendValueDescr = /*#__PURE__*/styled__default.div(_templateObject4$4 || (_templateObject4$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 0.25rem;\n font-size: 0.75rem;\n font-weight: 600;\n line-height: 1rem;\n"])));
5026
- const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject5$4 || (_templateObject5$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n height: 1rem;\n background: ", ";\n border: 1px rgba(48, 69, 79, 0.1) solid;\n margin-right: -1px;\n \n ", "\n"])), _ref => {
5035
+ const MapLegendDescriptionContainer = /*#__PURE__*/styled__default.div(_templateObject4$4 || (_templateObject4$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 0.5rem;\n font-weight: 400;\n font-size: 0.625rem;\n color: rgba(255, 255, 255, 0.65);\n"])));
5036
+ const MinimizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObject5$4 || (_templateObject5$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :not(:first-child) {\n margin-top: 1rem;\n }\n"])));
5037
+ const MapLegendValueDescr = /*#__PURE__*/styled__default.div(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n min-height: 1rem;\n margin-bottom: 0.25rem;\n font-size: 0.75rem;\n font-weight: 600;\n line-height: 1rem;\n"])));
5038
+
5039
+ const SizeLegendItemMixin = function SizeLegendItemMixin(value) {
5040
+ if (value === void 0) {
5041
+ value = 0;
5042
+ }
5043
+
5044
+ 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);
5045
+ };
5046
+
5047
+ const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
5048
+ if (value === void 0) {
5049
+ value = 0;
5050
+ }
5051
+
5052
+ 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));
5053
+ };
5054
+
5055
+ 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 => {
5027
5056
  let {
5028
- value
5057
+ parameter
5029
5058
  } = _ref;
5030
- return typeof value === "number" ? "none" : value;
5059
+ return isParameterType(["strokeColor", "stroke.color"], parameter) ? 0.25 : 1;
5031
5060
  }, _ref2 => {
5032
5061
  let {
5033
5062
  value
5034
5063
  } = _ref2;
5035
- return !!value && typeof value === "number" && SizeLegendMixin(value);
5036
- });
5037
- const MapLegendOther = /*#__PURE__*/styled__default(MapLegendItem)(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: none;\n width: 1rem;\n margin-left: 0.25rem;\n border-radius: 0.125rem;\n"])));
5038
- const SizeOverlayLegendMixin = /*#__PURE__*/styled.css(_templateObject7$2 || (_templateObject7$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 2rem;\n height: 2rem;\n margin: 0 auto;\n \n ", ", ", " {\n flex: none;\n position: absolute;\n top: 0;\n left: 50%;\n width: inherit;\n height: inherit;\n margin-left: -1rem;\n \n :after {\n top: 0;\n margin-top: 0;\n }\n }\n"])), MapLegendItem, MapLegendOther);
5039
- const SizeMinimizedLegend = /*#__PURE__*/styled__default.div(_templateObject8$2 || (_templateObject8$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n margin-top: 0.5rem;\n \n ", " {\n margin: 0 auto;\n }\n"])), MapLegendItem);
5040
- const SizeMinimizedLegendSymbol = /*#__PURE__*/styled__default.div(_templateObject9$1 || (_templateObject9$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n"])));
5041
- const SizeMinimizedLegendLabel = /*#__PURE__*/styled__default.div(_templateObject10$1 || (_templateObject10$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
5042
- const SizeMinimizedLegendDown = /*#__PURE__*/styled__default.div(_templateObject11$1 || (_templateObject11$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.28;\n"])));
5043
- const SizeMinimizedLegendUp = /*#__PURE__*/styled__default.div(_templateObject12$1 || (_templateObject12$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
5044
- const MapLegendItems = /*#__PURE__*/styled__default.div(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n"])), _ref3 => {
5064
+ return typeof value === "number" ? "none" : value;
5065
+ }, _ref3 => {
5045
5066
  let {
5046
- overlay
5067
+ value,
5068
+ parameter
5047
5069
  } = _ref3;
5048
- return overlay && SizeOverlayLegendMixin;
5070
+ return isParameterType("size", parameter) && SizeLegendItemMixin(value);
5071
+ }, _ref4 => {
5072
+ let {
5073
+ value,
5074
+ parameter
5075
+ } = _ref4;
5076
+ return isParameterType(["strokeWidth", "stroke.width"], parameter) && StrokeWidthLegendItemMixin(value);
5049
5077
  });
5078
+ 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"])));
5079
+ 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);
5080
+ 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);
5081
+ 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"])));
5082
+ const SizeMinimizedLegendSymbol = /*#__PURE__*/styled__default.div(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n"])));
5083
+ const SizeMinimizedLegendLabel = /*#__PURE__*/styled__default.div(_templateObject15$1 || (_templateObject15$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
5084
+ const SizeMinimizedLegendDown = /*#__PURE__*/styled__default.div(_templateObject16$1 || (_templateObject16$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.28;\n"])));
5085
+ const SizeMinimizedLegendUp = /*#__PURE__*/styled__default.div(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
5086
+ 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 => {
5087
+ let {
5088
+ isSize
5089
+ } = _ref5;
5090
+ return isSize && SizeLegendItemsMixin;
5091
+ }, _ref6 => {
5092
+ let {
5093
+ isStrokeWidth
5094
+ } = _ref6;
5095
+ return isStrokeWidth && StrokeWidthLegendItemsMixin;
5096
+ });
5097
+ 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"])));
5098
+ const MapLegendValuesRange = /*#__PURE__*/styled__default.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
5099
+ const MapLegendValuesOther = /*#__PURE__*/styled__default(MapLegendOther)(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
5100
+ 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"])));
5050
5101
 
5051
- const SizeLegendMixin = function SizeLegendMixin(value) {
5052
- if (value === void 0) {
5053
- value = 0;
5054
- }
5055
-
5056
- return styled.css(_templateObject14$1 || (_templateObject14$1 = _taggedTemplateLiteralLoose(["\n position: relative;\n height: 2rem;\n background: none;\n border: none;\n margin-right: 0;\n \n :after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n border: 1px rgba(48, 69, 79, 0.28) solid;\n border-radius: 50%;\n margin: -", "px 0 0 -", "px;\n width: ", "px;\n height: ", "px;\n }\n"])), value / 2, value / 2, value, value);
5102
+ const MapLegendDescription = _ref => {
5103
+ let {
5104
+ parameter
5105
+ } = _ref;
5106
+ const isSize = isParameterType("size", parameter);
5107
+ const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
5108
+ const isStrokeColor = isParameterType(["strokeColor", "stroke.color"], parameter);
5109
+ console.info("MapLegendDescription", parameter, isSize, isStrokeWidth, isStrokeColor);
5110
+ return React__default.createElement(MapLegendDescriptionContainer, null, isStrokeWidth || isStrokeColor ? isStrokeWidth ? "Толщина обводки" : "Цвет обводки" : isSize ? "Размер знака" : "Цвет символа");
5057
5111
  };
5058
5112
 
5059
- const MapLegendValues = /*#__PURE__*/styled__default.div(_templateObject15$1 || (_templateObject15$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n font-size: 0.75rem;\n color: rgba(48, 69, 79, 0.65);\n"])));
5060
- const MapLegendValuesRange = /*#__PURE__*/styled__default.div(_templateObject16$1 || (_templateObject16$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
5061
- const MapLegendValuesOther = /*#__PURE__*/styled__default(MapLegendOther)(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
5062
- const MapLegendExpandButton = /*#__PURE__*/styled__default.div(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
5063
-
5064
5113
  const getValueFromLegendTitle = (title, minOrMax) => {
5065
5114
  var _title$split;
5066
5115
 
@@ -5073,34 +5122,55 @@ const getValueFromLegendTitle = (title, minOrMax) => {
5073
5122
  };
5074
5123
 
5075
5124
  const MinimizedLegend = _ref => {
5076
- var _currentValues$, _currentValues;
5125
+ var _currentValues$, _currentValues, _currentValues$2, _currentValues2;
5077
5126
 
5078
5127
  let {
5079
5128
  values,
5080
5129
  title,
5081
- isSize
5130
+ parameter
5082
5131
  } = _ref;
5083
5132
  const currentValues = [...values];
5084
5133
  const other = currentValues.pop();
5085
- return React__default.createElement(React__default.Fragment, 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, {
5086
- overlay: true
5087
- }, currentValues.map(value => React__default.createElement(MapLegendItem, {
5088
- key: value.title,
5134
+ const isSize = isParameterType("size", parameter);
5135
+ const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
5136
+ const titleMax = getValueFromLegendTitle((_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title, "max");
5137
+ const titleMin = getValueFromLegendTitle((_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title, "min");
5138
+ return React__default.createElement(MinimizedLegendContainer, null, !!title && React__default.createElement(MapLegendValueDescr, null, title), React__default.createElement(MapLegendDescription, {
5139
+ parameter: parameter
5140
+ }), isSize ? React__default.createElement(React__default.Fragment, null, React__default.createElement(SizeMinimizedLegend, null, React__default.createElement(SizeMinimizedLegendSymbol, null, React__default.createElement(MapLegendItems, {
5141
+ isSize: true
5142
+ }, currentValues.map((value, index) => React__default.createElement(MapLegendItem, {
5143
+ key: "" + value.title + index,
5089
5144
  title: value.title,
5090
- value: value.parameterValue
5091
- })))), React__default.createElement(SizeMinimizedLegendLabel, null, React__default.createElement(SizeMinimizedLegendDown, null, "50 \u0438 \u043C\u0435\u043D\u0435\u0435"), React__default.createElement(SizeMinimizedLegendUp, null, "\u0431\u043E\u043B\u0435\u0435 100"))), React__default.createElement(SizeMinimizedLegend, null, React__default.createElement(SizeMinimizedLegendSymbol, null, React__default.createElement(MapLegendOther, {
5145
+ value: value.parameterValue,
5146
+ parameter: parameter
5147
+ })))), 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, {
5148
+ isSize: true
5149
+ }, React__default.createElement(MapLegendOther, {
5092
5150
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5093
- value: other == null ? void 0 : other.parameterValue
5094
- })), React__default.createElement(SizeMinimizedLegendLabel, null, React__default.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : React__default.createElement(MapLegendItems, {
5095
- overlay: isSize
5096
- }, currentValues.map(value => React__default.createElement(MapLegendItem, {
5097
- key: value.title,
5151
+ value: other == null ? void 0 : other.parameterValue,
5152
+ parameter: parameter
5153
+ }))), React__default.createElement(SizeMinimizedLegendLabel, null, React__default.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : isStrokeWidth ? React__default.createElement(MapLegendItems, {
5154
+ isStrokeWidth: true
5155
+ }, currentValues.map((value, index) => React__default.createElement(MapLegendItem, {
5156
+ key: "" + value.title + index,
5157
+ title: value.title,
5158
+ value: value.parameterValue,
5159
+ parameter: parameter
5160
+ }, (!index || index === currentValues.length - 1) && value.title)), React__default.createElement(MapLegendOther, {
5161
+ title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5162
+ value: other == null ? void 0 : other.parameterValue,
5163
+ parameter: parameter
5164
+ }, "\u0414\u0440\u0443\u0433\u043E\u0435")) : React__default.createElement(MapLegendItems, null, currentValues.map((value, index) => React__default.createElement(MapLegendItem, {
5165
+ key: "" + value.title + index,
5098
5166
  title: value.title,
5099
- value: value.parameterValue
5167
+ value: value.parameterValue,
5168
+ parameter: parameter
5100
5169
  })), React__default.createElement(MapLegendOther, {
5101
5170
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5102
- value: other == null ? void 0 : other.parameterValue
5103
- })), typeof (other == null ? void 0 : other.parameterValue) === "string" && React__default.createElement(MapLegendValues, null, React__default.createElement(MapLegendValuesRange, null, React__default.createElement("div", null, getValueFromLegendTitle((_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title, "max")), React__default.createElement("div", null, getValueFromLegendTitle((_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title, "min"))), React__default.createElement(MapLegendValuesOther, null, "-")));
5171
+ value: other == null ? void 0 : other.parameterValue,
5172
+ parameter: parameter
5173
+ })), 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, "-")));
5104
5174
  };
5105
5175
 
5106
5176
  const MapLegend = _ref => {
@@ -5129,7 +5199,7 @@ const MapLegend = _ref => {
5129
5199
  layer: layer,
5130
5200
  config: config
5131
5201
  }) : React__default.createElement(React__default.Fragment, null, items.map(item => {
5132
- var _symbol$fill, _item$parameter;
5202
+ var _symbol$fill;
5133
5203
 
5134
5204
  return React__default.createElement(React.Fragment, {
5135
5205
  key: item.title
@@ -5137,7 +5207,7 @@ const MapLegend = _ref => {
5137
5207
  values: item.values,
5138
5208
  defaultValue: (_symbol$fill = symbol.fill) == null ? void 0 : _symbol$fill.color,
5139
5209
  title: item.title !== (layer == null ? void 0 : layer.alias) ? item.title : "",
5140
- isSize: (_item$parameter = item.parameter) == null ? void 0 : _item$parameter.includes("size")
5210
+ parameter: item.parameter
5141
5211
  }));
5142
5212
  })), React__default.createElement(MapLegendExpandButton, {
5143
5213
  onClick: toggleExpanded
@@ -5585,6 +5655,8 @@ exports.MapControl = MapControl;
5585
5655
  exports.MapControls = MapControls;
5586
5656
  exports.MapLegend = MapLegend;
5587
5657
  exports.MapLegendContainer = MapLegendContainer;
5658
+ exports.MapLegendDescription = MapLegendDescription;
5659
+ exports.MapLegendDescriptionContainer = MapLegendDescriptionContainer;
5588
5660
  exports.MapLegendExpandButton = MapLegendExpandButton;
5589
5661
  exports.MapLegendHeader = MapLegendHeader;
5590
5662
  exports.MapLegendItem = MapLegendItem;
@@ -5670,6 +5742,7 @@ exports.isMaskedImageSymbol = isMaskedImageSymbol;
5670
5742
  exports.isMiterExist = isMiterExist;
5671
5743
  exports.isNumeric = isNumeric;
5672
5744
  exports.isParameterByAttribute = isParameterByAttribute;
5745
+ exports.isParameterType = isParameterType;
5673
5746
  exports.isParameterValueSimple = isParameterValueSimple;
5674
5747
  exports.isParameterValueSymbol = isParameterValueSymbol;
5675
5748
  exports.isPatternBrush = isPatternBrush;