@tellescope/react-components 1.214.0 → 1.216.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/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +18 -4
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/esm/CMS/components.d.ts +1 -0
- package/lib/esm/CMS/components.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +3 -3
- 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 +18 -4
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/inputs.native.d.ts +1 -0
- 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 +294 -294
- package/lib/esm/theme.native.d.ts +1 -0
- package/lib/esm/theme.native.d.ts.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/inputs.tsx +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.216.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.216.0",
|
|
51
|
+
"@tellescope/sdk": "^1.216.0",
|
|
52
|
+
"@tellescope/types-client": "^1.216.0",
|
|
53
|
+
"@tellescope/types-models": "^1.216.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.216.0",
|
|
55
|
+
"@tellescope/utilities": "^1.216.0",
|
|
56
|
+
"@tellescope/validation": "^1.216.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",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
84
84
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "0f37ecbd88daecfc7c365b223d81a3d4848efe42",
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
}
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -5,7 +5,7 @@ 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
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
|
-
import { DatabaseSelectResponse, Enduser, EnduserRelationship, FormResponseValue, InsuranceRelationship, MedicationResponse, MultipleChoiceOptions, TellescopeGender, TIMEZONES_USA } from "@tellescope/types-models"
|
|
8
|
+
import { Address, DatabaseSelectResponse, Enduser, EnduserRelationship, FormResponseValue, InsuranceRelationship, MedicationResponse, MultipleChoiceOptions, TellescopeGender, TIMEZONES_USA } from "@tellescope/types-models"
|
|
9
9
|
import { VALID_STATES, emailValidator, phoneValidator } from "@tellescope/validation"
|
|
10
10
|
import Slider from '@mui/material/Slider';
|
|
11
11
|
import LinearProgress from '@mui/material/LinearProgress';
|
|
@@ -1220,6 +1220,14 @@ export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange
|
|
|
1220
1220
|
)
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
|
+
const formatBytes = (bytes: number) => {
|
|
1224
|
+
if (bytes === 0) return '0 Bytes';
|
|
1225
|
+
const k = 1024;
|
|
1226
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
1227
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1228
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1223
1231
|
export async function convertHEIC (file: FileBlob | string){
|
|
1224
1232
|
// get image as blob url
|
|
1225
1233
|
let blobURL = (
|
|
@@ -1250,6 +1258,10 @@ export const FileInput = ({ value, onChange, field, existingFileName, uploadingF
|
|
|
1250
1258
|
const file = acceptedFiles.pop()
|
|
1251
1259
|
if (!file) return
|
|
1252
1260
|
|
|
1261
|
+
if (field.options?.maxFileSize && file.size > field.options.maxFileSize) {
|
|
1262
|
+
return setError(`File size must be less than ${formatBytes(field.options.maxFileSize)}`)
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1253
1265
|
if (field.options?.validFileTypes?.length) {
|
|
1254
1266
|
const match = field.options.validFileTypes.find(t => file.type.includes(t.toLowerCase()))
|
|
1255
1267
|
if (!match) {
|
|
@@ -2012,6 +2024,9 @@ export const DatabaseSelectInput = ({ AddToDatabase, field, value: _value, onCha
|
|
|
2012
2024
|
? (filterResponse as any[]).find(r => r === v.toString() || (typeof r === 'object' && r.text === v))
|
|
2013
2025
|
: (typeof filterResponse === 'string' || typeof filterResponse === 'number')
|
|
2014
2026
|
? filterResponse.toString() === v.toString()
|
|
2027
|
+
: (typeof filterResponse === 'object' && (filterResponse as Address).city === v.toString()) ? true
|
|
2028
|
+
: (typeof filterResponse === 'object' && (filterResponse as Address).state === v.toString()) ? true
|
|
2029
|
+
: (typeof filterResponse === 'object' && (filterResponse as Address).zipCode === v.toString()) ? true
|
|
2015
2030
|
: false
|
|
2016
2031
|
)
|
|
2017
2032
|
}
|