import { IEventEmitter } from '@breadstone/mosaik-elements'; import { SchedulerView } from 'libs/mosaik-elements-foundation/src/Controls/Types/SchedulerView'; import { IAppearanceableProps } from '../../../../../Behaviors/Appearanceable'; import { IDisableableProps } from '../../../../../Behaviors/Disableable'; import { ILocaleableProps } from '../../../../../Behaviors/Localeable'; import { ISizeableProps } from '../../../../../Behaviors/Sizeable'; import { IThemeableProps } from '../../../../../Behaviors/Themeable'; import { IVariantableProps } from '../../../../../Behaviors/Variantable'; import type { ISchedulerBeforeEventActivateEventDetail, ISchedulerBeforeSelectRangeEventDetail, ISchedulerEventActivateEventDetail, ISchedulerSelectRangeEventDetail, SchedulerEventActivateTrigger } from '../../../../../events/SchedulerEvents'; import type { Appearance } from '../../../../../Types/Appearance'; import { DayOfWeek } from '../../../../../Types/DayOfWeek'; import type { FlowDirection } from '../../../../../Types/FlowDirection'; import type { Size } from '../../../../../Types/Size'; import type { Variant } from '../../../../../Types/Variant'; import { CustomElement } from '../../../../Abstracts/CustomElement'; import { SchedulerElementIntl } from '../../Intl/SchedulerElementIntl'; import { ICollectedEvent } from '../../models/ICollectedEvent'; /** * Represents the shared properties for all Scheduler view elements. * * @public */ export interface ISchedulerViewBaseElementProps extends IDisableableProps, ILocaleableProps, IThemeableProps, ISizeableProps, IAppearanceableProps, IVariantableProps { /** * The start date for the visible range. */ startDate: Date | null; /** * The first day of the week (0 = Sunday, 1 = Monday, etc.). */ firstDayOfWeek: DayOfWeek; /** * The blackout dates that should be disabled. */ blackoutDates: Array; /** * The special dates that should be visually highlighted. */ specialDates: Array; /** * Whether today is visually highlighted. */ isTodayHighlighted: boolean; /** * Whether weekend columns are visually highlighted. */ isWeekendHighlighted: boolean; /** * The collected events to display. */ collectedEvents: Array; /** * Format string for weekday headers (e.g., 'ddd' for 'Mon'). */ weekdayFormat: string; /** * Format string for day numbers (e.g., 'd' for '1', 'dd' for '01'). */ dayFormat: string; /** * Format string for time display (e.g., 'HH:mm' for '14:30'). */ timeFormat: string; /** * Format string for month-day display (e.g., 'MMM d' for 'Feb 13'). */ monthDayFormat: string; } /** * Default values for SchedulerViewBaseElement properties. * * @public */ export declare namespace ISchedulerViewBaseElementProps { const DEFAULTS: ISchedulerViewBaseElementProps; } declare const SchedulerViewBaseElement_base: (abstract new (...args: Array) => IThemeableProps) & (abstract new (...args: Array) => ISizeableProps) & (abstract new (...args: Array) => IAppearanceableProps) & (abstract new (...args: Array) => IVariantableProps) & (abstract new (...args: Array) => ILocaleableProps) & (abstract new (...args: Array) => IDisableableProps) & typeof CustomElement & import("../../../../../Behaviors/Themeable").IThemeableCtor; /** * Scheduler View Base Element - The foundational base class for all scheduler view components. * * @description * SchedulerViewBaseElement provides the core infrastructure for all scheduler view types including * month, week, day, and agenda views. It manages common scheduler functionality such as date range * navigation, event collection rendering, blackout dates, special dates, visual highlighting, and * user interactions like event activation and range selection. The class implements inheritance * controllers to consume properties from parent SchedulerElement, supports comprehensive i18n and * locale formatting, and provides cancelable events for interaction workflows. All concrete scheduler * views (MonthView, WeekView, DayView, AgendaView) extend this base class to inherit consistent * behavior, theming, and event handling patterns. * * @remarks * This class uses the InheritanceConsumerController to inherit properties (disabled, appearance, * variant, size, locale, etc.) from a parent SchedulerElement when nested. Watch methods are * intentionally not implemented to allow subclasses full control over change reactions. Event * activation and range selection provide before/after event pairs with cancellation support. * * @name SchedulerViewBaseElement * @category Abstract Elements * * @fires connected {ConnectedEvent} - Emitted when the element is connected to the DOM * @fires disconnected {DisconnectedEvent} - Emitted when the element is disconnected from the DOM * @fires changed {PropertyChangedEvent} - Emitted when any attribute changes before update * @fires schedulerBeforeEventActivate {SchedulerBeforeEventActivateEvent} - Emitted before an event is activated (cancelable) * @fires schedulerEventActivate {SchedulerEventActivateEvent} - Emitted after an event is activated * @fires schedulerBeforeSelectRange {SchedulerBeforeSelectRangeEvent} - Emitted before a range is selected (cancelable) * @fires schedulerSelectRange {SchedulerSelectRangeEvent} - Emitted after a range is selected * * @example * Extending SchedulerViewBaseElement for a month view: * ```typescript * export class SchedulerMonthViewElement extends SchedulerViewBaseElement { * public override get view(): SchedulerView { * return SchedulerView.Month; * } * * protected override render() { * return html`
...
`; * } * } * ``` * * @example * Using blackout and special dates: * ```html * * * ``` * * @example * Handling event activation with cancellation: * ```typescript * view.schedulerBeforeEventActivate.on((detail) => { * if (!isUserAuthorized(detail.eventKey)) { * detail.cancel = true; // Prevent activation * } * }); * * view.schedulerEventActivate.on((detail) => { * console.log('Event activated:', detail.eventKey); * }); * ``` * * @example * Custom date formatting: * ```html * * * ``` * * @abstract * @public */ export declare abstract class SchedulerViewBaseElement extends SchedulerViewBaseElement_base implements ISchedulerViewBaseElementProps { private readonly _inheritance; private readonly _schedulerBeforeEventActivate; private readonly _schedulerEventActivate; private readonly _schedulerBeforeSelectRange; private readonly _schedulerSelectRange; private _startDate; private _firstDayOfWeek; private _blackoutDates; private _specialDates; private _isTodayHighlighted; private _isWeekendHighlighted; private _collectedEvents; private _intl; private _weekdayFormat; private _dayFormat; private _timeFormat; private _monthDayFormat; /** * @public */ constructor(); /** * Gets the layout mode that this view provides to its events. * Each concrete view must implement this to return its layout type. * * @public * @abstract * @readonly */ abstract get view(): SchedulerView; /** * @public * @override */ get disabled(): boolean; set disabled(value: boolean); /** * @public * @override */ get appearance(): Appearance; set appearance(value: Appearance); /** * @public * @override */ get variant(): Variant; set variant(value: Variant); /** * @public * @override */ get size(): Size; set size(value: Size); /** * @public * @override */ get locale(): string; set locale(value: string); /** * @public * @override */ get dir(): FlowDirection; set dir(value: FlowDirection); /** * @public * @override */ get themeName(): string; set themeName(value: string); /** * Gets or sets the start date for the visible range. * * @public * @attr */ get startDate(): Date | null; set startDate(value: Date | null); /** * Gets the effective start date, defaulting to today if startDate is null. * * @protected * @readonly */ protected get effectiveStartDate(): Date; /** * Gets or sets the first day of the week. * * @public * @attr */ get firstDayOfWeek(): DayOfWeek; set firstDayOfWeek(value: DayOfWeek); /** * Gets or sets the blackout dates that should be disabled. * * @public */ get blackoutDates(): Array; set blackoutDates(value: Array); /** * Gets or sets the special dates that should be highlighted. * * @public */ get specialDates(): Array; set specialDates(value: Array); /** * Gets or sets whether today is highlighted. * * @public * @attr */ get isTodayHighlighted(): boolean; set isTodayHighlighted(value: boolean); /** * Gets or sets whether weekends are highlighted. * * @public * @attr */ get isWeekendHighlighted(): boolean; set isWeekendHighlighted(value: boolean); /** * Gets or sets the collected events to display. * * @public */ get collectedEvents(): Array; set collectedEvents(value: Array); /** * Gets or sets the internationalization helper. * * @public */ get intl(): SchedulerElementIntl | null; set intl(value: SchedulerElementIntl | null); /** * Gets or sets the format string for weekday headers. * * @remarks * Supports: `d` (day number 1-7), `dd` (01-07), `ddd` (Mon), `dddd` (Monday). * Default: `ddd`. * * @public * @attr */ get weekdayFormat(): string; set weekdayFormat(value: string); /** * Gets or sets the format string for day numbers. * * @remarks * Supports: `d` (1-31), `dd` (01-31). * Default: `d`. * * @public * @attr */ get dayFormat(): string; set dayFormat(value: string); /** * Gets or sets the format string for time display. * * @remarks * Supports: `H` (0-23), `HH` (00-23), `h` (1-12), `hh` (01-12), `m` (0-59), `mm` (00-59), `tt` (AM/PM). * Default: `HH:mm`. * * @public * @attr */ get timeFormat(): string; set timeFormat(value: string); /** * Gets or sets the format string for month-day display. * * @remarks * Supports: `M` (1-12), `MM` (01-12), `MMM` (Jan), `MMMM` (January), `d` (1-31), `dd` (01-31). * Default: `MMM d`. * * @public * @attr */ get monthDayFormat(): string; set monthDayFormat(value: string); /** * Called before an event is activated (cancelable). * * @public * @readonly * @eventProperty */ get schedulerBeforeEventActivate(): IEventEmitter; /** * Called after an event is activated. * * @public * @readonly * @eventProperty */ get schedulerEventActivate(): IEventEmitter; /** * Called before a range is selected (cancelable). * * @public * @readonly * @eventProperty */ get schedulerBeforeSelectRange(): IEventEmitter; /** * Called after a range is selected. * * @public * @readonly * @eventProperty */ get schedulerSelectRange(): IEventEmitter; /** * Returns true when a date is configured as blackout date. * * @public * @param date - The date to check. */ isBlackoutDate(date: Date): boolean; /** * Returns true when a date is configured as special date. * * @public * @param date - The date to check. */ isSpecialDate(date: Date): boolean; /** * Returns true when the given date is weekend. * * @public * @param date - The date to check. */ isWeekend(date: Date): boolean; /** * Returns true when the given date is today. * * @public * @param date - The date to check. */ isToday(date: Date): boolean; /** * Activates an event programmatically. * * @public * @param eventKey - The event key to activate. * @param trigger - The activation trigger. * @returns True if activation succeeded. */ activateEvent(eventKey: string, trigger?: SchedulerEventActivateTrigger): boolean; /** * Handles click on an event renderer. * * @private */ onEventClick(event: MouseEvent, eventKey: string): void; /** * Handles keyboard activation of an event. * * @private */ onEventKeydown(event: KeyboardEvent, eventKey: string): void; /** * Emits a select range event. * * @protected * @param start - The start date. * @param end - The end date. * @param dayKey - The day key (YYYY-MM-DD). * @param isAllDay - Whether this is an all-day selection. */ protected emitSelectRange(start: Date, end: Date, dayKey: string, isAllDay: boolean): void; } export {}; //# sourceMappingURL=SchedulerViewBaseElement.d.ts.map