@medplum/react 2.0.2 → 2.0.3

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 (305) hide show
  1. package/dist/cjs/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +2 -1
  2. package/dist/cjs/ResourceDiffTable/ResourceDiffTable.stories.d.ts +5 -0
  3. package/dist/cjs/ResourceTable/ResourceTable.d.ts +13 -0
  4. package/dist/cjs/ResourceTimeline/ResourceTimeline.d.ts +2 -2
  5. package/dist/cjs/index.cjs +1833 -1211
  6. package/dist/cjs/index.cjs.map +1 -1
  7. package/dist/cjs/index.d.ts +1 -0
  8. package/dist/cjs/index.min.cjs +1 -1
  9. package/dist/cjs/useResource/useResource.d.ts +2 -2
  10. package/dist/cjs/utils/date.d.ts +2 -1
  11. package/dist/esm/AddressDisplay/AddressDisplay.mjs +2 -2
  12. package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +1 -1
  13. package/dist/esm/AddressInput/AddressInput.mjs +9 -9
  14. package/dist/esm/AddressInput/AddressInput.mjs.map +1 -1
  15. package/dist/esm/AnnotationInput/AnnotationInput.mjs +2 -2
  16. package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +1 -1
  17. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +2 -2
  18. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +1 -1
  19. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs +4 -4
  20. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +1 -1
  21. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs +20 -19
  22. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +1 -1
  23. package/dist/esm/AttachmentButton/AttachmentButton.mjs +3 -3
  24. package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +1 -1
  25. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +9 -9
  26. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +1 -1
  27. package/dist/esm/AttachmentInput/AttachmentInput.mjs +5 -5
  28. package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +1 -1
  29. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs +6 -6
  30. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +1 -1
  31. package/dist/esm/BackboneElementInput/BackboneElementInput.mjs +7 -7
  32. package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +1 -1
  33. package/dist/esm/CalendarInput/CalendarInput.mjs +18 -18
  34. package/dist/esm/CalendarInput/CalendarInput.mjs.map +1 -1
  35. package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs +5 -5
  36. package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +1 -1
  37. package/dist/esm/CodeInput/CodeInput.mjs +2 -2
  38. package/dist/esm/CodeInput/CodeInput.mjs.map +1 -1
  39. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs +2 -2
  40. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +1 -1
  41. package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +2 -2
  42. package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +1 -1
  43. package/dist/esm/CodingDisplay/CodingDisplay.mjs +2 -2
  44. package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +1 -1
  45. package/dist/esm/CodingInput/CodingInput.mjs +2 -2
  46. package/dist/esm/CodingInput/CodingInput.mjs.map +1 -1
  47. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs +3 -3
  48. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +1 -1
  49. package/dist/esm/ContactDetailInput/ContactDetailInput.mjs +4 -4
  50. package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +1 -1
  51. package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs +2 -2
  52. package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +1 -1
  53. package/dist/esm/ContactPointInput/ContactPointInput.mjs +5 -5
  54. package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +1 -1
  55. package/dist/esm/Container/Container.mjs +2 -2
  56. package/dist/esm/Container/Container.mjs.map +1 -1
  57. package/dist/esm/DateTimeInput/DateTimeInput.mjs +2 -2
  58. package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +1 -1
  59. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs +3 -7
  60. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +1 -1
  61. package/dist/esm/DescriptionList/DescriptionList.mjs +5 -5
  62. package/dist/esm/DescriptionList/DescriptionList.mjs.map +1 -1
  63. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs +49 -49
  64. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +1 -1
  65. package/dist/esm/Document/Document.mjs +3 -3
  66. package/dist/esm/Document/Document.mjs.map +1 -1
  67. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs +7 -7
  68. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +1 -1
  69. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs +4 -4
  70. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +1 -1
  71. package/dist/esm/ExtensionInput/ExtensionInput.mjs +2 -2
  72. package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +1 -1
  73. package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs +2 -2
  74. package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +1 -1
  75. package/dist/esm/FhirPathTable/FhirPathTable.mjs +19 -19
  76. package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +1 -1
  77. package/dist/esm/Form/Form.mjs +2 -2
  78. package/dist/esm/Form/Form.mjs.map +1 -1
  79. package/dist/esm/FormSection/FormSection.mjs +2 -2
  80. package/dist/esm/FormSection/FormSection.mjs.map +1 -1
  81. package/dist/esm/GoogleButton/GoogleButton.mjs +4 -4
  82. package/dist/esm/GoogleButton/GoogleButton.mjs.map +1 -1
  83. package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs +2 -2
  84. package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +1 -1
  85. package/dist/esm/HumanNameInput/HumanNameInput.mjs +7 -7
  86. package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +1 -1
  87. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +2 -2
  88. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +1 -1
  89. package/dist/esm/IdentifierInput/IdentifierInput.mjs +4 -4
  90. package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +1 -1
  91. package/dist/esm/Logo/Logo.mjs +8 -8
  92. package/dist/esm/Logo/Logo.mjs.map +1 -1
  93. package/dist/esm/MedplumLink/MedplumLink.mjs +2 -2
  94. package/dist/esm/MedplumLink/MedplumLink.mjs.map +1 -1
  95. package/dist/esm/MedplumProvider/MedplumProvider.mjs +2 -2
  96. package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +1 -1
  97. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +2 -2
  98. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +1 -1
  99. package/dist/esm/MoneyInput/MoneyInput.mjs +4 -4
  100. package/dist/esm/MoneyInput/MoneyInput.mjs.map +1 -1
  101. package/dist/esm/NoteDisplay/NoteDisplay.mjs +2 -2
  102. package/dist/esm/NoteDisplay/NoteDisplay.mjs.map +1 -1
  103. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +2 -1
  104. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs +5 -4
  105. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs.map +1 -1
  106. package/dist/esm/Panel/Panel.mjs +2 -2
  107. package/dist/esm/Panel/Panel.mjs.map +1 -1
  108. package/dist/esm/PatientTimeline/PatientTimeline.mjs +12 -12
  109. package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +1 -1
  110. package/dist/esm/PeriodInput/PeriodInput.mjs +4 -4
  111. package/dist/esm/PeriodInput/PeriodInput.mjs.map +1 -1
  112. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs +34 -34
  113. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +1 -1
  114. package/dist/esm/QuantityDisplay/QuantityDisplay.mjs +2 -2
  115. package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +1 -1
  116. package/dist/esm/QuantityInput/QuantityInput.mjs +5 -5
  117. package/dist/esm/QuantityInput/QuantityInput.mjs.map +1 -1
  118. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs +31 -31
  119. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +1 -1
  120. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs +32 -32
  121. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +1 -1
  122. package/dist/esm/RangeDisplay/RangeDisplay.mjs +2 -2
  123. package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +1 -1
  124. package/dist/esm/RangeInput/RangeInput.mjs +4 -4
  125. package/dist/esm/RangeInput/RangeInput.mjs.map +1 -1
  126. package/dist/esm/RatioDisplay/RatioDisplay.mjs +4 -4
  127. package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +1 -1
  128. package/dist/esm/RatioInput/RatioInput.mjs +4 -4
  129. package/dist/esm/RatioInput/RatioInput.mjs.map +1 -1
  130. package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs +3 -3
  131. package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +1 -1
  132. package/dist/esm/ReferenceInput/ReferenceInput.mjs +4 -4
  133. package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +1 -1
  134. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs +32 -31
  135. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +1 -1
  136. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs +16 -15
  137. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +1 -1
  138. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs +3 -3
  139. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +1 -1
  140. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs +19 -18
  141. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +1 -1
  142. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +4 -4
  143. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +1 -1
  144. package/dist/esm/ResourceBadge/ResourceBadge.mjs +4 -4
  145. package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +1 -1
  146. package/dist/esm/ResourceBlame/ResourceBlame.mjs +13 -13
  147. package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +1 -1
  148. package/dist/esm/ResourceDiff/ResourceDiff.mjs +7 -7
  149. package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +1 -1
  150. package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs +18 -18
  151. package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +1 -1
  152. package/dist/esm/ResourceDiffTable/ResourceDiffTable.stories.d.ts +5 -0
  153. package/dist/esm/ResourceForm/ResourceForm.mjs +12 -12
  154. package/dist/esm/ResourceForm/ResourceForm.mjs.map +1 -1
  155. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs +17 -17
  156. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +1 -1
  157. package/dist/esm/ResourceInput/ResourceInput.mjs +8 -8
  158. package/dist/esm/ResourceInput/ResourceInput.mjs.map +1 -1
  159. package/dist/esm/ResourceName/ResourceName.mjs +2 -2
  160. package/dist/esm/ResourceName/ResourceName.mjs.map +1 -1
  161. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs +26 -26
  162. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +1 -1
  163. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs +34 -34
  164. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +1 -1
  165. package/dist/esm/ResourceTable/ResourceTable.d.ts +13 -0
  166. package/dist/esm/ResourceTable/ResourceTable.mjs +5 -2
  167. package/dist/esm/ResourceTable/ResourceTable.mjs.map +1 -1
  168. package/dist/esm/ResourceTimeline/ResourceTimeline.d.ts +2 -2
  169. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs +105 -76
  170. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +1 -1
  171. package/dist/esm/Scheduler/Scheduler.mjs +22 -22
  172. package/dist/esm/Scheduler/Scheduler.mjs.map +1 -1
  173. package/dist/esm/SearchControl/SearchControl.mjs +55 -49
  174. package/dist/esm/SearchControl/SearchControl.mjs.map +1 -1
  175. package/dist/esm/SearchControl/SearchUtils.mjs +4 -4
  176. package/dist/esm/SearchControl/SearchUtils.mjs.map +1 -1
  177. package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs +25 -25
  178. package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +1 -1
  179. package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs +37 -37
  180. package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +1 -1
  181. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs +6 -6
  182. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +1 -1
  183. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs +4 -4
  184. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +1 -1
  185. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs +8 -8
  186. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +1 -1
  187. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs +75 -62
  188. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +1 -1
  189. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs +8 -8
  190. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +1 -1
  191. package/dist/esm/StatusBadge/StatusBadge.mjs +2 -2
  192. package/dist/esm/StatusBadge/StatusBadge.mjs.map +1 -1
  193. package/dist/esm/Timeline/Timeline.mjs +20 -20
  194. package/dist/esm/Timeline/Timeline.mjs.map +1 -1
  195. package/dist/esm/TimingInput/TimingInput.mjs +19 -19
  196. package/dist/esm/TimingInput/TimingInput.mjs.map +1 -1
  197. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +2 -2
  198. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +1 -1
  199. package/dist/esm/auth/AuthenticationForm.mjs +22 -22
  200. package/dist/esm/auth/AuthenticationForm.mjs.map +1 -1
  201. package/dist/esm/auth/ChooseProfileForm.mjs +11 -11
  202. package/dist/esm/auth/ChooseProfileForm.mjs.map +1 -1
  203. package/dist/esm/auth/ChooseScopeForm.mjs +9 -9
  204. package/dist/esm/auth/ChooseScopeForm.mjs.map +1 -1
  205. package/dist/esm/auth/MfaForm.mjs +12 -12
  206. package/dist/esm/auth/MfaForm.mjs.map +1 -1
  207. package/dist/esm/auth/NewProjectForm.mjs +12 -12
  208. package/dist/esm/auth/NewProjectForm.mjs.map +1 -1
  209. package/dist/esm/auth/NewUserForm.mjs +22 -22
  210. package/dist/esm/auth/NewUserForm.mjs.map +1 -1
  211. package/dist/esm/auth/RegisterForm.mjs +5 -5
  212. package/dist/esm/auth/RegisterForm.mjs.map +1 -1
  213. package/dist/esm/auth/SignInForm.mjs +8 -8
  214. package/dist/esm/auth/SignInForm.mjs.map +1 -1
  215. package/dist/esm/index.d.ts +1 -0
  216. package/dist/esm/index.min.mjs +1 -1
  217. package/dist/esm/index.mjs +1 -0
  218. package/dist/esm/index.mjs.map +1 -1
  219. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +69 -0
  220. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs.map +1 -0
  221. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +18 -0
  222. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs.map +1 -0
  223. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs +24 -0
  224. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs.map +1 -0
  225. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs +14 -0
  226. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs.map +1 -0
  227. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs +18 -0
  228. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs.map +1 -0
  229. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs +19 -0
  230. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs.map +1 -0
  231. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs +25 -0
  232. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs.map +1 -0
  233. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs +16 -0
  234. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs.map +1 -0
  235. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs +19 -0
  236. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs.map +1 -0
  237. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs +26 -0
  238. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs.map +1 -0
  239. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs +23 -0
  240. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs.map +1 -0
  241. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +12 -0
  242. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs.map +1 -0
  243. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs +19 -0
  244. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs.map +1 -0
  245. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs +13 -0
  246. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs.map +1 -0
  247. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs +14 -0
  248. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs.map +1 -0
  249. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs +20 -0
  250. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs.map +1 -0
  251. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs +19 -0
  252. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs.map +1 -0
  253. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs +19 -0
  254. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs.map +1 -0
  255. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs +14 -0
  256. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs.map +1 -0
  257. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs +26 -0
  258. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs.map +1 -0
  259. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs +13 -0
  260. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs.map +1 -0
  261. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs +14 -0
  262. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs.map +1 -0
  263. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs +21 -0
  264. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs.map +1 -0
  265. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs +21 -0
  266. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs.map +1 -0
  267. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs +18 -0
  268. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs.map +1 -0
  269. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs +29 -0
  270. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs.map +1 -0
  271. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs +12 -0
  272. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs.map +1 -0
  273. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs +12 -0
  274. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs.map +1 -0
  275. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs +20 -0
  276. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs.map +1 -0
  277. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs +20 -0
  278. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs.map +1 -0
  279. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs +21 -0
  280. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs.map +1 -0
  281. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs +19 -0
  282. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs.map +1 -0
  283. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs +16 -0
  284. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs.map +1 -0
  285. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs +16 -0
  286. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs.map +1 -0
  287. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs +18 -0
  288. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs.map +1 -0
  289. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs +18 -0
  290. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs.map +1 -0
  291. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs +19 -0
  292. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs.map +1 -0
  293. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +13 -0
  294. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs.map +1 -0
  295. package/dist/esm/useResource/useResource.d.ts +2 -2
  296. package/dist/esm/useResource/useResource.mjs +62 -42
  297. package/dist/esm/useResource/useResource.mjs.map +1 -1
  298. package/dist/esm/utils/date.d.ts +2 -1
  299. package/dist/esm/utils/date.mjs +31 -25
  300. package/dist/esm/utils/date.mjs.map +1 -1
  301. package/icons-unique.txt +36 -0
  302. package/icons.txt +44 -0
  303. package/package.json +6 -6
  304. package/dist/esm/node_modules/@tabler/icons/icons-react/dist/index.esm.mjs +0 -6
  305. package/dist/esm/node_modules/@tabler/icons/icons-react/dist/index.esm.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
