@piserve-tech/form-submission 1.3.317 → 1.3.319
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/environment/environment.d.ts +5 -0
- package/esm2022/environment/environment.mjs +6 -0
- package/esm2022/form-fields/aggregate-function/aggregate-function.component.mjs +146 -0
- package/esm2022/form-fields/check-box-fields/check-box-fields.component.mjs +473 -0
- package/esm2022/form-fields/currency-fields/currency-fields.component.mjs +502 -0
- package/esm2022/form-fields/date-time-fields/date-time-fields.component.mjs +608 -0
- package/esm2022/form-fields/drop-down-fields/drop-down-fields.component.mjs +585 -0
- package/esm2022/form-fields/file-picker-fields/file-picker-fields.component.mjs +224 -0
- package/esm2022/form-fields/form-fields.module.mjs +174 -0
- package/esm2022/form-fields/hidden-field/hidden-field.component.mjs +137 -0
- package/esm2022/form-fields/iframe-fields/iframe-fields.component.mjs +198 -0
- package/esm2022/form-fields/location-fields/location-fields.component.mjs +85 -0
- package/esm2022/form-fields/mail-fields/mail-fields.component.mjs +131 -0
- package/esm2022/form-fields/mobile-fields/mobile-fields.component.mjs +270 -0
- package/esm2022/form-fields/number-fields/number-fields.component.mjs +242 -0
- package/esm2022/form-fields/password-fields/password-fields.component.mjs +257 -0
- package/esm2022/form-fields/radio-button-fields/radio-button-fields.component.mjs +346 -0
- package/esm2022/form-fields/rich-text-editor-fields/rich-text-editor-fields.component.mjs +148 -0
- package/esm2022/form-fields/section-fields/section-fields.component.mjs +29 -0
- package/esm2022/form-fields/selection-matrix-fields/selection-matrix-fields.component.mjs +158 -0
- package/esm2022/form-fields/signature-fields/signature-fields.component.mjs +32 -0
- package/esm2022/form-fields/slider-fields/slider-fields.component.mjs +73 -0
- package/esm2022/form-fields/terms-and-condition-fields/terms-and-condition-fields.component.mjs +66 -0
- package/esm2022/form-fields/text-area-fields/text-area-fields.component.mjs +159 -0
- package/esm2022/form-fields/text-fields/text-fields.component.mjs +245 -0
- package/esm2022/form-fields/toggle-switch-fields/toggle-switch-fields.component.mjs +85 -0
- package/esm2022/form-fields/url-fields/url-fields.component.mjs +124 -0
- package/esm2022/form-submission/form-submission.module.mjs +64 -0
- package/esm2022/form-submission/header/header.component.mjs +20 -0
- package/esm2022/form-submission/navigation-tabs/navigation-tabs.component.mjs +171 -0
- package/esm2022/form-submission/next-prev-navigation/next-prev-navigation.component.mjs +124 -0
- package/esm2022/form-submission/save-as-draft/saveDraftModalComponent .mjs +50 -0
- package/esm2022/form-submission/submission-container/submission-container.component.mjs +17 -0
- package/esm2022/form-submission/submit-form/submit-form.component.mjs +1610 -0
- package/esm2022/lib/form-submission.component.mjs +113 -0
- package/esm2022/lib/form-submission.module.mjs +56 -0
- package/esm2022/lib/form-submission.service.mjs +14 -0
- package/esm2022/models/aggregate.model.mjs +2 -0
- package/esm2022/models/answer.model.mjs +2 -0
- package/esm2022/models/appearance.model.mjs +2 -0
- package/esm2022/models/attachment.model.mjs +2 -0
- package/esm2022/models/defaultAnswerEntry.model.mjs +2 -0
- package/esm2022/models/defaultAnswersModel.model.mjs +2 -0
- package/esm2022/models/defaultQuestionAnswer.model.mjs +2 -0
- package/esm2022/models/elementOptionAPI.model.mjs +2 -0
- package/esm2022/models/elementOptionAPIData.model.mjs +2 -0
- package/esm2022/models/elementOptionDB.model.mjs +2 -0
- package/esm2022/models/elementOptionDBCriteria.model.mjs +2 -0
- package/esm2022/models/emitters.model.mjs +2 -0
- package/esm2022/models/enum/condition.enum.mjs +18 -0
- package/esm2022/models/enum/elementType .enum.mjs +24 -0
- package/esm2022/models/enum/entityType.enum.mjs +12 -0
- package/esm2022/models/formConfiguration.model.mjs +2 -0
- package/esm2022/models/formElement.model.mjs +2 -0
- package/esm2022/models/formElementType.model.mjs +2 -0
- package/esm2022/models/grid.model.mjs +2 -0
- package/esm2022/models/hiddenField.model.mjs +2 -0
- package/esm2022/models/iFrameProperties.model.mjs +2 -0
- package/esm2022/models/logic.model.mjs +2 -0
- package/esm2022/models/multifields.model.mjs +2 -0
- package/esm2022/models/option.model.mjs +2 -0
- package/esm2022/models/page.model.mjs +2 -0
- package/esm2022/models/publicForm.model.mjs +2 -0
- package/esm2022/models/question.model.mjs +2 -0
- package/esm2022/models/questionAnswer.model.mjs +2 -0
- package/esm2022/models/questionGroup.model.mjs +2 -0
- package/esm2022/models/row.model.mjs +2 -0
- package/esm2022/models/scoring.model.mjs +2 -0
- package/esm2022/models/section.model.mjs +2 -0
- package/esm2022/models/subForm.model.mjs +2 -0
- package/esm2022/models/subformConfiguration.model.mjs +2 -0
- package/esm2022/models/subformPropery.model.mjs +2 -0
- package/esm2022/models/submission.model.mjs +2 -0
- package/esm2022/models/submissionCopyConfig.mopdel.mjs +2 -0
- package/esm2022/models/terms&condition.model.mjs +2 -0
- package/esm2022/models/validation.model.mjs +2 -0
- package/esm2022/models/whenClause.model.mjs +2 -0
- package/esm2022/models/whenClauseCondition.model.mjs +2 -0
- package/esm2022/models/whenClauseElements.model.mjs +2 -0
- package/esm2022/piserve-tech-form-submission.mjs +5 -0
- package/esm2022/public-api.mjs +7 -0
- package/esm2022/question/card-subform/card-subform.component.mjs +354 -0
- package/esm2022/question/confirm-dialog/confirm-dialog.component.mjs +27 -0
- package/esm2022/question/form-elements/form-elements.component.mjs +62 -0
- package/esm2022/question/inline-multiple-subform/inline-multiple-subform.component.mjs +384 -0
- package/esm2022/question/multifields/multifields.component.mjs +54 -0
- package/esm2022/question/multiple-subform/multiple-subform.component.mjs +413 -0
- package/esm2022/question/question/question.component.mjs +145 -0
- package/esm2022/question/question-group/question-group.component.mjs +102 -0
- package/esm2022/question/recursive-logic/recursive-logic.component.mjs +49 -0
- package/esm2022/question/sub-form/sub-form.component.mjs +355 -0
- package/esm2022/services/aggregate.service.mjs +139 -0
- package/esm2022/services/countryService.mjs +89 -0
- package/esm2022/services/data.service.mjs +36 -0
- package/esm2022/services/element-tracker.service.mjs +27 -0
- package/esm2022/services/form-validation.service.mjs +128 -0
- package/esm2022/services/form.service.mjs +332 -0
- package/esm2022/services/mapper.service.mjs +519 -0
- package/esm2022/services/recaptcha.service.mjs +136 -0
- package/esm2022/services/score.service.mjs +268 -0
- package/esm2022/services/subform-copy.service.mjs +122 -0
- package/esm2022/services/validation.service.mjs +35 -0
- package/esm2022/services/whenClause.service.mjs +423 -0
- package/esm2022/shared/shared.module.mjs +97 -0
- package/esm2022/sub-form/submission-modal/submission-modal.component.mjs +133 -0
- package/fesm2022/piserve-tech-form-submission.mjs +11661 -0
- package/fesm2022/piserve-tech-form-submission.mjs.map +1 -0
- package/form-fields/aggregate-function/aggregate-function.component.d.ts +43 -0
- package/form-fields/check-box-fields/check-box-fields.component.d.ts +73 -0
- package/form-fields/currency-fields/currency-fields.component.d.ts +62 -0
- package/form-fields/date-time-fields/date-time-fields.component.d.ts +96 -0
- package/form-fields/drop-down-fields/drop-down-fields.component.d.ts +88 -0
- package/form-fields/file-picker-fields/file-picker-fields.component.d.ts +72 -0
- package/form-fields/form-fields.module.d.ts +40 -0
- package/form-fields/hidden-field/hidden-field.component.d.ts +38 -0
- package/form-fields/iframe-fields/iframe-fields.component.d.ts +35 -0
- package/form-fields/location-fields/location-fields.component.d.ts +29 -0
- package/form-fields/mail-fields/mail-fields.component.d.ts +41 -0
- package/form-fields/mobile-fields/mobile-fields.component.d.ts +71 -0
- package/form-fields/number-fields/number-fields.component.d.ts +53 -0
- package/form-fields/password-fields/password-fields.component.d.ts +57 -0
- package/form-fields/radio-button-fields/radio-button-fields.component.d.ts +70 -0
- package/form-fields/rich-text-editor-fields/rich-text-editor-fields.component.d.ts +46 -0
- package/form-fields/section-fields/section-fields.component.d.ts +10 -0
- package/form-fields/selection-matrix-fields/selection-matrix-fields.component.d.ts +45 -0
- package/form-fields/signature-fields/signature-fields.component.d.ts +13 -0
- package/form-fields/slider-fields/slider-fields.component.d.ts +32 -0
- package/form-fields/terms-and-condition-fields/terms-and-condition-fields.component.d.ts +26 -0
- package/form-fields/text-area-fields/text-area-fields.component.d.ts +49 -0
- package/form-fields/text-fields/text-fields.component.d.ts +49 -0
- package/form-fields/toggle-switch-fields/toggle-switch-fields.component.d.ts +29 -0
- package/form-fields/url-fields/url-fields.component.d.ts +41 -0
- package/form-submission/form-submission.module.d.ts +20 -0
- package/form-submission/header/header.component.d.ts +7 -0
- package/form-submission/navigation-tabs/navigation-tabs.component.d.ts +57 -0
- package/form-submission/next-prev-navigation/next-prev-navigation.component.d.ts +46 -0
- package/form-submission/save-as-draft/saveDraftModalComponent .d.ts +17 -0
- package/form-submission/submission-container/submission-container.component.d.ts +7 -0
- package/form-submission/submit-form/submit-form.component.d.ts +237 -0
- package/index.d.ts +5 -0
- package/lib/form-submission.component.d.ts +30 -0
- package/lib/form-submission.module.d.ts +16 -0
- package/lib/form-submission.service.d.ts +6 -0
- package/models/aggregate.model.d.ts +4 -0
- package/{src/models/answer.model.ts → models/answer.model.d.ts} +23 -25
- package/models/appearance.model.d.ts +64 -0
- package/{src/models/attachment.model.ts → models/attachment.model.d.ts} +6 -6
- package/{src/models/defaultAnswerEntry.model.ts → models/defaultAnswerEntry.model.d.ts} +5 -7
- package/{src/models/defaultAnswersModel.model.ts → models/defaultAnswersModel.model.d.ts} +4 -5
- package/{src/models/defaultQuestionAnswer.model.ts → models/defaultQuestionAnswer.model.d.ts} +6 -6
- package/models/elementOptionAPI.model.d.ts +12 -0
- package/models/elementOptionAPIData.model.d.ts +5 -0
- package/models/elementOptionDB.model.d.ts +8 -0
- package/models/elementOptionDBCriteria.model.d.ts +7 -0
- package/{src/models/emitters.model.ts → models/emitters.model.d.ts} +8 -8
- package/{src/models/enum/condition.enum.ts → models/enum/condition.enum.d.ts} +2 -2
- package/models/enum/elementType .enum.d.ts +22 -0
- package/models/enum/entityType.enum.d.ts +10 -0
- package/{src/models/formConfiguration.model.ts → models/formConfiguration.model.d.ts} +2 -2
- package/{src/models/formElement.model.ts → models/formElement.model.d.ts} +22 -22
- package/{src/models/formElementType.model.ts → models/formElementType.model.d.ts} +2 -3
- package/{src/models/grid.model.ts → models/grid.model.d.ts} +13 -14
- package/{src/models/hiddenField.model.ts → models/hiddenField.model.d.ts} +5 -5
- package/{src/models/iFrameProperties.model.ts → models/iFrameProperties.model.d.ts} +13 -13
- package/models/logic.model.d.ts +9 -0
- package/models/multifields.model.d.ts +11 -0
- package/{src/models/option.model.ts → models/option.model.d.ts} +5 -5
- package/models/page.model.d.ts +6 -0
- package/models/publicForm.model.d.ts +18 -0
- package/models/question.model.d.ts +26 -0
- package/models/questionAnswer.model.d.ts +7 -0
- package/models/questionGroup.model.d.ts +11 -0
- package/{src/models/row.model.ts → models/row.model.d.ts} +1 -2
- package/models/scoring.model.d.ts +10 -0
- package/models/section.model.d.ts +6 -0
- package/models/subForm.model.d.ts +24 -0
- package/models/subformConfiguration.model.d.ts +4 -0
- package/models/subformPropery.model.d.ts +7 -0
- package/{src/models/submission.model.ts → models/submission.model.d.ts} +14 -16
- package/{src/models/submissionCopyConfig.mopdel.ts → models/submissionCopyConfig.mopdel.d.ts} +4 -4
- package/{src/models/terms&condition.model.ts → models/terms&condition.model.d.ts} +1 -1
- package/models/validation.model.d.ts +48 -0
- package/models/whenClause.model.d.ts +6 -0
- package/{src/models/whenClauseCondition.model.ts → models/whenClauseCondition.model.d.ts} +6 -6
- package/{src/models/whenClauseElements.model.ts → models/whenClauseElements.model.d.ts} +5 -6
- package/package.json +46 -33
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/question/card-subform/card-subform.component.d.ts +44 -0
- package/question/confirm-dialog/confirm-dialog.component.d.ts +12 -0
- package/question/form-elements/form-elements.component.d.ts +20 -0
- package/question/inline-multiple-subform/inline-multiple-subform.component.d.ts +47 -0
- package/question/multifields/multifields.component.d.ts +11 -0
- package/question/multiple-subform/multiple-subform.component.d.ts +39 -0
- package/question/question/question.component.d.ts +30 -0
- package/question/question-group/question-group.component.d.ts +29 -0
- package/question/recursive-logic/recursive-logic.component.d.ts +19 -0
- package/question/sub-form/sub-form.component.d.ts +70 -0
- package/services/aggregate.service.d.ts +29 -0
- package/services/countryService.d.ts +21 -0
- package/services/data.service.d.ts +19 -0
- package/services/element-tracker.service.d.ts +10 -0
- package/services/form-validation.service.d.ts +16 -0
- package/services/form.service.d.ts +27 -0
- package/services/mapper.service.d.ts +31 -0
- package/services/recaptcha.service.d.ts +46 -0
- package/services/score.service.d.ts +27 -0
- package/services/subform-copy.service.d.ts +10 -0
- package/services/validation.service.d.ts +14 -0
- package/services/whenClause.service.d.ts +45 -0
- package/shared/shared.module.d.ts +25 -0
- package/sub-form/submission-modal/submission-modal.component.d.ts +31 -0
- package/ng-package.json +0 -30
- package/src/environment/environment.ts +0 -6
- package/src/form-fields/aggregate-function/aggregate-function.component.html +0 -63
- package/src/form-fields/aggregate-function/aggregate-function.component.scss +0 -1
- package/src/form-fields/aggregate-function/aggregate-function.component.spec.ts +0 -21
- package/src/form-fields/aggregate-function/aggregate-function.component.ts +0 -148
- package/src/form-fields/check-box-fields/check-box-fields.component.html +0 -81
- package/src/form-fields/check-box-fields/check-box-fields.component.scss +0 -28
- package/src/form-fields/check-box-fields/check-box-fields.component.spec.ts +0 -21
- package/src/form-fields/check-box-fields/check-box-fields.component.ts +0 -538
- package/src/form-fields/currency-fields/currency-fields.component.html +0 -85
- package/src/form-fields/currency-fields/currency-fields.component.scss +0 -48
- package/src/form-fields/currency-fields/currency-fields.component.spec.ts +0 -21
- package/src/form-fields/currency-fields/currency-fields.component.ts +0 -589
- package/src/form-fields/date-time-fields/date-time-fields.component.html +0 -268
- package/src/form-fields/date-time-fields/date-time-fields.component.scss +0 -88
- package/src/form-fields/date-time-fields/date-time-fields.component.spec.ts +0 -21
- package/src/form-fields/date-time-fields/date-time-fields.component.ts +0 -693
- package/src/form-fields/drop-down-fields/drop-down-fields.component.html +0 -77
- package/src/form-fields/drop-down-fields/drop-down-fields.component.scss +0 -12
- package/src/form-fields/drop-down-fields/drop-down-fields.component.spec.ts +0 -21
- package/src/form-fields/drop-down-fields/drop-down-fields.component.ts +0 -698
- package/src/form-fields/file-picker-fields/file-picker-fields.component.html +0 -72
- package/src/form-fields/file-picker-fields/file-picker-fields.component.scss +0 -33
- package/src/form-fields/file-picker-fields/file-picker-fields.component.spec.ts +0 -21
- package/src/form-fields/file-picker-fields/file-picker-fields.component.ts +0 -256
- package/src/form-fields/form-fields.module.ts +0 -110
- package/src/form-fields/hidden-field/hidden-field.component.scss +0 -0
- package/src/form-fields/hidden-field/hidden-field.component.spec.ts +0 -21
- package/src/form-fields/hidden-field/hidden-field.component.ts +0 -156
- package/src/form-fields/iframe-fields/iframe-fields.component.html +0 -31
- package/src/form-fields/iframe-fields/iframe-fields.component.scss +0 -0
- package/src/form-fields/iframe-fields/iframe-fields.component.spec.ts +0 -21
- package/src/form-fields/iframe-fields/iframe-fields.component.ts +0 -225
- package/src/form-fields/location-fields/location-fields.component.html +0 -54
- package/src/form-fields/location-fields/location-fields.component.scss +0 -22
- package/src/form-fields/location-fields/location-fields.component.spec.ts +0 -21
- package/src/form-fields/location-fields/location-fields.component.ts +0 -83
- package/src/form-fields/mail-fields/mail-fields.component.html +0 -66
- package/src/form-fields/mail-fields/mail-fields.component.scss +0 -10
- package/src/form-fields/mail-fields/mail-fields.component.spec.ts +0 -21
- package/src/form-fields/mail-fields/mail-fields.component.ts +0 -127
- package/src/form-fields/mobile-fields/mobile-fields.component.html +0 -97
- package/src/form-fields/mobile-fields/mobile-fields.component.scss +0 -52
- package/src/form-fields/mobile-fields/mobile-fields.component.spec.ts +0 -21
- package/src/form-fields/mobile-fields/mobile-fields.component.ts +0 -310
- package/src/form-fields/number-fields/number-fields.component.html +0 -70
- package/src/form-fields/number-fields/number-fields.component.scss +0 -17
- package/src/form-fields/number-fields/number-fields.component.spec.ts +0 -21
- package/src/form-fields/number-fields/number-fields.component.ts +0 -256
- package/src/form-fields/password-fields/password-fields.component.html +0 -113
- package/src/form-fields/password-fields/password-fields.component.scss +0 -61
- package/src/form-fields/password-fields/password-fields.component.spec.ts +0 -21
- package/src/form-fields/password-fields/password-fields.component.ts +0 -273
- package/src/form-fields/radio-button-fields/radio-button-fields.component.html +0 -82
- package/src/form-fields/radio-button-fields/radio-button-fields.component.scss +0 -28
- package/src/form-fields/radio-button-fields/radio-button-fields.component.spec.ts +0 -21
- package/src/form-fields/radio-button-fields/radio-button-fields.component.ts +0 -391
- package/src/form-fields/rich-text-editor-fields/rich-text-editor-fields.component.html +0 -67
- package/src/form-fields/rich-text-editor-fields/rich-text-editor-fields.component.scss +0 -23
- package/src/form-fields/rich-text-editor-fields/rich-text-editor-fields.component.spec.ts +0 -21
- package/src/form-fields/rich-text-editor-fields/rich-text-editor-fields.component.ts +0 -145
- package/src/form-fields/section-fields/section-fields.component.html +0 -4
- package/src/form-fields/section-fields/section-fields.component.scss +0 -37
- package/src/form-fields/section-fields/section-fields.component.spec.ts +0 -21
- package/src/form-fields/section-fields/section-fields.component.ts +0 -25
- package/src/form-fields/selection-matrix-fields/selection-matrix-fields.component.html +0 -93
- package/src/form-fields/selection-matrix-fields/selection-matrix-fields.component.scss +0 -52
- package/src/form-fields/selection-matrix-fields/selection-matrix-fields.component.spec.ts +0 -21
- package/src/form-fields/selection-matrix-fields/selection-matrix-fields.component.ts +0 -155
- package/src/form-fields/signature-fields/signature-fields.component.html +0 -43
- package/src/form-fields/signature-fields/signature-fields.component.scss +0 -10
- package/src/form-fields/signature-fields/signature-fields.component.spec.ts +0 -21
- package/src/form-fields/signature-fields/signature-fields.component.ts +0 -25
- package/src/form-fields/slider-fields/slider-fields.component.html +0 -67
- package/src/form-fields/slider-fields/slider-fields.component.scss +0 -55
- package/src/form-fields/slider-fields/slider-fields.component.spec.ts +0 -21
- package/src/form-fields/slider-fields/slider-fields.component.ts +0 -63
- package/src/form-fields/terms-and-condition-fields/terms-and-condition-fields.component.html +0 -52
- package/src/form-fields/terms-and-condition-fields/terms-and-condition-fields.component.scss +0 -85
- package/src/form-fields/terms-and-condition-fields/terms-and-condition-fields.component.spec.ts +0 -21
- package/src/form-fields/terms-and-condition-fields/terms-and-condition-fields.component.ts +0 -62
- package/src/form-fields/text-area-fields/text-area-fields.component.html +0 -68
- package/src/form-fields/text-area-fields/text-area-fields.component.scss +0 -19
- package/src/form-fields/text-area-fields/text-area-fields.component.spec.ts +0 -21
- package/src/form-fields/text-area-fields/text-area-fields.component.ts +0 -166
- package/src/form-fields/text-fields/text-fields.component.html +0 -67
- package/src/form-fields/text-fields/text-fields.component.scss +0 -26
- package/src/form-fields/text-fields/text-fields.component.spec.ts +0 -21
- package/src/form-fields/text-fields/text-fields.component.ts +0 -248
- package/src/form-fields/toggle-switch-fields/toggle-switch-fields.component.html +0 -70
- package/src/form-fields/toggle-switch-fields/toggle-switch-fields.component.scss +0 -112
- package/src/form-fields/toggle-switch-fields/toggle-switch-fields.component.spec.ts +0 -21
- package/src/form-fields/toggle-switch-fields/toggle-switch-fields.component.ts +0 -74
- package/src/form-fields/url-fields/url-fields.component.html +0 -109
- package/src/form-fields/url-fields/url-fields.component.scss +0 -22
- package/src/form-fields/url-fields/url-fields.component.spec.ts +0 -21
- package/src/form-fields/url-fields/url-fields.component.ts +0 -123
- package/src/form-submission/form-submission.module.ts +0 -40
- package/src/form-submission/header/header.component.html +0 -6
- package/src/form-submission/header/header.component.scss +0 -26
- package/src/form-submission/header/header.component.spec.ts +0 -21
- package/src/form-submission/header/header.component.ts +0 -12
- package/src/form-submission/navigation-tabs/navigation-tabs.component.html +0 -134
- package/src/form-submission/navigation-tabs/navigation-tabs.component.scss +0 -200
- package/src/form-submission/navigation-tabs/navigation-tabs.component.spec.ts +0 -21
- package/src/form-submission/navigation-tabs/navigation-tabs.component.ts +0 -134
- package/src/form-submission/next-prev-navigation/next-prev-navigation.component.html +0 -207
- package/src/form-submission/next-prev-navigation/next-prev-navigation.component.scss +0 -208
- package/src/form-submission/next-prev-navigation/next-prev-navigation.component.spec.ts +0 -21
- package/src/form-submission/next-prev-navigation/next-prev-navigation.component.ts +0 -74
- package/src/form-submission/save-as-draft/saveDraftModalComponent .ts +0 -60
- package/src/form-submission/save-as-draft/saveDraftModalComponent.html +0 -33
- package/src/form-submission/save-as-draft/saveDraftModalComponent.scss +0 -195
- package/src/form-submission/submission-container/submission-container.component.html +0 -30
- package/src/form-submission/submission-container/submission-container.component.scss +0 -67
- package/src/form-submission/submission-container/submission-container.component.spec.ts +0 -21
- package/src/form-submission/submission-container/submission-container.component.ts +0 -14
- package/src/form-submission/submit-form/submit-form.component.html +0 -76
- package/src/form-submission/submit-form/submit-form.component.scss +0 -88
- package/src/form-submission/submit-form/submit-form.component.spec.ts +0 -21
- package/src/form-submission/submit-form/submit-form.component.ts +0 -1953
- package/src/lib/form-submission.component.html +0 -15
- package/src/lib/form-submission.component.scss +0 -1
- package/src/lib/form-submission.component.ts +0 -120
- package/src/lib/form-submission.module.ts +0 -31
- package/src/lib/form-submission.service.spec.ts +0 -16
- package/src/lib/form-submission.service.ts +0 -9
- package/src/models/aggregate.model.ts +0 -4
- package/src/models/appearance.model.ts +0 -64
- package/src/models/elementOptionAPI.model.ts +0 -13
- package/src/models/elementOptionAPIData.model.ts +0 -5
- package/src/models/elementOptionDB.model.ts +0 -9
- package/src/models/elementOptionDBCriteria.model.ts +0 -7
- package/src/models/enum/elementType .enum.ts +0 -22
- package/src/models/enum/entityType.enum.ts +0 -10
- package/src/models/logic.model.ts +0 -11
- package/src/models/multifields.model.ts +0 -12
- package/src/models/page.model.ts +0 -7
- package/src/models/publicForm.model.ts +0 -19
- package/src/models/question.model.ts +0 -27
- package/src/models/questionAnswer.model.ts +0 -8
- package/src/models/questionGroup.model.ts +0 -12
- package/src/models/response.model.ts +0 -9
- package/src/models/result.model.ts +0 -5
- package/src/models/scoring.model.ts +0 -10
- package/src/models/section.model.ts +0 -6
- package/src/models/subForm.model.ts +0 -25
- package/src/models/subformConfiguration.model.ts +0 -4
- package/src/models/subformPropery.model.ts +0 -8
- package/src/models/validation.model.ts +0 -48
- package/src/models/whenClause.model.ts +0 -7
- package/src/question/card-subform/card-subform.component.html +0 -282
- package/src/question/card-subform/card-subform.component.scss +0 -49
- package/src/question/card-subform/card-subform.component.spec.ts +0 -21
- package/src/question/card-subform/card-subform.component.ts +0 -407
- package/src/question/confirm-dialog/confirm-dialog.component.html +0 -32
- package/src/question/confirm-dialog/confirm-dialog.component.scss +0 -109
- package/src/question/confirm-dialog/confirm-dialog.component.spec.ts +0 -21
- package/src/question/confirm-dialog/confirm-dialog.component.ts +0 -24
- package/src/question/form-elements/form-elements.component.html +0 -28
- package/src/question/form-elements/form-elements.component.scss +0 -0
- package/src/question/form-elements/form-elements.component.spec.ts +0 -21
- package/src/question/form-elements/form-elements.component.ts +0 -41
- package/src/question/inline-multiple-subform/inline-multiple-subform.component.html +0 -321
- package/src/question/inline-multiple-subform/inline-multiple-subform.component.scss +0 -78
- package/src/question/inline-multiple-subform/inline-multiple-subform.component.spec.ts +0 -21
- package/src/question/inline-multiple-subform/inline-multiple-subform.component.ts +0 -425
- package/src/question/multifields/multifields.component.html +0 -78
- package/src/question/multifields/multifields.component.scss +0 -6
- package/src/question/multifields/multifields.component.spec.ts +0 -21
- package/src/question/multifields/multifields.component.ts +0 -27
- package/src/question/multiple-subform/multiple-subform.component.html +0 -185
- package/src/question/multiple-subform/multiple-subform.component.scss +0 -52
- package/src/question/multiple-subform/multiple-subform.component.spec.ts +0 -21
- package/src/question/multiple-subform/multiple-subform.component.ts +0 -481
- package/src/question/question/question.component.html +0 -51
- package/src/question/question/question.component.scss +0 -0
- package/src/question/question/question.component.spec.ts +0 -21
- package/src/question/question/question.component.ts +0 -129
- package/src/question/question-group/question-group.component.html +0 -147
- package/src/question/question-group/question-group.component.scss +0 -36
- package/src/question/question-group/question-group.component.spec.ts +0 -21
- package/src/question/question-group/question-group.component.ts +0 -94
- package/src/question/question.module.ts +0 -22
- package/src/question/recursive-logic/recursive-logic.component.html +0 -33
- package/src/question/recursive-logic/recursive-logic.component.scss +0 -0
- package/src/question/recursive-logic/recursive-logic.component.spec.ts +0 -21
- package/src/question/recursive-logic/recursive-logic.component.ts +0 -29
- package/src/question/sub-form/sub-form.component.html +0 -254
- package/src/question/sub-form/sub-form.component.scss +0 -83
- package/src/question/sub-form/sub-form.component.spec.ts +0 -21
- package/src/question/sub-form/sub-form.component.ts +0 -421
- package/src/services/aggregate.service.ts +0 -148
- package/src/services/countryService.ts +0 -92
- package/src/services/data.service.ts +0 -36
- package/src/services/element-tracker.service.spec.ts +0 -16
- package/src/services/element-tracker.service.ts +0 -24
- package/src/services/form-validation.service.ts +0 -151
- package/src/services/form.service.spec.ts +0 -16
- package/src/services/form.service.ts +0 -407
- package/src/services/mapper.service.ts +0 -625
- package/src/services/recaptcha.service.spec.ts +0 -16
- package/src/services/recaptcha.service.ts +0 -179
- package/src/services/score.service.ts +0 -352
- package/src/services/subform-copy.service.ts +0 -148
- package/src/services/validation.service.spec.ts +0 -16
- package/src/services/validation.service.ts +0 -33
- package/src/services/whenClause.service.ts +0 -502
- package/src/shared/shared.module.ts +0 -58
- package/src/styles/shared-style.scss +0 -86
- package/src/sub-form/sub-form.module.ts +0 -24
- package/src/sub-form/submission-modal/submission-modal.component.html +0 -160
- package/src/sub-form/submission-modal/submission-modal.component.scss +0 -54
- package/src/sub-form/submission-modal/submission-modal.component.spec.ts +0 -21
- package/src/sub-form/submission-modal/submission-modal.component.ts +0 -127
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
- /package/{src/assets → assets}/fonts/Garamond.woff2 +0 -0
- /package/{src/assets → assets}/fonts/Georgia.woff2 +0 -0
- /package/{src/assets → assets}/fonts/Poppins.woff2 +0 -0
- /package/{src/assets → assets}/fonts/Tahoma.woff2 +0 -0
- /package/{src/assets → assets}/fonts/Tajawal.woff2 +0 -0
- /package/{src/assets → assets}/fonts/Verdana.woff2 +0 -0
- /package/{src/assets → assets}/icons/close-sidebar-mark-icon.svg +0 -0
- /package/{src/assets → assets}/icons/copy-icon.svg +0 -0
- /package/{src/assets → assets}/icons/delete-icon.svg +0 -0
- /package/{src/assets → assets}/icons/delete-no-outline-icon.svg +0 -0
- /package/{src/assets → assets}/icons/left_arrow.svg +0 -0
- /package/{src/assets → assets}/icons/right_arrow.svg +0 -0
|
@@ -1,538 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { FormService } from '../../services/form.service';
|
|
3
|
-
import { ElementTrackerService } from '../../services/element-tracker.service';
|
|
4
|
-
import { ValidationService } from '../../services/validation.service';
|
|
5
|
-
import { ScoreCalculationService } from '../../services/score.service';
|
|
6
|
-
import { WhenClauseService } from '../../services/whenClause.service';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'lib-check-box-fields',
|
|
10
|
-
templateUrl: './check-box-fields.component.html',
|
|
11
|
-
styleUrls: ['./check-box-fields.component.scss'],
|
|
12
|
-
})
|
|
13
|
-
export class CheckBoxFieldsComponent {
|
|
14
|
-
@Input() question: any = {};
|
|
15
|
-
@Input() inLine: boolean = false;
|
|
16
|
-
@Input() inCard: boolean = false;
|
|
17
|
-
@Input() submissionIndex!: number;
|
|
18
|
-
@Output() answerChange = new EventEmitter<{
|
|
19
|
-
answer: any;
|
|
20
|
-
maxPossibleScore?: number;
|
|
21
|
-
}>();
|
|
22
|
-
@Input() rowId: number = 0;
|
|
23
|
-
|
|
24
|
-
count: number = 0;
|
|
25
|
-
required: boolean = false;
|
|
26
|
-
hint: string = '';
|
|
27
|
-
selectionType: string = '';
|
|
28
|
-
minimumSelection?: number;
|
|
29
|
-
maximumSelection?: number;
|
|
30
|
-
optionType: string = '';
|
|
31
|
-
lookupTable: any = {};
|
|
32
|
-
customOptions: any[] = [];
|
|
33
|
-
database: any = {};
|
|
34
|
-
api: any = {};
|
|
35
|
-
apiOptions: any[] = [];
|
|
36
|
-
selectedOptions: any[] = [];
|
|
37
|
-
validationFailed: boolean = false;
|
|
38
|
-
displayOptionsInColumn: boolean = false;
|
|
39
|
-
validationMessage: string = '';
|
|
40
|
-
private elementId: string = '';
|
|
41
|
-
maxPossibleScore?: number;
|
|
42
|
-
@Input() disableEdit: boolean = false;
|
|
43
|
-
|
|
44
|
-
constructor(
|
|
45
|
-
private formService: FormService,
|
|
46
|
-
private validationService: ValidationService,
|
|
47
|
-
private tracker: ElementTrackerService,
|
|
48
|
-
private scoreCalcService: ScoreCalculationService,
|
|
49
|
-
private whenClauseService:WhenClauseService
|
|
50
|
-
) {}
|
|
51
|
-
|
|
52
|
-
ngOnInit() {
|
|
53
|
-
this.valueAssigned();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
valueAssigned() {
|
|
57
|
-
this.count = this.question.count;
|
|
58
|
-
this.required = this.question.required;
|
|
59
|
-
this.hint = this.question.hint;
|
|
60
|
-
this.selectionType = this.question.formElement.appearance.selectionType;
|
|
61
|
-
this.displayOptionsInColumn =
|
|
62
|
-
this.question.formElement.appearance.displayOptionsInColumn ?? false;
|
|
63
|
-
this.minimumSelection =
|
|
64
|
-
this.question.formElement.validation.minimumSelection;
|
|
65
|
-
this.maximumSelection =
|
|
66
|
-
this.question.formElement.validation.maximumSelection;
|
|
67
|
-
this.optionType = this.question.formElement.option.optionType;
|
|
68
|
-
switch (this.optionType) {
|
|
69
|
-
case 'OPTION':
|
|
70
|
-
this.customOptions = this.question.formElement.option.customOptions;
|
|
71
|
-
this.customOptions = this.question.formElement.option.customOptions.map(
|
|
72
|
-
(option: any) => ({
|
|
73
|
-
value: option.value,
|
|
74
|
-
label: option.value,
|
|
75
|
-
})
|
|
76
|
-
);
|
|
77
|
-
if (this.question.answer) {
|
|
78
|
-
this.initializeCustomOption();
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
case 'LOOKUP':
|
|
82
|
-
this.lookupTable = this.question.formElement.option.lookupTable;
|
|
83
|
-
this.fetchDataFromLookup();
|
|
84
|
-
break;
|
|
85
|
-
case 'DATABASE':
|
|
86
|
-
this.database = this.question.formElement.option.database;
|
|
87
|
-
this.fetchDataFromDatabase();
|
|
88
|
-
break;
|
|
89
|
-
case 'API':
|
|
90
|
-
this.api = this.question.formElement.option.api;
|
|
91
|
-
this.fetchDataFromAPI();
|
|
92
|
-
break;
|
|
93
|
-
default:
|
|
94
|
-
console.warn('Unknown option type:', this.optionType);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (this.selectionType === 'SINGLE') {
|
|
98
|
-
this.minimumSelection = 1;
|
|
99
|
-
this.maximumSelection = 1;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (
|
|
103
|
-
this.selectionType === 'MULTIPLE' &&
|
|
104
|
-
!this.minimumSelection &&
|
|
105
|
-
!this.maximumSelection
|
|
106
|
-
) {
|
|
107
|
-
this.minimumSelection = undefined;
|
|
108
|
-
this.maximumSelection = undefined;
|
|
109
|
-
}
|
|
110
|
-
if (
|
|
111
|
-
this.question.formElement.scoring &&
|
|
112
|
-
this.question.formElement.scoring.enableScoring
|
|
113
|
-
) {
|
|
114
|
-
this.maxPossibleScore =
|
|
115
|
-
this.scoreCalcService.getMaxPossibleScoreForQuestion(this.question);
|
|
116
|
-
this.question.maxPossibleScore = this.maxPossibleScore;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
initializeCustomOption() {
|
|
121
|
-
this.selectedOptions = [];
|
|
122
|
-
this.customOptions?.forEach((option: any) => {
|
|
123
|
-
if (
|
|
124
|
-
this.question?.answer?.find((a: any) => {
|
|
125
|
-
if (typeof a === 'string' && a.includes('|')) {
|
|
126
|
-
const parts = a.split('|');
|
|
127
|
-
return parts[1] === option.value.toString();
|
|
128
|
-
}
|
|
129
|
-
return a.toString() === option.value.toString();
|
|
130
|
-
})
|
|
131
|
-
) {
|
|
132
|
-
this.selectedOptions.push(option);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
setTimeout(() => {
|
|
136
|
-
const answers = Array.isArray(this.question.answer) ? this.question.answer : [];
|
|
137
|
-
const parsedAnswers = answers.map((ans:any) => ans.split('|')[1]);
|
|
138
|
-
this.whenClauseService.setQuestionAnswer(this.question.id,parsedAnswers,true);
|
|
139
|
-
});
|
|
140
|
-
if (this.question.childLogics && this.question.answer) {
|
|
141
|
-
this.updateChildLogics(this.question);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
onCheckboxChange(option: any, event: any) {
|
|
146
|
-
if (this.selectionType === 'SINGLE') {
|
|
147
|
-
if (event.target.checked) {
|
|
148
|
-
this.selectedOptions = [option];
|
|
149
|
-
this.question.answer = [`${option.label}|${option.value}`];
|
|
150
|
-
} else {
|
|
151
|
-
this.selectedOptions = [];
|
|
152
|
-
this.question.answer = [];
|
|
153
|
-
}
|
|
154
|
-
this.isMinimumSelectionValid();
|
|
155
|
-
} else if (this.selectionType === 'MULTIPLE') {
|
|
156
|
-
if (event.target.checked) {
|
|
157
|
-
if (!this.selectedOptions.includes(option)) {
|
|
158
|
-
this.selectedOptions.push(option);
|
|
159
|
-
}
|
|
160
|
-
} else {
|
|
161
|
-
this.selectedOptions = this.selectedOptions.filter(
|
|
162
|
-
(item) => item !== option
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
this.question.answer = this.selectedOptions.map(
|
|
166
|
-
(item) => `${item.label}|${item.value}`
|
|
167
|
-
);
|
|
168
|
-
this.isMinimumSelectionValid();
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (
|
|
172
|
-
this.maximumSelection !== undefined &&
|
|
173
|
-
this.selectedOptions.length > this.maximumSelection
|
|
174
|
-
) {
|
|
175
|
-
event.target.checked = false;
|
|
176
|
-
this.selectedOptions = this.selectedOptions.filter(
|
|
177
|
-
(item) => item !== option
|
|
178
|
-
);
|
|
179
|
-
this.question.answer = this.selectedOptions.map(
|
|
180
|
-
(item) => `${item.label}|${item.value}`
|
|
181
|
-
);
|
|
182
|
-
this.isMinimumSelectionValid();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (this.question.childLogics) {
|
|
186
|
-
this.updateChildLogics(this.question);
|
|
187
|
-
}
|
|
188
|
-
const scoreResult = this.scoreCalcService.calculateScoreFromAnswer(
|
|
189
|
-
this.question.answer,
|
|
190
|
-
this.question
|
|
191
|
-
);
|
|
192
|
-
this.question.score = scoreResult?.scores;
|
|
193
|
-
this.answerChange.emit({
|
|
194
|
-
answer: this.question.answer,
|
|
195
|
-
maxPossibleScore: this.maxPossibleScore,
|
|
196
|
-
});
|
|
197
|
-
const answers = Array.isArray(this.question.answer) ? this.question.answer : [];
|
|
198
|
-
const parsedAnswers = answers.map((ans:any) => ans.split('|')[1]);
|
|
199
|
-
this.whenClauseService.setQuestionAnswer(this.question.id,parsedAnswers);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
updateChildLogics(question: any) {
|
|
203
|
-
if (question.childLogics && Array.isArray(question.childLogics)) {
|
|
204
|
-
question.childLogics.forEach((childLogic: any) => {
|
|
205
|
-
if (this.selectionType === 'SINGLE') {
|
|
206
|
-
if (this.selectedOptions.length === 0) {
|
|
207
|
-
childLogic.showLogic = false;
|
|
208
|
-
this.clearAnswersRecursively(childLogic);
|
|
209
|
-
} else {
|
|
210
|
-
if (
|
|
211
|
-
this.evaluateCondition(
|
|
212
|
-
this.selectedOptions[0]?.label,
|
|
213
|
-
childLogic.condition,
|
|
214
|
-
childLogic.inputValue
|
|
215
|
-
)
|
|
216
|
-
) {
|
|
217
|
-
childLogic.showLogic = true;
|
|
218
|
-
} else {
|
|
219
|
-
childLogic.showLogic = false;
|
|
220
|
-
this.clearAnswersRecursively(childLogic);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
} else if (this.selectionType === 'MULTIPLE') {
|
|
224
|
-
if (this.selectedOptions.length === 0) {
|
|
225
|
-
childLogic.showLogic = false;
|
|
226
|
-
this.clearAnswersRecursively(childLogic);
|
|
227
|
-
} else {
|
|
228
|
-
const selectedLabels = this.selectedOptions.map(
|
|
229
|
-
(item: any) => item.label
|
|
230
|
-
);
|
|
231
|
-
if (
|
|
232
|
-
this.evaluateMultipleCondition(
|
|
233
|
-
selectedLabels,
|
|
234
|
-
childLogic.condition,
|
|
235
|
-
childLogic.inputValue
|
|
236
|
-
)
|
|
237
|
-
) {
|
|
238
|
-
childLogic.showLogic = true;
|
|
239
|
-
} else {
|
|
240
|
-
childLogic.showLogic = false;
|
|
241
|
-
this.clearAnswersRecursively(childLogic);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
clearAnswersRecursively(logic: any) {
|
|
250
|
-
if (!logic || !logic.rows) return;
|
|
251
|
-
|
|
252
|
-
logic.rows.forEach((row: any) => {
|
|
253
|
-
row.grid.forEach((item: any) => {
|
|
254
|
-
const element = item.element;
|
|
255
|
-
|
|
256
|
-
if (item.entityType === 'QUESTION' && element) {
|
|
257
|
-
// Clear answer if present
|
|
258
|
-
if ('answer' in element) {
|
|
259
|
-
element.answer = '';
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// Recursively clear childLogics if any
|
|
263
|
-
if (element.childLogics && element.childLogics.length > 0) {
|
|
264
|
-
element.childLogics.forEach((childLogic: any) => {
|
|
265
|
-
this.clearAnswersRecursively(childLogic);
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (item.entityType === 'SUBFORM' && element && element.rows) {
|
|
271
|
-
// SUBFORM contains its own rows structure like a form
|
|
272
|
-
this.clearAnswersRecursively({ rows: element.rows });
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
evaluateCondition(answer: any, condition: string, inputValue: any): boolean {
|
|
279
|
-
const inputValues = Array.isArray(inputValue)
|
|
280
|
-
? inputValue.map((val) => val.toString())
|
|
281
|
-
: [inputValue.toString()];
|
|
282
|
-
|
|
283
|
-
switch (condition) {
|
|
284
|
-
case '!=':
|
|
285
|
-
return !inputValues.includes(answer);
|
|
286
|
-
case '=':
|
|
287
|
-
return inputValues.includes(answer);
|
|
288
|
-
case 'IN':
|
|
289
|
-
return inputValues.includes(answer);
|
|
290
|
-
case 'NOT IN':
|
|
291
|
-
return !inputValues.includes(answer);
|
|
292
|
-
default:
|
|
293
|
-
return false;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
evaluateMultipleCondition(
|
|
298
|
-
answers: any[],
|
|
299
|
-
condition: string,
|
|
300
|
-
inputValue: any
|
|
301
|
-
): boolean {
|
|
302
|
-
const inputValues = Array.isArray(inputValue)
|
|
303
|
-
? inputValue.map((val) => val.toString())
|
|
304
|
-
: [inputValue.toString()];
|
|
305
|
-
|
|
306
|
-
switch (condition) {
|
|
307
|
-
case '!=':
|
|
308
|
-
return answers.every((answer) => !inputValues.includes(answer));
|
|
309
|
-
case '=':
|
|
310
|
-
return answers.some((answer) => inputValues.includes(answer));
|
|
311
|
-
case 'IN':
|
|
312
|
-
return answers.some((answer) => inputValues.includes(answer));
|
|
313
|
-
case 'NOT IN':
|
|
314
|
-
return answers.every((answer) => !inputValues.includes(answer));
|
|
315
|
-
default:
|
|
316
|
-
return false;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
fetchDataFromLookup() {
|
|
321
|
-
this.formService.fetchDataFromLookup(this.lookupTable).subscribe(
|
|
322
|
-
(response) => {
|
|
323
|
-
this.customOptions = response.result.values.map(
|
|
324
|
-
(item: { value: string; label: string }) => ({
|
|
325
|
-
value: item.value,
|
|
326
|
-
label: item.label,
|
|
327
|
-
})
|
|
328
|
-
);
|
|
329
|
-
if (this.question.answer) {
|
|
330
|
-
this.initializeCustomOption();
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
(error) => {
|
|
334
|
-
console.error('HTTP Error:', error);
|
|
335
|
-
}
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
fetchDataFromDatabase() {
|
|
340
|
-
const transformedDatabase = this.transformDatabaseObject(this.database);
|
|
341
|
-
this.formService.fetchDataFromDatabase(transformedDatabase).subscribe(
|
|
342
|
-
(response) => {
|
|
343
|
-
if (response.success) {
|
|
344
|
-
this.customOptions = response.result?.content?.map(
|
|
345
|
-
(item: { value: string; label: string }) => ({
|
|
346
|
-
value: item.value,
|
|
347
|
-
label: item.label,
|
|
348
|
-
})
|
|
349
|
-
);
|
|
350
|
-
if (this.question.answer) {
|
|
351
|
-
this.initializeCustomOption();
|
|
352
|
-
}
|
|
353
|
-
} else {
|
|
354
|
-
console.error('Error fetching data from database:', response.message);
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
(error) => {
|
|
358
|
-
console.error('HTTP Error:', error);
|
|
359
|
-
}
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
transformDatabaseObject(database: any) {
|
|
364
|
-
return {
|
|
365
|
-
tableName: database.tableName,
|
|
366
|
-
valueField: database.valueField,
|
|
367
|
-
labelField: database.labelField,
|
|
368
|
-
labelPattern: database?.labelPattern,
|
|
369
|
-
criteria: database.criteria.map((criteria: any) => ({
|
|
370
|
-
field: criteria?.field,
|
|
371
|
-
valueSource: criteria?.valueSource,
|
|
372
|
-
condition: criteria?.condition,
|
|
373
|
-
value: criteria?.inputValue,
|
|
374
|
-
logicalOperator: criteria?.logicalOperator,
|
|
375
|
-
})),
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
fetchDataFromAPI() {
|
|
380
|
-
const allowedChars = ['.', ',', '-', '_', '(', ')', ''];
|
|
381
|
-
const apiConfig = this.api;
|
|
382
|
-
this.formService.fetchDataFromExternalAPI(apiConfig).subscribe(
|
|
383
|
-
(response) => {
|
|
384
|
-
let data;
|
|
385
|
-
if (apiConfig.pathToValue) {
|
|
386
|
-
data = this.extractDataByPath(response, apiConfig.pathToValue);
|
|
387
|
-
} else {
|
|
388
|
-
data = response;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
this.customOptions = data.map((item: any) => {
|
|
392
|
-
if (
|
|
393
|
-
apiConfig.labelPattern &&
|
|
394
|
-
Array.isArray(apiConfig.labelPattern) &&
|
|
395
|
-
apiConfig.labelPattern.length > 0
|
|
396
|
-
) {
|
|
397
|
-
let label = '';
|
|
398
|
-
apiConfig.labelPattern.forEach((pattern: string) => {
|
|
399
|
-
pattern = pattern.trim();
|
|
400
|
-
if (allowedChars.includes(pattern)) {
|
|
401
|
-
label += pattern;
|
|
402
|
-
} else {
|
|
403
|
-
if (item[pattern] !== undefined && item[pattern] !== null) {
|
|
404
|
-
label += item[pattern] + ' ';
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
return {
|
|
409
|
-
value: item[apiConfig.valueField.trim()],
|
|
410
|
-
label: label,
|
|
411
|
-
};
|
|
412
|
-
} else {
|
|
413
|
-
return {
|
|
414
|
-
value: item[apiConfig.valueField.trim()],
|
|
415
|
-
label: item[apiConfig.labelField.trim()],
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
if (this.question.answer) {
|
|
420
|
-
this.initializeCustomOption();
|
|
421
|
-
}
|
|
422
|
-
},
|
|
423
|
-
(error) => {
|
|
424
|
-
console.error('HTTP Error:', error);
|
|
425
|
-
}
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
extractDataByPath(data: any, path: string) {
|
|
430
|
-
return path.split('.').reduce((acc, part) => acc && acc[part], data);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
isMinimumSelectionValid() {
|
|
434
|
-
this.validationFailed = false;
|
|
435
|
-
|
|
436
|
-
if (this.selectedOptions.length == 0 && this.required) {
|
|
437
|
-
this.validationService.clearInvalid(this.buildElementId());
|
|
438
|
-
this.validationFailed = true;
|
|
439
|
-
this.validationMessage = 'This is a required question';
|
|
440
|
-
this.question.validationMessage = 'This is a required question';
|
|
441
|
-
this.question.validation = false;
|
|
442
|
-
} else if (this.minimumSelection !== undefined) {
|
|
443
|
-
if (this.selectionType == 'SINGLE') {
|
|
444
|
-
this.validationService.clearInvalid(this.buildElementId());
|
|
445
|
-
if (
|
|
446
|
-
this.selectedOptions.length < this.minimumSelection &&
|
|
447
|
-
this.required
|
|
448
|
-
) {
|
|
449
|
-
this.validationFailed = true;
|
|
450
|
-
this.validationMessage = `Minimum ${this.minimumSelection} selection(s) required.`;
|
|
451
|
-
this.question.validationMessage = `Minimum ${this.minimumSelection} selection(s) required.`;
|
|
452
|
-
this.question.validation = false;
|
|
453
|
-
} else {
|
|
454
|
-
this.validationService.clearInvalid(this.buildElementId());
|
|
455
|
-
this.question.validation = true;
|
|
456
|
-
}
|
|
457
|
-
} else {
|
|
458
|
-
if (this.selectedOptions.length < this.minimumSelection) {
|
|
459
|
-
this.validationService.clearInvalid(this.buildElementId());
|
|
460
|
-
this.validationFailed = true;
|
|
461
|
-
this.validationMessage = `Minimum ${this.minimumSelection} selection(s) required.`;
|
|
462
|
-
this.question.validationMessage = `Minimum ${this.minimumSelection} selection(s) required.`;
|
|
463
|
-
this.question.validation = false;
|
|
464
|
-
} else {
|
|
465
|
-
this.validationService.clearInvalid(this.buildElementId());
|
|
466
|
-
this.question.validation = true;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
} else {
|
|
470
|
-
this.validationService.clearInvalid(this.buildElementId());
|
|
471
|
-
this.question.validation = true;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
getOptions() {
|
|
476
|
-
if (this.optionType === 'OPTION') {
|
|
477
|
-
return this.customOptions;
|
|
478
|
-
} else if (this.optionType === 'LOOKUP') {
|
|
479
|
-
return Object.values(this.lookupTable);
|
|
480
|
-
} else if (this.optionType === 'API') {
|
|
481
|
-
return this.apiOptions.map((option) => option.valueField);
|
|
482
|
-
} else {
|
|
483
|
-
return [];
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
isOptionDisabled(option: any): boolean {
|
|
488
|
-
return (
|
|
489
|
-
this.maximumSelection !== undefined &&
|
|
490
|
-
this.selectedOptions.length >= this.maximumSelection &&
|
|
491
|
-
!this.selectedOptions.includes(option)
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
handleValidation(
|
|
496
|
-
isValid: boolean,
|
|
497
|
-
message: string = 'This field is required'
|
|
498
|
-
) {
|
|
499
|
-
if (isValid) {
|
|
500
|
-
this.validationService.clearInvalid(this.buildElementId());
|
|
501
|
-
} else {
|
|
502
|
-
// this.validationService.setInvalid(this.question.id, message);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
private buildElementId(): string {
|
|
507
|
-
return this.inLine || this.inCard
|
|
508
|
-
? `${this.submissionIndex}-${this.question.id}`
|
|
509
|
-
: `${this.question.id}`;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
get isInvalid(): boolean {
|
|
513
|
-
return !!this.validationService.getErrorMessage(this.buildElementId());
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
get errorMessage(): string | null {
|
|
517
|
-
return this.validationService.getErrorMessage(this.buildElementId());
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
ngAfterViewInit() {
|
|
521
|
-
if (this.inLine || this.inCard) {
|
|
522
|
-
this.elementId = `question-${this.submissionIndex}-${this.question.id}`;
|
|
523
|
-
} else {
|
|
524
|
-
this.elementId = `question-${this.question.id}`;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
this.tracker.registerElement(this.elementId);
|
|
528
|
-
setTimeout(() => {
|
|
529
|
-
this.whenClauseService.markLoadCompleted();
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
ngOnDestroy() {
|
|
534
|
-
if (this.elementId) {
|
|
535
|
-
this.tracker.unregisterElement(this.elementId);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<div
|
|
2
|
-
[ngClass]="{ 'mb-4': !inLine }"
|
|
3
|
-
class="px-3"
|
|
4
|
-
[id]="(inLine || inCard) ? 'question-' + submissionIndex + '-' + question.id : 'question-' + question.id"
|
|
5
|
-
[attr.name]="question.testElementName"
|
|
6
|
-
>
|
|
7
|
-
<div class="input-wrapper mb-2" *ngIf="!inLine">
|
|
8
|
-
<div *ngIf="question.questionNumber" [innerHTML]="question.questionNumber"></div>
|
|
9
|
-
<span *ngIf="question.questionNumber" class="space"></span>
|
|
10
|
-
<label>{{ question.question }}</label
|
|
11
|
-
>
|
|
12
|
-
<span class="text-danger" *ngIf="question?.required">*</span>
|
|
13
|
-
<div
|
|
14
|
-
class="svg-wrapper mb-2 hintIcon"
|
|
15
|
-
[attr.data-title]="hint"
|
|
16
|
-
*ngIf="hint"
|
|
17
|
-
>
|
|
18
|
-
<svg
|
|
19
|
-
class="hintSvg"
|
|
20
|
-
viewBox="0 0 30 30"
|
|
21
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
-
>
|
|
23
|
-
<path
|
|
24
|
-
fill-rule="evenodd"
|
|
25
|
-
clip-rule="evenodd"
|
|
26
|
-
d="M15 26.25V26.25C8.78625 26.25 3.75 21.2138 3.75 15V15C3.75 8.78625 8.78625 3.75 15 3.75V3.75C21.2138 3.75 26.25 8.78625 26.25 15V15C26.25 21.2138 21.2138 26.25 15 26.25Z"
|
|
27
|
-
stroke="#323232"
|
|
28
|
-
stroke-width="1.5"
|
|
29
|
-
stroke-linecap="round"
|
|
30
|
-
stroke-linejoin="round"
|
|
31
|
-
/>
|
|
32
|
-
<path
|
|
33
|
-
d="M15 16.5623V16.2498C15 15.2285 15.6312 14.6748 16.2637 14.2498C16.8812 13.8335 17.5 13.291 17.5 12.291C17.5 10.9098 16.3813 9.79102 15 9.79102C13.6187 9.79102 12.5 10.9098 12.5 12.291"
|
|
34
|
-
stroke="#323232"
|
|
35
|
-
stroke-width="1.5"
|
|
36
|
-
stroke-linecap="round"
|
|
37
|
-
stroke-linejoin="round"
|
|
38
|
-
/>
|
|
39
|
-
<path
|
|
40
|
-
d="M14.9988 20C14.8263 20 14.6863 20.14 14.6875 20.3125C14.6875 20.485 14.8275 20.625 15 20.625C15.1725 20.625 15.3125 20.485 15.3125 20.3125C15.3125 20.14 15.1725 20 14.9988 20"
|
|
41
|
-
stroke="#323232"
|
|
42
|
-
stroke-width="1.5"
|
|
43
|
-
stroke-linecap="round"
|
|
44
|
-
stroke-linejoin="round"
|
|
45
|
-
/>
|
|
46
|
-
</svg>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div class="currency-input inside">
|
|
51
|
-
<span *ngIf="symbolPosition === 'Before the value'" class="currency-symbol left">
|
|
52
|
-
{{ currencySymbol }}
|
|
53
|
-
</span>
|
|
54
|
-
|
|
55
|
-
<input
|
|
56
|
-
type="text"
|
|
57
|
-
class="form-control mb-2 height"
|
|
58
|
-
[placeholder]="placeholder"
|
|
59
|
-
[class.hide-spin-buttons]="true"
|
|
60
|
-
(blur)="validateNumber()"
|
|
61
|
-
[(ngModel)]="enteredAmount"
|
|
62
|
-
[class.invalid]="validationFailed"
|
|
63
|
-
[class.invalid-question]="isInvalid && (!inLine || !enteredAmount)"
|
|
64
|
-
(input)="validateInput($event)"
|
|
65
|
-
[attr.min]="min"
|
|
66
|
-
[attr.max]="max"
|
|
67
|
-
(wheel)="preventNumberScroll($event)"
|
|
68
|
-
[disabled]="disableEdit"
|
|
69
|
-
/>
|
|
70
|
-
|
|
71
|
-
<span *ngIf="symbolPosition === 'After the value'" class="currency-symbol right">
|
|
72
|
-
{{ currencySymbol }}
|
|
73
|
-
</span>
|
|
74
|
-
|
|
75
|
-
</div>
|
|
76
|
-
<div *ngIf="showAmountInWords && amountInWordsText" class="amount-in-words">
|
|
77
|
-
{{ amountInWordsText }}
|
|
78
|
-
</div>
|
|
79
|
-
<div *ngIf="isInvalid && (!inLine || !enteredAmount)" class="error-message">
|
|
80
|
-
{{ errorMessage }}
|
|
81
|
-
</div>
|
|
82
|
-
<div *ngIf="validationFailed && !isInvalid" class="text-danger error-message">
|
|
83
|
-
{{ validationMessage }}
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
@import '../../styles/shared-style.scss';
|
|
2
|
-
|
|
3
|
-
.hide-spin-buttons::-webkit-outer-spin-button,
|
|
4
|
-
.hide-spin-buttons::-webkit-inner-spin-button {
|
|
5
|
-
-webkit-appearance: none;
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.invalid-question {
|
|
11
|
-
border: 2px solid #f44336; /* Material red */
|
|
12
|
-
border-radius: 4px;
|
|
13
|
-
padding: 8px;
|
|
14
|
-
margin-bottom: 4px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.currency-input.inside {
|
|
18
|
-
position: relative;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.currency-input.inside input {
|
|
22
|
-
padding-left: 0.75rem; /* fallback */
|
|
23
|
-
padding-right: 0.75rem; /* fallback */
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.currency-input.inside .currency-symbol {
|
|
27
|
-
position: absolute;
|
|
28
|
-
top: 50%;
|
|
29
|
-
transform: translateY(-50%);
|
|
30
|
-
color: #444;
|
|
31
|
-
font-weight: bold;
|
|
32
|
-
pointer-events: none;
|
|
33
|
-
white-space: nowrap; /* prevent wrapping for AED, USD, etc. */
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.currency-input.inside .currency-symbol.left{
|
|
37
|
-
left: 1%;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* Add padding depending on symbol position */
|
|
41
|
-
.currency-input.inside .currency-symbol.left + input {
|
|
42
|
-
padding-left: calc(1ch * 6); /* 4 character widths (enough for AED + space) */
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.currency-input.inside input + .currency-symbol.right {
|
|
46
|
-
right: 10px;
|
|
47
|
-
padding-right: calc(1ch * 4);
|
|
48
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { CurrencyFieldsComponent } from './currency-fields.component';
|
|
4
|
-
|
|
5
|
-
describe('CurrencyFieldsComponent', () => {
|
|
6
|
-
let component: CurrencyFieldsComponent;
|
|
7
|
-
let fixture: ComponentFixture<CurrencyFieldsComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [CurrencyFieldsComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(CurrencyFieldsComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|