@tellescope/react-components 1.219.0 → 1.221.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.219.0",
3
+ "version": "1.221.0",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -47,13 +47,13 @@
47
47
  "@reduxjs/toolkit": "^1.6.2",
48
48
  "@stripe/react-stripe-js": "^2.9.0",
49
49
  "@stripe/stripe-js": "^1.52.1",
50
- "@tellescope/constants": "^1.219.0",
51
- "@tellescope/sdk": "^1.219.0",
52
- "@tellescope/types-client": "^1.219.0",
53
- "@tellescope/types-models": "^1.219.0",
54
- "@tellescope/types-utilities": "^1.219.0",
55
- "@tellescope/utilities": "^1.219.0",
56
- "@tellescope/validation": "^1.219.0",
50
+ "@tellescope/constants": "^1.221.0",
51
+ "@tellescope/sdk": "^1.221.0",
52
+ "@tellescope/types-client": "^1.221.0",
53
+ "@tellescope/types-models": "^1.221.0",
54
+ "@tellescope/types-utilities": "^1.221.0",
55
+ "@tellescope/utilities": "^1.221.0",
56
+ "@tellescope/validation": "^1.221.0",
57
57
  "@typescript-eslint/eslint-plugin": "^4.33.0",
58
58
  "@typescript-eslint/parser": "^4.33.0",
59
59
  "css-to-react-native": "^3.0.0",
@@ -83,7 +83,7 @@
83
83
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
84
84
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
85
85
  },
86
- "gitHead": "7282e4f5d36d947700943ba1901e471d47d2e747",
86
+ "gitHead": "9f865339ecf82005e299c61fdc6fb6dacc0a7486",
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  }
@@ -4,7 +4,7 @@ import { ChangeHandler, FormFieldNode } from "./types"
4
4
  import { DatabaseRecord, Enduser, Form, FormField, FormResponse } from "@tellescope/types-client"
5
5
  import { phoneValidator } from "@tellescope/validation"
6
6
  import { FileBlob, Indexable } from "@tellescope/types-utilities"
7
- import { CompoundFilter, EnduserRelationship, FormCustomization, FormResponseAnswerAddress, FormResponseAnswerFileValue, FormResponseValue, FormResponseValueAnswer, OrganizationTheme, PreviousFormCompoundLogic, PreviousFormFieldType } from "@tellescope/types-models"
7
+ import { CompoundFilter, EnduserRelationship, FormCustomization, FormResponseAnswerAddress, FormResponseAnswerFileValue, FormResponseValue, FormResponseValueAnswer, OrganizationTheme, PreviousFormCompoundLogic, PreviousFormFieldType, Timezone, TIMEZONES } from "@tellescope/types-models"
8
8
  import { WithTheme, contact_is_valid, useAddGTMTag, useFileUpload, useFormFields, useFormResponses, useResolvedSession, value_is_loaded } from "../index"
9
9
  import ReactGA from "react-ga4";
10
10
 
@@ -751,6 +751,12 @@ export const useTellescopeForm = ({ dontAutoadvance, isPublicForm, form, urlLogi
751
751
 
752
752
  const stringValues: string[] = []
753
753
  for (const databaseValue of databaseValues) {
754
+ if (r.answer.type === 'Timezone') {
755
+ if (typeof databaseValue.value !== 'string') { continue }
756
+ if (!TIMEZONES.includes(databaseValue.value as Timezone)) { continue }
757
+
758
+ return { ...r, answer: { ...r.answer, value: databaseValue.value } }
759
+ }
754
760
  if (databaseValue.type === 'Address') {
755
761
  if (r.answer.type !== 'Address') return r
756
762
 
@@ -969,7 +969,7 @@ export const AddressInput = ({ field, form, value, onChange, ...props }: FormInp
969
969
  // state only
970
970
  field.options?.addressFields?.includes('state')
971
971
  ? (
972
- <Autocomplete value={value?.state}
972
+ <Autocomplete value={value?.state || ''}
973
973
  options={field.options?.validStates?.length ? field.options.validStates : VALID_STATES}
974
974
  disablePortal
975
975
  onChange={(e, v) => v &&
@@ -1043,7 +1043,7 @@ export const AddressInput = ({ field, form, value, onChange, ...props }: FormInp
1043
1043
  </Grid>
1044
1044
 
1045
1045
  <Grid item xs={field.fullZIP ? 4 : 6} sm={field.fullZIP ? 2 : 3}>
1046
- <Autocomplete value={value?.state} fullWidth
1046
+ <Autocomplete value={value?.state || ''} fullWidth
1047
1047
  options={field.options?.validStates?.length ? field.options.validStates : VALID_STATES}
1048
1048
  disablePortal
1049
1049
  onChange={(e, v) => v &&