@neo4j-ndl/react 2.0.0-alpha-e609471 → 2.0.0-alpha-3f8358d
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/lib/NOTICE.txt +2 -0
- package/lib/cjs/accordion/Accordion.js +6 -5
- package/lib/cjs/accordion/Accordion.js.map +1 -1
- package/lib/cjs/banner/Banner.js +9 -6
- package/lib/cjs/banner/Banner.js.map +1 -1
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/context-menu/ContextMenu.js +30 -16
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/data-grid/Components.js +364 -0
- package/lib/cjs/data-grid/Components.js.map +1 -0
- package/lib/cjs/data-grid/DataGrid.js +98 -0
- package/lib/cjs/data-grid/DataGrid.js.map +1 -0
- package/lib/cjs/{table-deprecated/hooks/hookCallbackTypes.js → data-grid/DataGridContext.js} +12 -1
- package/lib/cjs/data-grid/DataGridContext.js.map +1 -0
- package/lib/cjs/data-grid/helpers.js +94 -0
- package/lib/cjs/data-grid/helpers.js.map +1 -0
- package/lib/cjs/{table-deprecated → data-grid}/index.js +19 -6
- package/lib/cjs/data-grid/index.js.map +1 -0
- package/lib/cjs/dialog/Dialog.js +4 -3
- package/lib/cjs/dialog/Dialog.js.map +1 -1
- package/lib/cjs/{drag-and-drop/DragAndDrop.js → dropzone/Dropzone.js} +7 -14
- package/lib/cjs/dropzone/Dropzone.js.map +1 -0
- package/lib/cjs/dropzone/icons/CSV-file.js.map +1 -0
- package/lib/cjs/dropzone/icons/Cloud.js +27 -0
- package/lib/cjs/dropzone/icons/Cloud.js.map +1 -0
- package/lib/cjs/{drag-and-drop → dropzone}/icons/File.js +1 -1
- package/lib/cjs/dropzone/icons/File.js.map +1 -0
- package/lib/cjs/{drag-and-drop → dropzone}/icons/InvalidFile.js +1 -1
- package/lib/cjs/dropzone/icons/InvalidFile.js.map +1 -0
- package/lib/cjs/{drag-and-drop → dropzone}/index.js +3 -3
- package/lib/cjs/dropzone/index.js.map +1 -0
- package/lib/cjs/index.js +4 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/modal/Modal.js +5 -18
- package/lib/cjs/modal/Modal.js.map +1 -1
- package/lib/cjs/popover/Popover.js +7 -3
- package/lib/cjs/popover/Popover.js.map +1 -1
- package/lib/cjs/{view-selector/ViewSelector.js → segmented-control/SegmentedControl.js} +20 -13
- package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -0
- package/lib/cjs/{table-deprecated/hooks → segmented-control}/index.js +1 -3
- package/lib/cjs/segmented-control/index.js.map +1 -0
- package/lib/cjs/side-navigation/SideNavigation.js +17 -31
- package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
- package/lib/cjs/table/Components.js +1 -3
- package/lib/cjs/table/Components.js.map +1 -1
- package/lib/cjs/table/Table.js +8 -0
- package/lib/cjs/table/Table.js.map +1 -1
- package/lib/cjs/tabs/Tabs.js +15 -4
- package/lib/cjs/tabs/Tabs.js.map +1 -1
- package/lib/cjs/theme/ThemeProvider.js +99 -0
- package/lib/cjs/theme/ThemeProvider.js.map +1 -0
- package/lib/cjs/{view-selector → theme}/index.js +1 -1
- package/lib/cjs/theme/index.js.map +1 -0
- package/lib/esm/accordion/Accordion.js +7 -8
- package/lib/esm/accordion/Accordion.js.map +1 -1
- package/lib/esm/banner/Banner.js +8 -4
- package/lib/esm/banner/Banner.js.map +1 -1
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/context-menu/ContextMenu.js +29 -15
- package/lib/esm/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/data-grid/Components.js +339 -0
- package/lib/esm/data-grid/Components.js.map +1 -0
- package/lib/esm/data-grid/DataGrid.js +92 -0
- package/lib/esm/data-grid/DataGrid.js.map +1 -0
- package/lib/esm/{drag-and-drop/index.js → data-grid/DataGridContext.js} +10 -2
- package/lib/esm/data-grid/DataGridContext.js.map +1 -0
- package/lib/esm/data-grid/helpers.js +88 -0
- package/lib/esm/data-grid/helpers.js.map +1 -0
- package/lib/esm/{table-deprecated → data-grid}/index.js +4 -2
- package/lib/esm/data-grid/index.js.map +1 -0
- package/lib/esm/dialog/Dialog.js +4 -3
- package/lib/esm/dialog/Dialog.js.map +1 -1
- package/lib/esm/{drag-and-drop/DragAndDrop.js → dropzone/Dropzone.js} +7 -14
- package/lib/esm/dropzone/Dropzone.js.map +1 -0
- package/lib/esm/dropzone/icons/CSV-file.js.map +1 -0
- package/lib/esm/dropzone/icons/Cloud.js +25 -0
- package/lib/esm/dropzone/icons/Cloud.js.map +1 -0
- package/lib/esm/dropzone/icons/File.js +25 -0
- package/lib/esm/dropzone/icons/File.js.map +1 -0
- package/lib/esm/dropzone/icons/InvalidFile.js +25 -0
- package/lib/esm/dropzone/icons/InvalidFile.js.map +1 -0
- package/lib/{types/table-deprecated/index.d.ts → esm/dropzone/index.js} +2 -2
- package/lib/esm/dropzone/index.js.map +1 -0
- package/lib/esm/index.js +4 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/modal/Modal.js +6 -18
- package/lib/esm/modal/Modal.js.map +1 -1
- package/lib/esm/popover/Popover.js +7 -3
- package/lib/esm/popover/Popover.js.map +1 -1
- package/lib/esm/{view-selector/ViewSelector.js → segmented-control/SegmentedControl.js} +20 -13
- package/lib/esm/segmented-control/SegmentedControl.js.map +1 -0
- package/lib/esm/segmented-control/index.js +22 -0
- package/lib/esm/segmented-control/index.js.map +1 -0
- package/lib/esm/side-navigation/SideNavigation.js +16 -7
- package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
- package/lib/esm/table/Components.js +1 -3
- package/lib/esm/table/Components.js.map +1 -1
- package/lib/esm/table/Table.js +8 -0
- package/lib/esm/table/Table.js.map +1 -1
- package/lib/esm/tabs/Tabs.js +15 -4
- package/lib/esm/tabs/Tabs.js.map +1 -1
- package/lib/esm/theme/ThemeProvider.js +68 -0
- package/lib/esm/theme/ThemeProvider.js.map +1 -0
- package/lib/esm/{view-selector → theme}/index.js +1 -1
- package/lib/esm/theme/index.js.map +1 -0
- package/lib/types/accordion/Accordion.d.ts +7 -6
- package/lib/types/banner/Banner.d.ts +9 -5
- package/lib/types/context-menu/ContextMenu.d.ts +16 -12
- package/lib/types/data-grid/Components.d.ts +94 -0
- package/lib/types/data-grid/DataGrid.d.ts +90 -0
- package/lib/types/data-grid/DataGridContext.d.ts +62 -0
- package/lib/types/{table-deprecated → data-grid}/helpers.d.ts +15 -21
- package/lib/types/{table-deprecated/hooks → data-grid}/index.d.ts +5 -3
- package/lib/types/dialog/Dialog.d.ts +1 -1
- package/lib/types/{drag-and-drop/DragAndDrop.d.ts → dropzone/Dropzone.d.ts} +4 -11
- package/lib/types/{drag-and-drop → dropzone}/index.d.ts +1 -1
- package/lib/types/helpers/forwardRef.d.ts +6 -0
- package/lib/types/index.d.ts +4 -3
- package/lib/types/modal/Modal.d.ts +13 -6
- package/lib/types/popover/Popover.d.ts +8 -2
- package/lib/types/{view-selector/ViewSelector.d.ts → segmented-control/SegmentedControl.d.ts} +13 -19
- package/lib/{esm/table-deprecated/hooks/hookCallbackTypes.js → types/segmented-control/index.d.ts} +1 -2
- package/lib/types/side-navigation/SideNavigation.d.ts +10 -9
- package/lib/types/table/Table.d.ts +4 -0
- package/lib/types/tabs/Tabs.d.ts +5 -4
- package/lib/types/theme/ThemeProvider.d.ts +54 -0
- package/lib/types/{view-selector → theme}/index.d.ts +1 -1
- package/package.json +2 -2
- package/lib/cjs/drag-and-drop/DragAndDrop.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/CSV-file.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/Cloud.js +0 -27
- package/lib/cjs/drag-and-drop/icons/Cloud.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/File.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/InvalidFile.js.map +0 -1
- package/lib/cjs/drag-and-drop/index.js.map +0 -1
- package/lib/cjs/table-deprecated/Table.js +0 -157
- package/lib/cjs/table-deprecated/Table.js.map +0 -1
- package/lib/cjs/table-deprecated/TableNavigation.js +0 -51
- package/lib/cjs/table-deprecated/TableNavigation.js.map +0 -1
- package/lib/cjs/table-deprecated/helpers.js +0 -123
- package/lib/cjs/table-deprecated/helpers.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/hookCallbackTypes.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/index.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/useMultiRowSelect.js +0 -84
- package/lib/cjs/table-deprecated/hooks/useMultiRowSelect.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/useSingleRowSelect.js +0 -61
- package/lib/cjs/table-deprecated/hooks/useSingleRowSelect.js.map +0 -1
- package/lib/cjs/table-deprecated/index.js.map +0 -1
- package/lib/cjs/view-selector/ViewSelector.js.map +0 -1
- package/lib/cjs/view-selector/index.js.map +0 -1
- package/lib/esm/drag-and-drop/DragAndDrop.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/CSV-file.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/Cloud.js +0 -25
- package/lib/esm/drag-and-drop/icons/Cloud.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/File.js +0 -25
- package/lib/esm/drag-and-drop/icons/File.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/InvalidFile.js +0 -25
- package/lib/esm/drag-and-drop/icons/InvalidFile.js.map +0 -1
- package/lib/esm/drag-and-drop/index.js.map +0 -1
- package/lib/esm/table-deprecated/Table.js +0 -150
- package/lib/esm/table-deprecated/Table.js.map +0 -1
- package/lib/esm/table-deprecated/TableNavigation.js +0 -44
- package/lib/esm/table-deprecated/TableNavigation.js.map +0 -1
- package/lib/esm/table-deprecated/helpers.js +0 -116
- package/lib/esm/table-deprecated/helpers.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/hookCallbackTypes.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/index.js +0 -24
- package/lib/esm/table-deprecated/hooks/index.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/useMultiRowSelect.js +0 -82
- package/lib/esm/table-deprecated/hooks/useMultiRowSelect.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/useSingleRowSelect.js +0 -57
- package/lib/esm/table-deprecated/hooks/useSingleRowSelect.js.map +0 -1
- package/lib/esm/table-deprecated/index.js.map +0 -1
- package/lib/esm/view-selector/ViewSelector.js.map +0 -1
- package/lib/esm/view-selector/index.js.map +0 -1
- package/lib/types/table-deprecated/Table.d.ts +0 -76
- package/lib/types/table-deprecated/TableNavigation.d.ts +0 -38
- package/lib/types/table-deprecated/hooks/hookCallbackTypes.d.ts +0 -27
- package/lib/types/table-deprecated/hooks/useMultiRowSelect.d.ts +0 -42
- package/lib/types/table-deprecated/hooks/useSingleRowSelect.d.ts +0 -37
- /package/lib/cjs/{drag-and-drop → dropzone}/icons/CSV-file.js +0 -0
- /package/lib/esm/{drag-and-drop → dropzone}/icons/CSV-file.js +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/CSV-file.d.ts +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/Cloud.d.ts +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/File.d.ts +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/InvalidFile.d.ts +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) "Neo4j"
|
|
5
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
-
*
|
|
7
|
-
* This file is part of Neo4j.
|
|
8
|
-
*
|
|
9
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
-
* it under the terms of the GNU General Public License as published by
|
|
11
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
-
* (at your option) any later version.
|
|
13
|
-
*
|
|
14
|
-
* This program is distributed in the hope that it will be useful,
|
|
15
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
-
* GNU General Public License for more details.
|
|
18
|
-
*
|
|
19
|
-
* You should have received a copy of the GNU General Public License
|
|
20
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
-
*/
|
|
22
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
23
|
-
import { useRowSelect, } from 'react-table';
|
|
24
|
-
import { Checkbox } from '../../checkbox';
|
|
25
|
-
/**
|
|
26
|
-
* A react-table plugin to support controlled selected row state for multiple rows
|
|
27
|
-
*
|
|
28
|
-
* Required options provided to useTable:
|
|
29
|
-
*
|
|
30
|
-
* `onAllRowSelect`: A callback that is called when the all rows checkbox is toggled
|
|
31
|
-
* `onRowSelect`: A callback that is called when a rows checkbox is toggled
|
|
32
|
-
*
|
|
33
|
-
* Required fields on `data` provided to useTable:
|
|
34
|
-
*
|
|
35
|
-
* `isSelected`: a boolean that indicates if the row is selected. This key can be changed
|
|
36
|
-
* from `isSelected` to something else by setting the `manualRowSelectedKey` option
|
|
37
|
-
* in the useTable options. See the useRowSelect plugin docs for more details.
|
|
38
|
-
*/
|
|
39
|
-
const useMultiRowSelect = (hooks) => {
|
|
40
|
-
useRowSelect(hooks);
|
|
41
|
-
/*
|
|
42
|
-
Used for the indeterminate
|
|
43
|
-
state of the checkbox
|
|
44
|
-
*/
|
|
45
|
-
hooks.useControlledState.push((state, { instance }) => {
|
|
46
|
-
const { data } = instance;
|
|
47
|
-
const isSelectedKey = 'isSelected';
|
|
48
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
49
|
-
const newState = useMemo(() => (Object.assign(Object.assign({}, state), { selectedRowIds: data.reduce((acc, curr, index) => {
|
|
50
|
-
if (curr[isSelectedKey]) {
|
|
51
|
-
return Object.assign(Object.assign({}, acc), { [index]: true });
|
|
52
|
-
}
|
|
53
|
-
return acc;
|
|
54
|
-
}, {}) })), [state, data, isSelectedKey]);
|
|
55
|
-
return newState;
|
|
56
|
-
});
|
|
57
|
-
hooks.visibleColumns.push((columns, { instance }) => [
|
|
58
|
-
// Let's make a column for selection
|
|
59
|
-
{
|
|
60
|
-
id: 'ndl-checkbox-selection',
|
|
61
|
-
// The header can use the table's getToggleAllRowsSelectedProps method
|
|
62
|
-
// to render a checkbox
|
|
63
|
-
Header: ({ getToggleAllRowsSelectedProps, }) => {
|
|
64
|
-
const checkboxRef = useRef(null);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
if (checkboxRef && checkboxRef.current) {
|
|
67
|
-
checkboxRef.current.indeterminate =
|
|
68
|
-
getToggleAllRowsSelectedProps().indeterminate || false;
|
|
69
|
-
}
|
|
70
|
-
}, [checkboxRef, getToggleAllRowsSelectedProps]);
|
|
71
|
-
return (_jsx(Checkbox, Object.assign({ "aria-label": "all-rows-select", onClick: () => instance.onAllRowSelect() }, getToggleAllRowsSelectedProps(), { ref: checkboxRef })));
|
|
72
|
-
},
|
|
73
|
-
// The cell can use the individual row's getToggleRowSelectedProps method
|
|
74
|
-
// to the render a checkbox
|
|
75
|
-
Cell: ({ row }) => (_jsx("div", { children: _jsx(Checkbox, Object.assign({ "aria-label": `row-${row.index}`, onClick: () => instance.onRowSelect(row.original, row.index) }, row.getToggleRowSelectedProps())) })),
|
|
76
|
-
},
|
|
77
|
-
...columns,
|
|
78
|
-
]);
|
|
79
|
-
};
|
|
80
|
-
useMultiRowSelect.pluginName = 'useMultiRowSelect';
|
|
81
|
-
export default useMultiRowSelect;
|
|
82
|
-
//# sourceMappingURL=useMultiRowSelect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMultiRowSelect.js","sourceRoot":"","sources":["../../../../src/table-deprecated/hooks/useMultiRowSelect.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACn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,OAAO,CAAC,aAAa;4BAC/B,6BAA6B,EAAE,CAAC,aAAa,IAAI,KAAK,CAAC;qBAC1D;gBACH,CAAC,EAAE,CAAC,WAAW,EAAE,6BAA6B,CAAC,CAAC,CAAC;gBACjD,OAAO,CACL,KAAC,QAAQ,gCACI,iBAAiB,EAC5B,OAAO,EAAE,GAAG,EAAE,CAAE,QAA2B,CAAC,cAAc,EAAE,IACxD,6BAA6B,EAAE,IACnC,GAAG,EAAE,WAAW,IAChB,CACH,CAAC;YACJ,CAAC;YACD,yEAAyE;YACzE,2BAA2B;YAC3B,IAAI,EAAE,CAAC,EAAE,GAAG,EAAW,EAAE,EAAE,CAAC,CAC1B,wBACE,KAAC,QAAQ,gCACK,OAAO,GAAG,CAAC,KAAK,EAAE,EAC9B,OAAO,EAAE,GAAG,EAAE,CACX,QAA2B,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,IAE9D,GAAW,CAAC,yBAAyB,EAAE,EAC5C,GACE,CACP;SACK;QACR,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,iBAAiB,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAEnD,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) "Neo4j"
|
|
5
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
-
*
|
|
7
|
-
* This file is part of Neo4j.
|
|
8
|
-
*
|
|
9
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
-
* it under the terms of the GNU General Public License as published by
|
|
11
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
-
* (at your option) any later version.
|
|
13
|
-
*
|
|
14
|
-
* This program is distributed in the hope that it will be useful,
|
|
15
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
-
* GNU General Public License for more details.
|
|
18
|
-
*
|
|
19
|
-
* You should have received a copy of the GNU General Public License
|
|
20
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
-
*/
|
|
22
|
-
import { useRowSelect } from 'react-table';
|
|
23
|
-
import { Radio } from '../../radio';
|
|
24
|
-
/**
|
|
25
|
-
* A react-table plugin to support controlled selected row state for a single row
|
|
26
|
-
*
|
|
27
|
-
* Required options provided to useTable:
|
|
28
|
-
*
|
|
29
|
-
* `onRowSelect`: A callback that is called when a rows checkbox is toggled
|
|
30
|
-
*
|
|
31
|
-
* Required fields on `data` provided to useTable:
|
|
32
|
-
*
|
|
33
|
-
* `isSelected`: a boolean that indicates if the row is selected. This key can be changed
|
|
34
|
-
* from `isSelected` to something else by setting the `manualRowSelectedKey` option
|
|
35
|
-
* in the useTable options. See the useRowSelect plugin docs for more details.
|
|
36
|
-
* There should only ever be 1 data entry with isSelected set to true
|
|
37
|
-
*/
|
|
38
|
-
export const useSingleRowSelect = (hooks) => {
|
|
39
|
-
useRowSelect(hooks);
|
|
40
|
-
hooks.visibleColumns.push((columns, { instance }) => [
|
|
41
|
-
// Let's make a column for selection
|
|
42
|
-
// This should be definitely unique to avoid collision
|
|
43
|
-
{
|
|
44
|
-
id: 'ndl-radio-selection',
|
|
45
|
-
Header: () => null,
|
|
46
|
-
width: 20,
|
|
47
|
-
// The cell can use the individual row's getToggleRowSelectedProps method
|
|
48
|
-
// to the render a checkbox
|
|
49
|
-
Cell: ({ row }) => {
|
|
50
|
-
return (_jsx(Radio, Object.assign({}, row.getToggleRowSelectedProps(), { onChange: () => instance.onRowSelect(row.original, row.index) })));
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
...columns,
|
|
54
|
-
]);
|
|
55
|
-
};
|
|
56
|
-
export default useSingleRowSelect;
|
|
57
|
-
//# sourceMappingURL=useSingleRowSelect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSingleRowSelect.js","sourceRoot":"","sources":["../../../../src/table-deprecated/hooks/useSingleRowSelect.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,KAAe,EACf,EAAE;IACF,YAAY,CAAC,KAAK,CAAC,CAAC;IAEpB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;QACnD,oCAAoC;QACpC,sDAAsD;QACtD;YACE,EAAE,EAAE,qBAAqB;YACzB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI;YAClB,KAAK,EAAE,EAAE;YACT,yEAAyE;YACzE,2BAA2B;YAC3B,IAAI,EAAE,CAAC,EAAE,GAAG,EAAW,EAAE,EAAE;gBACzB,OAAO,CACL,KAAC,KAAK,oBACC,GAAW,CAAC,yBAAyB,EAAE,IAC5C,QAAQ,EAAE,GAAG,EAAE,CACZ,QAA2B,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,IAEnE,CACH,CAAC;YACJ,CAAC;SACK;QACR,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table-deprecated/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 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AK,EAAE,YAC/D,QAAQ,GACoB,IACrB,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,gBAAgB,CACxE,EAQC,EACD,GAAG;QATH,EACE,QAAQ,EACR,KAAK,EACL,EAAE,GAAG,QAAQ,EACb,SAAS,OAIV,EAHI,IAAI,cALT,wCAMC,CADQ;IAMT,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAE3D,MAAM,UAAU,GAAG,KAAK,IAAI,KAAK,KAAK,QAAQ,CAAC;IAE/C,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,EAAE;QACjC,mBAAmB,EAAE,CAAC,KAAK;QAC3B,mBAAmB,EAAE,KAAK;QAC1B,aAAa,EAAE,KAAK,IAAI,KAAK,KAAK,QAAQ;KAC3C,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,EAAE,CAAC;IAErB,OAAO,CACL,KAAC,SAAS,oBACJ,IAAI,IACR,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,QAAQ,CAAC,KAAK,CAAC,EAC7C,SAAS,EAAE,IAAI,EACf,GAAG,EAAE,GAAG,YAEP,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/view-selector/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) "Neo4j"
|
|
4
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
-
*
|
|
6
|
-
* This file is part of Neo4j.
|
|
7
|
-
*
|
|
8
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
/// <reference types="react" />
|
|
22
|
-
import { type Row, type UseColumnOrderState, type UseExpandedState, type UseFiltersState, type UsePaginationState, type UseGlobalFiltersState, type UsePaginationInstanceProps, type UseSortByInstanceProps, type UseTableInstanceProps } from 'react-table';
|
|
23
|
-
import { type ElementBase } from '../helpers/types';
|
|
24
|
-
type Sections = Record<'controls' | 'header' | 'body' | 'navigation', JSX.Element | JSX.Element[]>;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* Small Utilities
|
|
28
|
-
* for table styling and functionality
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
/** For fixed row height tables, we should have a fixed body size */
|
|
32
|
-
export declare const fixedHeight: (items: number, height: number) => {
|
|
33
|
-
style: {
|
|
34
|
-
height: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
type DefaultHeaderProps<T extends object> = Pick<UseTableInstanceProps<T>, 'headerGroups'> & UseSortByInstanceProps<T>;
|
|
38
|
-
type DefaultBodyProps<T extends object> = {
|
|
39
|
-
actionsButtons?: (row: Row<T>) => JSX.Element | JSX.Element[];
|
|
40
|
-
loading: boolean;
|
|
41
|
-
} & UseTableInstanceProps<T> & Partial<UsePaginationInstanceProps<T>>;
|
|
42
|
-
export interface PaginationTableState<T extends object> extends UseColumnOrderState<T>, UseExpandedState<T>, UseFiltersState<T>, UsePaginationState<T>, UseGlobalFiltersState<T> {
|
|
43
|
-
}
|
|
44
|
-
export type DefaultNavigationProps<T extends object> = {
|
|
45
|
-
state: Partial<PaginationTableState<T>>;
|
|
46
|
-
rows: Row<T>[];
|
|
47
|
-
} & UsePaginationInstanceProps<T>;
|
|
48
|
-
/**
|
|
49
|
-
* Table Skeleton to keep most section logic DRY
|
|
50
|
-
*
|
|
51
|
-
* How the table component is divided into sections:
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* +----------------+
|
|
55
|
-
* | Table Controls |
|
|
56
|
-
* | (ex: Search) |
|
|
57
|
-
* +----------------+
|
|
58
|
-
* | Header |
|
|
59
|
-
* +----------------+
|
|
60
|
-
* | Body (data) |
|
|
61
|
-
* +----------------+
|
|
62
|
-
* | Navigation |
|
|
63
|
-
* +----------------+
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
declare const Table: {
|
|
67
|
-
<T extends object>(props: Partial<Sections> & Partial<{
|
|
68
|
-
actionsButtons?: ((row: Row<T>) => JSX.Element | JSX.Element[]) | undefined;
|
|
69
|
-
loading: boolean;
|
|
70
|
-
} & UseTableInstanceProps<T> & Partial<UsePaginationInstanceProps<T>> & {
|
|
71
|
-
state: Partial<PaginationTableState<T>>;
|
|
72
|
-
rows: Row<T>[];
|
|
73
|
-
} & UsePaginationInstanceProps<T> & Pick<UseTableInstanceProps<T>, "headerGroups"> & UseSortByInstanceProps<T>> & Omit<ElementBase<HTMLDivElement>, "controls" | "data" | "headers" | "rows">): import("react/jsx-runtime").JSX.Element;
|
|
74
|
-
RowActions: (props: ElementBase<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
75
|
-
};
|
|
76
|
-
export default Table;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) "Neo4j"
|
|
4
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
-
*
|
|
6
|
-
* This file is part of Neo4j.
|
|
7
|
-
*
|
|
8
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
interface TableNavigationProps {
|
|
22
|
-
/** If there is a previous page available */
|
|
23
|
-
canPreviousPage: boolean;
|
|
24
|
-
/** If there is a next page available */
|
|
25
|
-
canNextPage: boolean;
|
|
26
|
-
/** On page click */
|
|
27
|
-
onPageClick: (pageNumber: number) => void;
|
|
28
|
-
/** Go to previous page if applicable */
|
|
29
|
-
previousPage: () => void;
|
|
30
|
-
/** Go to next page if applicable */
|
|
31
|
-
nextPage: () => void;
|
|
32
|
-
/** React Table page options */
|
|
33
|
-
pageOptions: any;
|
|
34
|
-
/** React Table current index */
|
|
35
|
-
pageIndex: number;
|
|
36
|
-
}
|
|
37
|
-
export declare const TableNavigation: ({ canPreviousPage, canNextPage, onPageClick, previousPage, nextPage, pageIndex, pageOptions, }: TableNavigationProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
export default TableNavigation;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) "Neo4j"
|
|
4
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
-
*
|
|
6
|
-
* This file is part of Neo4j.
|
|
7
|
-
*
|
|
8
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
import { type TableInstance } from 'react-table';
|
|
22
|
-
export type RowInstance<T extends Record<string, unknown>> = {
|
|
23
|
-
onAllRowSelect: onAllRowSelectType;
|
|
24
|
-
onRowSelect: onRowSelectType<T>;
|
|
25
|
-
} & TableInstance<T>;
|
|
26
|
-
export type onAllRowSelectType = () => void;
|
|
27
|
-
export type onRowSelectType<T extends Record<string, unknown>> = (originalDataRow: T, index: number) => void;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) "Neo4j"
|
|
4
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
-
*
|
|
6
|
-
* This file is part of Neo4j.
|
|
7
|
-
*
|
|
8
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
import { type Hooks, type UseGroupByCellProps, type UseTableCellProps, type UseRowStateCellProps, type UseRowSelectRowProps } from 'react-table';
|
|
22
|
-
export interface CustomCell<D extends Record<string, unknown> = Record<string, unknown>, V = any> extends UseTableCellProps<D, V>, UseGroupByCellProps<D>, UseRowSelectRowProps<D>, UseRowStateCellProps<D> {
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* A react-table plugin to support controlled selected row state for multiple rows
|
|
26
|
-
*
|
|
27
|
-
* Required options provided to useTable:
|
|
28
|
-
*
|
|
29
|
-
* `onAllRowSelect`: A callback that is called when the all rows checkbox is toggled
|
|
30
|
-
* `onRowSelect`: A callback that is called when a rows checkbox is toggled
|
|
31
|
-
*
|
|
32
|
-
* Required fields on `data` provided to useTable:
|
|
33
|
-
*
|
|
34
|
-
* `isSelected`: a boolean that indicates if the row is selected. This key can be changed
|
|
35
|
-
* from `isSelected` to something else by setting the `manualRowSelectedKey` option
|
|
36
|
-
* in the useTable options. See the useRowSelect plugin docs for more details.
|
|
37
|
-
*/
|
|
38
|
-
declare const useMultiRowSelect: {
|
|
39
|
-
<T extends Record<string, unknown>>(hooks: Hooks<T>): void;
|
|
40
|
-
pluginName: string;
|
|
41
|
-
};
|
|
42
|
-
export default useMultiRowSelect;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) "Neo4j"
|
|
4
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
-
*
|
|
6
|
-
* This file is part of Neo4j.
|
|
7
|
-
*
|
|
8
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
import { type Hooks } from 'react-table';
|
|
22
|
-
/**
|
|
23
|
-
* A react-table plugin to support controlled selected row state for a single row
|
|
24
|
-
*
|
|
25
|
-
* Required options provided to useTable:
|
|
26
|
-
*
|
|
27
|
-
* `onRowSelect`: A callback that is called when a rows checkbox is toggled
|
|
28
|
-
*
|
|
29
|
-
* Required fields on `data` provided to useTable:
|
|
30
|
-
*
|
|
31
|
-
* `isSelected`: a boolean that indicates if the row is selected. This key can be changed
|
|
32
|
-
* from `isSelected` to something else by setting the `manualRowSelectedKey` option
|
|
33
|
-
* in the useTable options. See the useRowSelect plugin docs for more details.
|
|
34
|
-
* There should only ever be 1 data entry with isSelected set to true
|
|
35
|
-
*/
|
|
36
|
-
export declare const useSingleRowSelect: <T extends Record<string, unknown>>(hooks: Hooks<T>) => void;
|
|
37
|
-
export default useSingleRowSelect;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|