UNPKG

@qn-pandora/pandora-visualization

Version:

Pandora 通用可视化库

91 lines (90 loc) 3.96 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); 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, action } from 'mobx'; import Store from '../../stores/store'; import { EThemeTypes, initialTheme } from '../../constants'; var BaseDashboardStore = /** @class */ (function (_super) { __extends(BaseDashboardStore, _super); function BaseDashboardStore() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.isEditing = false; _this.isFullscreen = false; _this.screenScaleY = 0; _this.theme = initialTheme; return _this; } BaseDashboardStore.prototype.setTheme = function (theme) { this.theme = theme; }; BaseDashboardStore.prototype.setIsEditing = function (isEditing) { this.isEditing = isEditing; }; BaseDashboardStore.prototype.setIsFullscreen = function (isFullscreen) { this.isFullscreen = isFullscreen; }; BaseDashboardStore.prototype.setScreenScaleY = function (scale) { this.screenScaleY = (window.screen.height * scale) / window.screen.width; }; __decorate([ observable, __metadata("design:type", Object) ], BaseDashboardStore.prototype, "isEditing", void 0); __decorate([ observable, __metadata("design:type", Object) ], BaseDashboardStore.prototype, "isFullscreen", void 0); __decorate([ observable, __metadata("design:type", Object) ], BaseDashboardStore.prototype, "screenScaleY", void 0); __decorate([ observable, __metadata("design:type", Object) ], BaseDashboardStore.prototype, "theme", void 0); __decorate([ action, __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0) ], BaseDashboardStore.prototype, "setTheme", null); __decorate([ action, __metadata("design:type", Function), __metadata("design:paramtypes", [Boolean]), __metadata("design:returntype", void 0) ], BaseDashboardStore.prototype, "setIsEditing", null); __decorate([ action, __metadata("design:type", Function), __metadata("design:paramtypes", [Boolean]), __metadata("design:returntype", void 0) ], BaseDashboardStore.prototype, "setIsFullscreen", null); __decorate([ action, __metadata("design:type", Function), __metadata("design:paramtypes", [Number]), __metadata("design:returntype", void 0) ], BaseDashboardStore.prototype, "setScreenScaleY", null); return BaseDashboardStore; }(Store)); export default BaseDashboardStore;