react-admin-crud-manager 1.1.0 → 1.1.1
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.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +31 -31
- package/dist/index.es.js.map +1 -1
- package/dist/types/OptionalSnackbarProvider.d.ts +6 -0
- package/dist/types/components/Button/Button.d.ts +11 -0
- package/dist/types/components/Chip/Chip.d.ts +8 -0
- package/dist/types/components/CrudPage.d.ts +213 -0
- package/dist/types/components/Details/Details.d.ts +12 -0
- package/dist/types/components/Details/components/CardGroup.d.ts +6 -0
- package/dist/types/components/Details/components/DetailRow.d.ts +6 -0
- package/dist/types/components/Details/components/GroupRow.d.ts +6 -0
- package/dist/types/components/Filter/FilterDrawer.d.ts +17 -0
- package/dist/types/components/Form/Form.d.ts +21 -0
- package/dist/types/components/Form/components/AudioPicker.d.ts +18 -0
- package/dist/types/components/Form/components/Checkbox.d.ts +19 -0
- package/dist/types/components/Form/components/ImageCropperModal.d.ts +12 -0
- package/dist/types/components/Form/components/ImagePicker.d.ts +19 -0
- package/dist/types/components/Form/components/Input.d.ts +18 -0
- package/dist/types/components/Form/components/InputLabel.d.ts +8 -0
- package/dist/types/components/Form/components/PhoneInput.d.ts +15 -0
- package/dist/types/components/Form/components/Radio.d.ts +17 -0
- package/dist/types/components/Form/components/RenderFields.d.ts +42 -0
- package/dist/types/components/Form/components/Select.d.ts +25 -0
- package/dist/types/components/Form/components/Switch.d.ts +13 -0
- package/dist/types/components/Form/components/TextArea.d.ts +9 -0
- package/dist/types/components/Form/components/TinyEditor.d.ts +20 -0
- package/dist/types/components/Form/components/VideoPicker.d.ts +18 -0
- package/dist/types/components/Loader/Spinner.d.ts +7 -0
- package/dist/types/components/Modal/Modal.d.ts +28 -0
- package/dist/types/components/Table/Table.d.ts +10 -0
- package/dist/types/components/Table/components/ImagePreview.d.ts +8 -0
- package/dist/types/components/Table/components/SortDropdown.d.ts +13 -0
- package/dist/types/components/Table/components/TableSkeleton.d.ts +6 -0
- package/dist/types/components/Table/utils/sortUtils.d.ts +58 -0
- package/dist/types/data/countries.d.ts +6 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/package.json +6 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
variant?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
size?: string;
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export default Button;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
interface CrudPageProps {
|
|
3
|
+
config: Config;
|
|
4
|
+
}
|
|
5
|
+
interface Option {
|
|
6
|
+
value: string | number | boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ActionButton {
|
|
11
|
+
type: string;
|
|
12
|
+
label: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
variant?: string;
|
|
15
|
+
onClick?: (event?: React.MouseEvent, item?: any) => void | Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
interface MenuAction {
|
|
18
|
+
title: string;
|
|
19
|
+
type: string;
|
|
20
|
+
variant?: string;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
interface TableHead {
|
|
24
|
+
key: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
type?: string;
|
|
27
|
+
imageKey?: string;
|
|
28
|
+
titleKey?: string;
|
|
29
|
+
subtitleKey?: string;
|
|
30
|
+
onClickDetails?: boolean;
|
|
31
|
+
variant?: string;
|
|
32
|
+
chipOptions?: Option[];
|
|
33
|
+
defaultColor?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
format?: string;
|
|
36
|
+
menuList?: MenuAction[];
|
|
37
|
+
}
|
|
38
|
+
interface FormField {
|
|
39
|
+
key: string;
|
|
40
|
+
label?: string;
|
|
41
|
+
type?: string;
|
|
42
|
+
options?: any[];
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
rows?: number;
|
|
45
|
+
inputClass?: string;
|
|
46
|
+
search?: boolean;
|
|
47
|
+
accept?: string;
|
|
48
|
+
text?: string;
|
|
49
|
+
required?: boolean;
|
|
50
|
+
minLength?: number;
|
|
51
|
+
dragDrop?: boolean;
|
|
52
|
+
parentClass?: string;
|
|
53
|
+
countriesList?: boolean;
|
|
54
|
+
defaultCountry?: string;
|
|
55
|
+
multiple?: boolean;
|
|
56
|
+
dropdownMaxHeight?: number;
|
|
57
|
+
editorKey?: string;
|
|
58
|
+
fontFamily?: string;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
negativeNumberAllow?: boolean;
|
|
61
|
+
defaultValue?: any;
|
|
62
|
+
renderCondition?: (formData: Record<string, any>) => boolean;
|
|
63
|
+
pattern?: string;
|
|
64
|
+
renderType?: string;
|
|
65
|
+
cropImage?: boolean;
|
|
66
|
+
aspectRatio?: number;
|
|
67
|
+
dependencyKey?: string;
|
|
68
|
+
mask?: string;
|
|
69
|
+
maskApplyOnValue?: boolean;
|
|
70
|
+
maxSize?: number;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}
|
|
73
|
+
interface ViewField {
|
|
74
|
+
key?: string;
|
|
75
|
+
label?: string;
|
|
76
|
+
type?: string;
|
|
77
|
+
imageKey?: string;
|
|
78
|
+
titleKey?: string;
|
|
79
|
+
subtitleKey?: string;
|
|
80
|
+
blockClass?: string;
|
|
81
|
+
icon?: ReactNode;
|
|
82
|
+
variant?: string;
|
|
83
|
+
chipOptions?: Option[];
|
|
84
|
+
defaultColor?: string;
|
|
85
|
+
className?: string;
|
|
86
|
+
format?: string;
|
|
87
|
+
}
|
|
88
|
+
interface SearchConfig {
|
|
89
|
+
enabled?: boolean;
|
|
90
|
+
useServerSideSearch?: boolean;
|
|
91
|
+
searchKeys?: string[];
|
|
92
|
+
}
|
|
93
|
+
interface PaginationConfig {
|
|
94
|
+
enabled?: boolean;
|
|
95
|
+
useServerSidePagination?: boolean;
|
|
96
|
+
}
|
|
97
|
+
interface FilterConfig {
|
|
98
|
+
enabled?: boolean;
|
|
99
|
+
useServerSideFilters?: boolean;
|
|
100
|
+
}
|
|
101
|
+
interface SortChangePayload {
|
|
102
|
+
value: string;
|
|
103
|
+
option: {
|
|
104
|
+
value: string;
|
|
105
|
+
label: string;
|
|
106
|
+
key: string;
|
|
107
|
+
order: string;
|
|
108
|
+
type?: string;
|
|
109
|
+
} | null;
|
|
110
|
+
key: string;
|
|
111
|
+
order: string;
|
|
112
|
+
type: string;
|
|
113
|
+
}
|
|
114
|
+
interface SortConfig {
|
|
115
|
+
enabled?: boolean;
|
|
116
|
+
useServerSideSorting?: boolean;
|
|
117
|
+
options?: Array<{
|
|
118
|
+
value: string;
|
|
119
|
+
label: string;
|
|
120
|
+
key: string;
|
|
121
|
+
order: string;
|
|
122
|
+
type?: string;
|
|
123
|
+
}>;
|
|
124
|
+
fields?: string[];
|
|
125
|
+
defaultValue?: string;
|
|
126
|
+
autoGenerate?: boolean;
|
|
127
|
+
clearLabel?: string;
|
|
128
|
+
onChange?: (payload: SortChangePayload) => void;
|
|
129
|
+
}
|
|
130
|
+
interface TableConfig {
|
|
131
|
+
table_head: TableHead[];
|
|
132
|
+
search?: SearchConfig;
|
|
133
|
+
pagination?: PaginationConfig;
|
|
134
|
+
filter?: FilterConfig;
|
|
135
|
+
sort?: SortConfig;
|
|
136
|
+
}
|
|
137
|
+
interface ModalConfig {
|
|
138
|
+
addModal?: {
|
|
139
|
+
title: string;
|
|
140
|
+
size?: string;
|
|
141
|
+
formClass?: string;
|
|
142
|
+
formFields?: FormField[];
|
|
143
|
+
handleSubmit: (formData: Record<string, any>) => Promise<{
|
|
144
|
+
newObject: any;
|
|
145
|
+
message?: string;
|
|
146
|
+
}>;
|
|
147
|
+
actionButtons?: ActionButton[];
|
|
148
|
+
icon?: ReactNode;
|
|
149
|
+
};
|
|
150
|
+
editModal?: {
|
|
151
|
+
title: string;
|
|
152
|
+
size?: string;
|
|
153
|
+
formClass?: string;
|
|
154
|
+
formFields?: FormField[];
|
|
155
|
+
handleSubmit: (formData: Record<string, any>, item: any) => Promise<{
|
|
156
|
+
newObject: any;
|
|
157
|
+
targetObject: any;
|
|
158
|
+
message?: string;
|
|
159
|
+
}>;
|
|
160
|
+
actionButtons?: ActionButton[];
|
|
161
|
+
icon?: ReactNode;
|
|
162
|
+
};
|
|
163
|
+
deleteModal?: {
|
|
164
|
+
title: string;
|
|
165
|
+
size?: string;
|
|
166
|
+
confirmText?: string;
|
|
167
|
+
referenceKey?: string;
|
|
168
|
+
actionButtons?: ActionButton[];
|
|
169
|
+
action: (item: any) => Promise<{
|
|
170
|
+
targetObject: any;
|
|
171
|
+
} | null>;
|
|
172
|
+
icon?: ReactNode;
|
|
173
|
+
};
|
|
174
|
+
viewModal?: {
|
|
175
|
+
title: string;
|
|
176
|
+
size?: string;
|
|
177
|
+
component?: React.ComponentType<{
|
|
178
|
+
data: any;
|
|
179
|
+
}>;
|
|
180
|
+
fields?: ViewField[];
|
|
181
|
+
footer?: {
|
|
182
|
+
cancelButton?: boolean;
|
|
183
|
+
cancelText?: string;
|
|
184
|
+
};
|
|
185
|
+
icon?: ReactNode;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
interface FilterConfigProps {
|
|
189
|
+
fields?: FormField[];
|
|
190
|
+
}
|
|
191
|
+
interface Config {
|
|
192
|
+
title: string;
|
|
193
|
+
description?: string;
|
|
194
|
+
buttonText?: string;
|
|
195
|
+
fetchData: (params: {
|
|
196
|
+
search: string;
|
|
197
|
+
rows_per_page: number;
|
|
198
|
+
current_page: number;
|
|
199
|
+
sort_by: string;
|
|
200
|
+
sort_order: string;
|
|
201
|
+
[key: string]: any;
|
|
202
|
+
}) => Promise<{
|
|
203
|
+
data: any[];
|
|
204
|
+
pagination: any;
|
|
205
|
+
}>;
|
|
206
|
+
fetchRowDetails?: (item: any) => Promise<any>;
|
|
207
|
+
isStaticData?: boolean;
|
|
208
|
+
tableConfig: TableConfig;
|
|
209
|
+
modalConfig?: ModalConfig;
|
|
210
|
+
filterConfig?: FilterConfigProps;
|
|
211
|
+
}
|
|
212
|
+
declare const CrudPage: React.FC<CrudPageProps>;
|
|
213
|
+
export default CrudPage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface DetailsProps {
|
|
2
|
+
data: Record<string, any> | null;
|
|
3
|
+
config: {
|
|
4
|
+
fields?: Array<Record<string, any>>;
|
|
5
|
+
containerClass?: string;
|
|
6
|
+
};
|
|
7
|
+
fetchRowDetails?: (payload: Record<string, any>) => Promise<{
|
|
8
|
+
data: Record<string, any>;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export default function Details({ data, config, fetchRowDetails, }: DetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type FieldConfig } from "../Form/components/RenderFields";
|
|
3
|
+
interface FilterConfig {
|
|
4
|
+
component: React.ComponentType<{
|
|
5
|
+
filters: Record<string, any>;
|
|
6
|
+
onFilterChange: (key: string, value: any) => void;
|
|
7
|
+
}>;
|
|
8
|
+
fields: FieldConfig[];
|
|
9
|
+
}
|
|
10
|
+
interface FilterDrawerProps {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
config: FilterConfig;
|
|
14
|
+
onApply: (filters: Record<string, any>) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const FilterDrawer: ({ isOpen, onClose, config, onApply, }: FilterDrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default FilterDrawer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface FormField {
|
|
3
|
+
key: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
interface FormConfig {
|
|
7
|
+
formClass?: string;
|
|
8
|
+
formFields?: FormField[];
|
|
9
|
+
}
|
|
10
|
+
interface FormProps {
|
|
11
|
+
config: FormConfig;
|
|
12
|
+
onSubmit: (data: Record<string, any>) => void;
|
|
13
|
+
initialData: Record<string, any> | null;
|
|
14
|
+
fetchRowDetails?: (item: Record<string, any>) => Promise<{
|
|
15
|
+
data: Record<string, any>;
|
|
16
|
+
}>;
|
|
17
|
+
type: "add" | "edit" | string;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const Form: React.FC<FormProps>;
|
|
21
|
+
export default Form;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type MediaValue = File | {
|
|
2
|
+
file?: File;
|
|
3
|
+
preview?: string;
|
|
4
|
+
} | string | null;
|
|
5
|
+
interface AudioPickerProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
value: MediaValue;
|
|
8
|
+
onChange: (file: File | null) => void;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
accept?: string;
|
|
11
|
+
id: string;
|
|
12
|
+
dragDrop?: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
parentClass?: string;
|
|
15
|
+
maxSize?: number;
|
|
16
|
+
}
|
|
17
|
+
declare const AudioPicker: ({ label, value, onChange, required, accept, id, dragDrop, name, parentClass, maxSize, }: AudioPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default AudioPicker;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface CheckboxOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: any;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface CheckboxProps {
|
|
7
|
+
name: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
options: CheckboxOption[];
|
|
10
|
+
value: any;
|
|
11
|
+
onChange: (value: any, name?: string) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
parentClass?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
multiSelect?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const Checkbox: ({ name, label, options, value, onChange, disabled, required, parentClass, className, multiSelect, }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default Checkbox;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ImageCropperModalProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
imageSrc: string;
|
|
4
|
+
fileType?: string;
|
|
5
|
+
fileName?: string;
|
|
6
|
+
aspect?: number;
|
|
7
|
+
title?: string;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onApply: (file: File) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const ImageCropperModal: ({ isOpen, imageSrc, fileType, fileName, aspect, title, onClose, onApply, }: ImageCropperModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export default ImageCropperModal;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type ImageValue = File | {
|
|
2
|
+
file?: File;
|
|
3
|
+
preview?: string;
|
|
4
|
+
} | string | null;
|
|
5
|
+
interface ImagePickerProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
value: ImageValue;
|
|
8
|
+
onChange: (file: File | null) => void;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
accept?: string;
|
|
11
|
+
aspect?: number | string;
|
|
12
|
+
id: string;
|
|
13
|
+
dragDrop?: boolean;
|
|
14
|
+
cropImage?: boolean;
|
|
15
|
+
name: string;
|
|
16
|
+
parentClass?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const ImagePicker: ({ label, value, onChange, required, accept, aspect, id, dragDrop, cropImage, name, parentClass, }: ImagePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default ImagePicker;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
value: any;
|
|
5
|
+
required: boolean;
|
|
6
|
+
parentClass?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
type: string;
|
|
9
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
10
|
+
negativeNumberAllow?: boolean;
|
|
11
|
+
defaultValue?: any;
|
|
12
|
+
field: Record<string, any>;
|
|
13
|
+
onChange: (value: any) => void;
|
|
14
|
+
mask?: string;
|
|
15
|
+
maskApplyOnValue?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
18
|
+
export { Input };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface InputLabelProps {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
infoText?: string;
|
|
6
|
+
}
|
|
7
|
+
export default function InputLabel({ label, required, infoText, }: InputLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface PhoneInputProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
value: string;
|
|
4
|
+
name: string;
|
|
5
|
+
parentClass?: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
search?: boolean;
|
|
11
|
+
countriesList?: boolean;
|
|
12
|
+
defaultCountry?: string;
|
|
13
|
+
}
|
|
14
|
+
export default function PhoneInput({ label, value, name, parentClass, onChange, disabled, required, placeholder, search, countriesList, defaultCountry, }: PhoneInputProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface RadioOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: any;
|
|
4
|
+
}
|
|
5
|
+
interface RadioProps {
|
|
6
|
+
value: any;
|
|
7
|
+
onChange: (value: any) => void;
|
|
8
|
+
text?: string;
|
|
9
|
+
options: RadioOption[];
|
|
10
|
+
label?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
name: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
parentClass?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const Radio: ({ value, onChange, text, options, label, required, name, disabled, parentClass, }: RadioProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default Radio;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface FieldConfig {
|
|
2
|
+
key: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
options?: any[];
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
rows?: number;
|
|
8
|
+
inputClass?: string;
|
|
9
|
+
search?: boolean;
|
|
10
|
+
accept?: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
minLength?: number;
|
|
14
|
+
dragDrop?: boolean;
|
|
15
|
+
parentClass?: string;
|
|
16
|
+
countriesList?: boolean;
|
|
17
|
+
defaultCountry?: string;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
dropdownMaxHeight?: number;
|
|
20
|
+
editorKey?: string;
|
|
21
|
+
fontFamily?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
negativeNumberAllow?: boolean;
|
|
24
|
+
defaultValue?: any;
|
|
25
|
+
renderCondition?: (formData: Record<string, any>) => boolean;
|
|
26
|
+
pattern?: string;
|
|
27
|
+
renderType?: string;
|
|
28
|
+
cropImage?: boolean;
|
|
29
|
+
aspectRatio?: number;
|
|
30
|
+
dependencyKey?: string;
|
|
31
|
+
mask?: string;
|
|
32
|
+
maskApplyOnValue?: boolean;
|
|
33
|
+
maxSize?: number;
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
36
|
+
interface RenderFieldsProps {
|
|
37
|
+
field: FieldConfig;
|
|
38
|
+
formData: Record<string, any>;
|
|
39
|
+
handleChange: (key: string, value: any) => void;
|
|
40
|
+
}
|
|
41
|
+
declare const RenderFields: ({ field, formData, handleChange }: RenderFieldsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
42
|
+
export default RenderFields;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface SelectOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: any;
|
|
5
|
+
}
|
|
6
|
+
interface SelectProps {
|
|
7
|
+
options: SelectOption[] | ((formData: Record<string, any>) => Promise<SelectOption[]> | SelectOption[]);
|
|
8
|
+
value: any;
|
|
9
|
+
defaultValue?: any;
|
|
10
|
+
onChange: (value: any) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
search?: boolean;
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
name: string;
|
|
18
|
+
parentClass?: string;
|
|
19
|
+
multiple?: boolean;
|
|
20
|
+
dropdownMaxHeight?: string | number;
|
|
21
|
+
formData: Record<string, any>;
|
|
22
|
+
dependencyKey?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Select: ({ options, value, defaultValue, onChange, placeholder, className, disabled, search, label, required, name, parentClass, multiple, dropdownMaxHeight, formData, dependencyKey, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default Select;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface SwitchProps {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
parentClass?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
value: boolean;
|
|
8
|
+
onChange: (checked: boolean) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
+
export { Switch };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
parentClass?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
9
|
+
export { TextArea };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface TinyEditorProps {
|
|
2
|
+
editorKey: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (content: string) => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
parentClass?: string;
|
|
9
|
+
height?: number;
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
plugins?: string[];
|
|
13
|
+
toolbar?: string;
|
|
14
|
+
menubar?: boolean;
|
|
15
|
+
fontFamily?: string;
|
|
16
|
+
initConfig?: Record<string, any>;
|
|
17
|
+
imageUploadHandler?: (blobInfo: any) => Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
declare const TinyEditor: ({ editorKey, value, onChange, label, required, placeholder, parentClass, height, inline, disabled, plugins, toolbar, menubar, fontFamily, initConfig, imageUploadHandler, }: TinyEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default TinyEditor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type MediaValue = File | {
|
|
2
|
+
file?: File;
|
|
3
|
+
preview?: string;
|
|
4
|
+
} | string | null;
|
|
5
|
+
interface VideoPickerProps {
|
|
6
|
+
label: string;
|
|
7
|
+
value: MediaValue;
|
|
8
|
+
onChange: (file: File | null) => void;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
accept?: string;
|
|
11
|
+
id: string;
|
|
12
|
+
dragDrop?: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
parentClass?: string;
|
|
15
|
+
maxSize?: number;
|
|
16
|
+
}
|
|
17
|
+
declare const VideoPicker: ({ label, value, onChange, required, accept, id, dragDrop, name, parentClass, maxSize, }: VideoPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default VideoPicker;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ActionButton {
|
|
3
|
+
type?: string;
|
|
4
|
+
variant?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
label?: string;
|
|
9
|
+
onClick?: (e?: React.MouseEvent, selectedItem?: any) => Promise<any> | any;
|
|
10
|
+
}
|
|
11
|
+
interface ModalProps {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
onClose: (resp?: any) => void;
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
title: React.ReactNode;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
size?: string;
|
|
18
|
+
actionButtons?: ActionButton[];
|
|
19
|
+
footerConfig?: any;
|
|
20
|
+
onFormSubmit?: (e?: any) => void;
|
|
21
|
+
onCancel?: () => void;
|
|
22
|
+
loadingBtn?: boolean;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
executeFunction?: (...args: any[]) => void;
|
|
25
|
+
selectedItem?: any;
|
|
26
|
+
}
|
|
27
|
+
declare const Modal: ({ isOpen, onClose, icon, title, children, size, actionButtons, onFormSubmit, loadingBtn, executeFunction, selectedItem, }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
+
export default Modal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface TableProps {
|
|
2
|
+
config: Record<string, any>;
|
|
3
|
+
setShowAdd: (value: boolean) => void;
|
|
4
|
+
title: string;
|
|
5
|
+
buttonText?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
showAddButton?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Table: ({ config, setShowAdd, title, buttonText, description, showAddButton, }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Table;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ImagePreviewProps {
|
|
2
|
+
src: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
setIsOpen: (value: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const ImagePreview: ({ src, alt, isOpen, setIsOpen, }: ImagePreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ImagePreview;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface SortOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
interface SortDropdownProps {
|
|
7
|
+
options: SortOption[];
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (value: string, option: SortOption | null) => void;
|
|
10
|
+
clearLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const SortDropdown: ({ options, value, onChange, clearLabel, }: SortDropdownProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export default SortDropdown;
|