@hh.ru/magritte-ui-upload 3.2.15 → 3.2.16
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/FileName.js +1 -1
- package/FileView.js +1 -1
- package/FileViewWithPreview.js +1 -1
- package/MultiUpload.js +1 -1
- package/SingleUpload.js +1 -1
- package/Upload.js +1 -1
- package/index.css +30 -30
- package/index.js +1 -1
- package/package.json +7 -7
- package/upload-D19YV3Gb.js +5 -0
- package/upload-D19YV3Gb.js.map +1 -0
- package/utils.js +3 -3
- package/utils.js.map +1 -1
- package/upload-Q469sICZ.js +0 -5
- package/upload-Q469sICZ.js.map +0 -1
package/FileName.js
CHANGED
|
@@ -2,7 +2,7 @@ import './index.css';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
|
|
5
|
-
var styles = {"file-name-body":"magritte-file-name-body___PTTMc_3-2-
|
|
5
|
+
var styles = {"file-name-body":"magritte-file-name-body___PTTMc_3-2-16","fileNameBody":"magritte-file-name-body___PTTMc_3-2-16","file-name-body_medium":"magritte-file-name-body_medium___sfmmq_3-2-16","fileNameBodyMedium":"magritte-file-name-body_medium___sfmmq_3-2-16","file-name":"magritte-file-name___ZSL2g_3-2-16","fileName":"magritte-file-name___ZSL2g_3-2-16"};
|
|
6
6
|
|
|
7
7
|
const parse = (file) => {
|
|
8
8
|
const name = file.name;
|
package/FileView.js
CHANGED
|
@@ -10,7 +10,7 @@ import { FileName } from './FileName.js';
|
|
|
10
10
|
import { getUploadIcon, bytes2mb } from './utils.js';
|
|
11
11
|
import 'classnames';
|
|
12
12
|
|
|
13
|
-
var styles = {"file-info-body":"magritte-file-info-body___HmfXd_3-2-
|
|
13
|
+
var styles = {"file-info-body":"magritte-file-info-body___HmfXd_3-2-16","fileInfoBody":"magritte-file-info-body___HmfXd_3-2-16","file-info-and-controls":"magritte-file-info-and-controls___61iyY_3-2-16","fileInfoAndControls":"magritte-file-info-and-controls___61iyY_3-2-16","file-info-container":"magritte-file-info-container___WFab8_3-2-16","fileInfoContainer":"magritte-file-info-container___WFab8_3-2-16","file-info":"magritte-file-info___HrqiB_3-2-16","fileInfo":"magritte-file-info___HrqiB_3-2-16","controls":"magritte-controls___WdH7A_3-2-16"};
|
|
14
14
|
|
|
15
15
|
const FileView = ({ uploadType, loadedFile, preview, renderFileInfo, onFileDelete, 'aria-label': ariaLabel, isLast = false, }) => {
|
|
16
16
|
const isLoading = Boolean(loadedFile?.loading);
|
package/FileViewWithPreview.js
CHANGED
|
@@ -13,7 +13,7 @@ import './FileName.js';
|
|
|
13
13
|
import 'classnames';
|
|
14
14
|
import 'react';
|
|
15
15
|
|
|
16
|
-
var styles = {"item":"magritte-item___vVDG-_3-2-
|
|
16
|
+
var styles = {"item":"magritte-item___vVDG-_3-2-16"};
|
|
17
17
|
|
|
18
18
|
const FileViewWithPreview = ({ loadedFile, ...otherProps }) => {
|
|
19
19
|
const uploadType = getFileType(loadedFile.data.type);
|
package/MultiUpload.js
CHANGED
|
@@ -8,7 +8,7 @@ import { Placeholder } from './Placeholder.js';
|
|
|
8
8
|
import { useDropActions } from './useDropActions.js';
|
|
9
9
|
import { useDropButtons } from './useDropButtons.js';
|
|
10
10
|
import { getAvaliableFileTypes, getUploadIcon, DEFAULT_ACCEPT, RenderFileInfoDefault } from './utils.js';
|
|
11
|
-
import { s as styles } from './upload-
|
|
11
|
+
import { s as styles } from './upload-D19YV3Gb.js';
|
|
12
12
|
import './FileView.js';
|
|
13
13
|
import '@hh.ru/magritte-ui-action';
|
|
14
14
|
import '@hh.ru/magritte-ui-avatar';
|
package/SingleUpload.js
CHANGED
|
@@ -15,7 +15,7 @@ import { useDropActions } from './useDropActions.js';
|
|
|
15
15
|
import { useDropButtons } from './useDropButtons.js';
|
|
16
16
|
import { useFilePreview } from './useFilePreview.js';
|
|
17
17
|
import { getAvaliableFileTypes, getUploadIcon, bytes2mb, DEFAULT_ACCEPT, RenderFileInfoDefault } from './utils.js';
|
|
18
|
-
import { s as styles } from './upload-
|
|
18
|
+
import { s as styles } from './upload-D19YV3Gb.js';
|
|
19
19
|
import '@hh.ru/magritte-ui-action';
|
|
20
20
|
import '@hh.ru/magritte-ui-divider';
|
|
21
21
|
import '@hh.ru/magritte-ui-breakpoint';
|
package/Upload.js
CHANGED
|
@@ -21,7 +21,7 @@ import '@hh.ru/magritte-ui-breakpoint';
|
|
|
21
21
|
import '@hh.ru/magritte-ui-typography';
|
|
22
22
|
import './useDropActions.js';
|
|
23
23
|
import './useDropButtons.js';
|
|
24
|
-
import './upload-
|
|
24
|
+
import './upload-D19YV3Gb.js';
|
|
25
25
|
|
|
26
26
|
const Upload = ({ multiple, noDragEventsBubbling = true, ...uploadProps }) => {
|
|
27
27
|
if (multiple) {
|
package/index.css
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--magritte-typography-label-2-regular-text-transform-v21-3-2:none;
|
|
9
9
|
--magritte-typography-label-2-regular-text-decoration-v21-3-2:none;
|
|
10
10
|
}
|
|
11
|
-
.magritte-file-name-body___PTTMc_3-2-
|
|
11
|
+
.magritte-file-name-body___PTTMc_3-2-16{
|
|
12
12
|
display:flex;
|
|
13
13
|
width:100%;
|
|
14
14
|
overflow:hidden;
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
text-transform:var(--magritte-typography-label-2-regular-text-transform-v21-3-2);
|
|
22
22
|
text-decoration:var(--magritte-typography-label-2-regular-text-decoration-v21-3-2);
|
|
23
23
|
}
|
|
24
|
-
.magritte-file-name-body_medium___sfmmq_3-2-
|
|
24
|
+
.magritte-file-name-body_medium___sfmmq_3-2-16{
|
|
25
25
|
justify-content:center;
|
|
26
26
|
}
|
|
27
|
-
.magritte-file-name___ZSL2g_3-2-
|
|
27
|
+
.magritte-file-name___ZSL2g_3-2-16{
|
|
28
28
|
overflow:hidden;
|
|
29
29
|
text-overflow:ellipsis;
|
|
30
30
|
}
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
--magritte-static-space-100-v21-3-2:4px;
|
|
42
42
|
--magritte-static-space-400-v21-3-2:16px;
|
|
43
43
|
}
|
|
44
|
-
.magritte-file-info-body___HmfXd_3-2-
|
|
44
|
+
.magritte-file-info-body___HmfXd_3-2-16{
|
|
45
45
|
flex-grow:1;
|
|
46
46
|
}
|
|
47
|
-
.magritte-file-info-and-controls___61iyY_3-2-
|
|
47
|
+
.magritte-file-info-and-controls___61iyY_3-2-16{
|
|
48
48
|
display:flex;
|
|
49
49
|
gap:var(--magritte-static-space-400-v21-3-2);
|
|
50
50
|
}
|
|
51
|
-
.magritte-file-info-container___WFab8_3-2-
|
|
51
|
+
.magritte-file-info-container___WFab8_3-2-16{
|
|
52
52
|
flex-grow:1;
|
|
53
53
|
width:50px;
|
|
54
54
|
}
|
|
55
|
-
.magritte-file-info___HrqiB_3-2-
|
|
55
|
+
.magritte-file-info___HrqiB_3-2-16{
|
|
56
56
|
display:flex;
|
|
57
57
|
gap:var(--magritte-static-space-100-v21-3-2);
|
|
58
58
|
font-family:var(--magritte-typography-label-4-regular-font-family-v21-3-2);
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
text-transform:var(--magritte-typography-label-4-regular-text-transform-v21-3-2);
|
|
65
65
|
text-decoration:var(--magritte-typography-label-4-regular-text-decoration-v21-3-2);
|
|
66
66
|
}
|
|
67
|
-
.magritte-controls___WdH7A_3-2-
|
|
67
|
+
.magritte-controls___WdH7A_3-2-16{
|
|
68
68
|
display:flex;
|
|
69
69
|
align-items:center;
|
|
70
70
|
margin-left:auto;
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
:root{
|
|
75
75
|
--magritte-static-space-400-v21-3-2:16px;
|
|
76
76
|
}
|
|
77
|
-
.magritte-item___vVDG-_3-2-
|
|
77
|
+
.magritte-item___vVDG-_3-2-16{
|
|
78
78
|
display:flex;
|
|
79
79
|
width:100%;
|
|
80
80
|
gap:var(--magritte-static-space-400-v21-3-2);
|
|
@@ -101,57 +101,57 @@
|
|
|
101
101
|
--magritte-color-stroke-state-focused-accessible-v21-3-2:#0070ff7a;
|
|
102
102
|
--magritte-color-component-input-stroke-state-negative-focused-accessible-v21-3-2:#ff4d3a7a;
|
|
103
103
|
}
|
|
104
|
-
.magritte-root___FV1tC_3-2-
|
|
104
|
+
.magritte-root___FV1tC_3-2-16{
|
|
105
105
|
position:relative;
|
|
106
106
|
display:flex;
|
|
107
107
|
overflow:hidden;
|
|
108
108
|
border-radius:var(--magritte-static-border-radius-600-v21-3-2);
|
|
109
109
|
background-color:var(--magritte-color-background-primary-v21-3-2);
|
|
110
110
|
}
|
|
111
|
-
.magritte-root___FV1tC_3-2-
|
|
111
|
+
.magritte-root___FV1tC_3-2-16:hover{
|
|
112
112
|
cursor:pointer;
|
|
113
113
|
}
|
|
114
|
-
.magritte-root___FV1tC_3-2-
|
|
114
|
+
.magritte-root___FV1tC_3-2-16:hover .magritte-background___RfZ0U_3-2-16{
|
|
115
115
|
border-color:var(--magritte-color-stroke-accent-v21-3-2);
|
|
116
116
|
}
|
|
117
|
-
.magritte-root___FV1tC_3-2-
|
|
117
|
+
.magritte-root___FV1tC_3-2-16.magritte-drag-active___dihBL_3-2-16 .magritte-background___RfZ0U_3-2-16{
|
|
118
118
|
border-color:var(--magritte-color-stroke-accent-v21-3-2);
|
|
119
119
|
}
|
|
120
|
-
.magritte-root___FV1tC_3-2-
|
|
120
|
+
.magritte-root___FV1tC_3-2-16.focus-visible{
|
|
121
121
|
outline:var(--magritte-color-stroke-state-focused-accessible-v21-3-2) solid 4px;
|
|
122
122
|
}
|
|
123
|
-
.magritte-root___FV1tC_3-2-
|
|
123
|
+
.magritte-root___FV1tC_3-2-16.focus-visible .magritte-background___RfZ0U_3-2-16{
|
|
124
124
|
border-color:var(--magritte-color-stroke-accent-v21-3-2);
|
|
125
125
|
}
|
|
126
|
-
.magritte-root___FV1tC_3-2-
|
|
127
|
-
.magritte-root___FV1tC_3-2-
|
|
126
|
+
.magritte-root___FV1tC_3-2-16.magritte-load___MghDA_3-2-16 .magritte-background___RfZ0U_3-2-16,
|
|
127
|
+
.magritte-root___FV1tC_3-2-16.magritte-loading___9E3p-_3-2-16 .magritte-background___RfZ0U_3-2-16{
|
|
128
128
|
border-style:solid;
|
|
129
129
|
border-width:7px;
|
|
130
130
|
}
|
|
131
|
-
.magritte-root___FV1tC_3-2-
|
|
131
|
+
.magritte-root___FV1tC_3-2-16.magritte-invalid___Rt10-_3-2-16.focus-visible{
|
|
132
132
|
outline:var(--magritte-color-component-input-stroke-state-negative-focused-accessible-v21-3-2) solid 4px;
|
|
133
133
|
}
|
|
134
|
-
.magritte-root___FV1tC_3-2-
|
|
134
|
+
.magritte-root___FV1tC_3-2-16.magritte-invalid___Rt10-_3-2-16 .magritte-background___RfZ0U_3-2-16{
|
|
135
135
|
border-color:var(--magritte-color-stroke-neutral-v21-3-2);
|
|
136
136
|
}
|
|
137
|
-
.magritte-root_medium___67WJa_3-2-
|
|
137
|
+
.magritte-root_medium___67WJa_3-2-16{
|
|
138
138
|
justify-content:center;
|
|
139
139
|
padding:var(--magritte-static-space-600-v21-3-2);
|
|
140
140
|
}
|
|
141
|
-
.magritte-root_medium___67WJa_3-2-
|
|
141
|
+
.magritte-root_medium___67WJa_3-2-16 .magritte-body___O7ROl_3-2-16{
|
|
142
142
|
flex-direction:column;
|
|
143
143
|
align-items:center;
|
|
144
144
|
justify-content:center;
|
|
145
145
|
}
|
|
146
|
-
.magritte-root_small___dkUYq_3-2-
|
|
146
|
+
.magritte-root_small___dkUYq_3-2-16{
|
|
147
147
|
padding-top:var(--magritte-static-space-400-v21-3-2);
|
|
148
148
|
padding-bottom:var(--magritte-static-space-400-v21-3-2);
|
|
149
149
|
padding-left:var(--magritte-static-space-400-v21-3-2);
|
|
150
150
|
}
|
|
151
|
-
.magritte-root_small___dkUYq_3-2-
|
|
151
|
+
.magritte-root_small___dkUYq_3-2-16 .magritte-body___O7ROl_3-2-16{
|
|
152
152
|
gap:var(--magritte-static-space-400-v21-3-2);
|
|
153
153
|
}
|
|
154
|
-
.magritte-background___RfZ0U_3-2-
|
|
154
|
+
.magritte-background___RfZ0U_3-2-16{
|
|
155
155
|
position:absolute;
|
|
156
156
|
border-width:8px;
|
|
157
157
|
border-style:dashed;
|
|
@@ -164,15 +164,15 @@
|
|
|
164
164
|
background-position:center;
|
|
165
165
|
background-size:100%;
|
|
166
166
|
}
|
|
167
|
-
.magritte-body___O7ROl_3-2-
|
|
167
|
+
.magritte-body___O7ROl_3-2-16{
|
|
168
168
|
display:flex;
|
|
169
169
|
width:100%;
|
|
170
170
|
}
|
|
171
|
-
.magritte-loader___XYpWg_3-2-
|
|
171
|
+
.magritte-loader___XYpWg_3-2-16{
|
|
172
172
|
position:relative;
|
|
173
173
|
display:flex;
|
|
174
174
|
}
|
|
175
|
-
.magritte-cancel___tQ-yX_3-2-
|
|
175
|
+
.magritte-cancel___tQ-yX_3-2-16{
|
|
176
176
|
position:absolute;
|
|
177
177
|
top:0;
|
|
178
178
|
left:0;
|
|
@@ -182,20 +182,20 @@
|
|
|
182
182
|
align-items:center;
|
|
183
183
|
justify-content:center;
|
|
184
184
|
}
|
|
185
|
-
.magritte-image-controls___vLf94_3-2-
|
|
185
|
+
.magritte-image-controls___vLf94_3-2-16{
|
|
186
186
|
display:flex;
|
|
187
187
|
position:absolute;
|
|
188
188
|
right:var(--magritte-static-space-300-v21-3-2);
|
|
189
189
|
bottom:var(--magritte-static-space-300-v21-3-2);
|
|
190
190
|
gap:var(--magritte-static-space-300-v21-3-2);
|
|
191
191
|
}
|
|
192
|
-
.magritte-small-controls___Qn9TP_3-2-
|
|
192
|
+
.magritte-small-controls___Qn9TP_3-2-16{
|
|
193
193
|
display:flex;
|
|
194
194
|
align-items:center;
|
|
195
195
|
margin-left:auto;
|
|
196
196
|
margin-right:var(--magritte-static-space-500-v21-3-2);
|
|
197
197
|
}
|
|
198
|
-
.magritte-file-list___L9uHt_3-2-
|
|
198
|
+
.magritte-file-list___L9uHt_3-2-16{
|
|
199
199
|
margin-top:var(--magritte-static-space-300-v21-3-2);
|
|
200
200
|
box-shadow:inset 0 0 0 1px var(--magritte-color-stroke-neutral-v21-3-2);
|
|
201
201
|
border-radius:var(--magritte-static-border-radius-600-v21-3-2);
|
package/index.js
CHANGED
|
@@ -22,6 +22,6 @@ import '@hh.ru/magritte-ui-breakpoint';
|
|
|
22
22
|
import '@hh.ru/magritte-ui-typography';
|
|
23
23
|
import './useDropActions.js';
|
|
24
24
|
import './useDropButtons.js';
|
|
25
|
-
import './upload-
|
|
25
|
+
import './upload-D19YV3Gb.js';
|
|
26
26
|
import './SingleUpload.js';
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-upload",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.16",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"react": ">=18.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@hh.ru/magritte-ui-action": "4.4.
|
|
30
|
+
"@hh.ru/magritte-ui-action": "4.4.33",
|
|
31
31
|
"@hh.ru/magritte-ui-avatar": "5.1.7",
|
|
32
32
|
"@hh.ru/magritte-ui-breakpoint": "5.0.0",
|
|
33
|
-
"@hh.ru/magritte-ui-button": "5.2.
|
|
34
|
-
"@hh.ru/magritte-ui-button-stack": "2.1.
|
|
33
|
+
"@hh.ru/magritte-ui-button": "5.2.27",
|
|
34
|
+
"@hh.ru/magritte-ui-button-stack": "2.1.47",
|
|
35
35
|
"@hh.ru/magritte-ui-divider": "1.1.45",
|
|
36
|
-
"@hh.ru/magritte-ui-icon": "
|
|
37
|
-
"@hh.ru/magritte-ui-loader": "1.3.
|
|
36
|
+
"@hh.ru/magritte-ui-icon": "10.0.0",
|
|
37
|
+
"@hh.ru/magritte-ui-loader": "1.3.25",
|
|
38
38
|
"@hh.ru/magritte-ui-mock-component": "1.0.12",
|
|
39
39
|
"@hh.ru/magritte-ui-spacing": "2.0.43",
|
|
40
40
|
"@hh.ru/magritte-ui-theme-provider": "1.1.41",
|
|
41
41
|
"@hh.ru/magritte-ui-typography": "3.0.31",
|
|
42
42
|
"react-dropzone": "14.3.5"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "0e4b0b94efe23dfdde06869bd8c294469ce0fe6b"
|
|
45
45
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
var styles = {"root":"magritte-root___FV1tC_3-2-16","background":"magritte-background___RfZ0U_3-2-16","drag-active":"magritte-drag-active___dihBL_3-2-16","dragActive":"magritte-drag-active___dihBL_3-2-16","load":"magritte-load___MghDA_3-2-16","loading":"magritte-loading___9E3p-_3-2-16","invalid":"magritte-invalid___Rt10-_3-2-16","root_medium":"magritte-root_medium___67WJa_3-2-16","rootMedium":"magritte-root_medium___67WJa_3-2-16","body":"magritte-body___O7ROl_3-2-16","root_small":"magritte-root_small___dkUYq_3-2-16","rootSmall":"magritte-root_small___dkUYq_3-2-16","loader":"magritte-loader___XYpWg_3-2-16","cancel":"magritte-cancel___tQ-yX_3-2-16","image-controls":"magritte-image-controls___vLf94_3-2-16","imageControls":"magritte-image-controls___vLf94_3-2-16","small-controls":"magritte-small-controls___Qn9TP_3-2-16","smallControls":"magritte-small-controls___Qn9TP_3-2-16","file-list":"magritte-file-list___L9uHt_3-2-16","fileList":"magritte-file-list___L9uHt_3-2-16"};
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
|
5
|
+
//# sourceMappingURL=upload-D19YV3Gb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-D19YV3Gb.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { ImageOutlinedSize24, ImageOutlinedSize32, VideocameraOutlinedSize24, VideocameraOutlinedSize32, DocumentOutlinedSize24, DocumentOutlinedSize32, DocumentArrowUpOutlinedSize24, DocumentArrowUpOutlinedSize32 } from '@hh.ru/magritte-ui-icon/icon';
|
|
4
4
|
|
|
5
5
|
const RenderFileInfoDefault = (loadedFile) => {
|
|
6
6
|
return loadedFile.fileSizeMB;
|
|
@@ -34,7 +34,7 @@ const getUploadIcon = (uploadType, loadedFile, isSmall) => {
|
|
|
34
34
|
return undefined;
|
|
35
35
|
}
|
|
36
36
|
if (uploadType === 'image') {
|
|
37
|
-
return isSmall ? jsx(
|
|
37
|
+
return isSmall ? (jsx(ImageOutlinedSize24, { initialColor: "accent" })) : (jsx(ImageOutlinedSize32, { initialColor: "secondary" }));
|
|
38
38
|
}
|
|
39
39
|
if (uploadType === 'video') {
|
|
40
40
|
return isSmall ? (jsx(VideocameraOutlinedSize24, { initialColor: "accent" })) : (jsx(VideocameraOutlinedSize32, { initialColor: "secondary" }));
|
|
@@ -43,7 +43,7 @@ const getUploadIcon = (uploadType, loadedFile, isSmall) => {
|
|
|
43
43
|
return isSmall ? (jsx(DocumentOutlinedSize24, { initialColor: "accent" })) : (jsx(DocumentOutlinedSize32, { initialColor: "secondary" }));
|
|
44
44
|
}
|
|
45
45
|
if (uploadType === 'video' || uploadType === 'image') {
|
|
46
|
-
return isSmall ? jsx(
|
|
46
|
+
return isSmall ? (jsx(ImageOutlinedSize24, { initialColor: "secondary" })) : (jsx(ImageOutlinedSize32, { initialColor: "secondary" }));
|
|
47
47
|
}
|
|
48
48
|
// mixed, application
|
|
49
49
|
return isSmall ? (jsx(DocumentArrowUpOutlinedSize24, { initialColor: "secondary" })) : (jsx(DocumentArrowUpOutlinedSize32, { initialColor: "secondary" }));
|
package/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.tsx"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\nimport { Accept } from 'react-dropzone';\n\nimport {\n DocumentArrowUpOutlinedSize32,\n DocumentOutlinedSize32,\n VideocameraOutlinedSize32,\n
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.tsx"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\nimport { Accept } from 'react-dropzone';\n\nimport {\n DocumentArrowUpOutlinedSize32,\n DocumentOutlinedSize32,\n VideocameraOutlinedSize32,\n ImageOutlinedSize32,\n DocumentArrowUpOutlinedSize24,\n DocumentOutlinedSize24,\n VideocameraOutlinedSize24,\n ImageOutlinedSize24,\n} from '@hh.ru/magritte-ui-icon/icon';\nimport { LoadedFile, UploadType, LoadedFileWithFileSize } from '@hh.ru/magritte-ui-upload/types';\n\nexport const RenderFileInfoDefault = (loadedFile: LoadedFileWithFileSize): ReactNode => {\n return loadedFile.fileSizeMB;\n};\n\nexport const DEFAULT_ACCEPT: Accept = {\n 'image/*': ['.png', '.jpeg', '.jpg'],\n};\n\nconst order = 1024 * 1024;\nexport const bytes2mb = (value: number): string => {\n return (value / order).toFixed(2);\n};\n\nexport const getFileType = (avaliableType: string): UploadType => {\n return avaliableType.split('/')[0] as UploadType;\n};\n\n// парсим accept в нормальный формат\nexport const getAvaliableFileTypes = (accept: Accept): UploadType => {\n const avaliableTypes = Object.keys(accept);\n if (avaliableTypes.length === 0) {\n throw new Error(`Magritte component Upload: accept can't be empty`);\n }\n if (avaliableTypes.length > 1) {\n return 'mixed';\n }\n return getFileType(avaliableTypes[0]);\n};\n\n// иконка (тип и цвет) может меняться в зависимости от типа, размера и состояния загрузки\nexport const getUploadIcon = (\n uploadType: UploadType,\n loadedFile: LoadedFile | undefined,\n isSmall: boolean\n): ReactElement | undefined => {\n if (loadedFile) {\n const { error, loading } = loadedFile;\n if ((loading || error) && !isSmall) {\n return undefined;\n }\n if (uploadType === 'image') {\n return isSmall ? (\n <ImageOutlinedSize24 initialColor=\"accent\" />\n ) : (\n <ImageOutlinedSize32 initialColor=\"secondary\" />\n );\n }\n if (uploadType === 'video') {\n return isSmall ? (\n <VideocameraOutlinedSize24 initialColor=\"accent\" />\n ) : (\n <VideocameraOutlinedSize32 initialColor=\"secondary\" />\n );\n }\n // mixed, application\n return isSmall ? (\n <DocumentOutlinedSize24 initialColor=\"accent\" />\n ) : (\n <DocumentOutlinedSize32 initialColor=\"secondary\" />\n );\n }\n if (uploadType === 'video' || uploadType === 'image') {\n return isSmall ? (\n <ImageOutlinedSize24 initialColor=\"secondary\" />\n ) : (\n <ImageOutlinedSize32 initialColor=\"secondary\" />\n );\n }\n // mixed, application\n return isSmall ? (\n <DocumentArrowUpOutlinedSize24 initialColor=\"secondary\" />\n ) : (\n <DocumentArrowUpOutlinedSize32 initialColor=\"secondary\" />\n );\n};\n"],"names":["_jsx"],"mappings":";;;AAea,MAAA,qBAAqB,GAAG,CAAC,UAAkC,KAAe;IACnF,OAAO,UAAU,CAAC,UAAU,CAAC;AACjC,EAAE;AAEW,MAAA,cAAc,GAAW;AAClC,IAAA,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC;EACtC;AAEF,MAAM,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AACb,MAAA,QAAQ,GAAG,CAAC,KAAa,KAAY;IAC9C,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACtC,EAAE;AAEW,MAAA,WAAW,GAAG,CAAC,aAAqB,KAAgB;IAC7D,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAe,CAAC;AACrD,EAAE;AAEF;AACa,MAAA,qBAAqB,GAAG,CAAC,MAAc,KAAgB;IAChE,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3C,IAAA,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;AAC7B,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,gDAAA,CAAkD,CAAC,CAAC;KACvE;AACD,IAAA,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;AAC3B,QAAA,OAAO,OAAO,CAAC;KAClB;AACD,IAAA,OAAO,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,EAAE;AAEF;AACa,MAAA,aAAa,GAAG,CACzB,UAAsB,EACtB,UAAkC,EAClC,OAAgB,KACU;IAC1B,IAAI,UAAU,EAAE;AACZ,QAAA,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;QACtC,IAAI,CAAC,OAAO,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE;AAChC,YAAA,OAAO,SAAS,CAAC;SACpB;AACD,QAAA,IAAI,UAAU,KAAK,OAAO,EAAE;YACxB,OAAO,OAAO,IACVA,IAAC,mBAAmB,EAAA,EAAC,YAAY,EAAC,QAAQ,EAAA,CAAG,KAE7CA,GAAC,CAAA,mBAAmB,EAAC,EAAA,YAAY,EAAC,WAAW,EAAG,CAAA,CACnD,CAAC;SACL;AACD,QAAA,IAAI,UAAU,KAAK,OAAO,EAAE;YACxB,OAAO,OAAO,IACVA,IAAC,yBAAyB,EAAA,EAAC,YAAY,EAAC,QAAQ,EAAA,CAAG,KAEnDA,GAAC,CAAA,yBAAyB,EAAC,EAAA,YAAY,EAAC,WAAW,EAAG,CAAA,CACzD,CAAC;SACL;;QAED,OAAO,OAAO,IACVA,IAAC,sBAAsB,EAAA,EAAC,YAAY,EAAC,QAAQ,EAAA,CAAG,KAEhDA,GAAC,CAAA,sBAAsB,EAAC,EAAA,YAAY,EAAC,WAAW,EAAG,CAAA,CACtD,CAAC;KACL;IACD,IAAI,UAAU,KAAK,OAAO,IAAI,UAAU,KAAK,OAAO,EAAE;QAClD,OAAO,OAAO,IACVA,IAAC,mBAAmB,EAAA,EAAC,YAAY,EAAC,WAAW,EAAA,CAAG,KAEhDA,GAAC,CAAA,mBAAmB,EAAC,EAAA,YAAY,EAAC,WAAW,EAAG,CAAA,CACnD,CAAC;KACL;;IAED,OAAO,OAAO,IACVA,IAAC,6BAA6B,EAAA,EAAC,YAAY,EAAC,WAAW,EAAA,CAAG,KAE1DA,GAAC,CAAA,6BAA6B,EAAC,EAAA,YAAY,EAAC,WAAW,EAAG,CAAA,CAC7D,CAAC;AACN;;;;"}
|
package/upload-Q469sICZ.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
var styles = {"root":"magritte-root___FV1tC_3-2-15","background":"magritte-background___RfZ0U_3-2-15","drag-active":"magritte-drag-active___dihBL_3-2-15","dragActive":"magritte-drag-active___dihBL_3-2-15","load":"magritte-load___MghDA_3-2-15","loading":"magritte-loading___9E3p-_3-2-15","invalid":"magritte-invalid___Rt10-_3-2-15","root_medium":"magritte-root_medium___67WJa_3-2-15","rootMedium":"magritte-root_medium___67WJa_3-2-15","body":"magritte-body___O7ROl_3-2-15","root_small":"magritte-root_small___dkUYq_3-2-15","rootSmall":"magritte-root_small___dkUYq_3-2-15","loader":"magritte-loader___XYpWg_3-2-15","cancel":"magritte-cancel___tQ-yX_3-2-15","image-controls":"magritte-image-controls___vLf94_3-2-15","imageControls":"magritte-image-controls___vLf94_3-2-15","small-controls":"magritte-small-controls___Qn9TP_3-2-15","smallControls":"magritte-small-controls___Qn9TP_3-2-15","file-list":"magritte-file-list___L9uHt_3-2-15","fileList":"magritte-file-list___L9uHt_3-2-15"};
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|
|
5
|
-
//# sourceMappingURL=upload-Q469sICZ.js.map
|
package/upload-Q469sICZ.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-Q469sICZ.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|