@aehrc/smart-forms-renderer 0.19.0 → 0.21.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 (514) 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.js +1 -1
  11. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +1 -1
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.js +1 -1
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +1 -1
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +1 -1
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +1 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +1 -1
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +1 -1
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +1 -1
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +1 -1
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +1 -1
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +1 -1
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +1 -1
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.js +1 -1
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +1 -1
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +1 -1
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +1 -1
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +1 -1
  28. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js +1 -1
  29. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +1 -1
  30. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.js +1 -1
  31. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.js.map +1 -0
  32. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.d.ts +1 -1
  33. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.js +13 -13
  34. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js.map +1 -0
  35. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.js +1 -2
  36. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePicker.js.map +1 -0
  37. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePickerButton.js +29 -0
  38. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/DatePickerButton.js.map +1 -0
  39. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.js +1 -1
  40. package/lib/components/FormComponents/DateTimeItems/CustomDateItem/MuiDatePicker.js.map +1 -0
  41. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.d.ts +9 -0
  42. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js +116 -0
  43. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map +1 -0
  44. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.d.ts +15 -0
  45. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js +40 -0
  46. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js.map +1 -0
  47. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.d.ts +22 -0
  48. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js +28 -0
  49. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js.map +1 -0
  50. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.js +1 -1
  51. package/lib/components/FormComponents/DateTimeItems/index.js.map +1 -0
  52. package/lib/components/FormComponents/DateTimeItems/utils/index.d.ts +1 -0
  53. package/lib/components/FormComponents/{CustomDateItem → DateTimeItems/utils}/index.js +2 -2
  54. package/lib/components/FormComponents/DateTimeItems/utils/index.js.map +1 -0
  55. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.d.ts → DateTimeItems/utils/parseDate.d.ts} +2 -2
  56. package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.js → DateTimeItems/utils/parseDate.js} +10 -10
  57. package/lib/components/FormComponents/DateTimeItems/utils/parseDate.js.map +1 -0
  58. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.d.ts +19 -0
  59. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.js +81 -0
  60. package/lib/components/FormComponents/DateTimeItems/utils/parseTime.js.map +1 -0
  61. package/lib/components/FormComponents/DecimalItem/DecimalField.js +1 -1
  62. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +1 -1
  63. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +1 -1
  64. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js +1 -1
  65. package/lib/components/FormComponents/DisplayItem/DisplayItem.js +1 -1
  66. package/lib/components/FormComponents/GridGroup/GridGroup.js +1 -1
  67. package/lib/components/FormComponents/GridGroup/GridRow.js +1 -1
  68. package/lib/components/FormComponents/GridGroup/GridTable.js +1 -1
  69. package/lib/components/FormComponents/GridGroup/index.js +1 -1
  70. package/lib/components/FormComponents/GroupItem/GroupHeading.js +1 -1
  71. package/lib/components/FormComponents/GroupItem/GroupItem.js +1 -1
  72. package/lib/components/FormComponents/GroupItem/GroupItem.styles.js +1 -1
  73. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +1 -1
  74. package/lib/components/FormComponents/GroupItem/NextTabButton.js +1 -1
  75. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js +1 -1
  76. package/lib/components/FormComponents/IntegerItem/IntegerField.js +1 -1
  77. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +1 -1
  78. package/lib/components/FormComponents/Item.styles.js +1 -1
  79. package/lib/components/FormComponents/ItemParts/CheckboxSingle.js +1 -1
  80. package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.js +1 -1
  81. package/lib/components/FormComponents/ItemParts/ContextDisplayItem.js +1 -1
  82. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +1 -1
  83. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +1 -1
  84. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +1 -1
  85. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +1 -1
  86. package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js +1 -1
  87. package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.js +1 -1
  88. package/lib/components/FormComponents/Lists.styles.js +1 -1
  89. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +1 -1
  90. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +1 -1
  91. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +1 -1
  92. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +1 -1
  93. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +1 -1
  94. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +1 -1
  95. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +1 -1
  96. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +1 -1
  97. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +1 -1
  98. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +1 -1
  99. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +1 -1
  100. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +1 -1
  101. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +1 -1
  102. package/lib/components/FormComponents/RepeatGroup/index.js +1 -1
  103. package/lib/components/FormComponents/RepeatItem/AddItemButton.js +1 -1
  104. package/lib/components/FormComponents/RepeatItem/RemoveItemButton.js +1 -1
  105. package/lib/components/FormComponents/RepeatItem/RepeatField.js +1 -1
  106. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +1 -1
  107. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js +1 -1
  108. package/lib/components/FormComponents/RepeatItem/index.js +1 -1
  109. package/lib/components/FormComponents/SingleItem/SingleItem.js +1 -1
  110. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +4 -4
  111. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  112. package/lib/components/FormComponents/SingleItem/index.js +1 -1
  113. package/lib/components/FormComponents/SliderItem/Slider.styles.js +1 -1
  114. package/lib/components/FormComponents/SliderItem/SliderDisplayValue.js +1 -1
  115. package/lib/components/FormComponents/SliderItem/SliderField.js +1 -1
  116. package/lib/components/FormComponents/SliderItem/SliderItem.js +1 -1
  117. package/lib/components/FormComponents/SliderItem/SliderLabels.js +1 -1
  118. package/lib/components/FormComponents/StringItem/StringField.js +1 -1
  119. package/lib/components/FormComponents/StringItem/StringItem.js +1 -1
  120. package/lib/components/FormComponents/Tables/AddRowButton.js +1 -1
  121. package/lib/components/FormComponents/Tables/GroupTable.js +1 -1
  122. package/lib/components/FormComponents/Tables/GroupTableBody.js +1 -1
  123. package/lib/components/FormComponents/Tables/GroupTableRow.js +1 -1
  124. package/lib/components/FormComponents/Tables/GroupTableRowCells.js +1 -1
  125. package/lib/components/FormComponents/Tables/GroupTableView.js +1 -1
  126. package/lib/components/FormComponents/Tables/RemoveRowButton.js +1 -1
  127. package/lib/components/FormComponents/Tables/SelectRowButton.js +1 -1
  128. package/lib/components/FormComponents/Tables/Table.styles.js +1 -1
  129. package/lib/components/FormComponents/Tables/index.js +1 -1
  130. package/lib/components/FormComponents/TextItem/MuiTextField.js +1 -1
  131. package/lib/components/FormComponents/TextItem/TextField.js +1 -1
  132. package/lib/components/FormComponents/TextItem/TextItem.js +1 -1
  133. package/lib/components/FormComponents/Textfield.styles.js +1 -1
  134. package/lib/components/FormComponents/TimeItem/TimeField.js +1 -1
  135. package/lib/components/FormComponents/TimeItem/TimeItem.js +1 -1
  136. package/lib/components/FormComponents/UrlItem/UrlField.js +1 -1
  137. package/lib/components/FormComponents/UrlItem/UrlItem.js +1 -1
  138. package/lib/components/FormComponents/index.d.ts +1 -1
  139. package/lib/components/FormComponents/index.js +2 -2
  140. package/lib/components/FormComponents/index.js.map +1 -1
  141. package/lib/components/Iconify/Iconify.js +1 -1
  142. package/lib/components/Lists.styles.js +1 -1
  143. package/lib/components/Renderer/BaseRenderer.js +1 -1
  144. package/lib/components/Renderer/FormBodyCollapsible.js +1 -1
  145. package/lib/components/Renderer/FormBodySingleCollapsible.js +1 -1
  146. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js +1 -1
  147. package/lib/components/Renderer/FormBodyTabbed.js +1 -1
  148. package/lib/components/Renderer/FormTitle.js +1 -1
  149. package/lib/components/Renderer/FormTopLevelItem.js +1 -1
  150. package/lib/components/Renderer/SmartFormsRenderer.js +1 -1
  151. package/lib/components/Renderer/index.js +1 -1
  152. package/lib/components/Tabs/CompleteTabButton.js +1 -1
  153. package/lib/components/Tabs/FormBodySingleTab.js +1 -1
  154. package/lib/components/Tabs/FormBodyTabList.js +1 -1
  155. package/lib/components/Tabs/FormBodyTabListWrapper.js +1 -1
  156. package/lib/components/Tabs/ShowCompletedTabsSection.js +1 -1
  157. package/lib/components/index.js +1 -1
  158. package/lib/hooks/useAttachmentUrlValidation.js +1 -1
  159. package/lib/hooks/useContextDisplayItems.js +1 -1
  160. package/lib/hooks/useDateTimeNonEmpty.d.ts +2 -0
  161. package/lib/{components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js → hooks/useDateTimeNonEmpty.js} +9 -3
  162. package/lib/hooks/useDateTimeNonEmpty.js.map +1 -0
  163. package/lib/hooks/useDateValidation.js +3 -3
  164. package/lib/hooks/useDateValidation.js.map +1 -1
  165. package/lib/hooks/useDebounce.js +1 -1
  166. package/lib/hooks/useDecimalCalculatedExpression.js +1 -1
  167. package/lib/hooks/useGroupTableRows.js +1 -1
  168. package/lib/hooks/useHidden.js +1 -1
  169. package/lib/hooks/useInitialiseGroupTable.js +1 -1
  170. package/lib/hooks/useInitialiseRenderer.js +1 -1
  171. package/lib/hooks/useInitialiseRepeatAnswers.js +1 -1
  172. package/lib/hooks/useInitialiseRepeatGroups.js +1 -1
  173. package/lib/hooks/useIntegerCalculatedExpression.js +1 -1
  174. package/lib/hooks/useNumberInput.js +1 -1
  175. package/lib/hooks/useQueryClient.js +1 -1
  176. package/lib/hooks/useReadOnly.js +1 -1
  177. package/lib/hooks/useRenderingExtensions.js +1 -1
  178. package/lib/hooks/useResponsive.js +1 -1
  179. package/lib/hooks/useSliderExtensions.js +1 -1
  180. package/lib/hooks/useStringCalculatedExpression.js +1 -1
  181. package/lib/hooks/useStringInput.js +1 -1
  182. package/lib/hooks/useTerminologyServerQuery.js +1 -1
  183. package/lib/hooks/useTimeValidation.d.ts +5 -0
  184. package/lib/hooks/useTimeValidation.js +54 -0
  185. package/lib/hooks/useTimeValidation.js.map +1 -0
  186. package/lib/hooks/useValidationFeedback.js +1 -1
  187. package/lib/hooks/useValueSetCodings.js +1 -1
  188. package/lib/interfaces/answerExpression.interface.js +1 -1
  189. package/lib/interfaces/choice.enum.js +1 -1
  190. package/lib/interfaces/enableWhen.interface.d.ts +11 -3
  191. package/lib/interfaces/enableWhen.interface.js +1 -1
  192. package/lib/interfaces/groupTable.interface.js +1 -1
  193. package/lib/interfaces/index.d.ts +1 -1
  194. package/lib/interfaces/populate.interface.js +1 -1
  195. package/lib/interfaces/questionnaireStore.interface.d.ts +2 -2
  196. package/lib/interfaces/questionnaireStore.interface.js +1 -1
  197. package/lib/interfaces/regex.interface.js +1 -1
  198. package/lib/interfaces/renderProps.interface.js +1 -1
  199. package/lib/interfaces/repeatGroup.interface.js +1 -1
  200. package/lib/interfaces/valueSet.interface.js +1 -1
  201. package/lib/interfaces/variables.interface.js +1 -1
  202. package/lib/stores/questionnaireResponseStore.js +1 -1
  203. package/lib/stores/questionnaireStore.d.ts +3 -3
  204. package/lib/stores/questionnaireStore.js +21 -6
  205. package/lib/stores/questionnaireStore.js.map +1 -1
  206. package/lib/stores/smartConfigStore.js +1 -1
  207. package/lib/stores/terminologyServerStore.js +1 -1
  208. package/lib/stories/MedicalHistoryTable.stories.js +1 -1
  209. package/lib/stories/SmartFormsRenderer.stories.js +1 -1
  210. package/lib/theme/customGlobalStyles.js +1 -1
  211. package/lib/theme/overrides/Accordion.js +1 -1
  212. package/lib/theme/overrides/Autocomplete.js +1 -1
  213. package/lib/theme/overrides/Button.js +1 -1
  214. package/lib/theme/overrides/Card.js +1 -1
  215. package/lib/theme/overrides/Input.js +1 -1
  216. package/lib/theme/overrides/Overrides.js +1 -1
  217. package/lib/theme/overrides/Paper.js +1 -1
  218. package/lib/theme/overrides/SpeedDial.js +1 -1
  219. package/lib/theme/overrides/Table.js +1 -1
  220. package/lib/theme/palette.js +1 -1
  221. package/lib/theme/shadows.js +1 -1
  222. package/lib/theme/typography.js +1 -1
  223. package/lib/utils/calculatedExpression.js +1 -1
  224. package/lib/utils/dayjsExtend.js +1 -1
  225. package/lib/utils/debounce.js +1 -1
  226. package/lib/utils/emptyResource.js +1 -1
  227. package/lib/utils/enableWhen.js +1 -1
  228. package/lib/utils/enableWhenExpression.d.ts +22 -5
  229. package/lib/utils/enableWhenExpression.js +98 -55
  230. package/lib/utils/enableWhenExpression.js.map +1 -1
  231. package/lib/utils/fhirpath.d.ts +3 -3
  232. package/lib/utils/fhirpath.js +1 -1
  233. package/lib/utils/formChanges.js +1 -1
  234. package/lib/utils/groupTable.js +1 -1
  235. package/lib/utils/index.js +1 -1
  236. package/lib/utils/initialise.d.ts +3 -3
  237. package/lib/utils/initialise.js +1 -1
  238. package/lib/utils/itemControl.js +1 -1
  239. package/lib/utils/mapItem.js +1 -1
  240. package/lib/utils/openChoice.js +1 -1
  241. package/lib/utils/parseInputs.js +1 -1
  242. package/lib/utils/populateContexts.js +1 -1
  243. package/lib/utils/qItem.d.ts +2 -2
  244. package/lib/utils/qItem.js +9 -9
  245. package/lib/utils/qItem.js.map +1 -1
  246. package/lib/utils/qrItem.js +1 -1
  247. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +1 -1
  248. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +2 -2
  249. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
  250. package/lib/utils/questionnaireStoreUtils/extractContainedValueSets.js +1 -1
  251. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.d.ts +5 -5
  252. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js +99 -35
  253. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +1 -1
  254. package/lib/utils/questionnaireStoreUtils/extractTabs.js +1 -1
  255. package/lib/utils/questionnaireStoreUtils/extractVariables.js +1 -1
  256. package/lib/utils/questionnaireStoreUtils/resolveValueSets.js +1 -1
  257. package/lib/utils/removeEmptyAnswers.d.ts +2 -2
  258. package/lib/utils/removeEmptyAnswers.js +1 -1
  259. package/lib/utils/removeEmptyAnswers.js.map +1 -1
  260. package/lib/utils/repopulateItems.d.ts +2 -2
  261. package/lib/utils/repopulateItems.js +1 -1
  262. package/lib/utils/slider.js +1 -1
  263. package/lib/utils/tabs.d.ts +6 -6
  264. package/lib/utils/tabs.js +4 -19
  265. package/lib/utils/tabs.js.map +1 -1
  266. package/lib/utils/validateQuestionnaire.d.ts +2 -2
  267. package/lib/utils/validateQuestionnaire.js +1 -8
  268. package/lib/utils/validateQuestionnaire.js.map +1 -1
  269. package/lib/utils/valueSet.js +1 -1
  270. package/package.json +3 -3
  271. package/src/api/smartClient.ts +1 -1
  272. package/src/components/Alert.styles.ts +1 -1
  273. package/src/components/Box.styles.ts +1 -1
  274. package/src/components/FormComponents/AttachmentItem/AttachmentField.tsx +1 -1
  275. package/src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx +1 -1
  276. package/src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.tsx +1 -1
  277. package/src/components/FormComponents/AttachmentItem/AttachmentItem.tsx +1 -1
  278. package/src/components/FormComponents/AttachmentItem/AttachmentUrlField.tsx +1 -1
  279. package/src/components/FormComponents/BooleanItem/BooleanField.tsx +1 -1
  280. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +1 -1
  281. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.tsx +1 -1
  282. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +1 -1
  283. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +1 -1
  284. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +1 -1
  285. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +1 -1
  286. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +1 -1
  287. package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +1 -1
  288. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +1 -1
  289. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +1 -1
  290. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +1 -1
  291. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +1 -1
  292. package/src/components/FormComponents/ChoiceItems/ChoiceRadioSingle.tsx +1 -1
  293. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +1 -1
  294. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +1 -1
  295. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +1 -1
  296. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +1 -1
  297. package/src/components/FormComponents/DateTimeItem/DateTimeField.tsx +1 -1
  298. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +1 -1
  299. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.tsx +1 -1
  300. package/src/components/FormComponents/{CustomDateItem → DateTimeItems/CustomDateItem}/CustomDateItem.tsx +15 -15
  301. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.tsx +1 -2
  302. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePickerButton.tsx +18 -1
  303. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.ts +1 -1
  304. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx +222 -0
  305. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.tsx +117 -0
  306. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.tsx +96 -0
  307. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.ts +1 -1
  308. package/src/components/FormComponents/{CustomDateItem → DateTimeItems/utils}/index.ts +2 -2
  309. package/src/components/FormComponents/{CustomDateItem/customDateTimePicker/utils/parseDates.ts → DateTimeItems/utils/parseDate.ts} +10 -10
  310. package/src/components/FormComponents/DateTimeItems/utils/parseTime.ts +127 -0
  311. package/src/components/FormComponents/DecimalItem/DecimalField.tsx +1 -1
  312. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +1 -1
  313. package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts +1 -1
  314. package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +1 -1
  315. package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +1 -1
  316. package/src/components/FormComponents/GridGroup/GridGroup.tsx +1 -1
  317. package/src/components/FormComponents/GridGroup/GridRow.tsx +1 -1
  318. package/src/components/FormComponents/GridGroup/GridTable.tsx +1 -1
  319. package/src/components/FormComponents/GridGroup/index.ts +1 -1
  320. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +1 -1
  321. package/src/components/FormComponents/GroupItem/GroupItem.styles.ts +1 -1
  322. package/src/components/FormComponents/GroupItem/GroupItem.tsx +1 -1
  323. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +1 -1
  324. package/src/components/FormComponents/GroupItem/NextTabButton.tsx +1 -1
  325. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx +1 -1
  326. package/src/components/FormComponents/IntegerItem/IntegerField.tsx +1 -1
  327. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +1 -1
  328. package/src/components/FormComponents/Item.styles.ts +1 -1
  329. package/src/components/FormComponents/ItemParts/CheckboxSingle.tsx +1 -1
  330. package/src/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.tsx +1 -1
  331. package/src/components/FormComponents/ItemParts/ContextDisplayItem.tsx +1 -1
  332. package/src/components/FormComponents/ItemParts/FadingCheckIcon.tsx +1 -1
  333. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +1 -1
  334. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +1 -1
  335. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +1 -1
  336. package/src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx +1 -1
  337. package/src/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.tsx +1 -1
  338. package/src/components/FormComponents/Lists.styles.ts +1 -1
  339. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +1 -1
  340. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +1 -1
  341. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +1 -1
  342. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +1 -1
  343. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +1 -1
  344. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +1 -1
  345. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +1 -1
  346. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +1 -1
  347. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +1 -1
  348. package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +1 -1
  349. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +1 -1
  350. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +1 -1
  351. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +1 -1
  352. package/src/components/FormComponents/RepeatGroup/index.ts +1 -1
  353. package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +1 -1
  354. package/src/components/FormComponents/RepeatItem/RemoveItemButton.tsx +1 -1
  355. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +1 -1
  356. package/src/components/FormComponents/RepeatItem/RepeatItem.styles.tsx +1 -1
  357. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +1 -1
  358. package/src/components/FormComponents/RepeatItem/index.ts +1 -1
  359. package/src/components/FormComponents/SingleItem/SingleItem.tsx +1 -1
  360. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +4 -4
  361. package/src/components/FormComponents/SingleItem/index.ts +1 -1
  362. package/src/components/FormComponents/SliderItem/Slider.styles.ts +1 -1
  363. package/src/components/FormComponents/SliderItem/SliderDisplayValue.tsx +1 -1
  364. package/src/components/FormComponents/SliderItem/SliderField.tsx +1 -1
  365. package/src/components/FormComponents/SliderItem/SliderItem.tsx +1 -1
  366. package/src/components/FormComponents/SliderItem/SliderLabels.tsx +1 -1
  367. package/src/components/FormComponents/StringItem/StringField.tsx +1 -1
  368. package/src/components/FormComponents/StringItem/StringItem.tsx +1 -1
  369. package/src/components/FormComponents/Tables/AddRowButton.tsx +1 -1
  370. package/src/components/FormComponents/Tables/GroupTable.tsx +1 -1
  371. package/src/components/FormComponents/Tables/GroupTableBody.tsx +1 -1
  372. package/src/components/FormComponents/Tables/GroupTableRow.tsx +1 -1
  373. package/src/components/FormComponents/Tables/GroupTableRowCells.tsx +1 -1
  374. package/src/components/FormComponents/Tables/GroupTableView.tsx +1 -1
  375. package/src/components/FormComponents/Tables/RemoveRowButton.tsx +1 -1
  376. package/src/components/FormComponents/Tables/SelectRowButton.tsx +1 -1
  377. package/src/components/FormComponents/Tables/Table.styles.tsx +1 -1
  378. package/src/components/FormComponents/Tables/index.ts +1 -1
  379. package/src/components/FormComponents/TextItem/MuiTextField.ts +1 -1
  380. package/src/components/FormComponents/TextItem/TextField.tsx +1 -1
  381. package/src/components/FormComponents/TextItem/TextItem.tsx +1 -1
  382. package/src/components/FormComponents/Textfield.styles.ts +1 -1
  383. package/src/components/FormComponents/TimeItem/TimeField.tsx +1 -1
  384. package/src/components/FormComponents/TimeItem/TimeItem.tsx +1 -1
  385. package/src/components/FormComponents/UrlItem/UrlField.tsx +1 -1
  386. package/src/components/FormComponents/UrlItem/UrlItem.tsx +1 -1
  387. package/src/components/FormComponents/index.ts +2 -2
  388. package/src/components/Iconify/Iconify.tsx +1 -1
  389. package/src/components/Lists.styles.ts +1 -1
  390. package/src/components/Renderer/BaseRenderer.tsx +1 -1
  391. package/src/components/Renderer/FormBodyCollapsible.tsx +1 -1
  392. package/src/components/Renderer/FormBodySingleCollapsible.tsx +1 -1
  393. package/src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx +1 -1
  394. package/src/components/Renderer/FormBodyTabbed.tsx +1 -1
  395. package/src/components/Renderer/FormTitle.tsx +1 -1
  396. package/src/components/Renderer/FormTopLevelItem.tsx +1 -1
  397. package/src/components/Renderer/SmartFormsRenderer.tsx +1 -1
  398. package/src/components/Renderer/index.ts +1 -1
  399. package/src/components/Tabs/CompleteTabButton.tsx +1 -1
  400. package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
  401. package/src/components/Tabs/FormBodyTabList.tsx +1 -1
  402. package/src/components/Tabs/FormBodyTabListWrapper.tsx +1 -1
  403. package/src/components/Tabs/ShowCompletedTabsSection.tsx +1 -1
  404. package/src/components/index.ts +1 -1
  405. package/src/hooks/useAttachmentUrlValidation.ts +1 -1
  406. package/src/hooks/useContextDisplayItems.ts +1 -1
  407. package/src/{components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.ts → hooks/useDateTimeNonEmpty.ts} +15 -2
  408. package/src/hooks/useDateValidation.tsx +3 -3
  409. package/src/hooks/useDebounce.ts +1 -1
  410. package/src/hooks/useDecimalCalculatedExpression.ts +1 -1
  411. package/src/hooks/useGroupTableRows.ts +1 -1
  412. package/src/hooks/useHidden.ts +1 -1
  413. package/src/hooks/useInitialiseGroupTable.ts +1 -1
  414. package/src/hooks/useInitialiseRenderer.ts +1 -1
  415. package/src/hooks/useInitialiseRepeatAnswers.ts +1 -1
  416. package/src/hooks/useInitialiseRepeatGroups.ts +1 -1
  417. package/src/hooks/useIntegerCalculatedExpression.ts +1 -1
  418. package/src/hooks/useNumberInput.ts +1 -1
  419. package/src/hooks/useQueryClient.ts +1 -1
  420. package/src/hooks/useReadOnly.ts +1 -1
  421. package/src/hooks/useRenderingExtensions.ts +1 -1
  422. package/src/hooks/useResponsive.ts +1 -1
  423. package/src/hooks/useSliderExtensions.ts +1 -1
  424. package/src/hooks/useStringCalculatedExpression.ts +1 -1
  425. package/src/hooks/useStringInput.ts +1 -1
  426. package/src/hooks/useTerminologyServerQuery.ts +1 -1
  427. package/src/hooks/useTimeValidation.tsx +70 -0
  428. package/src/hooks/useValidationFeedback.ts +1 -1
  429. package/src/hooks/useValueSetCodings.ts +1 -1
  430. package/src/interfaces/answerExpression.interface.ts +1 -1
  431. package/src/interfaces/choice.enum.ts +1 -1
  432. package/src/interfaces/enableWhen.interface.ts +14 -4
  433. package/src/interfaces/groupTable.interface.ts +1 -1
  434. package/src/interfaces/index.ts +4 -2
  435. package/src/interfaces/populate.interface.ts +1 -1
  436. package/src/interfaces/questionnaireStore.interface.ts +3 -3
  437. package/src/interfaces/regex.interface.ts +1 -1
  438. package/src/interfaces/renderProps.interface.ts +1 -1
  439. package/src/interfaces/repeatGroup.interface.ts +1 -1
  440. package/src/interfaces/tab.interface.ts +1 -1
  441. package/src/interfaces/valueSet.interface.ts +1 -1
  442. package/src/interfaces/variables.interface.ts +1 -1
  443. package/src/stores/questionnaireResponseStore.ts +1 -1
  444. package/src/stores/questionnaireStore.ts +24 -8
  445. package/src/stores/smartConfigStore.ts +1 -1
  446. package/src/stores/terminologyServerStore.ts +1 -1
  447. package/src/stories/MedicalHistoryTable.stories.tsx +1 -1
  448. package/src/stories/SmartFormsRenderer.stories.ts +1 -1
  449. package/src/theme/Theme.tsx +1 -1
  450. package/src/theme/customGlobalStyles.tsx +1 -1
  451. package/src/theme/overrides/Accordion.ts +1 -1
  452. package/src/theme/overrides/Autocomplete.ts +1 -1
  453. package/src/theme/overrides/Button.ts +1 -1
  454. package/src/theme/overrides/Card.ts +1 -1
  455. package/src/theme/overrides/Input.ts +1 -1
  456. package/src/theme/overrides/Overrides.ts +1 -1
  457. package/src/theme/overrides/Paper.ts +1 -1
  458. package/src/theme/overrides/SpeedDial.ts +1 -1
  459. package/src/theme/overrides/Table.ts +1 -1
  460. package/src/theme/palette.ts +1 -1
  461. package/src/theme/shadows.ts +1 -1
  462. package/src/theme/typography.ts +1 -1
  463. package/src/utils/calculatedExpression.ts +1 -1
  464. package/src/utils/choice.ts +1 -1
  465. package/src/utils/dayjsExtend.ts +1 -1
  466. package/src/utils/debounce.ts +1 -1
  467. package/src/utils/emptyResource.ts +1 -1
  468. package/src/utils/enableWhen.ts +1 -1
  469. package/src/utils/enableWhenExpression.ts +215 -79
  470. package/src/utils/fhirpath.ts +4 -4
  471. package/src/utils/formChanges.ts +1 -1
  472. package/src/utils/groupTable.ts +1 -1
  473. package/src/utils/index.ts +1 -1
  474. package/src/utils/initialise.ts +4 -4
  475. package/src/utils/itemControl.ts +1 -1
  476. package/src/utils/mapItem.ts +1 -1
  477. package/src/utils/openChoice.ts +1 -1
  478. package/src/utils/parseInputs.ts +1 -1
  479. package/src/utils/populateContexts.ts +1 -1
  480. package/src/utils/qItem.ts +12 -12
  481. package/src/utils/qrItem.ts +1 -1
  482. package/src/utils/questionnaireStoreUtils/addAdditionalVariables.ts +1 -1
  483. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +2 -2
  484. package/src/utils/questionnaireStoreUtils/extractContainedValueSets.ts +1 -1
  485. package/src/utils/questionnaireStoreUtils/extractOtherExtensions.ts +160 -40
  486. package/src/utils/questionnaireStoreUtils/extractTabs.ts +1 -1
  487. package/src/utils/questionnaireStoreUtils/extractVariables.ts +1 -1
  488. package/src/utils/questionnaireStoreUtils/resolveValueSets.ts +1 -1
  489. package/src/utils/removeEmptyAnswers.ts +5 -5
  490. package/src/utils/repopulateItems.ts +5 -5
  491. package/src/utils/slider.ts +1 -1
  492. package/src/utils/tabs.ts +10 -25
  493. package/src/utils/validateQuestionnaire.ts +4 -12
  494. package/src/utils/valueSet.ts +1 -1
  495. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +0 -1
  496. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.js.map +0 -1
  497. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.js.map +0 -1
  498. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js +0 -13
  499. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js.map +0 -1
  500. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.js.map +0 -1
  501. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.js.map +0 -1
  502. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.d.ts +0 -1
  503. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js.map +0 -1
  504. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.js.map +0 -1
  505. package/lib/components/FormComponents/CustomDateItem/index.d.ts +0 -1
  506. package/lib/components/FormComponents/CustomDateItem/index.js.map +0 -1
  507. package/lib/components/FormComponents/DateItem/DateField.d.ts +0 -12
  508. package/lib/components/FormComponents/DateItem/DateItem.d.ts +0 -9
  509. package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.d.ts +0 -7
  510. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/CustomDateField.d.ts +0 -0
  511. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePicker.d.ts +0 -0
  512. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/DatePickerButton.d.ts +0 -0
  513. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems/CustomDateItem}/MuiDatePicker.d.ts +0 -0
  514. /package/lib/components/FormComponents/{CustomDateItem/customDateTimePicker → DateTimeItems}/index.d.ts +0 -0
@@ -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");
@@ -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");
@@ -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");
@@ -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,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAgB5C,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ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pC,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,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S,EAAE,OAAO,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,iBAAiB,EAChC,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd,iBAAiB,iBACd,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,eAAe,IACd,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,EAC7B,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,iBAAiB,EAChC,YAAY,EAAE,gBAAgB,GAC9B,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,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");
@@ -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"],"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,EAAE,iBA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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":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