56 lines
2.4 KiB
JavaScript
56 lines
2.4 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.SVGTSpanInstance = void 0;
|
|
const SVGInstance_js_1 = require("../../browser/instance/SVGInstance.js");
|
|
//-- Mixins
|
|
const index_js_1 = require("../mixins/index.js");
|
|
// Presentation attributes
|
|
const color_js_1 = require("../mixins/presentation-attributes/color.js");
|
|
const display_js_1 = require("../mixins/presentation-attributes/display.js");
|
|
const fill_js_1 = require("../mixins/presentation-attributes/fill.js");
|
|
const opacity_js_1 = require("../mixins/presentation-attributes/opacity.js");
|
|
const stroke_js_1 = require("../mixins/presentation-attributes/stroke.js");
|
|
const vectorEffect_js_1 = require("../mixins/presentation-attributes/vectorEffect.js");
|
|
const visibility_js_1 = require("../mixins/presentation-attributes/visibility.js");
|
|
// Attributes
|
|
const xyPositioning_js_1 = require("../mixins/attributes/xyPositioning.js");
|
|
const widthHeight_js_1 = require("../mixins/attributes/widthHeight.js");
|
|
const text_js_1 = require("../mixins/attributes/text.js");
|
|
// Style attributes
|
|
const font_js_1 = require("../mixins/style-attributes/font.js");
|
|
//-- Class
|
|
class SVGTSpanInstance extends SVGInstance_js_1.SVGInstance {
|
|
constructor(_parent) {
|
|
super("tspan", _parent);
|
|
}
|
|
addTSpan(xOrTextOrUndefined, yOrUndefined, textOrUndefined) {
|
|
const text = new SVGTSpanInstance(this);
|
|
if (typeof xOrTextOrUndefined === "string" && typeof yOrUndefined === "undefined") {
|
|
text.text(xOrTextOrUndefined);
|
|
}
|
|
else if ((typeof xOrTextOrUndefined === "string" || typeof xOrTextOrUndefined === "number") && (typeof yOrUndefined === "string" || typeof yOrUndefined === "number")) {
|
|
text.attr("x", xOrTextOrUndefined);
|
|
text.attr("y", yOrUndefined);
|
|
if (typeof textOrUndefined === "string") {
|
|
text.text(textOrUndefined);
|
|
}
|
|
}
|
|
this.appendInstance(text);
|
|
return text;
|
|
}
|
|
}
|
|
exports.SVGTSpanInstance = SVGTSpanInstance;
|
|
(0, index_js_1.applyMixins)(SVGTSpanInstance, [
|
|
color_js_1.Color,
|
|
display_js_1.Display,
|
|
fill_js_1.Fill,
|
|
opacity_js_1.Opacity,
|
|
stroke_js_1.Stroke,
|
|
vectorEffect_js_1.VectorEffect,
|
|
visibility_js_1.Visibility,
|
|
xyPositioning_js_1.XYPositioning,
|
|
widthHeight_js_1.WidthHeight,
|
|
text_js_1.TextAttributes,
|
|
font_js_1.Font
|
|
]);
|
|
//# sourceMappingURL=SVGTSpanInstance.js.map
|