UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

1 lines 1.28 kB
{"version":3,"file":"ViewPercentageCell.cjs","sources":["../../../../../src/lib/DataTable/cells/ViewPercentageCell.tsx"],"sourcesContent":["import type {ComponentProps, FC} from 'react';\n\nimport type {NumberProps} from '@/lib/Number';\nimport {NumberPercent} from '@/lib/Number';\nimport type {Locale} from '@/internal/locale';\n\nimport type {CellComponent} from './../types.ts';\nimport classes from './Cells.module.css';\n\nexport type Props = ComponentProps<CellComponent> &\n Omit<NumberProps, 'notation' | 'compactDisplay' | 'value' | 'locale'>;\n\nexport const ViewPercentageCell: FC<Props> = ({value, cellContext, ...restProps}) => {\n const locale = cellContext.table.options.meta?.locale as Locale;\n return (\n <div className={classes.viewNumberCell}>\n <NumberPercent {...restProps} locale={locale} value={Number(value)} />\n </div>\n );\n};\n"],"names":["ViewPercentageCell","value","cellContext","restProps","locale","_a","jsx","classes","NumberPercent"],"mappings":"kNAYaA,EAAgC,CAAC,CAAC,MAAAC,EAAO,YAAAC,EAAa,GAAGC,KAAe,OACjF,MAAMC,GAASC,EAAAH,EAAY,MAAM,QAAQ,OAA1B,YAAAG,EAAgC,OAC/C,OACKC,EAAAA,IAAA,MAAA,CAAI,UAAWC,EAAAA,QAAQ,eACpB,SAACD,EAAA,IAAAE,EAAA,cAAA,CAAe,GAAGL,EAAW,OAAAC,EAAgB,MAAO,OAAOH,CAAK,CAAG,CAAA,EACxE,CAER"}