@aehrc/smart-forms-renderer 0.4.0 → 0.5.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 (363) hide show
  1. package/lib/components/FormRenderer/SmartFormsRenderer.js +4 -2
  2. package/lib/components/FormRenderer/SmartFormsRenderer.js.map +1 -1
  3. package/lib/theme/Theme.d.ts +38 -0
  4. package/lib/theme/Theme.js +39 -0
  5. package/lib/theme/Theme.js.map +1 -0
  6. package/lib/theme/globalStyles.d.ts +2 -0
  7. package/lib/theme/globalStyles.js +64 -0
  8. package/lib/theme/globalStyles.js.map +1 -0
  9. package/lib/theme/overrides/Accordion.d.ts +14 -0
  10. package/{src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js → lib/theme/overrides/Accordion.js} +15 -7
  11. package/lib/theme/overrides/Accordion.js.map +1 -0
  12. package/lib/theme/overrides/Autocomplete.d.ts +10 -0
  13. package/{src/components/FormComponents/DisplayItem/DisplayInstructions.styles.js → lib/theme/overrides/Autocomplete.js} +12 -7
  14. package/lib/theme/overrides/Autocomplete.js.map +1 -0
  15. package/lib/theme/overrides/Backdrop.d.ts +13 -0
  16. package/{src/components/FormComponents/ItemParts/FadingCheckIcon.js → lib/theme/overrides/Backdrop.js} +15 -9
  17. package/lib/theme/overrides/Backdrop.js.map +1 -0
  18. package/lib/theme/overrides/Button.d.ts +33 -0
  19. package/lib/theme/overrides/Button.js +52 -0
  20. package/lib/theme/overrides/Button.js.map +1 -0
  21. package/lib/theme/overrides/Card.d.ts +35 -0
  22. package/lib/theme/overrides/Card.js +49 -0
  23. package/lib/theme/overrides/Card.js.map +1 -0
  24. package/lib/theme/overrides/Input.d.ts +64 -0
  25. package/lib/theme/overrides/Input.js +81 -0
  26. package/lib/theme/overrides/Input.js.map +1 -0
  27. package/lib/theme/overrides/Overrides.d.ts +3 -0
  28. package/{src/components/BackToTopButton/BackToTopButton.js → lib/theme/overrides/Overrides.js} +14 -15
  29. package/lib/theme/overrides/Overrides.js.map +1 -0
  30. package/lib/theme/overrides/Paper.d.ts +12 -0
  31. package/{src/hooks/useQueryClient.js → lib/theme/overrides/Paper.js} +12 -10
  32. package/lib/theme/overrides/Paper.js.map +1 -0
  33. package/lib/theme/overrides/SpeedDial.d.ts +16 -0
  34. package/{src/hooks/useInitialiseRepeatAnswers.js → lib/theme/overrides/SpeedDial.js} +16 -18
  35. package/lib/theme/overrides/SpeedDial.js.map +1 -0
  36. package/lib/theme/overrides/Table.d.ts +11 -0
  37. package/{src/components/FormRenderer/index.js → lib/theme/overrides/Table.js} +13 -2
  38. package/lib/theme/overrides/Table.js.map +1 -0
  39. package/lib/theme/overrides/Typography.d.ts +13 -0
  40. package/lib/theme/overrides/Typography.js +31 -0
  41. package/lib/theme/overrides/Typography.js.map +1 -0
  42. package/lib/theme/palette.d.ts +28 -0
  43. package/lib/theme/palette.js +67 -0
  44. package/lib/theme/palette.js.map +1 -0
  45. package/lib/theme/shadows.d.ts +2 -0
  46. package/lib/theme/shadows.js +52 -0
  47. package/lib/theme/shadows.js.map +1 -0
  48. package/lib/theme/typography.d.ts +139 -0
  49. package/lib/theme/typography.js +80 -0
  50. package/lib/theme/typography.js.map +1 -0
  51. package/package.json +1 -1
  52. package/src/components/FormRenderer/SmartFormsRenderer.tsx +6 -3
  53. package/src/theme/Theme.tsx +107 -0
  54. package/src/theme/globalStyles.tsx +68 -0
  55. package/src/{components/FormComponents/Item.styles.js → theme/overrides/Accordion.ts} +18 -11
  56. package/src/{interfaces/answerExpression.interface.js → theme/overrides/Autocomplete.ts} +14 -2
  57. package/src/theme/overrides/Backdrop.ts +34 -0
  58. package/src/theme/overrides/Button.ts +54 -0
  59. package/src/theme/overrides/Card.ts +51 -0
  60. package/src/theme/overrides/Input.ts +83 -0
  61. package/src/theme/overrides/Overrides.ts +45 -0
  62. package/src/{interfaces/enableWhen.interface.js → theme/overrides/Paper.ts} +15 -2
  63. package/src/{hooks/useInitialiseGroupTable.js → theme/overrides/SpeedDial.ts} +17 -17
  64. package/src/{hooks/useBackToTop.js → theme/overrides/Table.ts} +14 -9
  65. package/src/{components/FormComponents/Typography.styles.js → theme/overrides/Typography.ts} +17 -7
  66. package/src/theme/palette.ts +100 -0
  67. package/src/theme/shadows.ts +54 -0
  68. package/src/theme/typography.ts +114 -0
  69. package/src/api/populate.js +0 -63
  70. package/src/api/populate.js.map +0 -1
  71. package/src/components/Alert.styles.js +0 -40
  72. package/src/components/Alert.styles.js.map +0 -1
  73. package/src/components/BackToTopButton/BackToTopButton.js.map +0 -1
  74. package/src/components/Box.styles.js +0 -30
  75. package/src/components/Box.styles.js.map +0 -1
  76. package/src/components/FormComponents/BooleanItem/BooleanField.js +0 -24
  77. package/src/components/FormComponents/BooleanItem/BooleanField.js.map +0 -1
  78. package/src/components/FormComponents/BooleanItem/BooleanItem.js +0 -49
  79. package/src/components/FormComponents/BooleanItem/BooleanItem.js.map +0 -1
  80. package/src/components/FormComponents/DateItem/DateField.js +0 -31
  81. package/src/components/FormComponents/DateItem/DateField.js.map +0 -1
  82. package/src/components/FormComponents/DateItem/DateItem.js +0 -52
  83. package/src/components/FormComponents/DateItem/DateItem.js.map +0 -1
  84. package/src/components/FormComponents/DateTimeItem/DateTimeField.js +0 -33
  85. package/src/components/FormComponents/DateTimeItem/DateTimeField.js.map +0 -1
  86. package/src/components/FormComponents/DateTimeItem/DateTimeItem.js +0 -52
  87. package/src/components/FormComponents/DateTimeItem/DateTimeItem.js.map +0 -1
  88. package/src/components/FormComponents/DecimalItem/DecimalField.js +0 -30
  89. package/src/components/FormComponents/DecimalItem/DecimalField.js.map +0 -1
  90. package/src/components/FormComponents/DecimalItem/DecimalItem.js +0 -80
  91. package/src/components/FormComponents/DecimalItem/DecimalItem.js.map +0 -1
  92. package/src/components/FormComponents/DisplayItem/DisplayInstructions.js +0 -26
  93. package/src/components/FormComponents/DisplayItem/DisplayInstructions.js.map +0 -1
  94. package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.js.map +0 -1
  95. package/src/components/FormComponents/DisplayItem/DisplayItem.js +0 -31
  96. package/src/components/FormComponents/DisplayItem/DisplayItem.js.map +0 -1
  97. package/src/components/FormComponents/GridGroup/GridGroup.js +0 -58
  98. package/src/components/FormComponents/GridGroup/GridGroup.js.map +0 -1
  99. package/src/components/FormComponents/GridGroup/GridRow.js +0 -55
  100. package/src/components/FormComponents/GridGroup/GridRow.js.map +0 -1
  101. package/src/components/FormComponents/GridGroup/GridTable.js +0 -42
  102. package/src/components/FormComponents/GridGroup/GridTable.js.map +0 -1
  103. package/src/components/FormComponents/GroupItem/GroupHeading.js +0 -39
  104. package/src/components/FormComponents/GroupItem/GroupHeading.js.map +0 -1
  105. package/src/components/FormComponents/GroupItem/GroupItem.js +0 -62
  106. package/src/components/FormComponents/GroupItem/GroupItem.js.map +0 -1
  107. package/src/components/FormComponents/GroupItem/GroupItem.styles.js +0 -27
  108. package/src/components/FormComponents/GroupItem/GroupItem.styles.js.map +0 -1
  109. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.js +0 -73
  110. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +0 -1
  111. package/src/components/FormComponents/GroupItem/NextTabButton.js +0 -25
  112. package/src/components/FormComponents/GroupItem/NextTabButton.js.map +0 -1
  113. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.js +0 -55
  114. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.js.map +0 -1
  115. package/src/components/FormComponents/IntegerItem/IntegerField.js +0 -30
  116. package/src/components/FormComponents/IntegerItem/IntegerField.js.map +0 -1
  117. package/src/components/FormComponents/IntegerItem/IntegerItem.js +0 -73
  118. package/src/components/FormComponents/IntegerItem/IntegerItem.js.map +0 -1
  119. package/src/components/FormComponents/Item.styles.js.map +0 -1
  120. package/src/components/FormComponents/ItemParts/ContextDisplayItem.js +0 -29
  121. package/src/components/FormComponents/ItemParts/ContextDisplayItem.js.map +0 -1
  122. package/src/components/FormComponents/ItemParts/FadingCheckIcon.js.map +0 -1
  123. package/src/components/FormComponents/ItemParts/ItemFieldGrid.js +0 -31
  124. package/src/components/FormComponents/ItemParts/ItemFieldGrid.js.map +0 -1
  125. package/src/components/FormComponents/ItemParts/ItemLabelText.js +0 -45
  126. package/src/components/FormComponents/ItemParts/ItemLabelText.js.map +0 -1
  127. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.js +0 -32
  128. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +0 -1
  129. package/src/components/FormComponents/ItemParts/QItemCheckboxSingle.js +0 -24
  130. package/src/components/FormComponents/ItemParts/QItemCheckboxSingle.js.map +0 -1
  131. package/src/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js +0 -33
  132. package/src/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js.map +0 -1
  133. package/src/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js +0 -31
  134. package/src/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js.map +0 -1
  135. package/src/components/FormComponents/Lists.styles.js +0 -38
  136. package/src/components/FormComponents/Lists.styles.js.map +0 -1
  137. package/src/components/FormComponents/QItemChoice/QItemChoice.js +0 -61
  138. package/src/components/FormComponents/QItemChoice/QItemChoice.js.map +0 -1
  139. package/src/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js +0 -85
  140. package/src/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js.map +0 -1
  141. package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js +0 -70
  142. package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js.map +0 -1
  143. package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js +0 -66
  144. package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js.map +0 -1
  145. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js +0 -70
  146. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js.map +0 -1
  147. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js +0 -70
  148. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js.map +0 -1
  149. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js.map +0 -1
  150. package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js +0 -70
  151. package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js.map +0 -1
  152. package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js +0 -80
  153. package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js.map +0 -1
  154. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js +0 -49
  155. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js.map +0 -1
  156. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js +0 -104
  157. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js.map +0 -1
  158. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js +0 -105
  159. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js.map +0 -1
  160. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js +0 -116
  161. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js.map +0 -1
  162. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js +0 -74
  163. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js.map +0 -1
  164. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js +0 -66
  165. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map +0 -1
  166. package/src/components/FormComponents/RepeatGroup/AddItemButton.js +0 -27
  167. package/src/components/FormComponents/RepeatGroup/AddItemButton.js.map +0 -1
  168. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.js +0 -30
  169. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +0 -1
  170. package/src/components/FormComponents/RepeatGroup/RepeatGroup.js +0 -81
  171. package/src/components/FormComponents/RepeatGroup/RepeatGroup.js.map +0 -1
  172. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.js +0 -30
  173. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +0 -1
  174. package/src/components/FormComponents/RepeatItem/AddItemButton.js +0 -27
  175. package/src/components/FormComponents/RepeatItem/AddItemButton.js.map +0 -1
  176. package/src/components/FormComponents/RepeatItem/DeleteItemButton.js +0 -30
  177. package/src/components/FormComponents/RepeatItem/DeleteItemButton.js.map +0 -1
  178. package/src/components/FormComponents/RepeatItem/RepeatField.js +0 -31
  179. package/src/components/FormComponents/RepeatItem/RepeatField.js.map +0 -1
  180. package/src/components/FormComponents/RepeatItem/RepeatItem.js +0 -69
  181. package/src/components/FormComponents/RepeatItem/RepeatItem.js.map +0 -1
  182. package/src/components/FormComponents/RepeatItem/RepeatItem.styles.js +0 -29
  183. package/src/components/FormComponents/RepeatItem/RepeatItem.styles.js.map +0 -1
  184. package/src/components/FormComponents/SingleItem/SingleItem.js +0 -32
  185. package/src/components/FormComponents/SingleItem/SingleItem.js.map +0 -1
  186. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.js +0 -63
  187. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +0 -1
  188. package/src/components/FormComponents/StringItem/StringField.js +0 -30
  189. package/src/components/FormComponents/StringItem/StringField.js.map +0 -1
  190. package/src/components/FormComponents/StringItem/StringItem.js +0 -71
  191. package/src/components/FormComponents/StringItem/StringItem.js.map +0 -1
  192. package/src/components/FormComponents/Tables/DeleteRowButton.js +0 -31
  193. package/src/components/FormComponents/Tables/DeleteRowButton.js.map +0 -1
  194. package/src/components/FormComponents/Tables/QItemGroupTable.js +0 -99
  195. package/src/components/FormComponents/Tables/QItemGroupTable.js.map +0 -1
  196. package/src/components/FormComponents/Tables/QItemGroupTableRow.js +0 -46
  197. package/src/components/FormComponents/Tables/QItemGroupTableRow.js.map +0 -1
  198. package/src/components/FormComponents/Tables/Table.styles.js +0 -46
  199. package/src/components/FormComponents/Tables/Table.styles.js.map +0 -1
  200. package/src/components/FormComponents/TextItem/TextField.js +0 -29
  201. package/src/components/FormComponents/TextItem/TextField.js.map +0 -1
  202. package/src/components/FormComponents/TextItem/TextItem.js +0 -71
  203. package/src/components/FormComponents/TextItem/TextItem.js.map +0 -1
  204. package/src/components/FormComponents/Textfield.styles.js +0 -27
  205. package/src/components/FormComponents/Textfield.styles.js.map +0 -1
  206. package/src/components/FormComponents/TimeItem/TimeField.js +0 -30
  207. package/src/components/FormComponents/TimeItem/TimeField.js.map +0 -1
  208. package/src/components/FormComponents/TimeItem/TimeItem.js +0 -52
  209. package/src/components/FormComponents/TimeItem/TimeItem.js.map +0 -1
  210. package/src/components/FormComponents/Typography.styles.js.map +0 -1
  211. package/src/components/FormComponents/UrlItem/UrlField.js +0 -25
  212. package/src/components/FormComponents/UrlItem/UrlField.js.map +0 -1
  213. package/src/components/FormComponents/UrlItem/UrlItem.js +0 -61
  214. package/src/components/FormComponents/UrlItem/UrlItem.js.map +0 -1
  215. package/src/components/FormRenderer/FormBodyCollapsible.js +0 -57
  216. package/src/components/FormRenderer/FormBodyCollapsible.js.map +0 -1
  217. package/src/components/FormRenderer/FormBodySingleCollapsible.js +0 -39
  218. package/src/components/FormRenderer/FormBodySingleCollapsible.js.map +0 -1
  219. package/src/components/FormRenderer/FormBodySingleCollapsibleWrapper.js +0 -31
  220. package/src/components/FormRenderer/FormBodySingleCollapsibleWrapper.js.map +0 -1
  221. package/src/components/FormRenderer/FormBodyTabbed.js +0 -60
  222. package/src/components/FormRenderer/FormBodyTabbed.js.map +0 -1
  223. package/src/components/FormRenderer/FormTitle.js +0 -30
  224. package/src/components/FormRenderer/FormTitle.js.map +0 -1
  225. package/src/components/FormRenderer/FormTopLevelItem.js +0 -45
  226. package/src/components/FormRenderer/FormTopLevelItem.js.map +0 -1
  227. package/src/components/FormRenderer/SmartFormsRenderer.js +0 -37
  228. package/src/components/FormRenderer/SmartFormsRenderer.js.map +0 -1
  229. package/src/components/FormRenderer/index.js.map +0 -1
  230. package/src/components/Iconify/Iconify.js +0 -26
  231. package/src/components/Iconify/Iconify.js.map +0 -1
  232. package/src/components/Lists.styles.js +0 -38
  233. package/src/components/Lists.styles.js.map +0 -1
  234. package/src/components/Tabs/CompleteTabButton.js +0 -29
  235. package/src/components/Tabs/CompleteTabButton.js.map +0 -1
  236. package/src/components/Tabs/FormBodySingleTab.js +0 -39
  237. package/src/components/Tabs/FormBodySingleTab.js.map +0 -1
  238. package/src/components/Tabs/FormBodyTabList.js +0 -52
  239. package/src/components/Tabs/FormBodyTabList.js.map +0 -1
  240. package/src/components/index.js +0 -18
  241. package/src/components/index.js.map +0 -1
  242. package/src/hooks/useBackToTop.js.map +0 -1
  243. package/src/hooks/useDebounce.js +0 -38
  244. package/src/hooks/useDebounce.js.map +0 -1
  245. package/src/hooks/useDecimalCalculatedExpression.js +0 -50
  246. package/src/hooks/useDecimalCalculatedExpression.js.map +0 -1
  247. package/src/hooks/useHidden.js +0 -35
  248. package/src/hooks/useHidden.js.map +0 -1
  249. package/src/hooks/useInitialiseGroupTable.js.map +0 -1
  250. package/src/hooks/useInitialiseRenderer.js +0 -49
  251. package/src/hooks/useInitialiseRenderer.js.map +0 -1
  252. package/src/hooks/useInitialiseRepeatAnswers.js.map +0 -1
  253. package/src/hooks/useInitialiseRepeatGroups.js +0 -36
  254. package/src/hooks/useInitialiseRepeatGroups.js.map +0 -1
  255. package/src/hooks/useIntegerCalculatedExpression.js +0 -44
  256. package/src/hooks/useIntegerCalculatedExpression.js.map +0 -1
  257. package/src/hooks/useQueryClient.js.map +0 -1
  258. package/src/hooks/useRenderingExtensions.js +0 -30
  259. package/src/hooks/useRenderingExtensions.js.map +0 -1
  260. package/src/hooks/useResponsive.js +0 -37
  261. package/src/hooks/useResponsive.js.map +0 -1
  262. package/src/hooks/useStringCalculatedExpression.js +0 -44
  263. package/src/hooks/useStringCalculatedExpression.js.map +0 -1
  264. package/src/hooks/useTerminologyServerQuery.js +0 -73
  265. package/src/hooks/useTerminologyServerQuery.js.map +0 -1
  266. package/src/hooks/useValidationError.js +0 -38
  267. package/src/hooks/useValidationError.js.map +0 -1
  268. package/src/hooks/useValueSetCodings.js +0 -125
  269. package/src/hooks/useValueSetCodings.js.map +0 -1
  270. package/src/index.js +0 -2
  271. package/src/index.js.map +0 -1
  272. package/src/interfaces/answerExpression.interface.js.map +0 -1
  273. package/src/interfaces/calculatedExpression.interface.js +0 -2
  274. package/src/interfaces/calculatedExpression.interface.js.map +0 -1
  275. package/src/interfaces/choice.enum.js +0 -41
  276. package/src/interfaces/choice.enum.js.map +0 -1
  277. package/src/interfaces/enableWhen.interface.js.map +0 -1
  278. package/src/interfaces/groupTable.interface.js +0 -18
  279. package/src/interfaces/groupTable.interface.js.map +0 -1
  280. package/src/interfaces/populate.interface.js +0 -18
  281. package/src/interfaces/populate.interface.js.map +0 -1
  282. package/src/interfaces/questionnaireStore.interface.js +0 -18
  283. package/src/interfaces/questionnaireStore.interface.js.map +0 -1
  284. package/src/interfaces/regex.interface.js +0 -18
  285. package/src/interfaces/regex.interface.js.map +0 -1
  286. package/src/interfaces/renderProps.interface.js +0 -18
  287. package/src/interfaces/renderProps.interface.js.map +0 -1
  288. package/src/interfaces/repeatGroup.interface.js +0 -18
  289. package/src/interfaces/repeatGroup.interface.js.map +0 -1
  290. package/src/interfaces/repeatItem.interface.js +0 -2
  291. package/src/interfaces/repeatItem.interface.js.map +0 -1
  292. package/src/interfaces/tab.interface.js +0 -2
  293. package/src/interfaces/tab.interface.js.map +0 -1
  294. package/src/interfaces/valueSet.interface.js +0 -18
  295. package/src/interfaces/valueSet.interface.js.map +0 -1
  296. package/src/interfaces/variables.interface.js +0 -18
  297. package/src/interfaces/variables.interface.js.map +0 -1
  298. package/src/setup-jest.js +0 -2
  299. package/src/setup-jest.js.map +0 -1
  300. package/src/stores/useConfigStore.js +0 -17
  301. package/src/stores/useConfigStore.js.map +0 -1
  302. package/src/stores/useQuestionnaireResponseStore.js +0 -39
  303. package/src/stores/useQuestionnaireResponseStore.js.map +0 -1
  304. package/src/stores/useQuestionnaireStore.js +0 -151
  305. package/src/stores/useQuestionnaireStore.js.map +0 -1
  306. package/src/stories/SmartFormsRenderer.stories.js +0 -90
  307. package/src/stories/SmartFormsRenderer.stories.js.map +0 -1
  308. package/src/utils/calculatedExpression.js +0 -180
  309. package/src/utils/calculatedExpression.js.map +0 -1
  310. package/src/utils/choice.js +0 -160
  311. package/src/utils/choice.js.map +0 -1
  312. package/src/utils/debounce.js +0 -19
  313. package/src/utils/debounce.js.map +0 -1
  314. package/src/utils/emptyResource.js +0 -25
  315. package/src/utils/emptyResource.js.map +0 -1
  316. package/src/utils/enableWhen.js +0 -228
  317. package/src/utils/enableWhen.js.map +0 -1
  318. package/src/utils/enableWhenExpression.js +0 -76
  319. package/src/utils/enableWhenExpression.js.map +0 -1
  320. package/src/utils/fhirpath.js +0 -98
  321. package/src/utils/fhirpath.js.map +0 -1
  322. package/src/utils/initialiseForm.js +0 -45
  323. package/src/utils/initialiseForm.js.map +0 -1
  324. package/src/utils/itemControl.js +0 -299
  325. package/src/utils/itemControl.js.map +0 -1
  326. package/src/utils/mapItem.js +0 -80
  327. package/src/utils/mapItem.js.map +0 -1
  328. package/src/utils/openChoice.js +0 -150
  329. package/src/utils/openChoice.js.map +0 -1
  330. package/src/utils/parseInputs.js +0 -49
  331. package/src/utils/parseInputs.js.map +0 -1
  332. package/src/utils/populate.js +0 -78
  333. package/src/utils/populate.js.map +0 -1
  334. package/src/utils/populateCallback.js +0 -40
  335. package/src/utils/populateCallback.js.map +0 -1
  336. package/src/utils/populateContexts.js +0 -76
  337. package/src/utils/populateContexts.js.map +0 -1
  338. package/src/utils/populateInputParams.js +0 -193
  339. package/src/utils/populateInputParams.js.map +0 -1
  340. package/src/utils/qItem.js +0 -73
  341. package/src/utils/qItem.js.map +0 -1
  342. package/src/utils/qrItem.js +0 -221
  343. package/src/utils/qrItem.js.map +0 -1
  344. package/src/utils/questionnaireStoreUtils/addAdditionalVariables.js +0 -47
  345. package/src/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +0 -1
  346. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.js +0 -79
  347. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +0 -1
  348. package/src/utils/questionnaireStoreUtils/extractContainedValueSets.js +0 -59
  349. package/src/utils/questionnaireStoreUtils/extractContainedValueSets.js.map +0 -1
  350. package/src/utils/questionnaireStoreUtils/extractLaunchContext.js +0 -18
  351. package/src/utils/questionnaireStoreUtils/extractLaunchContext.js.map +0 -1
  352. package/src/utils/questionnaireStoreUtils/extractOtherExtensions.js +0 -174
  353. package/src/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +0 -1
  354. package/src/utils/questionnaireStoreUtils/extractTabs.js +0 -31
  355. package/src/utils/questionnaireStoreUtils/extractTabs.js.map +0 -1
  356. package/src/utils/questionnaireStoreUtils/extractVariables.js +0 -63
  357. package/src/utils/questionnaireStoreUtils/extractVariables.js.map +0 -1
  358. package/src/utils/questionnaireStoreUtils/resolveValueSets.js +0 -58
  359. package/src/utils/questionnaireStoreUtils/resolveValueSets.js.map +0 -1
  360. package/src/utils/tabs.js +0 -190
  361. package/src/utils/tabs.js.map +0 -1
  362. package/src/utils/valueSet.js +0 -126
  363. package/src/utils/valueSet.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormBodyTabList.js","sourceRoot":"","sources":["FormBodyTabList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAA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AAK;wBACN,QAAQ,CAAC;4BACP,iBAAiB,EAAE,KAAK;4BACxB,qBAAqB;4BACrB,eAAe;4BACf,qBAAqB;yBACtB,CAAC,EACF;wBACA,OAAO,IAAI,CAAC;qBACb;oBAED,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;oBAClE,MAAM,QAAQ,GAAG,MAAA,MAAA,YAAY,CAAC,KAAK,CAAC,mCAAI,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC;oBAEzD,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG;wBACvC,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,CAAC,GACZ,CACO,CACZ,CAAC;gBACJ,CAAC,CAAC,CACc,CACI,CACpB,CACD,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC"}
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- export * from './FormRenderer';
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,gBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBackToTop.js","sourceRoot":"","sources":["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,38 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect, useState } from 'react';
18
- // Lifted from https://usehooks.com/useDebounce/
19
- function useDebounce(value, delay) {
20
- // State and setters for debounced value
21
- const [debouncedValue, setDebouncedValue] = useState(value);
22
- useEffect(() => {
23
- // Update debounced value after delay
24
- const handler = setTimeout(() => {
25
- setDebouncedValue(value);
26
- }, delay);
27
- // Cancel the timeout if value changes (also on delay change or unmount)
28
- // This is how we prevent debounced value from updating if value is changed ...
29
- // .. within the delay period. Timeout gets cleared and restarted.
30
- return () => {
31
- clearTimeout(handler);
32
- };
33
- }, [value, delay] // Only re-call effect if value or delay changes
34
- );
35
- return debouncedValue;
36
- }
37
- export default useDebounce;
38
- //# sourceMappingURL=useDebounce.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDebounce.js","sourceRoot":"","sources":["useDebounce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,gDAAgD;AAChD,SAAS,WAAW,CAAC,KAAa,EAAE,KAAa;IAC/C,wCAAwC;IACxC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAS,KAAK,CAAC,CAAC;IAEpE,SAAS,CACP,GAAG,EAAE;QACH,qCAAqC;QACrC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,wEAAwE;QACxE,+EAA+E;QAC/E,kEAAkE;QAClE,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EACD,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,gDAAgD;KAChE,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,eAAe,WAAW,CAAC"}
@@ -1,50 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect, useState } from 'react';
18
- import { createEmptyQrItemWithUnit } from '../utils/qrItem';
19
- import useQuestionnaireStore from '../stores/useQuestionnaireStore';
20
- function useDecimalCalculatedExpression(props) {
21
- const { qItem, inputValue, displayUnit, precision, setInputValue, onQrItemChange } = props;
22
- const calculatedExpressions = useQuestionnaireStore((state) => state.calculatedExpressions);
23
- const [calcExpUpdated, setCalcExpUpdated] = useState(false);
24
- useEffect(() => {
25
- const calcExpression = calculatedExpressions[qItem.linkId];
26
- // only update if calculated value is different from current value
27
- if ((calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) !== inputValue && typeof (calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) === 'number') {
28
- const value = precision
29
- ? parseFloat(calcExpression.value.toFixed(precision))
30
- : calcExpression.value;
31
- // only update if calculated value is different from current value
32
- if (value !== parseFloat(inputValue)) {
33
- // update ui to show calculated value changes
34
- setCalcExpUpdated(true);
35
- setTimeout(() => {
36
- setCalcExpUpdated(false);
37
- }, 500);
38
- // update questionnaireResponse
39
- setInputValue(precision ? value.toFixed(precision) : value.toString());
40
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItemWithUnit(qItem, displayUnit)), { answer: [{ valueDecimal: value }] }));
41
- }
42
- }
43
- },
44
- // Only trigger this effect if calculatedExpression of item changes
45
- // eslint-disable-next-line react-hooks/exhaustive-deps
46
- [calculatedExpressions]);
47
- return { calcExpUpdated: calcExpUpdated };
48
- }
49
- export default useDecimalCalculatedExpression;
50
- //# sourceMappingURL=useDecimalCalculatedExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDecimalCalculatedExpression.js","sourceRoot":"","sources":["useDecimalCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AAepE,SAAS,8BAA8B,C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EAAE,CAAC,IACjC,CAAC;aACJ;SACF;IACH,CAAC;IACD,mEAAmE;IACnE,uDAAuD;IACvD,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC5C,CAAC;AAED,eAAe,8BAA8B,CAAC"}
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { hasHiddenExtension } from '../utils/itemControl';
18
- import useQuestionnaireStore from '../stores/useQuestionnaireStore';
19
- import { isHiddenByEnableWhens } from '../utils/qItem';
20
- function useHidden(qItem) {
21
- const enableWhenIsActivated = useQuestionnaireStore((state) => state.enableWhenIsActivated);
22
- const enableWhenItems = useQuestionnaireStore((state) => state.enableWhenItems);
23
- const enableWhenExpressions = useQuestionnaireStore((state) => state.enableWhenExpressions);
24
- if (hasHiddenExtension(qItem)) {
25
- return true;
26
- }
27
- return isHiddenByEnableWhens({
28
- linkId: qItem.linkId,
29
- enableWhenIsActivated,
30
- enableWhenItems,
31
- enableWhenExpressions
32
- });
33
- }
34
- export default useHidden;
35
- //# sourceMappingURL=useHidden.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useHidden.js","sourceRoot":"","sources":["useHidden.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,qBAAqB,MAAM,iCAAiC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,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 { useLayoutEffect, useState } from 'react';
18
- import { createQuestionnaireResponse } from '../utils/qrItem';
19
- import useQuestionnaireStore from '../stores/useQuestionnaireStore';
20
- import useQuestionnaireResponseStore from '../stores/useQuestionnaireResponseStore';
21
- function useInitialiseRenderer(questionnaire, questionnaireResponse, additionalVariables) {
22
- const buildSourceQuestionnaire = useQuestionnaireStore((state) => state.buildSourceQuestionnaire);
23
- const updatePopulatedProperties = useQuestionnaireStore((state) => state.updatePopulatedProperties);
24
- const buildSourceResponse = useQuestionnaireResponseStore((state) => state.buildSourceResponse);
25
- const populateResponse = useQuestionnaireResponseStore((state) => state.populateResponse);
26
- const [loading, setLoading] = useState(true);
27
- useLayoutEffect(() => {
28
- setLoading(true);
29
- buildSourceQuestionnaire(questionnaire, questionnaireResponse, additionalVariables).then(() => {
30
- buildSourceResponse(createQuestionnaireResponse(questionnaire));
31
- if (questionnaireResponse) {
32
- const updatedResponse = updatePopulatedProperties(questionnaireResponse);
33
- populateResponse(updatedResponse);
34
- }
35
- setLoading(false);
36
- });
37
- }, [
38
- questionnaire,
39
- questionnaireResponse,
40
- buildSourceQuestionnaire,
41
- buildSourceResponse,
42
- populateResponse,
43
- updatePopulatedProperties,
44
- additionalVariables
45
- ]);
46
- return loading;
47
- }
48
- export default useInitialiseRenderer;
49
- //# sourceMappingURL=useInitialiseRenderer.js.map
@@ -1 +0,0 @@
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AAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE;QACD,aAAa;QACb,qBAAqB;QACrB,wBAAwB;QACxB,mBAAmB;QACnB,gBAAgB;QAChB,yBAAyB;QACzB,mBAAmB;KACpB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,eAAe,qBAAqB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInitialiseRepeatAnswers.js","sourceRoot":"","sources":["useInitialiseRepeatAnswers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,SAAS,0BAA0B,CAAC,MAAiC;IACnE,IAAI,oBAAoB,GAAmB;QACzC;YACE,MAAM,EAAE,MAAM,EAAE;YAChB,MAAM,EAAE,IAAI;SACb;KACF,CAAC;IAEF,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,EAAE;QAClB,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAClD,OAAO;gBACL,MAAM,EAAE,MAAM,EAAE;gBAChB,MAAM;aACP,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,eAAe,0BAA0B,CAAC"}
@@ -1,36 +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 { nanoid } from 'nanoid';
18
- function useInitialiseRepeatGroups(qrItems) {
19
- let initialRepeatGroupAnswers = [
20
- {
21
- nanoId: nanoid(),
22
- qrItem: null
23
- }
24
- ];
25
- if (qrItems.length > 0) {
26
- initialRepeatGroupAnswers = qrItems.map((qrItem) => {
27
- return {
28
- nanoId: nanoid(),
29
- qrItem
30
- };
31
- });
32
- }
33
- return initialRepeatGroupAnswers;
34
- }
35
- export default useInitialiseRepeatGroups;
36
- //# sourceMappingURL=useInitialiseRepeatGroups.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInitialiseRepeatGroups.js","sourceRoot":"","sources":["useInitialiseRepeatGroups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,SAAS,yBAAyB,CAAC,OAAoC;IACrE,IAAI,yBAAyB,GAAwB;QACnD;YACE,MAAM,EAAE,MAAM,EAAE;YAChB,MAAM,EAAE,IAAI;SACb;KACF,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,yBAAyB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACjD,OAAO;gBACL,MAAM,EAAE,MAAM,EAAE;gBAChB,MAAM;aACP,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAED,eAAe,yBAAyB,CAAC"}
@@ -1,44 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect, useState } from 'react';
18
- import { createEmptyQrItemWithUnit } from '../utils/qrItem';
19
- import useQuestionnaireStore from '../stores/useQuestionnaireStore';
20
- function useIntegerCalculatedExpression(props) {
21
- const { qItem, inputValue, displayUnit, setInputValue, onQrItemChange } = props;
22
- const calculatedExpressions = useQuestionnaireStore((state) => state.calculatedExpressions);
23
- const [calcExpUpdated, setCalcExpUpdated] = useState(false);
24
- useEffect(() => {
25
- const calcExpression = calculatedExpressions[qItem.linkId];
26
- // only update if calculated value is different from current value
27
- if ((calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) !== inputValue && typeof (calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) === 'number') {
28
- // update ui to show calculated value changes
29
- setCalcExpUpdated(true);
30
- setTimeout(() => {
31
- setCalcExpUpdated(false);
32
- }, 500);
33
- // update questionnaireResponse
34
- setInputValue(calcExpression.value);
35
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItemWithUnit(qItem, displayUnit)), { answer: [{ valueInteger: calcExpression.value }] }));
36
- }
37
- },
38
- // Only trigger this effect if calculatedExpression of item changes
39
- // eslint-disable-next-line react-hooks/exhaustive-deps
40
- [calculatedExpressions]);
41
- return { calcExpUpdated: calcExpUpdated };
42
- }
43
- export default useIntegerCalculatedExpression;
44
- //# sourceMappingURL=useIntegerCalculatedExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntegerCalculatedExpression.js","sourceRoot":"","sources":["useIntegerCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AAcpE,SA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;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,SAAS,cAAc;IACrB,OAAO,IAAI,WAAW,CAAC;QACrB,cAAc,EAAE;YACd,OAAO,EAAE;gBACP,oBAAoB,EAAE,KAAK;gBAC3B,gBAAgB,EAAE,IAAI;aACvB;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -1,30 +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 { getEntryFormat, getMaxLength, getReadOnly, getRegexValidation, getTextDisplayInstructions, getTextDisplayPrompt, getTextDisplayUnit } from '../utils/itemControl';
18
- function useRenderingExtensions(qItem) {
19
- return {
20
- displayUnit: getTextDisplayUnit(qItem),
21
- displayPrompt: getTextDisplayPrompt(qItem),
22
- displayInstructions: getTextDisplayInstructions(qItem),
23
- readOnly: getReadOnly(qItem),
24
- entryFormat: getEntryFormat(qItem),
25
- regexValidation: getRegexValidation(qItem),
26
- maxLength: getMaxLength(qItem)
27
- };
28
- }
29
- export default useRenderingExtensions;
30
- //# sourceMappingURL=useRenderingExtensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRenderingExtensions.js","sourceRoot":"","sources":["useRenderingExtensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAc9B,SAAS,sBAAsB,CAAC,KAAwB;IACtD,OAAO;QACL,WAAW,EAAE,kBAAkB,CAAC,KAAK,CAAC;QACtC,aAAa,EAAE,oBAAoB,CAAC,KAAK,CAAC;QAC1C,mBAAmB,EAAE,0BAA0B,CAAC,KAAK,CAAC;QACtD,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC;QAC5B,WAAW,EAAE,cAAc,CAAC,KAAK,CAAC;QAClC,eAAe,EAAE,kBAAkB,CAAC,KAAK,CAAC;QAC1C,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC;KAC/B,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
@@ -1,37 +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 { useTheme } from '@mui/material/styles';
18
- import useMediaQuery from '@mui/material/useMediaQuery';
19
- function useResponsive(query, start, end = 'xl') {
20
- const theme = useTheme();
21
- const mediaUp = useMediaQuery(theme.breakpoints.up(start));
22
- const mediaDown = useMediaQuery(theme.breakpoints.down(start));
23
- const mediaBetween = useMediaQuery(theme.breakpoints.between(start, end));
24
- const mediaOnly = useMediaQuery(theme.breakpoints.only(start));
25
- if (query === 'up') {
26
- return mediaUp;
27
- }
28
- if (query === 'down') {
29
- return mediaDown;
30
- }
31
- if (query === 'between') {
32
- return mediaBetween;
33
- }
34
- return mediaOnly;
35
- }
36
- export default useResponsive;
37
- //# sourceMappingURL=useResponsive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useResponsive.js","sourceRoot":"","sources":["useResponsive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,SAAS,aAAa,CACpB,KAAyC,EACzC,KAAuC,EACvC,MAAwC,IAAI;IAE5C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAE3D,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/D,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAE1E,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/D,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,KAAK,KAAK,MAAM,EAAE;QACpB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,YAAY,CAAC;KACrB;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -1,44 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { useEffect, useState } from 'react';
18
- import { createEmptyQrItem } from '../utils/qrItem';
19
- import useQuestionnaireStore from '../stores/useQuestionnaireStore';
20
- function useStringCalculatedExpression(props) {
21
- const { qItem, inputValue, setInputValue, onQrItemChange } = props;
22
- const calculatedExpressions = useQuestionnaireStore((state) => state.calculatedExpressions);
23
- const [calcExpUpdated, setCalcExpUpdated] = useState(false);
24
- useEffect(() => {
25
- const calcExpression = calculatedExpressions[qItem.linkId];
26
- // only update if calculated value is different from current value
27
- if ((calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) !== inputValue && typeof (calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) === 'string') {
28
- // update ui to show calculated value changes
29
- setCalcExpUpdated(true);
30
- setTimeout(() => {
31
- setCalcExpUpdated(false);
32
- }, 500);
33
- // update questionnaireResponse
34
- setInputValue(calcExpression.value);
35
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueString: calcExpression.value }] }));
36
- }
37
- },
38
- // Only trigger this effect if calculatedExpression of item changes
39
- // eslint-disable-next-line react-hooks/exhaustive-deps
40
- [calculatedExpressions]);
41
- return { calcExpUpdated: calcExpUpdated };
42
- }
43
- export default useStringCalculatedExpression;
44
- //# sourceMappingURL=useStringCalculatedExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStringCalculatedExpression.js","sourceRoot":"","sources":["useStringCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,qBAAqB,MAA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ensed 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 { useQuery } from '@tanstack/react-query';
18
- import { getValueSetCodings, getValueSetPromise } from '../utils/valueSet';
19
- import useQuestionnaireStore from '../stores/useQuestionnaireStore';
20
- function useTerminologyServerQuery(answerValueSetUrl, maxList, input, searchTerm, terminologyServerUrl) {
21
- var _a;
22
- const processedValueSetUrls = useQuestionnaireStore((state) => state.processedValueSetUrls);
23
- let fullUrl = '';
24
- let options = [];
25
- let loading = false;
26
- let feedback;
27
- if (input.length === 0) {
28
- feedback = undefined;
29
- }
30
- if (searchTerm.length < 2 && searchTerm.length > 0) {
31
- feedback = { message: 'Enter at least 2 characters to search for results.', color: 'info' };
32
- }
33
- // Restructure url to include filter and count parameters
34
- if (answerValueSetUrl) {
35
- if (answerValueSetUrl.startsWith('#')) {
36
- answerValueSetUrl = answerValueSetUrl.slice(1);
37
- }
38
- // attempt to get url from contained value sets when loading questionnaire
39
- if (processedValueSetUrls[answerValueSetUrl]) {
40
- answerValueSetUrl = processedValueSetUrls[answerValueSetUrl];
41
- }
42
- const urlWithTrailingAmpersand = answerValueSetUrl + (answerValueSetUrl[answerValueSetUrl.length - 1] !== '&' ? '&' : '');
43
- fullUrl = urlWithTrailingAmpersand + 'filter=' + searchTerm + '&count=' + maxList;
44
- }
45
- // Perform query
46
- const { isInitialLoading, error, data } = useQuery(['expandValueSet', fullUrl], () => getValueSetPromise(fullUrl, terminologyServerUrl), {
47
- enabled: searchTerm.length >= 2 && answerValueSetUrl !== undefined
48
- });
49
- if (isInitialLoading) {
50
- loading = true;
51
- }
52
- if (error) {
53
- console.warn('Ontoserver query failed. Details below: \n' + error);
54
- feedback = {
55
- message: 'An error occurred. Try again later or try searching for a different term.',
56
- color: 'error'
57
- };
58
- }
59
- if (data) {
60
- if (((_a = data.expansion) === null || _a === void 0 ? void 0 : _a.total) !== 0) {
61
- options = getValueSetCodings(data);
62
- }
63
- else {
64
- feedback = {
65
- message: "We couldn't seem to find anything. Try searching for a different term.",
66
- color: 'warning'
67
- };
68
- }
69
- }
70
- return { options, loading, feedback };
71
- }
72
- export default useTerminologyServerQuery;
73
- //# sourceMappingURL=useTerminologyServerQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTerminologyServerQuery.js","sourceRoot":"","sources":["useTerminologyServerQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG3E,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AAEpE,SAAS,yBAAyB,CAChC,iBAAqC,EACrC,OAAe,EACf,KAAa,EACb,UAAkB,EAClB,oBAA6B;;IAE7B,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAE5F,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,OAAO,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,QAA4D,CAAC;IAEjE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,QAAQ,GAAG,SAAS,CAAC;KACtB;IAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QAClD,QAAQ,GAAG,EAAE,OAAO,EAAE,oDAAoD,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;KAC7F;IAED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,GAAG;gBACT,OAAO,EAAE,wEAAwE;gBACjF,KAAK,EAAE,SAAS;aACjB,CAAC;SACH;KACF;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACxC,CAAC;AACD,eAAe,yBAAyB,CAAC"}
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- function useValidationError(input, regexValidation, maxLength) {
18
- var _a;
19
- let feedback = '';
20
- if (input) {
21
- // Test regex
22
- if (regexValidation) {
23
- if (!regexValidation.expression.test(input)) {
24
- feedback =
25
- (_a = regexValidation.feedback) !== null && _a !== void 0 ? _a : `Input should match the specified regex ${regexValidation.expression}`;
26
- }
27
- }
28
- // Test max character limit
29
- if (maxLength) {
30
- if (input.length > maxLength) {
31
- feedback = 'Input exceeds maximum character limit.';
32
- }
33
- }
34
- }
35
- return feedback;
36
- }
37
- export default useValidationError;
38
- //# sourceMappingURL=useValidationError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useValidationError.js","sourceRoot":"","sources":["useValidationError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,SAAS,kBAAkB,CACzB,KAAa,EACb,eAAuC,EACvC,SAAwB;;IAExB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,IAAI,KAAK,EAAE;QACT,aAAa;QACb,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBAC3C,QAAQ;oBACN,MAAA,eAAe,CAAC,QAAQ,mCACxB,0CAA0C,eAAe,CAAC,UAAU,EAAE,CAAC;aAC1E;SACF;QAED,2BAA2B;QAC3B,IAAI,SAAS,EAAE;YACb,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,EAAE;gBAC5B,QAAQ,GAAG,wCAAwC,CAAC;aACrD;SACF;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,eAAe,kBAAkB,CAAC"}