lumen-dioxus 6.0.0

Lumen UI components for Dioxus: web, desktop, mobile, and Dioxus Native (Blitz).
Documentation
//! Data and records: `Stat` and its parts, `Meter`, `Rating`, `Timeline`, `Timer`,
//! `Descriptions` and its parts, `DataTable`, `Table`, `Tree`, `TreeGrid`, `VirtualList`,
//! `ReorderableList`, `ChangeSummary`, `FilterBar`, `ThemeBuilder`, `WorldMap`, and the AI
//! surfaces `ApprovalCard`, `PromptComposer`, `SourceCitation`, `StreamMessage`, and
//! `ToolActivity`.

mod ai;
mod dashboard;
mod data_table;
mod display;
mod reorderable_list;
mod stat;
mod table;
mod theme_builder;
mod timer;
mod tree;
mod virtual_list;
mod world_map;

pub use ai::*;
pub use dashboard::*;
pub use data_table::*;
pub use display::*;
pub use reorderable_list::*;
pub use stat::*;
pub use table::*;
pub use theme_builder::*;
pub use timer::*;
pub use tree::*;
pub use virtual_list::*;
pub use world_map::*;

use dioxus::core::{DynamicNode, TemplateNode};
use dioxus::prelude::*;

/// Whether an element renders anything, so a default can stand in for missing children.
pub(crate) fn has_content(element: &Element) -> bool {
    let Ok(node) = element else {
        return false;
    };

    let only_placeholders = node
        .template
        .roots
        .iter()
        .all(|root| matches!(root, TemplateNode::Dynamic { .. }))
        && node
            .dynamic_nodes
            .iter()
            .all(|dynamic| matches!(dynamic, DynamicNode::Placeholder(_)));

    !only_placeholders
}