UNPKG

angular2-json-schema-form

Version:
49 lines 2.69 kB
"use strict"; 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); }; var core_1 = require("@angular/core"); var json_schema_form_service_1 = require("../library/json-schema-form.service"); var ButtonComponent = (function () { function ButtonComponent(jsf) { this.jsf = jsf; this.controlDisabled = false; this.boundControl = false; } ButtonComponent.prototype.ngOnInit = function () { this.options = this.layoutNode.options; this.jsf.initializeControl(this); }; ButtonComponent.prototype.updateValue = function (event) { this.jsf.updateValue(this, event.target.value); }; return ButtonComponent; }()); __decorate([ core_1.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "layoutNode", void 0); __decorate([ core_1.Input(), __metadata("design:type", Array) ], ButtonComponent.prototype, "layoutIndex", void 0); __decorate([ core_1.Input(), __metadata("design:type", Array) ], ButtonComponent.prototype, "dataIndex", void 0); ButtonComponent = __decorate([ core_1.Component({ moduleId: module.id, selector: 'button-widget', template: "\n <div\n [class]=\"options?.htmlClass\">\n <button\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [class]=\"options?.fieldHtmlClass\"\n [disabled]=\"controlDisabled\"\n [name]=\"controlName\"\n [type]=\"layoutNode?.type\"\n [value]=\"controlValue\"\n (click)=\"updateValue($event)\">\n <span *ngIf=\"options?.icon || options?.title\"\n [class]=\"options?.icon\"\n [innerHTML]=\"options?.title\"></span>\n </button>\n </div>", }), __metadata("design:paramtypes", [json_schema_form_service_1.JsonSchemaFormService]) ], ButtonComponent); exports.ButtonComponent = ButtonComponent; //# sourceMappingURL=button.component.js.map