plain-design 1.0.0-beta.42 → 1.0.0-beta.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/dist/plain-design.commonjs.min.js +12 -3
  2. package/dist/plain-design.min.css +18 -17
  3. package/dist/plain-design.min.js +12 -3
  4. package/dist/report.html +2 -2
  5. package/package.json +44 -44
  6. package/src/packages/components/Application/theme/theme.ts +26 -14
  7. package/src/packages/components/AutoLoadingObserver/index.tsx +172 -0
  8. package/src/packages/components/AutoTable/auto-table.scss +19 -8
  9. package/src/packages/components/AutoTable/filter/useTableOption.filter.search.tsx +3 -3
  10. package/src/packages/components/AutoTable/use/useTableOption.fill.tsx +2 -1
  11. package/src/packages/components/AutoTable/use/useTableOption.loading.tsx +8 -2
  12. package/src/packages/components/AutoTable/use/useTableOption.pagination.tsx +5 -0
  13. package/src/packages/components/Button/button.scss +5 -5
  14. package/src/packages/components/Button/index.tsx +68 -10
  15. package/src/packages/components/Cascade/cascade.scss +2 -2
  16. package/src/packages/components/CascadePanel/flat/cascade-flat-panel.scss +21 -34
  17. package/src/packages/components/CheckboxInner/checkbox-inner.scss +1 -0
  18. package/src/packages/components/DatePicker/date.scss +1 -1
  19. package/src/packages/components/DatePicker/index.tsx +1 -1
  20. package/src/packages/components/Dialog/dialog.scss +4 -1
  21. package/src/packages/components/FilterFormSingle/index.tsx +7 -2
  22. package/src/packages/components/Form/form.scss +51 -1
  23. package/src/packages/components/Form/layout/useFormLayout.tsx +47 -13
  24. package/src/packages/components/Form/validate/useFormValidation.tsx +21 -16
  25. package/src/packages/components/FormItem/FormItemValidateMessage.tsx +16 -0
  26. package/src/packages/components/FormItem/index.tsx +24 -11
  27. package/src/packages/components/Icon/index.tsx +1 -1
  28. package/src/packages/components/Input/index.scss +17 -5
  29. package/src/packages/components/Input/useMultipleInput.tsx +1 -1
  30. package/src/packages/components/InputNumber/index.tsx +1 -1
  31. package/src/packages/components/InputNumber/number.scss +1 -1
  32. package/src/packages/components/Object/object.scss +9 -2
  33. package/src/packages/components/Select/SelectPanel.tsx +3 -0
  34. package/src/packages/components/Select/select.utils.tsx +1 -1
  35. package/src/packages/components/SelectGroup/index.tsx +37 -0
  36. package/src/packages/components/Space/index.tsx +30 -0
  37. package/src/packages/components/Space/space.scss +26 -0
  38. package/src/packages/components/Table/standard/PlcOperation/outer-operation.scss +4 -4
  39. package/src/packages/components/Table/table/body/cell.tsx +17 -12
  40. package/src/packages/components/Table/table/table.scss +17 -14
  41. package/src/packages/components/Table/table/use/useTableFormEditor.tsx +2 -0
  42. package/src/packages/components/VirtualList/useVirtualList.tsx +16 -11
  43. package/src/packages/components/VirtualTable/virtual-table.scss +1 -1
  44. package/src/packages/components/createHttp/index.tsx +4 -1
  45. package/src/packages/components/useMessage/message.scss +2 -2
  46. package/src/packages/components/useNotice/notice.scss +1 -1
  47. package/src/packages/components/usePopup/PopupItem.tsx +14 -1
  48. package/src/packages/components/usePopup/popup-item.scss +5 -1
  49. package/src/packages/components/useTooltip/index.tsx +4 -0
  50. package/src/packages/entry.tsx +4 -0
  51. package/src/packages/uses/useCollapseStyles.tsx +55 -0
  52. package/src/packages/utils/findReactElement.tsx +2 -2
