Text.js 1.2 KB

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