@mamrp/components 1.7.6 → 1.7.8
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 +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +92 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -609,4 +610,18 @@ type DataTableProps<T extends Record<string, any>> = {
|
|
|
609
610
|
*/
|
|
610
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;
|
|
611
612
|
|
|
612
|
-
|
|
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;
|
|
618
|
+
open: boolean;
|
|
619
|
+
onClose: () => void;
|
|
620
|
+
maxWidth?: DialogProps["maxWidth"];
|
|
621
|
+
fullWidth?: boolean;
|
|
622
|
+
children: ReactNode;
|
|
623
|
+
actions?: ReactNode;
|
|
624
|
+
}
|
|
625
|
+
declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, children, actions, }: CustomDialogProps): React$1.JSX.Element;
|
|
626
|
+
|
|
627
|
+
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, type CustomDialogProps, 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, type PaletteColor, 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;
|
|
@@ -609,4 +610,18 @@ type DataTableProps<T extends Record<string, any>> = {
|
|
|
609
610
|
*/
|
|
610
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;
|
|
611
612
|
|
|
612
|
-
|
|
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;
|
|
618
|
+
open: boolean;
|
|
619
|
+
onClose: () => void;
|
|
620
|
+
maxWidth?: DialogProps["maxWidth"];
|
|
621
|
+
fullWidth?: boolean;
|
|
622
|
+
children: ReactNode;
|
|
623
|
+
actions?: ReactNode;
|
|
624
|
+
}
|
|
625
|
+
declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, children, actions, }: CustomDialogProps): React$1.JSX.Element;
|
|
626
|
+
|
|
627
|
+
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, type CustomDialogProps, 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, type PaletteColor, 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,
|
|
@@ -5220,6 +5221,96 @@ var DataTable = ({
|
|
|
5220
5221
|
return /* @__PURE__ */ React.createElement(import_material_react_table.MaterialReactTable, { table });
|
|
5221
5222
|
};
|
|
5222
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
|
+
actions
|
|
5238
|
+
}) {
|
|
5239
|
+
return /* @__PURE__ */ React.createElement(
|
|
5240
|
+
import_material31.Dialog,
|
|
5241
|
+
{
|
|
5242
|
+
open,
|
|
5243
|
+
onClose,
|
|
5244
|
+
maxWidth,
|
|
5245
|
+
fullWidth,
|
|
5246
|
+
PaperComponent: DraggablePaper,
|
|
5247
|
+
disableScrollLock: true
|
|
5248
|
+
},
|
|
5249
|
+
/* @__PURE__ */ React.createElement(
|
|
5250
|
+
import_material31.DialogTitle,
|
|
5251
|
+
{
|
|
5252
|
+
fontWeight: 700,
|
|
5253
|
+
fontSize: "1.2rem",
|
|
5254
|
+
display: "flex",
|
|
5255
|
+
alignItems: "center",
|
|
5256
|
+
gap: "4px",
|
|
5257
|
+
sx: { cursor: "move" },
|
|
5258
|
+
id: "draggable-dialog"
|
|
5259
|
+
},
|
|
5260
|
+
/* @__PURE__ */ React.createElement(import_material31.Stack, { direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React.createElement(import_material31.Box, null, Icon && /* @__PURE__ */ React.createElement(
|
|
5261
|
+
import_material31.Stack,
|
|
5262
|
+
{
|
|
5263
|
+
alignItems: "center",
|
|
5264
|
+
sx: {
|
|
5265
|
+
color: iconColor ? (theme3) => {
|
|
5266
|
+
const paletteColors = [
|
|
5267
|
+
"primary",
|
|
5268
|
+
"secondary",
|
|
5269
|
+
"error",
|
|
5270
|
+
"warning",
|
|
5271
|
+
"info",
|
|
5272
|
+
"success",
|
|
5273
|
+
"tertiary",
|
|
5274
|
+
"accent",
|
|
5275
|
+
"successLight",
|
|
5276
|
+
"orange",
|
|
5277
|
+
"indigo",
|
|
5278
|
+
"teal",
|
|
5279
|
+
"pinkLight",
|
|
5280
|
+
"aqua",
|
|
5281
|
+
"customRed"
|
|
5282
|
+
];
|
|
5283
|
+
if (paletteColors.includes(iconColor)) {
|
|
5284
|
+
const palette = theme3.palette;
|
|
5285
|
+
return palette[iconColor]?.main || iconColor;
|
|
5286
|
+
}
|
|
5287
|
+
return iconColor;
|
|
5288
|
+
} : (theme3) => theme3.palette.info.main,
|
|
5289
|
+
pr: 0.5
|
|
5290
|
+
}
|
|
5291
|
+
},
|
|
5292
|
+
/* @__PURE__ */ React.createElement(Icon, { size: 20 })
|
|
5293
|
+
)), /* @__PURE__ */ React.createElement(import_material31.Box, null, title))
|
|
5294
|
+
),
|
|
5295
|
+
/* @__PURE__ */ React.createElement(import_material31.Tooltip, { title: "\u0628\u0633\u062A\u0646" }, /* @__PURE__ */ React.createElement(
|
|
5296
|
+
import_material31.IconButton,
|
|
5297
|
+
{
|
|
5298
|
+
"aria-label": "close",
|
|
5299
|
+
onClick: onClose,
|
|
5300
|
+
sx: {
|
|
5301
|
+
position: "absolute",
|
|
5302
|
+
right: 8,
|
|
5303
|
+
top: 8,
|
|
5304
|
+
color: (theme3) => theme3.palette.grey[500]
|
|
5305
|
+
}
|
|
5306
|
+
},
|
|
5307
|
+
/* @__PURE__ */ React.createElement(import_md9.MdClose, null)
|
|
5308
|
+
)),
|
|
5309
|
+
/* @__PURE__ */ React.createElement(import_material31.Divider, null),
|
|
5310
|
+
/* @__PURE__ */ React.createElement(import_material31.DialogContent, null, children),
|
|
5311
|
+
actions && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_material31.DialogActions, null, actions))
|
|
5312
|
+
);
|
|
5313
|
+
}
|
|
5223
5314
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5224
5315
|
0 && (module.exports = {
|
|
5225
5316
|
Accordion,
|
|
@@ -5227,6 +5318,7 @@ var data_table_default = DataTable;
|
|
|
5227
5318
|
ConfirmationDialog,
|
|
5228
5319
|
ConnectToBasculeButton,
|
|
5229
5320
|
CustomCheckbox,
|
|
5321
|
+
CustomDialog,
|
|
5230
5322
|
CustomTimePicker,
|
|
5231
5323
|
DataTable,
|
|
5232
5324
|
DateFilter,
|