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