mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-12 04:20:28 +00:00
Calendar Panel: FullCalendar (#5742)
* WIP * remove big calendar * remove file * Convert to lit * More * Ready for the public to see? prob not * Fix types and imports * Remove dependencies * ignore the typing that hasnt been finished in Beta * Convert paper to MWC * Styling * View list as name of view | MWC components version * Updates action directive for ripple. MWC 14.1.0 * Update * Updates * Update height styling * Toggle Button Group * Adds Toggle group transition * style updates * Few fixes * Fix Yarn lock from merge | height of celndar as parent * Update package Json and yarn | remove unneeded pkg * Remove mwc-list * Search hass.states for calendars instead of api * Move function to file in data | event fetch logic * compute state name * add ha button menu | refresh * Remove Event ffetch logic * copy pasta * Types * Fix for toggling * Translations * Update ha-button-toggle-group * Update ha-button-toggle-group.ts * Update ha-button-toggle-group.ts * Change mobile view * Locale in fullcalendar * Comments * ha-button-menu trigger slot * Comments * icon-x * Update src/panels/calendar/ha-panel-calendar.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl> * Update src/panels/calendar/ha-panel-calendar.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
55
src/components/ha-button-menu.ts
Normal file
55
src/components/ha-button-menu.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
TemplateResult,
|
||||
LitElement,
|
||||
CSSResult,
|
||||
css,
|
||||
query,
|
||||
} from "lit-element";
|
||||
import "@material/mwc-button";
|
||||
import "@material/mwc-menu";
|
||||
import "@material/mwc-list/mwc-list-item";
|
||||
import type { Menu } from "@material/mwc-menu";
|
||||
|
||||
import { haStyle } from "../resources/styles";
|
||||
|
||||
import "./ha-icon-button";
|
||||
|
||||
@customElement("ha-button-menu")
|
||||
export class HaButtonMenu extends LitElement {
|
||||
@query("mwc-menu") private _menu?: Menu;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
<div @click=${this._handleClick}>
|
||||
<slot name="trigger"></slot>
|
||||
</div>
|
||||
<mwc-menu>
|
||||
<slot></slot>
|
||||
</mwc-menu>
|
||||
`;
|
||||
}
|
||||
|
||||
private _handleClick(): void {
|
||||
this._menu!.anchor = this;
|
||||
this._menu!.show();
|
||||
}
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return [
|
||||
haStyle,
|
||||
css`
|
||||
:host {
|
||||
position: relative;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"ha-button-menu": HaButtonMenu;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user