T06c forms date and time: calendar, date, range, time and date-time pickers, month, quarter, year and week pickers, relative ranges, time zones, durations, cron editor

This commit is contained in:
ZacharyZhang-NY committed 2026-09-25 07:27:42 -04:00
1 parent e39d623b58
commit 8b418b8e80
21 files changed
+3397 -146

No files matched your search

+9 -40
View File
@@ -9,12 +9,12 @@ use gpui::{
use super::{
Choice,
check::tab_stop,
input::text_size,
options::{OnValues, float, option_row, surface},
select::{field_button, field_text},
};
use crate::{
primitives::{Icon, IconName},
theme::{ActiveTheme, ControlSize, IconSize, Radius},
theme::{ActiveTheme, ControlSize, IconSize},
};
/// A node of a cascade: a value, its label, and the nodes under it.
@@ -279,26 +279,7 @@ impl RenderOnce for Cascader {
cx,
)
});
div()
.id(self.id)
.track_focus(&focus)
.relative()
.flex()
.items_center()
.gap_2()
.w_full()
.h(theme.control_height(self.size))
.px(theme.control_padding(self.size))
.rounded(theme.radius(Radius::Md))
.border_1()
.border_color(if focused {
colors.focus
} else {
colors.border_strong
})
.bg(colors.surface)
.text_size(theme.text_size(text_size(self.size)))
.cursor_pointer()
field_button(self.id, &focus, self.size, false, window, cx)
.on_click(move |event, _, cx| {
if matches!(event, ClickEvent::Mouse(_)) {
show(&click, !open, start.clone(), cx)
@@ -339,24 +320,12 @@ impl RenderOnce for Cascader {
cx.stop_propagation();
show(&keys, true, trail, cx);
})
.child(
div()
.flex_1()
.min_w_0()
.overflow_hidden()
.text_ellipsis()
.whitespace_nowrap()
.text_color(if shown.is_empty() {
colors.fg_subtle
} else {
colors.fg
})
.child(if shown.is_empty() {
self.placeholder
} else {
SharedString::from(shown.join(" / "))
}),
)
.child(field_text(
(!shown.is_empty()).then(|| SharedString::from(shown.join(" / "))),
self.placeholder,
false,
cx,
))
.child(
Icon::new(IconName::ChevronsUpDown)
.size(IconSize::Xs)