adminforth 1.0.31 → 1.0.33
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/dataConnectors/postgres.ts +9 -6
- package/dataConnectors/sqlite.ts +1 -0
- package/dist/dataConnectors/postgres.js +9 -6
- package/dist/dataConnectors/sqlite.js +1 -0
- package/dist/index.js +87 -65
- package/dist/modules/utils.js +9 -0
- package/dist/spa/spa/src/App.vue +0 -7
- package/dist/spa/spa/src/components/CustomDatePicker.vue +3 -3
- package/dist/spa/spa/src/components/CustomDateRangePicker.vue +3 -3
- package/dist/spa/spa/src/components/CustomRangePicker.vue +32 -19
- package/dist/spa/spa/src/components/Dropdown.vue +6 -2
- package/dist/spa/spa/src/components/ResourceForm.vue +125 -102
- package/dist/spa/spa/src/components/ValueRenderer.vue +11 -1
- package/dist/spa/spa/src/stores/core.ts +21 -19
- package/dist/spa/spa/src/views/CreateView.vue +16 -6
- package/dist/spa/spa/src/views/EditView.vue +15 -5
- package/dist/spa/spa/src/views/ListView.vue +31 -21
- package/dist/spa/spa/src/views/ResourceParent.vue +1 -1
- package/dist/spa/spa/src/views/ShowView.vue +21 -6
- package/dist/types/AdminForthConfig.js +1 -0
- package/index.ts +73 -141
- package/modules/utils.ts +14 -0
- package/package.json +1 -1
- package/spa/src/App.vue +0 -7
- package/spa/src/components/CustomDatePicker.vue +3 -3
- package/spa/src/components/CustomDateRangePicker.vue +3 -3
- package/spa/src/components/CustomRangePicker.vue +32 -19
- package/spa/src/components/Dropdown.vue +6 -2
- package/spa/src/components/ResourceForm.vue +125 -102
- package/spa/src/components/ValueRenderer.vue +11 -1
- package/spa/src/stores/core.ts +21 -19
- package/spa/src/views/CreateView.vue +16 -6
- package/spa/src/views/EditView.vue +15 -5
- package/spa/src/views/ListView.vue +31 -21
- package/spa/src/views/ResourceParent.vue +1 -1
- package/spa/src/views/ShowView.vue +21 -6
- package/types/AdminForthConfig.ts +159 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export type AdminForthConfigMenuItem = {
|
|
4
|
+
label: string,
|
|
5
|
+
icon?: string,
|
|
6
|
+
path?: string,
|
|
7
|
+
component?: string,
|
|
8
|
+
resourceId?: string,
|
|
9
|
+
homepage?: boolean,
|
|
10
|
+
children?: Array<AdminForthConfigMenuItem>,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export type AdminForthResourceColumn = {
|
|
15
|
+
name: string,
|
|
16
|
+
label?: string,
|
|
17
|
+
type?: AdminForthTypesValues,
|
|
18
|
+
primaryKey?: boolean,
|
|
19
|
+
required?: boolean | { create: boolean, edit: boolean },
|
|
20
|
+
editingNote?: string | { create: string, edit: string },
|
|
21
|
+
showIn?: Array<string>,
|
|
22
|
+
fillOnCreate?: Function,
|
|
23
|
+
isUnique?: boolean,
|
|
24
|
+
virtual?: boolean,
|
|
25
|
+
allowMinMaxQuery?: boolean,
|
|
26
|
+
component?: AdminForthResourceColumnComponent
|
|
27
|
+
maxLength?: number,
|
|
28
|
+
minLength?: number,
|
|
29
|
+
min?: number,
|
|
30
|
+
max?: number,
|
|
31
|
+
minValue?: number,
|
|
32
|
+
maxValue?: number,
|
|
33
|
+
enum?: Array<AdminForthResourceColumnEnumElement>,
|
|
34
|
+
foreignResource?:AdminForthResourceColumnForeignResource,
|
|
35
|
+
sortable?: boolean,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type AdminForthResource = {
|
|
39
|
+
resourceId: string,
|
|
40
|
+
label?: string,
|
|
41
|
+
table: string,
|
|
42
|
+
dataSource: string,
|
|
43
|
+
columns: Array<AdminForthResourceColumn>,
|
|
44
|
+
itemLabel?: Function,
|
|
45
|
+
hooks?: {
|
|
46
|
+
show?: {
|
|
47
|
+
beforeDatasourceRequest?: Function,
|
|
48
|
+
afterDatasourceResponse?: Function,
|
|
49
|
+
},
|
|
50
|
+
list?: {
|
|
51
|
+
beforeDatasourceRequest?: Function,
|
|
52
|
+
afterDatasourceResponse?: Function,
|
|
53
|
+
},
|
|
54
|
+
create?: {
|
|
55
|
+
beforeSave?: Function,
|
|
56
|
+
afterSave?: Function,
|
|
57
|
+
},
|
|
58
|
+
edit?: {
|
|
59
|
+
beforeSave?: Function,
|
|
60
|
+
afterSave?: Function,
|
|
61
|
+
},
|
|
62
|
+
delete?: {
|
|
63
|
+
beforeSave?: Function,
|
|
64
|
+
afterSave?: Function,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
options?: {
|
|
68
|
+
bulkActions?: Array<{
|
|
69
|
+
label: string,
|
|
70
|
+
state: string,
|
|
71
|
+
icon: string,
|
|
72
|
+
action: Function,
|
|
73
|
+
id?: string,
|
|
74
|
+
}>,
|
|
75
|
+
allowedActions?: AllowedActions,
|
|
76
|
+
allowDelete?: boolean,
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type AdminForthDataSource = {
|
|
82
|
+
id: string,
|
|
83
|
+
url: string,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type AdminForthConfig = {
|
|
87
|
+
rootUser?: {
|
|
88
|
+
username: string,
|
|
89
|
+
password: string,
|
|
90
|
+
},
|
|
91
|
+
auth?: {
|
|
92
|
+
resourceId: string,
|
|
93
|
+
usernameField: string,
|
|
94
|
+
passwordHashField: string,
|
|
95
|
+
loginBackgroundImage?: string,
|
|
96
|
+
userFullNameField?: string,
|
|
97
|
+
},
|
|
98
|
+
resources: Array<AdminForthResource>,
|
|
99
|
+
menu: Array<AdminForthConfigMenuItem>,
|
|
100
|
+
databaseConnectors?: any,
|
|
101
|
+
dataSources: Array<DataSource>,
|
|
102
|
+
customization?: {
|
|
103
|
+
customComponentsDir?: string,
|
|
104
|
+
vueUsesFile?: string,
|
|
105
|
+
},
|
|
106
|
+
baseUrl?: string,
|
|
107
|
+
brandName?: string,
|
|
108
|
+
datesFormat?: string,
|
|
109
|
+
deleteConfirmation?: boolean,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type AllowedActions = {
|
|
113
|
+
create?: boolean,
|
|
114
|
+
edit?: boolean,
|
|
115
|
+
show?: boolean,
|
|
116
|
+
delete?: boolean,
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type ValidationObject = {
|
|
120
|
+
regExp: string,
|
|
121
|
+
message: string,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export type DataSource = {
|
|
125
|
+
id: string,
|
|
126
|
+
url: string,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type AdminForthResourceColumnComponent = {
|
|
130
|
+
show?: string,
|
|
131
|
+
create?: string,
|
|
132
|
+
edit?: string,
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
export type AdminForthTypesValues =
|
|
137
|
+
| 'string'
|
|
138
|
+
| 'integer'
|
|
139
|
+
| 'float'
|
|
140
|
+
| 'decimal'
|
|
141
|
+
| 'boolean'
|
|
142
|
+
| 'date'
|
|
143
|
+
| 'datetime'
|
|
144
|
+
| 'time'
|
|
145
|
+
| 'text'
|
|
146
|
+
| 'json';
|
|
147
|
+
|
|
148
|
+
export type AdminForthResourceColumnEnumElement = {
|
|
149
|
+
value: string | null,
|
|
150
|
+
label: string,
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export type AdminForthResourceColumnForeignResource = {
|
|
154
|
+
resourceId: string,
|
|
155
|
+
hooks?: {
|
|
156
|
+
beforeDatasourceRequest?: Function,
|
|
157
|
+
afterDatasourceResponse?: Function,
|
|
158
|
+
},
|
|
159
|
+
}
|