Text.js 1.3 KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Text = void 0;
  4. var tslib_1 = require("tslib");
  5. var g_1 = require("@antv/g");
  6. var offscreen_1 = require("../util/offscreen");
  7. var Text = /** @class */ (function (_super) {
  8. tslib_1.__extends(Text, _super);
  9. function Text(_a) {
  10. if (_a === void 0) { _a = {}; }
  11. var style = _a.style, restOptions = tslib_1.__rest(_a, ["style"]);
  12. return _super.call(this, tslib_1.__assign({ style: tslib_1.__assign({ text: '', fill: 'black', fontFamily: 'sans-serif', fontSize: 16, fontStyle: 'normal', fontVariant: 'normal', fontWeight: 'normal', lineWidth: 1, textAlign: 'start', textBaseline: 'middle' }, style) }, restOptions)) || this;
  13. }
  14. Object.defineProperty(Text.prototype, "offscreenGroup", {
  15. get: function () {
  16. if (!this._offscreen)
  17. this._offscreen = (0, offscreen_1.createOffscreenGroup)(this);
  18. return this._offscreen;
  19. },
  20. enumerable: false,
  21. configurable: true
  22. });
  23. Text.prototype.disconnectedCallback = function () {
  24. var _a;
  25. (_a = this._offscreen) === null || _a === void 0 ? void 0 : _a.destroy();
  26. };
  27. return Text;
  28. }(g_1.Text));
  29. exports.Text = Text;
  30. //# sourceMappingURL=Text.js.map