1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/// Built-in toolbar control visibility when no custom [`crate::DataTableToolbarSlot`] is provided.
///
/// Set individual flags to `false` to hide Filters, Columns, Pivot, or Export while keeping
/// quick search. Ignored when a custom toolbar slot replaces the default chrome.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct DataTableToolbarConfig {
/// Show the quick-search field in the toolbar. Default `true`.
pub quick_search: bool,
/// Show the structured filter panel trigger. Default `true`.
pub filter_panel: bool,
/// Show the column visibility picker trigger. Default `true`.
pub column_picker: bool,
/// Show the pivot configuration trigger (requires [`crate::DataTableFeatures::PIVOTING`]). Default `true`.
pub pivot: bool,
/// Show the export/print menu trigger. Default `true`.
pub export_menu: bool,
}
impl Default for DataTableToolbarConfig {
fn default() -> Self {
Self {
quick_search: true,
filter_panel: true,
column_picker: true,
pivot: true,
export_menu: true,
}
}
}
/// Per-column-header chrome toggles (menu, inline filter button, hide-column UX).
///
/// Gate header actions without replacing [`crate::DataTableHeaderCell`] rendering.
/// Feature flags still control underlying capability; these flags control visible chrome only.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct DataTableHeaderChromeConfig {
/// Show the column header actions menu (sort, pin, hide). Default `true`.
pub column_menu: bool,
/// Show the per-header filter popover button. Default `true`.
pub column_filter_button: bool,
/// Allow hiding columns via menu and picker. Default `true`.
pub column_hide: bool,
}
impl Default for DataTableHeaderChromeConfig {
fn default() -> Self {
Self {
column_menu: true,
column_filter_button: true,
column_hide: true,
}
}
}