1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.Controller = void 0;
|
4 | var util_1 = require("@antv/util");
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | var Controller = (function () {
|
12 | function Controller(view) {
|
13 |
|
14 | this.visible = true;
|
15 |
|
16 | this.components = [];
|
17 | this.view = view;
|
18 | }
|
19 | |
20 |
|
21 |
|
22 |
|
23 | Controller.prototype.clear = function (includeOption) {
|
24 |
|
25 | (0, util_1.each)(this.components, function (co) {
|
26 | co.component.destroy();
|
27 | });
|
28 |
|
29 | this.components = [];
|
30 | };
|
31 | |
32 |
|
33 |
|
34 | Controller.prototype.destroy = function () {
|
35 | this.clear();
|
36 | };
|
37 | |
38 |
|
39 |
|
40 |
|
41 | Controller.prototype.getComponents = function () {
|
42 | return this.components;
|
43 | };
|
44 | |
45 |
|
46 |
|
47 |
|
48 | Controller.prototype.changeVisible = function (visible) {
|
49 | if (this.visible === visible) {
|
50 | return;
|
51 | }
|
52 | this.components.forEach(function (co) {
|
53 | if (visible) {
|
54 | co.component.show();
|
55 | }
|
56 | else {
|
57 | co.component.hide();
|
58 | }
|
59 | });
|
60 | this.visible = visible;
|
61 | };
|
62 | return Controller;
|
63 | }());
|
64 | exports.Controller = Controller;
|
65 |
|
\ | No newline at end of file |