@alfalab/core-components-file-upload-item 3.6.5 → 3.7.3

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 CHANGED
@@ -3,6 +3,49 @@
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.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-file-upload-item@3.7.2...@alfalab/core-components-file-upload-item@3.7.3) (2022-06-28)
7
+
8
+ **Note:** Version bump only for package @alfalab/core-components-file-upload-item
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.7.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-file-upload-item@3.7.1...@alfalab/core-components-file-upload-item@3.7.2) (2022-06-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **icon-button:** fix disabled colors ([#104](https://github.com/core-ds/core-components/issues/104)) ([3f03849](https://github.com/core-ds/core-components/commit/3f038495bb63f72cd81ceeedbe55b52119581d57))
20
+
21
+
22
+
23
+
24
+
25
+ ## [3.7.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-file-upload-item@3.7.0...@alfalab/core-components-file-upload-item@3.7.1) (2022-06-23)
26
+
27
+ **Note:** Version bump only for package @alfalab/core-components-file-upload-item
28
+
29
+
30
+
31
+
32
+
33
+ # [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)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **icon-button:** fix loading ([#105](https://github.com/core-ds/core-components/issues/105)) ([0b133f0](https://github.com/core-ds/core-components/commit/0b133f042e86702ec2861915f2cdbcdbad9ca905))
39
+
40
+
41
+ ### Features
42
+
43
+ * **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))
44
+
45
+
46
+
47
+
48
+
6
49
  ## [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
50
 
8
51
  **Note:** Version bump only for package @alfalab/core-components-file-upload-item
@@ -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-item__component_10h7l","infoSection":"file-upload-item__infoSection_10h7l","info":"file-upload-item__info_10h7l","icon":"file-upload-item__icon_10h7l","errorIcon":"file-upload-item__errorIcon_10h7l","successIcon":"file-upload-item__successIcon_10h7l","name":"file-upload-item__name_10h7l","meta":"file-upload-item__meta_10h7l","size":"file-upload-item__size_10h7l","delete":"file-upload-item__delete_10h7l","download":"file-upload-item__download_10h7l","errorWrapper":"file-upload-item__errorWrapper_10h7l","restore":"file-upload-item__restore_10h7l","spinnerWrapper":"file-upload-item__spinnerWrapper_10h7l","spinner":"file-upload-item__spinner_10h7l","uploadPercent":"file-upload-item__uploadPercent_10h7l"};
27
+ var styles = {"component":"file-upload-item__component_1bbpu","infoSection":"file-upload-item__infoSection_1bbpu","info":"file-upload-item__info_1bbpu","icon":"file-upload-item__icon_1bbpu","errorIcon":"file-upload-item__errorIcon_1bbpu","successIcon":"file-upload-item__successIcon_1bbpu","name":"file-upload-item__name_1bbpu","meta":"file-upload-item__meta_1bbpu","size":"file-upload-item__size_1bbpu","delete":"file-upload-item__delete_1bbpu","download":"file-upload-item__download_1bbpu","errorWrapper":"file-upload-item__errorWrapper_1bbpu","restore":"file-upload-item__restore_1bbpu","spinnerWrapper":"file-upload-item__spinnerWrapper_1bbpu","spinner":"file-upload-item__spinner_1bbpu","uploadPercent":"file-upload-item__uploadPercent_1bbpu"};
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;
@@ -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
  */
@@ -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;
@@ -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
  */
@@ -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-item__component_10h7l","infoSection":"file-upload-item__infoSection_10h7l","info":"file-upload-item__info_10h7l","icon":"file-upload-item__icon_10h7l","errorIcon":"file-upload-item__errorIcon_10h7l","successIcon":"file-upload-item__successIcon_10h7l","name":"file-upload-item__name_10h7l","meta":"file-upload-item__meta_10h7l","size":"file-upload-item__size_10h7l","delete":"file-upload-item__delete_10h7l","download":"file-upload-item__download_10h7l","errorWrapper":"file-upload-item__errorWrapper_10h7l","restore":"file-upload-item__restore_10h7l","spinnerWrapper":"file-upload-item__spinnerWrapper_10h7l","spinner":"file-upload-item__spinner_10h7l","uploadPercent":"file-upload-item__uploadPercent_10h7l"};
18
+ var styles = {"component":"file-upload-item__component_1bbpu","infoSection":"file-upload-item__infoSection_1bbpu","info":"file-upload-item__info_1bbpu","icon":"file-upload-item__icon_1bbpu","errorIcon":"file-upload-item__errorIcon_1bbpu","successIcon":"file-upload-item__successIcon_1bbpu","name":"file-upload-item__name_1bbpu","meta":"file-upload-item__meta_1bbpu","size":"file-upload-item__size_1bbpu","delete":"file-upload-item__delete_1bbpu","download":"file-upload-item__download_1bbpu","errorWrapper":"file-upload-item__errorWrapper_1bbpu","restore":"file-upload-item__restore_1bbpu","spinnerWrapper":"file-upload-item__spinnerWrapper_1bbpu","spinner":"file-upload-item__spinner_1bbpu","uploadPercent":"file-upload-item__uploadPercent_1bbpu"};
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 };
@@ -1,4 +1,4 @@
1
- /* hash: nz1cm */
1
+ /* hash: 1riqo */
2
2
  :root {
3
3
  --color-light-border-primary: #dbdee1;
4
4
  --color-light-graphic-negative: #f15045;
@@ -22,7 +22,7 @@
22
22
  --gap-s: 12px;
23
23
  --gap-xl: 24px;
24
24
  }
