Skip to content

Commit

Permalink
Add visual card editor support (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol authored Sep 26, 2024
1 parent 0a6dfbd commit b6a3491
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions vertical-stack-in-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,23 @@ class VerticalStackInCard extends HTMLElement {
const sizes = await Promise.all(this._refCards.map(this._computeCardSize));
return sizes.reduce((a, b) => a + b, 0);
}
}

customElements.define('vertical-stack-in-card', VerticalStackInCard);
static getConfigElement() {
return customElements.get('hui-vertical-stack-card').getConfigElement();
}

window.customElements.get('vertical-stack-in-card').getConfigElement = function() {
return document.createElement('hui-stack-card-editor');
static getStubConfig() {
return {
cards: [],
};
}
}

customElements.define('vertical-stack-in-card', VerticalStackInCard);
window.customCards = window.customCards || [];
window.customCards.push({
type: 'vertical-stack-in-card',
name: 'Vertical Stack In Card',
description: 'Group multiple cards into a single sleek card.',
preview: false,
});

0 comments on commit b6a3491

Please sign in to comment.