- import { Reference, Resource } from '@medplum/fhirtypes';
1
+ import { OperationOutcome, Reference, Resource } from '@medplum/fhirtypes';
2
2
  /**
3
3
  * React Hook to use a FHIR reference.
4
4
  * Handles the complexity of resolving references and caching resources.
5
5
  * @param value The resource or reference to resource.
6
6
  * @returns The resolved resource.
7
7
  */
8
- export declare function useResource<T extends Resource>(value: Reference<T> | T | undefined): T | undefined;
8
+ export declare function useResource<T extends Resource>(value: Reference<T> | T | undefined, setOutcome?: (outcome: OperationOutcome) => void): T | undefined;
@@ -2,5 +2,6 @@ import { Resource } from '@medplum/fhirtypes';
2
2
  /**
3
3
  * Sorts an array of resources in place by meta.lastUpdated ascending.
4
4
  * @param resources Array of resources.
5
+ * @param timelineResource Optional primary resource of a timeline view. If specified, the primary resource will be sorted by meta.lastUpdated descending.
5
6
  */
6
- export declare function sortByDateAndPriority(resources: Resource[]): void;
7
+ export declare function sortByDateAndPriority(resources: Resource[], timelineResource?: Resource): void;
@@ -1,12 +1,12 @@
1
1
  import { formatAddress } from '@medplum/core';
2
- import e__default from 'react';
2
+ import React from 'react';
3
3
 
4
4
  function AddressDisplay(props) {
5
5
  const address = props.value;
6
6
  if (!address) {
7
7
  return null;
8
8
  }
9
- return e__default.createElement(e__default.Fragment, null, formatAddress(address));
9
+ return React.createElement(React.Fragment, null, formatAddress(address));
10
10
  }
11
11
 
12
12
  export { AddressDisplay };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressDisplay.mjs","sources":["../../../src/AddressDisplay/AddressDisplay.tsx"],"sourcesContent":["import { formatAddress } from '@medplum/core';\nimport { Address } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface AddressDisplayProps {\n value?: Address;\n}\n\nexport function AddressDisplay(props: AddressDisplayProps): JSX.Element | null {\n const address = props.value;\n if (!address) {\n return null;\n }\n\n return <>{formatAddress(address)}</>;\n}\n"],"names":["React"],"mappings":";;;AAQM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,OAAOA,oDAAG,aAAa,CAAC,OAAO,CAAC,CAAI,CAAC;AACvC;;;;"}
1
+ {"version":3,"file":"AddressDisplay.mjs","sources":["../../../src/AddressDisplay/AddressDisplay.tsx"],"sourcesContent":["import { formatAddress } from '@medplum/core';\nimport { Address } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface AddressDisplayProps {\n value?: Address;\n}\n\nexport function AddressDisplay(props: AddressDisplayProps): JSX.Element | null {\n const address = props.value;\n if (!address) {\n return null;\n }\n\n return <>{formatAddress(address)}</>;\n}\n"],"names":[],"mappings":";;;AAQM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,OAAO,0CAAG,aAAa,CAAC,OAAO,CAAC,CAAI,CAAC;AACvC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { Group, NativeSelect, TextInput } from '@mantine/core';
2
- import e__default, { useState, useRef } from 'react';
2
+ import React, { useState, useRef } from 'react';
3
3
 
4
4
  function getLine(address, index) {
5
5
  return address && address.line && address.line.length > index ? address.line[index] : '';
@@ -43,14 +43,14 @@ function AddressInput(props) {
43
43
  function setPostalCode(postalCode) {
44
44
  setValueWrapper({ ...valueRef.current, postalCode });
45
45
  }
46
- return (e__default.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
47
- e__default.createElement(NativeSelect, { "data-testid": "address-use", defaultValue: value?.use, onChange: (e) => setUse(e.currentTarget.value), data: ['', 'home', 'work', 'temp', 'old', 'billing'] }),
48
- e__default.createElement(NativeSelect, { "data-testid": "address-type", defaultValue: value?.type, onChange: (e) => setType(e.currentTarget.value), data: ['', 'postal', 'physical', 'both'] }),
49
- e__default.createElement(TextInput, { placeholder: "Line 1", defaultValue: getLine(value, 0), onChange: (e) => setLine1(e.currentTarget.value) }),
50
- e__default.createElement(TextInput, { placeholder: "Line 2", defaultValue: getLine(value, 1), onChange: (e) => setLine2(e.currentTarget.value) }),
51
- e__default.createElement(TextInput, { placeholder: "City", defaultValue: value.city, onChange: (e) => setCity(e.currentTarget.value) }),
52
- e__default.createElement(TextInput, { placeholder: "State", defaultValue: value.state, onChange: (e) => setState(e.currentTarget.value) }),
53
- e__default.createElement(TextInput, { placeholder: "Postal Code", defaultValue: value.postalCode, onChange: (e) => setPostalCode(e.currentTarget.value) })));
46
+ return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
47
+ React.createElement(NativeSelect, { "data-testid": "address-use", defaultValue: value?.use, onChange: (e) => setUse(e.currentTarget.value), data: ['', 'home', 'work', 'temp', 'old', 'billing'] }),
48
+ React.createElement(NativeSelect, { "data-testid": "address-type", defaultValue: value?.type, onChange: (e) => setType(e.currentTarget.value), data: ['', 'postal', 'physical', 'both'] }),
49
+ React.createElement(TextInput, { placeholder: "Line 1", defaultValue: getLine(value, 0), onChange: (e) => setLine1(e.currentTarget.value) }),
50
+ React.createElement(TextInput, { placeholder: "Line 2", defaultValue: getLine(value, 1), onChange: (e) => setLine2(e.currentTarget.value) }),
51
+ React.createElement(TextInput, { placeholder: "City", defaultValue: value.city, onChange: (e) => setCity(e.currentTarget.value) }),
52
+ React.createElement(TextInput, { placeholder: "State", defaultValue: value.state, onChange: (e) => setState(e.currentTarget.value) }),
53
+ React.createElement(TextInput, { placeholder: "Postal Code", defaultValue: value.postalCode, onChange: (e) => setPostalCode(e.currentTarget.value) })));
54
54
  }
55
55
 
56
56
  export { AddressInput };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressInput.mjs","sources":["../../../src/AddressInput/AddressInput.tsx"],"sourcesContent":["import { Group, NativeSelect, TextInput } from '@mantine/core';\nimport { Address } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\n\nfunction getLine(address: Address, index: number): string {\n return address && address.line && address.line.length > index ? address.line[index] : '';\n}\n\nfunction setLine(address: Address, index: number, str: string): Address {\n const line: string[] = address.line || [];\n while (line.length <= index) {\n line.push('');\n }\n line[index] = str;\n return { ...address, line };\n}\n\nexport interface AddressInputProps {\n name: string;\n defaultValue?: Address;\n onChange?: (value: Address) => void;\n}\n\nexport function AddressInput(props: AddressInputProps): JSX.Element {\n const [value, setValue] = useState<Address>(props.defaultValue || {});\n\n const valueRef = useRef<Address>();\n valueRef.current = value;\n\n function setValueWrapper(newValue: Address): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setUse(use: 'home' | 'work' | 'temp' | 'old' | 'billing'): void {\n setValueWrapper({ ...valueRef.current, use });\n }\n\n function setType(type: 'postal' | 'physical' | 'both'): void {\n setValueWrapper({ ...valueRef.current, type });\n }\n\n function setLine1(line1: string): void {\n setValueWrapper(setLine(valueRef.current || {}, 0, line1));\n }\n\n function setLine2(line2: string): void {\n setValueWrapper(setLine(valueRef.current || {}, 1, line2));\n }\n\n function setCity(city: string): void {\n setValueWrapper({ ...valueRef.current, city });\n }\n\n function setState(state: string): void {\n setValueWrapper({ ...valueRef.current, state });\n }\n\n function setPostalCode(postalCode: string): void {\n setValueWrapper({ ...valueRef.current, postalCode });\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <NativeSelect\n data-testid=\"address-use\"\n defaultValue={value?.use}\n onChange={(e) => setUse(e.currentTarget.value as 'home' | 'work' | 'temp' | 'old' | 'billing')}\n data={['', 'home', 'work', 'temp', 'old', 'billing']}\n />\n <NativeSelect\n data-testid=\"address-type\"\n defaultValue={value?.type}\n onChange={(e) => setType(e.currentTarget.value as 'postal' | 'physical' | 'both')}\n data={['', 'postal', 'physical', 'both']}\n />\n <TextInput\n placeholder=\"Line 1\"\n defaultValue={getLine(value, 0)}\n onChange={(e) => setLine1(e.currentTarget.value)}\n />\n <TextInput\n placeholder=\"Line 2\"\n defaultValue={getLine(value, 1)}\n onChange={(e) => setLine2(e.currentTarget.value)}\n />\n <TextInput placeholder=\"City\" defaultValue={value.city} onChange={(e) => setCity(e.currentTarget.value)} />\n <TextInput placeholder=\"State\" defaultValue={value.state} onChange={(e) => setState(e.currentTarget.value)} />\n <TextInput\n placeholder=\"Postal Code\"\n defaultValue={value.postalCode}\n onChange={(e) => setPostalCode(e.currentTarget.value)}\n />\n </Group>\n );\n}\n"],"names":["React"],"mappings":";;;AAIA,SAAS,OAAO,CAAC,OAAgB,EAAE,KAAa,EAAA;IAC9C,OAAO,OAAO,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAC3F,CAAC;AAED,SAAS,OAAO,CAAC,OAAgB,EAAE,KAAa,EAAE,GAAW,EAAA;AAC3D,IAAA,MAAM,IAAI,GAAa,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;AAC1C,IAAA,OAAO,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;AAC3B,QAAA,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACf,KAAA;AACD,IAAA,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAClB,IAAA,OAAO,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9B,CAAC;AAQK,SAAU,YAAY,CAAC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a,CAAC,KAAK,CAAC,EAChD,CAAA;QACFA,UAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,WAAW,EAAC,MAAM,EAAC,YAAY,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAI,CAAA;QAC3GA,UAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,WAAW,EAAC,OAAO,EAAC,YAAY,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAI,CAAA;AAC9G,QAAAA,UAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,WAAW,EAAC,aAAa,EACzB,YAAY,EAAE,KAAK,CAAC,UAAU,EAC9B,QAAQ,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EACrD,CAAA,CACI,EACR;AACJ;;;;"}
