UNPKG

nakedobjects.spa

Version:

Single Page Application client for a Naked Objects application.

51 lines 2.21 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { LinkViewModel } from './link-view-model'; var ItemViewModel = (function (_super) { __extends(ItemViewModel, _super); function ItemViewModel(context, colorService, error, urlManager, configService, link, paneId, clickHandler, viewModelFactory, index, isSelected, id) { var _this = _super.call(this, context, colorService, error, urlManager, configService, link, paneId) || this; _this.clickHandler = clickHandler; _this.viewModelFactory = viewModelFactory; _this.index = index; _this.isSelected = isSelected; _this.id = id; _this.selectionChange = function () { _this.urlManager.setItemSelected(_this.index, _this.selected, _this.id, _this.paneId); }; _this.doClick = function (right) { var currentPane = _this.clickHandler.pane(_this.paneId, right); _this.urlManager.setItem(_this.link, currentPane); }; var members = link.members(); if (members) { _this.tableRowViewModel = _this.viewModelFactory.tableRowViewModel(members, paneId, _this.title); } return _this; } Object.defineProperty(ItemViewModel.prototype, "selected", { get: function () { return this.isSelected; }, set: function (v) { this.isSelected = v; this.selectionChange(); }, enumerable: true, configurable: true }); ItemViewModel.prototype.silentSelect = function (v) { this.isSelected = v; }; return ItemViewModel; }(LinkViewModel)); export { ItemViewModel }; //# sourceMappingURL=item-view-model.js.map