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 { html, customElement, property, state } from '../../../external/lit/index.js';
import { UmbLitElement } from '../../core/lit-element/index.js';
import { UmbChangeEvent } from '../../core/event/index.js';
/**
 * @element umb-property-editor-ui-overlay-size
 */
let UmbPropertyEditorUIOverlaySizeElement = class UmbPropertyEditorUIOverlaySizeElement extends UmbLitElement {
    constructor() {
        super(...arguments);
        this.value = '';
        // TODO: Stop having global type of the UUI-SELECT element. And make it possible to have undefined as an option.
        this._list = [
            { value: undefined, name: 'Default', selected: true },
            { value: 'small', name: 'Small' },
            { value: 'medium', name: 'Medium' },
            { value: 'large', name: 'Large' },
            { value: 'full', name: 'Full' },
        ];
    }
    firstUpdated() {
        if (!this.value)
            return;
        this._list = this._list.map((option) => ({
            ...option,
            selected: option.value === this.value,
        }));
    }
    #onChange(event) {
        this.value = event.target.value;
        this.dispatchEvent(new UmbChangeEvent());
    }
    render() {
        return html `
			<uui-select
				label=${this.localize.term('rte_config_overlaySize')}
				.options=${this._list}
				@change=${this.#onChange}>
			</uui-select>
		`;
    }
};
__decorate([
    property()
], UmbPropertyEditorUIOverlaySizeElement.prototype, "value", void 0);
__decorate([
    state()
], UmbPropertyEditorUIOverlaySizeElement.prototype, "_list", void 0);
__decorate([
    property({ attribute: false })
], UmbPropertyEditorUIOverlaySizeElement.prototype, "config", void 0);
UmbPropertyEditorUIOverlaySizeElement = __decorate([
    customElement('umb-property-editor-ui-overlay-size')
], UmbPropertyEditorUIOverlaySizeElement);
export { UmbPropertyEditorUIOverlaySizeElement };
export default UmbPropertyEditorUIOverlaySizeElement;
