plain-design 1.0.0-beta.91 → 1.0.0-beta.93
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/plain-design.commonjs.min.js +2 -2
- package/dist/plain-design.min.css +1 -1
- package/dist/plain-design.min.js +2 -2
- package/dist/report.html +2 -2
- package/package.json +1 -1
- package/src/packages/components/FilterFormMultiple/index.tsx +3 -2
- package/src/packages/components/Form/form.scss +3 -0
- package/src/packages/components/Form/layout/useFormLayout.tsx +2 -2
- package/src/packages/components/usePopup/refresh/MaxMinTopLeft.ts +38 -0
- package/src/packages/components/usePopup/refresh/calcPosition.ts +2 -18
- package/src/packages/components/usePopup/refresh/refreshPopup.ts +3 -1
package/package.json
CHANGED
@@ -178,7 +178,6 @@ export const FilterFormMultiple = designComponent({
|
|
178
178
|
const formAttrs = computed(() => {
|
179
179
|
return {
|
180
180
|
column: props.column,
|
181
|
-
labelAlign: 'right' as const,
|
182
181
|
labelWidth: 100,
|
183
182
|
...props.formAttrs,
|
184
183
|
};
|
@@ -222,7 +221,9 @@ export const FilterFormMultiple = designComponent({
|
|
222
221
|
return (
|
223
222
|
<FormItem
|
224
223
|
class={isFirstColumn ? 'filter-form-multiple-first-column' : undefined}
|
225
|
-
|
224
|
+
labelAlign={isFirstColumn ? 'left' : 'right'}
|
225
|
+
key={key}
|
226
|
+
label={label}
|
226
227
|
column={column}
|
227
228
|
>
|
228
229
|
<InputGroup>
|
@@ -119,7 +119,7 @@ export const useFormLayout = (() => {
|
|
119
119
|
if (!!props.validateMessagePosition) {return props.validateMessagePosition;}
|
120
120
|
|
121
121
|
/*纵向文本的情况下,校验消息默认放在左下角*/
|
122
|
-
if (props.verticalLabel) {return FormValidateMessagePosition["bottom-
|
122
|
+
if (props.verticalLabel) {return FormValidateMessagePosition["bottom-right"];}
|
123
123
|
if (isSingleColumn.value) {
|
124
124
|
/*单列的情况下,校验消息默认放在右侧*/
|
125
125
|
return FormValidateMessagePosition['right'];
|
@@ -204,7 +204,7 @@ export const useFormLayout = (() => {
|
|
204
204
|
* @author 韦胜健
|
205
205
|
* @date 2022.9.4 23:22
|
206
206
|
*/
|
207
|
-
const labelAlign = computed(() => props.
|
207
|
+
const labelAlign = computed(() => form.props.verticalLabel ? eFormLabelAlign.left : (props.labelAlign || form.props.labelAlign));
|
208
208
|
|
209
209
|
/**
|
210
210
|
* 内容对其方式
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import {iPopupRefreshBuildParams} from "../utils/popup.utils";
|
2
|
+
|
3
|
+
export function MaxMinTopLeft(
|
4
|
+
{
|
5
|
+
top,
|
6
|
+
left,
|
7
|
+
buildParams,
|
8
|
+
option,
|
9
|
+
}: {
|
10
|
+
top: number,
|
11
|
+
left: number,
|
12
|
+
buildParams: iPopupRefreshBuildParams,
|
13
|
+
option: {
|
14
|
+
maxTop?: number | ((buildParams: iPopupRefreshBuildParams) => number),
|
15
|
+
minTop?: number | ((buildParams: iPopupRefreshBuildParams) => number),
|
16
|
+
maxLeft?: number | ((buildParams: iPopupRefreshBuildParams) => number),
|
17
|
+
minLeft?: number | ((buildParams: iPopupRefreshBuildParams) => number),
|
18
|
+
}
|
19
|
+
}
|
20
|
+
): { top: number, left: number } {
|
21
|
+
if (option.maxTop != null) {
|
22
|
+
const maxTop = typeof option.maxTop === "function" ? option.maxTop(buildParams) : option.maxTop;
|
23
|
+
if (top > maxTop) {top = maxTop;}
|
24
|
+
}
|
25
|
+
if (option.minTop != null) {
|
26
|
+
const minTop = typeof option.minTop === "function" ? option.minTop(buildParams) : option.minTop;
|
27
|
+
if (top < minTop) {top = minTop;}
|
28
|
+
}
|
29
|
+
if (option.maxLeft != null) {
|
30
|
+
const maxLeft = typeof option.maxLeft === "function" ? option.maxLeft(buildParams) : option.maxLeft;
|
31
|
+
if (left > maxLeft) {left = maxLeft;}
|
32
|
+
}
|
33
|
+
if (option.minLeft != null) {
|
34
|
+
const minLeft = typeof option.minLeft === "function" ? option.minLeft(buildParams) : option.minLeft;
|
35
|
+
if (left < minLeft) {left = minLeft;}
|
36
|
+
}
|
37
|
+
return { top, left };
|
38
|
+
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import {iPopupRefreshBuildParams} from "../utils/popup.utils";
|
2
2
|
import {handleDirection} from "../utils/handleDirection";
|
3
|
+
import {MaxMinTopLeft} from "./MaxMinTopLeft";
|
3
4
|
|
4
5
|
/**
|
5
6
|
* 计算popup根节点定位信息
|
@@ -83,22 +84,5 @@ export function calcPosition(
|
|
83
84
|
if (left > maxLeft) {left = maxLeft;}
|
84
85
|
}
|
85
86
|
|
86
|
-
|
87
|
-
const maxTop = typeof option.maxTop === "function" ? option.maxTop(buildParams) : option.maxTop;
|
88
|
-
if (top! > maxTop) {top = maxTop;}
|
89
|
-
}
|
90
|
-
if (option.minTop != null) {
|
91
|
-
const minTop = typeof option.minTop === "function" ? option.minTop(buildParams) : option.minTop;
|
92
|
-
if (top! < minTop) {top = minTop;}
|
93
|
-
}
|
94
|
-
if (option.maxLeft != null) {
|
95
|
-
const maxLeft = typeof option.maxLeft === "function" ? option.maxLeft(buildParams) : option.maxLeft;
|
96
|
-
if (left! > maxLeft) {left = maxLeft;}
|
97
|
-
}
|
98
|
-
if (option.minLeft != null) {
|
99
|
-
const minLeft = typeof option.minLeft === "function" ? option.minLeft(buildParams) : option.minLeft;
|
100
|
-
if (left! < minLeft) {left = minLeft;}
|
101
|
-
}
|
102
|
-
|
103
|
-
return { top: top!, left: left! };
|
87
|
+
return MaxMinTopLeft({ top: top!, left: left!, buildParams, option, });
|
104
88
|
}
|
@@ -5,6 +5,7 @@ import {calcPosition} from "./calcPosition";
|
|
5
5
|
import {applyPosition} from "./applyPosition";
|
6
6
|
import {refreshArrow} from "./refreshArrow";
|
7
7
|
import {getRects} from "../utils/getRects";
|
8
|
+
import {MaxMinTopLeft} from "./MaxMinTopLeft";
|
8
9
|
|
9
10
|
/**
|
10
11
|
* 刷新popup定位
|
@@ -64,7 +65,8 @@ export function refreshPopup(params: iPopupRefreshParams) {
|
|
64
65
|
buildParams.rects = getRects(refs);
|
65
66
|
refreshArrow(buildParams);
|
66
67
|
} else {
|
67
|
-
const { top, left, height, width } = rects.alignReference;
|
68
|
+
const { top: _top, left: _left, height, width } = rects.alignReference;
|
69
|
+
const { top, left } = MaxMinTopLeft({ top: _top!, left: _left!, buildParams, option, });
|
68
70
|
Object.assign(refs.popupEl.style, {
|
69
71
|
...params.transformLocation ? { transform: `translate3d(${left}px,${top}px,0)` } : { top: `${top}px`, left: `${left}px`, },
|
70
72
|
height: `${height}px`,
|