@aehrc/smart-forms-renderer 0.12.1 → 0.13.0

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 (282) hide show
  1. package/lib/components/Box.styles.d.ts +6 -0
  2. package/lib/components/Box.styles.js +29 -1
  3. package/lib/components/Box.styles.js.map +1 -1
  4. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +2 -2
  5. package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
  6. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +4 -10
  7. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
  8. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +4 -9
  9. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
  10. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +4 -9
  11. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +4 -10
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +4 -10
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +4 -10
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +4 -10
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
  20. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js +2 -2
  21. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +1 -1
  22. package/lib/components/FormComponents/DateItem/DateItem.js +2 -2
  23. package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -1
  24. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +2 -2
  25. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -1
  26. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +4 -4
  27. package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
  28. package/lib/components/FormComponents/IntegerItem/IntegerField.js +1 -1
  29. package/lib/components/FormComponents/IntegerItem/IntegerField.js.map +1 -1
  30. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +4 -4
  31. package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
  32. package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.d.ts +7 -0
  33. package/lib/components/FormComponents/{DateItem/DatePickerField.js → ItemParts/ItemExtensionLabels.js} +12 -6
  34. package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.js.map +1 -0
  35. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +1 -0
  36. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +10 -7
  37. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
  38. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +4 -10
  39. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
  40. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +4 -9
  41. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
  42. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +4 -10
  43. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
  44. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +4 -10
  45. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
  46. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +4 -10
  47. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
  48. package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +1 -2
  49. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +2 -2
  50. package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
  51. package/lib/components/FormComponents/SliderItem/SliderItem.js +2 -2
  52. package/lib/components/FormComponents/SliderItem/SliderItem.js.map +1 -1
  53. package/lib/components/FormComponents/StringItem/StringItem.js +4 -4
  54. package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
  55. package/lib/components/FormComponents/TextItem/TextItem.js +4 -4
  56. package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
  57. package/lib/components/FormComponents/TimeItem/TimeItem.js +2 -2
  58. package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
  59. package/lib/components/FormComponents/UrlItem/UrlItem.js +4 -4
  60. package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
  61. package/lib/components/Renderer/BaseRenderer.js +7 -0
  62. package/lib/components/Renderer/BaseRenderer.js.map +1 -1
  63. package/lib/hooks/useRenderingExtensions.d.ts +2 -0
  64. package/lib/hooks/useRenderingExtensions.js +16 -11
  65. package/lib/hooks/useRenderingExtensions.js.map +1 -1
  66. package/lib/hooks/useValidationFeedback.d.ts +3 -0
  67. package/lib/hooks/useValidationFeedback.js +37 -0
  68. package/lib/hooks/useValidationFeedback.js.map +1 -0
  69. package/lib/stores/questionnaireResponseStore.d.ts +8 -1
  70. package/lib/stores/questionnaireResponseStore.js +22 -0
  71. package/lib/stores/questionnaireResponseStore.js.map +1 -1
  72. package/lib/utils/itemControl.d.ts +1 -27
  73. package/lib/utils/itemControl.js +0 -49
  74. package/lib/utils/itemControl.js.map +1 -1
  75. package/lib/utils/mapItem.d.ts +2 -0
  76. package/lib/utils/mapItem.js +2 -0
  77. package/lib/utils/mapItem.js.map +1 -1
  78. package/lib/utils/validateQuestionnaire.d.ts +23 -0
  79. package/lib/utils/validateQuestionnaire.js +183 -0
  80. package/lib/utils/validateQuestionnaire.js.map +1 -0
  81. package/package.json +1 -1
  82. package/src/components/Box.styles.ts +31 -1
  83. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +6 -2
  84. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +19 -23
  85. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +15 -18
  86. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +16 -19
  87. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +15 -19
  88. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +17 -21
  89. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +15 -19
  90. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +17 -21
  91. package/src/components/FormComponents/CustomDateItem/CustomDateItem.tsx +7 -2
  92. package/src/components/FormComponents/DateItem/DateItem.tsx +7 -2
  93. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +7 -2
  94. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +9 -3
  95. package/src/components/FormComponents/IntegerItem/IntegerField.tsx +1 -0
  96. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +9 -3
  97. package/{lib/components/BackToTopButton/BackToTopButton.js → src/components/FormComponents/ItemParts/ItemExtensionLabels.tsx} +23 -15
  98. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +14 -9
  99. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +21 -25
  100. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +20 -23
  101. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +18 -22
  102. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +16 -20
  103. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +17 -21
  104. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +8 -4
  105. package/src/components/FormComponents/SliderItem/SliderItem.tsx +6 -2
  106. package/src/components/FormComponents/StringItem/StringItem.tsx +9 -3
  107. package/src/components/FormComponents/TextItem/TextItem.tsx +9 -3
  108. package/src/components/FormComponents/TimeItem/TimeItem.tsx +7 -2
  109. package/src/components/FormComponents/UrlItem/UrlItem.tsx +9 -3
  110. package/src/components/Renderer/BaseRenderer.tsx +9 -0
  111. package/src/hooks/useRenderingExtensions.ts +17 -11
  112. package/src/hooks/{useValidationError.ts → useValidationFeedback.ts} +23 -21
  113. package/src/stores/questionnaireResponseStore.ts +36 -1
  114. package/src/utils/itemControl.ts +1 -67
  115. package/src/utils/mapItem.ts +2 -0
  116. package/src/utils/validateQuestionnaire.ts +273 -0
  117. package/lib/components/BackToTopButton/BackToTopButton.d.ts +0 -7
  118. package/lib/components/BackToTopButton/BackToTopButton.js.map +0 -1
  119. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.d.ts +0 -18
  120. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js +0 -31
  121. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js.map +0 -1
  122. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.d.ts +0 -9
  123. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js +0 -75
  124. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js.map +0 -1
  125. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.d.ts +0 -9
  126. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js +0 -75
  127. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js.map +0 -1
  128. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.d.ts +0 -5
  129. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js +0 -27
  130. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js.map +0 -1
  131. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.d.ts +0 -9
  132. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js +0 -71
  133. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js.map +0 -1
  134. package/lib/components/FormComponents/DateItem/DatePicker.d.ts +0 -2
  135. package/lib/components/FormComponents/DateItem/DatePicker.js +0 -42
  136. package/lib/components/FormComponents/DateItem/DatePicker.js.map +0 -1
  137. package/lib/components/FormComponents/DateItem/DatePickerField.d.ts +0 -8
  138. package/lib/components/FormComponents/DateItem/DatePickerField.js.map +0 -1
  139. package/lib/components/FormComponents/DisplayItem/DisplayBox.d.ts +0 -0
  140. package/lib/components/FormComponents/DisplayItem/DisplayBox.js +0 -2
  141. package/lib/components/FormComponents/DisplayItem/DisplayBox.js.map +0 -1
  142. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.d.ts +0 -4
  143. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js +0 -35
  144. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js.map +0 -1
  145. package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.d.ts +0 -10
  146. package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js +0 -73
  147. package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js.map +0 -1
  148. package/lib/components/FormComponents/GroupItem/ItemSwitcher.d.ts +0 -10
  149. package/lib/components/FormComponents/GroupItem/ItemSwitcher.js +0 -81
  150. package/lib/components/FormComponents/GroupItem/ItemSwitcher.js.map +0 -1
  151. package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.d.ts +0 -10
  152. package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js +0 -45
  153. package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js.map +0 -1
  154. package/lib/components/FormComponents/IntegerItem/SliderItem.d.ts +0 -9
  155. package/lib/components/FormComponents/IntegerItem/SliderItem.js +0 -75
  156. package/lib/components/FormComponents/IntegerItem/SliderItem.js.map +0 -1
  157. package/lib/components/FormComponents/ItemParts/RadioButtons.d.ts +0 -8
  158. package/lib/components/FormComponents/ItemParts/RadioButtons.js +0 -37
  159. package/lib/components/FormComponents/ItemParts/RadioButtons.js.map +0 -1
  160. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.d.ts +0 -8
  161. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js +0 -37
  162. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js.map +0 -1
  163. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts +0 -0
  164. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js +0 -2
  165. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map +0 -1
  166. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +0 -0
  167. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +0 -2
  168. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map +0 -1
  169. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +0 -10
  170. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +0 -30
  171. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +0 -1
  172. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.d.ts +0 -4
  173. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js +0 -35
  174. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js.map +0 -1
  175. package/lib/components/FormComponents/Tables/AddItemButton.d.ts +0 -8
  176. package/lib/components/FormComponents/Tables/AddItemButton.js +0 -28
  177. package/lib/components/FormComponents/Tables/AddItemButton.js.map +0 -1
  178. package/lib/components/FormComponents/Tables/DeleteRowButton.d.ts +0 -10
  179. package/lib/components/FormComponents/Tables/DeleteRowButton.js +0 -32
  180. package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +0 -1
  181. package/lib/components/FormComponents/Tables/GroupTableRows.d.ts +0 -17
  182. package/lib/components/FormComponents/Tables/GroupTableRows.js +0 -45
  183. package/lib/components/FormComponents/Tables/GroupTableRows.js.map +0 -1
  184. package/lib/components/FormComponents/Tables/GroupTableTestRow.d.ts +0 -22
  185. package/lib/components/FormComponents/Tables/GroupTableTestRow.js +0 -43
  186. package/lib/components/FormComponents/Tables/GroupTableTestRow.js.map +0 -1
  187. package/lib/components/FormComponents/Tables/QItemGroupTable.d.ts +0 -10
  188. package/lib/components/FormComponents/Tables/QItemGroupTable.js +0 -109
  189. package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +0 -1
  190. package/lib/components/FormComponents/Tables/QItemGroupTableRow.d.ts +0 -10
  191. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +0 -46
  192. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +0 -1
  193. package/lib/components/FormComponents/Typography.styles.d.ts +0 -6
  194. package/lib/components/FormComponents/Typography.styles.js +0 -24
  195. package/lib/components/FormComponents/Typography.styles.js.map +0 -1
  196. package/lib/hooks/useBackToTop.d.ts +0 -2
  197. package/lib/hooks/useBackToTop.js +0 -26
  198. package/lib/hooks/useBackToTop.js.map +0 -1
  199. package/lib/hooks/useDateSeparatorValidation.d.ts +0 -2
  200. package/lib/hooks/useDateSeparatorValidation.js +0 -25
  201. package/lib/hooks/useDateSeparatorValidation.js.map +0 -1
  202. package/lib/hooks/useDecimalUpdateFromProp.d.ts +0 -2
  203. package/lib/hooks/useDecimalUpdateFromProp.js +0 -29
  204. package/lib/hooks/useDecimalUpdateFromProp.js.map +0 -1
  205. package/lib/hooks/useIntegerUpdateFromProp.d.ts +0 -2
  206. package/lib/hooks/useIntegerUpdateFromProp.js +0 -29
  207. package/lib/hooks/useIntegerUpdateFromProp.js.map +0 -1
  208. package/lib/hooks/useMinimalStringCalculatedExpression.d.ts +0 -11
  209. package/lib/hooks/useMinimalStringCalculatedExpression.js +0 -49
  210. package/lib/hooks/useMinimalStringCalculatedExpression.js.map +0 -1
  211. package/lib/hooks/useNumberUpdateFromProp.d.ts +0 -2
  212. package/lib/hooks/useNumberUpdateFromProp.js +0 -29
  213. package/lib/hooks/useNumberUpdateFromProp.js.map +0 -1
  214. package/lib/hooks/useRepeatItemState.d.ts +0 -5
  215. package/lib/hooks/useRepeatItemState.js +0 -35
  216. package/lib/hooks/useRepeatItemState.js.map +0 -1
  217. package/lib/hooks/useRepeatItemUpdateFromProp.d.ts +0 -2
  218. package/lib/hooks/useRepeatItemUpdateFromProp.js +0 -29
  219. package/lib/hooks/useRepeatItemUpdateFromProp.js.map +0 -1
  220. package/lib/hooks/useStringField.d.ts +0 -2
  221. package/lib/hooks/useStringField.js +0 -29
  222. package/lib/hooks/useStringField.js.map +0 -1
  223. package/lib/hooks/useStringUpdateFromProp.d.ts +0 -2
  224. package/lib/hooks/useStringUpdateFromProp.js +0 -29
  225. package/lib/hooks/useStringUpdateFromProp.js.map +0 -1
  226. package/lib/hooks/useValidationError.d.ts +0 -3
  227. package/lib/hooks/useValidationError.js +0 -38
  228. package/lib/hooks/useValidationError.js.map +0 -1
  229. package/lib/interfaces/index.d.ts +0 -2
  230. package/lib/interfaces/index.js +0 -18
  231. package/lib/interfaces/index.js.map +0 -1
  232. package/lib/setup-jest.js +0 -1
  233. package/lib/setup-jest.js.map +0 -1
  234. package/lib/stores/useQuestionnaireResponseStore.d.ts +0 -27
  235. package/lib/stores/useQuestionnaireResponseStore.js +0 -49
  236. package/lib/stores/useQuestionnaireResponseStore.js.map +0 -1
  237. package/lib/stores/useQuestionnaireStore.d.ts +0 -64
  238. package/lib/stores/useQuestionnaireStore.js +0 -173
  239. package/lib/stores/useQuestionnaireStore.js.map +0 -1
  240. package/lib/stores/useSmartConfigStore.d.ts +0 -14
  241. package/lib/stores/useSmartConfigStore.js +0 -13
  242. package/lib/stores/useSmartConfigStore.js.map +0 -1
  243. package/lib/stores/useTerminologyServerStore.d.ts +0 -7
  244. package/lib/stores/useTerminologyServerStore.js +0 -25
  245. package/lib/stores/useTerminologyServerStore.js.map +0 -1
  246. package/lib/stories/MedicalHistoryTable.stories.js +0 -45
  247. package/lib/stories/MedicalHistoryTable.stories.js.map +0 -1
  248. package/lib/stories/SmartFormsRenderer.stories.js +0 -103
  249. package/lib/stories/SmartFormsRenderer.stories.js.map +0 -1
  250. package/lib/test.d.ts +0 -4
  251. package/lib/test.js +0 -18
  252. package/lib/test.js.map +0 -1
  253. package/lib/theme/overrides/Backdrop.d.ts +0 -13
  254. package/lib/theme/overrides/Backdrop.js +0 -32
  255. package/lib/theme/overrides/Backdrop.js.map +0 -1
  256. package/lib/theme/overrides/Typography.d.ts +0 -13
  257. package/lib/theme/overrides/Typography.js +0 -31
  258. package/lib/theme/overrides/Typography.js.map +0 -1
  259. package/lib/utils/formChangesOld.d.ts +0 -18
  260. package/lib/utils/formChangesOld.js +0 -91
  261. package/lib/utils/formChangesOld.js.map +0 -1
  262. package/lib/utils/initialiseForm.d.ts +0 -22
  263. package/lib/utils/initialiseForm.js +0 -53
  264. package/lib/utils/initialiseForm.js.map +0 -1
  265. package/lib/utils/launchContext.d.ts +0 -0
  266. package/lib/utils/launchContext.js +0 -2
  267. package/lib/utils/launchContext.js.map +0 -1
  268. package/lib/utils/populateInputParams.d.ts +0 -8
  269. package/lib/utils/populateInputParams.js +0 -193
  270. package/lib/utils/populateInputParams.js.map +0 -1
  271. package/lib/utils/removeHidden.d.ts +0 -16
  272. package/lib/utils/removeHidden.js +0 -105
  273. package/lib/utils/removeHidden.js.map +0 -1
  274. package/lib/utils/repopulate.d.ts +0 -9
  275. package/lib/utils/repopulate.js +0 -133
  276. package/lib/utils/repopulate.js.map +0 -1
  277. package/lib/utils/repopulateGenerateItems.d.ts +0 -9
  278. package/lib/utils/repopulateGenerateItems.js +0 -133
  279. package/lib/utils/repopulateGenerateItems.js.map +0 -1
  280. package/lib/utils/repopulateRepeatGroup.d.ts +0 -4
  281. package/lib/utils/repopulateRepeatGroup.js +0 -62
  282. package/lib/utils/repopulateRepeatGroup.js.map +0 -1