@@ -17,7 +17,7 @@
17
17
  .cascade-panel-item {
18
18
  transition: all ease 150ms;
19
19
  position: relative;
20
- background-color: plv(background-lite);
20
+ background-color: plv(background-color);
21
21
  overflow: hidden;
22
22
 
23
23
  .cascade-panel-item-inner {
@@ -29,7 +29,7 @@
29
29
  display: flex;
30
30
  align-items: center;
31
31
  justify-content: space-between;
32
- border-bottom: solid 1px plv(background-lite);
32
+ border-bottom: solid 1px plv(background-color);
33
33
  cursor: pointer;
34
34
  color: plv(text-2);
35
35
 
@@ -1,6 +1,15 @@
1
1
  @include prefix(cascade-panel-flat) {
2
2
  width: 500px;
3
3
 
4
+ & > .#{componentName(scroll)} {
5
+ & > .scroll-wrapper {
6
+ & > .scroll-content {
7
+ overflow-x: initial !important;
8
+ overflow-y: initial !important;
9
+ }
10
+ }
11
+ }
12
+
4
13
  .cascade-panel-flat-header {
5
14
  position: sticky;
6
15
  top: 0;
@@ -83,35 +92,26 @@
83
92
  &.cascade-panel-size-normal, &.cascade-panel-size-large {
84
93
  @include comp(cascade-panel-flat) {
85
94
  .cascade-panel-flat-header {
86
- padding: 8px calc(#{plv(input-padding-x)} - 8px);
87
95
 
88
- .cascade-panel-flat-header-item {
89
- padding: 0 8px;
90
- line-height: 28px;
91
- cursor: pointer;
92
-
93
- &:hover {
94
- background-color: plv(background-hover);
95
- }
96
- }
97
96
  }
98
97
  .cascade-panel-flat-body {
99
- padding: 8px calc(#{plv(input-padding-x)} - 8px);
100
98
 
101
- .cascade-panel-flat-item {
102
- padding: 8px 8px;
103
- }
104
99
  }
105
100
  }
106
101
  }
107
- &.cascade-panel-size-small, &.cascade-panel-size-mini {
102
+
103
+ @include sizeMixin(cascade-panel, ()) {
108
104
  @include comp(cascade-panel-flat) {
105
+ .cascade-panel-flat-item {
106
+ border-radius: plv(box-size-#{$name}-border-radius);
107
+ }
109
108
  .cascade-panel-flat-header {
110
- padding: 4px calc(#{plv(input-padding-x)} - 4px);
109
+ font-size: $font-size;
110
+ padding: 2px 2px;
111
111
 
112
112
  .cascade-panel-flat-header-item {
113
- padding: 0 4px;
114
- line-height: 24px;
113
+ padding: 0 calc(#{plv(input-padding-x-#{$name})} - 2px);
114
+ line-height: 28px;
115
115
  cursor: pointer;
116
116
 
117
117
  &:hover {
@@ -120,26 +120,13 @@
120
120
  }
121
121
  }
122
122
  .cascade-panel-flat-body {
123
- padding: 4px calc(#{plv(input-padding-x)} - 4px);
123
+ font-size: $font-size;
124
+ padding: 2px 2px;
124
125
 
125
126
  .cascade-panel-flat-item {
126
- padding: 4px 4px;
127
+ padding: calc((#{plv(input-padding-x-#{$name})} - 2px) * 0.6) calc(#{plv(input-padding-x-#{$name})} - 2px);
127
128
  }
128
129
  }
129
130
  }
130
131
  }
131
-
132
- @include sizeMixin(cascade-panel, ()) {
133
- @include comp(cascade-panel-flat) {
134
- .cascade-panel-flat-item {
135
- border-radius: plv(box-size-#{$name}-border-radius);
136
- }
137
- .cascade-panel-flat-header {
138
- font-size: $font-size;
139
- }
140
- .cascade-panel-flat-body {
141
- font-size: $font-size;
142
- }
143
- }
144
- }
145
132
  }
@@ -6,6 +6,7 @@
6
6
  vertical-align: -0.15em;
7
7
  border-width: 1px;
8
8
  border-style: solid;
9
+ border-radius: plv(box-size-small-border-radius);
9
10
  //border-radius: 2px;
10
11
 
11
12
  &.checkbox-inner-status-check {
@@ -194,7 +194,7 @@ $width: 276px;
194
194
  }
195
195
 
196
196
  .date-base-panel-year-list {
197
- background-color: plv(background-lite);
197
+ background-color: inherit;
198
198
  transition: all ease 300ms;
199
199
  position: absolute;
200
200
  left: 0;
@@ -20,7 +20,7 @@ import {createPopupAttrsGetter} from "../usePopup/utils/createPopperAttrsGetter"
20
20
  import {useParentPopupId} from "../usePopup/utils/popup.utils";
21
21
 
22
22
  export const DatePicker = designComponent({
23
- name: '-date',
23
+ name: '-date-picker',
24
24
  props: DatePropsOptions,
25
25
  expose: {
26
26
  DatePanel,
@@ -12,7 +12,10 @@
12
12
  }
13
13
 
14
14
  .dialog-content {
15
- background-color: plv(background-color);
15
+ background-color: plv(bg-3);
16
+ --#{componentName('background-color')}: #{plv(bg-3)};
17
+ --#{componentName('table-head-background')}: #{plv(bg-3)};
18
+
16
19
  border: solid 1px plv(border-color);
17
20
  display: flex;
18
21
  flex-direction: column;
@@ -28,6 +28,7 @@ export const FilterFormSingle = designComponent({
28
28
  hideHandlerSelector: { type: Boolean },
29
29
  hideSearchButton: { type: Boolean },
30
30
  width: { type: String, default: '440px' },
31
+ handleSearch: { type: Function as PropType<(data: iFilterFormSingleData) => void | Promise<void>> },
31
32
  },
32
33
  emits: {
33
34
  onSearch: (data: iFilterFormSingleData) => true,
@@ -111,7 +112,11 @@ export const FilterFormSingle = designComponent({
111
112
  * @author 韦胜健
112
113
  * @date 2023.1.6 12:46
113
114
  */
114
- search: async () => {emit.onSearch(await methods.getData());},
115
+ search: async () => {
116
+ const data = await methods.getData();
117
+ emit.onSearch(data);
118
+ await props.handleSearch?.(data);
119
+ },
115
120
  };
116
121
 
117
122
  const handler = {
@@ -156,7 +161,7 @@ export const FilterFormSingle = designComponent({
156
161
  )}
157
162
  {FilterService.getHandler(usingFilterOption.value)!.render({ formData: state.formData, option: usingFilterOption.value, confirm: methods.search })}
158
163
  {!props.hideSearchButton && (
159
- <Button label={i18n('base.query').d('查询')} icon="pi-search" mode="fill" onClick={methods.search}/>
164
+ <Button label={i18n('base.query').d('查询')} icon="pi-search" mode="fill" asyncHandler={methods.search}/>
160
165
  )}
161
166
  {slots.append()}
162
167
  </InputGroup>
@@ -11,6 +11,22 @@
11
11
  line-height: $height;
12
12
  font-size: $font-size;
13
13
  }
14
+
15
+ /*@formatter:off*/
16
+ .form-item-validate-message-inner {
17
+ font-size: $font-size;
18
+
19
+ }
20
+ .form-item-validate-position-bottom-left { .form-item-validate-message-inner {line-height: 1.5em} }
21
+ .form-item-validate-position-bottom-right { .form-item-validate-message-inner {line-height: 1.5em} }
22
+ .form-item-validate-position-right {
23
+ .form-item-validate-message-inner {
24
+ margin-left: $margin;
25
+ line-height: $height;
26
+ height: $height;
27
+ }
28
+ }
29
+ /*@formatter:on*/
14
30
  }
15
31
 
16
32
  @include prefix(form-item) {
@@ -60,16 +76,19 @@
60
76
  &.form-item-content-align-left {
61
77
  .form-item-content-inner {
62
78
  text-align: left;
79
+ position: relative;
63
80
  }
64
81
  }
65
82
  &.form-item-content-align-center {
66
83
  .form-item-content-inner {
67
84
  text-align: center;
85
+ position: relative;
68
86
  }
69
87
  }
70
88
  &.form-item-content-align-right {
71
89
  .form-item-content-inner {
72
90
  text-align: right;
91
+ position: relative;
73
92
  }
74
93
  }
75
94
 
@@ -103,12 +122,43 @@
103
122
  }
104
123
  }
105
124
 
106
-
107
125
  &.form-item-no-label {
108
126
  .form-item-content {
109
127
  width: 100% !important;
110
128
  }
111
129
  }
130
+
131
+ .form-item-validate-message-inner {
132
+ color: plv(error-6);
133
+ white-space: nowrap;
134
+ display: flex;
135
+ align-items: center;
136
+ @include comp(icon) {
137
+ margin-right: 0.25em;
138
+ }
139
+ }
140
+ &.form-item-validate-position-bottom-left {
141
+ .form-item-validate-message-inner {
142
+ position: absolute;
143
+ top: 100%;
144
+ left: 0;
145
+ }
146
+ }
147
+ &.form-item-validate-position-bottom-right {
148
+ .form-item-validate-message-inner {
149
+ position: absolute;
150
+ top: 100%;
151
+ right: 0;
152
+ }
153
+ }
154
+ &.form-item-validate-position-right {
155
+ .form-item-validate-message-inner {
156
+ position: absolute;
157
+ left: 100%;
158
+ top: 0;
159
+ }
160
+ }
161
+
112
162
  }
113
163
 
114
164
  &.form-column-1 {
@@ -41,6 +41,7 @@ export const FormLayoutPropsOption = {
41
41
  verticalLabel: { type: Boolean as PropType<boolean> }, // 纵向的表单
42
42
  gutter: { type: Number }, // 列间隔
43
43
  rowGutter: { type: Number }, // 行间隔
44
+ validateMessagePosition: { type: String as PropType<typeof FormValidateMessagePosition.TYPE> }, // 校验消息的位置
44
45
  } as const;
45
46
 
46
47
  /**
@@ -63,6 +64,7 @@ export const FormItemLayoutPropsOption = {
63
64
  contentAlign: { type: String as PropType<typeof eFormContentAlign.TYPE> }, // content 对齐方式
64
65
  singleColumnContentWidth: { type: Number }, // 单列的时候form item content的宽度
65
66
  colon: { type: Boolean as PropType<boolean | null>, default: null }, // label的冒号
67
+ validateMessagePosition: { type: String as PropType<typeof FormValidateMessagePosition.TYPE> }, // 校验消息的位置
66
68
  } as const;
67
69
 
68
70
  /**
@@ -96,14 +98,32 @@ export const useFormLayout = (() => {
96
98
  const isSingleColumn = computed(() => props.column === 1);
97
99
  /*列间距*/
98
100
  const gutter = computed((): number => {
99
- if (props.gutter != null) {return removeUnit(props.gutter) as any;}
101
+ if (props.gutter != null) {
102
+ return removeUnit(props.gutter) as any;
103
+ }
100
104
  /*单列的情况下不设置列间距*/
101
105
  return isSingleColumn.value ? 0 : FormSizeGutter[styleComputed.value.size];
102
106
  });
103
107
  /*行间距*/
104
108
  const rowGutter = computed((): number => {
105
- if (props.rowGutter != null) {return removeUnit(props.rowGutter) as any;}
106
- return gutter.value || FormSizeRowsGutter[styleComputed.value.size];
109
+ if (props.rowGutter != null) {
110
+ return removeUnit(props.rowGutter) as any;
111
+ }
112
+ return FormSizeRowsGutter[styleComputed.value.size];
113
+ });
114
+ /*校验消息的位置*/
115
+ const validateMessagePosition = computed(() => {
116
+ if (!!props.validateMessagePosition) {return props.validateMessagePosition;}
117
+
118
+ /*纵向文本的情况下,校验消息默认放在左下角*/
119
+ if (props.verticalLabel) {return FormValidateMessagePosition["bottom-left"];}
120
+ if (isSingleColumn.value) {
121
+ /*单列的情况下,校验消息默认放在右侧*/
122
+ return FormValidateMessagePosition['right'];
123
+ } else {
124
+ /*其他都放在右下角*/
125
+ return FormValidateMessagePosition['bottom-right'];
126
+ }
107
127
  });
108
128
  /*根节点样式*/
109
129
  const styles = useStyles((styles) => {
@@ -118,7 +138,7 @@ export const useFormLayout = (() => {
118
138
  style.marginLeft = unit(-gutter.value / 2);
119
139
  }
120
140
  });
121
- const refer = { props, styles, gutter, rowGutter, innerStyles, isSingleColumn };
141
+ const refer = { props, styles, gutter, rowGutter, innerStyles, isSingleColumn, validateMessagePosition };
122
142
  provide(FORM_LAYOUT_PROVIDER, refer);
123
143
  return refer;
124
144
  };
@@ -178,7 +198,7 @@ export const useFormLayout = (() => {
178
198
  * @author 韦胜健
179
199
  * @date 2022.9.4 23:22
180
200
  */
181
- const labelAlign = computed(() => props.labelAlign || form.props.labelAlign || eFormLabelAlign.left);
201
+ const labelAlign = computed(() => props.labelAlign || form.props.labelAlign || (form.props.verticalLabel ? eFormLabelAlign.left : eFormLabelAlign.right));
182
202
 
183
203
  /**
184
204
  * 内容对其方式
@@ -187,6 +207,7 @@ export const useFormLayout = (() => {
187
207
  */
188
208
  const contentAlign = computed(() => props.contentAlign || form.props.contentAlign || eFormContentAlign.left);
189
209
 
210
+ const validateMessagePosition = computed(() => props.validateMessagePosition || form.validateMessagePosition.value);
190
211
  /**
191
212
  * 根节点样式
192
213
  * @author 韦胜健
@@ -196,7 +217,9 @@ export const useFormLayout = (() => {
196
217
  styles.width = (() => {
197
218
  const totalColumn = Number(form.props.column);
198
219
  const itemColumn = column.value;
199
- if (itemColumn === totalColumn) {return '100%';}
220
+ if (itemColumn === totalColumn) {
221
+ return '100%';
222
+ }
200
223
  return `calc(${Number((itemColumn / totalColumn).toFixed(4)) * 100}%)`;
201
224
  })();
202
225
  styles.padding = `0 ${unit(form.gutter.value / 2)}`;
@@ -227,12 +250,16 @@ export const useFormLayout = (() => {
227
250
  }
228
251
  } else {
229
252
  style.width = unit((() => {
230
- if (props.singleColumnContentWidth) {return props.singleColumnContentWidth;}
231
- if (form.props.singleColumnContentWidth) {return form.props.singleColumnContentWidth;}
253
+ if (props.singleColumnContentWidth) {
254
+ return props.singleColumnContentWidth;
255
+ }
256
+ if (form.props.singleColumnContentWidth) {
257
+ return form.props.singleColumnContentWidth;
258
+ }
232
259
  if (form.props.column === 1 && !!form.props.labelWidth) {
233
260
  return `calc(100% - ${unit(form.props.labelWidth)})`;
234
261
  }
235
- return 300;
262
+ return 400;
236
263
  })());
237
264
  }
238
265
  });
@@ -245,6 +272,7 @@ export const useFormLayout = (() => {
245
272
  labelStyles,
246
273
  contentStyles,
247
274
  form,
275
+ validateMessagePosition,
248
276
  };
249
277
  };
250
278
 
@@ -259,8 +287,14 @@ const FormSizeGutter: Record<typeof ThemeSize.TYPE, number> = {
259
287
  };
260
288
 
261
289
  const FormSizeRowsGutter: Record<typeof ThemeSize.TYPE, number> = {
262
- large: 12,
263
- normal: 8,
264
- small: 4,
265
- mini: 2,
290
+ large: 32,
291
+ normal: 24,
292
+ small: 16,
293
+ mini: 12,
266
294
  };
295
+
296
+ export const FormValidateMessagePosition = createEnum([
297
+ 'bottom-left',
298
+ 'bottom-right',
299
+ 'right'
300
+ ] as const);
@@ -2,6 +2,7 @@ import {eFormValidateMode, eFormValidateTrigger, getValidateResultMessage, iForm
2
2
  import {provide, reactive} from "plain-design-composition";
3
3
  import {$message} from "../../$message";
4
4
  import {Validation} from "./createValidation";
5
+ import {AutoLoadingObserver} from "../../AutoLoadingObserver";
5
6
 
6
7
  /**
7
8
  * Form以及FormItem的上下文状态注入关键字
@@ -97,24 +98,28 @@ export function useFormValidation({ props }: { props: iFormValidatePropsType })
97
98
  * @date 2022.11.5 23:28
98
99
  */
99
100
  validate: async (config?: { autoLoading?: boolean, autoAlert?: boolean, }) => {
100
- config = config || {};
101
- if (config.autoLoading != false) {
102
- loading.show();
103
- }
104
- try {
105
- const validateResultData = await parentValidation.methods.validate({
106
- state,
107
- formData: props.modelValue,
108
- });
109
- if (!!validateResultData && validateResultData.length > 0) {
110
- if (config.autoAlert !== false) {
111
- $message(getValidateResultMessage(validateResultData[0], props.modelValue));
101
+ let promise = (async () => {
102
+ config = config || {};
103
+ if (config.autoLoading != false) {
104
+ loading.show();
105
+ }
106
+ try {
107
+ const validateResultData = await parentValidation.methods.validate({
108
+ state,
109
+ formData: props.modelValue,
110
+ });
111
+ if (!!validateResultData && validateResultData.length > 0) {
112
+ if (config.autoAlert !== false) {
113
+ $message(getValidateResultMessage(validateResultData[0], props.modelValue));
114
+ }
115
+ return Promise.reject(validateResultData);
112
116
  }
113
- return Promise.reject(validateResultData);
117
+ } finally {
118
+ loading.hide();
114
119
  }
115
- } finally {
116
- loading.hide();
117
- }
120
+ })();
121
+ AutoLoadingObserver.subject(promise);
122
+ return promise;
118
123
  },
119
124
  };
120
125
 
@@ -0,0 +1,16 @@
1
+ import {designComponent} from "plain-design-composition";
2
+ import Icon from "../Icon";
3
+
4
+ export const FormItemValidateMessage = designComponent({
5
+ props: {
6
+ message: { type: String }
7
+ },
8
+ setup({ props }) {
9
+ return () => (
10
+ !!props.message && <div className="form-item-validate-message-inner">
11
+ <Icon icon="pi-exclamation-polygon-fill"/>
12
+ <span>{props.message}</span>
13
+ </div>
14
+ );
15
+ },
16
+ });
@@ -4,7 +4,7 @@ import {EditProps, useEdit} from "../../uses/useEdit";
4
4
  import {StyleProps, ThemeStatus, useStyle} from "../../uses/useStyle";
5
5
  import {FormItemLayoutPropsOption, useFormLayout} from "../Form/layout/useFormLayout";
6
6
  import {useFormItemValidation} from "../Form/validate/useFormItemValidation";
7
- import {useTooltip} from "../useTooltip";
7
+ import {FormItemValidateMessage} from "./FormItemValidateMessage";
8
8
 
9
9
  export const FormItem = designComponent({
10
10
  name: '-form-item',
@@ -63,6 +63,7 @@ export const FormItem = designComponent({
63
63
  getComponentCls('form-item'),
64
64
  `form-item-label-align-${formItemLayout.labelAlign.value}`,
65
65
  `form-item-content-align-${formItemLayout.contentAlign.value}`,
66
+ `form-item-validate-position-${formItemLayout.validateMessagePosition.value}`,
66
67
  {
67
68
  'form-item-required': formItemValidation.isRequired.value,
68
69
  'form-item-has-label': !!props.label,
@@ -72,16 +73,23 @@ export const FormItem = designComponent({
72
73
  },
73
74
  ]);
74
75
 
75
- useTooltip({
76
- ignoreEmptyMessage: true,
77
- tooltip: () => ({
78
- popperSize: styleComputed.value.size,
79
- reference: refs.el,
80
- message: formItemValidation.validateMessage.value,
81
- status: 'error',
82
- placement: formItemLayout.form.props.singleColumnCenter ? 'right-start' : 'bottom-end'
83
- })
84
- });
76
+ /* useTooltip({
77
+ ignoreEmptyMessage: true,
78
+ alwaysShow: true,
79
+ tooltip: () => ({
80
+ type: uuid(),
81
+ trigger: 'manual',
82
+ popperSize: styleComputed.value.size,
83
+ reference: refs.el,
84
+ message: formItemValidation.validateMessage.value,
85
+ status: 'error',
86
+ placement: formItemLayout.form.props.singleColumnCenter ? 'right-center' : 'bottom-end',
87
+ minWidth: 0,
88
+ noBackground: true,
89
+ noArrow: true,
90
+ offset: 16,
91
+ })
92
+ });*/
85
93
 
86
94
  return {
87
95
  refer: {
@@ -102,9 +110,13 @@ export const FormItem = designComponent({
102
110
  {slots.prepend.isExist() && <div className="form-item-prepend-content">{slots.prepend()}</div>}
103
111
  <div className="form-item-content-inner">
104
112
  {slots.default()}
113
+ {/*校验消息放下边的时候放在 form-item-content-inner 内部使得与输入框左或者右对齐*/}
114
+ {formItemLayout.validateMessagePosition.value !== 'right' && <FormItemValidateMessage message={formItemValidation.validateMessage.value!}/>}
105
115
  </div>
106
116
  {slots.append.isExist() && <div className="form-item-append-content">{slots.append()}</div>}
107
117
  </div>
118
+ {/*校验消息放在右边的时候,放在外部,使得与输入框横向对齐*/}
119
+ {formItemLayout.validateMessagePosition.value === 'right' && <FormItemValidateMessage message={formItemValidation.validateMessage.value!}/>}
108
120
  </div>
109
121
  )
110
122
  };
@@ -112,3 +124,4 @@ export const FormItem = designComponent({
112
124
  });
113
125
 
114
126
  export default FormItem;
127
+
@@ -14,7 +14,7 @@ export const Icon = designComponent({
14
14
  inheritPropsType: iHTMLElement,
15
15
  props: {
16
16
  icon: { type: String },
17
- strokeWidth: { type: Number, default: 4 },
17
+ strokeWidth: { type: Number, default: 2 },
18
18
  strokeLinecap: { type: String as PropType<tStrokeLinecap>, default: "butt", },
19
19
  strokeLinejoin: { type: String as PropType<tStrokeLinejoin>, default: "miter", },
20
20
 
@@ -57,8 +57,6 @@
57
57
  box-sizing: border-box;
58
58
  display: flex;
59
59
  align-items: center;
60
- padding-right: plv(input-padding-x);
61
- padding-left: plv(input-padding-x);
62
60
 
63
61
  &:not(:first-child) {
64
62
  border-left: solid 1px plv(border-color);
@@ -70,7 +68,7 @@
70
68
  /*prefix icon右侧的input-box不需要左边框以及左边距*/
71
69
  .input-prefix-icon {
72
70
  & + .input-box {
73
- padding-left: 0;
71
+ padding-left: 0 !important;
74
72
  border-left: none;
75
73
  }
76
74
  }
@@ -179,9 +177,11 @@
179
177
  /*prefix icon以及suffix icon的宽度与高度相同,显示为正方形*/
180
178
  .input-prefix-icon {
181
179
  width: $height;
180
+ color: plv(text-2);
182
181
  }
183
182
  .input-suffix-icon-wrapper {
184
- width: 18px;
183
+ color: plv(text-2);
184
+ width: plv(input-clear-size-#{$name})
185
185
  }
186
186
 
187
187
  &.input-size-mini {
@@ -189,6 +189,14 @@
189
189
  line-height: 1.667;
190
190
  }
191
191
  }
192
+
193
+ /*所有的直接子节点,垂直居中,加上左右边距,除了第一个直接子节点之外,其他节点都加上左边框*/
194
+ & > div, & > span, & > input, & > textarea {
195
+ &:not(.input-suffix-icon-wrapper) {
196
+ padding-right: plv(input-padding-x-#{$name});
197
+ padding-left: plv(input-padding-x-#{$name});
198
+ }
199
+ }
192
200
  }
193
201
 
194
202
  /*input status*/
@@ -327,12 +335,16 @@
327
335
  &:not(.input-empty) {
328
336
  .input-box.input-tag-container {
329
337
  padding-left: 3px;
338
+ padding-right: 0;
339
+ @include comp(auto-width-input) {
340
+ padding: 0 3px;
341
+ }
330
342
  }
331
343
  }
332
344
 
333
345
  &.input-empty {
334
346
  .input-tag-container {
335
- .custom-auto-width-input {
347
+ @include comp(auto-width-input) {
336
348
  flex: 1;
337
349
  }
338
350
  }
@@ -106,7 +106,7 @@ export const useMultipleInput = createEffectiveHandler(({ hooks, props, model, r
106
106
  <AutoWidthInput
107
107
  modelValue={text.value}
108
108
  onChange={handler.onChange}
109
- placeholder={editComputed.value.placeholder}
109
+ placeholder={!(model.value as any)?.length ? editComputed.value.placeholder : undefined}
110
110
  disabled={!!editComputed.value.disabled}
111
111
  readonly={!!editComputed.value.readonly || !!props.customReadonly || !!editComputed.value.loading}
112
112
  {...props.nativeAttrs}
@@ -8,7 +8,7 @@ import {useInputNumberSingle} from "./useInputNumber.single";
8
8
  import {useInputNumberMultiple} from "./useInputNumber.multiple";
9
9
 
10
10
  export const InputNumber = designComponent({
11
- name: '-number',
11
+ name: '-input-number',
12
12
  inheritPropsType: Input,
13
13
  props: InputNumberPropsOption,
14
14
  emits: InputNumberEmitsOption,
@@ -33,7 +33,7 @@
33
33
  flex-direction: column;
34
34
  align-items: stretch;
35
35
  justify-content: center;
36
- padding: 0;
36
+ padding: 0 !important;
37
37
  position: relative;
38
38
 
39
39
  &:after {
@@ -1,11 +1,18 @@
1
1
  @include comp(object) {
2
2
  .object-icon {
3
3
  cursor: pointer;
4
- padding-right: calc(#{plv(input-padding-x)} - 4px);
5
- padding-left: calc(#{plv(input-padding-x)} - 4px);
6
4
 
7
5
  &:active {
8
6
  background-color: plv(secondary-light-2);
9
7
  }
10
8
  }
9
+ @include sizeMixin(input, ()) {
10
+ span.object-icon {
11
+ width: calc(#{$height} - 2px);
12
+ padding: 0;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ }
17
+ }
11
18
  }