@glowgreen/gg-questionnaire-v2 0.0.55 → 0.0.56
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 +36 -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 +8 -1
- package/esm2015/lib/services/questionnaire.service.js +1 -1
- package/esm5/lib/services/form-constructor.service.js +37 -19
- package/esm5/lib/services/questionnaire.service.js +1 -1
- package/fesm2015/glowgreen-gg-questionnaire-v2.js +7 -0
- package/fesm2015/glowgreen-gg-questionnaire-v2.js.map +1 -1
- package/fesm5/glowgreen-gg-questionnaire-v2.js +36 -18
- package/fesm5/glowgreen-gg-questionnaire-v2.js.map +1 -1
- package/package.json +1 -1
|
@@ -812,6 +812,7 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
812
812
|
* @return {?} An abstract control.
|
|
813
813
|
*/
|
|
814
814
|
function (question, section, currentQuestionnaireForm) {
|
|
815
|
+
var e_3, _a;
|
|
815
816
|
/** @type {?} */
|
|
816
817
|
var convertedValidators = this.convertValidators(question.validators);
|
|
817
818
|
/** @type {?} */
|
|
@@ -820,6 +821,23 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
820
821
|
case QuestionType.Repeater:
|
|
821
822
|
/** @type {?} */
|
|
822
823
|
var currentArray = currentQuestionnaireForm ? ((/** @type {?} */ (currentQuestionnaireForm.get([section.name, question.name])))) : false;
|
|
824
|
+
if (currentArray) {
|
|
825
|
+
try {
|
|
826
|
+
for (var _b = __values(currentArray.controls), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
827
|
+
var item = _c.value;
|
|
828
|
+
/** @type {?} */
|
|
829
|
+
var index = currentArray.controls.indexOf(item);
|
|
830
|
+
item = this.generateFormsForRepeater(question, index);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
834
|
+
finally {
|
|
835
|
+
try {
|
|
836
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
837
|
+
}
|
|
838
|
+
finally { if (e_3) throw e_3.error; }
|
|
839
|
+
}
|
|
840
|
+
}
|
|
823
841
|
return currentArray ? currentArray : this.fb.array([], convertedValidators);
|
|
824
842
|
case QuestionType.Checklist:
|
|
825
843
|
return this.generateGroupForChecklist(question, convertedValidators);
|
|
@@ -852,7 +870,7 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
852
870
|
* @return {?} A form group.
|
|
853
871
|
*/
|
|
854
872
|
function (question, convertedValidators) {
|
|
855
|
-
var
|
|
873
|
+
var e_4, _a;
|
|
856
874
|
if (question.type !== QuestionType.Checklist || question.checklistItems.length === 0) {
|
|
857
875
|
return null;
|
|
858
876
|
}
|
|
@@ -866,12 +884,12 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
866
884
|
checklistForms.addControl(checklistItem.name, checklistItemControl);
|
|
867
885
|
}
|
|
868
886
|
}
|
|
869
|
-
catch (
|
|
887
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
870
888
|
finally {
|
|
871
889
|
try {
|
|
872
890
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
873
891
|
}
|
|
874
|
-
finally { if (
|
|
892
|
+
finally { if (e_4) throw e_4.error; }
|
|
875
893
|
}
|
|
876
894
|
return checklistForms;
|
|
877
895
|
};
|
|
@@ -896,7 +914,7 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
896
914
|
* @return {?} A form group.
|
|
897
915
|
*/
|
|
898
916
|
function (question, index) {
|
|
899
|
-
var
|
|
917
|
+
var e_5, _a;
|
|
900
918
|
if (question.type !== QuestionType.Repeater || question.repeaterQuestions.length === 0) {
|
|
901
919
|
console.log('Question isnt a repeater or has no questions, returning null');
|
|
902
920
|
return null;
|
|
@@ -914,12 +932,12 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
914
932
|
repeaterForms.addControl(repeaterQuestion.name, repeaterQuestionControl);
|
|
915
933
|
}
|
|
916
934
|
}
|
|
917
|
-
catch (
|
|
935
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
918
936
|
finally {
|
|
919
937
|
try {
|
|
920
938
|
if (repeaterQuestions_1_1 && !repeaterQuestions_1_1.done && (_a = repeaterQuestions_1.return)) _a.call(repeaterQuestions_1);
|
|
921
939
|
}
|
|
922
|
-
finally { if (
|
|
940
|
+
finally { if (e_5) throw e_5.error; }
|
|
923
941
|
}
|
|
924
942
|
return repeaterForms;
|
|
925
943
|
};
|
|
@@ -969,7 +987,7 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
969
987
|
* @return {?} A convered array of form validators.
|
|
970
988
|
*/
|
|
971
989
|
function (validators) {
|
|
972
|
-
var
|
|
990
|
+
var e_6, _a;
|
|
973
991
|
if (!validators || validators.length === 0) {
|
|
974
992
|
return [];
|
|
975
993
|
}
|
|
@@ -985,12 +1003,12 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
985
1003
|
}
|
|
986
1004
|
}
|
|
987
1005
|
}
|
|
988
|
-
catch (
|
|
1006
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
989
1007
|
finally {
|
|
990
1008
|
try {
|
|
991
1009
|
if (validators_1_1 && !validators_1_1.done && (_a = validators_1.return)) _a.call(validators_1);
|
|
992
1010
|
}
|
|
993
|
-
finally { if (
|
|
1011
|
+
finally { if (e_6) throw e_6.error; }
|
|
994
1012
|
}
|
|
995
1013
|
return convertedValidators;
|
|
996
1014
|
};
|
|
@@ -1042,12 +1060,12 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
1042
1060
|
* @return {?}
|
|
1043
1061
|
*/
|
|
1044
1062
|
function (savedState, sections, currentQuestionnaireForm) {
|
|
1045
|
-
var
|
|
1063
|
+
var e_7, _a, e_8, _b, e_9, _c;
|
|
1046
1064
|
try {
|
|
1047
1065
|
for (var sections_2 = __values(sections), sections_2_1 = sections_2.next(); !sections_2_1.done; sections_2_1 = sections_2.next()) {
|
|
1048
1066
|
var section = sections_2_1.value;
|
|
1049
1067
|
try {
|
|
1050
|
-
for (var _d = (
|
|
1068
|
+
for (var _d = (e_8 = void 0, __values(section.questions)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
1051
1069
|
var question = _e.value;
|
|
1052
1070
|
if (question.type !== QuestionType.Repeater) {
|
|
1053
1071
|
continue;
|
|
@@ -1064,7 +1082,7 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
1064
1082
|
}
|
|
1065
1083
|
try {
|
|
1066
1084
|
// For each item that used to be there push a new empty template there to be populated.
|
|
1067
|
-
for (var repeaterArray_1 = (
|
|
1085
|
+
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()) {
|
|
1068
1086
|
var repeaterItem = repeaterArray_1_1.value;
|
|
1069
1087
|
/** @type {?} */
|
|
1070
1088
|
var index = repeaterArray.indexOf(repeaterItem);
|
|
@@ -1073,30 +1091,30 @@ var FormConstructorService = /** @class */ (function () {
|
|
|
1073
1091
|
repeaterFormArray.push(repeaterItemTemplate);
|
|
1074
1092
|
}
|
|
1075
1093
|
}
|
|
1076
|
-
catch (
|
|
1094
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1077
1095
|
finally {
|
|
1078
1096
|
try {
|
|
1079
1097
|
if (repeaterArray_1_1 && !repeaterArray_1_1.done && (_c = repeaterArray_1.return)) _c.call(repeaterArray_1);
|
|
1080
1098
|
}
|
|
1081
|
-
finally { if (
|
|
1099
|
+
finally { if (e_9) throw e_9.error; }
|
|
1082
1100
|
}
|
|
1083
1101
|
}
|
|
1084
1102
|
}
|
|
1085
|
-
catch (
|
|
1103
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1086
1104
|
finally {
|
|
1087
1105
|
try {
|
|
1088
1106
|
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
|
1089
1107
|
}
|
|
1090
|
-
finally { if (
|
|
1108
|
+
finally { if (e_8) throw e_8.error; }
|
|
1091
1109
|
}
|
|
1092
1110
|
}
|
|
1093
1111
|
}
|
|
1094
|
-
catch (
|
|
1112
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1095
1113
|
finally {
|
|
1096
1114
|
try {
|
|
1097
1115
|
if (sections_2_1 && !sections_2_1.done && (_a = sections_2.return)) _a.call(sections_2);
|
|
1098
1116
|
}
|
|
1099
|
-
finally { if (
|
|
1117
|
+
finally { if (e_7) throw e_7.error; }
|
|
1100
1118
|
}
|
|
1101
1119
|
};
|
|
1102
1120
|
FormConstructorService.decorators = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glowgreen-gg-questionnaire-v2.js","sources":["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":["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","_.cloneDeep"],"mappings":";;;;;;;;;;;IACI,OAAQ,OAAO;IACf,QAAS,QAAQ;IACjB,UAAW,UAAU;IACrB,UAAW,UAAU;IACrB,WAAY,WAAW;IACvB,YAAa,YAAY;IACzB,QAAS,QAAQ;IACjB,WAAY,WAAW;IACvB,QAAS,QAAQ;IACjB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,QAAQ,EAAE,uBAAuB;YACjC,SAAS,EAAE;gBACP,oBAAoB;gBACpB;oBACI,OAAO,EAAE,SAAS;oBAClB,QAAQ,EAAE,OAAO;iBACpB;aACJ;SACJ,CAAC;KACH;;gBAvBF,QAAQ,SAAC;oBACR,YAAY,EAAE,EAAE;oBAChB,SAAS,EAAE;wBACT,sBAAsB;wBACtB,aAAa;qBACd;oBACD,OAAO,EAAE;wBACP,WAAW;wBACX,mBAAmB;qBACpB;iBACF;;IAcD,8BAAC;CAxBD;;;;;;;;ICPI,MAAO,MAAM;IACb,QAAS,QAAQ;IACjB,OAAQ,OAAO;IACf,WAAY,KAAK;IACjB,UAAW,UAAU;IACrB,OAAQ,OAAO;IACf,MAAO,MAAM;IACb,eAAgB,gBAAgB;IAChC,MAAO,MAAM;IACb,OAAQ,OAAO;IACf,MAAO,MAAM;;;;;;;;;ICVb,OAAQ,OAAO;IACf,QAAS,QAAQ;IACjB,QAAS,QAAQ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"glowgreen-gg-questionnaire-v2.js","sources":["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":["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 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","_.cloneDeep"],"mappings":";;;;;;;;;;;IACI,OAAQ,OAAO;IACf,QAAS,QAAQ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