web-component-gallery 2.3.21 → 2.3.23

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.
@@ -186,8 +186,8 @@ const DescriptionsList = {
186
186
 
187
187
  // 设置固定标签宽度
188
188
  this.setStyle(label, { width: `${this.labelWidth}px`, minWidth: `${this.labelWidth}px`, maxWidth: `${this.labelWidth}px` })
189
- // 设置自适应内容宽度
190
- this.setStyle(contents[index], { width: `${contentWidth}px`, minWidth: `${contentWidth}px`, maxWidth: `${contentWidth}px` })
189
+ // 设置自适应内容宽度 (table-layout: auto; 自适应情况下不需要设置内容宽度)
190
+ // this.setStyle(contents[index], { width: `${contentWidth}px`, minWidth: `${contentWidth}px`, maxWidth: `${contentWidth}px` })
191
191
 
192
192
  itemCount++
193
193
  })
@@ -25,6 +25,9 @@
25
25
 
26
26
  .ant-descriptions-item-content {
27
27
  word-wrap: break-word;
28
+ word-break: break-all;
29
+ overflow-wrap: anywhere;
30
+ max-width: 0;
28
31
 
29
32
  .Browse {
30
33
  align-items: center;
@@ -400,7 +400,9 @@ export default {
400
400
  * 处理选项变化
401
401
  */
402
402
  handleOptionsChange(newVal) {
403
- this.innerOptions = this.deduplicateOptions([...newVal, ...this.innerOptions])
403
+ this.innerOptions = this.listPageHandler
404
+ ? this.deduplicateOptions([...newVal, ...this.innerOptions])
405
+ : [...newVal]
404
406
  },
405
407
 
406
408
  /**
@@ -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
- const HEADLESS_MODES = ['screen', 'headless-large']
7
+ // 无头部模式后缀
8
+ const HEADLESS_SUFFIX = '-headless'
7
9
 
8
10
  const ModalProps = {
9
- size: PropTypes.string.def('small'),
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 normalizedMode = this.internalMode === 'headless-large' ? 'large' : this.internalMode
34
- const currentIndex = MODAL_MODES.indexOf(normalizedMode)
37
+ const baseMode = this.getBaseMode(this.internalMode)
38
+ const currentIndex = MODAL_MODES.indexOf(baseMode)
35
39
  const isLastMode = currentIndex === MODAL_MODES.length - 1
36
- this.internalMode = isLastMode ? this.size : MODAL_MODES[currentIndex + 1]
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 !HEADLESS_MODES.includes(this.size)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "2.3.21",
3
+ "version": "2.3.23",
4
4
  "description": "基础vue、antdvue、less实现的私有组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [