@measured/puck 0.14.0-canary.3816c08 → 0.14.0-canary.3df6d96

Sign up to get free protection for your applications and to get access to all the features.
@@ -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;
@@ -92,11 +91,15 @@ type ExternalField<Props extends {
92
91
  placeholder?: string;
93
92
  fetchList: (params: {
94
93
  query: string;
94
+ filters: Record<string, any>;
95
95
  }) => Promise<any[] | null>;
96
96
  mapProp?: (value: any) => Props;
97
+ mapRow?: (value: any) => Record<string, string | number>;
97
98
  getItemSummary: (item: Props, index?: number) => string;
98
99
  showSearch?: boolean;
99
100
  initialQuery?: string;
101
+ filterFields?: Record<string, Field>;
102
+ initialFilters?: Record<string, any>;
100
103
  };
101
104
  type CustomField<Props extends {
102
105
  [key: string]: any;