| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.GUI = void 0;
- var tslib_1 = require("tslib");
- var shapes_1 = require("../shapes");
- var util_1 = require("../util");
- function applyVisibility() {
- (0, util_1.visibility)(this, this.attributes.visibility !== 'hidden');
- }
- var GUI = /** @class */ (function (_super) {
- tslib_1.__extends(GUI, _super);
- function GUI(options, defaultStyleProps) {
- if (defaultStyleProps === void 0) { defaultStyleProps = {}; }
- var _this = _super.call(this, (0, util_1.deepAssign)({}, { style: defaultStyleProps }, options)) || this;
- _this.initialized = false;
- _this._defaultOptions = defaultStyleProps;
- return _this;
- }
- Object.defineProperty(GUI.prototype, "offscreenGroup", {
- get: function () {
- if (!this._offscreen)
- this._offscreen = (0, util_1.createOffscreenGroup)(this);
- return this._offscreen;
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(GUI.prototype, "defaultOptions", {
- get: function () {
- return this._defaultOptions;
- },
- enumerable: false,
- configurable: true
- });
- GUI.prototype.connectedCallback = function () {
- this.render(this.attributes, this);
- this.bindEvents(this.attributes, this);
- // applyVisibility.call(this);
- this.initialized = true;
- };
- GUI.prototype.disconnectedCallback = function () {
- var _a;
- (_a = this._offscreen) === null || _a === void 0 ? void 0 : _a.destroy();
- };
- GUI.prototype.attributeChangedCallback = function (name) {
- if (name === 'visibility') {
- applyVisibility.call(this);
- }
- };
- GUI.prototype.update = function (attr, animate) {
- var _a;
- if (attr === void 0) { attr = {}; }
- this.attr((0, util_1.deepAssign)({}, this.attributes, attr));
- return (_a = this.render) === null || _a === void 0 ? void 0 : _a.call(this, this.attributes, this, animate);
- };
- GUI.prototype.clear = function () {
- this.removeChildren();
- };
- GUI.prototype.bindEvents = function (attributes, container) { };
- return GUI;
- }(shapes_1.CustomElement));
- exports.GUI = GUI;
- //# sourceMappingURL=gui.js.map
|