@trackunit/react-form-components 0.1.31 → 0.1.33
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/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/package.json +1 -1
- package/src/components/DropZone/DropZone.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -808,7 +808,7 @@ const DropZoneDefaultLabel = () => (jsxRuntime.jsx(Trans, { components: {
|
|
|
808
808
|
* @param {DropZoneProps} props - The props for the DropZone component
|
|
809
809
|
* @returns {JSX.Element} DropZone component
|
|
810
810
|
*/
|
|
811
|
-
const DropZone = ({ className, dataTestId, filesSelected, label = jsxRuntime.jsx(DropZoneDefaultLabel, {}), size = "large", isInvalid = false, disabled = false, accept, ...rest }) => {
|
|
811
|
+
const DropZone = ({ className, dataTestId, filesSelected, label = jsxRuntime.jsx(DropZoneDefaultLabel, {}), size = "large", isInvalid = false, disabled = false, accept, multiple = false, ...rest }) => {
|
|
812
812
|
const [dragActive, setDragActive] = React.useState(false);
|
|
813
813
|
const [fileDropped, setFileDropped] = React.useState(false);
|
|
814
814
|
const [t] = useTranslation();
|
|
@@ -857,7 +857,7 @@ const DropZone = ({ className, dataTestId, filesSelected, label = jsxRuntime.jsx
|
|
|
857
857
|
e.preventDefault();
|
|
858
858
|
e.stopPropagation();
|
|
859
859
|
}
|
|
860
|
-
}, onDragEnter: handleDrag, onDragLeave: handleDrag, onDragOver: handleDrag, onDrop: handleDrop, ...rest, children: jsxRuntime.jsxs("label", { className: cvaDropZoneLabel(), "data-testid": dataTestId ? `${dataTestId}-label` : null, ref: inputLabelRef, children: [jsxRuntime.jsx("input", { accept: accept, className: "hidden", onChange: handleChange, title: t("dropzone.input.title"), type: "file" }), jsxRuntime.jsx("div", { className: cvaDropZoneIconBackground({ invalid: isInvalid }), children: jsxRuntime.jsx(reactComponents.Icon, { className: !isInvalid ? "text-gray-400" : "", color: isInvalid ? "danger" : "neutral", name: "ArrowUpCircle", type: "solid" }) }), jsxRuntime.jsx("button", { disabled: disabled, onClick: handleButtonClick, children: label })] }) }));
|
|
860
|
+
}, onDragEnter: handleDrag, onDragLeave: handleDrag, onDragOver: handleDrag, onDrop: handleDrop, ...rest, children: jsxRuntime.jsxs("label", { className: cvaDropZoneLabel(), "data-testid": dataTestId ? `${dataTestId}-label` : null, ref: inputLabelRef, children: [jsxRuntime.jsx("input", { accept: accept, className: "hidden", multiple: multiple, onChange: handleChange, title: t("dropzone.input.title"), type: "file" }), jsxRuntime.jsx("div", { className: cvaDropZoneIconBackground({ invalid: isInvalid }), children: jsxRuntime.jsx(reactComponents.Icon, { className: !isInvalid ? "text-gray-400" : "", color: isInvalid ? "danger" : "neutral", name: "ArrowUpCircle", type: "solid" }) }), jsxRuntime.jsx("button", { disabled: disabled, onClick: handleButtonClick, children: label })] }) }));
|
|
861
861
|
};
|
|
862
862
|
|
|
863
863
|
// Doing the same check as we do on the backend
|
package/index.esm.js
CHANGED
|
@@ -789,7 +789,7 @@ const DropZoneDefaultLabel = () => (jsx(Trans, { components: {
|
|
|
789
789
|
* @param {DropZoneProps} props - The props for the DropZone component
|
|
790
790
|
* @returns {JSX.Element} DropZone component
|
|
791
791
|
*/
|
|
792
|
-
const DropZone = ({ className, dataTestId, filesSelected, label = jsx(DropZoneDefaultLabel, {}), size = "large", isInvalid = false, disabled = false, accept, ...rest }) => {
|
|
792
|
+
const DropZone = ({ className, dataTestId, filesSelected, label = jsx(DropZoneDefaultLabel, {}), size = "large", isInvalid = false, disabled = false, accept, multiple = false, ...rest }) => {
|
|
793
793
|
const [dragActive, setDragActive] = useState(false);
|
|
794
794
|
const [fileDropped, setFileDropped] = useState(false);
|
|
795
795
|
const [t] = useTranslation();
|
|
@@ -838,7 +838,7 @@ const DropZone = ({ className, dataTestId, filesSelected, label = jsx(DropZoneDe
|
|
|
838
838
|
e.preventDefault();
|
|
839
839
|
e.stopPropagation();
|
|
840
840
|
}
|
|
841
|
-
}, onDragEnter: handleDrag, onDragLeave: handleDrag, onDragOver: handleDrag, onDrop: handleDrop, ...rest, children: jsxs("label", { className: cvaDropZoneLabel(), "data-testid": dataTestId ? `${dataTestId}-label` : null, ref: inputLabelRef, children: [jsx("input", { accept: accept, className: "hidden", onChange: handleChange, title: t("dropzone.input.title"), type: "file" }), jsx("div", { className: cvaDropZoneIconBackground({ invalid: isInvalid }), children: jsx(Icon, { className: !isInvalid ? "text-gray-400" : "", color: isInvalid ? "danger" : "neutral", name: "ArrowUpCircle", type: "solid" }) }), jsx("button", { disabled: disabled, onClick: handleButtonClick, children: label })] }) }));
|
|
841
|
+
}, onDragEnter: handleDrag, onDragLeave: handleDrag, onDragOver: handleDrag, onDrop: handleDrop, ...rest, children: jsxs("label", { className: cvaDropZoneLabel(), "data-testid": dataTestId ? `${dataTestId}-label` : null, ref: inputLabelRef, children: [jsx("input", { accept: accept, className: "hidden", multiple: multiple, onChange: handleChange, title: t("dropzone.input.title"), type: "file" }), jsx("div", { className: cvaDropZoneIconBackground({ invalid: isInvalid }), children: jsx(Icon, { className: !isInvalid ? "text-gray-400" : "", color: isInvalid ? "danger" : "neutral", name: "ArrowUpCircle", type: "solid" }) }), jsx("button", { disabled: disabled, onClick: handleButtonClick, children: label })] }) }));
|
|
842
842
|
};
|
|
843
843
|
|
|
844
844
|
// Doing the same check as we do on the backend
|
package/package.json
CHANGED
|
@@ -29,5 +29,5 @@ export interface DropZoneProps extends BaseInputExposedProps, CommonProps {
|
|
|
29
29
|
* @param {DropZoneProps} props - The props for the DropZone component
|
|
30
30
|
* @returns {JSX.Element} DropZone component
|
|
31
31
|
*/
|
|
32
|
-
export declare const DropZone: ({ className, dataTestId, filesSelected, label, size, isInvalid, disabled, accept, ...rest }: DropZoneProps) => JSX.Element;
|
|
32
|
+
export declare const DropZone: ({ className, dataTestId, filesSelected, label, size, isInvalid, disabled, accept, multiple, ...rest }: DropZoneProps) => JSX.Element;
|
|
33
33
|
export {};
|