@monolith-forensics/monolith-ui 1.2.88 → 1.2.90

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.
@@ -75,6 +75,7 @@ export const MenuItem = styled(forwardRef((_a, forwardedRef) => {
75
75
  : "2px 8px"};
76
76
 
77
77
  &[data-disabled] {
78
+ opacity: 0.5;
78
79
  color: ${(props) => props.theme.palette.text.secondary};
79
80
  pointer-events: "none";
80
81
  }
@@ -35,9 +35,10 @@ export const MenuItemList = ({ menuItems, searchable, searchValue = "", isObject
35
35
  onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(item);
36
36
  (_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, item);
37
37
  };
38
+ const visibleItems = menuItems.filter((item) => item.visible !== false);
38
39
  const filteredItems = searchable
39
- ? filterMenuItems(menuItems, searchValue)
40
- : menuItems;
40
+ ? filterMenuItems(visibleItems, searchValue)
41
+ : visibleItems;
41
42
  useLayoutEffect(() => {
42
43
  if (listElm.current) {
43
44
  if (onScroll) {
@@ -72,9 +73,9 @@ export const MenuItemList = ({ menuItems, searchable, searchValue = "", isObject
72
73
  const item = (data === null || data === void 0 ? void 0 : data[index]) || {};
73
74
  const isSelected = !!(selected === null || selected === void 0 ? void 0 : selected.find((s) => isObjectArray ? (s === null || s === void 0 ? void 0 : s.value) === (item === null || item === void 0 ? void 0 : item.value) : s === item));
74
75
  if (item.items) {
75
- return (_jsx(DropDownMenu, { data: item.items, size: size, buttonProps: { style }, children: item.label }));
76
+ return (_jsx(DropDownMenu, { data: item.items, size: size, buttonProps: { style }, disabled: item.disabled, children: item.label }));
76
77
  }
77
- return (_jsx(MenuItem, { className: "MenuItem", itemData: item, TooltipContent: TooltipContent, "data-selected": isSelected, leftSection: multiselect ? (_jsxs(_Fragment, { children: [_jsx(CheckBox, { value: isSelected, size: size, onChange: (newValue) => {
78
+ return (_jsx(MenuItem, { className: "MenuItem", itemData: item, TooltipContent: TooltipContent, "data-selected": isSelected, "data-disabled": item.disabled, disabled: item.disabled, leftSection: multiselect ? (_jsxs(_Fragment, { children: [_jsx(CheckBox, { value: isSelected, size: size, onChange: (newValue) => {
78
79
  var _a;
79
80
  newValue ? handleAddItem(item) : handleRemoveItem(item);
80
81
  (_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, item);
@@ -12,6 +12,8 @@ export type DropDownItem = {
12
12
  items?: DropDownItem[];
13
13
  leftSection?: React.ReactNode;
14
14
  rightSection?: React.ReactNode;
15
+ disabled?: boolean;
16
+ visible?: boolean;
15
17
  };
16
18
  export type SearchInputProps = React.ComponentPropsWithoutRef<typeof Input>;
17
19
  export interface StyledContentProps {
@@ -39,6 +41,7 @@ export interface DropDownMenuProps {
39
41
  dropDownProps?: ComponentPropsWithoutRef<typeof StyledContent>;
40
42
  buttonRender?: (props: any) => ReactElement;
41
43
  buttonProps?: ButtonProps;
44
+ disabled?: boolean;
42
45
  }
43
46
  export interface MenuProps {
44
47
  label?: any;
@@ -55,4 +58,5 @@ export interface MenuProps {
55
58
  onMenuClose?: () => void;
56
59
  TooltipContent?: ComponentType<any>;
57
60
  dropDownProps?: ComponentPropsWithoutRef<typeof StyledContent>;
61
+ disabled?: boolean;
58
62
  }
@@ -171,6 +171,13 @@ const TableProvider = (_a) => {
171
171
  for (const rule of rules) {
172
172
  const column = columnState.find((col) => col.dataField === rule.dataField);
173
173
  const { value, operator, dataField } = rule;
174
+ if (operator.value === "isEmpty" || operator.value === "isNotEmpty") {
175
+ processedData = processedData.filter((row) => {
176
+ return operator.value === "isEmpty"
177
+ ? !row[dataField]
178
+ : row[dataField];
179
+ });
180
+ }
174
181
  if (!value || value.length === 0) {
175
182
  continue;
176
183
  }
@@ -299,16 +306,6 @@ const TableProvider = (_a) => {
299
306
  return !value.find((v) => v == row[dataField]);
300
307
  });
301
308
  break;
302
- case "isEmpty":
303
- processedData = processedData.filter((row) => {
304
- return !row[dataField];
305
- });
306
- break;
307
- case "isNotEmpty":
308
- processedData = processedData.filter((row) => {
309
- return row[dataField];
310
- });
311
- break;
312
309
  default:
313
310
  break;
314
311
  }
@@ -6,16 +6,18 @@ import TableDefaults from "./TableDefaults";
6
6
  import TableRow from "./TableRow";
7
7
  const VirtualizedRows = ({ tableDimensions, targetElm, listElm, rowHeight, headerRowHeight }) => {
8
8
  const { data, compactState } = useTable();
9
- return (_jsx(TableViewPort, { className: "mfui-tbody-viewport", ref: targetElm, style: tableDimensions, children: _jsx(FixedSizeList, { itemData: { data }, overscanCount: 10, height: tableDimensions.height -
10
- (headerRowHeight
11
- ? headerRowHeight
12
- : compactState
13
- ? TableDefaults.row.height.compact
14
- : TableDefaults.row.height.normal), width: tableDimensions.width, itemCount: (data === null || data === void 0 ? void 0 : data.length) || 0, itemSize: rowHeight
15
- ? rowHeight
16
- : compactState
17
- ? TableDefaults.row.height.compact
18
- : TableDefaults.row.height.normal, outerRef: listElm, innerElementType: (props) => {
9
+ const effectiveRowHeight = compactState
10
+ ? TableDefaults.row.height.compact
11
+ : rowHeight
12
+ ? rowHeight
13
+ : TableDefaults.row.height.normal;
14
+ const viewPortHeight = tableDimensions.height -
15
+ (headerRowHeight
16
+ ? headerRowHeight
17
+ : compactState
18
+ ? TableDefaults.row.height.compact
19
+ : TableDefaults.row.height.normal);
20
+ return (_jsx(TableViewPort, { className: "mfui-tbody-viewport", ref: targetElm, style: tableDimensions, children: _jsx(FixedSizeList, { itemData: { data }, overscanCount: 10, height: viewPortHeight, width: tableDimensions.width, itemCount: (data === null || data === void 0 ? void 0 : data.length) || 0, itemSize: effectiveRowHeight, outerRef: listElm, innerElementType: (props) => {
19
21
  return _jsx(TBody, Object.assign({ className: "mfui-tbody" }, props));
20
22
  }, children: ({ data, index, style }) => {
21
23
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.2.88",
3
+ "version": "1.2.90",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",