@trackunit/react-core-contexts-api 1.8.75 → 1.8.79
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/README.md +3 -6
- package/index.cjs.js +136 -147
- package/index.esm.js +102 -138
- package/package.json +4 -6
- package/src/analytics/AnalyticsContext.d.ts +3 -0
- package/src/assetSorting/AssetSortingContext.d.ts +7 -0
- package/src/confirmationDialog/ConfirmationDialogContext.d.ts +12 -0
- package/src/environment/EnvironmentContext.d.ts +12 -0
- package/src/errorHandling/ErrorHandlingContext.d.ts +3 -0
- package/src/exportData/ExportDataContext.d.ts +3 -0
- package/src/featureFlags/FeatureFlagContext.d.ts +13 -0
- package/src/filterBar/FilterBarContext.d.ts +12 -0
- package/src/index.d.ts +18 -16
- package/src/modalDialog/ModalDialogContext.d.ts +12 -0
- package/src/navigation/NavigationContext.d.ts +12 -0
- package/src/oemBranding/OemBrandingContext.d.ts +12 -0
- package/src/subscription/UserSubscriptionContext.d.ts +12 -0
- package/src/timeRange/TimeRangeContext.d.ts +12 -0
- package/src/toast/ToastContext.d.ts +12 -0
- package/src/token/TokenContext.d.ts +12 -0
- package/src/user/CurrentUserContext.d.ts +12 -0
- package/src/user/CurrentUserPreferenceContext.d.ts +12 -0
- package/src/widgetConfig/WidgetConfigContext.d.ts +12 -0
- package/src/IUserPreferencesContext.d.ts +0 -24
- package/src/analyticsContext.d.ts +0 -79
- package/src/assetSortingContext.d.ts +0 -52
- package/src/confirmationDialogContext.d.ts +0 -32
- package/src/currentUserContext.d.ts +0 -62
- package/src/environmentContext.d.ts +0 -33
- package/src/errorHandlingContext.d.ts +0 -26
- package/src/filterBarContext.d.ts +0 -37
- package/src/modalDialogContext.d.ts +0 -13
- package/src/navigationContext.d.ts +0 -81
- package/src/oemBrandingContext.d.ts +0 -36
- package/src/timeRangeContext.d.ts +0 -34
- package/src/toastContext.d.ts +0 -53
- package/src/tokenContext.d.ts +0 -6
- package/src/userSubscriptionContext.d.ts +0 -51
- package/src/widgetConfigContext.d.ts +0 -61
package/README.md
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
#
|
|
2
|
-
The `@trackunit/react-core-contexts-api` package is a small package containing reusable types for the Trackunit Iris App SDK.
|
|
1
|
+
# core-contexts-api
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
This library contains providers
|
|
5
4
|
|
|
6
5
|
For more info and a full guide on Iris App SDK Development, please visit our [Developer Hub](https://developers.trackunit.com/).
|
|
7
|
-
## Basic Usage
|
|
8
|
-
This package is not meant for isolated usage but is a part of the [`@trackunit/iris-app`](https://www.npmjs.com/package/@trackunit/iris-app) package.
|
|
9
6
|
|
|
10
7
|
## Trackunit
|
|
11
8
|
This package was developed by Trackunit ApS.
|
|
12
9
|
Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.
|
|
13
10
|
|
|
14
|
-

|
|
11
|
+

|
package/index.cjs.js
CHANGED
|
@@ -1,165 +1,154 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
|
|
6
|
+
const AnalyticsContext = react.createContext(null);
|
|
7
|
+
const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
|
|
8
|
+
|
|
9
|
+
const AssetSortingContext = react.createContext(null);
|
|
5
10
|
/**
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
11
|
+
* This is a provider for the AssetSortingContext.
|
|
12
|
+
*/
|
|
13
|
+
const AssetSortingProvider = AssetSortingContext.Provider;
|
|
14
|
+
|
|
15
|
+
const ConfirmationDialogContext = react.createContext(null);
|
|
16
|
+
/**
|
|
17
|
+
* This is a provider for the ConfirmationDialogContext.
|
|
18
|
+
*/
|
|
19
|
+
const ConfirmationDialogProvider = (props) => (jsxRuntime.jsx(ConfirmationDialogContext.Provider, { ...props }));
|
|
20
|
+
|
|
21
|
+
const EnvironmentContext = react.createContext(null);
|
|
22
|
+
/**
|
|
23
|
+
* This is a provider for the EnvironmentContext.
|
|
24
|
+
*/
|
|
25
|
+
const EnvironmentContextProvider = (props) => {
|
|
26
|
+
return jsxRuntime.jsx(EnvironmentContext.Provider, { ...props });
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const ErrorHandlingContext = react.createContext(null);
|
|
30
|
+
const ErrorHandlingContextProvider = ErrorHandlingContext.Provider; // easy import
|
|
31
|
+
|
|
32
|
+
const ExportDataContext = react.createContext(undefined);
|
|
33
|
+
|
|
34
|
+
const FeatureFlagContext = react.createContext(null);
|
|
35
|
+
/**
|
|
36
|
+
* This is a provider for the FeatureFlagContext.
|
|
13
37
|
*/
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
properties: {},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
exports.AssetSortByProperty = void 0;
|
|
20
|
-
(function (AssetSortByProperty) {
|
|
21
|
-
AssetSortByProperty["Activity"] = "ACTIVITY";
|
|
22
|
-
AssetSortByProperty["Brand"] = "BRAND";
|
|
23
|
-
AssetSortByProperty["Category"] = "CATEGORY";
|
|
24
|
-
AssetSortByProperty["Criticality"] = "CRITICALITY";
|
|
25
|
-
AssetSortByProperty["CustomField"] = "CUSTOM_FIELD";
|
|
26
|
-
AssetSortByProperty["CustomerName"] = "CUSTOMER_NAME";
|
|
27
|
-
AssetSortByProperty["AccessManagement"] = "ACCESS_MANAGEMENT";
|
|
28
|
-
AssetSortByProperty["ExternalReference"] = "EXTERNAL_REFERENCE";
|
|
29
|
-
AssetSortByProperty["Location"] = "LOCATION";
|
|
30
|
-
AssetSortByProperty["LocationUpdatedAt"] = "LOCATION_UPDATED_AT";
|
|
31
|
-
AssetSortByProperty["Model"] = "MODEL";
|
|
32
|
-
AssetSortByProperty["Name"] = "NAME";
|
|
33
|
-
AssetSortByProperty["OwnerAccountName"] = "OWNER_ACCOUNT_NAME";
|
|
34
|
-
AssetSortByProperty["ProductionYear"] = "PRODUCTION_YEAR";
|
|
35
|
-
AssetSortByProperty["SerialNumber"] = "SERIAL_NUMBER";
|
|
36
|
-
AssetSortByProperty["ServicePlanAssignmentStatus"] = "SERVICE_PLAN_ASSIGNMENT_STATUS";
|
|
37
|
-
AssetSortByProperty["ServicePlanOverdueness"] = "SERVICE_PLAN_OVERDUENESS";
|
|
38
|
-
AssetSortByProperty["ServicePlanStatus"] = "SERVICE_PLAN_STATUS";
|
|
39
|
-
AssetSortByProperty["TelematicsDeviceSerialNumber"] = "TELEMATICS_DEVICE_SERIAL_NUMBER";
|
|
40
|
-
AssetSortByProperty["Type"] = "TYPE";
|
|
41
|
-
AssetSortByProperty["PlannedServiceBooked"] = "PLANNED_SERVICE_BOOKED";
|
|
42
|
-
AssetSortByProperty["PlannedServiceBookingDate"] = "PLANNED_SERVICE_BOOKING_DATE";
|
|
43
|
-
AssetSortByProperty["ServicePlanPrediction"] = "SERVICE_PLAN_PREDICTION";
|
|
44
|
-
AssetSortByProperty["IssueCreatedAt"] = "ISSUE_CREATED_AT";
|
|
45
|
-
})(exports.AssetSortByProperty || (exports.AssetSortByProperty = {}));
|
|
46
|
-
// The type [key in AssetSortByProperty] will ensure that ALL keys are present
|
|
47
|
-
const stringToEnum = {
|
|
48
|
-
ACTIVITY: exports.AssetSortByProperty.Activity,
|
|
49
|
-
BRAND: exports.AssetSortByProperty.Brand,
|
|
50
|
-
CATEGORY: exports.AssetSortByProperty.Category,
|
|
51
|
-
CUSTOM_FIELD: exports.AssetSortByProperty.CustomField,
|
|
52
|
-
CRITICALITY: exports.AssetSortByProperty.Criticality,
|
|
53
|
-
CUSTOMER_NAME: exports.AssetSortByProperty.CustomerName,
|
|
54
|
-
ACCESS_MANAGEMENT: exports.AssetSortByProperty.AccessManagement,
|
|
55
|
-
EXTERNAL_REFERENCE: exports.AssetSortByProperty.ExternalReference,
|
|
56
|
-
LOCATION: exports.AssetSortByProperty.Location,
|
|
57
|
-
LOCATION_UPDATED_AT: exports.AssetSortByProperty.LocationUpdatedAt,
|
|
58
|
-
MODEL: exports.AssetSortByProperty.Model,
|
|
59
|
-
NAME: exports.AssetSortByProperty.Name,
|
|
60
|
-
OWNER_ACCOUNT_NAME: exports.AssetSortByProperty.OwnerAccountName,
|
|
61
|
-
PRODUCTION_YEAR: exports.AssetSortByProperty.ProductionYear,
|
|
62
|
-
SERIAL_NUMBER: exports.AssetSortByProperty.SerialNumber,
|
|
63
|
-
SERVICE_PLAN_ASSIGNMENT_STATUS: exports.AssetSortByProperty.ServicePlanAssignmentStatus,
|
|
64
|
-
SERVICE_PLAN_OVERDUENESS: exports.AssetSortByProperty.ServicePlanOverdueness,
|
|
65
|
-
SERVICE_PLAN_STATUS: exports.AssetSortByProperty.ServicePlanStatus,
|
|
66
|
-
TELEMATICS_DEVICE_SERIAL_NUMBER: exports.AssetSortByProperty.TelematicsDeviceSerialNumber,
|
|
67
|
-
TYPE: exports.AssetSortByProperty.Type,
|
|
68
|
-
PLANNED_SERVICE_BOOKED: exports.AssetSortByProperty.PlannedServiceBooked,
|
|
69
|
-
PLANNED_SERVICE_BOOKING_DATE: exports.AssetSortByProperty.PlannedServiceBookingDate,
|
|
70
|
-
SERVICE_PLAN_PREDICTION: exports.AssetSortByProperty.ServicePlanPrediction,
|
|
71
|
-
ISSUE_CREATED_AT: exports.AssetSortByProperty.IssueCreatedAt,
|
|
38
|
+
const FeatureFlagContextProvider = (props) => {
|
|
39
|
+
return jsxRuntime.jsx(FeatureFlagContext.Provider, { ...props });
|
|
72
40
|
};
|
|
41
|
+
|
|
42
|
+
const FilterBarContext = react.createContext(null);
|
|
73
43
|
/**
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
44
|
+
* This is a provider for the FilterBarContext.
|
|
45
|
+
*/
|
|
46
|
+
const FilterBarProvider = (props) => jsxRuntime.jsx(FilterBarContext.Provider, { ...props });
|
|
47
|
+
|
|
48
|
+
const ModalDialogContext = react.createContext(null);
|
|
49
|
+
/**
|
|
50
|
+
* This is a provider for the ModalDialogContext.
|
|
51
|
+
*/
|
|
52
|
+
const ModalDialogContextProvider = (props) => (jsxRuntime.jsx(ModalDialogContext.Provider, { ...props }));
|
|
53
|
+
|
|
54
|
+
const NavigationContext = react.createContext(null);
|
|
55
|
+
/**
|
|
56
|
+
* This is a provider for the NavigationContext.
|
|
78
57
|
*/
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
if (!input) {
|
|
82
|
-
return { sortBy: fallback };
|
|
83
|
-
}
|
|
84
|
-
// Try to get the enum value from the string. -> Fallback to the default
|
|
85
|
-
if (sharedUtils.isUUID(input)) {
|
|
86
|
-
return {
|
|
87
|
-
sortBy: exports.AssetSortByProperty.CustomField,
|
|
88
|
-
customFieldDefinitionId: input,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return { sortBy: stringToEnum[input] ?? fallback };
|
|
58
|
+
const NavigationContextProvider = (props) => {
|
|
59
|
+
return jsxRuntime.jsx(NavigationContext.Provider, { ...props });
|
|
92
60
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Si: "SI",
|
|
101
|
-
UsCustomary: "US_CUSTOMARY",
|
|
61
|
+
|
|
62
|
+
const OEMBrandingService = react.createContext(null);
|
|
63
|
+
/**
|
|
64
|
+
* This is a provider for the OemBrandingContext.
|
|
65
|
+
*/
|
|
66
|
+
const OemBrandingContextProvider = (props) => {
|
|
67
|
+
return jsxRuntime.jsx(OEMBrandingService.Provider, { ...props });
|
|
102
68
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
69
|
+
|
|
70
|
+
const UserSubscriptionContext = react.createContext(null);
|
|
71
|
+
/**
|
|
72
|
+
* This is a provider for the UserSubscriptionContext.
|
|
73
|
+
*/
|
|
74
|
+
const UserSubscriptionProvider = (props) => {
|
|
75
|
+
return jsxRuntime.jsx(UserSubscriptionContext.Provider, { ...props });
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const TimeRangeContext = react.createContext(null);
|
|
79
|
+
/**
|
|
80
|
+
* This is a provider for the TimeRangeContext.
|
|
81
|
+
*/
|
|
82
|
+
const TimeRangeProvider = (props) => jsxRuntime.jsx(TimeRangeContext.Provider, { ...props });
|
|
83
|
+
|
|
84
|
+
const ToastContext = react.createContext(null);
|
|
85
|
+
/**
|
|
86
|
+
* This is a provider for the ToastContext.
|
|
87
|
+
*/
|
|
88
|
+
const ToastProvider = (props) => jsxRuntime.jsx(ToastContext.Provider, { ...props });
|
|
89
|
+
|
|
90
|
+
const TokenContext = react.createContext(null);
|
|
91
|
+
/**
|
|
92
|
+
* This is a provider for the TokenContext.
|
|
93
|
+
*/
|
|
94
|
+
const TokenProvider = (props) => {
|
|
95
|
+
return jsxRuntime.jsx(TokenContext.Provider, { ...props });
|
|
107
96
|
};
|
|
108
97
|
|
|
109
|
-
|
|
110
|
-
const assetHomePageIds = [
|
|
111
|
-
"status",
|
|
112
|
-
"movement",
|
|
113
|
-
"events",
|
|
114
|
-
"insights",
|
|
115
|
-
"specification",
|
|
116
|
-
"telematics",
|
|
117
|
-
"contracts",
|
|
118
|
-
];
|
|
119
|
-
const siteHomePageIds = ["overview", "assets", "asset-visibility"];
|
|
120
|
-
const groupHomePageIds = ["assets", "users", "details"];
|
|
121
|
-
const customerHomePageIds = ["info", "assets", "contact-list"];
|
|
98
|
+
const CurrentUserContext = react.createContext(null);
|
|
122
99
|
/**
|
|
123
|
-
*
|
|
100
|
+
* This is a provider for the CurrentUserContext.
|
|
124
101
|
*/
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
return (typeof options === "object" &&
|
|
130
|
-
"irisAppId" in options &&
|
|
131
|
-
Boolean(options.irisAppId) &&
|
|
132
|
-
"extensionId" in options);
|
|
102
|
+
const CurrentUserProvider = (props) => {
|
|
103
|
+
return jsxRuntime.jsx(CurrentUserContext.Provider, { ...props });
|
|
133
104
|
};
|
|
134
105
|
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
EVOLVE_OEM: "Evolve (OEM)",
|
|
142
|
-
EXPAND_OEM: "Expand (OEM)",
|
|
143
|
-
COLLECT: "COLLECT",
|
|
144
|
-
INSIGHT: "INSIGHT",
|
|
145
|
-
VIEW: "VIEW",
|
|
146
|
-
NONE: "NONE",
|
|
147
|
-
EXPLORE: "Explore",
|
|
148
|
-
EVOLVE: "Evolve",
|
|
149
|
-
EXPAND: "Expand",
|
|
150
|
-
LINK: "Link",
|
|
151
|
-
LIFT: "Lift",
|
|
152
|
-
LEAP: "Leap",
|
|
153
|
-
CUSTOMER_PORTAL: "Customer Portal",
|
|
106
|
+
const CurrentUserPreferenceContext = react.createContext(null);
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
*/
|
|
110
|
+
const CurrentUserPreferenceProvider = (props) => {
|
|
111
|
+
return jsxRuntime.jsx(CurrentUserPreferenceContext.Provider, { ...props });
|
|
154
112
|
};
|
|
155
113
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
exports.
|
|
163
|
-
exports.
|
|
164
|
-
exports.
|
|
165
|
-
exports.
|
|
114
|
+
const WidgetConfigContext = react.createContext(null);
|
|
115
|
+
/**
|
|
116
|
+
* This is a provider for the WidgetConfigContext.
|
|
117
|
+
*/
|
|
118
|
+
const WidgetConfigProvider = (props) => jsxRuntime.jsx(WidgetConfigContext.Provider, { ...props });
|
|
119
|
+
|
|
120
|
+
exports.AnalyticsContext = AnalyticsContext;
|
|
121
|
+
exports.AnalyticsContextProvider = AnalyticsContextProvider;
|
|
122
|
+
exports.AssetSortingContext = AssetSortingContext;
|
|
123
|
+
exports.AssetSortingProvider = AssetSortingProvider;
|
|
124
|
+
exports.ConfirmationDialogContext = ConfirmationDialogContext;
|
|
125
|
+
exports.ConfirmationDialogProvider = ConfirmationDialogProvider;
|
|
126
|
+
exports.CurrentUserContext = CurrentUserContext;
|
|
127
|
+
exports.CurrentUserPreferenceContext = CurrentUserPreferenceContext;
|
|
128
|
+
exports.CurrentUserPreferenceProvider = CurrentUserPreferenceProvider;
|
|
129
|
+
exports.CurrentUserProvider = CurrentUserProvider;
|
|
130
|
+
exports.EnvironmentContext = EnvironmentContext;
|
|
131
|
+
exports.EnvironmentContextProvider = EnvironmentContextProvider;
|
|
132
|
+
exports.ErrorHandlingContext = ErrorHandlingContext;
|
|
133
|
+
exports.ErrorHandlingContextProvider = ErrorHandlingContextProvider;
|
|
134
|
+
exports.ExportDataContext = ExportDataContext;
|
|
135
|
+
exports.FeatureFlagContext = FeatureFlagContext;
|
|
136
|
+
exports.FeatureFlagContextProvider = FeatureFlagContextProvider;
|
|
137
|
+
exports.FilterBarContext = FilterBarContext;
|
|
138
|
+
exports.FilterBarProvider = FilterBarProvider;
|
|
139
|
+
exports.ModalDialogContext = ModalDialogContext;
|
|
140
|
+
exports.ModalDialogContextProvider = ModalDialogContextProvider;
|
|
141
|
+
exports.NavigationContext = NavigationContext;
|
|
142
|
+
exports.NavigationContextProvider = NavigationContextProvider;
|
|
143
|
+
exports.OemBrandingContext = OEMBrandingService;
|
|
144
|
+
exports.OemBrandingContextProvider = OemBrandingContextProvider;
|
|
145
|
+
exports.TimeRangeContext = TimeRangeContext;
|
|
146
|
+
exports.TimeRangeProvider = TimeRangeProvider;
|
|
147
|
+
exports.ToastContext = ToastContext;
|
|
148
|
+
exports.ToastProvider = ToastProvider;
|
|
149
|
+
exports.TokenContext = TokenContext;
|
|
150
|
+
exports.TokenProvider = TokenProvider;
|
|
151
|
+
exports.UserSubscriptionContext = UserSubscriptionContext;
|
|
152
|
+
exports.UserSubscriptionProvider = UserSubscriptionProvider;
|
|
153
|
+
exports.WidgetConfigContext = WidgetConfigContext;
|
|
154
|
+
exports.WidgetConfigProvider = WidgetConfigProvider;
|
package/index.esm.js
CHANGED
|
@@ -1,154 +1,118 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
|
|
4
|
+
const AnalyticsContext = createContext(null);
|
|
5
|
+
const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
|
|
6
|
+
|
|
7
|
+
const AssetSortingContext = createContext(null);
|
|
3
8
|
/**
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
9
|
+
* This is a provider for the AssetSortingContext.
|
|
10
|
+
*/
|
|
11
|
+
const AssetSortingProvider = AssetSortingContext.Provider;
|
|
12
|
+
|
|
13
|
+
const ConfirmationDialogContext = createContext(null);
|
|
14
|
+
/**
|
|
15
|
+
* This is a provider for the ConfirmationDialogContext.
|
|
16
|
+
*/
|
|
17
|
+
const ConfirmationDialogProvider = (props) => (jsx(ConfirmationDialogContext.Provider, { ...props }));
|
|
18
|
+
|
|
19
|
+
const EnvironmentContext = createContext(null);
|
|
20
|
+
/**
|
|
21
|
+
* This is a provider for the EnvironmentContext.
|
|
22
|
+
*/
|
|
23
|
+
const EnvironmentContextProvider = (props) => {
|
|
24
|
+
return jsx(EnvironmentContext.Provider, { ...props });
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const ErrorHandlingContext = createContext(null);
|
|
28
|
+
const ErrorHandlingContextProvider = ErrorHandlingContext.Provider; // easy import
|
|
29
|
+
|
|
30
|
+
const ExportDataContext = createContext(undefined);
|
|
31
|
+
|
|
32
|
+
const FeatureFlagContext = createContext(null);
|
|
33
|
+
/**
|
|
34
|
+
* This is a provider for the FeatureFlagContext.
|
|
11
35
|
*/
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
properties: {},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
var AssetSortByProperty;
|
|
18
|
-
(function (AssetSortByProperty) {
|
|
19
|
-
AssetSortByProperty["Activity"] = "ACTIVITY";
|
|
20
|
-
AssetSortByProperty["Brand"] = "BRAND";
|
|
21
|
-
AssetSortByProperty["Category"] = "CATEGORY";
|
|
22
|
-
AssetSortByProperty["Criticality"] = "CRITICALITY";
|
|
23
|
-
AssetSortByProperty["CustomField"] = "CUSTOM_FIELD";
|
|
24
|
-
AssetSortByProperty["CustomerName"] = "CUSTOMER_NAME";
|
|
25
|
-
AssetSortByProperty["AccessManagement"] = "ACCESS_MANAGEMENT";
|
|
26
|
-
AssetSortByProperty["ExternalReference"] = "EXTERNAL_REFERENCE";
|
|
27
|
-
AssetSortByProperty["Location"] = "LOCATION";
|
|
28
|
-
AssetSortByProperty["LocationUpdatedAt"] = "LOCATION_UPDATED_AT";
|
|
29
|
-
AssetSortByProperty["Model"] = "MODEL";
|
|
30
|
-
AssetSortByProperty["Name"] = "NAME";
|
|
31
|
-
AssetSortByProperty["OwnerAccountName"] = "OWNER_ACCOUNT_NAME";
|
|
32
|
-
AssetSortByProperty["ProductionYear"] = "PRODUCTION_YEAR";
|
|
33
|
-
AssetSortByProperty["SerialNumber"] = "SERIAL_NUMBER";
|
|
34
|
-
AssetSortByProperty["ServicePlanAssignmentStatus"] = "SERVICE_PLAN_ASSIGNMENT_STATUS";
|
|
35
|
-
AssetSortByProperty["ServicePlanOverdueness"] = "SERVICE_PLAN_OVERDUENESS";
|
|
36
|
-
AssetSortByProperty["ServicePlanStatus"] = "SERVICE_PLAN_STATUS";
|
|
37
|
-
AssetSortByProperty["TelematicsDeviceSerialNumber"] = "TELEMATICS_DEVICE_SERIAL_NUMBER";
|
|
38
|
-
AssetSortByProperty["Type"] = "TYPE";
|
|
39
|
-
AssetSortByProperty["PlannedServiceBooked"] = "PLANNED_SERVICE_BOOKED";
|
|
40
|
-
AssetSortByProperty["PlannedServiceBookingDate"] = "PLANNED_SERVICE_BOOKING_DATE";
|
|
41
|
-
AssetSortByProperty["ServicePlanPrediction"] = "SERVICE_PLAN_PREDICTION";
|
|
42
|
-
AssetSortByProperty["IssueCreatedAt"] = "ISSUE_CREATED_AT";
|
|
43
|
-
})(AssetSortByProperty || (AssetSortByProperty = {}));
|
|
44
|
-
// The type [key in AssetSortByProperty] will ensure that ALL keys are present
|
|
45
|
-
const stringToEnum = {
|
|
46
|
-
ACTIVITY: AssetSortByProperty.Activity,
|
|
47
|
-
BRAND: AssetSortByProperty.Brand,
|
|
48
|
-
CATEGORY: AssetSortByProperty.Category,
|
|
49
|
-
CUSTOM_FIELD: AssetSortByProperty.CustomField,
|
|
50
|
-
CRITICALITY: AssetSortByProperty.Criticality,
|
|
51
|
-
CUSTOMER_NAME: AssetSortByProperty.CustomerName,
|
|
52
|
-
ACCESS_MANAGEMENT: AssetSortByProperty.AccessManagement,
|
|
53
|
-
EXTERNAL_REFERENCE: AssetSortByProperty.ExternalReference,
|
|
54
|
-
LOCATION: AssetSortByProperty.Location,
|
|
55
|
-
LOCATION_UPDATED_AT: AssetSortByProperty.LocationUpdatedAt,
|
|
56
|
-
MODEL: AssetSortByProperty.Model,
|
|
57
|
-
NAME: AssetSortByProperty.Name,
|
|
58
|
-
OWNER_ACCOUNT_NAME: AssetSortByProperty.OwnerAccountName,
|
|
59
|
-
PRODUCTION_YEAR: AssetSortByProperty.ProductionYear,
|
|
60
|
-
SERIAL_NUMBER: AssetSortByProperty.SerialNumber,
|
|
61
|
-
SERVICE_PLAN_ASSIGNMENT_STATUS: AssetSortByProperty.ServicePlanAssignmentStatus,
|
|
62
|
-
SERVICE_PLAN_OVERDUENESS: AssetSortByProperty.ServicePlanOverdueness,
|
|
63
|
-
SERVICE_PLAN_STATUS: AssetSortByProperty.ServicePlanStatus,
|
|
64
|
-
TELEMATICS_DEVICE_SERIAL_NUMBER: AssetSortByProperty.TelematicsDeviceSerialNumber,
|
|
65
|
-
TYPE: AssetSortByProperty.Type,
|
|
66
|
-
PLANNED_SERVICE_BOOKED: AssetSortByProperty.PlannedServiceBooked,
|
|
67
|
-
PLANNED_SERVICE_BOOKING_DATE: AssetSortByProperty.PlannedServiceBookingDate,
|
|
68
|
-
SERVICE_PLAN_PREDICTION: AssetSortByProperty.ServicePlanPrediction,
|
|
69
|
-
ISSUE_CREATED_AT: AssetSortByProperty.IssueCreatedAt,
|
|
36
|
+
const FeatureFlagContextProvider = (props) => {
|
|
37
|
+
return jsx(FeatureFlagContext.Provider, { ...props });
|
|
70
38
|
};
|
|
39
|
+
|
|
40
|
+
const FilterBarContext = createContext(null);
|
|
71
41
|
/**
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
42
|
+
* This is a provider for the FilterBarContext.
|
|
43
|
+
*/
|
|
44
|
+
const FilterBarProvider = (props) => jsx(FilterBarContext.Provider, { ...props });
|
|
45
|
+
|
|
46
|
+
const ModalDialogContext = createContext(null);
|
|
47
|
+
/**
|
|
48
|
+
* This is a provider for the ModalDialogContext.
|
|
49
|
+
*/
|
|
50
|
+
const ModalDialogContextProvider = (props) => (jsx(ModalDialogContext.Provider, { ...props }));
|
|
51
|
+
|
|
52
|
+
const NavigationContext = createContext(null);
|
|
53
|
+
/**
|
|
54
|
+
* This is a provider for the NavigationContext.
|
|
76
55
|
*/
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
if (!input) {
|
|
80
|
-
return { sortBy: fallback };
|
|
81
|
-
}
|
|
82
|
-
// Try to get the enum value from the string. -> Fallback to the default
|
|
83
|
-
if (isUUID(input)) {
|
|
84
|
-
return {
|
|
85
|
-
sortBy: AssetSortByProperty.CustomField,
|
|
86
|
-
customFieldDefinitionId: input,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
return { sortBy: stringToEnum[input] ?? fallback };
|
|
56
|
+
const NavigationContextProvider = (props) => {
|
|
57
|
+
return jsx(NavigationContext.Provider, { ...props });
|
|
90
58
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Si: "SI",
|
|
99
|
-
UsCustomary: "US_CUSTOMARY",
|
|
59
|
+
|
|
60
|
+
const OEMBrandingService = createContext(null);
|
|
61
|
+
/**
|
|
62
|
+
* This is a provider for the OemBrandingContext.
|
|
63
|
+
*/
|
|
64
|
+
const OemBrandingContextProvider = (props) => {
|
|
65
|
+
return jsx(OEMBrandingService.Provider, { ...props });
|
|
100
66
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
67
|
+
|
|
68
|
+
const UserSubscriptionContext = createContext(null);
|
|
69
|
+
/**
|
|
70
|
+
* This is a provider for the UserSubscriptionContext.
|
|
71
|
+
*/
|
|
72
|
+
const UserSubscriptionProvider = (props) => {
|
|
73
|
+
return jsx(UserSubscriptionContext.Provider, { ...props });
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const TimeRangeContext = createContext(null);
|
|
77
|
+
/**
|
|
78
|
+
* This is a provider for the TimeRangeContext.
|
|
79
|
+
*/
|
|
80
|
+
const TimeRangeProvider = (props) => jsx(TimeRangeContext.Provider, { ...props });
|
|
81
|
+
|
|
82
|
+
const ToastContext = createContext(null);
|
|
83
|
+
/**
|
|
84
|
+
* This is a provider for the ToastContext.
|
|
85
|
+
*/
|
|
86
|
+
const ToastProvider = (props) => jsx(ToastContext.Provider, { ...props });
|
|
87
|
+
|
|
88
|
+
const TokenContext = createContext(null);
|
|
89
|
+
/**
|
|
90
|
+
* This is a provider for the TokenContext.
|
|
91
|
+
*/
|
|
92
|
+
const TokenProvider = (props) => {
|
|
93
|
+
return jsx(TokenContext.Provider, { ...props });
|
|
105
94
|
};
|
|
106
95
|
|
|
107
|
-
|
|
108
|
-
const assetHomePageIds = [
|
|
109
|
-
"status",
|
|
110
|
-
"movement",
|
|
111
|
-
"events",
|
|
112
|
-
"insights",
|
|
113
|
-
"specification",
|
|
114
|
-
"telematics",
|
|
115
|
-
"contracts",
|
|
116
|
-
];
|
|
117
|
-
const siteHomePageIds = ["overview", "assets", "asset-visibility"];
|
|
118
|
-
const groupHomePageIds = ["assets", "users", "details"];
|
|
119
|
-
const customerHomePageIds = ["info", "assets", "contact-list"];
|
|
96
|
+
const CurrentUserContext = createContext(null);
|
|
120
97
|
/**
|
|
121
|
-
*
|
|
98
|
+
* This is a provider for the CurrentUserContext.
|
|
122
99
|
*/
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
return (typeof options === "object" &&
|
|
128
|
-
"irisAppId" in options &&
|
|
129
|
-
Boolean(options.irisAppId) &&
|
|
130
|
-
"extensionId" in options);
|
|
100
|
+
const CurrentUserProvider = (props) => {
|
|
101
|
+
return jsx(CurrentUserContext.Provider, { ...props });
|
|
131
102
|
};
|
|
132
103
|
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
EVOLVE_OEM: "Evolve (OEM)",
|
|
140
|
-
EXPAND_OEM: "Expand (OEM)",
|
|
141
|
-
COLLECT: "COLLECT",
|
|
142
|
-
INSIGHT: "INSIGHT",
|
|
143
|
-
VIEW: "VIEW",
|
|
144
|
-
NONE: "NONE",
|
|
145
|
-
EXPLORE: "Explore",
|
|
146
|
-
EVOLVE: "Evolve",
|
|
147
|
-
EXPAND: "Expand",
|
|
148
|
-
LINK: "Link",
|
|
149
|
-
LIFT: "Lift",
|
|
150
|
-
LEAP: "Leap",
|
|
151
|
-
CUSTOMER_PORTAL: "Customer Portal",
|
|
104
|
+
const CurrentUserPreferenceContext = createContext(null);
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
const CurrentUserPreferenceProvider = (props) => {
|
|
109
|
+
return jsx(CurrentUserPreferenceContext.Provider, { ...props });
|
|
152
110
|
};
|
|
153
111
|
|
|
154
|
-
|
|
112
|
+
const WidgetConfigContext = createContext(null);
|
|
113
|
+
/**
|
|
114
|
+
* This is a provider for the WidgetConfigContext.
|
|
115
|
+
*/
|
|
116
|
+
const WidgetConfigProvider = (props) => jsx(WidgetConfigContext.Provider, { ...props });
|
|
117
|
+
|
|
118
|
+
export { AnalyticsContext, AnalyticsContextProvider, AssetSortingContext, AssetSortingProvider, ConfirmationDialogContext, ConfirmationDialogProvider, CurrentUserContext, CurrentUserPreferenceContext, CurrentUserPreferenceProvider, CurrentUserProvider, EnvironmentContext, EnvironmentContextProvider, ErrorHandlingContext, ErrorHandlingContextProvider, ExportDataContext, FeatureFlagContext, FeatureFlagContextProvider, FilterBarContext, FilterBarProvider, ModalDialogContext, ModalDialogContextProvider, NavigationContext, NavigationContextProvider, OEMBrandingService as OemBrandingContext, OemBrandingContextProvider, TimeRangeContext, TimeRangeProvider, ToastContext, ToastProvider, TokenContext, TokenProvider, UserSubscriptionContext, UserSubscriptionProvider, WidgetConfigContext, WidgetConfigProvider };
|
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts-api",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.79",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"
|
|
11
|
-
"@trackunit/
|
|
12
|
-
"@trackunit/geo-json-utils": "1.7.70",
|
|
13
|
-
"@trackunit/react-test-setup": "1.4.70"
|
|
10
|
+
"react": "19.0.0",
|
|
11
|
+
"@trackunit/iris-app-runtime-core-api": "1.7.120"
|
|
14
12
|
},
|
|
15
13
|
"module": "./index.esm.js",
|
|
16
14
|
"main": "./index.cjs.js",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AnalyticsRuntimeApiSync } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
+
export declare const AnalyticsContext: import("react").Context<AnalyticsRuntimeApiSync<Record<string, never>> | null>;
|
|
3
|
+
export declare const AnalyticsContextProvider: import("react").Provider<AnalyticsRuntimeApiSync<Record<string, never>> | null>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AssetSortingState } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
+
declare const AssetSortingContext: import("react").Context<AssetSortingState | null>;
|
|
3
|
+
/**
|
|
4
|
+
* This is a provider for the AssetSortingContext.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AssetSortingProvider: import("react").Provider<AssetSortingState | null>;
|
|
7
|
+
export { AssetSortingContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConfirmationDialogRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
declare const ConfirmationDialogContext: import("react").Context<ConfirmationDialogRuntimeApi | null>;
|
|
4
|
+
export interface ConfirmationDialogContextProviderProps {
|
|
5
|
+
value: ConfirmationDialogRuntimeApi;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* This is a provider for the ConfirmationDialogContext.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ConfirmationDialogProvider: (props: ConfirmationDialogContextProviderProps) => ReactNode;
|
|
12
|
+
export { ConfirmationDialogContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EnvironmentState } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
declare const EnvironmentContext: import("react").Context<EnvironmentState | null>;
|
|
4
|
+
interface EnvironmentContextProviderProps {
|
|
5
|
+
value: EnvironmentState;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* This is a provider for the EnvironmentContext.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EnvironmentContextProvider: (props: EnvironmentContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { EnvironmentContext };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ErrorHandlingContextValue } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
+
export declare const ErrorHandlingContext: import("react").Context<ErrorHandlingContextValue | null>;
|
|
3
|
+
export declare const ErrorHandlingContextProvider: import("react").Provider<ErrorHandlingContextValue | null>;
|