mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 22:49:26 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
2ddaeb62a6
@ -51,7 +51,7 @@ export const FormItem: any = withDynamicSchemaProps(
|
|||||||
const field = useField<Field>();
|
const field = useField<Field>();
|
||||||
const schema = useFieldSchema();
|
const schema = useFieldSchema();
|
||||||
const { addActiveFieldName } = useFormActiveFields() || {};
|
const { addActiveFieldName } = useFormActiveFields() || {};
|
||||||
const { wrapperStyle } = useDataFormItemProps();
|
const { wrapperStyle }: { wrapperStyle: any } = useDataFormItemProps();
|
||||||
|
|
||||||
useParseDefaultValue();
|
useParseDefaultValue();
|
||||||
useLazyLoadDisplayAssociationFieldsOfForm();
|
useLazyLoadDisplayAssociationFieldsOfForm();
|
||||||
@ -95,7 +95,15 @@ export const FormItem: any = withDynamicSchemaProps(
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<ACLCollectionFieldProvider>
|
<ACLCollectionFieldProvider>
|
||||||
<Item className={className} {...props} extra={extra} wrapperStyle={wrapperStyle} />
|
<Item
|
||||||
|
className={className}
|
||||||
|
{...props}
|
||||||
|
extra={extra}
|
||||||
|
wrapperStyle={{
|
||||||
|
...(wrapperStyle.backgroundColor ? { paddingLeft: '5px', paddingRight: '5px' } : {}),
|
||||||
|
...wrapperStyle,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</ACLCollectionFieldProvider>
|
</ACLCollectionFieldProvider>
|
||||||
</BlockItem>
|
</BlockItem>
|
||||||
</CollectionFieldProvider>
|
</CollectionFieldProvider>
|
||||||
|
@ -602,12 +602,16 @@ const InternalBodyCellComponent = React.memo<BodyCellComponentProps>((props) =>
|
|||||||
const { record, schema, rowIndex, isSubTable, ...others } = props;
|
const { record, schema, rowIndex, isSubTable, ...others } = props;
|
||||||
const styleRules = schema?.[LinkageRuleDataKeyMap['style']];
|
const styleRules = schema?.[LinkageRuleDataKeyMap['style']];
|
||||||
const [dynamicStyle, setDynamicStyle] = useState({});
|
const [dynamicStyle, setDynamicStyle] = useState({});
|
||||||
|
const isReadyPrettyMode =
|
||||||
|
!!schema?.properties && Object.values(schema.properties).some((item) => item['x-read-pretty'] === true);
|
||||||
const style = useMemo(() => ({ ...props.style, ...dynamicStyle }), [props.style, dynamicStyle]);
|
const style = useMemo(() => ({ ...props.style, ...dynamicStyle }), [props.style, dynamicStyle]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* To improve rendering performance, do not render GetStyleRules component when no style rules are set */}
|
{/* To improve rendering performance, do not render GetStyleRules component when no style rules are set */}
|
||||||
{!_.isEmpty(styleRules) && <GetStyleRules record={record} schema={schema} onStyleChange={setDynamicStyle} />}
|
{!_.isEmpty(styleRules) && (
|
||||||
|
<GetStyleRules record={record} schema={schema} onStyleChange={isReadyPrettyMode ? setDynamicStyle : _.noop} />
|
||||||
|
)}
|
||||||
<td {...others} className={classNames(props.className, cellClass)} style={style}>
|
<td {...others} className={classNames(props.className, cellClass)} style={style}>
|
||||||
{props.children}
|
{props.children}
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user