@alfalab/core-components-file-upload-item 8.0.3 → 8.0.4
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/components/actions-control/actions-control.css +8 -8
- package/components/actions-control/actions-control.module.css.js +1 -1
- package/components/actions-control/actions-control.module.css.js.map +1 -1
- package/components/actions-control/actions.js.map +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.map +1 -1
- package/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/components/content/components/content-error/content-error.css +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.map +1 -1
- package/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/components/content/components/content-subtitle/content-subtitle.module.css.js.map +1 -1
- package/components/content/content.css +7 -7
- package/components/content/content.js.map +1 -1
- package/components/content/content.module.css.js +1 -1
- package/components/content/content.module.css.js.map +1 -1
- package/components/content/utils/isError.js.map +1 -1
- package/components/status-control/extension-icon/index.css +5 -5
- 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.module.css.js +1 -1
- package/components/status-control/index.module.css.js.map +1 -1
- package/context/file-upload-item-context.d.ts +1 -1
- package/cssm/components/actions-control/actions.js.map +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.map +1 -1
- package/cssm/components/actions-control/components/restore-button/restore-button.js.map +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.map +1 -1
- package/cssm/components/content/content.js.map +1 -1
- package/cssm/components/content/utils/isError.js.map +1 -1
- package/cssm/components/status-control/extension-icon/index.js.map +1 -1
- package/cssm/context/file-upload-item-context.d.ts +1 -1
- package/cssm/types/status.d.ts +1 -1
- package/cssm/utils.d.ts +6 -6
- 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-control.module.css.js.map +1 -1
- package/esm/components/actions-control/actions.js.map +1 -1
- 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.map +1 -1
- package/esm/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/esm/components/content/components/content-error/content-error.css +1 -1
- 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.map +1 -1
- package/esm/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/esm/components/content/components/content-subtitle/content-subtitle.module.css.js.map +1 -1
- package/esm/components/content/content.css +7 -7
- package/esm/components/content/content.js.map +1 -1
- package/esm/components/content/content.module.css.js +1 -1
- package/esm/components/content/content.module.css.js.map +1 -1
- package/esm/components/content/utils/isError.js.map +1 -1
- package/esm/components/status-control/extension-icon/index.css +5 -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.module.css.js +1 -1
- package/esm/components/status-control/index.module.css.js.map +1 -1
- package/esm/context/file-upload-item-context.d.ts +1 -1
- package/esm/index.css +2 -2
- package/esm/index.module.css.js +1 -1
- package/esm/index.module.css.js.map +1 -1
- package/esm/types/status.d.ts +1 -1
- package/esm/utils.d.ts +6 -6
- package/index.css +2 -2
- package/index.module.css.js +1 -1
- package/index.module.css.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-control.module.css.js.map +1 -1
- package/modern/components/actions-control/actions.js.map +1 -1
- 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.map +1 -1
- package/modern/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/modern/components/content/components/content-error/content-error.css +1 -1
- 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.map +1 -1
- package/modern/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/modern/components/content/components/content-subtitle/content-subtitle.module.css.js.map +1 -1
- package/modern/components/content/content.css +7 -7
- package/modern/components/content/content.js.map +1 -1
- package/modern/components/content/content.module.css.js +1 -1
- package/modern/components/content/content.module.css.js.map +1 -1
- package/modern/components/content/utils/isError.js.map +1 -1
- package/modern/components/status-control/extension-icon/index.css +5 -5
- 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.module.css.js +1 -1
- package/modern/components/status-control/index.module.css.js.map +1 -1
- package/modern/context/file-upload-item-context.d.ts +1 -1
- package/modern/index.css +2 -2
- package/modern/index.module.css.js +1 -1
- package/modern/index.module.css.js.map +1 -1
- package/modern/types/status.d.ts +1 -1
- package/modern/utils.d.ts +6 -6
- package/moderncssm/components/actions-control/actions.js.map +1 -1
- 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.map +1 -1
- package/moderncssm/components/actions-control/components/restore-button/restore-button.js.map +1 -1
- package/moderncssm/components/content/components/content-error/content-error.js.map +1 -1
- package/moderncssm/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/moderncssm/components/content/content.js.map +1 -1
- package/moderncssm/components/content/utils/isError.js.map +1 -1
- package/moderncssm/components/status-control/extension-icon/index.js.map +1 -1
- package/moderncssm/context/file-upload-item-context.d.ts +1 -1
- package/moderncssm/types/status.d.ts +1 -1
- package/moderncssm/utils.d.ts +6 -6
- package/package.json +6 -6
- package/src/components/actions-control/actions-control.module.css +1 -1
- package/src/components/content/components/content-subtitle/content-subtitle.module.css +1 -1
- package/src/components/content/content.module.css +1 -1
- package/src/components/status-control/extension-icon/index.module.css +1 -1
- package/src/components/status-control/index.module.css +1 -1
- package/src/index.module.css +1 -1
- package/types/status.d.ts +1 -1
- package/utils.d.ts +6 -6
|
@@ -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_1aco4 {
|
|
6
6
|
display: flex;
|
|
7
7
|
max-width: 144px;
|
|
8
8
|
}
|
|
9
|
-
.file-upload-
|
|
9
|
+
.file-upload-item__container_1aco4 .file-upload-item__icon_1aco4 {
|
|
10
10
|
width: 48px;
|
|
11
11
|
height: 48px;
|
|
12
12
|
}
|
|
13
|
-
.file-upload-
|
|
13
|
+
.file-upload-item__deleteIconColor_1aco4 {
|
|
14
14
|
fill: var(--color-light-text-tertiary);
|
|
15
15
|
}
|
|
16
|
-
.file-upload-
|
|
16
|
+
.file-upload-item__deleteIconColor_1aco4:hover {
|
|
17
17
|
fill: var(--color-light-text-tertiary-hover);
|
|
18
18
|
}
|
|
19
|
-
.file-upload-
|
|
19
|
+
.file-upload-item__downloadIconColor_1aco4 {
|
|
20
20
|
fill: var(--color-light-text-tertiary);
|
|
21
21
|
}
|
|
22
|
-
.file-upload-
|
|
22
|
+
.file-upload-item__downloadIconColor_1aco4:hover {
|
|
23
23
|
fill: var(--color-light-text-tertiary-hover);
|
|
24
24
|
}
|
|
25
|
-
.file-upload-
|
|
25
|
+
.file-upload-item__restoreIconColor_1aco4 {
|
|
26
26
|
fill: var(--color-light-text-tertiary);
|
|
27
27
|
}
|
|
28
|
-
.file-upload-
|
|
28
|
+
.file-upload-item__restoreIconColor_1aco4:hover {
|
|
29
29
|
fill: var(--color-light-text-tertiary-hover);
|
|
30
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './actions-control.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"container":"file-upload-
|
|
3
|
+
const styles = {"container":"file-upload-item__container_1aco4","icon":"file-upload-item__icon_1aco4","deleteIconColor":"file-upload-item__deleteIconColor_1aco4","downloadIconColor":"file-upload-item__downloadIconColor_1aco4","restoreIconColor":"file-upload-item__restoreIconColor_1aco4"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=actions-control.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-control.module.css.js","sources":["../../src/components/actions-control/actions-control.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"actions-control.module.css.js","sources":["../../src/components/actions-control/actions-control.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n display: flex;\n max-width: 144px;\n\n & .icon {\n width: 48px;\n height: 48px;\n }\n}\n\n.deleteIconColor {\n fill: var(--color-light-text-tertiary);\n\n &:hover {\n fill: var(--color-light-text-tertiary-hover);\n }\n}\n\n.downloadIconColor {\n fill: var(--color-light-text-tertiary);\n\n &:hover {\n fill: var(--color-light-text-tertiary-hover);\n }\n}\n\n.restoreIconColor {\n fill: var(--color-light-text-tertiary);\n\n &:hover {\n fill: var(--color-light-text-tertiary-hover);\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,MAAM,CAAC,8BAA8B,CAAC,iBAAiB,CAAC,yCAAyC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,kBAAkB,CAAC,0CAA0C,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sources":["../../../src/components/actions-control/actions.tsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\n\nimport { FileUploadItemContext } 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';\n\nimport styles from './actions-control.module.css';\n\nexport const Actions = () => {\n const { showRestore, downloadLink, showDelete, setActionsPresent, onDownload } =\n useContext(FileUploadItemContext);\n\n useEffect(() => {\n if (setActionsPresent) {\n setActionsPresent(!!(showRestore || downloadLink || showDelete || onDownload));\n }\n }, [showRestore, downloadLink, showDelete, setActionsPresent, onDownload]);\n\n return (\n <div className={styles.container}>\n {showRestore && <RestoreButton />}\n\n {(downloadLink || onDownload) && !showRestore && <DownloadButton />}\n\n {showDelete && !showRestore && <DeleteButton />}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAUO,MAAM,OAAO,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAC1E,UAAU,CAAC,qBAAqB,CAAC;IAErC,SAAS,CAAC,MAAK;
|
|
1
|
+
{"version":3,"file":"actions.js","sources":["../../../src/components/actions-control/actions.tsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\n\nimport { FileUploadItemContext } 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';\n\nimport styles from './actions-control.module.css';\n\nexport const Actions = () => {\n const { showRestore, downloadLink, showDelete, setActionsPresent, onDownload } =\n useContext(FileUploadItemContext);\n\n useEffect(() => {\n if (setActionsPresent) {\n setActionsPresent(!!(showRestore || downloadLink || showDelete || onDownload));\n }\n }, [showRestore, downloadLink, showDelete, setActionsPresent, onDownload]);\n\n return (\n <div className={styles.container}>\n {showRestore && <RestoreButton />}\n\n {(downloadLink || onDownload) && !showRestore && <DownloadButton />}\n\n {showDelete && !showRestore && <DeleteButton />}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAUO,MAAM,OAAO,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAC1E,UAAU,CAAC,qBAAqB,CAAC;IAErC,SAAS,CAAC,MAAK;QACX,IAAI,iBAAiB,EAAE;AACnB,YAAA,iBAAiB,CAAC,CAAC,EAAE,WAAW,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,CAAC,CAAC;;AAEtF,KAAC,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAE1E,IAAA,QACI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,SAAS,EAAA;QAC3B,WAAW,IAAI,KAAC,CAAA,aAAA,CAAA,aAAa,EAAG,IAAA,CAAA;QAEhC,CAAC,YAAY,IAAI,UAAU,KAAK,CAAC,WAAW,IAAI,KAAC,CAAA,aAAA,CAAA,cAAc,EAAG,IAAA,CAAA;QAElE,UAAU,IAAI,CAAC,WAAW,IAAI,oBAAC,YAAY,EAAA,IAAA,CAAG,CAC7C;AAEd;;;;"}
|
|
@@ -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, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport CrossMIcon from '@alfalab/icons-glyph/CrossMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const DeleteButton = () => {\n const { id = '0', disableButtons, onDelete } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAEhF,IAAA,MAAM,YAAY,GAAG,CAAC,CAA0B,KAAI;
|
|
1
|
+
{"version":3,"file":"delete-button.js","sources":["../../../../../src/components/actions-control/components/delete-button/delete-button.tsx"],"sourcesContent":["import React, { type MouseEvent, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport CrossMIcon from '@alfalab/icons-glyph/CrossMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const DeleteButton = () => {\n const { id = '0', disableButtons, onDelete } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAEhF,IAAA,MAAM,YAAY,GAAG,CAAC,CAA0B,KAAI;QAChD,IAAI,QAAQ,EAAE;AACV,YAAA,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;;AAEvB,KAAC;AAED,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,UAAU,EACP,EAAA,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EACG,YAAA,EAAA,4CAAS,EACpB,IAAI,EAAE,KAAC,CAAA,aAAA,CAAA,UAAU,IAAC,SAAS,EAAE,MAAM,CAAC,eAAe,EAAI,CAAA,EACvD,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EAAA,CACvB;AAEV;;;;"}
|
|
@@ -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, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowDownLineDownCompactMIcon from '@alfalab/icons-glyph/ArrowDownLineDownCompactMIcon';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;IAC/B,MAAM,EACF,EAAE,GAAG,GAAG,EACR,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,GACb,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAErC,IAAA,MAAM,cAAc,GAAG,CAAC,CAA0B,KAAI;
|
|
1
|
+
{"version":3,"file":"download-button.js","sources":["../../../../../src/components/actions-control/components/download-button/download-button.tsx"],"sourcesContent":["import React, { type MouseEvent, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowDownLineDownCompactMIcon from '@alfalab/icons-glyph/ArrowDownLineDownCompactMIcon';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;IAC/B,MAAM,EACF,EAAE,GAAG,GAAG,EACR,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,GACb,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAErC,IAAA,MAAM,cAAc,GAAG,CAAC,CAA0B,KAAI;QAClD,IAAI,UAAU,EAAE;YACZ,CAAC,CAAC,cAAc,EAAE;YAClB,UAAU,CAAC,EAAE,CAAC;;AAEtB,KAAC;IAED,QACI,oBAAC,UAAU,EAAA,EACP,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EAAA,YAAA,EACG,4CAAS,EACpB,IAAI,EAAE,KAAC,CAAA,aAAA,CAAA,6BAA6B,EAAC,EAAA,SAAS,EAAE,MAAM,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;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore-button.js","sources":["../../../../../src/components/actions-control/components/restore-button/restore-button.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowsCwCompactMIcon from '@alfalab/icons-glyph/ArrowsCwCompactMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const RestoreButton = () => {\n const { id = '0', disableButtons, onRestore } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEjF,MAAM,aAAa,GAAG,MAAK;
|
|
1
|
+
{"version":3,"file":"restore-button.js","sources":["../../../../../src/components/actions-control/components/restore-button/restore-button.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowsCwCompactMIcon from '@alfalab/icons-glyph/ArrowsCwCompactMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const RestoreButton = () => {\n const { id = '0', disableButtons, onRestore } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEjF,MAAM,aAAa,GAAG,MAAK;QACvB,IAAI,SAAS,EAAE;YACX,SAAS,CAAC,EAAE,CAAC;;AAErB,KAAC;AAED,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,UAAU,EACP,EAAA,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EACG,YAAA,EAAA,0EAAc,EACzB,IAAI,EAAE,KAAC,CAAA,aAAA,CAAA,oBAAoB,IAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAI,CAAA,EAClE,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,aAAa,EAAA,CACxB;AAEV;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-error.js","sources":["../../../../../src/components/content/components/content-error/content-error.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from './content-error.module.css';\n\nexport const ContentError = () => {\n const { error } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;AAQO,MAAM,YAAY,GAAG,MAAK;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,QACI,oBAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAC7E,EAAA,KAAK,CACO
|
|
1
|
+
{"version":3,"file":"content-error.js","sources":["../../../../../src/components/content/components/content-error/content-error.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from './content-error.module.css';\n\nexport const ContentError = () => {\n const { error } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;AAQO,MAAM,YAAY,GAAG,MAAK;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,QACI,oBAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,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,QACI,KACK,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACZ,KAAA,CAAA,aAAA,CAAC,cAAc,EACX,EAAA,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,UAAU,IAEf,IAAI,CACQ,CACpB,CAAC,CACA;;AAId,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,IAAC,SAAS,EAAE,MAAM,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_1svbn {
|
|
6
6
|
display: block;
|
|
7
7
|
}
|
|
8
|
-
.file-upload-
|
|
8
|
+
.file-upload-item__subtitle_1svbn.file-upload-item__truncate_1svbn {
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
text-overflow: ellipsis;
|
|
12
12
|
}
|
|
13
|
-
.file-upload-
|
|
13
|
+
.file-upload-item__size_1svbn {
|
|
14
14
|
margin-right: var(--gap-8);
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-subtitle.js","sources":["../../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React, { useContext } 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 { FileUploadItemContext } 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 useContext(FileUploadItemContext);\n\n const shouldShownError = isErrorStatus(uploadStatus) || isError(error);\n const showMeta =\n !showRestore && (isSuccessStatus(uploadStatus) || isUploadedStatus(uploadStatus));\n\n // валидация progressBar (не должен превышать 100 и быть меньше 0)\n const validateProgressBarValue = (progressValue: number | undefined) => {\n if (progressValue === undefined) {\n return 0;\n }\n\n return Math.min(Math.max(progressValue, 0), MAX_PROGRESS_BAR_VALUE);\n };\n\n const validProgressBar = validateProgressBarValue(progressBar);\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":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GACzF,UAAU,CAAC,qBAAqB,CAAC;IAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;AACtE,IAAA,MAAM,QAAQ,GACV,CAAC,WAAW,KAAK,eAAe,CAAC,YAAY,CAAC,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC;;AAGrF,IAAA,MAAM,wBAAwB,GAAG,CAAC,aAAiC,KAAI;
|
|
1
|
+
{"version":3,"file":"content-subtitle.js","sources":["../../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React, { useContext } 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 { FileUploadItemContext } 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 useContext(FileUploadItemContext);\n\n const shouldShownError = isErrorStatus(uploadStatus) || isError(error);\n const showMeta =\n !showRestore && (isSuccessStatus(uploadStatus) || isUploadedStatus(uploadStatus));\n\n // валидация progressBar (не должен превышать 100 и быть меньше 0)\n const validateProgressBarValue = (progressValue: number | undefined) => {\n if (progressValue === undefined) {\n return 0;\n }\n\n return Math.min(Math.max(progressValue, 0), MAX_PROGRESS_BAR_VALUE);\n };\n\n const validProgressBar = validateProgressBarValue(progressBar);\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":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GACzF,UAAU,CAAC,qBAAqB,CAAC;IAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;AACtE,IAAA,MAAM,QAAQ,GACV,CAAC,WAAW,KAAK,eAAe,CAAC,YAAY,CAAC,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC;;AAGrF,IAAA,MAAM,wBAAwB,GAAG,CAAC,aAAiC,KAAI;AACnE,QAAA,IAAI,aAAa,KAAK,SAAS,EAAE;AAC7B,YAAA,OAAO,CAAC;;AAGZ,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,sBAAsB,CAAC;AACvE,KAAC;AAED,IAAA,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,WAAW,CAAC;;AAG9D,IAAA,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,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,OAAO,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,IAAA,CAAG;;;IAI3B,IAAI,QAAQ,EAAE;AACV,QAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YACK,IAAI,KACD,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA,EACzE,aAAa,CAAC,IAAI,CAAC,CACP,CACpB;AACA,YAAA,UAAU,KACP,KAAA,CAAA,aAAA,CAAC,cAAc,EAAC,EAAA,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EACjD,EAAA,UAAU,CACE,CACpB,CACC;;;IAKd,IAAI,WAAW,EAAE;AACb,QAAA,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,+DAAA,CAEpC;;IAIzB,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,EACX,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE;AAC3B,YAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC9B,SAAA,CAAC,EACF,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,WAAW,EAEhB,EAAA,QAAQ,CACI;AAEzB;;;;"}
|
package/modern/components/content/components/content-subtitle/content-subtitle.module.css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './content-subtitle.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"subtitle":"file-upload-
|
|
3
|
+
const styles = {"subtitle":"file-upload-item__subtitle_1svbn","truncate":"file-upload-item__truncate_1svbn","size":"file-upload-item__size_1svbn"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=content-subtitle.module.css.js.map
|
package/modern/components/content/components/content-subtitle/content-subtitle.module.css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-subtitle.module.css.js","sources":["../../../../src/components/content/components/content-subtitle/content-subtitle.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"content-subtitle.module.css.js","sources":["../../../../src/components/content/components/content-subtitle/content-subtitle.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.subtitle {\n display: block;\n\n &.truncate {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n}\n\n.size {\n margin-right: var(--gap-8);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,UAAU,CAAC,kCAAkC,CAAC,UAAU,CAAC,kCAAkC,CAAC,MAAM,CAAC,8BAA8B,CAAC;;;;"}
|
|
@@ -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_1vs4w {
|
|
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_1vs4w.file-upload-item__clickable_1vs4w {
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
}
|
|
20
|
-
.file-upload-
|
|
20
|
+
.file-upload-item__container_1vs4w.file-upload-item__single_1vs4w {
|
|
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_1vs4w.file-upload-item__single_1vs4w .file-upload-item__title_1vs4w {
|
|
28
28
|
margin-bottom: 0;
|
|
29
29
|
}
|
|
30
|
-
.file-upload-
|
|
30
|
+
.file-upload-item__container_1vs4w .file-upload-item__title_1vs4w {
|
|
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_1vs4w .file-upload-item__title_1vs4w.file-upload-item__truncate_1vs4w {
|
|
36
36
|
white-space: nowrap;
|
|
37
37
|
overflow: hidden;
|
|
38
38
|
text-overflow: ellipsis;
|
|
39
39
|
}
|
|
40
|
-
.file-upload-
|
|
40
|
+
.file-upload-item__container_1vs4w .file-upload-item__title_1vs4w.file-upload-item__restore_1vs4w {
|
|
41
41
|
color: var(--color-light-text-tertiary);
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../../src/components/content/content.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;;AAWO,MAAM,OAAO,GAAG,MAAK;IACxB,MAAM,EACF,KAAK,EACL,aAAa,EAAE,aAAa,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,GACd,GAAG,UAAU,CAAC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../../src/components/content/content.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;;AAWO,MAAM,OAAO,GAAG,MAAK;IACxB,MAAM,EACF,KAAK,EACL,aAAa,EAAE,aAAa,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,GACd,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAErC,IAAI,aAAa,EAAE;QACf,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG;;IAG5B,QACI,6BACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;AAC5B,YAAA,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,QAAQ;YAC1B,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,cAAc,IAAI,WAAW;SACrD,CAAC,EAAA;AAED,QAAA,KAAK,KACF,KAAC,CAAA,aAAA,CAAA,cAAc,EACX,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;AACxB,gBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC3B,gBAAA,CAAC,MAAM,CAAC,OAAO,GAAG,WAAW;aAChC,CAAC,EACF,IAAI,EAAC,mBAAmB,EACxB,KAAK,EAAC,SAAS,EAAA,EAEd,KAAK,CACO,CACpB;AACD,QAAA,KAAA,CAAA,aAAA,CAAC,eAAe,EAAA,IAAA,CAAG,CACjB;AAEd;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './content.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"container":"file-upload-
|
|
3
|
+
const styles = {"container":"file-upload-item__container_1vs4w","clickable":"file-upload-item__clickable_1vs4w","single":"file-upload-item__single_1vs4w","title":"file-upload-item__title_1vs4w","truncate":"file-upload-item__truncate_1vs4w","restore":"file-upload-item__restore_1vs4w"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=content.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.module.css.js","sources":["../../src/components/content/content.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"content.module.css.js","sources":["../../src/components/content/content.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n padding: var(--gap-2) 0 0 var(--gap-16);\n flex-grow: 1;\n min-width: 0;\n\n &.clickable {\n cursor: pointer;\n }\n\n &.single {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding-top: 0;\n min-height: 48px;\n\n & .title {\n margin-bottom: 0;\n }\n }\n\n & .title {\n margin-bottom: var(--gap-4);\n display: block;\n overflow-wrap: break-word;\n\n &.truncate {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &.restore {\n color: var(--color-light-text-tertiary);\n }\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,WAAW,CAAC,mCAAmC,CAAC,QAAQ,CAAC,gCAAgC,CAAC,OAAO,CAAC,+BAA+B,CAAC,UAAU,CAAC,kCAAkC,CAAC,SAAS,CAAC,iCAAiC,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isError.js","sources":["../../../../src/components/content/utils/isError.ts"],"sourcesContent":["export const isError = (error?: string | string[]) => {\n if (typeof error === 'string' && error.length > 0) {\n return true;\n }\n\n if (Array.isArray(error) && error.length > 0) {\n return true;\n }\n\n return false;\n};\n"],"names":[],"mappings":"AAAa,MAAA,OAAO,GAAG,CAAC,KAAyB,KAAI;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC/C,QAAA,OAAO,IAAI
|
|
1
|
+
{"version":3,"file":"isError.js","sources":["../../../../src/components/content/utils/isError.ts"],"sourcesContent":["export const isError = (error?: string | string[]) => {\n if (typeof error === 'string' && error.length > 0) {\n return true;\n }\n\n if (Array.isArray(error) && error.length > 0) {\n return true;\n }\n\n return false;\n};\n"],"names":[],"mappings":"AAAa,MAAA,OAAO,GAAG,CAAC,KAAyB,KAAI;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC/C,QAAA,OAAO,IAAI;;AAGf,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1C,QAAA,OAAO,IAAI;;AAGf,IAAA,OAAO,KAAK;AAChB;;;;"}
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
--color-light-decorative-orange: #fa9313;
|
|
8
8
|
--color-light-decorative-red: #fe5e48;
|
|
9
9
|
}
|
|
10
|
-
.file-upload-
|
|
10
|
+
.file-upload-item__iconPDFColored_18nhj {
|
|
11
11
|
fill: var(--color-light-decorative-red);
|
|
12
12
|
}
|
|
13
|
-
.file-upload-
|
|
13
|
+
.file-upload-item__iconDOCColored_18nhj {
|
|
14
14
|
fill: var(--color-light-decorative-blue);
|
|
15
15
|
}
|
|
16
|
-
.file-upload-
|
|
16
|
+
.file-upload-item__iconExcelColored_18nhj {
|
|
17
17
|
fill: var(--color-light-decorative-green);
|
|
18
18
|
}
|
|
19
|
-
.file-upload-
|
|
19
|
+
.file-upload-item__icon1CColored_18nhj {
|
|
20
20
|
fill: var(--color-light-decorative-orange);
|
|
21
21
|
}
|
|
22
|
-
.file-upload-
|
|
22
|
+
.file-upload-item__iconDocumentColored_18nhj {
|
|
23
23
|
fill: var(--color-light-neutral-translucent-1300);
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/extension-icon/index.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Document1CMIcon } from '@alfalab/icons-glyph/Document1CMIcon';\nimport { DocumentDocMIcon } from '@alfalab/icons-glyph/DocumentDocMIcon';\nimport { DocumentExcelMIcon } from '@alfalab/icons-glyph/DocumentExcelMIcon';\nimport { DocumentImageMIcon } from '@alfalab/icons-glyph/DocumentImageMIcon';\nimport { DocumentMIcon } from '@alfalab/icons-glyph/DocumentMIcon';\nimport { DocumentOffMIcon } from '@alfalab/icons-glyph/DocumentOffMIcon';\nimport { DocumentPdfMIcon } from '@alfalab/icons-glyph/DocumentPdfMIcon';\nimport { PaperclipMIcon } from '@alfalab/icons-glyph/PaperclipMIcon';\n\nimport { FileUploadItemContext } from '../../../context/file-upload-item-context';\nimport { getExtension, isInitialStatus } from '../../../utils';\n\nimport styles from './index.module.css';\n\nexport const ExtensionIcon = () => {\n const {\n title = '',\n uploadStatus,\n iconStyle,\n customIcon: CustomIcon,\n imageUrl,\n showRestore,\n } = useContext(FileUploadItemContext);\n\n if (imageUrl) {\n return null;\n }\n\n if (CustomIcon) {\n return <CustomIcon />;\n }\n\n if (isInitialStatus(uploadStatus)) {\n return <PaperclipMIcon />;\n }\n\n if (showRestore) {\n return <DocumentOffMIcon />;\n }\n\n const isColoredIcon = iconStyle === 'colored';\n const fileType = getExtension(title);\n\n switch (fileType) {\n case 'pdf':\n case 'ppt':\n case 'pptx':\n return <DocumentPdfMIcon className={cn({ [styles.iconPDFColored]: isColoredIcon })} />;\n case 'doc':\n case 'docx':\n return <DocumentDocMIcon className={cn({ [styles.iconDOCColored]: isColoredIcon })} />;\n case 'xls':\n case 'xlsx':\n return (\n <DocumentExcelMIcon className={cn({ [styles.iconExcelColored]: isColoredIcon })} />\n );\n case '1c':\n return <Document1CMIcon className={cn({ [styles.icon1CColored]: isColoredIcon })} />;\n case 'png':\n case 'jpg':\n case 'jpeg':\n case 'svg':\n case 'tif':\n case 'tiff':\n return <DocumentImageMIcon />;\n default:\n return (\n <DocumentMIcon className={cn({ [styles.iconDocumentColored]: isColoredIcon })} />\n );\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiBO,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,KAAK,GAAG,EAAE,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EAAE,UAAU,EACtB,QAAQ,EACR,WAAW,GACd,GAAG,UAAU,CAAC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/extension-icon/index.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Document1CMIcon } from '@alfalab/icons-glyph/Document1CMIcon';\nimport { DocumentDocMIcon } from '@alfalab/icons-glyph/DocumentDocMIcon';\nimport { DocumentExcelMIcon } from '@alfalab/icons-glyph/DocumentExcelMIcon';\nimport { DocumentImageMIcon } from '@alfalab/icons-glyph/DocumentImageMIcon';\nimport { DocumentMIcon } from '@alfalab/icons-glyph/DocumentMIcon';\nimport { DocumentOffMIcon } from '@alfalab/icons-glyph/DocumentOffMIcon';\nimport { DocumentPdfMIcon } from '@alfalab/icons-glyph/DocumentPdfMIcon';\nimport { PaperclipMIcon } from '@alfalab/icons-glyph/PaperclipMIcon';\n\nimport { FileUploadItemContext } from '../../../context/file-upload-item-context';\nimport { getExtension, isInitialStatus } from '../../../utils';\n\nimport styles from './index.module.css';\n\nexport const ExtensionIcon = () => {\n const {\n title = '',\n uploadStatus,\n iconStyle,\n customIcon: CustomIcon,\n imageUrl,\n showRestore,\n } = useContext(FileUploadItemContext);\n\n if (imageUrl) {\n return null;\n }\n\n if (CustomIcon) {\n return <CustomIcon />;\n }\n\n if (isInitialStatus(uploadStatus)) {\n return <PaperclipMIcon />;\n }\n\n if (showRestore) {\n return <DocumentOffMIcon />;\n }\n\n const isColoredIcon = iconStyle === 'colored';\n const fileType = getExtension(title);\n\n switch (fileType) {\n case 'pdf':\n case 'ppt':\n case 'pptx':\n return <DocumentPdfMIcon className={cn({ [styles.iconPDFColored]: isColoredIcon })} />;\n case 'doc':\n case 'docx':\n return <DocumentDocMIcon className={cn({ [styles.iconDOCColored]: isColoredIcon })} />;\n case 'xls':\n case 'xlsx':\n return (\n <DocumentExcelMIcon className={cn({ [styles.iconExcelColored]: isColoredIcon })} />\n );\n case '1c':\n return <Document1CMIcon className={cn({ [styles.icon1CColored]: isColoredIcon })} />;\n case 'png':\n case 'jpg':\n case 'jpeg':\n case 'svg':\n case 'tif':\n case 'tiff':\n return <DocumentImageMIcon />;\n default:\n return (\n <DocumentMIcon className={cn({ [styles.iconDocumentColored]: isColoredIcon })} />\n );\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiBO,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,KAAK,GAAG,EAAE,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EAAE,UAAU,EACtB,QAAQ,EACR,WAAW,GACd,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAErC,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,IAAI;;IAGf,IAAI,UAAU,EAAE;QACZ,OAAO,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,IAAA,CAAG;;AAGzB,IAAA,IAAI,eAAe,CAAC,YAAY,CAAC,EAAE;QAC/B,OAAO,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,IAAA,CAAG;;IAG7B,IAAI,WAAW,EAAE;QACb,OAAO,KAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,IAAA,CAAG;;AAG/B,IAAA,MAAM,aAAa,GAAG,SAAS,KAAK,SAAS;AAC7C,IAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC;IAEpC,QAAQ,QAAQ;AACZ,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,MAAM;AACP,YAAA,OAAO,oBAAC,gBAAgB,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,GAAG,aAAa,EAAE,CAAC,GAAI;AAC1F,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,MAAM;AACP,YAAA,OAAO,oBAAC,gBAAgB,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,GAAG,aAAa,EAAE,CAAC,GAAI;AAC1F,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,MAAM;YACP,QACI,oBAAC,kBAAkB,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,gBAAgB,GAAG,aAAa,EAAE,CAAC,EAAA,CAAI;AAE3F,QAAA,KAAK,IAAI;AACL,YAAA,OAAO,oBAAC,eAAe,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,GAAG,aAAa,EAAE,CAAC,GAAI;AACxF,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,MAAM;AACX,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,MAAM;YACP,OAAO,KAAA,CAAA,aAAA,CAAC,kBAAkB,EAAA,IAAA,CAAG;AACjC,QAAA;YACI,QACI,oBAAC,aAAa,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,mBAAmB,GAAG,aAAa,EAAE,CAAC,EAAA,CAAI;;AAGjG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"iconPDFColored":"file-upload-
|
|
3
|
+
const styles = {"iconPDFColored":"file-upload-item__iconPDFColored_18nhj","iconDOCColored":"file-upload-item__iconDOCColored_18nhj","iconExcelColored":"file-upload-item__iconExcelColored_18nhj","icon1CColored":"file-upload-item__icon1CColored_18nhj","iconDocumentColored":"file-upload-item__iconDocumentColored_18nhj"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../../src/components/status-control/extension-icon/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../../src/components/status-control/extension-icon/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '@alfalab/core-components-vars/src/colors-decorative.css';\n\n.iconPDFColored {\n fill: var(--color-light-decorative-red);\n}\n\n.iconDOCColored {\n fill: var(--color-light-decorative-blue);\n}\n\n.iconExcelColored {\n fill: var(--color-light-decorative-green);\n}\n\n.icon1CColored {\n fill: var(--color-light-decorative-orange);\n}\n\n.iconDocumentColored {\n fill: var(--color-light-neutral-translucent-1300);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,gBAAgB,CAAC,wCAAwC,CAAC,gBAAgB,CAAC,wCAAwC,CAAC,kBAAkB,CAAC,0CAA0C,CAAC,eAAe,CAAC,uCAAuC,CAAC,qBAAqB,CAAC,6CAA6C,CAAC;;;;"}
|
|
@@ -7,30 +7,30 @@
|
|
|
7
7
|
--gap-2xs-neg: -4px;
|
|
8
8
|
--gap-4-neg: var(--gap-2xs-neg);
|
|
9
9
|
}
|
|
10
|
-
.file-upload-
|
|
10
|
+
.file-upload-item__container_15bp4 {
|
|
11
11
|
position: relative;
|
|
12
12
|
}
|
|
13
|
-
.file-upload-
|
|
13
|
+
.file-upload-item__container_15bp4.file-upload-item__clickable_15bp4 {
|
|
14
14
|
cursor: pointer;
|
|
15
15
|
}
|
|
16
|
-
.file-upload-
|
|
16
|
+
.file-upload-item__container_15bp4 .file-upload-item__progress_15bp4 {
|
|
17
17
|
position: absolute;
|
|
18
18
|
top: var(--gap-4-neg);
|
|
19
19
|
left: var(--gap-4-neg);
|
|
20
20
|
z-index: 1;
|
|
21
21
|
will-change: opacity;
|
|
22
22
|
}
|
|
23
|
-
.file-upload-
|
|
24
|
-
.file-upload-
|
|
23
|
+
.file-upload-item__container_15bp4 .file-upload-item__progress_15bp4.file-upload-item__success_15bp4,
|
|
24
|
+
.file-upload-item__container_15bp4 .file-upload-item__progress_15bp4.file-upload-item__error_15bp4 {
|
|
25
25
|
transition: opacity 400ms ease-in;
|
|
26
26
|
opacity: 0;
|
|
27
27
|
}
|
|
28
|
-
.file-upload-
|
|
28
|
+
.file-upload-item__container_15bp4 .file-upload-item__progress_15bp4.file-upload-item__success_15bp4 path {
|
|
29
29
|
stroke: var(--color-light-status-positive);
|
|
30
30
|
}
|
|
31
|
-
.file-upload-
|
|
31
|
+
.file-upload-item__container_15bp4 .file-upload-item__progress_15bp4.file-upload-item__loading_15bp4 {
|
|
32
32
|
color: var(--color-light-neutral-500);
|
|
33
33
|
}
|
|
34
|
-
.file-upload-
|
|
34
|
+
.file-upload-item__container_15bp4 .file-upload-item__progress_15bp4.file-upload-item__error_15bp4 path {
|
|
35
35
|
stroke: var(--color-light-status-negative);
|
|
36
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"container":"file-upload-
|
|
3
|
+
const styles = {"container":"file-upload-item__container_15bp4","clickable":"file-upload-item__clickable_15bp4","progress":"file-upload-item__progress_15bp4","success":"file-upload-item__success_15bp4","error":"file-upload-item__error_15bp4","loading":"file-upload-item__loading_15bp4"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/status-control/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/status-control/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n position: relative;\n\n &.clickable {\n cursor: pointer;\n }\n\n & .progress {\n position: absolute;\n top: var(--gap-4-neg);\n left: var(--gap-4-neg);\n z-index: 1;\n will-change: opacity;\n\n &.success,\n &.error {\n transition: opacity 400ms ease-in;\n opacity: 0;\n }\n\n &.success {\n & path {\n stroke: var(--color-light-status-positive);\n }\n }\n\n &.loading {\n color: var(--color-light-neutral-500);\n }\n\n &.error {\n & path {\n stroke: var(--color-light-status-negative);\n }\n }\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,WAAW,CAAC,mCAAmC,CAAC,UAAU,CAAC,kCAAkC,CAAC,SAAS,CAAC,iCAAiC,CAAC,OAAO,CAAC,+BAA+B,CAAC,SAAS,CAAC,iCAAiC,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ElementType, type HTMLAttributeAnchorTarget, type MouseEvent } from 'react';
|
|
2
2
|
import { type SuperEllipseProps } from '@alfalab/core-components-icon-view/modern/super-ellipse';
|
|
3
3
|
import { type FileUploadItemStatus } from '../types/status';
|
|
4
|
-
|
|
4
|
+
type TFileUploadItemContext = {
|
|
5
5
|
showRestore?: boolean;
|
|
6
6
|
uploadStatus?: FileUploadItemStatus;
|
|
7
7
|
error?: string | string[];
|
package/modern/index.css
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
--gap-2: var(--gap-3xs);
|
|
5
5
|
--gap-12: var(--gap-s);
|
|
6
6
|
}
|
|
7
|
-
.file-upload-
|
|
7
|
+
.file-upload-item__component_3ewe9 {
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: flex-start;
|
|
11
11
|
width: 100%;
|
|
12
12
|
min-height: 48px;
|
|
13
13
|
}
|
|
14
|
-
.file-upload-
|
|
14
|
+
.file-upload-item__restore_3ewe9 {
|
|
15
15
|
margin-left: var(--gap-12);
|
|
16
16
|
margin-top: var(--gap-2);
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"file-upload-
|
|
3
|
+
const styles = {"component":"file-upload-item__component_3ewe9","restore":"file-upload-item__restore_3ewe9"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n box-sizing: border-box;\n display: flex;\n align-items: flex-start;\n width: 100%;\n min-height: 48px;\n}\n\n.restore {\n margin-left: var(--gap-12);\n margin-top: var(--gap-2);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,SAAS,CAAC,iCAAiC,CAAC;;;;"}
|
package/modern/types/status.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type FileUploadItemStatus = 'INITIAL' | 'SUCCESS' | 'ERROR' | 'UPLOADING' | 'UPLOADED' | 'LOADING' | 'DELETED';
|
package/modern/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type FileUploadItemStatus } from './types/status';
|
|
2
2
|
export declare const getExtension: (filename: string) => string | undefined;
|
|
3
|
-
export declare const isInitialStatus: (status?: FileUploadItemStatus) =>
|
|
4
|
-
export declare const isSuccessStatus: (status?: FileUploadItemStatus) =>
|
|
5
|
-
export declare const isErrorStatus: (status?: FileUploadItemStatus) =>
|
|
6
|
-
export declare const isUploadingStatus: (status?: FileUploadItemStatus) =>
|
|
7
|
-
export declare const isUploadedStatus: (status?: FileUploadItemStatus) =>
|
|
8
|
-
export declare const isLoadingStatus: (status?: FileUploadItemStatus) =>
|
|
3
|
+
export declare const isInitialStatus: (status?: FileUploadItemStatus) => status is "INITIAL";
|
|
4
|
+
export declare const isSuccessStatus: (status?: FileUploadItemStatus) => status is "SUCCESS";
|
|
5
|
+
export declare const isErrorStatus: (status?: FileUploadItemStatus) => status is "ERROR";
|
|
6
|
+
export declare const isUploadingStatus: (status?: FileUploadItemStatus) => status is "UPLOADING";
|
|
7
|
+
export declare const isUploadedStatus: (status?: FileUploadItemStatus) => status is "UPLOADED";
|
|
8
|
+
export declare const isLoadingStatus: (status?: FileUploadItemStatus) => status is "LOADING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sources":["../../../src/components/actions-control/actions.tsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\n\nimport { FileUploadItemContext } 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';\n\nimport styles from './actions-control.module.css';\n\nexport const Actions = () => {\n const { showRestore, downloadLink, showDelete, setActionsPresent, onDownload } =\n useContext(FileUploadItemContext);\n\n useEffect(() => {\n if (setActionsPresent) {\n setActionsPresent(!!(showRestore || downloadLink || showDelete || onDownload));\n }\n }, [showRestore, downloadLink, showDelete, setActionsPresent, onDownload]);\n\n return (\n <div className={styles.container}>\n {showRestore && <RestoreButton />}\n\n {(downloadLink || onDownload) && !showRestore && <DownloadButton />}\n\n {showDelete && !showRestore && <DeleteButton />}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAUO,MAAM,OAAO,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAC1E,UAAU,CAAC,qBAAqB,CAAC;IAErC,SAAS,CAAC,MAAK;
|
|
1
|
+
{"version":3,"file":"actions.js","sources":["../../../src/components/actions-control/actions.tsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\n\nimport { FileUploadItemContext } 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';\n\nimport styles from './actions-control.module.css';\n\nexport const Actions = () => {\n const { showRestore, downloadLink, showDelete, setActionsPresent, onDownload } =\n useContext(FileUploadItemContext);\n\n useEffect(() => {\n if (setActionsPresent) {\n setActionsPresent(!!(showRestore || downloadLink || showDelete || onDownload));\n }\n }, [showRestore, downloadLink, showDelete, setActionsPresent, onDownload]);\n\n return (\n <div className={styles.container}>\n {showRestore && <RestoreButton />}\n\n {(downloadLink || onDownload) && !showRestore && <DownloadButton />}\n\n {showDelete && !showRestore && <DeleteButton />}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAUO,MAAM,OAAO,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAC1E,UAAU,CAAC,qBAAqB,CAAC;IAErC,SAAS,CAAC,MAAK;QACX,IAAI,iBAAiB,EAAE;AACnB,YAAA,iBAAiB,CAAC,CAAC,EAAE,WAAW,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,CAAC,CAAC;;AAEtF,KAAC,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAE1E,IAAA,QACI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,SAAS,EAAA;QAC3B,WAAW,IAAI,KAAC,CAAA,aAAA,CAAA,aAAa,EAAG,IAAA,CAAA;QAEhC,CAAC,YAAY,IAAI,UAAU,KAAK,CAAC,WAAW,IAAI,KAAC,CAAA,aAAA,CAAA,cAAc,EAAG,IAAA,CAAA;QAElE,UAAU,IAAI,CAAC,WAAW,IAAI,oBAAC,YAAY,EAAA,IAAA,CAAG,CAC7C;AAEd;;;;"}
|
|
@@ -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, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport CrossMIcon from '@alfalab/icons-glyph/CrossMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const DeleteButton = () => {\n const { id = '0', disableButtons, onDelete } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAEhF,IAAA,MAAM,YAAY,GAAG,CAAC,CAA0B,KAAI;
|
|
1
|
+
{"version":3,"file":"delete-button.js","sources":["../../../../../src/components/actions-control/components/delete-button/delete-button.tsx"],"sourcesContent":["import React, { type MouseEvent, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport CrossMIcon from '@alfalab/icons-glyph/CrossMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const DeleteButton = () => {\n const { id = '0', disableButtons, onDelete } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAEhF,IAAA,MAAM,YAAY,GAAG,CAAC,CAA0B,KAAI;QAChD,IAAI,QAAQ,EAAE;AACV,YAAA,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;;AAEvB,KAAC;AAED,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,UAAU,EACP,EAAA,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EACG,YAAA,EAAA,4CAAS,EACpB,IAAI,EAAE,KAAC,CAAA,aAAA,CAAA,UAAU,IAAC,SAAS,EAAE,MAAM,CAAC,eAAe,EAAI,CAAA,EACvD,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,YAAY,EAAA,CACvB;AAEV;;;;"}
|
package/moderncssm/components/actions-control/components/download-button/download-button.js.map
CHANGED
|
@@ -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, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowDownLineDownCompactMIcon from '@alfalab/icons-glyph/ArrowDownLineDownCompactMIcon';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;IAC/B,MAAM,EACF,EAAE,GAAG,GAAG,EACR,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,GACb,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAErC,IAAA,MAAM,cAAc,GAAG,CAAC,CAA0B,KAAI;
|
|
1
|
+
{"version":3,"file":"download-button.js","sources":["../../../../../src/components/actions-control/components/download-button/download-button.tsx"],"sourcesContent":["import React, { type MouseEvent, useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowDownLineDownCompactMIcon from '@alfalab/icons-glyph/ArrowDownLineDownCompactMIcon';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;IAC/B,MAAM,EACF,EAAE,GAAG,GAAG,EACR,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,GACb,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAErC,IAAA,MAAM,cAAc,GAAG,CAAC,CAA0B,KAAI;QAClD,IAAI,UAAU,EAAE;YACZ,CAAC,CAAC,cAAc,EAAE;YAClB,UAAU,CAAC,EAAE,CAAC;;AAEtB,KAAC;IAED,QACI,oBAAC,UAAU,EAAA,EACP,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EAAA,YAAA,EACG,4CAAS,EACpB,IAAI,EAAE,KAAC,CAAA,aAAA,CAAA,6BAA6B,EAAC,EAAA,SAAS,EAAE,MAAM,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;;;;"}
|
package/moderncssm/components/actions-control/components/restore-button/restore-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore-button.js","sources":["../../../../../src/components/actions-control/components/restore-button/restore-button.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowsCwCompactMIcon from '@alfalab/icons-glyph/ArrowsCwCompactMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const RestoreButton = () => {\n const { id = '0', disableButtons, onRestore } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEjF,MAAM,aAAa,GAAG,MAAK;
|
|
1
|
+
{"version":3,"file":"restore-button.js","sources":["../../../../../src/components/actions-control/components/restore-button/restore-button.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport ArrowsCwCompactMIcon from '@alfalab/icons-glyph/ArrowsCwCompactMIcon';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from '../../actions-control.module.css';\n\nexport const RestoreButton = () => {\n const { id = '0', disableButtons, onRestore } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;AASO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEjF,MAAM,aAAa,GAAG,MAAK;QACvB,IAAI,SAAS,EAAE;YACX,SAAS,CAAC,EAAE,CAAC;;AAErB,KAAC;AAED,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,UAAU,EACP,EAAA,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EACG,YAAA,EAAA,0EAAc,EACzB,IAAI,EAAE,KAAC,CAAA,aAAA,CAAA,oBAAoB,IAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAI,CAAA,EAClE,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,aAAa,EAAA,CACxB;AAEV;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-error.js","sources":["../../../../../src/components/content/components/content-error/content-error.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from './content-error.module.css';\n\nexport const ContentError = () => {\n const { error } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;AAQO,MAAM,YAAY,GAAG,MAAK;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,QACI,oBAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAC7E,EAAA,KAAK,CACO
|
|
1
|
+
{"version":3,"file":"content-error.js","sources":["../../../../../src/components/content/components/content-error/content-error.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } from '../../../../context/file-upload-item-context';\n\nimport styles from './content-error.module.css';\n\nexport const ContentError = () => {\n const { error } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;AAQO,MAAM,YAAY,GAAG,MAAK;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAEnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,QACI,oBAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,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,QACI,KACK,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACZ,KAAA,CAAA,aAAA,CAAC,cAAc,EACX,EAAA,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,UAAU,IAEf,IAAI,CACQ,CACpB,CAAC,CACA;;AAId,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,IAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,yIAAA,CAEjE;AAEzB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-subtitle.js","sources":["../../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React, { useContext } 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 { FileUploadItemContext } 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 useContext(FileUploadItemContext);\n\n const shouldShownError = isErrorStatus(uploadStatus) || isError(error);\n const showMeta =\n !showRestore && (isSuccessStatus(uploadStatus) || isUploadedStatus(uploadStatus));\n\n // валидация progressBar (не должен превышать 100 и быть меньше 0)\n const validateProgressBarValue = (progressValue: number | undefined) => {\n if (progressValue === undefined) {\n return 0;\n }\n\n return Math.min(Math.max(progressValue, 0), MAX_PROGRESS_BAR_VALUE);\n };\n\n const validProgressBar = validateProgressBarValue(progressBar);\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":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GACzF,UAAU,CAAC,qBAAqB,CAAC;IAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;AACtE,IAAA,MAAM,QAAQ,GACV,CAAC,WAAW,KAAK,eAAe,CAAC,YAAY,CAAC,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC;;AAGrF,IAAA,MAAM,wBAAwB,GAAG,CAAC,aAAiC,KAAI;
|
|
1
|
+
{"version":3,"file":"content-subtitle.js","sources":["../../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React, { useContext } 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 { FileUploadItemContext } 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 useContext(FileUploadItemContext);\n\n const shouldShownError = isErrorStatus(uploadStatus) || isError(error);\n const showMeta =\n !showRestore && (isSuccessStatus(uploadStatus) || isUploadedStatus(uploadStatus));\n\n // валидация progressBar (не должен превышать 100 и быть меньше 0)\n const validateProgressBarValue = (progressValue: number | undefined) => {\n if (progressValue === undefined) {\n return 0;\n }\n\n return Math.min(Math.max(progressValue, 0), MAX_PROGRESS_BAR_VALUE);\n };\n\n const validProgressBar = validateProgressBarValue(progressBar);\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":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GACzF,UAAU,CAAC,qBAAqB,CAAC;IAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;AACtE,IAAA,MAAM,QAAQ,GACV,CAAC,WAAW,KAAK,eAAe,CAAC,YAAY,CAAC,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC;;AAGrF,IAAA,MAAM,wBAAwB,GAAG,CAAC,aAAiC,KAAI;AACnE,QAAA,IAAI,aAAa,KAAK,SAAS,EAAE;AAC7B,YAAA,OAAO,CAAC;;AAGZ,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,sBAAsB,CAAC;AACvE,KAAC;AAED,IAAA,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,WAAW,CAAC;;AAG9D,IAAA,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,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,OAAO,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,IAAA,CAAG;;;IAI3B,IAAI,QAAQ,EAAE;AACV,QAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YACK,IAAI,KACD,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA,EACzE,aAAa,CAAC,IAAI,CAAC,CACP,CACpB;AACA,YAAA,UAAU,KACP,KAAA,CAAA,aAAA,CAAC,cAAc,EAAC,EAAA,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EACjD,EAAA,UAAU,CACE,CACpB,CACC;;;IAKd,IAAI,WAAW,EAAE;AACb,QAAA,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,+DAAA,CAEpC;;IAIzB,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,EACX,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE;AAC3B,YAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC9B,SAAA,CAAC,EACF,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,WAAW,EAEhB,EAAA,QAAQ,CACI;AAEzB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../../src/components/content/content.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;;AAWO,MAAM,OAAO,GAAG,MAAK;IACxB,MAAM,EACF,KAAK,EACL,aAAa,EAAE,aAAa,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,GACd,GAAG,UAAU,CAAC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../../src/components/content/content.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { FileUploadItemContext } 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 } = useContext(FileUploadItemContext);\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":[],"mappings":";;;;;;;AAWO,MAAM,OAAO,GAAG,MAAK;IACxB,MAAM,EACF,KAAK,EACL,aAAa,EAAE,aAAa,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,GACd,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAErC,IAAI,aAAa,EAAE;QACf,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG;;IAG5B,QACI,6BACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;AAC5B,YAAA,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,QAAQ;YAC1B,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,cAAc,IAAI,WAAW;SACrD,CAAC,EAAA;AAED,QAAA,KAAK,KACF,KAAC,CAAA,aAAA,CAAA,cAAc,EACX,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;AACxB,gBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC3B,gBAAA,CAAC,MAAM,CAAC,OAAO,GAAG,WAAW;aAChC,CAAC,EACF,IAAI,EAAC,mBAAmB,EACxB,KAAK,EAAC,SAAS,EAAA,EAEd,KAAK,CACO,CACpB;AACD,QAAA,KAAA,CAAA,aAAA,CAAC,eAAe,EAAA,IAAA,CAAG,CACjB;AAEd;;;;"}
|