UNPKG

1.55 kBJavaScriptView Raw
1"use strict";
2var __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})();
12Object.defineProperty(exports, "__esModule", { value: true });
13var Graphic_1 = require("./../Graphic");
14var Tool_1 = require("./../Tool");
15var Switch = (function (_super) {
16 __extends(Switch, _super);
17 /* LIFECYCLE */
18 function Switch() {
19 var _this = _super.call(this) || this;
20 _this.setProps({
21 activable: true
22 });
23 return _this;
24 }
25 Switch.prototype.initialize = function (props) {
26 _super.prototype.initialize.call(this, props);
27 this.shape("shape", {
28 width: 15,
29 height: 15,
30 stroke: Tool_1.Color.cyan400,
31 strokeThickness: 3,
32 fill: Tool_1.Color.black,
33 fillAlpha: 0.5
34 }, {
35 active: {
36 fill: Tool_1.Color.cyan400,
37 fillAlpha: 1
38 }
39 }).text("label", {
40 x: 30,
41 y: -2,
42 fill: Tool_1.Color.white,
43 fontSize: 15
44 });
45 };
46 return Switch;
47}(Graphic_1.Graphic));
48exports.Switch = Switch;