1#![doc = include_str!("../readme.md")]
2
3use crate::_private::NonExhaustive;
4use ratatui_core::layout::Rect;
5use ratatui_core::style::Style;
6
7mod derive;
8pub mod edit;
9pub mod selection;
10mod table;
11mod util;
12mod vec;
13
14pub use rat_ftable::TableSelection;
15pub use rat_ftable::TableStyle;
16pub use table::{Table, TableState};
17pub use vec::{TableVec, TableVecState};
18
19#[derive(Debug, Default)]
21pub enum LayoutWidth {
22 Length(u16),
24 Columns,
30 #[default]
32 Area,
33}
34
35#[derive(Debug)]
37pub struct TableContext<'a> {
38 pub row: usize,
40
41 pub focus: bool,
43
44 pub selected_cell: bool,
46 pub selected_row: bool,
48 pub selected_column: bool,
50
51 pub style: Style,
53 pub select_style: Option<Style>,
55
56 pub column_layout: &'a [Rect],
60 pub space_area: Rect,
63 pub row_area: Rect,
65
66 pub non_exhaustive: NonExhaustive,
68}
69
70pub mod event {
72 pub use rat_event::*;
73 pub use rat_ftable::event::{DoubleClickOutcome, TableOutcome};
74}
75
76mod _private {
77 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
78 pub struct NonExhaustive;
79}