@evergis/react 2.0.135 → 2.0.136

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
@@ -2871,6 +2871,9 @@ function renderSymbolToCanvas(renders, canvas) {
2871
2871
 
2872
2872
  function deserializeSymbol(symbol) {
2873
2873
  switch (symbol.type) {
2874
+ case "h3grid":
2875
+ return deserializeH3Symbol(symbol);
2876
+
2874
2877
  case 'circlePointSymbol':
2875
2878
  return deserializePointSymbol(symbol);
2876
2879
 
@@ -2895,6 +2898,17 @@ function deserializeSymbol(symbol) {
2895
2898
  }
2896
2899
  }
2897
2900
 
2901
+ function deserializeH3Symbol(symbol) {
2902
+ var _symbol$stroke, _symbol$stroke2, _symbol$fill;
2903
+
2904
+ return new H3Symbol(_extends({}, symbol, {
2905
+ cellSize: getParameterValue(symbol.cellSize),
2906
+ strokeWidth: getParameterValue(symbol == null ? void 0 : (_symbol$stroke = symbol.stroke) == null ? void 0 : _symbol$stroke.width),
2907
+ strokeColor: getParameterValue(symbol == null ? void 0 : (_symbol$stroke2 = symbol.stroke) == null ? void 0 : _symbol$stroke2.color),
2908
+ fillColor: getParameterValue(symbol == null ? void 0 : (_symbol$fill = symbol.fill) == null ? void 0 : _symbol$fill.color)
2909
+ }));
2910
+ }
2911
+
2898
2912
  function deserializePointSymbol(symbol) {
2899
2913
  // @ts-ignore
2900
2914
  return new PointSymbol(deserializePointSymbolParams(symbol));
@@ -4669,7 +4683,7 @@ const EvergisSelect = _ref => {
4669
4683
  };
4670
4684
 
4671
4685
  var _templateObject$2, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5$1;
4672
- const LegendContainer = /*#__PURE__*/styled.div(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: #fff;\n\n canvas {\n border-radius: 0.125rem;\n }\n"])));
4686
+ const LegendContainer = /*#__PURE__*/styled.div(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: white;\n"])));
4673
4687
  const LegendSectionContainer = /*#__PURE__*/styled.div(_templateObject2$1 || (_templateObject2$1 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
4674
4688
  const LegendSymbolTitle = /*#__PURE__*/styled.p(_templateObject3$1 || (_templateObject3$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])));
4675
4689
  const LegendValueContainer = /*#__PURE__*/styled.div(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n font-size: 0.75rem;\n padding: 0.125rem 0;\n\n ", " {\n padding-left: 0.5rem;\n }\n"])), LegendSymbolTitle);
@@ -4679,9 +4693,10 @@ const LegendSection = _ref => {
4679
4693
  let {
4680
4694
  item,
4681
4695
  renderLegendTitle,
4696
+ hideTitle,
4682
4697
  children
4683
4698
  } = _ref;
4684
- return React.createElement(LegendSectionContainer, null, React.createElement(LegendSectionHeader, null, renderLegendTitle ? renderLegendTitle(item) : item.title), item.values.map(children));
4699
+ return React.createElement(LegendSectionContainer, null, !hideTitle && React.createElement(LegendSectionHeader, null, renderLegendTitle ? renderLegendTitle(item) : item.title), item.values.map(children));
4685
4700
  };
4686
4701
 
4687
4702
  var _templateObject$3, _templateObject2$2, _templateObject3$2;
@@ -4797,6 +4812,7 @@ const Legend = _ref => {
4797
4812
  }), renderCustomLegend && layer ? renderCustomLegend(layer) : children ? legend && children(legend) : legend && legend.items.map(legendItem => React.createElement(LegendSection, {
4798
4813
  key: legendItem.attribute + "-" + legendItem.parameter,
4799
4814
  item: legendItem,
4815
+ hideTitle: (layer == null ? void 0 : layer.alias) === legendItem.title,
4800
4816
  renderLegendTitle: config && config.renderLegendTitle
4801
4817
  }, legendValue => React.createElement(LegendValue, {
4802
4818
  key: legendValue.title,
@@ -4939,9 +4955,9 @@ const Fullscreen = () => {
4939
4955
  var _templateObject$6, _templateObject2$5, _templateObject3$5, _templateObject4$4, _templateObject5$4, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$1, _templateObject10$1, _templateObject11$1;
4940
4956
  const MapLegendControl = /*#__PURE__*/styled(MapControl)(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: default;\n"])));
4941
4957
  const MapLegendContainer = /*#__PURE__*/styled.div(_templateObject2$5 || (_templateObject2$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 12.5rem;\n box-sizing: border-box;\n\n canvas {\n height: 1rem;\n width: 1rem;\n }\n"])));
4942
- const MapLegendHeader = /*#__PURE__*/styled(LegendSectionHeader)(_templateObject3$5 || (_templateObject3$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0.25rem 0;\n font-weight: 500;\n"])));
4958
+ const MapLegendHeader = /*#__PURE__*/styled(LegendSectionHeader)(_templateObject3$5 || (_templateObject3$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: 15rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n"])));
4943
4959
  const MapLegendValueDescr = /*#__PURE__*/styled.div(_templateObject4$4 || (_templateObject4$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 0.25rem;\n font-size: 0.75rem;\n font-weight: 500;\n"])));
4944
- const MapLegendItems = /*#__PURE__*/styled.div(_templateObject5$4 || (_templateObject5$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n border-radius: 0.125rem;\n overflow: hidden;\n"])));
4960
+ const MapLegendItems = /*#__PURE__*/styled.div(_templateObject5$4 || (_templateObject5$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n border-radius: 0.125rem;\n"])));
4945
4961
  const MapLegendItem = /*#__PURE__*/styled.div(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n height: 1rem;\n background-color: ", ";\n border: 1px rgba(48, 69, 79, 0.1) solid;\n"])), _ref => {
4946
4962
  let {
4947
4963
  value
@@ -4955,8 +4971,14 @@ const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject
4955
4971
  const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject11$1 || (_templateObject11$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
4956
4972
 
4957
4973
  const getValueFromLegendTitle = (title, minOrMax) => {
4958
- const result = title == null ? void 0 : title.split(" - ");
4959
- return minOrMax === "min" ? result == null ? void 0 : result[0] : result == null ? void 0 : result[1];
4974
+ var _title$split;
4975
+
4976
+ if (title.includes(" - ")) {
4977
+ const result = title == null ? void 0 : title.split(" - ");
4978
+ return minOrMax === "min" ? result == null ? void 0 : result[0] : result == null ? void 0 : result[1];
4979
+ }
4980
+
4981
+ return (title == null ? void 0 : (_title$split = title.split(" ")) == null ? void 0 : _title$split[1]) || "";
4960
4982
  };
4961
4983
 
4962
4984
  const MapLegend = _ref => {
@@ -4984,7 +5006,7 @@ const MapLegend = _ref => {
4984
5006
  className: className
4985
5007
  }, React.createElement(MapLegendHeader, null, layer == null ? void 0 : layer.alias), React.createElement(MapLegendContainer, null, isExpanded ? React.createElement(Legend, {
4986
5008
  layer: layer
4987
- }) : React.createElement(React.Fragment, null, React.createElement(MapLegendValueDescr, null, item.title), React.createElement(MapLegendItems, null, item.values.map(value => React.createElement(MapLegendItem, {
5009
+ }) : React.createElement(React.Fragment, null, item.title !== (layer == null ? void 0 : layer.alias) && React.createElement(MapLegendValueDescr, null, item.title), React.createElement(MapLegendItems, null, item.values.map(value => React.createElement(MapLegendItem, {
4988
5010
  key: value.title,
4989
5011
  title: value.title,
4990
5012
  value: value.parameterValue