adminforth 1.0.73 → 1.0.75

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.
@@ -1,4 +1,23 @@
1
- import AdminForthPlugin from '../plugins/base.js';
1
+
2
+
3
+ export interface CodeInjector {
4
+ srcFoldersToSync: Object;
5
+ allComponentNames: Object;
6
+ }
7
+
8
+ export interface AdminForthClass {
9
+ config: AdminForthConfig;
10
+ codeInjector: CodeInjector;
11
+ }
12
+
13
+
14
+ export interface AdminForthPluginType {
15
+ adminforth: AdminForthClass;
16
+ pluginDir: string;
17
+ customFolderName: string;
18
+ modifyResourceConfig(adminforth: AdminForthClass, resourceConfig: AdminForthResource): void;
19
+ componentPath(componentFile: string): string;
20
+ }
2
21
 
3
22
  export type AdminForthConfigMenuItem = {
4
23
  type?: 'heading' | 'group' | 'resource' | 'page' | 'gap' | 'divider',
@@ -20,7 +39,7 @@ export type AdminForthConfigMenuItem = {
20
39
  export type AdminForthResourceColumn = {
21
40
  name: string,
22
41
  label?: string,
23
- type?: AdminForthTypesValues,
42
+ type?: AdminForthDataTypes,
24
43
  primaryKey?: boolean,
25
44
  required?: boolean | { create: boolean, edit: boolean },
26
45
  editingNote?: string | { create: string, edit: string },
@@ -48,8 +67,9 @@ export type AdminForthResource = {
48
67
  table: string,
49
68
  dataSource: string,
50
69
  columns: Array<AdminForthResourceColumn>,
70
+ dataSourceColumns?: Array<AdminForthResourceColumn>,
51
71
  itemLabel?: Function,
52
- plugins?: Array<AdminForthPlugin>,
72
+ plugins?: Array<AdminForthPluginType>,
53
73
  hooks?: {
54
74
  show?: {
55
75
  beforeDatasourceRequest?: Function | Array<Function>,
@@ -153,18 +173,37 @@ export type AdminForthResourceColumnComponent = {
153
173
  list?: string,
154
174
  }
155
175
 
176
+ export enum AdminForthDataTypes {
177
+ STRING = 'string',
178
+ INTEGER = 'integer',
179
+ FLOAT = 'float',
180
+ DECIMAL = 'decimal',
181
+ BOOLEAN = 'boolean',
182
+ DATE = 'date',
183
+ DATETIME = 'datetime',
184
+ TIME = 'time',
185
+ TEXT = 'text',
186
+ JSON = 'json',
187
+ }
188
+
189
+ export enum AdminForthFilterOperators {
190
+ EQ = 'eq',
191
+ NE = 'ne',
192
+ GT = 'gt',
193
+ LT = 'lt',
194
+ GTE = 'gte',
195
+ LTE = 'lte',
196
+ LIKE = 'like',
197
+ ILIKE = 'ilike',
198
+ IN = 'in',
199
+ NIN = 'nin',
200
+ };
201
+
202
+ export enum AdminForthSortDirections {
203
+ ASC = 'asc',
204
+ DESC = 'desc',
205
+ };
156
206
 
157
- export type AdminForthTypesValues =
158
- | 'string'
159
- | 'integer'
160
- | 'float'
161
- | 'decimal'
162
- | 'boolean'
163
- | 'date'
164
- | 'datetime'
165
- | 'time'
166
- | 'text'
167
- | 'json';
168
207
 
169
208
  export type AdminForthResourceColumnEnumElement = {
170
209
  value: string | null,
package/types.ts DELETED
@@ -1,36 +0,0 @@
1
-
2
-
3
- // typical types which AdminForth supports
4
- //
5
- export const AdminForthTypes = {
6
- STRING: 'string',
7
- INTEGER: 'integer',
8
- FLOAT: 'float',
9
- DECIMAL: 'decimal',
10
- BOOLEAN: 'boolean',
11
- DATE: 'date',
12
- DATETIME: 'datetime',
13
- TIME: 'time',
14
- TEXT: 'text',
15
- JSON: 'json',
16
- }
17
-
18
- export type AdminForthTypesValues = keyof typeof AdminForthTypes;
19
-
20
- export const AdminForthFilterOperators = {
21
- EQ: 'eq',
22
- NE: 'ne',
23
- GT: 'gt',
24
- LT: 'lt',
25
- GTE: 'gte',
26
- LTE: 'lte',
27
- LIKE: 'like',
28
- ILIKE: 'ilike',
29
- IN: 'in',
30
- NIN: 'nin',
31
- };
32
-
33
- export const AdminForthSortDirections = {
34
- ASC: 'asc',
35
- DESC: 'desc',
36
- };