UNPKG

nakedobjects.spa

Version:

Single Page Application client for a Naked Objects application.

263 lines 9.9 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 __()); }; })(); 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 { Component, Input, HostListener, ViewChildren, QueryList, Renderer } from '@angular/core'; import { FieldComponent } from '../field/field.component'; import { FormGroup } from '@angular/forms'; import { Router } from '@angular/router'; import { ErrorService } from '../error.service'; import { ContextService } from '../context.service'; import { PropertyViewModel } from '../view-models/property-view-model'; import { DomainObjectViewModel } from '../view-models/domain-object-view-model'; import { ConfigService } from '../config.service'; import { LoggerService } from '../logger.service'; var EditPropertyComponent = (function (_super) { __extends(EditPropertyComponent, _super); function EditPropertyComponent(router, error, context, configService, loggerService, renderer) { var _this = _super.call(this, context, configService, loggerService, renderer) || this; _this.router = router; _this.error = error; return _this; } Object.defineProperty(EditPropertyComponent.prototype, "property", { get: function () { return this.prop; }, set: function (value) { this.prop = value; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "propertyPaneId", { get: function () { return this.property.paneArgId; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "propertyId", { get: function () { return this.property.id; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "propertyChoices", { get: function () { return this.property.choices; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "title", { get: function () { return this.property.title; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "propertyType", { get: function () { return this.property.type; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "propertyReturnType", { get: function () { return this.property.returnType; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "propertyEntryType", { get: function () { return this.property.entryType; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "isEditable", { get: function () { return this.property.isEditable; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "formattedValue", { get: function () { return this.property.formattedValue; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "value", { get: function () { return this.property.formattedValue; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "format", { get: function () { return this.property.format; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "isBlob", { get: function () { return this.property.format === "blob"; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "isMultiline", { get: function () { return !(this.property.multipleLines === 1); }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "isPassword", { get: function () { return this.property.password; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "multilineHeight", { get: function () { return this.property.multipleLines * 20 + "px"; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "rows", { get: function () { return this.property.multipleLines; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "propertyDescription", { get: function () { return this.property.description; }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "message", { get: function () { return this.property.getMessage(); }, enumerable: true, configurable: true }); Object.defineProperty(EditPropertyComponent.prototype, "attachment", { get: function () { return this.property.attachment; }, enumerable: true, configurable: true }); EditPropertyComponent.prototype.choiceName = function (choice) { return choice.name; }; EditPropertyComponent.prototype.classes = function () { return _a = {}, _a[this.prop.color] = true, _a["candrop"] = this.canDrop, _a; var _a; }; Object.defineProperty(EditPropertyComponent.prototype, "form", { get: function () { return this.formGroup; }, set: function (fm) { this.formGroup = fm; }, enumerable: true, configurable: true }); EditPropertyComponent.prototype.ngOnInit = function () { _super.prototype.init.call(this, this.parent, this.property, this.form.controls[this.prop.id]); }; EditPropertyComponent.prototype.onKeydown = function (event) { this.handleKeyEvents(event, this.isMultiline); }; EditPropertyComponent.prototype.onKeypress = function (event) { this.handleKeyEvents(event, this.isMultiline); }; EditPropertyComponent.prototype.ngAfterViewInit = function () { this.populateBoolean(); }; return EditPropertyComponent; }(FieldComponent)); __decorate([ Input(), __metadata("design:type", DomainObjectViewModel) ], EditPropertyComponent.prototype, "parent", void 0); __decorate([ Input(), __metadata("design:type", PropertyViewModel), __metadata("design:paramtypes", [PropertyViewModel]) ], EditPropertyComponent.prototype, "property", null); __decorate([ Input(), __metadata("design:type", FormGroup), __metadata("design:paramtypes", [FormGroup]) ], EditPropertyComponent.prototype, "form", null); __decorate([ HostListener('keydown', ['$event']), __metadata("design:type", Function), __metadata("design:paramtypes", [KeyboardEvent]), __metadata("design:returntype", void 0) ], EditPropertyComponent.prototype, "onKeydown", null); __decorate([ HostListener('keypress', ['$event']), __metadata("design:type", Function), __metadata("design:paramtypes", [KeyboardEvent]), __metadata("design:returntype", void 0) ], EditPropertyComponent.prototype, "onKeypress", null); __decorate([ ViewChildren("focus"), __metadata("design:type", QueryList) ], EditPropertyComponent.prototype, "focusList", void 0); __decorate([ ViewChildren("checkbox"), __metadata("design:type", QueryList) ], EditPropertyComponent.prototype, "checkboxList", void 0); EditPropertyComponent = __decorate([ Component({ selector: 'nof-edit-property', template: require('./edit-property.component.html'), styles: [require('./edit-property.component.css')] }), __metadata("design:paramtypes", [Router, ErrorService, ContextService, ConfigService, LoggerService, Renderer]) ], EditPropertyComponent); export { EditPropertyComponent }; //# sourceMappingURL=edit-property.component.js.map