web-component-gallery 2.3.21 → 2.3.22
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/dist/js.umd.js +1 -1
- package/lib/form-comp/ASelectCustom.vue +3 -1
- package/lib/modal/index.jsx +27 -6
- package/lib/modal/style/index.less +15 -10
- package/package.json +1 -1
|
@@ -400,7 +400,9 @@ export default {
|
|
|
400
400
|
* 处理选项变化
|
|
401
401
|
*/
|
|
402
402
|
handleOptionsChange(newVal) {
|
|
403
|
-
this.innerOptions = this.
|
|
403
|
+
this.innerOptions = this.listPageHandler
|
|
404
|
+
? this.deduplicateOptions([...newVal, ...this.innerOptions])
|
|
405
|
+
: [...newVal]
|
|
404
406
|
},
|
|
405
407
|
|
|
406
408
|
/**
|
package/lib/modal/index.jsx
CHANGED
|
@@ -2,11 +2,13 @@ import PropTypes from 'ant-design-vue/es/_util/vue-types'
|
|
|
2
2
|
import { Modal } from 'ant-design-vue/es'
|
|
3
3
|
import IconFont from '../icon-font'
|
|
4
4
|
|
|
5
|
+
// 弹窗尺寸模式
|
|
5
6
|
const MODAL_MODES = ['small', 'middle', 'large', 'max']
|
|
6
|
-
|
|
7
|
+
// 无头部模式后缀
|
|
8
|
+
const HEADLESS_SUFFIX = '-headless'
|
|
7
9
|
|
|
8
10
|
const ModalProps = {
|
|
9
|
-
size: PropTypes.string.def('
|
|
11
|
+
size: PropTypes.string.def('middle'),
|
|
10
12
|
title: PropTypes.string.def('标题'),
|
|
11
13
|
visible: PropTypes.bool.def(false),
|
|
12
14
|
cancelHandle: PropTypes.func
|
|
@@ -26,17 +28,33 @@ const ModalComp = {
|
|
|
26
28
|
}
|
|
27
29
|
},
|
|
28
30
|
methods: {
|
|
31
|
+
// 打开外部链接
|
|
29
32
|
handleBlank() {
|
|
30
33
|
window.open(this.$attrs.externalLink, '_blank')
|
|
31
34
|
},
|
|
35
|
+
// 切换弹窗尺寸(保持无头部状态)
|
|
32
36
|
handleConvert() {
|
|
33
|
-
const
|
|
34
|
-
const currentIndex = MODAL_MODES.indexOf(
|
|
37
|
+
const baseMode = this.getBaseMode(this.internalMode)
|
|
38
|
+
const currentIndex = MODAL_MODES.indexOf(baseMode)
|
|
35
39
|
const isLastMode = currentIndex === MODAL_MODES.length - 1
|
|
36
|
-
|
|
40
|
+
const nextBaseMode = isLastMode ? MODAL_MODES[0] : MODAL_MODES[currentIndex + 1]
|
|
41
|
+
|
|
42
|
+
const suffix = this.internalMode.endsWith(HEADLESS_SUFFIX)
|
|
43
|
+
? HEADLESS_SUFFIX
|
|
44
|
+
: ''
|
|
45
|
+
|
|
46
|
+
this.internalMode = nextBaseMode + suffix
|
|
37
47
|
},
|
|
48
|
+
// 提取基础尺寸(去除后缀)
|
|
49
|
+
getBaseMode(mode) {
|
|
50
|
+
if (mode.endsWith(HEADLESS_SUFFIX)) {
|
|
51
|
+
return mode.replace(HEADLESS_SUFFIX, '')
|
|
52
|
+
}
|
|
53
|
+
return mode
|
|
54
|
+
},
|
|
55
|
+
// 判断是否显示标题栏
|
|
38
56
|
hasTitleBar() {
|
|
39
|
-
return !
|
|
57
|
+
return !this.internalMode.endsWith(HEADLESS_SUFFIX) && this.internalMode !== 'screen'
|
|
40
58
|
}
|
|
41
59
|
},
|
|
42
60
|
render() {
|
|
@@ -59,14 +77,17 @@ const ModalComp = {
|
|
|
59
77
|
...this.$listeners
|
|
60
78
|
}}
|
|
61
79
|
>
|
|
80
|
+
{/* 条件渲染标题栏 */}
|
|
62
81
|
{this.hasTitleBar() && (
|
|
63
82
|
<div slot="title" class="AntModal__Title">
|
|
64
83
|
<span>{this.title}</span>
|
|
65
84
|
<div class="AntModal__Title__Blank">
|
|
85
|
+
{/* 切换尺寸按钮 */}
|
|
66
86
|
<IconFont
|
|
67
87
|
type="modal_convert"
|
|
68
88
|
on={{ click: this.handleConvert }}
|
|
69
89
|
/>
|
|
90
|
+
{/* 外部链接按钮(可选) */}
|
|
70
91
|
{
|
|
71
92
|
$attrs.externalLink &&
|
|
72
93
|
<IconFont
|
|
@@ -18,16 +18,6 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
&__headless-large {
|
|
22
|
-
.ant-modal {
|
|
23
|
-
.layout(1600px, 848px);
|
|
24
|
-
|
|
25
|
-
&-body {
|
|
26
|
-
padding: 0;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
21
|
&__max {
|
|
32
22
|
.ant-modal {
|
|
33
23
|
top: 0;
|
|
@@ -48,6 +38,21 @@
|
|
|
48
38
|
}
|
|
49
39
|
}
|
|
50
40
|
|
|
41
|
+
&__small-headless,
|
|
42
|
+
&__middle-headless,
|
|
43
|
+
&__large-headless,
|
|
44
|
+
&__max-headless {
|
|
45
|
+
.ant-modal {
|
|
46
|
+
&-header {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-body {
|
|
51
|
+
padding: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
51
56
|
&__Title {
|
|
52
57
|
.flex-layout();
|
|
53
58
|
|