plain-design 1.0.0-beta.97 → 1.0.0-beta.98
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -70,6 +70,7 @@ export const FormItemLayoutPropsOption = {
|
|
70
70
|
singleColumnContentWidth: { type: Number }, // 单列的时候form item content的宽度
|
71
71
|
colon: { type: Boolean as PropType<boolean | null>, default: null }, // label的冒号
|
72
72
|
validateMessagePosition: { type: String as PropType<typeof FormValidateMessagePosition.TYPE> }, // 校验消息的位置
|
73
|
+
negativeInnerMarginTop: { type: Boolean }, // inner节点启用负的marginTop值
|
73
74
|
} as const;
|
74
75
|
|
75
76
|
/**
|
@@ -287,6 +288,10 @@ export const useFormLayout = (() => {
|
|
287
288
|
}
|
288
289
|
});
|
289
290
|
|
291
|
+
const contentInnerStyles = useStyles(style => {
|
292
|
+
if (props.negativeInnerMarginTop) {style.marginTop = `-${form.rowGutter.value}px`;}
|
293
|
+
});
|
294
|
+
|
290
295
|
const refer = {
|
291
296
|
colon,
|
292
297
|
labelAlign,
|
@@ -294,6 +299,7 @@ export const useFormLayout = (() => {
|
|
294
299
|
styles,
|
295
300
|
labelStyles,
|
296
301
|
contentStyles,
|
302
|
+
contentInnerStyles,
|
297
303
|
form,
|
298
304
|
validateMessagePosition,
|
299
305
|
};
|
@@ -108,7 +108,7 @@ export const FormItem = designComponent({
|
|
108
108
|
)}
|
109
109
|
<div className="form-item-content box-message-reference" style={formItemLayout.contentStyles.value}>
|
110
110
|
{slots.prepend.isExist() && <div className="form-item-prepend-content">{slots.prepend()}</div>}
|
111
|
-
<div className="form-item-content-inner">
|
111
|
+
<div className="form-item-content-inner" style={formItemLayout.contentInnerStyles.value}>
|
112
112
|
<Fragment key="slot_default">{slots.default()}</Fragment>
|
113
113
|
{/*校验消息放下边的时候放在 form-item-content-inner 内部使得与输入框左或者右对齐*/}
|
114
114
|
{formItemLayout.validateMessagePosition.value !== 'right' && <FormItemValidateMessage message={formItemValidation.validateMessage.value!}/>}
|