@mamrp/components 1.7.5 → 1.7.7

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
@@ -2,11 +2,12 @@ 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
- import { SxProps, Theme, PaperProps } from '@mui/material';
5
+ import { SxProps, Theme, PaperProps, DialogProps } from '@mui/material';
6
6
  import { GridColDef, GridRowSelectionModel, GridRowParams } from '@mui/x-data-grid';
7
7
  import { TextFieldProps } from '@mui/material/TextField';
8
8
  import { MRT_ColumnDef, MRT_PaginationState, MRT_ColumnFiltersState, MRT_SortingState, MRT_TableOptions } from 'material-react-table';
9
9
  export { MRT_ColumnDef } from 'material-react-table';
10
+ import { IconType } from 'react-icons';
10
11
 
11
12
  interface MultipleSelectChipProps {
12
13
  name: string;
@@ -253,8 +254,9 @@ type TapleProps = {
253
254
  selectedRows?: GridRowSelectionModel;
254
255
  setSelectedRows?: Dispatch<SetStateAction<GridRowSelectionModel>>;
255
256
  isRowSelectable?: (params: GridRowParams) => boolean;
257
+ disablePageSizeChange?: boolean;
256
258
  };
257
- 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;
259
+ declare const Table: ({ pagingmode, totalRows, rows, columns, paginationModel, setPaginationModel, loading, rowId, _tools, _CustomFooter, rowInPage, highlightedRowId, evenRowBgColor, sortFieldMapping, setsortQuery, sortQuery, fontSize, checkboxSelection, selectedRows, setSelectedRows, isRowSelectable, disablePageSizeChange, ...rest }: TapleProps) => React__default.JSX.Element;
258
260
 
259
261
  type FormInputNumberProps<T extends FieldValues> = {
260
262
  control: Control<T>;
@@ -608,4 +610,17 @@ type DataTableProps<T extends Record<string, any>> = {
608
610
  */
609
611
  declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, showColumnFilters, onShowColumnFiltersChange, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, enableColumnVirtualization, columnVirtualizerOptions, enableColumnResizing, }: DataTableProps<T>) => React$1.JSX.Element;
610
612
 
611
- 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 };
613
+ type PaletteColor = "primary" | "secondary" | "error" | "warning" | "info" | "success" | "tertiary" | "accent" | "successLight" | "orange" | "indigo" | "teal" | "pinkLight" | "aqua" | "customRed";
614
+ interface CustomDialogProps {
615
+ title: string;
616
+ icon?: IconType;
617
+ iconColor?: PaletteColor | string;
618
+ open: boolean;
619
+ onClose: () => void;
620
+ maxWidth?: DialogProps["maxWidth"];
621
+ fullWidth?: boolean;
622
+ children: ReactNode;
623
+ }
624
+ declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, children, }: CustomDialogProps): React$1.JSX.Element;
625
+
626
+ export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, 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
@@ -2,11 +2,12 @@ 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
- import { SxProps, Theme, PaperProps } from '@mui/material';
5
+ import { SxProps, Theme, PaperProps, DialogProps } from '@mui/material';
6
6
  import { GridColDef, GridRowSelectionModel, GridRowParams } from '@mui/x-data-grid';
7
7
  import { TextFieldProps } from '@mui/material/TextField';
8
8
  import { MRT_ColumnDef, MRT_PaginationState, MRT_ColumnFiltersState, MRT_SortingState, MRT_TableOptions } from 'material-react-table';
9
9
  export { MRT_ColumnDef } from 'material-react-table';
10
+ import { IconType } from 'react-icons';
10
11
 
