@mamrp/components 1.0.35 → 1.0.37

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/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ import React__default, { ReactNode, CSSProperties, Dispatch, SetStateAction } fr
3
3
  import { Control, FieldValues, Path, FieldErrors, UseFormSetValue } from 'react-hook-form';
4
4
  import { Moment } from 'moment-jalaali';
5
5
  import { SxProps, Theme } from '@mui/material';
6
- import { GridColDef } from '@mui/x-data-grid';
6
+ import { GridColDef, GridRowSelectionModel, GridRowParams } from '@mui/x-data-grid';
7
7
  import { TextFieldProps } from '@mui/material/TextField';
8
8
 
9
9
  interface MultipleSelectChipProps {
@@ -228,8 +228,12 @@ type TapleProps = {
228
228
  setsortQuery?: Dispatch<SetStateAction<any | null>>;
229
229
  sortQuery?: any;
230
230
  fontSize?: number | string;
231
+ checkboxSelection?: boolean;
232
+ selectedRows?: GridRowSelectionModel;
233
+ setSelectedRows?: Dispatch<SetStateAction<GridRowSelectionModel>>;
234
+ isRowSelectable?: (params: GridRowParams) => boolean;
231
235
  };
232
- declare const Table: ({ pagingmode, totalRows, rows, columns, paginationModel, setPaginationModel, loading, rowId, _tools, _CustomFooter, rowInPage, highlightedRowId, evenRowBgColor, sortFieldMapping, setsortQuery, sortQuery, fontSize, ...rest }: TapleProps) => React__default.JSX.Element;
236
+ declare const Table: ({ pagingmode, totalRows, rows, columns, paginationModel, setPaginationModel, loading, rowId, _tools, _CustomFooter, rowInPage, highlightedRowId, evenRowBgColor, sortFieldMapping, setsortQuery, sortQuery, fontSize, checkboxSelection, selectedRows, setSelectedRows, isRowSelectable, ...rest }: TapleProps) => React__default.JSX.Element;
233
237
 
234
238
  type FormInputNumberProps<T extends FieldValues> = {
235
239
  control: Control<T>;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import React__default, { ReactNode, CSSProperties, Dispatch, SetStateAction } fr
3
3
  import { Control, FieldValues, Path, FieldErrors, UseFormSetValue } from 'react-hook-form';
4
4
  import { Moment } from 'moment-jalaali';
5
5
  import { SxProps, Theme } from '@mui/material';
6
- import { GridColDef } from '@mui/x-data-grid';
6
+ import { GridColDef, GridRowSelectionModel, GridRowParams } from '@mui/x-data-grid';
7
7
  import { TextFieldProps } from '@mui/material/TextField';
8
8
 
9
9
  interface MultipleSelectChipProps {
@@ -228,8 +228,12 @@ type TapleProps = {
228
228
  setsortQuery?: Dispatch<SetStateAction<any | null>>;
229
229
  sortQuery?: any;
230
230
  fontSize?: number | string;
231
+ checkboxSelection?: boolean;
232
+ selectedRows?: GridRowSelectionModel;
233
+ setSelectedRows?: Dispatch<SetStateAction<GridRowSelectionModel>>;
234
+ isRowSelectable?: (params: GridRowParams) => boolean;
231
235
  };
232
- declare const Table: ({ pagingmode, totalRows, rows, columns, paginationModel, setPaginationModel, loading, rowId, _tools, _CustomFooter, rowInPage, highlightedRowId, evenRowBgColor, sortFieldMapping, setsortQuery, sortQuery, fontSize, ...rest }: TapleProps) => React__default.JSX.Element;
236
+ declare const Table: ({ pagingmode, totalRows, rows, columns, paginationModel, setPaginationModel, loading, rowId, _tools, _CustomFooter, rowInPage, highlightedRowId, evenRowBgColor, sortFieldMapping, setsortQuery, sortQuery, fontSize, checkboxSelection, selectedRows, setSelectedRows, isRowSelectable, ...rest }: TapleProps) => React__default.JSX.Element;
233
237
 
234
238
  type FormInputNumberProps<T extends FieldValues> = {
235
239
  control: Control<T>;
package/dist/index.js CHANGED
@@ -3138,6 +3138,10 @@ var Table = ({
3138
3138
  setsortQuery,
3139
3139
  sortQuery,
3140
3140
  fontSize,
3141
+ checkboxSelection = false,
3142
+ selectedRows,
3143
+ setSelectedRows,
3144
+ isRowSelectable,
3141
3145
  ...rest
3142
3146
  }) => {
3143
3147
  const [sortModel, setSortModel] = import_react19.default.useState([]);
@@ -3212,6 +3216,14 @@ var Table = ({
3212
3216
  return /* @__PURE__ */ import_react19.default.createElement(ScrollableContainer, null, /* @__PURE__ */ import_react19.default.createElement(
3213
3217
  import_x_data_grid.DataGrid,
3214
3218
  {
3219
+ checkboxSelection: selectedRows != void 0,
3220
+ rowSelectionModel: selectedRows,
3221
+ isRowSelectable: isRowSelectable ? (params) => isRowSelectable(params) : void 0,
3222
+ onRowSelectionModelChange: (newSelection) => {
3223
+ if (setSelectedRows) {
3224
+ setSelectedRows(newSelection);
3225
+ }
3226
+ },
3215
3227
  rows,
3216
3228
  columns: columns.map((column) => ({ ...column })),
3217
3229
  disableRowSelectionOnClick: true,