@medplum/react 1.0.4 → 1.0.6
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.
- package/README.md +2 -1
- package/dist/cjs/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
- package/dist/cjs/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
- package/dist/cjs/FhirPathTable/FhirPathTable.d.ts +2 -2
- package/dist/cjs/MoneyDisplay/MoneyDisplay.d.ts +6 -0
- package/dist/cjs/MoneyInput/MoneyInput.d.ts +10 -0
- package/dist/cjs/MoneyInput/MoneyInput.stories.d.ts +6 -0
- package/dist/cjs/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
- package/dist/cjs/auth/ChooseProfileForm.d.ts +2 -1
- package/dist/cjs/auth/ChooseScopeForm.d.ts +2 -1
- package/dist/cjs/auth/MfaForm.d.ts +7 -0
- package/dist/cjs/auth/SignInForm.d.ts +10 -0
- package/dist/cjs/{index.js → index.cjs} +860 -642
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.min.cjs +1 -0
- package/dist/cjs/stories/referenceLab.d.ts +3 -1
- package/dist/esm/AddressDisplay/{AddressDisplay.js → AddressDisplay.mjs} +1 -1
- package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +1 -0
- package/dist/esm/AddressInput/{AddressInput.js → AddressInput.mjs} +9 -9
- package/dist/esm/AddressInput/AddressInput.mjs.map +1 -0
- package/dist/esm/AnnotationInput/{AnnotationInput.js → AnnotationInput.mjs} +2 -2
- package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +1 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +113 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +1 -0
- package/dist/esm/AttachmentArrayDisplay/{AttachmentArrayDisplay.js → AttachmentArrayDisplay.mjs} +2 -2
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +1 -0
- package/dist/esm/AttachmentArrayInput/{AttachmentArrayInput.js → AttachmentArrayInput.mjs} +6 -7
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +1 -0
- package/dist/esm/AttachmentButton/{AttachmentButton.js → AttachmentButton.mjs} +5 -7
- package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +1 -0
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +21 -0
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +1 -0
- package/dist/esm/AttachmentInput/{AttachmentInput.js → AttachmentInput.mjs} +5 -5
- package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +1 -0
- package/dist/esm/BackboneElementDisplay/{BackboneElementDisplay.js → BackboneElementDisplay.mjs} +4 -4
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +1 -0
- package/dist/esm/BackboneElementInput/{BackboneElementInput.js → BackboneElementInput.mjs} +10 -11
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +1 -0
- package/dist/esm/CalendarInput/{CalendarInput.js → CalendarInput.mjs} +1 -1
- package/dist/esm/CalendarInput/CalendarInput.mjs.map +1 -0
- package/dist/esm/CheckboxFormSection/{CheckboxFormSection.js → CheckboxFormSection.mjs} +1 -1
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +1 -0
- package/dist/esm/CodeInput/{CodeInput.js → CodeInput.mjs} +6 -5
- package/dist/esm/CodeInput/CodeInput.mjs.map +1 -0
- package/dist/esm/CodeableConceptDisplay/{CodeableConceptDisplay.js → CodeableConceptDisplay.mjs} +1 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +1 -0
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +36 -0
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +1 -0
- package/dist/esm/CodingDisplay/{CodingDisplay.js → CodingDisplay.mjs} +1 -1
- package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +1 -0
- package/dist/esm/CodingInput/{CodingInput.js → CodingInput.mjs} +5 -4
- package/dist/esm/CodingInput/CodingInput.mjs.map +1 -0
- package/dist/esm/ContactDetailDisplay/{ContactDetailDisplay.js → ContactDetailDisplay.mjs} +4 -5
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +1 -0
- package/dist/esm/ContactDetailInput/{ContactDetailInput.js → ContactDetailInput.mjs} +6 -7
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +1 -0
- package/dist/esm/ContactPointDisplay/{ContactPointDisplay.js → ContactPointDisplay.mjs} +1 -1
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +1 -0
- package/dist/esm/ContactPointInput/{ContactPointInput.js → ContactPointInput.mjs} +7 -7
- package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +1 -0
- package/dist/esm/Container/{Container.js → Container.mjs} +3 -4
- package/dist/esm/Container/Container.mjs.map +1 -0
- package/dist/esm/DateTimeInput/{DateTimeInput.js → DateTimeInput.mjs} +2 -2
- package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +1 -0
- package/dist/esm/DefaultResourceTimeline/{DefaultResourceTimeline.js → DefaultResourceTimeline.mjs} +2 -2
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +1 -0
- package/dist/esm/DescriptionList/{DescriptionList.js → DescriptionList.mjs} +1 -1
- package/dist/esm/DescriptionList/DescriptionList.mjs.map +1 -0
- package/dist/esm/DiagnosticReportDisplay/{DiagnosticReportDisplay.js → DiagnosticReportDisplay.mjs} +19 -16
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +1 -0
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
- package/dist/esm/Document/Document.mjs +12 -0
- package/dist/esm/Document/Document.mjs.map +1 -0
- package/dist/esm/EncounterTimeline/{EncounterTimeline.js → EncounterTimeline.mjs} +2 -2
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +1 -0
- package/dist/esm/ErrorBoundary/{ErrorBoundary.js → ErrorBoundary.mjs} +1 -1
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +1 -0
- package/dist/esm/ExtensionInput/{ExtensionInput.js → ExtensionInput.mjs} +1 -1
- package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +1 -0
- package/dist/esm/FhirPathDisplay/{FhirPathDisplay.js → FhirPathDisplay.mjs} +2 -2
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +1 -0
- package/dist/esm/FhirPathTable/FhirPathTable.d.ts +2 -2
- package/dist/esm/FhirPathTable/{FhirPathTable.js → FhirPathTable.mjs} +14 -17
- package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +1 -0
- package/dist/esm/Form/{Form.js → Form.mjs} +2 -2
- package/dist/esm/Form/Form.mjs.map +1 -0
- package/dist/esm/Form/{FormUtils.js → FormUtils.mjs} +1 -1
- package/dist/esm/Form/FormUtils.mjs.map +1 -0
- package/dist/esm/FormSection/{FormSection.js → FormSection.mjs} +2 -2
- package/dist/esm/FormSection/FormSection.mjs.map +1 -0
- package/dist/esm/GoogleButton/{GoogleButton.js → GoogleButton.mjs} +4 -5
- package/dist/esm/GoogleButton/GoogleButton.mjs.map +1 -0
- package/dist/esm/HumanNameDisplay/{HumanNameDisplay.js → HumanNameDisplay.mjs} +1 -1
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +1 -0
- package/dist/esm/HumanNameInput/HumanNameInput.mjs +50 -0
- package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +1 -0
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +11 -0
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +1 -0
- package/dist/esm/IdentifierInput/{IdentifierInput.js → IdentifierInput.mjs} +3 -3
- package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +1 -0
- package/dist/esm/Logo/{Logo.js → Logo.mjs} +1 -1
- package/dist/esm/Logo/Logo.mjs.map +1 -0
- package/dist/esm/MedplumLink/{MedplumLink.js → MedplumLink.mjs} +5 -6
- package/dist/esm/MedplumLink/MedplumLink.mjs.map +1 -0
- package/dist/esm/MedplumProvider/{MedplumProvider.js → MedplumProvider.mjs} +9 -3
- package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +1 -0
- package/dist/esm/MoneyDisplay/MoneyDisplay.d.ts +6 -0
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +9 -0
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +1 -0
- package/dist/esm/MoneyInput/MoneyInput.d.ts +10 -0
- package/dist/esm/MoneyInput/MoneyInput.mjs +53 -0
- package/dist/esm/MoneyInput/MoneyInput.mjs.map +1 -0
- package/dist/esm/MoneyInput/MoneyInput.stories.d.ts +6 -0
- package/dist/esm/Panel/{Panel.js → Panel.mjs} +3 -4
- package/dist/esm/Panel/Panel.mjs.map +1 -0
- package/dist/esm/PatientTimeline/{PatientTimeline.js → PatientTimeline.mjs} +2 -2
- package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +1 -0
- package/dist/esm/PeriodInput/{PeriodInput.js → PeriodInput.mjs} +4 -4
- package/dist/esm/PeriodInput/PeriodInput.mjs.map +1 -0
- package/dist/esm/PlanDefinitionBuilder/{PlanDefinitionBuilder.js → PlanDefinitionBuilder.mjs} +36 -24
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +1 -0
- package/dist/esm/QuantityDisplay/{QuantityDisplay.js → QuantityDisplay.mjs} +1 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +1 -0
- package/dist/esm/QuantityInput/{QuantityInput.js → QuantityInput.mjs} +13 -5
- package/dist/esm/QuantityInput/QuantityInput.mjs.map +1 -0
- package/dist/esm/QuestionnaireBuilder/{QuestionnaireBuilder.js → QuestionnaireBuilder.mjs} +45 -27
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +1 -0
- package/dist/esm/QuestionnaireForm/{QuestionnaireForm.js → QuestionnaireForm.mjs} +37 -36
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +1 -0
- package/dist/esm/RangeDisplay/{RangeDisplay.js → RangeDisplay.mjs} +1 -1
- package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +1 -0
- package/dist/esm/RangeInput/{RangeInput.js → RangeInput.mjs} +10 -4
- package/dist/esm/RangeInput/RangeInput.mjs.map +1 -0
- package/dist/esm/RatioDisplay/{RatioDisplay.js → RatioDisplay.mjs} +2 -2
- package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +1 -0
- package/dist/esm/RatioInput/{RatioInput.js → RatioInput.mjs} +10 -4
- package/dist/esm/RatioInput/RatioInput.mjs.map +1 -0
- package/dist/esm/ReferenceDisplay/{ReferenceDisplay.js → ReferenceDisplay.mjs} +2 -2
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +1 -0
- package/dist/esm/ReferenceInput/{ReferenceInput.js → ReferenceInput.mjs} +10 -5
- package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +1 -0
- package/dist/esm/ReferenceRangeEditor/{ReferenceRangeEditor.js → ReferenceRangeEditor.mjs} +44 -38
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +1 -0
- package/dist/esm/RequestGroupDisplay/{RequestGroupDisplay.js → RequestGroupDisplay.mjs} +14 -17
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +1 -0
- package/dist/esm/ResourceArrayDisplay/{ResourceArrayDisplay.js → ResourceArrayDisplay.mjs} +4 -5
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +1 -0
- package/dist/esm/ResourceArrayInput/{ResourceArrayInput.js → ResourceArrayInput.mjs} +3 -3
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +1 -0
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +23 -0
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +1 -0
- package/dist/esm/ResourceBadge/{ResourceBadge.js → ResourceBadge.mjs} +3 -3
- package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +1 -0
- package/dist/esm/ResourceBlame/{ResourceBlame.js → ResourceBlame.mjs} +6 -7
- package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +1 -0
- package/dist/esm/ResourceDiff/{ResourceDiff.js → ResourceDiff.mjs} +4 -4
- package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +1 -0
- package/dist/esm/ResourceDiffTable/{ResourceDiffTable.js → ResourceDiffTable.mjs} +3 -3
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +1 -0
- package/dist/esm/ResourceForm/{ResourceForm.js → ResourceForm.mjs} +5 -5
- package/dist/esm/ResourceForm/ResourceForm.mjs.map +1 -0
- package/dist/esm/ResourceHistoryTable/{ResourceHistoryTable.js → ResourceHistoryTable.mjs} +10 -13
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +1 -0
- package/dist/esm/ResourceInput/{ResourceInput.js → ResourceInput.mjs} +19 -25
- package/dist/esm/ResourceInput/ResourceInput.mjs.map +1 -0
- package/dist/esm/ResourceName/ResourceName.mjs +18 -0
- package/dist/esm/ResourceName/ResourceName.mjs.map +1 -0
- package/dist/esm/ResourcePropertyDisplay/{ResourcePropertyDisplay.js → ResourcePropertyDisplay.mjs} +23 -21
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +1 -0
- package/dist/esm/ResourcePropertyInput/{ResourcePropertyInput.js → ResourcePropertyInput.mjs} +34 -34
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +1 -0
- package/dist/esm/ResourceTable/{ResourceTable.js → ResourceTable.mjs} +4 -4
- package/dist/esm/ResourceTable/ResourceTable.mjs.map +1 -0
- package/dist/esm/ResourceTimeline/{ResourceTimeline.js → ResourceTimeline.mjs} +26 -30
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +1 -0
- package/dist/esm/Scheduler/{Scheduler.js → Scheduler.mjs} +8 -9
- package/dist/esm/Scheduler/Scheduler.mjs.map +1 -0
- package/dist/esm/SearchControl/{SearchControl.js → SearchControl.mjs} +66 -50
- package/dist/esm/SearchControl/SearchControl.mjs.map +1 -0
- package/dist/esm/SearchControl/{SearchControlField.js → SearchControlField.mjs} +3 -4
- package/dist/esm/SearchControl/SearchControlField.mjs.map +1 -0
- package/dist/esm/SearchControl/{SearchUtils.js → SearchUtils.mjs} +34 -17
- package/dist/esm/SearchControl/SearchUtils.mjs.map +1 -0
- package/dist/esm/SearchFieldEditor/{SearchFieldEditor.js → SearchFieldEditor.mjs} +28 -21
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +1 -0
- package/dist/esm/SearchFilterEditor/{SearchFilterEditor.js → SearchFilterEditor.mjs} +8 -9
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +1 -0
- package/dist/esm/SearchFilterValueDialog/{SearchFilterValueDialog.js → SearchFilterValueDialog.mjs} +5 -6
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +1 -0
- package/dist/esm/SearchFilterValueDisplay/{SearchFilterValueDisplay.js → SearchFilterValueDisplay.mjs} +3 -4
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +1 -0
- package/dist/esm/SearchFilterValueInput/{SearchFilterValueInput.js → SearchFilterValueInput.mjs} +5 -6
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +1 -0
- package/dist/esm/SearchPopupMenu/{SearchPopupMenu.js → SearchPopupMenu.mjs} +10 -10
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +1 -0
- package/dist/esm/ServiceRequestTimeline/{ServiceRequestTimeline.js → ServiceRequestTimeline.mjs} +2 -2
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +1 -0
- package/dist/esm/StatusBadge/{StatusBadge.js → StatusBadge.mjs} +3 -2
- package/dist/esm/StatusBadge/StatusBadge.mjs.map +1 -0
- package/dist/esm/Timeline/{Timeline.js → Timeline.mjs} +11 -13
- package/dist/esm/Timeline/Timeline.mjs.map +1 -0
- package/dist/esm/TimingInput/{TimingInput.js → TimingInput.mjs} +13 -18
- package/dist/esm/TimingInput/TimingInput.mjs.map +1 -0
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +43 -0
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +1 -0
- package/dist/esm/auth/{AuthenticationForm.js → AuthenticationForm.mjs} +21 -19
- package/dist/esm/auth/AuthenticationForm.mjs.map +1 -0
- package/dist/esm/auth/ChooseProfileForm.d.ts +2 -1
- package/dist/esm/auth/ChooseProfileForm.mjs +29 -0
- package/dist/esm/auth/ChooseProfileForm.mjs.map +1 -0
- package/dist/esm/auth/ChooseScopeForm.d.ts +2 -1
- package/dist/esm/auth/{ChooseScopeForm.js → ChooseScopeForm.mjs} +4 -4
- package/dist/esm/auth/ChooseScopeForm.mjs.map +1 -0
- package/dist/esm/auth/MfaForm.d.ts +7 -0
- package/dist/esm/auth/MfaForm.mjs +34 -0
- package/dist/esm/auth/MfaForm.mjs.map +1 -0
- package/dist/esm/auth/{NewProjectForm.js → NewProjectForm.mjs} +8 -9
- package/dist/esm/auth/NewProjectForm.mjs.map +1 -0
- package/dist/esm/auth/{NewUserForm.js → NewUserForm.mjs} +15 -19
- package/dist/esm/auth/NewUserForm.mjs.map +1 -0
- package/dist/esm/auth/{RegisterForm.js → RegisterForm.mjs} +5 -5
- package/dist/esm/auth/RegisterForm.mjs.map +1 -0
- package/dist/esm/auth/SignInForm.d.ts +10 -0
- package/dist/esm/auth/{SignInForm.js → SignInForm.mjs} +25 -10
- package/dist/esm/auth/SignInForm.mjs.map +1 -0
- package/dist/esm/{constants.js → constants.mjs} +1 -1
- package/dist/esm/constants.mjs.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.min.mjs +1 -0
- package/dist/esm/{index.js → index.mjs} +88 -85
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/stories/referenceLab.d.ts +3 -1
- package/dist/esm/useResource/{useResource.js → useResource.mjs} +2 -2
- package/dist/esm/useResource/useResource.mjs.map +1 -0
- package/dist/esm/utils/{blame.js → blame.mjs} +6 -9
- package/dist/esm/utils/blame.mjs.map +1 -0
- package/dist/esm/utils/{date.js → date.mjs} +2 -3
- package/dist/esm/utils/date.mjs.map +1 -0
- package/dist/esm/utils/{diff.js → diff.mjs} +1 -1
- package/dist/esm/utils/diff.mjs.map +1 -0
- package/dist/esm/utils/{dom.js → dom.mjs} +1 -1
- package/dist/esm/utils/dom.mjs.map +1 -0
- package/dist/esm/utils/outcomes.mjs +30 -0
- package/dist/esm/utils/outcomes.mjs.map +1 -0
- package/dist/esm/utils/{questionnaire.js → questionnaire.mjs} +1 -1
- package/dist/esm/utils/questionnaire.mjs.map +1 -0
- package/dist/esm/utils/{recaptcha.js → recaptcha.mjs} +5 -6
- package/dist/esm/utils/recaptcha.mjs.map +1 -0
- package/dist/esm/utils/{script.js → script.mjs} +1 -1
- package/dist/esm/utils/script.mjs.map +1 -0
- package/package.json +22 -22
- package/rollup.config.mjs +6 -7
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/index.min.js +0 -2
- package/dist/cjs/index.min.js.map +0 -1
- package/dist/esm/AddressDisplay/AddressDisplay.js.map +0 -1
- package/dist/esm/AddressInput/AddressInput.js.map +0 -1
- package/dist/esm/AnnotationInput/AnnotationInput.js.map +0 -1
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.js.map +0 -1
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.js.map +0 -1
- package/dist/esm/AttachmentButton/AttachmentButton.js.map +0 -1
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.js +0 -21
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.js.map +0 -1
- package/dist/esm/AttachmentInput/AttachmentInput.js.map +0 -1
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.js.map +0 -1
- package/dist/esm/BackboneElementInput/BackboneElementInput.js.map +0 -1
- package/dist/esm/CalendarInput/CalendarInput.js.map +0 -1
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.js.map +0 -1
- package/dist/esm/CodeInput/CodeInput.js.map +0 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.js.map +0 -1
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.js +0 -37
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.js.map +0 -1
- package/dist/esm/CodingDisplay/CodingDisplay.js.map +0 -1
- package/dist/esm/CodingInput/CodingInput.js.map +0 -1
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.js.map +0 -1
- package/dist/esm/ContactDetailInput/ContactDetailInput.js.map +0 -1
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.js.map +0 -1
- package/dist/esm/ContactPointInput/ContactPointInput.js.map +0 -1
- package/dist/esm/Container/Container.js.map +0 -1
- package/dist/esm/DateTimeInput/DateTimeInput.js.map +0 -1
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.js.map +0 -1
- package/dist/esm/DescriptionList/DescriptionList.js.map +0 -1
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.js.map +0 -1
- package/dist/esm/Document/Document.js +0 -13
- package/dist/esm/Document/Document.js.map +0 -1
- package/dist/esm/EncounterTimeline/EncounterTimeline.js.map +0 -1
- package/dist/esm/ErrorBoundary/ErrorBoundary.js.map +0 -1
- package/dist/esm/ExtensionInput/ExtensionInput.js.map +0 -1
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.js.map +0 -1
- package/dist/esm/FhirPathTable/FhirPathTable.js.map +0 -1
- package/dist/esm/Form/Form.js.map +0 -1
- package/dist/esm/Form/FormUtils.js.map +0 -1
- package/dist/esm/FormSection/FormSection.js.map +0 -1
- package/dist/esm/GoogleButton/GoogleButton.js.map +0 -1
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.js.map +0 -1
- package/dist/esm/HumanNameInput/HumanNameInput.js +0 -39
- package/dist/esm/HumanNameInput/HumanNameInput.js.map +0 -1
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.js +0 -12
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.js.map +0 -1
- package/dist/esm/IdentifierInput/IdentifierInput.js.map +0 -1
- package/dist/esm/Logo/Logo.js.map +0 -1
- package/dist/esm/MedplumLink/MedplumLink.js.map +0 -1
- package/dist/esm/MedplumProvider/MedplumProvider.js.map +0 -1
- package/dist/esm/Panel/Panel.js.map +0 -1
- package/dist/esm/PatientTimeline/PatientTimeline.js.map +0 -1
- package/dist/esm/PeriodInput/PeriodInput.js.map +0 -1
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.js.map +0 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.js.map +0 -1
- package/dist/esm/QuantityInput/QuantityInput.js.map +0 -1
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.js.map +0 -1
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.js.map +0 -1
- package/dist/esm/RangeDisplay/RangeDisplay.js.map +0 -1
- package/dist/esm/RangeInput/RangeInput.js.map +0 -1
- package/dist/esm/RatioDisplay/RatioDisplay.js.map +0 -1
- package/dist/esm/RatioInput/RatioInput.js.map +0 -1
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.js.map +0 -1
- package/dist/esm/ReferenceInput/ReferenceInput.js.map +0 -1
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js.map +0 -1
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.js.map +0 -1
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.js.map +0 -1
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.js.map +0 -1
- package/dist/esm/ResourceAvatar/ResourceAvatar.js +0 -24
- package/dist/esm/ResourceAvatar/ResourceAvatar.js.map +0 -1
- package/dist/esm/ResourceBadge/ResourceBadge.js.map +0 -1
- package/dist/esm/ResourceBlame/ResourceBlame.js.map +0 -1
- package/dist/esm/ResourceDiff/ResourceDiff.js.map +0 -1
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.js.map +0 -1
- package/dist/esm/ResourceForm/ResourceForm.js.map +0 -1
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.js.map +0 -1
- package/dist/esm/ResourceInput/ResourceInput.js.map +0 -1
- package/dist/esm/ResourceName/ResourceName.js +0 -19
- package/dist/esm/ResourceName/ResourceName.js.map +0 -1
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.js.map +0 -1
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.js.map +0 -1
- package/dist/esm/ResourceTable/ResourceTable.js.map +0 -1
- package/dist/esm/ResourceTimeline/ResourceTimeline.js.map +0 -1
- package/dist/esm/Scheduler/Scheduler.js.map +0 -1
- package/dist/esm/SearchControl/SearchControl.js.map +0 -1
- package/dist/esm/SearchControl/SearchControlField.js.map +0 -1
- package/dist/esm/SearchControl/SearchUtils.js.map +0 -1
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.js.map +0 -1
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.js.map +0 -1
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.js.map +0 -1
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.js.map +0 -1
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.js.map +0 -1
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.js.map +0 -1
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.js.map +0 -1
- package/dist/esm/StatusBadge/StatusBadge.js.map +0 -1
- package/dist/esm/Timeline/Timeline.js.map +0 -1
- package/dist/esm/TimingInput/TimingInput.js.map +0 -1
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js +0 -65
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js.map +0 -1
- package/dist/esm/auth/AuthenticationForm.js.map +0 -1
- package/dist/esm/auth/ChooseProfileForm.js +0 -32
- package/dist/esm/auth/ChooseProfileForm.js.map +0 -1
- package/dist/esm/auth/ChooseScopeForm.js.map +0 -1
- package/dist/esm/auth/NewProjectForm.js.map +0 -1
- package/dist/esm/auth/NewUserForm.js.map +0 -1
- package/dist/esm/auth/RegisterForm.js.map +0 -1
- package/dist/esm/auth/SignInForm.js.map +0 -1
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.min.js +0 -2
- package/dist/esm/index.min.js.map +0 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js +0 -39
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +0 -1
- package/dist/esm/useResource/useResource.js.map +0 -1
- package/dist/esm/utils/blame.js.map +0 -1
- package/dist/esm/utils/date.js.map +0 -1
- package/dist/esm/utils/diff.js.map +0 -1
- package/dist/esm/utils/dom.js.map +0 -1
- package/dist/esm/utils/outcomes.js +0 -29
- package/dist/esm/utils/outcomes.js.map +0 -1
- package/dist/esm/utils/questionnaire.js.map +0 -1
- package/dist/esm/utils/recaptcha.js.map +0 -1
- package/dist/esm/utils/script.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FhirPathTable.mjs","sources":["../../../src/FhirPathTable/FhirPathTable.tsx"],"sourcesContent":["import { Button, Loader, Table } from '@mantine/core';\nimport { IndexedStructureDefinition, PropertyType } from '@medplum/core';\nimport { OperationOutcome, Resource } from '@medplum/fhirtypes';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { FhirPathDisplay } from '../FhirPathDisplay/FhirPathDisplay';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { SearchClickEvent } from '../SearchControl/SearchControl';\nimport { isCheckboxCell, killEvent } from '../utils/dom';\n\nexport interface FhirPathTableField {\n readonly propertyType: PropertyType;\n readonly name: string;\n readonly fhirPath: string;\n}\n\nexport interface FhirPathTableProps {\n resourceType: string;\n query: string;\n fields: FhirPathTableField[];\n checkboxesEnabled?: boolean;\n onClick?: (e: SearchClickEvent) => void;\n onAuxClick?: (e: SearchClickEvent) => void;\n onBulk?: (ids: string[]) => void;\n}\n\nexport interface SmartSearchResponse {\n data: {\n ResourceList: Resource[];\n };\n}\n\n/**\n * The FhirPathTable component represents the embeddable search table control.\n */\nexport function FhirPathTable(props: FhirPathTableProps): JSX.Element {\n const medplum = useMedplum();\n const [schema, setSchema] = useState<IndexedStructureDefinition | undefined>();\n const [outcome, setOutcome] = useState<OperationOutcome | undefined>();\n const { query, fields } = props;\n const [response, setResponse] = useState<SmartSearchResponse | undefined>();\n const [selected, setSelected] = useState<{ [id: string]: boolean }>({});\n\n const responseRef = useRef<SmartSearchResponse>();\n responseRef.current = response;\n\n const selectedRef = useRef<{ [id: string]: boolean }>({});\n selectedRef.current = selected;\n\n useEffect(() => {\n setOutcome(undefined);\n medplum.graphql(query).then(setResponse).catch(setOutcome);\n }, [medplum, query]);\n\n function handleSingleCheckboxClick(e: React.ChangeEvent, id: string): void {\n e.stopPropagation();\n\n const el = e.target as HTMLInputElement;\n const checked = el.checked;\n const newSelected = { ...selectedRef.current };\n if (checked) {\n newSelected[id] = true;\n } else {\n delete newSelected[id];\n }\n setSelected(newSelected);\n }\n\n function handleAllCheckboxClick(e: React.ChangeEvent): void {\n e.stopPropagation();\n\n const el = e.target as HTMLInputElement;\n const checked = el.checked;\n const newSelected = {} as { [id: string]: boolean };\n const resources = responseRef.current?.data?.ResourceList;\n if (checked && resources) {\n resources.forEach((resource) => {\n if (resource?.id) {\n newSelected[resource.id] = true;\n }\n });\n }\n setSelected(newSelected);\n }\n\n function isAllSelected(): boolean {\n const resources = responseRef.current?.data?.ResourceList;\n if (!resources || resources.length === 0) {\n return false;\n }\n for (const resource of resources) {\n if (resource?.id && !selectedRef.current[resource.id]) {\n return false;\n }\n }\n return true;\n }\n\n function handleRowClick(e: React.MouseEvent, resource: Resource): void {\n if (isCheckboxCell(e.target as Element)) {\n // Ignore clicks on checkboxes\n return;\n }\n\n killEvent(e);\n\n if (e.button !== 1 && props.onClick) {\n props.onClick(new SearchClickEvent(resource, e));\n }\n\n if (e.button === 1 && props.onAuxClick) {\n props.onAuxClick(new SearchClickEvent(resource, e));\n }\n }\n\n useEffect(() => {\n medplum\n .requestSchema(props.resourceType)\n .then((newSchema) => {\n // The schema could have the same object identity,\n // so need to use the spread operator to kick React re-render.\n setSchema({ ...newSchema });\n })\n .catch(console.log);\n }, [medplum, props.resourceType]);\n\n const typeSchema = schema?.types?.[props.resourceType];\n if (!typeSchema) {\n return <Loader />;\n }\n\n const checkboxColumn = props.checkboxesEnabled;\n\n return (\n <div onContextMenu={(e) => killEvent(e)} data-testid=\"search-control\">\n <Table>\n <thead>\n <tr>\n {checkboxColumn && (\n <th>\n <input\n type=\"checkbox\"\n value=\"checked\"\n aria-label=\"all-checkbox\"\n data-testid=\"all-checkbox\"\n checked={isAllSelected()}\n onChange={(e) => handleAllCheckboxClick(e)}\n />\n </th>\n )}\n {fields.map((field) => (\n <th key={field.name}>{field.name}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {response?.data?.ResourceList?.map(\n (resource) =>\n resource && (\n <tr\n key={resource.id}\n data-testid=\"search-control-row\"\n onClick={(e) => handleRowClick(e, resource)}\n onAuxClick={(e) => handleRowClick(e, resource)}\n >\n {checkboxColumn && (\n <td>\n <input\n type=\"checkbox\"\n value=\"checked\"\n data-testid=\"row-checkbox\"\n aria-label={`Checkbox for ${resource.id}`}\n checked={!!selected[resource.id as string]}\n onChange={(e) => handleSingleCheckboxClick(e, resource.id as string)}\n />\n </td>\n )}\n {fields.map((field) => {\n return (\n <td key={field.name}>\n <FhirPathDisplay propertyType={field.propertyType} path={field.fhirPath} resource={resource} />\n </td>\n );\n })}\n </tr>\n )\n )}\n </tbody>\n </Table>\n {response?.data?.ResourceList?.length === 0 && <div data-testid=\"empty-search\">No results</div>}\n {outcome && (\n <div data-testid=\"search-error\">\n <pre style={{ textAlign: 'left' }}>{JSON.stringify(outcome, undefined, 2)}</pre>\n </div>\n )}\n {props.onBulk && (\n <Button onClick={() => (props.onBulk as (ids: string[]) => any)(Object.keys(selectedRef.current))}>\n Bulk...\n </Button>\n )}\n </div>\n );\n}\n\nexport const MemoizedFhirPathTable = React.memo(FhirPathTable);\n"],"names":[],"mappings":";;;;;;;AA+BA;;AAEG;AACG,SAAU,aAAa,CAAC,KAAyB,EAAA;AACrD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAA0C,CAAC;IAC/E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAgC,CAAC;AACvE,IAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,EAAmC,CAAC;IAC5E,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAA4B,EAAE,CAAC,CAAC;AAExE,IAAA,MAAM,WAAW,GAAG,MAAM,EAAuB,CAAC;AAClD,IAAA,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;AAE/B,IAAA,MAAM,WAAW,GAAG,MAAM,CAA4B,EAAE,CAAC,CAAC;AAC1D,IAAA,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE/B,SAAS,CAAC,MAAK;QACb,UAAU,CAAC,SAAS,CAAC,CAAC;AACtB,QAAA,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAC7D,KAAC,EAAE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AAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAO,CAC5E,CACP;AACA,QAAA,KAAK,CAAC,MAAM,KACX,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,OAAO,EAAE,MAAO,KAAK,CAAC,MAAiC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAA,EAAA,SAAA,CAExF,CACV,CACG,EACN;AACJ,CAAC;AAEY,MAAA,qBAAqB,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { parseForm } from './FormUtils.
|
|
2
|
+
import { parseForm } from './FormUtils.mjs';
|
|
3
3
|
|
|
4
4
|
function Form(props) {
|
|
5
5
|
return (React.createElement("form", { style: props.style, "data-testid": props.testid, onSubmit: (e) => {
|
|
@@ -12,4 +12,4 @@ function Form(props) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export { Form };
|
|
15
|
-
//# sourceMappingURL=Form.
|
|
15
|
+
//# sourceMappingURL=Form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.mjs","sources":["../../../src/Form/Form.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\nimport { parseForm } from './FormUtils';\n\nexport interface FormProps {\n onSubmit?: (formData: Record<string, string>) => void;\n style?: CSSProperties;\n children?: React.ReactNode;\n testid?: string;\n}\n\nexport function Form(props: FormProps): JSX.Element {\n return (\n <form\n style={props.style}\n data-testid={props.testid}\n onSubmit={(e: React.SyntheticEvent) => {\n e.preventDefault();\n const formData = parseForm(e.target as HTMLFormElement);\n if (props.onSubmit) {\n props.onSubmit(formData);\n }\n }}\n >\n {props.children}\n </form>\n );\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,IAAI,CAAC,KAAgB,EAAA;AACnC,IAAA,QACE,KACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAA,aAAA,EACL,KAAK,CAAC,MAAM,EACzB,QAAQ,EAAE,CAAC,CAAuB,KAAI;YACpC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,MAAyB,CAAC,CAAC;YACxD,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,gBAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,aAAA;AACH,SAAC,IAEA,KAAK,CAAC,QAAQ,CACV,EACP;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormUtils.mjs","sources":["../../../src/Form/FormUtils.ts"],"sourcesContent":["/**\n * Parses an HTML form and returns the result as a JavaScript object.\n * @param form The HTML form element.\n */\nexport function parseForm(form: HTMLFormElement): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const element of Array.from(form.elements)) {\n if (element instanceof HTMLInputElement) {\n parseInputElement(result, element);\n } else if (element instanceof HTMLTextAreaElement) {\n result[element.name] = element.value;\n } else if (element instanceof HTMLSelectElement) {\n parseSelectElement(result, element);\n }\n }\n\n return result;\n}\n\n/**\n * Parses an HTML input element.\n * Sets the name/value pair in the result,\n * but only if the element is enabled and checked.\n * @param el The input element.\n * @param result The result builder.\n */\nfunction parseInputElement(result: Record<string, string>, el: HTMLInputElement): void {\n if (el.disabled) {\n // Ignore disabled elements\n return;\n }\n\n if ((el.type === 'checkbox' || el.type === 'radio') && !el.checked) {\n // Ignore unchecked radio or checkbox elements\n return;\n }\n\n result[el.name] = el.value;\n}\n\n/**\n * Parses an HTML select element.\n * Sets the name/value pair if one is selected.\n * @param result The result builder.\n * @param el The select element.\n */\nfunction parseSelectElement(result: Record<string, string>, el: HTMLSelectElement): void {\n result[el.name] = el.value;\n}\n"],"names":[],"mappings":"AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,IAAqB,EAAA;IAC7C,MAAM,MAAM,GAA2B,EAAE,CAAC;IAE1C,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAC/C,IAAI,OAAO,YAAY,gBAAgB,EAAE;AACvC,YAAA,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpC,SAAA;aAAM,IAAI,OAAO,YAAY,mBAAmB,EAAE;YACjD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;AACtC,SAAA;aAAM,IAAI,OAAO,YAAY,iBAAiB,EAAE;AAC/C,YAAA,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,SAAA;AACF,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;AAMG;AACH,SAAS,iBAAiB,CAAC,MAA8B,EAAE,EAAoB,EAAA;IAC7E,IAAI,EAAE,CAAC,QAAQ,EAAE;;QAEf,OAAO;AACR,KAAA;AAED,IAAA,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,UAAU,IAAI,EAAE,CAAC,IAAI,KAAK,OAAO,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE;;QAElE,OAAO;AACR,KAAA;IAED,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAC7B,CAAC;AAED;;;;;AAKG;AACH,SAAS,kBAAkB,CAAC,MAA8B,EAAE,EAAqB,EAAA;IAC/E,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAC7B;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Input } from '@mantine/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { getErrorsForInput } from '../utils/outcomes.
|
|
3
|
+
import { getErrorsForInput } from '../utils/outcomes.mjs';
|
|
4
4
|
|
|
5
5
|
function FormSection(props) {
|
|
6
6
|
return (React.createElement(Input.Wrapper, { id: props.htmlFor, label: props.title, description: props.description, error: getErrorsForInput(props.outcome, props.htmlFor) }, props.children));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { FormSection };
|
|
10
|
-
//# sourceMappingURL=FormSection.
|
|
10
|
+
//# sourceMappingURL=FormSection.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSection.mjs","sources":["../../../src/FormSection/FormSection.tsx"],"sourcesContent":["import { Input } from '@mantine/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface FormSectionProps {\n title?: string;\n htmlFor?: string;\n description?: string;\n outcome?: OperationOutcome;\n children?: React.ReactNode;\n}\n\nexport function FormSection(props: FormSectionProps): JSX.Element {\n return (\n <Input.Wrapper\n id={props.htmlFor}\n label={props.title}\n description={props.description}\n error={getErrorsForInput(props.outcome, props.htmlFor)}\n >\n {props.children}\n </Input.Wrapper>\n );\n}\n"],"names":[],"mappings":";;;;AAaM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,KAAK,CAAC,OAAO,EAAA,EACZ,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAErD,EAAA,KAAK,CAAC,QAAQ,CACD,EAChB;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.
|
|
3
|
-
import { createScriptTag } from '../utils/script.
|
|
2
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
3
|
+
import { createScriptTag } from '../utils/script.mjs';
|
|
4
4
|
|
|
5
5
|
function GoogleButton(props) {
|
|
6
6
|
const medplum = useMedplum();
|
|
@@ -32,12 +32,11 @@ function GoogleButton(props) {
|
|
|
32
32
|
return React.createElement("div", { ref: parentRef });
|
|
33
33
|
}
|
|
34
34
|
function getGoogleClientId(clientId) {
|
|
35
|
-
var _a, _b;
|
|
36
35
|
if (clientId) {
|
|
37
36
|
return clientId;
|
|
38
37
|
}
|
|
39
38
|
const origin = window.location.protocol + '//' + window.location.host;
|
|
40
|
-
const authorizedOrigins =
|
|
39
|
+
const authorizedOrigins = "http://localhost:3000,http://127.0.0.1:3000,http://localhost:6006,http://127.0.0.1:6006,https://app.medplum.com,https://docs.medplum.com,https://storybook.medplum.com,https://graphiql.medplum.com,https://www.medplum.com"?.split(',') ?? [];
|
|
41
40
|
if (authorizedOrigins.includes(origin)) {
|
|
42
41
|
return "921088377005-3j1sa10vr6hj86jgmdfh2l53v3mp7lfi.apps.googleusercontent.com";
|
|
43
42
|
}
|
|
@@ -45,4 +44,4 @@ function getGoogleClientId(clientId) {
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
export { GoogleButton, getGoogleClientId };
|
|
48
|
-
//# sourceMappingURL=GoogleButton.
|
|
47
|
+
//# sourceMappingURL=GoogleButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleButton.mjs","sources":["../../../src/GoogleButton/GoogleButton.tsx"],"sourcesContent":["import { GoogleCredentialResponse } from '@medplum/core';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { createScriptTag } from '../utils/script';\n\ninterface GoogleApi {\n accounts: {\n id: {\n initialize: (args: any) => void;\n renderButton: (parent: HTMLElement, args: any) => void;\n };\n };\n}\n\ndeclare const google: GoogleApi;\n\nexport interface GoogleButtonProps {\n readonly googleClientId?: string;\n readonly handleGoogleCredential: (response: GoogleCredentialResponse) => void;\n}\n\nexport function GoogleButton(props: GoogleButtonProps): JSX.Element | null {\n const medplum = useMedplum();\n const { googleClientId, handleGoogleCredential } = props;\n const parentRef = useRef<HTMLDivElement>(null);\n const [scriptLoaded, setScriptLoaded] = useState<boolean>(typeof google !== 'undefined');\n const [initialized, setInitialized] = useState<boolean>(false);\n const [buttonRendered, setButtonRendered] = useState<boolean>(false);\n\n useEffect(() => {\n if (typeof google === 'undefined') {\n createScriptTag('https://accounts.google.com/gsi/client', () => setScriptLoaded(true));\n return;\n }\n\n if (!initialized) {\n google.accounts.id.initialize({\n client_id: googleClientId,\n callback: handleGoogleCredential,\n });\n setInitialized(true);\n }\n\n if (parentRef.current && !buttonRendered) {\n google.accounts.id.renderButton(parentRef.current, {});\n setButtonRendered(true);\n }\n }, [medplum, googleClientId, initialized, scriptLoaded, parentRef, buttonRendered, handleGoogleCredential]);\n\n if (!googleClientId) {\n return null;\n }\n\n return <div ref={parentRef} />;\n}\n\nexport function getGoogleClientId(clientId: string | undefined): string | undefined {\n if (clientId) {\n return clientId;\n }\n\n const origin = window.location.protocol + '//' + window.location.host;\n const authorizedOrigins = process.env.GOOGLE_AUTH_ORIGINS?.split(',') ?? [];\n if (authorizedOrigins.includes(origin)) {\n return process.env.GOOGLE_CLIENT_ID;\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;;;AAqBM,SAAU,YAAY,CAAC,KAAwB,EAAA;AACnD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAC7B,IAAA,MAAM,EAAE,cAAc,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC;AACzD,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AAC/C,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAU,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC;IACzF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,C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ACtE,IAAA,MAAM,iBAAiB,GAAG,6NAA+B,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;AAC5E,IAAA,IAAI,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACtC,QAAA,OAAO,0EAA4B,CAAC;AACrC,KAAA;AAED,IAAA,OAAO,SAAS,CAAC;AACnB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HumanNameDisplay.mjs","sources":["../../../src/HumanNameDisplay/HumanNameDisplay.tsx"],"sourcesContent":["import { formatHumanName, HumanNameFormatOptions } from '@medplum/core';\nimport { HumanName } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface HumanNameDisplayProps {\n value?: HumanName;\n options?: HumanNameFormatOptions;\n}\n\nexport function HumanNameDisplay(props: HumanNameDisplayProps): JSX.Element | null {\n const name = props.value;\n if (!name) {\n return null;\n }\n\n return <>{formatHumanName(name, props.options)}</>;\n}\n"],"names":[],"mappings":";;;AASM,SAAU,gBAAgB,CAAC,KAA4B,EAAA;AAC3D,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC;IACzB,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;IAED,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAI,CAAC;AACrD;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Group, NativeSelect, TextInput } from '@mantine/core';
|
|
2
|
+
import React, { useState, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
function HumanNameInput(props) {
|
|
5
|
+
const [value, setValue] = useState(props.defaultValue);
|
|
6
|
+
const valueRef = useRef();
|
|
7
|
+
valueRef.current = value;
|
|
8
|
+
function setValueWrapper(newValue) {
|
|
9
|
+
setValue(newValue);
|
|
10
|
+
if (props.onChange) {
|
|
11
|
+
props.onChange(newValue);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function setUse(use) {
|
|
15
|
+
setValueWrapper({ ...valueRef.current, use: use ? use : undefined });
|
|
16
|
+
}
|
|
17
|
+
function setPrefix(prefix) {
|
|
18
|
+
setValueWrapper({
|
|
19
|
+
...valueRef.current,
|
|
20
|
+
prefix: prefix ? prefix.split(' ') : undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function setGiven(given) {
|
|
24
|
+
setValueWrapper({
|
|
25
|
+
...valueRef.current,
|
|
26
|
+
given: given ? given.split(' ') : undefined,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function setFamily(family) {
|
|
30
|
+
setValueWrapper({
|
|
31
|
+
...valueRef.current,
|
|
32
|
+
family: family ? family : undefined,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function setSuffix(suffix) {
|
|
36
|
+
setValueWrapper({
|
|
37
|
+
...valueRef.current,
|
|
38
|
+
suffix: suffix ? suffix.split(' ') : undefined,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
|
|
42
|
+
React.createElement(NativeSelect, { defaultValue: value?.use, "data-testid": "use", onChange: (e) => setUse(e.currentTarget.value), data: ['', 'temp', 'old', 'usual', 'official', 'nickname', 'anonymous', 'maiden'] }),
|
|
43
|
+
React.createElement(TextInput, { placeholder: "Prefix", defaultValue: value?.prefix?.join(' '), onChange: (e) => setPrefix(e.currentTarget.value) }),
|
|
44
|
+
React.createElement(TextInput, { placeholder: "Given", defaultValue: value?.given?.join(' '), onChange: (e) => setGiven(e.currentTarget.value) }),
|
|
45
|
+
React.createElement(TextInput, { placeholder: "Family", defaultValue: value?.family, onChange: (e) => setFamily(e.currentTarget.value) }),
|
|
46
|
+
React.createElement(TextInput, { placeholder: "Suffix", defaultValue: value?.suffix?.join(' '), onChange: (e) => setSuffix(e.currentTarget.value) })));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { HumanNameInput };
|
|
50
|
+
//# sourceMappingURL=HumanNameInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HumanNameInput.mjs","sources":["../../../src/HumanNameInput/HumanNameInput.tsx"],"sourcesContent":["import { Group, NativeSelect, TextInput } from '@mantine/core';\nimport { HumanName } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\n\nexport interface HumanNameInputProps {\n name: string;\n defaultValue?: HumanName;\n onChange?: (value: HumanName) => void;\n}\n\nexport function HumanNameInput(props: HumanNameInputProps): JSX.Element {\n const [value, setValue] = useState<HumanName | undefined>(props.defaultValue);\n\n const valueRef = useRef<HumanName>();\n valueRef.current = value;\n\n function setValueWrapper(newValue: HumanName): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setUse(use: 'temp' | 'old' | 'usual' | 'official' | 'nickname' | 'anonymous' | 'maiden' | undefined): void {\n setValueWrapper({ ...valueRef.current, use: use ? use : undefined });\n }\n\n function setPrefix(prefix: string): void {\n setValueWrapper({\n ...valueRef.current,\n prefix: prefix ? prefix.split(' ') : undefined,\n });\n }\n\n function setGiven(given: string): void {\n setValueWrapper({\n ...valueRef.current,\n given: given ? given.split(' ') : undefined,\n });\n }\n\n function setFamily(family: string): void {\n setValueWrapper({\n ...valueRef.current,\n family: family ? family : undefined,\n });\n }\n\n function setSuffix(suffix: string): void {\n setValueWrapper({\n ...valueRef.current,\n suffix: suffix ? suffix.split(' ') : undefined,\n });\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <NativeSelect\n defaultValue={value?.use}\n data-testid=\"use\"\n onChange={(e) =>\n setUse(e.currentTarget.value as 'temp' | 'old' | 'usual' | 'official' | 'nickname' | 'anonymous' | 'maiden')\n }\n data={['', 'temp', 'old', 'usual', 'official', 'nickname', 'anonymous', 'maiden']}\n />\n <TextInput\n placeholder=\"Prefix\"\n defaultValue={value?.prefix?.join(' ')}\n onChange={(e) => setPrefix(e.currentTarget.value)}\n />\n <TextInput\n placeholder=\"Given\"\n defaultValue={value?.given?.join(' ')}\n onChange={(e) => setGiven(e.currentTarget.value)}\n />\n <TextInput placeholder=\"Family\" defaultValue={value?.family} onChange={(e) => setFamily(e.currentTarget.value)} />\n <TextInput\n placeholder=\"Suffix\"\n defaultValue={value?.suffix?.join(' ')}\n onChange={(e) => setSuffix(e.currentTarget.value)}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAwB,KAAK,CAAC,YAAY,CAAC,CAAC;AAE9E,IAAA,MAAM,QAAQ,GAAG,MAAM,EAAa,CAAC;AACrC,IAAA,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;IAEzB,SAAS,eAAe,CAAC,QAAmB,EAAA;QAC1C,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;IAED,SAAS,MAAM,CAAC,GAA4F,EAAA;QAC1G,eAAe,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,EAAE,CAAC,CAAC;KACtE;IAED,SAAS,SAAS,CAAC,MAAc,EAAA;AAC/B,QAAA,eAAe,CAAC;YACd,GAAG,QAAQ,CAAC,OAAO;AACnB,YAAA,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS;AAC/C,SAAA,CAAC,CAAC;KACJ;IAED,SAAS,QAAQ,CAAC,KAAa,EAAA;AAC7B,QAAA,eAAe,CAAC;YACd,GAAG,QAAQ,CAAC,OAAO;AACnB,YAAA,KAAK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AAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,EACrC,QAAQ,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAChD,CAAA;QACF,KAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,WAAW,EAAC,QAAQ,EAAC,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAI,CAAA;AAClH,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,WAAW,EAAC,QAAQ,EACpB,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,EACtC,QAAQ,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EACjD,CAAA,CACI,EACR;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentifierDisplay.mjs","sources":["../../../src/IdentifierDisplay/IdentifierDisplay.tsx"],"sourcesContent":["import { Identifier } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface IdentifierDisplayProps {\n value?: Identifier;\n}\n\nexport function IdentifierDisplay(props: IdentifierDisplayProps): JSX.Element {\n return (\n <div>\n {props.value?.system}: {props.value?.value}\n </div>\n );\n}\n"],"names":[],"mappings":";;AAOM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;QACG,KAAK,CAAC,KAAK,EAAE,MAAM;;AAAI,QAAA,KAAK,CAAC,KAAK,EAAE,KAAK,CACtC,EACN;AACJ;;;;"}
|
|
@@ -10,9 +10,9 @@ function IdentifierInput(props) {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
|
|
13
|
-
React.createElement(TextInput, { placeholder: "System", defaultValue: value
|
|
14
|
-
React.createElement(TextInput, { placeholder: "Value", defaultValue: value
|
|
13
|
+
React.createElement(TextInput, { placeholder: "System", defaultValue: value?.system, onChange: (e) => setValueWrapper({ ...value, system: e.currentTarget.value }) }),
|
|
14
|
+
React.createElement(TextInput, { placeholder: "Value", defaultValue: value?.value, onChange: (e) => setValueWrapper({ ...value, value: e.currentTarget.value }) })));
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export { IdentifierInput };
|
|
18
|
-
//# sourceMappingURL=IdentifierInput.
|
|
18
|
+
//# sourceMappingURL=IdentifierInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentifierInput.mjs","sources":["../../../src/IdentifierInput/IdentifierInput.tsx"],"sourcesContent":["import { Group, TextInput } from '@mantine/core';\nimport { Identifier } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\n\nexport interface IdentifierInputProps {\n name: string;\n defaultValue?: Identifier;\n onChange?: (value: Identifier) => void;\n}\n\nexport function IdentifierInput(props: IdentifierInputProps): JSX.Element {\n const [value, setValue] = useState(props.defaultValue);\n\n function setValueWrapper(newValue: Identifier): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <TextInput\n placeholder=\"System\"\n defaultValue={value?.system}\n onChange={(e) => setValueWrapper({ ...value, system: e.currentTarget.value })}\n />\n <TextInput\n placeholder=\"Value\"\n defaultValue={value?.value}\n onChange={(e) => setValueWrapper({ ...value, value: e.currentTarget.value })}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;AAUM,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,QAAoB,EAAA;QAC3C,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;IAED,QACE,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAC,IAAI,EAAC,IAAI,EAAA,IAAA,EAAC,MAAM,EAAA,IAAA,EAAA;AAC7B,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,WAAW,EAAC,QAAQ,EACpB,YAAY,EAAE,KAAK,EAAE,MAAM,EAC3B,QAAQ,EAAE,CAAC,CAAC,KAAK,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAC7E,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EACR,EAAA,WAAW,EAAC,OAAO,EACnB,YAAY,EAAE,KAAK,EAAE,KAAK,EAC1B,QAAQ,EAAE,CAAC,CAAC,KAAK,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAC5E,CAAA,CACI,EACR;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logo.mjs","sources":["../../../src/Logo/Logo.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface LogoProps {\n size: number;\n fill?: string;\n}\n\nexport function Logo(props: LogoProps): JSX.Element {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 491 491\" style={{ width: props.size, height: props.size }}>\n <title>Medplum Logo</title>\n <path fill={props.fill || '#ad7136'} d=\"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z\" />\n <path\n fill={props.fill || '#946af9'}\n d=\"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z\"\n />\n <path\n fill={props.fill || '#7857c5'}\n d=\"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z\"\n />\n <path\n fill={props.fill || '#40bc26'}\n d=\"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z\"\n />\n <path fill={props.fill || '#33961e'} d=\"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z\" />\n </svg>\n );\n}\n"],"names":[],"mappings":";;AAOM,SAAU,IAAI,CAAC,KAAgB,EAAA;IACnC,QACE,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,EAAA;QAC5G,KAA2B,CAAA,aAAA,CAAA,OAAA,EAAA,IAAA,EAAA,cAAA,CAAA;QAC3B,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC,EAAC,gEAAgE,EAAG,CAAA;QAC1G,KACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,SAAS,EAC7B,CAAC,EAAC,kJAAkJ,EACpJ,CAAA;QACF,KACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,SAAS,EAC7B,CAAC,EAAC,4FAA4F,EAC9F,CAAA;QACF,KACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,SAAS,EAC7B,CAAC,EAAC,yEAAyE,EAC3E,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC,EAAC,0DAA0D,EAAG,CAAA,CAChG,EACN;AACJ;;;;"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { __rest } from '../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { Anchor } from '@mantine/core';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { useNavigate } from 'react-router-dom';
|
|
5
|
-
import { killEvent } from '../utils/dom.
|
|
4
|
+
import { killEvent } from '../utils/dom.mjs';
|
|
6
5
|
|
|
7
6
|
function MedplumLink(props) {
|
|
8
7
|
const navigate = useNavigate();
|
|
9
|
-
const { to, suffix, label, onClick, children
|
|
8
|
+
const { to, suffix, label, onClick, children, ...rest } = props;
|
|
10
9
|
let href = getHref(to);
|
|
11
10
|
if (suffix) {
|
|
12
11
|
href += '/' + suffix;
|
|
13
12
|
}
|
|
14
|
-
return (React.createElement(Anchor,
|
|
13
|
+
return (React.createElement(Anchor, { href: href, "aria-label": label, onClick: (e) => {
|
|
15
14
|
killEvent(e);
|
|
16
15
|
if (onClick) {
|
|
17
16
|
onClick();
|
|
@@ -19,7 +18,7 @@ function MedplumLink(props) {
|
|
|
19
18
|
else if (to) {
|
|
20
19
|
navigate(href);
|
|
21
20
|
}
|
|
22
|
-
}
|
|
21
|
+
}, ...rest }, children));
|
|
23
22
|
}
|
|
24
23
|
function getHref(to) {
|
|
25
24
|
if (to) {
|
|
@@ -49,4 +48,4 @@ function getReferenceHref(to) {
|
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
export { MedplumLink };
|
|
52
|
-
//# sourceMappingURL=MedplumLink.
|
|
51
|
+
//# sourceMappingURL=MedplumLink.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MedplumLink.mjs","sources":["../../../src/MedplumLink/MedplumLink.tsx"],"sourcesContent":["import { Anchor, TextProps } from '@mantine/core';\nimport { Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { killEvent } from '../utils/dom';\n\nexport interface MedplumLinkProps extends TextProps {\n to?: Resource | Reference | string;\n suffix?: string;\n label?: string;\n onClick?: () => void;\n children: React.ReactNode;\n}\n\nexport function MedplumLink(props: MedplumLinkProps): JSX.Element {\n const navigate = useNavigate();\n const { to, suffix, label, onClick, children, ...rest } = props;\n\n let href = getHref(to);\n if (suffix) {\n href += '/' + suffix;\n }\n\n return (\n <Anchor\n href={href}\n aria-label={label}\n onClick={(e: React.SyntheticEvent) => {\n killEvent(e);\n if (onClick) {\n onClick();\n } else if (to) {\n navigate(href);\n }\n }}\n {...rest}\n >\n {children}\n </Anchor>\n );\n}\n\nfunction getHref(to: Resource | Reference | string | undefined): string {\n if (to) {\n if (typeof to === 'string') {\n return getStringHref(to);\n } else if ('resourceType' in to) {\n return getResourceHref(to);\n } else if ('reference' in to) {\n return getReferenceHref(to);\n }\n }\n return '#';\n}\n\nfunction getStringHref(to: string): string {\n if (to.startsWith('http://') || to.startsWith('https://') || to.startsWith('/')) {\n return to;\n }\n return '/' + to;\n}\n\nfunction getResourceHref(to: Resource): string {\n return `/${to.resourceType}/${to.id}`;\n}\n\nfunction getReferenceHref(to: Reference): string {\n return `/${to.reference}`;\n}\n"],"names":[],"mappings":";;;;;AAcM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AAC/B,IAAA,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;AAEhE,IAAA,IAAI,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;AACvB,IAAA,IAAI,MAAM,EAAE;AACV,QAAA,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC;AACtB,KAAA;AAED,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA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AA,EAAE,CAAC,SAAS,EAAE,CAAC;AAC5B;;;;"}
|
|
@@ -16,12 +16,18 @@ function MedplumProvider(props) {
|
|
|
16
16
|
});
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
function eventListener() {
|
|
19
|
-
setState(
|
|
19
|
+
setState({
|
|
20
|
+
...state,
|
|
21
|
+
profile: medplum.getProfile(),
|
|
22
|
+
});
|
|
20
23
|
}
|
|
21
24
|
medplum.addEventListener('change', eventListener);
|
|
22
25
|
return () => medplum.removeEventListeneer('change', eventListener);
|
|
23
26
|
}, [medplum, state]);
|
|
24
|
-
const medplumContext =
|
|
27
|
+
const medplumContext = {
|
|
28
|
+
...state,
|
|
29
|
+
medplum,
|
|
30
|
+
};
|
|
25
31
|
return React.createElement(reactContext.Provider, { value: medplumContext }, props.children);
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
@@ -47,4 +53,4 @@ function useMedplumProfile() {
|
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
export { MedplumProvider, useMedplum, useMedplumContext, useMedplumProfile };
|
|
50
|
-
//# sourceMappingURL=MedplumProvider.
|
|
56
|
+
//# sourceMappingURL=MedplumProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MedplumProvider.mjs","sources":["../../../src/MedplumProvider/MedplumProvider.tsx"],"sourcesContent":["import { MedplumClient, ProfileResource } from '@medplum/core';\nimport React, { createContext, useContext, useEffect, useState } from 'react';\n\nconst reactContext = createContext(undefined as MedplumContext | undefined);\n\nexport interface MedplumProviderProps {\n medplum: MedplumClient;\n children: React.ReactNode;\n}\n\nexport interface MedplumContext {\n medplum: MedplumClient;\n profile?: ProfileResource;\n loading: boolean;\n}\n\n/**\n * The MedplumProvider component provides Medplum context state.\n *\n * Medplum context includes:\n * 1) medplum - Medplum client library\n * 2) profile - The current user profile (if signed in)\n */\nexport function MedplumProvider(props: MedplumProviderProps): JSX.Element {\n const medplum = props.medplum;\n\n const [state, setState] = useState({\n profile: medplum.getProfile(),\n loading: false,\n });\n\n useEffect(() => {\n function eventListener(): void {\n setState({\n ...state,\n profile: medplum.getProfile(),\n });\n }\n\n medplum.addEventListener('change', eventListener);\n return () => medplum.removeEventListeneer('change', eventListener);\n }, [medplum, state]);\n\n const medplumContext = {\n ...state,\n medplum,\n };\n\n return <reactContext.Provider value={medplumContext}>{props.children}</reactContext.Provider>;\n}\n\n/**\n * Returns the MedplumContext instance.\n */\nexport function useMedplumContext(): MedplumContext {\n return useContext(reactContext) as MedplumContext;\n}\n\n/**\n * Returns the MedplumClient instance.\n * This is a shortcut for useMedplumContext().medplum.\n */\nexport function useMedplum(): MedplumClient {\n return useMedplumContext().medplum;\n}\n\n/**\n * Returns the current Medplum user profile (if signed in).\n * This is a shortcut for useMedplumContext().profile.\n * @returns The current user profile.\n */\nexport function useMedplumProfile(): ProfileResource | undefined {\n return useMedplumContext().profile;\n}\n"],"names":[],"mappings":";;AAGA,MAAM,YAAY,GAAG,aAAa,CAAC,SAAuC,CAAC,CAAC;AAa5E;;;;;;AAMG;AACG,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAE9B,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC;AACjC,QAAA,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;AAC7B,QAAA,OAAO,EAAE,KAAK;AACf,KAAA,CAAC,CAAC;IAEH,SAAS,CAAC,MAAK;AACb,QAAA,SAAS,aAAa,GAAA;AACpB,YAAA,QAAQ,CAAC;AACP,gBAAA,GAAG,KAAK;AACR,gBAAA,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;AAC9B,aAAA,CAAC,CAAC;SACJ;AAED,QAAA,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAClD,OAAO,MAAM,OAAO,CAAC,oBAAoB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AACrE,KAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAErB,IAAA,MAAM,cAAc,GAAG;AACrB,QAAA,GAAG,KAAK;QACR,OAAO;KACR,CAAC;AAEF,IAAA,OAAO,KAAC,CAAA,aAAA,CAAA,YAAY,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,cAAc,EAAG,EAAA,KAAK,CAAC,QAAQ,CAAyB,CAAC;AAChG,CAAC;AAED;;AAEG;SACa,iBAAiB,GAAA;AAC/B,IAAA,OAAO,UAAU,CAAC,YAAY,CAAmB,CAAC;AACpD,CAAC;AAED;;;AAGG;SACa,UAAU,GAAA;AACxB,IAAA,OAAO,iBAAiB,EAAE,CAAC,OAAO,CAAC;AACrC,CAAC;AAED;;;;AAIG;SACa,iBAAiB,GAAA;AAC/B,IAAA,OAAO,iBAAiB,EAAE,CAAC,OAAO,CAAC;AACrC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoneyDisplay.mjs","sources":["../../../src/MoneyDisplay/MoneyDisplay.tsx"],"sourcesContent":["import { formatMoney } from '@medplum/core';\nimport { Money } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface MoneyDisplayProps {\n value?: Money;\n}\n\nexport function MoneyDisplay(props: MoneyDisplayProps): JSX.Element | null {\n return <>{formatMoney(props.value)}</>;\n}\n"],"names":[],"mappings":";;;AAQM,SAAU,YAAY,CAAC,KAAwB,EAAA;IACnD,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAI,CAAC;AACzC;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Money } from '@medplum/fhirtypes';
|
|
3
|
+
export interface MoneyInputProps {
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
defaultValue?: Money;
|
|
8
|
+
onChange?: (value: Money) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function MoneyInput(props: MoneyInputProps): JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NativeSelect, TextInput } from '@mantine/core';
|
|
2
|
+
import { IconCurrencyDollar } from '@tabler/icons';
|
|
3
|
+
import React, { useState, useCallback } from 'react';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Based on: https://github.com/mantinedev/ui.mantine.dev/blob/master/components/CurrencyInput/CurrencyInput.tsx
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* List of currencies.
|
|
10
|
+
*
|
|
11
|
+
* Full list of currencies:
|
|
12
|
+
* https://www.hl7.org/fhir/valueset-currencies.html
|
|
13
|
+
*
|
|
14
|
+
* Latest browsers can report list of supported currencies, but it's not widely supported:
|
|
15
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf
|
|
16
|
+
*
|
|
17
|
+
* Using a short list for simplicity for now.
|
|
18
|
+
*/
|
|
19
|
+
const data = ['USD', 'EUR', 'CAD', 'GBP', 'AUD'];
|
|
20
|
+
function MoneyInput(props) {
|
|
21
|
+
const { onChange } = props;
|
|
22
|
+
const [value, setValue] = useState(props.defaultValue);
|
|
23
|
+
const setValueWrapper = useCallback((newValue) => {
|
|
24
|
+
setValue(newValue);
|
|
25
|
+
if (onChange) {
|
|
26
|
+
onChange(newValue);
|
|
27
|
+
}
|
|
28
|
+
}, [onChange]);
|
|
29
|
+
const handleCurrencyChange = useCallback((e) => {
|
|
30
|
+
setValueWrapper({
|
|
31
|
+
...value,
|
|
32
|
+
currency: e.currentTarget.value,
|
|
33
|
+
});
|
|
34
|
+
}, [value, setValueWrapper]);
|
|
35
|
+
const handleValueChange = useCallback((e) => {
|
|
36
|
+
setValueWrapper({
|
|
37
|
+
...value,
|
|
38
|
+
value: e.currentTarget.valueAsNumber,
|
|
39
|
+
});
|
|
40
|
+
}, [value, setValueWrapper]);
|
|
41
|
+
const select = (React.createElement(NativeSelect, { defaultValue: value?.currency, data: data, styles: {
|
|
42
|
+
input: {
|
|
43
|
+
fontWeight: 500,
|
|
44
|
+
borderTopLeftRadius: 0,
|
|
45
|
+
borderBottomLeftRadius: 0,
|
|
46
|
+
width: 92,
|
|
47
|
+
},
|
|
48
|
+
}, onChange: handleCurrencyChange }));
|
|
49
|
+
return (React.createElement(TextInput, { type: "number", label: props.label, placeholder: props.placeholder || 'Value', defaultValue: value?.value?.toString() || 'USD', icon: React.createElement(IconCurrencyDollar, { size: 14 }), rightSection: select, rightSectionWidth: 92, onChange: handleValueChange }));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { MoneyInput };
|
|
53
|
+
//# sourceMappingURL=MoneyInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoneyInput.mjs","sources":["../../../src/MoneyInput/MoneyInput.tsx"],"sourcesContent":["import { NativeSelect, TextInput } from '@mantine/core';\nimport { Money } from '@medplum/fhirtypes';\nimport { IconCurrencyDollar } from '@tabler/icons';\nimport React, { useCallback, useState } from 'react';\n\n/*\n * Based on: https://github.com/mantinedev/ui.mantine.dev/blob/master/components/CurrencyInput/CurrencyInput.tsx\n */\n\n/**\n * List of currencies.\n *\n * Full list of currencies:\n * https://www.hl7.org/fhir/valueset-currencies.html\n *\n * Latest browsers can report list of supported currencies, but it's not widely supported:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf\n *\n * Using a short list for simplicity for now.\n */\nconst data = ['USD', 'EUR', 'CAD', 'GBP', 'AUD'];\n\nexport interface MoneyInputProps {\n name: string;\n label?: string;\n placeholder?: string;\n defaultValue?: Money;\n onChange?: (value: Money) => void;\n}\n\nexport function MoneyInput(props: MoneyInputProps): JSX.Element {\n const { onChange } = props;\n const [value, setValue] = useState(props.defaultValue);\n\n const setValueWrapper = useCallback(\n (newValue: Money): void => {\n setValue(newValue);\n if (onChange) {\n onChange(newValue);\n }\n },\n [onChange]\n );\n\n const handleCurrencyChange = useCallback(\n (e: React.ChangeEvent<HTMLSelectElement>) => {\n setValueWrapper({\n ...value,\n currency: e.currentTarget.value,\n });\n },\n [value, setValueWrapper]\n );\n\n const handleValueChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setValueWrapper({\n ...value,\n value: e.currentTarget.valueAsNumber,\n });\n },\n [value, setValueWrapper]\n );\n\n const select = (\n <NativeSelect\n defaultValue={value?.currency}\n data={data}\n styles={{\n input: {\n fontWeight: 500,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n width: 92,\n },\n }}\n onChange={handleCurrencyChange}\n />\n );\n\n return (\n <TextInput\n type=\"number\"\n label={props.label}\n placeholder={props.placeholder || 'Value'}\n defaultValue={value?.value?.toString() || 'USD'}\n icon={<IconCurrencyDollar size={14} />}\n rightSection={select}\n rightSectionWidth={92}\n onChange={handleValueChange}\n />\n );\n}\n"],"names":[],"mappings":";;;;AAKA;;AAEG;AAEH;;;;;;;;;;AAUG;AACH,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAU3C,SAAU,UAAU,CAAC,KAAsB,EAAA;AAC/C,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;AAC3B,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAEvD,IAAA,MAAM,eAAe,GAAG,WAAW,CACjC,CAAC,QAAe,KAAU;QACxB,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACnB,QAAA,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACpB,SAAA;AACH,KAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;AAEF,IAAA,MAAM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C3B,CAAA,EACF;AACJ;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Basic: () => JSX.Element;
|
|
6
|
+
export declare const DefaultValue: () => JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest } from '../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { createStyles, useComponentDefaultProps, Paper } from '@mantine/core';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
|
|
@@ -26,10 +25,10 @@ const defaultProps = {
|
|
|
26
25
|
withBorder: true,
|
|
27
26
|
};
|
|
28
27
|
function Panel(props) {
|
|
29
|
-
const
|
|
28
|
+
const { className, children, width, fill, unstyled, ...others } = useComponentDefaultProps('Panel', defaultProps, props);
|
|
30
29
|
const { classes, cx } = useStyles({ width, fill }, { name: 'Panel', unstyled });
|
|
31
|
-
return (React.createElement(Paper,
|
|
30
|
+
return (React.createElement(Paper, { className: cx(classes.paper, className), ...others }, children));
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export { Panel };
|
|
35
|
-
//# sourceMappingURL=Panel.
|
|
34
|
+
//# sourceMappingURL=Panel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.mjs","sources":["../../../src/Panel/Panel.tsx"],"sourcesContent":["import { createStyles, Paper, PaperProps, useComponentDefaultProps } from '@mantine/core';\nimport React from 'react';\n\nexport interface PanelStylesParams {\n width?: number;\n fill?: boolean;\n}\n\nconst useStyles = createStyles((theme, { width, fill }: PanelStylesParams) => ({\n paper: {\n maxWidth: width,\n margin: `${theme.spacing.xl}px auto`,\n padding: fill ? 0 : theme.spacing.md,\n '@media (max-width: 800px)': {\n padding: fill ? 0 : 8,\n },\n '& img': {\n width: '100%',\n maxWidth: '100%',\n },\n '& video': {\n width: '100%',\n maxWidth: '100%',\n },\n },\n}));\n\nexport interface PanelProps extends PaperProps {\n width?: number;\n fill?: boolean;\n}\n\nconst defaultProps: Partial<PanelProps> = {\n shadow: 'xs',\n radius: 'md',\n withBorder: true,\n};\n\nexport function Panel(props: PanelProps): JSX.Element {\n const { className, children, width, fill, unstyled, ...others } = useComponentDefaultProps(\n 'Panel',\n defaultProps,\n props\n );\n const { classes, cx } = useStyles({ width, fill }, { name: 'Panel', unstyled });\n\n return (\n <Paper className={cx(classes.paper, className)} {...others}>\n {children}\n </Paper>\n );\n}\n"],"names":[],"mappings":";;;AAQA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAqB,MAAM;AAC7E,IAAA,KAAK,EAAE;AACL,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,MAAM,EAAE,CAAG,EAAA,KAAK,CAAC,OAAO,CAAC,EAAE,CAAS,OAAA,CAAA;AACpC,QAAA,OAAO,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE;AACpC,QAAA,2BAA2B,EAAE;YAC3B,OAAO,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC;AACtB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,QAAQ,EAAE,MAAM;AACjB,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,QAAQ,EAAE,MAAM;AACjB,SAAA;AACF,KAAA;AACF,CAAA,CAAC,CAAC,CAAC;AAOJ,MAAM,YAAY,GAAwB;AACxC,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,UAAU,EAAE,IAAI;CACjB,CAAC;AAEI,SAAU,KAAK,CAAC,KAAiB,EAAA;IACrC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,wBAAwB,CACxF,OAAO,EACP,YAAY,EACZ,KAAK,CACN,CAAC;IACF,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEhF,QACE,oBAAC,KAAK,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,EAAM,GAAA,MAAM,IACvD,QAAQ,CACH,EACR;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getReferenceString, createReference } from '@medplum/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.
|
|
3
|
+
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.mjs';
|
|
4
4
|
|
|
5
5
|
const searches = [
|
|
6
6
|
'$/_history',
|
|
@@ -39,4 +39,4 @@ function PatientTimeline(props) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export { PatientTimeline };
|
|
42
|
-
//# sourceMappingURL=PatientTimeline.
|
|
42
|
+
//# sourceMappingURL=PatientTimeline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PatientTimeline.mjs","sources":["../../../src/PatientTimeline/PatientTimeline.tsx"],"sourcesContent":["import { createReference, getReferenceString, ProfileResource } from '@medplum/core';\nimport { Attachment, Patient, Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline';\n\nexport interface PatientTimelineProps {\n patient: Patient | Reference<Patient>;\n}\n\nconst searches = [\n '$/_history',\n 'Communication?subject=$',\n 'Device?patient=$',\n 'DeviceRequest?patient=$',\n 'DiagnosticReport?subject=$',\n 'Media?subject=$',\n 'ServiceRequest?subject=$',\n];\n\nexport function PatientTimeline(props: PatientTimelineProps): JSX.Element {\n return (\n <ResourceTimeline\n value={props.patient}\n buildSearchRequests={(resource: Resource) => ({\n resourceType: 'Bundle',\n type: 'batch',\n entry: searches.map((search) => ({\n request: {\n method: 'GET',\n url: search.replaceAll('$', getReferenceString(resource)),\n },\n })),\n })}\n createCommunication={(resource: Patient, sender: ProfileResource, text: string) => ({\n resourceType: 'Communication',\n status: 'completed',\n subject: createReference(resource),\n sender: createReference(sender),\n sent: new Date().toISOString(),\n payload: [{ contentString: text }],\n })}\n createMedia={(resource: Patient, operator: ProfileResource, content: Attachment) => ({\n resourceType: 'Media',\n status: 'completed',\n subject: createReference(resource),\n operator: createReference(operator),\n issued: new Date().toISOString(),\n content,\n })}\n />\n );\n}\n"],"names":[],"mappings":";;;;AASA,MAAM,QAAQ,GAAG;IACf,YAAY;IACZ,yBAAyB;IACzB,kBAAkB;IAClB,yBAAyB;IACzB,4BAA4B;IAC5B,iBAAiB;IACjB,0BAA0B;CAC3B,CAAC;AAEI,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,gBAAgB,EACf,EAAA,KAAK,EAAE,KAAK,CAAC,OAAO,EACpB,mBAAmB,EAAE,CAAC,QAAkB,MAAM;AAC5C,YAAA,YAAY,EAAE,QAAQ;AACtB,YAAA,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,MAAM;AAC/B,gBAAA,OAAO,EAAE;AACP,oBAAA,MAAM,EAAE,KAAK;oBACb,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAC1D,iBAAA;AACF,aAAA,CAAC,CAAC;AACJ,SAAA,CAAC,EACF,mBAAmB,EAAE,CAAC,QAAiB,EAAE,MAAuB,EAAE,IAAY,MAAM;AAClF,YAAA,YAAY,EAAE,eAAe;AAC7B,YAAA,MAAM,EAAE,WAAW;AACnB,YAAA,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC;AAClC,YAAA,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;AAC/B,YAAA,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC9B,YAAA,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACnC,SAAA,CAAC,EACF,WAAW,EAAE,CAAC,QAAiB,EAAE,QAAyB,EAAE,OAAmB,MAAM;AACnF,YAAA,YAAY,EAAE,OAAO;AACrB,YAAA,MAAM,EAAE,WAAW;AACnB,YAAA,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC;AAClC,YAAA,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC;AACnC,YAAA,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAChC,OAAO;SACR,CAAC,EAAA,CACF,EACF;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Group } from '@mantine/core';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import { DateTimeInput } from '../DateTimeInput/DateTimeInput.
|
|
3
|
+
import { DateTimeInput } from '../DateTimeInput/DateTimeInput.mjs';
|
|
4
4
|
|
|
5
5
|
function PeriodInput(props) {
|
|
6
6
|
const [value, setValue] = useState(props.defaultValue);
|
|
@@ -11,9 +11,9 @@ function PeriodInput(props) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
|
|
14
|
-
React.createElement(DateTimeInput, { name: props.name + '.start', placeholder: "Start", defaultValue: value
|
|
15
|
-
React.createElement(DateTimeInput, { name: props.name + '.end', placeholder: "End", defaultValue: value
|
|
14
|
+
React.createElement(DateTimeInput, { name: props.name + '.start', placeholder: "Start", defaultValue: value?.start, onChange: (newValue) => setValueWrapper({ ...value, start: newValue }) }),
|
|
15
|
+
React.createElement(DateTimeInput, { name: props.name + '.end', placeholder: "End", defaultValue: value?.end, onChange: (newValue) => setValueWrapper({ ...value, end: newValue }) })));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export { PeriodInput };
|
|
19
|
-
//# sourceMappingURL=PeriodInput.
|
|
19
|
+
//# sourceMappingURL=PeriodInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PeriodInput.mjs","sources":["../../../src/PeriodInput/PeriodInput.tsx"],"sourcesContent":["import { Group } from '@mantine/core';\nimport { Period } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { DateTimeInput } from '../DateTimeInput/DateTimeInput';\n\nexport interface PeriodInputProps {\n name: string;\n defaultValue?: Period;\n onChange?: (value: Period) => void;\n}\n\nexport function PeriodInput(props: PeriodInputProps): JSX.Element {\n const [value, setValue] = useState(props.defaultValue);\n\n function setValueWrapper(newValue: Period): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <DateTimeInput\n name={props.name + '.start'}\n placeholder=\"Start\"\n defaultValue={value?.start}\n onChange={(newValue) => setValueWrapper({ ...value, start: newValue })}\n />\n <DateTimeInput\n name={props.name + '.end'}\n placeholder=\"End\"\n defaultValue={value?.end}\n onChange={(newValue) => setValueWrapper({ ...value, end: newValue })}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;;AAWM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEvD,SAAS,eAAe,CAAC,QAAgB,EAAA;QACvC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;IAED,QACE,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAC,IAAI,EAAC,IAAI,EAAA,IAAA,EAAC,MAAM,EAAA,IAAA,EAAA;AAC7B,QAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EACZ,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,QAAQ,EAC3B,WAAW,EAAC,OAAO,EACnB,YAAY,EAAE,KAAK,EAAE,KAAK,EAC1B,QAAQ,EAAE,CAAC,QAAQ,KAAK,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EACtE,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EACZ,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,MAAM,EACzB,WAAW,EAAC,KAAK,EACjB,YAAY,EAAE,KAAK,EAAE,GAAG,EACxB,QAAQ,EAAE,CAAC,QAAQ,KAAK,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EACpE,CAAA,CACI,EACR;AACJ;;;;"}
|