UNPKG

angular2-schema-form

Version:

Angular2 Schema Form (DISCLAIMER: it is not related to angular-schema-form)

29 lines (28 loc) 1.64 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 { Component } from '@angular/core'; import { ControlWidget } from '../../widget'; var RadioWidget = (function (_super) { __extends(RadioWidget, _super); function RadioWidget() { return _super !== null && _super.apply(this, arguments) || this; } return RadioWidget; }(ControlWidget)); export { RadioWidget }; RadioWidget.decorators = [ { type: Component, args: [{ selector: 'sf-radio-widget', template: "<div class=\"widget form-group\">\n\t<label>{{schema.title}}</label>\n <span *ngIf=\"schema.description\" class=\"formHelp\">{{schema.description}}</span>\n\t<div *ngFor=\"let option of schema.oneOf\" class=\"radio\">\n\t\t<label class=\"horizontal control-label\">\n\t\t\t<input [formControl]=\"control\" [attr.name]=\"name\" value=\"{{option.enum[0]}}\" type=\"radio\" [attr.disabled]=\"schema.readOnly\">\n\t\t\t{{option.description}}\n\t\t</label>\n\t</div>\n\t<input *ngIf=\"schema.readOnly\" [attr.name]=\"name\" type=\"hidden\" [formControl]=\"control\">\n</div>" },] }, ]; /** @nocollapse */ RadioWidget.ctorParameters = function () { return []; };