@evergis/react 4.0.20 → 4.0.21

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
@@ -4248,8 +4248,8 @@ const useChartChange = ({ dataSources, chartId, width, height, relatedAttributes
4248
4248
  const customize = useCallback(({ svg }) => {
4249
4249
  svg.style("overflow", "visible");
4250
4250
  svg
4251
- .selectAll(`.${lineChartClassNames.lineChartXScaleGlobal} line,
4252
- .${lineChartClassNames.lineChartYScaleGlobal} line,
4251
+ .selectAll(`.${lineChartClassNames.lineChartXScaleGlobal} line,
4252
+ .${lineChartClassNames.lineChartYScaleGlobal} line,
4253
4253
  .domain`)
4254
4254
  .each((_, index, nodes) => {
4255
4255
  nodes[index].remove();
@@ -4320,11 +4320,11 @@ const useChartChange = ({ dataSources, chartId, width, height, relatedAttributes
4320
4320
  .attr("fill", `url(#${gradientId})`)
4321
4321
  .attr("stroke-width", "0")
4322
4322
  .attr("fill-opacity", FILL_OPACITY);
4323
- defs.push(`
4324
- <linearGradient id="${gradientId}" x1="0" y1="0" x2="0" y2="1">
4325
- <stop offset="0" stop-color="${color}" stop-opacity="1" />
4326
- <stop offset="1" stop-color="${color}" stop-opacity="0" />
4327
- </linearGradient>
4323
+ defs.push(`
4324
+ <linearGradient id="${gradientId}" x1="0" y1="0" x2="0" y2="1">
4325
+ <stop offset="0" stop-color="${color}" stop-opacity="1" />
4326
+ <stop offset="1" stop-color="${color}" stop-opacity="0" />
4327
+ </linearGradient>
4328
4328
  `);
4329
4329
  ref.current = {
4330
4330
  path: newPath,
@@ -7534,7 +7534,8 @@ const useEditControl = (type, elementConfig) => {
7534
7534
  attributes,
7535
7535
  ]);
7536
7536
  const dataSource = useMemo(() => dataSources?.find(({ name }) => name === control.relatedDataSource), [control.relatedDataSource, dataSources]);
7537
- const items = useMemo(() => dataSource?.features.map(item => item.properties[control?.attributeName] || null) || [], [dataSource?.features, control?.attributeName]);
7537
+ const items = useMemo(() => control?.variants?.map(v => String(v.text || v.value)) ||
7538
+ dataSource?.features.map(item => item.properties[control?.attributeName] || null) || [], [control?.variants, dataSource?.features, control?.attributeName]);
7538
7539
  const onChange = useCallback((newValue) => {
7539
7540
  changeControls({
7540
7541
  [control?.targetAttributeName]: newValue,
@@ -8539,11 +8540,7 @@ const ElementControl = ({ elementConfig }) => {
8539
8540
  const isDisabled = useMemo(() => {
8540
8541
  const attr = layerInfo?.configuration?.attributesConfiguration?.attributes?.find(item => item.attributeName === control?.targetAttributeName);
8541
8542
  return !attr?.isEditable;
8542
- }, [
8543
- control?.targetAttributeName,
8544
- layerInfo?.configuration
8545
- ?.attributesConfiguration?.attributes,
8546
- ]);
8543
+ }, [control?.targetAttributeName, layerInfo?.configuration]);
8547
8544
  const currentValue = controls?.[control?.targetAttributeName] ??
8548
8545
  attribute?.value ??
8549
8546
  defaultValue;