UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

39 lines 1.38 kB
import iconNavDownArrow from '@ui5/webcomponents-icons/dist/navigation-down-arrow.js'; import iconNavRightArrow from '@ui5/webcomponents-icons/dist/navigation-right-arrow.js'; import { TextAlign } from '../../../../enums/index.js'; import { Icon } from '../../../../webComponents/index.js'; import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; const tableGroupExpandCollapseIcon = { color: 'var(--sapContent_IconColor)', height: '0.75rem', width: '0.75rem', padding: '0.625rem', display: 'block' }; export const Grouped = props => { const { cell, row, webComponentsReactProperties } = props; const { translatableTexts } = webComponentsReactProperties; const style = {}; if (cell.column.hAlign && (cell.column.hAlign !== TextAlign.Left || cell.column.hAlign !== TextAlign.Begin)) { style.marginRight = 'auto'; } return /*#__PURE__*/_jsxs(_Fragment, { children: [/*#__PURE__*/_jsx("span", { ...row.getToggleRowExpandedProps({ style, column: cell.column }), title: row.isExpanded ? translatableTexts.collapseNodeA11yText : translatableTexts.expandNodeA11yText, children: /*#__PURE__*/_jsx(Icon, { name: row.isExpanded ? iconNavDownArrow : iconNavRightArrow, style: tableGroupExpandCollapseIcon }) }), cell.render('Cell')] }); };