/* eslint-disable @typescript-eslint/no-unused-vars */
/**
 * Angular wrapper for Bryntum YearPlanner
 */

import { Component, ElementRef, EventEmitter, Output, Input, SimpleChange, SimpleChanges, OnDestroy, OnInit } from '@angular/core';

import WrapperHelper from './wrapper.helper';

import { AlignSpec, Base, BryntumScrollOptions, ButtonConfig, CalendarMixinClass, CalendarRow, CalendarRowConfig, CalendarView, Color, Container, ContainerItemConfig, ContainerLayoutConfig, DomConfig, DurationConfig, EventBar, EventModel, KeyMapConfig, Layout, MaskConfig, MenuItemConfig, Model, PagingToolbarConfig, Panel, PanelCollapserConfig, PanelCollapserOverlayConfig, PanelHeader, Rectangle, ResourceModel, Scroller, ScrollerConfig, StateProvider, TabConfig, Tool, ToolConfig, ToolbarConfig, ToolbarItems, TooltipConfig, Widget, YearPlanner, YearPlannerListeners } from '@bryntum/calendar';

import { DomHelper, StringHelper } from '@bryntum/calendar';
import { initThemeInShadowRoots } from './shadowdom.helper';

export type BryntumYearPlannerProps = {
    // Configs
    /**
     * A key to use to activate this view.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-activationKey)
     */
    activationKey ? : string
    /**
     * Element (or element id) to adopt as this Widget's encapsulating element. The widget's
     * content will be placed inside this element.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-adopt)
     */
    adopt ? : HTMLElement|string
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating).*
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-align)
     */
    align ? : AlignSpec|string
    /**
     * When this widget is a child of a [Container](https://bryntum.com/products/calendar/docs/api/Core/widget/Container), it will by default be participating in a
     * flexbox layout. This config allows you to set this widget's
     * [align-self](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) style.
     */
    alignSelf ? : string
    /**
     * Configure this as `false` to disable drag-creating events in this view.
     */
    allowDragCreate ? : boolean
    /**
     * Configure this as `false` to disable drag-moving events in this view.
     */
    allowDragMove ? : boolean
    /**
     * Configure this as `false` to disable drag-resizing events in this view.
     */
    allowDragResize ? : boolean
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating) and being shown through [showBy](#Core/widget/Widget#function-showBy).*
     * `true` to show a connector arrow pointing to the align target.
     */
    anchor ? : boolean
    /**
     * By default, when navigating through time, the next time
     * block will be animated in from the appropriate direction.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-animateTimeShift)
     */
    animateTimeShift ? : boolean
    /**
     * Element (or the id of an element) to append this widget's element to. Can be configured, or set once at
     * runtime. To access the element of a rendered widget, see [element](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-element).
     */
    appendTo ? : HTMLElement|string
    /**
     * A localizable string (May contain `'L{}'` tokens which resolve in the locale file) to inject
     * into an element which will be linked using the `aria-describedby` attribute.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-ariaDescription)
     */
    ariaDescription ? : string
    /**
     * A localizable string (May contain `'L{}'` tokens which resolve in the locale file) to inject as
     * the `aria-label` attribute.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-ariaLabel)
     */
    ariaLabel ? : string
    /**
     * If this config is set, then the `gesture` configured (which defaults to `dblclick`) creates a
     * new event at the mouse or touch event's time point.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-autoCreate)
     * @property {string} [gesture] The DOM event name which initiates event creation at the event's position.
     * @property {Function,string} [newName] The name of an event created using `autoCreate` or a function to call which yields the name. When a function is specified, the following parameters are passed:  * <span class="name">view : <span class="type">CalendarMixin</span></span><div class="description">The view in which the event is being created.</div> * <span class="name">startDate : <span class="type">String</span></span><div class="description">The start date of the event being created.</div> * <span class="name">resourceRecord : <span class="type">ResourceModel</span></span><div class="description">The resource of the event being created.</div>
     * @property {string} [step] The time unit by which to snap the start click point of auto created events. <strong>Only for views which have a granularity of less than one day such as `WeekView` and `DayView`</strong>. For views which show whole days, the start defaults to 8am. This is a string in the format required by [parseDuration](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper#function-parseDuration-static). This value is also used for the [step](https://bryntum.com/products/calendar/docs/api/Core/widget/TimeField#property-step) value in the [EventEdit](https://bryntum.com/products/calendar/docs/api/Calendar/feature/EventEdit)'s time input field.
     * @property {'round','ceil','floor'} [snapType] How to snap a precise gesture time to a boundary specified by the `step` property. <strong>Only for views which have a granularity of less than one day such as `WeekView` and `DayView`</strong>.
     * @property {string} [duration] The default start hour for auto created events in the form accepted by [parseDuration](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper#function-parseDuration-static)
     * @property {number} [startHour] The default start hour for auto created events in views where the time granularity is one day. In a `DayView` or `WeekView` where a mouse event position will translate to a time of day, this is not used. This is the hour of the day to start the event at. It may be fractional.
     */
    autoCreate ? : object|string|boolean
    /**
     * A Config object representing the configuration of a [Toolbar](https://bryntum.com/products/calendar/docs/api/Core/widget/Toolbar),
     * or array of config objects representing the child items of a Toolbar. Another way to add a bbar is to use [strips](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-strips).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-bbar)
     */
    bbar ? : (ContainerItemConfig|string)[]|ToolbarConfig|PagingToolbarConfig|null
    /**
     * Custom CSS classes to add to the panel's body element.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-bodyCls)
     */
    bodyCls ? : string|object
    /**
     * Set `true` to add a border to this container's element.
     */
    border ? : boolean
    /**
     * An object where property names with a truthy value indicate which events should bubble up the ownership
     * hierarchy when triggered.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-bubbleEvents)
     */
    bubbleEvents ? : object
    /**
     * Set to `false` to not call onXXX method names (e.g. `onShow`, `onClick`), as an easy way to listen for events.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-callOnFunctions)
     */
    callOnFunctions ? : boolean
    /**
     * By default, if an event handler throws an exception, the error propagates up the stack and the
     * application state is undefined. Code which follows the event handler will *not* be executed.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-catchEventHandlerExceptions)
     */
    catchEventHandlerExceptions ? : boolean
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating).*
     * Set to `true` to centre the Widget in browser viewport space.
     */
    centered ? : boolean
    /**
     * Custom CSS classes to add to element.
     * May be specified as a space separated string, or as an object in which property names
     * with truthy values are used as the class names:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-cls)
     */
    cls ? : string|object
    /**
     * Controls whether the panel is collapsed (the body of the panel is hidden while only the header is
     * visible). Only valid if the panel is [collapsible](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-collapsible).
     */
    collapsed ? : boolean
    /**
     * This config enables collapsibility for the panel. See [collapsed](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-collapsed).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-collapsible)
     */
    collapsible ? : boolean|PanelCollapserConfig|PanelCollapserOverlayConfig
    /**
     * Applies the specified color to the widget, by setting the `--b-primary` CSS variable in the widgets
     * `style` block.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-color)
     */
    color ? : Color
    /**
     * Programmatic control over which column to start in when used in a grid layout.
     */
    column ? : number
    config ? : object
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating) or [positioned](#Core/widget/Widget#config-positioned).*
     * Element, Widget or Rectangle to which this Widget is constrained.
     */
    constrainTo ? : HTMLElement|Widget|Rectangle
    /**
     * Custom CSS classes to add to the [contentElement](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-contentElement).
     * May be specified as a space separated string, or as an object in which property names
     * with truthy values are used as the class names:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-contentElementCls)
     */
    contentElementCls ? : string|object
    /**
     * When this Widget configuration is used in the Grid's RowExpander feature's `widget` config, provide the
     * field on the expanded record to use for populating this widget's store (if applicable)
     */
    dataField ? : string
    /**
     * Object to apply to elements dataset (each key will be used as a data-attribute on the element)
     */
    dataset ? : Record<string, string>
    /**
     * A date which specifies the year to display. All types of calendar view have a `date`
     * config which they use to set their visible date range according to their configuration
     * and type.
     */
    date ? : Date
    /**
     * A [DateHelper](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper) format string/function to use to create date output for view descriptions.
     * @param {Date} date The date to format.
     * @returns {string} The formatted date.
     */
    dateFormat ? : string|((date: Date) => string)
    /**
     * A string used to separate start and end dates in the [descriptionFormat](https://bryntum.com/products/calendar/docs/api/Scheduler/view/mixin/Describable#config-descriptionFormat).
     */
    dateSeparator ? : string
    /**
     * The [DateHelper](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper) format string for day names in the column headers.
     * The day names are displayed at the top of the year planner, above all month rows.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-dayNameFormat)
     */
    dayNameFormat ? : 'ddd'|'dd'|'d1'|string
    /**
     * The name of the property to set when a single value is to be applied to this Widget. Such as when used
     * in a grid WidgetColumn, this is the property to which the column's `field` is applied.
     */
    defaultBindProperty ? : string
    /**
     * A [query](https://bryntum.com/products/calendar/docs/api/Core/widget/Container#function-query) selector function which can identify the descendant widget to which
     * focus should be directed by default.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-defaultFocus)
     * @param {Core.widget.Widget} widget Widget passed to method
     * @returns {boolean} truthy value if widget is the default one
     */
    defaultFocus ? : ((widget: Widget) => boolean)|string
    /**
     * A config object containing default settings to apply to all child widgets.
     */
    defaults ? : ContainerItemConfig
    /**
     * Options to add into scroll options when the [scrollTo](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#function-scrollTo) method is called.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-defaultScrollOptions)
     */
    defaultScrollOptions ? : BryntumScrollOptions
    /**
     * The date format used by the default [descriptionRenderer](https://bryntum.com/products/calendar/docs/api/Scheduler/view/mixin/Describable#config-descriptionRenderer) for rendering the view's description.
     * If this value is `null`, the [dateFormat](https://bryntum.com/products/calendar/docs/api/Scheduler/view/mixin/Describable#config-dateFormat) (and potentially [dateSeparator](#Scheduler/view/mixin/Describable#config-dateSeparator)) will
     * be used.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-descriptionFormat)
     * @param {Date} date The date to format.
     * @returns {string} The formatted date.
     */
    descriptionFormat ? : string|string[]|boolean[]|((date: Date) => string)|(((date: Date) => string)[])
    /**
     * A function that provides the textual description for this view. If provided, this function overrides the
     * [descriptionFormat](https://bryntum.com/products/calendar/docs/api/Scheduler/view/mixin/Describable#config-descriptionFormat).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-descriptionRenderer)
     * @param {Core.widget.Widget} view The active view in case the function is in another scope.
     * @returns {string} Description string
     */
    descriptionRenderer ? : (view: Widget) => string
    /**
     * Check for CSS compatibility and inclusion related issues and try to auto fix them. Performs the following
     * checks:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-detectCSSCompatibilityIssues)
     */
    detectCSSCompatibilityIssues ? : boolean
    /**
     * Disable or enable the widget. It is similar to [readOnly](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-readOnly) except a disabled widget
     * cannot be focused, uses a different rendition (usually greyish) and does not allow selecting its value.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-disabled)
     */
    disabled ? : boolean|'inert'
    /**
     * Controls the placement of this widget when it is added to a [panel's ](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel)
     * [strips collection](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-strips). Typical values for this config are `'top'`,
     * `'bottom'`, `'left'`, or `'right'`, which cause the widget to be placed on that side of the panel's
     * body. Such widgets are called "edge strips".
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-dock)
     */
    dock ? : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating).*
     * Set to `true` to be able to drag a widget freely on the page. Or set to an object with a ´handleSelector´
     * property which controls when a drag should start.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-draggable)
     * @property {string} handleSelector CSS selector used to determine if drag can be started from a mouse-downed element inside the widget
     */
    draggable ? : boolean|object
    /**
     * The [durationUnit](https://bryntum.com/products/calendar/docs/api/Scheduler/model/EventModel#field-durationUnit) to use when drag-creating events
     * in this view.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-dragUnit)
     */
    dragUnit ? : string
    /**
     * Make this Panel a docked drawer which slides out from one side of the browser viewport by default.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-drawer)
     * @param {'start','left','end','right','top','bottom'} [side] The side of the viewport to dock the drawer to.  * `'start'` means the `inline-start` side. * `'end'` means the `inline-end` side.
     * @param {string,number} [size] The size of the drawer in its collapsible axis.
     * @param {boolean} [inline] If using the [appendTo](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-appendTo) config to place the drawer inside a host widget, this may be set to `true` to make the drawer inline within that host. Note that, if using this, the layout of the host element must have `flex-direction` set appropriately.
     * @param {boolean,object} [autoClose] Specifies what user actions should automatically close the drawer. Defaults to closing when the user clicks outside of the drawer or when focus moves outside of the drawer.
     * @param {boolean,string} [autoClose.mousedown] If the user clicks outside of the drawer, the drawer will automatically be hidden. If the value is a string, it is used as a CSS selector to filter clicks which should close the drawer.
     * @param {boolean,string} [autoClose.focusout] If focus moves outside of the drawer, the drawer will automatically be hidden.
     * @param {string} [autoClose.mouseout] Hides the drawer when the mouse leaves the drawer after the `autoCloseDelay` period.
     * @param {number} [autoCloseDelay] When using `mouseout`, this is the delay in milliseconds
     */
    drawer ? : boolean|{ side?: 'start'|'left'|'end'|'right'|'top'|'bottom', size?: string|number, inline?: boolean, autoClose?: boolean|{ mousedown?: boolean|string, focusout?: boolean|string, mouseout?: string }, autoCloseDelay?: number }
    /**
     * An object specifying attributes to assign to the root element of this widget.
     * Set `null` value to attribute to remove it.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-elementAttributes)
     */
    elementAttributes ? : Record<string, string|null>
    /**
     * A function, or the name of a function in the ownership hierarchy which you
     * can specify to customize event DOM content.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-eventHeaderRenderer)
     * @param {object} detail An object that contains data about the event being rendered
     * @param {CalendarView} detail.view The view rendering the event
     * @param {Scheduler.model.EventModel} detail.eventRecord The event record
     * @param {Scheduler.model.ResourceModel} detail.resourceRecord The resource record
     * @param {object} detail.renderData A data object containing properties that will be used to create the event element
     * @param {object} detail.renderData.style The style property is an object containing style properties for the event element
     * @param {object} detail.renderData.cls The cls property is an object whose property names will be added to the event element if the property value is truthy
     * @param {object} detail.renderData.iconStyle The iconStyle property is an object containing style properties for the icon element if an icon element is to be used
     * @param {object} detail.renderData.iconCls The iconCls property is an object whose property names will be added to the icon element. Initially set from the event record's [iconCls](https://bryntum.com/products/calendar/docs/api/Scheduler/model/EventModel#field-iconCls). Can be mutated by the renderer. If null, or no properties are set, no icon will be rendered
     * @param {string} detail.renderData.eventColor Color to be applied to the event
     * @param {object} detail.renderData.dataset An object which produces the `dataset` of the resulting event bar
     * @param {boolean} detail.renderData.solidBar This is valid for views which create event bars. This is set to `true` by default for all day and interday events so that these appear as a solid block of background color. An eventRenderer may mutate this flag to change in what manner the event bar is colored - as a solid bar of color, or using the foreground color (text and icons) such as the MonthView, the CalendarRow (all day events in a DayView), and OverflowPopups
     * @param {string} detail.renderData.bodyColor When used in a [DayView](https://bryntum.com/products/calendar/docs/api/Calendar/widget/DayView), this color is applied to the body of the event element. Note that this must be light enough that the text color (From the SASS variable `$dayview-event-color`) is visible
     * @param {boolean} detail.showBullet If there is no `iconCls`, and the event is not recurring, then by default a "bullet" circular icon is shown if the view's [showBullet](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-showBullet) if set. Setting this property in an event renderer overrides this behaviour.
     * @returns {DomConfig,DomConfig[],string,void}
     */
    eventHeaderRenderer ? : ((detail: { view: CalendarView, eventRecord: EventModel, resourceRecord: ResourceModel, renderData: { style: object, cls: object, iconStyle: object, iconCls: object, eventColor: string, dataset: object, solidBar: boolean, bodyColor: string }, showBullet: boolean }) => DomConfig|DomConfig[]|string|void)|string
    /**
     * The height of event bars in this view. This can be a numeric value in pixels or a CSS unit measure such
     * as `'2em'`.
     */
    eventHeight ? : number|string
    /**
     * A function, or the name of a function in the ownership hierarchy which you
     * can specify to customize event DOM content.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-eventRenderer)
     * @param {object} context An object that contains data about the event being rendered
     * @param {Calendar.widget.mixin.CalendarMixin} context.view The view rendering the event
     * @param {Scheduler.model.EventModel} context.eventRecord The event record
     * @param {Scheduler.model.ResourceModel} context.resourceRecord The Resource record
     * @param {object} context.renderData A data object containing properties that will be used to create the event element
     * @param {object} context.renderData.style The style property is an object containing style properties for the event element
     * @param {object} context.renderData.cls The cls property is an object whose property names will be added to the event element if the property value is truthy
     * @param {object} context.renderData.iconStyle The iconStyle property is an object containing style properties for the icon element if an icon element is to be used
     * @param {object} context.renderData.iconCls The iconCls property is an object whose property names will be added to the icon element. Initially set from the event record's [iconCls](https://bryntum.com/products/calendar/docs/api/Scheduler/model/EventModel#field-iconCls). Can be mutated by the renderer. If null, or no properties are set, no icon will be rendered
     * @param {string} context.renderData.eventColor Color to be applied to the event. This may be a CSS color name or a CSS color value in any of the supported CSS color formats such as `#RRGGBB`, `rgb(255, 0, 0)`, or `rgba(255, 0, 0, 0.5)`.
     * @param {string} context.renderData.eventBackground A CSS background style to be applied to the event. This is not set by default, but can be set by the renderer to provide a background image or gradient for the event bar. This overrides the `eventColor` property if present.
     * @param {string} context.renderData.textColor A CSS color to be applied to the event text. This is not set by default, but can be set by the renderer to provide a custom color for the event name text in the event bar. This may be a CSS color name or a CSS color value in any of the supported CSS color formats such as `#RRGGBB`, `rgb(255, 0, 0)`, or `rgba(255, 0, 0, 0.5)`.
     * @param {object} context.renderData.eventInnerStyle The eventInnerStyle property is an object containing style properties for the inner part of the event element, the `.b-cal-event` element.
     * @param {object} context.renderData.dataset An object which produces the `dataset` of the resulting event bar
     * @param {boolean} context.renderData.solidBar This is valid for views which create event bars. This is set to `true` by default for all day and interday events so that these appear as a solid block of background color. An eventRenderer may mutate this flag to change in what manner the event bar is colored - as a solid bar of color, or using the foreground color (text and icons) such as the MonthView, the CalendarRow (all day events in a DayView), and OverflowPopups
     * @param {string} context.renderData.bodyColor When used in a [DayView](https://bryntum.com/products/calendar/docs/api/Calendar/widget/DayView), this color is applied to the body of the event element. Note that this must be light enough that the text color (From the SASS variable `$dayview-event-color`) is visible
     * @param {boolean} context.renderData.showBullet If there is no `iconCls`, and the event is not recurring, then by default a "bullet" circular icon is shown if the view's [showBullet](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-showBullet) if set. Setting this property in an event renderer overrides this behaviour. <h3>Using JSX (React)</h3> When using the Bryntum React wrapper, the event renderer can return JSX elements: ```javascript eventRenderer({ eventRecord, renderData }) {     return &lt;MyEventComponent event={eventRecord} />; } ``` *Using JSX in the event renderer creates a React portal for each rendered event. For calendars with many visible events or frequently re-rendered views, this may impact scrolling performance compared to returning plain strings or [DomConfig](https://bryntum.com/products/calendar/docs/api/Core/helper/DomHelper#typedef-DomConfig) objects. Consider using JSX primarily for events that require complex interactive React components.*
     * @returns {DomConfig,DomConfig[],string,void} The content to be used as the event body.
     */
    eventRenderer ? : ((context: { view: CalendarMixinClass, eventRecord: EventModel, resourceRecord: ResourceModel, renderData: { style: object, cls: object, iconStyle: object, iconCls: object, eventColor: string, eventBackground: string, textColor: string, eventInnerStyle: object, dataset: object, solidBar: boolean, bodyColor: string, showBullet: boolean } }) => DomConfig|DomConfig[]|string|void)|string
    /**
     * A function which compares events which some views use to decide upon rendering order.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-eventSorter)
     * @param {Scheduler.model.EventModel,EventBar} lhs The left side value to conpare
     * @param {Scheduler.model.EventModel,EventBar} rhs The right side value to conpare
     * @returns {number}
     */
    eventSorter ? : (lhs: EventModel|EventBar, rhs: EventModel|EventBar) => number
    /**
     * By default, the end date of an all day event is displayed in the UI as
     * the last calendar date on which the event falls. For most end users, this is the
     * expected value.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-extendAllDayEndDay)
     */
    extendAllDayEndDay ? : boolean
    extraData ? : any
    /**
     * If this is set to `true`, then when determining which assigned resource of a multi assigned event
     * to use to create the event UI, the first resource which is still selected in the
     * [resourceFilter](https://bryntum.com/products/calendar/docs/api/Calendar/widget/Sidebar#property-resourceFilter) is used.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-filterEventResources)
     */
    filterEventResources ? : boolean
    /**
     * When this widget is a child of a [Container](https://bryntum.com/products/calendar/docs/api/Core/widget/Container), it will by default be participating in a
     * flexbox layout. This config allows you to set this widget's
     * [flex](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) style.
     * This may be configured as a single number or a `&lt;flex-grow&gt; &lt;flex-shrink&gt; &lt;flex-basis&gt;` format string.
     * numeric-only values are interpreted as the `flex-grow` value.
     */
    flex ? : number|string
    /**
     * Set to `true` to move the widget out of the document flow and position it
     * absolutely in browser viewport space.
     */
    floating ? : boolean
    /**
     * Config object of a footer. May contain a `dock`, `html` and a `cls` property. A footer is not a widget,
     * but rather plain HTML that follows the last element of the panel's body and [strips](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-strips).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-footer)
     * @property {'top','right','bottom','left','start','end'} dock Where to dock
     * @property {string} html Html to populate the footer with
     * @property {string} cls CSS class to add to the footer
     */
    footer ? : object|string
    /**
     * A Function (or name of a function in the ownership hierarchy) which returns the
     * [resource record](https://bryntum.com/products/calendar/docs/api/Scheduler/model/ResourceModel) to use to create the UI for an event.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-getPrimaryResource)
     * @param {Scheduler.model.EventModel} eventRecord The event from which to extract the primary resource.
     * @returns {Scheduler.model.ResourceModel} The resource to be used to render the event.
     */
    getPrimaryResource ? : ((eventRecord: EventModel) => ResourceModel)|string
    /**
     * A config [object](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#typedef-PanelHeader) for the panel's header or a string in place of a `title`.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-header)
     */
    header ? : string|boolean|PanelHeader
    /**
     * Widget's height, used to set element `style.height`. Either specify a valid height string or a number,
     * which will get 'px' appended. We recommend using CSS as the primary way to control height, but in some
     * cases this config is convenient.
     */
    height ? : string|number
    /**
     * Configure with true to make widget initially hidden.
     */
    hidden ? : boolean
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating).*
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-hideAnimation)
     */
    hideAnimation ? : boolean|object
    /**
     * Configure as `true` to hide [nonWorkingDays](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-nonWorkingDays)
     */
    hideNonWorkingDays ? : boolean
    /**
     * Specify `true` to make this container hide when it has no visible children (Either empty
     * or all children hidden).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-hideWhenEmpty)
     */
    hideWhenEmpty ? : boolean
    /**
     * An icon to show before the [title](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-title). Either pass a CSS class as a string, or pass a
     * [DomConfig](https://bryntum.com/products/calendar/docs/api/Core/helper/DomHelper#typedef-DomConfig) object describing an element to represent the icon.
     */
    icon ? : string|DomConfig
    /**
     * Widget id, if not specified one will be generated. Also used for lookups through Widget.getById
     */
    id ? : string
    /**
     * Determines if the widgets read-only state should be controlled by its parent.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-ignoreParentReadOnly)
     */
    ignoreParentReadOnly ? : boolean
    /**
     * Convenience setting to align input fields of child widgets. By default, the Field input element is
     * placed immediately following the `label`. If you prefer to have all input fields aligned to the
     * right, set this config to `'end'`.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-inputFieldAlign)
     */
    inputFieldAlign ? : 'start'|'end'
    /**
     * Element (or element id) to insert this widget before. If provided, [appendTo](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-appendTo) config is ignored.
     */
    insertBefore ? : HTMLElement|string
    /**
     * Element (or element id) to append this widget element to, as a first child. If provided, [appendTo](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-appendTo) config is ignored.
     */
    insertFirst ? : HTMLElement|string
    /**
     * An optional CSS class to add to child items of this container.
     */
    itemCls ? : string
    /**
     * An object whose keys are the [key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) name
     * and optional modifier prefixes: `'Ctrl+'`, `'Alt+'`, `'Meta+'`, and `'Shift+'` (case-insensitive). The values
     * are the name of the instance method to call when the keystroke is received.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-keyMap)
     */
    keyMap ? : Record<string, KeyMapConfig>
    /**
     * Convenience setting to use same label placement on all child widgets.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-labelPosition)
     */
    labelPosition ? : 'before'|'above'|'align-before'|'auto'|null
    /**
     * Sets `labelWidth´ for all children of this Container, that does not define their own `labelWidth`.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-labelWidth)
     */
    labelWidth ? : number|null
    /**
     * The short name of a helper class which manages rendering and styling of child items.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-layout)
     */
    layout ? : string|ContainerLayoutConfig
    /**
     * The CSS style properties to apply to the [contentElement](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-contentElement).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-layoutStyle)
     */
    layoutStyle ? : object
    /**
     * An array of [child item](https://bryntum.com/products/calendar/docs/api/Core/widget/Container#config-items) *config objects* which is to be converted into
     * instances only when this Container is rendered, rather than eagerly at construct time.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-lazyItems)
     */
    lazyItems ? : Record<string, ContainerItemConfig>|ContainerItemConfig[]|Widget[]
    /**
     * The listener set for this object.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-listeners)
     */
    listeners ? : YearPlannerListeners
    /**
     * A class translations of which are used for translating this entity.
     * This is often used when translations of an item are defined on its container class.
     * For example:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-localeClass)
     */
    localeClass ? : typeof Base
    /**
     * Set to `false` to disable localization of this object.
     */
    localizable ? : boolean
    /**
     * List of properties which values should be translated automatically upon a locale applying.
     * In case there is a need to localize not typical value (not a String value or a field with re-defined setter/getter),
     * you could use 'localeKey' meta configuration.
     * Example:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-localizableProperties)
     */
    localizableProperties ? : string[]
    /**
     * Widget's margin. This may be configured as a single number or a `TRBL` format string.
     * numeric-only values are interpreted as pixels.
     */
    margin ? : number|string
    /**
     * This config object contains the defaults for the [Mask](https://bryntum.com/products/calendar/docs/api/Core/widget/Mask) created for the
     * [masked](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-masked) config. Any properties specified in the `masked` config will override these
     * values.
     */
    maskDefaults ? : MaskConfig
    /**
     * Set to `true` to apply the default mask to the widget. Alternatively, this can be the mask message or a
     * [Mask](https://bryntum.com/products/calendar/docs/api/Core/widget/Mask) config object.
     */
    masked ? : boolean|string|MaskConfig
    /**
     * The maximum date to which the `endDate` of this view may be navigated.
     */
    maxDate ? : Date|string
    /**
     * The element's maxHeight. Can be either a String or a Number (which will have 'px' appended). Note that
     * like [height](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
     */
    maxHeight ? : string|number
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating).*
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-maximizeOnMobile)
     */
    maximizeOnMobile ? : number|string
    /**
     * The elements maxWidth. Can be either a String or a Number (which will have 'px' appended). Note that
     * like [width](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
     */
    maxWidth ? : string|number
    /**
     * The minimum date to which the `startDate` of this view may be navigated.
     */
    minDate ? : Date|string
    /**
     * The element's minHeight. Can be either a String or a Number (which will have 'px' appended). Note that
     * like [height](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
     */
    minHeight ? : string|number
    /**
     * The elements minWidth. Can be either a String or a Number (which will have 'px' appended). Note that
     * like [width](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
     */
    minWidth ? : string|number
    /**
     * When this is configured as `true` a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
     * is used to monitor this element for size changes caused by either style manipulation, or by CSS
     * layout.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-monitorResize)
     * @property {boolean} immediate Set to `true` to receive resize notifications immediately.
     */
    monitorResize ? : boolean|object
    /**
     * The [DateHelper](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper) format string for month names in the row headers.
     * Each month row displays its month name on the left side using this format.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-monthNameFormat)
     */
    monthNameFormat ? : 'MMMM'|'MMM'|'MM'|string
    /**
     * An object containing default config objects which may be referenced by name in the [items](https://bryntum.com/products/calendar/docs/api/Core/widget/Container#config-items)
     * config. For example, a specialized [Menu](https://bryntum.com/products/calendar/docs/api/Core/widget/Menu) subclass may have a `namedItems` default
     * value defined like this:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-namedItems)
     */
    namedItems ? : Record<string, ContainerItemConfig>
    /**
     * Non-working days as an object where keys are day indices, 0-6 (Sunday-Saturday), and the value is `true`.
     * Defaults to [nonWorkingDays](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper#property-nonWorkingDays-static).
     */
    nonWorkingDays ? : Record<number, boolean>
    /**
     * The class name to add to events which have an end date in the past. Defaults to `'b-past-event'`.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-pastEventCls)
     */
    pastEventCls ? : string
    /**
     * Set to `true` when a widget is rendered into another widget's [contentElement](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-contentElement), but must
     * not participate in the standard layout of that widget, and must be positioned relatively to that
     * widget's [contentElement](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-contentElement).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-positioned)
     */
    positioned ? : boolean
    /**
     * Prevent tooltip from being displayed on touch devices. Useful for example for buttons that display a
     * menu on click etc, since the tooltip would be displayed at the same time.
     */
    preventTooltipOnTouch ? : boolean
    /**
     * Whether this widget is read-only.  This is only valid if the widget is an input
     * field, <strong>or contains input fields at any depth</strong>.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-readOnly)
     */
    readOnly ? : boolean
    relayStoreEvents ? : boolean
    /**
     * Either a default `rendition` to apply to all child widgets, or a map of renditions keyed by child widget
     * `type`.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-rendition)
     */
    rendition ? : string|Record<string, string>|null
    /**
     * Path to load resource images from. Used by the [showResourceAvatars](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-showResourceAvatars) config
     * to create URLs using the resource's
     * [image](https://bryntum.com/products/calendar/docs/api/Scheduler/model/ResourceModel#field-image) or
     * [imageUrl](https://bryntum.com/products/calendar/docs/api/Scheduler/model/ResourceModel#field-imageUrl) fields:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-resourceImagePath)
     */
    resourceImagePath ? : string
    /**
     * Configure as `true` to have the component display a translucent ripple when its
     * [focusElement](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-focusElement), or [element](#Core/widget/Widget#property-element) is tapped <em>if the
     * current theme supports ripples</em>. Out of the box, only the Material theme supports ripples.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-ripple)
     * @property {string} [delegate] A CSS selector to filter which child elements trigger ripples. By default, the ripple is clipped to the triggering element.
     * @property {string} [color] A CSS color name or specification.
     * @property {number} [radius] The ending radius of the ripple. Note that it will be clipped by the target element by default.
     * @property {string} [clip] A string which describes how to clip the ripple if it is not to be clipped to the default element. Either the property of the widget to use as the clipping element, or a selector to allow clipping to the closest matching ancestor to the target element.
     */
    ripple ? : boolean|object
    /**
     * The ARIA role to apply to this widget's element. By default, this is set to `'presentation'` to avoid
     * accidentally applying a role which may interfere with screen readers.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-role)
     */
    role ? : string
    /**
     * If you are rendering this widget to a shadow root inside a web component, set this config to the shadowRoot. If not inside a web component, set it to `document.body`
     */
    rootElement ? : ShadowRoot|HTMLElement
    /**
     * This may be configured as `true` to make the widget's element use the `direction:rtl` style.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-rtl)
     */
    rtl ? : boolean
    /**
     * Specifies whether (and optionally in which axes) a Widget may scroll. `true` means this widget may scroll
     * in both axes. May be an object containing boolean `overflowX` and `overflowY` properties which are
     * applied to CSS style properties `overflowX` and `overflowY`. If they are boolean, they are translated to
     * CSS overflow properties thus:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-scrollable)
     */
    scrollable ? : boolean|ScrollerConfig|Scroller
    /**
     * Defines what to do if document is scrolled while Widget is visible (only relevant when floating is set to `true`).
     * Valid values: ´null´: do nothing, ´hide´: hide the widget or ´realign´: realign to the target if possible.
     */
    scrollAction ? : 'hide'|'realign'|null
    /**
     * A button configuration object to use for the automatically created mode selector button for this mode.
     */
    selectorButton ? : ButtonConfig
    /**
     * A menu item configuration object to use for the automatically created mode selector menu item for this mode.
     */
    selectorMenuItem ? : MenuItemConfig
    /**
     * A [DateHelper](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper) format string/function to use to create date output for
     * abbreviated view descriptions.
     * @param {Date} date The date to format.
     * @returns {string} The formatted date.
     */
    shortDateFormat ? : string|((date: Date) => string)
    /**
     * A [DateHelper](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper) format string/function to use to create date and time output for
     * abbreviated view descriptions.
     * @param {Date} date The date to format.
     * @returns {string} The formatted date.
     */
    shortDateTimeFormat ? : string|((date: Date) => string)
    /**
     * The class name to add to events which have duration less than or equal to
     * [shortEventDuration](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-shortEventDuration).
     */
    shortEventCls ? : string
    /**
     * The duration threshold at or below which an event's encapsulating element gets
     * the [shortEventCls](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-shortEventCls) added to it so that small event bars can have
     * style rearrangements.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-shortEventDuration)
     */
    shortEventDuration ? : DurationConfig|number|string
    /**
     * *Only valid if this Widget is [floating](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-floating).*
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-showAnimation)
     */
    showAnimation ? : boolean|object
    /**
     * This specifies whether to show a circular "bullet" icon if there is no
     * [iconCls](https://bryntum.com/products/calendar/docs/api/Scheduler/model/EventModel#field-iconCls) defined for an event.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-showBullet)
     * @param {boolean} [bar] This is `false` by default. Set this to `true` in modes where a solid event bar should show a bullet icon
     * @param {boolean} [noBar] This is `true` by default. Events with no background colour, use this to show the event's defined `eventColor`
     */
    showBullet ? : boolean|{ bar?: boolean, noBar?: boolean }
    /**
     * Configure as `true` to show avatars of the assigned resources (calendars) at the
     * start of the event bar.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-showResourceAvatars)
     */
    showResourceAvatars ? : boolean|string
    /**
     * Set to `false` to not show the tooltip when this widget is [disabled](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-disabled)
     */
    showTooltipWhenDisabled ? : boolean
    /**
     * Programmatic control over how many columns to span when used in a grid layout.
     */
    span ? : number
    /**
     * This value can be one of the following:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-stateful)
     */
    stateful ? : boolean|object|string[]
    /**
     * The events that, when fired by this component, should trigger it to save its state by calling
     * [saveState](https://bryntum.com/products/calendar/docs/api/Core/mixin/State#function-saveState).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-statefulEvents)
     */
    statefulEvents ? : object|string[]
    /**
     * The key to use when saving this object's state in the [stateProvider](https://bryntum.com/products/calendar/docs/api/Core/mixin/State#config-stateProvider). If this config is
     * not assigned, and [stateful](https://bryntum.com/products/calendar/docs/api/Core/mixin/State#config-stateful) is not set to `false`, the [id](#Core/widget/Widget#config-id)
     * (if explicitly specified) will be used as the `stateId`.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-stateId)
     */
    stateId ? : string
    /**
     * The `StateProvider` to use to save and restore this object's [state](https://bryntum.com/products/calendar/docs/api/Core/mixin/State#property-state). By default, `state`
     * will be saved using the [default state provider](https://bryntum.com/products/calendar/docs/api/Core/state/StateProvider#property-instance-static).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-stateProvider)
     */
    stateProvider ? : StateProvider
    /**
     * Specify `true` to match fields by their `name` property only when assigning a [record](https://bryntum.com/products/calendar/docs/api/Core/widget/Container#config-record),
     * without falling back to `ref`.
     */
    strictRecordMapping ? : boolean
    /**
     * An object containing widgets keyed by name. By default (when no `type` is given), strips are
     * [toolbars](https://bryntum.com/products/calendar/docs/api/Core/widget/Toolbar). If you want to pass an array, you can use
     * the toolbar's [items](https://bryntum.com/products/calendar/docs/api/Core/widget/Container#config-items).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-strips)
     */
    strips ? : Record<string, ContainerItemConfig>
    /**
     * The converse of [syncViewDate](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#property-syncViewDate)
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-syncCalendarDate)
     */
    syncCalendarDate ? : boolean
    /**
     * The converse of [syncCalendarDate](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#property-syncCalendarDate)
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-syncViewDate)
     */
    syncViewDate ? : boolean
    /**
     * A configuration for the [tab](https://bryntum.com/products/calendar/docs/api/Core/widget/Tab) created for this widget when it is placed in a
     * [TabPanel](https://bryntum.com/products/calendar/docs/api/Core/widget/TabPanel). For example, this config can be used to control the icon of the `tab` for
     * this widget:
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-tab)
     */
    tab ? : boolean|TabConfig
    /**
     * When this container is used as a tab in a TabPanel, these items are added to the
     * [TabBar](https://bryntum.com/products/calendar/docs/api/Core/widget/TabBar) when this container is the active tab.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-tabBarItems)
     */
    tabBarItems ? : ToolbarItems[]|Widget[]
    /**
     * The tag name of this Widget's root element
     */
    tag ? : string
    /**
     * The toolbar configuration for the YearPlanner. By default, includes a month filtering UI consisting
     * of a group of toggleable buttons representing each month. Pressed buttons indicate visible months.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-tbar)
     */
    tbar ? : ToolbarConfig|null
    /**
     * Text alignment: 'left', 'center' or 'right'. Also accepts direction neutral 'start' and 'end'.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-textAlign)
     */
    textAlign ? : 'left'|'center'|'right'|'start'|'end'
    /**
     * A [DateHelper](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper) format string/function used to format the time displayed in events
     * @param {Date} date The date to format.
     * @returns {string} The formatted date.
     */
    timeFormat ? : string|((date: Date) => string)
    /**
     * A title to display in the header or owning TabPanel. Causes creation and docking of a header
     * to the top if no header is configured.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-title)
     */
    title ? : string
    /**
     * The [tools](https://bryntum.com/products/calendar/docs/api/Core/widget/Tool) to add either before or after the `title` in the Panel header. Each
     * property name is the reference by which an instantiated tool may be retrieved from the live
     * `[tools](https://bryntum.com/products/calendar/docs/api/Core/widget/mixin/Toolable#property-tools)` property.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-tools)
     */
    tools ? : Record<string, ToolConfig>|null
    /**
     * Tooltip for the widget, either as a string or as a Tooltip config object.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-tooltip)
     */
    tooltip ? : string|TooltipConfig|null
    /**
     * By default, tabbing within a Panel is not contained, ie you can TAB out of the Panel
     * forwards or backwards.
     * Configure this as `true` to disallow tabbing out of the Panel, and make tabbing circular within this Panel.
     */
    trapFocus ? : boolean
    type ? : 'yearplanner'
    /**
     * Custom CSS class name suffixes to apply to the elements rendered by this widget. This may be specified
     * as a space separated string, an array of strings, or as an object in which property names with truthy
     * values are used as the class names.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-ui)
     */
    ui ? : 'plain'|'toolbar'|string|object
    /**
     * A config object used to configure all child month row views. Each of the 12 month rows in
     * the YearPlanner is an instance of [CalendarRow](https://bryntum.com/products/calendar/docs/api/Calendar/widget/CalendarRow) (specifically, the
     * internal `YearPlannerRow` subclass).
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-view)
     */
    view ? : CalendarRowConfig
    /**
     * The week start day, 0 meaning Sunday, 6 meaning Saturday.
     * Defaults to [weekStartDay](https://bryntum.com/products/calendar/docs/api/Core/helper/DateHelper#property-weekStartDay-static).
     */
    weekStartDay ? : number
    /**
     * A widgets weight determines its position among siblings when added to a [Container](https://bryntum.com/products/calendar/docs/api/Core/widget/Container).
     * Higher weights go further down.
     */
    weight ? : number
    /**
     * Widget's width, used to set element `style.width`. Either specify a valid width string or a number, which
     * will get 'px' appended. We recommend using CSS as the primary way to control width, but in some cases
     * this config is convenient.
     */
    width ? : string|number
    /**
     * A Scheduler-compatible working time config object containing `fromDay` and `toDay`
     * properties which control which days of the week are visible.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-workingTime)
     * @property {number} workingTime.fromDay Day index 0-6 (0 is Sunday)
     * @property {number} workingTime.toDay Day index 0-6 (0 is Sunday)
     */
    workingTime ? : { fromDay: number, toDay: number }
    /**
     * The x position for the widget.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-x)
     */
    x ? : number
    /**
     * The y position for the widget.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#config-y)
     */
    y ? : number
    /**
     * The year to display.
     */
    year ? : number

}

