@forestadmin/datasource-customizer 1.14.0 → 1.15.0-alpha-widgets.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.
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CompositeId, Json } from '@forestadmin/datasource-toolkit';
|
|
2
|
+
type DropdownOption<TValue = string> = {
|
|
3
|
+
value: TValue | null;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
2
6
|
export type ValueOrHandler<Context = unknown, Result = unknown> = ((context: Context) => Promise<Result>) | ((context: Context) => Result) | Promise<Result> | Result;
|
|
3
7
|
interface BaseDynamicField<Type, Context, Result> {
|
|
4
8
|
type: Type;
|
|
@@ -27,6 +31,12 @@ type NumberDynamicField<Context> = BaseDynamicField<'Number', Context, number>;
|
|
|
27
31
|
type NumberListDynamicField<Context> = BaseDynamicField<'NumberList', Context, number[]>;
|
|
28
32
|
type StringDynamicField<Context> = BaseDynamicField<'Date' | 'Dateonly' | 'String', Context, string>;
|
|
29
33
|
type StringListDynamicField<Context> = BaseDynamicField<'StringList', Context, string[]>;
|
|
30
|
-
|
|
34
|
+
interface DropdownDynamicFieldConfiguration<TValue = string> {
|
|
35
|
+
widget: 'Dropdown';
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
search?: 'static' | 'disabled';
|
|
38
|
+
options: DropdownOption<TValue>[];
|
|
39
|
+
}
|
|
40
|
+
export type DynamicField<Context = unknown> = BooleanDynamicField<Context> | CollectionDynamicField<Context> | EnumDynamicField<Context> | EnumListDynamicField<Context> | FileDynamicField<Context> | FileListDynamicField<Context> | JsonDynamicField<Context> | NumberDynamicField<Context> | (NumberDynamicField<Context> & DropdownDynamicFieldConfiguration<number>) | NumberListDynamicField<Context> | StringDynamicField<Context> | (StringDynamicField<Context> & DropdownDynamicFieldConfiguration<string>) | StringListDynamicField<Context>;
|
|
31
41
|
export {};
|
|
32
42
|
//# sourceMappingURL=fields.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forestadmin/datasource-customizer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0-alpha-widgets.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/uuid": "^9.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@forestadmin/datasource-toolkit": "1.
|
|
31
|
+
"@forestadmin/datasource-toolkit": "1.9.0-alpha-widgets.1",
|
|
32
32
|
"file-type": "^16.5.4",
|
|
33
33
|
"luxon": "^3.2.1",
|
|
34
34
|
"object-hash": "^3.0.0",
|