xt-element-ui 2.0.4 → 2.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xt-element-ui",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "基于 Vue 2.7 + ElementUI 的企业级组件库,提供丰富的自定义组件和扩展组件",
5
5
  "main": "lib/index.common.js",
6
6
  "module": "lib/index.esm.js",
@@ -66,8 +66,8 @@
66
66
  "url": "https://github.com/JobWebNie/xt-element-ui.git"
67
67
  },
68
68
  "engines": {
69
- "node": ">=12.0.0",
70
- "npm": ">=6.0.0"
69
+ "node": "18.20.4",
70
+ "npm": ">=8.0.0"
71
71
  },
72
72
  "browserslist": [
73
73
  "> 1%",
@@ -1,10 +1,5 @@
1
1
  <template>
2
- <span class="xt-badge" :class="[
3
- `xt-badge--${type}`,
4
- { 'xt-badge--dot': isDot },
5
- { 'xt-badge--hidden': hidden },
6
- { 'xt-badge--fixed': fixed }
7
- ]">
2
+ <span :class="rootClasses">
8
3
  <span class="xt-badge__content">
9
4
  <slot></slot>
10
5
  </span>
@@ -13,9 +8,9 @@
13
8
  class="xt-badge__badge"
14
9
  :style="badgeStyle"
15
10
  >
16
- <template v-if="isDot"></template>
17
- <template v-else-if="showOverflow && value > max">{{ max }}+</template>
18
- <template v-else>{{ value }}</template>
11
+ <span v-if="isDot"></span>
12
+ <span v-else-if="isOverflow">{{ overflowText }}</span>
13
+ <span v-else>{{ value }}</span>
19
14
  </span>
20
15
  </span>
21
16
  </template>
@@ -59,12 +54,27 @@ export default {
59
54
  }
60
55
  },
61
56
  computed: {
57
+ rootClasses() {
58
+ return [
59
+ 'xt-badge',
60
+ `xt-badge--${this.type}`,
61
+ { 'xt-badge--dot': this.isDot },
62
+ { 'xt-badge--hidden': this.hidden },
63
+ { 'xt-badge--fixed': this.fixed }
64
+ ]
65
+ },
62
66
  badgeStyle() {
63
67
  const style = {}
64
68
  if (this.color) {
65
69
  style.backgroundColor = this.color
66
70
  }
67
71
  return style
72
+ },
73
+ overflowText() {
74
+ return this.max + '+'
75
+ },
76
+ isOverflow() {
77
+ return this.showOverflow && this.value > this.max
68
78
  }
69
79
  }
70
80
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <el-button
3
- class="ex-button"
3
+ class="xt-button"
4
4
  :class="buttonClasses"
5
5
  v-bind="$attrs"
6
6
  @click="handleClick"
@@ -49,8 +49,8 @@ export default {
49
49
  },
50
50
  buttonClasses() {
51
51
  return [
52
- `ex-button-${this.finalSize}`,
53
- `ex-button-${this.type}`
52
+ `xt-button-${this.finalSize}`,
53
+ `xt-button-${this.type}`
54
54
  ]
55
55
  }
56
56
  },
@@ -1,6 +1,6 @@
1
1
  @import '../../../styles/variables.scss';
2
2
 
