@rolster/react-components 18.21.41 → 18.21.43

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
@@ -1552,7 +1552,7 @@ function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
1552
1552
  return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
1553
1553
  }
1554
1554
 
1555
- function RlsInput({ children, decimals, disabled, formControl, identifier, onEnter, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
1555
+ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
1556
1556
  const valueInitial = formControl?.value ?? value ? String(value) : '';
1557
1557
  const [valueInput, setValueInput] = useState(valueInitial);
1558
1558
  const [focused, setFocused] = useState(false);
@@ -1584,11 +1584,13 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onEnt
1584
1584
  const _onFocus = useCallback(() => {
1585
1585
  formControl?.focus();
1586
1586
  setFocused(() => true);
1587
- }, [formControl]);
1587
+ onFocus && onFocus();
1588
+ }, [formControl, onFocus]);
1588
1589
  const _onBlur = useCallback(() => {
1589
1590
  formControl?.blur();
1590
1591
  setFocused(() => false);
1591
- }, [formControl]);
1592
+ onBlur && onBlur();
1593
+ }, [formControl, onBlur]);
1592
1594
  const className = useMemo(() => {
1593
1595
  return renderClassStatus('rls-input', {
1594
1596
  disabled: formControl?.disabled || disabled,
@@ -2634,17 +2636,24 @@ function useFieldAutocomplete(props) {
2634
2636
  }, [controller.setState]);
2635
2637
  const onChange = useCallback((element) => {
2636
2638
  if (props.onSelect) {
2637
- controller.setState({ modalIsVisible: false });
2638
2639
  element.value && props.onSelect(element.value);
2639
2640
  }
2640
2641
  else {
2641
- controller.setState({ modalIsVisible: false });
2642
2642
  controller.setFormValue(element);
2643
2643
  }
2644
+ if (props.selectionContinuos) {
2645
+ setPattern('');
2646
+ controller.inputRef?.current?.focus();
2647
+ }
2648
+ else {
2649
+ controller.setState({ modalIsVisible: false });
2650
+ }
2644
2651
  props.onValue && props.onValue(element.value);
2645
2652
  }, [
2646
2653
  controller.setState,
2647
2654
  controller.setFormValue,
2655
+ setPattern,
2656
+ props.selectionContinuos,
2648
2657
  props.onSelect,
2649
2658
  props.onValue
2650
2659
  ]);