angular-formio-proyectoscolfuturo
Version:
Form.io Angular JSON Form Renderer ========================== This library serves as a Dynamic JSON Powered Form rendering library for [Angular](https://angular.io). This works by providing a JSON schema to a ```<formio>``` Angular component, where tha
110 lines (109 loc) • 4.15 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { Component, EventEmitter, ViewChild, ElementRef } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { FormManagerService } from '../form-manager.service';
import { FormManagerConfig } from '../form-manager.config';
var FormManagerIndexComponent = /** @class */ (function () {
function FormManagerIndexComponent(service, route, router, config) {
this.service = service;
this.route = route;
this.router = router;
this.config = config;
this.gridQuery = { tags: this.config.tag, type: 'form' };
this.refreshGrid = new EventEmitter();
}
/**
* @return {?}
*/
FormManagerIndexComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this.service.reset();
};
/**
* @return {?}
*/
FormManagerIndexComponent.prototype.onSearch = /**
* @return {?}
*/
function () {
/** @type {?} */
var searchInput = this.search.nativeElement.value;
if (searchInput.length > 0) {
this.gridQuery.skip = 0;
this.gridQuery.title__regex = '/' + searchInput + '/i';
}
else {
delete this.gridQuery.title__regex;
}
this.refreshGrid.emit(this.gridQuery);
};
/**
* @param {?} action
* @return {?}
*/
FormManagerIndexComponent.prototype.onAction = /**
* @param {?} action
* @return {?}
*/
function (action) {
this.router.navigate([action.row._id, action.action], { relativeTo: this.route });
};
/**
* @param {?} row
* @return {?}
*/
FormManagerIndexComponent.prototype.onSelect = /**
* @param {?} row
* @return {?}
*/
function (row) {
this.router.navigate([row._id, 'view'], { relativeTo: this.route });
};
/**
* @return {?}
*/
FormManagerIndexComponent.prototype.onCreateItem = /**
* @return {?}
*/
function () {
this.router.navigate(['create'], { relativeTo: this.route });
};
FormManagerIndexComponent.decorators = [
{ type: Component, args: [{
template: "<div class=\"input-group mb-3\" *ngIf=\"config.includeSearch\"> <input type=\"text\" class=\"form-control\" placeholder=\"Search Forms\" aria-label=\"Search Forms\" aria-describedby=\"button-search\" #search> <div class=\"input-group-append\"> <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"button-search\" (click)=\"onSearch()\"><i class=\"fa fa-search\"></i> Search</button> </div> </div> <formio-grid *ngIf=\"service.ready\" [formio]=\"service.formio\" [gridType]=\"'form'\" [query]=\"{tags: config.tag, type: 'form'}\" [refresh]=\"refreshGrid\" [isActionAllowed]=\"service.actionAllowed\" (rowAction)=\"onAction($event)\" (rowSelect)=\"onSelect($event)\" (createItem)=\"onCreateItem()\" ></formio-grid> "
},] },
];
/** @nocollapse */
FormManagerIndexComponent.ctorParameters = function () { return [
{ type: FormManagerService },
{ type: ActivatedRoute },
{ type: Router },
{ type: FormManagerConfig }
]; };
FormManagerIndexComponent.propDecorators = {
search: [{ type: ViewChild, args: ['search',] }]
};
return FormManagerIndexComponent;
}());
export { FormManagerIndexComponent };
if (false) {
/** @type {?} */
FormManagerIndexComponent.prototype.gridQuery;
/** @type {?} */
FormManagerIndexComponent.prototype.refreshGrid;
/** @type {?} */
FormManagerIndexComponent.prototype.search;
/** @type {?} */
FormManagerIndexComponent.prototype.service;
/** @type {?} */
FormManagerIndexComponent.prototype.route;
/** @type {?} */
FormManagerIndexComponent.prototype.router;
/** @type {?} */
FormManagerIndexComponent.prototype.config;
}