@trama-ui/react-native 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +198 -2
- package/dist/accordion.d.ts +29 -0
- package/dist/accordion.js +137 -0
- package/dist/alert.d.ts +30 -0
- package/dist/alert.js +95 -0
- package/dist/avatar.d.ts +36 -0
- package/dist/avatar.js +91 -0
- package/dist/bars.d.ts +44 -0
- package/dist/bars.js +74 -0
- package/dist/button.d.ts +30 -0
- package/dist/button.js +90 -0
- package/dist/calendar.d.ts +71 -0
- package/dist/calendar.js +276 -0
- package/dist/card.d.ts +41 -0
- package/dist/card.js +139 -0
- package/dist/choices.d.ts +87 -0
- package/dist/choices.js +228 -0
- package/dist/collections.d.ts +131 -0
- package/dist/collections.js +230 -0
- package/dist/color-code.d.ts +37 -0
- package/dist/color-code.js +158 -0
- package/dist/compositions.d.ts +110 -0
- package/dist/compositions.js +190 -0
- package/dist/controls.d.ts +85 -0
- package/dist/controls.js +221 -0
- package/dist/drag-drop.d.ts +65 -0
- package/dist/drag-drop.js +482 -0
- package/dist/feedback.d.ts +30 -0
- package/dist/feedback.js +81 -0
- package/dist/file-upload.d.ts +67 -0
- package/dist/file-upload.js +251 -0
- package/dist/generated/icons.d.ts +1037 -0
- package/dist/generated/icons.js +3 -0
- package/dist/generated/tokens.d.ts +64 -0
- package/dist/generated/tokens.js +65 -0
- package/dist/icon.d.ts +31 -0
- package/dist/icon.js +28 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +43 -0
- package/dist/input.d.ts +43 -0
- package/dist/input.js +115 -0
- package/dist/interactive-layout.d.ts +26 -0
- package/dist/interactive-layout.js +117 -0
- package/dist/internal/content.d.ts +17 -0
- package/dist/internal/content.js +24 -0
- package/dist/internal/drag-geometry.d.ts +16 -0
- package/dist/internal/drag-geometry.js +25 -0
- package/dist/internal/keyboard.d.ts +20 -0
- package/dist/internal/keyboard.js +101 -0
- package/dist/internal/motion.d.ts +1 -0
- package/dist/internal/motion.js +24 -0
- package/dist/internal/number-format.d.ts +4 -0
- package/dist/internal/number-format.js +25 -0
- package/dist/internal/pointer-capture.d.ts +1 -0
- package/dist/internal/pointer-capture.js +16 -0
- package/dist/internal/state.d.ts +6 -0
- package/dist/internal/state.js +28 -0
- package/dist/internal/system-drag.d.ts +48 -0
- package/dist/internal/system-drag.js +93 -0
- package/dist/internal/table-drag.d.ts +56 -0
- package/dist/internal/table-drag.js +237 -0
- package/dist/internal/table-editing.d.ts +49 -0
- package/dist/internal/table-editing.js +278 -0
- package/dist/internal/table-editor.d.ts +11 -0
- package/dist/internal/table-editor.js +31 -0
- package/dist/internal/table-grid.d.ts +44 -0
- package/dist/internal/table-grid.js +153 -0
- package/dist/internal/table-model.d.ts +132 -0
- package/dist/internal/table-model.js +231 -0
- package/dist/internal/table-source.d.ts +9 -0
- package/dist/internal/table-source.js +80 -0
- package/dist/internal/tour-target.d.ts +23 -0
- package/dist/internal/tour-target.js +81 -0
- package/dist/keyboard.d.ts +14 -0
- package/dist/keyboard.js +27 -0
- package/dist/layout.d.ts +35 -0
- package/dist/layout.js +77 -0
- package/dist/loader.d.ts +18 -0
- package/dist/loader.js +79 -0
- package/dist/localization.d.ts +106 -0
- package/dist/localization.js +310 -0
- package/dist/media.d.ts +35 -0
- package/dist/media.js +96 -0
- package/dist/menus.d.ts +103 -0
- package/dist/menus.js +422 -0
- package/dist/navigation.d.ts +111 -0
- package/dist/navigation.js +255 -0
- package/dist/overlays.d.ts +97 -0
- package/dist/overlays.js +364 -0
- package/dist/pill.d.ts +33 -0
- package/dist/pill.js +90 -0
- package/dist/progress.d.ts +27 -0
- package/dist/progress.js +154 -0
- package/dist/responsive.d.ts +15 -0
- package/dist/responsive.js +27 -0
- package/dist/select.d.ts +74 -0
- package/dist/select.js +181 -0
- package/dist/separator.d.ts +13 -0
- package/dist/separator.js +34 -0
- package/dist/switch.d.ts +26 -0
- package/dist/switch.js +69 -0
- package/dist/table.d.ts +122 -0
- package/dist/table.js +928 -0
- package/dist/text-fields.d.ts +39 -0
- package/dist/text-fields.js +134 -0
- package/dist/theme.d.ts +47 -0
- package/dist/theme.js +71 -0
- package/dist/transient.d.ts +80 -0
- package/dist/transient.js +273 -0
- package/package.json +50 -4
package/dist/table.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type PressableProps, type ViewProps } from 'react-native';
|
|
3
|
+
import { type TableKeyboardEvent } from './internal/table-grid.js';
|
|
4
|
+
import { type TableCellAddress, type TableCellRange, type TableClipboard, type TableColumnDefinition, type TableDataSource, type TableExportOptions, type TableRowId, type TableRowsChange, type TableSort } from './internal/table-model.js';
|
|
5
|
+
import type { TramaResponsive } from './responsive.js';
|
|
6
|
+
type RowId = TableRowId;
|
|
7
|
+
export type { TableSort, TableColumnDefinition, TableRowId, TableValue, TableCellAddress, TableCellRange, TableCellChange, TableCellEditor, TableRowsChange, TableClipboard, TableExportOptions, TableDataSource, TableQuery, } from './internal/table-model.js';
|
|
8
|
+
export type { TableKeyboardEvent } from './internal/table-grid.js';
|
|
9
|
+
export interface TableKeyboardCellProps extends Pick<PressableProps, 'accessibilityRole' | 'accessibilityState' | 'accessibilityLabel' | 'accessibilityHint' | 'aria-selected' | 'style' | 'tabIndex'> {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
onPress?: NonNullable<PressableProps['onPress']>;
|
|
12
|
+
onFocus?: () => void;
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
focusRef: (host: {
|
|
15
|
+
focus(): void;
|
|
16
|
+
} | null) => void;
|
|
17
|
+
handleKey: (event: TableKeyboardEvent) => boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface TableHandle {
|
|
20
|
+
selectRange(range: TableCellRange | null): boolean;
|
|
21
|
+
beginEdit(cell: TableCellAddress): boolean;
|
|
22
|
+
saveEdit(): boolean;
|
|
23
|
+
cancelEdit(): void;
|
|
24
|
+
copySelection(): Promise<string>;
|
|
25
|
+
pasteSelection(content?: string): Promise<boolean>;
|
|
26
|
+
fillSelection(): boolean;
|
|
27
|
+
undo(): boolean;
|
|
28
|
+
redo(): boolean;
|
|
29
|
+
exportData(options?: TableExportOptions): string;
|
|
30
|
+
setColumnOrder(order: readonly string[]): boolean;
|
|
31
|
+
setHiddenColumns(columns: readonly string[]): boolean;
|
|
32
|
+
focusCell(cell: TableCellAddress): boolean;
|
|
33
|
+
handleKey(event: TableKeyboardEvent): boolean;
|
|
34
|
+
refresh(): void;
|
|
35
|
+
}
|
|
36
|
+
export interface TableProps<Row> extends ViewProps {
|
|
37
|
+
ref?: Ref<TableHandle>;
|
|
38
|
+
rows?: readonly Row[];
|
|
39
|
+
defaultRows?: readonly Row[];
|
|
40
|
+
onRowsChange?: (rows: readonly Row[], detail: TableRowsChange) => void | false;
|
|
41
|
+
columns?: readonly TableColumnDefinition<Row>[];
|
|
42
|
+
rowId: (row: Row) => RowId;
|
|
43
|
+
variant?: TramaResponsive<'plain' | 'bordered' | 'striped'>;
|
|
44
|
+
density?: TramaResponsive<'compact' | 'comfortable' | 'spacious'>;
|
|
45
|
+
height?: number;
|
|
46
|
+
stickyHeader?: boolean;
|
|
47
|
+
virtualized?: boolean;
|
|
48
|
+
rowHeight?: number;
|
|
49
|
+
columnVirtualized?: TramaResponsive<boolean>;
|
|
50
|
+
columnOverscan?: number;
|
|
51
|
+
selectable?: boolean;
|
|
52
|
+
selectedKeys?: readonly RowId[];
|
|
53
|
+
defaultSelectedKeys?: readonly RowId[];
|
|
54
|
+
onSelectionChange?: (keys: readonly RowId[]) => void | false;
|
|
55
|
+
activeKeys?: readonly RowId[];
|
|
56
|
+
sort?: TableSort | null;
|
|
57
|
+
defaultSort?: TableSort;
|
|
58
|
+
onSortChange?: (sort: TableSort | null) => void | false;
|
|
59
|
+
multiSort?: boolean;
|
|
60
|
+
sorting?: readonly TableSort[];
|
|
61
|
+
defaultSorting?: readonly TableSort[];
|
|
62
|
+
onSortingChange?: (sorting: readonly TableSort[]) => void | false;
|
|
63
|
+
filterable?: boolean;
|
|
64
|
+
filter?: string;
|
|
65
|
+
defaultFilter?: string;
|
|
66
|
+
onFilterChange?: (filter: string) => void;
|
|
67
|
+
filterRow?: (row: Row, filter: string) => boolean;
|
|
68
|
+
page?: number;
|
|
69
|
+
defaultPage?: number;
|
|
70
|
+
pageSize?: number;
|
|
71
|
+
onPageChange?: (page: number) => void | false;
|
|
72
|
+
manual?: boolean;
|
|
73
|
+
dataSource?: TableDataSource<Row>;
|
|
74
|
+
cacheDataSource?: boolean;
|
|
75
|
+
onDataError?: (error: unknown) => void;
|
|
76
|
+
totalItems?: number;
|
|
77
|
+
groupBy?: (row: Row) => string;
|
|
78
|
+
pinnedRows?: Readonly<{
|
|
79
|
+
start?: readonly RowId[];
|
|
80
|
+
end?: readonly RowId[];
|
|
81
|
+
}>;
|
|
82
|
+
expandedKeys?: readonly RowId[];
|
|
83
|
+
defaultExpandedKeys?: readonly RowId[];
|
|
84
|
+
onExpandedChange?: (keys: readonly RowId[]) => void | false;
|
|
85
|
+
renderRowActions?: (row: Row) => ReactNode;
|
|
86
|
+
renderRowDetail?: (row: Row) => ReactNode;
|
|
87
|
+
renderSelectionActions?: (keys: readonly RowId[]) => ReactNode;
|
|
88
|
+
onColumnResize?: (column: string, width: number) => void;
|
|
89
|
+
columnWidths?: Readonly<Record<string, number>>;
|
|
90
|
+
defaultColumnWidths?: Readonly<Record<string, number>>;
|
|
91
|
+
onColumnWidthsChange?: (widths: Readonly<Record<string, number>>) => void | false;
|
|
92
|
+
columnOrder?: readonly string[];
|
|
93
|
+
defaultColumnOrder?: readonly string[];
|
|
94
|
+
onColumnOrderChange?: (order: readonly string[]) => void | false;
|
|
95
|
+
hiddenColumns?: readonly string[];
|
|
96
|
+
defaultHiddenColumns?: readonly string[];
|
|
97
|
+
onHiddenColumnsChange?: (columns: readonly string[]) => void | false;
|
|
98
|
+
renderColumnGroup?: (group: string) => ReactNode;
|
|
99
|
+
cellSelection?: 'none' | 'single' | 'range';
|
|
100
|
+
dragSelection?: boolean;
|
|
101
|
+
cellRange?: TableCellRange | null;
|
|
102
|
+
defaultCellRange?: TableCellRange | null;
|
|
103
|
+
onCellRangeChange?: (range: TableCellRange | null) => void | false;
|
|
104
|
+
clipboard?: TableClipboard;
|
|
105
|
+
keyboardNavigation?: boolean;
|
|
106
|
+
keyboardCell?: ComponentType<TableKeyboardCellProps>;
|
|
107
|
+
showCellActions?: boolean;
|
|
108
|
+
empty?: ReactNode;
|
|
109
|
+
}
|
|
110
|
+
export declare function Table<Row>({ ref, rows: controlledRows, defaultRows, onRowsChange, columns, rowId, variant, density, height, stickyHeader, virtualized, rowHeight, columnVirtualized, columnOverscan, selectable, selectedKeys, defaultSelectedKeys, onSelectionChange, activeKeys, sort, defaultSort, onSortChange, multiSort, sorting: controlledSorting, defaultSorting, onSortingChange, filterable, filter, defaultFilter, onFilterChange, filterRow, page, defaultPage, pageSize, onPageChange, manual, dataSource, cacheDataSource, onDataError, totalItems, groupBy, pinnedRows, expandedKeys, defaultExpandedKeys, onExpandedChange, renderRowActions, renderRowDetail, renderSelectionActions, onColumnResize, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnOrder, defaultColumnOrder, onColumnOrderChange, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, renderColumnGroup, cellSelection, dragSelection, cellRange, defaultCellRange, onCellRangeChange, clipboard, keyboardNavigation, keyboardCell: KeyboardCell, showCellActions, empty, children, style, ...props }: TableProps<Row>): import("react").JSX.Element;
|
|
111
|
+
export declare const DataGrid: typeof Table;
|
|
112
|
+
export interface TableColumnProps<Row> extends TableColumnDefinition<Row> {
|
|
113
|
+
children?: ReactNode;
|
|
114
|
+
}
|
|
115
|
+
export declare function TableColumn<Row>({ children }: TableColumnProps<Row>): import("react").JSX.Element;
|
|
116
|
+
export declare function TableCell({ children, style, ...props }: ViewProps): import("react").JSX.Element;
|
|
117
|
+
export declare function TableHeader({ children, style, ...props }: ViewProps): import("react").JSX.Element;
|
|
118
|
+
export declare function TableRowActions(props: ViewProps): import("react").JSX.Element;
|
|
119
|
+
export declare function TableRowDetail(props: ViewProps): import("react").JSX.Element;
|
|
120
|
+
export declare function TableSelectionActions(props: ViewProps): import("react").JSX.Element;
|
|
121
|
+
export declare function TableSummary(props: ViewProps): import("react").JSX.Element;
|
|
122
|
+
export declare function TableToolbar(props: ViewProps): import("react").JSX.Element;
|