@ecolovo/uniapp-components 1.0.10 → 2.0.1
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/README.md +202 -66
- package/components/aspect/aspect.vue +24 -15
- package/components/badge/badge.scss +20 -0
- package/components/badge/badge.vue +49 -40
- package/components/button/button.scss +15 -0
- package/components/button/button.vue +121 -177
- package/components/checkbox/checkbox.scss +10 -0
- package/components/checkbox/checkbox.vue +118 -146
- package/components/checkbox-group/checkbox-group.vue +79 -85
- package/components/checkbox-group2/checkbox-group2.vue +111 -107
- package/components/checkbox-group2/checkbox2.vue +104 -0
- package/components/data-list/data-list.scss +9 -0
- package/components/data-list/data-list.vue +70 -79
- package/components/date-picker/date-picker-view.vue +125 -124
- package/components/date-picker/date-picker.vue +145 -146
- package/components/dialog/dialog-content.vue +39 -47
- package/components/dialog/dialog.scss +11 -0
- package/components/dialog/dialog.vue +125 -138
- package/components/dropdown/dropdown.scss +11 -0
- package/components/dropdown/dropdown.vue +55 -97
- package/components/empty/empty.scss +14 -0
- package/components/empty/empty.vue +42 -41
- package/components/flex/flex.vue +45 -54
- package/components/form/form.vue +29 -24
- package/components/form-item/form-item.scss +11 -0
- package/components/form-item/form-item.vue +43 -40
- package/components/icon/icon.vue +70 -85
- package/components/image/image.vue +35 -38
- package/components/input/input.vue +65 -79
- package/components/input/password-input.vue +34 -42
- package/components/list-page/list-page.vue +73 -99
- package/components/load-more/load-more.scss +12 -0
- package/components/load-more/load-more.vue +29 -29
- package/components/loading/animations/loading-animation1.vue +8 -8
- package/components/loading/animations/loading-animation2.vue +8 -9
- package/components/loading/animations/loading-animation3.vue +11 -11
- package/components/loading/animations/loading-animation4.vue +8 -8
- package/components/loading/loading.vue +19 -20
- package/components/message-box/message-box.vue +59 -41
- package/components/number-dialog/number-dialog.scss +9 -0
- package/components/number-dialog/number-dialog.vue +209 -204
- package/components/number-input/number-input.scss +9 -0
- package/components/number-input/number-input.vue +233 -232
- package/components/numpad/numpad.scss +9 -0
- package/components/numpad/numpad.vue +133 -150
- package/components/page/page-body.scss +15 -0
- package/components/page/page-body.vue +137 -119
- package/components/page/page-footer.scss +13 -0
- package/components/page/page-footer.vue +31 -33
- package/components/page/page-header.scss +17 -0
- package/components/page/page-header.vue +89 -94
- package/components/page/page.scss +9 -0
- package/components/page/page.vue +105 -81
- package/components/picker/picker-popup.vue +218 -209
- package/components/picker/picker.vue +99 -104
- package/components/popover/popover-content.vue +54 -63
- package/components/popover/popover-mask.vue +63 -63
- package/components/popover/popover.scss +28 -0
- package/components/popover/popover.vue +49 -47
- package/components/popup/popup-content.vue +49 -53
- package/components/popup/popup.scss +11 -0
- package/components/popup/popup.vue +117 -132
- package/components/price/price.scss +20 -0
- package/components/price/price.vue +31 -42
- package/components/search/search.scss +12 -0
- package/components/search/search.vue +93 -117
- package/components/searching/searching.vue +33 -40
- package/components/selector/selector.vue +43 -48
- package/components/switch/switch.scss +12 -0
- package/components/switch/switch.vue +99 -96
- package/components/tab/tab.scss +19 -0
- package/components/tab/tab.vue +151 -145
- package/components/textarea/textarea.vue +104 -101
- package/composable/component-name.d.ts +2 -0
- package/composable/component-name.js +8 -0
- package/composable/component-name.ts +10 -0
- package/configs/index.d.ts +25 -10
- package/configs/index.js +14 -23
- package/configs/index.ts +82 -0
- package/easyCom.d.ts +9 -0
- package/easyCom.js +1 -2
- package/easyCom.ts +31 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.ts +1 -0
- package/init.d.ts +4 -7
- package/init.js +5 -4
- package/init.ts +34 -0
- package/package.json +14 -4
- package/styles/utils/css-var.scss +12 -15
- package/styles/utils/ellipsis.scss +0 -7
- package/styles/utils/z-index.scss +1 -1
- package/styles/var/component.scss +21 -245
- package/utils/date.d.ts +47 -0
- package/utils/date.js +23 -43
- package/utils/date.ts +153 -0
- package/utils/freezeDeep.d.ts +1 -0
- package/utils/freezeDeep.js +4 -14
- package/utils/freezeDeep.ts +9 -0
- package/utils/price.d.ts +24 -0
- package/utils/price.js +14 -8
- package/utils/price.ts +57 -0
- package/utils/round.d.ts +2 -0
- package/utils/round.js +2 -14
- package/utils/round.ts +11 -0
- package/utils/windowInfo.d.ts +24 -0
- package/utils/windowInfo.js +8 -36
- package/utils/windowInfo.ts +50 -0
- package/components/checkbox-group2/checkbox.vue +0 -109
- package/components/datetime-picker/datetime-picker-view.vue +0 -209
- package/components/datetime-picker/datetime-picker.vue +0 -235
- package/components/form/mixin.js +0 -13
- package/components/list-page/list-page.js +0 -10
- package/components/table/table.vue +0 -112
- package/components/time-picker/time-picker-view.vue +0 -127
- package/components/time-picker/time-picker.vue +0 -140
- package/components/uploader/download.js +0 -81
- package/components/uploader/file-uploader.vue +0 -52
- package/components/uploader/files.js +0 -225
- package/components/uploader/media-uploader.vue +0 -189
- package/components/uploader/mixin.js +0 -171
- package/components/uploader/uni.js +0 -38
- package/components/uploader/upload-button.vue +0 -29
- package/components/uploader/uploader copy.vue +0 -547
- package/components/uploader/uploader.vue +0 -117
- package/mixins/componentName.js +0 -32
- package/mixins/listPage.js +0 -1
- package/mixins/windowInfo.js +0 -1
- package/utils/fileSize.js +0 -39
- package/utils/floor.js +0 -20
package/utils/fileSize.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { floor } from './floor';
|
|
2
|
-
|
|
3
|
-
const ONE_KB = 1024;
|
|
4
|
-
const ONE_MB = ONE_KB * 1024;
|
|
5
|
-
const ONE_GB = ONE_MB * 1024;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 格式化文件尺寸
|
|
9
|
-
* @param {number} size 文件大小 B
|
|
10
|
-
* @returns {{
|
|
11
|
-
* size: number;
|
|
12
|
-
* unit: 'B' | 'KB' | 'MB' | 'GB';
|
|
13
|
-
* formattedSize: string;
|
|
14
|
-
* }} 格式化后的大小
|
|
15
|
-
*/
|
|
16
|
-
export function fileSize(size) {
|
|
17
|
-
if (size < 0) {
|
|
18
|
-
return { size: -1, unit: 'B', formattedSize: '' };
|
|
19
|
-
}
|
|
20
|
-
const rtnObj = {};
|
|
21
|
-
if (size < 100) {
|
|
22
|
-
rtnObj.size = size;
|
|
23
|
-
rtnObj.unit = 'B';
|
|
24
|
-
} else if (size < ONE_KB) {
|
|
25
|
-
rtnObj.size = floor(size / ONE_KB, 2);
|
|
26
|
-
rtnObj.unit = 'KB';
|
|
27
|
-
} else if (size < ONE_MB) {
|
|
28
|
-
rtnObj.size = floor(size / ONE_KB, 0);
|
|
29
|
-
rtnObj.unit = 'KB';
|
|
30
|
-
} else if (size < ONE_GB) {
|
|
31
|
-
rtnObj.size = floor(size / ONE_MB, 1);
|
|
32
|
-
rtnObj.unit = 'MB';
|
|
33
|
-
} else {
|
|
34
|
-
rtnObj.size = floor(size / ONE_GB, 1);
|
|
35
|
-
rtnObj.unit = 'GB';
|
|
36
|
-
}
|
|
37
|
-
rtnObj.formattedSize = `${rtnObj.size} ${rtnObj.unit}`;
|
|
38
|
-
return rtnObj;
|
|
39
|
-
}
|
package/utils/floor.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { round } from './round';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 向下取值
|
|
5
|
-
* @param {number} val 需要处理的数据
|
|
6
|
-
* @param {number} precision 保留小数位数,默认不保留
|
|
7
|
-
* @returns {number} 处理后的数据
|
|
8
|
-
*/
|
|
9
|
-
export function floor(val, precision = 0) {
|
|
10
|
-
return Math.floor(+round(val, precision) + 'e' + precision) / Math.pow(10, precision);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 向下取值,并保留 2 位小数
|
|
15
|
-
* @param {number} val 需要处理的数据
|
|
16
|
-
* @returns {number} 处理后的数据
|
|
17
|
-
*/
|
|
18
|
-
export function floor2(val) {
|
|
19
|
-
return floor(val, 2);
|
|
20
|
-
}
|