UNPKG

131 kBJavaScriptView Raw
1import { InjectionToken, Injectable, Inject, ɵɵdefineInjectable, ɵɵinject, Component, Input, EventEmitter, Compiler, ComponentFactoryResolver, Output, Directive, ViewContainerRef, NgModule } from '@angular/core';
2import { HttpClient, HttpClientModule } from '@angular/common/http';
3import { Store, StoreModule } from '@ngrx/store';
4import { BehaviorSubject as BehaviorSubject$1 } from 'rxjs/BehaviorSubject';
5import { filter, map, take, switchMap, takeUntil, catchError } from 'rxjs/operators';
6import { stringTemplate } from '@soushians/shared';
7import { FormGroup, FormControl, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
8import { BehaviorSubject, Subject } from 'rxjs';
9import { getFormModuleConfig } from '@soushians/config';
10import { MatTableDataSource, MatExpansionModule, MatSnackBarModule, MatIconModule, MatDatepickerModule, MatButtonModule, MatCardModule, MatCheckboxModule, MatTableModule, MatSelectModule, MatInputModule, MatFormFieldModule, MatTabsModule, MatDividerModule, MatRadioModule, MatSlideToggleModule } from '@angular/material';
11import { SelectionModel } from '@angular/cdk/collections';
12import { CommonModule } from '@angular/common';
13import { ActivatedRoute, Router, RouterModule } from '@angular/router';
14import { FlexLayoutModule } from '@angular/flex-layout';
15import { ofType, Actions, Effect, EffectsModule } from '@ngrx/effects';
16import { __assign, __extends, __decorate, __metadata } from 'tslib';
17import 'rxjs/Observable';
18import 'rxjs/add/operator/map';
19import 'rxjs/add/operator/mergeMap';
20import 'rxjs/add/operator/switchMap';
21import { of } from 'rxjs/observable/of';
22
23/**
24 * @fileoverview added by tsickle
25 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
26 */
27var AddFormApiModel;
28(function (AddFormApiModel) {
29 var Request = /** @class */ (function () {
30 function Request(initValue) {
31 var _this = this;
32 if (initValue === void 0) { initValue = (/** @type {?} */ ({})); }
33 Object.keys(initValue).forEach((/**
34 * @param {?} key
35 * @return {?}
36 */
37 function (key) { return (_this[key] = initValue[key]); }));
38 }
39 /**
40 * @return {?}
41 */
42 Request.prototype.getRequestBody = /**
43 * @return {?}
44 */
45 function () {
46 return {
47 name: this.name,
48 form: this.form,
49 events: this.events
50 };
51 };
52 Object.defineProperty(Request, "formGroup", {
53 get: /**
54 * @return {?}
55 */
56 function () {
57 return new FormGroup({
58 _id: new FormControl("", [Validators.required]),
59 name: new FormControl("", [Validators.required]),
60 title: new FormControl("", [Validators.required]),
61 form: new FormControl({}),
62 events: new FormGroup({
63 accept: new FormGroup({
64 show: new FormControl(false),
65 text: new FormControl("ثبت")
66 }),
67 cancel: new FormGroup({
68 show: new FormControl(false),
69 text: new FormControl("انصراف")
70 })
71 })
72 });
73 },
74 enumerable: true,
75 configurable: true
76 });
77 return Request;
78 }());
79 AddFormApiModel.Request = Request;
80 if (false) {
81 /** @type {?} */
82 Request.prototype._id;
83 /** @type {?} */
84 Request.prototype.name;
85 /** @type {?} */
86 Request.prototype.form;
87 /** @type {?} */
88 Request.prototype.events;
89 }
90 var Response = /** @class */ (function () {
91 function Response() {
92 }
93 return Response;
94 }());
95 AddFormApiModel.Response = Response;
96 if (false) {
97 /** @type {?} */
98 Response.prototype.Result;
99 }
100})(AddFormApiModel || (AddFormApiModel = {}));
101
102/**
103 * @fileoverview added by tsickle
104 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
105 */
106var EditFormApiModel;
107(function (EditFormApiModel) {
108 var Request = /** @class */ (function () {
109 function Request(initValue) {
110 var _this = this;
111 if (initValue === void 0) { initValue = (/** @type {?} */ ({})); }
112 Object.keys(initValue).forEach((/**
113 * @param {?} key
114 * @return {?}
115 */
116 function (key) { return (_this[key] = initValue[key]); }));
117 }
118 /**
119 * @return {?}
120 */
121 Request.prototype.getRequestBody = /**
122 * @return {?}
123 */
124 function () {
125 return {
126 _id: this._id,
127 name: this.name,
128 form: this.form,
129 events: this.events
130 };
131 };
132 Object.defineProperty(Request, "formGroup", {
133 get: /**
134 * @return {?}
135 */
136 function () {
137 return new FormGroup({
138 _id: new FormControl("", [Validators.required]),
139 name: new FormControl("", [Validators.required]),
140 form: new FormControl({}),
141 events: new FormGroup({
142 accept: new FormGroup({
143 show: new FormControl(false),
144 text: new FormControl("ثبت")
145 }),
146 cancel: new FormGroup({
147 show: new FormControl(false),
148 text: new FormControl("انصراف")
149 })
150 })
151 });
152 },
153 enumerable: true,
154 configurable: true
155 });
156 return Request;
157 }());
158 EditFormApiModel.Request = Request;
159 if (false) {
160 /** @type {?} */
161 Request.prototype._id;
162 /** @type {?} */
163 Request.prototype.name;
164 /** @type {?} */
165 Request.prototype.form;
166 /** @type {?} */
167 Request.prototype.events;
168 }
169 var Response = /** @class */ (function () {
170 function Response() {
171 }
172 return Response;
173 }());
174 EditFormApiModel.Response = Response;
175 if (false) {
176 /** @type {?} */
177 Response.prototype.Result;
178 }
179})(EditFormApiModel || (EditFormApiModel = {}));
180
181/**
182 * @fileoverview added by tsickle
183 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
184 */
185var FormListApiModel;
186(function (FormListApiModel) {
187 var Request = /** @class */ (function () {
188 function Request(initValue) {
189 var _this = this;
190 if (initValue === void 0) { initValue = (/** @type {?} */ ({})); }
191 Object.keys(initValue).forEach((/**
192 * @param {?} key
193 * @return {?}
194 */
195 function (key) { return (_this[key] = initValue[key]); }));
196 }
197 /**
198 * @return {?}
199 */
200 Request.prototype.getRequestBody = /**
201 * @return {?}
202 */
203 function () {
204 return {
205 Name: this.Name,
206 Controls: this.Controls
207 };
208 };
209 Object.defineProperty(Request, "formGroup", {
210 get: /**
211 * @return {?}
212 */
213 function () {
214 return new FormGroup({
215 Name: new FormControl("", [Validators.required]),
216 Controls: new FormGroup({})
217 });
218 },
219 enumerable: true,
220 configurable: true
221 });
222 return Request;
223 }());
224 FormListApiModel.Request = Request;
225 if (false) {
226 /** @type {?} */
227 Request.prototype.Name;
228 /** @type {?} */
229 Request.prototype.Controls;
230 }
231 var Response = /** @class */ (function () {
232 function Response() {
233 }
234 return Response;
235 }());
236 FormListApiModel.Response = Response;
237 if (false) {
238 /** @type {?} */
239 Response.prototype.Result;
240 }
241})(FormListApiModel || (FormListApiModel = {}));
242
243/**
244 * @fileoverview added by tsickle
245 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
246 */
247/**
248 * @record
249 */
250function validation() { }
251if (false) {
252 /** @type {?} */
253 validation.prototype.active;
254 /** @type {?} */
255 validation.prototype.message;
256 /** @type {?|undefined} */
257 validation.prototype.value;
258}
259var Validator = /** @class */ (function () {
260 function Validator() {
261 this.required = {
262 active: false,
263 message: "این فیلد الزامی است"
264 };
265 this.minlength = {
266 active: false,
267 message: "حداقل تعداد کارکترها",
268 value: 5
269 };
270 this.email = {
271 active: false,
272 message: "لطفا ایمیل صحیح وارد نمایید"
273 };
274 }
275 return Validator;
276}());
277if (false) {
278 /** @type {?} */
279 Validator.prototype.required;
280 /** @type {?} */
281 Validator.prototype.minlength;
282 /** @type {?} */
283 Validator.prototype.email;
284}
285
286/**
287 * @fileoverview added by tsickle
288 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
289 */
290var FieldConfig = /** @class */ (function () {
291 function FieldConfig(type) {
292 this.type = type;
293 if (type != "control")
294 this.fields = [];
295 this.width = 3;
296 this.validator = new Validator();
297 }
298 return FieldConfig;
299}());
300if (false) {
301 /** @type {?} */
302 FieldConfig.prototype.id;
303 /** @type {?} */
304 FieldConfig.prototype.type;
305 /** @type {?} */
306 FieldConfig.prototype.name;
307 /** @type {?} */
308 FieldConfig.prototype.subtype;
309 /** @type {?} */
310 FieldConfig.prototype.disabled;
311 /** @type {?} */
312 FieldConfig.prototype.title;
313 /** @type {?} */
314 FieldConfig.prototype.parentType;
315 /** @type {?} */
316 FieldConfig.prototype.formGroupPath;
317 /** @type {?} */
318 FieldConfig.prototype.path;
319 /** @type {?} */
320 FieldConfig.prototype.inputType;
321 /** @type {?} */
322 FieldConfig.prototype.value;
323 /** @type {?} */
324 FieldConfig.prototype.order;
325 /** @type {?} */
326 FieldConfig.prototype.width;
327 /** @type {?} */
328 FieldConfig.prototype.options;
329 /** @type {?} */
330 FieldConfig.prototype.dataEndpoint;
331 /** @type {?} */
332 FieldConfig.prototype.optionsEndpoint;
333 /** @type {?} */
334 FieldConfig.prototype.fields;
335 /** @type {?} */
336 FieldConfig.prototype.validator;
337}
338
339/**
340 * @fileoverview added by tsickle
341 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
342 */
343var FormSchemaModel = /** @class */ (function () {
344 function FormSchemaModel() {
345 this.events = {
346 accept: {
347 show: false,
348 text: "ثبت"
349 },
350 cancel: {
351 show: false,
352 text: "انصراف"
353 }
354 };
355 this.form = new FieldConfig("group");
356 }
357 /**
358 * @return {?}
359 */
360 FormSchemaModel.prototype.init = /**
361 * @return {?}
362 */
363 function () {
364 this._id = (Math.random() * 10).toString();
365 };
366 return FormSchemaModel;
367}());
368if (false) {
369 /** @type {?} */
370 FormSchemaModel.prototype._id;
371 /** @type {?} */
372 FormSchemaModel.prototype.name;
373 /** @type {?} */
374 FormSchemaModel.prototype.description;
375 /** @type {?} */
376 FormSchemaModel.prototype.form;
377 /** @type {?} */
378 FormSchemaModel.prototype.events;
379}
380
381/**
382 * @fileoverview added by tsickle
383 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
384 */
385/**
386 * @record
387 */
388function Field() { }
389if (false) {
390 /** @type {?} */
391 Field.prototype.config;
392 /** @type {?} */
393 Field.prototype.group;
394}
395
396/**
397 * @fileoverview added by tsickle
398 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
399 */
400
401/**
402 * @fileoverview added by tsickle
403 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
404 */
405/**
406 * @record
407 */
408function FormModuleConfig() { }
409if (false) {
410 /** @type {?|undefined} */
411 FormModuleConfig.prototype.env;
412 /** @type {?|undefined} */
413 FormModuleConfig.prototype.endpoints;
414}
415/** @type {?} */
416var MODULE_DEFAULT_CONFIG = {
417 env: {
418 production: false,
419 frontend_server: "frontend/server/did/not/set",
420 server: "server/did/not/set"
421 },
422 endpoints: {
423 addForm: "",
424 editForm: "",
425 getForm: "",
426 getList: "",
427 deleteForm: "",
428 captchaUrl: ""
429 },
430};
431/** @type {?} */
432var MODULE_CONFIG_TOKEN = new InjectionToken("FormModuleConfig");
433
434/**
435 * @fileoverview added by tsickle
436 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
437 */
438var FormConfigurationService = /** @class */ (function () {
439 function FormConfigurationService(configFile, store) {
440 var _this = this;
441 this.store = store;
442 this.config$ = new BehaviorSubject(MODULE_DEFAULT_CONFIG);
443 this._config = Object.assign({}, MODULE_DEFAULT_CONFIG, configFile);
444 this.config$.next(this._config);
445 this.store.select(getFormModuleConfig).subscribe((/**
446 * @param {?} userConfig
447 * @return {?}
448 */
449 function (userConfig) {
450 if (!userConfig)
451 return;
452 _this._config = Object.assign({}, _this._config, userConfig.Config);
453 _this.config$.next(_this._config);
454 }));
455 }
456 Object.defineProperty(FormConfigurationService.prototype, "config", {
457 get: /**
458 * @return {?}
459 */
460 function () {
461 return this._config;
462 },
463 enumerable: true,
464 configurable: true
465 });
466 FormConfigurationService.decorators = [
467 { type: Injectable, args: [{
468 providedIn: "root"
469 },] }
470 ];
471 /** @nocollapse */
472 FormConfigurationService.ctorParameters = function () { return [
473 { type: undefined, decorators: [{ type: Inject, args: [MODULE_CONFIG_TOKEN,] }] },
474 { type: Store }
475 ]; };
476 /** @nocollapse */ FormConfigurationService.ngInjectableDef = ɵɵdefineInjectable({ factory: function FormConfigurationService_Factory() { return new FormConfigurationService(ɵɵinject(MODULE_CONFIG_TOKEN), ɵɵinject(Store)); }, token: FormConfigurationService, providedIn: "root" });
477 return FormConfigurationService;
478}());
479if (false) {
480 /**
481 * @type {?}
482 * @private
483 */
484 FormConfigurationService.prototype._config;
485 /** @type {?} */
486 FormConfigurationService.prototype.config$;
487 /**
488 * @type {?}
489 * @private
490 */
491 FormConfigurationService.prototype.store;
492}
493
494/**
495 * @fileoverview added by tsickle
496 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
497 */
498var FormService = /** @class */ (function () {
499 function FormService(http, store, configurationService) {
500 this.http = http;
501 this.store = store;
502 this.configurationService = configurationService;
503 }
504 /**
505 * @param {?} data
506 * @return {?}
507 */
508 FormService.prototype.add = /**
509 * @param {?} data
510 * @return {?}
511 */
512 function (data) {
513 var _this = this;
514 /** @type {?} */
515 var model = new AddFormApiModel.Request(data);
516 return this.configurationService.config$
517 .filter((/**
518 * @param {?} config
519 * @return {?}
520 */
521 function (config) { return config.endpoints.addForm != ""; }))
522 .take(1)
523 .switchMap((/**
524 * @param {?} config
525 * @return {?}
526 */
527 function (config) {
528 return _this.http.post(config.env.frontend_server + config.endpoints.addForm, model.getRequestBody());
529 }))
530 .map((/**
531 * @param {?} response
532 * @return {?}
533 */
534 function (response) { return response.Result; }));
535 };
536 /**
537 * @param {?} _id
538 * @return {?}
539 */
540 FormService.prototype.get = /**
541 * @param {?} _id
542 * @return {?}
543 */
544 function (_id) {
545 var _this = this;
546 return this.configurationService.config$
547 .filter((/**
548 * @param {?} config
549 * @return {?}
550 */
551 function (config) { return config.endpoints.getForm != ""; }))
552 .take(1)
553 .switchMap((/**
554 * @param {?} config
555 * @return {?}
556 */
557 function (config) {
558 return _this.http.get(stringTemplate(config.env.frontend_server + config.endpoints.getForm, { _id: _id }));
559 }))
560 .map((/**
561 * @param {?} response
562 * @return {?}
563 */
564 function (response) { return response.Result; }));
565 };
566 /**
567 * @return {?}
568 */
569 FormService.prototype.getList = /**
570 * @return {?}
571 */
572 function () {
573 var _this = this;
574 return this.configurationService.config$
575 .filter((/**
576 * @param {?} config
577 * @return {?}
578 */
579 function (config) { return config.endpoints.getList != ""; }))
580 .switchMap((/**
581 * @param {?} config
582 * @return {?}
583 */
584 function (config) { return _this.http.get(config.env.frontend_server + config.endpoints.getList); }))
585 .map((/**
586 * @param {?} response
587 * @return {?}
588 */
589 function (response) { return response.Result; }));
590 };
591 /**
592 * @param {?} data
593 * @return {?}
594 */
595 FormService.prototype.update = /**
596 * @param {?} data
597 * @return {?}
598 */
599 function (data) {
600 var _this = this;
601 /** @type {?} */
602 var model = new EditFormApiModel.Request(data);
603 return this.configurationService.config$
604 .filter((/**
605 * @param {?} config
606 * @return {?}
607 */
608 function (config) { return config.endpoints.editForm != ""; }))
609 .take(1)
610 .switchMap((/**
611 * @param {?} config
612 * @return {?}
613 */
614 function (config) {
615 return _this.http.put(config.env.frontend_server + config.endpoints.editForm, model.getRequestBody());
616 }))
617 .map((/**
618 * @param {?} response
619 * @return {?}
620 */
621 function (response) { return response.Result; }));
622 };
623 /**
624 * @param {?} _id
625 * @return {?}
626 */
627 FormService.prototype.delete = /**
628 * @param {?} _id
629 * @return {?}
630 */
631 function (_id) {
632 var _this = this;
633 return this.configurationService.config$
634 .filter((/**
635 * @param {?} config
636 * @return {?}
637 */
638 function (config) { return config.endpoints.deleteForm != ""; }))
639 .switchMap((/**
640 * @param {?} config
641 * @return {?}
642 */
643 function (config) { return _this.http.get(config.env.frontend_server + config.endpoints.deleteForm); }));
644 };
645 /**
646 * @param {?} _id
647 * @return {?}
648 */
649 FormService.prototype.selectFormById = /**
650 * @param {?} _id
651 * @return {?}
652 */
653 function (_id) {
654 /** @type {?} */
655 var subject = new BehaviorSubject$1(undefined);
656 this.store
657 .select((/**
658 * @param {?} state
659 * @return {?}
660 */
661 function (state) { return state.form.list.data; }))
662 .pipe(filter((/**
663 * @param {?} forms
664 * @return {?}
665 */
666 function (forms) { return forms != null; })), map((/**
667 * @param {?} forms
668 * @return {?}
669 */
670 function (forms) { return forms.find((/**
671 * @param {?} form
672 * @return {?}
673 */
674 function (form) { return form._id == _id; })); })))
675 .subscribe((/**
676 * @param {?} formSchemaModel
677 * @return {?}
678 */
679 function (formSchemaModel) { return subject.next(formSchemaModel); }));
680 return subject.asObservable();
681 };
682 FormService.decorators = [
683 { type: Injectable, args: [{
684 providedIn: "root"
685 },] }
686 ];
687 /** @nocollapse */
688 FormService.ctorParameters = function () { return [
689 { type: HttpClient },
690 { type: Store },
691 { type: FormConfigurationService }
692 ]; };
693 /** @nocollapse */ FormService.ngInjectableDef = ɵɵdefineInjectable({ factory: function FormService_Factory() { return new FormService(ɵɵinject(HttpClient), ɵɵinject(Store), ɵɵinject(FormConfigurationService)); }, token: FormService, providedIn: "root" });
694 return FormService;
695}());
696if (false) {
697 /**
698 * @type {?}
699 * @private
700 */
701 FormService.prototype.http;
702 /**
703 * @type {?}
704 * @private
705 */
706 FormService.prototype.store;
707 /**
708 * @type {?}
709 * @private
710 */
711 FormService.prototype.configurationService;
712}
713
714/**
715 * @fileoverview added by tsickle
716 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
717 */
718var SelectComponent = /** @class */ (function () {
719 function SelectComponent() {
720 }
721 SelectComponent.decorators = [
722 { type: Component, args: [{
723 selector: "ngs-form-control-select",
724 template: "<div [formGroup]=\"group\">\r\n<mat-form-field>\r\n <mat-select [formControlName]=\"config.name\" [placeholder]=\"config.title\">\r\n <mat-option *ngFor=\"let option of config.options\" [value]=\"option.value\">{{option.key}}</mat-option>\r\n </mat-select>\r\n</mat-form-field>\r\n</div>",
725 styles: [":host{display:block}.mat-form-field{width:100%}"]
726 }] }
727 ];
728 /** @nocollapse */
729 SelectComponent.ctorParameters = function () { return []; };
730 return SelectComponent;
731}());
732if (false) {
733 /** @type {?} */
734 SelectComponent.prototype.config;
735 /** @type {?} */
736 SelectComponent.prototype.group;
737}
738
739/**
740 * @fileoverview added by tsickle
741 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
742 */
743
744/**
745 * @fileoverview added by tsickle
746 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
747 */
748var CheckboxComponent = /** @class */ (function () {
749 function CheckboxComponent() {
750 }
751 CheckboxComponent.decorators = [
752 { type: Component, args: [{
753 selector: "ngs-form-control-checkbox",
754 template: "<div [formGroup]=\"group\">\r\n <mat-checkbox [formControlName]=\"config.name\">\r\n {{config.title}}\r\n </mat-checkbox>\r\n</div>",
755 styles: [":host{display:block}.mat-form-field{width:100%}"]
756 }] }
757 ];
758 /** @nocollapse */
759 CheckboxComponent.ctorParameters = function () { return []; };
760 return CheckboxComponent;
761}());
762if (false) {
763 /** @type {?} */
764 CheckboxComponent.prototype.config;
765 /** @type {?} */
766 CheckboxComponent.prototype.group;
767}
768
769/**
770 * @fileoverview added by tsickle
771 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
772 */
773
774/**
775 * @fileoverview added by tsickle
776 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
777 */
778var EmailComponent = /** @class */ (function () {
779 function EmailComponent() {
780 }
781 /**
782 * @return {?}
783 */
784 EmailComponent.prototype.ngOnInit = /**
785 * @return {?}
786 */
787 function () { };
788 EmailComponent.decorators = [
789 { type: Component, args: [{
790 selector: "ngs-form-control-email",
791 template: "<div [formGroup]=\"group\">\r\n<mat-form-field fxFlexFill>\r\n <input matInput [type]=\"config.inputType\" [placeholder]=\"config.title\" [formControlName]=\"config.name\">\r\n</mat-form-field>\r\n</div>",
792 styles: [":host{display:block}.mat-form-field{width:100%}"]
793 }] }
794 ];
795 /** @nocollapse */
796 EmailComponent.ctorParameters = function () { return []; };
797 return EmailComponent;
798}());
799if (false) {
800 /** @type {?} */
801 EmailComponent.prototype.config;
802 /** @type {?} */
803 EmailComponent.prototype.group;
804}
805
806/**
807 * @fileoverview added by tsickle
808 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
809 */
810
811/**
812 * @fileoverview added by tsickle
813 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
814 */
815var ColorComponent = /** @class */ (function () {
816 function ColorComponent() {
817 }
818 /**
819 * @return {?}
820 */
821 ColorComponent.prototype.ngOnInit = /**
822 * @return {?}
823 */
824 function () { };
825 ColorComponent.decorators = [
826 { type: Component, args: [{
827 selector: "ngs-form-control-color",
828 template: "<div [formGroup]=\"form\">\r\n<mat-form-field fxFlexFill>\r\n <input matInput [type]=\"schema.inputType\" [placeholder]=\"schema.title\" [formControlName]=\"schema.name\">\r\n</mat-form-field>\r\n</div>",
829 styles: [":host{display:block}.mat-form-field{width:100%}"]
830 }] }
831 ];
832 /** @nocollapse */
833 ColorComponent.ctorParameters = function () { return []; };
834 ColorComponent.propDecorators = {
835 form: [{ type: Input }],
836 schema: [{ type: Input }]
837 };
838 return ColorComponent;
839}());
840if (false) {
841 /** @type {?} */
842 ColorComponent.prototype.config;
843 /** @type {?} */
844 ColorComponent.prototype.group;
845 /** @type {?} */
846 ColorComponent.prototype.form;
847 /** @type {?} */
848 ColorComponent.prototype.schema;
849}
850
851/**
852 * @fileoverview added by tsickle
853 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
854 */
855
856/**
857 * @fileoverview added by tsickle
858 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
859 */
860var TableComponent = /** @class */ (function () {
861 function TableComponent(http) {
862 this.http = http;
863 this.selection = new SelectionModel(true, []);
864 this.ready = false;
865 }
866 /**
867 * @return {?}
868 */
869 TableComponent.prototype.ngOnInit = /**
870 * @return {?}
871 */
872 function () {
873 var _this = this;
874 this.http.get(this.schema.dataEndpoint).subscribe((/**
875 * @param {?} data
876 * @return {?}
877 */
878 function (data) {
879 _this.ready = true;
880 _this.displayedColumns = data.displayedColumns;
881 _this.filedDisplayedColumns = data.filedDisplayedColumns;
882 _this.dataSource = new MatTableDataSource(data.dataSource);
883 }));
884 };
885 /** Whether the number of selected elements matches the total number of rows. */
886 /**
887 * Whether the number of selected elements matches the total number of rows.
888 * @return {?}
889 */
890 TableComponent.prototype.isAllSelected = /**
891 * Whether the number of selected elements matches the total number of rows.
892 * @return {?}
893 */
894 function () {
895 var _a;
896 /** @type {?} */
897 var numSelected = this.selection.selected.length;
898 this.form.patchValue((_a = {},
899 _a[this.schema.name] = this.selection.selected,
900 _a));
901 /** @type {?} */
902 var numRows = this.dataSource.data.length;
903 return numSelected === numRows;
904 };
905 /** Selects all rows if they are not all selected; otherwise clear selection. */
906 /**
907 * Selects all rows if they are not all selected; otherwise clear selection.
908 * @return {?}
909 */
910 TableComponent.prototype.masterToggle = /**
911 * Selects all rows if they are not all selected; otherwise clear selection.
912 * @return {?}
913 */
914 function () {
915 var _this = this;
916 this.isAllSelected() ? this.selection.clear() : this.dataSource.data.forEach((/**
917 * @param {?} row
918 * @return {?}
919 */
920 function (row) { return _this.selection.select(row); }));
921 };
922 TableComponent.decorators = [
923 { type: Component, args: [{
924 selector: "ngs-form-control-table",
925 template: "<div class=\"example-container mat-elevation-z8\" *ngIf=\"ready\">\r\n <mat-table #table [dataSource]=\"dataSource\">\r\n \r\n <ng-container matColumnDef=\"select\">\r\n <mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"selection.hasValue() && isAllSelected()\"\r\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\">\r\n <mat-checkbox (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\">\r\n </mat-checkbox>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <div *ngFor=\"let col of filedDisplayedColumns\">\r\n <ng-container [matColumnDef]=\"col\">\r\n <mat-header-cell *matHeaderCellDef> {{col}} </mat-header-cell>\r\n <mat-cell *matCellDef=\"let element\"> {{element[col]}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <ng-container matColumnDef=\"actions\">\r\n <mat-header-cell *matHeaderCellDef></mat-header-cell>\r\n <mat-cell class='left-align' *matCellDef=\"let row\">\r\n <button mat-icon-button>\r\n <mat-icon aria-label=\"\u0627\u0646\u062A\u062E\u0627\u0628\">arrow_back</mat-icon>\r\n </button>\r\n </mat-cell>\r\n </ng-container>\r\n \r\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns: displayedColumns;\" (click)=\"selection.toggle(row)\"></mat-row>\r\n\r\n </mat-table>\r\n </div>\r\n\r\n\r\n<!-- <mat-form-field fxFlexFill [formGroup]=\"form\">\r\n \r\n <input matInput [id]=\"schema.name\" [type]=\"schema.inputType\" [placeholder]=\"schema.title\" [formControlName]=\"schema.name\">\r\n \r\n <mat-error *ngIf=\"form.get(schema.name).errors?.required\">\r\n {{schema.validator.required.message}}\r\n </mat-error>\r\n <mat-error *ngIf=\"form.get(schema.name).errors?.minlength\">\r\n {{schema.validator.minlength.message}}\r\n </mat-error>\r\n <mat-error *ngIf=\"form.get(schema.name).email?.minlength\">\r\n {{schema.validator.email.message}}\r\n </mat-error>\r\n</mat-form-field> -->\r\n \r\n <!-- <div *ngIf=\"form.get(schema.name).invalid && (form.get(schema.name).dirty || form.get(schema.name).touched)\" class=\"alert alert-danger\">\r\n </div> -->",
926 styles: [":host{display:block}.mat-form-field{width:100%}"]
927 }] }
928 ];
929 /** @nocollapse */
930 TableComponent.ctorParameters = function () { return [
931 { type: HttpClient }
932 ]; };
933 TableComponent.propDecorators = {
934 form: [{ type: Input }],
935 schema: [{ type: Input }]
936 };
937 return TableComponent;
938}());
939if (false) {
940 /** @type {?} */
941 TableComponent.prototype.config;
942 /** @type {?} */
943 TableComponent.prototype.group;
944 /** @type {?} */
945 TableComponent.prototype.form;
946 /** @type {?} */
947 TableComponent.prototype.schema;
948 /** @type {?} */
949 TableComponent.prototype.ready;
950 /** @type {?} */
951 TableComponent.prototype.displayedColumns;
952 /** @type {?} */
953 TableComponent.prototype.filedDisplayedColumns;
954 /** @type {?} */
955 TableComponent.prototype.dataSource;
956 /** @type {?} */
957 TableComponent.prototype.selection;
958 /**
959 * @type {?}
960 * @private
961 */
962 TableComponent.prototype.http;
963}
964
965/**
966 * @fileoverview added by tsickle
967 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
968 */
969
970/**
971 * @fileoverview added by tsickle
972 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
973 */
974var NumberComponent = /** @class */ (function () {
975 function NumberComponent() {
976 }
977 /**
978 * @return {?}
979 */
980 NumberComponent.prototype.ngOnInit = /**
981 * @return {?}
982 */
983 function () { };
984 NumberComponent.decorators = [
985 { type: Component, args: [{
986 selector: "ngs-form-control-number",
987 template: "<div [formGroup]=\"form\">\r\n <mat-form-field fxFlexFill>\r\n <input matInput [type]=\"schema.inputType\" [placeholder]=\"schema.title\" [formControlName]=\"schema.name\">\r\n </mat-form-field>\r\n</div>",
988 styles: [":host{display:block}.mat-form-field{width:100%}"]
989 }] }
990 ];
991 /** @nocollapse */
992 NumberComponent.ctorParameters = function () { return []; };
993 NumberComponent.propDecorators = {
994 form: [{ type: Input }],
995 schema: [{ type: Input }]
996 };
997 return NumberComponent;
998}());
999if (false) {
1000 /** @type {?} */
1001 NumberComponent.prototype.form;
1002 /** @type {?} */
1003 NumberComponent.prototype.schema;
1004}
1005
1006/**
1007 * @fileoverview added by tsickle
1008 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1009 */
1010
1011/**
1012 * @fileoverview added by tsickle
1013 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1014 */
1015var TextComponent = /** @class */ (function () {
1016 function TextComponent() {
1017 }
1018 TextComponent.decorators = [
1019 { type: Component, args: [{
1020 selector: "ngs-form-control-text",
1021 template: "<mat-form-field fxFlexFill [formGroup]=\"group\">\r\n\r\n <input matInput [id]=\"config.name\" [type]=\"config.inputType\" [placeholder]=\"config.title\" [formControlName]=\"config.name\">\r\n\r\n <mat-error *ngIf=\"group.get(config.name).errors?.required\">\r\n {{config.validator.required.message}}\r\n </mat-error>\r\n <mat-error *ngIf=\"group.get(config.name).errors?.minlength\">\r\n {{config.validator.minlength.message}}\r\n </mat-error>\r\n <!-- <mat-error *ngIf=\"group.get(config.name).email?.minlength\">\r\n {{config.validator.email.message}}\r\n </mat-error> -->\r\n\r\n <!-- <div *ngIf=\"form.get(config.name).invalid && (form.get(config.name).dirty || form.get(config.name).touched)\" class=\"alert alert-danger\">\r\n </div> -->\r\n\r\n</mat-form-field>",
1022 styles: [":host{display:block}.mat-form-field{width:100%}"]
1023 }] }
1024 ];
1025 /** @nocollapse */
1026 TextComponent.ctorParameters = function () { return []; };
1027 return TextComponent;
1028}());
1029if (false) {
1030 /** @type {?} */
1031 TextComponent.prototype.config;
1032 /** @type {?} */
1033 TextComponent.prototype.group;
1034}
1035
1036/**
1037 * @fileoverview added by tsickle
1038 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1039 */
1040
1041/**
1042 * @fileoverview added by tsickle
1043 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1044 */
1045
1046/**
1047 * @fileoverview added by tsickle
1048 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1049 */
1050/** @enum {string} */
1051var FormsListActionTypes = {
1052 FORMS_LIST: "[FORM][LIST] FORMS_LIST",
1053 FORMS_LIST_START: "[FORM][LIST] FORMS_LIST_START",
1054 FORMS_LIST_SUCCEED: "[FORM][LIST] FORMS_LIST_SUCCEED",
1055 FORMS_LIST_FAILED: "[FORM][LIST] FORMS_LIST_FAILED",
1056 ADD_FORM_SCHEMA: "[FORM][LIST] ADD_FORM_SCHEMA",
1057 FORM_SCHEMA_UPDATE: "[FORM][LIST] FORM_SCHEMA_UPDATE",
1058 GET_FORM_SCHEMA: "[FORM][LIST] GET_FORM_SCHEMA",
1059 FORM_SCHEMA_FETCHED: "[FORM][LIST] FORM_SCHEMA_FETCHED",
1060};
1061var FormsListAction = /** @class */ (function () {
1062 function FormsListAction() {
1063 this.type = FormsListActionTypes.FORMS_LIST;
1064 }
1065 return FormsListAction;
1066}());
1067if (false) {
1068 /** @type {?} */
1069 FormsListAction.prototype.type;
1070}
1071var FormsListStartAction = /** @class */ (function () {
1072 function FormsListStartAction() {
1073 this.type = FormsListActionTypes.FORMS_LIST_START;
1074 }
1075 return FormsListStartAction;
1076}());
1077if (false) {
1078 /** @type {?} */
1079 FormsListStartAction.prototype.type;
1080}
1081var FormsListSucceedAction = /** @class */ (function () {
1082 function FormsListSucceedAction(payload) {
1083 this.payload = payload;
1084 this.type = FormsListActionTypes.FORMS_LIST_SUCCEED;
1085 }
1086 return FormsListSucceedAction;
1087}());
1088if (false) {
1089 /** @type {?} */
1090 FormsListSucceedAction.prototype.type;
1091 /** @type {?} */
1092 FormsListSucceedAction.prototype.payload;
1093}
1094var FormsListFailedAction = /** @class */ (function () {
1095 function FormsListFailedAction() {
1096 this.type = FormsListActionTypes.FORMS_LIST_FAILED;
1097 }
1098 return FormsListFailedAction;
1099}());
1100if (false) {
1101 /** @type {?} */
1102 FormsListFailedAction.prototype.type;
1103}
1104var UpdateFormSchemaAction = /** @class */ (function () {
1105 function UpdateFormSchemaAction(payload) {
1106 this.payload = payload;
1107 this.type = FormsListActionTypes.FORM_SCHEMA_UPDATE;
1108 }
1109 return UpdateFormSchemaAction;
1110}());
1111if (false) {
1112 /** @type {?} */
1113 UpdateFormSchemaAction.prototype.type;
1114 /** @type {?} */
1115 UpdateFormSchemaAction.prototype.payload;
1116}
1117var AddFormSchemaAction = /** @class */ (function () {
1118 function AddFormSchemaAction(payload) {
1119 this.payload = payload;
1120 this.type = FormsListActionTypes.ADD_FORM_SCHEMA;
1121 }
1122 return AddFormSchemaAction;
1123}());
1124if (false) {
1125 /** @type {?} */
1126 AddFormSchemaAction.prototype.type;
1127 /** @type {?} */
1128 AddFormSchemaAction.prototype.payload;
1129}
1130var GetFormSchemaAction = /** @class */ (function () {
1131 function GetFormSchemaAction(payload) {
1132 this.payload = payload;
1133 this.type = FormsListActionTypes.GET_FORM_SCHEMA;
1134 }
1135 return GetFormSchemaAction;
1136}());
1137if (false) {
1138 /** @type {?} */
1139 GetFormSchemaAction.prototype.type;
1140 /** @type {?} */
1141 GetFormSchemaAction.prototype.payload;
1142}
1143var FormSchemaFechedAction = /** @class */ (function () {
1144 function FormSchemaFechedAction(payload) {
1145 this.payload = payload;
1146 this.type = FormsListActionTypes.FORM_SCHEMA_FETCHED;
1147 }
1148 return FormSchemaFechedAction;
1149}());
1150if (false) {
1151 /** @type {?} */
1152 FormSchemaFechedAction.prototype.type;
1153 /** @type {?} */
1154 FormSchemaFechedAction.prototype.payload;
1155}
1156
1157/**
1158 * @fileoverview added by tsickle
1159 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1160 */
1161var DateFormInputControlComponent = /** @class */ (function () {
1162 function DateFormInputControlComponent() {
1163 }
1164 DateFormInputControlComponent.decorators = [
1165 { type: Component, args: [{
1166 selector: "ngs-form-control-date",
1167 template: "<mat-form-field fxFlexFill [formGroup]=\"group\">\r\n\r\n <!-- <input matInput [id]=\"config.name\" [type]=\"config.inputType\" [placeholder]=\"config.title\" [formControlName]=\"config.name\"> -->\r\n <input matInput [id]=\"config.name\" [matDatepicker]=\"_datepicker\" [placeholder]=\"config.title\" [formControlName]=\"config.name\">\r\n <mat-datepicker-toggle matSuffix [for]=\"_datepicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #_datepicker></mat-datepicker>\r\n\r\n <mat-error *ngIf=\"group.get(config.name).errors?.required\">\r\n {{config.validator.required.message}}\r\n </mat-error>\r\n <mat-error *ngIf=\"group.get(config.name).errors?.minlength\">\r\n {{config.validator.minlength.message}}\r\n </mat-error>\r\n <!-- <mat-error *ngIf=\"group.get(config.name).email?.minlength\">\r\n {{config.validator.email.message}}\r\n </mat-error> -->\r\n\r\n <!-- <div *ngIf=\"form.get(config.name).invalid && (form.get(config.name).dirty || form.get(config.name).touched)\" class=\"alert alert-danger\">\r\n </div> -->\r\n\r\n</mat-form-field>\r\n\r\n<!-- \r\n\r\n<div [formGroup]=\"formGroup\">\r\n <div class=\"field-wrapper\">\r\n <div [@filedAnimation]=\"mode\">\r\n <mat-form-field class=\"fit\" [(ngClass)]=\"mode\">\r\n <input matInput [matDatepicker]=\"_datepicker\" [placeholder]=\"placeholder\" [formControlName]=\"controlName\">\r\n <mat-datepicker-toggle matSuffix [for]=\"_datepicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #_datepicker></mat-datepicker>\r\n \r\n <mat-icon class=\"tooltip md-18\" *ngIf=\"tooltip\" [matTooltip]=\"tooltip\">help</mat-icon>\r\n </mat-form-field>\r\n <div class=\"value-box\"> \r\n <span class=\"name\">\r\n {{ placeholder }} :\r\n </span>\r\n <span class=\"value\">\r\n {{(DisplayValue$ | async | persianDate)}} \r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div> -->",
1168 styles: [":host{display:block}.mat-form-field{width:100%}"]
1169 }] }
1170 ];
1171 /** @nocollapse */
1172 DateFormInputControlComponent.ctorParameters = function () { return []; };
1173 return DateFormInputControlComponent;
1174}());
1175if (false) {
1176 /** @type {?} */
1177 DateFormInputControlComponent.prototype.config;
1178 /** @type {?} */
1179 DateFormInputControlComponent.prototype.group;
1180}
1181
1182/**
1183 * @fileoverview added by tsickle
1184 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1185 */
1186var FileFormInputControlComponent = /** @class */ (function () {
1187 function FileFormInputControlComponent() {
1188 }
1189 FileFormInputControlComponent.decorators = [
1190 { type: Component, args: [{
1191 selector: "ngs-form-control-file",
1192 template: "<div fxFlexFill [formGroup]=\"group\">\r\n\r\n <!-- <input matInput [id]=\"config.name\" [type]=\"config.inputType\" [placeholder]=\"config.title\" [formControlName]=\"config.name\"> -->\r\n <input [id]=\"config.name\" [type]=\"config.inputType\" [placeholder]=\"config.title\" [formControlName]=\"config.name\">\r\n\r\n <mat-error *ngIf=\"group.get(config.name).errors?.required\">\r\n {{config.validator.required.message}}\r\n </mat-error>\r\n <mat-error *ngIf=\"group.get(config.name).errors?.minlength\">\r\n {{config.validator.minlength.message}}\r\n </mat-error>\r\n <!-- <mat-error *ngIf=\"group.get(config.name).email?.minlength\">\r\n {{config.validator.email.message}}\r\n </mat-error> -->\r\n\r\n <!-- <div *ngIf=\"form.get(config.name).invalid && (form.get(config.name).dirty || form.get(config.name).touched)\" class=\"alert alert-danger\">\r\n </div> -->\r\n\r\n</div>\r\n\r\n<!-- \r\n\r\n<div [formGroup]=\"formGroup\">\r\n <div class=\"field-wrapper\">\r\n <div [@filedAnimation]=\"mode\">\r\n <mat-form-field class=\"fit\" [(ngClass)]=\"mode\">\r\n <input matInput [matDatepicker]=\"_datepicker\" [placeholder]=\"placeholder\" [formControlName]=\"controlName\">\r\n <mat-datepicker-toggle matSuffix [for]=\"_datepicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #_datepicker></mat-datepicker>\r\n \r\n <mat-icon class=\"tooltip md-18\" *ngIf=\"tooltip\" [matTooltip]=\"tooltip\">help</mat-icon>\r\n </mat-form-field>\r\n <div class=\"value-box\"> \r\n <span class=\"name\">\r\n {{ placeholder }} :\r\n </span>\r\n <span class=\"value\">\r\n {{(DisplayValue$ | async | persianDate)}} \r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div> -->",
1193 styles: [":host{display:block}.mat-form-field{width:100%}"]
1194 }] }
1195 ];
1196 /** @nocollapse */
1197 FileFormInputControlComponent.ctorParameters = function () { return []; };
1198 return FileFormInputControlComponent;
1199}());
1200if (false) {
1201 /** @type {?} */
1202 FileFormInputControlComponent.prototype.config;
1203 /** @type {?} */
1204 FileFormInputControlComponent.prototype.group;
1205}
1206
1207/**
1208 * @fileoverview added by tsickle
1209 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1210 */
1211var FormCaptchaService = /** @class */ (function () {
1212 function FormCaptchaService(http, store, configurationService) {
1213 this.http = http;
1214 this.store = store;
1215 this.configurationService = configurationService;
1216 }
1217 /**
1218 * @return {?}
1219 */
1220 FormCaptchaService.prototype.getCaptcha = /**
1221 * @return {?}
1222 */
1223 function () {
1224 var _this = this;
1225 return this.configurationService.config$.pipe(filter((/**
1226 * @param {?} captcha
1227 * @return {?}
1228 */
1229 function (captcha) { return captcha.endpoints.captchaUrl != ""; })), take(1), switchMap((/**
1230 * @param {?} captcha
1231 * @return {?}
1232 */
1233 function (captcha) {
1234 return _this.http.get(captcha.env.server + captcha.endpoints.captchaUrl);
1235 })), map((/**
1236 * @param {?} response
1237 * @return {?}
1238 */
1239 function (response) { return response.Result; })));
1240 };
1241 /**
1242 * @return {?}
1243 */
1244 FormCaptchaService.prototype.sendCaptcha = /**
1245 * @return {?}
1246 */
1247 function () {
1248 var _this = this;
1249 return this.configurationService.config$.pipe(filter((/**
1250 * @param {?} config
1251 * @return {?}
1252 */
1253 function (config) { return config.endpoints.getList != ""; })), switchMap((/**
1254 * @param {?} config
1255 * @return {?}
1256 */
1257 function (config) { return _this.http.get(config.env.server + config.endpoints.getList); })), map((/**
1258 * @param {?} response
1259 * @return {?}
1260 */
1261 function (response) { return response.Result; })));
1262 };
1263 FormCaptchaService.decorators = [
1264 { type: Injectable, args: [{
1265 providedIn: "root"
1266 },] }
1267 ];
1268 /** @nocollapse */
1269 FormCaptchaService.ctorParameters = function () { return [
1270 { type: HttpClient },
1271 { type: Store },
1272 { type: FormConfigurationService }
1273 ]; };
1274 /** @nocollapse */ FormCaptchaService.ngInjectableDef = ɵɵdefineInjectable({ factory: function FormCaptchaService_Factory() { return new FormCaptchaService(ɵɵinject(HttpClient), ɵɵinject(Store), ɵɵinject(FormConfigurationService)); }, token: FormCaptchaService, providedIn: "root" });
1275 return FormCaptchaService;
1276}());
1277if (false) {
1278 /**
1279 * @type {?}
1280 * @private
1281 */
1282 FormCaptchaService.prototype.http;
1283 /**
1284 * @type {?}
1285 * @private
1286 */
1287 FormCaptchaService.prototype.store;
1288 /**
1289 * @type {?}
1290 * @private
1291 */
1292 FormCaptchaService.prototype.configurationService;
1293}
1294
1295/**
1296 * @fileoverview added by tsickle
1297 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1298 */
1299var CaptchaModel = /** @class */ (function () {
1300 function CaptchaModel(_a) {
1301 var _b = _a === void 0 ? {} : _a, captchaImg = _b.captchaImg, captchaCode = _b.captchaCode;
1302 this.captchaImg = captchaImg + "?" + Math.random();
1303 this.captchaCode = captchaCode || "";
1304 }
1305 return CaptchaModel;
1306}());
1307if (false) {
1308 /** @type {?} */
1309 CaptchaModel.prototype.captchaImg;
1310 /** @type {?} */
1311 CaptchaModel.prototype.captchaCode;
1312}
1313var UpsertCaptchaApiModel;
1314(function (UpsertCaptchaApiModel) {
1315 var Request = /** @class */ (function () {
1316 function Request(initValue) {
1317 var _this = this;
1318 if (initValue === void 0) { initValue = {}; }
1319 Object.keys(initValue).forEach((/**
1320 * @param {?} key
1321 * @return {?}
1322 */
1323 function (key) { return (_this[key] = initValue[key]); }));
1324 }
1325 /**
1326 * @return {?}
1327 */
1328 Request.prototype.getRequestBody = /**
1329 * @return {?}
1330 */
1331 function () {
1332 return this.Captcha.captchaCode;
1333 };
1334 return Request;
1335 }());
1336 UpsertCaptchaApiModel.Request = Request;
1337 if (false) {
1338 /** @type {?} */
1339 Request.prototype.Captcha;
1340 }
1341 var Response = /** @class */ (function () {
1342 function Response() {
1343 }
1344 return Response;
1345 }());
1346 UpsertCaptchaApiModel.Response = Response;
1347 if (false) {
1348 /** @type {?} */
1349 Response.prototype.Result;
1350 }
1351})(UpsertCaptchaApiModel || (UpsertCaptchaApiModel = {}));
1352
1353/**
1354 * @fileoverview added by tsickle
1355 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1356 */
1357var FormCaptchaComponent = /** @class */ (function () {
1358 function FormCaptchaComponent(service, store, configurationService) {
1359 // this.captcha = new CaptchaModel({
1360 // captchaImg: "http://172.22.34.28:8001/api/authentication/captcha"
1361 // });
1362 this.service = service;
1363 this.store = store;
1364 this.configurationService = configurationService;
1365 this._captcha_generate();
1366 }
1367 /**
1368 * @return {?}
1369 */
1370 FormCaptchaComponent.prototype.ngOnInit = /**
1371 * @return {?}
1372 */
1373 function () {
1374 var _this = this;
1375 this.store.select((/**
1376 * @param {?} s
1377 * @return {?}
1378 */
1379 function (s) { return s.authentication.captcha.captcha; })).subscribe((/**
1380 * @param {?} e
1381 * @return {?}
1382 */
1383 function (e) { return _this.refresh(); }));
1384 };
1385 /**
1386 * @return {?}
1387 */
1388 FormCaptchaComponent.prototype.refresh = /**
1389 * @return {?}
1390 */
1391 function () {
1392 this.captcha.captchaImg = this._captcha_generate() + ("?" + Math.random());
1393 };
1394 /**
1395 * @return {?}
1396 */
1397 FormCaptchaComponent.prototype._captcha_generate = /**
1398 * @return {?}
1399 */
1400 function () {
1401 var _this = this;
1402 this.configurationService.config$.pipe(map((/**
1403 * @param {?} config
1404 * @return {?}
1405 */
1406 function (config) { return config.env.server + config.endpoints.captchaUrl; }))).subscribe((/**
1407 * @param {?} captcha
1408 * @return {?}
1409 */
1410 function (captcha) {
1411 _this.captcha = new CaptchaModel({
1412 captchaImg: captcha
1413 });
1414 }));
1415 };
1416 FormCaptchaComponent.decorators = [
1417 { type: Component, args: [{
1418 selector: "lib-form-captcha",
1419 template: "<div fxLayout=\"row wrap\" fxLayoutAlign=\"start center\">\r\n <img [src]=\"captcha.captchaImg\" />\r\n\r\n <button type=\"button\" mat-icon-button color=\"primary\" (click)=\"refresh()\">\r\n <mat-icon>refresh</mat-icon>\r\n </button>\r\n\r\n <div [formGroup]=\"group\">\r\n <mat-form-field fxFlex>\r\n <input matInput [id]=\"config.name\" [placeholder]=\"config.title\" [formControlName]=\"config.name\" />\r\n </mat-form-field>\r\n </div>\r\n</div>",
1420 styles: ["img{border:1px solid #e4e4e4}"]
1421 }] }
1422 ];
1423 /** @nocollapse */
1424 FormCaptchaComponent.ctorParameters = function () { return [
1425 { type: FormCaptchaService },
1426 { type: Store },
1427 { type: FormConfigurationService }
1428 ]; };
1429 return FormCaptchaComponent;
1430}());
1431if (false) {
1432 /** @type {?} */
1433 FormCaptchaComponent.prototype.config;
1434 /** @type {?} */
1435 FormCaptchaComponent.prototype.group;
1436 /** @type {?} */
1437 FormCaptchaComponent.prototype.captcha;
1438 /** @type {?} */
1439 FormCaptchaComponent.prototype.captchaSrc;
1440 /**
1441 * @type {?}
1442 * @private
1443 */
1444 FormCaptchaComponent.prototype.service;
1445 /**
1446 * @type {?}
1447 * @private
1448 */
1449 FormCaptchaComponent.prototype.store;
1450 /**
1451 * @type {?}
1452 * @private
1453 */
1454 FormCaptchaComponent.prototype.configurationService;
1455}
1456
1457/**
1458 * @fileoverview added by tsickle
1459 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1460 */
1461
1462/**
1463 * @fileoverview added by tsickle
1464 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1465 */
1466var FormViewComponent = /** @class */ (function () {
1467 function FormViewComponent(service, compiler, resolver, store) {
1468 var _this = this;
1469 this.service = service;
1470 this.compiler = compiler;
1471 this.resolver = resolver;
1472 this.store = store;
1473 this.unsubscribe = new Subject();
1474 this.accept = new EventEmitter();
1475 this.cancel = new EventEmitter();
1476 this.card = false;
1477 this.formGroupCreated = false;
1478 this.schema$ = new BehaviorSubject$1(undefined);
1479 this.schema$.pipe(takeUntil(this.unsubscribe)).subscribe((/**
1480 * @param {?} schema
1481 * @return {?}
1482 */
1483 function (schema) {
1484 if (!schema)
1485 return;
1486 _this.formGroup = (/** @type {?} */ (_this.createFrom(schema.form)));
1487 if (!schema.form.name)
1488 return;
1489 _this.formGroupCreated = true;
1490 }));
1491 }
1492 Object.defineProperty(FormViewComponent.prototype, "id", {
1493 set: /**
1494 * @param {?} id
1495 * @return {?}
1496 */
1497 function (id) {
1498 var _this = this;
1499 if (!this.local)
1500 this.store.dispatch(new GetFormSchemaAction(id));
1501 this.service
1502 .selectFormById(id)
1503 .pipe(takeUntil(this.unsubscribe))
1504 .subscribe((/**
1505 * @param {?} schema
1506 * @return {?}
1507 */
1508 function (schema) { return _this.schema$.next(schema); }));
1509 },
1510 enumerable: true,
1511 configurable: true
1512 });
1513 Object.defineProperty(FormViewComponent.prototype, "schema", {
1514 set: /**
1515 * @param {?} schema
1516 * @return {?}
1517 */
1518 function (schema) {
1519 this.schema$.next(schema);
1520 },
1521 enumerable: true,
1522 configurable: true
1523 });
1524 /**
1525 * @return {?}
1526 */
1527 FormViewComponent.prototype.ngOnDestroy = /**
1528 * @return {?}
1529 */
1530 function () {
1531 this.unsubscribe.next();
1532 this.unsubscribe.complete();
1533 };
1534 /**
1535 * @param {?} schema
1536 * @return {?}
1537 */
1538 FormViewComponent.prototype.generate = /**
1539 * @param {?} schema
1540 * @return {?}
1541 */
1542 function (schema) {
1543 this.schema$.next(schema);
1544 };
1545 /**
1546 * @param {?} data
1547 * @param {?=} parentPath
1548 * @return {?}
1549 */
1550 FormViewComponent.prototype.createFrom = /**
1551 * @param {?} data
1552 * @param {?=} parentPath
1553 * @return {?}
1554 */
1555 function (data, parentPath) {
1556 var _this = this;
1557 if (parentPath === void 0) { parentPath = ""; }
1558 if (data.type == "control") {
1559 /** @type {?} */
1560 var formGroupPath = void 0;
1561 if (data.parentType == "array") {
1562 // parentPath = `${parentPath}.controls[${(data as FieldConfig).name}]`;
1563 }
1564 else if (data.parentType == "group") {
1565 formGroupPath = parentPath;
1566 parentPath = parentPath + ".controls." + ((/** @type {?} */ (data))).name;
1567 }
1568 /** @type {?} */
1569 var validators = [];
1570 if (data.validator.required && data.validator.required.active) {
1571 validators.push(Validators.required);
1572 }
1573 if (data.validator.minlength && data.validator.minlength.active) {
1574 validators.push(Validators.minLength(data.validator.minlength.value));
1575 }
1576 if (data.validator.email && data.validator.email.active) {
1577 validators.push(Validators.email);
1578 }
1579 /** @type {?} */
1580 var ctr = new FormControl(data.value, validators);
1581 ((/** @type {?} */ (ctr))).schema = data;
1582 ((/** @type {?} */ (ctr))).schema.path = parentPath;
1583 ((/** @type {?} */ (ctr))).schema.formGroupPath = formGroupPath;
1584 return ctr;
1585 }
1586 else if (data.type == "group") {
1587 /** @type {?} */
1588 var formGroup_1 = new FormGroup({});
1589 if (data.parentType == undefined) {
1590 parentPath = ((/** @type {?} */ (data))).name;
1591 }
1592 else if (data.parentType == "array") {
1593 parentPath = parentPath + ".controls[" + ((/** @type {?} */ (data))).name + "]";
1594 }
1595 else if (data.parentType == "group") {
1596 parentPath = parentPath + ".controls." + ((/** @type {?} */ (data))).name;
1597 }
1598 ((/** @type {?} */ (formGroup_1))).schema = data;
1599 ((/** @type {?} */ (formGroup_1))).schema.path = parentPath;
1600 data.fields.forEach((/**
1601 * @param {?} item
1602 * @return {?}
1603 */
1604 function (item) {
1605 item.parentType = "group";
1606 formGroup_1.addControl(item.name, _this.createFrom(item, parentPath));
1607 }));
1608 return formGroup_1;
1609 }
1610 else {
1611 /** @type {?} */
1612 var formArray_1 = new FormArray([]);
1613 parentPath =
1614 parentPath == "" ? ((/** @type {?} */ (data))).name : parentPath + ".controls." + ((/** @type {?} */ (data))).name;
1615 ((/** @type {?} */ (formArray_1))).schema = data;
1616 ((/** @type {?} */ (formArray_1))).schema.path = parentPath;
1617 data.fields.forEach((/**
1618 * @param {?} item
1619 * @param {?} idx
1620 * @return {?}
1621 */
1622 function (item, idx) {
1623 item.parentType = "array";
1624 item.name = idx.toString();
1625 formArray_1.controls.push(_this.createFrom(item, parentPath));
1626 }));
1627 return formArray_1;
1628 }
1629 };
1630 /**
1631 * @return {?}
1632 */
1633 FormViewComponent.prototype.accepted = /**
1634 * @return {?}
1635 */
1636 function () {
1637 this.accept.emit(this.formGroup);
1638 };
1639 /**
1640 * @return {?}
1641 */
1642 FormViewComponent.prototype.canceled = /**
1643 * @return {?}
1644 */
1645 function () {
1646 this.cancel.emit(this.formGroup);
1647 };
1648 FormViewComponent.decorators = [
1649 { type: Component, args: [{
1650 selector: "ngs-form-view",
1651 template: "<div fxFlex=\"nogrow\" fxLayoutAlign=\"center center\" class=\"main-container\">\r\n <form *ngIf=\"formGroupCreated && card\" class=\"ngs-dynamic-form\" [formGroup]=\"formGroup\" (ngSubmit)=\"accepted()\">\r\n <mat-card>\r\n <mat-card-title>\r\n {{(schema$ | async)?.name}}\r\n </mat-card-title>\r\n <mat-card-content fxLayout=\"row wrap\" fxLayoutGap=\"25px\">\r\n <div *ngFor=\"let field of (schema$ | async)?.form.fields;\" [fxFlex]=\"field.width * 10\">\r\n <ng-container *ngIf=\"field && field.inputType\" dynamicField [config]=\"field\" [group]=\"formGroup\"></ng-container>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions align=\"end\">\r\n <button type=\"button\" *ngIf=\"(schema$ | async)?.events.cancel.show\" (click)=\"cancel.emit()\" mat-button color=\"primary\">{{(schema$\r\n | async)?.events.cancel.text}}</button>\r\n <button type=\"submit\" *ngIf=\"(schema$ | async)?.events.accept.show\" mat-raised-button color=\"primary\">{{(schema$\r\n | async)?.events.accept.text}}</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form>\r\n <form *ngIf=\"formGroupCreated && !card\" class=\"ngs-dynamic-form\" [formGroup]=\"formGroup\" (ngSubmit)=\"accepted()\">\r\n <div>\r\n <h3>\r\n {{(schema$ | async)?.name}}\r\n </h3>\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"5px\">\r\n <div *ngFor=\"let field of (schema$ | async)?.form.fields;\" [fxFlex]=\"field.width * 10\">\r\n <ng-container dynamicField [config]=\"field\" [group]=\"formGroup\"></ng-container>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" *ngIf=\"(schema$ | async)?.events.cancel.show\" (click)=\"cancel.emit()\" mat-button color=\"primary\">{{(schema$\r\n | async)?.events.cancel.text}}</button>\r\n <button type=\"submit\" *ngIf=\"(schema$ | async)?.events.accept.show\" mat-raised-button color=\"primary\">{{(schema$\r\n | async)?.events.accept.text}}</button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n</div>",
1652 styles: [""]
1653 }] }
1654 ];
1655 /** @nocollapse */
1656 FormViewComponent.ctorParameters = function () { return [
1657 { type: FormService },
1658 { type: Compiler },
1659 { type: ComponentFactoryResolver },
1660 { type: Store }
1661 ]; };
1662 FormViewComponent.propDecorators = {
1663 accept: [{ type: Output }],
1664 cancel: [{ type: Output }],
1665 local: [{ type: Input }],
1666 card: [{ type: Input }],
1667 id: [{ type: Input }],
1668 schema: [{ type: Input }]
1669 };
1670 return FormViewComponent;
1671}());
1672if (false) {
1673 /** @type {?} */
1674 FormViewComponent.prototype.unsubscribe;
1675 /** @type {?} */
1676 FormViewComponent.prototype.accept;
1677 /** @type {?} */
1678 FormViewComponent.prototype.cancel;
1679 /** @type {?} */
1680 FormViewComponent.prototype.local;
1681 /** @type {?} */
1682 FormViewComponent.prototype.card;
1683 /** @type {?} */
1684 FormViewComponent.prototype._id;
1685 /** @type {?} */
1686 FormViewComponent.prototype.formGroup;
1687 /** @type {?} */
1688 FormViewComponent.prototype.formGroupCreated;
1689 /** @type {?} */
1690 FormViewComponent.prototype.schema$;
1691 /**
1692 * @type {?}
1693 * @private
1694 */
1695 FormViewComponent.prototype.service;
1696 /**
1697 * @type {?}
1698 * @private
1699 */
1700 FormViewComponent.prototype.compiler;
1701 /**
1702 * @type {?}
1703 * @private
1704 */
1705 FormViewComponent.prototype.resolver;
1706 /**
1707 * @type {?}
1708 * @private
1709 */
1710 FormViewComponent.prototype.store;
1711}
1712/** @type {?} */
1713var components = {
1714 checkbox: CheckboxComponent,
1715 text: TextComponent,
1716 password: TextComponent,
1717 date: DateFormInputControlComponent,
1718 file: FileFormInputControlComponent,
1719 table: TableComponent,
1720 color: ColorComponent,
1721 email: EmailComponent,
1722 captcha: FormCaptchaComponent,
1723 select: SelectComponent
1724};
1725var DynamicFieldDirective = /** @class */ (function () {
1726 function DynamicFieldDirective(resolver, container) {
1727 this.resolver = resolver;
1728 this.container = container;
1729 }
1730 /**
1731 * @return {?}
1732 */
1733 DynamicFieldDirective.prototype.ngOnChanges = /**
1734 * @return {?}
1735 */
1736 function () {
1737 if (this.component) {
1738 this.component.instance.config = this.config;
1739 this.component.instance.group = this.group;
1740 }
1741 };
1742 /**
1743 * @return {?}
1744 */
1745 DynamicFieldDirective.prototype.ngOnInit = /**
1746 * @return {?}
1747 */
1748 function () {
1749 if (this.config.inputType == undefined)
1750 return;
1751 if (!components[this.config.inputType]) {
1752 /** @type {?} */
1753 var supportedTypes = Object.keys(components).join(", ");
1754 throw new Error("Trying to use an unsupported type (" + this.config.inputType + ").\n\t\t Supported types: " + supportedTypes);
1755 }
1756 /** @type {?} */
1757 var component = this.resolver.resolveComponentFactory(components[this.config.inputType]);
1758 this.component = this.container.createComponent(component);
1759 this.component.instance.config = this.config;
1760 this.component.instance.group = this.group;
1761 };
1762 DynamicFieldDirective.decorators = [
1763 { type: Directive, args: [{
1764 selector: "[dynamicField]"
1765 },] }
1766 ];
1767 /** @nocollapse */
1768 DynamicFieldDirective.ctorParameters = function () { return [
1769 { type: ComponentFactoryResolver },
1770 { type: ViewContainerRef }
1771 ]; };
1772 DynamicFieldDirective.propDecorators = {
1773 config: [{ type: Input }],
1774 group: [{ type: Input }]
1775 };
1776 return DynamicFieldDirective;
1777}());
1778if (false) {
1779 /** @type {?} */
1780 DynamicFieldDirective.prototype.config;
1781 /** @type {?} */
1782 DynamicFieldDirective.prototype.group;
1783 /** @type {?} */
1784 DynamicFieldDirective.prototype.component;
1785 /**
1786 * @type {?}
1787 * @private
1788 */
1789 DynamicFieldDirective.prototype.resolver;
1790 /**
1791 * @type {?}
1792 * @private
1793 */
1794 DynamicFieldDirective.prototype.container;
1795}
1796
1797/**
1798 * @fileoverview added by tsickle
1799 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1800 */
1801/**
1802 * @record
1803 */
1804function State() { }
1805if (false) {
1806 /** @type {?} */
1807 State.prototype.status;
1808 /** @type {?} */
1809 State.prototype.data;
1810}
1811var ɵ0 = [];
1812/** @type {?} */
1813var initialState = {
1814 status: "pristine",
1815 data: ɵ0
1816};
1817/**
1818 * @param {?=} state
1819 * @param {?=} action
1820 * @return {?}
1821 */
1822function reducer(state, action) {
1823 if (state === void 0) { state = initialState; }
1824 switch (action.type) {
1825 case FormsListActionTypes.FORMS_LIST: {
1826 return __assign({}, state, { status: "dirty" });
1827 }
1828 case FormsListActionTypes.FORMS_LIST_START: {
1829 return __assign({}, state, { status: "pending" });
1830 }
1831 case FormsListActionTypes.FORMS_LIST_SUCCEED: {
1832 return __assign({}, state, { data: action.payload, status: "succeed" });
1833 }
1834 case FormsListActionTypes.FORMS_LIST_FAILED: {
1835 return __assign({}, state, { status: "failed" });
1836 }
1837 case FormsListActionTypes.FORM_SCHEMA_UPDATE: {
1838 /** @type {?} */
1839 var data = state.data.concat();
1840 /** @type {?} */
1841 var entityIdx = state.data.findIndex((/**
1842 * @param {?} form
1843 * @return {?}
1844 */
1845 function (form) { return form._id == action.payload._id; }));
1846 if (entityIdx > -1) {
1847 data[entityIdx] = Object.assign({}, data[entityIdx], action.payload);
1848 }
1849 else {
1850 data.push(action.payload);
1851 }
1852 return __assign({}, state, { data: data });
1853 }
1854 case FormsListActionTypes.ADD_FORM_SCHEMA: {
1855 /** @type {?} */
1856 var data = state.data.concat();
1857 /** @type {?} */
1858 var entityIdx = state.data.findIndex((/**
1859 * @param {?} form
1860 * @return {?}
1861 */
1862 function (form) { return form._id == action.payload._id; }));
1863 if (entityIdx > -1) {
1864 data[entityIdx] = Object.assign({}, data[entityIdx], action.payload);
1865 }
1866 else {
1867 data.push(action.payload);
1868 }
1869 return __assign({}, state, { data: data });
1870 }
1871 case FormsListActionTypes.FORM_SCHEMA_FETCHED: {
1872 /** @type {?} */
1873 var data = state.data.concat();
1874 /** @type {?} */
1875 var entityIdx = state.data.findIndex((/**
1876 * @param {?} form
1877 * @return {?}
1878 */
1879 function (form) { return form._id == action.payload._id; }));
1880 if (entityIdx > -1) {
1881 data[entityIdx] = Object.assign({}, data[entityIdx], action.payload);
1882 }
1883 else {
1884 data.push(action.payload);
1885 }
1886 return __assign({}, state, { data: data });
1887 }
1888 default: {
1889 return state;
1890 }
1891 }
1892}
1893/** @type {?} */
1894var getStatus = (/**
1895 * @param {?} state
1896 * @return {?}
1897 */
1898function (state) { return state.status; });
1899
1900/**
1901 * @fileoverview added by tsickle
1902 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1903 */
1904/**
1905 * @record
1906 */
1907function FormState() { }
1908if (false) {
1909 /** @type {?} */
1910 FormState.prototype.list;
1911}
1912/** @type {?} */
1913var FormReducers = {
1914 list: reducer
1915};
1916/**
1917 * @record
1918 */
1919function MainContainerState() { }
1920if (false) {
1921 /** @type {?} */
1922 MainContainerState.prototype.form;
1923}
1924
1925/**
1926 * @fileoverview added by tsickle
1927 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1928 */
1929var FormGroupComponent = /** @class */ (function () {
1930 function FormGroupComponent() {
1931 this.noHeader = false;
1932 this.changes = new EventEmitter();
1933 this.delete = new EventEmitter();
1934 }
1935 /**
1936 * @return {?}
1937 */
1938 FormGroupComponent.prototype.changed = /**
1939 * @return {?}
1940 */
1941 function () {
1942 this.changes.emit();
1943 };
1944 /**
1945 * @param {?} root
1946 * @return {?}
1947 */
1948 FormGroupComponent.prototype.addFormGroup = /**
1949 * @param {?} root
1950 * @return {?}
1951 */
1952 function (root) {
1953 /** @type {?} */
1954 var group = new FieldConfig("group");
1955 group.fields = [];
1956 root.fields.push(group);
1957 this.schema.id = this.schema.id + 1;
1958 return group;
1959 };
1960 /**
1961 * @param {?} root
1962 * @return {?}
1963 */
1964 FormGroupComponent.prototype.addFormArray = /**
1965 * @param {?} root
1966 * @return {?}
1967 */
1968 function (root) {
1969 /** @type {?} */
1970 var array = new FieldConfig("array");
1971 array.fields = [];
1972 root.fields.push(array);
1973 return array;
1974 };
1975 /**
1976 * @param {?} root
1977 * @return {?}
1978 */
1979 FormGroupComponent.prototype.addFormControl = /**
1980 * @param {?} root
1981 * @return {?}
1982 */
1983 function (root) {
1984 /** @type {?} */
1985 var control = new FieldConfig("control");
1986 root.fields.push(control);
1987 return control;
1988 };
1989 /**
1990 * @param {?} idx
1991 * @return {?}
1992 */
1993 FormGroupComponent.prototype.deleteFormGroup = /**
1994 * @param {?} idx
1995 * @return {?}
1996 */
1997 function (idx) {
1998 this.schema.fields.splice(idx, 1);
1999 };
2000 FormGroupComponent.decorators = [
2001 { type: Component, args: [{
2002 selector: "app-form-group",
2003 template: "<div>\r\n\r\n <mat-form-field *ngIf=\"!noHeader\">\r\n <input matInput [(ngModel)]=\"schema.name\" placeholder=\"Name\">\r\n </mat-form-field>\r\n\r\n <mat-form-field *ngIf=\"!noHeader\">\r\n <input matInput [(ngModel)]=\"schema.title\" placeholder=\"\u0639\u0646\u0648\u0627\u0646\">\r\n </mat-form-field>\r\n\r\n <div class=\"button-row\">\r\n <button mat-button color=\"primary\" (click)=\"addFormGroup(schema)\"> addFormGroup </button>\r\n <button mat-button color=\"primary\" (click)=\"addFormArray(schema)\"> addFormArray </button>\r\n <button mat-button color=\"primary\" (click)=\"addFormControl(schema)\">addFormControl</button>\r\n </div>\r\n\r\n <div *ngFor=\"let field of schema.fields;let i = index\">\r\n <div [ngSwitch]=\"field.type\">\r\n <app-form-group *ngSwitchCase=\"'group'\" [schema]=\"field\" (change)=\"changed()\"></app-form-group>\r\n <!-- <app-form-array *ngSwitchCase=\"'array'\" [schema]=\"field\" (change)=\"changed()\"></app-form-array> -->\r\n <app-form-control *ngSwitchCase=\"'control'\" [schema]=\"field\" (changes)=\"changed()\" (delete)=\"deleteFormGroup(i)\"></app-form-control>\r\n </div>\r\n </div>\r\n</div>"
2004 }] }
2005 ];
2006 /** @nocollapse */
2007 FormGroupComponent.ctorParameters = function () { return []; };
2008 FormGroupComponent.propDecorators = {
2009 schema: [{ type: Input }],
2010 noHeader: [{ type: Input }],
2011 changes: [{ type: Output }],
2012 delete: [{ type: Output }]
2013 };
2014 return FormGroupComponent;
2015}());
2016if (false) {
2017 /** @type {?} */
2018 FormGroupComponent.prototype.schema;
2019 /** @type {?} */
2020 FormGroupComponent.prototype.noHeader;
2021 /** @type {?} */
2022 FormGroupComponent.prototype.changes;
2023 /** @type {?} */
2024 FormGroupComponent.prototype.delete;
2025}
2026
2027/**
2028 * @fileoverview added by tsickle
2029 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2030 */
2031var FormArrayComponent = /** @class */ (function () {
2032 function FormArrayComponent() {
2033 this.changes = new EventEmitter();
2034 }
2035 /**
2036 * @return {?}
2037 */
2038 FormArrayComponent.prototype.changed = /**
2039 * @return {?}
2040 */
2041 function () {
2042 this.changes.emit();
2043 };
2044 /**
2045 * @param {?} root
2046 * @return {?}
2047 */
2048 FormArrayComponent.prototype.addFormGroup = /**
2049 * @param {?} root
2050 * @return {?}
2051 */
2052 function (root) {
2053 /** @type {?} */
2054 var group = new FieldConfig("group");
2055 group.fields = [];
2056 root.fields.push(group);
2057 return group;
2058 };
2059 /**
2060 * @param {?} root
2061 * @return {?}
2062 */
2063 FormArrayComponent.prototype.addFormArray = /**
2064 * @param {?} root
2065 * @return {?}
2066 */
2067 function (root) {
2068 /** @type {?} */
2069 var array = new FieldConfig("array");
2070 array.fields = [];
2071 root.fields.push(array);
2072 return array;
2073 };
2074 /**
2075 * @param {?} root
2076 * @return {?}
2077 */
2078 FormArrayComponent.prototype.addFormControl = /**
2079 * @param {?} root
2080 * @return {?}
2081 */
2082 function (root) {
2083 /** @type {?} */
2084 var control = new FieldConfig("control");
2085 root.fields.push(control);
2086 return control;
2087 };
2088 FormArrayComponent.decorators = [
2089 { type: Component, args: [{
2090 selector: "app-form-array",
2091 template: "<mat-card>\r\n <mat-card-content>\r\n <mat-form-field>\r\n <input matInput [(ngModel)]=\"schema.name\" placeholder=\"Name\">\r\n </mat-form-field>\r\n \r\n <div class=\"button-row\">\r\n <button mat-button color=\"primary\" (click)=\"addFormGroup(schema)\">addFormGroup</button>\r\n <button mat-button color=\"primary\" (click)=\"addFormArray(schema)\">addFormArray</button>\r\n <!-- <button mat-button color=\"primary\" (click)=\"addFormControl(schema)\">addFormControl</button> -->\r\n </div>\r\n \r\n <div *ngFor=\"let field of schema.fields\">\r\n <div [ngSwitch]=\"field.type\">\r\n <app-form-group *ngSwitchCase=\"'group'\" [schema]=\"field\" (changes)=\"changed()\"></app-form-group>\r\n <app-form-array *ngSwitchCase=\"'array'\" [schema]=\"field\" (changes)=\"changed()\"></app-form-array>\r\n <!-- <app-form-control *ngSwitchCase=\"'control'\" [schema]=\"field\" (change)=\"changed($event)\"></app-form-control> -->\r\n </div>\r\n </div>\r\n \r\n </mat-card-content>\r\n</mat-card>"
2092 }] }
2093 ];
2094 /** @nocollapse */
2095 FormArrayComponent.ctorParameters = function () { return []; };
2096 FormArrayComponent.propDecorators = {
2097 schema: [{ type: Input }],
2098 changes: [{ type: Output }]
2099 };
2100 return FormArrayComponent;
2101}());
2102if (false) {
2103 /** @type {?} */
2104 FormArrayComponent.prototype.schema;
2105 /** @type {?} */
2106 FormArrayComponent.prototype.changes;
2107}
2108
2109/**
2110 * @fileoverview added by tsickle
2111 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2112 */
2113var FormControlComponent = /** @class */ (function () {
2114 function FormControlComponent() {
2115 this.changes = new EventEmitter();
2116 this.delete = new EventEmitter();
2117 this.width = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
2118 this.options = new FormArray([
2119 new FormGroup({
2120 key: new FormControl(),
2121 value: new FormControl()
2122 })
2123 ]);
2124 this.tableOptions = new FormGroup({
2125 dataEndpoint: new FormControl("")
2126 });
2127 }
2128 /**
2129 * @return {?}
2130 */
2131 FormControlComponent.prototype.changed = /**
2132 * @return {?}
2133 */
2134 function () {
2135 if ([this.schema.name, this.schema.title, this.schema.inputType].some((/**
2136 * @param {?} item
2137 * @return {?}
2138 */
2139 function (item) { return !item; })))
2140 return true;
2141 if (this.schema.inputType == "table") {
2142 this.schema.options = this.tableOptions.value;
2143 }
2144 else if (this.schema.inputType == "select") {
2145 this.schema.options = this.options.value;
2146 }
2147 this.changes.emit();
2148 };
2149 /**
2150 * @return {?}
2151 */
2152 FormControlComponent.prototype.addOption = /**
2153 * @return {?}
2154 */
2155 function () {
2156 this.options.push(new FormGroup({
2157 key: new FormControl(),
2158 value: new FormControl()
2159 }));
2160 };
2161 /**
2162 * @param {?} i
2163 * @return {?}
2164 */
2165 FormControlComponent.prototype.removeOption = /**
2166 * @param {?} i
2167 * @return {?}
2168 */
2169 function (i) {
2170 this.options.controls.splice(i, 1);
2171 };
2172 /**
2173 * @return {?}
2174 */
2175 FormControlComponent.prototype.insertOptions = /**
2176 * @return {?}
2177 */
2178 function () {
2179 this.schema.options = this.options.value;
2180 };
2181 FormControlComponent.decorators = [
2182 { type: Component, args: [{
2183 selector: "app-form-control",
2184 template: "<mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title fxLayout=\"row\" fxLayoutAlign=\"start center\">\r\n <button mat-icon-button (click)=\"delete.emit()\">\r\n <mat-icon aria-label=\"icon-button\">delete_forever</mat-icon>\r\n </button>\r\n <span>{{schema.name}}</span>\r\n\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"10px\">\r\n <mat-form-field fxFlex>\r\n <input matInput [(ngModel)]=\"schema.name\" (change)=\"changed()\" placeholder=\"Name\">\r\n </mat-form-field>\r\n\r\n <mat-form-field fxFlex>\r\n <input matInput [(ngModel)]=\"schema.title\" (change)=\"changed()\" placeholder=\"Placeholder\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field fxFlex>\r\n <mat-select [(ngModel)]=\"schema.inputType\" (change)=\"changed()\" placeholder=\"Input Type\">\r\n <mat-option value=\"table\">table</mat-option>\r\n <mat-option value=\"select\">select</mat-option>\r\n <mat-option value=\"text\">text</mat-option>\r\n <mat-option value=\"number\">number</mat-option>\r\n <mat-option value=\"email\">email</mat-option>\r\n <mat-option value=\"color\">color</mat-option>\r\n <mat-option value=\"radio\">radio</mat-option>\r\n <mat-option value=\"checkbox\">checkbox</mat-option>\r\n <mat-option value=\"checkbox\">captcha</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"10px\">\r\n <mat-form-field fxFlex>\r\n <input matInput [(ngModel)]=\"schema.value\" (change)=\"changed()\" placeholder=\"Value\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field fxFlex>\r\n <mat-select [(ngModel)]=\"schema.width\" (change)=\"changed()\" placeholder=\"width\">\r\n <mat-option *ngFor=\"let item of width\" [value]=\"item\">{{item}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <div fxLayout=\"column\" fxLayoutGap=\"10px\">\r\n <div *ngIf=\"schema.inputType=='table'\" [formGroup]=\"tableOptions\">\r\n <mat-form-field>\r\n <input matInput (change)=\"changed()\" formControlName=\"dataEndpoint\" placeholder=\"dataEndpoint\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div *ngIf=\"schema.inputType=='select'\">\r\n [options]\r\n <button (click)=\"addOption()\">+</button>\r\n <button (click)=\"insertOptions()\">insert</button>\r\n <div *ngFor=\"let option of options.controls;index as i\">\r\n {{i}}\r\n <div [formGroup]=\"options.controls[i]\">\r\n <mat-form-field>\r\n <input matInput (change)=\"changed()\" formControlName=\"key\" placeholder=\"key\" />\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput (change)=\"changed()\" formControlName=\"value\" placeholder=\"value\" />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n <br />\r\n <mat-card fxLayout=\"column\">\r\n <mat-slide-toggle (change)=\"changed()\" [(ngModel)]=\"schema.validator.required.active\">\u0627\u062C\u0628\u0627\u0631\u06CC</mat-slide-toggle>\r\n <mat-form-field>\r\n <input matInput (change)=\"changed()\" [(ngModel)]=\"schema.validator.required.message\" placeholder=\"\u067E\u06CC\u063A\u0627\u0645\" />\r\n </mat-form-field>\r\n </mat-card>\r\n <mat-card fxLayout=\"column\">\r\n <mat-slide-toggle (change)=\"changed()\" [(ngModel)]=\"schema.validator.email.active\">\u0627\u06CC\u0645\u06CC\u0644</mat-slide-toggle>\r\n <mat-form-field>\r\n <input matInput (change)=\"changed()\" [(ngModel)]=\"schema.validator.email.message\" placeholder=\"\u067E\u06CC\u063A\u0627\u0645\" />\r\n </mat-form-field>\r\n </mat-card>\r\n <mat-card fxLayout=\"column\">\r\n <mat-slide-toggle (change)=\"changed()\" [(ngModel)]=\"schema.validator.minlength.active\">\u062D\u062F\u0627\u0642\u0644 \u062A\u0639\u062F\u0627\u062F \u06A9\u0627\u0631\u0627\u06A9\u062A\u0631</mat-slide-toggle>\r\n <mat-form-field>\r\n <input matInput (change)=\"changed()\" [(ngModel)]=\"schema.validator.minlength.message\" placeholder=\"\u067E\u06CC\u063A\u0627\u0645\" />\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput (change)=\"changed()\" [(ngModel)]=\"schema.validator.minlength.value\" placeholder=\"\u062A\u0639\u062F\u0627\u062F \u062D\u062F\u0627\u0642\u0644 \u06A9\u0627\u0631\u0627\u06A9\u062A\u0631\" />\r\n </mat-form-field>\r\n </mat-card>\r\n </div>\r\n</mat-expansion-panel>"
2185 }] }
2186 ];
2187 /** @nocollapse */
2188 FormControlComponent.ctorParameters = function () { return []; };
2189 FormControlComponent.propDecorators = {
2190 schema: [{ type: Input }],
2191 changes: [{ type: Output }],
2192 delete: [{ type: Output }]
2193 };
2194 return FormControlComponent;
2195}());
2196if (false) {
2197 /** @type {?} */
2198 FormControlComponent.prototype.schema;
2199 /** @type {?} */
2200 FormControlComponent.prototype.changes;
2201 /** @type {?} */
2202 FormControlComponent.prototype.delete;
2203 /** @type {?} */
2204 FormControlComponent.prototype.width;
2205 /** @type {?} */
2206 FormControlComponent.prototype.options;
2207 /** @type {?} */
2208 FormControlComponent.prototype.tableOptions;
2209}
2210
2211/**
2212 * @fileoverview added by tsickle
2213 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2214 */
2215/** @enum {string} */
2216var EditFormActionTypes = {
2217 EDIT_FORM: "[FORM][EDIT] EDIT_FORM",
2218 EDIT_FORM_START: "[FORM][EDIT] EDIT_FORM_START",
2219 EDIT_FORM_SUCCEED: "[FORM][EDIT] EDIT_FORM_SUCCEED",
2220 EDIT_FORM_FAILED: "[FORM][EDIT] EDIT_FORM_FAILED",
2221};
2222var EditFormAction = /** @class */ (function () {
2223 function EditFormAction(payload) {
2224 this.payload = payload;
2225 this.type = EditFormActionTypes.EDIT_FORM;
2226 }
2227 return EditFormAction;
2228}());
2229if (false) {
2230 /** @type {?} */
2231 EditFormAction.prototype.type;
2232 /** @type {?} */
2233 EditFormAction.prototype.payload;
2234}
2235var EditFormStartAction = /** @class */ (function () {
2236 function EditFormStartAction(payload) {
2237 this.payload = payload;
2238 this.type = EditFormActionTypes.EDIT_FORM_START;
2239 }
2240 return EditFormStartAction;
2241}());
2242if (false) {
2243 /** @type {?} */
2244 EditFormStartAction.prototype.type;
2245 /** @type {?} */
2246 EditFormStartAction.prototype.payload;
2247}
2248var EditFormSucceedAction = /** @class */ (function () {
2249 function EditFormSucceedAction(payload) {
2250 this.payload = payload;
2251 this.type = EditFormActionTypes.EDIT_FORM_SUCCEED;
2252 }
2253 return EditFormSucceedAction;
2254}());
2255if (false) {
2256 /** @type {?} */
2257 EditFormSucceedAction.prototype.type;
2258 /** @type {?} */
2259 EditFormSucceedAction.prototype.payload;
2260}
2261var EditFormFailedAction = /** @class */ (function () {
2262 function EditFormFailedAction() {
2263 this.type = EditFormActionTypes.EDIT_FORM_FAILED;
2264 }
2265 return EditFormFailedAction;
2266}());
2267if (false) {
2268 /** @type {?} */
2269 EditFormFailedAction.prototype.type;
2270}
2271
2272/**
2273 * @fileoverview added by tsickle
2274 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2275 */
2276/** @enum {string} */
2277var AddFormActionTypes = {
2278 ADD_FORM: "[FORM][ADD] ADD_FORM_PROFILE",
2279 ADD_FORM_START: "[FORM][ADD] ADD_FORM_START",
2280 ADD_FORM_SUCCEED: "[FORM][ADD] ADD_FORM_SUCCEED",
2281 ADD_FORM_FAILED: "[FORM][ADD] ADD_FORM_FAILED",
2282};
2283var AddFormAction = /** @class */ (function () {
2284 function AddFormAction(payload) {
2285 this.payload = payload;
2286 this.type = AddFormActionTypes.ADD_FORM;
2287 }
2288 return AddFormAction;
2289}());
2290if (false) {
2291 /** @type {?} */
2292 AddFormAction.prototype.type;
2293 /** @type {?} */
2294 AddFormAction.prototype.payload;
2295}
2296var AddFormStartAction = /** @class */ (function () {
2297 function AddFormStartAction(payload) {
2298 this.payload = payload;
2299 this.type = AddFormActionTypes.ADD_FORM_START;
2300 }
2301 return AddFormStartAction;
2302}());
2303if (false) {
2304 /** @type {?} */
2305 AddFormStartAction.prototype.type;
2306 /** @type {?} */
2307 AddFormStartAction.prototype.payload;
2308}
2309var AddFormSucceedAction = /** @class */ (function () {
2310 function AddFormSucceedAction() {
2311 this.type = AddFormActionTypes.ADD_FORM_SUCCEED;
2312 }
2313 return AddFormSucceedAction;
2314}());
2315if (false) {
2316 /** @type {?} */
2317 AddFormSucceedAction.prototype.type;
2318}
2319var AddFormFailedAction = /** @class */ (function () {
2320 function AddFormFailedAction() {
2321 this.type = AddFormActionTypes.ADD_FORM_FAILED;
2322 }
2323 return AddFormFailedAction;
2324}());
2325if (false) {
2326 /** @type {?} */
2327 AddFormFailedAction.prototype.type;
2328}
2329
2330/**
2331 * @fileoverview added by tsickle
2332 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2333 */
2334var AddFormContainerComponent = /** @class */ (function () {
2335 function AddFormContainerComponent(store, service) {
2336 this.store = store;
2337 this.service = service;
2338 }
2339 /**
2340 * @return {?}
2341 */
2342 AddFormContainerComponent.prototype.ngOnInit = /**
2343 * @return {?}
2344 */
2345 function () {
2346 this.schema = new FormSchemaModel();
2347 this.schema.init();
2348 this.store.dispatch(new AddFormSchemaAction(this.schema));
2349 };
2350 /**
2351 * @param {?} form
2352 * @return {?}
2353 */
2354 AddFormContainerComponent.prototype.add = /**
2355 * @param {?} form
2356 * @return {?}
2357 */
2358 function (form) {
2359 this.store.dispatch(new AddFormAction(form));
2360 };
2361 /**
2362 * @param {?} form
2363 * @return {?}
2364 */
2365 AddFormContainerComponent.prototype.update_schema = /**
2366 * @param {?} form
2367 * @return {?}
2368 */
2369 function (form) {
2370 this.store.dispatch(new UpdateFormSchemaAction(form));
2371 };
2372 AddFormContainerComponent.decorators = [
2373 { type: Component, args: [{
2374 template: "<ngs-form-add \n\t\t\t\t\t[schema]=\"schema\" \n\t\t\t\t\t(changes)=\"update_schema($event)\" \n\t\t\t\t\t(submited)=add($event)\n\t\t\t\t></ngs-form-add>"
2375 }] }
2376 ];
2377 /** @nocollapse */
2378 AddFormContainerComponent.ctorParameters = function () { return [
2379 { type: Store },
2380 { type: FormService }
2381 ]; };
2382 return AddFormContainerComponent;
2383}());
2384if (false) {
2385 /** @type {?} */
2386 AddFormContainerComponent.prototype.schema;
2387 /** @type {?} */
2388 AddFormContainerComponent.prototype.store;
2389 /** @type {?} */
2390 AddFormContainerComponent.prototype.service;
2391}
2392
2393/**
2394 * @fileoverview added by tsickle
2395 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2396 */
2397
2398/**
2399 * @fileoverview added by tsickle
2400 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2401 */
2402var EditFormContainerComponent = /** @class */ (function (_super) {
2403 __extends(EditFormContainerComponent, _super);
2404 function EditFormContainerComponent(service, route, store) {
2405 var _this = _super.call(this, store, service) || this;
2406 _this.service = service;
2407 _this.route = route;
2408 _this.store = store;
2409 _this.formGroup = EditFormApiModel.Request.formGroup;
2410 return _this;
2411 }
2412 /**
2413 * @return {?}
2414 */
2415 EditFormContainerComponent.prototype.ngOnInit = /**
2416 * @return {?}
2417 */
2418 function () {
2419 var _this = this;
2420 this.route.params
2421 .map((/**
2422 * @param {?} params
2423 * @return {?}
2424 */
2425 function (params) { return params["_id"]; }))
2426 .subscribe((/**
2427 * @param {?} id
2428 * @return {?}
2429 */
2430 function (id) { return _this.store.dispatch(new GetFormSchemaAction(id)); }));
2431 this.route.params
2432 .map((/**
2433 * @param {?} params
2434 * @return {?}
2435 */
2436 function (params) { return params["_id"]; }))
2437 .switchMap((/**
2438 * @param {?} id
2439 * @return {?}
2440 */
2441 function (id) { return _this.service.selectFormById(id); }))
2442 .filter((/**
2443 * @param {?} data
2444 * @return {?}
2445 */
2446 function (data) { return data != null; }))
2447 .take(1)
2448 .subscribe((/**
2449 * @param {?} formSchema
2450 * @return {?}
2451 */
2452 function (formSchema) {
2453 _this.schema = formSchema;
2454 _this.formGroup.patchValue(formSchema);
2455 }));
2456 };
2457 /**
2458 * @param {?} data
2459 * @return {?}
2460 */
2461 EditFormContainerComponent.prototype.update = /**
2462 * @param {?} data
2463 * @return {?}
2464 */
2465 function (data) {
2466 this.store.dispatch(new EditFormAction(data));
2467 };
2468 EditFormContainerComponent.decorators = [
2469 { type: Component, args: [{
2470 template: "<edit-form\n\t\t\t\t\t[formGroup]=\"formGroup\"\n\t\t\t\t\t[schema]=\"schema\"\n\t\t\t\t\t(changes)=\"update_schema($event)\"\n\t\t\t\t\t(submited)=\"update($event)\">\n\t\t\t\t</edit-form>"
2471 }] }
2472 ];
2473 /** @nocollapse */
2474 EditFormContainerComponent.ctorParameters = function () { return [
2475 { type: FormService },
2476 { type: ActivatedRoute },
2477 { type: Store }
2478 ]; };
2479 return EditFormContainerComponent;
2480}(AddFormContainerComponent));
2481if (false) {
2482 /** @type {?} */
2483 EditFormContainerComponent.prototype.formGroup;
2484 /** @type {?} */
2485 EditFormContainerComponent.prototype.service;
2486 /**
2487 * @type {?}
2488 * @private
2489 */
2490 EditFormContainerComponent.prototype.route;
2491 /** @type {?} */
2492 EditFormContainerComponent.prototype.store;
2493}
2494
2495/**
2496 * @fileoverview added by tsickle
2497 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2498 */
2499var AddFormComponent = /** @class */ (function () {
2500 function AddFormComponent() {
2501 this.formGroup = AddFormApiModel.Request.formGroup;
2502 this.submited = new EventEmitter();
2503 this.changes = new EventEmitter();
2504 }
2505 /**
2506 * @return {?}
2507 */
2508 AddFormComponent.prototype.emit = /**
2509 * @return {?}
2510 */
2511 function () {
2512 this.formGroup.patchValue({ form: this.schema.form });
2513 this.submited.emit(this.formGroup.value);
2514 };
2515 /**
2516 * @return {?}
2517 */
2518 AddFormComponent.prototype.changed = /**
2519 * @return {?}
2520 */
2521 function () {
2522 this.formGroup.patchValue({ form: this.schema.form });
2523 this.changes.emit(this.formGroup.value);
2524 };
2525 /**
2526 * @param {?} $event
2527 * @return {?}
2528 */
2529 AddFormComponent.prototype.changeOrder = /**
2530 * @param {?} $event
2531 * @return {?}
2532 */
2533 function ($event) { };
2534 /**
2535 * @param {?} root
2536 * @return {?}
2537 */
2538 AddFormComponent.prototype.addFormGroup = /**
2539 * @param {?} root
2540 * @return {?}
2541 */
2542 function (root) {
2543 /** @type {?} */
2544 var group = new FieldConfig("group");
2545 group.fields = [];
2546 root.fields.push(group);
2547 return group;
2548 };
2549 /**
2550 * @param {?} root
2551 * @return {?}
2552 */
2553 AddFormComponent.prototype.addFormArray = /**
2554 * @param {?} root
2555 * @return {?}
2556 */
2557 function (root) {
2558 /** @type {?} */
2559 var array = new FieldConfig("array");
2560 array.fields = [];
2561 root.fields.push(array);
2562 return array;
2563 };
2564 /**
2565 * @param {?} root
2566 * @return {?}
2567 */
2568 AddFormComponent.prototype.addFormControl = /**
2569 * @param {?} root
2570 * @return {?}
2571 */
2572 function (root) {
2573 /** @type {?} */
2574 var control = new FieldConfig("control");
2575 root.fields.push(control);
2576 return control;
2577 };
2578 AddFormComponent.decorators = [
2579 { type: Component, args: [{
2580 selector: "ngs-form-add",
2581 template: "<div fxLayout=\"row\" *ngIf=\"schema\">\r\n <div [fxFlex]=\"50\" *ngIf=\"formGroup\">\r\n <form [formGroup]=\"formGroup\">\r\n <mat-card>\r\n <mat-card-title>\u0627\u06CC\u062C\u0627\u062F \u0641\u0631\u0645 \u062C\u062F\u06CC\u062F</mat-card-title>\r\n <mat-card-content>\r\n <mat-form-field>\r\n <input type=\"text\" matInput (change)=\"changed()\" placeholder=\"\u0646\u0627\u0645 \u0641\u0631\u0645\" formControlName=\"name\">\r\n </mat-form-field>\r\n <!-- <div class=\"button-row\">\r\n <button mat-button color=\"primary\" (click)=\"addFormGroup(schema.form)\">Add form group</button>\r\n <button mat-button color=\"primary\" (click)=\"addFormArray(schema.form)\">Add form array</button>\r\n <button mat-button color=\"primary\" (click)=\"addFormControl(schema.form)\">Add form control</button>\r\n </div> -->\r\n </mat-card-content>\r\n </mat-card>\r\n <mat-card>\r\n <mat-card-content>\r\n <div [ngSwitch]=\"schema.form?.type\">\r\n <app-form-group *ngSwitchCase=\"'group'\" [schema]=\"schema.form\" noHeader=\"true\" (changes)=\"changed()\"></app-form-group>\r\n <app-form-array *ngSwitchCase=\"'array'\" [schema]=\"schema.form\" (changes)=\"changed()\"></app-form-array>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <!-- <button mat-raised-button color=\"primary\" (click)=\"form.generate(schema)\">\u0627\u06CC\u062C\u0627\u062F \u0641\u0631\u0645</button> -->\r\n <button mat-raised-button color=\"primary\" (click)=\"emit()\" type=\"submit\">\u062B\u0628\u062A</button>\r\n </mat-card-actions>\r\n\r\n <div [formGroup]=\"$any(formGroup.controls.events).controls.accept\">\r\n <mat-slide-toggle (change)=\"changed()\" formControlName=\"show\">\u0646\u0645\u0627\u06CC\u0634 \u062A\u0627\u06CC\u06CC\u062F</mat-slide-toggle>\r\n <mat-form-field>\r\n <input type=\"text\" (change)=\"changed()\" matInput placeholder=\"\u0645\u062A\u0646 \u062A\u0627\u06CC\u06CC\u062F\" formControlName=\"text\">\r\n </mat-form-field>\r\n </div>\r\n <div [formGroup]=\"$any(formGroup.controls.events).controls.cancel\">\r\n <mat-slide-toggle (change)=\"changed()\" formControlName=\"show\">\u0646\u0645\u0627\u06CC\u0634 \u0627\u0646\u0635\u0631\u0627\u0641</mat-slide-toggle>\r\n <mat-form-field>\r\n <input type=\"text\" (change)=\"changed()\" matInput placeholder=\"\u0645\u062A\u0646 \u0627\u0646\u0635\u0631\u0627\u0641\" formControlName=\"text\">\r\n </mat-form-field>\r\n </div>\r\n\r\n </mat-card>\r\n </form>\r\n </div>\r\n <div [fxFlex]=\"50\">\r\n <ngs-form-view [local]='true' [id]=\"schema._id\"></ngs-form-view>\r\n </div>\r\n</div>"
2582 }] }
2583 ];
2584 AddFormComponent.propDecorators = {
2585 schema: [{ type: Input }],
2586 formGroup: [{ type: Input }],
2587 submited: [{ type: Output }],
2588 changes: [{ type: Output }]
2589 };
2590 return AddFormComponent;
2591}());
2592if (false) {
2593 /** @type {?} */
2594 AddFormComponent.prototype.schema;
2595 /** @type {?} */
2596 AddFormComponent.prototype.formGroup;
2597 /** @type {?} */
2598 AddFormComponent.prototype.submited;
2599 /** @type {?} */
2600 AddFormComponent.prototype.changes;
2601}
2602
2603/**
2604 * @fileoverview added by tsickle
2605 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2606 */
2607
2608/**
2609 * @fileoverview added by tsickle
2610 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2611 */
2612var EditFormComponent = /** @class */ (function (_super) {
2613 __extends(EditFormComponent, _super);
2614 function EditFormComponent() {
2615 return _super !== null && _super.apply(this, arguments) || this;
2616 }
2617 /**
2618 * @return {?}
2619 */
2620 EditFormComponent.prototype.emit = /**
2621 * @return {?}
2622 */
2623 function () {
2624 if (!this.formGroup.valid)
2625 return;
2626 return this.submited.emit(this.formGroup.value);
2627 };
2628 EditFormComponent.decorators = [
2629 { type: Component, args: [{
2630 selector: "edit-form",
2631 template: "<div fxLayout=\"row\" fxLayoutAlign=\"center\" fxLayoutGap=\"25px\" class=\"main-container\">\r\n\r\n <div class=\"content-action\">\r\n <mat-card fxLayout=\"column\" fxLayoutGap=\"10px\" fxLayoutAlign=\"start\" class=\"with-sticky-action\">\r\n <div fxLayout=\"row wrap\" *ngIf=\"schema\" fxFlex=\"100\" fxLayoutAlign=\"start start\" fxLayoutAlign.lt-md=\"center\">\r\n <div fxFlex.gt-md=\"50\" fxFlex.lt-md=\"100\" *ngIf=\"formGroup\">\r\n <form [formGroup]=\"formGroup\">\r\n <mat-card>\r\n <mat-card-title>\u0627\u06CC\u062C\u0627\u062F \u0641\u0631\u0645 \u062C\u062F\u06CC\u062F</mat-card-title>\r\n <mat-card-content>\r\n <mat-form-field>\r\n <input type=\"text\" matInput (change)=\"changed()\" placeholder=\"\u0646\u0627\u0645 \u0641\u0631\u0645\" formControlName=\"name\">\r\n </mat-form-field>\r\n <!-- <div class=\"button-row\">\r\n <button mat-button color=\"primary\" (click)=\"addFormGroup(schema.form)\">Add form group</button>\r\n <button mat-button color=\"primary\" (click)=\"addFormArray(schema.form)\">Add form array</button>\r\n <button mat-button color=\"primary\" (click)=\"addFormControl(schema.form)\">Add form control</button>\r\n </div> -->\r\n <mat-divider></mat-divider>\r\n <div [ngSwitch]=\"schema.form?.type\" class=\"schema-form\">\r\n <app-form-group *ngSwitchCase=\"'group'\" [schema]=\"schema.form\" noHeader=\"true\" (changes)=\"changed()\"></app-form-group>\r\n <app-form-array *ngSwitchCase=\"'array'\" [schema]=\"schema.form\" (changes)=\"changed()\"></app-form-array>\r\n </div>\r\n\r\n <mat-divider></mat-divider>\r\n <div class=\"form-buttons\" fxLayout=\"row wrap\" fxLayoutGap=\"10px\">\r\n\r\n <div fxLayout=\"column\" [formGroup]=\"$any(formGroup.controls.events).controls.accept\">\r\n <mat-slide-toggle (change)=\"changed()\" formControlName=\"show\">\u0646\u0645\u0627\u06CC\u0634 \u062A\u0627\u06CC\u06CC\u062F</mat-slide-toggle>\r\n <mat-form-field>\r\n <input type=\"text\" (change)=\"changed()\" matInput placeholder=\"\u0645\u062A\u0646 \u062A\u0627\u06CC\u06CC\u062F\" formControlName=\"text\">\r\n </mat-form-field>\r\n </div>\r\n <div fxLayout=\"column\" [formGroup]=\"$any(formGroup.controls.events).controls.cancel\">\r\n <mat-slide-toggle (change)=\"changed()\" formControlName=\"show\">\u0646\u0645\u0627\u06CC\u0634 \u0627\u0646\u0635\u0631\u0627\u0641</mat-slide-toggle>\r\n <mat-form-field>\r\n <input type=\"text\" (change)=\"changed()\" matInput placeholder=\"\u0645\u062A\u0646 \u0627\u0646\u0635\u0631\u0627\u0641\" formControlName=\"text\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n <!-- <button mat-raised-button color=\"primary\" (click)=\"$any(form).generate(schema)\">\u0627\u06CC\u062C\u0627\u062F \u0641\u0631\u0645</button> -->\r\n <button mat-raised-button color=\"primary\" (click)=\"emit()\" type=\"submit\">\u062B\u0628\u062A</button>\r\n </mat-card-actions>\r\n\r\n </mat-card-content>\r\n </mat-card>\r\n </form>\r\n </div>\r\n <div fxFlex.gt-md=\"50\" fxFlex.lt-md=\"100\" fxLayoutAlign=\"center start\">\r\n <ngs-form-view [local]='true' [id]=\" schema._id\">\r\n </ngs-form-view>\r\n\r\n </div>\r\n </div>\r\n </mat-card>\r\n </div>\r\n</div>",
2632 styles: [".form-buttons,.schema-form{padding:25px 10px}"]
2633 }] }
2634 ];
2635 EditFormComponent.propDecorators = {
2636 schema: [{ type: Input }]
2637 };
2638 return EditFormComponent;
2639}(AddFormComponent));
2640if (false) {
2641 /** @type {?} */
2642 EditFormComponent.prototype.schema;
2643}
2644
2645/**
2646 * @fileoverview added by tsickle
2647 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2648 */
2649var FormListContainerComponent = /** @class */ (function () {
2650 function FormListContainerComponent(store) {
2651 this.store = store;
2652 this.data$ = this.store.select((/**
2653 * @param {?} state
2654 * @return {?}
2655 */
2656 function (state) { return state.form.list.data; }));
2657 }
2658 /**
2659 * @return {?}
2660 */
2661 FormListContainerComponent.prototype.ngOnInit = /**
2662 * @return {?}
2663 */
2664 function () {
2665 this.store.dispatch(new FormsListAction());
2666 };
2667 FormListContainerComponent.decorators = [
2668 { type: Component, args: [{
2669 template: "<form-list\n\t\t\t\t\t[data]=\"data$\">\n\t\t\t\t</form-list>"
2670 }] }
2671 ];
2672 /** @nocollapse */
2673 FormListContainerComponent.ctorParameters = function () { return [
2674 { type: Store }
2675 ]; };
2676 return FormListContainerComponent;
2677}());
2678if (false) {
2679 /** @type {?} */
2680 FormListContainerComponent.prototype.data$;
2681 /** @type {?} */
2682 FormListContainerComponent.prototype.store;
2683}
2684
2685/**
2686 * @fileoverview added by tsickle
2687 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2688 */
2689var FormListComponent = /** @class */ (function () {
2690 function FormListComponent() {
2691 }
2692 FormListComponent.decorators = [
2693 { type: Component, args: [{
2694 selector: "form-list",
2695 template: "<div fxLayout=\"row\" fxLayoutAlign=\"center\" fxLayoutGap=\"25px\" class=\"main-container\">\r\n\r\n <div class=\"content-action\">\r\n <mat-card class=\"with-sticky-action\">\r\n <mat-card-header>\r\n <mat-card-title fxLayout=\"row\" fxLayoutGap=\"5px\">\r\n <mat-icon>assignment</mat-icon>\r\n <span>\u0645\u062F\u06CC\u0631\u06CC\u062A \u0641\u0631\u0645 \u0647\u0627</span>\r\n </mat-card-title>\r\n <mat-card-subtitle fxLayout=\"row\" fxLayoutAlign=\"space-between center\">\r\n <span>\r\n \u0634\u0627\u0645\u0644 \u062A\u0645\u0627\u0645\u06CC \u062F\u0631\u062E\u0648\u0627\u0633\u062A\u200C\u0647\u0627 \u0627\u0632 \u0642\u0628\u06CC\u0644 \u062F\u0627\u0626\u0631\u06CC\u060C \u062C\u0645\u0639\u200C\u0622\u0648\u0631\u06CC \u0648 ...\r\n </span>\r\n </mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"10px\" fxLayoutAlign=\"start\">\r\n\r\n <button fxFlex.lt-lg=\"19\" fxFlex.lg=\"24\" fxFlex.md=\"32\" fxFlex.sm=\"49\" fxFlex.xs=\"100\" class='link'\r\n mat-raised-button [routerLink]=\"['edit' , item._id]\" *ngFor=\"let item of (data$ | async)\">\r\n <div fxLayout='column' fxLayoutAlign='center center'>\r\n <mat-icon color='primary'>settings</mat-icon>\r\n <h3 class='title'>{{item.name}}</h3>\r\n </div>\r\n </button>\r\n\r\n </div>\r\n </mat-card>\r\n </div>\r\n</div>",
2696 styles: ["button.link{padding:25px 15px;margin:.5%;box-sizing:border-box}button mat-icon{font-size:34px;width:34px;height:34px}"]
2697 }] }
2698 ];
2699 FormListComponent.propDecorators = {
2700 data$: [{ type: Input, args: ["data",] }]
2701 };
2702 return FormListComponent;
2703}());
2704if (false) {
2705 /** @type {?} */
2706 FormListComponent.prototype.data$;
2707}
2708
2709/**
2710 * @fileoverview added by tsickle
2711 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2712 */
2713var MainContainerComponent = /** @class */ (function () {
2714 function MainContainerComponent(route, store) {
2715 this.route = route;
2716 this.store = store;
2717 }
2718 MainContainerComponent.decorators = [
2719 { type: Component, args: [{
2720 template: "<router-outlet></router-outlet>"
2721 }] }
2722 ];
2723 /** @nocollapse */
2724 MainContainerComponent.ctorParameters = function () { return [
2725 { type: ActivatedRoute },
2726 { type: Store }
2727 ]; };
2728 return MainContainerComponent;
2729}());
2730if (false) {
2731 /**
2732 * @type {?}
2733 * @private
2734 */
2735 MainContainerComponent.prototype.route;
2736 /**
2737 * @type {?}
2738 * @private
2739 */
2740 MainContainerComponent.prototype.store;
2741}
2742
2743/**
2744 * @fileoverview added by tsickle
2745 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2746 */
2747var AddFormEffects = /** @class */ (function () {
2748 function AddFormEffects(actions$, router, service) {
2749 var _this = this;
2750 this.actions$ = actions$;
2751 this.router = router;
2752 this.service = service;
2753 this.AddForm$ = this.actions$.pipe(ofType(AddFormActionTypes.ADD_FORM), map((/**
2754 * @param {?} action
2755 * @return {?}
2756 */
2757 function (action) { return action.payload; })), map((/**
2758 * @param {?} data
2759 * @return {?}
2760 */
2761 function (data) { return new AddFormStartAction(data); })));
2762 this.AddFormStart$ = this.actions$.pipe(ofType(AddFormActionTypes.ADD_FORM_START), map((/**
2763 * @param {?} action
2764 * @return {?}
2765 */
2766 function (action) { return action.payload; })), switchMap((/**
2767 * @param {?} data
2768 * @return {?}
2769 */
2770 function (data) { return _this.service.add(data); })), map((/**
2771 * @param {?} res
2772 * @return {?}
2773 */
2774 function (res) { return new AddFormSucceedAction(); })), catchError((/**
2775 * @return {?}
2776 */
2777 function () { return of(new AddFormFailedAction()); })));
2778 }
2779 AddFormEffects.decorators = [
2780 { type: Injectable }
2781 ];
2782 /** @nocollapse */
2783 AddFormEffects.ctorParameters = function () { return [
2784 { type: Actions },
2785 { type: Router },
2786 { type: FormService }
2787 ]; };
2788 __decorate([
2789 Effect(),
2790 __metadata("design:type", Object)
2791 ], AddFormEffects.prototype, "AddForm$", void 0);
2792 __decorate([
2793 Effect(),
2794 __metadata("design:type", Object)
2795 ], AddFormEffects.prototype, "AddFormStart$", void 0);
2796 return AddFormEffects;
2797}());
2798if (false) {
2799 /** @type {?} */
2800 AddFormEffects.prototype.AddForm$;
2801 /** @type {?} */
2802 AddFormEffects.prototype.AddFormStart$;
2803 /**
2804 * @type {?}
2805 * @private
2806 */
2807 AddFormEffects.prototype.actions$;
2808 /**
2809 * @type {?}
2810 * @private
2811 */
2812 AddFormEffects.prototype.router;
2813 /**
2814 * @type {?}
2815 * @private
2816 */
2817 AddFormEffects.prototype.service;
2818}
2819
2820/**
2821 * @fileoverview added by tsickle
2822 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2823 */
2824
2825/**
2826 * @fileoverview added by tsickle
2827 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2828 */
2829
2830/**
2831 * @fileoverview added by tsickle
2832 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2833 */
2834var FormsListEffects = /** @class */ (function () {
2835 function FormsListEffects(actions$, router, service) {
2836 var _this = this;
2837 this.actions$ = actions$;
2838 this.router = router;
2839 this.service = service;
2840 this.EditProfileRequest$ = this.actions$.pipe(ofType(FormsListActionTypes.FORMS_LIST), map((/**
2841 * @param {?} data
2842 * @return {?}
2843 */
2844 function (data) { return new FormsListStartAction(); })));
2845 this.GetForm$ = this.actions$.pipe(ofType(FormsListActionTypes.GET_FORM_SCHEMA), map((/**
2846 * @param {?} action
2847 * @return {?}
2848 */
2849 function (action) { return action.payload; })), switchMap((/**
2850 * @param {?} id
2851 * @return {?}
2852 */
2853 function (id) { return _this.service.get(id); })), map((/**
2854 * @param {?} formSchema
2855 * @return {?}
2856 */
2857 function (formSchema) { return new FormSchemaFechedAction(formSchema); })));
2858 this.get_forms_list$ = this.actions$.pipe(ofType(FormsListActionTypes.FORMS_LIST_START), switchMap((/**
2859 * @param {?} data
2860 * @return {?}
2861 */
2862 function (data) { return _this.service.getList(); })), map((/**
2863 * @param {?} res
2864 * @return {?}
2865 */
2866 function (res) { return new FormsListSucceedAction(res); })), catchError((/**
2867 * @return {?}
2868 */
2869 function () { return of(new FormsListFailedAction()); })));
2870 }
2871 FormsListEffects.decorators = [
2872 { type: Injectable }
2873 ];
2874 /** @nocollapse */
2875 FormsListEffects.ctorParameters = function () { return [
2876 { type: Actions },
2877 { type: Router },
2878 { type: FormService }
2879 ]; };
2880 __decorate([
2881 Effect(),
2882 __metadata("design:type", Object)
2883 ], FormsListEffects.prototype, "EditProfileRequest$", void 0);
2884 __decorate([
2885 Effect(),
2886 __metadata("design:type", Object)
2887 ], FormsListEffects.prototype, "GetForm$", void 0);
2888 __decorate([
2889 Effect(),
2890 __metadata("design:type", Object)
2891 ], FormsListEffects.prototype, "get_forms_list$", void 0);
2892 return FormsListEffects;
2893}());
2894if (false) {
2895 /** @type {?} */
2896 FormsListEffects.prototype.EditProfileRequest$;
2897 /** @type {?} */
2898 FormsListEffects.prototype.GetForm$;
2899 /** @type {?} */
2900 FormsListEffects.prototype.get_forms_list$;
2901 /**
2902 * @type {?}
2903 * @private
2904 */
2905 FormsListEffects.prototype.actions$;
2906 /**
2907 * @type {?}
2908 * @private
2909 */
2910 FormsListEffects.prototype.router;
2911 /**
2912 * @type {?}
2913 * @private
2914 */
2915 FormsListEffects.prototype.service;
2916}
2917
2918/**
2919 * @fileoverview added by tsickle
2920 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2921 */
2922
2923/**
2924 * @fileoverview added by tsickle
2925 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2926 */
2927var EditFormEffects = /** @class */ (function () {
2928 function EditFormEffects(actions$, router, service) {
2929 var _this = this;
2930 this.actions$ = actions$;
2931 this.router = router;
2932 this.service = service;
2933 this.EditForm$ = this.actions$.pipe(ofType(EditFormActionTypes.EDIT_FORM), map((/**
2934 * @param {?} action
2935 * @return {?}
2936 */
2937 function (action) { return action.payload; })), map((/**
2938 * @param {?} data
2939 * @return {?}
2940 */
2941 function (data) { return new EditFormStartAction(data); })));
2942 this.EditFormStart$ = this.actions$.pipe(ofType(EditFormActionTypes.EDIT_FORM_START), map((/**
2943 * @param {?} action
2944 * @return {?}
2945 */
2946 function (action) { return action.payload; })), switchMap((/**
2947 * @param {?} data
2948 * @return {?}
2949 */
2950 function (data) { return _this.service.update(data); })), map((/**
2951 * @param {?} formSchema
2952 * @return {?}
2953 */
2954 function (formSchema) { return new EditFormSucceedAction(formSchema); })), catchError((/**
2955 * @return {?}
2956 */
2957 function () { return of(new EditFormFailedAction()); })));
2958 this.UpdateFormsListStart$ = this.actions$.pipe(ofType(EditFormActionTypes.EDIT_FORM_SUCCEED), map((/**
2959 * @param {?} action
2960 * @return {?}
2961 */
2962 function (action) { return action.payload; })), map((/**
2963 * @param {?} formSchema
2964 * @return {?}
2965 */
2966 function (formSchema) { return new UpdateFormSchemaAction(formSchema); })));
2967 }
2968 EditFormEffects.decorators = [
2969 { type: Injectable }
2970 ];
2971 /** @nocollapse */
2972 EditFormEffects.ctorParameters = function () { return [
2973 { type: Actions },
2974 { type: Router },
2975 { type: FormService }
2976 ]; };
2977 __decorate([
2978 Effect(),
2979 __metadata("design:type", Object)
2980 ], EditFormEffects.prototype, "EditForm$", void 0);
2981 __decorate([
2982 Effect(),
2983 __metadata("design:type", Object)
2984 ], EditFormEffects.prototype, "EditFormStart$", void 0);
2985 __decorate([
2986 Effect(),
2987 __metadata("design:type", Object)
2988 ], EditFormEffects.prototype, "UpdateFormsListStart$", void 0);
2989 return EditFormEffects;
2990}());
2991if (false) {
2992 /** @type {?} */
2993 EditFormEffects.prototype.EditForm$;
2994 /** @type {?} */
2995 EditFormEffects.prototype.EditFormStart$;
2996 /** @type {?} */
2997 EditFormEffects.prototype.UpdateFormsListStart$;
2998 /**
2999 * @type {?}
3000 * @private
3001 */
3002 EditFormEffects.prototype.actions$;
3003 /**
3004 * @type {?}
3005 * @private
3006 */
3007 EditFormEffects.prototype.router;
3008 /**
3009 * @type {?}
3010 * @private
3011 */
3012 EditFormEffects.prototype.service;
3013}
3014
3015/**
3016 * @fileoverview added by tsickle
3017 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3018 */
3019/** @type {?} */
3020var routes = [
3021 {
3022 path: "form",
3023 component: MainContainerComponent,
3024 children: [
3025 {
3026 path: "add",
3027 component: AddFormContainerComponent
3028 },
3029 {
3030 path: "edit/:_id",
3031 component: EditFormContainerComponent
3032 },
3033 {
3034 path: "",
3035 component: FormListContainerComponent
3036 }
3037 ]
3038 }
3039];
3040/** @type {?} */
3041var RoutingModule = RouterModule.forChild(routes);
3042
3043/**
3044 * @fileoverview added by tsickle
3045 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3046 */
3047/** @enum {string} */
3048var CaptchaActionTypes = {
3049 GET_CAPTCHA: "[CAPTCHA][GET] GET_CAPTCHA",
3050 GET_CAPTCHA_START: "[CAPTCHA][GET] GET_CAPTCHA_START",
3051 GET_CAPTCHA_SUCCEED: "[CAPTCHA][GET] GET_CAPTCHA_SUCCEED",
3052 GET_CAPTCHA_FAILED: "[CAPTCHA][GET] GET_CAPTCHA_FAILED",
3053};
3054var GetCaptchaAction = /** @class */ (function () {
3055 function GetCaptchaAction() {
3056 this.type = CaptchaActionTypes.GET_CAPTCHA;
3057 // constructor(public payload: CaptchaModel) { }
3058 }
3059 return GetCaptchaAction;
3060}());
3061if (false) {
3062 /** @type {?} */
3063 GetCaptchaAction.prototype.type;
3064}
3065var GetCaptchaStartAction = /** @class */ (function () {
3066 function GetCaptchaStartAction(payload) {
3067 this.payload = payload;
3068 this.type = CaptchaActionTypes.GET_CAPTCHA_START;
3069 }
3070 return GetCaptchaStartAction;
3071}());
3072if (false) {
3073 /** @type {?} */
3074 GetCaptchaStartAction.prototype.type;
3075 /** @type {?} */
3076 GetCaptchaStartAction.prototype.payload;
3077}
3078var GetCaptchaSucceedAction = /** @class */ (function () {
3079 function GetCaptchaSucceedAction() {
3080 this.type = CaptchaActionTypes.GET_CAPTCHA_SUCCEED;
3081 }
3082 return GetCaptchaSucceedAction;
3083}());
3084if (false) {
3085 /** @type {?} */
3086 GetCaptchaSucceedAction.prototype.type;
3087}
3088var GetCaptchaFailedAction = /** @class */ (function () {
3089 function GetCaptchaFailedAction() {
3090 this.type = CaptchaActionTypes.GET_CAPTCHA_FAILED;
3091 }
3092 return GetCaptchaFailedAction;
3093}());
3094if (false) {
3095 /** @type {?} */
3096 GetCaptchaFailedAction.prototype.type;
3097}
3098
3099/**
3100 * @fileoverview added by tsickle
3101 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3102 */
3103var CaptchaEffects = /** @class */ (function () {
3104 function CaptchaEffects(actions$, router, service) {
3105 var _this = this;
3106 this.actions$ = actions$;
3107 this.router = router;
3108 this.service = service;
3109 this.GetCaptcha$ = this.actions$.pipe(ofType(CaptchaActionTypes.GET_CAPTCHA), map((/**
3110 * @param {?} action
3111 * @return {?}
3112 */
3113 function (action) { return action.payload; })), map((/**
3114 * @param {?} data
3115 * @return {?}
3116 */
3117 function (data) { return new GetCaptchaStartAction(data); })));
3118 this.AddFormStart$ = this.actions$.pipe(ofType(CaptchaActionTypes.GET_CAPTCHA_START), map((/**
3119 * @param {?} action
3120 * @return {?}
3121 */
3122 function (action) { return action.payload; })), switchMap((/**
3123 * @param {?} data
3124 * @return {?}
3125 */
3126 function (data) { return _this.service.getCaptcha(); })), map((/**
3127 * @param {?} res
3128 * @return {?}
3129 */
3130 function (res) { return new GetCaptchaSucceedAction(); })), catchError((/**
3131 * @return {?}
3132 */
3133 function () { return of(new GetCaptchaFailedAction()); })));
3134 }
3135 CaptchaEffects.decorators = [
3136 { type: Injectable }
3137 ];
3138 /** @nocollapse */
3139 CaptchaEffects.ctorParameters = function () { return [
3140 { type: Actions },
3141 { type: Router },
3142 { type: FormCaptchaService }
3143 ]; };
3144 __decorate([
3145 Effect(),
3146 __metadata("design:type", Object)
3147 ], CaptchaEffects.prototype, "GetCaptcha$", void 0);
3148 __decorate([
3149 Effect(),
3150 __metadata("design:type", Object)
3151 ], CaptchaEffects.prototype, "AddFormStart$", void 0);
3152 return CaptchaEffects;
3153}());
3154if (false) {
3155 /** @type {?} */
3156 CaptchaEffects.prototype.GetCaptcha$;
3157 /** @type {?} */
3158 CaptchaEffects.prototype.AddFormStart$;
3159 /**
3160 * @type {?}
3161 * @private
3162 */
3163 CaptchaEffects.prototype.actions$;
3164 /**
3165 * @type {?}
3166 * @private
3167 */
3168 CaptchaEffects.prototype.router;
3169 /**
3170 * @type {?}
3171 * @private
3172 */
3173 CaptchaEffects.prototype.service;
3174}
3175
3176/**
3177 * @fileoverview added by tsickle
3178 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3179 */
3180var NgsFormModule = /** @class */ (function () {
3181 function NgsFormModule() {
3182 }
3183 /**
3184 * @param {?=} config
3185 * @return {?}
3186 */
3187 NgsFormModule.forRoot = /**
3188 * @param {?=} config
3189 * @return {?}
3190 */
3191 function (config) {
3192 return {
3193 ngModule: RootNgsFormModule,
3194 providers: [{ provide: MODULE_CONFIG_TOKEN, useValue: config }, FormConfigurationService]
3195 };
3196 };
3197 NgsFormModule.decorators = [
3198 { type: NgModule, args: [{
3199 imports: [
3200 HttpClientModule,
3201 FormsModule,
3202 RouterModule,
3203 CommonModule,
3204 MatExpansionModule,
3205 MatSnackBarModule,
3206 MatIconModule,
3207 MatDatepickerModule,
3208 MatButtonModule,
3209 MatCardModule,
3210 MatCheckboxModule,
3211 MatTableModule,
3212 MatSelectModule,
3213 MatInputModule,
3214 MatFormFieldModule,
3215 MatTabsModule,
3216 MatDividerModule,
3217 FlexLayoutModule,
3218 MatRadioModule,
3219 MatSlideToggleModule,
3220 ReactiveFormsModule
3221 ],
3222 declarations: [
3223 EditFormContainerComponent,
3224 EditFormComponent,
3225 FormListContainerComponent,
3226 FormListComponent,
3227 AddFormContainerComponent,
3228 MainContainerComponent,
3229 AddFormComponent,
3230 FormGroupComponent,
3231 FormArrayComponent,
3232 FormControlComponent,
3233 FormViewComponent,
3234 DynamicFieldDirective,
3235 SelectComponent,
3236 CheckboxComponent,
3237 EmailComponent,
3238 ColorComponent,
3239 DateFormInputControlComponent,
3240 FileFormInputControlComponent,
3241 TextComponent,
3242 NumberComponent,
3243 TableComponent,
3244 FormCaptchaComponent
3245 // NgsFormSelectorComponent
3246 ],
3247 entryComponents: [
3248 SelectComponent,
3249 CheckboxComponent,
3250 EmailComponent,
3251 ColorComponent,
3252 DateFormInputControlComponent,
3253 FileFormInputControlComponent,
3254 TextComponent,
3255 NumberComponent,
3256 TableComponent,
3257 FormCaptchaComponent
3258 ],
3259 exports: [FormViewComponent]
3260 // exports: [ FormViewComponent, NgsFormSelectorComponent ]
3261 },] }
3262 ];
3263 return NgsFormModule;
3264}());
3265var RootNgsFormModule = /** @class */ (function () {
3266 function RootNgsFormModule() {
3267 ((/** @type {?} */ (window))).___starter = ((/** @type {?} */ (window))).___starter || {};
3268 ((/** @type {?} */ (window))).___starter.form = "8.0.11";
3269 }
3270 RootNgsFormModule.decorators = [
3271 { type: NgModule, args: [{
3272 imports: [
3273 NgsFormModule,
3274 StoreModule.forFeature("form", FormReducers),
3275 EffectsModule.forFeature([AddFormEffects, EditFormEffects, FormsListEffects, CaptchaEffects]),
3276 RoutingModule
3277 ],
3278 exports: [NgsFormModule]
3279 },] }
3280 ];
3281 /** @nocollapse */
3282 RootNgsFormModule.ctorParameters = function () { return []; };
3283 return RootNgsFormModule;
3284}());
3285
3286/**
3287 * @fileoverview added by tsickle
3288 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3289 */
3290
3291/**
3292 * @fileoverview added by tsickle
3293 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3294 */
3295
3296export { DynamicFieldDirective, FormService, FormViewComponent, NgsFormModule, RootNgsFormModule, MODULE_CONFIG_TOKEN as ɵa, FormReducers as ɵb, FormCaptchaComponent as ɵba, FormCaptchaService as ɵbb, reducer as ɵbc, AddFormEffects as ɵbd, EditFormEffects as ɵbe, FormsListEffects as ɵbf, CaptchaEffects as ɵbg, RoutingModule as ɵbh, FormConfigurationService as ɵd, EditFormContainerComponent as ɵf, AddFormContainerComponent as ɵg, EditFormComponent as ɵh, AddFormComponent as ɵi, FormListContainerComponent as ɵj, FormListComponent as ɵk, AddFormContainerComponent as ɵl, MainContainerComponent as ɵm, AddFormComponent as ɵn, FormGroupComponent as ɵo, FormArrayComponent as ɵp, FormControlComponent as ɵq, SelectComponent as ɵr, CheckboxComponent as ɵs, EmailComponent as ɵt, ColorComponent as ɵu, DateFormInputControlComponent as ɵv, FileFormInputControlComponent as ɵw, TextComponent as ɵx, NumberComponent as ɵy, TableComponent as ɵz };
3297//# sourceMappingURL=soushians-form.js.map