UNPKG

nakedobjects.spa

Version:

Single Page Application client for a Naked Objects application.

44 lines 1.95 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 { Command } from './Command'; import * as Usermessages from '../user-messages'; var Selection = (function (_super) { __extends(Selection, _super); function Selection() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.shortCommand = "se"; _this.fullCommand = Usermessages.selectionCommand; _this.helpText = Usermessages.selectionHelp; _this.minArguments = 1; _this.maxArguments = 1; return _this; } Selection.prototype.isAvailableInCurrentContext = function () { return this.isList(); }; Selection.prototype.doExecute = function (args, chained) { // //TODO: Add in sub-commands: Add, Remove, All, Clear & Show // const arg = this.argumentAsString(args, 0); // const { start, end } = this.parseRange(arg); //'destructuring' // this.getList().then(list => this.selectItems(list, start, end)).catch((reject: Ro.ErrorWrapper) => this.error.handleError(reject)); return Promise.reject("Not Implemented"); }; ; Selection.prototype.selectItems = function (list, startNo, endNo) { var itemNo; for (itemNo = startNo; itemNo <= endNo; itemNo++) { this.urlManager.setItemSelected(itemNo - 1, true, ""); } }; return Selection; }(Command)); export { Selection }; //# sourceMappingURL=selection.js.map