@databiosphere/findable-ui 2.2.0 → 3.0.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/lib/components/Detail/components/DetailViewTable/detailViewTable.js +1 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
- package/lib/components/Index/index.d.ts +2 -1
- package/lib/components/Index/index.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +3 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Table/common/utils.d.ts +6 -0
- package/lib/components/Table/common/utils.js +12 -1
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +2 -2
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +1 -1
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +3 -3
- package/lib/components/Table/components/TableCell/common/utils.d.ts +8 -0
- package/lib/components/Table/components/TableCell/common/utils.js +15 -0
- package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.d.ts +6 -0
- package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.js +15 -0
- package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.d.ts +6 -0
- package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.js +16 -0
- package/lib/components/Table/components/TableHead/tableHead.js +2 -2
- package/lib/components/Table/components/TableRows/tableRows.js +2 -3
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.d.ts +10 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.js +37 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.d.ts +3 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.js +13 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.d.ts +9 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.js +19 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.d.ts +5 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.js +13 -0
- package/lib/components/Table/components/TableToolbar/tableToolbar.js +5 -5
- package/lib/components/Table/components/TableToolbar/tableToolbar.styles.d.ts +1 -5
- package/lib/components/Table/components/TableToolbar/tableToolbar.styles.js +10 -7
- package/lib/components/Table/table.d.ts +5 -2
- package/lib/components/Table/table.js +13 -2
- package/lib/components/TableCreator/common/constants.d.ts +6 -0
- package/lib/components/TableCreator/common/constants.js +22 -0
- package/lib/components/TableCreator/common/entities.d.ts +5 -0
- package/lib/components/TableCreator/common/entities.js +2 -0
- package/lib/components/TableCreator/common/utils.d.ts +8 -0
- package/lib/components/TableCreator/common/utils.js +24 -0
- package/lib/components/TableCreator/tableCreator.d.ts +3 -1
- package/lib/components/TableCreator/tableCreator.js +19 -34
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +5 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +25 -0
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.d.ts +4 -2
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.js +2 -2
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.styles.d.ts +5 -1
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.styles.js +24 -1
- package/lib/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.d.ts +6 -0
- package/lib/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.js +29 -0
- package/lib/components/common/Dialog/dialog.d.ts +7 -0
- package/lib/components/common/Dialog/dialog.js +24 -0
- package/lib/components/common/DropdownMenu/common/constants.d.ts +2 -0
- package/lib/components/common/DropdownMenu/common/constants.js +8 -0
- package/lib/components/common/DropdownMenu/common/entities.d.ts +10 -0
- package/lib/components/common/DropdownMenu/common/entities.js +2 -0
- package/lib/components/common/DropdownMenu/components/MenuItem/menuItem.d.ts +7 -0
- package/lib/components/common/DropdownMenu/components/MenuItem/menuItem.js +25 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.d.ts +9 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.js +49 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.d.ts +3 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.js +13 -0
- package/lib/components/common/IconButton/iconButton.d.ts +4 -3
- package/lib/components/common/IconButton/iconButton.js +4 -4
- package/lib/components/common/IconButton/iconButton.styles.d.ts +34 -0
- package/lib/components/common/IconButton/iconButton.styles.js +27 -1
- package/lib/components/common/Tabs/tabs.styles.d.ts +1 -1
- package/lib/config/entities.d.ts +2 -0
- package/lib/providers/exploreState/entities.d.ts +6 -2
- package/lib/providers/exploreState/initializer/utils.js +20 -7
- package/lib/providers/exploreState/payloads/entities.d.ts +24 -6
- package/lib/providers/exploreState/utils.d.ts +24 -2
- package/lib/providers/exploreState/utils.js +52 -3
- package/lib/providers/exploreState.d.ts +29 -5
- package/lib/providers/exploreState.js +28 -7
- package/lib/theme/common/components.js +4 -0
- package/lib/views/ExploreView/exploreView.d.ts +3 -1
- package/lib/views/ExploreView/exploreView.js +3 -3
- package/package.json +1 -1
- package/src/components/Detail/components/DetailViewTable/detailViewTable.tsx +2 -2
- package/src/components/Index/index.tsx +3 -1
- package/src/components/Table/common/utils.ts +17 -0
- package/src/components/Table/components/CheckboxMenu/checkboxMenu.styles.ts +3 -3
- package/src/components/Table/components/CheckboxMenu/checkboxMenu.tsx +4 -2
- package/src/components/Table/components/TableCell/common/utils.ts +16 -0
- package/src/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.tsx +24 -0
- package/src/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.tsx +31 -0
- package/src/components/Table/components/TableHead/tableHead.tsx +18 -7
- package/src/components/Table/components/TableRows/tableRows.tsx +10 -8
- package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.ts +8 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.tsx +50 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.ts +8 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.tsx +30 -0
- package/src/components/Table/components/TableToolbar/tableToolbar.styles.ts +10 -7
- package/src/components/Table/components/TableToolbar/tableToolbar.tsx +11 -8
- package/src/components/Table/table.tsx +18 -1
- package/src/components/TableCreator/common/constants.ts +26 -0
- package/src/components/TableCreator/common/entities.ts +6 -0
- package/src/components/TableCreator/common/utils.ts +33 -0
- package/src/components/TableCreator/tableCreator.tsx +38 -17
- package/src/components/common/Alert/components/AlertText/alertText.styles.ts +20 -0
- package/src/components/common/Button/components/DropdownButton/dropdownButton.styles.ts +15 -1
- package/src/components/common/Button/components/DropdownButton/dropdownButton.tsx +10 -2
- package/src/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.tsx +23 -0
- package/src/components/common/Dialog/dialog.tsx +21 -0
- package/src/components/common/DropdownMenu/common/constants.ts +7 -0
- package/src/components/common/DropdownMenu/common/entities.ts +11 -0
- package/src/components/common/DropdownMenu/components/MenuItem/menuItem.tsx +24 -0
- package/src/components/common/DropdownMenu/dropdownMenu.styles.ts +8 -0
- package/src/components/common/DropdownMenu/dropdownMenu.tsx +48 -0
- package/src/components/common/IconButton/iconButton.styles.ts +18 -0
- package/src/components/common/IconButton/iconButton.tsx +10 -11
- package/src/config/entities.ts +2 -0
- package/src/providers/exploreState/entities.ts +8 -2
- package/src/providers/exploreState/initializer/utils.ts +21 -1
- package/src/providers/exploreState/payloads/entities.ts +32 -7
- package/src/providers/exploreState/utils.ts +81 -1
- package/src/providers/exploreState.tsx +88 -11
- package/src/theme/common/components.ts +4 -0
- package/src/views/ExploreView/exploreView.tsx +6 -2
- package/types/data-explorer-ui.d.ts +10 -0
- package/src/components/Table/components/EntityViewToggle/entityViewToggle.tsx +0 -36
|
@@ -51,18 +51,19 @@ const table_styles_1 = require("./table.styles");
|
|
|
51
51
|
* Uncontrolled table will take advantage of React Table's state and will be used for static loads.
|
|
52
52
|
* @param tableProps - Set of props required for displaying the table.
|
|
53
53
|
* @param tableProps.columns - Set of columns to display.
|
|
54
|
+
* @param tableProps.getRowId - Function to customize the row ID.
|
|
54
55
|
* @param tableProps.initialState - Initial table state.
|
|
55
56
|
* @param tableProps.items - Row data to display.
|
|
56
57
|
* @param tableProps.listView - List view configuration.
|
|
57
58
|
* @param tableProps.total - Total number of rows in the result set.
|
|
58
59
|
* @returns Configured table element for display.
|
|
59
60
|
*/
|
|
60
|
-
const TableComponent = ({ columns, initialState, items, listView, total, }) => {
|
|
61
|
+
const TableComponent = ({ columns, getRowId, initialState, items, listView, total, }) => {
|
|
61
62
|
const tabletDown = (0, useBreakpointHelper_1.useBreakpointHelper)(useBreakpointHelper_1.BREAKPOINT_FN_NAME.DOWN, breakpoints_1.TABLET);
|
|
62
63
|
const exploreMode = (0, useExploreMode_1.useExploreMode)();
|
|
63
64
|
const { exploreDispatch, exploreState } = (0, useExploreState_1.useExploreState)();
|
|
64
65
|
const { entityPageState, filterState, isRelatedView, listItems, loading, paginationState, tabValue, } = exploreState;
|
|
65
|
-
const { columnsVisibility, sorting } = entityPageState[tabValue];
|
|
66
|
+
const { columnsVisibility, enableRowSelection, rowSelection, sorting } = entityPageState[tabValue];
|
|
66
67
|
const { currentPage, pages, pageSize } = paginationState;
|
|
67
68
|
const { disablePagination = false } = listView || {};
|
|
68
69
|
const clientFiltering = (0, utils_1.isClientFilteringEnabled)(exploreMode);
|
|
@@ -89,12 +90,19 @@ const TableComponent = ({ columns, initialState, items, listView, total, }) => {
|
|
|
89
90
|
type: exploreState_1.ExploreActionKind.UpdateColumnVisibility,
|
|
90
91
|
});
|
|
91
92
|
};
|
|
93
|
+
const onRowSelectionChange = (updater) => {
|
|
94
|
+
exploreDispatch({
|
|
95
|
+
payload: typeof updater === "function" ? updater(rowSelection) : updater,
|
|
96
|
+
type: exploreState_1.ExploreActionKind.UpdateRowSelection,
|
|
97
|
+
});
|
|
98
|
+
};
|
|
92
99
|
const state = {
|
|
93
100
|
columnVisibility: columnsVisibility,
|
|
94
101
|
pagination: {
|
|
95
102
|
pageIndex: 0,
|
|
96
103
|
pageSize: disablePagination ? Number.MAX_SAFE_INTEGER : pageSize,
|
|
97
104
|
},
|
|
105
|
+
rowSelection,
|
|
98
106
|
sorting,
|
|
99
107
|
};
|
|
100
108
|
const tableInstance = (0, react_table_1.useReactTable)({
|
|
@@ -103,6 +111,7 @@ const TableComponent = ({ columns, initialState, items, listView, total, }) => {
|
|
|
103
111
|
enableColumnFilters: true,
|
|
104
112
|
enableFilters: true,
|
|
105
113
|
enableMultiSort: false,
|
|
114
|
+
enableRowSelection,
|
|
106
115
|
enableSorting: true,
|
|
107
116
|
enableSortingRemoval: false,
|
|
108
117
|
getCoreRowModel: (0, react_table_1.getCoreRowModel)(),
|
|
@@ -112,11 +121,13 @@ const TableComponent = ({ columns, initialState, items, listView, total, }) => {
|
|
|
112
121
|
: undefined,
|
|
113
122
|
getFilteredRowModel: clientFiltering ? (0, react_table_1.getFilteredRowModel)() : undefined,
|
|
114
123
|
getPaginationRowModel: (0, react_table_1.getPaginationRowModel)(),
|
|
124
|
+
getRowId,
|
|
115
125
|
getSortedRowModel: clientFiltering ? (0, react_table_1.getSortedRowModel)() : undefined,
|
|
116
126
|
initialState,
|
|
117
127
|
manualPagination: clientFiltering,
|
|
118
128
|
manualSorting: !clientFiltering,
|
|
119
129
|
onColumnVisibilityChange,
|
|
130
|
+
onRowSelectionChange,
|
|
120
131
|
onSortingChange,
|
|
121
132
|
pageCount: total,
|
|
122
133
|
state,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COLUMN_CONFIGS = exports.ACCESSOR_KEYS = void 0;
|
|
4
|
+
const rowSelectionCell_1 = require("../../Table/components/TableCell/components/RowSelectionCell/rowSelectionCell");
|
|
5
|
+
exports.ACCESSOR_KEYS = {
|
|
6
|
+
SELECT: "select",
|
|
7
|
+
};
|
|
8
|
+
exports.COLUMN_CONFIGS = {
|
|
9
|
+
SELECT: {
|
|
10
|
+
columnPinned: false,
|
|
11
|
+
columnVisible: false,
|
|
12
|
+
componentConfig: { component: rowSelectionCell_1.RowSelectionCell },
|
|
13
|
+
disableHiding: true,
|
|
14
|
+
disableSorting: true,
|
|
15
|
+
header: exports.ACCESSOR_KEYS.SELECT,
|
|
16
|
+
id: exports.ACCESSOR_KEYS.SELECT,
|
|
17
|
+
meta: {
|
|
18
|
+
header: "",
|
|
19
|
+
},
|
|
20
|
+
width: "max-content",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
import { BaseColumnConfig } from "./entities";
|
|
3
|
+
/**
|
|
4
|
+
* Builds a base column definition.
|
|
5
|
+
* @param baseColumnConfig - Base column configuration.
|
|
6
|
+
* @returns column definition.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildBaseColumnDef<T, TValue>(baseColumnConfig: BaseColumnConfig<T, TValue>): ColumnDef<T>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBaseColumnDef = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Builds a base column definition.
|
|
6
|
+
* @param baseColumnConfig - Base column configuration.
|
|
7
|
+
* @returns column definition.
|
|
8
|
+
*/
|
|
9
|
+
function buildBaseColumnDef(baseColumnConfig) {
|
|
10
|
+
const { columnPinned, disableHiding, disableSorting, header, id, meta, width, } = baseColumnConfig;
|
|
11
|
+
return {
|
|
12
|
+
accessorKey: id,
|
|
13
|
+
enableHiding: !disableHiding,
|
|
14
|
+
enableSorting: !disableSorting,
|
|
15
|
+
header,
|
|
16
|
+
id,
|
|
17
|
+
meta: {
|
|
18
|
+
columnPinned,
|
|
19
|
+
header: meta ? meta.header : header,
|
|
20
|
+
width,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.buildBaseColumnDef = buildBaseColumnDef;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnSort } from "@tanstack/react-table";
|
|
3
|
+
import { CoreOptions } from "@tanstack/table-core";
|
|
3
4
|
import { Pagination } from "../../common/entities";
|
|
4
5
|
import { ColumnConfig, ListViewConfig } from "../../config/entities";
|
|
5
6
|
export interface TableCreatorProps<T> {
|
|
6
7
|
columns: ColumnConfig<T>[];
|
|
7
8
|
defaultSort: ColumnSort | undefined;
|
|
9
|
+
getRowId?: CoreOptions<T>["getRowId"];
|
|
8
10
|
items: T[];
|
|
9
11
|
listView?: ListViewConfig;
|
|
10
12
|
loading?: boolean;
|
|
@@ -14,4 +16,4 @@ export interface TableCreatorProps<T> {
|
|
|
14
16
|
pagination?: Pagination;
|
|
15
17
|
total?: number;
|
|
16
18
|
}
|
|
17
|
-
export declare const TableCreator: <T extends object>({ columns, defaultSort, items, listView, loading, pageCount, pages, pageSize, pagination, total, }: TableCreatorProps<T>) => JSX.Element;
|
|
19
|
+
export declare const TableCreator: <T extends object>({ columns, defaultSort, getRowId, items, listView, loading, pageCount, pages, pageSize, pagination, total, }: TableCreatorProps<T>) => JSX.Element;
|
|
@@ -22,17 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
26
|
exports.TableCreator = void 0;
|
|
38
27
|
const react_1 = __importStar(require("react"));
|
|
@@ -40,35 +29,31 @@ const paper_1 = require("../common/Paper/paper");
|
|
|
40
29
|
const ComponentCreator_1 = require("../ComponentCreator/ComponentCreator");
|
|
41
30
|
const loading_1 = require("../Loading/loading");
|
|
42
31
|
const utils_1 = require("../Table/common/utils");
|
|
32
|
+
const rowSelectionCell_1 = require("../Table/components/TableCell/components/RowSelectionCell/rowSelectionCell");
|
|
33
|
+
const headSelectionCell_1 = require("../Table/components/TableHead/components/HeadSelectionCell/headSelectionCell");
|
|
43
34
|
const table_1 = require("../Table/table");
|
|
35
|
+
const constants_1 = require("./common/constants");
|
|
36
|
+
const utils_2 = require("./common/utils");
|
|
44
37
|
const tableCreator_styles_1 = require("./tableCreator.styles");
|
|
45
|
-
const createCell = (config) =>
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- We can't determine the cell type
|
|
47
|
-
function CellCreator({ row }) {
|
|
38
|
+
const createCell = (config) => function CellCreator({ row }) {
|
|
48
39
|
return (react_1.default.createElement(ComponentCreator_1.ComponentCreator, { components: [config.componentConfig], response: row.original }));
|
|
49
40
|
};
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
header: columnConfig.header,
|
|
64
|
-
width: columnConfig.width,
|
|
65
|
-
},
|
|
66
|
-
sortingFn: utils_1.sortingFn,
|
|
67
|
-
});
|
|
68
|
-
}), [columns]);
|
|
41
|
+
const createHeaderSelectionCell = () => function CellCreator({ table }) {
|
|
42
|
+
return react_1.default.createElement(headSelectionCell_1.HeadSelectionCell, { tableInstance: table });
|
|
43
|
+
};
|
|
44
|
+
const createRowSelectionCell = () => function CellCreator({ row }) {
|
|
45
|
+
return react_1.default.createElement(rowSelectionCell_1.RowSelectionCell, { row: row });
|
|
46
|
+
};
|
|
47
|
+
const TableCreator = ({ columns, defaultSort, getRowId, items, listView, loading, pageCount, pages, pageSize, pagination, total, }) => {
|
|
48
|
+
const columnDefs = (0, react_1.useMemo)(() => columns.reduce((acc, columnConfig) => {
|
|
49
|
+
acc.push(Object.assign(Object.assign({}, (0, utils_2.buildBaseColumnDef)(columnConfig)), { cell: createCell(columnConfig), filterFn: utils_1.arrIncludesSome, sortingFn: utils_1.sortingFn }));
|
|
50
|
+
return acc;
|
|
51
|
+
}, [
|
|
52
|
+
Object.assign(Object.assign({}, (0, utils_2.buildBaseColumnDef)(constants_1.COLUMN_CONFIGS.SELECT)), { cell: createRowSelectionCell(), header: createHeaderSelectionCell() }),
|
|
53
|
+
]), [columns]);
|
|
69
54
|
const initialState = (0, utils_1.getInitialState)(columns, defaultSort);
|
|
70
55
|
return (react_1.default.createElement(tableCreator_styles_1.TableCreator, null,
|
|
71
56
|
react_1.default.createElement(loading_1.Loading, { appear: false, loading: loading || false, panelStyle: paper_1.PAPER_PANEL_STYLE.FLUID }),
|
|
72
|
-
react_1.default.createElement(table_1.Table, { columns: columnDefs, count: pageCount, initialState: initialState, items: items, listView: listView, loading: loading, pages: pages, pageSize: pageSize, pagination: pagination, total: total })));
|
|
57
|
+
react_1.default.createElement(table_1.Table, { columns: columnDefs, count: pageCount, getRowId: getRowId, initialState: initialState, items: items, listView: listView, loading: loading, pages: pages, pageSize: pageSize, pagination: pagination, total: total })));
|
|
73
58
|
};
|
|
74
59
|
exports.TableCreator = TableCreator;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const AlertText: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AlertText = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
exports.AlertText = styled_1.default.div `
|
|
9
|
+
ul {
|
|
10
|
+
padding-left: 24px;
|
|
11
|
+
margin: 8px 0;
|
|
12
|
+
|
|
13
|
+
li {
|
|
14
|
+
margin: 4px 0;
|
|
15
|
+
|
|
16
|
+
&:last-child {
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
*:last-child {
|
|
23
|
+
margin-bottom: 0;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ButtonProps } from "../../button";
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export interface DropdownButtonProps extends Exclude<ButtonProps, "StartIcon"> {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const DropdownButton: ({ children, disabled, open, ...props }: DropdownButtonProps) => JSX.Element;
|
|
@@ -19,7 +19,7 @@ const ArrowDropDownRounded_1 = __importDefault(require("@mui/icons-material/Arro
|
|
|
19
19
|
const react_1 = __importDefault(require("react"));
|
|
20
20
|
const dropdownButton_styles_1 = require("./dropdownButton.styles");
|
|
21
21
|
const DropdownButton = (_a) => {
|
|
22
|
-
var { children, disabled = false } = _a, props = __rest(_a, ["children", "disabled"]) /* Spread props to allow for Mui ButtonProps specific prop overrides e.g. "onClick". */;
|
|
23
|
-
return (react_1.default.createElement(dropdownButton_styles_1.DropdownButton, Object.assign({ disabled: disabled, EndIcon: ArrowDropDownRounded_1.default }, props), children));
|
|
22
|
+
var { children, disabled = false, open = false } = _a, props = __rest(_a, ["children", "disabled", "open"]) /* Spread props to allow for Mui ButtonProps specific prop overrides e.g. "onClick". */;
|
|
23
|
+
return (react_1.default.createElement(dropdownButton_styles_1.DropdownButton, Object.assign({ disabled: disabled, EndIcon: ArrowDropDownRounded_1.default, open: open }, props), children));
|
|
24
24
|
};
|
|
25
25
|
exports.DropdownButton = DropdownButton;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
open: boolean;
|
|
4
|
+
}
|
|
2
5
|
export declare const DropdownButton: import("@emotion/styled").StyledComponent<Omit<import("../../button").ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
3
6
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
}, {}, {}>;
|
|
7
|
+
} & Props, {}, {}>;
|
|
8
|
+
export {};
|
|
@@ -1,16 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
exports.DropdownButton = void 0;
|
|
18
|
+
const react_1 = require("@emotion/react");
|
|
7
19
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
20
|
+
const colors_1 = require("../../../../../styles/common/mixins/colors");
|
|
8
21
|
const buttonSecondary_1 = require("../ButtonSecondary/buttonSecondary");
|
|
9
22
|
// Dropdown button with "secondary" styles.
|
|
10
|
-
exports.DropdownButton = (0, styled_1.default)(buttonSecondary_1.ButtonSecondary
|
|
23
|
+
exports.DropdownButton = (0, styled_1.default)(buttonSecondary_1.ButtonSecondary, {
|
|
24
|
+
shouldForwardProp: (prop) => prop !== "open",
|
|
25
|
+
}) `
|
|
11
26
|
padding-right: 8px;
|
|
12
27
|
|
|
13
28
|
.MuiButton-endIcon {
|
|
14
29
|
margin-left: -6px;
|
|
15
30
|
}
|
|
31
|
+
|
|
32
|
+
${(_a) => {
|
|
33
|
+
var { open } = _a, props = __rest(_a, ["open"]);
|
|
34
|
+
return open &&
|
|
35
|
+
(0, react_1.css) `
|
|
36
|
+
background-color: ${(0, colors_1.smokeLightest)(props)};
|
|
37
|
+
`;
|
|
38
|
+
}}
|
|
16
39
|
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.IndeterminateIcon = void 0;
|
|
18
|
+
const material_1 = require("@mui/material");
|
|
19
|
+
const react_1 = __importDefault(require("react"));
|
|
20
|
+
/**
|
|
21
|
+
* Custom indeterminate icon.
|
|
22
|
+
*/
|
|
23
|
+
const IndeterminateIcon = (_a) => {
|
|
24
|
+
var { fontSize = "xsmall", viewBox = "0 0 18 18" } = _a, props = __rest(_a, ["fontSize", "viewBox"]) /* Spread props to allow for Mui SvgIconProps specific prop overrides e.g. "htmlColor". */;
|
|
25
|
+
return (react_1.default.createElement(material_1.SvgIcon, Object.assign({ fontSize: fontSize, viewBox: viewBox }, props),
|
|
26
|
+
react_1.default.createElement("path", { d: "M0 4C0 1.79086 1.79086 0 4 0H14C16.2091 0 18 1.79086 18 4V14C18 16.2091 16.2091 18 14 18H4C1.79086 18 0 16.2091 0 14V4Z", fill: "currentColor" }),
|
|
27
|
+
react_1.default.createElement("rect", { x: "5", y: "8", width: "8", height: "2", rx: "1", fill: "white" })));
|
|
28
|
+
};
|
|
29
|
+
exports.IndeterminateIcon = IndeterminateIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DialogProps as MDialogProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export interface DialogProps extends MDialogProps {
|
|
4
|
+
children: ReactNode | ReactNode[];
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Dialog: ({ children, className, onClose, open, ...props }: DialogProps) => JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Dialog = void 0;
|
|
18
|
+
const material_1 = require("@mui/material");
|
|
19
|
+
const react_1 = __importDefault(require("react"));
|
|
20
|
+
const Dialog = (_a) => {
|
|
21
|
+
var { children, className, onClose, open } = _a, props = __rest(_a, ["children", "className", "onClose", "open"]) /* Spread props to allow for Mui Dialog specific prop overrides e.g. "fullWidth". */;
|
|
22
|
+
return (react_1.default.createElement(material_1.Dialog, Object.assign({ className: className, onClose: onClose, open: open }, props), children));
|
|
23
|
+
};
|
|
24
|
+
exports.Dialog = Dialog;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_DROPDOWN_MENU_PROPS = void 0;
|
|
4
|
+
exports.DEFAULT_DROPDOWN_MENU_PROPS = {
|
|
5
|
+
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
6
|
+
slotProps: { paper: { variant: "menu" } },
|
|
7
|
+
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps as MButtonProps, IconButtonProps as MIconButtonProps } from "@mui/material";
|
|
2
|
+
export interface DropdownMenuItemProps {
|
|
3
|
+
closeMenu: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare type DropdownMenuButtonProps = MButtonProps & {
|
|
6
|
+
open?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare type DropdownMenuIconButtonProps = MIconButtonProps & {
|
|
9
|
+
open?: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MenuItemProps as MMenuItemProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export interface MenuItemProps extends MMenuItemProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const MenuItem: ({ children, className, onClick, ...props }: MenuItemProps) => JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MenuItem = void 0;
|
|
18
|
+
const material_1 = require("@mui/material");
|
|
19
|
+
const react_1 = __importDefault(require("react"));
|
|
20
|
+
const MenuItem = (_a) => {
|
|
21
|
+
var { children, className, onClick } = _a, props = __rest(_a, ["children", "className", "onClick"]) /* Spread props to allow for Mui MenuItem specific prop overrides e.g. "disableGutters". */;
|
|
22
|
+
return (react_1.default.createElement(material_1.MenuItem, Object.assign({ className: className, onClick: onClick }, props),
|
|
23
|
+
react_1.default.createElement(material_1.ListItemText, { disableTypography: true }, children)));
|
|
24
|
+
};
|
|
25
|
+
exports.MenuItem = MenuItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MenuProps as MMenuProps } from "@mui/material";
|
|
2
|
+
import { ElementType } from "react";
|
|
3
|
+
import { DropdownMenuButtonProps, DropdownMenuIconButtonProps, DropdownMenuItemProps } from "./common/entities";
|
|
4
|
+
export interface DropdownMenuProps extends Omit<MMenuProps, "children" | "open"> {
|
|
5
|
+
Button: ElementType<DropdownMenuButtonProps> | ElementType<DropdownMenuIconButtonProps>;
|
|
6
|
+
children?: ({ closeMenu }: DropdownMenuItemProps) => JSX.Element[];
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DropdownMenu: ({ Button, children, className, ...props }: DropdownMenuProps) => JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.DropdownMenu = void 0;
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const constants_1 = require("./common/constants");
|
|
40
|
+
const dropdownMenu_styles_1 = require("./dropdownMenu.styles");
|
|
41
|
+
const DropdownMenu = (_a) => {
|
|
42
|
+
var { Button, children, className } = _a, props = __rest(_a, ["Button", "children", "className"]) /* Spread props to allow for Mui Menu specific prop overrides e.g. "anchorOrigin". */;
|
|
43
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
44
|
+
const closeMenu = () => setAnchorEl(null);
|
|
45
|
+
return (react_1.default.createElement(react_1.Fragment, null,
|
|
46
|
+
react_1.default.createElement(Button, { onClick: (event) => setAnchorEl(event.currentTarget), open: Boolean(anchorEl) }),
|
|
47
|
+
react_1.default.createElement(dropdownMenu_styles_1.Menu, Object.assign({}, constants_1.DEFAULT_DROPDOWN_MENU_PROPS, { anchorEl: anchorEl, className: className, onClose: closeMenu, open: Boolean(anchorEl) }, props), children ? children({ closeMenu }) : null)));
|
|
48
|
+
};
|
|
49
|
+
exports.DropdownMenu = DropdownMenu;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Menu = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
exports.Menu = (0, styled_1.default)(material_1.Menu) `
|
|
10
|
+
.MuiPaper-menu {
|
|
11
|
+
margin: 4px 0;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconButtonProps as MIconButtonProps } from "@mui/material";
|
|
1
|
+
import { IconButtonProps as MIconButtonProps, IconProps as MIconProps } from "@mui/material";
|
|
2
2
|
import { ElementType } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Basic icon button component.
|
|
@@ -6,7 +6,8 @@ import { ElementType } from "react";
|
|
|
6
6
|
*/
|
|
7
7
|
export interface IconButtonProps extends MIconButtonProps {
|
|
8
8
|
className?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
9
|
Icon: ElementType;
|
|
10
|
+
iconProps?: MIconProps;
|
|
11
|
+
open?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare const IconButton: ({ className,
|
|
13
|
+
export declare const IconButton: ({ className, Icon, iconProps, open, size, ...props }: IconButtonProps) => JSX.Element;
|
|
@@ -15,11 +15,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.IconButton = void 0;
|
|
18
|
-
const material_1 = require("@mui/material");
|
|
19
18
|
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const iconButton_styles_1 = require("./iconButton.styles");
|
|
20
20
|
const IconButton = (_a) => {
|
|
21
|
-
var { className,
|
|
22
|
-
return (react_1.default.createElement(
|
|
23
|
-
react_1.default.createElement(Icon, {
|
|
21
|
+
var { className, Icon, iconProps = { fontSize: "small" }, open = false, size = "large" } = _a, props = __rest(_a, ["className", "Icon", "iconProps", "open", "size"]) /* Spread props to allow for Mui IconButtonProps specific prop overrides e.g. "onClick". */;
|
|
22
|
+
return (react_1.default.createElement(iconButton_styles_1.Button, Object.assign({ className: className, open: open, size: size }, props),
|
|
23
|
+
react_1.default.createElement(Icon, Object.assign({}, iconProps))));
|
|
24
24
|
};
|
|
25
25
|
exports.IconButton = IconButton;
|