@Component({
    selector : 'bryntum-year-planner',
    template : ''
})
export class BryntumYearPlannerComponent implements OnInit, OnDestroy {

    public static instanceClass = YearPlanner;

    public static instanceName = 'YearPlanner';

    private static bryntumEvents: string[] = [
        'onBeforeAutoCreate',
        'onBeforeChangeDate',
        'onBeforeDestroy',
        'onBeforeHide',
        'onBeforeSetRecord',
        'onBeforeShow',
        'onBeforeStateApply',
        'onBeforeStateSave',
        'onCatchAll',
        'onCollapse',
        'onDestroy',
        'onDirtyStateChange',
        'onElementCreated',
        'onEventAutoCreated',
        'onExpand',
        'onFocusIn',
        'onFocusOut',
        'onHide',
        'onPaint',
        'onReadOnly',
        'onRecompose',
        'onResize',
        'onShow',
        'onToolClick'
    ];

    private static bryntumFeatureNames: string[] = [

    ];

    private static bryntumConfigs: string[] = BryntumYearPlannerComponent.bryntumFeatureNames.concat([
        'activationKey',
        'adopt',
        'align',
        'alignSelf',
        'allowDragCreate',
        'allowDragMove',
        'allowDragResize',
        'anchor',
        'animateTimeShift',
        'appendTo',
        'ariaDescription',
        'ariaLabel',
        'autoCreate',
        'bbar',
        'bodyCls',
        'border',
        'bubbleEvents',
        'callOnFunctions',
        'catchEventHandlerExceptions',
        'centered',
        'cls',
        'collapsed',
        'collapsible',
        'color',
        'column',
        'config',
        'constrainTo',
        'contentElementCls',
        'dataField',
        'dataset',
        'date',
        'dateFormat',
        'dateSeparator',
        'dayNameFormat',
        'defaultBindProperty',
        'defaultFocus',
        'defaults',
        'defaultScrollOptions',
        'descriptionFormat',
        'descriptionRenderer',
        'detectCSSCompatibilityIssues',
        'disabled',
        'dock',
        'draggable',
        'dragUnit',
        'drawer',
        'elementAttributes',
        'eventHeaderRenderer',
        'eventHeight',
        'eventRenderer',
        'eventSorter',
        'extendAllDayEndDay',
        'extraData',
        'filterEventResources',
        'flex',
        'floating',
        'footer',
        'getPrimaryResource',
        'header',
        'height',
        'hidden',
        'hideAnimation',
        'hideNonWorkingDays',
        'hideWhenEmpty',
        'icon',
        'id',
        'ignoreParentReadOnly',
        'inputFieldAlign',
        'insertBefore',
        'insertFirst',
        'itemCls',
        'keyMap',
        'labelPosition',
        'labelWidth',
        'layout',
        'layoutStyle',
        'lazyItems',
        'listeners',
        'localeClass',
        'localizable',
        'localizableProperties',
        'margin',
        'maskDefaults',
        'masked',
        'maxDate',
        'maxHeight',
        'maximizeOnMobile',
        'maxWidth',
        'minDate',
        'minHeight',
        'minWidth',
        'monitorResize',
        'monthNameFormat',
        'namedItems',
        'nonWorkingDays',
        'pastEventCls',
        'positioned',
        'preventTooltipOnTouch',
        'readOnly',
        'relayStoreEvents',
        'rendition',
        'resourceImagePath',
        'ripple',
        'role',
        'rootElement',
        'rtl',
        'scrollable',
        'scrollAction',
        'selectorButton',
        'selectorMenuItem',
        'shortDateFormat',
        'shortDateTimeFormat',
        'shortEventCls',
        'shortEventDuration',
        'showAnimation',
        'showBullet',
        'showResourceAvatars',
        'showTooltipWhenDisabled',
        'span',
        'stateful',
        'statefulEvents',
        'stateId',
        'stateProvider',
        'strictRecordMapping',
        'strips',
        'syncCalendarDate',
        'syncViewDate',
        'tab',
        'tabBarItems',
        'tag',
        'tbar',
        'textAlign',
        'timeFormat',
        'title',
        'tools',
        'tooltip',
        'trapFocus',
        'type',
        'ui',
        'view',
        'weekStartDay',
        'weight',
        'width',
        'workingTime',
        'x',
        'y',
        'year'
    ]);

