@aehrc/smart-forms-renderer 0.12.0 → 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 (324) 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/Tables/GroupTable.js +0 -1
  56. package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
  57. package/lib/components/FormComponents/Tables/GroupTableRow.js +3 -3
  58. package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
  59. package/lib/components/FormComponents/Tables/GroupTableView.js +1 -1
  60. package/lib/components/FormComponents/Tables/GroupTableView.js.map +1 -1
  61. package/lib/components/FormComponents/Tables/SelectRowButton.d.ts +1 -0
  62. package/lib/components/FormComponents/Tables/SelectRowButton.js +2 -2
  63. package/lib/components/FormComponents/Tables/SelectRowButton.js.map +1 -1
  64. package/lib/components/FormComponents/TextItem/TextItem.js +4 -4
  65. package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
  66. package/lib/components/FormComponents/TimeItem/TimeItem.js +2 -2
  67. package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
  68. package/lib/components/FormComponents/UrlItem/UrlItem.js +4 -4
  69. package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
  70. package/lib/components/Renderer/BaseRenderer.js +9 -1
  71. package/lib/components/Renderer/BaseRenderer.js.map +1 -1
  72. package/lib/components/Renderer/FormBodyCollapsible.d.ts +2 -2
  73. package/lib/components/Renderer/FormBodyCollapsible.js +2 -2
  74. package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -1
  75. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.d.ts +2 -2
  76. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js +2 -2
  77. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js.map +1 -1
  78. package/lib/components/Renderer/FormBodyTabbed.d.ts +2 -2
  79. package/lib/components/Renderer/FormBodyTabbed.js +2 -2
  80. package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
  81. package/lib/components/Renderer/FormTopLevelItem.d.ts +2 -2
  82. package/lib/components/Renderer/FormTopLevelItem.js +4 -4
  83. package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
  84. package/lib/components/Renderer/SmartFormsRenderer.d.ts +1 -0
  85. package/lib/components/Renderer/SmartFormsRenderer.js +2 -2
  86. package/lib/components/Renderer/SmartFormsRenderer.js.map +1 -1
  87. package/lib/hooks/useInitialiseRenderer.d.ts +1 -1
  88. package/lib/hooks/useInitialiseRenderer.js +4 -3
  89. package/lib/hooks/useInitialiseRenderer.js.map +1 -1
  90. package/lib/hooks/useRenderingExtensions.d.ts +2 -0
  91. package/lib/hooks/useRenderingExtensions.js +16 -11
  92. package/lib/hooks/useRenderingExtensions.js.map +1 -1
  93. package/lib/hooks/useValidationFeedback.d.ts +3 -0
  94. package/lib/hooks/useValidationFeedback.js +37 -0
  95. package/lib/hooks/useValidationFeedback.js.map +1 -0
  96. package/lib/stores/questionnaireResponseStore.d.ts +8 -1
  97. package/lib/stores/questionnaireResponseStore.js +22 -0
  98. package/lib/stores/questionnaireResponseStore.js.map +1 -1
  99. package/lib/stores/questionnaireStore.d.ts +4 -2
  100. package/lib/stores/questionnaireStore.js +4 -2
  101. package/lib/stores/questionnaireStore.js.map +1 -1
  102. package/lib/utils/itemControl.d.ts +1 -27
  103. package/lib/utils/itemControl.js +0 -49
  104. package/lib/utils/itemControl.js.map +1 -1
  105. package/lib/utils/mapItem.d.ts +2 -0
  106. package/lib/utils/mapItem.js +2 -0
  107. package/lib/utils/mapItem.js.map +1 -1
  108. package/lib/utils/validateQuestionnaire.d.ts +23 -0
  109. package/lib/utils/validateQuestionnaire.js +183 -0
  110. package/lib/utils/validateQuestionnaire.js.map +1 -0
  111. package/package.json +2 -2
  112. package/src/components/Box.styles.ts +31 -1
  113. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +6 -2
  114. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +19 -23
  115. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +15 -18
  116. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +16 -19
  117. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +15 -19
  118. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +17 -21
  119. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +15 -19
  120. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +17 -21
  121. package/src/components/FormComponents/CustomDateItem/CustomDateItem.tsx +7 -2
  122. package/src/components/FormComponents/DateItem/DateItem.tsx +7 -2
  123. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +7 -2
  124. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +9 -3
  125. package/src/components/FormComponents/IntegerItem/IntegerField.tsx +1 -0
  126. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +9 -3
  127. package/{lib/components/BackToTopButton/BackToTopButton.js → src/components/FormComponents/ItemParts/ItemExtensionLabels.tsx} +23 -15
  128. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +14 -9
  129. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +21 -25
  130. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +20 -23
  131. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +18 -22
  132. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +16 -20
  133. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +17 -21
  134. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +8 -4
  135. package/src/components/FormComponents/SliderItem/SliderItem.tsx +6 -2
  136. package/src/components/FormComponents/StringItem/StringItem.tsx +9 -3
  137. package/src/components/FormComponents/Tables/GroupTable.tsx +0 -2
  138. package/src/components/FormComponents/Tables/GroupTableRow.tsx +6 -2
  139. package/src/components/FormComponents/Tables/GroupTableView.tsx +1 -0
  140. package/src/components/FormComponents/Tables/SelectRowButton.tsx +9 -2
  141. package/src/components/FormComponents/TextItem/TextItem.tsx +9 -3
  142. package/src/components/FormComponents/TimeItem/TimeItem.tsx +7 -2
  143. package/src/components/FormComponents/UrlItem/UrlItem.tsx +9 -3
  144. package/src/components/Renderer/BaseRenderer.tsx +12 -0
  145. package/src/components/Renderer/FormBodyCollapsible.tsx +9 -3
  146. package/src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx +10 -3
  147. package/src/components/Renderer/FormBodyTabbed.tsx +9 -3
  148. package/src/components/Renderer/FormTopLevelItem.tsx +13 -3
  149. package/src/components/Renderer/SmartFormsRenderer.tsx +5 -2
  150. package/src/hooks/useInitialiseRenderer.ts +6 -3
  151. package/src/hooks/useRenderingExtensions.ts +17 -11
  152. package/src/hooks/{useValidationError.ts → useValidationFeedback.ts} +23 -21
  153. package/src/stores/questionnaireResponseStore.ts +36 -1
  154. package/src/stores/questionnaireStore.ts +8 -3
  155. package/src/stories/SmartFormsRenderer.stories.ts +16 -0
  156. package/src/utils/itemControl.ts +1 -67
  157. package/src/utils/mapItem.ts +2 -0
  158. package/src/utils/validateQuestionnaire.ts +273 -0
  159. package/lib/components/BackToTopButton/BackToTopButton.d.ts +0 -7
  160. package/lib/components/BackToTopButton/BackToTopButton.js.map +0 -1
  161. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.d.ts +0 -18
  162. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js +0 -31
  163. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js.map +0 -1
  164. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.d.ts +0 -9
  165. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js +0 -75
  166. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js.map +0 -1
  167. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.d.ts +0 -9
  168. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js +0 -75
  169. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js.map +0 -1
  170. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.d.ts +0 -5
  171. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js +0 -27
  172. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js.map +0 -1
  173. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.d.ts +0 -9
  174. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js +0 -71
  175. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js.map +0 -1
  176. package/lib/components/FormComponents/DateItem/DatePicker.d.ts +0 -2
  177. package/lib/components/FormComponents/DateItem/DatePicker.js +0 -42
  178. package/lib/components/FormComponents/DateItem/DatePicker.js.map +0 -1
  179. package/lib/components/FormComponents/DateItem/DatePickerField.d.ts +0 -8
  180. package/lib/components/FormComponents/DateItem/DatePickerField.js.map +0 -1
  181. package/lib/components/FormComponents/DisplayItem/DisplayBox.d.ts +0 -0
  182. package/lib/components/FormComponents/DisplayItem/DisplayBox.js +0 -2
  183. package/lib/components/FormComponents/DisplayItem/DisplayBox.js.map +0 -1
  184. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.d.ts +0 -4
  185. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js +0 -35
  186. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js.map +0 -1
  187. package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.d.ts +0 -10
  188. package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js +0 -73
  189. package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js.map +0 -1
  190. package/lib/components/FormComponents/GroupItem/ItemSwitcher.d.ts +0 -10
  191. package/lib/components/FormComponents/GroupItem/ItemSwitcher.js +0 -81
  192. package/lib/components/FormComponents/GroupItem/ItemSwitcher.js.map +0 -1
  193. package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.d.ts +0 -10
  194. package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js +0 -45
  195. package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js.map +0 -1
  196. package/lib/components/FormComponents/IntegerItem/SliderItem.d.ts +0 -9
  197. package/lib/components/FormComponents/IntegerItem/SliderItem.js +0 -75
  198. package/lib/components/FormComponents/IntegerItem/SliderItem.js.map +0 -1
  199. package/lib/components/FormComponents/ItemParts/RadioButtons.d.ts +0 -8
  200. package/lib/components/FormComponents/ItemParts/RadioButtons.js +0 -37
  201. package/lib/components/FormComponents/ItemParts/RadioButtons.js.map +0 -1
  202. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.d.ts +0 -8
  203. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js +0 -37
  204. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js.map +0 -1
  205. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts +0 -0
  206. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js +0 -2
  207. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map +0 -1
  208. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +0 -0
  209. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +0 -2
  210. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map +0 -1
  211. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +0 -10
  212. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +0 -30
  213. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +0 -1
  214. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.d.ts +0 -4
  215. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js +0 -35
  216. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js.map +0 -1
  217. package/lib/components/FormComponents/Tables/AddItemButton.d.ts +0 -8
  218. package/lib/components/FormComponents/Tables/AddItemButton.js +0 -28
  219. package/lib/components/FormComponents/Tables/AddItemButton.js.map +0 -1
  220. package/lib/components/FormComponents/Tables/DeleteRowButton.d.ts +0 -10
  221. package/lib/components/FormComponents/Tables/DeleteRowButton.js +0 -32
  222. package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +0 -1
  223. package/lib/components/FormComponents/Tables/GroupTableRows.d.ts +0 -17
  224. package/lib/components/FormComponents/Tables/GroupTableRows.js +0 -45
  225. package/lib/components/FormComponents/Tables/GroupTableRows.js.map +0 -1
  226. package/lib/components/FormComponents/Tables/GroupTableTestRow.d.ts +0 -22
  227. package/lib/components/FormComponents/Tables/GroupTableTestRow.js +0 -43
  228. package/lib/components/FormComponents/Tables/GroupTableTestRow.js.map +0 -1
  229. package/lib/components/FormComponents/Tables/QItemGroupTable.d.ts +0 -10
  230. package/lib/components/FormComponents/Tables/QItemGroupTable.js +0 -109
  231. package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +0 -1
  232. package/lib/components/FormComponents/Tables/QItemGroupTableRow.d.ts +0 -10
  233. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +0 -46
  234. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +0 -1
  235. package/lib/components/FormComponents/Typography.styles.d.ts +0 -6
  236. package/lib/components/FormComponents/Typography.styles.js +0 -24
  237. package/lib/components/FormComponents/Typography.styles.js.map +0 -1
  238. package/lib/hooks/useBackToTop.d.ts +0 -2
  239. package/lib/hooks/useBackToTop.js +0 -26
  240. package/lib/hooks/useBackToTop.js.map +0 -1
  241. package/lib/hooks/useDateSeparatorValidation.d.ts +0 -2
  242. package/lib/hooks/useDateSeparatorValidation.js +0 -25
  243. package/lib/hooks/useDateSeparatorValidation.js.map +0 -1
  244. package/lib/hooks/useDecimalUpdateFromProp.d.ts +0 -2
  245. package/lib/hooks/useDecimalUpdateFromProp.js +0 -29
  246. package/lib/hooks/useDecimalUpdateFromProp.js.map +0 -1
  247. package/lib/hooks/useIntegerUpdateFromProp.d.ts +0 -2
  248. package/lib/hooks/useIntegerUpdateFromProp.js +0 -29
  249. package/lib/hooks/useIntegerUpdateFromProp.js.map +0 -1
  250. package/lib/hooks/useMinimalStringCalculatedExpression.d.ts +0 -11
  251. package/lib/hooks/useMinimalStringCalculatedExpression.js +0 -49
  252. package/lib/hooks/useMinimalStringCalculatedExpression.js.map +0 -1
  253. package/lib/hooks/useNumberUpdateFromProp.d.ts +0 -2
  254. package/lib/hooks/useNumberUpdateFromProp.js +0 -29
  255. package/lib/hooks/useNumberUpdateFromProp.js.map +0 -1
  256. package/lib/hooks/useRepeatItemState.d.ts +0 -5
  257. package/lib/hooks/useRepeatItemState.js +0 -35
  258. package/lib/hooks/useRepeatItemState.js.map +0 -1
  259. package/lib/hooks/useRepeatItemUpdateFromProp.d.ts +0 -2
  260. package/lib/hooks/useRepeatItemUpdateFromProp.js +0 -29
  261. package/lib/hooks/useRepeatItemUpdateFromProp.js.map +0 -1
  262. package/lib/hooks/useStringField.d.ts +0 -2
  263. package/lib/hooks/useStringField.js +0 -29
  264. package/lib/hooks/useStringField.js.map +0 -1
  265. package/lib/hooks/useStringUpdateFromProp.d.ts +0 -2
  266. package/lib/hooks/useStringUpdateFromProp.js +0 -29
  267. package/lib/hooks/useStringUpdateFromProp.js.map +0 -1
  268. package/lib/hooks/useValidationError.d.ts +0 -3
  269. package/lib/hooks/useValidationError.js +0 -38
  270. package/lib/hooks/useValidationError.js.map +0 -1
  271. package/lib/interfaces/index.d.ts +0 -2
  272. package/lib/interfaces/index.js +0 -18
  273. package/lib/interfaces/index.js.map +0 -1
  274. package/lib/setup-jest.js +0 -1
  275. package/lib/setup-jest.js.map +0 -1
  276. package/lib/stores/useQuestionnaireResponseStore.d.ts +0 -27
  277. package/lib/stores/useQuestionnaireResponseStore.js +0 -49
  278. package/lib/stores/useQuestionnaireResponseStore.js.map +0 -1
  279. package/lib/stores/useQuestionnaireStore.d.ts +0 -64
  280. package/lib/stores/useQuestionnaireStore.js +0 -173
  281. package/lib/stores/useQuestionnaireStore.js.map +0 -1
  282. package/lib/stores/useSmartConfigStore.d.ts +0 -14
  283. package/lib/stores/useSmartConfigStore.js +0 -13
  284. package/lib/stores/useSmartConfigStore.js.map +0 -1
  285. package/lib/stores/useTerminologyServerStore.d.ts +0 -7
  286. package/lib/stores/useTerminologyServerStore.js +0 -25
  287. package/lib/stores/useTerminologyServerStore.js.map +0 -1
  288. package/lib/stories/MedicalHistoryTable.stories.js +0 -45
  289. package/lib/stories/MedicalHistoryTable.stories.js.map +0 -1
  290. package/lib/stories/SmartFormsRenderer.stories.js +0 -103
  291. package/lib/stories/SmartFormsRenderer.stories.js.map +0 -1
  292. package/lib/test.d.ts +0 -4
  293. package/lib/test.js +0 -18
  294. package/lib/test.js.map +0 -1
  295. package/lib/theme/overrides/Backdrop.d.ts +0 -13
  296. package/lib/theme/overrides/Backdrop.js +0 -32
  297. package/lib/theme/overrides/Backdrop.js.map +0 -1
  298. package/lib/theme/overrides/Typography.d.ts +0 -13
  299. package/lib/theme/overrides/Typography.js +0 -31
  300. package/lib/theme/overrides/Typography.js.map +0 -1
  301. package/lib/utils/formChangesOld.d.ts +0 -18
  302. package/lib/utils/formChangesOld.js +0 -91
  303. package/lib/utils/formChangesOld.js.map +0 -1
  304. package/lib/utils/initialiseForm.d.ts +0 -22
  305. package/lib/utils/initialiseForm.js +0 -53
  306. package/lib/utils/initialiseForm.js.map +0 -1
  307. package/lib/utils/launchContext.d.ts +0 -0
  308. package/lib/utils/launchContext.js +0 -2
  309. package/lib/utils/launchContext.js.map +0 -1
  310. package/lib/utils/populateInputParams.d.ts +0 -8
  311. package/lib/utils/populateInputParams.js +0 -193
  312. package/lib/utils/populateInputParams.js.map +0 -1
  313. package/lib/utils/removeHidden.d.ts +0 -16
  314. package/lib/utils/removeHidden.js +0 -105
  315. package/lib/utils/removeHidden.js.map +0 -1
  316. package/lib/utils/repopulate.d.ts +0 -9
  317. package/lib/utils/repopulate.js +0 -133
  318. package/lib/utils/repopulate.js.map +0 -1
  319. package/lib/utils/repopulateGenerateItems.d.ts +0 -9
  320. package/lib/utils/repopulateGenerateItems.js +0 -133
  321. package/lib/utils/repopulateGenerateItems.js.map +0 -1
  322. package/lib/utils/repopulateRepeatGroup.d.ts +0 -4
  323. package/lib/utils/repopulateRepeatGroup.js +0 -62
  324. package/lib/utils/repopulateRepeatGroup.js.map +0 -1
