web-component-gallery 2.3.10 → 2.3.11
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/modal/index.jsx +11 -5
- package/lib/modal/style/index.less +10 -0
- package/package.json +1 -1
package/lib/modal/index.jsx
CHANGED
|
@@ -2,6 +2,9 @@ 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
|
+
const MODAL_MODES = ['small', 'middle', 'large', 'max']
|
|
6
|
+
const HEADLESS_MODES = ['screen', 'headless-large']
|
|
7
|
+
|
|
5
8
|
const ModalProps = {
|
|
6
9
|
size: PropTypes.string.def('small'),
|
|
7
10
|
title: PropTypes.string.def('标题'),
|
|
@@ -14,7 +17,6 @@ const ModalComp = {
|
|
|
14
17
|
props: ModalProps,
|
|
15
18
|
data() {
|
|
16
19
|
return {
|
|
17
|
-
modalModes: ['small', 'middle', 'large', 'max'],
|
|
18
20
|
internalMode: this.size
|
|
19
21
|
}
|
|
20
22
|
},
|
|
@@ -28,9 +30,13 @@ const ModalComp = {
|
|
|
28
30
|
window.open(this.$attrs.externalLink, '_blank')
|
|
29
31
|
},
|
|
30
32
|
handleConvert() {
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
33
|
+
const normalizedMode = this.internalMode === 'headless-large' ? 'large' : this.internalMode
|
|
34
|
+
const currentIndex = MODAL_MODES.indexOf(normalizedMode)
|
|
35
|
+
const isLastMode = currentIndex === MODAL_MODES.length - 1
|
|
36
|
+
this.internalMode = isLastMode ? this.size : MODAL_MODES[currentIndex + 1]
|
|
37
|
+
},
|
|
38
|
+
hasTitleBar() {
|
|
39
|
+
return !HEADLESS_MODES.includes(this.size)
|
|
34
40
|
}
|
|
35
41
|
},
|
|
36
42
|
render() {
|
|
@@ -53,7 +59,7 @@ const ModalComp = {
|
|
|
53
59
|
...this.$listeners
|
|
54
60
|
}}
|
|
55
61
|
>
|
|
56
|
-
{this.
|
|
62
|
+
{this.hasTitleBar() && (
|
|
57
63
|
<div slot="title" class="AntModal__Title">
|
|
58
64
|
<span>{this.title}</span>
|
|
59
65
|
<div class="AntModal__Title__Blank">
|