25
- .file-upload-item__component_10h7l {
25
+ .file-upload-item__component_1bbpu {
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-item__component_10h7l svg {
37
+ .file-upload-item__component_1bbpu svg {
38
38
  display: block;
39
39
  }
40
- .file-upload-item__infoSection_10h7l {
40
+ .file-upload-item__infoSection_1bbpu {
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-item__info_10h7l {
48
+ .file-upload-item__info_1bbpu {
49
49
  display: flex;
50
50
  flex-wrap: wrap;
51
51
  flex: 1;
52
52
  overflow: hidden;
53
53
  }
54
- .file-upload-item__icon_10h7l {
54
+ .file-upload-item__icon_1bbpu {
55
55
  display: block;
56
56
  flex-shrink: 0;
57
57
  color: var(--color-light-text-primary);
58
58
  }
59
- .file-upload-item__errorIcon_10h7l {
59
+ .file-upload-item__errorIcon_1bbpu {
60
60
  flex-shrink: 0;
61
61
  color: var(--color-light-graphic-negative);
62
62
  }
63
- .file-upload-item__successIcon_10h7l {
63
+ .file-upload-item__successIcon_1bbpu {
64
64
  flex-shrink: 0;
65
65
  color: var(--color-light-graphic-positive);
66
66
  }
67
- .file-upload-item__name_10h7l {
67
+ .file-upload-item__name_1bbpu {
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-item__meta_10h7l {
73
+ .file-upload-item__meta_1bbpu {
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-item__meta_10h7l > * {
80
+ .file-upload-item__meta_1bbpu > * {
81
81
  margin-right: var(--gap-s)
82
82
  }
83
- .file-upload-item__meta_10h7l > *:last-child {
83
+ .file-upload-item__meta_1bbpu > *:last-child {
84
84
  margin-right: 0;
85
85
  }
86
- .file-upload-item__size_10h7l {
86
+ .file-upload-item__size_1bbpu {
87
87
  text-align: right;
88
88
  }
89
- .file-upload-item__delete_10h7l,
90
- .file-upload-item__download_10h7l {
89
+ .file-upload-item__delete_1bbpu,
90
+ .file-upload-item__download_1bbpu {
91
91
  height: 24px;
92
92
  width: 24px;
93
93
  margin-left: var(--gap-xs)
94
94
  }
95
- .file-upload-item__delete_10h7l svg, .file-upload-item__download_10h7l svg {
95
+ .file-upload-item__delete_1bbpu svg, .file-upload-item__download_1bbpu svg {
96
96
  width: 18px;
97
97
  height: 18px;
98
98
  }
99
- .file-upload-item__errorWrapper_10h7l {
99
+ .file-upload-item__errorWrapper_1bbpu {
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-item__errorWrapper_10h7l {
104
+ .file-upload-item__errorWrapper_1bbpu {
105
105
  flex: 1 0 100%;
106
106
  margin-top: var(--gap-3xs)
107
107
  }
108
108
  }
109
- .file-upload-item__restore_10h7l {
109
+ .file-upload-item__restore_1bbpu {
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-item__spinnerWrapper_10h7l {
116
+ .file-upload-item__spinnerWrapper_1bbpu {
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-item__spinner_10h7l {
123
+ .file-upload-item__spinner_1bbpu {
124
124
  width: 20px;
125
125
  height: 20px;
126
126
  }
127
- .file-upload-item__uploadPercent_10h7l {
127
+ .file-upload-item__uploadPercent_1bbpu {
128
128
  margin-top: var(--gap-2xs);
129
129
  margin-left: var(--gap-xl);
130
130
  }
package/dist/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: nz1cm */
1
+ /* hash: 1riqo */
2
2
  :root {
3
3
  --color-light-border-primary: #dbdee1;
4
4
  --color-light-graphic-negative: #f15045;
@@ -22,7 +22,7 @@
22
22
  --gap-s: 12px;
23
23
  --gap-xl: 24px;
24
24
  }
25
- .file-upload-item__component_10h7l {
25
+ .file-upload-item__component_1bbpu {
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-item__component_10h7l svg {
37
+ .file-upload-item__component_1bbpu svg {
38
38
  display: block;
39
39
  }
40
- .file-upload-item__infoSection_10h7l {
40
+ .file-upload-item__infoSection_1bbpu {
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-item__info_10h7l {
48
+ .file-upload-item__info_1bbpu {
49
49
  display: flex;
50
50
  flex-wrap: wrap;
51
51
  flex: 1;
52
52
  overflow: hidden;
53
53
  }
54
- .file-upload-item__icon_10h7l {
54
+ .file-upload-item__icon_1bbpu {
55
55
  display: block;
56
56
  flex-shrink: 0;
57
57
  color: var(--color-light-text-primary);
58
58
  }
59
- .file-upload-item__errorIcon_10h7l {
59
+ .file-upload-item__errorIcon_1bbpu {
60
60
  flex-shrink: 0;
61
61
  color: var(--color-light-graphic-negative);
62
62
  }
63
- .file-upload-item__successIcon_10h7l {
63
+ .file-upload-item__successIcon_1bbpu {
64
64
  flex-shrink: 0;
65
65
  color: var(--color-light-graphic-positive);
66
66
  }
67
- .file-upload-item__name_10h7l {
67
+ .file-upload-item__name_1bbpu {
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-item__meta_10h7l {
73
+ .file-upload-item__meta_1bbpu {
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-item__meta_10h7l > * {
80
+ .file-upload-item__meta_1bbpu > * {
81
81
  margin-right: var(--gap-s)
82
82
  }
83
- .file-upload-item__meta_10h7l > *:last-child {
83
+ .file-upload-item__meta_1bbpu > *:last-child {
84
84
  margin-right: 0;
85
85
  }
86
- .file-upload-item__size_10h7l {
86
+ .file-upload-item__size_1bbpu {
87
87
  text-align: right;
88
88
  }
89
- .file-upload-item__delete_10h7l,
90
- .file-upload-item__download_10h7l {
89
+ .file-upload-item__delete_1bbpu,
90
+ .file-upload-item__download_1bbpu {
91
91
  height: 24px;
92
92
  width: 24px;
93
93
  margin-left: var(--gap-xs)
94
94
  }
95
- .file-upload-item__delete_10h7l svg, .file-upload-item__download_10h7l svg {
95
+ .file-upload-item__delete_1bbpu svg, .file-upload-item__download_1bbpu svg {
96
96
  width: 18px;
97
97
  height: 18px;
98
98
  }
99
- .file-upload-item__errorWrapper_10h7l {
99
+ .file-upload-item__errorWrapper_1bbpu {
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-item__errorWrapper_10h7l {
104
+ .file-upload-item__errorWrapper_1bbpu {
105
105
  flex: 1 0 100%;
106
106
  margin-top: var(--gap-3xs)
107
107
  }
108
108
  }
109
- .file-upload-item__restore_10h7l {
109
+ .file-upload-item__restore_1bbpu {
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-item__spinnerWrapper_10h7l {
116
+ .file-upload-item__spinnerWrapper_1bbpu {
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-item__spinner_10h7l {
123
+ .file-upload-item__spinner_1bbpu {
124
124
  width: 20px;
125
125
  height: 20px;
126
126
  }
127
- .file-upload-item__uploadPercent_10h7l {
127
+ .file-upload-item__uploadPercent_1bbpu {
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
  */
@@ -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-item__component_10h7l","infoSection":"file-upload-item__infoSection_10h7l","info":"file-upload-item__info_10h7l","icon":"file-upload-item__icon_10h7l","errorIcon":"file-upload-item__errorIcon_10h7l","successIcon":"file-upload-item__successIcon_10h7l","name":"file-upload-item__name_10h7l","meta":"file-upload-item__meta_10h7l","size":"file-upload-item__size_10h7l","delete":"file-upload-item__delete_10h7l","download":"file-upload-item__download_10h7l","errorWrapper":"file-upload-item__errorWrapper_10h7l","restore":"file-upload-item__restore_10h7l","spinnerWrapper":"file-upload-item__spinnerWrapper_10h7l","spinner":"file-upload-item__spinner_10h7l","uploadPercent":"file-upload-item__uploadPercent_10h7l"};
18
+ var styles = {"component":"file-upload-item__component_1bbpu","infoSection":"file-upload-item__infoSection_1bbpu","info":"file-upload-item__info_1bbpu","icon":"file-upload-item__icon_1bbpu","errorIcon":"file-upload-item__errorIcon_1bbpu","successIcon":"file-upload-item__successIcon_1bbpu","name":"file-upload-item__name_1bbpu","meta":"file-upload-item__meta_1bbpu","size":"file-upload-item__size_1bbpu","delete":"file-upload-item__delete_1bbpu","download":"file-upload-item__download_1bbpu","errorWrapper":"file-upload-item__errorWrapper_1bbpu","restore":"file-upload-item__restore_1bbpu","spinnerWrapper":"file-upload-item__spinnerWrapper_1bbpu","spinner":"file-upload-item__spinner_1bbpu","uploadPercent":"file-upload-item__uploadPercent_1bbpu"};
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 };
@@ -1,4 +1,4 @@
1
- /* hash: nz1cm */
1
+ /* hash: 1riqo */
2
2
  :root {
3
3
  --color-light-border-primary: #dbdee1;
4
4
  --color-light-graphic-negative: #f15045;
@@ -22,7 +22,7 @@
22
22
  --gap-s: 12px;
23
23
  --gap-xl: 24px;
24
24
  }
25
- .file-upload-item__component_10h7l {
25
+ .file-upload-item__component_1bbpu {
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-item__component_10h7l svg {
37
+ .file-upload-item__component_1bbpu svg {
38
38
  display: block;
39
39
  }
40
- .file-upload-item__infoSection_10h7l {
40
+ .file-upload-item__infoSection_1bbpu {
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-item__info_10h7l {
48
+ .file-upload-item__info_1bbpu {
49
49
  display: flex;
50
50
  flex-wrap: wrap;
51
51
  flex: 1;
52
52
  overflow: hidden;
53
53
  }
54
- .file-upload-item__icon_10h7l {
54
+ .file-upload-item__icon_1bbpu {
55
55
  display: block;
56
56
  flex-shrink: 0;
57
57
  color: var(--color-light-text-primary);
58
58
  }
59
- .file-upload-item__errorIcon_10h7l {
59
+ .file-upload-item__errorIcon_1bbpu {
60
60
  flex-shrink: 0;
61
61
  color: var(--color-light-graphic-negative);
62
62
  }
63
- .file-upload-item__successIcon_10h7l {
63
+ .file-upload-item__successIcon_1bbpu {
64
64
  flex-shrink: 0;
65
65
  color: var(--color-light-graphic-positive);
66
66
  }
67
- .file-upload-item__name_10h7l {
67
+ .file-upload-item__name_1bbpu {
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-item__meta_10h7l {
73
+ .file-upload-item__meta_1bbpu {
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-item__meta_10h7l > * {
80
+ .file-upload-item__meta_1bbpu > * {
81
81
  margin-right: var(--gap-s)
82
82
  }
83
- .file-upload-item__meta_10h7l > *:last-child {
83
+ .file-upload-item__meta_1bbpu > *:last-child {
84
84
  margin-right: 0;
85
85
  }
86
- .file-upload-item__size_10h7l {
86
+ .file-upload-item__size_1bbpu {
87
87
  text-align: right;
88
88
  }
89
- .file-upload-item__delete_10h7l,
90
- .file-upload-item__download_10h7l {
89
+ .file-upload-item__delete_1bbpu,
90
+ .file-upload-item__download_1bbpu {
91
91
  height: 24px;
92
92
  width: 24px;
93
93
  margin-left: var(--gap-xs)
94
94
  }
95
- .file-upload-item__delete_10h7l svg, .file-upload-item__download_10h7l svg {
95
+ .file-upload-item__delete_1bbpu svg, .file-upload-item__download_1bbpu svg {
96
96
  width: 18px;
97
97
  height: 18px;
98
98
  }
99
- .file-upload-item__errorWrapper_10h7l {
99
+ .file-upload-item__errorWrapper_1bbpu {
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-item__errorWrapper_10h7l {
104
+ .file-upload-item__errorWrapper_1bbpu {
105
105
  flex: 1 0 100%;
106
106
  margin-top: var(--gap-3xs)
107
107
  }
108
108
  }
109
- .file-upload-item__restore_10h7l {
109
+ .file-upload-item__restore_1bbpu {
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-item__spinnerWrapper_10h7l {
116
+ .file-upload-item__spinnerWrapper_1bbpu {
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-item__spinner_10h7l {
123
+ .file-upload-item__spinner_1bbpu {
124
124
  width: 20px;
125
125
  height: 20px;
126
126
  }
127
- .file-upload-item__uploadPercent_10h7l {
127
+ .file-upload-item__uploadPercent_1bbpu {
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.6.5",
3
+ "version": "3.7.3",
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.11",
20
- "@alfalab/core-components-link": "^3.2.4",
21
- "@alfalab/core-components-spinner": "^2.0.3",
19
+ "@alfalab/core-components-icon-button": "^4.2.0",
20
+ "@alfalab/core-components-link": "^3.3.0",
21
+ "@alfalab/core-components-spinner": "^2.1.0",
22
22
  "@alfalab/icons-glyph": "^2.16.0"
23
23
  },
24
- "gitHead": "d86d1207351d2e8dceb0519cbb0b64c06aaa6884"
24
+ "gitHead": "dcd5c0c8e25b7c374ff9311505ccf738a82e22c0"
25
25
  }