"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const element_1 = require("../../../../client/element");
const propHandler_1 = require("../../../../client/propHandler");
const style_1 = require("../../../../client/style");
const DEFAULT_STYLE = {
    color: 'currentColor',
};
class H3 extends element_1.Element {
    constructor($props, $system) {
        super($props, $system);
        const { id, className, style, innerText, tabIndex, title, draggable, data = {}, attr = {}, } = this.$props;
        this.$element = this.$system.api.document.createElement('h3');
        if (id !== undefined) {
            this.$element.id = id;
        }
        if (className !== undefined) {
            this.$element.className = className;
        }
        if (innerText) {
            this.$element.innerText = innerText;
        }
        if (tabIndex !== undefined) {
            this.$element.tabIndex = tabIndex;
        }
        if (title) {
            this.$element.title = title;
        }
        if (draggable !== undefined) {
            this.$element.setAttribute('draggable', draggable.toString());
        }
        if (data !== undefined) {
            for (const key in data) {
                const d = data[key];
                this.$element.dataset[key] = d;
            }
        }
        (0, style_1.applyDynamicStyle)(this, this.$element, Object.assign(Object.assign({}, DEFAULT_STYLE), style));
        this._prop_handler = Object.assign({}, (0, propHandler_1.htmlPropHandler)(this, this.$element, DEFAULT_STYLE));
    }
    onPropChanged(prop, current) {
        this._prop_handler[prop](current);
    }
}
exports.default = H3;
//# sourceMappingURL=Component.js.map