UNPKG

react-native-paper

Version:
85 lines (84 loc) 4.59 kB
import * as React from 'react'; import { StyleProp, TouchableWithoutFeedback, ViewStyle } from 'react-native'; declare type Props = React.ComponentPropsWithRef<typeof TouchableWithoutFeedback> & { /** * Text content of the `DataTableTitle`. */ children: React.ReactNode; /** * Align the text to the right. Generally monetary or number fields are aligned to right. */ numeric?: boolean; /** * Direction of sorting. An arrow indicating the direction is displayed when this is given. */ sortDirection?: 'ascending' | 'descending'; /** * The number of lines to show. */ numberOfLines?: number; /** * Function to execute on press. */ onPress?: () => void; style?: StyleProp<ViewStyle>; /** * @optional */ theme: ReactNativePaper.Theme; }; /** * A component to display title in table header. * * <div class="screenshots"> * <figure> * <img class="medium" src="screenshots/data-table-header.png" /> * </figure> * </div> * * * ## Usage * ```js * import * as React from 'react'; * import { DataTable } from 'react-native-paper'; * * const MyComponent = () => ( * <DataTable> * <DataTable.Header> * <DataTable.Title * sortDirection='descending' * > * Dessert * </DataTable.Title> * <DataTable.Title numeric>Calories</DataTable.Title> * <DataTable.Title numeric>Fat (g)</DataTable.Title> * </DataTable.Header> * </DataTable> * ); * * export default MyComponent; * ``` */ declare const DataTableTitle: { ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element; displayName: string; }; declare const _default: (React.ComponentClass<Pick<Props, "ref" | "style" | "children" | "numberOfLines" | "onLayout" | "onPress" | "onLongPress" | "testID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "key" | "hitSlop" | "hasTVPreferredFocus" | "tvParallaxProperties" | "delayLongPress" | "delayPressIn" | "delayPressOut" | "disabled" | "onBlur" | "onFocus" | "onPressIn" | "onPressOut" | "pressRetentionOffset" | "touchSoundDisabled" | "numeric" | "sortDirection"> & { theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined; }, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & { ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element; displayName: string; }) | (React.FunctionComponent<Props> & { ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element; displayName: string; }), {}>) | (React.FunctionComponent<Pick<Props, "ref" | "style" | "children" | "numberOfLines" | "onLayout" | "onPress" | "onLongPress" | "testID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "key" | "hitSlop" | "hasTVPreferredFocus" | "tvParallaxProperties" | "delayLongPress" | "delayPressIn" | "delayPressOut" | "disabled" | "onBlur" | "onFocus" | "onPressIn" | "onPressOut" | "pressRetentionOffset" | "touchSoundDisabled" | "numeric" | "sortDirection"> & { theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined; }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & { ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element; displayName: string; }) | (React.FunctionComponent<Props> & { ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element; displayName: string; }), {}>); export default _default; export { DataTableTitle };