@tellescope/react-components 1.249.2 → 1.250.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/forms.v2.js +1 -1
- package/lib/cjs/Forms/forms.v2.js.map +1 -1
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +29 -20
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/forms.v2.js +1 -1
- package/lib/esm/Forms/forms.v2.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +29 -20
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/forms.v2.tsx +1 -1
- package/src/Forms/hooks.tsx +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.250.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@reduxjs/toolkit": "1.9.0",
|
|
52
52
|
"@stripe/react-stripe-js": "2.9.0",
|
|
53
53
|
"@stripe/stripe-js": "1.52.1",
|
|
54
|
-
"@tellescope/constants": "1.
|
|
55
|
-
"@tellescope/sdk": "1.
|
|
56
|
-
"@tellescope/types-client": "1.
|
|
57
|
-
"@tellescope/types-models": "1.
|
|
58
|
-
"@tellescope/types-utilities": "1.
|
|
59
|
-
"@tellescope/utilities": "1.
|
|
60
|
-
"@tellescope/validation": "1.
|
|
54
|
+
"@tellescope/constants": "1.250.1",
|
|
55
|
+
"@tellescope/sdk": "1.250.1",
|
|
56
|
+
"@tellescope/types-client": "1.250.1",
|
|
57
|
+
"@tellescope/types-models": "1.250.1",
|
|
58
|
+
"@tellescope/types-utilities": "1.250.1",
|
|
59
|
+
"@tellescope/utilities": "1.250.1",
|
|
60
|
+
"@tellescope/validation": "1.250.1",
|
|
61
61
|
"@twilio/video-processors": "3.2.0",
|
|
62
62
|
"css-to-react-native": "3.0.0",
|
|
63
63
|
"draft-js": "0.11.7",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
86
86
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "1d3f595cd692366a94bf05bc3c7a31e051ab44e4",
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
|
91
91
|
}
|
package/src/Forms/forms.v2.tsx
CHANGED
|
@@ -49,7 +49,7 @@ const TellescopeFormContainerWithThemeV2: typeof TellescopeFormContainerV2 = ({
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<Flex flex={1} column alignItems="center" style={{
|
|
52
|
-
backgroundColor: finalBgColor,
|
|
52
|
+
backgroundColor: hideBg ? 'transparent' : finalBgColor,
|
|
53
53
|
overflow: 'auto',
|
|
54
54
|
boxSizing: 'border-box',
|
|
55
55
|
paddingTop: window.innerWidth < 600 ? 20 : 40,
|
package/src/Forms/hooks.tsx
CHANGED
|
@@ -1213,13 +1213,24 @@ export const useTellescopeForm = ({ dontAutoadvance, isPublicForm, form, urlLogi
|
|
|
1213
1213
|
// remaining are required, non-empty
|
|
1214
1214
|
|
|
1215
1215
|
if (field.type === 'file' || field.type === 'files') {
|
|
1216
|
-
|
|
1216
|
+
const blobCount = file.blobs?.length ?? 0
|
|
1217
|
+
|
|
1218
|
+
let existingCount = 0
|
|
1219
|
+
if (field.type === 'files' && value.answer.type === 'files' && Array.isArray(value.answer.value)) {
|
|
1220
|
+
existingCount = value.answer.value.filter(av => !file.blobs?.some(b => b.name === av.name)).length
|
|
1221
|
+
} else if (field.type === 'file' && value.answer.type === 'file' && value.answer.value?.secureName) {
|
|
1222
|
+
existingCount = 1
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
const totalCount = blobCount + existingCount
|
|
1226
|
+
|
|
1227
|
+
if (totalCount === 0) {
|
|
1217
1228
|
return "A file is required"
|
|
1218
1229
|
}
|
|
1219
|
-
if (typeof field.options?.min === 'number' &&
|
|
1230
|
+
if (typeof field.options?.min === 'number' && totalCount < field.options.min) {
|
|
1220
1231
|
return `At least ${field.options?.min} file(s) are required`
|
|
1221
1232
|
}
|
|
1222
|
-
if (typeof field.options?.max === 'number' &&
|
|
1233
|
+
if (typeof field.options?.max === 'number' && totalCount > field.options.max) {
|
|
1223
1234
|
return `At most ${field.options?.max} file(s) are allowed`
|
|
1224
1235
|
}
|
|
1225
1236
|
return null // no need to check against other stuff
|