@openmrs/esm-react-utils 3.2.1-pre.1094 → 3.2.1-pre.1102

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-react-utils",
3
- "version": "3.2.1-pre.1094",
3
+ "version": "3.2.1-pre.1102",
4
4
  "license": "MPL-2.0",
5
5
  "description": "React utilities for OpenMRS.",
6
6
  "browser": "dist/openmrs-esm-react-utils.js",
@@ -55,11 +55,11 @@
55
55
  "react-i18next": "11.x"
56
56
  },
57
57
  "devDependencies": {
58
- "@openmrs/esm-api": "^3.2.1-pre.1094",
59
- "@openmrs/esm-config": "^3.2.1-pre.1094",
60
- "@openmrs/esm-error-handling": "^3.2.1-pre.1094",
61
- "@openmrs/esm-extensions": "^3.2.1-pre.1094",
62
- "@openmrs/esm-globals": "^3.2.1-pre.1094",
58
+ "@openmrs/esm-api": "^3.2.1-pre.1102",
59
+ "@openmrs/esm-config": "^3.2.1-pre.1102",
60
+ "@openmrs/esm-error-handling": "^3.2.1-pre.1102",
61
+ "@openmrs/esm-extensions": "^3.2.1-pre.1102",
62
+ "@openmrs/esm-globals": "^3.2.1-pre.1102",
63
63
  "dayjs": "^1.10.8",
64
64
  "i18next": "^19.6.0",
65
65
  "react": "^16.13.1",
@@ -68,5 +68,5 @@
68
68
  "rxjs": "^6.5.3",
69
69
  "unistore": "^3.5.2"
70
70
  },
71
- "gitHead": "098d850b2490bbfc115d844bd1b5ffabf876e98a"
71
+ "gitHead": "6780e8f11ac37b73336935de1f56ed5b82eb51c0"
72
72
  }
@@ -1,3 +1,4 @@
1
+ /** @module @category Navigation */
1
2
  import React, { MouseEvent, AnchorHTMLAttributes } from "react";
2
3
  import { navigate, interpolateUrl } from "@openmrs/esm-config";
3
4
 
@@ -27,7 +28,6 @@ export interface ConfigurableLinkProps
27
28
  * @param to The target path or URL. Supports interpolation. See [[navigate]]
28
29
  * @param children Inline elements within the link
29
30
  * @param otherProps Any other valid props for an <a> tag except `href` and `onClick`
30
- * @category Navigation
31
31
  */
