next-recomponents 1.7.63 → 1.8.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,6 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
3
- import React__default, { DetailedHTMLProps, ButtonHTMLAttributes, Dispatch, SetStateAction, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes, TableHTMLAttributes, DialogHTMLAttributes } from 'react';
2
+ import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, Dispatch, SetStateAction, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes, TableHTMLAttributes } from 'react';
4
3
 
5
4
  interface Props$6 {
6
5
  color?: "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
@@ -17,31 +16,31 @@ declare function Button({ className, size, color, children, icon, disabled, ...p
17
16
 
18
17
  type LocationItem = {
19
18
  location: string;
20
- name: React__default.ReactNode;
21
- icon?: React__default.ReactNode;
19
+ name: React$1.ReactNode;
20
+ icon?: React$1.ReactNode;
22
21
  };
23
22
  declare function Container({ children, appName, menuList, navItems, leftPanel, footPanel, expandedFooter, expandedMenu, }: {
24
- appName?: React__default.ReactNode;
25
- children: React__default.ReactNode;
23
+ appName?: React$1.ReactNode;
24
+ children: React$1.ReactNode;
26
25
  menuList?: Array<LocationItem>;
27
26
  navItems?: Array<LocationItem>;
28
- leftPanel?: React__default.ReactNode;
29
- footPanel?: React__default.ReactNode;
27
+ leftPanel?: React$1.ReactNode;
28
+ footPanel?: React$1.ReactNode;
30
29
  expandedMenu?: boolean;
31
30
  expandedFooter?: boolean;
32
31
  }): react_jsx_runtime.JSX.Element;
33
32
 
34
- interface OnSubmitProps extends React__default.FormEvent<HTMLFormElement> {
33
+ interface OnSubmitProps extends React$1.FormEvent<HTMLFormElement> {
35
34
  values: Record<string, any>;
36
35
  }
37
- interface Props$4 extends React__default.DetailedHTMLProps<React__default.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> {
36
+ interface Props$4 extends React$1.DetailedHTMLProps<React$1.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> {
38
37
  onSubmit: (e: OnSubmitProps) => void | Promise<void>;
39
- children: React__default.ReactNode;
38
+ children: React$1.ReactNode;
40
39
  state?: [any, Dispatch<SetStateAction<any>>];
41
40
  invalidMessage?: string;
42
- loader?: React__default.ReactNode;
41
+ loader?: React$1.ReactNode;
43
42
  }
44
- declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React__default.Dispatch<Partial<T>>];
43
+ declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.Dispatch<Partial<T>>];
45
44
  declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$4): react_jsx_runtime.JSX.Element;
46
45
 
47
46
  interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
@@ -78,7 +77,7 @@ type TableEventProps = {
78
77
  row: Record<string, any>;
79
78
  updateRow: (data: Record<string, any>) => void;
80
79
  };
81
- interface TableProps$1 extends React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
80
+ interface TableProps extends React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
82
81
  data: Record<string, DataTypeOrItem> | Array<Record<string, DataTypeOrItem>>;
83
82
  dataTypes?: Record<string, any>;
84
83
  totals?: Array<string>;
@@ -90,10 +89,10 @@ interface TableProps$1 extends React.DetailedHTMLProps<React.TableHTMLAttributes
90
89
  loader?: React.ReactNode;
91
90
  maxItems?: number;
92
91
  }
93
- declare function Table({ ...props }: TableProps$1): react_jsx_runtime.JSX.Element;
92
+ declare function Table({ ...props }: TableProps): react_jsx_runtime.JSX.Element;
94
93
 
95
94
  interface Props$3 extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
96
- label?: React__default.ReactNode;
95
+ label?: React$1.ReactNode;
97
96
  maxLength?: number;
98
97
  }
99
98
  declare function TextArea({ label, className, maxLength, onChange, children, ...props }: Props$3): react_jsx_runtime.JSX.Element;
@@ -141,7 +140,7 @@ type EnhancedEndpoints<T extends Record<string, ItemsRecord>> = {
141
140
 
142
141
  declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$2<T>): EnhancedEndpoints<T>;
143
142
 
144
- interface CustomSelectProps extends React__default.DetailedHTMLProps<React__default.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
143
+ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
145
144
  label?: string;
146
145
  placeholder?: string;
147
146
  children: ReactNode;
@@ -152,11 +151,11 @@ interface CustomSelectProps extends React__default.DetailedHTMLProps<React__defa
152
151
  }
153
152
  declare function Select({ label, placeholder, children, strictMode, ...props }: CustomSelectProps): react_jsx_runtime.JSX.Element;
154
153
 
