@trackunit/react-core-hooks 0.2.149 → 0.2.151
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/index.cjs.js
CHANGED
|
@@ -98,6 +98,22 @@ const useAssetSorting = () => {
|
|
|
98
98
|
return context;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
const ConfirmationDialogContext = React__namespace.createContext(null);
|
|
102
|
+
/**
|
|
103
|
+
* This is a provider for the ConfirmationDialogContext.
|
|
104
|
+
*/
|
|
105
|
+
const ConfirmationDialogProvider = (props) => (jsxRuntime.jsx(ConfirmationDialogContext.Provider, Object.assign({}, props)));
|
|
106
|
+
/**
|
|
107
|
+
* This is a hook to use the ConfirmationDialogContext.
|
|
108
|
+
*/
|
|
109
|
+
const useConfirmationDialog = () => {
|
|
110
|
+
const confirmationDialogContext = React__namespace.useContext(ConfirmationDialogContext);
|
|
111
|
+
if (!confirmationDialogContext) {
|
|
112
|
+
throw new Error("useConfirmationDialog must be used within the ConfirmationDialogProvider");
|
|
113
|
+
}
|
|
114
|
+
return confirmationDialogContext;
|
|
115
|
+
};
|
|
116
|
+
|
|
101
117
|
const EnvironmentContext = React.createContext(null);
|
|
102
118
|
/**
|
|
103
119
|
* This is a provider for the EnvironmentContext.
|
|
@@ -657,6 +673,7 @@ const useCurrentUser = () => {
|
|
|
657
673
|
exports.AnalyticsContext = AnalyticsContext;
|
|
658
674
|
exports.AnalyticsContextProvider = AnalyticsContextProvider;
|
|
659
675
|
exports.AssetSortingProvider = AssetSortingProvider;
|
|
676
|
+
exports.ConfirmationDialogProvider = ConfirmationDialogProvider;
|
|
660
677
|
exports.CurrentUserPreferenceProvider = CurrentUserPreferenceProvider;
|
|
661
678
|
exports.CurrentUserProvider = CurrentUserProvider;
|
|
662
679
|
exports.EnvironmentContextProvider = EnvironmentContextProvider;
|
|
@@ -669,6 +686,7 @@ exports.UserSubscriptionProvider = UserSubscriptionProvider;
|
|
|
669
686
|
exports.useAnalytics = useAnalytics;
|
|
670
687
|
exports.useAssetRuntime = useAssetRuntime;
|
|
671
688
|
exports.useAssetSorting = useAssetSorting;
|
|
689
|
+
exports.useConfirmationDialog = useConfirmationDialog;
|
|
672
690
|
exports.useCurrentUser = useCurrentUser;
|
|
673
691
|
exports.useCurrentUserLanguage = useCurrentUserLanguage;
|
|
674
692
|
exports.useCurrentUserSystemOfMeasurement = useCurrentUserSystemOfMeasurement;
|
package/index.esm.js
CHANGED
|
@@ -72,6 +72,22 @@ const useAssetSorting = () => {
|
|
|
72
72
|
return context;
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
const ConfirmationDialogContext = React.createContext(null);
|
|
76
|
+
/**
|
|
77
|
+
* This is a provider for the ConfirmationDialogContext.
|
|
78
|
+
*/
|
|
79
|
+
const ConfirmationDialogProvider = (props) => (jsx(ConfirmationDialogContext.Provider, Object.assign({}, props)));
|
|
80
|
+
/**
|
|
81
|
+
* This is a hook to use the ConfirmationDialogContext.
|
|
82
|
+
*/
|
|
83
|
+
const useConfirmationDialog = () => {
|
|
84
|
+
const confirmationDialogContext = React.useContext(ConfirmationDialogContext);
|
|
85
|
+
if (!confirmationDialogContext) {
|
|
86
|
+
throw new Error("useConfirmationDialog must be used within the ConfirmationDialogProvider");
|
|
87
|
+
}
|
|
88
|
+
return confirmationDialogContext;
|
|
89
|
+
};
|
|
90
|
+
|
|
75
91
|
const EnvironmentContext = createContext(null);
|
|
76
92
|
/**
|
|
77
93
|
* This is a provider for the EnvironmentContext.
|
|
@@ -628,4 +644,4 @@ const useCurrentUser = () => {
|
|
|
628
644
|
return context;
|
|
629
645
|
};
|
|
630
646
|
|
|
631
|
-
export { AnalyticsContext, AnalyticsContextProvider, AssetSortingProvider, CurrentUserPreferenceProvider, CurrentUserProvider, EnvironmentContextProvider, FilterBarProvider, NavigationContextProvider, OemBrandingContextProvider, ToastProvider, TokenProvider, UserSubscriptionProvider, useAnalytics, useAssetRuntime, useAssetSorting, useCurrentUser, useCurrentUserLanguage, useCurrentUserSystemOfMeasurement, useCurrentUserTimeZonePreference, useCustomFieldRuntime, useCustomFieldRuntimeForEntity, useEnvironment, useEventRuntime, useFilterBarContext, useHasAccessTo, useNavigateInHost, useOemBrandingContext, useSiteRuntime, useTextSearch, useToast, useToken, useURLSynchronization, useUserSubscription };
|
|
647
|
+
export { AnalyticsContext, AnalyticsContextProvider, AssetSortingProvider, ConfirmationDialogProvider, CurrentUserPreferenceProvider, CurrentUserProvider, EnvironmentContextProvider, FilterBarProvider, NavigationContextProvider, OemBrandingContextProvider, ToastProvider, TokenProvider, UserSubscriptionProvider, useAnalytics, useAssetRuntime, useAssetSorting, useConfirmationDialog, useCurrentUser, useCurrentUserLanguage, useCurrentUserSystemOfMeasurement, useCurrentUserTimeZonePreference, useCustomFieldRuntime, useCustomFieldRuntimeForEntity, useEnvironment, useEventRuntime, useFilterBarContext, useHasAccessTo, useNavigateInHost, useOemBrandingContext, useSiteRuntime, useTextSearch, useToast, useToken, useURLSynchronization, useUserSubscription };
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ConfirmationDialogContextValue } from "@trackunit/react-core-contexts-api";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface ConfirmationDialogContextProviderProps {
|
|
4
|
+
value: ConfirmationDialogContextValue;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This is a provider for the ConfirmationDialogContext.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ConfirmationDialogProvider: (props: ConfirmationDialogContextProviderProps) => JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* This is a hook to use the ConfirmationDialogContext.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useConfirmationDialog: () => ConfirmationDialogContextValue;
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./analytics/AnalyticsProvider";
|
|
2
2
|
export * from "./assetSorting/AssetSortingProvider";
|
|
3
|
+
export * from "./confirmationDialog/ConfirmationDialogProvider";
|
|
3
4
|
export * from "./environment/EnvironmentContextProvider";
|
|
4
5
|
export * from "./filter-bar/FilterBarProvider";
|
|
5
6
|
export * from "./irisOemApp/IrisOemAppContextProvider";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IToastContext } from "@trackunit/react-core-contexts-api";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface ToastContextProviderProps {
|
|
4
4
|
value: IToastContext;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* This is a provider for the ToastContext.
|
|
9
9
|
*/
|
|
10
|
-
export declare const ToastProvider: (props:
|
|
10
|
+
export declare const ToastProvider: (props: ToastContextProviderProps) => JSX.Element;
|
|
11
11
|
/**
|
|
12
12
|
* This is a hook to use the ToastContext.
|
|
13
13
|
*
|