nakedobjects.spa
Version:
Single Page Application client for a Naked Objects application.
239 lines • 9.63 kB
JavaScript
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 { ViewModelFactoryService } from '../view-model-factory.service';
import { UrlManagerService } from '../url-manager.service';
import * as Models from '../models';
import { FieldComponent } from '../field/field.component';
import { FormGroup } from '@angular/forms';
import { ContextService } from '../context.service';
import { ParameterViewModel } from '../view-models/parameter-view-model';
import { DialogViewModel } from '../view-models/dialog-view-model';
import { ConfigService } from '../config.service';
import { LoggerService } from '../logger.service';
var EditParameterComponent = (function (_super) {
__extends(EditParameterComponent, _super);
function EditParameterComponent(viewModelFactory, urlManager, context, configService, loggerService, renderer) {
var _this = _super.call(this, context, configService, loggerService, renderer) || this;
_this.viewModelFactory = viewModelFactory;
_this.urlManager = urlManager;
_this.choiceName = function (choice) { return choice.name; };
return _this;
}
Object.defineProperty(EditParameterComponent.prototype, "parameter", {
get: function () {
return this.parm;
},
set: function (value) {
this.parm = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "parameterPaneId", {
get: function () {
return this.parameter.paneArgId;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "title", {
get: function () {
return this.parameter.title;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "parameterType", {
get: function () {
return this.parameter.type;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "parameterEntryType", {
get: function () {
return this.parameter.entryType;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "parameterReturnType", {
get: function () {
return this.parameter.returnType;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "format", {
get: function () {
return this.parameter.format;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "description", {
get: function () {
return this.parameter.description;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "parameterId", {
get: function () {
return this.parameter.id;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "choices", {
get: function () {
return this.parameter.choices;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "isMultiline", {
get: function () {
return !(this.parameter.multipleLines === 1);
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "isPassword", {
get: function () {
return this.parameter.password;
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "multilineHeight", {
get: function () {
return this.parameter.multipleLines * 20 + "px";
},
enumerable: true,
configurable: true
});
Object.defineProperty(EditParameterComponent.prototype, "rows", {
get: function () {
return this.parameter.multipleLines;
},
enumerable: true,
configurable: true
});
EditParameterComponent.prototype.classes = function () {
return _a = {},
_a[this.parm.color] = true,
_a["candrop"] = this.canDrop,
_a;
var _a;
};
EditParameterComponent.prototype.ngOnInit = function () {
_super.prototype.init.call(this, this.parent, this.parameter, this.form.controls[this.parm.id]);
};
Object.defineProperty(EditParameterComponent.prototype, "form", {
get: function () {
return this.formGroup;
},
set: function (fm) {
this.formGroup = fm;
},
enumerable: true,
configurable: true
});
EditParameterComponent.prototype.isChoices = function () {
return this.parm.entryType === Models.EntryType.Choices ||
this.parm.entryType === Models.EntryType.ConditionalChoices ||
this.parm.entryType === Models.EntryType.MultipleChoices ||
this.parm.entryType === Models.EntryType.MultipleConditionalChoices;
};
EditParameterComponent.prototype.isMultiple = function () {
return this.parm.entryType === Models.EntryType.MultipleChoices ||
this.parm.entryType === Models.EntryType.MultipleConditionalChoices;
};
EditParameterComponent.prototype.onKeydown = function (event) {
this.handleKeyEvents(event, this.isMultiline);
};
EditParameterComponent.prototype.onKeypress = function (event) {
this.handleKeyEvents(event, this.isMultiline);
};
EditParameterComponent.prototype.onClick = function (event) {
this.handleClick(event);
};
EditParameterComponent.prototype.ngAfterViewInit = function () {
this.populateBoolean();
};
return EditParameterComponent;
}(FieldComponent));
__decorate([
Input(),
__metadata("design:type", DialogViewModel)
], EditParameterComponent.prototype, "parent", void 0);
__decorate([
Input(),
__metadata("design:type", ParameterViewModel),
__metadata("design:paramtypes", [ParameterViewModel])
], EditParameterComponent.prototype, "parameter", null);
__decorate([
Input(),
__metadata("design:type", FormGroup),
__metadata("design:paramtypes", [FormGroup])
], EditParameterComponent.prototype, "form", null);
__decorate([
HostListener('keydown', ['$event']),
__metadata("design:type", Function),
__metadata("design:paramtypes", [KeyboardEvent]),
__metadata("design:returntype", void 0)
], EditParameterComponent.prototype, "onKeydown", null);
__decorate([
HostListener('keypress', ['$event']),
__metadata("design:type", Function),
__metadata("design:paramtypes", [KeyboardEvent]),
__metadata("design:returntype", void 0)
], EditParameterComponent.prototype, "onKeypress", null);
__decorate([
HostListener('click', ['$event']),
__metadata("design:type", Function),
__metadata("design:paramtypes", [KeyboardEvent]),
__metadata("design:returntype", void 0)
], EditParameterComponent.prototype, "onClick", null);
__decorate([
ViewChildren("focus"),
__metadata("design:type", QueryList)
], EditParameterComponent.prototype, "focusList", void 0);
__decorate([
ViewChildren("checkbox"),
__metadata("design:type", QueryList)
], EditParameterComponent.prototype, "checkboxList", void 0);
EditParameterComponent = __decorate([
Component({
selector: 'nof-edit-parameter',
template: require('./edit-parameter.component.html'),
styles: [require('./edit-parameter.component.css')]
}),
__metadata("design:paramtypes", [ViewModelFactoryService,
UrlManagerService,
ContextService,
ConfigService,
LoggerService,
Renderer])
], EditParameterComponent);
export { EditParameterComponent };
//# sourceMappingURL=edit-parameter.component.js.map