1 | import { __extends } from "tslib";
|
2 | import EE from '@antv/event-emitter';
|
3 |
|
4 |
|
5 |
|
6 | var Base = (function (_super) {
|
7 | __extends(Base, _super);
|
8 | function Base(cfg) {
|
9 | var _this = _super.call(this) || this;
|
10 |
|
11 | _this.destroyed = false;
|
12 | var _a = cfg.visible, visible = _a === void 0 ? true : _a;
|
13 | _this.visible = visible;
|
14 | return _this;
|
15 | }
|
16 | |
17 |
|
18 |
|
19 | Base.prototype.show = function () {
|
20 | var visible = this.visible;
|
21 | if (!visible) {
|
22 | this.changeVisible(true);
|
23 | }
|
24 | };
|
25 | |
26 |
|
27 |
|
28 | Base.prototype.hide = function () {
|
29 | var visible = this.visible;
|
30 | if (visible) {
|
31 | this.changeVisible(false);
|
32 | }
|
33 | };
|
34 | |
35 |
|
36 |
|
37 | Base.prototype.destroy = function () {
|
38 | this.off();
|
39 | this.destroyed = true;
|
40 | };
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | Base.prototype.changeVisible = function (visible) {
|
47 | if (this.visible === visible) {
|
48 | return;
|
49 | }
|
50 | this.visible = visible;
|
51 | };
|
52 | return Base;
|
53 | }(EE));
|
54 | export default Base;
|
55 |
|
\ | No newline at end of file |