@myunisoft/design-system 1.2.6-rev396 → 1.2.9-SC-713.1

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.
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { GridValidRowModel } from '@mui/x-data-grid-pro';
3
+ export type MenuAction = {
4
+ key: string;
5
+ label: string;
6
+ icon?: ReactNode;
7
+ color?: string;
8
+ disabled?: boolean | ((selectedRows: GridValidRowModel[]) => boolean);
9
+ onClick: (selectedRows: GridValidRowModel[]) => void;
10
+ };
11
+ type ActionsMenuProps = {
12
+ isOpen: boolean;
13
+ anchorEl: HTMLElement | null;
14
+ menuActions: MenuAction[];
15
+ selectedRows: GridValidRowModel[];
16
+ onClose: () => void;
17
+ };
18
+ declare const ActionsMenu: ({ isOpen, anchorEl, menuActions, selectedRows, onClose }: ActionsMenuProps) => import("react/jsx-runtime").JSX.Element;
19
+ export default ActionsMenu;
@@ -7,20 +7,23 @@
7
7
  * Source (MUI v7.x): https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/components/toolbar/GridToolbar.tsx
8
8
  */
9
9
  import { type GridRowSelectionModel, type GridSlotsComponentsProps, type GridValidRowModel } from '@mui/x-data-grid-pro';
10
+ import { type MenuAction } from './ActionsMenu';
10
11
  import { type IconButtonConfig, type TextButtonConfig } from './ArrayButtons';
11
12
  interface DeleteAction {
12
13
  onDelete: (selectedRowIds: GridRowSelectionModel) => boolean | Promise<boolean>;
13
14
  disabled?: boolean;
14
15
  }
15
16
  interface BulkEditAction {
16
- onBulkEditSave: (selectedIds: GridRowSelectionModel, newRows: GridValidRowModel[]) => boolean | Promise<boolean>;
17
+ onBulkEditSave: (selectedRowIds: GridRowSelectionModel, newRows: GridValidRowModel[]) => boolean | Promise<boolean>;
17
18
  disabled?: boolean;
18
19
  }
19
20
  declare module '@mui/x-data-grid-pro' {
20
21
  interface ToolbarPropsOverrides {
22
+ showSelectedCount?: boolean;
21
23
  customButtons?: CustomToolbarButtonConfig[];
22
24
  deleteAction?: DeleteAction;
23
25
  bulkEditAction?: BulkEditAction;
26
+ menuActions?: MenuAction[];
24
27
  }
25
28
  }
26
29
  interface CustomTextButtonConfig extends Omit<TextButtonConfig, 'onClick'> {