next-recomponents 2.0.40 → 2.0.42

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,82 @@
1
+ import { GridValidRowModel } from "@mui/x-data-grid";
2
+
3
+ export interface SortType {
4
+ field: string;
5
+ type: "ASC" | "DESC" | "TOGGLE";
6
+ }
7
+
8
+ export interface FiltersType {
9
+ field: string;
10
+ values: any[];
11
+ }
12
+
13
+ type FooterAggregation = "sum" | "avg" | "count";
14
+
15
+ interface FooterType {
16
+ [key: string]: FooterAggregation;
17
+ }
18
+
19
+ type GridDensity = "compact" | "standard" | "comfortable";
20
+ export interface TableButtonProps extends React.MouseEvent<
21
+ HTMLButtonElement,
22
+ MouseEvent
23
+ > {
24
+ row: Record<string, any>;
25
+ }
26
+ export interface TableProps {
27
+ data: any;
28
+ searchable?: boolean;
29
+ editableFields?: string[];
30
+ onSelect?: (data: GridValidRowModel[]) => void;
31
+ onSelectLabel?: string;
32
+ onSave?: (data: GridValidRowModel[]) => void;
33
+ onSaveLabel?: string;
34
+ buttons?: Record<string, any>;
35
+ exportName?: string;
36
+ modal?: React.ReactNode;
37
+ modalButton?: React.ReactNode;
38
+ height?: number;
39
+ width?: number | string;
40
+ header?: React.ReactNode;
41
+ hideColumns?: string[];
42
+ footer?: FooterType;
43
+ symbols?: any;
44
+ currentCoin?: string;
45
+ className?: string;
46
+ fontSize?: string;
47
+ colSize?: Record<string, number>;
48
+ rowHeight?: number;
49
+ wrapText?: boolean;
50
+ density?: GridDensity;
51
+ autoHeight?: boolean;
52
+ flex?: number;
53
+ sortBy?: Record<string, "DESC" | "ASC">;
54
+ onCloseModal?: (data: GridValidRowModel) => Promise<boolean>;
55
+ [key: string]: any;
56
+ }
57
+
58
+ // ─── Height mapping ───────────────────────────────────────────────────────────
59
+
60
+ export const HEIGHT_MAP: Record<number, number> = {
61
+ 1: 110,
62
+ 2: 165,
63
+ 3: 215,
64
+ 4: 265,
65
+ 5: 320,
66
+ 6: 370,
67
+ 7: 425,
68
+ 8: 475,
69
+ 9: 525,
70
+ 10: 585,
71
+ };
72
+ const regularExpresions: {
73
+ email: RegExp;
74
+ phone: RegExp;
75
+ number: RegExp;
76
+ } = {
77
+ email: /^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/,
78
+ phone: /^\d{10}$/,
79
+ number: /^\d+$/,
80
+ };
81
+
82
+ export default regularExpresions;
@@ -21,7 +21,7 @@ export default function TextArea({
21
21
  }: Props) {
22
22
  const [value, setValue] = useState<string>((props?.value as string) || "");
23
23
  return (
24
- <div className="w-full relative mb-5">
24
+ <div className="w-full relative my-3">
25
25
  <div className="relative flex items-center border rounded bg-white ">
26
26
  <textarea
27
27
  {...props}
@@ -35,7 +35,7 @@ export default function TextArea({
35
35
  onChange?.(e);
36
36
  }}
37
37
  ></textarea>{" "}
38
- <label className="absolute -top-2.5 left-2 text-xs font-bold bg-white px-1">
38
+ <label className="absolute -top-2.5 left-2 text-xs font-bold px-1">
39
39
  {label} {props?.required && <span className="text-red-500">*</span>}
40
40
  </label>
41
41
  {maxLength && (