@aehrc/smart-forms-renderer 0.17.0 → 0.20.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 (567) hide show
  1. package/__mocks__/zustand.ts +1 -1
  2. package/lib/api/smartClient.js +1 -1
  3. package/lib/components/Alert.styles.js +1 -1
  4. package/lib/components/Box.styles.js +1 -1
  5. package/lib/components/FormComponents/AttachmentItem/AttachmentField.js +1 -1
  6. package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js +1 -1
  7. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.js +1 -1
  8. package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js +1 -1
  9. package/lib/components/FormComponents/AttachmentItem/AttachmentUrlField.js +1 -1
  10. package/lib/components/FormComponents/BooleanItem/BooleanField.d.ts +7 -3
  11. package/lib/components/FormComponents/BooleanItem/BooleanField.js +27 -5
  12. package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
  13. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +20 -11
  14. package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.js +1 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +1 -1
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +0 -2
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +6 -4
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -1
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +0 -2
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +4 -4
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +2 -3
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +5 -2
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -1
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +0 -2
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +4 -4
  28. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  29. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +6 -7
  30. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
  31. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.d.ts +0 -2
  32. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +5 -2
  33. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
  34. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +0 -2
  35. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +4 -4
  36. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
  37. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +0 -2
  38. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +5 -2
  39. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
  40. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +0 -2
  41. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +4 -4
  42. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
  43. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.js +1 -1
  44. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +1 -1
  45. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +1 -1
  46. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +1 -1
  47. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +1 -1
  48. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js +1 -1
  49. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +1 -1
  50. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.js +1 -1
  51. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.js.map +1 -0
  52. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.d.ts +1 -1
  53. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.js +13 -13
  54. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js.map +1 -0
  55. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.js +1 -2
  56. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePicker.js.map +1 -0
  57. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePickerButton.js +29 -0
  58. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePickerButton.js.map +1 -0
  59. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.js +1 -1
  60. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/MuiDatePicker.js.map +1 -0
  61. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.d.ts +9 -0
  62. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js +116 -0
  63. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map +1 -0
  64. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.d.ts +15 -0
  65. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js +40 -0
  66. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js.map +1 -0
  67. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.d.ts +22 -0
  68. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js +28 -0
  69. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js.map +1 -0
  70. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.js +1 -1
  71. package/lib/components/FormComponents/DateTimeItems/index.js.map +1 -0
  72. package/lib/components/FormComponents/DateTimeItems/utils/index.d.ts +1 -0
  73. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/utils}/index.js +2 -2
  74. package/lib/components/FormComponents/DateTimeItems/utils/index.js.map +1 -0
  75. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.d.ts → DateTimeItems/utils/parseDate.d.ts} +2 -2
  76. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.js → DateTimeItems/utils/parseDate.js} +10 -10
  77. package/lib/components/FormComponents/DateTimeItems/utils/parseDate.js.map +1 -0
  78. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.d.ts +19 -0
  79. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.js +81 -0
  80. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.js.map +1 -0
  81. package/lib/components/FormComponents/DecimalItem/DecimalField.js +1 -1
  82. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +1 -1
  83. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +1 -1
  84. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js +1 -1
  85. package/lib/components/FormComponents/DisplayItem/DisplayItem.js +1 -1
  86. package/lib/components/FormComponents/GridGroup/GridGroup.js +1 -1
  87. package/lib/components/FormComponents/GridGroup/GridRow.js +1 -1
  88. package/lib/components/FormComponents/GridGroup/GridTable.js +1 -1
  89. package/lib/components/FormComponents/GridGroup/index.js +1 -1
  90. package/lib/components/FormComponents/GroupItem/GroupHeading.js +1 -1
  91. package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +2 -1
  92. package/lib/components/FormComponents/GroupItem/GroupItem.js +4 -4
  93. package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
  94. package/lib/components/FormComponents/GroupItem/GroupItem.styles.js +1 -1
  95. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.d.ts +2 -1
  96. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +5 -5
  97. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
  98. package/lib/components/FormComponents/GroupItem/NextTabButton.js +1 -1
  99. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js +1 -1
  100. package/lib/components/FormComponents/IntegerItem/IntegerField.js +1 -1
  101. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +1 -1
  102. package/lib/components/FormComponents/Item.styles.js +1 -1
  103. package/lib/components/FormComponents/ItemParts/CheckboxSingle.js +1 -1
  104. package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.js +1 -1
  105. package/lib/components/FormComponents/ItemParts/ContextDisplayItem.js +1 -1
  106. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +1 -1
  107. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +1 -1
  108. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +1 -1
  109. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +1 -1
  110. package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js +1 -1
  111. package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.js +1 -1
  112. package/lib/components/FormComponents/Lists.styles.js +1 -1
  113. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +1 -1
  114. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +1 -1
  115. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +0 -2
  116. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +7 -5
  117. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -1
  118. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +0 -2
  119. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +4 -4
  120. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
  121. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +3 -5
  122. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
  123. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +0 -2
  124. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +5 -2
  125. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -1
  126. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +0 -2
  127. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +3 -3
  128. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
  129. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +1 -1
  130. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +1 -1
  131. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +1 -1
  132. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +1 -1
  133. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +2 -2
  134. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +9 -3
  135. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
  136. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.d.ts +1 -0
  137. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +3 -3
  138. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
  139. package/lib/components/FormComponents/RepeatGroup/index.js +1 -1
  140. package/lib/components/FormComponents/RepeatItem/AddItemButton.js +1 -1
  141. package/lib/components/FormComponents/RepeatItem/RemoveItemButton.js +1 -1
  142. package/lib/components/FormComponents/RepeatItem/RepeatField.js +1 -1
  143. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +1 -1
  144. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js +1 -1
  145. package/lib/components/FormComponents/RepeatItem/index.js +1 -1
  146. package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
  147. package/lib/components/FormComponents/SingleItem/SingleItem.js +12 -7
  148. package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
  149. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +4 -4
  150. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  151. package/lib/components/FormComponents/SingleItem/index.js +1 -1
  152. package/lib/components/FormComponents/SliderItem/Slider.styles.js +1 -1
  153. package/lib/components/FormComponents/SliderItem/SliderDisplayValue.js +1 -1
  154. package/lib/components/FormComponents/SliderItem/SliderField.js +1 -1
  155. package/lib/components/FormComponents/SliderItem/SliderItem.js +1 -1
  156. package/lib/components/FormComponents/SliderItem/SliderLabels.js +1 -1
  157. package/lib/components/FormComponents/StringItem/StringField.js +1 -1
  158. package/lib/components/FormComponents/StringItem/StringItem.js +1 -1
  159. package/lib/components/FormComponents/Tables/AddRowButton.js +1 -1
  160. package/lib/components/FormComponents/Tables/GroupTable.js +1 -1
  161. package/lib/components/FormComponents/Tables/GroupTableBody.js +1 -1
  162. package/lib/components/FormComponents/Tables/GroupTableRow.js +1 -1
  163. package/lib/components/FormComponents/Tables/GroupTableRowCells.js +1 -1
  164. package/lib/components/FormComponents/Tables/GroupTableView.js +1 -1
  165. package/lib/components/FormComponents/Tables/RemoveRowButton.js +1 -1
  166. package/lib/components/FormComponents/Tables/SelectRowButton.js +1 -1
  167. package/lib/components/FormComponents/Tables/Table.styles.js +1 -1
  168. package/lib/components/FormComponents/Tables/index.js +1 -1
  169. package/lib/components/FormComponents/TextItem/MuiTextField.js +1 -1
  170. package/lib/components/FormComponents/TextItem/TextField.js +1 -1
  171. package/lib/components/FormComponents/TextItem/TextItem.js +1 -1
  172. package/lib/components/FormComponents/Textfield.styles.js +1 -1
  173. package/lib/components/FormComponents/TimeItem/TimeField.js +1 -1
  174. package/lib/components/FormComponents/TimeItem/TimeItem.js +1 -1
  175. package/lib/components/FormComponents/UrlItem/UrlField.js +1 -1
  176. package/lib/components/FormComponents/UrlItem/UrlItem.js +1 -1
  177. package/lib/components/FormComponents/index.d.ts +1 -1
  178. package/lib/components/FormComponents/index.js +2 -2
  179. package/lib/components/FormComponents/index.js.map +1 -1
  180. package/lib/components/Iconify/Iconify.js +1 -1
  181. package/lib/components/Lists.styles.js +1 -1
  182. package/lib/components/Renderer/BaseRenderer.js +1 -1
  183. package/lib/components/Renderer/FormBodyCollapsible.js +1 -1
  184. package/lib/components/Renderer/FormBodySingleCollapsible.js +1 -1
  185. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js +1 -1
  186. package/lib/components/Renderer/FormBodyTabbed.js +1 -1
  187. package/lib/components/Renderer/FormTitle.js +1 -1
  188. package/lib/components/Renderer/FormTopLevelItem.js +1 -1
  189. package/lib/components/Renderer/SmartFormsRenderer.js +1 -1
  190. package/lib/components/Renderer/index.js +1 -1
  191. package/lib/components/Tabs/CompleteTabButton.js +1 -1
  192. package/lib/components/Tabs/FormBodySingleTab.js +1 -1
  193. package/lib/components/Tabs/FormBodyTabList.js +1 -1
  194. package/lib/components/Tabs/FormBodyTabListWrapper.js +1 -1
  195. package/lib/components/Tabs/ShowCompletedTabsSection.js +1 -1
  196. package/lib/components/index.js +1 -1
  197. package/lib/hooks/useAttachmentUrlValidation.js +1 -1
  198. package/lib/hooks/useContextDisplayItems.js +1 -1
  199. package/lib/hooks/useDateTimeNonEmpty.d.ts +2 -0
  200. package/lib/{components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js → hooks/useDateTimeNonEmpty.js} +9 -3
  201. package/lib/hooks/useDateTimeNonEmpty.js.map +1 -0
  202. package/lib/hooks/useDateValidation.js +3 -3
  203. package/lib/hooks/useDateValidation.js.map +1 -1
  204. package/lib/hooks/useDebounce.js +1 -1
  205. package/lib/hooks/useDecimalCalculatedExpression.js +1 -1
  206. package/lib/hooks/useGroupTableRows.js +1 -1
  207. package/lib/hooks/useHidden.d.ts +1 -1
  208. package/lib/hooks/useHidden.js +4 -3
  209. package/lib/hooks/useHidden.js.map +1 -1
  210. package/lib/hooks/useInitialiseGroupTable.js +1 -1
  211. package/lib/hooks/useInitialiseRenderer.js +1 -1
  212. package/lib/hooks/useInitialiseRepeatAnswers.js +1 -1
  213. package/lib/hooks/useInitialiseRepeatGroups.js +1 -1
  214. package/lib/hooks/useIntegerCalculatedExpression.js +1 -1
  215. package/lib/hooks/useNumberInput.js +1 -1
  216. package/lib/hooks/useQueryClient.js +1 -1
  217. package/lib/hooks/useReadOnly.js +1 -1
  218. package/lib/hooks/useRenderingExtensions.js +1 -1
  219. package/lib/hooks/useResponsive.js +1 -1
  220. package/lib/hooks/useSliderExtensions.js +1 -1
  221. package/lib/hooks/useStringCalculatedExpression.js +1 -1
  222. package/lib/hooks/useStringInput.js +1 -1
  223. package/lib/hooks/useTerminologyServerQuery.js +1 -1
  224. package/lib/hooks/useTimeValidation.d.ts +5 -0
  225. package/lib/hooks/useTimeValidation.js +54 -0
  226. package/lib/hooks/useTimeValidation.js.map +1 -0
  227. package/lib/hooks/useValidationFeedback.js +1 -1
  228. package/lib/hooks/useValueSetCodings.js +1 -1
  229. package/lib/index.d.ts +1 -0
  230. package/lib/index.js +1 -0
  231. package/lib/index.js.map +1 -1
  232. package/lib/interfaces/answerExpression.interface.js +1 -1
  233. package/lib/interfaces/choice.enum.js +1 -1
  234. package/lib/interfaces/enableWhen.interface.d.ts +20 -5
  235. package/lib/interfaces/enableWhen.interface.js +1 -1
  236. package/lib/interfaces/groupTable.interface.js +1 -1
  237. package/lib/interfaces/index.d.ts +1 -0
  238. package/lib/interfaces/index.js +2 -0
  239. package/lib/interfaces/index.js.map +1 -0
  240. package/lib/interfaces/populate.interface.js +1 -1
  241. package/lib/interfaces/questionnaireStore.interface.d.ts +2 -2
  242. package/lib/interfaces/questionnaireStore.interface.js +1 -1
  243. package/lib/interfaces/regex.interface.js +1 -1
  244. package/lib/interfaces/renderProps.interface.d.ts +4 -0
  245. package/lib/interfaces/renderProps.interface.js +1 -1
  246. package/lib/interfaces/repeatGroup.interface.js +1 -1
  247. package/lib/interfaces/valueSet.interface.js +1 -1
  248. package/lib/interfaces/variables.interface.js +1 -1
  249. package/lib/stores/questionnaireResponseStore.js +1 -1
  250. package/lib/stores/questionnaireStore.d.ts +5 -3
  251. package/lib/stores/questionnaireStore.js +13 -6
  252. package/lib/stores/questionnaireStore.js.map +1 -1
  253. package/lib/stores/smartConfigStore.js +1 -1
  254. package/lib/stores/terminologyServerStore.js +1 -1
  255. package/lib/theme/customGlobalStyles.js +1 -1
  256. package/lib/theme/overrides/Accordion.js +1 -1
  257. package/lib/theme/overrides/Autocomplete.js +1 -1
  258. package/lib/theme/overrides/Button.js +1 -1
  259. package/lib/theme/overrides/Card.js +1 -1
  260. package/lib/theme/overrides/Input.js +1 -1
  261. package/lib/theme/overrides/Overrides.js +1 -1
  262. package/lib/theme/overrides/Paper.js +1 -1
  263. package/lib/theme/overrides/SpeedDial.js +1 -1
  264. package/lib/theme/overrides/Table.js +1 -1
  265. package/lib/theme/palette.js +1 -1
  266. package/lib/theme/shadows.js +1 -1
  267. package/lib/theme/typography.js +1 -1
  268. package/lib/utils/calculatedExpression.js +1 -1
  269. package/lib/utils/choice.d.ts +1 -1
  270. package/lib/utils/choice.js +1 -1
  271. package/lib/utils/choice.js.map +1 -1
  272. package/lib/utils/dayjsExtend.js +1 -1
  273. package/lib/utils/debounce.js +1 -1
  274. package/lib/utils/emptyResource.js +1 -1
  275. package/lib/utils/enableWhen.d.ts +11 -4
  276. package/lib/utils/enableWhen.js +131 -54
  277. package/lib/utils/enableWhen.js.map +1 -1
  278. package/lib/utils/enableWhenExpression.d.ts +1 -1
  279. package/lib/utils/enableWhenExpression.js +27 -8
  280. package/lib/utils/enableWhenExpression.js.map +1 -1
  281. package/lib/utils/fhirpath.js +1 -1
  282. package/lib/utils/formChanges.js +1 -1
  283. package/lib/utils/groupTable.js +1 -1
  284. package/lib/utils/index.d.ts +1 -0
  285. package/lib/utils/index.js +2 -1
  286. package/lib/utils/index.js.map +1 -1
  287. package/lib/utils/initialise.js +1 -1
  288. package/lib/utils/itemControl.js +1 -1
  289. package/lib/utils/mapItem.js +1 -1
  290. package/lib/utils/misc.d.ts +5 -0
  291. package/lib/utils/misc.js +116 -0
  292. package/lib/utils/misc.js.map +1 -0
  293. package/lib/utils/openChoice.js +1 -1
  294. package/lib/utils/parseInputs.js +1 -1
  295. package/lib/utils/populateContexts.js +1 -1
  296. package/lib/utils/qItem.d.ts +2 -1
  297. package/lib/utils/qItem.js +20 -8
  298. package/lib/utils/qItem.js.map +1 -1
  299. package/lib/utils/qrItem.js +1 -1
  300. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +1 -1
  301. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +2 -2
  302. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
  303. package/lib/utils/questionnaireStoreUtils/extractContainedValueSets.js +1 -1
  304. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.d.ts +13 -3
  305. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js +82 -19
  306. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +1 -1
  307. package/lib/utils/questionnaireStoreUtils/extractTabs.js +1 -1
  308. package/lib/utils/questionnaireStoreUtils/extractVariables.js +1 -1
  309. package/lib/utils/questionnaireStoreUtils/resolveValueSets.js +1 -1
  310. package/lib/utils/removeEmptyAnswers.js +1 -1
  311. package/lib/utils/repopulateItems.js +1 -1
  312. package/lib/utils/slider.js +1 -1
  313. package/lib/utils/tabs.d.ts +1 -1
  314. package/lib/utils/tabs.js +7 -5
  315. package/lib/utils/tabs.js.map +1 -1
  316. package/lib/utils/validateQuestionnaire.js +1 -1
  317. package/lib/utils/valueSet.js +1 -1
  318. package/package.json +2 -2
  319. package/src/api/smartClient.ts +1 -1
  320. package/src/components/Alert.styles.ts +1 -1
  321. package/src/components/Box.styles.ts +1 -1
  322. package/src/components/FormComponents/AttachmentItem/AttachmentField.tsx +1 -1
  323. package/src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx +1 -1
  324. package/src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.tsx +1 -1
  325. package/src/components/FormComponents/AttachmentItem/AttachmentItem.tsx +1 -1
  326. package/src/components/FormComponents/AttachmentItem/AttachmentUrlField.tsx +1 -1
  327. package/src/components/FormComponents/BooleanItem/BooleanField.tsx +54 -18
  328. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +48 -14
  329. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.tsx +1 -1
  330. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +1 -1
  331. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +5 -3
  332. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +1 -6
  333. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +7 -4
  334. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +3 -6
  335. package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +2 -7
  336. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +5 -3
  337. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +2 -6
  338. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +5 -4
  339. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +2 -6
  340. package/src/components/FormComponents/ChoiceItems/ChoiceRadioSingle.tsx +1 -1
  341. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +1 -1
  342. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +1 -1
  343. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +1 -1
  344. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +1 -1
  345. package/src/components/FormComponents/DateTimeItem/DateTimeField.tsx +1 -1
  346. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +1 -1
  347. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.tsx +1 -1
  348. package/src/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.tsx +15 -15
  349. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.tsx +1 -2
  350. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePickerButton.tsx +18 -1
  351. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.ts +1 -1
  352. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx +222 -0
  353. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.tsx +117 -0
  354. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.tsx +96 -0
  355. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.ts +1 -1
  356. package/src/components/FormComponents/{CustomDateItem → DateTimeItems/utils}/index.ts +2 -2
  357. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.ts → DateTimeItems/utils/parseDate.ts} +10 -10
  358. package/src/components/FormComponents/DateTimeItems/utils/parseTime.ts +127 -0
  359. package/src/components/FormComponents/DecimalItem/DecimalField.tsx +1 -1
  360. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +1 -1
  361. package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts +1 -1
  362. package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +1 -1
  363. package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +1 -1
  364. package/src/components/FormComponents/GridGroup/GridGroup.tsx +1 -1
  365. package/src/components/FormComponents/GridGroup/GridRow.tsx +1 -1
  366. package/src/components/FormComponents/GridGroup/GridTable.tsx +1 -1
  367. package/src/components/FormComponents/GridGroup/index.ts +1 -1
  368. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +1 -1
  369. package/src/components/FormComponents/GroupItem/GroupItem.styles.ts +1 -1
  370. package/src/components/FormComponents/GroupItem/GroupItem.tsx +9 -3
  371. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +11 -3
  372. package/src/components/FormComponents/GroupItem/NextTabButton.tsx +1 -1
  373. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx +1 -1
  374. package/src/components/FormComponents/IntegerItem/IntegerField.tsx +1 -1
  375. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +1 -1
  376. package/src/components/FormComponents/Item.styles.ts +1 -1
  377. package/src/components/FormComponents/ItemParts/CheckboxSingle.tsx +1 -1
  378. package/src/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.tsx +1 -1
  379. package/src/components/FormComponents/ItemParts/ContextDisplayItem.tsx +1 -1
  380. package/src/components/FormComponents/ItemParts/FadingCheckIcon.tsx +1 -1
  381. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +1 -1
  382. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +1 -1
  383. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +1 -1
  384. package/src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx +1 -1
  385. package/src/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.tsx +1 -1
  386. package/src/components/FormComponents/Lists.styles.ts +1 -1
  387. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +1 -1
  388. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +1 -1
  389. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +4 -3
  390. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +1 -6
  391. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +1 -6
  392. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +4 -3
  393. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +2 -5
  394. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +1 -1
  395. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +1 -1
  396. package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +1 -1
  397. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +1 -1
  398. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +14 -3
  399. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +5 -1
  400. package/src/components/FormComponents/RepeatGroup/index.ts +1 -1
  401. package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +1 -1
  402. package/src/components/FormComponents/RepeatItem/RemoveItemButton.tsx +1 -1
  403. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +1 -1
  404. package/src/components/FormComponents/RepeatItem/RepeatItem.styles.tsx +1 -1
  405. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +1 -1
  406. package/src/components/FormComponents/RepeatItem/index.ts +1 -1
  407. package/src/components/FormComponents/SingleItem/SingleItem.tsx +20 -7
  408. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +4 -4
  409. package/src/components/FormComponents/SingleItem/index.ts +1 -1
  410. package/src/components/FormComponents/SliderItem/Slider.styles.ts +1 -1
  411. package/src/components/FormComponents/SliderItem/SliderDisplayValue.tsx +1 -1
  412. package/src/components/FormComponents/SliderItem/SliderField.tsx +1 -1
  413. package/src/components/FormComponents/SliderItem/SliderItem.tsx +1 -1
  414. package/src/components/FormComponents/SliderItem/SliderLabels.tsx +1 -1
  415. package/src/components/FormComponents/StringItem/StringField.tsx +1 -1
  416. package/src/components/FormComponents/StringItem/StringItem.tsx +1 -1
  417. package/src/components/FormComponents/Tables/AddRowButton.tsx +1 -1
  418. package/src/components/FormComponents/Tables/GroupTable.tsx +1 -1
  419. package/src/components/FormComponents/Tables/GroupTableBody.tsx +1 -1
  420. package/src/components/FormComponents/Tables/GroupTableRow.tsx +1 -1
  421. package/src/components/FormComponents/Tables/GroupTableRowCells.tsx +1 -1
  422. package/src/components/FormComponents/Tables/GroupTableView.tsx +1 -1
  423. package/src/components/FormComponents/Tables/RemoveRowButton.tsx +1 -1
  424. package/src/components/FormComponents/Tables/SelectRowButton.tsx +1 -1
  425. package/src/components/FormComponents/Tables/Table.styles.tsx +1 -1
  426. package/src/components/FormComponents/Tables/index.ts +1 -1
  427. package/src/components/FormComponents/TextItem/MuiTextField.ts +1 -1
  428. package/src/components/FormComponents/TextItem/TextField.tsx +1 -1
  429. package/src/components/FormComponents/TextItem/TextItem.tsx +1 -1
  430. package/src/components/FormComponents/Textfield.styles.ts +1 -1
  431. package/src/components/FormComponents/TimeItem/TimeField.tsx +1 -1
  432. package/src/components/FormComponents/TimeItem/TimeItem.tsx +1 -1
  433. package/src/components/FormComponents/UrlItem/UrlField.tsx +1 -1
  434. package/src/components/FormComponents/UrlItem/UrlItem.tsx +1 -1
  435. package/src/components/FormComponents/index.ts +2 -2
  436. package/src/components/Iconify/Iconify.tsx +1 -1
  437. package/src/components/Lists.styles.ts +1 -1
  438. package/src/components/Renderer/BaseRenderer.tsx +1 -1
  439. package/src/components/Renderer/FormBodyCollapsible.tsx +1 -1
  440. package/src/components/Renderer/FormBodySingleCollapsible.tsx +1 -1
  441. package/src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx +1 -1
  442. package/src/components/Renderer/FormBodyTabbed.tsx +1 -1
  443. package/src/components/Renderer/FormTitle.tsx +1 -1
  444. package/src/components/Renderer/FormTopLevelItem.tsx +1 -1
  445. package/src/components/Renderer/SmartFormsRenderer.tsx +1 -1
  446. package/src/components/Renderer/index.ts +1 -1
  447. package/src/components/Tabs/CompleteTabButton.tsx +1 -1
  448. package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
  449. package/src/components/Tabs/FormBodyTabList.tsx +1 -1
  450. package/src/components/Tabs/FormBodyTabListWrapper.tsx +1 -1
  451. package/src/components/Tabs/ShowCompletedTabsSection.tsx +1 -1
  452. package/src/components/index.ts +1 -1
  453. package/src/hooks/useAttachmentUrlValidation.ts +1 -1
  454. package/src/hooks/useContextDisplayItems.ts +1 -1
  455. package/src/{components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.ts → hooks/useDateTimeNonEmpty.ts} +15 -2
  456. package/src/hooks/useDateValidation.tsx +3 -3
  457. package/src/hooks/useDebounce.ts +1 -1
  458. package/src/hooks/useDecimalCalculatedExpression.ts +1 -1
  459. package/src/hooks/useGroupTableRows.ts +1 -1
  460. package/src/hooks/useHidden.ts +4 -3
  461. package/src/hooks/useInitialiseGroupTable.ts +1 -1
  462. package/src/hooks/useInitialiseRenderer.ts +1 -1
  463. package/src/hooks/useInitialiseRepeatAnswers.ts +1 -1
  464. package/src/hooks/useInitialiseRepeatGroups.ts +1 -1
  465. package/src/hooks/useIntegerCalculatedExpression.ts +1 -1
  466. package/src/hooks/useNumberInput.ts +1 -1
  467. package/src/hooks/useQueryClient.ts +1 -1
  468. package/src/hooks/useReadOnly.ts +1 -1
  469. package/src/hooks/useRenderingExtensions.ts +1 -1
  470. package/src/hooks/useResponsive.ts +1 -1
  471. package/src/hooks/useSliderExtensions.ts +1 -1
  472. package/src/hooks/useStringCalculatedExpression.ts +1 -1
  473. package/src/hooks/useStringInput.ts +1 -1
  474. package/src/hooks/useTerminologyServerQuery.ts +1 -1
  475. package/src/hooks/useTimeValidation.tsx +70 -0
  476. package/src/hooks/useValidationFeedback.ts +1 -1
  477. package/src/hooks/useValueSetCodings.ts +1 -1
  478. package/src/index.ts +1 -0
  479. package/src/interfaces/answerExpression.interface.ts +1 -1
  480. package/src/interfaces/choice.enum.ts +1 -1
  481. package/src/interfaces/enableWhen.interface.ts +25 -6
  482. package/src/interfaces/groupTable.interface.ts +1 -1
  483. package/src/interfaces/index.ts +8 -0
  484. package/src/interfaces/populate.interface.ts +1 -1
  485. package/src/interfaces/questionnaireStore.interface.ts +3 -3
  486. package/src/interfaces/regex.interface.ts +1 -1
  487. package/src/interfaces/renderProps.interface.ts +5 -1
  488. package/src/interfaces/repeatGroup.interface.ts +1 -1
  489. package/src/interfaces/tab.interface.ts +1 -1
  490. package/src/interfaces/valueSet.interface.ts +1 -1
  491. package/src/interfaces/variables.interface.ts +1 -1
  492. package/src/stores/questionnaireResponseStore.ts +1 -1
  493. package/src/stores/questionnaireStore.ts +46 -9
  494. package/src/stores/smartConfigStore.ts +1 -1
  495. package/src/stores/terminologyServerStore.ts +1 -1
  496. package/src/stories/MedicalHistoryTable.stories.tsx +1 -1
  497. package/src/stories/SmartFormsRenderer.stories.ts +1 -1
  498. package/src/theme/Theme.tsx +1 -1
  499. package/src/theme/customGlobalStyles.tsx +1 -1
  500. package/src/theme/overrides/Accordion.ts +1 -1
  501. package/src/theme/overrides/Autocomplete.ts +1 -1
  502. package/src/theme/overrides/Button.ts +1 -1
  503. package/src/theme/overrides/Card.ts +1 -1
  504. package/src/theme/overrides/Input.ts +1 -1
  505. package/src/theme/overrides/Overrides.ts +1 -1
  506. package/src/theme/overrides/Paper.ts +1 -1
  507. package/src/theme/overrides/SpeedDial.ts +1 -1
  508. package/src/theme/overrides/Table.ts +1 -1
  509. package/src/theme/palette.ts +1 -1
  510. package/src/theme/shadows.ts +1 -1
  511. package/src/theme/typography.ts +1 -1
  512. package/src/utils/calculatedExpression.ts +1 -1
  513. package/src/utils/choice.ts +5 -3
  514. package/src/utils/dayjsExtend.ts +1 -1
  515. package/src/utils/debounce.ts +1 -1
  516. package/src/utils/emptyResource.ts +1 -1
  517. package/src/utils/enableWhen.ts +195 -56
  518. package/src/utils/enableWhenExpression.ts +36 -9
  519. package/src/utils/fhirpath.ts +1 -1
  520. package/src/utils/formChanges.ts +1 -1
  521. package/src/utils/groupTable.ts +1 -1
  522. package/src/utils/index.ts +6 -1
  523. package/src/utils/initialise.ts +1 -1
  524. package/src/utils/itemControl.ts +1 -1
  525. package/src/utils/mapItem.ts +1 -1
  526. package/src/utils/misc.ts +160 -0
  527. package/src/utils/openChoice.ts +1 -1
  528. package/src/utils/parseInputs.ts +1 -1
  529. package/src/utils/populateContexts.ts +1 -1
  530. package/src/utils/qItem.ts +32 -9
  531. package/src/utils/qrItem.ts +1 -1
  532. package/src/utils/questionnaireStoreUtils/addAdditionalVariables.ts +1 -1
  533. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +2 -2
  534. package/src/utils/questionnaireStoreUtils/extractContainedValueSets.ts +1 -1
  535. package/src/utils/questionnaireStoreUtils/extractOtherExtensions.ts +123 -26
  536. package/src/utils/questionnaireStoreUtils/extractTabs.ts +1 -1
  537. package/src/utils/questionnaireStoreUtils/extractVariables.ts +1 -1
  538. package/src/utils/questionnaireStoreUtils/resolveValueSets.ts +1 -1
  539. package/src/utils/removeEmptyAnswers.ts +1 -1
  540. package/src/utils/repopulateItems.ts +1 -1
  541. package/src/utils/slider.ts +1 -1
  542. package/src/utils/tabs.ts +9 -6
  543. package/src/utils/validateQuestionnaire.ts +1 -1
  544. package/src/utils/valueSet.ts +1 -1
  545. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +0 -1
  546. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.js.map +0 -1
  547. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.js.map +0 -1
  548. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js +0 -13
  549. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js.map +0 -1
  550. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.js.map +0 -1
  551. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.js.map +0 -1
  552. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.d.ts +0 -1
  553. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js.map +0 -1
  554. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.js.map +0 -1
  555. package/lib/components/FormComponents/CustomDateItem/index.d.ts +0 -1
  556. package/lib/components/FormComponents/CustomDateItem/index.js.map +0 -1
  557. package/lib/components/FormComponents/DateItem/DateField.d.ts +0 -12
  558. package/lib/components/FormComponents/DateItem/DateItem.d.ts +0 -9
  559. package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.d.ts +0 -7
  560. package/lib/setup-jest.js +0 -1
  561. package/lib/stories/MedicalHistoryTable.stories.js +0 -45
  562. package/lib/stories/SmartFormsRenderer.stories.js +0 -117
  563. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.d.ts +0 -0
  564. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.d.ts +0 -0
  565. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePickerButton.d.ts +0 -0
  566. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.d.ts +0 -0
  567. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.d.ts +0 -0
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
3
2
  import type { Coding, QuestionnaireItem } from 'fhir/r4';
