@glowgreen/gg-questionnaire-v2 0.0.55 → 0.0.57
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.
- package/bundles/glowgreen-gg-questionnaire-v2.umd.js +38 -18
- package/bundles/glowgreen-gg-questionnaire-v2.umd.js.map +1 -1
- package/bundles/glowgreen-gg-questionnaire-v2.umd.min.js +1 -1
- package/bundles/glowgreen-gg-questionnaire-v2.umd.min.js.map +1 -1
- package/esm2015/lib/services/form-constructor.service.js +10 -1
- package/esm2015/lib/services/questionnaire.service.js +1 -1
- package/esm5/lib/services/form-constructor.service.js +39 -19
- package/esm5/lib/services/questionnaire.service.js +1 -1
- package/fesm2015/glowgreen-gg-questionnaire-v2.js +9 -0
- package/fesm2015/glowgreen-gg-questionnaire-v2.js.map +1 -1
- package/fesm5/glowgreen-gg-questionnaire-v2.js +38 -18
- package/fesm5/glowgreen-gg-questionnaire-v2.js.map +1 -1
- package/package.json +1 -1
|
@@ -1000,6 +1000,7 @@
|
|
|
1000
1000
|
* @return {?} An abstract control.
|
|
1001
1001
|
*/
|
|
1002
1002
|
function (question, section, currentQuestionnaireForm) {
|
|
1003
|
+
var e_3, _a;
|
|
1003
1004
|
/** @type {?} */
|
|
1004
1005
|
var convertedValidators = this.convertValidators(question.validators);
|
|
1005
1006
|
/** @type {?} */
|
|
@@ -1008,6 +1009,25 @@
|
|
|
1008
1009
|
case QuestionType.Repeater:
|
|
1009
1010
|
/** @type {?} */
|
|
1010
1011
|
var currentArray = currentQuestionnaireForm ? ((/** @type {?} */ (currentQuestionnaireForm.get([section.name, question.name])))) : false;
|
|
1012
|
+
if (currentArray) {
|
|
1013
|
+
try {
|
|
1014
|
+
for (var _b = __values(currentArray.controls), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1015
|
+
var item = _c.value;
|
|
1016
|
+
/** @type {?} */
|
|
1017
|
+
var index = currentArray.controls.indexOf(item);
|
|
1018
|
+
console.log('Current item', item);
|
|
1019
|
+
console.log('New Item', this.generateFormsForRepeater(question, index));
|
|
1020
|
+
item = this.generateFormsForRepeater(question, index);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1024
|
+
finally {
|
|
1025
|
+
try {
|
|
1026
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1027
|
+
}
|
|
1028
|
+
finally { if (e_3) throw e_3.error; }
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1011
1031
|
return currentArray ? currentArray : this.fb.array([], convertedValidators);
|
|
1012
1032
|
case QuestionType.Checklist:
|
|
1013
1033
|
return this.generateGroupForChecklist(question, convertedValidators);
|
|
@@ -1040,7 +1060,7 @@
|
|
|
1040
1060
|
* @return {?} A form group.
|
|
1041
1061
|
*/
|
|
1042
1062
|
function (question, convertedValidators) {
|
|
1043
|
-
var
|
|
1063
|
+
var e_4, _a;
|
|
1044
1064
|
if (question.type !== QuestionType.Checklist || question.checklistItems.length === 0) {
|
|
1045
1065
|
return null;
|
|
1046
1066
|
}
|
|
@@ -1054,12 +1074,12 @@
|
|
|
1054
1074
|
checklistForms.addControl(checklistItem.name, checklistItemControl);
|
|
1055
1075
|
}
|
|
1056
1076
|
}
|
|
1057
|
-
catch (
|
|
1077
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1058
1078
|
finally {
|
|
1059
1079
|
try {
|
|
1060
1080
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1061
1081
|
}
|
|
1062
|
-
finally { if (
|
|
1082
|
+
finally { if (e_4) throw e_4.error; }
|
|
1063
1083
|
}
|
|
1064
1084
|
return checklistForms;
|
|
1065
1085
|
};
|
|
@@ -1084,7 +1104,7 @@
|
|
|
1084
1104
|
* @return {?} A form group.
|
|
1085
1105
|
*/
|
|
1086
1106
|
function (question, index) {
|
|
1087
|
-
var
|
|
1107
|
+
var e_5, _a;
|
|
1088
1108
|
if (question.type !== QuestionType.Repeater || question.repeaterQuestions.length === 0) {
|
|
1089
1109
|
console.log('Question isnt a repeater or has no questions, returning null');
|
|
1090
1110
|
return null;
|
|
@@ -1102,12 +1122,12 @@
|
|
|
1102
1122
|
repeaterForms.addControl(repeaterQuestion.name, repeaterQuestionControl);
|
|
1103
1123
|
}
|
|
1104
1124
|
}
|
|
1105
|
-
catch (
|
|
1125
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1106
1126
|
finally {
|
|
1107
1127
|
try {
|
|
1108
1128
|
if (repeaterQuestions_1_1 && !repeaterQuestions_1_1.done && (_a = repeaterQuestions_1.return)) _a.call(repeaterQuestions_1);
|
|
1109
1129
|
}
|
|
1110
|
-
finally { if (
|
|
1130
|
+
finally { if (e_5) throw e_5.error; }
|
|
1111
1131
|
}
|
|
1112
1132
|
return repeaterForms;
|
|
1113
1133
|
};
|
|
@@ -1157,7 +1177,7 @@
|
|
|
1157
1177
|
* @return {?} A convered array of form validators.
|
|
1158
1178
|
*/
|
|
1159
1179
|
function (validators) {
|
|
1160
|
-
var
|
|
1180
|
+
var e_6, _a;
|
|
1161
1181
|
if (!validators || validators.length === 0) {
|
|
1162
1182
|
return [];
|
|
1163
1183
|
}
|
|
@@ -1173,12 +1193,12 @@
|
|
|
1173
1193
|
}
|
|
1174
1194
|
}
|
|
1175
1195
|
}
|
|
1176
|
-
catch (
|
|
1196
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1177
1197
|
finally {
|
|
1178
1198
|
try {
|
|
1179
1199
|
if (validators_1_1 && !validators_1_1.done && (_a = validators_1.return)) _a.call(validators_1);
|
|
1180
1200
|
}
|
|
1181
|
-
finally { if (
|
|
1201
|
+
finally { if (e_6) throw e_6.error; }
|
|
1182
1202
|
}
|
|
1183
1203
|
return convertedValidators;
|
|
1184
1204
|
};
|
|
@@ -1230,12 +1250,12 @@
|
|
|
1230
1250
|
* @return {?}
|
|
1231
1251
|
*/
|
|
1232
1252
|
function (savedState, sections, currentQuestionnaireForm) {
|
|
1233
|
-
var
|
|
1253
|
+
var e_7, _a, e_8, _b, e_9, _c;
|
|
1234
1254
|
try {
|
|
1235
1255
|
for (var sections_2 = __values(sections), sections_2_1 = sections_2.next(); !sections_2_1.done; sections_2_1 = sections_2.next()) {
|
|
1236
1256
|
var section = sections_2_1.value;
|
|
1237
1257
|
try {
|
|
1238
|
-
for (var _d = (
|
|
1258
|
+
for (var _d = (e_8 = void 0, __values(section.questions)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
1239
1259
|
var question = _e.value;
|
|
1240
1260
|
if (question.type !== QuestionType.Repeater) {
|
|
1241
1261
|
continue;
|
|
@@ -1252,7 +1272,7 @@
|
|
|
1252
1272
|
}
|
|
1253
1273
|
try {
|
|
1254
1274
|
// For each item that used to be there push a new empty template there to be populated.
|
|
1255
|
-
for (var repeaterArray_1 = (
|
|
1275
|
+
for (var repeaterArray_1 = (e_9 = void 0, __values(repeaterArray)), repeaterArray_1_1 = repeaterArray_1.next(); !repeaterArray_1_1.done; repeaterArray_1_1 = repeaterArray_1.next()) {
|
|
1256
1276
|
var repeaterItem = repeaterArray_1_1.value;
|
|
1257
1277
|
/** @type {?} */
|
|
1258
1278
|
var index = repeaterArray.indexOf(repeaterItem);
|
|
@@ -1261,30 +1281,30 @@
|
|
|
1261
1281
|
repeaterFormArray.push(repeaterItemTemplate);
|
|
1262
1282
|
}
|
|
1263
1283
|
}
|
|
1264
|
-
catch (
|
|
1284
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1265
1285
|
finally {
|
|
1266
1286
|
try {
|
|
1267
1287
|
if (repeaterArray_1_1 && !repeaterArray_1_1.done && (_c = repeaterArray_1.return)) _c.call(repeaterArray_1);
|
|
1268
1288
|
}
|
|
1269
|
-
finally { if (
|
|
1289
|
+
finally { if (e_9) throw e_9.error; }
|
|
1270
1290
|
}
|
|
1271
1291
|
}
|
|
1272
1292
|
}
|
|
1273
|
-
catch (
|
|
1293
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1274
1294
|
finally {
|
|
1275
1295
|
try {
|
|
1276
1296
|
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
|
1277
1297
|
}
|
|
1278
|
-
finally { if (
|
|
1298
|
+
finally { if (e_8) throw e_8.error; }
|
|
1279
1299
|
}
|
|
1280
1300
|
}
|
|
1281
1301
|
}
|
|
1282
|
-
catch (
|
|
1302
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1283
1303
|
finally {
|
|
1284
1304
|
try {
|
|
1285
1305
|
if (sections_2_1 && !sections_2_1.done && (_a = sections_2.return)) _a.call(sections_2);
|
|
1286
1306
|
}
|
|
1287
|
-
finally { if (
|
|
1307
|
+
finally { if (e_7) throw e_7.error; }
|
|
1288
1308
|
}
|
|
1289
1309
|
};
|
|
1290
1310
|
FormConstructorService.decorators = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glowgreen-gg-questionnaire-v2.umd.js","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 Slider = 'slider',\n Info = 'info',\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, FormArray } 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';\nimport { Question } from '../interfaces/question';\nimport { RepeaterQuestion } from '../interfaces/repeater-question';\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 continue;\n }\n\n const filteredQuestions = [];\n for (const question of section.questions) {\n if (!this.meetsConditionGroups(question.conditionGroups, currentQuestionnaireForm, additionalData)) {\n continue;\n }\n\n // If it's a repeater we need to do a lot of extra filtering due to per item conditions.\n if (question.type === 'repeater') {\n const items = currentQuestionnaireForm.get([section.name, question.name]) as FormArray;\n\n if (items && items.controls) {\n for (const repeaterItem of items.controls) {\n const filteredRepeaterItemQuestions: Array<RepeaterQuestion> = [];\n\n for (const repeaterQuestion of question.repeaterQuestions) {\n\n const meetsConditions = this.meetsConditionGroups(\n repeaterQuestion.conditionGroups,\n currentQuestionnaireForm,\n additionalData,\n repeaterItem as FormGroup\n );\n\n if (meetsConditions) {\n const cloneQuestion = _.clone(repeaterQuestion);\n\n cloneQuestion.selectOptions = this.getFetchOptionsForQuestion(\n repeaterQuestion,\n additionalData,\n currentQuestionnaireForm,\n repeaterItem as FormGroup\n );\n\n filteredRepeaterItemQuestions.push(cloneQuestion);\n }\n }\n\n const index = items.controls.indexOf(repeaterItem);\n\n if (!question.filteredRepeaterQuestions) {\n question.filteredRepeaterQuestions = [];\n }\n\n question.filteredRepeaterQuestions[index] = filteredRepeaterItemQuestions;\n }\n }\n\n }\n\n question.selectOptions = this.getFetchOptionsForQuestion(question, additionalData, currentQuestionnaireForm);\n\n filteredQuestions.push(question);\n }\n\n if (filteredQuestions.length === 0) {\n continue;\n }\n\n section.questions = filteredQuestions;\n filteredSections.push(section);\n }\n\n return filteredSections;\n }\n\n private getFetchOptionsForQuestion(\n question: Question | RepeaterQuestion,\n additionalData,\n currentQuestionnaireForm,\n repeaterItem?: FormGroup\n ) {\n\n if (!question.fetchPath) {\n return question.selectOptions;\n }\n\n let options = additionalData[question.fetchPath];\n if (question.fetchSelectors && question.fetchSelectors.length > 0) {\n const values = this.getValuesForArray(question.fetchSelectors, currentQuestionnaireForm, additionalData, repeaterItem);\n options = _.get(additionalData[question.fetchPath], values);\n }\n\n options = this.getFinalFetchArray(options);\n\n if (!question.selectOptions) {\n question.selectOptions = [];\n }\n\n return question.selectOptions.concat(options);\n }\n\n private getFinalFetchArray(items: any): Array<Object> {\n if (!items) {\n return null;\n }\n if (!Array.isArray(items)) {\n items = _.keys(items);\n }\n if (items.length <= 0) {\n return null;\n }\n const convertedArray: Array<Object> = [];\n for (const item of items) {\n if (item) {\n if (item instanceof Object && item.value && item.label) {\n convertedArray.push(item);\n } else {\n convertedArray.push({label: this.uppercase(item), value: item});\n }\n }\n }\n return convertedArray;\n }\n\n private uppercase(item: any) {\n return item.charAt(0).toUpperCase() + item.slice(1);\n }\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 repeaterItem?: FormGroup\n ): boolean {\n if (!conditionGroups || conditionGroups.length === 0) {\n return true;\n }\n return conditionGroups.every((x) => {\n return this.meetsConditionGroup(x, currentQuestionnaireForm, additionalData, repeaterItem) === 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 repeaterItem?: FormGroup\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, repeaterItem));\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(\n condition: Condition,\n currentQuestionnaireForm: FormGroup,\n additionalData?: Object,\n repeaterItem?: FormGroup\n ): boolean {\n const v1s: Array<any> = this.getValuesForArray(condition.v1s, currentQuestionnaireForm, additionalData, repeaterItem);\n const v2s: Array<any> = this.getValuesForArray(condition.v2s, currentQuestionnaireForm, additionalData, repeaterItem);\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(\n paths: Array<string>,\n currentQuestionnaireForm: FormGroup,\n additionalData?: Object,\n repeaterItem?: FormGroup\n ): Array<any> {\n if (currentQuestionnaireForm) {\n const values = [];\n for (const path of paths) {\n const value = this.getValueForString(path, currentQuestionnaireForm, additionalData, repeaterItem);\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(\n path: string,\n currentQuestionnaireForm: FormGroup,\n additionalData?: Object,\n repeaterItem?: FormGroup\n ) {\n if (currentQuestionnaireForm) {\n if (!additionalData) {\n additionalData = {};\n }\n\n let control = currentQuestionnaireForm.get(path.toString());\n\n if (!control && repeaterItem) {\n control = repeaterItem.get(path);\n }\n\n const value = control ? control.value : this.convertStringToValue(path);\n return _.get(additionalData, path, value);\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 currentQuestionnaire: 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\n const noChange = currentQuestionnaireForm && (sections === currentQuestionnaire.sections);\n\n if (noChange && !skipFilter) {\n return null;\n }\n\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 if (question.type === QuestionType.Info) {\n continue;\n }\n\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 const defaultValue = question.defaultValue ? question.defaultValue : null;\n switch (question.type) {\n case QuestionType.Repeater:\n const currentArray = currentQuestionnaireForm ? (currentQuestionnaireForm.get([section.name, question.name]) as FormArray) : false;\n return currentArray ? currentArray : this.fb.array([], convertedValidators);\n case QuestionType.Checklist:\n return this.generateGroupForChecklist(question, convertedValidators);\n case QuestionType.Slider:\n return this.fb.control(defaultValue, { validators: convertedValidators }); // Remove update on blur for sliders.\n default:\n return this.fb.control(defaultValue, { 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, index?: any): 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 repeaterQuestions = index ? question.filteredRepeaterQuestions[index] : question.repeaterQuestions;\n\n console.log('Got the following repeater questions', repeaterQuestions);\n\n const repeaterForms: FormGroup = this.fb.group({});\n for (const repeaterQuestion of 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 each item that used to be there push a new empty template there to be populated.\n for (const repeaterItem of repeaterArray) {\n const index = repeaterArray.indexOf(repeaterItem);\n const repeaterItemTemplate = this.generateFormsForRepeater(question, index);\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 public sectionFinishedEvent: 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 public additionalData: Object;\n\n private skippable = true;\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 loadQuestionnaire(questionnaire: Questionnaire, savedState?: Object, additionalData?: Object) {\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 _.cloneDeep(this.currentQuestionnaire),\n this.currentQuestionnaireForm,\n this.additionalData,\n true\n );\n\n if (newData) {\n this.formConstuctor.constructRepeaterFromsFromState(savedState, newData.sections, newData.forms);\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaireForm.patchValue(savedState);\n }\n\n }\n\n this.updateQuestionnaire(savedState);\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 }\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) {\n const oldLength = this.currentQuestionnaire.sections.map(x => x.questions.length).reduce((a, b) => a + b, 0);\n\n const newData = this.formConstuctor.generateFormsForQuestionnaire(\n _.cloneDeep(this.originalQuestionnaire),\n _.cloneDeep(this.currentQuestionnaire),\n this.currentQuestionnaireForm,\n this.additionalData\n );\n\n if (newData) {\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaire.sections = newData.sections;\n }\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 && this.currentQuestion.formControl) {\n this.questionValueChangeSubscription = this.currentQuestion.formControl.valueChanges.subscribe(() => {\n this.clearFields(this.currentQuestion.data.clearfields);\n });\n }\n\n const newLength = this.currentQuestionnaire.sections.map(x => x.questions.length).reduce((a, b) => a + b, 0);\n\n if (oldLength !== newLength) {\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 && control.value === null && question.defaultValue) {\n control.setValue(question.defaultValue);\n }\n }\n }\n }\n }\n\n public updateAdditionalData(payload: any) {\n this.additionalData = Object.assign(this.additionalData, payload);\n this.updateQuestionnaire(this.currentQuestionnaireForm.getRawValue());\n }\n\n public clearAdditionalData() {\n this.additionalData = {};\n this.updateQuestionnaire(this.currentQuestionnaireForm.getRawValue());\n }\n\n public get isValid() {\n return this.currentQuestionnaireForm.valid;\n }\n\n public get isFirstQuestion(): boolean {\n if (!this.currentSection || !this.currentQuestion) {\n return false;\n }\n const currentIndex = this.currentSection.data.questions.indexOf(this.currentQuestion.data);\n return currentIndex === 0;\n }\n\n public get isLastQuestion(): boolean {\n if (!this.currentSection || !this.currentQuestion) {\n return false;\n }\n const currentIndex = this.currentSection.data.questions.indexOf(this.currentQuestion.data);\n const maxIndex = this.currentSection.data.questions.length - 1;\n return currentIndex === maxIndex;\n }\n\n public get isFirstSection(): boolean {\n if (!this.currentSection) {\n return false;\n }\n\n const currentIndex = this.currentQuestionnaire.sections.indexOf(this.currentSection.data);\n return currentIndex === 0;\n }\n\n public get isLastSection(): boolean {\n if (!this.currentSection) {\n return false;\n }\n\n const currentIndex = this.currentQuestionnaire.sections.indexOf(this.currentSection.data);\n const maxIndex = this.currentQuestionnaire.sections.length - 1;\n return currentIndex === maxIndex;\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 ? 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; } | 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 const formControl = this.currentSection.formGroup.get(data.name) as AbstractControl;\n\n return {\n data: data,\n formControl: formControl\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 && !this.currentQuestion.formControl.valid) {\n return reject('Current question is invalid');\n }\n }\n\n this.getCurrentQuestionIndex().then((currentIndex) => {\n const lastQuestionIndex = this.currentSection.data.questions.length - 1;\n const isLastQuestion = lastQuestionIndex === currentIndex;\n\n if (isLastQuestion) {\n this.sectionFinishedEvent.emit();\n return resolve();\n }\n\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.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 * 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 if (!sendToNextQuestion) {\n this.currentQuestion.formControl.setValue(answer);\n return;\n }\n\n if (this.skippable) { // Timeout to prevent skipping glitch.\n this.skippable = false;\n setTimeout(() => {\n this.currentQuestion.formControl.setValue(answer);\n this.nextQuestion().then(() => {\n this.skippable = true;\n });\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 && 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 Upload = 'upload',\n}\n"],"names":["tslib_1.__values","_.clone","_.get","_.keys","Injectable","Validators","FormBuilder","EventEmitter","_.cloneDeep","FormArray","Inject","NgModule","FormsModule","ReactiveFormsModule"],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;;AAEF,IAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;;AAED,IAAO,IAAI,QAAQ,GAAG,WAAW;IACjC,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;QACjB,QAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"glowgreen-gg-questionnaire-v2.umd.js","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 Slider = 'slider',\n Info = 'info',\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, FormArray } 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';\nimport { Question } from '../interfaces/question';\nimport { RepeaterQuestion } from '../interfaces/repeater-question';\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 continue;\n }\n\n const filteredQuestions = [];\n for (const question of section.questions) {\n if (!this.meetsConditionGroups(question.conditionGroups, currentQuestionnaireForm, additionalData)) {\n continue;\n }\n\n // If it's a repeater we need to do a lot of extra filtering due to per item conditions.\n if (question.type === 'repeater') {\n const items = currentQuestionnaireForm.get([section.name, question.name]) as FormArray;\n\n if (items && items.controls) {\n for (const repeaterItem of items.controls) {\n const filteredRepeaterItemQuestions: Array<RepeaterQuestion> = [];\n\n for (const repeaterQuestion of question.repeaterQuestions) {\n\n const meetsConditions = this.meetsConditionGroups(\n repeaterQuestion.conditionGroups,\n currentQuestionnaireForm,\n additionalData,\n repeaterItem as FormGroup\n );\n\n if (meetsConditions) {\n const cloneQuestion = _.clone(repeaterQuestion);\n\n cloneQuestion.selectOptions = this.getFetchOptionsForQuestion(\n repeaterQuestion,\n additionalData,\n currentQuestionnaireForm,\n repeaterItem as FormGroup\n );\n\n filteredRepeaterItemQuestions.push(cloneQuestion);\n }\n }\n\n const index = items.controls.indexOf(repeaterItem);\n\n if (!question.filteredRepeaterQuestions) {\n question.filteredRepeaterQuestions = [];\n }\n\n question.filteredRepeaterQuestions[index] = filteredRepeaterItemQuestions;\n }\n }\n\n }\n\n question.selectOptions = this.getFetchOptionsForQuestion(question, additionalData, currentQuestionnaireForm);\n\n filteredQuestions.push(question);\n }\n\n if (filteredQuestions.length === 0) {\n continue;\n }\n\n section.questions = filteredQuestions;\n filteredSections.push(section);\n }\n\n return filteredSections;\n }\n\n private getFetchOptionsForQuestion(\n question: Question | RepeaterQuestion,\n additionalData,\n currentQuestionnaireForm,\n repeaterItem?: FormGroup\n ) {\n\n if (!question.fetchPath) {\n return question.selectOptions;\n }\n\n let options = additionalData[question.fetchPath];\n if (question.fetchSelectors && question.fetchSelectors.length > 0) {\n const values = this.getValuesForArray(question.fetchSelectors, currentQuestionnaireForm, additionalData, repeaterItem);\n options = _.get(additionalData[question.fetchPath], values);\n }\n\n options = this.getFinalFetchArray(options);\n\n if (!question.selectOptions) {\n question.selectOptions = [];\n }\n\n return question.selectOptions.concat(options);\n }\n\n private getFinalFetchArray(items: any): Array<Object> {\n if (!items) {\n return null;\n }\n if (!Array.isArray(items)) {\n items = _.keys(items);\n }\n if (items.length <= 0) {\n return null;\n }\n const convertedArray: Array<Object> = [];\n for (const item of items) {\n if (item) {\n if (item instanceof Object && item.value && item.label) {\n convertedArray.push(item);\n } else {\n convertedArray.push({label: this.uppercase(item), value: item});\n }\n }\n }\n return convertedArray;\n }\n\n private uppercase(item: any) {\n return item.charAt(0).toUpperCase() + item.slice(1);\n }\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 repeaterItem?: FormGroup\n ): boolean {\n if (!conditionGroups || conditionGroups.length === 0) {\n return true;\n }\n return conditionGroups.every((x) => {\n return this.meetsConditionGroup(x, currentQuestionnaireForm, additionalData, repeaterItem) === 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 repeaterItem?: FormGroup\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, repeaterItem));\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(\n condition: Condition,\n currentQuestionnaireForm: FormGroup,\n additionalData?: Object,\n repeaterItem?: FormGroup\n ): boolean {\n const v1s: Array<any> = this.getValuesForArray(condition.v1s, currentQuestionnaireForm, additionalData, repeaterItem);\n const v2s: Array<any> = this.getValuesForArray(condition.v2s, currentQuestionnaireForm, additionalData, repeaterItem);\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(\n paths: Array<string>,\n currentQuestionnaireForm: FormGroup,\n additionalData?: Object,\n repeaterItem?: FormGroup\n ): Array<any> {\n if (currentQuestionnaireForm) {\n const values = [];\n for (const path of paths) {\n const value = this.getValueForString(path, currentQuestionnaireForm, additionalData, repeaterItem);\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(\n path: string,\n currentQuestionnaireForm: FormGroup,\n additionalData?: Object,\n repeaterItem?: FormGroup\n ) {\n if (currentQuestionnaireForm) {\n if (!additionalData) {\n additionalData = {};\n }\n\n let control = currentQuestionnaireForm.get(path.toString());\n\n if (!control && repeaterItem) {\n control = repeaterItem.get(path);\n }\n\n const value = control ? control.value : this.convertStringToValue(path);\n return _.get(additionalData, path, value);\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 currentQuestionnaire: 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\n const noChange = currentQuestionnaireForm && (sections === currentQuestionnaire.sections);\n\n if (noChange && !skipFilter) {\n return null;\n }\n\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 if (question.type === QuestionType.Info) {\n continue;\n }\n\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 const defaultValue = question.defaultValue ? question.defaultValue : null;\n switch (question.type) {\n case QuestionType.Repeater:\n const currentArray = currentQuestionnaireForm ? (currentQuestionnaireForm.get([section.name, question.name]) as FormArray) : false;\n\n if (currentArray) {\n for (let item of currentArray.controls) {\n const index = currentArray.controls.indexOf(item);\n\n console.log('Current item', item);\n console.log('New Item', this.generateFormsForRepeater(question, index));\n\n item = this.generateFormsForRepeater(question, index);\n }\n }\n\n return currentArray ? currentArray : this.fb.array([], convertedValidators);\n case QuestionType.Checklist:\n return this.generateGroupForChecklist(question, convertedValidators);\n case QuestionType.Slider:\n return this.fb.control(defaultValue, { validators: convertedValidators }); // Remove update on blur for sliders.\n default:\n return this.fb.control(defaultValue, { 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, index?: any): 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 repeaterQuestions = index ? question.filteredRepeaterQuestions[index] : question.repeaterQuestions;\n\n console.log('Got the following repeater questions', repeaterQuestions);\n\n const repeaterForms: FormGroup = this.fb.group({});\n for (const repeaterQuestion of 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 each item that used to be there push a new empty template there to be populated.\n for (const repeaterItem of repeaterArray) {\n const index = repeaterArray.indexOf(repeaterItem);\n const repeaterItemTemplate = this.generateFormsForRepeater(question, index);\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 public sectionFinishedEvent: 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 public additionalData: Object;\n\n private skippable = true;\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 loadQuestionnaire(questionnaire: Questionnaire, savedState?: Object, additionalData?: Object) {\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 _.cloneDeep(this.currentQuestionnaire),\n this.currentQuestionnaireForm,\n this.additionalData,\n true\n );\n\n if (newData) {\n this.formConstuctor.constructRepeaterFromsFromState(savedState, newData.sections, newData.forms);\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaireForm.patchValue(savedState);\n }\n\n }\n\n this.updateQuestionnaire(savedState);\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 }\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) {\n const oldLength = this.currentQuestionnaire.sections.map(x => x.questions.length).reduce((a, b) => a + b, 0);\n\n const newData = this.formConstuctor.generateFormsForQuestionnaire(\n _.cloneDeep(this.originalQuestionnaire),\n _.cloneDeep(this.currentQuestionnaire),\n this.currentQuestionnaireForm,\n this.additionalData\n );\n\n if (newData) {\n this.currentQuestionnaireForm = newData.forms;\n this.currentQuestionnaire.sections = newData.sections;\n }\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 && this.currentQuestion.formControl) {\n this.questionValueChangeSubscription = this.currentQuestion.formControl.valueChanges.subscribe(() => {\n this.clearFields(this.currentQuestion.data.clearfields);\n });\n }\n\n const newLength = this.currentQuestionnaire.sections.map(x => x.questions.length).reduce((a, b) => a + b, 0);\n\n if (oldLength !== newLength) {\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 && control.value === null && question.defaultValue) {\n control.setValue(question.defaultValue);\n }\n }\n }\n }\n }\n\n public updateAdditionalData(payload: any) {\n this.additionalData = Object.assign(this.additionalData, payload);\n this.updateQuestionnaire(this.currentQuestionnaireForm.getRawValue());\n }\n\n public clearAdditionalData() {\n this.additionalData = {};\n this.updateQuestionnaire(this.currentQuestionnaireForm.getRawValue());\n }\n\n public get isValid() {\n return this.currentQuestionnaireForm.valid;\n }\n\n public get isFirstQuestion(): boolean {\n if (!this.currentSection || !this.currentQuestion) {\n return false;\n }\n const currentIndex = this.currentSection.data.questions.indexOf(this.currentQuestion.data);\n return currentIndex === 0;\n }\n\n public get isLastQuestion(): boolean {\n if (!this.currentSection || !this.currentQuestion) {\n return false;\n }\n const currentIndex = this.currentSection.data.questions.indexOf(this.currentQuestion.data);\n const maxIndex = this.currentSection.data.questions.length - 1;\n return currentIndex === maxIndex;\n }\n\n public get isFirstSection(): boolean {\n if (!this.currentSection) {\n return false;\n }\n\n const currentIndex = this.currentQuestionnaire.sections.indexOf(this.currentSection.data);\n return currentIndex === 0;\n }\n\n public get isLastSection(): boolean {\n if (!this.currentSection) {\n return false;\n }\n\n const currentIndex = this.currentQuestionnaire.sections.indexOf(this.currentSection.data);\n const maxIndex = this.currentQuestionnaire.sections.length - 1;\n return currentIndex === maxIndex;\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 ? 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; } | 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 const formControl = this.currentSection.formGroup.get(data.name) as AbstractControl;\n\n return {\n data: data,\n formControl: formControl\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 && !this.currentQuestion.formControl.valid) {\n return reject('Current question is invalid');\n }\n }\n\n this.getCurrentQuestionIndex().then((currentIndex) => {\n const lastQuestionIndex = this.currentSection.data.questions.length - 1;\n const isLastQuestion = lastQuestionIndex === currentIndex;\n\n if (isLastQuestion) {\n this.sectionFinishedEvent.emit();\n return resolve();\n }\n\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.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 * 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 if (!sendToNextQuestion) {\n this.currentQuestion.formControl.setValue(answer);\n return;\n }\n\n if (this.skippable) { // Timeout to prevent skipping glitch.\n this.skippable = false;\n setTimeout(() => {\n this.currentQuestion.formControl.setValue(answer);\n this.nextQuestion().then(() => {\n this.skippable = true;\n });\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 \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 && 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 Upload = 'upload',\n}\n"],"names":["tslib_1.__values","_.clone","_.get","_.keys","Injectable","Validators","FormBuilder","EventEmitter","_.cloneDeep","FormArray","Inject","NgModule","FormsModule","ReactiveFormsModule"],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc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