@openmrs/esm-framework 6.3.1-pre.3106 → 6.3.1-pre.3119
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/.turbo/turbo-build.log +1 -1
- package/dist/openmrs-esm-framework.js +2 -2
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +310 -8579
- package/docs/classes/OpenmrsFetchError.md +88 -117
- package/docs/enumerations/Type.md +77 -0
- package/docs/enumerations/VisitMode.md +29 -0
- package/docs/enumerations/VisitStatus.md +21 -0
- package/docs/functions/ConfigurableLink.md +19 -0
- package/docs/functions/CustomOverflowMenu.md +17 -0
- package/docs/functions/DashboardExtension.md +17 -0
- package/docs/functions/ExtensionSlot.md +46 -0
- package/docs/functions/OpenmrsAppContext.md +36 -0
- package/docs/functions/PatientBannerActionsMenu.md +17 -0
- package/docs/functions/PatientBannerContactDetails.md +17 -0
- package/docs/functions/PatientBannerPatientIdentifiers.md +17 -0
- package/docs/functions/PatientBannerPatientInfo.md +17 -0
- package/docs/functions/PatientBannerToggleContactDetailsButton.md +17 -0
- package/docs/functions/PatientPhoto.md +19 -0
- package/docs/functions/WorkspaceContainer.md +55 -0
- package/docs/functions/age.md +32 -0
- package/docs/functions/attach.md +40 -0
- package/docs/functions/beginEditSynchronizationItem.md +22 -0
- package/docs/functions/canAccessStorage.md +25 -0
- package/docs/functions/canBeginEditSynchronizationItemsOfType.md +22 -0
- package/docs/functions/clearCurrentUser.md +11 -0
- package/docs/functions/closeWorkspace.md +27 -0
- package/docs/functions/compile.md +30 -0
- package/docs/functions/convertToLocaleCalendar.md +25 -0
- package/docs/functions/createAttachment.md +21 -0
- package/docs/functions/createErrorHandler.md +21 -0
- package/docs/functions/createGlobalStore.md +36 -0
- package/docs/functions/createUseStore.md +66 -0
- package/docs/functions/defineConfigSchema.md +33 -0
- package/docs/functions/defineExtensionConfigSchema.md +38 -0
- package/docs/functions/deleteAttachmentPermanently.md +21 -0
- package/docs/functions/deleteSynchronizationItem.md +21 -0
- package/docs/functions/detach.md +25 -0
- package/docs/functions/detachAll.md +21 -0
- package/docs/functions/dispatchNotificationShown.md +17 -0
- package/docs/functions/dispatchPrecacheStaticDependencies.md +17 -0
- package/docs/functions/displayName.md +21 -0
- package/docs/functions/evaluate.md +84 -0
- package/docs/functions/evaluateAsBoolean.md +31 -0
- package/docs/functions/evaluateAsBooleanAsync.md +31 -0
- package/docs/functions/evaluateAsNumber.md +31 -0
- package/docs/functions/evaluateAsNumberAsync.md +31 -0
- package/docs/functions/evaluateAsType.md +46 -0
- package/docs/functions/evaluateAsTypeAsync.md +46 -0
- package/docs/functions/evaluateAsync.md +87 -0
- package/docs/functions/extractVariableNames.md +50 -0
- package/docs/functions/fetchCurrentPatient.md +25 -0
- package/docs/functions/filterBreadcrumbs.md +21 -0
- package/docs/functions/formatDate.md +39 -0
- package/docs/functions/formatDatetime.md +29 -0
- package/docs/functions/formatPartialDate.md +39 -0
- package/docs/functions/formatPatientName.md +23 -0
- package/docs/functions/formatTime.md +20 -0
- package/docs/functions/formattedName.md +21 -0
- package/docs/functions/generateOfflineUuid.md +13 -0
- package/docs/functions/getAssignedExtensions.md +23 -0
- package/docs/functions/getAsyncLifecycle.md +31 -0
- package/docs/functions/getAttachmentByUuid.md +21 -0
- package/docs/functions/getAttachments.md +25 -0
- package/docs/functions/getBreadcrumbs.md +11 -0
- package/docs/functions/getBreadcrumbsFor.md +17 -0
- package/docs/functions/getConfig.md +31 -0
- package/docs/functions/getContext.md +29 -0
- package/docs/functions/getCoreTranslation.md +35 -0
- package/docs/functions/getCurrentOfflineMode.md +11 -0
- package/docs/functions/getCurrentUser.md +154 -0
- package/docs/functions/getDefaultCalendar.md +21 -0
- package/docs/functions/getDefaultsFromConfigSchema.md +32 -0
- package/docs/functions/getDynamicOfflineDataEntries.md +28 -0
- package/docs/functions/getDynamicOfflineDataEntriesFor.md +34 -0
- package/docs/functions/getDynamicOfflineDataHandlers.md +13 -0
- package/docs/functions/getExtensionNameFromId.md +30 -0
- package/docs/functions/getExtensionStore.md +14 -0
- package/docs/functions/getFeatureFlag.md +21 -0
- package/docs/functions/getFhirServerPaginationHandlers.md +17 -0
- package/docs/functions/getFullSynchronizationItems.md +27 -0
- package/docs/functions/getFullSynchronizationItemsFor.md +33 -0
- package/docs/functions/getGlobalStore.md +36 -0
- package/docs/functions/getHistory.md +13 -0
- package/docs/functions/getLifecycle.md +27 -0
- package/docs/functions/getLocale.md +15 -0
- package/docs/functions/getLocations.md +21 -0
- package/docs/functions/getLoggedInUser.md +11 -0
- package/docs/functions/getOfflinePatientDataStore.md +15 -0
- package/docs/functions/getPatientName.md +26 -0
- package/docs/functions/getSessionLocation.md +11 -0
- package/docs/functions/getSessionStore.md +11 -0
- package/docs/functions/getSyncLifecycle.md +31 -0
- package/docs/functions/getSynchronizationItem.md +27 -0
- package/docs/functions/getSynchronizationItems.md +27 -0
- package/docs/functions/getVisitStore.md +11 -0
- package/docs/functions/getVisitTypes.md +11 -0
- package/docs/functions/getVisitsForPatient.md +29 -0
- package/docs/functions/goBackInHistory.md +25 -0
- package/docs/functions/importDynamic.md +58 -0
- package/docs/functions/inRange.md +27 -0
- package/docs/functions/interpolateString.md +34 -0
- package/docs/functions/interpolateUrl.md +48 -0
- package/docs/functions/isDesktop.md +17 -0
- package/docs/functions/isDevEnabled.md +11 -0
- package/docs/functions/isOfflineUuid.md +19 -0
- package/docs/functions/isOmrsDateStrict.md +20 -0
- package/docs/functions/isOmrsDateToday.md +19 -0
- package/docs/functions/isOnline.md +17 -0
- package/docs/functions/isUrlWithTemplateParameters.md +22 -0
- package/docs/functions/isVersionSatisfied.md +21 -0
- package/docs/functions/launchWorkspace.md +56 -0
- package/docs/functions/launchWorkspaceGroup.md +38 -0
- package/docs/functions/makeUrl.md +26 -0
- package/docs/functions/messageOmrsServiceWorker.md +23 -0
- package/docs/functions/navigate.md +48 -0
- package/docs/functions/navigateAndLaunchWorkspace.md +33 -0
- package/docs/functions/oneOf.md +21 -0
- package/docs/functions/openmrsFetch.md +75 -0
- package/docs/functions/openmrsObservableFetch.md +55 -0
- package/docs/functions/parseDate.md +20 -0
- package/docs/functions/provide.md +21 -0
- package/docs/functions/putDynamicOfflineData.md +28 -0
- package/docs/functions/putDynamicOfflineDataFor.md +34 -0
- package/docs/functions/queueSynchronizationItem.md +39 -0
- package/docs/functions/refetchCurrentUser.md +33 -0
- package/docs/functions/registerBreadcrumb.md +17 -0
- package/docs/functions/registerBreadcrumbs.md +17 -0
- package/docs/functions/registerContext.md +34 -0
- package/docs/functions/registerDefaultCalendar.md +33 -0
- package/docs/functions/registerFeatureFlag.md +36 -0
- package/docs/functions/registerOfflinePatientHandler.md +25 -0
- package/docs/functions/removeDynamicOfflineData.md +28 -0
- package/docs/functions/removeDynamicOfflineDataFor.md +34 -0
- package/docs/functions/renderExtension.md +41 -0
- package/docs/functions/reportError.md +17 -0
- package/docs/functions/retry.md +44 -0
- package/docs/functions/saveVisit.md +21 -0
- package/docs/functions/selectPreferredName.md +46 -0
- package/docs/functions/setCurrentVisit.md +21 -0
- package/docs/functions/setLeftNav.md +23 -0
- package/docs/functions/setSessionLocation.md +21 -0
- package/docs/functions/setUserLanguage.md +17 -0
- package/docs/functions/setUserProperties.md +23 -0
- package/docs/functions/setupDynamicOfflineDataHandler.md +22 -0
- package/docs/functions/setupOfflineSync.md +49 -0
- package/docs/functions/shallowEqual.md +32 -0
- package/docs/functions/showActionableNotification.md +21 -0
- package/docs/functions/showModal.md +44 -0
- package/docs/functions/showNotification.md +21 -0
- package/docs/functions/showSnackbar.md +21 -0
- package/docs/functions/showToast.md +21 -0
- package/docs/functions/subscribeActionableNotificationShown.md +21 -0
- package/docs/functions/subscribeConnectivity.md +21 -0
- package/docs/functions/subscribeConnectivityChanged.md +21 -0
- package/docs/functions/subscribeNotificationShown.md +21 -0
- package/docs/functions/subscribePrecacheStaticDependencies.md +21 -0
- package/docs/functions/subscribeSnackbarShown.md +21 -0
- package/docs/functions/subscribeTo.md +75 -0
- package/docs/functions/subscribeToContext.md +39 -0
- package/docs/functions/subscribeToastShown.md +21 -0
- package/docs/functions/syncAllDynamicOfflineData.md +27 -0
- package/docs/functions/syncDynamicOfflineData.md +33 -0
- package/docs/functions/syncOfflinePatientData.md +21 -0
- package/docs/functions/toDateObjectStrict.md +20 -0
- package/docs/functions/toLocationObject.md +17 -0
- package/docs/functions/toOmrsIsoString.md +23 -0
- package/docs/functions/toVisitTypeObject.md +17 -0
- package/docs/functions/translateFrom.md +55 -0
- package/docs/functions/unregisterContext.md +20 -0
- package/docs/functions/unsetLeftNav.md +23 -0
- package/docs/functions/updateContext.md +29 -0
- package/docs/functions/updateVisit.md +25 -0
- package/docs/functions/useAbortController.md +32 -0
- package/docs/functions/useAppContext.md +43 -0
- package/docs/functions/useAssignedExtensionIds.md +26 -0
- package/docs/functions/useAssignedExtensions.md +21 -0
- package/docs/functions/useAttachments.md +41 -0
- package/docs/functions/useBodyScrollLock.md +17 -0
- package/docs/functions/useConfig.md +27 -0
- package/docs/functions/useConnectivity.md +11 -0
- package/docs/functions/useDebounce.md +57 -0
- package/docs/functions/useDefineAppContext.md +70 -0
- package/docs/functions/useEmrConfiguration.md +35 -0
- package/docs/functions/useExtensionSlotMeta.md +25 -0
- package/docs/functions/useExtensionSlotStore.md +17 -0
- package/docs/functions/useFeatureFlag.md +30 -0
- package/docs/functions/useFhirFetchAll.md +44 -0
- package/docs/functions/useFhirInfinite.md +46 -0
- package/docs/functions/useFhirPagination.md +129 -0
- package/docs/functions/useLayoutType.md +11 -0
- package/docs/functions/useLeftNav.md +17 -0
- package/docs/functions/useLeftNavStore.md +11 -0
- package/docs/functions/useLocations.md +21 -0
- package/docs/functions/useOnClickOutside.md +27 -0
- package/docs/functions/useOnVisible.md +28 -0
- package/docs/functions/useOpenmrsFetchAll.md +46 -0
- package/docs/functions/useOpenmrsInfinite.md +54 -0
- package/docs/functions/useOpenmrsPagination.md +140 -0
- package/docs/functions/useOpenmrsSWR.md +71 -0
- package/docs/functions/usePagination.md +89 -0
- package/docs/functions/usePatient.md +38 -0
- package/docs/functions/usePatientPhoto.md +17 -0
- package/docs/functions/usePrimaryIdentifierCode.md +23 -0
- package/docs/functions/useRenderableExtensions.md +43 -0
- package/docs/functions/useSession.md +19 -0
- package/docs/functions/useStore.md +131 -0
- package/docs/functions/useStoreWithActions.md +33 -0
- package/docs/functions/useVisit.md +41 -0
- package/docs/functions/useVisitContextStore.md +23 -0
- package/docs/functions/useVisitTypes.md +11 -0
- package/docs/functions/useWorkspaces.md +11 -0
- package/docs/functions/userHasAccess.md +27 -0
- package/docs/functions/validator.md +44 -0
- package/docs/interfaces/ActionMenuButtonProps.md +33 -57
- package/docs/interfaces/ActionableNotificationDescriptor.md +32 -62
- package/docs/interfaces/AssignedExtension.md +30 -57
- package/docs/interfaces/Attachment.md +23 -47
- package/docs/interfaces/AttachmentResponse.md +20 -41
- package/docs/interfaces/AuditInfo.md +49 -88
- package/docs/interfaces/BreadcrumbRegistration.md +8 -17
- package/docs/interfaces/BreadcrumbSettings.md +18 -33
- package/docs/interfaces/CancelLoading.md +6 -10
- package/docs/interfaces/ClearDynamicRoutesMessage.md +9 -17
- package/docs/interfaces/CloseWorkspaceOptions.md +18 -29
- package/docs/interfaces/ComponentConfig.md +11 -23
- package/docs/interfaces/Concept.md +83 -131
- package/docs/interfaces/ConceptClass.md +46 -67
- package/docs/interfaces/ConceptDatatype.md +50 -74
- package/docs/interfaces/ConceptName.md +50 -74
- package/docs/interfaces/Config.md +4 -2
- package/docs/interfaces/ConfigObject.md +12 -21
- package/docs/interfaces/ConfigSchema.md +15 -27
- package/docs/interfaces/ConfigurableLinkProps.md +24 -4314
- package/docs/interfaces/ConnectedExtension.md +25 -41
- package/docs/interfaces/ConnectivityChangedEvent.md +4 -10
- package/docs/interfaces/CurrentPatientOptions.md +9 -18
- package/docs/interfaces/DashboardExtensionProps.md +13 -28
- package/docs/interfaces/DefaultWorkspaceProps.md +44 -51
- package/docs/interfaces/Diagnosis.md +80 -104
- package/docs/interfaces/DisplayConditionsConfigObject.md +18 -33
- package/docs/interfaces/DynamicOfflineData.md +23 -41
- package/docs/interfaces/DynamicOfflineDataHandler.md +47 -54
- package/docs/interfaces/DynamicOfflineDataSyncState.md +29 -39
- package/docs/interfaces/EmrApiConfigurationResponse.md +243 -350
- package/docs/interfaces/Encounter.md +67 -110
- package/docs/interfaces/EncounterProvider.md +39 -61
- package/docs/interfaces/EncounterRole.md +43 -68
- package/docs/interfaces/EncounterType.md +43 -68
- package/docs/interfaces/ErrorStateProps.md +7 -16
- package/docs/interfaces/ExtensionData.md +10 -22
- package/docs/interfaces/ExtensionMeta.md +4 -2
- package/docs/interfaces/ExtensionRegistration.md +36 -69
- package/docs/interfaces/ExtensionSlotBaseProps.md +35 -35
- package/docs/interfaces/ExtensionSlotConfig.md +17 -32
- package/docs/interfaces/ExtensionSlotConfigObject.md +14 -26
- package/docs/interfaces/ExtensionSlotConfigureValueObject.md +4 -2
- package/docs/interfaces/ExtensionSlotProps.md +3520 -0
- package/docs/interfaces/ExtensionSlotState.md +9 -18
- package/docs/interfaces/ExtensionStore.md +5 -11
- package/docs/interfaces/FHIRCode.md +11 -23
- package/docs/interfaces/FHIRLocationResource.md +25 -18
- package/docs/interfaces/FHIRResource.md +105 -41
- package/docs/interfaces/FeatureFlagDefinition.md +14 -26
- package/docs/interfaces/FetchConfig.md +80 -117
- package/docs/interfaces/FetchError.md +8 -21
- package/docs/interfaces/FetchHeaders.md +4 -2
- package/docs/interfaces/FetchResponse.md +124 -130
- package/docs/interfaces/FetchResponseJson.md +4 -2
- package/docs/interfaces/ImportMap.md +4 -10
- package/docs/interfaces/LeftNavStore.md +14 -29
- package/docs/interfaces/Link.md +11 -23
- package/docs/interfaces/Location.md +147 -250
- package/docs/interfaces/LoggedInUser.md +68 -70
- package/docs/interfaces/LoggedInUserFetchResponse.md +120 -128
- package/docs/interfaces/MessageServiceWorkerResult.md +17 -29
- package/docs/interfaces/NavigateOptions.md +9 -18
- package/docs/interfaces/NewVisitPayload.md +32 -48
- package/docs/interfaces/NotificationDescriptor.md +31 -58
- package/docs/interfaces/Obs.md +99 -166
- package/docs/interfaces/OfflineModeResult.md +11 -23
- package/docs/interfaces/OfflinePatientArgs.md +13 -20
- package/docs/interfaces/OfflinePatientDataSyncHandler.md +17 -27
- package/docs/interfaces/OfflinePatientDataSyncState.md +29 -51
- package/docs/interfaces/OfflinePatientDataSyncStore.md +13 -20
- package/docs/interfaces/OmrsServiceWorkerMessage.md +13 -23
- package/docs/interfaces/OnImportMapChangedMessage.md +12 -23
- package/docs/interfaces/OnlyThePatient.md +9 -17
- package/docs/interfaces/OpenWorkspace.md +116 -170
- package/docs/interfaces/OpenmrsAppContextProps.md +14 -23
- package/docs/interfaces/OpenmrsAppRoutes.md +41 -71
- package/docs/interfaces/OpenmrsDatePickerProps.md +346 -483
- package/docs/interfaces/OpenmrsResource.md +39 -57
- package/docs/interfaces/OpenmrsResourceStrict.md +27 -51
- package/docs/interfaces/PageHeaderContentProps.md +12 -24
- package/docs/interfaces/PageHeaderWrapperProps.md +9 -18
- package/docs/interfaces/Patient.md +41 -70
- package/docs/interfaces/PatientBannerActionsMenuProps.md +15 -30
- package/docs/interfaces/PatientBannerToggleContactDetailsButtonProps.md +17 -32
- package/docs/interfaces/PatientIdentifier.md +49 -84
- package/docs/interfaces/PatientIdentifierType.md +65 -112
- package/docs/interfaces/PatientPhotoProps.md +8 -17
- package/docs/interfaces/PatientWithFullResponse.md +9 -17
- package/docs/interfaces/Person.md +96 -160
- package/docs/interfaces/PersonAddress.md +136 -230
- package/docs/interfaces/PersonAttribute.md +43 -68
- package/docs/interfaces/PersonName.md +72 -118
- package/docs/interfaces/PrecacheStaticDependenciesEvent.md +3 -1
- package/docs/interfaces/PrimaryIdentifier.md +5 -11
- package/docs/interfaces/Privilege.md +11 -23
- package/docs/interfaces/Prompt.md +20 -41
- package/docs/interfaces/QueueItemDescriptor.md +23 -30
- package/docs/interfaces/RegisterDynamicRouteMessage.md +21 -38
- package/docs/interfaces/ResourceLoader.md +10 -14
- package/docs/interfaces/ResponsiveWrapperProps.md +5 -11
- package/docs/interfaces/RetryOptions.md +36 -37
- package/docs/interfaces/Role.md +10 -22
- package/docs/interfaces/Session.md +31 -54
- package/docs/interfaces/SessionLocation.md +10 -22
- package/docs/interfaces/SetLeftNavParams.md +15 -30
- package/docs/interfaces/ShowActionableNotificationEvent.md +26 -50
- package/docs/interfaces/ShowNotificationEvent.md +20 -38
- package/docs/interfaces/ShowSnackbarEvent.md +34 -64
- package/docs/interfaces/ShowToastEvent.md +22 -43
- package/docs/interfaces/SnackbarDescriptor.md +41 -76
- package/docs/interfaces/SnackbarMeta.md +55 -93
- package/docs/interfaces/SpaConfig.md +30 -40
- package/docs/interfaces/StyleguideConfigObject.md +39 -70
- package/docs/interfaces/SyncItem.md +34 -57
- package/docs/interfaces/SyncProcessOptions.md +22 -40
- package/docs/interfaces/ToastDescriptor.md +29 -55
- package/docs/interfaces/ToastNotificationMeta.md +40 -69
- package/docs/interfaces/UploadedFile.md +25 -49
- package/docs/interfaces/UseConfigOptions.md +6 -12
- package/docs/interfaces/UsePatientPhotoResult.md +12 -24
- package/docs/interfaces/UseServerFetchAllOptions.md +41 -61
- package/docs/interfaces/UseServerInfiniteOptions.md +29 -46
- package/docs/interfaces/UseServerPaginationOptions.md +26 -41
- package/docs/interfaces/User.md +34 -46
- package/docs/interfaces/UserHasAccessProps.md +13 -25
- package/docs/interfaces/Visit.md +36 -66
- package/docs/interfaces/VisitItem.md +16 -31
- package/docs/interfaces/VisitReturnType.md +24 -51
- package/docs/interfaces/VisitStoreState.md +14 -26
- package/docs/interfaces/VisitType.md +11 -23
- package/docs/interfaces/WorkspaceContainerProps.md +20 -38
- package/docs/interfaces/WorkspaceGroupDefinition.md +10 -19
- package/docs/interfaces/WorkspaceRegistration.md +43 -82
- package/docs/interfaces/WorkspacesInfo.md +30 -40
- package/docs/type-aliases/ActionFunction.md +27 -0
- package/docs/type-aliases/ActionableNotificationType.md +7 -0
- package/docs/type-aliases/Actions.md +13 -0
- package/docs/type-aliases/ArgumentsTuple.md +7 -0
- package/docs/type-aliases/BoundActions.md +17 -0
- package/docs/type-aliases/ConfigValue.md +7 -0
- package/docs/type-aliases/ContextCallback.md +23 -0
- package/docs/type-aliases/CoreTranslationKey.md +7 -0
- package/docs/type-aliases/CurrentPatient.md +7 -0
- package/docs/type-aliases/DateInput.md +7 -0
- package/docs/type-aliases/DefaultEvaluateReturnType.md +9 -0
- package/docs/type-aliases/ExtensionDefinition.md +69 -0
- package/docs/type-aliases/ExtensionProps.md +13 -0
- package/docs/type-aliases/FormatDateMode.md +7 -0
- package/docs/type-aliases/FormatDateOptions.md +102 -0
- package/docs/type-aliases/IconProps.md +31 -0
- package/docs/type-aliases/InlineNotificationType.md +7 -0
- package/docs/type-aliases/Key.md +7 -0
- package/docs/type-aliases/KnownOmrsServiceWorkerMessages.md +7 -0
- package/docs/type-aliases/LayoutType.md +7 -0
- package/docs/type-aliases/LoadedSessionStore.md +23 -0
- package/docs/type-aliases/ModalDefinition.md +17 -0
- package/docs/type-aliases/NameUse.md +7 -0
- package/docs/type-aliases/NullablePatient.md +7 -0
- package/docs/type-aliases/OfflineMode.md +7 -0
- package/docs/type-aliases/OmrsOfflineCachingStrategy.md +12 -0
- package/docs/type-aliases/OmrsOfflineHttpHeaderNames.md +7 -0
- package/docs/type-aliases/OmrsOfflineHttpHeaders.md +44 -0
- package/docs/type-aliases/OpenmrsRoutes.md +10 -0
- package/docs/type-aliases/PageDefinition.md +41 -0
- package/docs/type-aliases/PageHeaderProps.md +7 -0
- package/docs/type-aliases/PatientUuid.md +7 -0
- package/docs/type-aliases/PictogramProps.md +23 -0
- package/docs/type-aliases/ProvidedConfig.md +23 -0
- package/docs/type-aliases/ResourceName.md +7 -0
- package/docs/type-aliases/SessionStore.md +7 -0
- package/docs/type-aliases/SnackbarType.md +7 -0
- package/docs/type-aliases/SpaEnvironment.md +7 -0
- package/docs/type-aliases/SvgIconProps.md +23 -0
- package/docs/type-aliases/SvgPictogramProps.md +27 -0
- package/docs/type-aliases/TemplateParams.md +11 -0
- package/docs/type-aliases/ToastType.md +7 -0
- package/docs/type-aliases/UnloadedSessionStore.md +23 -0
- package/docs/type-aliases/UpdateVisitPayload.md +7 -0
- package/docs/type-aliases/UseOpenmrsSWROptions.md +39 -0
- package/docs/type-aliases/Validator.md +17 -0
- package/docs/type-aliases/ValidatorFunction.md +17 -0
- package/docs/type-aliases/VariablesMap.md +13 -0
- package/docs/type-aliases/WorkspaceDefinition.md +78 -0
- package/docs/type-aliases/WorkspaceWindowState.md +7 -0
- package/docs/variables/ActionMenuButton.md +7 -0
- package/docs/variables/ActivityIcon.md +7 -0
- package/docs/variables/AddIcon.md +7 -0
- package/docs/variables/AllergiesIcon.md +7 -0
- package/docs/variables/AppointmentsPictogram.md +7 -0
- package/docs/variables/ArrowDownIcon.md +7 -0
- package/docs/variables/ArrowLeftIcon.md +7 -0
- package/docs/variables/ArrowRightIcon.md +7 -0
- package/docs/variables/ArrowUpIcon.md +7 -0
- package/docs/variables/AttachmentIcon.md +7 -0
- package/docs/variables/BabyIcon.md +7 -0
- package/docs/variables/CalendarHeatMapIcon.md +7 -0
- package/docs/variables/CalendarIcon.md +7 -0
- package/docs/variables/CaretDownIcon.md +7 -0
- package/docs/variables/CaretLeftIcon.md +7 -0
- package/docs/variables/CaretRightIcon.md +7 -0
- package/docs/variables/CaretUpIcon.md +7 -0
- package/docs/variables/ChartAverageIcon.md +7 -0
- package/docs/variables/CheckmarkFilledIcon.md +7 -0
- package/docs/variables/CheckmarkOutlineIcon.md +7 -0
- package/docs/variables/ChemistryIcon.md +7 -0
- package/docs/variables/ChevronDownIcon.md +7 -0
- package/docs/variables/ChevronLeftIcon.md +7 -0
- package/docs/variables/ChevronRightIcon.md +7 -0
- package/docs/variables/ChevronUpIcon.md +7 -0
- package/docs/variables/CloseFilledIcon.md +7 -0
- package/docs/variables/CloseIcon.md +7 -0
- package/docs/variables/CloseOutlineIcon.md +7 -0
- package/docs/variables/ConditionsIcon.md +11 -0
- package/docs/variables/DiagnosisTags.md +11 -0
- package/docs/variables/DocumentAttachmentIcon.md +7 -0
- package/docs/variables/DocumentIcon.md +7 -0
- package/docs/variables/DownloadIcon.md +7 -0
- package/docs/variables/DrugOrderIcon.md +7 -0
- package/docs/variables/EditIcon.md +7 -0
- package/docs/variables/ErrorState.md +7 -0
- package/docs/variables/EventScheduleIcon.md +7 -0
- package/docs/variables/EventsIcon.md +7 -0
- package/docs/variables/Extension.md +15 -0
- package/docs/variables/GenderFemaleIcon.md +7 -0
- package/docs/variables/GenderMaleIcon.md +7 -0
- package/docs/variables/GenderOtherIcon.md +7 -0
- package/docs/variables/GenderUnknownIcon.md +7 -0
- package/docs/variables/GenericOrderTypeIcon.md +7 -0
- package/docs/variables/GroupAccessIcon.md +7 -0
- package/docs/variables/GroupIcon.md +7 -0
- package/docs/variables/HomePictogram.md +7 -0
- package/docs/variables/HospitalBedIcon.md +7 -0
- package/docs/variables/Icon.md +9 -0
- package/docs/variables/ImageMedicalIcon.md +7 -0
- package/docs/variables/InPatientPictogram.md +7 -0
- package/docs/variables/InformationFilledIcon.md +7 -0
- package/docs/variables/InformationIcon.md +7 -0
- package/docs/variables/InformationSquareIcon.md +7 -0
- package/docs/variables/InventoryManagementIcon.md +7 -0
- package/docs/variables/LabOrderIcon.md +7 -0
- package/docs/variables/LaboratoryPictogram.md +7 -0
- package/docs/variables/LeftNavMenu.md +13 -0
- package/docs/variables/ListCheckedIcon.md +7 -0
- package/docs/variables/LocationIcon.md +7 -0
- package/docs/variables/LocationPicker.md +7 -0
- package/docs/variables/MaterialOrderIcon.md +7 -0
- package/docs/variables/MaximizeIcon.md +7 -0
- package/docs/variables/MaybeIcon.md +16 -0
- package/docs/variables/MaybePictogram.md +16 -0
- package/docs/variables/MedicationIcon.md +7 -0
- package/docs/variables/MessageQueueIcon.md +7 -0
- package/docs/variables/MicroscopeIcon.md +7 -0
- package/docs/variables/MoneyIcon.md +9 -0
- package/docs/variables/MotherIcon.md +7 -0
- package/docs/variables/MovementIcon.md +7 -0
- package/docs/variables/OpenmrsDatePicker.md +9 -0
- package/docs/variables/OverflowMenuHorizontalIcon.md +7 -0
- package/docs/variables/OverflowMenuVerticalIcon.md +7 -0
- package/docs/variables/PageHeader.md +30 -0
- package/docs/variables/PageHeaderContent.md +21 -0
- package/docs/variables/PasswordIcon.md +7 -0
- package/docs/variables/PatientListsPictogram.md +7 -0
- package/docs/variables/PedestrianFamilyIcon.md +7 -0
- package/docs/variables/PenIcon.md +7 -0
- package/docs/variables/PharmacyPictogram.md +7 -0
- package/docs/variables/Pictogram.md +9 -0
- package/docs/variables/PrinterIcon.md +7 -0
- package/docs/variables/ProcedureOrderIcon.md +7 -0
- package/docs/variables/ProgramsIcon.md +7 -0
- package/docs/variables/RadiologyIcon.md +7 -0
- package/docs/variables/ReferralOrderIcon.md +7 -0
- package/docs/variables/RegistrationPictogram.md +7 -0
- package/docs/variables/RenderIfValueIsTruthy.md +21 -0
- package/docs/variables/RenewIcon.md +7 -0
- package/docs/variables/ReportIcon.md +7 -0
- package/docs/variables/ResetIcon.md +7 -0
- package/docs/variables/ResponsiveWrapper.md +11 -0
- package/docs/variables/SaveIcon.md +7 -0
- package/docs/variables/SearchIcon.md +7 -0
- package/docs/variables/ServiceQueuesPictogram.md +7 -0
- package/docs/variables/ShoppingCartAddItemIcon.md +11 -0
- package/docs/variables/ShoppingCartArrowDownIcon.md +9 -0
- package/docs/variables/ShoppingCartIcon.md +9 -0
- package/docs/variables/StickyNoteAddIcon.md +9 -0
- package/docs/variables/StockManagementPictogram.md +7 -0
- package/docs/variables/SwitcherIcon.md +7 -0
- package/docs/variables/SyringeIcon.md +7 -0
- package/docs/variables/TableIcon.md +7 -0
- package/docs/variables/TableOfContentsIcon.md +9 -0
- package/docs/variables/TimeIcon.md +9 -0
- package/docs/variables/ToolsIcon.md +7 -0
- package/docs/variables/TranslateIcon.md +7 -0
- package/docs/variables/TrashCanIcon.md +7 -0
- package/docs/variables/TreeViewAltIcon.md +7 -0
- package/docs/variables/UserAvatarIcon.md +9 -0
- package/docs/variables/UserFollowIcon.md +7 -0
- package/docs/variables/UserHasAccess.md +35 -0
- package/docs/variables/UserIcon.md +7 -0
- package/docs/variables/UserXrayIcon.md +11 -0
- package/docs/variables/ViewIcon.md +7 -0
- package/docs/variables/ViewOffIcon.md +7 -0
- package/docs/variables/WarningIcon.md +7 -0
- package/docs/variables/attachmentUrl.md +7 -0
- package/docs/variables/backendDependencies.md +17 -0
- package/docs/variables/defaultVisitCustomRepresentation.md +7 -0
- package/docs/variables/fhirBaseUrl.md +7 -0
- package/docs/variables/getAsyncExtensionLifecycle.md +35 -0
- package/docs/variables/getStartedVisit.md +9 -0
- package/docs/variables/isUrl.md +9 -0
- package/docs/variables/offlineUuidPrefix.md +7 -0
- package/docs/variables/omrsOfflineCachingStrategyHttpHeaderName.md +7 -0
- package/docs/variables/omrsOfflineResponseBodyHttpHeaderName.md +7 -0
- package/docs/variables/omrsOfflineResponseStatusHttpHeaderName.md +7 -0
- package/docs/variables/restBaseUrl.md +7 -0
- package/docs/variables/sessionEndpoint.md +7 -0
- package/docs/variables/useConnectedExtensions.md +25 -0
- package/docs/variables/useExtensionStore.md +55 -0
- package/docs/variables/validators.md +78 -0
- package/package.json +24 -20
- package/rspack.config.cjs +1 -8
- package/tsconfig.build.json +2 -1
- package/typedoc.json +16 -3
- package/docs/.nojekyll +0 -1
- package/docs/enums/Type.md +0 -107
- package/docs/enums/VisitMode.md +0 -41
- package/docs/enums/VisitStatus.md +0 -30
- package/docs/interfaces/OldExtensionSlotBaseProps.md +0 -67
@@ -0,0 +1,11 @@
|
|
1
|
+
[O3 Framework](../API.md) / useLayoutType
|
2
|
+
|
3
|
+
# Function: useLayoutType()
|
4
|
+
|
5
|
+
> **useLayoutType**(): [`LayoutType`](../type-aliases/LayoutType.md)
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useLayoutType.ts:26](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useLayoutType.ts#L26)
|
8
|
+
|
9
|
+
## Returns
|
10
|
+
|
11
|
+
[`LayoutType`](../type-aliases/LayoutType.md)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
[O3 Framework](../API.md) / useLeftNav
|
2
|
+
|
3
|
+
# Function: useLeftNav()
|
4
|
+
|
5
|
+
> **useLeftNav**(`params`): `void`
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useLeftNav.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useLeftNav.ts#L5)
|
8
|
+
|
9
|
+
## Parameters
|
10
|
+
|
11
|
+
### params
|
12
|
+
|
13
|
+
`Omit`\<`SetLeftNavParams`, `"module"`\>
|
14
|
+
|
15
|
+
## Returns
|
16
|
+
|
17
|
+
`void`
|
@@ -0,0 +1,11 @@
|
|
1
|
+
[O3 Framework](../API.md) / useLeftNavStore
|
2
|
+
|
3
|
+
# Function: useLeftNavStore()
|
4
|
+
|
5
|
+
> **useLeftNavStore**(): `LeftNavStore`
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useLeftNavStore.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useLeftNavStore.ts#L4)
|
8
|
+
|
9
|
+
## Returns
|
10
|
+
|
11
|
+
`LeftNavStore`
|
@@ -0,0 +1,21 @@
|
|
1
|
+
[O3 Framework](../API.md) / useLocations
|
2
|
+
|
3
|
+
# Function: useLocations()
|
4
|
+
|
5
|
+
> **useLocations**(`tagUuidOrName`, `query`): `Location`[]
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useLocations.tsx:5](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useLocations.tsx#L5)
|
8
|
+
|
9
|
+
## Parameters
|
10
|
+
|
11
|
+
### tagUuidOrName
|
12
|
+
|
13
|
+
`null` | `string`
|
14
|
+
|
15
|
+
### query
|
16
|
+
|
17
|
+
`null` | `string`
|
18
|
+
|
19
|
+
## Returns
|
20
|
+
|
21
|
+
`Location`[]
|
@@ -0,0 +1,27 @@
|
|
1
|
+
[O3 Framework](../API.md) / useOnClickOutside
|
2
|
+
|
3
|
+
# Function: useOnClickOutside()
|
4
|
+
|
5
|
+
> **useOnClickOutside**\<`T`\>(`handler`, `active`): `RefObject`\<`T`\>
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useOnClickOutside.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOnClickOutside.ts#L4)
|
8
|
+
|
9
|
+
## Type Parameters
|
10
|
+
|
11
|
+
### T
|
12
|
+
|
13
|
+
`T` *extends* `HTMLElement` = `HTMLElement`
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
### handler
|
18
|
+
|
19
|
+
(`event`) => `void`
|
20
|
+
|
21
|
+
### active
|
22
|
+
|
23
|
+
`boolean` = `true`
|
24
|
+
|
25
|
+
## Returns
|
26
|
+
|
27
|
+
`RefObject`\<`T`\>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
[O3 Framework](../API.md) / useOnVisible
|
2
|
+
|
3
|
+
# Function: useOnVisible()
|
4
|
+
|
5
|
+
> **useOnVisible**(`callBack`): `MutableRefObject`\<`HTMLElement`\>
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useOnVisible.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOnVisible.ts#L15)
|
8
|
+
|
9
|
+
Returns a ref that can be used on a HTML component to trigger
|
10
|
+
an action when the component is scrolled into visible view,
|
11
|
+
This is particularly useful for infinite scrolling UIs to load data on demand.
|
12
|
+
|
13
|
+
## Parameters
|
14
|
+
|
15
|
+
### callBack
|
16
|
+
|
17
|
+
() => `void`
|
18
|
+
|
19
|
+
The callback to run when the component is scrolled into visible view.
|
20
|
+
Care should be taken with this param. The callback should
|
21
|
+
be cached across re-renders (via useCallback) and it should have
|
22
|
+
logic to avoid doing work multiple times while scrolling.
|
23
|
+
|
24
|
+
## Returns
|
25
|
+
|
26
|
+
`MutableRefObject`\<`HTMLElement`\>
|
27
|
+
|
28
|
+
a ref that can be passed to an HTML Element
|
@@ -0,0 +1,46 @@
|
|
1
|
+
[O3 Framework](../API.md) / useOpenmrsFetchAll
|
2
|
+
|
3
|
+
# Function: useOpenmrsFetchAll()
|
4
|
+
|
5
|
+
> **useOpenmrsFetchAll**\<`T`\>(`url`, `options`): `UseServerInfiniteReturnObject`\<`T`, `OpenMRSPaginatedResponse`\<`T`\>\>
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useOpenmrsFetchAll.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsFetchAll.ts#L40)
|
8
|
+
|
9
|
+
Most OpenMRS REST endpoints that return a list of objects, such as getAll or search, are server-side paginated.
|
10
|
+
This hook handles fetching results from *all* pages of a paginated OpenMRS REST endpoint, making multiple requests
|
11
|
+
as needed.
|
12
|
+
|
13
|
+
## Type Parameters
|
14
|
+
|
15
|
+
### T
|
16
|
+
|
17
|
+
`T`
|
18
|
+
|
19
|
+
## Parameters
|
20
|
+
|
21
|
+
### url
|
22
|
+
|
23
|
+
The URL of the paginated OpenMRS REST endpoint. Note that the `limit` GET param can be set to specify
|
24
|
+
the page size; if not set, the page size defaults to the `webservices.rest.maxResultsDefault` value defined
|
25
|
+
server-side.
|
26
|
+
Similar to useSWRInfinite, this param can be null to disable fetching.
|
27
|
+
|
28
|
+
`string` | `URL`
|
29
|
+
|
30
|
+
### options
|
31
|
+
|
32
|
+
[`UseServerFetchAllOptions`](../interfaces/UseServerFetchAllOptions.md)\<`OpenMRSPaginatedResponse`\<`T`\>\> = `{}`
|
33
|
+
|
34
|
+
The options object
|
35
|
+
|
36
|
+
## Returns
|
37
|
+
|
38
|
+
`UseServerInfiniteReturnObject`\<`T`, `OpenMRSPaginatedResponse`\<`T`\>\>
|
39
|
+
|
40
|
+
a UseOpenmrsInfiniteReturnObject object
|
41
|
+
|
42
|
+
## See
|
43
|
+
|
44
|
+
- `useOpenmrsPagination`
|
45
|
+
- `useOpenmrsInfinite`
|
46
|
+
- `useFhirFetchAll`
|
@@ -0,0 +1,54 @@
|
|
1
|
+
[O3 Framework](../API.md) / useOpenmrsInfinite
|
2
|
+
|
3
|
+
# Function: useOpenmrsInfinite()
|
4
|
+
|
5
|
+
> **useOpenmrsInfinite**\<`T`\>(`url`, `options`): `UseServerInfiniteReturnObject`\<`T`, `OpenMRSPaginatedResponse`\<`T`\>\>
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useOpenmrsInfinite.ts:102](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsInfinite.ts#L102)
|
8
|
+
|
9
|
+
Most REST endpoints that return a list of objects, such as getAll or search, are server-side paginated.
|
10
|
+
The server limits the max number of results being returned, and multiple requests are needed to get the full data set
|
11
|
+
if its size exceeds this limit.
|
12
|
+
The max number of results per request is configurable server-side
|
13
|
+
with the key "webservices.rest.maxResultsDefault". See: https://openmrs.atlassian.net/wiki/spaces/docs/pages/25469882/REST+Module
|
14
|
+
|
15
|
+
This hook fetches data from a paginated rest endpoint, initially by fetching the first page of the results.
|
16
|
+
It provides a callback to load data from subsequent pages as needed. This hook is intended to serve UIs that
|
17
|
+
provide infinite loading / scrolling of results. Unlike `useOpenmrsPagination`, this hook does not allow random access
|
18
|
+
(and lazy-loading) of any arbitrary page; rather, it fetches pages sequentially starting form the initial page, and the next page
|
19
|
+
is fetched by calling `loadMore`. See: https://swr.vercel.app/docs/pagination#useswrinfinite
|
20
|
+
|
21
|
+
## Type Parameters
|
22
|
+
|
23
|
+
### T
|
24
|
+
|
25
|
+
`T`
|
26
|
+
|
27
|
+
## Parameters
|
28
|
+
|
29
|
+
### url
|
30
|
+
|
31
|
+
The URL of the paginated rest endpoint. Note that the `limit` GET param can be set to specify
|
32
|
+
the page size; if not set, the page size defaults to the `webservices.rest.maxResultsDefault` value defined
|
33
|
+
server-side.
|
34
|
+
Similar to useSWRInfinite, this param can be null to disable fetching.
|
35
|
+
|
36
|
+
`string` | `URL`
|
37
|
+
|
38
|
+
### options
|
39
|
+
|
40
|
+
[`UseServerInfiniteOptions`](../interfaces/UseServerInfiniteOptions.md)\<`OpenMRSPaginatedResponse`\<`T`\>\> = `{}`
|
41
|
+
|
42
|
+
The options object
|
43
|
+
|
44
|
+
## Returns
|
45
|
+
|
46
|
+
`UseServerInfiniteReturnObject`\<`T`, `OpenMRSPaginatedResponse`\<`T`\>\>
|
47
|
+
|
48
|
+
a UseServerInfiniteReturnObject object
|
49
|
+
|
50
|
+
## See
|
51
|
+
|
52
|
+
- `useOpenmrsPagination`
|
53
|
+
- `useOpenmrsFetchAll`
|
54
|
+
- `useFhirInfinite`
|
@@ -0,0 +1,140 @@
|
|
1
|
+
[O3 Framework](../API.md) / useOpenmrsPagination
|
2
|
+
|
3
|
+
# Function: useOpenmrsPagination()
|
4
|
+
|
5
|
+
> **useOpenmrsPagination**\<`T`\>(`url`, `pageSize`, `options`): `object`
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useOpenmrsPagination.ts:59](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsPagination.ts#L59)
|
8
|
+
|
9
|
+
Most OpenMRS REST endpoints that return a list of objects, such as getAll or search, are server-side paginated.
|
10
|
+
The server limits the max number of results being returned, and multiple requests are needed to get the full data set
|
11
|
+
if its size exceeds this limit.
|
12
|
+
The max number of results per request is configurable server-side
|
13
|
+
with the key "webservices.rest.maxResultsDefault". See: https://openmrs.atlassian.net/wiki/spaces/docs/pages/25469882/REST+Module
|
14
|
+
|
15
|
+
For any UI that displays a paginated view of the full data set, we MUST handle the server-side pagination properly,
|
16
|
+
or else the UI does not correctly display the full data set.
|
17
|
+
This hook does that by providing callback functions for navigating to different pages of the results, and
|
18
|
+
lazy-loads the data on each page as needed.
|
19
|
+
|
20
|
+
Note that this hook is not suitable for use for situations that require client-side sorting or filtering
|
21
|
+
of the data set. In that case, all data must be loaded onto client-side first.
|
22
|
+
|
23
|
+
## Type Parameters
|
24
|
+
|
25
|
+
### T
|
26
|
+
|
27
|
+
`T`
|
28
|
+
|
29
|
+
## Parameters
|
30
|
+
|
31
|
+
### url
|
32
|
+
|
33
|
+
The URL of the paginated rest endpoint. \
|
34
|
+
It should be populated with any needed GET params, except `limit`, `startIndex` or `totalCount`,
|
35
|
+
which will be overridden and manipulated by the `goTo*` callbacks.
|
36
|
+
Similar to useSWR, this param can be null to disable fetching.
|
37
|
+
|
38
|
+
`string` | `URL`
|
39
|
+
|
40
|
+
### pageSize
|
41
|
+
|
42
|
+
`number`
|
43
|
+
|
44
|
+
The number of results to return per page / fetch. Note that this value MUST NOT exceed
|
45
|
+
"webservices.rest.maxResultsAbsolute", which should be reasonably high by default (1000).
|
46
|
+
|
47
|
+
### options
|
48
|
+
|
49
|
+
[`UseServerPaginationOptions`](../interfaces/UseServerPaginationOptions.md)\<`OpenMRSPaginatedResponse`\<`T`\>\> = `{}`
|
50
|
+
|
51
|
+
The options object
|
52
|
+
|
53
|
+
## Returns
|
54
|
+
|
55
|
+
### currentPage
|
56
|
+
|
57
|
+
> **currentPage**: `number`
|
58
|
+
|
59
|
+
### currentPageSize
|
60
|
+
|
61
|
+
> **currentPageSize**: `MutableRefObject`\<`number`\>
|
62
|
+
|
63
|
+
### data
|
64
|
+
|
65
|
+
> **data**: `undefined` \| `T`[]
|
66
|
+
|
67
|
+
### error
|
68
|
+
|
69
|
+
> **error**: `any`
|
70
|
+
|
71
|
+
The error object thrown by the fetcher function.
|
72
|
+
|
73
|
+
### goTo()
|
74
|
+
|
75
|
+
> **goTo**: (`page`) => `void`
|
76
|
+
|
77
|
+
#### Parameters
|
78
|
+
|
79
|
+
##### page
|
80
|
+
|
81
|
+
`number`
|
82
|
+
|
83
|
+
#### Returns
|
84
|
+
|
85
|
+
`void`
|
86
|
+
|
87
|
+
### goToNext()
|
88
|
+
|
89
|
+
> **goToNext**: () => `void`
|
90
|
+
|
91
|
+
#### Returns
|
92
|
+
|
93
|
+
`void`
|
94
|
+
|
95
|
+
### goToPrevious()
|
96
|
+
|
97
|
+
> **goToPrevious**: () => `void`
|
98
|
+
|
99
|
+
#### Returns
|
100
|
+
|
101
|
+
`void`
|
102
|
+
|
103
|
+
### isLoading
|
104
|
+
|
105
|
+
> **isLoading**: `boolean`
|
106
|
+
|
107
|
+
### isValidating
|
108
|
+
|
109
|
+
> **isValidating**: `boolean`
|
110
|
+
|
111
|
+
### mutate
|
112
|
+
|
113
|
+
> **mutate**: `KeyedMutator`\<`FetchResponse`\<`OpenMRSPaginatedResponse`\<`T`\>\>\>
|
114
|
+
|
115
|
+
### paginated
|
116
|
+
|
117
|
+
> **paginated**: `boolean`
|
118
|
+
|
119
|
+
### showNextButton
|
120
|
+
|
121
|
+
> **showNextButton**: `boolean`
|
122
|
+
|
123
|
+
### showPreviousButton
|
124
|
+
|
125
|
+
> **showPreviousButton**: `boolean`
|
126
|
+
|
127
|
+
### totalCount
|
128
|
+
|
129
|
+
> **totalCount**: `number` = `totalCount.current`
|
130
|
+
|
131
|
+
### totalPages
|
132
|
+
|
133
|
+
> **totalPages**: `number`
|
134
|
+
|
135
|
+
## See
|
136
|
+
|
137
|
+
- `useOpenmrsInfinite`
|
138
|
+
- `useOpenmrsFetchAll`
|
139
|
+
- `usePagination` for pagination of client-side data`
|
140
|
+
@see `useFhirPagination``
|
@@ -0,0 +1,71 @@
|
|
1
|
+
[O3 Framework](../API.md) / useOpenmrsSWR
|
2
|
+
|
3
|
+
# Function: useOpenmrsSWR()
|
4
|
+
|
5
|
+
> **useOpenmrsSWR**\<`DataType`, `ErrorType`\>(`key`, `options`): `SWRResponse`\<`FetchResponse`\<`DataType`\>, `ErrorType`, `undefined` \| `SWRConfiguration`\<`FetchResponse`\<`DataType`\>, `ErrorType`, `BareFetcher`\<`FetchResponse`\<`DataType`\>\>\>\>
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useOpenmrsSWR.ts:70](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsSWR.ts#L70)
|
8
|
+
|
9
|
+
**`Beta`**
|
10
|
+
|
11
|
+
This hook is intended to simplify using openmrsFetch in useSWR, while also ensuring that
|
12
|
+
all useSWR usages properly use an abort controller, so that fetch requests are cancelled
|
13
|
+
if the React component unmounts.
|
14
|
+
|
15
|
+
## Type Parameters
|
16
|
+
|
17
|
+
### DataType
|
18
|
+
|
19
|
+
`DataType` = `any`
|
20
|
+
|
21
|
+
### ErrorType
|
22
|
+
|
23
|
+
`ErrorType` = `any`
|
24
|
+
|
25
|
+
## Parameters
|
26
|
+
|
27
|
+
### key
|
28
|
+
|
29
|
+
[`Key`](../type-aliases/Key.md)
|
30
|
+
|
31
|
+
The SWR key to use
|
32
|
+
|
33
|
+
### options
|
34
|
+
|
35
|
+
[`UseOpenmrsSWROptions`](../type-aliases/UseOpenmrsSWROptions.md) = `{}`
|
36
|
+
|
37
|
+
An object of optional parameters to provide, including a [FetchConfig](../interfaces/FetchConfig.md) object
|
38
|
+
to pass to [openmrsFetch](openmrsFetch.md) or options to pass to SWR
|
39
|
+
|
40
|
+
## Returns
|
41
|
+
|
42
|
+
`SWRResponse`\<`FetchResponse`\<`DataType`\>, `ErrorType`, `undefined` \| `SWRConfiguration`\<`FetchResponse`\<`DataType`\>, `ErrorType`, `BareFetcher`\<`FetchResponse`\<`DataType`\>\>\>\>
|
43
|
+
|
44
|
+
## Examples
|
45
|
+
|
46
|
+
```tsx
|
47
|
+
import { useOpenmrsSWR } from "@openmrs/esm-framework";
|
48
|
+
|
49
|
+
function MyComponent() {
|
50
|
+
const { data } = useOpenmrsSWR(key);
|
51
|
+
|
52
|
+
return (
|
53
|
+
// render something with data
|
54
|
+
);
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
58
|
+
Note that if you are using a complex SWR key you must provide a url function to the options parameter,
|
59
|
+
which translates the key into a URL to be sent to `openmrsFetch()`
|
60
|
+
|
61
|
+
```tsx
|
62
|
+
import { useOpenmrsSWR } from "@openmrs/esm-framework";
|
63
|
+
|
64
|
+
function MyComponent() {
|
65
|
+
const { data } = useOpenmrsSWR(['key', 'url'], { url: (key) => key[1] });
|
66
|
+
|
67
|
+
return (
|
68
|
+
// render something with data
|
69
|
+
);
|
70
|
+
}
|
71
|
+
```
|
@@ -0,0 +1,89 @@
|
|
1
|
+
[O3 Framework](../API.md) / usePagination
|
2
|
+
|
3
|
+
# Function: usePagination()
|
4
|
+
|
5
|
+
> **usePagination**\<`T`\>(`data`, `resultsPerPage`): `object`
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/usePagination.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/usePagination.ts#L15)
|
8
|
+
|
9
|
+
Use this hook to paginate data that already exists on the client side.
|
10
|
+
Note that if the data is obtained from server-side, the caller must handle server-side pagination manually.
|
11
|
+
|
12
|
+
## Type Parameters
|
13
|
+
|
14
|
+
### T
|
15
|
+
|
16
|
+
`T`
|
17
|
+
|
18
|
+
## Parameters
|
19
|
+
|
20
|
+
### data
|
21
|
+
|
22
|
+
`T`[] = `[]`
|
23
|
+
|
24
|
+
### resultsPerPage
|
25
|
+
|
26
|
+
`number` = `defaultResultsPerPage`
|
27
|
+
|
28
|
+
## Returns
|
29
|
+
|
30
|
+
`object`
|
31
|
+
|
32
|
+
### currentPage
|
33
|
+
|
34
|
+
> **currentPage**: `number` = `page`
|
35
|
+
|
36
|
+
### goTo()
|
37
|
+
|
38
|
+
> **goTo**: (`page`) => `void`
|
39
|
+
|
40
|
+
#### Parameters
|
41
|
+
|
42
|
+
##### page
|
43
|
+
|
44
|
+
`number`
|
45
|
+
|
46
|
+
#### Returns
|
47
|
+
|
48
|
+
`void`
|
49
|
+
|
50
|
+
### goToNext()
|
51
|
+
|
52
|
+
> **goToNext**: () => `void`
|
53
|
+
|
54
|
+
#### Returns
|
55
|
+
|
56
|
+
`void`
|
57
|
+
|
58
|
+
### goToPrevious()
|
59
|
+
|
60
|
+
> **goToPrevious**: () => `void`
|
61
|
+
|
62
|
+
#### Returns
|
63
|
+
|
64
|
+
`void`
|
65
|
+
|
66
|
+
### paginated
|
67
|
+
|
68
|
+
> **paginated**: `boolean`
|
69
|
+
|
70
|
+
### results
|
71
|
+
|
72
|
+
> **results**: `T`[]
|
73
|
+
|
74
|
+
### showNextButton
|
75
|
+
|
76
|
+
> **showNextButton**: `boolean`
|
77
|
+
|
78
|
+
### showPreviousButton
|
79
|
+
|
80
|
+
> **showPreviousButton**: `boolean`
|
81
|
+
|
82
|
+
### totalPages
|
83
|
+
|
84
|
+
> **totalPages**: `number`
|
85
|
+
|
86
|
+
## See
|
87
|
+
|
88
|
+
- `useServerPagination` for hook that automatically manages server-side pagination.
|
89
|
+
- `useServerInfinite` for hook to get all data loaded onto the client-side
|
@@ -0,0 +1,38 @@
|
|
1
|
+
[O3 Framework](../API.md) / usePatient
|
2
|
+
|
3
|
+
# Function: usePatient()
|
4
|
+
|
5
|
+
> **usePatient**(`patientUuid?`): `object`
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/usePatient.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/usePatient.ts#L19)
|
8
|
+
|
9
|
+
This React hook returns a patient object. If the `patientUuid` is provided
|
10
|
+
as a parameter, then the patient for that UUID is returned. If the parameter
|
11
|
+
is not provided, the patient UUID is obtained from the current route, and
|
12
|
+
a route listener is set up to update the patient whenever the route changes.
|
13
|
+
|
14
|
+
## Parameters
|
15
|
+
|
16
|
+
### patientUuid?
|
17
|
+
|
18
|
+
`string`
|
19
|
+
|
20
|
+
## Returns
|
21
|
+
|
22
|
+
`object`
|
23
|
+
|
24
|
+
### error
|
25
|
+
|
26
|
+
> **error**: `undefined` \| `null` \| `Error`
|
27
|
+
|
28
|
+
### isLoading
|
29
|
+
|
30
|
+
> **isLoading**: `boolean`
|
31
|
+
|
32
|
+
### patient
|
33
|
+
|
34
|
+
> **patient**: `undefined` \| [`NullablePatient`](../type-aliases/NullablePatient.md)
|
35
|
+
|
36
|
+
### patientUuid
|
37
|
+
|
38
|
+
> **patientUuid**: `null` \| `string` = `currentPatientUuid`
|
@@ -0,0 +1,17 @@
|
|
1
|
+
[O3 Framework](../API.md) / usePatientPhoto
|
2
|
+
|
3
|
+
# Function: usePatientPhoto()
|
4
|
+
|
5
|
+
> **usePatientPhoto**(`patientUuid`): [`UsePatientPhotoResult`](../interfaces/UsePatientPhotoResult.md)
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-styleguide/src/patient-photo/usePatientPhoto.ts:30](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/patient-photo/usePatientPhoto.ts#L30)
|
8
|
+
|
9
|
+
## Parameters
|
10
|
+
|
11
|
+
### patientUuid
|
12
|
+
|
13
|
+
`string`
|
14
|
+
|
15
|
+
## Returns
|
16
|
+
|
17
|
+
[`UsePatientPhotoResult`](../interfaces/UsePatientPhotoResult.md)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
[O3 Framework](../API.md) / usePrimaryIdentifierCode
|
2
|
+
|
3
|
+
# Function: usePrimaryIdentifierCode()
|
4
|
+
|
5
|
+
> **usePrimaryIdentifierCode**(): `object`
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/usePrimaryIdentifierResource.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/usePrimaryIdentifierResource.ts#L13)
|
8
|
+
|
9
|
+
## Returns
|
10
|
+
|
11
|
+
`object`
|
12
|
+
|
13
|
+
### error
|
14
|
+
|
15
|
+
> **error**: `undefined` \| `Error`
|
16
|
+
|
17
|
+
### isLoading
|
18
|
+
|
19
|
+
> **isLoading**: `boolean`
|
20
|
+
|
21
|
+
### primaryIdentifierCode
|
22
|
+
|
23
|
+
> **primaryIdentifierCode**: `undefined` \| `string`
|
@@ -0,0 +1,43 @@
|
|
1
|
+
[O3 Framework](../API.md) / useRenderableExtensions
|
2
|
+
|
3
|
+
# Function: useRenderableExtensions()
|
4
|
+
|
5
|
+
> **useRenderableExtensions**(`name`): `FC`\<`Pick`\<[`ExtensionProps`](../type-aliases/ExtensionProps.md), `"state"`\>\>[]
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useRenderableExtensions.tsx:31](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useRenderableExtensions.tsx#L31)
|
8
|
+
|
9
|
+
This is an advanced hook for use-cases where its useful to use the extension system,
|
10
|
+
but not the `ExtensionSlot` component's rendering of extensions. Use of this hook
|
11
|
+
should be avoided if possible.
|
12
|
+
|
13
|
+
Functionally, this hook is very similar to the `ExtensionSlot` component, but whereas
|
14
|
+
an `ExtensionSlot` renders a DOM tree of extensions bound to the slot, this hook simply
|
15
|
+
returns the extensions as an array of React components that can be wired into a component
|
16
|
+
however makes sense.
|
17
|
+
|
18
|
+
## Parameters
|
19
|
+
|
20
|
+
### name
|
21
|
+
|
22
|
+
`string`
|
23
|
+
|
24
|
+
The name of the extension slot
|
25
|
+
|
26
|
+
## Returns
|
27
|
+
|
28
|
+
`FC`\<`Pick`\<[`ExtensionProps`](../type-aliases/ExtensionProps.md), `"state"`\>\>[]
|
29
|
+
|
30
|
+
## Example
|
31
|
+
|
32
|
+
```ts
|
33
|
+
const extensions = useRenderableExtensions('my-extension-slot');
|
34
|
+
return (
|
35
|
+
<>
|
36
|
+
{extensions.map((Ext, index) => (
|
37
|
+
<React.Fragment key={index}>
|
38
|
+
<Ext state={{key: 'value'}} />
|
39
|
+
</React.Fragment>
|
40
|
+
))}
|
41
|
+
</>
|
42
|
+
)
|
43
|
+
```
|
@@ -0,0 +1,19 @@
|
|
1
|
+
[O3 Framework](../API.md) / useSession
|
2
|
+
|
3
|
+
# Function: useSession()
|
4
|
+
|
5
|
+
> **useSession**(): `Session`
|
6
|
+
|
7
|
+
Defined in: [packages/framework/esm-react-utils/src/useSession.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useSession.ts#L17)
|
8
|
+
|
9
|
+
Gets the current user session information. Returns an object with
|
10
|
+
property `authenticated` == `false` if the user is not logged in.
|
11
|
+
|
12
|
+
Uses Suspense. This hook will always either return a Session object
|
13
|
+
or throw for Suspense. It will never return `null`/`undefined`.
|
14
|
+
|
15
|
+
## Returns
|
16
|
+
|
17
|
+
`Session`
|
18
|
+
|
19
|
+
Current user session information
|