Date Picker

カレンダーUIを使って日付を選択するフォームコンポーネント。予約日時や締め切り日の入力に使用します。

Basic

jui-date-picker の最も基本的な使用例です。

関連コンポーネント

  • Calendar — 日付を視覚的に表示するカレンダーコンポーネント
  • Input — テキスト入力フィールドコンポーネント
  • Form Field — フォーム要素にラベルやバリデーションを付与するラッパーコンポーネント

アクセシビリティ

  • WAI-ARIA:
    • トリガー要素に role="combobox", aria-expanded, aria-haspopup="dialog" を設定。
    • カレンダーパネルに role="dialog", aria-modal="true", aria-label を設定。
    • 日付セルに aria-selected, aria-current="date"(今日)を設定。
    • ラベルとトリガーを aria-labelledby で紐付け。
  • キーボードナビゲーション:
    • Enter / Space: カレンダーの開閉
    • ArrowDown: カレンダーを開く
    • Escape: カレンダーを閉じる
    • ArrowLeft/Right/Up/Down: 日付セル間の移動
    • Enter: フォーカス中の日付を選択

CSS カスタムプロパティ

このコンポーネント固有のカスタムプロパティはありません。グローバルのデザイントークンを参照してスタイルが適用されます。

ブラウザ対応

機能用途ChromeFirefoxSafariステータス
:focus-visibleキーボードフォーカスリング86+85+15.4+Baseline 2022
::slotted()Shadow DOM スロットスタイル53+63+10+Baseline
CSS Custom Propertiesデザイントークン49+31+9.1+Baseline
toLocaleDateString()ロケール対応日付表示Widely Available

Baseline 情報

機能Baseline 達成Widely Available
:focus-visible2022年2024年後半 ✅
CSS Custom PropertiesBaselineWidely Available ✅

プロパティ

コンポーネントが受け付ける属性(Props)の一覧と詳細仕様です。

PropertyAttributeDescriptionTypeDefault
calendarLabelcalendar-labelカレンダーダイアログの aria-labelstring'カレンダー'
disableddisabled無効状態かbooleanfalse
errorMessageerror-messageエラーメッセージstring | undefinedundefined
firstDayOfWeekfirst-day-of-week週の開始曜日(0=日, 1=月)number0
formatformat表示フォーマット(YYYY, MM, DD をトークンとして使用)string'YYYY-MM-DD'
labellabelラベルテキストstring | undefinedundefined
localelocaleロケール(曜日名等の表示に使用)string'ja'
maxmax最大日付(ISO 8601 形式)string''
minmin最小日付(ISO 8601 形式)string''
modemode選択モード: date / month / year"date" | "month" | "year"'date'
namenameフォーム識別用の name 属性stringundefined
placeholderplaceholderプレースホルダーテキストstring'Select date'
requiredrequired必須フィールドかbooleanfalse
valuevalue選択された日付(ISO 8601 形式: YYYY-MM-DD)string''

イベント

コンポーネントから発火するカスタムイベントの一覧です。

EventDescriptionType
juiChange日付選択時に発火CustomEvent<{ value: string; date: Date; }>
juiCloseカレンダー閉時に発火CustomEvent<void>
juiOpenカレンダー開時に発火CustomEvent<void>

シャドウパーツ

CSSから直接スタイリング可能な内部要素(Parts)の一覧です。

PartDescription
"calendar"カレンダーポップアップコンテナ
"error"エラーメッセージ要素
"label"ラベル要素
"trigger"日付入力トリガーボタン

Built with StencilJS