@measured/puck 0.14.0-canary.de9c2c4 → 0.14.0-canary.e8991cc
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/{Config-1b86f0dc.d.ts → Config-bb4b39cd.d.ts} +14 -9
- package/dist/index.css +791 -539
- package/dist/index.d.ts +32 -4
- package/dist/index.js +181 -113
- package/dist/rsc.d.ts +1 -1
- package/package.json +7 -2
@@ -17,6 +17,11 @@ declare function DropZone(props: DropZoneProps): react_jsx_runtime.JSX.Element;
|
|
17
17
|
type WithPuckProps<Props> = Props & {
|
18
18
|
id: string;
|
19
19
|
};
|
20
|
+
type FieldOption = {
|
21
|
+
label: string;
|
22
|
+
value: string | number | boolean;
|
23
|
+
};
|
24
|
+
type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
|
20
25
|
type BaseField = {
|
21
26
|
label?: string;
|
22
27
|
};
|
@@ -33,17 +38,11 @@ type TextareaField = BaseField & {
|
|
33
38
|
};
|
34
39
|
type SelectField = BaseField & {
|
35
40
|
type: "select";
|
36
|
-
options:
|
37
|
-
label: string;
|
38
|
-
value: string | number | boolean;
|
39
|
-
}[];
|
41
|
+
options: FieldOptions;
|
40
42
|
};
|
41
43
|
type RadioField = BaseField & {
|
42
44
|
type: "radio";
|
43
|
-
options:
|
44
|
-
label: string;
|
45
|
-
value: string | number | boolean;
|
46
|
-
}[];
|
45
|
+
options: FieldOptions;
|
47
46
|
};
|
48
47
|
type ArrayField<Props extends {
|
49
48
|
[key: string]: any;
|
@@ -56,6 +55,8 @@ type ArrayField<Props extends {
|
|
56
55
|
};
|
57
56
|
defaultItemProps?: Props[0];
|
58
57
|
getItemSummary?: (item: Props[0], index?: number) => string;
|
58
|
+
max?: number;
|
59
|
+
min?: number;
|
59
60
|
};
|
60
61
|
type ObjectField<Props extends {
|
61
62
|
[key: string]: any;
|
@@ -64,7 +65,7 @@ type ObjectField<Props extends {
|
|
64
65
|
}> = BaseField & {
|
65
66
|
type: "object";
|
66
67
|
objectFields: {
|
67
|
-
[SubPropName in keyof Props
|
68
|
+
[SubPropName in keyof Props]: Field<Props[SubPropName]>;
|
68
69
|
};
|
69
70
|
};
|
70
71
|
type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
|
@@ -92,11 +93,15 @@ type ExternalField<Props extends {
|
|
92
93
|
placeholder?: string;
|
93
94
|
fetchList: (params: {
|
94
95
|
query: string;
|
96
|
+
filters: Record<string, any>;
|
95
97
|
}) => Promise<any[] | null>;
|
96
98
|
mapProp?: (value: any) => Props;
|
99
|
+
mapRow?: (value: any) => Record<string, string | number>;
|
97
100
|
getItemSummary: (item: Props, index?: number) => string;
|
98
101
|
showSearch?: boolean;
|
99
102
|
initialQuery?: string;
|
103
|
+
filterFields?: Record<string, Field>;
|
104
|
+
initialFilters?: Record<string, any>;
|
100
105
|
};
|
101
106
|
type CustomField<Props extends {
|
102
107
|
[key: string]: any;
|