    private static bryntumConfigsOnly: string[] = [
        'activationKey',
        'adopt',
        'align',
        'anchor',
        'ariaDescription',
        'ariaLabel',
        'bbar',
        'bodyCls',
        'border',
        'bubbleEvents',
        'centered',
        'collapsible',
        'color',
        'config',
        'constrainTo',
        'contentElementCls',
        'dataField',
        'date',
        'dayNameFormat',
        'defaultBindProperty',
        'defaultFocus',
        'defaults',
        'descriptionRenderer',
        'detectCSSCompatibilityIssues',
        'dock',
        'draggable',
        'drawer',
        'elementAttributes',
        'eventHeaderRenderer',
        'eventHeight',
        'eventRenderer',
        'eventSorter',
        'floating',
        'footer',
        'getPrimaryResource',
        'header',
        'hideAnimation',
        'hideWhenEmpty',
        'icon',
        'ignoreParentReadOnly',
        'itemCls',
        'lazyItems',
        'listeners',
        'localeClass',
        'localizable',
        'localizableProperties',
        'maskDefaults',
        'masked',
        'monitorResize',
        'monthNameFormat',
        'namedItems',
        'positioned',
        'preventTooltipOnTouch',
        'relayStoreEvents',
        'resourceImagePath',
        'ripple',
        'role',
        'rootElement',
        'scrollAction',
        'selectorButton',
        'selectorMenuItem',
        'shortEventCls',
        'shortEventDuration',
        'showAnimation',
        'showBullet',
        'showResourceAvatars',
        'showTooltipWhenDisabled',
        'stateful',
        'statefulEvents',
        'stateId',
        'stateProvider',
        'strips',
        'tab',
        'tabBarItems',
        'tag',
        'tbar',
        'textAlign',
        'timeFormat',
        'trapFocus',
        'type',
        'ui',
        'weekStartDay',
        'weight',
        'workingTime',
        'year'
    ];

