@sis-cc/dotstatsuite-visions 10.10.0 → 10.12.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.
@@ -14,10 +14,15 @@ import { useTheme } from '@material-ui/core';
14
14
  import { getIsRtl } from '../utils';
15
15
 
16
16
  var getCounter = function getCounter(items, disableAccessor, tagAccessor) {
17
- var count = R.pipe(R.filter(function (item) {
18
- return R.prop('isSelected', item) && !disableAccessor(item);
19
- }), R.map(R.prop('id')), R.uniq, R.length)(items);
20
- var total = R.pipe(R.when(R.always(R.is(Function, disableAccessor)), R.reject(disableAccessor)), R.map(R.prop('id')), R.uniq, R.length)(items);
17
+ var selectedItemsIds = R.reduce(function (acc, item) {
18
+ if (R.prop('isSelected', item)) {
19
+ return R.append(item.id, acc);
20
+ }
21
+ return acc;
22
+ }, [], items);
23
+ var itemsIds = R.pluck('id', items);
24
+ var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
25
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
21
26
  if (R.is(Function, tagAccessor)) {
22
27
  return tagAccessor(count, total);
23
28
  }
@@ -54,18 +54,18 @@ export var getDeprecatedIds = function getDeprecatedIds(ids, items, selectedIds)
54
54
 
55
55
  var deprecatedParents = R.reduce(function (acc, id) {
56
56
  var _item = R.prop(id, indexedItemsById);
57
- if (!isItemSelected(selectedIds)(_item)) {
58
- return acc;
59
- }
60
57
  var _itemsIds = R.has('hierarchicalId', _item) ? R.pipe(R.values, R.filter(R.propEq('id', _item.id)), R.map(getHierarchicalId))(indexedItemsById) : [id];
61
58
 
62
- if (R.propOr(true, 'isEnabled', _item)) {
63
- return acc;
64
- }
65
59
  var children = R.pipe(R.props(_itemsIds), R.unnest)(groupedItemsByParentId);
66
60
  var selectedChild = R.find(function (child) {
67
61
  return !R.includes(getHierarchicalId(child), _ids) && isItemSelected(selectedIds)(child);
68
62
  }, children);
63
+ if (!isItemSelected(selectedIds)(_item) && R.isNil(selectedChild)) {
64
+ return R.concat(reccurse([id]), acc);
65
+ }
66
+ if (!R.propOr(false, 'isGreyed', _item)) {
67
+ return acc;
68
+ }
69
69
  if (R.isNil(selectedChild)) {
70
70
  return R.concat(acc, _itemsIds);
71
71
  }
@@ -43,10 +43,15 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
43
43
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
44
44
 
45
45
  var getCounter = function getCounter(items, disableAccessor, tagAccessor) {
46
- var count = R.pipe(R.filter(function (item) {
47
- return R.prop('isSelected', item) && !disableAccessor(item);
48
- }), R.map(R.prop('id')), R.uniq, R.length)(items);
49
- var total = R.pipe(R.when(R.always(R.is(Function, disableAccessor)), R.reject(disableAccessor)), R.map(R.prop('id')), R.uniq, R.length)(items);
46
+ var selectedItemsIds = R.reduce(function (acc, item) {
47
+ if (R.prop('isSelected', item)) {
48
+ return R.append(item.id, acc);
49
+ }
50
+ return acc;
51
+ }, [], items);
52
+ var itemsIds = R.pluck('id', items);
53
+ var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
54
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
50
55
  if (R.is(Function, tagAccessor)) {
51
56
  return tagAccessor(count, total);
52
57
  }
@@ -63,18 +63,18 @@ var getDeprecatedIds = exports.getDeprecatedIds = function getDeprecatedIds(ids,
63
63
 
64
64
  var deprecatedParents = R.reduce(function (acc, id) {
65
65
  var _item = R.prop(id, indexedItemsById);
66
- if (!isItemSelected(selectedIds)(_item)) {
67
- return acc;
68
- }
69
66
  var _itemsIds = R.has('hierarchicalId', _item) ? R.pipe(R.values, R.filter(R.propEq('id', _item.id)), R.map(getHierarchicalId))(indexedItemsById) : [id];
70
67
 
71
- if (R.propOr(true, 'isEnabled', _item)) {
72
- return acc;
73
- }
74
68
  var children = R.pipe(R.props(_itemsIds), R.unnest)(groupedItemsByParentId);
75
69
  var selectedChild = R.find(function (child) {
76
70
  return !R.includes(getHierarchicalId(child), _ids) && isItemSelected(selectedIds)(child);
77
71
  }, children);
72
+ if (!isItemSelected(selectedIds)(_item) && R.isNil(selectedChild)) {
73
+ return R.concat(reccurse([id]), acc);
74
+ }
75
+ if (!R.propOr(false, 'isGreyed', _item)) {
76
+ return acc;
77
+ }
78
78
  if (R.isNil(selectedChild)) {
79
79
  return R.concat(acc, _itemsIds);
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "10.10.0",
3
+ "version": "10.12.0",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @sis-cc/dotstatsuite-visions v10.10.0 - https://visions-qa.siscc.org/#o
2
+ * @sis-cc/dotstatsuite-visions v10.12.0 - https://visions-qa.siscc.org/#o
3
3
  * MIT Licensed
4
4
  */
5
5
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -6699,7 +6699,7 @@ function removeClassName(el
6699
6699
  /* 121 */
6700
6700
  /***/ (function(module) {
6701
6701
 
6702
- module.exports = {"name":"@sis-cc/dotstatsuite-visions","version":"10.10.0","description":"Library of visual components","author":"OECD","homepage":"https://visions-qa.siscc.org/#o","license":"MIT","repository":"https://gitlab.com/sis-cc/.stat-suite/dotstatsuite-visions","main":"lib/index.js","module":"es/index.js","engines":{"node":">=14"},"files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component --copy-files --no-demo && node scripts/doc && nwb build-demo","build:dev":"nwb build-react-component --copy-files --no-demo","clean":"nwb clean-module && nwb clean-demo","prepublishOnly":"npm run build","start":"nwb serve-react-demo","test":"jest","test:watch":"jest --watch --no-cache","lint":"eslint src/ --color","precommit":"lint-staged"},"dependencies":{"@react-hook/size":"^2.1.1","classnames":"^2.2.6","date-fns":"^1.30.1","isemail":"^3.2.0","numeral":"^2.0.6","prop-types":"^15.7.2","ramda":"^0.27.0","react-beautiful-dnd":"^13.0.0","react-draggable":"^4.4.5","react-error-boundary":"^4.0.10","react-virtualized":"^9.21.2"},"peerDependencies":{"@material-ui/core":"^4","@material-ui/icons":"^4","@sis-cc/dotstatsuite-sdmxjs":"^8.x","react":"^18","react-dom":"^18"},"devDependencies":{"@babel/eslint-parser":"^7.5.4","@babel/plugin-syntax-dynamic-import":"^7.2.0","@cfaester/enzyme-adapter-react-18":"^0.7.0","@material-ui/core":"^4","@material-ui/icons":"^4","@sis-cc/dotstatsuite-sdmxjs":"*","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","babel-jest":"^24.8.0","babel-preset-react-app":"^9.0.0","dox":"^0.9.0","eslint":"^8.39.0","eslint-plugin-import":"^2.27.5","eslint-plugin-jsx-a11y":"^6.7.1","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","husky":"^2.7.0","identity-obj-proxy":"^3.0.0","jest":"^24.8.0","jss":"^10.10.0","jss-rtl":"^0.2.3","lint-staged":"^8.2.1","mutationobserver-shim":"^0.3.7","nwb":"0.23.0","prettier":"^2.8.8","pretty-quick":"^3.1.3","react":"^18","react-a11y":"^1.1.0","react-dom":"^18","react-helmet":"^5.2.1","react-scrollable-anchor":"^0.6.1","react-syntax-highlighter":"^10.2.1","sanitize-html":"2.7.0","webpack":"^5.68.0","webpack-cli":"^4.9.2","webpack-dev-server":"^4.7.4"},"jest":{"verbose":true,"coverageDirectory":"coverage","collectCoverageFrom":["src/**/*.{js,jsx,ts,tsx}","!src/ScopeList/*.{js,jsx,ts,tsx}","!src/**/*.d.ts"],"setupFilesAfterEnv":["<rootDir>/tests/setup.js"],"testMatch":["**/tests/**/*.{spec,test}.{js,jsx,ts,tsx}","!**/tests/ScopeList.test.js"],"testEnvironment":"jsdom","transform":{"^.+\\.(js|jsx|ts|tsx)$":"<rootDir>/node_modules/babel-jest"},"transformIgnorePatterns":["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$","^.+\\.module\\.(css|sass|scss)$"],"modulePaths":[],"moduleNameMapper":{"^react-native$":"react-native-web","^.+\\.module\\.(css|sass|scss)$":"identity-obj-proxy","\\.(jpg|jpeg|png)$":"identity-obj-proxy"},"moduleFileExtensions":["web.js","js","web.ts","ts","web.tsx","tsx","json","web.jsx","jsx","node"]},"babel":{"presets":["react-app"],"plugins":["@babel/plugin-syntax-dynamic-import"]},"eslintConfig":{"env":{"browser":true,"jest":true,"node":true,"es6":true},"extends":["eslint:recommended","plugin:react/recommended","plugin:jsx-a11y/recommended"],"parser":"@babel/eslint-parser","parserOptions":{"babelOptions":{"presets":[["babel-preset-react-app",false],"babel-preset-react-app/test"]},"ecmaFeatures":{"experimentalObjectRestSpread":true,"jsx":true},"sourceType":"module"},"plugins":["prettier","react","import","react-hooks","jsx-a11y"],"rules":{"no-console":"warn","no-unused-vars":"error","react/display-name":"off","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn","no-use-before-define":"error"}},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"src/**/*.{js,css}":["prettier --write","git add","yarn lint"]},"prettier":{"endOfLine":"lf","useTabs":false,"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"all","bracketSameLine":false,"bracketSpacing":true,"parser":"babel","semi":true,"arrowParens":"avoid"}};
6702
+ module.exports = {"name":"@sis-cc/dotstatsuite-visions","version":"10.12.0","description":"Library of visual components","author":"OECD","homepage":"https://visions-qa.siscc.org/#o","license":"MIT","repository":"https://gitlab.com/sis-cc/.stat-suite/dotstatsuite-visions","main":"lib/index.js","module":"es/index.js","engines":{"node":">=14"},"files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component --copy-files --no-demo && node scripts/doc && nwb build-demo","build:dev":"nwb build-react-component --copy-files --no-demo","clean":"nwb clean-module && nwb clean-demo","prepublishOnly":"npm run build","start":"nwb serve-react-demo","test":"jest","test:watch":"jest --watch --no-cache","lint":"eslint src/ --color","precommit":"lint-staged"},"dependencies":{"@react-hook/size":"^2.1.1","classnames":"^2.2.6","date-fns":"^1.30.1","isemail":"^3.2.0","numeral":"^2.0.6","prop-types":"^15.7.2","ramda":"^0.27.0","react-beautiful-dnd":"^13.0.0","react-draggable":"^4.4.5","react-error-boundary":"^4.0.10","react-virtualized":"^9.21.2"},"peerDependencies":{"@material-ui/core":"^4","@material-ui/icons":"^4","@sis-cc/dotstatsuite-sdmxjs":"^8.x","react":"^18","react-dom":"^18"},"devDependencies":{"@babel/eslint-parser":"^7.5.4","@babel/plugin-syntax-dynamic-import":"^7.2.0","@cfaester/enzyme-adapter-react-18":"^0.7.0","@material-ui/core":"^4","@material-ui/icons":"^4","@sis-cc/dotstatsuite-sdmxjs":"*","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","babel-jest":"^24.8.0","babel-preset-react-app":"^9.0.0","dox":"^0.9.0","eslint":"^8.39.0","eslint-plugin-import":"^2.27.5","eslint-plugin-jsx-a11y":"^6.7.1","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","husky":"^2.7.0","identity-obj-proxy":"^3.0.0","jest":"^24.8.0","jss":"^10.10.0","jss-rtl":"^0.2.3","lint-staged":"^8.2.1","mutationobserver-shim":"^0.3.7","nwb":"0.23.0","prettier":"^2.8.8","pretty-quick":"^3.1.3","react":"^18","react-a11y":"^1.1.0","react-dom":"^18","react-helmet":"^5.2.1","react-scrollable-anchor":"^0.6.1","react-syntax-highlighter":"^10.2.1","sanitize-html":"2.7.0","webpack":"^5.68.0","webpack-cli":"^4.9.2","webpack-dev-server":"^4.7.4"},"jest":{"verbose":true,"coverageDirectory":"coverage","collectCoverageFrom":["src/**/*.{js,jsx,ts,tsx}","!src/ScopeList/*.{js,jsx,ts,tsx}","!src/**/*.d.ts"],"setupFilesAfterEnv":["<rootDir>/tests/setup.js"],"testMatch":["**/tests/**/*.{spec,test}.{js,jsx,ts,tsx}","!**/tests/ScopeList.test.js"],"testEnvironment":"jsdom","transform":{"^.+\\.(js|jsx|ts|tsx)$":"<rootDir>/node_modules/babel-jest"},"transformIgnorePatterns":["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$","^.+\\.module\\.(css|sass|scss)$"],"modulePaths":[],"moduleNameMapper":{"^react-native$":"react-native-web","^.+\\.module\\.(css|sass|scss)$":"identity-obj-proxy","\\.(jpg|jpeg|png)$":"identity-obj-proxy"},"moduleFileExtensions":["web.js","js","web.ts","ts","web.tsx","tsx","json","web.jsx","jsx","node"]},"babel":{"presets":["react-app"],"plugins":["@babel/plugin-syntax-dynamic-import"]},"eslintConfig":{"env":{"browser":true,"jest":true,"node":true,"es6":true},"extends":["eslint:recommended","plugin:react/recommended","plugin:jsx-a11y/recommended"],"parser":"@babel/eslint-parser","parserOptions":{"babelOptions":{"presets":[["babel-preset-react-app",false],"babel-preset-react-app/test"]},"ecmaFeatures":{"experimentalObjectRestSpread":true,"jsx":true},"sourceType":"module"},"plugins":["prettier","react","import","react-hooks","jsx-a11y"],"rules":{"no-console":"warn","no-unused-vars":"error","react/display-name":"off","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn","no-use-before-define":"error"}},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"src/**/*.{js,css}":["prettier --write","git add","yarn lint"]},"prettier":{"endOfLine":"lf","useTabs":false,"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"all","bracketSameLine":false,"bracketSpacing":true,"parser":"babel","semi":true,"arrowParens":"avoid"}};
6703
6703
 
6704
6704
  /***/ }),
6705
6705
  /* 122 */
@@ -70942,18 +70942,18 @@ var utils_getDeprecatedIds = function getDeprecatedIds(ids, items, selectedIds)
70942
70942
 
70943
70943
  var deprecatedParents = es_reduce(function (acc, id) {
70944
70944
  var _item = es_prop(id, indexedItemsById);
70945
- if (!utils_isItemSelected(selectedIds)(_item)) {
70946
- return acc;
70947
- }
70948
70945
  var _itemsIds = es_has('hierarchicalId', _item) ? pipe(es_values, es_filter(es_propEq('id', _item.id)), es_map(utils_getHierarchicalId))(indexedItemsById) : [id];
70949
70946
 
70950
- if (es_propOr(true, 'isEnabled', _item)) {
70951
- return acc;
70952
- }
70953
70947
  var children = pipe(es_props(_itemsIds), es_unnest)(groupedItemsByParentId);
70954
70948
  var selectedChild = es_find(function (child) {
70955
70949
  return !es_includes(utils_getHierarchicalId(child), _ids) && utils_isItemSelected(selectedIds)(child);
70956
70950
  }, children);
70951
+ if (!utils_isItemSelected(selectedIds)(_item) && es_isNil(selectedChild)) {
70952
+ return es_concat(reccurse([id]), acc);
70953
+ }
70954
+ if (!es_propOr(false, 'isGreyed', _item)) {
70955
+ return acc;
70956
+ }
70957
70957
  if (es_isNil(selectedChild)) {
70958
70958
  return es_concat(acc, _itemsIds);
70959
70959
  }
@@ -72384,10 +72384,15 @@ var HierarchicalFilter_extends = Object.assign || function (target) { for (var i
72384
72384
 
72385
72385
 
72386
72386
  var HierarchicalFilter_getCounter = function getCounter(items, disableAccessor, tagAccessor) {
72387
- var count = pipe(es_filter(function (item) {
72388
- return es_prop('isSelected', item) && !disableAccessor(item);
72389
- }), es_map(es_prop('id')), es_uniq, es_length)(items);
72390
- var total = pipe(es_when(es_always(es_is(Function, disableAccessor)), es_reject(disableAccessor)), es_map(es_prop('id')), es_uniq, es_length)(items);
72387
+ var selectedItemsIds = es_reduce(function (acc, item) {
72388
+ if (es_prop('isSelected', item)) {
72389
+ return es_append(item.id, acc);
72390
+ }
72391
+ return acc;
72392
+ }, [], items);
72393
+ var itemsIds = es_pluck('id', items);
72394
+ var count = pipe(es_uniq, es_length)(selectedItemsIds);
72395
+ var total = pipe(es_uniq, es_length)(itemsIds);
72391
72396
  if (es_is(Function, tagAccessor)) {
72392
72397
  return tagAccessor(count, total);
72393
72398
  }