3
- .ex-button {
3
+ .xt-button {
4
4
  padding: 8px 16px;
5
5
  border-radius: var(--xt-border-radius-base);
6
6
  font-size: var(--xt-font-size-base);
@@ -43,25 +43,25 @@
43
43
  }
44
44
 
45
45
  /* small size - 字体大小 12px */
46
- .ex-button-mini {
46
+ .xt-button-mini {
47
47
  padding: 2px 4px;
48
48
  font-size: calc(var(--xt-font-size-base) + $xt-font-size-increment-extra-small);
49
49
  }
50
50
 
51
51
  /* small size - 字体大小 14px */
52
- .ex-button-small {
52
+ .xt-button-small {
53
53
  padding: 5px 10px;
54
54
  font-size: calc(var(--xt-font-size-base) + $xt-font-size-increment-base);
55
55
  }
56
56
 
57
57
  /* medium size - 字体大小 16px */
58
- .ex-button-medium {
58
+ .xt-button-medium {
59
59
  padding: 8px 16px;
60
60
  font-size: calc(var(--xt-font-size-base) + $xt-font-size-increment-medium);
61
61
  }
62
62
 
63
63
  /* large size - 字体大小 18px */
64
- .ex-button-large {
64
+ .xt-button-large {
65
65
  padding: 11px 22px;
66
66
  font-size: calc(var(--xt-font-size-base) + $xt-font-size-increment-large);
67
67
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <el-card
3
- class="ex-card"
3
+ class="xt-card"
4
4
  :class="cardClasses"
5
5
  v-bind="$attrs"
6
6
  >
@@ -55,10 +55,10 @@ export default {
55
55
  },
56
56
  cardClasses() {
57
57
  return [
58
- `ex-card-${this.shadow}`,
59
- `ex-card-${this.finalSize}`,
58
+ `xt-card-${this.shadow}`,
59
+ `xt-card-${this.finalSize}`,
60
60
  {
61
- 'ex-card-no-border': !this.bordered,
61
+ 'xt-card-no-border': !this.bordered,
62
62
  [this.bodyClass]: this.bodyClass
63
63
  }
64
64
  ]
@@ -2,27 +2,27 @@
2
2
  @import '../../../styles/element-theme.scss';
3
3
  @import '../../../styles/variables.scss';
4
4
 
5
- .ex-card {
5
+ .xt-card {
6
6
  border-radius: 8px;
7
7
  transition: all 0.3s;
8
- font-size: var(--ex-card-font-size, 14px);
8
+ font-size: var(--xt-card-font-size, 14px);
9
9
  background-color: var(--el-bg-color-block, #ffffff);
10
10
  color: var(--el-text-color-primary, #303133);
11
11
  border-color: var(--el-border-color, #303133);
12
12
 
13
13
  .el-card__header {
14
- padding: var(--ex-card-header-padding, 16px 20px);
14
+ padding: var(--xt-card-header-padding, 16px 20px);
15
15
  border-bottom: 1px solid var(--el-border-color, #ebeef5);
16
16
  background-color: var(--el-bg-color-block-head, #ffffff);
17
17
  font-weight: 600;
18
18
  }
19
19
 
20
20
  .el-card__body {
21
- padding: var(--ex-card-body-padding, 20px);
21
+ padding: var(--xt-card-body-padding, 20px);
22
22
  }
23
23
  }
24
24
 
25
- .ex-card-small {
25
+ .xt-card-small {
26
26
  font-size: 12px;
27
27
 
28
28
  .el-card__header {
@@ -30,7 +30,7 @@
30
30
  }
31
31
  }
32
32
 
33
- .ex-card-medium {
33
+ .xt-card-medium {
34
34
  font-size: 14px;
35
35
 
36
36
  .el-card__header {
@@ -38,7 +38,7 @@
38
38
  }
39
39
  }
40
40
 
41
- .ex-card-large {
41
+ .xt-card-large {
42
42
  font-size: 16px;
43
43
 
44
44
  .el-card__header {
@@ -46,11 +46,11 @@
46
46
  }
47
47
  }
48
48
 
49
- .ex-card-always {
49
+ .xt-card-always {
50
50
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
51
51
  }
52
52
 
53
- .ex-card-hover {
53
+ .xt-card-hover {
54
54
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
55
55
 
56
56
  &:hover {
@@ -58,12 +58,12 @@
58
58
  }
59
59
  }
60
60
 
61
- .ex-card-never {
61
+ .xt-card-never {
62
62
  box-shadow: none;
63
63
  border: 1px solid var(--el-border-color, #ebeef5);
64
64
  }
65
65
 
66
- .ex-card-no-border {
66
+ .xt-card-no-border {
67
67
  border: none;
68
68
 
69
69
  .el-card__header {
@@ -115,14 +115,8 @@ export default {
115
115
  right: "30",
116
116
  bottom: "20"
117
117
  },
118
- xAxis: [{
118
+ xAxis: {
119
119
  type: "category",
120
- splitLine: {
121
- show: true,
122
- lineStyle: {
123
- type: "dashed"
124
- }
125
- },
126
120
  axisLabel: {
127
121
  interval: this.intervalvalue
128
122
  },
@@ -130,7 +124,7 @@ export default {
130
124
  data: _self.chartData.map((item) => {
131
125
  return item[keys.label];
132
126
  })
133
- }],
127
+ },
134
128
  yAxis: {
135
129
  type: "value",
136
130
  axisLine: {
@@ -1,22 +1,21 @@
1
1
 
2
2
  import variables from '../../../styles/variables-export.scss'
3
3
  export default {
4
- color: ["#0de7ff", "#a782ff", "#fcdd60", "#0de7ff", "#ffc5a1", "#6291ae", "#13ce66"],
4
+ color: ["#1060ff", "#6648fe", "#26ddff", "#1bae94", "#ff8041", "#3a5dca", "#c7dd4b"],
5
5
  backgroundColor: "#000",
6
6
  textStyle: {
7
7
  fontFamily: "Microsoft YaHei, sans-serif"
8
8
  },
9
9
  title: {
10
10
  textStyle: {
11
- color: "#ffffff"
11
+ color: "#ffffff",
12
+ fontSize: 16
12
13
  },
13
14
  subtextStyle: {
14
- color: "#ffffff"
15
+ color: "#ffffff",
16
+ fontSize: 12
15
17
  }
16
18
  },
17
- axisLabel: {
18
- color: "#ffffff"
19
- },
20
19
  line: {
21
20
  itemStyle: {
22
21
  },
@@ -48,6 +47,16 @@ export default {
48
47
  borderColor: "#dcdfe6"
49
48
  }
50
49
  },
50
+ valueAxis: {
51
+ axisLabel: {
52
+ color: "#ffffff"
53
+ }
54
+ },
55
+ categoryAxis: {
56
+ axisLabel: {
57
+ color: "#ffffff"
58
+ }
59
+ },
51
60
  gauge: {
52
61
  axisLine: {
53
62
  lineStyle: {
@@ -60,14 +69,28 @@ export default {
60
69
  borderColor: "#ffffff"
61
70
  }
62
71
  },
63
- axisLine: {
64
- lineStyle: {
65
- color: "#DCDFE6"
72
+ xAxis: {
73
+ axisLine: {
74
+ lineStyle: {
75
+ color: "#DCDFE6"
76
+ }
77
+ },
78
+ axisTick: {
79
+ lineStyle: {
80
+ color: "#DCDFE6"
81
+ }
66
82
  }
67
83
  },
68
- axisTick: {
69
- lineStyle: {
70
- color: "#DCDFE6"
84
+ yAxis: {
85
+ axisLine: {
86
+ lineStyle: {
87
+ color: "#DCDFE6"
88
+ }
89
+ },
90
+ axisTick: {
91
+ lineStyle: {
92
+ color: "#DCDFE6"
93
+ }
71
94
  }
72
95
  },
73
96
  splitLine: {
@@ -45,6 +45,11 @@ export default {
45
45
  borderColor: "#fff"
46
46
  }
47
47
  },
48
+ valueAxis: {
49
+ axisLabel: {
50
+ color: "#666666"
51
+ }
52
+ },
48
53
  gauge: {
49
54
  axisLine: {
50
55
  lineStyle: {
@@ -312,6 +312,34 @@ EchartsUtil.applyFontSize = function(themeOption, size) {
312
312
  }
313
313
  }
314
314
 
315
+ // 调整坐标轴标签字体大小和颜色
316
+ const applyAxisLabel = function(axis) {
317
+ if (!axis) return;
318
+ if (!axis.axisLabel) {
319
+ axis.axisLabel = {};
320
+ }
321
+ if (result.axisLabel && result.axisLabel.color) {
322
+ axis.axisLabel.color = result.axisLabel.color;
323
+ }
324
+ axis.axisLabel.fontSize = fontSizeConfig.axisLabel;
325
+ };
326
+
327
+ if (result.xAxis) {
328
+ if (Array.isArray(result.xAxis)) {
329
+ result.xAxis.forEach(applyAxisLabel);
330
+ } else {
331
+ applyAxisLabel(result.xAxis);
332
+ }
333
+ }
334
+
335
+ if (result.yAxis) {
336
+ if (Array.isArray(result.yAxis)) {
337
+ result.yAxis.forEach(applyAxisLabel);
338
+ } else {
339
+ applyAxisLabel(result.yAxis);
340
+ }
341
+ }
342
+
315
343
  return result;
316
344
  };
317
345
 
@@ -1,5 +1,9 @@
1
1
  <script>
2
2
  import EchartsUtil from '../xt-chart/utils.js'
3
+
4
+ // SSR 兼容:Node.js 环境中 HTMLElement 不存在
5
+ const HTMLElementType = typeof HTMLElement !== 'undefined' ? HTMLElement : Object
6
+
3
7
  export default {
4
8
  name: 'XtConfigProvider',
5
9
  inheritAttrs: false,
@@ -107,7 +111,7 @@ export default {
107
111
  default: false
108
112
  },
109
113
  proxyElement: {
110
- type: [HTMLElement, String, Object],
114
+ type: [HTMLElementType, String, Object],
111
115
  default: null,
112
116
  description: '代理元素,将样式应用到该元素上。支持 HTMLElement、CSS选择器字符串或 ref 对象'
113
117
  },
@@ -0,0 +1,8 @@
1
+ import XtList from './index.vue'
2
+
3
+ XtList.install = function (Vue) {
4
+ Vue.component(XtList.name, XtList)
5
+ }
6
+
7
+ export default XtList
8
+ export { XtList }