mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 14:26:35 +00:00
Fix automation traces (#23524)
This commit is contained in:
parent
d08a28ab9e
commit
eaab47a667
@ -1,14 +1,19 @@
|
|||||||
type NonUndefined<T> = T extends undefined ? never : T;
|
type NonNullUndefined<T> = T extends undefined
|
||||||
|
? never
|
||||||
|
: T extends null
|
||||||
|
? never
|
||||||
|
: T;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure that the input is an array or wrap it in an array
|
* Ensure that the input is an array or wrap it in an array
|
||||||
* @param value - The value to ensure is an array
|
* @param value - The value to ensure is an array
|
||||||
*/
|
*/
|
||||||
export function ensureArray(value: undefined): undefined;
|
export function ensureArray(value: undefined): undefined;
|
||||||
export function ensureArray<T>(value: T | T[]): NonUndefined<T>[];
|
export function ensureArray(value: null): null;
|
||||||
export function ensureArray<T>(value: T | readonly T[]): NonUndefined<T>[];
|
export function ensureArray<T>(value: T | T[]): NonNullUndefined<T>[];
|
||||||
|
export function ensureArray<T>(value: T | readonly T[]): NonNullUndefined<T>[];
|
||||||
export function ensureArray(value) {
|
export function ensureArray(value) {
|
||||||
if (value === undefined || Array.isArray(value)) {
|
if (value === undefined || value === null || Array.isArray(value)) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
return [value];
|
return [value];
|
||||||
|
@ -20,8 +20,8 @@ export class HatGraphNode extends LitElement {
|
|||||||
@property({ attribute: false, reflect: true, type: Boolean }) notEnabled =
|
@property({ attribute: false, reflect: true, type: Boolean }) notEnabled =
|
||||||
false;
|
false;
|
||||||
|
|
||||||
@property({ attribute: false, reflect: true, type: Boolean }) graphStart =
|
@property({ attribute: "graph-start", reflect: true, type: Boolean })
|
||||||
false;
|
graphStart = false;
|
||||||
|
|
||||||
@property({ type: Boolean, attribute: "nofocus" }) noFocus = false;
|
@property({ type: Boolean, attribute: "nofocus" }) noFocus = false;
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ export class HatGraphNode extends LitElement {
|
|||||||
var(--hat-graph-node-size) + var(--hat-graph-spacing) + 1px
|
var(--hat-graph-node-size) + var(--hat-graph-spacing) + 1px
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
:host([graphStart]) {
|
:host([graph-start]) {
|
||||||
height: calc(var(--hat-graph-node-size) + 2px);
|
height: calc(var(--hat-graph-node-size) + 2px);
|
||||||
}
|
}
|
||||||
:host([track]) {
|
:host([track]) {
|
||||||
|
@ -91,7 +91,7 @@ export class HatScriptGraph extends LitElement {
|
|||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<hat-graph-node
|
<hat-graph-node
|
||||||
graphStart
|
graph-start
|
||||||
?track=${track}
|
?track=${track}
|
||||||
@focus=${this._selectNode(config, path)}
|
@focus=${this._selectNode(config, path)}
|
||||||
?active=${this.selected === path}
|
?active=${this.selected === path}
|
||||||
@ -354,8 +354,8 @@ export class HatScriptGraph extends LitElement {
|
|||||||
></hat-graph-node>
|
></hat-graph-node>
|
||||||
<div
|
<div
|
||||||
style=${`width: ${NODE_SIZE + SPACING}px;`}
|
style=${`width: ${NODE_SIZE + SPACING}px;`}
|
||||||
graphStart
|
graph-start
|
||||||
graphEnd
|
graph-end
|
||||||
></div>
|
></div>
|
||||||
<div ?track=${trackPass}></div>
|
<div ?track=${trackPass}></div>
|
||||||
<hat-graph-node
|
<hat-graph-node
|
||||||
|
Loading…
x
Reference in New Issue
Block a user