Calendar
日付を視覚的に表示するカレンダーコンポーネント。月表示・週表示に対応し、イベント表示やスケジュール管理に使用します。
Basic
jui-calendar の最も基本的な使用例です。
関連コンポーネント
- Date Picker — カレンダーUIを使って日付を選択するフォームコンポーネント
アクセシビリティ
- WAI-ARIA:
- 日付グリッドに
role="grid"を設定。 - 各日付セルに
role="gridcell"を設定。 - 選択された日付に
aria-selected="true"を設定。 - 今日の日付に
aria-current="date"を設定。 - 前月・次月ナビゲーションボタンに
aria-labelを設定。 - 月/年の表示切替ボタンに適切なラベルを設定。
- 日付グリッドに
- キーボードナビゲーション:
ArrowLeft: 前日に移動ArrowRight: 翌日に移動ArrowUp: 前週(同曜日)に移動ArrowDown: 翌週(同曜日)に移動Enter/Space: フォーカス中の日付を選択Home: 週の先頭に移動End: 週の末尾に移動
CSS カスタムプロパティ
このコンポーネント固有のカスタムプロパティはありません。グローバルのデザイントークンを参照してスタイルが適用されます。
ブラウザ対応
| 機能 | 用途 | Chrome | Firefox | Safari | ステータス |
|---|---|---|---|---|---|
:focus-visible | キーボードフォーカスリング | 86+ | 85+ | 15.4+ | Baseline 2022 |
::slotted() | Shadow DOM スロットスタイル | 53+ | 63+ | 10+ | Baseline |
| CSS Custom Properties | デザイントークン | 49+ | 31+ | 9.1+ | Baseline |
Intl.DateTimeFormat | ロケール対応の曜日名・月名表示 | ✅ | ✅ | ✅ | Widely Available |
Baseline 情報
| 機能 | Baseline 達成 | Widely Available |
|---|---|---|
:focus-visible | 2022年 | 2024年後半 ✅ |
| CSS Custom Properties | Baseline | Widely Available ✅ |
Intl.DateTimeFormat | Baseline | Widely Available ✅ |
プロパティ
コンポーネントが受け付ける属性(Props)の一覧と詳細仕様です。
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
events | events | カレンダーイベント(JSON文字列またはオブジェクト配列) | CalendarEvent[] | string | '[]' |
fullscreen | fullscreen | フルスクリーン表示(true: 大きいセル + イベントテキスト表示) | boolean | true |
locale | locale | ロケール(曜日名・月名の表示に使用) | string | 'ja' |
max | max | 最大日付(ISO 8601 形式) | string | '' |
min | min | 最小日付(ISO 8601 形式) | string | '' |
mode | mode | 表示モード: month(月表示)/ year(年表示) | "month" | "year" | 'month' |
monthButtonLabel | month-button-label | 月表示ボタンのラベル | string | '月' |
nextMonthLabel | next-month-label | 次月ボタンのaria-label | string | 'Next month' |
prevMonthLabel | prev-month-label | 前月ボタンのaria-label | string | 'Previous month' |
todayLabel | today-label | 今日ボタンのラベル | string | 'Today' |
value | value | 選択日(ISO 8601 形式: YYYY-MM-DD) | string | '' |
yearButtonLabel | year-button-label | 年表示ボタンのラベル | string | '年' |
イベント
コンポーネントから発火するカスタムイベントの一覧です。
| Event | Description | Type |
|---|---|---|
juiChange | 日付選択時に発火 | CustomEvent<{ value: string; date: Date; }> |
juiPanelChange | パネル変更時(モードまたは表示月の変更)に発火 | CustomEvent<{ mode: string; date: Date; }> |
Built with StencilJS