From 2b073c0640688f6f62176c2c4e07d83189e4e8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20M=C3=B8ller=20Jensen?= <26099018+JesmoDev@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:54:54 +1300 Subject: [PATCH] add test value --- .../property-editor-ui-image-cropper.element.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/image-cropper/property-editor-ui-image-cropper.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/image-cropper/property-editor-ui-image-cropper.element.ts index 514db2b7c2..f9c5fea9be 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/image-cropper/property-editor-ui-image-cropper.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/image-cropper/property-editor-ui-image-cropper.element.ts @@ -1,4 +1,4 @@ -import { html, customElement, property } from '@umbraco-cms/backoffice/external/lit'; +import { html, customElement, property, nothing } from '@umbraco-cms/backoffice/external/lit'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry'; import { UmbLitElement } from '@umbraco-cms/internal/lit-element'; @@ -11,13 +11,23 @@ import '../../../components/input-image-cropper/input-image-cropper.element.js'; @customElement('umb-property-editor-ui-image-cropper') export class UmbPropertyEditorUIImageCropperElement extends UmbLitElement implements UmbPropertyEditorUiElement { @property() - value: any | undefined; + value: any = undefined; @property({ attribute: false }) public config?: UmbPropertyEditorConfigCollection; render() { - console.log('HEREs', this.value); + if (!this.config) return nothing; + + if (!this.value) { + this.value = { + crops: this.config[0].value, + focalPoint: { left: 0.5, top: 0.5 }, + src: 'https://picsum.photos/seed/picsum/2000/3000', + }; + } + + console.log('this.value', this.value); return html``; }