@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/cjs/index.js CHANGED
@@ -2087,7 +2087,6 @@ function useListControl({ suggestions, formControl }) {
2087
2087
  };
2088
2088
  }, []);
2089
2089
  require$$0.useEffect(() => {
2090
- state.visible && formControl?.touch();
2091
2090
  setState((state) => ({
2092
2091
  ...state,
2093
2092
  higher: components.locationListCanTop(contentRef.current, listRef.current)
@@ -2134,6 +2133,7 @@ function useListControl({ suggestions, formControl }) {
2134
2133
  }
2135
2134
  function setVisible(visible) {
2136
2135
  setState((state) => ({ ...state, visible }));
2136
+ !visible && formControl?.touch();
2137
2137
  }
2138
2138
  function navigationInput(event) {
2139
2139
  if (state.visible) {
@@ -2267,17 +2267,13 @@ function useFieldAutocomplete({ disabled, formControl, onSelect, onValue, sugges
2267
2267
  };
2268
2268
  }
2269
2269
 
2270
- function RlsFieldAutocompleteTemplate({ render, suggestions, children, disabled, formControl, hiddenIcon, onSearch, onSelect, onValue, placeholder, rlsTheme, searching }) {
2271
- const fieldAutocomplete = useFieldAutocomplete({
2272
- suggestions,
2273
- disabled,
2274
- formControl,
2275
- onSelect,
2276
- onValue
2277
- });
2270
+ function RlsFieldAutocompleteTemplate(props) {
2271
+ const fieldAutocomplete = useFieldAutocomplete(props);
2272
+ const { render, children, disabled, formControl, hiddenIcon, onSearch, placeholder, rlsTheme, searching } = props;
2278
2273
  return (jsxRuntimeExports.jsxs("div", { ref: fieldAutocomplete.listControl.contentRef, className: renderClassStatus('rls-field-box', {
2279
2274
  disabled,
2280
2275
  focused: fieldAutocomplete.listControl.focused,
2276
+ error: formControl?.wrong,
2281
2277
  selected: !!fieldAutocomplete.listControl.value
2282
2278
  }, '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', {
2283
2279
  visible: fieldAutocomplete.listControl.visible,
@@ -2550,15 +2546,14 @@ function useFieldSelect({ suggestions, formControl, onSelect, onValue }) {
2550
2546
  };
2551
2547
  }
2552
2548
 
2553
- function RlsFieldSelectTemplate({ render, suggestions, children, disabled, formControl, onSelect, onValue, placeholder, rlsTheme }) {
2554
- const fieldSelect = useFieldSelect({
2555
- suggestions,
2556
- disabled,
2557
- formControl,
2558
- onSelect,
2559
- onValue
2560
- });
2561
- 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', {
2549
+ function RlsFieldSelectTemplate(props) {
2550
+ const fieldSelect = useFieldSelect(props);
2551
+ const { render, suggestions, children, disabled, formControl, placeholder, rlsTheme } = props;
2552
+ return (jsxRuntimeExports.jsxs("div", { ref: fieldSelect.listControl.contentRef, className: renderClassStatus('rls-field-box', {
2553
+ focused: fieldSelect.listControl.focused,
2554
+ error: formControl?.wrong,
2555
+ disabled
2556
+ }, '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', {
2562
2557
  visible: fieldSelect.listControl.visible
2563
2558
  }), 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', {
2564
2559
  visible: fieldSelect.listControl.visible,