mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 10:26:35 +00:00
Fix calendar (#6691)
This commit is contained in:
parent
5503cd0589
commit
358c5205d2
@ -1,17 +1,15 @@
|
|||||||
import "@material/mwc-icon-button/mwc-icon-button";
|
import "@material/mwc-icon-button/mwc-icon-button";
|
||||||
import {
|
import {
|
||||||
|
css,
|
||||||
|
CSSResult,
|
||||||
customElement,
|
customElement,
|
||||||
html,
|
html,
|
||||||
TemplateResult,
|
|
||||||
property,
|
|
||||||
LitElement,
|
LitElement,
|
||||||
CSSResult,
|
property,
|
||||||
css,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
|
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import type { ToggleButton } from "../types";
|
import type { ToggleButton } from "../types";
|
||||||
|
|
||||||
import "./ha-svg-icon";
|
import "./ha-svg-icon";
|
||||||
|
|
||||||
@customElement("ha-button-toggle-group")
|
@customElement("ha-button-toggle-group")
|
||||||
@ -40,7 +38,7 @@ export class HaButtonToggleGroup extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _handleClick(ev): void {
|
private _handleClick(ev): void {
|
||||||
this.active = ev.target.value;
|
this.active = ev.currentTarget.value;
|
||||||
fireEvent(this, "value-changed", { value: this.active });
|
fireEvent(this, "value-changed", { value: this.active });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,41 +1,39 @@
|
|||||||
import "@material/mwc-button";
|
// @ts-ignore
|
||||||
import {
|
import fullcalendarStyle from "@fullcalendar/common/main.css";
|
||||||
property,
|
|
||||||
internalProperty,
|
|
||||||
PropertyValues,
|
|
||||||
LitElement,
|
|
||||||
CSSResult,
|
|
||||||
html,
|
|
||||||
css,
|
|
||||||
unsafeCSS,
|
|
||||||
TemplateResult,
|
|
||||||
} from "lit-element";
|
|
||||||
import { mdiViewModule, mdiViewWeek, mdiViewDay, mdiViewAgenda } from "@mdi/js";
|
|
||||||
import { Calendar } from "@fullcalendar/core";
|
import { Calendar } from "@fullcalendar/core";
|
||||||
import type { CalendarOptions } from "@fullcalendar/core";
|
import type { CalendarOptions } from "@fullcalendar/core";
|
||||||
import dayGridPlugin from "@fullcalendar/daygrid";
|
import dayGridPlugin from "@fullcalendar/daygrid";
|
||||||
import listPlugin from "@fullcalendar/list";
|
|
||||||
import interactionPlugin from "@fullcalendar/interaction";
|
|
||||||
// @ts-ignore
|
|
||||||
import fullcalendarStyle from "@fullcalendar/common/main.css";
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import daygridStyle from "@fullcalendar/daygrid/main.css";
|
import daygridStyle from "@fullcalendar/daygrid/main.css";
|
||||||
|
import interactionPlugin from "@fullcalendar/interaction";
|
||||||
|
import listPlugin from "@fullcalendar/list";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import listStyle from "@fullcalendar/list/main.css";
|
import listStyle from "@fullcalendar/list/main.css";
|
||||||
|
import "@material/mwc-button";
|
||||||
|
import { mdiViewAgenda, mdiViewDay, mdiViewModule, mdiViewWeek } from "@mdi/js";
|
||||||
|
import {
|
||||||
|
css,
|
||||||
|
CSSResult,
|
||||||
|
html,
|
||||||
|
internalProperty,
|
||||||
|
LitElement,
|
||||||
|
property,
|
||||||
|
PropertyValues,
|
||||||
|
TemplateResult,
|
||||||
|
unsafeCSS,
|
||||||
|
} from "lit-element";
|
||||||
import memoize from "memoize-one";
|
import memoize from "memoize-one";
|
||||||
|
|
||||||
import "../../components/ha-icon-button";
|
|
||||||
import "../../components/ha-button-toggle-group";
|
|
||||||
|
|
||||||
import type {
|
|
||||||
CalendarViewChanged,
|
|
||||||
CalendarEvent,
|
|
||||||
ToggleButton,
|
|
||||||
HomeAssistant,
|
|
||||||
FullCalendarView,
|
|
||||||
} from "../../types";
|
|
||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
|
import "../../components/ha-button-toggle-group";
|
||||||
|
import "../../components/ha-icon-button";
|
||||||
import { haStyle } from "../../resources/styles";
|
import { haStyle } from "../../resources/styles";
|
||||||
|
import type {
|
||||||
|
CalendarEvent,
|
||||||
|
CalendarViewChanged,
|
||||||
|
FullCalendarView,
|
||||||
|
HomeAssistant,
|
||||||
|
ToggleButton,
|
||||||
|
} from "../../types";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
@ -191,8 +189,8 @@ class HAFullCalendar extends LitElement {
|
|||||||
locale: this.hass.language,
|
locale: this.hass.language,
|
||||||
};
|
};
|
||||||
|
|
||||||
config.dateClick = this._handleDateClick;
|
config.dateClick = (info) => this._handleDateClick(info);
|
||||||
config.eventClick = this._handleEventClick;
|
config.eventClick = (info) => this._handleEventClick(info);
|
||||||
|
|
||||||
this.calendar = new Calendar(
|
this.calendar = new Calendar(
|
||||||
this.shadowRoot!.getElementById("calendar")!,
|
this.shadowRoot!.getElementById("calendar")!,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user