@sis-cc/dotstatsuite-visions 12.21.0 → 12.23.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.
@@ -376,7 +376,7 @@ var AdvancedSelection = function AdvancedSelection(props) {
376
376
  return onChangeSelection(selection, ids, filter);
377
377
  },
378
378
  withExpandControl: true,
379
- treeHeight: isNarrow ? 0 : '700px',
379
+ treeHeight: isNarrow ? 0 : '450px',
380
380
  scopeGetter: scopeGetter,
381
381
  expandedIds: expandedIds
382
382
  }))
@@ -2,7 +2,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
2
2
 
3
3
  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
4
4
 
5
- import React, { useState } from 'react';
5
+ import React, { useState, useEffect } from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import * as R from 'ramda';
8
8
  import cx from 'classnames';
@@ -57,7 +57,9 @@ var TabPanel = function TabPanel(props) {
57
57
  isNarrow = props.isNarrow,
58
58
  setOpen = props.setOpen,
59
59
  labelRenderer = props.labelRenderer,
60
- other = _objectWithoutProperties(props, ['children', 'open', 'item', 'classes', 'labels', 'onClose', 'isNarrow', 'setOpen', 'labelRenderer']);
60
+ _props$styles = props.styles,
61
+ styles = _props$styles === undefined ? {} : _props$styles,
62
+ other = _objectWithoutProperties(props, ['children', 'open', 'item', 'classes', 'labels', 'onClose', 'isNarrow', 'setOpen', 'labelRenderer', 'styles']);
61
63
 
62
64
  return React.createElement(
63
65
  'div',
@@ -66,7 +68,8 @@ var TabPanel = function TabPanel(props) {
66
68
  hidden: !open,
67
69
  id: 'vertical-tabpanel-' + item.index,
68
70
  'aria-labelledby': 'vertical-tab-' + item.index,
69
- className: isNarrow ? classes.tabPanelNarrow : classes.tabPanel
71
+ className: isNarrow ? classes.tabPanelNarrow : classes.tabPanel,
72
+ style: styles
70
73
  }, other),
71
74
  open && React.createElement(
72
75
  Box,
@@ -143,7 +146,8 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
143
146
  children: PropTypes.node,
144
147
  isNarrow: PropTypes.bool,
145
148
  setOpen: PropTypes.func,
146
- labelRenderer: PropTypes.func
149
+ labelRenderer: PropTypes.func,
150
+ styles: PropTypes.object
147
151
  } : {};
148
152
 
149
153
  var PaperComponent = function PaperComponent(props) {
@@ -195,6 +199,10 @@ var DynamicDrawer = function DynamicDrawer(props) {
195
199
  allSelection = _useState4[0],
196
200
  setAllSelection = _useState4[1];
197
201
 
202
+ var _useState5 = useState(-1),
203
+ value = _useState5[0],
204
+ setValue = _useState5[1];
205
+
198
206
  var getCounter = function getCounter(items, tagAccessor) {
199
207
  var selectedItemsIds = R.reduce(function (acc, item) {
200
208
  if (R.prop('isSelected', item)) {
@@ -230,12 +238,15 @@ var DynamicDrawer = function DynamicDrawer(props) {
230
238
  tagAccessor = props.tagAccessor,
231
239
  tagAriaLabel = props.tagAriaLabel,
232
240
  children = props.children,
233
- rest = _objectWithoutProperties(props, ['list', 'labelRenderer', 'onClick', 'handleChangePanel', 'isNarrow', 'labels', 'disableAccessor', 'expandAll', 'collapseAll', 'expandedIds', 'allItems', 'periodPanel', 'classes', 'testId', 'tagAccessor', 'tagAriaLabel', 'children']);
241
+ _props$styles2 = props.styles,
242
+ styles = _props$styles2 === undefined ? {} : _props$styles2,
243
+ rest = _objectWithoutProperties(props, ['list', 'labelRenderer', 'onClick', 'handleChangePanel', 'isNarrow', 'labels', 'disableAccessor', 'expandAll', 'collapseAll', 'expandedIds', 'allItems', 'periodPanel', 'classes', 'testId', 'tagAccessor', 'tagAriaLabel', 'children', 'styles']);
234
244
 
235
245
  var handleChange = function handleChange(e, item) {
236
246
  setSelection(_extends({}, allSelection[item.id]));
237
247
  handleChangePanel(item.id, selection, allSelection);
238
248
  setFilter(item);
249
+ setValue(item.id);
239
250
  setOpen(true);
240
251
  };
241
252
  var handleSubmit = function handleSubmit() {
@@ -243,15 +254,27 @@ var DynamicDrawer = function DynamicDrawer(props) {
243
254
  setAllSelection({});
244
255
  setSelection({});
245
256
  setOpen(false);
257
+ setFilter({});
246
258
  };
247
259
  var handleClose = function handleClose() {
248
260
  setOpen(false);
249
261
  setAllSelection({});
250
262
  setSelection({});
263
+ setFilter({});
251
264
  };
252
265
 
253
266
  var isHidden = open && isNarrow;
254
267
  var isNotHiddenButton = !R.isEmpty(allSelection) && isNarrow;
268
+ useEffect(function () {
269
+ if (open) {
270
+ document.body.style.overflow = 'hidden';
271
+ } else {
272
+ document.body.style.overflow = '';
273
+ }
274
+ return function () {
275
+ document.body.style.overflow = '';
276
+ };
277
+ }, [open]);
255
278
 
256
279
  return React.createElement(
257
280
  'div',
@@ -274,7 +297,10 @@ var DynamicDrawer = function DynamicDrawer(props) {
274
297
  {
275
298
  orientation: 'vertical',
276
299
  variant: 'scrollable',
277
- value: false,
300
+ TabIndicatorProps: { style: { transition: 'none' } },
301
+ scrollButtons: false,
302
+ disableScrollButtons: true,
303
+ value: value,
278
304
  onChange: handleChange,
279
305
  'aria-label': 'filters',
280
306
  'data-testid': testId,
@@ -284,7 +310,8 @@ var DynamicDrawer = function DynamicDrawer(props) {
284
310
  height: '100%',
285
311
  borderRight: 1,
286
312
  borderColor: 'divider',
287
- zIndex: 1000
313
+ zIndex: 1000,
314
+ overflow: 'auto'
288
315
  }
289
316
  },
290
317
  R.map(function (item) {
@@ -317,7 +344,9 @@ var DynamicDrawer = function DynamicDrawer(props) {
317
344
  alignItems: 'start',
318
345
  maxWidth: '100%'
319
346
  },
320
- wrapped: true
347
+ wrapped: true,
348
+ disableRipple: true,
349
+ disableFocusRipple: true
321
350
  });
322
351
  })(list),
323
352
  open && !isNarrow && React.createElement(
@@ -354,7 +383,8 @@ var DynamicDrawer = function DynamicDrawer(props) {
354
383
  onClose: handleClose,
355
384
  isNarrow: isNarrow,
356
385
  setOpen: setOpen,
357
- labelRenderer: labelRenderer
386
+ labelRenderer: labelRenderer,
387
+ styles: styles
358
388
  },
359
389
  R.equals(filter.id, periodPanel) ? children : React.createElement(AdvancedSelection, _extends({
360
390
  id: filter.id,
@@ -410,7 +440,8 @@ DynamicDrawer.propTypes = process.env.NODE_ENV !== "production" ? {
410
440
  periodPanel: PropTypes.string,
411
441
  isNarrow: PropTypes.bool,
412
442
  disableAccessor: PropTypes.func,
413
- children: PropTypes.node
443
+ children: PropTypes.node,
444
+ styles: PropTypes.object
414
445
  } : {};
415
446
 
416
447
  export default DynamicDrawer;
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import * as R from 'ramda';
4
4
  import cx from 'classnames';
5
- import { Box, Button, Paper, Typography } from '@mui/material';
6
- import { Tooltip } from '..';
5
+ import { Box, Paper, Typography } from '@mui/material';
6
+ import { Tooltip, Button } from '..';
7
7
 
8
8
  var mapIndexed = R.addIndex(R.map);
9
9
  var ButtonCarousel = function ButtonCarousel(_ref) {
@@ -52,8 +52,13 @@ var updateLimit = function updateLimit(value, isSamePeriod, defaultValue) {
52
52
  };
53
53
 
54
54
  export var getRange = R.curry(function (boundaries, date) {
55
- var _ref3;
55
+ var _ref4;
56
56
 
57
+ if (R.isNil(R.head(boundaries)) || R.isNil(R.last(boundaries))) {
58
+ var _ref;
59
+
60
+ return _ref = {}, _ref[YEARS] = [NaN], _ref[HOURS] = [NaN], _ref[FULL_HOURS] = [NaN], _ref[MONTHS] = [NaN], _ref[WEEKS] = [NaN], _ref[SEMESTERS] = [NaN], _ref[QUARTERS] = [NaN], _ref[DAYS] = [NaN], _ref[MINUTES] = [NaN], _ref;
61
+ }
57
62
  var destructuredDate = getDestructuringDate(date);
58
63
  var destructuredBoundaries = R.map(getDestructuringDate, boundaries);
59
64
 
@@ -68,17 +73,17 @@ export var getRange = R.curry(function (boundaries, date) {
68
73
  semesters = _R$transpose[8];
69
74
 
70
75
  if (R.isNil(date)) {
71
- var _ref;
76
+ var _ref2;
72
77
 
73
- return _ref = {}, _ref[YEARS] = years, _ref[HOURS] = [NaN], _ref[FULL_HOURS] = [NaN], _ref[MONTHS] = [NaN], _ref[WEEKS] = [NaN], _ref[SEMESTERS] = [NaN], _ref[QUARTERS] = [NaN], _ref[DAYS] = [NaN], _ref[MINUTES] = [NaN], _ref;
78
+ return _ref2 = {}, _ref2[YEARS] = years, _ref2[HOURS] = [NaN], _ref2[FULL_HOURS] = [NaN], _ref2[MONTHS] = [NaN], _ref2[WEEKS] = [NaN], _ref2[SEMESTERS] = [NaN], _ref2[QUARTERS] = [NaN], _ref2[DAYS] = [NaN], _ref2[MINUTES] = [NaN], _ref2;
74
79
  }
75
- var listEqualsValueFromDate = R.pipe(R.transpose, R.reduce(function (acc, _ref2) {
80
+ var listEqualsValueFromDate = R.pipe(R.transpose, R.reduce(function (acc, _ref3) {
76
81
  var _extends2;
77
82
 
78
- var type = _ref2[0],
79
- date = _ref2[1],
80
- start = _ref2[2],
81
- end = _ref2[3];
83
+ var type = _ref3[0],
84
+ date = _ref3[1],
85
+ start = _ref3[2],
86
+ end = _ref3[3];
82
87
 
83
88
  return _extends({}, acc, (_extends2 = {}, _extends2[type] = [R.equals(date, start), R.equals(date, end)], _extends2));
84
89
  }, {}))([frequencies, destructuredDate].concat(destructuredBoundaries));
@@ -92,21 +97,21 @@ export var getRange = R.curry(function (boundaries, date) {
92
97
  return updateLimit(R.nth(index)(hours), isSamePeriod, value);
93
98
  })([0, 23]);
94
99
 
95
- return _ref3 = {}, _ref3[YEARS] = years, _ref3[HOURS] = hoursRange, _ref3[FULL_HOURS] = hoursRange, _ref3[MONTHS] = R.addIndex(R.map)(function (value, index) {
100
+ return _ref4 = {}, _ref4[YEARS] = years, _ref4[HOURS] = hoursRange, _ref4[FULL_HOURS] = hoursRange, _ref4[MONTHS] = R.addIndex(R.map)(function (value, index) {
96
101
  return updateLimit(R.nth(index)(months), R.nth(index, equalsYears), value);
97
- })([1, 12]), _ref3[WEEKS] = R.addIndex(R.map)(function (value, index) {
102
+ })([1, 12]), _ref4[WEEKS] = R.addIndex(R.map)(function (value, index) {
98
103
  return updateLimit(R.nth(index)(weeks), R.nth(index, equalsYears), value);
99
- })([1, dateFns.getISOWeeksInYear(date)]), _ref3[SEMESTERS] = R.addIndex(R.map)(function (value, index) {
104
+ })([1, dateFns.getISOWeeksInYear(date)]), _ref4[SEMESTERS] = R.addIndex(R.map)(function (value, index) {
100
105
  return updateLimit(R.nth(index)(semesters), R.nth(index, equalsYears), value);
101
- })([1, 2]), _ref3[QUARTERS] = R.addIndex(R.map)(function (value, index) {
106
+ })([1, 2]), _ref4[QUARTERS] = R.addIndex(R.map)(function (value, index) {
102
107
  return updateLimit(R.nth(index)(quarters), R.nth(index, equalsYears), value);
103
- })([1, 4]), _ref3[DAYS] = R.addIndex(R.map)(function (value, index) {
108
+ })([1, 4]), _ref4[DAYS] = R.addIndex(R.map)(function (value, index) {
104
109
  var isSamePeriod = R.and(R.nth(index, equalsMonths), R.nth(index, equalsYears));
105
110
  return updateLimit(R.nth(index)(days), isSamePeriod, value);
106
- })([1, dateFns.getDaysInMonth(date)]), _ref3[MINUTES] = R.addIndex(R.map)(function (value, index) {
111
+ })([1, dateFns.getDaysInMonth(date)]), _ref4[MINUTES] = R.addIndex(R.map)(function (value, index) {
107
112
  var isSamePeriod = R.all(R.identity)([R.nth(index, R.prop('hours')(listEqualsValueFromDate)), R.nth(index, equalsDays), R.nth(index, equalsMonths), R.nth(index, equalsYears)]);
108
113
  return updateLimit(R.nth(index)(minutes), isSamePeriod, value);
109
- })([0, 59]), _ref3;
114
+ })([0, 59]), _ref4;
110
115
  });
111
116
 
112
117
  export var getAjustedDate = function getAjustedDate(frequency) {
@@ -114,9 +119,9 @@ export var getAjustedDate = function getAjustedDate(frequency) {
114
119
  };
115
120
 
116
121
  export var isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
117
- export var getDefaultFrequency = function getDefaultFrequency(_ref4) {
118
- var defaultFrequency = _ref4.defaultFrequency,
119
- frequencies = _ref4.frequencies;
122
+ export var getDefaultFrequency = function getDefaultFrequency(_ref5) {
123
+ var defaultFrequency = _ref5.defaultFrequency,
124
+ frequencies = _ref5.frequencies;
120
125
 
121
126
  var isNotIncludes = R.complement(R.and)(R.includes(defaultFrequency)(frequencies), R.includes(defaultFrequency)(supportedFrequenciesKey));
122
127
  return R.or(R.either(R.isEmpty, R.isNil)(defaultFrequency), isNotIncludes) ? R.head(frequencies) : defaultFrequency;
@@ -433,7 +433,7 @@ var AdvancedSelection = function AdvancedSelection(props) {
433
433
  return onChangeSelection(selection, ids, filter);
434
434
  },
435
435
  withExpandControl: true,
436
- treeHeight: isNarrow ? 0 : '700px',
436
+ treeHeight: isNarrow ? 0 : '450px',
437
437
  scopeGetter: scopeGetter,
438
438
  expandedIds: expandedIds
439
439
  }))
@@ -96,7 +96,9 @@ var TabPanel = function TabPanel(props) {
96
96
  isNarrow = props.isNarrow,
97
97
  setOpen = props.setOpen,
98
98
  labelRenderer = props.labelRenderer,
99
- other = _objectWithoutProperties(props, ['children', 'open', 'item', 'classes', 'labels', 'onClose', 'isNarrow', 'setOpen', 'labelRenderer']);
99
+ _props$styles = props.styles,
100
+ styles = _props$styles === undefined ? {} : _props$styles,
101
+ other = _objectWithoutProperties(props, ['children', 'open', 'item', 'classes', 'labels', 'onClose', 'isNarrow', 'setOpen', 'labelRenderer', 'styles']);
100
102
 
101
103
  return _react2.default.createElement(
102
104
  'div',
@@ -105,7 +107,8 @@ var TabPanel = function TabPanel(props) {
105
107
  hidden: !open,
106
108
  id: 'vertical-tabpanel-' + item.index,
107
109
  'aria-labelledby': 'vertical-tab-' + item.index,
108
- className: isNarrow ? classes.tabPanelNarrow : classes.tabPanel
110
+ className: isNarrow ? classes.tabPanelNarrow : classes.tabPanel,
111
+ style: styles
109
112
  }, other),
110
113
  open && _react2.default.createElement(
111
114
  _Box2.default,
@@ -182,7 +185,8 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
182
185
  children: _propTypes2.default.node,
183
186
  isNarrow: _propTypes2.default.bool,
184
187
  setOpen: _propTypes2.default.func,
185
- labelRenderer: _propTypes2.default.func
188
+ labelRenderer: _propTypes2.default.func,
189
+ styles: _propTypes2.default.object
186
190
  } : {};
187
191
 
188
192
  var PaperComponent = function PaperComponent(props) {
@@ -234,6 +238,10 @@ var DynamicDrawer = function DynamicDrawer(props) {
234
238
  allSelection = _useState4[0],
235
239
  setAllSelection = _useState4[1];
236
240
 
241
+ var _useState5 = (0, _react.useState)(-1),
242
+ value = _useState5[0],
243
+ setValue = _useState5[1];
244
+
237
245
  var getCounter = function getCounter(items, tagAccessor) {
238
246
  var selectedItemsIds = R.reduce(function (acc, item) {
239
247
  if (R.prop('isSelected', item)) {
@@ -269,12 +277,15 @@ var DynamicDrawer = function DynamicDrawer(props) {
269
277
  tagAccessor = props.tagAccessor,
270
278
  tagAriaLabel = props.tagAriaLabel,
271
279
  children = props.children,
272
- rest = _objectWithoutProperties(props, ['list', 'labelRenderer', 'onClick', 'handleChangePanel', 'isNarrow', 'labels', 'disableAccessor', 'expandAll', 'collapseAll', 'expandedIds', 'allItems', 'periodPanel', 'classes', 'testId', 'tagAccessor', 'tagAriaLabel', 'children']);
280
+ _props$styles2 = props.styles,
281
+ styles = _props$styles2 === undefined ? {} : _props$styles2,
282
+ rest = _objectWithoutProperties(props, ['list', 'labelRenderer', 'onClick', 'handleChangePanel', 'isNarrow', 'labels', 'disableAccessor', 'expandAll', 'collapseAll', 'expandedIds', 'allItems', 'periodPanel', 'classes', 'testId', 'tagAccessor', 'tagAriaLabel', 'children', 'styles']);
273
283
 
274
284
  var handleChange = function handleChange(e, item) {
275
285
  setSelection(_extends({}, allSelection[item.id]));
276
286
  handleChangePanel(item.id, selection, allSelection);
277
287
  setFilter(item);
288
+ setValue(item.id);
278
289
  setOpen(true);
279
290
  };
280
291
  var handleSubmit = function handleSubmit() {
@@ -282,15 +293,27 @@ var DynamicDrawer = function DynamicDrawer(props) {
282
293
  setAllSelection({});
283
294
  setSelection({});
284
295
  setOpen(false);
296
+ setFilter({});
285
297
  };
286
298
  var handleClose = function handleClose() {
287
299
  setOpen(false);
288
300
  setAllSelection({});
289
301
  setSelection({});
302
+ setFilter({});
290
303
  };
291
304
 
292
305
  var isHidden = open && isNarrow;
293
306
  var isNotHiddenButton = !R.isEmpty(allSelection) && isNarrow;
307
+ (0, _react.useEffect)(function () {
308
+ if (open) {
309
+ document.body.style.overflow = 'hidden';
310
+ } else {
311
+ document.body.style.overflow = '';
312
+ }
313
+ return function () {
314
+ document.body.style.overflow = '';
315
+ };
316
+ }, [open]);
294
317
 
295
318
  return _react2.default.createElement(
296
319
  'div',
@@ -313,7 +336,10 @@ var DynamicDrawer = function DynamicDrawer(props) {
313
336
  {
314
337
  orientation: 'vertical',
315
338
  variant: 'scrollable',
316
- value: false,
339
+ TabIndicatorProps: { style: { transition: 'none' } },
340
+ scrollButtons: false,
341
+ disableScrollButtons: true,
342
+ value: value,
317
343
  onChange: handleChange,
318
344
  'aria-label': 'filters',
319
345
  'data-testid': testId,
@@ -323,7 +349,8 @@ var DynamicDrawer = function DynamicDrawer(props) {
323
349
  height: '100%',
324
350
  borderRight: 1,
325
351
  borderColor: 'divider',
326
- zIndex: 1000
352
+ zIndex: 1000,
353
+ overflow: 'auto'
327
354
  }
328
355
  },
329
356
  R.map(function (item) {
@@ -356,7 +383,9 @@ var DynamicDrawer = function DynamicDrawer(props) {
356
383
  alignItems: 'start',
357
384
  maxWidth: '100%'
358
385
  },
359
- wrapped: true
386
+ wrapped: true,
387
+ disableRipple: true,
388
+ disableFocusRipple: true
360
389
  });
361
390
  })(list),
362
391
  open && !isNarrow && _react2.default.createElement(
@@ -393,7 +422,8 @@ var DynamicDrawer = function DynamicDrawer(props) {
393
422
  onClose: handleClose,
394
423
  isNarrow: isNarrow,
395
424
  setOpen: setOpen,
396
- labelRenderer: labelRenderer
425
+ labelRenderer: labelRenderer,
426
+ styles: styles
397
427
  },
398
428
  R.equals(filter.id, periodPanel) ? children : _react2.default.createElement(_AdvancedSelection2.default, _extends({
399
429
  id: filter.id,
@@ -449,7 +479,8 @@ DynamicDrawer.propTypes = process.env.NODE_ENV !== "production" ? {
449
479
  periodPanel: _propTypes2.default.string,
450
480
  isNarrow: _propTypes2.default.bool,
451
481
  disableAccessor: _propTypes2.default.func,
452
- children: _propTypes2.default.node
482
+ children: _propTypes2.default.node,
483
+ styles: _propTypes2.default.object
453
484
  } : {};
454
485
 
455
486
  exports.default = DynamicDrawer;
@@ -60,7 +60,7 @@ var ButtonCarousel = function ButtonCarousel(_ref) {
60
60
  tabIndex: -1
61
61
  },
62
62
  _react2.default.createElement(
63
- _material.Button,
63
+ _.Button,
64
64
  {
65
65
  className: (0, _classnames2.default)(classes.selectButton, classes.selectButtonNarrow),
66
66
  selected: value === selectionMode,
@@ -70,8 +70,13 @@ var updateLimit = function updateLimit(value, isSamePeriod, defaultValue) {
70
70
  };
71
71
 
72
72
  var getRange = exports.getRange = R.curry(function (boundaries, date) {
73
- var _ref3;
73
+ var _ref4;
74
74
 
75
+ if (R.isNil(R.head(boundaries)) || R.isNil(R.last(boundaries))) {
76
+ var _ref;
77
+
78
+ return _ref = {}, _ref[_constants.YEARS] = [NaN], _ref[_constants.HOURS] = [NaN], _ref[_constants.FULL_HOURS] = [NaN], _ref[_constants.MONTHS] = [NaN], _ref[_constants.WEEKS] = [NaN], _ref[_constants.SEMESTERS] = [NaN], _ref[_constants.QUARTERS] = [NaN], _ref[_constants.DAYS] = [NaN], _ref[_constants.MINUTES] = [NaN], _ref;
79
+ }
75
80
  var destructuredDate = getDestructuringDate(date);
76
81
  var destructuredBoundaries = R.map(getDestructuringDate, boundaries);
77
82
 
@@ -86,17 +91,17 @@ var getRange = exports.getRange = R.curry(function (boundaries, date) {
86
91
  semesters = _R$transpose[8];
87
92
 
88
93
  if (R.isNil(date)) {
89
- var _ref;
94
+ var _ref2;
90
95
 
91
- return _ref = {}, _ref[_constants.YEARS] = years, _ref[_constants.HOURS] = [NaN], _ref[_constants.FULL_HOURS] = [NaN], _ref[_constants.MONTHS] = [NaN], _ref[_constants.WEEKS] = [NaN], _ref[_constants.SEMESTERS] = [NaN], _ref[_constants.QUARTERS] = [NaN], _ref[_constants.DAYS] = [NaN], _ref[_constants.MINUTES] = [NaN], _ref;
96
+ return _ref2 = {}, _ref2[_constants.YEARS] = years, _ref2[_constants.HOURS] = [NaN], _ref2[_constants.FULL_HOURS] = [NaN], _ref2[_constants.MONTHS] = [NaN], _ref2[_constants.WEEKS] = [NaN], _ref2[_constants.SEMESTERS] = [NaN], _ref2[_constants.QUARTERS] = [NaN], _ref2[_constants.DAYS] = [NaN], _ref2[_constants.MINUTES] = [NaN], _ref2;
92
97
  }
93
- var listEqualsValueFromDate = R.pipe(R.transpose, R.reduce(function (acc, _ref2) {
98
+ var listEqualsValueFromDate = R.pipe(R.transpose, R.reduce(function (acc, _ref3) {
94
99
  var _extends2;
95
100
 
96
- var type = _ref2[0],
97
- date = _ref2[1],
98
- start = _ref2[2],
99
- end = _ref2[3];
101
+ var type = _ref3[0],
102
+ date = _ref3[1],
103
+ start = _ref3[2],
104
+ end = _ref3[3];
100
105
 
101
106
  return _extends({}, acc, (_extends2 = {}, _extends2[type] = [R.equals(date, start), R.equals(date, end)], _extends2));
102
107
  }, {}))([_constants.frequencies, destructuredDate].concat(destructuredBoundaries));
@@ -110,21 +115,21 @@ var getRange = exports.getRange = R.curry(function (boundaries, date) {
110
115
  return updateLimit(R.nth(index)(hours), isSamePeriod, value);
111
116
  })([0, 23]);
112
117
 
113
- return _ref3 = {}, _ref3[_constants.YEARS] = years, _ref3[_constants.HOURS] = hoursRange, _ref3[_constants.FULL_HOURS] = hoursRange, _ref3[_constants.MONTHS] = R.addIndex(R.map)(function (value, index) {
118
+ return _ref4 = {}, _ref4[_constants.YEARS] = years, _ref4[_constants.HOURS] = hoursRange, _ref4[_constants.FULL_HOURS] = hoursRange, _ref4[_constants.MONTHS] = R.addIndex(R.map)(function (value, index) {
114
119
  return updateLimit(R.nth(index)(months), R.nth(index, equalsYears), value);
115
- })([1, 12]), _ref3[_constants.WEEKS] = R.addIndex(R.map)(function (value, index) {
120
+ })([1, 12]), _ref4[_constants.WEEKS] = R.addIndex(R.map)(function (value, index) {
116
121
  return updateLimit(R.nth(index)(weeks), R.nth(index, equalsYears), value);
117
- })([1, _dateFns2.default.getISOWeeksInYear(date)]), _ref3[_constants.SEMESTERS] = R.addIndex(R.map)(function (value, index) {
122
+ })([1, _dateFns2.default.getISOWeeksInYear(date)]), _ref4[_constants.SEMESTERS] = R.addIndex(R.map)(function (value, index) {
118
123
  return updateLimit(R.nth(index)(semesters), R.nth(index, equalsYears), value);
119
- })([1, 2]), _ref3[_constants.QUARTERS] = R.addIndex(R.map)(function (value, index) {
124
+ })([1, 2]), _ref4[_constants.QUARTERS] = R.addIndex(R.map)(function (value, index) {
120
125
  return updateLimit(R.nth(index)(quarters), R.nth(index, equalsYears), value);
121
- })([1, 4]), _ref3[_constants.DAYS] = R.addIndex(R.map)(function (value, index) {
126
+ })([1, 4]), _ref4[_constants.DAYS] = R.addIndex(R.map)(function (value, index) {
122
127
  var isSamePeriod = R.and(R.nth(index, equalsMonths), R.nth(index, equalsYears));
123
128
  return updateLimit(R.nth(index)(days), isSamePeriod, value);
124
- })([1, _dateFns2.default.getDaysInMonth(date)]), _ref3[_constants.MINUTES] = R.addIndex(R.map)(function (value, index) {
129
+ })([1, _dateFns2.default.getDaysInMonth(date)]), _ref4[_constants.MINUTES] = R.addIndex(R.map)(function (value, index) {
125
130
  var isSamePeriod = R.all(R.identity)([R.nth(index, R.prop('hours')(listEqualsValueFromDate)), R.nth(index, equalsDays), R.nth(index, equalsMonths), R.nth(index, equalsYears)]);
126
131
  return updateLimit(R.nth(index)(minutes), isSamePeriod, value);
127
- })([0, 59]), _ref3;
132
+ })([0, 59]), _ref4;
128
133
  });
129
134
 
130
135
  var getAjustedDate = exports.getAjustedDate = function getAjustedDate(frequency) {
@@ -132,9 +137,9 @@ var getAjustedDate = exports.getAjustedDate = function getAjustedDate(frequency)
132
137
  };
133
138
 
134
139
  var isValidNumber = exports.isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
135
- var getDefaultFrequency = exports.getDefaultFrequency = function getDefaultFrequency(_ref4) {
136
- var defaultFrequency = _ref4.defaultFrequency,
137
- frequencies = _ref4.frequencies;
140
+ var getDefaultFrequency = exports.getDefaultFrequency = function getDefaultFrequency(_ref5) {
141
+ var defaultFrequency = _ref5.defaultFrequency,
142
+ frequencies = _ref5.frequencies;
138
143
 
139
144
  var isNotIncludes = R.complement(R.and)(R.includes(defaultFrequency)(frequencies), R.includes(defaultFrequency)(supportedFrequenciesKey));
140
145
  return R.or(R.either(R.isEmpty, R.isNil)(defaultFrequency), isNotIncludes) ? R.head(frequencies) : defaultFrequency;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "12.21.0",
3
+ "version": "12.23.0",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",