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
package/package.json
CHANGED
|
@@ -27,14 +27,17 @@
|
|
|
27
27
|
// Time 组件样式
|
|
28
28
|
@import './xt-time/style/index.scss';
|
|
29
29
|
|
|
30
|
-
// ExButton 组件样式
|
|
31
|
-
@import './ex-button/style/index.scss';
|
|
32
|
-
|
|
33
|
-
// ExCard 组件样式
|
|
34
|
-
@import './ex-card/style/index.scss';
|
|
35
|
-
|
|
36
30
|
// GridBox 组件样式
|
|
37
31
|
@import './xt-grid-box/style/index.scss';
|
|
38
32
|
|
|
39
|
-
//
|
|
40
|
-
@import './
|
|
33
|
+
// Icon 组件样式
|
|
34
|
+
@import './xt-icon/style/index.scss';
|
|
35
|
+
|
|
36
|
+
// Progress 组件样式
|
|
37
|
+
@import './xt-progress/style/index.scss';
|
|
38
|
+
|
|
39
|
+
// Tabs 组件样式
|
|
40
|
+
@import './xt-tabs/style/index.scss';
|
|
41
|
+
|
|
42
|
+
// Badge 组件样式
|
|
43
|
+
@import './xt-badge/style/index.scss';
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
]">
|
|
8
|
+
<span class="xt-badge__content">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</span>
|
|
11
|
+
<span
|
|
12
|
+
v-if="!hidden && (value || isDot)"
|
|
13
|
+
class="xt-badge__badge"
|
|
14
|
+
:style="badgeStyle"
|
|
15
|
+
>
|
|
16
|
+
<template v-if="isDot"></template>
|
|
17
|
+
<template v-else-if="showOverflow && value > max">{{ max }}+</template>
|
|
18
|
+
<template v-else>{{ value }}</template>
|
|
19
|
+
</span>
|
|
20
|
+
</span>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: 'XtBadge',
|
|
26
|
+
props: {
|
|
27
|
+
value: {
|
|
28
|
+
type: [Number, String],
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
type: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'primary',
|
|
34
|
+
validator: (val) => ['primary', 'success', 'warning', 'danger', 'info'].includes(val)
|
|
35
|
+
},
|
|
36
|
+
max: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 99
|
|
39
|
+
},
|
|
40
|
+
isDot: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
hidden: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
showOverflow: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
fixed: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
color: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ''
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
badgeStyle() {
|
|
63
|
+
const style = {}
|
|
64
|
+
if (this.color) {
|
|
65
|
+
style.backgroundColor = this.color
|
|
66
|
+
}
|
|
67
|
+
return style
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@import '../../../styles/variables.scss';
|
|
2
|
+
|
|
3
|
+
.xt-badge {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.xt-badge__content {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.xt-badge__badge {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: -6px;
|
|
17
|
+
right: -8px;
|
|
18
|
+
min-width: 18px;
|
|
19
|
+
height: 18px;
|
|
20
|
+
padding: 0 5px;
|
|
21
|
+
border-radius: 9px;
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
line-height: 18px;
|
|
25
|
+
color: #ffffff;
|
|
26
|
+
text-align: center;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
background: $xt-color-danger;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.xt-badge--dot .xt-badge__badge {
|
|
32
|
+
min-width: 8px;
|
|
33
|
+
width: 8px;
|
|
34
|
+
height: 8px;
|
|
35
|
+
padding: 0;
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.xt-badge--fixed .xt-badge__badge {
|
|
40
|
+
top: -4px;
|
|
41
|
+
right: -4px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.xt-badge--primary .xt-badge__badge {
|
|
45
|
+
background: $xt-color-primary;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.xt-badge--success .xt-badge__badge {
|
|
49
|
+
background: $xt-color-success;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.xt-badge--warning .xt-badge__badge {
|
|
53
|
+
background: $xt-color-warning;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.xt-badge--danger .xt-badge__badge {
|
|
57
|
+
background: $xt-color-danger;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.xt-badge--info .xt-badge__badge {
|
|
61
|
+
background: $xt-color-info;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.xt-badge--hidden {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-theme='dark'], html.dark {
|
|
69
|
+
.xt-badge--primary .xt-badge__badge {
|
|
70
|
+
background: $xt-dark-color-primary;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.xt-badge--success .xt-badge__badge {
|
|
74
|
+
background: $xt-dark-color-success;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.xt-badge--warning .xt-badge__badge {
|
|
78
|
+
background: $xt-dark-color-warning;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.xt-badge--danger .xt-badge__badge {
|
|
82
|
+
background: $xt-dark-color-danger;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.xt-badge--info .xt-badge__badge {
|
|
86
|
+
background: $xt-dark-color-info;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import XtButton from './index.vue'
|
|
2
|
-
|
|
3
|
-
XtButton.install = function (Vue) {
|
|
4
|
-
Vue.component(XtButton.name, XtButton)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default XtButton
|
|
8
|
-
export { XtButton }
|
|
1
|
+
import XtButton from './index.vue'
|
|
2
|
+
|
|
3
|
+
XtButton.install = function (Vue) {
|
|
4
|
+
Vue.component(XtButton.name, XtButton)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default XtButton
|
|
8
|
+
export { XtButton }
|
|
@@ -1,97 +1,67 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<button
|
|
3
|
-
class="
|
|
4
|
-
:class="
|
|
5
|
-
|
|
6
|
-
size ? 'xt-button--' + size : '',
|
|
7
|
-
{
|
|
8
|
-
'is-plain': plain,
|
|
9
|
-
'is-disabled': disabled,
|
|
10
|
-
'is-round': round,
|
|
11
|
-
'is-circle': circle,
|
|
12
|
-
'is-dashed': dashed,
|
|
13
|
-
'is-text': text,
|
|
14
|
-
'is-link': link,
|
|
15
|
-
'is-loading': loading
|
|
16
|
-
}
|
|
17
|
-
]"
|
|
18
|
-
:disabled="disabled || loading"
|
|
2
|
+
<el-button
|
|
3
|
+
class="ex-button"
|
|
4
|
+
:class="buttonClasses"
|
|
5
|
+
v-bind="$attrs"
|
|
19
6
|
@click="handleClick"
|
|
20
7
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
<span v-if="$slots.default" class="xt-button__inner">
|
|
24
|
-
<slot></slot>
|
|
25
|
-
</span>
|
|
26
|
-
</button>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</el-button>
|
|
27
10
|
</template>
|
|
28
|
-
|
|
29
11
|
<script>
|
|
30
12
|
export default {
|
|
31
13
|
name: 'XtButton',
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
inject: {
|
|
16
|
+
xtConfig: {
|
|
17
|
+
default: () => ({
|
|
18
|
+
theme: 'light',
|
|
19
|
+
size: 'medium',
|
|
20
|
+
primaryColor: '#1890ff'
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
},
|
|
32
24
|
props: {
|
|
33
25
|
type: {
|
|
34
26
|
type: String,
|
|
35
|
-
default: '',
|
|
36
|
-
validator: (val) => ['', 'primary', 'success', 'warning', 'danger'].includes(val)
|
|
37
|
-
},
|
|
38
|
-
size: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: '',
|
|
41
|
-
validator: (val) => ['', 'large', 'medium', 'small'].includes(val)
|
|
42
|
-
},
|
|
43
|
-
plain: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: false
|
|
46
|
-
},
|
|
47
|
-
disabled: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: false
|
|
50
|
-
},
|
|
51
|
-
round: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default: false
|
|
27
|
+
default: 'default',
|
|
28
|
+
validator: (val) => ['default', 'primary', 'success', 'warning', 'danger'].includes(val)
|
|
54
29
|
},
|
|
55
|
-
|
|
56
|
-
type:
|
|
57
|
-
default:
|
|
30
|
+
throttle: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 0
|
|
58
33
|
},
|
|
59
|
-
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: false
|
|
62
|
-
},
|
|
63
|
-
text: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false
|
|
66
|
-
},
|
|
67
|
-
link: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false
|
|
70
|
-
},
|
|
71
|
-
icon: {
|
|
34
|
+
size: {
|
|
72
35
|
type: String,
|
|
73
|
-
default:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
36
|
+
default: null,
|
|
37
|
+
validator: (val) => !val || ['mini', 'small', 'medium', 'large'].includes(val)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
lastClickTime: 0
|
|
78
43
|
}
|
|
79
44
|
},
|
|
80
45
|
computed: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return
|
|
46
|
+
finalSize() {
|
|
47
|
+
// 优先使用组件自身的 size,其次继承 XtConfigProvider 的 size,最后使用默认值
|
|
48
|
+
return this.size || this.xtConfig.size || 'medium'
|
|
49
|
+
},
|
|
50
|
+
buttonClasses() {
|
|
51
|
+
return [
|
|
52
|
+
`ex-button-${this.finalSize}`,
|
|
53
|
+
`ex-button-${this.type}`
|
|
54
|
+
]
|
|
87
55
|
}
|
|
88
56
|
},
|
|
89
57
|
methods: {
|
|
90
58
|
handleClick() {
|
|
91
|
-
if (
|
|
92
|
-
|
|
59
|
+
if (this.throttle > 0 && Date.now() - this.lastClickTime < this.throttle) {
|
|
60
|
+
return
|
|
93
61
|
}
|
|
62
|
+
this.lastClickTime = Date.now()
|
|
63
|
+
this.$emit('click')
|
|
94
64
|
}
|
|
95
65
|
}
|
|
96
66
|
}
|
|
97
|
-
</script>
|
|
67
|
+
</script>
|