cy-element-ui 1.0.8 → 1.0.10
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/lib/alert.js +2 -2
- package/lib/aside.js +76 -76
- package/lib/autocomplete.js +61 -75
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +109 -109
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +2 -2
- package/lib/button-group.js +2 -2
- package/lib/calendar.js +391 -452
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +9 -9
- package/lib/carousel.js +25 -25
- package/lib/cascader-panel.js +30 -34
- package/lib/cascader.js +101 -116
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +2 -2
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +936 -851
- package/lib/collapse.js +2 -2
- package/lib/color-picker.js +62 -76
- package/lib/container.js +2 -2
- package/lib/date-picker.js +450 -474
- package/lib/descriptions-item.js +2 -2
- package/lib/descriptions.js +4 -4
- package/lib/dialog.js +5 -9
- package/lib/divider.js +105 -105
- package/lib/drawer.js +109 -109
- package/lib/dropdown-item.js +2 -2
- package/lib/dropdown-menu.js +65 -65
- package/lib/dropdown.js +1206 -1112
- package/lib/element-ui.common.js +43826 -48176
- package/lib/empty.js +6 -20
- package/lib/fileUpload.js +62 -77
- package/lib/footer.js +76 -76
- package/lib/form-item.js +7 -21
- package/lib/form.js +11 -11
- package/lib/header.js +2 -2
- package/lib/icon.js +2 -2
- package/lib/image.js +22 -36
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +8 -8
- package/lib/input-number.js +5 -9
- package/lib/link.js +2 -2
- package/lib/loading.js +33 -33
- package/lib/main.js +65 -65
- package/lib/menu-item-group.js +2 -2
- package/lib/menu-item.js +63 -78
- package/lib/menu.js +2 -16
- package/lib/message-box.js +22 -36
- package/lib/message.js +8 -22
- package/lib/notification.js +8 -22
- package/lib/option-group.js +2 -2
- package/lib/option.js +14 -18
- package/lib/page-header.js +109 -109
- package/lib/pagination.js +100 -114
- package/lib/popconfirm.js +59 -74
- package/lib/popover.js +52 -56
- package/lib/progress.js +4 -4
- package/lib/radio-button.js +4 -4
- package/lib/radio-group.js +4 -4
- package/lib/radio.js +2 -2
- package/lib/rate.js +18 -18
- package/lib/result.js +2 -2
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +6 -6
- package/lib/select.js +82 -86
- package/lib/skeleton-item.js +2 -2
- package/lib/skeleton.js +107 -107
- package/lib/slider.js +72 -86
- package/lib/spinner.js +2 -2
- package/lib/step.js +2 -2
- package/lib/steps.js +9 -9
- package/lib/subTitle.js +91 -91
- package/lib/submenu.js +250 -250
- package/lib/switch.js +883 -811
- package/lib/tab-pane.js +2 -2
- package/lib/tabDialog.js +19 -33
- package/lib/table-column.js +13 -13
- package/lib/table.js +96 -110
- package/lib/tabs.js +8 -22
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/src/index.scss +0 -1
- package/lib/time-picker.js +450 -474
- package/lib/time-select.js +437 -461
- package/lib/timeline-item.js +107 -107
- package/lib/timeline.js +2 -2
- package/lib/tooltip.js +54 -55
- package/lib/transfer.js +15 -29
- package/lib/tree.js +22 -36
- package/lib/treeSelect.js +58 -73
- package/lib/upload.js +28 -32
- package/lib/utils/date.js +10 -3
- package/lib/utils/date_source.js +290 -304
- package/lib/utils/lodash_source.js +9290 -9290
- package/package.json +1 -1
- package/packages/theme-chalk/src/index.scss +0 -1
- package/src/index.js +1 -4
- package/src/utils/date.js +2 -2
- package/src/utils/date_source.js +305 -321
- package/src/utils/lodash_source.js +18079 -18064
- package/lib/statistic.js +0 -10484
- package/lib/theme-chalk/src/statistic.scss +0 -38
- package/packages/statistic/index.js +0 -8
- package/packages/statistic/src/main.vue +0 -203
- package/packages/theme-chalk/src/statistic.scss +0 -38
- package/types/statistic.d.ts +0 -37
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@import "mixins/mixins";
|
|
2
|
-
@import "common/var";
|
|
3
|
-
|
|
4
|
-
@include b(statistic) {
|
|
5
|
-
$statistic-justify: center;
|
|
6
|
-
$statistic-align: center;
|
|
7
|
-
width: 100%;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
color: $--color-black;
|
|
12
|
-
font-variant: tabular-nums;
|
|
13
|
-
list-style: none;
|
|
14
|
-
font-feature-settings: "tnum";
|
|
15
|
-
text-align: center;
|
|
16
|
-
.head {
|
|
17
|
-
margin-bottom: 4px;
|
|
18
|
-
color: $--color-text-regular;
|
|
19
|
-
font-size: $--font-size-small;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.con {
|
|
23
|
-
font-family: Sans-serif;
|
|
24
|
-
display: flex;
|
|
25
|
-
justify-content: $statistic-justify;
|
|
26
|
-
align-items: $statistic-align;
|
|
27
|
-
color: $--color-text-primary;
|
|
28
|
-
.number {
|
|
29
|
-
font-size: $--font-size-extra-large;
|
|
30
|
-
padding: 0 4px;
|
|
31
|
-
}
|
|
32
|
-
span {
|
|
33
|
-
display: inline-block;
|
|
34
|
-
margin: 0;
|
|
35
|
-
line-height: 100%;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="el-statistic">
|
|
3
|
-
<div class="head" v-if="title||$slots.title">
|
|
4
|
-
<slot name="title">
|
|
5
|
-
<span class="title">
|
|
6
|
-
{{ title }}
|
|
7
|
-
</span>
|
|
8
|
-
</slot>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="con">
|
|
11
|
-
<span class="prefix" v-if="prefix||$slots.prefix">
|
|
12
|
-
<slot name="prefix" >
|
|
13
|
-
{{ prefix }}
|
|
14
|
-
</slot>
|
|
15
|
-
</span>
|
|
16
|
-
<span class="number" :style="valueStyle">
|
|
17
|
-
<slot name="formatter"> {{ disposeValue }}</slot>
|
|
18
|
-
</span>
|
|
19
|
-
<span class="suffix" v-if="suffix||$slots.suffix">
|
|
20
|
-
<slot name="suffix">
|
|
21
|
-
{{ suffix }}
|
|
22
|
-
</slot>
|
|
23
|
-
</span>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
import { isNumber, chain, multiply, padStart, reduce } from 'element-ui/src/utils/lodash';
|
|
30
|
-
export default {
|
|
31
|
-
name: 'ElStatistic',
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
disposeValue: '',
|
|
35
|
-
timeTask: null,
|
|
36
|
-
REFRESH_INTERVAL: 1000 / 30
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
props: {
|
|
40
|
-
decimalSeparator: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: '.'
|
|
43
|
-
},
|
|
44
|
-
groupSeparator: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: ''
|
|
47
|
-
},
|
|
48
|
-
precision: {
|
|
49
|
-
type: Number,
|
|
50
|
-
default: null
|
|
51
|
-
},
|
|
52
|
-
value: {
|
|
53
|
-
type: [String, Number, Date],
|
|
54
|
-
default: ''
|
|
55
|
-
},
|
|
56
|
-
prefix: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: ''
|
|
59
|
-
},
|
|
60
|
-
suffix: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: ''
|
|
63
|
-
},
|
|
64
|
-
title: {
|
|
65
|
-
type: [String, Number],
|
|
66
|
-
default: ''
|
|
67
|
-
},
|
|
68
|
-
timeIndices: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: false
|
|
71
|
-
},
|
|
72
|
-
valueStyle: {
|
|
73
|
-
type: Object,
|
|
74
|
-
default: function() {
|
|
75
|
-
return {};
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
format: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: 'HH:mm:ss:SSS'
|
|
81
|
-
},
|
|
82
|
-
rate: {
|
|
83
|
-
type: Number,
|
|
84
|
-
default: 1000
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
created() {
|
|
88
|
-
this.branch();
|
|
89
|
-
},
|
|
90
|
-
watch: {
|
|
91
|
-
value: function() {
|
|
92
|
-
this.branch();
|
|
93
|
-
},
|
|
94
|
-
groupSeparator() {
|
|
95
|
-
this.dispose();
|
|
96
|
-
},
|
|
97
|
-
mulriple() {
|
|
98
|
-
this.dispose();
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
methods: {
|
|
102
|
-
branch() {
|
|
103
|
-
let { timeIndices, countDown, dispose } = this;
|
|
104
|
-
if (timeIndices) {
|
|
105
|
-
countDown(this.value.valueOf() || this.value);
|
|
106
|
-
} else {
|
|
107
|
-
dispose();
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
magnification(num, mulriple = 1000, groupSeparator = ',') {
|
|
111
|
-
// magnification factor
|
|
112
|
-
const level = String(mulriple).length;
|
|
113
|
-
return num.replace(new RegExp(`(\\d)(?=(\\d{${ level - 1 }})+$)`, 'g'), `$1${ groupSeparator }`);
|
|
114
|
-
},
|
|
115
|
-
dispose() {
|
|
116
|
-
let { value, rate, groupSeparator } = this;
|
|
117
|
-
if (!isNumber(value)) return false;
|
|
118
|
-
if (this.precision) {
|
|
119
|
-
value = value.toFixed(this.precision);
|
|
120
|
-
}
|
|
121
|
-
let [integer, decimal] = String(value).split('.');
|
|
122
|
-
// 1000 multiplying power
|
|
123
|
-
if (groupSeparator) {
|
|
124
|
-
integer = this.magnification(integer, rate, groupSeparator);
|
|
125
|
-
}
|
|
126
|
-
let result = `${ integer }${ decimal ? this.decimalSeparator + decimal : '' }`;
|
|
127
|
-
this.disposeValue = result;
|
|
128
|
-
return result;
|
|
129
|
-
},
|
|
130
|
-
diffDate(minuend, subtrahend) {
|
|
131
|
-
return Math.max(minuend - subtrahend, 0);
|
|
132
|
-
},
|
|
133
|
-
suspend(isStop) {
|
|
134
|
-
if (isStop) {
|
|
135
|
-
if (this.timeTask) {
|
|
136
|
-
clearInterval(this.timeTask);
|
|
137
|
-
this.timeTask = null;
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
this.branch();
|
|
141
|
-
}
|
|
142
|
-
return this.disposeValue;
|
|
143
|
-
},
|
|
144
|
-
formatTimeStr: function(time) {
|
|
145
|
-
let { format } = this;
|
|
146
|
-
const escapeRegex = /\[[^\]]*]/g;
|
|
147
|
-
const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
|
|
148
|
-
const timeUnits = [
|
|
149
|
-
['Y', 1000 * 60 * 60 * 24 * 365], // years
|
|
150
|
-
['M', 1000 * 60 * 60 * 24 * 30], // months
|
|
151
|
-
['D', 1000 * 60 * 60 * 24], // days
|
|
152
|
-
['H', 1000 * 60 * 60], // hours
|
|
153
|
-
['m', 1000 * 60], // minutes
|
|
154
|
-
['s', 1000], // seconds
|
|
155
|
-
['S', 1] // million seconds
|
|
156
|
-
];
|
|
157
|
-
let formatText = reduce(
|
|
158
|
-
timeUnits,
|
|
159
|
-
(con, item) => {
|
|
160
|
-
const name = item[0];
|
|
161
|
-
return con.replace(new RegExp(`${ name }+`, 'g'), (match) => {
|
|
162
|
-
let sum = chain(time).divide(item[1]).floor(0).value();
|
|
163
|
-
time -= multiply(sum, item[1]);
|
|
164
|
-
return padStart(String(sum), String(match).length, 0);
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
format
|
|
168
|
-
);
|
|
169
|
-
let index = 0;
|
|
170
|
-
return formatText.replace(escapeRegex, () => {
|
|
171
|
-
const match = keepList[index];
|
|
172
|
-
index += 1;
|
|
173
|
-
return match;
|
|
174
|
-
});
|
|
175
|
-
},
|
|
176
|
-
stopTime(time) {
|
|
177
|
-
let result = true; // stop
|
|
178
|
-
if (time) {
|
|
179
|
-
this.$emit('change', time);
|
|
180
|
-
result = false;
|
|
181
|
-
} else {
|
|
182
|
-
result = true;
|
|
183
|
-
this.suspend(true);
|
|
184
|
-
this.$emit('finish', true);
|
|
185
|
-
}
|
|
186
|
-
return result;
|
|
187
|
-
},
|
|
188
|
-
countDown(timeVlaue) {
|
|
189
|
-
let { REFRESH_INTERVAL, timeTask, diffDate, formatTimeStr, stopTime, suspend } = this;
|
|
190
|
-
if (timeTask) return;
|
|
191
|
-
let than = this;
|
|
192
|
-
this.timeTask = setInterval(() => {
|
|
193
|
-
let diffTiem = diffDate(timeVlaue, Date.now());
|
|
194
|
-
than.disposeValue = formatTimeStr(diffTiem);
|
|
195
|
-
stopTime(diffTiem);
|
|
196
|
-
}, REFRESH_INTERVAL);
|
|
197
|
-
this.$once('hook:beforeDestroy', () => {
|
|
198
|
-
suspend(true);
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
</script>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@import "mixins/mixins";
|
|
2
|
-
@import "common/var";
|
|
3
|
-
|
|
4
|
-
@include b(statistic) {
|
|
5
|
-
$statistic-justify: center;
|
|
6
|
-
$statistic-align: center;
|
|
7
|
-
width: 100%;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
color: $--color-black;
|
|
12
|
-
font-variant: tabular-nums;
|
|
13
|
-
list-style: none;
|
|
14
|
-
font-feature-settings: "tnum";
|
|
15
|
-
text-align: center;
|
|
16
|
-
.head {
|
|
17
|
-
margin-bottom: 4px;
|
|
18
|
-
color: $--color-text-regular;
|
|
19
|
-
font-size: $--font-size-small;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.con {
|
|
23
|
-
font-family: Sans-serif;
|
|
24
|
-
display: flex;
|
|
25
|
-
justify-content: $statistic-justify;
|
|
26
|
-
align-items: $statistic-align;
|
|
27
|
-
color: $--color-text-primary;
|
|
28
|
-
.number {
|
|
29
|
-
font-size: $--font-size-extra-large;
|
|
30
|
-
padding: 0 4px;
|
|
31
|
-
}
|
|
32
|
-
span {
|
|
33
|
-
display: inline-block;
|
|
34
|
-
margin: 0;
|
|
35
|
-
line-height: 100%;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
package/types/statistic.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ElementUIComponent } from './component'
|
|
2
|
-
|
|
3
|
-
/** Statistic Component */
|
|
4
|
-
export declare class ElStatistic extends ElementUIComponent {
|
|
5
|
-
/** Set the decimal point */
|
|
6
|
-
decimalSeparator: string
|
|
7
|
-
|
|
8
|
-
/** Sets the thousandth identifier */
|
|
9
|
-
groupSeparator: string
|
|
10
|
-
|
|
11
|
-
/** numerical precision */
|
|
12
|
-
precision: number
|
|
13
|
-
|
|
14
|
-
/** Numerical content */
|
|
15
|
-
value: string | number
|
|
16
|
-
|
|
17
|
-
/** Title of numerical value */
|
|
18
|
-
title: string | number
|
|
19
|
-
|
|
20
|
-
/** Whether to enable the countdown function */
|
|
21
|
-
timeIndices: boolean
|
|
22
|
-
|
|
23
|
-
/** Sets the style of the value */
|
|
24
|
-
valueStyle: object
|
|
25
|
-
|
|
26
|
-
/** Numeric content formatting countdown display */
|
|
27
|
-
format: string
|
|
28
|
-
|
|
29
|
-
/** Set the ratio */
|
|
30
|
-
rate: number
|
|
31
|
-
|
|
32
|
-
/** Set the suffix of the value */
|
|
33
|
-
suffix: string
|
|
34
|
-
|
|
35
|
-
/** Set the prefix of the value */
|
|
36
|
-
prefix: string
|
|
37
|
-
}
|