@tellescope/react-components 1.133.1 → 1.134.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/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +28 -20
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/inputs.d.ts +4 -1
- package/lib/cjs/inputs.d.ts.map +1 -1
- package/lib/cjs/inputs.js +2 -2
- package/lib/cjs/inputs.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +28 -20
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/inputs.d.ts +4 -1
- package/lib/esm/inputs.d.ts.map +1 -1
- package/lib/esm/inputs.js +2 -2
- package/lib/esm/inputs.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/Forms/hooks.tsx +8 -0
- package/src/inputs.tsx +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.134.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@reduxjs/toolkit": "^1.6.2",
|
|
48
48
|
"@stripe/react-stripe-js": "^2.1.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.
|
|
50
|
+
"@tellescope/constants": "^1.134.0",
|
|
51
|
+
"@tellescope/sdk": "^1.134.0",
|
|
52
|
+
"@tellescope/types-client": "^1.134.0",
|
|
53
|
+
"@tellescope/types-models": "^1.134.0",
|
|
54
54
|
"@tellescope/types-utilities": "^1.69.3",
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
55
|
+
"@tellescope/utilities": "^1.134.0",
|
|
56
56
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
57
57
|
"@typescript-eslint/parser": "^4.33.0",
|
|
58
58
|
"css-to-react-native": "^3.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
80
80
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "9c40fa515b642f3711e0e19e320e6a0dba2eb849",
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
}
|
package/src/Forms/hooks.tsx
CHANGED
|
@@ -861,6 +861,14 @@ export const useTellescopeForm = ({ form, urlLogicValue, customization, carePlan
|
|
|
861
861
|
return `Must be under 20000 characters, got ${value.answer.value?.length}`
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
+
if (value.answer.type === 'number' && value.answer.value) {
|
|
865
|
+
if ((field.options?.min ?? -Infinity) >= value.answer.value) {
|
|
866
|
+
return `Must be greater than ${field.options?.min}`
|
|
867
|
+
}
|
|
868
|
+
if ((field.options?.max ?? Infinity) <= value.answer.value) {
|
|
869
|
+
return `Must be less than ${field.options?.max}`
|
|
870
|
+
}
|
|
871
|
+
}
|
|
864
872
|
|
|
865
873
|
if (field.isOptional || (sessionType === 'user' && field.type === 'Appointment Booking')) {
|
|
866
874
|
return null
|
package/src/inputs.tsx
CHANGED
|
@@ -95,16 +95,17 @@ export const useFileDropzone = ({ DropzoneComponent=DefaultDropzoneContent, styl
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
type FileUploadHandler = (details: FileDetails, file: Blob | Buffer | ReactNativeFile, options?: {}) => Promise<FileClientType>
|
|
98
|
+
type FileUploadHandler = (details: FileDetails & { externalId?: string, }, file: Blob | Buffer | ReactNativeFile, options?: {}) => Promise<FileClientType>
|
|
99
99
|
interface UseFileUploaderOptions {
|
|
100
100
|
enduserId?: string
|
|
101
101
|
publicRead?: boolean,
|
|
102
102
|
publicName?: string,
|
|
103
103
|
source?: string,
|
|
104
104
|
isCalledOut?: boolean,
|
|
105
|
+
externalId?: string,
|
|
105
106
|
}
|
|
106
107
|
export const useFileUpload = (o={} as UseFileUploaderOptions) => {
|
|
107
|
-
const { enduserId, publicRead, publicName, source, isCalledOut } = o
|
|
108
|
+
const { enduserId, publicRead, publicName, source, isCalledOut, externalId } = o
|
|
108
109
|
const session = useResolvedSession()
|
|
109
110
|
const [, { addLocalElement }] = useFiles({ dontFetch: true })
|
|
110
111
|
|
|
@@ -113,7 +114,7 @@ export const useFileUpload = (o={} as UseFileUploaderOptions) => {
|
|
|
113
114
|
const handleUpload: FileUploadHandler = useCallback(async (details, file) => {
|
|
114
115
|
setUploading(true)
|
|
115
116
|
try {
|
|
116
|
-
const createdFile = await session.prepare_and_upload_file({ ...details, publicName, enduserId, publicRead, source, isCalledOut }, file);
|
|
117
|
+
const createdFile = await session.prepare_and_upload_file({ externalId, ...details, publicName, enduserId, publicRead, source, isCalledOut }, file);
|
|
117
118
|
addLocalElement(createdFile)
|
|
118
119
|
return createdFile
|
|
119
120
|
} catch(err) {
|