@rolster/react-components 19.8.17 → 19.8.19

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.mjs CHANGED
@@ -1979,7 +1979,7 @@ function RlsNavbarMenuComponent({ options, onOption }) {
1979
1979
  }
1980
1980
  const RlsNavbarMenu = memo(RlsNavbarMenuComponent);
1981
1981
 
1982
- function PageButton({ page, onSelect }) {
1982
+ function RlsPaginationButton({ page, onSelect }) {
1983
1983
  const className = renderClassStatus('rls-pagination__page', {
1984
1984
  active: page.active
1985
1985
  });
@@ -2033,7 +2033,7 @@ function RlsPaginationComponent({ suggestions, count, filter, onPagination, posi
2033
2033
  const goLastPagination = useCallback(() => {
2034
2034
  refreshPagination(controller.current?.goLastPage());
2035
2035
  }, [refreshPagination]);
2036
- return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template?.pages.map((page) => (jsxRuntimeExports.jsx(PageButton, { page: page, onSelect: goToPagination }, page.value))) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template?.description }), jsxRuntimeExports.jsx("span", { className: "rls-pagination__count", children: suggestions.length })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
2036
+ return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template?.pages.map((page) => (jsxRuntimeExports.jsx(RlsPaginationButton, { page: page, onSelect: goToPagination }, page.value))) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template?.description }), jsxRuntimeExports.jsx("span", { className: "rls-pagination__count", children: suggestions.length })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
2037
2037
  }
2038
2038
  const RlsPagination = memo(RlsPaginationComponent);
2039
2039
 
@@ -2578,7 +2578,7 @@ function useListController({ suggestions, automatic, formControl, reference }) {
2578
2578
  ...state,
2579
2579
  value: element?.description || ''
2580
2580
  }));
2581
- changeValueInternal.current = true;
2581
+ changeValueInternal.current = !Object.is(element?.value, formControl?.value);
2582
2582
  if (valueIsDefault) {
2583
2583
  formControl?.setDefaultValue(element?.value);
2584
2584
  }
@@ -2608,6 +2608,9 @@ function useListController({ suggestions, automatic, formControl, reference }) {
2608
2608
  if (element) {
2609
2609
  setFormValue(element);
2610
2610
  }
2611
+ else if (automatic) {
2612
+ setFormValue(collection.value[0], true);
2613
+ }
2611
2614
  else {
2612
2615
  refreshState((state) => ({ ...state, value: '' }));
2613
2616
  }