Overview
Theapp-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
Usage
Properties
Dialog-Specific Properties
Controls dialog visibility. Set to
true to show the dialog, false to hide it.Text label for the confirm/accept button.
Text label for the cancel/dismiss button.
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
Opens the dialog picker.
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
--mdc-dialog-min-width and --mdc-shape-medium are managed internally.
CSS Shadow Parts
Inherits all shadow parts from app-date-picker:header- Picker headerbody- Picker bodycalendar- Calendar containercalendar-day- Calendar day cellstoday- Today’s dateyear-grid- Year grid containeryear- Year buttons- And all other calendar parts
Example: Complete Integration
TypeScript
Behavior Notes
- The dialog only updates the
valueproperty 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)