@trackunit/react-core-contexts-api 1.8.8 → 1.8.10

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
@@ -23,6 +23,7 @@ exports.AssetSortByProperty = void 0;
23
23
  AssetSortByProperty["Category"] = "CATEGORY";
24
24
  AssetSortByProperty["Criticality"] = "CRITICALITY";
25
25
  AssetSortByProperty["CustomField"] = "CUSTOM_FIELD";
26
+ AssetSortByProperty["CustomerName"] = "CUSTOMER_NAME";
26
27
  AssetSortByProperty["AccessManagement"] = "ACCESS_MANAGEMENT";
27
28
  AssetSortByProperty["ExternalReference"] = "EXTERNAL_REFERENCE";
28
29
  AssetSortByProperty["Location"] = "LOCATION";
@@ -42,13 +43,14 @@ exports.AssetSortByProperty = void 0;
42
43
  AssetSortByProperty["ServicePlanPrediction"] = "SERVICE_PLAN_PREDICTION";
43
44
  AssetSortByProperty["IssueCreatedAt"] = "ISSUE_CREATED_AT";
44
45
  })(exports.AssetSortByProperty || (exports.AssetSortByProperty = {}));
45
- // The type [key in AssetSortByProperty] will insure that ALL keys are present
46
+ // The type [key in AssetSortByProperty] will ensure that ALL keys are present
46
47
  const stringToEnum = {
47
48
  ACTIVITY: exports.AssetSortByProperty.Activity,
48
49
  BRAND: exports.AssetSortByProperty.Brand,
49
50
  CATEGORY: exports.AssetSortByProperty.Category,
50
51
  CUSTOM_FIELD: exports.AssetSortByProperty.CustomField,
51
52
  CRITICALITY: exports.AssetSortByProperty.Criticality,
53
+ CUSTOMER_NAME: exports.AssetSortByProperty.CustomerName,
52
54
  ACCESS_MANAGEMENT: exports.AssetSortByProperty.AccessManagement,
53
55
  EXTERNAL_REFERENCE: exports.AssetSortByProperty.ExternalReference,
54
56
  LOCATION: exports.AssetSortByProperty.Location,
package/index.esm.js CHANGED
@@ -21,6 +21,7 @@ var AssetSortByProperty;
21
21
  AssetSortByProperty["Category"] = "CATEGORY";
22
22
  AssetSortByProperty["Criticality"] = "CRITICALITY";
23
23
  AssetSortByProperty["CustomField"] = "CUSTOM_FIELD";
24
+ AssetSortByProperty["CustomerName"] = "CUSTOMER_NAME";
24
25
  AssetSortByProperty["AccessManagement"] = "ACCESS_MANAGEMENT";
25
26
  AssetSortByProperty["ExternalReference"] = "EXTERNAL_REFERENCE";
26
27
  AssetSortByProperty["Location"] = "LOCATION";
@@ -40,13 +41,14 @@ var AssetSortByProperty;
40
41
  AssetSortByProperty["ServicePlanPrediction"] = "SERVICE_PLAN_PREDICTION";
41
42
  AssetSortByProperty["IssueCreatedAt"] = "ISSUE_CREATED_AT";
42
43
  })(AssetSortByProperty || (AssetSortByProperty = {}));
43
- // The type [key in AssetSortByProperty] will insure that ALL keys are present
44
+ // The type [key in AssetSortByProperty] will ensure that ALL keys are present
44
45
  const stringToEnum = {
45
46
  ACTIVITY: AssetSortByProperty.Activity,
46
47
  BRAND: AssetSortByProperty.Brand,
47
48
  CATEGORY: AssetSortByProperty.Category,
48
49
  CUSTOM_FIELD: AssetSortByProperty.CustomField,
49
50
  CRITICALITY: AssetSortByProperty.Criticality,
51
+ CUSTOMER_NAME: AssetSortByProperty.CustomerName,
50
52
  ACCESS_MANAGEMENT: AssetSortByProperty.AccessManagement,
51
53
  EXTERNAL_REFERENCE: AssetSortByProperty.ExternalReference,
52
54
  LOCATION: AssetSortByProperty.Location,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts-api",
3
- "version": "1.8.8",
3
+ "version": "1.8.10",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,9 +8,9 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "jest-fetch-mock": "^3.0.3",
11
- "@trackunit/shared-utils": "1.9.7",
12
- "@trackunit/geo-json-utils": "1.7.7",
13
- "@trackunit/react-test-setup": "1.4.7"
11
+ "@trackunit/shared-utils": "1.9.8",
12
+ "@trackunit/geo-json-utils": "1.7.8",
13
+ "@trackunit/react-test-setup": "1.4.8"
14
14
  },
15
15
  "module": "./index.esm.js",
16
16
  "main": "./index.cjs.js",
@@ -16,6 +16,7 @@ export declare enum AssetSortByProperty {
16
16
  Category = "CATEGORY",
17
17
  Criticality = "CRITICALITY",
18
18
  CustomField = "CUSTOM_FIELD",
19
+ CustomerName = "CUSTOMER_NAME",
19
20
  AccessManagement = "ACCESS_MANAGEMENT",
20
21
  ExternalReference = "EXTERNAL_REFERENCE",
21
22
  Location = "LOCATION",
@@ -1,3 +1,7 @@
1
+ export type LoadingState = {
2
+ hasData: boolean;
3
+ isLoading: boolean;
4
+ };
1
5
  export interface WidgetConfigContext {
2
6
  /**
3
7
  * Gets the title of the widget.
@@ -34,4 +38,24 @@ export interface WidgetConfigContext {
34
38
  * @param dataVersion - The data version to set.
35
39
  */
36
40
  setData: (data: Record<string, unknown>, dataVersion: number) => Promise<void>;
41
+ /**
42
+ * Sets the loading state of the widget.
43
+ *
44
+ * @param loadingState - The loading state to set.
45
+ */
46
+ setLoadingState: (loadingState: LoadingState) => Promise<void>;
47
+ /**
48
+ * Opens the edit mode of the widget.
49
+ */
50
+ openEditMode: () => Promise<void>;
51
+ /**
52
+ * Closes the edit mode of the widget.
53
+ */
54
+ closeEditMode: () => Promise<void>;
55
+ /**
56
+ * The poll interval of the widget.
57
+ *
58
+ * @returns the poll interval of the widget
59
+ */
60
+ pollInterval?: number;
37
61
  }