Merge pull request #1650 from umbraco/chore/lee/codesweep

Chore: Lee's code sweep (post-RC1, pre-RC2)
This commit is contained in:
Lee Kelleher
2024-04-18 14:08:21 +01:00
committed by GitHub
11 changed files with 34 additions and 26 deletions

View File

@@ -6,7 +6,7 @@
--uui-color-current: #316dca;
--uui-color-current-emphasis: #3e79d0;
--uui-color-current-standalone: #5b8dd7;
--uui-color-current-contrast: #f000;
--uui-color-current-contrast: #eeeeef;
--uui-color-disabled: #434c56;
--uui-color-disabled-standalone: #545d68;
--uui-color-disabled-contrast: #fcfcfc4d;

View File

@@ -1,5 +1,6 @@
import { html, customElement, css, property, when, nothing } from '@umbraco-cms/backoffice/external/lit';
import { html, customElement, css, property, when } from '@umbraco-cms/backoffice/external/lit';
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import { UUIRefElement, UUIRefEvent, UUIRefNodeElement } from '@umbraco-cms/backoffice/external/uui';
@customElement('umb-ref-item')
@@ -30,11 +31,7 @@ export class UmbRefItemElement extends UmbElementMixin(UUIRefElement) {
@click=${this.handleOpenClick}
@keydown=${this.handleOpenKeydown}
?disabled=${this.disabled}>
${when(
this.icon,
() => html`<span id="icon"><uui-icon name=${this.icon ?? ''}></uui-icon></span>`,
() => nothing,
)}
${when(this.icon, () => html`<span id="icon"><uui-icon name=${this.icon ?? ''}></uui-icon></span>`)}
<div id="info">
<div id="name">${this.name}</div>
<small id="detail">${this.detail}</small>
@@ -48,6 +45,7 @@ export class UmbRefItemElement extends UmbElementMixin(UUIRefElement) {
static styles = [
...UUIRefElement.styles,
...UUIRefNodeElement.styles,
UmbTextStyles,
css`
:host {
padding: calc(var(--uui-size-4) + 1px);

View File

@@ -59,9 +59,8 @@ export class UmbPropertyEditorUIMemberGroupPickerElement extends UmbLitElement i
@change=${this._onChange}
.selection=${this._items}
.min=${this._limitMin ?? 0}
.max=${this._limitMax ?? Infinity}
>Add</umb-input-member-group
>
.max=${this._limitMax ?? Infinity}>
</umb-input-member-group>
`;
}
}

View File

@@ -1,8 +1,9 @@
import type { UmbInputToggleElement } from '../../../components/input-toggle/input-toggle.element.js';
import { html, customElement, property, state } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UmbPropertyValueChangeEvent } from '@umbraco-cms/backoffice/property-editor';
import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
/**
* @element umb-property-editor-ui-toggle
@@ -28,9 +29,9 @@ export class UmbPropertyEditorUIToggleElement extends UmbLitElement implements U
this._showLabels = config?.getValueByAlias('showLabels');
}
private _onChange(event: CustomEvent) {
this.value = (event.target as UmbInputToggleElement).checked;
this.dispatchEvent(new CustomEvent('property-value-change'));
#onChange(event: CustomEvent & { target: UmbInputToggleElement }) {
this.value = event.target.checked;
this.dispatchEvent(new UmbPropertyValueChangeEvent());
}
render() {
@@ -39,7 +40,7 @@ export class UmbPropertyEditorUIToggleElement extends UmbLitElement implements U
.labelOn="${this._labelOn}"
.labelOff=${this._labelOff}
?showLabels="${this._showLabels}"
@change="${this._onChange}"></umb-input-toggle>`;
@change="${this.#onChange}"></umb-input-toggle>`;
}
}

View File

@@ -28,7 +28,7 @@ const entityActions: Array<ManifestTypes> = [
type: 'modal',
alias: 'Umb.Modal.DocumentTypeCreateOptions',
name: 'Document Type Create Options Modal',
js: () => import('./modal/document-type-create-options-modal.element.js'),
element: () => import('./modal/document-type-create-options-modal.element.js'),
},
];

View File

@@ -52,7 +52,6 @@ export class UmbPropertyEditorUIDocumentTypePickerElement extends UmbLitElement
.min=${this._limitMin ?? 0}
.max=${this._limitMax ?? Infinity}
.elementTypesOnly=${this._onlyElementTypes ?? false}>
<umb-localize key="general_add">Add</umb-localize>
</umb-input-document-type>
`
: '';

View File

@@ -4,7 +4,7 @@ export const manifest: ManifestPropertyEditorUi = {
type: 'propertyEditorUi',
alias: 'Umb.PropertyEditorUi.DocumentPicker',
name: 'Document Picker Property Editor UI',
js: () => import('./property-editor-ui-document-picker.element.js'),
element: () => import('./property-editor-ui-document-picker.element.js'),
meta: {
label: 'Document Picker',
propertyEditorSchemaAlias: 'Umbraco.ContentPicker',

View File

@@ -130,7 +130,7 @@ const workspaceActions: Array<ManifestWorkspaceActions> = [
weight: 90,
api: () => import('./actions/save-and-preview.action.js'),
meta: {
label: 'Save And Preview',
label: '#buttons_saveAndPreview',
},
conditions: [
{

View File

@@ -114,6 +114,7 @@ export class UmbAppLanguageSelectElement extends UmbLitElement {
}
#toggle {
color: var(--uui-color-text);
width: var(--umb-section-sidebar-width);
text-align: left;
background: none;
@@ -132,6 +133,10 @@ export class UmbAppLanguageSelectElement extends UmbLitElement {
#toggle:hover {
background-color: var(--uui-color-surface-emphasis);
}
uui-menu-item {
color: var(--uui-color-text);
}
`,
];
}

View File

@@ -74,7 +74,6 @@ export class UmbPropertyEditorUIMediaPickerElement extends UmbLitElement impleme
.selection=${this._items}
.min=${this._limitMin}
.max=${this._limitMax}>
<umb-localize key="general_add">Add</umb-localize>
</umb-input-media>
`;
}

View File

@@ -1,5 +1,6 @@
import { html, LitElement, customElement, property } from '@umbraco-cms/backoffice/external/lit';
import { css, html, LitElement, customElement, property } from '@umbraco-cms/backoffice/external/lit';
import type { UmbTableItem } from '@umbraco-cms/backoffice/components';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
@customElement('umb-user-group-table-name-column-layout')
export class UmbUserGroupTableNameColumnLayoutElement extends LitElement {
@@ -10,12 +11,18 @@ export class UmbUserGroupTableNameColumnLayoutElement extends LitElement {
value!: any;
render() {
return html` <a
style="font-weight: bold;"
href="section/user-management/view/user-groups/user-group/edit/${this.item.id}">
${this.value.name}
</a>`;
const href = `section/user-management/view/user-groups/user-group/edit/${this.item.id}`;
return html`<a href=${href}>${this.value.name}</a>`;
}
static styles = [
UmbTextStyles,
css`
a {
font-weight: bold;
}
`,
];
}
export default UmbUserGroupTableNameColumnLayoutElement;