@carbonorm/carbonreact 4.0.6 → 4.0.8
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/CarbonReact.d.ts +4 -3
- package/dist/components/Alert/Alert.d.ts +3 -3
- package/dist/components/WebSocket/CarbonWebSocket.d.ts +3 -3
- package/dist/index.cjs.js +4 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/CarbonReact.tsx +8 -6
- package/src/components/Alert/Alert.tsx +3 -3
- package/src/components/WebSocket/CarbonWebSocket.tsx +3 -3
package/dist/CarbonReact.d.ts
CHANGED
|
@@ -25,9 +25,10 @@ declare abstract class CarbonReact<P = {}, S extends iCarbonReactState = iCarbon
|
|
|
25
25
|
private static persistentStateMap;
|
|
26
26
|
context: Context<S & iCarbonReactState>;
|
|
27
27
|
protected target: typeof CarbonReact;
|
|
28
|
-
protected static _instance:
|
|
29
|
-
static
|
|
30
|
-
static
|
|
28
|
+
protected static _instance: CarbonReact<any, any>;
|
|
29
|
+
static getInstance<T extends CarbonReact<any, any>>(): T;
|
|
30
|
+
static get instance(): CarbonReact<any, any>;
|
|
31
|
+
static set instance(instance: CarbonReact<any, any>);
|
|
31
32
|
protected updateRestfulObjectArrays: <ObjectType extends {
|
|
32
33
|
[key: string]: any;
|
|
33
34
|
} = {}>(rest: Omit<iUpdateRestfulObjectArrays<ObjectType, S, P>, "instance">) => void;
|
|
@@ -6,7 +6,7 @@ export interface iAlertButtonOptions {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
color: "default" | "primary" | "secondary" | "inherit" | "danger" | "info" | "success" | "warning" | undefined;
|
|
8
8
|
}
|
|
9
|
-
export interface iAlert<P, S> {
|
|
9
|
+
export interface iAlert<P, S extends iCarbonReactState> {
|
|
10
10
|
title: string;
|
|
11
11
|
text: string;
|
|
12
12
|
instance: CarbonReact<P, S>;
|
|
@@ -22,7 +22,7 @@ export interface iAlert<P, S> {
|
|
|
22
22
|
[key: string]: any;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
export declare function addAlert<P, S extends
|
|
26
|
-
export default function Alert<P, S extends
|
|
25
|
+
export declare function addAlert<P, S extends iCarbonReactState>(props: iAlert<P, S>): void;
|
|
26
|
+
export default function Alert<P, S extends iCarbonReactState>({ instance }: {
|
|
27
27
|
instance: CarbonReact<P, S>;
|
|
28
28
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import CarbonReact, { iCarbonReactState } from "CarbonReact";
|
|
2
2
|
import { tC6Tables, tC6RestApi } from "@carbonorm/carbonnode";
|
|
3
|
-
export interface iCarbonWebSocketProps<P, S> {
|
|
3
|
+
export interface iCarbonWebSocketProps<P, S extends iCarbonReactState> {
|
|
4
4
|
url?: string;
|
|
5
5
|
timeoutSeconds?: number;
|
|
6
6
|
heartbeatSeconds?: number;
|
|
@@ -12,5 +12,5 @@ export interface iCarbonWebSocketProps<P, S> {
|
|
|
12
12
|
* @function connect
|
|
13
13
|
* This function establishes a connection with the websocket and also ensures constant reconnection if connection closes
|
|
14
14
|
**/
|
|
15
|
-
export declare function initiateWebsocket<P, S extends
|
|
16
|
-
export default function <P, S extends
|
|
15
|
+
export declare function initiateWebsocket<P, S extends iCarbonReactState>(props: iCarbonWebSocketProps<P, S>): void;
|
|
16
|
+
export default function <P, S extends iCarbonReactState>(props: iCarbonWebSocketProps<P, S>): null;
|
package/dist/index.cjs.js
CHANGED
|
@@ -4365,8 +4365,11 @@ class CarbonReact extends react.Component {
|
|
|
4365
4365
|
context = react.createContext(this.state);
|
|
4366
4366
|
target;
|
|
4367
4367
|
static _instance;
|
|
4368
|
+
static getInstance() {
|
|
4369
|
+
return this._instance;
|
|
4370
|
+
}
|
|
4368
4371
|
static get instance() {
|
|
4369
|
-
return this;
|
|
4372
|
+
return this.getInstance();
|
|
4370
4373
|
}
|
|
4371
4374
|
static set instance(instance) {
|
|
4372
4375
|
this._instance = instance;
|