mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 06:29:25 +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 schema = useFieldSchema();
|
||||
const { addActiveFieldName } = useFormActiveFields() || {};
|
||||
const { wrapperStyle } = useDataFormItemProps();
|
||||
const { wrapperStyle }: { wrapperStyle: any } = useDataFormItemProps();
|
||||
|
||||
useParseDefaultValue();
|
||||
useLazyLoadDisplayAssociationFieldsOfForm();
|
||||
@ -95,7 +95,15 @@ export const FormItem: any = withDynamicSchemaProps(
|
||||
)}
|
||||
>
|
||||
<ACLCollectionFieldProvider>
|
||||
<Item className={className} {...props} extra={extra} wrapperStyle={wrapperStyle} />
|
||||
<Item
|
||||
className={className}
|
||||
{...props}
|
||||
extra={extra}
|
||||
wrapperStyle={{
|
||||
...(wrapperStyle.backgroundColor ? { paddingLeft: '5px', paddingRight: '5px' } : {}),
|
||||
...wrapperStyle,
|
||||
}}
|
||||
/>
|
||||
</ACLCollectionFieldProvider>
|
||||
</BlockItem>
|
||||
</CollectionFieldProvider>
|
||||
|
@ -602,12 +602,16 @@ const InternalBodyCellComponent = React.memo<BodyCellComponentProps>((props) =>
|
||||
const { record, schema, rowIndex, isSubTable, ...others } = props;
|
||||
const styleRules = schema?.[LinkageRuleDataKeyMap['style']];
|
||||
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]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* 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}>
|
||||
{props.children}
|
||||
</td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user