4
3
  import type { TerminologyError } from '../../../hooks/useValueSetCodings';
5
4
  interface ChoiceRadioAnswerValueSetFieldsProps {
6
5
  qItem: QuestionnaireItem;
7
6
  codings: Coding[];
8
7
  valueRadio: string | null;
9
- orientation: ChoiceItemOrientation;
10
8
  readOnly: boolean;
11
9
  terminologyError: TerminologyError;
12
10
  onCheckedChange: (newValue: string) => void;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,11 @@ import ChoiceRadioSingle from './ChoiceRadioSingle';
21
21
  import { StyledRadioGroup } from '../Item.styles';
22
22
  import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
23
23
  import { StyledAlert } from '../../Alert.styles';
24
+ import { getChoiceOrientation } from '../../../utils/choice';
24
25
  function ChoiceRadioAnswerValueSetFields(props) {
25
- const { qItem, codings, valueRadio, orientation, readOnly, terminologyError, onCheckedChange } = props;
26
+ var _a;
27
+ const { qItem, codings, valueRadio, readOnly, terminologyError, onCheckedChange } = props;
28
+ const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
26
29
  if (codings.length > 0) {
27
30
  return (React.createElement(StyledRadioGroup, { row: orientation === ChoiceItemOrientation.Horizontal, name: qItem.text, id: qItem.id, onChange: (e) => onCheckedChange(e.target.value), value: valueRadio !== null && valueRadio !== void 0 ? valueRadio : null }, codings.map((coding) => {
28
31
  var _a, _b, _c;
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceRadioAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAajD,SAAS,+BAA+B,CAAC,KAA2C;IAClF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAC5F,KAAK,CAAC;IAER,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,OAAO,CACL,oBAAC,gBAAgB,IACf,GAAG,EAAE,WAAW,KAAK,qBAAqB,CAAC,UAAU,EACrD,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAChD,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,IACxB,OAAO,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;;YAC9B,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE,EACtB,KAAK,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE,EACxB,KAAK,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,IAAI,EAAE,EACzC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;QACJ,CAAC,CAAC,CACe,CACpB,CAAC;KACH;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE;QAC1B,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;YACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW;;gBACuC,GAAG;gBACtE,gBAAgB,CAAC,cAAc,CACrB,CACD,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"ChoiceRadioAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM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AgB,CAAC,KAAK,EAAE;QAC1B,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;YACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW;;gBACuC,GAAG;gBACtE,gBAAgB,CAAC,cAAc,CACrB,CACD,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,+BAA+B,CAAC"}
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
- import type { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
3
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
3
  import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
5
4
  interface ChoiceRadioAnswerValueSetItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
6
5
  qItem: QuestionnaireItem;
7
6
  qrItem: QuestionnaireResponseItem | null;
8
- orientation: ChoiceItemOrientation;
9
7
  }
10
8
  declare function ChoiceRadioAnswerValueSetItem(props: ChoiceRadioAnswerValueSetItemProps): React.JSX.Element;
11
9
  export default ChoiceRadioAnswerValueSetItem;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
25
25
  import { useQuestionnaireStore } from '../../../stores';
26
26
  function ChoiceRadioAnswerValueSetItem(props) {
27
27
  var _a, _b;
28
- const { qItem, qrItem, orientation, isRepeated, parentIsReadOnly, onQrItemChange } = props;
28
+ const { qItem, qrItem, isRepeated, parentIsReadOnly, onQrItemChange } = props;
29
29
  const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
30
30
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
31
31
  // Init input value
@@ -45,11 +45,11 @@ function ChoiceRadioAnswerValueSetItem(props) {
45
45
  }
46
46
  }
47
47
  if (isRepeated) {
48
- return (React.createElement(ChoiceRadioAnswerValueSetFields, { qItem: qItem, codings: codings, valueRadio: valueRadio, orientation: orientation, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleChange }));
48
+ return (React.createElement(ChoiceRadioAnswerValueSetFields, { qItem: qItem, codings: codings, valueRadio: valueRadio, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleChange }));
49
49
  }
50
50
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-radio-answer-value-set-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
51
51
  React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
52
- React.createElement(ChoiceRadioAnswerValueSetFields, { qItem: qItem, codings: codings, valueRadio: valueRadio, orientation: orientation, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleChange }))));
52
+ React.createElement(ChoiceRadioAnswerValueSetFields, { qItem: qItem, codings: codings, valueRadio: valueRadio, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleChange }))));
53
53
  }
