Skip to main content

Overview

The app-date-picker-dialog component wraps the date picker in a Material Design dialog with confirm, cancel, and reset buttons. It inherits all properties and events from app-date-picker and adds dialog-specific functionality.

Installation

Import

Or import from specific path:

Usage

Properties

Dialog-Specific Properties

boolean
default:"false"
Controls dialog visibility. Set to true to show the dialog, false to hide it.
string
default:"set"
Text label for the confirm/accept button.
string
default:"cancel"
Text label for the cancel/dismiss button.
string
default:"reset"
Text label for the reset button.

Inherited Properties

Inherits all properties from app-date-picker:
  • value - Selected date (string)
  • min - Minimum date (string)
  • max - Maximum date (string)
  • locale - Language code (string)
  • firstDayOfWeek - First day of week (number)
  • showWeekNumber - Show week numbers (boolean)
  • weekNumberType - Week calculation type (string)
  • startView - Initial view (string)
  • disabledDates - Disabled dates (string)
  • disabledDays - Disabled days (string)
  • All label properties
  • valueAsDate - Date object (readonly)
  • valueAsNumber - Timestamp (readonly)

Methods

method
Opens the dialog picker.
method
Closes the dialog picker.

Events

date-updated

Fires when the user confirms a date selection (clicks the confirm button).

first-updated

Fires when the picker completes its first render.

year-updated

Fires when the selected year changes in the year grid view.

Dialog Events

opened

Fires after the dialog has fully opened.

opening

Fires when the dialog begins to open.

closed

Fires after the dialog has fully closed.

closing

Fires when the dialog begins to close. The event detail includes the action that triggered closing.

CSS Custom Properties

Inherits all CSS custom properties from app-date-picker plus Material Dialog properties.

Dialog-Specific

The component uses Material Web Components Dialog. You can customize:
  • --mdc-theme-surface - Dialog background
  • --mdc-theme-on-surface - Dialog text color
  • --mdc-dialog-scrim-color - Backdrop color
  • --mdc-dialog-z-index - Dialog z-index
Note: --mdc-dialog-min-width and --mdc-shape-medium are managed internally.

CSS Shadow Parts

Inherits all shadow parts from app-date-picker:
  • header - Picker header
  • body - Picker body
  • calendar - Calendar container
  • calendar-day - Calendar day cells
  • today - Today’s date
  • year-grid - Year grid container
  • year - Year buttons
  • And all other calendar parts

Example: Complete Integration

TypeScript

Behavior Notes

  • The dialog only updates the value property when the user clicks the confirm button
  • Clicking cancel or dismissing the dialog reverts to the previous value
  • The reset button sets the value to today’s date
  • The dialog lazy-loads its content for better performance
  • Pressing ESC or clicking the backdrop dismisses the dialog (equivalent to cancel)