@ballistix.digital/react-components 0.4.117 → 0.4.118
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/index.esm.js +6 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4482,9 +4482,9 @@ function reducer(state, action) {
|
|
|
4482
4482
|
function noop() {}
|
|
4483
4483
|
|
|
4484
4484
|
var FileInputGroupForm = function (props) {
|
|
4485
|
-
var _a = props.name, name = _a === void 0 ? 'multiple-file-input' : _a, label = props.label, description = props.description, required = props.required, value = props.value,
|
|
4485
|
+
var _a = props.name, name = _a === void 0 ? 'multiple-file-input' : _a, label = props.label, description = props.description, required = props.required, value = props.value, max = props.max, error = props.error, isDisabled = props.isDisabled, _b = props.isRequired, isRequired = _b === void 0 ? false : _b, _c = props.isTouched, isTouched = _c === void 0 ? false : _c, children = props.children, onChange = props.onChange, onBlur = props.onBlur, stylesOverrides = props.styles;
|
|
4486
4486
|
var isValid = error === undefined;
|
|
4487
|
-
var
|
|
4487
|
+
var _d = useState(false), isDragging = _d[0], setIsDragging = _d[1];
|
|
4488
4488
|
var handleChangeInput = useCallback(function (file) {
|
|
4489
4489
|
var reader = new FileReader();
|
|
4490
4490
|
reader === null || reader === void 0 ? void 0 : reader.readAsDataURL(file);
|
|
@@ -4496,7 +4496,8 @@ var FileInputGroupForm = function (props) {
|
|
|
4496
4496
|
blob: reader === null || reader === void 0 ? void 0 : reader.result,
|
|
4497
4497
|
file: file,
|
|
4498
4498
|
};
|
|
4499
|
-
|
|
4499
|
+
// eg. 10 * 1024 * 1024
|
|
4500
|
+
if (max && max * 1024 * 1024 < result.size) {
|
|
4500
4501
|
return;
|
|
4501
4502
|
}
|
|
4502
4503
|
onChange(result);
|
|
@@ -4506,7 +4507,7 @@ var FileInputGroupForm = function (props) {
|
|
|
4506
4507
|
setIsDragging(false);
|
|
4507
4508
|
handleChangeInput(files[0]);
|
|
4508
4509
|
}, [handleChangeInput]);
|
|
4509
|
-
var
|
|
4510
|
+
var _e = useDropzone({
|
|
4510
4511
|
onDrop: onDrop,
|
|
4511
4512
|
multiple: false,
|
|
4512
4513
|
onError: function () {
|
|
@@ -4519,7 +4520,7 @@ var FileInputGroupForm = function (props) {
|
|
|
4519
4520
|
onDragLeave: function () {
|
|
4520
4521
|
setIsDragging(false);
|
|
4521
4522
|
},
|
|
4522
|
-
}), getRootProps =
|
|
4523
|
+
}), getRootProps = _e.getRootProps, getInputProps = _e.getInputProps;
|
|
4523
4524
|
var handleGenerateStyle = function () {
|
|
4524
4525
|
var result = deepCopyObject(styles.base);
|
|
4525
4526
|
var keys = calculateNestedKeys(styles.base);
|