54
54
  export default ChoiceRadioAnswerValueSetItem;
55
55
  //# sourceMappingURL=ChoiceRadioAnswerValueSetItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceRadioAnswerValueSetItem.js","sourceRo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gB;QACpC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACtB,MAAM,QAAQ,GAAG,2BAA2B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAChE,IAAI,QAAQ,EAAE;gBACZ,cAAc,iCACT,iBAAiB,CAAC,KAAK,CAAC,KAC3B,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,IACnC,CAAC;aACJ;SACF;IACH,CAAC;IAED,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,+BAA+B,IAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,YAAY,GAC7B,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd,0CAA0C,iBACvC,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7C,oBAAC,+BAA+B,IAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,YAAY,GAC7B,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"ChoiceRadioAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,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BAAiB,CAAC,KAAK,CAAC,KAC3B,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,IACnC,CAAC;aACJ;SACF;IACH,CAAC;IAED,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,+BAA+B,IAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,YAAY,GAC7B,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd,0CAA0C,iBACvC,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7C,oBAAC,+BAA+B,IAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,YAAY,GAC7B,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomDateField.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,EAAE,MAAM,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,OAAO,EAC3B,YAAY,EAAE,CAAC,UAAiB,EAAE,EAAE;4BAClC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;wBAChD,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GACrC,CACD,CACJ;aACF,EACD,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,GACpC,CACM,CACX,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
