@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.js CHANGED
@@ -4484,9 +4484,9 @@ function reducer(state, action) {
4484
4484
  function noop() {}
4485
4485
 
4486
4486
  var FileInputGroupForm = function (props) {
4487
- var _a = props.name, name = _a === void 0 ? 'multiple-file-input' : _a, label = props.label, description = props.description, required = props.required, value = props.value, _b = props.max, max = _b === void 0 ? 10 * 1024 * 1024 : _b, error = props.error, isDisabled = props.isDisabled, _c = props.isRequired, isRequired = _c === void 0 ? false : _c, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, children = props.children, onChange = props.onChange, onBlur = props.onBlur, stylesOverrides = props.styles;
4487
+ 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;
4488
4488
  var isValid = error === undefined;
4489
- var _e = React.useState(false), isDragging = _e[0], setIsDragging = _e[1];
4489
+ var _d = React.useState(false), isDragging = _d[0], setIsDragging = _d[1];
4490
4490
  var handleChangeInput = React.useCallback(function (file) {
4491
4491
  var reader = new FileReader();
4492
4492
  reader === null || reader === void 0 ? void 0 : reader.readAsDataURL(file);
@@ -4498,7 +4498,8 @@ var FileInputGroupForm = function (props) {
4498
4498
  blob: reader === null || reader === void 0 ? void 0 : reader.result,
4499
4499
  file: file,
4500
4500
  };
4501
- if (max && max < result.size) {
4501
+ // eg. 10 * 1024 * 1024
4502
+ if (max && max * 1024 * 1024 < result.size) {
4502
4503
  return;
4503
4504
  }
4504
4505
  onChange(result);
@@ -4508,7 +4509,7 @@ var FileInputGroupForm = function (props) {
4508
4509
  setIsDragging(false);
4509
4510
  handleChangeInput(files[0]);
4510
4511
  }, [handleChangeInput]);
4511
- var _f = useDropzone({
4512
+ var _e = useDropzone({
4512
4513
  onDrop: onDrop,
4513
4514
  multiple: false,
4514
4515
  onError: function () {
@@ -4521,7 +4522,7 @@ var FileInputGroupForm = function (props) {
4521
4522
  onDragLeave: function () {
4522
4523
  setIsDragging(false);
4523
4524
  },
4524
- }), getRootProps = _f.getRootProps, getInputProps = _f.getInputProps;
4525
+ }), getRootProps = _e.getRootProps, getInputProps = _e.getInputProps;
4525
4526
  var handleGenerateStyle = function () {
4526
4527
  var result = deepCopyObject(styles.base);
4527
4528
  var keys = calculateNestedKeys(styles.base);