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
54
55
56
// SPDX-License-Identifier: MPL-2.0
// SPDX-FileCopyrightText: 2026 FernTech
//! `CheckState` — tri-state checkbox value shared by the data layer and widgets.
//!
//! Represents the three visual states of a checkbox: unchecked, checked, and
//! indeterminate (partial — some but not all descendants are checked). Lives in
//! `teksilo-data` rather than `teksilo-widgets` so that [`crate::TreeCheckedModel`]
//! can produce `Signal<CheckState>` values without inverting the dependency graph.
//!
//! `From<bool>` converts a plain two-state boolean (e.g. from a filter predicate)
//! into `Unchecked` or `Checked`, making it easy to bridge non-tristate sources.
//!
//! ```rust
//! # use teksilo_data::CheckState;
//! let state = CheckState::Indeterminate;
//! assert!(state.is_filled());
//! assert_eq!(state.next_tristate(), CheckState::Unchecked);
//! assert_eq!(CheckState::from(true), CheckState::Checked);
//! ```