    private static bryntumProps: string[] = BryntumYearPlannerComponent.bryntumFeatureNames.concat([
        'alignSelf',
        'allowDragCreate',
        'allowDragMove',
        'allowDragResize',
        'animateTimeShift',
        'appendTo',
        'autoCreate',
        'callOnFunctions',
        'catchEventHandlerExceptions',
        'cls',
        'collapsed',
        'column',
        'dataset',
        'dateFormat',
        'dateSeparator',
        'dayCellCls',
        'defaultScrollOptions',
        'descriptionFormat',
        'disabled',
        'dragUnit',
        'extendAllDayEndDay',
        'extraData',
        'filterEventResources',
        'flex',
        'height',
        'hidden',
        'hideNonWorkingDays',
        'id',
        'inputFieldAlign',
        'insertBefore',
        'insertFirst',
        'items',
        'keyMap',
        'labelPosition',
        'labelWidth',
        'layout',
        'layoutStyle',
        'margin',
        'maxDate',
        'maxHeight',
        'maximizeOnMobile',
        'maxWidth',
        'minDate',
        'minHeight',
        'minWidth',
        'nonWorkingDays',
        'parent',
        'pastEventCls',
        'readOnly',
        'record',
        'rendition',
        'rtl',
        'scrollable',
        'shortDateFormat',
        'shortDateTimeFormat',
        'span',
        'state',
        'strictRecordMapping',
        'syncCalendarDate',
        'syncViewDate',
        'title',
        'tools',
        'tooltip',
        'values',
        'view',
        'width',
        'x',
        'y'
    ]);

