Skip to content

Commit

Permalink
block area component
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe committed Nov 8, 2024
1 parent 6a7e8ad commit 9b71096
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { UMB_BLOCK_GRID_ENTRIES_CONTEXT } from '../../context/block-grid-entries.context-token.js';
import { UmbBlockGridEntriesElement } from '../block-grid-entries/index.js';
import { customElement } from '@umbraco-cms/backoffice/external/lit';

/**
* @description
* This element is used to render a single block grid area.
*/
@customElement('umb-block-grid-area')
export class UmbBlockGridAreasContainerElement extends UmbBlockGridEntriesElement {
//
constructor() {
super();

this.consumeContext(UMB_BLOCK_GRID_ENTRIES_CONTEXT, (context) => {
this.observe(
context.layoutColumns,
(layoutColumns) => {
this.layoutColumns = layoutColumns;
},
'observeParentEntriesLayoutColumns',
);
}).skipHost();
}

override connectedCallback(): void {
super.connectedCallback();
// eslint-disable-next-line wc/no-self-class
this.classList.add('umb-block-grid__area');
}
}

export default UmbBlockGridAreasContainerElement;

declare global {
interface HTMLElementTagNameMap {
'umb-block-grid-area': UmbBlockGridAreasContainerElement;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './block-grid-area.element.js';

0 comments on commit 9b71096

Please sign in to comment.