@tellescope/react-components 1.207.0 → 1.208.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.
Files changed (43) hide show
  1. package/lib/cjs/Forms/forms.d.ts +1 -0
  2. package/lib/cjs/Forms/forms.d.ts.map +1 -1
  3. package/lib/cjs/Forms/forms.js +2 -3
  4. package/lib/cjs/Forms/forms.js.map +1 -1
  5. package/lib/cjs/Forms/hooks.d.ts.map +1 -1
  6. package/lib/cjs/Forms/hooks.js +37 -31
  7. package/lib/cjs/Forms/hooks.js.map +1 -1
  8. package/lib/cjs/Forms/inputs.d.ts.map +1 -1
  9. package/lib/cjs/Forms/inputs.js +4 -1
  10. package/lib/cjs/Forms/inputs.js.map +1 -1
  11. package/lib/cjs/layout.d.ts +5 -1
  12. package/lib/cjs/layout.d.ts.map +1 -1
  13. package/lib/cjs/layout.js +3 -3
  14. package/lib/cjs/layout.js.map +1 -1
  15. package/lib/cjs/table.d.ts +2 -1
  16. package/lib/cjs/table.d.ts.map +1 -1
  17. package/lib/cjs/table.js +3 -2
  18. package/lib/cjs/table.js.map +1 -1
  19. package/lib/esm/Forms/forms.d.ts +1 -0
  20. package/lib/esm/Forms/forms.d.ts.map +1 -1
  21. package/lib/esm/Forms/forms.js +2 -3
  22. package/lib/esm/Forms/forms.js.map +1 -1
  23. package/lib/esm/Forms/hooks.d.ts.map +1 -1
  24. package/lib/esm/Forms/hooks.js +38 -32
  25. package/lib/esm/Forms/hooks.js.map +1 -1
  26. package/lib/esm/Forms/inputs.d.ts.map +1 -1
  27. package/lib/esm/Forms/inputs.js +5 -2
  28. package/lib/esm/Forms/inputs.js.map +1 -1
  29. package/lib/esm/layout.d.ts +5 -1
  30. package/lib/esm/layout.d.ts.map +1 -1
  31. package/lib/esm/layout.js +3 -3
  32. package/lib/esm/layout.js.map +1 -1
  33. package/lib/esm/table.d.ts +2 -1
  34. package/lib/esm/table.d.ts.map +1 -1
  35. package/lib/esm/table.js +3 -2
  36. package/lib/esm/table.js.map +1 -1
  37. package/lib/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +9 -9
  39. package/src/Forms/forms.tsx +3 -3
  40. package/src/Forms/hooks.tsx +7 -1
  41. package/src/Forms/inputs.tsx +6 -2
  42. package/src/layout.tsx +5 -2
  43. package/src/table.tsx +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.207.0",
3
+ "version": "1.208.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.207.0",
51
- "@tellescope/sdk": "^1.207.0",
52
- "@tellescope/types-client": "^1.207.0",
53
- "@tellescope/types-models": "^1.207.0",
54
- "@tellescope/types-utilities": "^1.207.0",
55
- "@tellescope/utilities": "^1.207.0",
56
- "@tellescope/validation": "^1.207.0",
50
+ "@tellescope/constants": "^1.208.0",
51
+ "@tellescope/sdk": "^1.208.0",
52
+ "@tellescope/types-client": "^1.208.0",
53
+ "@tellescope/types-models": "^1.208.0",
54
+ "@tellescope/types-utilities": "^1.208.0",
55
+ "@tellescope/utilities": "^1.208.0",
56
+ "@tellescope/validation": "^1.208.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",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
85
85
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
86
86
  },