    private elementRef: ElementRef;
    public instance!: YearPlanner;

    private bryntumConfig = {
        adopt            : undefined,
        appendTo         : undefined,
        href             : undefined,
        angularComponent : this,
        features         : {},
        listeners        : {}
    };

    constructor(element: ElementRef) {
        this.elementRef = element;
    }

    // Configs only
    @Input() activationKey                ! : string;
    @Input() adopt                        ! : HTMLElement|string;
    @Input() align                        ! : AlignSpec|string;
    @Input() anchor                       ! : boolean;
    @Input() ariaDescription              ! : string;
    @Input() ariaLabel                    ! : string;
    @Input() bbar                         ! : (ContainerItemConfig|string)[]|ToolbarConfig|PagingToolbarConfig|null;
    @Input() bodyCls                      ! : string|object;
    @Input() border                       ! : boolean;
    @Input() bubbleEvents                 ! : object;
    @Input() centered                     ! : boolean;
    @Input() collapsible                  ! : boolean|PanelCollapserConfig|PanelCollapserOverlayConfig;
    @Input() color                        ! : Color;
    @Input() config                       ! : object;
    @Input() constrainTo                  ! : HTMLElement|Widget|Rectangle;
    @Input() contentElementCls            ! : string|object;
    @Input() dataField                    ! : string;
    @Input() date                         ! : Date;
    @Input() dayNameFormat                ! : 'ddd'|'dd'|'d1'|string;
    @Input() defaultBindProperty          ! : string;
    @Input() defaultFocus                 ! : ((widget: Widget) => boolean)|string;
    @Input() defaults                     ! : ContainerItemConfig;
    @Input() descriptionRenderer          ! : (view: Widget) => string;
    @Input() detectCSSCompatibilityIssues ! : boolean;
    @Input() dock                         ! : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object;
    @Input() draggable                    ! : boolean|object;
    @Input() drawer                       ! : boolean|{ side?: 'start'|'left'|'end'|'right'|'top'|'bottom', size?: string|number, inline?: boolean, autoClose?: boolean|{ mousedown?: boolean|string, focusout?: boolean|string, mouseout?: string }, autoCloseDelay?: number };
    @Input() elementAttributes            ! : Record<string, string|null>;
    @Input() eventHeaderRenderer          ! : ((detail: { view: CalendarView, eventRecord: EventModel, resourceRecord: ResourceModel, renderData: { style: object, cls: object, iconStyle: object, iconCls: object, eventColor: string, dataset: object, solidBar: boolean, bodyColor: string }, showBullet: boolean }) => DomConfig|DomConfig[]|string|void)|string;
    @Input() eventHeight                  ! : number|string;
    @Input() eventRenderer                ! : ((context: { view: CalendarMixinClass, eventRecord: EventModel, resourceRecord: ResourceModel, renderData: { style: object, cls: object, iconStyle: object, iconCls: object, eventColor: string, eventBackground: string, textColor: string, eventInnerStyle: object, dataset: object, solidBar: boolean, bodyColor: string, showBullet: boolean } }) => DomConfig|DomConfig[]|string|void)|string;
    @Input() eventSorter                  ! : (lhs: EventModel|EventBar, rhs: EventModel|EventBar) => number;
    @Input() floating                     ! : boolean;
    @Input() footer                       ! : object|string;
    @Input() getPrimaryResource           ! : ((eventRecord: EventModel) => ResourceModel)|string;
    @Input() header                       ! : string|boolean|PanelHeader;
    @Input() hideAnimation                ! : boolean|object;
    @Input() hideWhenEmpty                ! : boolean;
    @Input() icon                         ! : string|DomConfig;
    @Input() ignoreParentReadOnly         ! : boolean;
    @Input() itemCls                      ! : string;
    @Input() lazyItems                    ! : Record<string, ContainerItemConfig>|ContainerItemConfig[]|Widget[];
    @Input() listeners                    ! : YearPlannerListeners;
    @Input() localeClass                  ! : typeof Base;
    @Input() localizable                  ! : boolean;
    @Input() localizableProperties        ! : string[];
    @Input() maskDefaults                 ! : MaskConfig;
    @Input() masked                       ! : boolean|string|MaskConfig;
    @Input() monitorResize                ! : boolean|object;
    @Input() monthNameFormat              ! : 'MMMM'|'MMM'|'MM'|string;
    @Input() namedItems                   ! : Record<string, ContainerItemConfig>;
    @Input() positioned                   ! : boolean;
    @Input() preventTooltipOnTouch        ! : boolean;
    @Input() relayStoreEvents             ! : boolean;
    @Input() resourceImagePath            ! : string;
    @Input() ripple                       ! : boolean|object;
    @Input() role                         ! : string;
    @Input() rootElement                  ! : ShadowRoot|HTMLElement;
    @Input() scrollAction                 ! : 'hide'|'realign'|null;
    @Input() selectorButton               ! : ButtonConfig;
    @Input() selectorMenuItem             ! : MenuItemConfig;
    @Input() shortEventCls                ! : string;
    @Input() shortEventDuration           ! : DurationConfig|number|string;
    @Input() showAnimation                ! : boolean|object;
    @Input() showBullet                   ! : boolean|{ bar?: boolean, noBar?: boolean };
    @Input() showResourceAvatars          ! : boolean|string;
    @Input() showTooltipWhenDisabled      ! : boolean;
    @Input() stateful                     ! : boolean|object|string[];
    @Input() statefulEvents               ! : object|string[];
    @Input() stateId                      ! : string;
    @Input() stateProvider                ! : StateProvider;
    @Input() strips                       ! : Record<string, ContainerItemConfig>;
    @Input() tab                          ! : boolean|TabConfig;
    @Input() tabBarItems                  ! : ToolbarItems[]|Widget[];
    @Input() tag                          ! : string;
    @Input() tbar                         ! : ToolbarConfig|null;
    @Input() textAlign                    ! : 'left'|'center'|'right'|'start'|'end';
    @Input() timeFormat                   ! : string|((date: Date) => string);
    @Input() trapFocus                    ! : boolean;
    @Input() type                         ! : 'yearplanner';
    @Input() ui                           ! : 'plain'|'toolbar'|string|object;
    @Input() weekStartDay                 ! : number;
    @Input() weight                       ! : number;
    @Input() workingTime                  ! : { fromDay: number, toDay: number };
    @Input() year                         ! : number;