11
12
  interface MultipleSelectChipProps {
12
13
  name: string;
@@ -253,8 +254,9 @@ type TapleProps = {
253
254
  selectedRows?: GridRowSelectionModel;
254
255
  setSelectedRows?: Dispatch<SetStateAction<GridRowSelectionModel>>;
255
256
  isRowSelectable?: (params: GridRowParams) => boolean;
257
+ disablePageSizeChange?: boolean;
256
258
  };
257
- 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;
259
+ declare const Table: ({ pagingmode, totalRows, rows, columns, paginationModel, setPaginationModel, loading, rowId, _tools, _CustomFooter, rowInPage, highlightedRowId, evenRowBgColor, sortFieldMapping, setsortQuery, sortQuery, fontSize, checkboxSelection, selectedRows, setSelectedRows, isRowSelectable, disablePageSizeChange, ...rest }: TapleProps) => React__default.JSX.Element;
258
260
 
259
261
  type FormInputNumberProps<T extends FieldValues> = {
260
262
  control: Control<T>;
@@ -608,4 +610,17 @@ type DataTableProps<T extends Record<string, any>> = {
608
610
  */
609
611
  declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, showColumnFilters, onShowColumnFiltersChange, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, enableColumnVirtualization, columnVirtualizerOptions, enableColumnResizing, }: DataTableProps<T>) => React$1.JSX.Element;
610
612
 
611
- 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 };
613
+ type PaletteColor = "primary" | "secondary" | "error" | "warning" | "info" | "success" | "tertiary" | "accent" | "successLight" | "orange" | "indigo" | "teal" | "pinkLight" | "aqua" | "customRed";
614
+ interface CustomDialogProps {
615
+ title: string;
616
+ icon?: IconType;
617
+ iconColor?: PaletteColor | string;
618
+ open: boolean;
619
+ onClose: () => void;
620
+ maxWidth?: DialogProps["maxWidth"];
621
+ fullWidth?: boolean;
622
+ children: ReactNode;
623
+ }
624
+ declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, children, }: CustomDialogProps): React$1.JSX.Element;
625
+
626
+ export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, 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
@@ -35,6 +35,7 @@ __export(src_exports, {
35
35
  ConfirmationDialog: () => ConfirmationDialog,
36
36
  ConnectToBasculeButton: () => bascule_connection_button_default,
37
37
  CustomCheckbox: () => CustomCheckbox,
38
+ CustomDialog: () => CustomDialog,
38
39
  CustomTimePicker: () => CustomTimePicker,
39
40
  DataTable: () => data_table_default,
40
41
  DateFilter: () => DateFilter,
@@ -3619,6 +3620,7 @@ var Table = ({
3619
3620
  selectedRows,
3620
3621
  setSelectedRows,
3621
3622
  isRowSelectable,
3623
+ disablePageSizeChange = false,
3622
3624
  ...rest
3623
3625
  }) => {
3624
3626
  const [sortModel, setSortModel] = import_react19.default.useState([]);
@@ -3736,7 +3738,7 @@ var Table = ({
3736
3738
  autoHeight: true,
3737
3739
  ...shouldShowPagination && { rowCount: totalRows },
3738
3740
  ...shouldShowPagination && {
3739
- pageSizeOptions: [5, 10, 25, 50, 75, 100]
3741
+ pageSizeOptions: disablePageSizeChange ? [paginationModel?.pageSize || 5] : [5, 10, 25, 50, 75, 100]
3740
3742
  },
3741
3743
  ...shouldShowPagination && {
3742
3744
  slotProps: {
@@ -3748,6 +3750,7 @@ var Table = ({
3748
3750
  disableColumnMenu: true,
3749
3751
  disableColumnFilter: true,
3750
3752
  loading,
3753
+ ...disablePageSizeChange && { hideFooterRowsPerPage: true },
3751
3754
  localeText: {
3752
3755
  noRowsLabel: "\u0647\u06CC\u0686 \u062F\u0627\u062F\u0647\u200C\u0627\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F!",
3753
3756
  noResultsOverlayLabel: "\u0647\u06CC\u0686 \u062F\u0627\u062F\u0647\u200C\u0627\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F!",
@@ -5218,6 +5221,94 @@ var DataTable = ({
5218
5221
  return /* @__PURE__ */ React.createElement(import_material_react_table.MaterialReactTable, { table });
5219
5222
  };
5220
5223
  var data_table_default = DataTable;
5224
+
5225
+ // src/custom-dialog/index.tsx
5226
+ var import_material31 = require("@mui/material");
5227
+ var import_md9 = require("react-icons/md");
5228
+ function CustomDialog({
5229
+ title,
5230
+ icon: Icon,
5231
+ iconColor,
5232
+ open,
5233
+ onClose,
5234
+ maxWidth = "sm",
5235
+ fullWidth = true,
5236
+ children
5237
+ }) {
5238
+ return /* @__PURE__ */ React.createElement(
5239
+ import_material31.Dialog,
5240
+ {
5241
+ open,
5242
+ onClose,
5243
+ maxWidth,
5244
+ fullWidth,
5245
+ PaperComponent: DraggablePaper,
5246
+ disableScrollLock: true
5247
+ },
5248
+ /* @__PURE__ */ React.createElement(
5249
+ import_material31.DialogTitle,
5250
+ {
5251
+ fontWeight: 700,
5252
+ fontSize: "1.2rem",
5253
+ display: "flex",
5254
+ alignItems: "center",
5255
+ gap: "4px",
5256
+ sx: { cursor: "move" },
5257
+ id: "draggable-dialog"
5258
+ },
5259
+ /* @__PURE__ */ React.createElement(import_material31.Stack, { direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React.createElement(import_material31.Box, null, Icon && /* @__PURE__ */ React.createElement(
5260
+ import_material31.Stack,
5261
+ {
5262
+ alignItems: "center",
5263
+ sx: {
5264
+ color: iconColor ? (theme3) => {
5265
+ const paletteColors = [
5266
+ "primary",
5267
+ "secondary",
5268
+ "error",
5269
+ "warning",
5270
+ "info",
5271
+ "success",
5272
+ "tertiary",
5273
+ "accent",
5274
+ "successLight",
5275
+ "orange",
5276
+ "indigo",
5277
+ "teal",
5278
+ "pinkLight",
5279
+ "aqua",
5280
+ "customRed"
5281
+ ];
5282
+ if (paletteColors.includes(iconColor)) {
5283
+ const palette = theme3.palette;
5284
+ return palette[iconColor]?.main || iconColor;
5285
+ }
5286
+ return iconColor;
5287
+ } : (theme3) => theme3.palette.info.main,
5288
+ pr: 0.5
5289
+ }
5290
+ },
5291
+ /* @__PURE__ */ React.createElement(Icon, { size: 20 })
5292
+ )), /* @__PURE__ */ React.createElement(import_material31.Box, null, title))
5293
+ ),
5294
+ /* @__PURE__ */ React.createElement(import_material31.Tooltip, { title: "\u0628\u0633\u062A\u0646" }, /* @__PURE__ */ React.createElement(
5295
+ import_material31.IconButton,
5296
+ {
5297
+ "aria-label": "close",
5298
+ onClick: onClose,
5299
+ sx: {
5300
+ position: "absolute",
5301
+ right: 8,
5302
+ top: 8,
5303
+ color: (theme3) => theme3.palette.grey[500]
5304
+ }
5305
+ },
5306
+ /* @__PURE__ */ React.createElement(import_md9.MdClose, null)
5307
+ )),
5308
+ /* @__PURE__ */ React.createElement(import_material31.Divider, null),
5309
+ /* @__PURE__ */ React.createElement(import_material31.DialogContent, null, children)
5310
+ );
5311
+ }
5221
5312
  // Annotate the CommonJS export names for ESM import in node:
5222
5313
  0 && (module.exports = {
5223
5314
  Accordion,
@@ -5225,6 +5316,7 @@ var data_table_default = DataTable;
5225
5316
  ConfirmationDialog,
5226
5317
  ConnectToBasculeButton,
5227
5318
  CustomCheckbox,
5319
+ CustomDialog,
5228
5320
  CustomTimePicker,
5229
5321
  DataTable,
5230
5322
  DateFilter,