-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2527 from umbraco/v15/feature/block-area-component
V15/feature/block area component
- Loading branch information
Showing
5 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/packages/block/block-grid/components/block-grid-area/block-grid-area.element.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/packages/block/block-grid/components/block-grid-area/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './block-grid-area.element.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters