@rolster/react-components 18.15.13 → 18.15.14

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
@@ -2085,7 +2085,6 @@ function useListControl({ suggestions, formControl }) {
2085
2085
  };
2086
2086
  }, []);
2087
2087
  useEffect(() => {
2088
- state.visible && formControl?.touch();
2089
2088
  setState((state) => ({
2090
2089
  ...state,
2091
2090
  higher: locationListCanTop(contentRef.current, listRef.current)
@@ -2132,6 +2131,7 @@ function useListControl({ suggestions, formControl }) {
2132
2131
  }
2133
2132
  function setVisible(visible) {
2134
2133
  setState((state) => ({ ...state, visible }));
2134
+ !visible && formControl?.touch();
2135
2135
  }
2136
2136
  function navigationInput(event) {
2137
2137
  if (state.visible) {
@@ -2265,17 +2265,13 @@ function useFieldAutocomplete({ disabled, formControl, onSelect, onValue, sugges
2265
2265
  };
2266
2266
  }
2267
2267
 
2268
- function RlsFieldAutocompleteTemplate({ render, suggestions, children, disabled, formControl, hiddenIcon, onSearch, onSelect, onValue, placeholder, rlsTheme, searching }) {
2269
- const fieldAutocomplete = useFieldAutocomplete({
2270
- suggestions,
2271
- disabled,
2272
- formControl,
2273
- onSelect,
2274
- onValue
2275
- });
2268
+ function RlsFieldAutocompleteTemplate(props) {
2269
+ const fieldAutocomplete = useFieldAutocomplete(props);
2270
+ const { render, children, disabled, formControl, hiddenIcon, onSearch, placeholder, rlsTheme, searching } = props;
2276
2271
  return (jsxRuntimeExports.jsxs("div", { ref: fieldAutocomplete.listControl.contentRef, className: renderClassStatus('rls-field-box', {
2277
2272
  disabled,
2278
2273
  focused: fieldAutocomplete.listControl.focused,
2274
+ error: formControl?.wrong,
2279
2275
  selected: !!fieldAutocomplete.listControl.value
2280
2276
  }, 'rls-field-list rls-field-autocomplete'), "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: fieldAutocomplete.listControl.value, onClick: fieldAutocomplete.onClickControl }), !hiddenIcon && fieldAutocomplete.listControl.value && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: fieldAutocomplete.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: "trash-2" }) }))] }) }), jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }), jsxRuntimeExports.jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
2281
2277
  visible: fieldAutocomplete.listControl.visible,
@@ -2548,15 +2544,14 @@ function useFieldSelect({ suggestions, formControl, onSelect, onValue }) {
2548
2544
  };
2549
2545
  }
2550
2546
 
2551
- function RlsFieldSelectTemplate({ render, suggestions, children, disabled, formControl, onSelect, onValue, placeholder, rlsTheme }) {
2552
- const fieldSelect = useFieldSelect({
2553
- suggestions,
2554
- disabled,
2555
- formControl,
2556
- onSelect,
2557
- onValue
2558
- });
2559
- return (jsxRuntimeExports.jsxs("div", { ref: fieldSelect.listControl.contentRef, className: renderClassStatus('rls-field-box', { focused: fieldSelect.listControl.focused, disabled }, 'rls-field-list rls-field-select'), "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: fieldSelect.listControl.inputRef, className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: fieldSelect.listControl.value, onFocus: fieldSelect.onFocusInput, onBlur: fieldSelect.onBlurInput, onClick: fieldSelect.onClickInput, onKeyDown: fieldSelect.onKeydownInput }), jsxRuntimeExports.jsx("button", { className: renderClassStatus('rls-field-list__action', {
2547
+ function RlsFieldSelectTemplate(props) {
2548
+ const fieldSelect = useFieldSelect(props);
2549
+ const { render, suggestions, children, disabled, formControl, placeholder, rlsTheme } = props;
2550
+ return (jsxRuntimeExports.jsxs("div", { ref: fieldSelect.listControl.contentRef, className: renderClassStatus('rls-field-box', {
2551
+ focused: fieldSelect.listControl.focused,
2552
+ error: formControl?.wrong,
2553
+ disabled
2554
+ }, 'rls-field-list rls-field-select'), "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: fieldSelect.listControl.inputRef, className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: fieldSelect.listControl.value, onFocus: fieldSelect.onFocusInput, onBlur: fieldSelect.onBlurInput, onClick: fieldSelect.onClickInput, onKeyDown: fieldSelect.onKeydownInput }), jsxRuntimeExports.jsx("button", { className: renderClassStatus('rls-field-list__action', {
2560
2555
  visible: fieldSelect.listControl.visible
2561
2556
  }), disabled: disabled, onClick: fieldSelect.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-down" }) })] }) }), jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }), jsxRuntimeExports.jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
2562
2557
  visible: fieldSelect.listControl.visible,