2
+ import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../../interfaces/renderProps.interface';
3
3
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
4
  interface CustomDateItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,15 +15,15 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { useState } from 'react';
18
- import useReadOnly from '../../../hooks/useReadOnly';
19
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
20
- import { FullWidthFormComponentBox } from '../../Box.styles';
21
- import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
22
- import { parseFhirDateToDisplayDate, parseInputDateToFhirDate, validateInput } from './customDateTimePicker/utils/parseDates';
23
- import { createEmptyQrItem } from '../../../utils/qrItem';
24
- import useDateValidation from '../../../hooks/useDateValidation';
25
- import CustomDateField from './customDateTimePicker/CustomDateField';
26
- import { useQuestionnaireStore } from '../../../stores';
18
+ import useReadOnly from '../../../../hooks/useReadOnly';
19
+ import useRenderingExtensions from '../../../../hooks/useRenderingExtensions';
20
+ import { FullWidthFormComponentBox } from '../../../Box.styles';
21
+ import ItemFieldGrid from '../../ItemParts/ItemFieldGrid';
22
+ import { parseFhirDateToDisplayDate, parseInputDateToFhirDate, validateDateInput } from '../utils/parseDate';
23
+ import { createEmptyQrItem } from '../../../../utils/qrItem';
24
+ import useDateValidation from '../../../../hooks/useDateValidation';
25
+ import CustomDateField from './CustomDateField';
26
+ import { useQuestionnaireStore } from '../../../../stores';
27
27
  function CustomDateItem(props) {
28
28
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
29
29
  const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
@@ -40,11 +40,11 @@ function CustomDateItem(props) {
40
40
  valueDate = qrDate.answer[0].valueDateTime;
41
41
  }
42
42
  }
