Skip to content

Commit

Permalink
feat: allow style related props
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Woolum authored and cwoolum committed Nov 4, 2022
1 parent 45a2e81 commit 3921f71
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export declare type CustomDataFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: CustomDataFormInputValues) => CustomDataFormInputValues;
onValidate?: CustomDataFormValidationValues;
}>;
} & React.CSSProperties>;
export default function CustomDataForm(props: CustomDataFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -782,7 +782,7 @@ export declare type CustomDataFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: CustomDataFormInputValues) => CustomDataFormInputValues;
onValidate?: CustomDataFormValidationValues;
}>;
} & React.CSSProperties>;
export default function CustomDataForm(props: CustomDataFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -1187,7 +1187,7 @@ export declare type CustomDataFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: CustomDataFormInputValues) => CustomDataFormInputValues;
onValidate?: CustomDataFormValidationValues;
}>;
} & React.CSSProperties>;
export default function CustomDataForm(props: CustomDataFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -1740,7 +1740,7 @@ export declare type MyPostFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: MyPostFormInputValues) => MyPostFormInputValues;
onValidate?: MyPostFormValidationValues;
}>;
} & React.CSSProperties>;
export default function MyPostForm(props: MyPostFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -2305,7 +2305,7 @@ export declare type NestedJsonProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: NestedJsonInputValues) => NestedJsonInputValues;
onValidate?: NestedJsonValidationValues;
}>;
} & React.CSSProperties>;
export default function NestedJson(props: NestedJsonProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -2786,7 +2786,7 @@ export declare type NestedJsonProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: NestedJsonInputValues) => NestedJsonInputValues;
onValidate?: NestedJsonValidationValues;
}>;
} & React.CSSProperties>;
export default function NestedJson(props: NestedJsonProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -2962,7 +2962,7 @@ export declare type CustomWithSectionalElementsProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: CustomWithSectionalElementsInputValues) => CustomWithSectionalElementsInputValues;
onValidate?: CustomWithSectionalElementsValidationValues;
}>;
} & React.CSSProperties>;
export default function CustomWithSectionalElements(props: CustomWithSectionalElementsProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -3299,7 +3299,7 @@ export declare type MyPostFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: MyPostFormInputValues) => MyPostFormInputValues;
onValidate?: MyPostFormValidationValues;
}>;
} & React.CSSProperties>;
export default function MyPostForm(props: MyPostFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -3728,7 +3728,7 @@ export declare type MyPostFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: MyPostFormInputValues) => MyPostFormInputValues;
onValidate?: MyPostFormValidationValues;
}>;
} & React.CSSProperties>;
export default function MyPostForm(props: MyPostFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -4275,7 +4275,7 @@ export declare type MyFlexUpdateFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: MyFlexUpdateFormInputValues) => MyFlexUpdateFormInputValues;
onValidate?: MyFlexUpdateFormValidationValues;
}>;
} & React.CSSProperties>;
export default function MyFlexUpdateForm(props: MyFlexUpdateFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -4803,7 +4803,7 @@ export declare type BlogCreateFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: BlogCreateFormInputValues) => BlogCreateFormInputValues;
onValidate?: BlogCreateFormValidationValues;
}>;
} & React.CSSProperties>;
export default function BlogCreateForm(props: BlogCreateFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -5520,7 +5520,7 @@ export declare type InputGalleryCreateFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: InputGalleryCreateFormInputValues) => InputGalleryCreateFormInputValues;
onValidate?: InputGalleryCreateFormValidationValues;
}>;
} & React.CSSProperties>;
export default function InputGalleryCreateForm(props: InputGalleryCreateFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -6287,7 +6287,7 @@ export declare type InputGalleryUpdateFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: InputGalleryUpdateFormInputValues) => InputGalleryUpdateFormInputValues;
onValidate?: InputGalleryUpdateFormValidationValues;
}>;
} & React.CSSProperties>;
export default function InputGalleryUpdateForm(props: InputGalleryUpdateFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -6816,7 +6816,7 @@ export declare type MyFlexCreateFormProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: MyFlexCreateFormInputValues) => MyFlexCreateFormInputValues;
onValidate?: MyFlexCreateFormValidationValues;
}>;
} & React.CSSProperties>;
export default function MyFlexCreateForm(props: MyFlexCreateFormProps): React.ReactElement;
"
`;
Expand Down Expand Up @@ -7213,7 +7213,7 @@ export declare type PostCreateFormRowProps = React.PropsWithChildren<{
onCancel?: () => void;
onChange?: (fields: PostCreateFormRowInputValues) => PostCreateFormRowInputValues;
onValidate?: PostCreateFormRowValidationValues;
}>;
} & React.CSSProperties>;
export default function PostCreateFormRow(props: PostCreateFormRowProps): React.ReactElement;
"
`;
9 changes: 8 additions & 1 deletion packages/codegen-ui-react/lib/forms/react-form-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,14 @@ export abstract class ReactFormTemplateRenderer extends StudioTemplateRenderer<
factory.createIdentifier(formPropType),
undefined,
factory.createTypeReferenceNode(factory.createIdentifier('React.PropsWithChildren'), [
factory.createIntersectionTypeNode([escapeHatchTypeNode, buildFormPropNode(this.component, modelName)]),
factory.createIntersectionTypeNode([
escapeHatchTypeNode,
buildFormPropNode(this.component, modelName),
factory.createTypeReferenceNode(
factory.createQualifiedName(factory.createIdentifier('React'), factory.createIdentifier('CSSProperties')),
undefined,
),
]),
]),
),
];
Expand Down

0 comments on commit 3921f71

Please sign in to comment.