@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
21 lines • 1.76 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { DeviceBreakpointsType } from '../../types/breakpoints/breakpoints';
import { List } from './component/list';
import { Table } from './component/table';
const TableStandAloneComponent = ({ accordionIconCollapsedAriaLabel = 'Expand current last cell', accordionIconExpandedAriaLabel = 'Collapse current las cell', initialExpanded = false, dataTestId = 'table', headerVariant = 'PRIMARY',
// deprecated - use formatList instead
formatListInMobile = false, formatSideBySideInList = false, ...props }, ref) => {
const hasSomeExpandedContent = props.values.some(o => {
return !!Object.getOwnPropertyDescriptor(o, 'expandedContent');
});
const isList = (props.formatList && props.formatList[props.device]) ||
(props.device === DeviceBreakpointsType.MOBILE && formatListInMobile);
return isList ? (_jsx(List, { ...props, accordionIconCollapsedAriaLabel: accordionIconCollapsedAriaLabel, accordionIconExpandedAriaLabel: accordionIconExpandedAriaLabel, dataTestId: dataTestId, formatSideBySideInList: formatSideBySideInList, hasSomeExpandedContent: hasSomeExpandedContent, headerVariant: headerVariant, initialExpanded: initialExpanded })) : (_jsx(Table, { ...props, ref: ref, accordionIconCollapsedAriaLabel: accordionIconCollapsedAriaLabel, accordionIconExpandedAriaLabel: accordionIconExpandedAriaLabel, dataTestId: dataTestId, hasSomeExpandedContent: hasSomeExpandedContent, headerVariant: headerVariant, initialExpanded: initialExpanded }));
};
/**
* @description
* Table component is used to display data in a tabular format.
*/
export const TableStandAlone = React.forwardRef(TableStandAloneComponent);
//# sourceMappingURL=tableStandAlone.js.map