@alfalab/core-components-file-upload-item 5.1.23 → 5.1.25
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/Component.js +1 -1
- package/cssm/utils.js +1 -1
- package/esm/Component.js +1 -1
- package/esm/index.css +22 -22
- package/esm/utils.js +1 -1
- package/index.css +22 -22
- package/modern/Component.js +1 -1
- package/modern/index.css +22 -22
- package/modern/utils.js +1 -1
- package/package.json +4 -4
- package/utils.js +1 -1
- package/send-stats.js +0 -82
package/Component.js
CHANGED
|
@@ -24,7 +24,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
24
24
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
25
25
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
26
26
|
|
|
27
|
-
var styles = {"component":"file-upload-
|
|
27
|
+
var styles = {"component":"file-upload-item__component_1rhap","infoSection":"file-upload-item__infoSection_1rhap","info":"file-upload-item__info_1rhap","icon":"file-upload-item__icon_1rhap","errorIcon":"file-upload-item__errorIcon_1rhap","successIcon":"file-upload-item__successIcon_1rhap","name":"file-upload-item__name_1rhap","meta":"file-upload-item__meta_1rhap","size":"file-upload-item__size_1rhap","delete":"file-upload-item__delete_1rhap","download":"file-upload-item__download_1rhap","errorWrapper":"file-upload-item__errorWrapper_1rhap","restore":"file-upload-item__restore_1rhap","spinnerWrapper":"file-upload-item__spinnerWrapper_1rhap","spinner":"file-upload-item__spinner_1rhap","uploadPercent":"file-upload-item__uploadPercent_1rhap"};
|
|
28
28
|
require('./index.css')
|
|
29
29
|
|
|
30
30
|
var FileUploadItem = function (_a) {
|
package/cssm/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ var DocumentTxtMIcon = require('@alfalab/icons-glyph/DocumentTxtMIcon');
|
|
|
9
9
|
var DocumentUnknownMIcon = require('@alfalab/icons-glyph/DocumentUnknownMIcon');
|
|
10
10
|
|
|
11
11
|
function humanFileSize(size) {
|
|
12
|
-
var units = ['
|
|
12
|
+
var units = ['Б', 'КБ', 'МБ', 'ГБ'];
|
|
13
13
|
var humanSize = Number(size);
|
|
14
14
|
var factor = 0;
|
|
15
15
|
while (humanSize >= 1024 && factor < units.length - 1) {
|
package/esm/Component.js
CHANGED
|
@@ -15,7 +15,7 @@ import '@alfalab/icons-glyph/DocumentPdfMIcon';
|
|
|
15
15
|
import '@alfalab/icons-glyph/DocumentTxtMIcon';
|
|
16
16
|
import '@alfalab/icons-glyph/DocumentUnknownMIcon';
|
|
17
17
|
|
|
18
|
-
var styles = {"component":"file-upload-
|
|
18
|
+
var styles = {"component":"file-upload-item__component_1rhap","infoSection":"file-upload-item__infoSection_1rhap","info":"file-upload-item__info_1rhap","icon":"file-upload-item__icon_1rhap","errorIcon":"file-upload-item__errorIcon_1rhap","successIcon":"file-upload-item__successIcon_1rhap","name":"file-upload-item__name_1rhap","meta":"file-upload-item__meta_1rhap","size":"file-upload-item__size_1rhap","delete":"file-upload-item__delete_1rhap","download":"file-upload-item__download_1rhap","errorWrapper":"file-upload-item__errorWrapper_1rhap","restore":"file-upload-item__restore_1rhap","spinnerWrapper":"file-upload-item__spinnerWrapper_1rhap","spinner":"file-upload-item__spinner_1rhap","uploadPercent":"file-upload-item__uploadPercent_1rhap"};
|
|
19
19
|
require('./index.css')
|
|
20
20
|
|
|
21
21
|
var FileUploadItem = function (_a) {
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: plx1w */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-primary: #dcdcdd;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
--gap-xl: 24px;
|
|
26
26
|
} :root {
|
|
27
27
|
} :root {
|
|
28
|
-
} .file-upload-
|
|
28
|
+
} .file-upload-item__component_1rhap {
|
|
29
29
|
font-size: 13px;
|
|
30
30
|
line-height: 16px;
|
|
31
31
|
font-weight: 400;
|
|
@@ -36,78 +36,78 @@
|
|
|
36
36
|
color: var(--color-light-text-secondary);
|
|
37
37
|
box-shadow: 0 -1px 0 0 var(--color-light-border-primary) inset;
|
|
38
38
|
box-sizing: border-box
|
|
39
|
-
} .file-upload-
|
|
39
|
+
} .file-upload-item__component_1rhap svg {
|
|
40
40
|
display: block;
|
|
41
|
-
} .file-upload-
|
|
41
|
+
} .file-upload-item__infoSection_1rhap {
|
|
42
42
|
display: flex;
|
|
43
43
|
flex-direction: column;
|
|
44
44
|
flex: 1;
|
|
45
45
|
margin-top: var(--gap-2xs);
|
|
46
46
|
margin-left: var(--gap-s);
|
|
47
47
|
min-width: 40%;
|
|
48
|
-
} .file-upload-
|
|
48
|
+
} .file-upload-item__info_1rhap {
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
flex: 1;
|
|
52
52
|
overflow: hidden;
|
|
53
|
-
} .file-upload-
|
|
53
|
+
} .file-upload-item__icon_1rhap {
|
|
54
54
|
display: block;
|
|
55
55
|
flex-shrink: 0;
|
|
56
56
|
color: var(--color-light-text-primary);
|
|
57
|
-
} .file-upload-
|
|
57
|
+
} .file-upload-item__errorIcon_1rhap {
|
|
58
58
|
flex-shrink: 0;
|
|
59
59
|
color: var(--color-light-graphic-negative);
|
|
60
|
-
} .file-upload-
|
|
60
|
+
} .file-upload-item__successIcon_1rhap {
|
|
61
61
|
flex-shrink: 0;
|
|
62
62
|
color: var(--color-light-graphic-positive);
|
|
63
|
-
} .file-upload-
|
|
63
|
+
} .file-upload-item__name_1rhap {
|
|
64
64
|
white-space: nowrap;
|
|
65
65
|
overflow: hidden;
|
|
66
66
|
text-overflow: ellipsis;
|
|
67
67
|
color: var(--color-light-text-primary)
|
|
68
|
-
} .file-upload-
|
|
68
|
+
} .file-upload-item__name_1rhap a {
|
|
69
69
|
display: block;
|
|
70
70
|
margin-bottom: 1px;
|
|
71
|
-
} .file-upload-
|
|
71
|
+
} .file-upload-item__meta_1rhap {
|
|
72
72
|
display: flex;
|
|
73
73
|
white-space: nowrap;
|
|
74
74
|
margin-right: var(--gap-2xs);
|
|
75
75
|
margin-left: var(--gap-xl);
|
|
76
76
|
padding: var(--gap-2xs) 0
|
|
77
|
-
} .file-upload-
|
|
77
|
+
} .file-upload-item__meta_1rhap > * {
|
|
78
78
|
margin-right: var(--gap-s)
|
|
79
|
-
} .file-upload-
|
|
79
|
+
} .file-upload-item__meta_1rhap > *:last-child {
|
|
80
80
|
margin-right: 0;
|
|
81
|
-
} .file-upload-
|
|
81
|
+
} .file-upload-item__size_1rhap {
|
|
82
82
|
text-align: right;
|
|
83
|
-
} .file-upload-
|
|
84
|
-
.file-upload-
|
|
83
|
+
} .file-upload-item__delete_1rhap,
|
|
84
|
+
.file-upload-item__download_1rhap {
|
|
85
85
|
height: 24px;
|
|
86
86
|
width: 24px;
|
|
87
87
|
margin-left: var(--gap-xs);
|
|
88
|
-
} .file-upload-
|
|
88
|
+
} .file-upload-item__errorWrapper_1rhap {
|
|
89
89
|
margin-top: var(--gap-s);
|
|
90
90
|
color: var(--color-light-text-accent)
|
|
91
|
-
} @media (--small-only) { .file-upload-
|
|
91
|
+
} @media (--small-only) { .file-upload-item__errorWrapper_1rhap {
|
|
92
92
|
flex: 1 0 100%;
|
|
93
93
|
margin-top: var(--gap-3xs)
|
|
94
94
|
}
|
|
95
|
-
} .file-upload-
|
|
95
|
+
} .file-upload-item__restore_1rhap {
|
|
96
96
|
font-size: 14px;
|
|
97
97
|
line-height: 20px;
|
|
98
98
|
font-weight: 400;
|
|
99
99
|
|
|
100
100
|
margin-left: var(--gap-s);
|
|
101
|
-
} .file-upload-
|
|
101
|
+
} .file-upload-item__spinnerWrapper_1rhap {
|
|
102
102
|
display: flex;
|
|
103
103
|
justify-content: center;
|
|
104
104
|
align-items: center;
|
|
105
105
|
width: 24px;
|
|
106
106
|
height: 24px;
|
|
107
|
-
} .file-upload-
|
|
107
|
+
} .file-upload-item__spinner_1rhap {
|
|
108
108
|
width: 20px;
|
|
109
109
|
height: 20px;
|
|
110
|
-
} .file-upload-
|
|
110
|
+
} .file-upload-item__uploadPercent_1rhap {
|
|
111
111
|
margin-top: var(--gap-2xs);
|
|
112
112
|
margin-left: var(--gap-xl);
|
|
113
113
|
}
|
package/esm/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ import { DocumentTxtMIcon } from '@alfalab/icons-glyph/DocumentTxtMIcon';
|
|
|
5
5
|
import { DocumentUnknownMIcon } from '@alfalab/icons-glyph/DocumentUnknownMIcon';
|
|
6
6
|
|
|
7
7
|
function humanFileSize(size) {
|
|
8
|
-
var units = ['
|
|
8
|
+
var units = ['Б', 'КБ', 'МБ', 'ГБ'];
|
|
9
9
|
var humanSize = Number(size);
|
|
10
10
|
var factor = 0;
|
|
11
11
|
while (humanSize >= 1024 && factor < units.length - 1) {
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: plx1w */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-primary: #dcdcdd;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
--gap-xl: 24px;
|
|
26
26
|
} :root {
|
|
27
27
|
} :root {
|
|
28
|
-
} .file-upload-
|
|
28
|
+
} .file-upload-item__component_1rhap {
|
|
29
29
|
font-size: 13px;
|
|
30
30
|
line-height: 16px;
|
|
31
31
|
font-weight: 400;
|
|
@@ -36,78 +36,78 @@
|
|
|
36
36
|
color: var(--color-light-text-secondary);
|
|
37
37
|
box-shadow: 0 -1px 0 0 var(--color-light-border-primary) inset;
|
|
38
38
|
box-sizing: border-box
|
|
39
|
-
} .file-upload-
|
|
39
|
+
} .file-upload-item__component_1rhap svg {
|
|
40
40
|
display: block;
|
|
41
|
-
} .file-upload-
|
|
41
|
+
} .file-upload-item__infoSection_1rhap {
|
|
42
42
|
display: flex;
|
|
43
43
|
flex-direction: column;
|
|
44
44
|
flex: 1;
|
|
45
45
|
margin-top: var(--gap-2xs);
|
|
46
46
|
margin-left: var(--gap-s);
|
|
47
47
|
min-width: 40%;
|
|
48
|
-
} .file-upload-
|
|
48
|
+
} .file-upload-item__info_1rhap {
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
flex: 1;
|
|
52
52
|
overflow: hidden;
|
|
53
|
-
} .file-upload-
|
|
53
|
+
} .file-upload-item__icon_1rhap {
|
|
54
54
|
display: block;
|
|
55
55
|
flex-shrink: 0;
|
|
56
56
|
color: var(--color-light-text-primary);
|
|
57
|
-
} .file-upload-
|
|
57
|
+
} .file-upload-item__errorIcon_1rhap {
|
|
58
58
|
flex-shrink: 0;
|
|
59
59
|
color: var(--color-light-graphic-negative);
|
|
60
|
-
} .file-upload-
|
|
60
|
+
} .file-upload-item__successIcon_1rhap {
|
|
61
61
|
flex-shrink: 0;
|
|
62
62
|
color: var(--color-light-graphic-positive);
|
|
63
|
-
} .file-upload-
|
|
63
|
+
} .file-upload-item__name_1rhap {
|
|
64
64
|
white-space: nowrap;
|
|
65
65
|
overflow: hidden;
|
|
66
66
|
text-overflow: ellipsis;
|
|
67
67
|
color: var(--color-light-text-primary)
|
|
68
|
-
} .file-upload-
|
|
68
|
+
} .file-upload-item__name_1rhap a {
|
|
69
69
|
display: block;
|
|
70
70
|
margin-bottom: 1px;
|
|
71
|
-
} .file-upload-
|
|
71
|
+
} .file-upload-item__meta_1rhap {
|
|
72
72
|
display: flex;
|
|
73
73
|
white-space: nowrap;
|
|
74
74
|
margin-right: var(--gap-2xs);
|
|
75
75
|
margin-left: var(--gap-xl);
|
|
76
76
|
padding: var(--gap-2xs) 0
|
|
77
|
-
} .file-upload-
|
|
77
|
+
} .file-upload-item__meta_1rhap > * {
|
|
78
78
|
margin-right: var(--gap-s)
|
|
79
|
-
} .file-upload-
|
|
79
|
+
} .file-upload-item__meta_1rhap > *:last-child {
|
|
80
80
|
margin-right: 0;
|
|
81
|
-
} .file-upload-
|
|
81
|
+
} .file-upload-item__size_1rhap {
|
|
82
82
|
text-align: right;
|
|
83
|
-
} .file-upload-
|
|
84
|
-
.file-upload-
|
|
83
|
+
} .file-upload-item__delete_1rhap,
|
|
84
|
+
.file-upload-item__download_1rhap {
|
|
85
85
|
height: 24px;
|
|
86
86
|
width: 24px;
|
|
87
87
|
margin-left: var(--gap-xs);
|
|
88
|
-
} .file-upload-
|
|
88
|
+
} .file-upload-item__errorWrapper_1rhap {
|
|
89
89
|
margin-top: var(--gap-s);
|
|
90
90
|
color: var(--color-light-text-accent)
|
|
91
|
-
} @media (--small-only) { .file-upload-
|
|
91
|
+
} @media (--small-only) { .file-upload-item__errorWrapper_1rhap {
|
|
92
92
|
flex: 1 0 100%;
|
|
93
93
|
margin-top: var(--gap-3xs)
|
|
94
94
|
}
|
|
95
|
-
} .file-upload-
|
|
95
|
+
} .file-upload-item__restore_1rhap {
|
|
96
96
|
font-size: 14px;
|
|
97
97
|
line-height: 20px;
|
|
98
98
|
font-weight: 400;
|
|
99
99
|
|
|
100
100
|
margin-left: var(--gap-s);
|
|
101
|
-
} .file-upload-
|
|
101
|
+
} .file-upload-item__spinnerWrapper_1rhap {
|
|
102
102
|
display: flex;
|
|
103
103
|
justify-content: center;
|
|
104
104
|
align-items: center;
|
|
105
105
|
width: 24px;
|
|
106
106
|
height: 24px;
|
|
107
|
-
} .file-upload-
|
|
107
|
+
} .file-upload-item__spinner_1rhap {
|
|
108
108
|
width: 20px;
|
|
109
109
|
height: 20px;
|
|
110
|
-
} .file-upload-
|
|
110
|
+
} .file-upload-item__uploadPercent_1rhap {
|
|
111
111
|
margin-top: var(--gap-2xs);
|
|
112
112
|
margin-left: var(--gap-xl);
|
|
113
113
|
}
|
package/modern/Component.js
CHANGED
|
@@ -15,7 +15,7 @@ import '@alfalab/icons-glyph/DocumentPdfMIcon';
|
|
|
15
15
|
import '@alfalab/icons-glyph/DocumentTxtMIcon';
|
|
16
16
|
import '@alfalab/icons-glyph/DocumentUnknownMIcon';
|
|
17
17
|
|
|
18
|
-
const styles = {"component":"file-upload-
|
|
18
|
+
const styles = {"component":"file-upload-item__component_1rhap","infoSection":"file-upload-item__infoSection_1rhap","info":"file-upload-item__info_1rhap","icon":"file-upload-item__icon_1rhap","errorIcon":"file-upload-item__errorIcon_1rhap","successIcon":"file-upload-item__successIcon_1rhap","name":"file-upload-item__name_1rhap","meta":"file-upload-item__meta_1rhap","size":"file-upload-item__size_1rhap","delete":"file-upload-item__delete_1rhap","download":"file-upload-item__download_1rhap","errorWrapper":"file-upload-item__errorWrapper_1rhap","restore":"file-upload-item__restore_1rhap","spinnerWrapper":"file-upload-item__spinnerWrapper_1rhap","spinner":"file-upload-item__spinner_1rhap","uploadPercent":"file-upload-item__uploadPercent_1rhap"};
|
|
19
19
|
require('./index.css')
|
|
20
20
|
|
|
21
21
|
const FileUploadItem = ({ className, children, id = '0', name = '', size, icon: Icon = fileIcon(name), uploadDate, downloadLink, download, uploadStatus, uploadPercent = 0, error, showDelete, showRestore, onDelete, onDownload, onRestore, disableButtons, dataTestId, }) => {
|
package/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: plx1w */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-primary: #dcdcdd;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
--gap-xl: 24px;
|
|
26
26
|
} :root {
|
|
27
27
|
} :root {
|
|
28
|
-
} .file-upload-
|
|
28
|
+
} .file-upload-item__component_1rhap {
|
|
29
29
|
font-size: 13px;
|
|
30
30
|
line-height: 16px;
|
|
31
31
|
font-weight: 400;
|
|
@@ -36,78 +36,78 @@
|
|
|
36
36
|
color: var(--color-light-text-secondary);
|
|
37
37
|
box-shadow: 0 -1px 0 0 var(--color-light-border-primary) inset;
|
|
38
38
|
box-sizing: border-box
|
|
39
|
-
} .file-upload-
|
|
39
|
+
} .file-upload-item__component_1rhap svg {
|
|
40
40
|
display: block;
|
|
41
|
-
} .file-upload-
|
|
41
|
+
} .file-upload-item__infoSection_1rhap {
|
|
42
42
|
display: flex;
|
|
43
43
|
flex-direction: column;
|
|
44
44
|
flex: 1;
|
|
45
45
|
margin-top: var(--gap-2xs);
|
|
46
46
|
margin-left: var(--gap-s);
|
|
47
47
|
min-width: 40%;
|
|
48
|
-
} .file-upload-
|
|
48
|
+
} .file-upload-item__info_1rhap {
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
flex: 1;
|
|
52
52
|
overflow: hidden;
|
|
53
|
-
} .file-upload-
|
|
53
|
+
} .file-upload-item__icon_1rhap {
|
|
54
54
|
display: block;
|
|
55
55
|
flex-shrink: 0;
|
|
56
56
|
color: var(--color-light-text-primary);
|
|
57
|
-
} .file-upload-
|
|
57
|
+
} .file-upload-item__errorIcon_1rhap {
|
|
58
58
|
flex-shrink: 0;
|
|
59
59
|
color: var(--color-light-graphic-negative);
|
|
60
|
-
} .file-upload-
|
|
60
|
+
} .file-upload-item__successIcon_1rhap {
|
|
61
61
|
flex-shrink: 0;
|
|
62
62
|
color: var(--color-light-graphic-positive);
|
|
63
|
-
} .file-upload-
|
|
63
|
+
} .file-upload-item__name_1rhap {
|
|
64
64
|
white-space: nowrap;
|
|
65
65
|
overflow: hidden;
|
|
66
66
|
text-overflow: ellipsis;
|
|
67
67
|
color: var(--color-light-text-primary)
|
|
68
|
-
} .file-upload-
|
|
68
|
+
} .file-upload-item__name_1rhap a {
|
|
69
69
|
display: block;
|
|
70
70
|
margin-bottom: 1px;
|
|
71
|
-
} .file-upload-
|
|
71
|
+
} .file-upload-item__meta_1rhap {
|
|
72
72
|
display: flex;
|
|
73
73
|
white-space: nowrap;
|
|
74
74
|
margin-right: var(--gap-2xs);
|
|
75
75
|
margin-left: var(--gap-xl);
|
|
76
76
|
padding: var(--gap-2xs) 0
|
|
77
|
-
} .file-upload-
|
|
77
|
+
} .file-upload-item__meta_1rhap > * {
|
|
78
78
|
margin-right: var(--gap-s)
|
|
79
|
-
} .file-upload-
|
|
79
|
+
} .file-upload-item__meta_1rhap > *:last-child {
|
|
80
80
|
margin-right: 0;
|
|
81
|
-
} .file-upload-
|
|
81
|
+
} .file-upload-item__size_1rhap {
|
|
82
82
|
text-align: right;
|
|
83
|
-
} .file-upload-
|
|
84
|
-
.file-upload-
|
|
83
|
+
} .file-upload-item__delete_1rhap,
|
|
84
|
+
.file-upload-item__download_1rhap {
|
|
85
85
|
height: 24px;
|
|
86
86
|
width: 24px;
|
|
87
87
|
margin-left: var(--gap-xs);
|
|
88
|
-
} .file-upload-
|
|
88
|
+
} .file-upload-item__errorWrapper_1rhap {
|
|
89
89
|
margin-top: var(--gap-s);
|
|
90
90
|
color: var(--color-light-text-accent)
|
|
91
|
-
} @media (--small-only) { .file-upload-
|
|
91
|
+
} @media (--small-only) { .file-upload-item__errorWrapper_1rhap {
|
|
92
92
|
flex: 1 0 100%;
|
|
93
93
|
margin-top: var(--gap-3xs)
|
|
94
94
|
}
|
|
95
|
-
} .file-upload-
|
|
95
|
+
} .file-upload-item__restore_1rhap {
|
|
96
96
|
font-size: 14px;
|
|
97
97
|
line-height: 20px;
|
|
98
98
|
font-weight: 400;
|
|
99
99
|
|
|
100
100
|
margin-left: var(--gap-s);
|
|
101
|
-
} .file-upload-
|
|
101
|
+
} .file-upload-item__spinnerWrapper_1rhap {
|
|
102
102
|
display: flex;
|
|
103
103
|
justify-content: center;
|
|
104
104
|
align-items: center;
|
|
105
105
|
width: 24px;
|
|
106
106
|
height: 24px;
|
|
107
|
-
} .file-upload-
|
|
107
|
+
} .file-upload-item__spinner_1rhap {
|
|
108
108
|
width: 20px;
|
|
109
109
|
height: 20px;
|
|
110
|
-
} .file-upload-
|
|
110
|
+
} .file-upload-item__uploadPercent_1rhap {
|
|
111
111
|
margin-top: var(--gap-2xs);
|
|
112
112
|
margin-left: var(--gap-xl);
|
|
113
113
|
}
|
package/modern/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ import { DocumentTxtMIcon } from '@alfalab/icons-glyph/DocumentTxtMIcon';
|
|
|
5
5
|
import { DocumentUnknownMIcon } from '@alfalab/icons-glyph/DocumentUnknownMIcon';
|
|
6
6
|
|
|
7
7
|
function humanFileSize(size) {
|
|
8
|
-
const units = ['
|
|
8
|
+
const units = ['Б', 'КБ', 'МБ', 'ГБ'];
|
|
9
9
|
let humanSize = Number(size);
|
|
10
10
|
let factor = 0;
|
|
11
11
|
while (humanSize >= 1024 && factor < units.length - 1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-file-upload-item",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@alfalab/core-components-icon-button": "^6.1.
|
|
18
|
-
"@alfalab/core-components-link": "^5.0.
|
|
19
|
-
"@alfalab/core-components-spinner": "^3.0.
|
|
17
|
+
"@alfalab/core-components-icon-button": "^6.1.3",
|
|
18
|
+
"@alfalab/core-components-link": "^5.0.6",
|
|
19
|
+
"@alfalab/core-components-spinner": "^3.0.7",
|
|
20
20
|
"@alfalab/icons-glyph": "^2.108.0",
|
|
21
21
|
"tslib": "^2.4.0"
|
|
22
22
|
}
|
package/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ var DocumentTxtMIcon = require('@alfalab/icons-glyph/DocumentTxtMIcon');
|
|
|
9
9
|
var DocumentUnknownMIcon = require('@alfalab/icons-glyph/DocumentUnknownMIcon');
|
|
10
10
|
|
|
11
11
|
function humanFileSize(size) {
|
|
12
|
-
var units = ['
|
|
12
|
+
var units = ['Б', 'КБ', 'МБ', 'ГБ'];
|
|
13
13
|
var humanSize = Number(size);
|
|
14
14
|
var factor = 0;
|
|
15
15
|
while (humanSize >= 1024 && factor < units.length - 1) {
|
package/send-stats.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const http = require('http');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const { promisify } = require('util');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const readFile = promisify(fs.readFile);
|
|
7
|
-
|
|
8
|
-
async function main() {
|
|
9
|
-
const remoteHost = process.env.NIS_HOST || 'digital';
|
|
10
|
-
const remotePort = process.env.NIS_PORT || 80;
|
|
11
|
-
const remotePath = process.env.NIS_PATH || '/npm-install-stats/api/install-stats';
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const [_, node, os, arch] =
|
|
15
|
-
/node\/v(\d+\.\d+\.\d+) (\w+) (\w+)/.exec(process.env.npm_config_user_agent) || [];
|
|
16
|
-
const [__, npm] = /npm\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
|
|
17
|
-
const [___, yarn] = /yarn\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
|
|
18
|
-
|
|
19
|
-
let ownPackageJson, packageJson;
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
const result = await Promise.all([
|
|
23
|
-
readFile(path.join(process.cwd(), 'package.json'), 'utf-8'),
|
|
24
|
-
readFile(path.join(process.cwd(), '../../../package.json'), 'utf-8'),
|
|
25
|
-
]);
|
|
26
|
-
|
|
27
|
-
ownPackageJson = JSON.parse(result[0]);
|
|
28
|
-
packageJson = JSON.parse(result[1]);
|
|
29
|
-
} catch (err) {
|
|
30
|
-
ownPackageJson = '';
|
|
31
|
-
packageJson = '';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const data = {
|
|
35
|
-
node,
|
|
36
|
-
npm,
|
|
37
|
-
yarn,
|
|
38
|
-
os,
|
|
39
|
-
arch,
|
|
40
|
-
ownPackageJson: JSON.stringify(ownPackageJson),
|
|
41
|
-
packageJson: JSON.stringify(packageJson),
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const body = JSON.stringify(data);
|
|
45
|
-
|
|
46
|
-
const options = {
|
|
47
|
-
host: remoteHost,
|
|
48
|
-
port: remotePort,
|
|
49
|
-
path: remotePath,
|
|
50
|
-
method: 'POST',
|
|
51
|
-
headers: {
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
'Content-Length': body.length,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return new Promise((resolve, reject) => {
|
|
58
|
-
const req = http.request(options, (res) => {
|
|
59
|
-
res.on('end', () => {
|
|
60
|
-
resolve();
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
req.on('error', () => {
|
|
65
|
-
reject();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
req.write(body);
|
|
69
|
-
req.end();
|
|
70
|
-
});
|
|
71
|
-
} catch (error) {
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
main()
|
|
77
|
-
.then(() => {
|
|
78
|
-
process.exit(0);
|
|
79
|
-
})
|
|
80
|
-
.catch(() => {
|
|
81
|
-
process.exit(0);
|
|
82
|
-
});
|