@rolster/react-components 18.12.8 → 18.12.9

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
@@ -1116,10 +1116,17 @@ function useDatatable() {
1116
1116
  const [scrolleable, setScrolleable] = useState(false);
1117
1117
  const bodyRef = useRef(null);
1118
1118
  useEffect(() => {
1119
- const scrollHeight = bodyRef?.current?.scrollHeight || 0;
1120
- const clientHeight = bodyRef?.current?.clientHeight || 0;
1121
- setScrolleable(scrollHeight > clientHeight);
1122
- }, [bodyRef]);
1119
+ let observer;
1120
+ if (bodyRef?.current) {
1121
+ observer = new ResizeObserver(() => {
1122
+ const scrollHeight = bodyRef?.current?.scrollHeight || 0;
1123
+ const clientHeight = bodyRef?.current?.clientHeight || 0;
1124
+ setScrolleable(scrollHeight > clientHeight);
1125
+ });
1126
+ observer.observe(bodyRef?.current);
1127
+ }
1128
+ return () => observer?.disconnect();
1129
+ }, []);
1123
1130
  return { bodyRef, scrolleable };
1124
1131
  }
1125
1132
 
@@ -1545,10 +1552,16 @@ function RlsDatatableData({ children, className, error }) {
1545
1552
  function RlsDatatableCell({ children, className, control, overflow }) {
1546
1553
  return (jsx("th", { className: renderClassStatus('rls-datatable__cell', { control, overflow }, className).trim(), children: children }));
1547
1554
  }
1548
- function RlsDatatable({ children, datatable, footer, header, rlsTheme }) {
1555
+ function RlsDatatableTotals({ children, className, error }) {
1556
+ return (jsx("div", { className: renderClassStatus('rls-datatable__totals', { error }, className).trim(), children: children }));
1557
+ }
1558
+ function RlsDatatableInfo({ children, className, control, overflow }) {
1559
+ return (jsx("div", { className: renderClassStatus('rls-datatable__info', { control, overflow }, className).trim(), children: children }));
1560
+ }
1561
+ function RlsDatatable({ children, datatable, footer, header, rlsTheme, summary }) {
1549
1562
  return (jsxs("div", { className: renderClassStatus('rls-datatable', {
1550
1563
  scrolleable: datatable?.scrolleable
1551
- }), "rls-theme": rlsTheme, children: [jsxs("table", { children: [header && jsx("thead", { className: "rls-datatable__thead", children: header }), jsx("tbody", { ref: datatable?.bodyRef, className: "rls-datatable__tbody", children: children })] }), footer && jsx("div", { className: "rls-datatable__tfooter", children: footer })] }));
1564
+ }), "rls-theme": rlsTheme, children: [jsxs("table", { children: [header && jsx("thead", { className: "rls-datatable__thead", children: header }), jsx("tbody", { ref: datatable?.bodyRef, className: "rls-datatable__tbody", children: children })] }), summary && jsx("div", { className: "rls-datatable__tsummary", children: summary }), footer && jsx("div", { className: "rls-datatable__tfooter", children: footer })] }));
1552
1565
  }
1553
1566
 
1554
1567
  const controlIsValid = (props) => {
@@ -2096,5 +2109,5 @@ function RlsApplication({ children }) {
2096
2109
  return (jsxs(RlsContext.Provider, { value: { confirmation, snackbar }, children: [jsx("div", { className: "rls-app__body", children: children }), RlsSnackbar, RlsConfirmation] }));
2097
2110
  }
2098
2111
 
2099
- export { ConfirmationResult, ListCollection, RlsAmount, RlsApplication, RlsAutocompleteField, RlsAutocompleteFieldTemplate, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsCheckBoxLabel, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableHeader, RlsDatatableTitle, RlsDateField, RlsDatePicker, RlsDateRangeField, RlsDateRangePicker, RlsDayPicker, RlsDayRangePicker, RlsFormNavigation, RlsIcon, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputText, RlsLabel, RlsMessageIcon, RlsModal, RlsMoneyField, RlsMonthPicker, RlsMonthTitlePicker, RlsNumberField, RlsPagination, RlsPasswordField, RlsPoster, RlsProgressBar, RlsRadioButton, RlsRadioButtonLabel, RlsSearchInput, RlsSelectField, RlsSelectFieldTemplate, RlsSkeleton, RlsSkeletonText, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsSwitchLabel, RlsTabularText, RlsTextField, RlsToolbar, RlsYearPicker, renderClassStatus, useConfirmationService, useDatatable, useListControl, useSnackbarService };
2112
+ export { ConfirmationResult, ListCollection, RlsAmount, RlsApplication, RlsAutocompleteField, RlsAutocompleteFieldTemplate, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsCheckBoxLabel, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableHeader, RlsDatatableInfo, RlsDatatableTitle, RlsDatatableTotals, RlsDateField, RlsDatePicker, RlsDateRangeField, RlsDateRangePicker, RlsDayPicker, RlsDayRangePicker, RlsFormNavigation, RlsIcon, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputText, RlsLabel, RlsMessageIcon, RlsModal, RlsMoneyField, RlsMonthPicker, RlsMonthTitlePicker, RlsNumberField, RlsPagination, RlsPasswordField, RlsPoster, RlsProgressBar, RlsRadioButton, RlsRadioButtonLabel, RlsSearchInput, RlsSelectField, RlsSelectFieldTemplate, RlsSkeleton, RlsSkeletonText, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsSwitchLabel, RlsTabularText, RlsTextField, RlsToolbar, RlsYearPicker, renderClassStatus, useConfirmationService, useDatatable, useListControl, useSnackbarService };
2100
2113
  //# sourceMappingURL=index.js.map