UNPKG

@adaptabletools/adaptable

Version:

Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

12 lines (11 loc) 909 B
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime"; import { PercentBarStylePreview } from './PercentBarStylePreview'; import { Box, Flex } from '../../../../../components/Flex'; import { Tag } from '../../../../../components/Tag'; export const PercentBarPreview = (props) => { let postfix = ''; if (props.percentBarStyle.RangeValueType === 'Percentage') { postfix = '%'; } return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children: props.percentBarStyle.CellRanges.map((range, i) => (_jsxs(Flex, { alignItems: "stretch", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Tag, { children: [range.Min, postfix, " \u2192 ", range.Max, postfix] }), _jsx(Box, { className: "twa:flex-1 twa:min-w-[120px]", children: _jsx(PercentBarStylePreview, { backgroundColor: props.percentBarStyle.BackColor, barBackgroundColor: range.Color }) })] }, i))) })); };