@trackunit/react-core-hooks 0.2.135-alpha-bc5b0fcd90.0 → 0.2.135
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 +0 -28
- package/index.esm.js +1 -27
- package/package.json +1 -1
- package/src/index.d.ts +0 -1
- package/src/global-selection/GlobalSelectionProvider.d.ts +0 -25
package/index.cjs.js
CHANGED
|
@@ -150,32 +150,6 @@ const useFilterBarContext = () => {
|
|
|
150
150
|
*/
|
|
151
151
|
const FilterBarProvider = (props) => jsxRuntime.jsx(FilterBarContext.Provider, Object.assign({}, props));
|
|
152
152
|
|
|
153
|
-
const GlobalSelectionContext = React__namespace.createContext(null);
|
|
154
|
-
/**
|
|
155
|
-
* This is a hook to use the GlobalSelectionContext.
|
|
156
|
-
*
|
|
157
|
-
* @requires GlobalSelectionProvider
|
|
158
|
-
* @example
|
|
159
|
-
* import { useGlobalSelection } from "@trackunit/react-core-hooks";
|
|
160
|
-
*
|
|
161
|
-
* export const useActiveGlobalGroupIdFilter = () => {
|
|
162
|
-
* const { selection } = useGlobalSelection();
|
|
163
|
-
* return (selection?.type === "group") ? selection.groupId : undefined;
|
|
164
|
-
* };
|
|
165
|
-
* @see {@link IGlobalSelectionContext}
|
|
166
|
-
*/
|
|
167
|
-
const useGlobalSelection = () => {
|
|
168
|
-
const context = React__namespace.useContext(GlobalSelectionContext);
|
|
169
|
-
if (!context) {
|
|
170
|
-
throw new Error("useGlobalSelection must be used within the GlobalSelectionContext");
|
|
171
|
-
}
|
|
172
|
-
return context;
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* This is a provider for the GlobalSelectionContext.
|
|
176
|
-
*/
|
|
177
|
-
const GlobalSelectionProvider = (props) => jsxRuntime.jsx(GlobalSelectionContext.Provider, Object.assign({}, props));
|
|
178
|
-
|
|
179
153
|
const OemBrandingContext = React.createContext(null);
|
|
180
154
|
/**
|
|
181
155
|
* This is a hook to use the IOemBrandingContext.
|
|
@@ -660,7 +634,6 @@ exports.CurrentUserPreferenceProvider = CurrentUserPreferenceProvider;
|
|
|
660
634
|
exports.CurrentUserProvider = CurrentUserProvider;
|
|
661
635
|
exports.EnvironmentContextProvider = EnvironmentContextProvider;
|
|
662
636
|
exports.FilterBarProvider = FilterBarProvider;
|
|
663
|
-
exports.GlobalSelectionProvider = GlobalSelectionProvider;
|
|
664
637
|
exports.NavigationContextProvider = NavigationContextProvider;
|
|
665
638
|
exports.OemBrandingContextProvider = OemBrandingContextProvider;
|
|
666
639
|
exports.ToastProvider = ToastProvider;
|
|
@@ -678,7 +651,6 @@ exports.useCustomFieldRuntimeForEntity = useCustomFieldRuntimeForEntity;
|
|
|
678
651
|
exports.useEnvironment = useEnvironment;
|
|
679
652
|
exports.useEventRuntime = useEventRuntime;
|
|
680
653
|
exports.useFilterBarContext = useFilterBarContext;
|
|
681
|
-
exports.useGlobalSelection = useGlobalSelection;
|
|
682
654
|
exports.useHasAccessTo = useHasAccessTo;
|
|
683
655
|
exports.useNavigateInHost = useNavigateInHost;
|
|
684
656
|
exports.useOemBrandingContext = useOemBrandingContext;
|
package/index.esm.js
CHANGED
|
@@ -124,32 +124,6 @@ const useFilterBarContext = () => {
|
|
|
124
124
|
*/
|
|
125
125
|
const FilterBarProvider = (props) => jsx(FilterBarContext.Provider, Object.assign({}, props));
|
|
126
126
|
|
|
127
|
-
const GlobalSelectionContext = React.createContext(null);
|
|
128
|
-
/**
|
|
129
|
-
* This is a hook to use the GlobalSelectionContext.
|
|
130
|
-
*
|
|
131
|
-
* @requires GlobalSelectionProvider
|
|
132
|
-
* @example
|
|
133
|
-
* import { useGlobalSelection } from "@trackunit/react-core-hooks";
|
|
134
|
-
*
|
|
135
|
-
* export const useActiveGlobalGroupIdFilter = () => {
|
|
136
|
-
* const { selection } = useGlobalSelection();
|
|
137
|
-
* return (selection?.type === "group") ? selection.groupId : undefined;
|
|
138
|
-
* };
|
|
139
|
-
* @see {@link IGlobalSelectionContext}
|
|
140
|
-
*/
|
|
141
|
-
const useGlobalSelection = () => {
|
|
142
|
-
const context = React.useContext(GlobalSelectionContext);
|
|
143
|
-
if (!context) {
|
|
144
|
-
throw new Error("useGlobalSelection must be used within the GlobalSelectionContext");
|
|
145
|
-
}
|
|
146
|
-
return context;
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* This is a provider for the GlobalSelectionContext.
|
|
150
|
-
*/
|
|
151
|
-
const GlobalSelectionProvider = (props) => jsx(GlobalSelectionContext.Provider, Object.assign({}, props));
|
|
152
|
-
|
|
153
127
|
const OemBrandingContext = createContext(null);
|
|
154
128
|
/**
|
|
155
129
|
* This is a hook to use the IOemBrandingContext.
|
|
@@ -627,4 +601,4 @@ const useCurrentUser = () => {
|
|
|
627
601
|
return context;
|
|
628
602
|
};
|
|
629
603
|
|
|
630
|
-
export { AnalyticsContext, AnalyticsContextProvider, AssetSortingProvider, CurrentUserPreferenceProvider, CurrentUserProvider, EnvironmentContextProvider, FilterBarProvider,
|
|
604
|
+
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, useRestRuntime, useSiteRuntime, useTextSearch, useToast, useToken, useURLSynchronization, useUserSubscription };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from "./analytics/AnalyticsProvider";
|
|
|
2
2
|
export * from "./assetSorting/AssetSortingProvider";
|
|
3
3
|
export * from "./environment/EnvironmentContextProvider";
|
|
4
4
|
export * from "./filter-bar/FilterBarProvider";
|
|
5
|
-
export * from "./global-selection/GlobalSelectionProvider";
|
|
6
5
|
export * from "./irisOemApp/IrisOemAppContextProvider";
|
|
7
6
|
export * from "./navigation/NavigationContextProvider";
|
|
8
7
|
export * from "./navigation/useURLSynchronization";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { IGlobalSelectionContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/**
|
|
4
|
-
* This is a hook to use the GlobalSelectionContext.
|
|
5
|
-
*
|
|
6
|
-
* @requires GlobalSelectionProvider
|
|
7
|
-
* @example
|
|
8
|
-
* import { useGlobalSelection } from "@trackunit/react-core-hooks";
|
|
9
|
-
*
|
|
10
|
-
* export const useActiveGlobalGroupIdFilter = () => {
|
|
11
|
-
* const { selection } = useGlobalSelection();
|
|
12
|
-
* return (selection?.type === "group") ? selection.groupId : undefined;
|
|
13
|
-
* };
|
|
14
|
-
* @see {@link IGlobalSelectionContext}
|
|
15
|
-
*/
|
|
16
|
-
export declare const useGlobalSelection: () => IGlobalSelectionContext;
|
|
17
|
-
interface IProps {
|
|
18
|
-
value: IGlobalSelectionContext;
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* This is a provider for the GlobalSelectionContext.
|
|
23
|
-
*/
|
|
24
|
-
export declare const GlobalSelectionProvider: (props: IProps) => JSX.Element;
|
|
25
|
-
export {};
|