@trackunit/iris-app-runtime-core 0.3.77 → 0.3.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/index.cjs.js CHANGED
@@ -529,6 +529,21 @@ const AssetSortingRuntime = {
529
529
  }),
530
530
  };
531
531
 
532
+ const CurrentUserPreferenceRuntime = {
533
+ getCurrentUserLanguage: () => __awaiter(void 0, void 0, void 0, function* () {
534
+ const api = yield getHostConnector();
535
+ return api.getCurrentUserLanguage();
536
+ }),
537
+ getCurrentUserTimeZonePreference: () => __awaiter(void 0, void 0, void 0, function* () {
538
+ const api = yield getHostConnector();
539
+ return api.getCurrentUserTimeZonePreference();
540
+ }),
541
+ getCurrentUserSystemOfMeasurement: () => __awaiter(void 0, void 0, void 0, function* () {
542
+ const api = yield getHostConnector();
543
+ return api.getCurrentUserSystemOfMeasurement();
544
+ }),
545
+ };
546
+
532
547
  const CurrentUserRuntime = {
533
548
  getCurrentUserContext: () => __awaiter(void 0, void 0, void 0, function* () {
534
549
  const api = yield getHostConnector();
@@ -603,6 +618,12 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
603
618
  type: irisAppRuntimeCoreApi.CustomFieldType.NUMBER,
604
619
  };
605
620
  }
621
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.MONETARY) {
622
+ return {
623
+ numberValue: newValue,
624
+ type: irisAppRuntimeCoreApi.CustomFieldType.MONETARY,
625
+ };
626
+ }
606
627
  else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.PHONE_NUMBER) {
607
628
  return {
608
629
  stringValue: getStringValue(newValue),
@@ -810,6 +831,7 @@ const UserSubscriptionRuntime = {
810
831
  exports.AnalyticsContextRuntime = AnalyticsContextRuntime;
811
832
  exports.AssetRuntime = AssetRuntime;
812
833
  exports.AssetSortingRuntime = AssetSortingRuntime;
834
+ exports.CurrentUserPreferenceRuntime = CurrentUserPreferenceRuntime;
813
835
  exports.CurrentUserRuntime = CurrentUserRuntime;
814
836
  exports.CustomFieldRuntime = CustomFieldRuntime;
815
837
  exports.EnvironmentRuntime = EnvironmentRuntime;
package/index.esm.js CHANGED
@@ -526,6 +526,21 @@ const AssetSortingRuntime = {
526
526
  }),
527
527
  };
528
528
 
529
+ const CurrentUserPreferenceRuntime = {
530
+ getCurrentUserLanguage: () => __awaiter(void 0, void 0, void 0, function* () {
531
+ const api = yield getHostConnector();
532
+ return api.getCurrentUserLanguage();
533
+ }),
534
+ getCurrentUserTimeZonePreference: () => __awaiter(void 0, void 0, void 0, function* () {
535
+ const api = yield getHostConnector();
536
+ return api.getCurrentUserTimeZonePreference();
537
+ }),
538
+ getCurrentUserSystemOfMeasurement: () => __awaiter(void 0, void 0, void 0, function* () {
539
+ const api = yield getHostConnector();
540
+ return api.getCurrentUserSystemOfMeasurement();
541
+ }),
542
+ };
543
+
529
544
  const CurrentUserRuntime = {
530
545
  getCurrentUserContext: () => __awaiter(void 0, void 0, void 0, function* () {
531
546
  const api = yield getHostConnector();
@@ -600,6 +615,12 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
600
615
  type: CustomFieldType.NUMBER,
601
616
  };
602
617
  }
618
+ else if (customFieldDefinition.type === CustomFieldType.MONETARY) {
619
+ return {
620
+ numberValue: newValue,
621
+ type: CustomFieldType.MONETARY,
622
+ };
623
+ }
603
624
  else if (customFieldDefinition.type === CustomFieldType.PHONE_NUMBER) {
604
625
  return {
605
626
  stringValue: getStringValue(newValue),
@@ -804,4 +825,4 @@ const UserSubscriptionRuntime = {
804
825
  }),
805
826
  };
806
827
 
807
- export { AnalyticsContextRuntime, AssetRuntime, AssetSortingRuntime, CurrentUserRuntime, CustomFieldRuntime, EnvironmentRuntime, FilterBarRuntime, GlobalSelectionRuntime, NavigationRuntime, OemBrandingContextRuntime, ParamsRuntime, RestRuntime, SiteRuntime, ToastRuntime, TokenRuntime, UserSubscriptionRuntime, getCustomFieldValueToSaveFromRawValue, getDateValue, getHostConnector, getStringValue, setupHostConnector };
828
+ export { AnalyticsContextRuntime, AssetRuntime, AssetSortingRuntime, CurrentUserPreferenceRuntime, CurrentUserRuntime, CustomFieldRuntime, EnvironmentRuntime, FilterBarRuntime, GlobalSelectionRuntime, NavigationRuntime, OemBrandingContextRuntime, ParamsRuntime, RestRuntime, SiteRuntime, ToastRuntime, TokenRuntime, UserSubscriptionRuntime, getCustomFieldValueToSaveFromRawValue, getDateValue, getHostConnector, getStringValue, setupHostConnector };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-runtime-core",
3
- "version": "0.3.77",
3
+ "version": "0.3.79",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,8 +9,8 @@
9
9
  "module": "./index.esm.js",
10
10
  "main": "./index.cjs.js",
11
11
  "dependencies": {
12
- "@trackunit/iris-app-runtime-core-api": "0.3.70",
13
- "@trackunit/react-core-contexts-api": "0.2.58"
12
+ "@trackunit/iris-app-runtime-core-api": "0.3.71",
13
+ "@trackunit/react-core-contexts-api": "0.2.59"
14
14
  },
15
15
  "peerDependencies": {}
16
16
  }
@@ -0,0 +1,7 @@
1
+ import { SystemOfMeasurementType, TimeZonePreferenceType } from "@trackunit/react-core-contexts-api";
2
+ export interface ICurrentUserPreferenceRuntime {
3
+ getCurrentUserLanguage: () => Promise<string>;
4
+ getCurrentUserTimeZonePreference: () => Promise<TimeZonePreferenceType>;
5
+ getCurrentUserSystemOfMeasurement: () => Promise<SystemOfMeasurementType>;
6
+ }
7
+ export declare const CurrentUserPreferenceRuntime: ICurrentUserPreferenceRuntime;
@@ -1,9 +1,8 @@
1
1
  import { CustomFieldDefinition, CustomFieldError, CustomFieldValue, EntityIdentity, UnitSiType, UnitUsType, ValueAndDefinition, ValueAndDefinitionKey } from "@trackunit/iris-app-runtime-core-api";
2
+ import { SystemOfMeasurementType } from "@trackunit/react-core-contexts-api";
2
3
  export interface DropdownSelection {
3
4
  value: string;
4
5
  }
5
- /** System of measurement. */
6
- export type SystemOfMeasurement = "SI" | "US_CUSTOMARY";
7
6
  /**
8
7
  * Get the value of a custom field from a raw value.
9
8
  *
@@ -25,6 +24,6 @@ export interface ICustomFieldRuntime {
25
24
  getCustomFieldsFor: (entity: EntityIdentity) => Promise<ValueAndDefinition[]>;
26
25
  setCustomFieldsFor: (entity: EntityIdentity, values: ValueAndDefinitionKey[]) => Promise<void | CustomFieldError>;
27
26
  setCustomFieldsFromFormData: (entity: EntityIdentity, formData: Record<string, boolean | string | string[] | number>, originalDefinitions: ValueAndDefinition[]) => Promise<void | CustomFieldError>;
28
- getCustomFieldValueForDisplayInUI: (value: number | string | null | undefined, unit: UnitUsType | UnitSiType | null | undefined, systemOfMeasurement?: SystemOfMeasurement, language?: string) => number | string | null | undefined;
27
+ getCustomFieldValueForDisplayInUI: (value: number | string | null | undefined, unit: UnitUsType | UnitSiType | null | undefined, systemOfMeasurement?: SystemOfMeasurementType, language?: string) => number | string | null | undefined;
29
28
  }
30
29
  export declare const CustomFieldRuntime: ICustomFieldRuntime;
package/src/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "@trackunit/iris-app-runtime-core-api";
2
2
  export * from "./AnalyticsRuntime";
3
3
  export * from "./AssetRuntime";
4
4
  export * from "./AssetSortingRuntime";
5
+ export * from "./CurrentPreferenceUserRuntime";
5
6
  export * from "./CurrentUserRuntime";
6
7
  export * from "./CustomFieldRuntime";
7
8
  export * from "./EnvironmentRuntime";