mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Revert "Love: Add column and row card"
This reverts commit e0ccc1999ad3c83901f5e4d5b54ed0188debba39.
This commit is contained in:
parent
e0ccc1999a
commit
de91aea3b9
@ -1,48 +0,0 @@
|
|||||||
import createCardElement from '../common/create-card-element.js';
|
|
||||||
import createErrorConfig from '../common/create-error-card-config.js';
|
|
||||||
|
|
||||||
class HuiColumnCard extends HTMLElement {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
this._elements = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
getCardSize() {
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
set config(config) {
|
|
||||||
this._elements = [];
|
|
||||||
const root = this;
|
|
||||||
|
|
||||||
while (root.lastChild) {
|
|
||||||
root.removeChild(root.lastChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config && config.cards && Array.isArray(config.cards)) {
|
|
||||||
const elements = [];
|
|
||||||
config.cards.forEach(card => {
|
|
||||||
const element = createCardElement(card);
|
|
||||||
element.style.setProperty('margin', '4px');
|
|
||||||
elements.push(element);
|
|
||||||
root.appendChild(element);
|
|
||||||
});
|
|
||||||
elements[0].style.marginTop = '0';
|
|
||||||
elements[(elements.length - 1)].style.marginBottom = '0';
|
|
||||||
this._elements = elements;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
const error = 'Card config incorrect.';
|
|
||||||
const element = createCardElement(createErrorConfig(error, config));
|
|
||||||
root.appendChild(element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
set hass(hass) {
|
|
||||||
this._elements.forEach(element => {
|
|
||||||
element.hass = hass;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define('hui-column-card', HuiColumnCard);
|
|
@ -1,7 +1,6 @@
|
|||||||
import fireEvent from '../../../common/dom/fire_event.js';
|
import fireEvent from '../../../common/dom/fire_event.js';
|
||||||
|
|
||||||
import '../cards/hui-camera-preview-card.js';
|
import '../cards/hui-camera-preview-card.js';
|
||||||
import '../cards/hui-column-card.js';
|
|
||||||
import '../cards/hui-entities-card.js';
|
import '../cards/hui-entities-card.js';
|
||||||
import '../cards/hui-entity-filter-card.js';
|
import '../cards/hui-entity-filter-card.js';
|
||||||
import '../cards/hui-glance-card';
|
import '../cards/hui-glance-card';
|
||||||
@ -20,7 +19,6 @@ import createErrorCardConfig from './create-error-card-config.js';
|
|||||||
|
|
||||||
const CARD_TYPES = [
|
const CARD_TYPES = [
|
||||||
'camera-preview',
|
'camera-preview',
|
||||||
'column',
|
|
||||||
'entities',
|
'entities',
|
||||||
'entity-filter',
|
'entity-filter',
|
||||||
'entity-picture',
|
'entity-picture',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user