@trackunit/custom-field-components 1.3.48 → 1.3.51

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
@@ -604,17 +604,17 @@ const useCustomFieldResolver = ({ field, definition, register, setValue, formSta
604
604
  const useValue = (uniqueIdentifier, numberValue, control, def, field) => {
605
605
  // workaround that ensures the value in the phone number field is updated if the formState changes.
606
606
  // Would probably be better to use PhoneFieldWithController, but doing that makes the form dirty on initial load.
607
- const initialValue = field?.__typename === "PhoneNumberFieldValueAndDefinition" ? field.stringValue : null;
607
+ const initialValue = field?.__typename === "PhoneNumberFieldValueAndDefinition" ? field.phoneNumberValue : null;
608
608
  const watchedValue = reactHookForm.useWatch({ name: uniqueIdentifier, defaultValue: initialValue, control });
609
609
  if (!def) {
610
610
  return null;
611
611
  }
612
612
  switch (def.__typename) {
613
613
  case "WebAddressFieldDefinition": {
614
- return field?.__typename === "WebAddressFieldValueAndDefinition" ? field.stringValue : null;
614
+ return field?.__typename === "WebAddressFieldValueAndDefinition" ? field.webAddressValue : null;
615
615
  }
616
616
  case "EmailFieldDefinition": {
617
- return field?.__typename === "EmailFieldValueAndDefinition" ? field.stringValue : null;
617
+ return field?.__typename === "EmailFieldValueAndDefinition" ? field.emailValue : null;
618
618
  }
619
619
  case "PhoneNumberFieldDefinition": {
620
620
  return watchedValue;
package/index.esm.js CHANGED
@@ -602,17 +602,17 @@ const useCustomFieldResolver = ({ field, definition, register, setValue, formSta
602
602
  const useValue = (uniqueIdentifier, numberValue, control, def, field) => {
603
603
  // workaround that ensures the value in the phone number field is updated if the formState changes.
604
604
  // Would probably be better to use PhoneFieldWithController, but doing that makes the form dirty on initial load.
605
- const initialValue = field?.__typename === "PhoneNumberFieldValueAndDefinition" ? field.stringValue : null;
605
+ const initialValue = field?.__typename === "PhoneNumberFieldValueAndDefinition" ? field.phoneNumberValue : null;
606
606
  const watchedValue = useWatch({ name: uniqueIdentifier, defaultValue: initialValue, control });
607
607
  if (!def) {
608
608
  return null;
609
609
  }
610
610
  switch (def.__typename) {
611
611
  case "WebAddressFieldDefinition": {
612
- return field?.__typename === "WebAddressFieldValueAndDefinition" ? field.stringValue : null;
612
+ return field?.__typename === "WebAddressFieldValueAndDefinition" ? field.webAddressValue : null;
613
613
  }
614
614
  case "EmailFieldDefinition": {
615
- return field?.__typename === "EmailFieldValueAndDefinition" ? field.stringValue : null;
615
+ return field?.__typename === "EmailFieldValueAndDefinition" ? field.emailValue : null;
616
616
  }
617
617
  case "PhoneNumberFieldDefinition": {
618
618
  return watchedValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/custom-field-components",
3
- "version": "1.3.48",
3
+ "version": "1.3.51",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -12,15 +12,15 @@
12
12
  "react-select": "^5.10.0",
13
13
  "@testing-library/react": "16.2.0",
14
14
  "jest-fetch-mock": "^3.0.3",
15
- "@trackunit/react-form-components": "1.3.46",
16
- "@trackunit/shared-utils": "1.5.36",
17
- "@trackunit/custom-field-api": "1.3.38",
18
- "@trackunit/iris-app-runtime-core": "1.4.37",
19
- "@trackunit/react-components": "1.4.40",
20
- "@trackunit/react-modal": "1.3.43",
21
- "@trackunit/react-core-hooks": "1.3.37",
22
- "@trackunit/i18n-library-translation": "1.3.38",
23
- "@trackunit/iris-app-runtime-core-api": "1.3.37"
15
+ "@trackunit/react-form-components": "1.3.48",
16
+ "@trackunit/shared-utils": "1.5.37",
17
+ "@trackunit/custom-field-api": "1.3.41",
18
+ "@trackunit/iris-app-runtime-core": "1.4.39",
19
+ "@trackunit/react-components": "1.4.41",
20
+ "@trackunit/react-modal": "1.3.45",
21
+ "@trackunit/react-core-hooks": "1.3.39",
22
+ "@trackunit/i18n-library-translation": "1.3.40",
23
+ "@trackunit/iris-app-runtime-core-api": "1.3.39"
24
24
  },
25
25
  "module": "./index.esm.js",
26
26
  "main": "./index.cjs.js",