Allow different types of heading badges (#22109)

* Allow different type of heading item

* Update editor

* Migrate entities to items

* Rename support for string entity

* Refactor

* Rename to badges and add error state

* Update font weight

* Feedback

* Feedback
This commit is contained in:
Paul Bottein
2024-09-27 12:33:15 +02:00
committed by GitHub
parent 468660d235
commit a92dab46c2
19 changed files with 824 additions and 394 deletions

View File

@@ -0,0 +1,22 @@
import "../heading-badges/hui-entity-heading-badge";
import {
createLovelaceElement,
getLovelaceElementClass,
} from "./create-element-base";
import { LovelaceHeadingBadgeConfig } from "../heading-badges/types";
const ALWAYS_LOADED_TYPES = new Set(["error", "entity"]);
export const createHeadingBadgeElement = (config: LovelaceHeadingBadgeConfig) =>
createLovelaceElement(
"heading-badge",
config,
ALWAYS_LOADED_TYPES,
undefined,
undefined,
"entity"
);
export const getHeadingBadgeElementClass = (type: string) =>
getLovelaceElementClass(type, "heading-badge", ALWAYS_LOADED_TYPES);