87
- "gitHead": "ddf48910e1681e4fc241e85af98f4c6a0f3f42bb",
87
+ "gitHead": "386150ae354f2879790b6dbf5d5064eca5015b83",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -20,6 +20,7 @@ export const TellescopeFormContainer = ({ businessId, organizationIds, ...props
20
20
  logoHeight?: number,
21
21
  language?: string,
22
22
  onChangeLanguage?: (l: string) => void,
23
+ paperMinHeight?: React.CSSProperties['minHeight'],
23
24
  } & Styled) => {
24
25
  // if context already is provided, no need to duplicate
25
26
  if (props.dontAddContext) return (
@@ -33,9 +34,8 @@ export const TellescopeFormContainer = ({ businessId, organizationIds, ...props
33
34
  )
34
35
  }
35
36
 
36
- const TellescopeFormContainerWithTheme: typeof TellescopeFormContainer = ({ children, language, onChangeLanguage, style, hideBg, backgroundColor, hideLogo, logoHeight }) => {
37
+ const TellescopeFormContainerWithTheme: typeof TellescopeFormContainer = ({ paperMinHeight=575, children, language, onChangeLanguage, style, hideBg, backgroundColor, hideLogo, logoHeight }) => {
37
38
  const theme = useOrganizationTheme()
38
- console.log('logoHeight',logoHeight)
39
39
 
40
40
  const formContent = (
41
41
  <Flex flex={1} column>
@@ -72,7 +72,7 @@ const TellescopeFormContainerWithTheme: typeof TellescopeFormContainer = ({ chil
72
72
  }
73
73
  return (
74
74
  <Flex flex={1} alignItems="center" justifyContent="center" style={{ backgroundColor: backgroundColor ?? theme.themeColor ?? '#ffffff', ...style }}>
75
- <Paper flex elevation={3} style={{ marginTop: 50, marginBottom: 50, padding: 20, maxWidth: 650, minWidth: 250, minHeight: 575 }}>
75
+ <Paper flex elevation={3} style={{ marginTop: 50, marginBottom: 50, padding: 20, maxWidth: 650, minWidth: 250, minHeight: paperMinHeight }}>
76
76
  {formContent}
77
77
  </Paper>
78
78
  </Flex>
@@ -9,7 +9,7 @@ import { WithTheme, contact_is_valid, useAddGTMTag, useFileUpload, useFormFields
9
9
  import ReactGA from "react-ga4";
10
10
 
11
11
  import isEmail from "validator/lib/isEmail"
12
- import { append_current_utm_params, emit_gtm_event, field_can_autoadvance, getLocalTimezone, get_time_values, get_utm_params, is_object, object_is_empty, responses_satisfy_conditions, update_local_storage } from "@tellescope/utilities"
12
+ import { append_current_utm_params, emit_gtm_event, field_can_autoadvance, getLocalTimezone, get_time_values, get_utm_params, is_object, object_is_empty, read_local_storage, responses_satisfy_conditions, update_local_storage } from "@tellescope/utilities"
13
13
 
14
14
  export const useFlattenedTree = (root?: FormFieldNode) => {
15
15
  const flat: FormField[] = []
@@ -1297,6 +1297,12 @@ export const useTellescopeForm = ({ dontAutoadvance, isPublicForm, form, urlLogi
1297
1297
  if (submitRedirectURL) {
1298
1298
  (window?.top ?? window).location.href = append_current_utm_params(submitRedirectURL);
1299
1299
  }
1300
+ if (form?.redirectToBookedAppointmentOnSubmit) {
1301
+ const url = read_local_storage('tellescope_last_booking_page_join_link')
1302
+ if (url) {
1303
+ (window?.top ?? window).location.href = append_current_utm_params(url);
1304
+ }
1305
+ }
1300
1306
  } catch(err: any) {
1301
1307
  console.error(err)
1302
1308
  setSubmitErrorMessage(err?.message ?? 'An error occurred')
@@ -4,7 +4,7 @@ import { Autocomplete, Box, Button, Checkbox, Chip, Divider, FormControl, FormCo
4
4
  import { FormInputProps } from "./types"
5
5
  import { useDropzone } from "react-dropzone"
6
6
  import { CANVAS_TITLE, EMOTII_TITLE, INSURANCE_RELATIONSHIPS, INSURANCE_RELATIONSHIPS_CANVAS, PRIMARY_HEX, RELATIONSHIP_TYPES, TELLESCOPE_GENDERS } from "@tellescope/constants"
7
- import { MM_DD_YYYY_to_YYYY_MM_DD, capture_is_supported, downloadFile, emit_gtm_event, first_letter_capitalized, form_response_value_to_string, getLocalTimezone, getPublicFileURL, mm_dd_yyyy, replace_enduser_template_values, truncate_string, user_display_name } from "@tellescope/utilities"
7
+ import { MM_DD_YYYY_to_YYYY_MM_DD, capture_is_supported, downloadFile, emit_gtm_event, first_letter_capitalized, form_response_value_to_string, getLocalTimezone, getPublicFileURL, mm_dd_yyyy, replace_enduser_template_values, truncate_string, update_local_storage, user_display_name } from "@tellescope/utilities"
8
8
  import { DatabaseSelectResponse, Enduser, EnduserRelationship, FormResponseValue, InsuranceRelationship, MedicationResponse, MultipleChoiceOptions, TellescopeGender } from "@tellescope/types-models"
9
9
  import { VALID_STATES, emailValidator, phoneValidator } from "@tellescope/validation"
10
10
  import Slider from '@mui/material/Slider';
@@ -2900,7 +2900,11 @@ export const AppointmentBookingInput = ({ formResponseId, field, value, onChange
2900
2900
  }
2901
2901
  if (m?.data?.type === 'Confirmation') {
2902
2902
  setConfirming(true)
2903
- } else {
2903
+ }
2904
+ if (m?.data?.type === 'Join Link' && m?.data?.link) {
2905
+ update_local_storage('tellescope_last_booking_page_join_link', m.data.link)
2906
+ }
2907
+ else {
2904
2908
  setConfirming(false)
2905
2909
  }
2906
2910
  }
package/src/layout.tsx CHANGED
@@ -282,6 +282,7 @@ export type TitleComponentType = React.JSXElementConstructor<{ title?: React.Rea
282
282
  export interface ScrollingListProps <T extends { id: string | number }> extends Styled {
283
283
  items: T[],
284
284
  Item: React.JSXElementConstructor<{ item: T, index: number }>
285
+ renderItem?: (p: { item: T, index: number }) => React.ReactElement,
285
286
  title?: React.ReactNode,
286
287
  header?: React.ReactNode,
287
288
  emptyText?: React.ReactNode,
@@ -317,6 +318,7 @@ export const ScrollingList = <T extends { id: string | number }>({
317
318
  doneLoading,
318
319
  loadMore,
319
320
  Item,
321
+ renderItem,
320
322
  TitleComponent,
321
323
  titleActionsComponent,
322
324
  style,
@@ -410,7 +412,8 @@ export const ScrollingList = <T extends { id: string | number }>({
410
412
  >
411
413
  {({ data, index, style }) => (
412
414
  <div style={style}>
413
- <Item key={data[index].id} item={data[index]} index={index} />
415
+ {renderItem ? renderItem({ item: data[index], index }) : <Item key={data[index].id} item={data[index]} index={index} />}
416
+
414
417
  {index === items.length -1 && loadMore && !doneLoading?.() &&
415
418
  <div style={{ textAlign: 'center' }}>
416
419
  <LoadingButton submitText="Load Older Data" submittingText="Loading..."
@@ -424,7 +427,7 @@ export const ScrollingList = <T extends { id: string | number }>({
424
427
  </FixedSizeList>
425
428
  ) : (
426
429
  items.map((item, index) => (
427
- <Item key={item.id} item={item} index={index} />
430
+ renderItem ? renderItem({ item, index }) : <Item key={item.id} item={item} index={index} />
428
431
  ))
429
432
  )
430
433
  }
package/src/table.tsx CHANGED
@@ -769,6 +769,7 @@ export interface TableProps<T extends Item> extends WithTitle, WithHeader<T>, Wi
769
769
  columnResizeZIndex?: number,
770
770
  rowHeight?: number,
771
771
  headerHeight?: number,
772
+ onChangeColumnSorting?: (sorting: Sorting[]) => void,
772
773
  }
773
774
  export const Table = <T extends Item>({
774
775
  items,
@@ -827,6 +828,7 @@ export const Table = <T extends Item>({
827
828
  refreshFilterSuggestionsKey,
828
829
  minColumnWidth,
829
830
  columnResizeZIndex,
831
+ onChangeColumnSorting,
830
832
  }: TableProps<T> & Styled) => {
831
833
  const sortingStorageKey = (memoryId ?? '') + 'sorting'
832
834
  const cachedSortString = read_local_storage(sortingStorageKey)
@@ -883,10 +885,11 @@ export const Table = <T extends Item>({
883
885
  )
884
886
 
885
887
  useEffect(() => {
886
- if (!memoryId) return
887
-
888
+ onChangeColumnSorting?.(sorting)
889
+
890
+ if (!memoryId) return
888
891
  update_local_storage(sortingStorageKey, JSON.stringify(sorting))
889
- }, [sorting, memoryId])
892
+ }, [sorting, memoryId, onChangeColumnSorting])
890
893
 
891
894
  // sorts in place
892
895
  const applySorting = useCallback((items: T[]) => {