@medplum/react 2.0.24 → 2.0.25

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 (331) hide show
  1. package/dist/cjs/index.cjs +11 -7714
  2. package/dist/cjs/index.cjs.map +7 -1
  3. package/dist/esm/index.mjs +67 -92
  4. package/dist/esm/index.mjs.map +7 -1
  5. package/package.json +5 -8
  6. package/dist/cjs/index.min.cjs +0 -1
  7. package/dist/esm/AddressDisplay/AddressDisplay.mjs +0 -13
  8. package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +0 -1
  9. package/dist/esm/AddressInput/AddressInput.mjs +0 -57
  10. package/dist/esm/AddressInput/AddressInput.mjs.map +0 -1
  11. package/dist/esm/AnnotationInput/AnnotationInput.mjs +0 -28
  12. package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +0 -1
  13. package/dist/esm/AppShell/AppShell.mjs +0 -37
  14. package/dist/esm/AppShell/AppShell.mjs.map +0 -1
  15. package/dist/esm/AppShell/Header.mjs +0 -88
  16. package/dist/esm/AppShell/Header.mjs.map +0 -1
  17. package/dist/esm/AppShell/HeaderSearchInput.mjs +0 -230
  18. package/dist/esm/AppShell/HeaderSearchInput.mjs.map +0 -1
  19. package/dist/esm/AppShell/Navbar.mjs +0 -169
  20. package/dist/esm/AppShell/Navbar.mjs.map +0 -1
  21. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +0 -121
  22. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +0 -1
  23. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs +0 -10
  24. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +0 -1
  25. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs +0 -45
  26. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +0 -1
  27. package/dist/esm/AttachmentButton/AttachmentButton.mjs +0 -55
  28. package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +0 -1
  29. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +0 -21
  30. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +0 -1
  31. package/dist/esm/AttachmentInput/AttachmentInput.mjs +0 -27
  32. package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +0 -1
  33. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs +0 -49
  34. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +0 -1
  35. package/dist/esm/BackboneElementInput/BackboneElementInput.mjs +0 -52
  36. package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +0 -1
  37. package/dist/esm/BookmarkDialog/BookmarkDialog.mjs +0 -47
  38. package/dist/esm/BookmarkDialog/BookmarkDialog.mjs.map +0 -1
  39. package/dist/esm/CalendarInput/CalendarInput.mjs +0 -133
  40. package/dist/esm/CalendarInput/CalendarInput.mjs.map +0 -1
  41. package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs +0 -12
  42. package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +0 -1
  43. package/dist/esm/CodeInput/CodeInput.mjs +0 -24
  44. package/dist/esm/CodeInput/CodeInput.mjs.map +0 -1
  45. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs +0 -9
  46. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +0 -1
  47. package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +0 -36
  48. package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +0 -1
  49. package/dist/esm/CodingDisplay/CodingDisplay.mjs +0 -9
  50. package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +0 -1
  51. package/dist/esm/CodingInput/CodingInput.mjs +0 -32
  52. package/dist/esm/CodingInput/CodingInput.mjs.map +0 -1
  53. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs +0 -16
  54. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +0 -1
  55. package/dist/esm/ContactDetailInput/ContactDetailInput.mjs +0 -35
  56. package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +0 -1
  57. package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs +0 -29
  58. package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +0 -1
  59. package/dist/esm/ContactPointInput/ContactPointInput.mjs +0 -45
  60. package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +0 -1
  61. package/dist/esm/Container/Container.mjs +0 -19
  62. package/dist/esm/Container/Container.mjs.map +0 -1
  63. package/dist/esm/DateTimeInput/DateTimeInput.mjs +0 -71
  64. package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +0 -1
  65. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs +0 -16
  66. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +0 -1
  67. package/dist/esm/DescriptionList/DescriptionList.mjs +0 -35
  68. package/dist/esm/DescriptionList/DescriptionList.mjs.map +0 -1
  69. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs +0 -172
  70. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +0 -1
  71. package/dist/esm/Document/Document.mjs +0 -12
  72. package/dist/esm/Document/Document.mjs.map +0 -1
  73. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs +0 -32
  74. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +0 -1
  75. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs +0 -30
  76. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +0 -1
  77. package/dist/esm/ExtensionInput/ExtensionInput.mjs +0 -14
  78. package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +0 -1
  79. package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs +0 -23
  80. package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +0 -1
  81. package/dist/esm/FhirPathTable/FhirPathTable.mjs +0 -122
  82. package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +0 -1
  83. package/dist/esm/Form/Form.mjs +0 -15
  84. package/dist/esm/Form/Form.mjs.map +0 -1
  85. package/dist/esm/Form/FormUtils.mjs +0 -50
  86. package/dist/esm/Form/FormUtils.mjs.map +0 -1
  87. package/dist/esm/FormSection/FormSection.mjs +0 -10
  88. package/dist/esm/FormSection/FormSection.mjs.map +0 -1
  89. package/dist/esm/GoogleButton/GoogleButton.mjs +0 -49
  90. package/dist/esm/GoogleButton/GoogleButton.mjs.map +0 -1
  91. package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs +0 -13
  92. package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +0 -1
  93. package/dist/esm/HumanNameInput/HumanNameInput.mjs +0 -50
  94. package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +0 -1
  95. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +0 -11
  96. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +0 -1
  97. package/dist/esm/IdentifierInput/IdentifierInput.mjs +0 -18
  98. package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +0 -1
  99. package/dist/esm/Loading/Loading.mjs +0 -10
  100. package/dist/esm/Loading/Loading.mjs.map +0 -1
  101. package/dist/esm/Logo/Logo.mjs +0 -14
  102. package/dist/esm/Logo/Logo.mjs.map +0 -1
  103. package/dist/esm/MedplumLink/MedplumLink.mjs +0 -52
  104. package/dist/esm/MedplumLink/MedplumLink.mjs.map +0 -1
  105. package/dist/esm/MedplumProvider/MedplumProvider.mjs +0 -84
  106. package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +0 -1
  107. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +0 -9
  108. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +0 -1
  109. package/dist/esm/MoneyInput/MoneyInput.mjs +0 -53
  110. package/dist/esm/MoneyInput/MoneyInput.mjs.map +0 -1
  111. package/dist/esm/NoteDisplay/NoteDisplay.mjs +0 -18
  112. package/dist/esm/NoteDisplay/NoteDisplay.mjs.map +0 -1
  113. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs +0 -14
  114. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs.map +0 -1
  115. package/dist/esm/Panel/Panel.mjs +0 -34
  116. package/dist/esm/Panel/Panel.mjs.map +0 -1
  117. package/dist/esm/PatientTimeline/PatientTimeline.mjs +0 -38
  118. package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +0 -1
  119. package/dist/esm/PeriodInput/PeriodInput.mjs +0 -19
  120. package/dist/esm/PeriodInput/PeriodInput.mjs.map +0 -1
  121. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs +0 -258
  122. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +0 -1
  123. package/dist/esm/QuantityDisplay/QuantityDisplay.mjs +0 -9
  124. package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +0 -1
  125. package/dist/esm/QuantityInput/QuantityInput.mjs +0 -40
  126. package/dist/esm/QuantityInput/QuantityInput.mjs.map +0 -1
  127. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs +0 -288
  128. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +0 -1
  129. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs +0 -276
  130. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +0 -1
  131. package/dist/esm/RangeDisplay/RangeDisplay.mjs +0 -9
  132. package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +0 -1
  133. package/dist/esm/RangeInput/RangeInput.mjs +0 -31
  134. package/dist/esm/RangeInput/RangeInput.mjs.map +0 -1
  135. package/dist/esm/RatioDisplay/RatioDisplay.mjs +0 -16
  136. package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +0 -1
  137. package/dist/esm/RatioInput/RatioInput.mjs +0 -31
  138. package/dist/esm/RatioInput/RatioInput.mjs.map +0 -1
  139. package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs +0 -21
  140. package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +0 -1
  141. package/dist/esm/ReferenceInput/ReferenceInput.mjs +0 -45
  142. package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +0 -1
  143. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs +0 -286
  144. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +0 -1
  145. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs +0 -72
  146. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +0 -1
  147. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs +0 -13
  148. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +0 -1
  149. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs +0 -51
  150. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +0 -1
  151. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +0 -23
  152. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +0 -1
  153. package/dist/esm/ResourceBadge/ResourceBadge.mjs +0 -13
  154. package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +0 -1
  155. package/dist/esm/ResourceBlame/ResourceBlame.mjs +0 -113
  156. package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +0 -1
  157. package/dist/esm/ResourceDiff/ResourceDiff.mjs +0 -39
  158. package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +0 -1
  159. package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs +0 -80
  160. package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +0 -1
  161. package/dist/esm/ResourceForm/ResourceForm.mjs +0 -56
  162. package/dist/esm/ResourceForm/ResourceForm.mjs.map +0 -1
  163. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs +0 -50
  164. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +0 -1
  165. package/dist/esm/ResourceInput/ResourceInput.mjs +0 -70
  166. package/dist/esm/ResourceInput/ResourceInput.mjs.map +0 -1
  167. package/dist/esm/ResourceName/ResourceName.mjs +0 -25
  168. package/dist/esm/ResourceName/ResourceName.mjs.map +0 -1
  169. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs +0 -119
  170. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +0 -1
  171. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs +0 -171
  172. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +0 -1
  173. package/dist/esm/ResourceTable/ResourceTable.mjs +0 -25
  174. package/dist/esm/ResourceTable/ResourceTable.mjs.map +0 -1
  175. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs +0 -309
  176. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +0 -1
  177. package/dist/esm/Scheduler/Scheduler.mjs +0 -98
  178. package/dist/esm/Scheduler/Scheduler.mjs.map +0 -1
  179. package/dist/esm/SearchControl/SearchControl.mjs +0 -337
  180. package/dist/esm/SearchControl/SearchControl.mjs.map +0 -1
  181. package/dist/esm/SearchControl/SearchControlField.mjs +0 -95
  182. package/dist/esm/SearchControl/SearchControlField.mjs.map +0 -1
  183. package/dist/esm/SearchControl/SearchUtils.mjs +0 -497
  184. package/dist/esm/SearchControl/SearchUtils.mjs.map +0 -1
  185. package/dist/esm/SearchExportDialog/SearchExportDialog.mjs +0 -19
  186. package/dist/esm/SearchExportDialog/SearchExportDialog.mjs.map +0 -1
  187. package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs +0 -196
  188. package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +0 -1
  189. package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs +0 -97
  190. package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +0 -1
  191. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs +0 -22
  192. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +0 -1
  193. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs +0 -22
  194. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +0 -1
  195. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs +0 -57
  196. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +0 -1
  197. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs +0 -134
  198. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +0 -1
  199. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs +0 -36
  200. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +0 -1
  201. package/dist/esm/StatusBadge/StatusBadge.mjs +0 -63
  202. package/dist/esm/StatusBadge/StatusBadge.mjs.map +0 -1
  203. package/dist/esm/Timeline/Timeline.mjs +0 -40
  204. package/dist/esm/Timeline/Timeline.mjs.map +0 -1
  205. package/dist/esm/TimingInput/TimingInput.mjs +0 -76
  206. package/dist/esm/TimingInput/TimingInput.mjs.map +0 -1
  207. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +0 -58
  208. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +0 -1
  209. package/dist/esm/auth/AuthenticationForm.mjs +0 -89
  210. package/dist/esm/auth/AuthenticationForm.mjs.map +0 -1
  211. package/dist/esm/auth/ChooseProfileForm.mjs +0 -33
  212. package/dist/esm/auth/ChooseProfileForm.mjs.map +0 -1
  213. package/dist/esm/auth/ChooseScopeForm.mjs +0 -28
  214. package/dist/esm/auth/ChooseScopeForm.mjs.map +0 -1
  215. package/dist/esm/auth/MfaForm.mjs +0 -34
  216. package/dist/esm/auth/MfaForm.mjs.map +0 -1
  217. package/dist/esm/auth/NewProjectForm.mjs +0 -39
  218. package/dist/esm/auth/NewProjectForm.mjs.map +0 -1
  219. package/dist/esm/auth/NewUserForm.mjs +0 -84
  220. package/dist/esm/auth/NewUserForm.mjs.map +0 -1
  221. package/dist/esm/auth/RegisterForm.mjs +0 -39
  222. package/dist/esm/auth/RegisterForm.mjs.map +0 -1
  223. package/dist/esm/auth/SignInForm.mjs +0 -100
  224. package/dist/esm/auth/SignInForm.mjs.map +0 -1
  225. package/dist/esm/constants.mjs +0 -12
  226. package/dist/esm/constants.mjs.map +0 -1
  227. package/dist/esm/index.min.mjs +0 -1
  228. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +0 -70
  229. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs.map +0 -1
  230. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +0 -18
  231. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs.map +0 -1
  232. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs +0 -25
  233. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs.map +0 -1
  234. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs +0 -15
  235. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs.map +0 -1
  236. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs +0 -19
  237. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs.map +0 -1
  238. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs +0 -20
  239. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs.map +0 -1
  240. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs +0 -26
  241. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs.map +0 -1
  242. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs +0 -17
  243. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs.map +0 -1
  244. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs +0 -20
  245. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs.map +0 -1
  246. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs +0 -27
  247. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs.map +0 -1
  248. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs +0 -24
  249. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs.map +0 -1
  250. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +0 -13
  251. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs.map +0 -1
  252. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs +0 -20
  253. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs.map +0 -1
  254. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs +0 -13
  255. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs.map +0 -1
  256. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs +0 -14
  257. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs.map +0 -1
  258. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs +0 -15
  259. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs.map +0 -1
  260. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs +0 -21
  261. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs.map +0 -1
  262. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs +0 -20
  263. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs.map +0 -1
  264. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs +0 -20
  265. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs.map +0 -1
  266. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs +0 -15
  267. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs.map +0 -1
  268. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs +0 -27
  269. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs.map +0 -1
  270. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs +0 -14
  271. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs.map +0 -1
  272. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs +0 -15
  273. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs.map +0 -1
  274. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs +0 -22
  275. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs.map +0 -1
  276. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs +0 -22
  277. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs.map +0 -1
  278. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs +0 -19
  279. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs.map +0 -1
  280. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs +0 -30
  281. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs.map +0 -1
  282. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconLogout.mjs +0 -21
  283. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconLogout.mjs.map +0 -1
  284. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs +0 -13
  285. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs.map +0 -1
  286. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs +0 -13
  287. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs.map +0 -1
  288. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs +0 -21
  289. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs.map +0 -1
  290. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs +0 -21
  291. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs.map +0 -1
  292. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs +0 -22
  293. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs.map +0 -1
  294. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs +0 -14
  295. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs.map +0 -1
  296. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs +0 -14
  297. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs.map +0 -1
  298. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs +0 -20
  299. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs.map +0 -1
  300. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs +0 -17
  301. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs.map +0 -1
  302. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs +0 -17
  303. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs.map +0 -1
  304. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs +0 -19
  305. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs.map +0 -1
  306. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSwitchHorizontal.mjs +0 -20
  307. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSwitchHorizontal.mjs.map +0 -1
  308. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs +0 -23
  309. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs.map +0 -1
  310. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs +0 -20
  311. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs.map +0 -1
  312. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +0 -14
  313. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs.map +0 -1
  314. package/dist/esm/useResource/useResource.mjs +0 -68
  315. package/dist/esm/useResource/useResource.mjs.map +0 -1
  316. package/dist/esm/utils/blame.mjs +0 -72
  317. package/dist/esm/utils/blame.mjs.map +0 -1
  318. package/dist/esm/utils/date.mjs +0 -56
  319. package/dist/esm/utils/date.mjs.map +0 -1
  320. package/dist/esm/utils/diff.mjs +0 -118
  321. package/dist/esm/utils/diff.mjs.map +0 -1
  322. package/dist/esm/utils/dom.mjs +0 -34
  323. package/dist/esm/utils/dom.mjs.map +0 -1
  324. package/dist/esm/utils/outcomes.mjs +0 -30
  325. package/dist/esm/utils/outcomes.mjs.map +0 -1
  326. package/dist/esm/utils/questionnaire.mjs +0 -26
  327. package/dist/esm/utils/questionnaire.mjs.map +0 -1
  328. package/dist/esm/utils/recaptcha.mjs +0 -32
  329. package/dist/esm/utils/recaptcha.mjs.map +0 -1
  330. package/dist/esm/utils/script.mjs +0 -16
  331. package/dist/esm/utils/script.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Panel.mjs","sources":["../../../src/Panel/Panel.tsx"],"sourcesContent":["import { createStyles, Paper, PaperProps, useComponentDefaultProps } from '@mantine/core';\nimport React from 'react';\n\nexport interface PanelStylesParams {\n width?: number;\n fill?: boolean;\n}\n\nconst useStyles = createStyles((theme, { width, fill }: PanelStylesParams) => ({\n paper: {\n maxWidth: width,\n margin: `${theme.spacing.xl} auto`,\n padding: fill ? 0 : theme.spacing.md,\n '@media (max-width: 800px)': {\n padding: fill ? 0 : 8,\n },\n '& img': {\n width: '100%',\n maxWidth: '100%',\n },\n '& video': {\n width: '100%',\n maxWidth: '100%',\n },\n },\n}));\n\nexport interface PanelProps extends PaperProps {\n width?: number;\n fill?: boolean;\n}\n\nconst defaultProps: Partial<PanelProps> = {\n shadow: 'xs',\n radius: 'md',\n withBorder: true,\n};\n\nexport function Panel(props: PanelProps): JSX.Element {\n const { className, children, width, fill, unstyled, ...others } = useComponentDefaultProps(\n 'Panel',\n defaultProps,\n props\n );\n const { classes, cx } = useStyles({ width, fill }, { name: 'Panel', unstyled });\n\n return (\n <Paper className={cx(classes.paper, className)} {...others}>\n {children}\n </Paper>\n );\n}\n"],"names":[],"mappings":";;;AAQA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAqB,MAAM;AAC7E,IAAA,KAAK,EAAE;AACL,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,MAAM,EAAE,CAAG,EAAA,KAAK,CAAC,OAAO,CAAC,EAAE,CAAO,KAAA,CAAA;AAClC,QAAA,OAAO,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE;AACpC,QAAA,2BAA2B,EAAE;YAC3B,OAAO,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC;AACtB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,QAAQ,EAAE,MAAM;AACjB,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,QAAQ,EAAE,MAAM;AACjB,SAAA;AACF,KAAA;AACF,CAAA,CAAC,CAAC,CAAC;AAOJ,MAAM,YAAY,GAAwB;AACxC,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,UAAU,EAAE,IAAI;CACjB,CAAC;AAEI,SAAU,KAAK,CAAC,KAAiB,EAAA;IACrC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,wBAAwB,CACxF,OAAO,EACP,YAAY,EACZ,KAAK,CACN,CAAC;IACF,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEhF,QACE,oBAAC,KAAK,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,EAAM,GAAA,MAAM,IACvD,QAAQ,CACH,EACR;AACJ;;;;"}
