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,58 @@
|
|
|
1
|
+
interface SortOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
key: string;
|
|
5
|
+
order: "asc" | "desc";
|
|
6
|
+
type?: string;
|
|
7
|
+
}
|
|
8
|
+
interface FieldRule {
|
|
9
|
+
key?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
}
|
|
13
|
+
interface SortChangePayload {
|
|
14
|
+
value: string;
|
|
15
|
+
option: SortOption | null;
|
|
16
|
+
key: string;
|
|
17
|
+
order: string;
|
|
18
|
+
type: string;
|
|
19
|
+
}
|
|
20
|
+
interface SortConfig {
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
useServerSideSorting?: boolean;
|
|
23
|
+
options?: SortOption[];
|
|
24
|
+
fields?: (string | FieldRule)[];
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
autoGenerate?: boolean;
|
|
27
|
+
clearLabel?: string;
|
|
28
|
+
onChange?: ((payload: SortChangePayload) => void) | null;
|
|
29
|
+
}
|
|
30
|
+
interface NormalizedSortConfig {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
useServerSideSorting: boolean;
|
|
33
|
+
options: SortOption[];
|
|
34
|
+
fields: (string | FieldRule)[];
|
|
35
|
+
defaultValue: string;
|
|
36
|
+
autoGenerate: boolean;
|
|
37
|
+
clearLabel: string;
|
|
38
|
+
onChange: ((payload: SortChangePayload) => void) | null;
|
|
39
|
+
}
|
|
40
|
+
interface TableColumn {
|
|
41
|
+
key: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
sortKey?: string;
|
|
45
|
+
sortType?: string;
|
|
46
|
+
sortLabel?: string;
|
|
47
|
+
titleKey?: string;
|
|
48
|
+
chipOptions?: Array<{
|
|
49
|
+
value: any;
|
|
50
|
+
label: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
export declare const normalizeSortConfig: (sortConfig: boolean | SortConfig | null | undefined) => NormalizedSortConfig;
|
|
54
|
+
export declare const getSortableColumns: (tableHead?: TableColumn[]) => TableColumn[];
|
|
55
|
+
export declare const buildDefaultSortOptions: (columns?: TableColumn[]) => SortOption[];
|
|
56
|
+
export declare const getNormalizedSortOptions: (normalizedSortConfig: NormalizedSortConfig, sortableColumns?: TableColumn[]) => SortOption[];
|
|
57
|
+
export declare const sortTableData: (filteredData: any[] | undefined, sortBy: string | undefined, normalizedSortConfig: NormalizedSortConfig | null, normalizedSortOptions?: SortOption[]) => any[];
|
|
58
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-admin-crud-manager",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A reusable React CRUD admin template with modular components.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.es.js",
|
|
11
|
-
"require": "./dist/index.cjs.js"
|
|
11
|
+
"require": "./dist/index.cjs.js",
|
|
12
|
+
"types": "./dist/types/index.d.ts"
|
|
12
13
|
},
|
|
13
14
|
"./dist/tailwind.css": "./dist/tailwind.css"
|
|
14
15
|
},
|
|
@@ -36,6 +37,8 @@
|
|
|
36
37
|
"scripts": {
|
|
37
38
|
"dev": "vite",
|
|
38
39
|
"build": "vite build && node build-css.js",
|
|
40
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
41
|
+
"build:all": "npm run build && npm run build:types",
|
|
39
42
|
"preview": "vite preview"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
@@ -53,6 +56,7 @@
|
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
55
58
|
"@types/react": "^19.2.14",
|
|
59
|
+
"@types/react-dom": "^19.2.3",
|
|
56
60
|
"@vitejs/plugin-react": "^4.2.1",
|
|
57
61
|
"autoprefixer": "10.4.15",
|
|
58
62
|
"tailwindcss": "3.3.3",
|