Updated with @madsrasmussen's feedback
Reverted the `disabled` on Multi-URL Picker, as there's more work involved, with do as a separate bugfix.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { UmbDocumentPickerContext } from './input-document.context.js';
|
||||
import { css, html, customElement, property, state, repeat } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { classMap, css, customElement, html, property, repeat, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { splitStringToArray } from '@umbraco-cms/backoffice/utils';
|
||||
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
@@ -140,7 +140,7 @@ export class UmbInputDocumentElement extends UUIFormControlMixin(UmbLitElement,
|
||||
}
|
||||
|
||||
#isDraft(item: UmbDocumentItemModel) {
|
||||
return item.variants[0]?.state === 'Draft' ?? false;
|
||||
return item.variants[0]?.state === 'Draft';
|
||||
}
|
||||
|
||||
#pickableFilter: (item: UmbDocumentItemModel) => boolean = (item) => {
|
||||
@@ -193,7 +193,7 @@ export class UmbInputDocumentElement extends UUIFormControlMixin(UmbLitElement,
|
||||
#renderItem(item: UmbDocumentItemModel) {
|
||||
if (!item.unique) return;
|
||||
return html`
|
||||
<uui-ref-node name=${item.name} id=${item.unique} ?disabled=${this.#isDraft(item)}>
|
||||
<uui-ref-node name=${item.name} id=${item.unique} class=${classMap({ draft: this.#isDraft(item) })}>
|
||||
${this.#renderIcon(item)} ${this.#renderIsTrashed(item)}
|
||||
<uui-action-bar slot="actions">
|
||||
${this.#renderOpenButton(item)}
|
||||
@@ -233,6 +233,10 @@ export class UmbInputDocumentElement extends UUIFormControlMixin(UmbLitElement,
|
||||
uui-ref-node[drag-placeholder] {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.draft {
|
||||
opacity: 0.6;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -273,8 +273,7 @@ export class UmbMultiUrlPickerElement extends UUIFormControlMixin(UmbLitElement,
|
||||
id=${unique}
|
||||
href=${href}
|
||||
name=${link.name || ''}
|
||||
detail=${(link.url || '') + (link.queryString || '')}
|
||||
?disabled=${!link.published}>
|
||||
detail=${(link.url || '') + (link.queryString || '')}>
|
||||
<umb-icon slot="icon" name=${link.icon || 'icon-link'}></umb-icon>
|
||||
<uui-action-bar slot="actions">
|
||||
<uui-button href=${href} label=${this.localize.term('general_edit')}></uui-button>
|
||||
|
||||
Reference in New Issue
Block a user