@mamrp/components 1.4.1 → 1.4.2

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
@@ -1,10 +1,11 @@
1
- import * as React from 'react';
1
+ import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, CSSProperties, Dispatch, SetStateAction } from 'react';
3
3
  import { Control, FieldValues, Path, FieldErrors, UseFormSetValue } from 'react-hook-form';
4
4
  import { Moment } from 'moment-jalaali';
5
5
  import { SxProps, Theme, PaperProps } from '@mui/material';
6
6
  import { GridColDef, GridRowSelectionModel, GridRowParams } from '@mui/x-data-grid';
7
7
  import { TextFieldProps } from '@mui/material/TextField';
8
+ import { MRT_ColumnDef, MRT_PaginationState, MRT_ColumnFiltersState, MRT_SortingState, MRT_TableOptions } from 'material-react-table';
8
9
 
9
10
  interface MultipleSelectChipProps {
10
11
  name: string;
@@ -19,7 +20,7 @@ interface MultipleSelectChipProps {
19
20
  variant?: "outlined" | "filled" | "standard";
20
21
  placeholder?: string;
21
22
  }
22
- declare function MultipleSelectChip({ name, control, label, data, multipleitems, isLoading, disabled, size, clear, variant, placeholder, }: MultipleSelectChipProps): React.JSX.Element;
23
+ declare function MultipleSelectChip({ name, control, label, data, multipleitems, isLoading, disabled, size, clear, variant, placeholder, }: MultipleSelectChipProps): React$1.JSX.Element;
23
24
 
24
25
  interface AdvancedSearchButtonProps {
25
26
  isShowFilter: boolean;
@@ -54,12 +55,12 @@ interface ConfirmationDialogProps$1 {
54
55
  iconColor: string;
55
56
  color: "error" | "info" | "primary" | "success" | "warning" | "secondary";
56
57
  actionTitle: string;
57
- icon?: React.ReactElement<{
58
+ icon?: React$1.ReactElement<{
58
59
  color?: string;
59
60
  size?: number;
60
61
  }>;
61
62
  }
62
- declare function ConfirmationDialog$1({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, maxWidth, iconColor, color, actionTitle, icon, }: ConfirmationDialogProps$1): React.JSX.Element;
63
+ declare function ConfirmationDialog$1({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, maxWidth, iconColor, color, actionTitle, icon, }: ConfirmationDialogProps$1): React$1.JSX.Element;
63
64
 
64
65
  interface CustomTimePickerProps {
65
66
  name: string;
@@ -70,12 +71,12 @@ interface CustomTimePickerProps {
70
71
  autoRefresh?: boolean;
71
72
  disabled?: boolean;
72
73
  }
73
- declare function CustomTimePicker({ name, control, label, size, fullwidth, autoRefresh, disabled, }: CustomTimePickerProps): React.JSX.Element;
74
+ declare function CustomTimePicker({ name, control, label, size, fullwidth, autoRefresh, disabled, }: CustomTimePickerProps): React$1.JSX.Element;
74
75
 
75
76
  declare function DateFilterRange({ FromDate, ToDate }: {
76
77
  FromDate: any;
77
78
  ToDate: any;
78
- }): React.JSX.Element;
79
+ }): React$1.JSX.Element;
79
80
 
80
81
  declare function DateFilter({ setHandler }: {
81
82
  setHandler?: any;
@@ -144,7 +145,7 @@ interface LicensePlateProps$1 {
144
145
  readOnly?: boolean;
145
146
  size?: "small" | "medium";
146
147
  }
147
- declare function LicensePlate({ width, name, setValue, data, readOnly, size, }: LicensePlateProps$1): React.JSX.Element;
148
+ declare function LicensePlate({ width, name, setValue, data, readOnly, size, }: LicensePlateProps$1): React$1.JSX.Element;
148
149
 
149
150
  interface LicensePlateProps {
150
151
  width?: CSSProperties["width"];
@@ -177,7 +178,7 @@ interface ConfirmationDialogProps {
177
178
  bodyText: ReactNode;
178
179
  isLoading?: boolean;
179
180
  }
180
- declare function ConfirmationDialog({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, }: ConfirmationDialogProps): React.JSX.Element;
181
+ declare function ConfirmationDialog({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, }: ConfirmationDialogProps): React$1.JSX.Element;
181
182
 
182
183
  interface NoResultProps {
183
184
  title?: string;
@@ -188,14 +189,14 @@ declare function NoResult({ title, description, sx, }: NoResultProps): React__de
188
189
 
189
190
  interface PaginationListProps {
190
191
  currentPage: number;
191
- setCurrentPage: React.Dispatch<React.SetStateAction<number>>;
192
+ setCurrentPage: React$1.Dispatch<React$1.SetStateAction<number>>;
192
193
  totalPages: number;
193
194
  }
194
- declare function PaginationList({ currentPage, setCurrentPage, totalPages, }: PaginationListProps): React.JSX.Element;
195
+ declare function PaginationList({ currentPage, setCurrentPage, totalPages, }: PaginationListProps): React$1.JSX.Element;
195
196
 
196
197
  declare function RadioButton({ name, label, options, control, align, disabledBoarder, direction, }: {
197
198
  name: string;
198
- label: string | React.ReactNode;
199
+ label: string | React$1.ReactNode;
199
200
  control: Control<any>;
200
201
  options: {
201
202
  value: any;
@@ -205,7 +206,7 @@ declare function RadioButton({ name, label, options, control, align, disabledBoa
205
206
  align?: "start" | "center" | "end";
206
207
  disabledBoarder?: boolean;
207
208
  direction?: "row" | "column";
208
- }): React.JSX.Element;
209
+ }): React$1.JSX.Element;
209
210
 
210
211
  declare const NestedSelect: React__default.FC;
211
212
 
@@ -218,7 +219,7 @@ interface HorizontalStepperProps {
218
219
  currentStep: number;
219
220
  setCurrentStep: (newStep: number) => void;
220
221
  }
221
- declare function HorizontalStepper({ steps, currentStep, setCurrentStep, }: HorizontalStepperProps): React.JSX.Element;
222
+ declare function HorizontalStepper({ steps, currentStep, setCurrentStep, }: HorizontalStepperProps): React$1.JSX.Element;
222
223
 
223
224
  interface StateType {
224
225
  page: number;
@@ -346,7 +347,7 @@ declare function Page({ data, }: {
346
347
  title: string;
347
348
  body: ReactNode;
348
349
  }];
349
- }): React.JSX.Element;
350
+ }): React$1.JSX.Element;
350
351
 
351
352
  type SwitchButtonProps = {
352
353
  checked: boolean;
@@ -369,6 +370,41 @@ interface DraggablePaperProps extends PaperProps {
369
370
  handle?: string;
370
371
  cancel?: string;
371
372
  }
372
- declare function DraggablePaper({ handle, cancel, ...props }: DraggablePaperProps): React.JSX.Element;
373
+ declare function DraggablePaper({ handle, cancel, ...props }: DraggablePaperProps): React$1.JSX.Element;
373
374
 
374
- export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomTimePicker, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
375
+ type DataTableProps<T extends Record<string, any>> = {
376
+ data: T[];
377
+ columns: MRT_ColumnDef<T>[];
378
+ isLoading?: boolean;
379
+ isRefetching?: boolean;
380
+ pagination: MRT_PaginationState;
381
+ onPaginationChange: (updater: MRT_PaginationState | ((old: MRT_PaginationState) => MRT_PaginationState)) => void;
382
+ totalRows: number;
383
+ manualPagination?: boolean;
384
+ columnFilters?: MRT_ColumnFiltersState;
385
+ onColumnFiltersChange?: (filters: MRT_ColumnFiltersState | ((old: MRT_ColumnFiltersState) => MRT_ColumnFiltersState)) => void;
386
+ manualFiltering?: boolean;
387
+ onClearFilters?: () => void;
388
+ showClearFiltersButton?: boolean;
389
+ sorting?: MRT_SortingState;
390
+ onSortingChange?: (sorting: MRT_SortingState | ((old: MRT_SortingState) => MRT_SortingState)) => void;
391
+ manualSorting?: boolean;
392
+ enableStickyHeader?: boolean;
393
+ maxHeight?: string;
394
+ density?: "comfortable" | "compact" | "spacious";
395
+ enableColumnOrdering?: boolean;
396
+ enableGlobalFilter?: boolean;
397
+ enableColumnFilterModes?: boolean;
398
+ enableRowSelection?: boolean;
399
+ renderTopToolbarCustomActions?: (props: {
400
+ table: any;
401
+ }) => React.ReactNode;
402
+ renderBottomToolbarCustomActions?: (props: {
403
+ table: any;
404
+ }) => React.ReactNode;
405
+ tableOptions?: Partial<MRT_TableOptions<T>>;
406
+ localization?: Record<string, string>;
407
+ };
408
+ declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, }: DataTableProps<T>) => React$1.JSX.Element;
409
+
410
+ export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import * as React from 'react';
1
+ import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, CSSProperties, Dispatch, SetStateAction } from 'react';
3
3
  import { Control, FieldValues, Path, FieldErrors, UseFormSetValue } from 'react-hook-form';
4
4
  import { Moment } from 'moment-jalaali';
5
5
  import { SxProps, Theme, PaperProps } from '@mui/material';
6
6
  import { GridColDef, GridRowSelectionModel, GridRowParams } from '@mui/x-data-grid';
7
7
  import { TextFieldProps } from '@mui/material/TextField';
8
+ import { MRT_ColumnDef, MRT_PaginationState, MRT_ColumnFiltersState, MRT_SortingState, MRT_TableOptions } from 'material-react-table';
8
9
 
9
10
  interface MultipleSelectChipProps {
10
11
  name: string;
@@ -19,7 +20,7 @@ interface MultipleSelectChipProps {
19
20
  variant?: "outlined" | "filled" | "standard";
20
21
  placeholder?: string;
21
22
  }
22
- declare function MultipleSelectChip({ name, control, label, data, multipleitems, isLoading, disabled, size, clear, variant, placeholder, }: MultipleSelectChipProps): React.JSX.Element;
23
+ declare function MultipleSelectChip({ name, control, label, data, multipleitems, isLoading, disabled, size, clear, variant, placeholder, }: MultipleSelectChipProps): React$1.JSX.Element;
23
24
 
24
25
  interface AdvancedSearchButtonProps {
25
26
  isShowFilter: boolean;
@@ -54,12 +55,12 @@ interface ConfirmationDialogProps$1 {
54
55
  iconColor: string;
55
56
  color: "error" | "info" | "primary" | "success" | "warning" | "secondary";
56
57
  actionTitle: string;
57
- icon?: React.ReactElement<{
58
+ icon?: React$1.ReactElement<{
58
59
  color?: string;
59
60
  size?: number;
60
61
  }>;
61
62
  }
62
- declare function ConfirmationDialog$1({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, maxWidth, iconColor, color, actionTitle, icon, }: ConfirmationDialogProps$1): React.JSX.Element;
63
+ declare function ConfirmationDialog$1({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, maxWidth, iconColor, color, actionTitle, icon, }: ConfirmationDialogProps$1): React$1.JSX.Element;
63
64
 
64
65
  interface CustomTimePickerProps {
65
66
  name: string;
@@ -70,12 +71,12 @@ interface CustomTimePickerProps {
70
71
  autoRefresh?: boolean;
71
72
  disabled?: boolean;
72
73
  }
73
- declare function CustomTimePicker({ name, control, label, size, fullwidth, autoRefresh, disabled, }: CustomTimePickerProps): React.JSX.Element;
74
+ declare function CustomTimePicker({ name, control, label, size, fullwidth, autoRefresh, disabled, }: CustomTimePickerProps): React$1.JSX.Element;
74
75
 
75
76
  declare function DateFilterRange({ FromDate, ToDate }: {
76
77
  FromDate: any;
77
78
  ToDate: any;
78
- }): React.JSX.Element;
79
+ }): React$1.JSX.Element;
79
80
 
80
81
  declare function DateFilter({ setHandler }: {
81
82
  setHandler?: any;
@@ -144,7 +145,7 @@ interface LicensePlateProps$1 {
144
145
  readOnly?: boolean;
145
146
  size?: "small" | "medium";
146
147
  }
147
- declare function LicensePlate({ width, name, setValue, data, readOnly, size, }: LicensePlateProps$1): React.JSX.Element;
148
+ declare function LicensePlate({ width, name, setValue, data, readOnly, size, }: LicensePlateProps$1): React$1.JSX.Element;
148
149
 
149
150
  interface LicensePlateProps {
150
151
  width?: CSSProperties["width"];
@@ -177,7 +178,7 @@ interface ConfirmationDialogProps {
177
178
  bodyText: ReactNode;
178
179
  isLoading?: boolean;
179
180
  }
180
- declare function ConfirmationDialog({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, }: ConfirmationDialogProps): React.JSX.Element;
181
+ declare function ConfirmationDialog({ open, handleClose, callback, callbackParams, headerText, bodyText, isLoading, }: ConfirmationDialogProps): React$1.JSX.Element;
181
182
 
182
183
  interface NoResultProps {
183
184
  title?: string;
@@ -188,14 +189,14 @@ declare function NoResult({ title, description, sx, }: NoResultProps): React__de
188
189
 
189
190
  interface PaginationListProps {
190
191
  currentPage: number;
191
- setCurrentPage: React.Dispatch<React.SetStateAction<number>>;
192
+ setCurrentPage: React$1.Dispatch<React$1.SetStateAction<number>>;
192
193
  totalPages: number;
193
194
  }
194
- declare function PaginationList({ currentPage, setCurrentPage, totalPages, }: PaginationListProps): React.JSX.Element;
195
+ declare function PaginationList({ currentPage, setCurrentPage, totalPages, }: PaginationListProps): React$1.JSX.Element;
195
196
 
196
197
  declare function RadioButton({ name, label, options, control, align, disabledBoarder, direction, }: {
197
198
  name: string;
198
- label: string | React.ReactNode;
199
+ label: string | React$1.ReactNode;
199
200
  control: Control<any>;
200
201
  options: {
201
202
  value: any;
@@ -205,7 +206,7 @@ declare function RadioButton({ name, label, options, control, align, disabledBoa
205
206
  align?: "start" | "center" | "end";
206
207
  disabledBoarder?: boolean;
207
208
  direction?: "row" | "column";
208
- }): React.JSX.Element;
209
+ }): React$1.JSX.Element;
209
210
 
210
211
  declare const NestedSelect: React__default.FC;
211
212
 
@@ -218,7 +219,7 @@ interface HorizontalStepperProps {
218
219
  currentStep: number;
219
220
  setCurrentStep: (newStep: number) => void;
220
221
  }
221
- declare function HorizontalStepper({ steps, currentStep, setCurrentStep, }: HorizontalStepperProps): React.JSX.Element;
222
+ declare function HorizontalStepper({ steps, currentStep, setCurrentStep, }: HorizontalStepperProps): React$1.JSX.Element;
222
223
 
223
224
  interface StateType {
224
225
  page: number;
@@ -346,7 +347,7 @@ declare function Page({ data, }: {
346
347
  title: string;
347
348
  body: ReactNode;
348
349
  }];
349
- }): React.JSX.Element;
350
+ }): React$1.JSX.Element;
350
351
 
351
352
  type SwitchButtonProps = {
352
353
  checked: boolean;
@@ -369,6 +370,41 @@ interface DraggablePaperProps extends PaperProps {
369
370
  handle?: string;
370
371
  cancel?: string;
371
372
  }
372
- declare function DraggablePaper({ handle, cancel, ...props }: DraggablePaperProps): React.JSX.Element;
373
+ declare function DraggablePaper({ handle, cancel, ...props }: DraggablePaperProps): React$1.JSX.Element;
373
374
 
374
- export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomTimePicker, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
375
+ type DataTableProps<T extends Record<string, any>> = {
376
+ data: T[];
377
+ columns: MRT_ColumnDef<T>[];
378
+ isLoading?: boolean;
379
+ isRefetching?: boolean;
380
+ pagination: MRT_PaginationState;
381
+ onPaginationChange: (updater: MRT_PaginationState | ((old: MRT_PaginationState) => MRT_PaginationState)) => void;
382
+ totalRows: number;
383
+ manualPagination?: boolean;
384
+ columnFilters?: MRT_ColumnFiltersState;
385
+ onColumnFiltersChange?: (filters: MRT_ColumnFiltersState | ((old: MRT_ColumnFiltersState) => MRT_ColumnFiltersState)) => void;
386
+ manualFiltering?: boolean;
387
+ onClearFilters?: () => void;
388
+ showClearFiltersButton?: boolean;
389
+ sorting?: MRT_SortingState;
390
+ onSortingChange?: (sorting: MRT_SortingState | ((old: MRT_SortingState) => MRT_SortingState)) => void;
391
+ manualSorting?: boolean;
392
+ enableStickyHeader?: boolean;
393
+ maxHeight?: string;
394
+ density?: "comfortable" | "compact" | "spacious";
395
+ enableColumnOrdering?: boolean;
396
+ enableGlobalFilter?: boolean;
397
+ enableColumnFilterModes?: boolean;
398
+ enableRowSelection?: boolean;
399
+ renderTopToolbarCustomActions?: (props: {
400
+ table: any;
401
+ }) => React.ReactNode;
402
+ renderBottomToolbarCustomActions?: (props: {
403
+ table: any;
404
+ }) => React.ReactNode;
405
+ tableOptions?: Partial<MRT_TableOptions<T>>;
406
+ localization?: Record<string, string>;
407
+ };
408
+ declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, }: DataTableProps<T>) => React$1.JSX.Element;
409
+
410
+ export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ __export(src_exports, {
36
36
  ConnectToBasculeButton: () => bascule_connection_button_default,
37
37
  CustomCheckbox: () => CustomCheckbox,
38
38
  CustomTimePicker: () => CustomTimePicker,
39
+ DataTable: () => data_table_default,
39
40
  DateFilter: () => DateFilter,
40
41
  DateFilterRange: () => DateFilterRange,
41
42
  DateMonthPicker: () => date_month_default,
@@ -4786,6 +4787,127 @@ function DraggablePaper({
4786
4787
  /* @__PURE__ */ React.createElement(import_material29.Paper, { ref: nodeRef, ...props })
4787
4788
  );
4788
4789
  }
4790
+
4791
+ // src/data-table/index.tsx
4792
+ var import_Clear = __toESM(require("@mui/icons-material/Clear"));
4793
+ var import_material30 = require("@mui/material");
4794
+ var import_material_react_table = require("material-react-table");
4795
+ var import_fa6 = require("material-react-table/locales/fa");
4796
+ var import_react32 = require("react");
4797
+ var customLocalization = {
4798
+ ...import_fa6.MRT_Localization_FA,
4799
+ mrt_columns_showHide_resetOrder: "\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC \u062A\u0631\u062A\u06CC\u0628"
4800
+ };
4801
+ var DataTable = ({
4802
+ data,
4803
+ columns,
4804
+ isLoading = false,
4805
+ isRefetching = false,
4806
+ pagination,
4807
+ onPaginationChange,
4808
+ totalRows,
4809
+ manualPagination = true,
4810
+ columnFilters = [],
4811
+ onColumnFiltersChange,
4812
+ manualFiltering = true,
4813
+ onClearFilters,
4814
+ showClearFiltersButton = true,
4815
+ sorting = [],
4816
+ onSortingChange,
4817
+ manualSorting = false,
4818
+ enableStickyHeader = true,
4819
+ maxHeight = "calc(100vh - 200px)",
4820
+ density = "compact",
4821
+ enableColumnOrdering = true,
4822
+ enableGlobalFilter = false,
4823
+ enableColumnFilterModes = false,
4824
+ enableRowSelection = false,
4825
+ renderTopToolbarCustomActions,
4826
+ renderBottomToolbarCustomActions,
4827
+ tableOptions = {},
4828
+ localization = customLocalization
4829
+ }) => {
4830
+ const memoizedColumns = (0, import_react32.useMemo)(() => columns, [columns]);
4831
+ const memoizedData = (0, import_react32.useMemo)(() => data, [data]);
4832
+ const defaultRenderTopToolbarCustomActions = ({ table: table2 }) => {
4833
+ const showFilters = table2.getState().showColumnFilters;
4834
+ if (!showFilters || !showClearFiltersButton || !onClearFilters) return null;
4835
+ return /* @__PURE__ */ React.createElement(import_material30.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React.createElement(
4836
+ import_material30.Box,
4837
+ {
4838
+ display: "flex",
4839
+ alignItems: "center",
4840
+ justifyContent: "flex-start"
4841
+ },
4842
+ /* @__PURE__ */ React.createElement(
4843
+ import_material30.Button,
4844
+ {
4845
+ color: "secondary",
4846
+ onClick: onClearFilters,
4847
+ startIcon: /* @__PURE__ */ React.createElement(import_Clear.default, null)
4848
+ },
4849
+ "\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC \u0641\u06CC\u0644\u062A\u0631\u0647\u0627"
4850
+ )
4851
+ ));
4852
+ };
4853
+ const table = (0, import_material_react_table.useMaterialReactTable)({
4854
+ columns: memoizedColumns,
4855
+ data: memoizedData,
4856
+ localization,
4857
+ // Pagination
4858
+ manualPagination,
4859
+ onPaginationChange,
4860
+ pageCount: manualPagination ? Math.ceil(totalRows / pagination.pageSize) : void 0,
4861
+ rowCount: totalRows ?? 0,
4862
+ // Filtering
4863
+ manualFiltering,
4864
+ onColumnFiltersChange,
4865
+ enableColumnFilterModes,
4866
+ enableGlobalFilter,
4867
+ // Sorting
4868
+ manualSorting,
4869
+ onSortingChange,
4870
+ // Features
4871
+ enableColumnOrdering,
4872
+ enableRowSelection,
4873
+ enableStickyHeader,
4874
+ // State
4875
+ state: {
4876
+ pagination,
4877
+ columnFilters,
4878
+ sorting,
4879
+ isLoading,
4880
+ showProgressBars: isRefetching
4881
+ },
4882
+ // Styling
4883
+ muiTablePaperProps: { sx: { direction: "ltr" } },
4884
+ muiTableBodyCellProps: { sx: { textAlign: "center" } },
4885
+ muiTableHeadCellProps: {
4886
+ sx: {
4887
+ "& .Mui-TableHeadCell-Content": {
4888
+ flexDirection: "row-reverse",
4889
+ justifyContent: "center"
4890
+ }
4891
+ }
4892
+ },
4893
+ muiTableContainerProps: {
4894
+ sx: {
4895
+ maxHeight
4896
+ }
4897
+ },
4898
+ // Initial state
4899
+ initialState: {
4900
+ density
4901
+ },
4902
+ // Custom toolbars
4903
+ renderTopToolbarCustomActions: renderTopToolbarCustomActions || defaultRenderTopToolbarCustomActions,
4904
+ renderBottomToolbarCustomActions,
4905
+ // Override with any additional options
4906
+ ...tableOptions
4907
+ });
4908
+ return /* @__PURE__ */ React.createElement(import_material_react_table.MaterialReactTable, { table });
4909
+ };
4910
+ var data_table_default = DataTable;
4789
4911
  // Annotate the CommonJS export names for ESM import in node:
4790
4912
  0 && (module.exports = {
4791
4913
  Accordion,
@@ -4794,6 +4916,7 @@ function DraggablePaper({
4794
4916
  ConnectToBasculeButton,
4795
4917
  CustomCheckbox,
4796
4918
  CustomTimePicker,
4919
+ DataTable,
4797
4920
  DateFilter,
4798
4921
  DateFilterRange,
4799
4922
  DateMonthPicker,