@sis-cc/dotstatsuite-visions 10.29.0 → 11.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/es/AdvancedFilterDialog/AdvancedFilterDialog.js +1 -1
- package/es/NoData/NoData.js +2 -5
- package/es/Spotlight/Fields.js +3 -6
- package/es/TableHtml5/TableHtml5.js +2 -4
- package/es/TableLayout/TableLayout.js +136 -69
- package/es/TableLayout/lib.js +5 -0
- package/es/TablePreview/TablePreview.js +73 -76
- package/es/TablePreview/lib.js +5 -6
- package/lib/AdvancedFilterDialog/AdvancedFilterDialog.js +1 -1
- package/lib/NoData/NoData.js +2 -5
- package/lib/Spotlight/Fields.js +3 -6
- package/lib/TableHtml5/TableHtml5.js +1 -3
- package/lib/TableLayout/TableLayout.js +134 -67
- package/lib/TableLayout/lib.js +6 -1
- package/lib/TablePreview/TablePreview.js +75 -75
- package/lib/TablePreview/lib.js +6 -7
- package/package.json +1 -1
- package/umd/@sis-cc/dotstatsuite-visions.js +1386 -1830
- package/umd/@sis-cc/dotstatsuite-visions.min.js +9 -9
- package/umd/@sis-cc/dotstatsuite-visions.min.js.map +1 -1
|
@@ -550,7 +550,7 @@ AdvancedFilterDialog.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
550
550
|
isOpen: PropTypes.bool,
|
|
551
551
|
items: PropTypes.array,
|
|
552
552
|
labels: PropTypes.shape({
|
|
553
|
-
placeholder: PropTypes.string,
|
|
553
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
554
554
|
disableItemLabel: PropTypes.string,
|
|
555
555
|
singleSelection: PropTypes.string,
|
|
556
556
|
childrenSelection: PropTypes.string,
|
package/es/NoData/NoData.js
CHANGED
|
@@ -20,7 +20,8 @@ var useStyles = makeStyles(function () {
|
|
|
20
20
|
var NO_RESULT_MESSAGE_ID = 'noResultMessage';
|
|
21
21
|
|
|
22
22
|
var NoData = function NoData(_ref) {
|
|
23
|
-
var icon = _ref.icon,
|
|
23
|
+
var _ref$icon = _ref.icon,
|
|
24
|
+
icon = _ref$icon === undefined ? React.createElement(Error, { color: 'primary', fontSize: 'large' }) : _ref$icon,
|
|
24
25
|
message = _ref.message;
|
|
25
26
|
|
|
26
27
|
var classes = useStyles();
|
|
@@ -45,8 +46,4 @@ NoData.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
45
46
|
message: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
46
47
|
} : {};
|
|
47
48
|
|
|
48
|
-
NoData.defaultProps = {
|
|
49
|
-
icon: React.createElement(Error, { color: 'primary', fontSize: 'large' })
|
|
50
|
-
};
|
|
51
|
-
|
|
52
49
|
export default NoData;
|
package/es/Spotlight/Fields.js
CHANGED
|
@@ -8,7 +8,8 @@ import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
|
|
|
8
8
|
import Check from '@material-ui/icons/Check';
|
|
9
9
|
|
|
10
10
|
export var Field = function Field(_ref) {
|
|
11
|
-
var spotlight = _ref.spotlight,
|
|
11
|
+
var _ref$spotlight = _ref.spotlight,
|
|
12
|
+
spotlight = _ref$spotlight === undefined ? {} : _ref$spotlight,
|
|
12
13
|
onChangeField = _ref.onChangeField,
|
|
13
14
|
isRtl = _ref.isRtl,
|
|
14
15
|
classes = _ref.classes;
|
|
@@ -96,8 +97,4 @@ Field.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
96
97
|
}),
|
|
97
98
|
onChangeField: PropTypes.func.isRequired,
|
|
98
99
|
isRtl: PropTypes.bool
|
|
99
|
-
} : {};
|
|
100
|
-
|
|
101
|
-
Field.defaultProps = {
|
|
102
|
-
spotlight: {}
|
|
103
|
-
};
|
|
100
|
+
} : {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
2
2
|
|
|
3
|
-
import React, { useRef, useState, useEffect, useMemo
|
|
3
|
+
import React, { useRef, useState, useEffect, useMemo } from 'react';
|
|
4
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import * as R from 'ramda';
|
|
@@ -101,8 +101,6 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
101
101
|
var headerRef = useRef(null);
|
|
102
102
|
var subHeadCellsRef = useRef([]);
|
|
103
103
|
|
|
104
|
-
var cellValueAccessorHandler = useCallback(cellValueAccessor, []);
|
|
105
|
-
|
|
106
104
|
useEffect(function () {
|
|
107
105
|
setHeaderHeight(R.pathOr(0, ['current', 'clientHeight'], headerRef));
|
|
108
106
|
setSubHeadCellsWidth(getCellsWidth(R.prop('current', subHeadCellsRef)));
|
|
@@ -185,7 +183,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
185
183
|
SideIcon: SideIcon,
|
|
186
184
|
subHeadCellsWidth: subHeadCellsWidth,
|
|
187
185
|
HTMLRenderer: HTMLRenderer,
|
|
188
|
-
cellValueAccessor:
|
|
186
|
+
cellValueAccessor: cellValueAccessor,
|
|
189
187
|
labelAccessor: labelAccessor,
|
|
190
188
|
isNoWrap: isNoWrap,
|
|
191
189
|
textAlign: textAlign
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
2
2
|
|
|
3
|
-
import React, { Fragment, useState, useEffect } from 'react';
|
|
3
|
+
import React, { Fragment, useState, useMemo, useEffect } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import * as R from 'ramda';
|
|
@@ -17,7 +17,7 @@ import { DragDropContext } from 'react-beautiful-dnd';
|
|
|
17
17
|
import { withBlank } from '../utils';
|
|
18
18
|
import TablePreview from '../TablePreview';
|
|
19
19
|
import Box from './Box';
|
|
20
|
-
import { changeLayout,
|
|
20
|
+
import { changeLayout, getIsOptionalActivated } from './lib';
|
|
21
21
|
import { BOX, wcagId } from './constants';
|
|
22
22
|
import { Button } from '../';
|
|
23
23
|
|
|
@@ -34,6 +34,12 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
34
34
|
flexDirection: 'row',
|
|
35
35
|
alignItems: 'center',
|
|
36
36
|
flexFlow: 'nowrap'
|
|
37
|
+
},
|
|
38
|
+
activationButton: {
|
|
39
|
+
backgroundColor: theme.palette.action.hover,
|
|
40
|
+
'&:hover': {
|
|
41
|
+
backgroundColor: theme.palette.action.selected
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
};
|
|
39
45
|
});
|
|
@@ -46,7 +52,11 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
46
52
|
var _boxLabel;
|
|
47
53
|
|
|
48
54
|
var _ref$layout = _ref.layout,
|
|
49
|
-
layout = _ref$layout === undefined ?
|
|
55
|
+
layout = _ref$layout === undefined ? {} : _ref$layout,
|
|
56
|
+
_ref$items = _ref.items,
|
|
57
|
+
items = _ref$items === undefined ? [] : _ref$items,
|
|
58
|
+
_ref$optionalItem = _ref.optionalItem,
|
|
59
|
+
optionalItem = _ref$optionalItem === undefined ? {} : _ref$optionalItem,
|
|
50
60
|
_ref$itemRenderer = _ref.itemRenderer,
|
|
51
61
|
itemRenderer = _ref$itemRenderer === undefined ? R.prop('name') : _ref$itemRenderer,
|
|
52
62
|
itemButtonProps = _ref.itemButtonProps,
|
|
@@ -56,40 +66,51 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
56
66
|
accessibility = _ref.accessibility;
|
|
57
67
|
|
|
58
68
|
var classes = useStyles();
|
|
59
|
-
var hiddenElement = R.map(R.filter(function (_ref2) {
|
|
60
|
-
var isHidden = _ref2.isHidden;
|
|
61
|
-
return isHidden;
|
|
62
|
-
}))(layout);
|
|
63
69
|
|
|
64
|
-
var _useState = useState(
|
|
70
|
+
var _useState = useState(layout),
|
|
65
71
|
currentLayout = _useState[0],
|
|
66
72
|
setCurrentLayout = _useState[1];
|
|
67
73
|
|
|
68
74
|
var boxLabel = (_boxLabel = {}, _boxLabel[BOX.header] = labels.column || BOX.header, _boxLabel[BOX.sections] = labels.section || BOX.sections, _boxLabel[BOX.rows] = labels.row || BOX.rows, _boxLabel);
|
|
69
|
-
|
|
70
75
|
useEffect(function () {
|
|
71
|
-
|
|
76
|
+
setCurrentLayout(layout);
|
|
72
77
|
}, [layout]);
|
|
78
|
+
var indexedItems = useMemo(function () {
|
|
79
|
+
var indexed = R.indexBy(R.prop('id'), items);
|
|
80
|
+
if (!R.isEmpty(optionalItem) && !R.isNil(optionalItem)) {
|
|
81
|
+
return R.assoc(optionalItem.id, optionalItem, indexed);
|
|
82
|
+
}
|
|
83
|
+
return indexed;
|
|
84
|
+
}, [items, optionalItem]);
|
|
73
85
|
|
|
74
86
|
var onChangeLayout = function onChangeLayout(props) {
|
|
75
87
|
return setCurrentLayout(changeLayout(_extends({}, props)));
|
|
76
88
|
};
|
|
77
89
|
|
|
90
|
+
var activateOptionalItem = function activateOptionalItem() {
|
|
91
|
+
var nextLayout = R.over(R.lensProp('header'), R.append(optionalItem.id), currentLayout);
|
|
92
|
+
setCurrentLayout(nextLayout);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
var deactivateOptionalItem = function deactivateOptionalItem() {
|
|
96
|
+
setCurrentLayout(R.map(R.reject(R.equals(optionalItem.id)), currentLayout));
|
|
97
|
+
};
|
|
98
|
+
|
|
78
99
|
var onCommit = function onCommit() {
|
|
79
100
|
if (R.is(Function)(commit)) {
|
|
80
|
-
commit(
|
|
101
|
+
commit(currentLayout);
|
|
81
102
|
}
|
|
82
103
|
};
|
|
83
104
|
|
|
84
105
|
var onCancel = function onCancel() {
|
|
85
106
|
if (R.is(Function)(setCurrentLayout)) {
|
|
86
|
-
setCurrentLayout(
|
|
107
|
+
setCurrentLayout(layout);
|
|
87
108
|
}
|
|
88
109
|
};
|
|
89
110
|
|
|
90
|
-
var onDragStart = function onDragStart(
|
|
91
|
-
var draggableId =
|
|
92
|
-
source =
|
|
111
|
+
var onDragStart = function onDragStart(_ref2, provided) {
|
|
112
|
+
var draggableId = _ref2.draggableId,
|
|
113
|
+
source = _ref2.source;
|
|
93
114
|
|
|
94
115
|
if (R.is(Function)(labels.wcagDragStart)) {
|
|
95
116
|
// start.source = droppableId & index
|
|
@@ -103,9 +124,9 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
103
124
|
}
|
|
104
125
|
};
|
|
105
126
|
|
|
106
|
-
var onDragUpdate = function onDragUpdate(
|
|
107
|
-
var destination =
|
|
108
|
-
source =
|
|
127
|
+
var onDragUpdate = function onDragUpdate(_ref3, provided) {
|
|
128
|
+
var destination = _ref3.destination,
|
|
129
|
+
source = _ref3.source;
|
|
109
130
|
|
|
110
131
|
if (R.isNil(destination)) {
|
|
111
132
|
return;
|
|
@@ -127,10 +148,10 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
127
148
|
};
|
|
128
149
|
|
|
129
150
|
var onDragEnd = function onDragEnd(layout) {
|
|
130
|
-
return function (
|
|
131
|
-
var reason =
|
|
132
|
-
destination =
|
|
133
|
-
source =
|
|
151
|
+
return function (_ref4, provided) {
|
|
152
|
+
var reason = _ref4.reason,
|
|
153
|
+
destination = _ref4.destination,
|
|
154
|
+
source = _ref4.source;
|
|
134
155
|
|
|
135
156
|
if (R.is(String)(labels.wcagDragCancel)) {
|
|
136
157
|
if (R.equals(reason, 'CANCEL')) {
|
|
@@ -164,10 +185,16 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
164
185
|
};
|
|
165
186
|
};
|
|
166
187
|
|
|
188
|
+
var getItems = function getItems(level) {
|
|
189
|
+
return R.pipe(R.prop(level), function (ids) {
|
|
190
|
+
return R.props(ids, indexedItems);
|
|
191
|
+
}, R.filter(R.identity))(currentLayout);
|
|
192
|
+
};
|
|
193
|
+
|
|
167
194
|
var header = React.createElement(Box, {
|
|
168
195
|
title: labels.column,
|
|
169
196
|
Icon: ViewColumn,
|
|
170
|
-
items:
|
|
197
|
+
items: getItems('header'),
|
|
171
198
|
labels: labels,
|
|
172
199
|
dropZoneLabel: BOX.header,
|
|
173
200
|
itemRenderer: itemRenderer,
|
|
@@ -182,7 +209,7 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
182
209
|
React.createElement(Box, {
|
|
183
210
|
title: labels.section,
|
|
184
211
|
Icon: Reorder,
|
|
185
|
-
items:
|
|
212
|
+
items: getItems('sections'),
|
|
186
213
|
labels: labels,
|
|
187
214
|
dropZoneLabel: BOX.sections,
|
|
188
215
|
itemRenderer: itemRenderer,
|
|
@@ -193,7 +220,7 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
193
220
|
React.createElement(Box, {
|
|
194
221
|
title: labels.row,
|
|
195
222
|
Icon: ViewList,
|
|
196
|
-
items:
|
|
223
|
+
items: getItems('rows'),
|
|
197
224
|
labels: labels,
|
|
198
225
|
dropZoneLabel: BOX.rows,
|
|
199
226
|
itemRenderer: itemRenderer,
|
|
@@ -203,6 +230,8 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
203
230
|
})
|
|
204
231
|
);
|
|
205
232
|
|
|
233
|
+
var isOptionalActivated = getIsOptionalActivated(currentLayout, R.prop('id', optionalItem));
|
|
234
|
+
|
|
206
235
|
return React.createElement(
|
|
207
236
|
Grid,
|
|
208
237
|
{ 'data-testid': 'table-layout-test-id', container: true },
|
|
@@ -267,63 +296,101 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
267
296
|
labels.table
|
|
268
297
|
)
|
|
269
298
|
),
|
|
270
|
-
React.createElement(TablePreview,
|
|
299
|
+
React.createElement(TablePreview, {
|
|
300
|
+
header: R.props(R.prop('header', currentLayout), indexedItems),
|
|
301
|
+
sections: R.props(R.prop('sections', currentLayout), indexedItems),
|
|
302
|
+
rows: R.props(R.prop('rows', currentLayout), indexedItems),
|
|
303
|
+
itemRenderer: itemRenderer
|
|
304
|
+
})
|
|
271
305
|
)
|
|
272
306
|
)
|
|
273
307
|
)
|
|
274
308
|
),
|
|
275
309
|
React.createElement(
|
|
276
310
|
Grid,
|
|
277
|
-
{
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
311
|
+
{
|
|
312
|
+
container: true,
|
|
313
|
+
justifyContent: 'space-between',
|
|
314
|
+
className: classes.buttonContainer,
|
|
315
|
+
spacing: 1
|
|
316
|
+
},
|
|
317
|
+
React.createElement(
|
|
318
|
+
Grid,
|
|
319
|
+
{
|
|
320
|
+
item: true,
|
|
321
|
+
'data-testid': isOptionalActivated ? 'table-layout-deactivate-optional' : 'table-layout-activate-optional'
|
|
322
|
+
},
|
|
323
|
+
!R.isNil(optionalItem) && !R.isEmpty(optionalItem) && React.createElement(
|
|
324
|
+
Button,
|
|
325
|
+
{
|
|
326
|
+
className: classes.activationButton,
|
|
327
|
+
'aria-label': R.prop('activationLabel', optionalItem),
|
|
328
|
+
color: 'primary',
|
|
329
|
+
onClick: isOptionalActivated ? deactivateOptionalItem : activateOptionalItem,
|
|
330
|
+
startIcon: React.createElement(Done, null)
|
|
331
|
+
},
|
|
282
332
|
React.createElement(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
Typography,
|
|
287
|
-
{ variant: 'body2' },
|
|
288
|
-
button.label
|
|
289
|
-
)
|
|
333
|
+
Typography,
|
|
334
|
+
{ variant: 'body2' },
|
|
335
|
+
R.prop('activationLabel', optionalItem)
|
|
290
336
|
)
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
337
|
+
)
|
|
338
|
+
),
|
|
339
|
+
React.createElement(
|
|
340
|
+
Grid,
|
|
341
|
+
{ item: true },
|
|
342
|
+
React.createElement(
|
|
343
|
+
Grid,
|
|
344
|
+
{ container: true, justifyContent: 'flex-end', display: 'flex', spacing: 1 },
|
|
345
|
+
R.map(function (button) {
|
|
346
|
+
return React.createElement(
|
|
347
|
+
Grid,
|
|
348
|
+
{ item: true, key: button.id, 'data-testid': button['data-testid'] },
|
|
349
|
+
React.createElement(
|
|
350
|
+
Button,
|
|
351
|
+
_extends({ 'aria-label': button.label, color: 'primary' }, button),
|
|
352
|
+
React.createElement(
|
|
353
|
+
Typography,
|
|
354
|
+
{ variant: 'body2' },
|
|
355
|
+
button.label
|
|
356
|
+
)
|
|
357
|
+
)
|
|
358
|
+
);
|
|
359
|
+
})([{
|
|
360
|
+
id: 2,
|
|
361
|
+
label: labels.cancel,
|
|
362
|
+
onClick: onCancel,
|
|
363
|
+
startIcon: React.createElement(Undo, null),
|
|
364
|
+
'datatest-id': 'table-layout-cancel'
|
|
365
|
+
}, {
|
|
366
|
+
id: 1,
|
|
367
|
+
label: labels.commit,
|
|
368
|
+
onClick: onCommit,
|
|
369
|
+
startIcon: React.createElement(Done, null),
|
|
370
|
+
variant: 'contained',
|
|
371
|
+
alternative: 'siscc',
|
|
372
|
+
className: classes.applyButton,
|
|
373
|
+
'data-testid': 'table-layout-apply'
|
|
374
|
+
}])
|
|
375
|
+
)
|
|
376
|
+
)
|
|
308
377
|
)
|
|
309
378
|
);
|
|
310
379
|
};
|
|
311
380
|
|
|
312
|
-
var patern = {
|
|
381
|
+
var patern = PropTypes.shape({
|
|
313
382
|
id: PropTypes.string,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
id: PropTypes.string,
|
|
317
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
318
|
-
}))
|
|
319
|
-
};
|
|
383
|
+
count: PropTypes.number
|
|
384
|
+
});
|
|
320
385
|
|
|
321
386
|
TableLayout.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
322
387
|
layout: PropTypes.shape({
|
|
323
|
-
header: PropTypes.arrayOf(PropTypes.
|
|
324
|
-
sections: PropTypes.arrayOf(PropTypes.
|
|
325
|
-
rows: PropTypes.arrayOf(PropTypes.
|
|
388
|
+
header: PropTypes.arrayOf(PropTypes.string),
|
|
389
|
+
sections: PropTypes.arrayOf(PropTypes.string),
|
|
390
|
+
rows: PropTypes.arrayOf(PropTypes.string)
|
|
326
391
|
}),
|
|
392
|
+
items: PropTypes.arrayOf(patern),
|
|
393
|
+
optionalItem: patern,
|
|
327
394
|
itemRenderer: PropTypes.func,
|
|
328
395
|
commit: PropTypes.func,
|
|
329
396
|
noPreview: PropTypes.bool,
|
|
@@ -348,10 +415,10 @@ TableLayout.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
348
415
|
accessibility: PropTypes.bool
|
|
349
416
|
} : {};
|
|
350
417
|
|
|
351
|
-
export default withBlank(function (
|
|
352
|
-
var
|
|
353
|
-
layout =
|
|
354
|
-
isBlank =
|
|
418
|
+
export default withBlank(function (_ref5) {
|
|
419
|
+
var _ref5$layout = _ref5.layout,
|
|
420
|
+
layout = _ref5$layout === undefined ? [] : _ref5$layout,
|
|
421
|
+
isBlank = _ref5.isBlank;
|
|
355
422
|
return {
|
|
356
423
|
isBlank: R.or(isBlank, R.pipe(R.values, R.all(R.isEmpty))(layout))
|
|
357
424
|
};
|
package/es/TableLayout/lib.js
CHANGED
|
@@ -23,4 +23,9 @@ export var addHiddenElement = function addHiddenElement(layout) {
|
|
|
23
23
|
return R.mapObjIndexed(function (values, key) {
|
|
24
24
|
return R.pipe(R.prop(key), R.concat(values))(layout);
|
|
25
25
|
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export var getIsOptionalActivated = function getIsOptionalActivated(layout, optionalId) {
|
|
29
|
+
var founded = R.pipe(R.values, R.unnest, R.find(R.equals(optionalId)))(layout);
|
|
30
|
+
return !R.isNil(founded);
|
|
26
31
|
};
|