UNPKG

4.39 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, TouchableWithoutFeedback, ViewStyle, TextStyle } 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 * Text content style of the `DataTableTitle`.
27 */
28 textStyle?: StyleProp<TextStyle>;
29 /**
30 * @optional
31 */
32 theme: ReactNativePaper.Theme;
33};
34/**
35 * A component to display title in table header.
36 *
37 * <div class="screenshots">
38 * <figure>
39 * <img class="medium" src="screenshots/data-table-header.png" />
40 * </figure>
41 * </div>
42 *
43 *
44 * ## Usage
45 * ```js
46 * import * as React from 'react';
47 * import { DataTable } from 'react-native-paper';
48 *
49 * const MyComponent = () => (
50 * <DataTable>
51 * <DataTable.Header>
52 * <DataTable.Title
53 * sortDirection='descending'
54 * >
55 * Dessert
56 * </DataTable.Title>
57 * <DataTable.Title numeric>Calories</DataTable.Title>
58 * <DataTable.Title numeric>Fat (g)</DataTable.Title>
59 * </DataTable.Header>
60 * </DataTable>
61 * );
62 *
63 * export default MyComponent;
64 * ```
65 */
66declare const DataTableTitle: {
67 ({ numeric, children, onPress, sortDirection, theme, textStyle, style, numberOfLines, ...rest }: Props): JSX.Element;
68 displayName: string;
69};
70declare const _default: React.ComponentType<Pick<import("react-native").TouchableWithoutFeedbackProps & React.RefAttributes<TouchableWithoutFeedback> & {
71 /**
72 * Text content of the `DataTableTitle`.
73 */
74 children: React.ReactNode;
75 /**
76 * Align the text to the right. Generally monetary or number fields are aligned to right.
77 */
78 numeric?: boolean | undefined;
79 /**
80 * Direction of sorting. An arrow indicating the direction is displayed when this is given.
81 */
82 sortDirection?: "ascending" | "descending" | undefined;
83 /**
84 * The number of lines to show.
85 */
86 numberOfLines?: number | undefined;
87 /**
88 * Function to execute on press.
89 */
90 onPress?: (() => void) | undefined;
91 style?: StyleProp<ViewStyle>;
92 /**
93 * Text content style of the `DataTableTitle`.
94 */
95 textStyle?: StyleProp<TextStyle>;
96 /**
97 * @optional
98 */
99 theme: ReactNativePaper.Theme;
100}, "numberOfLines" | keyof import("react-native").TouchableWithoutFeedbackProps | keyof React.RefAttributes<TouchableWithoutFeedback> | "numeric" | "textStyle" | "sortDirection"> & {
101 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
102}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<import("react-native").TouchableWithoutFeedbackProps & React.RefAttributes<TouchableWithoutFeedback> & {
103 /**
104 * Text content of the `DataTableTitle`.
105 */
106 children: React.ReactNode;
107 /**
108 * Align the text to the right. Generally monetary or number fields are aligned to right.
109 */
110 numeric?: boolean | undefined;
111 /**
112 * Direction of sorting. An arrow indicating the direction is displayed when this is given.
113 */
114 sortDirection?: "ascending" | "descending" | undefined;
115 /**
116 * The number of lines to show.
117 */
118 numberOfLines?: number | undefined;
119 /**
120 * Function to execute on press.
121 */
122 onPress?: (() => void) | undefined;
123 style?: StyleProp<ViewStyle>;
124 /**
125 * Text content style of the `DataTableTitle`.
126 */
127 textStyle?: StyleProp<TextStyle>;
128 /**
129 * @optional
130 */
131 theme: ReactNativePaper.Theme;
132}> & {
133 ({ numeric, children, onPress, sortDirection, theme, textStyle, style, numberOfLines, ...rest }: Props): JSX.Element;
134 displayName: string;
135}, {}>;
136export default _default;
137export { DataTableTitle };
138
\No newline at end of file