@glowgreen/gg-questionnaire-v2 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -177,6 +177,7 @@
177
177
  * @author Will Poulson
178
178
  * @param {?} sections The array of sections to filter.
179
179
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
180
+ * @param {?=} additionalData
180
181
  * @return {?} An array of filtered sections with their filtered questions.
181
182
  */
182
183
  FilterService.prototype.filterSections = /**
@@ -184,27 +185,28 @@
184
185
  * @author Will Poulson
185
186
  * @param {?} sections The array of sections to filter.
186
187
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
188
+ * @param {?=} additionalData
187
189
  * @return {?} An array of filtered sections with their filtered questions.
188
190
  */
189
- function (sections, currentQuestionnaireForm) {
191
+ function (sections, currentQuestionnaireForm, additionalData) {
190
192
  var e_1, _a, e_2, _b, e_3, _c;
191
193
  /** @type {?} */
192
194
  var filteredSections = [];
193
195
  try {
194
196
  for (var sections_1 = __values(sections), sections_1_1 = sections_1.next(); !sections_1_1.done; sections_1_1 = sections_1.next()) {
195
197
  var section = sections_1_1.value;
196
- if (this.meetsConditionGroups(section.conditionGroups, currentQuestionnaireForm)) {
198
+ if (this.meetsConditionGroups(section.conditionGroups, currentQuestionnaireForm, additionalData)) {
197
199
  /** @type {?} */
198
200
  var filteredQuestions = [];
199
201
  try {
200
202
  for (var _d = __values(section.questions), _e = _d.next(); !_e.done; _e = _d.next()) {
201
203
  var question = _e.value;
202
- if (this.meetsConditionGroups(question.conditionGroups, currentQuestionnaireForm)) {
204
+ if (this.meetsConditionGroups(question.conditionGroups, currentQuestionnaireForm, additionalData)) {
203
205
  if (question.repeaterQuestions) {
204
206
  try {
205
207
  for (var _f = __values(question.repeaterQuestions), _g = _f.next(); !_g.done; _g = _f.next()) {
206
208
  var repeaterQuestion = _g.value;
207
- if (this.meetsConditionGroups(repeaterQuestion.conditionGroups, currentQuestionnaireForm)) ;
209
+ if (this.meetsConditionGroups(repeaterQuestion.conditionGroups, currentQuestionnaireForm, additionalData)) ;
208
210
  }
209
211
  }
210
212
  catch (e_3_1) {
@@ -271,6 +273,7 @@
271
273
  * @private
272
274
  * @param {?} conditionGroups The array of condition groups.
273
275
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
276
+ * @param {?=} additionalData
274
277
  * @return {?} A boolean stating if the condition groups conditions has been met.
275
278
  */
276
279
  FilterService.prototype.meetsConditionGroups = /**
@@ -279,9 +282,10 @@
279
282
  * @private
280
283
  * @param {?} conditionGroups The array of condition groups.
281
284
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
285
+ * @param {?=} additionalData
282
286
  * @return {?} A boolean stating if the condition groups conditions has been met.
283
287
  */
284
- function (conditionGroups, currentQuestionnaireForm) {
288
+ function (conditionGroups, currentQuestionnaireForm, additionalData) {
285
289
  var _this = this;
286
290
  if (!conditionGroups || conditionGroups.length === 0) {
287
291
  return true;
@@ -290,7 +294,7 @@
290
294
  * @param {?} x
291
295
  * @return {?}
292
296
  */function (x) {
293
- return _this.meetsConditionGroup(x, currentQuestionnaireForm) === true;
297
+ return _this.meetsConditionGroup(x, currentQuestionnaireForm, additionalData) === true;
294
298
  }));
295
299
  };
296
300
  /**
@@ -306,6 +310,7 @@
306
310
  * @private
307
311
  * @param {?} conditionGroup The condition group to check.
308
312
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
313
+ * @param {?=} additionalData
309
314
  * @return {?} A boolean stating if the condition group conditions has been met.
310
315
  */
311
316
  FilterService.prototype.meetsConditionGroup = /**
@@ -314,9 +319,10 @@
314
319
  * @private
315
320
  * @param {?} conditionGroup The condition group to check.
316
321
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
322
+ * @param {?=} additionalData
317
323
  * @return {?} A boolean stating if the condition group conditions has been met.
318
324
  */
319
- function (conditionGroup, currentQuestionnaireForm) {
325
+ function (conditionGroup, currentQuestionnaireForm, additionalData) {
320
326
  var e_4, _a;
321
327
  if (!conditionGroup.conditions || conditionGroup.conditions.length === 0) {
322
328
  return true;
@@ -326,7 +332,7 @@
326
332
  try {
327
333
  for (var _b = __values(conditionGroup.conditions), _c = _b.next(); !_c.done; _c = _b.next()) {
328
334
  var condition = _c.value;
329
- results.push(this.meetsCondition(condition, currentQuestionnaireForm));
335
+ results.push(this.meetsCondition(condition, currentQuestionnaireForm, additionalData));
330
336
  }
331
337
  }
332
338
  catch (e_4_1) {
@@ -374,6 +380,7 @@
374
380
  * @private
375
381
  * @param {?} condition The condition to check.
376
382
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
383
+ * @param {?=} additionalData
377
384
  * @return {?} A boolean stating if the condition group conditions has been met.
378
385
  */
379
386
  FilterService.prototype.meetsCondition = /**
@@ -382,14 +389,15 @@
382
389
  * @private
383
390
  * @param {?} condition The condition to check.
384
391
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
392
+ * @param {?=} additionalData
385
393
  * @return {?} A boolean stating if the condition group conditions has been met.
386
394
  */
387
- function (condition, currentQuestionnaireForm) {
395
+ function (condition, currentQuestionnaireForm, additionalData) {
388
396
  var e_5, _a, e_6, _b;
389
397
  /** @type {?} */
390
- var v1s = this.getValuesForArray(condition.v1s, currentQuestionnaireForm);
398
+ var v1s = this.getValuesForArray(condition.v1s, currentQuestionnaireForm, additionalData);
391
399
  /** @type {?} */
392
- var v2s = this.getValuesForArray(condition.v2s, currentQuestionnaireForm);
400
+ var v2s = this.getValuesForArray(condition.v2s, currentQuestionnaireForm, additionalData);
393
401
  /** @type {?} */
394
402
  var result = false;
395
403
  switch (condition.type) {
@@ -509,6 +517,7 @@
509
517
  * @private
510
518
  * @param {?} paths The array of strings to check.
511
519
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
520
+ * @param {?=} additionalData
512
521
  * @return {?} An array of strings/values
513
522
  */
514
523
  FilterService.prototype.getValuesForArray = /**
@@ -517,9 +526,10 @@
517
526
  * @private
518
527
  * @param {?} paths The array of strings to check.
519
528
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
529
+ * @param {?=} additionalData
520
530
  * @return {?} An array of strings/values
521
531
  */
522
- function (paths, currentQuestionnaireForm) {
532
+ function (paths, currentQuestionnaireForm, additionalData) {
523
533
  var e_7, _a;
524
534
  if (currentQuestionnaireForm) {
525
535
  /** @type {?} */
@@ -528,7 +538,7 @@
528
538
  for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {
529
539
  var path = paths_1_1.value;
530
540
  /** @type {?} */
531
- var value = this.getValueForString(path, currentQuestionnaireForm);
541
+ var value = this.getValueForString(path, currentQuestionnaireForm, additionalData);
532
542
  values.push(value);
533
543
  }
534
544
  }
@@ -564,6 +574,7 @@
564
574
  * @private
565
575
  * @param {?} path The string value to check.
566
576
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
577
+ * @param {?=} additionalData
567
578
  * @return {?} A string/value.
568
579
  */
569
580
  FilterService.prototype.getValueForString = /**
@@ -572,13 +583,23 @@
572
583
  * @private
573
584
  * @param {?} path The string value to check.
574
585
  * @param {?} currentQuestionnaireForm The current form data, can be null/undefined.
586
+ * @param {?=} additionalData
575
587
  * @return {?} A string/value.
576
588
  */
577
- function (path, currentQuestionnaireForm) {
589
+ function (path, currentQuestionnaireForm, additionalData) {
578
590
  if (currentQuestionnaireForm) {
579
- /** @type {?} */
580
- var control = currentQuestionnaireForm.get(path);
581
- return control ? control.value : this.convertStringToValue(path);
591
+ if (additionalData) {
592
+ /** @type {?} */
593
+ var data = _.get(additionalData, path);
594
+ if (data) {
595
+ return data;
596
+ }
597
+ }
598
+ else {
599
+ /** @type {?} */
600
+ var control = currentQuestionnaireForm.get(path);
601
+ return control ? control.value : this.convertStringToValue(path);
602
+ }
582
603
  }
583
604
  else {
584
605
  return this.convertStringToValue(path);
@@ -666,6 +687,7 @@
666
687
  * @author Will Poulson
667
688
  * @param {?} questionnaire The questionnaire data to build the form group on.
668
689
  * @param {?} currentQuestionnaireForm
690
+ * @param {?=} additionalData
669
691
  * @param {?=} skipFilter
670
692
  * @return {?} A filted form group.
671
693
  */
@@ -675,14 +697,15 @@
675
697
  * @author Will Poulson
676
698
  * @param {?} questionnaire The questionnaire data to build the form group on.
677
699
  * @param {?} currentQuestionnaireForm
700
+ * @param {?=} additionalData
678
701
  * @param {?=} skipFilter
679
702
  * @return {?} A filted form group.
680
703
  */
681
- function (questionnaire, currentQuestionnaireForm, skipFilter) {
704
+ function (questionnaire, currentQuestionnaireForm, additionalData, skipFilter) {
682
705
  /** @type {?} */
683
706
  var sections = skipFilter ?
684
707
  questionnaire.sections :
685
- this.filterService.filterSections(questionnaire.sections, currentQuestionnaireForm);
708
+ this.filterService.filterSections(questionnaire.sections, currentQuestionnaireForm, additionalData);
686
709
  /** @type {?} */
687
710
  var questionnaireForms = this.generateFormsForSections(sections, currentQuestionnaireForm);
688
711
  return { sections: sections, forms: questionnaireForms };
@@ -1155,6 +1178,7 @@
1155
1178
  * @author Will Poulson
1156
1179
  * @param {?} questionnaire The questionnaire data to load, often parsed JSON from the editor.
1157
1180
  * @param {?=} savedState The saved state of the questionnaire, often from localstorage.
1181
+ * @param {?=} additionalData
1158
1182
  * @return {?} null
1159
1183
  */
1160
1184
  QuestionnaireService.prototype.loadQuestionnaire = /**
@@ -1162,9 +1186,10 @@
1162
1186
  * @author Will Poulson
1163
1187
  * @param {?} questionnaire The questionnaire data to load, often parsed JSON from the editor.
1164
1188
  * @param {?=} savedState The saved state of the questionnaire, often from localstorage.
1189
+ * @param {?=} additionalData
1165
1190
  * @return {?} null
1166
1191
  */
1167
- function (questionnaire, savedState) {
1192
+ function (questionnaire, savedState, additionalData) {
1168
1193
  return __awaiter(this, void 0, void 0, function () {
1169
1194
  var e_1, _a, e_2, _b, newData, _c, _d, section, _e, _f, question, control;
1170
1195
  return __generator(this, function (_g) {
@@ -1172,8 +1197,9 @@
1172
1197
  case 0:
1173
1198
  this.originalQuestionnaire = _.cloneDeep(questionnaire);
1174
1199
  this.currentQuestionnaire = _.cloneDeep(questionnaire);
1200
+ this.additionalData = additionalData;
1175
1201
  if (savedState && Object.keys(savedState).length > 0) {
1176
- newData = this.formConstuctor.generateFormsForQuestionnaire(_.cloneDeep(this.originalQuestionnaire), this.currentQuestionnaireForm, true);
1202
+ newData = this.formConstuctor.generateFormsForQuestionnaire(_.cloneDeep(this.originalQuestionnaire), this.currentQuestionnaireForm, this.additionalData, true);
1177
1203
  this.formConstuctor.constructRepeaterFromsFromState(savedState, newData.sections, newData.forms);
1178
1204
  this.currentQuestionnaireForm = newData.forms;
1179
1205
  this.currentQuestionnaireForm.patchValue(savedState);
@@ -1253,7 +1279,7 @@
1253
1279
  function (savedState) {
1254
1280
  var _this = this;
1255
1281
  /** @type {?} */
1256
- var newData = this.formConstuctor.generateFormsForQuestionnaire(_.cloneDeep(this.originalQuestionnaire), this.currentQuestionnaireForm);
1282
+ var newData = this.formConstuctor.generateFormsForQuestionnaire(_.cloneDeep(this.originalQuestionnaire), this.currentQuestionnaireForm, this.additionalData);
1257
1283
  this.currentQuestionnaireForm = newData.forms;
1258
1284
  this.currentQuestionnaire.sections = newData.sections;
1259
1285
  if (savedState && Object.keys(savedState).length > 0) {
@@ -1371,6 +1397,7 @@
1371
1397
  this.currentQuestionnaire = undefined;
1372
1398
  this.currentSectionName = undefined;
1373
1399
  this.currentQuestionName = undefined;
1400
+ this.additionalData = undefined;
1374
1401
  };
1375
1402
  Object.defineProperty(QuestionnaireService.prototype, "currentSection", {
1376
1403
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"glowgreen-gg-questionnaire-v2.umd.js.map","sources":["node_modules/tslib/tslib.es6.js","ng://@glowgreen/gg-questionnaire-v2/lib/enums/question-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/condition-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/condition-relationship.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/services/filter.service.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/validation-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/services/form-constructor.service.ts","ng://@glowgreen/gg-questionnaire-v2/lib/services/questionnaire.service.ts","ng://@glowgreen/gg-questionnaire-v2/lib/gg-questionnaire-v2.module.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/input-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/repeater-question-type.enum.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n 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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n 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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n 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); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n 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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n 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);\r\n 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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","export enum QuestionType {\n Input = 'input',\n Select = 'select',\n Textarea = 'textarea',\n Repeater = 'repeater',\n Checklist = 'checklist',\n Attachment = 'attachment',\n Upload = 'upload',\n Signature = 'signature',\n}\n","export enum ConditionType {\n EqualTo = 'equalTo',\n NotEqualTo = 'notEqualTo',\n LessThan = 'lessThan',\n GreaterThan = 'greaterThan',\n Includes = 'includes',\n Excludes = 'excludes'\n}\n","export enum ConditionRelationship {\n Every = 'every',\n Any = 'any',\n}\n","import { Injectable } from '@angular/core';\nimport { Section } from '../interfaces/section';\nimport { FormGroup } from '@angular/forms';\nimport { Condition } from '../interfaces/condition';\nimport { ConditionGroup } from '../interfaces/condition-group';\nimport { ConditionType } from '../enums/condition-type.enum';\nimport { ConditionRelationship } from '../enums/condition-relationship.enum';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class FilterService {\n\n constructor() { }\n\n /**\n * Filters an array of sections based on their condition groups.\n * @param sections The array of sections to filter.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns An array of filtered sections with their filtered questions.\n * @author Will Poulson\n */\n public filterSections(sections: Array<Section>, currentQuestionnaireForm: FormGroup | null): Array<Section> {\n const filteredSections = [];\n for (const section of sections) {\n if (this.meetsConditionGroups(section.conditionGroups, currentQuestionnaireForm)) {\n const filteredQuestions = [];\n for (const question of section.questions) {\n if (this.meetsConditionGroups(question.conditionGroups, currentQuestionnaireForm)) {\n\n if (question.repeaterQuestions) {\n const filteredRepeaterQuestions = [];\n for (const repeaterQuestion of question.repeaterQuestions) {\n if (this.meetsConditionGroups(repeaterQuestion.conditionGroups, currentQuestionnaireForm)) {\n filteredRepeaterQuestions.push(repeaterQuestion);\n }\n }\n }\n\n filteredQuestions.push(question);\n }\n }\n section.questions = filteredQuestions;\n filteredSections.push(section);\n }\n }\n return filteredSections;\n }\n\n /**\n * Checks if each condition groups conditions have been met.\n * @param conditionGroups The array of condition groups.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A boolean stating if the condition groups conditions has been met.\n * @author Will Poulson\n */\n private meetsConditionGroups(conditionGroups: Array<ConditionGroup>, currentQuestionnaireForm: FormGroup | null): boolean {\n if (!conditionGroups || conditionGroups.length === 0) {\n return true;\n }\n return conditionGroups.every((x) => {\n return this.meetsConditionGroup(x, currentQuestionnaireForm) === true;\n });\n }\n\n /**\n * Checks if a condition groups conditions have been met.\n * @param conditionGroup The condition group to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A boolean stating if the condition group conditions has been met.\n * @author Will Poulson\n */\n private meetsConditionGroup(conditionGroup: ConditionGroup, currentQuestionnaireForm: FormGroup | null): boolean {\n if (!conditionGroup.conditions || conditionGroup.conditions.length === 0) {\n return true;\n }\n\n const results = [];\n\n for (const condition of conditionGroup.conditions) {\n results.push(this.meetsCondition(condition, currentQuestionnaireForm));\n }\n\n switch (conditionGroup.relationship) {\n case ConditionRelationship.Every:\n return results.every((x) => {\n return x === true;\n });\n case ConditionRelationship.Any:\n return !!results.find((x) => {\n return x === true;\n });\n default:\n return true;\n }\n }\n\n /**\n * Checks if a condition has been met.\n * @param condition The condition to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A boolean stating if the condition group conditions has been met.\n * @author Will Poulson\n */\n private meetsCondition(condition: Condition, currentQuestionnaireForm: FormGroup): boolean {\n const v1s: Array<any> = this.getValuesForArray(condition.v1s, currentQuestionnaireForm);\n const v2s: Array<any> = this.getValuesForArray(condition.v2s, currentQuestionnaireForm);\n\n let result = false;\n\n switch (condition.type) {\n case ConditionType.Excludes:\n result = v1s.filter((v1) => {\n return v2s.indexOf(v1) > -1;\n }).length === 0;\n break;\n case ConditionType.Includes:\n result = v1s.filter((v1) => {\n return v2s.indexOf(v1) > -1;\n }).length !== 0;\n break;\n default:\n for (let v2 of v2s) {\n for (let v1 of v1s) {\n switch (condition.type) {\n case ConditionType.EqualTo:\n v1 = this.getStringForValue(v1);\n v2 = this.getStringForValue(v2);\n if (v1 === v2) { result = true; }\n break;\n case ConditionType.NotEqualTo:\n v1 = this.getStringForValue(v1);\n v2 = this.getStringForValue(v2);\n if (v1 !== v2) { result = true; }\n break;\n case ConditionType.GreaterThan:\n v1 = parseFloat(v1);\n v2 = parseFloat(v2);\n if (v1 >= v2) { result = true; }\n break;\n case ConditionType.LessThan:\n v1 = parseFloat(v1);\n v2 = parseFloat(v2);\n if (v1 <= v2) { result = true; }\n break;\n }\n }\n }\n }\n\n return result;\n }\n\n private getStringForValue(value) {\n switch (value) {\n case null:\n return 'null';\n default:\n return value.toString();\n }\n }\n\n /**\n * Gets the current values for an array of strings.\n * @param paths The array of strings to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns An array of strings/values\n * @author Will Poulson\n */\n private getValuesForArray(paths: Array<string>, currentQuestionnaireForm: FormGroup): Array<any> {\n if (currentQuestionnaireForm) {\n const values = [];\n for (const path of paths) {\n const value = this.getValueForString(path, currentQuestionnaireForm);\n values.push(value);\n }\n return values;\n } else {\n return paths;\n }\n }\n\n /**\n * Gets a current value for a string.\n * @param path The string value to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A string/value.\n * @author Will Poulson\n */\n private getValueForString(path: string, currentQuestionnaireForm: FormGroup) {\n if (currentQuestionnaireForm) {\n const control = currentQuestionnaireForm.get(path);\n return control ? control.value : this.convertStringToValue(path);\n } else {\n return this.convertStringToValue(path);\n }\n }\n\n /**\n * Converts a string to a value.\n * Eg. true/false.\n * @param path The string value to check for conversion;\n * @returns Either a string or the converted value.\n * @author Will Poulson\n */\n private convertStringToValue(path: string) {\n switch (path) {\n case 'true':\n return true;\n case 'false':\n return false;\n case 'null':\n return null;\n default:\n return path;\n }\n }\n}\n","export enum ValidationType {\n Required = 'required',\n Boolean = 'boolean',\n Number = 'number',\n String = 'string',\n Email = 'email',\n Telephone = 'telephone',\n}\n","import { Injectable } from '@angular/core';\nimport { FormBuilder, FormGroup, FormControl, AbstractControl, ValidatorFn, Validators, FormArray } from '@angular/forms';\nimport { Section } from '../interfaces/section';\nimport { Question } from '../interfaces/question';\nimport { Questionnaire } from '../interfaces/questionnaire';\nimport { QuestionType } from '../enums/question-type.enum';\nimport { FilterService } from './filter.service';\nimport { Validator } from '../interfaces/validator';\nimport { ValidationType } from '../enums/validation-type.enum';\nimport * as _ from 'lodash';\nimport { RepeaterQuestion } from '../interfaces/repeater-question';\nimport { ChecklistItem } from '../interfaces/checklist-item';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class FormConstructorService {\n\n constructor(\n private fb: FormBuilder,\n private filterService: FilterService\n ) { }\n\n /**\n * Constructs a form group based on the questionnaire data.\n * This form group has been filtered down based on the conditions of the sections and questions.\n * @param questionnaire The questionnaire data to build the form group on.\n * @returns A filted form group.\n * @author Will Poulson\n */\n public generateFormsForQuestionnaire(\n questionnaire: Questionnaire,\n currentQuestionnaireForm: FormGroup,\n skipFilter?: boolean\n ): {sections: Array<Section>; forms: FormGroup} {\n const sections = skipFilter ?\n questionnaire.sections :\n this.filterService.filterSections(questionnaire.sections, currentQuestionnaireForm);\n const questionnaireForms = this.generateFormsForSections(sections, currentQuestionnaireForm);\n return {sections: sections, forms: questionnaireForms};\n }\n\n private generateFormsForSections(sections: Array<Section>, currentQuestionnaireForm: FormGroup) {\n const questionnaireForms: FormGroup = this.fb.group({});\n for (const section of sections) {\n const sectionForms = this.generateFormsForSection(section, currentQuestionnaireForm);\n questionnaireForms.addControl(section.name, sectionForms);\n }\n return questionnaireForms;\n }\n\n /**\n * Constructs a form group based on the section data.\n * This form group has been filtered down based on the conditions of the questions.\n * @param section The section data to build the form group on.\n * @returns A filtered form group.\n * @author Will Poulson\n */\n private generateFormsForSection(section: Section, currentQuestionnaireForm: FormGroup): FormGroup {\n const sectionForms: FormGroup = this.fb.group({});\n for (const question of section.questions) {\n const questionControl = this.generateControlForQuestion(question, section, currentQuestionnaireForm);\n sectionForms.addControl(question.name, questionControl);\n }\n return sectionForms;\n }\n\n /**\n * Constructs an astract form control based on the question data.\n * @param question The question data to build the abstract control on.\n * @returns An abstract control.\n * @author Will Poulson\n */\n private generateControlForQuestion(question: Question, section: Section, currentQuestionnaireForm: FormGroup): AbstractControl {\n const convertedValidators = this.convertValidators(question.validators);\n switch (question.type) {\n case QuestionType.Repeater:\n const currentArray = currentQuestionnaireForm ? (currentQuestionnaireForm.get([section.name, question.name]) as FormArray) : false;\n const newArray = currentArray ? currentArray.controls : [];\n return this.fb.array(newArray, convertedValidators);\n case QuestionType.Checklist:\n return this.generateGroupForChecklist(question, convertedValidators);\n default:\n return this.fb.control(null, { validators: convertedValidators, updateOn: 'blur' });\n }\n }\n\n /**\n * Generates the form group for a checklist question.\n * @param question The question. Must be of type checklist or else null is returned.\n * @returns A form group.\n * @author Will Poulson\n */\n private generateGroupForChecklist(question: Question, convertedValidators) {\n if (question.type !== QuestionType.Checklist || question.checklistItems.length === 0) {\n return null;\n }\n\n const checklistForms: FormGroup = this.fb.group({});\n for (const checklistItem of question.checklistItems) {\n const checklistItemControl = this.fb.control(null, convertedValidators);\n checklistForms.addControl(checklistItem.name, checklistItemControl);\n }\n return checklistForms;\n }\n\n\n /**\n * Generates the form template for a repeater question.\n * @param question The question. Must be of type repeater or else null is returned.\n * @returns A form group.\n * @author Will Poulson\n */\n public generateFormsForRepeater(question: Question): FormGroup {\n if (question.type !== QuestionType.Repeater || question.repeaterQuestions.length === 0) {\n console.log('Question isnt a repeater or has no questions, returning null');\n return null;\n }\n\n const repeaterForms: FormGroup = this.fb.group({});\n for (const repeaterQuestion of question.repeaterQuestions) {\n const repeaterQuestionControl = this.generateControlForRepeaterQuestion(repeaterQuestion);\n repeaterForms.addControl(repeaterQuestion.name, repeaterQuestionControl);\n }\n return repeaterForms;\n }\n\n /**\n * Generates a control for a repeaters question.\n * @param repeaterQuestion A repeater question.\n * @returns An abstract control.\n * @author Will Poulson\n */\n private generateControlForRepeaterQuestion(repeaterQuestion: RepeaterQuestion): AbstractControl {\n const convertedValidators = this.convertValidators(repeaterQuestion.validators);\n return this.fb.control(null, { validators: convertedValidators, updateOn: 'blur' });\n }\n\n /**\n * Converts an array of validators into form validators.\n * @param validators The uncoverted array of validators.\n * @returns A convered array of form validators.\n * @author Will Poulson\n */\n private convertValidators(validators: Array<Validator>): Array<ValidatorFn> {\n if (!validators || validators.length === 0) {\n return [];\n }\n const convertedValidators: Array<ValidatorFn> = [];\n for (const validator of validators) {\n const convertedValidator = this.convertValidator(validator);\n if (convertedValidator) {\n convertedValidators.push(convertedValidator);\n }\n }\n return convertedValidators;\n }\n\n /**\n * Converts a single validator into a form validator.\n * @param validator The unconverted validator.\n * @returns A converted form validator.\n * @author Will Poulson\n */\n private convertValidator(validator: Validator): ValidatorFn | null {\n switch (validator.type) {\n case ValidationType.Required:\n return Validators.required;\n default:\n return null;\n }\n }\n\n /**\n * Constructs the forms for repeaters from saved state.\n * @param savedState The saved state to load.\n * @param sections The sections already generated by the form constructor.\n */\n public constructRepeaterFromsFromState(savedState: any, sections: Array<Section>, currentQuestionnaireForm: FormGroup) {\n for (const section of sections) {\n for (const question of section.questions) {\n if (question.type !== QuestionType.Repeater) {\n continue;\n }\n\n const repeaterArray = savedState[section.name][question.name];\n if (!repeaterArray || repeaterArray.length === 0) {\n continue;\n }\n\n const repeaterFormArray = currentQuestionnaireForm.get([section.name, question.name]) as FormArray;\n\n if (repeaterFormArray.controls.length === repeaterArray.length) {\n continue;\n }\n\n for (const repeaterItem of repeaterArray) {\n const repeaterItemTemplate = this.generateFormsForRepeater(question);\n repeaterFormArray.push(repeaterItemTemplate);\n }\n }\n }\n }\n}\n","import { Injectable, Inject, EventEmitter } from '@angular/core';\nimport { FormConstructorService } from './form-constructor.service';\nimport { Questionnaire } from '../interfaces/questionnaire';\nimport { FormGroup, AbstractControl, FormArray, FormBuilder } from '@angular/forms';\nimport { Section } from '../interfaces/section';\nimport { Question } from '../interfaces/question';\nimport { Subscription } from 'rxjs';\nimport * as _ from 'lodash';\nimport { QuestionnaireOptions } from '../interfaces/questionnaire-options';\nimport { QuestionType } from '../enums/question-type.enum';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class QuestionnaireService {\n public dataChangedEvent: EventEmitter<any> = new EventEmitter<any>();\n\n private originalQuestionnaire: Questionnaire;\n\n private currentQuestionnaire: Questionnaire;\n private currentQuestionnaireForm: FormGroup;\n\n private currentSectionName: string;\n private currentQuestionName: string;\n\n private questionnaireValueChangeSubscription: Subscription;\n private questionValueChangeSubscription: Subscription;\n\n private skippable = false;\n\n constructor(\n private formConstuctor: FormConstructorService,\n @Inject('options') private options: QuestionnaireOptions\n ) { }\n\n /**\n * Loads a questionnaire from data.\n * @param questionnaire The questionnaire data to load, often parsed JSON from the editor.\n * @param savedState The saved state of the questionnaire, often from localstorage.\n * @returns null\n * @author Will Poulson\n */\n public async loadQuestionnaire(questionnaire: Questionnaire, savedState?: Object): Promise<any> {\n this.originalQuestionnaire = _.cloneDeep(questionnaire);\n this.currentQuestionnaire = _.cloneDeep(questionnaire);\n\n if (savedState && Object.keys(savedState).length > 0) {\n const newData = this.formConstuctor.generateFormsForQuestionnaire(\n _.cloneDeep(this.originalQuestionnaire),\n this.currentQuestionnaireForm,\n true\n );\n this.formConstuctor.constructRepeaterFromsFromState(savedState, newData.sections, newData.forms);\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaireForm.patchValue(savedState);\n }\n\n await this.updateQuestionnaire(savedState);\n\n for (const section of this.currentQuestionnaire.sections) {\n for (const question of section.questions) {\n const control = this.currentQuestionnaireForm.get([section.name, question.name]);\n if (!control.value && question.defaultValue) {\n control.setValue(question.defaultValue);\n }\n }\n }\n\n if (this.options.skipToFirstSection) {\n this.currentSectionName = Object.keys(this.currentQuestionnaireForm.controls)[0];\n }\n\n if (this.options.skipToFirstQuestion) {\n this.currentQuestionName = Object.keys(this.currentSection.formGroup.controls)[0];\n }\n\n return;\n }\n\n /**\n * Updates the current questionnaire, used when a value is updated to check conditions.\n * @param savedState The saved state of the questionnaire, often from localstorage.\n * @returns null\n * @author Will Poulson\n */\n public updateQuestionnaire(savedState?: Object): Promise<any> {\n const newData = this.formConstuctor.generateFormsForQuestionnaire(\n _.cloneDeep(this.originalQuestionnaire),\n this.currentQuestionnaireForm\n );\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaire.sections = newData.sections;\n\n if (savedState && Object.keys(savedState).length > 0) {\n this.currentQuestionnaireForm.patchValue(savedState);\n }\n\n if (this.questionnaireValueChangeSubscription) {\n this.questionnaireValueChangeSubscription.unsubscribe();\n }\n\n if (this.questionValueChangeSubscription) {\n this.questionValueChangeSubscription.unsubscribe();\n }\n\n this.questionnaireValueChangeSubscription = this.currentQuestionnaireForm.valueChanges.subscribe(() => {\n this.dataChangedEvent.emit();\n this.updateQuestionnaire(this.currentQuestionnaireForm.getRawValue());\n });\n\n if (this.currentQuestion) {\n this.questionValueChangeSubscription = this.currentQuestion.formControl.valueChanges.subscribe(() => {\n this.clearFields(this.currentQuestion.data.clearfields);\n });\n }\n\n return;\n }\n\n public get isValid() {\n return this.currentQuestionnaireForm.valid;\n }\n\n public sectionValid(name: string) {\n return this.currentQuestionnaireForm.get(name).valid;\n }\n\n /**\n * Clears all the fields parsed\n * @param clearfields An array of strings, paths to clear.\n * @author Will Poulson\n */\n private clearFields(clearfields: Array<string>) {\n if (!clearfields || clearfields.length === 0) {\n return;\n }\n\n for (const clearfield of clearfields) {\n const control = this.currentQuestionnaireForm.get(clearfield);\n\n if (control) {\n control.reset(undefined);\n }\n }\n }\n\n /**\n * Unloads the current questionnaire.\n * Useful when exiting a questionnaire page or completing a questionnaire.\n * @author Will Poulson\n */\n public unloadQuestionnaire() {\n this.originalQuestionnaire = undefined;\n this.currentQuestionnaireForm = undefined;\n this.currentQuestionnaire = undefined;\n this.currentSectionName = undefined;\n this.currentQuestionName = undefined;\n }\n\n /**\n * Gets the current selected section.\n * @returns An object containing the section data and the related form group.\n * @author Will Poulson\n */\n public get currentSection(): { data: Section; formGroup: FormGroup; } | null {\n if (!this.currentSectionName) {\n return null;\n }\n\n const data = this.currentQuestionnaire.sections.find((x) => {\n return x.name === this.currentSectionName;\n });\n\n if (!data) {\n return null;\n }\n\n return {\n data: data,\n formGroup: this.currentQuestionnaireForm.get(data.name) as FormGroup\n };\n }\n\n /**\n * Gets all the avaialble sections.\n * @returns An array of all avaialble sections.\n * @author Will Poulson\n */\n public get availableSections(): Array<Section> {\n if (!this.currentQuestionnaire || !this.currentQuestionnaire.sections) {\n return [];\n }\n return this.currentQuestionnaire.sections;\n }\n\n /**\n * Gets the current data for the entire questionnaire.\n * @returns An object of data.\n * @author Will Poulson\n */\n public get currentData() {\n return this.currentQuestionnaireForm.getRawValue();\n }\n\n\n /**\n * Gets the current selected question.\n * @returns An object containing the question data and the related form control.\n * @author Will Poulson\n */\n public get currentQuestion(): { data: Question; formControl: AbstractControl; } | null {\n if (!this.currentQuestionName) {\n return null;\n }\n\n const data = this.currentSection.data.questions.find((x) => {\n return x.name === this.currentQuestionName;\n });\n\n if (!data) {\n return null;\n }\n\n return {\n data: data,\n formControl: this.currentSection.formGroup.get(data.name) as AbstractControl\n };\n }\n\n /**\n * Navigates to the next question.\n * If there is no question to navigate to it will reject with a out of bounds exception.\n * If allowSkipRequiredField is false then it will reject if the current question is invalid.\n * If emitSectionFinishEvent is true then it will emit an event if it's navigating past the length of questions.\n * @returns A promise which will resolve when the question has been navigated to.\n * @author Will Poulson\n */\n public nextQuestion() {\n return new Promise((resolve, reject) => {\n if (!this.options.allowSkipRequiredField) {\n if (!this.currentQuestion.formControl.valid) {\n return reject('Current question is invalid');\n }\n }\n\n this.getCurrentQuestionIndex().then((currentIndex) => {\n const newIndex = currentIndex + 1;\n\n this.navigateToQuestion(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Navigates to the previous question.\n * If there is no question to navigate to it will reject with a out of bounds exception.\n * If allowNavigateBackwards is false then it will reject.\n * @returns A promise which will resolve when the question has been navigated to.\n * @author Will Poulson\n */\n public prevQuestion() {\n return new Promise((resolve, reject) => {\n if (!this.options.allowNavigateBackwards) {\n return reject('This questionnaire does not allow for backwards navigation');\n }\n\n this.getCurrentQuestionIndex().then((currentIndex) => {\n const newIndex = currentIndex - 1;\n\n this.navigateToQuestion(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Gets the current questions index.\n * @returns A promise which resolves a number.\n * @author Will Poulson\n */\n private getCurrentQuestionIndex(): Promise<number> {\n return new Promise((resolve, reject) => {\n const currentIndex = this.currentSection.data.questions.indexOf(this.currentQuestion.data);\n\n if (currentIndex === -1) {\n return reject('Could not find current question');\n }\n\n return resolve(currentIndex);\n });\n }\n\n /**\n * Checks a question is in bounds then navigates to it.\n * @param index The index to navigate to.\n * @returns A promise which will resolve when the question has been navigated to.\n * @author Will Poulson\n */\n public navigateToQuestion(index: number) {\n return new Promise((resolve, reject) => {\n if (this.currentSection.data.questions.length - 1 < index || index < 0) {\n return reject('Out of bounds exception');\n }\n\n this.currentQuestionName = this.currentSection.data.questions[index].name;\n return resolve();\n });\n }\n\n /**\n * Navigates to the next section.\n * @returns A promise which will resolve when the section has been navigated to.\n * @author Will Poulson\n */\n public nextSection() {\n return new Promise((resolve, reject) => {\n this.getCurrentSectionIndex().then((currentIndex) => {\n const newIndex = currentIndex + 1;\n this.navigateToSection(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Navigates to the previous section.\n * @returns A promise which will resolve when the section has been navigated to.\n * @author Will Poulson\n */\n public prevSection() {\n return new Promise((resolve, reject) => {\n this.getCurrentSectionIndex().then((currentIndex) => {\n const newIndex = currentIndex - 1;\n this.navigateToQuestion(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Gets the current section index.\n * @returns A promise which resolves a number.\n * @author Will Poulson\n */\n private getCurrentSectionIndex(): Promise<number> {\n return new Promise((resolve, reject) => {\n const currentIndex = this.currentQuestionnaire.sections.indexOf(this.currentSection.data);\n\n if (currentIndex === -1) {\n return reject('Could not find current section');\n }\n\n return resolve(currentIndex);\n });\n }\n\n /**\n * Checks a section is in bounds then navigates to it.\n * @param index The index to navigate to.\n * @returns A promise which will resolve when the section has been navigated to.\n * @author Will Poulson\n */\n public navigateToSection(index: number) {\n return new Promise((resolve, reject) => {\n if (this.currentQuestionnaire.sections.length - 1 < index || index < 0) {\n return reject('Out of bounds exception');\n }\n\n this.currentSectionName = this.currentQuestionnaire.sections[index].name;\n return resolve();\n });\n }\n\n /**\n * Answers the current question with the parsed value.\n * @param answer The value to answer the question with.\n * @author Will Poulson\n */\n public answerCurrentQuestion(answer: any, sendToNextQuestion?: boolean) {\n this.currentQuestion.formControl.setValue(answer);\n if (sendToNextQuestion && this.skippable) { // Timeout to prevent skipping glitch.\n this.skippable = false;\n setTimeout(() => {\n this.nextQuestion();\n this.skippable = true;\n }, 150);\n }\n }\n\n /**\n * Adds a repeater item to the current question.\n * Current question must be of type Repeater.\n * @returns A promise which resolves when the repeater item has been added.\n * @author Will Poulson\n */\n public addRepeaterItem() {\n return new Promise((resolve, reject) => {\n if (this.currentQuestion.data.type !== QuestionType.Repeater) {\n return reject(`Current question isn't a repeater`);\n }\n const repeaterForm = this.formConstuctor.generateFormsForRepeater(this.currentQuestion.data);\n\n if (!repeaterForm) {\n return reject(`Repeater template failed to generate. May be due to the repeater having no items in the editor.`);\n }\n\n\n if (!(this.currentQuestion.formControl instanceof FormArray)) {\n return reject(`The current questions control isn't of type FormArray`);\n }\n\n this.currentQuestion.formControl.push(repeaterForm);\n return resolve();\n });\n }\n\n /**\n * Removes a repeater item on the current question.\n * Current question must be of type Repeater.\n * @param index The index at which to remove.\n * @returns A promise which resolves when the repeater item has been removed.\n * @author Will Poulson\n */\n public removeRepeaterItem(index: number) {\n return new Promise((resolve, reject) => {\n if (this.currentQuestion.data.type !== QuestionType.Repeater) {\n return reject(`Current question isn't a repeater`);\n }\n\n if (!(this.currentQuestion.formControl instanceof FormArray)) {\n return reject(`The current questions control isn't of type FormArray`);\n }\n\n this.currentQuestion.formControl.removeAt(index);\n return resolve();\n });\n }\n\n /**\n * Returns the display text for a given repeater item\n * @param index The index at which to get the label for.\n * @returns A string which is the display text.\n * @author Will Poulson\n */\n public getRepeaterItemLabel(index: number): string {\n if (!this.currentQuestion.formControl || !(this.currentQuestion.formControl instanceof FormArray)) {\n return '';\n }\n\n const repeaterItem = this.currentQuestion.formControl.controls[index];\n\n if (!repeaterItem) {\n return '';\n }\n\n const template = this.currentQuestion.data.repeaterDisplayName;\n const splitTemplate = template.split(' ');\n\n const displayArray = [];\n for (const templateItem of splitTemplate) {\n if (templateItem.match(/\\[.*?\\]/)) {\n const path = templateItem.replace(/[\\[\\]']+/g, '');\n const item = repeaterItem.get(path);\n const value = item.value ? item.value : '?';\n displayArray.push(value);\n } else {\n displayArray.push(templateItem);\n }\n }\n\n const display = displayArray.join(' ');\n return display;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormConstructorService } from './services/form-constructor.service';\nimport { QuestionnaireService } from './services/questionnaire.service';\nimport { FilterService } from './services/filter.service';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { QuestionnaireOptions } from './interfaces/questionnaire-options';\nimport { ModuleWithProviders } from '@angular/compiler/src/core';\n\n@NgModule({\n declarations: [],\n providers: [\n FormConstructorService,\n FilterService\n ],\n imports: [\n FormsModule,\n ReactiveFormsModule\n ],\n})\nexport class GgQuestionnaireV2Module {\n public static forRoot(options: QuestionnaireOptions): ModuleWithProviders {\n return {\n ngModule: GgQuestionnaireV2Module,\n providers: [\n QuestionnaireService,\n {\n provide: 'options',\n useValue: options\n }\n ]\n };\n }\n}\n","export enum InputType {\n Text = 'text',\n Number = 'number',\n Email = 'email',\n Telephone = 'tel',\n Password = 'password',\n Color = 'color',\n Date = 'date',\n DateTimeLocal = 'datetime-local',\n Time = 'time',\n Month = 'month',\n Week = 'week',\n}\n","export enum RepeaterQuestionType {\n Input = 'input',\n Select = 'select',\n}\n"],"names":["_","tslib_1.__values","Injectable","Validators","FormBuilder","EventEmitter","_.cloneDeep","FormArray","Inject","NgModule","FormsModule","ReactiveFormsModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;AAcA,aAmDgB,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS;QACvD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM;YACrD,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC3F,SAAS,QAAQ,CAAC,KAAK,IAAI,IAAI;gBA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GAAG,GAAG;4BAC3C,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;yBAC1B;6BAAM;4BACL,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;yBACjC;qBACF;;;;;;;;;;;;;;;;oBAEK,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;gBACtC,OAAO,OAAO,CAAC;aAChB;;oBAleFC,aAAU,SAAC;wBACV,UAAU,EAAE,MAAM;qBACnB;;;;;wBAZQ,sBAAsB;wDA+B1BM,SAAM,SAAC,SAAS;;;;mCAhCrB;KAWA;;;;;;ACXA;QAQA;SAwBC;;;;;QAZe,+BAAO;;;;YAArB,UAAsB,OAA6B;gBACjD,OAAO;oBACH,QAAQ,EAAE,uBAAuB;oBACjC,SAAS,EAAE;wBACP,oBAAoB;wBACpB;4BACI,OAAO,EAAE,SAAS;4BAClB,QAAQ,EAAE,OAAO;yBACpB;qBACJ;iBACJ,CAAC;aACH;;oBAvBFC,WAAQ,SAAC;wBACR,YAAY,EAAE,EAAE;wBAChB,SAAS,EAAE;4BACT,sBAAsB;4BACtB,aAAa;yBACd;wBACD,OAAO,EAAE;4BACPC,cAAW;4BACXC,sBAAmB;yBACpB;qBACF;;QAcD,8BAAC;KAxBD;;;;;;;;QCPI,MAAO,MAAM;QACb,QAAS,QAAQ;QACjB,OAAQ,OAAO;QACf,WAAY,KAAK;QACjB,UAAW,UAAU;QACrB,OAAQ,OAAO;QACf,MAAO,MAAM;QACb,eAAgB,gBAAgB;QAChC,MAAO,MAAM;QACb,OAAQ,OAAO;QACf,MAAO,MAAM;;;;;;;;;QCVb,OAAQ,OAAO;QACf,QAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"glowgreen-gg-questionnaire-v2.umd.js.map","sources":["node_modules/tslib/tslib.es6.js","ng://@glowgreen/gg-questionnaire-v2/lib/enums/question-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/condition-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/condition-relationship.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/services/filter.service.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/validation-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/services/form-constructor.service.ts","ng://@glowgreen/gg-questionnaire-v2/lib/services/questionnaire.service.ts","ng://@glowgreen/gg-questionnaire-v2/lib/gg-questionnaire-v2.module.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/input-type.enum.ts","ng://@glowgreen/gg-questionnaire-v2/lib/enums/repeater-question-type.enum.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n 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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n 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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n 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); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n 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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n 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);\r\n 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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","export enum QuestionType {\n Input = 'input',\n Select = 'select',\n Textarea = 'textarea',\n Repeater = 'repeater',\n Checklist = 'checklist',\n Attachment = 'attachment',\n Upload = 'upload',\n Signature = 'signature',\n}\n","export enum ConditionType {\n EqualTo = 'equalTo',\n NotEqualTo = 'notEqualTo',\n LessThan = 'lessThan',\n GreaterThan = 'greaterThan',\n Includes = 'includes',\n Excludes = 'excludes'\n}\n","export enum ConditionRelationship {\n Every = 'every',\n Any = 'any',\n}\n","import { Injectable } from '@angular/core';\nimport { Section } from '../interfaces/section';\nimport { FormGroup } from '@angular/forms';\nimport { Condition } from '../interfaces/condition';\nimport { ConditionGroup } from '../interfaces/condition-group';\nimport { ConditionType } from '../enums/condition-type.enum';\nimport { ConditionRelationship } from '../enums/condition-relationship.enum';\nimport * as _ from 'lodash';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class FilterService {\n\n constructor() { }\n\n /**\n * Filters an array of sections based on their condition groups.\n * @param sections The array of sections to filter.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns An array of filtered sections with their filtered questions.\n * @author Will Poulson\n */\n public filterSections(sections: Array<Section>, currentQuestionnaireForm: FormGroup | null, additionalData?: Object): Array<Section> {\n const filteredSections = [];\n for (const section of sections) {\n if (this.meetsConditionGroups(section.conditionGroups, currentQuestionnaireForm, additionalData)) {\n const filteredQuestions = [];\n for (const question of section.questions) {\n if (this.meetsConditionGroups(question.conditionGroups, currentQuestionnaireForm, additionalData)) {\n\n if (question.repeaterQuestions) {\n const filteredRepeaterQuestions = [];\n for (const repeaterQuestion of question.repeaterQuestions) {\n if (this.meetsConditionGroups(repeaterQuestion.conditionGroups, currentQuestionnaireForm, additionalData)) {\n filteredRepeaterQuestions.push(repeaterQuestion);\n }\n }\n }\n\n filteredQuestions.push(question);\n }\n }\n section.questions = filteredQuestions;\n filteredSections.push(section);\n }\n }\n return filteredSections;\n }\n\n /**\n * Checks if each condition groups conditions have been met.\n * @param conditionGroups The array of condition groups.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A boolean stating if the condition groups conditions has been met.\n * @author Will Poulson\n */\n private meetsConditionGroups(\n conditionGroups: Array<ConditionGroup>,\n currentQuestionnaireForm: FormGroup | null,\n additionalData?: Object\n ): boolean {\n if (!conditionGroups || conditionGroups.length === 0) {\n return true;\n }\n return conditionGroups.every((x) => {\n return this.meetsConditionGroup(x, currentQuestionnaireForm, additionalData) === true;\n });\n }\n\n /**\n * Checks if a condition groups conditions have been met.\n * @param conditionGroup The condition group to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A boolean stating if the condition group conditions has been met.\n * @author Will Poulson\n */\n private meetsConditionGroup(\n conditionGroup: ConditionGroup,\n currentQuestionnaireForm: FormGroup | null,\n additionalData?: Object\n ): boolean {\n if (!conditionGroup.conditions || conditionGroup.conditions.length === 0) {\n return true;\n }\n\n const results = [];\n\n for (const condition of conditionGroup.conditions) {\n results.push(this.meetsCondition(condition, currentQuestionnaireForm, additionalData));\n }\n\n switch (conditionGroup.relationship) {\n case ConditionRelationship.Every:\n return results.every((x) => {\n return x === true;\n });\n case ConditionRelationship.Any:\n return !!results.find((x) => {\n return x === true;\n });\n default:\n return true;\n }\n }\n\n /**\n * Checks if a condition has been met.\n * @param condition The condition to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A boolean stating if the condition group conditions has been met.\n * @author Will Poulson\n */\n private meetsCondition(condition: Condition, currentQuestionnaireForm: FormGroup, additionalData?: Object): boolean {\n const v1s: Array<any> = this.getValuesForArray(condition.v1s, currentQuestionnaireForm, additionalData);\n const v2s: Array<any> = this.getValuesForArray(condition.v2s, currentQuestionnaireForm, additionalData);\n\n let result = false;\n\n switch (condition.type) {\n case ConditionType.Excludes:\n result = v1s.filter((v1) => {\n return v2s.indexOf(v1) > -1;\n }).length === 0;\n break;\n case ConditionType.Includes:\n result = v1s.filter((v1) => {\n return v2s.indexOf(v1) > -1;\n }).length !== 0;\n break;\n default:\n for (let v2 of v2s) {\n for (let v1 of v1s) {\n switch (condition.type) {\n case ConditionType.EqualTo:\n v1 = this.getStringForValue(v1);\n v2 = this.getStringForValue(v2);\n if (v1 === v2) { result = true; }\n break;\n case ConditionType.NotEqualTo:\n v1 = this.getStringForValue(v1);\n v2 = this.getStringForValue(v2);\n if (v1 !== v2) { result = true; }\n break;\n case ConditionType.GreaterThan:\n v1 = parseFloat(v1);\n v2 = parseFloat(v2);\n if (v1 >= v2) { result = true; }\n break;\n case ConditionType.LessThan:\n v1 = parseFloat(v1);\n v2 = parseFloat(v2);\n if (v1 <= v2) { result = true; }\n break;\n }\n }\n }\n }\n\n return result;\n }\n\n private getStringForValue(value) {\n switch (value) {\n case null:\n return 'null';\n default:\n return value.toString();\n }\n }\n\n /**\n * Gets the current values for an array of strings.\n * @param paths The array of strings to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns An array of strings/values\n * @author Will Poulson\n */\n private getValuesForArray(paths: Array<string>, currentQuestionnaireForm: FormGroup, additionalData?: Object): Array<any> {\n if (currentQuestionnaireForm) {\n const values = [];\n for (const path of paths) {\n const value = this.getValueForString(path, currentQuestionnaireForm, additionalData);\n values.push(value);\n }\n return values;\n } else {\n return paths;\n }\n }\n\n /**\n * Gets a current value for a string.\n * @param path The string value to check.\n * @param currentQuestionnaireForm The current form data, can be null/undefined.\n * @returns A string/value.\n * @author Will Poulson\n */\n private getValueForString(path: string, currentQuestionnaireForm: FormGroup, additionalData?: Object) {\n if (currentQuestionnaireForm) {\n if (additionalData) {\n const data = _.get(additionalData, path);\n if (data) {\n return data;\n }\n } else {\n const control = currentQuestionnaireForm.get(path);\n return control ? control.value : this.convertStringToValue(path);\n }\n } else {\n return this.convertStringToValue(path);\n }\n }\n\n /**\n * Converts a string to a value.\n * Eg. true/false.\n * @param path The string value to check for conversion;\n * @returns Either a string or the converted value.\n * @author Will Poulson\n */\n private convertStringToValue(path: string) {\n switch (path) {\n case 'true':\n return true;\n case 'false':\n return false;\n case 'null':\n return null;\n default:\n return path;\n }\n }\n}\n","export enum ValidationType {\n Required = 'required',\n Boolean = 'boolean',\n Number = 'number',\n String = 'string',\n Email = 'email',\n Telephone = 'telephone',\n}\n","import { Injectable } from '@angular/core';\nimport { FormBuilder, FormGroup, FormControl, AbstractControl, ValidatorFn, Validators, FormArray } from '@angular/forms';\nimport { Section } from '../interfaces/section';\nimport { Question } from '../interfaces/question';\nimport { Questionnaire } from '../interfaces/questionnaire';\nimport { QuestionType } from '../enums/question-type.enum';\nimport { FilterService } from './filter.service';\nimport { Validator } from '../interfaces/validator';\nimport { ValidationType } from '../enums/validation-type.enum';\nimport * as _ from 'lodash';\nimport { RepeaterQuestion } from '../interfaces/repeater-question';\nimport { ChecklistItem } from '../interfaces/checklist-item';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class FormConstructorService {\n\n constructor(\n private fb: FormBuilder,\n private filterService: FilterService\n ) { }\n\n /**\n * Constructs a form group based on the questionnaire data.\n * This form group has been filtered down based on the conditions of the sections and questions.\n * @param questionnaire The questionnaire data to build the form group on.\n * @returns A filted form group.\n * @author Will Poulson\n */\n public generateFormsForQuestionnaire(\n questionnaire: Questionnaire,\n currentQuestionnaireForm: FormGroup,\n additionalData?: Object,\n skipFilter?: boolean\n ): {sections: Array<Section>; forms: FormGroup} {\n const sections = skipFilter ?\n questionnaire.sections :\n this.filterService.filterSections(questionnaire.sections, currentQuestionnaireForm, additionalData);\n const questionnaireForms = this.generateFormsForSections(sections, currentQuestionnaireForm);\n return {sections: sections, forms: questionnaireForms};\n }\n\n private generateFormsForSections(sections: Array<Section>, currentQuestionnaireForm: FormGroup) {\n const questionnaireForms: FormGroup = this.fb.group({});\n for (const section of sections) {\n const sectionForms = this.generateFormsForSection(section, currentQuestionnaireForm);\n questionnaireForms.addControl(section.name, sectionForms);\n }\n return questionnaireForms;\n }\n\n /**\n * Constructs a form group based on the section data.\n * This form group has been filtered down based on the conditions of the questions.\n * @param section The section data to build the form group on.\n * @returns A filtered form group.\n * @author Will Poulson\n */\n private generateFormsForSection(section: Section, currentQuestionnaireForm: FormGroup): FormGroup {\n const sectionForms: FormGroup = this.fb.group({});\n for (const question of section.questions) {\n const questionControl = this.generateControlForQuestion(question, section, currentQuestionnaireForm);\n sectionForms.addControl(question.name, questionControl);\n }\n return sectionForms;\n }\n\n /**\n * Constructs an astract form control based on the question data.\n * @param question The question data to build the abstract control on.\n * @returns An abstract control.\n * @author Will Poulson\n */\n private generateControlForQuestion(question: Question, section: Section, currentQuestionnaireForm: FormGroup): AbstractControl {\n const convertedValidators = this.convertValidators(question.validators);\n switch (question.type) {\n case QuestionType.Repeater:\n const currentArray = currentQuestionnaireForm ? (currentQuestionnaireForm.get([section.name, question.name]) as FormArray) : false;\n const newArray = currentArray ? currentArray.controls : [];\n return this.fb.array(newArray, convertedValidators);\n case QuestionType.Checklist:\n return this.generateGroupForChecklist(question, convertedValidators);\n default:\n return this.fb.control(null, { validators: convertedValidators, updateOn: 'blur' });\n }\n }\n\n /**\n * Generates the form group for a checklist question.\n * @param question The question. Must be of type checklist or else null is returned.\n * @returns A form group.\n * @author Will Poulson\n */\n private generateGroupForChecklist(question: Question, convertedValidators) {\n if (question.type !== QuestionType.Checklist || question.checklistItems.length === 0) {\n return null;\n }\n\n const checklistForms: FormGroup = this.fb.group({});\n for (const checklistItem of question.checklistItems) {\n const checklistItemControl = this.fb.control(null, convertedValidators);\n checklistForms.addControl(checklistItem.name, checklistItemControl);\n }\n return checklistForms;\n }\n\n\n /**\n * Generates the form template for a repeater question.\n * @param question The question. Must be of type repeater or else null is returned.\n * @returns A form group.\n * @author Will Poulson\n */\n public generateFormsForRepeater(question: Question): FormGroup {\n if (question.type !== QuestionType.Repeater || question.repeaterQuestions.length === 0) {\n console.log('Question isnt a repeater or has no questions, returning null');\n return null;\n }\n\n const repeaterForms: FormGroup = this.fb.group({});\n for (const repeaterQuestion of question.repeaterQuestions) {\n const repeaterQuestionControl = this.generateControlForRepeaterQuestion(repeaterQuestion);\n repeaterForms.addControl(repeaterQuestion.name, repeaterQuestionControl);\n }\n return repeaterForms;\n }\n\n /**\n * Generates a control for a repeaters question.\n * @param repeaterQuestion A repeater question.\n * @returns An abstract control.\n * @author Will Poulson\n */\n private generateControlForRepeaterQuestion(repeaterQuestion: RepeaterQuestion): AbstractControl {\n const convertedValidators = this.convertValidators(repeaterQuestion.validators);\n return this.fb.control(null, { validators: convertedValidators, updateOn: 'blur' });\n }\n\n /**\n * Converts an array of validators into form validators.\n * @param validators The uncoverted array of validators.\n * @returns A convered array of form validators.\n * @author Will Poulson\n */\n private convertValidators(validators: Array<Validator>): Array<ValidatorFn> {\n if (!validators || validators.length === 0) {\n return [];\n }\n const convertedValidators: Array<ValidatorFn> = [];\n for (const validator of validators) {\n const convertedValidator = this.convertValidator(validator);\n if (convertedValidator) {\n convertedValidators.push(convertedValidator);\n }\n }\n return convertedValidators;\n }\n\n /**\n * Converts a single validator into a form validator.\n * @param validator The unconverted validator.\n * @returns A converted form validator.\n * @author Will Poulson\n */\n private convertValidator(validator: Validator): ValidatorFn | null {\n switch (validator.type) {\n case ValidationType.Required:\n return Validators.required;\n default:\n return null;\n }\n }\n\n /**\n * Constructs the forms for repeaters from saved state.\n * @param savedState The saved state to load.\n * @param sections The sections already generated by the form constructor.\n */\n public constructRepeaterFromsFromState(savedState: any, sections: Array<Section>, currentQuestionnaireForm: FormGroup) {\n for (const section of sections) {\n for (const question of section.questions) {\n if (question.type !== QuestionType.Repeater) {\n continue;\n }\n\n const repeaterArray = savedState[section.name][question.name];\n if (!repeaterArray || repeaterArray.length === 0) {\n continue;\n }\n\n const repeaterFormArray = currentQuestionnaireForm.get([section.name, question.name]) as FormArray;\n\n if (repeaterFormArray.controls.length === repeaterArray.length) {\n continue;\n }\n\n for (const repeaterItem of repeaterArray) {\n const repeaterItemTemplate = this.generateFormsForRepeater(question);\n repeaterFormArray.push(repeaterItemTemplate);\n }\n }\n }\n }\n}\n","import { Injectable, Inject, EventEmitter } from '@angular/core';\nimport { FormConstructorService } from './form-constructor.service';\nimport { Questionnaire } from '../interfaces/questionnaire';\nimport { FormGroup, AbstractControl, FormArray, FormBuilder } from '@angular/forms';\nimport { Section } from '../interfaces/section';\nimport { Question } from '../interfaces/question';\nimport { Subscription } from 'rxjs';\nimport * as _ from 'lodash';\nimport { QuestionnaireOptions } from '../interfaces/questionnaire-options';\nimport { QuestionType } from '../enums/question-type.enum';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class QuestionnaireService {\n public dataChangedEvent: EventEmitter<any> = new EventEmitter<any>();\n\n private originalQuestionnaire: Questionnaire;\n\n private currentQuestionnaire: Questionnaire;\n private currentQuestionnaireForm: FormGroup;\n\n private currentSectionName: string;\n private currentQuestionName: string;\n\n private questionnaireValueChangeSubscription: Subscription;\n private questionValueChangeSubscription: Subscription;\n\n private additionalData: Object;\n\n private skippable = false;\n\n constructor(\n private formConstuctor: FormConstructorService,\n @Inject('options') private options: QuestionnaireOptions\n ) { }\n\n /**\n * Loads a questionnaire from data.\n * @param questionnaire The questionnaire data to load, often parsed JSON from the editor.\n * @param savedState The saved state of the questionnaire, often from localstorage.\n * @returns null\n * @author Will Poulson\n */\n public async loadQuestionnaire(questionnaire: Questionnaire, savedState?: Object, additionalData?: Object): Promise<any> {\n this.originalQuestionnaire = _.cloneDeep(questionnaire);\n this.currentQuestionnaire = _.cloneDeep(questionnaire);\n\n this.additionalData = additionalData;\n\n if (savedState && Object.keys(savedState).length > 0) {\n const newData = this.formConstuctor.generateFormsForQuestionnaire(\n _.cloneDeep(this.originalQuestionnaire),\n this.currentQuestionnaireForm,\n this.additionalData,\n true\n );\n this.formConstuctor.constructRepeaterFromsFromState(savedState, newData.sections, newData.forms);\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaireForm.patchValue(savedState);\n }\n\n await this.updateQuestionnaire(savedState);\n\n for (const section of this.currentQuestionnaire.sections) {\n for (const question of section.questions) {\n const control = this.currentQuestionnaireForm.get([section.name, question.name]);\n if (!control.value && question.defaultValue) {\n control.setValue(question.defaultValue);\n }\n }\n }\n\n if (this.options.skipToFirstSection) {\n this.currentSectionName = Object.keys(this.currentQuestionnaireForm.controls)[0];\n }\n\n if (this.options.skipToFirstQuestion) {\n this.currentQuestionName = Object.keys(this.currentSection.formGroup.controls)[0];\n }\n\n return;\n }\n\n /**\n * Updates the current questionnaire, used when a value is updated to check conditions.\n * @param savedState The saved state of the questionnaire, often from localstorage.\n * @returns null\n * @author Will Poulson\n */\n public updateQuestionnaire(savedState?: Object): Promise<any> {\n const newData = this.formConstuctor.generateFormsForQuestionnaire(\n _.cloneDeep(this.originalQuestionnaire),\n this.currentQuestionnaireForm,\n this.additionalData\n );\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaire.sections = newData.sections;\n\n if (savedState && Object.keys(savedState).length > 0) {\n this.currentQuestionnaireForm.patchValue(savedState);\n }\n\n if (this.questionnaireValueChangeSubscription) {\n this.questionnaireValueChangeSubscription.unsubscribe();\n }\n\n if (this.questionValueChangeSubscription) {\n this.questionValueChangeSubscription.unsubscribe();\n }\n\n this.questionnaireValueChangeSubscription = this.currentQuestionnaireForm.valueChanges.subscribe(() => {\n this.dataChangedEvent.emit();\n this.updateQuestionnaire(this.currentQuestionnaireForm.getRawValue());\n });\n\n if (this.currentQuestion) {\n this.questionValueChangeSubscription = this.currentQuestion.formControl.valueChanges.subscribe(() => {\n this.clearFields(this.currentQuestion.data.clearfields);\n });\n }\n\n return;\n }\n\n public get isValid() {\n return this.currentQuestionnaireForm.valid;\n }\n\n public sectionValid(name: string) {\n return this.currentQuestionnaireForm.get(name).valid;\n }\n\n /**\n * Clears all the fields parsed\n * @param clearfields An array of strings, paths to clear.\n * @author Will Poulson\n */\n private clearFields(clearfields: Array<string>) {\n if (!clearfields || clearfields.length === 0) {\n return;\n }\n\n for (const clearfield of clearfields) {\n const control = this.currentQuestionnaireForm.get(clearfield);\n\n if (control) {\n control.reset(undefined);\n }\n }\n }\n\n /**\n * Unloads the current questionnaire.\n * Useful when exiting a questionnaire page or completing a questionnaire.\n * @author Will Poulson\n */\n public unloadQuestionnaire() {\n this.originalQuestionnaire = undefined;\n this.currentQuestionnaireForm = undefined;\n this.currentQuestionnaire = undefined;\n this.currentSectionName = undefined;\n this.currentQuestionName = undefined;\n this.additionalData = undefined;\n }\n\n /**\n * Gets the current selected section.\n * @returns An object containing the section data and the related form group.\n * @author Will Poulson\n */\n public get currentSection(): { data: Section; formGroup: FormGroup; } | null {\n if (!this.currentSectionName) {\n return null;\n }\n\n const data = this.currentQuestionnaire.sections.find((x) => {\n return x.name === this.currentSectionName;\n });\n\n if (!data) {\n return null;\n }\n\n return {\n data: data,\n formGroup: this.currentQuestionnaireForm.get(data.name) as FormGroup\n };\n }\n\n /**\n * Gets all the avaialble sections.\n * @returns An array of all avaialble sections.\n * @author Will Poulson\n */\n public get availableSections(): Array<Section> {\n if (!this.currentQuestionnaire || !this.currentQuestionnaire.sections) {\n return [];\n }\n return this.currentQuestionnaire.sections;\n }\n\n /**\n * Gets the current data for the entire questionnaire.\n * @returns An object of data.\n * @author Will Poulson\n */\n public get currentData() {\n return this.currentQuestionnaireForm.getRawValue();\n }\n\n\n /**\n * Gets the current selected question.\n * @returns An object containing the question data and the related form control.\n * @author Will Poulson\n */\n public get currentQuestion(): { data: Question; formControl: AbstractControl; } | null {\n if (!this.currentQuestionName) {\n return null;\n }\n\n const data = this.currentSection.data.questions.find((x) => {\n return x.name === this.currentQuestionName;\n });\n\n if (!data) {\n return null;\n }\n\n return {\n data: data,\n formControl: this.currentSection.formGroup.get(data.name) as AbstractControl\n };\n }\n\n /**\n * Navigates to the next question.\n * If there is no question to navigate to it will reject with a out of bounds exception.\n * If allowSkipRequiredField is false then it will reject if the current question is invalid.\n * If emitSectionFinishEvent is true then it will emit an event if it's navigating past the length of questions.\n * @returns A promise which will resolve when the question has been navigated to.\n * @author Will Poulson\n */\n public nextQuestion() {\n return new Promise((resolve, reject) => {\n if (!this.options.allowSkipRequiredField) {\n if (!this.currentQuestion.formControl.valid) {\n return reject('Current question is invalid');\n }\n }\n\n this.getCurrentQuestionIndex().then((currentIndex) => {\n const newIndex = currentIndex + 1;\n\n this.navigateToQuestion(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Navigates to the previous question.\n * If there is no question to navigate to it will reject with a out of bounds exception.\n * If allowNavigateBackwards is false then it will reject.\n * @returns A promise which will resolve when the question has been navigated to.\n * @author Will Poulson\n */\n public prevQuestion() {\n return new Promise((resolve, reject) => {\n if (!this.options.allowNavigateBackwards) {\n return reject('This questionnaire does not allow for backwards navigation');\n }\n\n this.getCurrentQuestionIndex().then((currentIndex) => {\n const newIndex = currentIndex - 1;\n\n this.navigateToQuestion(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Gets the current questions index.\n * @returns A promise which resolves a number.\n * @author Will Poulson\n */\n private getCurrentQuestionIndex(): Promise<number> {\n return new Promise((resolve, reject) => {\n const currentIndex = this.currentSection.data.questions.indexOf(this.currentQuestion.data);\n\n if (currentIndex === -1) {\n return reject('Could not find current question');\n }\n\n return resolve(currentIndex);\n });\n }\n\n /**\n * Checks a question is in bounds then navigates to it.\n * @param index The index to navigate to.\n * @returns A promise which will resolve when the question has been navigated to.\n * @author Will Poulson\n */\n public navigateToQuestion(index: number) {\n return new Promise((resolve, reject) => {\n if (this.currentSection.data.questions.length - 1 < index || index < 0) {\n return reject('Out of bounds exception');\n }\n\n this.currentQuestionName = this.currentSection.data.questions[index].name;\n return resolve();\n });\n }\n\n /**\n * Navigates to the next section.\n * @returns A promise which will resolve when the section has been navigated to.\n * @author Will Poulson\n */\n public nextSection() {\n return new Promise((resolve, reject) => {\n this.getCurrentSectionIndex().then((currentIndex) => {\n const newIndex = currentIndex + 1;\n this.navigateToSection(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Navigates to the previous section.\n * @returns A promise which will resolve when the section has been navigated to.\n * @author Will Poulson\n */\n public prevSection() {\n return new Promise((resolve, reject) => {\n this.getCurrentSectionIndex().then((currentIndex) => {\n const newIndex = currentIndex - 1;\n this.navigateToQuestion(newIndex).then(() => {\n return resolve();\n }).catch((error) => {\n return reject(error);\n });\n }).catch((error) => {\n return reject(error);\n });\n });\n }\n\n /**\n * Gets the current section index.\n * @returns A promise which resolves a number.\n * @author Will Poulson\n */\n private getCurrentSectionIndex(): Promise<number> {\n return new Promise((resolve, reject) => {\n const currentIndex = this.currentQuestionnaire.sections.indexOf(this.currentSection.data);\n\n if (currentIndex === -1) {\n return reject('Could not find current section');\n }\n\n return resolve(currentIndex);\n });\n }\n\n /**\n * Checks a section is in bounds then navigates to it.\n * @param index The index to navigate to.\n * @returns A promise which will resolve when the section has been navigated to.\n * @author Will Poulson\n */\n public navigateToSection(index: number) {\n return new Promise((resolve, reject) => {\n if (this.currentQuestionnaire.sections.length - 1 < index || index < 0) {\n return reject('Out of bounds exception');\n }\n\n this.currentSectionName = this.currentQuestionnaire.sections[index].name;\n return resolve();\n });\n }\n\n /**\n * Answers the current question with the parsed value.\n * @param answer The value to answer the question with.\n * @author Will Poulson\n */\n public answerCurrentQuestion(answer: any, sendToNextQuestion?: boolean) {\n this.currentQuestion.formControl.setValue(answer);\n if (sendToNextQuestion && this.skippable) { // Timeout to prevent skipping glitch.\n this.skippable = false;\n setTimeout(() => {\n this.nextQuestion();\n this.skippable = true;\n }, 150);\n }\n }\n\n /**\n * Adds a repeater item to the current question.\n * Current question must be of type Repeater.\n * @returns A promise which resolves when the repeater item has been added.\n * @author Will Poulson\n */\n public addRepeaterItem() {\n return new Promise((resolve, reject) => {\n if (this.currentQuestion.data.type !== QuestionType.Repeater) {\n return reject(`Current question isn't a repeater`);\n }\n const repeaterForm = this.formConstuctor.generateFormsForRepeater(this.currentQuestion.data);\n\n if (!repeaterForm) {\n return reject(`Repeater template failed to generate. May be due to the repeater having no items in the editor.`);\n }\n\n\n if (!(this.currentQuestion.formControl instanceof FormArray)) {\n return reject(`The current questions control isn't of type FormArray`);\n }\n\n this.currentQuestion.formControl.push(repeaterForm);\n return resolve();\n });\n }\n\n /**\n * Removes a repeater item on the current question.\n * Current question must be of type Repeater.\n * @param index The index at which to remove.\n * @returns A promise which resolves when the repeater item has been removed.\n * @author Will Poulson\n */\n public removeRepeaterItem(index: number) {\n return new Promise((resolve, reject) => {\n if (this.currentQuestion.data.type !== QuestionType.Repeater) {\n return reject(`Current question isn't a repeater`);\n }\n\n if (!(this.currentQuestion.formControl instanceof FormArray)) {\n return reject(`The current questions control isn't of type FormArray`);\n }\n\n this.currentQuestion.formControl.removeAt(index);\n return resolve();\n });\n }\n\n /**\n * Returns the display text for a given repeater item\n * @param index The index at which to get the label for.\n * @returns A string which is the display text.\n * @author Will Poulson\n */\n public getRepeaterItemLabel(index: number): string {\n if (!this.currentQuestion.formControl || !(this.currentQuestion.formControl instanceof FormArray)) {\n return '';\n }\n\n const repeaterItem = this.currentQuestion.formControl.controls[index];\n\n if (!repeaterItem) {\n return '';\n }\n\n const template = this.currentQuestion.data.repeaterDisplayName;\n const splitTemplate = template.split(' ');\n\n const displayArray = [];\n for (const templateItem of splitTemplate) {\n if (templateItem.match(/\\[.*?\\]/)) {\n const path = templateItem.replace(/[\\[\\]']+/g, '');\n const item = repeaterItem.get(path);\n const value = item.value ? item.value : '?';\n displayArray.push(value);\n } else {\n displayArray.push(templateItem);\n }\n }\n\n const display = displayArray.join(' ');\n return display;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormConstructorService } from './services/form-constructor.service';\nimport { QuestionnaireService } from './services/questionnaire.service';\nimport { FilterService } from './services/filter.service';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { QuestionnaireOptions } from './interfaces/questionnaire-options';\nimport { ModuleWithProviders } from '@angular/compiler/src/core';\n\n@NgModule({\n declarations: [],\n providers: [\n FormConstructorService,\n FilterService\n ],\n imports: [\n FormsModule,\n ReactiveFormsModule\n ],\n})\nexport class GgQuestionnaireV2Module {\n public static forRoot(options: QuestionnaireOptions): ModuleWithProviders {\n return {\n ngModule: GgQuestionnaireV2Module,\n providers: [\n QuestionnaireService,\n {\n provide: 'options',\n useValue: options\n }\n ]\n };\n }\n}\n","export enum InputType {\n Text = 'text',\n Number = 'number',\n Email = 'email',\n Telephone = 'tel',\n Password = 'password',\n Color = 'color',\n Date = 'date',\n DateTimeLocal = 'datetime-local',\n Time = 'time',\n Month = 'month',\n Week = 'week',\n}\n","export enum RepeaterQuestionType {\n Input = 'input',\n Select = 'select',\n}\n"],"names":["_","tslib_1.__values","_.get","Injectable","Validators","FormBuilder","EventEmitter","_.cloneDeep","FormArray","Inject","NgModule","FormsModule","ReactiveFormsModule"],"mappings":";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