From cb52acb03043ca706037b9d5930babad229cd7c0 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 27 Sep 2022 10:33:46 +0200 Subject: [PATCH] move label and description styling to layout element for easier reuse --- .../entity-property.element.ts | 27 +++++++++---------- .../editor-property-layout.element.ts | 19 ++++++++++--- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/components/entity-property/entity-property.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/components/entity-property/entity-property.element.ts index baa3ed4997..569e265dc1 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/components/entity-property/entity-property.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/components/entity-property/entity-property.element.ts @@ -149,28 +149,25 @@ export class UmbEntityPropertyElement extends UmbContextConsumerMixin(LitElement this._propertyEditorUISubscription?.unsubscribe(); } - private _renderPropertyActionMenu() { - return html`${this.propertyEditorUIAlias - ? html`` - : ''}`; - } - render() { return html` - -
- ${this.label} - ${this._renderPropertyActionMenu()} -

${this.description}

-
+ + ${this._renderPropertyActionMenu()}
${this._element}

`; } + + private _renderPropertyActionMenu() { + return html`${this.propertyEditorUIAlias + ? html`` + : ''}`; + } } declare global { diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/editors/shared/editor-property-layout/editor-property-layout.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/editors/shared/editor-property-layout/editor-property-layout.element.ts index 83e8bd4a27..1423b5243f 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/editors/shared/editor-property-layout/editor-property-layout.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/editors/shared/editor-property-layout/editor-property-layout.element.ts @@ -1,6 +1,6 @@ import { css, html, LitElement } from 'lit'; import { UUITextStyles } from '@umbraco-ui/uui-css/lib'; -import { customElement } from 'lit/decorators.js'; +import { customElement, property } from 'lit/decorators.js'; @customElement('umb-editor-property-layout') export class UmbEditorPropertyLayoutElement extends LitElement { @@ -15,10 +15,23 @@ export class UmbEditorPropertyLayoutElement extends LitElement { `, ]; + @property({ type: String }) + public label = ''; + + @property({ type: String }) + public description = ''; + render() { return html` - - +
+ ${this.label} + +

${this.description}

+ +
+
+ +
`; } }