@sis-cc/dotstatsuite-components 23.0.0 → 23.1.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © OECD 2019-2025
3
+ Copyright © OECD 2019-2026
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import PropTypes from '../../../../_virtual/index3.js';
5
5
  import { create as createJss } from '../../../jss/dist/jss.esm.js';
6
6
  import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime2.js';
7
- import createGenerateClassName from '../createGenerateClassName/createGenerateClassName.js';
8
7
  import jssPreset from '../jssPreset/jssPreset.js';
8
+ import createGenerateClassName from '../createGenerateClassName/createGenerateClassName.js';
9
9
  import exactProp from '../../utils/esm/exactProp/exactProp.js';
10
10
 
11
11
  const _excluded = ["children", "injectFirst", "disableGeneration"];
@@ -147,5 +147,5 @@ if (process.env.NODE_ENV !== 'production') {
147
147
  process.env.NODE_ENV !== "production" ? StylesProvider.propTypes = exactProp(StylesProvider.propTypes) : void 0;
148
148
  }
149
149
 
150
- export { StylesContext, StylesProvider as default, defaultSheetsManager as sheetsManager };
150
+ export { StylesContext, defaultSheetsManager as sheetsManager };
151
151
  //# sourceMappingURL=StylesProvider.js.map
@@ -1,4 +1,4 @@
1
- import { isBrowser } from '../../is-in-browser/dist/module.js';
1
+ import isBrowser from '../../is-in-browser/dist/module.js';
2
2
  import _toConsumableArray from '../../@babel/runtime/helpers/esm/toConsumableArray.js';
3
3
 
4
4
  // Export javascript style and css style vendor prefixes.
@@ -1,5 +1,5 @@
1
1
  import _extends from '../../@babel/runtime/helpers/esm/extends.js';
2
- import { isBrowser } from '../../is-in-browser/dist/module.js';
2
+ import isBrowser from '../../is-in-browser/dist/module.js';
3
3
  import warning from '../../tiny-warning/dist/tiny-warning.esm.js';
4
4
  import _createClass from '../../@babel/runtime/helpers/esm/createClass.js';
5
5
  import _inheritsLoose from '../../@babel/runtime/helpers/esm/inheritsLoose.js';
@@ -2,7 +2,7 @@ import * as R from 'ramda';
2
2
 
3
3
  function focus(series, focusSelections) {
4
4
  const { highlight = [], baseline = [] } = focusSelections || {};
5
- if (R.isEmpty(highlight && R.isEmpty(baseline))) {
5
+ if (R.isEmpty(highlight) && R.isEmpty(baseline)) {
6
6
  return series;
7
7
  }
8
8
 
@@ -17,7 +17,7 @@ function focus(series, focusSelections) {
17
17
  return ({
18
18
  ...dp,
19
19
  highlightIndex: R.findIndex(isFocusMatch, highlight),
20
- baselineIndex: isFocusMatch(R.head(baseline)) ? 0 : -1
20
+ baselineIndex: R.head(baseline) && isFocusMatch(R.head(baseline)) ? 0 : -1
21
21
  })
22
22
  }),
23
23
  series
@@ -1 +1 @@
1
- {"version":3,"file":"scatter-focus.js","sources":["../../../../src/rules/src/factories/scatter-focus.js"],"sourcesContent":["import * as R from 'ramda';\n\nexport default function focus(series, focusSelections) {\n const { highlight = [], baseline = [] } = focusSelections || {};\n if (R.isEmpty(highlight && R.isEmpty(baseline))) {\n return series;\n }\n\n return R.over(\n R.lensPath([0, 'datapoints']),\n R.map(dp => {\n const isFocusMatch = f => {\n const focusedDim = R.path(['options', 'dimensionId'], f);\n const dpValId = R.path(['dimensionValues', focusedDim, 'id'], dp);\n return dpValId === R.path(['options', 'dimensionValueId'], f);\n }\n return ({\n ...dp,\n highlightIndex: R.findIndex(isFocusMatch, highlight),\n baselineIndex: isFocusMatch(R.head(baseline)) ? 0 : -1\n })\n }),\n series\n );\n};\n"],"names":[],"mappings":";;AAEe,SAAS,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE;AACvD,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,eAAe,IAAI,EAAE;AACjE,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;AACnD,IAAI,OAAO,MAAM;AACjB,EAAE;;AAEF,EAAE,OAAO,CAAC,CAAC,IAAI;AACf,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AACjC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI;AAChB,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI;AAChC,QAAQ,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;AAChE,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;AACzE,QAAQ,OAAO,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACrE,MAAM;AACN,MAAM,QAAQ;AACd,QAAQ,GAAG,EAAE;AACb,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC;AAC5D,QAAQ,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,GAAG;AAC5D,OAAO;AACP,IAAI,CAAC,CAAC;AACN,IAAI;AACJ,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"scatter-focus.js","sources":["../../../../src/rules/src/factories/scatter-focus.js"],"sourcesContent":["import * as R from 'ramda';\n\nexport default function focus(series, focusSelections) {\n const { highlight = [], baseline = [] } = focusSelections || {};\n if (R.isEmpty(highlight) && R.isEmpty(baseline)) {\n return series;\n }\n\n return R.over(\n R.lensPath([0, 'datapoints']),\n R.map(dp => {\n const isFocusMatch = f => {\n const focusedDim = R.path(['options', 'dimensionId'], f);\n const dpValId = R.path(['dimensionValues', focusedDim, 'id'], dp);\n return dpValId === R.path(['options', 'dimensionValueId'], f);\n }\n return ({\n ...dp,\n highlightIndex: R.findIndex(isFocusMatch, highlight),\n baselineIndex: R.head(baseline) && isFocusMatch(R.head(baseline)) ? 0 : -1\n })\n }),\n series\n );\n};\n"],"names":[],"mappings":";;AAEe,SAAS,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE;AACvD,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,eAAe,IAAI,EAAE;AACjE,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;AACnD,IAAI,OAAO,MAAM;AACjB,EAAE;;AAEF,EAAE,OAAO,CAAC,CAAC,IAAI;AACf,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AACjC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI;AAChB,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI;AAChC,QAAQ,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;AAChE,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;AACzE,QAAQ,OAAO,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACrE,MAAM;AACN,MAAM,QAAQ;AACd,QAAQ,GAAG,EAAE;AACb,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC;AAC5D,QAAQ,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,GAAG;AAChF,OAAO;AACP,IAAI,CAAC,CAAC;AACN,IAAI;AACJ,GAAG;AACH;;;;"}
@@ -1,11 +1,11 @@
1
1
  import * as R from 'ramda';
2
2
  import { TIMELINE, STACKED_ROW, STACKED_BAR, V_SYMBOL, H_SYMBOL, SCATTER } from '../constants.js';
3
- import { focusOptions, sampleFocusStateFromNewProps, onChangeFocusSelection } from './focus.js';
4
- import { scatterStateValueToOption, scatterValueOptions, isScatter, scatterStateFromNewProps, onChangeScatterVal, onChangeScatterDim, toScatterSingularity } from './scatter.js';
5
- import { isSymbol, symbolStateFromNewProps, onChangeSymbolDim, toSymbolSingularity } from './symbol.js';
6
- import { stackedModeOptions, isStacked, isStackedDimActive, stackedStateFromNewProps, onChangeStackedMode, onChangeStackedDimension, toStackedSingularity } from './stacked.js';
7
- import { toProperties as toProperties$1, linearStateFromNewProps } from './linear.js';
8
- import { isChart, chartDimensionToOption, chartDimensionOptions, hasFocus, optionParser, isNaturalInt } from './utils.js';
3
+ import { sampleFocusStateFromNewProps, focusOptions, onChangeFocusSelection } from './focus.js';
4
+ import { scatterStateFromNewProps, scatterStateValueToOption, scatterValueOptions, onChangeScatterVal, isScatter, onChangeScatterDim, toScatterSingularity } from './scatter.js';
5
+ import { symbolStateFromNewProps, onChangeSymbolDim, isSymbol, toSymbolSingularity } from './symbol.js';
6
+ import { stackedModeOptions, stackedStateFromNewProps, onChangeStackedMode, isStacked, onChangeStackedDimension, isStackedDimActive, toStackedSingularity } from './stacked.js';
7
+ import { linearStateFromNewProps, toProperties as toProperties$1 } from './linear.js';
8
+ import { isChart, optionParser, chartDimensionToOption, chartDimensionOptions, isNaturalInt, hasFocus } from './utils.js';
9
9
  import { getSourceLabel } from './getHeaderProps.js';
10
10
  import { stringifySubtitle } from './getStringifiedSubtitle.js';
11
11
 
@@ -1,5 +1,5 @@
1
1
  import * as R from 'ramda';
2
- import { BAR, STACKED_BAR, ROW, STACKED_ROW, SCATTER, TIMELINE, V_SYMBOL, H_SYMBOL } from '../constants.js';
2
+ import { BAR, STACKED_BAR, ROW, STACKED_ROW, H_SYMBOL, SCATTER, TIMELINE, V_SYMBOL } from '../constants.js';
3
3
  import { isPositiveNumber, isNumber } from './utils.js';
4
4
  import { isStacked } from './stacked.js';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import * as R from 'ramda';
2
2
  import { isRefAreaDimension } from '@sis-cc/dotstatsuite-sdmxjs';
3
3
  import { SCATTER } from '../constants.js';
4
- import { getPropertyDimension, artefactToOption, toState, getDimensionsWithValues } from './utils.js';
4
+ import { getDimensionsWithValues, artefactToOption, toState, getPropertyDimension } from './utils.js';
5
5
  import { focusStateFromNewProps } from './focus.js';
6
6
 
7
7
  const getScatterDimension = getPropertyDimension('scatterDimension');
@@ -1,6 +1,6 @@
1
1
  import * as R from 'ramda';
2
2
  import { VALUES, PERCENT, STACKED_BAR, STACKED_ROW } from '../constants.js';
3
- import { getDimensionsWithValues, toState, getPropertyDimension, getGroupedDimensions } from './utils.js';
3
+ import { getDimensionsWithValues, getGroupedDimensions, toState, getPropertyDimension } from './utils.js';
4
4
  import { focusStateFromNewProps } from './focus.js';
5
5
 
6
6
  const getStackedDimension = getPropertyDimension('stackedDimension');
@@ -1,6 +1,6 @@
1
1
  import * as R from 'ramda';
2
2
  import { H_SYMBOL, V_SYMBOL } from '../constants.js';
3
- import { toState, getDimensionsWithValues, getPropertyDimension, getGroupedDimensions } from './utils.js';
3
+ import { getDimensionsWithValues, getGroupedDimensions, toState, getPropertyDimension } from './utils.js';
4
4
  import { focusStateFromNewProps } from './focus.js';
5
5
 
6
6
  const getSymbolDimension = getPropertyDimension('symbolDimension');
@@ -1,4 +1,4 @@
1
- import { has, pipe, isNil, prop, equals, length, map, omit, find, propEq, propOr, reject, isEmpty, not, groupBy } from 'ramda';
1
+ import { has, pipe, is, prop, equals, length, map, isNil, omit, propOr, reject, isEmpty, groupBy, find, propEq, not } from 'ramda';
2
2
  import { isRefAreaDimension, isTimePeriodDimension } from '@sis-cc/dotstatsuite-sdmxjs';
3
3
  import { dimensionValueDisplay, parseDisplay } from '../dimension-utils.js';
4
4
  import { TYPES, STACKED_BAR, STACKED_ROW, CHORO } from '../constants.js';
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/rules/src/properties/utils.js"],"sourcesContent":["import {\n equals,\n find,\n groupBy,\n has,\n isEmpty,\n isNil,\n length,\n map,\n not,\n omit,\n pipe,\n prop,\n propEq,\n propOr,\n reject\n} from 'ramda';\nimport { isRefAreaDimension, isTimePeriodDimension } from '@sis-cc/dotstatsuite-sdmxjs';\nimport { parseDisplay } from '../dimension-utils';\nimport { CHORO, STACKED_BAR, STACKED_ROW, TYPES } from '../constants';\nimport { dimensionValueDisplay } from '../dimension-utils';\n\nexport const isNumber = (input) => {\n const value = Number(input);\n return not(isNil(value) || isNaN(value));\n};\n\nexport const isPositiveNumber = (input) => {\n return (isNumber(input) && Number(input) >= 0);\n};\n\nexport const isNaturalInt = value => isNil(value) || /^\\d+$/.test(String(value));\n\n\nexport const isChart = (type) => has(type, TYPES);\n\nexport const hasFocus = (type) => has(type, omit([CHORO], TYPES));\n\nexport const getDimensionsWithValues = (data) => pipe(\n propOr([], 'dimensions'),\n reject(d => d.header || isEmpty(d.values || []))\n)(data);\n\nexport const toState = (artefact) => prop('id', artefact);\n\nexport const getPropertyDimension = (property) => (data, state) => {\n const dimensionId = prop(property, state);\n const { dimensions = [] } = data || {};\n\n return find(propEq(dimensionId, 'id'), dimensions);\n};\n\nexport const getGroupedDimensions = pipe(\n getDimensionsWithValues,\n groupBy(\n dimension => {\n if (isRefAreaDimension(dimension)) {\n return 'area';\n }\n if (isTimePeriodDimension(dimension)) {\n return 'time';\n }\n return 'other';\n }\n )\n);\n\nexport const optionParser = option => pipe(\n option => is(Array, option) ? head(option) : option,\n option => is(Object, option) ? prop('value', option) : option,\n option => is(String, option) ? option : undefined\n)(option);\n\n\nexport const artefactToOption = (display) => (artefact) => isNil(artefact)\n ? undefined\n : {\n label: dimensionValueDisplay(parseDisplay(display))(artefact),\n value: prop('id', artefact)\n };\n\nexport const chartDimensionToOption = (property) => ({ data, display }, state) => pipe(\n getPropertyDimension(property),\n artefactToOption(display)\n)(data, state);\n\nexport const chartDimensionOptions = ({ data, type, display }, typeValidator) => {\n if (!typeValidator(type)) {\n return [];\n }\n const dimensions = getDimensionsWithValues(data);\n if ((equals(type, STACKED_BAR) || equals(type, STACKED_ROW)) && length(dimensions) === 1) {\n return [];\n }\n return map(\n artefactToOption(display),\n dimensions\n );\n};\n"],"names":[],"mappings":";;;;;AAsBY,MAAC,QAAQ,GAAG,CAAC,KAAK,KAAK;AACnC,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAC7B,EAAE,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1C;;AAEY,MAAC,gBAAgB,GAAG,CAAC,KAAK,KAAK;AAC3C,EAAE,QAAQ,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;AAC/C;;AAEY,MAAC,YAAY,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;;;AAGnE,MAAC,OAAO,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,EAAE,KAAK;;AAEpC,MAAC,QAAQ,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;;AAEpD,MAAC,uBAAuB,GAAG,CAAC,IAAI,KAAK,IAAI;AACrD,EAAE,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC;AAC1B,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,MAAM,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KAAK,EAAE,qBAAqB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;AACjE,IAAI,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ;AAC9B;;AAEY,MAAC,sBAAsB,GAAG,CAAC,QAAQ,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,KAAK,IAAI;AACtF,EAAE,oBAAoB,CAAC,QAAQ,CAAC;AAChC,EAAE,gBAAgB,CAAC,OAAO;AAC1B,CAAC,CAAC,IAAI,EAAE,KAAK;;AAED,MAAC,qBAAqB,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,aAAa,KAAK;AACjF,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE;AAC5B,IAAI,OAAO,EAAE;AACb,EAAE;AACF,EAAE,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,CAAC;AAClD,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AAC5F,IAAI,OAAO,EAAE;AACb,EAAE;AACF,EAAE,OAAO,GAAG;AACZ,IAAI,gBAAgB,CAAC,OAAO,CAAC;AAC7B,IAAI;AACJ,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/rules/src/properties/utils.js"],"sourcesContent":["import {\n equals,\n find,\n groupBy,\n has,\n is,\n isEmpty,\n isNil,\n length,\n map,\n not,\n omit,\n pipe,\n prop,\n propEq,\n propOr,\n reject\n} from 'ramda';\nimport { isRefAreaDimension, isTimePeriodDimension } from '@sis-cc/dotstatsuite-sdmxjs';\nimport { parseDisplay } from '../dimension-utils';\nimport { CHORO, STACKED_BAR, STACKED_ROW, TYPES } from '../constants';\nimport { dimensionValueDisplay } from '../dimension-utils';\n\nexport const isNumber = (input) => {\n const value = Number(input);\n return not(isNil(value) || isNaN(value));\n};\n\nexport const isPositiveNumber = (input) => {\n return (isNumber(input) && Number(input) >= 0);\n};\n\nexport const isNaturalInt = value => isNil(value) || /^\\d+$/.test(String(value));\n\n\nexport const isChart = (type) => has(type, TYPES);\n\nexport const hasFocus = (type) => has(type, omit([CHORO], TYPES));\n\nexport const getDimensionsWithValues = (data) => pipe(\n propOr([], 'dimensions'),\n reject(d => d.header || isEmpty(d.values || []))\n)(data);\n\nexport const toState = (artefact) => prop('id', artefact);\n\nexport const getPropertyDimension = (property) => (data, state) => {\n const dimensionId = prop(property, state);\n const { dimensions = [] } = data || {};\n\n return find(propEq(dimensionId, 'id'), dimensions);\n};\n\nexport const getGroupedDimensions = pipe(\n getDimensionsWithValues,\n groupBy(\n dimension => {\n if (isRefAreaDimension(dimension)) {\n return 'area';\n }\n if (isTimePeriodDimension(dimension)) {\n return 'time';\n }\n return 'other';\n }\n )\n);\n\nexport const optionParser = option => pipe(\n option => is(Array, option) ? head(option) : option,\n option => is(Object, option) ? prop('value', option) : option,\n option => is(String, option) ? option : undefined\n)(option);\n\n\nexport const artefactToOption = (display) => (artefact) => isNil(artefact)\n ? undefined\n : {\n label: dimensionValueDisplay(parseDisplay(display))(artefact),\n value: prop('id', artefact)\n };\n\nexport const chartDimensionToOption = (property) => ({ data, display }, state) => pipe(\n getPropertyDimension(property),\n artefactToOption(display)\n)(data, state);\n\nexport const chartDimensionOptions = ({ data, type, display }, typeValidator) => {\n if (!typeValidator(type)) {\n return [];\n }\n const dimensions = getDimensionsWithValues(data);\n if ((equals(type, STACKED_BAR) || equals(type, STACKED_ROW)) && length(dimensions) === 1) {\n return [];\n }\n return map(\n artefactToOption(display),\n dimensions\n );\n};\n"],"names":[],"mappings":";;;;;AAuBY,MAAC,QAAQ,GAAG,CAAC,KAAK,KAAK;AACnC,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAC7B,EAAE,OAAO,GAAG,CAAC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EAAE;AACb,EAAE;AACF,EAAE,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,CAAC;AAClD,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AAC5F,IAAI,OAAO,EAAE;AACb,EAAE;AACF,EAAE,OAAO,GAAG;AACZ,IAAI,gBAAgB,CAAC,OAAO,CAAC;AAC7B,IAAI;AACJ,GAAG;AACH;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-components",
3
3
  "description": "Set components based on React.",
4
- "version": "23.0.0",
4
+ "version": "23.1.0",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "sideEffects": false,
@@ -2,7 +2,7 @@ import * as R from 'ramda';
2
2
 
3
3
  export default function focus(series, focusSelections) {
4
4
  const { highlight = [], baseline = [] } = focusSelections || {};
5
- if (R.isEmpty(highlight && R.isEmpty(baseline))) {
5
+ if (R.isEmpty(highlight) && R.isEmpty(baseline)) {
6
6
  return series;
7
7
  }
8
8
 
@@ -17,7 +17,7 @@ export default function focus(series, focusSelections) {
17
17
  return ({
18
18
  ...dp,
19
19
  highlightIndex: R.findIndex(isFocusMatch, highlight),
20
- baselineIndex: isFocusMatch(R.head(baseline)) ? 0 : -1
20
+ baselineIndex: R.head(baseline) && isFocusMatch(R.head(baseline)) ? 0 : -1
21
21
  })
22
22
  }),
23
23
  series
@@ -3,6 +3,7 @@ import {
3
3
  find,
4
4
  groupBy,
5
5
  has,
6
+ is,
6
7
  isEmpty,
7
8
  isNil,
8
9
  length,