carbon-react 124.2.2 → 124.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
- package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.js +6 -4
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts +35 -0
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.js +73 -0
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.d.ts +12 -0
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +97 -0
- package/esm/components/file-input/__internal__/file-upload-status/index.d.ts +2 -0
- package/esm/components/file-input/__internal__/file-upload-status/index.js +1 -0
- package/esm/components/file-input/file-input.component.d.ts +36 -0
- package/esm/components/file-input/file-input.component.js +353 -0
- package/esm/components/file-input/file-input.style.d.ts +14 -0
- package/esm/components/file-input/file-input.style.js +58 -0
- package/esm/components/file-input/index.d.ts +3 -0
- package/esm/components/file-input/index.js +1 -0
- package/esm/locales/en-gb.js +10 -0
- package/esm/locales/locale.d.ts +10 -0
- package/esm/locales/pl-pl.js +10 -0
- package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
- package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.js +6 -4
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts +35 -0
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.component.js +81 -0
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.d.ts +12 -0
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +106 -0
- package/lib/components/file-input/__internal__/file-upload-status/index.d.ts +2 -0
- package/lib/components/file-input/__internal__/file-upload-status/index.js +13 -0
- package/lib/components/file-input/__internal__/file-upload-status/package.json +6 -0
- package/lib/components/file-input/file-input.component.d.ts +36 -0
- package/lib/components/file-input/file-input.component.js +361 -0
- package/lib/components/file-input/file-input.style.d.ts +14 -0
- package/lib/components/file-input/file-input.style.js +67 -0
- package/lib/components/file-input/index.d.ts +3 -0
- package/lib/components/file-input/index.js +13 -0
- package/lib/components/file-input/package.json +6 -0
- package/lib/locales/en-gb.js +10 -0
- package/lib/locales/locale.d.ts +10 -0
- package/lib/locales/pl-pl.js +10 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactWrapper, ShallowWrapper } from "enzyme";
|
|
2
2
|
declare const elementsTagTest: (wrapper: ReactWrapper | ShallowWrapper, elements: string[]) => void;
|
|
3
3
|
declare const rootTagTest: (rootNode: ReactWrapper | ShallowWrapper, comp: string, elem?: string, role?: string) => void;
|
|
4
|
-
declare const rootTagTestRtl: (
|
|
4
|
+
declare const rootTagTestRtl: (rootNode: HTMLElement, comp: string, elem?: string, role?: string) => void;
|
|
5
5
|
export { elementsTagTest, rootTagTest, rootTagTestRtl };
|
|
@@ -12,9 +12,11 @@ const rootTagTest = (rootNode, comp, elem, role) => {
|
|
|
12
12
|
expect(rootNode.prop("data-element")).toEqual(elem);
|
|
13
13
|
expect(rootNode.prop("data-role")).toEqual(role);
|
|
14
14
|
};
|
|
15
|
-
const rootTagTestRtl = (
|
|
16
|
-
expect(
|
|
17
|
-
expect(
|
|
18
|
-
expect(
|
|
15
|
+
const rootTagTestRtl = (rootNode, comp, elem, role) => {
|
|
16
|
+
expect(rootNode).toHaveAttribute("data-component", comp);
|
|
17
|
+
expect(rootNode).toHaveAttribute("data-element", elem);
|
|
18
|
+
expect(rootNode).toHaveAttribute("data-role", role);
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line jest/no-export
|
|
20
22
|
export { elementsTagTest, rootTagTest, rootTagTestRtl };
|
package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LinkProps } from "../../../link";
|
|
3
|
+
import { IconType } from "../../../icon";
|
|
4
|
+
interface StatusUploadingProps {
|
|
5
|
+
/** the status of the upload */
|
|
6
|
+
status: "uploading";
|
|
7
|
+
/** a number from 0-100 giving the current upload progress as a percentage. Only used for the `uploading` status.
|
|
8
|
+
* If the progress prop is not specified in the `uploading` status, a loading animation will be shown instead
|
|
9
|
+
* (or text equivalent for users with a reduced-motion operating system preference).
|
|
10
|
+
*/
|
|
11
|
+
progress?: number;
|
|
12
|
+
}
|
|
13
|
+
interface StatusDoneProps extends LinkProps {
|
|
14
|
+
/** the status of the upload */
|
|
15
|
+
status: "completed" | "previously";
|
|
16
|
+
/** the URL opened by the file link. Must be provided for only the `completed` and `previously` statuses. */
|
|
17
|
+
href: string;
|
|
18
|
+
}
|
|
19
|
+
interface StatusErrorProps {
|
|
20
|
+
/** the status of the upload */
|
|
21
|
+
status: "error";
|
|
22
|
+
}
|
|
23
|
+
interface MandatoryStatusProps {
|
|
24
|
+
/** the name of the file */
|
|
25
|
+
filename: string;
|
|
26
|
+
/** a function to be executed when the user clicks the appropriate action button (Clear/Delete File/Cancel Upload) */
|
|
27
|
+
onAction: () => void;
|
|
28
|
+
/** The status message. Used to display the current upload progress, including error messages where appropriate. Not used for the `previously` status. */
|
|
29
|
+
message?: string;
|
|
30
|
+
/** The icon to use for the file during or after upload */
|
|
31
|
+
iconType?: IconType;
|
|
32
|
+
}
|
|
33
|
+
export declare type FileUploadStatusProps = MandatoryStatusProps & (StatusUploadingProps | StatusErrorProps | StatusDoneProps);
|
|
34
|
+
export declare const FileUploadStatus: ({ status, filename, message, onAction, iconType, ...statusProps }: FileUploadStatusProps) => React.JSX.Element;
|
|
35
|
+
export default FileUploadStatus;
|
package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import Link from "../../../link";
|
|
4
|
+
import ButtonMinor from "../../../button-minor";
|
|
5
|
+
import StyledTypography from "../../../typography/typography.style";
|
|
6
|
+
import ProgressTracker from "../../../progress-tracker";
|
|
7
|
+
import LoaderBar from "../../../loader-bar";
|
|
8
|
+
import Icon from "../../../icon";
|
|
9
|
+
import { StyledFileUploadStatus, StyledFileUploadStatusRow, StyledFileLinkContainer } from "./file-upload-status.style";
|
|
10
|
+
import useLocale from "../../../../hooks/__internal__/useLocale";
|
|
11
|
+
export const FileUploadStatus = ({
|
|
12
|
+
status,
|
|
13
|
+
filename,
|
|
14
|
+
message,
|
|
15
|
+
onAction,
|
|
16
|
+
iconType = "file_generic",
|
|
17
|
+
...statusProps
|
|
18
|
+
}) => {
|
|
19
|
+
const locale = useLocale();
|
|
20
|
+
const statusMessage = message || locale.fileInput.fileUploadStatus();
|
|
21
|
+
let buttonText;
|
|
22
|
+
let linkProps;
|
|
23
|
+
let progressBar = null;
|
|
24
|
+
switch (status) {
|
|
25
|
+
case "uploading":
|
|
26
|
+
buttonText = locale.fileInput.actions.cancel();
|
|
27
|
+
progressBar = statusProps.progress === undefined ? /*#__PURE__*/React.createElement(LoaderBar, {
|
|
28
|
+
size: "small"
|
|
29
|
+
}) : /*#__PURE__*/React.createElement(ProgressTracker, {
|
|
30
|
+
size: "small",
|
|
31
|
+
progress: statusProps.progress,
|
|
32
|
+
length: "100%"
|
|
33
|
+
});
|
|
34
|
+
break;
|
|
35
|
+
case "previously":
|
|
36
|
+
case "completed":
|
|
37
|
+
buttonText = locale.fileInput.actions.delete();
|
|
38
|
+
linkProps = {
|
|
39
|
+
...statusProps,
|
|
40
|
+
icon: iconType
|
|
41
|
+
};
|
|
42
|
+
break;
|
|
43
|
+
case "error":
|
|
44
|
+
buttonText = locale.fileInput.actions.clear();
|
|
45
|
+
break;
|
|
46
|
+
// istanbul ignore next
|
|
47
|
+
default:
|
|
48
|
+
// no other cases if consumers are using TS, but ESLint still insists on it
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
const actionButton = /*#__PURE__*/React.createElement(ButtonMinor, {
|
|
52
|
+
onClick: onAction,
|
|
53
|
+
buttonType: "tertiary"
|
|
54
|
+
}, buttonText);
|
|
55
|
+
const fileLink = linkProps ? /*#__PURE__*/React.createElement(Link, linkProps, filename) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
|
|
56
|
+
type: iconType
|
|
57
|
+
}), /*#__PURE__*/React.createElement("span", null, filename));
|
|
58
|
+
const mainRow = status !== "previously" ? /*#__PURE__*/React.createElement(StyledFileUploadStatusRow, null, /*#__PURE__*/React.createElement(StyledTypography, {
|
|
59
|
+
as: "p",
|
|
60
|
+
mb: 0,
|
|
61
|
+
"aria-live": "polite"
|
|
62
|
+
}, statusMessage), actionButton) : /*#__PURE__*/React.createElement(StyledFileUploadStatusRow, {
|
|
63
|
+
onlyRow: true
|
|
64
|
+
}, /*#__PURE__*/React.createElement(StyledFileLinkContainer, null, fileLink), actionButton);
|
|
65
|
+
const secondRow = status !== "previously" ? /*#__PURE__*/React.createElement(StyledFileUploadStatusRow, {
|
|
66
|
+
upperPadding: true,
|
|
67
|
+
lowerPadding: true
|
|
68
|
+
}, /*#__PURE__*/React.createElement(StyledFileLinkContainer, null, fileLink)) : null;
|
|
69
|
+
return /*#__PURE__*/React.createElement(StyledFileUploadStatus, {
|
|
70
|
+
hasError: status === "error"
|
|
71
|
+
}, mainRow, secondRow, progressBar);
|
|
72
|
+
};
|
|
73
|
+
export default FileUploadStatus;
|
package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const StyledFileLinkContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
interface StyledFileUploadStatusRowProps {
|
|
3
|
+
upperPadding?: boolean;
|
|
4
|
+
lowerPadding?: boolean;
|
|
5
|
+
onlyRow?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const StyledFileUploadStatusRow: import("styled-components").StyledComponent<"div", any, StyledFileUploadStatusRowProps, never>;
|
|
8
|
+
interface StyledFileUploadStatusProps {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const StyledFileUploadStatus: import("styled-components").StyledComponent<"div", any, StyledFileUploadStatusProps, never>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import StyledTypography from "../../../typography/typography.style";
|
|
3
|
+
import StyledIcon from "../../../icon/icon.style";
|
|
4
|
+
import { StyledProgressBar, InnerBar as ProgressTrackerInnerBar } from "../../../progress-tracker/progress-tracker.style";
|
|
5
|
+
import StyledLoaderBar, { StyledLoader, InnerBar as LoaderBarInnerBar } from "../../../loader-bar/loader-bar.style";
|
|
6
|
+
import { StyledLink, StyledContent } from "../../../link/link.style";
|
|
7
|
+
export const StyledFileLinkContainer = styled.div`
|
|
8
|
+
color: var(--colorsActionMajorYin090);
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
overflow-x: clip;
|
|
12
|
+
overflow-y: visible;
|
|
13
|
+
padding-right: var(--spacing150);
|
|
14
|
+
|
|
15
|
+
${StyledLink} {
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
${StyledLink} a {
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
display: flex;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${StyledContent} {
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
text-overflow: ellipsis;
|
|
28
|
+
text-decoration: underline;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&&& ${StyledIcon} {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: flex-start;
|
|
35
|
+
width: 24px;
|
|
36
|
+
height: 24px;
|
|
37
|
+
|
|
38
|
+
// only apply these styles when the icon is not part of a Link component
|
|
39
|
+
:not(${StyledLink} ${StyledIcon}) {
|
|
40
|
+
color: var(--colorsUtilityYin065);
|
|
41
|
+
padding-right: var(--spacing100);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
export const StyledFileUploadStatusRow = styled.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
${({
|
|
49
|
+
onlyRow
|
|
50
|
+
}) => onlyRow ? "" : "align-items: baseline;"}
|
|
51
|
+
padding-left: var(--spacing150);
|
|
52
|
+
${({
|
|
53
|
+
upperPadding
|
|
54
|
+
}) => upperPadding ? "padding-top: var(--spacing050);" : ""}
|
|
55
|
+
${({
|
|
56
|
+
lowerPadding
|
|
57
|
+
}) => lowerPadding ? "padding-bottom: var(--spacing125);" : ""}
|
|
58
|
+
|
|
59
|
+
${StyledTypography} {
|
|
60
|
+
color: var(--colorsUtilityYin055);
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
export const StyledFileUploadStatus = styled.div`
|
|
64
|
+
background-color: var(--colorsUtilityYang100);
|
|
65
|
+
${({
|
|
66
|
+
hasError
|
|
67
|
+
}) => {
|
|
68
|
+
const borderWidthToken = hasError ? "borderWidth200" : "borderWidth100";
|
|
69
|
+
const colorToken = hasError ? "colorsSemanticNegative500" : "colorsUtilityMajor300";
|
|
70
|
+
return css`
|
|
71
|
+
border: var(--${borderWidthToken}) solid var(--${colorToken});
|
|
72
|
+
${hasError && `&& ${StyledTypography} {
|
|
73
|
+
color: var(--${colorToken});
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
}`}
|
|
76
|
+
`;
|
|
77
|
+
}}
|
|
78
|
+
border-radius: var(--borderRadius050);
|
|
79
|
+
width: 100%;
|
|
80
|
+
|
|
81
|
+
${StyledProgressBar}, ${ProgressTrackerInnerBar} {
|
|
82
|
+
border-radius: var(--borderRadius050);
|
|
83
|
+
border: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
${StyledLoader} {
|
|
87
|
+
display: flex;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
${StyledLoaderBar} {
|
|
91
|
+
background-color: var(--colorsSemanticNeutral200);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
${LoaderBarInnerBar} {
|
|
95
|
+
background-color: var(--colorsSemanticNeutral500);
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./file-upload-status.component";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { ValidationProps } from "../../__internal__/validations";
|
|
4
|
+
import { InputProps } from "../../__internal__/input";
|
|
5
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
6
|
+
import { FileUploadStatusProps } from "./__internal__/file-upload-status";
|
|
7
|
+
export interface FileInputProps extends Pick<ValidationProps, "error">, Pick<InputProps, "id" | "name" | "required">, TagProps, MarginProps {
|
|
8
|
+
/** Which file format(s) to accept. Will be passed to the underlying HTML input.
|
|
9
|
+
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept */
|
|
10
|
+
accept?: string;
|
|
11
|
+
/** Text to appear on the main button. Defaults to "Select file" */
|
|
12
|
+
buttonText?: string;
|
|
13
|
+
/** Explanatory text to appear inside the input area. Defaults to "or drag and drop your file" */
|
|
14
|
+
dragAndDropText?: string;
|
|
15
|
+
/** A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input. */
|
|
16
|
+
inputHint?: React.ReactNode;
|
|
17
|
+
/** Sets the default layout to vertical - with the button below the explanatory text rather than next to it.
|
|
18
|
+
* This is the equivalent of removing the maxHeight prop - it will be over-ridden if this prop is set explicitly. */
|
|
19
|
+
isVertical?: boolean;
|
|
20
|
+
/** Label content */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** A valid CSS string for the max-height CSS property. Defaults to the same as the minHeight. */
|
|
23
|
+
maxHeight?: string;
|
|
24
|
+
/** A valid CSS string for the max-width CSS property. Defaults to the same as the minWidth. */
|
|
25
|
+
maxWidth?: string;
|
|
26
|
+
/** A valid CSS string for the min-height CSS property. Defaults to 40px. */
|
|
27
|
+
minHeight?: string;
|
|
28
|
+
/** A valid CSS string for the min-width CSS property. Defaults to 256px. */
|
|
29
|
+
minWidth?: string;
|
|
30
|
+
/** onChange event handler. Accepts a list of all files currently entered to the input. */
|
|
31
|
+
onChange: (files: FileList) => void;
|
|
32
|
+
/** used to control how to display the progress of uploaded file(s) within the component */
|
|
33
|
+
uploadStatus?: FileUploadStatusProps | FileUploadStatusProps[];
|
|
34
|
+
}
|
|
35
|
+
export declare const FileInput: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
36
|
+
export default FileInput;
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React, { useRef, useState, useEffect } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
5
|
+
import { InputBehaviour } from "../../__internal__/input-behaviour";
|
|
6
|
+
import FormField from "../../__internal__/form-field";
|
|
7
|
+
import useUniqueId from "../../hooks/__internal__/useUniqueId";
|
|
8
|
+
import useInputAccessibility from "../../hooks/__internal__/useInputAccessibility/useInputAccessibility";
|
|
9
|
+
import ValidationMessage from "../../__internal__/validation-message";
|
|
10
|
+
import { StyledHiddenFileInput, StyledFileInputPresentation } from "./file-input.style";
|
|
11
|
+
import { StyledHintText, ErrorBorder } from "../textbox/textbox.style";
|
|
12
|
+
import ButtonMinor from "../button-minor";
|
|
13
|
+
import Typography from "../typography";
|
|
14
|
+
import FileUploadStatus from "./__internal__/file-upload-status";
|
|
15
|
+
import Box from "../box";
|
|
16
|
+
import useLocale from "../../hooks/__internal__/useLocale";
|
|
17
|
+
const FileInput = /*#__PURE__*/React.forwardRef(({
|
|
18
|
+
accept,
|
|
19
|
+
buttonText,
|
|
20
|
+
"data-element": dataElement,
|
|
21
|
+
"data-role": dataRole,
|
|
22
|
+
dragAndDropText,
|
|
23
|
+
error,
|
|
24
|
+
label,
|
|
25
|
+
id,
|
|
26
|
+
inputHint,
|
|
27
|
+
isVertical,
|
|
28
|
+
maxHeight,
|
|
29
|
+
maxWidth,
|
|
30
|
+
minHeight = "40px",
|
|
31
|
+
minWidth = "256px",
|
|
32
|
+
name,
|
|
33
|
+
onChange,
|
|
34
|
+
required,
|
|
35
|
+
uploadStatus = [],
|
|
36
|
+
...rest
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const locale = useLocale();
|
|
39
|
+
const textOnButton = buttonText || locale.fileInput.selectFile();
|
|
40
|
+
const mainText = dragAndDropText || locale.fileInput.dragAndDrop();
|
|
41
|
+
const sizeProps = {
|
|
42
|
+
maxHeight: maxHeight || (isVertical ? undefined : minHeight),
|
|
43
|
+
maxWidth: maxWidth || minWidth,
|
|
44
|
+
minHeight,
|
|
45
|
+
minWidth
|
|
46
|
+
};
|
|
47
|
+
const [uniqueId, uniqueName] = useUniqueId(id, name);
|
|
48
|
+
const [isDraggedOver, setIsDraggedOver] = useState(false);
|
|
49
|
+
const [isDraggingFile, setIsDraggingFile] = useState(false);
|
|
50
|
+
const internalInputRef = useRef(null);
|
|
51
|
+
const internalCallbackRef = fileInput => {
|
|
52
|
+
internalInputRef.current = fileInput;
|
|
53
|
+
if (typeof ref === "function") {
|
|
54
|
+
ref(fileInput);
|
|
55
|
+
} else if (ref) {
|
|
56
|
+
ref.current = fileInput;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const startDrag = e => {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
if (e.dataTransfer?.types.includes("Files")) {
|
|
62
|
+
setIsDraggingFile(true);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const stopDrag = e => {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
setIsDraggingFile(false);
|
|
68
|
+
};
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
document.addEventListener("dragover", startDrag);
|
|
71
|
+
document.addEventListener("drop", stopDrag);
|
|
72
|
+
document.addEventListener("dragleave", stopDrag);
|
|
73
|
+
return () => {
|
|
74
|
+
document.removeEventListener("dragover", startDrag);
|
|
75
|
+
document.removeEventListener("drop", stopDrag);
|
|
76
|
+
document.removeEventListener("dragleave", stopDrag);
|
|
77
|
+
};
|
|
78
|
+
}, []);
|
|
79
|
+
const onSelectFileClick = () => {
|
|
80
|
+
internalInputRef.current?.click();
|
|
81
|
+
};
|
|
82
|
+
const onFileAdded = files => {
|
|
83
|
+
onChange?.(files);
|
|
84
|
+
};
|
|
85
|
+
const onDragOver = e => {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
if (e.dataTransfer?.types.includes("Files")) {
|
|
88
|
+
setIsDraggedOver(true);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const onDragLeave = e => {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
e.stopPropagation(); // stop event triggering the document listener that resets the styles
|
|
94
|
+
setIsDraggedOver(false);
|
|
95
|
+
};
|
|
96
|
+
const onDrop = e => {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
setIsDraggedOver(false);
|
|
99
|
+
onFileAdded(e.dataTransfer.files);
|
|
100
|
+
};
|
|
101
|
+
const onInputChange = e => {
|
|
102
|
+
onFileAdded(e.target.files);
|
|
103
|
+
};
|
|
104
|
+
const {
|
|
105
|
+
labelId,
|
|
106
|
+
validationId
|
|
107
|
+
} = useInputAccessibility({
|
|
108
|
+
id: uniqueId,
|
|
109
|
+
validationRedesignOptIn: true,
|
|
110
|
+
error,
|
|
111
|
+
label
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// allow for single input that a single set of status props is provided
|
|
115
|
+
const filesUploaded = Array.isArray(uploadStatus) ? uploadStatus : [uploadStatus];
|
|
116
|
+
const input = /*#__PURE__*/React.createElement(React.Fragment, null, inputHint && /*#__PURE__*/React.createElement(StyledHintText, null, inputHint), /*#__PURE__*/React.createElement(Box, {
|
|
117
|
+
position: "relative"
|
|
118
|
+
}, /*#__PURE__*/React.createElement(ValidationMessage, {
|
|
119
|
+
error: error,
|
|
120
|
+
validationId: validationId
|
|
121
|
+
}), error && /*#__PURE__*/React.createElement(ErrorBorder, {
|
|
122
|
+
warning: false
|
|
123
|
+
}), /*#__PURE__*/React.createElement(StyledHiddenFileInput, _extends({}, required && {
|
|
124
|
+
required
|
|
125
|
+
}, {
|
|
126
|
+
accept: accept,
|
|
127
|
+
"aria-invalid": !!error,
|
|
128
|
+
id: uniqueId,
|
|
129
|
+
ref: internalCallbackRef,
|
|
130
|
+
name: uniqueName,
|
|
131
|
+
onChange: onInputChange,
|
|
132
|
+
type: "file"
|
|
133
|
+
}, rest)), /*#__PURE__*/React.createElement(StyledFileInputPresentation, _extends({
|
|
134
|
+
isDraggedOver: isDraggedOver,
|
|
135
|
+
isDraggingFile: isDraggingFile,
|
|
136
|
+
error: error,
|
|
137
|
+
onDragLeave: onDragLeave,
|
|
138
|
+
onDragOver: onDragOver,
|
|
139
|
+
onDrop: onDrop
|
|
140
|
+
}, sizeProps), /*#__PURE__*/React.createElement(ButtonMinor, {
|
|
141
|
+
buttonType: "primary",
|
|
142
|
+
onClick: onSelectFileClick
|
|
143
|
+
}, textOnButton), /*#__PURE__*/React.createElement(Typography, {
|
|
144
|
+
m: 0
|
|
145
|
+
}, mainText))));
|
|
146
|
+
return /*#__PURE__*/React.createElement(InputBehaviour, null, /*#__PURE__*/React.createElement(FormField, _extends({
|
|
147
|
+
error: error,
|
|
148
|
+
label: label,
|
|
149
|
+
labelId: labelId,
|
|
150
|
+
id: uniqueId,
|
|
151
|
+
isRequired: required,
|
|
152
|
+
"data-component": "file-input",
|
|
153
|
+
"data-role": dataRole,
|
|
154
|
+
"data-element": dataElement,
|
|
155
|
+
validationRedesignOptIn: true // do not support old-style validation for File Input component
|
|
156
|
+
}, filterStyledSystemMarginProps(rest)), filesUploaded.length === 0 ? input : filesUploaded.map(props => /*#__PURE__*/React.createElement(StyledFileInputPresentation, _extends({
|
|
157
|
+
hasUploadStatus: true
|
|
158
|
+
}, sizeProps, {
|
|
159
|
+
key: props.filename
|
|
160
|
+
}), /*#__PURE__*/React.createElement(FileUploadStatus, props)))));
|
|
161
|
+
});
|
|
162
|
+
FileInput.propTypes = {
|
|
163
|
+
"accept": PropTypes.string,
|
|
164
|
+
"buttonText": PropTypes.string,
|
|
165
|
+
"data-component": PropTypes.string,
|
|
166
|
+
"data-element": PropTypes.string,
|
|
167
|
+
"data-role": PropTypes.string,
|
|
168
|
+
"dragAndDropText": PropTypes.string,
|
|
169
|
+
"error": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
170
|
+
"id": PropTypes.string,
|
|
171
|
+
"inputHint": PropTypes.node,
|
|
172
|
+
"isVertical": PropTypes.bool,
|
|
173
|
+
"label": PropTypes.string,
|
|
174
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
175
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
176
|
+
"description": PropTypes.string,
|
|
177
|
+
"toString": PropTypes.func.isRequired,
|
|
178
|
+
"valueOf": PropTypes.func.isRequired
|
|
179
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
180
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
181
|
+
"description": PropTypes.string,
|
|
182
|
+
"toString": PropTypes.func.isRequired,
|
|
183
|
+
"valueOf": PropTypes.func.isRequired
|
|
184
|
+
}), PropTypes.string]),
|
|
185
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
186
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
187
|
+
"description": PropTypes.string,
|
|
188
|
+
"toString": PropTypes.func.isRequired,
|
|
189
|
+
"valueOf": PropTypes.func.isRequired
|
|
190
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
191
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
192
|
+
"description": PropTypes.string,
|
|
193
|
+
"toString": PropTypes.func.isRequired,
|
|
194
|
+
"valueOf": PropTypes.func.isRequired
|
|
195
|
+
}), PropTypes.string]),
|
|
196
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
197
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
198
|
+
"description": PropTypes.string,
|
|
199
|
+
"toString": PropTypes.func.isRequired,
|
|
200
|
+
"valueOf": PropTypes.func.isRequired
|
|
201
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
202
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
203
|
+
"description": PropTypes.string,
|
|
204
|
+
"toString": PropTypes.func.isRequired,
|
|
205
|
+
"valueOf": PropTypes.func.isRequired
|
|
206
|
+
}), PropTypes.string]),
|
|
207
|
+
"marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
208
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
209
|
+
"description": PropTypes.string,
|
|
210
|
+
"toString": PropTypes.func.isRequired,
|
|
211
|
+
"valueOf": PropTypes.func.isRequired
|
|
212
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
213
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
214
|
+
"description": PropTypes.string,
|
|
215
|
+
"toString": PropTypes.func.isRequired,
|
|
216
|
+
"valueOf": PropTypes.func.isRequired
|
|
217
|
+
}), PropTypes.string]),
|
|
218
|
+
"marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
219
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
220
|
+
"description": PropTypes.string,
|
|
221
|
+
"toString": PropTypes.func.isRequired,
|
|
222
|
+
"valueOf": PropTypes.func.isRequired
|
|
223
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
224
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
225
|
+
"description": PropTypes.string,
|
|
226
|
+
"toString": PropTypes.func.isRequired,
|
|
227
|
+
"valueOf": PropTypes.func.isRequired
|
|
228
|
+
}), PropTypes.string]),
|
|
229
|
+
"marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
230
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
231
|
+
"description": PropTypes.string,
|
|
232
|
+
"toString": PropTypes.func.isRequired,
|
|
233
|
+
"valueOf": PropTypes.func.isRequired
|
|
234
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
235
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
236
|
+
"description": PropTypes.string,
|
|
237
|
+
"toString": PropTypes.func.isRequired,
|
|
238
|
+
"valueOf": PropTypes.func.isRequired
|
|
239
|
+
}), PropTypes.string]),
|
|
240
|
+
"marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
241
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
242
|
+
"description": PropTypes.string,
|
|
243
|
+
"toString": PropTypes.func.isRequired,
|
|
244
|
+
"valueOf": PropTypes.func.isRequired
|
|
245
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
246
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
247
|
+
"description": PropTypes.string,
|
|
248
|
+
"toString": PropTypes.func.isRequired,
|
|
249
|
+
"valueOf": PropTypes.func.isRequired
|
|
250
|
+
}), PropTypes.string]),
|
|
251
|
+
"marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
252
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
253
|
+
"description": PropTypes.string,
|
|
254
|
+
"toString": PropTypes.func.isRequired,
|
|
255
|
+
"valueOf": PropTypes.func.isRequired
|
|
256
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
257
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
258
|
+
"description": PropTypes.string,
|
|
259
|
+
"toString": PropTypes.func.isRequired,
|
|
260
|
+
"valueOf": PropTypes.func.isRequired
|
|
261
|
+
}), PropTypes.string]),
|
|
262
|
+
"maxHeight": PropTypes.string,
|
|
263
|
+
"maxWidth": PropTypes.string,
|
|
264
|
+
"mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
265
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
266
|
+
"description": PropTypes.string,
|
|
267
|
+
"toString": PropTypes.func.isRequired,
|
|
268
|
+
"valueOf": PropTypes.func.isRequired
|
|
269
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
270
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
271
|
+
"description": PropTypes.string,
|
|
272
|
+
"toString": PropTypes.func.isRequired,
|
|
273
|
+
"valueOf": PropTypes.func.isRequired
|
|
274
|
+
}), PropTypes.string]),
|
|
275
|
+
"minHeight": PropTypes.string,
|
|
276
|
+
"minWidth": PropTypes.string,
|
|
277
|
+
"ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
278
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
279
|
+
"description": PropTypes.string,
|
|
280
|
+
"toString": PropTypes.func.isRequired,
|
|
281
|
+
"valueOf": PropTypes.func.isRequired
|
|
282
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
283
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
284
|
+
"description": PropTypes.string,
|
|
285
|
+
"toString": PropTypes.func.isRequired,
|
|
286
|
+
"valueOf": PropTypes.func.isRequired
|
|
287
|
+
}), PropTypes.string]),
|
|
288
|
+
"mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
289
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
290
|
+
"description": PropTypes.string,
|
|
291
|
+
"toString": PropTypes.func.isRequired,
|
|
292
|
+
"valueOf": PropTypes.func.isRequired
|
|
293
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
294
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
295
|
+
"description": PropTypes.string,
|
|
296
|
+
"toString": PropTypes.func.isRequired,
|
|
297
|
+
"valueOf": PropTypes.func.isRequired
|
|
298
|
+
}), PropTypes.string]),
|
|
299
|
+
"mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
300
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
301
|
+
"description": PropTypes.string,
|
|
302
|
+
"toString": PropTypes.func.isRequired,
|
|
303
|
+
"valueOf": PropTypes.func.isRequired
|
|
304
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
305
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
306
|
+
"description": PropTypes.string,
|
|
307
|
+
"toString": PropTypes.func.isRequired,
|
|
308
|
+
"valueOf": PropTypes.func.isRequired
|
|
309
|
+
}), PropTypes.string]),
|
|
310
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
311
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
312
|
+
"description": PropTypes.string,
|
|
313
|
+
"toString": PropTypes.func.isRequired,
|
|
314
|
+
"valueOf": PropTypes.func.isRequired
|
|
315
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
316
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
317
|
+
"description": PropTypes.string,
|
|
318
|
+
"toString": PropTypes.func.isRequired,
|
|
319
|
+
"valueOf": PropTypes.func.isRequired
|
|
320
|
+
}), PropTypes.string]),
|
|
321
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
322
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
323
|
+
"description": PropTypes.string,
|
|
324
|
+
"toString": PropTypes.func.isRequired,
|
|
325
|
+
"valueOf": PropTypes.func.isRequired
|
|
326
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
327
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
328
|
+
"description": PropTypes.string,
|
|
329
|
+
"toString": PropTypes.func.isRequired,
|
|
330
|
+
"valueOf": PropTypes.func.isRequired
|
|
331
|
+
}), PropTypes.string]),
|
|
332
|
+
"name": PropTypes.string,
|
|
333
|
+
"onChange": PropTypes.func.isRequired,
|
|
334
|
+
"required": PropTypes.bool,
|
|
335
|
+
"uploadStatus": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.object, PropTypes.shape({
|
|
336
|
+
"filename": PropTypes.string.isRequired,
|
|
337
|
+
"iconType": PropTypes.oneOf(["accessibility_web", "add", "admin", "alert_on", "alert", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow_bottom_right_circle", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_top_left_circle", "arrow_up", "arrow", "arrows_left_right", "attach", "bank_with_card", "bank", "basket_with_squares", "basket", "bed", "bill_paid", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_pay_date", "calendar_today", "calendar", "call", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "cash", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "check_all", "check_none", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "cloud_co2", "coins", "collaborate", "computer_clock", "connect_off", "connect", "construction", "contact_card", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "drill", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "form_refresh", "gift", "go", "graduation_hat", "graph", "grid", "hand_cash_coins", "hand_cash_note", "heart_pulse", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "like_no", "like", "link_cloud", "link_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "microphone", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause_circle", "pause", "pdf", "people_switch", "people", "percentage_boxed", "person_info", "person_tick", "person", "petrol_pump", "phone", "piggy_bank", "plane", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "protect", "question_hollow", "question_mark", "question", "recruiting", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "send", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "support_online", "sync", "tag", "talk", "target_man", "target", "theatre_masks", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volunteering", "warning", "website", "welfare"]),
|
|
338
|
+
"message": PropTypes.string,
|
|
339
|
+
"onAction": PropTypes.func.isRequired,
|
|
340
|
+
"progress": PropTypes.number,
|
|
341
|
+
"status": PropTypes.oneOf(["uploading"]).isRequired
|
|
342
|
+
})])), PropTypes.object, PropTypes.shape({
|
|
343
|
+
"filename": PropTypes.string.isRequired,
|
|
344
|
+
"iconType": PropTypes.oneOf(["accessibility_web", "add", "admin", "alert_on", "alert", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow_bottom_right_circle", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_top_left_circle", "arrow_up", "arrow", "arrows_left_right", "attach", "bank_with_card", "bank", "basket_with_squares", "basket", "bed", "bill_paid", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_pay_date", "calendar_today", "calendar", "call", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "cash", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "check_all", "check_none", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "cloud_co2", "coins", "collaborate", "computer_clock", "connect_off", "connect", "construction", "contact_card", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "drill", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "form_refresh", "gift", "go", "graduation_hat", "graph", "grid", "hand_cash_coins", "hand_cash_note", "heart_pulse", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "like_no", "like", "link_cloud", "link_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "microphone", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause_circle", "pause", "pdf", "people_switch", "people", "percentage_boxed", "person_info", "person_tick", "person", "petrol_pump", "phone", "piggy_bank", "plane", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "protect", "question_hollow", "question_mark", "question", "recruiting", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "send", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "support_online", "sync", "tag", "talk", "target_man", "target", "theatre_masks", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volunteering", "warning", "website", "welfare"]),
|
|
345
|
+
"message": PropTypes.string,
|
|
346
|
+
"onAction": PropTypes.func.isRequired,
|
|
347
|
+
"progress": PropTypes.number,
|
|
348
|
+
"status": PropTypes.oneOf(["uploading"]).isRequired
|
|
349
|
+
})])
|
|
350
|
+
};
|
|
351
|
+
export { FileInput };
|
|
352
|
+
FileInput.displayName = "FileInput";
|
|
353
|
+
export default FileInput;
|