@aehrc/smart-forms-renderer 0.5.0 → 0.6.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 (448) hide show
  1. package/lib/api/smartClient.d.ts +5 -0
  2. package/lib/api/smartClient.js +41 -0
  3. package/lib/api/smartClient.js.map +1 -0
  4. package/lib/components/Alert.styles.d.ts +4 -4
  5. package/lib/components/Alert.styles.js +2 -1
  6. package/lib/components/Alert.styles.js.map +1 -1
  7. package/lib/components/BackToTopButton/BackToTopButton.js +3 -1
  8. package/lib/components/BackToTopButton/BackToTopButton.js.map +1 -1
  9. package/lib/components/Box.styles.d.ts +9 -9
  10. package/lib/components/Box.styles.js +2 -1
  11. package/lib/components/Box.styles.js.map +1 -1
  12. package/lib/components/FormComponents/BooleanItem/BooleanField.js +2 -1
  13. package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
  14. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +1 -1
  15. package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.d.ts +9 -0
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +91 -0
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -0
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +11 -0
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +70 -0
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -0
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +11 -0
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +67 -0
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -0
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +9 -0
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +61 -0
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -0
  28. package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.d.ts +8 -0
  29. package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.js +25 -0
  30. package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.js.map +1 -0
  31. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +11 -0
  32. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +70 -0
  33. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -0
  34. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +11 -0
  35. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +73 -0
  36. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -0
  37. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.d.ts +8 -0
  38. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.js +25 -0
  39. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.js.map +1 -0
  40. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.d.ts +8 -0
  41. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.js +25 -0
  42. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.js.map +1 -0
  43. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.d.ts +8 -0
  44. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.js +25 -0
  45. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.js.map +1 -0
  46. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.d.ts +9 -0
  47. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +75 -0
  48. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -0
  49. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.d.ts +9 -0
  50. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +84 -0
  51. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -0
  52. package/lib/components/FormComponents/ChoiceItems/QItemChoice.d.ts +9 -0
  53. package/lib/components/FormComponents/ChoiceItems/QItemChoice.js +61 -0
  54. package/lib/components/FormComponents/ChoiceItems/QItemChoice.js.map +1 -0
  55. package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.d.ts +9 -0
  56. package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.js +89 -0
  57. package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.js.map +1 -0
  58. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.d.ts +11 -0
  59. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.js +70 -0
  60. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.js.map +1 -0
  61. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.d.ts +11 -0
  62. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.js +67 -0
  63. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.js.map +1 -0
  64. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.d.ts +11 -0
  65. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.js +70 -0
  66. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.js.map +1 -0
  67. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.d.ts +11 -0
  68. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.js +72 -0
  69. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.js.map +1 -0
  70. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.d.ts +8 -0
  71. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.js +25 -0
  72. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.js.map +1 -0
  73. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.d.ts +9 -0
  74. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.js +73 -0
  75. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.js.map +1 -0
  76. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.d.ts +9 -0
  77. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.js +82 -0
  78. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.js.map +1 -0
  79. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js +1 -1
  80. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js.map +1 -1
  81. package/lib/components/FormComponents/DecimalItem/DecimalField.js +1 -1
  82. package/lib/components/FormComponents/DecimalItem/DecimalField.js.map +1 -1
  83. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +1 -1
  84. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js.map +1 -1
  85. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.d.ts +3 -3
  86. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js +2 -1
  87. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js.map +1 -1
  88. package/lib/components/FormComponents/GridGroup/GridGroup.js +4 -1
  89. package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
  90. package/lib/components/FormComponents/GridGroup/GridRow.js +1 -1
  91. package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -1
  92. package/lib/components/FormComponents/GridGroup/GridTable.js +5 -1
  93. package/lib/components/FormComponents/GridGroup/GridTable.js.map +1 -1
  94. package/lib/components/FormComponents/GroupItem/GroupHeading.js +2 -1
  95. package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
  96. package/lib/components/FormComponents/GroupItem/GroupItem.styles.d.ts +3 -3
  97. package/lib/components/FormComponents/GroupItem/GroupItem.styles.js +2 -1
  98. package/lib/components/FormComponents/GroupItem/GroupItem.styles.js.map +1 -1
  99. package/lib/components/FormComponents/GroupItem/NextTabButton.js +1 -1
  100. package/lib/components/FormComponents/GroupItem/NextTabButton.js.map +1 -1
  101. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js +1 -1
  102. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js.map +1 -1
  103. package/lib/components/FormComponents/IntegerItem/IntegerField.js +1 -1
  104. package/lib/components/FormComponents/IntegerItem/IntegerField.js.map +1 -1
  105. package/lib/components/FormComponents/Item.styles.d.ts +4 -4
  106. package/lib/components/FormComponents/Item.styles.js +4 -1
  107. package/lib/components/FormComponents/Item.styles.js.map +1 -1
  108. package/lib/components/FormComponents/ItemParts/CheckboxSingle.d.ts +10 -0
  109. package/lib/components/FormComponents/ItemParts/CheckboxSingle.js +25 -0
  110. package/lib/components/FormComponents/ItemParts/CheckboxSingle.js.map +1 -0
  111. package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.d.ts +10 -0
  112. package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.js +35 -0
  113. package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.js.map +1 -0
  114. package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.d.ts +10 -0
  115. package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.js +35 -0
  116. package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.js.map +1 -0
  117. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +1 -1
  118. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js.map +1 -1
  119. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +1 -1
  120. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
  121. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +1 -1
  122. package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
  123. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +1 -1
  124. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
  125. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js +2 -1
  126. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js.map +1 -1
  127. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js +3 -1
  128. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js.map +1 -1
  129. package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js +3 -3
  130. package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js.map +1 -1
  131. package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.d.ts +10 -0
  132. package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.js +31 -0
  133. package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.js.map +1 -0
  134. package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.d.ts +10 -0
  135. package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.js +31 -0
  136. package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.js.map +1 -0
  137. package/lib/components/FormComponents/Lists.styles.d.ts +3 -3
  138. package/lib/components/FormComponents/Lists.styles.js +2 -2
  139. package/lib/components/FormComponents/Lists.styles.js.map +1 -1
  140. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.d.ts +9 -0
  141. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +111 -0
  142. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -0
  143. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +11 -0
  144. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +105 -0
  145. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -0
  146. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +9 -0
  147. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +49 -0
  148. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -0
  149. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +11 -0
  150. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +116 -0
  151. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -0
  152. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.d.ts +9 -0
  153. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +77 -0
  154. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -0
  155. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.d.ts +9 -0
  156. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +70 -0
  157. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -0
  158. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.d.ts +9 -0
  159. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.js +49 -0
  160. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.js.map +1 -0
  161. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.d.ts +9 -0
  162. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.js +109 -0
  163. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.js.map +1 -0
  164. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.d.ts +11 -0
  165. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.js +105 -0
  166. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.js.map +1 -0
  167. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.d.ts +11 -0
  168. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.js +116 -0
  169. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.js.map +1 -0
  170. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.d.ts +9 -0
  171. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.js +75 -0
  172. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.js.map +1 -0
  173. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.d.ts +9 -0
  174. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.js +68 -0
  175. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.js.map +1 -0
  176. package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js +5 -1
  177. package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js.map +1 -1
  178. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js +1 -1
  179. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js.map +1 -1
  180. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js +2 -1
  181. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js.map +1 -1
  182. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js +1 -1
  183. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js.map +1 -1
  184. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js +3 -1
  185. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js.map +1 -1
  186. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js +2 -1
  187. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js.map +1 -1
  188. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js +4 -1
  189. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js.map +1 -1
  190. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js +3 -1
  191. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js.map +1 -1
  192. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js +6 -1
  193. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js.map +1 -1
  194. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js +1 -1
  195. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js.map +1 -1
  196. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js +1 -1
  197. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js.map +1 -1
  198. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js +2 -1
  199. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js.map +1 -1
  200. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js +3 -1
  201. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map +1 -1
  202. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +2 -1
  203. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js.map +1 -1
  204. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +1 -1
  205. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +1 -1
  206. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +3 -1
  207. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
  208. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +1 -1
  209. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
  210. package/lib/components/FormComponents/RepeatItem/AddItemButton.js +2 -1
  211. package/lib/components/FormComponents/RepeatItem/AddItemButton.js.map +1 -1
  212. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +1 -1
  213. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +1 -1
  214. package/lib/components/FormComponents/RepeatItem/RepeatField.js +1 -1
  215. package/lib/components/FormComponents/RepeatItem/RepeatField.js.map +1 -1
  216. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +1 -1
  217. package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
  218. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.d.ts +7 -7
  219. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js +3 -1
  220. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js.map +1 -1
  221. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +5 -5
  222. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  223. package/lib/components/FormComponents/StringItem/StringField.js +1 -1
  224. package/lib/components/FormComponents/StringItem/StringField.js.map +1 -1
  225. package/lib/components/FormComponents/Tables/DeleteRowButton.js +2 -1
  226. package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +1 -1
  227. package/lib/components/FormComponents/Tables/QItemGroupTable.js +11 -1
  228. package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +1 -1
  229. package/lib/components/FormComponents/Tables/Table.styles.d.ts +5 -5
  230. package/lib/components/FormComponents/Tables/Table.styles.js +2 -1
  231. package/lib/components/FormComponents/Tables/Table.styles.js.map +1 -1
  232. package/lib/components/FormComponents/Textfield.styles.d.ts +2 -2
  233. package/lib/components/FormComponents/Textfield.styles.js +2 -1
  234. package/lib/components/FormComponents/Textfield.styles.js.map +1 -1
  235. package/lib/components/FormComponents/Typography.styles.d.ts +2 -2
  236. package/lib/components/FormComponents/Typography.styles.js +2 -1
  237. package/lib/components/FormComponents/Typography.styles.js.map +1 -1
  238. package/lib/components/FormComponents/UrlItem/UrlField.js +1 -1
  239. package/lib/components/FormComponents/UrlItem/UrlField.js.map +1 -1
  240. package/lib/components/Iconify/Iconify.d.ts +1 -1
  241. package/lib/components/Iconify/Iconify.js +1 -1
  242. package/lib/components/Iconify/Iconify.js.map +1 -1
  243. package/lib/components/Lists.styles.d.ts +3 -3
  244. package/lib/components/Lists.styles.js +2 -2
  245. package/lib/components/Lists.styles.js.map +1 -1
  246. package/lib/components/Renderer/BaseRenderer.d.ts +3 -0
  247. package/lib/components/Renderer/BaseRenderer.js +55 -0
  248. package/lib/components/Renderer/BaseRenderer.js.map +1 -0
  249. package/lib/components/Renderer/FormBodyCollapsible.d.ts +9 -0
  250. package/lib/components/Renderer/FormBodyCollapsible.js +57 -0
  251. package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -0
  252. package/lib/components/Renderer/FormBodySingleCollapsible.d.ts +12 -0
  253. package/lib/components/Renderer/FormBodySingleCollapsible.js +44 -0
  254. package/lib/components/Renderer/FormBodySingleCollapsible.js.map +1 -0
  255. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.d.ts +12 -0
  256. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js +31 -0
  257. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js.map +1 -0
  258. package/lib/components/Renderer/FormBodyTabbed.d.ts +9 -0
  259. package/lib/components/Renderer/FormBodyTabbed.js +60 -0
  260. package/lib/components/Renderer/FormBodyTabbed.js.map +1 -0
  261. package/lib/components/Renderer/FormTitle.d.ts +7 -0
  262. package/lib/components/Renderer/FormTitle.js +30 -0
  263. package/lib/components/Renderer/FormTitle.js.map +1 -0
  264. package/lib/components/Renderer/FormTopLevelItem.d.ts +9 -0
  265. package/lib/components/Renderer/FormTopLevelItem.js +45 -0
  266. package/lib/components/Renderer/FormTopLevelItem.js.map +1 -0
  267. package/lib/components/Renderer/SmartFormsRenderer.d.ts +11 -0
  268. package/lib/components/Renderer/SmartFormsRenderer.js +41 -0
  269. package/lib/components/Renderer/SmartFormsRenderer.js.map +1 -0
  270. package/lib/components/Renderer/index.d.ts +2 -0
  271. package/lib/components/Renderer/index.js +19 -0
  272. package/lib/components/Renderer/index.js.map +1 -0
  273. package/lib/components/Tabs/CompleteTabButton.js +2 -1
  274. package/lib/components/Tabs/CompleteTabButton.js.map +1 -1
  275. package/lib/components/Tabs/FormBodySingleTab.js +4 -1
  276. package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
  277. package/lib/components/Tabs/FormBodyTabList.js +3 -1
  278. package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
  279. package/lib/components/index.d.ts +1 -1
  280. package/lib/components/index.js +1 -1
  281. package/lib/components/index.js.map +1 -1
  282. package/lib/contexts/TestContext.d.ts +11 -0
  283. package/lib/contexts/TestContext.js +32 -0
  284. package/lib/contexts/TestContext.js.map +1 -0
  285. package/lib/contexts/index.d.ts +1 -0
  286. package/lib/contexts/index.js +2 -0
  287. package/lib/contexts/index.js.map +1 -0
  288. package/lib/hooks/useInitialiseRenderer.d.ts +2 -1
  289. package/lib/hooks/useInitialiseRenderer.js +28 -5
  290. package/lib/hooks/useInitialiseRenderer.js.map +1 -1
  291. package/lib/hooks/useTerminologyServerQuery.d.ts +1 -1
  292. package/lib/hooks/useTestContext.d.ts +5 -0
  293. package/lib/hooks/useTestContext.js +27 -0
  294. package/lib/hooks/useTestContext.js.map +1 -0
  295. package/lib/hooks/useValueSetCodings.js +4 -4
  296. package/lib/hooks/useValueSetCodings.js.map +1 -1
  297. package/lib/index.d.ts +5 -63
  298. package/lib/index.js +6 -87
  299. package/lib/index.js.map +1 -1
  300. package/lib/interfaces/choice.enum.d.ts +4 -4
  301. package/lib/interfaces/choice.enum.js +24 -24
  302. package/lib/interfaces/choice.enum.js.map +1 -1
  303. package/lib/stores/index.d.ts +3 -0
  304. package/lib/stores/index.js +4 -0
  305. package/lib/stores/index.js.map +1 -0
  306. package/lib/stores/useQuestionnaireResponseStore.d.ts +3 -3
  307. package/lib/stores/useQuestionnaireResponseStore.js +5 -4
  308. package/lib/stores/useQuestionnaireResponseStore.js.map +1 -1
  309. package/lib/stores/useSmartClientStore.d.ts +7 -0
  310. package/lib/stores/useSmartClientStore.js +7 -0
  311. package/lib/stores/useSmartClientStore.js.map +1 -0
  312. package/lib/stores/useSmartConfigStore.d.ts +14 -0
  313. package/lib/stores/useSmartConfigStore.js +13 -0
  314. package/lib/stores/useSmartConfigStore.js.map +1 -0
  315. package/lib/theme/Theme.d.ts +1 -1
  316. package/lib/theme/Theme.js +1 -1
  317. package/lib/theme/Theme.js.map +1 -1
  318. package/lib/theme/overrides/Accordion.d.ts +1 -1
  319. package/lib/theme/overrides/Autocomplete.d.ts +1 -1
  320. package/lib/theme/overrides/Backdrop.d.ts +1 -1
  321. package/lib/theme/overrides/Backdrop.js.map +1 -1
  322. package/lib/theme/overrides/Button.d.ts +1 -1
  323. package/lib/theme/overrides/Button.js.map +1 -1
  324. package/lib/theme/overrides/Card.d.ts +1 -1
  325. package/lib/theme/overrides/Input.d.ts +1 -1
  326. package/lib/theme/overrides/Input.js.map +1 -1
  327. package/lib/theme/overrides/Overrides.d.ts +1 -1
  328. package/lib/theme/overrides/SpeedDial.d.ts +1 -1
  329. package/lib/theme/overrides/Typography.d.ts +1 -1
  330. package/lib/theme/palette.d.ts +1 -2
  331. package/lib/theme/palette.js.map +1 -1
  332. package/lib/utils/choice.d.ts +3 -3
  333. package/lib/utils/choice.js +11 -11
  334. package/lib/utils/choice.js.map +1 -1
  335. package/lib/utils/openChoice.d.ts +3 -3
  336. package/lib/utils/openChoice.js +7 -7
  337. package/lib/utils/openChoice.js.map +1 -1
  338. package/lib/utils/qItem.js +3 -3
  339. package/lib/utils/qItem.js.map +1 -1
  340. package/lib/utils/removeHidden.d.ts +2 -2
  341. package/lib/utils/valueSet.js +13 -1
  342. package/lib/utils/valueSet.js.map +1 -1
  343. package/package.json +12 -11
  344. package/src/api/smartClient.ts +31 -0
  345. package/src/components/Alert.styles.ts +2 -1
  346. package/src/components/BackToTopButton/BackToTopButton.tsx +3 -1
  347. package/src/components/Box.styles.ts +2 -1
  348. package/src/components/FormComponents/BooleanItem/BooleanField.tsx +2 -1
  349. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +1 -1
  350. package/src/components/FormComponents/{QItemChoice/QItemChoiceAutocomplete.tsx → ChoiceItems/ChoiceAutocompleteItem.tsx} +13 -8
  351. package/src/components/FormComponents/{QItemChoice/QItemChoiceCheckboxAnswerOption.tsx → ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx} +8 -8
  352. package/src/components/FormComponents/{QItemChoice/QItemChoiceCheckboxAnswerValueSet.tsx → ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx} +10 -9
  353. package/src/components/FormComponents/{QItemChoice/QItemChoice.tsx → ChoiceItems/ChoiceItemSwitcher.tsx} +22 -22
  354. package/src/components/FormComponents/{QItemChoice/QItemChoiceRadioAnswerOption.tsx → ChoiceItems/ChoiceRadioAnswerOptionItem.tsx} +11 -11
  355. package/src/components/FormComponents/{QItemChoice/QItemChoiceRadioAnswerValueSet.tsx → ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx} +15 -13
  356. package/src/components/FormComponents/{QItemChoice/QItemChoiceRadioSingle.tsx → ChoiceItems/ChoiceRadioSingle.tsx} +5 -4
  357. package/src/components/FormComponents/{QItemChoice/QItemChoiceSelectAnswerOption.tsx → ChoiceItems/ChoiceSelectAnswerOptionItem.tsx} +13 -9
  358. package/src/components/FormComponents/{QItemChoice/QItemChoiceSelectAnswerValueSet.tsx → ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx} +11 -8
  359. package/src/components/FormComponents/DateTimeItem/DateTimeField.tsx +1 -1
  360. package/src/components/FormComponents/DecimalItem/DecimalField.tsx +1 -1
  361. package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts +2 -1
  362. package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +1 -1
  363. package/src/components/FormComponents/GridGroup/GridGroup.tsx +4 -1
  364. package/src/components/FormComponents/GridGroup/GridRow.tsx +1 -1
  365. package/src/components/FormComponents/GridGroup/GridTable.tsx +5 -1
  366. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +2 -1
  367. package/src/components/FormComponents/GroupItem/GroupItem.styles.ts +2 -1
  368. package/src/components/FormComponents/GroupItem/NextTabButton.tsx +1 -1
  369. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx +1 -1
  370. package/src/components/FormComponents/IntegerItem/IntegerField.tsx +1 -1
  371. package/src/components/FormComponents/Item.styles.ts +4 -1
  372. package/src/components/FormComponents/ItemParts/{QItemCheckboxSingle.tsx → CheckboxSingle.tsx} +4 -3
  373. package/src/components/FormComponents/ItemParts/{QItemCheckboxSingleWithOpenLabel.tsx → CheckboxSingleWithOpenLabel.tsx} +5 -3
  374. package/src/components/FormComponents/ItemParts/FadingCheckIcon.tsx +1 -1
  375. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +1 -1
  376. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +1 -1
  377. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +1 -1
  378. package/src/components/FormComponents/ItemParts/{QItemRadioButtonWithOpenLabel.tsx → RadioButtonWithOpenLabel.tsx} +6 -6
  379. package/src/components/FormComponents/Lists.styles.ts +2 -2
  380. package/src/components/FormComponents/{QItemOpenChoice/QItemOpenChoiceAutocomplete.tsx → OpenChoiceItems/OpenChoiceAutocompleteItem.tsx} +15 -8
  381. package/src/components/FormComponents/{QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.tsx → OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx} +15 -15
  382. package/src/components/FormComponents/{QItemOpenChoice/QItemOpenChoice.tsx → OpenChoiceItems/OpenChoiceItemSwitcher.tsx} +18 -18
  383. package/src/components/FormComponents/{QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.tsx → OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx} +13 -13
  384. package/src/components/FormComponents/{QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.tsx → OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx} +11 -9
  385. package/src/components/FormComponents/{QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.tsx → OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx} +11 -9
  386. package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +2 -1
  387. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +1 -1
  388. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +4 -1
  389. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +1 -1
  390. package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +2 -1
  391. package/src/components/FormComponents/RepeatItem/DeleteItemButton.tsx +1 -1
  392. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +1 -1
  393. package/src/components/FormComponents/RepeatItem/RepeatItem.styles.tsx +3 -1
  394. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +1 -1
  395. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +5 -5
  396. package/src/components/FormComponents/StringItem/StringField.tsx +1 -1
  397. package/src/components/FormComponents/Tables/DeleteRowButton.tsx +3 -1
  398. package/src/components/FormComponents/Tables/QItemGroupTable.tsx +12 -13
  399. package/src/components/FormComponents/Tables/Table.styles.tsx +2 -1
  400. package/src/components/FormComponents/Textfield.styles.ts +2 -1
  401. package/src/components/FormComponents/Typography.styles.ts +2 -1
  402. package/src/components/FormComponents/UrlItem/UrlField.tsx +1 -1
  403. package/src/components/Iconify/Iconify.tsx +2 -2
  404. package/src/components/Lists.styles.ts +2 -2
  405. package/src/components/{FormRenderer → Renderer}/BaseRenderer.tsx +3 -2
  406. package/src/components/{FormRenderer → Renderer}/FormBodyCollapsible.tsx +1 -1
  407. package/src/components/{FormRenderer → Renderer}/FormBodySingleCollapsible.tsx +6 -8
  408. package/src/components/{FormRenderer → Renderer}/FormBodyTabbed.tsx +1 -1
  409. package/src/components/{FormRenderer → Renderer}/FormTitle.tsx +1 -1
  410. package/src/components/{FormRenderer → Renderer}/SmartFormsRenderer.tsx +9 -3
  411. package/src/components/Tabs/CompleteTabButton.tsx +2 -1
  412. package/src/components/Tabs/FormBodySingleTab.tsx +5 -1
  413. package/src/components/Tabs/FormBodyTabList.tsx +3 -1
  414. package/src/components/index.ts +1 -1
  415. package/src/hooks/useInitialiseRenderer.ts +34 -5
  416. package/src/hooks/useTerminologyServerQuery.ts +1 -1
  417. package/src/hooks/useValueSetCodings.ts +4 -4
  418. package/src/index.ts +6 -94
  419. package/src/interfaces/choice.enum.ts +4 -4
  420. package/src/stores/index.ts +3 -0
  421. package/src/stores/useQuestionnaireResponseStore.ts +8 -8
  422. package/src/stores/useSmartConfigStore.ts +27 -0
  423. package/src/stories/SmartFormsRenderer.stories.ts +25 -16
  424. package/src/stories/assets/QTestGrid.json +245 -0
  425. package/src/theme/Theme.tsx +2 -2
  426. package/src/theme/overrides/Accordion.ts +1 -1
  427. package/src/theme/overrides/Autocomplete.ts +1 -1
  428. package/src/theme/overrides/Backdrop.ts +1 -1
  429. package/src/theme/overrides/Button.ts +1 -1
  430. package/src/theme/overrides/Card.ts +1 -1
  431. package/src/theme/overrides/Input.ts +1 -1
  432. package/src/theme/overrides/Overrides.ts +1 -1
  433. package/src/theme/overrides/SpeedDial.ts +1 -1
  434. package/src/theme/overrides/Typography.ts +1 -1
  435. package/src/theme/palette.ts +1 -2
  436. package/src/utils/choice.ts +12 -12
  437. package/src/utils/openChoice.ts +8 -8
  438. package/src/utils/qItem.ts +3 -3
  439. package/src/utils/removeHidden.ts +2 -2
  440. package/src/utils/valueSet.ts +16 -1
  441. package/tsconfig.json +3 -2
  442. package/src/api/populate.ts +0 -70
  443. package/src/stores/useConfigStore.ts +0 -36
  444. package/src/utils/populate.ts +0 -117
  445. package/src/utils/populateCallback.ts +0 -53
  446. /package/src/components/{FormRenderer → Renderer}/FormBodySingleCollapsibleWrapper.tsx +0 -0
  447. /package/src/components/{FormRenderer → Renderer}/FormTopLevelItem.tsx +0 -0
  448. /package/src/components/{FormRenderer → Renderer}/index.ts +0 -0
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
+ import type { PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
4
+ interface FormBodySingleCollapsibleProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
5
+ qItem: QuestionnaireItem;
6
+ qrItem: QuestionnaireResponseItem;
7
+ index: number;
8
+ selectedIndex: number;
9
+ onToggleExpand: (index: number) => void;
10
+ }
11
+ declare function FormBodySingleCollapsibleWrapper(props: FormBodySingleCollapsibleProps): React.JSX.Element | null;
12
+ export default FormBodySingleCollapsibleWrapper;
@@ -0,0 +1,31 @@
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 GroupItem from '../FormComponents/GroupItem/GroupItem';
19
+ import FormBodySingleCollapsible from './FormBodySingleCollapsible';
20
+ import useHidden from '../../hooks/useHidden';
21
+ function FormBodySingleCollapsibleWrapper(props) {
22
+ const { qItem, qrItem, index, selectedIndex, onToggleExpand, onQrItemChange } = props;
23
+ const itemIsHidden = useHidden(qItem);
24
+ if (itemIsHidden) {
25
+ return null;
26
+ }
27
+ return (React.createElement(FormBodySingleCollapsible, { key: qItem.linkId, qItem: qItem, index: index, selectedIndex: selectedIndex, onToggleExpand: onToggleExpand },
28
+ React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem, isRepeated: true, groupCardElevation: 1, onQrItemChange: onQrItemChange })));
29
+ }
30
+ export default FormBodySingleCollapsibleWrapper;
31
+ //# sourceMappingURL=FormBodySingleCollapsibleWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormBodySingleCollapsibleWrapper.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAEpE,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAW9C,SAAS,gCAAgC,CAAC,KAAqC;IAC7E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEtF,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,YAAY,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,oBAAC,yBAAyB,IACxB,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc;QAC9B,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,IAAI,EAChB,kBAAkB,EAAE,CAAC,EACrB,cAAc,EAAE,cAAc,GAC9B,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,gCAAgC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
+ import type { PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
4
+ interface FormBodyTabbedProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
5
+ topLevelQItem: QuestionnaireItem;
6
+ topLevelQRItem: QuestionnaireResponseItem;
7
+ }
8
+ declare function FormBodyTabbed(props: FormBodyTabbedProps): React.JSX.Element;
9
+ export default FormBodyTabbed;
@@ -0,0 +1,60 @@
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 } from 'react';
18
+ import Grid from '@mui/material/Grid';
19
+ import { TabContext, TabPanel } from '@mui/lab';
20
+ import { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
21
+ import GroupItem from '../FormComponents/GroupItem/GroupItem';
22
+ import { updateQrGroup } from '../../utils/qrItem';
23
+ import FormBodyTabList from '../Tabs/FormBodyTabList';
24
+ import useQuestionnaireStore from '../../stores/useQuestionnaireStore';
25
+ function FormBodyTabbed(props) {
26
+ const { topLevelQItem, topLevelQRItem, onQrItemChange } = props;
27
+ const tabs = useQuestionnaireStore((state) => state.tabs);
28
+ const currentTab = useQuestionnaireStore((state) => state.currentTabIndex);
29
+ const indexMap = useMemo(() => mapQItemsIndex(topLevelQItem), [topLevelQItem]);
30
+ const qItems = topLevelQItem.item;
31
+ const qrItems = topLevelQRItem.item;
32
+ function handleQrGroupChange(qrItem) {
33
+ updateQrGroup(qrItem, null, topLevelQRItem, indexMap);
34
+ onQrItemChange(topLevelQRItem);
35
+ }
36
+ if (!qItems || !qrItems) {
37
+ return React.createElement(React.Fragment, null, "Unable to load form");
38
+ }
39
+ const qrItemsByIndex = getQrItemsIndex(qItems, qrItems, indexMap);
40
+ return (React.createElement(Grid, { container: true, spacing: 2 },
41
+ React.createElement(TabContext, { value: currentTab.toString() },
42
+ React.createElement(Grid, { item: true, xs: 12, md: 3.5, lg: 3, xl: 2.75 },
43
+ React.createElement(FormBodyTabList, { qFormItems: qItems, currentTabIndex: currentTab, tabs: tabs })),
44
+ React.createElement(Grid, { item: true, xs: 12, md: 8.5, lg: 9, xl: 9.25 }, qItems.map((qItem, i) => {
45
+ var _a, _b;
46
+ const qrItem = qrItemsByIndex[i];
47
+ const isNotRepeatGroup = !Array.isArray(qrItem);
48
+ const isTab = !!tabs[qItem.linkId];
49
+ if (!isTab || !isNotRepeatGroup) {
50
+ // Something has gone horribly wrong
51
+ return null;
52
+ }
53
+ const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
54
+ const tabIsMarkedAsComplete = (_b = tabs[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
55
+ return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-tab-panel" },
56
+ React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, groupCardElevation: 1, tabIsMarkedAsComplete: tabIsMarkedAsComplete, tabs: tabs, currentTabIndex: currentTab, onQrItemChange: handleQrGroupChange })));
57
+ })))));
58
+ }
59
+ export default FormBodyTabbed;
60
+ //# sourceMappingURL=FormBodyTabbed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormBodyTabbed.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyTabbed.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,eAAe,MAAM,yBAAyB,CAAC;AAEtD,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAOvE,SAAS,cAAc,CAAC,KAA0B;IAChD,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEhE,MAAM,IAAI,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAE3E,MAAM,QAAQ,GAA2B,OAAO,CAC9C,GAAG,EAAE,CAAC,cAAc,CAAC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AEnC,IAAI,CAAC,KAAK,IAAI,CAAC,gBAAgB,EAAE;oBAC/B,oCAAoC;oBACpC,OAAO,IAAI,CAAC;iBACb;gBAED,MAAM,UAAU,GAAG,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC;gBAC1C,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,mCAAI,KAAK,CAAC;gBAErE,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,eACT,oBAAoB;oBAC9B,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,UAAU,EAC3B,cAAc,EAAE,mBAAmB,GACnC,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { Questionnaire } from 'fhir/r4';
3
+ interface FormTitleProps {
4
+ questionnaire: Questionnaire;
5
+ }
6
+ declare const FormTitle: React.NamedExoticComponent<FormTitleProps>;
7
+ export default FormTitle;
@@ -0,0 +1,30 @@
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, { memo } from 'react';
18
+ import parse from 'html-react-parser';
19
+ import { getXHtmlStringFromQuestionnaire } from '../../utils/qItem';
20
+ import { FormTitleWrapper } from '../Box.styles';
21
+ import Typography from '@mui/material/Typography';
22
+ const FormTitle = memo(function FormTitle(props) {
23
+ const { questionnaire } = props;
24
+ const xHtmlString = getXHtmlStringFromQuestionnaire(questionnaire);
25
+ const formTitle = xHtmlString ? parse(xHtmlString) : questionnaire.title;
26
+ return (React.createElement(FormTitleWrapper, null,
27
+ React.createElement(Typography, { variant: "h3", "data-test": "form-heading" }, formTitle)));
28
+ });
29
+ export default FormTitle;
30
+ //# sourceMappingURL=FormTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormTitle.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTitle.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAMlD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,SAAS,CAAC,KAAqB;IAC7D,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAEhC,MAAM,WAAW,GAAG,+BAA+B,CAAC,aAAa,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;IAEzE,OAAO,CACL,oBAAC,gBAAgB;QACf,oBAAC,UAAU,IAAC,OAAO,EAAC,IAAI,eAAW,cAAc,IAC9C,SAAS,CACC,CACI,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
+ import type { PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
4
+ interface FormTopLevelItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
5
+ topLevelQItem: QuestionnaireItem;
6
+ topLevelQRItem: QuestionnaireResponseItem;
7
+ }
8
+ declare function FormTopLevelItem(props: FormTopLevelItemProps): React.JSX.Element;
9
+ export default FormTopLevelItem;
@@ -0,0 +1,45 @@
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 FormBodyTabbed from './FormBodyTabbed';
19
+ import { containsTabs, isTabContainer } from '../../utils/tabs';
20
+ import GroupItem from '../FormComponents/GroupItem/GroupItem';
21
+ import SingleItem from '../FormComponents/SingleItem/SingleItem';
22
+ import FormBodyCollapsible from './FormBodyCollapsible';
23
+ import useResponsive from '../../hooks/useResponsive';
24
+ function FormTopLevelItem(props) {
25
+ const { topLevelQItem, topLevelQRItem, onQrItemChange } = props;
26
+ const itemIsTabContainer = isTabContainer(topLevelQItem);
27
+ const itemContainsTabs = containsTabs(topLevelQItem);
28
+ const isDesktop = useResponsive('up', 'lg');
29
+ const itemIsGroup = topLevelQItem.type === 'group';
30
+ // If form is tabbed, it is rendered as a tabbed form
31
+ if (itemContainsTabs || itemIsTabContainer) {
32
+ if (isDesktop) {
33
+ return (React.createElement(FormBodyTabbed, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, onQrItemChange: onQrItemChange }));
34
+ }
35
+ return (React.createElement(FormBodyCollapsible, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, onQrItemChange: onQrItemChange }));
36
+ }
37
+ // If form is untabbed, it is rendered as a regular group
38
+ if (itemIsGroup) {
39
+ return (React.createElement(GroupItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, groupCardElevation: 1, onQrItemChange: onQrItemChange, isRepeated: false }));
40
+ }
41
+ // Otherwise, it is rendered as a non-group item
42
+ return (React.createElement(SingleItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, isTabled: false, onQrItemChange: onQrItemChange, isRepeated: false }));
43
+ }
44
+ export default FormTopLevelItem;
45
+ //# sourceMappingURL=FormTopLevelItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormTopLevelItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTopLevelItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,UAAU,MAAM,yCAAyC,CAAC;AAEjE,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAOtD,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,aAAa,EAAE,cAAc,EA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naire, QuestionnaireResponse } from 'fhir/r4';
3
+ import type Client from 'fhirclient/lib/Client';
4
+ interface SmartFormsRendererProps {
5
+ questionnaire: Questionnaire;
6
+ questionnaireResponse?: QuestionnaireResponse;
7
+ additionalVariables?: Record<string, object>;
8
+ fhirClient?: Client;
9
+ }
10
+ declare function SmartFormsRenderer(props: SmartFormsRendererProps): React.JSX.Element;
11
+ export default SmartFormsRenderer;
@@ -0,0 +1,41 @@
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 useInitialiseRenderer from '../../hooks/useInitialiseRenderer';
19
+ import Box from '@mui/material/Box';
20
+ import CircularProgress from '@mui/material/CircularProgress';
21
+ import Typography from '@mui/material/Typography';
22
+ import { QueryClientProvider } from '@tanstack/react-query';
23
+ import useQueryClient from '../../hooks/useQueryClient';
24
+ import BaseRenderer from './BaseRenderer';
25
+ import ThemeProvider from '../../theme/Theme';
26
+ // TODO add terminiology server
27
+ function SmartFormsRenderer(props) {
28
+ const { questionnaire, questionnaireResponse, additionalVariables, fhirClient } = props;
29
+ const isLoading = useInitialiseRenderer(questionnaire, questionnaireResponse, additionalVariables, fhirClient);
30
+ const queryClient = useQueryClient();
31
+ if (isLoading) {
32
+ return (React.createElement(Box, { display: "flex", alignItems: "center", columnGap: 2 },
33
+ React.createElement(CircularProgress, null),
34
+ React.createElement(Typography, null, "Loading questionnaire...")));
35
+ }
36
+ return (React.createElement(ThemeProvider, null,
37
+ React.createElement(QueryClientProvider, { client: queryClient },
38
+ React.createElement(BaseRenderer, null))));
39
+ }
40
+ export default SmartFormsRenderer;
41
+ //# sourceMappingURL=SmartFormsRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmartFormsRenderer.js","sourceRoot":"","sources":["../../../src/components/Renderer/SmartFormsRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,qBAAqB,MAAM,mCAAmC,CAAC;AACtE,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,cAAc,MAAM,4BAA4B,CAAC;AACxD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAU9C,+BAA+B;AAC/B,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAExF,MAAM,SAAS,GAAG,qBAAqB,CACrC,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,CACX,CAAC;IACF,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,SAAS,EAAE;QACb,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC;YAClD,oBAAC,gBAAgB,OAAG;YACpB,oBAAC,UAAU,mCAAsC,CAC7C,CACP,CAAC;KACH;IAED,OAAO,CACL,oBAAC,aAAa;QACZ,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;YACtC,oBAAC,YAAY,OAAG,CACI,CACR,CACjB,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as SmartFormsRenderer } from './SmartFormsRenderer';
2
+ export { default as BaseRenderer } from './BaseRenderer';
@@ -0,0 +1,19 @@
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 { default as SmartFormsRenderer } from './SmartFormsRenderer';
18
+ export { default as BaseRenderer } from './BaseRenderer';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Renderer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -15,7 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { memo } from 'react';
18
- import { IconButton, Tooltip } from '@mui/material';
18
+ import IconButton from '@mui/material/IconButton';
19
+ import Tooltip from '@mui/material/Tooltip';
19
20
  import CheckCircleIcon from '@mui/icons-material/CheckCircle';
