@sis-cc/dotstatsuite-visions 9.1.0 → 10.0.1

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.
@@ -1,94 +1,94 @@
1
- /**
2
- * Scope List allow a horizontal navigation in a tree
3
- * (open console to see selection onClick, onKeyPress)
4
- *
5
- * limitDisplay: default 0. by default the filter will be blank if items content n of in the list.
6
- *
7
- * displayAccessor: if displayAccessor is defined the list will be the items return by displayAccessor,
8
- * in other word if the prop defined get by displayAccessor is not there, then the scope list will ignore the item and the item will be completely hide
9
- *
10
- * disabledAccessor: this accessor allow you to allow disabled items. Contrary to displayAccessor the item will be show but not clikable.
11
- *
12
- * bulkselection: allow and show button to selection entire level or current view
13
- *
14
- * @memberOf VISIONS
15
- * @name ScopeList
16
- * @tag component
17
- * @api public
18
- * @props
19
- * ScopeList.propTypes = {
20
- * disableAccessor: PropTypes.func,
21
- * displayAccessor: PropTypes.func,
22
- * testId: PropTypes.string,
23
- * term: PropTypes.string,
24
- * id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
25
- * label: PropTypes.string,
26
- * accessibility: PropTypes.bool,
27
- * limitDisplay: PropTypes.number
28
- * items: {
29
- * id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
30
- * label: PropTypes.string,
31
- * parentId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
32
- * isSelected: PropTypes.bool,
33
- * isDisabled: PropTypes.bool,
34
- * count: PropTypes.number,
35
- * path: PropTypes.arrayOf(PropTypes.shape({
36
- * id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
37
- * label: PropTypes.string,
38
- * parentId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
39
- * isSelected: PropTypes.bool,
40
- * })),
41
- * [yourDisplayAccessorKey]: PropTypes.bool,
42
- * },
43
- * spotlight, c.f proptype spotlight
44
- * mainPlaceholder: PropTypes.string,
45
- * secondaryPlaceholder: PropTypes.string,
46
- * activePanelId: PropTypes.string,,
47
- * hasPath: PropTypes.bool,
48
- * changeSelection: PropTypes.func,
49
- * labels: {
50
- * childrenNavigateDesc: PropTypes.string,
51
- * navigateBefore: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
52
- * navigateNext: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
53
- * backHelper: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
54
- * disableItemLabel: PropTypes.string,
55
- * selection: {
56
- * title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
57
- * currentLevel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
58
- * level: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
59
- * }
60
- * },
61
- * expansionPanelProps: PropTypes.object
62
- * bulkSelection: PropTypes.bool
63
- * labelRenderer: PropTypes.func,
64
- * };
65
- * @theme
66
- * // see ExpansionPanel too custom open and close scopelist
67
- * level: a level is the current tree level start from level 1
68
- * {
69
- * palette: {
70
- * primary: {
71
- * main: // label color and background color of around arrow to see children. global override: outerPalette.primaryMain
72
- * },
73
- * common: {
74
- * white: // color of arrow to see children
75
- * },
76
- * action: {
77
- * hover: // background color of element and header element (from level 2) on hover or selected
78
- * selected: // background color of focus element (accessibility must be set to true) or hover of selected element
79
- * },
80
- * grey: {
81
- * 100: // color of tough line (line displayed from level 2)
82
- * 600: // count label (after label element) and path label color (use search to see path)
83
- * 700: // disabled label
84
- * 800: // arrow color between header element (displayed from level 3). globale override: outerPalette.textLight
85
- * }
86
- * }
87
- * }
88
- * @testId
89
- * @demoReady
90
- * root: [testId]
91
- * value: [testId]_value_[props.items.id]
1
+ /**
2
+ * Scope List allow a horizontal navigation in a tree
3
+ * (open console to see selection onClick, onKeyPress)
4
+ *
5
+ * limitDisplay: default 0. by default the filter will be blank if items content n of in the list.
6
+ *
7
+ * displayAccessor: if displayAccessor is defined the list will be the items return by displayAccessor,
8
+ * in other word if the prop defined get by displayAccessor is not there, then the scope list will ignore the item and the item will be completely hide
9
+ *
10
+ * disabledAccessor: this accessor allow you to allow disabled items. Contrary to displayAccessor the item will be show but not clikable.
11
+ *
12
+ * bulkselection: allow and show button to selection entire level or current view
13
+ *
14
+ * @memberOf VISIONS
15
+ * @name ScopeList
16
+ * @tag component
17
+ * @api public
18
+ * @props
19
+ * ScopeList.propTypes = {
20
+ * disableAccessor: PropTypes.func,
21
+ * displayAccessor: PropTypes.func,
22
+ * testId: PropTypes.string,
23
+ * term: PropTypes.string,
24
+ * id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
25
+ * label: PropTypes.string,
26
+ * accessibility: PropTypes.bool,
27
+ * limitDisplay: PropTypes.number
28
+ * items: {
29
+ * id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
30
+ * label: PropTypes.string,
31
+ * parentId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
32
+ * isSelected: PropTypes.bool,
33
+ * isDisabled: PropTypes.bool,
34
+ * count: PropTypes.number,
35
+ * path: PropTypes.arrayOf(PropTypes.shape({
36
+ * id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
37
+ * label: PropTypes.string,
38
+ * parentId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
39
+ * isSelected: PropTypes.bool,
40
+ * })),
41
+ * [yourDisplayAccessorKey]: PropTypes.bool,
42
+ * },
43
+ * spotlight, c.f proptype spotlight
44
+ * mainPlaceholder: PropTypes.string,
45
+ * secondaryPlaceholder: PropTypes.string,
46
+ * activePanelId: PropTypes.string,,
47
+ * hasPath: PropTypes.bool,
48
+ * changeSelection: PropTypes.func,
49
+ * labels: {
50
+ * childrenNavigateDesc: PropTypes.string,
51
+ * navigateBefore: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
52
+ * navigateNext: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
53
+ * backHelper: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
54
+ * disableItemLabel: PropTypes.string,
55
+ * selection: {
56
+ * title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
57
+ * currentLevel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
58
+ * level: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
59
+ * }
60
+ * },
61
+ * expansionPanelProps: PropTypes.object
62
+ * bulkSelection: PropTypes.bool
63
+ * labelRenderer: PropTypes.func,
64
+ * };
65
+ * @theme
66
+ * // see ExpansionPanel too custom open and close scopelist
67
+ * level: a level is the current tree level start from level 1
68
+ * {
69
+ * palette: {
70
+ * primary: {
71
+ * main: // label color and background color of around arrow to see children. global override: outerPalette.primaryMain
72
+ * },
73
+ * common: {
74
+ * white: // color of arrow to see children
75
+ * },
76
+ * action: {
77
+ * hover: // background color of element and header element (from level 2) on hover or selected
78
+ * selected: // background color of focus element (accessibility must be set to true) or hover of selected element
79
+ * },
80
+ * grey: {
81
+ * 100: // color of tough line (line displayed from level 2)
82
+ * 600: // count label (after label element) and path label color (use search to see path)
83
+ * 700: // disabled label
84
+ * 800: // arrow color between header element (displayed from level 3). globale override: outerPalette.textLight
85
+ * }
86
+ * }
87
+ * }
88
+ * @testId
89
+ * @demoReady
90
+ * root: [testId]
91
+ * value: [testId]_value_[props.items.id]
92
92
  */