1
+ {"version":3,"file":"AddressInput.mjs","sources":["../../../src/AddressInput/AddressInput.tsx"],"sourcesContent":["import { Group, NativeSelect, TextInput } from '@mantine/core';\nimport { Address } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\n\nfunction getLine(address: Address, index: number): string {\n return address && address.line && address.line.length > index ? address.line[index] : '';\n}\n\nfunction setLine(address: Address, index: number, str: string): Address {\n const line: string[] = address.line || [];\n while (line.length <= index) {\n line.push('');\n }\n line[index] = str;\n return { ...address, line };\n}\n\nexport interface AddressInputProps {\n name: string;\n defaultValue?: Address;\n onChange?: (value: Address) => void;\n}\n\nexport function AddressInput(props: AddressInputProps): JSX.Element {\n const [value, setValue] = useState<Address>(props.defaultValue || {});\n\n const valueRef = useRef<Address>();\n valueRef.current = value;\n\n function setValueWrapper(newValue: Address): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setUse(use: 'home' | 'work' | 'temp' | 'old' | 'billing'): void {\n setValueWrapper({ ...valueRef.current, use });\n }\n\n function setType(type: 'postal' | 'physical' | 'both'): void {\n setValueWrapper({ ...valueRef.current, type });\n }\n\n function setLine1(line1: string): void {\n setValueWrapper(setLine(valueRef.current || {}, 0, line1));\n }\n\n function setLine2(line2: string): void {\n setValueWrapper(setLine(valueRef.current || {}, 1, line2));\n }\n\n function setCity(city: string): void {\n setValueWrapper({ ...valueRef.current, city });\n }\n\n function setState(state: string): void {\n setValueWrapper({ ...valueRef.current, state });\n }\n\n function setPostalCode(postalCode: string): void {\n setValueWrapper({ ...valueRef.current, postalCode });\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <NativeSelect\n data-testid=\"address-use\"\n defaultValue={value?.use}\n onChange={(e) => setUse(e.currentTarget.value as 'home' | 'work' | 'temp' | 'old' | 'billing')}\n data={['', 'home', 'work', 'temp', 'old', 'billing']}\n />\n <NativeSelect\n data-testid=\"address-type\"\n defaultValue={value?.type}\n onChange={(e) => setType(e.currentTarget.value as 'postal' | 'physical' | 'both')}\n data={['', 'postal', 'physical', 'both']}\n />\n <TextInput\n placeholder=\"Line 1\"\n defaultValue={getLine(value, 0)}\n onChange={(e) => setLine1(e.currentTarget.value)}\n />\n <TextInput\n placeholder=\"Line 2\"\n defaultValue={getLine(value, 1)}\n onChange={(e) => setLine2(e.currentTarget.value)}\n />\n <TextInput placeholder=\"City\" defaultValue={value.city} onChange={(e) => setCity(e.currentTarget.value)} />\n <TextInput placeholder=\"State\" defaultValue={value.state} onChange={(e) => setState(e.currentTarget.value)} />\n <TextInput\n placeholder=\"Postal Code\"\n defaultValue={value.postalCode}\n onChange={(e) => setPostalCode(e.currentTarget.value)}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,OAAO,CAAC,OAAgB,EAAE,KAAa,EAAA;IAC9C,OAAO,OAAO,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,C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{ useState, useRef } from 'react';
3
+ import React, { useState, useRef } from 'react';
4
4
  import { useMedplumProfile } from '../MedplumProvider/MedplumProvider.mjs';
5
5
 
6
6
  function AnnotationInput(props) {
@@ -21,7 +21,7 @@ function AnnotationInput(props) {
21
21
  props.onChange(newValue);
22
22
  }
23
23
  }
24
- return (e__default.createElement(TextInput, { name: props.name, placeholder: "Annotation text", defaultValue: value.text, onChange: (e) => setText(e.currentTarget.value) }));
24
+ return (React.createElement(TextInput, { name: props.name, placeholder: "Annotation text", defaultValue: value.text, onChange: (e) => setText(e.currentTarget.value) }));
25
25
  }
26
26
 
27
27
  export { AnnotationInput };
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationInput.mjs","sources":["../../../src/AnnotationInput/AnnotationInput.tsx"],"sourcesContent":["import { TextInput } from '@mantine/core';\nimport { createReference } from '@medplum/core';\nimport { Annotation } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\nimport { useMedplumProfile } from '../MedplumProvider/MedplumProvider';\n\nexport interface AnnotationInputProps {\n name: string;\n defaultValue?: Annotation;\n onChange?: (value: Annotation) => void;\n}\n\nexport function AnnotationInput(props: AnnotationInputProps): JSX.Element {\n const author = useMedplumProfile();\n const [value, setValue] = useState<Annotation>(props.defaultValue || {});\n\n const valueRef = useRef<Annotation>();\n valueRef.current = value;\n\n function setText(text: string): void {\n const newValue: Annotation = text\n ? {\n text,\n authorReference: author && createReference(author),\n time: new Date().toISOString(),\n }\n : {};\n\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n return (\n <TextInput\n name={props.name}\n placeholder=\"Annotation text\"\n defaultValue={value.text}\n onChange={(e) => setText(e.currentTarget.value)}\n />\n );\n}\n"],"names":["React"],"mappings":";;;;;AAYM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;AACnC,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAa,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;AAEzE,IAAA,MAAM,QAAQ,GAAG,MAAM,EAAc,CAAC;AACtC,IAAA,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;IAEzB,SAAS,OAAO,CAAC,IAAY,EAAA;QAC3B,MAAM,QAAQ,GAAe,IAAI;AAC/B,cAAE;gBACE,IAAI;AACJ,gBAAA,eAAe,EAAE,MAAM,IAAI,eAAe,CAAC,MAAM,CAAC;AAClD,gBAAA,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC/B,aAAA;cACD,EAAE,CAAC;QAEP,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;AAED,IAAA,QACEA,UAAC,CAAA,aAAA,CAAA,SAAS,EACR,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAC,iBAAiB,EAC7B,YAAY,EAAE,KAAK,CAAC,IAAI,EACxB,QAAQ,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAA,CAC/C,EACF;AACJ;;;;"}
1
+ {"version":3,"file":"AnnotationInput.mjs","sources":["../../../src/AnnotationInput/AnnotationInput.tsx"],"sourcesContent":["import { TextInput } from '@mantine/core';\nimport { createReference } from '@medplum/core';\nimport { Annotation } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\nimport { useMedplumProfile } from '../MedplumProvider/MedplumProvider';\n\nexport interface AnnotationInputProps {\n name: string;\n defaultValue?: Annotation;\n onChange?: (value: Annotation) => void;\n}\n\nexport function AnnotationInput(props: AnnotationInputProps): JSX.Element {\n const author = useMedplumProfile();\n const [value, setValue] = useState<Annotation>(props.defaultValue || {});\n\n const valueRef = useRef<Annotation>();\n valueRef.current = value;\n\n function setText(text: string): void {\n const newValue: Annotation = text\n ? {\n text,\n authorReference: author && createReference(author),\n time: new Date().toISOString(),\n }\n : {};\n\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n return (\n <TextInput\n name={props.name}\n placeholder=\"Annotation text\"\n defaultValue={value.text}\n onChange={(e) => setText(e.currentTarget.value)}\n />\n );\n}\n"],"names":[],"mappings":";;;;;AAYM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;AACnC,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAa,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;AAEzE,IAAA,MAAM,QAAQ,GAAG,MAAM,EAAc,CAAC;AACtC,IAAA,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;IAEzB,SAAS,OAAO,CAAC,IAAY,EAAA;QAC3B,MAAM,QAAQ,GAAe,IAAI;AAC/B,cAAE;gBACE,IAAI;AACJ,gBAAA,eAAe,EAAE,MAAM,IAAI,eAAe,CAAC,MAAM,CAAC;AAClD,gBAAA,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC/B,aAAA;cACD,EAAE,CAAC;QAEP,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,SAAS,EACR,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAC,iBAAiB,EAC7B,YAAY,EAAE,KAAK,CAAC,IAAI,EACxB,QAAQ,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAA,CAC/C,EACF;AACJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { MultiSelect, Loader } from '@mantine/core';
2
- import e__default, { useRef, useState, useCallback, useEffect } from 'react';
2
+ import React, { useRef, useState, useCallback, useEffect } from 'react';
3
3
  import { killEvent } from '../utils/dom.mjs';
4
4
 
5
5
  function AsyncAutocomplete(props) {
@@ -97,7 +97,7 @@ function AsyncAutocomplete(props) {
97
97
  }
98
98
  };
99
99
  }, []);
100
- return (e__default.createElement(MultiSelect, { ...rest, ref: inputRef, defaultValue: defaultItems.map(toKey), searchable: true, onKeyDown: handleKeyDown, onSearchChange: handleSearchChange, data: options, onFocus: handleTimer, onChange: handleChange, onCreate: handleCreate, rightSectionWidth: 40, rightSection: abortController ? e__default.createElement(Loader, { size: 16 }) : null, filter: handleFilter }));
100
+ return (React.createElement(MultiSelect, { ...rest, ref: inputRef, defaultValue: defaultItems.map(toKey), searchable: true, onKeyDown: handleKeyDown, onSearchChange: handleSearchChange, data: options, onFocus: handleTimer, onChange: handleChange, onCreate: handleCreate, rightSectionWidth: 40, rightSection: abortController ? React.createElement(Loader, { size: 16 }) : null, filter: handleFilter }));
101
101
  }
