1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = Object.setPrototypeOf ||
|
4 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
6 | return function (d, b) {
|
7 | extendStatics(d, b);
|
8 | function __() { this.constructor = d; }
|
9 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
10 | };
|
11 | })();
|
12 | Object.defineProperty(exports, "__esModule", { value: true });
|
13 | var Graphic_1 = require("./../Graphic");
|
14 | var Tool_1 = require("./../Tool");
|
15 | var Switch = (function (_super) {
|
16 | __extends(Switch, _super);
|
17 |
|
18 | |
19 |
|
20 |
|
21 | function Switch() {
|
22 | var _this = _super.call(this) || this;
|
23 | _this.setProps({
|
24 | label: "",
|
25 | activable: true
|
26 | });
|
27 | return _this;
|
28 | }
|
29 | |
30 |
|
31 |
|
32 |
|
33 | Switch.prototype.initialize = function (props) {
|
34 | var _this = this;
|
35 | _super.prototype.initialize.call(this, props);
|
36 | this.shape("shape", {
|
37 | width: 15,
|
38 | height: 15,
|
39 | stroke: this.context.theme.primaryColor,
|
40 | strokeThickness: 3,
|
41 | fill: Tool_1.Color.black,
|
42 | fillAlpha: 0.5
|
43 | }, {
|
44 | active: {
|
45 | fill: Tool_1.Color.cyan400,
|
46 | fillAlpha: 1
|
47 | }
|
48 | }).text("label", {
|
49 | x: 30,
|
50 | y: -2,
|
51 | text: this.props.label,
|
52 | fill: Tool_1.Color.white,
|
53 | fontSize: 15
|
54 | });
|
55 | this.connect(this.signals.propChange, "label", function () { return _this.text("label", { text: _this.props.label }); });
|
56 | };
|
57 | return Switch;
|
58 | }(Graphic_1.Graphic));
|
59 | exports.Switch = Switch;
|