155
- interface Props$1 extends React__default.DetailedHTMLProps<React__default.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> {
156
- button: React__default.ReactElement<{
157
- onClick: (e: React__default.MouseEvent) => void;
154
+ interface Props$1 extends React$1.DetailedHTMLProps<React$1.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> {
155
+ button: React$1.ReactElement<{
156
+ onClick: (e: React$1.MouseEvent) => void;
158
157
  }>;
159
- children: React__default.ReactElement<{
158
+ children: React$1.ReactElement<{
160
159
  hide: () => void;
161
160
  }>;
162
161
  }
@@ -165,7 +164,7 @@ declare function Modal({ button, children, ref, title }: Props$1): react_jsx_run
165
164
  type PreProps = {
166
165
  data: any;
167
166
  };
168
- declare const Pre: React__default.FC<PreProps>;
167
+ declare const Pre: React$1.FC<PreProps>;
169
168
 
170
169
  declare function useDates(): {
171
170
  isValid: (date: string, date2?: any) => boolean;
@@ -202,24 +201,18 @@ type Props = {
202
201
  };
203
202
  declare function DocumentViewer({ item }: Props): react_jsx_runtime.JSX.Element;
204
203
 
205
- interface TableProps extends DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
204
+ interface Table3Props extends DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
206
205
  data: Record<string, any>[];
206
+ selectItems?: boolean;
207
207
  maxItems?: number;
208
- symbols?: Record<string, React__default.ReactNode>;
209
- handlers?: Record<string, React__default.ReactNode>;
210
- onSave?: (data: Record<string, any>[]) => void;
208
+ onSave?: (e: any) => void;
211
209
  exportName?: string;
212
- selectItems?: boolean;
213
210
  colSizes?: Record<string, number>;
211
+ modal?: React$1.ReactNode;
212
+ footer?: Record<string, "sum" | "count" | "avg">;
213
+ header?: React$1.ReactNode;
214
+ onChange?: (e: any) => any;
214
215
  }
215
- declare function TableDos({ data, maxItems, symbols, handlers, onSave, exportName, selectItems, colSizes, ...props }: TableProps): react_jsx_runtime.JSX.Element | null;
216
-
217
- declare function useModal(): {
218
- show: () => void;
219
- hide: () => void;
220
- Modal: ({ className, children, title, ...props }: DetailedHTMLProps<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> & {
221
- title?: React.ReactNode;
222
- }) => React$1.ReactPortal | null;
223
- };
216
+ declare function Table3({ data, selectItems, maxItems, onSave, exportName, colSizes, modal, header, footer, onChange, ...props }: Table3Props): react_jsx_runtime.JSX.Element | null;
224
217
 
225
- export { Alert, Button, Container, DocumentViewer, Form, Input, Modal, MyCalendar, Pre, Select, Table, TableDos, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, useModal, useResources };
218
+ export { Alert, Button, Container, DocumentViewer, Form, Input, Modal, MyCalendar, Pre, Select, Table, Table3, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, useResources };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
3
- import React__default, { DetailedHTMLProps, ButtonHTMLAttributes, Dispatch, SetStateAction, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes, TableHTMLAttributes, DialogHTMLAttributes } from 'react';
2
+ import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, Dispatch, SetStateAction, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes, TableHTMLAttributes } from 'react';
4
3
 
5
4
  interface Props$6 {
6
5
  color?: "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
@@ -17,31 +16,31 @@ declare function Button({ className, size, color, children, icon, disabled, ...p
17
16
 
18
17
  type LocationItem = {
19
18
  location: string;
20
- name: React__default.ReactNode;
21
- icon?: React__default.ReactNode;
19
+ name: React$1.ReactNode;
20
+ icon?: React$1.ReactNode;
22
21
  };
23
22
  declare function Container({ children, appName, menuList, navItems, leftPanel, footPanel, expandedFooter, expandedMenu, }: {
24
- appName?: React__default.ReactNode;
25
- children: React__default.ReactNode;
23
+ appName?: React$1.ReactNode;
24
+ children: React$1.ReactNode;
26
25
  menuList?: Array<LocationItem>;
27
26
  navItems?: Array<LocationItem>;
28
- leftPanel?: React__default.ReactNode;
29
- footPanel?: React__default.ReactNode;
27
+ leftPanel?: React$1.ReactNode;
28
+ footPanel?: React$1.ReactNode;
30
29
  expandedMenu?: boolean;
31
30
  expandedFooter?: boolean;
32
31
  }): react_jsx_runtime.JSX.Element;
33
32
 
34
- interface OnSubmitProps extends React__default.FormEvent<HTMLFormElement> {
33
+ interface OnSubmitProps extends React$1.FormEvent<HTMLFormElement> {
35
34
  values: Record<string, any>;
36
35
  }
37
- interface Props$4 extends React__default.DetailedHTMLProps<React__default.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> {
36
+ interface Props$4 extends React$1.DetailedHTMLProps<React$1.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> {
38
37
  onSubmit: (e: OnSubmitProps) => void | Promise<void>;
39
- children: React__default.ReactNode;
38
+ children: React$1.ReactNode;
40
39
  state?: [any, Dispatch<SetStateAction<any>>];
41
40
  invalidMessage?: string;
42
- loader?: React__default.ReactNode;
41
+ loader?: React$1.ReactNode;
43
42
  }
44
- declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React__default.Dispatch<Partial<T>>];
43
+ declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.Dispatch<Partial<T>>];
45
44
  declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$4): react_jsx_runtime.JSX.Element;
46
45
 
47
46
  interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
@@ -78,7 +77,7 @@ type TableEventProps = {
78
77
  row: Record<string, any>;
79
78
  updateRow: (data: Record<string, any>) => void;
80
79
  };
81
- interface TableProps$1 extends React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
80
+ interface TableProps extends React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
82
81
  data: Record<string, DataTypeOrItem> | Array<Record<string, DataTypeOrItem>>;
83
82
  dataTypes?: Record<string, any>;
84
83
  totals?: Array<string>;
@@ -90,10 +89,10 @@ interface TableProps$1 extends React.DetailedHTMLProps<React.TableHTMLAttributes
90
89
  loader?: React.ReactNode;
91
90
  maxItems?: number;
92
91
  }
93
- declare function Table({ ...props }: TableProps$1): react_jsx_runtime.JSX.Element;
92
+ declare function Table({ ...props }: TableProps): react_jsx_runtime.JSX.Element;
94
93
 
95
94
  interface Props$3 extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
96
- label?: React__default.ReactNode;
95
+ label?: React$1.ReactNode;
97
96
  maxLength?: number;
98
97
  }
99
98
  declare function TextArea({ label, className, maxLength, onChange, children, ...props }: Props$3): react_jsx_runtime.JSX.Element;
@@ -141,7 +140,7 @@ type EnhancedEndpoints<T extends Record<string, ItemsRecord>> = {
141
140
 
142
141
  declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$2<T>): EnhancedEndpoints<T>;
143
142
 
144
- interface CustomSelectProps extends React__default.DetailedHTMLProps<React__default.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
143
+ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
145
144
  label?: string;
146
145
  placeholder?: string;
147
146
  children: ReactNode;
@@ -152,11 +151,11 @@ interface CustomSelectProps extends React__default.DetailedHTMLProps<React__defa
152
151
  }
153
152
  declare function Select({ label, placeholder, children, strictMode, ...props }: CustomSelectProps): react_jsx_runtime.JSX.Element;
154
153
 
155
- interface Props$1 extends React__default.DetailedHTMLProps<React__default.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> {
156
- button: React__default.ReactElement<{
157
- onClick: (e: React__default.MouseEvent) => void;
154
+ interface Props$1 extends React$1.DetailedHTMLProps<React$1.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> {
155
+ button: React$1.ReactElement<{
156
+ onClick: (e: React$1.MouseEvent) => void;
158
157
  }>;
159
- children: React__default.ReactElement<{
158
+ children: React$1.ReactElement<{
160
159
  hide: () => void;
161
160
  }>;
162
161
  }
@@ -165,7 +164,7 @@ declare function Modal({ button, children, ref, title }: Props$1): react_jsx_run
165
164
  type PreProps = {
166
165
  data: any;
167
166
  };
168
- declare const Pre: React__default.FC<PreProps>;
167
+ declare const Pre: React$1.FC<PreProps>;
169
168
 
170
169
  declare function useDates(): {
171
170
  isValid: (date: string, date2?: any) => boolean;
@@ -202,24 +201,18 @@ type Props = {
202
201
  };
203
202
  declare function DocumentViewer({ item }: Props): react_jsx_runtime.JSX.Element;
204
203
 
205
- interface TableProps extends DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
204
+ interface Table3Props extends DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
206
205
  data: Record<string, any>[];
206
+ selectItems?: boolean;
207
207
  maxItems?: number;
208
- symbols?: Record<string, React__default.ReactNode>;
209
- handlers?: Record<string, React__default.ReactNode>;
210
- onSave?: (data: Record<string, any>[]) => void;
208
+ onSave?: (e: any) => void;
211
209
  exportName?: string;
212
- selectItems?: boolean;
213
210
  colSizes?: Record<string, number>;
211
+ modal?: React$1.ReactNode;
212
+ footer?: Record<string, "sum" | "count" | "avg">;
213
+ header?: React$1.ReactNode;
214
+ onChange?: (e: any) => any;
214
215
  }
215
- declare function TableDos({ data, maxItems, symbols, handlers, onSave, exportName, selectItems, colSizes, ...props }: TableProps): react_jsx_runtime.JSX.Element | null;
216
-
217
- declare function useModal(): {
218
- show: () => void;
219
- hide: () => void;
220
- Modal: ({ className, children, title, ...props }: DetailedHTMLProps<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> & {
221
- title?: React.ReactNode;
222
- }) => React$1.ReactPortal | null;
223
- };
216
+ declare function Table3({ data, selectItems, maxItems, onSave, exportName, colSizes, modal, header, footer, onChange, ...props }: Table3Props): react_jsx_runtime.JSX.Element | null;
224
217
 
225
- export { Alert, Button, Container, DocumentViewer, Form, Input, Modal, MyCalendar, Pre, Select, Table, TableDos, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, useModal, useResources };
218
+ export { Alert, Button, Container, DocumentViewer, Form, Input, Modal, MyCalendar, Pre, Select, Table, Table3, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, useResources };