32
32
  export const ConfigurableLink: React.FC<ConfigurableLinkProps> = ({
33
33
  to,
@@ -1,3 +1,4 @@
1
+ /** @module @category API */
1
2
  import React, { useEffect, useState } from "react";
2
3
  import { getCurrentUser, userHasAccess, LoggedInUser } from "@openmrs/esm-api";
3
4
 
@@ -1,3 +1,4 @@
1
+ /** @module @category Store */
1
2
  import { useEffect, useMemo, useState } from "react";
2
3
  import { Store, BoundAction } from "unistore";
3
4
 
@@ -1,3 +1,4 @@
1
+ /** @module @category Framework */
1
2
  import React from "react";
2
3
  import ReactDOM from "react-dom";
3
4
  import singleSpaReact from "single-spa-react";
package/src/public.ts ADDED
@@ -0,0 +1,26 @@
1
+ export { ExtensionData } from "./ComponentContext";
2
+ export * from "./ConfigurableLink";
3
+ export * from "./createUseStore";
4
+ export * from "./Extension";
5
+ export * from "./ExtensionSlot";
6
+ export * from "./getLifecycle";
7
+ export * from "./useAssignedExtensions";
8
+ export * from "./useAssignedExtensionIds";
9
+ export * from "./useBodyScrollLock";
10
+ export * from "./useConfig";
11
+ export * from "./useConnectedExtensions";
12
+ export * from "./useConnectivity";
13
+ export * from "./usePatient";
14
+ export * from "./useCurrentPatient";
15
+ export * from "./useExtensionSlot";
16
+ export * from "./useExtensionSlotMeta";
17
+ export * from "./useExtensionStore";
18
+ export * from "./useLayoutType";
19
+ export * from "./useLocations";
20
+ export * from "./useOnClickOutside";
21
+ export * from "./UserHasAccess";
22
+ export * from "./useSessionUser";
23
+ export * from "./useStore";
24
+ export * from "./useVisit";
25
+ export * from "./useVisitTypes";
26
+ export * from "./usePagination";
@@ -1,3 +1,4 @@
1
+ /** @module @category Extension */
1
2
  import { useEffect, useState } from "react";
2
3
  import { getExtensionStore } from "@openmrs/esm-extensions";
3
4
  import { isEqual } from "lodash";
@@ -1,3 +1,4 @@
1
+ /** @module @category Extension */
1
2
  import { useEffect, useState } from "react";
2
3
  import {
3
4
  AssignedExtension,
@@ -1,3 +1,4 @@
1
+ /** @module @category UI */
1
2
  import { useEffect } from "react";
2
3
 
3
4
  export function useBodyScrollLock(active: boolean) {
package/src/useConfig.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** @module @category Config */
1
2
  import { useContext, useEffect, useMemo, useState } from "react";
2
3
  import {
3
4
  getConfigStore,
@@ -1,3 +1,4 @@
1
+ /** @module @category Extension */
1
2
  import { useMemo } from "react";
2
3
  import {
3
4
  ConnectedExtension,
@@ -1,3 +1,4 @@
1
+ /** @module @category Offline */
1
2
  import { subscribeConnectivityChanged } from "@openmrs/esm-globals";
2
3
  import { useEffect, useState } from "react";
3
4
 
@@ -1,3 +1,4 @@
1
+ /** @module @category API */
1
2
  import { useEffect, useReducer } from "react";
2
3
  import { fetchCurrentPatient, PatientUuid } from "@openmrs/esm-api";
3
4
 
@@ -1,3 +1,4 @@
1
+ /** @module @category Extension */
1
2
  import { ExtensionMeta } from "@openmrs/esm-extensions";
2
3
  import { useMemo } from "react";
3
4
  import { useConnectedExtensions } from "./useConnectedExtensions";
@@ -1,3 +1,4 @@
1
+ /** @module @category Extension */
1
2
  import { ExtensionStore, getExtensionStore } from "@openmrs/esm-extensions";
2
3
  import { createUseStore } from "./createUseStore";
3
4
 
@@ -1,3 +1,4 @@
1
+ /** @module @category UI */
1
2
  import { useEffect, useState } from "react";
2
3
 
3
4
  export type LayoutType = "tablet" | "phone" | "desktop";
@@ -1,3 +1,4 @@
1
+ /** @module @category API */
1
2
  import { getLocations, Location } from "@openmrs/esm-api";
2
3
  import { useState, useEffect } from "react";
3
4
 
@@ -1,3 +1,4 @@
1
+ /** @module @category UI */
1
2
  import { useRef, useEffect } from "react";
2
3
 
3
4
  export function useOnClickOutside<T extends HTMLElement = HTMLElement>(
@@ -10,7 +11,7 @@ export function useOnClickOutside<T extends HTMLElement = HTMLElement>(
10
11
  if (active) {
11
12
  const listener = (event: Event) => {
12
13
  if (ref?.current?.contains(event.target as Node)) {
13
- return;
14
+ return;
14
15
  }
15
16
 
16
17
  handler(event);
@@ -1,3 +1,4 @@
1
+ /** @module @category UI */
1
2
  import { useMemo, useState } from "react";
2
3
 
3
4
  const defaultResultsPerPage = 10;
package/src/usePatient.ts CHANGED
@@ -1,7 +1,8 @@
1
+ /** @module @category API */
1
2
  import { useEffect, useReducer } from "react";
2
3
  import { fetchCurrentPatient, PatientUuid } from "@openmrs/esm-api";
3
4
 
4
- type NullablePatient = fhir.Patient | null;
5
+ export type NullablePatient = fhir.Patient | null;
5
6
 
6
7
  interface CurrentPatientState {
7
8
  patientUuid: string | null;
@@ -1,3 +1,4 @@
1
+ /** @module @category API */
1
2
  import { openmrsObservableFetch, SessionUser } from "@openmrs/esm-api";
2
3
  import { useState, useEffect } from "react";
3
4
 
package/src/useStore.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** @module @category Store */
1
2
  import { subscribeTo } from "@openmrs/esm-state";
2
3
  import { useEffect, useMemo, useState } from "react";
3
4
  import { Store } from "unistore";
package/src/useVisit.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** @module @category API */
1
2
  import {
2
3
  defaultVisitCustomRepresentation,
3
4
  openmrsFetch,
@@ -1,3 +1,4 @@
1
+ /** @module @category API */
1
2
  import { getVisitTypes, VisitType } from "@openmrs/esm-api";
2
3
  import { useEffect, useState } from "react";
3
4