plain-design 1.0.0-beta.96 → 1.0.0-beta.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "1.0.0-beta.96",
3
+ "version": "1.0.0-beta.98",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
6
  "module": "dist/plain-design.commonjs.min.js",
@@ -4,6 +4,7 @@
4
4
  border-radius: plv(box-size-normal-border-radius);
5
5
  position: relative;
6
6
  padding: 8px 16px;
7
+ line-height: initial;
7
8
 
8
9
  .alert-label {
9
10
  font-size: plv(font-size-small);
@@ -23,7 +24,7 @@
23
24
  position: absolute;
24
25
  width: $icon-width-normal;
25
26
  left: 0;
26
- top: 0.15em;
27
+ top: 0.075em;
27
28
  padding-top: inherit;
28
29
  display: inline-flex;
29
30
  align-items: center;
@@ -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!}/>}