@aehrc/smart-forms-renderer 1.2.8 → 1.2.9
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/components/FormComponents/AttachmentItem/AttachmentField.js +3 -2
- package/lib/components/FormComponents/AttachmentItem/AttachmentField.js.map +1 -1
- package/lib/components/FormComponents/BooleanItem/BooleanField.d.ts +2 -1
- package/lib/components/FormComponents/BooleanItem/BooleanField.js +6 -4
- package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +8 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +11 -11
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.js +2 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js +2 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalField.js +2 -1
- package/lib/components/FormComponents/DecimalItem/DecimalField.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerField.js +2 -1
- package/lib/components/FormComponents/IntegerItem/IntegerField.js.map +1 -1
- package/lib/components/FormComponents/Item.styles.d.ts +1 -1
- package/lib/components/FormComponents/Item.styles.js +1 -1
- package/lib/components/FormComponents/ItemParts/AccessibleFeedback.d.ts +7 -0
- package/lib/components/FormComponents/ItemParts/AccessibleFeedback.js +7 -0
- package/lib/components/FormComponents/ItemParts/AccessibleFeedback.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/CheckboxFormGroup.js +4 -2
- package/lib/components/FormComponents/ItemParts/CheckboxFormGroup.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ClearButtonAdornment.js +12 -12
- package/lib/components/FormComponents/ItemParts/ClearButtonAdornment.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/RadioFormGroup.d.ts +1 -1
- package/lib/components/FormComponents/ItemParts/RadioFormGroup.js +5 -3
- package/lib/components/FormComponents/ItemParts/RadioFormGroup.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +8 -8
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityField.js +2 -1
- package/lib/components/FormComponents/QuantityItem/QuantityField.js.map +1 -1
- package/lib/components/FormComponents/SliderItem/SliderField.js +4 -2
- package/lib/components/FormComponents/SliderItem/SliderField.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringField.js +2 -1
- package/lib/components/FormComponents/StringItem/StringField.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextField.js +2 -1
- package/lib/components/FormComponents/TextItem/TextField.js.map +1 -1
- package/lib/components/FormComponents/UrlItem/UrlField.js +2 -1
- package/lib/components/FormComponents/UrlItem/UrlField.js.map +1 -1
- package/package.json +4 -4
- package/src/components/FormComponents/AttachmentItem/AttachmentField.tsx +7 -2
- package/src/components/FormComponents/BooleanItem/BooleanField.tsx +12 -3
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +2 -3
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +3 -3
- package/src/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.tsx +2 -1
- package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.tsx +6 -3
- package/src/components/FormComponents/DecimalItem/DecimalField.tsx +2 -1
- package/src/components/FormComponents/IntegerItem/IntegerField.tsx +2 -1
- package/src/components/FormComponents/Item.styles.ts +1 -1
- package/src/components/FormComponents/ItemParts/AccessibleFeedback.tsx +35 -0
- package/src/components/FormComponents/ItemParts/CheckboxFormGroup.tsx +10 -2
- package/src/components/FormComponents/ItemParts/ClearButtonAdornment.tsx +22 -23
- package/src/components/FormComponents/ItemParts/RadioFormGroup.tsx +11 -3
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +2 -3
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +2 -3
- package/src/components/FormComponents/QuantityItem/QuantityField.tsx +2 -1
- package/src/components/FormComponents/SliderItem/SliderField.tsx +10 -2
- package/src/components/FormComponents/StringItem/StringField.tsx +2 -1
- package/src/components/FormComponents/TextItem/TextField.tsx +2 -1
- package/src/components/FormComponents/UrlItem/UrlField.tsx +2 -1
|
@@ -3,20 +3,20 @@ import { getAnswerOptionLabel } from '../../../utils/openChoice';
|
|
|
3
3
|
import { StandardTextField } from '../Textfield.styles';
|
|
4
4
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
5
5
|
import { useRendererConfigStore } from '../../../stores';
|
|
6
|
-
import { StyledRequiredTypography } from '../Item.styles';
|
|
7
6
|
import DisplayUnitText from '../ItemParts/DisplayUnitText';
|
|
7
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
8
8
|
function OpenChoiceSelectAnswerOptionField(props) {
|
|
9
9
|
const { qItem, options, valueSelect, feedback, readOnly, isTabled, renderingExtensions, onValueChange } = props;
|
|
10
10
|
const readOnlyVisualStyle = useRendererConfigStore.use.readOnlyVisualStyle();
|
|
11
11
|
const textFieldWidth = useRendererConfigStore.use.textFieldWidth();
|
|
12
12
|
const { displayUnit, displayPrompt, entryFormat } = renderingExtensions;
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
return (_jsx(_Fragment, { children: _jsx(Autocomplete, { id: qItem.type + '-' + qItem.linkId, value: valueSelect ?? null, options: options, getOptionLabel: (option) => getAnswerOptionLabel(option), onChange: (_, newValue, reason) => onValueChange(newValue, reason), onInputChange: (_, newValue, reason) => onValueChange(newValue, reason), freeSolo: true, autoHighlight: true, sx: { maxWidth: !isTabled ? textFieldWidth : 3000, minWidth: 160, flexGrow: 1 }, disabled: readOnly && readOnlyVisualStyle === 'disabled', readOnly: readOnly && readOnlyVisualStyle === 'readonly', size: "small", renderInput: (params) => (_jsx(StandardTextField, { multiline: true, textFieldWidth: textFieldWidth, isTabled: isTabled, placeholder: entryFormat || displayPrompt, helperText: _jsx(AccessibleFeedback, { children: feedback }), ...params, slotProps: {
|
|
14
|
+
input: {
|
|
15
|
+
...params.InputProps,
|
|
16
|
+
readOnly: readOnly && readOnlyVisualStyle === 'readonly',
|
|
17
|
+
endAdornment: (_jsxs(_Fragment, { children: [params.InputProps.endAdornment, _jsx(DisplayUnitText, { readOnly: readOnly, children: displayUnit })] }))
|
|
18
|
+
}
|
|
19
|
+
} })) }) }));
|
|
20
20
|
}
|
|
21
21
|
export default OpenChoiceSelectAnswerOptionField;
|
|
22
22
|
//# sourceMappingURL=OpenChoiceSelectAnswerOptionField.js.map
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenChoiceSelectAnswerOptionField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAOtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"OpenChoiceSelectAnswerOptionField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAOtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AAiBjE,SAAS,iCAAiC,CAAC,KAA6C;IACtF,MAAM,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACd,GAAG,KAAK,CAAC;IAEV,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;IAC7E,MAAM,cAAc,GAAG,sBAAsB,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IAEnE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,mBAAmB,CAAC;IAExE,OAAO,CACL,4BACE,KAAC,YAAY,IACX,EAAE,EAAE,KAAK,CAAC,IAAI,GAAG,GAAG,GAAG,KAAK,CAAC,MAAM,EACnC,KAAK,EAAE,WAAW,IAAI,IAAI,EAC1B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,CAAC,EACxD,QAAQ,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,EAClE,aAAa,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,EACvE,QAAQ,QACR,aAAa,QACb,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,EAC/E,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU,EACxD,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU,EACxD,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,KAAC,iBAAiB,IAChB,SAAS,QACT,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,IAAI,aAAa,EACzC,UAAU,EAAE,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,KAC3D,MAAM,EACV,SAAS,EAAE;oBACT,KAAK,EAAE;wBACL,GAAG,MAAM,CAAC,UAAU;wBACpB,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU;wBACxD,YAAY,EAAE,CACZ,8BACG,MAAM,CAAC,UAAU,CAAC,YAAY,EAC/B,KAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,YAAG,WAAW,GAAmB,IACnE,CACJ;qBACF;iBACF,GACD,CACH,GACD,GACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,iCAAiC,CAAC"}
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js
CHANGED
|
@@ -3,20 +3,20 @@ import Autocomplete from '@mui/material/Autocomplete';
|
|
|
3
3
|
import { StandardTextField } from '../Textfield.styles';
|
|
4
4
|
import Typography from '@mui/material/Typography';
|
|
5
5
|
import { useRendererConfigStore } from '../../../stores';
|
|
6
|
-
import { StyledRequiredTypography } from '../Item.styles';
|
|
7
6
|
import DisplayUnitText from '../ItemParts/DisplayUnitText';
|
|
7
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
8
8
|
function OpenChoiceSelectAnswerValueSetField(props) {
|
|
9
9
|
const { qItem, options, valueSelect, terminologyError, feedback, readOnly, isTabled, renderingExtensions, onValueChange } = props;
|
|
10
10
|
const readOnlyVisualStyle = useRendererConfigStore.use.readOnlyVisualStyle();
|
|
11
11
|
const textFieldWidth = useRendererConfigStore.use.textFieldWidth();
|
|
12
12
|
const { displayUnit, displayPrompt, entryFormat } = renderingExtensions;
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx(Autocomplete, { id: qItem.type + '-' + qItem.linkId, value: valueSelect ?? null, options: options, getOptionLabel: (option) => typeof option === 'string' ? option : (option.display ?? `${option.code}`), onChange: (_, newValue, reason) => onValueChange(newValue, reason), onInputChange: (_, newValue, reason) => onValueChange(newValue, reason), freeSolo: true, autoHighlight: true, sx: { maxWidth: !isTabled ? textFieldWidth : 3000, minWidth: 160, flexGrow: 1 }, disabled: readOnly && readOnlyVisualStyle === 'disabled', readOnly: readOnly && readOnlyVisualStyle === 'readonly', size: "small", renderInput: (params) => (_jsx(StandardTextField, { multiline: true, textFieldWidth: textFieldWidth, isTabled: isTabled, placeholder: entryFormat || displayPrompt, ...params, slotProps: {
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(Autocomplete, { id: qItem.type + '-' + qItem.linkId, value: valueSelect ?? null, options: options, getOptionLabel: (option) => typeof option === 'string' ? option : (option.display ?? `${option.code}`), onChange: (_, newValue, reason) => onValueChange(newValue, reason), onInputChange: (_, newValue, reason) => onValueChange(newValue, reason), freeSolo: true, autoHighlight: true, sx: { maxWidth: !isTabled ? textFieldWidth : 3000, minWidth: 160, flexGrow: 1 }, disabled: readOnly && readOnlyVisualStyle === 'disabled', readOnly: readOnly && readOnlyVisualStyle === 'readonly', size: "small", renderInput: (params) => (_jsx(StandardTextField, { multiline: true, textFieldWidth: textFieldWidth, isTabled: isTabled, placeholder: entryFormat || displayPrompt, helperText: _jsx(AccessibleFeedback, { children: feedback }), ...params, slotProps: {
|
|
14
14
|
input: {
|
|
15
15
|
...params.InputProps,
|
|
16
16
|
readOnly: readOnly && readOnlyVisualStyle === 'readonly',
|
|
17
17
|
endAdornment: (_jsxs(_Fragment, { children: [params.InputProps.endAdornment, _jsx(DisplayUnitText, { readOnly: readOnly, children: displayUnit })] }))
|
|
18
18
|
}
|
|
19
|
-
} })) }), terminologyError.error ? (_jsxs(Typography, { children: ["There was an error fetching options from the terminology server for", ' ', terminologyError.answerValueSet] })) : null
|
|
19
|
+
} })) }), terminologyError.error ? (_jsxs(Typography, { children: ["There was an error fetching options from the terminology server for", ' ', terminologyError.answerValueSet] })) : null] }));
|
|
20
20
|
}
|
|
21
21
|
export default OpenChoiceSelectAnswerValueSetField;
|
|
22
22
|
//# sourceMappingURL=OpenChoiceSelectAnswerValueSetField.js.map
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenChoiceSelectAnswerValueSetField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx"],"names":[],"mappings":";AAmBA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAQlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"OpenChoiceSelectAnswerValueSetField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx"],"names":[],"mappings":";AAmBA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,q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,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,EAC/E,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU,EACxD,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU,EACxD,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,KAAC,iBAAiB,IAChB,SAAS,QACT,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,IAAI,aAAa,EACzC,UAAU,EAAE,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,KAC3D,MAAM,EACV,SAAS,EAAE;wBACT,KAAK,EAAE;4BACL,GAAG,MAAM,CAAC,UAAU;4BACpB,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU;4BACxD,YAAY,EAAE,CACZ,8BACG,MAAM,CAAC,UAAU,CAAC,YAAY,EAC/B,KAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,YAAG,WAAW,GAAmB,IACnE,CACJ;yBACF;qBACF,GACD,CACH,GACD,EACD,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CACxB,MAAC,UAAU,sFAC2D,GAAG,EACtE,gBAAgB,CAAC,cAAc,IACrB,CACd,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,CAAC"}
|
|
@@ -21,6 +21,7 @@ import DisplayUnitText from '../ItemParts/DisplayUnitText';
|
|
|
21
21
|
import { ClearButtonAdornment } from '../ItemParts/ClearButtonAdornment';
|
|
22
22
|
import ExpressionUpdateFadingIcon from '../ItemParts/ExpressionUpdateFadingIcon';
|
|
23
23
|
import { StandardTextField } from '../Textfield.styles';
|
|
24
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
24
25
|
function QuantityField(props) {
|
|
25
26
|
const { linkId, itemType, itemText, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, calcExpUpdated, isTabled, onInputChange } = props;
|
|
26
27
|
const readOnlyVisualStyle = useRendererConfigStore.use.readOnlyVisualStyle();
|
|
@@ -47,7 +48,7 @@ function QuantityField(props) {
|
|
|
47
48
|
onInputChange('');
|
|
48
49
|
} }), _jsx(DisplayUnitText, { readOnly: readOnly, children: displayUnit })] }))
|
|
49
50
|
}
|
|
50
|
-
}, helperText: feedback, "data-test": "q-item-quantity-field" }));
|
|
51
|
+
}, helperText: _jsx(AccessibleFeedback, { children: feedback }), "data-test": "q-item-quantity-field" }));
|
|
51
52
|
}
|
|
52
53
|
export default QuantityField;
|
|
53
54
|
//# sourceMappingURL=QuantityField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuantityField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QuantityItem/QuantityField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,0BAA0B,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"QuantityField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QuantityItem/QuantityField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACz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,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE;YACT,SAAS,EAAE;gBACT,SAAS,EAAE,SAAS;gBACpB,OAAO,EAAE,QAAQ;gBACjB,GAAG,CAAC,SAAS,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;aAC9C;YACD,KAAK,EAAE;gBACL,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU;gBACxD,YAAY,EAAE,CACZ,MAAC,cAAc,IAAC,QAAQ,EAAE,KAAK,aAC7B,KAAC,0BAA0B,IAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAI,EAC1E,KAAC,oBAAoB,IACnB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;gCACZ,aAAa,CAAC,EAAE,CAAC,CAAC;4BACpB,CAAC,GACD,EACF,KAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,YAAG,WAAW,GAAmB,IACrD,CAClB;aACF;SACF,EACD,UAAU,EAAE,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,eACrD,uBAAuB,GACjC,CACH,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -4,8 +4,9 @@ import Stack from '@mui/material/Stack';
|
|
|
4
4
|
import SliderLabels from './SliderLabels';
|
|
5
5
|
import SliderDisplayValue from './SliderDisplayValue';
|
|
6
6
|
import { useRendererConfigStore } from '../../../stores';
|
|
7
|
-
import {
|
|
7
|
+
import { StyledFeedbackTypography } from '../Item.styles';
|
|
8
8
|
import { StandardSlider } from './Slider.styles';
|
|
9
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
9
10
|
function SliderField(props) {
|
|
10
11
|
const { linkId, itemType, value, minValue, maxValue, stepValue, minLabel, maxLabel, isInteracted, feedback, readOnly, isTabled, onValueChange } = props;
|
|
11
12
|
const readOnlyVisualStyle = useRendererConfigStore.use.readOnlyVisualStyle();
|
|
@@ -16,6 +17,7 @@ function SliderField(props) {
|
|
|
16
17
|
minWidth: 160
|
|
17
18
|
};
|
|
18
19
|
const hasLabels = !!(minLabel || maxLabel);
|
|
20
|
+
const feedbackId = itemType + '-' + linkId + '-feedback';
|
|
19
21
|
return (_jsxs(_Fragment, { children: [_jsxs(Stack, { sx: { ...sliderSx }, children: [_jsx(SliderDisplayValue, { value: value, hasLabels: hasLabels, isInteracted: isInteracted }), hasLabels ? _jsx(SliderLabels, { minLabel: minLabel, maxLabel: maxLabel }) : null, _jsx(StandardSlider, { id: itemType + '-' + linkId, value: value, min: minValue, max: maxValue, step: stepValue, marks: sliderMarks, sx: { ...sliderSx }, onChange: (_, newValue) => {
|
|
20
22
|
// If item.readOnly=true, do not allow any changes
|
|
21
23
|
if (readOnly) {
|
|
@@ -24,7 +26,7 @@ function SliderField(props) {
|
|
|
24
26
|
if (typeof newValue === 'number') {
|
|
25
27
|
onValueChange(newValue);
|
|
26
28
|
}
|
|
27
|
-
}, disabled: readOnly && readOnlyVisualStyle === 'disabled', readOnly: readOnly && readOnlyVisualStyle === 'readonly', "aria-readonly": readOnly && readOnlyVisualStyle === 'readonly', valueLabelDisplay: "auto", "data-test": "q-item-slider-field" })] }), feedback ? _jsx(
|
|
29
|
+
}, disabled: readOnly && readOnlyVisualStyle === 'disabled', readOnly: readOnly && readOnlyVisualStyle === 'readonly', "aria-readonly": readOnly && readOnlyVisualStyle === 'readonly', "aria-describedby": feedback ? feedbackId : undefined, valueLabelDisplay: "auto", "data-test": "q-item-slider-field" })] }), feedback ? (_jsx(AccessibleFeedback, { id: feedbackId, children: _jsx(StyledFeedbackTypography, { children: feedback }) })) : null] }));
|
|
28
30
|
}
|
|
29
31
|
export default SliderField;
|
|
30
32
|
//# sourceMappingURL=SliderField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SliderItem/SliderField.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAA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UAAU,sBAC3C,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACnD,iBAAiB,EAAC,MAAM,eACd,qBAAqB,GAC/B,IACI,EAEP,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,kBAAkB,IAAC,EAAE,EAAE,UAAU,YAChC,KAAC,wBAAwB,cAAE,QAAQ,GAA4B,GAC5C,CACtB,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -22,6 +22,7 @@ import { ClearButtonAdornment } from '../ItemParts/ClearButtonAdornment';
|
|
|
22
22
|
import ExpressionUpdateFadingIcon from '../ItemParts/ExpressionUpdateFadingIcon';
|
|
23
23
|
import ItemRepopulateButton from '../ItemParts/ItemRepopulateButton';
|
|
24
24
|
import { StandardTextField } from '../Textfield.styles';
|
|
25
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
25
26
|
function StringField(props) {
|
|
26
27
|
const { qItem, input, feedback, renderingExtensions, readOnly, isTabled, calcExpUpdated, onInputChange, onRepopulateSync } = props;
|
|
27
28
|
const { displayPrompt, displayUnit, entryFormat, isRepopulatable } = renderingExtensions;
|
|
@@ -34,7 +35,7 @@ function StringField(props) {
|
|
|
34
35
|
onInputChange('');
|
|
35
36
|
} }), _jsx(ItemRepopulateButton, { qItem: qItem, repopulatable: isRepopulatable, onRepopulate: onRepopulateSync }), _jsx(DisplayUnitText, { readOnly: readOnly, children: displayUnit })] }))
|
|
36
37
|
}
|
|
37
|
-
}, helperText: feedback, "data-test": "q-item-string-field" }));
|
|
38
|
+
}, helperText: _jsx(AccessibleFeedback, { children: feedback }), "data-test": "q-item-string-field" }));
|
|
38
39
|
}
|
|
39
40
|
export default StringField;
|
|
40
41
|
//# sourceMappingURL=StringField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/StringField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,0BAA0B,MAAM,yCAAyC,CAAC;AACjF,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"StringField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/StringField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,0BAA0B,MAAM,yCAAyC,CAAC;AACjF,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AAajE,SAAS,WAAW,CAAC,KAAuB;IAC1C,MAAM,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,aAAa,EACb,gBAAgB,EACjB,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,mBAAmB,CAAC;IAEzF,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;IAC7E,MAAM,cAAc,GAAG,sBAAsB,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RendererConfigStore } from '../../../stores';
|
|
22
22
|
import ExpressionUpdateFadingIcon from '../ItemParts/ExpressionUpdateFadingIcon';
|
|
23
23
|
import ItemRepopulateButton from '../ItemParts/ItemRepopulateButton';
|
|
24
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
24
25
|
function TextField(props) {
|
|
25
26
|
const { qItem, input, feedback, renderingExtensions, readOnly, calcExpUpdated, onInputChange, onRepopulateSync } = props;
|
|
26
27
|
const { displayPrompt, displayUnit, entryFormat, isRepopulatable } = renderingExtensions;
|
|
@@ -30,7 +31,7 @@ function TextField(props) {
|
|
|
30
31
|
readOnly: readOnly && readOnlyVisualStyle === 'readonly',
|
|
31
32
|
endAdornment: (_jsxs(InputAdornment, { position: "end", children: [_jsx(ExpressionUpdateFadingIcon, { fadeIn: calcExpUpdated, disabled: readOnly }), _jsx(ItemRepopulateButton, { qItem: qItem, repopulatable: isRepopulatable, onRepopulate: onRepopulateSync }), _jsx(DisplayUnitText, { readOnly: readOnly, children: displayUnit })] }))
|
|
32
33
|
}
|
|
33
|
-
}, helperText: feedback, "data-test": "q-item-text-field" }));
|
|
34
|
+
}, helperText: _jsx(AccessibleFeedback, { children: feedback }), "data-test": "q-item-text-field" }));
|
|
34
35
|
}
|
|
35
36
|
export default TextField;
|
|
36
37
|
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,0BAA0B,MAAM,yCAAyC,CAAC;AAGjF,OAAO,oBAAoB,MAAM,mCAAmC,CA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,mBAAmB,KAAK,UAAU;gBACxD,YAAY,EAAE,CACZ,MAAC,cAAc,IAAC,QAAQ,EAAC,KAAK,aAC5B,KAAC,0BAA0B,IAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAI,EAC1E,KAAC,oBAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,eAAe,EAC9B,YAAY,EAAE,gBAAgB,GAC9B,EACF,KAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,YAAG,WAAW,GAAmB,IACrD,CAClB;aACF;SACF,EACD,UAAU,EAAE,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,eACrD,mBAAmB,GAC7B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { StandardTextField } from '../Textfield.styles';
|
|
|
4
4
|
import { useRendererConfigStore } from '../../../stores';
|
|
5
5
|
import DisplayUnitText from '../ItemParts/DisplayUnitText';
|
|
6
6
|
import { ClearButtonAdornment } from '../ItemParts/ClearButtonAdornment';
|
|
7
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
7
8
|
function UrlField(props) {
|
|
8
9
|
const { linkId, itemType, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, isTabled, onInputChange } = props;
|
|
9
10
|
const readOnlyVisualStyle = useRendererConfigStore.use.readOnlyVisualStyle();
|
|
@@ -15,7 +16,7 @@ function UrlField(props) {
|
|
|
15
16
|
onInputChange('');
|
|
16
17
|
} }), _jsx(DisplayUnitText, { readOnly: readOnly, children: displayUnit })] }))
|
|
17
18
|
}
|
|
18
|
-
}, helperText: feedback, "data-test": "q-item-url-field" }));
|
|
19
|
+
}, helperText: _jsx(AccessibleFeedback, { children: feedback }), "data-test": "q-item-url-field" }));
|
|
19
20
|
}
|
|
20
21
|
export default UrlField;
|
|
21
22
|
//# sourceMappingURL=UrlField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlField.tsx"],"names":[],"mappings":";AAmBA,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"UrlField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlField.tsx"],"names":[],"mappings":";AAmBA,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AAcjE,SAAS,QAAQ,CAAC,KAAoB;IACpC,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,aAAa,EACd,GAAG,KAAK,CAAC;IAEV,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;IAC7E,MAAM,cAAc,GAAG,sBAAsB,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IAEnE,OAAO,CACL,KAAC,iBAAiB,IAChB,EAAE,EAAE,QAAQ,GAAG,GAAG,GAAG,MAAM,EAC3B,SAAS,QACT,SAAS,QACT,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACtD,WAAW,EAAE,WAAW,IAAI,aAAa,EACzC,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU,EACxD,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,QAAQ,EAAE,QAAQ,IAAI,mBAAmB,KAAK,UAAU;gBACxD,YAAY,EAAE,CACZ,MAAC,cAAc,IAAC,QAAQ,EAAC,KAAK,aAC5B,KAAC,oBAAoB,IACnB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;gCACZ,aAAa,CAAC,EAAE,CAAC,CAAC;4BACpB,CAAC,GACD,EACF,KAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,YAAG,WAAW,GAAmB,IACrD,CAClB;aACF;SACF,EACD,UAAU,EAAE,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,eACrD,kBAAkB,GAC5B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aehrc/smart-forms-renderer",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@mui/lab": "^7.0.0-beta.13",
|
|
40
40
|
"@mui/material": "^7.1.1",
|
|
41
41
|
"@mui/x-date-pickers": "^7.28.3",
|
|
42
|
-
"@tanstack/react-query": "^5.90.
|
|
42
|
+
"@tanstack/react-query": "^5.90.5",
|
|
43
43
|
"dayjs": "^1.11.18",
|
|
44
44
|
"deep-diff": "^1.0.2",
|
|
45
45
|
"fast-equals": "^5.2.2",
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@babel/core": "^7.
|
|
69
|
+
"@babel/core": "^7.28.5",
|
|
70
70
|
"@chromatic-com/storybook": "^4.1.1",
|
|
71
71
|
"@storybook/addon-docs": "^9.1.13",
|
|
72
72
|
"@storybook/addon-links": "^9.1.13",
|
|
73
73
|
"@storybook/addon-onboarding": "^9.1.13",
|
|
74
74
|
"@storybook/addon-themes": "^9.1.13",
|
|
75
75
|
"@storybook/react-vite": "^9.1.13",
|
|
76
|
-
"@storybook/test-runner": "^0.
|
|
76
|
+
"@storybook/test-runner": "^0.24.0",
|
|
77
77
|
"@testing-library/jest-dom": "^6.9.1",
|
|
78
78
|
"@testing-library/react": "^16.3.0",
|
|
79
79
|
"@types/deep-diff": "^1.0.5",
|
|
@@ -25,9 +25,10 @@ import Stack from '@mui/material/Stack';
|
|
|
25
25
|
import type { AttachmentValues } from './AttachmentItem';
|
|
26
26
|
import AttachmentUrlField from './AttachmentUrlField';
|
|
27
27
|
import { useRendererConfigStore } from '../../../stores';
|
|
28
|
-
import {
|
|
28
|
+
import { StyledFeedbackTypography } from '../Item.styles';
|
|
29
29
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
30
30
|
import { ClearButtonAdornment } from '../ItemParts/ClearButtonAdornment';
|
|
31
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
31
32
|
|
|
32
33
|
interface AttachmentFieldProps extends PropsWithIsTabledAttribute {
|
|
33
34
|
linkId: string;
|
|
@@ -132,7 +133,11 @@ function AttachmentField(props: AttachmentFieldProps) {
|
|
|
132
133
|
) : null}
|
|
133
134
|
</Stack>
|
|
134
135
|
|
|
135
|
-
{feedback ?
|
|
136
|
+
{feedback ? (
|
|
137
|
+
<AccessibleFeedback>
|
|
138
|
+
<StyledFeedbackTypography>{feedback}</StyledFeedbackTypography>
|
|
139
|
+
</AccessibleFeedback>
|
|
140
|
+
) : null}
|
|
136
141
|
</>
|
|
137
142
|
);
|
|
138
143
|
}
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { memo } from 'react';
|
|
18
|
+
import React, { memo } from 'react';
|
|
19
19
|
import Box from '@mui/material/Box';
|
|
20
20
|
import RadioGroup from '@mui/material/RadioGroup';
|
|
21
21
|
import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
|
|
22
22
|
import type { QuestionnaireItem } from 'fhir/r4';
|
|
23
23
|
import ChoiceRadioSingle from '../ChoiceItems/ChoiceRadioSingle';
|
|
24
|
-
import {
|
|
24
|
+
import { StyledFeedbackTypography } from '../Item.styles';
|
|
25
25
|
import { getChoiceOrientation } from '../../../utils/choice';
|
|
26
26
|
import ExpressionUpdateFadingIcon from '../ItemParts/ExpressionUpdateFadingIcon';
|
|
27
27
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
@@ -31,6 +31,7 @@ import { useRendererConfigStore } from '../../../stores';
|
|
|
31
31
|
import { StandardCheckbox } from '../../Checkbox.styles';
|
|
32
32
|
import { ariaCheckedMap } from '../../../utils/checkbox';
|
|
33
33
|
import { SrOnly } from '../SrOnly.styles';
|
|
34
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
34
35
|
|
|
35
36
|
interface BooleanFieldProps {
|
|
36
37
|
qItem: QuestionnaireItem;
|
|
@@ -59,6 +60,8 @@ const BooleanField = memo(function BooleanField(props: BooleanFieldProps) {
|
|
|
59
60
|
|
|
60
61
|
const ariaCheckedValue = ariaCheckedMap.get(selection ?? 'false');
|
|
61
62
|
|
|
63
|
+
const feedbackId = `${qItem.type}-${qItem.linkId}-feedback`;
|
|
64
|
+
|
|
62
65
|
return (
|
|
63
66
|
<>
|
|
64
67
|
<Box
|
|
@@ -78,6 +81,7 @@ const BooleanField = memo(function BooleanField(props: BooleanFieldProps) {
|
|
|
78
81
|
checked={selection === 'true'}
|
|
79
82
|
readOnly={readOnly && readOnlyVisualStyle === 'readonly'}
|
|
80
83
|
aria-readonly={readOnly && readOnlyVisualStyle === 'readonly'}
|
|
84
|
+
aria-describedby={feedback ? feedbackId : undefined}
|
|
81
85
|
role="checkbox"
|
|
82
86
|
aria-checked={ariaCheckedValue}
|
|
83
87
|
onChange={() => {
|
|
@@ -109,6 +113,7 @@ const BooleanField = memo(function BooleanField(props: BooleanFieldProps) {
|
|
|
109
113
|
row={orientation === ChoiceItemOrientation.Horizontal}
|
|
110
114
|
sx={inputsFlexGrow ? { width: '100%', flexWrap: 'nowrap' } : {}}
|
|
111
115
|
aria-readonly={readOnly && readOnlyVisualStyle === 'readonly'}
|
|
116
|
+
aria-describedby={feedback ? feedbackId : undefined}
|
|
112
117
|
onChange={(e) => {
|
|
113
118
|
// If item.readOnly=true, do not allow any changes
|
|
114
119
|
if (readOnly) {
|
|
@@ -168,7 +173,11 @@ const BooleanField = memo(function BooleanField(props: BooleanFieldProps) {
|
|
|
168
173
|
/>
|
|
169
174
|
</Box>
|
|
170
175
|
|
|
171
|
-
{feedback ?
|
|
176
|
+
{feedback ? (
|
|
177
|
+
<AccessibleFeedback id={feedbackId}>
|
|
178
|
+
<StyledFeedbackTypography>{feedback}</StyledFeedbackTypography>
|
|
179
|
+
</AccessibleFeedback>
|
|
180
|
+
) : null}
|
|
172
181
|
</>
|
|
173
182
|
);
|
|
174
183
|
});
|
|
@@ -24,10 +24,10 @@ import type {
|
|
|
24
24
|
import { useRendererConfigStore } from '../../../stores';
|
|
25
25
|
import { compareAnswerOptionValue, isOptionDisabled } from '../../../utils/choice';
|
|
26
26
|
import { getAnswerOptionLabel } from '../../../utils/openChoice';
|
|
27
|
-
import { StyledRequiredTypography } from '../Item.styles';
|
|
28
27
|
import DisplayUnitText from '../ItemParts/DisplayUnitText';
|
|
29
28
|
import ExpressionUpdateFadingIcon from '../ItemParts/ExpressionUpdateFadingIcon';
|
|
30
29
|
import { StandardTextField } from '../Textfield.styles';
|
|
30
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
31
31
|
|
|
32
32
|
interface ChoiceSelectAnswerOptionFieldsProps
|
|
33
33
|
extends PropsWithIsTabledAttribute,
|
|
@@ -82,6 +82,7 @@ function ChoiceSelectAnswerOptionFields(props: ChoiceSelectAnswerOptionFieldsPro
|
|
|
82
82
|
textFieldWidth={textFieldWidth}
|
|
83
83
|
isTabled={isTabled}
|
|
84
84
|
placeholder={entryFormat || displayPrompt}
|
|
85
|
+
helperText={<AccessibleFeedback>{feedback}</AccessibleFeedback>}
|
|
85
86
|
{...params}
|
|
86
87
|
slotProps={{
|
|
87
88
|
input: {
|
|
@@ -99,8 +100,6 @@ function ChoiceSelectAnswerOptionFields(props: ChoiceSelectAnswerOptionFieldsPro
|
|
|
99
100
|
/>
|
|
100
101
|
)}
|
|
101
102
|
/>
|
|
102
|
-
|
|
103
|
-
{feedback ? <StyledRequiredTypography>{feedback}</StyledRequiredTypography> : null}
|
|
104
103
|
</>
|
|
105
104
|
);
|
|
106
105
|
}
|
|
@@ -28,9 +28,10 @@ import { useRendererConfigStore } from '../../../stores';
|
|
|
28
28
|
import { isCodingDisabled } from '../../../utils/choice';
|
|
29
29
|
import ExpressionUpdateFadingIcon from '../ItemParts/ExpressionUpdateFadingIcon';
|
|
30
30
|
import { StyledAlert } from '../../Alert.styles';
|
|
31
|
-
import { StyledRequiredTypography } from '../Item.styles';
|
|
32
31
|
import DisplayUnitText from '../ItemParts/DisplayUnitText';
|
|
33
32
|
import { StandardTextField } from '../Textfield.styles';
|
|
33
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
34
|
+
import React from 'react';
|
|
34
35
|
|
|
35
36
|
interface ChoiceSelectAnswerValueSetFieldsProps
|
|
36
37
|
extends PropsWithIsTabledAttribute,
|
|
@@ -89,6 +90,7 @@ function ChoiceSelectAnswerValueSetFields(props: ChoiceSelectAnswerValueSetField
|
|
|
89
90
|
textFieldWidth={textFieldWidth}
|
|
90
91
|
isTabled={isTabled}
|
|
91
92
|
placeholder={entryFormat || displayPrompt}
|
|
93
|
+
helperText={<AccessibleFeedback>{feedback}</AccessibleFeedback>}
|
|
92
94
|
{...params}
|
|
93
95
|
slotProps={{
|
|
94
96
|
input: {
|
|
@@ -113,8 +115,6 @@ function ChoiceSelectAnswerValueSetFields(props: ChoiceSelectAnswerValueSetField
|
|
|
113
115
|
/>
|
|
114
116
|
)}
|
|
115
117
|
/>
|
|
116
|
-
|
|
117
|
-
{feedback ? <StyledRequiredTypography>{feedback}</StyledRequiredTypography> : null}
|
|
118
118
|
</>
|
|
119
119
|
);
|
|
120
120
|
}
|
|
@@ -24,6 +24,7 @@ import { StandardTextField } from '../../Textfield.styles';
|
|
|
24
24
|
import DatePicker from './DatePicker';
|
|
25
25
|
import { useRendererConfigStore } from '../../../../stores';
|
|
26
26
|
import ExpressionUpdateFadingIcon from '../../ItemParts/ExpressionUpdateFadingIcon';
|
|
27
|
+
import AccessibleFeedback from '../../ItemParts/AccessibleFeedback';
|
|
27
28
|
|
|
28
29
|
interface CustomDateFieldProps extends PropsWithIsTabledAttribute {
|
|
29
30
|
linkId: string;
|
|
@@ -119,7 +120,7 @@ function CustomDateField(props: CustomDateFieldProps) {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
}}
|
|
122
|
-
helperText={feedback}
|
|
123
|
+
helperText={<AccessibleFeedback>{feedback}</AccessibleFeedback>}
|
|
123
124
|
/>
|
|
124
125
|
);
|
|
125
126
|
}
|
|
@@ -25,6 +25,7 @@ import type { PropsWithIsTabledAttribute } from '../../../../interfaces/renderPr
|
|
|
25
25
|
import { useRendererConfigStore } from '../../../../stores';
|
|
26
26
|
import FormControl from '@mui/material/FormControl';
|
|
27
27
|
import MuiTextField from '../../TextItem/MuiTextField';
|
|
28
|
+
import AccessibleFeedback from '../../ItemParts/AccessibleFeedback';
|
|
28
29
|
|
|
29
30
|
interface CustomTimeFieldProps extends PropsWithIsTabledAttribute {
|
|
30
31
|
linkId: string;
|
|
@@ -113,9 +114,11 @@ function CustomTimeField(props: CustomTimeFieldProps) {
|
|
|
113
114
|
</Select>
|
|
114
115
|
</FormControl>
|
|
115
116
|
</Box>
|
|
116
|
-
<
|
|
117
|
-
{
|
|
118
|
-
|
|
117
|
+
<AccessibleFeedback>
|
|
118
|
+
<Typography component="span" variant="caption" color="error" sx={{ ml: 1.75, mt: -0.5 }}>
|
|
119
|
+
{feedback}
|
|
120
|
+
</Typography>
|
|
121
|
+
</AccessibleFeedback>
|
|
119
122
|
</>
|
|
120
123
|
);
|
|
121
124
|
}
|
|
@@ -25,6 +25,7 @@ import ItemRepopulateButton from '../ItemParts/ItemRepopulateButton';
|
|
|
25
25
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
26
26
|
import type { RenderingExtensions } from '../../../hooks/useRenderingExtensions';
|
|
27
27
|
import { StandardTextField } from '../Textfield.styles';
|
|
28
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
28
29
|
|
|
29
30
|
interface DecimalFieldProps extends PropsWithIsTabledAttribute {
|
|
30
31
|
qItem: QuestionnaireItem;
|
|
@@ -74,7 +75,7 @@ function DecimalField(props: DecimalFieldProps) {
|
|
|
74
75
|
id={inputId}
|
|
75
76
|
value={input}
|
|
76
77
|
error={!!feedback}
|
|
77
|
-
helperText={feedback}
|
|
78
|
+
helperText={<AccessibleFeedback>{feedback}</AccessibleFeedback>}
|
|
78
79
|
onChange={(event) => onInputChange(event.target.value)}
|
|
79
80
|
disabled={readOnly && readOnlyVisualStyle === 'disabled'}
|
|
80
81
|
placeholder={placeholderText}
|
|
@@ -25,6 +25,7 @@ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
|
25
25
|
import ItemRepopulateButton from '../ItemParts/ItemRepopulateButton';
|
|
26
26
|
import type { RenderingExtensions } from '../../../hooks/useRenderingExtensions';
|
|
27
27
|
import { StandardTextField } from '../Textfield.styles';
|
|
28
|
+
import AccessibleFeedback from '../ItemParts/AccessibleFeedback';
|
|
28
29
|
|
|
29
30
|
interface IntegerFieldProps extends PropsWithIsTabledAttribute {
|
|
30
31
|
qItem: QuestionnaireItem;
|
|
@@ -74,7 +75,7 @@ function IntegerField(props: IntegerFieldProps) {
|
|
|
74
75
|
id={inputId}
|
|
75
76
|
value={input}
|
|
76
77
|
error={!!feedback}
|
|
77
|
-
helperText={feedback}
|
|
78
|
+
helperText={<AccessibleFeedback>{feedback}</AccessibleFeedback>}
|
|
78
79
|
onChange={(event) => onInputChange(event.target.value)}
|
|
79
80
|
disabled={readOnly && readOnlyVisualStyle === 'disabled'}
|
|
80
81
|
label={displayPrompt}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { styled } from '@mui/material/styles';
|
|
19
19
|
import Typography from '@mui/material/Typography';
|
|
20
20
|
|
|
21
|
-
export const
|
|
21
|
+
export const StyledFeedbackTypography = styled(Typography)(({ theme }) => ({
|
|
22
22
|
color: theme.palette.error.main,
|
|
23
23
|
fontSize: '0.75rem',
|
|
24
24
|
marginTop: 4
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { type ReactNode } from 'react';
|
|
19
|
+
|
|
20
|
+
interface AccessibleFeedbackProps {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
id?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function AccessibleFeedback(props: AccessibleFeedbackProps) {
|
|
26
|
+
const { children, id } = props;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<span id={id} role="alert" aria-live="assertive">
|
|
30
|
+
{children}
|
|
31
|
+
</span>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default AccessibleFeedback;
|
|
@@ -10,9 +10,10 @@ import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
|
|
|
10
10
|
import { useRendererConfigStore } from '../../../stores';
|
|
11
11
|
import { getChoiceOrientation } from '../../../utils/choice';
|
|
12
12
|
import CheckboxOptionList from '../ChoiceItems/CheckboxOptionList';
|
|
13
|
-
import {
|
|
13
|
+
import { StyledFeedbackTypography } from '../Item.styles';
|
|
14
14
|
import ClearInputButton from './ClearInputButton';
|
|
15
15
|
import ExpressionUpdateFadingIcon from './ExpressionUpdateFadingIcon';
|
|
16
|
+
import AccessibleFeedback from './AccessibleFeedback';
|
|
16
17
|
|
|
17
18
|
interface ChoiceCheckboxFormGroupProps {
|
|
18
19
|
qItem: QuestionnaireItem;
|
|
@@ -50,6 +51,8 @@ function CheckboxFormGroup(props: ChoiceCheckboxFormGroupProps) {
|
|
|
50
51
|
|
|
51
52
|
const answersEmpty = answers.length === 0;
|
|
52
53
|
|
|
54
|
+
const feedbackId = `${qItem.type}-${qItem.linkId}-feedback`;
|
|
55
|
+
|
|
53
56
|
return (
|
|
54
57
|
<>
|
|
55
58
|
<Box
|
|
@@ -68,6 +71,7 @@ function CheckboxFormGroup(props: ChoiceCheckboxFormGroupProps) {
|
|
|
68
71
|
{...(!isTabled
|
|
69
72
|
? { 'aria-labelledby': 'label-' + qItem.linkId }
|
|
70
73
|
: { 'aria-label': qItem.text ?? 'Unnamed checkbox list' })}
|
|
74
|
+
aria-describedby={feedback ? feedbackId : undefined}
|
|
71
75
|
role="group"
|
|
72
76
|
row={orientation === ChoiceItemOrientation.Horizontal}
|
|
73
77
|
sx={inputsFlexGrow ? { width: '100%', flexWrap: 'nowrap' } : {}}>
|
|
@@ -91,7 +95,11 @@ function CheckboxFormGroup(props: ChoiceCheckboxFormGroupProps) {
|
|
|
91
95
|
<ClearInputButton buttonShown={!answersEmpty} readOnly={readOnly} onClear={onClear} />
|
|
92
96
|
</Box>
|
|
93
97
|
|
|
94
|
-
{feedback ?
|
|
98
|
+
{feedback ? (
|
|
99
|
+
<AccessibleFeedback id={feedbackId}>
|
|
100
|
+
<StyledFeedbackTypography>{feedback}</StyledFeedbackTypography>
|
|
101
|
+
</AccessibleFeedback>
|
|
102
|
+
) : null}
|
|
95
103
|
</>
|
|
96
104
|
);
|
|
97
105
|
}
|