UNPKG

4.59 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, TouchableWithoutFeedback, ViewStyle } from 'react-native';
3declare type Props = React.ComponentPropsWithRef<typeof TouchableWithoutFeedback> & {
4 /**
5 * Text content of the `DataTableTitle`.
6 */
7 children: React.ReactNode;
8 /**
9 * Align the text to the right. Generally monetary or number fields are aligned to right.
10 */
11 numeric?: boolean;
12 /**
13 * Direction of sorting. An arrow indicating the direction is displayed when this is given.
14 */
15 sortDirection?: 'ascending' | 'descending';
16 /**
17 * The number of lines to show.
18 */
19 numberOfLines?: number;
20 /**
21 * Function to execute on press.
22 */
23 onPress?: () => void;
24 style?: StyleProp<ViewStyle>;
25 /**
26 * @optional
27 */
28 theme: ReactNativePaper.Theme;
29};
30/**
31 * A component to display title in table header.
32 *
33 * <div class="screenshots">
34 * <figure>
35 * <img class="medium" src="screenshots/data-table-header.png" />
36 * </figure>
37 * </div>
38 *
39 *
40 * ## Usage
41 * ```js
42 * import * as React from 'react';
43 * import { DataTable } from 'react-native-paper';
44 *
45 * const MyComponent = () => (
46 * <DataTable>
47 * <DataTable.Header>
48 * <DataTable.Title
49 * sortDirection='descending'
50 * >
51 * Dessert
52 * </DataTable.Title>
53 * <DataTable.Title numeric>Calories</DataTable.Title>
54 * <DataTable.Title numeric>Fat (g)</DataTable.Title>
55 * </DataTable.Header>
56 * </DataTable>
57 * );
58 *
59 * export default MyComponent;
60 * ```
61 */
62declare const DataTableTitle: {
63 ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element;
64 displayName: string;
65};
66declare 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"> & {
67 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
68}, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & {
69 ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element;
70 displayName: string;
71}) | (React.FunctionComponent<Props> & {
72 ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element;
73 displayName: string;
74}), {}>) | (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"> & {
75 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
76}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & {
77 ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element;
78 displayName: string;
79}) | (React.FunctionComponent<Props> & {
80 ({ numeric, children, onPress, sortDirection, theme, style, numberOfLines, ...rest }: Props): JSX.Element;
81 displayName: string;
82}), {}>);
83export default _default;
84export { DataTableTitle };