UNPKG

@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

27 lines 2.11 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TableStandAlone = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = __importDefault(require("react")); const breakpoints_1 = require("../../types/breakpoints/breakpoints"); const list_1 = require("./component/list"); const table_1 = require("./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 === breakpoints_1.DeviceBreakpointsType.MOBILE && formatListInMobile); return isList ? ((0, jsx_runtime_1.jsx)(list_1.List, { ...props, accordionIconCollapsedAriaLabel: accordionIconCollapsedAriaLabel, accordionIconExpandedAriaLabel: accordionIconExpandedAriaLabel, dataTestId: dataTestId, formatSideBySideInList: formatSideBySideInList, hasSomeExpandedContent: hasSomeExpandedContent, headerVariant: headerVariant, initialExpanded: initialExpanded })) : ((0, jsx_runtime_1.jsx)(table_1.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. */ exports.TableStandAlone = react_1.default.forwardRef(TableStandAloneComponent); //# sourceMappingURL=tableStandAlone.js.map