@medplum/react 2.0.24 → 2.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +11 -7714
- package/dist/cjs/index.cjs.map +7 -1
- package/dist/esm/index.mjs +67 -92
- package/dist/esm/index.mjs.map +7 -1
- package/package.json +5 -8
- package/dist/cjs/index.min.cjs +0 -1
- package/dist/esm/AddressDisplay/AddressDisplay.mjs +0 -13
- package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +0 -1
- package/dist/esm/AddressInput/AddressInput.mjs +0 -57
- package/dist/esm/AddressInput/AddressInput.mjs.map +0 -1
- package/dist/esm/AnnotationInput/AnnotationInput.mjs +0 -28
- package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +0 -1
- package/dist/esm/AppShell/AppShell.mjs +0 -37
- package/dist/esm/AppShell/AppShell.mjs.map +0 -1
- package/dist/esm/AppShell/Header.mjs +0 -88
- package/dist/esm/AppShell/Header.mjs.map +0 -1
- package/dist/esm/AppShell/HeaderSearchInput.mjs +0 -230
- package/dist/esm/AppShell/HeaderSearchInput.mjs.map +0 -1
- package/dist/esm/AppShell/Navbar.mjs +0 -169
- package/dist/esm/AppShell/Navbar.mjs.map +0 -1
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +0 -121
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +0 -1
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs +0 -10
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +0 -1
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs +0 -45
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +0 -1
- package/dist/esm/AttachmentButton/AttachmentButton.mjs +0 -55
- package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +0 -1
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +0 -21
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +0 -1
- package/dist/esm/AttachmentInput/AttachmentInput.mjs +0 -27
- package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +0 -1
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs +0 -49
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +0 -1
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs +0 -52
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +0 -1
- package/dist/esm/BookmarkDialog/BookmarkDialog.mjs +0 -47
- package/dist/esm/BookmarkDialog/BookmarkDialog.mjs.map +0 -1
- package/dist/esm/CalendarInput/CalendarInput.mjs +0 -133
- package/dist/esm/CalendarInput/CalendarInput.mjs.map +0 -1
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs +0 -12
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +0 -1
- package/dist/esm/CodeInput/CodeInput.mjs +0 -24
- package/dist/esm/CodeInput/CodeInput.mjs.map +0 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs +0 -9
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +0 -1
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +0 -36
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +0 -1
- package/dist/esm/CodingDisplay/CodingDisplay.mjs +0 -9
- package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +0 -1
- package/dist/esm/CodingInput/CodingInput.mjs +0 -32
- package/dist/esm/CodingInput/CodingInput.mjs.map +0 -1
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs +0 -16
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +0 -1
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs +0 -35
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +0 -1
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs +0 -29
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +0 -1
- package/dist/esm/ContactPointInput/ContactPointInput.mjs +0 -45
- package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +0 -1
- package/dist/esm/Container/Container.mjs +0 -19
- package/dist/esm/Container/Container.mjs.map +0 -1
- package/dist/esm/DateTimeInput/DateTimeInput.mjs +0 -71
- package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +0 -1
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs +0 -16
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +0 -1
- package/dist/esm/DescriptionList/DescriptionList.mjs +0 -35
- package/dist/esm/DescriptionList/DescriptionList.mjs.map +0 -1
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs +0 -172
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +0 -1
- package/dist/esm/Document/Document.mjs +0 -12
- package/dist/esm/Document/Document.mjs.map +0 -1
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs +0 -32
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +0 -1
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs +0 -30
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +0 -1
- package/dist/esm/ExtensionInput/ExtensionInput.mjs +0 -14
- package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +0 -1
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs +0 -23
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +0 -1
- package/dist/esm/FhirPathTable/FhirPathTable.mjs +0 -122
- package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +0 -1
- package/dist/esm/Form/Form.mjs +0 -15
- package/dist/esm/Form/Form.mjs.map +0 -1
- package/dist/esm/Form/FormUtils.mjs +0 -50
- package/dist/esm/Form/FormUtils.mjs.map +0 -1
- package/dist/esm/FormSection/FormSection.mjs +0 -10
- package/dist/esm/FormSection/FormSection.mjs.map +0 -1
- package/dist/esm/GoogleButton/GoogleButton.mjs +0 -49
- package/dist/esm/GoogleButton/GoogleButton.mjs.map +0 -1
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs +0 -13
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +0 -1
- package/dist/esm/HumanNameInput/HumanNameInput.mjs +0 -50
- package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +0 -1
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +0 -11
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +0 -1
- package/dist/esm/IdentifierInput/IdentifierInput.mjs +0 -18
- package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +0 -1
- package/dist/esm/Loading/Loading.mjs +0 -10
- package/dist/esm/Loading/Loading.mjs.map +0 -1
- package/dist/esm/Logo/Logo.mjs +0 -14
- package/dist/esm/Logo/Logo.mjs.map +0 -1
- package/dist/esm/MedplumLink/MedplumLink.mjs +0 -52
- package/dist/esm/MedplumLink/MedplumLink.mjs.map +0 -1
- package/dist/esm/MedplumProvider/MedplumProvider.mjs +0 -84
- package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +0 -1
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +0 -9
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +0 -1
- package/dist/esm/MoneyInput/MoneyInput.mjs +0 -53
- package/dist/esm/MoneyInput/MoneyInput.mjs.map +0 -1
- package/dist/esm/NoteDisplay/NoteDisplay.mjs +0 -18
- package/dist/esm/NoteDisplay/NoteDisplay.mjs.map +0 -1
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs +0 -14
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs.map +0 -1
- package/dist/esm/Panel/Panel.mjs +0 -34
- package/dist/esm/Panel/Panel.mjs.map +0 -1
- package/dist/esm/PatientTimeline/PatientTimeline.mjs +0 -38
- package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +0 -1
- package/dist/esm/PeriodInput/PeriodInput.mjs +0 -19
- package/dist/esm/PeriodInput/PeriodInput.mjs.map +0 -1
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs +0 -258
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +0 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs +0 -9
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +0 -1
- package/dist/esm/QuantityInput/QuantityInput.mjs +0 -40
- package/dist/esm/QuantityInput/QuantityInput.mjs.map +0 -1
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs +0 -288
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +0 -1
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs +0 -276
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +0 -1
- package/dist/esm/RangeDisplay/RangeDisplay.mjs +0 -9
- package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +0 -1
- package/dist/esm/RangeInput/RangeInput.mjs +0 -31
- package/dist/esm/RangeInput/RangeInput.mjs.map +0 -1
- package/dist/esm/RatioDisplay/RatioDisplay.mjs +0 -16
- package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +0 -1
- package/dist/esm/RatioInput/RatioInput.mjs +0 -31
- package/dist/esm/RatioInput/RatioInput.mjs.map +0 -1
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs +0 -21
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +0 -1
- package/dist/esm/ReferenceInput/ReferenceInput.mjs +0 -45
- package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +0 -1
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs +0 -286
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +0 -1
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs +0 -72
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +0 -1
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs +0 -13
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +0 -1
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs +0 -51
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +0 -1
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +0 -23
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +0 -1
- package/dist/esm/ResourceBadge/ResourceBadge.mjs +0 -13
- package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +0 -1
- package/dist/esm/ResourceBlame/ResourceBlame.mjs +0 -113
- package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +0 -1
- package/dist/esm/ResourceDiff/ResourceDiff.mjs +0 -39
- package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +0 -1
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs +0 -80
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +0 -1
- package/dist/esm/ResourceForm/ResourceForm.mjs +0 -56
- package/dist/esm/ResourceForm/ResourceForm.mjs.map +0 -1
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs +0 -50
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +0 -1
- package/dist/esm/ResourceInput/ResourceInput.mjs +0 -70
- package/dist/esm/ResourceInput/ResourceInput.mjs.map +0 -1
- package/dist/esm/ResourceName/ResourceName.mjs +0 -25
- package/dist/esm/ResourceName/ResourceName.mjs.map +0 -1
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs +0 -119
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +0 -1
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs +0 -171
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +0 -1
- package/dist/esm/ResourceTable/ResourceTable.mjs +0 -25
- package/dist/esm/ResourceTable/ResourceTable.mjs.map +0 -1
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs +0 -309
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +0 -1
- package/dist/esm/Scheduler/Scheduler.mjs +0 -98
- package/dist/esm/Scheduler/Scheduler.mjs.map +0 -1
- package/dist/esm/SearchControl/SearchControl.mjs +0 -337
- package/dist/esm/SearchControl/SearchControl.mjs.map +0 -1
- package/dist/esm/SearchControl/SearchControlField.mjs +0 -95
- package/dist/esm/SearchControl/SearchControlField.mjs.map +0 -1
- package/dist/esm/SearchControl/SearchUtils.mjs +0 -497
- package/dist/esm/SearchControl/SearchUtils.mjs.map +0 -1
- package/dist/esm/SearchExportDialog/SearchExportDialog.mjs +0 -19
- package/dist/esm/SearchExportDialog/SearchExportDialog.mjs.map +0 -1
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs +0 -196
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +0 -1
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs +0 -97
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +0 -1
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs +0 -22
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +0 -1
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs +0 -22
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +0 -1
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs +0 -57
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +0 -1
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs +0 -134
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +0 -1
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs +0 -36
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +0 -1
- package/dist/esm/StatusBadge/StatusBadge.mjs +0 -63
- package/dist/esm/StatusBadge/StatusBadge.mjs.map +0 -1
- package/dist/esm/Timeline/Timeline.mjs +0 -40
- package/dist/esm/Timeline/Timeline.mjs.map +0 -1
- package/dist/esm/TimingInput/TimingInput.mjs +0 -76
- package/dist/esm/TimingInput/TimingInput.mjs.map +0 -1
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +0 -58
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +0 -1
- package/dist/esm/auth/AuthenticationForm.mjs +0 -89
- package/dist/esm/auth/AuthenticationForm.mjs.map +0 -1
- package/dist/esm/auth/ChooseProfileForm.mjs +0 -33
- package/dist/esm/auth/ChooseProfileForm.mjs.map +0 -1
- package/dist/esm/auth/ChooseScopeForm.mjs +0 -28
- package/dist/esm/auth/ChooseScopeForm.mjs.map +0 -1
- package/dist/esm/auth/MfaForm.mjs +0 -34
- package/dist/esm/auth/MfaForm.mjs.map +0 -1
- package/dist/esm/auth/NewProjectForm.mjs +0 -39
- package/dist/esm/auth/NewProjectForm.mjs.map +0 -1
- package/dist/esm/auth/NewUserForm.mjs +0 -84
- package/dist/esm/auth/NewUserForm.mjs.map +0 -1
- package/dist/esm/auth/RegisterForm.mjs +0 -39
- package/dist/esm/auth/RegisterForm.mjs.map +0 -1
- package/dist/esm/auth/SignInForm.mjs +0 -100
- package/dist/esm/auth/SignInForm.mjs.map +0 -1
- package/dist/esm/constants.mjs +0 -12
- package/dist/esm/constants.mjs.map +0 -1
- package/dist/esm/index.min.mjs +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +0 -70
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +0 -18
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs +0 -25
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs +0 -19
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs +0 -26
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs +0 -17
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs +0 -27
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs +0 -24
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs +0 -27
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs +0 -22
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs +0 -22
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs +0 -19
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs +0 -30
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconLogout.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconLogout.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs +0 -22
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs +0 -17
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs +0 -17
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs +0 -19
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSwitchHorizontal.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSwitchHorizontal.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs +0 -23
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs.map +0 -1
- package/dist/esm/useResource/useResource.mjs +0 -68
- package/dist/esm/useResource/useResource.mjs.map +0 -1
- package/dist/esm/utils/blame.mjs +0 -72
- package/dist/esm/utils/blame.mjs.map +0 -1
- package/dist/esm/utils/date.mjs +0 -56
- package/dist/esm/utils/date.mjs.map +0 -1
- package/dist/esm/utils/diff.mjs +0 -118
- package/dist/esm/utils/diff.mjs.map +0 -1
- package/dist/esm/utils/dom.mjs +0 -34
- package/dist/esm/utils/dom.mjs.map +0 -1
- package/dist/esm/utils/outcomes.mjs +0 -30
- package/dist/esm/utils/outcomes.mjs.map +0 -1
- package/dist/esm/utils/questionnaire.mjs +0 -26
- package/dist/esm/utils/questionnaire.mjs.map +0 -1
- package/dist/esm/utils/recaptcha.mjs +0 -32
- package/dist/esm/utils/recaptcha.mjs.map +0 -1
- package/dist/esm/utils/script.mjs +0 -16
- package/dist/esm/utils/script.mjs.map +0 -1
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Center, Group, Divider, TextInput, Anchor, Button, Stack, PasswordInput, Checkbox } from '@mantine/core';
|
|
2
|
-
import { normalizeOperationOutcome } from '@medplum/core';
|
|
3
|
-
import React, { useState, useCallback } from 'react';
|
|
4
|
-
import { Form } from '../Form/Form.mjs';
|
|
5
|
-
import { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton.mjs';
|
|
6
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
7
|
-
import { OperationOutcomeAlert } from '../OperationOutcomeAlert/OperationOutcomeAlert.mjs';
|
|
8
|
-
import { getIssuesForExpression, getErrorsForInput } from '../utils/outcomes.mjs';
|
|
9
|
-
|
|
10
|
-
function AuthenticationForm(props) {
|
|
11
|
-
const [email, setEmail] = useState();
|
|
12
|
-
if (!email) {
|
|
13
|
-
return React.createElement(EmailForm, { setEmail: setEmail, ...props });
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
return React.createElement(PasswordForm, { email: email, ...props });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function EmailForm(props) {
|
|
20
|
-
const { setEmail, onRegister, handleAuthResponse, children, ...baseLoginRequest } = props;
|
|
21
|
-
const medplum = useMedplum();
|
|
22
|
-
const googleClientId = !props.disableGoogleAuth && getGoogleClientId(props.googleClientId);
|
|
23
|
-
const isExternalAuth = useCallback(async (authMethod) => {
|
|
24
|
-
if (!authMethod.authorizeUrl) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
const state = JSON.stringify({
|
|
28
|
-
...(await medplum.ensureCodeChallenge(baseLoginRequest)),
|
|
29
|
-
domain: authMethod.domain,
|
|
30
|
-
});
|
|
31
|
-
const url = new URL(authMethod.authorizeUrl);
|
|
32
|
-
url.searchParams.set('state', state);
|
|
33
|
-
window.location.assign(url.toString());
|
|
34
|
-
return true;
|
|
35
|
-
}, [medplum, baseLoginRequest]);
|
|
36
|
-
const handleSubmit = useCallback(async (formData) => {
|
|
37
|
-
const authMethod = await medplum.post('auth/method', { email: formData.email });
|
|
38
|
-
if (!(await isExternalAuth(authMethod))) {
|
|
39
|
-
setEmail(formData.email);
|
|
40
|
-
}
|
|
41
|
-
}, [medplum, isExternalAuth, setEmail]);
|
|
42
|
-
const handleGoogleCredential = useCallback(async (response) => {
|
|
43
|
-
const authResponse = await medplum.startGoogleLogin({
|
|
44
|
-
...baseLoginRequest,
|
|
45
|
-
googleCredential: response.credential,
|
|
46
|
-
});
|
|
47
|
-
if (!(await isExternalAuth(authResponse))) {
|
|
48
|
-
handleAuthResponse(authResponse);
|
|
49
|
-
}
|
|
50
|
-
}, [medplum, baseLoginRequest, isExternalAuth, handleAuthResponse]);
|
|
51
|
-
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: handleSubmit },
|
|
52
|
-
React.createElement(Center, { sx: { flexDirection: 'column' } }, children),
|
|
53
|
-
googleClientId && (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(Group, { position: "center", p: "xl", style: { height: 70 } },
|
|
55
|
-
React.createElement(GoogleButton, { googleClientId: googleClientId, handleGoogleCredential: handleGoogleCredential })),
|
|
56
|
-
React.createElement(Divider, { label: "or", labelPosition: "center", my: "lg" }))),
|
|
57
|
-
React.createElement(TextInput, { name: "email", type: "email", label: "Email", placeholder: "name@domain.com", required: true, autoFocus: true }),
|
|
58
|
-
React.createElement(Group, { position: "apart", mt: "xl", spacing: 0, noWrap: true },
|
|
59
|
-
React.createElement("div", null, onRegister && (React.createElement(Anchor, { component: "button", type: "button", color: "dimmed", onClick: onRegister, size: "xs" }, "Register"))),
|
|
60
|
-
React.createElement(Button, { type: "submit" }, "Next"))));
|
|
61
|
-
}
|
|
62
|
-
function PasswordForm(props) {
|
|
63
|
-
const { onForgotPassword, handleAuthResponse, children, ...baseLoginRequest } = props;
|
|
64
|
-
const medplum = useMedplum();
|
|
65
|
-
const [outcome, setOutcome] = useState();
|
|
66
|
-
const issues = getIssuesForExpression(outcome, undefined);
|
|
67
|
-
const handleSubmit = useCallback((formData) => {
|
|
68
|
-
medplum
|
|
69
|
-
.startLogin({
|
|
70
|
-
...baseLoginRequest,
|
|
71
|
-
password: formData.password,
|
|
72
|
-
remember: formData.remember === 'on',
|
|
73
|
-
})
|
|
74
|
-
.then(handleAuthResponse)
|
|
75
|
-
.catch((err) => setOutcome(normalizeOperationOutcome(err)));
|
|
76
|
-
}, [medplum, baseLoginRequest, handleAuthResponse]);
|
|
77
|
-
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: handleSubmit },
|
|
78
|
-
React.createElement(Center, { sx: { flexDirection: 'column' } }, children),
|
|
79
|
-
React.createElement(OperationOutcomeAlert, { issues: issues }),
|
|
80
|
-
React.createElement(Stack, { spacing: "xl" },
|
|
81
|
-
React.createElement(PasswordInput, { name: "password", label: "Password", autoComplete: "off", required: true, autoFocus: true, error: getErrorsForInput(outcome, 'password') })),
|
|
82
|
-
React.createElement(Group, { position: "apart", mt: "xl", spacing: 0, noWrap: true },
|
|
83
|
-
onForgotPassword && (React.createElement(Anchor, { component: "button", type: "button", color: "dimmed", onClick: onForgotPassword, size: "xs" }, "Forgot password")),
|
|
84
|
-
React.createElement(Checkbox, { id: "remember", name: "remember", label: "Remember me", size: "xs", sx: { lineHeight: 1 } }),
|
|
85
|
-
React.createElement(Button, { type: "submit" }, "Sign in"))));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export { AuthenticationForm, EmailForm, PasswordForm };
|
|
89
|
-
//# sourceMappingURL=AuthenticationForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationForm.mjs","sources":["../../../src/auth/AuthenticationForm.tsx"],"sourcesContent":["import { Anchor, Button, Center, Checkbox, Divider, Group, PasswordInput, Stack, TextInput } from '@mantine/core';\nimport {\n BaseLoginRequest,\n GoogleCredentialResponse,\n GoogleLoginRequest,\n LoginAuthenticationResponse,\n normalizeOperationOutcome,\n} from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useCallback, useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { OperationOutcomeAlert } from '../OperationOutcomeAlert/OperationOutcomeAlert';\nimport { getErrorsForInput, getIssuesForExpression } from '../utils/outcomes';\n\nexport interface AuthenticationFormProps extends BaseLoginRequest {\n readonly disableGoogleAuth?: 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 [email, setEmail] = useState<string>();\n\n if (!email) {\n return <EmailForm setEmail={setEmail} {...props} />;\n } else {\n return <PasswordForm email={email} {...props} />;\n }\n}\n\nexport interface EmailFormProps extends BaseLoginRequest {\n readonly disableGoogleAuth?: boolean;\n readonly onRegister?: () => void;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n readonly setEmail: (email: string) => void;\n readonly children?: React.ReactNode;\n}\n\nexport function EmailForm(props: EmailFormProps): JSX.Element {\n const { setEmail, onRegister, handleAuthResponse, children, ...baseLoginRequest } = props;\n const medplum = useMedplum();\n const googleClientId = !props.disableGoogleAuth && getGoogleClientId(props.googleClientId);\n\n const isExternalAuth = useCallback(\n async (authMethod: any): Promise<boolean> => {\n if (!authMethod.authorizeUrl) {\n return false;\n }\n\n const state = JSON.stringify({\n ...(await medplum.ensureCodeChallenge(baseLoginRequest)),\n domain: authMethod.domain,\n });\n const url = new URL(authMethod.authorizeUrl);\n url.searchParams.set('state', state);\n window.location.assign(url.toString());\n return true;\n },\n [medplum, baseLoginRequest]\n );\n\n const handleSubmit = useCallback(\n async (formData: Record<string, string>) => {\n const authMethod = await medplum.post('auth/method', { email: formData.email });\n if (!(await isExternalAuth(authMethod))) {\n setEmail(formData.email);\n }\n },\n [medplum, isExternalAuth, setEmail]\n );\n\n const handleGoogleCredential = useCallback(\n async (response: GoogleCredentialResponse) => {\n const authResponse = await medplum.startGoogleLogin({\n ...baseLoginRequest,\n googleCredential: response.credential,\n } as GoogleLoginRequest);\n if (!(await isExternalAuth(authResponse))) {\n handleAuthResponse(authResponse);\n }\n },\n [medplum, baseLoginRequest, isExternalAuth, handleAuthResponse]\n );\n\n return (\n <Form style={{ maxWidth: 400 }} onSubmit={handleSubmit}>\n <Center sx={{ flexDirection: 'column' }}>{children}</Center>\n {googleClientId && (\n <>\n <Group position=\"center\" p=\"xl\" style={{ height: 70 }}>\n <GoogleButton googleClientId={googleClientId} handleGoogleCredential={handleGoogleCredential} />\n </Group>\n <Divider label=\"or\" labelPosition=\"center\" my=\"lg\" />\n </>\n )}\n <TextInput\n name=\"email\"\n type=\"email\"\n label=\"Email\"\n placeholder=\"name@domain.com\"\n required={true}\n autoFocus={true}\n />\n <Group position=\"apart\" mt=\"xl\" spacing={0} noWrap>\n <div>\n {onRegister && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onRegister} size=\"xs\">\n Register\n </Anchor>\n )}\n </div>\n <Button type=\"submit\">Next</Button>\n </Group>\n </Form>\n );\n}\n\nexport interface PasswordFormProps extends BaseLoginRequest {\n readonly email: string;\n readonly onForgotPassword?: () => void;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n readonly children?: React.ReactNode;\n}\n\nexport function PasswordForm(props: PasswordFormProps): JSX.Element {\n const { onForgotPassword, handleAuthResponse, children, ...baseLoginRequest } = props;\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n const handleSubmit = useCallback(\n (formData: Record<string, string>) => {\n medplum\n .startLogin({\n ...baseLoginRequest,\n password: formData.password,\n remember: formData.remember === 'on',\n })\n .then(handleAuthResponse)\n .catch((err) => setOutcome(normalizeOperationOutcome(err)));\n },\n [medplum, baseLoginRequest, handleAuthResponse]\n );\n\n return (\n <Form style={{ maxWidth: 400 }} onSubmit={handleSubmit}>\n <Center sx={{ flexDirection: 'column' }}>{children}</Center>\n <OperationOutcomeAlert issues={issues} />\n <Stack spacing=\"xl\">\n <PasswordInput\n name=\"password\"\n label=\"Password\"\n autoComplete=\"off\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'password')}\n />\n </Stack>\n <Group position=\"apart\" mt=\"xl\" spacing={0} noWrap>\n {onForgotPassword && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onForgotPassword} size=\"xs\">\n Forgot password\n </Anchor>\n )}\n <Checkbox id=\"remember\" name=\"remember\" label=\"Remember me\" size=\"xs\" sx={{ lineHeight: 1 }} />\n <Button type=\"submit\">Sign in</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBM,SAAU,kBAAkB,CAAC,KAA8B,EAAA;IAC/D,MAAM,CAAC,KAAK,EAAE,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,CAAC,GAC7C,CACI;AACR,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAA,IAAA,EAAA;YAC/C,gBAAgB,KACf,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAC,IAAI,EAAA,EAAA,iBAAA,CAEnF,CACV;YACD,KAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,EAAE,EAAC,UAAU,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,EAAI,CAAA;YAC/F,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAiB,EAAA,SAAA,CAAA,CAChC,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Stack, Center, Title, UnstyledButton, Group, Avatar, Text } from '@mantine/core';
|
|
2
|
-
import { normalizeOperationOutcome } from '@medplum/core';
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { Logo } from '../Logo/Logo.mjs';
|
|
5
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
6
|
-
import { OperationOutcomeAlert } from '../OperationOutcomeAlert/OperationOutcomeAlert.mjs';
|
|
7
|
-
|
|
8
|
-
function ChooseProfileForm(props) {
|
|
9
|
-
const medplum = useMedplum();
|
|
10
|
-
const [outcome, setOutcome] = useState();
|
|
11
|
-
return (React.createElement(Stack, null,
|
|
12
|
-
React.createElement(Center, { sx: { flexDirection: 'column' } },
|
|
13
|
-
React.createElement(Logo, { size: 32 }),
|
|
14
|
-
React.createElement(Title, { order: 3 }, "Choose profile")),
|
|
15
|
-
React.createElement(OperationOutcomeAlert, { outcome: outcome }),
|
|
16
|
-
props.memberships.map((membership) => (React.createElement(UnstyledButton, { key: membership.id, onClick: () => {
|
|
17
|
-
medplum
|
|
18
|
-
.post('auth/profile', {
|
|
19
|
-
login: props.login,
|
|
20
|
-
profile: membership.id,
|
|
21
|
-
})
|
|
22
|
-
.then(props.handleAuthResponse)
|
|
23
|
-
.catch((err) => setOutcome(normalizeOperationOutcome(err)));
|
|
24
|
-
} },
|
|
25
|
-
React.createElement(Group, null,
|
|
26
|
-
React.createElement(Avatar, { radius: "xl" }),
|
|
27
|
-
React.createElement("div", { style: { flex: 1 } },
|
|
28
|
-
React.createElement(Text, { size: "sm", weight: 500 }, membership.profile?.display),
|
|
29
|
-
React.createElement(Text, { color: "dimmed", size: "xs" }, membership.project?.display))))))));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { ChooseProfileForm };
|
|
33
|
-
//# sourceMappingURL=ChooseProfileForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseProfileForm.mjs","sources":["../../../src/auth/ChooseProfileForm.tsx"],"sourcesContent":["import { Avatar, Center, Group, Stack, Text, Title, UnstyledButton } from '@mantine/core';\nimport { LoginAuthenticationResponse, normalizeOperationOutcome } from '@medplum/core';\nimport { OperationOutcome, ProjectMembership } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { OperationOutcomeAlert } from '../OperationOutcomeAlert/OperationOutcomeAlert';\n\nexport interface ChooseProfileFormProps {\n login: string;\n memberships: ProjectMembership[];\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function ChooseProfileForm(props: ChooseProfileFormProps): JSX.Element {\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome>();\n return (\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title order={3}>Choose profile</Title>\n </Center>\n <OperationOutcomeAlert outcome={outcome} />\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((err) => setOutcome(normalizeOperationOutcome(err)));\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":";;;;;;;AAcM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAoB,CAAC;IAC3D,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;AAClB,YAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAC,EAAA,KAAK,EAAE,CAAC,qBAAwB,CAChC;AACT,QAAA,KAAA,CAAA,aAAA,CAAC,qBAAqB,EAAA,EAAC,OAAO,EAAE,OAAO,EAAI,CAAA;QAC1C,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAA6B,MACnD,oBAAC,cAAc,EAAA,EACb,GAAG,EAAE,UAAU,CAAC,EAAE,EAClB,OAAO,EAAE,MAAK;gBACZ,OAAO;qBACJ,IAAI,CAAC,cAAc,EAAE;oBACpB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,OAAO,EAAE,UAAU,CAAC,EAAE;iBACvB,CAAC;AACD,qBAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAC9B,qBAAA,KAAK,CAAC,CAAC,GAAG,KAAK,UAAU,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aAC/D,EAAA;AAED,YAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;AACJ,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,MAAM,EAAC,IAAI,EAAG,CAAA;AACtB,gBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAA;AACrB,oBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAC,IAAI,EAAC,MAAM,EAAE,GAAG,IACxB,UAAU,CAAC,OAAO,EAAE,OAAO,CACvB;oBACP,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAC3B,EAAA,UAAU,CAAC,OAAO,EAAE,OAAO,CACvB,CACH,CACA,CACO,CAClB,CAAC,CACI,EACR;AACJ;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Stack, Center, Title, Checkbox, Group, Button } from '@mantine/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Form } from '../Form/Form.mjs';
|
|
4
|
-
import { Logo } from '../Logo/Logo.mjs';
|
|
5
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
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.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseScopeForm.mjs","sources":["../../../src/auth/ChooseScopeForm.tsx"],"sourcesContent":["import { Button, Center, Checkbox, Group, Stack, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse } from '@medplum/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: LoginAuthenticationResponse) => 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":";;;;;;AAaM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAC7B,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAC,QAAgC,KAAI;YAC7C,OAAO;iBACJ,IAAI,CAAC,YAAY,EAAE;gBAClB,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;aACvC,CAAC;AACD,iBAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAC9B,iBAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SACvB,EAAA;AAED,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;YACJ,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;gBAClB,KAAC,CAAA,aAAA,CAAA,KAAK,uBAAqB,CACpB;YACT,KAAC,CAAA,aAAA,CAAA,KAAK,QACH,CAAC,KAAK,CAAC,KAAK,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,SAAiB,MAC1D,oBAAC,QAAQ,EAAA,EAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAA,IAAA,EAAA,CAAG,CAC9F,CAAC,CACI;YACR,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAA;gBAC7B,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,IAAI,EAAC,QAAQ,gBAAmB,CAClC,CACF,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Stack, Center, Title, Alert, TextInput, Group, Button } from '@mantine/core';
|
|
2
|
-
import { normalizeErrorString } from '@medplum/core';
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { Form } from '../Form/Form.mjs';
|
|
5
|
-
import { Logo } from '../Logo/Logo.mjs';
|
|
6
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
7
|
-
import IconAlertCircle from '../node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs';
|
|
8
|
-
|
|
9
|
-
function MfaForm(props) {
|
|
10
|
-
const medplum = useMedplum();
|
|
11
|
-
const [errorMessage, setErrorMessage] = useState(undefined);
|
|
12
|
-
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: (formData) => {
|
|
13
|
-
setErrorMessage(undefined);
|
|
14
|
-
medplum
|
|
15
|
-
.post('auth/mfa/verify', {
|
|
16
|
-
login: props.login,
|
|
17
|
-
token: formData.token,
|
|
18
|
-
})
|
|
19
|
-
.then(props.handleAuthResponse)
|
|
20
|
-
.catch((err) => setErrorMessage(normalizeErrorString(err)));
|
|
21
|
-
} },
|
|
22
|
-
React.createElement(Stack, null,
|
|
23
|
-
React.createElement(Center, { sx: { flexDirection: 'column' } },
|
|
24
|
-
React.createElement(Logo, { size: 32 }),
|
|
25
|
-
React.createElement(Title, null, "Enter MFA code")),
|
|
26
|
-
errorMessage && (React.createElement(Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), title: "Error", color: "red" }, errorMessage)),
|
|
27
|
-
React.createElement(Stack, null,
|
|
28
|
-
React.createElement(TextInput, { name: "token", label: "MFA code", required: true })),
|
|
29
|
-
React.createElement(Group, { position: "right", mt: "xl" },
|
|
30
|
-
React.createElement(Button, { type: "submit" }, "Submit code")))));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { MfaForm };
|
|
34
|
-
//# sourceMappingURL=MfaForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MfaForm.mjs","sources":["../../../src/auth/MfaForm.tsx"],"sourcesContent":["import { Alert, Button, Center, Group, Stack, TextInput, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse, normalizeErrorString } from '@medplum/core';\nimport { IconAlertCircle } from '@tabler/icons-react';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface MfaFormProps {\n login: string;\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function MfaForm(props: MfaFormProps): JSX.Element {\n const medplum = useMedplum();\n const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined);\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={(formData: Record<string, string>) => {\n setErrorMessage(undefined);\n medplum\n .post('auth/mfa/verify', {\n login: props.login,\n token: formData.token,\n })\n .then(props.handleAuthResponse)\n .catch((err) => setErrorMessage(normalizeErrorString(err)));\n }}\n >\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Enter MFA code</Title>\n </Center>\n {errorMessage && (\n <Alert icon={<IconAlertCircle size={16} />} title=\"Error\" color=\"red\">\n {errorMessage}\n </Alert>\n )}\n <Stack>\n <TextInput name=\"token\" label=\"MFA code\" required />\n </Stack>\n <Group position=\"right\" mt=\"xl\">\n <Button type=\"submit\">Submit code</Button>\n </Group>\n </Stack>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAaM,SAA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AA,EAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAA,IAAA,EAAA,CAAG,CAC9C;YACR,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAA;gBAC7B,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,IAAI,EAAC,QAAQ,kBAAqB,CACpC,CACF,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Center, Title, Stack, TextInput, Text, Anchor, Group, Button } from '@mantine/core';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import { Form } from '../Form/Form.mjs';
|
|
4
|
-
import { Logo } from '../Logo/Logo.mjs';
|
|
5
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
6
|
-
import { getErrorsForInput } from '../utils/outcomes.mjs';
|
|
7
|
-
|
|
8
|
-
function NewProjectForm(props) {
|
|
9
|
-
const medplum = useMedplum();
|
|
10
|
-
const [outcome, setOutcome] = useState();
|
|
11
|
-
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: async (formData) => {
|
|
12
|
-
try {
|
|
13
|
-
props.handleAuthResponse(await medplum.startNewProject({
|
|
14
|
-
login: props.login,
|
|
15
|
-
projectName: formData.projectName,
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
setOutcome(err);
|
|
20
|
-
}
|
|
21
|
-
} },
|
|
22
|
-
React.createElement(Center, { sx: { flexDirection: 'column' } },
|
|
23
|
-
React.createElement(Logo, { size: 32 }),
|
|
24
|
-
React.createElement(Title, null, "Create project")),
|
|
25
|
-
React.createElement(Stack, { spacing: "xl" },
|
|
26
|
-
React.createElement(TextInput, { name: "projectName", label: "Project Name", placeholder: "My Project", required: true, autoFocus: true, error: getErrorsForInput(outcome, 'firstName') }),
|
|
27
|
-
React.createElement(Text, { color: "dimmed", size: "xs" },
|
|
28
|
-
"By clicking submit you agree to the Medplum",
|
|
29
|
-
' ',
|
|
30
|
-
React.createElement(Anchor, { href: "https://www.medplum.com/privacy" }, "Privacy\u00A0Policy"),
|
|
31
|
-
' and ',
|
|
32
|
-
React.createElement(Anchor, { href: "https://www.medplum.com/terms" }, "Terms\u00A0of\u00A0Service"),
|
|
33
|
-
".")),
|
|
34
|
-
React.createElement(Group, { position: "right", mt: "xl", noWrap: true },
|
|
35
|
-
React.createElement(Button, { type: "submit" }, "Create project"))));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { NewProjectForm };
|
|
39
|
-
//# sourceMappingURL=NewProjectForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NewProjectForm.mjs","sources":["../../../src/auth/NewProjectForm.tsx"],"sourcesContent":["import { Anchor, 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{' '}\n <Anchor href=\"https://www.medplum.com/privacy\">Privacy Policy</Anchor>\n {' and '}\n <Anchor href=\"https://www.medplum.com/terms\">Terms of Service</Anchor>.\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,IACH,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,OAAO,QAAgC,KAAI;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;SACF,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,GAAG;AAC/C,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,iCAAiC,EAA6B,EAAA,qBAAA,CAAA;gBAC1E,OAAO;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,+BAA+B,EAAoC,EAAA,4BAAA,CAAA;oBAC3E,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,84 +0,0 @@
|
|
|
1
|
-
import { Center, Group, Divider, Stack, TextInput, PasswordInput, Text, Anchor, Checkbox, Button } from '@mantine/core';
|
|
2
|
-
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import { Form } from '../Form/Form.mjs';
|
|
4
|
-
import { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton.mjs';
|
|
5
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
6
|
-
import { OperationOutcomeAlert } from '../OperationOutcomeAlert/OperationOutcomeAlert.mjs';
|
|
7
|
-
import { getIssuesForExpression, getErrorsForInput } from '../utils/outcomes.mjs';
|
|
8
|
-
import { initRecaptcha, getRecaptcha } from '../utils/recaptcha.mjs';
|
|
9
|
-
|
|
10
|
-
function NewUserForm(props) {
|
|
11
|
-
const googleClientId = getGoogleClientId(props.googleClientId);
|
|
12
|
-
const recaptchaSiteKey = props.recaptchaSiteKey;
|
|
13
|
-
const medplum = useMedplum();
|
|
14
|
-
const [outcome, setOutcome] = useState();
|
|
15
|
-
const issues = getIssuesForExpression(outcome, undefined);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (recaptchaSiteKey) {
|
|
18
|
-
initRecaptcha(recaptchaSiteKey);
|
|
19
|
-
}
|
|
20
|
-
}, [recaptchaSiteKey]);
|
|
21
|
-
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: async (formData) => {
|
|
22
|
-
try {
|
|
23
|
-
let recaptchaToken = '';
|
|
24
|
-
if (recaptchaSiteKey) {
|
|
25
|
-
recaptchaToken = await getRecaptcha(recaptchaSiteKey);
|
|
26
|
-
}
|
|
27
|
-
props.handleAuthResponse(await medplum.startNewUser({
|
|
28
|
-
projectId: props.projectId,
|
|
29
|
-
firstName: formData.firstName,
|
|
30
|
-
lastName: formData.lastName,
|
|
31
|
-
email: formData.email,
|
|
32
|
-
password: formData.password,
|
|
33
|
-
remember: formData.remember === 'true',
|
|
34
|
-
recaptchaSiteKey,
|
|
35
|
-
recaptchaToken,
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
setOutcome(err);
|
|
40
|
-
}
|
|
41
|
-
} },
|
|
42
|
-
React.createElement(Center, { sx: { flexDirection: 'column' } }, props.children),
|
|
43
|
-
React.createElement(OperationOutcomeAlert, { issues: issues }),
|
|
44
|
-
googleClientId && (React.createElement(React.Fragment, null,
|
|
45
|
-
React.createElement(Group, { position: "center", p: "xl", style: { height: 70 } },
|
|
46
|
-
React.createElement(GoogleButton, { googleClientId: googleClientId, handleGoogleCredential: async (response) => {
|
|
47
|
-
try {
|
|
48
|
-
props.handleAuthResponse(await medplum.startGoogleLogin({
|
|
49
|
-
googleClientId: response.clientId,
|
|
50
|
-
googleCredential: response.credential,
|
|
51
|
-
createUser: true,
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
setOutcome(err);
|
|
56
|
-
}
|
|
57
|
-
} })),
|
|
58
|
-
React.createElement(Divider, { label: "or", labelPosition: "center", my: "lg" }))),
|
|
59
|
-
React.createElement(Stack, { spacing: "xl" },
|
|
60
|
-
React.createElement(TextInput, { name: "firstName", type: "text", label: "First name", placeholder: "First name", required: true, autoFocus: true, error: getErrorsForInput(outcome, 'firstName') }),
|
|
61
|
-
React.createElement(TextInput, { name: "lastName", type: "text", label: "Last name", placeholder: "Last name", required: true, error: getErrorsForInput(outcome, 'lastName') }),
|
|
62
|
-
React.createElement(TextInput, { name: "email", type: "email", label: "Email", placeholder: "name@domain.com", required: true, error: getErrorsForInput(outcome, 'email') }),
|
|
63
|
-
React.createElement(PasswordInput, { name: "password", label: "Password", autoComplete: "off", required: true, error: getErrorsForInput(outcome, 'password') }),
|
|
64
|
-
React.createElement(Text, { color: "dimmed", size: "xs" },
|
|
65
|
-
"By clicking submit you agree to the Medplum",
|
|
66
|
-
' ',
|
|
67
|
-
React.createElement(Anchor, { href: "https://www.medplum.com/privacy" }, "Privacy\u00A0Policy"),
|
|
68
|
-
' and ',
|
|
69
|
-
React.createElement(Anchor, { href: "https://www.medplum.com/terms" }, "Terms\u00A0of\u00A0Service"),
|
|
70
|
-
"."),
|
|
71
|
-
React.createElement(Text, { color: "dimmed", size: "xs" },
|
|
72
|
-
"This site is protected by reCAPTCHA and the Google",
|
|
73
|
-
' ',
|
|
74
|
-
React.createElement(Anchor, { href: "https://policies.google.com/privacy" }, "Privacy\u00A0Policy"),
|
|
75
|
-
' and ',
|
|
76
|
-
React.createElement(Anchor, { href: "https://policies.google.com/terms" }, "Terms\u00A0of\u00A0Service"),
|
|
77
|
-
" apply.")),
|
|
78
|
-
React.createElement(Group, { position: "apart", mt: "xl", noWrap: true },
|
|
79
|
-
React.createElement(Checkbox, { name: "remember", label: "Remember me", size: "xs" }),
|
|
80
|
-
React.createElement(Button, { type: "submit" }, "Create account"))));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { NewUserForm };
|
|
84
|
-
//# sourceMappingURL=NewUserForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NewUserForm.mjs","sources":["../../../src/auth/NewUserForm.tsx"],"sourcesContent":["import { Anchor, Button, Center, Checkbox, Divider, Group, PasswordInput, Stack, Text, TextInput } from '@mantine/core';\nimport { GoogleCredentialResponse, LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { OperationOutcomeAlert } from '../OperationOutcomeAlert/OperationOutcomeAlert';\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(() => {\n if (recaptchaSiteKey) {\n initRecaptcha(recaptchaSiteKey);\n }\n }, [recaptchaSiteKey]);\n\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n let recaptchaToken = '';\n if (recaptchaSiteKey) {\n recaptchaToken = await getRecaptcha(recaptchaSiteKey);\n }\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 <OperationOutcomeAlert issues={issues} />\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{' '}\n <Anchor href=\"https://www.medplum.com/privacy\">Privacy Policy</Anchor>\n {' and '}\n <Anchor href=\"https://www.medplum.com/terms\">Terms of Service</Anchor>.\n </Text>\n <Text color=\"dimmed\" size=\"xs\">\n This site is protected by reCAPTCHA and the Google{' '}\n <Anchor href=\"https://policies.google.com/privacy\">Privacy Policy</Anchor>\n {' and '}\n <Anchor href=\"https://policies.google.com/terms\">Terms of Service</Anchor> 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;IAE1D,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,gBAAgB,EAAE;YACpB,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACjC,SAAA;AACH,KAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAEvB,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,IACH,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,OAAO,QAAgC,KAAI;YACnD,IAAI;gBACF,IAAI,cAAc,GAAG,EAAE,CAAC;AACxB,gBAAA,IAAI,gBAAgB,EAAE;AACpB,oBAAA,cAAc,GAAG,MAAM,YAAY,CAAC,gBAAgB,CAAC,CAAC;AACvD,iBAAA;AACD,gBAAA,KAAK,CAAC,kBAAkB,CACtB,MAAM,OAAO,CAAC,YAAY,CAAC;oBACzB,SAAS,EAAE,KAAK,CAAC,SAAS;oBAC1B,SAAS,EAAE,QAAQ,CAAC,SAAS;oBAC7B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;oBAC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AAC/C,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,iCAAiC,EAA6B,EAAA,qBAAA,CAAA;gBAC1E,OAAO;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,+BAA+B,EAAoC,EAAA,4BAAA,CAAA;AAC3E,gBAAA,GAAA,CAAA;YACP,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA;;gBACuB,GAAG;AACtD,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,qCAAqC,EAA6B,EAAA,qBAAA,CAAA;gBAC9E,OAAO;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,mCAAmC,EAAoC,EAAA,4BAAA,CAAA;0BAC/E,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,39 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { Document } from '../Document/Document.mjs';
|
|
3
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
4
|
-
import { NewProjectForm } from './NewProjectForm.mjs';
|
|
5
|
-
import { NewUserForm } from './NewUserForm.mjs';
|
|
6
|
-
|
|
7
|
-
function RegisterForm(props) {
|
|
8
|
-
const { type, projectId, googleClientId, recaptchaSiteKey, onSuccess } = props;
|
|
9
|
-
const medplum = useMedplum();
|
|
10
|
-
const [login, setLogin] = useState(undefined);
|
|
11
|
-
const [outcome, setOutcome] = useState();
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (type === 'patient' && login) {
|
|
14
|
-
medplum
|
|
15
|
-
.startNewPatient({ login, projectId: projectId })
|
|
16
|
-
.then((response) => medplum.processCode(response.code))
|
|
17
|
-
.then(() => onSuccess())
|
|
18
|
-
.catch((err) => setOutcome(err));
|
|
19
|
-
}
|
|
20
|
-
}, [medplum, type, projectId, login, onSuccess]);
|
|
21
|
-
function handleAuthResponse(response) {
|
|
22
|
-
if (response.code) {
|
|
23
|
-
medplum
|
|
24
|
-
.processCode(response.code)
|
|
25
|
-
.then(() => onSuccess())
|
|
26
|
-
.catch(console.log);
|
|
27
|
-
}
|
|
28
|
-
else if (response.login) {
|
|
29
|
-
setLogin(response.login);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return (React.createElement(Document, { width: 450 },
|
|
33
|
-
outcome && React.createElement("pre", null, JSON.stringify(outcome, null, 2)),
|
|
34
|
-
!login && (React.createElement(NewUserForm, { projectId: projectId, googleClientId: googleClientId, recaptchaSiteKey: recaptchaSiteKey, handleAuthResponse: handleAuthResponse }, props.children)),
|
|
35
|
-
login && type === 'project' && React.createElement(NewProjectForm, { login: login, handleAuthResponse: handleAuthResponse })));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { RegisterForm };
|
|
39
|
-
//# sourceMappingURL=RegisterForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RegisterForm.mjs","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,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAClE,MAAM,CAAC,OAAO,EAAE,U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AC9B,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,100 +0,0 @@
|
|
|
1
|
-
import { showNotification } from '@mantine/notifications';
|
|
2
|
-
import { normalizeErrorString } from '@medplum/core';
|
|
3
|
-
import React, { useState, useCallback, useEffect } from 'react';
|
|
4
|
-
import { Document } from '../Document/Document.mjs';
|
|
5
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
6
|
-
import { AuthenticationForm } from './AuthenticationForm.mjs';
|
|
7
|
-
import { ChooseProfileForm } from './ChooseProfileForm.mjs';
|
|
8
|
-
import { ChooseScopeForm } from './ChooseScopeForm.mjs';
|
|
9
|
-
import { MfaForm } from './MfaForm.mjs';
|
|
10
|
-
import { NewProjectForm } from './NewProjectForm.mjs';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The SignInForm component allows users to sign in to Medplum.
|
|
14
|
-
*
|
|
15
|
-
* "Signing in" is a multi-step process:
|
|
16
|
-
* 1) Authentication - identify the user
|
|
17
|
-
* 2) MFA - If MFA is enabled, prompt for MFA code
|
|
18
|
-
* 3) Choose profile - If the user has multiple profiles, prompt to choose one
|
|
19
|
-
* 4) Choose scope - If the user has multiple scopes, prompt to choose one
|
|
20
|
-
* 5) Success - Return to the caller with either a code or a redirect
|
|
21
|
-
* @param props The SignInForm React props.
|
|
22
|
-
* @returns The SignInForm React node.
|
|
23
|
-
*/
|
|
24
|
-
function SignInForm(props) {
|
|
25
|
-
const { login: loginCode, chooseScopes, onSuccess, onForgotPassword, onRegister, onCode, ...baseLoginRequest } = props;
|
|
26
|
-
const medplum = useMedplum();
|
|
27
|
-
const [login, setLogin] = useState(undefined);
|
|
28
|
-
const [mfaRequired, setAuthenticatorRequired] = useState(false);
|
|
29
|
-
const [memberships, setMemberships] = useState(undefined);
|
|
30
|
-
const handleCode = useCallback((code) => {
|
|
31
|
-
if (onCode) {
|
|
32
|
-
onCode(code);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
medplum
|
|
36
|
-
.processCode(code)
|
|
37
|
-
.then(() => {
|
|
38
|
-
if (onSuccess) {
|
|
39
|
-
onSuccess();
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
.catch((err) => showNotification({ color: 'red', message: normalizeErrorString(err) }));
|
|
43
|
-
}
|
|
44
|
-
}, [medplum, onCode, onSuccess]);
|
|
45
|
-
const handleAuthResponse = useCallback((response) => {
|
|
46
|
-
setAuthenticatorRequired(!!response.mfaRequired);
|
|
47
|
-
if (response.login) {
|
|
48
|
-
setLogin(response.login);
|
|
49
|
-
}
|
|
50
|
-
if (response.memberships) {
|
|
51
|
-
setMemberships(response.memberships);
|
|
52
|
-
}
|
|
53
|
-
if (response.code) {
|
|
54
|
-
if (chooseScopes) {
|
|
55
|
-
setMemberships(undefined);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
handleCode(response.code);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}, [chooseScopes, handleCode]);
|
|
62
|
-
const handleScopeResponse = useCallback((response) => {
|
|
63
|
-
handleCode(response.code);
|
|
64
|
-
}, [handleCode]);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
// Beware the race condition here
|
|
67
|
-
// The `useMedplum` hook will return a new instance of the MedplumClient on login
|
|
68
|
-
// We do not want to request the login status again in that case
|
|
69
|
-
// Only request login status once
|
|
70
|
-
if (loginCode && !login) {
|
|
71
|
-
medplum
|
|
72
|
-
.get('auth/login/' + loginCode)
|
|
73
|
-
.then(handleAuthResponse)
|
|
74
|
-
.catch((err) => showNotification({ color: 'red', message: normalizeErrorString(err) }));
|
|
75
|
-
}
|
|
76
|
-
}, [medplum, loginCode, login, handleAuthResponse]);
|
|
77
|
-
return (React.createElement(Document, { width: 450 }, (() => {
|
|
78
|
-
if (!login) {
|
|
79
|
-
return (React.createElement(AuthenticationForm, { onForgotPassword: onForgotPassword, onRegister: onRegister, handleAuthResponse: handleAuthResponse, disableGoogleAuth: props.disableGoogleAuth, ...baseLoginRequest }, props.children));
|
|
80
|
-
}
|
|
81
|
-
else if (mfaRequired) {
|
|
82
|
-
return React.createElement(MfaForm, { login: login, handleAuthResponse: handleAuthResponse });
|
|
83
|
-
}
|
|
84
|
-
else if (memberships) {
|
|
85
|
-
return React.createElement(ChooseProfileForm, { login: login, memberships: memberships, handleAuthResponse: handleAuthResponse });
|
|
86
|
-
}
|
|
87
|
-
else if (props.projectId === 'new') {
|
|
88
|
-
return React.createElement(NewProjectForm, { login: login, handleAuthResponse: handleAuthResponse });
|
|
89
|
-
}
|
|
90
|
-
else if (props.chooseScopes) {
|
|
91
|
-
return React.createElement(ChooseScopeForm, { login: login, scope: props.scope, handleAuthResponse: handleScopeResponse });
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
return React.createElement("div", null, "Success");
|
|
95
|
-
}
|
|
96
|
-
})()));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export { SignInForm };
|
|
100
|
-
//# sourceMappingURL=SignInForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignInForm.mjs","sources":["../../../src/auth/SignInForm.tsx"],"sourcesContent":["import { showNotification } from '@mantine/notifications';\nimport { BaseLoginRequest, LoginAuthenticationResponse, normalizeErrorString } from '@medplum/core';\nimport { ProjectMembership } from '@medplum/fhirtypes';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { Document } from '../Document/Document';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { AuthenticationForm } from './AuthenticationForm';\nimport { ChooseProfileForm } from './ChooseProfileForm';\nimport { ChooseScopeForm } from './ChooseScopeForm';\nimport { MfaForm } from './MfaForm';\nimport { NewProjectForm } from './NewProjectForm';\n\nexport interface SignInFormProps extends BaseLoginRequest {\n readonly login?: string;\n readonly chooseScopes?: boolean;\n readonly disableGoogleAuth?: boolean;\n readonly onSuccess?: () => void;\n readonly onForgotPassword?: () => void;\n readonly onRegister?: () => void;\n readonly onCode?: (code: string) => void;\n readonly children?: React.ReactNode;\n}\n\n/**\n * The SignInForm component allows users to sign in to Medplum.\n *\n * \"Signing in\" is a multi-step process:\n * 1) Authentication - identify the user\n * 2) MFA - If MFA is enabled, prompt for MFA code\n * 3) Choose profile - If the user has multiple profiles, prompt to choose one\n * 4) Choose scope - If the user has multiple scopes, prompt to choose one\n * 5) Success - Return to the caller with either a code or a redirect\n * @param props The SignInForm React props.\n * @returns The SignInForm React node.\n */\nexport function SignInForm(props: SignInFormProps): JSX.Element {\n const {\n login: loginCode,\n chooseScopes,\n onSuccess,\n onForgotPassword,\n onRegister,\n onCode,\n ...baseLoginRequest\n } = props;\n const medplum = useMedplum();\n const [login, setLogin] = useState<string | undefined>(undefined);\n const [mfaRequired, setAuthenticatorRequired] = useState<boolean>(false);\n const [memberships, setMemberships] = useState<ProjectMembership[] | undefined>(undefined);\n\n const handleCode = useCallback(\n (code: string): void => {\n if (onCode) {\n onCode(code);\n } else {\n medplum\n .processCode(code)\n .then(() => {\n if (onSuccess) {\n onSuccess();\n }\n })\n .catch((err) => showNotification({ color: 'red', message: normalizeErrorString(err) }));\n }\n },\n [medplum, onCode, onSuccess]\n );\n\n const handleAuthResponse = useCallback(\n (response: LoginAuthenticationResponse): void => {\n setAuthenticatorRequired(!!response.mfaRequired);\n\n if (response.login) {\n setLogin(response.login);\n }\n\n if (response.memberships) {\n setMemberships(response.memberships);\n }\n\n if (response.code) {\n if (chooseScopes) {\n setMemberships(undefined);\n } else {\n handleCode(response.code as string);\n }\n }\n },\n [chooseScopes, handleCode]\n );\n\n const handleScopeResponse = useCallback(\n (response: LoginAuthenticationResponse): void => {\n handleCode(response.code as string);\n },\n [handleCode]\n );\n\n useEffect(() => {\n // Beware the race condition here\n // The `useMedplum` hook will return a new instance of the MedplumClient on login\n // We do not want to request the login status again in that case\n // Only request login status once\n if (loginCode && !login) {\n medplum\n .get('auth/login/' + loginCode)\n .then(handleAuthResponse)\n .catch((err) => showNotification({ color: 'red', message: normalizeErrorString(err) }));\n }\n }, [medplum, loginCode, login, handleAuthResponse]);\n\n return (\n <Document width={450}>\n {(() => {\n if (!login) {\n return (\n <AuthenticationForm\n onForgotPassword={onForgotPassword}\n onRegister={onRegister}\n handleAuthResponse={handleAuthResponse}\n disableGoogleAuth={props.disableGoogleAuth}\n {...baseLoginRequest}\n >\n {props.children}\n </AuthenticationForm>\n );\n } else if (mfaRequired) {\n return <MfaForm login={login} handleAuthResponse={handleAuthResponse} />;\n } else if (memberships) {\n return <ChooseProfileForm login={login} memberships={memberships} handleAuthResponse={handleAuthResponse} />;\n } else if (props.projectId === 'new') {\n return <NewProjectForm login={login} handleAuthResponse={handleAuthResponse} />;\n } else if (props.chooseScopes) {\n return <ChooseScopeForm login={login} scope={props.scope} handleAuthResponse={handleScopeResponse} />;\n } else {\n return <div>Success</div>;\n }\n })()}\n </Document>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAuBA;;;;;;;;;;;AAWG;AACG,SAAU,UAAU,CAAC,KAAsB,EAAA;IAC/C,MAAM,EACJ,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,GAAG,gBAAgB,EACpB,GAAG,KAAK,CAAC;AACV,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAClE,MAAM,CAAC,WAAW,EAAE,wBAAwB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACzE,MAAM,CAAC,WAAW,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EAAE,kBAAkB,GAAI,CAAC;AAC9G,SAAA;AAAM,aAAA,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,EAAE;YACpC,OAAO,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAA,CAAI,CAAC;AACjF,SAAA;aAAM,IAAI,KAAK,CAAC,YAAY,EAAE;AAC7B,YAAA,OAAO,oBAAC,eAAe,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,GAAI,CAAC;AACvG,SAAA;AAAM,aAAA;AACL,YAAA,OAAO,2CAAkB,CAAC;AAC3B,SAAA;AACH,KAAC,GAAG,CACK,EACX;AACJ;;;;"}
|
package/dist/esm/constants.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../src/constants.ts"],"sourcesContent":["export const DEFAULT_IGNORED_PROPERTIES = [\n 'meta',\n 'implicitRules',\n 'language',\n 'text',\n 'contained',\n 'extension',\n 'modifierExtension',\n];\n"],"names":[],"mappings":"AAAa,MAAA,0BAA0B,GAAG;IACxC,MAAM;IACN,eAAe;IACf,UAAU;IACV,MAAM;IACN,WAAW;IACX,WAAW;IACX,mBAAmB;;;;;"}
|