@tellescope/react-components 1.237.4 → 1.237.6
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 +2 -0
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts +12 -12
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +73 -73
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/Forms/inputs.v2.d.ts +11 -11
- package/lib/cjs/Forms/inputs.v2.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.v2.js +47 -47
- package/lib/cjs/Forms/inputs.v2.js.map +1 -1
- package/lib/cjs/Forms/localization.d.ts +2 -1
- package/lib/cjs/Forms/localization.d.ts.map +1 -1
- package/lib/cjs/Forms/localization.js +198 -61
- package/lib/cjs/Forms/localization.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts +2 -0
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +12 -12
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +73 -73
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/inputs.v2.d.ts +11 -11
- package/lib/esm/Forms/inputs.v2.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.v2.js +47 -47
- package/lib/esm/Forms/inputs.v2.js.map +1 -1
- package/lib/esm/Forms/localization.d.ts +2 -1
- package/lib/esm/Forms/localization.d.ts.map +1 -1
- package/lib/esm/Forms/localization.js +196 -60
- package/lib/esm/Forms/localization.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/inputs.tsx +116 -116
- package/src/Forms/inputs.v2.tsx +78 -79
- package/src/Forms/localization.ts +232 -30
package/src/Forms/inputs.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import LinearProgress from '@mui/material/LinearProgress';
|
|
|
13
13
|
import DatePicker from "react-datepicker";
|
|
14
14
|
import { datepickerCSS } from "./css/react-datepicker" // avoids build issue with RN
|
|
15
15
|
import { CancelIcon, FileBlob, IconButton, LabeledIconButton, LoadingButton, Styled, form_display_text_for_language, isDateString, useProducts, useResolvedSession } from ".."
|
|
16
|
-
import { CalendarEvent, DatabaseRecord, FormField } from "@tellescope/types-client"
|
|
16
|
+
import { CalendarEvent, DatabaseRecord, Form, FormField } from "@tellescope/types-client"
|
|
17
17
|
import { css } from '@emotion/css'
|
|
18
18
|
import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
|
|
19
19
|
import DragIndicatorIcon from '@mui/icons-material/DragIndicator';
|
|
@@ -202,7 +202,7 @@ const getListStyle = (isDraggingOver: boolean) => ({
|
|
|
202
202
|
// padding: `${grid}px`,
|
|
203
203
|
// width: '250px'
|
|
204
204
|
});
|
|
205
|
-
export const RankingInput = ({ field, value, onChange }: FormInputProps<'ranking'>) => {
|
|
205
|
+
export const RankingInput = ({ field, value, onChange, form }: FormInputProps<'ranking'>) => {
|
|
206
206
|
return (
|
|
207
207
|
<Grid container direction='column'>
|
|
208
208
|
{/* <Typography>Most</Typography> */}
|
|
@@ -251,7 +251,7 @@ export const RankingInput = ({ field, value, onChange }: FormInputProps<'ranking
|
|
|
251
251
|
</DragDropContext>
|
|
252
252
|
|
|
253
253
|
<Typography color="primary" style={{ marginTop: 3 }}>
|
|
254
|
-
Drag and drop to re-order the above options
|
|
254
|
+
{form_display_text_for_language(form, "Drag and drop to re-order the above options")}
|
|
255
255
|
</Typography>
|
|
256
256
|
|
|
257
257
|
{/* <Typography>Least</Typography> */}
|
|
@@ -289,7 +289,7 @@ export const DateInput = ({
|
|
|
289
289
|
)
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
export const TableInput = ({ field, value=[], onChange, ...props }: FormInputProps<'Input Table'>) => {
|
|
292
|
+
export const TableInput = ({ field, value=[], onChange, form, ...props }: FormInputProps<'Input Table'>) => {
|
|
293
293
|
const choices = field.options?.tableChoices
|
|
294
294
|
|
|
295
295
|
const handleNewRow = useCallback(() => {
|
|
@@ -333,7 +333,7 @@ export const TableInput = ({ field, value=[], onChange, ...props }: FormInputPro
|
|
|
333
333
|
}, [field.isOptional, value, handleNewRow])
|
|
334
334
|
|
|
335
335
|
if (!choices?.length) {
|
|
336
|
-
return <Typography color="error">No input choices available</Typography>
|
|
336
|
+
return <Typography color="error">{form_display_text_for_language(form, "No input choices available")}</Typography>
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
const length = choices.length || 1
|
|
@@ -402,7 +402,7 @@ export const TableInput = ({ field, value=[], onChange, ...props }: FormInputPro
|
|
|
402
402
|
))}
|
|
403
403
|
|
|
404
404
|
<Grid item sx={{ ml: 'auto', width: iconWidth }}>
|
|
405
|
-
<LabeledIconButton Icon={CancelIcon} label="Remove" onClick={() => handleRemove(i)}
|
|
405
|
+
<LabeledIconButton Icon={CancelIcon} label={form_display_text_for_language(form, "Remove")} onClick={() => handleRemove(i)}
|
|
406
406
|
disabled={!field.isOptional && value.length === 1}
|
|
407
407
|
/>
|
|
408
408
|
</Grid>
|
|
@@ -413,7 +413,7 @@ export const TableInput = ({ field, value=[], onChange, ...props }: FormInputPro
|
|
|
413
413
|
))}
|
|
414
414
|
|
|
415
415
|
<Button variant="outlined" size="small" onClick={handleNewRow} sx={{ width: 200 }}>
|
|
416
|
-
Add new entry
|
|
416
|
+
{form_display_text_for_language(form, "Add new entry")}
|
|
417
417
|
</Button>
|
|
418
418
|
</Grid>
|
|
419
419
|
)
|
|
@@ -432,7 +432,7 @@ const CustomDateStringInput = forwardRef((props: TextFieldProps & { inputProps?:
|
|
|
432
432
|
/>
|
|
433
433
|
)
|
|
434
434
|
})
|
|
435
|
-
export const DateStringInput = ({ field, value, onChange, ...props }: FormInputProps<'string'>) => {
|
|
435
|
+
export const DateStringInput = ({ field, value, onChange, form, ...props }: FormInputProps<'string'>) => {
|
|
436
436
|
const inputRef = useRef(null);
|
|
437
437
|
|
|
438
438
|
// if (value && isDateString(value)) {
|
|
@@ -466,7 +466,7 @@ export const DateStringInput = ({ field, value, onChange, ...props }: FormInputP
|
|
|
466
466
|
/>
|
|
467
467
|
)
|
|
468
468
|
: (
|
|
469
|
-
<AutoFocusTextField {...props} required={!field.isOptional} fullWidth placeholder="MM-DD-YYYY" value={value}
|
|
469
|
+
<AutoFocusTextField {...props} required={!field.isOptional} fullWidth placeholder={form_display_text_for_language(form, "MM-DD-YYYY")} value={value}
|
|
470
470
|
label={(!field.title && field.placeholder) ? field.placeholder : props.label}
|
|
471
471
|
onChange={e => {
|
|
472
472
|
const v = e.target.value || ''
|
|
@@ -667,8 +667,8 @@ export const InsuranceInput = ({ field, onDatabaseSelect, value, onChange, form,
|
|
|
667
667
|
}
|
|
668
668
|
renderInput={(params) => (
|
|
669
669
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: (inputProps || defaultInputProps).sx }}
|
|
670
|
-
required={!field.isOptional} size="small" label={"Insurer"}
|
|
671
|
-
placeholder={(field.options?.dataSource === CANVAS_TITLE || field.options?.dataSource === BRIDGE_TITLE) ? "Search insurer..." : "Insurer"}
|
|
670
|
+
required={!field.isOptional} size="small" label={form_display_text_for_language(form, "Insurer")}
|
|
671
|
+
placeholder={(field.options?.dataSource === CANVAS_TITLE || field.options?.dataSource === BRIDGE_TITLE) ? form_display_text_for_language(form, "Search insurer...") : form_display_text_for_language(form, "Insurer")}
|
|
672
672
|
/>
|
|
673
673
|
)}
|
|
674
674
|
/>
|
|
@@ -690,7 +690,7 @@ export const InsuranceInput = ({ field, onDatabaseSelect, value, onChange, form,
|
|
|
690
690
|
</Grid>
|
|
691
691
|
|
|
692
692
|
<Grid item xs={12} sm={6}>
|
|
693
|
-
<DateStringInput size="small" label="Plan Start Date"
|
|
693
|
+
<DateStringInput size="small" label={form_display_text_for_language(form, "Plan Start Date")}
|
|
694
694
|
inputProps={inputProps}
|
|
695
695
|
field={{
|
|
696
696
|
...field,
|
|
@@ -717,7 +717,7 @@ export const InsuranceInput = ({ field, onDatabaseSelect, value, onChange, form,
|
|
|
717
717
|
}
|
|
718
718
|
|
|
719
719
|
<Grid item xs={12}>
|
|
720
|
-
<StringSelector size="small" label="Relationship to Policy Owner"
|
|
720
|
+
<StringSelector size="small" label={form_display_text_for_language(form, "Relationship to Policy Owner")}
|
|
721
721
|
inputProps={inputProps}
|
|
722
722
|
options={
|
|
723
723
|
(
|
|
@@ -737,11 +737,11 @@ export const InsuranceInput = ({ field, onDatabaseSelect, value, onChange, form,
|
|
|
737
737
|
{(value?.relationship || 'Self') !== 'Self' &&
|
|
738
738
|
<>
|
|
739
739
|
<Grid item xs={12}>
|
|
740
|
-
<Typography sx={{ fontWeight: 'bold' }}>Policy Owner Details</Typography>
|
|
740
|
+
<Typography sx={{ fontWeight: 'bold' }}>{form_display_text_for_language(form, "Policy Owner Details")}</Typography>
|
|
741
741
|
</Grid>
|
|
742
742
|
|
|
743
743
|
<Grid item xs={6}>
|
|
744
|
-
<TextField label="First Name" size="small" InputProps={inputProps || defaultInputProps} fullWidth
|
|
744
|
+
<TextField label={form_display_text_for_language(form, "First Name")} size="small" InputProps={inputProps || defaultInputProps} fullWidth
|
|
745
745
|
value={value?.relationshipDetails?.fname || ''}
|
|
746
746
|
required={!field.isOptional}
|
|
747
747
|
onChange={e =>
|
|
@@ -753,7 +753,7 @@ export const InsuranceInput = ({ field, onDatabaseSelect, value, onChange, form,
|
|
|
753
753
|
/>
|
|
754
754
|
</Grid>
|
|
755
755
|
<Grid item xs={6}>
|
|
756
|
-
<TextField label="Last Name" size="small" InputProps={inputProps || defaultInputProps} fullWidth
|
|
756
|
+
<TextField label={form_display_text_for_language(form, "Last Name")} size="small" InputProps={inputProps || defaultInputProps} fullWidth
|
|
757
757
|
value={value?.relationshipDetails?.lname || ''}
|
|
758
758
|
required={!field.isOptional}
|
|
759
759
|
onChange={e =>
|
|
@@ -765,7 +765,7 @@ export const InsuranceInput = ({ field, onDatabaseSelect, value, onChange, form,
|
|
|
765
765
|
/>
|
|
766
766
|
</Grid>
|
|
767
767
|
<Grid item xs={6}>
|
|
768
|
-
<StringSelector options={TELLESCOPE_GENDERS} size="small" label="Gender"
|
|
768
|
+
<StringSelector options={TELLESCOPE_GENDERS} size="small" label={form_display_text_for_language(form, "Gender")}
|
|
769
769
|
inputProps={inputProps}
|
|
770
770
|
value={value?.relationshipDetails?.gender || ''}
|
|
771
771
|
required={!field.isOptional}
|
|
@@ -778,7 +778,7 @@ export const InsuranceInput = ({ field, onDatabaseSelect, value, onChange, form,
|
|
|
778
778
|
/>
|
|
779
779
|
</Grid>
|
|
780
780
|
<Grid item xs={6}>
|
|
781
|
-
<DateStringInput size="small" label="Date of Birth"
|
|
781
|
+
<DateStringInput size="small" label={form_display_text_for_language(form, "Date of Birth")}
|
|
782
782
|
inputProps={inputProps}
|
|
783
783
|
field={{
|
|
784
784
|
...field,
|
|
@@ -962,7 +962,7 @@ const StringSelector = ({ options, value, onChange, required, getDisplayValue, i
|
|
|
962
962
|
</FormControl>
|
|
963
963
|
)
|
|
964
964
|
|
|
965
|
-
export const BridgeEligibilityInput = ({ field, value, onChange, responses, enduser, inputProps, enduserId, ...props }: FormInputProps<'Bridge Eligibility'> & {
|
|
965
|
+
export const BridgeEligibilityInput = ({ field, value, onChange, responses, enduser, inputProps, enduserId, form, ...props }: FormInputProps<'Bridge Eligibility'> & {
|
|
966
966
|
inputProps?: { sx: SxProps },
|
|
967
967
|
}) => {
|
|
968
968
|
const session = useResolvedSession()
|
|
@@ -1375,7 +1375,7 @@ export const BridgeEligibilityInput = ({ field, value, onChange, responses, endu
|
|
|
1375
1375
|
{polling && (
|
|
1376
1376
|
<Grid item>
|
|
1377
1377
|
<Typography variant="body2" color="primary">
|
|
1378
|
-
Polling for results... (this may take 15-30 seconds)
|
|
1378
|
+
{form_display_text_for_language(form, "Polling for results... (this may take 15-30 seconds)")}
|
|
1379
1379
|
</Typography>
|
|
1380
1380
|
</Grid>
|
|
1381
1381
|
)}
|
|
@@ -1385,8 +1385,8 @@ export const BridgeEligibilityInput = ({ field, value, onChange, responses, endu
|
|
|
1385
1385
|
<LoadingButton
|
|
1386
1386
|
variant="outlined"
|
|
1387
1387
|
onClick={checkProviderEligibility}
|
|
1388
|
-
submitText="Check Provider Eligibility (Free)"
|
|
1389
|
-
submittingText="Checking..."
|
|
1388
|
+
submitText={form_display_text_for_language(form, "Check Provider Eligibility (Free)")}
|
|
1389
|
+
submittingText={form_display_text_for_language(form, "Checking...")}
|
|
1390
1390
|
submitting={loading && !polling}
|
|
1391
1391
|
disabled={!field.options?.bridgeServiceTypeIds?.length || loading || polling}
|
|
1392
1392
|
/>
|
|
@@ -1395,8 +1395,8 @@ export const BridgeEligibilityInput = ({ field, value, onChange, responses, endu
|
|
|
1395
1395
|
<LoadingButton
|
|
1396
1396
|
variant="outlined"
|
|
1397
1397
|
onClick={checkServiceEligibility}
|
|
1398
|
-
submitText="Check Service Eligibility (Paid)"
|
|
1399
|
-
submittingText={polling ? "Polling..." : "Initiating..."}
|
|
1398
|
+
submitText={form_display_text_for_language(form, "Check Service Eligibility (Paid)")}
|
|
1399
|
+
submittingText={polling ? form_display_text_for_language(form, "Polling...") : form_display_text_for_language(form, "Initiating...")}
|
|
1400
1400
|
submitting={loading || polling}
|
|
1401
1401
|
disabled={!field.options?.bridgeServiceTypeIds?.length || loading || polling}
|
|
1402
1402
|
/>
|
|
@@ -1578,10 +1578,10 @@ export const AddressInput = ({ field, form, value, onChange, ...props }: FormInp
|
|
|
1578
1578
|
|
|
1579
1579
|
{field.fullZIP &&
|
|
1580
1580
|
<Grid item xs={3}>
|
|
1581
|
-
<TextField {...props} size="small" label="ZIP+4" required={!field.isOptional && field.fullZIP}
|
|
1581
|
+
<TextField {...props} size="small" label={form_display_text_for_language(form, "ZIP+4")} required={!field.isOptional && field.fullZIP}
|
|
1582
1582
|
InputProps={defaultInputProps}
|
|
1583
|
-
value={value?.zipPlusFour ?? ''}
|
|
1584
|
-
placeholder="ZIP + 4"
|
|
1583
|
+
value={value?.zipPlusFour ?? ''}
|
|
1584
|
+
placeholder={form_display_text_for_language(form, "ZIP + 4")}
|
|
1585
1585
|
onChange={e =>
|
|
1586
1586
|
onChange({
|
|
1587
1587
|
...value as any,
|
|
@@ -1637,7 +1637,7 @@ export const ESignatureTerms = () => {
|
|
|
1637
1637
|
)
|
|
1638
1638
|
}
|
|
1639
1639
|
|
|
1640
|
-
export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange }: FormInputProps<'signature'>) => {
|
|
1640
|
+
export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange, form }: FormInputProps<'signature'>) => {
|
|
1641
1641
|
const prefill = (
|
|
1642
1642
|
field.options?.prefillSignature && enduser?.fname && enduser.lname
|
|
1643
1643
|
? `${enduser.fname} ${enduser.lname}`
|
|
@@ -1671,8 +1671,8 @@ export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange
|
|
|
1671
1671
|
}
|
|
1672
1672
|
{!field.options?.pdfAttachment && field.options?.signatureUrl &&
|
|
1673
1673
|
<Grid container direction="column" sx={{ mb: 2 }}>
|
|
1674
|
-
<iframe src={field.options.signatureUrl}
|
|
1675
|
-
style={{
|
|
1674
|
+
<iframe src={field.options.signatureUrl}
|
|
1675
|
+
style={{
|
|
1676
1676
|
border: 'none',
|
|
1677
1677
|
height: 400,
|
|
1678
1678
|
width: '100%',
|
|
@@ -1680,12 +1680,12 @@ export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange
|
|
|
1680
1680
|
}}
|
|
1681
1681
|
/>
|
|
1682
1682
|
<a href={field.options.signatureUrl} target="_blank" rel="noopener noreferrer">
|
|
1683
|
-
View document in new tab
|
|
1683
|
+
{form_display_text_for_language(form, "View document in new tab")}
|
|
1684
1684
|
</a>
|
|
1685
1685
|
</Grid>
|
|
1686
1686
|
}
|
|
1687
1687
|
|
|
1688
|
-
<Grid item xs={12}>
|
|
1688
|
+
<Grid item xs={12}>
|
|
1689
1689
|
<Checkbox
|
|
1690
1690
|
style={{ margin: 0, marginTop: 5, padding: 0, paddingRight: 3 }}
|
|
1691
1691
|
color="primary"
|
|
@@ -1693,9 +1693,8 @@ export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange
|
|
|
1693
1693
|
onClick={() => handleConsentChange()}
|
|
1694
1694
|
inputProps={{ 'aria-label': 'consent to e-signature checkbox' }}
|
|
1695
1695
|
/>
|
|
1696
|
-
<Typography component="span" style={{ position: 'relative', top: 5, left: 2 }}>
|
|
1697
|
-
I consent to
|
|
1698
|
-
use <a href={`/e-signature-terms?name=${field.options?.esignatureTermsCompanyName || ''}`} target="_blank" rel="noopener noreferrer"> electronic signatures </a>
|
|
1696
|
+
<Typography component="span" style={{ position: 'relative', top: 5, left: 2 }}>
|
|
1697
|
+
{form_display_text_for_language(form, "I consent to use")} <a href={`/e-signature-terms?name=${field.options?.esignatureTermsCompanyName || ''}`} target="_blank" rel="noopener noreferrer"> {form_display_text_for_language(form, "electronic signatures")} </a>
|
|
1699
1698
|
</Typography>
|
|
1700
1699
|
</Grid>
|
|
1701
1700
|
|
|
@@ -1703,14 +1702,14 @@ export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange
|
|
|
1703
1702
|
<TextField disabled={!value?.signed} autoFocus={autoFocus}
|
|
1704
1703
|
style={{ width: '100%'}}
|
|
1705
1704
|
size="small"
|
|
1706
|
-
aria-label="Full Name"
|
|
1707
|
-
value={value?.fullName}
|
|
1708
|
-
placeholder={prefill || "Full Name"} variant="outlined"
|
|
1705
|
+
aria-label={form_display_text_for_language(form, "Full Name")}
|
|
1706
|
+
value={value?.fullName}
|
|
1707
|
+
placeholder={prefill || form_display_text_for_language(form, "Full Name")} variant="outlined"
|
|
1709
1708
|
onChange={e => handleNameChange(e.target.value)}
|
|
1710
1709
|
InputProps={defaultInputProps}
|
|
1711
1710
|
/>
|
|
1712
|
-
<Typography color="primary" style={{ fontSize: 15, marginTop: 2 }}>
|
|
1713
|
-
Enter your legal full name to complete the signature
|
|
1711
|
+
<Typography color="primary" style={{ fontSize: 15, marginTop: 2 }}>
|
|
1712
|
+
{form_display_text_for_language(form, "Enter your legal full name to complete the signature")}
|
|
1714
1713
|
</Typography>
|
|
1715
1714
|
</Grid>
|
|
1716
1715
|
</Grid>
|
|
@@ -1747,7 +1746,7 @@ export async function convertHEIC (file: FileBlob | string){
|
|
|
1747
1746
|
};
|
|
1748
1747
|
|
|
1749
1748
|
const value_is_image = (f?: { type?: string })=> f?.type?.includes('image')
|
|
1750
|
-
export const FileInput = ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles }: FormInputProps<'file'> & { existingFileName?: string }) => {
|
|
1749
|
+
export const FileInput = ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles, form }: FormInputProps<'file'> & { existingFileName?: string }) => {
|
|
1751
1750
|
const [error, setError] = useState('')
|
|
1752
1751
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
1753
1752
|
onDrop: useCallback(
|
|
@@ -1826,16 +1825,16 @@ export const FileInput = ({ value, onChange, field, existingFileName, uploadingF
|
|
|
1826
1825
|
? (
|
|
1827
1826
|
<Grid container direction="column" alignItems="center">
|
|
1828
1827
|
<Grid item>
|
|
1829
|
-
<AddPhotoAlternateIcon color="primary" />
|
|
1828
|
+
<AddPhotoAlternateIcon color="primary" />
|
|
1830
1829
|
</Grid>
|
|
1831
1830
|
<Grid item>
|
|
1832
1831
|
<Typography sx={{ fontSize: 14, textAlign: 'center' }}>
|
|
1833
|
-
Select file or take picture
|
|
1832
|
+
{form_display_text_for_language(form, "Select file or take picture")}
|
|
1834
1833
|
</Typography>
|
|
1835
1834
|
</Grid>
|
|
1836
1835
|
</Grid>
|
|
1837
1836
|
)
|
|
1838
|
-
: "Select a File"
|
|
1837
|
+
: form_display_text_for_language(form, "Select a File")
|
|
1839
1838
|
}
|
|
1840
1839
|
</p>
|
|
1841
1840
|
}
|
|
@@ -1864,7 +1863,7 @@ export const safe_create_url = (file: any) => {
|
|
|
1864
1863
|
}
|
|
1865
1864
|
}
|
|
1866
1865
|
|
|
1867
|
-
export const FilesInput = ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles }: FormInputProps<'files'> & { existingFileName?: string }) => {
|
|
1866
|
+
export const FilesInput = ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles, form }: FormInputProps<'files'> & { existingFileName?: string }) => {
|
|
1868
1867
|
const [error, setError] = useState('')
|
|
1869
1868
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
1870
1869
|
onDrop: useCallback(
|
|
@@ -1915,23 +1914,23 @@ export const FilesInput = ({ value, onChange, field, existingFileName, uploading
|
|
|
1915
1914
|
<input {...getInputProps({ multiple: false })} />
|
|
1916
1915
|
{
|
|
1917
1916
|
<p>
|
|
1918
|
-
{isDragActive
|
|
1919
|
-
? "Drop to select files"
|
|
1917
|
+
{isDragActive
|
|
1918
|
+
? form_display_text_for_language(form, "Drop to select files")
|
|
1920
1919
|
: capture_is_supported()
|
|
1921
1920
|
? (
|
|
1922
1921
|
<Grid container direction="column" alignItems="center">
|
|
1923
1922
|
<Grid item>
|
|
1924
|
-
<AddPhotoAlternateIcon color="primary" />
|
|
1923
|
+
<AddPhotoAlternateIcon color="primary" />
|
|
1925
1924
|
</Grid>
|
|
1926
1925
|
<Grid item>
|
|
1927
1926
|
<Typography sx={{ fontSize: 14, textAlign: 'center' }}>
|
|
1928
|
-
Select files or take pictures
|
|
1927
|
+
{form_display_text_for_language(form, "Select files or take pictures")}
|
|
1929
1928
|
</Typography>
|
|
1930
1929
|
</Grid>
|
|
1931
1930
|
</Grid>
|
|
1932
1931
|
)
|
|
1933
|
-
: "Select Files"
|
|
1934
|
-
// preview
|
|
1932
|
+
: form_display_text_for_language(form, "Select Files")
|
|
1933
|
+
// preview
|
|
1935
1934
|
// ? <img src={preview} style={{ paddingLeft: '10%', width : '80%', maxHeight: 200 }} />
|
|
1936
1935
|
// : `${truncate_string(value.name, { length: 30, showEllipsis: true })} selected!`
|
|
1937
1936
|
}
|
|
@@ -1969,7 +1968,7 @@ export const FilesInput = ({ value, onChange, field, existingFileName, uploading
|
|
|
1969
1968
|
</Grid>
|
|
1970
1969
|
|
|
1971
1970
|
<Grid item>
|
|
1972
|
-
<LabeledIconButton label="Remove"
|
|
1971
|
+
<LabeledIconButton label={form_display_text_for_language(form, "Remove")}
|
|
1973
1972
|
Icon={Delete}
|
|
1974
1973
|
onClick={() => onChange(value.filter((f, _i) => i !== _i), field.id)}
|
|
1975
1974
|
/>
|
|
@@ -1978,7 +1977,7 @@ export const FilesInput = ({ value, onChange, field, existingFileName, uploading
|
|
|
1978
1977
|
</Grid>
|
|
1979
1978
|
))}
|
|
1980
1979
|
</Grid>
|
|
1981
|
-
|
|
1980
|
+
|
|
1982
1981
|
{error &&
|
|
1983
1982
|
<Grid item alignSelf="center" sx={{ mt: 0.5 }}>
|
|
1984
1983
|
<Typography color="error">{error}</Typography>
|
|
@@ -2360,7 +2359,7 @@ export const StripeInput = ({ field, value, onChange, setCustomerId, enduserId,
|
|
|
2360
2359
|
<LinearProgress />
|
|
2361
2360
|
</Grid>
|
|
2362
2361
|
<Grid item>
|
|
2363
|
-
<Typography>Loading product information
|
|
2362
|
+
<Typography>{form_display_text_for_language(form, "Loading product information...")}</Typography>
|
|
2364
2363
|
</Grid>
|
|
2365
2364
|
</Grid>
|
|
2366
2365
|
)
|
|
@@ -2520,15 +2519,16 @@ export const StripeInput = ({ field, value, onChange, setCustomerId, enduserId,
|
|
|
2520
2519
|
<Elements stripe={stripePromise} options={{
|
|
2521
2520
|
clientSecret,
|
|
2522
2521
|
}}>
|
|
2523
|
-
<StripeForm businessName={businessName} onSuccess={() => onChange(answertext || 'Saved card details', field.id)}
|
|
2522
|
+
<StripeForm businessName={businessName} onSuccess={() => onChange(answertext || 'Saved card details', field.id)}
|
|
2524
2523
|
cost={cost}
|
|
2525
2524
|
field={field}
|
|
2525
|
+
form={form}
|
|
2526
2526
|
/>
|
|
2527
2527
|
</Elements>
|
|
2528
2528
|
)
|
|
2529
2529
|
}
|
|
2530
2530
|
|
|
2531
|
-
const StripeForm = ({ businessName, onSuccess, field, cost } : { businessName: string, onSuccess: () => void, field: FormField, cost: number }) => {
|
|
2531
|
+
const StripeForm = ({ businessName, onSuccess, field, cost, form } : { businessName: string, onSuccess: () => void, field: FormField, cost: number, form?: Form }) => {
|
|
2532
2532
|
const stripe = useStripe();
|
|
2533
2533
|
const elements = useElements()
|
|
2534
2534
|
|
|
@@ -2578,7 +2578,7 @@ const StripeForm = ({ businessName, onSuccess, field, cost } : { businessName: s
|
|
|
2578
2578
|
<Button variant="contained" color="primary" type="submit" sx={{ mt: 1 }}
|
|
2579
2579
|
disabled={!(stripe && ready)}
|
|
2580
2580
|
>
|
|
2581
|
-
{field.options?.chargeImmediately ? 'Make Payment' : 'Save Payment Details'}
|
|
2581
|
+
{field.options?.chargeImmediately ? form_display_text_for_language(form, 'Make Payment') : form_display_text_for_language(form, 'Save Payment Details')}
|
|
2582
2582
|
</Button>
|
|
2583
2583
|
|
|
2584
2584
|
{cost > 0 &&
|
|
@@ -3218,7 +3218,7 @@ type CanvasMedicationResult = {
|
|
|
3218
3218
|
entry?: { resource: { code: { coding: { system: string, code: string, display: string } []}} }[]
|
|
3219
3219
|
}
|
|
3220
3220
|
|
|
3221
|
-
export const CanvasMedicationsInput = ({ field, value=[], onChange }: FormInputProps<'Medications'>) => {
|
|
3221
|
+
export const CanvasMedicationsInput = ({ field, value=[], onChange, form }: FormInputProps<'Medications'>) => {
|
|
3222
3222
|
const session = useResolvedSession()
|
|
3223
3223
|
const [query, setQuery] = useState('')
|
|
3224
3224
|
const [results, setResults] = useState<MedicationResponse[]>([])
|
|
@@ -3266,7 +3266,7 @@ export const CanvasMedicationsInput = ({ field, value=[], onChange }: FormInputP
|
|
|
3266
3266
|
<Grid container direction="column" spacing={1}>
|
|
3267
3267
|
<Grid item>
|
|
3268
3268
|
<Autocomplete multiple value={value} options={results} style={{ marginTop: 5 }}
|
|
3269
|
-
noOptionsText={query.length ? 'No results found' : 'Type to start search'}
|
|
3269
|
+
noOptionsText={query.length ? form_display_text_for_language(form, 'No results found') : form_display_text_for_language(form, 'Type to start search')}
|
|
3270
3270
|
onChange={(e, v) => {
|
|
3271
3271
|
if (!v) { return }
|
|
3272
3272
|
onChange(v, field.id)
|
|
@@ -3276,7 +3276,7 @@ export const CanvasMedicationsInput = ({ field, value=[], onChange }: FormInputP
|
|
|
3276
3276
|
inputValue={query} onInputChange={(e, v) => e && setQuery(v) }
|
|
3277
3277
|
renderInput={(params) => (
|
|
3278
3278
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
3279
|
-
required={!field.isOptional} size="small" label="" placeholder="Search medications..."
|
|
3279
|
+
required={!field.isOptional} size="small" label="" placeholder={form_display_text_for_language(form, "Search medications...")}
|
|
3280
3280
|
/>
|
|
3281
3281
|
)}
|
|
3282
3282
|
renderTags={(value, getTagProps) =>
|
|
@@ -3302,7 +3302,7 @@ export const CanvasMedicationsInput = ({ field, value=[], onChange }: FormInputP
|
|
|
3302
3302
|
|
|
3303
3303
|
<Grid item>
|
|
3304
3304
|
<TextField InputProps={{ sx: defaultInputProps.sx }} fullWidth size="small"
|
|
3305
|
-
label="Medication instructions: how much you take, how often, and when"
|
|
3305
|
+
label={form_display_text_for_language(form, "Medication instructions: how much you take, how often, and when")}
|
|
3306
3306
|
value={medication.dosage?.description || ''}
|
|
3307
3307
|
onChange={e => (
|
|
3308
3308
|
onChange((value || []).map((v, _i) =>
|
|
@@ -3325,7 +3325,7 @@ export const CanvasMedicationsInput = ({ field, value=[], onChange }: FormInputP
|
|
|
3325
3325
|
)
|
|
3326
3326
|
}
|
|
3327
3327
|
|
|
3328
|
-
export const MedicationsInput = ({ field, value, onChange, ...props }: FormInputProps<'Medications'>) => {
|
|
3328
|
+
export const MedicationsInput = ({ field, value, onChange, form, ...props }: FormInputProps<'Medications'>) => {
|
|
3329
3329
|
const { displayTerms, doneLoading, getCodesForDrug, getDrugsForDisplayTerm } = useMedications({
|
|
3330
3330
|
dontFetch: field.options?.dataSource === CANVAS_TITLE
|
|
3331
3331
|
})
|
|
@@ -3416,10 +3416,10 @@ export const MedicationsInput = ({ field, value, onChange, ...props }: FormInput
|
|
|
3416
3416
|
field.id,
|
|
3417
3417
|
)
|
|
3418
3418
|
}}
|
|
3419
|
-
renderInput={params =>
|
|
3420
|
-
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }} required={!field.isOptional} label="Search" size="small" fullWidth />
|
|
3419
|
+
renderInput={params =>
|
|
3420
|
+
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }} required={!field.isOptional} label={form_display_text_for_language(form, "Search")} size="small" fullWidth />
|
|
3421
3421
|
}
|
|
3422
|
-
/>
|
|
3422
|
+
/>
|
|
3423
3423
|
</Grid>
|
|
3424
3424
|
|
|
3425
3425
|
{v.displayTerm && v.drugName !== "Unknown" && !v.otherDrug &&
|
|
@@ -3442,15 +3442,15 @@ export const MedicationsInput = ({ field, value, onChange, ...props }: FormInput
|
|
|
3442
3442
|
if (!drug) return
|
|
3443
3443
|
|
|
3444
3444
|
const info = (
|
|
3445
|
-
drug.name === 'Unknown'
|
|
3445
|
+
drug.name === 'Unknown'
|
|
3446
3446
|
? await getCodesForDrug(v.displayTerm) // might get us a value, better than searching Unknown or keeping a prior value
|
|
3447
3447
|
: await getCodesForDrug(drug.name)
|
|
3448
3448
|
)
|
|
3449
3449
|
onChange(
|
|
3450
3450
|
(value ?? []).map((_v, _i) => (
|
|
3451
3451
|
i === _i
|
|
3452
|
-
? {
|
|
3453
|
-
..._v,
|
|
3452
|
+
? {
|
|
3453
|
+
..._v,
|
|
3454
3454
|
drugName: drug.name,
|
|
3455
3455
|
drugSynonym: drug.synonym || '',
|
|
3456
3456
|
...info,
|
|
@@ -3460,16 +3460,16 @@ export const MedicationsInput = ({ field, value, onChange, ...props }: FormInput
|
|
|
3460
3460
|
field.id,
|
|
3461
3461
|
)
|
|
3462
3462
|
}}
|
|
3463
|
-
renderInput={params =>
|
|
3464
|
-
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }} required={!field.isOptional} label="Drug Select" size="small" fullWidth />
|
|
3463
|
+
renderInput={params =>
|
|
3464
|
+
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }} required={!field.isOptional} label={form_display_text_for_language(form, "Drug Select")} size="small" fullWidth />
|
|
3465
3465
|
}
|
|
3466
|
-
/>
|
|
3466
|
+
/>
|
|
3467
3467
|
</Grid>
|
|
3468
3468
|
}
|
|
3469
3469
|
|
|
3470
|
-
{v.displayTerm && (v.drugName === "Unknown" || !v.drugName) &&
|
|
3470
|
+
{v.displayTerm && (v.drugName === "Unknown" || !v.drugName) &&
|
|
3471
3471
|
<Grid item sx={{ mt: 1 }}>
|
|
3472
|
-
<TextField label='Other Drug' fullWidth size="small" required
|
|
3472
|
+
<TextField label={form_display_text_for_language(form, 'Other Drug')} fullWidth size="small" required
|
|
3473
3473
|
InputProps={defaultInputProps}
|
|
3474
3474
|
value={value?.find((v, _i) => _i === i)?.otherDrug ?? ''}
|
|
3475
3475
|
onChange={e => (
|
|
@@ -3562,7 +3562,7 @@ export const MedicationsInput = ({ field, value, onChange, ...props }: FormInput
|
|
|
3562
3562
|
|
|
3563
3563
|
{v.displayTerm &&
|
|
3564
3564
|
<Grid item sx={{ mt: 1.25 }}>
|
|
3565
|
-
<TextField label="Reason for taking medication" size="small" fullWidth
|
|
3565
|
+
<TextField label={form_display_text_for_language(form, "Reason for taking medication")} size="small" fullWidth
|
|
3566
3566
|
InputProps={defaultInputProps}
|
|
3567
3567
|
value={v.reasonForTaking ?? ''}
|
|
3568
3568
|
onChange={e =>
|
|
@@ -3586,7 +3586,7 @@ export const MedicationsInput = ({ field, value, onChange, ...props }: FormInput
|
|
|
3586
3586
|
<Typography color="primary" sx={{ textDecoration: 'underline', cursor: 'pointer' }}
|
|
3587
3587
|
onClick={() => onChange((value ?? []).filter((_, _i) => i !== _i), field.id)}
|
|
3588
3588
|
>
|
|
3589
|
-
Remove medication
|
|
3589
|
+
{form_display_text_for_language(form, "Remove medication")}
|
|
3590
3590
|
</Typography>
|
|
3591
3591
|
</Grid>
|
|
3592
3592
|
|
|
@@ -3614,17 +3614,17 @@ export const MedicationsInput = ({ field, value, onChange, ...props }: FormInput
|
|
|
3614
3614
|
))}
|
|
3615
3615
|
|
|
3616
3616
|
<Grid item>
|
|
3617
|
-
<Button color="primary" variant="outlined"
|
|
3617
|
+
<Button color="primary" variant="outlined"
|
|
3618
3618
|
onClick={() => onChange([...(value ?? []), { displayTerm: '', drugName: '' }], field.id)}
|
|
3619
3619
|
>
|
|
3620
|
-
Add Medication
|
|
3620
|
+
{form_display_text_for_language(form, "Add Medication")}
|
|
3621
3621
|
</Button>
|
|
3622
3622
|
</Grid>
|
|
3623
3623
|
</Grid>
|
|
3624
3624
|
)
|
|
3625
3625
|
}
|
|
3626
3626
|
|
|
3627
|
-
export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }: FormInputProps<'Beluga Patient Preference'>) => {
|
|
3627
|
+
export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange, form }: FormInputProps<'Beluga Patient Preference'>) => {
|
|
3628
3628
|
const value = Array.isArray(_value) ? _value : []
|
|
3629
3629
|
|
|
3630
3630
|
return (
|
|
@@ -3636,7 +3636,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3636
3636
|
<Grid item sx={{ width: '100%'}}>
|
|
3637
3637
|
<Grid container direction="column" spacing={1.5}>
|
|
3638
3638
|
<Grid item>
|
|
3639
|
-
<TextField label="Medication Name" size="small" fullWidth required
|
|
3639
|
+
<TextField label={form_display_text_for_language(form, "Medication Name")} size="small" fullWidth required
|
|
3640
3640
|
value={v.name ?? ''}
|
|
3641
3641
|
onChange={e =>
|
|
3642
3642
|
onChange(
|
|
@@ -3652,7 +3652,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3652
3652
|
<Grid item>
|
|
3653
3653
|
<Grid container spacing={1}>
|
|
3654
3654
|
<Grid item xs={12} md={6}>
|
|
3655
|
-
<TextField label="Strength" size="small" fullWidth required
|
|
3655
|
+
<TextField label={form_display_text_for_language(form, "Strength")} size="small" fullWidth required
|
|
3656
3656
|
value={v.strength ?? ''}
|
|
3657
3657
|
onChange={e =>
|
|
3658
3658
|
onChange(
|
|
@@ -3665,7 +3665,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3665
3665
|
/>
|
|
3666
3666
|
</Grid>
|
|
3667
3667
|
<Grid item xs={12} md={6}>
|
|
3668
|
-
<TextField label="Dispense Unit" size="small" fullWidth required
|
|
3668
|
+
<TextField label={form_display_text_for_language(form, "Dispense Unit")} size="small" fullWidth required
|
|
3669
3669
|
value={v.dispenseUnit ?? ''}
|
|
3670
3670
|
onChange={e =>
|
|
3671
3671
|
onChange(
|
|
@@ -3683,7 +3683,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3683
3683
|
<Grid item>
|
|
3684
3684
|
<Grid container spacing={1}>
|
|
3685
3685
|
<Grid item xs={12} md={4}>
|
|
3686
|
-
<TextField label="Quantity" size="small" fullWidth required
|
|
3686
|
+
<TextField label={form_display_text_for_language(form, "Quantity")} size="small" fullWidth required
|
|
3687
3687
|
value={v.quantity ?? ''}
|
|
3688
3688
|
onChange={e =>
|
|
3689
3689
|
onChange(
|
|
@@ -3696,7 +3696,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3696
3696
|
/>
|
|
3697
3697
|
</Grid>
|
|
3698
3698
|
<Grid item xs={12} md={4}>
|
|
3699
|
-
<TextField label="Refills" size="small" fullWidth required
|
|
3699
|
+
<TextField label={form_display_text_for_language(form, "Refills")} size="small" fullWidth required
|
|
3700
3700
|
value={v.refills ?? ''}
|
|
3701
3701
|
onChange={e =>
|
|
3702
3702
|
onChange(
|
|
@@ -3709,7 +3709,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3709
3709
|
/>
|
|
3710
3710
|
</Grid>
|
|
3711
3711
|
<Grid item xs={12} md={4}>
|
|
3712
|
-
<TextField label="Days Supply" size="small" fullWidth required
|
|
3712
|
+
<TextField label={form_display_text_for_language(form, "Days Supply")} size="small" fullWidth required
|
|
3713
3713
|
value={v.daysSupply ?? ''}
|
|
3714
3714
|
onChange={e =>
|
|
3715
3715
|
onChange(
|
|
@@ -3725,7 +3725,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3725
3725
|
</Grid>
|
|
3726
3726
|
|
|
3727
3727
|
<Grid item>
|
|
3728
|
-
<TextField label="Sig (Instructions)" size="small" fullWidth required multiline rows={2}
|
|
3728
|
+
<TextField label={form_display_text_for_language(form, "Sig (Instructions)")} size="small" fullWidth required multiline rows={2}
|
|
3729
3729
|
value={v.sig ?? ''}
|
|
3730
3730
|
onChange={e =>
|
|
3731
3731
|
onChange(
|
|
@@ -3739,7 +3739,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3739
3739
|
</Grid>
|
|
3740
3740
|
|
|
3741
3741
|
<Grid item>
|
|
3742
|
-
<TextField label="Med ID (NDC11)" size="small" fullWidth required
|
|
3742
|
+
<TextField label={form_display_text_for_language(form, "Med ID (NDC11)")} size="small" fullWidth required
|
|
3743
3743
|
value={v.medId ?? ''}
|
|
3744
3744
|
onChange={e =>
|
|
3745
3745
|
onChange(
|
|
@@ -3756,7 +3756,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3756
3756
|
<Typography color="primary" sx={{ textDecoration: 'underline', cursor: 'pointer' }}
|
|
3757
3757
|
onClick={() => onChange(value.filter((_, _i) => i !== _i), field.id)}
|
|
3758
3758
|
>
|
|
3759
|
-
Remove medication
|
|
3759
|
+
{form_display_text_for_language(form, "Remove medication")}
|
|
3760
3760
|
</Typography>
|
|
3761
3761
|
</Grid>
|
|
3762
3762
|
</Grid>
|
|
@@ -3775,7 +3775,7 @@ export const BelugaPatientPreferenceInput = ({ field, value: _value, onChange }:
|
|
|
3775
3775
|
{ name: '', strength: '', quantity: '', refills: '', daysSupply: '', sig: '', dispenseUnit: '', medId: '' }
|
|
3776
3776
|
], field.id)}
|
|
3777
3777
|
>
|
|
3778
|
-
Add Medication
|
|
3778
|
+
{form_display_text_for_language(form, "Add Medication")}
|
|
3779
3779
|
</Button>
|
|
3780
3780
|
</Grid>
|
|
3781
3781
|
</Grid>
|
|
@@ -3802,7 +3802,7 @@ export const contact_is_valid = (e: Partial<Enduser>) => {
|
|
|
3802
3802
|
}
|
|
3803
3803
|
}
|
|
3804
3804
|
|
|
3805
|
-
export const RelatedContactsInput = ({ field, value: _value, onChange, error: parentError, ...props }: FormInputProps<'Related Contacts'>) => {
|
|
3805
|
+
export const RelatedContactsInput = ({ field, value: _value, onChange, error: parentError, form, ...props }: FormInputProps<'Related Contacts'>) => {
|
|
3806
3806
|
// safeguard against any rogue values like empty string
|
|
3807
3807
|
const value = Array.isArray(_value) ? _value : []
|
|
3808
3808
|
|
|
@@ -3828,7 +3828,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3828
3828
|
<Grid container alignItems="center" wrap="nowrap" spacing={1}>
|
|
3829
3829
|
{!field.options?.hiddenDefaultFields?.includes('First Name') &&
|
|
3830
3830
|
<Grid item xs={4}>
|
|
3831
|
-
<TextField label="First Name" size="small" fullWidth
|
|
3831
|
+
<TextField label={form_display_text_for_language(form, "First Name")} size="small" fullWidth
|
|
3832
3832
|
InputProps={defaultInputProps}
|
|
3833
3833
|
value={fname} onChange={e => onChange(value.map((v, i) => i === editing ? { ...v, fname: e.target.value } : v), field.id)}
|
|
3834
3834
|
/>
|
|
@@ -3837,7 +3837,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3837
3837
|
|
|
3838
3838
|
{!field.options?.hiddenDefaultFields?.includes('Last Name') &&
|
|
3839
3839
|
<Grid item xs={4}>
|
|
3840
|
-
<TextField label="Last Name" size="small" fullWidth
|
|
3840
|
+
<TextField label={form_display_text_for_language(form, "Last Name")} size="small" fullWidth
|
|
3841
3841
|
InputProps={defaultInputProps}
|
|
3842
3842
|
value={lname} onChange={e => onChange(value.map((v, i) => i === editing ? { ...v, lname: e.target.value } : v), field.id)}
|
|
3843
3843
|
/>
|
|
@@ -3845,7 +3845,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3845
3845
|
}
|
|
3846
3846
|
|
|
3847
3847
|
<Grid item xs={4}>
|
|
3848
|
-
<StringSelector options={field.options?.relatedContactTypes?.length ? field.options.relatedContactTypes : RELATIONSHIP_TYPES} label="Relationship" size="small"
|
|
3848
|
+
<StringSelector options={field.options?.relatedContactTypes?.length ? field.options.relatedContactTypes : RELATIONSHIP_TYPES} label={form_display_text_for_language(form, "Relationship")} size="small"
|
|
3849
3849
|
disabled={field?.options?.relatedContactTypes?.length === 1}
|
|
3850
3850
|
value={relationships?.[0]?.type ?? ''}
|
|
3851
3851
|
onChange={type => onChange(value.map((v, i) => i === editing ? { ...v, relationships: [{ type: type as EnduserRelationship['type'], id: '' /* to be filled on server-side */ }] } : v), field.id)}
|
|
@@ -3858,7 +3858,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3858
3858
|
<Grid container alignItems="center" wrap="nowrap" spacing={1}>
|
|
3859
3859
|
{!field.options?.hiddenDefaultFields?.includes('Date of Birth') &&
|
|
3860
3860
|
<Grid item xs={4}>
|
|
3861
|
-
<DateStringInput value={dateOfBirth} field={{ ...field, isOptional: true }} size="small" label="Date of Birth (MM-DD-YYYY)"
|
|
3861
|
+
<DateStringInput value={dateOfBirth} field={{ ...field, isOptional: true }} size="small" label={form_display_text_for_language(form, "Date of Birth (MM-DD-YYYY)")}
|
|
3862
3862
|
onChange={dateOfBirth => onChange(value.map((v, i) => i === editing ? { ...v, dateOfBirth } : v), field.id)}
|
|
3863
3863
|
/>
|
|
3864
3864
|
</Grid>
|
|
@@ -3866,7 +3866,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3866
3866
|
|
|
3867
3867
|
{!field.options?.hiddenDefaultFields?.includes('Email') &&
|
|
3868
3868
|
<Grid item xs={4}>
|
|
3869
|
-
<TextField label="Email" size="small" fullWidth type="email"
|
|
3869
|
+
<TextField label={form_display_text_for_language(form, "Email")} size="small" fullWidth type="email"
|
|
3870
3870
|
InputProps={defaultInputProps}
|
|
3871
3871
|
value={email} onChange={e => onChange(value.map((v, i) => i === editing ? { ...v, email: e.target.value } : v), field.id)}
|
|
3872
3872
|
/>
|
|
@@ -3875,7 +3875,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3875
3875
|
|
|
3876
3876
|
{!field.options?.hiddenDefaultFields?.includes('Phone Number') &&
|
|
3877
3877
|
<Grid item xs={4}>
|
|
3878
|
-
<TextField label="Phone Number" size="small" fullWidth
|
|
3878
|
+
<TextField label={form_display_text_for_language(form, "Phone Number")} size="small" fullWidth
|
|
3879
3879
|
InputProps={defaultInputProps}
|
|
3880
3880
|
value={phone} onChange={e => onChange(value.map((v, i) => i === editing ? { ...v, phone: e.target.value.trim() } : v), field.id)}
|
|
3881
3881
|
/>
|
|
@@ -3932,7 +3932,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3932
3932
|
|
|
3933
3933
|
<Grid item sx={{ my: 0.75 }}>
|
|
3934
3934
|
<Button variant="outlined" onClick={() => setEditing(-1)} size="small" disabled={!!errorMessage || !!parentError}>
|
|
3935
|
-
Save Contact
|
|
3935
|
+
{form_display_text_for_language(form, "Save Contact")}
|
|
3936
3936
|
</Button>
|
|
3937
3937
|
</Grid>
|
|
3938
3938
|
|
|
@@ -3959,13 +3959,13 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3959
3959
|
<Edit />
|
|
3960
3960
|
</IconButton>
|
|
3961
3961
|
<Typography noWrap>
|
|
3962
|
-
{user_display_name(contact) ||
|
|
3962
|
+
{user_display_name(contact) || `${form_display_text_for_language(form, "Unnamed Contact")} ${i + 1}`}
|
|
3963
3963
|
</Typography>
|
|
3964
3964
|
</Grid>
|
|
3965
3965
|
</Grid>
|
|
3966
3966
|
|
|
3967
3967
|
<Grid item>
|
|
3968
|
-
<LabeledIconButton Icon={Delete} label="Remove" onClick={() => onChange(value.filter((v, _i) => i !== _i), field.id)} />
|
|
3968
|
+
<LabeledIconButton Icon={Delete} label={form_display_text_for_language(form, "Remove")} onClick={() => onChange(value.filter((v, _i) => i !== _i), field.id)} />
|
|
3969
3969
|
</Grid>
|
|
3970
3970
|
</Grid>
|
|
3971
3971
|
</Grid>
|
|
@@ -3974,7 +3974,7 @@ export const RelatedContactsInput = ({ field, value: _value, onChange, error: pa
|
|
|
3974
3974
|
|
|
3975
3975
|
<Grid item>
|
|
3976
3976
|
<Button variant="contained" onClick={handleAddContact}>
|
|
3977
|
-
Add Contact
|
|
3977
|
+
{form_display_text_for_language(form, "Add Contact")}
|
|
3978
3978
|
</Button>
|
|
3979
3979
|
</Grid>
|
|
3980
3980
|
</Grid>
|
|
@@ -4080,14 +4080,14 @@ export const AppointmentBookingInput = ({ formResponseId, field, value, onChange
|
|
|
4080
4080
|
<CheckCircleOutline color="success" />
|
|
4081
4081
|
|
|
4082
4082
|
<Typography sx={{ ml: 1, fontSize: 20 }}>
|
|
4083
|
-
Your appointment has been booked
|
|
4083
|
+
{form_display_text_for_language(form, "Your appointment has been booked")}
|
|
4084
4084
|
</Typography>
|
|
4085
4085
|
</Grid>
|
|
4086
4086
|
</Grid>
|
|
4087
4087
|
|
|
4088
4088
|
<Grid item sx={{ maxWidth: 250 }}>
|
|
4089
4089
|
<LoadingButton variant="contained" style={{ maxWidth: 250 }}
|
|
4090
|
-
submitText="Add to Calendar" submittingText="Downloading..."
|
|
4090
|
+
submitText={form_display_text_for_language(form, "Add to Calendar")} submittingText={form_display_text_for_language(form, "Downloading...")}
|
|
4091
4091
|
onClick={() => downloadICS({ id: value })}
|
|
4092
4092
|
/>
|
|
4093
4093
|
</Grid>
|
|
@@ -4095,7 +4095,7 @@ export const AppointmentBookingInput = ({ formResponseId, field, value, onChange
|
|
|
4095
4095
|
)
|
|
4096
4096
|
}
|
|
4097
4097
|
if (!bookingPageId) {
|
|
4098
|
-
return <Typography>No booking page specified</Typography>
|
|
4098
|
+
return <Typography>{form_display_text_for_language(form, "No booking page specified")}</Typography>
|
|
4099
4099
|
}
|
|
4100
4100
|
if (error) {
|
|
4101
4101
|
return (
|
|
@@ -4177,7 +4177,7 @@ export const AppointmentBookingInput = ({ formResponseId, field, value, onChange
|
|
|
4177
4177
|
const bridgeUserIds = getBridgeEligibilityUserIds()
|
|
4178
4178
|
|
|
4179
4179
|
if (bridgeUserIds.length === 0) {
|
|
4180
|
-
return <Typography>No eligible users found for booking</Typography>
|
|
4180
|
+
return <Typography>{form_display_text_for_language(form, "No eligible users found for booking")}</Typography>
|
|
4181
4181
|
}
|
|
4182
4182
|
|
|
4183
4183
|
bookingURL += `&userIds=${bridgeUserIds.join(',')}`
|
|
@@ -4194,7 +4194,7 @@ export const AppointmentBookingInput = ({ formResponseId, field, value, onChange
|
|
|
4194
4194
|
{!!field.options?.userFilterTags?.length && !field.options.userTags?.length && !isPreviousDisabled?.() && !confirming &&
|
|
4195
4195
|
<Grid item alignSelf="flex-start" >
|
|
4196
4196
|
<Button variant="outlined" onClick={goToPreviousField} sx={{ height: 25, p: 0.5, px: 1 }}>
|
|
4197
|
-
Back
|
|
4197
|
+
{form_display_text_for_language(form, "Back")}
|
|
4198
4198
|
</Button>
|
|
4199
4199
|
</Grid>
|
|
4200
4200
|
}
|
|
@@ -4226,16 +4226,16 @@ export const AppointmentBookingInput = ({ formResponseId, field, value, onChange
|
|
|
4226
4226
|
)
|
|
4227
4227
|
}
|
|
4228
4228
|
|
|
4229
|
-
export const HeightInput = ({ field, value={} as any, onChange, ...props }: FormInputProps<'Height'>) => (
|
|
4229
|
+
export const HeightInput = ({ field, value={} as any, onChange, form, ...props }: FormInputProps<'Height'>) => (
|
|
4230
4230
|
<Grid container alignItems='center' wrap="nowrap" spacing={1} style={{ marginTop: 5 }}>
|
|
4231
4231
|
<Grid item sx={{ width: '100%' }}>
|
|
4232
|
-
<TextField fullWidth size="small" label="Feet" type="number"
|
|
4233
|
-
value={value?.feet || ''}
|
|
4232
|
+
<TextField fullWidth size="small" label={form_display_text_for_language(form, "Feet")} type="number"
|
|
4233
|
+
value={value?.feet || ''}
|
|
4234
4234
|
onChange={e => onChange({ ...value, feet: parseInt(e.target.value) }, field.id)}
|
|
4235
4235
|
/>
|
|
4236
4236
|
</Grid>
|
|
4237
4237
|
<Grid item sx={{ width: '100%' }}>
|
|
4238
|
-
<TextField fullWidth size="small" label="Inches" type="number"
|
|
4238
|
+
<TextField fullWidth size="small" label={form_display_text_for_language(form, "Inches")} type="number"
|
|
4239
4239
|
value={value?.inches ?? ''}
|
|
4240
4240
|
onChange={e => onChange({ ...value, inches: parseInt(e.target.value) }, field.id)}
|
|
4241
4241
|
/>
|
|
@@ -4453,7 +4453,7 @@ export const EmotiiInput = ({ goToNextField, goToPreviousField, field, value, on
|
|
|
4453
4453
|
<CheckCircleOutline color="success" />
|
|
4454
4454
|
|
|
4455
4455
|
<Typography sx={{ ml: 1, fontSize: 20 }}>
|
|
4456
|
-
Please click Next or Submit to continue.
|
|
4456
|
+
{form_display_text_for_language(form, "Please click Next or Submit to continue.")}
|
|
4457
4457
|
</Typography>
|
|
4458
4458
|
</Grid>
|
|
4459
4459
|
)
|
|
@@ -4533,7 +4533,7 @@ export const AllergiesInput = ({ goToNextField, goToPreviousField, field, value,
|
|
|
4533
4533
|
<Grid container direction="column" spacing={1}>
|
|
4534
4534
|
<Grid item>
|
|
4535
4535
|
<Autocomplete multiple value={value || []} options={results} style={{ marginTop: 5 }}
|
|
4536
|
-
noOptionsText={query.length ? 'No results found' : 'Type to start search'}
|
|
4536
|
+
noOptionsText={query.length ? form_display_text_for_language(form, 'No results found') : form_display_text_for_language(form, 'Type to start search')}
|
|
4537
4537
|
onChange={(e, v) => {
|
|
4538
4538
|
if (!v) { return }
|
|
4539
4539
|
onChange(v, field.id)
|
|
@@ -4543,7 +4543,7 @@ export const AllergiesInput = ({ goToNextField, goToPreviousField, field, value,
|
|
|
4543
4543
|
inputValue={query} onInputChange={(e, v) => e && setQuery(v) }
|
|
4544
4544
|
renderInput={(params) => (
|
|
4545
4545
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
4546
|
-
required={!field.isOptional} size="small" label="" placeholder="Search allergies..."
|
|
4546
|
+
required={!field.isOptional} size="small" label="" placeholder={form_display_text_for_language(form, "Search allergies...")}
|
|
4547
4547
|
/>
|
|
4548
4548
|
)}
|
|
4549
4549
|
renderTags={(value, getTagProps) =>
|
|
@@ -4568,7 +4568,7 @@ export const AllergiesInput = ({ goToNextField, goToPreviousField, field, value,
|
|
|
4568
4568
|
</Grid>
|
|
4569
4569
|
|
|
4570
4570
|
<Grid item sx={{ width: 140 }}>
|
|
4571
|
-
<StringSelector options={['mild', 'moderate', 'severe']} size="small" label="Severity"
|
|
4571
|
+
<StringSelector options={['mild', 'moderate', 'severe']} size="small" label={form_display_text_for_language(form, "Severity")}
|
|
4572
4572
|
value={allergy.severity || ''}
|
|
4573
4573
|
onChange={severity => onChange((value || []).map((v, _i) => i === _i ? { ...v, severity } : v), field.id)}
|
|
4574
4574
|
getDisplayValue={first_letter_capitalized}
|
|
@@ -4576,8 +4576,8 @@ export const AllergiesInput = ({ goToNextField, goToPreviousField, field, value,
|
|
|
4576
4576
|
</Grid>
|
|
4577
4577
|
|
|
4578
4578
|
<Grid item sx={{ width: "50%" }}>
|
|
4579
|
-
<TextField InputProps={{ sx: defaultInputProps.sx }} fullWidth size="small" label="Note"
|
|
4580
|
-
value={allergy.note || ''}
|
|
4579
|
+
<TextField InputProps={{ sx: defaultInputProps.sx }} fullWidth size="small" label={form_display_text_for_language(form, "Note")}
|
|
4580
|
+
value={allergy.note || ''}
|
|
4581
4581
|
onChange={e => onChange((value || []).map((v, _i) => i === _i ? { ...v, note: e.target.value } : v), field.id)}
|
|
4582
4582
|
/>
|
|
4583
4583
|
</Grid>
|
|
@@ -4619,7 +4619,7 @@ export const ConditionsInput = ({ goToNextField, goToPreviousField, field, value
|
|
|
4619
4619
|
|
|
4620
4620
|
return (
|
|
4621
4621
|
<Autocomplete multiple value={value || []} options={results} style={{ marginTop: 5 }}
|
|
4622
|
-
noOptionsText={query.length ? 'No results found' : 'Type to start search'}
|
|
4622
|
+
noOptionsText={query.length ? form_display_text_for_language(form, 'No results found') : form_display_text_for_language(form, 'Type to start search')}
|
|
4623
4623
|
onChange={(e, v) => {
|
|
4624
4624
|
if (!v) { return }
|
|
4625
4625
|
onChange(v, field.id)
|
|
@@ -4629,7 +4629,7 @@ export const ConditionsInput = ({ goToNextField, goToPreviousField, field, value
|
|
|
4629
4629
|
inputValue={query} onInputChange={(e, v) => e && setQuery(v) }
|
|
4630
4630
|
renderInput={(params) => (
|
|
4631
4631
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
4632
|
-
required={!field.isOptional} size="small" label="" placeholder="Search conditions..."
|
|
4632
|
+
required={!field.isOptional} size="small" label="" placeholder={form_display_text_for_language(form, "Search conditions...")}
|
|
4633
4633
|
/>
|
|
4634
4634
|
)}
|
|
4635
4635
|
renderTags={(value, getTagProps) =>
|