cy-element-ui 1.0.9 → 1.0.11

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.
Files changed (109) hide show
  1. package/lib/alert.js +2 -2
  2. package/lib/aside.js +2 -2
  3. package/lib/autocomplete.js +11 -14
  4. package/lib/avatar.js +2 -2
  5. package/lib/backtop.js +2 -2
  6. package/lib/badge.js +2 -2
  7. package/lib/breadcrumb-item.js +4 -4
  8. package/lib/breadcrumb.js +2 -2
  9. package/lib/button-group.js +2 -2
  10. package/lib/calendar.js +393 -34
  11. package/lib/card.js +2 -2
  12. package/lib/carousel-item.js +6 -6
  13. package/lib/carousel.js +9 -9
  14. package/lib/cascader-panel.js +19 -22
  15. package/lib/cascader.js +34 -37
  16. package/lib/checkbox-button.js +4 -4
  17. package/lib/checkbox-group.js +2 -2
  18. package/lib/col.js +4 -4
  19. package/lib/collapse-item.js +797 -712
  20. package/lib/collapse.js +2 -2
  21. package/lib/color-picker.js +8 -11
  22. package/lib/container.js +2 -2
  23. package/lib/date-picker.js +386 -27
  24. package/lib/descriptions-item.js +2 -2
  25. package/lib/descriptions.js +2 -2
  26. package/lib/dialog.js +7 -10
  27. package/lib/divider.js +2 -2
  28. package/lib/drawer.js +4 -4
  29. package/lib/dropdown-item.js +2 -2
  30. package/lib/dropdown-menu.js +12 -12
  31. package/lib/dropdown.js +1205 -1111
  32. package/lib/element-ui.common.js +1213 -1261
  33. package/lib/empty.js +6 -9
  34. package/lib/fileUpload.js +44 -48
  35. package/lib/footer.js +2 -2
  36. package/lib/form-item.js +11 -14
  37. package/lib/form.js +4 -4
  38. package/lib/header.js +2 -2
  39. package/lib/icon.js +2 -2
  40. package/lib/image.js +16 -19
  41. package/lib/index.js +1 -1
  42. package/lib/infinite-scroll.js +10 -10
  43. package/lib/input-number.js +13 -16
  44. package/lib/input.js +4 -4
  45. package/lib/link.js +2 -2
  46. package/lib/loading.js +28 -28
  47. package/lib/main.js +2 -2
  48. package/lib/menu-item-group.js +2 -2
  49. package/lib/menu-item.js +12 -15
  50. package/lib/menu.js +7 -10
  51. package/lib/message-box.js +11 -14
  52. package/lib/message.js +7 -10
  53. package/lib/notification.js +7 -10
  54. package/lib/option-group.js +2 -2
  55. package/lib/option.js +18 -21
  56. package/lib/page-header.js +6 -6
  57. package/lib/pagination.js +39 -42
  58. package/lib/popconfirm.js +11 -15
  59. package/lib/popover.js +8 -9
  60. package/lib/progress.js +5 -5
  61. package/lib/radio-button.js +4 -4
  62. package/lib/radio-group.js +4 -4
  63. package/lib/radio.js +2 -2
  64. package/lib/rate.js +10 -10
  65. package/lib/result.js +2 -2
  66. package/lib/row.js +2 -2
  67. package/lib/scrollbar.js +5 -5
  68. package/lib/select.js +24 -27
  69. package/lib/skeleton-item.js +2 -2
  70. package/lib/skeleton.js +2 -2
  71. package/lib/slider.js +24 -27
  72. package/lib/spinner.js +2 -2
  73. package/lib/step.js +2 -2
  74. package/lib/steps.js +6 -6
  75. package/lib/subTitle.js +91 -91
  76. package/lib/submenu.js +121 -121
  77. package/lib/switch.js +9 -12
  78. package/lib/tab-pane.js +2 -2
  79. package/lib/tabDialog.js +15 -18
  80. package/lib/table-column.js +12 -12
  81. package/lib/table.js +32 -35
  82. package/lib/tabs.js +6 -9
  83. package/lib/theme-chalk/src/index.scss +0 -1
  84. package/lib/time-picker.js +387 -28
  85. package/lib/time-select.js +385 -26
  86. package/lib/timeline-item.js +2 -2
  87. package/lib/timeline.js +2 -2
  88. package/lib/tooltip.js +6 -6
  89. package/lib/transfer.js +9 -12
  90. package/lib/tree.js +18 -21
  91. package/lib/treeSelect.js +12 -16
  92. package/lib/upload.js +20 -23
  93. package/lib/utils/date.js +5 -5
  94. package/lib/utils/date_source.js +290 -304
  95. package/lib/utils/lodash.js +10 -11
  96. package/lib/utils/lodash_source.js +9290 -9290
  97. package/package.json +1 -3
  98. package/packages/theme-chalk/src/index.scss +0 -1
  99. package/src/index.js +1 -4
  100. package/src/utils/date.js +2 -2
  101. package/src/utils/date_source.js +305 -321
  102. package/src/utils/lodash.js +9 -2
  103. package/src/utils/lodash_source.js +18079 -18064
  104. package/lib/statistic.js +0 -650
  105. package/lib/theme-chalk/src/statistic.scss +0 -38
  106. package/packages/statistic/index.js +0 -8
  107. package/packages/statistic/src/main.vue +0 -203
  108. package/packages/theme-chalk/src/statistic.scss +0 -38
  109. package/types/statistic.d.ts +0 -37
@@ -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
- }
@@ -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
- }