import { r as registerInstance, h, g as getElement } from './core-095fd691.js';
import { l as linker } from './input-linker-2b74e80e.js';

const BceElementTextTemplate = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.text = '';
        this.placeholderText = '';
        this._link = linker(this, this.handleInput);
        this._text = this._link('text');
    }
    handleInput(name, event) {
        const input = event.target;
        if (!input)
            return;
        event.cancelBubble = true;
        this[name] = input.value;
        this.value = this.updateValue({ [name]: input.value });
        this.el.dispatchEvent(new Event('input', { bubbles: true }));
    }
    updateValue(part = {}) {
        const current = { text: this.text };
        return Object.assign({}, current, part);
    }
    componentDidLoad() {
        this.value = { text: this.text };
        this.el.dispatchEvent(new Event('input', { bubbles: true }));
    }
    render() {
        return h("bce-input", Object.assign({ type: "textarea" }, this._text));
    }
    get el() { return getElement(this); }
};

export { BceElementTextTemplate as bce_element_text_template };
