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

21 lines 2.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.List = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const footer_1 = require("../../../components/footer/footer"); const table_styled_1 = require("../table.styled"); const formatListHeaderPriority_1 = require("../types/formatListHeaderPriority"); const listColumnHeaderPriority_1 = require("./listColumnHeaderPriority"); const listRowHeaderPriority_1 = require("./listRowHeaderPriority"); const listRowPriority_1 = require("./listRowPriority"); const List = ({ formatListHeaderPriority = formatListHeaderPriority_1.FormatListHeaderPriorityType.ROW, ...props }) => { const footerVariant = props.footer?.variant ?? props.styles?.footerVariant; return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [formatListHeaderPriority === formatListHeaderPriority_1.FormatListHeaderPriorityType.ROW && ((0, jsx_runtime_1.jsx)(table_styled_1.ListContainerStyled, { "data-testid": props.dataTestId, styles: props.styles, children: formatListHeaderPriority === formatListHeaderPriority_1.FormatListHeaderPriorityType.ROW && props.values.map((value, indexValue) => { return ((0, jsx_runtime_1.jsx)(listRowPriority_1.ListRowPriority, { ...props, index: indexValue, value: value }, indexValue)); }) })), formatListHeaderPriority === formatListHeaderPriority_1.FormatListHeaderPriorityType.ROW_HEADER && ((0, jsx_runtime_1.jsx)(table_styled_1.ListContainerHeaderPriorityStyled, { "data-testid": props.dataTestId, styles: props.styles, children: props.values.map((value, indexValue) => { return ((0, jsx_runtime_1.jsx)(listRowHeaderPriority_1.ListRowHeaderPriority, { ...props, index: indexValue, value: value }, indexValue)); }) })), formatListHeaderPriority === formatListHeaderPriority_1.FormatListHeaderPriorityType.COLUMN_HEADER && ((0, jsx_runtime_1.jsx)(table_styled_1.ListContainerHeaderPriorityStyled, { "data-testid": props.dataTestId, styles: props.styles, children: (0, jsx_runtime_1.jsx)(listColumnHeaderPriority_1.ListColumnHeaderPriority, { ...props }) })), props.footer?.content && footerVariant && ((0, jsx_runtime_1.jsx)(footer_1.Footer, { simpleContainer: false, ...props.footer, variant: footerVariant, children: props.footer.content }))] })); }; exports.List = List; //# sourceMappingURL=list.js.map