xt-element-ui 1.3.4 → 2.0.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/CHANGELOG.md +37 -20
- package/README.md +39 -35
- package/docs/README.md +25 -15
- package/docs/components/base/xt-badge.md +139 -0
- package/docs/components/base/xt-bar.md +182 -0
- package/docs/components/base/xt-card-item.md +12 -12
- package/docs/components/base/xt-chart.md +183 -0
- package/docs/components/base/xt-date-picker.md +111 -0
- package/docs/components/base/xt-icon.md +154 -0
- package/docs/components/base/xt-line.md +145 -0
- package/docs/components/base/xt-multi.md +278 -0
- package/docs/components/base/xt-page.md +84 -0
- package/docs/components/base/xt-pie.md +175 -0
- package/docs/components/base/xt-progress.md +134 -0
- package/docs/components/base/xt-select-tree.md +141 -0
- package/docs/components/base/xt-table.md +344 -0
- package/docs/components/base/xt-tabs.md +197 -0
- package/docs/components/base/xt-upload.md +85 -0
- package/lib/index.common.js +885 -828
- package/lib/index.css +1 -1
- package/lib/index.umd.js +890 -834
- package/lib/index.umd.min.js +5 -5
- package/package.json +1 -1
- package/src/components/index.scss +11 -8
- package/src/components/xt-badge/index.js +7 -0
- package/src/components/xt-badge/index.vue +71 -0
- package/src/components/xt-badge/style/index.scss +88 -0
- package/src/components/xt-button/index.js +8 -8
- package/src/components/xt-button/index.vue +43 -73
- package/src/components/xt-button/style/index.scss +51 -787
- package/src/components/xt-card/index.js +7 -8
- package/src/components/xt-card/index.vue +61 -21
- package/src/components/xt-card/style/index.scss +56 -32
- package/src/components/xt-card-item/index.vue +7 -7
- package/src/components/xt-chart/index.js +8 -0
- package/src/components/{ex-chart → xt-chart}/index.vue +13 -13
- package/src/components/{ex-chart → xt-chart}/pieList.vue +1 -1
- package/src/components/{ex-chart → xt-chart}/theme/dark.js +4 -1
- package/src/components/{ex-chart → xt-chart}/utils.js +1 -1
- package/src/components/xt-config-provider/index.vue +1 -1
- package/src/components/xt-date-picker/index.js +8 -0
- package/src/components/{ex-date-picker → xt-date-picker}/index.vue +1 -1
- package/src/components/xt-icon/index.js +8 -0
- package/src/components/{ex-icon → xt-icon}/index.vue +4 -4
- package/src/components/xt-layout/ExFieldset.vue +1 -1
- package/src/components/xt-page/index.js +8 -0
- package/src/components/{ex-page → xt-page}/index.vue +1 -1
- package/src/components/xt-progress/index.js +7 -0
- package/src/components/xt-progress/index.vue +103 -0
- package/src/components/xt-progress/style/index.scss +119 -0
- package/src/components/xt-select-tree/index.js +8 -0
- package/src/components/{ex-select-tree → xt-select-tree}/index.vue +1 -1
- package/src/components/{ex-table/ExTableCell.vue → xt-table/XtTableCell.vue} +1 -1
- package/src/components/xt-table/index.js +8 -0
- package/src/components/{ex-table → xt-table}/index.vue +6 -6
- package/src/components/xt-tabs/TabPane.vue +36 -0
- package/src/components/xt-tabs/index.js +10 -0
- package/src/components/xt-tabs/index.vue +113 -0
- package/src/components/xt-tabs/style/index.scss +197 -0
- package/src/components/xt-text/index.vue +15 -1
- package/src/components/xt-text/style/index.scss +18 -0
- package/src/components/xt-upload/index.js +8 -0
- package/src/index.js +24 -31
- package/src/utils/index.js +1 -1
- package/docs/components/extend/ex-bar.md +0 -68
- package/docs/components/extend/ex-button.md +0 -62
- package/docs/components/extend/ex-card.md +0 -86
- package/docs/components/extend/ex-chart.md +0 -463
- package/docs/components/extend/ex-date-picker.md +0 -0
- package/docs/components/extend/ex-icon.md +0 -189
- package/docs/components/extend/ex-line.md +0 -71
- package/docs/components/extend/ex-multi.md +0 -156
- package/docs/components/extend/ex-page.md +0 -0
- package/docs/components/extend/ex-pie.md +0 -70
- package/docs/components/extend/ex-select-tree.md +0 -210
- package/docs/components/extend/ex-table.md +0 -591
- package/docs/components/extend/ex-upload.md +0 -134
- package/src/components/ex-button/index.js +0 -8
- package/src/components/ex-button/index.vue +0 -67
- package/src/components/ex-button/style/index.scss +0 -67
- package/src/components/ex-card/index.js +0 -7
- package/src/components/ex-card/index.vue +0 -68
- package/src/components/ex-card/style/index.scss +0 -73
- package/src/components/ex-chart/index.js +0 -8
- package/src/components/ex-date-picker/index.js +0 -8
- package/src/components/ex-icon/index.js +0 -8
- package/src/components/ex-page/index.js +0 -8
- package/src/components/ex-select-tree/index.js +0 -8
- package/src/components/ex-table/index.js +0 -8
- package/src/components/ex-upload/index.js +0 -8
- package/src/config/element-registry.js +0 -136
- /package/src/components/{ex-chart/ExBar.vue → xt-chart/XtBar.vue} +0 -0
- /package/src/components/{ex-chart/ExLine.vue → xt-chart/XtLine.vue} +0 -0
- /package/src/components/{ex-chart/ExMulti.vue → xt-chart/XtMulti.vue} +0 -0
- /package/src/components/{ex-chart/ExPie.vue → xt-chart/XtPie.vue} +0 -0
- /package/src/components/{ex-chart → xt-chart}/theme/white.js +0 -0
- /package/src/components/{ex-date-picker → xt-date-picker}/SearchDate.vue +0 -0
- /package/src/components/{ex-date-picker → xt-date-picker}/quarter.vue +0 -0
- /package/src/components/{ex-icon → xt-icon}/style/index.scss +0 -0
- /package/src/components/{ex-table → xt-table}/VirtualElTable.vue +0 -0
- /package/src/components/{ex-table → xt-table}/virtualScrollData.js +0 -0
- /package/src/components/{ex-upload → xt-upload}/index.vue +0 -0
- /package/src/components/{ex-upload → xt-upload}/preview.vue +0 -0
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<el-table-column :key="child._key" v-bind="getColumnProps(child)">
|
|
54
54
|
<template v-if="child.render" v-slot="scope">{{ child.render(scope) }}</template>
|
|
55
55
|
<template v-else-if="child.formatter" v-slot="scope">
|
|
56
|
-
<
|
|
56
|
+
<XtTableCell
|
|
57
57
|
:row="scope.row"
|
|
58
58
|
:index="scope.$index"
|
|
59
59
|
:formatter="child.formatter"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
<el-table-column v-else :key="col._key" v-bind="getColumnProps(col)">
|
|
75
75
|
<template v-if="col.render" v-slot="scope">{{ col.render(scope) }}</template>
|
|
76
76
|
<template v-else-if="col.formatter" v-slot="scope">
|
|
77
|
-
<
|
|
77
|
+
<XtTableCell
|
|
78
78
|
:row="scope.row"
|
|
79
79
|
:index="scope.$index"
|
|
80
80
|
:formatter="col.formatter"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<!-- 分页 -->
|
|
98
98
|
<div class="ex-table-footer" v-if="showPagination">
|
|
99
99
|
<el-pagination
|
|
100
|
-
:current-page="pagination.
|
|
100
|
+
:current-page="pagination.pageNum"
|
|
101
101
|
:page-size="pagination.pageSize"
|
|
102
102
|
:total="total"
|
|
103
103
|
:page-sizes="pagination.pageSizes || [10, 20, 50, 100]"
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
</template>
|
|
111
111
|
|
|
112
112
|
<script>
|
|
113
|
-
import
|
|
113
|
+
import XtTableCell from './XtTableCell.vue'
|
|
114
114
|
import VirtualElTable from './VirtualElTable.vue'
|
|
115
115
|
|
|
116
116
|
export default {
|
|
117
|
-
name: '
|
|
117
|
+
name: 'XtTable',
|
|
118
118
|
inheritAttrs: false,
|
|
119
|
-
components: {
|
|
119
|
+
components: { XtTableCell, VirtualElTable },
|
|
120
120
|
|
|
121
121
|
props: {
|
|
122
122
|
tableData: { type: Array, default: () => [] },
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-show="isActive" class="xt-tab-pane">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'XtTabPane',
|
|
10
|
+
props: {
|
|
11
|
+
name: {
|
|
12
|
+
type: [String, Number],
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ''
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
computed: {
|
|
21
|
+
isActive() {
|
|
22
|
+
return this.$parent && this.$parent.activeName === this.name
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
mounted() {
|
|
26
|
+
if (this.$parent && typeof this.$parent.addPane === 'function') {
|
|
27
|
+
this.$parent.addPane({ name: this.name, label: this.label })
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
beforeDestroy() {
|
|
31
|
+
if (this.$parent && typeof this.$parent.removePane === 'function') {
|
|
32
|
+
this.$parent.removePane(this.name)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="xt-tabs" :class="[
|
|
3
|
+
`xt-tabs--${position}`,
|
|
4
|
+
{ 'xt-tabs--card': type === 'card' }
|
|
5
|
+
]">
|
|
6
|
+
<div class="xt-tabs__header">
|
|
7
|
+
<div class="xt-tabs__nav">
|
|
8
|
+
<div
|
|
9
|
+
v-for="(pane, index) in panes"
|
|
10
|
+
:key="pane.name"
|
|
11
|
+
class="xt-tabs__nav-item"
|
|
12
|
+
:class="{ 'xt-tabs__nav-item--active': activeName === pane.name }"
|
|
13
|
+
@click="handleTabClick(pane.name)"
|
|
14
|
+
>
|
|
15
|
+
<span class="xt-tabs__nav-link">{{ pane.label }}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="xt-tabs__nav-indicator" :style="indicatorStyle"></div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="xt-tabs__content">
|
|
22
|
+
<transition name="xt-tabs-fade" mode="out-in">
|
|
23
|
+
<div
|
|
24
|
+
v-for="(pane, index) in panes"
|
|
25
|
+
:key="pane.name"
|
|
26
|
+
class="xt-tabs__pane"
|
|
27
|
+
v-show="activeName === pane.name"
|
|
28
|
+
>
|
|
29
|
+
<slot :name="pane.name"></slot>
|
|
30
|
+
</div>
|
|
31
|
+
</transition>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
export default {
|
|
38
|
+
name: 'XtTabs',
|
|
39
|
+
props: {
|
|
40
|
+
value: {
|
|
41
|
+
type: [String, Number],
|
|
42
|
+
default: ''
|
|
43
|
+
},
|
|
44
|
+
type: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'default',
|
|
47
|
+
validator: (val) => ['default', 'card'].includes(val)
|
|
48
|
+
},
|
|
49
|
+
position: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'top',
|
|
52
|
+
validator: (val) => ['top', 'bottom', 'left', 'right'].includes(val)
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
panes: [],
|
|
58
|
+
activeName: this.value
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
watch: {
|
|
62
|
+
value(val) {
|
|
63
|
+
this.activeName = val
|
|
64
|
+
},
|
|
65
|
+
activeName(val) {
|
|
66
|
+
this.$emit('input', val)
|
|
67
|
+
this.$emit('change', val)
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
indicatorStyle() {
|
|
72
|
+
const activeIndex = this.panes.findIndex(p => p.name === this.activeName)
|
|
73
|
+
if (activeIndex === -1) return { display: 'none' }
|
|
74
|
+
|
|
75
|
+
const navItems = this.$el && this.$el.querySelectorAll('.xt-tabs__nav-item')
|
|
76
|
+
if (!navItems || navItems.length === 0) return { display: 'none' }
|
|
77
|
+
|
|
78
|
+
const activeItem = navItems[activeIndex]
|
|
79
|
+
return {
|
|
80
|
+
left: `${activeItem.offsetLeft}px`,
|
|
81
|
+
width: `${activeItem.offsetWidth}px`,
|
|
82
|
+
display: 'block'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
handleTabClick(name) {
|
|
88
|
+
this.activeName = name
|
|
89
|
+
},
|
|
90
|
+
addPane(pane) {
|
|
91
|
+
if (!this.panes.find(p => p.name === pane.name)) {
|
|
92
|
+
this.panes.push(pane)
|
|
93
|
+
if (!this.activeName && this.panes.length === 1) {
|
|
94
|
+
this.activeName = pane.name
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
removePane(name) {
|
|
99
|
+
const index = this.panes.findIndex(p => p.name === name)
|
|
100
|
+
if (index > -1) {
|
|
101
|
+
this.panes.splice(index, 1)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
mounted() {
|
|
106
|
+
this.$children.forEach(child => {
|
|
107
|
+
if (child.$options.name === 'XtTabPane') {
|
|
108
|
+
this.addPane({ name: child.name, label: child.label })
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
@import '../../../styles/variables.scss';
|
|
2
|
+
|
|
3
|
+
.xt-tabs {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.xt-tabs--left,
|
|
9
|
+
.xt-tabs--right {
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.xt-tabs__header {
|
|
14
|
+
position: relative;
|
|
15
|
+
border-bottom: 1px solid $xt-color-border-light;
|
|
16
|
+
padding-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.xt-tabs--card .xt-tabs__header {
|
|
20
|
+
border-bottom: none;
|
|
21
|
+
background: $xt-color-bg-secondary;
|
|
22
|
+
padding: 4px 4px 0;
|
|
23
|
+
border-radius: 4px 4px 0 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.xt-tabs--left .xt-tabs__header {
|
|
27
|
+
border-right: 1px solid $xt-color-border-light;
|
|
28
|
+
border-bottom: none;
|
|
29
|
+
padding-right: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.xt-tabs--right .xt-tabs__header {
|
|
33
|
+
border-left: 1px solid $xt-color-border-light;
|
|
34
|
+
border-bottom: none;
|
|
35
|
+
padding-left: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.xt-tabs__nav {
|
|
39
|
+
display: flex;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.xt-tabs--left .xt-tabs__nav,
|
|
43
|
+
.xt-tabs--right .xt-tabs__nav {
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.xt-tabs__nav-item {
|
|
48
|
+
position: relative;
|
|
49
|
+
padding: 12px 20px;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
color: $xt-color-text-secondary;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
transition: color 0.3s ease;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.xt-tabs--card .xt-tabs__nav-item {
|
|
57
|
+
margin-bottom: -1px;
|
|
58
|
+
border-radius: 4px 4px 0 0;
|
|
59
|
+
background: transparent;
|
|
60
|
+
border: 1px solid transparent;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.xt-tabs--card .xt-tabs__nav-item--active {
|
|
64
|
+
background: $xt-color-bg-primary;
|
|
65
|
+
border-color: $xt-color-border-light;
|
|
66
|
+
border-bottom-color: $xt-color-bg-primary;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.xt-tabs__nav-item:hover {
|
|
70
|
+
color: $xt-color-primary;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.xt-tabs__nav-item--active {
|
|
74
|
+
color: $xt-color-primary;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.xt-tabs__nav-link {
|
|
79
|
+
display: inline-block;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.xt-tabs__nav-indicator {
|
|
83
|
+
position: absolute;
|
|
84
|
+
bottom: 0;
|
|
85
|
+
height: 2px;
|
|
86
|
+
background: $xt-color-primary;
|
|
87
|
+
transition: left 0.3s ease, width 0.3s ease;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.xt-tabs--left .xt-tabs__nav-indicator {
|
|
91
|
+
bottom: auto;
|
|
92
|
+
left: auto;
|
|
93
|
+
right: 0;
|
|
94
|
+
width: 2px;
|
|
95
|
+
height: auto;
|
|
96
|
+
top: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.xt-tabs--right .xt-tabs__nav-indicator {
|
|
100
|
+
bottom: auto;
|
|
101
|
+
right: auto;
|
|
102
|
+
left: 0;
|
|
103
|
+
width: 2px;
|
|
104
|
+
height: auto;
|
|
105
|
+
top: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.xt-tabs--card .xt-tabs__nav-indicator {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.xt-tabs__content {
|
|
113
|
+
flex: 1;
|
|
114
|
+
padding: 20px 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.xt-tabs--card .xt-tabs__content {
|
|
118
|
+
border: 1px solid $xt-color-border-light;
|
|
119
|
+
border-top: none;
|
|
120
|
+
border-radius: 0 0 4px 4px;
|
|
121
|
+
padding: 20px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.xt-tabs--left .xt-tabs__content,
|
|
125
|
+
.xt-tabs--right .xt-tabs__content {
|
|
126
|
+
padding: 0 20px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.xt-tabs__pane {
|
|
130
|
+
animation: xt-tabs-fade-in 0.3s ease;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@keyframes xt-tabs-fade-in {
|
|
134
|
+
from {
|
|
135
|
+
opacity: 0;
|
|
136
|
+
transform: translateY(10px);
|
|
137
|
+
}
|
|
138
|
+
to {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
transform: translateY(0);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.xt-tabs-fade-enter-active,
|
|
145
|
+
.xt-tabs-fade-leave-active {
|
|
146
|
+
transition: opacity 0.3s ease, transform 0.3s ease;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.xt-tabs-fade-enter {
|
|
150
|
+
opacity: 0;
|
|
151
|
+
transform: translateY(10px);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.xt-tabs-fade-leave-to {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
transform: translateY(-10px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-theme='dark'], html.dark {
|
|
160
|
+
.xt-tabs__header {
|
|
161
|
+
border-color: $xt-dark-color-border;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.xt-tabs--card .xt-tabs__header {
|
|
165
|
+
background: $xt-dark-color-bg-secondary;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.xt-tabs--card .xt-tabs__nav-item--active {
|
|
169
|
+
background: $xt-dark-color-bg-primary;
|
|
170
|
+
border-color: $xt-dark-color-border;
|
|
171
|
+
border-bottom-color: $xt-dark-color-bg-primary;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.xt-tabs--left .xt-tabs__header {
|
|
175
|
+
border-color: $xt-dark-color-border;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.xt-tabs--right .xt-tabs__header {
|
|
179
|
+
border-color: $xt-dark-color-border;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.xt-tabs__nav-item {
|
|
183
|
+
color: $xt-dark-color-text-secondary;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.xt-tabs__nav-item:hover {
|
|
187
|
+
color: $xt-dark-color-primary;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.xt-tabs__nav-item--active {
|
|
191
|
+
color: $xt-dark-color-primary;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.xt-tabs--card .xt-tabs__content {
|
|
195
|
+
border-color: $xt-dark-color-border;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
type ? 'xt-text--' + type : '',
|
|
6
6
|
'xt-text--' + size,
|
|
7
7
|
{ 'xt-text--bold': bold },
|
|
8
|
-
{ 'xt-text--money': format === 'money' }
|
|
8
|
+
{ 'xt-text--money': format === 'money' },
|
|
9
|
+
{ 'xt-text--ellipsis': ellipsis },
|
|
10
|
+
{ 'xt-text--ellipsis-multiline': ellipsis && ellipsisRows > 1 }
|
|
9
11
|
]"
|
|
10
12
|
:style="customStyle"
|
|
11
13
|
>
|
|
@@ -43,6 +45,15 @@ export default {
|
|
|
43
45
|
type: [String, Number],
|
|
44
46
|
default: ''
|
|
45
47
|
},
|
|
48
|
+
ellipsis: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
ellipsisRows: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 1,
|
|
55
|
+
validator: (val) => val >= 1 && val <= 10
|
|
56
|
+
},
|
|
46
57
|
|
|
47
58
|
// 格式化模式:normal 普通 | thousand 千分位 | money 金额
|
|
48
59
|
format: {
|
|
@@ -98,6 +109,9 @@ export default {
|
|
|
98
109
|
if (this.letterSpacing) {
|
|
99
110
|
style.letterSpacing = typeof this.letterSpacing === 'number' ? `${this.letterSpacing}px` : this.letterSpacing
|
|
100
111
|
}
|
|
112
|
+
if (this.ellipsis && this.ellipsisRows > 1) {
|
|
113
|
+
style.WebkitLineClamp = this.ellipsisRows
|
|
114
|
+
}
|
|
101
115
|
return style
|
|
102
116
|
},
|
|
103
117
|
|
|
@@ -52,6 +52,24 @@
|
|
|
52
52
|
font-weight: bold;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// 单行省略
|
|
56
|
+
.xt-text--ellipsis {
|
|
57
|
+
display: inline-block;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 多行省略
|
|
65
|
+
.xt-text--ellipsis-multiline {
|
|
66
|
+
display: -webkit-box;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
-webkit-box-orient: vertical;
|
|
69
|
+
text-overflow: ellipsis;
|
|
70
|
+
max-width: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
55
73
|
// 金额样式
|
|
56
74
|
.xt-text--money {
|
|
57
75
|
font-family: 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
package/src/index.js
CHANGED
|
@@ -30,14 +30,14 @@ import XtMap from './components/xt-map'
|
|
|
30
30
|
import XtMapProvider from './components/xt-map-provider'
|
|
31
31
|
import XtGridBox from './components/xt-grid-box'
|
|
32
32
|
import XtGridItem from './components/xt-grid-item'
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
33
|
+
import XtProgress from './components/xt-progress'
|
|
34
|
+
import XtTabs from './components/xt-tabs'
|
|
35
|
+
import XtBadge from './components/xt-badge'
|
|
36
|
+
import XtDatePicker from './components/xt-date-picker'
|
|
37
|
+
import XtChart from './components/xt-chart' // XtChart 组件(基于 ECharts 封装)
|
|
38
|
+
import XtIcon from './components/xt-icon' // XtIcon 组件(支持 el-icon / svg / 自定义字体)
|
|
39
|
+
import XtTable from './components/xt-table' // XtTable 组件(基于 ElementUI Table 封装)
|
|
39
40
|
|
|
40
|
-
import { registerElementExComponents, registerElementDirectives } from './config/element-registry'
|
|
41
41
|
|
|
42
42
|
const components = [
|
|
43
43
|
XtButton,
|
|
@@ -54,12 +54,13 @@ const components = [
|
|
|
54
54
|
XtMapProvider,
|
|
55
55
|
XtGridBox,
|
|
56
56
|
XtGridItem,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
XtProgress,
|
|
58
|
+
XtTabs,
|
|
59
|
+
XtBadge,
|
|
60
|
+
XtDatePicker,
|
|
61
|
+
XtChart,
|
|
62
|
+
XtIcon,
|
|
63
|
+
XtTable
|
|
63
64
|
]
|
|
64
65
|
|
|
65
66
|
const install = function (Vue, options = {}) {
|
|
@@ -98,13 +99,6 @@ const install = function (Vue, options = {}) {
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
try {
|
|
102
|
-
const ElementUI = require('element-ui')
|
|
103
|
-
registerElementExComponents(Vue, ElementUI)
|
|
104
|
-
registerElementDirectives(Vue, ElementUI)
|
|
105
|
-
} catch (e) {
|
|
106
|
-
console.warn('[XtElementUI] ElementUI 未安装,Ex 系列组件可能无法正常使用')
|
|
107
|
-
}
|
|
108
102
|
}
|
|
109
103
|
|
|
110
104
|
// 支持全局 script 标签引入
|
|
@@ -115,9 +109,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
115
109
|
// 导出
|
|
116
110
|
export default {
|
|
117
111
|
install,
|
|
118
|
-
// 导出组件列表
|
|
119
112
|
components,
|
|
120
|
-
// 按需导出组件
|
|
121
113
|
XtButton,
|
|
122
114
|
XtInput,
|
|
123
115
|
XtFlexBox,
|
|
@@ -132,18 +124,19 @@ export default {
|
|
|
132
124
|
XtMapProvider,
|
|
133
125
|
XtGridBox,
|
|
134
126
|
XtGridItem,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
127
|
+
XtProgress,
|
|
128
|
+
XtTabs,
|
|
129
|
+
XtBadge,
|
|
130
|
+
XtDatePicker,
|
|
131
|
+
XtIcon,
|
|
132
|
+
XtTable
|
|
140
133
|
}
|
|
141
134
|
|
|
142
|
-
//
|
|
143
|
-
export { default as
|
|
135
|
+
// XtChart 组件按需导出(使用时需自行安装 echarts 依赖)
|
|
136
|
+
export { default as XtChart } from './components/xt-chart'
|
|
144
137
|
|
|
145
|
-
//
|
|
146
|
-
export { createVirtualScrollData, virtualScrollColumns } from './components/
|
|
138
|
+
// XtTable 虚拟滚动演示数据工具
|
|
139
|
+
export { createVirtualScrollData, virtualScrollColumns } from './components/xt-table/virtualScrollData'
|
|
147
140
|
|
|
148
141
|
// 导出工具函数和变量
|
|
149
142
|
export {
|
package/src/utils/index.js
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
## ExBar - 柱状图组件
|
|
2
|
-
|
|
3
|
-
基于 ECharts 封装的柱状图组件。
|
|
4
|
-
|
|
5
|
-
## 基本用法
|
|
6
|
-
|
|
7
|
-
::: demo 柱状图基础示例
|
|
8
|
-
```vue
|
|
9
|
-
<template>
|
|
10
|
-
<ExChart type="bar" :chartData="chartData" style="height: 400px;" />
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
export default {
|
|
15
|
-
data() {
|
|
16
|
-
return {
|
|
17
|
-
chartData: [
|
|
18
|
-
{ name: '张三', value: 65 },
|
|
19
|
-
{ name: '李四', value: 78 },
|
|
20
|
-
{ name: '王五', value: 89 },
|
|
21
|
-
{ name: '赵六', value: 95 },
|
|
22
|
-
{ name: '钱七', value: 72 }
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
</script>
|
|
28
|
-
```
|
|
29
|
-
:::
|
|
30
|
-
|
|
31
|
-
## 显示标记点
|
|
32
|
-
|
|
33
|
-
::: demo 显示最大值和最小值标记点
|
|
34
|
-
```vue
|
|
35
|
-
<template>
|
|
36
|
-
<ExChart type="bar" :chartData="chartData" :markPoint="true" style="height: 400px;" />
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script>
|
|
40
|
-
export default {
|
|
41
|
-
data() {
|
|
42
|
-
return {
|
|
43
|
-
chartData: [
|
|
44
|
-
{ name: '华东区', value: 1250 },
|
|
45
|
-
{ name: '华南区', value: 980 },
|
|
46
|
-
{ name: '华北区', value: 890 },
|
|
47
|
-
{ name: '西南区', value: 720 },
|
|
48
|
-
{ name: '西北区', value: 560 }
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
```
|
|
55
|
-
:::
|
|
56
|
-
|
|
57
|
-
## 属性说明
|
|
58
|
-
|
|
59
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
60
|
-
|------|------|--------|------|
|
|
61
|
-
| `chartData` | Array | [] | 图表数据 |
|
|
62
|
-
| `theme` | String | '' | 主题名称 |
|
|
63
|
-
| `size` | String | 'medium' | 尺寸 |
|
|
64
|
-
| `markPoint` | Boolean | false | 是否显示标记点 |
|
|
65
|
-
| `showZoom` | Boolean | false | 是否显示缩放功能 |
|
|
66
|
-
| `reverse` | Boolean | false | 是否反转坐标轴 |
|
|
67
|
-
| `longLable` | Boolean | false | 是否启用长标签模式 |
|
|
68
|
-
| `energyType` | String | '' | Y轴单位 |
|