@sis-cc/dotstatsuite-visions 10.23.0 → 10.24.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.
@@ -188,6 +188,14 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
188
188
  height = _useState3[0],
189
189
  setHeight = _useState3[1];
190
190
 
191
+ var getTotal = function getTotal(items, spotlightAcc) {
192
+ var itemsIds = R.pluck('id', items);
193
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
194
+ if (R.is(Function, spotlightAcc)) {
195
+ return spotlightAcc(total);
196
+ }
197
+ return total;
198
+ };
191
199
  var measureRef = React.useCallback(function (node) {
192
200
  if (node !== null) {
193
201
  setHeight(node.getBoundingClientRect().height * 75 / 100);
@@ -398,7 +406,7 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
398
406
  { className: isNarrow ? classes.narrowSpotlight : classes.spotlight },
399
407
  React.createElement(Spotlight, {
400
408
  hasClearAll: true,
401
- placeholder: R.prop('placeholder', labels),
409
+ placeholder: getTotal(items, R.prop('placeholder', labels)),
402
410
  term: spotlight.term,
403
411
  hasCommit: false,
404
412
  spotlight: { fields: {} },
@@ -28,7 +28,14 @@ var getCounter = function getCounter(items, disableAccessor, tagAccessor) {
28
28
  }
29
29
  return count + '/' + total;
30
30
  };
31
-
31
+ var getTotal = function getTotal(items, spotlightAcc) {
32
+ var itemsIds = R.pluck('id', items);
33
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
34
+ if (R.is(Function, spotlightAcc)) {
35
+ return spotlightAcc(total);
36
+ }
37
+ return total;
38
+ };
32
39
  var HierarchicalFilter = function HierarchicalFilter(props) {
33
40
  var id = props.id,
34
41
  items = props.items,
@@ -97,7 +104,7 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
97
104
  className: { container: classes.middle },
98
105
  fullWidth: true,
99
106
  hasClearAll: true,
100
- placeholder: R.prop('placeholder', labels),
107
+ placeholder: getTotal(items, R.prop('placeholder', labels)),
101
108
  term: spotlight.term,
102
109
  hasCommit: false,
103
110
  spotlight: { fields: {} },
@@ -258,6 +258,14 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
258
258
  height = _useState3[0],
259
259
  setHeight = _useState3[1];
260
260
 
261
+ var getTotal = function getTotal(items, spotlightAcc) {
262
+ var itemsIds = R.pluck('id', items);
263
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
264
+ if (R.is(Function, spotlightAcc)) {
265
+ return spotlightAcc(total);
266
+ }
267
+ return total;
268
+ };
261
269
  var measureRef = _react2.default.useCallback(function (node) {
262
270
  if (node !== null) {
263
271
  setHeight(node.getBoundingClientRect().height * 75 / 100);
@@ -468,7 +476,7 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
468
476
  { className: isNarrow ? classes.narrowSpotlight : classes.spotlight },
469
477
  _react2.default.createElement(_.Spotlight, {
470
478
  hasClearAll: true,
471
- placeholder: R.prop('placeholder', labels),
479
+ placeholder: getTotal(items, R.prop('placeholder', labels)),
472
480
  term: spotlight.term,
473
481
  hasCommit: false,
474
482
  spotlight: { fields: {} },
@@ -57,7 +57,14 @@ var getCounter = function getCounter(items, disableAccessor, tagAccessor) {
57
57
  }
58
58
  return count + '/' + total;
59
59
  };
60
-
60
+ var getTotal = function getTotal(items, spotlightAcc) {
61
+ var itemsIds = R.pluck('id', items);
62
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
63
+ if (R.is(Function, spotlightAcc)) {
64
+ return spotlightAcc(total);
65
+ }
66
+ return total;
67
+ };
61
68
  var HierarchicalFilter = function HierarchicalFilter(props) {
62
69
  var id = props.id,
63
70
  items = props.items,
@@ -126,7 +133,7 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
126
133
  className: { container: classes.middle },
127
134
  fullWidth: true,
128
135
  hasClearAll: true,
129
- placeholder: R.prop('placeholder', labels),
136
+ placeholder: getTotal(items, R.prop('placeholder', labels)),
130
137
  term: spotlight.term,
131
138
  hasCommit: false,
132
139
  spotlight: { fields: {} },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "10.23.0",
3
+ "version": "10.24.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.23.0 - https://visions-qa.siscc.org/#o
2
+ * @sis-cc/dotstatsuite-visions v10.24.0 - https://visions-qa.siscc.org/#o
3
3
  * MIT Licensed
4
4
  */
5
5
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -6697,7 +6697,7 @@ function removeClassName(el
6697
6697
  /* 119 */
6698
6698
  /***/ (function(module) {
6699
6699
 
6700
- module.exports = {"name":"@sis-cc/dotstatsuite-visions","version":"10.23.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"}};
6700
+ module.exports = {"name":"@sis-cc/dotstatsuite-visions","version":"10.24.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"}};
6701
6701
 
6702
6702
  /***/ }),
6703
6703
  /* 120 */
@@ -72105,6 +72105,14 @@ var AdvancedFilterDialog_AdvancedFilterDialog = function AdvancedFilterDialog(pr
72105
72105
  height = _useState3[0],
72106
72106
  setHeight = _useState3[1];
72107
72107
 
72108
+ var getTotal = function getTotal(items, spotlightAcc) {
72109
+ var itemsIds = es_pluck('id', items);
72110
+ var total = pipe(es_uniq, es_length)(itemsIds);
72111
+ if (es_is(Function, spotlightAcc)) {
72112
+ return spotlightAcc(total);
72113
+ }
72114
+ return total;
72115
+ };
72108
72116
  var measureRef = react_default.a.useCallback(function (node) {
72109
72117
  if (node !== null) {
72110
72118
  setHeight(node.getBoundingClientRect().height * 75 / 100);
@@ -72315,7 +72323,7 @@ var AdvancedFilterDialog_AdvancedFilterDialog = function AdvancedFilterDialog(pr
72315
72323
  { className: isNarrow ? classes.narrowSpotlight : classes.spotlight },
72316
72324
  react_default.a.createElement(src_Spotlight_Spotlight, {
72317
72325
  hasClearAll: true,
72318
- placeholder: es_prop('placeholder', labels),
72326
+ placeholder: getTotal(items, es_prop('placeholder', labels)),
72319
72327
  term: spotlight.term,
72320
72328
  hasCommit: false,
72321
72329
  spotlight: { fields: {} },
@@ -72497,7 +72505,14 @@ var HierarchicalFilter_getCounter = function getCounter(items, disableAccessor,
72497
72505
  }
72498
72506
  return count + '/' + total;
72499
72507
  };
72500
-
72508
+ var HierarchicalFilter_getTotal = function getTotal(items, spotlightAcc) {
72509
+ var itemsIds = es_pluck('id', items);
72510
+ var total = pipe(es_uniq, es_length)(itemsIds);
72511
+ if (es_is(Function, spotlightAcc)) {
72512
+ return spotlightAcc(total);
72513
+ }
72514
+ return total;
72515
+ };
72501
72516
  var HierarchicalFilter_HierarchicalFilter = function HierarchicalFilter(props) {
72502
72517
  var id = props.id,
72503
72518
  items = props.items,
@@ -72566,7 +72581,7 @@ var HierarchicalFilter_HierarchicalFilter = function HierarchicalFilter(props) {
72566
72581
  className: { container: classes.middle },
72567
72582
  fullWidth: true,
72568
72583
  hasClearAll: true,
72569
- placeholder: es_prop('placeholder', labels),
72584
+ placeholder: HierarchicalFilter_getTotal(items, es_prop('placeholder', labels)),
72570
72585
  term: spotlight.term,
72571
72586
  hasCommit: false,
72572
72587
  spotlight: { fields: {} },