@redsift/dashboard 8.0.0-alpha.8 → 8.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.
- package/.env +2 -0
- package/coverage/clover.xml +509 -0
- package/coverage/coverage-final.json +22 -0
- package/coverage/lcov-report/ConnectedDataGrid/ConnectedDataGrid.tsx.html +193 -0
- package/coverage/lcov-report/ConnectedDataGrid/index.html +131 -0
- package/coverage/lcov-report/ConnectedDataGrid/index.ts.html +85 -0
- package/coverage/lcov-report/Dashboard/Dashboard.tsx.html +229 -0
- package/coverage/lcov-report/Dashboard/context.ts.html +118 -0
- package/coverage/lcov-report/Dashboard/index.html +176 -0
- package/coverage/lcov-report/Dashboard/index.ts.html +97 -0
- package/coverage/lcov-report/Dashboard/reducer.ts.html +139 -0
- package/coverage/lcov-report/Dashboard/types.ts.html +190 -0
- package/coverage/lcov-report/HorizontalBarChart/HorizontalBarChart.tsx.html +430 -0
- package/coverage/lcov-report/HorizontalBarChart/index.html +161 -0
- package/coverage/lcov-report/HorizontalBarChart/index.ts.html +88 -0
- package/coverage/lcov-report/HorizontalBarChart/styles.ts.html +217 -0
- package/coverage/lcov-report/HorizontalBarChart/types.ts.html +184 -0
- package/coverage/lcov-report/PieChart/PieChart.tsx.html +736 -0
- package/coverage/lcov-report/PieChart/index.html +161 -0
- package/coverage/lcov-report/PieChart/index.ts.html +88 -0
- package/coverage/lcov-report/PieChart/styles.ts.html +244 -0
- package/coverage/lcov-report/PieChart/types.ts.html +184 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/components/ChartEmptyState/ChartEmptyState.tsx.html +679 -0
- package/coverage/lcov-report/components/ChartEmptyState/index.html +146 -0
- package/coverage/lcov-report/components/ChartEmptyState/index.ts.html +91 -0
- package/coverage/lcov-report/components/ChartEmptyState/styles.ts.html +184 -0
- package/coverage/lcov-report/components/ConnectedDataGrid/ConnectedDataGrid.tsx.html +181 -0
- package/coverage/lcov-report/components/ConnectedDataGrid/index.html +131 -0
- package/coverage/lcov-report/components/ConnectedDataGrid/index.ts.html +85 -0
- package/coverage/lcov-report/components/CrossfilterRegistry/CrossfilterRegistry.ts.html +163 -0
- package/coverage/lcov-report/components/CrossfilterRegistry/index.html +131 -0
- package/coverage/lcov-report/components/CrossfilterRegistry/index.ts.html +88 -0
- package/coverage/lcov-report/components/Dashboard/Dashboard.tsx.html +289 -0
- package/coverage/lcov-report/components/Dashboard/context.ts.html +115 -0
- package/coverage/lcov-report/components/Dashboard/index.html +176 -0
- package/coverage/lcov-report/components/Dashboard/index.ts.html +97 -0
- package/coverage/lcov-report/components/Dashboard/reducer.ts.html +382 -0
- package/coverage/lcov-report/components/Dashboard/types.ts.html +226 -0
- package/coverage/lcov-report/components/DataGrid/DataGrid.tsx.html +202 -0
- package/coverage/lcov-report/components/DataGrid/index.html +131 -0
- package/coverage/lcov-report/components/DataGrid/index.ts.html +91 -0
- package/coverage/lcov-report/components/EmptyChart/EmptyChart.tsx.html +244 -0
- package/coverage/lcov-report/components/EmptyChart/index.html +146 -0
- package/coverage/lcov-report/components/EmptyChart/index.ts.html +91 -0
- package/coverage/lcov-report/components/EmptyChart/styles.ts.html +241 -0
- package/coverage/lcov-report/components/HorizontalBarChart/HorizontalBarChart.tsx.html +1063 -0
- package/coverage/lcov-report/components/HorizontalBarChart/index.html +161 -0
- package/coverage/lcov-report/components/HorizontalBarChart/index.ts.html +91 -0
- package/coverage/lcov-report/components/HorizontalBarChart/styles.ts.html +385 -0
- package/coverage/lcov-report/components/HorizontalBarChart/types.ts.html +328 -0
- package/coverage/lcov-report/components/PDFExportButton/PdfDocument.tsx.html +688 -0
- package/coverage/lcov-report/components/PDFExportButton/PdfExportButton.tsx.html +583 -0
- package/coverage/lcov-report/components/PDFExportButton/index.html +161 -0
- package/coverage/lcov-report/components/PDFExportButton/index.ts.html +88 -0
- package/coverage/lcov-report/components/PDFExportButton/styles.ts.html +532 -0
- package/coverage/lcov-report/components/PDFExportButton/utils.ts.html +283 -0
- package/coverage/lcov-report/components/PieChart/PieChart.tsx.html +1363 -0
- package/coverage/lcov-report/components/PieChart/index.html +161 -0
- package/coverage/lcov-report/components/PieChart/index.ts.html +91 -0
- package/coverage/lcov-report/components/PieChart/styles.ts.html +388 -0
- package/coverage/lcov-report/components/PieChart/types.ts.html +325 -0
- package/coverage/lcov-report/components/ResetButton/ResetButton.tsx.html +160 -0
- package/coverage/lcov-report/components/ResetButton/index.html +131 -0
- package/coverage/lcov-report/components/ResetButton/index.ts.html +91 -0
- package/coverage/lcov-report/components/ScatterPlot/ScatterPlot.tsx.html +2881 -0
- package/coverage/lcov-report/components/ScatterPlot/index.html +176 -0
- package/coverage/lcov-report/components/ScatterPlot/index.ts.html +91 -0
- package/coverage/lcov-report/components/ScatterPlot/styles.ts.html +505 -0
- package/coverage/lcov-report/components/ScatterPlot/types.ts.html +370 -0
- package/coverage/lcov-report/components/ScatterPlot/utils.ts.html +136 -0
- package/coverage/lcov-report/components/StaticPieChart/StaticPieChart.tsx.html +286 -0
- package/coverage/lcov-report/components/StaticPieChart/index.html +131 -0
- package/coverage/lcov-report/components/StaticPieChart/index.ts.html +88 -0
- package/coverage/lcov-report/components/TimeSeriesBarChart/TimeSeriesBarChart.tsx.html +1744 -0
- package/coverage/lcov-report/components/TimeSeriesBarChart/index.html +161 -0
- package/coverage/lcov-report/components/TimeSeriesBarChart/index.ts.html +91 -0
- package/coverage/lcov-report/components/TimeSeriesBarChart/styles.ts.html +361 -0
- package/coverage/lcov-report/components/TimeSeriesBarChart/types.ts.html +319 -0
- package/coverage/lcov-report/components/WithFilters/FilterableBarChart.tsx.html +628 -0
- package/coverage/lcov-report/components/WithFilters/FilterableDataGrid.tsx.html +220 -0
- package/coverage/lcov-report/components/WithFilters/FilterablePieChart.tsx.html +622 -0
- package/coverage/lcov-report/components/WithFilters/FilterableScatterPlot.tsx.html +1090 -0
- package/coverage/lcov-report/components/WithFilters/WithFilters.tsx.html +172 -0
- package/coverage/lcov-report/components/WithFilters/index.html +191 -0
- package/coverage/lcov-report/components/WithFilters/index.ts.html +91 -0
- package/coverage/lcov-report/components/index.html +116 -0
- package/coverage/lcov-report/components/index.ts.html +97 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/hooks/index.html +116 -0
- package/coverage/lcov-report/hooks/useCategoricalChartAsListbox.ts.html +478 -0
- package/coverage/lcov-report/hooks/useChartAsListbox.ts.html +655 -0
- package/coverage/lcov-report/index.html +206 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/utils/groupReduceCount.ts.html +94 -0
- package/coverage/lcov-report/utils/groupReduceSum.ts.html +97 -0
- package/coverage/lcov-report/utils/groupReducers/groupReduceCount.ts.html +100 -0
- package/coverage/lcov-report/utils/groupReducers/groupReduceSum.ts.html +103 -0
- package/coverage/lcov-report/utils/groupReducers/index.html +146 -0
- package/coverage/lcov-report/utils/groupReducers/index.ts.html +91 -0
- package/coverage/lcov-report/utils/index.html +116 -0
- package/coverage/lcov-report/utils/index.ts.html +88 -0
- package/coverage/lcov.info +1070 -0
- package/{index.js → dist/index.js} +144 -20
- package/dist/index.js.map +1 -0
- package/dist/package.json +113 -0
- package/index.ts +1 -0
- package/jest.config.js +3 -0
- package/package.json +6 -12
- package/rollup.config.js +13 -0
- package/src/components/ChartEmptyState/ChartEmptyState.stories.tsx +23 -0
- package/src/components/ChartEmptyState/ChartEmptyState.tsx +198 -0
- package/src/components/ChartEmptyState/index.ts +2 -0
- package/src/components/ChartEmptyState/styles.ts +33 -0
- package/src/components/ChartEmptyState/types.ts +15 -0
- package/src/components/CrossfilterRegistry/CrossfilterRegistry.ts +26 -0
- package/src/components/CrossfilterRegistry/index.ts +1 -0
- package/src/components/Dashboard/Dashboard.stories.tsx +602 -0
- package/src/components/Dashboard/Dashboard.test.tsx +19 -0
- package/src/components/Dashboard/Dashboard.tsx +68 -0
- package/src/components/Dashboard/__snapshots__/Dashboard.stories.storyshot +24646 -0
- package/src/components/Dashboard/context.ts +10 -0
- package/src/components/Dashboard/index.ts +4 -0
- package/src/components/Dashboard/reducer.ts +99 -0
- package/src/components/Dashboard/types.ts +47 -0
- package/src/components/PdfExportButton/PdfDocument.tsx +203 -0
- package/src/components/PdfExportButton/PdfExportButton.tsx +168 -0
- package/src/components/PdfExportButton/index.ts +3 -0
- package/src/components/PdfExportButton/styles.ts +151 -0
- package/src/components/PdfExportButton/types.ts +59 -0
- package/src/components/TimeSeriesBarChart/TimeSeriesBarChart.tsx +565 -0
- package/src/components/TimeSeriesBarChart/index.ts +4 -0
- package/src/components/TimeSeriesBarChart/styles.ts +94 -0
- package/src/components/TimeSeriesBarChart/types.ts +82 -0
- package/src/components/WithFilters/FilterableBarChart.tsx +181 -0
- package/src/components/WithFilters/FilterableDataGrid.tsx +45 -0
- package/src/components/WithFilters/FilterablePieChart.tsx +179 -0
- package/src/components/WithFilters/FilterableScatterPlot.tsx +335 -0
- package/src/components/WithFilters/WithFilters.tsx +29 -0
- package/src/components/WithFilters/index.ts +2 -0
- package/src/components/WithFilters/types.ts +45 -0
- package/src/hooks/useCategoricalChartAsListbox.ts +131 -0
- package/src/index.ts +8 -0
- package/src/types.ts +39 -0
- package/src/utils/groupReducers/groupReduceCount.ts +5 -0
- package/src/utils/groupReducers/groupReduceSum.ts +6 -0
- package/src/utils/groupReducers/index.ts +2 -0
- package/src/utils/index.ts +1 -0
- package/tsconfig.json +3 -0
- package/index.js.map +0 -1
- /package/{CONTRIBUTING.md → dist/CONTRIBUTING.md} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
|
@@ -197,7 +197,7 @@ const ChartEmptyState = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
197
197
|
}, subtitle), onReset ? /*#__PURE__*/React.createElement(StyledResetButton, {
|
|
198
198
|
variant: "unstyled",
|
|
199
199
|
leftIcon: mdiRefresh,
|
|
200
|
-
|
|
200
|
+
onClick: onReset
|
|
201
201
|
}, resetLabel) : null);
|
|
202
202
|
});
|
|
203
203
|
ChartEmptyState.className = CLASSNAME$3;
|
|
@@ -310,14 +310,18 @@ const DashboardContext = /*#__PURE__*/React.createContext({
|
|
|
310
310
|
* Reducer props.
|
|
311
311
|
*/
|
|
312
312
|
|
|
313
|
-
let DashboardReducerActionType
|
|
314
|
-
(function (DashboardReducerActionType) {
|
|
313
|
+
let DashboardReducerActionType = /*#__PURE__*/function (DashboardReducerActionType) {
|
|
315
314
|
DashboardReducerActionType["ResetFilter"] = "reset-filter";
|
|
316
315
|
DashboardReducerActionType["ResetFilters"] = "reset-filters";
|
|
317
316
|
DashboardReducerActionType["FilterTable"] = "filter-table";
|
|
318
317
|
DashboardReducerActionType["FilterTableBatch"] = "filter-table-batch";
|
|
319
318
|
DashboardReducerActionType["AppendFilterTableBatch"] = "append-filter-table-batch";
|
|
320
|
-
|
|
319
|
+
return DashboardReducerActionType;
|
|
320
|
+
}({});
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Component props.
|
|
324
|
+
*/
|
|
321
325
|
|
|
322
326
|
const areEquals = (tableFilter, actionFilter) => {
|
|
323
327
|
return tableFilter.columnField === actionFilter.columnField && tableFilter.operatorValue === actionFilter.operatorValue;
|
|
@@ -826,7 +830,7 @@ const PdfExportButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
826
830
|
};
|
|
827
831
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
828
832
|
className: classNames(PdfExportButton.className, className),
|
|
829
|
-
|
|
833
|
+
onClick: exportPdf,
|
|
830
834
|
isDisabled: isLoading
|
|
831
835
|
}, forwardedProps, {
|
|
832
836
|
ref: ref
|
|
@@ -852,6 +856,10 @@ const TimeSeriesBarChartSize = {
|
|
|
852
856
|
*/
|
|
853
857
|
const TimeSeriesBarChartTheme = ColorTheme;
|
|
854
858
|
|
|
859
|
+
/**
|
|
860
|
+
* Component props.
|
|
861
|
+
*/
|
|
862
|
+
|
|
855
863
|
// istanbul ignore file
|
|
856
864
|
/**
|
|
857
865
|
* Component style.
|
|
@@ -1241,7 +1249,7 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1241
1249
|
id: `id${id}__title`
|
|
1242
1250
|
}, title) : null, chart && isResetable ? /*#__PURE__*/React.createElement(Button, {
|
|
1243
1251
|
variant: "unstyled",
|
|
1244
|
-
|
|
1252
|
+
onClick: () => {
|
|
1245
1253
|
chart.filter(null);
|
|
1246
1254
|
redrawAll();
|
|
1247
1255
|
if (columnToFilter) {
|
|
@@ -1289,6 +1297,96 @@ TimeSeriesBarChart.className = CLASSNAME;
|
|
|
1289
1297
|
TimeSeriesBarChart.defaultProps = DEFAULT_PROPS;
|
|
1290
1298
|
TimeSeriesBarChart.displayName = COMPONENT_NAME;
|
|
1291
1299
|
|
|
1300
|
+
/**
|
|
1301
|
+
* Hook to give to a chart the roles, events and attributes of a listbox.
|
|
1302
|
+
*/
|
|
1303
|
+
const useCategoricalChartAsListbox = _ref => {
|
|
1304
|
+
let {
|
|
1305
|
+
id,
|
|
1306
|
+
ref,
|
|
1307
|
+
type,
|
|
1308
|
+
ndxGroup,
|
|
1309
|
+
orientation = 'horizontal'
|
|
1310
|
+
} = _ref;
|
|
1311
|
+
const currentIndexRef = useRef(0);
|
|
1312
|
+
const props = useMemo(() => {
|
|
1313
|
+
const numberOfGroups = ndxGroup === null || ndxGroup === void 0 ? void 0 : ndxGroup.all().filter(datum => datum.value).length;
|
|
1314
|
+
if (ref && numberOfGroups) {
|
|
1315
|
+
const getCurrentOption = () => ref.current.querySelector(`._${currentIndexRef.current}`);
|
|
1316
|
+
const next = () => {
|
|
1317
|
+
getCurrentOption().classList.remove('focused');
|
|
1318
|
+
const index = currentIndexRef.current === numberOfGroups - 1 ? 0 : currentIndexRef.current + 1;
|
|
1319
|
+
currentIndexRef.current = index;
|
|
1320
|
+
ref.current.setAttribute('aria-activedescendant', `id${id}__${type}-${currentIndexRef.current}`);
|
|
1321
|
+
getCurrentOption().classList.add('focused');
|
|
1322
|
+
};
|
|
1323
|
+
const previous = () => {
|
|
1324
|
+
getCurrentOption().classList.remove('focused');
|
|
1325
|
+
const index = currentIndexRef.current === 0 ? numberOfGroups - 1 : currentIndexRef.current - 1;
|
|
1326
|
+
currentIndexRef.current = index;
|
|
1327
|
+
ref.current.setAttribute('aria-activedescendant', `id${id}__${type}-${currentIndexRef.current}`);
|
|
1328
|
+
getCurrentOption().classList.add('focused');
|
|
1329
|
+
};
|
|
1330
|
+
const focus = () => {
|
|
1331
|
+
ref.current.setAttribute('aria-activedescendant', `id${id}__${type}-0`);
|
|
1332
|
+
getCurrentOption().classList.add('focused');
|
|
1333
|
+
};
|
|
1334
|
+
const blur = () => {
|
|
1335
|
+
getCurrentOption().classList.remove('focused');
|
|
1336
|
+
currentIndexRef.current = 0;
|
|
1337
|
+
ref.current.setAttribute('aria-activedescendant', '');
|
|
1338
|
+
};
|
|
1339
|
+
const keydown = e => {
|
|
1340
|
+
e.stopPropagation();
|
|
1341
|
+
switch (e.code) {
|
|
1342
|
+
case 'ArrowRight':
|
|
1343
|
+
if (orientation === 'horizontal') {
|
|
1344
|
+
e.preventDefault();
|
|
1345
|
+
next();
|
|
1346
|
+
}
|
|
1347
|
+
break;
|
|
1348
|
+
case 'ArrowLeft':
|
|
1349
|
+
if (orientation === 'horizontal') {
|
|
1350
|
+
e.preventDefault();
|
|
1351
|
+
previous();
|
|
1352
|
+
}
|
|
1353
|
+
break;
|
|
1354
|
+
case 'ArrowDown':
|
|
1355
|
+
if (orientation === 'vertical') {
|
|
1356
|
+
e.preventDefault();
|
|
1357
|
+
next();
|
|
1358
|
+
}
|
|
1359
|
+
break;
|
|
1360
|
+
case 'ArrowUp':
|
|
1361
|
+
if (orientation === 'vertical') {
|
|
1362
|
+
e.preventDefault();
|
|
1363
|
+
previous();
|
|
1364
|
+
}
|
|
1365
|
+
break;
|
|
1366
|
+
case 'Enter':
|
|
1367
|
+
case 'Space':
|
|
1368
|
+
e.preventDefault();
|
|
1369
|
+
getCurrentOption().dispatchEvent(new Event('click'));
|
|
1370
|
+
break;
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
return {
|
|
1374
|
+
'aria-activedescendant': '',
|
|
1375
|
+
'aria-multiselectable': 'true',
|
|
1376
|
+
'aria-orientation': orientation,
|
|
1377
|
+
role: 'listbox',
|
|
1378
|
+
tabIndex: 0,
|
|
1379
|
+
onFocus: focus,
|
|
1380
|
+
onBlur: blur,
|
|
1381
|
+
onMouseDown: event => event.preventDefault(),
|
|
1382
|
+
onMouseLeave: blur,
|
|
1383
|
+
onKeyDown: keydown
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
}, [ref, ref.current, ndxGroup, JSON.parse(JSON.stringify((ndxGroup === null || ndxGroup === void 0 ? void 0 : ndxGroup.all()) || ''))]);
|
|
1387
|
+
return props;
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1292
1390
|
const FilterableBarChart = props => {
|
|
1293
1391
|
const {
|
|
1294
1392
|
children,
|
|
@@ -1301,7 +1399,8 @@ const FilterableBarChart = props => {
|
|
|
1301
1399
|
localeText,
|
|
1302
1400
|
onFilter
|
|
1303
1401
|
} = props;
|
|
1304
|
-
const id = propsId !== null && propsId !== void 0 ? propsId : useId();
|
|
1402
|
+
const id = (propsId !== null && propsId !== void 0 ? propsId : useId()).replace(/:/g, '');
|
|
1403
|
+
const ref = useRef();
|
|
1305
1404
|
const {
|
|
1306
1405
|
emptyChartTitle,
|
|
1307
1406
|
emptyChartSubtitle,
|
|
@@ -1396,18 +1495,30 @@ const FilterableBarChart = props => {
|
|
|
1396
1495
|
resetLabel: emptyChartResetLabel,
|
|
1397
1496
|
onReset: resetFilters
|
|
1398
1497
|
});
|
|
1498
|
+
const chartProps = useCategoricalChartAsListbox({
|
|
1499
|
+
id,
|
|
1500
|
+
ref: ref,
|
|
1501
|
+
type: 'bar',
|
|
1502
|
+
ndxGroup,
|
|
1503
|
+
orientation: 'vertical'
|
|
1504
|
+
});
|
|
1399
1505
|
const filterProps = {
|
|
1506
|
+
barProps: {
|
|
1507
|
+
tabIndex: -1
|
|
1508
|
+
},
|
|
1509
|
+
barRole: 'option',
|
|
1510
|
+
chartProps: chartProps,
|
|
1511
|
+
chartRef: ref,
|
|
1400
1512
|
data: ndxGroup ? JSON.parse(JSON.stringify(ndxGroup.all())) : undefined,
|
|
1401
|
-
id,
|
|
1402
|
-
onReset: isResetable ? resetFilters : undefined,
|
|
1403
1513
|
emptyComponent,
|
|
1404
|
-
|
|
1405
|
-
handleFilter(datum.data.key);
|
|
1406
|
-
},
|
|
1514
|
+
id,
|
|
1407
1515
|
isBarSelected: datum => {
|
|
1408
1516
|
return filters.length === 0 || filters.includes(datum.data.key);
|
|
1409
1517
|
},
|
|
1410
|
-
|
|
1518
|
+
onBarClick: datum => {
|
|
1519
|
+
handleFilter(datum.data.key);
|
|
1520
|
+
},
|
|
1521
|
+
onReset: isResetable ? resetFilters : undefined
|
|
1411
1522
|
};
|
|
1412
1523
|
if ( /*#__PURE__*/isValidElement(children)) {
|
|
1413
1524
|
return /*#__PURE__*/React.cloneElement(children, _objectSpread2({}, filterProps));
|
|
@@ -1472,7 +1583,8 @@ const FilterablePieChart = props => {
|
|
|
1472
1583
|
localeText,
|
|
1473
1584
|
onFilter
|
|
1474
1585
|
} = props;
|
|
1475
|
-
const id = propsId !== null && propsId !== void 0 ? propsId : useId();
|
|
1586
|
+
const id = (propsId !== null && propsId !== void 0 ? propsId : useId()).replace(/:/g, '');
|
|
1587
|
+
const ref = useRef();
|
|
1476
1588
|
const {
|
|
1477
1589
|
emptyChartTitle,
|
|
1478
1590
|
emptyChartSubtitle,
|
|
@@ -1563,18 +1675,30 @@ const FilterablePieChart = props => {
|
|
|
1563
1675
|
resetLabel: emptyChartResetLabel,
|
|
1564
1676
|
onReset: resetFilters
|
|
1565
1677
|
});
|
|
1678
|
+
const chartProps = useCategoricalChartAsListbox({
|
|
1679
|
+
id,
|
|
1680
|
+
ref: ref,
|
|
1681
|
+
type: 'bar',
|
|
1682
|
+
ndxGroup,
|
|
1683
|
+
orientation: 'horizontal'
|
|
1684
|
+
});
|
|
1566
1685
|
const filterProps = {
|
|
1686
|
+
sliceProps: {
|
|
1687
|
+
tabIndex: -1
|
|
1688
|
+
},
|
|
1689
|
+
sliceRole: 'option',
|
|
1690
|
+
chartProps: chartProps,
|
|
1691
|
+
chartRef: ref,
|
|
1567
1692
|
data: ndxGroup ? JSON.parse(JSON.stringify(ndxGroup.all())) : undefined,
|
|
1568
|
-
id,
|
|
1569
|
-
onReset: isResetable ? resetFilters : undefined,
|
|
1570
1693
|
emptyComponent,
|
|
1571
|
-
|
|
1572
|
-
handleFilter(datum.data.key);
|
|
1573
|
-
},
|
|
1694
|
+
id,
|
|
1574
1695
|
isSliceSelected: datum => {
|
|
1575
1696
|
return filters.length === 0 || filters.includes(datum.data.key);
|
|
1576
1697
|
},
|
|
1577
|
-
|
|
1698
|
+
onSliceClick: datum => {
|
|
1699
|
+
handleFilter(datum.data.key);
|
|
1700
|
+
},
|
|
1701
|
+
onReset: isResetable ? resetFilters : undefined
|
|
1578
1702
|
};
|
|
1579
1703
|
if ( /*#__PURE__*/isValidElement(children)) {
|
|
1580
1704
|
return /*#__PURE__*/React.cloneElement(children, _objectSpread2({}, filterProps));
|