@aehrc/smart-forms-renderer 0.3.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 (710) hide show
  1. package/.storybook/main.ts +28 -0
  2. package/.storybook/preview.ts +34 -0
  3. package/__mocks__/zustand.ts +60 -0
  4. package/jest.config.ts +16 -0
  5. package/lib/api/populate.js +63 -0
  6. package/lib/api/populate.js.map +1 -0
  7. package/{dist → lib}/components/Alert.styles.d.ts +5 -5
  8. package/lib/components/Alert.styles.js +40 -0
  9. package/lib/components/Alert.styles.js.map +1 -0
  10. package/lib/components/BackToTopButton/BackToTopButton.js +32 -0
  11. package/lib/components/BackToTopButton/BackToTopButton.js.map +1 -0
  12. package/{dist → lib}/components/Box.styles.d.ts +15 -15
  13. package/lib/components/Box.styles.js +30 -0
  14. package/lib/components/Box.styles.js.map +1 -0
  15. package/lib/components/FormComponents/BooleanItem/BooleanField.js +24 -0
  16. package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -0
  17. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +49 -0
  18. package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -0
  19. package/lib/components/FormComponents/DateItem/DateField.js +31 -0
  20. package/lib/components/FormComponents/DateItem/DateField.js.map +1 -0
  21. package/lib/components/FormComponents/DateItem/DateItem.js +52 -0
  22. package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -0
  23. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js +33 -0
  24. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js.map +1 -0
  25. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +52 -0
  26. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -0
  27. package/lib/components/FormComponents/DecimalItem/DecimalField.js +30 -0
  28. package/lib/components/FormComponents/DecimalItem/DecimalField.js.map +1 -0
  29. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +80 -0
  30. package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -0
  31. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +26 -0
  32. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js.map +1 -0
  33. package/{dist → lib}/components/FormComponents/DisplayItem/DisplayInstructions.styles.d.ts +5 -5
  34. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js +23 -0
  35. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js.map +1 -0
  36. package/lib/components/FormComponents/DisplayItem/DisplayItem.js +31 -0
  37. package/lib/components/FormComponents/DisplayItem/DisplayItem.js.map +1 -0
  38. package/{dist → lib}/components/FormComponents/GridGroup/GridGroup.d.ts +1 -1
  39. package/lib/components/FormComponents/GridGroup/GridGroup.js +58 -0
  40. package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -0
  41. package/{dist → lib}/components/FormComponents/GridGroup/GridRow.d.ts +1 -1
  42. package/lib/components/FormComponents/GridGroup/GridRow.js +55 -0
  43. package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -0
  44. package/lib/components/FormComponents/GridGroup/GridTable.js +42 -0
  45. package/lib/components/FormComponents/GridGroup/GridTable.js.map +1 -0
  46. package/lib/components/FormComponents/GroupItem/GroupHeading.js +39 -0
  47. package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -0
  48. package/{dist → lib}/components/FormComponents/GroupItem/GroupItem.d.ts +1 -1
  49. package/lib/components/FormComponents/GroupItem/GroupItem.js +62 -0
  50. package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -0
  51. package/{dist → lib}/components/FormComponents/GroupItem/GroupItem.styles.d.ts +5 -5
  52. package/lib/components/FormComponents/GroupItem/GroupItem.styles.js +27 -0
  53. package/lib/components/FormComponents/GroupItem/GroupItem.styles.js.map +1 -0
  54. package/{dist → lib}/components/FormComponents/GroupItem/GroupItemSwitcher.d.ts +1 -1
  55. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +73 -0
  56. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -0
  57. package/lib/components/FormComponents/GroupItem/NextTabButton.js +25 -0
  58. package/lib/components/FormComponents/GroupItem/NextTabButton.js.map +1 -0
  59. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js +55 -0
  60. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js.map +1 -0
  61. package/lib/components/FormComponents/IntegerItem/IntegerField.js +30 -0
  62. package/lib/components/FormComponents/IntegerItem/IntegerField.js.map +1 -0
  63. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +73 -0
  64. package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -0
  65. package/lib/components/FormComponents/Item.styles.d.ts +6 -0
  66. package/lib/components/FormComponents/Item.styles.js +27 -0
  67. package/lib/components/FormComponents/Item.styles.js.map +1 -0
  68. package/lib/components/FormComponents/ItemParts/ContextDisplayItem.js +29 -0
  69. package/lib/components/FormComponents/ItemParts/ContextDisplayItem.js.map +1 -0
  70. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +26 -0
  71. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js.map +1 -0
  72. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +31 -0
  73. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -0
  74. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +45 -0
  75. package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -0
  76. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +32 -0
  77. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -0
  78. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js +24 -0
  79. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js.map +1 -0
  80. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js +33 -0
  81. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js.map +1 -0
  82. package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js +31 -0
  83. package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js.map +1 -0
  84. package/{dist → lib}/components/FormComponents/Lists.styles.d.ts +5 -5
  85. package/lib/components/FormComponents/Lists.styles.js +38 -0
  86. package/lib/components/FormComponents/Lists.styles.js.map +1 -0
  87. package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoice.d.ts +1 -1
  88. package/lib/components/FormComponents/QItemChoice/QItemChoice.js +61 -0
  89. package/lib/components/FormComponents/QItemChoice/QItemChoice.js.map +1 -0
  90. package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.d.ts +1 -1
  91. package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js +85 -0
  92. package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js.map +1 -0
  93. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js +70 -0
  94. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js.map +1 -0
  95. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js +66 -0
  96. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js.map +1 -0
  97. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js +70 -0
  98. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js.map +1 -0
  99. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js +70 -0
  100. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js.map +1 -0
  101. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js +24 -0
  102. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js.map +1 -0
  103. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js +70 -0
  104. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js.map +1 -0
  105. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js +80 -0
  106. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js.map +1 -0
  107. package/{dist → lib}/components/FormComponents/QItemOpenChoice/QItemOpenChoice.d.ts +1 -1
  108. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js +49 -0
  109. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js.map +1 -0
  110. package/{dist → lib}/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.d.ts +1 -1
  111. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js +104 -0
  112. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js.map +1 -0
  113. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js +105 -0
  114. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js.map +1 -0
  115. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js +116 -0
  116. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js.map +1 -0
  117. package/{dist → lib}/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.d.ts +1 -1
  118. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js +74 -0
  119. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js.map +1 -0
  120. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js +66 -0
  121. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map +1 -0
  122. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +27 -0
  123. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js.map +1 -0
  124. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +30 -0
  125. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +1 -0
  126. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +81 -0
  127. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -0
  128. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +30 -0
  129. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -0
  130. package/lib/components/FormComponents/RepeatItem/AddItemButton.js +27 -0
  131. package/lib/components/FormComponents/RepeatItem/AddItemButton.js.map +1 -0
  132. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +30 -0
  133. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +1 -0
  134. package/lib/components/FormComponents/RepeatItem/RepeatField.js +31 -0
  135. package/lib/components/FormComponents/RepeatItem/RepeatField.js.map +1 -0
  136. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +69 -0
  137. package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -0
  138. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.d.ts +22 -0
  139. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js +29 -0
  140. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js.map +1 -0
  141. package/lib/components/FormComponents/SingleItem/SingleItem.js +32 -0
  142. package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -0
  143. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +63 -0
  144. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -0
  145. package/lib/components/FormComponents/StringItem/StringField.js +30 -0
  146. package/lib/components/FormComponents/StringItem/StringField.js.map +1 -0
  147. package/lib/components/FormComponents/StringItem/StringItem.js +71 -0
  148. package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -0
  149. package/lib/components/FormComponents/Tables/DeleteRowButton.js +31 -0
  150. package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +1 -0
  151. package/{dist → lib}/components/FormComponents/Tables/QItemGroupTable.d.ts +1 -1
  152. package/lib/components/FormComponents/Tables/QItemGroupTable.js +99 -0
  153. package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +1 -0
  154. package/{dist → lib}/components/FormComponents/Tables/QItemGroupTableRow.d.ts +1 -1
  155. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +46 -0
  156. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +1 -0
  157. package/lib/components/FormComponents/Tables/Table.styles.js +46 -0
  158. package/lib/components/FormComponents/Tables/Table.styles.js.map +1 -0
  159. package/lib/components/FormComponents/TextItem/TextField.js +29 -0
  160. package/lib/components/FormComponents/TextItem/TextField.js.map +1 -0
  161. package/lib/components/FormComponents/TextItem/TextItem.js +71 -0
  162. package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -0
  163. package/{dist → lib}/components/FormComponents/Textfield.styles.d.ts +1 -1
  164. package/lib/components/FormComponents/Textfield.styles.js +27 -0
  165. package/lib/components/FormComponents/Textfield.styles.js.map +1 -0
  166. package/lib/components/FormComponents/TimeItem/TimeField.js +30 -0
  167. package/lib/components/FormComponents/TimeItem/TimeField.js.map +1 -0
  168. package/lib/components/FormComponents/TimeItem/TimeItem.js +52 -0
  169. package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -0
  170. package/lib/components/FormComponents/Typography.styles.d.ts +6 -0
  171. package/lib/components/FormComponents/Typography.styles.js +23 -0
  172. package/lib/components/FormComponents/Typography.styles.js.map +1 -0
  173. package/lib/components/FormComponents/UrlItem/UrlField.js +25 -0
  174. package/lib/components/FormComponents/UrlItem/UrlField.js.map +1 -0
  175. package/lib/components/FormComponents/UrlItem/UrlItem.js +61 -0
  176. package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -0
  177. package/lib/components/FormRenderer/BaseRenderer.js +54 -0
  178. package/lib/components/FormRenderer/BaseRenderer.js.map +1 -0
  179. package/lib/components/FormRenderer/FormBodyCollapsible.js +57 -0
  180. package/lib/components/FormRenderer/FormBodyCollapsible.js.map +1 -0
  181. package/lib/components/FormRenderer/FormBodySingleCollapsible.js +39 -0
  182. package/lib/components/FormRenderer/FormBodySingleCollapsible.js.map +1 -0
  183. package/{dist → lib}/components/FormRenderer/FormBodySingleCollapsibleWrapper.d.ts +1 -1
  184. package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.js +31 -0
  185. package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.js.map +1 -0
  186. package/lib/components/FormRenderer/FormBodyTabbed.js +60 -0
  187. package/lib/components/FormRenderer/FormBodyTabbed.js.map +1 -0
  188. package/lib/components/FormRenderer/FormRenderer.js +54 -0
  189. package/lib/components/FormRenderer/FormRenderer.js.map +1 -0
  190. package/lib/components/FormRenderer/FormTitle.js +30 -0
  191. package/lib/components/FormRenderer/FormTitle.js.map +1 -0
  192. package/lib/components/FormRenderer/FormTopLevelItem.js +45 -0
  193. package/lib/components/FormRenderer/FormTopLevelItem.js.map +1 -0
  194. package/lib/components/FormRenderer/SmartFormsRenderer.js +39 -0
  195. package/lib/components/FormRenderer/SmartFormsRenderer.js.map +1 -0
  196. package/lib/components/FormRenderer/index.js +19 -0
  197. package/lib/components/FormRenderer/index.js.map +1 -0
  198. package/lib/components/Iconify/Iconify.js +26 -0
  199. package/lib/components/Iconify/Iconify.js.map +1 -0
  200. package/{dist → lib}/components/Lists.styles.d.ts +6 -6
  201. package/lib/components/Lists.styles.js +38 -0
  202. package/lib/components/Lists.styles.js.map +1 -0
  203. package/lib/components/Tabs/CompleteTabButton.js +29 -0
  204. package/lib/components/Tabs/CompleteTabButton.js.map +1 -0
  205. package/lib/components/Tabs/FormBodySingleTab.js +39 -0
  206. package/lib/components/Tabs/FormBodySingleTab.js.map +1 -0
  207. package/lib/components/Tabs/FormBodyTabList.js +52 -0
  208. package/lib/components/Tabs/FormBodyTabList.js.map +1 -0
  209. package/lib/components/index.js +18 -0
  210. package/lib/components/index.js.map +1 -0
  211. package/lib/hooks/index.js +2 -0
  212. package/lib/hooks/index.js.map +1 -0
  213. package/lib/hooks/useBackToTop.js +26 -0
  214. package/lib/hooks/useBackToTop.js.map +1 -0
  215. package/lib/hooks/useDebounce.js +38 -0
  216. package/lib/hooks/useDebounce.js.map +1 -0
  217. package/lib/hooks/useDecimalCalculatedExpression.js +50 -0
  218. package/lib/hooks/useDecimalCalculatedExpression.js.map +1 -0
  219. package/lib/hooks/useHidden.js +35 -0
  220. package/lib/hooks/useHidden.js.map +1 -0
  221. package/lib/hooks/useInitialiseGroupTable.js +36 -0
  222. package/lib/hooks/useInitialiseGroupTable.js.map +1 -0
  223. package/lib/hooks/useInitialiseRenderer.js +49 -0
  224. package/lib/hooks/useInitialiseRenderer.js.map +1 -0
  225. package/lib/hooks/useInitialiseRepeatAnswers.js +36 -0
  226. package/lib/hooks/useInitialiseRepeatAnswers.js.map +1 -0
  227. package/lib/hooks/useInitialiseRepeatGroups.js +36 -0
  228. package/lib/hooks/useInitialiseRepeatGroups.js.map +1 -0
  229. package/lib/hooks/useIntegerCalculatedExpression.js +44 -0
  230. package/lib/hooks/useIntegerCalculatedExpression.js.map +1 -0
  231. package/lib/hooks/useQueryClient.js +29 -0
  232. package/lib/hooks/useQueryClient.js.map +1 -0
  233. package/lib/hooks/useRenderingExtensions.js +30 -0
  234. package/lib/hooks/useRenderingExtensions.js.map +1 -0
  235. package/lib/hooks/useResponsive.js +37 -0
  236. package/lib/hooks/useResponsive.js.map +1 -0
  237. package/lib/hooks/useStringCalculatedExpression.js +44 -0
  238. package/lib/hooks/useStringCalculatedExpression.js.map +1 -0
  239. package/lib/hooks/useTerminologyServerQuery.js +73 -0
  240. package/lib/hooks/useTerminologyServerQuery.js.map +1 -0
  241. package/lib/hooks/useValidationError.js +38 -0
  242. package/lib/hooks/useValidationError.js.map +1 -0
  243. package/{dist → lib}/hooks/useValueSetCodings.d.ts +1 -1
  244. package/lib/hooks/useValueSetCodings.js +125 -0
  245. package/lib/hooks/useValueSetCodings.js.map +1 -0
  246. package/lib/index.d.ts +89 -0
  247. package/lib/index.js +153 -0
  248. package/lib/index.js.map +1 -0
  249. package/lib/interfaces/answerExpression.interface.js +18 -0
  250. package/lib/interfaces/answerExpression.interface.js.map +1 -0
  251. package/lib/interfaces/calculatedExpression.interface.js +2 -0
  252. package/lib/interfaces/calculatedExpression.interface.js.map +1 -0
  253. package/lib/interfaces/choice.enum.js +41 -0
  254. package/lib/interfaces/choice.enum.js.map +1 -0
  255. package/lib/interfaces/enableWhen.interface.js +18 -0
  256. package/lib/interfaces/enableWhen.interface.js.map +1 -0
  257. package/lib/interfaces/groupTable.interface.js +18 -0
  258. package/lib/interfaces/groupTable.interface.js.map +1 -0
  259. package/lib/interfaces/populate.interface.js +18 -0
  260. package/lib/interfaces/populate.interface.js.map +1 -0
  261. package/lib/interfaces/questionnaireStore.interface.js +18 -0
  262. package/lib/interfaces/questionnaireStore.interface.js.map +1 -0
  263. package/lib/interfaces/regex.interface.js +18 -0
  264. package/lib/interfaces/regex.interface.js.map +1 -0
  265. package/{dist → lib}/interfaces/renderProps.interface.d.ts +1 -1
  266. package/lib/interfaces/renderProps.interface.js +18 -0
  267. package/lib/interfaces/renderProps.interface.js.map +1 -0
  268. package/lib/interfaces/repeatGroup.interface.js +18 -0
  269. package/lib/interfaces/repeatGroup.interface.js.map +1 -0
  270. package/lib/interfaces/repeatItem.interface.js +2 -0
  271. package/lib/interfaces/repeatItem.interface.js.map +1 -0
  272. package/lib/interfaces/tab.interface.js +2 -0
  273. package/lib/interfaces/tab.interface.js.map +1 -0
  274. package/lib/interfaces/valueSet.interface.js +18 -0
  275. package/lib/interfaces/valueSet.interface.js.map +1 -0
  276. package/lib/interfaces/variables.interface.js +18 -0
  277. package/lib/interfaces/variables.interface.js.map +1 -0
  278. package/lib/stores/useConfigStore.js +17 -0
  279. package/lib/stores/useConfigStore.js.map +1 -0
  280. package/lib/stores/useQuestionnaireResponseStore.js +39 -0
  281. package/lib/stores/useQuestionnaireResponseStore.js.map +1 -0
  282. package/lib/stores/useQuestionnaireStore.js +151 -0
  283. package/lib/stores/useQuestionnaireStore.js.map +1 -0
  284. package/lib/theme/Theme.d.ts +38 -0
  285. package/lib/theme/Theme.js +39 -0
  286. package/lib/theme/Theme.js.map +1 -0
  287. package/lib/theme/globalStyles.d.ts +2 -0
  288. package/lib/theme/globalStyles.js +64 -0
  289. package/lib/theme/globalStyles.js.map +1 -0
  290. package/lib/theme/overrides/Accordion.d.ts +14 -0
  291. package/lib/theme/overrides/Accordion.js +32 -0
  292. package/lib/theme/overrides/Accordion.js.map +1 -0
  293. package/lib/theme/overrides/Autocomplete.d.ts +10 -0
  294. package/lib/theme/overrides/Autocomplete.js +28 -0
  295. package/lib/theme/overrides/Autocomplete.js.map +1 -0
  296. package/lib/theme/overrides/Backdrop.d.ts +13 -0
  297. package/lib/theme/overrides/Backdrop.js +32 -0
  298. package/lib/theme/overrides/Backdrop.js.map +1 -0
  299. package/lib/theme/overrides/Button.d.ts +33 -0
  300. package/lib/theme/overrides/Button.js +52 -0
  301. package/lib/theme/overrides/Button.js.map +1 -0
  302. package/lib/theme/overrides/Card.d.ts +35 -0
  303. package/lib/theme/overrides/Card.js +49 -0
  304. package/lib/theme/overrides/Card.js.map +1 -0
  305. package/lib/theme/overrides/Input.d.ts +64 -0
  306. package/lib/theme/overrides/Input.js +81 -0
  307. package/lib/theme/overrides/Input.js.map +1 -0
  308. package/lib/theme/overrides/Overrides.d.ts +3 -0
  309. package/lib/theme/overrides/Overrides.js +31 -0
  310. package/lib/theme/overrides/Overrides.js.map +1 -0
  311. package/lib/theme/overrides/Paper.d.ts +12 -0
  312. package/lib/theme/overrides/Paper.js +31 -0
  313. package/lib/theme/overrides/Paper.js.map +1 -0
  314. package/lib/theme/overrides/SpeedDial.d.ts +16 -0
  315. package/lib/theme/overrides/SpeedDial.js +34 -0
  316. package/lib/theme/overrides/SpeedDial.js.map +1 -0
  317. package/lib/theme/overrides/Table.d.ts +11 -0
  318. package/lib/theme/overrides/Table.js +29 -0
  319. package/lib/theme/overrides/Table.js.map +1 -0
  320. package/lib/theme/overrides/Typography.d.ts +13 -0
  321. package/lib/theme/overrides/Typography.js +31 -0
  322. package/lib/theme/overrides/Typography.js.map +1 -0
  323. package/lib/theme/palette.d.ts +28 -0
  324. package/lib/theme/palette.js +67 -0
  325. package/lib/theme/palette.js.map +1 -0
  326. package/lib/theme/shadows.d.ts +2 -0
  327. package/lib/theme/shadows.js +52 -0
  328. package/lib/theme/shadows.js.map +1 -0
  329. package/lib/theme/typography.d.ts +139 -0
  330. package/lib/theme/typography.js +80 -0
  331. package/lib/theme/typography.js.map +1 -0
  332. package/lib/utils/calculatedExpression.js +180 -0
  333. package/lib/utils/calculatedExpression.js.map +1 -0
  334. package/lib/utils/choice.js +160 -0
  335. package/lib/utils/choice.js.map +1 -0
  336. package/lib/utils/debounce.js +19 -0
  337. package/lib/utils/debounce.js.map +1 -0
  338. package/lib/utils/emptyResource.js +25 -0
  339. package/lib/utils/emptyResource.js.map +1 -0
  340. package/lib/utils/enableWhen.js +228 -0
  341. package/lib/utils/enableWhen.js.map +1 -0
  342. package/lib/utils/enableWhenExpression.js +76 -0
  343. package/lib/utils/enableWhenExpression.js.map +1 -0
  344. package/lib/utils/fhirpath.js +98 -0
  345. package/lib/utils/fhirpath.js.map +1 -0
  346. package/lib/utils/initialiseForm.js +45 -0
  347. package/lib/utils/initialiseForm.js.map +1 -0
  348. package/lib/utils/itemControl.js +299 -0
  349. package/lib/utils/itemControl.js.map +1 -0
  350. package/lib/utils/mapItem.js +80 -0
  351. package/lib/utils/mapItem.js.map +1 -0
  352. package/lib/utils/openChoice.js +150 -0
  353. package/lib/utils/openChoice.js.map +1 -0
  354. package/lib/utils/parseInputs.js +49 -0
  355. package/lib/utils/parseInputs.js.map +1 -0
  356. package/lib/utils/populate.js +78 -0
  357. package/lib/utils/populate.js.map +1 -0
  358. package/lib/utils/populateCallback.js +40 -0
  359. package/lib/utils/populateCallback.js.map +1 -0
  360. package/lib/utils/populateContexts.js +76 -0
  361. package/lib/utils/populateContexts.js.map +1 -0
  362. package/lib/utils/populateInputParams.js +193 -0
  363. package/lib/utils/populateInputParams.js.map +1 -0
  364. package/lib/utils/qItem.js +73 -0
  365. package/lib/utils/qItem.js.map +1 -0
  366. package/lib/utils/qrItem.js +221 -0
  367. package/lib/utils/qrItem.js.map +1 -0
  368. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +43 -0
  369. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +1 -0
  370. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +79 -0
  371. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -0
  372. package/lib/utils/questionnaireStoreUtils/extractContainedValueSets.js +59 -0
  373. package/lib/utils/questionnaireStoreUtils/extractContainedValueSets.js.map +1 -0
  374. package/lib/utils/questionnaireStoreUtils/extractLaunchContext.js +18 -0
  375. package/lib/utils/questionnaireStoreUtils/extractLaunchContext.js.map +1 -0
  376. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js +174 -0
  377. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +1 -0
  378. package/lib/utils/questionnaireStoreUtils/extractTabs.js +31 -0
  379. package/lib/utils/questionnaireStoreUtils/extractTabs.js.map +1 -0
  380. package/lib/utils/questionnaireStoreUtils/extractVariables.js +63 -0
  381. package/lib/utils/questionnaireStoreUtils/extractVariables.js.map +1 -0
  382. package/lib/utils/questionnaireStoreUtils/resolveValueSets.js +58 -0
  383. package/lib/utils/questionnaireStoreUtils/resolveValueSets.js.map +1 -0
  384. package/lib/utils/removeHidden.js +104 -0
  385. package/lib/utils/removeHidden.js.map +1 -0
  386. package/lib/utils/tabs.js +190 -0
  387. package/lib/utils/tabs.js.map +1 -0
  388. package/lib/utils/valueSet.js +126 -0
  389. package/lib/utils/valueSet.js.map +1 -0
  390. package/package.json +19 -27
  391. package/src/api/populate.ts +70 -0
  392. package/src/components/Alert.styles.ts +45 -0
  393. package/src/components/BackToTopButton/BackToTopButton.tsx +47 -0
  394. package/src/components/Box.styles.ts +33 -0
  395. package/src/components/FormComponents/BooleanItem/BooleanField.tsx +44 -0
  396. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +82 -0
  397. package/src/components/FormComponents/DateItem/DateField.tsx +56 -0
  398. package/src/components/FormComponents/DateItem/DateItem.tsx +95 -0
  399. package/src/components/FormComponents/DateTimeItem/DateTimeField.tsx +58 -0
  400. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +94 -0
  401. package/src/components/FormComponents/DecimalItem/DecimalField.tsx +76 -0
  402. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +152 -0
  403. package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts +24 -0
  404. package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +38 -0
  405. package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +43 -0
  406. package/src/components/FormComponents/GridGroup/GridGroup.tsx +92 -0
  407. package/src/components/FormComponents/GridGroup/GridRow.tsx +88 -0
  408. package/src/components/FormComponents/GridGroup/GridTable.tsx +77 -0
  409. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +59 -0
  410. package/src/components/FormComponents/GroupItem/GroupItem.styles.ts +28 -0
  411. package/src/components/FormComponents/GroupItem/GroupItem.tsx +124 -0
  412. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +150 -0
  413. package/src/components/FormComponents/GroupItem/NextTabButton.tsx +43 -0
  414. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx +76 -0
  415. package/src/components/FormComponents/IntegerItem/IntegerField.tsx +76 -0
  416. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +140 -0
  417. package/src/components/FormComponents/Item.styles.ts +30 -0
  418. package/src/components/FormComponents/ItemParts/ContextDisplayItem.tsx +38 -0
  419. package/src/components/FormComponents/ItemParts/FadingCheckIcon.tsx +36 -0
  420. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +47 -0
  421. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +58 -0
  422. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +47 -0
  423. package/src/components/FormComponents/ItemParts/QItemCheckboxSingle.tsx +44 -0
  424. package/src/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.tsx +62 -0
  425. package/src/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.tsx +54 -0
  426. package/src/components/FormComponents/Lists.styles.ts +39 -0
  427. package/src/components/FormComponents/QItemChoice/QItemChoice.tsx +130 -0
  428. package/src/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.tsx +178 -0
  429. package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.tsx +131 -0
  430. package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.tsx +126 -0
  431. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.tsx +125 -0
  432. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.tsx +129 -0
  433. package/src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.tsx +41 -0
  434. package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.tsx +130 -0
  435. package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.tsx +162 -0
  436. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.tsx +104 -0
  437. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.tsx +207 -0
  438. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.tsx +194 -0
  439. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.tsx +190 -0
  440. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.tsx +149 -0
  441. package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.tsx +138 -0
  442. package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +47 -0
  443. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +46 -0
  444. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +125 -0
  445. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +66 -0
  446. package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +47 -0
  447. package/src/components/FormComponents/RepeatItem/DeleteItemButton.tsx +46 -0
  448. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +61 -0
  449. package/src/components/FormComponents/RepeatItem/RepeatItem.styles.tsx +32 -0
  450. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +116 -0
  451. package/src/components/FormComponents/SingleItem/SingleItem.tsx +62 -0
  452. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +171 -0
  453. package/src/components/FormComponents/StringItem/StringField.tsx +76 -0
  454. package/src/components/FormComponents/StringItem/StringItem.tsx +131 -0
  455. package/src/components/FormComponents/Tables/DeleteRowButton.tsx +47 -0
  456. package/src/components/FormComponents/Tables/QItemGroupTable.tsx +171 -0
  457. package/src/components/FormComponents/Tables/QItemGroupTableRow.tsx +77 -0
  458. package/src/components/FormComponents/Tables/Table.styles.tsx +51 -0
  459. package/src/components/FormComponents/TextItem/TextField.tsx +74 -0
  460. package/src/components/FormComponents/TextItem/TextItem.tsx +128 -0
  461. package/src/components/FormComponents/Textfield.styles.ts +28 -0
  462. package/src/components/FormComponents/TimeItem/TimeField.tsx +54 -0
  463. package/src/components/FormComponents/TimeItem/TimeItem.tsx +94 -0
  464. package/src/components/FormComponents/Typography.styles.ts +24 -0
  465. package/src/components/FormComponents/UrlItem/UrlField.tsx +66 -0
  466. package/src/components/FormComponents/UrlItem/UrlItem.tsx +118 -0
  467. package/src/components/FormRenderer/BaseRenderer.tsx +82 -0
  468. package/src/components/FormRenderer/FormBodyCollapsible.tsx +96 -0
  469. package/src/components/FormRenderer/FormBodySingleCollapsible.tsx +76 -0
  470. package/src/components/FormRenderer/FormBodySingleCollapsibleWrapper.tsx +60 -0
  471. package/src/components/FormRenderer/FormBodyTabbed.tsx +106 -0
  472. package/src/components/FormRenderer/FormTitle.tsx +44 -0
  473. package/src/components/FormRenderer/FormTopLevelItem.tsx +93 -0
  474. package/src/components/FormRenderer/SmartFormsRenderer.tsx +62 -0
  475. package/src/components/FormRenderer/index.ts +19 -0
  476. package/src/components/Iconify/Iconify.tsx +38 -0
  477. package/src/components/Lists.styles.ts +39 -0
  478. package/src/components/Tabs/CompleteTabButton.tsx +42 -0
  479. package/src/components/Tabs/FormBodySingleTab.tsx +67 -0
  480. package/src/components/Tabs/FormBodyTabList.tsx +83 -0
  481. package/src/components/index.ts +18 -0
  482. package/src/hooks/index.ts +1 -0
  483. package/src/hooks/useBackToTop.ts +29 -0
  484. package/src/hooks/useDebounce.ts +45 -0
  485. package/src/hooks/useDecimalCalculatedExpression.ts +80 -0
  486. package/src/hooks/useHidden.ts +40 -0
  487. package/src/hooks/useInitialiseGroupTable.ts +42 -0
  488. package/src/hooks/useInitialiseRenderer.ts +62 -0
  489. package/src/hooks/useInitialiseRepeatAnswers.ts +42 -0
  490. package/src/hooks/useInitialiseRepeatGroups.ts +42 -0
  491. package/src/hooks/useIntegerCalculatedExpression.ts +72 -0
  492. package/src/hooks/useQueryClient.ts +31 -0
  493. package/src/hooks/useRenderingExtensions.ts +52 -0
  494. package/src/hooks/useResponsive.ts +51 -0
  495. package/src/hooks/useStringCalculatedExpression.ts +71 -0
  496. package/src/hooks/useTerminologyServerQuery.ts +98 -0
  497. package/src/hooks/useValidationError.ts +48 -0
  498. package/src/hooks/useValueSetCodings.ts +150 -0
  499. package/src/index.ts +163 -0
  500. package/src/interfaces/answerExpression.interface.ts +23 -0
  501. package/src/interfaces/calculatedExpression.interface.ts +4 -0
  502. package/src/interfaces/choice.enum.ts +40 -0
  503. package/src/interfaces/enableWhen.interface.ts +40 -0
  504. package/src/interfaces/groupTable.interface.ts +23 -0
  505. package/src/interfaces/populate.interface.ts +218 -0
  506. package/src/interfaces/questionnaireStore.interface.ts +36 -0
  507. package/src/interfaces/regex.interface.ts +21 -0
  508. package/src/interfaces/renderProps.interface.ts +34 -0
  509. package/src/interfaces/repeatGroup.interface.ts +28 -0
  510. package/src/interfaces/repeatItem.interface.ts +6 -0
  511. package/src/interfaces/tab.interface.ts +18 -0
  512. package/src/interfaces/valueSet.interface.ts +23 -0
  513. package/src/interfaces/variables.interface.ts +28 -0
  514. package/src/stores/useConfigStore.ts +36 -0
  515. package/src/stores/useQuestionnaireResponseStore.ts +58 -0
  516. package/src/stores/useQuestionnaireStore.ts +232 -0
  517. package/src/stories/SmartFormsRenderer.stories.ts +104 -0
  518. package/src/stories/assets/Q715.json +15086 -0
  519. package/src/stories/assets/QTestGrid.json +166 -0
  520. package/src/stories/assets/R715.json +311 -0
  521. package/src/stories/assets/RTestGrid.json +34 -0
  522. package/src/theme/Theme.tsx +107 -0
  523. package/src/theme/globalStyles.tsx +68 -0
  524. package/src/theme/overrides/Accordion.ts +34 -0
  525. package/src/theme/overrides/Autocomplete.ts +30 -0
  526. package/src/theme/overrides/Backdrop.ts +34 -0
  527. package/src/theme/overrides/Button.ts +54 -0
  528. package/src/theme/overrides/Card.ts +51 -0
  529. package/src/theme/overrides/Input.ts +83 -0
  530. package/src/theme/overrides/Overrides.ts +45 -0
  531. package/src/theme/overrides/Paper.ts +31 -0
  532. package/src/theme/overrides/SpeedDial.ts +36 -0
  533. package/src/theme/overrides/Table.ts +31 -0
  534. package/src/theme/overrides/Typography.ts +33 -0
  535. package/src/theme/palette.ts +100 -0
  536. package/src/theme/shadows.ts +54 -0
  537. package/src/theme/typography.ts +114 -0
  538. package/src/utils/calculatedExpression.ts +299 -0
  539. package/src/utils/choice.ts +194 -0
  540. package/src/utils/debounce.ts +20 -0
  541. package/src/utils/emptyResource.ts +28 -0
  542. package/src/utils/enableWhen.ts +303 -0
  543. package/src/utils/enableWhenExpression.ts +123 -0
  544. package/src/utils/fhirpath.ts +164 -0
  545. package/src/utils/initialiseForm.ts +81 -0
  546. package/src/utils/itemControl.ts +367 -0
  547. package/src/utils/mapItem.ts +97 -0
  548. package/src/utils/openChoice.ts +179 -0
  549. package/src/utils/parseInputs.ts +58 -0
  550. package/src/utils/populate.ts +117 -0
  551. package/src/utils/populateCallback.ts +53 -0
  552. package/src/utils/populateContexts.ts +112 -0
  553. package/src/utils/populateInputParams.ts +242 -0
  554. package/src/utils/qItem.ts +103 -0
  555. package/src/utils/qrItem.ts +250 -0
  556. package/src/utils/questionnaireStoreUtils/addAdditionalVariables.ts +52 -0
  557. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +96 -0
  558. package/src/utils/questionnaireStoreUtils/extractContainedValueSets.ts +74 -0
  559. package/src/utils/questionnaireStoreUtils/extractLaunchContext.ts +21 -0
  560. package/src/utils/questionnaireStoreUtils/extractOtherExtensions.ts +239 -0
  561. package/src/utils/questionnaireStoreUtils/extractTabs.ts +37 -0
  562. package/src/utils/questionnaireStoreUtils/extractVariables.ts +77 -0
  563. package/src/utils/questionnaireStoreUtils/resolveValueSets.ts +68 -0
  564. package/src/utils/removeHidden.ts +162 -0
  565. package/src/utils/tabs.ts +255 -0
  566. package/src/utils/valueSet.ts +159 -0
  567. package/tsconfig.json +21 -0
  568. package/dist/components/FormComponents/Item.styles.d.ts +0 -6
  569. package/dist/components/FormComponents/RepeatItem/RepeatItem.styles.d.ts +0 -22
  570. package/dist/components/FormComponents/Typography.styles.d.ts +0 -6
  571. package/dist/components/FormRenderer/BaseFormRenderer.d.ts +0 -3
  572. package/dist/components/FormRenderer/Form.d.ts +0 -3
  573. package/dist/index.d.ts +0 -16
  574. package/dist/index.esm.js +0 -10650
  575. package/dist/index.esm.js.map +0 -1
  576. package/dist/index.js +0 -10710
  577. package/dist/index.js.map +0 -1
  578. package/dist/stories/SmartFormsRenderer.stories.d.ts +0 -14
  579. /package/{dist → lib}/api/populate.d.ts +0 -0
  580. /package/{dist → lib}/components/BackToTopButton/BackToTopButton.d.ts +0 -0
  581. /package/{dist → lib}/components/FormComponents/BooleanItem/BooleanField.d.ts +0 -0
  582. /package/{dist → lib}/components/FormComponents/BooleanItem/BooleanItem.d.ts +0 -0
  583. /package/{dist → lib}/components/FormComponents/DateItem/DateField.d.ts +0 -0
  584. /package/{dist → lib}/components/FormComponents/DateItem/DateItem.d.ts +0 -0
  585. /package/{dist → lib}/components/FormComponents/DateTimeItem/DateTimeField.d.ts +0 -0
  586. /package/{dist → lib}/components/FormComponents/DateTimeItem/DateTimeItem.d.ts +0 -0
  587. /package/{dist → lib}/components/FormComponents/DecimalItem/DecimalField.d.ts +0 -0
  588. /package/{dist → lib}/components/FormComponents/DecimalItem/DecimalItem.d.ts +0 -0
  589. /package/{dist → lib}/components/FormComponents/DisplayItem/DisplayInstructions.d.ts +0 -0
  590. /package/{dist → lib}/components/FormComponents/DisplayItem/DisplayItem.d.ts +0 -0
  591. /package/{dist → lib}/components/FormComponents/GridGroup/GridTable.d.ts +0 -0
  592. /package/{dist → lib}/components/FormComponents/GroupItem/GroupHeading.d.ts +0 -0
  593. /package/{dist → lib}/components/FormComponents/GroupItem/NextTabButton.d.ts +0 -0
  594. /package/{dist → lib}/components/FormComponents/GroupItem/NextTabButtonWrapper.d.ts +0 -0
  595. /package/{dist → lib}/components/FormComponents/IntegerItem/IntegerField.d.ts +0 -0
  596. /package/{dist → lib}/components/FormComponents/IntegerItem/IntegerItem.d.ts +0 -0
  597. /package/{dist → lib}/components/FormComponents/ItemParts/ContextDisplayItem.d.ts +0 -0
  598. /package/{dist → lib}/components/FormComponents/ItemParts/FadingCheckIcon.d.ts +0 -0
  599. /package/{dist → lib}/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +0 -0
  600. /package/{dist → lib}/components/FormComponents/ItemParts/ItemLabelText.d.ts +0 -0
  601. /package/{dist → lib}/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +0 -0
  602. /package/{dist → lib}/components/FormComponents/ItemParts/QItemCheckboxSingle.d.ts +0 -0
  603. /package/{dist → lib}/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.d.ts +0 -0
  604. /package/{dist → lib}/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.d.ts +0 -0
  605. /package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.d.ts +0 -0
  606. /package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.d.ts +0 -0
  607. /package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.d.ts +0 -0
  608. /package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.d.ts +0 -0
  609. /package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.d.ts +0 -0
  610. /package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.d.ts +0 -0
  611. /package/{dist → lib}/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.d.ts +0 -0
  612. /package/{dist → lib}/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.d.ts +0 -0
  613. /package/{dist → lib}/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.d.ts +0 -0
  614. /package/{dist → lib}/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.d.ts +0 -0
  615. /package/{dist → lib}/components/FormComponents/RepeatGroup/AddItemButton.d.ts +0 -0
  616. /package/{dist → lib}/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +0 -0
  617. /package/{dist → lib}/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +0 -0
  618. /package/{dist → lib}/components/FormComponents/RepeatGroup/RepeatGroupItem.d.ts +0 -0
  619. /package/{dist → lib}/components/FormComponents/RepeatItem/AddItemButton.d.ts +0 -0
  620. /package/{dist → lib}/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +0 -0
  621. /package/{dist → lib}/components/FormComponents/RepeatItem/RepeatField.d.ts +0 -0
  622. /package/{dist → lib}/components/FormComponents/RepeatItem/RepeatItem.d.ts +0 -0
  623. /package/{dist → lib}/components/FormComponents/SingleItem/SingleItem.d.ts +0 -0
  624. /package/{dist → lib}/components/FormComponents/SingleItem/SingleItemSwitcher.d.ts +0 -0
  625. /package/{dist → lib}/components/FormComponents/StringItem/StringField.d.ts +0 -0
  626. /package/{dist → lib}/components/FormComponents/StringItem/StringItem.d.ts +0 -0
  627. /package/{dist → lib}/components/FormComponents/Tables/DeleteRowButton.d.ts +0 -0
  628. /package/{dist → lib}/components/FormComponents/Tables/Table.styles.d.ts +0 -0
  629. /package/{dist → lib}/components/FormComponents/TextItem/TextField.d.ts +0 -0
  630. /package/{dist → lib}/components/FormComponents/TextItem/TextItem.d.ts +0 -0
  631. /package/{dist → lib}/components/FormComponents/TimeItem/TimeField.d.ts +0 -0
  632. /package/{dist → lib}/components/FormComponents/TimeItem/TimeItem.d.ts +0 -0
  633. /package/{dist → lib}/components/FormComponents/UrlItem/UrlField.d.ts +0 -0
  634. /package/{dist → lib}/components/FormComponents/UrlItem/UrlItem.d.ts +0 -0
  635. /package/{dist → lib}/components/FormRenderer/BaseRenderer.d.ts +0 -0
  636. /package/{dist → lib}/components/FormRenderer/FormBodyCollapsible.d.ts +0 -0
  637. /package/{dist → lib}/components/FormRenderer/FormBodySingleCollapsible.d.ts +0 -0
  638. /package/{dist → lib}/components/FormRenderer/FormBodyTabbed.d.ts +0 -0
  639. /package/{dist → lib}/components/FormRenderer/FormRenderer.d.ts +0 -0
  640. /package/{dist → lib}/components/FormRenderer/FormTitle.d.ts +0 -0
  641. /package/{dist → lib}/components/FormRenderer/FormTopLevelItem.d.ts +0 -0
  642. /package/{dist → lib}/components/FormRenderer/SmartFormsRenderer.d.ts +0 -0
  643. /package/{dist → lib}/components/FormRenderer/index.d.ts +0 -0
  644. /package/{dist → lib}/components/Iconify/Iconify.d.ts +0 -0
  645. /package/{dist → lib}/components/Tabs/CompleteTabButton.d.ts +0 -0
  646. /package/{dist → lib}/components/Tabs/FormBodySingleTab.d.ts +0 -0
  647. /package/{dist → lib}/components/Tabs/FormBodyTabList.d.ts +0 -0
  648. /package/{dist → lib}/components/index.d.ts +0 -0
  649. /package/{dist → lib}/hooks/index.d.ts +0 -0
  650. /package/{dist → lib}/hooks/useBackToTop.d.ts +0 -0
  651. /package/{dist → lib}/hooks/useDebounce.d.ts +0 -0
  652. /package/{dist → lib}/hooks/useDecimalCalculatedExpression.d.ts +0 -0
  653. /package/{dist → lib}/hooks/useHidden.d.ts +0 -0
  654. /package/{dist → lib}/hooks/useInitialiseGroupTable.d.ts +0 -0
  655. /package/{dist → lib}/hooks/useInitialiseRenderer.d.ts +0 -0
  656. /package/{dist → lib}/hooks/useInitialiseRepeatAnswers.d.ts +0 -0
  657. /package/{dist → lib}/hooks/useInitialiseRepeatGroups.d.ts +0 -0
  658. /package/{dist → lib}/hooks/useIntegerCalculatedExpression.d.ts +0 -0
  659. /package/{dist → lib}/hooks/useQueryClient.d.ts +0 -0
  660. /package/{dist → lib}/hooks/useRenderingExtensions.d.ts +0 -0
  661. /package/{dist → lib}/hooks/useResponsive.d.ts +0 -0
  662. /package/{dist → lib}/hooks/useStringCalculatedExpression.d.ts +0 -0
  663. /package/{dist → lib}/hooks/useTerminologyServerQuery.d.ts +0 -0
  664. /package/{dist → lib}/hooks/useValidationError.d.ts +0 -0
  665. /package/{dist → lib}/interfaces/answerExpression.interface.d.ts +0 -0
  666. /package/{dist → lib}/interfaces/calculatedExpression.interface.d.ts +0 -0
  667. /package/{dist → lib}/interfaces/choice.enum.d.ts +0 -0
  668. /package/{dist → lib}/interfaces/enableWhen.interface.d.ts +0 -0
  669. /package/{dist → lib}/interfaces/groupTable.interface.d.ts +0 -0
  670. /package/{dist → lib}/interfaces/populate.interface.d.ts +0 -0
  671. /package/{dist → lib}/interfaces/questionnaireStore.interface.d.ts +0 -0
  672. /package/{dist → lib}/interfaces/regex.interface.d.ts +0 -0
  673. /package/{dist → lib}/interfaces/repeatGroup.interface.d.ts +0 -0
  674. /package/{dist → lib}/interfaces/repeatItem.interface.d.ts +0 -0
  675. /package/{dist → lib}/interfaces/tab.interface.d.ts +0 -0
  676. /package/{dist → lib}/interfaces/valueSet.interface.d.ts +0 -0
  677. /package/{dist → lib}/interfaces/variables.interface.d.ts +0 -0
  678. /package/{dist → lib}/stores/useConfigStore.d.ts +0 -0
  679. /package/{dist → lib}/stores/useQuestionnaireResponseStore.d.ts +0 -0
  680. /package/{dist → lib}/stores/useQuestionnaireStore.d.ts +0 -0
  681. /package/{dist → lib}/utils/calculatedExpression.d.ts +0 -0
  682. /package/{dist → lib}/utils/choice.d.ts +0 -0
  683. /package/{dist → lib}/utils/debounce.d.ts +0 -0
  684. /package/{dist → lib}/utils/emptyResource.d.ts +0 -0
  685. /package/{dist → lib}/utils/enableWhen.d.ts +0 -0
  686. /package/{dist → lib}/utils/enableWhenExpression.d.ts +0 -0
  687. /package/{dist → lib}/utils/fhirpath.d.ts +0 -0
  688. /package/{dist → lib}/utils/initialiseForm.d.ts +0 -0
  689. /package/{dist → lib}/utils/itemControl.d.ts +0 -0
  690. /package/{dist → lib}/utils/mapItem.d.ts +0 -0
  691. /package/{dist → lib}/utils/openChoice.d.ts +0 -0
  692. /package/{dist → lib}/utils/parseInputs.d.ts +0 -0
  693. /package/{dist → lib}/utils/populate.d.ts +0 -0
  694. /package/{dist → lib}/utils/populateCallback.d.ts +0 -0
  695. /package/{dist → lib}/utils/populateContexts.d.ts +0 -0
  696. /package/{dist → lib}/utils/populateInputParams.d.ts +0 -0
  697. /package/{dist → lib}/utils/qItem.d.ts +0 -0
  698. /package/{dist → lib}/utils/qrItem.d.ts +0 -0
  699. /package/{dist → lib}/utils/questionnaireStoreUtils/addAdditionalVariables.d.ts +0 -0
  700. /package/{dist → lib}/utils/questionnaireStoreUtils/createQuestionaireModel.d.ts +0 -0
  701. /package/{dist → lib}/utils/questionnaireStoreUtils/extractContainedValueSets.d.ts +0 -0
  702. /package/{dist → lib}/utils/questionnaireStoreUtils/extractLaunchContext.d.ts +0 -0
  703. /package/{dist → lib}/utils/questionnaireStoreUtils/extractOtherExtensions.d.ts +0 -0
  704. /package/{dist → lib}/utils/questionnaireStoreUtils/extractTabs.d.ts +0 -0
  705. /package/{dist → lib}/utils/questionnaireStoreUtils/extractVariables.d.ts +0 -0
  706. /package/{dist → lib}/utils/questionnaireStoreUtils/resolveValueSets.d.ts +0 -0
  707. /package/{dist → lib}/utils/removeHidden.d.ts +0 -0
  708. /package/{dist → lib}/utils/tabs.d.ts +0 -0
  709. /package/{dist → lib}/utils/valueSet.d.ts +0 -0
  710. /package/{dist/setup-jest.d.ts → src/setup-jest.ts} +0 -0
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2023 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { styled, TableCell } from '@mui/material';
18
+ export const HeaderTableCell = styled(TableCell)(() => ({
19
+ fontSize: 13,
20
+ lineHeight: 'normal'
21
+ }));
22
+ export const StandardTableCell = styled(TableCell, {
23
+ shouldForwardProp: (prop) => prop !== 'numOfColumns' && prop !== 'isFirst'
24
+ })(({ numOfColumns, isFirst }) => ({
25
+ width: `${100 / numOfColumns}%`,
26
+ paddingLeft: isFirst ? 8 : 4,
27
+ paddingRight: 4
28
+ }));
29
+ export const DeleteButtonTableCell = styled(TableCell)(() => ({
30
+ paddingLeft: 0,
31
+ paddingRight: 4
32
+ }));
33
+ export const GridTextTableCell = styled(TableCell)(({ theme }) => ({
34
+ width: '20%',
35
+ paddingLeft: '18px',
36
+ paddingRight: '18px',
37
+ color: theme.palette.text.secondary
38
+ }));
39
+ export const GridAnswerTableCell = styled(TableCell, {
40
+ shouldForwardProp: (prop) => prop !== 'numOfColumns'
41
+ })(({ numOfColumns }) => ({
42
+ width: `${80 / numOfColumns}%`,
43
+ paddingLeft: 5,
44
+ paddingRight: 5
45
+ }));
46
+ //# sourceMappingURL=Table.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/Table.styles.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACtD,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,EAAE;IACjD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,SAAS;CAC3E,CAAC,CAA6C,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,KAAK,EAAE,GAAG,GAAG,GAAG,YAAY,GAAG;IAC/B,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5D,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACjE,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,MAAM;IACpB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;CACpC,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,SAAS,EAAE;IACnD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc;CACrD,CAAC,CAA2B,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAClD,KAAK,EAAE,GAAG,EAAE,GAAG,YAAY,GAAG;IAC9B,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
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 { InputAdornment, TextField as MuiTextField } from '@mui/material';
19
+ import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
20
+ function TextField(props) {
21
+ const { linkId, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, calcExpUpdated, onInputChange } = props;
22
+ return (React.createElement(MuiTextField, { id: linkId, value: input, error: !!feedback, onChange: (event) => onInputChange(event.target.value), disabled: readOnly, label: displayPrompt, placeholder: entryFormat, fullWidth: true, multiline: true, size: "small", minRows: 3, InputProps: {
23
+ endAdornment: (React.createElement(InputAdornment, { position: 'end' },
24
+ React.createElement(FadingCheckIcon, { fadeIn: calcExpUpdated }),
25
+ displayUnit))
26
+ }, helperText: feedback, "data-test": "q-item-text-field" }));
27
+ }
28
+ export default TextField;
29
+ //# sourceMappingURL=TextField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAc3D,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EACJ,MAAM,EACN,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACd,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,oBAAC,YAAY,IACX,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACtD,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,QACT,SAAS,QACT,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,CAAC,EACV,UAAU,EAAE;YACV,YAAY,EAAE,CACZ,oBAAC,cAAc,IAAC,QAAQ,EAAE,KAAK;gBAC7B,oBAAC,eAAe,IAAC,MAAM,EAAE,cAAc,GAAI;gBAC1C,WAAW,CACG,CAClB;SACF,EACD,UAAU,EAAE,QAAQ,eACV,mBAAmB,GAC7B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,71 @@
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, { useCallback, useState } from 'react';
18
+ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
19
+ import useValidationError from '../../../hooks/useValidationError';
20
+ import debounce from 'lodash.debounce';
21
+ import { createEmptyQrItem } from '../../../utils/qrItem';
22
+ import { DEBOUNCE_DURATION } from '../../../utils/debounce';
23
+ import { FullWidthFormComponentBox } from '../../Box.styles';
24
+ import TextField from './TextField';
25
+ import useStringCalculatedExpression from '../../../hooks/useStringCalculatedExpression';
26
+ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
27
+ function TextItem(props) {
28
+ const { qItem, qrItem, isRepeated, onQrItemChange } = props;
29
+ // Get additional rendering extensions
30
+ const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
31
+ // Init input value
32
+ let valueText = '';
33
+ if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueString)) {
34
+ valueText = qrItem.answer[0].valueString;
35
+ }
36
+ const [input, setInput] = useState(valueText);
37
+ // Perform validation checks
38
+ const feedback = useValidationError(input, regexValidation, maxLength);
39
+ // Process calculated expressions
40
+ const { calcExpUpdated } = useStringCalculatedExpression({
41
+ qItem: qItem,
42
+ inputValue: input,
43
+ setInputValue: (value) => {
44
+ setInput(value);
45
+ },
46
+ onQrItemChange: onQrItemChange
47
+ });
48
+ // Event handlers
49
+ function handleInputChange(newInput) {
50
+ setInput(newInput);
51
+ updateQrItemWithDebounce(newInput);
52
+ }
53
+ // eslint-disable-next-line react-hooks/exhaustive-deps
54
+ const updateQrItemWithDebounce = useCallback(debounce((input) => {
55
+ const emptyQrItem = createEmptyQrItem(qItem);
56
+ if (input !== '') {
57
+ onQrItemChange(Object.assign(Object.assign({}, emptyQrItem), { answer: [{ valueString: input.trim() }] }));
58
+ }
59
+ else {
60
+ onQrItemChange(emptyQrItem);
61
+ }
62
+ }, DEBOUNCE_DURATION), [onQrItemChange, qItem]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
63
+ if (isRepeated) {
64
+ return (React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }));
65
+ }
66
+ return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-text-box" },
67
+ React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
68
+ React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }))));
69
+ }
70
+ export default TextItem;
71
+ //# sourceMappingURL=TextItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,6BAA6B,MAAM,8CAA8C,CAAC;AACzF,OAAO,aAAa,MAAM,4BAA4B,CAAC;AASvD,SAAS,QAAQ,CAAC,KAAoB;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE5D,sCAAsC;IACtC,MAAM,EACJ,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,eAAe,EACf,SAAS,EACV,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAElC,mBAAmB;IACnB,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,CAAC,EAAE,WAAW,CAAA,EAAE;QACnD,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;KAC1C;IACD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAE9C,4BAA4B;IAC5B,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;IAEvE,iCAAiC;IACjC,MAAM,EAAE,cAAc,EAAE,GAAG,6BAA6B,CAAC;QACvD,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,KAAK;QACjB,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YACvB,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,cAAc,EAAE,cAAc;KAC/B,CAAC,CAAC;IAEH,iBAAiB;IACjB,SAAS,iBAAiB,CAAC,QAAgB;QACzC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,uDAAuD;IACvD,MAAM,wBAAwB,GAAG,WAAW,CAC1C,QAAQ,CAAC,CAAC,KAAa,EAAE,EAAE;QACzB,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,KAAK,KAAK,EAAE,EAAE;YAChB,cAAc,iCAAM,WAAW,KAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,IAAG,CAAC;SAC7E;aAAM;YACL,cAAc,CAAC,WAAW,CAAC,CAAC;SAC7B;IACH,CAAC,EAAE,iBAAiB,CAAC,EACrB,CAAC,cAAc,EAAE,KAAK,CAAC,CACxB,CAAC,CAAC,oFAAoF;IAEvF,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,SAAS,IACR,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,iBAAiB,GAChC,CACH,CAAC;KACH;IACD,OAAO,CACL,oBAAC,yBAAyB,iBAAW,iBAAiB;QACpD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB;YACnE,oBAAC,SAAS,IACR,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,iBAAiB,GAChC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export declare const StandardTextField: import("@emotion/styled").StyledComponent<{
2
- variant?: import("@mui/material").TextFieldVariants;
2
+ variant?: import("@mui/material").TextFieldVariants | undefined;
3
3
  } & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