    // Configs and properties
    @Input() alignSelf                   ! : string;
    @Input() allowDragCreate             ! : boolean;
    @Input() allowDragMove               ! : boolean;
    @Input() allowDragResize             ! : boolean;
    @Input() animateTimeShift            ! : boolean;
    @Input() appendTo                    ! : HTMLElement|string;
    @Input() autoCreate                  ! : {
        gesture?: string
        newName?: Function|string
        step?: string
        snapType?: 'round'|'ceil'|'floor'
        duration?: string
        startHour?: number
    }|string|boolean|object|string|boolean;
    @Input() callOnFunctions             ! : boolean;
    @Input() catchEventHandlerExceptions ! : boolean;
    @Input() cls                         ! : string|object;
    @Input() collapsed                   ! : boolean;
    @Input() column                      ! : number;
    @Input() dataset                     ! : object|Record<string, string>;
    @Input() dateFormat                  ! : string|((date: Date) => string)|(string|((date: Date) => string));
    @Input() dateSeparator               ! : string;
    @Input() defaultScrollOptions        ! : BryntumScrollOptions;
    @Input() descriptionFormat           ! : string|string[]|boolean[]|((date: Date) => string)|(((date: Date) => string)[])|(string|string[]|boolean[]|((date: Date) => string)|(((date: Date) => string)[]));
    @Input() disabled                    ! : boolean|'inert';
    @Input() dragUnit                    ! : string;
    @Input() extendAllDayEndDay          ! : boolean;
    @Input() extraData                   ! : any;
    @Input() filterEventResources        ! : boolean;
    @Input() flex                        ! : number|string;
    @Input() height                      ! : number|string;
    @Input() hidden                      ! : boolean;
    @Input() hideNonWorkingDays          ! : boolean;
    @Input() id                          ! : string;
    @Input() inputFieldAlign             ! : 'start'|'end';
    @Input() insertBefore                ! : HTMLElement|string;
    @Input() insertFirst                 ! : HTMLElement|string;
    @Input() keyMap                      ! : Record<string, KeyMapConfig>;
    @Input() labelPosition               ! : 'before'|'above'|'align-before'|'auto'|null;
    @Input() labelWidth                  ! : number|null;
    @Input() layout                      ! : Layout|string|ContainerLayoutConfig;
    @Input() layoutStyle                 ! : object;
    @Input() margin                      ! : number|string;
    @Input() maxDate                     ! : Date|string;
    @Input() maxHeight                   ! : string|number;
    @Input() maximizeOnMobile            ! : number|string;
    @Input() maxWidth                    ! : string|number;
    @Input() minDate                     ! : Date|string;
    @Input() minHeight                   ! : string|number;
    @Input() minWidth                    ! : string|number;
    @Input() nonWorkingDays              ! : Record<number, boolean>;
    @Input() pastEventCls                ! : string;
    @Input() readOnly                    ! : boolean;
    @Input() rendition                   ! : string|Record<string, string>|null;
    @Input() rtl                         ! : boolean;
    @Input() scrollable                  ! : Scroller|boolean|ScrollerConfig;
    @Input() shortDateFormat             ! : string|((date: Date) => string)|(string|((date: Date) => string));
    @Input() shortDateTimeFormat         ! : string|((date: Date) => string)|(string|((date: Date) => string));
    @Input() span                        ! : number;
    @Input() strictRecordMapping         ! : boolean;
    @Input() syncCalendarDate            ! : boolean;
    @Input() syncViewDate                ! : boolean;
    @Input() title                       ! : string;
    @Input() tools                       ! : Record<string, Tool|ToolConfig>|null|Record<string, Tool>|Record<string, ToolConfig>;
    @Input() tooltip                     ! : string|TooltipConfig|null;
    @Input() view                        ! : CalendarRow|CalendarRowConfig;
    @Input() width                       ! : number|string;
    @Input() x                           ! : number;
    @Input() y                           ! : number;

