UNPKG

ng2-json-editor

Version:

Angular2 component for editing large json documents

73 lines 4.11 kB
/* * This file is part of ng2-json-editor. * Copyright (C) 2016 CERN. * * ng2-json-editor is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * ng2-json-editor is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ng2-json-editor; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * In applying this license, CERN does not * waive the privileges and immunities granted to it by virtue of its status * as an Intergovernmental Organization or submit itself to any jurisdiction. */ 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, Input, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { AbstractFieldComponent } from '../abstract-field'; import { AppGlobalsService, JsonStoreService, PathUtilService, ProblemsService } from '../shared/services'; var TableItemFieldComponent = (function (_super) { __extends(TableItemFieldComponent, _super); function TableItemFieldComponent(appGlobalsService, problemsService, jsonStoreService, pathUtilService, changeDetectorRef) { var _this = _super.call(this, appGlobalsService, problemsService, pathUtilService, changeDetectorRef, jsonStoreService) || this; _this.appGlobalsService = appGlobalsService; _this.problemsService = problemsService; _this.jsonStoreService = jsonStoreService; _this.pathUtilService = pathUtilService; _this.changeDetectorRef = changeDetectorRef; return _this; } return TableItemFieldComponent; }(AbstractFieldComponent)); export { TableItemFieldComponent }; TableItemFieldComponent.decorators = [ { type: Component, args: [{ // Defined as attribute selector not to break table > tr > td html structure // tslint:disable-next-line selector: '[table-item-field]', styles: [""], template: "<td *ngFor=\"let key of keys; trackBy:trackByElement; first as isFirst\" [style.width]=\"schema.properties[key].columnWidth + '%'\" [ngClass]=\"isFirst ? redLeftBorderClass : ''\"> <any-type-field [value]=\"value.get(key) | selfOrEmpty:schema.properties[key]\" [schema]=\"schema.properties[key]\" [path]=\"getPathForChild(key)\"> </any-type-field> <add-new-element-button *ngIf=\"schema.properties[key].type === 'array'\" [path]=\"getPathForChild(key)\" [schema]=\"schema.properties[key]\"> </add-new-element-button> <patch-actions *ngIf=\"removeJsonPatch && isFirst\" [patch]=\"removeJsonPatch\"></patch-actions> </td> <!-- td element with list-action-group (up/down and delete buttons) --> <ng-content></ng-content> ", changeDetection: ChangeDetectionStrategy.OnPush },] }, ]; /** @nocollapse */ TableItemFieldComponent.ctorParameters = function () { return [ { type: AppGlobalsService, }, { type: ProblemsService, }, { type: JsonStoreService, }, { type: PathUtilService, }, { type: ChangeDetectorRef, }, ]; }; TableItemFieldComponent.propDecorators = { 'value': [{ type: Input },], 'schema': [{ type: Input },], 'path': [{ type: Input },], 'keys': [{ type: Input },], }; //# sourceMappingURL=table-item-field.component.js.map