@tellescope/react-components 1.154.0 → 1.155.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/lib/cjs/Forms/forms.d.ts +6 -0
- package/lib/cjs/Forms/forms.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.js +6 -5
- package/lib/cjs/Forms/forms.js.map +1 -1
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +3 -0
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts +1 -1
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +20 -3
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/esm/CMS/components.d.ts +0 -1
- package/lib/esm/CMS/components.d.ts.map +1 -1
- package/lib/esm/Forms/form_responses.d.ts +0 -1
- package/lib/esm/Forms/form_responses.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +9 -3
- package/lib/esm/Forms/forms.d.ts.map +1 -1
- package/lib/esm/Forms/forms.js +2 -2
- package/lib/esm/Forms/forms.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts +0 -1
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +3 -0
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +2 -2
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +20 -3
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/inputs.native.d.ts +0 -1
- package/lib/esm/inputs.native.d.ts.map +1 -1
- package/lib/esm/state.d.ts +52 -52
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/forms.tsx +2 -2
- package/src/Forms/hooks.tsx +3 -0
- package/src/Forms/inputs.tsx +38 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.155.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.
|
|
51
|
-
"@tellescope/sdk": "^1.
|
|
52
|
-
"@tellescope/types-client": "^1.
|
|
53
|
-
"@tellescope/types-models": "^1.
|
|
54
|
-
"@tellescope/types-utilities": "^1.
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
56
|
-
"@tellescope/validation": "^1.
|
|
50
|
+
"@tellescope/constants": "^1.155.0",
|
|
51
|
+
"@tellescope/sdk": "^1.155.0",
|
|
52
|
+
"@tellescope/types-client": "^1.155.0",
|
|
53
|
+
"@tellescope/types-models": "^1.155.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.155.0",
|
|
55
|
+
"@tellescope/utilities": "^1.155.0",
|
|
56
|
+
"@tellescope/validation": "^1.155.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",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
81
81
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "be943fbead3f47347ebff8ddc8f3e21c789490a4",
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
}
|
package/src/Forms/forms.tsx
CHANGED
|
@@ -254,7 +254,7 @@ export const QuestionForField = ({
|
|
|
254
254
|
<Height field={field} disabled={value.disabled} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
255
255
|
)
|
|
256
256
|
: field.type === 'Redirect' ? (
|
|
257
|
-
<Redirect groupId={groupId} groupInsance={groupInstance} submit={submit} field={field} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
257
|
+
<Redirect responses={responses} enduser={enduser} groupId={groupId} groupInsance={groupInstance} submit={submit} field={field} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
258
258
|
)
|
|
259
259
|
: field.type === 'Related Contacts' ? (
|
|
260
260
|
<RelatedContacts field={field} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
@@ -601,7 +601,7 @@ export const TellescopeSingleQuestionFlow: typeof TellescopeForm = ({
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
export const DEFAULT_THANKS_MESSAGE = "Your response was successfully recorded";
|
|
604
|
-
const ThanksMessage = ({
|
|
604
|
+
export const ThanksMessage = ({
|
|
605
605
|
thanksMessage,
|
|
606
606
|
htmlThanksMessage,
|
|
607
607
|
showRestartAtEnd,
|
package/src/Forms/hooks.tsx
CHANGED
|
@@ -99,6 +99,9 @@ export const default_label_for_compound_logic = (f: CompoundFilter<string>): str
|
|
|
99
99
|
const value = f.condition[key]
|
|
100
100
|
if (value && typeof value === 'object') {
|
|
101
101
|
const objectKey = Object.keys(value)[0]
|
|
102
|
+
if (objectKey === '$ne') {
|
|
103
|
+
return `${key} Does Not Equal ${value[objectKey as keyof typeof value]}`
|
|
104
|
+
}
|
|
102
105
|
if (objectKey === '$gt') {
|
|
103
106
|
return `${key} Greater Than ${value[objectKey as keyof typeof value]}`
|
|
104
107
|
}
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -2735,7 +2735,7 @@ export const HeightInput = ({ field, value={} as any, onChange, ...props }: Form
|
|
|
2735
2735
|
</Grid>
|
|
2736
2736
|
)
|
|
2737
2737
|
|
|
2738
|
-
export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, submit, value={} as any, onChange, ...props }: FormInputProps<'Redirect'>) => {
|
|
2738
|
+
export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, submit, value={} as any, onChange, responses, enduser, ...props }: FormInputProps<'Redirect'>) => {
|
|
2739
2739
|
const session = useResolvedSession()
|
|
2740
2740
|
|
|
2741
2741
|
let eId = ''
|
|
@@ -2743,6 +2743,33 @@ export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, su
|
|
|
2743
2743
|
eId = new URL(window.location.href).searchParams.get('eId') || ''
|
|
2744
2744
|
} catch(err) {}
|
|
2745
2745
|
|
|
2746
|
+
const email = (
|
|
2747
|
+
responses?.find(r => r.intakeField === 'email')?.answer?.value
|
|
2748
|
+
|| enduser?.email
|
|
2749
|
+
|| session.userInfo.email
|
|
2750
|
+
)
|
|
2751
|
+
const phone = (
|
|
2752
|
+
responses?.find(r => r.intakeField === 'phone')?.answer?.value
|
|
2753
|
+
|| enduser?.phone
|
|
2754
|
+
|| session.userInfo.phone
|
|
2755
|
+
)
|
|
2756
|
+
const fname = (
|
|
2757
|
+
responses?.find(r => r.intakeField === 'fname')?.answer?.value
|
|
2758
|
+
|| enduser?.fname
|
|
2759
|
+
|| session.userInfo?.fname
|
|
2760
|
+
)
|
|
2761
|
+
const lname = (
|
|
2762
|
+
responses?.find(r => r.intakeField === 'lname')?.answer?.value
|
|
2763
|
+
|| enduser?.lname
|
|
2764
|
+
|| session.userInfo?.lname
|
|
2765
|
+
)
|
|
2766
|
+
const state = (
|
|
2767
|
+
responses?.find(r => r.intakeField === 'state')?.answer?.value
|
|
2768
|
+
|| (responses?.find(r => r.intakeField === 'Address')?.answer?.value as any)?.state
|
|
2769
|
+
|| enduser?.state
|
|
2770
|
+
|| (session.userInfo as Enduser)?.state
|
|
2771
|
+
)
|
|
2772
|
+
|
|
2746
2773
|
useEffect(() => {
|
|
2747
2774
|
if (session.type === 'user') { return }
|
|
2748
2775
|
|
|
@@ -2751,7 +2778,15 @@ export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, su
|
|
|
2751
2778
|
.finally(() => {
|
|
2752
2779
|
if (!field.options?.redirectExternalUrl) { return }
|
|
2753
2780
|
|
|
2754
|
-
window.location.href =
|
|
2781
|
+
window.location.href = (
|
|
2782
|
+
replace_enduser_template_values(
|
|
2783
|
+
field.options.redirectExternalUrl,
|
|
2784
|
+
{
|
|
2785
|
+
...session.userInfo as any,
|
|
2786
|
+
email, fname, lname, state, phone,
|
|
2787
|
+
}
|
|
2788
|
+
)
|
|
2789
|
+
)
|
|
2755
2790
|
})
|
|
2756
2791
|
.catch(console.error)
|
|
2757
2792
|
|
|
@@ -2785,7 +2820,7 @@ export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, su
|
|
|
2785
2820
|
})
|
|
2786
2821
|
))
|
|
2787
2822
|
.catch(console.error)
|
|
2788
|
-
}, [session])
|
|
2823
|
+
}, [session, email, fname, lname, state, phone])
|
|
2789
2824
|
|
|
2790
2825
|
if (session.type === 'user') {
|
|
2791
2826
|
return (
|