    // Properties only
    @Input() dayCellCls ! : string;
    @Input() items      ! : (ContainerItemConfig|MenuItemConfig|Widget)[]|Record<string, ContainerItemConfig|MenuItemConfig>|Widget[];
    @Input() parent     ! : Widget;
    @Input() record     ! : Model;
    @Input() state      ! : any;
    @Input() values     ! : Record<string, object>;

    // Events emitters
    /**
     * This event fires whenever the [autoCreate gesture](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-autoCreate) is detected
     * and also when a [drag-create](https://bryntum.com/products/calendar/docs/api/Calendar/feature/CalendarDrag) gesture is detected.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#event-beforeAutoCreate)
     * @param {object} event Event object
     * @param {Event} event.domEvent The DOM event which initiated the creation.
     * @param {Date} event.date *DEPRECATED in favour of `startDate`.* The starting time of the event to be created. If this is in a `DayView`, this will be snapped according to the specification in [autoCreate](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-autoCreate)
     * @param {Date} event.startDate The starting time of the event to be created. If this is in a `DayView`, this will be snapped according to the specification in [autoCreate](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-autoCreate)
     * @param {Date} event.endDate The ending time of the event to be created.
     * @param {Scheduler.model.ResourceModel} event.resourceRecord The resource if the UI includes a resource.
     * @param {CalendarView} event.view This view.
     */
    @Output() onBeforeAutoCreate: any = new EventEmitter<((event: { domEvent: Event, date: Date, startDate: Date, endDate: Date, resourceRecord: ResourceModel, view: CalendarView }) => Promise<boolean>|boolean|void)|string>();
    /**
     * Triggered before a view's orientating date changes.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#event-beforeChangeDate)
     * @param {object} event Event object
     * @param {Date} event.oldDate The current orientating date of this view.
     * @param {Date} event.date The new date to which this view is to be orientated.
     */
    @Output() onBeforeChangeDate: any = new EventEmitter<((event: { oldDate: Date, date: Date }) => Promise<boolean>|boolean|void)|string>();
    /**
     * Fires before an object is destroyed.
     * @param {object} event Event object
     * @param {Core.Base} event.source The Object that is being destroyed.
     */
    @Output() onBeforeDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
    /**
     * Triggered before a widget is hidden. Return `false` to prevent the action.
     * @param {object} event Event object
     * @param {Core.widget.Widget} event.source The widget being hidden.
     */
    @Output() onBeforeHide: any = new EventEmitter<((event: { source: Widget }) => Promise<boolean>|boolean|void)|string>();
    /**
     * Fired before this container will load record values into its child fields. This is useful if you
     * want to modify the UI before data is loaded (e.g. set some input field to be readonly)
     * @param {object} event Event object
     * @param {Core.widget.Container} event.source The container
     * @param {Core.data.Model} event.record The record
     */
    @Output() onBeforeSetRecord: any = new EventEmitter<((event: { source: Container, record: Model }) => void)|string>();
    /**
     * Triggered before a widget is shown. Return `false` to prevent the action.
     * @param {object} event Event object
     * @param {Core.widget.Widget,any} event.source The widget being shown
     */
    @Output() onBeforeShow: any = new EventEmitter<((event: { source: Widget|any }) => Promise<boolean>|boolean|void)|string>();
    /**
     * Fired before state is applied to the source. Allows editing the state object or preventing the operation.
     * @param {object} event Event object
     * @param {any} event.state State object config
     */
    @Output() onBeforeStateApply: any = new EventEmitter<((event: { state: any }) => Promise<boolean>|boolean|void)|string>();
    /**
     * Fired before state is saved by the StateProvider. Allows editing the state object or preventing the operation.
     * @param {object} event Event object
     * @param {any} event.state State object config
     */
    @Output() onBeforeStateSave: any = new EventEmitter<((event: { state: any }) => Promise<boolean>|boolean|void)|string>();
    /**
     * Fires when any other event is fired from the object.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#event-catchAll)
     * @param {object} event Event object
     * @param {{[key: string]: any, type: string}} event.event The Object that contains event details
     * @param {string} event.event.type The type of the event which is caught by the listener
     */
    @Output() onCatchAll: any = new EventEmitter<((event: {[key: string]: any, type: string}) => void)|string>();
    /**
     * Fires when a Panel is collapsed using the [collapsible](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-collapsible) setting.
     * @param {object} event Event object
     * @param {Core.widget.Panel} event.source This Panel.
     */
    @Output() onCollapse: any = new EventEmitter<((event: { source: Panel }) => void)|string>();
    /**
     * Fires when an object is destroyed.
     * @param {object} event Event object
     * @param {Core.Base} event.source The Object that is being destroyed.
     */
    @Output() onDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
    /**
     * Fires when a field is mutated and the state of the [hasChanges](https://bryntum.com/products/calendar/docs/api/Core/widget/Container#property-hasChanges) property changes
     * @param {object} event Event object
     * @param {Core.widget.Container} event.source The container.
     * @param {boolean} event.dirty The dirty state of the Container - `true` if there are any fields which have been changed since initial load.
     */
    @Output() onDirtyStateChange: any = new EventEmitter<((event: { source: Container, dirty: boolean }) => void)|string>();
    /**
     * Triggered when a widget's [element](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#property-element) is available.
     * @param {object} event Event object
     * @param {HTMLElement} event.element The Widget's element.
     */
    @Output() onElementCreated: any = new EventEmitter<((event: { element: HTMLElement }) => void)|string>();
    /**
     * Fired when an [autoCreate](https://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-autoCreate) gesture has created a new event
     * and added it to the event store.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#event-eventAutoCreated)
     * @param {object} event Event object
     * @param {CalendarView} event.source This Calendar view instance.
     * @param {Scheduler.model.EventModel} event.eventRecord The new event record.
     */
    @Output() onEventAutoCreated: any = new EventEmitter<((event: { source: CalendarView, eventRecord: EventModel }) => void)|string>();
    /**
     * Fires when a Panel is expanded using the [collapsible](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-collapsible) setting.
     * @param {object} event Event object
     * @param {Core.widget.Panel} event.source This Panel.
     */
    @Output() onExpand: any = new EventEmitter<((event: { source: Panel }) => void)|string>();
    /**
     * Fired when focus enters this Widget.
     * @param {object} event Event object
     * @param {Core.widget.Widget} event.source This Widget
     * @param {HTMLElement} event.fromElement The element which lost focus.
     * @param {HTMLElement} event.toElement The element which gained focus.
     * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
     * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
     * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
     */
    @Output() onFocusIn: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
    /**
     * Fired when focus exits this Widget's ownership tree. This is different from a `blur` event.
     * focus moving from within this Widget's ownership tree, even if there are floating widgets
     * will not trigger this event. This is when focus exits this widget completely.
     * @param {object} event Event object
     * @param {Core.widget.Widget} event.source This Widget
     * @param {HTMLElement} event.fromElement The element which lost focus.
     * @param {HTMLElement} event.toElement The element which gained focus.
     * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
     * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
     * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
     */
    @Output() onFocusOut: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
    /**
     * Triggered after a widget was hidden
     * @param {object} event Event object
     * @param {Core.widget.Widget} event.source The widget
     */
    @Output() onHide: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
    /**
     * Triggered when a widget which had been in a non-visible state for any reason
     * achieves visibility.
     * [More...](https://bryntum.com/products/calendar/docs/api/Calendar/widget/YearPlanner#event-paint)
     * @param {object} event Event object
     * @param {Core.widget.Widget} event.source The widget being painted.
     * @param {boolean} event.firstPaint `true` if this is the first paint.
     */
    @Output() onPaint: any = new EventEmitter<((event: { source: Widget, firstPaint: boolean }) => void)|string>();
    /**
     * Fired when a Widget's read only state is toggled
     * @param {object} event Event object
     * @param {boolean} event.readOnly Read only or not
     */
    @Output() onReadOnly: any = new EventEmitter<((event: { readOnly: boolean }) => void)|string>();
    /**
     * This event is fired after a widget's elements have been synchronized due to a direct or indirect call
     * to [recompose](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#function-recompose), if this results in some change to the widget's rendered DOM elements.
     */
    @Output() onRecompose: any = new EventEmitter<(() => void)|string>();
    /**
     * Fired when the encapsulating element of a Widget resizes *only when [monitorResize](https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#config-monitorResize) is `true`*.
     * @param {object} event Event object
     * @param {Core.widget.Widget} event.source This Widget
     * @param {number} event.width The new width
     * @param {number} event.height The new height
     * @param {number} event.oldWidth The old width
     * @param {number} event.oldHeight The old height
     */
    @Output() onResize: any = new EventEmitter<((event: { source: Widget, width: number, height: number, oldWidth: number, oldHeight: number }) => void)|string>();
    /**
     * Triggered after a widget is shown.
     * @param {object} event Event object
     * @param {Core.widget.Widget} event.source The widget
     */
    @Output() onShow: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
    /**
     * A header [tool](https://bryntum.com/products/calendar/docs/api/Core/widget/Panel#config-tools) has been clicked.
     * @param {object} event Event object
     * @param {Core.widget.Tool} event.source This Panel.
     * @param {Core.widget.Tool} event.tool The tool which is being clicked.
     */
    @Output() onToolClick: any = new EventEmitter<((event: { source: Tool, tool: Tool }) => void)|string>();

