UNPKG

@qn-pandora/pandora-visualization

Version:

Pandora 通用可视化库

125 lines (124 loc) 4.55 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { observable, computed, action } from 'mobx'; import bind from '../../../../utils/bind'; var Legend = /** @class */ (function () { function Legend(option) { this.sortList = option.sortList; this.position = option.position || "top" /* Top */; this.columnsWidthMap = option.columnsWidthMap; this.width = option.width; this.sort = option.sort; } Object.defineProperty(Legend.prototype, "option", { get: function () { return this.baseOption; }, enumerable: false, configurable: true }); Object.defineProperty(Legend.prototype, "baseOption", { get: function () { return { position: this.position, columnsWidthMap: this.columnsWidthMap, sortList: this.sortList, width: this.width, sort: this.sort }; }, enumerable: false, configurable: true }); Legend.prototype.setPosition = function (position) { this.position = position; }; Legend.prototype.setColumnWidthMap = function (columnsWidthMap) { this.columnsWidthMap = columnsWidthMap; }; Legend.prototype.set = function (option) { this.position = option.position || "top" /* Top */; this.columnsWidthMap = option.columnsWidthMap; this.width = option.width; this.sort = option.sort; }; Legend.prototype.setSort = function (sort) { this.sort = sort; }; Legend.prototype.setWidth = function (width) { this.width = width; }; __decorate([ observable, __metadata("design:type", String) ], Legend.prototype, "position", void 0); __decorate([ observable.ref, __metadata("design:type", Object) ], Legend.prototype, "columnsWidthMap", void 0); __decorate([ observable.ref, __metadata("design:type", Array) ], Legend.prototype, "sortList", void 0); __decorate([ observable, __metadata("design:type", Number) ], Legend.prototype, "width", void 0); __decorate([ observable, __metadata("design:type", Object) ], Legend.prototype, "sort", void 0); __decorate([ computed, __metadata("design:type", Object), __metadata("design:paramtypes", []) ], Legend.prototype, "option", null); __decorate([ computed, __metadata("design:type", Object), __metadata("design:paramtypes", []) ], Legend.prototype, "baseOption", null); __decorate([ bind, action, __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0) ], Legend.prototype, "setPosition", null); __decorate([ bind, action, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], Legend.prototype, "setColumnWidthMap", null); __decorate([ action, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], Legend.prototype, "set", null); __decorate([ bind, action, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], Legend.prototype, "setSort", null); __decorate([ bind, action, __metadata("design:type", Function), __metadata("design:paramtypes", [Number]), __metadata("design:returntype", void 0) ], Legend.prototype, "setWidth", null); return Legend; }()); export default Legend;