UNPKG

4.22 kBSource Map (JSON)View Raw
1{"version":3,"sources":["DataTableRow.tsx"],"names":["React","color","StyleSheet","View","TouchableRipple","black","white","withTheme","DataTableRow","onPress","style","theme","children","pointerEvents","rest","borderBottomColor","dark","alpha","rgb","string","styles","container","content","displayName","create","borderStyle","borderBottomWidth","hairlineWidth","minHeight","paddingHorizontal","flex","flexDirection"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SACEC,UADF,EAGEC,IAHF,QAMO,cANP;AAOA,OAAOC,eAAP,MAA4B,oCAA5B;AACA,SAASC,KAAT,EAAgBC,KAAhB,QAA6B,qBAA7B;AACA,SAASC,SAAT,QAA0B,oBAA1B;;AAuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAMC,YAAY,GAAG,QAOR;AAAA,MAPS;AACpBC,IAAAA,OADoB;AAEpBC,IAAAA,KAFoB;AAGpBC,IAAAA,KAHoB;AAIpBC,IAAAA,QAJoB;AAKpBC,IAAAA,aALoB;AAMpB,OAAGC;AANiB,GAOT;AACX,QAAMC,iBAAiB,GAAGd,KAAK,CAACU,KAAK,CAACK,IAAN,GAAaV,KAAb,GAAqBD,KAAtB,CAAL,CACvBY,KADuB,CACjB,IADiB,EAEvBC,GAFuB,GAGvBC,MAHuB,EAA1B;AAKA,sBACE,oBAAC,eAAD,eACML,IADN;AAEE,IAAA,OAAO,EAAEL,OAFX;AAGE,IAAA,KAAK,EAAE,CAACW,MAAM,CAACC,SAAR,EAAmB;AAAEN,MAAAA;AAAF,KAAnB,EAA0CL,KAA1C;AAHT,mBAKE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEU,MAAM,CAACE,OAApB;AAA6B,IAAA,aAAa,EAAET;AAA5C,KACGD,QADH,CALF,CADF;AAWD,CAxBD;;AA0BAJ,YAAY,CAACe,WAAb,GAA2B,eAA3B;AAEA,MAAMH,MAAM,GAAGlB,UAAU,CAACsB,MAAX,CAAkB;AAC/BH,EAAAA,SAAS,EAAE;AACTI,IAAAA,WAAW,EAAE,OADJ;AAETC,IAAAA,iBAAiB,EAAExB,UAAU,CAACyB,aAFrB;AAGTC,IAAAA,SAAS,EAAE,EAHF;AAITC,IAAAA,iBAAiB,EAAE;AAJV,GADoB;AAO/BP,EAAAA,OAAO,EAAE;AACPQ,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,aAAa,EAAE;AAFR;AAPsB,CAAlB,CAAf;AAaA,eAAexB,SAAS,CAACC,YAAD,CAAxB,C,CAEA;;AACA,SAASA,YAAT","sourcesContent":["import * as React from 'react';\nimport color from 'color';\nimport {\n StyleSheet,\n StyleProp,\n View,\n ViewStyle,\n ViewProps,\n} from 'react-native';\nimport TouchableRipple from '../TouchableRipple/TouchableRipple';\nimport { black, white } from '../../styles/colors';\nimport { withTheme } from '../../core/theming';\nimport type { $RemoveChildren } from '../../types';\n\ntype Props = $RemoveChildren<typeof TouchableRipple> & {\n /**\n * Content of the `DataTableRow`.\n */\n children: React.ReactNode;\n /**\n * Function to execute on press.\n */\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n /**\n * @optional\n */\n theme: ReactNativePaper.Theme;\n /**\n * `pointerEvents` passed to the `View` container, which is wrapping children within `TouchableRipple`.\n */\n pointerEvents?: ViewProps['pointerEvents'];\n};\n\n/**\n * A component to show a single row inside of a table.\n *\n * <div class=\"screenshots\">\n * <figure>\n * <img class=\"medium\" src=\"screenshots/data-table-row-cell.png\" />\n * </figure>\n * </div>\n *\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { DataTable } from 'react-native-paper';\n *\n * const MyComponent = () => (\n * <DataTable.Row>\n * <DataTable.Cell numeric>1</DataTable.Cell>\n * <DataTable.Cell numeric>2</DataTable.Cell>\n * <DataTable.Cell numeric>3</DataTable.Cell>\n * <DataTable.Cell numeric>4</DataTable.Cell>\n * </DataTable.Row>\n * );\n *\n * export default MyComponent;\n * ```\n */\n\nconst DataTableRow = ({\n onPress,\n style,\n theme,\n children,\n pointerEvents,\n ...rest\n}: Props) => {\n const borderBottomColor = color(theme.dark ? white : black)\n .alpha(0.12)\n .rgb()\n .string();\n\n return (\n <TouchableRipple\n {...rest}\n onPress={onPress}\n style={[styles.container, { borderBottomColor }, style]}\n >\n <View style={styles.content} pointerEvents={pointerEvents}>\n {children}\n </View>\n </TouchableRipple>\n );\n};\n\nDataTableRow.displayName = 'DataTable.Row';\n\nconst styles = StyleSheet.create({\n container: {\n borderStyle: 'solid',\n borderBottomWidth: StyleSheet.hairlineWidth,\n minHeight: 48,\n paddingHorizontal: 16,\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n },\n});\n\nexport default withTheme(DataTableRow);\n\n// @component-docs ignore-next-line\nexport { DataTableRow };\n"]}
\No newline at end of file