var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { UmbDocumentItemDataResolver } from '../../../../item/index.js';
import { css, customElement, html, nothing, property, state } from '../../../../../../../external/lit/index.js';
import { UmbLitElement } from '../../../../../../core/lit-element/index.js';
let UmbDocumentTableColumnNameElement = class UmbDocumentTableColumnNameElement extends UmbLitElement {
    #resolver;
    set value(value) {
        this.#value = value;
        if (value.item) {
            this.#resolver.setData(value.item);
        }
    }
    get value() {
        return this.#value;
    }
    #value;
    constructor() {
        super();
        this.#resolver = new UmbDocumentItemDataResolver(this);
        this._name = '';
        this.#resolver.observe(this.#resolver.name, (name) => (this._name = name || ''));
    }
    render() {
        if (!this.value)
            return nothing;
        if (!this.value.editPath)
            return nothing;
        if (!this._name)
            return nothing;
        return html `<uui-button compact href=${this.value.editPath} label=${this._name}></uui-button>`;
    }
    static { this.styles = [
        css `
			uui-button {
				text-align: left;
			}
		`,
    ]; }
};
__decorate([
    state()
], UmbDocumentTableColumnNameElement.prototype, "_name", void 0);
__decorate([
    property({ attribute: false })
], UmbDocumentTableColumnNameElement.prototype, "value", null);
UmbDocumentTableColumnNameElement = __decorate([
    customElement('umb-document-table-column-name')
], UmbDocumentTableColumnNameElement);
export { UmbDocumentTableColumnNameElement };
export default UmbDocumentTableColumnNameElement;
