@tellescope/react-components 1.203.2 → 1.204.1
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/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +3 -1
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +16 -5
- 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/forms.d.ts +3 -3
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +3 -1
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +1 -1
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +16 -5
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/inputs.native.d.ts +0 -1
- package/lib/esm/Forms/inputs.native.d.ts.map +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/layout.d.ts +1 -1
- package/lib/esm/state.d.ts +288 -288
- package/lib/esm/theme.native.d.ts +0 -1
- package/lib/esm/theme.native.d.ts.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/hooks.tsx +3 -1
- package/src/Forms/inputs.tsx +19 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.204.1",
|
|
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.204.1",
|
|
51
|
+
"@tellescope/sdk": "^1.204.1",
|
|
52
|
+
"@tellescope/types-client": "^1.204.1",
|
|
53
|
+
"@tellescope/types-models": "^1.204.1",
|
|
54
|
+
"@tellescope/types-utilities": "^1.204.1",
|
|
55
|
+
"@tellescope/utilities": "^1.204.1",
|
|
56
|
+
"@tellescope/validation": "^1.204.1",
|
|
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",
|
|
85
85
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "bf08d1f48c4e7939f6e4e246a2ba84189f0e68db",
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
}
|
package/src/Forms/hooks.tsx
CHANGED
|
@@ -638,7 +638,9 @@ export const useTellescopeForm = ({ dontAutoadvance, isPublicForm, form, urlLogi
|
|
|
638
638
|
? (
|
|
639
639
|
(f.options?.default && !isNaN(parseInt(f.options.default)))
|
|
640
640
|
? parseInt(f.options.default)
|
|
641
|
-
:
|
|
641
|
+
: f.isOptional
|
|
642
|
+
? undefined
|
|
643
|
+
: (f.options?.from || 1)
|
|
642
644
|
)
|
|
643
645
|
: f.type === 'Related Contacts'
|
|
644
646
|
? (f.isOptional ? [] : [{ relationships: f?.options?.relatedContactTypes?.length === 1 ? [{ type: f.options.relatedContactTypes[0] as EnduserRelationship['type'], id: ''! } ] : [] }])
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -142,6 +142,9 @@ export const RatingInput = ({ field, value, onChange }: FormInputProps<'rating'>
|
|
|
142
142
|
valueLabelDisplay={marks.length < allMarks.length ? 'auto' : "off"}
|
|
143
143
|
value={value}
|
|
144
144
|
onChange={(e, v) => onChange(v as number, field.id)}
|
|
145
|
+
sx={{
|
|
146
|
+
'& .MuiSlider-thumb': value === undefined ? { display: 'none' } : {}, // Hide thumb until value is set
|
|
147
|
+
}}
|
|
145
148
|
/>
|
|
146
149
|
)
|
|
147
150
|
}
|
|
@@ -3143,6 +3146,19 @@ export const HiddenValueInput = ({ goToNextField, goToPreviousField, field, valu
|
|
|
3143
3146
|
|| !!(groupFields?.find(v => v.type !== 'Hidden Value')) // group contains at least 1 non-hidden value
|
|
3144
3147
|
)
|
|
3145
3148
|
|
|
3149
|
+
const publicIdentifier = useMemo(() => {
|
|
3150
|
+
try {
|
|
3151
|
+
return new URL(window.location.href).searchParams.get('publicIdentifier') || ''
|
|
3152
|
+
} catch(err) {
|
|
3153
|
+
return ''
|
|
3154
|
+
}
|
|
3155
|
+
}, [])
|
|
3156
|
+
|
|
3157
|
+
const valueToSet = useMemo(() => (
|
|
3158
|
+
(field.title === "{{PUBLIC_IDENTIFIER}}" && publicIdentifier) ? publicIdentifier
|
|
3159
|
+
: field.title
|
|
3160
|
+
), [field.title, publicIdentifier])
|
|
3161
|
+
|
|
3146
3162
|
useEffect(() => {
|
|
3147
3163
|
if (lastRef.current > Date.now() - 1000 && lastIdRef.current === field.id) return
|
|
3148
3164
|
lastRef.current = Date.now()
|
|
@@ -3155,15 +3171,14 @@ export const HiddenValueInput = ({ goToNextField, goToPreviousField, field, valu
|
|
|
3155
3171
|
if (dontNavigate) return
|
|
3156
3172
|
goToPreviousField?.()
|
|
3157
3173
|
} else {
|
|
3158
|
-
onChange(
|
|
3174
|
+
onChange(valueToSet, field.id)
|
|
3159
3175
|
|
|
3160
3176
|
if (dontNavigate) return
|
|
3161
3177
|
|
|
3162
3178
|
// pass value that is set after above onChange
|
|
3163
|
-
|
|
3164
|
-
goToNextField?.({ type: 'Hidden Value', value: field.title })
|
|
3179
|
+
goToNextField?.({ type: 'Hidden Value', value: valueToSet })
|
|
3165
3180
|
}
|
|
3166
|
-
}, [value, onChange, field, goToNextField, goToPreviousField, isSinglePage, dontNavigate])
|
|
3181
|
+
}, [value, onChange, field.id, valueToSet, goToNextField, goToPreviousField, isSinglePage, dontNavigate])
|
|
3167
3182
|
|
|
3168
3183
|
return <></>
|
|
3169
3184
|
}
|