93
93
 
94
94
  export { default } from './ScopeList';
@@ -167,20 +167,24 @@ var VirtualizedTree = function VirtualizedTree(props) {
167
167
  };
168
168
  var eventsCallbacks = function eventsCallbacks(id, index) {
169
169
  return {
170
- onMouseUp: isMouseDown ? function () {
170
+ onMouseUp: isMouseDown ? function (e) {
171
+ e.preventDefault();
171
172
  apply();
172
173
  if (!R.isEmpty(selectIds)) {
173
174
  setLastItemId(id);
174
175
  }
176
+ setIsMouseDown(false);
175
177
  } : null,
176
178
  onMouseDown: function onMouseDown(e) {
179
+ e.preventDefault();
177
180
  if (e.ctrlKey || e.shiftKey) {
178
181
  return;
179
182
  }
180
- multiSelect(id);
181
183
  setIsMouseDown(true);
184
+ multiSelect(id);
182
185
  },
183
186
  onMouseEnter: isMouseDown ? function (e) {
187
+ e.preventDefault();
184
188
  if (e.ctrlKey || e.shiftKey) {
185
189
  return;
186
190
  }
@@ -188,12 +192,15 @@ var VirtualizedTree = function VirtualizedTree(props) {
188
192
  } : null,
189
193
  onClick: function onClick(e) {
190
194
  e.preventDefault();
195
+ setIsMouseDown(false);
196
+ setLastItemId(id);
191
197
  if (e.ctrlKey) {
192
198
  multiSelect(id);
193
199
  } else if (e.shiftKey) {
194
200
  shiftSelect(index);
195
201
  }
196
202
  }
203
+ // ondblclick: () => null
197
204
  };
198
205
  };
199
206
  var onKeyUp = function onKeyUp(e) {
package/es/index.js CHANGED
@@ -28,7 +28,7 @@ export { default as Mode } from './Mode';
28
28
  export { default as Pagination } from './Pagination';
29
29
  export { default as PeriodPicker } from './PeriodPicker';
30
30
  export { spotlightScopeListEngine, reduceChildren } from './utils';
31
- export { default as ScopeList } from './ScopeList';
31
+ //export { default as ScopeList } from './ScopeList';
32
32
  export { default as Select } from './Select';
33
33
  export { default as Share } from './Share';
34
34
  export { default as SisccFooter } from './SisccFooter';
@@ -205,20 +205,24 @@ var VirtualizedTree = function VirtualizedTree(props) {
205
205
  };
206
206
  var eventsCallbacks = function eventsCallbacks(id, index) {
207
207
  return {
208
- onMouseUp: isMouseDown ? function () {
208
+ onMouseUp: isMouseDown ? function (e) {
209
+ e.preventDefault();
209
210
  apply();
210
211
  if (!R.isEmpty(selectIds)) {
211
212
  setLastItemId(id);
212
213
  }
214
+ setIsMouseDown(false);
213
215
  } : null,
214
216
  onMouseDown: function onMouseDown(e) {
217
+ e.preventDefault();
215
218
  if (e.ctrlKey || e.shiftKey) {
216
219
  return;
217
220
  }
218
- multiSelect(id);
219
221
  setIsMouseDown(true);
222
+ multiSelect(id);
220
223
  },
221
224
  onMouseEnter: isMouseDown ? function (e) {
225
+ e.preventDefault();
222
226
  if (e.ctrlKey || e.shiftKey) {
223
227
  return;
224
228
  }
@@ -226,12 +230,15 @@ var VirtualizedTree = function VirtualizedTree(props) {
226
230
  } : null,
227
231
  onClick: function onClick(e) {
228
232
  e.preventDefault();
233
+ setIsMouseDown(false);
234
+ setLastItemId(id);
229
235
  if (e.ctrlKey) {
230
236
  multiSelect(id);
231
237
  } else if (e.shiftKey) {
232
238
  shiftSelect(index);
233
239
  }
234
240
  }
241
+ // ondblclick: () => null
235
242
  };
236
243
  };
237
244
  var onKeyUp = function onKeyUp(e) {
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  exports.__esModule = true;
4
- exports.T4_BREAKPOINTS = exports.innerPalette = exports.sisccTheme = exports.HierarchicalFilter = exports.AdvancedFilterDialog = exports.VirtualizedTree = exports.AuthDialog = exports.VerticalButton = exports.UserRightForm = exports.Tooltip = exports.ToggleButton = exports.Tag = exports.TablePreview = exports.TableLayout = exports.Cell = exports.TableHtml5 = exports.TableHeader = exports.TableFooter = exports.Spotlight = exports.SisccFooter = exports.Share = exports.Select = exports.ScopeList = exports.reduceChildren = exports.spotlightScopeListEngine = exports.PeriodPicker = exports.Pagination = exports.Mode = exports.NoData = exports.Logo = exports.Loading = exports.LabelDivider = exports.InputNumber = exports.Input = exports.ExpansionPanel = exports.DataFooter = exports.DataHeader = exports.Dataflow = exports.DataEdit = exports.Contact = exports.CollapsibleTree = exports.CollapseButtons = exports.GroupedChips = exports.DeleteAllChip = exports.ChartsConfig = exports.Button = exports.Breadcrumbs = exports.ApiQueries = exports.Alert = undefined;
4
+ exports.T4_BREAKPOINTS = exports.innerPalette = exports.sisccTheme = exports.HierarchicalFilter = exports.AdvancedFilterDialog = exports.VirtualizedTree = exports.AuthDialog = exports.VerticalButton = exports.UserRightForm = exports.Tooltip = exports.ToggleButton = exports.Tag = exports.TablePreview = exports.TableLayout = exports.Cell = exports.TableHtml5 = exports.TableHeader = exports.TableFooter = exports.Spotlight = exports.SisccFooter = exports.Share = exports.Select = exports.reduceChildren = exports.spotlightScopeListEngine = exports.PeriodPicker = exports.Pagination = exports.Mode = exports.NoData = exports.Logo = exports.Loading = exports.LabelDivider = exports.InputNumber = exports.Input = exports.ExpansionPanel = exports.DataFooter = exports.DataHeader = exports.Dataflow = exports.DataEdit = exports.Contact = exports.CollapsibleTree = exports.CollapseButtons = exports.GroupedChips = exports.DeleteAllChip = exports.ChartsConfig = exports.Button = exports.Breadcrumbs = exports.ApiQueries = exports.Alert = undefined;
5
5
 
6
6
  var _Alert = require('./Alert');
7
7
 
@@ -243,15 +243,6 @@ Object.defineProperty(exports, 'reduceChildren', {
243
243
  }
244
244
  });
245
245
 
246
- var _ScopeList = require('./ScopeList');
247
-
248
- Object.defineProperty(exports, 'ScopeList', {
249
- enumerable: true,
250
- get: function get() {
251
- return _interopRequireDefault(_ScopeList).default;
252
- }
253
- });
254
-
255
246
  var _Select = require('./Select');
256
247
 
257
248
  Object.defineProperty(exports, 'Select', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "9.1.0",
3
+ "version": "10.0.1",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",
@@ -45,7 +45,8 @@
45
45
  "@material-ui/core": "^4",
46
46
  "@material-ui/icons": "^4",
47
47
  "@sis-cc/dotstatsuite-sdmxjs": "^8.x",
48
- "react": "^18"
48
+ "react": "^18",
49
+ "react-dom": "^18"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@babel/eslint-parser": "^7.5.4",
@@ -59,7 +60,6 @@
59
60
  "babel-jest": "^24.8.0",
60
61
  "babel-preset-react-app": "^9.0.0",
61
62
  "dox": "^0.9.0",
62
- "enzyme": "^3.10.0",
63
63
  "eslint": "^8.39.0",
64
64
  "eslint-plugin-import": "^2.27.5",
65
65
  "eslint-plugin-jsx-a11y": "^6.7.1",
@@ -92,13 +92,15 @@
92
92
  "coverageDirectory": "coverage",
93
93
  "collectCoverageFrom": [
94
94
  "src/**/*.{js,jsx,ts,tsx}",
95
+ "!src/ScopeList/*.{js,jsx,ts,tsx}",
95
96
  "!src/**/*.d.ts"
96
97
  ],
97
98
  "setupFilesAfterEnv": [
98
99
  "<rootDir>/tests/setup.js"
99
100
  ],
100
101
  "testMatch": [
101
- "**/tests/**/*.{spec,test}.{js,jsx,ts,tsx}"
102
+ "**/tests/**/*.{spec,test}.{js,jsx,ts,tsx}",
103
+ "!**/tests/ScopeList.test.js"
102
104
  ],
103
105
  "testEnvironment": "jsdom",
104
106
  "transform": {