102
102
  function toDefaultItems(defaultValue) {
103
103
  if (!defaultValue) {
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncAutocomplete.mjs","sources":["../../../src/AsyncAutocomplete/AsyncAutocomplete.tsx"],"sourcesContent":["import { Loader, MultiSelect, MultiSelectProps, SelectItem } from '@mantine/core';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { killEvent } from '../utils/dom';\n\nexport interface AsyncAutocompleteOption<T> extends SelectItem {\n resource: T;\n}\n\nexport interface AsyncAutocompleteProps<T>\n extends Omit<MultiSelectProps, 'data' | 'defaultValue' | 'loadOptions' | 'onChange' | 'onCreate' | 'searchable'> {\n defaultValue?: T | T[];\n toKey: (item: T) => string;\n toOption: (item: T) => AsyncAutocompleteOption<T>;\n loadOptions: (input: string, signal: AbortSignal) => Promise<T[]>;\n onChange: (item: T[]) => void;\n onCreate?: (input: string) => T;\n}\n\nexport function AsyncAutocomplete<T>(props: AsyncAutocompleteProps<T>): JSX.Element {\n const { defaultValue, toKey, toOption, loadOptions, onChange, onCreate, ...rest } = props;\n const defaultItems = toDefaultItems(defaultValue);\n const inputRef = useRef<HTMLInputElement>(null);\n const [lastValue, setLastValue] = useState<string | undefined>(undefined);\n const [timer, setTimer] = useState<number>();\n const [abortController, setAbortController] = useState<AbortController>();\n const [autoSubmit, setAutoSubmit] = useState<boolean>();\n const [options, setOptions] = useState<AsyncAutocompleteOption<T>[]>(defaultItems?.map(toOption));\n\n const lastValueRef = useRef<string>();\n lastValueRef.current = lastValue;\n\n const timerRef = useRef<number>();\n timerRef.current = timer;\n\n const abortControllerRef = useRef<AbortController>();\n abortControllerRef.current = abortController;\n\n const autoSubmitRef = useRef<boolean>();\n autoSubmitRef.current = autoSubmit;\n\n const optionsRef = useRef<AsyncAutocompleteOption<T>[]>();\n optionsRef.current = options;\n\n const handleTimer = useCallback((): void => {\n setTimer(undefined);\n\n const value = inputRef.current?.value?.trim() || '';\n if (value === lastValueRef.current) {\n // Nothing has changed, move on\n return;\n }\n\n setLastValue(value);\n\n const newAbortController = new AbortController();\n setAbortController(newAbortController);\n\n loadOptions(value, newAbortController.signal)\n .then((newValues: T[]) => {\n if (!newAbortController.signal.aborted) {\n setOptions(newValues.map(toOption));\n setAbortController(undefined);\n if (autoSubmitRef.current) {\n if (newValues.length > 0) {\n onChange(newValues.slice(0, 1));\n }\n setAutoSubmit(false);\n }\n }\n })\n .catch(console.log);\n }, [loadOptions, onChange, toOption]);\n\n const handleSearchChange = useCallback((): void => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n setAbortController(undefined);\n }\n\n if (timerRef.current !== undefined) {\n window.clearTimeout(timerRef.current);\n }\n\n const newTimer = window.setTimeout(() => handleTimer(), 100);\n setTimer(newTimer);\n }, [handleTimer]);\n\n const handleChange = useCallback(\n (values: string[]): void => {\n const result: T[] = [];\n for (const value of values) {\n let item = optionsRef.current?.find((option) => option.value === value)?.resource;\n if (!item) {\n item = (onCreate as (input: string) => T)(value);\n }\n result.push(item);\n }\n onChange(result);\n },\n [onChange, onCreate]\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent): void => {\n if (e.key === 'Enter') {\n if (!timerRef.current && !abortControllerRef.current) {\n killEvent(e);\n if (optionsRef.current && optionsRef.current.length > 0) {\n setOptions(optionsRef.current.slice(0, 1));\n handleChange([optionsRef.current[0].value]);\n }\n } else {\n // The user pressed enter, but we don't have results yet.\n // We need to wait for the results to come in.\n setAutoSubmit(true);\n }\n }\n },\n [handleChange]\n );\n\n const handleCreate = useCallback(\n (input: string): AsyncAutocompleteOption<T> => {\n const option = toOption((onCreate as (input: string) => T)(input));\n setOptions([...(optionsRef.current as AsyncAutocompleteOption<T>[]), option]);\n return option;\n },\n [onCreate, setOptions, toOption]\n );\n\n const handleFilter = useCallback((_value: string, selected: boolean) => !selected, []);\n\n useEffect(() => {\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, []);\n\n return (\n <MultiSelect\n {...rest}\n ref={inputRef}\n defaultValue={defaultItems.map(toKey)}\n searchable\n onKeyDown={handleKeyDown}\n onSearchChange={handleSearchChange}\n data={options}\n onFocus={handleTimer}\n onChange={handleChange}\n onCreate={handleCreate}\n rightSectionWidth={40}\n rightSection={abortController ? <Loader size={16} /> : null}\n filter={handleFilter}\n />\n );\n}\n\nfunction toDefaultItems<T>(defaultValue: T | T[] | undefined): T[] {\n if (!defaultValue) {\n return [];\n }\n if (Array.isArray(defaultValue)) {\n return defaultValue;\n }\n return [defaultValue];\n}\n"],"names":["React"],"mappings":";;;;AAkBM,SAAU,iBAAiB,CAAI,KAAgC,EAAA;AACnE,IAAA,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;AAC1F,IAAA,MAAM,YAAY,GAAG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Ac,CAAI,YAAiC,EAAA;IAC1D,IAAI,CAAC,YAAY,EAAE;AACjB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AACD,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AAC/B,QAAA,OAAO,YAAY,CAAC;AACrB,KAAA;IACD,OAAO,CAAC,YAAY,CAAC,CAAC;AACxB;;;;"}
1
+ {"version":3,"file":"AsyncAutocomplete.mjs","sources":["../../../src/AsyncAutocomplete/AsyncAutocomplete.tsx"],"sourcesContent":["import { Loader, MultiSelect, MultiSelectProps, SelectItem } from '@mantine/core';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { killEvent } from '../utils/dom';\n\nexport interface AsyncAutocompleteOption<T> extends SelectItem {\n resource: T;\n}\n\nexport interface AsyncAutocompleteProps<T>\n extends Omit<MultiSelectProps, 'data' | 'defaultValue' | 'loadOptions' | 'onChange' | 'onCreate' | 'searchable'> {\n defaultValue?: T | T[];\n toKey: (item: T) => string;\n toOption: (item: T) => AsyncAutocompleteOption<T>;\n loadOptions: (input: string, signal: AbortSignal) => Promise<T[]>;\n onChange: (item: T[]) => void;\n onCreate?: (input: string) => T;\n}\n\nexport function AsyncAutocomplete<T>(props: AsyncAutocompleteProps<T>): JSX.Element {\n const { defaultValue, toKey, toOption, loadOptions, onChange, onCreate, ...rest } = props;\n const defaultItems = toDefaultItems(defaultValue);\n const inputRef = useRef<HTMLInputElement>(null);\n const [lastValue, setLastValue] = useState<string | undefined>(undefined);\n const [timer, setTimer] = useState<number>();\n const [abortController, setAbortController] = useState<AbortController>();\n const [autoSubmit, setAutoSubmit] = useState<boolean>();\n const [options, setOptions] = useState<AsyncAutocompleteOption<T>[]>(defaultItems?.map(toOption));\n\n const lastValueRef = useRef<string>();\n lastValueRef.current = lastValue;\n\n const timerRef = useRef<number>();\n timerRef.current = timer;\n\n const abortControllerRef = useRef<AbortController>();\n abortControllerRef.current = abortController;\n\n const autoSubmitRef = useRef<boolean>();\n autoSubmitRef.current = autoSubmit;\n\n const optionsRef = useRef<AsyncAutocompleteOption<T>[]>();\n optionsRef.current = options;\n\n const handleTimer = useCallback((): void => {\n setTimer(undefined);\n\n const value = inputRef.current?.value?.trim() || '';\n if (value === lastValueRef.current) {\n // Nothing has changed, move on\n return;\n }\n\n setLastValue(value);\n\n const newAbortController = new AbortController();\n setAbortController(newAbortController);\n\n loadOptions(value, newAbortController.signal)\n .then((newValues: T[]) => {\n if (!newAbortController.signal.aborted) {\n setOptions(newValues.map(toOption));\n setAbortController(undefined);\n if (autoSubmitRef.current) {\n if (newValues.length > 0) {\n onChange(newValues.slice(0, 1));\n }\n setAutoSubmit(false);\n }\n }\n })\n .catch(console.log);\n }, [loadOptions, onChange, toOption]);\n\n const handleSearchChange = useCallback((): void => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n setAbortController(undefined);\n }\n\n if (timerRef.current !== undefined) {\n window.clearTimeout(timerRef.current);\n }\n\n const newTimer = window.setTimeout(() => handleTimer(), 100);\n setTimer(newTimer);\n }, [handleTimer]);\n\n const handleChange = useCallback(\n (values: string[]): void => {\n const result: T[] = [];\n for (const value of values) {\n let item = optionsRef.current?.find((option) => option.value === value)?.resource;\n if (!item) {\n item = (onCreate as (input: string) => T)(value);\n }\n result.push(item);\n }\n onChange(result);\n },\n [onChange, onCreate]\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent): void => {\n if (e.key === 'Enter') {\n if (!timerRef.current && !abortControllerRef.current) {\n killEvent(e);\n if (optionsRef.current && optionsRef.current.length > 0) {\n setOptions(optionsRef.current.slice(0, 1));\n handleChange([optionsRef.current[0].value]);\n }\n } else {\n // The user pressed enter, but we don't have results yet.\n // We need to wait for the results to come in.\n setAutoSubmit(true);\n }\n }\n },\n [handleChange]\n );\n\n const handleCreate = useCallback(\n (input: string): AsyncAutocompleteOption<T> => {\n const option = toOption((onCreate as (input: string) => T)(input));\n setOptions([...(optionsRef.current as AsyncAutocompleteOption<T>[]), option]);\n return option;\n },\n [onCreate, setOptions, toOption]\n );\n\n const handleFilter = useCallback((_value: string, selected: boolean) => !selected, []);\n\n useEffect(() => {\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, []);\n\n return (\n <MultiSelect\n {...rest}\n ref={inputRef}\n defaultValue={defaultItems.map(toKey)}\n searchable\n onKeyDown={handleKeyDown}\n onSearchChange={handleSearchChange}\n data={options}\n onFocus={handleTimer}\n onChange={handleChange}\n onCreate={handleCreate}\n rightSectionWidth={40}\n rightSection={abortController ? <Loader size={16} /> : null}\n filter={handleFilter}\n />\n );\n}\n\nfunction toDefaultItems<T>(defaultValue: T | T[] | undefined): T[] {\n if (!defaultValue) {\n return [];\n }\n if (Array.isArray(defaultValue)) {\n return defaultValue;\n }\n return [defaultValue];\n}\n"],"names":[],"mappings":";;;;AAkBM,SAAU,iBAAiB,CAAI,KAAgC,EAAA;AACnE,IAAA,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;AAC1F,IAAA,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;AAClD,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAC1E,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAU,CAAC;IAC7C,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,EAAmB,CAAC;IAC1E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,EAAW,CAAC;AACxD,IAAA,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAA+B,YAAY,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,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AAC,CAAC;IAEvF,SAAS,CAAC,MAAK;AACb,QAAA,OAAO,MAAK;YACV,IAAI,kBAAkB,CAAC,OAAO,EAAE;AAC9B,gBAAA,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;AACpC,aAAA;AACH,SAAC,CAAC;KACH,EAAE,EAAE,CAAC,CAAC;AAEP,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,WAAW,EAAA,EAAA,GACN,IAAI,EACR,GAAG,EAAE,QAAQ,EACb,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,EACrC,UAAU,EAAA,IAAA,EACV,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,kBAAkB,EAClC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,iBAAiB,EAAE,EAAE,EACrB,YAAY,EAAE,eAAe,GAAG,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,IAAI,EAAE,EAAE,GAAI,GAAG,IAAI,EAC3D,MAAM,EAAE,YAAY,EAAA,CACpB,EACF;AACJ,CAAC;AAED,SAAS,cAAc,CAAI,YAAiC,EAAA;IAC1D,IAAI,CAAC,YAAY,EAAE;AACjB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AACD,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AAC/B,QAAA,OAAO,YAAY,CAAC;AACrB,KAAA;IACD,OAAO,CAAC,YAAY,CAAC,CAAC;AACxB;;;;"}
@@ -1,10 +1,10 @@
1
- import e__default from 'react';
1
+ import React from 'react';
2
2
  import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.mjs';
3
3
 
4
4
  function AttachmentArrayDisplay(props) {
5
- return (e__default.createElement("div", null, props.values &&
6
- props.values.map((v, index) => (e__default.createElement("div", { key: 'attatchment-' + index },
7
- e__default.createElement(AttachmentDisplay, { value: v, maxWidth: props.maxWidth }))))));
5
+ return (React.createElement("div", null, props.values &&
6
+ props.values.map((v, index) => (React.createElement("div", { key: 'attatchment-' + index },
7
+ React.createElement(AttachmentDisplay, { value: v, maxWidth: props.maxWidth }))))));
8
8
  }
9
9
 
10
10
  export { AttachmentArrayDisplay };
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentArrayDisplay.mjs","sources":["../../../src/AttachmentArrayDisplay/AttachmentArrayDisplay.tsx"],"sourcesContent":["import { Attachment } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\n\nexport interface AttachmentArrayDisplayProps {\n values?: Attachment[];\n maxWidth?: number;\n}\n\nexport function AttachmentArrayDisplay(props: AttachmentArrayDisplayProps): JSX.Element {\n return (\n <div>\n {props.values &&\n props.values.map((v, index) => (\n <div key={'attatchment-' + index}>\n <AttachmentDisplay value={v} maxWidth={props.maxWidth} />\n </div>\n ))}\n </div>\n );\n}\n"],"names":["React"],"mappings":";;;AASM,SAAU,sBAAsB,CAAC,KAAkC,EAAA;AACvE,IAAA,QACEA,UAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EACG,KAAK,CAAC,MAAM;AACX,QAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MACxBA,UAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,cAAc,GAAG,KAAK,EAAA;AAC9B,YAAAA,UAAA,CAAA,aAAA,CAAC,iBAAiB,EAAC,EAAA,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAI,CAAA,CACrD,CACP,CAAC,CACA,EACN;AACJ;;;;"}
1
+ {"version":3,"file":"AttachmentArrayDisplay.mjs","sources":["../../../src/AttachmentArrayDisplay/AttachmentArrayDisplay.tsx"],"sourcesContent":["import { Attachment } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\n\nexport interface AttachmentArrayDisplayProps {\n values?: Attachment[];\n maxWidth?: number;\n}\n\nexport function AttachmentArrayDisplay(props: AttachmentArrayDisplayProps): JSX.Element {\n return (\n <div>\n {props.values &&\n props.values.map((v, index) => (\n <div key={'attatchment-' + index}>\n <AttachmentDisplay value={v} maxWidth={props.maxWidth} />\n </div>\n ))}\n </div>\n );\n}\n"],"names":[],"mappings":";;;AASM,SAAU,sBAAsB,CAAC,KAAkC,EAAA;AACvE,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EACG,KAAK,CAAC,MAAM;AACX,QAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MACxB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,cAAc,GAAG,KAAK,EAAA;AAC9B,YAAA,KAAA,CAAA,aAAA,CAAC,iBAAiB,EAAC,EAAA,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAI,CAAA,CACrD,CACP,CAAC,CACA,EACN;AACJ;;;;"}
@@ -1,9 +1,10 @@
1
1
  import { ActionIcon } from '@mantine/core';
2
- import { IconCircleMinus as IP, IconCloudUpload as XA } from '../node_modules/@tabler/icons/icons-react/dist/index.esm.mjs';
3
- import e__default, { useState, useRef } from 'react';
2
+ import React, { useState, useRef } from 'react';
4
3
  import { AttachmentButton } from '../AttachmentButton/AttachmentButton.mjs';
5
4
  import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.mjs';
6
5
  import { killEvent } from '../utils/dom.mjs';
6
+ import IconCircleMinus from '../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs';
7
+ import IconCloudUpload from '../node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs';
7
8
 
8
9
  function AttachmentArrayInput(props) {
9
10
  const [values, setValues] = useState(props.defaultValue ?? []);
@@ -15,29 +16,29 @@ function AttachmentArrayInput(props) {
15
16
  props.onChange(newValues);
16
17
  }
17
18
  }
18
- return (e__default.createElement("table", { style: { width: '100%' } },
19
- e__default.createElement("colgroup", null,
20
- e__default.createElement("col", { width: "97%" }),
21
- e__default.createElement("col", { width: "3%" })),
22
- e__default.createElement("tbody", null,
23
- values.map((v, index) => (e__default.createElement("tr", { key: `${index}-${values.length}` },
24
- e__default.createElement("td", null,
25
- e__default.createElement(AttachmentDisplay, { value: v, maxWidth: 200 })),
26
- e__default.createElement("td", null,
27
- e__default.createElement(ActionIcon, { title: "Remove", size: "sm", onClick: (e) => {
19
+ return (React.createElement("table", { style: { width: '100%' } },
20
+ React.createElement("colgroup", null,
21
+ React.createElement("col", { width: "97%" }),
22
+ React.createElement("col", { width: "3%" })),
23
+ React.createElement("tbody", null,
24
+ values.map((v, index) => (React.createElement("tr", { key: `${index}-${values.length}` },
25
+ React.createElement("td", null,
26
+ React.createElement(AttachmentDisplay, { value: v, maxWidth: 200 })),
27
+ React.createElement("td", null,
28
+ React.createElement(ActionIcon, { title: "Remove", size: "sm", onClick: (e) => {
28
29
  killEvent(e);
29
30
  const copy = values.slice();
30
31
  copy.splice(index, 1);
31
32
  setValuesWrapper(copy);
32
33
  } },
33
- e__default.createElement(IP, null)))))),
34
- e__default.createElement("tr", null,
35
- e__default.createElement("td", null),
36
- e__default.createElement("td", null,
37
- e__default.createElement(AttachmentButton, { onUpload: (attachment) => {
34
+ React.createElement(IconCircleMinus, null)))))),
35
+ React.createElement("tr", null,
36
+ React.createElement("td", null),
37
+ React.createElement("td", null,
38
+ React.createElement(AttachmentButton, { onUpload: (attachment) => {
38
39
  setValuesWrapper([...valuesRef.current, attachment]);
39
- } }, (props) => (e__default.createElement(ActionIcon, { ...props, title: "Add", size: "sm", color: "green" },
40
- e__default.createElement(XA, { size: 16 })))))))));
40
+ } }, (props) => (React.createElement(ActionIcon, { ...props, title: "Add", size: "sm", color: "green" },
41
+ React.createElement(IconCloudUpload, { size: 16 })))))))));
41
42
  }
42
43
 
43
44
  export { AttachmentArrayInput };
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentArrayInput.mjs","sources":["../../../src/AttachmentArrayInput/AttachmentArrayInput.tsx"],"sourcesContent":["import { ActionIcon } from '@mantine/core';\nimport { Attachment } from '@medplum/fhirtypes';\nimport { IconCircleMinus, IconCloudUpload } from '@tabler/icons';\nimport React, { useRef, useState } from 'react';\nimport { AttachmentButton } from '../AttachmentButton/AttachmentButton';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\nimport { killEvent } from '../utils/dom';\n\nexport interface AttachmentArrayInputProps {\n name: string;\n defaultValue?: Attachment[];\n arrayElement?: boolean;\n onChange?: (value: Attachment[]) => void;\n}\n\nexport function AttachmentArrayInput(props: AttachmentArrayInputProps): JSX.Element {\n const [values, setValues] = useState<Attachment[]>(props.defaultValue ?? []);\n\n const valuesRef = useRef<Attachment[]>();\n valuesRef.current = values;\n\n function setValuesWrapper(newValues: Attachment[]): void {\n setValues(newValues);\n if (props.onChange) {\n props.onChange(newValues);\n }\n }\n\n return (\n <table style={{ width: '100%' }}>\n <colgroup>\n <col width=\"97%\" />\n <col width=\"3%\" />\n </colgroup>\n <tbody>\n {values.map((v: Attachment, index: number) => (\n <tr key={`${index}-${values.length}`}>\n <td>\n <AttachmentDisplay value={v} maxWidth={200} />\n </td>\n <td>\n <ActionIcon\n title=\"Remove\"\n size=\"sm\"\n onClick={(e: React.MouseEvent) => {\n killEvent(e);\n const copy = values.slice();\n copy.splice(index, 1);\n setValuesWrapper(copy);\n }}\n >\n <IconCircleMinus />\n </ActionIcon>\n </td>\n </tr>\n ))}\n <tr>\n <td></td>\n <td>\n <AttachmentButton\n onUpload={(attachment: Attachment) => {\n setValuesWrapper([...(valuesRef.current as Attachment[]), attachment]);\n }}\n >\n {(props) => (\n <ActionIcon {...props} title=\"Add\" size=\"sm\" color=\"green\">\n <IconCloudUpload size={16} />\n </ActionIcon>\n )}\n </AttachmentButton>\n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A,aAAA,CAAA,IAAA,EAAA,IAAA;AACE,oBAAAA,UAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACT,KAAK,EAAC,QAAQ,EACd,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,CAAC,CAAmB,KAAI;4BAC/B,SAAS,CAAC,CAAC,CAAC,CAAC;AACb,4BAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5B,4BAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BACtB,gBAAgB,CAAC,IAAI,CAAC,CAAC;yBACxB,EAAA;AAED,wBAAAA,UAAA,CAAA,aAAA,CAACC,EAAe,EAAG,IAAA,CAAA,CACR,CACV,CACF,CACN,CAAC;AACF,YAAAD,UAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;gBACEA,UAAS,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,CAAA;AACT,gBAAAA,UAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;AACE,oBAAAA,UAAA,CAAA,aAAA,CAAC,gBAAgB,EACf,EAAA,QAAQ,EAAE,CAAC,UAAsB,KAAI;4BACnC,gBAAgB,CAAC,CAAC,GAAI,SAAS,CAAC,OAAwB,EAAE,UAAU,CAAC,CAAC,CAAC;yBACxE,EAAA,EAEA,CAAC,KAAK,MACLA,UAAC,CAAA,aAAA,CAAA,UAAU,EAAK,EAAA,GAAA,KAAK,EAAE,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO,EAAA;AACxD,wBAAAA,UAAA,CAAA,aAAA,CAACE,EAAe,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA,CAClB,CACd,CACgB,CAChB,CACF,CACC,CACF,EACR;AACJ;;;;"}
1
+ {"version":3,"file":"AttachmentArrayInput.mjs","sources":["../../../src/AttachmentArrayInput/AttachmentArrayInput.tsx"],"sourcesContent":["import { ActionIcon } from '@mantine/core';\nimport { Attachment } from '@medplum/fhirtypes';\nimport { IconCircleMinus, IconCloudUpload } from '@tabler/icons-react';\nimport React, { useRef, useState } from 'react';\nimport { AttachmentButton } from '../AttachmentButton/AttachmentButton';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\nimport { killEvent } from '../utils/dom';\n\nexport interface AttachmentArrayInputProps {\n name: string;\n defaultValue?: Attachment[];\n arrayElement?: boolean;\n onChange?: (value: Attachment[]) => void;\n}\n\nexport function AttachmentArrayInput(props: AttachmentArrayInputProps): JSX.Element {\n const [values, setValues] = useState<Attachment[]>(props.defaultValue ?? []);\n\n const valuesRef = useRef<Attachment[]>();\n valuesRef.current = values;\n\n function setValuesWrapper(newValues: Attachment[]): void {\n setValues(newValues);\n if (props.onChange) {\n props.onChange(newValues);\n }\n }\n\n return (\n <table style={{ width: '100%' }}>\n <colgroup>\n <col width=\"97%\" />\n <col width=\"3%\" />\n </colgroup>\n <tbody>\n {values.map((v: Attachment, index: number) => (\n <tr key={`${index}-${values.length}`}>\n <td>\n <AttachmentDisplay value={v} maxWidth={200} />\n </td>\n <td>\n <ActionIcon\n title=\"Remove\"\n size=\"sm\"\n onClick={(e: React.MouseEvent) => {\n killEvent(e);\n const copy = values.slice();\n copy.splice(index, 1);\n setValuesWrapper(copy);\n }}\n >\n <IconCircleMinus />\n </ActionIcon>\n </td>\n </tr>\n ))}\n <tr>\n <td></td>\n <td>\n <AttachmentButton\n onUpload={(attachment: Attachment) => {\n setValuesWrapper([...(valuesRef.current as Attachment[]), attachment]);\n }}\n >\n {(props) => (\n <ActionIcon {...props} title=\"Add\" size=\"sm\" color=\"green\">\n <IconCloudUpload size={16} />\n </ActionIcon>\n )}\n </AttachmentButton>\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAeM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAe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AC;AACb,4BAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5B,4BAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BACtB,gBAAgB,CAAC,IAAI,CAAC,CAAC;yBACxB,EAAA;AAED,wBAAA,KAAA,CAAA,aAAA,CAAC,eAAe,EAAG,IAAA,CAAA,CACR,CACV,CACF,CACN,CAAC;AACF,YAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;gBACE,KAAS,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,CAAA;AACT,gBAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;AACE,oBAAA,KAAA,CAAA,aAAA,CAAC,gBAAgB,EACf,EAAA,QAAQ,EAAE,CAAC,UAAsB,KAAI;4BACnC,gBAAgB,CAAC,CAAC,GAAI,SAAS,CAAC,OAAwB,EAAE,UAAU,CAAC,CAAC,CAAC;yBACxE,EAAA,EAEA,CAAC,KAAK,MACL,KAAC,CAAA,aAAA,CAAA,UAAU,EAAK,EAAA,GAAA,KAAK,EAAE,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO,EAAA;AACxD,wBAAA,KAAA,CAAA,aAAA,CAAC,eAAe,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA,CAClB,CACd,CACgB,CAChB,CACF,CACC,CACF,EACR;AACJ;;;;"}
@@ -1,4 +1,4 @@
1
- import e__default, { useRef } from 'react';
1
+ import React, { useRef } from 'react';
2
2
  import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
3
3
  import { killEvent } from '../utils/dom.mjs';
4
4
 
@@ -47,8 +47,8 @@ function AttachmentButton(props) {
47
47
  alert(outcome?.issue?.[0]?.details?.text);
48
48
  });
49
49
  }
50
- return (e__default.createElement(e__default.Fragment, null,
51
- e__default.createElement("input", { type: "file", "data-testid": "upload-file-input", style: { display: 'none' }, ref: fileInputRef, onChange: (e) => onFileChange(e) }),
50
+ return (React.createElement(React.Fragment, null,
51
+ React.createElement("input", { type: "file", "data-testid": "upload-file-input", style: { display: 'none' }, ref: fileInputRef, onChange: (e) => onFileChange(e) }),
52
52
  props.children({ onClick })));
53
53
  }
54
54
 
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentButton.mjs","sources":["../../../src/AttachmentButton/AttachmentButton.tsx"],"sourcesContent":["import { Attachment, Binary, OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useRef } from 'react';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { killEvent } from '../utils/dom';\n\nexport interface AttachmentButtonProps {\n onUpload: (attachment: Attachment) => void;\n onUploadStart?: () => void;\n onUploadProgress?: (e: ProgressEvent) => void;\n children(props: { onClick(e: React.MouseEvent): void }): React.ReactNode;\n}\n\nexport function AttachmentButton(props: AttachmentButtonProps): JSX.Element {\n const medplum = useMedplum();\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n function onClick(e: React.MouseEvent): void {\n killEvent(e);\n fileInputRef.current?.click();\n }\n\n function onFileChange(e: React.ChangeEvent): void {\n killEvent(e);\n const files = (e.target as HTMLInputElement).files;\n if (files) {\n Array.from(files).forEach(processFile);\n }\n }\n\n /**\n * Processes a single file.\n *\n * @param {File} file The file descriptor.\n */\n function processFile(file: File): void {\n if (!file) {\n return;\n }\n\n const fileName = file.name;\n if (!fileName) {\n return;\n }\n\n if (props.onUploadStart) {\n props.onUploadStart();\n }\n\n const filename = file.name;\n const contentType = file.type || 'application/octet-stream';\n medplum\n .createBinary(file, filename, contentType, props.onUploadProgress)\n .then((binary: Binary) => {\n props.onUpload({\n contentType: binary.contentType,\n url: binary.url,\n title: filename,\n });\n })\n .catch((outcome: OperationOutcome) => {\n alert(outcome?.issue?.[0]?.details?.text);\n });\n }\n\n return (\n <>\n <input\n type=\"file\"\n data-testid=\"upload-file-input\"\n style={{ display: 'none' }}\n ref={fileInputRef}\n onChange={(e) => onFileChange(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AC/B,GAAG,EAAE,MAAM,CAAC,GAAG;AACf,gBAAA,KAAK,EAAE,QAAQ;AAChB,aAAA,CAAC,CAAC;AACL,SAAC,CAAC;AACD,aAAA,KAAK,CAAC,CAAC,OAAyB,KAAI;AACnC,YAAA,KAAK,CAAC,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5C,SAAC,CAAC,CAAC;KACN;AAED,IAAA,QACEA,UAAA,CAAA,aAAA,CAAAA,UAAA,CAAA,QAAA,EAAA,IAAA;AACE,QAAAA,UAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAC,MAAM,EAAA,aAAA,EACC,mBAAmB,EAC/B,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC1B,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,EAChC,CAAA;QACD,KAAK,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAC3B,EACH;AACJ;;;;"}
1
+ {"version":3,"file":"AttachmentButton.mjs","sources":["../../../src/AttachmentButton/AttachmentButton.tsx"],"sourcesContent":["import { Attachment, Binary, OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useRef } from 'react';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { killEvent } from '../utils/dom';\n\nexport interface AttachmentButtonProps {\n onUpload: (attachment: Attachment) => void;\n onUploadStart?: () => void;\n onUploadProgress?: (e: ProgressEvent) => void;\n children(props: { onClick(e: React.MouseEvent): void }): React.ReactNode;\n}\n\nexport function AttachmentButton(props: AttachmentButtonProps): JSX.Element {\n const medplum = useMedplum();\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n function onClick(e: React.MouseEvent): void {\n killEvent(e);\n fileInputRef.current?.click();\n }\n\n function onFileChange(e: React.ChangeEvent): void {\n killEvent(e);\n const files = (e.target as HTMLInputElement).files;\n if (files) {\n Array.from(files).forEach(processFile);\n }\n }\n\n /**\n * Processes a single file.\n *\n * @param {File} file The file descriptor.\n */\n function processFile(file: File): void {\n if (!file) {\n return;\n }\n\n const fileName = file.name;\n if (!fileName) {\n return;\n }\n\n if (props.onUploadStart) {\n props.onUploadStart();\n }\n\n const filename = file.name;\n const contentType = file.type || 'application/octet-stream';\n medplum\n .createBinary(file, filename, contentType, props.onUploadProgress)\n .then((binary: Binary) => {\n props.onUpload({\n contentType: binary.contentType,\n url: binary.url,\n title: filename,\n });\n })\n .catch((outcome: OperationOutcome) => {\n alert(outcome?.issue?.[0]?.details?.text);\n });\n }\n\n return (\n <>\n <input\n type=\"file\"\n data-testid=\"upload-file-input\"\n style={{ display: 'none' }}\n ref={fileInputRef}\n onChange={(e) => onFileChange(e)}\n />\n {props.children({ onClick })}\n </>\n );\n}\n"],"names":[],"mappings":";;;;AAYM,SAAU,gBAAgB,CAAC,KAA4B,EAAA;AAC3D,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAC7B,IAAA,MAAM,YAAY,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEpD,SAAS,OAAO,CAAC,CAAmB,EAAA;QAClC,SAAS,CAAC,CAAC,CAAC,CAAC;AACb,QAAA,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;KAC/B;IAED,SAAS,YAAY,CAAC,CAAoB,EAAA;QACxC,SAAS,CAAC,CAAC,CAAC,CAAC;AACb,QAAA,MAAM,KAAK,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;AACnD,QAAA,IAAI,KAAK,EAAE;YACT,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACxC,SAAA;KACF;AAED;;;;AAIG;IACH,SAAS,WAAW,CAAC,IAAU,EAAA;QAC7B,IAAI,CAAC,IAAI,EAAE;YACT,OAAO;AACR,SAAA;AAED,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,I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
4
  function AttachmentDisplay(props) {
5
5
  const value = props.value;
@@ -7,14 +7,14 @@ function AttachmentDisplay(props) {
7
7
  if (!url) {
8
8
  return null;
9
9
  }
10
- return (e__default.createElement("div", { "data-testid": "attachment-display" },
11
- contentType?.startsWith('image/') && (e__default.createElement("img", { "data-testid": "attachment-image", style: { maxWidth: props.maxWidth }, src: url, alt: value?.title })),
12
- contentType?.startsWith('video/') && (e__default.createElement("video", { "data-testid": "attachment-video", style: { maxWidth: props.maxWidth }, controls: true },
13
- e__default.createElement("source", { type: contentType, src: url }))),
14
- contentType === 'application/pdf' && !title?.endsWith('.pdf') && (e__default.createElement("div", { "data-testid": "attachment-pdf", style: { maxWidth: props.maxWidth, minHeight: 400 } },
15
- e__default.createElement("iframe", { width: "100%", height: "400", src: url + '#navpanes=0', allowFullScreen: true, frameBorder: 0, seamless: true }))),
16
- e__default.createElement("div", { "data-testid": "download-link", style: { padding: '2px 16px 16px 16px' } },
17
- e__default.createElement(Anchor, { href: value?.url, "data-testid": "attachment-details", target: "_blank", rel: "noopener noreferrer" }, value?.title || 'Download'))));
10
+ return (React.createElement("div", { "data-testid": "attachment-display" },
11
+ contentType?.startsWith('image/') && (React.createElement("img", { "data-testid": "attachment-image", style: { maxWidth: props.maxWidth }, src: url, alt: value?.title })),
12
+ contentType?.startsWith('video/') && (React.createElement("video", { "data-testid": "attachment-video", style: { maxWidth: props.maxWidth }, controls: true },
13
+ React.createElement("source", { type: contentType, src: url }))),
14
+ contentType === 'application/pdf' && !title?.endsWith('.pdf') && (React.createElement("div", { "data-testid": "attachment-pdf", style: { maxWidth: props.maxWidth, minHeight: 400 } },
15
+ React.createElement("iframe", { width: "100%", height: "400", src: url + '#navpanes=0', allowFullScreen: true, frameBorder: 0, seamless: true }))),
16
+ React.createElement("div", { "data-testid": "download-link", style: { padding: '2px 16px 16px 16px' } },
17
+ React.createElement(Anchor, { href: value?.url, "data-testid": "attachment-details", target: "_blank", rel: "noopener noreferrer" }, value?.title || 'Download'))));
18
18
  }
19
19
 
20
20
  export { AttachmentDisplay };
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentDisplay.mjs","sources":["../../../src/AttachmentDisplay/AttachmentDisplay.tsx"],"sourcesContent":["import { Anchor } from '@mantine/core';\nimport { Attachment } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface AttachmentDisplayProps {\n value?: Attachment;\n maxWidth?: number;\n}\n\nexport function AttachmentDisplay(props: AttachmentDisplayProps): JSX.Element | null {\n const value = props.value;\n const { contentType, url, title } = value ?? {};\n\n if (!url) {\n return null;\n }\n\n return (\n <div data-testid=\"attachment-display\">\n {contentType?.startsWith('image/') && (\n <img data-testid=\"attachment-image\" style={{ maxWidth: props.maxWidth }} src={url} alt={value?.title} />\n )}\n {contentType?.startsWith('video/') && (\n <video data-testid=\"attachment-video\" style={{ maxWidth: props.maxWidth }} controls={true}>\n <source type={contentType} src={url} />\n </video>\n )}\n {contentType === 'application/pdf' && !title?.endsWith('.pdf') && (\n <div data-testid=\"attachment-pdf\" style={{ maxWidth: props.maxWidth, minHeight: 400 }}>\n <iframe\n width=\"100%\"\n height=\"400\"\n src={url + '#navpanes=0'}\n allowFullScreen={true}\n frameBorder={0}\n seamless={true}\n />\n </div>\n )}\n <div data-testid=\"download-link\" style={{ padding: '2px 16px 16px 16px' }}>\n <Anchor href={value?.url} data-testid=\"attachment-details\" target=\"_blank\" rel=\"noopener noreferrer\">\n {value?.title || 'Download'}\n </Anchor>\n </div>\n </div>\n );\n}\n"],"names":["React"],"mappings":";;;AASM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;IAEhD,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;IAED,QACEA,iDAAiB,oBAAoB,EAAA;A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GAAG,EAAc,aAAA,EAAA,oBAAoB,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,EACjG,EAAA,KAAK,EAAE,KAAK,IAAI,UAAU,CACpB,CACL,CACF,EACN;AACJ;;;;"}
1
+ {"version":3,"file":"AttachmentDisplay.mjs","sources":["../../../src/AttachmentDisplay/AttachmentDisplay.tsx"],"sourcesContent":["import { Anchor } from '@mantine/core';\nimport { Attachment } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface AttachmentDisplayProps {\n value?: Attachment;\n maxWidth?: number;\n}\n\nexport function AttachmentDisplay(props: AttachmentDisplayProps): JSX.Element | null {\n const value = props.value;\n const { contentType, url, title } = value ?? {};\n\n if (!url) {\n return null;\n }\n\n return (\n <div data-testid=\"attachment-display\">\n {contentType?.startsWith('image/') && (\n <img data-testid=\"attachment-image\" style={{ maxWidth: props.maxWidth }} src={url} alt={value?.title} />\n )}\n {contentType?.startsWith('video/') && (\n <video data-testid=\"attachment-video\" style={{ maxWidth: props.maxWidth }} controls={true}>\n <source type={contentType} src={url} />\n </video>\n )}\n {contentType === 'application/pdf' && !title?.endsWith('.pdf') && (\n <div data-testid=\"attachment-pdf\" style={{ maxWidth: props.maxWidth, minHeight: 400 }}>\n <iframe\n width=\"100%\"\n height=\"400\"\n src={url + '#navpanes=0'}\n allowFullScreen={true}\n frameBorder={0}\n seamless={true}\n />\n </div>\n )}\n <div data-testid=\"download-link\" style={{ padding: '2px 16px 16px 16px' }}>\n <Anchor href={value?.url} data-testid=\"attachment-details\" target=\"_blank\" rel=\"noopener noreferrer\">\n {value?.title || 'Download'}\n </Anchor>\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;AASM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;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AE,oBAAoB,EAAE,EAAA;YACvE,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,IAAI,EAAE,KAAK,EAAE,GAAG,EAAc,aAAA,EAAA,oBAAoB,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,EACjG,EAAA,KAAK,EAAE,KAAK,IAAI,UAAU,CACpB,CACL,CACF,EACN;AACJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { Button } from '@mantine/core';
2
- import e__default, { useState } from 'react';
2
+ import React, { useState } from 'react';
3
3
  import { AttachmentButton } from '../AttachmentButton/AttachmentButton.mjs';
4
4
  import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.mjs';
5
5
  import { killEvent } from '../utils/dom.mjs';
@@ -13,14 +13,14 @@ function AttachmentInput(props) {
13
13
  }
14
14
  }
15
15
  if (value) {
16
- return (e__default.createElement(e__default.Fragment, null,
17
- e__default.createElement(AttachmentDisplay, { value: value, maxWidth: 200 }),
18
- e__default.createElement(Button, { onClick: (e) => {
16
+ return (React.createElement(React.Fragment, null,
17
+ React.createElement(AttachmentDisplay, { value: value, maxWidth: 200 }),
18
+ React.createElement(Button, { onClick: (e) => {
19
19
  killEvent(e);
20
20
  setValueWrapper(undefined);
21
21
  } }, "Remove")));
22
22
  }
23
- return (e__default.createElement(AttachmentButton, { onUpload: setValueWrapper }, (props) => e__default.createElement(Button, { ...props }, "Upload...")));
23
+ return (React.createElement(AttachmentButton, { onUpload: setValueWrapper }, (props) => React.createElement(Button, { ...props }, "Upload...")));
24
24
  }
25
25
 
26
26
  export { AttachmentInput };
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentInput.mjs","sources":["../../../src/AttachmentInput/AttachmentInput.tsx"],"sourcesContent":["import { Button } from '@mantine/core';\nimport { Attachment } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { AttachmentButton } from '../AttachmentButton/AttachmentButton';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\nimport { killEvent } from '../utils/dom';\n\nexport interface AttachmentInputProps {\n name: string;\n defaultValue?: Attachment;\n arrayElement?: boolean;\n onChange?: (value: Attachment | undefined) => void;\n}\n\nexport function AttachmentInput(props: AttachmentInputProps): JSX.Element {\n const [value, setValue] = useState(props.defaultValue);\n\n function setValueWrapper(newValue: Attachment | undefined): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n if (value) {\n return (\n <>\n <AttachmentDisplay value={value} maxWidth={200} />\n <Button\n onClick={(e: React.MouseEvent) => {\n killEvent(e);\n setValueWrapper(undefined);\n }}\n >\n Remove\n </Button>\n </>\n );\n }\n\n return (\n <AttachmentButton onUpload={setValueWrapper}>{(props) => <Button {...props}>Upload...</Button>}</AttachmentButton>\n );\n}\n"],"names":["React"],"mappings":";;;;;;AAcM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEvD,SAAS,eAAe,CAAC,QAAgC,EAAA;QACvD,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;AAED,IAAA,IAAI,KAAK,EAAE;AACT,QAAA,QACEA,UAAA,CAAA,aAAA,CAAAA,UAAA,CAAA,QAAA,EAAA,IAAA;YACEA,UAAC,CAAA,aAAA,CAAA,iBAAiB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAI,CAAA;AAClD,YAAAA,UAAA,CAAA,aAAA,CAAC,MAAM,EACL,EAAA,OAAO,EAAE,CAAC,CAAmB,KAAI;oBAC/B,SAAS,CAAC,CAAC,CAAC,CAAC;oBACb,eAAe,CAAC,SAAS,CAAC,CAAC;iBAC5B,EAAA,EAAA,QAAA,CAGM,CACR,EACH;AACH,KAAA;IAED,QACEA,yBAAC,gBAAgB,EAAA,EAAC,QAAQ,EAAE,eAAe,IAAG,CAAC,KAAK,KAAKA,yBAAC,MAAM,EAAA,EAAA,GAAK,KAAK,EAAoB,EAAA,WAAA,CAAA,CAAoB,EAClH;AACJ;;;;"}
1
+ {"version":3,"file":"AttachmentInput.mjs","sources":["../../../src/AttachmentInput/AttachmentInput.tsx"],"sourcesContent":["import { Button } from '@mantine/core';\nimport { Attachment } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { AttachmentButton } from '../AttachmentButton/AttachmentButton';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\nimport { killEvent } from '../utils/dom';\n\nexport interface AttachmentInputProps {\n name: string;\n defaultValue?: Attachment;\n arrayElement?: boolean;\n onChange?: (value: Attachment | undefined) => void;\n}\n\nexport function AttachmentInput(props: AttachmentInputProps): JSX.Element {\n const [value, setValue] = useState(props.defaultValue);\n\n function setValueWrapper(newValue: Attachment | undefined): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n if (value) {\n return (\n <>\n <AttachmentDisplay value={value} maxWidth={200} />\n <Button\n onClick={(e: React.MouseEvent) => {\n killEvent(e);\n setValueWrapper(undefined);\n }}\n >\n Remove\n </Button>\n </>\n );\n }\n\n return (\n <AttachmentButton onUpload={setValueWrapper}>{(props) => <Button {...props}>Upload...</Button>}</AttachmentButton>\n );\n}\n"],"names":[],"mappings":";;;;;;AAcM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEvD,SAAS,eAAe,CAAC,QAAgC,EAAA;QACvD,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;AAED,IAAA,IAAI,KAAK,EAAE;AACT,QAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;YACE,KAAC,CAAA,aAAA,CAAA,iBAAiB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAI,CAAA;AAClD,YAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EACL,EAAA,OAAO,EAAE,CAAC,CAAmB,KAAI;oBAC/B,SAAS,CAAC,CAAC,CAAC,CAAC;oBACb,eAAe,CAAC,SAAS,CAAC,CAAC;iBAC5B,EAAA,EAAA,QAAA,CAGM,CACR,EACH;AACH,KAAA;IAED,QACE,oBAAC,gBAAgB,EAAA,EAAC,QAAQ,EAAE,eAAe,IAAG,CAAC,KAAK,KAAK,oBAAC,MAAM,EAAA,EAAA,GAAK,KAAK,EAAoB,EAAA,WAAA,CAAA,CAAoB,EAClH;AACJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { globalSchema, getPropertyDisplayName } from '@medplum/core';
2
- import e__default from 'react';
2
+ import React from 'react';
3
3
  import { DEFAULT_IGNORED_PROPERTIES } from '../constants.mjs';
4
4
  import { DescriptionList, DescriptionListEntry } from '../DescriptionList/DescriptionList.mjs';
5
5
  import { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
@@ -13,7 +13,7 @@ function BackboneElementDisplay(props) {
13
13
  const typeName = typedValue.type;
14
14
  const typeSchema = globalSchema.types[typeName];
15
15
  if (!typeSchema) {
16
- return e__default.createElement("div", null,
16
+ return React.createElement("div", null,
17
17
  typeName,
18
18
  "\u00A0not implemented");
19
19
  }
@@ -24,9 +24,9 @@ function BackboneElementDisplay(props) {
24
24
  // Special case for common BackboneElement pattern
25
25
  // Where there is an object with a single property 'name'
26
26
  // Just display the name value.
27
- return e__default.createElement("div", null, value.name);
27
+ return React.createElement("div", null, value.name);
28
28
  }
29
- return (e__default.createElement(DescriptionList, { compact: props.compact }, Object.entries(typeSchema.properties).map((entry) => {
29
+ return (React.createElement(DescriptionList, { compact: props.compact }, Object.entries(typeSchema.properties).map((entry) => {
30
30
  const key = entry[0];
31
31
  if (DEFAULT_IGNORED_PROPERTIES.indexOf(key) >= 0) {
32
32
  return null;
@@ -40,8 +40,8 @@ function BackboneElementDisplay(props) {
40
40
  (!propertyValue || (Array.isArray(propertyValue) && propertyValue.length === 0))) {
41
41
  return null;
42
42
  }
43
- return (e__default.createElement(DescriptionListEntry, { key: key, term: getPropertyDisplayName(key) },
44
- e__default.createElement(ResourcePropertyDisplay, { property: property, propertyType: propertyType, value: propertyValue, ignoreMissingValues: props.ignoreMissingValues, link: props.link })));
43
+ return (React.createElement(DescriptionListEntry, { key: key, term: getPropertyDisplayName(key) },
44
+ React.createElement(ResourcePropertyDisplay, { property: property, propertyType: propertyType, value: propertyValue, ignoreMissingValues: props.ignoreMissingValues, link: props.link })));
45
45
  })));
46
46
  }
47
47
 
@@ -1 +1 @@
1
- {"version":3,"file":"BackboneElementDisplay.mjs","sources":["../../../src/BackboneElementDisplay/BackboneElementDisplay.tsx"],"sourcesContent":["import { getPropertyDisplayName, globalSchema, TypedValue } from '@medplum/core';\nimport React from 'react';\nimport { DEFAULT_IGNORED_PROPERTIES } from '../constants';\nimport { DescriptionList, DescriptionListEntry } from '../DescriptionList/DescriptionList';\nimport { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay';\n\nexport interface BackboneElementDisplayProps {\n value: TypedValue;\n compact?: boolean;\n ignoreMissingValues?: boolean;\n link?: boolean;\n}\n\nexport function BackboneElementDisplay(props: BackboneElementDisplayProps): JSX.Element | null {\n const typedValue = props.value;\n const value = typedValue.value;\n if (!value) {\n return null;\n }\n\n const typeName = typedValue.type;\n const typeSchema = globalSchema.types[typeName];\n if (!typeSchema) {\n return <div>{typeName}&nbsp;not implemented</div>;\n }\n\n if (\n typeof value === 'object' &&\n 'name' in value &&\n Object.keys(value).length === 1 &&\n typeof value.name === 'string'\n ) {\n // Special case for common BackboneElement pattern\n // Where there is an object with a single property 'name'\n // Just display the name value.\n return <div>{value.name}</div>;\n }\n\n return (\n <DescriptionList compact={props.compact}>\n {Object.entries(typeSchema.properties).map((entry) => {\n const key = entry[0];\n if (DEFAULT_IGNORED_PROPERTIES.indexOf(key) >= 0) {\n return null;\n }\n const property = entry[1];\n if (!property.path) {\n property.path = typeName + '.' + key;\n }\n const [propertyValue, propertyType] = getValueAndType(typedValue, key);\n if (\n props.ignoreMissingValues &&\n (!propertyValue || (Array.isArray(propertyValue) && propertyValue.length === 0))\n ) {\n return null;\n }\n return (\n <DescriptionListEntry key={key} term={getPropertyDisplayName(key)}>\n <ResourcePropertyDisplay\n property={property}\n propertyType={propertyType}\n value={propertyValue}\n ignoreMissingValues={props.ignoreMissingValues}\n link={props.link}\n />\n </DescriptionListEntry>\n );\n })}\n </DescriptionList>\n );\n}\n"],"names":["React"],"mappings":";;;;;;AAaM,SAAU,sBAAsB,CAAC,KAAkC,EAAA;AACvE,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;AAC/B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;IACjC,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,UAAU,EAAE;QACf,OAAOA,UAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YAAM,QAAQ;oCAA4B,CAAC;AACnD,KAAA;IAED,IACE,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,MAAM,IAAI,KAAK;QACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC;AAC/B,QAAA,OAAO,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AAa,EACpB,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,IAAI,EAAE,KAAK,CAAC,IAAI,EAAA,CAChB,CACmB,EACvB;KACH,CAAC,CACc,EAClB;AACJ;;;;"}
1
+ {"version":3,"file":"BackboneElementDisplay.mjs","sources":["../../../src/BackboneElementDisplay/BackboneElementDisplay.tsx"],"sourcesContent":["import { getPropertyDisplayName, globalSchema, TypedValue } from '@medplum/core';\nimport React from 'react';\nimport { DEFAULT_IGNORED_PROPERTIES } from '../constants';\nimport { DescriptionList, DescriptionListEntry } from '../DescriptionList/DescriptionList';\nimport { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay';\n\nexport interface BackboneElementDisplayProps {\n value: TypedValue;\n compact?: boolean;\n ignoreMissingValues?: boolean;\n link?: boolean;\n}\n\nexport function BackboneElementDisplay(props: BackboneElementDisplayProps): JSX.Element | null {\n const typedValue = props.value;\n const value = typedValue.value;\n if (!value) {\n return null;\n }\n\n const typeName = typedValue.type;\n const typeSchema = globalSchema.types[typeName];\n if (!typeSchema) {\n return <div>{typeName}&nbsp;not implemented</div>;\n }\n\n if (\n typeof value === 'object' &&\n 'name' in value &&\n Object.keys(value).length === 1 &&\n typeof value.name === 'string'\n ) {\n // Special case for common BackboneElement pattern\n // Where there is an object with a single property 'name'\n // Just display the name value.\n return <div>{value.name}</div>;\n }\n\n return (\n <DescriptionList compact={props.compact}>\n {Object.entries(typeSchema.properties).map((entry) => {\n const key = entry[0];\n if (DEFAULT_IGNORED_PROPERTIES.indexOf(key) >= 0) {\n return null;\n }\n const property = entry[1];\n if (!property.path) {\n property.path = typeName + '.' + key;\n }\n const [propertyValue, propertyType] = getValueAndType(typedValue, key);\n if (\n props.ignoreMissingValues &&\n (!propertyValue || (Array.isArray(propertyValue) && propertyValue.length === 0))\n ) {\n return null;\n }\n return (\n <DescriptionListEntry key={key} term={getPropertyDisplayName(key)}>\n <ResourcePropertyDisplay\n property={property}\n propertyType={propertyType}\n value={propertyValue}\n ignoreMissingValues={props.ignoreMissingValues}\n link={props.link}\n />\n </DescriptionListEntry>\n );\n })}\n </DescriptionList>\n );\n}\n"],"names":[],"mappings":";;;;;;AAaM,SAAU,sBAAsB,CAAC,KAAkC,EAAA;AACvE,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;AAC/B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;IACjC,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YAAM,QAAQ;oCAA4B,CAAC;AACnD,KAAA;IAED,IACE,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,MAAM,IAAI,KAAK;QACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC;AAC/B,QAAA,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAC9B;;;;AAIA,QAAA,OAAO,KAAM,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAA,KAAK,CAAC,IAAI,CAAO,CAAC;AAChC,KAAA;IAED,QACE,KAAC,CAAA,aAAA,CAAA,eAAe,EAAC,EAAA,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,EACpC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;AACnD,QAAA,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,0BAA0B,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAChD,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;AACD,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1B,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YAClB,QAAQ,CAAC,IAAI,GAAG,QAAQ,GAAG,GAAG,GAAG,GAAG,CAAC;AACtC,SAAA;AACD,QAAA,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG,eAAe,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QACvE,IACE,KAAK,CAAC,mBAAmB;AACzB,aAAC,CAAC,aAAa,KAAK,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,EAChF;AACA,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;AACD,QAAA,QACE,KAAA,CAAA,aAAA,CAAC,oBAAoB,EAAA,EAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,sBAAsB,CAAC,GAAG,CAAC,EAAA;AAC/D,YAAA,KAAA,CAAA,aAAA,CAAC,uBAAuB,EAAA,EACtB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,aAAa,EACpB,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,IAAI,EAAE,KAAK,CAAC,IAAI,EAAA,CAChB,CACmB,EACvB;KACH,CAAC,CACc,EAClB;AACJ;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { Stack } from '@mantine/core';
2
2
  import { globalSchema, getPropertyDisplayName } from '@medplum/core';
3
- import e__default, { useState } from 'react';
3
+ import React, { useState } from 'react';
4
4
  import { CheckboxFormSection } from '../CheckboxFormSection/CheckboxFormSection.mjs';
5
5
  import { DEFAULT_IGNORED_PROPERTIES } from '../constants.mjs';
6
6
  import { FormSection } from '../FormSection/FormSection.mjs';
@@ -19,12 +19,12 @@ function BackboneElementInput(props) {
19
19
  const typeName = props.typeName;
20
20
  const typeSchema = globalSchema.types[typeName];
21
21
  if (!typeSchema) {
22
- return e__default.createElement("div", null,
22
+ return React.createElement("div", null,
23
23
  typeName,
24
24
  "\u00A0not implemented");
25
25
  }
26
26
  const typedValue = { type: typeName, value };
27
- return (e__default.createElement(Stack, null, Object.entries(typeSchema.properties).map((entry) => {
27
+ return (React.createElement(Stack, null, Object.entries(typeSchema.properties).map((entry) => {
28
28
  const key = entry[0];
29
29
  if (key === 'id' || DEFAULT_IGNORED_PROPERTIES.indexOf(key) >= 0) {
30
30
  return null;
@@ -35,13 +35,13 @@ function BackboneElementInput(props) {
35
35
  }
36
36
  const [propertyValue, propertyType] = getValueAndType(typedValue, key);
37
37
  if (property.type.length === 1 && property.type[0].code === 'boolean') {
38
- return (e__default.createElement(CheckboxFormSection, { key: key, title: getPropertyDisplayName(key), description: property.definition, htmlFor: key },
39
- e__default.createElement(ResourcePropertyInput, { property: property, name: key, defaultValue: propertyValue, defaultPropertyType: propertyType, outcome: props.outcome, onChange: (newValue, propName) => {
38
+ return (React.createElement(CheckboxFormSection, { key: key, title: getPropertyDisplayName(key), description: property.definition, htmlFor: key },
39
+ React.createElement(ResourcePropertyInput, { property: property, name: key, defaultValue: propertyValue, defaultPropertyType: propertyType, outcome: props.outcome, onChange: (newValue, propName) => {
40
40
  setValueWrapper(setPropertyValue(value, key, propName ?? key, entry[1], newValue));
41
41
  } })));
42
42
  }
43
- return (e__default.createElement(FormSection, { key: key, title: getPropertyDisplayName(key), description: property.definition, htmlFor: key, outcome: props.outcome },
44
- e__default.createElement(ResourcePropertyInput, { property: property, name: key, defaultValue: propertyValue, defaultPropertyType: propertyType, outcome: props.outcome, onChange: (newValue, propName) => {
43
+ return (React.createElement(FormSection, { key: key, title: getPropertyDisplayName(key), description: property.definition, htmlFor: key, outcome: props.outcome },
44
+ React.createElement(ResourcePropertyInput, { property: property, name: key, defaultValue: propertyValue, defaultPropertyType: propertyType, outcome: props.outcome, onChange: (newValue, propName) => {
45
45
  setValueWrapper(setPropertyValue(value, key, propName ?? key, entry[1], newValue));
46
46
  } })));
47
47
  })));