@tellescope/react-components 1.123.0 → 1.123.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/inputs.d.ts +2 -2
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +9 -9
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/Forms/localization.d.ts.map +1 -1
- package/lib/cjs/Forms/localization.js +21 -0
- package/lib/cjs/Forms/localization.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +2 -2
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +9 -9
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/localization.d.ts.map +1 -1
- package/lib/esm/Forms/localization.js +21 -0
- package/lib/esm/Forms/localization.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/Forms/inputs.tsx +24 -15
- package/src/Forms/localization.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.123.
|
|
3
|
+
"version": "1.123.1",
|
|
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.123.
|
|
51
|
-
"@tellescope/sdk": "^1.123.
|
|
52
|
-
"@tellescope/types-client": "^1.123.
|
|
53
|
-
"@tellescope/types-models": "^1.123.
|
|
50
|
+
"@tellescope/constants": "^1.123.1",
|
|
51
|
+
"@tellescope/sdk": "^1.123.1",
|
|
52
|
+
"@tellescope/types-client": "^1.123.1",
|
|
53
|
+
"@tellescope/types-models": "^1.123.1",
|
|
54
54
|
"@tellescope/types-utilities": "^1.69.3",
|
|
55
|
-
"@tellescope/utilities": "^1.123.
|
|
55
|
+
"@tellescope/utilities": "^1.123.1",
|
|
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": "f68c00cc64ab7cdd2ad82532ddcde5571aefaf40",
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
}
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -846,7 +846,7 @@ export const TimeInput = ({ field, value, onChange, ...props }: FormInputProps<'
|
|
|
846
846
|
)
|
|
847
847
|
}
|
|
848
848
|
|
|
849
|
-
export const AddressInput = ({ field, value, onChange, ...props }: FormInputProps<'Address'>) => (
|
|
849
|
+
export const AddressInput = ({ field, form, value, onChange, ...props }: FormInputProps<'Address'>) => (
|
|
850
850
|
// state only
|
|
851
851
|
field.options?.addressFields?.includes('state')
|
|
852
852
|
? (
|
|
@@ -862,7 +862,8 @@ export const AddressInput = ({ field, value, onChange, ...props }: FormInputProp
|
|
|
862
862
|
)}
|
|
863
863
|
renderInput={(params) => (
|
|
864
864
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
865
|
-
size={'small'}
|
|
865
|
+
size={'small'} required={!field.isOptional}
|
|
866
|
+
label={form_display_text_for_language(form, "State")}
|
|
866
867
|
/>
|
|
867
868
|
)}
|
|
868
869
|
{...props}
|
|
@@ -871,9 +872,10 @@ export const AddressInput = ({ field, value, onChange, ...props }: FormInputProp
|
|
|
871
872
|
: (
|
|
872
873
|
<Grid container direction="column" spacing={2} sx={{ mt: 0 }}>
|
|
873
874
|
<Grid item>
|
|
874
|
-
<AutoFocusTextField {...props} size="small"
|
|
875
|
+
<AutoFocusTextField {...props} size="small" required={!field.isOptional} fullWidth
|
|
875
876
|
value={value?.addressLineOne ?? ''}
|
|
876
|
-
|
|
877
|
+
label={form_display_text_for_language(form, "Address Line 1")}
|
|
878
|
+
placeholder={form_display_text_for_language(form, "Address Line 1")}
|
|
877
879
|
onChange={e =>
|
|
878
880
|
onChange({
|
|
879
881
|
...value as any,
|
|
@@ -885,10 +887,11 @@ export const AddressInput = ({ field, value, onChange, ...props }: FormInputProp
|
|
|
885
887
|
</Grid>
|
|
886
888
|
|
|
887
889
|
<Grid item>
|
|
888
|
-
<TextField {...props} size="small"
|
|
890
|
+
<TextField {...props} size="small" required={false} fullWidth
|
|
889
891
|
InputProps={defaultInputProps}
|
|
890
892
|
value={value?.addressLineTwo ?? ''}
|
|
891
|
-
|
|
893
|
+
label={form_display_text_for_language(form, "Address Line 2")}
|
|
894
|
+
placeholder={form_display_text_for_language(form, "Address Line 2")}
|
|
892
895
|
onChange={e =>
|
|
893
896
|
onChange({
|
|
894
897
|
...value as any,
|
|
@@ -902,11 +905,12 @@ export const AddressInput = ({ field, value, onChange, ...props }: FormInputProp
|
|
|
902
905
|
<Grid item>
|
|
903
906
|
<Grid container alignItems="center" justifyContent={"space-between"} spacing={1}>
|
|
904
907
|
<Grid item xs={12} sm={field.fullZIP ? 5 : 6}>
|
|
905
|
-
<TextField {...props} size="small"
|
|
908
|
+
<TextField {...props} size="small" required={!field.isOptional}
|
|
906
909
|
InputProps={defaultInputProps}
|
|
907
910
|
fullWidth
|
|
908
911
|
value={value?.city ?? ''}
|
|
909
|
-
|
|
912
|
+
label={form_display_text_for_language(form, "City")}
|
|
913
|
+
placeholder={form_display_text_for_language(form, "City")}
|
|
910
914
|
onChange={e =>
|
|
911
915
|
onChange({
|
|
912
916
|
...value as any,
|
|
@@ -930,7 +934,8 @@ export const AddressInput = ({ field, value, onChange, ...props }: FormInputProp
|
|
|
930
934
|
)}
|
|
931
935
|
renderInput={(params) => (
|
|
932
936
|
<TextField {...params} InputProps={{ ...params.InputProps, sx: defaultInputProps.sx }}
|
|
933
|
-
size={'small'}
|
|
937
|
+
size={'small'} required={!field.isOptional}
|
|
938
|
+
label={form_display_text_for_language(form, "State")}
|
|
934
939
|
/>
|
|
935
940
|
)}
|
|
936
941
|
{...props}
|
|
@@ -938,10 +943,11 @@ export const AddressInput = ({ field, value, onChange, ...props }: FormInputProp
|
|
|
938
943
|
</Grid>
|
|
939
944
|
|
|
940
945
|
<Grid item xs={field.fullZIP ? 5 : 6} sm={field.fullZIP ? 2 : 3}>
|
|
941
|
-
<TextField {...props} size="small"
|
|
946
|
+
<TextField {...props} size="small" required={!field.isOptional}
|
|
942
947
|
InputProps={defaultInputProps} fullWidth
|
|
943
948
|
value={value?.zipCode ?? ''}
|
|
944
|
-
|
|
949
|
+
label={form_display_text_for_language(form, "ZIP Code")}
|
|
950
|
+
placeholder={form_display_text_for_language(form, "ZIP Code")}
|
|
945
951
|
onChange={e =>
|
|
946
952
|
onChange({
|
|
947
953
|
...value as any,
|
|
@@ -1305,7 +1311,7 @@ const multipleChoiceItemSx: SxProps = {
|
|
|
1305
1311
|
},
|
|
1306
1312
|
}
|
|
1307
1313
|
|
|
1308
|
-
export const MultipleChoiceInput = ({ field, value: _value, onChange }: FormInputProps<'multiple_choice'>) => {
|
|
1314
|
+
export const MultipleChoiceInput = ({ field, form, value: _value, onChange }: FormInputProps<'multiple_choice'>) => {
|
|
1309
1315
|
const value = typeof _value === 'string' ? [_value] : _value // if loading existingResponses, allows them to be a string
|
|
1310
1316
|
const { choices, radio, other } = field.options as MultipleChoiceOptions
|
|
1311
1317
|
|
|
@@ -1318,7 +1324,9 @@ export const MultipleChoiceInput = ({ field, value: _value, onChange }: FormInpu
|
|
|
1318
1324
|
{radio
|
|
1319
1325
|
? (
|
|
1320
1326
|
<FormControl fullWidth>
|
|
1321
|
-
<FormLabel id={`radio-group-${field.id}-label`}>
|
|
1327
|
+
<FormLabel id={`radio-group-${field.id}-label`}>
|
|
1328
|
+
{form_display_text_for_language(form, "Select One")}
|
|
1329
|
+
</FormLabel>
|
|
1322
1330
|
<RadioGroup
|
|
1323
1331
|
aria-labelledby={`radio-group-${field.id}-label`}
|
|
1324
1332
|
defaultValue="female"
|
|
@@ -1374,9 +1382,10 @@ export const MultipleChoiceInput = ({ field, value: _value, onChange }: FormInpu
|
|
|
1374
1382
|
InputProps={{ sx: { borderRadius: 2.5 }}} // match Checkbox, not default styles
|
|
1375
1383
|
sx={{ width: radio ? `calc(100% - 15px)` : '100%' }}
|
|
1376
1384
|
size="small"
|
|
1377
|
-
aria-label="Other"
|
|
1385
|
+
aria-label={form_display_text_for_language(form, "Other")}
|
|
1378
1386
|
value={otherString}
|
|
1379
|
-
placeholder="Other"
|
|
1387
|
+
placeholder={form_display_text_for_language(form, "Other")}
|
|
1388
|
+
variant="outlined"
|
|
1380
1389
|
// onClick={() => !otherChecked && handleOtherChecked()} // allow click to enable when disabled
|
|
1381
1390
|
onChange={e => {
|
|
1382
1391
|
enteringOtherStringRef.current = e.target.value
|
|
@@ -21,6 +21,15 @@ export const form_display_text_for_language = (form: Pick<Form, 'language'> | un
|
|
|
21
21
|
if (text === 'Previous') { return "Previo" }
|
|
22
22
|
if (text === 'Submit') { return "Entregar" }
|
|
23
23
|
|
|
24
|
+
if (text === 'Select One') { return "Seleccione una" }
|
|
25
|
+
if (text === 'Other') { return "Otra" }
|
|
26
|
+
|
|
27
|
+
if (text === 'Address Line 1') { return "Dirección Línea 1" }
|
|
28
|
+
if (text === 'Address Line 2') { return "Dirección Línea 2" }
|
|
29
|
+
if (text === 'City') { return "Ciudad" }
|
|
30
|
+
if (text === 'State') { return "Estado" }
|
|
31
|
+
if (text === 'ZIP Code') { return "Código Postal" }
|
|
32
|
+
|
|
24
33
|
if (typeof placeholder === 'string') { return placeholder }
|
|
25
34
|
}
|
|
26
35
|
|