optimized-react-component-library-xyz123 0.1.102 → 0.1.104

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.
Files changed (220) hide show
  1. package/dist/NewHelpMethodsStandard/ApplicationContentSlice/applicationContentSlice.d.ts +87 -0
  2. package/dist/NewHelpMethodsStandard/ApplicationContentSlice/applicationContentSlice.js +75 -0
  3. package/dist/NewHelpMethodsStandard/CookieHandler/cookieHandler.d.ts +12 -0
  4. package/dist/NewHelpMethodsStandard/CookieHandler/cookieHandler.js +42 -0
  5. package/dist/NewHelpMethodsStandard/CreateApiDataObject/CreateApiDataObject.d.ts +3 -0
  6. package/dist/NewHelpMethodsStandard/CreateApiDataObject/CreateApiDataObject.js +44 -0
  7. package/dist/NewHelpMethodsStandard/CreateApiDataObject/CreateApiDataObject.types.d.ts +8 -0
  8. package/dist/NewHelpMethodsStandard/CreateApiDataObject/CreateApiDataObject.types.js +1 -0
  9. package/dist/NewHelpMethodsStandard/CreateApiDataObject/index.d.ts +2 -0
  10. package/dist/NewHelpMethodsStandard/CreateApiDataObject/index.js +1 -0
  11. package/dist/NewHelpMethodsStandard/DoCategoriesAndQuestionsVisible/DoCategoriesAndQuestionsVisible.d.ts +3 -0
  12. package/dist/NewHelpMethodsStandard/DoCategoriesAndQuestionsVisible/DoCategoriesAndQuestionsVisible.js +11 -0
  13. package/dist/NewHelpMethodsStandard/DoCategoriesAndQuestionsVisible/index.d.ts +1 -0
  14. package/dist/NewHelpMethodsStandard/DoCategoriesAndQuestionsVisible/index.js +1 -0
  15. package/dist/NewHelpMethodsStandard/FocusElement/focusElement.d.ts +7 -0
  16. package/dist/NewHelpMethodsStandard/FocusElement/focusElement.js +16 -0
  17. package/dist/NewHelpMethodsStandard/GetIdsGroupCheckValidationTypes/getIdsGroupCheckValidationTypes.d.ts +5 -0
  18. package/dist/NewHelpMethodsStandard/GetIdsGroupCheckValidationTypes/getIdsGroupCheckValidationTypes.js +14 -0
  19. package/dist/NewHelpMethodsStandard/GroupQuestionByStepPreviewPage/GroupQuestionByStepPreviewPage.d.ts +3 -0
  20. package/dist/NewHelpMethodsStandard/GroupQuestionByStepPreviewPage/GroupQuestionByStepPreviewPage.js +12 -0
  21. package/dist/NewHelpMethodsStandard/GroupQuestionByStepPreviewPage/index.d.ts +1 -0
  22. package/dist/NewHelpMethodsStandard/GroupQuestionByStepPreviewPage/index.js +1 -0
  23. package/dist/NewHelpMethodsStandard/GroupQuestionsByStepCategoryGroup/GroupQuestionsByStepCategoryGroup.d.ts +3 -0
  24. package/dist/NewHelpMethodsStandard/GroupQuestionsByStepCategoryGroup/GroupQuestionsByStepCategoryGroup.js +61 -0
  25. package/dist/NewHelpMethodsStandard/GroupQuestionsByStepCategoryGroup/index.d.ts +1 -0
  26. package/dist/NewHelpMethodsStandard/GroupQuestionsByStepCategoryGroup/index.js +1 -0
  27. package/dist/NewHelpMethodsStandard/InputElements.types.d.ts +51 -0
  28. package/dist/NewHelpMethodsStandard/InputElements.types.js +12 -0
  29. package/dist/NewHelpMethodsStandard/IsDependsOnOtherQuestionTrue/IsDependsOnOtherQuestionTrue.d.ts +2 -0
  30. package/dist/NewHelpMethodsStandard/IsDependsOnOtherQuestionTrue/IsDependsOnOtherQuestionTrue.js +13 -0
  31. package/dist/NewHelpMethodsStandard/IsDependsOnOtherQuestionTrue/index.d.ts +1 -0
  32. package/dist/NewHelpMethodsStandard/IsDependsOnOtherQuestionTrue/index.js +1 -0
  33. package/dist/NewHelpMethodsStandard/QuestionHasValidationError/QuestionHasValidationError.d.ts +2 -0
  34. package/dist/NewHelpMethodsStandard/QuestionHasValidationError/QuestionHasValidationError.js +58 -0
  35. package/dist/NewHelpMethodsStandard/QuestionHasValidationError/QuestionHasValidationError.types.d.ts +5 -0
  36. package/dist/NewHelpMethodsStandard/QuestionHasValidationError/QuestionHasValidationError.types.js +1 -0
  37. package/dist/NewHelpMethodsStandard/QuestionHasValidationError/index.d.ts +1 -0
  38. package/dist/NewHelpMethodsStandard/QuestionHasValidationError/index.js +1 -0
  39. package/dist/NewHelpMethodsStandard/QuestionSlice/questionSlice.d.ts +138 -0
  40. package/dist/NewHelpMethodsStandard/QuestionSlice/questionSlice.js +166 -0
  41. package/dist/NewHelpMethodsStandard/ScriptHandler/scriptHandler.d.ts +7 -0
  42. package/dist/NewHelpMethodsStandard/ScriptHandler/scriptHandler.js +34 -0
  43. package/dist/NewHelpMethodsStandard/ValidationCheckAllVisibleQuestion/ValidationCheckAllVisibleQuestion.d.ts +2 -0
  44. package/dist/NewHelpMethodsStandard/ValidationCheckAllVisibleQuestion/ValidationCheckAllVisibleQuestion.js +17 -0
  45. package/dist/NewHelpMethodsStandard/ValidationCheckAllVisibleQuestion/index.d.ts +1 -0
  46. package/dist/NewHelpMethodsStandard/ValidationCheckAllVisibleQuestion/index.js +1 -0
  47. package/dist/NewHelpMethodsStandard/index.d.ts +15 -0
  48. package/dist/NewHelpMethodsStandard/index.js +15 -0
  49. package/dist/NewHelpMethodsStandard/useFormStatusModal/useFormStatusModal.d.ts +8 -0
  50. package/dist/NewHelpMethodsStandard/useFormStatusModal/useFormStatusModal.js +23 -0
  51. package/dist/NewHelpMethodsStandard/usePTSPageTitle/usePTSPageTitle.d.ts +1 -0
  52. package/dist/NewHelpMethodsStandard/usePTSPageTitle/usePTSPageTitle.js +19 -0
  53. package/dist/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.d.ts +5 -0
  54. package/dist/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.js +170 -0
  55. package/dist/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.types.d.ts +11 -0
  56. package/dist/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.types.js +1 -0
  57. package/dist/NewInputComponentStandard/AddFilesStandard/ClipboardFilesStandard.d.ts +2 -0
  58. package/dist/NewInputComponentStandard/AddFilesStandard/ClipboardFilesStandard.js +48 -0
  59. package/dist/NewInputComponentStandard/AddFilesStandard/DropFilesStandard.d.ts +3 -0
  60. package/dist/NewInputComponentStandard/AddFilesStandard/DropFilesStandard.js +16 -0
  61. package/dist/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.d.ts +3 -0
  62. package/dist/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.js +28 -0
  63. package/dist/NewInputComponentStandard/AddFilesStandard/IndicatorStandard.d.ts +3 -0
  64. package/dist/NewInputComponentStandard/AddFilesStandard/IndicatorStandard.js +15 -0
  65. package/dist/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.d.ts +7 -0
  66. package/dist/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.js +25 -0
  67. package/dist/NewInputComponentStandard/AddFilesStandard/SelectedFilesStandard.d.ts +3 -0
  68. package/dist/NewInputComponentStandard/AddFilesStandard/SelectedFilesStandard.js +71 -0
  69. package/dist/NewInputComponentStandard/AddFilesStandard/index.d.ts +1 -0
  70. package/dist/NewInputComponentStandard/AddFilesStandard/index.js +1 -0
  71. package/dist/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.d.ts +5 -0
  72. package/dist/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.js +243 -0
  73. package/dist/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.types.d.ts +21 -0
  74. package/dist/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.types.js +1 -0
  75. package/dist/NewInputComponentStandard/FilesUploadStandard/index.d.ts +1 -0
  76. package/dist/NewInputComponentStandard/FilesUploadStandard/index.js +1 -0
  77. package/dist/NewInputComponentStandard/InputElements.types.d.ts +50 -0
  78. package/dist/NewInputComponentStandard/InputElements.types.js +12 -0
  79. package/dist/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.d.ts +5 -0
  80. package/dist/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.js +35 -0
  81. package/dist/NewInputComponentStandard/MultipleCheckboxesStandard/MultiplesCheckboxesStandard.types.d.ts +7 -0
  82. package/dist/NewInputComponentStandard/MultipleCheckboxesStandard/MultiplesCheckboxesStandard.types.js +1 -0
  83. package/dist/NewInputComponentStandard/MultipleCheckboxesStandard/index.d.ts +1 -0
  84. package/dist/NewInputComponentStandard/MultipleCheckboxesStandard/index.js +1 -0
  85. package/dist/NewInputComponentStandard/RadioMultipleStandard/RadioMultipleStandard.d.ts +5 -0
  86. package/dist/NewInputComponentStandard/RadioMultipleStandard/RadioMultipleStandard.js +19 -0
  87. package/dist/NewInputComponentStandard/RadioMultipleStandard/RadioMultipleStandard.types.d.ts +6 -0
  88. package/dist/NewInputComponentStandard/RadioMultipleStandard/RadioMultipleStandard.types.js +1 -0
  89. package/dist/NewInputComponentStandard/RadioMultipleStandard/index.d.ts +1 -0
  90. package/dist/NewInputComponentStandard/RadioMultipleStandard/index.js +1 -0
  91. package/dist/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.d.ts +5 -0
  92. package/dist/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.js +27 -0
  93. package/dist/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.types.d.ts +7 -0
  94. package/dist/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.types.js +1 -0
  95. package/dist/NewInputComponentStandard/TextAreaStandard/index.d.ts +1 -0
  96. package/dist/NewInputComponentStandard/TextAreaStandard/index.js +1 -0
  97. package/dist/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.d.ts +4 -0
  98. package/dist/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.js +19 -0
  99. package/dist/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.types.d.ts +7 -0
  100. package/dist/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.types.js +1 -0
  101. package/dist/NewInputComponentStandard/TextFieldStandard/index.d.ts +1 -0
  102. package/dist/NewInputComponentStandard/TextFieldStandard/index.js +1 -0
  103. package/dist/NewInputComponentStandard/index.d.ts +6 -0
  104. package/dist/NewInputComponentStandard/index.js +6 -0
  105. package/dist/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.d.ts +2 -0
  106. package/dist/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.js +7 -0
  107. package/dist/NewRenderFormComponentStandard/RenderQuestion/index.d.ts +1 -0
  108. package/dist/NewRenderFormComponentStandard/RenderQuestion/index.js +1 -0
  109. package/dist/NewRenderFormComponentStandard/RenderQuestionGroup/RenderQuestionGroup.d.ts +2 -0
  110. package/dist/NewRenderFormComponentStandard/RenderQuestionGroup/RenderQuestionGroup.js +27 -0
  111. package/dist/NewRenderFormComponentStandard/RenderQuestionGroup/index.d.ts +1 -0
  112. package/dist/NewRenderFormComponentStandard/RenderQuestionGroup/index.js +1 -0
  113. package/dist/NewRenderFormComponentStandard/index.d.ts +2 -0
  114. package/dist/NewRenderFormComponentStandard/index.js +2 -0
  115. package/dist/NewTextComponentStandard/CookieBanner/CookieBanner.d.ts +4 -0
  116. package/dist/NewTextComponentStandard/CookieBanner/CookieBanner.js +21 -0
  117. package/dist/NewTextComponentStandard/CookieBanner/CookieBanner.types.d.ts +8 -0
  118. package/dist/NewTextComponentStandard/CookieBanner/CookieBanner.types.js +1 -0
  119. package/dist/NewTextComponentStandard/EditPreviewLinkStandard/EditPreviewLinkStandard.d.ts +5 -0
  120. package/dist/NewTextComponentStandard/EditPreviewLinkStandard/EditPreviewLinkStandard.js +9 -0
  121. package/dist/NewTextComponentStandard/EditPreviewLinkStandard/EditPreviewLinkStandard.types.d.ts +6 -0
  122. package/dist/NewTextComponentStandard/EditPreviewLinkStandard/EditPreviewLinkStandard.types.js +1 -0
  123. package/dist/NewTextComponentStandard/EditPreviewLinkStandard/index.d.ts +1 -0
  124. package/dist/NewTextComponentStandard/EditPreviewLinkStandard/index.js +1 -0
  125. package/dist/NewTextComponentStandard/FooterStandard/FooterStandard.d.ts +5 -0
  126. package/dist/NewTextComponentStandard/FooterStandard/FooterStandard.js +22 -0
  127. package/dist/NewTextComponentStandard/FooterStandard/FooterStandard.types.d.ts +3 -0
  128. package/dist/NewTextComponentStandard/FooterStandard/FooterStandard.types.js +1 -0
  129. package/dist/NewTextComponentStandard/FooterStandard/index.d.ts +1 -0
  130. package/dist/NewTextComponentStandard/FooterStandard/index.js +1 -0
  131. package/dist/NewTextComponentStandard/FooterStandard/logoWhiteSvg.d.ts +4 -0
  132. package/dist/NewTextComponentStandard/FooterStandard/logoWhiteSvg.js +5 -0
  133. package/dist/NewTextComponentStandard/HeaderStandard/HeaderStandard.d.ts +5 -0
  134. package/dist/NewTextComponentStandard/HeaderStandard/HeaderStandard.js +24 -0
  135. package/dist/NewTextComponentStandard/HeaderStandard/HeaderStandard.types.d.ts +5 -0
  136. package/dist/NewTextComponentStandard/HeaderStandard/HeaderStandard.types.js +1 -0
  137. package/dist/NewTextComponentStandard/HeaderStandard/Icons.d.ts +14 -0
  138. package/dist/NewTextComponentStandard/HeaderStandard/Icons.js +8 -0
  139. package/dist/NewTextComponentStandard/HeaderStandard/index.d.ts +1 -0
  140. package/dist/NewTextComponentStandard/HeaderStandard/index.js +1 -0
  141. package/dist/NewTextComponentStandard/InfoOnlyStandard/InfoOnlyStandard.d.ts +5 -0
  142. package/dist/NewTextComponentStandard/InfoOnlyStandard/InfoOnlyStandard.js +24 -0
  143. package/dist/NewTextComponentStandard/InfoOnlyStandard/InfoOnlyStandard.types.d.ts +11 -0
  144. package/dist/NewTextComponentStandard/InfoOnlyStandard/InfoOnlyStandard.types.js +1 -0
  145. package/dist/NewTextComponentStandard/InfoOnlyStandard/index.d.ts +1 -0
  146. package/dist/NewTextComponentStandard/InfoOnlyStandard/index.js +1 -0
  147. package/dist/NewTextComponentStandard/InputElements.types.d.ts +60 -0
  148. package/dist/NewTextComponentStandard/InputElements.types.js +22 -0
  149. package/dist/NewTextComponentStandard/ModalStandard/ModalStandard.d.ts +5 -0
  150. package/dist/NewTextComponentStandard/ModalStandard/ModalStandard.js +19 -0
  151. package/dist/NewTextComponentStandard/ModalStandard/ModalStandard.types.d.ts +4 -0
  152. package/dist/NewTextComponentStandard/ModalStandard/ModalStandard.types.js +1 -0
  153. package/dist/NewTextComponentStandard/ModalStandard/index.d.ts +1 -0
  154. package/dist/NewTextComponentStandard/ModalStandard/index.js +1 -0
  155. package/dist/NewTextComponentStandard/PrincipleOfPublicityStandard/PrincipleOfPublicityStandard.d.ts +4 -0
  156. package/dist/NewTextComponentStandard/PrincipleOfPublicityStandard/PrincipleOfPublicityStandard.js +47 -0
  157. package/dist/NewTextComponentStandard/PrincipleOfPublicityStandard/PrincipleOfPublicityStandard.types.d.ts +3 -0
  158. package/dist/NewTextComponentStandard/PrincipleOfPublicityStandard/PrincipleOfPublicityStandard.types.js +1 -0
  159. package/dist/NewTextComponentStandard/PrincipleOfPublicityStandard/index.d.ts +1 -0
  160. package/dist/NewTextComponentStandard/PrincipleOfPublicityStandard/index.js +1 -0
  161. package/dist/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/ServiceHeadlineAndBodyStandard.d.ts +5 -0
  162. package/dist/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/ServiceHeadlineAndBodyStandard.js +7 -0
  163. package/dist/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/ServiceHeadlineAndBodyStandard.types.d.ts +5 -0
  164. package/dist/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/ServiceHeadlineAndBodyStandard.types.js +1 -0
  165. package/dist/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/index.d.ts +1 -0
  166. package/dist/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/index.js +1 -0
  167. package/dist/NewTextComponentStandard/SkipLinkStandard/SkipLinkStandard.d.ts +4 -0
  168. package/dist/NewTextComponentStandard/SkipLinkStandard/SkipLinkStandard.js +16 -0
  169. package/dist/NewTextComponentStandard/SkipLinkStandard/index.d.ts +1 -0
  170. package/dist/NewTextComponentStandard/SkipLinkStandard/index.js +1 -0
  171. package/dist/NewTextComponentStandard/StepperButtonsStandard/StepperButtonsStandard.d.ts +5 -0
  172. package/dist/NewTextComponentStandard/StepperButtonsStandard/StepperButtonsStandard.js +7 -0
  173. package/dist/NewTextComponentStandard/StepperButtonsStandard/StepperButtonsStandard.types.d.ts +8 -0
  174. package/dist/NewTextComponentStandard/StepperButtonsStandard/StepperButtonsStandard.types.js +1 -0
  175. package/dist/NewTextComponentStandard/StepperButtonsStandard/index.d.ts +1 -0
  176. package/dist/NewTextComponentStandard/StepperButtonsStandard/index.js +1 -0
  177. package/dist/NewTextComponentStandard/StepperStandard/StepperStandard.d.ts +5 -0
  178. package/dist/NewTextComponentStandard/StepperStandard/StepperStandard.js +14 -0
  179. package/dist/NewTextComponentStandard/StepperStandard/StepperStandard.types.d.ts +5 -0
  180. package/dist/NewTextComponentStandard/StepperStandard/StepperStandard.types.js +1 -0
  181. package/dist/NewTextComponentStandard/StepperStandard/index.d.ts +1 -0
  182. package/dist/NewTextComponentStandard/StepperStandard/index.js +1 -0
  183. package/dist/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.d.ts +5 -0
  184. package/dist/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.js +9 -0
  185. package/dist/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.types.d.ts +5 -0
  186. package/dist/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.types.js +1 -0
  187. package/dist/NewTextComponentStandard/TextHeadlineAndBodyStandard/index.d.ts +1 -0
  188. package/dist/NewTextComponentStandard/TextHeadlineAndBodyStandard/index.js +1 -0
  189. package/dist/NewTextComponentStandard/ValidationErrorSummaryList/ValidationErrorSummaryList.d.ts +4 -0
  190. package/dist/NewTextComponentStandard/ValidationErrorSummaryList/ValidationErrorSummaryList.js +61 -0
  191. package/dist/NewTextComponentStandard/ValidationErrorSummaryList/ValidationErrorSummaryList.types.d.ts +10 -0
  192. package/dist/NewTextComponentStandard/ValidationErrorSummaryList/ValidationErrorSummaryList.types.js +1 -0
  193. package/dist/NewTextComponentStandard/ValidationErrorSummaryList/index.d.ts +1 -0
  194. package/dist/NewTextComponentStandard/ValidationErrorSummaryList/index.js +1 -0
  195. package/dist/NewTextComponentStandard/index.d.ts +13 -0
  196. package/dist/NewTextComponentStandard/index.js +13 -0
  197. package/dist/NewTypesStandard/InitialState/InitialState.d.ts +4 -0
  198. package/dist/NewTypesStandard/InitialState/InitialState.js +79 -0
  199. package/dist/NewTypesStandard/InitialState/InitialState.types.d.ts +14 -0
  200. package/dist/NewTypesStandard/InitialState/InitialState.types.js +1 -0
  201. package/dist/NewTypesStandard/InitialState/index.d.ts +2 -0
  202. package/dist/NewTypesStandard/InitialState/index.js +1 -0
  203. package/dist/NewTypesStandard/TypesStandard.types.d.ts +107 -0
  204. package/dist/NewTypesStandard/TypesStandard.types.js +1 -0
  205. package/dist/NewTypesStandard/index.d.ts +3 -0
  206. package/dist/NewTypesStandard/index.js +1 -0
  207. package/dist/index.d.ts +5 -330
  208. package/dist/index.js +6 -2837
  209. package/dist/tabortN/303/244rKlarFilesUpload/FilesUpload.d.ts +18 -0
  210. package/dist/tabortN/303/244rKlarFilesUpload/FilesUpload.js +133 -0
  211. package/dist/tabortN/303/244rKlarFilesUpload/FilesUpload.types.d.ts +11 -0
  212. package/dist/tabortN/303/244rKlarFilesUpload/FilesUpload.types.js +1 -0
  213. package/dist/tabortN/303/244rKlarFilesUpload/index.d.ts +2 -0
  214. package/dist/tabortN/303/244rKlarFilesUpload/index.js +2 -0
  215. package/package.json +75 -74
  216. package/src/css/darkMode.css +0 -49
  217. package/src/css/styles.css +419 -164
  218. package/dist/index.css +0 -15
  219. package/dist/index.d.mts +0 -330
  220. package/dist/index.mjs +0 -2771
