@rolster/react-components 18.12.7 → 18.12.8

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
@@ -1112,6 +1112,17 @@ const reactI18n = i18n({
1112
1112
  }
1113
1113
  });
1114
1114
 
1115
+ function useDatatable() {
1116
+ const [scrolleable, setScrolleable] = useState(false);
1117
+ const bodyRef = useRef(null);
1118
+ useEffect(() => {
1119
+ const scrollHeight = bodyRef?.current?.scrollHeight || 0;
1120
+ const clientHeight = bodyRef?.current?.clientHeight || 0;
1121
+ setScrolleable(scrollHeight > clientHeight);
1122
+ }, [bodyRef]);
1123
+ return { bodyRef, scrolleable };
1124
+ }
1125
+
1115
1126
  class ListCollection {
1116
1127
  constructor(value) {
1117
1128
  this.value = value;
@@ -1526,19 +1537,18 @@ function RlsDatatableHeader({ children }) {
1526
1537
  return jsx("tr", { className: "rls-datatable__header", children: children });
1527
1538
  }
1528
1539
  function RlsDatatableTitle({ children, className, control }) {
1529
- return (jsx("th", { className: (renderClassStatus('rls-datatable__title', { control }) +
1530
- ` ${className || ''}`).trim(), children: children }));
1540
+ return (jsx("th", { className: renderClassStatus('rls-datatable__title', { control }, className).trim(), children: children }));
1531
1541
  }
1532
1542
  function RlsDatatableData({ children, className, error }) {
1533
- return (jsx("tr", { className: (renderClassStatus('rls-datatable__data', { error }) +
1534
- ` ${className || ''}`).trim(), children: children }));
1543
+ return (jsx("tr", { className: renderClassStatus('rls-datatable__data', { error }, className).trim(), children: children }));
1535
1544
  }
1536
1545
  function RlsDatatableCell({ children, className, control, overflow }) {
1537
- return (jsx("th", { className: (renderClassStatus('rls-datatable__cell', { control, overflow }) +
1538
- ` ${className || ''}`).trim(), children: children }));
1546
+ return (jsx("th", { className: renderClassStatus('rls-datatable__cell', { control, overflow }, className).trim(), children: children }));
1539
1547
  }
1540
- function RlsDatatable({ bodyRef, children, footer, header, rlsTheme }) {
1541
- return (jsxs("div", { className: "rls-datatable", "rls-theme": rlsTheme, children: [jsxs("table", { children: [header && jsx("thead", { className: "rls-datatable__thead", children: header }), jsx("tbody", { ref: bodyRef, className: "rls-datatable__tbody", children: children })] }), footer && jsx("div", { className: "rls-datatable__tfooter", children: footer })] }));
1548
+ function RlsDatatable({ children, datatable, footer, header, rlsTheme }) {
1549
+ return (jsxs("div", { className: renderClassStatus('rls-datatable', {
1550
+ 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 })] }));
1542
1552
  }
1543
1553
 
1544
1554
  const controlIsValid = (props) => {
@@ -2086,5 +2096,5 @@ function RlsApplication({ children }) {
2086
2096
  return (jsxs(RlsContext.Provider, { value: { confirmation, snackbar }, children: [jsx("div", { className: "rls-app__body", children: children }), RlsSnackbar, RlsConfirmation] }));
2087
2097
  }
2088
2098
 
2089
- 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, useListControl, useSnackbarService };
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 };
2090
2100
  //# sourceMappingURL=index.js.map