@alfalab/core-components-file-upload-item 8.2.6 → 8.2.7
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.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-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/actions-control/components/reupload-button/index.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-error/content-error.module.css.js.map +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 +6 -6
- 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.map +1 -1
- package/components/status-control/index.module.css.js +1 -1
- package/components/status-control/index.module.css.js.map +1 -1
- package/components/status-control/progress-bar/index.js.map +1 -1
- package/const/progress-bar.js.map +1 -1
- package/context/file-upload-item-context.js.map +1 -1
- package/context/use-context-value.js.map +1 -1
- package/cssm/Component.js.map +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/actions-control/components/reupload-button/index.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/components/status-control/index.js.map +1 -1
- package/cssm/components/status-control/progress-bar/index.js.map +1 -1
- package/cssm/const/progress-bar.js.map +1 -1
- package/cssm/context/file-upload-item-context.js.map +1 -1
- package/cssm/context/use-context-value.js.map +1 -1
- package/cssm/utils.js.map +1 -1
- 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-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/actions-control/components/reupload-button/index.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-error/content-error.module.css.js.map +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 +6 -6
- 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.map +1 -1
- 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/components/status-control/progress-bar/index.js.map +1 -1
- package/esm/const/progress-bar.js.map +1 -1
- package/esm/context/file-upload-item-context.js.map +1 -1
- package/esm/context/use-context-value.js.map +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/utils.js.map +1 -1
- package/index.css +2 -2
- package/index.module.css.js +1 -1
- package/index.module.css.js.map +1 -1
- 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-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/actions-control/components/reupload-button/index.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-error/content-error.module.css.js.map +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 +6 -6
- 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.map +1 -1
- 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/components/status-control/progress-bar/index.js.map +1 -1
- package/modern/const/progress-bar.js.map +1 -1
- package/modern/context/file-upload-item-context.js.map +1 -1
- package/modern/context/use-context-value.js.map +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/utils.js.map +1 -1
- package/moderncssm/Component.js.map +1 -1
- 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/actions-control/components/reupload-button/index.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/components/status-control/index.js.map +1 -1
- package/moderncssm/components/status-control/progress-bar/index.js.map +1 -1
- package/moderncssm/const/progress-bar.js.map +1 -1
- package/moderncssm/context/file-upload-item-context.js.map +1 -1
- package/moderncssm/context/use-context-value.js.map +1 -1
- package/moderncssm/utils.js.map +1 -1
- package/package.json +3 -3
- package/utils.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
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 {\n uploadStatus,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n truncate,\n showRestore,\n error,\n 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 !== undefined && 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={subtitleColor}\n >\n {subtitle}\n </TypographyText>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EACF,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,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,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,sBAAsB,CAAC;;AAGxF,IAAA,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACI,
|
|
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 {\n uploadStatus,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n truncate,\n showRestore,\n error,\n 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 !== undefined && 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={subtitleColor}\n >\n {subtitle}\n </TypographyText>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EACF,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,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,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,sBAAsB,CAAC;;AAGxF,IAAA,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA;;YACxC,QAAQ;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;AAChB,YAAA,GAAA,CAAA;IAEzB;;IAGA,IAAI,gBAAgB,EAAE;QAClB,OAAO,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,IAAA,CAAG;IAC3B;;IAGA,IAAI,QAAQ,EAAE;AACV,QAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;AACK,YAAA,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,KAC9B,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,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA,EACjD,UAAU,CACE,CACpB,CACC;IAEd;;IAGA,IAAI,WAAW,EAAE;AACb,QAAA,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,+DAAA,CAEpC;IAEzB;IAEA,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACX,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,EAAE,aAAa,EAAA,EAEnB,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_12hn7","truncate":"file-upload-item__truncate_12hn7","size":"file-upload-item__size_12hn7"};
|
|
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/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
|
|
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;;"}
|
|
@@ -6,34 +6,34 @@
|
|
|
6
6
|
--gap-4: 4px;
|
|
7
7
|
--gap-16: 16px;
|
|
8
8
|
}
|
|
9
|
-
.file-upload-
|
|
9
|
+
.file-upload-item__container_1j6lu {
|
|
10
10
|
padding: var(--gap-2) 0 0 var(--gap-16);
|
|
11
11
|
flex-grow: 1;
|
|
12
12
|
min-width: 0;
|
|
13
13
|
}
|
|
14
|
-
.file-upload-
|
|
14
|
+
.file-upload-item__container_1j6lu.file-upload-item__clickable_1j6lu {
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
}
|
|
17
|
-
.file-upload-
|
|
17
|
+
.file-upload-item__container_1j6lu.file-upload-item__single_1j6lu {
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
justify-content: center;
|
|
21
21
|
padding-top: 0;
|
|
22
22
|
min-height: 48px;
|
|
23
23
|
}
|
|
24
|
-
.file-upload-
|
|
24
|
+
.file-upload-item__container_1j6lu.file-upload-item__single_1j6lu .file-upload-item__title_1j6lu {
|
|
25
25
|
margin-bottom: 0;
|
|
26
26
|
}
|
|
27
|
-
.file-upload-
|
|
27
|
+
.file-upload-item__container_1j6lu .file-upload-item__title_1j6lu {
|
|
28
28
|
margin-bottom: var(--gap-4);
|
|
29
29
|
display: block;
|
|
30
30
|
overflow-wrap: break-word;
|
|
31
31
|
}
|
|
32
|
-
.file-upload-
|
|
32
|
+
.file-upload-item__container_1j6lu .file-upload-item__title_1j6lu.file-upload-item__truncate_1j6lu {
|
|
33
33
|
white-space: nowrap;
|
|
34
34
|
overflow: hidden;
|
|
35
35
|
text-overflow: ellipsis;
|
|
36
36
|
}
|
|
37
|
-
.file-upload-
|
|
37
|
+
.file-upload-item__container_1j6lu .file-upload-item__title_1j6lu.file-upload-item__restore_1j6lu {
|
|
38
38
|
color: var(--color-light-text-tertiary);
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
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":[],"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,wBAAwB,EAAE;IAE9B,IAAI,aAAa,EAAE;QACf,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG
|
|
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":[],"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,wBAAwB,EAAE;IAE9B,IAAI,aAAa,EAAE;QACf,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG;IAC5B;IAEA,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,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACX,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_1j6lu","clickable":"file-upload-item__clickable_1j6lu","single":"file-upload-item__single_1j6lu","title":"file-upload-item__title_1j6lu","truncate":"file-upload-item__truncate_1j6lu","restore":"file-upload-item__restore_1j6lu"};
|
|
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/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
|
+
{"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":"
|
|
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":"AAAO,MAAM,OAAO,GAAG,CAAC,KAAyB,KAAI;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC/C,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1C,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,KAAK;AAChB;;"}
|
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
--color-light-decorative-orange: #fa9313;
|
|
9
9
|
--color-light-decorative-red: #fe5e48;
|
|
10
10
|
}
|
|
11
|
-
.file-upload-
|
|
11
|
+
.file-upload-item__iconPDFColored_1dzw8 {
|
|
12
12
|
fill: var(--color-light-decorative-red);
|
|
13
13
|
}
|
|
14
|
-
.file-upload-
|
|
14
|
+
.file-upload-item__iconDOCColored_1dzw8 {
|
|
15
15
|
fill: var(--color-light-decorative-blue);
|
|
16
16
|
}
|
|
17
|
-
.file-upload-
|
|
17
|
+
.file-upload-item__iconExcelColored_1dzw8 {
|
|
18
18
|
fill: var(--color-light-decorative-green);
|
|
19
19
|
}
|
|
20
|
-
.file-upload-
|
|
20
|
+
.file-upload-item__icon1CColored_1dzw8 {
|
|
21
21
|
fill: var(--color-light-decorative-orange);
|
|
22
22
|
}
|
|
23
|
-
.file-upload-
|
|
23
|
+
.file-upload-item__iconDocumentColored_1dzw8 {
|
|
24
24
|
fill: var(--color-light-neutral-translucent-1300);
|
|
25
25
|
}
|
|
26
|
-
.file-upload-
|
|
26
|
+
.file-upload-item__iconArchiveColored_1dzw8 {
|
|
27
27
|
fill: var(--color-light-status-attention);
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/extension-icon/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Document1CMIcon } from '@alfalab/icons-glyph/Document1CMIcon';\nimport { DocumentArchiveMIcon } from '@alfalab/icons-glyph/DocumentArchiveMIcon';\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 { useFileUploadItemContext } from '../../../context/file-upload-item-context';\nimport { getExtension, isInitialStatus } from '../../../utils';\n\nimport styles from './index.module.css';\n\n// eslint-disable-next-line complexity\nexport const ExtensionIcon = () => {\n const {\n title = '',\n uploadStatus,\n iconStyle,\n customIcon: CustomIcon,\n imageUrl,\n showRestore,\n } = useFileUploadItemContext();\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 case 'zip':\n case 'rar':\n case '7z':\n return (\n <DocumentArchiveMIcon\n className={cn({ [styles.iconArchiveColored]: isColoredIcon })}\n />\n );\n default:\n return (\n <DocumentMIcon className={cn({ [styles.iconDocumentColored]: isColoredIcon })} />\n );\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkBA;AACO,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,KAAK,GAAG,EAAE,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EAAE,UAAU,EACtB,QAAQ,EACR,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,IAAI
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/extension-icon/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Document1CMIcon } from '@alfalab/icons-glyph/Document1CMIcon';\nimport { DocumentArchiveMIcon } from '@alfalab/icons-glyph/DocumentArchiveMIcon';\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 { useFileUploadItemContext } from '../../../context/file-upload-item-context';\nimport { getExtension, isInitialStatus } from '../../../utils';\n\nimport styles from './index.module.css';\n\n// eslint-disable-next-line complexity\nexport const ExtensionIcon = () => {\n const {\n title = '',\n uploadStatus,\n iconStyle,\n customIcon: CustomIcon,\n imageUrl,\n showRestore,\n } = useFileUploadItemContext();\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 case 'zip':\n case 'rar':\n case '7z':\n return (\n <DocumentArchiveMIcon\n className={cn({ [styles.iconArchiveColored]: isColoredIcon })}\n />\n );\n default:\n return (\n <DocumentMIcon className={cn({ [styles.iconDocumentColored]: isColoredIcon })} />\n );\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkBA;AACO,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,KAAK,GAAG,EAAE,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EAAE,UAAU,EACtB,QAAQ,EACR,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,IAAI;IACf;IAEA,IAAI,UAAU,EAAE;QACZ,OAAO,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,IAAA,CAAG;IACzB;AAEA,IAAA,IAAI,eAAe,CAAC,YAAY,CAAC,EAAE;QAC/B,OAAO,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,IAAA,CAAG;IAC7B;IAEA,IAAI,WAAW,EAAE;QACb,OAAO,KAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,IAAA,CAAG;IAC/B;AAEA,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,KAAK,KAAK;AACV,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,IAAI;YACL,QACI,oBAAC,oBAAoB,EAAA,EACjB,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,kBAAkB,GAAG,aAAa,EAAE,CAAC,EAAA,CAC/D;AAEV,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_1dzw8","iconDOCColored":"file-upload-item__iconDOCColored_1dzw8","iconExcelColored":"file-upload-item__iconExcelColored_1dzw8","icon1CColored":"file-upload-item__icon1CColored_1dzw8","iconDocumentColored":"file-upload-item__iconDocumentColored_1dzw8","iconArchiveColored":"file-upload-item__iconArchiveColored_1dzw8"};
|
|
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/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\n.iconArchiveColored {\n fill: var(--color-light-status-attention);\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,oBAAoB,CAAC,4CAA4C,CAAC
|
|
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\n.iconArchiveColored {\n fill: var(--color-light-status-attention);\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,oBAAoB,CAAC,4CAA4C,CAAC;;"}
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
:root {
|
|
7
7
|
--gap-4-neg: -4px;
|
|
8
8
|
}
|
|
9
|
-
.file-upload-
|
|
9
|
+
.file-upload-item__container_1ao3t {
|
|
10
10
|
position: relative;
|
|
11
11
|
}
|
|
12
|
-
.file-upload-
|
|
12
|
+
.file-upload-item__container_1ao3t.file-upload-item__clickable_1ao3t {
|
|
13
13
|
cursor: pointer;
|
|
14
14
|
}
|
|
15
|
-
.file-upload-
|
|
15
|
+
.file-upload-item__container_1ao3t .file-upload-item__progress_1ao3t {
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: var(--gap-4-neg);
|
|
18
18
|
left: var(--gap-4-neg);
|
|
19
19
|
z-index: 1;
|
|
20
20
|
will-change: opacity;
|
|
21
21
|
}
|
|
22
|
-
.file-upload-
|
|
23
|
-
.file-upload-
|
|
22
|
+
.file-upload-item__container_1ao3t .file-upload-item__progress_1ao3t.file-upload-item__success_1ao3t,
|
|
23
|
+
.file-upload-item__container_1ao3t .file-upload-item__progress_1ao3t.file-upload-item__error_1ao3t {
|
|
24
24
|
transition: opacity 400ms ease-in;
|
|
25
25
|
opacity: 0;
|
|
26
26
|
}
|
|
27
|
-
.file-upload-
|
|
27
|
+
.file-upload-item__container_1ao3t .file-upload-item__progress_1ao3t.file-upload-item__success_1ao3t path {
|
|
28
28
|
stroke: var(--color-light-status-positive);
|
|
29
29
|
}
|
|
30
|
-
.file-upload-
|
|
30
|
+
.file-upload-item__container_1ao3t .file-upload-item__progress_1ao3t.file-upload-item__loading_1ao3t {
|
|
31
31
|
color: var(--color-light-neutral-500);
|
|
32
32
|
}
|
|
33
|
-
.file-upload-
|
|
33
|
+
.file-upload-item__container_1ao3t .file-upload-item__progress_1ao3t.file-upload-item__error_1ao3t path {
|
|
34
34
|
stroke: var(--color-light-status-negative);
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/status-control/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { SuperEllipse } from '@alfalab/core-components-icon-view/super-ellipse';\n\nimport { useFileUploadItemContext } from '../../context/file-upload-item-context';\nimport { isErrorStatus, isLoadingStatus, isSuccessStatus } from '../../utils';\n\nimport { ExtensionIcon } from './extension-icon';\nimport { ProgressBar } from './progress-bar';\n\nimport styles from './index.module.css';\n\nconst STROKE_DASHARRAY_TOTAL_LENGTH = 182.5742645263672;\n\nexport const StatusControl = () => {\n const {\n uploadStatus = 'INITIAL',\n progressBar = 0,\n progressBarAvailable = true,\n imageUrl,\n backgroundColor,\n actionsPresent,\n isClickable,\n } = useFileUploadItemContext();\n\n const measureDashoffset = STROKE_DASHARRAY_TOTAL_LENGTH * (1 - progressBar / 100);\n const strokeDashoffset = Math.max(measureDashoffset, 0);\n\n const hasFullStatus = isSuccessStatus(uploadStatus) || isErrorStatus(uploadStatus);\n\n return (\n <div\n className={cn(styles.container, {\n [styles.clickable]: !actionsPresent && isClickable,\n })}\n >\n <SuperEllipse\n backgroundColor={backgroundColor}\n size={48}\n {...(imageUrl && { imageUrl })}\n >\n <ExtensionIcon />\n </SuperEllipse>\n\n <ProgressBar\n className={cn(styles.progress, {\n [styles.loading]: !progressBarAvailable && isLoadingStatus(uploadStatus),\n [styles.error]: isErrorStatus(uploadStatus),\n [styles.success]: isSuccessStatus(uploadStatus),\n })}\n strokeDasharray={STROKE_DASHARRAY_TOTAL_LENGTH}\n strokeDashoffset={hasFullStatus ? 0 : strokeDashoffset}\n isIndeterminate={!progressBarAvailable && isLoadingStatus(uploadStatus)}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAaA,MAAM,6BAA6B,GAAG,iBAAiB;AAEhD,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,YAAY,GAAG,SAAS,EACxB,WAAW,GAAG,CAAC,EACf,oBAAoB,GAAG,IAAI,EAC3B,QAAQ,EACR,eAAe,EACf,cAAc,EACd,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,MAAM,iBAAiB,GAAG,6BAA6B,IAAI,CAAC,GAAG,WAAW,GAAG,GAAG,CAAC;IACjF,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAEvD,MAAM,aAAa,GAAG,eAAe,CAAC,YAAY,CAAC,IAAI,aAAa,CAAC,YAAY,CAAC;IAElF,QACI,6BACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;YAC5B,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,cAAc,IAAI,WAAW;SACrD,CAAC,EAAA;AAEF,QAAA,KAAA,CAAA,aAAA,CAAC,YAAY,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/status-control/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { SuperEllipse } from '@alfalab/core-components-icon-view/super-ellipse';\n\nimport { useFileUploadItemContext } from '../../context/file-upload-item-context';\nimport { isErrorStatus, isLoadingStatus, isSuccessStatus } from '../../utils';\n\nimport { ExtensionIcon } from './extension-icon';\nimport { ProgressBar } from './progress-bar';\n\nimport styles from './index.module.css';\n\nconst STROKE_DASHARRAY_TOTAL_LENGTH = 182.5742645263672;\n\nexport const StatusControl = () => {\n const {\n uploadStatus = 'INITIAL',\n progressBar = 0,\n progressBarAvailable = true,\n imageUrl,\n backgroundColor,\n actionsPresent,\n isClickable,\n } = useFileUploadItemContext();\n\n const measureDashoffset = STROKE_DASHARRAY_TOTAL_LENGTH * (1 - progressBar / 100);\n const strokeDashoffset = Math.max(measureDashoffset, 0);\n\n const hasFullStatus = isSuccessStatus(uploadStatus) || isErrorStatus(uploadStatus);\n\n return (\n <div\n className={cn(styles.container, {\n [styles.clickable]: !actionsPresent && isClickable,\n })}\n >\n <SuperEllipse\n backgroundColor={backgroundColor}\n size={48}\n {...(imageUrl && { imageUrl })}\n >\n <ExtensionIcon />\n </SuperEllipse>\n\n <ProgressBar\n className={cn(styles.progress, {\n [styles.loading]: !progressBarAvailable && isLoadingStatus(uploadStatus),\n [styles.error]: isErrorStatus(uploadStatus),\n [styles.success]: isSuccessStatus(uploadStatus),\n })}\n strokeDasharray={STROKE_DASHARRAY_TOTAL_LENGTH}\n strokeDashoffset={hasFullStatus ? 0 : strokeDashoffset}\n isIndeterminate={!progressBarAvailable && isLoadingStatus(uploadStatus)}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAaA,MAAM,6BAA6B,GAAG,iBAAiB;AAEhD,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,YAAY,GAAG,SAAS,EACxB,WAAW,GAAG,CAAC,EACf,oBAAoB,GAAG,IAAI,EAC3B,QAAQ,EACR,eAAe,EACf,cAAc,EACd,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,MAAM,iBAAiB,GAAG,6BAA6B,IAAI,CAAC,GAAG,WAAW,GAAG,GAAG,CAAC;IACjF,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAEvD,MAAM,aAAa,GAAG,eAAe,CAAC,YAAY,CAAC,IAAI,aAAa,CAAC,YAAY,CAAC;IAElF,QACI,6BACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;YAC5B,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,cAAc,IAAI,WAAW;SACrD,CAAC,EAAA;AAEF,QAAA,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,EACT,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,EAAE,EAAA,IACH,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAA;YAE9B,KAAA,CAAA,aAAA,CAAC,aAAa,OAAG,CACN;QAEf,KAAA,CAAA,aAAA,CAAC,WAAW,IACR,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAC3B,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,oBAAoB,IAAI,eAAe,CAAC,YAAY,CAAC;gBACxE,CAAC,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC,YAAY,CAAC;gBAC3C,CAAC,MAAM,CAAC,OAAO,GAAG,eAAe,CAAC,YAAY,CAAC;AAClD,aAAA,CAAC,EACF,eAAe,EAAE,6BAA6B,EAC9C,gBAAgB,EAAE,aAAa,GAAG,CAAC,GAAG,gBAAgB,EACtD,eAAe,EAAE,CAAC,oBAAoB,IAAI,eAAe,CAAC,YAAY,CAAC,EAAA,CACzE,CACA;AAEd;;"}
|
|
@@ -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_1ao3t","clickable":"file-upload-item__clickable_1ao3t","progress":"file-upload-item__progress_1ao3t","success":"file-upload-item__success_1ao3t","error":"file-upload-item__error_1ao3t","loading":"file-upload-item__loading_1ao3t"};
|
|
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/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
|
+
{"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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/progress-bar/index.tsx"],"sourcesContent":["import React, { type FC } from 'react';\n\nimport { useId } from '@alfalab/hooks';\n\ninterface ProgressBarProps {\n className: string;\n strokeDasharray: number;\n strokeDashoffset: number;\n strokeWidth?: number;\n stroke?: string;\n size?: number;\n isIndeterminate?: boolean;\n}\n\nexport const ProgressBar: FC<ProgressBarProps> = (props) => {\n const {\n className,\n size = 56,\n stroke = '#babbc2',\n strokeDasharray,\n strokeDashoffset = 0,\n strokeWidth = 2,\n isIndeterminate = false,\n } = props;\n\n const uniqId = useId();\n\n const spinnerDefs = (\n <defs>\n <linearGradient\n id={`spinner-gradient-${uniqId}`}\n x1='0%'\n y1='0%'\n x2='0%'\n y2='100%'\n gradientTransform='rotate(0)'\n >\n <stop offset='0%' stopColor={stroke} stopOpacity='0' />\n <stop offset='100%' stopColor={stroke} stopOpacity='1' />\n <animateTransform\n attributeName='gradientTransform'\n type='rotate'\n values='0 0.5 0.5;360 0.5 0.5'\n dur='2s'\n repeatCount='indefinite'\n />\n </linearGradient>\n </defs>\n );\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n {isIndeterminate && spinnerDefs}\n <path\n d='M28 1C32.7738 1 36.7752 1.34174 40.0029 1.80371C47.4798 2.87385 53.1262 8.52019 54.1963 15.9971C54.6583 19.2248 55 23.2262 55 28C55 32.7738 54.6583 36.7752 54.1963 40.0029C53.1262 47.4798 47.4798 53.1262 40.0029 54.1963C36.7752 54.6583 32.7738 55 28 55C23.2262 55 19.2248 54.6583 15.9971 54.1963C8.5202 53.1262 2.87385 47.4798 1.80371 40.0029C1.34175 36.7752 1 32.7738 1 28C1 23.2262 1.34174 19.2248 1.80371 15.9971C2.87385 8.5202 8.5202 2.87385 15.9971 1.80371C19.2248 1.34174 23.2262 1 28 1Z'\n stroke={isIndeterminate ? `url(#spinner-gradient-${uniqId})` : stroke}\n strokeWidth={strokeWidth}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={isIndeterminate ? 0 : strokeDashoffset}\n />\n </svg>\n );\n};\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/progress-bar/index.tsx"],"sourcesContent":["import React, { type FC } from 'react';\n\nimport { useId } from '@alfalab/hooks';\n\ninterface ProgressBarProps {\n className: string;\n strokeDasharray: number;\n strokeDashoffset: number;\n strokeWidth?: number;\n stroke?: string;\n size?: number;\n isIndeterminate?: boolean;\n}\n\nexport const ProgressBar: FC<ProgressBarProps> = (props) => {\n const {\n className,\n size = 56,\n stroke = '#babbc2',\n strokeDasharray,\n strokeDashoffset = 0,\n strokeWidth = 2,\n isIndeterminate = false,\n } = props;\n\n const uniqId = useId();\n\n const spinnerDefs = (\n <defs>\n <linearGradient\n id={`spinner-gradient-${uniqId}`}\n x1='0%'\n y1='0%'\n x2='0%'\n y2='100%'\n gradientTransform='rotate(0)'\n >\n <stop offset='0%' stopColor={stroke} stopOpacity='0' />\n <stop offset='100%' stopColor={stroke} stopOpacity='1' />\n <animateTransform\n attributeName='gradientTransform'\n type='rotate'\n values='0 0.5 0.5;360 0.5 0.5'\n dur='2s'\n repeatCount='indefinite'\n />\n </linearGradient>\n </defs>\n );\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n {isIndeterminate && spinnerDefs}\n <path\n d='M28 1C32.7738 1 36.7752 1.34174 40.0029 1.80371C47.4798 2.87385 53.1262 8.52019 54.1963 15.9971C54.6583 19.2248 55 23.2262 55 28C55 32.7738 54.6583 36.7752 54.1963 40.0029C53.1262 47.4798 47.4798 53.1262 40.0029 54.1963C36.7752 54.6583 32.7738 55 28 55C23.2262 55 19.2248 54.6583 15.9971 54.1963C8.5202 53.1262 2.87385 47.4798 1.80371 40.0029C1.34175 36.7752 1 32.7738 1 28C1 23.2262 1.34174 19.2248 1.80371 15.9971C2.87385 8.5202 8.5202 2.87385 15.9971 1.80371C19.2248 1.34174 23.2262 1 28 1Z'\n stroke={isIndeterminate ? `url(#spinner-gradient-${uniqId})` : stroke}\n strokeWidth={strokeWidth}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={isIndeterminate ? 0 : strokeDashoffset}\n />\n </svg>\n );\n};\n"],"names":[],"mappings":";;;AAcO,MAAM,WAAW,GAAyB,CAAC,KAAK,KAAI;IACvD,MAAM,EACF,SAAS,EACT,IAAI,GAAG,EAAE,EACT,MAAM,GAAG,SAAS,EAClB,eAAe,EACf,gBAAgB,GAAG,CAAC,EACpB,WAAW,GAAG,CAAC,EACf,eAAe,GAAG,KAAK,GAC1B,GAAG,KAAK;AAET,IAAA,MAAM,MAAM,GAAG,KAAK,EAAE;IAEtB,MAAM,WAAW,IACb,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA;QACI,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,EACI,EAAE,EAAE,CAAA,iBAAA,EAAoB,MAAM,CAAA,CAAE,EAChC,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,MAAM,EACT,iBAAiB,EAAC,WAAW,EAAA;YAE7B,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,MAAM,EAAC,IAAI,EAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAC,GAAG,EAAA,CAAG;YACvD,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,MAAM,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAC,GAAG,EAAA,CAAG;YACzD,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,EACI,aAAa,EAAC,mBAAmB,EACjC,IAAI,EAAC,QAAQ,EACb,MAAM,EAAC,uBAAuB,EAC9B,GAAG,EAAC,IAAI,EACR,WAAW,EAAC,YAAY,EAAA,CAC1B,CACW,CACd,CACV;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,CAAA,IAAA,EAAO,IAAI,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,EAC9B,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAAA;AAEjC,QAAA,eAAe,IAAI,WAAW;AAC/B,QAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACI,CAAC,EAAC,+eAA+e,EACjf,MAAM,EAAE,eAAe,GAAG,CAAA,sBAAA,EAAyB,MAAM,CAAA,CAAA,CAAG,GAAG,MAAM,EACrE,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,eAAe,GAAG,CAAC,GAAG,gBAAgB,EAAA,CAC1D,CACA;AAEd;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.js","sources":["../../src/const/progress-bar.ts"],"sourcesContent":["export const MAX_PROGRESS_BAR_VALUE = 100;\n"],"names":[],"mappings":"AAAO,MAAM,sBAAsB,GAAG
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sources":["../../src/const/progress-bar.ts"],"sourcesContent":["export const MAX_PROGRESS_BAR_VALUE = 100;\n"],"names":[],"mappings":"AAAO,MAAM,sBAAsB,GAAG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload-item-context.js","sources":["../../src/context/file-upload-item-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\ninterface ContextType\n extends Pick<\n FileUploadItemProps,\n | 'showRestore'\n | 'uploadStatus'\n | 'error'\n | 'title'\n | 'subtitle'\n | 'subtitleColor'\n | 'uploadDate'\n | 'size'\n | 'id'\n | 'onDownload'\n | 'onDelete'\n | 'onRestore'\n | 'downloadLink'\n | 'download'\n | 'disableButtons'\n | 'isClickable'\n | 'target'\n | 'showDelete'\n | 'customIcon'\n | 'iconStyle'\n | 'progressBar'\n | 'progressBarAvailable'\n | 'customContent'\n | 'truncate'\n | 'imageUrl'\n | 'backgroundColor'\n | 'reupload'\n > {\n actionsPresent?: boolean;\n}\n\nexport const FileUploadItemContext = createContext<ContextType>({});\n\nexport const useFileUploadItemContext = (): ContextType => useContext(FileUploadItemContext);\n"],"names":[],"mappings":";;MAsCa,qBAAqB,GAAG,aAAa,CAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"file-upload-item-context.js","sources":["../../src/context/file-upload-item-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\ninterface ContextType\n extends Pick<\n FileUploadItemProps,\n | 'showRestore'\n | 'uploadStatus'\n | 'error'\n | 'title'\n | 'subtitle'\n | 'subtitleColor'\n | 'uploadDate'\n | 'size'\n | 'id'\n | 'onDownload'\n | 'onDelete'\n | 'onRestore'\n | 'downloadLink'\n | 'download'\n | 'disableButtons'\n | 'isClickable'\n | 'target'\n | 'showDelete'\n | 'customIcon'\n | 'iconStyle'\n | 'progressBar'\n | 'progressBarAvailable'\n | 'customContent'\n | 'truncate'\n | 'imageUrl'\n | 'backgroundColor'\n | 'reupload'\n > {\n actionsPresent?: boolean;\n}\n\nexport const FileUploadItemContext = createContext<ContextType>({});\n\nexport const useFileUploadItemContext = (): ContextType => useContext(FileUploadItemContext);\n"],"names":[],"mappings":";;MAsCa,qBAAqB,GAAG,aAAa,CAAc,EAAE;AAE3D,MAAM,wBAAwB,GAAG,MAAmB,UAAU,CAAC,qBAAqB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-context-value.js","sources":["../../src/context/use-context-value.ts"],"sourcesContent":["import { type ContextType, useMemo } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\nimport { type FileUploadItemContext } from './file-upload-item-context';\n\ntype UseContextValueProps = Omit<FileUploadItemProps, 'className' | 'dataTestId' | 'children'>;\n\nexport const useContextValue = (\n props: UseContextValueProps,\n): ContextType<typeof FileUploadItemContext> => {\n const {\n id = '0',\n title = '',\n isClickable = true,\n iconStyle = 'gray',\n progressBar = 0,\n progressBarAvailable = true,\n showRestore,\n uploadStatus,\n error,\n subtitle,\n subtitleColor = 'secondary',\n uploadDate,\n size,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n target,\n showDelete,\n customIcon,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n reupload,\n } = props;\n\n const actionsPresent = Boolean(\n showRestore || downloadLink || showDelete || onDownload || reupload,\n );\n\n return useMemo(\n () => ({\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n }),\n [\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n ],\n );\n};\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"use-context-value.js","sources":["../../src/context/use-context-value.ts"],"sourcesContent":["import { type ContextType, useMemo } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\nimport { type FileUploadItemContext } from './file-upload-item-context';\n\ntype UseContextValueProps = Omit<FileUploadItemProps, 'className' | 'dataTestId' | 'children'>;\n\nexport const useContextValue = (\n props: UseContextValueProps,\n): ContextType<typeof FileUploadItemContext> => {\n const {\n id = '0',\n title = '',\n isClickable = true,\n iconStyle = 'gray',\n progressBar = 0,\n progressBarAvailable = true,\n showRestore,\n uploadStatus,\n error,\n subtitle,\n subtitleColor = 'secondary',\n uploadDate,\n size,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n target,\n showDelete,\n customIcon,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n reupload,\n } = props;\n\n const actionsPresent = Boolean(\n showRestore || downloadLink || showDelete || onDownload || reupload,\n );\n\n return useMemo(\n () => ({\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n }),\n [\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n ],\n );\n};\n"],"names":[],"mappings":";;AAQO,MAAM,eAAe,GAAG,CAC3B,KAA2B,KACgB;AAC3C,IAAA,MAAM,EACF,EAAE,GAAG,GAAG,EACR,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,IAAI,EAClB,SAAS,GAAG,MAAM,EAClB,WAAW,GAAG,CAAC,EACf,oBAAoB,GAAG,IAAI,EAC3B,WAAW,EACX,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,aAAa,GAAG,WAAW,EAC3B,UAAU,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,QAAQ,GACX,GAAG,KAAK;AAET,IAAA,MAAM,cAAc,GAAG,OAAO,CAC1B,WAAW,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,IAAI,QAAQ,CACtE;AAED,IAAA,OAAO,OAAO,CACV,OAAO;QACH,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,aAAa;QACb,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CAAC,EACF;QACI,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,aAAa;QACb,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CACJ;AACL;;"}
|
package/modern/index.css
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
--gap-2: 2px;
|
|
3
3
|
--gap-12: 12px;
|
|
4
4
|
}
|
|
5
|
-
.file-upload-
|
|
5
|
+
.file-upload-item__component_tskuc {
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: flex-start;
|
|
9
9
|
width: 100%;
|
|
10
10
|
min-height: 48px;
|
|
11
11
|
}
|
|
12
|
-
.file-upload-
|
|
12
|
+
.file-upload-item__restore_tskuc {
|
|
13
13
|
margin-left: var(--gap-12);
|
|
14
14
|
margin-top: var(--gap-2);
|
|
15
15
|
}
|
|
@@ -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_tskuc","restore":"file-upload-item__restore_tskuc"};
|
|
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/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
|
|
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/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { type FileUploadItemStatus } from './types/status';\n\nexport const getExtension = (filename: string) => filename.toLowerCase().split('.').pop();\n\nexport const isInitialStatus = (status?: FileUploadItemStatus) => status === 'INITIAL';\nexport const isSuccessStatus = (status?: FileUploadItemStatus) => status === 'SUCCESS';\nexport const isErrorStatus = (status?: FileUploadItemStatus) => status === 'ERROR';\nexport const isUploadingStatus = (status?: FileUploadItemStatus) => status === 'UPLOADING';\nexport const isUploadedStatus = (status?: FileUploadItemStatus) => status === 'UPLOADED';\nexport const isLoadingStatus = (status?: FileUploadItemStatus) => status === 'LOADING';\n"],"names":[],"mappings":"MAEa,YAAY,GAAG,CAAC,QAAgB,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;AAEhF,MAAM,eAAe,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACtE,MAAM,eAAe,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACtE,MAAM,aAAa,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACpE,MAAM,iBAAiB,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACxE,MAAM,gBAAgB,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACvE,MAAM,eAAe,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { type FileUploadItemStatus } from './types/status';\n\nexport const getExtension = (filename: string) => filename.toLowerCase().split('.').pop();\n\nexport const isInitialStatus = (status?: FileUploadItemStatus) => status === 'INITIAL';\nexport const isSuccessStatus = (status?: FileUploadItemStatus) => status === 'SUCCESS';\nexport const isErrorStatus = (status?: FileUploadItemStatus) => status === 'ERROR';\nexport const isUploadingStatus = (status?: FileUploadItemStatus) => status === 'UPLOADING';\nexport const isUploadedStatus = (status?: FileUploadItemStatus) => status === 'UPLOADED';\nexport const isLoadingStatus = (status?: FileUploadItemStatus) => status === 'LOADING';\n"],"names":[],"mappings":"MAEa,YAAY,GAAG,CAAC,QAAgB,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;AAEhF,MAAM,eAAe,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACtE,MAAM,eAAe,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACtE,MAAM,aAAa,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACpE,MAAM,iBAAiB,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACxE,MAAM,gBAAgB,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;AACvE,MAAM,eAAe,GAAG,CAAC,MAA6B,KAAK,MAAM,KAAK;;"}
|
|
@@ -1 +1 @@
|
|
|
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":[],"mappings":";;;;;;;;;
|
|
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":[],"mappings":";;;;;;;;;AAYO,MAAM,uBAAuB,GAA4B,CAAC,EAC7D,SAAS,EACT,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,GAAG,IAAI,EACV,KAAI;IACD,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC;IAE/D,QACI,6BACI,SAAS,EAAE,EAAE,CACT,SAAS,EACT,MAAM,CAAC,SAAS,EAChB,YAAY,IAAI,MAAM,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC,CAC3D,EAAA,cAAA,EACa,UAAU,EAAA;AAExB,QAAA,KAAA,CAAA,aAAA,CAAC,qBAAqB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,EAC9C,QAAQ,CACoB,CAC/B;AAEd;MAEa,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE;IACjE,aAAa;IACb,OAAO;IACP,OAAO;AACV,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
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":[],"mappings":";;;;;;;;AAWO,MAAM,OAAO,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,GACjE,wBAAwB,EAAE;AAE9B,IAAA,QACI,
|
|
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":[],"mappings":";;;;;;;;AAWO,MAAM,OAAO,GAAG,MAAK;AACxB,IAAA,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,GACjE,wBAAwB,EAAE;AAE9B,IAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,SAAS,EAAA;QAC3B,WAAW,IAAI,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG;QAEhC,CAAC,YAAY,IAAI,UAAU,KAAK,CAAC,WAAW,IAAI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,IAAA,CAAG;QAElE,QAAQ,IAAI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,IAAA,CAAG;QAE9B,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 } 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":[],"mappings":";;;;;;AASO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,wBAAwB,EAAE;AAEzE,IAAA,MAAM,YAAY,GAAG,CAAC,CAA0B,KAAI;QAChD,IAAI,QAAQ,EAAE;AACV,YAAA,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC
|
|
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":[],"mappings":";;;;;;AASO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,wBAAwB,EAAE;AAEzE,IAAA,MAAM,YAAY,GAAG,CAAC,CAA0B,KAAI;QAChD,IAAI,QAAQ,EAAE;AACV,YAAA,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QACnB;AACJ,IAAA,CAAC;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACP,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EAAA,YAAA,EACG,4CAAS,EACpB,IAAI,EAAE,KAAA,CAAA,aAAA,CAAC,UAAU,IAAC,SAAS,EAAE,MAAM,CAAC,eAAe,EAAA,CAAI,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 } 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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;AAC/B,IAAA,MAAM,EACF,EAAE,GAAG,GAAG,EACR,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,GACb,GAAG,wBAAwB,EAAE;AAE9B,IAAA,MAAM,cAAc,GAAG,CAAC,CAA0B,KAAI;QAClD,IAAI,UAAU,EAAE;YACZ,CAAC,CAAC,cAAc,EAAE;YAClB,UAAU,CAAC,EAAE,CAAC
|
|
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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;AAC/B,IAAA,MAAM,EACF,EAAE,GAAG,GAAG,EACR,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,GACb,GAAG,wBAAwB,EAAE;AAE9B,IAAA,MAAM,cAAc,GAAG,CAAC,CAA0B,KAAI;QAClD,IAAI,UAAU,EAAE;YACZ,CAAC,CAAC,cAAc,EAAE;YAClB,UAAU,CAAC,EAAE,CAAC;QAClB;AACJ,IAAA,CAAC;IAED,QACI,oBAAC,UAAU,EAAA,EACP,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EAAA,YAAA,EACG,4CAAS,EACpB,IAAI,EAAE,KAAA,CAAA,aAAA,CAAC,6BAA6B,EAAA,EAAC,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,EAAA,CACzB;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 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":[],"mappings":";;;;;;AASO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,wBAAwB,EAAE;IAE1E,MAAM,aAAa,GAAG,MAAK;QACvB,IAAI,SAAS,EAAE;YACX,SAAS,CAAC,EAAE,CAAC
|
|
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":[],"mappings":";;;;;;AASO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,wBAAwB,EAAE;IAE1E,MAAM,aAAa,GAAG,MAAK;QACvB,IAAI,SAAS,EAAE;YACX,SAAS,CAAC,EAAE,CAAC;QACjB;AACJ,IAAA,CAAC;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACP,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EAAA,YAAA,EACG,0EAAc,EACzB,IAAI,EAAE,KAAA,CAAA,aAAA,CAAC,oBAAoB,IAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAA,CAAI,EAClE,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,aAAa,EAAA,CACxB;AAEV;;"}
|
|
@@ -1 +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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;AAC/B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,wBAAwB,EAAE;IAEzE,MAAM,WAAW,GAAG,MAAK;AACrB,QAAA,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAC9B,YAAA,QAAQ,CAAC,OAAO,GAAG,EAAE,CAAC
|
|
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":[],"mappings":";;;;;;AASO,MAAM,cAAc,GAAG,MAAK;AAC/B,IAAA,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,wBAAwB,EAAE;IAEzE,MAAM,WAAW,GAAG,MAAK;AACrB,QAAA,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAC9B,YAAA,QAAQ,CAAC,OAAO,GAAG,EAAE,CAAC;QAC1B;AACJ,IAAA,CAAC;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACP,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAE,EAAE,EAAA,YAAA,EACG,yGAAoB,EAC/B,IAAI,EAAE,KAAA,CAAA,aAAA,CAAC,oBAAoB,IAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAA,CAAI,EAClE,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,WAAW,EAAA,CACtB;AAEV;;"}
|
|
@@ -1 +1 @@
|
|
|
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":[],"mappings":";;;;;AAQO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,wBAAwB,EAAE;IAE5C,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,
|
|
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":[],"mappings":";;;;;AAQO,MAAM,YAAY,GAAG,MAAK;AAC7B,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,wBAAwB,EAAE;IAE5C,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,EAAA,EAC7E,KAAK,CACO;IAEzB;AAEA,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1C,QAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EACK,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACZ,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACX,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,UAAU,IAEf,IAAI,CACQ,CACpB,CAAC,CACA;IAEd;AAEA,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,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 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 {\n uploadStatus,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n truncate,\n showRestore,\n error,\n 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 !== undefined && 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={subtitleColor}\n >\n {subtitle}\n </TypographyText>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EACF,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,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,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,sBAAsB,CAAC;;AAGxF,IAAA,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACI,
|
|
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 {\n uploadStatus,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n truncate,\n showRestore,\n error,\n 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 !== undefined && 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={subtitleColor}\n >\n {subtitle}\n </TypographyText>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EACF,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,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,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,sBAAsB,CAAC;;AAGxF,IAAA,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA;;YACxC,QAAQ;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;AAChB,YAAA,GAAA,CAAA;IAEzB;;IAGA,IAAI,gBAAgB,EAAE;QAClB,OAAO,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,IAAA,CAAG;IAC3B;;IAGA,IAAI,QAAQ,EAAE;AACV,QAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;AACK,YAAA,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,KAC9B,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,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA,EACjD,UAAU,CACE,CACpB,CACC;IAEd;;IAGA,IAAI,WAAW,EAAE;AACb,QAAA,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,+DAAA,CAEpC;IAEzB;IAEA,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACX,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,EAAE,aAAa,EAAA,EAEnB,QAAQ,CACI;AAEzB;;"}
|
|
@@ -1 +1 @@
|
|
|
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":[],"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,wBAAwB,EAAE;IAE9B,IAAI,aAAa,EAAE;QACf,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG
|
|
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":[],"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,wBAAwB,EAAE;IAE9B,IAAI,aAAa,EAAE;QACf,OAAO,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,CAAG;IAC5B;IAEA,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,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACX,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 +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":"
|
|
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":"AAAO,MAAM,OAAO,GAAG,CAAC,KAAyB,KAAI;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC/C,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1C,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,KAAK;AAChB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/extension-icon/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Document1CMIcon } from '@alfalab/icons-glyph/Document1CMIcon';\nimport { DocumentArchiveMIcon } from '@alfalab/icons-glyph/DocumentArchiveMIcon';\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 { useFileUploadItemContext } from '../../../context/file-upload-item-context';\nimport { getExtension, isInitialStatus } from '../../../utils';\n\nimport styles from './index.module.css';\n\n// eslint-disable-next-line complexity\nexport const ExtensionIcon = () => {\n const {\n title = '',\n uploadStatus,\n iconStyle,\n customIcon: CustomIcon,\n imageUrl,\n showRestore,\n } = useFileUploadItemContext();\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 case 'zip':\n case 'rar':\n case '7z':\n return (\n <DocumentArchiveMIcon\n className={cn({ [styles.iconArchiveColored]: isColoredIcon })}\n />\n );\n default:\n return (\n <DocumentMIcon className={cn({ [styles.iconDocumentColored]: isColoredIcon })} />\n );\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkBA;AACO,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,KAAK,GAAG,EAAE,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EAAE,UAAU,EACtB,QAAQ,EACR,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,IAAI
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/status-control/extension-icon/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Document1CMIcon } from '@alfalab/icons-glyph/Document1CMIcon';\nimport { DocumentArchiveMIcon } from '@alfalab/icons-glyph/DocumentArchiveMIcon';\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 { useFileUploadItemContext } from '../../../context/file-upload-item-context';\nimport { getExtension, isInitialStatus } from '../../../utils';\n\nimport styles from './index.module.css';\n\n// eslint-disable-next-line complexity\nexport const ExtensionIcon = () => {\n const {\n title = '',\n uploadStatus,\n iconStyle,\n customIcon: CustomIcon,\n imageUrl,\n showRestore,\n } = useFileUploadItemContext();\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 case 'zip':\n case 'rar':\n case '7z':\n return (\n <DocumentArchiveMIcon\n className={cn({ [styles.iconArchiveColored]: isColoredIcon })}\n />\n );\n default:\n return (\n <DocumentMIcon className={cn({ [styles.iconDocumentColored]: isColoredIcon })} />\n );\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkBA;AACO,MAAM,aAAa,GAAG,MAAK;IAC9B,MAAM,EACF,KAAK,GAAG,EAAE,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EAAE,UAAU,EACtB,QAAQ,EACR,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,IAAI;IACf;IAEA,IAAI,UAAU,EAAE;QACZ,OAAO,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,IAAA,CAAG;IACzB;AAEA,IAAA,IAAI,eAAe,CAAC,YAAY,CAAC,EAAE;QAC/B,OAAO,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,IAAA,CAAG;IAC7B;IAEA,IAAI,WAAW,EAAE;QACb,OAAO,KAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,IAAA,CAAG;IAC/B;AAEA,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,KAAK,KAAK;AACV,QAAA,KAAK,KAAK;AACV,QAAA,KAAK,IAAI;YACL,QACI,oBAAC,oBAAoB,EAAA,EACjB,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,kBAAkB,GAAG,aAAa,EAAE,CAAC,EAAA,CAC/D;AAEV,QAAA;YACI,QACI,oBAAC,aAAa,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,mBAAmB,GAAG,aAAa,EAAE,CAAC,EAAA,CAAI;;AAGjG;;"}
|