@@ -0,0 +1,87 @@
1
+ import { PayloadAction } from '@reduxjs/toolkit';
2
+ /** ----- Typer ----- */
3
+ export interface LanguageEntry {
4
+ language: string;
5
+ backButton: string;
6
+ forwardButton: string;
7
+ sendButton: string;
8
+ }
9
+ export interface LanguageSupportConfig {
10
+ activatedLanguage: string;
11
+ languageSupport: LanguageEntry[];
12
+ }
13
+ export interface LanguageState {
14
+ activatedLanguage: string;
15
+ languageSupport: LanguageEntry[];
16
+ languageSupportLoaded: boolean;
17
+ backButton: string;
18
+ forwardButton: string;
19
+ sendButton: string;
20
+ }
21
+ /** ----- Helpers ----- */
22
+ export declare const pickLang: (cfg: LanguageSupportConfig, lang: string) => LanguageEntry;
23
+ /** ----- Slice-fabrik (ingen app-specifik state/RootState här) ----- */
24
+ export declare const createLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
25
+ name?: string;
26
+ }) => import("@reduxjs/toolkit").Slice<LanguageState, {
27
+ setActivatedLanguage: (state: import("immer").WritableDraft<LanguageState>, action: PayloadAction<string>) => void;
28
+ setLabelsFromLanguageEntry: (state: import("immer").WritableDraft<LanguageState>, action: PayloadAction<Pick<LanguageEntry, "backButton" | "forwardButton" | "sendButton">>) => void;
29
+ replaceLanguageSupport: (state: import("immer").WritableDraft<LanguageState>, action: PayloadAction<LanguageSupportConfig>) => void;
30
+ }, string, string, import("@reduxjs/toolkit").SliceSelectors<LanguageState>>;
31
+ /** ----- Selector-fabrik (helt generisk, ingen RootState) ----- */
32
+ export declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => LanguageState) => {
33
+ selectActivatedLanguage: (state: TState) => string;
34
+ selectLanguageSupportLoaded: (state: TState) => boolean;
35
+ selectLanguageSupport: (state: TState) => LanguageEntry[];
36
+ selectOverallContentState: (state: TState) => LanguageState;
37
+ selectOverallContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
38
+ activatedLanguage: string;
39
+ languageSupport: LanguageEntry[];
40
+ languageSupportLoaded: boolean;
41
+ backButton: string;
42
+ forwardButton: string;
43
+ sendButton: string;
44
+ }) & {
45
+ clearCache: () => void;
46
+ resultsCount: () => number;
47
+ resetResultsCount: () => void;
48
+ } & {
49
+ resultFunc: (resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
50
+ activatedLanguage: string;
51
+ languageSupport: LanguageEntry[];
52
+ languageSupportLoaded: boolean;
53
+ backButton: string;
54
+ forwardButton: string;
55
+ sendButton: string;
56
+ };
57
+ memoizedResultFunc: ((resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
58
+ activatedLanguage: string;
59
+ languageSupport: LanguageEntry[];
60
+ languageSupportLoaded: boolean;
61
+ backButton: string;
62
+ forwardButton: string;
63
+ sendButton: string;
64
+ }) & {
65
+ clearCache: () => void;
66
+ resultsCount: () => number;
67
+ resetResultsCount: () => void;
68
+ };
69
+ lastResult: () => {
70
+ activatedLanguage: string;
71
+ languageSupport: LanguageEntry[];
72
+ languageSupportLoaded: boolean;
73
+ backButton: string;
74
+ forwardButton: string;
75
+ sendButton: string;
76
+ };
77
+ dependencies: [(state: TState) => LanguageState, (_: TState, activatedLanguage: string) => string];
78
+ recomputations: () => number;
79
+ resetRecomputations: () => void;
80
+ dependencyRecomputations: () => number;
81
+ resetDependencyRecomputations: () => void;
82
+ } & {
83
+ memoize: typeof import("reselect").weakMapMemoize;
84
+ argsMemoize: typeof import("reselect").weakMapMemoize;
85
+ };
86
+ };
87
+ export type { PayloadAction } from '@reduxjs/toolkit';
@@ -0,0 +1,75 @@
1
+ // src/languageSlice.ts (i NPM-paketet)
2
+ import { createSlice, createSelector } from '@reduxjs/toolkit';
3
+ /** ----- Helpers ----- */
4
+ export const pickLang = (cfg, lang) => {
5
+ var _a;
6
+ return (_a = cfg.languageSupport.find((l) => l.language === lang)) !== null && _a !== void 0 ? _a : cfg.languageSupport[0];
7
+ };
8
+ /** ----- Slice-fabrik (ingen app-specifik state/RootState här) ----- */
9
+ export const createLanguageSlice = (initialConfig, options) => {
10
+ var _a;
11
+ const name = (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : 'applicationContent';
12
+ const initialLang = pickLang(initialConfig, initialConfig.activatedLanguage);
13
+ const initialState = {
14
+ activatedLanguage: initialConfig.activatedLanguage,
15
+ languageSupport: initialConfig.languageSupport,
16
+ languageSupportLoaded: true,
17
+ backButton: initialLang.backButton,
18
+ forwardButton: initialLang.forwardButton,
19
+ sendButton: initialLang.sendButton,
20
+ };
21
+ const slice = createSlice({
22
+ name,
23
+ initialState,
24
+ reducers: {
25
+ setActivatedLanguage: (state, action) => {
26
+ state.activatedLanguage = action.payload;
27
+ const lang = pickLang({ activatedLanguage: state.activatedLanguage, languageSupport: state.languageSupport }, action.payload);
28
+ state.backButton = lang.backButton;
29
+ state.forwardButton = lang.forwardButton;
30
+ state.sendButton = lang.sendButton;
31
+ },
32
+ setLabelsFromLanguageEntry: (state, action) => {
33
+ state.backButton = action.payload.backButton;
34
+ state.forwardButton = action.payload.forwardButton;
35
+ state.sendButton = action.payload.sendButton;
36
+ },
37
+ replaceLanguageSupport: (state, action) => {
38
+ state.languageSupport = action.payload.languageSupport;
39
+ state.activatedLanguage = action.payload.activatedLanguage;
40
+ const lang = pickLang(action.payload, action.payload.activatedLanguage);
41
+ state.backButton = lang.backButton;
42
+ state.forwardButton = lang.forwardButton;
43
+ state.sendButton = lang.sendButton;
44
+ state.languageSupportLoaded = true;
45
+ },
46
+ },
47
+ });
48
+ return slice;
49
+ };
50
+ /** ----- Selector-fabrik (helt generisk, ingen RootState) ----- */
51
+ export const makeLanguageSelectors = (selectSlice) => {
52
+ const selectState = selectSlice;
53
+ const selectActivatedLanguage = (state) => selectState(state).activatedLanguage;
54
+ const selectLanguageSupportLoaded = (state) => selectState(state).languageSupportLoaded;
55
+ const selectLanguageSupport = (state) => selectState(state).languageSupport;
56
+ const selectOverallContentState = (state) => selectState(state);
57
+ const selectOverallContentFromLanguageSupport = createSelector([selectState, (_, activatedLanguage) => activatedLanguage], (applicationContent, activatedLanguage) => {
58
+ const match = applicationContent.languageSupport.find((l) => l.language === activatedLanguage);
59
+ if (!match)
60
+ return { ...applicationContent };
61
+ return {
62
+ ...applicationContent,
63
+ backButton: match.backButton,
64
+ forwardButton: match.forwardButton,
65
+ sendButton: match.sendButton,
66
+ };
67
+ });
68
+ return {
69
+ selectActivatedLanguage,
70
+ selectLanguageSupportLoaded,
71
+ selectLanguageSupport,
72
+ selectOverallContentState,
73
+ selectOverallContentFromLanguageSupport,
74
+ };
75
+ };
@@ -0,0 +1,12 @@
1
+ export interface CookieConsentConfig {
2
+ cookieName: string;
3
+ choiceKey: string;
4
+ expiryYears?: number;
5
+ }
6
+ export declare const createCookieConsent: (config: CookieConsentConfig) => {
7
+ acceptCookies: () => void;
8
+ rejectCookies: () => void;
9
+ areCookiesAccepted: () => boolean;
10
+ hasChoiceBeenMade: () => boolean;
11
+ clearChoiceFromSession: () => void;
12
+ };
@@ -0,0 +1,42 @@
1
+ const getCookie = (name) => {
2
+ const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
3
+ return match ? match[2] : null;
4
+ };
5
+ const setCookie = (name, value, expirationDate) => {
6
+ let cookieString = `${name}=${value}; path=/; SameSite=Strict`;
7
+ if (expirationDate) {
8
+ cookieString += `; expires=${expirationDate.toUTCString()}`;
9
+ }
10
+ if (window.location.protocol === 'https:') {
11
+ cookieString += '; Secure';
12
+ }
13
+ document.cookie = cookieString;
14
+ };
15
+ const removeCookie = (name) => {
16
+ const pastDate = new Date(0);
17
+ setCookie(name, '', pastDate);
18
+ };
19
+ export const createCookieConsent = (config) => {
20
+ const { cookieName, choiceKey, expiryYears = 1 } = config;
21
+ const acceptCookies = () => {
22
+ const expires = new Date();
23
+ expires.setFullYear(expires.getFullYear() + expiryYears);
24
+ setCookie(cookieName, 'true', expires);
25
+ localStorage.setItem(cookieName, 'true');
26
+ };
27
+ const rejectCookies = () => {
28
+ removeCookie(cookieName);
29
+ localStorage.removeItem(cookieName);
30
+ sessionStorage.setItem(choiceKey, 'true');
31
+ };
32
+ const areCookiesAccepted = () => getCookie(cookieName) === 'true';
33
+ const hasChoiceBeenMade = () => sessionStorage.getItem(choiceKey) === 'true';
34
+ const clearChoiceFromSession = () => sessionStorage.removeItem(choiceKey);
35
+ return {
36
+ acceptCookies,
37
+ rejectCookies,
38
+ areCookiesAccepted,
39
+ hasChoiceBeenMade,
40
+ clearChoiceFromSession,
41
+ };
42
+ };
@@ -0,0 +1,3 @@
1
+ import type { TranslatedAnswers, ApiDataObject } from './CreateApiDataObject.types';
2
+ declare function CreateApiDataObject(data: any[], specialMappedQuestions: Set<string>, translatedAnswers: TranslatedAnswers): ApiDataObject;
3
+ export default CreateApiDataObject;
@@ -0,0 +1,44 @@
1
+ const normalize = (str) => {
2
+ return str.toString().toLowerCase().replace(/\s+/g, '');
3
+ };
4
+ function CreateApiDataObject(data, specialMappedQuestions, translatedAnswers) {
5
+ return data.reduce((acc, question) => {
6
+ var _a;
7
+ let translatedAnswer = question.answer;
8
+ if (question.answer &&
9
+ typeof question.answer === 'string' &&
10
+ Array.isArray(question.options) &&
11
+ question.mappingId &&
12
+ specialMappedQuestions.has(question.mappingId)) {
13
+ const answerNormalized = normalize(question.answer);
14
+ const matchingIds = question.options
15
+ .filter((option) => answerNormalized.includes(normalize(option.label)))
16
+ .map((option) => `^${option.id}^`);
17
+ if (matchingIds.length > 0) {
18
+ translatedAnswer = matchingIds.join(',');
19
+ }
20
+ }
21
+ else {
22
+ const shouldTranslate = question.mappingId
23
+ ? translatedAnswers[question.mappingId]
24
+ : undefined;
25
+ translatedAnswer = shouldTranslate
26
+ ? shouldTranslate[question.answer] || question.answer
27
+ : question.answer;
28
+ }
29
+ return {
30
+ ...acc,
31
+ ...(question.mappingId &&
32
+ question.isDisplayed &&
33
+ question.answer && {
34
+ [question.mappingId]: translatedAnswer,
35
+ }),
36
+ ...(question.questionType === 'AddFiles' &&
37
+ ((_a = question.files) === null || _a === void 0 ? void 0 : _a.length) &&
38
+ question.files.length > 0 && {
39
+ files: question.files,
40
+ }),
41
+ };
42
+ }, {});
43
+ }
44
+ export default CreateApiDataObject;
@@ -0,0 +1,8 @@
1
+ export interface TranslatedAnswers {
2
+ [questionId: string]: {
3
+ [originalAnswer: string]: string;
4
+ };
5
+ }
6
+ export interface ApiDataObject {
7
+ [key: string]: string | number | boolean | File[];
8
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './CreateApiDataObject';
2
+ export type { TranslatedAnswers, ApiDataObject } from './CreateApiDataObject.types';
@@ -0,0 +1 @@
1
+ export { default } from './CreateApiDataObject';
@@ -0,0 +1,3 @@
1
+ import { IQuestion } from '../../NewTypesStandard';
2
+ declare const doCategoriesAndQuestionsVisible: (questions: IQuestion[], validationErrorsList: number[]) => any[];
3
+ export default doCategoriesAndQuestionsVisible;
@@ -0,0 +1,11 @@
1
+ import isDependsOnOtherQuestionTrue from '../IsDependsOnOtherQuestionTrue';
2
+ const doCategoriesAndQuestionsVisible = (questions, validationErrorsList) => {
3
+ const updatedQuestions = questions.map((question) => {
4
+ const hasLinkedConditions = question.dependsOnOtherQuestion && question.dependsOnOtherQuestion.length > 0;
5
+ const isVisible = hasLinkedConditions ? isDependsOnOtherQuestionTrue(questions, question) : true; // om inget länkat, visa frågan
6
+ const hasError = validationErrorsList.includes(question.id);
7
+ return { ...question, visible: isVisible, hasValidationError: hasError };
8
+ });
9
+ return updatedQuestions;
10
+ };
11
+ export default doCategoriesAndQuestionsVisible;
@@ -0,0 +1 @@
1
+ export { default } from './DoCategoriesAndQuestionsVisible';
@@ -0,0 +1 @@
1
+ export { default } from './DoCategoriesAndQuestionsVisible';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Sätter fokus på ett element med givet id (eller HTMLElement),
3
+ * sätter tabindex="-1" om inte redan finns, och scrollar dit smidigt.
4
+ *
5
+ * @param target Elementets id (t.ex. 'main-content') eller själva elementet.
6
+ */
7
+ export declare const focusElement: (target: string | HTMLElement | null) => void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Sätter fokus på ett element med givet id (eller HTMLElement),
3
+ * sätter tabindex="-1" om inte redan finns, och scrollar dit smidigt.
4
+ *
5
+ * @param target Elementets id (t.ex. 'main-content') eller själva elementet.
6
+ */
7
+ export const focusElement = (target) => {
8
+ const element = typeof target === 'string' ? document.getElementById(target) : target;
9
+ if (!element)
10
+ return;
11
+ if (!element.hasAttribute('tabindex')) {
12
+ element.setAttribute('tabindex', '-1');
13
+ }
14
+ element.focus();
15
+ element.scrollIntoView({ behavior: 'smooth' });
16
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Plockar ut alla id:n från validationType som börjar med "groupCheck-"
3
+ */
4
+ declare const getIdsGroupCheckValidationTypes: (validationType?: string[]) => number[];
5
+ export { getIdsGroupCheckValidationTypes };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Plockar ut alla id:n från validationType som börjar med "groupCheck-"
3
+ */
4
+ const getIdsGroupCheckValidationTypes = (validationType) => {
5
+ if (!(validationType === null || validationType === void 0 ? void 0 : validationType.length))
6
+ return [];
7
+ const ids = validationType
8
+ .filter((t) => t.startsWith('groupCheck-'))
9
+ .flatMap((t) => t.split('-').slice(1))
10
+ .map((s) => Number(s))
11
+ .filter((n) => Number.isFinite(n));
12
+ return Array.from(new Set(ids));
13
+ };
14
+ export { getIdsGroupCheckValidationTypes };
@@ -0,0 +1,3 @@
1
+ import { IStepObject, IQuestion } from '../../NewTypesStandard/TypesStandard.types';
2
+ declare function groupQuestionByStepPreviewPage(steps: IStepObject[], questions: IQuestion[]): any[];
3
+ export default groupQuestionByStepPreviewPage;
@@ -0,0 +1,12 @@
1
+ function groupQuestionByStepPreviewPage(steps, questions) {
2
+ return steps
3
+ .map(step => {
4
+ const filteredQuestions = questions.filter(q => q.step === step.step && q.isDisplayed);
5
+ return {
6
+ step,
7
+ questions: filteredQuestions,
8
+ };
9
+ })
10
+ .filter(group => group.questions.length > 0);
11
+ }
12
+ export default groupQuestionByStepPreviewPage;
@@ -0,0 +1 @@
1
+ export { default } from './GroupQuestionByStepPreviewPage';
@@ -0,0 +1 @@
1
+ export { default } from './GroupQuestionByStepPreviewPage';
@@ -0,0 +1,3 @@
1
+ import { IQuestion, IStepObject } from '../../NewTypesStandard';
2
+ declare function groupQuestionsByStepCategoryGroup(questions: IQuestion[], steps: IStepObject[], validationErrorsList: number[]): any[];
3
+ export default groupQuestionsByStepCategoryGroup;
@@ -0,0 +1,61 @@
1
+ import doCategoriesAndQuestionsVisible from '../DoCategoriesAndQuestionsVisible';
2
+ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsList) {
3
+ var _a, _b;
4
+ const formatedQuestions = doCategoriesAndQuestionsVisible(questions, validationErrorsList);
5
+ const result = [];
6
+ const stepsMap = new Map();
7
+ formatedQuestions.forEach((question) => {
8
+ var _a, _b;
9
+ const step = (_a = question.step) !== null && _a !== void 0 ? _a : 0;
10
+ const category = ((_b = question.categoryLabel) === null || _b === void 0 ? void 0 : _b.trim()) || 'Okänd kategori';
11
+ const groupId = question.questionGroupId || 'unknown';
12
+ if (!stepsMap.has(step)) {
13
+ stepsMap.set(step, new Map());
14
+ }
15
+ const categoryMap = stepsMap.get(step);
16
+ if (!categoryMap.has(category)) {
17
+ categoryMap.set(category, new Map());
18
+ }
19
+ const groupMap = categoryMap.get(category);
20
+ if (!groupMap.has(groupId)) {
21
+ groupMap.set(groupId, []);
22
+ }
23
+ groupMap.get(groupId).push(question);
24
+ });
25
+ for (const [step, categoryMap] of Array.from(stepsMap.entries())) {
26
+ const categories = [];
27
+ for (const [category, groupMap] of Array.from(categoryMap.entries())) {
28
+ const questionGroups = [];
29
+ for (const [groupId, questions] of Array.from(groupMap.entries())) {
30
+ questionGroups.push({
31
+ questionGroupId: groupId,
32
+ questionGroupType: questions[0].questionGroupType,
33
+ questions,
34
+ legend: questions[0].categoryDescription,
35
+ });
36
+ }
37
+ const isVisible = questionGroups.some((group) => group.questions.some((question) => question.visible));
38
+ categories.push({
39
+ category,
40
+ visible: isVisible,
41
+ isDisplayed: isVisible,
42
+ questionGroups,
43
+ });
44
+ }
45
+ const stepHeadline = ((_a = steps.find((s) => s.step === step)) === null || _a === void 0 ? void 0 : _a.stepHeadline) || undefined;
46
+ const stepDescription = ((_b = steps.find((s) => s.step === step)) === null || _b === void 0 ? void 0 : _b.stepDescription) || undefined;
47
+ result.push({
48
+ step,
49
+ stepHeadline,
50
+ stepDescription,
51
+ categories,
52
+ });
53
+ }
54
+ result.push({
55
+ step: steps.length,
56
+ stepHeadline: steps[steps.length - 1].stepHeadline,
57
+ stepDescription: steps[steps.length - 1].stepDescription,
58
+ });
59
+ return result;
60
+ }
61
+ export default groupQuestionsByStepCategoryGroup;
@@ -0,0 +1 @@
1
+ export { default } from './GroupQuestionsByStepCategoryGroup';
@@ -0,0 +1 @@
1
+ export { default } from './GroupQuestionsByStepCategoryGroup';
@@ -0,0 +1,51 @@
1
+ export interface IQuestionObjectStandard {
2
+ Id?: number;
3
+ Order?: number;
4
+ Step?: number;
5
+ Category?: string;
6
+ CategoryOrder?: number;
7
+ CategoryDescription?: string;
8
+ CategoryMandatory?: boolean;
9
+ QuestionPreviewLabel?: string;
10
+ GroupId?: number;
11
+ Question?: string;
12
+ Answer?: string;
13
+ PlaceholderText?: string;
14
+ About?: string;
15
+ Mandatory?: boolean;
16
+ Dependent?: boolean;
17
+ DependentOnOrder?: number;
18
+ QuestionType?: string;
19
+ InputName?: string;
20
+ Options?: Array<any>;
21
+ isTouched?: boolean;
22
+ error?: boolean;
23
+ errorType?: Array<string>;
24
+ errorSpecificMessage?: string;
25
+ Files?: Array<any>;
26
+ MoreFields?: Array<string>;
27
+ questionArray?: Array<any>;
28
+ answerColumnArray?: Array<any>;
29
+ languageSupport?: Array<{}>;
30
+ Width?: string;
31
+ InputSize?: string;
32
+ CheckboxOrder?: number;
33
+ Details?: string;
34
+ Info?: string;
35
+ MaxLength?: number;
36
+ HideQuestion?: boolean;
37
+ InputType?: string;
38
+ autocomplete?: string;
39
+ HideMaxLength?: boolean;
40
+ isDisplayed?: boolean;
41
+ }
42
+ export declare enum IQuestionTypeStandard {
43
+ TextFieldStandard = 0,
44
+ TextAreaStandard = 1,
45
+ SelectStandard = 2,
46
+ RadioStandard = 3,
47
+ CheckboxStandard = 4,
48
+ DatePickerStandard = 5,
49
+ FileUploadStandard = 6,
50
+ QuestionHasValidationError = 7
51
+ }
@@ -0,0 +1,12 @@
1
+ //Todo: Ej implementerad i IQuestionObject
2
+ export var IQuestionTypeStandard;
3
+ (function (IQuestionTypeStandard) {
4
+ IQuestionTypeStandard[IQuestionTypeStandard["TextFieldStandard"] = 0] = "TextFieldStandard";
5
+ IQuestionTypeStandard[IQuestionTypeStandard["TextAreaStandard"] = 1] = "TextAreaStandard";
6
+ IQuestionTypeStandard[IQuestionTypeStandard["SelectStandard"] = 2] = "SelectStandard";
7
+ IQuestionTypeStandard[IQuestionTypeStandard["RadioStandard"] = 3] = "RadioStandard";
8
+ IQuestionTypeStandard[IQuestionTypeStandard["CheckboxStandard"] = 4] = "CheckboxStandard";
9
+ IQuestionTypeStandard[IQuestionTypeStandard["DatePickerStandard"] = 5] = "DatePickerStandard";
10
+ IQuestionTypeStandard[IQuestionTypeStandard["FileUploadStandard"] = 6] = "FileUploadStandard";
11
+ IQuestionTypeStandard[IQuestionTypeStandard["QuestionHasValidationError"] = 7] = "QuestionHasValidationError";
12
+ })(IQuestionTypeStandard || (IQuestionTypeStandard = {}));
@@ -0,0 +1,2 @@
1
+ declare const isDependsOnOtherQuestionTrue: (data: any[], question: any) => boolean;
2
+ export default isDependsOnOtherQuestionTrue;
@@ -0,0 +1,13 @@
1
+ const isDependsOnOtherQuestionTrue = (data, question) => {
2
+ const isParentTrue = (questionId, questionArrayAnswerId, answer) => {
3
+ const parent = data.find((q) => q.id === questionId);
4
+ if (!parent)
5
+ return false;
6
+ return ((questionArrayAnswerId !== undefined && parent.questionArrayAnswerId === questionArrayAnswerId) ||
7
+ parent.answer === answer);
8
+ };
9
+ if (!question.dependsOnOtherQuestion || question.dependsOnOtherQuestion.length === 0)
10
+ return false;
11
+ return question.dependsOnOtherQuestion.some((conditions) => conditions.every((cond) => isParentTrue(cond.LinkedToQuestionId, cond.questionArrayAnswerId, cond.Answer)));
12
+ };
13
+ export default isDependsOnOtherQuestionTrue;
@@ -0,0 +1 @@
1
+ export { default } from './IsDependsOnOtherQuestionTrue';
@@ -0,0 +1 @@
1
+ export { default } from './IsDependsOnOtherQuestionTrue';
@@ -0,0 +1,2 @@
1
+ declare const questionHasValidationError: (questionObject: any, arrayOfQuestionObjects: any[]) => boolean;
2
+ export default questionHasValidationError;
@@ -0,0 +1,58 @@
1
+ import { isValid, parseISO } from 'date-fns';
2
+ const questionHasValidationError = (questionObject, arrayOfQuestionObjects) => {
3
+ var _a, _b, _c, _d, _e;
4
+ let error = false;
5
+ if (questionObject.isQuestionMandatory) {
6
+ if (questionObject.isTouched === false) {
7
+ error = true;
8
+ }
9
+ if (questionObject.answer.trim() === '') {
10
+ error = true;
11
+ }
12
+ if (questionObject.answer === 'false' &&
13
+ ((_a = questionObject.validationType) === null || _a === void 0 ? void 0 : _a.find((e) => e === 'mustBeTrue'))) {
14
+ error = true;
15
+ }
16
+ }
17
+ if (((_b = questionObject.validationType) === null || _b === void 0 ? void 0 : _b.find((e) => e === 'email')) &&
18
+ (questionObject.isQuestionMandatory || questionObject.answer !== '')) {
19
+ const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
20
+ if (!emailRegex.test(questionObject.answer)) {
21
+ error = true;
22
+ }
23
+ }
24
+ if (((_c = questionObject.validationType) === null || _c === void 0 ? void 0 : _c.find((e) => e === 'fourNumbers')) &&
25
+ (questionObject.isQuestionMandatory || questionObject.answer !== '')) {
26
+ const fourNumbersRegex = /^\d{4}$/.test(questionObject.answer);
27
+ if (!fourNumbersRegex) {
28
+ error = true;
29
+ }
30
+ }
31
+ if (((_d = questionObject.validationType) === null || _d === void 0 ? void 0 : _d.find((e) => e === 'isDateFormatValid')) &&
32
+ questionObject.answer !== '') {
33
+ const regex = /^\d{4}-\d{2}-\d{2}$/;
34
+ if (!regex.test(questionObject.answer)) {
35
+ error = true;
36
+ }
37
+ const isValidDate = (dateString) => {
38
+ const date = parseISO(dateString);
39
+ return isValid(date);
40
+ };
41
+ const validDate = isValidDate(questionObject.answer);
42
+ if (!validDate) {
43
+ error = true;
44
+ }
45
+ }
46
+ const groupCheckError = (_e = questionObject.validationType) === null || _e === void 0 ? void 0 : _e.find((e) => e.startsWith('groupCheck-'));
47
+ if (groupCheckError) {
48
+ const ids = groupCheckError.replace('groupCheck-', '').split('-');
49
+ const relatedAnswers = ids.map((id) => { var _a; return (_a = arrayOfQuestionObjects.find((q) => { var _a; return ((_a = q.id) === null || _a === void 0 ? void 0 : _a.toString()) === id; })) === null || _a === void 0 ? void 0 : _a.answer; });
50
+ const currentAnswer = questionObject.answer;
51
+ const allAnswers = [...relatedAnswers, currentAnswer];
52
+ if (allAnswers.every((ans) => ans === '')) {
53
+ error = true;
54
+ }
55
+ }
56
+ return error;
57
+ };
58
+ export default questionHasValidationError;
@@ -0,0 +1,5 @@
1
+ import { IQuestionObjectStandard } from '../InputElements.types';
2
+ export interface ValidationProps {
3
+ questionObject: IQuestionObjectStandard;
4
+ arrayOfQuestionObjects: IQuestionObjectStandard[];
5
+ }
@@ -0,0 +1 @@
1
+ export { default } from './QuestionHasValidationError';
@@ -0,0 +1 @@
1
+ export { default } from './QuestionHasValidationError';