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