@alfalab/core-components-file-upload-item 5.5.0 → 5.6.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/Component.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ElementType, ReactNode } from "react";
3
+ import { ElementType, MouseEvent, ReactNode } from "react";
4
4
  type FileStatuses = 'ERROR' | 'SUCCESS' | 'LOADING' | 'UPLOADING';
5
5
  type FileUploadItemProps = {
6
6
  /**
@@ -69,7 +69,7 @@ type FileUploadItemProps = {
69
69
  /**
70
70
  * Обработчик удаления файла
71
71
  */
72
- onDelete?: (id: string) => void;
72
+ onDelete?: (id: string, event?: MouseEvent<HTMLElement>) => void;
73
73
  /**
74
74
  * Обработчик восстановления файла
75
75
  */
package/Component.js CHANGED
@@ -19,7 +19,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
19
19
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
20
20
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
21
21
 
22
- var styles = {"component":"file-upload-item__component_1sj7r","infoSection":"file-upload-item__infoSection_1sj7r","info":"file-upload-item__info_1sj7r","icon":"file-upload-item__icon_1sj7r","errorIcon":"file-upload-item__errorIcon_1sj7r","successIcon":"file-upload-item__successIcon_1sj7r","name":"file-upload-item__name_1sj7r","rowLimit":"file-upload-item__rowLimit_1sj7r","meta":"file-upload-item__meta_1sj7r","size":"file-upload-item__size_1sj7r","delete":"file-upload-item__delete_1sj7r","download":"file-upload-item__download_1sj7r","errorWrapper":"file-upload-item__errorWrapper_1sj7r","restore":"file-upload-item__restore_1sj7r","spinnerWrapper":"file-upload-item__spinnerWrapper_1sj7r","spinner":"file-upload-item__spinner_1sj7r","uploadPercent":"file-upload-item__uploadPercent_1sj7r"};
22
+ var styles = {"component":"file-upload-item__component_15h75","infoSection":"file-upload-item__infoSection_15h75","info":"file-upload-item__info_15h75","icon":"file-upload-item__icon_15h75","errorIcon":"file-upload-item__errorIcon_15h75","successIcon":"file-upload-item__successIcon_15h75","name":"file-upload-item__name_15h75","rowLimit":"file-upload-item__rowLimit_15h75","meta":"file-upload-item__meta_15h75","size":"file-upload-item__size_15h75","delete":"file-upload-item__delete_15h75","download":"file-upload-item__download_15h75","errorWrapper":"file-upload-item__errorWrapper_15h75","restore":"file-upload-item__restore_15h75","spinnerWrapper":"file-upload-item__spinnerWrapper_15h75","spinner":"file-upload-item__spinner_15h75","uploadPercent":"file-upload-item__uploadPercent_15h75"};
23
23
  require('./index.css')
24
24
 
25
25
  var FileUploadItem = function (_a) {
@@ -30,9 +30,9 @@ var FileUploadItem = function (_a) {
30
30
  onDownload(id);
31
31
  }
32
32
  };
33
- var handleDelete = function () {
33
+ var handleDelete = function (event) {
34
34
  if (onDelete)
35
- onDelete(id);
35
+ onDelete(id, event);
36
36
  };
37
37
  var handleRestore = function () {
38
38
  if (onRestore)
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ElementType, ReactNode } from "react";
3
+ import { ElementType, MouseEvent, ReactNode } from "react";
4
4
  type FileStatuses = 'ERROR' | 'SUCCESS' | 'LOADING' | 'UPLOADING';
5
5
  type FileUploadItemProps = {
6
6
  /**
@@ -69,7 +69,7 @@ type FileUploadItemProps = {
69
69
  /**
70
70
  * Обработчик удаления файла
71
71
  */
72
- onDelete?: (id: string) => void;
72
+ onDelete?: (id: string, event?: MouseEvent<HTMLElement>) => void;
73
73
  /**
74
74
  * Обработчик восстановления файла
75
75
  */
package/cssm/Component.js CHANGED
@@ -29,9 +29,9 @@ var FileUploadItem = function (_a) {
29
29
  onDownload(id);
30
30
  }
31
31
  };
32
- var handleDelete = function () {
32
+ var handleDelete = function (event) {
33
33
  if (onDelete)
34
- onDelete(id);
34
+ onDelete(id, event);
35
35
  };
36
36
  var handleRestore = function () {
37
37
  if (onRestore)
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ElementType, ReactNode } from "react";
3
+ import { ElementType, MouseEvent, ReactNode } from "react";
4
4
  type FileStatuses = 'ERROR' | 'SUCCESS' | 'LOADING' | 'UPLOADING';
5
5
  type FileUploadItemProps = {
6
6
  /**
@@ -69,7 +69,7 @@ type FileUploadItemProps = {
69
69
  /**
70
70
  * Обработчик удаления файла
71
71
  */
72
- onDelete?: (id: string) => void;
72
+ onDelete?: (id: string, event?: MouseEvent<HTMLElement>) => void;
73
73
  /**
74
74
  * Обработчик восстановления файла
75
75
  */
package/esm/Component.js CHANGED
@@ -10,7 +10,7 @@ import { CrossSIcon } from '@alfalab/icons-glyph/CrossSIcon';
10
10
  import { PointerDownSIcon } from '@alfalab/icons-glyph/PointerDownSIcon';
11
11
  import { fileIcon, humanFileSize } from './utils.js';
12
12
 
13
- var styles = {"component":"file-upload-item__component_1sj7r","infoSection":"file-upload-item__infoSection_1sj7r","info":"file-upload-item__info_1sj7r","icon":"file-upload-item__icon_1sj7r","errorIcon":"file-upload-item__errorIcon_1sj7r","successIcon":"file-upload-item__successIcon_1sj7r","name":"file-upload-item__name_1sj7r","rowLimit":"file-upload-item__rowLimit_1sj7r","meta":"file-upload-item__meta_1sj7r","size":"file-upload-item__size_1sj7r","delete":"file-upload-item__delete_1sj7r","download":"file-upload-item__download_1sj7r","errorWrapper":"file-upload-item__errorWrapper_1sj7r","restore":"file-upload-item__restore_1sj7r","spinnerWrapper":"file-upload-item__spinnerWrapper_1sj7r","spinner":"file-upload-item__spinner_1sj7r","uploadPercent":"file-upload-item__uploadPercent_1sj7r"};
13
+ var styles = {"component":"file-upload-item__component_15h75","infoSection":"file-upload-item__infoSection_15h75","info":"file-upload-item__info_15h75","icon":"file-upload-item__icon_15h75","errorIcon":"file-upload-item__errorIcon_15h75","successIcon":"file-upload-item__successIcon_15h75","name":"file-upload-item__name_15h75","rowLimit":"file-upload-item__rowLimit_15h75","meta":"file-upload-item__meta_15h75","size":"file-upload-item__size_15h75","delete":"file-upload-item__delete_15h75","download":"file-upload-item__download_15h75","errorWrapper":"file-upload-item__errorWrapper_15h75","restore":"file-upload-item__restore_15h75","spinnerWrapper":"file-upload-item__spinnerWrapper_15h75","spinner":"file-upload-item__spinner_15h75","uploadPercent":"file-upload-item__uploadPercent_15h75"};
14
14
  require('./index.css')
15
15
 
16
16
  var FileUploadItem = function (_a) {
@@ -21,9 +21,9 @@ var FileUploadItem = function (_a) {
21
21
  onDownload(id);
22
22
  }
23
23
  };
24
- var handleDelete = function () {
24
+ var handleDelete = function (event) {
25
25
  if (onDelete)
26
- onDelete(id);
26
+ onDelete(id, event);
27
27
  };
28
28
  var handleRestore = function () {
29
29
  if (onRestore)
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 12ndz */
1
+ /* hash: ycu52 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-1500: #0e0e0e;
@@ -26,7 +26,7 @@
26
26
  --gap-xl: 24px;
27
27
  } :root {
28
28
  } :root {
29
- } .file-upload-item__component_1sj7r {
29
+ } .file-upload-item__component_15h75 {
30
30
  font-size: 13px;
31
31
  line-height: 16px;
32
32
  font-weight: 400;
@@ -38,82 +38,82 @@
38
38
  color: var(--color-light-text-secondary);
39
39
  box-shadow: 0 -1px 0 0 var(--color-light-neutral-300) inset;
40
40
  box-sizing: border-box
41
- } .file-upload-item__component_1sj7r svg {
41
+ } .file-upload-item__component_15h75 svg {
42
42
  display: block;
43
- } .file-upload-item__component_1sj7r:last-child {
43
+ } .file-upload-item__component_15h75:last-child {
44
44
  box-shadow: none;
45
- } .file-upload-item__infoSection_1sj7r {
45
+ } .file-upload-item__infoSection_15h75 {
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  flex: 1;
49
49
  margin-top: var(--gap-2xs);
50
50
  margin-left: var(--gap-s);
51
51
  min-width: 40%;
52
- } .file-upload-item__info_1sj7r {
52
+ } .file-upload-item__info_15h75 {
53
53
  display: flex;
54
54
  flex-wrap: wrap;
55
55
  flex: 1;
56
56
  overflow: hidden;
57
- } .file-upload-item__icon_1sj7r {
57
+ } .file-upload-item__icon_15h75 {
58
58
  display: block;
59
59
  flex-shrink: 0;
60
60
  color: var(--color-light-neutral-1500);
61
- } .file-upload-item__errorIcon_1sj7r {
61
+ } .file-upload-item__errorIcon_15h75 {
62
62
  flex-shrink: 0;
63
63
  color: var(--color-light-status-negative);
64
- } .file-upload-item__successIcon_1sj7r {
64
+ } .file-upload-item__successIcon_15h75 {
65
65
  flex-shrink: 0;
66
66
  color: var(--color-light-status-positive);
67
- } .file-upload-item__name_1sj7r {
67
+ } .file-upload-item__name_15h75 {
68
68
  color: var(--color-light-text-primary)
69
- } .file-upload-item__name_1sj7r a {
69
+ } .file-upload-item__name_15h75 a {
70
70
  display: block;
71
71
  margin-bottom: 1px;
72
- } .file-upload-item__name_1sj7r.file-upload-item__rowLimit_1sj7r {
72
+ } .file-upload-item__name_15h75.file-upload-item__rowLimit_15h75 {
73
73
  white-space: nowrap;
74
74
  overflow: hidden;
75
75
  text-overflow: ellipsis;
76
- } .file-upload-item__meta_1sj7r {
76
+ } .file-upload-item__meta_15h75 {
77
77
  display: flex;
78
78
  white-space: nowrap;
79
79
  margin-right: var(--gap-2xs);
80
80
  margin-left: 36px;
81
81
  padding: var(--gap-2xs) 0
82
- } .file-upload-item__meta_1sj7r > * {
82
+ } .file-upload-item__meta_15h75 > * {
83
83
  margin-right: var(--gap-s)
84
- } .file-upload-item__meta_1sj7r > *:last-child {
84
+ } .file-upload-item__meta_15h75 > *:last-child {
85
85
  margin-right: 0;
86
- } .file-upload-item__size_1sj7r {
86
+ } .file-upload-item__size_15h75 {
87
87
  text-align: right;
88
- } .file-upload-item__delete_1sj7r,
89
- .file-upload-item__download_1sj7r {
88
+ } .file-upload-item__delete_15h75,
89
+ .file-upload-item__download_15h75 {
90
90
  height: 24px;
91
91
  width: 24px;
92
92
  margin-left: var(--gap-xs);
93
- } .file-upload-item__errorWrapper_1sj7r {
93
+ } .file-upload-item__errorWrapper_15h75 {
94
94
  margin-top: var(--gap-s);
95
95
  color: var(--color-light-text-negative)
96
- } @media (--small-only) { .file-upload-item__errorWrapper_1sj7r {
96
+ } @media (--small-only) { .file-upload-item__errorWrapper_15h75 {
97
97
  flex: 1 0 100%;
98
98
  margin-top: var(--gap-3xs)
99
99
  }
100
- } .file-upload-item__restore_1sj7r {
100
+ } .file-upload-item__restore_15h75 {
101
101
  font-size: 14px;
102
102
  line-height: 20px;
103
103
  font-weight: 400;
104
104
 
105
105
  margin-left: var(--gap-s);
106
106
  margin-top: var(--gap-3xs);
107
- } .file-upload-item__spinnerWrapper_1sj7r {
107
+ } .file-upload-item__spinnerWrapper_15h75 {
108
108
  display: flex;
109
109
  justify-content: center;
110
110
  align-items: center;
111
111
  width: 24px;
112
112
  height: 24px;
113
- } .file-upload-item__spinner_1sj7r {
113
+ } .file-upload-item__spinner_15h75 {
114
114
  width: 20px;
115
115
  height: 20px;
116
- } .file-upload-item__uploadPercent_1sj7r {
116
+ } .file-upload-item__uploadPercent_15h75 {
117
117
  margin-top: var(--gap-2xs);
118
118
  margin-left: var(--gap-xl);
119
119
  }
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 12ndz */
1
+ /* hash: ycu52 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-1500: #0e0e0e;
@@ -26,7 +26,7 @@
26
26
  --gap-xl: 24px;
27
27
  } :root {
28
28
  } :root {
29
- } .file-upload-item__component_1sj7r {
29
+ } .file-upload-item__component_15h75 {
30
30
  font-size: 13px;
31
31
  line-height: 16px;
32
32
  font-weight: 400;
@@ -38,82 +38,82 @@
38
38
  color: var(--color-light-text-secondary);
39
39
  box-shadow: 0 -1px 0 0 var(--color-light-neutral-300) inset;
40
40
  box-sizing: border-box
41
- } .file-upload-item__component_1sj7r svg {
41
+ } .file-upload-item__component_15h75 svg {
42
42
  display: block;
43
- } .file-upload-item__component_1sj7r:last-child {
43
+ } .file-upload-item__component_15h75:last-child {
44
44
  box-shadow: none;
45
- } .file-upload-item__infoSection_1sj7r {
45
+ } .file-upload-item__infoSection_15h75 {
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  flex: 1;
49
49
  margin-top: var(--gap-2xs);
50
50
  margin-left: var(--gap-s);
51
51
  min-width: 40%;
52
- } .file-upload-item__info_1sj7r {
52
+ } .file-upload-item__info_15h75 {
53
53
  display: flex;
54
54
  flex-wrap: wrap;
55
55
  flex: 1;
56
56
  overflow: hidden;
57
- } .file-upload-item__icon_1sj7r {
57
+ } .file-upload-item__icon_15h75 {
58
58
  display: block;
59
59
  flex-shrink: 0;
60
60
  color: var(--color-light-neutral-1500);
61
- } .file-upload-item__errorIcon_1sj7r {
61
+ } .file-upload-item__errorIcon_15h75 {
62
62
  flex-shrink: 0;
63
63
  color: var(--color-light-status-negative);
64
- } .file-upload-item__successIcon_1sj7r {
64
+ } .file-upload-item__successIcon_15h75 {
65
65
  flex-shrink: 0;
66
66
  color: var(--color-light-status-positive);
67
- } .file-upload-item__name_1sj7r {
67
+ } .file-upload-item__name_15h75 {
68
68
  color: var(--color-light-text-primary)
69
- } .file-upload-item__name_1sj7r a {
69
+ } .file-upload-item__name_15h75 a {
70
70
  display: block;
71
71
  margin-bottom: 1px;
72
- } .file-upload-item__name_1sj7r.file-upload-item__rowLimit_1sj7r {
72
+ } .file-upload-item__name_15h75.file-upload-item__rowLimit_15h75 {
73
73
  white-space: nowrap;
74
74
  overflow: hidden;
75
75
  text-overflow: ellipsis;
76
- } .file-upload-item__meta_1sj7r {
76
+ } .file-upload-item__meta_15h75 {
77
77
  display: flex;
78
78
  white-space: nowrap;
79
79
  margin-right: var(--gap-2xs);
80
80
  margin-left: 36px;
81
81
  padding: var(--gap-2xs) 0
82
- } .file-upload-item__meta_1sj7r > * {
82
+ } .file-upload-item__meta_15h75 > * {
83
83
  margin-right: var(--gap-s)
84
- } .file-upload-item__meta_1sj7r > *:last-child {
84
+ } .file-upload-item__meta_15h75 > *:last-child {
85
85
  margin-right: 0;
86
- } .file-upload-item__size_1sj7r {
86
+ } .file-upload-item__size_15h75 {
87
87
  text-align: right;
88
- } .file-upload-item__delete_1sj7r,
89
- .file-upload-item__download_1sj7r {
88
+ } .file-upload-item__delete_15h75,
89
+ .file-upload-item__download_15h75 {
90
90
  height: 24px;
91
91
  width: 24px;
92
92
  margin-left: var(--gap-xs);
93
- } .file-upload-item__errorWrapper_1sj7r {
93
+ } .file-upload-item__errorWrapper_15h75 {
94
94
  margin-top: var(--gap-s);
95
95
  color: var(--color-light-text-negative)
96
- } @media (--small-only) { .file-upload-item__errorWrapper_1sj7r {
96
+ } @media (--small-only) { .file-upload-item__errorWrapper_15h75 {
97
97
  flex: 1 0 100%;
98
98
  margin-top: var(--gap-3xs)
99
99
  }
100
- } .file-upload-item__restore_1sj7r {
100
+ } .file-upload-item__restore_15h75 {
101
101
  font-size: 14px;
102
102
  line-height: 20px;
103
103
  font-weight: 400;
104
104
 
105
105
  margin-left: var(--gap-s);
106
106
  margin-top: var(--gap-3xs);
107
- } .file-upload-item__spinnerWrapper_1sj7r {
107
+ } .file-upload-item__spinnerWrapper_15h75 {
108
108
  display: flex;
109
109
  justify-content: center;
110
110
  align-items: center;
111
111
  width: 24px;
112
112
  height: 24px;
113
- } .file-upload-item__spinner_1sj7r {
113
+ } .file-upload-item__spinner_15h75 {
114
114
  width: 20px;
115
115
  height: 20px;
116
- } .file-upload-item__uploadPercent_1sj7r {
116
+ } .file-upload-item__uploadPercent_15h75 {
117
117
  margin-top: var(--gap-2xs);
118
118
  margin-left: var(--gap-xl);
119
119
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ElementType, ReactNode } from "react";
3
+ import { ElementType, MouseEvent, ReactNode } from "react";
4
4
  type FileStatuses = 'ERROR' | 'SUCCESS' | 'LOADING' | 'UPLOADING';
5
5
  type FileUploadItemProps = {
6
6
  /**
@@ -69,7 +69,7 @@ type FileUploadItemProps = {
69
69
  /**
70
70
  * Обработчик удаления файла
71
71
  */
72
- onDelete?: (id: string) => void;
72
+ onDelete?: (id: string, event?: MouseEvent<HTMLElement>) => void;
73
73
  /**
74
74
  * Обработчик восстановления файла
75
75
  */
@@ -10,7 +10,7 @@ import { CrossSIcon } from '@alfalab/icons-glyph/CrossSIcon';
10
10
  import { PointerDownSIcon } from '@alfalab/icons-glyph/PointerDownSIcon';
11
11
  import { humanFileSize, fileIcon } from './utils.js';
12
12
 
13
- const styles = {"component":"file-upload-item__component_1sj7r","infoSection":"file-upload-item__infoSection_1sj7r","info":"file-upload-item__info_1sj7r","icon":"file-upload-item__icon_1sj7r","errorIcon":"file-upload-item__errorIcon_1sj7r","successIcon":"file-upload-item__successIcon_1sj7r","name":"file-upload-item__name_1sj7r","rowLimit":"file-upload-item__rowLimit_1sj7r","meta":"file-upload-item__meta_1sj7r","size":"file-upload-item__size_1sj7r","delete":"file-upload-item__delete_1sj7r","download":"file-upload-item__download_1sj7r","errorWrapper":"file-upload-item__errorWrapper_1sj7r","restore":"file-upload-item__restore_1sj7r","spinnerWrapper":"file-upload-item__spinnerWrapper_1sj7r","spinner":"file-upload-item__spinner_1sj7r","uploadPercent":"file-upload-item__uploadPercent_1sj7r"};
13
+ const styles = {"component":"file-upload-item__component_15h75","infoSection":"file-upload-item__infoSection_15h75","info":"file-upload-item__info_15h75","icon":"file-upload-item__icon_15h75","errorIcon":"file-upload-item__errorIcon_15h75","successIcon":"file-upload-item__successIcon_15h75","name":"file-upload-item__name_15h75","rowLimit":"file-upload-item__rowLimit_15h75","meta":"file-upload-item__meta_15h75","size":"file-upload-item__size_15h75","delete":"file-upload-item__delete_15h75","download":"file-upload-item__download_15h75","errorWrapper":"file-upload-item__errorWrapper_15h75","restore":"file-upload-item__restore_15h75","spinnerWrapper":"file-upload-item__spinnerWrapper_15h75","spinner":"file-upload-item__spinner_15h75","uploadPercent":"file-upload-item__uploadPercent_15h75"};
14
14
  require('./index.css')
15
15
 
16
16
  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, multiline = false, dataTestId, }) => {
@@ -20,9 +20,9 @@ const FileUploadItem = ({ className, children, id = '0', name = '', size, icon:
20
20
  onDownload(id);
21
21
  }
22
22
  };
23
- const handleDelete = () => {
23
+ const handleDelete = (event) => {
24
24
  if (onDelete)
25
- onDelete(id);
25
+ onDelete(id, event);
26
26
  };
27
27
  const handleRestore = () => {
28
28
  if (onRestore)
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 12ndz */
1
+ /* hash: ycu52 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-1500: #0e0e0e;
@@ -26,7 +26,7 @@
26
26
  --gap-xl: 24px;
27
27
  } :root {
28
28
  } :root {
29
- } .file-upload-item__component_1sj7r {
29
+ } .file-upload-item__component_15h75 {
30
30
  font-size: 13px;
31
31
  line-height: 16px;
32
32
  font-weight: 400;
@@ -38,82 +38,82 @@
38
38
  color: var(--color-light-text-secondary);
39
39
  box-shadow: 0 -1px 0 0 var(--color-light-neutral-300) inset;
40
40
  box-sizing: border-box
41
- } .file-upload-item__component_1sj7r svg {
41
+ } .file-upload-item__component_15h75 svg {
42
42
  display: block;
43
- } .file-upload-item__component_1sj7r:last-child {
43
+ } .file-upload-item__component_15h75:last-child {
44
44
  box-shadow: none;
45
- } .file-upload-item__infoSection_1sj7r {
45
+ } .file-upload-item__infoSection_15h75 {
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  flex: 1;
49
49
  margin-top: var(--gap-2xs);
50
50
  margin-left: var(--gap-s);
51
51
  min-width: 40%;
52
- } .file-upload-item__info_1sj7r {
52
+ } .file-upload-item__info_15h75 {
53
53
  display: flex;
54
54
  flex-wrap: wrap;
55
55
  flex: 1;
56
56
  overflow: hidden;
57
- } .file-upload-item__icon_1sj7r {
57
+ } .file-upload-item__icon_15h75 {
58
58
  display: block;
59
59
  flex-shrink: 0;
60
60
  color: var(--color-light-neutral-1500);
61
- } .file-upload-item__errorIcon_1sj7r {
61
+ } .file-upload-item__errorIcon_15h75 {
62
62
  flex-shrink: 0;
63
63
  color: var(--color-light-status-negative);
64
- } .file-upload-item__successIcon_1sj7r {
64
+ } .file-upload-item__successIcon_15h75 {
65
65
  flex-shrink: 0;
66
66
  color: var(--color-light-status-positive);
67
- } .file-upload-item__name_1sj7r {
67
+ } .file-upload-item__name_15h75 {
68
68
  color: var(--color-light-text-primary)
69
- } .file-upload-item__name_1sj7r a {
69
+ } .file-upload-item__name_15h75 a {
70
70
  display: block;
71
71
  margin-bottom: 1px;
72
- } .file-upload-item__name_1sj7r.file-upload-item__rowLimit_1sj7r {
72
+ } .file-upload-item__name_15h75.file-upload-item__rowLimit_15h75 {
73
73
  white-space: nowrap;
74
74
  overflow: hidden;
75
75
  text-overflow: ellipsis;
76
- } .file-upload-item__meta_1sj7r {
76
+ } .file-upload-item__meta_15h75 {
77
77
  display: flex;
78
78
  white-space: nowrap;
79
79
  margin-right: var(--gap-2xs);
80
80
  margin-left: 36px;
81
81
  padding: var(--gap-2xs) 0
82
- } .file-upload-item__meta_1sj7r > * {
82
+ } .file-upload-item__meta_15h75 > * {
83
83
  margin-right: var(--gap-s)
84
- } .file-upload-item__meta_1sj7r > *:last-child {
84
+ } .file-upload-item__meta_15h75 > *:last-child {
85
85
  margin-right: 0;
86
- } .file-upload-item__size_1sj7r {
86
+ } .file-upload-item__size_15h75 {
87
87
  text-align: right;
88
- } .file-upload-item__delete_1sj7r,
89
- .file-upload-item__download_1sj7r {
88
+ } .file-upload-item__delete_15h75,
89
+ .file-upload-item__download_15h75 {
90
90
  height: 24px;
91
91
  width: 24px;
92
92
  margin-left: var(--gap-xs);
93
- } .file-upload-item__errorWrapper_1sj7r {
93
+ } .file-upload-item__errorWrapper_15h75 {
94
94
  margin-top: var(--gap-s);
95
95
  color: var(--color-light-text-negative)
96
- } @media (--small-only) { .file-upload-item__errorWrapper_1sj7r {
96
+ } @media (--small-only) { .file-upload-item__errorWrapper_15h75 {
97
97
  flex: 1 0 100%;
98
98
  margin-top: var(--gap-3xs)
99
99
  }
100
- } .file-upload-item__restore_1sj7r {
100
+ } .file-upload-item__restore_15h75 {
101
101
  font-size: 14px;
102
102
  line-height: 20px;
103
103
  font-weight: 400;
104
104
 
105
105
  margin-left: var(--gap-s);
106
106
  margin-top: var(--gap-3xs);
107
- } .file-upload-item__spinnerWrapper_1sj7r {
107
+ } .file-upload-item__spinnerWrapper_15h75 {
108
108
  display: flex;
109
109
  justify-content: center;
110
110
  align-items: center;
111
111
  width: 24px;
112
112
  height: 24px;
113
- } .file-upload-item__spinner_1sj7r {
113
+ } .file-upload-item__spinner_15h75 {
114
114
  width: 20px;
115
115
  height: 20px;
116
- } .file-upload-item__uploadPercent_1sj7r {
116
+ } .file-upload-item__uploadPercent_15h75 {
117
117
  margin-top: var(--gap-2xs);
118
118
  margin-left: var(--gap-xl);
119
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-file-upload-item",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@alfalab/core-components-icon-button": "^6.5.4",
17
+ "@alfalab/core-components-icon-button": "^6.5.5",
18
18
  "@alfalab/core-components-link": "^5.2.1",
19
19
  "@alfalab/core-components-spinner": "^3.3.0",
20
20
  "@alfalab/icons-glyph": "^2.139.0",
package/src/Component.tsx CHANGED
@@ -96,7 +96,7 @@ export type FileUploadItemProps = {
96
96
  /**
97
97
  * Обработчик удаления файла
98
98
  */
99
- onDelete?: (id: string) => void;
99
+ onDelete?: (id: string, event?: MouseEvent<HTMLElement>) => void;
100
100
 
101
101
  /**
102
102
  * Обработчик восстановления файла
@@ -148,8 +148,8 @@ export const FileUploadItem: React.FC<FileUploadItemProps> = ({
148
148
  }
149
149
  };
150
150
 
151
- const handleDelete = () => {
152
- if (onDelete) onDelete(id);
151
+ const handleDelete = (event: MouseEvent<HTMLElement>) => {
152
+ if (onDelete) onDelete(id, event);
153
153
  };
154
154
 
155
155
  const handleRestore = () => {