    /**
     * Create and append the underlying widget
     */
    ngOnInit(): void {
        const
            me = this,
            {
                elementRef,
                bryntumConfig
            } = me,
            {
                instanceClass,
                instanceName,
                bryntumConfigs,
                bryntumEvents
            } = BryntumYearPlannerComponent;

        bryntumConfigs.filter(prop => prop in this).forEach(prop => {
            // @ts-ignore
            WrapperHelper.applyPropValue(bryntumConfig, prop, this[prop]);
            if (['features', 'config'].includes(prop)) {
                WrapperHelper.devWarningConfigProp(instanceName, prop);
            }
        });
        // @ts-ignore
        bryntumEvents.filter(event => this[event] && this[event].observers.length > 0).forEach(event => {
            const
                uncapitalize = (str: string) => str.charAt(0).toLowerCase() + str.slice(1),
                eventName = (str: string) => uncapitalize(str.slice(2));

            // @ts-ignore
            bryntumConfig.listeners[eventName(event)] = e => {
                // @ts-ignore
                me[event].emit(e);
                // EventEmitter does not return values in the normal way, work around it by setting `returnValue` flag
                // in Angular listeners
                return e.returnValue;
            };
        });

        // If component has no container specified in config then use adopt to Wrapper's element
        const
            containerParam = [
                'adopt',
                'appendTo',
                'insertAfter',
                'insertBefore'
                // @ts-ignore
            ].find(prop => bryntumConfig[prop]);
        if (!containerParam) {
            if (instanceName === 'Button' || elementRef.nativeElement.getRootNode() instanceof ShadowRoot) {
                // Button should always be <a> or <button> inside owner element
                bryntumConfig.appendTo = elementRef.nativeElement;
            }
            else {
                bryntumConfig.adopt = elementRef.nativeElement;
            }
        }
        else {
            WrapperHelper.devWarningContainer(instanceName, containerParam);
        }

        // In shadow DOM (e.g. Angular ViewEncapsulation.ShadowDom), theme CSS from document.head
        // does not cascade into the shadow root. Inject a matching <link> so Bryntum's CSS check
        // finds the theme. The @font-face rules from component styles are also extracted to
        // document scope so document.fonts detects them (shadow-root @font-face is not reliably
        // included in document.fonts across all browsers).
        const shadowRoot = elementRef.nativeElement.getRootNode();
        if (shadowRoot instanceof ShadowRoot) {
            initThemeInShadowRoots();
            BryntumYearPlannerComponent.ensureFontsInDocument(shadowRoot);
        }

        // @ts-ignore
        me.instance = instanceName === 'Widget' ? Widget.create(bryntumConfig) : new instanceClass(bryntumConfig);

    }

    /**
     * Extracts all @font-face declarations from a shadow root's stylesheets and adds them to
     * document.head as a single <style> element. This is needed because @font-face rules inside
     * a shadow root are not reliably included in document.fonts across all browsers, causing
     * Bryntum's CSS compatibility check to incorrectly report missing fonts.
     * Safe to call multiple times — the extraction runs only once per page.
     */
    private static ensureFontsInDocument(shadowRoot: ShadowRoot): void {
        if (document.querySelector('#b-shadow-root-fonts')) {
            return;
        }

        const fontFaceRules: string[] = [];

        const extractFromSheet = (sheet: CSSStyleSheet): void => {
            try {
                const rules = sheet.cssRules;
                for (let i = 0; i < rules.length; i++) {
                    if (rules[i].type === CSSRule.FONT_FACE_RULE) {
                        fontFaceRules.push(rules[i].cssText);
                    }
                }
            }
            catch (_e) {
                // Cross-origin access may throw; silently skip
            }
        };

        // adoptedStyleSheets (Angular 14+ / modern browsers)
        const adoptedSheets: CSSStyleSheet[] = (shadowRoot as any).adoptedStyleSheets ?? [];
        adoptedSheets.forEach(sheet => extractFromSheet(sheet));

        // <style> elements (older Angular or fallback)
        shadowRoot.querySelectorAll('style').forEach(el => {
            if (el.sheet) {
                extractFromSheet(el.sheet);
            }
        });

        if (fontFaceRules.length > 0) {
            const style = document.createElement('style');
            style.id = 'b-shadow-root-fonts';
            style.textContent = fontFaceRules.join('\n');
            document.head.appendChild(style);
        }
    }

    /**
     * Watch for changes
     * @param changes
     */
    ngOnChanges(changes: SimpleChanges): void {
        const
            { instance } = this,
            { instanceName } = BryntumYearPlannerComponent;
        if (!instance) {
            return;
        }
        // Iterate over all changes
        Object.entries(changes).forEach(([prop, change]) => {
            const
                newValue = (change as SimpleChange).currentValue,
                { instance } = this,
                { bryntumConfigsOnly, bryntumProps } = BryntumYearPlannerComponent;
            if (bryntumProps.includes(prop)) {
                WrapperHelper.applyPropValue(instance, prop, newValue, false);
                if (bryntumConfigsOnly.includes(prop)) {
                    WrapperHelper.devWarningUpdateProp(instanceName, prop);
                }
            }
        });
    }

    /**
     * Destroy the component
     */
    ngOnDestroy(): void {
        // @ts-ignore
        if (this.instance && this.instance.destroy) {
            this.instance.destroy();
        }
    }
}