43
- const { displayDate, parseFail } = parseFhirDateToDisplayDate(valueDate);
43
+ const { displayDate, dateParseFail } = parseFhirDateToDisplayDate(valueDate);
44
44
  const [input, setInput] = useState(displayDate);
45
45
  const [focused, setFocused] = useState(false);
46
46
  // Perform validation checks
47
- const errorFeedback = useDateValidation(input, parseFail);
47
+ const errorFeedback = useDateValidation(input, dateParseFail);
48
48
  function handleSelectDate(selectedDate) {
49
49
  setInput(selectedDate);
50
50
  onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseInputDateToFhirDate(selectedDate) }] }));
@@ -54,7 +54,7 @@ function CustomDateItem(props) {
54
54
  if (newInput === '') {
55
55
  onQrItemChange(createEmptyQrItem(qItem));
56
56
  }
57
- if (!validateInput(newInput)) {
57
+ if (!validateDateInput(newInput)) {
58
58
  return;
59
59
  }
60
60
  onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseInputDateToFhirDate(newInput) }] }));
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomDateItem.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQxC,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,sBAAsB,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,qCAAqC,CAAC;AACpE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAW3D,SAAS,cAAc,CAAC,KAA0B;IAChD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAExF,MAAM,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC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2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,6 @@ import dayjs from 'dayjs';
19
19
  import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
