next-recomponents 2.0.10 → 2.0.12
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 +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +473 -414
- package/dist/index.mjs +445 -386
- package/package.json +1 -1
- package/src/container/index.tsx +1 -1
- package/src/modal/index copy.tsx +59 -0
- package/src/modal/index.tsx +33 -52
- package/src/pop/actions.tsx +30 -0
- package/src/pop/color.tsx +69 -0
- package/src/pop/icon.tsx +15 -0
- package/src/pop/index.tsx +90 -255
- package/src/pop/input.tsx +27 -0
- package/src/pop/overlay.tsx +88 -0
- package/src/pop/types.ts +56 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode, Dispatch, SetStateAction, InputHTMLAttributes, TextareaHTMLAttributes, TableHTMLAttributes } from 'react';
|
|
2
|
+
import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode, Dispatch, SetStateAction, InputHTMLAttributes, TextareaHTMLAttributes, ReactElement, TableHTMLAttributes } from 'react';
|
|
3
3
|
import { GridValidRowModel } from '@mui/x-data-grid';
|
|
4
|
-
import { React as React$2 } from 'next/dist/server/route-modules/app-page/vendored/rsc/entrypoints';
|
|
5
4
|
|
|
6
|
-
interface Props$
|
|
5
|
+
interface Props$5 extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
6
|
color?: "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
}
|
|
10
|
-
declare function Alert({ color, children, ...props }: Props$
|
|
9
|
+
declare function Alert({ color, children, ...props }: Props$5): react_jsx_runtime.JSX.Element;
|
|
11
10
|
|
|
12
|
-
interface Props$
|
|
11
|
+
interface Props$4 extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
13
12
|
icon?: React.ReactNode;
|
|
14
13
|
size?: "full" | "small";
|
|
15
14
|
full?: boolean;
|
|
16
15
|
color?: "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
17
16
|
}
|
|
18
|
-
declare function Button({ className, size, color, children, icon, disabled, full, ...props }: Props$
|
|
17
|
+
declare function Button({ className, size, color, children, icon, disabled, full, ...props }: Props$4): react_jsx_runtime.JSX.Element;
|
|
19
18
|
|
|
20
19
|
type LocationItem = {
|
|
21
20
|
location: string;
|
|
@@ -36,7 +35,7 @@ declare function Container({ children, appName, menuList, navItems, leftPanel, f
|
|
|
36
35
|
interface OnSubmitProps extends React$1.FormEvent<HTMLFormElement> {
|
|
37
36
|
values: Record<string, any>;
|
|
38
37
|
}
|
|
39
|
-
interface Props$
|
|
38
|
+
interface Props$3 {
|
|
40
39
|
onSubmit?: (e: OnSubmitProps) => void | Promise<void>;
|
|
41
40
|
children?: React$1.ReactNode;
|
|
42
41
|
state?: [any, Dispatch<SetStateAction<any>>];
|
|
@@ -45,7 +44,7 @@ interface Props$4 {
|
|
|
45
44
|
[key: string]: any;
|
|
46
45
|
}
|
|
47
46
|
declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.ActionDispatch<[action: Partial<T>]>];
|
|
48
|
-
declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$
|
|
47
|
+
declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$3): react_jsx_runtime.JSX.Element;
|
|
49
48
|
|
|
50
49
|
interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
51
50
|
label: React.ReactNode;
|
|
@@ -86,11 +85,11 @@ interface TableProps {
|
|
|
86
85
|
}
|
|
87
86
|
declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
|
|
88
87
|
|
|
89
|
-
interface Props$
|
|
88
|
+
interface Props$2 extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
90
89
|
label?: React$1.ReactNode;
|
|
91
90
|
maxLength?: number;
|
|
92
91
|
}
|
|
93
|
-
declare function TextArea({ label, className, maxLength, onChange, children, ...props }: Props$
|
|
92
|
+
declare function TextArea({ label, className, maxLength, onChange, children, ...props }: Props$2): react_jsx_runtime.JSX.Element;
|
|
94
93
|
|
|
95
94
|
interface DefaultParams {
|
|
96
95
|
[key: string]: any;
|
|
@@ -102,7 +101,7 @@ interface ItemsRecord<T = any> {
|
|
|
102
101
|
id?: number | string | string[] | undefined;
|
|
103
102
|
defaultParams?: DefaultParams;
|
|
104
103
|
}
|
|
105
|
-
interface Props$
|
|
104
|
+
interface Props$1<T extends Record<string, ItemsRecord>> {
|
|
106
105
|
baseURI: string;
|
|
107
106
|
endpoints: T;
|
|
108
107
|
onError?: (error: any) => void;
|
|
@@ -138,7 +137,7 @@ type EnhancedEndpoints<T extends Record<string, ItemsRecord>> = {
|
|
|
138
137
|
};
|
|
139
138
|
};
|
|
140
139
|
|
|
141
|
-
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$
|
|
140
|
+
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$1<T>): EnhancedEndpoints<T>;
|
|
142
141
|
|
|
143
142
|
interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
144
143
|
label?: string;
|
|
@@ -151,15 +150,14 @@ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLA
|
|
|
151
150
|
}
|
|
152
151
|
declare function Select({ label, placeholder, children, strictMode, ...props }: CustomSelectProps): react_jsx_runtime.JSX.Element;
|
|
153
152
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
children: React$1.ReactElement<{
|
|
153
|
+
type PopupColor$1 = "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
154
|
+
declare function Modal({ button, children, color, }: {
|
|
155
|
+
button: ReactElement<React$1.ComponentPropsWithRef<"button">>;
|
|
156
|
+
children: ReactElement<React$1.ComponentPropsWithRef<"div"> & {
|
|
159
157
|
hide: () => void;
|
|
160
158
|
}>;
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
color?: PopupColor$1;
|
|
160
|
+
}): react_jsx_runtime.JSX.Element;
|
|
163
161
|
|
|
164
162
|
type PreProps = {
|
|
165
163
|
data: any;
|
|
@@ -217,13 +215,15 @@ interface Table3Props<T extends Record<string, any>> extends DetailedHTMLProps<T
|
|
|
217
215
|
}
|
|
218
216
|
declare function Table3<T extends Record<string, any>>({ data, selectItems, maxItems, onSave, exportName, colSizes, modal, header, footer, onChange, symbols, sortBy, ...props }: Table3Props<T>): react_jsx_runtime.JSX.Element | null;
|
|
219
217
|
|
|
220
|
-
type
|
|
218
|
+
type PopupColor = "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
219
|
+
|
|
221
220
|
declare function usePopup(): {
|
|
222
|
-
alert: (message: string, color?:
|
|
223
|
-
confirm: (message: string, color?:
|
|
224
|
-
prompt: (message: string, color?:
|
|
221
|
+
alert: (message: string, color?: PopupColor) => Promise<void>;
|
|
222
|
+
confirm: (message: string, color?: PopupColor) => Promise<boolean>;
|
|
223
|
+
prompt: (message: string, color?: PopupColor) => Promise<string | null>;
|
|
224
|
+
modal: (message: ReactNode, color?: PopupColor, icons?: boolean, full?: boolean) => Promise<void>;
|
|
225
225
|
PopupComponent: react_jsx_runtime.JSX.Element | null;
|
|
226
|
-
|
|
226
|
+
close: (confirmed: boolean, value?: string) => void;
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
export { Alert, Button, Container, DocumentViewer, Form, Input, Modal, MyCalendar, Pre, Select, Table, Table3, type TableButtonProps, type TableButtonProps as TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, usePopup, useResources };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode, Dispatch, SetStateAction, InputHTMLAttributes, TextareaHTMLAttributes, TableHTMLAttributes } from 'react';
|
|
2
|
+
import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode, Dispatch, SetStateAction, InputHTMLAttributes, TextareaHTMLAttributes, ReactElement, TableHTMLAttributes } from 'react';
|
|
3
3
|
import { GridValidRowModel } from '@mui/x-data-grid';
|
|
4
|
-
import { React as React$2 } from 'next/dist/server/route-modules/app-page/vendored/rsc/entrypoints';
|
|
5
4
|
|
|
6
|
-
interface Props$
|
|
5
|
+
interface Props$5 extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
6
|
color?: "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
}
|
|
10
|
-
declare function Alert({ color, children, ...props }: Props$
|
|
9
|
+
declare function Alert({ color, children, ...props }: Props$5): react_jsx_runtime.JSX.Element;
|
|
11
10
|
|
|
12
|
-
interface Props$
|
|
11
|
+
interface Props$4 extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
13
12
|
icon?: React.ReactNode;
|
|
14
13
|
size?: "full" | "small";
|
|
15
14
|
full?: boolean;
|
|
16
15
|
color?: "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
17
16
|
}
|
|
18
|
-
declare function Button({ className, size, color, children, icon, disabled, full, ...props }: Props$
|
|
17
|
+
declare function Button({ className, size, color, children, icon, disabled, full, ...props }: Props$4): react_jsx_runtime.JSX.Element;
|
|
19
18
|
|
|
20
19
|
type LocationItem = {
|
|
21
20
|
location: string;
|
|
@@ -36,7 +35,7 @@ declare function Container({ children, appName, menuList, navItems, leftPanel, f
|
|
|
36
35
|
interface OnSubmitProps extends React$1.FormEvent<HTMLFormElement> {
|
|
37
36
|
values: Record<string, any>;
|
|
38
37
|
}
|
|
39
|
-
interface Props$
|
|
38
|
+
interface Props$3 {
|
|
40
39
|
onSubmit?: (e: OnSubmitProps) => void | Promise<void>;
|
|
41
40
|
children?: React$1.ReactNode;
|
|
42
41
|
state?: [any, Dispatch<SetStateAction<any>>];
|
|
@@ -45,7 +44,7 @@ interface Props$4 {
|
|
|
45
44
|
[key: string]: any;
|
|
46
45
|
}
|
|
47
46
|
declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.ActionDispatch<[action: Partial<T>]>];
|
|
48
|
-
declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$
|
|
47
|
+
declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$3): react_jsx_runtime.JSX.Element;
|
|
49
48
|
|
|
50
49
|
interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
51
50
|
label: React.ReactNode;
|
|
@@ -86,11 +85,11 @@ interface TableProps {
|
|
|
86
85
|
}
|
|
87
86
|
declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
|
|
88
87
|
|
|
89
|
-
interface Props$
|
|
88
|
+
interface Props$2 extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
90
89
|
label?: React$1.ReactNode;
|
|
91
90
|
maxLength?: number;
|
|
92
91
|
}
|
|
93
|
-
declare function TextArea({ label, className, maxLength, onChange, children, ...props }: Props$
|
|
92
|
+
declare function TextArea({ label, className, maxLength, onChange, children, ...props }: Props$2): react_jsx_runtime.JSX.Element;
|
|
94
93
|
|
|
95
94
|
interface DefaultParams {
|
|
96
95
|
[key: string]: any;
|
|
@@ -102,7 +101,7 @@ interface ItemsRecord<T = any> {
|
|
|
102
101
|
id?: number | string | string[] | undefined;
|
|
103
102
|
defaultParams?: DefaultParams;
|
|
104
103
|
}
|
|
105
|
-
interface Props$
|
|
104
|
+
interface Props$1<T extends Record<string, ItemsRecord>> {
|
|
106
105
|
baseURI: string;
|
|
107
106
|
endpoints: T;
|
|
108
107
|
onError?: (error: any) => void;
|
|
@@ -138,7 +137,7 @@ type EnhancedEndpoints<T extends Record<string, ItemsRecord>> = {
|
|
|
138
137
|
};
|
|
139
138
|
};
|
|
140
139
|
|
|
141
|
-
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$
|
|
140
|
+
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$1<T>): EnhancedEndpoints<T>;
|
|
142
141
|
|
|
143
142
|
interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
144
143
|
label?: string;
|
|
@@ -151,15 +150,14 @@ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLA
|
|
|
151
150
|
}
|
|
152
151
|
declare function Select({ label, placeholder, children, strictMode, ...props }: CustomSelectProps): react_jsx_runtime.JSX.Element;
|
|
153
152
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
children: React$1.ReactElement<{
|
|
153
|
+
type PopupColor$1 = "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
154
|
+
declare function Modal({ button, children, color, }: {
|
|
155
|
+
button: ReactElement<React$1.ComponentPropsWithRef<"button">>;
|
|
156
|
+
children: ReactElement<React$1.ComponentPropsWithRef<"div"> & {
|
|
159
157
|
hide: () => void;
|
|
160
158
|
}>;
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
color?: PopupColor$1;
|
|
160
|
+
}): react_jsx_runtime.JSX.Element;
|
|
163
161
|
|
|
164
162
|
type PreProps = {
|
|
165
163
|
data: any;
|
|
@@ -217,13 +215,15 @@ interface Table3Props<T extends Record<string, any>> extends DetailedHTMLProps<T
|
|
|
217
215
|
}
|
|
218
216
|
declare function Table3<T extends Record<string, any>>({ data, selectItems, maxItems, onSave, exportName, colSizes, modal, header, footer, onChange, symbols, sortBy, ...props }: Table3Props<T>): react_jsx_runtime.JSX.Element | null;
|
|
219
217
|
|
|
220
|
-
type
|
|
218
|
+
type PopupColor = "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
219
|
+
|
|
221
220
|
declare function usePopup(): {
|
|
222
|
-
alert: (message: string, color?:
|
|
223
|
-
confirm: (message: string, color?:
|
|
224
|
-
prompt: (message: string, color?:
|
|
221
|
+
alert: (message: string, color?: PopupColor) => Promise<void>;
|
|
222
|
+
confirm: (message: string, color?: PopupColor) => Promise<boolean>;
|
|
223
|
+
prompt: (message: string, color?: PopupColor) => Promise<string | null>;
|
|
224
|
+
modal: (message: ReactNode, color?: PopupColor, icons?: boolean, full?: boolean) => Promise<void>;
|
|
225
225
|
PopupComponent: react_jsx_runtime.JSX.Element | null;
|
|
226
|
-
|
|
226
|
+
close: (confirmed: boolean, value?: string) => void;
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
export { Alert, Button, Container, DocumentViewer, Form, Input, Modal, MyCalendar, Pre, Select, Table, Table3, type TableButtonProps, type TableButtonProps as TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, usePopup, useResources };
|