property styling

This commit is contained in:
Jesper Møller Jensen
2023-06-09 20:10:36 +12:00
parent 9f6b50eb9c
commit ea38ce318d

View File

@@ -97,7 +97,6 @@ export class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
const target = event.composedPath()[0] as UUIInputElement;
if (typeof target?.value === 'string') {
const oldName = this.property?.name ?? '';
const oldAlias = this.property?.alias ?? '';
const newName = event.target.value.toString();
@@ -118,17 +117,21 @@ export class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
? html`
<div id="header">
<uui-input
name="label"
id="label-input"
placeholder="Label..."
.value=${this.property.name}
@input=${this.#onNameChange}></uui-input>
<!-- TODO: should use UUI-LOCK-INPUT, but that does not fire an event when its locked/unlocked -->
<uui-input
name="alias"
id="alias-input"
placeholder="Alias..."
.value=${this.property.alias}
?disabled=${this._aliasLocked}
@input=${(e: CustomEvent) => {
if (e.target) this._singleValueUpdate('alias', (e.target as HTMLInputElement).value);
}}
>
}}>
<!-- TODO: validation for bad characters -->
<div @click=${this.#onToggleAliasLock} @keydown=${() => ''} id="alias-lock" slot="prepend">
<uui-icon name=${this._aliasLocked ? 'umb:lock' : 'umb:unlocked'}></uui-icon>
@@ -137,6 +140,9 @@ export class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
<slot name="property-action-menu"></slot>
<p>
<uui-textarea
name="description"
id="description-input"
placeholder="Enter a description..."
.value=${this.property.description}
@input=${(e: CustomEvent) => {
if (e.target) this._singleValueUpdate('description', (e.target as HTMLInputElement).value);
@@ -216,7 +222,25 @@ export class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
#editor {
background-color: var(--uui-color-background);
}
#alias-input,
#label-input,
#description-input {
width: 100%;
}
#alias-input {
border-color: transparent;
background: var(--uui-color-surface);
}
#label-input {
font-weight: bold; /* TODO: UUI Input does not support bold text yet */
--uui-input-border-color: transparent;
}
#label-input input {
font-weight: bold;
--uui-input-border-color: transparent;
}
#alias-lock {
display: flex;
@@ -226,6 +250,11 @@ export class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
}
#alias-lock uui-icon {
margin-bottom: 2px;
/* margin: 0; */
}
#description-input {
--uui-textarea-border-color: transparent;
font-weight: 0.5rem; /* TODO: Cant change font size of UUI textarea yet */
}
`,
];