@@ -1,25 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- function useDateSeparatorValidation(input) {
18
- let feedback = '';
19
- if (input.includes('-')) {
20
- feedback = 'Input does not match the required format with "/" as the separator.';
21
- }
22
- return feedback;
23
- }
24
- export default useDateSeparatorValidation;
25
- //# sourceMappingURL=useDateSeparatorValidation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDateSeparatorValidation.js","sourceRoot":"","sources":["../../src/hooks/useDateSeparatorValidation.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,SAAS,0BAA0B,CAAC,KAAa;IAC/C,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACvB,QAAQ,GAAG,qEAAqE,CAAC;KAClF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,eAAe,0BAA0B,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useIntegerUpdateFromProp(stateValue: string, propValue: number, setInputValue: (value: number) => void): void;
2
- export default useIntegerUpdateFromProp;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect } from 'react';
18
- function useIntegerUpdateFromProp(stateValue, propValue, setInputValue) {
19
- useEffect(() => {
20
- if (stateValue !== propValue) {
21
- setInputValue(propValue);
22
- }
23
- },
24
- // Only trigger this effect if prop value changes
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- [propValue]);
27
- }
28
- export default useIntegerUpdateFromProp;
29
- //# sourceMappingURL=useDecimalUpdateFromProp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDecimalUpdateFromProp.js","sourceRoot":"","sources":["../../src/hooks/useDecimalUpdateFromProp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,wBAAwB,CAC/B,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useIntegerUpdateFromProp(stateValue: number, propValue: number, setInputValue: (value: number) => void): void;
2
- export default useIntegerUpdateFromProp;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect } from 'react';
18
- function useIntegerUpdateFromProp(stateValue, propValue, setInputValue) {
19
- useEffect(() => {
20
- if (stateValue !== propValue) {
21
- setInputValue(propValue);
22
- }
23
- },
24
- // Only trigger this effect if prop value changes
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- [propValue]);
27
- }
28
- export default useIntegerUpdateFromProp;
29
- //# sourceMappingURL=useIntegerUpdateFromProp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntegerUpdateFromProp.js","sourceRoot":"","sources":["../../src/hooks/useIntegerUpdateFromProp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,wBAAwB,CAC/B,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
2
- interface UseMinimalStringCalculatedExpression {
3
- calcExpUpdated: boolean;
4
- }
5
- interface useMinimalStringCalculatedExpressionProps {
6
- qItem: QuestionnaireItem;
7
- inputValue: string;
8
- onQrItemChange: (qrItem: QuestionnaireResponseItem) => void;
9
- }
10
- declare function useMinimalStringCalculatedExpression(props: useMinimalStringCalculatedExpressionProps): UseMinimalStringCalculatedExpression;
11
- export default useMinimalStringCalculatedExpression;
@@ -1,49 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect } from 'react';
18
- import { createEmptyQrItem } from '../utils/qrItem';
19
- import useQuestionnaireStore from '../stores/useQuestionnaireStore';
20
- function useMinimalStringCalculatedExpression(props) {
21
- const { qItem, inputValue, onQrItemChange } = props;
22
- const calculatedExpressions = useQuestionnaireStore((state) => state.calculatedExpressions);
23
- useEffect(
24
- () => {
25
- const calcExpression = calculatedExpressions[qItem.linkId];
26
- // only update if calculated value is different from current value
27
- if (
28
- (calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) !==
29
- inputValue &&
30
- typeof (calcExpression === null || calcExpression === void 0
31
- ? void 0
32
- : calcExpression.value) === 'string'
33
- ) {
34
- // update questionnaireResponse
35
- onQrItemChange(
36
- Object.assign(Object.assign({}, createEmptyQrItem(qItem)), {
37
- answer: [{ valueString: calcExpression.value }]
38
- })
39
- );
40
- }
41
- },
42
- // Only trigger this effect if calculatedExpression of item changes
43
- // eslint-disable-next-line react-hooks/exhaustive-deps
44
- [calculatedExpressions]
45
- );
46
- return { calcExpUpdated: false };
47
- }
48
- export default useMinimalStringCalculatedExpression;
49
- //# sourceMappingURL=useMinimalStringCalculatedExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMinimalStringCalculatedExpression.js","sourceRoot":"","sources":["../../src/hooks/useMinimalStringCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AAYpE,SAAS,oCAAoC,CAC3C,KAAgD;IAEhD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEpD,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAE5F,SAAS,CACP,GAAG,EAAE;QACH,MAAM,cAAc,GAAG,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE3D,kEAAkE;QAClE,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,MAAK,UAAU,IAAI,OAAO,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,CAAA,KAAK,QAAQ,EAAE;YACrF,+BAA+B;YAC/B,cAAc,iCACT,iBAAiB,CAAC,KAAK,CAAC,KAC3B,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC,IAC/C,CAAC;SACJ;IACH,CAAC;IACD,mEAAmE;IACnE,uDAAuD;IACvD,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC;AAED,eAAe,oCAAoC,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useNumberUpdateFromProp(stateValue: number, propValue: number, setInputValue: (value: number) => void): void;
2
- export default useNumberUpdateFromProp;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect } from 'react';
18
- function useNumberUpdateFromProp(stateValue, propValue, setInputValue) {
19
- useEffect(() => {
20
- if (stateValue !== propValue) {
21
- setInputValue(propValue);
22
- }
23
- },
24
- // Only trigger this effect if prop value changes
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- [propValue]);
27
- }
28
- export default useNumberUpdateFromProp;
29
- //# sourceMappingURL=useNumberUpdateFromProp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNumberUpdateFromProp.js","sourceRoot":"","sources":["../../src/hooks/useNumberUpdateFromProp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,uBAAuB,CAC9B,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
@@ -1,5 +0,0 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
- import { RepeatAnswer } from '../interfaces/repeatItem.interface';
3
- import { QuestionnaireResponseItem } from 'fhir/r4';
4
- declare function useRepeatItemState(qrItem: QuestionnaireResponseItem, initialRepeatAnswers: RepeatAnswer[]): [RepeatAnswer[], Dispatch<SetStateAction<RepeatAnswer[]>>];
5
- export default useRepeatItemState;
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect, useState } from 'react';
18
- function useRepeatItemState(qrItem, initialRepeatAnswers) {
19
- const [repeatAnswers, setRepeatAnswers] = useState(initialRepeatAnswers);
20
- useEffect(() => {
21
- var _a;
22
- if (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) {
23
- if (repeatAnswers.length !== ((_a = qrItem.answer) === null || _a === void 0 ? void 0 : _a.length) &&
24
- repeatAnswers !== initialRepeatAnswers) {
25
- setRepeatAnswers(initialRepeatAnswers);
26
- }
27
- }
28
- },
29
- // Only trigger this effect if prop value changes
30
- // eslint-disable-next-line react-hooks/exhaustive-deps
31
- [qrItem]);
32
- return [repeatAnswers, setRepeatAnswers];
33
- }
34
- export default useRepeatItemState;
35
- //# sourceMappingURL=useRepeatItemState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRepeatItemState.js","sourceRoot":"","sources":["../../src/hooks/useRepeatItemState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAA4B,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItE,SAAS,kBAAkB,CACzB,MAAiC,EACjC,oBAAoC;IAEpC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAEzE,SAAS,CACP,GAAG,EAAE;;QACH,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,EAAE;YAClB,IACE,aAAa,CAAC,MAAM,MAAK,MAAA,MAAM,CAAC,MAAM,0CAAE,MAAM,CAAA;gBAC9C,aAAa,KAAK,oBAAoB,EACtC;gBACA,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;aACxC;SACF;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAC3C,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useRepeatItemUpdateFromProp(stateValue: string, propValue: string, setInputValue: (value: string) => void): void;
2
- export default useRepeatItemUpdateFromProp;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect } from 'react';
18
- function useRepeatItemUpdateFromProp(stateValue, propValue, setInputValue) {
19
- useEffect(() => {
20
- if (stateValue !== propValue) {
21
- setInputValue(propValue);
22
- }
23
- },
24
- // Only trigger this effect if prop value changes
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- [propValue]);
27
- }
28
- export default useRepeatItemUpdateFromProp;
29
- //# sourceMappingURL=useRepeatItemUpdateFromProp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRepeatItemUpdateFromProp.js","sourceRoot":"","sources":["../../src/hooks/useRepeatItemUpdateFromProp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,2BAA2B,CAClC,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,2BAA2B,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useStringUpdateFromProp(stateValue: string, propValue: string, setInputValue: (value: string) => void): void;
2
- export default useStringUpdateFromProp;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect } from 'react';
18
- function useStringUpdateFromProp(stateValue, propValue, setInputValue) {
19
- useEffect(() => {
20
- if (stateValue !== propValue) {
21
- setInputValue(propValue);
22
- }
23
- },
24
- // Only trigger this effect if prop value changes
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- [propValue]);
27
- }
28
- export default useStringUpdateFromProp;
29
- //# sourceMappingURL=useStringField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStringField.js","sourceRoot":"","sources":["../../src/hooks/useStringField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,uBAAuB,CAC9B,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useStringUpdateFromProp(stateValue: string, propValue: string, setInputValue: (value: string) => void): void;
2
- export default useStringUpdateFromProp;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect } from 'react';
18
- function useStringUpdateFromProp(stateValue, propValue, setInputValue) {
19
- useEffect(() => {
20
- if (stateValue !== propValue) {
21
- setInputValue(propValue);
22
- }
23
- },
24
- // Only trigger this effect if prop value changes
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- [propValue]);
27
- }
28
- export default useStringUpdateFromProp;
29
- //# sourceMappingURL=useStringUpdateFromProp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStringUpdateFromProp.js","sourceRoot":"","sources":["../../src/hooks/useStringUpdateFromProp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,uBAAuB,CAC9B,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { RegexValidation } from '../interfaces/regex.interface';
2
- declare function useValidationError(input: string, regexValidation: RegexValidation | null, maxLength: number | null): string;
3
- export default useValidationError;
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- function useValidationError(input, regexValidation, maxLength) {
18
- var _a;
19
- let feedback = '';
20
- if (input) {
21
- // Test regex
22
- if (regexValidation) {
23
- if (!regexValidation.expression.test(input)) {
24
- feedback =
25
- (_a = regexValidation.feedback) !== null && _a !== void 0 ? _a : `Input should match the specified regex ${regexValidation.expression}`;
26
- }
27
- }
28
- // Test max character limit
29
- if (maxLength) {
30
- if (input.length > maxLength) {
31
- feedback = 'Input exceeds maximum character limit.';
32
- }
33
- }
34
- }
35
- return feedback;
36
- }
37
- export default useValidationError;
38
- //# sourceMappingURL=useValidationError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useValidationError.js","sourceRoot":"","sources":["../../src/hooks/useValidationError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,SAAS,kBAAkB,CACzB,KAAa,EACb,eAAuC,EACvC,SAAwB;;IAExB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,IAAI,KAAK,EAAE;QACT,aAAa;QACb,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBAC3C,QAAQ;oBACN,MAAA,eAAe,CAAC,QAAQ,mCACxB,0CAA0C,eAAe,CAAC,UAAU,EAAE,CAAC;aAC1E;SACF;QAED,2BAA2B;QAC3B,IAAI,SAAS,EAAE;YACb,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,EAAE;gBAC5B,QAAQ,GAAG,wCAAwC,CAAC;aACrD;SACF;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,2 +0,0 @@
1
- export type { AnswerExpression } from './answerExpression.interface';
2
- export type { CalculatedExpression } from './calculatedExpression.interface';
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- export {};
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
package/lib/setup-jest.js DELETED
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/setup-jest.ts"],"sourcesContent":["import '@testing-library/jest-dom';\n"],"names":[],"mappings":"AAAA,OAAO,4BAA4B"}
@@ -1,27 +0,0 @@
1
- import type { QuestionnaireResponse } from 'fhir/r4';
2
- import type { Diff } from 'deep-diff';
3
- export interface QuestionnaireResponseStoreType {
4
- sourceResponse: QuestionnaireResponse;
5
- updatableResponse: QuestionnaireResponse;
6
- formChangesHistory: (Diff<QuestionnaireResponse, QuestionnaireResponse>[] | null)[];
7
- buildSourceResponse: (response: QuestionnaireResponse) => void;
8
- setUpdatableResponseAsPopulated: (populatedResponse: QuestionnaireResponse) => void;
9
- updateResponse: (updatedResponse: QuestionnaireResponse) => void;
10
- setUpdatableResponseAsSaved: (savedResponse: QuestionnaireResponse) => void;
11
- setUpdatableResponseAsEmpty: (clearedResponse: QuestionnaireResponse) => void;
12
- destroySourceResponse: () => void;
13
- }
14
- declare const useQuestionnaireResponseStore: import("zustand/vanilla").StoreApi<QuestionnaireResponseStoreType> & {
15
- use: {
16
- sourceResponse: () => QuestionnaireResponse;
17
- updatableResponse: () => QuestionnaireResponse;
18
- formChangesHistory: () => (Diff<QuestionnaireResponse, QuestionnaireResponse>[] | null)[];
19
- buildSourceResponse: () => (response: QuestionnaireResponse) => void;
20
- setUpdatableResponseAsPopulated: () => (populatedResponse: QuestionnaireResponse) => void;
21
- updateResponse: () => (updatedResponse: QuestionnaireResponse) => void;
22
- setUpdatableResponseAsSaved: () => (savedResponse: QuestionnaireResponse) => void;
23
- setUpdatableResponseAsEmpty: () => (clearedResponse: QuestionnaireResponse) => void;
24
- destroySourceResponse: () => () => void;
25
- };
26
- };
27
- export default useQuestionnaireResponseStore;
@@ -1,49 +0,0 @@
1
- import { createStore } from 'zustand/vanilla';
2
- import { emptyResponse } from '../utils/emptyResource';
3
- import cloneDeep from 'lodash.clonedeep';
4
- import { diff } from 'deep-diff';
5
- import { createSelectors } from './selector';
6
- const questionnaireResponseStore = createStore()((set, get) => ({
7
- sourceResponse: cloneDeep(emptyResponse),
8
- updatableResponse: cloneDeep(emptyResponse),
9
- formChangesHistory: [],
10
- buildSourceResponse: (questionnaireResponse) => {
11
- set(() => ({
12
- sourceResponse: questionnaireResponse,
13
- updatableResponse: questionnaireResponse
14
- }));
15
- },
16
- setUpdatableResponseAsPopulated: (populatedResponse) => {
17
- var _a;
18
- const formChanges = (_a = diff(get().updatableResponse, populatedResponse)) !== null && _a !== void 0 ? _a : null;
19
- set(() => ({
20
- updatableResponse: populatedResponse,
21
- formChangesHistory: [...get().formChangesHistory, formChanges]
22
- }));
23
- },
24
- updateResponse: (updatedResponse) => {
25
- var _a;
26
- const formChanges = (_a = diff(get().updatableResponse, updatedResponse)) !== null && _a !== void 0 ? _a : null;
27
- set(() => ({
28
- updatableResponse: updatedResponse,
29
- formChangesHistory: [...get().formChangesHistory, formChanges]
30
- }));
31
- },
32
- setUpdatableResponseAsSaved: (savedResponse) => set(() => ({
33
- sourceResponse: savedResponse,
34
- updatableResponse: savedResponse,
35
- formChangesHistory: []
36
- })),
37
- setUpdatableResponseAsEmpty: (clearedResponse) => set(() => ({
38
- updatableResponse: clearedResponse,
39
- formChangesHistory: []
40
- })),
41
- destroySourceResponse: () => set(() => ({
42
- sourceResponse: cloneDeep(emptyResponse),
43
- updatableResponse: cloneDeep(emptyResponse),
44
- formChangesHistory: []
45
- }))
46
- }));
47
- const useQuestionnaireResponseStore = createSelectors(questionnaireResponseStore);
48
- export default useQuestionnaireResponseStore;
49
- //# sourceMappingURL=useQuestionnaireResponseStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useQuestionnaireResponseStore.js","sourceRoot":"","sources":["../../src/stores/useQuestionnaireResponseStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C,MAAM,0BAA0B,GAAG,WAAW,EAAkC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAC9F,cAAc,EAAE,SAAS,CAAC,aAAa,CAAC;IACxC,iBAAiB,EAAE,SAAS,CAAC,aAAa,CAAC;IAC3C,kBAAkB,EAAE,EAAE;IACtB,mBAAmB,EAAE,CAAC,qBAA4C,EAAE,EAAE;QACpE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YACT,cAAc,EAAE,qBAAqB;YACrC,iBAAiB,EAAE,qBAAqB;SACzC,CAAC,CAAC,CAAC;IACN,CAAC;IACD,+BAA+B,EAAE,CAAC,iBAAwC,EAAE,EAAE;;QAC5E,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,mCAAI,IAAI,CAAC;QAC7E,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YACT,iBAAiB,EAAE,iBAAiB;YACpC,kBAAkB,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC;SAC/D,CAAC,CAAC,CAAC;IACN,CAAC;IACD,cAAc,EAAE,CAAC,eAAsC,EAAE,EAAE;;QACzD,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC,mCAAI,IAAI,CAAC;QAC3E,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YACT,iBAAiB,EAAE,eAAe;YAClC,kBAAkB,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC;SAC/D,CAAC,CAAC,CAAC;IACN,CAAC;IACD,2BAA2B,EAAE,CAAC,aAAoC,EAAE,EAAE,CACpE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,cAAc,EAAE,aAAa;QAC7B,iBAAiB,EAAE,aAAa;QAChC,kBAAkB,EAAE,EAAE;KACvB,CAAC,CAAC;IACL,2BAA2B,EAAE,CAAC,eAAsC,EAAE,EAAE,CACtE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,iBAAiB,EAAE,eAAe;QAClC,kBAAkB,EAAE,EAAE;KACvB,CAAC,CAAC;IACL,qBAAqB,EAAE,GAAG,EAAE,CAC1B,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,cAAc,EAAE,SAAS,CAAC,aAAa,CAAC;QACxC,iBAAiB,EAAE,SAAS,CAAC,aAAa,CAAC;QAC3C,kBAAkB,EAAE,EAAE;KACvB,CAAC,CAAC;CACN,CAAC,CAAC,CAAC;AAEJ,MAAM,6BAA6B,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC;AAElF,eAAe,6BAA6B,CAAC"}
@@ -1,64 +0,0 @@
1
- import type { Coding, Questionnaire, QuestionnaireResponse, QuestionnaireResponseItemAnswer } from 'fhir/r4';
2
- import type { Variables } from '../interfaces/variables.interface';
3
- import type { LaunchContext } from '../interfaces/populate.interface';
4
- import type { CalculatedExpression } from '../interfaces/calculatedExpression.interface';
5
- import type { EnableWhenExpression, EnableWhenItems } from '../interfaces/enableWhen.interface';
6
- import type { AnswerExpression } from '../interfaces/answerExpression.interface';
7
- import type { Tabs } from '../interfaces/tab.interface';
8
- export interface QuestionnaireStoreType {
9
- sourceQuestionnaire: Questionnaire;
10
- itemTypes: Record<string, string>;
11
- tabs: Tabs;
12
- currentTabIndex: number;
13
- variables: Variables;
14
- launchContexts: Record<string, LaunchContext>;
15
- enableWhenItems: EnableWhenItems;
16
- enableWhenLinkedQuestions: Record<string, string[]>;
17
- enableWhenIsActivated: boolean;
18
- enableWhenExpressions: Record<string, EnableWhenExpression>;
19
- calculatedExpressions: Record<string, CalculatedExpression>;
20
- answerExpressions: Record<string, AnswerExpression>;
21
- processedValueSetCodings: Record<string, Coding[]>;
22
- processedValueSetUrls: Record<string, string>;
23
- cachedValueSetCodings: Record<string, Coding[]>;
24
- fhirPathContext: Record<string, any>;
25
- buildSourceQuestionnaire: (questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>, terminologyServerUrl?: string) => Promise<void>;
26
- destroySourceQuestionnaire: () => void;
27
- switchTab: (newTabIndex: number) => void;
28
- markTabAsComplete: (tabLinkId: string) => void;
29
- updateEnableWhenItem: (linkId: string, newAnswer: QuestionnaireResponseItemAnswer[]) => void;
30
- toggleEnableWhenActivation: (isActivated: boolean) => void;
31
- updateExpressions: (updatedResponse: QuestionnaireResponse) => void;
32
- addCodingToCache: (valueSetUrl: string, codings: Coding[]) => void;
33
- updatePopulatedProperties: (populatedResponse: QuestionnaireResponse, persistTabIndex?: boolean) => QuestionnaireResponse;
34
- }
35
- declare const useQuestionnaireStore: import("zustand/vanilla").StoreApi<QuestionnaireStoreType> & {
36
- use: {
37
- sourceQuestionnaire: () => Questionnaire;
38
- itemTypes: () => Record<string, string>;
39
- tabs: () => Tabs;
40
- currentTabIndex: () => number;
41
- variables: () => Variables;
42
- launchContexts: () => Record<string, LaunchContext>;
43
- enableWhenItems: () => EnableWhenItems;
44
- enableWhenLinkedQuestions: () => Record<string, string[]>;
45
- enableWhenIsActivated: () => boolean;
46
- enableWhenExpressions: () => Record<string, EnableWhenExpression>;
47
- calculatedExpressions: () => Record<string, CalculatedExpression>;
48
- answerExpressions: () => Record<string, AnswerExpression>;
49
- processedValueSetCodings: () => Record<string, Coding[]>;
50
- processedValueSetUrls: () => Record<string, string>;
51
- cachedValueSetCodings: () => Record<string, Coding[]>;
52
- fhirPathContext: () => Record<string, any>;
53
- buildSourceQuestionnaire: () => (questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>, terminologyServerUrl?: string) => Promise<void>;
54
- destroySourceQuestionnaire: () => () => void;
55
- switchTab: () => (newTabIndex: number) => void;
56
- markTabAsComplete: () => (tabLinkId: string) => void;
57
- updateEnableWhenItem: () => (linkId: string, newAnswer: QuestionnaireResponseItemAnswer[]) => void;
58
- toggleEnableWhenActivation: () => (isActivated: boolean) => void;
59
- updateExpressions: () => (updatedResponse: QuestionnaireResponse) => void;
60
- addCodingToCache: () => (valueSetUrl: string, codings: Coding[]) => void;
61
- updatePopulatedProperties: () => (populatedResponse: QuestionnaireResponse, persistTabIndex?: boolean) => QuestionnaireResponse;
62
- };
63
- };
64
- export default useQuestionnaireStore;