umb-property

This commit is contained in:
Niels Lyngsø
2023-12-08 12:49:26 +01:00
parent 950372cc38
commit 2855af3352
5 changed files with 14 additions and 14 deletions

View File

@@ -60,12 +60,12 @@ export class UmbPropertyTypeBasedPropertyElement extends UmbLitElement {
}
render() {
return html`<umb-workspace-property
return html`<umb-property
alias=${ifDefined(this._property?.alias)}
label=${ifDefined(this._property?.name)}
description=${ifDefined(this._property?.description || undefined)}
property-editor-ui-alias=${ifDefined(this._propertyEditorUiAlias)}
.config=${this._dataTypeData}></umb-workspace-property>`;
.config=${this._dataTypeData}></umb-property>`;
}
static styles = [

View File

@@ -45,12 +45,12 @@ export class UmbPropertyEditorConfigElement extends UmbLitElement {
this._properties,
(property) => property.alias,
(property) =>
html`<umb-workspace-property
html`<umb-property
label="${property.label}"
description="${ifDefined(property.description)}"
alias="${property.alias}"
property-editor-ui-alias="${property.propertyEditorUiAlias}"
.config=${property.config}></umb-workspace-property>`,
.config=${property.config}></umb-property>`,
)
: html`<div>No configuration</div>`;
}

View File

@@ -35,13 +35,13 @@ export class UmbPropertyDatasetElement extends UmbLitElement {
*
* html`
* <umb-property-dataset .value="${dataSet}">
* <umb-workspace-property
* <umb-property
* label="My label for this property"
* description="The description to show on the property"
* alias="testAlias"
* property-editor-ui-alias="Umb.PropertyEditorUi.TextBox"
* .config=${...}>
* </umb-workspace-property>
* </umb-property>
* </umb-property-dataset>
* `
* ```

View File

@@ -11,14 +11,14 @@ import {
} from '@umbraco-cms/backoffice/property-editor';
/**
* @element umb-workspace-property
* @element umb-property
* @description Component for displaying a property with editor from extension registry.
* The Element will render a Property Editor based on the Property Editor UI alias passed to the element.
* This will also render all Property Actions related to the Property Editor UI Alias.
*/
@customElement('umb-workspace-property')
export class UmbWorkspacePropertyElement extends UmbLitElement {
@customElement('umb-property')
export class UmbPropertyElement extends UmbLitElement {
/**
* Label. Name of the property
* @type {string}
@@ -238,6 +238,6 @@ export class UmbWorkspacePropertyElement extends UmbLitElement {
declare global {
interface HTMLElementTagNameMap {
'umb-workspace-property': UmbWorkspacePropertyElement;
'umb-property': UmbPropertyElement;
}
}

View File

@@ -1,5 +1,5 @@
import { Meta, Story } from '@storybook/web-components';
import type { UmbWorkspacePropertyElement } from './property.element.js';
import type { UmbPropertyElement } from './property.element.js';
import { html } from '@umbraco-cms/backoffice/external/lit';
import './property.element.js';
@@ -10,11 +10,11 @@ export default {
id: 'umb-property',
} as Meta;
export const AAAOverview: Story<UmbWorkspacePropertyElement> = () =>
html` <umb-workspace-property
export const AAAOverview: Story<UmbPropertyElement> = () =>
html` <umb-property
label="Property"
description="Description"
alias="textProperty"
property-editor-ui-alias="Umb.PropertyEditorUi.TextBox"
.value="${'Hello'}"></umb-workspace-property>`;
.value="${'Hello'}"></umb-property>`;
AAAOverview.storyName = 'Overview';