admin_lsac 1.4.8 → 1.4.9
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/.eslintrc.cjs +1 -1
- package/admin_lsac.d.ts +68 -0
- package/dist/esm/src/admin_lsac.d.ts +68 -0
- package/package.json +1 -1
package/.eslintrc.cjs
CHANGED
|
@@ -6,7 +6,7 @@ module.exports = {
|
|
|
6
6
|
'plugin:@typescript-eslint/recommended',
|
|
7
7
|
'plugin:react-hooks/recommended',
|
|
8
8
|
],
|
|
9
|
-
ignorePatterns: ['dist', '.eslintrc.cjs', 'src/testSchemas'],
|
|
9
|
+
ignorePatterns: ['dist', '.eslintrc.cjs', 'src/testSchemas', 'admin_lsac.d.ts'],
|
|
10
10
|
parser: '@typescript-eslint/parser',
|
|
11
11
|
plugins: ['react-refresh'],
|
|
12
12
|
rules: {
|
package/admin_lsac.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare module 'admin_lsac' {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface TableField {
|
|
4
|
+
name: string;
|
|
5
|
+
access: (obj: any) => string | number | React.ReactElement;
|
|
6
|
+
}
|
|
7
|
+
export interface SimpleField {
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type: 'string' | 'number' | 'file';
|
|
11
|
+
validationSchema: any;
|
|
12
|
+
}
|
|
13
|
+
export interface Option {
|
|
14
|
+
value: string | number | boolean;
|
|
15
|
+
display: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DropdownField {
|
|
18
|
+
name: string;
|
|
19
|
+
label: string;
|
|
20
|
+
type: 'dropdown';
|
|
21
|
+
options?: Option[] | undefined;
|
|
22
|
+
getOptions: () => Promise<Option[]>;
|
|
23
|
+
}
|
|
24
|
+
export interface ObjectField {
|
|
25
|
+
name: string;
|
|
26
|
+
label: string;
|
|
27
|
+
type: 'object';
|
|
28
|
+
fields: FormField[];
|
|
29
|
+
}
|
|
30
|
+
export interface ArrayField {
|
|
31
|
+
name: string;
|
|
32
|
+
label: string;
|
|
33
|
+
type: 'array';
|
|
34
|
+
element: Exclude<FormField, ArrayField>;
|
|
35
|
+
}
|
|
36
|
+
export type FormField = SimpleField | DropdownField | ObjectField | ArrayField;
|
|
37
|
+
export interface Action {
|
|
38
|
+
name: string;
|
|
39
|
+
fields?: FormField[];
|
|
40
|
+
onSubmit: (obj1: any, obj2?: any) => Promise<any>;
|
|
41
|
+
}
|
|
42
|
+
export interface RowAction {
|
|
43
|
+
name: string;
|
|
44
|
+
fields?: FormField[];
|
|
45
|
+
initialise?: (obj: any) => any;
|
|
46
|
+
onSubmit: (obj1: any, obj2?: any) => Promise<any>;
|
|
47
|
+
}
|
|
48
|
+
export interface PageSchema {
|
|
49
|
+
name: string;
|
|
50
|
+
actions: Action[];
|
|
51
|
+
rowActions: RowAction[];
|
|
52
|
+
getRequest: () => Promise<any[]>;
|
|
53
|
+
tableFields: TableField[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function pageToUrl(page: PageSchema): string;
|
|
57
|
+
export function AdminPage({
|
|
58
|
+
pages,
|
|
59
|
+
selectedPage,
|
|
60
|
+
basePath,
|
|
61
|
+
apiURL,
|
|
62
|
+
}: {
|
|
63
|
+
pages: PageSchema[];
|
|
64
|
+
selectedPage: PageSchema;
|
|
65
|
+
basePath: string;
|
|
66
|
+
apiURL?: string;
|
|
67
|
+
}): import('react/jsx-runtime').JSX.Element;
|
|
68
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare module 'admin_lsac' {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface TableField {
|
|
4
|
+
name: string;
|
|
5
|
+
access: (obj: any) => string | number | React.ReactElement;
|
|
6
|
+
}
|
|
7
|
+
export interface SimpleField {
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type: 'string' | 'number' | 'file';
|
|
11
|
+
validationSchema: any;
|
|
12
|
+
}
|
|
13
|
+
export interface Option {
|
|
14
|
+
value: string | number | boolean;
|
|
15
|
+
display: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DropdownField {
|
|
18
|
+
name: string;
|
|
19
|
+
label: string;
|
|
20
|
+
type: 'dropdown';
|
|
21
|
+
options?: Option[] | undefined;
|
|
22
|
+
getOptions: () => Promise<Option[]>;
|
|
23
|
+
}
|
|
24
|
+
export interface ObjectField {
|
|
25
|
+
name: string;
|
|
26
|
+
label: string;
|
|
27
|
+
type: 'object';
|
|
28
|
+
fields: FormField[];
|
|
29
|
+
}
|
|
30
|
+
export interface ArrayField {
|
|
31
|
+
name: string;
|
|
32
|
+
label: string;
|
|
33
|
+
type: 'array';
|
|
34
|
+
element: Exclude<FormField, ArrayField>;
|
|
35
|
+
}
|
|
36
|
+
export type FormField = SimpleField | DropdownField | ObjectField | ArrayField;
|
|
37
|
+
export interface Action {
|
|
38
|
+
name: string;
|
|
39
|
+
fields?: FormField[];
|
|
40
|
+
onSubmit: (obj1: any, obj2?: any) => Promise<any>;
|
|
41
|
+
}
|
|
42
|
+
export interface RowAction {
|
|
43
|
+
name: string;
|
|
44
|
+
fields?: FormField[];
|
|
45
|
+
initialise?: (obj: any) => any;
|
|
46
|
+
onSubmit: (obj1: any, obj2?: any) => Promise<any>;
|
|
47
|
+
}
|
|
48
|
+
export interface PageSchema {
|
|
49
|
+
name: string;
|
|
50
|
+
actions: Action[];
|
|
51
|
+
rowActions: RowAction[];
|
|
52
|
+
getRequest: () => Promise<any[]>;
|
|
53
|
+
tableFields: TableField[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function pageToUrl(page: PageSchema): string;
|
|
57
|
+
export function AdminPage({
|
|
58
|
+
pages,
|
|
59
|
+
selectedPage,
|
|
60
|
+
basePath,
|
|
61
|
+
apiURL,
|
|
62
|
+
}: {
|
|
63
|
+
pages: PageSchema[];
|
|
64
|
+
selectedPage: PageSchema;
|
|
65
|
+
basePath: string;
|
|
66
|
+
apiURL?: string;
|
|
67
|
+
}): import('react/jsx-runtime').JSX.Element;
|
|
68
|
+
}
|