@medplum/react 1.0.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- 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/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +6 -0
- package/dist/cjs/auth/AuthenticationForm.d.ts +15 -1
- package/dist/cjs/auth/SignInForm.d.ts +1 -0
- package/dist/cjs/{index.js → index.cjs} +675 -549
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.min.cjs +1 -0
- 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.js → AsyncAutocomplete.mjs} +7 -10
- 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} +3 -3
- 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.js → CodeableConceptInput.mjs} +3 -4
- 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} +2 -2
- 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} +13 -16
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +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.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/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +6 -0
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs +13 -0
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs.map +1 -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} +36 -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} +18 -24
- 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} +1 -1
- 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.mjs +43 -0
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +1 -0
- package/dist/esm/auth/AuthenticationForm.d.ts +15 -1
- package/dist/esm/auth/AuthenticationForm.mjs +88 -0
- package/dist/esm/auth/AuthenticationForm.mjs.map +1 -0
- package/dist/esm/auth/ChooseProfileForm.mjs +29 -0
- package/dist/esm/auth/ChooseProfileForm.mjs.map +1 -0
- package/dist/esm/auth/{ChooseScopeForm.js → ChooseScopeForm.mjs} +4 -4
- package/dist/esm/auth/ChooseScopeForm.mjs.map +1 -0
- package/dist/esm/auth/{MfaForm.js → MfaForm.mjs} +4 -4
- 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} +16 -21
- 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 +1 -0
- package/dist/esm/auth/{SignInForm.js → SignInForm.mjs} +36 -29
- 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 +2 -0
- package/dist/esm/index.min.mjs +1 -0
- package/dist/esm/{index.js → index.mjs} +88 -86
- package/dist/esm/index.mjs.map +1 -0
- 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/auth/OktaButton.d.ts +0 -5
- 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/AsyncAutocomplete/AsyncAutocomplete.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.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 -45
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js.map +0 -1
- package/dist/esm/auth/AuthenticationForm.js +0 -54
- 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/MfaForm.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/OktaButton.d.ts +0 -5
- 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
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ActionIcon } from '@mantine/core';
|
|
2
2
|
import { IconCircleMinus, IconCloudUpload } from '@tabler/icons';
|
|
3
3
|
import React, { useState, useRef } from 'react';
|
|
4
|
-
import { AttachmentButton } from '../AttachmentButton/AttachmentButton.
|
|
5
|
-
import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.
|
|
6
|
-
import { killEvent } from '../utils/dom.
|
|
4
|
+
import { AttachmentButton } from '../AttachmentButton/AttachmentButton.mjs';
|
|
5
|
+
import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.mjs';
|
|
6
|
+
import { killEvent } from '../utils/dom.mjs';
|
|
7
7
|
|
|
8
8
|
function AttachmentArrayInput(props) {
|
|
9
|
-
|
|
10
|
-
const [values, setValues] = useState((_a = props.defaultValue) !== null && _a !== void 0 ? _a : []);
|
|
9
|
+
const [values, setValues] = useState(props.defaultValue ?? []);
|
|
11
10
|
const valuesRef = useRef();
|
|
12
11
|
valuesRef.current = values;
|
|
13
12
|
function setValuesWrapper(newValues) {
|
|
@@ -37,9 +36,9 @@ function AttachmentArrayInput(props) {
|
|
|
37
36
|
React.createElement("td", null,
|
|
38
37
|
React.createElement(AttachmentButton, { onUpload: (attachment) => {
|
|
39
38
|
setValuesWrapper([...valuesRef.current, attachment]);
|
|
40
|
-
} }, (props) => (React.createElement(ActionIcon,
|
|
39
|
+
} }, (props) => (React.createElement(ActionIcon, { ...props, title: "Add", size: "sm", color: "green" },
|
|
41
40
|
React.createElement(IconCloudUpload, { size: 16 })))))))));
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
export { AttachmentArrayInput };
|
|
45
|
-
//# sourceMappingURL=AttachmentArrayInput.
|
|
44
|
+
//# sourceMappingURL=AttachmentArrayInput.mjs.map
|
|
@@ -0,0 +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 </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,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;AAE7E,IAAA,MAAM,SAAS,GAAG,MAAM,EAAgB,CAAC;AACzC,IAAA,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;IAE3B,SAAS,gBAAgB,CAAC,SAAuB,EAAA;QAC/C,SAAS,CAAC,SAAS,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC3B,SAAA;KACF;IAED,QACE,+BAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAA;AAC7B,QAAA,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,IAAA;YACE,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,KAAK,EAAG,CAAA;AACnB,YAAA,KAAA,CAAA,aAAA,C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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,14 +1,13 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.
|
|
3
|
-
import { killEvent } from '../utils/dom.
|
|
2
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
3
|
+
import { killEvent } from '../utils/dom.mjs';
|
|
4
4
|
|
|
5
5
|
function AttachmentButton(props) {
|
|
6
6
|
const medplum = useMedplum();
|
|
7
7
|
const fileInputRef = useRef(null);
|
|
8
8
|
function onClick(e) {
|
|
9
|
-
var _a;
|
|
10
9
|
killEvent(e);
|
|
11
|
-
|
|
10
|
+
fileInputRef.current?.click();
|
|
12
11
|
}
|
|
13
12
|
function onFileChange(e) {
|
|
14
13
|
killEvent(e);
|
|
@@ -45,8 +44,7 @@ function AttachmentButton(props) {
|
|
|
45
44
|
});
|
|
46
45
|
})
|
|
47
46
|
.catch((outcome) => {
|
|
48
|
-
|
|
49
|
-
alert((_c = (_b = (_a = outcome === null || outcome === void 0 ? void 0 : outcome.issue) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.details) === null || _c === void 0 ? void 0 : _c.text);
|
|
47
|
+
alert(outcome?.issue?.[0]?.details?.text);
|
|
50
48
|
});
|
|
51
49
|
}
|
|
52
50
|
return (React.createElement(React.Fragment, null,
|
|
@@ -55,4 +53,4 @@ function AttachmentButton(props) {
|
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
export { AttachmentButton };
|
|
58
|
-
//# sourceMappingURL=AttachmentButton.
|
|
56
|
+
//# sourceMappingURL=AttachmentButton.mjs.map
|
|
@@ -0,0 +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(e)}\n />\n {props.children({ onClick })}\n </>\n );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G;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,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;AACE,QAAA,KAAA,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;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Anchor } from '@mantine/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
function AttachmentDisplay(props) {
|
|
5
|
+
const value = props.value;
|
|
6
|
+
const { contentType, url, title } = value ?? {};
|
|
7
|
+
if (!url) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
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
|
+
}
|
|
19
|
+
|
|
20
|
+
export { AttachmentDisplay };
|
|
21
|
+
//# sourceMappingURL=AttachmentDisplay.mjs.map
|
|
@@ -0,0 +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>\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G,EAAE,GAAG,GAAG,aAAa,EACxB,eAAe,EAAE,IAAI,EACrB,WAAW,EAAE,CAAC,EACd,QAAQ,EAAE,IAAI,EACd,CAAA,CACE,CACP;QACD,KAAiB,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAA,eAAe,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,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,8 +1,8 @@
|
|
|
1
1
|
import { Button } from '@mantine/core';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import { AttachmentButton } from '../AttachmentButton/AttachmentButton.
|
|
4
|
-
import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.
|
|
5
|
-
import { killEvent } from '../utils/dom.
|
|
3
|
+
import { AttachmentButton } from '../AttachmentButton/AttachmentButton.mjs';
|
|
4
|
+
import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.mjs';
|
|
5
|
+
import { killEvent } from '../utils/dom.mjs';
|
|
6
6
|
|
|
7
7
|
function AttachmentInput(props) {
|
|
8
8
|
const [value, setValue] = useState(props.defaultValue);
|
|
@@ -20,8 +20,8 @@ function AttachmentInput(props) {
|
|
|
20
20
|
setValueWrapper(undefined);
|
|
21
21
|
} }, "Remove")));
|
|
22
22
|
}
|
|
23
|
-
return (React.createElement(AttachmentButton, { onUpload: setValueWrapper }, (props) => React.createElement(Button,
|
|
23
|
+
return (React.createElement(AttachmentButton, { onUpload: setValueWrapper }, (props) => React.createElement(Button, { ...props }, "Upload...")));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export { AttachmentInput };
|
|
27
|
-
//# sourceMappingURL=AttachmentInput.
|
|
27
|
+
//# sourceMappingURL=AttachmentInput.mjs.map
|
|
@@ -0,0 +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":[],"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;;;;"}
|
package/dist/esm/BackboneElementDisplay/{BackboneElementDisplay.js → BackboneElementDisplay.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { globalSchema, getPropertyDisplayName } from '@medplum/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { DEFAULT_IGNORED_PROPERTIES } from '../constants.
|
|
4
|
-
import { DescriptionList, DescriptionListEntry } from '../DescriptionList/DescriptionList.
|
|
5
|
-
import { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.
|
|
3
|
+
import { DEFAULT_IGNORED_PROPERTIES } from '../constants.mjs';
|
|
4
|
+
import { DescriptionList, DescriptionListEntry } from '../DescriptionList/DescriptionList.mjs';
|
|
5
|
+
import { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
|
|
6
6
|
|
|
7
7
|
function BackboneElementDisplay(props) {
|
|
8
8
|
const typedValue = props.value;
|
|
@@ -46,4 +46,4 @@ function BackboneElementDisplay(props) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export { BackboneElementDisplay };
|
|
49
|
-
//# sourceMappingURL=BackboneElementDisplay.
|
|
49
|
+
//# sourceMappingURL=BackboneElementDisplay.mjs.map
|
|
@@ -0,0 +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} 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}\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,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,16 +1,15 @@
|
|
|
1
1
|
import { Stack } from '@mantine/core';
|
|
2
2
|
import { globalSchema, getPropertyDisplayName } from '@medplum/core';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
-
import { CheckboxFormSection } from '../CheckboxFormSection/CheckboxFormSection.
|
|
5
|
-
import { DEFAULT_IGNORED_PROPERTIES } from '../constants.
|
|
6
|
-
import { FormSection } from '../FormSection/FormSection.
|
|
7
|
-
import { setPropertyValue } from '../ResourceForm/ResourceForm.
|
|
8
|
-
import { getValueAndType } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.
|
|
9
|
-
import { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput.
|
|
4
|
+
import { CheckboxFormSection } from '../CheckboxFormSection/CheckboxFormSection.mjs';
|
|
5
|
+
import { DEFAULT_IGNORED_PROPERTIES } from '../constants.mjs';
|
|
6
|
+
import { FormSection } from '../FormSection/FormSection.mjs';
|
|
7
|
+
import { setPropertyValue } from '../ResourceForm/ResourceForm.mjs';
|
|
8
|
+
import { getValueAndType } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
|
|
9
|
+
import { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput.mjs';
|
|
10
10
|
|
|
11
11
|
function BackboneElementInput(props) {
|
|
12
|
-
|
|
13
|
-
const [value, setValue] = useState((_a = props.defaultValue) !== null && _a !== void 0 ? _a : {});
|
|
12
|
+
const [value, setValue] = useState(props.defaultValue ?? {});
|
|
14
13
|
function setValueWrapper(newValue) {
|
|
15
14
|
setValue(newValue);
|
|
16
15
|
if (props.onChange) {
|
|
@@ -38,15 +37,15 @@ function BackboneElementInput(props) {
|
|
|
38
37
|
if (property.type.length === 1 && property.type[0].code === 'boolean') {
|
|
39
38
|
return (React.createElement(CheckboxFormSection, { key: key, title: getPropertyDisplayName(key), description: property.definition, htmlFor: key },
|
|
40
39
|
React.createElement(ResourcePropertyInput, { property: property, name: key, defaultValue: propertyValue, defaultPropertyType: propertyType, outcome: props.outcome, onChange: (newValue, propName) => {
|
|
41
|
-
setValueWrapper(setPropertyValue(value, key, propName
|
|
40
|
+
setValueWrapper(setPropertyValue(value, key, propName ?? key, entry[1], newValue));
|
|
42
41
|
} })));
|
|
43
42
|
}
|
|
44
43
|
return (React.createElement(FormSection, { key: key, title: getPropertyDisplayName(key), description: property.definition, htmlFor: key, outcome: props.outcome },
|
|
45
44
|
React.createElement(ResourcePropertyInput, { property: property, name: key, defaultValue: propertyValue, defaultPropertyType: propertyType, outcome: props.outcome, onChange: (newValue, propName) => {
|
|
46
|
-
setValueWrapper(setPropertyValue(value, key, propName
|
|
45
|
+
setValueWrapper(setPropertyValue(value, key, propName ?? key, entry[1], newValue));
|
|
47
46
|
} })));
|
|
48
47
|
})));
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
export { BackboneElementInput };
|
|
52
|
-
//# sourceMappingURL=BackboneElementInput.
|
|
51
|
+
//# sourceMappingURL=BackboneElementInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackboneElementInput.mjs","sources":["../../../src/BackboneElementInput/BackboneElementInput.tsx"],"sourcesContent":["import { Stack } from '@mantine/core';\nimport { getPropertyDisplayName, globalSchema } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { CheckboxFormSection } from '../CheckboxFormSection/CheckboxFormSection';\nimport { DEFAULT_IGNORED_PROPERTIES } from '../constants';\nimport { FormSection } from '../FormSection/FormSection';\nimport { setPropertyValue } from '../ResourceForm/ResourceForm';\nimport { getValueAndType } from '../ResourcePropertyDisplay/ResourcePropertyDisplay';\nimport { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput';\n\nexport interface BackboneElementInputProps {\n typeName: string;\n defaultValue?: any;\n outcome?: OperationOutcome;\n onChange?: (value: any) => void;\n}\n\nexport function BackboneElementInput(props: BackboneElementInputProps): JSX.Element {\n const [value, setValue] = useState<any>(props.defaultValue ?? {});\n\n function setValueWrapper(newValue: any): void {\n setValue(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n const typeName = props.typeName;\n const typeSchema = globalSchema.types[typeName];\n if (!typeSchema) {\n return <div>{typeName} not implemented</div>;\n }\n\n const typedValue = { type: typeName, value };\n\n return (\n <Stack>\n {Object.entries(typeSchema.properties).map((entry) => {\n const key = entry[0];\n if (key === 'id' || DEFAULT_IGNORED_PROPERTIES.indexOf(key) >= 0) {\n return null;\n }\n const property = entry[1];\n if (!property.type) {\n return null;\n }\n\n const [propertyValue, propertyType] = getValueAndType(typedValue, key);\n\n if (property.type.length === 1 && property.type[0].code === 'boolean') {\n return (\n <CheckboxFormSection\n key={key}\n title={getPropertyDisplayName(key)}\n description={property.definition}\n htmlFor={key}\n >\n <ResourcePropertyInput\n property={property}\n name={key}\n defaultValue={propertyValue}\n defaultPropertyType={propertyType}\n outcome={props.outcome}\n onChange={(newValue: any, propName?: string) => {\n setValueWrapper(setPropertyValue(value, key, propName ?? key, entry[1], newValue));\n }}\n />\n </CheckboxFormSection>\n );\n }\n\n return (\n <FormSection\n key={key}\n title={getPropertyDisplayName(key)}\n description={property.definition}\n htmlFor={key}\n outcome={props.outcome}\n >\n <ResourcePropertyInput\n property={property}\n name={key}\n defaultValue={propertyValue}\n defaultPropertyType={propertyType}\n outcome={props.outcome}\n onChange={(newValue: any, propName?: string) => {\n setValueWrapper(setPropertyValue(value, key, propName ?? key, entry[1], newValue));\n }}\n />\n </FormSection>\n );\n })}\n </Stack>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAkBM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAM,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IAElE,SAAS,eAAe,CAAC,QAAa,EAAA;QACpC,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,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAChC,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,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,K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E,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;qBACpF,EAAA,CACD,CACkB,EACtB;AACH,SAAA;AAED,QAAA,QACE,KAAA,CAAA,aAAA,CAAC,WAAW,EAAA,EACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,sBAAsB,CAAC,GAAG,CAAC,EAClC,WAAW,EAAE,QAAQ,CAAC,UAAU,EAChC,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA;AAEtB,YAAA,KAAA,CAAA,aAAA,CAAC,qBAAqB,EAAA,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,aAAa,EAC3B,mBAAmB,EAAE,YAAY,EACjC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,CAAC,QAAa,EAAE,QAAiB,KAAI;AAC7C,oBAAA,eAAe,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;iBACpF,EAAA,CACD,CACU,EACd;KACH,CAAC,CACI,EACR;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarInput.mjs","sources":["../../../src/CalendarInput/CalendarInput.tsx"],"sourcesContent":["import { Button, createStyles, Group } from '@mantine/core';\nimport { Slot } from '@medplum/fhirtypes';\nimport React, { useMemo, useState } from 'react';\n\nconst useStyles = createStyles((theme) => ({\n table: {\n width: 350,\n\n '& th': {\n fontWeight: 'normal',\n fontSize: 11,\n padding: 8,\n textAlign: 'center',\n },\n\n '& td': {\n padding: '2px 4px',\n },\n\n '& td button': {\n width: 44,\n height: 44,\n color: theme.colors[theme.primaryColor][5],\n fontSize: 16,\n fontWeight: 500,\n textAlign: 'center',\n padding: 0,\n backgroundColor: theme.colors[theme.primaryColor][0],\n border: 0,\n borderRadius: '50%',\n cursor: 'pointer',\n },\n\n '& td button:hover': {\n backgroundColor: theme.colors[theme.primaryColor][1],\n },\n\n '& td button:disabled': {\n backgroundColor: 'transparent',\n cursor: 'default',\n color: theme.colors.gray[4],\n fontWeight: 'normal',\n },\n },\n}));\n\nexport interface CalendarInputProps {\n slots: Slot[];\n onChangeMonth: (date: Date) => void;\n onClick: (date: Date) => void;\n}\n\n/**\n * Returns a month display string (e.g. \"January 2020\").\n * @param date Any date within the month.\n * @returns The month display string (e.g. \"January 2020\")\n */\nexport function getMonthString(date: Date): string {\n return date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\n}\n\ninterface CalendarCell {\n date: Date;\n available: boolean;\n}\n\ntype OptionalCalendarCell = CalendarCell | undefined;\n\nexport function CalendarInput(props: CalendarInputProps): JSX.Element {\n const { classes } = useStyles();\n const { onChangeMonth, onClick } = props;\n const [month, setMonth] = useState<Date>(getStartMonth);\n\n function moveMonth(delta: number): void {\n setMonth((currMonth) => {\n const newMonth = new Date(currMonth.getTime());\n newMonth.setMonth(currMonth.getMonth() + delta);\n onChangeMonth(newMonth);\n return newMonth;\n });\n }\n\n const grid = useMemo(() => buildGrid(month, props.slots), [month, props.slots]);\n\n return (\n <div>\n <Group position=\"apart\" spacing=\"xs\" grow noWrap>\n <p style={{ flex: 1 }}>{getMonthString(month)}</p>\n <Group position=\"right\" spacing=\"xs\">\n <Button variant=\"outline\" aria-label=\"Previous month\" onClick={() => moveMonth(-1)}>\n <\n </Button>\n <Button variant=\"outline\" aria-label=\"Next month\" onClick={() => moveMonth(1)}>\n >\n </Button>\n </Group>\n </Group>\n <table className={classes.table}>\n <thead>\n <tr>\n <th>SUN</th>\n <th>MON</th>\n <th>TUE</th>\n <th>WED</th>\n <th>THU</th>\n <th>FRI</th>\n <th>SAT</th>\n </tr>\n </thead>\n <tbody>\n {grid.map((week, weekIndex) => (\n <tr key={'week-' + weekIndex}>\n {week.map((day, dayIndex) => (\n <td key={'day-' + dayIndex}>\n {day && (\n <Button disabled={!day.available} onClick={() => onClick(day.date)}>\n {day.date.getDate()}\n </Button>\n )}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport function getStartMonth(): Date {\n const result = new Date();\n result.setDate(1);\n result.setHours(0, 0, 0, 0);\n return result;\n}\n\nfunction buildGrid(startDate: Date, slots: Slot[]): OptionalCalendarCell[][] {\n const d = new Date(startDate.getFullYear(), startDate.getMonth());\n const grid: OptionalCalendarCell[][] = [];\n let row: OptionalCalendarCell[] = [];\n\n // Fill leading empty days\n for (let i = 0; i < d.getDay(); i++) {\n row.push(undefined);\n }\n\n while (d.getMonth() === startDate.getMonth()) {\n row.push({\n date: new Date(d.getTime()),\n available: isDayAvailable(d, slots),\n });\n\n if (d.getDay() === 6) {\n grid.push(row);\n row = [];\n }\n\n d.setDate(d.getDate() + 1);\n }\n\n // Fill trailing empty days\n if (d.getDay() !== 0) {\n for (let i = d.getDay(); i < 7; i++) {\n row.push(undefined);\n }\n grid.push(row);\n }\n\n return grid;\n}\n\n/**\n * Returns true if the given date is available for booking.\n * @param day The day to check.\n * @param slots The list of available slots.\n * @returns True if there are any available slots for the day.\n */\nfunction isDayAvailable(day: Date, slots: Slot[]): boolean {\n // Note that slot start and end time may or may not be in UTC.\n for (const slot of slots) {\n const slotStart = new Date(slot.start as string);\n if (\n slotStart.getFullYear() === day.getFullYear() &&\n slotStart.getMonth() === day.getMonth() &&\n slotStart.getDate() === day.getDate()\n ) {\n return true;\n }\n }\n\n return false;\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,KAAK,EAAE;AACL,QAAA,KAAK,EAAE,GAAG;AAEV,QAAA,MAAM,EAAE;AACN,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,QAAQ,EAAE,EAAE;AACZ,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,SAAS,EAAE,QAAQ;AACpB,SA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C;YACf,GAAG,GAAG,EAAE,CAAC;AACV,SAAA;QAED,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;AAC5B,KAAA;;AAGD,IAAA,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;AACpB,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AACnC,YAAA,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACrB,SAAA;AACD,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,KAAA;AAED,IAAA,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;AAKG;AACH,SAAS,cAAc,CAAC,GAAS,EAAE,KAAa,EAAA;;AAE9C,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC;QACjD,IACE,SAAS,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,WAAW,EAAE;AAC7C,YAAA,SAAS,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,QAAQ,EAAE;YACvC,SAAS,CAAC,OAAO,EAAE,KAAK,GAAG,CAAC,OAAO,EAAE,EACrC;AACA,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;AACF,KAAA;AAED,IAAA,OAAO,KAAK,CAAC;AACf;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxFormSection.mjs","sources":["../../../src/CheckboxFormSection/CheckboxFormSection.tsx"],"sourcesContent":["import { Group, Input } from '@mantine/core';\nimport React from 'react';\n\nexport interface CheckboxFormSectionProps {\n htmlFor?: string;\n title?: string;\n description?: string;\n children?: React.ReactNode;\n}\n\nexport function CheckboxFormSection(props: CheckboxFormSectionProps): JSX.Element {\n return (\n <Group noWrap>\n <div>{props.children}</div>\n <div>\n <Input.Wrapper id={props.htmlFor} label={props.title} description={props.description}>\n {(() => null)()}\n </Input.Wrapper>\n </div>\n </Group>\n );\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,mBAAmB,CAAC,KAA+B,EAAA;AACjE,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,MAAM,EAAA,IAAA,EAAA;QACX,KAAM,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAA,KAAK,CAAC,QAAQ,CAAO;AAC3B,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;AACE,YAAA,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAO,EAAA,EAAC,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAA,EACjF,CAAC,MAAM,IAAI,GAAG,CACD,CACZ,CACA,EACR;AACJ;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete.
|
|
2
|
+
import { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete.mjs';
|
|
3
3
|
|
|
4
4
|
function CodeInput(props) {
|
|
5
5
|
const [value, setValue] = useState(props.defaultValue);
|
|
@@ -17,8 +17,8 @@ function codeToValueSetElement(code) {
|
|
|
17
17
|
return code ? { code } : undefined;
|
|
18
18
|
}
|
|
19
19
|
function valueSetElementToCode(element) {
|
|
20
|
-
return element
|
|
20
|
+
return element?.code;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export { CodeInput };
|
|
24
|
-
//# sourceMappingURL=CodeInput.
|
|
24
|
+
//# sourceMappingURL=CodeInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeInput.mjs","sources":["../../../src/CodeInput/CodeInput.tsx"],"sourcesContent":["import { ElementDefinition, ValueSetExpansionContains } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete';\n\nexport interface CodeInputProps {\n property: ElementDefinition;\n name: string;\n placeholder?: string;\n defaultValue?: string;\n onChange?: (value: string | undefined) => void;\n}\n\nexport function CodeInput(props: CodeInputProps): JSX.Element {\n const [value, setValue] = useState<string | undefined>(props.defaultValue);\n\n function handleChange(newValues: ValueSetExpansionContains[]): void {\n const newValue = newValues[0];\n const newCode = valueSetElementToCode(newValue);\n setValue(newCode);\n if (props.onChange) {\n props.onChange(newCode);\n }\n }\n\n return (\n <ValueSetAutocomplete\n elementDefinition={props.property}\n name={props.name}\n placeholder={props.placeholder}\n defaultValue={codeToValueSetElement(value)}\n onChange={handleChange}\n />\n );\n}\n\nfunction codeToValueSetElement(code: string | undefined): ValueSetExpansionContains | undefined {\n return code ? { code } : undefined;\n}\n\nfunction valueSetElementToCode(element: ValueSetExpansionContains | undefined): string | undefined {\n return element?.code;\n}\n"],"names":[],"mappings":";;;AAYM,SAAU,SAAS,CAAC,KAAqB,EAAA;AAC7C,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,KAAK,CAAC,YAAY,CAAC,CAAC;IAE3E,SAAS,YAAY,CAAC,SAAsC,EAAA;AAC1D,QAAA,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC9B,QAAA,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAChD,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACzB,SAAA;KACF;AAED,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,oBAAoB,EAAA,EACnB,iBAAiB,EAAE,KAAK,CAAC,QAAQ,EACjC,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,YAAY,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAC1C,QAAQ,EAAE,YAAY,EAAA,CACtB,EACF;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAwB,EAAA;IACrD,OAAO,IAAI,GAAG,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;AACrC,CAAC;AAED,SAAS,qBAAqB,CAAC,OAA8C,EAAA;IAC3E,OAAO,OAAO,EAAE,IAAI,CAAC;AACvB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeableConceptDisplay.mjs","sources":["../../../src/CodeableConceptDisplay/CodeableConceptDisplay.tsx"],"sourcesContent":["import { formatCodeableConcept } from '@medplum/core';\nimport { CodeableConcept } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface CodeableConceptDisplayProps {\n value?: CodeableConcept;\n}\n\nexport function CodeableConceptDisplay(props: CodeableConceptDisplayProps): JSX.Element {\n return <>{formatCodeableConcept(props.value)}</>;\n}\n"],"names":[],"mappings":";;;AAQM,SAAU,sBAAsB,CAAC,KAAkC,EAAA;IACvE,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAI,CAAC;AACnD;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete.
|
|
2
|
+
import { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete.mjs';
|
|
3
3
|
|
|
4
4
|
function CodeableConceptInput(props) {
|
|
5
5
|
const [value, setValue] = useState(props.defaultValue);
|
|
@@ -13,8 +13,7 @@ function CodeableConceptInput(props) {
|
|
|
13
13
|
return (React.createElement(ValueSetAutocomplete, { elementDefinition: props.property, name: props.name, placeholder: props.placeholder, defaultValue: value && codeableConceptToValueSetElement(value), onChange: handleChange }));
|
|
14
14
|
}
|
|
15
15
|
function codeableConceptToValueSetElement(concept) {
|
|
16
|
-
|
|
17
|
-
return (_a = concept.coding) === null || _a === void 0 ? void 0 : _a.map((c) => ({
|
|
16
|
+
return concept.coding?.map((c) => ({
|
|
18
17
|
system: c.system,
|
|
19
18
|
code: c.code,
|
|
20
19
|
display: c.display,
|
|
@@ -34,4 +33,4 @@ function valueSetElementToCodeableConcept(elements) {
|
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
export { CodeableConceptInput };
|
|
37
|
-
//# sourceMappingURL=CodeableConceptInput.
|
|
36
|
+
//# sourceMappingURL=CodeableConceptInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeableConceptInput.mjs","sources":["../../../src/CodeableConceptInput/CodeableConceptInput.tsx"],"sourcesContent":["import { CodeableConcept, ElementDefinition, ValueSetExpansionContains } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete';\n\nexport interface CodeableConceptInputProps {\n property: ElementDefinition;\n name: string;\n placeholder?: string;\n defaultValue?: CodeableConcept;\n onChange?: (value: CodeableConcept | undefined) => void;\n}\n\nexport function CodeableConceptInput(props: CodeableConceptInputProps): JSX.Element {\n const [value, setValue] = useState<CodeableConcept | undefined>(props.defaultValue);\n\n function handleChange(newValues: ValueSetExpansionContains[]): void {\n const newConcept = valueSetElementToCodeableConcept(newValues);\n setValue(newConcept);\n if (props.onChange) {\n props.onChange(newConcept);\n }\n }\n\n return (\n <ValueSetAutocomplete\n elementDefinition={props.property}\n name={props.name}\n placeholder={props.placeholder}\n defaultValue={value && codeableConceptToValueSetElement(value)}\n onChange={handleChange}\n />\n );\n}\n\nfunction codeableConceptToValueSetElement(concept: CodeableConcept): ValueSetExpansionContains[] | undefined {\n return concept.coding?.map((c) => ({\n system: c.system,\n code: c.code,\n display: c.display,\n }));\n}\n\nfunction valueSetElementToCodeableConcept(elements: ValueSetExpansionContains[]): CodeableConcept | undefined {\n if (elements.length === 0) {\n return undefined;\n }\n return {\n coding: elements.map((e) => ({\n system: e.system,\n code: e.code,\n display: e.display,\n })),\n };\n}\n"],"names":[],"mappings":";;;AAYM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAA8B,KAAK,CAAC,YAAY,CAAC,CAAC;IAEpF,SAAS,YAAY,CAAC,SAAsC,EAAA;AAC1D,QAAA,MAAM,UAAU,GAAG,gCAAgC,CAAC,SAAS,CAAC,CAAC;QAC/D,QAAQ,CAAC,UAAU,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC5B,SAAA;KACF;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,oBAAoB,EACnB,EAAA,iBAAiB,EAAE,KAAK,CAAC,QAAQ,EACjC,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,YAAY,EAAE,KAAK,IAAI,gCAAgC,CAAC,KAAK,CAAC,EAC9D,QAAQ,EAAE,YAAY,EAAA,CACtB,EACF;AACJ,CAAC;AAED,SAAS,gCAAgC,CAAC,OAAwB,EAAA;IAChE,OAAO,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM;QACjC,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,OAAO,EAAE,CAAC,CAAC,OAAO;AACnB,KAAA,CAAC,CAAC,CAAC;AACN,CAAC;AAED,SAAS,gCAAgC,CAAC,QAAqC,EAAA;AAC7E,IAAA,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;AACzB,QAAA,OAAO,SAAS,CAAC;AAClB,KAAA;IACD,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM;YAC3B,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;AACnB,SAAA,CAAC,CAAC;KACJ,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodingDisplay.mjs","sources":["../../../src/CodingDisplay/CodingDisplay.tsx"],"sourcesContent":["import { formatCoding } from '@medplum/core';\nimport { Coding } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface CodingDisplayProps {\n value?: Coding;\n}\n\nexport function CodingDisplay(props: CodingDisplayProps): JSX.Element {\n return <>{formatCoding(props.value)}</>;\n}\n"],"names":[],"mappings":";;;AAQM,SAAU,aAAa,CAAC,KAAyB,EAAA;IACrD,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAI,CAAC;AAC1C;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete.
|
|
2
|
+
import { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete.mjs';
|
|
3
3
|
|
|
4
4
|
function CodingInput(props) {
|
|
5
5
|
const [value, setValue] = useState(props.defaultValue);
|
|
@@ -29,4 +29,4 @@ function valueSetElementToCoding(element) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { CodingInput };
|
|
32
|
-
//# sourceMappingURL=CodingInput.
|
|
32
|
+
//# sourceMappingURL=CodingInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodingInput.mjs","sources":["../../../src/CodingInput/CodingInput.tsx"],"sourcesContent":["import { Coding, ElementDefinition, ValueSetExpansionContains } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { ValueSetAutocomplete } from '../ValueSetAutocomplete/ValueSetAutocomplete';\n\nexport interface CodingInputProps {\n property: ElementDefinition;\n name: string;\n placeholder?: string;\n defaultValue?: Coding;\n onChange?: (value: Coding | undefined) => void;\n}\n\nexport function CodingInput(props: CodingInputProps): JSX.Element {\n const [value, setValue] = useState<Coding | undefined>(props.defaultValue);\n\n function handleChange(newValues: ValueSetExpansionContains[]): void {\n const newValue = newValues[0];\n const newConcept = newValue && valueSetElementToCoding(newValue);\n setValue(newConcept);\n if (props.onChange) {\n props.onChange(newConcept);\n }\n }\n\n return (\n <ValueSetAutocomplete\n elementDefinition={props.property}\n name={props.name}\n placeholder={props.placeholder}\n defaultValue={value && codingToValueSetElement(value)}\n onChange={handleChange}\n />\n );\n}\n\nfunction codingToValueSetElement(coding: Coding): ValueSetExpansionContains {\n return {\n system: coding.system,\n code: coding.code,\n display: coding.display,\n };\n}\n\nfunction valueSetElementToCoding(element: ValueSetExpansionContains): Coding {\n return {\n system: element.system,\n code: element.code,\n display: element.display,\n };\n}\n"],"names":[],"mappings":";;;AAYM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,KAAK,CAAC,YAAY,CAAC,CAAC;IAE3E,SAAS,YAAY,CAAC,SAAsC,EAAA;AAC1D,QAAA,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,UAAU,GAAG,QAAQ,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QACjE,QAAQ,CAAC,UAAU,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC5B,SAAA;KACF;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,oBAAoB,EACnB,EAAA,iBAAiB,EAAE,KAAK,CAAC,QAAQ,EACjC,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,YAAY,EAAE,KAAK,IAAI,uBAAuB,CAAC,KAAK,CAAC,EACrD,QAAQ,EAAE,YAAY,EAAA,CACtB,EACF;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,MAAc,EAAA;IAC7C,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,OAAkC,EAAA;IACjE,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;AACJ;;;;"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay.
|
|
2
|
+
import { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay.mjs';
|
|
3
3
|
|
|
4
4
|
function ContactDetailDisplay(props) {
|
|
5
|
-
var _a;
|
|
6
5
|
const contactDetail = props.value;
|
|
7
6
|
if (!contactDetail) {
|
|
8
7
|
return null;
|
|
9
8
|
}
|
|
10
9
|
return (React.createElement(React.Fragment, null,
|
|
11
10
|
contactDetail.name,
|
|
12
|
-
contactDetail.name && ': ',
|
|
13
|
-
|
|
11
|
+
contactDetail.name && ': ',
|
|
12
|
+
contactDetail.telecom?.map((telecom, index) => (React.createElement(ContactPointDisplay, { key: 'telecom-' + index, value: telecom })))));
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export { ContactDetailDisplay };
|
|
17
|
-
//# sourceMappingURL=ContactDetailDisplay.
|
|
16
|
+
//# sourceMappingURL=ContactDetailDisplay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactDetailDisplay.mjs","sources":["../../../src/ContactDetailDisplay/ContactDetailDisplay.tsx"],"sourcesContent":["import { ContactDetail } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay';\n\nexport interface ContactDetailDisplayProps {\n value?: ContactDetail;\n}\n\nexport function ContactDetailDisplay(props: ContactDetailDisplayProps): JSX.Element | null {\n const contactDetail = props.value;\n if (!contactDetail) {\n return null;\n }\n\n return (\n <>\n {contactDetail.name}\n {contactDetail.name && ': '}\n {contactDetail.telecom?.map((telecom, index) => (\n <ContactPointDisplay key={'telecom-' + index} value={telecom} />\n ))}\n </>\n );\n}\n"],"names":[],"mappings":";;;AAQM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;IAClC,IAAI,CAAC,aAAa,EAAE;AAClB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;AACG,QAAA,aAAa,CAAC,IAAI;QAClB,aAAa,CAAC,IAAI,IAAI,IAAI;AAC1B,QAAA,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,MACzC,KAAC,CAAA,aAAA,CAAA,mBAAmB,EAAC,EAAA,GAAG,EAAE,UAAU,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,EAAI,CAAA,CACjE,CAAC,CACD,EACH;AACJ;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Group, TextInput } from '@mantine/core';
|
|
2
2
|
import React, { useState, useRef } from 'react';
|
|
3
|
-
import { ContactPointInput } from '../ContactPointInput/ContactPointInput.
|
|
3
|
+
import { ContactPointInput } from '../ContactPointInput/ContactPointInput.mjs';
|
|
4
4
|
|
|
5
5
|
function ContactDetailInput(props) {
|
|
6
|
-
var _a;
|
|
7
6
|
const [contactPoint, setContactDetail] = useState(props.defaultValue);
|
|
8
7
|
const ref = useRef();
|
|
9
8
|
ref.current = contactPoint;
|
|
@@ -14,23 +13,23 @@ function ContactDetailInput(props) {
|
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
function setName(name) {
|
|
17
|
-
const newValue =
|
|
16
|
+
const newValue = { ...ref.current, name };
|
|
18
17
|
if (!name) {
|
|
19
18
|
delete newValue.name;
|
|
20
19
|
}
|
|
21
20
|
setContactDetailWrapper(newValue);
|
|
22
21
|
}
|
|
23
22
|
function setTelecom(telecom) {
|
|
24
|
-
const newValue =
|
|
23
|
+
const newValue = { ...ref.current, telecom: telecom && [telecom] };
|
|
25
24
|
if (!telecom) {
|
|
26
25
|
delete newValue.telecom;
|
|
27
26
|
}
|
|
28
27
|
setContactDetailWrapper(newValue);
|
|
29
28
|
}
|
|
30
29
|
return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
|
|
31
|
-
React.createElement(TextInput, { "data-testid": props.name + '-name', name: props.name + '-name', placeholder: "Name", style: { width: 180 }, defaultValue: contactPoint
|
|
32
|
-
React.createElement(ContactPointInput, { name: props.name + '-telecom', defaultValue:
|
|
30
|
+
React.createElement(TextInput, { "data-testid": props.name + '-name', name: props.name + '-name', placeholder: "Name", style: { width: 180 }, defaultValue: contactPoint?.name, onChange: (e) => setName(e.currentTarget.value) }),
|
|
31
|
+
React.createElement(ContactPointInput, { name: props.name + '-telecom', defaultValue: contactPoint?.telecom?.[0], onChange: setTelecom })));
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
export { ContactDetailInput };
|
|
36
|
-
//# sourceMappingURL=ContactDetailInput.
|
|
35
|
+
//# sourceMappingURL=ContactDetailInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactDetailInput.mjs","sources":["../../../src/ContactDetailInput/ContactDetailInput.tsx"],"sourcesContent":["import { Group, TextInput } from '@mantine/core';\nimport { ContactDetail, ContactPoint } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\nimport { ContactPointInput } from '../ContactPointInput/ContactPointInput';\n\nexport interface ContactDetailInputProps {\n name: string;\n defaultValue?: ContactDetail;\n onChange?: (value: ContactDetail) => void;\n}\n\nexport function ContactDetailInput(props: ContactDetailInputProps): JSX.Element {\n const [contactPoint, setContactDetail] = useState(props.defaultValue);\n\n const ref = useRef<ContactDetail>();\n ref.current = contactPoint;\n\n function setContactDetailWrapper(newValue: ContactDetail): void {\n setContactDetail(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setName(name: string): void {\n const newValue: ContactDetail = { ...ref.current, name };\n if (!name) {\n delete newValue.name;\n }\n setContactDetailWrapper(newValue);\n }\n\n function setTelecom(telecom: ContactPoint | undefined): void {\n const newValue: ContactDetail = { ...ref.current, telecom: telecom && [telecom] };\n if (!telecom) {\n delete newValue.telecom;\n }\n setContactDetailWrapper(newValue);\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <TextInput\n data-testid={props.name + '-name'}\n name={props.name + '-name'}\n placeholder=\"Name\"\n style={{ width: 180 }}\n defaultValue={contactPoint?.name}\n onChange={(e) => setName(e.currentTarget.value)}\n />\n <ContactPointInput\n name={props.name + '-telecom'}\n defaultValue={contactPoint?.telecom?.[0]}\n onChange={setTelecom}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;;AAWM,SAAU,kBAAkB,CAAC,KAA8B,EAAA;AAC/D,IAAA,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAEtE,IAAA,MAAM,GAAG,GAAG,MAAM,EAAiB,CAAC;AACpC,IAAA,GAAG,CAAC,OAAO,GAAG,YAAY,CAA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,KAAK,CAAC,IAAI,GAAG,UAAU,EAC7B,YAAY,EAAE,YAAY,EAAE,OAAO,GAAG,CAAC,CAAC,EACxC,QAAQ,EAAE,UAAU,EAAA,CACpB,CACI,EACR;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactPointDisplay.mjs","sources":["../../../src/ContactPointDisplay/ContactPointDisplay.tsx"],"sourcesContent":["import { ContactPoint } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface ContactPointDisplayProps {\n value?: ContactPoint;\n}\n\nexport function ContactPointDisplay(props: ContactPointDisplayProps): JSX.Element | null {\n const contactPoint = props.value;\n if (!contactPoint) {\n return null;\n }\n\n const builder = [];\n\n if (contactPoint.value) {\n builder.push(contactPoint.value);\n }\n\n if (contactPoint.use || contactPoint.system) {\n builder.push(' [');\n\n if (contactPoint.use) {\n builder.push(contactPoint.use);\n }\n\n if (contactPoint.use && contactPoint.system) {\n builder.push(' ');\n }\n\n if (contactPoint.system) {\n builder.push(contactPoint.system);\n }\n\n builder.push(']');\n }\n\n return <>{builder.join('').trim()}</>;\n}\n"],"names":[],"mappings":";;AAOM,SAAU,mBAAmB,CAAC,KAA+B,EAAA;AACjE,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;IACjC,IAAI,CAAC,YAAY,EAAE;AACjB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;IAED,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,IAAI,YAAY,CAAC,KAAK,EAAE;AACtB,QAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAClC,KAAA;AAED,IAAA,IAAI,YAAY,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE;AAC3C,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnB,IAAI,YAAY,CAAC,GAAG,EAAE;AACpB,YAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAChC,SAAA;AAED,QAAA,IAAI,YAAY,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE;AAC3C,YAAA,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,SAAA;QAED,IAAI,YAAY,CAAC,MAAM,EAAE;AACvB,YAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,KAAA;IAED,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAI,CAAC;AACxC;;;;"}
|
|
@@ -15,31 +15,31 @@ function ContactPointInput(props) {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
function setSystem(system) {
|
|
18
|
-
const newValue =
|
|
18
|
+
const newValue = { ...ref.current, system };
|
|
19
19
|
if (!system) {
|
|
20
20
|
delete newValue.system;
|
|
21
21
|
}
|
|
22
22
|
setContactPointWrapper(newValue);
|
|
23
23
|
}
|
|
24
24
|
function setUse(use) {
|
|
25
|
-
const newValue =
|
|
25
|
+
const newValue = { ...ref.current, use };
|
|
26
26
|
if (!use) {
|
|
27
27
|
delete newValue.use;
|
|
28
28
|
}
|
|
29
29
|
setContactPointWrapper(newValue);
|
|
30
30
|
}
|
|
31
31
|
function setValue(value) {
|
|
32
|
-
const newValue =
|
|
32
|
+
const newValue = { ...ref.current, value };
|
|
33
33
|
if (!value) {
|
|
34
34
|
delete newValue.value;
|
|
35
35
|
}
|
|
36
36
|
setContactPointWrapper(newValue);
|
|
37
37
|
}
|
|
38
38
|
return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
|
|
39
|
-
React.createElement(NativeSelect, { "data-testid": "system", defaultValue: contactPoint
|
|
40
|
-
React.createElement(NativeSelect, { "data-testid": "use", defaultValue: contactPoint
|
|
41
|
-
React.createElement(TextInput, { placeholder: "Value", defaultValue: contactPoint
|
|
39
|
+
React.createElement(NativeSelect, { "data-testid": "system", defaultValue: contactPoint?.system, onChange: (e) => setSystem(e.currentTarget.value), data: ['', 'email', 'phone', 'fax', 'pager', 'sms', 'other'] }),
|
|
40
|
+
React.createElement(NativeSelect, { "data-testid": "use", defaultValue: contactPoint?.use, onChange: (e) => setUse(e.currentTarget.value), data: ['', 'home', 'work', 'temp', 'old', 'mobile'] }),
|
|
41
|
+
React.createElement(TextInput, { placeholder: "Value", defaultValue: contactPoint?.value, onChange: (e) => setValue(e.currentTarget.value) })));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export { ContactPointInput };
|
|
45
|
-
//# sourceMappingURL=ContactPointInput.
|
|
45
|
+
//# sourceMappingURL=ContactPointInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactPointInput.mjs","sources":["../../../src/ContactPointInput/ContactPointInput.tsx"],"sourcesContent":["import { Group, NativeSelect, TextInput } from '@mantine/core';\nimport { ContactPoint } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\n\nexport interface ContactPointInputProps {\n name: string;\n defaultValue?: ContactPoint;\n onChange?: (value: ContactPoint | undefined) => void;\n}\n\nexport function ContactPointInput(props: ContactPointInputProps): JSX.Element {\n const [contactPoint, setContactPoint] = useState(props.defaultValue);\n\n const ref = useRef<ContactPoint>();\n ref.current = contactPoint;\n\n function setContactPointWrapper(newValue: ContactPoint | undefined): void {\n if (newValue && Object.keys(newValue).length === 0) {\n newValue = undefined;\n }\n setContactPoint(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setSystem(system: 'url' | 'phone' | 'fax' | 'email' | 'pager' | 'sms' | 'other'): void {\n const newValue: ContactPoint = { ...ref.current, system };\n if (!system) {\n delete newValue.system;\n }\n setContactPointWrapper(newValue);\n }\n\n function setUse(use: 'home' | 'work' | 'temp' | 'old' | 'mobile'): void {\n const newValue: ContactPoint = { ...ref.current, use };\n if (!use) {\n delete newValue.use;\n }\n setContactPointWrapper(newValue);\n }\n\n function setValue(value: string): void {\n const newValue: ContactPoint = { ...ref.current, value };\n if (!value) {\n delete newValue.value;\n }\n setContactPointWrapper(newValue);\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <NativeSelect\n data-testid=\"system\"\n defaultValue={contactPoint?.system}\n onChange={(e) =>\n setSystem(e.currentTarget.value as 'url' | 'phone' | 'fax' | 'email' | 'pager' | 'sms' | 'other')\n }\n data={['', 'email', 'phone', 'fax', 'pager', 'sms', 'other']}\n />\n <NativeSelect\n data-testid=\"use\"\n defaultValue={contactPoint?.use}\n onChange={(e) => setUse(e.currentTarget.value as 'home' | 'work' | 'temp' | 'old' | 'mobile')}\n data={['', 'home', 'work', 'temp', 'old', 'mobile']}\n />\n <TextInput\n placeholder=\"Value\"\n defaultValue={contactPoint?.value}\n onChange={(e) => setValue(e.currentTarget.value)}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAErE,IAAA,MAAM,GAAG,GAAG,MAAM,EAAgB,CAAC;AACnC,IAAA,GAAG,CAAC,OAAO,GAAG,YAAY,CAAC;IAE3B,SAAS,sBAAsB,CAAC,QAAkC,EAAA;AAChE,QAAA,IAAI,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YAClD,QAAQ,GAAG,SAAS,CAAC;AACtB,SAAA;QACD,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC1B,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;I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EACjB,YAAY,EAAE,YAAY,EAAE,GAAG,EAC/B,QAAQ,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,KAAoD,CAAC,EAC7F,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,EACnD,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,WAAW,EAAC,OAAO,EACnB,YAAY,EAAE,YAAY,EAAE,KAAK,EACjC,QAAQ,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAChD,CAAA,CACI,EACR;AACJ;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest } from '../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { createStyles, Container as Container$1 } from '@mantine/core';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
|
|
@@ -11,10 +10,10 @@ const useStyles = createStyles(() => ({
|
|
|
11
10
|
},
|
|
12
11
|
}));
|
|
13
12
|
function Container(props) {
|
|
14
|
-
const { children
|
|
13
|
+
const { children, ...others } = props;
|
|
15
14
|
const { classes } = useStyles();
|
|
16
|
-
return (React.createElement(Container$1,
|
|
15
|
+
return (React.createElement(Container$1, { className: classes.root, ...others }, children));
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export { Container };
|
|
20
|
-
//# sourceMappingURL=Container.
|
|
19
|
+
//# sourceMappingURL=Container.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.mjs","sources":["../../../src/Container/Container.tsx"],"sourcesContent":["import { Container as MantineContainer, ContainerProps, createStyles } from '@mantine/core';\nimport React from 'react';\n\nconst useStyles = createStyles(() => ({\n root: {\n '@media (max-width: 800px)': {\n paddingLeft: 4,\n paddingRight: 4,\n },\n },\n}));\n\nexport function Container(props: ContainerProps): JSX.Element {\n const { children, ...others } = props;\n const { classes } = useStyles();\n\n return (\n <MantineContainer className={classes.root} {...others}>\n {children}\n </MantineContainer>\n );\n}\n"],"names":["MantineContainer"],"mappings":";;;AAGA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO;AACpC,IAAA,IAAI,EAAE;AACJ,QAAA,2BAA2B,EAAE;AAC3B,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,CAAC;AAChB,SAAA;AACF,KAAA;AACF,CAAA,CAAC,CAAC,CAAC;AAEE,SAAU,SAAS,CAAC,KAAqB,EAAA;IAC7C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;AACtC,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC;AAEhC,IAAA,QACE,KAAA,CAAA,aAAA,CAACA,WAAgB,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,KAAM,MAAM,EAAA,EAClD,QAAQ,CACQ,EACnB;AACJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextInput } from '@mantine/core';
|
|
2
2
|
import { isValidDate } from '@medplum/core';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { getErrorsForInput } from '../utils/outcomes.
|
|
4
|
+
import { getErrorsForInput } from '../utils/outcomes.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The DateTimeInput component is a wrapper around the HTML5 input type="datetime-local".
|
|
@@ -67,4 +67,4 @@ function getInputType() {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export { DateTimeInput, convertIsoToLocal, convertLocalToIso };
|
|
70
|
-
//# sourceMappingURL=DateTimeInput.
|
|
70
|
+
//# sourceMappingURL=DateTimeInput.mjs.map
|