mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
feat(materials): add className prop to JsonSchemaEditor and adjust button styling (#406)
This commit is contained in:
parent
7c43b0cfd0
commit
233b9befab
@ -38,6 +38,7 @@ export function JsonSchemaEditor(props: {
|
|||||||
value?: IJsonSchema;
|
value?: IJsonSchema;
|
||||||
onChange?: (value: IJsonSchema) => void;
|
onChange?: (value: IJsonSchema) => void;
|
||||||
config?: ConfigType;
|
config?: ConfigType;
|
||||||
|
className?: string;
|
||||||
}) {
|
}) {
|
||||||
const { value = { type: 'object' }, config = {}, onChange: onChangeProps } = props;
|
const { value = { type: 'object' }, config = {}, onChange: onChangeProps } = props;
|
||||||
const { propertyList, onAddProperty, onRemoveProperty, onEditProperty } = usePropertiesEdit(
|
const { propertyList, onAddProperty, onRemoveProperty, onEditProperty } = usePropertiesEdit(
|
||||||
@ -46,7 +47,7 @@ export function JsonSchemaEditor(props: {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<UIContainer>
|
<UIContainer className={props.className}>
|
||||||
<UIProperties>
|
<UIProperties>
|
||||||
{propertyList.map((_property, index) => (
|
{propertyList.map((_property, index) => (
|
||||||
<PropertyEdit
|
<PropertyEdit
|
||||||
@ -63,7 +64,12 @@ export function JsonSchemaEditor(props: {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</UIProperties>
|
</UIProperties>
|
||||||
<Button size="small" style={{ marginTop: 10 }} icon={<IconPlus />} onClick={onAddProperty}>
|
<Button
|
||||||
|
size="small"
|
||||||
|
style={{ marginTop: 10, marginLeft: 16 }}
|
||||||
|
icon={<IconPlus />}
|
||||||
|
onClick={onAddProperty}
|
||||||
|
>
|
||||||
{config?.addButtonText ?? 'Add'}
|
{config?.addButtonText ?? 'Add'}
|
||||||
</Button>
|
</Button>
|
||||||
</UIContainer>
|
</UIContainer>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user