@openmrs/esm-react-utils 5.1.1-pre.944 → 5.1.1-pre.952

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": "5.1.1-pre.944",
3
+ "version": "5.1.1-pre.952",
4
4
  "license": "MPL-2.0",
5
5
  "description": "React utilities for OpenMRS.",
6
6
  "browser": "dist/openmrs-esm-react-utils.js",
@@ -56,12 +56,12 @@
56
56
  "react-i18next": "11.x"
57
57
  },
58
58
  "devDependencies": {
59
- "@openmrs/esm-api": "^5.1.1-pre.944",
60
- "@openmrs/esm-config": "^5.1.1-pre.944",
61
- "@openmrs/esm-error-handling": "^5.1.1-pre.944",
62
- "@openmrs/esm-extensions": "^5.1.1-pre.944",
63
- "@openmrs/esm-feature-flags": "^5.1.1-pre.944",
64
- "@openmrs/esm-globals": "^5.1.1-pre.944",
59
+ "@openmrs/esm-api": "^5.1.1-pre.952",
60
+ "@openmrs/esm-config": "^5.1.1-pre.952",
61
+ "@openmrs/esm-error-handling": "^5.1.1-pre.952",
62
+ "@openmrs/esm-extensions": "^5.1.1-pre.952",
63
+ "@openmrs/esm-feature-flags": "^5.1.1-pre.952",
64
+ "@openmrs/esm-globals": "^5.1.1-pre.952",
65
65
  "dayjs": "^1.10.8",
66
66
  "i18next": "^19.6.0",
67
67
  "react": "^18.1.0",
@@ -70,5 +70,5 @@
70
70
  "rxjs": "^6.5.3",
71
71
  "webpack": "^5.88.0"
72
72
  },
73
- "gitHead": "a5216bb94ee45d9f4a60a2bb7d7dac7996f56314"
73
+ "gitHead": "673848dd730a73bed00a06ba75e3d2b72db3bebc"
74
74
  }
@@ -1,8 +1,8 @@
1
1
  /** @module @category Navigation */
2
2
  import React, {
3
- MouseEvent,
4
- AnchorHTMLAttributes,
5
- PropsWithChildren,
3
+ type MouseEvent,
4
+ type AnchorHTMLAttributes,
5
+ type PropsWithChildren,
6
6
  } from "react";
7
7
  import { navigate, interpolateUrl, TemplateParams } from "@openmrs/esm-config";
8
8
 
package/src/Extension.tsx CHANGED
@@ -5,6 +5,7 @@ import React, {
5
5
  useEffect,
6
6
  useRef,
7
7
  useState,
8
+ type ReactElement,
8
9
  } from "react";
9
10
  import type { Parcel } from "single-spa";
10
11
  import { ComponentContext } from ".";
@@ -16,7 +17,7 @@ export type ExtensionProps = {
16
17
  wrap?(
17
18
  slot: React.ReactNode,
18
19
  extension: ExtensionData
19
- ): React.ReactElement<any, any> | null;
20
+ ): ReactElement<any, any> | null;
20
21
  } & Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
21
22
  children?:
22
23
  | React.ReactNode
@@ -1,5 +1,5 @@
1
1
  /** @module @category Framework */
2
- import React from "react";
2
+ import React, { ComponentType } from "react";
3
3
  import ReactDOMClient from "react-dom/client";
4
4
  import singleSpaReact from "single-spa-react";
5
5
  import {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./openmrsComponentDecorator";
9
9
 
10
10
  export function getLifecycle<T>(
11
- Component: React.ComponentType<T>,
11
+ Component: ComponentType<T>,
12
12
  options: ComponentDecoratorOptions
13
13
  ) {
14
14
  return singleSpaReact({
@@ -19,7 +19,7 @@ export function getLifecycle<T>(
19
19
  }
20
20
 
21
21
  export function getAsyncLifecycle<T>(
22
- lazy: () => Promise<{ default: React.ComponentType<T> }>,
22
+ lazy: () => Promise<{ default: ComponentType<T> }>,
23
23
  options: ComponentDecoratorOptions
24
24
  ) {
25
25
  return () =>
@@ -27,7 +27,7 @@ export function getAsyncLifecycle<T>(
27
27
  }
28
28
 
29
29
  export function getSyncLifecycle<T>(
30
- Component: React.ComponentType<T>,
30
+ Component: ComponentType<T>,
31
31
  options: ComponentDecoratorOptions
32
32
  ) {
33
33
  return () => Promise.resolve(getLifecycle(Component, options));
@@ -1,4 +1,4 @@
1
- import React, { Suspense, useEffect, useRef } from "react";
1
+ import React, { type ComponentType, Suspense } from "react";
2
2
  import { I18nextProvider } from "react-i18next";
3
3
  import type {} from "@openmrs/esm-globals";
4
4
  import {
@@ -42,8 +42,8 @@ export function openmrsComponentDecorator(userOpts: ComponentDecoratorOptions) {
42
42
  const opts = Object.assign({}, defaultOpts, userOpts);
43
43
 
44
44
  return function decorateComponent(
45
- Comp: React.ComponentType<any>
46
- ): React.ComponentType<any> {
45
+ Comp: ComponentType<any>
46
+ ): ComponentType<any> {
47
47
  return class OpenmrsReactComponent extends React.Component<
48
48
  OpenmrsReactComponentProps,
49
49
  OpenmrsReactComponentState