@@ -1,38 +0,0 @@
1
- import { createReference } from '@medplum/core';
2
- import React, { useCallback } from 'react';
3
- import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.mjs';
4
-
5
- function PatientTimeline(props) {
6
- const loadTimelineResources = useCallback((medplum, resourceType, id) => {
7
- const ref = `${resourceType}/${id}`;
8
- const _count = 100;
9
- return Promise.allSettled([
10
- medplum.readHistory('Patient', id),
11
- medplum.search('Communication', { subject: ref, _count }),
12
- medplum.search('Device', { patient: ref, _count }),
13
- medplum.search('DeviceRequest', { patient: ref, _count }),
14
- medplum.search('DiagnosticReport', { subject: ref, _count }),
15
- medplum.search('Media', { subject: ref, _count }),
16
- medplum.search('ServiceRequest', { subject: ref, _count }),
17
- medplum.search('Task', { subject: ref, _count }),
18
- ]);
19
- }, []);
20
- return (React.createElement(ResourceTimeline, { value: props.patient, loadTimelineResources: loadTimelineResources, createCommunication: (resource, sender, text) => ({
21
- resourceType: 'Communication',
22
- status: 'completed',
23
- subject: createReference(resource),
24
- sender: createReference(sender),
25
- sent: new Date().toISOString(),
26
- payload: [{ contentString: text }],
27
- }), createMedia: (resource, operator, content) => ({
28
- resourceType: 'Media',
29
- status: 'completed',
30
- subject: createReference(resource),
31
- operator: createReference(operator),
32
- issued: new Date().toISOString(),
33
- content,
34
- }) }));
35
- }
36
-
37
- export { PatientTimeline };
38
- //# sourceMappingURL=PatientTimeline.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PatientTimeline.mjs","sources":["../../../src/PatientTimeline/PatientTimeline.tsx"],"sourcesContent":["import { createReference, MedplumClient, ProfileResource } from '@medplum/core';\nimport { Attachment, Patient, Reference, ResourceType } from '@medplum/fhirtypes';\nimport React, { useCallback } from 'react';\nimport { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline';\n\nexport interface PatientTimelineProps {\n patient: Patient | Reference<Patient>;\n}\n\nexport function PatientTimeline(props: PatientTimelineProps): JSX.Element {\n const loadTimelineResources = useCallback((medplum: MedplumClient, resourceType: ResourceType, id: string) => {\n const ref = `${resourceType}/${id}`;\n const _count = 100;\n return Promise.allSettled([\n medplum.readHistory('Patient', id),\n medplum.search('Communication', { subject: ref, _count }),\n medplum.search('Device', { patient: ref, _count }),\n medplum.search('DeviceRequest', { patient: ref, _count }),\n medplum.search('DiagnosticReport', { subject: ref, _count }),\n medplum.search('Media', { subject: ref, _count }),\n medplum.search('ServiceRequest', { subject: ref, _count }),\n medplum.search('Task', { subject: ref, _count }),\n ]);\n }, []);\n\n return (\n <ResourceTimeline\n value={props.patient}\n loadTimelineResources={loadTimelineResources}\n createCommunication={(resource: Patient, sender: ProfileResource, text: string) => ({\n resourceType: 'Communication',\n status: 'completed',\n subject: createReference(resource),\n sender: createReference(sender),\n sent: new Date().toISOString(),\n payload: [{ contentString: text }],\n })}\n createMedia={(resource: Patient, operator: ProfileResource, content: Attachment) => ({\n resourceType: 'Media',\n status: 'completed',\n subject: createReference(resource),\n operator: createReference(operator),\n issued: new Date().toISOString(),\n content,\n })}\n />\n );\n}\n"],"names":[],"mappings":";;;;AASM,SAAU,eAAe,CAAC,KAA2B,EAAA;IACzD,MAAM,qBAAqB,GAAG,WAAW,CAAC,CAAC,OAAsB,EAAE,YAA0B,EAAE,EAAU,KAAI;AAC3G,QAAA,MAAM,GAAG,GAAG,CAAA,EAAG,YAAY,CAAI,CAAA,EAAA,EAAE,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,GAAG,CAAC;QACnB,OAAO,OAAO,CAAC,UAAU,CAAC;AACxB,YAAA,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC;AAClC,YAAA,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzD,YAAA,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AAClD,YAAA,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzD,YAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AAC5D,YAAA,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACjD,YAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AAC1D,YAAA,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACjD,SAAA,CAAC,CAAC;KACJ,EAAE,EAAE,CAAC,CAAC;IAEP,QACE,KAAC,CAAA,aAAA,CAAA,gBAAgB,EACf,EAAA,KAAK,EAAE,KAAK,CAAC,OAAO,EACpB,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,EAAE,CAAC,QAAiB,EAAE,MAAuB,EAAE,IAAY,MAAM;AAClF,YAAA,YAAY,EAAE,eAAe;AAC7B,YAAA,MAAM,EAAE,WAAW;AACnB,YAAA,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC;AAClC,YAAA,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;AAC/B,YAAA,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC9B,YAAA,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACnC,SAAA,CAAC,EACF,WAAW,EAAE,CAAC,QAAiB,EAAE,QAAyB,EAAE,OAAmB,MAAM;AACnF,YAAA,YAAY,EAAE,OAAO;AACrB,YAAA,MAAM,EAAE,WAAW;AACnB,YAAA,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC;AAClC,YAAA,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC;AACnC,YAAA,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAChC,OAAO;SACR,CAAC,EAAA,CACF,EACF;AACJ;;;;"}
@@ -1,19 +0,0 @@
1
- import { Group } from '@mantine/core';
2
- import React, { useState } from 'react';
3
- import { DateTimeInput } from '../DateTimeInput/DateTimeInput.mjs';
4
-
5
- function PeriodInput(props) {
6
- const [value, setValue] = useState(props.defaultValue);
7
- function setValueWrapper(newValue) {
8
- setValue(newValue);
9
- if (props.onChange) {
10
- props.onChange(newValue);
11
- }
12
- }
13
- return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
14
- React.createElement(DateTimeInput, { name: props.name + '.start', placeholder: "Start", defaultValue: value?.start, onChange: (newValue) => setValueWrapper({ ...value, start: newValue }) }),
15
- React.createElement(DateTimeInput, { name: props.name + '.end', placeholder: "End", defaultValue: value?.end, onChange: (newValue) => setValueWrapper({ ...value, end: newValue }) })));
16
- }
17
-
18
- export { PeriodInput };
19
- //# sourceMappingURL=PeriodInput.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PeriodInput.mjs","sources":["../../../src/PeriodInput/PeriodInput.tsx"],"sourcesContent":["import { Group } from '@mantine/core';\nimport { Period } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { DateTimeInput } from '../DateTimeInput/DateTimeInput';\n\nexport interface PeriodInputProps {\n name: string;\n defaultValue?: Period;\n onChange?: (value: Period) => void;\n}\n\nexport function PeriodInput(props: PeriodInputProps): JSX.Element {\n const [value, setValue] = useState(props.defaultValue);\n\n function setValueWrapper(newValue: Period): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <DateTimeInput\n name={props.name + '.start'}\n placeholder=\"Start\"\n defaultValue={value?.start}\n onChange={(newValue) => setValueWrapper({ ...value, start: newValue })}\n />\n <DateTimeInput\n name={props.name + '.end'}\n placeholder=\"End\"\n defaultValue={value?.end}\n onChange={(newValue) => setValueWrapper({ ...value, end: newValue })}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;;AAWM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEvD,SAAS,eAAe,CAAC,QAAgB,EAAA;QACvC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;IAED,QACE,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAC,IAAI,EAAC,IAAI,EAAA,IAAA,EAAC,MAAM,EAAA,IAAA,EAAA;AAC7B,QAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EACZ,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,QAAQ,EAC3B,WAAW,EAAC,OAAO,EACnB,YAAY,EAAE,KAAK,EAAE,KAAK,EAC1B,QAAQ,EAAE,CAAC,QAAQ,KAAK,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EACtE,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EACZ,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,MAAM,EACzB,WAAW,EAAC,KAAK,EACjB,YAAY,EAAE,KAAK,EAAE,GAAG,EACxB,QAAQ,EAAE,CAAC,QAAQ,KAAK,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EACpE,CAAA,CACI,EACR;AACJ;;;;"}
@@ -1,258 +0,0 @@
1
- import { createStyles, TextInput, Button, Anchor, Stack, NativeSelect } from '@mantine/core';
2
- import { getReferenceString } from '@medplum/core';
3
- import React, { useState, useRef, useEffect } from 'react';
4
- import { Form } from '../Form/Form.mjs';
5
- import { FormSection } from '../FormSection/FormSection.mjs';
6
- import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
7
- import { ReferenceDisplay } from '../ReferenceDisplay/ReferenceDisplay.mjs';
8
- import { setPropertyValue } from '../ResourceForm/ResourceForm.mjs';
9
- import { ResourceInput } from '../ResourceInput/ResourceInput.mjs';
10
- import { ResourcePropertyDisplay, getValueAndType } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
11
- import { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput.mjs';
12
- import { useResource } from '../useResource/useResource.mjs';
13
- import { killEvent } from '../utils/dom.mjs';
14
-
15
- const useStyles = createStyles((theme) => ({
16
- section: {
17
- position: 'relative',
18
- margin: '4px 4px 8px 0',
19
- padding: '6px 12px 16px 6px',
20
- border: `1.5px solid ${theme.colors.gray[1]}`,
21
- borderRadius: theme.radius.sm,
22
- transition: 'all 0.1s',
23
- },
24
- hovering: {
25
- border: `1.5px solid ${theme.colors.blue[5]}`,
26
- },
27
- editing: {
28
- border: `1.5px solid ${theme.colors.gray[1]}`,
29
- borderLeft: `4px solid ${theme.colors.blue[5]}`,
30
- },
31
- bottomActions: {
32
- position: 'absolute',
33
- right: 4,
34
- bottom: 0,
35
- fontSize: theme.fontSizes.xs,
36
- '& a': {
37
- marginLeft: 8,
38
- },
39
- },
40
- }));
41
- function PlanDefinitionBuilder(props) {
42
- const medplum = useMedplum();
43
- const defaultValue = useResource(props.value);
44
- const [schema, setSchema] = useState(undefined);
45
- const [selectedKey, setSelectedKey] = useState();
46
- const [hoverKey, setHoverKey] = useState();
47
- const [value, setValue] = useState();
48
- function handleDocumentMouseOver() {
49
- setHoverKey(undefined);
50
- }
51
- function handleDocumentClick() {
52
- setSelectedKey(undefined);
53
- }
54
- const valueRef = useRef();
55
- valueRef.current = value;
56
- useEffect(() => {
57
- medplum.requestSchema('PlanDefinition').then(setSchema).catch(console.log);
58
- }, [medplum]);
59
- useEffect(() => {
60
- setValue(ensurePlanDefinitionKeys(defaultValue ?? { resourceType: 'PlanDefinition' }));
61
- document.addEventListener('mouseover', handleDocumentMouseOver);
62
- document.addEventListener('click', handleDocumentClick);
63
- return () => {
64
- document.removeEventListener('mouseover', handleDocumentMouseOver);
65
- document.removeEventListener('click', handleDocumentClick);
66
- };
67
- }, [defaultValue]);
68
- if (!schema || !value) {
69
- return null;
70
- }
71
- function changeProperty(property, newValue) {
72
- setValue({
73
- ...valueRef.current,
74
- [property]: newValue,
75
- });
76
- }
77
- return (React.createElement("div", null,
78
- React.createElement(Form, { testid: "questionnaire-form", onSubmit: () => props.onSubmit(value) },
79
- React.createElement(TextInput, { label: "Plan Title", defaultValue: value.title, onChange: (e) => changeProperty('title', e.currentTarget.value) }),
80
- React.createElement(ActionArrayBuilder, { actions: value.action || [], selectedKey: selectedKey, setSelectedKey: setSelectedKey, hoverKey: hoverKey, setHoverKey: setHoverKey, onChange: (x) => changeProperty('action', x) }),
81
- React.createElement(Button, { type: "submit" }, "Save"))));
82
- }
83
- function ActionArrayBuilder(props) {
84
- const { classes } = useStyles();
85
- const actionsRef = useRef();
86
- actionsRef.current = props.actions;
87
- function changeAction(changedAction) {
88
- props.onChange(actionsRef.current.map((i) => (i.id === changedAction.id ? changedAction : i)));
89
- }
90
- function addAction(addedAction) {
91
- props.onChange([...actionsRef.current, addedAction]);
92
- props.setSelectedKey(addedAction.id);
93
- }
94
- function removeAction(removedAction) {
95
- props.onChange(actionsRef.current.filter((i) => i !== removedAction));
96
- }
97
- return (React.createElement("div", { className: classes.section },
98
- props.actions.map((action) => (React.createElement("div", { key: action.id },
99
- React.createElement(ActionBuilder, { action: action, selectedKey: props.selectedKey, setSelectedKey: props.setSelectedKey, hoverKey: props.hoverKey, setHoverKey: props.setHoverKey, onChange: changeAction, onRemove: () => removeAction(action) })))),
100
- React.createElement("div", { className: classes.bottomActions },
101
- React.createElement(Anchor, { href: "#", onClick: (e) => {
102
- killEvent(e);
103
- addAction({ id: generateId() });
104
- } }, "Add action"))));
105
- }
106
- function ActionBuilder(props) {
107
- const { classes, cx } = useStyles();
108
- const { action } = props;
109
- const actionType = getInitialActionType(action);
110
- const editing = props.selectedKey === props.action.id;
111
- const hovering = props.hoverKey === props.action.id;
112
- function onClick(e) {
113
- e.stopPropagation();
114
- props.setSelectedKey(props.action.id);
115
- }
116
- function onHover(e) {
117
- killEvent(e);
118
- props.setHoverKey(props.action.id);
119
- }
120
- const className = cx(classes.section, {
121
- [classes.editing]: editing,
122
- [classes.hovering]: hovering && !editing,
123
- });
124
- return (React.createElement("div", { "data-testid": action.id, className: className, onClick: onClick, onMouseOver: onHover },
125
- editing ? (React.createElement(ActionEditor, { action: action, actionType: actionType, onChange: props.onChange, selectedKey: props.selectedKey, setSelectedKey: props.setSelectedKey, hoverKey: props.hoverKey, setHoverKey: props.setHoverKey, onRemove: props.onRemove })) : (React.createElement(ActionDisplay, { action: action, actionType: actionType })),
126
- React.createElement("div", { className: classes.bottomActions },
127
- React.createElement(Anchor, { href: "#", onClick: (e) => {
128
- e.preventDefault();
129
- props.onRemove();
130
- } }, "Remove"))));
131
- }
132
- const timingProperty = {
133
- path: 'PlanDefinition.action.timing[x]',
134
- min: 0,
135
- max: '1',
136
- type: [{ code: 'dateTime' }, { code: 'Period' }, { code: 'Range' }, { code: 'Timing' }],
137
- };
138
- function ActionDisplay(props) {
139
- const { action, actionType } = props;
140
- const [propertyValue, propertyType] = getActionTiming(action);
141
- return (React.createElement("div", null,
142
- React.createElement("div", null,
143
- action.title || 'Untitled',
144
- " ",
145
- actionType && `(${actionType})`),
146
- action.definitionCanonical && (React.createElement("div", null,
147
- React.createElement(ReferenceDisplay, { value: { reference: action.definitionCanonical } }))),
148
- propertyValue && (React.createElement("div", null,
149
- React.createElement(ResourcePropertyDisplay, { property: timingProperty, propertyType: propertyType, value: propertyValue })))));
150
- }
151
- function ActionEditor(props) {
152
- const { action } = props;
153
- const [actionType, setActionType] = useState(props.actionType);
154
- function changeProperty(property, value) {
155
- props.onChange({
156
- ...action,
157
- [property]: value,
158
- });
159
- }
160
- return (React.createElement(Stack, { spacing: "xl" },
161
- React.createElement(TextInput, { name: `actionTitle-${action.id}`, label: "Title", defaultValue: action.title, onChange: (e) => changeProperty('title', e.currentTarget.value) }),
162
- React.createElement(TextInput, { name: `actionDescription-${action.id}`, label: "Description", defaultValue: action.description, onChange: (e) => changeProperty('description', e.currentTarget.value) }),
163
- React.createElement(NativeSelect, { label: "Type of Action", description: "The type of the action to be performed.", name: `actionType-${action.id}`, defaultValue: actionType, onChange: (e) => setActionType(e.currentTarget.value), data: ['', 'appointment', 'lab', 'questionnaire', 'task'] }),
164
- action.action && action.action.length > 0 && (React.createElement(ActionArrayBuilder, { actions: action.action, selectedKey: props.selectedKey, setSelectedKey: props.setSelectedKey, hoverKey: props.hoverKey, setHoverKey: props.setHoverKey, onChange: (x) => changeProperty('action', x) })),
165
- (() => {
166
- switch (actionType) {
167
- case 'appointment':
168
- return (React.createElement(ActionResourceTypeBuilder, { title: "Appointment", description: "The subject must schedule an appointment from the schedule.", resourceType: "Schedule", action: action, onChange: props.onChange }));
169
- case 'lab':
170
- return (React.createElement(ActionResourceTypeBuilder, { title: "Lab", description: "The subject must complete the following lab panel.", resourceType: "ActivityDefinition", action: action, onChange: props.onChange }));
171
- case 'questionnaire':
172
- return (React.createElement(ActionResourceTypeBuilder, { title: "Questionnaire", description: "The subject must complete the selected questionnaire.", resourceType: "Questionnaire", action: action, onChange: props.onChange }));
173
- case 'task':
174
- return (React.createElement(ActionResourceTypeBuilder, { title: "Task", description: "The subject must complete the following task.", resourceType: "ActivityDefinition", action: action, onChange: props.onChange }));
175
- default:
176
- return null;
177
- }
178
- })(),
179
- React.createElement(FormSection, { title: "Timing", description: "When the action should take place." },
180
- React.createElement(ActionTimingInput, { name: 'timing-' + action.id, action: action, onChange: props.onChange }))));
181
- }
182
- function ActionResourceTypeBuilder(props) {
183
- const { id, definitionCanonical } = props.action;
184
- const reference = definitionCanonical?.startsWith(props.resourceType + '/')
185
- ? { reference: definitionCanonical }
186
- : undefined;
187
- return (React.createElement(ResourceInput, { name: id, resourceType: props.resourceType, defaultValue: reference, loadOnFocus: true, onChange: (newValue) => {
188
- if (newValue) {
189
- props.onChange({ ...props.action, definitionCanonical: getReferenceString(newValue) });
190
- }
191
- else {
192
- props.onChange({ ...props.action, definitionCanonical: undefined });
193
- }
194
- } }));
195
- }
196
- function ActionTimingInput(props) {
197
- const value = props.action;
198
- const key = 'timing';
199
- const [propertyValue, propertyType] = getActionTiming(value);
200
- return (React.createElement(ResourcePropertyInput, { property: timingProperty, name: "timing[x]", defaultValue: propertyValue, defaultPropertyType: propertyType, onChange: (newValue, propName) => {
201
- props.onChange(setPropertyValue(value, key, propName ?? key, timingProperty, newValue));
202
- } }));
203
- }
204
- function getInitialActionType(action) {
205
- if (action.definitionCanonical?.startsWith('Schedule')) {
206
- return 'appointment';
207
- }
208
- if (action.definitionCanonical?.startsWith('Questionnaire/')) {
209
- return 'questionnaire';
210
- }
211
- if (action.definitionCanonical?.startsWith('ActivityDefinition/')) {
212
- return 'task';
213
- }
214
- return undefined;
215
- }
216
- function getActionTiming(action) {
217
- return getValueAndType({ type: 'PlanDefinitionAction', value: action }, 'timing');
218
- }
219
- let nextId = 1;
220
- /**
221
- * Generates a unique ID.
222
- * React needs unique IDs for components for rendering performance.
223
- * All of the important components in the questionnaire builder have id properties for this:
224
- * Questionnaire, QuestionnaireItem, and QuestionnaireItemAnswerOption.
225
- * @param existing Optional existing id which will update nextId.
226
- * @returns A unique key.
227
- */
228
- function generateId(existing) {
229
- if (existing) {
230
- if (existing.startsWith('id-')) {
231
- const existingNum = parseInt(existing.substring(3), 10);
232
- if (!isNaN(existingNum)) {
233
- nextId = Math.max(nextId, existingNum + 1);
234
- }
235
- }
236
- return existing;
237
- }
238
- return 'id-' + nextId++;
239
- }
240
- function ensurePlanDefinitionKeys(planDefinition) {
241
- return {
242
- ...planDefinition,
243
- action: ensurePlanDefinitionActionKeys(planDefinition.action),
244
- };
245
- }
246
- function ensurePlanDefinitionActionKeys(actions) {
247
- if (!actions) {
248
- return undefined;
249
- }
250
- return actions.map((action) => ({
251
- ...action,
252
- id: generateId(action.id),
253
- action: ensurePlanDefinitionActionKeys(action.action),
254
- }));
255
- }
256
-
257
- export { PlanDefinitionBuilder };
258
- //# sourceMappingURL=PlanDefinitionBuilder.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlanDefinitionBuilder.mjs","sources":["../../../src/PlanDefinitionBuilder/PlanDefinitionBuilder.tsx"],"sourcesContent":["import { Anchor, Button, createStyles, NativeSelect, Stack, TextInput } from '@mantine/core';\nimport { getReferenceString, IndexedStructureDefinition, PropertyType } from '@medplum/core';\nimport { ElementDefinition, PlanDefinition, PlanDefinitionAction, Reference, ResourceType } from '@medplum/fhirtypes';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { FormSection } from '../FormSection/FormSection';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { ReferenceDisplay } from '../ReferenceDisplay/ReferenceDisplay';\nimport { setPropertyValue } from '../ResourceForm/ResourceForm';\nimport { ResourceInput } from '../ResourceInput/ResourceInput';\nimport { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay';\nimport { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput';\nimport { useResource } from '../useResource/useResource';\nimport { killEvent } from '../utils/dom';\n\nconst useStyles = createStyles((theme) => ({\n section: {\n position: 'relative',\n margin: '4px 4px 8px 0',\n padding: '6px 12px 16px 6px',\n border: `1.5px solid ${theme.colors.gray[1]}`,\n borderRadius: theme.radius.sm,\n transition: 'all 0.1s',\n },\n\n hovering: {\n border: `1.5px solid ${theme.colors.blue[5]}`,\n },\n\n editing: {\n border: `1.5px solid ${theme.colors.gray[1]}`,\n borderLeft: `4px solid ${theme.colors.blue[5]}`,\n },\n\n bottomActions: {\n position: 'absolute',\n right: 4,\n bottom: 0,\n fontSize: theme.fontSizes.xs,\n\n '& a': {\n marginLeft: 8,\n },\n },\n}));\n\nexport interface PlanDefinitionBuilderProps {\n value: PlanDefinition | Reference<PlanDefinition>;\n onSubmit: (result: PlanDefinition) => void;\n}\n\nexport function PlanDefinitionBuilder(props: PlanDefinitionBuilderProps): JSX.Element | null {\n const medplum = useMedplum();\n const defaultValue = useResource(props.value);\n const [schema, setSchema] = useState<IndexedStructureDefinition | undefined>(undefined);\n const [selectedKey, setSelectedKey] = useState<string>();\n const [hoverKey, setHoverKey] = useState<string>();\n const [value, setValue] = useState<PlanDefinition>();\n\n function handleDocumentMouseOver(): void {\n setHoverKey(undefined);\n }\n\n function handleDocumentClick(): void {\n setSelectedKey(undefined);\n }\n\n const valueRef = useRef<PlanDefinition>();\n valueRef.current = value;\n\n useEffect(() => {\n medplum.requestSchema('PlanDefinition').then(setSchema).catch(console.log);\n }, [medplum]);\n\n useEffect(() => {\n setValue(ensurePlanDefinitionKeys(defaultValue ?? { resourceType: 'PlanDefinition' }));\n document.addEventListener('mouseover', handleDocumentMouseOver);\n document.addEventListener('click', handleDocumentClick);\n return () => {\n document.removeEventListener('mouseover', handleDocumentMouseOver);\n document.removeEventListener('click', handleDocumentClick);\n };\n }, [defaultValue]);\n\n if (!schema || !value) {\n return null;\n }\n\n function changeProperty(property: string, newValue: any): void {\n setValue({\n ...valueRef.current,\n [property]: newValue,\n } as PlanDefinition);\n }\n\n return (\n <div>\n <Form testid=\"questionnaire-form\" onSubmit={() => props.onSubmit(value)}>\n <TextInput\n label=\"Plan Title\"\n defaultValue={value.title}\n onChange={(e) => changeProperty('title', e.currentTarget.value)}\n />\n <ActionArrayBuilder\n actions={value.action || []}\n selectedKey={selectedKey}\n setSelectedKey={setSelectedKey}\n hoverKey={hoverKey}\n setHoverKey={setHoverKey}\n onChange={(x) => changeProperty('action', x)}\n />\n <Button type=\"submit\">Save</Button>\n </Form>\n </div>\n );\n}\n\ninterface ActionArrayBuilderProps {\n actions: PlanDefinitionAction[];\n selectedKey: string | undefined;\n setSelectedKey: (key: string | undefined) => void;\n hoverKey: string | undefined;\n setHoverKey: (key: string | undefined) => void;\n onChange: (actions: PlanDefinitionAction[]) => void;\n}\n\nfunction ActionArrayBuilder(props: ActionArrayBuilderProps): JSX.Element {\n const { classes } = useStyles();\n const actionsRef = useRef<PlanDefinitionAction[]>();\n actionsRef.current = props.actions;\n\n function changeAction(changedAction: PlanDefinitionAction): void {\n props.onChange(\n (actionsRef.current as PlanDefinition[]).map((i) => (i.id === changedAction.id ? changedAction : i))\n );\n }\n\n function addAction(addedAction: PlanDefinitionAction): void {\n props.onChange([...(actionsRef.current as PlanDefinition[]), addedAction]);\n props.setSelectedKey(addedAction.id);\n }\n\n function removeAction(removedAction: PlanDefinitionAction): void {\n props.onChange((actionsRef.current as PlanDefinition[]).filter((i) => i !== removedAction));\n }\n\n return (\n <div className={classes.section}>\n {props.actions.map((action) => (\n <div key={action.id}>\n <ActionBuilder\n action={action}\n selectedKey={props.selectedKey}\n setSelectedKey={props.setSelectedKey}\n hoverKey={props.hoverKey}\n setHoverKey={props.setHoverKey}\n onChange={changeAction}\n onRemove={() => removeAction(action)}\n />\n </div>\n ))}\n <div className={classes.bottomActions}>\n <Anchor\n href=\"#\"\n onClick={(e: React.MouseEvent) => {\n killEvent(e);\n addAction({ id: generateId() });\n }}\n >\n Add action\n </Anchor>\n </div>\n </div>\n );\n}\n\ninterface ActionBuilderProps {\n action: PlanDefinitionAction;\n selectedKey: string | undefined;\n setSelectedKey: (key: string | undefined) => void;\n hoverKey: string | undefined;\n setHoverKey: (key: string | undefined) => void;\n onChange: (action: PlanDefinitionAction) => void;\n onRemove: () => void;\n}\n\nfunction ActionBuilder(props: ActionBuilderProps): JSX.Element {\n const { classes, cx } = useStyles();\n const { action } = props;\n const actionType = getInitialActionType(action);\n const editing = props.selectedKey === props.action.id;\n const hovering = props.hoverKey === props.action.id;\n\n function onClick(e: React.SyntheticEvent): void {\n e.stopPropagation();\n props.setSelectedKey(props.action.id);\n }\n\n function onHover(e: React.SyntheticEvent): void {\n killEvent(e);\n props.setHoverKey(props.action.id);\n }\n\n const className = cx(classes.section, {\n [classes.editing]: editing,\n [classes.hovering]: hovering && !editing,\n });\n\n return (\n <div data-testid={action.id} className={className} onClick={onClick} onMouseOver={onHover}>\n {editing ? (\n <ActionEditor\n action={action}\n actionType={actionType}\n onChange={props.onChange}\n selectedKey={props.selectedKey}\n setSelectedKey={props.setSelectedKey}\n hoverKey={props.hoverKey}\n setHoverKey={props.setHoverKey}\n onRemove={props.onRemove}\n />\n ) : (\n <ActionDisplay action={action} actionType={actionType} />\n )}\n <div className={classes.bottomActions}>\n <Anchor\n href=\"#\"\n onClick={(e: React.MouseEvent) => {\n e.preventDefault();\n props.onRemove();\n }}\n >\n Remove\n </Anchor>\n </div>\n </div>\n );\n}\n\nconst timingProperty: ElementDefinition = {\n path: 'PlanDefinition.action.timing[x]',\n min: 0,\n max: '1',\n type: [{ code: 'dateTime' }, { code: 'Period' }, { code: 'Range' }, { code: 'Timing' }],\n};\n\ninterface ActionDisplayProps {\n action: PlanDefinitionAction;\n actionType: string | undefined;\n}\n\nfunction ActionDisplay(props: ActionDisplayProps): JSX.Element {\n const { action, actionType } = props;\n const [propertyValue, propertyType] = getActionTiming(action);\n return (\n <div>\n <div>\n {action.title || 'Untitled'} {actionType && `(${actionType})`}\n </div>\n {action.definitionCanonical && (\n <div>\n <ReferenceDisplay value={{ reference: action.definitionCanonical }} />\n </div>\n )}\n {propertyValue && (\n <div>\n <ResourcePropertyDisplay property={timingProperty} propertyType={propertyType} value={propertyValue} />\n </div>\n )}\n </div>\n );\n}\n\ninterface ActionEditorProps {\n action: PlanDefinitionAction;\n actionType: string | undefined;\n selectedKey: string | undefined;\n setSelectedKey: (key: string | undefined) => void;\n hoverKey: string | undefined;\n setHoverKey: (key: string | undefined) => void;\n onChange: (action: PlanDefinitionAction) => void;\n onRemove: () => void;\n}\n\nfunction ActionEditor(props: ActionEditorProps): JSX.Element {\n const { action } = props;\n const [actionType, setActionType] = useState<string | undefined>(props.actionType);\n\n function changeProperty(property: string, value: any): void {\n props.onChange({\n ...action,\n [property]: value,\n } as PlanDefinitionAction);\n }\n\n return (\n <Stack spacing=\"xl\">\n <TextInput\n name={`actionTitle-${action.id}`}\n label=\"Title\"\n defaultValue={action.title}\n onChange={(e) => changeProperty('title', e.currentTarget.value)}\n />\n <TextInput\n name={`actionDescription-${action.id}`}\n label=\"Description\"\n defaultValue={action.description}\n onChange={(e) => changeProperty('description', e.currentTarget.value)}\n />\n <NativeSelect\n label=\"Type of Action\"\n description=\"The type of the action to be performed.\"\n name={`actionType-${action.id}`}\n defaultValue={actionType}\n onChange={(e) => setActionType(e.currentTarget.value)}\n data={['', 'appointment', 'lab', 'questionnaire', 'task']}\n />\n {action.action && action.action.length > 0 && (\n <ActionArrayBuilder\n actions={action.action}\n selectedKey={props.selectedKey}\n setSelectedKey={props.setSelectedKey}\n hoverKey={props.hoverKey}\n setHoverKey={props.setHoverKey}\n onChange={(x) => changeProperty('action', x)}\n />\n )}\n {(() => {\n switch (actionType) {\n case 'appointment':\n return (\n <ActionResourceTypeBuilder\n title=\"Appointment\"\n description=\"The subject must schedule an appointment from the schedule.\"\n resourceType=\"Schedule\"\n action={action}\n onChange={props.onChange}\n />\n );\n case 'lab':\n return (\n <ActionResourceTypeBuilder\n title=\"Lab\"\n description=\"The subject must complete the following lab panel.\"\n resourceType=\"ActivityDefinition\"\n action={action}\n onChange={props.onChange}\n />\n );\n case 'questionnaire':\n return (\n <ActionResourceTypeBuilder\n title=\"Questionnaire\"\n description=\"The subject must complete the selected questionnaire.\"\n resourceType=\"Questionnaire\"\n action={action}\n onChange={props.onChange}\n />\n );\n case 'task':\n return (\n <ActionResourceTypeBuilder\n title=\"Task\"\n description=\"The subject must complete the following task.\"\n resourceType=\"ActivityDefinition\"\n action={action}\n onChange={props.onChange}\n />\n );\n default:\n return null;\n }\n })()}\n <FormSection title=\"Timing\" description=\"When the action should take place.\">\n <ActionTimingInput name={'timing-' + action.id} action={action} onChange={props.onChange} />\n </FormSection>\n </Stack>\n );\n}\n\ninterface ActionResourceTypeBuilderProps {\n action: PlanDefinitionAction;\n title: string;\n description: string;\n resourceType: ResourceType;\n onChange: (action: PlanDefinitionAction) => void;\n}\n\nfunction ActionResourceTypeBuilder(props: ActionResourceTypeBuilderProps): JSX.Element {\n const { id, definitionCanonical } = props.action;\n const reference = definitionCanonical?.startsWith(props.resourceType + '/')\n ? { reference: definitionCanonical }\n : undefined;\n return (\n <ResourceInput\n name={id as string}\n resourceType={props.resourceType}\n defaultValue={reference}\n loadOnFocus={true}\n onChange={(newValue) => {\n if (newValue) {\n props.onChange({ ...props.action, definitionCanonical: getReferenceString(newValue) });\n } else {\n props.onChange({ ...props.action, definitionCanonical: undefined });\n }\n }}\n />\n );\n}\n\ninterface ActionTimingInputProps {\n name: string;\n action: PlanDefinitionAction;\n onChange: (action: PlanDefinitionAction) => void;\n}\n\nfunction ActionTimingInput(props: ActionTimingInputProps): JSX.Element {\n const value = props.action;\n const key = 'timing';\n const [propertyValue, propertyType] = getActionTiming(value);\n return (\n <ResourcePropertyInput\n property={timingProperty}\n name=\"timing[x]\"\n defaultValue={propertyValue}\n defaultPropertyType={propertyType}\n onChange={(newValue: any, propName?: string) => {\n props.onChange(setPropertyValue(value, key, propName ?? key, timingProperty, newValue));\n }}\n />\n );\n}\n\nfunction getInitialActionType(action: PlanDefinitionAction): string | undefined {\n if (action.definitionCanonical?.startsWith('Schedule')) {\n return 'appointment';\n }\n\n if (action.definitionCanonical?.startsWith('Questionnaire/')) {\n return 'questionnaire';\n }\n\n if (action.definitionCanonical?.startsWith('ActivityDefinition/')) {\n return 'task';\n }\n\n return undefined;\n}\n\nfunction getActionTiming(action: PlanDefinitionAction): [any, PropertyType] {\n return getValueAndType({ type: 'PlanDefinitionAction', value: action }, 'timing');\n}\n\nlet nextId = 1;\n\n/**\n * Generates a unique ID.\n * React needs unique IDs for components for rendering performance.\n * All of the important components in the questionnaire builder have id properties for this:\n * Questionnaire, QuestionnaireItem, and QuestionnaireItemAnswerOption.\n * @param existing Optional existing id which will update nextId.\n * @returns A unique key.\n */\nfunction generateId(existing?: string): string {\n if (existing) {\n if (existing.startsWith('id-')) {\n const existingNum = parseInt(existing.substring(3), 10);\n if (!isNaN(existingNum)) {\n nextId = Math.max(nextId, existingNum + 1);\n }\n }\n return existing;\n }\n return 'id-' + nextId++;\n}\n\nfunction ensurePlanDefinitionKeys(planDefinition: PlanDefinition): PlanDefinition {\n return {\n ...planDefinition,\n action: ensurePlanDefinitionActionKeys(planDefinition.action),\n } as PlanDefinition;\n}\n\nfunction ensurePlanDefinitionActionKeys(\n actions: PlanDefinitionAction[] | undefined\n): PlanDefinitionAction[] | undefined {\n if (!actions) {\n return undefined;\n }\n return actions.map((action) => ({\n ...action,\n id: generateId(action.id),\n action: ensurePlanDefinitionActionKeys(action.action),\n }));\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,OAAO,EAAE;AACP,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,MAAM,EAAE,eAAe;AACvB,QAAA,OAAO,EAAE,mBAAmB;QAC5B,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAC7C,QAAA,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE;AAC7B,QAAA,UAAU,EAAE,UAAU;AACvB,KAAA;AAED,IAAA,QAAQ,EAAE;QACR,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAC9C,KAAA;AAED,IAAA,OAAO,EAAE;QACP,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;QAC7C,UAAU,EAAE,CAAa,UAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAChD,KAAA;AAED,IAAA,aAAa,EAAE;AACb,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,KAAK,EAAE,CAAC;AACR,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE;AAE5B,QAAA,KA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,CAAC;AAED,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;;;;;;;AAOG;AACH,SAAS,UAAU,CAAC,QAAiB,EAAA;AACnC,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,IAAI,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AAC9B,YAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACxD,YAAA,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;gBACvB,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;AAC5C,aAAA;AACF,SAAA;AACD,QAAA,OAAO,QAAQ,CAAC;AACjB,KAAA;AACD,IAAA,OAAO,KAAK,GAAG,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,cAA8B,EAAA;IAC9D,OAAO;AACL,QAAA,GAAG,cAAc;AACjB,QAAA,MAAM,EAAE,8BAA8B,CAAC,cAAc,CAAC,MAAM,CAAC;KAC5C,CAAC;AACtB,CAAC;AAED,SAAS,8BAA8B,CACrC,OAA2C,EAAA;IAE3C,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,OAAO,SAAS,CAAC;AAClB,KAAA;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAAM;AAC9B,QAAA,GAAG,MAAM;AACT,QAAA,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;AACzB,QAAA,MAAM,EAAE,8BAA8B,CAAC,MAAM,CAAC,MAAM,CAAC;AACtD,KAAA,CAAC,CAAC,CAAC;AACN;;;;"}
@@ -1,9 +0,0 @@
1
- import { formatQuantity } from '@medplum/core';
2
- import React from 'react';
3
-
4
- function QuantityDisplay(props) {
5
- return React.createElement(React.Fragment, null, formatQuantity(props.value));
6
- }
7
-
8
- export { QuantityDisplay };
9
- //# sourceMappingURL=QuantityDisplay.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuantityDisplay.mjs","sources":["../../../src/QuantityDisplay/QuantityDisplay.tsx"],"sourcesContent":["import { formatQuantity } from '@medplum/core';\nimport { Quantity } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface QuantityDisplayProps {\n value?: Quantity;\n}\n\nexport function QuantityDisplay(props: QuantityDisplayProps): JSX.Element | null {\n return <>{formatQuantity(props.value)}</>;\n}\n"],"names":[],"mappings":";;;AAQM,SAAU,eAAe,CAAC,KAA2B,EAAA;IACzD,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAI,CAAC;AAC5C;;;;"}
@@ -1,40 +0,0 @@
1
- import { Group, NativeSelect, TextInput } from '@mantine/core';
2
- import React, { useState } from 'react';
3
-
4
- function QuantityInput(props) {
5
- const [value, setValue] = useState(props.defaultValue);
6
- function setValueWrapper(newValue) {
7
- setValue(newValue);
8
- if (props.onChange) {
9
- props.onChange(newValue);
10
- }
11
- }
12
- return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
13
- React.createElement(NativeSelect, { style: { width: 80 }, "data-testid": props.name + '-comparator', defaultValue: value?.comparator, data: ['', '<', '<=', '>=', '>'], onChange: (e) => setValueWrapper({
14
- ...value,
15
- comparator: e.currentTarget.value,
16
- }) }),
17
- React.createElement(TextInput, { id: props.name, name: props.name, "data-testid": props.name + '-value', type: "number", placeholder: "Value", defaultValue: value?.value, step: "any", onWheel: (e) => {
18
- if (props.disableWheel) {
19
- e.currentTarget.blur();
20
- }
21
- }, onChange: (e) => {
22
- setValueWrapper({
23
- ...value,
24
- value: tryParseNumber(e.currentTarget.value),
25
- });
26
- } }),
27
- React.createElement(TextInput, { placeholder: "Unit", "data-testid": props.name + '-unit', defaultValue: value?.unit, onChange: (e) => setValueWrapper({
28
- ...value,
29
- unit: e.currentTarget.value,
30
- }) })));
31
- }
32
- function tryParseNumber(str) {
33
- if (!str) {
34
- return undefined;
35
- }
36
- return parseFloat(str);
37
- }
38
-
39
- export { QuantityInput };
40
- //# sourceMappingURL=QuantityInput.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuantityInput.mjs","sources":["../../../src/QuantityInput/QuantityInput.tsx"],"sourcesContent":["import { Group, NativeSelect, TextInput } from '@mantine/core';\nimport { Quantity } from '@medplum/fhirtypes';\nimport React, { useState, WheelEvent } from 'react';\n\nexport interface QuantityInputProps {\n name: string;\n defaultValue?: Quantity;\n onChange?: (value: Quantity) => void;\n disableWheel?: boolean;\n}\n\nexport function QuantityInput(props: QuantityInputProps): JSX.Element {\n const [value, setValue] = useState(props.defaultValue);\n\n function setValueWrapper(newValue: Quantity): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <NativeSelect\n style={{ width: 80 }}\n data-testid={props.name + '-comparator'}\n defaultValue={value?.comparator}\n data={['', '<', '<=', '>=', '>']}\n onChange={(e) =>\n setValueWrapper({\n ...value,\n comparator: e.currentTarget.value as '<' | '<=' | '>=' | '>',\n })\n }\n />\n <TextInput\n id={props.name}\n name={props.name}\n data-testid={props.name + '-value'}\n type=\"number\"\n placeholder=\"Value\"\n defaultValue={value?.value}\n step=\"any\"\n onWheel={(e: WheelEvent<HTMLInputElement>) => {\n if (props.disableWheel) {\n e.currentTarget.blur();\n }\n }}\n onChange={(e) => {\n setValueWrapper({\n ...value,\n value: tryParseNumber(e.currentTarget.value),\n });\n }}\n />\n <TextInput\n placeholder=\"Unit\"\n data-testid={props.name + '-unit'}\n defaultValue={value?.unit}\n onChange={(e) =>\n setValueWrapper({\n ...value,\n unit: e.currentTarget.value,\n })\n }\n />\n </Group>\n );\n}\n\nfunction tryParseNumber(str: string): number | undefined {\n if (!str) {\n return undefined;\n }\n return parseFloat(str);\n}\n"],"names":[],"mappings":";;;AA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