@onewelcome/react-lib-components 6.6.0 → 6.7.1
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/dist/cjs/DataGrid/DataGrid.module.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell.module.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow.module.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.module.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeaderCell.module.cjs.js +1 -1
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.module.cjs.js +1 -1
- package/dist/cjs/Form/FileUpload/FileUpload.cjs.js +1 -1
- package/dist/cjs/Form/FileUpload/FileUpload.cjs.js.map +1 -1
- package/dist/cjs/Form/FileUpload/FileUpload.module.cjs.js +1 -1
- package/dist/cjs/Icon/Icon.cjs.js +1 -1
- package/dist/cjs/Icon/Icon.cjs.js.map +1 -1
- package/dist/cjs/Icon/Icon.module.cjs.js +1 -1
- package/dist/cjs/Layout/ContentHeader/ContentHeader.cjs.js +2 -0
- package/dist/cjs/Layout/ContentHeader/ContentHeader.cjs.js.map +1 -0
- package/dist/cjs/Layout/ContentHeader/ContentHeader.module.cjs.js +2 -0
- package/dist/cjs/Layout/ContentHeader/ContentHeader.module.cjs.js.map +1 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormSection/FormSection.cjs.js +2 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormSection/FormSection.cjs.js.map +1 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.cjs.js +2 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.cjs.js.map +1 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.cjs.js +2 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.cjs.js.map +1 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.cjs.js +2 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.cjs.js.map +1 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js +2 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js.map +1 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.module.cjs.js +2 -0
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.module.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/AlertContainer/AlertContainer.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/AlertContainer/AlertContainer.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/AlertContainer/AlertContainer.module.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/AlertContainer/AlertContainer.module.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/AlertItem/AlertItem.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/AlertItem/AlertItem.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/AlertItem/AlertItem.module.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/AlertItem/AlertItem.module.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/AlertProvider/AlertContext.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/AlertProvider/AlertContext.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/AlertProvider/AlertProvider.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/AlertProvider/AlertProvider.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Alert/useAlert.cjs.js +2 -0
- package/dist/cjs/Notifications/Alert/useAlert.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.cjs.js.map +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js.map +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js.map +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js.map +1 -1
- package/dist/cjs/Notifications/Snackbar/interfaces.cjs.js.map +1 -1
- package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js.map +1 -1
- package/dist/cjs/Pagination/Pagination.cjs.js +1 -1
- package/dist/cjs/Pagination/Pagination.cjs.js.map +1 -1
- package/dist/cjs/Pagination/Pagination.module.cjs.js +1 -1
- package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js +1 -1
- package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
- package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.cjs.js +2 -0
- package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.cjs.js.map +1 -0
- package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.cjs.js +2 -0
- package/dist/cjs/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.cjs.js.map +1 -0
- package/dist/cjs/src/components/Form/FileUpload/FileItem/FileItem.d.ts +10 -0
- package/dist/cjs/src/components/Form/FileUpload/FileUpload.d.ts +3 -0
- package/dist/cjs/src/components/Icon/Icon.d.ts +5 -1
- package/dist/cjs/src/components/Layout/ContentHeader/ContentHeader.d.ts +10 -0
- package/dist/cjs/src/components/Layout/ContentHeader/ContentHeader.test.d.ts +1 -0
- package/dist/cjs/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.d.ts +7 -0
- package/dist/cjs/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.test.d.ts +1 -0
- package/dist/cjs/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.d.ts +10 -0
- package/dist/cjs/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.test.d.ts +1 -0
- package/dist/cjs/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.d.ts +6 -0
- package/dist/cjs/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.test.d.ts +1 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertContainer/AlertContainer.d.ts +12 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertContainer/AlertContainer.test.d.ts +1 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.d.ts +4 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertItem/AlertItem.d.ts +22 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertItem/AlertItem.test.d.ts +1 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertProvider/AlertContext.d.ts +13 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertProvider/AlertProvider.d.ts +22 -0
- package/dist/cjs/src/components/Notifications/Alert/AlertProvider/AlertProvider.test.d.ts +1 -0
- package/dist/cjs/src/components/Notifications/Alert/useAlert.d.ts +7 -0
- package/dist/cjs/src/components/Notifications/Alert/useAlert.test.d.ts +1 -0
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +9 -0
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +6 -0
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +9 -0
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +9 -0
- package/dist/cjs/src/components/Notifications/Snackbar/interfaces.d.ts +18 -0
- package/dist/cjs/src/components/Notifications/Snackbar/useSnackbar.d.ts +3 -0
- package/dist/cjs/src/components/_BaseStyling_/BaseStyling.d.ts +40 -0
- package/dist/cjs/src/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.d.ts +8 -0
- package/dist/cjs/src/index.cjs.js +1 -1
- package/dist/cjs/src/index.d.ts +18 -0
- package/dist/esm/DataGrid/DataGrid.module.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridCell.module.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridRow.module.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.module.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeaderCell.module.esm.js +1 -1
- package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js +1 -1
- package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js.map +1 -1
- package/dist/esm/Form/FileUpload/FileItem/FileItem.module.esm.js +1 -1
- package/dist/esm/Form/FileUpload/FileUpload.esm.js +1 -1
- package/dist/esm/Form/FileUpload/FileUpload.esm.js.map +1 -1
- package/dist/esm/Form/FileUpload/FileUpload.module.esm.js +1 -1
- package/dist/esm/Icon/Icon.esm.js +1 -1
- package/dist/esm/Icon/Icon.esm.js.map +1 -1
- package/dist/esm/Icon/Icon.module.esm.js +1 -1
- package/dist/esm/Layout/ContentHeader/ContentHeader.esm.js +2 -0
- package/dist/esm/Layout/ContentHeader/ContentHeader.esm.js.map +1 -0
- package/dist/esm/Layout/ContentHeader/ContentHeader.module.esm.js +2 -0
- package/dist/esm/Layout/ContentHeader/ContentHeader.module.esm.js.map +1 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormSection/FormSection.esm.js +2 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormSection/FormSection.esm.js.map +1 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.esm.js +2 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.esm.js.map +1 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.esm.js +2 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.esm.js.map +1 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.esm.js +2 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.esm.js.map +1 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js +2 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js.map +1 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.module.esm.js +2 -0
- package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.module.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/AlertContainer/AlertContainer.esm.js +2 -0
- package/dist/esm/Notifications/Alert/AlertContainer/AlertContainer.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/AlertContainer/AlertContainer.module.esm.js +2 -0
- package/dist/esm/Notifications/Alert/AlertContainer/AlertContainer.module.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.esm.js +2 -0
- package/dist/esm/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/AlertItem/AlertItem.esm.js +2 -0
- package/dist/esm/Notifications/Alert/AlertItem/AlertItem.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/AlertItem/AlertItem.module.esm.js +2 -0
- package/dist/esm/Notifications/Alert/AlertItem/AlertItem.module.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/AlertProvider/AlertContext.esm.js +2 -0
- package/dist/esm/Notifications/Alert/AlertProvider/AlertContext.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/AlertProvider/AlertProvider.esm.js +2 -0
- package/dist/esm/Notifications/Alert/AlertProvider/AlertProvider.esm.js.map +1 -0
- package/dist/esm/Notifications/Alert/useAlert.esm.js +2 -0
- package/dist/esm/Notifications/Alert/useAlert.esm.js.map +1 -0
- package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.esm.js.map +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js.map +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js.map +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js.map +1 -1
- package/dist/esm/Notifications/Snackbar/interfaces.esm.js.map +1 -1
- package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js.map +1 -1
- package/dist/esm/Pagination/Pagination.esm.js +1 -1
- package/dist/esm/Pagination/Pagination.esm.js.map +1 -1
- package/dist/esm/Pagination/Pagination.module.esm.js +1 -1
- package/dist/esm/_BaseStyling_/BaseStyling.esm.js +1 -1
- package/dist/esm/_BaseStyling_/BaseStyling.esm.js.map +1 -1
- package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.esm.js +2 -0
- package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.esm.js.map +1 -0
- package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.esm.js +2 -0
- package/dist/esm/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.esm.js.map +1 -0
- package/dist/esm/src/components/Form/FileUpload/FileItem/FileItem.d.ts +10 -0
- package/dist/esm/src/components/Form/FileUpload/FileUpload.d.ts +3 -0
- package/dist/esm/src/components/Icon/Icon.d.ts +5 -1
- package/dist/esm/src/components/Layout/ContentHeader/ContentHeader.d.ts +10 -0
- package/dist/esm/src/components/Layout/ContentHeader/ContentHeader.test.d.ts +1 -0
- package/dist/esm/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.d.ts +7 -0
- package/dist/esm/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.test.d.ts +1 -0
- package/dist/esm/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.d.ts +10 -0
- package/dist/esm/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.test.d.ts +1 -0
- package/dist/esm/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.d.ts +6 -0
- package/dist/esm/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.test.d.ts +1 -0
- package/dist/esm/src/components/Notifications/Alert/AlertContainer/AlertContainer.d.ts +12 -0
- package/dist/esm/src/components/Notifications/Alert/AlertContainer/AlertContainer.test.d.ts +1 -0
- package/dist/esm/src/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.d.ts +4 -0
- package/dist/esm/src/components/Notifications/Alert/AlertItem/AlertItem.d.ts +22 -0
- package/dist/esm/src/components/Notifications/Alert/AlertItem/AlertItem.test.d.ts +1 -0
- package/dist/esm/src/components/Notifications/Alert/AlertProvider/AlertContext.d.ts +13 -0
- package/dist/esm/src/components/Notifications/Alert/AlertProvider/AlertProvider.d.ts +22 -0
- package/dist/esm/src/components/Notifications/Alert/AlertProvider/AlertProvider.test.d.ts +1 -0
- package/dist/esm/src/components/Notifications/Alert/useAlert.d.ts +7 -0
- package/dist/esm/src/components/Notifications/Alert/useAlert.test.d.ts +1 -0
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +9 -0
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +6 -0
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +9 -0
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +9 -0
- package/dist/esm/src/components/Notifications/Snackbar/interfaces.d.ts +18 -0
- package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.d.ts +3 -0
- package/dist/esm/src/components/_BaseStyling_/BaseStyling.d.ts +40 -0
- package/dist/esm/src/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.d.ts +8 -0
- package/dist/esm/src/index.d.ts +18 -0
- package/dist/esm/src/index.esm.js +1 -1
- package/package.json +1 -1
- package/src/components/DataGrid/DataGrid.module.scss +2 -2
- package/src/components/DataGrid/DataGridBody/DataGridCell.module.scss +7 -2
- package/src/components/DataGrid/DataGridBody/DataGridCell.tsx +1 -1
- package/src/components/DataGrid/DataGridBody/DataGridRow.module.scss +10 -0
- package/src/components/DataGrid/DataGridBody/__snapshots__/DataGridBody.test.tsx.snap +16 -16
- package/src/components/DataGrid/DataGridHeader/DataGridHeader.module.scss +0 -10
- package/src/components/DataGrid/DataGridHeader/DataGridHeader.tsx +1 -1
- package/src/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss +3 -3
- package/src/components/Form/FileUpload/FileItem/FileItem.module.scss +114 -3
- package/src/components/Form/FileUpload/FileItem/FileItem.tsx +154 -47
- package/src/components/Form/FileUpload/FileUpload.module.scss +73 -16
- package/src/components/Form/FileUpload/FileUpload.tsx +82 -53
- package/src/components/Form/FormSection/FormSection.module.scss +12 -0
- package/src/components/Icon/Icon.module.scss +16 -1
- package/src/components/Icon/Icon.tsx +5 -1
- package/src/components/Layout/ContentHeader/ContentHeader.module.scss +44 -0
- package/src/components/Layout/ContentHeader/ContentHeader.tsx +70 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss +12 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.tsx +53 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss +25 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.tsx +54 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss +39 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.tsx +34 -0
- package/src/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss +56 -0
- package/src/components/Notifications/Alert/AlertContainer/AlertContainer.tsx +52 -0
- package/src/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.ts +47 -0
- package/src/components/Notifications/Alert/AlertItem/AlertItem.module.scss +277 -0
- package/src/components/Notifications/Alert/AlertItem/AlertItem.tsx +214 -0
- package/src/components/Notifications/Alert/AlertProvider/AlertContext.ts +42 -0
- package/src/components/Notifications/Alert/AlertProvider/AlertProvider.tsx +173 -0
- package/src/components/Notifications/Alert/useAlert.ts +30 -0
- package/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.tsx +9 -0
- package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +6 -0
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +9 -0
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +9 -0
- package/src/components/Notifications/Snackbar/interfaces.ts +18 -0
- package/src/components/Notifications/Snackbar/useSnackbar.ts +3 -0
- package/src/components/Pagination/Pagination.module.scss +4 -6
- package/src/components/Pagination/Pagination.tsx +3 -1
- package/src/components/_BaseStyling_/BaseStyling.tsx +78 -1
- package/src/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss +25 -0
- package/src/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.tsx +47 -0
- package/src/font/icomoon.eot +0 -0
- package/src/font/icomoon.svg +3 -0
- package/src/font/icomoon.ttf +0 -0
- package/src/font/icomoon.woff +0 -0
- package/src/font/selection.json +1 -1
- package/src/index.ts +25 -0
- package/src/mixins.module.scss +7 -0
- package/src/variables.scss +1 -0
|
@@ -20,7 +20,8 @@ import { Typography } from "../../../Typography/Typography";
|
|
|
20
20
|
import { Icon, Icons } from "../../../Icon/Icon";
|
|
21
21
|
import { ProgressBar } from "../../../ProgressBar/ProgressBar";
|
|
22
22
|
import { FileType } from "../FileUpload";
|
|
23
|
-
|
|
23
|
+
import { Button } from "../../../Button/Button";
|
|
24
|
+
import { Link } from "../../../Link/Link";
|
|
24
25
|
export type UploadProgress = "uploading" | "completed" | "error" | "readonly" | "retry";
|
|
25
26
|
|
|
26
27
|
export interface Props extends ComponentPropsWithRef<"div"> {
|
|
@@ -28,61 +29,96 @@ export interface Props extends ComponentPropsWithRef<"div"> {
|
|
|
28
29
|
status?: UploadProgress;
|
|
29
30
|
progress?: number;
|
|
30
31
|
error?: string;
|
|
32
|
+
downloadFileLink?: string;
|
|
33
|
+
totalPercentage?: number;
|
|
31
34
|
onRequestedFileAction?: (action: FILE_ACTION, name: FileType["name"]) => void;
|
|
32
35
|
}
|
|
33
36
|
interface FileItemIcons {
|
|
34
37
|
fileIcon: Icons;
|
|
35
|
-
|
|
38
|
+
actionIcons?: { type: Icons; action: FILE_ACTION }[];
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
export enum FILE_ACTION {
|
|
39
42
|
DELETE = "delete",
|
|
43
|
+
DOWNLOAD = "download",
|
|
40
44
|
REMOVE = "remove",
|
|
41
45
|
ABORT = "abort",
|
|
42
46
|
RETRY = "retry"
|
|
43
47
|
}
|
|
44
48
|
|
|
49
|
+
export enum ACTION_STATUS {
|
|
50
|
+
COMPLETED = "completed",
|
|
51
|
+
UPLOADING = "uploading",
|
|
52
|
+
ERROR = "error",
|
|
53
|
+
RETRY = "retry",
|
|
54
|
+
READONLY = "readonly"
|
|
55
|
+
}
|
|
56
|
+
|
|
45
57
|
const FileItemComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
46
|
-
{
|
|
58
|
+
{
|
|
59
|
+
name,
|
|
60
|
+
status,
|
|
61
|
+
error,
|
|
62
|
+
progress,
|
|
63
|
+
downloadFileLink,
|
|
64
|
+
totalPercentage,
|
|
65
|
+
onRequestedFileAction
|
|
66
|
+
}: Props,
|
|
47
67
|
ref
|
|
48
68
|
) => {
|
|
49
69
|
const determineIcons = (status?: UploadProgress): FileItemIcons => {
|
|
50
70
|
switch (status) {
|
|
51
|
-
case
|
|
71
|
+
case ACTION_STATUS.COMPLETED:
|
|
52
72
|
return {
|
|
53
|
-
fileIcon: Icons.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
73
|
+
fileIcon: Icons.FileAltIcon,
|
|
74
|
+
actionIcons: [
|
|
75
|
+
{
|
|
76
|
+
type: Icons.Trash,
|
|
77
|
+
action: FILE_ACTION.DELETE
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: Icons.DownloadFile,
|
|
81
|
+
action: FILE_ACTION.DOWNLOAD
|
|
82
|
+
}
|
|
83
|
+
]
|
|
58
84
|
};
|
|
59
|
-
case
|
|
85
|
+
case ACTION_STATUS.ERROR:
|
|
60
86
|
return {
|
|
61
|
-
fileIcon: Icons.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
87
|
+
fileIcon: Icons.Error,
|
|
88
|
+
actionIcons: [
|
|
89
|
+
{
|
|
90
|
+
type: Icons.Times,
|
|
91
|
+
action: FILE_ACTION.REMOVE
|
|
92
|
+
}
|
|
93
|
+
]
|
|
66
94
|
};
|
|
67
|
-
case
|
|
95
|
+
case ACTION_STATUS.UPLOADING:
|
|
68
96
|
return {
|
|
69
|
-
fileIcon: Icons.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
97
|
+
fileIcon: Icons.FileAltIcon,
|
|
98
|
+
actionIcons: [
|
|
99
|
+
{
|
|
100
|
+
type: Icons.AbortFile,
|
|
101
|
+
action: FILE_ACTION.ABORT
|
|
102
|
+
}
|
|
103
|
+
]
|
|
74
104
|
};
|
|
75
|
-
case
|
|
105
|
+
case ACTION_STATUS.RETRY:
|
|
76
106
|
return {
|
|
77
|
-
fileIcon: Icons.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
fileIcon: Icons.FileAltIcon,
|
|
108
|
+
actionIcons: [
|
|
109
|
+
{
|
|
110
|
+
type: Icons.Refresh,
|
|
111
|
+
action: FILE_ACTION.RETRY
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: Icons.Trash,
|
|
115
|
+
action: FILE_ACTION.REMOVE
|
|
116
|
+
}
|
|
117
|
+
]
|
|
82
118
|
};
|
|
83
|
-
case
|
|
119
|
+
case ACTION_STATUS.READONLY:
|
|
84
120
|
default:
|
|
85
|
-
return { fileIcon: Icons.
|
|
121
|
+
return { fileIcon: Icons.FileAltIcon };
|
|
86
122
|
}
|
|
87
123
|
};
|
|
88
124
|
|
|
@@ -95,28 +131,104 @@ const FileItemComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
95
131
|
|
|
96
132
|
const { friendlyName, extension } = getFriendlyNameAndExtension(name);
|
|
97
133
|
|
|
98
|
-
|
|
99
|
-
<
|
|
134
|
+
const getStartIcon = (icon: { type: Icons; action: FILE_ACTION }) => (
|
|
135
|
+
<Icon
|
|
136
|
+
key={icon.action}
|
|
137
|
+
title={icon.action}
|
|
138
|
+
icon={icon.type}
|
|
139
|
+
className={classes["action-icon"]}
|
|
140
|
+
></Icon>
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const renderActionIcons = (
|
|
144
|
+
actionIcons: { type: Icons; action: FILE_ACTION }[],
|
|
145
|
+
status: UploadProgress = ACTION_STATUS.UPLOADING
|
|
146
|
+
) => {
|
|
147
|
+
return actionIcons.map(icon => (
|
|
148
|
+
<>
|
|
149
|
+
{icon.action !== FILE_ACTION.DOWNLOAD && (
|
|
150
|
+
<Button
|
|
151
|
+
color="primary"
|
|
152
|
+
startIcon={getStartIcon(icon)}
|
|
153
|
+
title={icon.action !== FILE_ACTION.ABORT ? icon.action : ""}
|
|
154
|
+
type="button"
|
|
155
|
+
variant="text"
|
|
156
|
+
onClick={() =>
|
|
157
|
+
icon && onRequestedFileAction && onRequestedFileAction(icon.action, name)
|
|
158
|
+
}
|
|
159
|
+
>
|
|
160
|
+
{icon.action !== FILE_ACTION.ABORT ? icon.action : ""}
|
|
161
|
+
</Button>
|
|
162
|
+
)}
|
|
163
|
+
|
|
164
|
+
{icon.action === FILE_ACTION.DOWNLOAD && downloadFileLink && (
|
|
165
|
+
<Link
|
|
166
|
+
color="primary"
|
|
167
|
+
display="link"
|
|
168
|
+
to={downloadFileLink}
|
|
169
|
+
type="download"
|
|
170
|
+
target="_blank"
|
|
171
|
+
prefixIcon={
|
|
172
|
+
<Icon
|
|
173
|
+
key={icon.action}
|
|
174
|
+
className={classes["action-icon"]}
|
|
175
|
+
title={icon.action}
|
|
176
|
+
icon={icon.type}
|
|
177
|
+
></Icon>
|
|
178
|
+
}
|
|
179
|
+
>
|
|
180
|
+
{icon.action}
|
|
181
|
+
</Link>
|
|
182
|
+
)}
|
|
183
|
+
</>
|
|
184
|
+
));
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const getUploadedFileInfo = () => {
|
|
188
|
+
return (
|
|
100
189
|
<Typography
|
|
101
190
|
variant={"body"}
|
|
102
191
|
title={name}
|
|
103
192
|
className={`${classes["file-name"]} ${status ? classes[status] : ""}`}
|
|
104
193
|
>
|
|
105
|
-
|
|
106
|
-
<span className={classes["friendly-name"]}>{friendlyName}</span>.<span>{extension}</span>
|
|
107
|
-
{icons.actionIcon && (
|
|
194
|
+
{status === "retry" && (
|
|
108
195
|
<Icon
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
className={classes["action-icon"]}
|
|
112
|
-
onClick={() =>
|
|
113
|
-
icons.actionIcon &&
|
|
114
|
-
onRequestedFileAction &&
|
|
115
|
-
onRequestedFileAction(icons.actionIcon.action, name)
|
|
116
|
-
}
|
|
196
|
+
icon={Icons.Error}
|
|
197
|
+
className={`${classes["file-icon"]} ${status ? classes[status] : ""}`}
|
|
117
198
|
/>
|
|
118
199
|
)}
|
|
200
|
+
<Icon icon={icons.fileIcon} className={classes["file-icon"]} />
|
|
201
|
+
<span className={classes["friendly-name"]}>{friendlyName}</span>.<span>{extension}</span>
|
|
119
202
|
</Typography>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const getProgressBar = () => {
|
|
207
|
+
return (
|
|
208
|
+
<ProgressBar
|
|
209
|
+
className={classes["progress-bar"]}
|
|
210
|
+
completed={progress}
|
|
211
|
+
label={`${friendlyName}.${extension}`}
|
|
212
|
+
percentage={totalPercentage}
|
|
213
|
+
/>
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
<div ref={ref} className={classes["file-item-wrapper"]} aria-label={`${name}-wrapper`}>
|
|
219
|
+
<div className={classes["file-list-container"]}>
|
|
220
|
+
{status !== ACTION_STATUS.UPLOADING && getUploadedFileInfo()}
|
|
221
|
+
|
|
222
|
+
<div
|
|
223
|
+
className={`${status === ACTION_STATUS.UPLOADING ? classes["progress-with-action"] : ""}`}
|
|
224
|
+
>
|
|
225
|
+
{status === ACTION_STATUS.UPLOADING && getProgressBar()}
|
|
226
|
+
|
|
227
|
+
<div className={classes["action-button-wrapper"]}>
|
|
228
|
+
{icons.actionIcons && renderActionIcons(icons.actionIcons, status)}
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
120
232
|
{error && (
|
|
121
233
|
<Typography
|
|
122
234
|
variant={"sub-text"}
|
|
@@ -125,11 +237,6 @@ const FileItemComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
125
237
|
{error}
|
|
126
238
|
</Typography>
|
|
127
239
|
)}
|
|
128
|
-
{status === "uploading" ? (
|
|
129
|
-
<ProgressBar className={classes["progress-bar"]} completed={progress} />
|
|
130
|
-
) : (
|
|
131
|
-
""
|
|
132
|
-
)}
|
|
133
240
|
</div>
|
|
134
241
|
);
|
|
135
242
|
};
|
|
@@ -24,25 +24,27 @@
|
|
|
24
24
|
.file-dropzone {
|
|
25
25
|
border-radius: var(--input-border-radius);
|
|
26
26
|
background-color: var(--input-background-color);
|
|
27
|
-
padding: 1.25rem;
|
|
27
|
+
padding: 0.25rem 1.25rem;
|
|
28
28
|
position: relative;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var(--input-border-width),
|
|
35
|
-
var(--input-border-radius),
|
|
36
|
-
var(--drag-background-color)
|
|
37
|
-
);
|
|
38
|
-
@include outlineStates;
|
|
29
|
+
|
|
30
|
+
.file-upload-title {
|
|
31
|
+
margin: 0 0 0.25rem 0;
|
|
32
|
+
font-size: 0.875rem;
|
|
33
|
+
font-weight: 400;
|
|
39
34
|
}
|
|
35
|
+
|
|
36
|
+
@include transition(all, 0.2s, ease-in-out);
|
|
40
37
|
&.error {
|
|
41
38
|
span[data-icon-status],
|
|
42
39
|
.file-upload-title {
|
|
43
40
|
color: var(--error);
|
|
44
41
|
}
|
|
42
|
+
|
|
43
|
+
.file-select {
|
|
44
|
+
border-color: var(--error);
|
|
45
|
+
}
|
|
45
46
|
}
|
|
47
|
+
|
|
46
48
|
&.success {
|
|
47
49
|
span[data-icon-status] {
|
|
48
50
|
color: var(--success);
|
|
@@ -54,11 +56,58 @@
|
|
|
54
56
|
background-color: var(--disabled);
|
|
55
57
|
color: var(--greyed-out);
|
|
56
58
|
}
|
|
59
|
+
|
|
57
60
|
span[data-icon-status] {
|
|
58
61
|
font-size: 1.25rem;
|
|
59
62
|
position: absolute;
|
|
60
|
-
top:
|
|
61
|
-
right:
|
|
63
|
+
top: auto;
|
|
64
|
+
right: 2rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.file-upload-title-mandatory {
|
|
68
|
+
color: var(--color-red500);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.upload-button-wrapper {
|
|
73
|
+
background: var(--color-blue-grey25);
|
|
74
|
+
padding: 4px;
|
|
75
|
+
|
|
76
|
+
&.drag-active {
|
|
77
|
+
.outline {
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
position: absolute;
|
|
80
|
+
margin: 0;
|
|
81
|
+
padding: 0;
|
|
82
|
+
inset: 0;
|
|
83
|
+
border: var(--file-upload-border-width) var(--drag-drop-border-style)
|
|
84
|
+
var(--color-blue-grey500);
|
|
85
|
+
border-radius: var(--input-border-radius);
|
|
86
|
+
background-color: var(--color-primary-light);
|
|
87
|
+
|
|
88
|
+
@include transition(all, 0.2s, ease-in-out);
|
|
89
|
+
&::before {
|
|
90
|
+
content: "Drop here";
|
|
91
|
+
text-align: center;
|
|
92
|
+
display: block;
|
|
93
|
+
color: var(--color-primary);
|
|
94
|
+
padding-top: 2rem;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:hover .outline {
|
|
99
|
+
background-color: var(--color-primary-light);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
& .file-select {
|
|
103
|
+
position: relative;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.error {
|
|
107
|
+
.outline {
|
|
108
|
+
border-color: var(--error);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
62
111
|
}
|
|
63
112
|
}
|
|
64
113
|
|
|
@@ -73,12 +122,18 @@
|
|
|
73
122
|
.file-select {
|
|
74
123
|
display: flex;
|
|
75
124
|
align-items: center;
|
|
76
|
-
flex-direction:
|
|
125
|
+
flex-direction: row;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
border: var(--file-upload-border-width) var(--drag-drop-border-style) var(--color-blue-grey100);
|
|
128
|
+
padding: 1.25rem;
|
|
129
|
+
|
|
77
130
|
[class*="file"] {
|
|
78
131
|
font-size: 1.25rem;
|
|
132
|
+
margin-left: 0.5rem;
|
|
79
133
|
}
|
|
134
|
+
|
|
80
135
|
[class*="typography"] {
|
|
81
|
-
margin-bottom: 0
|
|
136
|
+
margin-bottom: 0;
|
|
82
137
|
}
|
|
83
138
|
}
|
|
84
139
|
|
|
@@ -94,6 +149,7 @@
|
|
|
94
149
|
bottom: 0;
|
|
95
150
|
opacity: 0;
|
|
96
151
|
cursor: pointer;
|
|
152
|
+
|
|
97
153
|
&:focus {
|
|
98
154
|
outline: none;
|
|
99
155
|
}
|
|
@@ -106,7 +162,8 @@
|
|
|
106
162
|
.file-list {
|
|
107
163
|
list-style: none;
|
|
108
164
|
padding: 0;
|
|
109
|
-
margin: 0.
|
|
165
|
+
margin: 0.25rem 0;
|
|
166
|
+
|
|
110
167
|
li:not(:last-child) {
|
|
111
168
|
margin-bottom: 0.5rem;
|
|
112
169
|
}
|
|
@@ -27,7 +27,6 @@ import { FILE_ACTION, FileItem, Props as FileConfig } from "./FileItem/FileItem"
|
|
|
27
27
|
import { Props as InputProps } from "../Input/Input";
|
|
28
28
|
import { Typography } from "../../Typography/Typography";
|
|
29
29
|
import classes from "./FileUpload.module.scss";
|
|
30
|
-
import { Icon, Icons } from "../../Icon/Icon";
|
|
31
30
|
import { useDetermineStatusIcon } from "../../../hooks/useDetermineStatusIcon";
|
|
32
31
|
|
|
33
32
|
type FileUploadType = Omit<InputProps, "onDrop" | "type" | "onChange" | "suffix" | "prefix">;
|
|
@@ -50,6 +49,9 @@ export interface Props extends FileUploadType {
|
|
|
50
49
|
onDrop?: (e: FileType[]) => void;
|
|
51
50
|
onChange?: (e: FileType[]) => void;
|
|
52
51
|
onRequestedFileAction?: (action: FILE_ACTION, name: FileType["name"]) => void;
|
|
52
|
+
downloadFileLink?: string;
|
|
53
|
+
isRequired?: boolean;
|
|
54
|
+
invalidDropErrorMessage?: string;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
const FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (
|
|
@@ -65,8 +67,8 @@ const FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (
|
|
|
65
67
|
labeledBy,
|
|
66
68
|
disabled = false,
|
|
67
69
|
onChange,
|
|
68
|
-
dragAndDropText = "
|
|
69
|
-
selectButtonText = "
|
|
70
|
+
dragAndDropText = "Drag and drop or",
|
|
71
|
+
selectButtonText = "Browse file",
|
|
70
72
|
onDragOver,
|
|
71
73
|
onDragLeave,
|
|
72
74
|
wrapperProps,
|
|
@@ -75,19 +77,30 @@ const FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (
|
|
|
75
77
|
onRequestedFileAction,
|
|
76
78
|
exceedingMaxSizeErrorText,
|
|
77
79
|
fileList,
|
|
80
|
+
downloadFileLink,
|
|
81
|
+
isRequired = true,
|
|
82
|
+
invalidDropErrorMessage = "Invalid file format. Supported formats are: $accept.",
|
|
78
83
|
...rest
|
|
79
84
|
}: Props,
|
|
80
85
|
ref
|
|
81
86
|
) => {
|
|
82
87
|
const labelRef = useRef(null);
|
|
83
88
|
const [dragActive, setDragActive] = useState(false);
|
|
89
|
+
const [errorMsg, setErrorMsg] = useState("");
|
|
84
90
|
const [inputError, setInputError] = useState(false);
|
|
85
91
|
const icon = useDetermineStatusIcon({ success, error });
|
|
86
92
|
let dropzoneClassNames = [classes["file-dropzone"]];
|
|
93
|
+
let dropzoneContainerClassNames = [classes["upload-button-wrapper"]];
|
|
87
94
|
let subTextClass = [classes["file-selector-sub-text"]];
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
let errorTextClass = [classes["file-selector-sub-text"]];
|
|
96
|
+
dragActive && dropzoneContainerClassNames.push(classes["drag-active"]);
|
|
97
|
+
const hasError = inputError || error || errorMsg;
|
|
98
|
+
if (hasError) {
|
|
99
|
+
const errorClass = classes["error"];
|
|
100
|
+
dropzoneClassNames.push(errorClass);
|
|
101
|
+
subTextClass.push(errorClass);
|
|
102
|
+
errorTextClass.push(errorClass);
|
|
103
|
+
}
|
|
91
104
|
disabled && dropzoneClassNames.push(classes["disabled"]);
|
|
92
105
|
success && !error && dropzoneClassNames.push(classes["success"]);
|
|
93
106
|
|
|
@@ -177,10 +190,13 @@ const FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (
|
|
|
177
190
|
e.preventDefault();
|
|
178
191
|
e.stopPropagation();
|
|
179
192
|
if (e?.dataTransfer?.files && e.dataTransfer.files.length) {
|
|
180
|
-
const extension = e?.dataTransfer?.files[0]
|
|
193
|
+
const extension = e?.dataTransfer?.files[0]?.name.split(".").pop();
|
|
181
194
|
if (extension && accept && !accept.includes(extension)) {
|
|
195
|
+
setErrorMsg(invalidDropErrorMessage.replace("$accept", accept));
|
|
182
196
|
setDragActive(false);
|
|
183
197
|
return;
|
|
198
|
+
} else {
|
|
199
|
+
setErrorMsg("");
|
|
184
200
|
}
|
|
185
201
|
const validatedFiles = getFileList(e.dataTransfer.files);
|
|
186
202
|
onDrop?.(validatedFiles);
|
|
@@ -191,40 +207,62 @@ const FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (
|
|
|
191
207
|
return (
|
|
192
208
|
<div className={classes["file-upload-wrapper"]} {...wrapperProps}>
|
|
193
209
|
<div className={classes["dropzone-wrapper"]}>
|
|
194
|
-
<div
|
|
195
|
-
className={dropzoneClassNames.join(" ")}
|
|
196
|
-
onDragOver={e => !disabled && handleOnDragOver(e)}
|
|
197
|
-
onDragLeave={e => !disabled && handleOnDragLeave(e)}
|
|
198
|
-
onDrop={e => !disabled && handleOnDrop(e)}
|
|
199
|
-
>
|
|
210
|
+
<div className={dropzoneClassNames.join(" ")}>
|
|
200
211
|
<Typography variant="body-bold" className={classes["file-upload-title"]} ref={labelRef}>
|
|
201
|
-
{title}
|
|
212
|
+
{title}{" "}
|
|
213
|
+
{isRequired && <span className={classes["file-upload-title-mandatory"]}>*</span>}
|
|
202
214
|
</Typography>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
<
|
|
206
|
-
{
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
215
|
+
|
|
216
|
+
{fileList?.length > 0 && (
|
|
217
|
+
<ul className={classes["file-list"]}>
|
|
218
|
+
{fileList.map(({ name, status, progress, error }) => (
|
|
219
|
+
<li key={name} className={status} id={name}>
|
|
220
|
+
<FileItem
|
|
221
|
+
name={name}
|
|
222
|
+
key={`${name}_${status}`}
|
|
223
|
+
status={status}
|
|
224
|
+
progress={progress}
|
|
225
|
+
error={error}
|
|
226
|
+
downloadFileLink={downloadFileLink}
|
|
227
|
+
onRequestedFileAction={onRequestedFileAction}
|
|
228
|
+
/>
|
|
229
|
+
</li>
|
|
230
|
+
))}
|
|
231
|
+
</ul>
|
|
232
|
+
)}
|
|
233
|
+
|
|
234
|
+
<div
|
|
235
|
+
className={dropzoneContainerClassNames.join(" ")}
|
|
236
|
+
onDragOver={e => !disabled && handleOnDragOver(e)}
|
|
237
|
+
onDragLeave={e => !disabled && handleOnDragLeave(e)}
|
|
238
|
+
onDrop={e => !disabled && handleOnDrop(e)}
|
|
239
|
+
>
|
|
240
|
+
<div className={classes["file-select"]}>
|
|
241
|
+
<Typography variant="body" className={"drag-and-drop-text"}>
|
|
242
|
+
{dragAndDropText}
|
|
243
|
+
</Typography>
|
|
244
|
+
|
|
245
|
+
<div className={classes["file-upload-btn"]}>
|
|
246
|
+
<Button variant="outline" disabled={disabled}>
|
|
247
|
+
{selectButtonText}
|
|
248
|
+
<input
|
|
249
|
+
{...rest}
|
|
250
|
+
className={`${classes["upload-input"]} ${rest.className}`}
|
|
251
|
+
ref={ref}
|
|
252
|
+
aria-labelledby={labeledBy}
|
|
253
|
+
type="file"
|
|
254
|
+
name={name}
|
|
255
|
+
multiple={multiple}
|
|
256
|
+
disabled={disabled}
|
|
257
|
+
accept={accept}
|
|
258
|
+
onChange={onInputChange}
|
|
259
|
+
spellCheck={false}
|
|
260
|
+
/>
|
|
261
|
+
</Button>
|
|
262
|
+
</div>
|
|
263
|
+
{!disabled && icon}
|
|
264
|
+
<span className={classes["outline"]}></span>
|
|
225
265
|
</div>
|
|
226
|
-
{!disabled && icon}
|
|
227
|
-
<span className={classes["outline"]}></span>
|
|
228
266
|
</div>
|
|
229
267
|
</div>
|
|
230
268
|
{subText && (
|
|
@@ -232,22 +270,13 @@ const FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (
|
|
|
232
270
|
{subText}
|
|
233
271
|
</Typography>
|
|
234
272
|
)}
|
|
273
|
+
|
|
274
|
+
{errorMsg && (
|
|
275
|
+
<Typography variant={"sub-text"} className={errorTextClass.join(" ")}>
|
|
276
|
+
{errorMsg}
|
|
277
|
+
</Typography>
|
|
278
|
+
)}
|
|
235
279
|
</div>
|
|
236
|
-
{fileList?.length > 0 && (
|
|
237
|
-
<ul className={classes["file-list"]}>
|
|
238
|
-
{fileList.map(({ name, status, progress, error }) => (
|
|
239
|
-
<li key={name} className={status} id={name}>
|
|
240
|
-
<FileItem
|
|
241
|
-
name={name}
|
|
242
|
-
status={status}
|
|
243
|
-
progress={progress}
|
|
244
|
-
error={error}
|
|
245
|
-
onRequestedFileAction={onRequestedFileAction}
|
|
246
|
-
/>
|
|
247
|
-
</li>
|
|
248
|
-
))}
|
|
249
|
-
</ul>
|
|
250
|
-
)}
|
|
251
280
|
</div>
|
|
252
281
|
);
|
|
253
282
|
};
|
|
@@ -337,8 +337,23 @@
|
|
|
337
337
|
content: "\e9d1";
|
|
338
338
|
@include fontProperties();
|
|
339
339
|
}
|
|
340
|
-
|
|
341
340
|
.icon-warning-filled:before {
|
|
342
341
|
content: "\e948";
|
|
343
342
|
@include fontProperties();
|
|
344
343
|
}
|
|
344
|
+
.icon-download-file-outline:before {
|
|
345
|
+
content: "\e945";
|
|
346
|
+
@include fontProperties();
|
|
347
|
+
}
|
|
348
|
+
.icon-retry:before {
|
|
349
|
+
content: "\e949";
|
|
350
|
+
@include fontProperties();
|
|
351
|
+
}
|
|
352
|
+
.icon-cancel:before {
|
|
353
|
+
content: "\e94a";
|
|
354
|
+
@include fontProperties();
|
|
355
|
+
}
|
|
356
|
+
.icon-file-alt:before {
|
|
357
|
+
content: "\e94b";
|
|
358
|
+
@include fontProperties();
|
|
359
|
+
}
|
|
@@ -91,7 +91,11 @@ export enum Icons {
|
|
|
91
91
|
FileDownload = "file-download-outline",
|
|
92
92
|
UploadOutline = "upload-outline",
|
|
93
93
|
ReplyOutline = "reply-outline",
|
|
94
|
-
SaveOutline = "save-outline"
|
|
94
|
+
SaveOutline = "save-outline",
|
|
95
|
+
DownloadFile = "download-file-outline",
|
|
96
|
+
RetryFile = "retry",
|
|
97
|
+
AbortFile = "cancel",
|
|
98
|
+
FileAltIcon = "file-alt"
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
type Tag = "span" | "div" | "i";
|