@tellescope/react-components 1.158.0 → 1.159.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/CMS/components.d.ts +1 -0
- package/lib/cjs/CMS/components.d.ts.map +1 -1
- package/lib/cjs/Forms/form_responses.d.ts +1 -0
- package/lib/cjs/Forms/form_responses.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.js +1 -1
- package/lib/cjs/Forms/forms.js.map +1 -1
- package/lib/cjs/Forms/hooks.d.ts +1 -0
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +75 -26
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/controls.d.ts +2 -2
- package/lib/cjs/inputs.native.d.ts +1 -0
- package/lib/cjs/inputs.native.d.ts.map +1 -1
- package/lib/cjs/mui.d.ts +2 -1
- package/lib/cjs/mui.d.ts.map +1 -1
- package/lib/cjs/mui.js +2 -2
- package/lib/cjs/mui.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/forms.js +1 -1
- package/lib/esm/Forms/forms.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 +75 -26
- 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/mui.d.ts +2 -1
- package/lib/esm/mui.d.ts.map +1 -1
- package/lib/esm/mui.js +2 -2
- package/lib/esm/mui.js.map +1 -1
- package/lib/esm/state.d.ts +256 -256
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/forms.tsx +1 -1
- package/src/Forms/inputs.tsx +105 -34
- package/src/mui.tsx +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.159.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.159.0",
|
|
51
|
+
"@tellescope/sdk": "^1.159.0",
|
|
52
|
+
"@tellescope/types-client": "^1.159.0",
|
|
53
|
+
"@tellescope/types-models": "^1.159.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.159.0",
|
|
55
|
+
"@tellescope/utilities": "^1.159.0",
|
|
56
|
+
"@tellescope/validation": "^1.159.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",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
81
81
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "105154b2072ee3c52f066e163aec77441d7e6c7d",
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
}
|
package/src/Forms/forms.tsx
CHANGED
|
@@ -372,7 +372,7 @@ export const QuestionForField = ({
|
|
|
372
372
|
|
|
373
373
|
{field.type !== 'Question Group' &&
|
|
374
374
|
<Typography color="error" style={{ marginTop: 3, height: 10, fontSize: 14, marginBottom: -10 }}>
|
|
375
|
-
{(validationMessage === 'A response is required' || validationMessage === 'A value must be checked' || validationMessage === 'A file is required')
|
|
375
|
+
{(validationMessage === 'A response is required' || validationMessage === 'A value must be checked' || validationMessage === 'A file is required' || 'Enter a valid phone number' || 'Insurer is required')
|
|
376
376
|
? value.touched
|
|
377
377
|
? form_display_text_for_language(form, validationMessage)
|
|
378
378
|
: null
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -492,6 +492,7 @@ export const InsuranceInput = ({ field, value, onChange, form, responses, enduse
|
|
|
492
492
|
const session = useResolvedSession()
|
|
493
493
|
|
|
494
494
|
const [payers, setPayers] = useState<{ id: string, name: string, type?: string, state?: string }[]>([])
|
|
495
|
+
const [query, setQuery] = useState('')
|
|
495
496
|
|
|
496
497
|
const addressQuestion = useMemo(() => responses?.find(r => {
|
|
497
498
|
if (r.answer.type !== 'Address') return false
|
|
@@ -509,6 +510,7 @@ export const InsuranceInput = ({ field, value, onChange, form, responses, enduse
|
|
|
509
510
|
|
|
510
511
|
const loadRef = useRef(false) // so session changes don't cause
|
|
511
512
|
useEffect(() => {
|
|
513
|
+
if (field?.options?.dataSource === CANVAS_TITLE) return // instead, look-up while typing against Canvas Search API
|
|
512
514
|
if (loadRef.current) return
|
|
513
515
|
loadRef.current = true
|
|
514
516
|
|
|
@@ -525,7 +527,30 @@ export const InsuranceInput = ({ field, value, onChange, form, responses, enduse
|
|
|
525
527
|
.filter(c => !c.state || !state || (c.state === state))
|
|
526
528
|
))
|
|
527
529
|
.catch(console.error)
|
|
528
|
-
}, [session, state])
|
|
530
|
+
}, [session, state, field?.options?.dataSource])
|
|
531
|
+
|
|
532
|
+
const searchRef = useRef(query)
|
|
533
|
+
useEffect(() => {
|
|
534
|
+
if (field?.options?.dataSource !== CANVAS_TITLE) { return }
|
|
535
|
+
if (!query) return
|
|
536
|
+
if (searchRef.current === query) return
|
|
537
|
+
searchRef.current = query
|
|
538
|
+
|
|
539
|
+
session.api.integrations.proxy_read({
|
|
540
|
+
integration: CANVAS_TITLE,
|
|
541
|
+
query,
|
|
542
|
+
type: 'organizations',
|
|
543
|
+
})
|
|
544
|
+
.then(({ data }) => {
|
|
545
|
+
try {
|
|
546
|
+
setPayers(data.map((d: any) => ({
|
|
547
|
+
id: d.resource.id,
|
|
548
|
+
name: d.resource.name,
|
|
549
|
+
})))
|
|
550
|
+
} catch(err) { console.error }
|
|
551
|
+
})
|
|
552
|
+
.catch(console.error)
|
|
553
|
+
}, [session, field?.options?.dataSource, query])
|
|
529
554
|
|
|
530
555
|
return (
|
|
531
556
|
<Grid container spacing={2} sx={{ mt: '0' }}>
|
|
@@ -538,12 +563,20 @@ export const InsuranceInput = ({ field, value, onChange, form, responses, enduse
|
|
|
538
563
|
payerId: payers.find(p => p.name === v)?.id || '',
|
|
539
564
|
payerType: payers.find(p => p.name === v)?.type || '',
|
|
540
565
|
}, field.id)}
|
|
541
|
-
onInputChange={
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
566
|
+
onInputChange={
|
|
567
|
+
field.options?.requirePredefinedInsurer
|
|
568
|
+
? (e, v) => { if (v) { setQuery(v) } }
|
|
569
|
+
: (e, v) => {
|
|
570
|
+
if (v) { setQuery(v) }
|
|
571
|
+
|
|
572
|
+
onChange({
|
|
573
|
+
...value,
|
|
574
|
+
payerName: v || '',
|
|
575
|
+
payerId: payers.find(p => p.name === v)?.id || '',
|
|
576
|
+
payerType: payers.find(p => p.name === v)?.type || '',
|
|
577
|
+
}, field.id)
|
|
578
|
+
}
|
|
579
|
+
}
|
|
547
580
|
renderInput={(params) => (
|
|
548
581
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
549
582
|
required={!field.isOptional} size="small" label="Insurer"
|
|
@@ -596,7 +629,11 @@ export const InsuranceInput = ({ field, value, onChange, form, responses, enduse
|
|
|
596
629
|
<Grid item xs={12}>
|
|
597
630
|
<StringSelector size="small" label="Relationship to Policy Owner"
|
|
598
631
|
options={
|
|
599
|
-
(
|
|
632
|
+
(
|
|
633
|
+
(field.options?.billingProvider === CANVAS_TITLE || field.options?.dataSource === CANVAS_TITLE )
|
|
634
|
+
? INSURANCE_RELATIONSHIPS_CANVAS
|
|
635
|
+
: INSURANCE_RELATIONSHIPS
|
|
636
|
+
)
|
|
600
637
|
.sort((x, y) => x.localeCompare(y))
|
|
601
638
|
}
|
|
602
639
|
value={value?.relationship || 'Self'}
|
|
@@ -809,13 +846,14 @@ export const InsuranceInput = ({ field, value, onChange, form, responses, enduse
|
|
|
809
846
|
}
|
|
810
847
|
|
|
811
848
|
|
|
812
|
-
const StringSelector = ({ options, value, onChange, required, ...props } : {
|
|
849
|
+
const StringSelector = ({ options, value, onChange, required, getDisplayValue, ...props } : {
|
|
813
850
|
options: string[]
|
|
814
851
|
value: string,
|
|
815
852
|
onChange: (v: string) => void,
|
|
816
853
|
label?: string,
|
|
817
854
|
size?: "small",
|
|
818
855
|
required?: boolean,
|
|
856
|
+
getDisplayValue?: (v: string) => string,
|
|
819
857
|
}) => (
|
|
820
858
|
<FormControl fullWidth size={props.size} required={required}>
|
|
821
859
|
<InputLabel>{props.label}</InputLabel>
|
|
@@ -823,7 +861,7 @@ const StringSelector = ({ options, value, onChange, required, ...props } : {
|
|
|
823
861
|
sx={defaultInputProps.sx}
|
|
824
862
|
>
|
|
825
863
|
{options.map((o, i) => (
|
|
826
|
-
<MenuItem value={o} key={o || i}>{o}</MenuItem>
|
|
864
|
+
<MenuItem value={o} key={o || i}>{getDisplayValue?.(o) ?? o}</MenuItem>
|
|
827
865
|
))}
|
|
828
866
|
</Select>
|
|
829
867
|
</FormControl>
|
|
@@ -886,7 +924,9 @@ export const AddressInput = ({ field, form, value, onChange, ...props }: FormInp
|
|
|
886
924
|
)}
|
|
887
925
|
renderInput={(params) => (
|
|
888
926
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
889
|
-
|
|
927
|
+
required={!field.isOptional}
|
|
928
|
+
// don't use 'small' so as to be consistent with other text fields, in case this is used in a group
|
|
929
|
+
// size={'small'}
|
|
890
930
|
label={form_display_text_for_language(form, "State")}
|
|
891
931
|
/>
|
|
892
932
|
)}
|
|
@@ -2966,30 +3006,61 @@ export const AllergiesInput = ({ goToNextField, goToPreviousField, field, value,
|
|
|
2966
3006
|
}, [session, query, field?.options?.dataSource])
|
|
2967
3007
|
|
|
2968
3008
|
return (
|
|
2969
|
-
<
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
onChange(
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
renderTags={(value, getTagProps) =>
|
|
2984
|
-
value.map((value, index) => (
|
|
2985
|
-
<Chip
|
|
2986
|
-
label={<Typography style={{whiteSpace: 'normal'}}>{value.display}</Typography>}
|
|
2987
|
-
{...getTagProps({ index })}
|
|
2988
|
-
sx={{height:"100%", py: 0.5 }}
|
|
3009
|
+
<Grid container direction="column" spacing={1}>
|
|
3010
|
+
<Grid item>
|
|
3011
|
+
<Autocomplete multiple value={value || []} options={results} style={{ marginTop: 5 }}
|
|
3012
|
+
noOptionsText={query.length ? 'No results found' : 'Type to start search'}
|
|
3013
|
+
onChange={(e, v) => {
|
|
3014
|
+
if (!v) { return }
|
|
3015
|
+
onChange(v, field.id)
|
|
3016
|
+
setResults([])
|
|
3017
|
+
}}
|
|
3018
|
+
getOptionLabel={v => first_letter_capitalized(v.display)} filterOptions={o => o}
|
|
3019
|
+
inputValue={query} onInputChange={(e, v) => e && setQuery(v) }
|
|
3020
|
+
renderInput={(params) => (
|
|
3021
|
+
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
3022
|
+
required={!field.isOptional} size="small" label="" placeholder="Search allergies..."
|
|
2989
3023
|
/>
|
|
2990
|
-
)
|
|
2991
|
-
|
|
2992
|
-
|
|
3024
|
+
)}
|
|
3025
|
+
renderTags={(value, getTagProps) =>
|
|
3026
|
+
value.map((value, index) => (
|
|
3027
|
+
<Chip
|
|
3028
|
+
label={<Typography style={{whiteSpace: 'normal'}}>{value.display}</Typography>}
|
|
3029
|
+
{...getTagProps({ index })}
|
|
3030
|
+
sx={{height:"100%", py: 0.5 }}
|
|
3031
|
+
/>
|
|
3032
|
+
))
|
|
3033
|
+
}
|
|
3034
|
+
/>
|
|
3035
|
+
</Grid>
|
|
3036
|
+
|
|
3037
|
+
{(value || []).map((allergy, i) => (
|
|
3038
|
+
<Grid item key={i}>
|
|
3039
|
+
<Grid container alignItems="center" wrap="nowrap" columnGap={0.5} justifyContent={"space-between"}>
|
|
3040
|
+
<Grid item>
|
|
3041
|
+
<Typography noWrap sx={{ width: 85, fontSize: 14 }}>
|
|
3042
|
+
{allergy.display}
|
|
3043
|
+
</Typography>
|
|
3044
|
+
</Grid>
|
|
3045
|
+
|
|
3046
|
+
<Grid item sx={{ width: 140 }}>
|
|
3047
|
+
<StringSelector options={['mild', 'moderate', 'severe']} size="small" label="Severity"
|
|
3048
|
+
value={allergy.severity || ''}
|
|
3049
|
+
onChange={severity => onChange((value || []).map((v, _i) => i === _i ? { ...v, severity } : v), field.id)}
|
|
3050
|
+
getDisplayValue={first_letter_capitalized}
|
|
3051
|
+
/>
|
|
3052
|
+
</Grid>
|
|
3053
|
+
|
|
3054
|
+
<Grid item sx={{ width: "50%" }}>
|
|
3055
|
+
<TextField InputProps={{ sx: defaultInputProps.sx }} fullWidth size="small" label="Note"
|
|
3056
|
+
value={allergy.note || ''}
|
|
3057
|
+
onChange={e => onChange((value || []).map((v, _i) => i === _i ? { ...v, note: e.target.value } : v), field.id)}
|
|
3058
|
+
/>
|
|
3059
|
+
</Grid>
|
|
3060
|
+
</Grid>
|
|
3061
|
+
</Grid>
|
|
3062
|
+
))}
|
|
3063
|
+
</Grid>
|
|
2993
3064
|
)
|
|
2994
3065
|
}
|
|
2995
3066
|
const display_with_code = (v: { code: string, display: string }) => `${v.code}: ${first_letter_capitalized(v.display)}`
|
package/src/mui.tsx
CHANGED
|
@@ -340,9 +340,10 @@ export interface ModalProps extends Styled {
|
|
|
340
340
|
setOpen: (b: boolean) => void,
|
|
341
341
|
onClick?: () => void,
|
|
342
342
|
ref?: any,
|
|
343
|
+
zIndex?: number,
|
|
343
344
|
}
|
|
344
|
-
export const Modal = ({ children, onClick, open, setOpen, style=defaultModalStyle }: ModalProps) => (
|
|
345
|
-
<MuiModal open={open} onClick={onClick} onClose={() => setOpen(false)}>
|
|
345
|
+
export const Modal = ({ children, onClick, open, setOpen, style=defaultModalStyle, zIndex }: ModalProps) => (
|
|
346
|
+
<MuiModal open={open} onClick={onClick} onClose={() => setOpen(false)} style={{ zIndex }}>
|
|
346
347
|
<Grid container style={style}>
|
|
347
348
|
{children}
|
|
348
349
|
</Grid>
|