@trackunit/react-core-contexts-api 0.2.116-alpha-869e1cbc10.0 → 0.2.116

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
@@ -102,6 +102,37 @@ exports.SortOrder = void 0;
102
102
  SortOrder["Desc"] = "DESC";
103
103
  })(exports.SortOrder || (exports.SortOrder = {}));
104
104
 
105
+ /** The property to sort by. */
106
+ exports.ContactSortByProperty = void 0;
107
+ (function (ContactSortByProperty) {
108
+ ContactSortByProperty["Name"] = "NAME";
109
+ ContactSortByProperty["Email"] = "EMAIL";
110
+ ContactSortByProperty["Fax"] = "FAX";
111
+ ContactSortByProperty["Phone"] = "PHONE";
112
+ ContactSortByProperty["Title"] = "TITLE";
113
+ })(exports.ContactSortByProperty || (exports.ContactSortByProperty = {}));
114
+ /**
115
+ * Ensures that a string is a valid ContactSortByProperty enum value
116
+ *
117
+ * @param input A string to test against ContactSortByProperty
118
+ * @returns {ContactSortByProperty.Name} The ContactSortByProperty enum value or the default value (ContactSortByProperty.Name)
119
+ */
120
+ const validateStringAsContactSortByProperty = (input) => {
121
+ switch (input) {
122
+ case exports.ContactSortByProperty.Email:
123
+ return exports.ContactSortByProperty.Email;
124
+ case exports.ContactSortByProperty.Fax:
125
+ return exports.ContactSortByProperty.Fax;
126
+ case exports.ContactSortByProperty.Phone:
127
+ return exports.ContactSortByProperty.Phone;
128
+ case exports.ContactSortByProperty.Title:
129
+ return exports.ContactSortByProperty.Title;
130
+ case exports.ContactSortByProperty.Name:
131
+ default:
132
+ return exports.ContactSortByProperty.Name;
133
+ }
134
+ };
135
+
105
136
  const assetHomePageIds = [
106
137
  "status",
107
138
  "movement",
@@ -207,4 +238,5 @@ exports.createEvent = createEvent;
207
238
  exports.isIrisOptions = isIrisOptions;
208
239
  exports.siteHomePageIds = siteHomePageIds;
209
240
  exports.validateStringAsAssetSortByProperty = validateStringAsAssetSortByProperty;
241
+ exports.validateStringAsContactSortByProperty = validateStringAsContactSortByProperty;
210
242
  exports.validateStringAsSiteSortByProperty = validateStringAsSiteSortByProperty;
package/index.esm.js CHANGED
@@ -98,6 +98,37 @@ var SortOrder;
98
98
  SortOrder["Desc"] = "DESC";
99
99
  })(SortOrder || (SortOrder = {}));
100
100
 
101
+ /** The property to sort by. */
102
+ var ContactSortByProperty;
103
+ (function (ContactSortByProperty) {
104
+ ContactSortByProperty["Name"] = "NAME";
105
+ ContactSortByProperty["Email"] = "EMAIL";
106
+ ContactSortByProperty["Fax"] = "FAX";
107
+ ContactSortByProperty["Phone"] = "PHONE";
108
+ ContactSortByProperty["Title"] = "TITLE";
109
+ })(ContactSortByProperty || (ContactSortByProperty = {}));
110
+ /**
111
+ * Ensures that a string is a valid ContactSortByProperty enum value
112
+ *
113
+ * @param input A string to test against ContactSortByProperty
114
+ * @returns {ContactSortByProperty.Name} The ContactSortByProperty enum value or the default value (ContactSortByProperty.Name)
115
+ */
116
+ const validateStringAsContactSortByProperty = (input) => {
117
+ switch (input) {
118
+ case ContactSortByProperty.Email:
119
+ return ContactSortByProperty.Email;
120
+ case ContactSortByProperty.Fax:
121
+ return ContactSortByProperty.Fax;
122
+ case ContactSortByProperty.Phone:
123
+ return ContactSortByProperty.Phone;
124
+ case ContactSortByProperty.Title:
125
+ return ContactSortByProperty.Title;
126
+ case ContactSortByProperty.Name:
127
+ default:
128
+ return ContactSortByProperty.Name;
129
+ }
130
+ };
131
+
101
132
  const assetHomePageIds = [
102
133
  "status",
103
134
  "movement",
@@ -195,4 +226,4 @@ const UserSubscriptionPackage = {
195
226
  LEAP: "Leap",
196
227
  };
197
228
 
198
- export { AssetSortByProperty, SiteSortByProperty, SortOrder, SystemOfMeasurement, TimeZonePreference, UserSubscriptionPackage, assetHomePageIds, createEvent, isIrisOptions, siteHomePageIds, validateStringAsAssetSortByProperty, validateStringAsSiteSortByProperty };
229
+ export { AssetSortByProperty, ContactSortByProperty, SiteSortByProperty, SortOrder, SystemOfMeasurement, TimeZonePreference, UserSubscriptionPackage, assetHomePageIds, createEvent, isIrisOptions, siteHomePageIds, validateStringAsAssetSortByProperty, validateStringAsContactSortByProperty, validateStringAsSiteSortByProperty };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts-api",
3
- "version": "0.2.116-alpha-869e1cbc10.0",
3
+ "version": "0.2.116",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -0,0 +1,15 @@
1
+ /** The property to sort by. */
2
+ export declare enum ContactSortByProperty {
3
+ Name = "NAME",
4
+ Email = "EMAIL",
5
+ Fax = "FAX",
6
+ Phone = "PHONE",
7
+ Title = "TITLE"
8
+ }
9
+ /**
10
+ * Ensures that a string is a valid ContactSortByProperty enum value
11
+ *
12
+ * @param input A string to test against ContactSortByProperty
13
+ * @returns {ContactSortByProperty.Name} The ContactSortByProperty enum value or the default value (ContactSortByProperty.Name)
14
+ */
15
+ export declare const validateStringAsContactSortByProperty: (input?: string) => ContactSortByProperty;
package/src/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./IUserPreferencesContext";
2
2
  export * from "./analyticsContext";
3
3
  export * from "./assetSortingContext";
4
4
  export * from "./confirmationDialogContext";
5
+ export * from "./contactSortingContext";
5
6
  export * from "./currentUserContext";
6
7
  export * from "./environmentContext";
7
8
  export * from "./filterBarContext";