20
21
  import useQuestionnaireStore from '../../stores/useQuestionnaireStore';
21
22
  const CompleteTabButton = memo(function CompleteTabButton(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"CompleteTabButton.js","sourceRoot":"","sources":["../../../src/components/Tabs/CompleteTabButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAOvE,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,iBAAiB,CAAC,KAA6B;IACrF,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAEnD,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAEpF,OAAO,CACL,oBAAC,OAAO,IAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,cAAc;QAC3E,oBAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;YACrD,oBAAC,eAAe,IAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAI,CAC9D,CACL,CACX,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"CompleteTabButton.js","sourceRoot":"","sources":["../../../src/components/Tabs/CompleteTabButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAOvE,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,iBAAiB,CAAC,KAA6B;IACrF,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAEnD,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAEpF,OAAO,CACL,oBAAC,OAAO,IAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,cAAc;QAC3E,oBAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;YACrD,oBAAC,eAAe,IAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAI,CAC9D,CACL,CACX,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
@@ -15,7 +15,10 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { memo } from 'react';
18
- import { Box, ListItemButton, ListItemText, Typography } from '@mui/material';
18
+ import Box from '@mui/material/Box';
19
+ import ListItemButton from '@mui/material/ListItemButton';
20
+ import ListItemText from '@mui/material/ListItemText';
21
+ import Typography from '@mui/material/Typography';
19
22
  import useQuestionnaireStore from '../../stores/useQuestionnaireStore';
20
23
  import { getContextDisplays } from '../../utils/tabs';
21
24
  import ContextDisplayItem from '../FormComponents/ItemParts/ContextDisplayItem';
@@ -1 +1 @@
1
- {"version":3,"file":"FormBodySingleTab.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodySingleTab.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,qBAAqB,MAAM,oC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BAAC,GAAG,IAAC,OAAO,EAAC,MAAM,IAChB,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBAChC,OAAO,oBAAC,kBAAkB,IAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,GAAI,CAAC;oBACrE,CAAC,CAAC,CACE,CACF,GAER,CACa,CAChB,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
@@ -15,7 +15,9 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { memo } from 'react';
18
- import { Box, Card, Collapse } from '@mui/material';
18
+ import Box from '@mui/material/Box';
19
+ import Card from '@mui/material/Card';
20
+ import Collapse from '@mui/material/Collapse';
19
21
  import { PrimarySelectableList } from '../Lists.styles';
20
22
  import { TransitionGroup } from 'react-transition-group';
21
23
  import { isHidden } from '../../utils/qItem';
@@ -1 +1 @@
1
- {"version":3,"file":"FormBodyTabList.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodyTabList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAQvE,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,eAAe,CAAC,KAA2B;IAC/E,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,IA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export * from './Renderer';
@@ -14,5 +14,5 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export * from './FormRenderer';
17
+ export * from './Renderer';
18
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ export interface TestContextContextType {
4
+ hasChanges: boolean;
5
+ setHasChanges: (updatedHasChanges: boolean) => unknown;
6
+ }
7
+ export declare const TestContext: React.Context<TestContextContextType>;
8
+ declare function TestContextProvider(props: {
9
+ children: ReactNode;
10
+ }): React.JSX.Element;
11
+ export default TestContextProvider;
@@ -0,0 +1,32 @@
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, { createContext, useState } from 'react';
18
+ export const TestContext = createContext({
19
+ hasChanges: false,
20
+ setHasChanges: () => void 0
21
+ });
22
+ function TestContextProvider(props) {
23
+ const { children } = props;
24
+ const [hasChanges, setHasChanges] = useState(false);
25
+ const testContext = {
26
+ hasChanges,
27
+ setHasChanges
28
+ };
29
+ return React.createElement(TestContext.Provider, { value: testContext }, children);
30
+ }
31
+ export default TestContextProvider;
32
+ //# sourceMappingURL=TestContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestContext.js","sourceRoot":"","sources":["../../src/contexts/TestContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOvD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAyB;IAC/D,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;CAC5B,CAAC,CAAC;AAEH,SAAS,mBAAmB,CAAC,KAA8B;IACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE3B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,WAAW,GAA2B;QAC1C,UAAU;QACV,aAAa;KACd,CAAC;IAEF,OAAO,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,WAAW,IAAG,QAAQ,CAAwB,CAAC;AACrF,CAAC;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as TestContextProvider } from './TestContext';
@@ -0,0 +1,2 @@
1
+ export { default as TestContextProvider } from './TestContext';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
2
- declare function useInitialiseRenderer(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>): boolean;
2
+ import type Client from 'fhirclient/lib/Client';
3
+ declare function useInitialiseRenderer(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>, fhirClient?: Client): boolean;
3
4
  export default useInitialiseRenderer;
@@ -18,19 +18,37 @@ import { useLayoutEffect, useState } from 'react';
18
18
  import { createQuestionnaireResponse } from '../utils/qrItem';
19
19
  import useQuestionnaireStore from '../stores/useQuestionnaireStore';
20
20
  import useQuestionnaireResponseStore from '../stores/useQuestionnaireResponseStore';
21
- function useInitialiseRenderer(questionnaire, questionnaireResponse, additionalVariables) {
21
+ import useSmartConfigStore from '../stores/useSmartConfigStore';
22
+ import { readEncounter, readPatient, readUser } from '../api/smartClient';
23
+ function useInitialiseRenderer(questionnaire, questionnaireResponse, additionalVariables, fhirClient) {
22
24
  const buildSourceQuestionnaire = useQuestionnaireStore((state) => state.buildSourceQuestionnaire);
23
25
  const updatePopulatedProperties = useQuestionnaireStore((state) => state.updatePopulatedProperties);
24
26
  const buildSourceResponse = useQuestionnaireResponseStore((state) => state.buildSourceResponse);
25
- const populateResponse = useQuestionnaireResponseStore((state) => state.populateResponse);
27
+ const setUpdatableResponseAsPopulated = useQuestionnaireResponseStore((state) => state.setUpdatableResponseAsPopulated);
28
+ const setSmartClient = useSmartConfigStore((state) => state.setClient);
29
+ const setPatient = useSmartConfigStore((state) => state.setPatient);
30
+ const setUser = useSmartConfigStore((state) => state.setUser);
31
+ const setEncounter = useSmartConfigStore((state) => state.setEncounter);
26
32
  const [loading, setLoading] = useState(true);
27
33
  useLayoutEffect(() => {
28
34
  setLoading(true);
35
+ if (fhirClient) {
36
+ setSmartClient(fhirClient);
37
+ readPatient(fhirClient).then((patient) => {
38
+ setPatient(patient);
39
+ });
40
+ readUser(fhirClient).then((user) => {
41
+ setUser(user);
42
+ });
43
+ readEncounter(fhirClient).then((encounter) => {
44
+ setEncounter(encounter);
45
+ });
46
+ }
29
47
  buildSourceQuestionnaire(questionnaire, questionnaireResponse, additionalVariables).then(() => {
30
48
  buildSourceResponse(createQuestionnaireResponse(questionnaire));
31
49
  if (questionnaireResponse) {
32
50
  const updatedResponse = updatePopulatedProperties(questionnaireResponse);
33
- populateResponse(updatedResponse);
51
+ setUpdatableResponseAsPopulated(updatedResponse);
34
52
  }
35
53
  setLoading(false);
36
54
  });
@@ -39,9 +57,14 @@ function useInitialiseRenderer(questionnaire, questionnaireResponse, additionalV
39
57
  questionnaireResponse,
40
58
  buildSourceQuestionnaire,
41
59
  buildSourceResponse,
42
- populateResponse,
60
+ setUpdatableResponseAsPopulated,
43
61
  updatePopulatedProperties,
44
- additionalVariables
62
+ additionalVariables,
63
+ fhirClient,
64
+ setSmartClient,
65
+ setPatient,
66
+ setUser,
67
+ setEncounter
45
68
  ]);
46
69
  return loading;
47
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useInitialiseRenderer.js","sourceRoot":"","sources":["../../src/hooks/useInitialiseRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,6BAA6B,MAAM,yCAAyC,CAAC;AAEpF,SAAS,qBAAqB,CAC5B,aAA4B,EAC5B,qBAA6C,EAC7C,mBAA4C;IAE5C,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAClG,MAAM,yBAAyB,GAAG,qBAAqB,CACrD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAC3C,CAAC;IACF,MAAM,mBAAmB,GAAG,6BAA6B,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAChG,MAAM,gBAAgB,GAAG,6BAA6B,CAAC,C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AAC,IAAI,EAAE,EAAE;gBACjC,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;gBAC3C,YAAY,CAAC,SAAS,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;SACJ;QAED,wBAAwB,CAAC,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5F,mBAAmB,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC,CAAC;YAEhE,IAAI,qBAAqB,EAAE;gBACzB,MAAM,eAAe,GAAG,yBAAyB,CAAC,qBAAqB,CAAC,CAAC;gBACzE,+BAA+B,CAAC,eAAe,CAAC,CAAC;aAClD;YACD,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE;QACD,aAAa;QACb,qBAAqB;QACrB,wBAAwB;QACxB,mBAAmB;QACnB,+BAA+B;QAC/B,yBAAyB;QACzB,mBAAmB;QACnB,UAAU;QACV,cAAc;QACd,UAAU;QACV,OAAO;QACP,YAAY;KACb,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,eAAe,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Coding } from 'fhir/r4';
2
- import type { AlertColor } from '@mui/material';
2
+ import type { AlertColor } from '@mui/material/Alert';
3
3
  declare function useTerminologyServerQuery(answerValueSetUrl: string | undefined, maxList: number, input: string, searchTerm: string, terminologyServerUrl?: string): {
4
4
  options: Coding[];
5
5
  loading: boolean;
@@ -0,0 +1,5 @@
1
+ declare function useTestContext(): {
2
+ hasChanges: boolean;
3
+ setHasChanges: (updatedHasChanges: boolean) => unknown;
4
+ };
5
+ export default useTestContext;
@@ -0,0 +1,27 @@
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 { useContext } from 'react';
18
+ import { TestContext } from '../contexts/TestContext';
19
+ function useTestContext() {
20
+ const { hasChanges, setHasChanges } = useContext(TestContext);
21
+ return {
22
+ hasChanges,
23
+ setHasChanges
24
+ };
25
+ }
26
+ export default useTestContext;
27
+ //# sourceMappingURL=useTestContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTestContext.js","sourceRoot":"","sources":["../../src/hooks/useTestContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,SAAS,cAAc;IACrB,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAE9D,OAAO;QACL,UAAU;QACV,aAAa;KACd,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -19,13 +19,13 @@ import { getResourceFromLaunchContext, getTerminologyServerUrl, getValueSetCodin
19
19
  import { getAnswerExpression } from '../utils/itemControl';
20
20
  import fhirpath from 'fhirpath';
21
21
  import fhirpath_r4_model from 'fhirpath/fhir-context/r4';
22
- import useConfigStore from '../stores/useConfigStore';
22
+ import useSmartConfigStore from '../stores/useSmartConfigStore';
23
23
  import useQuestionnaireStore from '../stores/useQuestionnaireStore';
24
24
  function useValueSetCodings(qItem) {
25
25
  var _a;
26
- const patient = useConfigStore((state) => state.patient);
27
- const user = useConfigStore((state) => state.user);
28
- const encounter = useConfigStore((state) => state.encounter);
26
+ const patient = useSmartConfigStore((state) => state.patient);
27
+ const user = useSmartConfigStore((state) => state.user);
28
+ const encounter = useSmartConfigStore((state) => state.encounter);
29
29
  const launchContexts = useQuestionnaireStore((state) => state.launchContexts);
30
30
  const processedValueSetCodings = useQuestionnaireStore((state) => state.processedValueSetCodings);
31
31
  const cachedValueSetCodings = useQuestionnaireStore((state) => state.cachedValueSetCodings);