"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const namespaceURI_1 = require("../../../../../client/component/namespaceURI");
const svg_1 = require("../../../../../client/svg");
class SVGText extends svg_1.SVGElement_ {
    constructor($props, $system) {
        super($props, $system, $system.api.document.createElementNS(namespaceURI_1.namespaceURI, 'text'), $system.style['text'], {}, {
            value: (value = '') => {
                this.$element.textContent = value;
            },
            x: (x = 0) => {
                this.$element.setAttribute('x', `${x}`);
            },
            y: (y = 0) => {
                this.$element.setAttribute('y', `${y}`);
            },
            width: (width = 0) => {
                this.$element.setAttribute('width', `${width}`);
            },
            height: (height = 0) => {
                this.$element.setAttribute('height', `${height}`);
            },
            dx: (dx = 0) => {
                this.$element.setAttribute('dx', `${dx}`);
            },
            dy: (dy = 0) => {
                this.$element.setAttribute('dy', `${dy}`);
            },
            textAnchor: (textAnchor) => {
                this.$element.setAttribute('text-anchor', textAnchor);
            },
        });
        const { className, value, x, y, dx, dy, textAnchor = 'start' } = this.$props;
        if (className) {
            this.$element.classList.add(className);
        }
        if (value !== undefined) {
            this.$element.textContent = value;
        }
        if (x !== undefined) {
            this.$element.setAttribute('x', `${x}`);
        }
        if (y !== undefined) {
            this.$element.setAttribute('y', `${y}`);
        }
        if (dx !== undefined) {
            this.$element.setAttribute('dx', `${dx}`);
        }
        if (dy !== undefined) {
            this.$element.setAttribute('dy', `${dy}`);
        }
        if (textAnchor !== undefined) {
            this.$element.setAttribute('text-anchor', textAnchor);
        }
    }
}
exports.default = SVGText;
//# sourceMappingURL=Component.js.map