@@ -1,45 +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 React from 'react';
18
- import { createEmptyQrItem } from '../../../utils/qrItem';
19
- import GroupTableRow from './GroupTableRow';
20
- import { DragDropContext, Droppable } from 'react-beautiful-dnd';
21
- import { reorderRows } from '../../../utils/groupTable';
22
- function GroupTableRows(props) {
23
- const { tableQItem, readOnly, tableRows, selectedIds, qItemsIndexMap, showMinimalView, parentIsReadOnly, onRowChange, onRemoveRow, onSelectRow, onReorderRows } = props;
24
- function onDragEnd(result) {
25
- if (!result.destination) {
26
- return;
27
- }
28
- if (result.destination.index === result.source.index) {
29
- return;
30
- }
31
- const reorderedRows = reorderRows(tableRows, result.source.index, result.destination.index);
32
- onReorderRows(reorderedRows);
33
- }
34
- return (React.createElement(DragDropContext, { onDragEnd: onDragEnd },
35
- React.createElement(Droppable, { droppableId: "list" }, tableRows.map(({ nanoId, qrItem: nullableQrItem }, index) => {
36
- const itemIsSelected = selectedIds.indexOf(nanoId) !== -1;
37
- const answeredQrItem = createEmptyQrItem(tableQItem);
38
- if (nullableQrItem) {
39
- answeredQrItem.item = nullableQrItem.item;
40
- }
41
- return (React.createElement(GroupTableRow, { key: nanoId, index: index, nanoId: nanoId, tableQItem: tableQItem, answeredQrItem: answeredQrItem, nullableQrItem: nullableQrItem, readOnly: readOnly, tableRows: tableRows, itemIsSelected: itemIsSelected, selectedIds: selectedIds, qItemsIndexMap: qItemsIndexMap, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onRowChange: onRowChange, onRemoveRow: onRemoveRow, onSelectRow: onSelectRow }));
42
- }))));
43
- }
44
- export default GroupTableRows;
45
- //# sourceMappingURL=GroupTableRows.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupTableRows.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableRows.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D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MAAM,EACd,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;QACJ,CAAC,CAAC,CACQ,CACI,CACnB,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithParentIsReadOnlyAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
4
- import { TableRowProps } from '@mui/material/TableRow';
5
- import { GroupTableRowModel } from '../../../interfaces/groupTable.interface';
6
- interface GroupTableTestRowProps extends PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute, TableRowProps {
7
- nanoId: string;
8
- index: number;
9
- tableQItem: QuestionnaireItem;
10
- answeredQrItem: QuestionnaireResponseItem;
11
- nullableQrItem: QuestionnaireResponseItem | null;
12
- readOnly: boolean;
13
- tableRows: GroupTableRowModel[];
14
- itemIsSelected: boolean;
15
- selectedIds: string[];
16
- qItemsIndexMap: Record<string, number>;
17
- onRowChange: (newQrRow: QuestionnaireResponseItem, index: number) => void;
18
- onRemoveRow: (index: number) => void;
19
- onSelectRow: (nanoId: string) => void;
20
- }
21
- declare function GroupTableTestRow(props: GroupTableTestRowProps): React.JSX.Element;
22
- export default GroupTableTestRow;
@@ -1,43 +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 React from 'react';
18
- import TableRow from '@mui/material/TableRow';
19
- import { alpha } from '@mui/material/styles';
20
- import SelectRowButton from './SelectRowButton';
21
- import GroupTableRow from './GroupTableRow';
22
- import RemoveRowButton from './RemoveRowButton';
23
- import { useDrag } from 'react-dnd';
24
- function GroupTableTestRow(props) {
25
- const { nanoId, index, tableQItem, answeredQrItem, nullableQrItem, readOnly, tableRows, itemIsSelected, qItemsIndexMap, showMinimalView, parentIsReadOnly, onRowChange, onRemoveRow, onSelectRow } = props;
26
- const [{ isDragging }, drag, dragPreview] = useDrag(() => ({
27
- // "type" is required. It is used by the "accept" specification of drop targets.
28
- type: 'ROW',
29
- // The collect function utilizes a "monitor" instance (see the Overview for what this is)
30
- // to pull important pieces of state from the DnD system.
31
- collect: (monitor) => ({
32
- isDragging: monitor.isDragging()
33
- })
34
- }));
35
- return (React.createElement(TableRow, { ref: drag, sx: {
36
- bgcolor: itemIsSelected ? alpha('#C7DBFF', 0.25) : 'common.white'
37
- } },
38
- showMinimalView ? null : (React.createElement(SelectRowButton, { isSelected: itemIsSelected, onSelectItem: () => onSelectRow(nanoId) })),
39
- React.createElement(GroupTableRow, { qItem: tableQItem, qrItem: answeredQrItem, qItemsIndexMap: qItemsIndexMap, parentIsReadOnly: parentIsReadOnly, onQrItemChange: (newQrGroup) => onRowChange(newQrGroup, index) }),
40
- showMinimalView ? null : (React.createElement(RemoveRowButton, { nullableQrItem: nullableQrItem, numOfRows: tableRows.length, readOnly: readOnly, onRemoveItem: () => onRemoveRow(index) }))));
41
- }
42
- export default GroupTableTestRow;
43
- //# sourceMappingURL=GroupTableTestRow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupTableTestRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableTestRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,QAA2B,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,SAAS,iBAAiB,CAAC,KAA6B;IACtD,MAAM,EACJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,QAAQ,EACR,SAAS,EACT,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,WAAW,EACZ,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACzD,gFAAgF;QAChF,IAAI,EAAE,KAAK;QACX,yFAAyF;QACzF,yDAAyD;QACzD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;SACjC,CAAC;KACH,CAAC,CAAC,CAAC;IAEJ,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,IAAI,EACT,EAAE,EAAE;YACF,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc;SAClE;QACA,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,oBAAC,eAAe,IAAC,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,GAAI,CACzF;QACD,oBAAC,aAAa,IACZ,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,GAC9D;QACD,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,oBAAC,eAAe,IACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,CAAC,MAAM,EAC3B,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,GACtC,CACH,CACQ,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface Props extends PropsWithQrRepeatGroupChangeHandler {
5
- qItem: QuestionnaireItem;
6
- qrItems: QuestionnaireResponseItem[];
7
- groupCardElevation: number;
8
- }
9
- declare function QItemGroupTable(props: Props): React.JSX.Element | null;
10
- export default QItemGroupTable;
@@ -1,109 +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 React, { useMemo, useState } from 'react';
18
- import Button from '@mui/material/Button';
19
- import Divider from '@mui/material/Divider';
20
- import Paper from '@mui/material/Paper';
21
- import Stack from '@mui/material/Stack';
22
- import Table from '@mui/material/Table';
23
- import TableBody from '@mui/material/TableBody';
24
- import TableCell from '@mui/material/TableCell';
25
- import TableContainer from '@mui/material/TableContainer';
26
- import TableHead from '@mui/material/TableHead';
27
- import TableRow from '@mui/material/TableRow';
28
- import Typography from '@mui/material/Typography';
29
- import AddIcon from '@mui/icons-material/Add';
30
- import QItemGroupTableRow from './QItemGroupTableRow';
31
- import { HeaderTableCell } from './Table.styles';
32
- import { QGroupContainerBox } from '../../Box.styles';
33
- import { mapQItemsIndex } from '../../../utils/mapItem';
34
- import useInitialiseGroupTable from '../../../hooks/useInitialiseGroupTable';
35
- import { nanoid } from 'nanoid';
36
- import { createEmptyQrItem } from '../../../utils/qrItem';
37
- import DeleteRowButton from './DeleteRowButton';
38
- import LabelWrapper from '../ItemParts/ItemLabelWrapper';
39
- function QItemGroupTable(props) {
40
- const { qItem, qrItems, groupCardElevation, onQrRepeatGroupChange } = props;
41
- const initialisedGroupTables = useInitialiseGroupTable(qrItems);
42
- const [tableRows, setTableRows] = useState(initialisedGroupTables);
43
- // Generate item labels as table headers
44
- const qItems = qItem.item;
45
- const itemLabels = useMemo(() => { var _a; return (_a = qItems === null || qItems === void 0 ? void 0 : qItems.map((item) => { var _a; return (_a = item.text) !== null && _a !== void 0 ? _a : ''; })) !== null && _a !== void 0 ? _a : []; }, [qItems]);
46
- const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
47
- // Check if there are columns within the group table
48
- if (!qItems || qItems.length === 0) {
49
- return null;
50
- }
51
- // Event Handlers
52
- function handleRowChange(newQrRow, index) {
53
- const updatedTableRows = [...tableRows];
54
- if (newQrRow.item) {
55
- updatedTableRows[index].qrItem = {
56
- linkId: newQrRow.linkId,
57
- text: newQrRow.text,
58
- item: newQrRow.item
59
- };
60
- }
61
- setTableRows(updatedTableRows);
62
- onQrRepeatGroupChange({
63
- linkId: qItem.linkId,
64
- qrItems: updatedTableRows.flatMap((singleRow) => (singleRow.qrItem ? [singleRow.qrItem] : []))
65
- });
66
- }
67
- function handleDeleteRow(index) {
68
- const updatedTableRows = [...tableRows];
69
- updatedTableRows.splice(index, 1);
70
- setTableRows(updatedTableRows);
71
- onQrRepeatGroupChange({
72
- linkId: qItem.linkId,
73
- qrItems: updatedTableRows.flatMap((singleRow) => (singleRow.qrItem ? [singleRow.qrItem] : []))
74
- });
75
- }
76
- function handleAddRow() {
77
- setTableRows([
78
- ...tableRows,
79
- {
80
- nanoId: nanoid(),
81
- qrItem: null
82
- }
83
- ]);
84
- }
85
- return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
86
- React.createElement(Typography, { fontSize: 13, variant: "h6" },
87
- React.createElement(LabelWrapper, { qItem: qItem })),
88
- React.createElement(Divider, { sx: { my: 1 }, light: true }),
89
- React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
90
- React.createElement(Table, null,
91
- React.createElement("caption", null,
92
- React.createElement(Stack, { direction: "row", justifyContent: "end" },
93
- React.createElement(Button, { variant: "contained", size: "small", startIcon: React.createElement(AddIcon, null), onClick: handleAddRow }, "Add Row"))),
94
- React.createElement(TableHead, null,
95
- React.createElement(TableRow, null,
96
- itemLabels.map((itemLabel) => (React.createElement(HeaderTableCell, { key: itemLabel }, itemLabel))),
97
- React.createElement(TableCell, null))),
98
- React.createElement(TableBody, null, tableRows.map(({ nanoId, qrItem: nullableQrItem }, index) => {
99
- const answeredQrItem = createEmptyQrItem(qItem);
100
- if (nullableQrItem) {
101
- answeredQrItem.item = nullableQrItem.item;
102
- }
103
- return (React.createElement(TableRow, { key: nanoId },
104
- React.createElement(QItemGroupTableRow, { qItem: qItem, qrItem: answeredQrItem, qItemsIndexMap: qItemsIndexMap, onQrItemChange: (newQrGroup) => handleRowChange(newQrGroup, index) }),
105
- React.createElement(DeleteRowButton, { nullableQrItem: nullableQrItem, numOfRows: tableRows.length, onDeleteItem: () => handleDeleteRow(index) })));
106
- }))))));
107
- }
108
- export default QItemGroupTable;
109
- //# sourceMappingURL=QItemGroupTable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemGroupTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,uBAAuB,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAA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CACO,CACE,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
5
- qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
7
- qItemsIndexMap: Record<string, number>;
8
- }
9
- declare function QItemGroupTableRow(props: Props): React.JSX.Element | null;
10
- export default QItemGroupTableRow;
@@ -1,46 +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 React from 'react';
18
- import { createQrGroup, updateQrGroup } from '../../../utils/qrItem';
19
- import SingleItem from '../SingleItem/SingleItem';
20
- import { getQrItemsIndex } from '../../../utils/mapItem';
21
- import { StandardTableCell } from './Table.styles';
22
- function QItemGroupTableRow(props) {
23
- const { qItem, qrItem, qItemsIndexMap, onQrItemChange } = props;
24
- const rowItems = qItem.item;
25
- const row = qrItem && qrItem.item ? qrItem : createQrGroup(qItem);
26
- const rowQrItems = row.item;
27
- if (!rowItems || !rowQrItems) {
28
- return null;
29
- }
30
- function handleQrRowItemChange(newQrRowItem) {
31
- const qrRow = Object.assign({}, row);
32
- updateQrGroup(newQrRowItem, null, qrRow, qItemsIndexMap);
33
- onQrItemChange(qrRow);
34
- }
35
- const qrItemsByIndex = getQrItemsIndex(rowItems, rowQrItems, qItemsIndexMap);
36
- return (React.createElement(React.Fragment, null, rowItems.map((rowItem, index) => {
37
- const qrItem = qrItemsByIndex[index];
38
- if (Array.isArray(qrItem)) {
39
- return null;
40
- }
41
- return (React.createElement(StandardTableCell, { key: index, numOfColumns: rowItems.length, isFirst: index === 0 },
42
- React.createElement(SingleItem, { key: qItem.linkId, qItem: rowItem, qrItem: qrItem, isRepeated: true, isTabled: true, onQrItemChange: handleQrRowItemChange })));
43
- })));
44
- }
45
- export default QItemGroupTableRow;
46
- //# sourceMappingURL=QItemGroupTableRow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemGroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnD,SAAS,kBAAkB,CAAC,KAAY;IACtC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEhE,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC;IAC5B,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC;IAE5B,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IAED,SAAS,qBAAqB,CAAC,YAAuC;QACpE,MAAM,KAAK,qBAAmC,GAAG,CAAE,CAAC;QACpD,aAAa,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;QACzD,cAAc,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,cAAc,GAAG,eAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IAE7E,OAAO,CACL,0CACG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QAErC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,CACL,oBAAC,iBAAiB,IAAC,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC;YAChF,oBAAC,UAAU,IACT,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,EACd,cAAc,EAAE,qBAAqB,GACrC,CACgB,CACrB,CAAC;IACJ,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const QGroupHeadingTypography: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
3
- ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
4
- }, "display" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "style" | "className" | "children" | "sx" | "classes" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variant" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
5
- isTabHeading?: boolean | undefined;
6
- }, {}, {}>;
@@ -1,24 +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 { styled } from '@mui/material/styles';
18
- import Typography from '@mui/material/Typography';
19
- export const QGroupHeadingTypography = styled(Typography, {
20
- shouldForwardProp: (prop) => prop !== 'isTabHeading'
21
- })(({ isTabHeading }) => ({
22
- fontSize: isTabHeading ? 16 : 15
23
- }));
24
- //# sourceMappingURL=Typography.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Typography.styles.js","sourceRoot":"","sources":["../../../src/components/FormComponents/Typography.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,UAAU,EAAE;IACxD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc;CACrD,CAAC,CAA6B,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IACpD,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;CACjC,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useBackToTop(): void;
2
- export default useBackToTop;
@@ -1,26 +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 { useLocation } from 'react-router-dom';
19
- function useBackToTop() {
20
- const { pathname } = useLocation();
21
- useEffect(() => {
22
- window.scrollTo(0, 0);
23
- }, [pathname]);
24
- }
25
- export default useBackToTop;
26
- //# sourceMappingURL=useBackToTop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBackToTop.js","sourceRoot":"","sources":["../../src/hooks/useBackToTop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,SAAS,YAAY;IACnB,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;IAEnC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- declare function useDateSeparatorValidation(input: string): string;
2
- export default useDateSeparatorValidation;
@@ -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;