Merge branch 'v15/dev' into v16/dev

This commit is contained in:
Andy Butland
2025-03-13 10:43:42 +01:00
5 changed files with 19 additions and 37 deletions

View File

@@ -5,8 +5,7 @@ import { html, customElement, state, nothing, css } from '@umbraco-cms/backoffic
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
const elementName = 'umb-picker-search-field';
@customElement(elementName)
@customElement('umb-picker-search-field')
export class UmbPickerSearchFieldElement extends UmbLitElement {
@state()
_query: string = '';
@@ -66,6 +65,11 @@ export class UmbPickerSearchFieldElement extends UmbLitElement {
width: 100%;
}
uui-input [slot='prepend'] {
display: flex;
align-items: center;
}
#divider {
width: 100%;
height: 1px;
@@ -84,6 +88,6 @@ export class UmbPickerSearchFieldElement extends UmbLitElement {
declare global {
interface HTMLElementTagNameMap {
[elementName]: UmbPickerSearchFieldElement;
'umb-picker-search-field': UmbPickerSearchFieldElement;
}
}

View File

@@ -6,8 +6,7 @@ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { UmbSearchRequestArgs } from '@umbraco-cms/backoffice/search';
import type { UmbEntityModel } from '@umbraco-cms/backoffice/entity';
const elementName = 'umb-picker-search-result';
@customElement(elementName)
@customElement('umb-picker-search-result')
export class UmbPickerSearchResultElement extends UmbLitElement {
@state()
_query?: UmbSearchRequestArgs;
@@ -67,6 +66,6 @@ export class UmbPickerSearchResultElement extends UmbLitElement {
declare global {
interface HTMLElementTagNameMap {
[elementName]: UmbPickerSearchResultElement;
'umb-picker-search-result': UmbPickerSearchResultElement;
}
}

View File

@@ -424,6 +424,10 @@ export class UmbMediaPickerModalElement extends UmbModalBaseElement<UmbMediaPick
width: 100%;
margin-bottom: var(--uui-size-3);
}
#search uui-input [slot='prepend'] {
display: flex;
align-items: center;
}
#searching-indicator {
margin-left: 7px;

View File

@@ -21,20 +21,6 @@ export const manifests: Array<UmbExtensionManifest> = [
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
config: [{ alias: 'min', value: 0 }],
},
{
alias: 'minHeight',
label: 'Min height (pixels)',
description: 'Sets the minimum height of the textarea',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
config: [{ alias: 'min', value: 0 }],
},
{
alias: 'maxHeight',
label: 'Max height (pixels)',
description: 'Sets the maximum height of the textarea',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
config: [{ alias: 'min', value: 0 }],
},
],
defaultData: [{ alias: 'rows', value: 10 }],
},

View File

@@ -46,36 +46,25 @@ export class UmbPropertyEditorUITextareaElement
@state()
private _rows?: number;
@state()
private _maxHeight?: number;
@state()
private _minHeight?: number;
@state()
private _css: StyleInfo = {};
public set config(config: UmbPropertyEditorConfigCollection | undefined) {
this._maxChars = Number(config?.getValueByAlias('maxChars')) || undefined;
this._rows = Number(config?.getValueByAlias('rows')) || undefined;
this._minHeight = Number(config?.getValueByAlias('minHeight')) || undefined;
this._maxHeight = Number(config?.getValueByAlias('maxHeight')) || undefined;
// min/max height where for a short period present in the config, but we do not want this complexity of our configuration.
// @deprecated remove config option in v.18, leave good default.
const _minHeight = Number(config?.getValueByAlias('minHeight')) || undefined;
const _maxHeight = Number(config?.getValueByAlias('maxHeight')) || undefined;
this._css = {
'--uui-textarea-min-height': this._minHeight ? `${this._minHeight}px` : 'reset',
'--uui-textarea-max-height': this._maxHeight ? `${this._maxHeight}px` : 'reset',
'--uui-textarea-min-height': _minHeight ? `${_minHeight}px` : 'reset',
'--uui-textarea-max-height': _maxHeight ? `${_maxHeight}px` : '33vh',
};
}
protected override firstUpdated(): void {
this.addFormControlElement(this.shadowRoot!.querySelector('uui-textarea')!);
if (this._minHeight && this._maxHeight && this._minHeight > this._maxHeight) {
console.warn(
`Property '${this.name}' (Textarea) has been misconfigured, 'minHeight' is greater than 'maxHeight'. Please correct your data type configuration.`,
this,
);
}
}
override focus() {