@rolster/react-components 18.23.4 → 18.23.5

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/es/index.js CHANGED
@@ -3544,7 +3544,6 @@ function useImageEditorController(options) {
3544
3544
  useEffect(() => {
3545
3545
  refInput.current = document.createElement('input');
3546
3546
  refInput.current.type = 'file';
3547
- refInput.current.disabled = true;
3548
3547
  refInput.current.onchange = () => {
3549
3548
  if (refInput.current.files &&
3550
3549
  MIME_TYPE_SUPPORTS.includes(refInput.current.files[0].type)) {
@@ -3564,7 +3563,7 @@ function useImageEditorController(options) {
3564
3563
  const onCancel = useCallback(() => {
3565
3564
  setSrcEditor(undefined);
3566
3565
  }, []);
3567
- const component = useMemo(() => {
3566
+ const RlsImageEditorChooser = useMemo(() => {
3568
3567
  return (srcEditor && (jsxRuntimeExports.jsx(RlsImageEditorModal, { src: srcEditor, formControl: options.formControl, imgWidth: options.imgWidth, imgQuality: options.imgQuality, onValue: onEditorValue, visible: true, children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", rlsTheme: "danger", onClick: onCancel, disabled: options.disabled, children: labels.actionCancel }) })));
3569
3568
  }, [
3570
3569
  srcEditor,
@@ -3577,9 +3576,9 @@ function useImageEditorController(options) {
3577
3576
  onCancel
3578
3577
  ]);
3579
3578
  const onImageChooser = useCallback(() => {
3580
- refInput.current.click();
3581
- }, []);
3582
- return { RlsImageEditorChooser: component, onImageChooser };
3579
+ !options.disabled && refInput.current.click();
3580
+ }, [options.disabled]);
3581
+ return { onImageChooser, RlsImageEditorChooser };
3583
3582
  }
3584
3583
 
3585
3584
  function RlsImageChooser(props) {