本文へスキップ

Calendar

1 つの日付を選ぶための、キーボードで操作できる月間カレンダーグリッドです。

デモを読み込み中…

#インポート

quickgui から Calendar をインポートします。

use quickgui::*;

#使い方

let calendar = Calendar::new("month");
calendar.root().flex_col()

#構成

  • Calendar::root
  • Calendar::week
  • Calendar::day

#API リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

pub fn new(root_id: impl Into<ElementId>) -> Self
root_idpub const fn root_id(self) -> ElementId—

Configures root id for this part.

pub const fn root_id(self) -> ElementId
ソースを見る
week_idpub fn week_id(self, index: usize) -> ElementId—

Configures week id for this part.

pub fn week_id(self, index: usize) -> ElementId
ソースを見る
day_idpub fn day_id(self, day: CivilDate) -> ElementId—

Configures day id for this part.

pub fn day_id(self, day: CivilDate) -> ElementId
ソースを見る

Calendar::grid_with

ソースを見る
pub fn grid_with(self, state: CalendarState, grid: Element) -> Element

Decorate an application-owned month grid without adding layout or appearance.

Calendar::grid

ソースを見る
pub fn grid(self, state: CalendarState) -> Element

Create the unstyled grid part. Use [`Self::grid_with`] to supply an existing element.

Calendar::week_with

ソースを見る
pub fn week_with(self, index: usize, week: Element) -> Element

Decorate an application-owned week row without adding layout or appearance.

Calendar::week

ソースを見る
pub fn week(self, index: usize) -> Element

Create the unstyled week part. Use [`Self::week_with`] to supply an existing element.

Calendar::day_with

ソースを見る
pub fn day_with(self, state: CalendarState, day: CivilDate, cell: Element) -> Element

Decorate an application-owned day cell without adding layout or appearance. Exactly one day carries the grid's Tab stop; the rest are reached with the arrow keys. QuickGUI sets the cell's accessible value to the ISO date; call `.accessibility_label(...)` afterwards to replace it with localized product text.

Calendar::day

ソースを見る
pub fn day(self, state: CalendarState, day: CivilDate) -> Element

Create the unstyled day part. Use [`Self::day_with`] to supply an existing element.

Calendar::key_with

ソースを見る
pub fn key_with<V: 'static>( self, cx: &mut ViewContext<'_, V>, day: CivilDate, cell: Element, access: fn(&mut V) -> &mut CalendarState, ) -> Element

Attach QuickGUI's typed calendar actions and click selection to one day cell. Install [`calendar_key_bindings`] once on the application keymap.

Calendar::key

ソースを見る
pub fn key<V: 'static>( self, cx: &mut ViewContext<'_, V>, day: CivilDate, access: fn(&mut V) -> &mut CalendarState, ) -> Element

Create the unstyled key part. Use [`Self::key_with`] to supply an existing element.

Calendar::key_with_accessor

ソースを見る
pub fn key_with_accessor<V: 'static>( self, cx: &mut ViewContext<'_, V>, day: CivilDate, cell: Element, access_source: StateAccessor<V, CalendarState>, ) -> Element

Attach the typed calendar actions against a per-instance state accessor. A host that renders many declared calendars through one view passes an accessor that captures which [`CalendarState`] this day cell belongs to.