@evergis/react 2.0.157 → 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.
package/dist/react.esm.js CHANGED
@@ -5025,7 +5025,7 @@ const Fullscreen = () => {
5025
5025
  }));
5026
5026
  };
5027
5027
 
5028
- 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;
5028
+ 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;
5029
5029
  const MapLegendControl = /*#__PURE__*/styled(MapControl)(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: default;\n"])));
5030
5030
  const MapLegendContainer = /*#__PURE__*/styled.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"])));
5031
5031
  const MapLegendHeader = /*#__PURE__*/styled(LegendSectionHeader)(_templateObject3$4 || (_templateObject3$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: 15rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n"])));
@@ -5046,11 +5046,11 @@ const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
5046
5046
  value = 0;
5047
5047
  }
5048
5048
 
5049
- return 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: -", "px;\n background: rgb(224, 224, 224);\n }\n"])), value, Math.round(value / 2));
5049
+ return 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));
5050
5050
  };
5051
5051
 
5052
5052
  const StrokeColorLegendItemMixin = /*#__PURE__*/css(_templateObject9$1 || (_templateObject9$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 0.5rem;\n width: 1.5rem;\n"])));
5053
- const MapLegendItem = /*#__PURE__*/styled.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\n ", "\n\n ", "\n"])), _ref => {
5053
+ const MapLegendItem = /*#__PURE__*/styled.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 => {
5054
5054
  let {
5055
5055
  parameter
5056
5056
  } = _ref;
@@ -5062,15 +5062,20 @@ const MapLegendItem = /*#__PURE__*/styled.div(_templateObject10$1 || (_templateO
5062
5062
  return typeof value === "number" ? "none" : value;
5063
5063
  }, _ref3 => {
5064
5064
  let {
5065
- value,
5066
- parameter
5065
+ isHidden
5067
5066
  } = _ref3;
5068
- return isParameterType("size", parameter) && SizeLegendItemMixin(value);
5067
+ return isHidden ? 0.28 : 1;
5069
5068
  }, _ref4 => {
5070
5069
  let {
5071
5070
  value,
5072
5071
  parameter
5073
5072
  } = _ref4;
5073
+ return isParameterType("size", parameter) && SizeLegendItemMixin(value);
5074
+ }, _ref5 => {
5075
+ let {
5076
+ value,
5077
+ parameter
5078
+ } = _ref5;
5074
5079
  return isParameterType(["strokeWidth", "stroke.width"], parameter) && StrokeWidthLegendItemMixin(value);
5075
5080
  });
5076
5081
  const MapLegendOther = /*#__PURE__*/styled(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"])));
@@ -5079,40 +5084,41 @@ const StrokeWidthLegendItemsMixin = /*#__PURE__*/css(_templateObject13$1 || (_te
5079
5084
  const SizeMinimizedLegend = /*#__PURE__*/styled.div(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n margin-top: 0.5rem;\n"])));
5080
5085
  const SizeMinimizedLegendSymbol = /*#__PURE__*/styled.div(_templateObject15$1 || (_templateObject15$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n"])));
5081
5086
  const SizeMinimizedLegendLabel = /*#__PURE__*/styled.div(_templateObject16$1 || (_templateObject16$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
5082
- const SizeMinimizedLegendDown = /*#__PURE__*/styled.div(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.28;\n"])));
5083
- const SizeMinimizedLegendUp = /*#__PURE__*/styled.div(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
5087
+ const SizeMinimizedLegendDown = /*#__PURE__*/styled.div(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
5088
+ const SizeMinimizedLegendUp = /*#__PURE__*/styled(SizeMinimizedLegendDown)(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
5084
5089
  const SingleSizeLegendItemsMixin = /*#__PURE__*/css(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n\n ", ":after {\n margin: 0 auto;\n }\n"])), MapLegendItem);
5085
- const SingleLegendItemsMixin = /*#__PURE__*/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"])), _ref5 => {
5090
+ const SingleLegendItemsMixin = /*#__PURE__*/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
5091
  let {
5087
5092
  isSize
5088
- } = _ref5;
5093
+ } = _ref6;
5089
5094
  return isSize && SingleSizeLegendItemsMixin;
5090
- }, MapLegendItem, _ref6 => {
5095
+ }, MapLegendItem, _ref7 => {
5091
5096
  let {
5092
5097
  parameter
5093
- } = _ref6;
5098
+ } = _ref7;
5094
5099
  return isParameterType(["strokeColor", "stroke.color"], parameter) && StrokeColorLegendItemMixin;
5095
5100
  });
5096
- const MapLegendItems = /*#__PURE__*/styled.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"])), _ref7 => {
5101
+ const MapLegendItems = /*#__PURE__*/styled.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 => {
5097
5102
  let {
5098
5103
  isSize
5099
- } = _ref7;
5104
+ } = _ref8;
5100
5105
  return isSize && SizeLegendItemsMixin;
5101
- }, _ref8 => {
5106
+ }, _ref9 => {
5102
5107
  let {
5103
5108
  isStrokeWidth
5104
- } = _ref8;
5109
+ } = _ref9;
5105
5110
  return isStrokeWidth && StrokeWidthLegendItemsMixin;
5106
- }, _ref9 => {
5111
+ }, _ref10 => {
5107
5112
  let {
5108
5113
  isSingle
5109
- } = _ref9;
5114
+ } = _ref10;
5110
5115
  return isSingle && SingleLegendItemsMixin;
5111
5116
  });
5112
- const MapLegendValues = /*#__PURE__*/styled.div(_templateObject22 || (_templateObject22 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n font-size: 0.75rem;\n color: rgba(48, 69, 79, 0.65);\n"])));
5113
- const MapLegendValuesRange = /*#__PURE__*/styled.div(_templateObject23 || (_templateObject23 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
5114
- const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject24 || (_templateObject24 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
5115
- const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject25 || (_templateObject25 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
5117
+ const MapLegendItemsContainer = /*#__PURE__*/styled.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);
5118
+ const MapLegendValues = /*#__PURE__*/styled.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"])));
5119
+ const MapLegendValuesRange = /*#__PURE__*/styled.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"])));
5120
+ const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject25 || (_templateObject25 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
5121
+ const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject26 || (_templateObject26 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
5116
5122
 
5117
5123
  const MapLegend = _ref => {
5118
5124
  let {
@@ -5169,14 +5175,17 @@ const MapLegendDescription = _ref => {
5169
5175
  };
5170
5176
 
5171
5177
  const getValueFromLegendTitle = (title, minOrMax) => {
5172
- var _title$split;
5173
-
5174
5178
  if (title.includes(" - ")) {
5175
5179
  const result = title == null ? void 0 : title.split(" - ");
5176
5180
  return minOrMax === "min" ? result == null ? void 0 : result[0] : result == null ? void 0 : result[1];
5177
5181
  }
5178
5182
 
5179
- return (title == null ? void 0 : (_title$split = title.split(" ")) == null ? void 0 : _title$split.find(isNumeric)) || "";
5183
+ if (title.includes(",")) {
5184
+ const result = title == null ? void 0 : title.split(",");
5185
+ return result.join(", ");
5186
+ }
5187
+
5188
+ return title.split(" ").find(isNumeric) || title || "";
5180
5189
  };
5181
5190
 
5182
5191
  const MinimizedLegend = _ref => {
@@ -5185,7 +5194,8 @@ const MinimizedLegend = _ref => {
5185
5194
  let {
5186
5195
  values,
5187
5196
  title,
5188
- parameter
5197
+ parameter,
5198
+ hiddenLegends
5189
5199
  } = _ref;
5190
5200
  const currentValues = [...values];
5191
5201
  const other = currentValues.pop();
@@ -5193,6 +5203,7 @@ const MinimizedLegend = _ref => {
5193
5203
  const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
5194
5204
  const titleMax = getValueFromLegendTitle((_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title, "max");
5195
5205
  const titleMin = getValueFromLegendTitle((_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title, "min");
5206
+ const checkIsHidden = useCallback(hiddenCondition => hiddenCondition ? hiddenLegends == null ? void 0 : hiddenLegends.some(condition => hiddenCondition.includes(condition)) : false, [hiddenLegends]);
5196
5207
  return React.createElement(MinimizedLegendContainer, null, !!title && React.createElement(MapLegendValueDescr, null, title), isSize ? React.createElement(React.Fragment, null, React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
5197
5208
  parameter: parameter,
5198
5209
  isSize: true
@@ -5200,14 +5211,16 @@ const MinimizedLegend = _ref => {
5200
5211
  key: "" + value.title + index,
5201
5212
  title: value.title,
5202
5213
  value: value.parameterValue,
5203
- parameter: parameter
5214
+ parameter: parameter,
5215
+ isHidden: checkIsHidden(value.hiddenCondition)
5204
5216
  })))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendDown, null, (_currentValues$2 = currentValues[0]) == null ? void 0 : _currentValues$2.title), React.createElement(SizeMinimizedLegendUp, null, (_currentValues2 = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues2.title))), React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
5205
5217
  parameter: parameter,
5206
5218
  isSize: true
5207
5219
  }, React.createElement(MapLegendOther, {
5208
5220
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5209
5221
  value: other == null ? void 0 : other.parameterValue,
5210
- parameter: parameter
5222
+ parameter: parameter,
5223
+ isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
5211
5224
  }))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : isStrokeWidth ? React.createElement(MapLegendItems, {
5212
5225
  parameter: parameter,
5213
5226
  isStrokeWidth: true
@@ -5215,22 +5228,26 @@ const MinimizedLegend = _ref => {
5215
5228
  key: "" + value.title + index,
5216
5229
  title: value.title,
5217
5230
  value: value.parameterValue,
5218
- parameter: parameter
5231
+ parameter: parameter,
5232
+ isHidden: checkIsHidden(value.hiddenCondition)
5219
5233
  }, (!index || index === currentValues.length - 1) && value.title)), React.createElement(MapLegendOther, {
5220
5234
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5221
5235
  value: other == null ? void 0 : other.parameterValue,
5222
- parameter: parameter
5236
+ parameter: parameter,
5237
+ isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
5223
5238
  }, "\u0414\u0440\u0443\u0433\u043E\u0435")) : React.createElement(MapLegendItems, {
5224
5239
  parameter: parameter
5225
- }, currentValues.map((value, index) => React.createElement(MapLegendItem, {
5240
+ }, React.createElement(MapLegendItemsContainer, null, currentValues.map((value, index) => React.createElement(MapLegendItem, {
5226
5241
  key: "" + value.title + index,
5227
5242
  title: value.title,
5228
5243
  value: value.parameterValue,
5229
- parameter: parameter
5230
- })), React.createElement(MapLegendOther, {
5244
+ parameter: parameter,
5245
+ isHidden: checkIsHidden(value.hiddenCondition)
5246
+ }))), React.createElement(MapLegendOther, {
5231
5247
  title: "\u0414\u0440\u0443\u0433\u043E\u0435",
5232
5248
  value: other == null ? void 0 : other.parameterValue,
5233
- parameter: parameter
5249
+ parameter: parameter,
5250
+ isHidden: checkIsHidden(other == null ? void 0 : other.hiddenCondition)
5234
5251
  })), typeof (other == null ? void 0 : other.parameterValue) === "string" && (titleMax || titleMin) && React.createElement(MapLegendValues, null, React.createElement(MapLegendValuesRange, null, React.createElement("div", null, titleMax), React.createElement("div", null, titleMin)), React.createElement(MapLegendValuesOther, null, "-")));
5235
5252
  };
5236
5253