@alfalab/core-components-file-upload-item 8.0.10 → 8.1.0-alfasans
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 +2 -2
- package/Component.js +5 -35
- package/Component.js.map +1 -1
- package/components/actions-control/actions-control.css +8 -8
- package/components/actions-control/actions-control.module.css.js +1 -1
- package/components/actions-control/actions.js +3 -6
- package/components/actions-control/actions.js.map +1 -1
- package/components/actions-control/components/delete-button/delete-button.js +1 -1
- package/components/actions-control/components/delete-button/delete-button.js.map +1 -1
- package/components/actions-control/components/download-button/download-button.js +1 -1
- package/components/actions-control/components/download-button/download-button.js.map +1 -1
- package/components/actions-control/components/restore-button/restore-button.js +1 -1
- package/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/components/actions-control/components/reupload-button/index.d.ts +2 -0
- package/components/actions-control/components/reupload-button/index.js +28 -0
- package/components/actions-control/components/reupload-button/index.js.map +1 -0
- package/components/content/components/content-error/content-error.css +1 -1
- package/components/content/components/content-error/content-error.js +1 -1
- package/components/content/components/content-error/content-error.js.map +1 -1
- package/components/content/components/content-error/content-error.module.css.js +1 -1
- package/components/content/components/content-subtitle/content-subtitle.css +3 -3
- package/components/content/components/content-subtitle/content-subtitle.js +2 -8
- package/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/components/content/content.css +7 -7
- package/components/content/content.js +1 -1
- package/components/content/content.js.map +1 -1
- package/components/content/content.module.css.js +1 -1
- package/components/status-control/extension-icon/index.css +9 -5
- package/components/status-control/extension-icon/index.js +9 -3
- package/components/status-control/extension-icon/index.js.map +1 -1
- package/components/status-control/extension-icon/index.module.css.js +1 -1
- package/components/status-control/extension-icon/index.module.css.js.map +1 -1
- package/components/status-control/index.css +8 -8
- package/components/status-control/index.js +4 -4
- package/components/status-control/index.js.map +1 -1
- package/components/status-control/index.module.css.js +1 -1
- package/context/file-upload-item-context.d.ts +5 -34
- package/context/file-upload-item-context.js +3 -29
- package/context/file-upload-item-context.js.map +1 -1
- package/context/use-context-value.d.ts +6 -0
- package/context/use-context-value.js +70 -0
- package/context/use-context-value.js.map +1 -0
- package/cssm/Component.d.ts +2 -2
- package/cssm/Component.js +5 -35
- package/cssm/Component.js.map +1 -1
- package/cssm/components/actions-control/actions.js +3 -6
- package/cssm/components/actions-control/actions.js.map +1 -1
- package/cssm/components/actions-control/components/delete-button/delete-button.js +1 -1
- package/cssm/components/actions-control/components/delete-button/delete-button.js.map +1 -1
- package/cssm/components/actions-control/components/download-button/download-button.js +1 -1
- package/cssm/components/actions-control/components/download-button/download-button.js.map +1 -1
- package/cssm/components/actions-control/components/restore-button/restore-button.js +1 -1
- package/cssm/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/cssm/components/actions-control/components/reupload-button/index.d.ts +2 -0
- package/cssm/components/actions-control/components/reupload-button/index.js +29 -0
- package/cssm/components/actions-control/components/reupload-button/index.js.map +1 -0
- package/cssm/components/content/components/content-error/content-error.js +1 -1
- package/cssm/components/content/components/content-error/content-error.js.map +1 -1
- package/cssm/components/content/components/content-subtitle/content-subtitle.js +2 -8
- package/cssm/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/cssm/components/content/content.js +1 -1
- package/cssm/components/content/content.js.map +1 -1
- package/cssm/components/status-control/extension-icon/index.js +9 -3
- package/cssm/components/status-control/extension-icon/index.js.map +1 -1
- package/cssm/components/status-control/extension-icon/index.module.css +4 -0
- package/cssm/components/status-control/index.js +4 -4
- package/cssm/components/status-control/index.js.map +1 -1
- package/cssm/context/file-upload-item-context.d.ts +5 -34
- package/cssm/context/file-upload-item-context.js +3 -29
- package/cssm/context/file-upload-item-context.js.map +1 -1
- package/cssm/context/use-context-value.d.ts +6 -0
- package/cssm/context/use-context-value.js +70 -0
- package/cssm/context/use-context-value.js.map +1 -0
- package/cssm/types/file-upload-item-props.d.ts +7 -0
- package/esm/Component.d.ts +2 -2
- package/esm/Component.js +6 -36
- package/esm/Component.js.map +1 -1
- package/esm/components/actions-control/actions-control.css +8 -8
- package/esm/components/actions-control/actions-control.module.css.js +1 -1
- package/esm/components/actions-control/actions.js +5 -8
- package/esm/components/actions-control/actions.js.map +1 -1
- package/esm/components/actions-control/components/delete-button/delete-button.js +3 -3
- package/esm/components/actions-control/components/delete-button/delete-button.js.map +1 -1
- package/esm/components/actions-control/components/download-button/download-button.js +3 -3
- package/esm/components/actions-control/components/download-button/download-button.js.map +1 -1
- package/esm/components/actions-control/components/restore-button/restore-button.js +3 -3
- package/esm/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/esm/components/actions-control/components/reupload-button/index.d.ts +2 -0
- package/esm/components/actions-control/components/reupload-button/index.js +19 -0
- package/esm/components/actions-control/components/reupload-button/index.js.map +1 -0
- package/esm/components/content/components/content-error/content-error.css +1 -1
- package/esm/components/content/components/content-error/content-error.js +3 -3
- package/esm/components/content/components/content-error/content-error.js.map +1 -1
- package/esm/components/content/components/content-error/content-error.module.css.js +1 -1
- package/esm/components/content/components/content-subtitle/content-subtitle.css +3 -3
- package/esm/components/content/components/content-subtitle/content-subtitle.js +4 -10
- package/esm/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/esm/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/esm/components/content/content.css +7 -7
- package/esm/components/content/content.js +3 -3
- package/esm/components/content/content.js.map +1 -1
- package/esm/components/content/content.module.css.js +1 -1
- package/esm/components/status-control/extension-icon/index.css +9 -5
- package/esm/components/status-control/extension-icon/index.js +11 -5
- package/esm/components/status-control/extension-icon/index.js.map +1 -1
- package/esm/components/status-control/extension-icon/index.module.css.js +1 -1
- package/esm/components/status-control/extension-icon/index.module.css.js.map +1 -1
- package/esm/components/status-control/index.css +8 -8
- package/esm/components/status-control/index.js +6 -6
- package/esm/components/status-control/index.js.map +1 -1
- package/esm/components/status-control/index.module.css.js +1 -1
- package/esm/context/file-upload-item-context.d.ts +5 -34
- package/esm/context/file-upload-item-context.js +4 -31
- package/esm/context/file-upload-item-context.js.map +1 -1
- package/esm/context/use-context-value.d.ts +6 -0
- package/esm/context/use-context-value.js +66 -0
- package/esm/context/use-context-value.js.map +1 -0
- package/esm/index.css +2 -2
- package/esm/index.module.css.js +1 -1
- package/esm/types/file-upload-item-props.d.ts +7 -0
- package/index.css +2 -2
- package/index.module.css.js +1 -1
- package/modern/Component.d.ts +2 -2
- package/modern/Component.js +5 -36
- package/modern/Component.js.map +1 -1
- package/modern/components/actions-control/actions-control.css +8 -8
- package/modern/components/actions-control/actions-control.module.css.js +1 -1
- package/modern/components/actions-control/actions.js +5 -8
- package/modern/components/actions-control/actions.js.map +1 -1
- package/modern/components/actions-control/components/delete-button/delete-button.js +3 -3
- package/modern/components/actions-control/components/delete-button/delete-button.js.map +1 -1
- package/modern/components/actions-control/components/download-button/download-button.js +3 -3
- package/modern/components/actions-control/components/download-button/download-button.js.map +1 -1
- package/modern/components/actions-control/components/restore-button/restore-button.js +3 -3
- package/modern/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/modern/components/actions-control/components/reupload-button/index.d.ts +2 -0
- package/modern/components/actions-control/components/reupload-button/index.js +18 -0
- package/modern/components/actions-control/components/reupload-button/index.js.map +1 -0
- package/modern/components/content/components/content-error/content-error.css +1 -1
- package/modern/components/content/components/content-error/content-error.js +3 -3
- package/modern/components/content/components/content-error/content-error.js.map +1 -1
- package/modern/components/content/components/content-error/content-error.module.css.js +1 -1
- package/modern/components/content/components/content-subtitle/content-subtitle.css +3 -3
- package/modern/components/content/components/content-subtitle/content-subtitle.js +4 -10
- package/modern/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/modern/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/modern/components/content/content.css +7 -7
- package/modern/components/content/content.js +3 -3
- package/modern/components/content/content.js.map +1 -1
- package/modern/components/content/content.module.css.js +1 -1
- package/modern/components/status-control/extension-icon/index.css +9 -5
- package/modern/components/status-control/extension-icon/index.js +9 -3
- package/modern/components/status-control/extension-icon/index.js.map +1 -1
- package/modern/components/status-control/extension-icon/index.module.css.js +1 -1
- package/modern/components/status-control/extension-icon/index.module.css.js.map +1 -1
- package/modern/components/status-control/index.css +8 -8
- package/modern/components/status-control/index.js +6 -6
- package/modern/components/status-control/index.js.map +1 -1
- package/modern/components/status-control/index.module.css.js +1 -1
- package/modern/context/file-upload-item-context.d.ts +5 -34
- package/modern/context/file-upload-item-context.js +4 -31
- package/modern/context/file-upload-item-context.js.map +1 -1
- package/modern/context/use-context-value.d.ts +6 -0
- package/modern/context/use-context-value.js +66 -0
- package/modern/context/use-context-value.js.map +1 -0
- package/modern/index.css +2 -2
- package/modern/index.module.css.js +1 -1
- package/modern/types/file-upload-item-props.d.ts +7 -0
- package/moderncssm/Component.d.ts +2 -2
- package/moderncssm/Component.js +5 -36
- package/moderncssm/Component.js.map +1 -1
- package/moderncssm/components/actions-control/actions.js +5 -8
- package/moderncssm/components/actions-control/actions.js.map +1 -1
- package/moderncssm/components/actions-control/components/delete-button/delete-button.js +3 -3
- package/moderncssm/components/actions-control/components/delete-button/delete-button.js.map +1 -1
- package/moderncssm/components/actions-control/components/download-button/download-button.js +3 -3
- package/moderncssm/components/actions-control/components/download-button/download-button.js.map +1 -1
- package/moderncssm/components/actions-control/components/restore-button/restore-button.js +3 -3
- package/moderncssm/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/moderncssm/components/actions-control/components/reupload-button/index.d.ts +2 -0
- package/moderncssm/components/actions-control/components/reupload-button/index.js +18 -0
- package/moderncssm/components/actions-control/components/reupload-button/index.js.map +1 -0
- package/moderncssm/components/content/components/content-error/content-error.js +3 -3
- package/moderncssm/components/content/components/content-error/content-error.js.map +1 -1
- package/moderncssm/components/content/components/content-subtitle/content-subtitle.js +4 -10
- package/moderncssm/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/moderncssm/components/content/content.js +3 -3
- package/moderncssm/components/content/content.js.map +1 -1
- package/moderncssm/components/status-control/extension-icon/index.js +9 -3
- package/moderncssm/components/status-control/extension-icon/index.js.map +1 -1
- package/moderncssm/components/status-control/extension-icon/index.module.css +4 -0
- package/moderncssm/components/status-control/index.js +6 -6
- package/moderncssm/components/status-control/index.js.map +1 -1
- package/moderncssm/context/file-upload-item-context.d.ts +5 -34
- package/moderncssm/context/file-upload-item-context.js +4 -31
- package/moderncssm/context/file-upload-item-context.js.map +1 -1
- package/moderncssm/context/use-context-value.d.ts +6 -0
- package/moderncssm/context/use-context-value.js +66 -0
- package/moderncssm/context/use-context-value.js.map +1 -0
- package/moderncssm/types/file-upload-item-props.d.ts +7 -0
- package/package.json +7 -7
- package/src/Component.tsx +7 -60
- package/src/components/actions-control/actions.tsx +7 -10
- package/src/components/actions-control/components/delete-button/delete-button.tsx +3 -3
- package/src/components/actions-control/components/download-button/download-button.tsx +3 -3
- package/src/components/actions-control/components/restore-button/restore-button.tsx +3 -3
- package/src/components/actions-control/components/reupload-button/index.tsx +29 -0
- package/src/components/content/components/content-error/content-error.tsx +3 -3
- package/src/components/content/components/content-subtitle/content-subtitle.tsx +4 -12
- package/src/components/content/content.tsx +3 -3
- package/src/components/status-control/extension-icon/index.module.css +4 -0
- package/src/components/status-control/extension-icon/index.tsx +13 -3
- package/src/components/status-control/index.tsx +7 -6
- package/src/context/file-upload-item-context.ts +36 -66
- package/src/context/use-context-value.ts +105 -0
- package/src/types/file-upload-item-props.ts +10 -0
- package/types/file-upload-item-props.d.ts +7 -0
package/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
2
|
import { type FileUploadItemProps } from './types/file-upload-item-props';
|
|
3
|
-
export declare const FileUploadItemComponent:
|
|
3
|
+
export declare const FileUploadItemComponent: FC<FileUploadItemProps>;
|
|
4
4
|
export declare const FileUploadItem: React.FC<FileUploadItemProps> & {
|
|
5
5
|
StatusControl: () => React.JSX.Element;
|
|
6
6
|
Content: () => React.JSX.Element;
|
package/Component.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var tslib = require('tslib');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var cn = require('classnames');
|
|
7
8
|
var actions = require('./components/actions-control/actions.js');
|
|
8
9
|
var content = require('./components/content/content.js');
|
|
9
10
|
var index = require('./components/status-control/index.js');
|
|
10
11
|
var fileUploadItemContext = require('./context/file-upload-item-context.js');
|
|
12
|
+
var useContextValue = require('./context/use-context-value.js');
|
|
11
13
|
var index_module = require('./index.module.css.js');
|
|
12
14
|
|
|
13
15
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -16,42 +18,10 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
16
18
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
17
19
|
|
|
18
20
|
var FileUploadItemComponent = function (_a) {
|
|
19
|
-
var className = _a.className, children = _a.children,
|
|
20
|
-
var
|
|
21
|
+
var className = _a.className, children = _a.children, dataTestId = _a.dataTestId, uploadStatus = _a.uploadStatus, rest = tslib.__rest(_a, ["className", "children", "dataTestId", "uploadStatus"]);
|
|
22
|
+
var contextValue = useContextValue.useContextValue(tslib.__assign({ uploadStatus: uploadStatus }, rest));
|
|
21
23
|
return (React__default.default.createElement("div", { className: cn__default.default(className, index_module.component, uploadStatus && index_module[uploadStatus.toLocaleLowerCase()]), "data-test-id": dataTestId },
|
|
22
|
-
React__default.default.createElement(fileUploadItemContext.FileUploadItemContext.Provider
|
|
23
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
24
|
-
, {
|
|
25
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
26
|
-
value: {
|
|
27
|
-
showRestore: showRestore,
|
|
28
|
-
uploadStatus: uploadStatus,
|
|
29
|
-
error: error,
|
|
30
|
-
title: title,
|
|
31
|
-
subtitle: subtitle,
|
|
32
|
-
uploadDate: uploadDate,
|
|
33
|
-
size: size,
|
|
34
|
-
id: id,
|
|
35
|
-
onDownload: onDownload,
|
|
36
|
-
onDelete: onDelete,
|
|
37
|
-
onRestore: onRestore,
|
|
38
|
-
downloadLink: downloadLink,
|
|
39
|
-
download: download,
|
|
40
|
-
disableButtons: disableButtons,
|
|
41
|
-
isClickable: isClickable,
|
|
42
|
-
target: target,
|
|
43
|
-
showDelete: showDelete,
|
|
44
|
-
customIcon: customIcon,
|
|
45
|
-
iconStyle: iconStyle,
|
|
46
|
-
progressBar: progressBar,
|
|
47
|
-
progressBarAvailable: progressBarAvailable,
|
|
48
|
-
customContent: customContent,
|
|
49
|
-
truncate: truncate,
|
|
50
|
-
imageUrl: imageUrl,
|
|
51
|
-
backgroundColor: backgroundColor,
|
|
52
|
-
actionsPresent: actionsPresent,
|
|
53
|
-
setActionsPresent: setActionsPresent,
|
|
54
|
-
} }, children)));
|
|
24
|
+
React__default.default.createElement(fileUploadItemContext.FileUploadItemContext.Provider, { value: contextValue }, children)));
|
|
55
25
|
};
|
|
56
26
|
var FileUploadItem = Object.assign(FileUploadItemComponent, {
|
|
57
27
|
StatusControl: index.StatusControl,
|
package/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["src/Component.tsx"],"sourcesContent":["import React, {
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["src/Component.tsx"],"sourcesContent":["import React, { type FC } from 'react';\nimport cn from 'classnames';\n\nimport { Actions } from './components/actions-control';\nimport { Content } from './components/content';\nimport { StatusControl } from './components/status-control';\nimport { FileUploadItemContext } from './context/file-upload-item-context';\nimport { useContextValue } from './context/use-context-value';\nimport { type FileUploadItemProps } from './types/file-upload-item-props';\n\nimport styles from './index.module.css';\n\nexport const FileUploadItemComponent: FC<FileUploadItemProps> = ({\n className,\n children,\n dataTestId,\n uploadStatus,\n ...rest\n}) => {\n const contextValue = useContextValue({ uploadStatus, ...rest });\n\n return (\n <div\n className={cn(\n className,\n styles.component,\n uploadStatus && styles[uploadStatus.toLocaleLowerCase()],\n )}\n data-test-id={dataTestId}\n >\n <FileUploadItemContext.Provider value={contextValue}>\n {children}\n </FileUploadItemContext.Provider>\n </div>\n );\n};\n\nexport const FileUploadItem = Object.assign(FileUploadItemComponent, {\n StatusControl,\n Content,\n Actions,\n});\n"],"names":["__rest","useContextValue","__assign","React","cn","styles","FileUploadItemContext","StatusControl","Content","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,IAAM,uBAAuB,GAA4B,UAAC,EAMhE,EAAA;AALG,IAAA,IAAA,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,QAAQ,cAAA,EACR,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,YAAY,GAAA,EAAA,CAAA,YAAA,EACT,IAAI,GAAAA,YAAA,CAAA,EAAA,EALsD,uDAMhE,CADU;IAEP,IAAM,YAAY,GAAGC,+BAAe,CAAAC,cAAA,CAAA,EAAG,YAAY,EAAA,YAAA,EAAA,EAAK,IAAI,CAAA,CAAG;IAE/D,QACIC,8CACI,SAAS,EAAEC,mBAAE,CACT,SAAS,EACTC,YAAM,CAAC,SAAS,EAChB,YAAY,IAAIA,YAAM,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC,CAC3D,EAAA,cAAA,EACa,UAAU,EAAA;AAExB,QAAAF,sBAAA,CAAA,aAAA,CAACG,2CAAqB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,EAC9C,QAAQ,CACoB,CAC/B;AAEd;IAEa,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE;AACjE,IAAA,aAAa,EAAAC,mBAAA;AACb,IAAA,OAAO,EAAAC,eAAA;AACP,IAAA,OAAO,EAAAC,eAAA;AACV,CAAA;;;;;"}
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
--color-light-text-tertiary: rgba(5, 8, 29, 0.38);
|
|
3
3
|
--color-light-text-tertiary-hover: rgba(4, 4, 21, 0.47);
|
|
4
4
|
}
|
|
5
|
-
.file-upload-
|
|
5
|
+
.file-upload-item__container_mxw8d {
|
|
6
6
|
display: flex;
|
|
7
7
|
max-width: 144px;
|
|
8
8
|
}
|
|
9
|
-
.file-upload-
|
|
9
|
+
.file-upload-item__container_mxw8d .file-upload-item__icon_mxw8d {
|
|
10
10
|
width: 48px;
|
|
11
11
|
height: 48px;
|
|
12
12
|
}
|
|
13
|
-
.file-upload-
|
|
13
|
+
.file-upload-item__deleteIconColor_mxw8d {
|
|
14
14
|
fill: var(--color-light-text-tertiary);
|
|
15
15
|
}
|
|
16
|
-
.file-upload-
|
|
16
|
+
.file-upload-item__deleteIconColor_mxw8d:hover {
|
|
17
17
|
fill: var(--color-light-text-tertiary-hover);
|
|
18
18
|
}
|
|
19
|
-
.file-upload-
|
|
19
|
+
.file-upload-item__downloadIconColor_mxw8d {
|
|
20
20
|
fill: var(--color-light-text-tertiary);
|
|
21
21
|
}
|
|
22
|
-
.file-upload-
|
|
22
|
+
.file-upload-item__downloadIconColor_mxw8d:hover {
|
|
23
23
|
fill: var(--color-light-text-tertiary-hover);
|
|
24
24
|
}
|
|
25
|
-
.file-upload-
|
|
25
|
+
.file-upload-item__restoreIconColor_mxw8d {
|
|
26
26
|
fill: var(--color-light-text-tertiary);
|
|
27
27
|
}
|
|
28
|
-
.file-upload-
|
|
28
|
+
.file-upload-item__restoreIconColor_mxw8d:hover {
|
|
29
29
|
fill: var(--color-light-text-tertiary-hover);
|
|
30
30
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./actions-control.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"container":"file-upload-
|
|
5
|
+
var styles = {"container":"file-upload-item__container_mxw8d","icon":"file-upload-item__icon_mxw8d","deleteIconColor":"file-upload-item__deleteIconColor_mxw8d","downloadIconColor":"file-upload-item__downloadIconColor_mxw8d","restoreIconColor":"file-upload-item__restoreIconColor_mxw8d"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=actions-control.module.css.js.map
|
|
@@ -7,6 +7,7 @@ var fileUploadItemContext = require('../../context/file-upload-item-context.js')
|
|
|
7
7
|
var deleteButton = require('./components/delete-button/delete-button.js');
|
|
8
8
|
var downloadButton = require('./components/download-button/download-button.js');
|
|
9
9
|
var restoreButton = require('./components/restore-button/restore-button.js');
|
|
10
|
+
var index = require('./components/reupload-button/index.js');
|
|
10
11
|
var actionsControl_module = require('./actions-control.module.css.js');
|
|
11
12
|
|
|
12
13
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -14,15 +15,11 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
15
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
16
|
|
|
16
17
|
var Actions = function () {
|
|
17
|
-
var _a =
|
|
18
|
-
React.useEffect(function () {
|
|
19
|
-
if (setActionsPresent) {
|
|
20
|
-
setActionsPresent(!!(showRestore || downloadLink || showDelete || onDownload));
|
|
21
|
-
}
|
|
22
|
-
}, [showRestore, downloadLink, showDelete, setActionsPresent, onDownload]);
|
|
18
|
+
var _a = fileUploadItemContext.useFileUploadItemContext(), showRestore = _a.showRestore, downloadLink = _a.downloadLink, showDelete = _a.showDelete, onDownload = _a.onDownload, reupload = _a.reupload;
|
|
23
19
|
return (React__default.default.createElement("div", { className: actionsControl_module.container },
|
|
24
20
|
showRestore && React__default.default.createElement(restoreButton.RestoreButton, null),
|
|
25
21
|
(downloadLink || onDownload) && !showRestore && React__default.default.createElement(downloadButton.DownloadButton, null),
|
|
22
|
+
reupload && React__default.default.createElement(index.ReuploadButton, null),
|
|
26
23
|
showDelete && !showRestore && React__default.default.createElement(deleteButton.DeleteButton, null)));
|
|
27
24
|
};
|
|
28
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sources":["../../src/components/actions-control/actions.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"actions.js","sources":["../../src/components/actions-control/actions.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useFileUploadItemContext } from '../../context/file-upload-item-context';\n\nimport { DeleteButton } from './components/delete-button';\nimport { DownloadButton } from './components/download-button';\nimport { RestoreButton } from './components/restore-button';\nimport { ReuploadButton } from './components/reupload-button';\n\nimport styles from './actions-control.module.css';\n\nexport const Actions = () => {\n const { showRestore, downloadLink, showDelete, onDownload, reupload } =\n useFileUploadItemContext();\n\n return (\n <div className={styles.container}>\n {showRestore && <RestoreButton />}\n\n {(downloadLink || onDownload) && !showRestore && <DownloadButton />}\n\n {reupload && <ReuploadButton />}\n\n {showDelete && !showRestore && <DeleteButton />}\n </div>\n );\n};\n"],"names":["useFileUploadItemContext","React","styles","RestoreButton","DownloadButton","ReuploadButton","DeleteButton"],"mappings":";;;;;;;;;;;;;;;;AAWa,IAAA,OAAO,GAAG,YAAA;AACb,IAAA,IAAA,KACFA,8CAAwB,EAAE,EADtB,WAAW,GAAA,EAAA,CAAA,WAAA,EAAE,YAAY,GAAA,EAAA,CAAA,YAAA,EAAE,UAAU,gBAAA,EAAE,UAAU,gBAAA,EAAE,QAAQ,cACrC;AAE9B,IAAA,QACIC,sBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEC,qBAAM,CAAC,SAAS,EAAA;QAC3B,WAAW,IAAID,sBAAC,CAAA,aAAA,CAAAE,2BAAa,EAAG,IAAA,CAAA;QAEhC,CAAC,YAAY,IAAI,UAAU,KAAK,CAAC,WAAW,IAAIF,sBAAC,CAAA,aAAA,CAAAG,6BAAc,EAAG,IAAA,CAAA;QAElE,QAAQ,IAAIH,sBAAC,CAAA,aAAA,CAAAI,oBAAc,EAAG,IAAA,CAAA;QAE9B,UAAU,IAAI,CAAC,WAAW,IAAIJ,qCAACK,yBAAY,EAAA,IAAA,CAAG,CAC7C;AAEd;;;;"}
|
|
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
14
14
|
var CrossMIcon__default = /*#__PURE__*/_interopDefaultCompat(CrossMIcon);
|
|
15
15
|
|
|
16
16
|
var DeleteButton = function () {
|
|
17
|
-
var _a =
|
|
17
|
+
var _a = fileUploadItemContext.useFileUploadItemContext(), _b = _a.id, id = _b === void 0 ? '0' : _b, disableButtons = _a.disableButtons, onDelete = _a.onDelete;
|
|
18
18
|
var handleDelete = function (e) {
|
|
19
19
|
if (onDelete) {
|
|
20
20
|
onDelete(id, e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-button.js","sources":["../../../../src/components/actions-control/components/delete-button/delete-button.tsx"],"sourcesContent":["import React, { type MouseEvent
|
|
1
|
+
{"version":3,"file":"delete-button.js","sources":["../../../../src/components/actions-control/components/delete-button/delete-button.tsx"],"sourcesContent":["import React, { type MouseEvent } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport CrossMIcon from '@alfalab/icons-glyph/CrossMIcon';\n\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const DeleteButton = () => {\n const { id = '0', disableButtons, onDelete } = useFileUploadItemContext();\n\n const handleDelete = (e: MouseEvent<HTMLElement>) => {\n if (onDelete) {\n onDelete(id, e);\n }\n };\n\n return (\n <IconButton\n className={styles.icon}\n size={24}\n aria-label='удалить'\n icon={<CrossMIcon className={styles.deleteIconColor} />}\n disabled={disableButtons}\n onClick={handleDelete}\n />\n );\n};\n"],"names":["useFileUploadItemContext","React","IconButton","styles","CrossMIcon"],"mappings":";;;;;;;;;;;;;;;AASa,IAAA,YAAY,GAAG,YAAA;AAClB,IAAA,IAAA,KAAyCA,8CAAwB,EAAE,EAAjE,EAAA,GAAA,EAAA,CAAA,EAAQ,EAAR,EAAE,GAAA,EAAA,KAAA,MAAA,GAAG,GAAG,GAAA,EAAA,EAAE,cAAc,GAAA,EAAA,CAAA,cAAA,EAAE,QAAQ,cAA+B;IAEzE,IAAM,YAAY,GAAG,UAAC,CAA0B,EAAA;QAC5C,IAAI,QAAQ,EAAE;AACV,YAAA,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;;AAEvB,KAAC;AAED,IAAA,QACIC,sBAAC,CAAA,aAAA,CAAAC,mCAAU,EACP,EAAA,SAAS,EAAEC,qBAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EACG,YAAA,EAAA,4CAAS,EACpB,IAAI,EAAEF,sBAAC,CAAA,aAAA,CAAAG,2BAAU,IAAC,SAAS,EAAED,qBAAM,CAAC,eAAe,EAAI,CAAA,EACvD,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EAAA,CACvB;AAEV;;;;"}
|
|
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
14
14
|
var ArrowDownLineDownCompactMIcon__default = /*#__PURE__*/_interopDefaultCompat(ArrowDownLineDownCompactMIcon);
|
|
15
15
|
|
|
16
16
|
var DownloadButton = function () {
|
|
17
|
-
var _a =
|
|
17
|
+
var _a = fileUploadItemContext.useFileUploadItemContext(), _b = _a.id, id = _b === void 0 ? '0' : _b, downloadLink = _a.downloadLink, download = _a.download, disableButtons = _a.disableButtons, target = _a.target, onDownload = _a.onDownload;
|
|
18
18
|
var handleDownload = function (e) {
|
|
19
19
|
if (onDownload) {
|
|
20
20
|
e.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-button.js","sources":["../../../../src/components/actions-control/components/download-button/download-button.tsx"],"sourcesContent":["import React, { type MouseEvent
|
|
1
|
+
{"version":3,"file":"download-button.js","sources":["../../../../src/components/actions-control/components/download-button/download-button.tsx"],"sourcesContent":["import React, { type MouseEvent } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowDownLineDownCompactMIcon from '@alfalab/icons-glyph/ArrowDownLineDownCompactMIcon';\n\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const DownloadButton = () => {\n const {\n id = '0',\n downloadLink,\n download,\n disableButtons,\n target,\n onDownload,\n } = useFileUploadItemContext();\n\n const handleDownload = (e: MouseEvent<HTMLElement>) => {\n if (onDownload) {\n e.preventDefault();\n onDownload(id);\n }\n };\n\n return (\n <IconButton\n className={styles.icon}\n size={24}\n aria-label='скачать'\n icon={<ArrowDownLineDownCompactMIcon className={styles.downloadIconColor} />}\n disabled={disableButtons}\n href={downloadLink}\n download={download}\n target={target}\n onClick={handleDownload}\n />\n );\n};\n"],"names":["useFileUploadItemContext","React","IconButton","styles","ArrowDownLineDownCompactMIcon"],"mappings":";;;;;;;;;;;;;;;AASa,IAAA,cAAc,GAAG,YAAA;IACpB,IAAA,EAAA,GAOFA,8CAAwB,EAAE,EAN1B,EAAA,GAAA,EAAA,CAAA,EAAQ,EAAR,EAAE,GAAA,EAAA,KAAA,MAAA,GAAG,GAAG,GAAA,EAAA,EACR,YAAY,kBAAA,EACZ,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,UAAU,GAAA,EAAA,CAAA,UACgB;IAE9B,IAAM,cAAc,GAAG,UAAC,CAA0B,EAAA;QAC9C,IAAI,UAAU,EAAE;YACZ,CAAC,CAAC,cAAc,EAAE;YAClB,UAAU,CAAC,EAAE,CAAC;;AAEtB,KAAC;IAED,QACIC,qCAACC,mCAAU,EAAA,EACP,SAAS,EAAEC,qBAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EAAA,YAAA,EACG,4CAAS,EACpB,IAAI,EAAEF,sBAAC,CAAA,aAAA,CAAAG,8CAA6B,EAAC,EAAA,SAAS,EAAED,qBAAM,CAAC,iBAAiB,EAAA,CAAI,EAC5E,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,EACzB,CAAA;AAEV;;;;"}
|
|
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
14
14
|
var ArrowsCwCompactMIcon__default = /*#__PURE__*/_interopDefaultCompat(ArrowsCwCompactMIcon);
|
|
15
15
|
|
|
16
16
|
var RestoreButton = function () {
|
|
17
|
-
var _a =
|
|
17
|
+
var _a = fileUploadItemContext.useFileUploadItemContext(), _b = _a.id, id = _b === void 0 ? '0' : _b, disableButtons = _a.disableButtons, onRestore = _a.onRestore;
|
|
18
18
|
var handleRestore = function () {
|
|
19
19
|
if (onRestore) {
|
|
20
20
|
onRestore(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore-button.js","sources":["../../../../src/components/actions-control/components/restore-button/restore-button.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"restore-button.js","sources":["../../../../src/components/actions-control/components/restore-button/restore-button.tsx"],"sourcesContent":["import React from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowsCwCompactMIcon from '@alfalab/icons-glyph/ArrowsCwCompactMIcon';\n\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const RestoreButton = () => {\n const { id = '0', disableButtons, onRestore } = useFileUploadItemContext();\n\n const handleRestore = () => {\n if (onRestore) {\n onRestore(id);\n }\n };\n\n return (\n <IconButton\n className={styles.icon}\n size={24}\n aria-label='восстановить'\n icon={<ArrowsCwCompactMIcon className={styles.restoreIconColor} />}\n disabled={disableButtons}\n onClick={handleRestore}\n />\n );\n};\n"],"names":["useFileUploadItemContext","React","IconButton","styles","ArrowsCwCompactMIcon"],"mappings":";;;;;;;;;;;;;;;AASa,IAAA,aAAa,GAAG,YAAA;AACnB,IAAA,IAAA,KAA0CA,8CAAwB,EAAE,EAAlE,EAAA,GAAA,EAAA,CAAA,EAAQ,EAAR,EAAE,GAAA,EAAA,KAAA,MAAA,GAAG,GAAG,GAAA,EAAA,EAAE,cAAc,GAAA,EAAA,CAAA,cAAA,EAAE,SAAS,eAA+B;AAE1E,IAAA,IAAM,aAAa,GAAG,YAAA;QAClB,IAAI,SAAS,EAAE;YACX,SAAS,CAAC,EAAE,CAAC;;AAErB,KAAC;AAED,IAAA,QACIC,sBAAC,CAAA,aAAA,CAAAC,mCAAU,EACP,EAAA,SAAS,EAAEC,qBAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EACG,YAAA,EAAA,0EAAc,EACzB,IAAI,EAAEF,sBAAC,CAAA,aAAA,CAAAG,qCAAoB,IAAC,SAAS,EAAED,qBAAM,CAAC,gBAAgB,EAAI,CAAA,EAClE,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,aAAa,EAAA,CACxB;AAEV;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var coreComponentsIconButton = require('@alfalab/core-components-icon-button');
|
|
7
|
+
var ArrowsCwCompactMIcon = require('@alfalab/icons-glyph/ArrowsCwCompactMIcon');
|
|
8
|
+
var fileUploadItemContext = require('../../../../context/file-upload-item-context.js');
|
|
9
|
+
var actionsControl_module = require('../../actions-control.module.css.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
var ArrowsCwCompactMIcon__default = /*#__PURE__*/_interopDefaultCompat(ArrowsCwCompactMIcon);
|
|
15
|
+
|
|
16
|
+
var ReuploadButton = function () {
|
|
17
|
+
var _a = fileUploadItemContext.useFileUploadItemContext(), _b = _a.id, id = _b === void 0 ? '0' : _b, disableButtons = _a.disableButtons, reupload = _a.reupload;
|
|
18
|
+
var handleClick = function () {
|
|
19
|
+
var _a;
|
|
20
|
+
if (typeof reupload === 'object') {
|
|
21
|
+
(_a = reupload.onClick) === null || _a === void 0 ? void 0 : _a.call(reupload, id);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return (React__default.default.createElement(coreComponentsIconButton.IconButton, { className: actionsControl_module.icon, size: 24, "aria-label": '\u041F\u043E\u0432\u0442\u043E\u0440\u043D\u0430\u044F \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430', icon: React__default.default.createElement(ArrowsCwCompactMIcon__default.default, { className: actionsControl_module.restoreIconColor }), disabled: disableButtons, onClick: handleClick }));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.ReuploadButton = ReuploadButton;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/actions-control/components/reupload-button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowsCwCompactMIcon from '@alfalab/icons-glyph/ArrowsCwCompactMIcon';\n\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const ReuploadButton = () => {\n const { id = '0', disableButtons, reupload } = useFileUploadItemContext();\n\n const handleClick = () => {\n if (typeof reupload === 'object') {\n reupload.onClick?.(id);\n }\n };\n\n return (\n <IconButton\n className={styles.icon}\n size={24}\n aria-label='Повторная загрузка'\n icon={<ArrowsCwCompactMIcon className={styles.restoreIconColor} />}\n disabled={disableButtons}\n onClick={handleClick}\n />\n );\n};\n"],"names":["useFileUploadItemContext","React","IconButton","styles","ArrowsCwCompactMIcon"],"mappings":";;;;;;;;;;;;;;;AASa,IAAA,cAAc,GAAG,YAAA;AACpB,IAAA,IAAA,KAAyCA,8CAAwB,EAAE,EAAjE,EAAA,GAAA,EAAA,CAAA,EAAQ,EAAR,EAAE,GAAA,EAAA,KAAA,MAAA,GAAG,GAAG,GAAA,EAAA,EAAE,cAAc,GAAA,EAAA,CAAA,cAAA,EAAE,QAAQ,cAA+B;AAEzE,IAAA,IAAM,WAAW,GAAG,YAAA;;AAChB,QAAA,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAC9B,YAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAG,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,CAAA,QAAA,EAAA,EAAE,CAAC;;AAE9B,KAAC;AAED,IAAA,QACIC,sBAAC,CAAA,aAAA,CAAAC,mCAAU,EACP,EAAA,SAAS,EAAEC,qBAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EACG,YAAA,EAAA,yGAAoB,EAC/B,IAAI,EAAEF,sBAAC,CAAA,aAAA,CAAAG,qCAAoB,IAAC,SAAS,EAAED,qBAAM,CAAC,gBAAgB,EAAI,CAAA,EAClE,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,WAAW,EAAA,CACtB;AAEV;;;;"}
|
|
@@ -12,7 +12,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
13
|
|
|
14
14
|
var ContentError = function () {
|
|
15
|
-
var error =
|
|
15
|
+
var error = fileUploadItemContext.useFileUploadItemContext().error;
|
|
16
16
|
if (typeof error === 'string' && error.length > 0) {
|
|
17
17
|
return (React__default.default.createElement(coreComponentsTypography.TypographyText, { className: contentError_module.errorItem, view: 'primary-small', color: 'negative' }, error));
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-error.js","sources":["../../../../src/components/content/components/content-error/content-error.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"content-error.js","sources":["../../../../src/components/content/components/content-error/content-error.tsx"],"sourcesContent":["import React from 'react';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from './content-error.module.css';\n\nexport const ContentError = () => {\n const { error } = useFileUploadItemContext();\n\n if (typeof error === 'string' && error.length > 0) {\n return (\n <TypographyText className={styles.errorItem} view='primary-small' color='negative'>\n {error}\n </TypographyText>\n );\n }\n\n if (Array.isArray(error) && error.length > 0) {\n return (\n <div>\n {error.map((item) => (\n <TypographyText\n key={item}\n className={styles.errorItem}\n view='primary-small'\n color='negative'\n >\n {item}\n </TypographyText>\n ))}\n </div>\n );\n }\n\n return (\n <TypographyText className={styles.errorItem} view='primary-small' color='negative'>\n Не удалось загрузить файл\n </TypographyText>\n );\n};\n"],"names":["useFileUploadItemContext","React","TypographyText","styles"],"mappings":";;;;;;;;;;;;;AAQa,IAAA,YAAY,GAAG,YAAA;AAChB,IAAA,IAAA,KAAK,GAAKA,8CAAwB,EAAE,MAA/B;IAEb,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,QACIC,qCAACC,uCAAc,EAAA,EAAC,SAAS,EAAEC,mBAAM,CAAC,SAAS,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAC7E,EAAA,KAAK,CACO;;AAIzB,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1C,QAAA,QACIF,sBACK,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAA,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAA,EAAK,QACjBA,qCAACC,uCAAc,EAAA,EACX,GAAG,EAAE,IAAI,EACT,SAAS,EAAEC,mBAAM,CAAC,SAAS,EAC3B,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,UAAU,EAEf,EAAA,IAAI,CACQ,EACpB,EAAA,CAAC,CACA;;AAId,IAAA,QACIF,sBAAC,CAAA,aAAA,CAAAC,uCAAc,IAAC,SAAS,EAAEC,mBAAM,CAAC,SAAS,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,yIAAA,CAEjE;AAEzB;;;;"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
--gap-xs: 8px;
|
|
3
3
|
--gap-8: var(--gap-xs);
|
|
4
4
|
}
|
|
5
|
-
.file-upload-
|
|
5
|
+
.file-upload-item__subtitle_5sknh {
|
|
6
6
|
display: block;
|
|
7
7
|
}
|
|
8
|
-
.file-upload-
|
|
8
|
+
.file-upload-item__subtitle_5sknh.file-upload-item__truncate_5sknh {
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
text-overflow: ellipsis;
|
|
12
12
|
}
|
|
13
|
-
.file-upload-
|
|
13
|
+
.file-upload-item__size_5sknh {
|
|
14
14
|
margin-right: var(--gap-8);
|
|
15
15
|
}
|
|
@@ -20,17 +20,11 @@ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
|
20
20
|
|
|
21
21
|
var ContentSubtitle = function () {
|
|
22
22
|
var _a;
|
|
23
|
-
var _b =
|
|
23
|
+
var _b = fileUploadItemContext.useFileUploadItemContext(), uploadStatus = _b.uploadStatus, subtitle = _b.subtitle, uploadDate = _b.uploadDate, size = _b.size, truncate = _b.truncate, showRestore = _b.showRestore, error = _b.error, progressBar$1 = _b.progressBar;
|
|
24
24
|
var shouldShownError = utils.isErrorStatus(uploadStatus) || isError.isError(error);
|
|
25
25
|
var showMeta = !showRestore && (utils.isSuccessStatus(uploadStatus) || utils.isUploadedStatus(uploadStatus));
|
|
26
26
|
// валидация progressBar (не должен превышать 100 и быть меньше 0)
|
|
27
|
-
var
|
|
28
|
-
if (progressValue === undefined) {
|
|
29
|
-
return 0;
|
|
30
|
-
}
|
|
31
|
-
return Math.min(Math.max(progressValue, 0), progressBar.MAX_PROGRESS_BAR_VALUE);
|
|
32
|
-
};
|
|
33
|
-
var validProgressBar = validateProgressBarValue(progressBar$1);
|
|
27
|
+
var validProgressBar = Math.min(Math.max(progressBar$1 !== null && progressBar$1 !== void 0 ? progressBar$1 : 0, 0), progressBar.MAX_PROGRESS_BAR_VALUE);
|
|
34
28
|
// uploading status
|
|
35
29
|
if (utils.isUploadingStatus(uploadStatus)) {
|
|
36
30
|
return (React__default.default.createElement(coreComponentsTypography.TypographyText, { view: 'primary-small', color: 'secondary' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-subtitle.js","sources":["../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"content-subtitle.js","sources":["../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { humanFileSize } from '@alfalab/core-components-shared';\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { MAX_PROGRESS_BAR_VALUE } from '../../../../const/progress-bar';\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\nimport {\n isErrorStatus,\n isSuccessStatus,\n isUploadedStatus,\n isUploadingStatus,\n} from '../../../../utils';\nimport { isError } from '../../utils/isError';\nimport { ContentError } from '../content-error';\n\nimport styles from './content-subtitle.module.css';\n\nexport const ContentSubtitle = () => {\n const { uploadStatus, subtitle, uploadDate, size, truncate, showRestore, error, progressBar } =\n useFileUploadItemContext();\n\n const shouldShownError = isErrorStatus(uploadStatus) || isError(error);\n const showMeta =\n !showRestore && (isSuccessStatus(uploadStatus) || isUploadedStatus(uploadStatus));\n\n // валидация progressBar (не должен превышать 100 и быть меньше 0)\n const validProgressBar = Math.min(Math.max(progressBar ?? 0, 0), MAX_PROGRESS_BAR_VALUE);\n\n // uploading status\n if (isUploadingStatus(uploadStatus)) {\n return (\n <TypographyText view='primary-small' color='secondary'>\n Загружено{'\\u00A0'}\n {Math.floor(validProgressBar)}%\n </TypographyText>\n );\n }\n\n // error status\n if (shouldShownError) {\n return <ContentError />;\n }\n\n // success status\n if (showMeta) {\n return (\n <div>\n {size && (\n <TypographyText className={styles.size} view='primary-small' color='secondary'>\n {humanFileSize(size)}\n </TypographyText>\n )}\n {uploadDate && (\n <TypographyText view='primary-small' color='secondary'>\n {uploadDate}\n </TypographyText>\n )}\n </div>\n );\n }\n\n // restore status\n if (showRestore) {\n return (\n <TypographyText view='primary-small' color='tertiary'>\n Файл удален\n </TypographyText>\n );\n }\n\n return (\n <TypographyText\n className={cn(styles.subtitle, {\n [styles.truncate]: truncate,\n })}\n view='primary-small'\n color='secondary'\n >\n {subtitle}\n </TypographyText>\n );\n};\n"],"names":["useFileUploadItemContext","progressBar","isErrorStatus","isError","isSuccessStatus","isUploadedStatus","MAX_PROGRESS_BAR_VALUE","isUploadingStatus","React","TypographyText","ContentError","styles","humanFileSize","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBa,IAAA,eAAe,GAAG,YAAA;;IACrB,IAAA,EAAA,GACFA,8CAAwB,EAAE,EADtB,YAAY,GAAA,EAAA,CAAA,YAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,UAAU,GAAA,EAAA,CAAA,UAAA,EAAE,IAAI,GAAA,EAAA,CAAA,IAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,WAAW,GAAA,EAAA,CAAA,WAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,EAAEC,aAAW,GAAA,EAAA,CAAA,WAC7D;IAE9B,IAAM,gBAAgB,GAAGC,mBAAa,CAAC,YAAY,CAAC,IAAIC,eAAO,CAAC,KAAK,CAAC;AACtE,IAAA,IAAM,QAAQ,GACV,CAAC,WAAW,KAAKC,qBAAe,CAAC,YAAY,CAAC,IAAIC,sBAAgB,CAAC,YAAY,CAAC,CAAC;;IAGrF,IAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAACJ,aAAW,aAAXA,aAAW,KAAA,MAAA,GAAXA,aAAW,GAAI,CAAC,EAAE,CAAC,CAAC,EAAEK,kCAAsB,CAAC;;AAGxF,IAAA,IAAIC,uBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACIC,sBAAC,CAAA,aAAA,CAAAC,uCAAc,EAAC,EAAA,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA;;YACxC,QAAQ;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;AAChB,YAAA,GAAA,CAAA;;;IAKzB,IAAI,gBAAgB,EAAE;QAClB,OAAOD,sBAAA,CAAA,aAAA,CAACE,yBAAY,EAAA,IAAA,CAAG;;;IAI3B,IAAI,QAAQ,EAAE;AACV,QAAA,QACIF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YACK,IAAI,KACDA,sBAAA,CAAA,aAAA,CAACC,uCAAc,EAAA,EAAC,SAAS,EAAEE,sBAAM,CAAC,IAAI,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA,EACzEC,kCAAa,CAAC,IAAI,CAAC,CACP,CACpB;AACA,YAAA,UAAU,KACPJ,sBAAA,CAAA,aAAA,CAACC,uCAAc,EAAC,EAAA,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EACjD,EAAA,UAAU,CACE,CACpB,CACC;;;IAKd,IAAI,WAAW,EAAE;AACb,QAAA,QACID,sBAAA,CAAA,aAAA,CAACC,uCAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,+DAAA,CAEpC;;IAIzB,QACID,sBAAC,CAAA,aAAA,CAAAC,uCAAc,EACX,EAAA,SAAS,EAAEI,mBAAE,CAACF,sBAAM,CAAC,QAAQ,GAAA,EAAA,GAAA,EAAA;AACzB,YAAA,EAAA,CAACA,sBAAM,CAAC,QAAQ,CAAA,GAAG,QAAQ;gBAC7B,EACF,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,WAAW,EAEhB,EAAA,QAAQ,CACI;AAEzB;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./content-subtitle.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"subtitle":"file-upload-
|
|
5
|
+
var styles = {"subtitle":"file-upload-item__subtitle_5sknh","truncate":"file-upload-item__truncate_5sknh","size":"file-upload-item__size_5sknh"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=content-subtitle.module.css.js.map
|
|
@@ -9,34 +9,34 @@
|
|
|
9
9
|
--gap-4: var(--gap-2xs);
|
|
10
10
|
--gap-16: var(--gap-m);
|
|
11
11
|
}
|
|
12
|
-
.file-upload-
|
|
12
|
+
.file-upload-item__container_pwc95 {
|
|
13
13
|
padding: var(--gap-2) 0 0 var(--gap-16);
|
|
14
14
|
flex-grow: 1;
|
|
15
15
|
min-width: 0;
|
|
16
16
|
}
|
|
17
|
-
.file-upload-
|
|
17
|
+
.file-upload-item__container_pwc95.file-upload-item__clickable_pwc95 {
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
}
|
|
20
|
-
.file-upload-
|
|
20
|
+
.file-upload-item__container_pwc95.file-upload-item__single_pwc95 {
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
justify-content: center;
|
|
24
24
|
padding-top: 0;
|
|
25
25
|
min-height: 48px;
|
|
26
26
|
}
|
|
27
|
-
.file-upload-
|
|
27
|
+
.file-upload-item__container_pwc95.file-upload-item__single_pwc95 .file-upload-item__title_pwc95 {
|
|
28
28
|
margin-bottom: 0;
|
|
29
29
|
}
|
|
30
|
-
.file-upload-
|
|
30
|
+
.file-upload-item__container_pwc95 .file-upload-item__title_pwc95 {
|
|
31
31
|
margin-bottom: var(--gap-4);
|
|
32
32
|
display: block;
|
|
33
33
|
overflow-wrap: break-word;
|
|
34
34
|
}
|
|
35
|
-
.file-upload-
|
|
35
|
+
.file-upload-item__container_pwc95 .file-upload-item__title_pwc95.file-upload-item__truncate_pwc95 {
|
|
36
36
|
white-space: nowrap;
|
|
37
37
|
overflow: hidden;
|
|
38
38
|
text-overflow: ellipsis;
|
|
39
39
|
}
|
|
40
|
-
.file-upload-
|
|
40
|
+
.file-upload-item__container_pwc95 .file-upload-item__title_pwc95.file-upload-item__restore_pwc95 {
|
|
41
41
|
color: var(--color-light-text-tertiary);
|
|
42
42
|
}
|
|
@@ -16,7 +16,7 @@ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
|
16
16
|
|
|
17
17
|
var Content = function () {
|
|
18
18
|
var _a, _b;
|
|
19
|
-
var _c =
|
|
19
|
+
var _c = fileUploadItemContext.useFileUploadItemContext(), title = _c.title, CustomContent = _c.customContent, truncate = _c.truncate, subtitle = _c.subtitle, showRestore = _c.showRestore, actionsPresent = _c.actionsPresent, isClickable = _c.isClickable;
|
|
20
20
|
if (CustomContent) {
|
|
21
21
|
return React__default.default.createElement(CustomContent, null);
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../src/components/content/content.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../src/components/content/content.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { useFileUploadItemContext } from '../../context/file-upload-item-context';\n\nimport { ContentSubtitle } from './components/content-subtitle/content-subtitle';\n\nimport styles from './content.module.css';\n\nexport const Content = () => {\n const {\n title,\n customContent: CustomContent,\n truncate,\n subtitle,\n showRestore,\n actionsPresent,\n isClickable,\n } = useFileUploadItemContext();\n\n if (CustomContent) {\n return <CustomContent />;\n }\n\n return (\n <div\n className={cn(styles.container, {\n [styles.single]: !subtitle,\n [styles.clickable]: !actionsPresent && isClickable,\n })}\n >\n {title && (\n <TypographyText\n className={cn(styles.title, {\n [styles.truncate]: truncate,\n [styles.restore]: showRestore,\n })}\n view='component-primary'\n color='primary'\n >\n {title}\n </TypographyText>\n )}\n <ContentSubtitle />\n </div>\n );\n};\n"],"names":["useFileUploadItemContext","React","cn","styles","TypographyText","ContentSubtitle"],"mappings":";;;;;;;;;;;;;;;;AAWa,IAAA,OAAO,GAAG,YAAA;;IACb,IAAA,EAAA,GAQFA,8CAAwB,EAAE,EAP1B,KAAK,WAAA,EACU,aAAa,GAAA,EAAA,CAAA,aAAA,EAC5B,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,WAAW,GAAA,EAAA,CAAA,WACe;IAE9B,IAAI,aAAa,EAAE;QACf,OAAOC,sBAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG;;IAG5B,QACIA,8CACI,SAAS,EAAEC,mBAAE,CAACC,cAAM,CAAC,SAAS,GAAA,EAAA,GAAA,EAAA;AAC1B,YAAA,EAAA,CAACA,cAAM,CAAC,MAAM,CAAA,GAAG,CAAC,QAAQ;AAC1B,YAAA,EAAA,CAACA,cAAM,CAAC,SAAS,IAAG,CAAC,cAAc,IAAI,WAAW;AACpD,YAAA,EAAA,EAAA,EAAA;QAED,KAAK,KACFF,sBAAA,CAAA,aAAA,CAACG,uCAAc,EAAA,EACX,SAAS,EAAEF,mBAAE,CAACC,cAAM,CAAC,KAAK,GAAA,EAAA,GAAA,EAAA;AACtB,gBAAA,EAAA,CAACA,cAAM,CAAC,QAAQ,CAAA,GAAG,QAAQ;AAC3B,gBAAA,EAAA,CAACA,cAAM,CAAC,OAAO,CAAA,GAAG,WAAW;oBAC/B,EACF,IAAI,EAAC,mBAAmB,EACxB,KAAK,EAAC,SAAS,EAAA,EAEd,KAAK,CACO,CACpB;AACD,QAAAF,sBAAA,CAAA,aAAA,CAACI,+BAAe,EAAA,IAAA,CAAG,CACjB;AAEd;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./content.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"container":"file-upload-
|
|
5
|
+
var styles = {"container":"file-upload-item__container_pwc95","clickable":"file-upload-item__clickable_pwc95","single":"file-upload-item__single_pwc95","title":"file-upload-item__title_pwc95","truncate":"file-upload-item__truncate_pwc95","restore":"file-upload-item__restore_pwc95"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=content.module.css.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-light-neutral-translucent-1300: rgba(3, 3, 6, 0.88);
|
|
3
|
+
--color-light-status-attention: #fa9313;
|
|
3
4
|
}
|
|
4
5
|
:root {
|
|
5
6
|
--color-light-decorative-blue: #3193fc;
|
|
@@ -7,18 +8,21 @@
|
|
|
7
8
|
--color-light-decorative-orange: #fa9313;
|
|
8
9
|
--color-light-decorative-red: #fe5e48;
|
|
9
10
|
}
|
|
10
|
-
.file-upload-
|
|
11
|
+
.file-upload-item__iconPDFColored_1oy63 {
|
|
11
12
|
fill: var(--color-light-decorative-red);
|
|
12
13
|
}
|
|
13
|
-
.file-upload-
|
|
14
|
+
.file-upload-item__iconDOCColored_1oy63 {
|
|
14
15
|
fill: var(--color-light-decorative-blue);
|
|
15
16
|
}
|
|
16
|
-
.file-upload-
|
|
17
|
+
.file-upload-item__iconExcelColored_1oy63 {
|
|
17
18
|
fill: var(--color-light-decorative-green);
|
|
18
19
|
}
|
|
19
|
-
.file-upload-
|
|
20
|
+
.file-upload-item__icon1CColored_1oy63 {
|
|
20
21
|
fill: var(--color-light-decorative-orange);
|
|
21
22
|
}
|
|
22
|
-
.file-upload-
|
|
23
|
+
.file-upload-item__iconDocumentColored_1oy63 {
|
|
23
24
|
fill: var(--color-light-neutral-translucent-1300);
|
|
24
25
|
}
|
|
26
|
+
.file-upload-item__iconArchiveColored_1oy63 {
|
|
27
|
+
fill: var(--color-light-status-attention);
|
|
28
|
+
}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var cn = require('classnames');
|
|
7
7
|
var Document1CMIcon = require('@alfalab/icons-glyph/Document1CMIcon');
|
|
8
|
+
var DocumentArchiveMIcon = require('@alfalab/icons-glyph/DocumentArchiveMIcon');
|
|
8
9
|
var DocumentDocMIcon = require('@alfalab/icons-glyph/DocumentDocMIcon');
|
|
9
10
|
var DocumentExcelMIcon = require('@alfalab/icons-glyph/DocumentExcelMIcon');
|
|
10
11
|
var DocumentImageMIcon = require('@alfalab/icons-glyph/DocumentImageMIcon');
|
|
@@ -21,9 +22,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
21
22
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
22
23
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
23
24
|
|
|
25
|
+
// eslint-disable-next-line complexity
|
|
24
26
|
var ExtensionIcon = function () {
|
|
25
|
-
var _a, _b, _c, _d, _e;
|
|
26
|
-
var
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
28
|
+
var _g = fileUploadItemContext.useFileUploadItemContext(), _h = _g.title, title = _h === void 0 ? '' : _h, uploadStatus = _g.uploadStatus, iconStyle = _g.iconStyle, CustomIcon = _g.customIcon, imageUrl = _g.imageUrl, showRestore = _g.showRestore;
|
|
27
29
|
if (imageUrl) {
|
|
28
30
|
return null;
|
|
29
31
|
}
|
|
@@ -58,8 +60,12 @@ var ExtensionIcon = function () {
|
|
|
58
60
|
case 'tif':
|
|
59
61
|
case 'tiff':
|
|
60
62
|
return React__default.default.createElement(DocumentImageMIcon.DocumentImageMIcon, null);
|
|
63
|
+
case 'zip':
|
|
64
|
+
case 'rar':
|
|
65
|
+
case '7z':
|
|
66
|
+
return (React__default.default.createElement(DocumentArchiveMIcon.DocumentArchiveMIcon, { className: cn__default.default((_e = {}, _e[index_module.iconArchiveColored] = isColoredIcon, _e)) }));
|
|
61
67
|
default:
|
|
62
|
-
return (React__default.default.createElement(DocumentMIcon.DocumentMIcon, { className: cn__default.default((
|
|
68
|
+
return (React__default.default.createElement(DocumentMIcon.DocumentMIcon, { className: cn__default.default((_f = {}, _f[index_module.iconDocumentColored] = isColoredIcon, _f)) }));
|
|
63
69
|
}
|
|
64
70
|
};
|
|
65
71
|
|