20
20
  import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
21
21
  import MuiDatePicker from './MuiDatePicker';
22
- // import { DatePicker as MuiDatePicker, LocalizationProvider } from '@mui/x-date-pickers';
23
22
  import DatePickerButton from './DatePickerButton';
24
23
  function DatePicker(props) {
25
24
  const { valueString, readOnly, anchorEl, onSelectDate, onFocus } = props;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateItem/DatePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAUlD,SAAS,UAAU,CAAC,KAAsB;IACxC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEzE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExC,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzE,OAAO,CACL,oBAAC,oBAAoB,IAAC,WAAW,EAAE,YAAY;QAC7C,oBAAC,aAAa,IACZ,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAClC,SAAS,EAAE;gBACT,KAAK,EAAE;oBACL,MAAM,EAAE,GAAG,EAAE;wBACX,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;wBACf,OAAO,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC;oBACD,QAAQ,EAAE,QAAQ;iBACZ;gBACR,SAAS,EAAE;oBACT,IAAI,EAAE,OAAO;iBACd;gBACD,MAAM,EAAE;oBACN,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAuB;iBACxC;aACF,EACD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,EACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;gBACrB,IAAI,CAAC,QAAQ,EAAE;oBACb,OAAO;iBACR;gBAED,YAAY,CAAC,QAAQ,CAAC,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,GACD,CACmB,CACxB,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2024 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 IconButton from '@mui/material/IconButton';
19
+ import EventIcon from '@mui/icons-material/Event';
20
+ function DatePickerButton(props) {
21
+ const { onOpen, readOnly } = props;
22
+ return (React.createElement(IconButton, { sx: { height: 30, width: 30 }, disabled: readOnly, onClick: (e) => {
23
+ e.stopPropagation();
24
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
25
+ } },
26
+ React.createElement(EventIcon, { fontSize: "small" })));
27
+ }
28
+ export default DatePickerButton;
29
+ //# sourceMappingURL=DatePickerButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerButton.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateItem/DatePickerButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAQlD,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEnC,OAAO,CACL,oBAAC,UAAU,IACT,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAC7B,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,MAAM,aAAN,MAAM,uBAAN,MAAM,EAAI,CAAC;QACb,CAAC;QACD,oBAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG,CACnB,CACd,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MuiDatePicker.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateItem/MuiDatePicker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC,eAAe,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../../interfaces/renderProps.interface';
3
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
+ interface CustomDateTimeItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
5
+ qItem: QuestionnaireItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
+ }
8
+ declare function CustomDateTimeItem(props: CustomDateTimeItemProps): React.JSX.Element;
9
+ export default CustomDateTimeItem;
@@ -0,0 +1,116 @@
1
+ /*
2
+ * Copyright 2024 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, { useState } from 'react';
18
+ import useReadOnly from '../../../../hooks/useReadOnly';
19
+ import useRenderingExtensions from '../../../../hooks/useRenderingExtensions';
20
+ import { FullWidthFormComponentBox } from '../../../Box.styles';
21
+ import ItemFieldGrid from '../../ItemParts/ItemFieldGrid';
22
+ import { createEmptyQrItem } from '../../../../utils/qrItem';
23
+ import useDateValidation from '../../../../hooks/useDateValidation';
24
+ import { useQuestionnaireStore } from '../../../../stores';
25
+ import { parseFhirDateToDisplayDate } from '../utils';
26
+ import { parseInputDateToFhirDate, validateDateInput } from '../utils/parseDate';
27
+ import Stack from '@mui/material/Stack';
28
+ import dayjs from 'dayjs';
29
+ import { parseDateTimeToDisplayTime, parseInputDateTimeToFhirDateTime, validateTimeInput } from '../utils/parseTime';
30
+ import useTimeValidation from '../../../../hooks/useTimeValidation';
31
+ import useDateNonEmptyValidation from '../../../../hooks/useDateTimeNonEmpty';
32
+ import DateTimeField from './DateTimeField';
33
+ function CustomDateTimeItem(props) {
34
+ const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
35
+ const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
36
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
37
+ const { displayPrompt, entryFormat } = useRenderingExtensions(qItem);
38
+ const qrDateTime = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
39
+ // Init input value
40
+ let valueDate = '';
41
+ let dateTimeDayJs = null;
42
+ if (qrDateTime.answer) {
43
+ let tempDateTime = '';
44
+ if (qrDateTime.answer[0].valueDate) {
45
+ tempDateTime = qrDateTime.answer[0].valueDate;
46
+ }
47
+ else if (qrDateTime.answer[0].valueDateTime) {
48
+ tempDateTime = qrDateTime.answer[0].valueDateTime;
49
+ }
50
+ // split date and time at "T", 2015-02-07T13:28:17-05:00
51
+ if (tempDateTime.includes('T')) {
52
+ valueDate = tempDateTime.split('T')[0];
53
+ dateTimeDayJs = dayjs(tempDateTime);
54
+ console.log(dateTimeDayJs);
55
+ }
56
+ else {
57
+ valueDate = tempDateTime;
58
+ }
59
+ }
60
+ const { displayDate, dateParseFail } = parseFhirDateToDisplayDate(valueDate);
61
+ const { displayTime, displayPeriod, timeParseFail } = parseDateTimeToDisplayTime(dateTimeDayJs);
62
+ const [dateInput, setDateInput] = useState(displayDate);
63
+ const [timeInput, setTimeInput] = useState(displayTime);
64
+ const [periodInput, setPeriodInput] = useState(displayPeriod);
65
+ const [dateFocused, setDateFocused] = useState(false);
66
+ // Perform validation checks
67
+ let dateFeedback = useDateValidation(dateInput, dateParseFail);
68
+ const { timeFeedback, is24HourNotation } = useTimeValidation(timeInput, periodInput, timeParseFail);
69
+ dateFeedback = useDateNonEmptyValidation(dateInput, timeInput, dateFeedback, timeFeedback);
70
+ function handleSelectDate(selectedDate) {
71
+ setDateInput(selectedDate);
72
+ updateQRDateTime(selectedDate, timeInput, periodInput, is24HourNotation);
73
+ }
74
+ function handleDateInputChange(newDateInput) {
75
+ setDateInput(newDateInput);
76
+ if (newDateInput === '') {
77
+ onQrItemChange(createEmptyQrItem(qItem));
78
+ }
79
+ if (!validateDateInput(newDateInput)) {
80
+ return;
81
+ }
82
+ updateQRDateTime(newDateInput, timeInput, periodInput, is24HourNotation);
83
+ }
84
+ function handleTimeInputChange(newTimeInput, newPeriodInput) {
85
+ setTimeInput(newTimeInput);
86
+ setPeriodInput(newPeriodInput);
87
+ if (newTimeInput === '') {
88
+ onQrItemChange(createEmptyQrItem(qItem));
89
+ }
90
+ const { timeIsValid, is24HourNotation } = validateTimeInput(newTimeInput, newPeriodInput);
91
+ if (!validateDateInput(dateInput) && !timeIsValid) {
92
+ return;
93
+ }
94
+ updateQRDateTime(dateInput, newTimeInput, newPeriodInput, is24HourNotation);
95
+ }
96
+ function updateQRDateTime(dateInput, timeInput, periodInput, is24HourNotation) {
97
+ let fhirTime = '';
98
+ if (timeInput) {
99
+ fhirTime = parseInputDateTimeToFhirDateTime(parseInputDateToFhirDate(dateInput), timeInput, periodInput, is24HourNotation);
100
+ }
101
+ else {
102
+ fhirTime = parseInputDateToFhirDate(dateInput);
103
+ }
104
+ onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDateTime: fhirTime }] }));
105
+ }
106
+ // FIXME entryFormat and displayPrompt, put them beneath the entire component instead of at the date field
107
+ if (isRepeated) {
108
+ return (React.createElement(Stack, null,
109
+ React.createElement(DateTimeField, { linkId: qItem.linkId, displayDate: displayDate, dateInput: dateInput, timeInput: timeInput, periodInput: periodInput, is24HourNotation: is24HourNotation, dateFeedback: dateFeedback !== null && dateFeedback !== void 0 ? dateFeedback : '', timeFeedback: timeFeedback !== null && timeFeedback !== void 0 ? timeFeedback : '', dateFocused: dateFocused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, onDateInputChange: handleDateInputChange, onSelectDate: handleSelectDate, setDateFocused: setDateFocused, onTimeInputChange: handleTimeInputChange })));
110
+ }
111
+ return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-date-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
112
+ React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
113
+ React.createElement(DateTimeField, { linkId: qItem.linkId, displayDate: displayDate, dateInput: dateInput, timeInput: timeInput, periodInput: periodInput, is24HourNotation: is24HourNotation, dateFeedback: dateFeedback !== null && dateFeedback !== void 0 ? dateFeedback : '', timeFeedback: timeFeedback !== null && timeFeedback !== void 0 ? timeFeedback : '', dateFocused: dateFocused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, onDateInputChange: handleDateInputChange, onSelectDate: handleSelectDate, setDateFocused: setDateFocused, onTimeInputChange: handleTimeInputChange }))));
114
+ }
115
+ export default CustomDateTimeItem;
116
+ //# sourceMappingURL=CustomDateTimeItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomDateTimeItem.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx"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AAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7C,oBAAC,aAAa,IACZ,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,EAChC,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,EAChC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,qBAAqB,EACxC,YAAY,EAAE,gBAAgB,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,qBAAqB,GACxC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsTabledAttribute } from '../../../../interfaces/renderProps.interface';
3
+ interface CustomTimeFieldProps extends PropsWithIsTabledAttribute {
4
+ linkId: string;
5
+ timeInput: string;
6
+ periodInput: string;
7
+ is24HourNotation: boolean;
8
+ feedback: string;
9
+ displayPrompt: string;
10
+ readOnly: boolean;
11
+ onTimeInputChange: (newInput: string) => void;
12
+ onPeriodChange: (newPeriod: string) => void;
13
+ }
14
+ declare function CustomTimeField(props: CustomTimeFieldProps): React.JSX.Element;
15
+ export default CustomTimeField;
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright 2024 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 { TEXT_FIELD_WIDTH } from '../../Textfield.styles';
19
+ import Tooltip from '@mui/material/Tooltip';
20
+ import Box from '@mui/material/Box';
21
+ import Select from '@mui/material/Select';
22
+ import MenuItem from '@mui/material/MenuItem';
23
+ import MuiTextField from '../../TextItem/MuiTextField';
24
+ import { grey } from '@mui/material/colors';
25
+ import Typography from '@mui/material/Typography';
26
+ function CustomTimeField(props) {
27
+ const { linkId, timeInput, periodInput, is24HourNotation, feedback, displayPrompt, readOnly, isTabled, onTimeInputChange, onPeriodChange } = props;
28
+ return (React.createElement(Tooltip, { title: isTabled ? feedback : '' },
29
+ React.createElement(React.Fragment, null,
30
+ React.createElement(Box, { display: "flex", alignItems: "center", columnGap: 1, sx: { maxWidth: !isTabled ? TEXT_FIELD_WIDTH : 3000, minWidth: 160 } },
31
+ React.createElement(MuiTextField, { id: linkId + '-time', value: timeInput, error: !!feedback, fullWidth: true, sx: { flex: 1 }, onChange: (e) => onTimeInputChange(e.target.value), label: displayPrompt, placeholder: "--:--", disabled: readOnly, size: "small" }),
32
+ React.createElement(Select, { id: linkId + '-period', value: is24HourNotation ? '' : periodInput, error: !!feedback, disabled: readOnly || is24HourNotation, displayEmpty: true, size: "small", sx: { flex: 1 }, onChange: (e) => onPeriodChange(e.target.value) },
33
+ React.createElement(MenuItem, { value: "" },
34
+ React.createElement("span", { style: { color: grey['500'] } }, is24HourNotation ? '-' : 'AM/PM')),
35
+ React.createElement(MenuItem, { value: "AM" }, "AM"),
36
+ React.createElement(MenuItem, { value: "PM" }, "PM"))),
37
+ React.createElement(Typography, { variant: "caption", color: "error", sx: { ml: 1.75, mt: -0.5 } }, isTabled ? '' : feedback))));
38
+ }
39
+ export default CustomTimeField;
40
+ //# sourceMappingURL=CustomTimeField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomTimeField.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoBH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAclD,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EACJ,MAAM,EACN,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,oBAAC,OAAO,IAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;QACtC;YACE,oBAAC,GAAG,IACF,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,SAAS,EAAE,CAAC,EACZ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE;gB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Q,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CACd,CACZ,CACK,CACX,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,22 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import type { PropsWithIsTabledAttribute } from '../../../../interfaces/renderProps.interface';
3
+ interface DateTimeFieldProps extends PropsWithIsTabledAttribute {
4
+ linkId: string;
5
+ displayDate: string;
6
+ dateInput: string;
7
+ timeInput: string;
8
+ periodInput: string;
9
+ is24HourNotation: boolean;
10
+ dateFeedback: string;
11
+ timeFeedback: string;
12
+ dateFocused: boolean;
13
+ displayPrompt: string;
14
+ entryFormat: string;
15
+ readOnly: boolean;
16
+ onDateInputChange: (newDateInput: string) => void;
17
+ onSelectDate: (selectedDate: string) => void;
18
+ setDateFocused: Dispatch<SetStateAction<boolean>>;
19
+ onTimeInputChange: (newTimeInput: string, newPeriodInput: string) => void;
20
+ }
21
+ declare function DateTimeField(props: DateTimeFieldProps): React.JSX.Element;
22
+ export default DateTimeField;
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright 2024 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 CustomDateField from '../CustomDateItem/CustomDateField';
19
+ import CustomTimeField from './CustomTimeField';
20
+ import Stack from '@mui/material/Stack';
21
+ function DateTimeField(props) {
22
+ const { linkId, displayDate, dateInput, timeInput, periodInput, is24HourNotation, dateFeedback, timeFeedback, dateFocused, displayPrompt, entryFormat, readOnly, isTabled, onDateInputChange, onSelectDate, setDateFocused, onTimeInputChange } = props;
23
+ return (React.createElement(Stack, { rowGap: 1 },
24
+ React.createElement(CustomDateField, { linkId: linkId, valueDate: displayDate, input: dateInput, feedback: dateFeedback !== null && dateFeedback !== void 0 ? dateFeedback : '', isFocused: dateFocused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, setFocused: setDateFocused, onInputChange: onDateInputChange, onSelectDate: onSelectDate }),
25
+ React.createElement(CustomTimeField, { linkId: linkId, timeInput: timeInput, periodInput: periodInput, is24HourNotation: is24HourNotation, feedback: timeFeedback !== null && timeFeedback !== void 0 ? timeFeedback : '', displayPrompt: displayPrompt, readOnly: readOnly, isTabled: isTabled, onTimeInputChange: (newTimeInput) => onTimeInputChange(newTimeInput, periodInput), onPeriodChange: (newPeriodInput) => onTimeInputChange(timeInput, newPeriodInput) })));
26
+ }
27
+ export default DateTimeField;
28
+ //# sourceMappingURL=DateTimeField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimeField.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAmC,MAAM,OAAO,CAAC;AAExD,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAChE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAqBxC,SAAS,aAAa,CAAC,KAAyB;IAC9C,MAAM,EACJ,MAAM,EACN,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,iBAAiB,EAClB,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,oBAAC,KAAK,IAAC,MAAM,EAAE,CAAC;QACd,oBAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,EAC5B,SAAS,EAAE,WAAW,EACtB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,cAAc,EAC1B,aAAa,EAAE,iBAAiB,EAChC,YAAY,EAAE,YAAY,GAC1B;QACF,oBAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,EACjF,cAAc,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,cAAc,CAAC,GAChF,CACI,CACT,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Commonwealth Scientific and Industrial Research
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
3
  * Organisation (CSIRO) ABN 41 687 119 230.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DateTimeItems/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ export { parseFhirDateToDisplayDate } from './parseDate';