Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 596d1b2

Browse files
committed
example
1 parent d4fe85d commit 596d1b2

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

examples/property-editor/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Property Dataset Dashboard Example
2+
3+
This example is a work in progress example of how to write a property editor.
4+
5+
This example covers a few points:
6+
7+
- Using an existing Property Editor Schema

examples/property-editor/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { ManifestPropertyEditorUi } from '@umbraco-cms/backoffice/extension-registry';
2+
3+
export const manifests: Array<ManifestPropertyEditorUi> = [
4+
{
5+
type: 'propertyEditorUi',
6+
alias: 'example.propertyEditorUi.propertyEditor',
7+
name: 'Example Property Editor UI',
8+
element: () => import('./property-editor.js'),
9+
meta: {
10+
label: 'Example Editor',
11+
propertyEditorSchemaAlias: 'Umbraco.ListView',
12+
icon: 'icon-code',
13+
group: 'common',
14+
settings: {
15+
properties: [
16+
{
17+
alias: 'customText',
18+
label: 'Custom text',
19+
propertyEditorUiAlias: 'Umb.PropertyEditorUi.TextBox',
20+
},
21+
],
22+
},
23+
},
24+
},
25+
];
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
2+
import { html, customElement, LitElement } from '@umbraco-cms/backoffice/external/lit';
3+
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
4+
5+
@customElement('example-property-editor')
6+
export class ExamplePropertyEditor extends UmbElementMixin(LitElement) {
7+
override render() {
8+
return html` <h1 class="uui-h2">Property Editor Example</h1> `;
9+
}
10+
11+
static override styles = [UmbTextStyles];
12+
}
13+
14+
export default ExamplePropertyEditor;
15+
16+
declare global {
17+
interface HTMLElementTagNameMap {
18+
'example-property-editor': ExamplePropertyEditor;
19+
}
20+
}

src/packages/data-type/components/property-editor-config/property-editor-config.element.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { UmbDataPathPropertyValueFilter } from '@umbraco-cms/backoffice/validati
1212
*/
1313
@customElement('umb-property-editor-config')
1414
export class UmbPropertyEditorConfigElement extends UmbLitElement {
15-
// TODO: Make this element generic, so its not bound to DATA-TYPEs. This will require moving some functionality of Data-Type-Context to this. and this might need to self provide a variant Context for its inner property editor UIs.
15+
// TODO: Make this element generic, so its not bound to DATA-TYPEs. This will require moving some functionality of Data-Type-Context to this. and this might need to self provide a variant Context for its inner property editor UIs. [NL]
1616
#workspaceContext?: typeof UMB_DATA_TYPE_WORKSPACE_CONTEXT.TYPE;
1717

1818
@state()
@@ -53,7 +53,8 @@ export class UmbPropertyEditorConfigElement extends UmbLitElement {
5353
property-editor-ui-alias=${property.propertyEditorUiAlias}
5454
.config=${property.config}></umb-property>`,
5555
)
56-
: html`<div>No configuration</div>`;
56+
: // TODO: Localize this [NL]
57+
html`<div>No configuration</div>`;
5758
}
5859

5960
static override styles = [UmbTextStyles];

0 commit comments

Comments
 (0)