@monolith-forensics/monolith-ui 1.2.94 → 1.2.96
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.
|
@@ -14,6 +14,7 @@ interface FieldLabelProps {
|
|
|
14
14
|
description?: string;
|
|
15
15
|
size?: Size;
|
|
16
16
|
asterisk?: boolean;
|
|
17
|
+
style?: React.CSSProperties;
|
|
17
18
|
}
|
|
18
|
-
declare const FieldLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<FieldLabelProps, never>> & string & Omit<({ className, children, error, description, size, }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
19
|
+
declare const FieldLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<FieldLabelProps, never>> & string & Omit<({ className, children, error, description, size, style, }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
19
20
|
export default FieldLabel;
|
|
@@ -24,8 +24,8 @@ export const InfoComponent = styled(({ className, children, description, label }
|
|
|
24
24
|
margin-bottom: 5px;
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
|
-
const FieldLabel = styled(({ className, children, error, description, size = "sm", }) => {
|
|
28
|
-
return (_jsxs("div", { className: className + " FieldLabel", children: [_jsx(InfoComponent, { description: description, label: children, children: _jsx("div", { className: "label", children: children }) }), error && (_jsx("div", { className: "error", title: error, children: error || "Invalid Value" }))] }));
|
|
27
|
+
const FieldLabel = styled(({ className, children, error, description, size = "sm", style, }) => {
|
|
28
|
+
return (_jsxs("div", { className: className + " FieldLabel", style: style, children: [_jsx(InfoComponent, { description: description, label: children, children: _jsx("div", { className: "label", children: children }) }), error && (_jsx("div", { className: "error", title: error, children: error || "Invalid Value" }))] }));
|
|
29
29
|
}) `
|
|
30
30
|
user-select: none;
|
|
31
31
|
font-family: apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
package/dist/Switch/Switch.js
CHANGED
|
@@ -120,7 +120,7 @@ const StyledThumb = styled(RadixSwitch.Thumb) `
|
|
|
120
120
|
`;
|
|
121
121
|
const Switch = styled((_a) => {
|
|
122
122
|
var { className, onChange, size = "xs", label, labelPosition = "right", description, error, required, disabled = false, defaultValue, value, style = {} } = _a, other = __rest(_a, ["className", "onChange", "size", "label", "labelPosition", "description", "error", "required", "disabled", "defaultValue", "value", "style"]);
|
|
123
|
-
return (_jsxs("div", { className: className, children: [label && labelPosition === "left" && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsx(StyledRoot, Object.assign({ size: size, className: "SwitchRoot", onCheckedChange: onChange, defaultChecked: defaultValue, checked: value, disabled: disabled, style: style }, other, { children: _jsx(StyledThumb, { size: size, className: "SwitchThumb" }) })), label && labelPosition === "right" && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label }))] }));
|
|
123
|
+
return (_jsxs("div", { className: className, children: [label && labelPosition === "left" && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, style: { margin: 0 }, children: label })), _jsx(StyledRoot, Object.assign({ size: size, className: "SwitchRoot", onCheckedChange: onChange, defaultChecked: defaultValue, checked: value, disabled: disabled, style: style }, other, { children: _jsx(StyledThumb, { size: size, className: "SwitchThumb" }) })), label && labelPosition === "right" && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, style: { margin: 0 }, children: label }))] }));
|
|
124
124
|
}) `
|
|
125
125
|
display: flex;
|
|
126
126
|
flex-direction: row;
|
package/dist/Table/Table.js
CHANGED
|
@@ -30,17 +30,17 @@ const StyledTableContainer = styled.div `
|
|
|
30
30
|
height: 0px;
|
|
31
31
|
flex: 1 1 auto;
|
|
32
32
|
`;
|
|
33
|
-
const TableContent = () => {
|
|
33
|
+
const TableContent = ({ children, }) => {
|
|
34
34
|
const { columnState, tableElement, tableHeight, tableMaxHeight, tableMinHeight, headerRowElm, tableDimensions, targetElm, listElm, rowHeight, headerRowHeight, compactState, virtualized, loading, } = useTable();
|
|
35
35
|
const visibleColumnCount = columnState.filter((column) => column.visible === true).length;
|
|
36
|
-
return (_jsxs(StyledTableContainer, { children: [_jsx(TableMenu, {}), _jsxs(StyledTable, { className: "mfui-table", style: {
|
|
36
|
+
return (_jsxs(StyledTableContainer, { children: [_jsx(TableMenu, {}), children, _jsxs(StyledTable, { className: "mfui-table", style: {
|
|
37
37
|
height: tableHeight || "100%",
|
|
38
38
|
maxHeight: tableMaxHeight,
|
|
39
39
|
minHeight: tableMinHeight,
|
|
40
40
|
}, ref: tableElement, "data-compact": compactState, children: [_jsx(LoadingIndicator, { visible: loading }), _jsx(TableHeader, { headerRowElm: headerRowElm }), visibleColumnCount === 0 && _jsx(_Fragment, {}), virtualized === true ? (_jsx(VirtualizedRows, { tableDimensions: tableDimensions, targetElm: targetElm, listElm: listElm, rowHeight: rowHeight, headerRowHeight: headerRowHeight })) : (_jsx(StaticRows, { targetElm: targetElm, listElm: listElm }))] })] }));
|
|
41
41
|
};
|
|
42
42
|
export const Table = (_a) => {
|
|
43
|
-
var { data, columnProps } = _a, props = __rest(_a, ["data", "columnProps"]) // pass through props straight to table context
|
|
43
|
+
var { data, columnProps, children } = _a, props = __rest(_a, ["data", "columnProps", "children"]) // pass through props straight to table context
|
|
44
44
|
;
|
|
45
45
|
const tableElement = useRef(null);
|
|
46
46
|
const targetElm = useRef(null);
|
|
@@ -110,5 +110,5 @@ export const Table = (_a) => {
|
|
|
110
110
|
};
|
|
111
111
|
}, []);
|
|
112
112
|
const __data = useMemo(() => data === null || data === void 0 ? void 0 : data.map((d, i) => (Object.assign(Object.assign({}, d), { __key: shortUUID.generate(), __index: i }))), [data]);
|
|
113
|
-
return (_jsx(TableProvider, Object.assign({ columns: columnProps, data: __data, tableElement: tableElement, headerRowElm: headerRowElm, tableDimensions: tableDimensions, targetElm: targetElm, listElm: listElm }, props, { children: _jsx(TableContent, {}) })));
|
|
113
|
+
return (_jsx(TableProvider, Object.assign({ columns: columnProps, data: __data, tableElement: tableElement, headerRowElm: headerRowElm, tableDimensions: tableDimensions, targetElm: targetElm, listElm: listElm }, props, { children: _jsx(TableContent, { children: children }) })));
|
|
114
114
|
};
|
|
@@ -31,7 +31,7 @@ const TableMenu = () => {
|
|
|
31
31
|
const { data, columnState, searchState, toggleColumnVisibility, tableMenuOptions, runSearch, enableSelection, compactState, toggleCompact, totalRecords, getCalculatedSelectionTotal, filterState, handleFilterChange, } = useTable();
|
|
32
32
|
if ((tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.enabled) !== true)
|
|
33
33
|
return null;
|
|
34
|
-
const { addButtonOptions, filterOptions, tableCountOptions, exportOptions, compactOptions, columnSelectorOptions, searchOptions, } = tableMenuOptions;
|
|
34
|
+
const { addButtonOptions, filterOptions, tableCountOptions, exportOptions, compactOptions, columnSelectorOptions, searchOptions, children, } = tableMenuOptions;
|
|
35
35
|
const queryFilter = useQueryFilter({
|
|
36
36
|
defaultFilter: filterState,
|
|
37
37
|
filterDefinitions: (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.filterDefinitions) || [],
|
|
@@ -61,11 +61,11 @@ const TableMenu = () => {
|
|
|
61
61
|
};
|
|
62
62
|
return (_jsxs(StyledContainer, { children: [_jsxs(FlexedRow, { className: "justify-sb", children: [_jsxs(FlexedRow, { children: [(addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.enabled) === true &&
|
|
63
63
|
((addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.type) === "button" ||
|
|
64
|
-
(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.
|
|
64
|
+
(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: ((_a = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.addButtonOptions) === null || _a === void 0 ? void 0 : _a.label) || "+ Add Record" }))), (addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.enabled) === true &&
|
|
65
65
|
(addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.type) === "menu" && (_jsx(DropDownMenu, Object.assign({ data: [], variant: "contained", arrow: true, size: "xxs", buttonProps: {
|
|
66
66
|
color: "primary",
|
|
67
67
|
size: "xxs",
|
|
68
|
-
} }, addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.
|
|
68
|
+
} }, addButtonOptions === null || addButtonOptions === void 0 ? void 0 : addButtonOptions.menuOptions, { children: ((_b = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.addButtonOptions) === null || _b === void 0 ? void 0 : _b.label) || "Options" }))), (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.enabled) === true && (_jsx(DropDownMenu, { variant: "outlined", size: "xs", data: ((_c = filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.filterDefinitions) === null || _c === void 0 ? void 0 : _c.map((filter) => ({
|
|
69
69
|
label: filter.label,
|
|
70
70
|
value: filter.dataField,
|
|
71
71
|
data: filter,
|
|
@@ -76,7 +76,7 @@ const TableMenu = () => {
|
|
|
76
76
|
}, onItemSelect: handleSelectFilter, dropDownProps: {
|
|
77
77
|
style: { width: 175, maxWidth: 400 },
|
|
78
78
|
}, searchable: true, children: "Filter" })), (tableCountOptions === null || tableCountOptions === void 0 ? void 0 : tableCountOptions.recordsTotalEnabled) === true && (_jsx(InfoBadge, { total: totalRecords || data.length })), enableSelection === true &&
|
|
79
|
-
(tableCountOptions === null || tableCountOptions === void 0 ? void 0 : tableCountOptions.selectionTotalEnabled) === true && (_jsx(InfoBadge, { total: getCalculatedSelectionTotal(), hint: "Selected Items", icon: CheckSquareIcon }))] }), _jsxs(FlexedRow, { children: [(exportOptions === null || exportOptions === void 0 ? void 0 : exportOptions.enabled) === true && (_jsx(DropDownMenu, { variant: "outlined", size: "xs", data: [
|
|
79
|
+
(tableCountOptions === null || tableCountOptions === void 0 ? void 0 : tableCountOptions.selectionTotalEnabled) === true && (_jsx(InfoBadge, { total: getCalculatedSelectionTotal(), hint: "Selected Items", icon: CheckSquareIcon })), children] }), _jsxs(FlexedRow, { children: [(exportOptions === null || exportOptions === void 0 ? void 0 : exportOptions.enabled) === true && (_jsx(DropDownMenu, { variant: "outlined", size: "xs", data: [
|
|
80
80
|
{
|
|
81
81
|
label: "Export Visible Columns",
|
|
82
82
|
value: TableExportOptions.ExportVisible,
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -217,8 +217,8 @@ export type TableMenuOptions = {
|
|
|
217
217
|
label?: string;
|
|
218
218
|
type?: "button" | "menu";
|
|
219
219
|
onClick?: () => void;
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
buttonOptions?: ButtonProps;
|
|
221
|
+
menuOptions?: DropDownMenuProps;
|
|
222
222
|
};
|
|
223
223
|
tableCountOptions?: {
|
|
224
224
|
recordsTotalEnabled?: boolean;
|
|
@@ -237,6 +237,7 @@ export type TableMenuOptions = {
|
|
|
237
237
|
columnSelectorOptions?: {
|
|
238
238
|
enabled?: boolean;
|
|
239
239
|
};
|
|
240
|
+
children?: React.ReactNode;
|
|
240
241
|
};
|
|
241
242
|
export interface TableProps {
|
|
242
243
|
columnProps: ColumnProps[];
|
|
@@ -265,6 +266,7 @@ export interface TableProps {
|
|
|
265
266
|
manualFiltering?: boolean;
|
|
266
267
|
manualExport?: boolean;
|
|
267
268
|
tableMenuOptions?: TableMenuOptions;
|
|
269
|
+
children?: React.ReactNode;
|
|
268
270
|
onRowUpdated?: () => void;
|
|
269
271
|
onSelectionChange?: onSelectionChangeFn;
|
|
270
272
|
onActionButtonClick?: (rowData: any) => void;
|