Files
Ely-GPUI-Components/examples/gallery/pages/tables/mod.rs
T
ZacharyZhang-NY 48c7b09d8d T44d Web · Gallery builds for wasm32: one story per section by URL, themed by the host
The gallery's entry runs natively or, on wasm32, from a wasm_bindgen start
through gpui_web, single-threaded with WebGL2 fallback. ?page, ?story and
?theme choose what shows; an unknown one fails in the page and the log.
set_theme switches the mode later. Pictures load from ELY_GALLERY_ASSETS.
scripts/stories.py writes examples/gallery/stories.json from the pages.
2026-09-29 19:16:41 -04:00

73 lines
2.0 KiB
Rust

mod core;
mod features;
mod grids;
use gpui::{AnyElement, App, IntoElement, ParentElement, Window, div};
use super::Page;
use crate::step::Step;
pub const PAGE: Page = Page {
number: 14,
slug: "tables",
title: "Tables",
summary: "Rows and columns that sort, filter, page and select, and stay quick at a hundred thousand rows.",
render,
script: SCRIPT,
};
const SCRIPT: &[Step] = &[
Step::Rest,
Step::DownAt("orders", 440.0, 16.0),
Step::UpAt("orders", 440.0, 16.0),
Step::Wait(200),
Step::Shot("sorted"),
Step::DownAt("orders", 18.0, 54.0),
Step::UpAt("orders", 18.0, 54.0),
Step::DownAt("orders", 18.0, 126.0),
Step::UpAt("orders", 18.0, 126.0),
Step::Wait(200),
Step::Shot("selected"),
Step::DownAt("orders-tools", 300.0, 14.0),
Step::UpAt("orders-tools", 300.0, 14.0),
Step::Wait(300),
Step::Shot("builders"),
Step::Hover("tasks"),
Step::Wait(300),
Step::DownAt("tasks", 14.0, 54.0),
Step::UpAt("tasks", 14.0, 54.0),
Step::Wait(300),
Step::Shot("expanded"),
Step::Hover("grouped"),
Step::Wait(300),
Step::DownAt("grouped", 60.0, 54.0),
Step::UpAt("grouped", 60.0, 54.0),
Step::Wait(300),
Step::Shot("folded"),
Step::Hover("sheet"),
Step::Wait(300),
Step::DownAt("sheet", 184.0, 294.0),
Step::UpAt("sheet", 184.0, 294.0),
Step::Type("=F8/4"),
Step::Key("enter"),
Step::Wait(300),
Step::Shot("sheet-formula"),
Step::Rest,
];
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
div()
.child(core::plain(cx))
.child(core::orders(window, cx))
.child(features::wide(cx))
.child(features::rows(window, cx))
.child(features::grouped(cx))
.child(grids::data_grid(window, cx))
.child(grids::spreadsheet(window, cx))
.child(grids::tree_table(cx))
.child(grids::pivot(cx))
.child(core::long(window, cx))
.child(core::heatmap(cx))
.into_any_element()
}