import type DatePicker from "./DatePicker.js"; import Button from "./Button.js"; import Calendar from "./Calendar.js"; import Icon from "./Icon.js"; import CalendarDate from "./CalendarDate.js"; import ResponsivePopover from "./ResponsivePopover.js"; import { isPhone } from "@ui5/webcomponents-base/dist/Device.js"; import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js"; import error from "@ui5/webcomponents-icons/dist/error.js"; import alert from "@ui5/webcomponents-icons/dist/alert.js"; import sysEnter2 from "@ui5/webcomponents-icons/dist/sys-enter-2.js"; import information from "@ui5/webcomponents-icons/dist/information.js"; type TemplateHook = () => void; export default function DatePickerPopoverTemplate(this: DatePicker, hooks?: { header?: TemplateHook, content?: TemplateHook, footer?: TemplateHook, initialFocus?: string }) { const header = hooks?.header || defaultHeader; const content = hooks?.content || defaultContent; const footer = hooks?.footer || defaultFooter; const initialFocus = hooks?.initialFocus; return ( { this.showHeader && header.call(this) } { valueStateTextHeader.call(this) } { content.call(this) } { this.showFooter && footer.call(this) } ); } function defaultHeader(this: DatePicker) { return (
{this._headerTitleText}
); } function defaultContent(this: DatePicker) { return ( { this._calendarSelectedDates.map(date => )} ); } function valueStateMessage(this: DatePicker) { return ( this.shouldDisplayDefaultValueStateMessage ? this.valueStateDefaultText : ); } function valueStateTextHeader(this: DatePicker) { if (!this.hasValueStateText) { return; } return (
{ valueStateMessage.call(this) }
); } function valueStateMessageInputIcon(this: DatePicker) { const iconPerValueState = { Negative: error, Critical: alert, Positive: sysEnter2, Information: information, }; return this.valueState !== ValueState.None ? iconPerValueState[this.valueState] : ""; } function defaultFooter(this: DatePicker) { return (
); }