@alfalab/core-components-file-upload-item 3.6.5 → 3.7.0
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/CHANGELOG.md +16 -0
- package/dist/Component.d.ts +4 -0
- package/dist/Component.js +4 -4
- package/dist/cssm/Component.d.ts +4 -0
- package/dist/cssm/Component.js +3 -3
- package/dist/esm/Component.d.ts +4 -0
- package/dist/esm/Component.js +4 -4
- package/dist/esm/index.css +21 -21
- package/dist/index.css +21 -21
- package/dist/modern/Component.d.ts +4 -0
- package/dist/modern/Component.js +4 -4
- package/dist/modern/index.css +21 -21
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.7.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-file-upload-item@3.6.5...@alfalab/core-components-file-upload-item@3.7.0) (2022-06-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **icon-button:** fix loading ([#105](https://github.com/core-ds/core-components/issues/105)) ([0b133f0](https://github.com/core-ds/core-components/commit/0b133f042e86702ec2861915f2cdbcdbad9ca905))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **file-upload-item:** add ability to disable file delete button ([#86](https://github.com/core-ds/core-components/issues/86)) ([daa8775](https://github.com/core-ds/core-components/commit/daa877591736598ef6f9f0237c40ac8759258eeb))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [3.6.5](https://github.com/core-ds/core-components/compare/@alfalab/core-components-file-upload-item@3.6.4...@alfalab/core-components-file-upload-item@3.6.5) (2022-06-03)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @alfalab/core-components-file-upload-item
|
package/dist/Component.d.ts
CHANGED
|
@@ -74,6 +74,10 @@ type FileUploadItemProps = {
|
|
|
74
74
|
* Обработчик восстановления файла
|
|
75
75
|
*/
|
|
76
76
|
onRestore?: (id: string) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Управление активностью кнопок
|
|
79
|
+
*/
|
|
80
|
+
disableButtons?: boolean;
|
|
77
81
|
/**
|
|
78
82
|
* Идентификатор для систем автоматизированного тестирования
|
|
79
83
|
*/
|
package/dist/Component.js
CHANGED
|
@@ -24,11 +24,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
24
24
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
25
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
26
26
|
|
|
27
|
-
var styles = {"component":"file-upload-
|
|
27
|
+
var styles = {"component":"file-upload-item__component_1pp48","infoSection":"file-upload-item__infoSection_1pp48","info":"file-upload-item__info_1pp48","icon":"file-upload-item__icon_1pp48","errorIcon":"file-upload-item__errorIcon_1pp48","successIcon":"file-upload-item__successIcon_1pp48","name":"file-upload-item__name_1pp48","meta":"file-upload-item__meta_1pp48","size":"file-upload-item__size_1pp48","delete":"file-upload-item__delete_1pp48","download":"file-upload-item__download_1pp48","errorWrapper":"file-upload-item__errorWrapper_1pp48","restore":"file-upload-item__restore_1pp48","spinnerWrapper":"file-upload-item__spinnerWrapper_1pp48","spinner":"file-upload-item__spinner_1pp48","uploadPercent":"file-upload-item__uploadPercent_1pp48"};
|
|
28
28
|
require('./index.css')
|
|
29
29
|
|
|
30
30
|
var FileUploadItem = function (_a) {
|
|
31
|
-
var className = _a.className, children = _a.children, _b = _a.id, id = _b === void 0 ? '0' : _b, _c = _a.name, name = _c === void 0 ? '' : _c, size = _a.size, _d = _a.icon, Icon = _d === void 0 ? utils.fileIcon(name) : _d, uploadDate = _a.uploadDate, downloadLink = _a.downloadLink, download = _a.download, uploadStatus = _a.uploadStatus, _e = _a.uploadPercent, uploadPercent = _e === void 0 ? 0 : _e, error = _a.error, showDelete = _a.showDelete, showRestore = _a.showRestore, onDelete = _a.onDelete, onDownload = _a.onDownload, onRestore = _a.onRestore, dataTestId = _a.dataTestId;
|
|
31
|
+
var className = _a.className, children = _a.children, _b = _a.id, id = _b === void 0 ? '0' : _b, _c = _a.name, name = _c === void 0 ? '' : _c, size = _a.size, _d = _a.icon, Icon = _d === void 0 ? utils.fileIcon(name) : _d, uploadDate = _a.uploadDate, downloadLink = _a.downloadLink, download = _a.download, uploadStatus = _a.uploadStatus, _e = _a.uploadPercent, uploadPercent = _e === void 0 ? 0 : _e, error = _a.error, showDelete = _a.showDelete, showRestore = _a.showRestore, onDelete = _a.onDelete, onDownload = _a.onDownload, onRestore = _a.onRestore, disableButtons = _a.disableButtons, dataTestId = _a.dataTestId;
|
|
32
32
|
var handleDownload = React.useCallback(function (event) {
|
|
33
33
|
if (onDownload) {
|
|
34
34
|
event.preventDefault();
|
|
@@ -79,8 +79,8 @@ var FileUploadItem = function (_a) {
|
|
|
79
79
|
uploadDate && React__default['default'].createElement("span", { key: uploadDate }, uploadDate),
|
|
80
80
|
size && (React__default['default'].createElement("span", { key: size, className: styles.size }, utils.humanFileSize(size)))))),
|
|
81
81
|
showRestore && (React__default['default'].createElement(coreComponentsLink.Link, { pseudo: true, className: styles.restore, onClick: handleRestore }, "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C")),
|
|
82
|
-
showDownload && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: PointerDownMIcon.PointerDownMIcon, className: styles.download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, download: download })),
|
|
83
|
-
showDelete && !showRestore && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: CrossMIcon.CrossMIcon, onClick: handleDelete, className: styles.delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
82
|
+
showDownload && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: PointerDownMIcon.PointerDownMIcon, className: styles.download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, disabled: disableButtons, download: download })),
|
|
83
|
+
showDelete && !showRestore && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: CrossMIcon.CrossMIcon, onClick: handleDelete, disabled: disableButtons, className: styles.delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
exports.FileUploadItem = FileUploadItem;
|
package/dist/cssm/Component.d.ts
CHANGED
|
@@ -74,6 +74,10 @@ type FileUploadItemProps = {
|
|
|
74
74
|
* Обработчик восстановления файла
|
|
75
75
|
*/
|
|
76
76
|
onRestore?: (id: string) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Управление активностью кнопок
|
|
79
|
+
*/
|
|
80
|
+
disableButtons?: boolean;
|
|
77
81
|
/**
|
|
78
82
|
* Идентификатор для систем автоматизированного тестирования
|
|
79
83
|
*/
|
package/dist/cssm/Component.js
CHANGED
|
@@ -27,7 +27,7 @@ var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
|
27
27
|
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
28
28
|
|
|
29
29
|
var FileUploadItem = function (_a) {
|
|
30
|
-
var className = _a.className, children = _a.children, _b = _a.id, id = _b === void 0 ? '0' : _b, _c = _a.name, name = _c === void 0 ? '' : _c, size = _a.size, _d = _a.icon, Icon = _d === void 0 ? utils.fileIcon(name) : _d, uploadDate = _a.uploadDate, downloadLink = _a.downloadLink, download = _a.download, uploadStatus = _a.uploadStatus, _e = _a.uploadPercent, uploadPercent = _e === void 0 ? 0 : _e, error = _a.error, showDelete = _a.showDelete, showRestore = _a.showRestore, onDelete = _a.onDelete, onDownload = _a.onDownload, onRestore = _a.onRestore, dataTestId = _a.dataTestId;
|
|
30
|
+
var className = _a.className, children = _a.children, _b = _a.id, id = _b === void 0 ? '0' : _b, _c = _a.name, name = _c === void 0 ? '' : _c, size = _a.size, _d = _a.icon, Icon = _d === void 0 ? utils.fileIcon(name) : _d, uploadDate = _a.uploadDate, downloadLink = _a.downloadLink, download = _a.download, uploadStatus = _a.uploadStatus, _e = _a.uploadPercent, uploadPercent = _e === void 0 ? 0 : _e, error = _a.error, showDelete = _a.showDelete, showRestore = _a.showRestore, onDelete = _a.onDelete, onDownload = _a.onDownload, onRestore = _a.onRestore, disableButtons = _a.disableButtons, dataTestId = _a.dataTestId;
|
|
31
31
|
var handleDownload = React.useCallback(function (event) {
|
|
32
32
|
if (onDownload) {
|
|
33
33
|
event.preventDefault();
|
|
@@ -78,8 +78,8 @@ var FileUploadItem = function (_a) {
|
|
|
78
78
|
uploadDate && React__default['default'].createElement("span", { key: uploadDate }, uploadDate),
|
|
79
79
|
size && (React__default['default'].createElement("span", { key: size, className: styles__default['default'].size }, utils.humanFileSize(size)))))),
|
|
80
80
|
showRestore && (React__default['default'].createElement(coreComponentsLink.Link, { pseudo: true, className: styles__default['default'].restore, onClick: handleRestore }, "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C")),
|
|
81
|
-
showDownload && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: PointerDownMIcon.PointerDownMIcon, className: styles__default['default'].download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, download: download })),
|
|
82
|
-
showDelete && !showRestore && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: CrossMIcon.CrossMIcon, onClick: handleDelete, className: styles__default['default'].delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
81
|
+
showDownload && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: PointerDownMIcon.PointerDownMIcon, className: styles__default['default'].download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, disabled: disableButtons, download: download })),
|
|
82
|
+
showDelete && !showRestore && (React__default['default'].createElement(coreComponentsIconButton.IconButton, { size: 'xxs', icon: CrossMIcon.CrossMIcon, onClick: handleDelete, disabled: disableButtons, className: styles__default['default'].delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
exports.FileUploadItem = FileUploadItem;
|
package/dist/esm/Component.d.ts
CHANGED
|
@@ -74,6 +74,10 @@ type FileUploadItemProps = {
|
|
|
74
74
|
* Обработчик восстановления файла
|
|
75
75
|
*/
|
|
76
76
|
onRestore?: (id: string) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Управление активностью кнопок
|
|
79
|
+
*/
|
|
80
|
+
disableButtons?: boolean;
|
|
77
81
|
/**
|
|
78
82
|
* Идентификатор для систем автоматизированного тестирования
|
|
79
83
|
*/
|
package/dist/esm/Component.js
CHANGED
|
@@ -15,11 +15,11 @@ import '@alfalab/icons-glyph/DocumentUnknownMIcon';
|
|
|
15
15
|
import '@alfalab/icons-glyph/DocumentImageMIcon';
|
|
16
16
|
import { fileIcon, humanFileSize } from './utils.js';
|
|
17
17
|
|
|
18
|
-
var styles = {"component":"file-upload-
|
|
18
|
+
var styles = {"component":"file-upload-item__component_1pp48","infoSection":"file-upload-item__infoSection_1pp48","info":"file-upload-item__info_1pp48","icon":"file-upload-item__icon_1pp48","errorIcon":"file-upload-item__errorIcon_1pp48","successIcon":"file-upload-item__successIcon_1pp48","name":"file-upload-item__name_1pp48","meta":"file-upload-item__meta_1pp48","size":"file-upload-item__size_1pp48","delete":"file-upload-item__delete_1pp48","download":"file-upload-item__download_1pp48","errorWrapper":"file-upload-item__errorWrapper_1pp48","restore":"file-upload-item__restore_1pp48","spinnerWrapper":"file-upload-item__spinnerWrapper_1pp48","spinner":"file-upload-item__spinner_1pp48","uploadPercent":"file-upload-item__uploadPercent_1pp48"};
|
|
19
19
|
require('./index.css')
|
|
20
20
|
|
|
21
21
|
var FileUploadItem = function (_a) {
|
|
22
|
-
var className = _a.className, children = _a.children, _b = _a.id, id = _b === void 0 ? '0' : _b, _c = _a.name, name = _c === void 0 ? '' : _c, size = _a.size, _d = _a.icon, Icon = _d === void 0 ? fileIcon(name) : _d, uploadDate = _a.uploadDate, downloadLink = _a.downloadLink, download = _a.download, uploadStatus = _a.uploadStatus, _e = _a.uploadPercent, uploadPercent = _e === void 0 ? 0 : _e, error = _a.error, showDelete = _a.showDelete, showRestore = _a.showRestore, onDelete = _a.onDelete, onDownload = _a.onDownload, onRestore = _a.onRestore, dataTestId = _a.dataTestId;
|
|
22
|
+
var className = _a.className, children = _a.children, _b = _a.id, id = _b === void 0 ? '0' : _b, _c = _a.name, name = _c === void 0 ? '' : _c, size = _a.size, _d = _a.icon, Icon = _d === void 0 ? fileIcon(name) : _d, uploadDate = _a.uploadDate, downloadLink = _a.downloadLink, download = _a.download, uploadStatus = _a.uploadStatus, _e = _a.uploadPercent, uploadPercent = _e === void 0 ? 0 : _e, error = _a.error, showDelete = _a.showDelete, showRestore = _a.showRestore, onDelete = _a.onDelete, onDownload = _a.onDownload, onRestore = _a.onRestore, disableButtons = _a.disableButtons, dataTestId = _a.dataTestId;
|
|
23
23
|
var handleDownload = useCallback(function (event) {
|
|
24
24
|
if (onDownload) {
|
|
25
25
|
event.preventDefault();
|
|
@@ -70,8 +70,8 @@ var FileUploadItem = function (_a) {
|
|
|
70
70
|
uploadDate && React.createElement("span", { key: uploadDate }, uploadDate),
|
|
71
71
|
size && (React.createElement("span", { key: size, className: styles.size }, humanFileSize(size)))))),
|
|
72
72
|
showRestore && (React.createElement(Link, { pseudo: true, className: styles.restore, onClick: handleRestore }, "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C")),
|
|
73
|
-
showDownload && (React.createElement(IconButton, { size: 'xxs', icon: PointerDownMIcon, className: styles.download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, download: download })),
|
|
74
|
-
showDelete && !showRestore && (React.createElement(IconButton, { size: 'xxs', icon: CrossMIcon, onClick: handleDelete, className: styles.delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
73
|
+
showDownload && (React.createElement(IconButton, { size: 'xxs', icon: PointerDownMIcon, className: styles.download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, disabled: disableButtons, download: download })),
|
|
74
|
+
showDelete && !showRestore && (React.createElement(IconButton, { size: 'xxs', icon: CrossMIcon, onClick: handleDelete, disabled: disableButtons, className: styles.delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
export { FileUploadItem };
|
package/dist/esm/index.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
--gap-s: 12px;
|
|
23
23
|
--gap-xl: 24px;
|
|
24
24
|
}
|
|
25
|
-
.file-upload-
|
|
25
|
+
.file-upload-item__component_1pp48 {
|
|
26
26
|
font-size: 13px;
|
|
27
27
|
line-height: 16px;
|
|
28
28
|
font-weight: 400;
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
box-shadow: 0 -1px 0 0 var(--color-light-border-primary) inset;
|
|
35
35
|
box-sizing: border-box
|
|
36
36
|
}
|
|
37
|
-
.file-upload-
|
|
37
|
+
.file-upload-item__component_1pp48 svg {
|
|
38
38
|
display: block;
|
|
39
39
|
}
|
|
40
|
-
.file-upload-
|
|
40
|
+
.file-upload-item__infoSection_1pp48 {
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
flex: 1;
|
|
@@ -45,86 +45,86 @@
|
|
|
45
45
|
margin-left: var(--gap-s);
|
|
46
46
|
min-width: 40%;
|
|
47
47
|
}
|
|
48
|
-
.file-upload-
|
|
48
|
+
.file-upload-item__info_1pp48 {
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
flex: 1;
|
|
52
52
|
overflow: hidden;
|
|
53
53
|
}
|
|
54
|
-
.file-upload-
|
|
54
|
+
.file-upload-item__icon_1pp48 {
|
|
55
55
|
display: block;
|
|
56
56
|
flex-shrink: 0;
|
|
57
57
|
color: var(--color-light-text-primary);
|
|
58
58
|
}
|
|
59
|
-
.file-upload-
|
|
59
|
+
.file-upload-item__errorIcon_1pp48 {
|
|
60
60
|
flex-shrink: 0;
|
|
61
61
|
color: var(--color-light-graphic-negative);
|
|
62
62
|
}
|
|
63
|
-
.file-upload-
|
|
63
|
+
.file-upload-item__successIcon_1pp48 {
|
|
64
64
|
flex-shrink: 0;
|
|
65
65
|
color: var(--color-light-graphic-positive);
|
|
66
66
|
}
|
|
67
|
-
.file-upload-
|
|
67
|
+
.file-upload-item__name_1pp48 {
|
|
68
68
|
white-space: nowrap;
|
|
69
69
|
overflow: hidden;
|
|
70
70
|
text-overflow: ellipsis;
|
|
71
71
|
color: var(--color-light-text-primary)
|
|
72
72
|
}
|
|
73
|
-
.file-upload-
|
|
73
|
+
.file-upload-item__meta_1pp48 {
|
|
74
74
|
display: flex;
|
|
75
75
|
white-space: nowrap;
|
|
76
76
|
margin-right: var(--gap-2xs);
|
|
77
77
|
margin-left: var(--gap-xl);
|
|
78
78
|
padding: var(--gap-2xs) 0
|
|
79
79
|
}
|
|
80
|
-
.file-upload-
|
|
80
|
+
.file-upload-item__meta_1pp48 > * {
|
|
81
81
|
margin-right: var(--gap-s)
|
|
82
82
|
}
|
|
83
|
-
.file-upload-
|
|
83
|
+
.file-upload-item__meta_1pp48 > *:last-child {
|
|
84
84
|
margin-right: 0;
|
|
85
85
|
}
|
|
86
|
-
.file-upload-
|
|
86
|
+
.file-upload-item__size_1pp48 {
|
|
87
87
|
text-align: right;
|
|
88
88
|
}
|
|
89
|
-
.file-upload-
|
|
90
|
-
.file-upload-
|
|
89
|
+
.file-upload-item__delete_1pp48,
|
|
90
|
+
.file-upload-item__download_1pp48 {
|
|
91
91
|
height: 24px;
|
|
92
92
|
width: 24px;
|
|
93
93
|
margin-left: var(--gap-xs)
|
|
94
94
|
}
|
|
95
|
-
.file-upload-
|
|
95
|
+
.file-upload-item__delete_1pp48 svg, .file-upload-item__download_1pp48 svg {
|
|
96
96
|
width: 18px;
|
|
97
97
|
height: 18px;
|
|
98
98
|
}
|
|
99
|
-
.file-upload-
|
|
99
|
+
.file-upload-item__errorWrapper_1pp48 {
|
|
100
100
|
margin-top: var(--gap-s);
|
|
101
101
|
color: var(--color-light-text-accent)
|
|
102
102
|
}
|
|
103
103
|
@media (--small-only) {
|
|
104
|
-
.file-upload-
|
|
104
|
+
.file-upload-item__errorWrapper_1pp48 {
|
|
105
105
|
flex: 1 0 100%;
|
|
106
106
|
margin-top: var(--gap-3xs)
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
.file-upload-
|
|
109
|
+
.file-upload-item__restore_1pp48 {
|
|
110
110
|
font-size: 14px;
|
|
111
111
|
line-height: 20px;
|
|
112
112
|
font-weight: 400;
|
|
113
113
|
|
|
114
114
|
margin-left: var(--gap-s);
|
|
115
115
|
}
|
|
116
|
-
.file-upload-
|
|
116
|
+
.file-upload-item__spinnerWrapper_1pp48 {
|
|
117
117
|
display: flex;
|
|
118
118
|
justify-content: center;
|
|
119
119
|
align-items: center;
|
|
120
120
|
width: 24px;
|
|
121
121
|
height: 24px;
|
|
122
122
|
}
|
|
123
|
-
.file-upload-
|
|
123
|
+
.file-upload-item__spinner_1pp48 {
|
|
124
124
|
width: 20px;
|
|
125
125
|
height: 20px;
|
|
126
126
|
}
|
|
127
|
-
.file-upload-
|
|
127
|
+
.file-upload-item__uploadPercent_1pp48 {
|
|
128
128
|
margin-top: var(--gap-2xs);
|
|
129
129
|
margin-left: var(--gap-xl);
|
|
130
130
|
}
|
package/dist/index.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
--gap-s: 12px;
|
|
23
23
|
--gap-xl: 24px;
|
|
24
24
|
}
|
|
25
|
-
.file-upload-
|
|
25
|
+
.file-upload-item__component_1pp48 {
|
|
26
26
|
font-size: 13px;
|
|
27
27
|
line-height: 16px;
|
|
28
28
|
font-weight: 400;
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
box-shadow: 0 -1px 0 0 var(--color-light-border-primary) inset;
|
|
35
35
|
box-sizing: border-box
|
|
36
36
|
}
|
|
37
|
-
.file-upload-
|
|
37
|
+
.file-upload-item__component_1pp48 svg {
|
|
38
38
|
display: block;
|
|
39
39
|
}
|
|
40
|
-
.file-upload-
|
|
40
|
+
.file-upload-item__infoSection_1pp48 {
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
flex: 1;
|
|
@@ -45,86 +45,86 @@
|
|
|
45
45
|
margin-left: var(--gap-s);
|
|
46
46
|
min-width: 40%;
|
|
47
47
|
}
|
|
48
|
-
.file-upload-
|
|
48
|
+
.file-upload-item__info_1pp48 {
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
flex: 1;
|
|
52
52
|
overflow: hidden;
|
|
53
53
|
}
|
|
54
|
-
.file-upload-
|
|
54
|
+
.file-upload-item__icon_1pp48 {
|
|
55
55
|
display: block;
|
|
56
56
|
flex-shrink: 0;
|
|
57
57
|
color: var(--color-light-text-primary);
|
|
58
58
|
}
|
|
59
|
-
.file-upload-
|
|
59
|
+
.file-upload-item__errorIcon_1pp48 {
|
|
60
60
|
flex-shrink: 0;
|
|
61
61
|
color: var(--color-light-graphic-negative);
|
|
62
62
|
}
|
|
63
|
-
.file-upload-
|
|
63
|
+
.file-upload-item__successIcon_1pp48 {
|
|
64
64
|
flex-shrink: 0;
|
|
65
65
|
color: var(--color-light-graphic-positive);
|
|
66
66
|
}
|
|
67
|
-
.file-upload-
|
|
67
|
+
.file-upload-item__name_1pp48 {
|
|
68
68
|
white-space: nowrap;
|
|
69
69
|
overflow: hidden;
|
|
70
70
|
text-overflow: ellipsis;
|
|
71
71
|
color: var(--color-light-text-primary)
|
|
72
72
|
}
|
|
73
|
-
.file-upload-
|
|
73
|
+
.file-upload-item__meta_1pp48 {
|
|
74
74
|
display: flex;
|
|
75
75
|
white-space: nowrap;
|
|
76
76
|
margin-right: var(--gap-2xs);
|
|
77
77
|
margin-left: var(--gap-xl);
|
|
78
78
|
padding: var(--gap-2xs) 0
|
|
79
79
|
}
|
|
80
|
-
.file-upload-
|
|
80
|
+
.file-upload-item__meta_1pp48 > * {
|
|
81
81
|
margin-right: var(--gap-s)
|
|
82
82
|
}
|
|
83
|
-
.file-upload-
|
|
83
|
+
.file-upload-item__meta_1pp48 > *:last-child {
|
|
84
84
|
margin-right: 0;
|
|
85
85
|
}
|
|
86
|
-
.file-upload-
|
|
86
|
+
.file-upload-item__size_1pp48 {
|
|
87
87
|
text-align: right;
|
|
88
88
|
}
|
|
89
|
-
.file-upload-
|
|
90
|
-
.file-upload-
|
|
89
|
+
.file-upload-item__delete_1pp48,
|
|
90
|
+
.file-upload-item__download_1pp48 {
|
|
91
91
|
height: 24px;
|
|
92
92
|
width: 24px;
|
|
93
93
|
margin-left: var(--gap-xs)
|
|
94
94
|
}
|
|
95
|
-
.file-upload-
|
|
95
|
+
.file-upload-item__delete_1pp48 svg, .file-upload-item__download_1pp48 svg {
|
|
96
96
|
width: 18px;
|
|
97
97
|
height: 18px;
|
|
98
98
|
}
|
|
99
|
-
.file-upload-
|
|
99
|
+
.file-upload-item__errorWrapper_1pp48 {
|
|
100
100
|
margin-top: var(--gap-s);
|
|
101
101
|
color: var(--color-light-text-accent)
|
|
102
102
|
}
|
|
103
103
|
@media (--small-only) {
|
|
104
|
-
.file-upload-
|
|
104
|
+
.file-upload-item__errorWrapper_1pp48 {
|
|
105
105
|
flex: 1 0 100%;
|
|
106
106
|
margin-top: var(--gap-3xs)
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
.file-upload-
|
|
109
|
+
.file-upload-item__restore_1pp48 {
|
|
110
110
|
font-size: 14px;
|
|
111
111
|
line-height: 20px;
|
|
112
112
|
font-weight: 400;
|
|
113
113
|
|
|
114
114
|
margin-left: var(--gap-s);
|
|
115
115
|
}
|
|
116
|
-
.file-upload-
|
|
116
|
+
.file-upload-item__spinnerWrapper_1pp48 {
|
|
117
117
|
display: flex;
|
|
118
118
|
justify-content: center;
|
|
119
119
|
align-items: center;
|
|
120
120
|
width: 24px;
|
|
121
121
|
height: 24px;
|
|
122
122
|
}
|
|
123
|
-
.file-upload-
|
|
123
|
+
.file-upload-item__spinner_1pp48 {
|
|
124
124
|
width: 20px;
|
|
125
125
|
height: 20px;
|
|
126
126
|
}
|
|
127
|
-
.file-upload-
|
|
127
|
+
.file-upload-item__uploadPercent_1pp48 {
|
|
128
128
|
margin-top: var(--gap-2xs);
|
|
129
129
|
margin-left: var(--gap-xl);
|
|
130
130
|
}
|
|
@@ -74,6 +74,10 @@ type FileUploadItemProps = {
|
|
|
74
74
|
* Обработчик восстановления файла
|
|
75
75
|
*/
|
|
76
76
|
onRestore?: (id: string) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Управление активностью кнопок
|
|
79
|
+
*/
|
|
80
|
+
disableButtons?: boolean;
|
|
77
81
|
/**
|
|
78
82
|
* Идентификатор для систем автоматизированного тестирования
|
|
79
83
|
*/
|
package/dist/modern/Component.js
CHANGED
|
@@ -15,10 +15,10 @@ import '@alfalab/icons-glyph/DocumentUnknownMIcon';
|
|
|
15
15
|
import '@alfalab/icons-glyph/DocumentImageMIcon';
|
|
16
16
|
import { fileIcon, humanFileSize } from './utils.js';
|
|
17
17
|
|
|
18
|
-
var styles = {"component":"file-upload-
|
|
18
|
+
var styles = {"component":"file-upload-item__component_1pp48","infoSection":"file-upload-item__infoSection_1pp48","info":"file-upload-item__info_1pp48","icon":"file-upload-item__icon_1pp48","errorIcon":"file-upload-item__errorIcon_1pp48","successIcon":"file-upload-item__successIcon_1pp48","name":"file-upload-item__name_1pp48","meta":"file-upload-item__meta_1pp48","size":"file-upload-item__size_1pp48","delete":"file-upload-item__delete_1pp48","download":"file-upload-item__download_1pp48","errorWrapper":"file-upload-item__errorWrapper_1pp48","restore":"file-upload-item__restore_1pp48","spinnerWrapper":"file-upload-item__spinnerWrapper_1pp48","spinner":"file-upload-item__spinner_1pp48","uploadPercent":"file-upload-item__uploadPercent_1pp48"};
|
|
19
19
|
require('./index.css')
|
|
20
20
|
|
|
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, dataTestId, }) => {
|
|
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, }) => {
|
|
22
22
|
const handleDownload = useCallback((event) => {
|
|
23
23
|
if (onDownload) {
|
|
24
24
|
event.preventDefault();
|
|
@@ -69,8 +69,8 @@ const FileUploadItem = ({ className, children, id = '0', name = '', size, icon:
|
|
|
69
69
|
uploadDate && React.createElement("span", { key: uploadDate }, uploadDate),
|
|
70
70
|
size && (React.createElement("span", { key: size, className: styles.size }, humanFileSize(size)))))),
|
|
71
71
|
showRestore && (React.createElement(Link, { pseudo: true, className: styles.restore, onClick: handleRestore }, "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C")),
|
|
72
|
-
showDownload && (React.createElement(IconButton, { size: 'xxs', icon: PointerDownMIcon, className: styles.download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, download: download })),
|
|
73
|
-
showDelete && !showRestore && (React.createElement(IconButton, { size: 'xxs', icon: CrossMIcon, onClick: handleDelete, className: styles.delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
72
|
+
showDownload && (React.createElement(IconButton, { size: 'xxs', icon: PointerDownMIcon, className: styles.download, "aria-label": '\u0441\u043A\u0430\u0447\u0430\u0442\u044C', href: downloadLink, onClick: handleDownload, disabled: disableButtons, download: download })),
|
|
73
|
+
showDelete && !showRestore && (React.createElement(IconButton, { size: 'xxs', icon: CrossMIcon, onClick: handleDelete, disabled: disableButtons, className: styles.delete, "aria-label": '\u0443\u0434\u0430\u043B\u0438\u0442\u044C' }))));
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
export { FileUploadItem };
|
package/dist/modern/index.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
--gap-s: 12px;
|
|
23
23
|
--gap-xl: 24px;
|
|
24
24
|
}
|
|
25
|
-
.file-upload-
|
|
25
|
+
.file-upload-item__component_1pp48 {
|
|
26
26
|
font-size: 13px;
|
|
27
27
|
line-height: 16px;
|
|
28
28
|
font-weight: 400;
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
box-shadow: 0 -1px 0 0 var(--color-light-border-primary) inset;
|
|
35
35
|
box-sizing: border-box
|
|
36
36
|
}
|
|
37
|
-
.file-upload-
|
|
37
|
+
.file-upload-item__component_1pp48 svg {
|
|
38
38
|
display: block;
|
|
39
39
|
}
|
|
40
|
-
.file-upload-
|
|
40
|
+
.file-upload-item__infoSection_1pp48 {
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
flex: 1;
|
|
@@ -45,86 +45,86 @@
|
|
|
45
45
|
margin-left: var(--gap-s);
|
|
46
46
|
min-width: 40%;
|
|
47
47
|
}
|
|
48
|
-
.file-upload-
|
|
48
|
+
.file-upload-item__info_1pp48 {
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
flex: 1;
|
|
52
52
|
overflow: hidden;
|
|
53
53
|
}
|
|
54
|
-
.file-upload-
|
|
54
|
+
.file-upload-item__icon_1pp48 {
|
|
55
55
|
display: block;
|
|
56
56
|
flex-shrink: 0;
|
|
57
57
|
color: var(--color-light-text-primary);
|
|
58
58
|
}
|
|
59
|
-
.file-upload-
|
|
59
|
+
.file-upload-item__errorIcon_1pp48 {
|
|
60
60
|
flex-shrink: 0;
|
|
61
61
|
color: var(--color-light-graphic-negative);
|
|
62
62
|
}
|
|
63
|
-
.file-upload-
|
|
63
|
+
.file-upload-item__successIcon_1pp48 {
|
|
64
64
|
flex-shrink: 0;
|
|
65
65
|
color: var(--color-light-graphic-positive);
|
|
66
66
|
}
|
|
67
|
-
.file-upload-
|
|
67
|
+
.file-upload-item__name_1pp48 {
|
|
68
68
|
white-space: nowrap;
|
|
69
69
|
overflow: hidden;
|
|
70
70
|
text-overflow: ellipsis;
|
|
71
71
|
color: var(--color-light-text-primary)
|
|
72
72
|
}
|
|
73
|
-
.file-upload-
|
|
73
|
+
.file-upload-item__meta_1pp48 {
|
|
74
74
|
display: flex;
|
|
75
75
|
white-space: nowrap;
|
|
76
76
|
margin-right: var(--gap-2xs);
|
|
77
77
|
margin-left: var(--gap-xl);
|
|
78
78
|
padding: var(--gap-2xs) 0
|
|
79
79
|
}
|
|
80
|
-
.file-upload-
|
|
80
|
+
.file-upload-item__meta_1pp48 > * {
|
|
81
81
|
margin-right: var(--gap-s)
|
|
82
82
|
}
|
|
83
|
-
.file-upload-
|
|
83
|
+
.file-upload-item__meta_1pp48 > *:last-child {
|
|
84
84
|
margin-right: 0;
|
|
85
85
|
}
|
|
86
|
-
.file-upload-
|
|
86
|
+
.file-upload-item__size_1pp48 {
|
|
87
87
|
text-align: right;
|
|
88
88
|
}
|
|
89
|
-
.file-upload-
|
|
90
|
-
.file-upload-
|
|
89
|
+
.file-upload-item__delete_1pp48,
|
|
90
|
+
.file-upload-item__download_1pp48 {
|
|
91
91
|
height: 24px;
|
|
92
92
|
width: 24px;
|
|
93
93
|
margin-left: var(--gap-xs)
|
|
94
94
|
}
|
|
95
|
-
.file-upload-
|
|
95
|
+
.file-upload-item__delete_1pp48 svg, .file-upload-item__download_1pp48 svg {
|
|
96
96
|
width: 18px;
|
|
97
97
|
height: 18px;
|
|
98
98
|
}
|
|
99
|
-
.file-upload-
|
|
99
|
+
.file-upload-item__errorWrapper_1pp48 {
|
|
100
100
|
margin-top: var(--gap-s);
|
|
101
101
|
color: var(--color-light-text-accent)
|
|
102
102
|
}
|
|
103
103
|
@media (--small-only) {
|
|
104
|
-
.file-upload-
|
|
104
|
+
.file-upload-item__errorWrapper_1pp48 {
|
|
105
105
|
flex: 1 0 100%;
|
|
106
106
|
margin-top: var(--gap-3xs)
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
.file-upload-
|
|
109
|
+
.file-upload-item__restore_1pp48 {
|
|
110
110
|
font-size: 14px;
|
|
111
111
|
line-height: 20px;
|
|
112
112
|
font-weight: 400;
|
|
113
113
|
|
|
114
114
|
margin-left: var(--gap-s);
|
|
115
115
|
}
|
|
116
|
-
.file-upload-
|
|
116
|
+
.file-upload-item__spinnerWrapper_1pp48 {
|
|
117
117
|
display: flex;
|
|
118
118
|
justify-content: center;
|
|
119
119
|
align-items: center;
|
|
120
120
|
width: 24px;
|
|
121
121
|
height: 24px;
|
|
122
122
|
}
|
|
123
|
-
.file-upload-
|
|
123
|
+
.file-upload-item__spinner_1pp48 {
|
|
124
124
|
width: 20px;
|
|
125
125
|
height: 20px;
|
|
126
126
|
}
|
|
127
|
-
.file-upload-
|
|
127
|
+
.file-upload-item__uploadPercent_1pp48 {
|
|
128
128
|
margin-top: var(--gap-2xs);
|
|
129
129
|
margin-left: var(--gap-xl);
|
|
130
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-file-upload-item",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"react": "^16.9.0 || ^17.0.1"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@alfalab/core-components-icon-button": "^4.1.
|
|
19
|
+
"@alfalab/core-components-icon-button": "^4.1.12",
|
|
20
20
|
"@alfalab/core-components-link": "^3.2.4",
|
|
21
21
|
"@alfalab/core-components-spinner": "^2.0.3",
|
|
22
22
|
"@alfalab/icons-glyph": "^2.16.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "7b9b0bbb422c34b432003ddc335fe15f596ad6d5"
|
|
25
25
|
}
|