From c4f038ed5a10e06587b0b4806088d02c3a3ed50c Mon Sep 17 00:00:00 2001 From: Chi Bong Ho Date: Thu, 31 Oct 2024 16:47:12 -0400 Subject: [PATCH] (chore) export openmrsComponentDecorator --- packages/framework/esm-framework/docs/API.md | 41 ++++++++++++++++++- .../framework/esm-react-utils/src/public.ts | 1 + .../esm-translations/translations/en.json | 1 + 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/packages/framework/esm-framework/docs/API.md b/packages/framework/esm-framework/docs/API.md index fa31904ef..c556424d9 100644 --- a/packages/framework/esm-framework/docs/API.md +++ b/packages/framework/esm-framework/docs/API.md @@ -192,6 +192,7 @@ - [evaluateAsync](API.md#evaluateasync) - [extractVariableNames](API.md#extractvariablenames) - [isOnline](API.md#isonline) +- [openmrsComponentDecorator](API.md#openmrscomponentdecorator) - [useFhirFetchAll](API.md#usefhirfetchall) - [useFhirInfinite](API.md#usefhirinfinite) @@ -6281,6 +6282,44 @@ ___ ___ +### openmrsComponentDecorator + +▸ **openmrsComponentDecorator**<`T`\>(`userOpts`): (`Comp`: `ComponentType`<`T`\>) => `ComponentType`<`T`\> + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `userOpts` | `ComponentDecoratorOptions` | + +#### Returns + +`fn` + +▸ (`Comp`): `ComponentType`<`T`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `Comp` | `ComponentType`<`T`\> | + +##### Returns + +`ComponentType`<`T`\> + +#### Defined in + +[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:46](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L46) + +___ + ### useFhirFetchAll ▸ **useFhirFetchAll**<`T`\>(`url`, `options?`): `UseServerInfiniteReturnObject`<`T`, `fhir.Bundle`\> @@ -6699,7 +6738,7 @@ invalid key to this function will result in a type error. | Name | Type | Description | | :------ | :------ | :------ | -| `key` | ``"error"`` \| ``"change"`` \| ``"close"`` \| ``"other"`` \| ``"actions"`` \| ``"address"`` \| ``"age"`` \| ``"cancel"`` \| ``"confirm"`` \| ``"contactAdministratorIfIssuePersists"`` \| ``"contactDetails"`` \| ``"errorCopy"`` \| ``"female"`` \| ``"hideDetails"`` \| ``"loading"`` \| ``"male"`` \| ``"patientIdentifierSticker"`` \| ``"patientLists"`` \| ``"print"`` \| ``"printError"`` \| ``"printErrorExplainer"`` \| ``"printIdentifierSticker"`` \| ``"printing"`` \| ``"relationships"`` \| ``"resetOverrides"`` \| ``"scriptLoadingFailed"`` \| ``"scriptLoadingError"`` \| ``"seeMoreLists"`` \| ``"sex"`` \| ``"showDetails"`` \| ``"unknown"`` \| ``"closeAllOpenedWorkspaces"`` \| ``"closingAllWorkspacesPromptBody"`` \| ``"closingAllWorkspacesPromptTitle"`` \| ``"discard"`` \| ``"hide"`` \| ``"maximize"`` \| ``"minimize"`` \| ``"openAnyway"`` \| ``"unsavedChangesInOpenedWorkspace"`` \| ``"unsavedChangesInWorkspace"`` \| ``"unsavedChangesTitleText"`` \| ``"workspaceHeader"`` \| ``"address1"`` \| ``"address2"`` \| ``"address3"`` \| ``"address4"`` \| ``"address5"`` \| ``"address6"`` \| ``"city"`` \| ``"cityVillage"`` \| ``"country"`` \| ``"countyDistrict"`` \| ``"postalCode"`` \| ``"state"`` \| ``"stateProvince"`` | - | +| `key` | ``"error"`` \| ``"change"`` \| ``"close"`` \| ``"other"`` \| ``"actions"`` \| ``"address"`` \| ``"age"`` \| ``"cancel"`` \| ``"confirm"`` \| ``"contactAdministratorIfIssuePersists"`` \| ``"contactDetails"`` \| ``"errorCopy"`` \| ``"female"`` \| ``"hideDetails"`` \| ``"loading"`` \| ``"male"`` \| ``"patientIdentifierSticker"`` \| ``"patientLists"`` \| ``"print"`` \| ``"printError"`` \| ``"printErrorExplainer"`` \| ``"printIdentifierSticker"`` \| ``"printing"`` \| ``"relationships"`` \| ``"resetOverrides"`` \| ``"scriptLoadingFailed"`` \| ``"scriptLoadingError"`` \| ``"seeMoreLists"`` \| ``"sex"`` \| ``"showDetails"`` \| ``"unknown"`` \| ``"closeAllOpenedWorkspaces"`` \| ``"closingAllWorkspacesPromptBody"`` \| ``"closingAllWorkspacesPromptTitle"`` \| ``"discard"`` \| ``"hide"`` \| ``"maximize"`` \| ``"minimize"`` \| ``"openAnyway"`` \| ``"unsavedChangesInOpenedWorkspace"`` \| ``"unsavedChangesInWorkspace"`` \| ``"unsavedChangesTitleText"`` \| ``"workspaceHeader"`` \| ``"address1"`` \| ``"address2"`` \| ``"address3"`` \| ``"address4"`` \| ``"address5"`` \| ``"address6"`` \| ``"city"`` \| ``"cityVillage"`` \| ``"country"`` \| ``"countyDistrict"`` \| ``"district"`` \| ``"postalCode"`` \| ``"state"`` \| ``"stateProvince"`` | - | | `defaultText?` | `string` | - | | `options?` | `Omit`<`TOptions`<`StringMap`\>, ``"defaultValue"`` \| ``"ns"``\> | Object passed to the i18next `t` function. See https://www.i18next.com/translation-function/essentials#overview-options for more information. `ns` and `defaultValue` are already set and may not be used. | diff --git a/packages/framework/esm-react-utils/src/public.ts b/packages/framework/esm-react-utils/src/public.ts index f5e4b4ca1..39aae1fa9 100644 --- a/packages/framework/esm-react-utils/src/public.ts +++ b/packages/framework/esm-react-utils/src/public.ts @@ -4,6 +4,7 @@ export * from './Extension'; export * from './ExtensionSlot'; export * from './UserHasAccess'; export * from './getLifecycle'; +export { openmrsComponentDecorator } from './openmrsComponentDecorator'; export * from './OpenmrsContext'; export * from './useAbortController'; export * from './useAppContext'; diff --git a/packages/framework/esm-translations/translations/en.json b/packages/framework/esm-translations/translations/en.json index e6e76392d..fdb5d8bdd 100644 --- a/packages/framework/esm-translations/translations/en.json +++ b/packages/framework/esm-translations/translations/en.json @@ -22,6 +22,7 @@ "country": "Country", "countyDistrict": "District", "discard": "Discard", + "district": "District", "error": "Error", "errorCopy": "Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.", "female": "Female",