4
4
  isTabled: boolean;
5
5
  }, {}, {}>;
@@ -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 { styled, TextField } from '@mui/material';
18
+ // Always use this accompanied by the TextField prop fullWidth
19
+ export const StandardTextField = styled(TextField, {
20
+ shouldForwardProp: (prop) => prop !== 'isTabled'
21
+ })(({ isTabled }) => ({
22
+ // Set 280 as the standard width for a field
23
+ // Set a theoretical infinite maxWidth if field is within a table to fill the table row
24
+ maxWidth: !isTabled ? 280 : 3000,
25
+ minWidth: 160
26
+ }));
27
+ //# sourceMappingURL=Textfield.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textfield.styles.js","sourceRoot":"","sources":["../../../src/components/FormComponents/Textfield.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAElD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,EAAE;IACjD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU;CACjD,CAAC,CAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3C,4CAA4C;IAC5C,uFAAuF;IACvF,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;IAChC,QAAQ,EAAE,GAAG;CACd,CAAC,CAAC,CAAC"}
@@ -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 from 'react';
18
+ import { LocalizationProvider, TimePicker as MuiTimePicker } from '@mui/x-date-pickers';
19
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
20
+ function TimeField(props) {
21
+ const { value, displayPrompt, entryFormat, readOnly, isTabled, onTimeChange } = props;
22
+ return (React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
23
+ React.createElement(MuiTimePicker, { format: entryFormat !== '' ? entryFormat : 'hh:mm a', value: value, disabled: readOnly, label: displayPrompt, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160 }, slotProps: {
24
+ textField: {
25
+ fullWidth: true
26
+ }
27
+ }, onChange: onTimeChange })));
28
+ }
29
+ export default TimeField;
30
+ //# sourceMappingURL=TimeField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAUhE,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAEtF,OAAO,CACL,oBAAC,oBAAoB,IAAC,WAAW,EAAE,YAAY;QAC7C,oBAAC,aAAa,IACZ,MAAM,EAAE,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACpD,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,EACpB,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EACvD,SAAS,EAAE;gBACT,SAAS,EAAE;oBACT,SAAS,EAAE,IAAI;iBAChB;aACF,EACD,QAAQ,EAAE,YAAY,GACtB,CACmB,CACxB,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,52 @@
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 useRenderingExtensions from '../../../hooks/useRenderingExtensions';
19
+ import { createEmptyQrItem } from '../../../utils/qrItem';
20
+ import { FullWidthFormComponentBox } from '../../Box.styles';
21
+ import TimeField from './TimeField';
22
+ import dayjs from 'dayjs';
23
+ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
24
+ function TimeItem(props) {
25
+ const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
26
+ // Get additional rendering extensions
27
+ const { displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
28
+ // Init input value
29
+ let timeString = null;
30
+ if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueTime)) {
31
+ timeString = qrItem.answer[0].valueTime;
32
+ }
33
+ const timeDayJs = timeString ? dayjs(timeString) : null;
34
+ // Event handlers
35
+ function handleTimeChange(newValue) {
36
+ const emptyQrItem = createEmptyQrItem(qItem);
37
+ if (newValue) {
38
+ onQrItemChange(Object.assign(Object.assign({}, emptyQrItem), { answer: [{ valueTime: newValue.format() }] }));
39
+ }
40
+ else {
41
+ onQrItemChange(emptyQrItem);
42
+ }
43
+ }
44
+ if (isRepeated) {
45
+ return (React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }));
46
+ }
47
+ return (React.createElement(FullWidthFormComponentBox, null,
48
+ React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
49
+ React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }))));
50
+ }
51
+ export default TimeItem;
52
+ //# sourceMappingURL=TimeItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAUvD,SAAS,QAAQ,CAAC,KAAoB;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEtE,sCAAsC;IACtC,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,GACjE,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAEhC,mBAAmB;IACnB,IAAI,UAAU,GAAkB,IAAI,CAAC;IACrC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,CAAC,EAAE,SAAS,CAAA,EAAE;QACjD,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;KACzC;IACD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAExD,iBAAiB;IACjB,SAAS,gBAAgB,CAAC,QAAsB;QAC9C,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,QAAQ,EAAE;YACZ,cAAc,iCAAM,WAAW,KAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,IAAG,CAAC;SAChF;aAAM;YACL,cAAc,CAAC,WAAW,CAAC,CAAC;SAC7B;IACH,CAAC;IAED,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,SAAS,IACR,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB;QACxB,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB;YACnE,oBAAC,SAAS,IACR,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,QAAQ,GAClB,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const QGroupHeadingTypography: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
3
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
4
+ }, "display" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "style" | "className" | "children" | "sx" | "classes" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variant" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
5
+ isTabHeading?: boolean | undefined;
6
+ }, {}, {}>;
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright 2023 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { styled, Typography } from '@mui/material';
18
+ export const QGroupHeadingTypography = styled(Typography, {
19
+ shouldForwardProp: (prop) => prop !== 'isTabHeading'
20
+ })(({ isTabHeading }) => ({
21
+ fontSize: isTabHeading ? 16 : 15
22
+ }));
23
+ //# sourceMappingURL=Typography.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Typography.styles.js","sourceRoot":"","sources":["../../../src/components/FormComponents/Typography.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,UAAU,EAAE;IACxD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc;CACrD,CAAC,CAA6B,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IACpD,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;CACjC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,25 @@
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 { InputAdornment } from '@mui/material';
19
+ import { StandardTextField } from '../Textfield.styles';
20
+ function UrlField(props) {
21
+ const { linkId, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, isTabled, onInputChange } = props;
22
+ return (React.createElement(StandardTextField, { fullWidth: true, isTabled: isTabled, id: linkId, value: input, error: !!feedback, onChange: (event) => onInputChange(event.target.value), label: displayPrompt, placeholder: entryFormat, disabled: readOnly, size: "small", InputProps: { endAdornment: React.createElement(InputAdornment, { position: 'end' }, displayUnit) }, helperText: feedback, "data-test": "q-item-url-field" }));
23
+ }
24
+ export default UrlField;
25
+ //# sourceMappingURL=UrlField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAaxD,SAAS,QAAQ,CAAC,KAAoB;IACpC,MAAM,EACJ,MAAM,EACN,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,aAAa,EACd,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,oBAAC,iBAAiB,IAChB,SAAS,QACT,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACtD,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,EAAE,YAAY,EAAE,oBAAC,cAAc,IAAC,QAAQ,EAAE,KAAK,IAAG,WAAW,CAAkB,EAAE,EAC7F,UAAU,EAAE,QAAQ,eACV,kBAAkB,GAC5B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,61 @@
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, { useCallback, useState } from 'react';
18
+ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
19
+ import useValidationError from '../../../hooks/useValidationError';
20
+ import debounce from 'lodash.debounce';
21
+ import { createEmptyQrItem } from '../../../utils/qrItem';
22
+ import { DEBOUNCE_DURATION } from '../../../utils/debounce';
23
+ import { FullWidthFormComponentBox } from '../../Box.styles';
24
+ import UrlField from './UrlField';
25
+ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
26
+ function UrlItem(props) {
27
+ const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
28
+ // Get additional rendering extensions
29
+ const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
30
+ // Init input value
31
+ let valueUri = '';
32
+ if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueUri)) {
33
+ valueUri = qrItem.answer[0].valueUri;
34
+ }
35
+ const [input, setInput] = useState(valueUri);
36
+ // Perform validation checks
37
+ const feedback = useValidationError(input, regexValidation, maxLength);
38
+ // Event handlers
39
+ function handleChange(newInput) {
40
+ setInput(newInput);
41
+ updateQrItemWithDebounce(newInput);
42
+ }
43
+ // eslint-disable-next-line react-hooks/exhaustive-deps
44
+ const updateQrItemWithDebounce = useCallback(debounce((input) => {
45
+ const emptyQrItem = createEmptyQrItem(qItem);
46
+ if (input !== '') {
47
+ onQrItemChange(Object.assign(Object.assign({}, emptyQrItem), { answer: [{ valueUri: input }] }));
48
+ }
49
+ else {
50
+ onQrItemChange(emptyQrItem);
51
+ }
52
+ }, DEBOUNCE_DURATION), [onQrItemChange, qItem]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
53
+ if (isRepeated) {
54
+ return (React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }));
55
+ }
56
+ return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-string-box" },
57
+ React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
58
+ React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }))));
59
+ }
60
+ export default UrlItem;
61
+ //# sourceMappingURL=UrlItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlItem.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,54 @@
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 { Container, Fade } from '@mui/material';
19
+ import FormTopLevelItem from '../FormRenderer/FormTopLevelItem';
20
+ import useQuestionnaireStore from '../../stores/useQuestionnaireStore';
21
+ import useQuestionnaireResponseStore from '../../stores/useQuestionnaireResponseStore';
22
+ function BaseRenderer() {
23
+ const sourceQuestionnaire = useQuestionnaireStore((state) => state.sourceQuestionnaire);
24
+ const updateExpressions = useQuestionnaireStore((state) => state.updateExpressions);
25
+ const updatableResponse = useQuestionnaireResponseStore((state) => state.updatableResponse);
26
+ const updateResponse = useQuestionnaireResponseStore((state) => state.updateResponse);
27
+ function handleTopLevelQRItemChange(newTopLevelQItem, index) {
28
+ if (!updatableResponse.item || updatableResponse.item.length === 0) {
29
+ return;
30
+ }
31
+ const updatedItems = [...updatableResponse.item]; // Copy the original array of items
32
+ updatedItems[index] = newTopLevelQItem; // Modify the item at the specified index
33
+ const updatedResponse = Object.assign(Object.assign({}, updatableResponse), { item: updatedItems });
34
+ updateExpressions(updatedResponse);
35
+ updateResponse(updatedResponse);
36
+ }
37
+ const topLevelQItems = sourceQuestionnaire.item;
38
+ const topLevelQRItems = updatableResponse.item;
39
+ if (!topLevelQItems) {
40
+ return React.createElement(React.Fragment, null, "Questionnaire does not have any items");
41
+ }
42
+ return (React.createElement(Fade, { in: true, timeout: 500 },
43
+ React.createElement(Container, { maxWidth: "xl" }, topLevelQItems.map((qItem, index) => {
44
+ const qrItem = topLevelQRItems
45
+ ? topLevelQRItems[index]
46
+ : {
47
+ linkId: qItem.linkId,
48
+ text: qItem.text
49
+ };
50
+ return (React.createElement(FormTopLevelItem, { key: qItem.linkId, topLevelQItem: qItem, topLevelQRItem: qrItem, onQrItemChange: (newTopLevelQRItem) => handleTopLevelQRItemChange(newTopLevelQRItem, index) }));
51
+ }))));
52
+ }
53
+ export default BaseRenderer;
54
+ //# sourceMappingURL=BaseRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseRenderer.js","sourceRoot":"","sources":["../../../src/components/FormRenderer/BaseRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAEhE,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,6BAA6B,MAAM,4CAA4C,CAAC;AAEvF,SAAS,YAAY;IACnB,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxF,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpF,MAAM,iBAAiB,GAAG,6BAA6B,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC5F,MAAM,cAAc,GAAG,6BAA6B,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAEtF,SAAS,0BAA0B,CAAC,gBAA2C,EAAE,KAAa;QAC5F,IAAI,CAAC,iBAAiB,CAAC,IAAI,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAClE,OAAO;SACR;QAED,MAAM,YAAY,GAAG,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,mCAAmC;QACrF,YAAY,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,CAAC,yCAAyC;QAEjF,MAAM,eAAe,mCAChB,iBAAiB,KACpB,IAAI,EAAE,YAAY,GACnB,CAAC;QAEF,iBAAiB,CAAC,eAAe,CAAC,CAAC;QACnC,cAAc,CAAC,eAAe,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,cAAc,GAAG,mBAAmB,CAAC,IAAI,CAAC;IAChD,MAAM,eAAe,GAAG,iBAAiB,CAAC,IAAI,CAAC;IAE/C,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,kFAA0C,CAAC;KACnD;IAED,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG;QAC1B,oBAAC,SAAS,IAAC,QAAQ,EAAC,IAAI,IACrB,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACnC,MAAM,MAAM,GAAG,eAAe;gBAC5B,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC;gBACxB,CAAC,CAAC;oBACE,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;iBACjB,CAAC;YAEN,OAAO,CACL,oBAAC,gBAAgB,IACf,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,aAAa,EAAE,KAAK,EACpB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,CAAC,iBAAiB,EAAE,EAAE,CACpC,0BAA0B,CAAC,iBAAiB,EAAE,KAAK,CAAC,GAEtD,CACH,CAAC;QACJ,CAAC,CAAC,CACQ,CACP,CACR,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,57 @@
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 { Stack } from '@mui/material';
19
+ import { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
20
+ import { updateQrGroup } from '../../utils/qrItem';
21
+ import useQuestionnaireStore from '../../stores/useQuestionnaireStore';
22
+ import FormBodySingleCollapsibleWrapper from './FormBodySingleCollapsibleWrapper';
23
+ function FormBodyCollapsibleWrapper(props) {
24
+ const { topLevelQItem, topLevelQRItem, onQrItemChange } = props;
25
+ const currentTab = useQuestionnaireStore((state) => state.currentTabIndex);
26
+ const tabs = useQuestionnaireStore((state) => state.tabs);
27
+ const switchTab = useQuestionnaireStore((state) => state.switchTab);
28
+ const indexMap = useMemo(() => mapQItemsIndex(topLevelQItem), [topLevelQItem]);
29
+ const qItems = topLevelQItem.item;
30
+ const qrItems = topLevelQRItem.item;
31
+ function handleQrGroupChange(qrItem) {
32
+ updateQrGroup(qrItem, null, topLevelQRItem, indexMap);
33
+ onQrItemChange(topLevelQRItem);
34
+ }
35
+ if (!qItems || !qrItems) {
36
+ return React.createElement(React.Fragment, null, "Unable to load form");
37
+ }
38
+ function handleToggleExpand(index) {
39
+ switchTab(currentTab === index ? -1 : index);
40
+ }
41
+ if (!qItems || !qrItems) {
42
+ return React.createElement(React.Fragment, null, "Unable to load form");
43
+ }
44
+ const qrItemsByIndex = getQrItemsIndex(qItems, qrItems, indexMap);
45
+ return (React.createElement(Stack, { rowGap: 1 }, qItems.map((qItem, i) => {
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
+ return (React.createElement(FormBodySingleCollapsibleWrapper, { key: qItem.linkId, qItem: qItem, qrItem: qrItem, index: i, selectedIndex: currentTab, onToggleExpand: handleToggleExpand, onQrItemChange: handleQrGroupChange }));
54
+ })));
55
+ }
56
+ export default FormBodyCollapsibleWrapper;
57
+ //# sourceMappingURL=FormBodyCollapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormBodyCollapsible.js","sourceRoot":"","sources":["../../../src/components/FormRenderer/FormBodyCollapsible.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAOlF,SAAS,0BAA0B,CAAC,KAA+B;IACjE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEhE,MAAM,UAAU,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE1D,MAAM,SAAS,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEpE,MAAM,QAAQ,GAA2B,OAAO,CAC9C,GAAG,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,EACnC,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;IAClC,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC;IAEpC,SAAS,mBAAmB,CAAC,MAAiC;QAC5D,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;QACtD,cAAc,CAAC,cAAc,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE;QACvB,OAAO,gEAAwB,CAAC;KACjC;IAED,SAAS,kBAAkB,CAAC,KAAa;QACvC,SAAS,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE;QACvB,OAAO,gEAAwB,CAAC;KACjC;IAED,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAElE,OAAO,CACL,oBAAC,KAAK,IAAC,MAAM,EAAE,CAAC,IACb,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QACvB,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAEjC,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnC,IAAI,CAAC,KAAK,IAAI,CAAC,gBAAgB,EAAE;YAC/B,oCAAoC;YACpC,OAAO,IAAI,CAAC;SACb;QAED,OAAO,CACL,oBAAC,gCAAgC,IAC/B,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,EACR,aAAa,EAAE,UAAU,EACzB,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,mBAAmB,GACnC,CACH,CAAC;IACJ,CAAC,CAAC,CACI,CACT,CAAC;AACJ,CAAC;AAED,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,39 @@
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 { Accordion, AccordionDetails, AccordionSummary, Box, Tooltip, Typography } from '@mui/material';
19
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
20
+ import { getContextDisplays } from '../../utils/tabs';
21
+ import { getShortText } from '../../utils/itemControl';
22
+ import ContextDisplayItem from '../FormComponents/ItemParts/ContextDisplayItem';
23
+ const FormBodySingleCollapsible = memo(function FormBodySingleCollapsible(props) {
24
+ var _a, _b;
25
+ const { qItem, index, selectedIndex, onToggleExpand, children } = props;
26
+ const contextDisplayItems = getContextDisplays(qItem);
27
+ const collapsibleLabel = (_b = (_a = getShortText(qItem)) !== null && _a !== void 0 ? _a : qItem.text) !== null && _b !== void 0 ? _b : '';
28
+ return (React.createElement(Accordion, { expanded: selectedIndex === index, TransitionProps: { unmountOnExit: true, timeout: 250 }, onChange: () => onToggleExpand(index) },
29
+ React.createElement(AccordionSummary, { expandIcon: React.createElement(Tooltip, { title: 'Expand' },
30
+ React.createElement(ExpandMoreIcon, null)) },
31
+ React.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", mr: 3 },
32
+ React.createElement(Typography, { variant: "subtitle2" }, collapsibleLabel),
33
+ React.createElement(Box, { display: "flex", columnGap: 0.5 }, contextDisplayItems.map((item) => {
34
+ return React.createElement(ContextDisplayItem, { key: item.linkId, displayItem: item });
35
+ })))),
36
+ React.createElement(AccordionDetails, null, children)));
37
+ });
38
+ export default FormBodySingleCollapsible;
39
+ //# sourceMappingURL=FormBodySingleCollapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormBodySingleCollapsible.js","sourceRoot":"","sources":["../../../src/components/FormRenderer/FormBodySingleCollapsible.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EACP,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,kBAAkB,MAAM,gDAAgD,CAAC;AAUhF,MAAM,yBAAyB,GAAG,IAAI,CAAC,SAAS,yBAAyB,CACvE,KAAqC;;IAErC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAExE,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAEtD,MAAM,gBAAgB,GAAG,MAAA,MAAA,YAAY,CAAC,KAAK,CAAC,mCAAI,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC;IAEjE,OAAO,CACL,oBAAC,SAAS,IACR,QAAQ,EAAE,aAAa,KAAK,KAAK,EACjC,eAAe,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EACtD,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC;QACrC,oBAAC,gBAAgB,IACf,UAAU,EACR,oBAAC,OAAO,IAAC,KAAK,EAAE,QAAQ;gBACtB,oBAAC,cAAc,OAAG,CACV;YAEZ,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe,EAAC,KAAK,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC;gBACvF,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,IAAE,gBAAgB,CAAc;gBAC/D,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,GAAG,IAC/B,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBAChC,OAAO,oBAAC,kBAAkB,IAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,GAAI,CAAC;gBACrE,CAAC,CAAC,CACE,CACF,CACW;QACnB,oBAAC,gBAAgB,QAAE,QAAQ,CAAoB,CACrC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
@@ -8,5 +8,5 @@ interface FormBodySingleCollapsibleProps extends PropsWithQrItemChangeHandler<Qu
8
8
  selectedIndex: number;
9
9
  onToggleExpand: (index: number) => void;
10
10
  }
11
- declare function FormBodySingleCollapsibleWrapper(props: FormBodySingleCollapsibleProps): React.JSX.Element;
11
+ declare function FormBodySingleCollapsibleWrapper(props: FormBodySingleCollapsibleProps): React.JSX.Element | null;
12
12
  export default FormBodySingleCollapsibleWrapper;