@measured/puck 0.14.0-canary.55740c4 → 0.14.0-canary.5bb1708

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,6 +55,8 @@ type ArrayField<Props extends {
55
55
  };
56
56
  defaultItemProps?: Props[0];
57
57
  getItemSummary?: (item: Props[0], index?: number) => string;
58
+ max?: number;
59
+ min?: number;
58
60
  };
59
61
  type ObjectField<Props extends {
60
62
  [key: string]: any;
@@ -63,7 +65,7 @@ type ObjectField<Props extends {
63
65
  }> = BaseField & {
64
66
  type: "object";
65
67
  objectFields: {
66
- [SubPropName in keyof Props[0]]: Field<Props[0][SubPropName]>;
68
+ [SubPropName in keyof Props]: Field<Props[SubPropName]>;
67
69
  };
68
70
  };
69
71
  type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
@@ -91,11 +93,15 @@ type ExternalField<Props extends {
91
93
  placeholder?: string;
92
94
  fetchList: (params: {
93
95
  query: string;
96
+ filters: Record<string, any>;
94
97
  }) => Promise<any[] | null>;
95
98
  mapProp?: (value: any) => Props;
99
+ mapRow?: (value: any) => Record<string, string | number>;
96
100
  getItemSummary: (item: Props, index?: number) => string;
97
101
  showSearch?: boolean;
98
102
  initialQuery?: string;
103
+ filterFields?: Record<string, Field>;
104
+ initialFilters?: Record<string, any>;
99
105
  };
100
106
  type CustomField<Props extends {
101
107
  [key: string]: any;
@@ -140,6 +146,7 @@ type PuckContext = {
140
146
  };
141
147
  type ComponentConfig<ComponentProps extends DefaultComponentProps = DefaultComponentProps, DefaultProps = ComponentProps, DataShape = ComponentData<ComponentProps>> = {
142
148
  render: PuckComponent<ComponentProps>;
149
+ label?: string;
143
150
  defaultProps?: DefaultProps;
144
151
  fields?: Fields<ComponentProps>;
145
152
  resolveData?: (data: DataShape, params: {