@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/cjs/index.js CHANGED
@@ -3546,7 +3546,6 @@ function useImageEditorController(options) {
3546
3546
  require$$0.useEffect(() => {
3547
3547
  refInput.current = document.createElement('input');
3548
3548
  refInput.current.type = 'file';
3549
- refInput.current.disabled = true;
3550
3549
  refInput.current.onchange = () => {
3551
3550
  if (refInput.current.files &&
3552
3551
  MIME_TYPE_SUPPORTS.includes(refInput.current.files[0].type)) {
@@ -3566,7 +3565,7 @@ function useImageEditorController(options) {
3566
3565
  const onCancel = require$$0.useCallback(() => {
3567
3566
  setSrcEditor(undefined);
3568
3567
  }, []);
3569
- const component = require$$0.useMemo(() => {
3568
+ const RlsImageEditorChooser = require$$0.useMemo(() => {
3570
3569
  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 }) })));
3571
3570
  }, [
3572
3571
  srcEditor,
@@ -3579,9 +3578,9 @@ function useImageEditorController(options) {
3579
3578
  onCancel
3580
3579
  ]);
3581
3580
  const onImageChooser = require$$0.useCallback(() => {
3582
- refInput.current.click();
3583
- }, []);
3584
- return { RlsImageEditorChooser: component, onImageChooser };
3581
+ !options.disabled && refInput.current.click();
3582
+ }, [options.disabled]);
3583
+ return { onImageChooser, RlsImageEditorChooser };
3585
3584
  }
3586
3585
 
3587
3586
  function RlsImageChooser(props) {