@monolith-forensics/monolith-ui 1.3.113 → 1.3.114
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.
|
@@ -29,7 +29,7 @@ const FlexedRow = styled.div `
|
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
31
31
|
const TableMenu = () => {
|
|
32
|
-
var _a, _b, _c, _d;
|
|
32
|
+
var _a, _b, _c, _d, _e;
|
|
33
33
|
const { data, columnState, searchState, toggleColumnVisibility, tableMenuOptions, runSearch, enableSelection, compactState, toggleCompact, totalRecords, getCalculatedSelectionTotal, filterState, handleFilterChange, clearSearch, } = useTable();
|
|
34
34
|
const inputRef = useRef(null);
|
|
35
35
|
if ((tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.enabled) !== true)
|
|
@@ -38,7 +38,7 @@ const TableMenu = () => {
|
|
|
38
38
|
const queryFilter = useQueryFilter({
|
|
39
39
|
defaultFilter: filterState,
|
|
40
40
|
filterDefinitions: (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.filterDefinitions) || [],
|
|
41
|
-
showCombinator: true,
|
|
41
|
+
showCombinator: (_a = filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.showCombinator) !== null && _a !== void 0 ? _a : true,
|
|
42
42
|
onFilterChange: (q) => {
|
|
43
43
|
var _a;
|
|
44
44
|
handleFilterChange(q);
|
|
@@ -83,11 +83,11 @@ const TableMenu = () => {
|
|
|
83
83
|
}, [searchState]);
|
|
84
84
|
return (_jsxs(StyledContainer, { children: [_jsxs(FlexedRow, { className: "justify-sb", children: [_jsxs(FlexedRow, { children: [(addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.enabled) === true &&
|
|
85
85
|
((addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.type) === "button" ||
|
|
86
|
-
(addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.type) === undefined) && (_jsx(Button, Object.assign({ color: "primary", variant: "contained", size: "xxs", onClick: () => { var _a; return (_a = addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.onClick) === null || _a === void 0 ? void 0 : _a.call(addButtonOptions); } }, addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.buttonOptions, { children: ((
|
|
86
|
+
(addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.type) === undefined) && (_jsx(Button, Object.assign({ color: "primary", variant: "contained", size: "xxs", onClick: () => { var _a; return (_a = addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.onClick) === null || _a === void 0 ? void 0 : _a.call(addButtonOptions); } }, addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.buttonOptions, { children: ((_b = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.addButtonOptions) === null || _b === void 0 ? void 0 : _b.label) || "+ Add Record" }))), (addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.enabled) === true &&
|
|
87
87
|
(addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.type) === "menu" && (_jsx(DropDownMenu, Object.assign({ data: [], variant: "contained", arrow: true, size: "xxs", buttonProps: {
|
|
88
88
|
color: "primary",
|
|
89
89
|
size: "xxs",
|
|
90
|
-
} }, addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.menuOptions, { children: ((
|
|
90
|
+
} }, addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.menuOptions, { children: ((_c = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.addButtonOptions) === null || _c === void 0 ? void 0 : _c.label) || "Options" }))), (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.enabled) === true && (_jsx(DropDownMenu, { variant: "outlined", size: "xs", data: ((_d = filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.filterDefinitions) === null || _d === void 0 ? void 0 : _d.map((filter) => ({
|
|
91
91
|
label: filter.label,
|
|
92
92
|
value: filter.dataField,
|
|
93
93
|
data: filter,
|
|
@@ -131,6 +131,6 @@ const TableMenu = () => {
|
|
|
131
131
|
style: { padding: "0px 4px", height: 24 },
|
|
132
132
|
}, dropDownProps: {
|
|
133
133
|
style: { width: 175, maxWidth: 400 },
|
|
134
|
-
}, children: _jsx(Columns3Icon, { size: 14 }) })), (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.enabled) === true && (_jsx(TextInput, { ref: inputRef, size: "xs", placeholder: ((
|
|
134
|
+
}, children: _jsx(Columns3Icon, { size: 14 }) })), (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.enabled) === true && (_jsx(TextInput, { ref: inputRef, size: "xs", placeholder: ((_e = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.searchOptions) === null || _e === void 0 ? void 0 : _e.placeholder) || "Search", defaultValue: searchState, onChange: handleSearch }))] })] }), _jsx(QueryFilter, { queryFilter: queryFilter })] }));
|
|
135
135
|
};
|
|
136
136
|
export default TableMenu;
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -221,6 +221,7 @@ export interface OnColumnChangeProps {
|
|
|
221
221
|
export type OnTableExportFn = (e: TableExportOptions) => void;
|
|
222
222
|
export type TableFilterOptions = {
|
|
223
223
|
enabled?: boolean;
|
|
224
|
+
showCombinator?: boolean;
|
|
224
225
|
filterDefinitions?: FilterDefinition[];
|
|
225
226
|
onFilterChange?: (e: Query) => void;
|
|
226
227
|
};
|