@medplum/react 1.0.0 → 1.0.1
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/dist/cjs/{AddressDisplay.d.ts → AddressDisplay/AddressDisplay.d.ts} +0 -0
- package/dist/cjs/{AddressInput.d.ts → AddressInput/AddressInput.d.ts} +0 -0
- package/dist/cjs/{stories → AddressInput}/AddressInput.stories.d.ts +0 -0
- package/dist/cjs/{AnnotationInput.d.ts → AnnotationInput/AnnotationInput.d.ts} +0 -0
- package/dist/cjs/{AttachmentArrayDisplay.d.ts → AttachmentArrayDisplay/AttachmentArrayDisplay.d.ts} +0 -0
- package/dist/cjs/{AttachmentArrayInput.d.ts → AttachmentArrayInput/AttachmentArrayInput.d.ts} +0 -0
- package/dist/cjs/{stories → AttachmentArrayInput}/AttachmentArrayInput.stories.d.ts +0 -0
- package/dist/cjs/{AttachmentButton.d.ts → AttachmentButton/AttachmentButton.d.ts} +0 -0
- package/dist/cjs/{stories → AttachmentButton}/AttachmentButton.stories.d.ts +0 -0
- package/dist/cjs/{AttachmentDisplay.d.ts → AttachmentDisplay/AttachmentDisplay.d.ts} +0 -0
- package/dist/cjs/{AttachmentInput.d.ts → AttachmentInput/AttachmentInput.d.ts} +0 -0
- package/dist/cjs/{stories → AttachmentInput}/AttachmentInput.stories.d.ts +0 -0
- package/dist/cjs/{BackboneElementDisplay.d.ts → BackboneElementDisplay/BackboneElementDisplay.d.ts} +0 -0
- package/dist/cjs/{BackboneElementInput.d.ts → BackboneElementInput/BackboneElementInput.d.ts} +0 -0
- package/dist/cjs/{CalendarInput.d.ts → CalendarInput/CalendarInput.d.ts} +0 -0
- package/dist/cjs/{CheckboxFormSection.d.ts → CheckboxFormSection/CheckboxFormSection.d.ts} +0 -0
- package/dist/cjs/{CodeInput.d.ts → CodeInput/CodeInput.d.ts} +0 -0
- package/dist/cjs/{stories → CodeInput}/CodeInput.stories.d.ts +0 -0
- package/dist/cjs/{CodeableConceptDisplay.d.ts → CodeableConceptDisplay/CodeableConceptDisplay.d.ts} +0 -0
- package/dist/cjs/{stories → CodeableConceptDisplay}/CodeableConceptDisplay.stories.d.ts +0 -0
- package/dist/cjs/{CodeableConceptInput.d.ts → CodeableConceptInput/CodeableConceptInput.d.ts} +0 -0
- package/dist/cjs/{stories → CodeableConceptInput}/CodeableConceptInput.stories.d.ts +0 -0
- package/dist/cjs/{CodingDisplay.d.ts → CodingDisplay/CodingDisplay.d.ts} +0 -0
- package/dist/cjs/{CodingInput.d.ts → CodingInput/CodingInput.d.ts} +0 -0
- package/dist/cjs/{ContactDetailDisplay.d.ts → ContactDetailDisplay/ContactDetailDisplay.d.ts} +0 -0
- package/dist/cjs/{ContactDetailInput.d.ts → ContactDetailInput/ContactDetailInput.d.ts} +0 -0
- package/dist/cjs/{ContactPointDisplay.d.ts → ContactPointDisplay/ContactPointDisplay.d.ts} +0 -0
- package/dist/cjs/{ContactPointInput.d.ts → ContactPointInput/ContactPointInput.d.ts} +0 -0
- package/dist/cjs/{DateTimeInput.d.ts → DateTimeInput/DateTimeInput.d.ts} +0 -0
- package/dist/cjs/{DefaultResourceTimeline.d.ts → DefaultResourceTimeline/DefaultResourceTimeline.d.ts} +0 -0
- package/dist/cjs/{DescriptionList.d.ts → DescriptionList/DescriptionList.d.ts} +0 -0
- package/dist/cjs/{stories → DescriptionList}/DescriptionList.stories.d.ts +0 -0
- package/dist/cjs/{DiagnosticReportDisplay.d.ts → DiagnosticReportDisplay/DiagnosticReportDisplay.d.ts} +0 -0
- package/dist/cjs/{stories → DiagnosticReportDisplay}/DiagnosticReportDisplay.stories.d.ts +0 -0
- package/dist/cjs/{Document.d.ts → Document/Document.d.ts} +0 -0
- package/dist/cjs/{EncounterTimeline.d.ts → EncounterTimeline/EncounterTimeline.d.ts} +0 -0
- package/dist/cjs/{stories → EncounterTimeline}/EncounterTimeline.stories.d.ts +0 -0
- package/dist/cjs/{ErrorBoundary.d.ts → ErrorBoundary/ErrorBoundary.d.ts} +0 -0
- package/dist/cjs/{ExtensionInput.d.ts → ExtensionInput/ExtensionInput.d.ts} +0 -0
- package/dist/cjs/{FhirPathDisplay.d.ts → FhirPathDisplay/FhirPathDisplay.d.ts} +0 -0
- package/dist/cjs/{stories → FhirPathDisplay}/FhirPathDisplay.stories.d.ts +1 -1
- package/dist/cjs/{FhirPathTable.d.ts → FhirPathTable/FhirPathTable.d.ts} +1 -1
- package/dist/cjs/{Form.d.ts → Form/Form.d.ts} +0 -0
- package/dist/cjs/{FormUtils.d.ts → Form/FormUtils.d.ts} +0 -0
- package/dist/cjs/{FormSection.d.ts → FormSection/FormSection.d.ts} +0 -0
- package/dist/cjs/{GoogleButton.d.ts → GoogleButton/GoogleButton.d.ts} +0 -0
- package/dist/cjs/{HumanNameDisplay.d.ts → HumanNameDisplay/HumanNameDisplay.d.ts} +0 -0
- package/dist/cjs/{HumanNameInput.d.ts → HumanNameInput/HumanNameInput.d.ts} +0 -0
- package/dist/cjs/{IdentifierDisplay.d.ts → IdentifierDisplay/IdentifierDisplay.d.ts} +0 -0
- package/dist/cjs/{IdentifierInput.d.ts → IdentifierInput/IdentifierInput.d.ts} +0 -0
- package/dist/cjs/{Logo.d.ts → Logo/Logo.d.ts} +0 -0
- package/dist/cjs/{stories → Logo}/Logo.stories.d.ts +0 -0
- package/dist/cjs/{MedplumLink.d.ts → MedplumLink/MedplumLink.d.ts} +0 -0
- package/dist/cjs/{MedplumProvider.d.ts → MedplumProvider/MedplumProvider.d.ts} +0 -0
- package/dist/cjs/{PatientTimeline.d.ts → PatientTimeline/PatientTimeline.d.ts} +0 -0
- package/dist/cjs/{stories → PatientTimeline}/PatientTimeline.stories.d.ts +0 -0
- package/dist/cjs/{PeriodInput.d.ts → PeriodInput/PeriodInput.d.ts} +0 -0
- package/dist/cjs/{stories → PeriodInput}/PeriodInput.stories.d.ts +0 -0
- package/dist/cjs/{PlanDefinitionBuilder.d.ts → PlanDefinitionBuilder/PlanDefinitionBuilder.d.ts} +0 -0
- package/dist/cjs/{stories → PlanDefinitionBuilder}/PlanDefinitionBuilder.stories.d.ts +0 -0
- package/dist/cjs/{QuantityDisplay.d.ts → QuantityDisplay/QuantityDisplay.d.ts} +0 -1
- package/dist/cjs/{QuantityInput.d.ts → QuantityInput/QuantityInput.d.ts} +0 -0
- package/dist/cjs/{QuestionnaireBuilder.d.ts → QuestionnaireBuilder/QuestionnaireBuilder.d.ts} +0 -0
- package/dist/cjs/{stories → QuestionnaireBuilder}/QuestionnaireBuilder.stories.d.ts +0 -0
- package/dist/cjs/{QuestionnaireForm.d.ts → QuestionnaireForm/QuestionnaireForm.d.ts} +0 -0
- package/dist/cjs/{stories → QuestionnaireForm}/QuestionnaireForm.stories.d.ts +0 -0
- package/dist/cjs/{RangeDisplay.d.ts → RangeDisplay/RangeDisplay.d.ts} +0 -1
- package/dist/cjs/{RangeInput.d.ts → RangeInput/RangeInput.d.ts} +0 -0
- package/dist/cjs/{RatioDisplay.d.ts → RatioDisplay/RatioDisplay.d.ts} +0 -0
- package/dist/cjs/{RatioInput.d.ts → RatioInput/RatioInput.d.ts} +0 -0
- package/dist/cjs/{ReferenceDisplay.d.ts → ReferenceDisplay/ReferenceDisplay.d.ts} +0 -0
- package/dist/cjs/{ReferenceInput.d.ts → ReferenceInput/ReferenceInput.d.ts} +0 -0
- package/dist/cjs/{stories → ReferenceInput}/ReferenceInput.stories.d.ts +0 -0
- package/dist/cjs/ReferenceRangeEditor/ReferenceRangeEditor.d.ts +27 -0
- package/dist/cjs/ReferenceRangeEditor/ReferenceRangeEditor.stories.d.ts +7 -0
- package/dist/cjs/{RequestGroupDisplay.d.ts → RequestGroupDisplay/RequestGroupDisplay.d.ts} +0 -0
- package/dist/cjs/{stories → RequestGroupDisplay}/RequestGroupDisplay.stories.d.ts +0 -0
- package/dist/cjs/{ResourceArrayDisplay.d.ts → ResourceArrayDisplay/ResourceArrayDisplay.d.ts} +0 -0
- package/dist/cjs/{ResourceArrayInput.d.ts → ResourceArrayInput/ResourceArrayInput.d.ts} +0 -0
- package/dist/cjs/{ResourceAvatar.d.ts → ResourceAvatar/ResourceAvatar.d.ts} +0 -0
- package/dist/cjs/{stories → ResourceAvatar}/ResourceAvatar.stories.d.ts +0 -0
- package/dist/cjs/{ResourceBadge.d.ts → ResourceBadge/ResourceBadge.d.ts} +0 -0
- package/dist/cjs/{ResourceBlame.d.ts → ResourceBlame/ResourceBlame.d.ts} +0 -0
- package/dist/cjs/{stories → ResourceBlame}/ResourceBlame.stories.d.ts +0 -0
- package/dist/cjs/{ResourceDiff.d.ts → ResourceDiff/ResourceDiff.d.ts} +0 -0
- package/dist/cjs/{ResourceDiffTable.d.ts → ResourceDiffTable/ResourceDiffTable.d.ts} +0 -0
- package/dist/cjs/ResourceDiffTable/ResourceDiffTable.stories.d.ts +5 -0
- package/dist/cjs/{ResourceForm.d.ts → ResourceForm/ResourceForm.d.ts} +0 -0
- package/dist/cjs/{stories → ResourceForm}/ResourceForm.stories.d.ts +0 -0
- package/dist/cjs/{ResourceHistoryTable.d.ts → ResourceHistoryTable/ResourceHistoryTable.d.ts} +0 -0
- package/dist/cjs/{stories → ResourceHistoryTable}/ResourceHistoryTable.stories.d.ts +0 -0
- package/dist/cjs/{ResourceInput.d.ts → ResourceInput/ResourceInput.d.ts} +0 -0
- package/dist/cjs/{stories → ResourceInput}/ResourceInput.stories.d.ts +0 -0
- package/dist/cjs/{ResourceName.d.ts → ResourceName/ResourceName.d.ts} +0 -0
- package/dist/cjs/{ResourcePropertyDisplay.d.ts → ResourcePropertyDisplay/ResourcePropertyDisplay.d.ts} +0 -0
- package/dist/cjs/{ResourcePropertyInput.d.ts → ResourcePropertyInput/ResourcePropertyInput.d.ts} +0 -0
- package/dist/cjs/{ResourceTable.d.ts → ResourceTable/ResourceTable.d.ts} +0 -0
- package/dist/cjs/{stories → ResourceTable}/ResourceTable.stories.d.ts +0 -0
- package/dist/cjs/{ResourceTimeline.d.ts → ResourceTimeline/ResourceTimeline.d.ts} +0 -0
- package/dist/cjs/{Scheduler.d.ts → Scheduler/Scheduler.d.ts} +0 -0
- package/dist/cjs/{stories → Scheduler}/Scheduler.stories.d.ts +0 -0
- package/dist/cjs/{SearchControl.d.ts → SearchControl/SearchControl.d.ts} +0 -0
- package/dist/cjs/{stories → SearchControl}/SearchControl.stories.d.ts +0 -0
- package/dist/cjs/{SearchControlField.d.ts → SearchControl/SearchControlField.d.ts} +0 -0
- package/dist/cjs/{SearchUtils.d.ts → SearchControl/SearchUtils.d.ts} +0 -21
- package/dist/cjs/{SearchFieldEditor.d.ts → SearchFieldEditor/SearchFieldEditor.d.ts} +0 -0
- package/dist/cjs/{SearchFilterEditor.d.ts → SearchFilterEditor/SearchFilterEditor.d.ts} +0 -0
- package/dist/cjs/{SearchFilterValueDialog.d.ts → SearchFilterValueDialog/SearchFilterValueDialog.d.ts} +0 -0
- package/dist/cjs/{SearchFilterValueDisplay.d.ts → SearchFilterValueDisplay/SearchFilterValueDisplay.d.ts} +0 -0
- package/dist/cjs/{SearchFilterValueInput.d.ts → SearchFilterValueInput/SearchFilterValueInput.d.ts} +0 -0
- package/dist/cjs/{SearchPopupMenu.d.ts → SearchPopupMenu/SearchPopupMenu.d.ts} +0 -0
- package/dist/cjs/{ServiceRequestTimeline.d.ts → ServiceRequestTimeline/ServiceRequestTimeline.d.ts} +0 -0
- package/dist/cjs/{StatusBadge.d.ts → StatusBadge/StatusBadge.d.ts} +0 -0
- package/dist/cjs/{stories → StatusBadge}/StatusBadge.stories.d.ts +0 -0
- package/dist/cjs/{Timeline.d.ts → Timeline/Timeline.d.ts} +0 -0
- package/dist/cjs/{stories → Timeline}/Timeline.stories.d.ts +0 -0
- package/dist/cjs/{TimingInput.d.ts → TimingInput/TimingInput.d.ts} +0 -0
- package/dist/cjs/{stories → TimingInput}/TimingInput.stories.d.ts +0 -0
- package/dist/cjs/{ValueSetAutocomplete.d.ts → ValueSetAutocomplete/ValueSetAutocomplete.d.ts} +0 -0
- package/dist/cjs/auth/AuthenticationForm.d.ts +2 -10
- package/dist/cjs/auth/ChooseScopeForm.d.ts +7 -0
- package/dist/cjs/{stories → auth}/RegisterForm.stories.d.ts +0 -0
- package/dist/cjs/auth/SignInForm.d.ts +3 -10
- package/dist/cjs/{stories → auth}/SignInForm.stories.d.ts +0 -0
- package/dist/cjs/index.d.ts +66 -65
- package/dist/cjs/index.js +444 -230
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/stories/referenceLab.d.ts +3 -0
- package/dist/cjs/{useResource.d.ts → useResource/useResource.d.ts} +0 -0
- package/dist/cjs/{QuestionnaireUtils.d.ts → utils/questionnaire.d.ts} +0 -0
- package/dist/cjs/{utils.d.ts → utils/script.d.ts} +0 -0
- package/dist/esm/{AddressDisplay.d.ts → AddressDisplay/AddressDisplay.d.ts} +0 -0
- package/dist/esm/{AddressDisplay.js → AddressDisplay/AddressDisplay.js} +0 -0
- package/dist/esm/AddressDisplay/AddressDisplay.js.map +1 -0
- package/dist/esm/{AddressInput.d.ts → AddressInput/AddressInput.d.ts} +0 -0
- package/dist/esm/{AddressInput.js → AddressInput/AddressInput.js} +0 -0
- package/dist/esm/AddressInput/AddressInput.js.map +1 -0
- package/dist/esm/{stories → AddressInput}/AddressInput.stories.d.ts +0 -0
- package/dist/esm/{AnnotationInput.d.ts → AnnotationInput/AnnotationInput.d.ts} +0 -0
- package/dist/esm/{AnnotationInput.js → AnnotationInput/AnnotationInput.js} +1 -1
- package/dist/esm/AnnotationInput/AnnotationInput.js.map +1 -0
- package/dist/esm/{AttachmentArrayDisplay.d.ts → AttachmentArrayDisplay/AttachmentArrayDisplay.d.ts} +0 -0
- package/dist/esm/{AttachmentArrayDisplay.js → AttachmentArrayDisplay/AttachmentArrayDisplay.js} +1 -1
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.js.map +1 -0
- package/dist/esm/{AttachmentArrayInput.d.ts → AttachmentArrayInput/AttachmentArrayInput.d.ts} +0 -0
- package/dist/esm/{AttachmentArrayInput.js → AttachmentArrayInput/AttachmentArrayInput.js} +3 -3
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.js.map +1 -0
- package/dist/esm/{stories → AttachmentArrayInput}/AttachmentArrayInput.stories.d.ts +0 -0
- package/dist/esm/{AttachmentButton.d.ts → AttachmentButton/AttachmentButton.d.ts} +0 -0
- package/dist/esm/{AttachmentButton.js → AttachmentButton/AttachmentButton.js} +2 -2
- package/dist/esm/AttachmentButton/AttachmentButton.js.map +1 -0
- package/dist/esm/{stories → AttachmentButton}/AttachmentButton.stories.d.ts +0 -0
- package/dist/esm/{AttachmentDisplay.d.ts → AttachmentDisplay/AttachmentDisplay.d.ts} +0 -0
- package/dist/esm/{AttachmentDisplay.js → AttachmentDisplay/AttachmentDisplay.js} +0 -0
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.js.map +1 -0
- package/dist/esm/{AttachmentInput.d.ts → AttachmentInput/AttachmentInput.d.ts} +0 -0
- package/dist/esm/{AttachmentInput.js → AttachmentInput/AttachmentInput.js} +3 -3
- package/dist/esm/AttachmentInput/AttachmentInput.js.map +1 -0
- package/dist/esm/{stories → AttachmentInput}/AttachmentInput.stories.d.ts +0 -0
- package/dist/esm/{BackboneElementDisplay.d.ts → BackboneElementDisplay/BackboneElementDisplay.d.ts} +0 -0
- package/dist/esm/{BackboneElementDisplay.js → BackboneElementDisplay/BackboneElementDisplay.js} +7 -4
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.js.map +1 -0
- package/dist/esm/{BackboneElementInput.d.ts → BackboneElementInput/BackboneElementInput.d.ts} +0 -0
- package/dist/esm/{BackboneElementInput.js → BackboneElementInput/BackboneElementInput.js} +6 -6
- package/dist/esm/BackboneElementInput/BackboneElementInput.js.map +1 -0
- package/dist/esm/{CalendarInput.d.ts → CalendarInput/CalendarInput.d.ts} +0 -0
- package/dist/esm/{CalendarInput.js → CalendarInput/CalendarInput.js} +0 -0
- package/dist/esm/CalendarInput/CalendarInput.js.map +1 -0
- package/dist/esm/{CheckboxFormSection.d.ts → CheckboxFormSection/CheckboxFormSection.d.ts} +0 -0
- package/dist/esm/{CheckboxFormSection.js → CheckboxFormSection/CheckboxFormSection.js} +0 -0
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.js.map +1 -0
- package/dist/esm/{CodeInput.d.ts → CodeInput/CodeInput.d.ts} +0 -0
- package/dist/esm/{CodeInput.js → CodeInput/CodeInput.js} +1 -1
- package/dist/esm/CodeInput/CodeInput.js.map +1 -0
- package/dist/esm/{stories → CodeInput}/CodeInput.stories.d.ts +0 -0
- package/dist/esm/{CodeableConceptDisplay.d.ts → CodeableConceptDisplay/CodeableConceptDisplay.d.ts} +0 -0
- package/dist/esm/{CodeableConceptDisplay.js → CodeableConceptDisplay/CodeableConceptDisplay.js} +1 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.js.map +1 -0
- package/dist/esm/{stories → CodeableConceptDisplay}/CodeableConceptDisplay.stories.d.ts +0 -0
- package/dist/esm/{CodeableConceptInput.d.ts → CodeableConceptInput/CodeableConceptInput.d.ts} +0 -0
- package/dist/esm/{CodeableConceptInput.js → CodeableConceptInput/CodeableConceptInput.js} +1 -1
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.js.map +1 -0
- package/dist/esm/{stories → CodeableConceptInput}/CodeableConceptInput.stories.d.ts +0 -0
- package/dist/esm/{CodingDisplay.d.ts → CodingDisplay/CodingDisplay.d.ts} +0 -0
- package/dist/esm/{CodingDisplay.js → CodingDisplay/CodingDisplay.js} +0 -0
- package/dist/esm/CodingDisplay/CodingDisplay.js.map +1 -0
- package/dist/esm/{CodingInput.d.ts → CodingInput/CodingInput.d.ts} +0 -0
- package/dist/esm/{CodingInput.js → CodingInput/CodingInput.js} +1 -1
- package/dist/esm/CodingInput/CodingInput.js.map +1 -0
- package/dist/esm/{ContactDetailDisplay.d.ts → ContactDetailDisplay/ContactDetailDisplay.d.ts} +0 -0
- package/dist/esm/{ContactDetailDisplay.js → ContactDetailDisplay/ContactDetailDisplay.js} +1 -1
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.js.map +1 -0
- package/dist/esm/{ContactDetailInput.d.ts → ContactDetailInput/ContactDetailInput.d.ts} +0 -0
- package/dist/esm/{ContactDetailInput.js → ContactDetailInput/ContactDetailInput.js} +1 -1
- package/dist/esm/ContactDetailInput/ContactDetailInput.js.map +1 -0
- package/dist/esm/{ContactPointDisplay.d.ts → ContactPointDisplay/ContactPointDisplay.d.ts} +0 -0
- package/dist/esm/{ContactPointDisplay.js → ContactPointDisplay/ContactPointDisplay.js} +0 -0
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.js.map +1 -0
- package/dist/esm/{ContactPointInput.d.ts → ContactPointInput/ContactPointInput.d.ts} +0 -0
- package/dist/esm/{ContactPointInput.js → ContactPointInput/ContactPointInput.js} +0 -0
- package/dist/esm/ContactPointInput/ContactPointInput.js.map +1 -0
- package/dist/esm/{DateTimeInput.d.ts → DateTimeInput/DateTimeInput.d.ts} +0 -0
- package/dist/esm/{DateTimeInput.js → DateTimeInput/DateTimeInput.js} +1 -1
- package/dist/esm/DateTimeInput/DateTimeInput.js.map +1 -0
- package/dist/esm/{DefaultResourceTimeline.d.ts → DefaultResourceTimeline/DefaultResourceTimeline.d.ts} +0 -0
- package/dist/esm/{DefaultResourceTimeline.js → DefaultResourceTimeline/DefaultResourceTimeline.js} +1 -1
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.js.map +1 -0
- package/dist/esm/{DescriptionList.d.ts → DescriptionList/DescriptionList.d.ts} +0 -0
- package/dist/esm/{DescriptionList.js → DescriptionList/DescriptionList.js} +0 -0
- package/dist/esm/DescriptionList/DescriptionList.js.map +1 -0
- package/dist/esm/{stories → DescriptionList}/DescriptionList.stories.d.ts +0 -0
- package/dist/esm/{DiagnosticReportDisplay.d.ts → DiagnosticReportDisplay/DiagnosticReportDisplay.d.ts} +0 -0
- package/dist/esm/{DiagnosticReportDisplay.js → DiagnosticReportDisplay/DiagnosticReportDisplay.js} +7 -7
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.js.map +1 -0
- package/dist/esm/{stories → DiagnosticReportDisplay}/DiagnosticReportDisplay.stories.d.ts +0 -0
- package/dist/esm/{Document.d.ts → Document/Document.d.ts} +0 -0
- package/dist/esm/{Document.js → Document/Document.js} +0 -0
- package/dist/esm/Document/Document.js.map +1 -0
- package/dist/esm/{EncounterTimeline.d.ts → EncounterTimeline/EncounterTimeline.d.ts} +0 -0
- package/dist/esm/{EncounterTimeline.js → EncounterTimeline/EncounterTimeline.js} +1 -1
- package/dist/esm/EncounterTimeline/EncounterTimeline.js.map +1 -0
- package/dist/esm/{stories → EncounterTimeline}/EncounterTimeline.stories.d.ts +0 -0
- package/dist/esm/{ErrorBoundary.d.ts → ErrorBoundary/ErrorBoundary.d.ts} +0 -0
- package/dist/esm/{ErrorBoundary.js → ErrorBoundary/ErrorBoundary.js} +4 -2
- package/dist/esm/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/dist/esm/{ExtensionInput.d.ts → ExtensionInput/ExtensionInput.d.ts} +0 -0
- package/dist/esm/{ExtensionInput.js → ExtensionInput/ExtensionInput.js} +0 -0
- package/dist/esm/ExtensionInput/ExtensionInput.js.map +1 -0
- package/dist/esm/{FhirPathDisplay.d.ts → FhirPathDisplay/FhirPathDisplay.d.ts} +0 -0
- package/dist/esm/{FhirPathDisplay.js → FhirPathDisplay/FhirPathDisplay.js} +1 -1
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.js.map +1 -0
- package/dist/esm/{stories → FhirPathDisplay}/FhirPathDisplay.stories.d.ts +1 -1
- package/dist/esm/{FhirPathTable.d.ts → FhirPathTable/FhirPathTable.d.ts} +1 -1
- package/dist/esm/{FhirPathTable.js → FhirPathTable/FhirPathTable.js} +4 -4
- package/dist/esm/FhirPathTable/FhirPathTable.js.map +1 -0
- package/dist/esm/{Form.d.ts → Form/Form.d.ts} +0 -0
- package/dist/esm/{Form.js → Form/Form.js} +0 -0
- package/dist/esm/Form/Form.js.map +1 -0
- package/dist/esm/{FormUtils.d.ts → Form/FormUtils.d.ts} +0 -0
- package/dist/esm/{FormUtils.js → Form/FormUtils.js} +0 -0
- package/dist/esm/Form/FormUtils.js.map +1 -0
- package/dist/esm/{FormSection.d.ts → FormSection/FormSection.d.ts} +0 -0
- package/dist/esm/{FormSection.js → FormSection/FormSection.js} +1 -1
- package/dist/esm/FormSection/FormSection.js.map +1 -0
- package/dist/esm/{GoogleButton.d.ts → GoogleButton/GoogleButton.d.ts} +0 -0
- package/dist/esm/{GoogleButton.js → GoogleButton/GoogleButton.js} +2 -2
- package/dist/esm/GoogleButton/GoogleButton.js.map +1 -0
- package/dist/esm/{HumanNameDisplay.d.ts → HumanNameDisplay/HumanNameDisplay.d.ts} +0 -0
- package/dist/esm/{HumanNameDisplay.js → HumanNameDisplay/HumanNameDisplay.js} +0 -0
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.js.map +1 -0
- package/dist/esm/{HumanNameInput.d.ts → HumanNameInput/HumanNameInput.d.ts} +0 -0
- package/dist/esm/{HumanNameInput.js → HumanNameInput/HumanNameInput.js} +0 -0
- package/dist/esm/HumanNameInput/HumanNameInput.js.map +1 -0
- package/dist/esm/{IdentifierDisplay.d.ts → IdentifierDisplay/IdentifierDisplay.d.ts} +0 -0
- package/dist/esm/{IdentifierDisplay.js → IdentifierDisplay/IdentifierDisplay.js} +0 -0
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.js.map +1 -0
- package/dist/esm/{IdentifierInput.d.ts → IdentifierInput/IdentifierInput.d.ts} +0 -0
- package/dist/esm/{IdentifierInput.js → IdentifierInput/IdentifierInput.js} +0 -0
- package/dist/esm/IdentifierInput/IdentifierInput.js.map +1 -0
- package/dist/esm/{Logo.d.ts → Logo/Logo.d.ts} +0 -0
- package/dist/esm/{Logo.js → Logo/Logo.js} +0 -0
- package/dist/esm/Logo/Logo.js.map +1 -0
- package/dist/esm/{stories → Logo}/Logo.stories.d.ts +0 -0
- package/dist/esm/{MedplumLink.d.ts → MedplumLink/MedplumLink.d.ts} +0 -0
- package/dist/esm/{MedplumLink.js → MedplumLink/MedplumLink.js} +2 -2
- package/dist/esm/MedplumLink/MedplumLink.js.map +1 -0
- package/dist/esm/{MedplumProvider.d.ts → MedplumProvider/MedplumProvider.d.ts} +0 -0
- package/dist/esm/{MedplumProvider.js → MedplumProvider/MedplumProvider.js} +0 -0
- package/dist/esm/MedplumProvider/MedplumProvider.js.map +1 -0
- package/dist/esm/{PatientTimeline.d.ts → PatientTimeline/PatientTimeline.d.ts} +0 -0
- package/dist/esm/{PatientTimeline.js → PatientTimeline/PatientTimeline.js} +1 -1
- package/dist/esm/PatientTimeline/PatientTimeline.js.map +1 -0
- package/dist/esm/{stories → PatientTimeline}/PatientTimeline.stories.d.ts +0 -0
- package/dist/esm/{PeriodInput.d.ts → PeriodInput/PeriodInput.d.ts} +0 -0
- package/dist/esm/{PeriodInput.js → PeriodInput/PeriodInput.js} +1 -1
- package/dist/esm/PeriodInput/PeriodInput.js.map +1 -0
- package/dist/esm/{stories → PeriodInput}/PeriodInput.stories.d.ts +0 -0
- package/dist/esm/{PlanDefinitionBuilder.d.ts → PlanDefinitionBuilder/PlanDefinitionBuilder.d.ts} +0 -0
- package/dist/esm/{PlanDefinitionBuilder.js → PlanDefinitionBuilder/PlanDefinitionBuilder.js} +10 -10
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.js.map +1 -0
- package/dist/esm/{stories → PlanDefinitionBuilder}/PlanDefinitionBuilder.stories.d.ts +0 -0
- package/dist/esm/{QuantityDisplay.d.ts → QuantityDisplay/QuantityDisplay.d.ts} +0 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.js +9 -0
- package/dist/esm/QuantityDisplay/QuantityDisplay.js.map +1 -0
- package/dist/esm/{QuantityInput.d.ts → QuantityInput/QuantityInput.d.ts} +0 -0
- package/dist/esm/{QuantityInput.js → QuantityInput/QuantityInput.js} +2 -2
- package/dist/esm/QuantityInput/QuantityInput.js.map +1 -0
- package/dist/esm/{QuestionnaireBuilder.d.ts → QuestionnaireBuilder/QuestionnaireBuilder.d.ts} +0 -0
- package/dist/esm/{QuestionnaireBuilder.js → QuestionnaireBuilder/QuestionnaireBuilder.js} +8 -8
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.js.map +1 -0
- package/dist/esm/{stories → QuestionnaireBuilder}/QuestionnaireBuilder.stories.d.ts +0 -0
- package/dist/esm/{QuestionnaireForm.d.ts → QuestionnaireForm/QuestionnaireForm.d.ts} +0 -0
- package/dist/esm/{QuestionnaireForm.js → QuestionnaireForm/QuestionnaireForm.js} +11 -11
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.js.map +1 -0
- package/dist/esm/{stories → QuestionnaireForm}/QuestionnaireForm.stories.d.ts +0 -0
- package/dist/esm/{RangeDisplay.d.ts → RangeDisplay/RangeDisplay.d.ts} +0 -1
- package/dist/esm/RangeDisplay/RangeDisplay.js +9 -0
- package/dist/esm/RangeDisplay/RangeDisplay.js.map +1 -0
- package/dist/esm/{RangeInput.d.ts → RangeInput/RangeInput.d.ts} +0 -0
- package/dist/esm/{RangeInput.js → RangeInput/RangeInput.js} +1 -1
- package/dist/esm/RangeInput/RangeInput.js.map +1 -0
- package/dist/esm/{RatioDisplay.d.ts → RatioDisplay/RatioDisplay.d.ts} +0 -0
- package/dist/esm/{RatioDisplay.js → RatioDisplay/RatioDisplay.js} +1 -1
- package/dist/esm/RatioDisplay/RatioDisplay.js.map +1 -0
- package/dist/esm/{RatioInput.d.ts → RatioInput/RatioInput.d.ts} +0 -0
- package/dist/esm/{RatioInput.js → RatioInput/RatioInput.js} +1 -1
- package/dist/esm/RatioInput/RatioInput.js.map +1 -0
- package/dist/esm/{ReferenceDisplay.d.ts → ReferenceDisplay/ReferenceDisplay.d.ts} +0 -0
- package/dist/esm/{ReferenceDisplay.js → ReferenceDisplay/ReferenceDisplay.js} +1 -1
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.js.map +1 -0
- package/dist/esm/{ReferenceInput.d.ts → ReferenceInput/ReferenceInput.d.ts} +0 -0
- package/dist/esm/{ReferenceInput.js → ReferenceInput/ReferenceInput.js} +1 -1
- package/dist/esm/ReferenceInput/ReferenceInput.js.map +1 -0
- package/dist/esm/{stories → ReferenceInput}/ReferenceInput.stories.d.ts +0 -0
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.d.ts +27 -0
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js +269 -0
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js.map +1 -0
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.stories.d.ts +7 -0
- package/dist/esm/{RequestGroupDisplay.d.ts → RequestGroupDisplay/RequestGroupDisplay.d.ts} +0 -0
- package/dist/esm/{RequestGroupDisplay.js → RequestGroupDisplay/RequestGroupDisplay.js} +4 -4
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.js.map +1 -0
- package/dist/esm/{stories → RequestGroupDisplay}/RequestGroupDisplay.stories.d.ts +0 -0
- package/dist/esm/{ResourceArrayDisplay.d.ts → ResourceArrayDisplay/ResourceArrayDisplay.d.ts} +0 -0
- package/dist/esm/{ResourceArrayDisplay.js → ResourceArrayDisplay/ResourceArrayDisplay.js} +1 -1
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.js.map +1 -0
- package/dist/esm/{ResourceArrayInput.d.ts → ResourceArrayInput/ResourceArrayInput.d.ts} +0 -0
- package/dist/esm/{ResourceArrayInput.js → ResourceArrayInput/ResourceArrayInput.js} +2 -2
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.js.map +1 -0
- package/dist/esm/{ResourceAvatar.d.ts → ResourceAvatar/ResourceAvatar.d.ts} +0 -0
- package/dist/esm/{ResourceAvatar.js → ResourceAvatar/ResourceAvatar.js} +2 -2
- package/dist/esm/ResourceAvatar/ResourceAvatar.js.map +1 -0
- package/dist/esm/{stories → ResourceAvatar}/ResourceAvatar.stories.d.ts +0 -0
- package/dist/esm/{ResourceBadge.d.ts → ResourceBadge/ResourceBadge.d.ts} +0 -0
- package/dist/esm/{ResourceBadge.js → ResourceBadge/ResourceBadge.js} +2 -2
- package/dist/esm/ResourceBadge/ResourceBadge.js.map +1 -0
- package/dist/esm/{ResourceBlame.d.ts → ResourceBlame/ResourceBlame.d.ts} +0 -0
- package/dist/esm/{ResourceBlame.js → ResourceBlame/ResourceBlame.js} +4 -4
- package/dist/esm/ResourceBlame/ResourceBlame.js.map +1 -0
- package/dist/esm/{stories → ResourceBlame}/ResourceBlame.stories.d.ts +0 -0
- package/dist/esm/{ResourceDiff.d.ts → ResourceDiff/ResourceDiff.d.ts} +0 -0
- package/dist/esm/{ResourceDiff.js → ResourceDiff/ResourceDiff.js} +1 -1
- package/dist/esm/ResourceDiff/ResourceDiff.js.map +1 -0
- package/dist/esm/{ResourceDiffTable.d.ts → ResourceDiffTable/ResourceDiffTable.d.ts} +0 -0
- package/dist/esm/{ResourceDiffTable.js → ResourceDiffTable/ResourceDiffTable.js} +2 -2
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.js.map +1 -0
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.stories.d.ts +5 -0
- package/dist/esm/{ResourceForm.d.ts → ResourceForm/ResourceForm.d.ts} +0 -0
- package/dist/esm/{ResourceForm.js → ResourceForm/ResourceForm.js} +5 -5
- package/dist/esm/ResourceForm/ResourceForm.js.map +1 -0
- package/dist/esm/{stories → ResourceForm}/ResourceForm.stories.d.ts +0 -0
- package/dist/esm/{ResourceHistoryTable.d.ts → ResourceHistoryTable/ResourceHistoryTable.d.ts} +0 -0
- package/dist/esm/{ResourceHistoryTable.js → ResourceHistoryTable/ResourceHistoryTable.js} +3 -3
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.js.map +1 -0
- package/dist/esm/{stories → ResourceHistoryTable}/ResourceHistoryTable.stories.d.ts +0 -0
- package/dist/esm/{ResourceInput.d.ts → ResourceInput/ResourceInput.d.ts} +0 -0
- package/dist/esm/{ResourceInput.js → ResourceInput/ResourceInput.js} +4 -4
- package/dist/esm/ResourceInput/ResourceInput.js.map +1 -0
- package/dist/esm/{stories → ResourceInput}/ResourceInput.stories.d.ts +0 -0
- package/dist/esm/{ResourceName.d.ts → ResourceName/ResourceName.d.ts} +0 -0
- package/dist/esm/{ResourceName.js → ResourceName/ResourceName.js} +3 -3
- package/dist/esm/ResourceName/ResourceName.js.map +1 -0
- package/dist/esm/{ResourcePropertyDisplay.d.ts → ResourcePropertyDisplay/ResourcePropertyDisplay.d.ts} +0 -0
- package/dist/esm/{ResourcePropertyDisplay.js → ResourcePropertyDisplay/ResourcePropertyDisplay.js} +15 -15
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.js.map +1 -0
- package/dist/esm/{ResourcePropertyInput.d.ts → ResourcePropertyInput/ResourcePropertyInput.d.ts} +0 -0
- package/dist/esm/{ResourcePropertyInput.js → ResourcePropertyInput/ResourcePropertyInput.js} +22 -22
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.js.map +1 -0
- package/dist/esm/{ResourceTable.d.ts → ResourceTable/ResourceTable.d.ts} +0 -0
- package/dist/esm/{ResourceTable.js → ResourceTable/ResourceTable.js} +3 -3
- package/dist/esm/ResourceTable/ResourceTable.js.map +1 -0
- package/dist/esm/{stories → ResourceTable}/ResourceTable.stories.d.ts +0 -0
- package/dist/esm/{ResourceTimeline.d.ts → ResourceTimeline/ResourceTimeline.d.ts} +0 -0
- package/dist/esm/{ResourceTimeline.js → ResourceTimeline/ResourceTimeline.js} +14 -13
- package/dist/esm/ResourceTimeline/ResourceTimeline.js.map +1 -0
- package/dist/esm/{Scheduler.d.ts → Scheduler/Scheduler.d.ts} +0 -0
- package/dist/esm/{Scheduler.js → Scheduler/Scheduler.js} +6 -6
- package/dist/esm/Scheduler/Scheduler.js.map +1 -0
- package/dist/esm/{stories → Scheduler}/Scheduler.stories.d.ts +0 -0
- package/dist/esm/{SearchControl.d.ts → SearchControl/SearchControl.d.ts} +0 -0
- package/dist/esm/{SearchControl.js → SearchControl/SearchControl.js} +12 -11
- package/dist/esm/SearchControl/SearchControl.js.map +1 -0
- package/dist/esm/{stories → SearchControl}/SearchControl.stories.d.ts +0 -0
- package/dist/esm/{SearchControlField.d.ts → SearchControl/SearchControlField.d.ts} +0 -0
- package/dist/esm/{SearchControlField.js → SearchControl/SearchControlField.js} +0 -0
- package/dist/esm/SearchControl/SearchControlField.js.map +1 -0
- package/dist/esm/{SearchUtils.d.ts → SearchControl/SearchUtils.d.ts} +0 -21
- package/dist/esm/{SearchUtils.js → SearchControl/SearchUtils.js} +2 -33
- package/dist/esm/SearchControl/SearchUtils.js.map +1 -0
- package/dist/esm/{SearchFieldEditor.d.ts → SearchFieldEditor/SearchFieldEditor.d.ts} +0 -0
- package/dist/esm/{SearchFieldEditor.js → SearchFieldEditor/SearchFieldEditor.js} +1 -1
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.js.map +1 -0
- package/dist/esm/{SearchFilterEditor.d.ts → SearchFilterEditor/SearchFilterEditor.d.ts} +0 -0
- package/dist/esm/{SearchFilterEditor.js → SearchFilterEditor/SearchFilterEditor.js} +3 -3
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.js.map +1 -0
- package/dist/esm/{SearchFilterValueDialog.d.ts → SearchFilterValueDialog/SearchFilterValueDialog.d.ts} +0 -0
- package/dist/esm/{SearchFilterValueDialog.js → SearchFilterValueDialog/SearchFilterValueDialog.js} +2 -2
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.js.map +1 -0
- package/dist/esm/{SearchFilterValueDisplay.d.ts → SearchFilterValueDisplay/SearchFilterValueDisplay.d.ts} +0 -0
- package/dist/esm/{SearchFilterValueDisplay.js → SearchFilterValueDisplay/SearchFilterValueDisplay.js} +1 -1
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.js.map +1 -0
- package/dist/esm/{SearchFilterValueInput.d.ts → SearchFilterValueInput/SearchFilterValueInput.d.ts} +0 -0
- package/dist/esm/{SearchFilterValueInput.js → SearchFilterValueInput/SearchFilterValueInput.js} +3 -3
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.js.map +1 -0
- package/dist/esm/{SearchPopupMenu.d.ts → SearchPopupMenu/SearchPopupMenu.d.ts} +0 -0
- package/dist/esm/{SearchPopupMenu.js → SearchPopupMenu/SearchPopupMenu.js} +1 -1
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.js.map +1 -0
- package/dist/esm/{ServiceRequestTimeline.d.ts → ServiceRequestTimeline/ServiceRequestTimeline.d.ts} +0 -0
- package/dist/esm/{ServiceRequestTimeline.js → ServiceRequestTimeline/ServiceRequestTimeline.js} +1 -1
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.js.map +1 -0
- package/dist/esm/{StatusBadge.d.ts → StatusBadge/StatusBadge.d.ts} +0 -0
- package/dist/esm/{StatusBadge.js → StatusBadge/StatusBadge.js} +0 -0
- package/dist/esm/StatusBadge/StatusBadge.js.map +1 -0
- package/dist/esm/{stories → StatusBadge}/StatusBadge.stories.d.ts +0 -0
- package/dist/esm/{Timeline.d.ts → Timeline/Timeline.d.ts} +0 -0
- package/dist/esm/{Timeline.js → Timeline/Timeline.js} +4 -4
- package/dist/esm/Timeline/Timeline.js.map +1 -0
- package/dist/esm/{stories → Timeline}/Timeline.stories.d.ts +0 -0
- package/dist/esm/{TimingInput.d.ts → TimingInput/TimingInput.d.ts} +0 -0
- package/dist/esm/{TimingInput.js → TimingInput/TimingInput.js} +2 -2
- package/dist/esm/TimingInput/TimingInput.js.map +1 -0
- package/dist/esm/{stories → TimingInput}/TimingInput.stories.d.ts +0 -0
- package/dist/esm/{ValueSetAutocomplete.d.ts → ValueSetAutocomplete/ValueSetAutocomplete.d.ts} +0 -0
- package/dist/esm/{ValueSetAutocomplete.js → ValueSetAutocomplete/ValueSetAutocomplete.js} +5 -5
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js.map +1 -0
- package/dist/esm/auth/AuthenticationForm.d.ts +2 -10
- package/dist/esm/auth/AuthenticationForm.js +13 -33
- package/dist/esm/auth/AuthenticationForm.js.map +1 -1
- package/dist/esm/auth/ChooseProfileForm.js +2 -2
- package/dist/esm/auth/ChooseProfileForm.js.map +1 -1
- package/dist/esm/auth/ChooseScopeForm.d.ts +7 -0
- package/dist/esm/auth/ChooseScopeForm.js +28 -0
- package/dist/esm/auth/ChooseScopeForm.js.map +1 -0
- package/dist/esm/auth/NewProjectForm.js +3 -3
- package/dist/esm/auth/NewProjectForm.js.map +1 -1
- package/dist/esm/auth/NewUserForm.js +3 -3
- package/dist/esm/auth/NewUserForm.js.map +1 -1
- package/dist/esm/auth/RegisterForm.js +2 -2
- package/dist/esm/auth/RegisterForm.js.map +1 -1
- package/dist/esm/{stories → auth}/RegisterForm.stories.d.ts +0 -0
- package/dist/esm/auth/SignInForm.d.ts +3 -10
- package/dist/esm/auth/SignInForm.js +30 -13
- package/dist/esm/auth/SignInForm.js.map +1 -1
- package/dist/esm/{stories → auth}/SignInForm.stories.d.ts +0 -0
- package/dist/esm/index.d.ts +66 -65
- package/dist/esm/index.js +66 -65
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/stories/referenceLab.d.ts +3 -0
- package/dist/esm/{useResource.d.ts → useResource/useResource.d.ts} +0 -0
- package/dist/esm/{useResource.js → useResource/useResource.js} +1 -1
- package/dist/esm/useResource/useResource.js.map +1 -0
- package/dist/esm/{QuestionnaireUtils.d.ts → utils/questionnaire.d.ts} +0 -0
- package/dist/esm/{QuestionnaireUtils.js → utils/questionnaire.js} +1 -1
- package/dist/esm/utils/questionnaire.js.map +1 -0
- package/dist/esm/utils/recaptcha.js +1 -1
- package/dist/esm/utils/recaptcha.js.map +1 -1
- package/dist/esm/{utils.d.ts → utils/script.d.ts} +0 -0
- package/dist/esm/{utils.js → utils/script.js} +1 -1
- package/dist/esm/utils/script.js.map +1 -0
- package/package.json +23 -23
- package/rollup.config.mjs +1 -1
- package/dist/esm/AddressDisplay.js.map +0 -1
- package/dist/esm/AddressInput.js.map +0 -1
- package/dist/esm/AnnotationInput.js.map +0 -1
- package/dist/esm/AttachmentArrayDisplay.js.map +0 -1
- package/dist/esm/AttachmentArrayInput.js.map +0 -1
- package/dist/esm/AttachmentButton.js.map +0 -1
- package/dist/esm/AttachmentDisplay.js.map +0 -1
- package/dist/esm/AttachmentInput.js.map +0 -1
- package/dist/esm/BackboneElementDisplay.js.map +0 -1
- package/dist/esm/BackboneElementInput.js.map +0 -1
- package/dist/esm/CalendarInput.js.map +0 -1
- package/dist/esm/CheckboxFormSection.js.map +0 -1
- package/dist/esm/CodeInput.js.map +0 -1
- package/dist/esm/CodeableConceptDisplay.js.map +0 -1
- package/dist/esm/CodeableConceptInput.js.map +0 -1
- package/dist/esm/CodingDisplay.js.map +0 -1
- package/dist/esm/CodingInput.js.map +0 -1
- package/dist/esm/ContactDetailDisplay.js.map +0 -1
- package/dist/esm/ContactDetailInput.js.map +0 -1
- package/dist/esm/ContactPointDisplay.js.map +0 -1
- package/dist/esm/ContactPointInput.js.map +0 -1
- package/dist/esm/DateTimeInput.js.map +0 -1
- package/dist/esm/DefaultResourceTimeline.js.map +0 -1
- package/dist/esm/DescriptionList.js.map +0 -1
- package/dist/esm/DiagnosticReportDisplay.js.map +0 -1
- package/dist/esm/Document.js.map +0 -1
- package/dist/esm/EncounterTimeline.js.map +0 -1
- package/dist/esm/ErrorBoundary.js.map +0 -1
- package/dist/esm/ExtensionInput.js.map +0 -1
- package/dist/esm/FhirPathDisplay.js.map +0 -1
- package/dist/esm/FhirPathTable.js.map +0 -1
- package/dist/esm/Form.js.map +0 -1
- package/dist/esm/FormSection.js.map +0 -1
- package/dist/esm/FormUtils.js.map +0 -1
- package/dist/esm/GoogleButton.js.map +0 -1
- package/dist/esm/HumanNameDisplay.js.map +0 -1
- package/dist/esm/HumanNameInput.js.map +0 -1
- package/dist/esm/IdentifierDisplay.js.map +0 -1
- package/dist/esm/IdentifierInput.js.map +0 -1
- package/dist/esm/Logo.js.map +0 -1
- package/dist/esm/MedplumLink.js.map +0 -1
- package/dist/esm/MedplumProvider.js.map +0 -1
- package/dist/esm/PatientTimeline.js.map +0 -1
- package/dist/esm/PeriodInput.js.map +0 -1
- package/dist/esm/PlanDefinitionBuilder.js.map +0 -1
- package/dist/esm/QuantityDisplay.js +0 -28
- package/dist/esm/QuantityDisplay.js.map +0 -1
- package/dist/esm/QuantityInput.js.map +0 -1
- package/dist/esm/QuestionnaireBuilder.js.map +0 -1
- package/dist/esm/QuestionnaireForm.js.map +0 -1
- package/dist/esm/QuestionnaireUtils.js.map +0 -1
- package/dist/esm/RangeDisplay.js +0 -21
- package/dist/esm/RangeDisplay.js.map +0 -1
- package/dist/esm/RangeInput.js.map +0 -1
- package/dist/esm/RatioDisplay.js.map +0 -1
- package/dist/esm/RatioInput.js.map +0 -1
- package/dist/esm/ReferenceDisplay.js.map +0 -1
- package/dist/esm/ReferenceInput.js.map +0 -1
- package/dist/esm/RequestGroupDisplay.js.map +0 -1
- package/dist/esm/ResourceArrayDisplay.js.map +0 -1
- package/dist/esm/ResourceArrayInput.js.map +0 -1
- package/dist/esm/ResourceAvatar.js.map +0 -1
- package/dist/esm/ResourceBadge.js.map +0 -1
- package/dist/esm/ResourceBlame.js.map +0 -1
- package/dist/esm/ResourceDiff.js.map +0 -1
- package/dist/esm/ResourceDiffTable.js.map +0 -1
- package/dist/esm/ResourceForm.js.map +0 -1
- package/dist/esm/ResourceHistoryTable.js.map +0 -1
- package/dist/esm/ResourceInput.js.map +0 -1
- package/dist/esm/ResourceName.js.map +0 -1
- package/dist/esm/ResourcePropertyDisplay.js.map +0 -1
- package/dist/esm/ResourcePropertyInput.js.map +0 -1
- package/dist/esm/ResourceTable.js.map +0 -1
- package/dist/esm/ResourceTimeline.js.map +0 -1
- package/dist/esm/Scheduler.js.map +0 -1
- package/dist/esm/SearchControl.js.map +0 -1
- package/dist/esm/SearchControlField.js.map +0 -1
- package/dist/esm/SearchFieldEditor.js.map +0 -1
- package/dist/esm/SearchFilterEditor.js.map +0 -1
- package/dist/esm/SearchFilterValueDialog.js.map +0 -1
- package/dist/esm/SearchFilterValueDisplay.js.map +0 -1
- package/dist/esm/SearchFilterValueInput.js.map +0 -1
- package/dist/esm/SearchPopupMenu.js.map +0 -1
- package/dist/esm/SearchUtils.js.map +0 -1
- package/dist/esm/ServiceRequestTimeline.js.map +0 -1
- package/dist/esm/StatusBadge.js.map +0 -1
- package/dist/esm/Timeline.js.map +0 -1
- package/dist/esm/TimingInput.js.map +0 -1
- package/dist/esm/ValueSetAutocomplete.js.map +0 -1
- package/dist/esm/useResource.js.map +0 -1
- package/dist/esm/utils.js.map +0 -1
|
@@ -2,10 +2,10 @@ import { Container, Paper, Group, Text, Menu, ActionIcon } from '@mantine/core';
|
|
|
2
2
|
import { formatDateTime, getReferenceString } from '@medplum/core';
|
|
3
3
|
import { IconDots } from '@tabler/icons';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { ErrorBoundary } from '
|
|
6
|
-
import { MedplumLink } from '
|
|
7
|
-
import { ResourceAvatar } from '
|
|
8
|
-
import { ResourceName } from '
|
|
5
|
+
import { ErrorBoundary } from '../ErrorBoundary/ErrorBoundary.js';
|
|
6
|
+
import { MedplumLink } from '../MedplumLink/MedplumLink.js';
|
|
7
|
+
import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.js';
|
|
8
|
+
import { ResourceName } from '../ResourceName/ResourceName.js';
|
|
9
9
|
|
|
10
10
|
function Timeline(props) {
|
|
11
11
|
return React.createElement(Container, null, props.children);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.js","sources":["../../../src/Timeline/Timeline.tsx"],"sourcesContent":["import { ActionIcon, Container, Group, Menu, Paper, Text } from '@mantine/core';\nimport { formatDateTime, getReferenceString } from '@medplum/core';\nimport { Reference, Resource } from '@medplum/fhirtypes';\nimport { IconDots } from '@tabler/icons';\nimport React from 'react';\nimport { ErrorBoundary } from '../ErrorBoundary/ErrorBoundary';\nimport { MedplumLink } from '../MedplumLink/MedplumLink';\nimport { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar';\nimport { ResourceName } from '../ResourceName/ResourceName';\n\nexport interface TimelineProps {\n children?: React.ReactNode;\n}\n\nexport function Timeline(props: TimelineProps): JSX.Element {\n return <Container>{props.children}</Container>;\n}\n\nexport interface TimelineItemProps {\n resource: Resource;\n profile?: Reference;\n socialEnabled?: boolean;\n children?: React.ReactNode;\n padding?: boolean;\n className?: string;\n popupMenuItems?: React.ReactNode;\n}\n\nexport function TimelineItem(props: TimelineItemProps): JSX.Element {\n const author = props.profile ?? props.resource.meta?.author;\n\n return (\n <Paper data-testid=\"timeline-item\" m=\"lg\" p=\"sm\" shadow=\"xs\" radius=\"sm\" withBorder className={props.className}>\n <Group position=\"apart\" spacing={8}>\n <ResourceAvatar value={author} link={true} size=\"md\" />\n <div style={{ flex: 1 }}>\n <Text size=\"sm\">\n <ResourceName color=\"dark\" weight={500} value={author} link={true} />\n </Text>\n <Text size=\"xs\">\n <MedplumLink color=\"dimmed\" to={props.resource}>\n {formatDateTime(props.resource.meta?.lastUpdated)}\n </MedplumLink>\n <Text component=\"span\" color=\"dimmed\" mx={8}>\n ·\n </Text>\n <MedplumLink color=\"dimmed\" to={props.resource}>\n {props.resource.resourceType}\n </MedplumLink>\n </Text>\n </div>\n {props.popupMenuItems && (\n <Menu position=\"bottom-end\" shadow=\"md\" width={200}>\n <Menu.Target>\n <ActionIcon radius=\"xl\" aria-label={`Actions for ${getReferenceString(props.resource)}`}>\n <IconDots />\n </ActionIcon>\n </Menu.Target>\n {props.popupMenuItems}\n </Menu>\n )}\n </Group>\n <ErrorBoundary>\n {props.padding && <div style={{ padding: '2px 16px 16px 16px' }}>{props.children}</div>}\n {!props.padding && <>{props.children}</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A,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA;AACX,YAAA,KAAK,CAAC,OAAO,IAAI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAA,EAAG,KAAK,CAAC,QAAQ,CAAO;AACtF,YAAA,CAAC,KAAK,CAAC,OAAO,IAAI,KAAG,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,KAAK,CAAC,QAAQ,CAAI,CAC1B,CACV,EACR;AACJ;;;;"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Group, Button, Modal, TextInput, NativeSelect, Checkbox } from '@mantine/core';
|
|
2
2
|
import { formatTiming } from '@medplum/core';
|
|
3
3
|
import React, { useState, useRef } from 'react';
|
|
4
|
-
import { DateTimeInput } from '
|
|
5
|
-
import { FormSection } from '
|
|
4
|
+
import { DateTimeInput } from '../DateTimeInput/DateTimeInput.js';
|
|
5
|
+
import { FormSection } from '../FormSection/FormSection.js';
|
|
6
6
|
|
|
7
7
|
const daysOfWeek = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
|
8
8
|
function TimingInput(props) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimingInput.js","sources":["../../../src/TimingInput/TimingInput.tsx"],"sourcesContent":["import { Button, Checkbox, Group, Modal, NativeSelect, TextInput } from '@mantine/core';\nimport { formatTiming } from '@medplum/core';\nimport { Timing, TimingRepeat } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\nimport { DateTimeInput } from '../DateTimeInput/DateTimeInput';\nimport { FormSection } from '../FormSection/FormSection';\n\nconst daysOfWeek = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n\ntype DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';\n\nexport interface TimingInputProps {\n name: string;\n defaultValue?: Timing;\n onChange?: (newValue: Timing) => void;\n}\n\nexport function TimingInput(props: TimingInputProps): JSX.Element {\n const [value, setValue] = useState<Timing>(props.defaultValue || {});\n const [open, setOpen] = useState(false);\n\n const valueRef = useRef<Timing>();\n valueRef.current = value;\n\n return (\n <>\n <Group spacing=\"xs\" grow noWrap>\n <span>{formatTiming(valueRef.current) || 'No repeat'}</span>\n <Button onClick={() => setOpen(true)}>Edit</Button>\n </Group>\n <TimingEditorDialog\n visible={open}\n defaultValue={valueRef.current}\n onOk={(newValue) => {\n if (props.onChange) {\n props.onChange(newValue);\n }\n setValue(newValue);\n setOpen(false);\n }}\n onCancel={() => setOpen(false)}\n />\n </>\n );\n}\n\ninterface TimingEditorDialogProps {\n visible: boolean;\n defaultValue?: Timing;\n onOk: (newValue: Timing) => void;\n onCancel: () => void;\n}\n\nfunction TimingEditorDialog(props: TimingEditorDialogProps): JSX.Element {\n const [value, setValue] = useState<Timing>(props.defaultValue || {});\n\n const valueRef = useRef<Timing>();\n valueRef.current = value;\n\n function setStart(newStart: string): void {\n setValue({ ...valueRef.current, event: [newStart] });\n }\n\n function setRepeat(repeat: TimingRepeat): void {\n setValue({ ...valueRef.current, repeat });\n }\n\n function setPeriod(newPeriod: number | undefined): void {\n setRepeat({ ...valueRef.current?.repeat, period: newPeriod });\n }\n\n function setPeriodUnit(newPeriodUnit: 'a' | 's' | 'min' | 'h' | 'd' | 'wk' | 'mo' | undefined): void {\n setRepeat({ ...valueRef.current?.repeat, periodUnit: newPeriodUnit });\n }\n\n function setDayOfWeek(day: DayOfWeek, enabled: boolean): void {\n if (enabled) {\n addDayOfWeek(day);\n } else {\n removeDayOfWeek(day);\n }\n }\n\n function addDayOfWeek(day: DayOfWeek): void {\n const existing = valueRef.current?.repeat?.dayOfWeek || [];\n if (!existing.includes(day)) {\n setRepeat({ ...valueRef.current?.repeat, dayOfWeek: [...existing, day] });\n }\n }\n\n function removeDayOfWeek(day: DayOfWeek): void {\n const existing = valueRef.current?.repeat?.dayOfWeek || [];\n if (existing.includes(day)) {\n setRepeat({ ...valueRef.current?.repeat, dayOfWeek: existing.filter((d) => d !== day) });\n }\n }\n\n return (\n <Modal title=\"Timing\" closeButtonLabel=\"Close\" opened={props.visible} onClose={() => props.onCancel()}>\n <div style={{ padding: '5px 20px', textAlign: 'left' }}>\n <FormSection title=\"Starts on\" htmlFor={'timing-dialog-start'}>\n <DateTimeInput name={'timing-dialog-start'} onChange={(newValue) => setStart(newValue)} />\n </FormSection>\n <FormSection title=\"Repeat every\" htmlFor={'timing-dialog-period'}>\n <Group spacing=\"xs\" grow noWrap>\n <TextInput\n type=\"number\"\n step={1}\n id=\"timing-dialog-period\"\n name=\"timing-dialog-period\"\n defaultValue={value?.repeat?.period}\n onChange={(e) => setPeriod(parseInt(e.currentTarget.value))}\n />\n <NativeSelect\n id=\"timing-dialog-periodUnit\"\n name=\"timing-dialog-periodUnit\"\n defaultValue={value?.repeat?.periodUnit}\n onChange={(e) => setPeriodUnit(e.currentTarget.value as 'a' | 'd' | 'wk' | 'mo' | undefined)}\n data={[\n { label: 'day', value: 'd' },\n { label: 'week', value: 'wk' },\n { label: 'month', value: 'mo' },\n { label: 'year', value: 'a' },\n ]}\n />\n </Group>\n </FormSection>\n <FormSection title=\"Repeat on\">\n <Group spacing=\"xs\" grow noWrap>\n {daysOfWeek.map((day) => (\n <React.Fragment key={day}>\n <label htmlFor={'timing-dialog-repeat-' + day}>{day.charAt(0).toUpperCase()}</label>\n <Checkbox\n id={'timing-dialog-repeat-' + day}\n name={'timing-dialog-repeat-' + day}\n onChange={(e) => setDayOfWeek(day as DayOfWeek, e.currentTarget.checked)}\n />\n </React.Fragment>\n ))}\n </Group>\n </FormSection>\n </div>\n <Button onClick={() => props.onOk(value)}>OK</Button>\n </Modal>\n );\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,E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W,EAAE,CAAS;AACpF,oBAAA,KAAA,CAAA,aAAA,CAAC,QAAQ,EACP,EAAA,EAAE,EAAE,uBAAuB,GAAG,GAAG,EACjC,IAAI,EAAE,uBAAuB,GAAG,GAAG,EACnC,QAAQ,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,GAAgB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EACxE,CAAA,CACa,CAClB,CAAC,CACI,CACI,CACV;AACN,QAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,OAAO,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAa,EAAA,IAAA,CAAA,CAC/C,EACR;AACJ;;;;"}
|
|
File without changes
|
package/dist/esm/{ValueSetAutocomplete.d.ts → ValueSetAutocomplete/ValueSetAutocomplete.d.ts}
RENAMED
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __awaiter } from '
|
|
1
|
+
import { __awaiter } from '../node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { MultiSelect } from '@mantine/core';
|
|
3
3
|
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
|
-
import { useMedplum } from '
|
|
4
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
5
5
|
|
|
6
6
|
function valueSetElementToAutocompleteItem(element) {
|
|
7
7
|
return {
|
|
@@ -13,8 +13,8 @@ function valueSetElementToAutocompleteItem(element) {
|
|
|
13
13
|
function ValueSetAutocomplete(props) {
|
|
14
14
|
const medplum = useMedplum();
|
|
15
15
|
const { property, defaultValue } = props;
|
|
16
|
-
const [textValues, setTextValues] = useState(defaultValue ? [defaultValue.code] : []);
|
|
17
|
-
const [data, setData] = useState(defaultValue ? [valueSetElementToAutocompleteItem(defaultValue)] : []);
|
|
16
|
+
const [textValues, setTextValues] = useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.code) ? [defaultValue.code] : []);
|
|
17
|
+
const [data, setData] = useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.code) ? [valueSetElementToAutocompleteItem(defaultValue)] : []);
|
|
18
18
|
const dataRef = useRef();
|
|
19
19
|
dataRef.current = data;
|
|
20
20
|
const loadValues = useCallback((input) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -24,7 +24,7 @@ function ValueSetAutocomplete(props) {
|
|
|
24
24
|
const valueSetElements = (_b = valueSet.expansion) === null || _b === void 0 ? void 0 : _b.contains;
|
|
25
25
|
const newData = [...dataRef.current];
|
|
26
26
|
for (const valueSetElement of valueSetElements) {
|
|
27
|
-
if (!newData.some((item) => item.value === valueSetElement.code)) {
|
|
27
|
+
if (valueSetElement.code && !newData.some((item) => item.value === valueSetElement.code)) {
|
|
28
28
|
newData.push(valueSetElementToAutocompleteItem(valueSetElement));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueSetAutocomplete.js","sources":["../../../src/ValueSetAutocomplete/ValueSetAutocomplete.tsx"],"sourcesContent":["import { MultiSelect } from '@mantine/core';\nimport { ElementDefinition, ValueSetExpansionContains } from '@medplum/fhirtypes';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ValueSetAutocompleteProps {\n property: ElementDefinition;\n name: string;\n placeholder?: string;\n defaultValue?: ValueSetExpansionContains;\n onChange?: (value: ValueSetExpansionContains | undefined) => void;\n}\n\ninterface ValueSetAutocompleteItem {\n value: string;\n label: string;\n element: ValueSetExpansionContains;\n}\n\nfunction valueSetElementToAutocompleteItem(element: ValueSetExpansionContains): ValueSetAutocompleteItem {\n return {\n value: element.code as string,\n label: getDisplay(element),\n element,\n };\n}\n\nexport function ValueSetAutocomplete(props: ValueSetAutocompleteProps): JSX.Element {\n const medplum = useMedplum();\n const { property, defaultValue } = props;\n const [textValues, setTextValues] = useState<string[]>(defaultValue?.code ? [defaultValue.code as string] : []);\n\n const [data, setData] = useState<ValueSetAutocompleteItem[]>(\n defaultValue?.code ? [valueSetElementToAutocompleteItem(defaultValue)] : []\n );\n\n const dataRef = useRef<ValueSetAutocompleteItem[]>();\n dataRef.current = data;\n\n const loadValues = useCallback(\n async (input: string): Promise<void> => {\n const system = property.binding?.valueSet as string;\n const valueSet = await medplum.searchValueSet(system, input);\n const valueSetElements = valueSet.expansion?.contains as ValueSetExpansionContains[];\n const newData = [...(dataRef.current as ValueSetAutocompleteItem[])];\n\n for (const valueSetElement of valueSetElements) {\n if (valueSetElement.code && !newData.some((item) => item.value === valueSetElement.code)) {\n newData.push(valueSetElementToAutocompleteItem(valueSetElement));\n }\n }\n\n setData(newData);\n },\n [medplum, property, dataRef]\n );\n\n function handleChange(values: string[]): void {\n setTextValues(values);\n\n const textValue = values[0];\n let currentItem = undefined;\n if (textValue) {\n currentItem = (dataRef.current as ValueSetAutocompleteItem[]).find((item) => item.value === values[0]);\n if (!currentItem) {\n const newElement = { code: textValue, display: textValue };\n currentItem = valueSetElementToAutocompleteItem(newElement);\n setData([...(dataRef.current as ValueSetAutocompleteItem[]), currentItem]);\n }\n }\n\n if (props.onChange) {\n props.onChange(currentItem?.element);\n }\n }\n\n useEffect(() => {\n loadValues('').catch(console.log);\n }, [loadValues]);\n\n return (\n <MultiSelect\n data={data}\n placeholder={props.placeholder}\n searchable\n creatable\n clearable\n value={textValues}\n filter={(value: string, selected: boolean, item: ValueSetAutocompleteItem) =>\n !!(\n textValues.length === 0 &&\n !selected &&\n (item.element.display?.toLowerCase().includes(value.toLowerCase().trim()) ||\n item.element.code?.toLowerCase().includes(value.toLowerCase().trim()))\n )\n }\n onChange={handleChange}\n getCreateLabel={(query) => `+ Create ${query}`}\n onCreate={(query) => valueSetElementToAutocompleteItem({ code: query, display: query })}\n />\n );\n}\n\nfunction getDisplay(item: ValueSetExpansionContains): string {\n return item.display || item.code || '';\n}\n"],"names":[],"mappings":";;;;;AAmBA,SAAS,iCAAiC,CAAC,OAAkC,EAAA;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K,KAAK,iCAAiC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAA,CACvF,EACF;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,IAA+B,EAAA;IACjD,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;AACzC;;;;"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import { LoginAuthenticationResponse } from '@medplum/core';
|
|
1
|
+
import { BaseLoginRequest, LoginAuthenticationResponse } from '@medplum/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export interface AuthenticationFormProps {
|
|
4
|
-
readonly projectId?: string;
|
|
5
|
-
readonly clientId?: string;
|
|
6
|
-
readonly resourceType?: string;
|
|
7
|
-
readonly scope?: string;
|
|
8
|
-
readonly nonce?: string;
|
|
9
|
-
readonly googleClientId?: string;
|
|
3
|
+
export interface AuthenticationFormProps extends BaseLoginRequest {
|
|
10
4
|
readonly generatePkce?: boolean;
|
|
11
|
-
readonly codeChallenge?: string;
|
|
12
|
-
readonly codeChallengeMethod?: string;
|
|
13
5
|
readonly onForgotPassword?: () => void;
|
|
14
6
|
readonly onRegister?: () => void;
|
|
15
7
|
readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;
|
|
@@ -1,42 +1,32 @@
|
|
|
1
|
-
import { __awaiter } from '../node_modules/tslib/tslib.es6.js';
|
|
1
|
+
import { __rest, __awaiter } from '../node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { Center, Alert, Group, Divider, Stack, TextInput, PasswordInput, Anchor, Checkbox, Button } from '@mantine/core';
|
|
3
3
|
import { IconAlertCircle } from '@tabler/icons';
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
|
-
import { Form } from '../Form.js';
|
|
6
|
-
import { getGoogleClientId, GoogleButton } from '../GoogleButton.js';
|
|
7
|
-
import { useMedplum } from '../MedplumProvider.js';
|
|
5
|
+
import { Form } from '../Form/Form.js';
|
|
6
|
+
import { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton.js';
|
|
7
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
8
8
|
import { getIssuesForExpression, getErrorsForInput } from '../utils/outcomes.js';
|
|
9
9
|
|
|
10
10
|
function AuthenticationForm(props) {
|
|
11
|
+
const { generatePkce, onForgotPassword, onRegister, handleAuthResponse, children } = props, baseLoginRequest = __rest(props, ["generatePkce", "onForgotPassword", "onRegister", "handleAuthResponse", "children"]);
|
|
11
12
|
const medplum = useMedplum();
|
|
12
13
|
const googleClientId = getGoogleClientId(props.googleClientId);
|
|
13
14
|
const [outcome, setOutcome] = useState();
|
|
14
15
|
const issues = getIssuesForExpression(outcome, undefined);
|
|
15
16
|
function startPkce() {
|
|
16
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
if (
|
|
18
|
+
if (generatePkce) {
|
|
18
19
|
yield medplum.startPkce();
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: (formData) => {
|
|
23
24
|
startPkce()
|
|
24
|
-
.then(() => medplum.startLogin({
|
|
25
|
-
|
|
26
|
-
clientId: props.clientId,
|
|
27
|
-
resourceType: props.resourceType,
|
|
28
|
-
scope: props.scope,
|
|
29
|
-
nonce: props.nonce,
|
|
30
|
-
codeChallenge: props.codeChallenge,
|
|
31
|
-
codeChallengeMethod: props.codeChallengeMethod,
|
|
32
|
-
email: formData.email,
|
|
33
|
-
password: formData.password,
|
|
34
|
-
remember: formData.remember === 'true',
|
|
35
|
-
}))
|
|
36
|
-
.then(props.handleAuthResponse)
|
|
25
|
+
.then(() => medplum.startLogin(Object.assign(Object.assign({}, baseLoginRequest), { email: formData.email, password: formData.password, remember: formData.remember === 'on' })))
|
|
26
|
+
.then(handleAuthResponse)
|
|
37
27
|
.catch(setOutcome);
|
|
38
28
|
} },
|
|
39
|
-
React.createElement(Center, { sx: { flexDirection: 'column' } },
|
|
29
|
+
React.createElement(Center, { sx: { flexDirection: 'column' } }, children),
|
|
40
30
|
issues && (React.createElement(Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), color: "red" }, issues.map((issue) => {
|
|
41
31
|
var _a, _b;
|
|
42
32
|
return (React.createElement("div", { "data-testid": "text-field-error", key: (_a = issue.details) === null || _a === void 0 ? void 0 : _a.text }, (_b = issue.details) === null || _b === void 0 ? void 0 : _b.text));
|
|
@@ -45,17 +35,7 @@ function AuthenticationForm(props) {
|
|
|
45
35
|
React.createElement(Group, { position: "center", p: "xl", style: { height: 70 } },
|
|
46
36
|
React.createElement(GoogleButton, { googleClientId: googleClientId, handleGoogleCredential: (response) => {
|
|
47
37
|
startPkce()
|
|
48
|
-
.then(() => medplum.startGoogleLogin({
|
|
49
|
-
projectId: props.projectId,
|
|
50
|
-
clientId: props.clientId,
|
|
51
|
-
resourceType: props.resourceType,
|
|
52
|
-
scope: props.scope,
|
|
53
|
-
nonce: props.nonce,
|
|
54
|
-
codeChallenge: props.codeChallenge,
|
|
55
|
-
codeChallengeMethod: props.codeChallengeMethod,
|
|
56
|
-
googleClientId: response.clientId,
|
|
57
|
-
googleCredential: response.credential,
|
|
58
|
-
}))
|
|
38
|
+
.then(() => medplum.startGoogleLogin(Object.assign(Object.assign({}, baseLoginRequest), { googleCredential: response.credential })))
|
|
59
39
|
.then(props.handleAuthResponse)
|
|
60
40
|
.catch(setOutcome);
|
|
61
41
|
} })),
|
|
@@ -64,9 +44,9 @@ function AuthenticationForm(props) {
|
|
|
64
44
|
React.createElement(TextInput, { name: "email", type: "email", label: "Email", placeholder: "name@domain.com", required: true, autoFocus: true, error: getErrorsForInput(outcome, 'email') }),
|
|
65
45
|
React.createElement(PasswordInput, { name: "password", type: "password", label: "Password", autoComplete: "off", required: true, error: getErrorsForInput(outcome, 'password') })),
|
|
66
46
|
React.createElement(Group, { position: "apart", mt: "xl", noWrap: true },
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
React.createElement(Checkbox, { name: "remember", label: "Remember me", size: "xs" }),
|
|
47
|
+
onForgotPassword && (React.createElement(Anchor, { component: "button", type: "button", color: "dimmed", onClick: onForgotPassword, size: "xs" }, "Forgot password")),
|
|
48
|
+
onRegister && (React.createElement(Anchor, { component: "button", type: "button", color: "dimmed", onClick: onRegister, size: "xs" }, "Register")),
|
|
49
|
+
React.createElement(Checkbox, { id: "remember", name: "remember", label: "Remember me", size: "xs" }),
|
|
70
50
|
React.createElement(Button, { type: "submit" }, "Sign in"))));
|
|
71
51
|
}
|
|
72
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationForm.js","sources":["../../../src/auth/AuthenticationForm.tsx"],"sourcesContent":["import {\n Alert,\n Anchor,\n Button,\n Center,\n Checkbox,\n Divider,\n Group,\n PasswordInput,\n Stack,\n TextInput,\n} from '@mantine/core';\nimport {
|
|
1
|
+
{"version":3,"file":"AuthenticationForm.js","sources":["../../../src/auth/AuthenticationForm.tsx"],"sourcesContent":["import {\n Alert,\n Anchor,\n Button,\n Center,\n Checkbox,\n Divider,\n Group,\n PasswordInput,\n Stack,\n TextInput,\n} from '@mantine/core';\nimport {\n BaseLoginRequest,\n GoogleCredentialResponse,\n GoogleLoginRequest,\n LoginAuthenticationResponse,\n} from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput, getIssuesForExpression } from '../utils/outcomes';\n\nexport interface AuthenticationFormProps extends BaseLoginRequest {\n readonly generatePkce?: boolean;\n readonly onForgotPassword?: () => void;\n readonly onRegister?: () => void;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n readonly children?: React.ReactNode;\n}\n\nexport function AuthenticationForm(props: AuthenticationFormProps): JSX.Element {\n const { generatePkce, onForgotPassword, onRegister, handleAuthResponse, children, ...baseLoginRequest } = props;\n const medplum = useMedplum();\n const googleClientId = getGoogleClientId(props.googleClientId);\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n async function startPkce(): Promise<void> {\n if (generatePkce) {\n await medplum.startPkce();\n }\n }\n\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={(formData: Record<string, string>) => {\n startPkce()\n .then(() =>\n medplum.startLogin({\n ...baseLoginRequest,\n email: formData.email,\n password: formData.password,\n remember: formData.remember === 'on',\n })\n )\n .then(handleAuthResponse)\n .catch(setOutcome);\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>{children}</Center>\n {issues && (\n <Alert icon={<IconAlertCircle size={16} />} color=\"red\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </Alert>\n )}\n {googleClientId && (\n <>\n <Group position=\"center\" p=\"xl\" style={{ height: 70 }}>\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={(response: GoogleCredentialResponse) => {\n startPkce()\n .then(() =>\n medplum.startGoogleLogin({\n ...baseLoginRequest,\n googleCredential: response.credential,\n } as GoogleLoginRequest)\n )\n .then(props.handleAuthResponse)\n .catch(setOutcome);\n }}\n />\n </Group>\n <Divider label=\"or\" labelPosition=\"center\" my=\"lg\" />\n </>\n )}\n <Stack spacing=\"xl\">\n <TextInput\n name=\"email\"\n type=\"email\"\n label=\"Email\"\n placeholder=\"name@domain.com\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'email')}\n />\n <PasswordInput\n name=\"password\"\n type=\"password\"\n label=\"Password\"\n autoComplete=\"off\"\n required={true}\n error={getErrorsForInput(outcome, 'password')}\n />\n </Stack>\n <Group position=\"apart\" mt=\"xl\" noWrap>\n {onForgotPassword && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onForgotPassword} size=\"xs\">\n Forgot password\n </Anchor>\n )}\n {onRegister && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onRegister} size=\"xs\">\n Register\n </Anchor>\n )}\n <Checkbox id=\"remember\" name=\"remember\" label=\"Remember me\" size=\"xs\" />\n <Button type=\"submit\">Sign in</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAkCM,SAAU,kBAAkB,CAAC,KAA8B,EAAA;AAC/D,IAAA,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAA0B,GAAA,KAAK,EAA1B,gBAAgB,GAAA,MAAA,CAAK,KAAK,EAAzG,CAAA,cAAA,EAAA,kBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,UAAA,CAAiG,CAAQ,CAAC;AAChH,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAoB,CAAC;IAC3D,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE1D,IAAA,SAAe,SAAS,GAAA;;AACtB,YAAA,IAAI,YAAY,EAAE;AAChB,gBAAA,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;AAC3B,aAAA;SACF,CAAA,CAAA;AAAA,KAAA;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAC,QAAgC,KAAI;AAC7C,YAAA,SAAS,EAAE;AACR,iBAAA,IAAI,CAAC,MACJ,OAAO,CAAC,UAAU,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACb,gBAAgB,C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EAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAC,IAAI,EAAA,EAAA,iBAAA,CAEnF,CACV;YACA,UAAU,KACT,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,EAAA,EAAA,UAAA,CAE7E,CACV;AACD,YAAA,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAC,EAAA,EAAE,EAAC,UAAU,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAG,CAAA;YACxE,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAiB,EAAA,SAAA,CAAA,CAChC,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stack, Center, Title, UnstyledButton, Group, Avatar, Text } from '@mantine/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Logo } from '../Logo.js';
|
|
4
|
-
import { useMedplum } from '../MedplumProvider.js';
|
|
3
|
+
import { Logo } from '../Logo/Logo.js';
|
|
4
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
5
5
|
|
|
6
6
|
function ChooseProfileForm(props) {
|
|
7
7
|
const medplum = useMedplum();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseProfileForm.js","sources":["../../../src/auth/ChooseProfileForm.tsx"],"sourcesContent":["import { Avatar, Center, Group, Stack, Text, Title, UnstyledButton } from '@mantine/core';\nimport { ProjectMembership } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { Logo } from '../Logo';\nimport { useMedplum } from '../MedplumProvider';\n\nexport interface ChooseProfileFormProps {\n login: string;\n memberships: ProjectMembership[];\n handleAuthResponse: (response: any) => void;\n}\n\nexport function ChooseProfileForm(props: ChooseProfileFormProps): JSX.Element {\n const medplum = useMedplum();\n return (\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Choose profile</Title>\n </Center>\n {props.memberships.map((membership: ProjectMembership) => (\n <UnstyledButton\n key={membership.id}\n onClick={() => {\n medplum\n .post('auth/profile', {\n login: props.login,\n profile: membership.id,\n })\n .then(props.handleAuthResponse)\n .catch(console.log);\n }}\n >\n <Group>\n <Avatar radius=\"xl\" />\n <div style={{ flex: 1 }}>\n <Text size=\"sm\" weight={500}>\n {membership.profile?.display}\n </Text>\n <Text color=\"dimmed\" size=\"xs\">\n {membership.project?.display}\n </Text>\n </div>\n </Group>\n </UnstyledButton>\n ))}\n </Stack>\n );\n}\n"],"names":[],"mappings":";;;;;AAYM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,QACE,oBAAC,KAAK,EAAA,IAAA;QACJ,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,YAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;YAClB,KAAC,CAAA,aAAA,CAAA,KAAK,yBAAuB,CACtB;QACR,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAA6B,KAAI;;AAAC,YAAA,QACxD,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACb,GAAG,EAAE,UAAU,CAAC,EAAE,EAClB,OAAO,EAAE,MAAK;oBACZ,OAAO;yBACJ,IAAI,CAAC,cAAc,EAAE;wBACpB,KAAK,EAAE,KAAK,CAAC,KAAK;wBAClB,OAAO,EAAE,UAAU,CAAC,EAAE;qBACvB,CAAC;AACD,yBAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAC9B,yBAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;iBACvB,EAAA;AAED,gBAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;AACJ,oBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,MAAM,EAAC,IAAI,EAAG,CAAA;AACtB,oBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAA;AACrB,wBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAC,IAAI,EAAC,MAAM,EAAE,GAAG,EAAA,EACxB,MAAA,UAAU,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,OAAO,CACvB;wBACP,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA,EAC3B,MAAA,UAAU,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,CACvB,CACH,CACA,CACO,EAClB;SAAA,CAAC,CACI,EACR;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"ChooseProfileForm.js","sources":["../../../src/auth/ChooseProfileForm.tsx"],"sourcesContent":["import { Avatar, Center, Group, Stack, Text, Title, UnstyledButton } from '@mantine/core';\nimport { ProjectMembership } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ChooseProfileFormProps {\n login: string;\n memberships: ProjectMembership[];\n handleAuthResponse: (response: any) => void;\n}\n\nexport function ChooseProfileForm(props: ChooseProfileFormProps): JSX.Element {\n const medplum = useMedplum();\n return (\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Choose profile</Title>\n </Center>\n {props.memberships.map((membership: ProjectMembership) => (\n <UnstyledButton\n key={membership.id}\n onClick={() => {\n medplum\n .post('auth/profile', {\n login: props.login,\n profile: membership.id,\n })\n .then(props.handleAuthResponse)\n .catch(console.log);\n }}\n >\n <Group>\n <Avatar radius=\"xl\" />\n <div style={{ flex: 1 }}>\n <Text size=\"sm\" weight={500}>\n {membership.profile?.display}\n </Text>\n <Text color=\"dimmed\" size=\"xs\">\n {membership.project?.display}\n </Text>\n </div>\n </Group>\n </UnstyledButton>\n ))}\n </Stack>\n );\n}\n"],"names":[],"mappings":";;;;;AAYM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,QACE,oBAAC,KAAK,EAAA,IAAA;QACJ,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,YAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;YAClB,KAAC,CAAA,aAAA,CAAA,KAAK,yBAAuB,CACtB;QACR,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAA6B,KAAI;;AAAC,YAAA,QACxD,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACb,GAAG,EAAE,UAAU,CAAC,EAAE,EAClB,OAAO,EAAE,MAAK;oBACZ,OAAO;yBACJ,IAAI,CAAC,cAAc,EAAE;wBACpB,KAAK,EAAE,KAAK,CAAC,KAAK;wBAClB,OAAO,EAAE,UAAU,CAAC,EAAE;qBACvB,CAAC;AACD,yBAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAC9B,yBAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;iBACvB,EAAA;AAED,gBAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;AACJ,oBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,MAAM,EAAC,IAAI,EAAG,CAAA;AACtB,oBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAA;AACrB,wBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAC,IAAI,EAAC,MAAM,EAAE,GAAG,EAAA,EACxB,MAAA,UAAU,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,OAAO,CACvB;wBACP,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA,EAC3B,MAAA,UAAU,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,CACvB,CACH,CACA,CACO,EAClB;SAAA,CAAC,CACI,EACR;AACJ;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Stack, Center, Title, Checkbox, Group, Button } from '@mantine/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Form } from '../Form/Form.js';
|
|
4
|
+
import { Logo } from '../Logo/Logo.js';
|
|
5
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
6
|
+
|
|
7
|
+
function ChooseScopeForm(props) {
|
|
8
|
+
const medplum = useMedplum();
|
|
9
|
+
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: (formData) => {
|
|
10
|
+
medplum
|
|
11
|
+
.post('auth/scope', {
|
|
12
|
+
login: props.login,
|
|
13
|
+
scope: Object.keys(formData).join(' '),
|
|
14
|
+
})
|
|
15
|
+
.then(props.handleAuthResponse)
|
|
16
|
+
.catch(console.log);
|
|
17
|
+
} },
|
|
18
|
+
React.createElement(Stack, null,
|
|
19
|
+
React.createElement(Center, { sx: { flexDirection: 'column' } },
|
|
20
|
+
React.createElement(Logo, { size: 32 }),
|
|
21
|
+
React.createElement(Title, null, "Choose scope")),
|
|
22
|
+
React.createElement(Stack, null, (props.scope || 'openid').split(' ').map((scopeName) => (React.createElement(Checkbox, { key: scopeName, id: scopeName, name: scopeName, label: scopeName, defaultChecked: true })))),
|
|
23
|
+
React.createElement(Group, { position: "right", mt: "xl" },
|
|
24
|
+
React.createElement(Button, { type: "submit" }, "Set scope")))));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { ChooseScopeForm };
|
|
28
|
+
//# sourceMappingURL=ChooseScopeForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChooseScopeForm.js","sources":["../../../src/auth/ChooseScopeForm.tsx"],"sourcesContent":["import { Button, Center, Checkbox, Group, Stack, Title } from '@mantine/core';\nimport React from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ChooseScopeFormProps {\n login: string;\n scope: string | undefined;\n handleAuthResponse: (response: any) => void;\n}\n\nexport function ChooseScopeForm(props: ChooseScopeFormProps): JSX.Element {\n const medplum = useMedplum();\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={(formData: Record<string, string>) => {\n medplum\n .post('auth/scope', {\n login: props.login,\n scope: Object.keys(formData).join(' '),\n })\n .then(props.handleAuthResponse)\n .catch(console.log);\n }}\n >\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Choose scope</Title>\n </Center>\n <Stack>\n {(props.scope || 'openid').split(' ').map((scopeName: string) => (\n <Checkbox key={scopeName} id={scopeName} name={scopeName} label={scopeName} defaultChecked />\n ))}\n </Stack>\n <Group position=\"right\" mt=\"xl\">\n <Button type=\"submit\">Set scope</Button>\n </Group>\n </Stack>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;AAYM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,OA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B,CAClC,CACF,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __awaiter } from '../node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { Center, Title, Stack, TextInput, Text, Group, Button } from '@mantine/core';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
-
import { Form } from '../Form.js';
|
|
5
|
-
import { Logo } from '../Logo.js';
|
|
6
|
-
import { useMedplum } from '../MedplumProvider.js';
|
|
4
|
+
import { Form } from '../Form/Form.js';
|
|
5
|
+
import { Logo } from '../Logo/Logo.js';
|
|
6
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
7
7
|
import { getErrorsForInput } from '../utils/outcomes.js';
|
|
8
8
|
|
|
9
9
|
function NewProjectForm(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProjectForm.js","sources":["../../../src/auth/NewProjectForm.tsx"],"sourcesContent":["import { Button, Center, Group, Stack, Text, TextInput, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { Form } from '../Form';\nimport { Logo } from '../Logo';\nimport { useMedplum } from '../MedplumProvider';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface NewProjectFormProps {\n login: string;\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function NewProjectForm(props: NewProjectFormProps): JSX.Element {\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome | undefined>();\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n props.handleAuthResponse(\n await medplum.startNewProject({\n login: props.login,\n projectName: formData.projectName,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Create project</Title>\n </Center>\n <Stack spacing=\"xl\">\n <TextInput\n name=\"projectName\"\n label=\"Project Name\"\n placeholder=\"My Project\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'firstName')}\n />\n <Text color=\"dimmed\" size=\"xs\">\n By clicking submit you agree to the Medplum <a href=\"https://www.medplum.com/privacy\">Privacy Policy</a>\n {' and '}\n <a href=\"https://www.medplum.com/terms\">Terms of Service</a>.\n </Text>\n </Stack>\n <Group position=\"right\" mt=\"xl\" noWrap>\n <Button type=\"submit\">Create project</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAcM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAgC,CAAC;AACvE,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAO,QAAgC,KAAI,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;YACnD,IAAI;AACF,gBAAA,KAAK,CAAC,kBAAkB,CACtB,MAAM,OAAO,CAAC,eAAe,CAAC;oBAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,WAAW,EAAE,QAAQ,CAAC,WAAW;AAClC,iBAAA,CAAC,CACH,CAAC;AACH,aAAA;AAAC,YAAA,OAAO,GAAG,EAAE;gBACZ,UAAU,CAAC,GAAuB,CAAC,CAAC;AACrC,aAAA;AACH,SAAC,CAAA,EAAA;QAED,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,YAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;YAClB,KAAC,CAAA,aAAA,CAAA,KAAK,yBAAuB,CACtB;AACT,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,OAAO,EAAC,IAAI,EAAA;AACjB,YAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,IAAI,EAAC,aAAa,EAClB,KAAK,EAAC,cAAc,EACpB,WAAW,EAAC,YAAY,EACxB,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,IAAI,EACf,KAAK,EAAE,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,EAC9C,CAAA;YACF,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA;;gBACgB,KAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,IAAI,EAAC,iCAAiC,EAAwB,EAAA,qBAAA,CAAA;gBAC5G,OAAO;gBACR,KAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,IAAI,EAAC,+BAA+B,EAA+B,EAAA,4BAAA,CAAA;oBACjE,CACD;QACR,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAA,IAAA,EAAA;YACpC,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAwB,EAAA,gBAAA,CAAA,CACvC,CACH,EACP;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"NewProjectForm.js","sources":["../../../src/auth/NewProjectForm.tsx"],"sourcesContent":["import { Button, Center, Group, Stack, Text, TextInput, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface NewProjectFormProps {\n login: string;\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function NewProjectForm(props: NewProjectFormProps): JSX.Element {\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome | undefined>();\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n props.handleAuthResponse(\n await medplum.startNewProject({\n login: props.login,\n projectName: formData.projectName,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Create project</Title>\n </Center>\n <Stack spacing=\"xl\">\n <TextInput\n name=\"projectName\"\n label=\"Project Name\"\n placeholder=\"My Project\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'firstName')}\n />\n <Text color=\"dimmed\" size=\"xs\">\n By clicking submit you agree to the Medplum <a href=\"https://www.medplum.com/privacy\">Privacy Policy</a>\n {' and '}\n <a href=\"https://www.medplum.com/terms\">Terms of Service</a>.\n </Text>\n </Stack>\n <Group position=\"right\" mt=\"xl\" noWrap>\n <Button type=\"submit\">Create project</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAcM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAgC,CAAC;AACvE,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAO,QAAgC,KAAI,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;YACnD,IAAI;AACF,gBAAA,KAAK,CAAC,kBAAkB,CACtB,MAAM,OAAO,CAAC,eAAe,CAAC;oBAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,WAAW,EAAE,QAAQ,CAAC,W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
|
|
@@ -2,9 +2,9 @@ import { __awaiter } from '../node_modules/tslib/tslib.es6.js';
|
|
|
2
2
|
import { Center, Alert, Group, Divider, Stack, TextInput, PasswordInput, Text, Checkbox, Button } from '@mantine/core';
|
|
3
3
|
import { IconAlertCircle } from '@tabler/icons';
|
|
4
4
|
import React, { useState, useEffect } from 'react';
|
|
5
|
-
import { Form } from '../Form.js';
|
|
6
|
-
import { getGoogleClientId, GoogleButton } from '../GoogleButton.js';
|
|
7
|
-
import { useMedplum } from '../MedplumProvider.js';
|
|
5
|
+
import { Form } from '../Form/Form.js';
|
|
6
|
+
import { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton.js';
|
|
7
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
8
8
|
import { getIssuesForExpression, getErrorsForInput } from '../utils/outcomes.js';
|
|
9
9
|
import { initRecaptcha, getRecaptcha } from '../utils/recaptcha.js';
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewUserForm.js","sources":["../../../src/auth/NewUserForm.tsx"],"sourcesContent":["import { Alert, Button, Center, Checkbox, Divider, Group, PasswordInput, Stack, Text, TextInput } from '@mantine/core';\nimport { GoogleCredentialResponse, LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { useEffect, useState } from 'react';\nimport { Form } from '../Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton';\nimport { useMedplum } from '../MedplumProvider';\nimport { getErrorsForInput, getIssuesForExpression } from '../utils/outcomes';\nimport { getRecaptcha, initRecaptcha } from '../utils/recaptcha';\n\nexport interface NewUserFormProps {\n readonly projectId: string;\n readonly googleClientId?: string;\n readonly recaptchaSiteKey: string;\n readonly children?: React.ReactNode;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function NewUserForm(props: NewUserFormProps): JSX.Element {\n const googleClientId = getGoogleClientId(props.googleClientId);\n const recaptchaSiteKey = props.recaptchaSiteKey;\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n useEffect(() => initRecaptcha(recaptchaSiteKey), [recaptchaSiteKey]);\n\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n const recaptchaToken = await getRecaptcha(recaptchaSiteKey);\n props.handleAuthResponse(\n await medplum.startNewUser({\n projectId: props.projectId,\n firstName: formData.firstName,\n lastName: formData.lastName,\n email: formData.email,\n password: formData.password,\n remember: formData.remember === 'true',\n recaptchaSiteKey,\n recaptchaToken,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>{props.children}</Center>\n {issues && (\n <Alert icon={<IconAlertCircle size={16} />} color=\"red\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </Alert>\n )}\n {googleClientId && (\n <>\n <Group position=\"center\" p=\"xl\" style={{ height: 70 }}>\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={async (response: GoogleCredentialResponse) => {\n try {\n props.handleAuthResponse(\n await medplum.startGoogleLogin({\n googleClientId: response.clientId,\n googleCredential: response.credential,\n createUser: true,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n />\n </Group>\n <Divider label=\"or\" labelPosition=\"center\" my=\"lg\" />\n </>\n )}\n <Stack spacing=\"xl\">\n <TextInput\n name=\"firstName\"\n type=\"text\"\n label=\"First name\"\n placeholder=\"First name\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'firstName')}\n />\n <TextInput\n name=\"lastName\"\n type=\"text\"\n label=\"Last name\"\n placeholder=\"Last name\"\n required={true}\n error={getErrorsForInput(outcome, 'lastName')}\n />\n <TextInput\n name=\"email\"\n type=\"email\"\n label=\"Email\"\n placeholder=\"name@domain.com\"\n required={true}\n error={getErrorsForInput(outcome, 'email')}\n />\n <PasswordInput\n name=\"password\"\n label=\"Password\"\n autoComplete=\"off\"\n required={true}\n error={getErrorsForInput(outcome, 'password')}\n />\n <Text color=\"dimmed\" size=\"xs\">\n By clicking submit you agree to the Medplum <a href=\"https://www.medplum.com/privacy\">Privacy Policy</a>\n {' and '}\n <a href=\"https://www.medplum.com/terms\">Terms of Service</a>.\n </Text>\n <Text color=\"dimmed\" size=\"xs\">\n This site is protected by reCAPTCHA and the Google{' '}\n <a href=\"https://policies.google.com/privacy\">Privacy Policy</a>\n {' and '}\n <a href=\"https://policies.google.com/terms\">Terms of Service</a> apply.\n </Text>\n </Stack>\n <Group position=\"apart\" mt=\"xl\" noWrap>\n <Checkbox name=\"remember\" label=\"Remember me\" size=\"xs\" />\n <Button type=\"submit\">Create account</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAmBM,SAAU,WAAW,CAAC,KAAuB,EAAA;IACjD,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAC/D,IAAA,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAoB,CAAC;IAC3D,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE1D,IAAA,SAAS,CAAC,MAAM,aAAa,CAAC,gBAAgB,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAErE,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAO,QAAgC,KAAI,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,C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I,EAAC,mCAAmC,EAA+B,EAAA,4BAAA,CAAA;0BACrE,CACD;QACR,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAA,IAAA,EAAA;AACpC,YAAA,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAG,CAAA;YAC1D,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAwB,EAAA,gBAAA,CAAA,CACvC,CACH,EACP;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"NewUserForm.js","sources":["../../../src/auth/NewUserForm.tsx"],"sourcesContent":["import { Alert, Button, Center, Checkbox, Divider, Group, PasswordInput, Stack, Text, TextInput } from '@mantine/core';\nimport { GoogleCredentialResponse, LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { useEffect, useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput, getIssuesForExpression } from '../utils/outcomes';\nimport { getRecaptcha, initRecaptcha } from '../utils/recaptcha';\n\nexport interface NewUserFormProps {\n readonly projectId: string;\n readonly googleClientId?: string;\n readonly recaptchaSiteKey: string;\n readonly children?: React.ReactNode;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function NewUserForm(props: NewUserFormProps): JSX.Element {\n const googleClientId = getGoogleClientId(props.googleClientId);\n const recaptchaSiteKey = props.recaptchaSiteKey;\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n useEffect(() => initRecaptcha(recaptchaSiteKey), [recaptchaSiteKey]);\n\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n const recaptchaToken = await getRecaptcha(recaptchaSiteKey);\n props.handleAuthResponse(\n await medplum.startNewUser({\n projectId: props.projectId,\n firstName: formData.firstName,\n lastName: formData.lastName,\n email: formData.email,\n password: formData.password,\n remember: formData.remember === 'true',\n recaptchaSiteKey,\n recaptchaToken,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>{props.children}</Center>\n {issues && (\n <Alert icon={<IconAlertCircle size={16} />} color=\"red\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </Alert>\n )}\n {googleClientId && (\n <>\n <Group position=\"center\" p=\"xl\" style={{ height: 70 }}>\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={async (response: GoogleCredentialResponse) => {\n try {\n props.handleAuthResponse(\n await medplum.startGoogleLogin({\n googleClientId: response.clientId,\n googleCredential: response.credential,\n createUser: true,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n />\n </Group>\n <Divider label=\"or\" labelPosition=\"center\" my=\"lg\" />\n </>\n )}\n <Stack spacing=\"xl\">\n <TextInput\n name=\"firstName\"\n type=\"text\"\n label=\"First name\"\n placeholder=\"First name\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'firstName')}\n />\n <TextInput\n name=\"lastName\"\n type=\"text\"\n label=\"Last name\"\n placeholder=\"Last name\"\n required={true}\n error={getErrorsForInput(outcome, 'lastName')}\n />\n <TextInput\n name=\"email\"\n type=\"email\"\n label=\"Email\"\n placeholder=\"name@domain.com\"\n required={true}\n error={getErrorsForInput(outcome, 'email')}\n />\n <PasswordInput\n name=\"password\"\n label=\"Password\"\n autoComplete=\"off\"\n required={true}\n error={getErrorsForInput(outcome, 'password')}\n />\n <Text color=\"dimmed\" size=\"xs\">\n By clicking submit you agree to the Medplum <a href=\"https://www.medplum.com/privacy\">Privacy Policy</a>\n {' and '}\n <a href=\"https://www.medplum.com/terms\">Terms of Service</a>.\n </Text>\n <Text color=\"dimmed\" size=\"xs\">\n This site is protected by reCAPTCHA and the Google{' '}\n <a href=\"https://policies.google.com/privacy\">Privacy Policy</a>\n {' and '}\n <a href=\"https://policies.google.com/terms\">Terms of Service</a> apply.\n </Text>\n </Stack>\n <Group position=\"apart\" mt=\"xl\" noWrap>\n <Checkbox name=\"remember\" label=\"Remember me\" size=\"xs\" />\n <Button type=\"submit\">Create account</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAmBM,SAAU,WAAW,CAAC,KAAuB,EAAA;IACjD,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAC/D,IAAA,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAoB,CAAC;IAC3D,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE1D,IAAA,SAAS,CAAC,MAAM,aAAa,CAAC,gBAAgB,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAErE,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAO,QAAgC,KAAI,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;YACnD,IAAI;AACF,gBAAA,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAC5D,gBAAA,KAAK,CAAC,kBAAkB,CACtB,MAAM,OAAO,CAAC,YA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AAA,IAAA,EAAA;AACpC,YAAA,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAG,CAAA;YAC1D,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAwB,EAAA,gBAAA,CAAA,CACvC,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { Document } from '../Document.js';
|
|
3
|
-
import { useMedplum } from '../MedplumProvider.js';
|
|
2
|
+
import { Document } from '../Document/Document.js';
|
|
3
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
4
4
|
import { NewProjectForm } from './NewProjectForm.js';
|
|
5
5
|
import { NewUserForm } from './NewUserForm.js';
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegisterForm.js","sources":["../../../src/auth/RegisterForm.tsx"],"sourcesContent":["import { LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { Document } from '../Document';\nimport { useMedplum } from '../MedplumProvider';\nimport { NewProjectForm } from './NewProjectForm';\nimport { NewUserForm } from './NewUserForm';\n\nexport interface RegisterFormProps {\n readonly type: 'patient' | 'project';\n readonly projectId?: string;\n readonly googleClientId?: string;\n readonly recaptchaSiteKey: string;\n readonly children?: React.ReactNode;\n readonly onSuccess: () => void;\n}\n\nexport function RegisterForm(props: RegisterFormProps): JSX.Element {\n const { type, projectId, googleClientId, recaptchaSiteKey, onSuccess } = props;\n const medplum = useMedplum();\n const [login, setLogin] = useState<string | undefined>(undefined);\n const [outcome, setOutcome] = useState<OperationOutcome>();\n\n useEffect(() => {\n if (type === 'patient' && login) {\n medplum\n .startNewPatient({ login, projectId: projectId as string })\n .then((response) => medplum.processCode(response.code as string))\n .then(() => onSuccess())\n .catch((err) => setOutcome(err as OperationOutcome));\n }\n }, [medplum, type, projectId, login, onSuccess]);\n\n function handleAuthResponse(response: LoginAuthenticationResponse): void {\n if (response.code) {\n medplum\n .processCode(response.code)\n .then(() => onSuccess())\n .catch(console.log);\n } else if (response.login) {\n setLogin(response.login);\n }\n }\n\n return (\n <Document width={450}>\n {outcome && <pre>{JSON.stringify(outcome, null, 2)}</pre>}\n {!login && (\n <NewUserForm\n projectId={projectId as string}\n googleClientId={googleClientId}\n recaptchaSiteKey={recaptchaSiteKey}\n handleAuthResponse={handleAuthResponse}\n >\n {props.children}\n </NewUserForm>\n )}\n {login && type === 'project' && <NewProjectForm login={login} handleAuthResponse={handleAuthResponse} />}\n </Document>\n );\n}\n"],"names":[],"mappings":";;;;;;AAiBM,SAAU,YAAY,CAAC,KAAwB,EAAA;AACnD,IAAA,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;AAC/E,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAClE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAoB,CAAC;IAE3D,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,EAAE;YAC/B,OAAO;iBACJ,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAmB,EAAE,CAAC;AAC1D,iBAAA,IAAI,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAc,CAAC,CAAC;AAChE,iBAAA,IAAI,CAAC,MAAM,SAAS,EAAE,CAAC;iBACvB,KAAK,CAAC,CAAC,GAAG,KAAK,UAAU,CAAC,GAAuB,CAAC,CAAC,CAAC;AACxD,SAAA;AACH,KAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;IAEjD,SAAS,kBAAkB,CAAC,QAAqC,EAAA;QAC/D,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,OAAO;AACJ,iBAAA,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC1B,iBAAA,IAAI,CAAC,MAAM,SAAS,EAAE,CAAC;AACvB,iBAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACvB,SAAA;aAAM,IAAI,QAAQ,CAAC,KAAK,EAAE;AACzB,YAAA,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1B,SAAA;KACF;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,KAAK,EAAE,GAAG,EAAA;AACjB,QAAA,OAAO,IAAI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAO;QACxD,CAAC,KAAK,KACL,KAAC,CAAA,aAAA,CAAA,WAAW,EACV,EAAA,SAAS,EAAE,SAAmB,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EAAA,EAErC,KAAK,CAAC,QAAQ,CACH,CACf;AACA,QAAA,KAAK,IAAI,IAAI,KAAK,SAAS,IAAI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAC,EAAA,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAI,CAAA,CAC/F,EACX;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"RegisterForm.js","sources":["../../../src/auth/RegisterForm.tsx"],"sourcesContent":["import { LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { Document } from '../Document/Document';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { NewProjectForm } from './NewProjectForm';\nimport { NewUserForm } from './NewUserForm';\n\nexport interface RegisterFormProps {\n readonly type: 'patient' | 'project';\n readonly projectId?: string;\n readonly googleClientId?: string;\n readonly recaptchaSiteKey: string;\n readonly children?: React.ReactNode;\n readonly onSuccess: () => void;\n}\n\nexport function RegisterForm(props: RegisterFormProps): JSX.Element {\n const { type, projectId, googleClientId, recaptchaSiteKey, onSuccess } = props;\n const medplum = useMedplum();\n const [login, setLogin] = useState<string | undefined>(undefined);\n const [outcome, setOutcome] = useState<OperationOutcome>();\n\n useEffect(() => {\n if (type === 'patient' && login) {\n medplum\n .startNewPatient({ login, projectId: projectId as string })\n .then((response) => medplum.processCode(response.code as string))\n .then(() => onSuccess())\n .catch((err) => setOutcome(err as OperationOutcome));\n }\n }, [medplum, type, projectId, login, onSuccess]);\n\n function handleAuthResponse(response: LoginAuthenticationResponse): void {\n if (response.code) {\n medplum\n .processCode(response.code)\n .then(() => onSuccess())\n .catch(console.log);\n } else if (response.login) {\n setLogin(response.login);\n }\n }\n\n return (\n <Document width={450}>\n {outcome && <pre>{JSON.stringify(outcome, null, 2)}</pre>}\n {!login && (\n <NewUserForm\n projectId={projectId as string}\n googleClientId={googleClientId}\n recaptchaSiteKey={recaptchaSiteKey}\n handleAuthResponse={handleAuthResponse}\n >\n {props.children}\n </NewUserForm>\n )}\n {login && type === 'project' && <NewProjectForm login={login} handleAuthResponse={handleAuthResponse} />}\n </Document>\n );\n}\n"],"names":[],"mappings":";;;;;;AAiBM,SAAU,YAAY,CAAC,KAAwB,EAAA;AACnD,IAAA,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;AAC/E,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,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,WAAW,EACV,EAAA,SAAS,EAAE,SAAmB,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EAAA,EAErC,KAAK,CAAC,QAAQ,CACH,CACf;AACA,QAAA,KAAK,IAAI,IAAI,KAAK,SAAS,IAAI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAC,EAAA,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAI,CAAA,CAC/F,EACX;AACJ;;;;"}
|
|
File without changes
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
+
import { BaseLoginRequest } from '@medplum/core';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export interface SignInFormProps {
|
|
3
|
-
readonly
|
|
4
|
-
readonly projectId?: string;
|
|
5
|
-
readonly googleClientId?: string;
|
|
6
|
-
readonly clientId?: string;
|
|
7
|
-
readonly scope?: string;
|
|
8
|
-
readonly nonce?: string;
|
|
9
|
-
readonly codeChallenge?: string;
|
|
10
|
-
readonly codeChallengeMethod?: string;
|
|
11
|
-
readonly resourceType?: string;
|
|
3
|
+
export interface SignInFormProps extends BaseLoginRequest {
|
|
4
|
+
readonly chooseScopes?: boolean;
|
|
12
5
|
readonly onSuccess?: () => void;
|
|
13
6
|
readonly onForgotPassword?: () => void;
|
|
14
7
|
readonly onRegister?: () => void;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { __rest } from '../node_modules/tslib/tslib.es6.js';
|
|
1
2
|
import React, { useState } from 'react';
|
|
2
|
-
import { Document } from '../Document.js';
|
|
3
|
-
import { useMedplum } from '../MedplumProvider.js';
|
|
3
|
+
import { Document } from '../Document/Document.js';
|
|
4
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
4
5
|
import { AuthenticationForm } from './AuthenticationForm.js';
|
|
5
6
|
import { ChooseProfileForm } from './ChooseProfileForm.js';
|
|
7
|
+
import { ChooseScopeForm } from './ChooseScopeForm.js';
|
|
6
8
|
import { NewProjectForm } from './NewProjectForm.js';
|
|
7
9
|
|
|
8
10
|
function SignInForm(props) {
|
|
11
|
+
const { chooseScopes, onSuccess, onForgotPassword, onRegister, onCode } = props, baseLoginRequest = __rest(props, ["chooseScopes", "onSuccess", "onForgotPassword", "onRegister", "onCode"]);
|
|
9
12
|
const medplum = useMedplum();
|
|
10
13
|
const [login, setLogin] = useState(undefined);
|
|
11
14
|
const [memberships, setMemberships] = useState(undefined);
|
|
@@ -17,24 +20,35 @@ function SignInForm(props) {
|
|
|
17
20
|
setMemberships(response.memberships);
|
|
18
21
|
}
|
|
19
22
|
if (response.code) {
|
|
20
|
-
if (
|
|
21
|
-
|
|
23
|
+
if (chooseScopes) {
|
|
24
|
+
setMemberships(undefined);
|
|
22
25
|
}
|
|
23
26
|
else {
|
|
24
|
-
|
|
25
|
-
.processCode(response.code)
|
|
26
|
-
.then(() => {
|
|
27
|
-
if (props.onSuccess) {
|
|
28
|
-
props.onSuccess();
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
.catch(console.log);
|
|
27
|
+
handleCode(response.code);
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
}
|
|
31
|
+
function handleScopeResponse(response) {
|
|
32
|
+
handleCode(response.code);
|
|
33
|
+
}
|
|
34
|
+
function handleCode(code) {
|
|
35
|
+
if (onCode) {
|
|
36
|
+
onCode(code);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
medplum
|
|
40
|
+
.processCode(code)
|
|
41
|
+
.then(() => {
|
|
42
|
+
if (onSuccess) {
|
|
43
|
+
onSuccess();
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
.catch(console.log);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
35
49
|
return (React.createElement(Document, { width: 450 }, (() => {
|
|
36
50
|
if (!login) {
|
|
37
|
-
return (React.createElement(AuthenticationForm, {
|
|
51
|
+
return (React.createElement(AuthenticationForm, Object.assign({ generatePkce: !onCode, onForgotPassword: onForgotPassword, onRegister: onRegister, handleAuthResponse: handleAuthResponse }, baseLoginRequest), props.children));
|
|
38
52
|
}
|
|
39
53
|
else if (memberships) {
|
|
40
54
|
return React.createElement(ChooseProfileForm, { login: login, memberships: memberships, handleAuthResponse: handleAuthResponse });
|
|
@@ -42,6 +56,9 @@ function SignInForm(props) {
|
|
|
42
56
|
else if (props.projectId === 'new') {
|
|
43
57
|
return React.createElement(NewProjectForm, { login: login, handleAuthResponse: handleAuthResponse });
|
|
44
58
|
}
|
|
59
|
+
else if (props.chooseScopes) {
|
|
60
|
+
return React.createElement(ChooseScopeForm, { login: login, scope: props.scope, handleAuthResponse: handleScopeResponse });
|
|
61
|
+
}
|
|
45
62
|
else {
|
|
46
63
|
return React.createElement("div", null, "Success");
|
|
47
64
|
}
|